main_2018_b.js 2.5 MB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988209892099020991209922099320994209952099620997209982099921000210012100221003210042100521006210072100821009210102101121012210132101421015210162101721018210192102021021210222102321024210252102621027210282102921030210312103221033210342103521036210372103821039210402104121042210432104421045210462104721048210492105021051210522105321054210552105621057210582105921060210612106221063210642106521066210672106821069210702107121072210732107421075210762107721078210792108021081210822108321084210852108621087210882108921090210912109221093210942109521096210972109821099211002110121102211032110421105211062110721108211092111021111211122111321114211152111621117211182111921120211212112221123211242112521126211272112821129211302113121132211332113421135211362113721138211392114021141211422114321144211452114621147211482114921150211512115221153211542115521156211572115821159211602116121162211632116421165211662116721168211692117021171211722117321174211752117621177211782117921180211812118221183211842118521186211872118821189211902119121192211932119421195211962119721198211992120021201212022120321204212052120621207212082120921210212112121221213212142121521216212172121821219212202122121222212232122421225212262122721228212292123021231212322123321234212352123621237212382123921240212412124221243212442124521246212472124821249212502125121252212532125421255212562125721258212592126021261212622126321264212652126621267212682126921270212712127221273212742127521276212772127821279212802128121282212832128421285212862128721288212892129021291212922129321294212952129621297212982129921300213012130221303213042130521306213072130821309213102131121312213132131421315213162131721318213192132021321213222132321324213252132621327213282132921330213312133221333213342133521336213372133821339213402134121342213432134421345213462134721348213492135021351213522135321354213552135621357213582135921360213612136221363213642136521366213672136821369213702137121372213732137421375213762137721378213792138021381213822138321384213852138621387213882138921390213912139221393213942139521396213972139821399214002140121402214032140421405214062140721408214092141021411214122141321414214152141621417214182141921420214212142221423214242142521426214272142821429214302143121432214332143421435214362143721438214392144021441214422144321444214452144621447214482144921450214512145221453214542145521456214572145821459214602146121462214632146421465214662146721468214692147021471214722147321474214752147621477214782147921480214812148221483214842148521486214872148821489214902149121492214932149421495214962149721498214992150021501215022150321504215052150621507215082150921510215112151221513215142151521516215172151821519215202152121522215232152421525215262152721528215292153021531215322153321534215352153621537215382153921540215412154221543215442154521546215472154821549215502155121552215532155421555215562155721558215592156021561215622156321564215652156621567215682156921570215712157221573215742157521576215772157821579215802158121582215832158421585215862158721588215892159021591215922159321594215952159621597215982159921600216012160221603216042160521606216072160821609216102161121612216132161421615216162161721618216192162021621216222162321624216252162621627216282162921630216312163221633216342163521636216372163821639216402164121642216432164421645216462164721648216492165021651216522165321654216552165621657216582165921660216612166221663216642166521666216672166821669216702167121672216732167421675216762167721678216792168021681216822168321684216852168621687216882168921690216912169221693216942169521696216972169821699217002170121702217032170421705217062170721708217092171021711217122171321714217152171621717217182171921720217212172221723217242172521726217272172821729217302173121732217332173421735217362173721738217392174021741217422174321744217452174621747217482174921750217512175221753217542175521756217572175821759217602176121762217632176421765217662176721768217692177021771217722177321774217752177621777217782177921780217812178221783217842178521786217872178821789217902179121792217932179421795217962179721798217992180021801218022180321804218052180621807218082180921810218112181221813218142181521816218172181821819218202182121822218232182421825218262182721828218292183021831218322183321834218352183621837218382183921840218412184221843218442184521846218472184821849218502185121852218532185421855218562185721858218592186021861218622186321864218652186621867218682186921870218712187221873218742187521876218772187821879218802188121882218832188421885218862188721888218892189021891218922189321894218952189621897218982189921900219012190221903219042190521906219072190821909219102191121912219132191421915219162191721918219192192021921219222192321924219252192621927219282192921930219312193221933219342193521936219372193821939219402194121942219432194421945219462194721948219492195021951219522195321954219552195621957219582195921960219612196221963219642196521966219672196821969219702197121972219732197421975219762197721978219792198021981219822198321984219852198621987219882198921990219912199221993219942199521996219972199821999220002200122002220032200422005220062200722008220092201022011220122201322014220152201622017220182201922020220212202222023220242202522026220272202822029220302203122032220332203422035220362203722038220392204022041220422204322044220452204622047220482204922050220512205222053220542205522056220572205822059220602206122062220632206422065220662206722068220692207022071220722207322074220752207622077220782207922080220812208222083220842208522086220872208822089220902209122092220932209422095220962209722098220992210022101221022210322104221052210622107221082210922110221112211222113221142211522116221172211822119221202212122122221232212422125221262212722128221292213022131221322213322134221352213622137221382213922140221412214222143221442214522146221472214822149221502215122152221532215422155221562215722158221592216022161221622216322164221652216622167221682216922170221712217222173221742217522176221772217822179221802218122182221832218422185221862218722188221892219022191221922219322194221952219622197221982219922200222012220222203222042220522206222072220822209222102221122212222132221422215222162221722218222192222022221222222222322224222252222622227222282222922230222312223222233222342223522236222372223822239222402224122242222432224422245222462224722248222492225022251222522225322254222552225622257222582225922260222612226222263222642226522266222672226822269222702227122272222732227422275222762227722278222792228022281222822228322284222852228622287222882228922290222912229222293222942229522296222972229822299223002230122302223032230422305223062230722308223092231022311223122231322314223152231622317223182231922320223212232222323223242232522326223272232822329223302233122332223332233422335223362233722338223392234022341223422234322344223452234622347223482234922350223512235222353223542235522356223572235822359223602236122362223632236422365223662236722368223692237022371223722237322374223752237622377223782237922380223812238222383223842238522386223872238822389223902239122392223932239422395223962239722398223992240022401224022240322404224052240622407224082240922410224112241222413224142241522416224172241822419224202242122422224232242422425224262242722428224292243022431224322243322434224352243622437224382243922440224412244222443224442244522446224472244822449224502245122452224532245422455224562245722458224592246022461224622246322464224652246622467224682246922470224712247222473224742247522476224772247822479224802248122482224832248422485224862248722488224892249022491224922249322494224952249622497224982249922500225012250222503225042250522506225072250822509225102251122512225132251422515225162251722518225192252022521225222252322524225252252622527225282252922530225312253222533225342253522536225372253822539225402254122542225432254422545225462254722548225492255022551225522255322554225552255622557225582255922560225612256222563225642256522566225672256822569225702257122572225732257422575225762257722578225792258022581225822258322584225852258622587225882258922590225912259222593225942259522596225972259822599226002260122602226032260422605226062260722608226092261022611226122261322614226152261622617226182261922620226212262222623226242262522626226272262822629226302263122632226332263422635226362263722638226392264022641226422264322644226452264622647226482264922650226512265222653226542265522656226572265822659226602266122662226632266422665226662266722668226692267022671226722267322674226752267622677226782267922680226812268222683226842268522686226872268822689226902269122692226932269422695226962269722698226992270022701227022270322704227052270622707227082270922710227112271222713227142271522716227172271822719227202272122722227232272422725227262272722728227292273022731227322273322734227352273622737227382273922740227412274222743227442274522746227472274822749227502275122752227532275422755227562275722758227592276022761227622276322764227652276622767227682276922770227712277222773227742277522776227772277822779227802278122782227832278422785227862278722788227892279022791227922279322794227952279622797227982279922800228012280222803228042280522806228072280822809228102281122812228132281422815228162281722818228192282022821228222282322824228252282622827228282282922830228312283222833228342283522836228372283822839228402284122842228432284422845228462284722848228492285022851228522285322854228552285622857228582285922860228612286222863228642286522866228672286822869228702287122872228732287422875228762287722878228792288022881228822288322884228852288622887228882288922890228912289222893228942289522896228972289822899229002290122902229032290422905229062290722908229092291022911229122291322914229152291622917229182291922920229212292222923229242292522926229272292822929229302293122932229332293422935229362293722938229392294022941229422294322944229452294622947229482294922950229512295222953229542295522956229572295822959229602296122962229632296422965229662296722968229692297022971229722297322974229752297622977229782297922980229812298222983229842298522986229872298822989229902299122992229932299422995229962299722998229992300023001230022300323004230052300623007230082300923010230112301223013230142301523016230172301823019230202302123022230232302423025230262302723028230292303023031230322303323034230352303623037230382303923040230412304223043230442304523046230472304823049230502305123052230532305423055230562305723058230592306023061230622306323064230652306623067230682306923070230712307223073230742307523076230772307823079230802308123082230832308423085230862308723088230892309023091230922309323094230952309623097230982309923100231012310223103231042310523106231072310823109231102311123112231132311423115231162311723118231192312023121231222312323124231252312623127231282312923130231312313223133231342313523136231372313823139231402314123142231432314423145231462314723148231492315023151231522315323154231552315623157231582315923160231612316223163231642316523166231672316823169231702317123172231732317423175231762317723178231792318023181231822318323184231852318623187231882318923190231912319223193231942319523196231972319823199232002320123202232032320423205232062320723208232092321023211232122321323214232152321623217232182321923220232212322223223232242322523226232272322823229232302323123232232332323423235232362323723238232392324023241232422324323244232452324623247232482324923250232512325223253232542325523256232572325823259232602326123262232632326423265232662326723268232692327023271232722327323274232752327623277232782327923280232812328223283232842328523286232872328823289232902329123292232932329423295232962329723298232992330023301233022330323304233052330623307233082330923310233112331223313233142331523316233172331823319233202332123322233232332423325233262332723328233292333023331233322333323334233352333623337233382333923340233412334223343233442334523346233472334823349233502335123352233532335423355233562335723358233592336023361233622336323364233652336623367233682336923370233712337223373233742337523376233772337823379233802338123382233832338423385233862338723388233892339023391233922339323394233952339623397233982339923400234012340223403234042340523406234072340823409234102341123412234132341423415234162341723418234192342023421234222342323424234252342623427234282342923430234312343223433234342343523436234372343823439234402344123442234432344423445234462344723448234492345023451234522345323454234552345623457234582345923460234612346223463234642346523466234672346823469234702347123472234732347423475234762347723478234792348023481234822348323484234852348623487234882348923490234912349223493234942349523496234972349823499235002350123502235032350423505235062350723508235092351023511235122351323514235152351623517235182351923520235212352223523235242352523526235272352823529235302353123532235332353423535235362353723538235392354023541235422354323544235452354623547235482354923550235512355223553235542355523556235572355823559235602356123562235632356423565235662356723568235692357023571235722357323574235752357623577235782357923580235812358223583235842358523586235872358823589235902359123592235932359423595235962359723598235992360023601236022360323604236052360623607236082360923610236112361223613236142361523616236172361823619236202362123622236232362423625236262362723628236292363023631236322363323634236352363623637236382363923640236412364223643236442364523646236472364823649236502365123652236532365423655236562365723658236592366023661236622366323664236652366623667236682366923670236712367223673236742367523676236772367823679236802368123682236832368423685236862368723688236892369023691236922369323694236952369623697236982369923700237012370223703237042370523706237072370823709237102371123712237132371423715237162371723718237192372023721237222372323724237252372623727237282372923730237312373223733237342373523736237372373823739237402374123742237432374423745237462374723748237492375023751237522375323754237552375623757237582375923760237612376223763237642376523766237672376823769237702377123772237732377423775237762377723778237792378023781237822378323784237852378623787237882378923790237912379223793237942379523796237972379823799238002380123802238032380423805238062380723808238092381023811238122381323814238152381623817238182381923820238212382223823238242382523826238272382823829238302383123832238332383423835238362383723838238392384023841238422384323844238452384623847238482384923850238512385223853238542385523856238572385823859238602386123862238632386423865238662386723868238692387023871238722387323874238752387623877238782387923880238812388223883238842388523886238872388823889238902389123892238932389423895238962389723898238992390023901239022390323904239052390623907239082390923910239112391223913239142391523916239172391823919239202392123922239232392423925239262392723928239292393023931239322393323934239352393623937239382393923940239412394223943239442394523946239472394823949239502395123952239532395423955239562395723958239592396023961239622396323964239652396623967239682396923970239712397223973239742397523976239772397823979239802398123982239832398423985239862398723988239892399023991239922399323994239952399623997239982399924000240012400224003240042400524006240072400824009240102401124012240132401424015240162401724018240192402024021240222402324024240252402624027240282402924030240312403224033240342403524036240372403824039240402404124042240432404424045240462404724048240492405024051240522405324054240552405624057240582405924060240612406224063240642406524066240672406824069240702407124072240732407424075240762407724078240792408024081240822408324084240852408624087240882408924090240912409224093240942409524096240972409824099241002410124102241032410424105241062410724108241092411024111241122411324114241152411624117241182411924120241212412224123241242412524126241272412824129241302413124132241332413424135241362413724138241392414024141241422414324144241452414624147241482414924150241512415224153241542415524156241572415824159241602416124162241632416424165241662416724168241692417024171241722417324174241752417624177241782417924180241812418224183241842418524186241872418824189241902419124192241932419424195241962419724198241992420024201242022420324204242052420624207242082420924210242112421224213242142421524216242172421824219242202422124222242232422424225242262422724228242292423024231242322423324234242352423624237242382423924240242412424224243242442424524246242472424824249242502425124252242532425424255242562425724258242592426024261242622426324264242652426624267242682426924270242712427224273242742427524276242772427824279242802428124282242832428424285242862428724288242892429024291242922429324294242952429624297242982429924300243012430224303243042430524306243072430824309243102431124312243132431424315243162431724318243192432024321243222432324324243252432624327243282432924330243312433224333243342433524336243372433824339243402434124342243432434424345243462434724348243492435024351243522435324354243552435624357243582435924360243612436224363243642436524366243672436824369243702437124372243732437424375243762437724378243792438024381243822438324384243852438624387243882438924390243912439224393243942439524396243972439824399244002440124402244032440424405244062440724408244092441024411244122441324414244152441624417244182441924420244212442224423244242442524426244272442824429244302443124432244332443424435244362443724438244392444024441244422444324444244452444624447244482444924450244512445224453244542445524456244572445824459244602446124462244632446424465244662446724468244692447024471244722447324474244752447624477244782447924480244812448224483244842448524486244872448824489244902449124492244932449424495244962449724498244992450024501245022450324504245052450624507245082450924510245112451224513245142451524516245172451824519245202452124522245232452424525245262452724528245292453024531245322453324534245352453624537245382453924540245412454224543245442454524546245472454824549245502455124552245532455424555245562455724558245592456024561245622456324564245652456624567245682456924570245712457224573245742457524576245772457824579245802458124582245832458424585245862458724588245892459024591245922459324594245952459624597245982459924600246012460224603246042460524606246072460824609246102461124612246132461424615246162461724618246192462024621246222462324624246252462624627246282462924630246312463224633246342463524636246372463824639246402464124642246432464424645246462464724648246492465024651246522465324654246552465624657246582465924660246612466224663246642466524666246672466824669246702467124672246732467424675246762467724678246792468024681246822468324684246852468624687246882468924690246912469224693246942469524696246972469824699247002470124702247032470424705247062470724708247092471024711247122471324714247152471624717247182471924720247212472224723247242472524726247272472824729247302473124732247332473424735247362473724738247392474024741247422474324744247452474624747247482474924750247512475224753247542475524756247572475824759247602476124762247632476424765247662476724768247692477024771247722477324774247752477624777247782477924780247812478224783247842478524786247872478824789247902479124792247932479424795247962479724798247992480024801248022480324804248052480624807248082480924810248112481224813248142481524816248172481824819248202482124822248232482424825248262482724828248292483024831248322483324834248352483624837248382483924840248412484224843248442484524846248472484824849248502485124852248532485424855248562485724858248592486024861248622486324864248652486624867248682486924870248712487224873248742487524876248772487824879248802488124882248832488424885248862488724888248892489024891248922489324894248952489624897248982489924900249012490224903249042490524906249072490824909249102491124912249132491424915249162491724918249192492024921249222492324924249252492624927249282492924930249312493224933249342493524936249372493824939249402494124942249432494424945249462494724948249492495024951249522495324954249552495624957249582495924960249612496224963249642496524966249672496824969249702497124972249732497424975249762497724978249792498024981249822498324984249852498624987249882498924990249912499224993249942499524996249972499824999250002500125002250032500425005250062500725008250092501025011250122501325014250152501625017250182501925020250212502225023250242502525026250272502825029250302503125032250332503425035250362503725038250392504025041250422504325044250452504625047250482504925050250512505225053250542505525056250572505825059250602506125062250632506425065250662506725068250692507025071250722507325074250752507625077250782507925080250812508225083250842508525086250872508825089250902509125092250932509425095250962509725098250992510025101251022510325104251052510625107251082510925110251112511225113251142511525116251172511825119251202512125122251232512425125251262512725128251292513025131251322513325134251352513625137251382513925140251412514225143251442514525146251472514825149251502515125152251532515425155251562515725158251592516025161251622516325164251652516625167251682516925170251712517225173251742517525176251772517825179251802518125182251832518425185251862518725188251892519025191251922519325194251952519625197251982519925200252012520225203252042520525206252072520825209252102521125212252132521425215252162521725218252192522025221252222522325224252252522625227252282522925230252312523225233252342523525236252372523825239252402524125242252432524425245252462524725248252492525025251252522525325254252552525625257252582525925260252612526225263252642526525266252672526825269252702527125272252732527425275252762527725278252792528025281252822528325284252852528625287252882528925290252912529225293252942529525296252972529825299253002530125302253032530425305253062530725308253092531025311253122531325314253152531625317253182531925320253212532225323253242532525326253272532825329253302533125332253332533425335253362533725338253392534025341253422534325344253452534625347253482534925350253512535225353253542535525356253572535825359253602536125362253632536425365253662536725368253692537025371253722537325374253752537625377253782537925380253812538225383253842538525386253872538825389253902539125392253932539425395253962539725398253992540025401254022540325404254052540625407254082540925410254112541225413254142541525416254172541825419254202542125422254232542425425254262542725428254292543025431254322543325434254352543625437254382543925440254412544225443254442544525446254472544825449254502545125452254532545425455254562545725458254592546025461254622546325464254652546625467254682546925470254712547225473254742547525476254772547825479254802548125482254832548425485254862548725488254892549025491254922549325494254952549625497254982549925500255012550225503255042550525506255072550825509255102551125512255132551425515255162551725518255192552025521255222552325524255252552625527255282552925530255312553225533255342553525536255372553825539255402554125542255432554425545255462554725548255492555025551255522555325554255552555625557255582555925560255612556225563255642556525566255672556825569255702557125572255732557425575255762557725578255792558025581255822558325584255852558625587255882558925590255912559225593255942559525596255972559825599256002560125602256032560425605256062560725608256092561025611256122561325614256152561625617256182561925620256212562225623256242562525626256272562825629256302563125632256332563425635256362563725638256392564025641256422564325644256452564625647256482564925650256512565225653256542565525656256572565825659256602566125662256632566425665256662566725668256692567025671256722567325674256752567625677256782567925680256812568225683256842568525686256872568825689256902569125692256932569425695256962569725698256992570025701257022570325704257052570625707257082570925710257112571225713257142571525716257172571825719257202572125722257232572425725257262572725728257292573025731257322573325734257352573625737257382573925740257412574225743257442574525746257472574825749257502575125752257532575425755257562575725758257592576025761257622576325764257652576625767257682576925770257712577225773257742577525776257772577825779257802578125782257832578425785257862578725788257892579025791257922579325794257952579625797257982579925800258012580225803258042580525806258072580825809258102581125812258132581425815258162581725818258192582025821258222582325824258252582625827258282582925830258312583225833258342583525836258372583825839258402584125842258432584425845258462584725848258492585025851258522585325854258552585625857258582585925860258612586225863258642586525866258672586825869258702587125872258732587425875258762587725878258792588025881258822588325884258852588625887258882588925890258912589225893258942589525896258972589825899259002590125902259032590425905259062590725908259092591025911259122591325914259152591625917259182591925920259212592225923259242592525926259272592825929259302593125932259332593425935259362593725938259392594025941259422594325944259452594625947259482594925950259512595225953259542595525956259572595825959259602596125962259632596425965259662596725968259692597025971259722597325974259752597625977259782597925980259812598225983259842598525986259872598825989259902599125992259932599425995259962599725998259992600026001260022600326004260052600626007260082600926010260112601226013260142601526016260172601826019260202602126022260232602426025260262602726028260292603026031260322603326034260352603626037260382603926040260412604226043260442604526046260472604826049260502605126052260532605426055260562605726058260592606026061260622606326064260652606626067260682606926070260712607226073260742607526076260772607826079260802608126082260832608426085260862608726088260892609026091260922609326094260952609626097260982609926100261012610226103261042610526106261072610826109261102611126112261132611426115261162611726118261192612026121261222612326124261252612626127261282612926130261312613226133261342613526136261372613826139261402614126142261432614426145261462614726148261492615026151261522615326154261552615626157261582615926160261612616226163261642616526166261672616826169261702617126172261732617426175261762617726178261792618026181261822618326184261852618626187261882618926190261912619226193261942619526196261972619826199262002620126202262032620426205262062620726208262092621026211262122621326214262152621626217262182621926220262212622226223262242622526226262272622826229262302623126232262332623426235262362623726238262392624026241262422624326244262452624626247262482624926250262512625226253262542625526256262572625826259262602626126262262632626426265262662626726268262692627026271262722627326274262752627626277262782627926280262812628226283262842628526286262872628826289262902629126292262932629426295262962629726298262992630026301263022630326304263052630626307263082630926310263112631226313263142631526316263172631826319263202632126322263232632426325263262632726328263292633026331263322633326334263352633626337263382633926340263412634226343263442634526346263472634826349263502635126352263532635426355263562635726358263592636026361263622636326364263652636626367263682636926370263712637226373263742637526376263772637826379263802638126382263832638426385263862638726388263892639026391263922639326394263952639626397263982639926400264012640226403264042640526406264072640826409264102641126412264132641426415264162641726418264192642026421264222642326424264252642626427264282642926430264312643226433264342643526436264372643826439264402644126442264432644426445264462644726448264492645026451264522645326454264552645626457264582645926460264612646226463264642646526466264672646826469264702647126472264732647426475264762647726478264792648026481264822648326484264852648626487264882648926490264912649226493264942649526496264972649826499265002650126502265032650426505265062650726508265092651026511265122651326514265152651626517265182651926520265212652226523265242652526526265272652826529265302653126532265332653426535265362653726538265392654026541265422654326544265452654626547265482654926550265512655226553265542655526556265572655826559265602656126562265632656426565265662656726568265692657026571265722657326574265752657626577265782657926580265812658226583265842658526586265872658826589265902659126592265932659426595265962659726598265992660026601266022660326604266052660626607266082660926610266112661226613266142661526616266172661826619266202662126622266232662426625266262662726628266292663026631266322663326634266352663626637266382663926640266412664226643266442664526646266472664826649266502665126652266532665426655266562665726658266592666026661266622666326664266652666626667266682666926670266712667226673266742667526676266772667826679266802668126682266832668426685266862668726688266892669026691266922669326694266952669626697266982669926700267012670226703267042670526706267072670826709267102671126712267132671426715267162671726718267192672026721267222672326724267252672626727267282672926730267312673226733267342673526736267372673826739267402674126742267432674426745267462674726748267492675026751267522675326754267552675626757267582675926760267612676226763267642676526766267672676826769267702677126772267732677426775267762677726778267792678026781267822678326784267852678626787267882678926790267912679226793267942679526796267972679826799268002680126802268032680426805268062680726808268092681026811268122681326814268152681626817268182681926820268212682226823268242682526826268272682826829268302683126832268332683426835268362683726838268392684026841268422684326844268452684626847268482684926850268512685226853268542685526856268572685826859268602686126862268632686426865268662686726868268692687026871268722687326874268752687626877268782687926880268812688226883268842688526886268872688826889268902689126892268932689426895268962689726898268992690026901269022690326904269052690626907269082690926910269112691226913269142691526916269172691826919269202692126922269232692426925269262692726928269292693026931269322693326934269352693626937269382693926940269412694226943269442694526946269472694826949269502695126952269532695426955269562695726958269592696026961269622696326964269652696626967269682696926970269712697226973269742697526976269772697826979269802698126982269832698426985269862698726988269892699026991269922699326994269952699626997269982699927000270012700227003270042700527006270072700827009270102701127012270132701427015270162701727018270192702027021270222702327024270252702627027270282702927030270312703227033270342703527036270372703827039270402704127042270432704427045270462704727048270492705027051270522705327054270552705627057270582705927060270612706227063270642706527066270672706827069270702707127072270732707427075270762707727078270792708027081270822708327084270852708627087270882708927090270912709227093270942709527096270972709827099271002710127102271032710427105271062710727108271092711027111271122711327114271152711627117271182711927120271212712227123271242712527126271272712827129271302713127132271332713427135271362713727138271392714027141271422714327144271452714627147271482714927150271512715227153271542715527156271572715827159271602716127162271632716427165271662716727168271692717027171271722717327174271752717627177271782717927180271812718227183271842718527186271872718827189271902719127192271932719427195271962719727198271992720027201272022720327204272052720627207272082720927210272112721227213272142721527216272172721827219272202722127222272232722427225272262722727228272292723027231272322723327234272352723627237272382723927240272412724227243272442724527246272472724827249272502725127252272532725427255272562725727258272592726027261272622726327264272652726627267272682726927270272712727227273272742727527276272772727827279272802728127282272832728427285272862728727288272892729027291272922729327294272952729627297272982729927300273012730227303273042730527306273072730827309273102731127312273132731427315273162731727318273192732027321273222732327324273252732627327273282732927330273312733227333273342733527336273372733827339273402734127342273432734427345273462734727348273492735027351273522735327354273552735627357273582735927360273612736227363273642736527366273672736827369273702737127372273732737427375273762737727378273792738027381273822738327384273852738627387273882738927390273912739227393273942739527396273972739827399274002740127402274032740427405274062740727408274092741027411274122741327414274152741627417274182741927420274212742227423274242742527426274272742827429274302743127432274332743427435274362743727438274392744027441274422744327444274452744627447274482744927450274512745227453274542745527456274572745827459274602746127462274632746427465274662746727468274692747027471274722747327474274752747627477274782747927480274812748227483274842748527486274872748827489274902749127492274932749427495274962749727498274992750027501275022750327504275052750627507275082750927510275112751227513275142751527516275172751827519275202752127522275232752427525275262752727528275292753027531275322753327534275352753627537275382753927540275412754227543275442754527546275472754827549275502755127552275532755427555275562755727558275592756027561275622756327564275652756627567275682756927570275712757227573275742757527576275772757827579275802758127582275832758427585275862758727588275892759027591275922759327594275952759627597275982759927600276012760227603276042760527606276072760827609276102761127612276132761427615276162761727618276192762027621276222762327624276252762627627276282762927630276312763227633276342763527636276372763827639276402764127642276432764427645276462764727648276492765027651276522765327654276552765627657276582765927660276612766227663276642766527666276672766827669276702767127672276732767427675276762767727678276792768027681276822768327684276852768627687276882768927690276912769227693276942769527696276972769827699277002770127702277032770427705277062770727708277092771027711277122771327714277152771627717277182771927720277212772227723277242772527726277272772827729277302773127732277332773427735277362773727738277392774027741277422774327744277452774627747277482774927750277512775227753277542775527756277572775827759277602776127762277632776427765277662776727768277692777027771277722777327774277752777627777277782777927780277812778227783277842778527786277872778827789277902779127792277932779427795277962779727798277992780027801278022780327804278052780627807278082780927810278112781227813278142781527816278172781827819278202782127822278232782427825278262782727828278292783027831278322783327834278352783627837278382783927840278412784227843278442784527846278472784827849278502785127852278532785427855278562785727858278592786027861278622786327864278652786627867278682786927870278712787227873278742787527876278772787827879278802788127882278832788427885278862788727888278892789027891278922789327894278952789627897278982789927900279012790227903279042790527906279072790827909279102791127912279132791427915279162791727918279192792027921279222792327924279252792627927279282792927930279312793227933279342793527936279372793827939279402794127942279432794427945279462794727948279492795027951279522795327954279552795627957279582795927960279612796227963279642796527966279672796827969279702797127972279732797427975279762797727978279792798027981279822798327984279852798627987279882798927990279912799227993279942799527996279972799827999280002800128002280032800428005280062800728008280092801028011280122801328014280152801628017280182801928020280212802228023280242802528026280272802828029280302803128032280332803428035280362803728038280392804028041280422804328044280452804628047280482804928050280512805228053280542805528056280572805828059280602806128062280632806428065280662806728068280692807028071280722807328074280752807628077280782807928080280812808228083280842808528086280872808828089280902809128092280932809428095280962809728098280992810028101281022810328104281052810628107281082810928110281112811228113281142811528116281172811828119281202812128122281232812428125281262812728128281292813028131281322813328134281352813628137281382813928140281412814228143281442814528146281472814828149281502815128152281532815428155281562815728158281592816028161281622816328164281652816628167281682816928170281712817228173281742817528176281772817828179281802818128182281832818428185281862818728188281892819028191281922819328194281952819628197281982819928200282012820228203282042820528206282072820828209282102821128212282132821428215282162821728218282192822028221282222822328224282252822628227282282822928230282312823228233282342823528236282372823828239282402824128242282432824428245282462824728248282492825028251282522825328254282552825628257282582825928260282612826228263282642826528266282672826828269282702827128272282732827428275282762827728278282792828028281282822828328284282852828628287282882828928290282912829228293282942829528296282972829828299283002830128302283032830428305283062830728308283092831028311283122831328314283152831628317283182831928320283212832228323283242832528326283272832828329283302833128332283332833428335283362833728338283392834028341283422834328344283452834628347283482834928350283512835228353283542835528356283572835828359283602836128362283632836428365283662836728368283692837028371283722837328374283752837628377283782837928380283812838228383283842838528386283872838828389283902839128392283932839428395283962839728398283992840028401284022840328404284052840628407284082840928410284112841228413284142841528416284172841828419284202842128422284232842428425284262842728428284292843028431284322843328434284352843628437284382843928440284412844228443284442844528446284472844828449284502845128452284532845428455284562845728458284592846028461284622846328464284652846628467284682846928470284712847228473284742847528476284772847828479284802848128482284832848428485284862848728488284892849028491284922849328494284952849628497284982849928500285012850228503285042850528506285072850828509285102851128512285132851428515285162851728518285192852028521285222852328524285252852628527285282852928530285312853228533285342853528536285372853828539285402854128542285432854428545285462854728548285492855028551285522855328554285552855628557285582855928560285612856228563285642856528566285672856828569285702857128572285732857428575285762857728578285792858028581285822858328584285852858628587285882858928590285912859228593285942859528596285972859828599286002860128602286032860428605286062860728608286092861028611286122861328614286152861628617286182861928620286212862228623286242862528626286272862828629286302863128632286332863428635286362863728638286392864028641286422864328644286452864628647286482864928650286512865228653286542865528656286572865828659286602866128662286632866428665286662866728668286692867028671286722867328674286752867628677286782867928680286812868228683286842868528686286872868828689286902869128692286932869428695286962869728698286992870028701287022870328704287052870628707287082870928710287112871228713287142871528716287172871828719287202872128722287232872428725287262872728728287292873028731287322873328734287352873628737287382873928740287412874228743287442874528746287472874828749287502875128752287532875428755287562875728758287592876028761287622876328764287652876628767287682876928770287712877228773287742877528776287772877828779287802878128782287832878428785287862878728788287892879028791287922879328794287952879628797287982879928800288012880228803288042880528806288072880828809288102881128812288132881428815288162881728818288192882028821288222882328824288252882628827288282882928830288312883228833288342883528836288372883828839288402884128842288432884428845288462884728848288492885028851288522885328854288552885628857288582885928860288612886228863288642886528866288672886828869288702887128872288732887428875288762887728878288792888028881288822888328884288852888628887288882888928890288912889228893288942889528896288972889828899289002890128902289032890428905289062890728908289092891028911289122891328914289152891628917289182891928920289212892228923289242892528926289272892828929289302893128932289332893428935289362893728938289392894028941289422894328944289452894628947289482894928950289512895228953289542895528956289572895828959289602896128962289632896428965289662896728968289692897028971289722897328974289752897628977289782897928980289812898228983289842898528986289872898828989289902899128992289932899428995289962899728998289992900029001290022900329004290052900629007290082900929010290112901229013290142901529016290172901829019290202902129022290232902429025290262902729028290292903029031290322903329034290352903629037290382903929040290412904229043290442904529046290472904829049290502905129052290532905429055290562905729058290592906029061290622906329064290652906629067290682906929070290712907229073290742907529076290772907829079290802908129082290832908429085290862908729088290892909029091290922909329094290952909629097290982909929100291012910229103291042910529106291072910829109291102911129112291132911429115291162911729118291192912029121291222912329124291252912629127291282912929130291312913229133291342913529136291372913829139291402914129142291432914429145291462914729148291492915029151291522915329154291552915629157291582915929160291612916229163291642916529166291672916829169291702917129172291732917429175291762917729178291792918029181291822918329184291852918629187291882918929190291912919229193291942919529196291972919829199292002920129202292032920429205292062920729208292092921029211292122921329214292152921629217292182921929220292212922229223292242922529226292272922829229292302923129232292332923429235292362923729238292392924029241292422924329244292452924629247292482924929250292512925229253292542925529256292572925829259292602926129262292632926429265292662926729268292692927029271292722927329274292752927629277292782927929280292812928229283292842928529286292872928829289292902929129292292932929429295292962929729298292992930029301293022930329304293052930629307293082930929310293112931229313293142931529316293172931829319293202932129322293232932429325293262932729328293292933029331293322933329334293352933629337293382933929340293412934229343293442934529346293472934829349293502935129352293532935429355293562935729358293592936029361293622936329364293652936629367293682936929370293712937229373293742937529376293772937829379293802938129382293832938429385293862938729388293892939029391293922939329394293952939629397293982939929400294012940229403294042940529406294072940829409294102941129412294132941429415294162941729418294192942029421294222942329424294252942629427294282942929430294312943229433294342943529436294372943829439294402944129442294432944429445294462944729448294492945029451294522945329454294552945629457294582945929460294612946229463294642946529466294672946829469294702947129472294732947429475294762947729478294792948029481294822948329484294852948629487294882948929490294912949229493294942949529496294972949829499295002950129502295032950429505295062950729508295092951029511295122951329514295152951629517295182951929520295212952229523295242952529526295272952829529295302953129532295332953429535295362953729538295392954029541295422954329544295452954629547295482954929550295512955229553295542955529556295572955829559295602956129562295632956429565295662956729568295692957029571295722957329574295752957629577295782957929580295812958229583295842958529586295872958829589295902959129592295932959429595295962959729598295992960029601296022960329604296052960629607296082960929610296112961229613296142961529616296172961829619296202962129622296232962429625296262962729628296292963029631296322963329634296352963629637296382963929640296412964229643296442964529646296472964829649296502965129652296532965429655296562965729658296592966029661296622966329664296652966629667296682966929670296712967229673296742967529676296772967829679296802968129682296832968429685296862968729688296892969029691296922969329694296952969629697296982969929700297012970229703297042970529706297072970829709297102971129712297132971429715297162971729718297192972029721297222972329724297252972629727297282972929730297312973229733297342973529736297372973829739297402974129742297432974429745297462974729748297492975029751297522975329754297552975629757297582975929760297612976229763297642976529766297672976829769297702977129772297732977429775297762977729778297792978029781297822978329784297852978629787297882978929790297912979229793297942979529796297972979829799298002980129802298032980429805298062980729808298092981029811298122981329814298152981629817298182981929820298212982229823298242982529826298272982829829298302983129832298332983429835298362983729838298392984029841298422984329844298452984629847298482984929850298512985229853298542985529856298572985829859298602986129862298632986429865298662986729868298692987029871298722987329874298752987629877298782987929880298812988229883298842988529886298872988829889298902989129892298932989429895298962989729898298992990029901299022990329904299052990629907299082990929910299112991229913299142991529916299172991829919299202992129922299232992429925299262992729928299292993029931299322993329934299352993629937299382993929940299412994229943299442994529946299472994829949299502995129952299532995429955299562995729958299592996029961299622996329964299652996629967299682996929970299712997229973299742997529976299772997829979299802998129982299832998429985299862998729988299892999029991299922999329994299952999629997299982999930000300013000230003300043000530006300073000830009300103001130012300133001430015300163001730018300193002030021300223002330024300253002630027300283002930030300313003230033300343003530036300373003830039300403004130042300433004430045300463004730048300493005030051300523005330054300553005630057300583005930060300613006230063300643006530066300673006830069300703007130072300733007430075300763007730078300793008030081300823008330084300853008630087300883008930090300913009230093300943009530096300973009830099301003010130102301033010430105301063010730108301093011030111301123011330114301153011630117301183011930120301213012230123301243012530126301273012830129301303013130132301333013430135301363013730138301393014030141301423014330144301453014630147301483014930150301513015230153301543015530156301573015830159301603016130162301633016430165301663016730168301693017030171301723017330174301753017630177301783017930180301813018230183301843018530186301873018830189301903019130192301933019430195301963019730198301993020030201302023020330204302053020630207302083020930210302113021230213302143021530216302173021830219302203022130222302233022430225302263022730228302293023030231302323023330234302353023630237302383023930240302413024230243302443024530246302473024830249302503025130252302533025430255302563025730258302593026030261302623026330264302653026630267302683026930270302713027230273302743027530276302773027830279302803028130282302833028430285302863028730288302893029030291302923029330294302953029630297302983029930300303013030230303303043030530306303073030830309303103031130312303133031430315303163031730318303193032030321303223032330324303253032630327303283032930330303313033230333303343033530336303373033830339303403034130342303433034430345303463034730348303493035030351303523035330354303553035630357303583035930360303613036230363303643036530366303673036830369303703037130372303733037430375303763037730378303793038030381303823038330384303853038630387303883038930390303913039230393303943039530396303973039830399304003040130402304033040430405304063040730408304093041030411304123041330414304153041630417304183041930420304213042230423304243042530426304273042830429304303043130432304333043430435304363043730438304393044030441304423044330444304453044630447304483044930450304513045230453304543045530456304573045830459304603046130462304633046430465304663046730468304693047030471304723047330474304753047630477304783047930480304813048230483304843048530486304873048830489304903049130492304933049430495304963049730498304993050030501305023050330504305053050630507305083050930510305113051230513305143051530516305173051830519305203052130522305233052430525305263052730528305293053030531305323053330534305353053630537305383053930540305413054230543305443054530546305473054830549305503055130552305533055430555305563055730558305593056030561305623056330564305653056630567305683056930570305713057230573305743057530576305773057830579305803058130582305833058430585305863058730588305893059030591305923059330594305953059630597305983059930600306013060230603306043060530606306073060830609306103061130612306133061430615306163061730618306193062030621306223062330624306253062630627306283062930630306313063230633306343063530636306373063830639306403064130642306433064430645306463064730648306493065030651306523065330654306553065630657306583065930660306613066230663306643066530666306673066830669306703067130672306733067430675306763067730678306793068030681306823068330684306853068630687306883068930690306913069230693306943069530696306973069830699307003070130702307033070430705307063070730708307093071030711307123071330714307153071630717307183071930720307213072230723307243072530726307273072830729307303073130732307333073430735307363073730738307393074030741307423074330744307453074630747307483074930750307513075230753307543075530756307573075830759307603076130762307633076430765307663076730768307693077030771307723077330774307753077630777307783077930780307813078230783307843078530786307873078830789307903079130792307933079430795307963079730798307993080030801308023080330804308053080630807308083080930810308113081230813308143081530816308173081830819308203082130822308233082430825308263082730828308293083030831308323083330834308353083630837308383083930840308413084230843308443084530846308473084830849308503085130852308533085430855308563085730858308593086030861308623086330864308653086630867308683086930870308713087230873308743087530876308773087830879308803088130882308833088430885308863088730888308893089030891308923089330894308953089630897308983089930900309013090230903309043090530906309073090830909309103091130912309133091430915309163091730918309193092030921309223092330924309253092630927309283092930930309313093230933309343093530936309373093830939309403094130942309433094430945309463094730948309493095030951309523095330954309553095630957309583095930960309613096230963309643096530966309673096830969309703097130972309733097430975309763097730978309793098030981309823098330984309853098630987309883098930990309913099230993309943099530996309973099830999310003100131002310033100431005310063100731008310093101031011310123101331014310153101631017310183101931020310213102231023310243102531026310273102831029310303103131032310333103431035310363103731038310393104031041310423104331044310453104631047310483104931050310513105231053310543105531056310573105831059310603106131062310633106431065310663106731068310693107031071310723107331074310753107631077310783107931080310813108231083310843108531086310873108831089310903109131092310933109431095310963109731098310993110031101311023110331104311053110631107311083110931110311113111231113311143111531116311173111831119311203112131122311233112431125311263112731128311293113031131311323113331134311353113631137311383113931140311413114231143311443114531146311473114831149311503115131152311533115431155311563115731158311593116031161311623116331164311653116631167311683116931170311713117231173311743117531176311773117831179311803118131182311833118431185311863118731188311893119031191311923119331194311953119631197311983119931200312013120231203312043120531206312073120831209312103121131212312133121431215312163121731218312193122031221312223122331224312253122631227312283122931230312313123231233312343123531236312373123831239312403124131242312433124431245312463124731248312493125031251312523125331254312553125631257312583125931260312613126231263312643126531266312673126831269312703127131272312733127431275312763127731278312793128031281312823128331284312853128631287312883128931290312913129231293312943129531296312973129831299313003130131302313033130431305313063130731308313093131031311313123131331314313153131631317313183131931320313213132231323313243132531326313273132831329313303133131332313333133431335313363133731338313393134031341313423134331344313453134631347313483134931350313513135231353313543135531356313573135831359313603136131362313633136431365313663136731368313693137031371313723137331374313753137631377313783137931380313813138231383313843138531386313873138831389313903139131392313933139431395313963139731398313993140031401314023140331404314053140631407314083140931410314113141231413314143141531416314173141831419314203142131422314233142431425314263142731428314293143031431314323143331434314353143631437314383143931440314413144231443314443144531446314473144831449314503145131452314533145431455314563145731458314593146031461314623146331464314653146631467314683146931470314713147231473314743147531476314773147831479314803148131482314833148431485314863148731488314893149031491314923149331494314953149631497314983149931500315013150231503315043150531506315073150831509315103151131512315133151431515315163151731518315193152031521315223152331524315253152631527315283152931530315313153231533315343153531536315373153831539315403154131542315433154431545315463154731548315493155031551315523155331554315553155631557315583155931560315613156231563315643156531566315673156831569315703157131572315733157431575315763157731578315793158031581315823158331584315853158631587315883158931590315913159231593315943159531596315973159831599316003160131602316033160431605316063160731608316093161031611316123161331614316153161631617316183161931620316213162231623316243162531626316273162831629316303163131632316333163431635316363163731638316393164031641316423164331644316453164631647316483164931650316513165231653316543165531656316573165831659316603166131662316633166431665316663166731668316693167031671316723167331674316753167631677316783167931680316813168231683316843168531686316873168831689316903169131692316933169431695316963169731698316993170031701317023170331704317053170631707317083170931710317113171231713317143171531716317173171831719317203172131722317233172431725317263172731728317293173031731317323173331734317353173631737317383173931740317413174231743317443174531746317473174831749317503175131752317533175431755317563175731758317593176031761317623176331764317653176631767317683176931770317713177231773317743177531776317773177831779317803178131782317833178431785317863178731788317893179031791317923179331794317953179631797317983179931800318013180231803318043180531806318073180831809318103181131812318133181431815318163181731818318193182031821318223182331824318253182631827318283182931830318313183231833318343183531836318373183831839318403184131842318433184431845318463184731848318493185031851318523185331854318553185631857318583185931860318613186231863318643186531866318673186831869318703187131872318733187431875318763187731878318793188031881318823188331884318853188631887318883188931890318913189231893318943189531896318973189831899319003190131902319033190431905319063190731908319093191031911319123191331914319153191631917319183191931920319213192231923319243192531926319273192831929319303193131932319333193431935319363193731938319393194031941319423194331944319453194631947319483194931950319513195231953319543195531956319573195831959319603196131962319633196431965319663196731968319693197031971319723197331974319753197631977319783197931980319813198231983319843198531986319873198831989319903199131992319933199431995319963199731998319993200032001320023200332004320053200632007320083200932010320113201232013320143201532016320173201832019320203202132022320233202432025320263202732028320293203032031320323203332034320353203632037320383203932040320413204232043320443204532046320473204832049320503205132052320533205432055320563205732058320593206032061320623206332064320653206632067320683206932070320713207232073320743207532076320773207832079320803208132082320833208432085320863208732088320893209032091320923209332094320953209632097320983209932100321013210232103321043210532106321073210832109321103211132112321133211432115321163211732118321193212032121321223212332124321253212632127321283212932130321313213232133321343213532136321373213832139321403214132142321433214432145321463214732148321493215032151321523215332154321553215632157321583215932160321613216232163321643216532166321673216832169321703217132172321733217432175321763217732178321793218032181321823218332184321853218632187321883218932190321913219232193321943219532196321973219832199322003220132202322033220432205322063220732208322093221032211322123221332214322153221632217322183221932220322213222232223322243222532226322273222832229322303223132232322333223432235322363223732238322393224032241322423224332244322453224632247322483224932250322513225232253322543225532256322573225832259322603226132262322633226432265322663226732268322693227032271322723227332274322753227632277322783227932280322813228232283322843228532286322873228832289322903229132292322933229432295322963229732298322993230032301323023230332304323053230632307323083230932310323113231232313323143231532316323173231832319323203232132322323233232432325323263232732328323293233032331323323233332334323353233632337323383233932340323413234232343323443234532346323473234832349323503235132352323533235432355323563235732358323593236032361323623236332364323653236632367323683236932370323713237232373323743237532376323773237832379323803238132382323833238432385323863238732388323893239032391323923239332394323953239632397323983239932400324013240232403324043240532406324073240832409324103241132412324133241432415324163241732418324193242032421324223242332424324253242632427324283242932430324313243232433324343243532436324373243832439324403244132442324433244432445324463244732448324493245032451324523245332454324553245632457324583245932460324613246232463324643246532466324673246832469324703247132472324733247432475324763247732478324793248032481324823248332484324853248632487324883248932490324913249232493324943249532496324973249832499325003250132502325033250432505325063250732508325093251032511325123251332514325153251632517325183251932520325213252232523325243252532526325273252832529325303253132532325333253432535325363253732538325393254032541325423254332544325453254632547325483254932550325513255232553325543255532556325573255832559325603256132562325633256432565325663256732568325693257032571325723257332574325753257632577325783257932580325813258232583325843258532586325873258832589325903259132592325933259432595325963259732598325993260032601326023260332604326053260632607326083260932610326113261232613326143261532616326173261832619326203262132622326233262432625326263262732628326293263032631326323263332634326353263632637326383263932640326413264232643326443264532646326473264832649326503265132652326533265432655326563265732658326593266032661326623266332664326653266632667326683266932670326713267232673326743267532676326773267832679326803268132682326833268432685326863268732688326893269032691326923269332694326953269632697326983269932700327013270232703327043270532706327073270832709327103271132712327133271432715327163271732718327193272032721327223272332724327253272632727327283272932730327313273232733327343273532736327373273832739327403274132742327433274432745327463274732748327493275032751327523275332754327553275632757327583275932760327613276232763327643276532766327673276832769327703277132772327733277432775327763277732778327793278032781327823278332784327853278632787327883278932790327913279232793327943279532796327973279832799328003280132802328033280432805328063280732808328093281032811328123281332814328153281632817328183281932820328213282232823328243282532826328273282832829328303283132832328333283432835328363283732838328393284032841328423284332844328453284632847328483284932850328513285232853328543285532856328573285832859328603286132862328633286432865328663286732868328693287032871328723287332874328753287632877328783287932880328813288232883328843288532886328873288832889328903289132892328933289432895328963289732898328993290032901329023290332904329053290632907329083290932910329113291232913329143291532916329173291832919329203292132922329233292432925329263292732928329293293032931329323293332934329353293632937329383293932940329413294232943329443294532946329473294832949329503295132952329533295432955329563295732958329593296032961329623296332964329653296632967329683296932970329713297232973329743297532976329773297832979329803298132982329833298432985329863298732988329893299032991329923299332994329953299632997329983299933000330013300233003330043300533006330073300833009330103301133012330133301433015330163301733018330193302033021330223302333024330253302633027330283302933030330313303233033330343303533036330373303833039330403304133042330433304433045330463304733048330493305033051330523305333054330553305633057330583305933060330613306233063330643306533066330673306833069330703307133072330733307433075330763307733078330793308033081330823308333084330853308633087330883308933090330913309233093330943309533096330973309833099331003310133102331033310433105331063310733108331093311033111331123311333114331153311633117331183311933120331213312233123331243312533126331273312833129331303313133132331333313433135331363313733138331393314033141331423314333144331453314633147331483314933150331513315233153331543315533156331573315833159331603316133162331633316433165331663316733168331693317033171331723317333174331753317633177331783317933180331813318233183331843318533186331873318833189331903319133192331933319433195331963319733198331993320033201332023320333204332053320633207332083320933210332113321233213332143321533216332173321833219332203322133222332233322433225332263322733228332293323033231332323323333234332353323633237332383323933240332413324233243332443324533246332473324833249332503325133252332533325433255332563325733258332593326033261332623326333264332653326633267332683326933270332713327233273332743327533276332773327833279332803328133282332833328433285332863328733288332893329033291332923329333294332953329633297332983329933300333013330233303333043330533306333073330833309333103331133312333133331433315333163331733318333193332033321333223332333324333253332633327333283332933330333313333233333333343333533336333373333833339333403334133342333433334433345333463334733348333493335033351333523335333354333553335633357333583335933360333613336233363333643336533366333673336833369333703337133372333733337433375333763337733378333793338033381333823338333384333853338633387333883338933390333913339233393333943339533396333973339833399334003340133402334033340433405334063340733408334093341033411334123341333414334153341633417334183341933420334213342233423334243342533426334273342833429334303343133432334333343433435334363343733438334393344033441334423344333444334453344633447334483344933450334513345233453334543345533456334573345833459334603346133462334633346433465334663346733468334693347033471334723347333474334753347633477334783347933480334813348233483334843348533486334873348833489334903349133492334933349433495334963349733498334993350033501335023350333504335053350633507335083350933510335113351233513335143351533516335173351833519335203352133522335233352433525335263352733528335293353033531335323353333534335353353633537335383353933540335413354233543335443354533546335473354833549335503355133552335533355433555335563355733558335593356033561335623356333564335653356633567335683356933570335713357233573335743357533576335773357833579335803358133582335833358433585335863358733588335893359033591335923359333594335953359633597335983359933600336013360233603336043360533606336073360833609336103361133612336133361433615336163361733618336193362033621336223362333624336253362633627336283362933630336313363233633336343363533636336373363833639336403364133642336433364433645336463364733648336493365033651336523365333654336553365633657336583365933660336613366233663336643366533666336673366833669336703367133672336733367433675336763367733678336793368033681336823368333684336853368633687336883368933690336913369233693336943369533696336973369833699337003370133702337033370433705337063370733708337093371033711337123371333714337153371633717337183371933720337213372233723337243372533726337273372833729337303373133732337333373433735337363373733738337393374033741337423374333744337453374633747337483374933750337513375233753337543375533756337573375833759337603376133762337633376433765337663376733768337693377033771337723377333774337753377633777337783377933780337813378233783337843378533786337873378833789337903379133792337933379433795337963379733798337993380033801338023380333804338053380633807338083380933810338113381233813338143381533816338173381833819338203382133822338233382433825338263382733828338293383033831338323383333834338353383633837338383383933840338413384233843338443384533846338473384833849338503385133852338533385433855338563385733858338593386033861338623386333864338653386633867338683386933870338713387233873338743387533876338773387833879338803388133882338833388433885338863388733888338893389033891338923389333894338953389633897338983389933900339013390233903339043390533906339073390833909339103391133912339133391433915339163391733918339193392033921339223392333924339253392633927339283392933930339313393233933339343393533936339373393833939339403394133942339433394433945339463394733948339493395033951339523395333954339553395633957339583395933960339613396233963339643396533966339673396833969339703397133972339733397433975339763397733978339793398033981339823398333984339853398633987339883398933990339913399233993339943399533996339973399833999340003400134002340033400434005340063400734008340093401034011340123401334014340153401634017340183401934020340213402234023340243402534026340273402834029340303403134032340333403434035340363403734038340393404034041340423404334044340453404634047340483404934050340513405234053340543405534056340573405834059340603406134062340633406434065340663406734068340693407034071340723407334074340753407634077340783407934080340813408234083340843408534086340873408834089340903409134092340933409434095340963409734098340993410034101341023410334104341053410634107341083410934110341113411234113341143411534116341173411834119341203412134122341233412434125341263412734128341293413034131341323413334134341353413634137341383413934140341413414234143341443414534146341473414834149341503415134152341533415434155341563415734158341593416034161341623416334164341653416634167341683416934170341713417234173341743417534176341773417834179341803418134182341833418434185341863418734188341893419034191341923419334194341953419634197341983419934200342013420234203342043420534206342073420834209342103421134212342133421434215342163421734218342193422034221342223422334224342253422634227342283422934230342313423234233342343423534236342373423834239342403424134242342433424434245342463424734248342493425034251342523425334254342553425634257342583425934260342613426234263342643426534266342673426834269342703427134272342733427434275342763427734278342793428034281342823428334284342853428634287342883428934290342913429234293342943429534296342973429834299343003430134302343033430434305343063430734308343093431034311343123431334314343153431634317343183431934320343213432234323343243432534326343273432834329343303433134332343333433434335343363433734338343393434034341343423434334344343453434634347343483434934350343513435234353343543435534356343573435834359343603436134362343633436434365343663436734368343693437034371343723437334374343753437634377343783437934380343813438234383343843438534386343873438834389343903439134392343933439434395343963439734398343993440034401344023440334404344053440634407344083440934410344113441234413344143441534416344173441834419344203442134422344233442434425344263442734428344293443034431344323443334434344353443634437344383443934440344413444234443344443444534446344473444834449344503445134452344533445434455344563445734458344593446034461344623446334464344653446634467344683446934470344713447234473344743447534476344773447834479344803448134482344833448434485344863448734488344893449034491344923449334494344953449634497344983449934500345013450234503345043450534506345073450834509345103451134512345133451434515345163451734518345193452034521345223452334524345253452634527345283452934530345313453234533345343453534536345373453834539345403454134542345433454434545345463454734548345493455034551345523455334554345553455634557345583455934560345613456234563345643456534566345673456834569345703457134572345733457434575345763457734578345793458034581345823458334584345853458634587345883458934590345913459234593345943459534596345973459834599346003460134602346033460434605346063460734608346093461034611346123461334614346153461634617346183461934620346213462234623346243462534626346273462834629346303463134632346333463434635346363463734638346393464034641346423464334644346453464634647346483464934650346513465234653346543465534656346573465834659346603466134662346633466434665346663466734668346693467034671346723467334674346753467634677346783467934680346813468234683346843468534686346873468834689346903469134692346933469434695346963469734698346993470034701347023470334704347053470634707347083470934710347113471234713347143471534716347173471834719347203472134722347233472434725347263472734728347293473034731347323473334734347353473634737347383473934740347413474234743347443474534746347473474834749347503475134752347533475434755347563475734758347593476034761347623476334764347653476634767347683476934770347713477234773347743477534776347773477834779347803478134782347833478434785347863478734788347893479034791347923479334794347953479634797347983479934800348013480234803348043480534806348073480834809348103481134812348133481434815348163481734818348193482034821348223482334824348253482634827348283482934830348313483234833348343483534836348373483834839348403484134842348433484434845348463484734848348493485034851348523485334854348553485634857348583485934860348613486234863348643486534866348673486834869348703487134872348733487434875348763487734878348793488034881348823488334884348853488634887348883488934890348913489234893348943489534896348973489834899349003490134902349033490434905349063490734908349093491034911349123491334914349153491634917349183491934920349213492234923349243492534926349273492834929349303493134932349333493434935349363493734938349393494034941349423494334944349453494634947349483494934950349513495234953349543495534956349573495834959349603496134962349633496434965349663496734968349693497034971349723497334974349753497634977349783497934980349813498234983349843498534986349873498834989349903499134992349933499434995349963499734998349993500035001350023500335004350053500635007350083500935010350113501235013350143501535016350173501835019350203502135022350233502435025350263502735028350293503035031350323503335034350353503635037350383503935040350413504235043350443504535046350473504835049350503505135052350533505435055350563505735058350593506035061350623506335064350653506635067350683506935070350713507235073350743507535076350773507835079350803508135082350833508435085350863508735088350893509035091350923509335094350953509635097350983509935100351013510235103351043510535106351073510835109351103511135112351133511435115351163511735118351193512035121351223512335124351253512635127351283512935130351313513235133351343513535136351373513835139351403514135142351433514435145351463514735148351493515035151351523515335154351553515635157351583515935160351613516235163351643516535166351673516835169351703517135172351733517435175351763517735178351793518035181351823518335184351853518635187351883518935190351913519235193351943519535196351973519835199352003520135202352033520435205352063520735208352093521035211352123521335214352153521635217352183521935220352213522235223352243522535226352273522835229352303523135232352333523435235352363523735238352393524035241352423524335244352453524635247352483524935250352513525235253352543525535256352573525835259352603526135262352633526435265352663526735268352693527035271352723527335274352753527635277352783527935280352813528235283352843528535286352873528835289352903529135292352933529435295352963529735298352993530035301353023530335304353053530635307353083530935310353113531235313353143531535316353173531835319353203532135322353233532435325353263532735328353293533035331353323533335334353353533635337353383533935340353413534235343353443534535346353473534835349353503535135352353533535435355353563535735358353593536035361353623536335364353653536635367353683536935370353713537235373353743537535376353773537835379353803538135382353833538435385353863538735388353893539035391353923539335394353953539635397353983539935400354013540235403354043540535406354073540835409354103541135412354133541435415354163541735418354193542035421354223542335424354253542635427354283542935430354313543235433354343543535436354373543835439354403544135442354433544435445354463544735448354493545035451354523545335454354553545635457354583545935460354613546235463354643546535466354673546835469354703547135472354733547435475354763547735478354793548035481354823548335484354853548635487354883548935490354913549235493354943549535496354973549835499355003550135502355033550435505355063550735508355093551035511355123551335514355153551635517355183551935520355213552235523355243552535526355273552835529355303553135532355333553435535355363553735538355393554035541355423554335544355453554635547355483554935550355513555235553355543555535556355573555835559355603556135562355633556435565355663556735568355693557035571355723557335574355753557635577355783557935580355813558235583355843558535586355873558835589355903559135592355933559435595355963559735598355993560035601356023560335604356053560635607356083560935610356113561235613356143561535616356173561835619356203562135622356233562435625356263562735628356293563035631356323563335634356353563635637356383563935640356413564235643356443564535646356473564835649356503565135652356533565435655356563565735658356593566035661356623566335664356653566635667356683566935670356713567235673356743567535676356773567835679356803568135682356833568435685356863568735688356893569035691356923569335694356953569635697356983569935700357013570235703357043570535706357073570835709357103571135712357133571435715357163571735718357193572035721357223572335724357253572635727357283572935730357313573235733357343573535736357373573835739357403574135742357433574435745357463574735748357493575035751357523575335754357553575635757357583575935760357613576235763357643576535766357673576835769357703577135772357733577435775357763577735778357793578035781357823578335784357853578635787357883578935790357913579235793357943579535796357973579835799358003580135802358033580435805358063580735808358093581035811358123581335814358153581635817358183581935820358213582235823358243582535826358273582835829358303583135832358333583435835358363583735838358393584035841358423584335844358453584635847358483584935850358513585235853358543585535856358573585835859358603586135862358633586435865358663586735868358693587035871358723587335874358753587635877358783587935880358813588235883358843588535886358873588835889358903589135892358933589435895358963589735898358993590035901359023590335904359053590635907359083590935910359113591235913359143591535916359173591835919359203592135922359233592435925359263592735928359293593035931359323593335934359353593635937359383593935940359413594235943359443594535946359473594835949359503595135952359533595435955359563595735958359593596035961359623596335964359653596635967359683596935970359713597235973359743597535976359773597835979359803598135982359833598435985359863598735988359893599035991359923599335994359953599635997359983599936000360013600236003360043600536006360073600836009360103601136012360133601436015360163601736018360193602036021360223602336024360253602636027360283602936030360313603236033360343603536036360373603836039360403604136042360433604436045360463604736048360493605036051360523605336054360553605636057360583605936060360613606236063360643606536066360673606836069360703607136072360733607436075360763607736078360793608036081360823608336084360853608636087360883608936090360913609236093360943609536096360973609836099361003610136102361033610436105361063610736108361093611036111361123611336114361153611636117361183611936120361213612236123361243612536126361273612836129361303613136132361333613436135361363613736138361393614036141361423614336144361453614636147361483614936150361513615236153361543615536156361573615836159361603616136162361633616436165361663616736168361693617036171361723617336174361753617636177361783617936180361813618236183361843618536186361873618836189361903619136192361933619436195361963619736198361993620036201362023620336204362053620636207362083620936210362113621236213362143621536216362173621836219362203622136222362233622436225362263622736228362293623036231362323623336234362353623636237362383623936240362413624236243362443624536246362473624836249362503625136252362533625436255362563625736258362593626036261362623626336264362653626636267362683626936270362713627236273362743627536276362773627836279362803628136282362833628436285362863628736288362893629036291362923629336294362953629636297362983629936300363013630236303363043630536306363073630836309363103631136312363133631436315363163631736318363193632036321363223632336324363253632636327363283632936330363313633236333363343633536336363373633836339363403634136342363433634436345363463634736348363493635036351363523635336354363553635636357363583635936360363613636236363363643636536366363673636836369363703637136372363733637436375363763637736378363793638036381363823638336384363853638636387363883638936390363913639236393363943639536396363973639836399364003640136402364033640436405364063640736408364093641036411364123641336414364153641636417364183641936420364213642236423364243642536426364273642836429364303643136432364333643436435364363643736438364393644036441364423644336444364453644636447364483644936450364513645236453364543645536456364573645836459364603646136462364633646436465364663646736468364693647036471364723647336474364753647636477364783647936480364813648236483364843648536486364873648836489364903649136492364933649436495364963649736498364993650036501365023650336504365053650636507365083650936510365113651236513365143651536516365173651836519365203652136522365233652436525365263652736528365293653036531365323653336534365353653636537365383653936540365413654236543365443654536546365473654836549365503655136552365533655436555365563655736558365593656036561365623656336564365653656636567365683656936570365713657236573365743657536576365773657836579365803658136582365833658436585365863658736588365893659036591365923659336594365953659636597365983659936600366013660236603366043660536606366073660836609366103661136612366133661436615366163661736618366193662036621366223662336624366253662636627366283662936630366313663236633366343663536636366373663836639366403664136642366433664436645366463664736648366493665036651366523665336654366553665636657366583665936660366613666236663366643666536666366673666836669366703667136672366733667436675366763667736678366793668036681366823668336684366853668636687366883668936690366913669236693366943669536696366973669836699367003670136702367033670436705367063670736708367093671036711367123671336714367153671636717367183671936720367213672236723367243672536726367273672836729367303673136732367333673436735367363673736738367393674036741367423674336744367453674636747367483674936750367513675236753367543675536756367573675836759367603676136762367633676436765367663676736768367693677036771367723677336774367753677636777367783677936780367813678236783367843678536786367873678836789367903679136792367933679436795367963679736798367993680036801368023680336804368053680636807368083680936810368113681236813368143681536816368173681836819368203682136822368233682436825368263682736828368293683036831368323683336834368353683636837368383683936840368413684236843368443684536846368473684836849368503685136852368533685436855368563685736858368593686036861368623686336864368653686636867368683686936870368713687236873368743687536876368773687836879368803688136882368833688436885368863688736888368893689036891368923689336894368953689636897368983689936900369013690236903369043690536906369073690836909369103691136912369133691436915369163691736918369193692036921369223692336924369253692636927369283692936930369313693236933369343693536936369373693836939369403694136942369433694436945369463694736948369493695036951369523695336954369553695636957369583695936960369613696236963369643696536966369673696836969369703697136972369733697436975369763697736978369793698036981369823698336984369853698636987369883698936990369913699236993369943699536996369973699836999370003700137002370033700437005370063700737008370093701037011370123701337014370153701637017370183701937020370213702237023370243702537026370273702837029370303703137032370333703437035370363703737038370393704037041370423704337044370453704637047370483704937050370513705237053370543705537056370573705837059370603706137062370633706437065370663706737068370693707037071370723707337074370753707637077370783707937080370813708237083370843708537086370873708837089370903709137092370933709437095370963709737098370993710037101371023710337104371053710637107371083710937110371113711237113371143711537116371173711837119371203712137122371233712437125371263712737128371293713037131371323713337134371353713637137371383713937140371413714237143371443714537146371473714837149371503715137152371533715437155371563715737158371593716037161371623716337164371653716637167371683716937170371713717237173371743717537176371773717837179371803718137182371833718437185371863718737188371893719037191371923719337194371953719637197371983719937200372013720237203372043720537206372073720837209372103721137212372133721437215372163721737218372193722037221372223722337224372253722637227372283722937230372313723237233372343723537236372373723837239372403724137242372433724437245372463724737248372493725037251372523725337254372553725637257372583725937260372613726237263372643726537266372673726837269372703727137272372733727437275372763727737278372793728037281372823728337284372853728637287372883728937290372913729237293372943729537296372973729837299373003730137302373033730437305373063730737308373093731037311373123731337314373153731637317373183731937320373213732237323373243732537326373273732837329373303733137332373333733437335373363733737338373393734037341373423734337344373453734637347373483734937350373513735237353373543735537356373573735837359373603736137362373633736437365373663736737368373693737037371373723737337374373753737637377373783737937380373813738237383373843738537386373873738837389373903739137392373933739437395373963739737398373993740037401374023740337404374053740637407374083740937410374113741237413374143741537416374173741837419374203742137422374233742437425374263742737428374293743037431374323743337434374353743637437374383743937440374413744237443374443744537446374473744837449374503745137452374533745437455374563745737458374593746037461374623746337464374653746637467374683746937470374713747237473374743747537476374773747837479374803748137482374833748437485374863748737488374893749037491374923749337494374953749637497374983749937500375013750237503375043750537506375073750837509375103751137512375133751437515375163751737518375193752037521375223752337524375253752637527375283752937530375313753237533375343753537536375373753837539375403754137542375433754437545375463754737548375493755037551375523755337554375553755637557375583755937560375613756237563375643756537566375673756837569375703757137572375733757437575375763757737578375793758037581375823758337584375853758637587375883758937590375913759237593375943759537596375973759837599376003760137602376033760437605376063760737608376093761037611376123761337614376153761637617376183761937620376213762237623376243762537626376273762837629376303763137632376333763437635376363763737638376393764037641376423764337644376453764637647376483764937650376513765237653376543765537656376573765837659376603766137662376633766437665376663766737668376693767037671376723767337674376753767637677376783767937680376813768237683376843768537686376873768837689376903769137692376933769437695376963769737698376993770037701377023770337704377053770637707377083770937710377113771237713377143771537716377173771837719377203772137722377233772437725377263772737728377293773037731377323773337734377353773637737377383773937740377413774237743377443774537746377473774837749377503775137752377533775437755377563775737758377593776037761377623776337764377653776637767377683776937770377713777237773377743777537776377773777837779377803778137782377833778437785377863778737788377893779037791377923779337794377953779637797377983779937800378013780237803378043780537806378073780837809378103781137812378133781437815378163781737818378193782037821378223782337824378253782637827378283782937830378313783237833378343783537836378373783837839378403784137842378433784437845378463784737848378493785037851378523785337854378553785637857378583785937860378613786237863378643786537866378673786837869378703787137872378733787437875378763787737878378793788037881378823788337884378853788637887378883788937890378913789237893378943789537896378973789837899379003790137902379033790437905379063790737908379093791037911379123791337914379153791637917379183791937920379213792237923379243792537926379273792837929379303793137932379333793437935379363793737938379393794037941379423794337944379453794637947379483794937950379513795237953379543795537956379573795837959379603796137962379633796437965379663796737968379693797037971379723797337974379753797637977379783797937980379813798237983379843798537986379873798837989379903799137992379933799437995379963799737998379993800038001380023800338004380053800638007380083800938010380113801238013380143801538016380173801838019380203802138022380233802438025380263802738028380293803038031380323803338034380353803638037380383803938040380413804238043380443804538046380473804838049380503805138052380533805438055380563805738058380593806038061380623806338064380653806638067380683806938070380713807238073380743807538076380773807838079380803808138082380833808438085380863808738088380893809038091380923809338094380953809638097380983809938100381013810238103381043810538106381073810838109381103811138112381133811438115381163811738118381193812038121381223812338124381253812638127381283812938130381313813238133381343813538136381373813838139381403814138142381433814438145381463814738148381493815038151381523815338154381553815638157381583815938160381613816238163381643816538166381673816838169381703817138172381733817438175381763817738178381793818038181381823818338184381853818638187381883818938190381913819238193381943819538196381973819838199382003820138202382033820438205382063820738208382093821038211382123821338214382153821638217382183821938220382213822238223382243822538226382273822838229382303823138232382333823438235382363823738238382393824038241382423824338244382453824638247382483824938250382513825238253382543825538256382573825838259382603826138262382633826438265382663826738268382693827038271382723827338274382753827638277382783827938280382813828238283382843828538286382873828838289382903829138292382933829438295382963829738298382993830038301383023830338304383053830638307383083830938310383113831238313383143831538316383173831838319383203832138322383233832438325383263832738328383293833038331383323833338334383353833638337383383833938340383413834238343383443834538346383473834838349383503835138352383533835438355383563835738358383593836038361383623836338364383653836638367383683836938370383713837238373383743837538376383773837838379383803838138382383833838438385383863838738388383893839038391383923839338394383953839638397383983839938400384013840238403384043840538406384073840838409384103841138412384133841438415384163841738418384193842038421384223842338424384253842638427384283842938430384313843238433384343843538436384373843838439384403844138442384433844438445384463844738448384493845038451384523845338454384553845638457384583845938460384613846238463384643846538466384673846838469384703847138472384733847438475384763847738478384793848038481384823848338484384853848638487384883848938490384913849238493384943849538496384973849838499385003850138502385033850438505385063850738508385093851038511385123851338514385153851638517385183851938520385213852238523385243852538526385273852838529385303853138532385333853438535385363853738538385393854038541385423854338544385453854638547385483854938550385513855238553385543855538556385573855838559385603856138562385633856438565385663856738568385693857038571385723857338574385753857638577385783857938580385813858238583385843858538586385873858838589385903859138592385933859438595385963859738598385993860038601386023860338604386053860638607386083860938610386113861238613386143861538616386173861838619386203862138622386233862438625386263862738628386293863038631386323863338634386353863638637386383863938640386413864238643386443864538646386473864838649386503865138652386533865438655386563865738658386593866038661386623866338664386653866638667386683866938670386713867238673386743867538676386773867838679386803868138682386833868438685386863868738688386893869038691386923869338694386953869638697386983869938700387013870238703387043870538706387073870838709387103871138712387133871438715387163871738718387193872038721387223872338724387253872638727387283872938730387313873238733387343873538736387373873838739387403874138742387433874438745387463874738748387493875038751387523875338754387553875638757387583875938760387613876238763387643876538766387673876838769387703877138772387733877438775387763877738778387793878038781387823878338784387853878638787387883878938790387913879238793387943879538796387973879838799388003880138802388033880438805388063880738808388093881038811388123881338814388153881638817388183881938820388213882238823388243882538826388273882838829388303883138832388333883438835388363883738838388393884038841388423884338844388453884638847388483884938850388513885238853388543885538856388573885838859388603886138862388633886438865388663886738868388693887038871388723887338874388753887638877388783887938880388813888238883388843888538886388873888838889388903889138892388933889438895388963889738898388993890038901389023890338904389053890638907389083890938910389113891238913389143891538916389173891838919389203892138922389233892438925389263892738928389293893038931389323893338934389353893638937389383893938940389413894238943389443894538946389473894838949389503895138952389533895438955389563895738958389593896038961389623896338964389653896638967389683896938970389713897238973389743897538976389773897838979389803898138982389833898438985389863898738988389893899038991389923899338994389953899638997389983899939000390013900239003390043900539006390073900839009390103901139012390133901439015390163901739018390193902039021390223902339024390253902639027390283902939030390313903239033390343903539036390373903839039390403904139042390433904439045390463904739048390493905039051390523905339054390553905639057390583905939060390613906239063390643906539066390673906839069390703907139072390733907439075390763907739078390793908039081390823908339084390853908639087390883908939090390913909239093390943909539096390973909839099391003910139102391033910439105391063910739108391093911039111391123911339114391153911639117391183911939120391213912239123391243912539126391273912839129391303913139132391333913439135391363913739138391393914039141391423914339144391453914639147391483914939150391513915239153391543915539156391573915839159391603916139162391633916439165391663916739168391693917039171391723917339174391753917639177391783917939180391813918239183391843918539186391873918839189391903919139192391933919439195391963919739198391993920039201392023920339204392053920639207392083920939210392113921239213392143921539216392173921839219392203922139222392233922439225392263922739228392293923039231392323923339234392353923639237392383923939240392413924239243392443924539246392473924839249392503925139252392533925439255392563925739258392593926039261392623926339264392653926639267392683926939270392713927239273392743927539276392773927839279392803928139282392833928439285392863928739288392893929039291392923929339294392953929639297392983929939300393013930239303393043930539306393073930839309393103931139312393133931439315393163931739318393193932039321393223932339324393253932639327393283932939330393313933239333393343933539336393373933839339393403934139342393433934439345393463934739348393493935039351393523935339354393553935639357393583935939360393613936239363393643936539366393673936839369393703937139372393733937439375393763937739378393793938039381393823938339384393853938639387393883938939390393913939239393393943939539396393973939839399394003940139402394033940439405394063940739408394093941039411394123941339414394153941639417394183941939420394213942239423394243942539426394273942839429394303943139432394333943439435394363943739438394393944039441394423944339444394453944639447394483944939450394513945239453394543945539456394573945839459394603946139462394633946439465394663946739468394693947039471394723947339474394753947639477394783947939480394813948239483394843948539486394873948839489394903949139492394933949439495394963949739498394993950039501395023950339504395053950639507395083950939510395113951239513395143951539516395173951839519395203952139522395233952439525395263952739528395293953039531395323953339534395353953639537395383953939540395413954239543395443954539546395473954839549395503955139552395533955439555395563955739558395593956039561395623956339564395653956639567395683956939570395713957239573395743957539576395773957839579395803958139582395833958439585395863958739588395893959039591395923959339594395953959639597395983959939600396013960239603396043960539606396073960839609396103961139612396133961439615396163961739618396193962039621396223962339624396253962639627396283962939630396313963239633396343963539636396373963839639396403964139642396433964439645396463964739648396493965039651396523965339654396553965639657396583965939660396613966239663396643966539666396673966839669396703967139672396733967439675396763967739678396793968039681396823968339684396853968639687396883968939690396913969239693396943969539696396973969839699397003970139702397033970439705397063970739708397093971039711397123971339714397153971639717397183971939720397213972239723397243972539726397273972839729397303973139732397333973439735397363973739738397393974039741397423974339744397453974639747397483974939750397513975239753397543975539756397573975839759397603976139762397633976439765397663976739768397693977039771397723977339774397753977639777397783977939780397813978239783397843978539786397873978839789397903979139792397933979439795397963979739798397993980039801398023980339804398053980639807398083980939810398113981239813398143981539816398173981839819398203982139822398233982439825398263982739828398293983039831398323983339834398353983639837398383983939840398413984239843398443984539846398473984839849398503985139852398533985439855398563985739858398593986039861398623986339864398653986639867398683986939870398713987239873398743987539876398773987839879398803988139882398833988439885398863988739888398893989039891398923989339894398953989639897398983989939900399013990239903399043990539906399073990839909399103991139912399133991439915399163991739918399193992039921399223992339924399253992639927399283992939930399313993239933399343993539936399373993839939399403994139942399433994439945399463994739948399493995039951399523995339954399553995639957399583995939960399613996239963399643996539966399673996839969399703997139972399733997439975399763997739978399793998039981399823998339984399853998639987399883998939990399913999239993399943999539996399973999839999400004000140002400034000440005400064000740008400094001040011400124001340014400154001640017400184001940020400214002240023400244002540026400274002840029400304003140032400334003440035400364003740038400394004040041400424004340044400454004640047400484004940050400514005240053400544005540056400574005840059400604006140062400634006440065400664006740068400694007040071400724007340074400754007640077400784007940080400814008240083400844008540086400874008840089400904009140092400934009440095400964009740098400994010040101401024010340104401054010640107401084010940110401114011240113401144011540116401174011840119401204012140122401234012440125401264012740128401294013040131401324013340134401354013640137401384013940140401414014240143401444014540146401474014840149401504015140152401534015440155401564015740158401594016040161401624016340164401654016640167401684016940170401714017240173401744017540176401774017840179401804018140182401834018440185401864018740188401894019040191401924019340194401954019640197401984019940200402014020240203402044020540206402074020840209402104021140212402134021440215402164021740218402194022040221402224022340224402254022640227402284022940230402314023240233402344023540236402374023840239402404024140242402434024440245402464024740248402494025040251402524025340254402554025640257402584025940260402614026240263402644026540266402674026840269402704027140272402734027440275402764027740278402794028040281402824028340284402854028640287402884028940290402914029240293402944029540296402974029840299403004030140302403034030440305403064030740308403094031040311403124031340314403154031640317403184031940320403214032240323403244032540326403274032840329403304033140332403334033440335403364033740338403394034040341403424034340344403454034640347403484034940350403514035240353403544035540356403574035840359403604036140362403634036440365403664036740368403694037040371403724037340374403754037640377403784037940380403814038240383403844038540386403874038840389403904039140392403934039440395403964039740398403994040040401404024040340404404054040640407404084040940410404114041240413404144041540416404174041840419404204042140422404234042440425404264042740428404294043040431404324043340434404354043640437404384043940440404414044240443404444044540446404474044840449404504045140452404534045440455404564045740458404594046040461404624046340464404654046640467404684046940470404714047240473404744047540476404774047840479404804048140482404834048440485404864048740488404894049040491404924049340494404954049640497404984049940500405014050240503405044050540506405074050840509405104051140512405134051440515405164051740518405194052040521405224052340524405254052640527405284052940530405314053240533405344053540536405374053840539405404054140542405434054440545405464054740548405494055040551405524055340554405554055640557405584055940560405614056240563405644056540566405674056840569405704057140572405734057440575405764057740578405794058040581405824058340584405854058640587405884058940590405914059240593405944059540596405974059840599406004060140602406034060440605406064060740608406094061040611406124061340614406154061640617406184061940620406214062240623406244062540626406274062840629406304063140632406334063440635406364063740638406394064040641406424064340644406454064640647406484064940650406514065240653406544065540656406574065840659406604066140662406634066440665406664066740668406694067040671406724067340674406754067640677406784067940680406814068240683406844068540686406874068840689406904069140692406934069440695406964069740698406994070040701407024070340704407054070640707407084070940710407114071240713407144071540716407174071840719407204072140722407234072440725407264072740728407294073040731407324073340734407354073640737407384073940740407414074240743407444074540746407474074840749407504075140752407534075440755407564075740758407594076040761407624076340764407654076640767407684076940770407714077240773407744077540776407774077840779407804078140782407834078440785407864078740788407894079040791407924079340794407954079640797407984079940800408014080240803408044080540806408074080840809408104081140812408134081440815408164081740818408194082040821408224082340824408254082640827408284082940830408314083240833408344083540836408374083840839408404084140842408434084440845408464084740848408494085040851408524085340854408554085640857408584085940860408614086240863408644086540866408674086840869408704087140872408734087440875408764087740878408794088040881408824088340884408854088640887408884088940890408914089240893408944089540896408974089840899409004090140902409034090440905409064090740908409094091040911409124091340914409154091640917409184091940920409214092240923409244092540926409274092840929409304093140932409334093440935409364093740938409394094040941409424094340944409454094640947409484094940950409514095240953409544095540956409574095840959409604096140962409634096440965409664096740968409694097040971409724097340974409754097640977409784097940980409814098240983409844098540986409874098840989409904099140992409934099440995409964099740998409994100041001410024100341004410054100641007410084100941010410114101241013410144101541016410174101841019410204102141022410234102441025410264102741028410294103041031410324103341034410354103641037410384103941040410414104241043410444104541046410474104841049410504105141052410534105441055410564105741058410594106041061410624106341064410654106641067410684106941070410714107241073410744107541076410774107841079410804108141082410834108441085410864108741088410894109041091410924109341094410954109641097410984109941100411014110241103411044110541106411074110841109411104111141112411134111441115411164111741118411194112041121411224112341124411254112641127411284112941130411314113241133411344113541136411374113841139411404114141142411434114441145411464114741148411494115041151411524115341154411554115641157411584115941160411614116241163411644116541166411674116841169411704117141172411734117441175411764117741178411794118041181411824118341184411854118641187411884118941190411914119241193411944119541196411974119841199412004120141202412034120441205412064120741208412094121041211412124121341214412154121641217412184121941220412214122241223412244122541226412274122841229412304123141232412334123441235412364123741238412394124041241412424124341244412454124641247412484124941250412514125241253412544125541256412574125841259412604126141262412634126441265412664126741268412694127041271412724127341274412754127641277412784127941280412814128241283412844128541286412874128841289412904129141292412934129441295412964129741298412994130041301413024130341304413054130641307413084130941310413114131241313413144131541316413174131841319413204132141322413234132441325413264132741328413294133041331413324133341334413354133641337413384133941340413414134241343413444134541346413474134841349413504135141352413534135441355413564135741358413594136041361413624136341364413654136641367413684136941370413714137241373413744137541376413774137841379413804138141382413834138441385413864138741388413894139041391413924139341394413954139641397413984139941400414014140241403414044140541406414074140841409414104141141412414134141441415414164141741418414194142041421414224142341424414254142641427414284142941430414314143241433414344143541436414374143841439414404144141442414434144441445414464144741448414494145041451414524145341454414554145641457414584145941460414614146241463414644146541466414674146841469414704147141472414734147441475414764147741478414794148041481414824148341484414854148641487414884148941490414914149241493414944149541496414974149841499415004150141502415034150441505415064150741508415094151041511415124151341514415154151641517415184151941520415214152241523415244152541526415274152841529415304153141532415334153441535415364153741538415394154041541415424154341544415454154641547415484154941550415514155241553415544155541556415574155841559415604156141562415634156441565415664156741568415694157041571415724157341574415754157641577415784157941580415814158241583415844158541586415874158841589415904159141592415934159441595415964159741598415994160041601416024160341604416054160641607416084160941610416114161241613416144161541616416174161841619416204162141622416234162441625416264162741628416294163041631416324163341634416354163641637416384163941640416414164241643416444164541646416474164841649416504165141652416534165441655416564165741658416594166041661416624166341664416654166641667416684166941670416714167241673416744167541676416774167841679416804168141682416834168441685416864168741688416894169041691416924169341694416954169641697416984169941700417014170241703417044170541706417074170841709417104171141712417134171441715417164171741718417194172041721417224172341724417254172641727417284172941730417314173241733417344173541736417374173841739417404174141742417434174441745417464174741748417494175041751417524175341754417554175641757417584175941760417614176241763417644176541766417674176841769417704177141772417734177441775417764177741778417794178041781417824178341784417854178641787417884178941790417914179241793417944179541796417974179841799418004180141802418034180441805418064180741808418094181041811418124181341814418154181641817418184181941820418214182241823418244182541826418274182841829418304183141832418334183441835418364183741838418394184041841418424184341844418454184641847418484184941850418514185241853418544185541856418574185841859418604186141862418634186441865418664186741868418694187041871418724187341874418754187641877418784187941880418814188241883418844188541886418874188841889418904189141892418934189441895418964189741898418994190041901419024190341904419054190641907419084190941910419114191241913419144191541916419174191841919419204192141922419234192441925419264192741928419294193041931419324193341934419354193641937419384193941940419414194241943419444194541946419474194841949419504195141952419534195441955419564195741958419594196041961419624196341964419654196641967419684196941970419714197241973419744197541976419774197841979419804198141982419834198441985419864198741988419894199041991419924199341994419954199641997419984199942000420014200242003420044200542006420074200842009420104201142012420134201442015420164201742018420194202042021420224202342024420254202642027420284202942030420314203242033420344203542036420374203842039420404204142042420434204442045420464204742048420494205042051420524205342054420554205642057420584205942060420614206242063420644206542066420674206842069420704207142072420734207442075420764207742078420794208042081420824208342084420854208642087420884208942090420914209242093420944209542096420974209842099421004210142102421034210442105421064210742108421094211042111421124211342114421154211642117421184211942120421214212242123421244212542126421274212842129421304213142132421334213442135421364213742138421394214042141421424214342144421454214642147421484214942150421514215242153421544215542156421574215842159421604216142162421634216442165421664216742168421694217042171421724217342174421754217642177421784217942180421814218242183421844218542186421874218842189421904219142192421934219442195421964219742198421994220042201422024220342204422054220642207422084220942210422114221242213422144221542216422174221842219422204222142222422234222442225422264222742228422294223042231422324223342234422354223642237422384223942240422414224242243422444224542246422474224842249422504225142252422534225442255422564225742258422594226042261422624226342264422654226642267422684226942270422714227242273422744227542276422774227842279422804228142282422834228442285422864228742288422894229042291422924229342294422954229642297422984229942300423014230242303423044230542306423074230842309423104231142312423134231442315423164231742318423194232042321423224232342324423254232642327423284232942330423314233242333423344233542336423374233842339423404234142342423434234442345423464234742348423494235042351423524235342354423554235642357423584235942360423614236242363423644236542366423674236842369423704237142372423734237442375423764237742378423794238042381423824238342384423854238642387423884238942390423914239242393423944239542396423974239842399424004240142402424034240442405424064240742408424094241042411424124241342414424154241642417424184241942420424214242242423424244242542426424274242842429424304243142432424334243442435424364243742438424394244042441424424244342444424454244642447424484244942450424514245242453424544245542456424574245842459424604246142462424634246442465424664246742468424694247042471424724247342474424754247642477424784247942480424814248242483424844248542486424874248842489424904249142492424934249442495424964249742498424994250042501425024250342504425054250642507425084250942510425114251242513425144251542516425174251842519425204252142522425234252442525425264252742528425294253042531425324253342534425354253642537425384253942540425414254242543425444254542546425474254842549425504255142552425534255442555425564255742558425594256042561425624256342564425654256642567425684256942570425714257242573425744257542576425774257842579425804258142582425834258442585425864258742588425894259042591425924259342594425954259642597425984259942600426014260242603426044260542606426074260842609426104261142612426134261442615426164261742618426194262042621426224262342624426254262642627426284262942630426314263242633426344263542636426374263842639426404264142642426434264442645426464264742648426494265042651426524265342654426554265642657426584265942660426614266242663426644266542666426674266842669426704267142672426734267442675426764267742678426794268042681426824268342684426854268642687426884268942690426914269242693426944269542696426974269842699427004270142702427034270442705427064270742708427094271042711427124271342714427154271642717427184271942720427214272242723427244272542726427274272842729427304273142732427334273442735427364273742738427394274042741427424274342744427454274642747427484274942750427514275242753427544275542756427574275842759427604276142762427634276442765427664276742768427694277042771427724277342774427754277642777427784277942780427814278242783427844278542786427874278842789427904279142792427934279442795427964279742798427994280042801428024280342804428054280642807428084280942810428114281242813428144281542816428174281842819428204282142822428234282442825428264282742828428294283042831428324283342834428354283642837428384283942840428414284242843428444284542846428474284842849428504285142852428534285442855428564285742858428594286042861428624286342864428654286642867428684286942870428714287242873428744287542876428774287842879428804288142882428834288442885428864288742888428894289042891428924289342894428954289642897428984289942900429014290242903429044290542906429074290842909429104291142912429134291442915429164291742918429194292042921429224292342924429254292642927429284292942930429314293242933429344293542936429374293842939429404294142942429434294442945429464294742948429494295042951429524295342954429554295642957429584295942960429614296242963429644296542966429674296842969429704297142972429734297442975429764297742978429794298042981429824298342984429854298642987429884298942990429914299242993429944299542996429974299842999430004300143002430034300443005430064300743008430094301043011430124301343014430154301643017430184301943020430214302243023430244302543026430274302843029430304303143032430334303443035430364303743038430394304043041430424304343044430454304643047430484304943050430514305243053430544305543056430574305843059430604306143062430634306443065430664306743068430694307043071430724307343074430754307643077430784307943080430814308243083430844308543086430874308843089430904309143092430934309443095430964309743098430994310043101431024310343104431054310643107431084310943110431114311243113431144311543116431174311843119431204312143122431234312443125431264312743128431294313043131431324313343134431354313643137431384313943140431414314243143431444314543146431474314843149431504315143152431534315443155431564315743158431594316043161431624316343164431654316643167431684316943170431714317243173431744317543176431774317843179431804318143182431834318443185431864318743188431894319043191431924319343194431954319643197431984319943200432014320243203432044320543206432074320843209432104321143212432134321443215432164321743218432194322043221432224322343224432254322643227432284322943230432314323243233432344323543236432374323843239432404324143242432434324443245432464324743248432494325043251432524325343254432554325643257432584325943260432614326243263432644326543266432674326843269432704327143272432734327443275432764327743278432794328043281432824328343284432854328643287432884328943290432914329243293432944329543296432974329843299433004330143302433034330443305433064330743308433094331043311433124331343314433154331643317433184331943320433214332243323433244332543326433274332843329433304333143332433334333443335433364333743338433394334043341433424334343344433454334643347433484334943350433514335243353433544335543356433574335843359433604336143362433634336443365433664336743368433694337043371433724337343374433754337643377433784337943380433814338243383433844338543386433874338843389433904339143392433934339443395433964339743398433994340043401434024340343404434054340643407434084340943410434114341243413434144341543416434174341843419434204342143422434234342443425434264342743428434294343043431434324343343434434354343643437434384343943440434414344243443434444344543446434474344843449434504345143452434534345443455434564345743458434594346043461434624346343464434654346643467434684346943470434714347243473434744347543476434774347843479434804348143482434834348443485434864348743488434894349043491434924349343494434954349643497434984349943500435014350243503435044350543506435074350843509435104351143512435134351443515435164351743518435194352043521435224352343524435254352643527435284352943530435314353243533435344353543536435374353843539435404354143542435434354443545435464354743548435494355043551435524355343554435554355643557435584355943560435614356243563435644356543566435674356843569435704357143572435734357443575435764357743578435794358043581435824358343584435854358643587435884358943590435914359243593435944359543596435974359843599436004360143602436034360443605436064360743608436094361043611436124361343614436154361643617436184361943620436214362243623436244362543626436274362843629436304363143632436334363443635436364363743638436394364043641436424364343644436454364643647436484364943650436514365243653436544365543656436574365843659436604366143662436634366443665436664366743668436694367043671436724367343674436754367643677436784367943680436814368243683436844368543686436874368843689436904369143692436934369443695436964369743698436994370043701437024370343704437054370643707437084370943710437114371243713437144371543716437174371843719437204372143722437234372443725437264372743728437294373043731437324373343734437354373643737437384373943740437414374243743437444374543746437474374843749437504375143752437534375443755437564375743758437594376043761437624376343764437654376643767437684376943770437714377243773437744377543776437774377843779437804378143782437834378443785437864378743788437894379043791437924379343794437954379643797437984379943800438014380243803438044380543806438074380843809438104381143812438134381443815438164381743818438194382043821438224382343824438254382643827438284382943830438314383243833438344383543836438374383843839438404384143842438434384443845438464384743848438494385043851438524385343854438554385643857438584385943860438614386243863438644386543866438674386843869438704387143872438734387443875438764387743878438794388043881438824388343884438854388643887438884388943890438914389243893438944389543896438974389843899439004390143902439034390443905439064390743908439094391043911439124391343914439154391643917439184391943920439214392243923439244392543926439274392843929439304393143932439334393443935439364393743938439394394043941439424394343944439454394643947439484394943950439514395243953439544395543956439574395843959439604396143962439634396443965439664396743968439694397043971439724397343974439754397643977439784397943980439814398243983439844398543986439874398843989439904399143992439934399443995439964399743998439994400044001440024400344004440054400644007440084400944010440114401244013440144401544016440174401844019440204402144022440234402444025440264402744028440294403044031440324403344034440354403644037440384403944040440414404244043440444404544046440474404844049440504405144052440534405444055440564405744058440594406044061440624406344064440654406644067440684406944070440714407244073440744407544076440774407844079440804408144082440834408444085440864408744088440894409044091440924409344094440954409644097440984409944100441014410244103441044410544106441074410844109441104411144112441134411444115441164411744118441194412044121441224412344124441254412644127441284412944130441314413244133441344413544136441374413844139441404414144142441434414444145441464414744148441494415044151441524415344154441554415644157441584415944160441614416244163441644416544166441674416844169441704417144172441734417444175441764417744178441794418044181441824418344184441854418644187441884418944190441914419244193441944419544196441974419844199442004420144202442034420444205442064420744208442094421044211442124421344214442154421644217442184421944220442214422244223442244422544226442274422844229442304423144232442334423444235442364423744238442394424044241442424424344244442454424644247442484424944250442514425244253442544425544256442574425844259442604426144262442634426444265442664426744268442694427044271442724427344274442754427644277442784427944280442814428244283442844428544286442874428844289442904429144292442934429444295442964429744298442994430044301443024430344304443054430644307443084430944310443114431244313443144431544316443174431844319443204432144322443234432444325443264432744328443294433044331443324433344334443354433644337443384433944340443414434244343443444434544346443474434844349443504435144352443534435444355443564435744358443594436044361443624436344364443654436644367443684436944370443714437244373443744437544376443774437844379443804438144382443834438444385443864438744388443894439044391443924439344394443954439644397443984439944400444014440244403444044440544406444074440844409444104441144412444134441444415444164441744418444194442044421444224442344424444254442644427444284442944430444314443244433444344443544436444374443844439444404444144442444434444444445444464444744448444494445044451444524445344454444554445644457444584445944460444614446244463444644446544466444674446844469444704447144472444734447444475444764447744478444794448044481444824448344484444854448644487444884448944490444914449244493444944449544496444974449844499445004450144502445034450444505445064450744508445094451044511445124451344514445154451644517445184451944520445214452244523445244452544526445274452844529445304453144532445334453444535445364453744538445394454044541445424454344544445454454644547445484454944550445514455244553445544455544556445574455844559445604456144562445634456444565445664456744568445694457044571445724457344574445754457644577445784457944580445814458244583445844458544586445874458844589445904459144592445934459444595445964459744598445994460044601446024460344604446054460644607446084460944610446114461244613446144461544616446174461844619446204462144622446234462444625446264462744628446294463044631446324463344634446354463644637446384463944640446414464244643446444464544646446474464844649446504465144652446534465444655446564465744658446594466044661446624466344664446654466644667446684466944670446714467244673446744467544676446774467844679446804468144682446834468444685446864468744688446894469044691446924469344694446954469644697446984469944700447014470244703447044470544706447074470844709447104471144712447134471444715447164471744718447194472044721447224472344724447254472644727447284472944730447314473244733447344473544736447374473844739447404474144742447434474444745447464474744748447494475044751447524475344754447554475644757447584475944760447614476244763447644476544766447674476844769447704477144772447734477444775447764477744778447794478044781447824478344784447854478644787447884478944790447914479244793447944479544796447974479844799448004480144802448034480444805448064480744808448094481044811448124481344814448154481644817448184481944820448214482244823448244482544826448274482844829448304483144832448334483444835448364483744838448394484044841448424484344844448454484644847448484484944850448514485244853448544485544856448574485844859448604486144862448634486444865448664486744868448694487044871448724487344874448754487644877448784487944880448814488244883448844488544886448874488844889448904489144892448934489444895448964489744898448994490044901449024490344904449054490644907449084490944910449114491244913449144491544916449174491844919449204492144922449234492444925449264492744928449294493044931449324493344934449354493644937449384493944940449414494244943449444494544946449474494844949449504495144952449534495444955449564495744958449594496044961449624496344964449654496644967449684496944970449714497244973449744497544976449774497844979449804498144982449834498444985449864498744988449894499044991449924499344994449954499644997449984499945000450014500245003450044500545006450074500845009450104501145012450134501445015450164501745018450194502045021450224502345024450254502645027450284502945030450314503245033450344503545036450374503845039450404504145042450434504445045450464504745048450494505045051450524505345054450554505645057450584505945060450614506245063450644506545066450674506845069450704507145072450734507445075450764507745078450794508045081450824508345084450854508645087450884508945090450914509245093450944509545096450974509845099451004510145102451034510445105451064510745108451094511045111451124511345114451154511645117451184511945120451214512245123451244512545126451274512845129451304513145132451334513445135451364513745138451394514045141451424514345144451454514645147451484514945150451514515245153451544515545156451574515845159451604516145162451634516445165451664516745168451694517045171451724517345174451754517645177451784517945180451814518245183451844518545186451874518845189451904519145192451934519445195451964519745198451994520045201452024520345204452054520645207452084520945210452114521245213452144521545216452174521845219452204522145222452234522445225452264522745228452294523045231452324523345234452354523645237452384523945240452414524245243452444524545246452474524845249452504525145252452534525445255452564525745258452594526045261452624526345264452654526645267452684526945270452714527245273452744527545276452774527845279452804528145282452834528445285452864528745288452894529045291452924529345294452954529645297452984529945300453014530245303453044530545306453074530845309453104531145312453134531445315453164531745318453194532045321453224532345324453254532645327453284532945330453314533245333453344533545336453374533845339453404534145342453434534445345453464534745348453494535045351453524535345354453554535645357453584535945360453614536245363453644536545366453674536845369453704537145372453734537445375453764537745378453794538045381453824538345384453854538645387453884538945390453914539245393453944539545396453974539845399454004540145402454034540445405454064540745408454094541045411454124541345414454154541645417454184541945420454214542245423454244542545426454274542845429454304543145432454334543445435454364543745438454394544045441454424544345444454454544645447454484544945450454514545245453454544545545456454574545845459454604546145462454634546445465454664546745468454694547045471454724547345474454754547645477454784547945480454814548245483454844548545486454874548845489454904549145492454934549445495454964549745498454994550045501455024550345504455054550645507455084550945510455114551245513455144551545516455174551845519455204552145522455234552445525455264552745528455294553045531455324553345534455354553645537455384553945540455414554245543455444554545546455474554845549455504555145552455534555445555455564555745558455594556045561455624556345564455654556645567455684556945570455714557245573455744557545576455774557845579455804558145582455834558445585455864558745588455894559045591455924559345594455954559645597455984559945600456014560245603456044560545606456074560845609456104561145612456134561445615456164561745618456194562045621456224562345624456254562645627456284562945630456314563245633456344563545636456374563845639456404564145642456434564445645456464564745648456494565045651456524565345654456554565645657456584565945660456614566245663456644566545666456674566845669456704567145672456734567445675456764567745678456794568045681456824568345684456854568645687456884568945690456914569245693456944569545696456974569845699457004570145702457034570445705457064570745708457094571045711457124571345714457154571645717457184571945720457214572245723457244572545726457274572845729457304573145732457334573445735457364573745738457394574045741457424574345744457454574645747457484574945750457514575245753457544575545756457574575845759457604576145762457634576445765457664576745768457694577045771457724577345774457754577645777457784577945780457814578245783457844578545786457874578845789457904579145792457934579445795457964579745798457994580045801458024580345804458054580645807458084580945810458114581245813458144581545816458174581845819458204582145822458234582445825458264582745828458294583045831458324583345834458354583645837458384583945840458414584245843458444584545846458474584845849458504585145852458534585445855458564585745858458594586045861458624586345864458654586645867458684586945870458714587245873458744587545876458774587845879458804588145882458834588445885458864588745888458894589045891458924589345894458954589645897458984589945900459014590245903459044590545906459074590845909459104591145912459134591445915459164591745918459194592045921459224592345924459254592645927459284592945930459314593245933459344593545936459374593845939459404594145942459434594445945459464594745948459494595045951459524595345954459554595645957459584595945960459614596245963459644596545966459674596845969459704597145972459734597445975459764597745978459794598045981459824598345984459854598645987459884598945990459914599245993459944599545996459974599845999460004600146002460034600446005460064600746008460094601046011460124601346014460154601646017460184601946020460214602246023460244602546026460274602846029460304603146032460334603446035460364603746038460394604046041460424604346044460454604646047460484604946050460514605246053460544605546056460574605846059460604606146062460634606446065460664606746068460694607046071460724607346074460754607646077460784607946080460814608246083460844608546086460874608846089460904609146092460934609446095460964609746098460994610046101461024610346104461054610646107461084610946110461114611246113461144611546116461174611846119461204612146122461234612446125461264612746128461294613046131461324613346134461354613646137461384613946140461414614246143461444614546146461474614846149461504615146152461534615446155461564615746158461594616046161461624616346164461654616646167461684616946170461714617246173461744617546176461774617846179461804618146182461834618446185461864618746188461894619046191461924619346194461954619646197461984619946200462014620246203462044620546206462074620846209462104621146212462134621446215462164621746218462194622046221462224622346224462254622646227462284622946230462314623246233462344623546236462374623846239462404624146242462434624446245462464624746248462494625046251462524625346254462554625646257462584625946260462614626246263462644626546266462674626846269462704627146272462734627446275462764627746278462794628046281462824628346284462854628646287462884628946290462914629246293462944629546296462974629846299463004630146302463034630446305463064630746308463094631046311463124631346314463154631646317463184631946320463214632246323463244632546326463274632846329463304633146332463334633446335463364633746338463394634046341463424634346344463454634646347463484634946350463514635246353463544635546356463574635846359463604636146362463634636446365463664636746368463694637046371463724637346374463754637646377463784637946380463814638246383463844638546386463874638846389463904639146392463934639446395463964639746398463994640046401464024640346404464054640646407464084640946410464114641246413464144641546416464174641846419464204642146422464234642446425464264642746428464294643046431464324643346434464354643646437464384643946440464414644246443464444644546446464474644846449464504645146452464534645446455464564645746458464594646046461464624646346464464654646646467464684646946470464714647246473464744647546476464774647846479464804648146482464834648446485464864648746488464894649046491464924649346494464954649646497464984649946500465014650246503465044650546506465074650846509465104651146512465134651446515465164651746518465194652046521465224652346524465254652646527465284652946530465314653246533465344653546536465374653846539465404654146542465434654446545465464654746548465494655046551465524655346554465554655646557465584655946560465614656246563465644656546566465674656846569465704657146572465734657446575465764657746578465794658046581465824658346584465854658646587465884658946590465914659246593465944659546596465974659846599466004660146602466034660446605466064660746608466094661046611466124661346614466154661646617466184661946620466214662246623466244662546626466274662846629466304663146632466334663446635466364663746638466394664046641466424664346644466454664646647466484664946650466514665246653466544665546656466574665846659466604666146662466634666446665466664666746668466694667046671466724667346674466754667646677466784667946680466814668246683466844668546686466874668846689466904669146692466934669446695466964669746698466994670046701467024670346704467054670646707467084670946710467114671246713467144671546716467174671846719467204672146722467234672446725467264672746728467294673046731467324673346734467354673646737467384673946740467414674246743467444674546746467474674846749467504675146752467534675446755467564675746758467594676046761467624676346764467654676646767467684676946770467714677246773467744677546776467774677846779467804678146782467834678446785467864678746788467894679046791467924679346794467954679646797467984679946800468014680246803468044680546806468074680846809468104681146812468134681446815468164681746818468194682046821468224682346824468254682646827468284682946830468314683246833468344683546836468374683846839468404684146842468434684446845468464684746848468494685046851468524685346854468554685646857468584685946860468614686246863468644686546866468674686846869468704687146872468734687446875468764687746878468794688046881468824688346884468854688646887468884688946890468914689246893468944689546896468974689846899469004690146902469034690446905469064690746908469094691046911469124691346914469154691646917469184691946920469214692246923469244692546926469274692846929469304693146932469334693446935469364693746938469394694046941469424694346944469454694646947469484694946950469514695246953469544695546956469574695846959469604696146962469634696446965469664696746968469694697046971469724697346974469754697646977469784697946980469814698246983469844698546986469874698846989469904699146992469934699446995469964699746998469994700047001470024700347004470054700647007470084700947010470114701247013470144701547016470174701847019470204702147022470234702447025470264702747028470294703047031470324703347034470354703647037470384703947040470414704247043470444704547046470474704847049470504705147052470534705447055470564705747058470594706047061470624706347064470654706647067470684706947070470714707247073470744707547076470774707847079470804708147082470834708447085470864708747088470894709047091470924709347094470954709647097470984709947100471014710247103471044710547106471074710847109471104711147112471134711447115471164711747118471194712047121471224712347124471254712647127471284712947130471314713247133471344713547136471374713847139471404714147142471434714447145471464714747148471494715047151471524715347154471554715647157471584715947160471614716247163471644716547166471674716847169471704717147172471734717447175471764717747178471794718047181471824718347184471854718647187471884718947190471914719247193471944719547196471974719847199472004720147202472034720447205472064720747208472094721047211472124721347214472154721647217472184721947220472214722247223472244722547226472274722847229472304723147232472334723447235472364723747238472394724047241472424724347244472454724647247472484724947250472514725247253472544725547256472574725847259472604726147262472634726447265472664726747268472694727047271472724727347274472754727647277472784727947280472814728247283472844728547286472874728847289472904729147292472934729447295472964729747298472994730047301473024730347304473054730647307473084730947310473114731247313473144731547316473174731847319473204732147322473234732447325473264732747328473294733047331473324733347334473354733647337473384733947340473414734247343473444734547346473474734847349473504735147352473534735447355473564735747358473594736047361473624736347364473654736647367473684736947370473714737247373473744737547376473774737847379473804738147382473834738447385473864738747388473894739047391473924739347394473954739647397473984739947400474014740247403474044740547406474074740847409474104741147412474134741447415474164741747418474194742047421474224742347424474254742647427474284742947430474314743247433474344743547436474374743847439474404744147442474434744447445474464744747448474494745047451474524745347454474554745647457474584745947460474614746247463474644746547466474674746847469474704747147472474734747447475474764747747478474794748047481474824748347484474854748647487474884748947490474914749247493474944749547496474974749847499475004750147502475034750447505475064750747508475094751047511475124751347514475154751647517475184751947520475214752247523475244752547526475274752847529475304753147532475334753447535475364753747538475394754047541475424754347544475454754647547475484754947550475514755247553475544755547556475574755847559475604756147562475634756447565475664756747568475694757047571475724757347574475754757647577475784757947580475814758247583475844758547586475874758847589475904759147592475934759447595475964759747598475994760047601476024760347604476054760647607476084760947610476114761247613476144761547616476174761847619476204762147622476234762447625476264762747628476294763047631476324763347634476354763647637476384763947640476414764247643476444764547646476474764847649476504765147652476534765447655476564765747658476594766047661476624766347664476654766647667476684766947670476714767247673476744767547676476774767847679476804768147682476834768447685476864768747688476894769047691476924769347694476954769647697476984769947700477014770247703477044770547706477074770847709477104771147712477134771447715477164771747718477194772047721477224772347724477254772647727477284772947730477314773247733477344773547736477374773847739477404774147742477434774447745477464774747748477494775047751477524775347754477554775647757477584775947760477614776247763477644776547766477674776847769477704777147772477734777447775477764777747778477794778047781477824778347784477854778647787477884778947790477914779247793477944779547796477974779847799478004780147802478034780447805478064780747808478094781047811478124781347814478154781647817478184781947820478214782247823478244782547826478274782847829478304783147832478334783447835478364783747838478394784047841478424784347844478454784647847478484784947850478514785247853478544785547856478574785847859478604786147862478634786447865478664786747868478694787047871478724787347874478754787647877478784787947880478814788247883478844788547886478874788847889478904789147892478934789447895478964789747898478994790047901479024790347904479054790647907479084790947910479114791247913479144791547916479174791847919479204792147922479234792447925479264792747928479294793047931479324793347934479354793647937479384793947940479414794247943479444794547946479474794847949479504795147952479534795447955479564795747958479594796047961479624796347964479654796647967479684796947970479714797247973479744797547976479774797847979479804798147982479834798447985479864798747988479894799047991479924799347994479954799647997479984799948000480014800248003480044800548006480074800848009480104801148012480134801448015480164801748018480194802048021480224802348024480254802648027480284802948030480314803248033480344803548036480374803848039480404804148042480434804448045480464804748048480494805048051480524805348054480554805648057480584805948060480614806248063480644806548066480674806848069480704807148072480734807448075480764807748078480794808048081480824808348084480854808648087480884808948090480914809248093480944809548096480974809848099481004810148102481034810448105481064810748108481094811048111481124811348114481154811648117481184811948120481214812248123481244812548126481274812848129481304813148132481334813448135481364813748138481394814048141481424814348144481454814648147481484814948150481514815248153481544815548156481574815848159481604816148162481634816448165481664816748168481694817048171481724817348174481754817648177481784817948180481814818248183481844818548186481874818848189481904819148192481934819448195481964819748198481994820048201482024820348204482054820648207482084820948210482114821248213482144821548216482174821848219482204822148222482234822448225482264822748228482294823048231482324823348234482354823648237482384823948240482414824248243482444824548246482474824848249482504825148252482534825448255482564825748258482594826048261482624826348264482654826648267482684826948270482714827248273482744827548276482774827848279482804828148282482834828448285482864828748288482894829048291482924829348294482954829648297482984829948300483014830248303483044830548306483074830848309483104831148312483134831448315483164831748318483194832048321483224832348324483254832648327483284832948330483314833248333483344833548336483374833848339483404834148342483434834448345483464834748348483494835048351483524835348354483554835648357483584835948360483614836248363483644836548366483674836848369483704837148372483734837448375483764837748378483794838048381483824838348384483854838648387483884838948390483914839248393483944839548396483974839848399484004840148402484034840448405484064840748408484094841048411484124841348414484154841648417484184841948420484214842248423484244842548426484274842848429484304843148432484334843448435484364843748438484394844048441484424844348444484454844648447484484844948450484514845248453484544845548456484574845848459484604846148462484634846448465484664846748468484694847048471484724847348474484754847648477484784847948480484814848248483484844848548486484874848848489484904849148492484934849448495484964849748498484994850048501485024850348504485054850648507485084850948510485114851248513485144851548516485174851848519485204852148522485234852448525485264852748528485294853048531485324853348534485354853648537485384853948540485414854248543485444854548546485474854848549485504855148552485534855448555485564855748558485594856048561485624856348564485654856648567485684856948570485714857248573485744857548576485774857848579485804858148582485834858448585485864858748588485894859048591485924859348594485954859648597485984859948600486014860248603486044860548606486074860848609486104861148612486134861448615486164861748618486194862048621486224862348624486254862648627486284862948630486314863248633486344863548636486374863848639486404864148642486434864448645486464864748648486494865048651486524865348654486554865648657486584865948660486614866248663486644866548666486674866848669486704867148672486734867448675486764867748678486794868048681486824868348684486854868648687486884868948690486914869248693486944869548696486974869848699487004870148702487034870448705487064870748708487094871048711487124871348714487154871648717487184871948720487214872248723487244872548726487274872848729487304873148732487334873448735487364873748738487394874048741487424874348744487454874648747487484874948750487514875248753487544875548756487574875848759487604876148762487634876448765487664876748768487694877048771487724877348774487754877648777487784877948780487814878248783487844878548786487874878848789487904879148792487934879448795487964879748798487994880048801488024880348804488054880648807488084880948810488114881248813488144881548816488174881848819488204882148822488234882448825488264882748828488294883048831488324883348834488354883648837488384883948840488414884248843488444884548846488474884848849488504885148852488534885448855488564885748858488594886048861488624886348864488654886648867488684886948870488714887248873488744887548876488774887848879488804888148882488834888448885488864888748888488894889048891488924889348894488954889648897488984889948900489014890248903489044890548906489074890848909489104891148912489134891448915489164891748918489194892048921489224892348924489254892648927489284892948930489314893248933489344893548936489374893848939489404894148942489434894448945489464894748948489494895048951489524895348954489554895648957489584895948960489614896248963489644896548966489674896848969489704897148972489734897448975489764897748978489794898048981489824898348984489854898648987489884898948990489914899248993489944899548996489974899848999490004900149002490034900449005490064900749008490094901049011490124901349014490154901649017490184901949020490214902249023490244902549026490274902849029490304903149032490334903449035490364903749038490394904049041490424904349044490454904649047490484904949050490514905249053490544905549056490574905849059490604906149062490634906449065490664906749068490694907049071490724907349074490754907649077490784907949080490814908249083490844908549086490874908849089490904909149092490934909449095490964909749098490994910049101491024910349104491054910649107491084910949110491114911249113491144911549116491174911849119491204912149122491234912449125491264912749128491294913049131491324913349134491354913649137491384913949140491414914249143491444914549146491474914849149491504915149152491534915449155491564915749158491594916049161491624916349164491654916649167491684916949170491714917249173491744917549176491774917849179491804918149182491834918449185491864918749188491894919049191491924919349194491954919649197491984919949200492014920249203492044920549206492074920849209492104921149212492134921449215492164921749218492194922049221492224922349224492254922649227492284922949230492314923249233492344923549236492374923849239492404924149242492434924449245492464924749248492494925049251492524925349254492554925649257492584925949260492614926249263492644926549266492674926849269492704927149272492734927449275492764927749278492794928049281492824928349284492854928649287492884928949290492914929249293492944929549296492974929849299493004930149302493034930449305493064930749308493094931049311493124931349314493154931649317493184931949320493214932249323493244932549326493274932849329493304933149332493334933449335493364933749338493394934049341493424934349344493454934649347493484934949350493514935249353493544935549356493574935849359493604936149362493634936449365493664936749368493694937049371493724937349374493754937649377493784937949380493814938249383493844938549386493874938849389493904939149392493934939449395493964939749398493994940049401494024940349404494054940649407494084940949410494114941249413494144941549416494174941849419494204942149422494234942449425494264942749428494294943049431494324943349434494354943649437494384943949440494414944249443494444944549446494474944849449494504945149452494534945449455494564945749458494594946049461494624946349464494654946649467494684946949470494714947249473494744947549476494774947849479494804948149482494834948449485494864948749488494894949049491494924949349494494954949649497494984949949500495014950249503495044950549506495074950849509495104951149512495134951449515495164951749518495194952049521495224952349524495254952649527495284952949530495314953249533495344953549536495374953849539495404954149542495434954449545495464954749548495494955049551495524955349554495554955649557495584955949560495614956249563495644956549566495674956849569495704957149572495734957449575495764957749578495794958049581495824958349584495854958649587495884958949590495914959249593495944959549596495974959849599496004960149602496034960449605496064960749608496094961049611496124961349614496154961649617496184961949620496214962249623496244962549626496274962849629496304963149632496334963449635496364963749638496394964049641496424964349644496454964649647496484964949650496514965249653496544965549656496574965849659496604966149662496634966449665496664966749668496694967049671496724967349674496754967649677496784967949680496814968249683496844968549686496874968849689496904969149692496934969449695496964969749698496994970049701497024970349704497054970649707497084970949710497114971249713497144971549716497174971849719497204972149722497234972449725497264972749728497294973049731497324973349734497354973649737497384973949740497414974249743497444974549746497474974849749497504975149752497534975449755497564975749758497594976049761497624976349764497654976649767497684976949770497714977249773497744977549776497774977849779497804978149782497834978449785497864978749788497894979049791497924979349794497954979649797497984979949800498014980249803498044980549806498074980849809498104981149812498134981449815498164981749818498194982049821498224982349824498254982649827498284982949830498314983249833498344983549836498374983849839498404984149842498434984449845498464984749848498494985049851498524985349854498554985649857498584985949860498614986249863498644986549866498674986849869498704987149872498734987449875498764987749878498794988049881498824988349884498854988649887498884988949890498914989249893498944989549896498974989849899499004990149902499034990449905499064990749908499094991049911499124991349914499154991649917499184991949920499214992249923499244992549926499274992849929499304993149932499334993449935499364993749938499394994049941499424994349944499454994649947499484994949950499514995249953499544995549956499574995849959499604996149962499634996449965499664996749968499694997049971499724997349974499754997649977499784997949980499814998249983499844998549986499874998849989499904999149992499934999449995499964999749998499995000050001500025000350004500055000650007500085000950010500115001250013500145001550016500175001850019500205002150022500235002450025500265002750028500295003050031500325003350034500355003650037500385003950040500415004250043500445004550046500475004850049500505005150052500535005450055500565005750058500595006050061500625006350064500655006650067500685006950070500715007250073500745007550076500775007850079500805008150082500835008450085500865008750088500895009050091500925009350094500955009650097500985009950100501015010250103501045010550106501075010850109501105011150112501135011450115501165011750118501195012050121501225012350124501255012650127501285012950130501315013250133501345013550136501375013850139501405014150142501435014450145501465014750148501495015050151501525015350154501555015650157501585015950160501615016250163501645016550166501675016850169501705017150172501735017450175501765017750178501795018050181501825018350184501855018650187501885018950190501915019250193501945019550196501975019850199502005020150202502035020450205502065020750208502095021050211502125021350214502155021650217502185021950220502215022250223502245022550226502275022850229502305023150232502335023450235502365023750238502395024050241502425024350244502455024650247502485024950250502515025250253502545025550256502575025850259502605026150262502635026450265502665026750268502695027050271502725027350274502755027650277502785027950280502815028250283502845028550286502875028850289502905029150292502935029450295502965029750298502995030050301503025030350304503055030650307503085030950310503115031250313503145031550316503175031850319503205032150322503235032450325503265032750328503295033050331503325033350334503355033650337503385033950340503415034250343503445034550346503475034850349503505035150352503535035450355503565035750358503595036050361503625036350364503655036650367503685036950370503715037250373503745037550376503775037850379503805038150382503835038450385503865038750388503895039050391503925039350394503955039650397503985039950400504015040250403504045040550406504075040850409504105041150412504135041450415504165041750418504195042050421504225042350424504255042650427504285042950430504315043250433504345043550436504375043850439504405044150442504435044450445504465044750448504495045050451504525045350454504555045650457504585045950460504615046250463504645046550466504675046850469504705047150472504735047450475504765047750478504795048050481504825048350484504855048650487504885048950490504915049250493504945049550496504975049850499505005050150502505035050450505505065050750508505095051050511505125051350514505155051650517505185051950520505215052250523505245052550526505275052850529505305053150532505335053450535505365053750538505395054050541505425054350544505455054650547505485054950550505515055250553505545055550556505575055850559505605056150562505635056450565505665056750568505695057050571505725057350574505755057650577505785057950580505815058250583505845058550586505875058850589505905059150592505935059450595505965059750598505995060050601506025060350604506055060650607506085060950610506115061250613506145061550616506175061850619506205062150622506235062450625506265062750628506295063050631506325063350634506355063650637506385063950640506415064250643506445064550646506475064850649506505065150652506535065450655506565065750658506595066050661506625066350664506655066650667506685066950670506715067250673506745067550676506775067850679506805068150682506835068450685506865068750688506895069050691506925069350694506955069650697506985069950700507015070250703507045070550706507075070850709507105071150712507135071450715507165071750718507195072050721507225072350724507255072650727507285072950730507315073250733507345073550736507375073850739507405074150742507435074450745507465074750748507495075050751507525075350754507555075650757507585075950760507615076250763507645076550766507675076850769507705077150772507735077450775507765077750778507795078050781507825078350784507855078650787507885078950790507915079250793507945079550796507975079850799508005080150802508035080450805508065080750808508095081050811508125081350814508155081650817508185081950820508215082250823508245082550826508275082850829508305083150832508335083450835508365083750838508395084050841508425084350844508455084650847508485084950850508515085250853508545085550856508575085850859508605086150862508635086450865508665086750868508695087050871508725087350874508755087650877508785087950880508815088250883508845088550886508875088850889508905089150892508935089450895508965089750898508995090050901509025090350904509055090650907509085090950910509115091250913509145091550916509175091850919509205092150922509235092450925509265092750928509295093050931509325093350934509355093650937509385093950940509415094250943509445094550946509475094850949509505095150952509535095450955509565095750958509595096050961509625096350964509655096650967509685096950970509715097250973509745097550976509775097850979509805098150982509835098450985509865098750988509895099050991509925099350994509955099650997509985099951000510015100251003510045100551006510075100851009510105101151012510135101451015510165101751018510195102051021510225102351024510255102651027510285102951030510315103251033510345103551036510375103851039510405104151042510435104451045510465104751048510495105051051510525105351054510555105651057510585105951060510615106251063510645106551066510675106851069510705107151072510735107451075510765107751078510795108051081510825108351084510855108651087510885108951090510915109251093510945109551096510975109851099511005110151102511035110451105511065110751108511095111051111511125111351114511155111651117511185111951120511215112251123511245112551126511275112851129511305113151132511335113451135511365113751138511395114051141511425114351144511455114651147511485114951150511515115251153511545115551156511575115851159511605116151162511635116451165511665116751168511695117051171511725117351174511755117651177511785117951180511815118251183511845118551186511875118851189511905119151192511935119451195511965119751198511995120051201512025120351204512055120651207512085120951210512115121251213512145121551216512175121851219512205122151222512235122451225512265122751228512295123051231512325123351234512355123651237512385123951240512415124251243512445124551246512475124851249512505125151252512535125451255512565125751258512595126051261512625126351264512655126651267512685126951270512715127251273512745127551276512775127851279512805128151282512835128451285512865128751288512895129051291512925129351294512955129651297512985129951300513015130251303513045130551306513075130851309513105131151312513135131451315513165131751318513195132051321513225132351324513255132651327513285132951330513315133251333513345133551336513375133851339513405134151342513435134451345513465134751348513495135051351513525135351354513555135651357513585135951360513615136251363513645136551366513675136851369513705137151372513735137451375513765137751378513795138051381513825138351384513855138651387513885138951390513915139251393513945139551396513975139851399514005140151402514035140451405514065140751408514095141051411514125141351414514155141651417514185141951420514215142251423514245142551426514275142851429514305143151432514335143451435514365143751438514395144051441514425144351444514455144651447514485144951450514515145251453514545145551456514575145851459514605146151462514635146451465514665146751468514695147051471514725147351474514755147651477514785147951480514815148251483514845148551486514875148851489514905149151492514935149451495514965149751498514995150051501515025150351504515055150651507515085150951510515115151251513515145151551516515175151851519515205152151522515235152451525515265152751528515295153051531515325153351534515355153651537515385153951540515415154251543515445154551546515475154851549515505155151552515535155451555515565155751558515595156051561515625156351564515655156651567515685156951570515715157251573515745157551576515775157851579515805158151582515835158451585515865158751588515895159051591515925159351594515955159651597515985159951600516015160251603516045160551606516075160851609516105161151612516135161451615516165161751618516195162051621516225162351624516255162651627516285162951630516315163251633516345163551636516375163851639516405164151642516435164451645516465164751648516495165051651516525165351654516555165651657516585165951660516615166251663516645166551666516675166851669516705167151672516735167451675516765167751678516795168051681516825168351684516855168651687516885168951690516915169251693516945169551696516975169851699517005170151702517035170451705517065170751708517095171051711517125171351714517155171651717517185171951720517215172251723517245172551726517275172851729517305173151732517335173451735517365173751738517395174051741517425174351744517455174651747517485174951750517515175251753517545175551756517575175851759517605176151762517635176451765517665176751768517695177051771517725177351774517755177651777517785177951780517815178251783517845178551786517875178851789517905179151792517935179451795517965179751798517995180051801518025180351804518055180651807518085180951810518115181251813518145181551816518175181851819518205182151822518235182451825518265182751828518295183051831518325183351834518355183651837518385183951840518415184251843518445184551846518475184851849518505185151852518535185451855518565185751858518595186051861518625186351864518655186651867518685186951870518715187251873518745187551876518775187851879518805188151882518835188451885518865188751888518895189051891518925189351894518955189651897518985189951900519015190251903519045190551906519075190851909519105191151912519135191451915519165191751918519195192051921519225192351924519255192651927519285192951930519315193251933519345193551936519375193851939519405194151942519435194451945519465194751948519495195051951519525195351954519555195651957519585195951960519615196251963519645196551966519675196851969519705197151972519735197451975519765197751978519795198051981519825198351984519855198651987519885198951990519915199251993519945199551996519975199851999520005200152002520035200452005520065200752008520095201052011520125201352014520155201652017520185201952020520215202252023520245202552026520275202852029520305203152032520335203452035520365203752038520395204052041520425204352044520455204652047520485204952050520515205252053520545205552056520575205852059520605206152062520635206452065520665206752068520695207052071520725207352074520755207652077520785207952080520815208252083520845208552086520875208852089520905209152092520935209452095520965209752098520995210052101521025210352104521055210652107521085210952110521115211252113521145211552116521175211852119521205212152122521235212452125521265212752128521295213052131521325213352134521355213652137521385213952140521415214252143521445214552146521475214852149521505215152152521535215452155521565215752158521595216052161521625216352164521655216652167521685216952170521715217252173521745217552176521775217852179521805218152182521835218452185521865218752188521895219052191521925219352194521955219652197521985219952200522015220252203522045220552206522075220852209522105221152212522135221452215522165221752218522195222052221522225222352224522255222652227522285222952230522315223252233522345223552236522375223852239522405224152242522435224452245522465224752248522495225052251522525225352254522555225652257522585225952260522615226252263522645226552266522675226852269522705227152272522735227452275522765227752278522795228052281522825228352284522855228652287522885228952290522915229252293522945229552296522975229852299523005230152302523035230452305523065230752308523095231052311523125231352314523155231652317523185231952320523215232252323523245232552326523275232852329523305233152332523335233452335523365233752338523395234052341523425234352344523455234652347523485234952350523515235252353523545235552356523575235852359523605236152362523635236452365523665236752368523695237052371523725237352374523755237652377523785237952380523815238252383523845238552386523875238852389523905239152392523935239452395523965239752398523995240052401524025240352404524055240652407524085240952410524115241252413524145241552416524175241852419524205242152422524235242452425524265242752428524295243052431524325243352434524355243652437524385243952440524415244252443524445244552446524475244852449524505245152452524535245452455524565245752458524595246052461524625246352464524655246652467524685246952470524715247252473524745247552476524775247852479524805248152482524835248452485524865248752488524895249052491524925249352494524955249652497524985249952500525015250252503525045250552506525075250852509525105251152512525135251452515525165251752518525195252052521525225252352524525255252652527525285252952530525315253252533525345253552536525375253852539525405254152542525435254452545525465254752548525495255052551525525255352554525555255652557525585255952560525615256252563525645256552566525675256852569525705257152572525735257452575525765257752578525795258052581525825258352584525855258652587525885258952590525915259252593525945259552596525975259852599526005260152602526035260452605526065260752608526095261052611526125261352614526155261652617526185261952620526215262252623526245262552626526275262852629526305263152632526335263452635526365263752638526395264052641526425264352644526455264652647526485264952650526515265252653526545265552656526575265852659526605266152662526635266452665526665266752668526695267052671526725267352674526755267652677526785267952680526815268252683526845268552686526875268852689526905269152692526935269452695526965269752698526995270052701527025270352704527055270652707527085270952710527115271252713527145271552716527175271852719527205272152722527235272452725527265272752728527295273052731527325273352734527355273652737527385273952740527415274252743527445274552746527475274852749527505275152752527535275452755527565275752758527595276052761527625276352764527655276652767527685276952770527715277252773527745277552776527775277852779527805278152782527835278452785527865278752788527895279052791527925279352794527955279652797527985279952800528015280252803528045280552806528075280852809528105281152812528135281452815528165281752818528195282052821528225282352824528255282652827528285282952830528315283252833528345283552836528375283852839528405284152842528435284452845528465284752848528495285052851528525285352854528555285652857528585285952860528615286252863528645286552866528675286852869528705287152872528735287452875528765287752878528795288052881528825288352884528855288652887528885288952890528915289252893528945289552896528975289852899529005290152902529035290452905529065290752908529095291052911529125291352914529155291652917529185291952920529215292252923529245292552926529275292852929529305293152932529335293452935529365293752938529395294052941529425294352944529455294652947529485294952950529515295252953529545295552956529575295852959529605296152962529635296452965529665296752968529695297052971529725297352974529755297652977529785297952980529815298252983529845298552986529875298852989529905299152992529935299452995529965299752998529995300053001530025300353004530055300653007530085300953010530115301253013530145301553016530175301853019530205302153022530235302453025530265302753028530295303053031530325303353034530355303653037530385303953040530415304253043530445304553046530475304853049530505305153052530535305453055530565305753058530595306053061530625306353064530655306653067530685306953070530715307253073530745307553076530775307853079530805308153082530835308453085530865308753088530895309053091530925309353094530955309653097530985309953100531015310253103531045310553106531075310853109531105311153112531135311453115531165311753118531195312053121531225312353124531255312653127531285312953130531315313253133531345313553136531375313853139531405314153142531435314453145531465314753148531495315053151531525315353154531555315653157531585315953160531615316253163531645316553166531675316853169531705317153172531735317453175531765317753178531795318053181531825318353184531855318653187531885318953190531915319253193531945319553196531975319853199532005320153202532035320453205532065320753208532095321053211532125321353214532155321653217532185321953220532215322253223532245322553226532275322853229532305323153232532335323453235532365323753238532395324053241532425324353244532455324653247532485324953250532515325253253532545325553256532575325853259532605326153262532635326453265532665326753268532695327053271532725327353274532755327653277532785327953280532815328253283532845328553286532875328853289532905329153292532935329453295532965329753298532995330053301533025330353304533055330653307533085330953310533115331253313533145331553316533175331853319533205332153322533235332453325533265332753328533295333053331533325333353334533355333653337533385333953340533415334253343533445334553346533475334853349533505335153352533535335453355533565335753358533595336053361533625336353364533655336653367533685336953370533715337253373533745337553376533775337853379533805338153382533835338453385533865338753388533895339053391533925339353394533955339653397533985339953400534015340253403534045340553406534075340853409534105341153412534135341453415534165341753418534195342053421534225342353424534255342653427534285342953430534315343253433534345343553436534375343853439534405344153442534435344453445534465344753448534495345053451534525345353454534555345653457534585345953460534615346253463534645346553466534675346853469534705347153472534735347453475534765347753478534795348053481534825348353484534855348653487534885348953490534915349253493534945349553496534975349853499535005350153502535035350453505535065350753508535095351053511535125351353514535155351653517535185351953520535215352253523535245352553526535275352853529535305353153532535335353453535535365353753538535395354053541535425354353544535455354653547535485354953550535515355253553535545355553556535575355853559535605356153562535635356453565535665356753568535695357053571535725357353574535755357653577535785357953580535815358253583535845358553586535875358853589535905359153592535935359453595535965359753598535995360053601536025360353604536055360653607536085360953610536115361253613536145361553616536175361853619536205362153622536235362453625536265362753628536295363053631536325363353634536355363653637536385363953640536415364253643536445364553646536475364853649536505365153652536535365453655536565365753658536595366053661536625366353664536655366653667536685366953670536715367253673536745367553676536775367853679536805368153682536835368453685536865368753688536895369053691536925369353694536955369653697536985369953700537015370253703537045370553706537075370853709537105371153712537135371453715537165371753718537195372053721537225372353724537255372653727537285372953730537315373253733537345373553736537375373853739537405374153742537435374453745537465374753748537495375053751537525375353754537555375653757537585375953760537615376253763537645376553766537675376853769537705377153772537735377453775537765377753778537795378053781537825378353784537855378653787537885378953790537915379253793537945379553796537975379853799538005380153802538035380453805538065380753808538095381053811538125381353814538155381653817538185381953820538215382253823538245382553826538275382853829538305383153832538335383453835538365383753838538395384053841538425384353844538455384653847538485384953850538515385253853538545385553856538575385853859538605386153862538635386453865538665386753868538695387053871538725387353874538755387653877538785387953880538815388253883538845388553886538875388853889538905389153892538935389453895538965389753898538995390053901539025390353904539055390653907539085390953910539115391253913539145391553916539175391853919539205392153922539235392453925539265392753928539295393053931539325393353934539355393653937539385393953940539415394253943539445394553946539475394853949539505395153952539535395453955539565395753958539595396053961539625396353964539655396653967539685396953970539715397253973539745397553976539775397853979539805398153982539835398453985539865398753988539895399053991539925399353994539955399653997539985399954000540015400254003540045400554006540075400854009540105401154012540135401454015540165401754018540195402054021540225402354024540255402654027540285402954030540315403254033540345403554036540375403854039540405404154042540435404454045540465404754048540495405054051540525405354054540555405654057540585405954060540615406254063540645406554066540675406854069540705407154072540735407454075540765407754078540795408054081540825408354084540855408654087540885408954090540915409254093540945409554096540975409854099541005410154102541035410454105541065410754108541095411054111541125411354114541155411654117541185411954120541215412254123541245412554126541275412854129541305413154132541335413454135541365413754138541395414054141541425414354144541455414654147541485414954150541515415254153541545415554156541575415854159541605416154162541635416454165541665416754168541695417054171541725417354174541755417654177541785417954180541815418254183541845418554186541875418854189541905419154192541935419454195541965419754198541995420054201542025420354204542055420654207542085420954210542115421254213542145421554216542175421854219542205422154222542235422454225542265422754228542295423054231542325423354234542355423654237542385423954240542415424254243542445424554246542475424854249542505425154252542535425454255542565425754258542595426054261542625426354264542655426654267542685426954270542715427254273542745427554276542775427854279542805428154282542835428454285542865428754288542895429054291542925429354294542955429654297542985429954300543015430254303543045430554306543075430854309543105431154312543135431454315543165431754318543195432054321543225432354324543255432654327543285432954330543315433254333543345433554336543375433854339543405434154342543435434454345543465434754348543495435054351543525435354354543555435654357543585435954360543615436254363543645436554366543675436854369543705437154372543735437454375543765437754378543795438054381543825438354384543855438654387543885438954390543915439254393543945439554396543975439854399544005440154402544035440454405544065440754408544095441054411544125441354414544155441654417544185441954420544215442254423544245442554426544275442854429544305443154432544335443454435544365443754438544395444054441544425444354444544455444654447544485444954450544515445254453544545445554456544575445854459544605446154462544635446454465544665446754468544695447054471544725447354474544755447654477544785447954480544815448254483544845448554486544875448854489544905449154492544935449454495544965449754498544995450054501545025450354504545055450654507545085450954510545115451254513545145451554516545175451854519545205452154522545235452454525545265452754528545295453054531545325453354534545355453654537545385453954540545415454254543545445454554546545475454854549545505455154552545535455454555545565455754558545595456054561545625456354564545655456654567545685456954570545715457254573545745457554576545775457854579545805458154582545835458454585545865458754588545895459054591545925459354594545955459654597545985459954600546015460254603546045460554606546075460854609546105461154612546135461454615546165461754618546195462054621546225462354624546255462654627546285462954630546315463254633546345463554636546375463854639546405464154642546435464454645546465464754648546495465054651546525465354654546555465654657546585465954660546615466254663546645466554666546675466854669546705467154672546735467454675546765467754678546795468054681546825468354684546855468654687546885468954690546915469254693546945469554696546975469854699547005470154702547035470454705547065470754708547095471054711547125471354714547155471654717547185471954720547215472254723547245472554726547275472854729547305473154732547335473454735547365473754738547395474054741547425474354744547455474654747547485474954750547515475254753547545475554756547575475854759547605476154762547635476454765547665476754768547695477054771547725477354774547755477654777547785477954780547815478254783547845478554786547875478854789547905479154792547935479454795547965479754798547995480054801548025480354804548055480654807548085480954810548115481254813548145481554816548175481854819548205482154822548235482454825548265482754828548295483054831548325483354834548355483654837548385483954840548415484254843548445484554846548475484854849548505485154852548535485454855548565485754858548595486054861548625486354864548655486654867548685486954870548715487254873548745487554876548775487854879548805488154882548835488454885548865488754888548895489054891548925489354894548955489654897548985489954900549015490254903549045490554906549075490854909549105491154912549135491454915549165491754918549195492054921549225492354924549255492654927549285492954930549315493254933549345493554936549375493854939549405494154942549435494454945549465494754948549495495054951549525495354954549555495654957549585495954960549615496254963549645496554966549675496854969549705497154972549735497454975549765497754978549795498054981549825498354984549855498654987549885498954990549915499254993549945499554996549975499854999550005500155002550035500455005550065500755008550095501055011550125501355014550155501655017550185501955020550215502255023550245502555026550275502855029550305503155032550335503455035550365503755038550395504055041550425504355044550455504655047550485504955050550515505255053550545505555056550575505855059550605506155062550635506455065550665506755068550695507055071550725507355074550755507655077550785507955080550815508255083550845508555086550875508855089550905509155092550935509455095550965509755098550995510055101551025510355104551055510655107551085510955110551115511255113551145511555116551175511855119551205512155122551235512455125551265512755128551295513055131551325513355134551355513655137551385513955140551415514255143551445514555146551475514855149551505515155152551535515455155551565515755158551595516055161551625516355164551655516655167551685516955170551715517255173551745517555176551775517855179551805518155182551835518455185551865518755188551895519055191551925519355194551955519655197551985519955200552015520255203552045520555206552075520855209552105521155212552135521455215552165521755218552195522055221552225522355224552255522655227552285522955230552315523255233552345523555236552375523855239552405524155242552435524455245552465524755248552495525055251552525525355254552555525655257552585525955260552615526255263552645526555266552675526855269552705527155272552735527455275552765527755278552795528055281552825528355284552855528655287552885528955290552915529255293552945529555296552975529855299553005530155302553035530455305553065530755308553095531055311553125531355314553155531655317553185531955320553215532255323553245532555326553275532855329553305533155332553335533455335553365533755338553395534055341553425534355344553455534655347553485534955350553515535255353553545535555356553575535855359553605536155362553635536455365553665536755368553695537055371553725537355374553755537655377553785537955380553815538255383553845538555386553875538855389553905539155392553935539455395553965539755398553995540055401554025540355404554055540655407554085540955410554115541255413554145541555416554175541855419554205542155422554235542455425554265542755428554295543055431554325543355434554355543655437554385543955440554415544255443554445544555446554475544855449554505545155452554535545455455554565545755458554595546055461554625546355464554655546655467554685546955470554715547255473554745547555476554775547855479554805548155482554835548455485554865548755488554895549055491554925549355494554955549655497554985549955500555015550255503555045550555506555075550855509555105551155512555135551455515555165551755518555195552055521555225552355524555255552655527555285552955530555315553255533555345553555536555375553855539555405554155542555435554455545555465554755548555495555055551555525555355554555555555655557555585555955560555615556255563555645556555566555675556855569555705557155572555735557455575555765557755578555795558055581555825558355584555855558655587555885558955590555915559255593555945559555596555975559855599556005560155602556035560455605556065560755608556095561055611556125561355614556155561655617556185561955620556215562255623556245562555626556275562855629556305563155632556335563455635556365563755638556395564055641556425564355644556455564655647556485564955650556515565255653556545565555656556575565855659556605566155662556635566455665556665566755668556695567055671556725567355674556755567655677556785567955680556815568255683556845568555686556875568855689556905569155692556935569455695556965569755698556995570055701557025570355704557055570655707557085570955710557115571255713557145571555716557175571855719557205572155722557235572455725557265572755728557295573055731557325573355734557355573655737557385573955740557415574255743557445574555746557475574855749557505575155752557535575455755557565575755758557595576055761557625576355764557655576655767557685576955770557715577255773557745577555776557775577855779557805578155782557835578455785557865578755788557895579055791557925579355794557955579655797557985579955800558015580255803558045580555806558075580855809558105581155812558135581455815558165581755818558195582055821558225582355824558255582655827558285582955830558315583255833558345583555836558375583855839558405584155842558435584455845558465584755848558495585055851558525585355854558555585655857558585585955860558615586255863558645586555866558675586855869558705587155872558735587455875558765587755878558795588055881558825588355884558855588655887558885588955890558915589255893558945589555896558975589855899559005590155902559035590455905559065590755908559095591055911559125591355914559155591655917559185591955920559215592255923559245592555926559275592855929559305593155932559335593455935559365593755938559395594055941559425594355944559455594655947559485594955950559515595255953559545595555956559575595855959559605596155962559635596455965559665596755968559695597055971559725597355974559755597655977559785597955980559815598255983559845598555986559875598855989559905599155992559935599455995559965599755998559995600056001560025600356004560055600656007560085600956010
  1. /* 许钟文修改的 标记 xzw
  2. 另外 所有"matter"字样已被我删除 原因:删除matterport信息
  3. */
  4. var dom = {//许钟文add
  5. getOffset: function(type, element, parent) {
  6. left = (type == "left") ? element.offsetLeft : element.offsetTop;
  7. if (!parent) parent = $("body")[0];
  8. while (element = element.offsetParent) {
  9. if (element == parent) break;
  10. left += (type == "left") ? element.offsetLeft : element.offsetTop;
  11. }
  12. return left;
  13. }
  14. };
  15. let rootPath = window.location.href.substring(0,window.location.href.lastIndexOf("/")+1)
  16. !function() {
  17. "use strict";
  18. function t(t, i) {
  19. return typeof t === i
  20. }
  21. function i(t, i) {
  22. return t instanceof i
  23. }
  24. function n(t) {
  25. return t && t.nodeType
  26. }
  27. function e(t) {
  28. return n(t) ? t : i(t, g) ? t[0] : void 0
  29. }
  30. function o(t, i, n) {
  31. return g.each(t, function(t, e) {
  32. n = i.call(e, n, t, e)
  33. }),
  34. n
  35. }
  36. function r(t, i, n) {
  37. var e, o, r;
  38. if (t === i)
  39. return !0;
  40. if (!t || !i || t.constructor !== i.constructor)
  41. return !1;
  42. for (e = 0,
  43. o = n.length; o > e; e += 1) {
  44. if (r = n[e],
  45. t[r] && y(t[r].equals) && !t[r].equals(i[r]))
  46. return !1;
  47. if (t[r] !== i[r])
  48. return !1
  49. }
  50. return !0
  51. }
  52. function s(t, i, n, e) {
  53. this.left = E(t),
  54. this.top = E(i),
  55. this.width = E(n),
  56. this.height = E(e),
  57. this.right = this.left + this.width,
  58. this.bottom = this.top + this.height
  59. }
  60. function h(t, i, n, e) {
  61. this.visible = t || 0,
  62. this.viewport = i || 0,
  63. this.possible = n || 0,
  64. this.rects = e && T({}, e) || null
  65. }
  66. function l(t, i) {
  67. this.els = t,
  68. this.viewport = i
  69. }
  70. function c(t, i, n) {
  71. var e;
  72. return g.inArray(n, q) >= 0 ? e = s.ofElement(t) : g.inArray(n, S) >= 0 && (e = h.of(t, i)),
  73. e ? e[n] : 0
  74. }
  75. function u(t, i) {
  76. return t.val - i.val
  77. }
  78. function a(t, i) {
  79. return i.val - t.val
  80. }
  81. function f(t) {
  82. var i = s.ofContent(t, !0)
  83. , n = s.ofViewport(t, !0)
  84. , e = i.width - n.width
  85. , o = i.height - n.height;
  86. this.content = i,
  87. this.viewport = n,
  88. this.width = 0 >= e ? null : n.left / e,
  89. this.height = 0 >= o ? null : n.top / o,
  90. this.left = n.left,
  91. this.top = n.top,
  92. this.right = i.right - n.right,
  93. this.bottom = i.bottom - n.bottom
  94. }
  95. function p(t) {
  96. this.el = t || window
  97. }
  98. function d(t, i) {
  99. this.context = t,
  100. this.viewport = i,
  101. this.init()
  102. }
  103. function v(t, i, n, e) {
  104. this.context = new l(t,i),
  105. this.property = n,
  106. this.descending = e,
  107. this.init()
  108. }
  109. function w(t) {
  110. t && t !== window && t !== document ? (this.context = t,
  111. this.$autoTarget = g(t)) : this.context = window,
  112. this.init()
  113. }
  114. var g = jQuery
  115. , m = g(window)
  116. , b = g(document)
  117. , T = g.extend
  118. , y = g.isFunction
  119. , k = Math.max
  120. , V = Math.min
  121. , E = Math.round
  122. , x = function() {
  123. var t = {}
  124. , i = 1;
  125. return function(n) {
  126. return n ? (t[n] || (t[n] = i,
  127. i += 1),
  128. t[n]) : 0
  129. }
  130. }();
  131. T(s.prototype, {
  132. equals: function(t) {
  133. return r(this, t, ["left", "top", "width", "height"])
  134. },
  135. area: function() {
  136. return this.width * this.height
  137. },
  138. relativeTo: function(t) {
  139. return new s(this.left - t.left,this.top - t.top,this.width,this.height)
  140. },
  141. intersection: function(t) {
  142. if (!i(t, s))
  143. return null;
  144. var n = k(this.left, t.left)
  145. , e = V(this.right, t.right)
  146. , o = k(this.top, t.top)
  147. , r = V(this.bottom, t.bottom)
  148. , h = e - n
  149. , l = r - o;
  150. return h >= 0 && l >= 0 ? new s(n,o,h,l) : null
  151. },
  152. envelope: function(t) {
  153. if (!i(t, s))
  154. return this;
  155. var n = V(this.left, t.left)
  156. , e = k(this.right, t.right)
  157. , o = V(this.top, t.top)
  158. , r = k(this.bottom, t.bottom)
  159. , h = e - n
  160. , l = r - o;
  161. return new s(n,o,h,l)
  162. }
  163. }),
  164. T(s, {
  165. ofContent: function(t, i) {
  166. 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())
  167. },
  168. ofViewport: function(t, i) {
  169. 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())
  170. },
  171. ofElement: function(t) {
  172. var i = g(t);
  173. if (!i.is(":visible"))
  174. return null;
  175. var n = i.offset();
  176. return new s(n.left,n.top,i.outerWidth(),i.outerHeight())
  177. }
  178. }),
  179. T(h.prototype, {
  180. equals: function(t) {
  181. return this.fracsEqual(t) && this.rectsEqual(t)
  182. },
  183. fracsEqual: function(t) {
  184. return r(this, t, ["visible", "viewport", "possible"])
  185. },
  186. rectsEqual: function(t) {
  187. return r(this.rects, t.rects, ["document", "element", "viewport"])
  188. }
  189. }),
  190. T(h, {
  191. of: function(t, i) {
  192. var e, o, r;
  193. return t = n(t) && s.ofElement(t) || t,
  194. i = n(i) && s.ofViewport(i) || i || s.ofViewport(),
  195. t instanceof s && (e = t.intersection(i)) ? (o = e.area(),
  196. r = V(t.width, i.width) * V(t.height, i.height),
  197. new h(o / t.area(),o / i.area(),o / r,{
  198. document: e,
  199. element: e.relativeTo(t),
  200. viewport: e.relativeTo(i)
  201. })) : new h
  202. }
  203. });
  204. var q = ["width", "height", "left", "right", "top", "bottom"]
  205. , S = ["possible", "visible", "viewport"];
  206. T(l.prototype, {
  207. sorted: function(t, i) {
  208. var n = this.viewport;
  209. return g.map(this.els, function(i) {
  210. return {
  211. el: i,
  212. val: c(i, n, t)
  213. }
  214. }).sort(i ? a : u)
  215. },
  216. best: function(t, i) {
  217. return this.els.length ? this.sorted(t, i)[0] : null
  218. }
  219. }),
  220. T(f.prototype, {
  221. equals: function(t) {
  222. return r(this, t, ["width", "height", "left", "top", "right", "bottom", "content", "viewport"])
  223. }
  224. }),
  225. T(p.prototype, {
  226. equals: function(t) {
  227. return r(this, t, ["el"])
  228. },
  229. scrollState: function() {
  230. return new f(this.el)
  231. },
  232. scrollTo: function(t, i, n) {
  233. var e = g(this.el === window ? "html,body" : this.el);
  234. t = t || 0,
  235. i = i || 0,
  236. n = isNaN(n) ? 1e3 : n,
  237. e.stop(!0).animate({
  238. scrollLeft: t,
  239. scrollTop: i
  240. }, n)
  241. },
  242. scroll: function(t, i, n) {
  243. var e = this.el === window ? m : g(this.el);
  244. t = t || 0,
  245. i = i || 0,
  246. this.scrollTo(e.scrollLeft() + t, e.scrollTop() + i, n)
  247. },
  248. scrollToRect: function(t, i, n, e) {
  249. i = i || 0,
  250. n = n || 0,
  251. this.scrollTo(t.left - i, t.top - n, e)
  252. },
  253. scrollToElement: function(t, i, n, e) {
  254. var o = s.ofElement(t).relativeTo(s.ofContent(this.el));
  255. this.scrollToRect(o, i, n, e)
  256. }
  257. });
  258. var C = {
  259. init: function() {
  260. this.callbacks = g.Callbacks("memory unique"),
  261. this.currVal = null,
  262. this.prevVal = null,
  263. this.checkProxy = g.proxy(this.check, this),
  264. this.autoCheck()
  265. },
  266. bind: function(t) {
  267. this.callbacks.add(t)
  268. },
  269. unbind: function(t) {
  270. t ? this.callbacks.remove(t) : this.callbacks.empty()
  271. },
  272. trigger: function() {
  273. this.callbacks.fireWith(this.context, [this.currVal, this.prevVal])
  274. },
  275. check: function(t) {
  276. var i = this.updatedValue(t);
  277. return void 0 !== i && (this.prevVal = this.currVal,
  278. this.currVal = i,
  279. this.trigger(),
  280. !0)
  281. },
  282. $autoTarget: m,
  283. autoEvents: "load resize scroll",
  284. autoCheck: function(t) {
  285. this.$autoTarget[t === !1 ? "off" : "on"](this.autoEvents, this.checkProxy)
  286. }
  287. };
  288. T(d.prototype, C, {
  289. updatedValue: function() {
  290. var t = h.of(this.context, this.viewport);
  291. return this.currVal && this.currVal.equals(t) ? void 0 : t
  292. }
  293. }),
  294. T(v.prototype, C, {
  295. updatedValue: function() {
  296. var t = this.context.best(this.property, this.descending);
  297. return t && (t = t.val > 0 ? t.el : null,
  298. this.currVal !== t) ? t : void 0
  299. }
  300. }),
  301. T(w.prototype, C, {
  302. updatedValue: function() {
  303. var t = new f(this.context);
  304. return this.currVal && this.currVal.equals(t) ? void 0 : t
  305. }
  306. });
  307. var L = function(t, i) {
  308. var n = [].slice
  309. , e = jQuery
  310. , o = e.extend
  311. , r = e.isFunction
  312. , s = o({}, i)
  313. , h = function(i, n, o, s) {
  314. return o = r(o) ? o.apply(i, n) : o,
  315. r(s[o]) ? s[o].apply(i, n) : void e.error('Method "' + o + '" does not exist on jQuery.' + t)
  316. }
  317. , l = function() {
  318. return h(this, n.call(arguments), s.defaultStatic, l)
  319. }
  320. , c = function(t) {
  321. return r(c[t]) ? c[t].apply(this, n.call(arguments, 1)) : h(this, n.call(arguments), s.defaultMethod, c)
  322. }
  323. , u = function(t) {
  324. t && (o(l, t.statics),
  325. o(c, t.methods)),
  326. l.modplug = u
  327. };
  328. u.prev = {
  329. statics: e[t],
  330. methods: e.fn[t]
  331. },
  332. u(i),
  333. e[t] = l,
  334. e.fn[t] = c
  335. }
  336. , M = "fracs";
  337. L(M, {
  338. statics: {
  339. version: "0.15.0",
  340. Rect: s,
  341. Fractions: h,
  342. Group: l,
  343. ScrollState: f,
  344. Viewport: p,
  345. FracsCallbacks: d,
  346. GroupCallbacks: v,
  347. ScrollStateCallbacks: w,
  348. fracs: function(t, i) {
  349. return h.of(t, i)
  350. }
  351. },
  352. methods: {
  353. content: function(t) {
  354. return this.length ? s.ofContent(this[0], t) : null
  355. },
  356. envelope: function() {
  357. return o(this, function(t) {
  358. var i = s.ofElement(this);
  359. return t ? t.envelope(i) : i
  360. })
  361. },
  362. fracs: function(i, n, o) {
  363. t(i, "string") || (o = n,
  364. n = i,
  365. i = null),
  366. y(n) || (o = n,
  367. n = null),
  368. o = e(o);
  369. var r = M + ".fracs." + x(o);
  370. return "unbind" === i ? this.each(function() {
  371. var t = g(this).data(r);
  372. t && t.unbind(n)
  373. }) : "check" === i ? this.each(function() {
  374. var t = g(this).data(r);
  375. t && t.check()
  376. }) : y(n) ? this.each(function() {
  377. var t = g(this)
  378. , i = t.data(r);
  379. i || (i = new d(this,o),
  380. t.data(r, i)),
  381. i.bind(n)
  382. }) : this.length ? h.of(this[0], o) : null
  383. },
  384. intersection: function() {
  385. return o(this, function(t) {
  386. var i = s.ofElement(this);
  387. return t ? t.intersection(i) : i
  388. })
  389. },
  390. max: function(t, i, n) {
  391. return y(i) || (n = i,
  392. i = null),
  393. n = e(n),
  394. i ? (new v(this,n,t,!0).bind(i),
  395. this) : this.pushStack(new l(this,n).best(t, !0).el)
  396. },
  397. min: function(t, i, n) {
  398. return y(i) || (n = i,
  399. i = null),
  400. n = e(n),
  401. i ? (new v(this,n,t).bind(i),
  402. this) : this.pushStack(new l(this,n).best(t).el)
  403. },
  404. rect: function() {
  405. return this.length ? s.ofElement(this[0]) : null
  406. },
  407. scrollState: function(i, n) {
  408. var e = M + ".scrollState";
  409. return t(i, "string") || (n = i,
  410. i = null),
  411. "unbind" === i ? this.each(function() {
  412. var t = g(this).data(e);
  413. t && t.unbind(n)
  414. }) : "check" === i ? this.each(function() {
  415. var t = g(this).data(e);
  416. t && t.check()
  417. }) : y(n) ? this.each(function() {
  418. var t = g(this)
  419. , i = t.data(e);
  420. i || (i = new w(this),
  421. t.data(e, i)),
  422. i.bind(n)
  423. }) : this.length ? new f(this[0]) : null
  424. },
  425. scroll: function(t, i, n) {
  426. return this.each(function() {
  427. new p(this).scroll(t, i, n)
  428. })
  429. },
  430. scrollTo: function(t, i, n, o) {
  431. return g.isNumeric(t) && (o = n,
  432. n = i,
  433. i = t,
  434. t = null),
  435. t = e(t),
  436. this.each(function() {
  437. t ? new p(this).scrollToElement(t, i, n, o) : new p(this).scrollTo(i, n, o)
  438. })
  439. },
  440. scrollToThis: function(t, i, n, o) {
  441. return o = new p(e(o)),
  442. o.scrollToElement(this[0], t, i, n),
  443. this
  444. },
  445. softLink: function(t, i, n, o) {
  446. return o = new p(e(o)),
  447. this.filter("a[href^=#]").each(function() {
  448. var e = g(this);
  449. e.on("click", function() {
  450. o.scrollToElement(g(e.attr("href"))[0], t, i, n)
  451. })
  452. })
  453. },
  454. sort: function(i, n, o) {
  455. return t(n, "boolean") || (o = n,
  456. n = null),
  457. o = e(o),
  458. this.pushStack(g.map(new l(this,o).sorted(i, !n), function(t) {
  459. return t.el
  460. }))
  461. },
  462. viewport: function(t) {
  463. return this.length ? s.ofViewport(this[0], t) : null
  464. }
  465. },
  466. defaultStatic: "fracs",
  467. defaultMethod: "fracs"
  468. })
  469. }();
  470. if ("undefined" == typeof jQuery)
  471. throw new Error("Bootstrap's JavaScript requires jQuery");
  472. +function(t) {
  473. "use strict";
  474. function e(e) {
  475. return this.each(function() {
  476. var o = t(this)
  477. , s = o.data("bs.tooltip")
  478. , n = "object" == typeof e && e;
  479. (s || "destroy" != e) && (s || o.data("bs.tooltip", s = new i(this,n)),
  480. "string" == typeof e && s[e]())
  481. })
  482. }
  483. var i = function(t, e) {
  484. this.type = this.options = this.enabled = this.timeout = this.hoverState = this.$element = null,
  485. this.init("tooltip", t, e)
  486. };
  487. i.VERSION = "3.2.0",
  488. i.DEFAULTS = {
  489. animation: !0,
  490. placement: "top",
  491. selector: !1,
  492. template: '<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',
  493. trigger: "hover focus",
  494. title: "",
  495. delay: 0,
  496. html: !1,
  497. container: !1,
  498. viewport: {
  499. selector: "body",
  500. padding: 0
  501. }
  502. },
  503. i.prototype.init = function(e, i, o) {
  504. this.enabled = !0,
  505. this.type = e,
  506. this.$element = t(i),
  507. this.options = this.getOptions(o),
  508. this.$viewport = this.options.viewport && t(this.options.viewport.selector || this.options.viewport);
  509. for (var s = this.options.trigger.split(" "), n = s.length; n--; ) {
  510. var r = s[n];
  511. if ("click" == r)
  512. this.$element.on("click." + this.type, this.options.selector, t.proxy(this.toggle, this));
  513. else if ("manual" != r) {
  514. var a = "hover" == r ? "mouseenter" : "focusin"
  515. , l = "hover" == r ? "mouseleave" : "focusout";
  516. this.$element.on(a + "." + this.type, this.options.selector, t.proxy(this.enter, this)),
  517. this.$element.on(l + "." + this.type, this.options.selector, t.proxy(this.leave, this))
  518. }
  519. }
  520. this.options.selector ? this._options = t.extend({}, this.options, {
  521. trigger: "manual",
  522. selector: ""
  523. }) : this.fixTitle()
  524. }
  525. ,
  526. i.prototype.getDefaults = function() {
  527. return i.DEFAULTS
  528. }
  529. ,
  530. i.prototype.getOptions = function(e) {
  531. return e = t.extend({}, this.getDefaults(), this.$element.data(), e),
  532. e.delay && "number" == typeof e.delay && (e.delay = {
  533. show: e.delay,
  534. hide: e.delay
  535. }),
  536. e
  537. }
  538. ,
  539. i.prototype.getDelegateOptions = function() {
  540. var e = {}
  541. , i = this.getDefaults();
  542. return this._options && t.each(this._options, function(t, o) {
  543. i[t] != o && (e[t] = o)
  544. }),
  545. e
  546. }
  547. ,
  548. i.prototype.enter = function(e) {
  549. var i = e instanceof this.constructor ? e : t(e.currentTarget).data("bs." + this.type);
  550. return i || (i = new this.constructor(e.currentTarget,this.getDelegateOptions()),
  551. t(e.currentTarget).data("bs." + this.type, i)),
  552. clearTimeout(i.timeout),
  553. i.hoverState = "in",
  554. i.options.delay && i.options.delay.show ? void (i.timeout = setTimeout(function() {
  555. // "in" == i.hoverState && i.show()
  556. }, i.options.delay.show)) : i.show()
  557. }
  558. ,
  559. i.prototype.leave = function(e) {
  560. var i = e instanceof this.constructor ? e : t(e.currentTarget).data("bs." + this.type);
  561. return i || (i = new this.constructor(e.currentTarget,this.getDelegateOptions()),
  562. t(e.currentTarget).data("bs." + this.type, i)),
  563. clearTimeout(i.timeout),
  564. i.hoverState = "out",
  565. i.options.delay && i.options.delay.hide ? void (i.timeout = setTimeout(function() {
  566. "out" == i.hoverState && i.hide()
  567. }, i.options.delay.hide)) : i.hide()
  568. }
  569. ,
  570. i.prototype.show = function() {
  571. var e = t.Event("show.bs." + this.type);
  572. if (this.hasContent() && this.enabled) {
  573. this.$element.trigger(e);
  574. var i = t.contains(document.documentElement, this.$element[0]);
  575. if (e.isDefaultPrevented() || !i)
  576. return;
  577. var o = this
  578. , s = this.tip()
  579. , n = this.getUID(this.type);
  580. this.setContent(),
  581. s.attr("id", n),
  582. this.$element.attr("aria-describedby", n),
  583. this.options.animation && s.addClass("fade");
  584. var r = "function" == typeof this.options.placement ? this.options.placement.call(this, s[0], this.$element[0]) : this.options.placement
  585. , a = /\s?auto?\s?/i
  586. , l = a.test(r);
  587. l && (r = r.replace(a, "") || "top"),
  588. s.detach().css({
  589. top: 0,
  590. left: 0,
  591. display: "block"
  592. }).addClass(r).data("bs." + this.type, this),
  593. this.options.container ? s.appendTo(this.options.container) : s.insertAfter(this.$element);
  594. var p = this.getPosition()
  595. , h = s[0].offsetWidth
  596. , f = s[0].offsetHeight;
  597. if (l) {
  598. var u = r
  599. , c = this.$element.parent()
  600. , d = this.getPosition(c);
  601. 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,
  602. s.removeClass(u).addClass(r)
  603. }
  604. var g = this.getCalculatedOffset(r, p, h, f);
  605. this.applyPlacement(g, r);
  606. var y = function() {
  607. o.$element.trigger("shown.bs." + o.type),
  608. o.hoverState = null
  609. };
  610. t.support.transition && this.$tip.hasClass("fade") ? s.one("bsTransitionEnd", y).emulateTransitionEnd(150) : y()
  611. }
  612. }
  613. ,
  614. i.prototype.applyPlacement = function(e, i) {
  615. var o = this.tip()
  616. , s = o[0].offsetWidth
  617. , n = o[0].offsetHeight
  618. , r = parseInt(o.css("margin-top"), 10)
  619. , a = parseInt(o.css("margin-left"), 10);
  620. isNaN(r) && (r = 0),
  621. isNaN(a) && (a = 0),
  622. e.top = e.top + r,
  623. e.left = e.left + a,
  624. t.offset.setOffset(o[0], t.extend({
  625. using: function(t) {
  626. o.css({
  627. top: Math.round(t.top),
  628. left: Math.round(t.left)
  629. })
  630. }
  631. }, e), 0),
  632. o.addClass("in");
  633. var l = o[0].offsetWidth
  634. , p = o[0].offsetHeight;
  635. "top" == i && p != n && (e.top = e.top + n - p);
  636. var h = this.getViewportAdjustedDelta(i, e, l, p);
  637. h.left ? e.left += h.left : e.top += h.top;
  638. var f = h.left ? 2 * h.left - s + l : 2 * h.top - n + p
  639. , u = h.left ? "left" : "top"
  640. , c = h.left ? "offsetWidth" : "offsetHeight";
  641. o.offset(e),
  642. this.replaceArrow(f, o[0][c], u)
  643. }
  644. ,
  645. i.prototype.replaceArrow = function(t, e, i) {
  646. this.arrow().css(i, t ? 50 * (1 - t / e) + "%" : "")
  647. }
  648. ,
  649. i.prototype.setContent = function() {
  650. var t = this.tip()
  651. , e = this.getTitle();
  652. t.find(".tooltip-inner")[this.options.html ? "html" : "text"](e),
  653. t.removeClass("fade in top bottom left right")
  654. }
  655. ,
  656. i.prototype.hide = function() {
  657. function e() {
  658. "in" != i.hoverState && o.detach(),
  659. i.$element.trigger("hidden.bs." + i.type)
  660. }
  661. var i = this
  662. , o = this.tip()
  663. , s = t.Event("hide.bs." + this.type);
  664. if (this.$element.removeAttr("aria-describedby"),
  665. this.$element.trigger(s),
  666. !s.isDefaultPrevented())
  667. return o.removeClass("in"),
  668. t.support.transition && this.$tip.hasClass("fade") ? o.one("bsTransitionEnd", e).emulateTransitionEnd(150) : e(),
  669. this.hoverState = null,
  670. this
  671. }
  672. ,
  673. i.prototype.fixTitle = function() {
  674. var t = this.$element;
  675. (t.attr("title") || "string" != typeof t.attr("data-original-title")) && t.attr("data-original-title", t.attr("title") || "").attr("title", "")
  676. }
  677. ,
  678. i.prototype.hasContent = function() {
  679. return this.getTitle()
  680. }
  681. ,
  682. i.prototype.getPosition = function(e) {
  683. e = e || this.$element;
  684. var i = e[0]
  685. , o = "BODY" == i.tagName;
  686. return t.extend({}, "function" == typeof i.getBoundingClientRect ? i.getBoundingClientRect() : null, {
  687. scroll: o ? document.documentElement.scrollTop || document.body.scrollTop : e.scrollTop(),
  688. width: o ? t(window).width() : e.outerWidth(),
  689. height: o ? t(window).height() : e.outerHeight()
  690. }, o ? {
  691. top: 0,
  692. left: 0
  693. } : e.offset())
  694. }
  695. ,
  696. i.prototype.getCalculatedOffset = function(t, e, i, o) {
  697. return "bottom" == t ? {
  698. top: e.top + e.height,
  699. left: e.left + e.width / 2 - i / 2
  700. } : "top" == t ? {
  701. top: e.top - o,
  702. left: e.left + e.width / 2 - i / 2
  703. } : "left" == t ? {
  704. top: e.top + e.height / 2 - o / 2,
  705. left: e.left - i
  706. } : {
  707. top: e.top + e.height / 2 - o / 2,
  708. left: e.left + e.width
  709. }
  710. }
  711. ,
  712. i.prototype.getViewportAdjustedDelta = function(t, e, i, o) {
  713. var s = {
  714. top: 0,
  715. left: 0
  716. };
  717. if (!this.$viewport)
  718. return s;
  719. var n = this.options.viewport && this.options.viewport.padding || 0
  720. , r = this.getPosition(this.$viewport);
  721. if (/right|left/.test(t)) {
  722. var a = e.top - n - r.scroll
  723. , l = e.top + n - r.scroll + o;
  724. a < r.top ? s.top = r.top - a : l > r.top + r.height && (s.top = r.top + r.height - l)
  725. } else {
  726. var p = e.left - n
  727. , h = e.left + n + i;
  728. p < r.left ? s.left = r.left - p : h > r.width && (s.left = r.left + r.width - h)
  729. }
  730. return s
  731. }
  732. ,
  733. i.prototype.getTitle = function() {
  734. var t, e = this.$element, i = this.options;
  735. return t = e.attr("data-original-title") || ("function" == typeof i.title ? i.title.call(e[0]) : i.title)
  736. }
  737. ,
  738. i.prototype.getUID = function(t) {
  739. do
  740. t += ~~(1e6 * Math.random());
  741. while (document.getElementById(t));return t
  742. }
  743. ,
  744. i.prototype.tip = function() {
  745. return this.$tip = this.$tip || t(this.options.template)
  746. }
  747. ,
  748. i.prototype.arrow = function() {
  749. return this.$arrow = this.$arrow || this.tip().find(".tooltip-arrow")
  750. }
  751. ,
  752. i.prototype.validate = function() {
  753. this.$element[0].parentNode || (this.hide(),
  754. this.$element = null,
  755. this.options = null)
  756. }
  757. ,
  758. i.prototype.enable = function() {
  759. this.enabled = !0
  760. }
  761. ,
  762. i.prototype.disable = function() {
  763. this.enabled = !1
  764. }
  765. ,
  766. i.prototype.toggleEnabled = function() {
  767. this.enabled = !this.enabled
  768. }
  769. ,
  770. i.prototype.toggle = function(e) {
  771. var i = this;
  772. e && (i = t(e.currentTarget).data("bs." + this.type),
  773. i || (i = new this.constructor(e.currentTarget,this.getDelegateOptions()),
  774. t(e.currentTarget).data("bs." + this.type, i))),
  775. i.tip().hasClass("in") ? i.leave(i) : i.enter(i)
  776. }
  777. ,
  778. i.prototype.destroy = function() {
  779. clearTimeout(this.timeout),
  780. this.hide().$element.off("." + this.type).removeData("bs." + this.type)
  781. }
  782. ;
  783. var o = t.fn.tooltip;
  784. t.fn.tooltip = e,
  785. t.fn.tooltip.Constructor = i,
  786. t.fn.tooltip.noConflict = function() {
  787. return t.fn.tooltip = o,
  788. this
  789. }
  790. }(jQuery);
  791. !function(e, t, n) {
  792. "undefined" != typeof module && module.exports ? module.exports = n() : "function" == typeof define && define.amd ? define(n) : t[e] = n()
  793. }("Keen", this, function() {
  794. "use strict";
  795. function Keen() {
  796. return _init.apply(this, arguments)
  797. }
  798. function _init(e) {
  799. if (_isUndefined(e))
  800. throw new Error("Check out our JavaScript SDK Usage Guide: https://keen.io/docs/clients/javascript/usage-guide/");
  801. if (_isUndefined(e.projectId) || "String" !== _type(e.projectId) || e.projectId.length < 1)
  802. throw new Error("Please provide a projectId");
  803. this.configure(e)
  804. }
  805. function _extend(e) {
  806. for (var t = 1; t < arguments.length; t++)
  807. for (var n in arguments[t])
  808. e[n] = arguments[t][n];
  809. return e
  810. }
  811. function _isUndefined(e) {
  812. return void 0 === e
  813. }
  814. function _type(e) {
  815. var t = e && e.constructor ? e.constructor.toString() : void 0;
  816. return t ? t.match(/function (.*)\(/)[1] : "Null"
  817. }
  818. function _each(e, t, n) {
  819. var r;
  820. if (!e)
  821. return 0;
  822. if (n = n ? n : e,
  823. "array" === _type(e)) {
  824. for (r = 0; r < e.length; r++)
  825. if (t.call(n, e[r], r, e) === !1)
  826. return 0
  827. } else
  828. for (r in e)
  829. if (e.hasOwnProperty(r) && t.call(n, e[r], r, e) === !1)
  830. return 0;
  831. return 1
  832. }
  833. function _parse_params(e) {
  834. for (var t, n = {}, r = /\+/g, i = /([^&=]+)=?([^&]*)/g, o = function(e) {
  835. return decodeURIComponent(e.replace(r, " "))
  836. }, a = e.split("?")[1]; t = i.exec(a); )
  837. n[o(t[1])] = o(t[2]);
  838. return n
  839. }
  840. function _set_protocol(e) {
  841. switch (e) {
  842. case "http":
  843. return "http";
  844. case "auto":
  845. return location.protocol.replace(/:/g, "");
  846. case "https":
  847. case void 0:
  848. default:
  849. return "https"
  850. }
  851. }
  852. function _set_request_type(e) {
  853. var t = e || "jsonp"
  854. , n = !1;
  855. return ("Object" === _type(XMLHttpRequest) || "Function" === _type(XMLHttpRequest)) && "withCredentials"in new XMLHttpRequest && (n = !0),
  856. null == t || "xhr" == t ? n ? "xhr" : "jsonp" : t
  857. }
  858. function _build_url(e) {
  859. return this.client.endpoint + "/projects/" + this.client.projectId + e
  860. }
  861. function _uploadEvent(e, t, n, r, i) {
  862. var o = _build_url.apply(this, ["/events/" + e])
  863. , a = {};
  864. n = n !== !1,
  865. this.client.globalProperties && (a = this.client.globalProperties(e));
  866. for (var c in t)
  867. t.hasOwnProperty(c) && (a[c] = t[c]);
  868. switch (this.client.requestType) {
  869. case "xhr":
  870. _request.xhr.apply(this, ["POST", o, null, a, this.client.writeKey, n, r, i]);
  871. break;
  872. case "jsonp":
  873. var s = JSON.stringify(a)
  874. , l = Keen.Base64.encode(s);
  875. o = o + "?api_key=" + this.client.writeKey,
  876. o = o + "&data=" + l,
  877. o = o + "&modified=" + (new Date).getTime(),
  878. _request.jsonp.apply(this, [o, this.client.writeKey, r, i]);
  879. break;
  880. case "beacon":
  881. var s = JSON.stringify(a)
  882. , l = Keen.Base64.encode(s);
  883. o = o + "?api_key=" + encodeURIComponent(this.client.writeKey),
  884. o = o + "&data=" + encodeURIComponent(l),
  885. o = o + "&modified=" + encodeURIComponent((new Date).getTime()),
  886. o += "&c=clv1",
  887. _request.beacon.apply(this, [o, null, r, i])
  888. }
  889. }
  890. Keen.prototype.configure = function(e) {
  891. return e.host = _isUndefined(e.host) ? "api.keen.io/3.0" : e.host.replace(/.*?:\/\//g, ""),
  892. e.protocol = _set_protocol(e.protocol),
  893. e.requestType = _set_request_type(e.requestType),
  894. this.client = {
  895. projectId: e.projectId,
  896. writeKey: e.writeKey,
  897. readKey: e.readKey,
  898. globalProperties: null,
  899. endpoint: e.protocol + "://" + e.host,
  900. requestType: e.requestType
  901. },
  902. Keen.trigger("client", this, e),
  903. this.trigger("ready"),
  904. this
  905. }
  906. ;
  907. var _request = {
  908. xhr: function(e, t, n, r, i, o, a, c) {
  909. if (!i)
  910. return Keen.log("Please provide a writeKey for https://keen.io/project/" + this.client.projectId);
  911. var s = new XMLHttpRequest;
  912. if (s.onreadystatechange = function() {
  913. if (4 == s.readyState)
  914. if (s.status >= 200 && s.status < 300) {
  915. var e;
  916. try {
  917. e = JSON.parse(s.responseText)
  918. } catch (e) {
  919. Keen.log("Could not JSON parse HTTP response: " + s.responseText),
  920. c && c(s, e)
  921. }
  922. a && e && a(e)
  923. } else
  924. Keen.log("HTTP request failed."),
  925. c && c(s, null)
  926. }
  927. ,
  928. s.open(e, t, o),
  929. i && s.setRequestHeader("Authorization", i),
  930. r && s.setRequestHeader("Content-Type", "application/json"),
  931. n)
  932. for (var l in n)
  933. n.hasOwnProperty(l) && s.setRequestHeader(l, n[l]);
  934. var u = r ? JSON.stringify(r) : null;
  935. s.send(u)
  936. },
  937. jsonp: function(e, t, n, r) {
  938. if (!t)
  939. return Keen.log("Please provide a writeKey for https://keen.io/project/" + this.client.projectId);
  940. if (t && e.indexOf("api_key") < 0) {
  941. var i = e.indexOf("?") > 0 ? "&" : "?";
  942. e = e + i + "api_key=" + t
  943. }
  944. for (var o = "keenJSONPCallback" + (new Date).getTime(); o in window; )
  945. o += "a";
  946. var a = !1;
  947. window[o] = function(e) {
  948. a = !0,
  949. n && e && n(e),
  950. window[o] = void 0
  951. }
  952. ,
  953. e = e + "&jsonp=" + o;
  954. var c = document.createElement("script");
  955. c.id = "keen-jsonp",
  956. c.src = e,
  957. document.getElementsByTagName("head")[0].appendChild(c),
  958. c.onreadystatechange = function() {
  959. a === !1 && "loaded" === this.readyState && (a = !0,
  960. r && r())
  961. }
  962. ,
  963. c.onerror = function() {
  964. a === !1 && (a = !0,
  965. r && r())
  966. }
  967. },
  968. beacon: function(e, t, n, r) {
  969. if (t && e.indexOf("api_key") < 0) {
  970. var i = e.indexOf("?") > 0 ? "&" : "?";
  971. e = e + i + "api_key=" + t
  972. }
  973. var o = !1
  974. , a = document.createElement("img");
  975. a.onload = function() {
  976. if (o = !0,
  977. "naturalHeight"in this) {
  978. if (this.naturalHeight + this.naturalWidth === 0)
  979. return void this.onerror()
  980. } else if (this.width + this.height === 0)
  981. return void this.onerror();
  982. n && n({
  983. created: !0
  984. })
  985. }
  986. ,
  987. a.onerror = function() {
  988. o = !0,
  989. r && r()
  990. }
  991. ,
  992. a.src = e
  993. }
  994. }
  995. , Events = Keen.Events = {
  996. on: function(e, t) {
  997. this.listeners || (this.listeners = {});
  998. var n = this.listeners[e] || (this.listeners[e] = []);
  999. return n.push({
  1000. callback: t
  1001. }),
  1002. this
  1003. },
  1004. off: function(e, t) {
  1005. if (!e && !t)
  1006. return this.listeners = void 0,
  1007. delete this.listeners,
  1008. this;
  1009. for (var n = this.listeners[e] || [], r = n.length; r--; )
  1010. t && t == n[r].callback && this.listeners[e].splice(r, 1),
  1011. t && 0 != n.length || (this.listeners[e] = void 0,
  1012. delete this.listeners[e]);
  1013. return this
  1014. },
  1015. trigger: function(e) {
  1016. if (!this.listeners)
  1017. return this;
  1018. for (var t = Array.prototype.slice.call(arguments, 1), n = this.listeners[e] || [], r = 0; r < n.length; r++)
  1019. n[r].callback.apply(this, t);
  1020. return this
  1021. }
  1022. };
  1023. _extend(Keen.prototype, Events),
  1024. _extend(Keen, Events),
  1025. Keen.loaded = !0,
  1026. Keen.utils = {
  1027. each: _each,
  1028. extend: _extend,
  1029. parseParams: _parse_params
  1030. },
  1031. Keen.ready = function(e) {
  1032. Keen.loaded ? e() : Keen.on("ready", e)
  1033. }
  1034. ,
  1035. Keen.log = function(e) {
  1036. "object" == typeof console && console.log("[Keen IO]", e)
  1037. }
  1038. ;
  1039. var Plugins = Keen.Plugins = {};
  1040. Keen.prototype.addEvent = function() {
  1041. _uploadEvent.apply(this, arguments)
  1042. }
  1043. ,
  1044. Keen.prototype.addEventSync = function(e, t, n, r) {
  1045. _uploadEvent.apply(this, [e, t, !1, n, r])
  1046. }
  1047. ,
  1048. Keen.prototype.trackExternalLink = function(e, t, n, r, i) {
  1049. var o = e
  1050. , a = o.metaKey
  1051. , c = o.target
  1052. , s = !1
  1053. , l = function() {};
  1054. return void 0 === r && (r = 500),
  1055. "A" === c.nodeName ? l = function() {
  1056. a || s || (s = !0,
  1057. window.location = c.href)
  1058. }
  1059. : "FORM" === c.nodeName && (l = function() {
  1060. s || (s = !0,
  1061. c.submit())
  1062. }
  1063. ),
  1064. i && (l = function() {
  1065. s || (s = !0,
  1066. i())
  1067. }
  1068. ),
  1069. _uploadEvent.call(this, t, n, l, l),
  1070. setTimeout(function() {
  1071. l()
  1072. }, r),
  1073. !!a && void 0
  1074. }
  1075. ,
  1076. Keen.prototype.setGlobalProperties = function(e) {
  1077. if (!this.client)
  1078. return Keen.log("Check out our JavaScript SDK Usage Guide: https://keen.io/docs/clients/javascript/usage-guide/");
  1079. if (!e || "function" != typeof e)
  1080. throw new Error("Invalid value for global properties: " + e);
  1081. this.client.globalProperties = e
  1082. }
  1083. ,
  1084. Keen.Base64 = {
  1085. map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
  1086. encode: function(e) {
  1087. var t, n, r, i, o, a, c, s = "", l = 0, u = this.map;
  1088. for (e = this.utf8.encode(e); l < e.length; )
  1089. t = e.charCodeAt(l++),
  1090. n = e.charCodeAt(l++),
  1091. r = e.charCodeAt(l++),
  1092. i = t >> 2,
  1093. o = (3 & t) << 4 | n >> 4,
  1094. a = isNaN(n) ? 64 : (15 & n) << 2 | r >> 6,
  1095. c = isNaN(n) || isNaN(r) ? 64 : 63 & r,
  1096. s = s + u.charAt(i) + u.charAt(o) + u.charAt(a) + u.charAt(c);
  1097. return s
  1098. },
  1099. decode: function(e) {
  1100. var t, n, r, i, o, a, c, s = "", l = 0, u = this.map, f = String.fromCharCode;
  1101. for (e = e.replace(/[^A-Za-z0-9\+\/\=]/g, ""); l < e.length; )
  1102. t = u.indexOf(e.charAt(l++)),
  1103. n = u.indexOf(e.charAt(l++)),
  1104. r = u.indexOf(e.charAt(l++)),
  1105. i = u.indexOf(e.charAt(l++)),
  1106. o = t << 2 | n >> 4,
  1107. a = (15 & n) << 4 | r >> 2,
  1108. c = (3 & r) << 6 | i,
  1109. s = s + (f(o) + (64 != r ? f(a) : "")) + (64 != i ? f(c) : "");
  1110. return this.utf8.decode(s)
  1111. },
  1112. utf8: {
  1113. encode: function(e) {
  1114. for (var t, n = "", r = 0, i = String.fromCharCode; r < e.length; )
  1115. t = e.charCodeAt(r++),
  1116. 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);
  1117. return n
  1118. },
  1119. decode: function(e) {
  1120. for (var t, n, r = "", i = 0, o = String.fromCharCode; i < e.length; )
  1121. n = e.charCodeAt(i),
  1122. 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];
  1123. return r
  1124. }
  1125. }
  1126. },
  1127. "object" != typeof JSON && (JSON = {}),
  1128. function() {
  1129. function f(e) {
  1130. return 10 > e ? "0" + e : e
  1131. }
  1132. function quote(e) {
  1133. return escapable.lastIndex = 0,
  1134. escapable.test(e) ? '"' + e.replace(escapable, function(e) {
  1135. var t = meta[e];
  1136. return "string" == typeof t ? t : "\\u" + ("0000" + e.charCodeAt(0).toString(16)).slice(-4)
  1137. }) + '"' : '"' + e + '"'
  1138. }
  1139. function str(e, t) {
  1140. var n, r, i, o, a, c = gap, s = t[e];
  1141. switch (s && "object" == typeof s && "function" == typeof s.toJSON && (s = s.toJSON(e)),
  1142. "function" == typeof rep && (s = rep.call(t, e, s)),
  1143. typeof s) {
  1144. case "string":
  1145. return quote(s);
  1146. case "number":
  1147. return isFinite(s) ? String(s) : "null";
  1148. case "boolean":
  1149. case "null":
  1150. return String(s);
  1151. case "object":
  1152. if (!s)
  1153. return "null";
  1154. if (gap += indent,
  1155. a = [],
  1156. "[object Array]" === Object.prototype.toString.apply(s)) {
  1157. for (o = s.length,
  1158. n = 0; o > n; n += 1)
  1159. a[n] = str(n, s) || "null";
  1160. return i = 0 === a.length ? "[]" : gap ? "[\n" + gap + a.join(",\n" + gap) + "\n" + c + "]" : "[" + a.join(",") + "]",
  1161. gap = c,
  1162. i
  1163. }
  1164. if (rep && "object" == typeof rep)
  1165. for (o = rep.length,
  1166. n = 0; o > n; n += 1)
  1167. "string" == typeof rep[n] && (r = rep[n],
  1168. i = str(r, s),
  1169. i && a.push(quote(r) + (gap ? ": " : ":") + i));
  1170. else
  1171. for (r in s)
  1172. Object.prototype.hasOwnProperty.call(s, r) && (i = str(r, s),
  1173. i && a.push(quote(r) + (gap ? ": " : ":") + i));
  1174. return i = 0 === a.length ? "{}" : gap ? "{\n" + gap + a.join(",\n" + gap) + "\n" + c + "}" : "{" + a.join(",") + "}",
  1175. gap = c,
  1176. i
  1177. }
  1178. }
  1179. "function" != typeof Date.prototype.toJSON && (Date.prototype.toJSON = function() {
  1180. 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
  1181. }
  1182. ,
  1183. String.prototype.toJSON = Number.prototype.toJSON = Boolean.prototype.toJSON = function() {
  1184. return this.valueOf()
  1185. }
  1186. );
  1187. 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 = {
  1188. "\b": "\\b",
  1189. "\t": "\\t",
  1190. "\n": "\\n",
  1191. "\f": "\\f",
  1192. "\r": "\\r",
  1193. '"': '\\"',
  1194. "\\": "\\\\"
  1195. }, rep;
  1196. "function" != typeof JSON.stringify && (JSON.stringify = function(e, t, n) {
  1197. var r;
  1198. if (gap = "",
  1199. indent = "",
  1200. "number" == typeof n)
  1201. for (r = 0; n > r; r += 1)
  1202. indent += " ";
  1203. else
  1204. "string" == typeof n && (indent = n);
  1205. if (rep = t,
  1206. t && "function" != typeof t && ("object" != typeof t || "number" != typeof t.length))
  1207. throw new Error("JSON.stringify");
  1208. return str("", {
  1209. "": e
  1210. })
  1211. }
  1212. ),
  1213. "function" != typeof JSON.parse && (JSON.parse = function(text, reviver) {
  1214. function walk(e, t) {
  1215. var n, r, i = e[t];
  1216. if (i && "object" == typeof i)
  1217. for (n in i)
  1218. Object.prototype.hasOwnProperty.call(i, n) && (r = walk(i, n),
  1219. void 0 !== r ? i[n] = r : delete i[n]);
  1220. return reviver.call(e, t, i)
  1221. }
  1222. var j;
  1223. if (text = String(text),
  1224. cx.lastIndex = 0,
  1225. cx.test(text) && (text = text.replace(cx, function(e) {
  1226. return "\\u" + ("0000" + e.charCodeAt(0).toString(16)).slice(-4)
  1227. })),
  1228. /^[\],:{}\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, "")))
  1229. return j = eval("(" + text + ")"),
  1230. "function" == typeof reviver ? walk({
  1231. "": j
  1232. }, "") : j;
  1233. throw new SyntaxError("JSON.parse")
  1234. }
  1235. )
  1236. }(),
  1237. !function(e, t, n) {
  1238. "undefined" != typeof module && module.exports ? module.exports = n() : "function" == typeof define && define.amd ? define(n) : t[e] = n()
  1239. }("domready", Keen.utils, function(e) {
  1240. function t(e) {
  1241. for (d = 1; e = r.shift(); )
  1242. e()
  1243. }
  1244. 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]);
  1245. return o[l] && o[l](s, n = function() {
  1246. o.removeEventListener(s, n, i),
  1247. t()
  1248. }
  1249. , i),
  1250. c && o.attachEvent(u, n = function() {
  1251. /^c/.test(o[f]) && (o.detachEvent(u, n),
  1252. t())
  1253. }
  1254. ),
  1255. e = c ? function(t) {
  1256. self != top ? d ? t() : r.push(t) : function() {
  1257. try {
  1258. a.doScroll("left")
  1259. } catch (n) {
  1260. return setTimeout(function() {
  1261. e(t)
  1262. }, 50)
  1263. }
  1264. t()
  1265. }()
  1266. }
  1267. : function(e) {
  1268. d ? e() : r.push(e)
  1269. }
  1270. });
  1271. var loaded = window.Keen, cached = window._Keen || {}, clients, ready;
  1272. if (loaded && cached) {
  1273. clients = cached.clients || {},
  1274. ready = cached.ready || [];
  1275. for (var instance in clients)
  1276. if (clients.hasOwnProperty(instance)) {
  1277. var client = clients[instance];
  1278. for (var method in Keen.prototype)
  1279. Keen.prototype.hasOwnProperty(method) && (loaded.prototype[method] = Keen.prototype[method]);
  1280. if (loaded.Query = Keen.Query ? Keen.Query : function() {}
  1281. ,
  1282. loaded.Visualization = Keen.Visualization ? Keen.Visualization : function() {}
  1283. ,
  1284. client._config && (client.configure.call(client, client._config),
  1285. delete client._config),
  1286. client._setGlobalProperties) {
  1287. for (var globals = client._setGlobalProperties, i = 0; i < globals.length; i++)
  1288. client.setGlobalProperties.apply(client, globals[i]);
  1289. delete client._setGlobalProperties
  1290. }
  1291. if (client._addEvent) {
  1292. for (var queue = client._addEvent || [], i = 0; i < queue.length; i++)
  1293. client.addEvent.apply(client, queue[i]);
  1294. delete client._addEvent
  1295. }
  1296. var callback = client._on || [];
  1297. if (client._on) {
  1298. for (var i = 0; i < callback.length; i++)
  1299. client.on.apply(client, callback[i]);
  1300. client.trigger("ready"),
  1301. delete client._on
  1302. }
  1303. }
  1304. for (var i = 0; i < ready.length; i++) {
  1305. var callback = ready[i];
  1306. Keen.on("ready", function() {
  1307. callback()
  1308. })
  1309. }
  1310. }
  1311. return Keen.loaded && setTimeout(function() {
  1312. Keen.utils.domready(function() {
  1313. Keen.trigger("ready")
  1314. })
  1315. }, 0),
  1316. Keen
  1317. });
  1318. !function() {
  1319. var t = window.analytics = window.analytics || [];
  1320. if (!t.initialize) {
  1321. if (t.invoked)
  1322. return void (window.console && console.error && console.error("Segment snippet included twice."));
  1323. t.invoked = !0,
  1324. t.methods = ["trackSubmit", "trackClick", "trackLink", "trackForm", "pageview", "identify", "reset", "group", "track", "ready", "alias", "debug", "page", "once", "off", "on"],
  1325. t.factory = function(e) {
  1326. return function() {
  1327. var n = Array.prototype.slice.call(arguments);
  1328. return n.unshift(e),
  1329. t.push(n),
  1330. t
  1331. }
  1332. }
  1333. ;
  1334. for (var e = 0; e < t.methods.length; e++) {
  1335. var n = t.methods[e];
  1336. t[n] = t.factory(n)
  1337. }
  1338. t.load = function(t) {
  1339. var e = document.createElement("script");
  1340. e.type = "text/javascript",
  1341. e.async = !0,
  1342. e.src = ("https:" === document.location.protocol ? "https://" : "http://") + "cdn.segment.com/analytics.js/v1/" + t + "/analytics.min.js";
  1343. var n = document.getElementsByTagName("script")[0];
  1344. n.parentNode.insertBefore(e, n)
  1345. }
  1346. ,
  1347. t.SNIPPET_VERSION = "4.0.0"
  1348. }
  1349. }();
  1350. !function(i, e) {
  1351. "use strict";
  1352. var s = ""
  1353. , r = "?"
  1354. , o = "function"
  1355. , a = "undefined"
  1356. , n = "object"
  1357. , t = "major"
  1358. , d = "model"
  1359. , w = "name"
  1360. , l = "type"
  1361. , p = "vendor"
  1362. , m = "version"
  1363. , c = "architecture"
  1364. , u = "console"
  1365. , g = "mobile"
  1366. , f = "tablet"
  1367. , h = "smarttv"
  1368. , b = {
  1369. has: function(i, e) {
  1370. return e.toLowerCase().indexOf(i.toLowerCase()) !== -1
  1371. },
  1372. lowerize: function(i) {
  1373. return i.toLowerCase()
  1374. }
  1375. }
  1376. , y = {
  1377. rgx: function() {
  1378. for (var i, s, r, t, d, w, l, p = 0, m = arguments; p < m.length; p += 2) {
  1379. var c = m[p]
  1380. , u = m[p + 1];
  1381. if (typeof i === a) {
  1382. i = {};
  1383. for (t in u)
  1384. d = u[t],
  1385. typeof d === n ? i[d[0]] = e : i[d] = e
  1386. }
  1387. for (s = r = 0; s < c.length; s++)
  1388. if (w = c[s].exec(this.getUA())) {
  1389. for (t = 0; t < u.length; t++)
  1390. l = w[++r],
  1391. d = u[t],
  1392. 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;
  1393. break
  1394. }
  1395. if (w)
  1396. break
  1397. }
  1398. return i
  1399. },
  1400. str: function(i, s) {
  1401. for (var o in s)
  1402. if (typeof s[o] === n && s[o].length > 0) {
  1403. for (var a = 0; a < s[o].length; a++)
  1404. if (b.has(s[o][a], i))
  1405. return o === r ? e : o
  1406. } else if (b.has(s[o], i))
  1407. return o === r ? e : o;
  1408. return i
  1409. }
  1410. }
  1411. , v = {
  1412. browser: {
  1413. oldsafari: {
  1414. major: {
  1415. 1: ["/8", "/1", "/3"],
  1416. 2: "/4",
  1417. "?": "/"
  1418. },
  1419. version: {
  1420. "1.0": "/8",
  1421. 1.2: "/1",
  1422. 1.3: "/3",
  1423. "2.0": "/412",
  1424. "2.0.2": "/416",
  1425. "2.0.3": "/417",
  1426. "2.0.4": "/419",
  1427. "?": "/"
  1428. }
  1429. }
  1430. },
  1431. device: {
  1432. sprint: {
  1433. model: {
  1434. "Evo Shift 4G": "7373KT"
  1435. },
  1436. vendor: {
  1437. HTC: "APA",
  1438. Sprint: "Sprint"
  1439. }
  1440. }
  1441. },
  1442. os: {
  1443. windows: {
  1444. version: {
  1445. ME: "4.90",
  1446. "NT 3.11": "NT3.51",
  1447. "NT 4.0": "NT4.0",
  1448. 2e3: "NT 5.0",
  1449. XP: ["NT 5.1", "NT 5.2"],
  1450. Vista: "NT 6.0",
  1451. 7: "NT 6.1",
  1452. 8: "NT 6.2",
  1453. 8.1: "NT 6.3",
  1454. RT: "ARM"
  1455. }
  1456. }
  1457. }
  1458. }
  1459. , k = {
  1460. 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]],
  1461. 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]],
  1462. 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]],
  1463. 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]],
  1464. 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]]
  1465. }
  1466. , x = function(e) {
  1467. var r = e || (i && i.navigator && i.navigator.userAgent ? i.navigator.userAgent : s);
  1468. return this instanceof x ? (this.getBrowser = function() {
  1469. return y.rgx.apply(this, k.browser)
  1470. }
  1471. ,
  1472. this.getCPU = function() {
  1473. return y.rgx.apply(this, k.cpu)
  1474. }
  1475. ,
  1476. this.getDevice = function() {
  1477. return y.rgx.apply(this, k.device)
  1478. }
  1479. ,
  1480. this.getEngine = function() {
  1481. return y.rgx.apply(this, k.engine)
  1482. }
  1483. ,
  1484. this.getOS = function() {
  1485. return y.rgx.apply(this, k.os)
  1486. }
  1487. ,
  1488. this.getResult = function() {
  1489. return {
  1490. ua: this.getUA(),
  1491. browser: this.getBrowser(),
  1492. engine: this.getEngine(),
  1493. os: this.getOS(),
  1494. device: this.getDevice(),
  1495. cpu: this.getCPU()
  1496. }
  1497. }
  1498. ,
  1499. this.getUA = function() {
  1500. return r
  1501. }
  1502. ,
  1503. this.setUA = function(i) {
  1504. return r = i,
  1505. this
  1506. }
  1507. ,
  1508. void this.setUA(r)) : new x(e).getResult()
  1509. };
  1510. if (typeof exports !== a)
  1511. typeof module !== a && module.exports && (exports = module.exports = x),
  1512. exports.UAParser = x;
  1513. else if (i.UAParser = x,
  1514. typeof define === o && define.amd && define(function() {
  1515. return x
  1516. }),
  1517. typeof i.jQuery !== a) {
  1518. var A = i.jQuery
  1519. , _ = new x;
  1520. A.ua = _.getResult(),
  1521. A.ua.get = function() {
  1522. return _.getUA()
  1523. }
  1524. ,
  1525. A.ua.set = function(i) {
  1526. _.setUA(i);
  1527. var e = _.getResult();
  1528. for (var s in e)
  1529. A.ua[s] = e[s]
  1530. }
  1531. }
  1532. }(this);
  1533. window.Modernizr = function(n, e, t) {
  1534. function o(n) {
  1535. d.cssText = n
  1536. }
  1537. function r(n, e) {
  1538. return typeof n === e
  1539. }
  1540. var i, c, u, a = "2.8.2", f = {}, s = e.documentElement, l = "modernizr", p = e.createElement(l), d = p.style, y = ({}.toString,
  1541. {}), w = [], b = w.slice, v = {}.hasOwnProperty;
  1542. u = r(v, "undefined") || r(v.call, "undefined") ? function(n, e) {
  1543. return e in n && r(n.constructor.prototype[e], "undefined")
  1544. }
  1545. : function(n, e) {
  1546. return v.call(n, e)
  1547. }
  1548. ,
  1549. Function.prototype.bind || (Function.prototype.bind = function(n) {
  1550. var e = this;
  1551. if ("function" != typeof e)
  1552. throw new TypeError;
  1553. var t = b.call(arguments, 1)
  1554. , o = function() {
  1555. if (this instanceof o) {
  1556. var r = function() {};
  1557. r.prototype = e.prototype;
  1558. var i = new r
  1559. , c = e.apply(i, t.concat(b.call(arguments)));
  1560. return Object(c) === c ? c : i
  1561. }
  1562. return e.apply(n, t.concat(b.call(arguments)))
  1563. };
  1564. return o
  1565. }
  1566. ),
  1567. y.webgl = function() {
  1568. return !!n.WebGLRenderingContext
  1569. }
  1570. ;
  1571. for (var h in y)
  1572. u(y, h) && (c = h.toLowerCase(),
  1573. f[c] = y[h](),
  1574. w.push((f[c] ? "" : "no-") + c));
  1575. return f.addTest = function(n, e) {
  1576. if ("object" == typeof n)
  1577. for (var o in n)
  1578. u(n, o) && f.addTest(o, n[o]);
  1579. else {
  1580. if (n = n.toLowerCase(),
  1581. f[n] !== t)
  1582. return f;
  1583. e = "function" == typeof e ? e() : e,
  1584. "undefined" != typeof enableClasses && enableClasses && (s.className += " " + (e ? "" : "no-") + n),
  1585. f[n] = e
  1586. }
  1587. return f
  1588. }
  1589. ,
  1590. o(""),
  1591. p = i = null,
  1592. f._version = a,
  1593. f
  1594. }(this, this.document);
  1595. !function(e, t, a) {
  1596. "use strict";
  1597. function n(t, h, m) {
  1598. function H(a) {
  1599. var n = 0
  1600. , i = Ee.length;
  1601. if (Ce.old = e.extend({}, Ce),
  1602. Ie = we ? 0 : be[ge.horizontal ? "width" : "height"](),
  1603. ke = Be[ge.horizontal ? "width" : "height"](),
  1604. ze = we ? t : Pe[ge.horizontal ? "outerWidth" : "outerHeight"](),
  1605. Ee.length = 0,
  1606. Ce.start = 0,
  1607. Ce.end = q(ze - Ie, 0),
  1608. Re) {
  1609. n = Ne.length,
  1610. qe = Pe.children(ge.itemSelector),
  1611. Ne.length = 0;
  1612. 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;
  1613. ze = 0,
  1614. qe.each(function(t, a) {
  1615. var n = e(a)
  1616. , i = a.getBoundingClientRect()
  1617. , l = E(ge.horizontal ? i.width || i.right - i.left : i.height || i.bottom - i.top)
  1618. , d = c(n, ge.horizontal ? "marginLeft" : "marginTop")
  1619. , p = c(n, ge.horizontal ? "marginRight" : "marginBottom")
  1620. , h = l + d + p
  1621. , m = !d || !p
  1622. , g = {};
  1623. g.el = a,
  1624. g.size = m ? l : h,
  1625. g.half = g.size / 2,
  1626. g.start = ze + (m ? d : 0),
  1627. g.center = g.start - E(Ie / 2 - g.size / 2),
  1628. g.end = g.start - Ie + g.size,
  1629. t || (ze += s),
  1630. ze += h,
  1631. ge.horizontal || u || p && d && t > 0 && (ze -= N(d, p)),
  1632. t === v && (g.end += o,
  1633. ze += o,
  1634. f = m ? p : 0),
  1635. Ne.push(g),
  1636. r = g
  1637. }),
  1638. Pe[0].style[ge.horizontal ? "width" : "height"] = (l ? ze : ze - s - o) + "px",
  1639. ze -= f,
  1640. Ne.length ? (Ce.start = Ne[0][Me ? "center" : "start"],
  1641. Ce.end = Me ? r.center : ze > Ie ? r.end : Ce.start) : Ce.start = Ce.end = 0
  1642. }
  1643. if (Ce.center = E(Ce.end / 2 + Ce.start / 2),
  1644. Q(),
  1645. Se.length && ke > 0 && (ge.dynamicHandle ? (Te = Ce.start === Ce.end ? ke : E(ke * Ie / ze),
  1646. Te = d(Te, ge.minHandleSize, ke),
  1647. Se[0].style[ge.horizontal ? "width" : "height"] = Te + "px") : Te = Se[ge.horizontal ? "outerWidth" : "outerHeight"](),
  1648. xe.end = ke - Te,
  1649. it || j()),
  1650. !we && Ie > 0) {
  1651. var p = Ce.start
  1652. , h = "";
  1653. if (Re)
  1654. e.each(Ne, function(e, t) {
  1655. Me ? Ee.push(t.center) : t.start + t.size > p && p <= Ce.end && (p = t.start,
  1656. Ee.push(p),
  1657. p += Ie,
  1658. p > Ce.end && p < Ce.end + Ie && Ee.push(Ce.end))
  1659. });
  1660. else
  1661. for (; p - Ie < Ce.end; )
  1662. Ee.push(p),
  1663. p += Ie;
  1664. if (De[0] && i !== Ee.length) {
  1665. for (var m = 0; m < Ee.length; m++)
  1666. h += ge.pageBuilder.call(ye, m);
  1667. Ae = De.html(h).children(),
  1668. Ae.eq(Oe.activePage).addClass(ge.activeClass)
  1669. }
  1670. }
  1671. if (Oe.slideeSize = ze,
  1672. Oe.frameSize = Ie,
  1673. Oe.sbSize = ke,
  1674. Oe.handleSize = Te,
  1675. Re) {
  1676. a && null != ge.startAt && (W(ge.startAt),
  1677. ye[Le ? "toCenter" : "toStart"](ge.startAt));
  1678. var g = Ne[Oe.activeItem];
  1679. X(Le && g ? g.center : d(Ce.dest, Ce.start, Ce.end))
  1680. } else
  1681. a ? null != ge.startAt && X(ge.startAt, 1) : X(d(Ce.dest, Ce.start, Ce.end));
  1682. pe("load")
  1683. }
  1684. function X(e, t, a) {
  1685. if (Re && at.released && !a) {
  1686. var n = $(e)
  1687. , i = e > Ce.start && e < Ce.end;
  1688. Le ? (i && (e = Ne[n.centerItem].center),
  1689. Me && ge.activateMiddle && W(n.centerItem)) : i && (e = Ne[n.firstItem].start)
  1690. }
  1691. 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),
  1692. et.start = +new Date,
  1693. et.time = 0,
  1694. et.from = Ce.cur,
  1695. et.to = e,
  1696. et.delta = e - Ce.cur,
  1697. et.tweesing = at.tweese || at.init && !at.slidee,
  1698. et.immediate = !et.tweesing && (t || at.init && at.slidee || !ge.speed),
  1699. at.tweese = 0,
  1700. e !== Ce.dest && (Ce.dest = e,
  1701. pe("change"),
  1702. it || Y()),
  1703. K(),
  1704. Q(),
  1705. Z(),
  1706. F()
  1707. }
  1708. function Y() {
  1709. if (ye.initialized) {
  1710. if (!it)
  1711. return it = w(Y),
  1712. void (at.released && pe("moveStart"));
  1713. et.immediate ? Ce.cur = et.to : et.tweesing ? (et.tweeseDelta = et.to - Ce.cur,
  1714. 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),
  1715. Ce.cur = et.from + et.delta * e.easing[ge.easing](et.time / ge.speed, et.time, 0, 1, ge.speed)),
  1716. et.to === Ce.cur ? (Ce.cur = et.to,
  1717. at.tweese = it = 0) : it = w(Y),
  1718. pe("move"),
  1719. 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"),
  1720. !it && at.released && pe("moveEnd"),
  1721. j()
  1722. }
  1723. }
  1724. function j() {
  1725. 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,
  1726. xe.cur = d(E(xe.cur), xe.start, xe.end),
  1727. _e.hPos !== xe.cur && (_e.hPos = xe.cur,
  1728. f ? Se[0].style[f] = v + (ge.horizontal ? "translateX" : "translateY") + "(" + xe.cur + "px)" : Se[0].style[ge.horizontal ? "left" : "top"] = xe.cur + "px"))
  1729. }
  1730. function F() {
  1731. Ae[0] && _e.page !== Oe.activePage && (_e.page = Oe.activePage,
  1732. Ae.removeClass(ge.activeClass).eq(Oe.activePage).addClass(ge.activeClass),
  1733. pe("activePage", _e.page))
  1734. }
  1735. function M() {
  1736. tt.speed && Ce.cur !== (tt.speed > 0 ? Ce.end : Ce.start) || ye.stop(),
  1737. ot = at.init ? w(M) : 0,
  1738. tt.now = +new Date,
  1739. tt.pos = Ce.cur + (tt.now - tt.lastTime) / 1e3 * tt.speed,
  1740. X(at.init ? tt.pos : E(tt.pos)),
  1741. at.init || Ce.cur !== Ce.dest || pe("moveEnd"),
  1742. tt.lastTime = tt.now
  1743. }
  1744. function L(e, t, n) {
  1745. if ("boolean" === i(t) && (n = t,
  1746. t = a),
  1747. t === a)
  1748. X(Ce[e], n);
  1749. else {
  1750. if (Le && "center" !== e)
  1751. return;
  1752. var r = ye.getPos(t);
  1753. r && X(r[e], n, !Le)
  1754. }
  1755. }
  1756. function R(e) {
  1757. return null != e ? l(e) ? e >= 0 && e < Ne.length ? e : -1 : qe.index(e) : -1
  1758. }
  1759. function U(e) {
  1760. return R(l(e) && 0 > e ? e + Ne.length : e)
  1761. }
  1762. function W(e, t) {
  1763. var a = R(e);
  1764. return !(!Re || 0 > a) && ((_e.active !== a || t) && (qe.eq(Oe.activeItem).removeClass(ge.activeClass),
  1765. qe.eq(a).addClass(ge.activeClass),
  1766. _e.active = Oe.activeItem = a,
  1767. Z(),
  1768. pe("active", a)),
  1769. a)
  1770. }
  1771. function $(e) {
  1772. e = d(l(e) ? e : Ce.dest, Ce.start, Ce.end);
  1773. var t = {}
  1774. , a = Me ? 0 : Ie / 2;
  1775. if (!we)
  1776. for (var n = 0, i = Ee.length; i > n; n++) {
  1777. if (e >= Ce.end || n === Ee.length - 1) {
  1778. t.activePage = Ee.length - 1;
  1779. break
  1780. }
  1781. if (e <= Ee[n] + a) {
  1782. t.activePage = n;
  1783. break
  1784. }
  1785. }
  1786. if (Re) {
  1787. for (var r = !1, s = !1, o = !1, c = 0, u = Ne.length; u > c; c++)
  1788. if (r === !1 && e <= Ne[c].start + Ne[c].half && (r = c),
  1789. o === !1 && e <= Ne[c].center + Ne[c].half && (o = c),
  1790. c === u - 1 || e <= Ne[c].end + Ne[c].half) {
  1791. s = c;
  1792. break
  1793. }
  1794. t.firstItem = l(r) ? r : 0,
  1795. t.centerItem = l(o) ? o : t.firstItem,
  1796. t.lastItem = l(s) ? s : t.centerItem
  1797. }
  1798. return t
  1799. }
  1800. function Q(t) {
  1801. e.extend(Oe, $(t))
  1802. }
  1803. function Z() {
  1804. var e = Ce.dest <= Ce.start
  1805. , t = Ce.dest >= Ce.end
  1806. , a = (e ? 1 : 0) | (t ? 2 : 0);
  1807. if (_e.slideePosState !== a && (_e.slideePosState = a,
  1808. Je.is("button,input") && Je.prop("disabled", e),
  1809. Ke.is("button,input") && Ke.prop("disabled", t),
  1810. Je.add(Qe)[e ? "addClass" : "removeClass"](ge.disabledClass),
  1811. Ke.add($e)[t ? "addClass" : "removeClass"](ge.disabledClass)),
  1812. _e.fwdbwdState !== a && at.released && (_e.fwdbwdState = a,
  1813. Qe.is("button,input") && Qe.prop("disabled", e),
  1814. $e.is("button,input") && $e.prop("disabled", t)),
  1815. Re && null != Oe.activeItem) {
  1816. var n = 0 === Oe.activeItem
  1817. , i = Oe.activeItem >= Ne.length - 1
  1818. , r = (n ? 1 : 0) | (i ? 2 : 0);
  1819. _e.itemsButtonState !== r && (_e.itemsButtonState = r,
  1820. Ze.is("button,input") && Ze.prop("disabled", n),
  1821. Ge.is("button,input") && Ge.prop("disabled", i),
  1822. Ze[n ? "addClass" : "removeClass"](ge.disabledClass),
  1823. Ge[i ? "addClass" : "removeClass"](ge.disabledClass))
  1824. }
  1825. }
  1826. function G(e, t, a) {
  1827. if (e = U(e),
  1828. t = U(t),
  1829. e > -1 && t > -1 && e !== t && (!a || t !== e - 1) && (a || t !== e + 1)) {
  1830. qe.eq(e)[a ? "insertAfter" : "insertBefore"](Ne[t].el);
  1831. var n = t > e ? e : a ? t : t - 1
  1832. , i = e > t ? e : a ? t + 1 : t
  1833. , r = e > t;
  1834. 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)),
  1835. H()
  1836. }
  1837. }
  1838. function J(e, t) {
  1839. for (var a = 0, n = Ve[e].length; n > a; a++)
  1840. if (Ve[e][a] === t)
  1841. return a;
  1842. return -1
  1843. }
  1844. function K() {
  1845. at.released && !ye.isPaused && ye.resume()
  1846. }
  1847. function V(e) {
  1848. return E(d(e, xe.start, xe.end) / xe.end * (Ce.end - Ce.start)) + Ce.start
  1849. }
  1850. function _() {
  1851. at.history[0] = at.history[1],
  1852. at.history[1] = at.history[2],
  1853. at.history[2] = at.history[3],
  1854. at.history[3] = at.delta
  1855. }
  1856. function ee(e) {
  1857. at.released = 0,
  1858. at.source = e,
  1859. at.slidee = "slidee" === e
  1860. }
  1861. function te(t) {
  1862. var a = "touchstart" === t.type
  1863. , n = t.data.source
  1864. , i = "slidee" === n;
  1865. 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),
  1866. ee(n),
  1867. at.init = 0,
  1868. at.$source = e(t.target),
  1869. at.touch = a,
  1870. at.pointer = a ? t.originalEvent.touches[0] : t,
  1871. at.initX = at.pointer.pageX,
  1872. at.initY = at.pointer.pageY,
  1873. at.initPos = i ? Ce.cur : xe.cur,
  1874. at.start = +new Date,
  1875. at.time = 0,
  1876. at.path = 0,
  1877. at.delta = 0,
  1878. at.locked = 0,
  1879. at.history = [0, 0, 0, 0],
  1880. at.pathToLock = i ? a ? 30 : 10 : 0,
  1881. b.on(a ? z : I, ae),
  1882. ye.pause(1),
  1883. (i ? Pe : Se).addClass(ge.draggedClass),
  1884. pe("moveStart"),
  1885. i && (rt = setInterval(_, 10)))
  1886. }
  1887. function ae(e) {
  1888. if (at.released = "mouseup" === e.type || "touchend" === e.type,
  1889. at.pointer = at.touch ? e.originalEvent[at.released ? "changedTouches" : "touches"][0] : e,
  1890. at.pathX = at.pointer.pageX - at.initX,
  1891. at.pathY = at.pointer.pageY - at.initY,
  1892. at.path = D(A(at.pathX, 2) + A(at.pathY, 2)),
  1893. at.delta = ge.horizontal ? at.pathX : at.pathY,
  1894. at.released || !(at.path < 1)) {
  1895. if (!at.init) {
  1896. if (!(ge.horizontal ? x(at.pathX) > x(at.pathY) : x(at.pathX) < x(at.pathY)))
  1897. return ne();
  1898. at.init = 1
  1899. }
  1900. r(e),
  1901. !at.locked && at.path > at.pathToLock && at.slidee && (at.locked = 1,
  1902. at.$source.on(B, s)),
  1903. at.released && (ne(),
  1904. ge.releaseSwing && at.slidee && (at.swing = (at.delta - at.history[0]) / 40 * 300,
  1905. at.delta += at.swing,
  1906. at.tweese = x(at.swing) > 10)),
  1907. X(at.slidee ? E(at.initPos - at.delta) : V(at.initPos + at.delta))
  1908. }
  1909. }
  1910. function ne() {
  1911. clearInterval(rt),
  1912. at.released = !0,
  1913. b.off(at.touch ? z : I, ae),
  1914. (at.slidee ? Pe : Se).removeClass(ge.draggedClass),
  1915. setTimeout(function() {
  1916. at.$source.off(B, s)
  1917. }),
  1918. Ce.cur === Ce.dest && at.init && pe("moveEnd"),
  1919. ye.resume(1),
  1920. at.init = 0
  1921. }
  1922. function ie(t) {
  1923. return ~e.inArray(t.nodeName, k) || e(t).is(ge.interactive)
  1924. }
  1925. function re() {
  1926. ye.stop(),
  1927. b.off("mouseup", re)
  1928. }
  1929. function se(e) {
  1930. switch (r(e),
  1931. this) {
  1932. case $e[0]:
  1933. case Qe[0]:
  1934. ye.moveBy($e.is(this) ? ge.moveBy : -ge.moveBy),
  1935. b.on("mouseup", re);
  1936. break;
  1937. case Ze[0]:
  1938. ye.prev();
  1939. break;
  1940. case Ge[0]:
  1941. ye.next();
  1942. break;
  1943. case Je[0]:
  1944. ye.prevPage();
  1945. break;
  1946. case Ke[0]:
  1947. ye.nextPage()
  1948. }
  1949. }
  1950. function oe(e) {
  1951. return nt.curDelta = (ge.horizontal ? e.deltaY || e.deltaX : e.deltaY) || -e.wheelDelta,
  1952. nt.curDelta /= 1 === e.deltaMode ? 3 : 100,
  1953. Re ? (p = +new Date,
  1954. nt.last < p - nt.resetTime && (nt.delta = 0),
  1955. nt.last = p,
  1956. nt.delta += nt.curDelta,
  1957. x(nt.delta) < 1 ? nt.finalDelta = 0 : (nt.finalDelta = E(nt.delta / 1),
  1958. nt.delta %= 1),
  1959. nt.finalDelta) : nt.curDelta
  1960. }
  1961. function le(e) {
  1962. e.originalEvent[g] = ye;
  1963. var t = +new Date;
  1964. if (O + ge.scrollHijack > t && Ue[0] !== document && Ue[0] !== window)
  1965. return void (O = t);
  1966. if (ge.scrollBy && Ce.start !== Ce.end) {
  1967. var a = oe(e.originalEvent);
  1968. (ge.scrollTrap || a > 0 && Ce.dest < Ce.end || 0 > a && Ce.dest > Ce.start) && r(e, 1),
  1969. ye.slideBy(ge.scrollBy * a)
  1970. }
  1971. }
  1972. function ce(e) {
  1973. ge.clickBar && e.target === Be[0] && (r(e),
  1974. X(V((ge.horizontal ? e.pageX - Be.offset().left : e.pageY - Be.offset().top) - Te / 2)))
  1975. }
  1976. function de(e) {
  1977. if (ge.keyboardNavBy)
  1978. switch (e.which) {
  1979. case ge.horizontal ? 37 : 38:
  1980. r(e),
  1981. ye["pages" === ge.keyboardNavBy ? "prevPage" : "prev"]();
  1982. break;
  1983. case ge.horizontal ? 39 : 40:
  1984. r(e),
  1985. ye["pages" === ge.keyboardNavBy ? "nextPage" : "next"]()
  1986. }
  1987. }
  1988. function ue(e) {
  1989. return ie(this) ? void (e.originalEvent[g + "ignore"] = !0) : void (this.parentNode !== Pe[0] || e.originalEvent[g + "ignore"] || ye.activate(this))
  1990. }
  1991. function fe() {
  1992. this.parentNode === De[0] && ye.activatePage(Ae.index(this))
  1993. }
  1994. function ve(e) {
  1995. ge.pauseOnHover && ye["mouseenter" === e.type ? "pause" : "resume"](2)
  1996. }
  1997. function pe(e, t) {
  1998. if (Ve[e]) {
  1999. for (me = Ve[e].length,
  2000. T.length = 0,
  2001. he = 0; me > he; he++)
  2002. T.push(Ve[e][he]);
  2003. for (he = 0; me > he; he++)
  2004. T[he].call(ye, e, t)
  2005. }
  2006. }
  2007. 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 = {
  2008. start: 0,
  2009. center: 0,
  2010. end: 0,
  2011. cur: 0,
  2012. dest: 0
  2013. }, Be = e(ge.scrollBar).eq(0), Se = Be.children().eq(0), ke = 0, Te = 0, xe = {
  2014. start: 0,
  2015. end: 0,
  2016. cur: 0
  2017. }, De = e(ge.pagesBar), Ae = 0, Ee = [], qe = 0, Ne = [], Oe = {
  2018. firstItem: 0,
  2019. lastItem: 0,
  2020. centerItem: 0,
  2021. activeItem: null,
  2022. activePage: 0
  2023. }, 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 = {
  2024. released: 1
  2025. }, nt = {
  2026. last: 0,
  2027. delta: 0,
  2028. resetTime: 200
  2029. }, it = 0, rt = 0, st = 0, ot = 0;
  2030. we || (t = be[0]),
  2031. ye.initialized = 0,
  2032. ye.frame = t,
  2033. ye.slidee = Pe[0],
  2034. ye.pos = Ce,
  2035. ye.rel = Oe,
  2036. ye.items = Ne,
  2037. ye.pages = Ee,
  2038. ye.isPaused = 0,
  2039. ye.options = ge,
  2040. ye.dragging = at,
  2041. ye.reload = function() {
  2042. H()
  2043. }
  2044. ,
  2045. ye.getPos = function(e) {
  2046. if (Re) {
  2047. var t = R(e);
  2048. return -1 !== t && Ne[t]
  2049. }
  2050. var a = Pe.find(e).eq(0);
  2051. if (a[0]) {
  2052. var n = ge.horizontal ? a.offset().left - Pe.offset().left : a.offset().top - Pe.offset().top
  2053. , i = a[ge.horizontal ? "outerWidth" : "outerHeight"]();
  2054. return {
  2055. start: n,
  2056. center: n - Ie / 2 + i / 2,
  2057. end: n - Ie + i,
  2058. size: i
  2059. }
  2060. }
  2061. return !1
  2062. }
  2063. ,
  2064. ye.moveBy = function(e) {
  2065. tt.speed = e,
  2066. !at.init && tt.speed && Ce.cur !== (tt.speed > 0 ? Ce.end : Ce.start) && (tt.lastTime = +new Date,
  2067. tt.startPos = Ce.cur,
  2068. ee("button"),
  2069. at.init = 1,
  2070. pe("moveStart"),
  2071. y(ot),
  2072. M())
  2073. }
  2074. ,
  2075. ye.stop = function() {
  2076. "button" === at.source && (at.init = 0,
  2077. at.released = 1)
  2078. }
  2079. ,
  2080. ye.prev = function() {
  2081. ye.activate(null == Oe.activeItem ? 0 : Oe.activeItem - 1)
  2082. }
  2083. ,
  2084. ye.next = function() {
  2085. ye.activate(null == Oe.activeItem ? 0 : Oe.activeItem + 1)
  2086. }
  2087. ,
  2088. ye.prevPage = function() {
  2089. ye.activatePage(Oe.activePage - 1)
  2090. }
  2091. ,
  2092. ye.nextPage = function() {
  2093. ye.activatePage(Oe.activePage + 1)
  2094. }
  2095. ,
  2096. ye.slideBy = function(e, t) {
  2097. e && (Re ? ye[Le ? "toCenter" : "toStart"](d((Le ? Oe.centerItem : Oe.firstItem) + ge.scrollBy * e, 0, Ne.length)) : X(Ce.dest + e, t))
  2098. }
  2099. ,
  2100. ye.slideTo = function(e, t) {
  2101. X(e, t)
  2102. }
  2103. ,
  2104. ye.toStart = function(e, t) {
  2105. L("start", e, t)
  2106. }
  2107. ,
  2108. ye.toEnd = function(e, t) {
  2109. L("end", e, t)
  2110. }
  2111. ,
  2112. ye.toCenter = function(e, t) {
  2113. L("center", e, t)
  2114. }
  2115. ,
  2116. ye.getIndex = R,
  2117. ye.activate = function(e, t) {
  2118. var a = W(e);
  2119. ge.smart && a !== !1 && (Le ? ye.toCenter(a, t) : a >= Oe.lastItem ? ye.toStart(a, t) : a <= Oe.firstItem ? ye.toEnd(a, t) : K())
  2120. }
  2121. ,
  2122. ye.activatePage = function(e, t) {
  2123. l(e) && X(Ee[d(e, 0, Ee.length - 1)], t)
  2124. }
  2125. ,
  2126. ye.resume = function(e) {
  2127. ge.cycleBy && ge.cycleInterval && ("items" !== ge.cycleBy || Ne[0] && null != Oe.activeItem) && !(e < ye.isPaused) && (ye.isPaused = 0,
  2128. st ? st = clearTimeout(st) : pe("resume"),
  2129. st = setTimeout(function() {
  2130. switch (pe("cycle"),
  2131. ge.cycleBy) {
  2132. case "items":
  2133. ye.activate(Oe.activeItem >= Ne.length - 1 ? 0 : Oe.activeItem + 1);
  2134. break;
  2135. case "pages":
  2136. ye.activatePage(Oe.activePage >= Ee.length - 1 ? 0 : Oe.activePage + 1)
  2137. }
  2138. }, ge.cycleInterval))
  2139. }
  2140. ,
  2141. ye.pause = function(e) {
  2142. e < ye.isPaused || (ye.isPaused = e || 100,
  2143. st && (st = clearTimeout(st),
  2144. pe("pause")))
  2145. }
  2146. ,
  2147. ye.toggle = function() {
  2148. ye[st ? "pause" : "resume"]()
  2149. }
  2150. ,
  2151. ye.set = function(t, a) {
  2152. e.isPlainObject(t) ? e.extend(ge, t) : ge.hasOwnProperty(t) && (ge[t] = a)
  2153. }
  2154. ,
  2155. ye.add = function(t, a) {
  2156. var n = e(t);
  2157. Re ? (null == a || !Ne[0] || a >= Ne.length ? n.appendTo(Pe) : Ne.length && n.insertBefore(Ne[a].el),
  2158. null != Oe.activeItem && a <= Oe.activeItem && (_e.active = Oe.activeItem += n.length)) : Pe.append(n),
  2159. H()
  2160. }
  2161. ,
  2162. ye.remove = function(t) {
  2163. if (Re) {
  2164. var a = U(t);
  2165. if (a > -1) {
  2166. qe.eq(a).remove();
  2167. var n = a === Oe.activeItem;
  2168. null != Oe.activeItem && a < Oe.activeItem && (_e.active = --Oe.activeItem),
  2169. H(),
  2170. n && (_e.active = null,
  2171. ye.activate(Oe.activeItem))
  2172. }
  2173. } else
  2174. e(t).remove(),
  2175. H()
  2176. }
  2177. ,
  2178. ye.moveAfter = function(e, t) {
  2179. G(e, t, 1)
  2180. }
  2181. ,
  2182. ye.moveBefore = function(e, t) {
  2183. G(e, t)
  2184. }
  2185. ,
  2186. ye.on = function(e, t) {
  2187. if ("object" === i(e))
  2188. for (var a in e)
  2189. e.hasOwnProperty(a) && ye.on(a, e[a]);
  2190. else if ("function" === i(t))
  2191. for (var n = e.split(" "), r = 0, s = n.length; s > r; r++)
  2192. Ve[n[r]] = Ve[n[r]] || [],
  2193. -1 === J(n[r], t) && Ve[n[r]].push(t);
  2194. else if ("array" === i(t))
  2195. for (var o = 0, l = t.length; l > o; o++)
  2196. ye.on(e, t[o])
  2197. }
  2198. ,
  2199. ye.one = function(e, t) {
  2200. function a() {
  2201. t.apply(ye, arguments),
  2202. ye.off(e, a)
  2203. }
  2204. ye.on(e, a)
  2205. }
  2206. ,
  2207. ye.off = function(e, t) {
  2208. if (t instanceof Array)
  2209. for (var a = 0, n = t.length; n > a; a++)
  2210. ye.off(e, t[a]);
  2211. else
  2212. for (var i = e.split(" "), r = 0, s = i.length; s > r; r++)
  2213. if (Ve[i[r]] = Ve[i[r]] || [],
  2214. null == t)
  2215. Ve[i[r]].length = 0;
  2216. else {
  2217. var o = J(i[r], t);
  2218. -1 !== o && Ve[i[r]].splice(o, 1)
  2219. }
  2220. }
  2221. ,
  2222. ye.destroy = function() {
  2223. return Ue.add(Se).add(Be).add(De).add($e).add(Qe).add(Ze).add(Ge).add(Je).add(Ke).off("." + g),
  2224. b.off("keydown", de),
  2225. Ze.add(Ge).add(Je).add(Ke).removeClass(ge.disabledClass),
  2226. qe && null != Oe.activeItem && qe.eq(Oe.activeItem).removeClass(ge.activeClass),
  2227. De.empty(),
  2228. we || (be.off("." + g),
  2229. He.restore(),
  2230. Xe.restore(),
  2231. Ye.restore(),
  2232. je.restore(),
  2233. e.removeData(t, g)),
  2234. Ne.length = Ee.length = 0,
  2235. _e = {},
  2236. ye.initialized = 0,
  2237. ye
  2238. }
  2239. ,
  2240. ye.init = function() {
  2241. if (!ye.initialized) {
  2242. ye.on(m);
  2243. var e = ["overflow", "position"]
  2244. , t = ["position", "webkitTransform", "msTransform", "transform", "left", "top", "width", "height"];
  2245. He.save.apply(He, e),
  2246. Ye.save.apply(Ye, e),
  2247. Xe.save.apply(Xe, t),
  2248. je.save.apply(je, t);
  2249. var a = Se;
  2250. return we || (a = a.add(Pe),
  2251. be.css("overflow", "hidden"),
  2252. f || "static" !== be.css("position") || be.css("position", "relative")),
  2253. f ? v && a.css(f, v) : ("static" === Be.css("position") && Be.css("position", "relative"),
  2254. a.css({
  2255. position: "absolute"
  2256. })),
  2257. ge.forward && $e.on(S, se),
  2258. ge.backward && Qe.on(S, se),
  2259. ge.prev && Ze.on(B, se),
  2260. ge.next && Ge.on(B, se),
  2261. ge.prevPage && Je.on(B, se),
  2262. ge.nextPage && Ke.on(B, se),
  2263. Ue.on(C, le),
  2264. Be[0] && Be.on(B, ce),
  2265. Re && ge.activateOn && be.on(ge.activateOn + "." + g, "*", ue),
  2266. De[0] && ge.activatePageOn && De.on(ge.activatePageOn + "." + g, "*", fe),
  2267. We.on(P, {
  2268. source: "slidee"
  2269. }, te),
  2270. Se && Se.on(P, {
  2271. source: "handle"
  2272. }, te),
  2273. b.on("keydown", de),
  2274. we || (be.on("mouseenter." + g + " mouseleave." + g, ve),
  2275. be.on("scroll." + g, o)),
  2276. ye.initialized = 1,
  2277. H(!0),
  2278. ge.cycleBy && !we && ye[ge.startPaused ? "pause" : "resume"](),
  2279. ye
  2280. }
  2281. }
  2282. }
  2283. function i(e) {
  2284. 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
  2285. }
  2286. function r(e, t) {
  2287. e.preventDefault(),
  2288. t && e.stopPropagation()
  2289. }
  2290. function s(t) {
  2291. r(t, 1),
  2292. e(this).off(t.type, s)
  2293. }
  2294. function o() {
  2295. this.scrollLeft = 0,
  2296. this.scrollTop = 0
  2297. }
  2298. function l(e) {
  2299. return !isNaN(parseFloat(e)) && isFinite(e)
  2300. }
  2301. function c(e, t) {
  2302. return 0 | E(String(e.css(t)).replace(/[^\-0-9.]/g, ""))
  2303. }
  2304. function d(e, t, a) {
  2305. return t > e ? t : e > a ? a : e
  2306. }
  2307. function u(e) {
  2308. var t = {};
  2309. return t.style = {},
  2310. t.save = function() {
  2311. if (e && e.nodeType) {
  2312. for (var a = 0; a < arguments.length; a++)
  2313. t.style[arguments[a]] = e.style[arguments[a]];
  2314. return t
  2315. }
  2316. }
  2317. ,
  2318. t.restore = function() {
  2319. if (e && e.nodeType) {
  2320. for (var a in t.style)
  2321. t.style.hasOwnProperty(a) && (e.style[a] = t.style[a]);
  2322. return t
  2323. }
  2324. }
  2325. ,
  2326. t
  2327. }
  2328. 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;
  2329. b.on(C, function(e) {
  2330. var t = e.originalEvent[g]
  2331. , a = +new Date;
  2332. (!t || t.options.scrollHijack < a - O) && (O = a)
  2333. }),
  2334. function(e) {
  2335. function t(e) {
  2336. var t = (new Date).getTime()
  2337. , n = Math.max(0, 16 - (t - a))
  2338. , i = setTimeout(e, n);
  2339. return a = t,
  2340. i
  2341. }
  2342. w = e.requestAnimationFrame || e.webkitRequestAnimationFrame || t;
  2343. var a = (new Date).getTime()
  2344. , n = e.cancelAnimationFrame || e.webkitCancelAnimationFrame || e.clearTimeout;
  2345. y = function(t) {
  2346. n.call(e, t)
  2347. }
  2348. }(window),
  2349. function() {
  2350. function e(e) {
  2351. for (var n = 0, i = t.length; i > n; n++) {
  2352. var r = t[n] ? t[n] + e.charAt(0).toUpperCase() + e.slice(1) : e;
  2353. if (null != a.style[r])
  2354. return r
  2355. }
  2356. }
  2357. var t = ["", "webkit", "moz", "ms", "o"]
  2358. , a = document.createElement("div");
  2359. f = e("transform"),
  2360. v = e("perspective") ? "translateZ(0) " : ""
  2361. }(),
  2362. t[m] = n,
  2363. e.fn[h] = function(t, a) {
  2364. var r, s;
  2365. return e.isPlainObject(t) || (("string" === i(t) || t === !1) && (r = t === !1 ? "destroy" : t,
  2366. s = Array.prototype.slice.call(arguments, 1)),
  2367. t = {}),
  2368. this.each(function(i, o) {
  2369. var l = e.data(o, g);
  2370. l || r ? l && r && l[r] && l[r].apply(l, s) : l = e.data(o, g, new n(o,t,a).init())
  2371. })
  2372. }
  2373. ,
  2374. n.defaults = {
  2375. slidee: null,
  2376. horizontal: !1,
  2377. itemNav: null,
  2378. itemSelector: null,
  2379. smart: !1,
  2380. activateOn: null,
  2381. activateMiddle: !1,
  2382. scrollSource: null,
  2383. scrollBy: 0,
  2384. scrollHijack: 300,
  2385. scrollTrap: !1,
  2386. dragSource: null,
  2387. mouseDragging: !1,
  2388. touchDragging: !1,
  2389. releaseSwing: !1,
  2390. swingSpeed: .2,
  2391. elasticBounds: !1,
  2392. interactive: null,
  2393. scrollBar: null,
  2394. dragHandle: !1,
  2395. dynamicHandle: !1,
  2396. minHandleSize: 50,
  2397. clickBar: !1,
  2398. syncSpeed: .5,
  2399. pagesBar: null,
  2400. activatePageOn: null,
  2401. pageBuilder: function(e) {
  2402. return "<li>" + (e + 1) + "</li>"
  2403. },
  2404. forward: null,
  2405. backward: null,
  2406. prev: null,
  2407. next: null,
  2408. prevPage: null,
  2409. nextPage: null,
  2410. cycleBy: null,
  2411. cycleInterval: 5e3,
  2412. pauseOnHover: !1,
  2413. startPaused: !1,
  2414. moveBy: 300,
  2415. speed: 0,
  2416. easing: "swing",
  2417. startAt: null,
  2418. keyboardNavBy: null,
  2419. draggedClass: "dragged",
  2420. activeClass: "active",
  2421. disabledClass: "disabled"
  2422. }
  2423. }(jQuery, window);
  2424. !function e(t, i, n) {
  2425. function r(a, s) {
  2426. if (!i[a]) {
  2427. if (!t[a]) {
  2428. var l = "function" == typeof require && require;
  2429. if (!s && l)
  2430. return l(a, !0);
  2431. if (o)
  2432. return o(a, !0);
  2433. var c = new Error("Cannot find module '" + a + "'");
  2434. throw c.code = "MODULE_NOT_FOUND",
  2435. c
  2436. }
  2437. var h = i[a] = {
  2438. exports: {}
  2439. };
  2440. t[a][0].call(h.exports, function(e) {
  2441. var i = t[a][1][e];
  2442. return r(i ? i : e)
  2443. }, h, h.exports, e, t, i, n)
  2444. }
  2445. return i[a].exports
  2446. }
  2447. for (var o = "function" == typeof require && require, a = 0; a < n.length; a++)
  2448. r(n[a]);
  2449. return r
  2450. }({
  2451. 1: [function(e, t, i) {
  2452. (function(i) {
  2453. "use strict";
  2454. function n(e) {
  2455. this.player = null,
  2456. this.director = null,
  2457. this.modelManager = null,
  2458. this.container = null,
  2459. this.tagManager = null,
  2460. this.fadeInSpeed = e,
  2461. null !== this.fadeInSpeed && void 0 !== this.fadeInSpeed || (this.fadeInSpeed = 0)
  2462. }
  2463. var r = e("three")
  2464. , o = e("./util/logger")
  2465. , a = (e("./util/common"),
  2466. e("./enum/PlayerEvents"))
  2467. , s = e("./enum/DirectorEvents")
  2468. , l = e("./settings")
  2469. , c = e("./enum/Viewmode")
  2470. , h = (e("./enum/WarpStyle"),
  2471. e("./enum/BlackoutStyle"),
  2472. e("./enum/ModelManagerEvents"))
  2473. , u = e("./enum/tagEvents")
  2474. , d = e("./util/transitions")
  2475. , p = e("./util/lerp")
  2476. , f = new o(i);
  2477. n.prototype.init = function(e, t, i, n, r) {
  2478. this.player = t,
  2479. this.director = e,
  2480. this.modelManager = i,
  2481. this.tagManager = n,
  2482. this.container = r,
  2483. this.updateModel(),
  2484. this.bindEvents()
  2485. }
  2486. ,
  2487. n.prototype.bindEvents = function() {
  2488. this.modelManager.on(h.ActiveModelChanged, this.updateModel.bind(this)),
  2489. this.player.on(a.ModeChanging, this.handlePlayerModeChanging.bind(this)),
  2490. this.player.on(a.ModeChanged, this.handlePlayerModeChanged.bind(this)),
  2491. this.player.on(a.ClosestPanoChanging, this.handleClosestPanoChanging.bind(this)),
  2492. this.player.on(a.StartInside, this.handleStartInside.bind(this)),
  2493. this.player.on(a.StartOutside, this.handleStartOutside.bind(this)),
  2494. this.player.on(a.WarpStarted, this.handleWarpStarted.bind(this)),
  2495. this.director.on(s.ActionInterrupted, this.handleActionInterruption.bind(this)),
  2496. this.tagManager.on(u.TagActivated, this.ontagActivated.bind(this)),
  2497. this.tagManager.on(u.TagNavigation, this.onNavigationTotag.bind(this))
  2498. }
  2499. ,
  2500. n.prototype.updateModel = function() {
  2501. this.model = this.modelManager.getActiveModel()
  2502. }
  2503. ,
  2504. n.prototype.handleWarpStarted = function() {
  2505. this.hidePlayerReticule()
  2506. }
  2507. ,
  2508. n.prototype.ontagActivated = function() {
  2509. this.hidePlayerReticule()
  2510. }
  2511. ,
  2512. n.prototype.onNavigationTotag = function() {
  2513. this.hidePlayerReticule()
  2514. }
  2515. ,
  2516. n.prototype.handlePlayerModeChanging = function(e, t, i) {
  2517. var n = this.modelManager.getActiveModel()
  2518. , r = this.player.is360View(t, i) || this.director.tourIsPlaying ? 0 : l[t].markerOpacity;
  2519. n.fadePanoMarkers(r),
  2520. n.setMode(t)
  2521. }
  2522. ,
  2523. n.prototype.handlePlayerModeChanged = function(e, t) {
  2524. var i = this.modelManager.getActiveModel()
  2525. , n = t === c.PANORAMA ? r.DoubleSide : r.FrontSide;
  2526. i.setSide(n),
  2527. i.setMode(t)
  2528. }
  2529. ,
  2530. n.prototype.handleClosestPanoChanging = function(e, t, i) {
  2531. i !== c.TRANSITIONING && (e && !this.director.tourIsPlaying && e.hoverOff(i),
  2532. t && !this.director.tourIsPlaying && t.hoverOn(i))
  2533. }
  2534. ,
  2535. n.prototype.handleActionInterruption = function() {}
  2536. ,
  2537. n.prototype.handleStartInside = function(e) {
  2538. var t = l[this.player.mode]
  2539. , i = e ? 0 : t.transitionTime * t.skyboxOpacityLength;
  2540. this.fadeIn(this.fadeInSpeed),
  2541. this.model.alpha = 0,
  2542. this.model.skybox.material.uniforms.opacity.value = 1,
  2543. this.model.fadePanoMarkers(e ? 0 : t.markerOpacity);
  2544. var n = this.player.reticule;
  2545. d.start(p.property(n.material, "opacity", 0), i, null, 0, null, "retReOpac")
  2546. }
  2547. ,
  2548. n.prototype.handleStartOutside = function(e) {
  2549. this.fadeIn(e)
  2550. }
  2551. ,
  2552. n.prototype.fadeIn = function(e) {
  2553. null !== e && void 0 !== e || (e = 2e3,
  2554. f.warn("DisplayController.fadeIn -> no transition time specified, defaulting to 2000 ms.")),
  2555. $(this.container).fadeIn(e)
  2556. }
  2557. ,
  2558. n.prototype.hidePlayerReticule = function() {
  2559. this.player.reticule.hide()
  2560. }
  2561. ,
  2562. t.exports = n
  2563. }
  2564. ).call(this, "/js/DisplayController.js")
  2565. }
  2566. , {
  2567. "./enum/BlackoutStyle": 18,
  2568. "./enum/DirectorEvents": 23,
  2569. "./enum/tagEvents": 32,
  2570. "./enum/ModelManagerEvents": 33,
  2571. "./enum/PlayerEvents": 40,
  2572. "./enum/Viewmode": 51,
  2573. "./enum/WarpStyle": 52,
  2574. "./settings": 166,
  2575. "./util/common": 185,
  2576. "./util/lerp": 188,
  2577. "./util/logger": 189,
  2578. "./util/transitions": 195,
  2579. three: 217
  2580. }],
  2581. 2: [function(e, t, i) {
  2582. "use strict";
  2583. function n() {
  2584. this.baseStartTime = performance.timing.navigationStart,
  2585. this.loadingStartTime = null,
  2586. this.waitingStartTime = null,
  2587. this.appReadyTime = null
  2588. }
  2589. n.prototype.setBaseStartTime = function(e) {
  2590. this.baseStartTime = e || Date.now()
  2591. }
  2592. ,
  2593. n.prototype.setWaitingStartTime = function(e) {
  2594. this.waitingStartTime = e || Date.now()
  2595. }
  2596. ,
  2597. n.prototype.setLoadingStartTime = function(e) {
  2598. this.loadingStartTime = e || Date.now()
  2599. }
  2600. ,
  2601. n.prototype.setAppReadyTime = function(e) {
  2602. this.appReadyTime = e || Date.now()
  2603. }
  2604. ,
  2605. n.prototype.calcFullLoadingTime = function() {
  2606. var e = this.appReadyTime - this.baseStartTime;
  2607. return this.waitingStartTime && (e -= this.loadingStartTime - this.waitingStartTime),
  2608. e
  2609. }
  2610. ,
  2611. t.exports = n
  2612. }
  2613. , {}],
  2614. 3: [function(e, t, i) {
  2615. (function(i) {
  2616. "use strict";
  2617. function n() {
  2618. return 100 * Math.random()
  2619. }
  2620. var r = e("./util/logger")
  2621. , o = e("./util/browser")
  2622. , a = new r(i)
  2623. , s = window.MP_AB_TESTS = window.MP_AB_TESTS || {
  2624. initialized: !1,
  2625. init: function(e, t) {
  2626. if (t = t || {},
  2627. !this.initialized) {
  2628. this.initialized = !0,
  2629. o.valueFromHash("tilegen") && (t.tilegen = 1 === o.valueFromHash("tilegen", 0)),
  2630. o.valueFromHash("imgopt") && (t.imgopt = 1 === o.valueFromHash("imgopt", 0));
  2631. for (var i in e) {
  2632. var r = i.match("^sc_tilegen_([0-9]+)$");
  2633. r && (s.tilegen = n() < parseInt(r[1]));
  2634. var l = i.match("^sc_imgopt_([0-9]+)$");
  2635. l && (s.imgopt = n() < parseInt(l[1]))
  2636. }
  2637. for (var c in t)
  2638. s[c] = t[c],
  2639. a.debug("A/B override:", c, s[c])
  2640. }
  2641. },
  2642. changeIfTileGenerating: function(e) {
  2643. return s.tilegen && (e += e.indexOf("?") === -1 ? "?" : "&",
  2644. e += ""),
  2645. e
  2646. },
  2647. changeIfImageOptimzing: function(e) {
  2648. return s.imgopt && e.indexOf("imgopt=1") === -1 && (e += e.indexOf("?") === -1 ? "?" : "&",
  2649. e += ""),
  2650. e
  2651. },
  2652. tilegen: !1,
  2653. imgopt: !1
  2654. };
  2655. t.exports = s
  2656. }
  2657. ).call(this, "/js/ab.js")
  2658. }
  2659. , {
  2660. "./util/browser": 182,
  2661. "./util/logger": 189
  2662. }],
  2663. 4: [function(e, t, i) {
  2664. (function(i) {
  2665. "use strict";
  2666. function n() {
  2667. return {
  2668. addons: [{
  2669. name: "keen:ua_parser",
  2670. input: {
  2671. ua_string: "user_agent"
  2672. },
  2673. output: "parsed_user_agent"
  2674. }]
  2675. }
  2676. }
  2677. function r(e, t, i, n) {
  2678. function r(t) {
  2679. l[t.sid] = !0;
  2680. var i = t.billboard.media && t.billboard.media.type
  2681. , n = {
  2682. tag_id: t.sid,
  2683. tags_visited: Object.keys(l).length,
  2684. tag_count: Object.keys(e.tags).length,
  2685. tag_view_count: ++E,
  2686. has_media: !!i
  2687. };
  2688. i && (n.media_type = i),
  2689. u("tag_opened", n)
  2690. }
  2691. var l = {}
  2692. , h = Date.now() - N
  2693. , f = null;
  2694. n && (f = Date.now() - window.navigationStart);
  2695. var g;
  2696. try {
  2697. g = e.data.player_options.highlight_reel && e.heroLocations.length > 1
  2698. } catch (e) {
  2699. g = !1
  2700. }
  2701. var v, A = e.supportsVR;
  2702. A || (v = "VR disabled at the model/account level",
  2703. 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"))),
  2704. u("model_loaded", {
  2705. duration: h,
  2706. duration_from_navigation_start: f,
  2707. has_hlr: g,
  2708. has_vr: A,
  2709. vr_reason: v
  2710. });
  2711. var I = 0;
  2712. e.panos.forEach(function(e) {
  2713. e.on("enter", function() {
  2714. c("pano_viewed", {
  2715. pano_id: e.id,
  2716. pano_view_count: ++I,
  2717. alignment_type: e.alignmentType,
  2718. interaction_source: O,
  2719. navigation_source: p
  2720. })
  2721. })
  2722. });
  2723. var E = 0;
  2724. for (var T in e.tags)
  2725. e.tags[T].billboard.on(M.OPENED, r.bind(this, e.tags[T]));
  2726. t.on("tour_auto", function(e) {
  2727. p = "tour_" + e
  2728. }),
  2729. t.on("tour_manual", function(e) {
  2730. O = "gui-" + e,
  2731. p = "tour_manual"
  2732. }),
  2733. i.on(C.InteractionKey, function() {
  2734. t.mode === y.TRANSITIONING || t.flying || d(C.InteractionKey)
  2735. }),
  2736. i.on(C.InteractionDirect, function() {
  2737. t.mode === y.TRANSITIONING || t.flying || d(C.InteractionDirect)
  2738. }),
  2739. o(t),
  2740. a(),
  2741. s()
  2742. }
  2743. function o(e) {
  2744. I.on(T.OPENED, function() {
  2745. c("showcase_share_intent", {
  2746. pano_id: e.currentPano && e.currentPano.id
  2747. })
  2748. }),
  2749. I.on(T.LINK_CLICKED, function(t) {
  2750. c("showcase_share_action", {
  2751. channel: t.channel,
  2752. pano_id: e.currentPano && e.currentPano.id
  2753. })
  2754. }),
  2755. E.on(x.ORIGIN_LINK_CLICKED, function() {
  2756. c("showcase_share_origin_link_clicked")
  2757. })
  2758. }
  2759. function a() {}
  2760. function s() {
  2761. b.on(S.OPENED, c.bind(this, "showcase_gui", {
  2762. gui_action: "click_vr_button"
  2763. })),
  2764. b.on(S.LAUNCH, function(e) {
  2765. c("showcase_gui", {
  2766. gui_action: "launch_vr",
  2767. vr_platform: e.vr_platform,
  2768. vr_app: e.vr_app
  2769. })
  2770. }),
  2771. b.on(S.PREV, c.bind(this, "showcase_gui", {
  2772. gui_action: "vr_modal_prev"
  2773. })),
  2774. b.on(S.NEXT, function(e) {
  2775. c("showcase_gui", {
  2776. gui_action: e.nextAction
  2777. })
  2778. }),
  2779. b.on(S.CLOSED, c.bind(this, "showcase_gui", {
  2780. gui_action: "vr_modal_close"
  2781. })),
  2782. b.on(S.falseICECHOSEN, function(e) {
  2783. c("showcase_gui", {
  2784. gui_action: e.name + " "
  2785. })
  2786. }),
  2787. b.on(S.STORE, function(e) {
  2788. c("showcase_gui", {
  2789. gui_action: "launch_store",
  2790. store: e
  2791. })
  2792. })
  2793. }
  2794. function l(e, t) {
  2795. if (f)
  2796. try {
  2797. f.addEvent(e, v.extendObject({
  2798. host: window.location.host,
  2799. keen: n(),
  2800. user_agent: "${keen.user_agent}",
  2801. referrer: {
  2802. url: v.normalizeUrl(document.referrer),
  2803. domain: v.domainFromUrl(document.referrer),
  2804. url_original: document.referrer
  2805. },
  2806. embedded: m.inIframe(),
  2807. is_mobile: m.isMobile(),
  2808. version: "2.25.6-0-gd87e5b1"
  2809. }, t))
  2810. } catch (e) {
  2811. P.warn("analytics.report -> client.addEvent() error (is there blocking software installed?). Error message: " + e)
  2812. }
  2813. }
  2814. function c(e, t) {
  2815. if (t = t || {},
  2816. L)
  2817. try {
  2818. window.analytics.track(e, v.extendObject(t, B), {
  2819. context: {
  2820. app: {
  2821. name: "showcase",
  2822. version: "2.25.6-0-gd87e5b1"
  2823. },
  2824. screen: {
  2825. width: window.screen.width,
  2826. height: window.screen.height,
  2827. density: window.devicePixelRatio
  2828. }
  2829. }
  2830. })
  2831. } catch (t) {
  2832. console.warn("Failed to send data to segment for " + e)
  2833. }
  2834. }
  2835. function h(e, t) {
  2836. if (t = t || {},
  2837. navigator.sendBeacon && L)
  2838. try {
  2839. navigator.sendBeacon("https://api.segment.io/v1/t", JSON.stringify({
  2840. event: e,
  2841. anonymousId: window.analytics.user().anonymousId(),
  2842. properties: v.extendObject(t, B),
  2843. writeKey: L,
  2844. sentAt: Date.now(),
  2845. type: "track",
  2846. context: {
  2847. userAgent: m.userAgent(),
  2848. library: {
  2849. name: "showcase-beacon",
  2850. version: "2.25.6-0-gd87e5b1"
  2851. },
  2852. app: {
  2853. name: "showcase",
  2854. version: "2.25.6-0-gd87e5b1"
  2855. }
  2856. }
  2857. }))
  2858. } catch (e) {
  2859. console.warn("Failed to send async segment request")
  2860. }
  2861. }
  2862. function u(e, t) {
  2863. t = t || {},
  2864. c(e, t)
  2865. }
  2866. function d(e, t) {
  2867. O = e === C.InteractionGui ? "gui-" + t : e,
  2868. p = "self_guided"
  2869. }
  2870. var p, f, g = (e("three"),
  2871. e("./util/ajax"),
  2872. e("./ab")), m = e("./util/browser"), v = e("./util/common"), A = e("./settings"), y = (e("./localization/localize"),
  2873. 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"),
  2874. "direct"), L = null, D = !1, N = null, B = null, F = v.uuid4();
  2875. t.exports = {
  2876. report: function(e, t, i, n) {
  2877. l("Session starts", {
  2878. model: e,
  2879. status: t,
  2880. loadtime: Date.now() - (N || Date.now()),
  2881. loadtime_from_navigation_start: i ? Date.now() - window.navigationStart : null,
  2882. autoplay: i,
  2883. quickstart: n,
  2884. ab_tilegen: g.tilegen,
  2885. ab_imgopt: g.imgopt
  2886. })
  2887. },
  2888. impression: function(e) {
  2889. e = e || {};
  2890. var t = void 0 === e.isVisible || e.isVisible
  2891. , i = (void 0 !== e.immediate && e.immediate,
  2892. window.location.search.substr(1).split("&"));
  2893. u("impression", {
  2894. visible: t,
  2895. url_params: i
  2896. })
  2897. },
  2898. initKeen: function(e) {
  2899. return e.token && e.appId ? void (f = new Keen({
  2900. projectId: e.appId,
  2901. writeKey: e.token,
  2902. readKey: "",
  2903. requestType: "xhr"
  2904. })) : void P.warn("no keen token/appId")
  2905. },
  2906. initSegment: function(e) {
  2907. return e.token ? (L = e.token,
  2908. window.analytics.load(e.token),
  2909. B = {
  2910. model_id: e.model,
  2911. start_source: e.startSource,
  2912. autoplay: e.autoplay,
  2913. quickstart: e.quickstart,
  2914. language_tag: A.languageTag,
  2915. is_mobile: m.isMobile(),
  2916. iframe: m.inIframe(),
  2917. aspect_ratio: m.aspectRatio(),
  2918. session_id: F,
  2919. window: {
  2920. width: $("#player").width(),
  2921. height: $("#player").height()
  2922. },
  2923. platform: {
  2924. browser: {
  2925. name: $.ua.browser.name,
  2926. major: $.ua.browser.major,
  2927. version: $.ua.browser.version
  2928. },
  2929. os: {
  2930. name: $.ua.os.name,
  2931. version: $.ua.os.version
  2932. },
  2933. device: {
  2934. vendor: $.ua.device.vendor,
  2935. model: $.ua.device.model,
  2936. type: $.ua.device.type
  2937. }
  2938. }
  2939. },
  2940. D = Math.random() < A.analytics.sessionTrackingRate,
  2941. P.debug("tracking sample rate = " + A.analytics.sessionTrackingRate),
  2942. void P.debug("tracking this session = " + D)) : void P.warn("no segment token")
  2943. },
  2944. sessionStart: function(e) {
  2945. P.debug("analytics user_session_start"),
  2946. c("session_started"),
  2947. N = Date.now(),
  2948. window.addEventListener("unload", function() {
  2949. h("session_ended", {
  2950. duration: Date.now() - N
  2951. })
  2952. })
  2953. },
  2954. modelLoaded: function(e, t, i, n) {
  2955. r(e, t, i, n)
  2956. },
  2957. loadComplete: function(e) {
  2958. var t = {
  2959. time_to_app_start: e
  2960. };
  2961. c("load_times", t)
  2962. },
  2963. track: function(e, t) {
  2964. D && (P.debug('analytics.track("' + e + '", ' + JSON.stringify(t) + " )"),
  2965. c(e, t))
  2966. },
  2967. trackAlways: function(e, t) {
  2968. P.debug('analytics.trackAlways("' + e + '", ' + JSON.stringify(t) + " )"),
  2969. c(e, t)
  2970. },
  2971. getSessionId: function() {
  2972. return F
  2973. },
  2974. updateInteraction: d
  2975. }
  2976. }
  2977. ).call(this, "/js/analytics.js")
  2978. }
  2979. , {
  2980. "./ab": 3,
  2981. "./enum/ControlEvents": 21,
  2982. "./enum/PlayerEvents": 40,
  2983. "./enum/VROption": 47,
  2984. "./enum/VRPlatforms": 49,
  2985. "./enum/Viewmode": 51,
  2986. "./gui/sharing/ShareEvents": 76,
  2987. "./gui/sharing/modal": 77,
  2988. "./gui/title/TitleEvents": 80,
  2989. "./gui/title/titleBar": 82,
  2990. "./gui/vr/vrEvent": 85,
  2991. "./gui/vr/vrModal": 87,
  2992. "./localization/localize": 108,
  2993. "./tag/Billboard/BillboardEvent": 120,
  2994. "./settings": 166,
  2995. "./util/ajax": 181,
  2996. "./util/browser": 182,
  2997. "./util/common": 185,
  2998. "./util/logger": 189,
  2999. three: 217
  3000. }],
  3001. 5: [function(e, t, i) {
  3002. "use strict";
  3003. function n() {
  3004. r.PerspectiveCamera.call(this, a.clampVFOV(o.dollhouseFOV), $("#player").width() / $("#player").height(), o.dollhouseNear, o.dollhouseFar),
  3005. this.controls = null
  3006. }
  3007. var r = e("three")
  3008. , o = e("../constants")
  3009. , a = e("../util/cameraLight");
  3010. n.prototype = Object.create(r.PerspectiveCamera.prototype),
  3011. n.prototype.updateAspect = function(e) {
  3012. this.aspect = e,
  3013. this.updateProjectionMatrix()
  3014. }
  3015. ,
  3016. t.exports = n
  3017. }
  3018. , {
  3019. "../constants": 8,
  3020. "../util/cameraLight": 184,
  3021. three: 217
  3022. }],
  3023. 6: [function(e, t, i) {
  3024. "use strict";
  3025. function n() {
  3026. var e = $("#player").width() / $("#player").height();
  3027. r.OrthographicCamera.call(this, -o.orthoBase, o.orthoBase, o.orthoBase / e, -o.orthoBase / e, o.orthoNear, o.orthoFar),
  3028. this.controls = null,
  3029. this.updateAspect(e)
  3030. }
  3031. var r = e("three")
  3032. , o = e("../constants");
  3033. n.prototype = Object.create(r.OrthographicCamera.prototype),
  3034. n.prototype.updateAspect = function(e) {
  3035. this.aspect = e,
  3036. this.top = o.orthoBase / e,
  3037. this.bottom = -o.orthoBase / e,
  3038. this.updateProjectionMatrix()
  3039. }
  3040. ,
  3041. t.exports = n
  3042. }
  3043. , {
  3044. "../constants": 8,
  3045. three: 217
  3046. }],
  3047. 7: [function(e, t, i) {
  3048. "use strict";
  3049. function n() {
  3050. r.PerspectiveCamera.call(this, a.clampVFOV(o.insideFOV), $("#player").width() / $("#player").height(), o.insideNear, o.insideFar),
  3051. this.controls = null
  3052. }
  3053. var r = e("three")
  3054. , o = e("../settings")
  3055. , a = e("../util/cameraLight");
  3056. n.prototype = Object.create(r.PerspectiveCamera.prototype),
  3057. n.prototype.updateAspect = function(e) {
  3058. this.aspect = e,
  3059. this.updateProjectionMatrix()
  3060. }
  3061. ,
  3062. t.exports = n
  3063. }
  3064. , {
  3065. "../settings": 166,
  3066. "../util/cameraLight": 184,
  3067. three: 217
  3068. }],
  3069. 8: [function(e, t, i) {
  3070. "use strict";
  3071. t.exports = {
  3072. signedUrlDefaultExpireTime: 24e4,
  3073. signedUrlCheckInterval: 1e4,
  3074. signedUrlRefreshBuffer: 15e3,
  3075. dollhouseFOV: 70,
  3076. dollhouseNear: 1,
  3077. dollhouseFar: 5e3,
  3078. insideFOV: 70,
  3079. insideFOVMax: 120,
  3080. insideNear: .1,
  3081. insideFar: 5e3,
  3082. insideLookSpeed: .12,
  3083. insideLookLimitUp: 40,
  3084. insideLookLimitDown: -40,
  3085. orthoNear: 1,
  3086. orthoFar: 5e3,
  3087. orthoBase: 10,
  3088. narrowLandscapeHeight: 290,
  3089. reallyNarrowLandscapeHeight: 250,
  3090. visionTilingStartDate: new Date("8/26/2016"),
  3091. visionTilingStartVersion: "1.1.407.13667",
  3092. windowHeightHighQualityThreshold: 900,
  3093. tourStepDelayDefault: 3500,
  3094. tourStepDelaySlideShow: 5e3,
  3095. workshopApsect: 9 / 16,
  3096. highQualityMaxZoom: 2,
  3097. ultraHighQualityMaxZoom: 3
  3098. }
  3099. }
  3100. , {}],
  3101. 9: [function(e, t, i) {
  3102. "use strict";
  3103. function n() {
  3104. this.activeControl = null,
  3105. this.controls = {},
  3106. this.cameras = {}
  3107. }
  3108. var r = e("./PanoramaControls")
  3109. , o = e("./DollhouseControls")
  3110. , a = e("./FloorplanControls")
  3111. , s = e("../cameras/PanoramaCamera")
  3112. , l = e("../cameras/DollhouseCamera")
  3113. , c = e("../cameras/FloorplanCamera")
  3114. , h = e("events").EventEmitter
  3115. , u = e("../enum/ControlEvents")
  3116. , d = e("../enum/ModelManagerEvents")
  3117. , p = e("../enum/Viewmode")
  3118. , f = e("../settings");
  3119. n.prototype = Object.create(h.prototype),
  3120. n.prototype.init = function(e, t) {
  3121. this.setUpControls(),
  3122. this.bindEvents(e, t)
  3123. }
  3124. ,
  3125. n.prototype.activateControls = function(e) {
  3126. this.activeControl && (this.activeControl.reset(),
  3127. this.activeControl.enabled = !1),
  3128. this.controls[e] && (this.controls[e].enabled = !0),
  3129. this.activeControl = this.controls[e]
  3130. }
  3131. ,
  3132. n.prototype.setUpControls = function() {
  3133. var e = {}
  3134. , t = {}
  3135. , i = [p.PANORAMA, p.DOLLHOUSE, p.FLOORPLAN]
  3136. , n = [s, l, c]
  3137. , h = [r, o, a];
  3138. i.forEach(function(i, r) {
  3139. e[i] = new n[r],
  3140. t[i] = new h[r](e[i]),
  3141. t[i].on(u.Move, this.emit.bind(this, u.Move)),
  3142. t[i].on(u.InputStart, this.emit.bind(this, u.InputStart)),
  3143. t[i].on(u.InteractionDirect, this.emit.bind(this, u.InteractionDirect)),
  3144. t[i].on(u.InteractionKey, this.emit.bind(this, u.InteractionKey)),
  3145. t[i].on(u.Pinch, this.emit.bind(this, u.Pinch)),
  3146. t[i].on(u.Scroll, this.emit.bind(this, u.Scroll))
  3147. }
  3148. .bind(this)),
  3149. this.controls = t,
  3150. this.cameras = e
  3151. }
  3152. ,
  3153. n.prototype.bindEvents = function(e, t) {
  3154. e.addEventListener("mousemove", this.onMouseMove.bind(this)),
  3155. e.addEventListener("mousedown", this.onMouseDown.bind(this)),
  3156. e.addEventListener("mouseup", this.onMouseUp.bind(this)),
  3157. e.addEventListener("mouseover", this.onMouseOver.bind(this)),
  3158. f.useWheel && (e.addEventListener("mousewheel", this.onMouseWheel.bind(this)),
  3159. e.addEventListener("DOMMouseScroll", this.onMouseWheel.bind(this))),
  3160. e.addEventListener("touchstart", this.onTouchStart.bind(this)),
  3161. e.addEventListener("touchmove", this.onTouchMove.bind(this)),
  3162. e.addEventListener("touchend", this.onTouchEnd.bind(this)),
  3163. e.addEventListener("contextmenu", function(e) {
  3164. e.preventDefault()
  3165. }),
  3166. e.addEventListener("pointerdown", this.onPointerDown.bind(this)),
  3167. e.addEventListener("pointermove", this.onPointerMove.bind(this)),
  3168. e.addEventListener("pointerup", this.onPointerUp.bind(this)),
  3169. e.addEventListener("pointerout", this.onPointerCancel.bind(this)),
  3170. e.addEventListener("pointercancel", this.onPointerCancel.bind(this)),
  3171. document.addEventListener("keydown", this.onKeyDown.bind(this)),
  3172. document.addEventListener("keyup", this.onKeyUp.bind(this)),
  3173. t.on(d.ActiveModelChanged, function(e) {
  3174. this.setModelForControls(e.model)
  3175. }
  3176. .bind(this))
  3177. }
  3178. ,
  3179. n.prototype.setModelForControls = function(e) {
  3180. this.controls[p.DOLLHOUSE].setZoomBounds(e.boundingBox);
  3181. var t = e.boundingBox.clone().expandByScalar(f.modelBoundsPadding);
  3182. [p.DOLLHOUSE, p.FLOORPLAN].forEach(function(e) {
  3183. this.controls[e].setBounds(t)
  3184. }
  3185. .bind(this))
  3186. }
  3187. ,
  3188. n.prototype.onMouseDown = function(e) {
  3189. e.preventDefault(),
  3190. this.activeControl && this.activeControl.onMouseDown(e)
  3191. }
  3192. ,
  3193. n.prototype.onMouseMove = function(e) {
  3194. e.preventDefault(),
  3195. this.activeControl && this.activeControl.onMouseMove(e)
  3196. }
  3197. ,
  3198. n.prototype.onMouseUp = function(e) {
  3199. e.preventDefault(),
  3200. this.activeControl && this.activeControl.onMouseUp(e)
  3201. }
  3202. ,
  3203. n.prototype.onMouseOver = function(e) {
  3204. e.preventDefault(),
  3205. this.activeControl && this.activeControl.onMouseOver(e)
  3206. }
  3207. ,
  3208. n.prototype.onMouseWheel = function(e) {
  3209. e.preventDefault(),
  3210. this.activeControl && this.activeControl.onMouseWheel(e)
  3211. }
  3212. ,
  3213. n.prototype.onTouchStart = function(e) {
  3214. e.preventDefault(),
  3215. this.activeControl && this.activeControl.onTouchStart(e)
  3216. }
  3217. ,
  3218. n.prototype.onTouchMove = function(e) {
  3219. e.preventDefault(),
  3220. this.activeControl && this.activeControl.onTouchMove(e)
  3221. }
  3222. ,
  3223. n.prototype.onTouchEnd = function(e) {
  3224. e.preventDefault(),
  3225. this.activeControl && this.activeControl.onTouchEnd(e)
  3226. }
  3227. ,
  3228. n.prototype.onPointerDown = function(e) {
  3229. if (e.preventDefault(),
  3230. this.activeControl)
  3231. switch (e.pointerType) {
  3232. case "mouse":
  3233. this.activeControl.onMouseDown(e);
  3234. break;
  3235. default:
  3236. this.activeControl.onPointerDown(e)
  3237. }
  3238. }
  3239. ,
  3240. n.prototype.onPointerMove = function(e) {
  3241. if (e.preventDefault(),
  3242. this.activeControl)
  3243. switch (e.pointerType) {
  3244. case "mouse":
  3245. this.activeControl.onMouseMove(e);
  3246. break;
  3247. default:
  3248. this.activeControl.onPointerMove(e)
  3249. }
  3250. }
  3251. ,
  3252. n.prototype.onPointerUp = function(e) {
  3253. if (e.preventDefault(),
  3254. this.activeControl)
  3255. switch (e.pointerType) {
  3256. case "mouse":
  3257. this.activeControl.onMouseUp(e);
  3258. break;
  3259. default:
  3260. this.activeControl.onPointerUp(e)
  3261. }
  3262. }
  3263. ,
  3264. n.prototype.onPointerCancel = function(e) {
  3265. e.preventDefault(),
  3266. this.activeControl && "mouse" !== e.pointerType && this.activeControl.onPointerUp(e)
  3267. }
  3268. ,
  3269. n.prototype.onKeyDown = function(e) {
  3270. e.metaKey || e.ctrlKey || (e.preventDefault(),
  3271. this.activeControl && this.activeControl.onKeyDown(e))
  3272. }
  3273. ,
  3274. n.prototype.onKeyUp = function(e) {
  3275. e.preventDefault(),
  3276. this.activeControl && this.activeControl.onKeyUp(e)
  3277. }
  3278. ,
  3279. t.exports = n
  3280. }
  3281. , {
  3282. "../cameras/DollhouseCamera": 5,
  3283. "../cameras/FloorplanCamera": 6,
  3284. "../cameras/PanoramaCamera": 7,
  3285. "../enum/ControlEvents": 21,
  3286. "../enum/ModelManagerEvents": 33,
  3287. "../enum/Viewmode": 51,
  3288. "../settings": 166,
  3289. "./DollhouseControls": 10,
  3290. "./FloorplanControls": 11,
  3291. "./PanoramaControls": 13,
  3292. events: 202
  3293. }],
  3294. 10: [function(e, t, i) {
  3295. "use strict";
  3296. function n(e) {
  3297. a.call(this, e),
  3298. this.minPolarAngle = o.dollhouseDefault.minPolarAngle,
  3299. this.maxPolarAngle = o.dollhouseDefault.maxPolarAngle,
  3300. this.minDistance = o.dollhouseDefault.minDistance,
  3301. this.maxDistance = o.dollhouseDefault.maxDistance,
  3302. this.adjustedMinDistance = this.minDistance,
  3303. this.adjustedMaxDistance = this.maxDistance
  3304. }
  3305. var r = e("three")
  3306. , o = e("../settings")
  3307. , a = e("./OutsideControls");
  3308. n.prototype = Object.create(a.prototype),
  3309. n.prototype.pan = function(e, t) {
  3310. this.camera.updateMatrix();
  3311. var i = this.camera.position.clone().sub(this.target).length();
  3312. i *= Math.tan(this.camera.fov / 2 * Math.PI / 180),
  3313. this.panLeft(2 * e * i / $("#player").height()),
  3314. this.panUp(-2 * t * i / $("#player").height())
  3315. }
  3316. ,
  3317. n.prototype.updateZoom = function() {
  3318. var e = this.offset.length();
  3319. return e * this.scale
  3320. }
  3321. ,
  3322. n.prototype.setZoomBounds = function(e) {
  3323. var t = e.min.distanceTo(e.max);
  3324. this.adjustedMinDistance = Math.max(Math.min(t / 2, o.dollhouseDefault.minDistance), 0),
  3325. this.adjustedMaxDistance = Math.min(Math.max(t, o.dollhouseDefault.maxDistance), o.skyboxRadius),
  3326. this.minDistance = this.adjustedMinDistance,
  3327. this.maxDistance = this.adjustedMaxDistance
  3328. }
  3329. ,
  3330. n.prototype.resetRanges = function(e, t) {
  3331. e ? (this.minDistance = Math.min(e, this.minDistance),
  3332. this.maxDistance = Math.max(e, this.maxDistance)) : (this.minDistance = this.adjustedMinDistance,
  3333. this.maxDistance = this.adjustedMaxDistance),
  3334. t ? (this.minPolarAngle = r.Math.degToRad(-15),
  3335. this.maxPolarAngle = r.Math.degToRad(89.9)) : (this.minPolarAngle = o.dollhouseDefault.minPolarAngle,
  3336. this.maxPolarAngle = o.dollhouseDefault.maxPolarAngle)
  3337. }
  3338. ,
  3339. n.prototype.toJSON = function() {
  3340. return a.prototype.toJSON.call(this)
  3341. }
  3342. ,
  3343. t.exports = n
  3344. }
  3345. , {
  3346. "../settings": 166,
  3347. "./OutsideControls": 12,
  3348. three: 217
  3349. }],
  3350. 11: [function(e, t, i) {
  3351. "use strict";
  3352. function n(e) {
  3353. a.call(this, e),
  3354. this.minDistance = 15,
  3355. this.maxDistance = 50,
  3356. this.noRotateUpDown = !0,
  3357. this.minPolarAngle = 0,
  3358. this.maxPolarAngle = 0,
  3359. this.mouseActions[l.LEFT] = s.PAN,
  3360. this.mouseActions[l.MIDDLE] = s.DOLLY,
  3361. this.mouseActions[l.RIGHT] = s.ROTATE,
  3362. this.touchActions[1] = s.PAN,
  3363. this.touchActions[2] = s.ROTATE_DOLLY,
  3364. this.absoluteScale = 1,
  3365. this.currentScale = 1
  3366. }
  3367. var r = e("three")
  3368. , o = e("../settings")
  3369. , a = e("./OutsideControls")
  3370. , s = e("../enum/ControlActions")
  3371. , l = e("../enum/MouseButton")
  3372. , c = e("../util/math")
  3373. , h = e("../util/browser");
  3374. n.prototype = Object.create(a.prototype),
  3375. n.prototype.zoomToContain = function(e) {
  3376. var t = Math.max(e.x, e.z)
  3377. , i = Math.min(e.x, e.z)
  3378. , n = Math.max(t, i * this.camera.aspect)
  3379. , r = Math.max(i, t * this.camera.aspect);
  3380. this.absoluteScale = (h.aspectRatio() < 1 ? r : n) / 2 / o.orthoBase * 1.2,
  3381. this.currentScale = this.absoluteScale
  3382. }
  3383. ,
  3384. n.prototype.rotateToView = function(e, t) {
  3385. var i = 0
  3386. , n = h.aspectRatio() < 1
  3387. , r = e.x < e.z;
  3388. n === r ? t.z > 0 && (i = Math.PI) : i = t.x > 0 ? Math.PI / 2 : -Math.PI / 2,
  3389. this.rotateLeft(i),
  3390. this.update(0)
  3391. }
  3392. ,
  3393. n.prototype.pan = function(e, t) {
  3394. this.camera.updateMatrix(),
  3395. this.panLeft(e * (this.camera.right - this.camera.left) / $("#player").width()),
  3396. this.panUp(-t * (this.camera.top - this.camera.bottom) / $("#player").height())
  3397. }
  3398. ,
  3399. n.prototype.updateZoom = function() {
  3400. return this.absoluteScale *= this.scale - .03 * this.keyboardZoomSpeed,
  3401. this.absoluteScale = Math.max(o.zoomNearLimit, Math.min(this.absoluteScale, o.zoomFarLimit)),
  3402. this.currentScale = .8 * this.currentScale + .2 * this.absoluteScale,
  3403. this.camera.left = -o.orthoBase * this.currentScale,
  3404. this.camera.right = o.orthoBase * this.currentScale,
  3405. this.camera.top = o.orthoBase * this.currentScale / this.camera.aspect,
  3406. this.camera.bottom = -o.orthoBase * this.currentScale / this.camera.aspect,
  3407. this.camera.updateProjectionMatrix(),
  3408. this.offset.length()
  3409. }
  3410. ,
  3411. n.prototype.toJSON = function() {
  3412. var e = new r.Quaternion
  3413. , t = (new r.Quaternion).setFromAxisAngle(new r.Vector3(0,1,0), r.Math.degToRad(90))
  3414. , i = new r.Quaternion;
  3415. return function() {
  3416. var n = a.prototype.toJSON.call(this);
  3417. return e.copy(n.camera_quaternion),
  3418. i.copy(t),
  3419. i.multiply(e),
  3420. n.camera_quaternion.x = c.toPrecision(i.x, 4),
  3421. n.camera_quaternion.y = c.toPrecision(i.y, 4),
  3422. n.camera_quaternion.z = c.toPrecision(i.z, 4),
  3423. n.camera_quaternion.w = c.toPrecision(i.w, 4),
  3424. n.ortho_zoom = c.toPrecision(this.currentScale * this.camera.aspect, 4),
  3425. n
  3426. }
  3427. }(),
  3428. t.exports = n
  3429. }
  3430. , {
  3431. "../enum/ControlActions": 20,
  3432. "../enum/MouseButton": 34,
  3433. "../settings": 166,
  3434. "../util/browser": 182,
  3435. "../util/math": 190,
  3436. "./OutsideControls": 12,
  3437. three: 217
  3438. }],
  3439. 12: [function(e, t, i) {
  3440. "use strict";
  3441. function n(e) {
  3442. this.camera = e,
  3443. this.camera.controls = this,
  3444. this.enabled = !1,
  3445. this.target = new r.Vector3,
  3446. this.targetBounds = new r.Box3,
  3447. this.zoomSpeed = 1,
  3448. this.minDistance = 0,
  3449. this.maxDistance = 1 / 0,
  3450. this.noRotateUpDown = !1,
  3451. this.rotateSpeed = 1,
  3452. this.keyboardZoomSpeed = 0,
  3453. this.keyPanSpeed = 7,
  3454. this.autoRotate = !1,
  3455. this.autoRotateSpeed = 2,
  3456. this.autoPan = !1,
  3457. this.autoPanPosition = new r.Vector3,
  3458. this.minPolarAngle = r.Math.degToRad(25),
  3459. this.maxPolarAngle = r.Math.degToRad(65),
  3460. this.rotationAcceleration = new r.Vector2,
  3461. this.rotationSpeed = new r.Vector2,
  3462. this.panAcceleration = new r.Vector2,
  3463. this.panSpeed = new r.Vector2,
  3464. this.rotateStart = new r.Vector2,
  3465. this.rotateEnd = new r.Vector2,
  3466. this.rotateDelta = new r.Vector2,
  3467. this.panStart = new r.Vector2,
  3468. this.panEnd = new r.Vector2,
  3469. this.panDelta = new r.Vector2,
  3470. this.panOffset = new r.Vector3,
  3471. this.offset = new r.Vector3,
  3472. this.dollyStart = new r.Vector2,
  3473. this.dollyEnd = new r.Vector2,
  3474. this.dollyDelta = new r.Vector2,
  3475. this.phiDelta = 0,
  3476. this.thetaDelta = 0,
  3477. this.scale = 1,
  3478. this.panVector = new r.Vector3,
  3479. this.lastPosition = new r.Vector3,
  3480. this.state = c.NONE,
  3481. this.mouseActions = {},
  3482. this.mouseActions[h.LEFT] = c.ROTATE,
  3483. this.mouseActions[h.MIDDLE] = c.DOLLY,
  3484. this.mouseActions[h.RIGHT] = c.PAN,
  3485. this.touchActions = {},
  3486. this.touchActions[1] = c.ROTATE,
  3487. this.touchActions[2] = c.PAN_DOLLY,
  3488. this.lastMoveTime = 0,
  3489. this.pointersLimit = 2,
  3490. this.pointers = []
  3491. }
  3492. var r = e("three")
  3493. , o = e("../settings")
  3494. , a = e("../util/common")
  3495. , s = e("../util/math")
  3496. , l = e("../enum/Vectors")
  3497. , c = e("../enum/ControlActions")
  3498. , h = e("../enum/MouseButton")
  3499. , u = e("../enum/Keys")
  3500. , d = e("../enum/ControlEvents")
  3501. , p = e("events").EventEmitter
  3502. , f = 1e-6;
  3503. n.prototype = Object.create(p.prototype),
  3504. n.prototype.setBounds = function(e) {
  3505. this.targetBounds = e
  3506. }
  3507. ,
  3508. n.prototype.isEngaged = function() {
  3509. return this.state !== c.NONE
  3510. }
  3511. ,
  3512. n.prototype.rotateLeft = function(e) {
  3513. void 0 === e && (e = this.getAutoRotationAngle()),
  3514. this.thetaDelta -= e
  3515. }
  3516. ,
  3517. n.prototype.rotateUp = function(e) {
  3518. this.noRotateUpDown || (void 0 === e && (e = this.getAutoRotationAngle()),
  3519. this.phiDelta -= e)
  3520. }
  3521. ,
  3522. n.prototype.panLeft = function(e) {
  3523. var t = this.camera.matrix.elements;
  3524. this.panOffset.set(t[0], 0, t[2]).normalize(),
  3525. this.panOffset.multiplyScalar(-e),
  3526. this.panVector.add(this.panOffset)
  3527. }
  3528. ,
  3529. n.prototype.panUp = function(e) {
  3530. var t = this.camera.matrix.elements;
  3531. this.panOffset.set(t[4], 0, t[6]).normalize(),
  3532. this.panOffset.multiplyScalar(-e),
  3533. this.panVector.add(this.panOffset)
  3534. }
  3535. ,
  3536. n.prototype.startRotating = function(e, t) {
  3537. e && this.navRotationAcc("x", e),
  3538. t && this.navRotationAcc("y", t)
  3539. }
  3540. ,
  3541. n.prototype.stopRotating = function(e) {
  3542. e && (this.rotationSpeed.x = this.rotationSpeed.y = 0),
  3543. this.navRotationAcc("x", 0),
  3544. this.navRotationAcc("y", 0)
  3545. }
  3546. ,
  3547. n.prototype.setAutoPanPosition = function(e, t) {
  3548. var i = new r.Vector3
  3549. , n = new r.Vector3;
  3550. return function(e, t) {
  3551. i.copy(this.camera.position),
  3552. void 0 === e && null === e || i.setX(e),
  3553. void 0 === t && null === t || i.setZ(t);
  3554. var r = this.camera.position.distanceTo(this.target)
  3555. , o = l.FORWARD.clone().applyQuaternion(this.camera.quaternion);
  3556. this.targetClamped = !1,
  3557. n.copy(i).addScaledVector(o, r),
  3558. this.targetBounds.containsPoint(n) || (this.targetBounds.clampPoint(n, n),
  3559. i.copy(n).addScaledVector(o, -r),
  3560. this.targetClamped = !0),
  3561. this.autoPanPosition.x = i.x,
  3562. this.autoPanPosition.z = i.z,
  3563. this.autoPan && this.stopAutoPanning()
  3564. }
  3565. }(),
  3566. n.prototype.stopAutoPanning = function() {
  3567. var e = this.autoPan;
  3568. this.autoPan = !1,
  3569. this.emit(this.targetClamped ? d.AutoPanClamped : e ? d.AutoPanInterrupt : d.AutoPanComplete)
  3570. }
  3571. ,
  3572. n.prototype.dollyIn = function(e) {
  3573. void 0 === e && (e = this.getZoomScale()),
  3574. this.scale /= e
  3575. }
  3576. ,
  3577. n.prototype.dollyOut = function(e) {
  3578. void 0 === e && (e = this.getZoomScale()),
  3579. this.scale *= e
  3580. }
  3581. ,
  3582. n.prototype.updatePan = function(e) {
  3583. if (this.panSpeed.multiplyScalar(1 - o.panFriction).addScaledVector(this.panAcceleration, o.panAccelerationOutside * e),
  3584. this.pan(-this.panSpeed.x, this.panSpeed.y),
  3585. this.autoPan) {
  3586. var t = (new r.Vector3).copy(this.autoPanPosition).sub(this.camera.position);
  3587. t.setY(0).clampLength(0, 50 * e),
  3588. this.target.add(t),
  3589. this.camera.position.add(t),
  3590. this.autoPanPosition.x === this.camera.position.x && this.autoPanPosition.z === this.camera.position.z && (this.autoPan = !1,
  3591. this.stopAutoPanning())
  3592. }
  3593. }
  3594. ,
  3595. n.prototype.update = function(e) {
  3596. e || (e = 1 / 60),
  3597. this.rotationSpeed.multiplyScalar(1 - o.rotationFriction).addScaledVector(this.rotationAcceleration, o.rotationAccelerationOutside * e),
  3598. this.rotateLeft(-this.rotationSpeed.x),
  3599. this.noRotateUpDown || this.rotateUp(this.rotationSpeed.y),
  3600. this.updatePan(e);
  3601. var t = this.camera.position;
  3602. this.offset.copy(t).sub(this.target);
  3603. var i = Math.atan2(this.offset.x, this.offset.z)
  3604. , n = Math.atan2(Math.sqrt(this.offset.x * this.offset.x + this.offset.z * this.offset.z), this.offset.y);
  3605. this.autoRotate && this.rotateLeft(this.getAutoRotationAngle()),
  3606. i += this.thetaDelta,
  3607. n += this.phiDelta,
  3608. n = Math.max(this.minPolarAngle, Math.min(this.maxPolarAngle, n)),
  3609. n = Math.max(f, Math.min(Math.PI - f, n));
  3610. var r = this.updateZoom();
  3611. r = Math.max(this.minDistance, Math.min(this.maxDistance, r)),
  3612. this.target.add(this.panVector),
  3613. this.targetBounds.clampPoint(this.target, this.target),
  3614. this.offset.x = r * Math.sin(n) * Math.sin(i),
  3615. this.offset.y = r * Math.cos(n),
  3616. this.offset.z = r * Math.sin(n) * Math.cos(i),
  3617. t.copy(this.target).add(this.offset),
  3618. this.camera.lookAt(this.target),
  3619. this.thetaDelta = 0,
  3620. this.phiDelta = 0,
  3621. this.scale = 1,
  3622. this.panVector.set(0, 0, 0),
  3623. this.lastPosition.distanceTo(this.camera.position) > 0 && this.lastPosition.copy(this.camera.position)
  3624. }
  3625. ,
  3626. n.prototype.getAutoRotationAngle = function() {
  3627. return 2 * Math.PI / 60 / 60 * this.autoRotateSpeed
  3628. }
  3629. ,
  3630. n.prototype.getZoomScale = function() {
  3631. return Math.pow(.95, this.zoomSpeed)
  3632. }
  3633. ,
  3634. n.prototype.onMouseDown = function(e) {
  3635. if (this.enabled) {
  3636. switch (e.preventDefault(),
  3637. this.stopAutoPanning(),
  3638. this.mouseDown = !0,
  3639. this.state = this.mouseActions[e.button],
  3640. this.state) {
  3641. case c.ROTATE:
  3642. this.rotateStart.set(e.clientX, this.noRotateUpDown ? 0 : e.clientY),
  3643. this.rotationSpeed.set(0, 0);
  3644. break;
  3645. case c.DOLLY:
  3646. this.dollyStart.set(e.clientX, e.clientY);
  3647. break;
  3648. case c.PAN:
  3649. this.panStart.set(e.clientX, e.clientY)
  3650. }
  3651. this.emit(d.InputStart, "mouse")
  3652. }
  3653. }
  3654. ,
  3655. n.prototype.onMouseMove = function(e) {
  3656. if (this.enabled && this.mouseDown && 0 !== e.buttons) {
  3657. switch (e.preventDefault(),
  3658. this.state) {
  3659. case c.ROTATE:
  3660. this.rotateEnd.set(e.clientX, this.noRotateUpDown ? 0 : e.clientY),
  3661. this.rotateDelta.subVectors(this.rotateEnd, this.rotateStart),
  3662. this.rotateLeft(2 * Math.PI * this.rotateDelta.x / $("#player").width() * this.rotateSpeed),
  3663. this.rotateUp(2 * Math.PI * this.rotateDelta.y / $("#player").height() * this.rotateSpeed),
  3664. this.rotateStart.copy(this.rotateEnd);
  3665. break;
  3666. case c.DOLLY:
  3667. this.dollyEnd.set(e.clientX, e.clientY),
  3668. this.dollyDelta.subVectors(this.dollyEnd, this.dollyStart);
  3669. var t = this.dollyDelta.y > 0 ? this.dollyIn : this.dollyOut;
  3670. t.call(this),
  3671. this.dollyStart.copy(this.dollyEnd);
  3672. break;
  3673. case c.PAN:
  3674. this.panEnd.set(e.clientX, e.clientY),
  3675. this.panDelta.subVectors(this.panEnd, this.panStart),
  3676. this.pan(this.panDelta.x, this.panDelta.y),
  3677. this.panStart.copy(this.panEnd)
  3678. }
  3679. this.emit(d.Move, "mouse"),
  3680. this.lastMoveTime = e.timeStamp,
  3681. this.update()
  3682. }
  3683. }
  3684. ,
  3685. n.prototype.onMouseUp = function(e) {
  3686. this.enabled && (this.mouseDown = !1,
  3687. this.state = c.NONE,
  3688. "mouseover" !== e.type && (e.timeStamp > this.lastMoveTime + 100 ? (this.rotationSpeed.set(0, 0),
  3689. this.rotationAcceleration.set(0, 0)) : this.rotationAcceleration.set(-this.rotateDelta.x, this.rotateDelta.y),
  3690. this.update(),
  3691. this.rotationAcceleration.set(0, 0),
  3692. this.rotateDelta.set(0, 0)))
  3693. }
  3694. ,
  3695. n.prototype.onMouseOver = function(e) {
  3696. 0 !== e.which && 0 !== e.buttons || this.onMouseUp(e)
  3697. }
  3698. ,
  3699. n.prototype.onMouseWheel = function(e) {
  3700. if (this.enabled && o.useWheel) {
  3701. this.emit(d.Move, "wheel");
  3702. var t = e.wheelDelta || -e.detail
  3703. , i = t > 0 ? this.dollyOut : this.dollyIn;
  3704. i.call(this),
  3705. this.update()
  3706. }
  3707. }
  3708. ,
  3709. n.prototype.onKeyDown = function(e) {
  3710. this.enabled && (e.metaKey || e.ctrlKey || (e.preventDefault(),
  3711. this.handleKeyDown(e.which)))
  3712. }
  3713. ,
  3714. n.prototype.navRotationAcc = function(e, t) {
  3715. "y" === e ? this.noRotateUpDown ? this.keyboardZoomSpeed = t : this.rotationAcceleration.y = t : this.rotationAcceleration.x = t
  3716. }
  3717. ,
  3718. n.prototype.navPanAcc = function(e, t) {
  3719. this.stopAutoPanning(),
  3720. this.panAcceleration[e] = t
  3721. }
  3722. ,
  3723. n.prototype.handleKeyDown = function(e) {
  3724. var t = !0;
  3725. switch (e) {
  3726. case u.UPARROW:
  3727. case u.I:
  3728. this.navRotationAcc("y", 1);
  3729. break;
  3730. case u.DOWNARROW:
  3731. case u.K:
  3732. this.navRotationAcc("y", -1);
  3733. break;
  3734. case u.LEFTARROW:
  3735. case u.J:
  3736. this.navRotationAcc("x", -1);
  3737. break;
  3738. case u.RIGHTARROW:
  3739. case u.L:
  3740. this.navRotationAcc("x", 1);
  3741. break;
  3742. case u.W:
  3743. this.navPanAcc("y", 1);
  3744. break;
  3745. case u.S:
  3746. this.navPanAcc("y", -1);
  3747. break;
  3748. case u.A:
  3749. this.navPanAcc("x", -1);
  3750. break;
  3751. case u.D:
  3752. this.navPanAcc("x", 1);
  3753. break;
  3754. default:
  3755. t = !1
  3756. }
  3757. t && this.emit(d.Move, "key")
  3758. }
  3759. ,
  3760. n.prototype.onKeyUp = function(e) {
  3761. this.enabled && (e.preventDefault(),
  3762. e.stopPropagation(),
  3763. this.handleKeyUp(e.which))
  3764. }
  3765. ,
  3766. n.prototype.handleKeyUp = function(e) {
  3767. switch (e) {
  3768. case u.I:
  3769. case u.K:
  3770. case u.UPARROW:
  3771. case u.DOWNARROW:
  3772. this.keyboardZoomSpeed = 0,
  3773. this.rotationAcceleration.y = 0;
  3774. break;
  3775. case u.J:
  3776. case u.L:
  3777. case u.LEFTARROW:
  3778. case u.RIGHTARROW:
  3779. this.rotationAcceleration.x = 0;
  3780. break;
  3781. case u.S:
  3782. case u.W:
  3783. this.panAcceleration.y = 0;
  3784. break;
  3785. case u.A:
  3786. case u.D:
  3787. this.panAcceleration.x = 0
  3788. }
  3789. }
  3790. ,
  3791. n.prototype.onTouchStart = function(e) {
  3792. if (this.enabled || this.state === c.NONE) {
  3793. e.preventDefault(),
  3794. e.stopPropagation(),
  3795. this.stopAutoPanning();
  3796. var t = function() {
  3797. if (2 === e.touches.length) {
  3798. var t = e.touches[0].pageX - e.touches[1].pageX
  3799. , i = e.touches[0].pageY - e.touches[1].pageY;
  3800. this.dollyStart.set(t, i)
  3801. }
  3802. }
  3803. .bind(this)
  3804. , i = function() {
  3805. this.panStart.set(a.average(e.touches, "pageX"), a.average(e.touches, "pageY"))
  3806. }
  3807. .bind(this)
  3808. , n = function() {
  3809. this.rotateStart.set(a.average(e.touches, "pageX"), a.average(e.touches, "pageY"))
  3810. }
  3811. .bind(this);
  3812. switch (this.state = this.touchActions[e.touches.length],
  3813. this.state) {
  3814. case c.PAN_DOLLY:
  3815. t();
  3816. case c.PAN:
  3817. i();
  3818. break;
  3819. case c.ROTATE_DOLLY:
  3820. t();
  3821. case c.ROTATE:
  3822. n()
  3823. }
  3824. this.rotationSpeed.set(0, 0),
  3825. this.emit(d.InputStart, "touch")
  3826. }
  3827. }
  3828. ,
  3829. n.prototype.onTouchMove = function(e) {
  3830. if (this.enabled && this.state !== c.NONE) {
  3831. e.preventDefault(),
  3832. e.stopPropagation();
  3833. var t = function() {
  3834. var t = e.touches[0].pageX - e.touches[1].pageX
  3835. , i = e.touches[0].pageY - e.touches[1].pageY;
  3836. this.dollyEnd.set(t, i);
  3837. var n = this.dollyStart.length() - this.dollyEnd.length();
  3838. n > 0 ? this.dollyOut(1 + n / 500) : this.dollyIn(1 - n / 500),
  3839. this.dollyStart.copy(this.dollyEnd)
  3840. }
  3841. .bind(this)
  3842. , i = function() {
  3843. this.panEnd.set(a.average(e.touches, "pageX"), a.average(e.touches, "pageY")),
  3844. this.panDelta.subVectors(this.panEnd, this.panStart),
  3845. this.pan(this.panDelta.x, this.panDelta.y),
  3846. this.panStart.copy(this.panEnd),
  3847. this.rotateDelta.set(0, 0)
  3848. }
  3849. .bind(this)
  3850. , n = function() {
  3851. this.rotateEnd.set(a.average(e.touches, "pageX"), a.average(e.touches, "pageY")),
  3852. this.rotateDelta.subVectors(this.rotateEnd, this.rotateStart),
  3853. this.rotateLeft(2 * Math.PI * this.rotateDelta.x / $("#player").width() * this.rotateSpeed),
  3854. this.rotateUp(2 * Math.PI * this.rotateDelta.y / $("#player").height() * this.rotateSpeed),
  3855. this.rotateStart.copy(this.rotateEnd)
  3856. }
  3857. .bind(this)
  3858. , r = function() {
  3859. if (2 === e.touches.length) {
  3860. var i = window.devicePixelRatio || 1
  3861. , r = e.touches[1].pageX - e.touches[0].pageX
  3862. , s = e.touches[1].pageY - e.touches[0].pageY
  3863. , l = Math.sqrt(r * r + s * s)
  3864. , h = Math.abs(this.dollyStart.length() - l);
  3865. if (h > o.input.touchMoveThreshold * i)
  3866. this.state = c.DOLLY,
  3867. t();
  3868. else {
  3869. var u = a.average(e.touches, "pageX")
  3870. , d = a.average(e.touches, "pageY")
  3871. , p = this.rotateDelta.set(u, d).sub(this.rotateStart).length();
  3872. p > o.input.touchMoveThreshold && (this.state = c.ROTATE,
  3873. this.rotateStart.set(u, d),
  3874. n())
  3875. }
  3876. }
  3877. }
  3878. .bind(this);
  3879. switch (this.state) {
  3880. case c.PAN_DOLLY:
  3881. t();
  3882. case c.PAN:
  3883. i();
  3884. break;
  3885. case c.ROTATE_DOLLY:
  3886. r();
  3887. break;
  3888. case c.DOLLY:
  3889. t();
  3890. break;
  3891. case c.ROTATE:
  3892. n();
  3893. break;
  3894. default:
  3895. this.state = c.NONE
  3896. }
  3897. this.lastMoveTime = e.timeStamp,
  3898. this.emit(d.Move, "touch")
  3899. }
  3900. }
  3901. ,
  3902. n.prototype.onTouchEnd = function(e) {
  3903. this.enabled && (this.state === c.ROTATE && (e.timeStamp > this.lastMoveTime + 100 ? (this.rotationSpeed.set(0, 0),
  3904. this.rotationAcceleration.set(0, 0)) : this.rotationAcceleration.set(-this.rotateDelta.x, this.rotateDelta.y)),
  3905. this.state = c.NONE,
  3906. this.update(),
  3907. this.rotationAcceleration.set(0, 0),
  3908. this.rotateDelta.set(0, 0))
  3909. }
  3910. ,
  3911. n.prototype.onPointerDown = function(e) {
  3912. this.enabled && ("touch" === e.pointerType && (this.pointers.length < this.pointersLimit && this.pointers.push({
  3913. id: e.pointerId,
  3914. pageX: e.pageX,
  3915. pageY: e.pageY
  3916. }),
  3917. e.touches = this.pointers,
  3918. this.onTouchStart(e)),
  3919. this.emit(d.InputStart, "pointer"))
  3920. }
  3921. ,
  3922. n.prototype.onPointerMove = function(e) {
  3923. this.enabled && "touch" === e.pointerType && (this.pointers.forEach(function(t) {
  3924. e.pointerId === t.id && (t.pageX = e.pageX,
  3925. t.pageY = e.pageY)
  3926. }),
  3927. e.touches = this.pointers,
  3928. this.onTouchMove(e))
  3929. }
  3930. ,
  3931. n.prototype.onPointerUp = function(e) {
  3932. this.enabled && "touch" === e.pointerType && (this.pointers.forEach(function(t, i) {
  3933. e.pointerId === t.id && this.pointers.splice(i, 1)
  3934. }
  3935. .bind(this)),
  3936. e.touches = this.pointers,
  3937. this.onTouchEnd(e))
  3938. }
  3939. ,
  3940. n.prototype.reset = function() {
  3941. this.state = c.NONE,
  3942. this.stopAutoPanning(),
  3943. this.rotationSpeed.set(0, 0),
  3944. this.rotationAcceleration.set(0, 0),
  3945. this.panSpeed.set(0, 0),
  3946. this.panAcceleration.set(0, 0)
  3947. }
  3948. ,
  3949. n.prototype.toJSON = function() {
  3950. var e = {
  3951. camera_position: {
  3952. x: s.toPrecision(this.camera.position.x, 4),
  3953. y: s.toPrecision(this.camera.position.y, 4),
  3954. z: s.toPrecision(this.camera.position.z, 4)
  3955. },
  3956. camera_quaternion: {
  3957. x: s.toPrecision(this.camera.quaternion.x, 4),
  3958. y: s.toPrecision(this.camera.quaternion.y, 4),
  3959. z: s.toPrecision(this.camera.quaternion.z, 4),
  3960. w: s.toPrecision(this.camera.quaternion.w, 4)
  3961. }
  3962. };
  3963. return e
  3964. }
  3965. ,
  3966. t.exports = n
  3967. }
  3968. , {
  3969. "../enum/ControlActions": 20,
  3970. "../enum/ControlEvents": 21,
  3971. "../enum/Keys": 30,
  3972. "../enum/MouseButton": 34,
  3973. "../enum/Vectors": 50,
  3974. "../settings": 166,
  3975. "../util/common": 185,
  3976. "../util/math": 190,
  3977. events: 202,
  3978. three: 217
  3979. }],
  3980. 13: [function(e, t, i) {
  3981. (function(i) {
  3982. "use strict";
  3983. function n(e) {
  3984. this.camera = e,
  3985. this.camera.controls = this,
  3986. this.target = new r.Vector3(0,0,0),
  3987. this.lookVector = new r.Vector3,
  3988. this.lookSpeed = .05,
  3989. this.rotationAcc = new r.Vector2,
  3990. this.rotationSpeed = new r.Vector2,
  3991. this.lat = 0,
  3992. this.lon = 0,
  3993. this.phi = 0,
  3994. this.theta = 0,
  3995. this.enabled = !1,
  3996. this.locked = !1,
  3997. this.pointer = new r.Vector2(0,0),
  3998. this.rotationHistory = [],
  3999. this.rotationDifference = new r.Vector2,
  4000. this.pointerDragOn = !1,
  4001. this.pointerDragStart = new r.Vector2(0,0),
  4002. this.pinchDistance = 0,
  4003. this.moveStart = new r.Vector2,
  4004. this.moveTolerance = .01,
  4005. this.pointersLimit = 2,
  4006. this.pointers = []
  4007. }
  4008. var r = e("three")
  4009. , o = e("../util/logger")
  4010. , a = e("../settings")
  4011. , s = e("../util/common")
  4012. , l = e("../util/math")
  4013. , c = (e("../enum/Vectors"),
  4014. e("../enum/MouseButton"))
  4015. , h = e("../enum/Keys")
  4016. , u = e("../enum/ControlEvents")
  4017. , d = e("events").EventEmitter;
  4018. new o(i);
  4019. n.prototype = Object.create(d.prototype),
  4020. n.prototype.usable = function() {
  4021. return this.enabled && !this.locked
  4022. }
  4023. ,
  4024. n.prototype.lookAt = function(e) {
  4025. var t = this.camera.position.clone().sub(e)
  4026. , i = Math.atan(t.z / t.x);
  4027. i += t.x < 0 ? Math.PI : 0,
  4028. i += t.x > 0 && t.z < 0 ? 2 * Math.PI : 0,
  4029. this.lon = r.Math.radToDeg(i) + 180;
  4030. var n = Math.sqrt(t.x * t.x + t.z * t.z)
  4031. , o = Math.atan(t.y / n);
  4032. this.lat = -r.Math.radToDeg(o)
  4033. }
  4034. ,
  4035. n.prototype.startRotationFrom = function(e, t) {
  4036. l.convertScreenPositionToNDC(e, t, this.pointer),
  4037. this.pointerDragOn = !0,
  4038. this.pointerDragStart.copy(this.pointer),
  4039. this.moveStart.copy(this.pointer),
  4040. this.rotationHistory = [],
  4041. this.rotationSpeed.set(0, 0)
  4042. }
  4043. ,
  4044. n.prototype.onMouseOver = function(e) {
  4045. !this.pointerDragOn || 0 !== e.which && 0 !== e.buttons || this.onMouseUp(e)
  4046. }
  4047. ,
  4048. n.prototype.onTouchStart = function(e) {
  4049. if (this.usable()) {
  4050. switch (e.preventDefault(),
  4051. e.stopPropagation(),
  4052. e.touches.length) {
  4053. case 1:
  4054. this.startRotationFrom(e.touches[0].clientX, e.touches[0].clientY);
  4055. break;
  4056. case 2:
  4057. var t = (e.touches[0].clientX - e.touches[1].clientX) / $("#player").width()
  4058. , i = (e.touches[0].clientY - e.touches[1].clientY) / $("#player").height();
  4059. this.pinchDistance = Math.sqrt(t * t + i * i)
  4060. }
  4061. this.emit(u.InputStart, "touch")
  4062. }
  4063. }
  4064. ,
  4065. n.prototype.onPointerDown = function(e) {
  4066. this.usable() && "touch" === e.pointerType && (this.pointers.length < this.pointersLimit && this.pointers.push({
  4067. id: e.pointerId,
  4068. clientX: e.clientX,
  4069. clientY: e.clientY
  4070. }),
  4071. e.touches = this.pointers,
  4072. this.onTouchStart(e),
  4073. this.emit(u.InputStart, "pointer"))
  4074. }
  4075. ,
  4076. n.prototype.onMouseDown = function(e) {
  4077. if (this.usable()) {
  4078. switch (e.preventDefault(),
  4079. e.stopPropagation(),
  4080. e.button) {
  4081. case c.LEFT:
  4082. this.startRotationFrom(e.clientX, e.clientY)
  4083. }
  4084. this.emit(u.InputStart, "mouse")
  4085. }
  4086. }
  4087. ,
  4088. n.prototype.updateRotation = function() {
  4089. if (this.usable() && this.pointerDragOn) {
  4090. var e = new r.Vector3(this.pointerDragStart.x,this.pointerDragStart.y,-1).unproject(this.camera)
  4091. , t = new r.Vector3(this.pointer.x,this.pointer.y,-1).unproject(this.camera)
  4092. , i = Math.sqrt(e.x * e.x + e.z * e.z)
  4093. , n = Math.sqrt(t.x * t.x + t.z * t.z)
  4094. , o = Math.atan2(e.y, i)
  4095. , a = Math.atan2(t.y, n);
  4096. this.rotationDifference.y = r.Math.radToDeg(o - a),
  4097. e.y = 0,
  4098. t.y = 0;
  4099. var s = Math.acos(e.dot(t) / e.length() / t.length());
  4100. isNaN(s) || (this.rotationDifference.x = r.Math.radToDeg(s),
  4101. this.pointerDragStart.x < this.pointer.x && (this.rotationDifference.x *= -1)),
  4102. this.pointerDragStart.copy(this.pointer)
  4103. }
  4104. }
  4105. ,
  4106. n.prototype.onMouseMove = function(e) {
  4107. this.usable() && (l.convertScreenPositionToNDC(e.clientX, e.clientY, this.pointer),
  4108. 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"))
  4109. }
  4110. ,
  4111. n.prototype.onTouchMove = function(e) {
  4112. if (this.usable())
  4113. switch (this.emit(u.Move, "touch"),
  4114. e.touches.length) {
  4115. case 1:
  4116. l.convertScreenPositionToNDC(e.touches[0].clientX, e.touches[0].clientY, this.pointer);
  4117. break;
  4118. case 2:
  4119. var t = (e.touches[0].clientX - e.touches[1].clientX) / $("#player").width()
  4120. , i = (e.touches[0].clientY - e.touches[1].clientY) / $("#player").height()
  4121. , n = this.pinchDistance - Math.sqrt(t * t + i * i);
  4122. Math.abs(n) > .01 && (this.emit(u.InteractionDirect),
  4123. this.emit(u.Pinch, n),
  4124. this.pinchDistance -= n)
  4125. }
  4126. }
  4127. ,
  4128. n.prototype.onPointerMove = function(e) {
  4129. this.usable() && "touch" === e.pointerType && (this.pointers.forEach(function(t) {
  4130. e.pointerId === t.id && (t.clientX = e.clientX,
  4131. t.clientY = e.clientY)
  4132. }),
  4133. e.touches = this.pointers,
  4134. this.onTouchMove(e))
  4135. }
  4136. ,
  4137. n.prototype.endRotation = function() {
  4138. this.pointerDragOn = !1;
  4139. var e = s.averageVectors(this.rotationHistory);
  4140. this.rotationSpeed.set(e.x * a.rotationAfterMoveMultiplier, e.y * a.rotationAfterMoveMultiplier)
  4141. }
  4142. ,
  4143. n.prototype.onTouchEnd = function(e) {
  4144. this.usable() && (e.preventDefault(),
  4145. e.stopPropagation(),
  4146. this.endRotation())
  4147. }
  4148. ,
  4149. n.prototype.onMouseUp = function(e) {
  4150. this.usable() && (e.preventDefault(),
  4151. e.stopPropagation(),
  4152. this.endRotation())
  4153. }
  4154. ,
  4155. n.prototype.onPointerUp = function(e) {
  4156. this.usable() && "touch" === e.pointerType && (this.pointers.forEach(function(t, i) {
  4157. e.pointerId === t.id && this.pointers.splice(i, 1)
  4158. }
  4159. .bind(this)),
  4160. e.touches = this.pointers,
  4161. this.onTouchEnd(e))
  4162. }
  4163. ,
  4164. n.prototype.update = function(e) {
  4165. this.lon,
  4166. this.lat;
  4167. for (this.updateRotation(),
  4168. this.rotationHistory.push(this.rotationDifference.clone()); this.rotationHistory.length > a.rotationAfterMoveHistoryCount; )
  4169. this.rotationHistory.shift();
  4170. this.lon += this.rotationDifference.x,
  4171. this.lat += this.rotationDifference.y,
  4172. this.rotationDifference.set(0, 0),
  4173. this.rotationSpeed.x = this.rotationSpeed.x * (1 - a.rotationFriction) + this.rotationAcc.x * a.rotationAccelerationInside,
  4174. this.rotationSpeed.y = this.rotationSpeed.y * (1 - a.rotationFriction) + this.rotationAcc.y * a.rotationAccelerationInside,
  4175. this.lon += this.rotationSpeed.x * e,
  4176. this.lat += this.rotationSpeed.y * e,
  4177. this.lat = Math.max(a.insideLookLimitDown, Math.min(a.insideLookLimitUp, this.lat)),
  4178. this.phi = r.Math.degToRad(90 - this.lat),
  4179. this.theta = r.Math.degToRad(this.lon),
  4180. this.lookVector.x = Math.sin(this.phi) * Math.cos(this.theta),
  4181. this.lookVector.y = Math.cos(this.phi),
  4182. this.lookVector.z = Math.sin(this.phi) * Math.sin(this.theta),
  4183. this.target.copy(this.lookVector).add(this.camera.position),
  4184. this.camera.lookAt(this.target)
  4185. }
  4186. ,
  4187. n.prototype.onMouseWheel = function(e) {
  4188. if (this.usable()) {
  4189. var t = e.wheelDelta || -e.detail;
  4190. this.emit(u.InteractionDirect),
  4191. this.emit(u.Scroll, t)
  4192. }
  4193. }
  4194. ,
  4195. n.prototype.onKeyDown = function(e) {
  4196. this.usable() && (e.metaKey || e.ctrlKey || (e.preventDefault(),
  4197. this.handleKeyDown(e.which)))
  4198. }
  4199. ,
  4200. n.prototype.handleKeyDown = function(e) {
  4201. var t = function(e, t) {
  4202. this.rotationAcc[e] = t
  4203. }
  4204. .bind(this);
  4205. this.emit(u.InteractionKey);
  4206. var i = !0;
  4207. switch (e) {
  4208. case h.LEFTARROW:
  4209. case h.J:
  4210. t("x", -1);
  4211. break;
  4212. case h.RIGHTARROW:
  4213. case h.L:
  4214. t("x", 1);
  4215. break;
  4216. case h.I:
  4217. t("y", 1);
  4218. break;
  4219. case h.K:
  4220. t("y", -1);
  4221. break;
  4222. default:
  4223. i = !1
  4224. }
  4225. i && this.emit(u.Move, "key")
  4226. }
  4227. ,
  4228. n.prototype.onKeyUp = function(e) {
  4229. this.usable() && (e.preventDefault(),
  4230. e.stopPropagation(),
  4231. this.handleKeyUp(e.which))
  4232. }
  4233. ,
  4234. n.prototype.handleKeyUp = function(e) {
  4235. switch (e) {
  4236. case h.LEFTARROW:
  4237. case h.J:
  4238. case h.RIGHTARROW:
  4239. case h.L:
  4240. this.rotationAcc.x = 0;
  4241. break;
  4242. case h.I:
  4243. case h.K:
  4244. this.rotationAcc.y = 0
  4245. }
  4246. }
  4247. ,
  4248. n.prototype.startRotating = function(e, t) {
  4249. e && (this.rotationAcc.x = e),
  4250. t && (this.rotationAcc.y = t)
  4251. }
  4252. ,
  4253. n.prototype.stopRotating = function(e) {
  4254. e && (this.rotationSpeed.x = this.rotationSpeed.y = 0),
  4255. this.rotationAcc.set(0, 0)
  4256. }
  4257. ,
  4258. n.prototype.reset = function() {
  4259. this.pointerDragOn = !1,
  4260. this.rotationAcc.set(0, 0),
  4261. this.rotationSpeed.set(0, 0),
  4262. this.pointers = []
  4263. }
  4264. ,
  4265. n.prototype.toJSON = function() {
  4266. var e = {
  4267. camera_position: {
  4268. x: l.toPrecision(this.camera.position.x, 4),
  4269. y: l.toPrecision(this.camera.position.y, 4),
  4270. z: l.toPrecision(this.camera.position.z, 4)
  4271. },
  4272. camera_quaternion: {
  4273. x: l.toPrecision(this.camera.quaternion.x, 4),
  4274. y: l.toPrecision(this.camera.quaternion.y, 4),
  4275. z: l.toPrecision(this.camera.quaternion.z, 4),
  4276. w: l.toPrecision(this.camera.quaternion.w, 4)
  4277. }
  4278. };
  4279. return e
  4280. }
  4281. ,
  4282. n.prototype.setStateFromJSON = function(e) {
  4283. this.camera.position.copy(e.camera_position),
  4284. this.camera.quaternion.copy(e.camera_quaternion)
  4285. }
  4286. ,
  4287. t.exports = n
  4288. }
  4289. ).call(this, "/js/controls/PanoramaControls.js")
  4290. }
  4291. , {
  4292. "../enum/ControlEvents": 21,
  4293. "../enum/Keys": 30,
  4294. "../enum/MouseButton": 34,
  4295. "../enum/Vectors": 50,
  4296. "../settings": 166,
  4297. "../util/common": 185,
  4298. "../util/logger": 189,
  4299. "../util/math": 190,
  4300. events: 202,
  4301. three: 217
  4302. }],
  4303. 14: [function(e, t, i) {
  4304. (function(i) {
  4305. "use strict";
  4306. var n = e("three")
  4307. , r = e("../enum/Viewmode")
  4308. , o = e("../util/logger")
  4309. , a = new o(i);
  4310. t.exports = {
  4311. serialize: function(e) {
  4312. return encodeURI(JSON.stringify(e))
  4313. },
  4314. deserialize: function(e) {
  4315. function t(e) {
  4316. function t(e, t) {
  4317. return e && "number" == typeof t && !isNaN(t)
  4318. }
  4319. return e.reduce(t, !0)
  4320. }
  4321. try {
  4322. var i = JSON.parse(decodeURI(e))
  4323. , o = {
  4324. mode: r.fromInt(i.camera_mode),
  4325. panoId: i.scan_id,
  4326. position: (new n.Vector3).copy(i.camera_position),
  4327. quaternion: (new n.Quaternion).copy(i.camera_quaternion),
  4328. zoom: i.ortho_zoom,
  4329. floorVisibility: i.floor_visibility
  4330. }
  4331. , s = o.position;
  4332. t([s.x, s.y, s.z]) || o.position.set(0, 0, 0);
  4333. var l = o.quaternion;
  4334. return t([l.x, l.y, l.z, l.w]) || o.quaternion.set(0, 0, 0, 1),
  4335. o
  4336. } catch (i) {
  4337. a.debug("Not able to parse start location as JSON; falling back to old array style parsing");
  4338. try {
  4339. var c = e.split(",")
  4340. , h = {
  4341. x: parseFloat(c[2]),
  4342. y: parseFloat(c[3]),
  4343. z: parseFloat(c[4])
  4344. }
  4345. , u = {
  4346. x: parseFloat(c[5]),
  4347. y: parseFloat(c[6]),
  4348. z: parseFloat(c[7]),
  4349. w: parseFloat(c[8])
  4350. };
  4351. return t([h.x, h.y, h.z]) || (h.x = 0,
  4352. h.y = 0,
  4353. h.z = 0),
  4354. t([u.x, u.y, u.z, u.w]) || (u.x = 0,
  4355. u.y = 0,
  4356. u.z = 0,
  4357. u.w = 1),
  4358. {
  4359. mode: r.fromInt(c[0]),
  4360. panoId: c[1],
  4361. position: (new n.Vector3).copy(h),
  4362. quaternion: (new n.Quaternion).copy(u)
  4363. }
  4364. } catch (t) {
  4365. a.warn('Invalid start override, ignoring: "' + e + '"', t.message)
  4366. }
  4367. }
  4368. return null
  4369. }
  4370. }
  4371. }
  4372. ).call(this, "/js/controls/serializer.js")
  4373. }
  4374. , {
  4375. "../enum/Viewmode": 51,
  4376. "../util/logger": 189,
  4377. three: 217
  4378. }],
  4379. 15: [function(e, t, i) {
  4380. (function(i) {
  4381. "use strict";
  4382. function n() {
  4383. this.endlessLoop = a.warp.loop,
  4384. this.clock = new r.Clock(!0),
  4385. this.model = null,
  4386. this.player = null,
  4387. this.currentItem = null,
  4388. this.destinationItem = null,
  4389. this.tourIsPlaying = !1,
  4390. this.transitionStage = y.None,
  4391. this.nextFunc = null,
  4392. this.onTheBus = !1,
  4393. this.tourInProgress = !1,
  4394. this.reachSource = null,
  4395. this.interrupted = !1,
  4396. this.nItems = 0,
  4397. this.walkingSectionPaused = !1
  4398. }
  4399. var r = e("three")
  4400. , o = e("./util/logger")
  4401. , a = e("./settings")
  4402. , s = e("./util/transitions")
  4403. , l = e("events").EventEmitter
  4404. , c = e("./enum/Viewmode")
  4405. , h = e("./analytics")
  4406. , u = e("./enum/WarpStyle")
  4407. , s = e("./util/transitions")
  4408. , d = (e("./model/ModelManager"),
  4409. e("./enum/ModelManagerEvents"))
  4410. , p = e("./enum/DirectorEvents")
  4411. , f = e("./enum/PlayerEvents")
  4412. , g = (e("./enum/ControlEvents"),
  4413. e("./enum/BlackoutStyle"))
  4414. , m = e("./enum/PathDiscardMode")
  4415. , v = e("./enum/PathDisplayMode")
  4416. , A = (e("./player"),
  4417. new o(i))
  4418. , y = Object.freeze({
  4419. None: 0,
  4420. Moving: 1,
  4421. Aiming: 2,
  4422. Interlude: 3
  4423. })
  4424. , C = Object.freeze({
  4425. Forward: 1,
  4426. NoChange: 0,
  4427. Backwards: -1
  4428. })
  4429. , I = s.getUniqueId();
  4430. n.prototype = Object.create(l.prototype),
  4431. n.prototype.init = function(e, t) {
  4432. this.player = e,
  4433. this.modelManager = t,
  4434. this.updateModel(),
  4435. this.resetAll(),
  4436. this.bindEvents()
  4437. }
  4438. ,
  4439. n.prototype.resetAll = function() {
  4440. if (this.currentItem = null,
  4441. this.destinationItem = null,
  4442. this.tourIsPlaying = !1,
  4443. this.bgmReplay(),//xzw
  4444. this.transitionStage = y.None,
  4445. this.nextFunc = null,
  4446. this.onTheBus = !1,
  4447. this.reachSource = null,
  4448. this.interrupted = !1,
  4449. this.model) {
  4450. var e = a.path.typ === u.WALK ? u.WALK : u.STD;
  4451. this.defaultWarpStyle = this.model.data.hasOwnProperty("player_options") && this.model.data.player_options && this.model.data.player_options.fast_transitions === !1 ? e : u.BLACK
  4452. } else
  4453. this.defaultWarpStyle = u.BLACK,
  4454. A.warn('No model yet, choosing "' + this.defaultWarpStyle + '" transitions');
  4455. this.resetSpecialTransition()
  4456. }
  4457. ,
  4458. n.prototype.updateModel = function() {
  4459. this.model = this.modelManager.getActiveModel(),
  4460. this.nItems = this.model.heroLocations.length
  4461. }
  4462. ,
  4463. n.prototype.bindEvents = function() {
  4464. this.modelManager.on(d.ActiveModelChanged, this.updateModel.bind(this)),
  4465. this.player.on(f.WarpInterruptedWithFlyTo, this.checkAndHandleWalkingtourInterruption.bind(this)),
  4466. this.player.on(f.Move, this.handlePlayerMove.bind(this)),
  4467. this.player.on(f.PanoChosen, this.handlePlayerPanoChosen.bind(this)),
  4468. this.player.on(f.ModeChanged, this.handlePlayerModeChanged.bind(this)),
  4469. this.player.on(f.InputStart, this.handlePlayerInputStart.bind(this)),
  4470. this.player.on(f.FlyingStarted, this.handlePlayerFlyingStarted.bind(this)),
  4471. this.player.once(f.Move, function() {
  4472. s.cancelById(I)
  4473. })
  4474. }
  4475. ,
  4476. n.prototype.checkAndHandleWalkingtourInterruption = function(e) {
  4477. return e === u.WALK && (this.interrupt(g.NONE),
  4478. this.pauseWalkingSection(),
  4479. this.player.fastForwardActivePanoFlight(),
  4480. !0)
  4481. }
  4482. ,
  4483. n.prototype.handlePlayerMove = function(e) {
  4484. this.transitionStage === y.Interlude && this.interrupt(g.NONE),
  4485. this.emit("update.controls")
  4486. }
  4487. ,
  4488. n.prototype.handlePlayerPanoChosen = function(e, t) {
  4489. this.intermediateState() || e.id === t.id || (this.onTheBus = !1,
  4490. this.emit("update.controls"))
  4491. }
  4492. ,
  4493. n.prototype.handlePlayerModeChanged = function(e, t) {
  4494. this.intermediateState() || e === t || (this.onTheBus = !1,
  4495. this.emit("update.controls"))
  4496. }
  4497. ,
  4498. n.prototype.handlePlayerInputStart = function(e) {
  4499. this.transitionStage === y.Interlude && this.interrupt(g.NONE)
  4500. }
  4501. ,
  4502. n.prototype.handlePlayerFlyingStarted = function() {
  4503. this.clearWalkingSectionPaused()
  4504. }
  4505. ,
  4506. n.prototype.describe = function() {
  4507. return {
  4508. nItems: this.nItems,
  4509. currentItem: this.currentItem,
  4510. destinationItem: this.destinationItem,
  4511. tourIsPlaying: this.tourIsPlaying,
  4512. onTheBus: this.onTheBus,
  4513. endlessLoop: this.endlessLoop,
  4514. viewMode: this.player.mode,
  4515. inTransition: this._inTransition(),
  4516. transitionStage: this.transitionStage,
  4517. tourInProgress: this.tourInProgress
  4518. }
  4519. }
  4520. ,
  4521. n.prototype._inTransition = function() {
  4522. return this.player.flying || this.player.isWarping() || this.player.isWaitingToWarp() || this.player.mode === c.TRANSITIONING || this.tourIsPlaying
  4523. }
  4524. ,
  4525. n.prototype.bounceable = function() {
  4526. var e = this.clock.getDelta();
  4527. return this.isInterrupted() || e < .9 && e > .01 || this.player.flying && !this.player.isWarping()
  4528. }
  4529. ,
  4530. n.prototype.currentMoveDirection = function() {
  4531. return null === this.currentItem || void 0 === this.currentItem ? C.Forward : this.destinationItem === this.currentItem ? C.NoChange : this.destinationItem > this.currentItem ? C.Forward : C.Backwards
  4532. }
  4533. ,
  4534. n.prototype.clearPath = function() {
  4535. this._inTransition() || this.player.path.discardPathObject()
  4536. }
  4537. ,
  4538. n.prototype.allFloors = function() {
  4539. this.model.toggleAllFloors()
  4540. }
  4541. ,
  4542. n.prototype.actionComplete = function(e) {
  4543. if (this.interrupted = !1,
  4544. this.transitionStage = y.None,
  4545. this.resetSpecialTransition(),
  4546. null !== this.destinationItem && this.setCurrentItem(this.destinationItem),
  4547. this.tourIsPlaying || (this.player.disablePreRendering(),
  4548. this.player.mode === c.PANORAMA && this.player.currentPano.isAligned() && this.model.fadePanoMarkers()),
  4549. this.emit("update.controls"),
  4550. this.nextFunc) {
  4551. var t = this.nextFunc;
  4552. this.nextFunc = null,
  4553. t()
  4554. }
  4555. }
  4556. ,
  4557. n.prototype.awaitCompletion = function(e, t) {
  4558. this.nextFunc = t,
  4559. e()
  4560. }
  4561. ,
  4562. n.prototype.updateSuccessFunction = function(e) {
  4563. this.nextFunc = e
  4564. }
  4565. ,
  4566. n.prototype.interrupt = function(e, t) {
  4567. return !!this.wouldInterrupt() && (this.tourIsPlaying && (this.player.zoomEnabled = this.wasZoomEnabled),
  4568. this.tourIsPlaying = !1,
  4569. this.bgmReplay(),//xzw
  4570. this.interrupted = !0,
  4571. this.nextFunc = null,
  4572. this.emit(p.ActionInterrupted),
  4573. null !== e && void 0 !== e || (e = g.BEGINNING),
  4574. this.player.interruptAndFastForward(e, t),
  4575. !0)
  4576. }
  4577. ,
  4578. n.prototype.wouldInterrupt = function() {
  4579. return this.transitionStage !== y.None
  4580. }
  4581. ,
  4582. n.prototype.intermediateState = function() {
  4583. return this.transitionStage !== y.None
  4584. }
  4585. ,
  4586. n.prototype.isInterrupted = function() {
  4587. return this.interrupted
  4588. }
  4589. ,
  4590. n.prototype.pauseWalkingSection = function() {
  4591. this.walkingSectionPaused = !0
  4592. }
  4593. ,
  4594. n.prototype.clearWalkingSectionPaused = function() {
  4595. this.walkingSectionPaused = !1
  4596. }
  4597. ,
  4598. n.prototype.autoTour = function() {
  4599. var e = Date.now();
  4600. this.model.auxDataPromise.then(function() {
  4601. e = Date.now() - e;
  4602. var t = a.warp.auto
  4603. , i = this.model.data && this.model.data.player_options && this.model.data.player_options.highlight_reel;
  4604. t >= 0 && this.model.heroCount() > 1 && i && s.trigger({
  4605. duration: Math.max(1e3 * Math.min(300, t) - e, 0),
  4606. done: function() {
  4607. this.playTour()
  4608. }
  4609. .bind(this),
  4610. name: "_atr",
  4611. id: I
  4612. })
  4613. }
  4614. .bind(this))
  4615. }
  4616. ,
  4617. n.prototype.atDestinationPano = function() {
  4618. if (!this.player.currentPano || null === this.destinationItem)
  4619. return !1;
  4620. var e = this.player.currentPano.id;
  4621. if (void 0 === e)
  4622. return !1;
  4623. var t = this.model.heroLocations;
  4624. return null !== this.destinationItem && void 0 !== t[this.destinationItem] && e === t[this.destinationItem].panoId
  4625. }
  4626. ,
  4627. n.prototype.redirectToItem = function(e, t) {
  4628. if (null === e || void 0 === e)
  4629. return void A.warn("Director.redirectToItem() -> Redirecting to null item.");
  4630. if (!this.wouldInterrupt())
  4631. return void A.warn("Director.redirectToItem() -> Director cannot redirect if there is nothing to interrupt.");
  4632. if (this.player.mode === c.TRANSITIONING)
  4633. return void A.debug("Director.redirectToItem() -> Cannot redirect while transitioning.");
  4634. A.debug("Director.redirectToItem() -> Redirecting to " + e + " via " + t);
  4635. var i = function() {
  4636. s.setTimeout(function() {
  4637. this.setDestinationItem(e),
  4638. this.goToDestination(!0, g.BEGINNING, a.warp.warpInterruptionRedirectTime, !1)
  4639. }
  4640. .bind(this), 0)
  4641. }
  4642. .bind(this);
  4643. this.interrupt(g.END, 0),
  4644. this.updateSuccessFunction(i)
  4645. }
  4646. ,
  4647. n.prototype.useSpecialTransition = function(e) {
  4648. void 0 !== e && this.defaultWarpStyle !== u.BLACK && A.debug("useSpecialTransition(): " + e),
  4649. this.nextWarpStyle = u.BLACK
  4650. }
  4651. ,
  4652. n.prototype.resetSpecialTransition = function() {
  4653. this.nextWarpStyle = this.defaultWarpStyle
  4654. }
  4655. ,
  4656. n.prototype.arrivedAtDestination = function(e) {
  4657. if (this.player.flying || this.player.isWarping())
  4658. A.warn("Cannot advance to interlude or aiming while player is flying or warping.");
  4659. else {
  4660. this.transitionStage = y.Aiming;
  4661. var t = this.tourIsPlaying ? this.tourInterlude.bind(this, this.nextItem(this.currentItem)) : null;
  4662. this.player.model.fadePanoMarkers(0),
  4663. this.awaitCompletion(function() {
  4664. this.resetSpecialTransition(),
  4665. e ? this.player.aimTourCamera(this.destinationItem, v.Retain, v.Slow, this.actionComplete.bind(this)) : this.actionComplete()
  4666. }
  4667. .bind(this), t)
  4668. }
  4669. }
  4670. ,
  4671. n.prototype.goToDestination = function(e, t, i, n) {
  4672. //xzw add:
  4673. if(g_data2.tourAudio){
  4674. var tM = g_version === "one" ?
  4675. g_data2.tourAudio[this.model.heroLocations[this.destinationItem].panoId] :
  4676. g_data2.tourAudio[this.model.heroLocations[this.destinationItem].sid];
  4677. if(tM && tM.music){
  4678. var s = g_Prefix+tM.music;
  4679. if(g_tourAudio.src==s && !g_tourAudio.paused) return;
  4680. g_tourAudio.src = s;
  4681. g_playAudio = g_tourAudio;
  4682. g_play && g_tourAudio.play();
  4683. g_bgAudio && g_bgAudio.pause();
  4684. }
  4685. };
  4686. if (this.onTheBus = !0,
  4687. this.emit("update.controls"),
  4688. this.player.updateLastView(),
  4689. !n && this.atDestinationPano())
  4690. return void this.arrivedAtDestination(!0);
  4691. if (this.player.flying || this.player.isWarping())
  4692. A.warn("Cannot go to new destination while player is flying or warping.");
  4693. else {
  4694. var r = this.model.getHeroDescriptorByIndex(this.destinationItem)
  4695. , o = null
  4696. , a = null;
  4697. if (r.isPano()) {
  4698. //czj 控制导览浏览的效果 u.BLACK 就是闪过去 'walk' 就是走过去
  4699. //var s = 0 === this.destinationItem || e ? u.BLACK : this.nextWarpStyle;
  4700. var walk = window.MP_PREFETCHED_MODELDATA.black ? 'black' : 'walk';
  4701. var s = 0 === this.destinationItem || e ? walk : walk;
  4702. a = this.player.warpToPanoByHeroIndex.bind(this.player, this.destinationItem, v.Show, m.Slow, s, t, i, this.actionComplete.bind(this)),
  4703. o = this.arrivedAtDestination.bind(this, !0)
  4704. } else
  4705. a = this.player.warpToNonPanoByHeroIndex.bind(this.player, this.destinationItem, this.actionComplete.bind(this)),
  4706. o = this.arrivedAtDestination.bind(this, !1);
  4707. this.transitionStage = y.Moving,
  4708. this.model.fadePanoMarkers(0),
  4709. this.awaitCompletion(function() {
  4710. a()
  4711. }
  4712. .bind(this), o),
  4713. this.emit("update.controls")
  4714. }
  4715. }
  4716. ,
  4717. n.prototype.tourInterlude = function() {
  4718. if (h.trackAlways("reach_highlight", {
  4719. reach_source: this.reachSource
  4720. }),
  4721. this.model.fadePanoMarkers(0),
  4722. this.emit("update.controls"),
  4723. this.tourIsPlaying)
  4724. return this.atEndOfTour() && !this.endlessLoop ? (this.tourInProgress = !1,
  4725. this.stopTour(),
  4726. this.emit(p.TourEnd),
  4727. void (this.player.mode === c.PANORAMA && this.model.fadePanoMarkers(a.panorama.markerOpacity))) : void this.awaitCompletion(function() {
  4728. this.transitionStage = y.Interlude,
  4729. this.player.tourInterlude(this.nextItem(this.currentItem), this.actionComplete.bind(this))
  4730. }
  4731. .bind(this), this.goNext.bind(this))
  4732. }
  4733. ,
  4734. n.prototype.playTour = function() {
  4735. if (!this.bounceable())
  4736. return this.tourIsPlaying ? void A.info("tour is already playing") : void (this.wouldInterrupt() || (this.player.emit("tour_auto", this.defaultWarpStyle),
  4737. this.tourInProgress = !0,
  4738. this.reachSource = "play",
  4739. this.tourIsPlaying = !0,
  4740. this.wasZoomEnabled = this.player.zoomEnabled,
  4741. this.player.zoomEnabled = !1,
  4742. this.resetSpecialTransition(),
  4743. this.emit("update.controls"),
  4744. this.emit(p.TourStart),
  4745. this.player.enablePreRendering(),
  4746. this.walkingSectionPaused ? (this.clearWalkingSectionPaused(),
  4747. this.goToDestination()) : this.goNext()))
  4748. }
  4749. ,
  4750. n.prototype.bgmReplay = function() {//xzw add 结束tour后可能要继续播放背景音乐
  4751. if(g_tourAudio && g_tourAudio.paused && g_bgAudio && g_bgAudio.paused){
  4752. g_playAudio = g_bgAudio;
  4753. g_bgAudio.play();
  4754. }
  4755. }
  4756. ,
  4757. n.prototype.stopTour = function() {
  4758. this.isInterrupted() || this.transitionStage === y.Moving && this.checkAndHandleWalkingtourInterruption(this.nextWarpStyle) || (this.tourIsPlaying && (this.player.zoomEnabled = this.wasZoomEnabled),
  4759. this.tourIsPlaying = !1,
  4760. this.bgmReplay(),//xzw
  4761. this.interrupt(),
  4762. this.clearWalkingSectionPaused(),
  4763. this.resetSpecialTransition(),
  4764. this.emit("update.controls"))
  4765. }
  4766. ,
  4767. n.prototype.endTourProgress = function() {
  4768. this.tourInProgress = !1,
  4769. this.emit("update.controls"),
  4770. this.emit(p.TourEnd)
  4771. }
  4772. ,
  4773. n.prototype.goToHighlight = function(e) {
  4774. if (this.wouldInterrupt())
  4775. e === this.destinationItem ? this.interrupt() : this.redirectToItem(e, "goToHighlight");
  4776. else {
  4777. if (A.debug("<tour.goto " + e + ">"),
  4778. this.isInterrupted())
  4779. return;
  4780. this.clearWalkingSectionPaused(),
  4781. this.setDestinationItem(e),
  4782. this.useSpecialTransition("Hilight"),
  4783. this.goToDestination(),
  4784. h.trackAlways("reach_highlight", {
  4785. reach_source: "thumb"
  4786. })
  4787. }
  4788. }
  4789. ,
  4790. n.prototype.prevHighlight = function() {
  4791. this.bounceable() || (this.player.emit("tour_manual", "prev"),
  4792. this.interrupt(g.BEGINNING) || this.isInterrupted() || (this.clearWalkingSectionPaused(),
  4793. this.reachSource = "prev",
  4794. this.goPrev()))
  4795. }
  4796. ,
  4797. n.prototype.nextHighlight = function() {
  4798. this.bounceable() || (this.player.emit("tour_manual", "next"),
  4799. this.interrupt(g.BEGINNING) || this.isInterrupted() || (this.clearWalkingSectionPaused(),
  4800. this.reachSource = "next",
  4801. this.goNext()))
  4802. }
  4803. ,
  4804. n.prototype.changeMode = function(e) {
  4805. var t = $.Deferred()
  4806. , i = t.resolve.bind(t)
  4807. , n = t.reject.bind(t);
  4808. this.emit(p.StartModeChange);
  4809. var r = function() {
  4810. return this.clearWalkingSectionPaused(),
  4811. !!this.wouldInterrupt() && (this.interrupt(),
  4812. !0)
  4813. }
  4814. .bind(this);
  4815. if (!r()) {
  4816. switch (e) {
  4817. case c.PANORAMA:
  4818. 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);
  4819. break;
  4820. case c.DOLLHOUSE:
  4821. case c.FLOORPLAN:
  4822. this.player.flyToNewMode({
  4823. mode: e
  4824. }).done(i).fail(n);
  4825. break;
  4826. case c.OUTDOOR:
  4827. 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)
  4828. }
  4829. return t.promise()
  4830. }
  4831. }
  4832. ,
  4833. n.prototype.atEndOfTour = function() {
  4834. var e = this.currentItem >= this.nItems - 1;
  4835. return e
  4836. }
  4837. ,
  4838. n.prototype.firstDestination = function() {
  4839. return this.nItems > 0 ? 0 : null
  4840. }
  4841. ,
  4842. n.prototype.finalDestination = function() {
  4843. return this.nItems > 0 ? this.nItems - 1 : null
  4844. }
  4845. ,
  4846. n.prototype.goPrev = function() {
  4847. this.tourAdvance(-1)
  4848. }
  4849. ,
  4850. n.prototype.goNext = function() {
  4851. this.tourAdvance(1)
  4852. }
  4853. ,
  4854. n.prototype.setDestinationItem = function(e) {
  4855. this.destinationItem = e,
  4856. this.emit("update.controls")
  4857. }
  4858. ,
  4859. n.prototype.setCurrentItem = function(e) {
  4860. this.currentItem = e,
  4861. this.emit("update.controls")
  4862. }
  4863. ,
  4864. n.prototype.nextItem = function(e) {
  4865. return null === e ? this.firstDestination() : e >= this.nItems - 1 ? this.endlessLoop ? this.firstDestination() : null : e + 1
  4866. }
  4867. ,
  4868. n.prototype.prevItem = function(e) {
  4869. return null === e ? this.firstDestination() : e < 0 ? this.endlessLoop ? this.lastDestination() : null : e - 1
  4870. }
  4871. ,
  4872. n.prototype.tourAdvance = function(e) {
  4873. A.debug("tourAdvance(" + e + ")"),
  4874. null === this.currentItem || void 0 === this.currentItem ? this.setDestinationItem(this.firstDestination()) : this.setDestinationItem(this.currentItem + e),
  4875. this.destinationItem < 0 ? (this.setDestinationItem(this.finalDestination()),
  4876. this.useSpecialTransition("reverse-looping to end")) : this.destinationItem >= this.nItems && (this.setDestinationItem(this.firstDestination()),
  4877. this.useSpecialTransition("looping back to start")),
  4878. this.goToDestination()
  4879. }
  4880. ,
  4881. t.exports = n
  4882. }
  4883. ).call(this, "/js/director.js")
  4884. }
  4885. , {
  4886. "./analytics": 4,
  4887. "./enum/BlackoutStyle": 18,
  4888. "./enum/ControlEvents": 21,
  4889. "./enum/DirectorEvents": 23,
  4890. "./enum/ModelManagerEvents": 33,
  4891. "./enum/PathDiscardMode": 38,
  4892. "./enum/PathDisplayMode": 39,
  4893. "./enum/PlayerEvents": 40,
  4894. "./enum/Viewmode": 51,
  4895. "./enum/WarpStyle": 52,
  4896. "./model/ModelManager": 140,
  4897. "./player": 155,
  4898. "./settings": 166,
  4899. "./util/logger": 189,
  4900. "./util/transitions": 195,
  4901. events: 202,
  4902. three: 217
  4903. }],
  4904. 16: [function(e, t, i) {
  4905. "use strict";
  4906. var n = e("three")
  4907. , r = e("./enum/Viewmode")
  4908. , o = (e("./settings"),
  4909. e("./util/transitions"))
  4910. , a = e("./enum/PlayerEvents")
  4911. , s = new n.ShaderPass(n.HorizontalBlurShader)
  4912. , l = new n.ShaderPass(n.VerticalBlurShader);
  4913. l.renderToScreen = !0;
  4914. var c = $("#player").width() / $("#player").height();
  4915. isNaN(c) && (c = 1);
  4916. var h = {
  4917. currentBlur: 0,
  4918. aspect: c,
  4919. blurStrength: 1,
  4920. hblurPass: s,
  4921. vblurPass: l,
  4922. bindEvents: function(e) {
  4923. e.on(a.ModeChanged, function(e, t) {
  4924. e === r.PANORAMA && (o.cancel(h.blur),
  4925. o.cancel(h.addBlur),
  4926. o.start(h.removeBlur, 500, null, 0, null, "deblur"))
  4927. })
  4928. },
  4929. blur: function(e) {
  4930. h.currentBlur = e;
  4931. var t = e * h.blurStrength;
  4932. l.uniforms.v.value = t / 512 * h.aspect,
  4933. s.uniforms.h.value = t / 512
  4934. },
  4935. addBlur: function(e) {
  4936. e = Math.max(e, h.currentBlur),
  4937. h.blur(e)
  4938. },
  4939. removeBlur: function(e) {
  4940. e = Math.min(1 - e, h.currentBlur),
  4941. h.blur(e)
  4942. }
  4943. };
  4944. h.blur(0),
  4945. t.exports = h
  4946. }
  4947. , {
  4948. "./enum/PlayerEvents": 40,
  4949. "./enum/Viewmode": 51,
  4950. "./settings": 166,
  4951. "./util/transitions": 195,
  4952. three: 217
  4953. }],
  4954. 17: [function(e, t, i) {
  4955. "use strict";
  4956. t.exports = {
  4957. UNKNOWN: 0,
  4958. ALIGNED: 1,
  4959. UNALIGNED: 2,
  4960. PLACED: 3
  4961. }
  4962. }
  4963. , {}],
  4964. 18: [function(e, t, i) {
  4965. "use strict";
  4966. t.exports = {
  4967. NONE: 0,
  4968. MIDDLE: 1,
  4969. END: 2,
  4970. BEGINNING: 3,
  4971. FADEIN: 4
  4972. }
  4973. }
  4974. , {}],
  4975. 19: [function(e, t, i) {
  4976. "use strict";
  4977. var n = e("three");
  4978. t.exports = {
  4979. newBlue: new n.Color(4967932),
  4980. altBlue: new n.Color(47355),
  4981. tagDefault: new n.Color(223357),
  4982. classicBlue: new n.Color(53759),
  4983. mpYellow: new n.Color(16502016),
  4984. mpOrange: new n.Color(16428055),
  4985. mpBlue: new n.Color(12096),
  4986. mpLtGrey: new n.Color(13751252),
  4987. mpDkGrey: new n.Color(10000019),
  4988. mpRed: new n.Color(12525854),
  4989. mpOrangeDesat: new n.Color(16764529),
  4990. mpBlueDesat: new n.Color(4034734),
  4991. mpRedDesat: new n.Color(14705505),
  4992. white: new n.Color(16777215),
  4993. black: new n.Color(0),
  4994. _desat: function(e, t) {
  4995. var i = t || .3
  4996. , r = (new n.Color).copy(e).getHSL();
  4997. return (new n.Color).setHSL(r.h, r.s * (1 - i), r.l)
  4998. },
  4999. _darken: function(e, t) {
  5000. var i = t || .2
  5001. , r = e.getHSL();
  5002. return (new n.Color).setHSL(r.h, r.s, r.l * (1 - i))
  5003. }
  5004. }
  5005. }
  5006. , {
  5007. three: 217
  5008. }],
  5009. 20: [function(e, t, i) {
  5010. "use strict";
  5011. t.exports = {
  5012. NONE: -1,
  5013. ROTATE: 0,
  5014. DOLLY: 1,
  5015. PAN: 2,
  5016. ROTATE_DOLLY: 3,
  5017. PAN_DOLLY: 4
  5018. }
  5019. }
  5020. , {}],
  5021. 21: [function(e, t, i) {
  5022. "use strict";
  5023. t.exports = {
  5024. Move: "move",
  5025. InteractionDirect: "interaction.direct",
  5026. InteractionKey: "interaction.key",
  5027. InteractionGui: "interaction.gui",
  5028. FlyInDirection: "fly.direction",
  5029. InputStart: "input.start",
  5030. Pinch: "input.pinch",
  5031. Scroll: "input.scroll",
  5032. AutoPanInterrupt: "autopan.interrupt",
  5033. AutoPanComplete: "autopan.complete",
  5034. AutoPanClamped: "autopan.clamped",
  5035. LongTap: "longtap"
  5036. }
  5037. }
  5038. , {}],
  5039. 22: [function(e, t, i) {
  5040. "use strict";
  5041. t.exports = Object.freeze({
  5042. FORWARD: "FORWARD",
  5043. LEFT: "LEFT",
  5044. RIGHT: "RIGHT",
  5045. BACK: "BACK",
  5046. UP: "UP",
  5047. DOWN: "DOWN"
  5048. })
  5049. }
  5050. , {}],
  5051. 23: [function(e, t, i) {
  5052. "use strict";
  5053. t.exports = {
  5054. ActionInterrupted: "action.interrupted",
  5055. TourStart: "tour.start",
  5056. TourEnd: "tour.end",
  5057. StartModeChange: "mode.startChange"
  5058. }
  5059. }
  5060. , {}],
  5061. 24: [function(e, t, i) {
  5062. "use strict";
  5063. t.exports = Object.freeze({
  5064. None: 0,
  5065. Queued: 1,
  5066. ForceQueued: 2,
  5067. Downloading: 3,
  5068. Downloaded: 4,
  5069. DownloadFailed: 5
  5070. })
  5071. }
  5072. , {}],
  5073. 25: [function(e, t, i) {
  5074. "use strict";
  5075. t.exports = {
  5076. GL_TEXTURE_CUBE_MAP_POSITIVE_X: 0,
  5077. GL_TEXTURE_CUBE_MAP_NEGATIVE_X: 1,
  5078. GL_TEXTURE_CUBE_MAP_POSITIVE_Y: 2,
  5079. GL_TEXTURE_CUBE_MAP_NEGATIVE_Y: 3,
  5080. GL_TEXTURE_CUBE_MAP_POSITIVE_Z: 4,
  5081. GL_TEXTURE_CUBE_MAP_NEGATIVE_Z: 5
  5082. }
  5083. }
  5084. , {}],
  5085. 26: [function(e, t, i) {
  5086. "use strict";
  5087. t.exports = {
  5088. Texture2D: 0,
  5089. TextureCube: 1
  5090. }
  5091. }
  5092. , {}],
  5093. 27: [function(e, t, i) {
  5094. "use strict";
  5095. t.exports = {
  5096. SMALL: "small",
  5097. LARGE: "large"
  5098. }
  5099. }
  5100. , {}],
  5101. 28: [function(e, t, i) {
  5102. "use strict";
  5103. var n = e("./Viewmode")
  5104. , r = {
  5105. LANDING: {},
  5106. NAVIGATION: "navigation",
  5107. MORE_HELP: "moreHelp",
  5108. TOUR_INTERACTION: {}
  5109. };
  5110. r.LANDING[n.PANORAMA] = "panorama.landing",
  5111. r.LANDING[n.OUTDOOR] = "outdoor.landing",
  5112. r.LANDING[n.DOLLHOUSE] = "dollhouse.landing",
  5113. r.LANDING[n.FLOORPLAN] = "floorplan.landing",
  5114. r.TOUR_INTERACTION.standard = "standard.tour",
  5115. r.TOUR_INTERACTION[n.OUTDOOR] = "outdoor.tour",
  5116. r.TOUR_INTERACTION[n.FLOORPLAN] = "floorplan.tour",
  5117. t.exports = r
  5118. }
  5119. , {
  5120. "./Viewmode": 51
  5121. }],
  5122. 29: [function(e, t, i) {
  5123. "use strict";
  5124. var n = {
  5125. UP: 1,
  5126. DOWN: -1,
  5127. LEFT: "L",
  5128. RIGHT: "R",
  5129. FORWARD: "F",
  5130. BACK: "B",
  5131. reverse: {},
  5132. opposite: function(e) {
  5133. return this.reverse[e.toString()]
  5134. }
  5135. };
  5136. !function() {
  5137. n.reverse[n.UP] = n.DOWN,
  5138. n.reverse[n.DOWN] = n.UP,
  5139. n.reverse[n.LEFT] = n.RIGHT,
  5140. n.reverse[n.RIGHT] = n.LEFT,
  5141. n.reverse[n.FORWARD] = n.BACK,
  5142. n.reverse[n.BACK] = n.FORWARD
  5143. }(),
  5144. t.exports = n
  5145. }
  5146. , {}],
  5147. 30: [function(e, t, i) {
  5148. "use strict";
  5149. var n = e("../util/browser")
  5150. , r = {
  5151. ZERO: 48,
  5152. ONE: 49,
  5153. TWO: 50,
  5154. THREE: 51,
  5155. FOUR: 52,
  5156. FIVE: 53,
  5157. SIX: 54,
  5158. SEVEN: 55,
  5159. EIGHT: 56,
  5160. NINE: 57,
  5161. LEFTARROW: 37,
  5162. UPARROW: 38,
  5163. RIGHTARROW: 39,
  5164. DOWNARROW: 40,
  5165. A: 65,
  5166. B: 66,
  5167. C: 67,
  5168. D: 68,
  5169. E: 69,
  5170. F: 70,
  5171. G: 71,
  5172. H: 72,
  5173. I: 73,
  5174. J: 74,
  5175. K: 75,
  5176. L: 76,
  5177. M: 77,
  5178. N: 78,
  5179. O: 79,
  5180. P: 80,
  5181. Q: 81,
  5182. R: 82,
  5183. S: 83,
  5184. T: 84,
  5185. U: 85,
  5186. V: 86,
  5187. W: 87,
  5188. X: 88,
  5189. Y: 89,
  5190. Z: 90,
  5191. SPACE: 32,
  5192. RETURN: 13,
  5193. SEMICOLON: 186,
  5194. PLUSEQUALS: 187,
  5195. DASHUNDERSCORE: 189,
  5196. OPENBRACKET: 219
  5197. };
  5198. n.detectFirefox() && (r.SEMICOLON = 59,
  5199. r.PLUSEQUALS = 61,
  5200. r.DASHUNDERSCORE = 173),
  5201. t.exports = r
  5202. }
  5203. , {
  5204. "../util/browser": 182
  5205. }],
  5206. 31: [function(e, t, i) {
  5207. "use strict";
  5208. t.exports = {
  5209. EN_US: "en-US",
  5210. ES_MX: "es-MX",
  5211. FR_FR: "fr-FR",
  5212. DE_DE: "de-DE",
  5213. RU_RU: "ru-RU",
  5214. CN_CN: "cn-CN",
  5215. JP_JP: "jp-JP"
  5216. }
  5217. }
  5218. , {}],
  5219. 32: [function(e, t, i) {
  5220. "use strict";
  5221. t.exports = {
  5222. TagActivated: "tag.activated",
  5223. TagDismissed: "tag.dismissed",
  5224. TagNavigation: "tag.navigation"
  5225. }
  5226. }
  5227. , {}],
  5228. 33: [function(e, t, i) {
  5229. "use strict";
  5230. t.exports = {
  5231. ModelAdded: "model-added",
  5232. ActiveModelChanged: "active-model-changed"
  5233. }
  5234. }
  5235. , {}],
  5236. 34: [function(e, t, i) {
  5237. "use strict";
  5238. t.exports = {
  5239. LEFT: 0,
  5240. MIDDLE: 1,
  5241. RIGHT: 2
  5242. }
  5243. }
  5244. , {}],
  5245. 35: [function(e, t, i) {
  5246. "use strict";
  5247. t.exports = {
  5248. PanoRenderComplete: "panorama.render.complete",
  5249. TileRenderFailure: "panorama.tile.render.failed",
  5250. TileRenderSuccess: "panorama.tile.render.success",
  5251. TileUploadAttempted: "panorama.tile.upload.attempted",
  5252. UploadAttemptedForAllTiles: "panorama.upload.attempted.all.tiles",
  5253. ZoomLevelRenderStarted: "panorama.zoom.render.started"
  5254. }
  5255. }
  5256. , {}],
  5257. 36: [function(e, t, i) {
  5258. "use strict";
  5259. t.exports = {
  5260. BASE: 1,
  5261. STANDARD: 2,
  5262. HIGH: 3,
  5263. ULTRAHIGH: 4
  5264. }
  5265. }
  5266. , {}],
  5267. 37: [function(e, t, i) {
  5268. "use strict";
  5269. t.exports = {
  5270. LoadComplete: "panorama.load.complete",
  5271. LoadFailed: "panorama.load.failed",
  5272. TileLoaded: "panorama.tile.loaded"
  5273. }
  5274. }
  5275. , {}],
  5276. 38: [function(e, t, i) {
  5277. "use strict";
  5278. t.exports = Object.freeze({
  5279. Standard: 0,
  5280. Slow: 1,
  5281. Retain: 2
  5282. })
  5283. }
  5284. , {}],
  5285. 39: [function(e, t, i) {
  5286. "use strict";
  5287. t.exports = Object.freeze({
  5288. Show: 0,
  5289. Hide: 1,
  5290. Retain: 2
  5291. })
  5292. }
  5293. , {}],
  5294. 40: [function(e, t, i) {
  5295. "use strict";
  5296. t.exports = {
  5297. Move: "move",
  5298. MoveComplete: "move.complete",
  5299. ModeChanged: "mode.changed",
  5300. ModeChanging: "mode.changing",
  5301. PanoChosen: "pano.chosen",
  5302. ClosestPanoChanging: "closest.pano.changing",
  5303. WarpStarted: "warp.started",
  5304. WarpInterrupted: "warp.interrupted",
  5305. WarpEnded: "warp.ended",
  5306. FlyinFinished: "flyin.finished",
  5307. FlyingStarted: "flying.started",
  5308. FlyingInterrupted: "flying.interrupted",
  5309. FlyingEnded: "flying.ended",
  5310. Ready: "ready",
  5311. StartInside: "start.inside",
  5312. StartOutside: "start.outside",
  5313. ViewChanged: "view.changed",
  5314. WarpInterruptedWithFlyTo: "warp.interrupted.flyto",
  5315. InputStart: "input.start"
  5316. }
  5317. }
  5318. , {}],
  5319. 41: [function(e, t, i) {
  5320. "use strict";
  5321. t.exports = Object.freeze({
  5322. DEFAULT: 0,
  5323. PANOMARKERS: 1,
  5324. RETICULE: 2,
  5325. TAG: 3
  5326. })
  5327. }
  5328. , {}],
  5329. 42: [function(e, t, i) {
  5330. "use strict";
  5331. t.exports = {
  5332. visibleFloor: 1,
  5333. ghostFloor: 3,
  5334. boundingSkybox: 1,
  5335. panoMarker: 2,
  5336. reticule: 3,
  5337. tagStem: 4,
  5338. tagDisc: 5,
  5339. ribbon: 100
  5340. }
  5341. }
  5342. , {}],
  5343. 43: [function(e, t, i) {
  5344. "use strict";
  5345. t.exports = {
  5346. ContextCreated: "scene-renderer-context-created",
  5347. AfterRender: "after-render",
  5348. MemoryUsageUpdated: "scene-renderer-memory-usage-updated"
  5349. }
  5350. }
  5351. , {}],
  5352. 44: [function(e, t, i) {
  5353. "use strict";
  5354. t.exports = {
  5355. IDLE: "idle",
  5356. BROWSE: "browse",
  5357. EXAMINE: "examine"
  5358. }
  5359. }
  5360. , {}],
  5361. 45: [function(e, t, i) {
  5362. "use strict";
  5363. t.exports = {
  5364. TileDownloadSuccess: "tiledownloader.download.success",
  5365. TileDownloadFailure: "tiledownloader.download.failure",
  5366. PanoDownloadComplete: "tiledownloader.pano.download.complete"
  5367. }
  5368. }
  5369. , {}],
  5370. 46: [function(e, t, i) {
  5371. "use strict";
  5372. t.exports = {
  5373. CardboardAndroid: "googlevr",
  5374. GearVR: "gearvr",
  5375. CardboardIOS: "googlevrios",
  5376. Cardboard: "googlevr"
  5377. }
  5378. }
  5379. , {}],
  5380. 47: [function(e, t, i) {
  5381. "use strict";
  5382. t.exports = {
  5383. NONE: 0,
  5384. CONTEXTUAL: 1,
  5385. ANDROID: 2
  5386. }
  5387. }
  5388. , {}],
  5389. 48: [function(e, t, i) {
  5390. "use strict";
  5391. var n = {
  5392. Title: 0,
  5393. Cardboard: 1
  5394. }
  5395. , r = {
  5396. Title: 0,
  5397. Cardboard: 1,
  5398. Gear: 2
  5399. };
  5400. !function() {
  5401. [n, r].forEach(function(e) {
  5402. e.pageCount = Object.keys(e).length
  5403. })
  5404. }(),
  5405. t.exports.ios = n,
  5406. t.exports.standard = r
  5407. }
  5408. , {}],
  5409. 49: [function(e, t, i) {
  5410. "use strict";
  5411. t.exports = {
  5412. Android: "android",
  5413. IOS: "ios",
  5414. Desktop: "desktop",
  5415. UnsupportedAndroid: "android-unsupported"
  5416. }
  5417. }
  5418. , {}],
  5419. 50: [function(e, t, i) {
  5420. "use strict";
  5421. var n = e("three");
  5422. t.exports = {
  5423. UP: new n.Vector3(0,1,0),
  5424. DOWN: new n.Vector3(0,-1,0),
  5425. LEFT: new n.Vector3(-1,0,0),
  5426. RIGHT: new n.Vector3(1,0,0),
  5427. FORWARD: new n.Vector3(0,0,-1),
  5428. BACK: new n.Vector3(0,0,1)
  5429. }
  5430. }
  5431. , {
  5432. three: 217
  5433. }],
  5434. 51: [function(e, t, i) {
  5435. "use strict";
  5436. var n = e("../exception/ViewmodeConvertException")
  5437. , r = e("./coreViewmodes")
  5438. , o = e("../util/common")
  5439. , a = {
  5440. MESH: "mesh",
  5441. OUTDOOR: "outdoor",
  5442. TRANSITIONING: "transitioning",
  5443. toInt: function(e) {
  5444. switch (e) {
  5445. case this.PANORAMA:
  5446. return 1;
  5447. case this.DOLLHOUSE:
  5448. return 2;
  5449. case this.FLOORPLAN:
  5450. return 3;
  5451. case this.OUTDOOR:
  5452. return 4;
  5453. case this.TRANSITIONING:
  5454. return -1
  5455. }
  5456. throw new n("No known conversion for Viewmode to int for mode: " + e)
  5457. },
  5458. fromInt: function(e) {
  5459. switch (e) {
  5460. case "1":
  5461. case 1:
  5462. return this.PANORAMA;
  5463. case "2":
  5464. case 2:
  5465. return this.DOLLHOUSE;
  5466. case "3":
  5467. case 3:
  5468. return this.FLOORPLAN;
  5469. case "4":
  5470. case 4:
  5471. return this.OUTDOOR
  5472. }
  5473. throw new n("No known conversion for int to viewmode for int: " + e)
  5474. },
  5475. convertWorkshopModeInt: function(e) {
  5476. switch (e) {
  5477. case "0":
  5478. case 0:
  5479. case undefined: //xzw add
  5480. return this.PANORAMA;
  5481. case "1":
  5482. case 1:
  5483. return this.FLOORPLAN;
  5484. case "2":
  5485. case 2:
  5486. return this.DOLLHOUSE;
  5487. case "3":
  5488. case 3:
  5489. return this.MESH
  5490. }
  5491. throw new n("No known conversion for Workshop int to viewmode for int: " + e)
  5492. }
  5493. };
  5494. o.extendObject(a, r),
  5495. t.exports = a
  5496. }
  5497. , {
  5498. "../exception/ViewmodeConvertException": 58,
  5499. "../util/common": 185,
  5500. "./coreViewmodes": 54
  5501. }],
  5502. 52: [function(e, t, i) {
  5503. "use strict";
  5504. t.exports = {
  5505. BLACK: "black",
  5506. STD: "std",
  5507. WALK: "walk"
  5508. }
  5509. }
  5510. , {}],
  5511. 53: [function(e, t, i) {
  5512. "use strict";
  5513. t.exports = {
  5514. ZoomIn: "zoom.in",
  5515. ZoomOut: "zoom.out",
  5516. ZoomMax: "zoom.max",
  5517. ZoomMin: "zoom.min"
  5518. }
  5519. }
  5520. , {}],
  5521. 54: [function(e, t, i) {
  5522. "use strict";
  5523. t.exports = {
  5524. PANORAMA: "panorama",
  5525. DOLLHOUSE: "dollhouse",
  5526. FLOORPLAN: "floorplan"
  5527. }
  5528. }
  5529. , {}],
  5530. 55: [function(e, t, i) {
  5531. "use strict";
  5532. function n(e) {
  5533. this.message = e
  5534. }
  5535. t.exports = n
  5536. }
  5537. , {}],
  5538. 56: [function(e, t, i) {
  5539. "use strict";
  5540. function n(e) {
  5541. r.call(this, e)
  5542. }
  5543. var r = e("./BasicException");
  5544. n.prototype = Object.create(r.prototype),
  5545. t.exports = n
  5546. }
  5547. , {
  5548. "./BasicException": 55
  5549. }],
  5550. 57: [function(e, t, i) {
  5551. "use strict";
  5552. function n(e) {
  5553. r.call(this, e)
  5554. }
  5555. var r = e("./BasicException");
  5556. n.prototype = Object.create(r.prototype),
  5557. t.exports = n
  5558. }
  5559. , {
  5560. "./BasicException": 55
  5561. }],
  5562. 58: [function(e, t, i) {
  5563. "use strict";
  5564. function n(e) {
  5565. r.call(this, e)
  5566. }
  5567. var r = e("./BasicException");
  5568. n.prototype = Object.create(r.prototype),
  5569. t.exports = n
  5570. }
  5571. , {
  5572. "./BasicException": 55
  5573. }],
  5574. 59: [function(e, t, i) {
  5575. (function(i) {
  5576. "use strict";
  5577. function n(e) {
  5578. var t = {};
  5579. if (e) {
  5580. var i = e.flags;
  5581. if (i)
  5582. for (var n in i)
  5583. i.hasOwnProperty(n) && (t[i[n]] = !0);
  5584. return t
  5585. }
  5586. return l.debug("Feature flags -> parseFeatureFlags: rawData is null."),
  5587. null
  5588. }
  5589. var r = e("./util/ajax")
  5590. , o = e("./util/showcase")
  5591. , a = e("./util/logger")
  5592. , s = ""
  5593. , l = new a(i)
  5594. , c = {};
  5595. t.exports = {
  5596. loadFeatureFlags: function(e) {
  5597. var t = $.Deferred();
  5598. return r.get(e.urlBase + s, {
  5599. responseType: "json",
  5600. prefetchFrom: "user",
  5601. auth: o.getAuthorizationHeader()
  5602. }).done(function(e) {
  5603. c = n(e),
  5604. c ? t.resolve(c) : t.reject("loading-failed")
  5605. }).fail(function() {
  5606. l.debug("Retrieval of feature flags failed."),
  5607. t.reject("loading-failed")
  5608. }),
  5609. t.promise()
  5610. },
  5611. getFlags: function() {
  5612. return c
  5613. },
  5614. updateDependentSettings: function(e, t) {
  5615. e = e || c,
  5616. e.labels && (t.labels.enabled = !0),
  5617. e.zooming && !t.zoom.forceOff && (t.zoom.enabled = !0),
  5618. e.showcase_sdk && (t.sdkInit = !0),
  5619. e.mobile_highq_override && (t.tiling.mobileHighQualityOverride = !0),
  5620. e.showcase_webvr && (t.vr.allowWebVR = !0),
  5621. e.uhql && (t.tiling.allowUltraHighResolution = !0),
  5622. e.hide_sc_sharing && (t.share.enabled = !1)
  5623. }
  5624. }
  5625. }
  5626. ).call(this, "/js/featureflags.js")
  5627. }
  5628. , {
  5629. "./util/ajax": 181,
  5630. "./util/logger": 189,
  5631. "./util/showcase": 193
  5632. }],
  5633. 60: [function(e, t, i) {
  5634. "use strict";
  5635. var n = (e("../util/common"),
  5636. {
  5637. status: 0,
  5638. set: function(e) {
  5639. if (isNaN(e))
  5640. return !1;
  5641. var t = $('.progressbar');
  5642. 0 > e && (e = 0);
  5643. e > 100 && (e = 100);
  5644. var width = parseInt(t.css('width').replace("px",""))/100; //获取进度条总长度除以100
  5645. var barperc = e*width;
  5646. var perc = Math.round(e);
  5647. var labelpos = (parseInt(barperc)-15);
  5648. t.find('.bar').css('width',barperc); //已经再跑颜色的百分比
  5649. t.find('.label').css('left', labelpos); //上面跟着的字的百分比
  5650. t.find('.perc').text(perc+'%'); //具体数字的百分比
  5651. this.status = e
  5652. },
  5653. done: function(e) {
  5654. return e || this.status ? (this.status = null,
  5655. this.set(100)) : this
  5656. }
  5657. });
  5658. t.exports.circleLoader = n
  5659. }
  5660. , {
  5661. "../util/common": 185
  5662. }],
  5663. 61: [function(e, t, i) {
  5664. "use strict";
  5665. t.exports = Object.freeze({
  5666. CLOSE: "modal.closer.close"
  5667. })
  5668. }
  5669. , {}],
  5670. 62: [function(e, t, i) {
  5671. "use strict";
  5672. function n(e, t) {
  5673. t && (t.stopPropagation(),
  5674. t.preventDefault()),
  5675. e && this.emit(l.CLOSE, e),
  5676. g.reset()
  5677. }
  5678. function r(e, t) {
  5679. function i() {
  5680. var t = e.offsetHeight >= $("#player").height() && e.offsetWidth >= $("#player").width();
  5681. t !== f && (f = t,
  5682. t ? (e.classList.add("closeByFooter"),
  5683. h.classList.add("closeByFooter")) : (e.classList.remove("closeByFooter"),
  5684. h.classList.remove("closeByFooter")))
  5685. }
  5686. t ? setTimeout(i, o.guiAnimationSpeed) : i()
  5687. }
  5688. var o = e("../../settings")
  5689. , a = (e("../../tag/Media/MediaEvent"),
  5690. e("../../util/browser"))
  5691. , s = e("../../util/common")
  5692. , l = e("./ModalCloserEvent")
  5693. , c = e("events").EventEmitter
  5694. , h = document.getElementsByClassName("footer")[0]
  5695. , u = h.querySelectorAll(".close")[0]
  5696. , d = null
  5697. , p = null
  5698. , f = null
  5699. , g = (a.isMobile(),
  5700. {
  5701. open: function(e) {
  5702. e && (r(e),
  5703. d && u.removeEventListener("click", d, !0),
  5704. d = n.bind(this, e.id),
  5705. u.addEventListener("click", d, !0),
  5706. p && window.removeEventListener("resize", p, !0),
  5707. p = r.bind(this, e),
  5708. window.addEventListener("resize", p, !0))
  5709. },
  5710. reset: function() {
  5711. h.classList.remove("closeByFooter"),
  5712. u.removeEventListener("click", d, !0),
  5713. window.removeEventListener("resize", p, !0),
  5714. d = p = f = null
  5715. }
  5716. });
  5717. s.extendObject(g, c.prototype),
  5718. t.exports = g
  5719. }
  5720. , {
  5721. "../../tag/Media/MediaEvent": 131,
  5722. "../../settings": 166,
  5723. "../../util/browser": 182,
  5724. "../../util/common": 185,
  5725. "./ModalCloserEvent": 61,
  5726. events: 202
  5727. }],
  5728. 63: [function(e, t, i) {
  5729. "use strict";
  5730. function n(e, t, i) {
  5731. var n = new r.GUI({
  5732. width: 400
  5733. })
  5734. , u = n.addFolder("Flydown from Dollhouse");
  5735. u.add(h.flydown, "movementEasing", Object.keys(a)),
  5736. u.add(h.flydown, "movementDelay", 0, 1).step(.01),
  5737. u.add(h.flydown, "rotationEasing", Object.keys(a)),
  5738. u.add(h.flydown, "rotationDelay", 0, 1).step(.01),
  5739. u.add(h.flydown, "modelTextureDelay", 0, 1).step(.01),
  5740. u.add(h.flydown, "skyboxDelay", 0, 1).step(.01),
  5741. u.add(h.dollhouseDefault, "minPolarAngle", 0, o.Math.degToRad(50)),
  5742. u.add(h.dollhouseDefault, "maxPolarAngle", o.Math.degToRad(50), o.Math.degToRad(170));
  5743. var d = n.addFolder("Transition between panos");
  5744. d.add(h.transition, "blur", 0, 10).onFinishChange(function() {}),
  5745. d.add(h.transition, "flySpeed", 0, 10).step(.01).onFinishChange(function() {
  5746. h.transition.flyTime = 0,
  5747. d.__controllers.forEach(function(e) {
  5748. e.updateDisplay()
  5749. })
  5750. }),
  5751. d.add(h.transition, "flyTime", 0, 5e3).onFinishChange(function() {
  5752. h.transition.flySpeed = 0,
  5753. d.__controllers.forEach(function(e) {
  5754. e.updateDisplay()
  5755. })
  5756. }),
  5757. d.add(h.transition, "aimTime", 500, 2500).step(50),
  5758. d.add(h.transition, "aimSlowFactor", 1, 3).step(.1),
  5759. d.add(h.transition, "movementEasing", Object.keys(a));
  5760. var p = n.addFolder("Path Display");
  5761. p.add(h.path, "opacity", 0, 1).step(.01).onFinishChange(function() {}),
  5762. p.add(h.path, "height", 0, .2).step(.01).onFinishChange(function() {}),
  5763. p.add(h.path, "outsideHeight", 0, 2).step(.01).onFinishChange(function() {}),
  5764. p.add(h.path, "ribbonWidth", .01, .35).step(.01).onFinishChange(function() {}),
  5765. p.add(h.path, "waypointRadius", .01, 1.2).step(.01).onFinishChange(function() {}),
  5766. p.add(h.path, "waypointPulse", 0, 3600).step(20).onFinishChange(function() {}),
  5767. p.add(h.path, "waypointIndoorRadius", .01, 1.2).step(.01).onFinishChange(function() {}),
  5768. p.add(h.path, "fadeInTime", 0, 1200).step(10).onFinishChange(function() {}),
  5769. p.add(h.path, "fadeOutTime", 0, 1200).step(10).onFinishChange(function() {}),
  5770. p.add(h.path, "color", Object.keys(l)).onFinishChange(function() {
  5771. h.path.color = l[h.path.color],
  5772. h.path.colorUp = l._desat(h.path.color),
  5773. h.path.colorDown = l.darken(h.path.color)
  5774. }),
  5775. p.add(h, "reticuleColor", Object.keys(l)).onFinishChange(function() {
  5776. h.reticuleColor = l[h.reticuleColor]
  5777. });
  5778. var f = n.addFolder("Warping")
  5779. , g = f.addFolder("Warp/Teleport");
  5780. g.add(h.warp, "softPushDist", 0, 2).onFinishChange(function() {}),
  5781. g.add(h.warp, "softPushEnd", 0, 1).step(.01).onFinishChange(function() {}),
  5782. g.add(h.warp, "softBendAngle", 0, 45).onFinishChange(function() {}),
  5783. g.add(h.warp, "softBendTilt", 0, 45).onFinishChange(function() {}),
  5784. g.add(h.warp, "softBendEnd", 0, 1).step(.01).onFinishChange(function() {}),
  5785. g.add(h.warp, "burnsAngle", 0, 30).onFinishChange(function() {}),
  5786. g.add(h.warp, "minBurnsAngle", 0, 10).onFinishChange(function() {}),
  5787. g.add(h.warp, "brakeStrength", 1, 8).onFinishChange(function() {}),
  5788. g.add(h.warp, "minBrakeAngle", 0, 5).step(.01).onFinishChange(function() {}),
  5789. g.add(h.warp, "maxBrakeAngle", 0, 5).step(.01).onFinishChange(function() {}),
  5790. g.add(h.path, "mapGuides").onFinishChange(function() {}),
  5791. g.add(h.warp, "teleportTime", 0, 5e3).step(10).onFinishChange(function() {}),
  5792. g.add(h.warp, "outsideTime", 0, 5e3).step(10).onFinishChange(function() {}),
  5793. g.add(h.path, "typ", Object.keys(c)).onFinishChange(function() {
  5794. h.path.typ = c[h.path.typ]
  5795. }),
  5796. g.add(h.warp, "loop").onChange(function() {}).onFinishChange(function() {
  5797. t.endlessLoop = h.warp.loop
  5798. }),
  5799. g.add(h.warp, "walkSlideShowThreshhold", 1, 1e4).step(1).onFinishChange(function() {}),
  5800. g.add(h.warp, "walkExtraPanosDistance", 0, 3).step(.1).onFinishChange(function() {}),
  5801. g.add(h.transition, "fastForwardFactor", 1, 10).step(1).onFinishChange(function() {});
  5802. var m = f.addFolder("Long Warp Only");
  5803. m.add(h.warp, "minWarpTime", 0, 5e3).step(10).onFinishChange(function() {
  5804. h.warp.flySpeed = 0,
  5805. m.__controllers.forEach(function(e) {
  5806. e.updateDisplay()
  5807. })
  5808. }),
  5809. m.add(h.warp, "timePerMeter", 0, 5e3).step(10).onFinishChange(function() {}),
  5810. m.add(h.warp, "lookAheadMax", .01, 1).step(.01).onFinishChange(function() {}),
  5811. m.add(h.warp, "lookAheadDist", .01, 4).step(.01).onFinishChange(function() {}),
  5812. m.add(h.warp, "maxTurnPerSec", 0, 720).step(1).onFinishChange(function() {}),
  5813. m.add(h.warp, "maxAimPerSec", 0, 720).step(1).onFinishChange(function() {}),
  5814. m.add(h.warp, "turnFriction", 0, 1).step(.01).onFinishChange(function() {}),
  5815. m.add(h.warp, "walkDelay", 0, 2e3).step(10).onFinishChange(function() {}),
  5816. m.add(h.transition, "flytimeMaxDistanceThreshold", 0, 25).step(10).onFinishChange(function() {}),
  5817. m.add(h.warp, "walkMaxDist", 0, 100).step(1).onFinishChange(function() {});
  5818. var v = n.addFolder("Warp Esoterica");
  5819. v.add(h.warp, "nearPanoDist", .01, 12).step(0).onFinishChange(function() {}),
  5820. v.add(h.warp, "blur", .01, 1).onFinishChange(function() {}),
  5821. v.add(h.warp, "flySpeed", 0, 10).step(.01).onFinishChange(function() {
  5822. h.warp.minWarpTime = 0,
  5823. v.__controllers.forEach(function(e) {
  5824. e.updateDisplay()
  5825. })
  5826. }),
  5827. v.add(h.warp, "showBunny").onFinishChange(function() {}),
  5828. v.add(h.warp, "fastTime", 0, 2500).step(10).onFinishChange(function() {}),
  5829. v.add(h.warp, "movementEasing", Object.keys(a));
  5830. var A = n.addFolder("Misc");
  5831. A.add(h, "dollhouseFOV", 10, 180).onChange(function() {
  5832. i.cameras[s.DOLLHOUSE].fov = h.dollhouseFOV
  5833. }),
  5834. A.add(h, "insideFOV", 10, 180).onChange(function() {
  5835. i.cameras[s.PANORAMA].fov = h.insideFOV
  5836. }),
  5837. A.add(h, "insideLookSpeed", .01, .3).step(.01).onChange(function() {}),
  5838. A.add(h, "rotationAccelerationInside", .1, 10).step(.1).onChange(function() {}),
  5839. A.add(h, "rotationAccelerationOutside", .1, 10).step(.1).onChange(function() {});
  5840. var y = n.addFolder("Navigation");
  5841. y.add(h.navigation, "panoScores").onFinishChange(function() {
  5842. h.navigation.panoScores || e.panos.forEach(function(e) {
  5843. e.floor.remove(e.text3d),
  5844. e.text3d = null
  5845. })
  5846. }),
  5847. y.add(h.navigation, "mouseDirection"),
  5848. y.add(h.navigation, "filterStrictness", 0, 1),
  5849. y.add(h.navigation, "angleFactor", -60, 0),
  5850. y.add(h.navigation, "directionFactor", 1, 20),
  5851. y.add(h.navigation, "distanceFactor", -5, 5),
  5852. y.add(h.navigation, "optionalityFactor", .1, 10);
  5853. var C = n.addFolder("tags")
  5854. , I = C.addFolder("Tag Creation");
  5855. I.add(h.tags.pole, "enabled").name("poleEnabled"),
  5856. I.add(h.tags.pole, "height", 0, 2.5).step(.01).name("poleHeight"),
  5857. I.add(h.tags.pole, "width", 1, 10).step(1).name("poleWidth"),
  5858. I.add(h.tags.pole, "opacity", .1, 1).step(.1).name("poleOpacity");
  5859. var E = C.addFolder("Visibility");
  5860. E.add(h.tags.visibility, "anyDistance"),
  5861. E.add(h.tags.visibility, "visibleDistance", .1, 30).step(.1),
  5862. E.add(h.tags.visibility, "cameraClearance", 0, 1).step(.01),
  5863. E.add(h.tags.visibility, "hideViaFloor"),
  5864. E.add(h.tags.visibility, "hideOffScreenDisc").name("hideEdgeDisc"),
  5865. E.add(h.tags.visibility, "hideOffScreenObject").name("hideEdgeObject");
  5866. var b = C.addFolder("Disc Parameters");
  5867. b.add(h.tags.disc.scale, "nearBound", .1, 10).step(.1),
  5868. b.add(h.tags.disc.scale, "farBound", .1, 20).step(.1).listen(),
  5869. b.add(h.tags.disc.scale, "linkFarBound").onChange(function(e) {
  5870. e && (h.tags.disc.scale.farBound = h.tags.visibility.visibleDistance * (1 - h.tags.disc.scale.linkPercent / 100))
  5871. }),
  5872. b.add(h.tags.disc.scale, "linkPercent", 0, 100).step(1).onChange(function(e) {
  5873. h.tags.disc.scale.linkFarBound && (h.tags.disc.scale.farBound = h.tags.visibility.visibleDistance * (1 - e / 100))
  5874. }),
  5875. b.add(h.tags.disc.scale, "maxSize", 40, 200).step(1),
  5876. b.add(h.tags.disc.scale, "minSize", 20, 100).step(1),
  5877. b.add(h.tags.disc.scale, "responsiveness", 0, 100).step(1);
  5878. var w = C.addFolder("Navigate");
  5879. w.add(h.tags.navigate, "nearestPano").name("nearestPano"),
  5880. w.add(h.tags.navigate, "lineOfSight").name("lineOfSight"),
  5881. w.add(h.tags.navigate, "reactivate").name("reactivate"),
  5882. w.add(h.tags.navigate, "aimAt", ["disc", "object", "pole", "nothing"]).name("aim at"),
  5883. w.add(h.tags.navigate, "tiltTolerance", 0, 50).step(1),
  5884. w.add(h.tags.navigate, "rotateSpeedFactor", 0, 5).step(.1);
  5885. var _ = n.addFolder("Debug");
  5886. _.add(h, "wireframe").onFinishChange(function() {
  5887. e.chunks.forEach(function(t) {
  5888. t.material && (t.wireframeTwin || (t.wireframeTwin = new o.WireframeHelper(t),
  5889. t.wireframeTwin.material.depthWrite = !1,
  5890. t.wireframeTwin.material.depthTest = !1,
  5891. t.wireframeTwin.material.opacity = .5,
  5892. t.wireframeTwin.material.transparent = !0),
  5893. h.wireframe ? e.add(t.wireframeTwin) : e.remove(t.wireframeTwin))
  5894. })
  5895. }),
  5896. _.add(h, "skyboxWireframe").onFinishChange(function() {
  5897. h.skyboxWireframe ? (e.skybox.wireframe = new o.WireframeHelper(e.skybox),
  5898. e.add(e.skybox.wireframe)) : (e.remove(e.skybox.wireframe),
  5899. e.skybox.wireframe = null)
  5900. }),
  5901. _.add(h, "showSweeps").onFinishChange(function() {
  5902. e.setSweepVisibility(h.showSweeps)
  5903. }),
  5904. _.add(h, "showMesh").onFinishChange(function() {
  5905. e.chunks.forEach(function(e) {
  5906. e.visible = h.showMesh
  5907. })
  5908. }),
  5909. _.add(h, "showFloors").onFinishChange(function() {
  5910. e.floors.forEach(function(e) {
  5911. e.collider.children.forEach(function(e) {
  5912. e.material.visible = h.showFloors
  5913. })
  5914. })
  5915. }),
  5916. _.add(h, "showSkyboxes").onFinishChange(function() {
  5917. e.panos.forEach(function(e) {
  5918. e.skyboxMesh.visible = h.showSkyboxes
  5919. })
  5920. }),
  5921. _.add(h, "showNeighbors").onChange(function() {}),
  5922. _.add(e, "alpha", 0, 1)
  5923. }
  5924. var r = e("../lib/dat.gui")
  5925. , o = e("three")
  5926. , a = e("../util/easing")
  5927. , s = e("../enum/Viewmode")
  5928. , l = e("../enum/Colors")
  5929. , c = e("../enum/WarpStyle")
  5930. , h = e("../settings");
  5931. e("../tag/tag");
  5932. r.GUI.prototype.removeFolder = function(e) {
  5933. var t = this.__folders[e];
  5934. t && (t.close(),
  5935. this.__ul.removeChild(t.domElement.parentNode),
  5936. delete this.__folders[e],
  5937. this.onResize())
  5938. }
  5939. ,
  5940. t.exports.toggle = n
  5941. }
  5942. , {
  5943. "../enum/Colors": 19,
  5944. "../enum/Viewmode": 51,
  5945. "../enum/WarpStyle": 52,
  5946. "../lib/dat.gui": 93,
  5947. "../tag/tag": 123,
  5948. "../settings": 166,
  5949. "../util/easing": 186,
  5950. three: 217
  5951. }],
  5952. 64: [function(e, t, i) {
  5953. (function(i) {
  5954. "use strict";
  5955. function n(e, t, i, n) {
  5956. $(".gui-error .error-problem-text").text(e),
  5957. $(".gui-error .error-solution-text").text(t),
  5958. $(".gui-error .error-explanation").text(i),
  5959. $(".gui-error .error-actions").html(n),
  5960. $(window).resize(),
  5961. $(".gui-error").fadeIn(),
  5962. $("#bottom-logo").fadeIn()
  5963. }
  5964. function r(e) {
  5965. 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("");
  5966. n(e, h.ERROR_BROWSER_SOLUTION, h.ERROR_BROWSER_EXPLANATION, t),
  5967. s.isMobile() || $("[rel=tiletip]").tooltip({
  5968. placement: "bottom",
  5969. delay: {
  5970. show: 50,
  5971. hide: 0
  5972. },
  5973. trigger: "hover",
  5974. viewport: {
  5975. selector: "body",
  5976. padding: 10
  5977. }
  5978. })
  5979. }
  5980. function o() {
  5981. var e = s.isMobile() ? "" : '<span class="link install-browser">' + h.ERROR_GENERIC_ACTIONS_2 + "</span>" + h.ERROR_GENERIC_ACTIONS_3
  5982. , t = [h.ERROR_GENERIC_ACTIONS_1, e,].join("");
  5983. n(h.ERROR_GENERIC_PROBLEM, h.ERROR_GENERIC_SOLUTION, "", t),
  5984. s.isMobile() || $(".install-browser").on("click touchstart", function(e) {
  5985. e.preventDefault(),
  5986. e.stopPropagation(),
  5987. r(" ")
  5988. })
  5989. }
  5990. function a(e) {
  5991. if ($("head title").text(c.pageTitle),
  5992. $("#gui-message, #gui-loading, #nprogress, #gui-thumb, #bottom-logo").hide(),
  5993. $("#gui-loading").fadeOut(250),
  5994. $("#quick-blackout").hide(),
  5995. l.track("showcase_error", {
  5996. error_key: e
  5997. }),
  5998. h.locale || h.init(),
  5999. "webgl-unsupported" === e)
  6000. s.isMobile() ? o() : r(h.ERROR_WEBGL_UNSUPPORTED_PROBLEM);
  6001. else if ("webgl-ios" === e)
  6002. 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>.");
  6003. else if ("webgl-safari" === e)
  6004. 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>.");
  6005. else if ("webgl-generic" === e)
  6006. o();
  6007. else if ("missing-urls" === e)
  6008. n(h.ERROR_MISSING_URLS_PROBLEM, "", h.ERROR_MISSING_URLS_EXPLANATION);
  6009. else if ("loading-failed" === e)
  6010. 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>.");
  6011. else {
  6012. if ("loading-failed-maintenance" !== e)
  6013. return void d.error("Unhandled error: " + e);
  6014. n(h.ERROR_MAINTENANCE_PROBLEM, h.ERROR_MAINTENANCE_SOLUTION)
  6015. }
  6016. }
  6017. var s = e("./../util/browser")
  6018. , l = e("./../analytics")
  6019. , c = e("./../settings")
  6020. , h = e("../localization/localize")
  6021. , u = e("./../util/logger")
  6022. , d = new u(i)
  6023. , p = '"https://support.port.com/hc/articles/208220058"';
  6024. t.exports.error = a
  6025. }
  6026. ).call(this, "/js/gui/error.js")
  6027. }
  6028. , {
  6029. "../localization/localize": 108,
  6030. "./../analytics": 4,
  6031. "./../settings": 166,
  6032. "./../util/browser": 182,
  6033. "./../util/logger": 189
  6034. }],
  6035. 65: [function(e, t, i) {
  6036. (function(i) {
  6037. "use strict";
  6038. function n() {
  6039. Ue = [],
  6040. je.floors.visible && Ue.push(".gui-floor", ".gui-floor-title"),
  6041. Ue.push(".hideTarget", ".pinTop.right")
  6042. }
  6043. function r() {
  6044. for (var e in je)
  6045. if (je.hasOwnProperty(e)) {
  6046. var t = je[e];
  6047. if (!t.visible)
  6048. for (var i = 0; i < t.elements.length; i++)
  6049. $(t.elements[i]).hide()
  6050. }
  6051. je.highlight.visible && $(".pinBottom").addClass("highlightExists"),
  6052. je.tourControls.visible === !1 && $("#drawer").addClass("fullWidth"),
  6053. n()
  6054. }
  6055. function o(e, t) {
  6056. var i = !K.isMobile() && Q.zoom.enabled && t.mode === _e.PANORAMA && !e.tourIsPlaying;
  6057. $("#gui-zoomin").toggle(i),
  6058. $("#gui-zoomout").toggle(i)
  6059. }
  6060. function a() {
  6061. c(),
  6062. $(".pinBottom").toggleClass("open"),
  6063. $("#drawer").toggleClass("open"),
  6064. $(".footer").toggleClass("open"),
  6065. $("#drawer").hasClass("open") ? ($("#pullTab .icon").attr("data-original-title", Re.CLOSE_HIGHLIGHTS),
  6066. Ze("highlights")) : ($("#pullTab .icon").attr("data-original-title", Re.OPEN_HIGHLIGHTS),
  6067. ie.resetDrawer()),
  6068. setTimeout(function() {
  6069. $("#pullTab").toggleClass("opened");
  6070. }, $("#drawer").hasClass("open") ? 0 : Q.highlightAnimationDuration),
  6071. $(".pinBottom").hasClass("open") && s($(".vr-popup")) && $(".vr-popup").is(":visible") && Ae.dismiss()
  6072. }
  6073. function s(e) {
  6074. var t;
  6075. "none" !== e.css("display") ? t = e.position().top + e.outerHeight() : (e.attr("style", "visibility: hidden"),
  6076. t = e.position().top + e.outerHeight(),
  6077. e.attr("style", "display: none"));
  6078. var i = $("#player").outerHeight()
  6079. , n = i - 130;
  6080. return n < t + 25
  6081. }
  6082. function l(e) {
  6083. "touchstart" === e.type && e.preventDefault(),
  6084. e.stopPropagation()
  6085. }
  6086. function c() {
  6087. W && (W.reload(),
  6088. W.init())
  6089. }
  6090. function h(e) {
  6091. ne.show(e),
  6092. r()
  6093. }
  6094. function u(e) {
  6095. ne.progress(e)
  6096. }
  6097. function d(e, t, i) {
  6098. var n = t.player;
  6099. $("#gui-thumb").fadeOut(2500),
  6100. ne.hide(function() {
  6101. Ge = !1
  6102. }),
  6103. me.init(e, i),
  6104. de.finishSetup(Object.keys(e.tags).length),
  6105. i.on(Te.IMAGE_OPENED, Ze.bind(this, "tag"));
  6106. var s = function() {
  6107. i.dismissExaminedTag(),
  6108. i.disableHovering()
  6109. };
  6110. Ae.on(ye.OPENED, s),
  6111. Ce.on(Me.OPENED, s),
  6112. he.on(ue.OPENED, s),
  6113. fe.on(ge.OPENED, s);
  6114. var l = i.enableHovering.bind(i);
  6115. if (Ae.on(ye.CLOSED, l),
  6116. Ce.on(Me.CLOSED, l),
  6117. he.on(ue.CLOSED, l),
  6118. fe.on(ge.CLOSED, l),
  6119. Q.labels.enabled && Object.keys(e.labels).length,
  6120. e.floors.length <= 1 || !je.floors.visible ? je.floors.visible = !1 : (y(e, t),
  6121. C(e.currentFloor, n.mode)),
  6122. r(),
  6123. o(t, t.player),
  6124. $("#gui").fadeIn(1500),
  6125. je.highlight.visible && (2 !== Q.startHighlights || e.has360Views) && setTimeout(function() {
  6126. a(),
  6127. (!e.has360Views && 1 !== Q.startHighlights || e.has360Views && 0 === Q.startHighlights) && setTimeout(a, 2e3)
  6128. }, 2e3),
  6129. !K.isMobile())
  6130. for (var c = ["a", "#title-toggle", ".next-button", ".prev-button", ".gui-floor", ".meta-toggle", ".thumbImg", "logo-button"], h = 0; h < c.length; h++)
  6131. $(c[h]).addClass("hasHover");
  6132. O(e),
  6133. de.setupToggling();
  6134. //xzw:
  6135. window.editHotPanel && editHotPanel();
  6136. //czj
  6137. navBorderRadius(e);
  6138. //czj 编辑界面
  6139. //window.EditingInterface && new EditingInterface(n.sceneRenderer);
  6140. window.EditTools && new EditTools(n.sceneRenderer);
  6141. }
  6142. function navBorderRadius(e){
  6143. var pullTab = $("#pullTab"),
  6144. mobileRadius = {
  6145. "bottom":{"border-bottom-left-radius":"10px","border-bottom-right-radius":"10px"},
  6146. "top":{"border-top-left-radius":"10px","border-top-right-radius":"10px"}
  6147. },
  6148. topRadius = {
  6149. "bottom":{"border-top-right-radius":"10px","border-bottom-right-radius":"10px"},
  6150. "top":{"border-bottom-left-radius":"10px","border-top-left-radius":"10px"}
  6151. };
  6152. function BorderRadius(bottom,top){
  6153. $("#gui-modes-map > div:visible:last").css(bottom);
  6154. if(pullTab.is(':visible')){
  6155. $(".viewContainer > div:visible:first").css(top);
  6156. }else{
  6157. $("#gui-modes-map > div:visible:first").css(top);
  6158. }
  6159. }
  6160. if(/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)){
  6161. BorderRadius(mobileRadius.bottom,mobileRadius.top);
  6162. }else{
  6163. BorderRadius(topRadius.bottom,topRadius.top);
  6164. }
  6165. //判断someData里面是否有special字段,如果有就会处理这些特殊的大场景
  6166. if(window.MP_PREFETCHED_MODELDATA.model.special || window.MP_PREFETCHED_MODELDATA.special === "true"){
  6167. window.specialScene && specialScene.special().afterImplement();
  6168. }
  6169. }
  6170. function p(e) {
  6171. e || (e = 0),
  6172. We = !1,
  6173. window.setTimeout(function() {
  6174. We || (ze = !0,
  6175. $("#gui-spinner").stop(!0, !0).show())
  6176. }
  6177. .bind(this), e)
  6178. }
  6179. function f() {
  6180. $("#gui-spinner").stop(!0, !0),
  6181. $("#gui-spinner").fadeOut(1e3),
  6182. We = !0,
  6183. ze = !1
  6184. }
  6185. function g(e, t) {
  6186. var i = e.mode
  6187. , n = t || e.currentPano;
  6188. $("#gui-modes-dollhouse").toggleClass("active", i === _e.DOLLHOUSE),
  6189. $("#gui-modes-floorplan").toggleClass("active", i === _e.FLOORPLAN),
  6190. $("#gui-modes-inside").toggleClass("active", i === _e.PANORAMA),
  6191. i === _e.PANORAMA ? ($("#view-controllers").slideUp(500),
  6192. Q.show360Views.enabled && !n.isAligned() ? (
  6193. $(".gui-floor").addClass("hidden"),
  6194. $("#gui-modes-outside").addClass("desktop-only")) : (
  6195. $(".gui-floor").removeClass("hidden"),
  6196. $("#gui-modes-outside").removeClass("desktop-only")),
  6197. $("#gui-modes-outside").removeClass("hidden")) : i !== _e.TRANSITIONING && (f(),
  6198. Be = i,
  6199. $("#gui-modes-outside").addClass("hidden"),
  6200. e.model.has360Views && $(".gui-floor").removeClass("hidden"),
  6201. $("#view-controllers").is(":visible") || $("#view-controllers").slideDown(Q.guiAnimationSpeed))
  6202. }
  6203. function m(e, t) {
  6204. var i = t.player;
  6205. $("#gui-modes-inside").on("mousedown touchstart", function(e) {
  6206. l(e),
  6207. J.updateInteraction(Se.InteractionGui, "inside-button"),
  6208. J.track("USER", {
  6209. event_type: "showcase_gui",
  6210. gui_action: "click_inside_mode_button"
  6211. }),
  6212. t.changeMode(_e.PANORAMA);
  6213. }),
  6214. $("#gui-modes-outside").find("a").on("click", function(e) {
  6215. l(e),
  6216. J.track("showcase_gui", {
  6217. gui_action: "click_outside_mode_button"
  6218. }),
  6219. t.changeMode(Be)
  6220. }),
  6221. $("#gui-modes-floorplan").on("click", function(e) {
  6222. l(e),
  6223. i.mode !== _e.FLOORPLAN && (J.track("showcase_gui", {
  6224. gui_action: "click_floorplan_mode_button"
  6225. }),
  6226. t.changeMode(_e.FLOORPLAN));
  6227. }),
  6228. $("#gui-modes-dollhouse").on("click", function(e) {
  6229. l(e),
  6230. i.mode !== _e.DOLLHOUSE && (J.track("showcase_gui", {
  6231. gui_action: "click_dollhouse_mode_button"
  6232. }),
  6233. t.changeMode(_e.DOLLHOUSE));
  6234. })
  6235. }
  6236. function v(e, t) {
  6237. function i() {
  6238. document.getElementById("vr").classList.remove("hidden"),
  6239. Q.vr.allowWebVR ? K.getVRDisplay().then(function(e) {
  6240. K.supportsFullscreen() ? n(e) : (De.warn("Unable to use WebVR when full screen is not supported"),
  6241. $(".improper-embed").toggleClass("hidden", !1),
  6242. r())
  6243. }, function(e) {
  6244. r()
  6245. }) : r()
  6246. }
  6247. function n(i) {
  6248. De.info(i.displayName + " detected, VR button activates WebVR experience"),
  6249. Ie.init(e.data, t, i, q),
  6250. Ie.on(Ee.OPENED, Ze.bind(gui, "vr")),
  6251. Ie.on(Ee.SHOW_TERMS, fe.show.bind(fe))
  6252. }
  6253. function r() {
  6254. De.info("WebVR support not found, VR button activates native app VR modal"),
  6255. Ae.init(e.data, q),
  6256. Ae.on(ye.OPENED, function() {
  6257. var e = document.getElementById("vr-modal");
  6258. return function() {
  6259. Ze("vr"),
  6260. le.open(e)
  6261. }
  6262. }()),
  6263. Ae.on(ye.CLOSED, le.reset)
  6264. }
  6265. if (Q.vr.enabled && e.supportsVR && !K.valueFromHash("mls", 0))
  6266. switch (Q.vr.option) {
  6267. case Pe.CONTEXTUAL:
  6268. i();
  6269. break;
  6270. case Pe.ANDROID:
  6271. K.detectAndroid() && i();
  6272. break;
  6273. case Pe.NONE:
  6274. }
  6275. }
  6276. function A(e, t) {
  6277. $("#play").find("a").on("mousedown touchstart", function(e) {
  6278. l(e);
  6279. Ze("tour");
  6280. ve.play();
  6281. J.trackAlways("showcase_gui", {
  6282. gui_action: "play_highlights"
  6283. })
  6284. }),
  6285. $("#pause").find("a").on("mousedown touchstart", function(e) {
  6286. l(e),
  6287. ve.pause(),
  6288. J.trackAlways("showcase_gui", {
  6289. gui_action: "pause_highlights"
  6290. })
  6291. }),
  6292. $("#gui-zoomin").find("a").on("click", function(e) {
  6293. l(e),
  6294. t.player.zoomInIncrementally()
  6295. }),
  6296. $("#gui-zoomout").find("a").on("click", function(e) {
  6297. l(e),
  6298. t.player.zoomOutIncrementally()
  6299. })
  6300. }
  6301. function y(e, t) {
  6302. for (var i = $(".gui-floor"), n = 0; n < e.floors.length; n++) {
  6303. var r = $('<div class="floorChoice" data-index="' + n + '"></div>').text(e.floors.get(n).name);
  6304. $(".gui-floor").find(".container").prepend(r)
  6305. //cxz 本来一开始是prepend 后来改了append 按顺序插入
  6306. }
  6307. i.find(".container").prepend('<div class="floorChoice darkGlass allFloorBtn" data-index="all" style="display:none">' + Re.FLOOR_ALL + "</div>"),
  6308. i.on("click", function(e) {
  6309. l(e),
  6310. Ze("floor"),
  6311. i.toggleClass("open")
  6312. }),
  6313. $(".floorChoice").on("click", function(e) {
  6314. l(e);
  6315. var n = $(this).data("index");
  6316. "all" !== n ? (J.updateInteraction(Se.InteractionGui, "floor-control"),
  6317. t.player.gotoFloor(n),
  6318. J.track("showcase_gui", {
  6319. gui_action: "click_floor_select_button",
  6320. interaction_source: "gui"
  6321. })) : (J.updateInteraction(Se.InteractionGui, "floor-control"),
  6322. Ze("move"),
  6323. t.allFloors(),
  6324. J.track("showcase_gui", {
  6325. gui_action: "click_toggle_all_floors_button",
  6326. interaction_source: "gui"
  6327. })),
  6328. i.removeClass("open")
  6329. })
  6330. }
  6331. function C(e, t) {
  6332. e && (t === _e.DOLLHOUSE || t === _e.FLOORPLAN ? ($(".allFloorBtn").show(),$(".gui-floor-icon").hide(),$(".gui-floor-title").show()) : ($(".allFloorBtn").hide(),$(".gui-floor-icon").show(),$(".gui-floor-title").hide()),
  6333. e.model.allFloorsVisible ? ($(".gui-floor-title").text(Re.FLOOR_ALL),
  6334. $(".gui-floor-number").text(Re.FLOOR_ALL),
  6335. $(".floorChoice").removeClass("active"),
  6336. $('.floorChoice[data-index="all"]').addClass("active")) : ($(".gui-floor-title").text(e.name),
  6337. $(".gui-floor-number").text(" " + (e.floorIndex + 1)),
  6338. $(".floorChoice").removeClass("active"),
  6339. $(".floorChoice[data-index=" + e.floorIndex + "]").addClass("active")))
  6340. }
  6341. function I(e) {
  6342. return e.describe().inTransition
  6343. }
  6344. function E(e) {
  6345. $("<img/>").attr("src", e).on("load", function() {
  6346. $("#gui-thumb").css("backgroundImage", "url(" + e + ")").fadeIn(500),
  6347. $(this).remove()
  6348. })
  6349. }
  6350. function b(e, t, i) {
  6351. Fe = e.heroLocations.length;
  6352. var n = '<li class="thumbImg" data-index=""><img src=""></li>'
  6353. , r = 100 / Fe + "%"
  6354. , o = $("#thumb-container")
  6355. , a = $("#progressBar");
  6356. $("#status").find(".totalSteps").text(Fe);
  6357. for (var s = 0; s < Fe; s++) {
  6358. var c = e.heroLocations[s]
  6359. , h = $(n);
  6360. if (h.attr("data-index", s),
  6361. je.highlight.visible && h.find("img").attr("src", c.thumbUrl),
  6362. c.name) {
  6363. var u = $('<div class="overlay"></div>').text(c.name);
  6364. h.prepend(u)
  6365. }
  6366. if (e.has360Views && c.cameraMode === _e.PANORAMA) {
  6367. var d = e.panos.get(c.panoId)
  6368. , p = d && !d.isAligned()
  6369. , 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>';
  6370. h.prepend(f)
  6371. }
  6372. o.append(h),
  6373. a.append('<div class="step" data-idx="' + s + '" style="width:' + r + '"></div>')
  6374. }
  6375. j = 144 * Fe,
  6376. Y = 111 * Fe,
  6377. $(".thumbImg").on("mouseover", function() {
  6378. I(t) || i.showPathToHeroLocation($(this).data("index"))
  6379. }),
  6380. $(".thumbImg").on("mouseout", function() {
  6381. t.clearPath()
  6382. }),
  6383. $(".thumbImg").on("click", function(e) {
  6384. l(e);
  6385. var i = $(this);
  6386. J.updateInteraction(Se.InteractionGui, "thumbnail"),
  6387. J.trackAlways("showcase_gui", {
  6388. gui_action: "click_highlight"
  6389. }),
  6390. t.goToHighlight(i.data("index"))
  6391. }),
  6392. $(".previous").find("a").on("click", function(e) {
  6393. l(e),
  6394. J.trackAlways("showcase_gui", {
  6395. gui_action: "prev_highlight"
  6396. }),
  6397. t.prevHighlight()
  6398. }),
  6399. $(".next").find("a").on("click", function(e) {
  6400. l(e),
  6401. J.trackAlways("showcase_gui", {
  6402. gui_action: "next_highlight"
  6403. }),
  6404. t.nextHighlight()
  6405. }),
  6406. $("#drawer").on("mouseleave", function(e) {
  6407. l(e);
  6408. var t;
  6409. try {
  6410. t = new MouseEvent("mouseup",{
  6411. clientX: e.clientX,
  6412. clientY: e.clientY,
  6413. screenX: e.screenX,
  6414. screenY: e.screenY
  6415. })
  6416. } catch (i) {
  6417. t = document.createEvent("MouseEvents"),
  6418. 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)
  6419. }
  6420. document.dispatchEvent(t)
  6421. }),
  6422. W = new Sly($("#scrollFrame"),{
  6423. horizontal: !0,
  6424. itemNav: "centered",
  6425. smart: !0,
  6426. scrollTrap: !0,
  6427. scrollBy: 1,
  6428. mouseDragging: !0,
  6429. touchDragging: !0,
  6430. speed: 300,
  6431. dragHandle: !0,
  6432. dynamicHandle: !0,
  6433. clickBar: !0,
  6434. scrollBar: $("#scroller"),
  6435. activateOn: null
  6436. }).init(),
  6437. W.on("active", function(e, t) {
  6438. Ve = t,
  6439. Ze("tour"),
  6440. $(".step").removeClass("active"),
  6441. $("#status").find(".curIdx").text(t + 1);
  6442. for (var i = 0; i <= t; i++)
  6443. $("#progressBar").find("[data-idx='" + i + "']").addClass("active")
  6444. }),
  6445. w()
  6446. }
  6447. function w() {
  6448. var e = $("#player").width() - 20
  6449. , t = $("#scroller")
  6450. , i = $("#drawer")
  6451. , n = $(".pinBottom");
  6452. if ($("#player").width() < 488 || $("#player").height() < 488)
  6453. t.addClass("hidden"),
  6454. i.addClass("noScroll"),
  6455. n.addClass("noScroll");
  6456. else {
  6457. var r = j > e
  6458. , o = !i.hasClass("noScroll")
  6459. , a = r !== o;
  6460. a && (t.toggleClass("hidden"),
  6461. i.toggleClass("noScroll"),
  6462. n.toggleClass("noScroll"))
  6463. }
  6464. }
  6465. function _(e) {
  6466. je.tourControls.visible = e.tour_buttons && K.valueFromHash("gt", 1),
  6467. je.coBrand.visible = e.presented_by && 1 !== Q.specialEdition && Q.brand && !K.valueFromHash("mls", !1),
  6468. je.highlight.visible = e.highlight_reel && 1 !== Q.specialEdition && Q.showHighlights
  6469. }
  6470. function T(e) {
  6471. function t(t, i) {
  6472. return !!e.player_options[t] && e[i || t]
  6473. }
  6474. $(".model-title").text(e.name);
  6475. var i = Q.pageTitle;
  6476. // 2 !== K.valueFromHash("mls", 0) && (i = e.name + " - " + i),
  6477. 2 !== K.valueFromHash("mls", 0) && (i = e.name),
  6478. document.title = i,
  6479. K.isMobile() ? $("#gui-fullscreen").css("display", "none") : ($("[rel=tooltip]").tooltip({
  6480. delay: {
  6481. show: 50,
  6482. hide: 0
  6483. },
  6484. trigger: "hover",
  6485. html: !1,
  6486. viewport: {
  6487. selector: "body",
  6488. padding: 10
  6489. }
  6490. }),
  6491. K.inIframe() && document.getElementsByClassName("pinBottom-container")[0].classList.add("embed")),
  6492. // 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"),
  6493. de.populate({
  6494. name: t("model_name", "name"),
  6495. coBrand: t("presented_by"),
  6496. description: t("model_summary", "summary") || "暂无内容",
  6497. contactName: t("contact_name"),
  6498. address: t("address"),
  6499. phone: t("contact_phone"),
  6500. formattedPhone: e.formatted_contact_phone,
  6501. email: t("contact_email"),
  6502. url: t("external_url"),
  6503. socialSharing: e.enable_social_sharing && e.is_public
  6504. })
  6505. }
  6506. function x(e, t, i, n, r, o) {
  6507. function a() {
  6508. o.setLoadingStartTime(),
  6509. H(),
  6510. r ? (re.showMessage(t, i, je.coBrand.visible),
  6511. l()) : h(l)
  6512. }
  6513. var s = $.Deferred()
  6514. , l = s.resolve.bind(s);
  6515. return Ge = !0,
  6516. O(e),
  6517. e.data.player_options && _(e.data.player_options),
  6518. 1 === Q.specialEdition && $("body").addClass("specialEdition"),
  6519. Re.localizeGUI(),
  6520. T(e.data),
  6521. r || $(".quick").addClass("hidden"),
  6522. e.data.image && !r && E(e.data.image),
  6523. n ? (J.impression(),
  6524. a()) : (o.setWaitingStartTime(),
  6525. oe.show(r, a)),
  6526. s
  6527. }
  6528. function S(e, t, i, n, r, a, s) {
  6529. q = s,
  6530. e.outsideAllowed() || $("#gui-modes-outside").addClass("invisible"),
  6531. e.supportedModes[_e.PANORAMA] || $("#gui-modes-inside").addClass("invisible"),
  6532. ae.init(),
  6533. re.init(e, a),
  6534. Oe.init(e, t, n),
  6535. $(".icon").on("mouseover", function() {
  6536. t.player && t.player.reticule.hide()
  6537. }),
  6538. m(e, t),
  6539. A(e, t),
  6540. e.data.enable_social_sharing && e.data.is_public && Q.share.enabled && (Ce.init(e.data.name),
  6541. Ce.on(Me.OPENED, function() {
  6542. var e = document.getElementById("share-modal");
  6543. return function() {
  6544. Ze("share"),
  6545. le.open(e)
  6546. }
  6547. }()),
  6548. Ce.on(Me.CLOSED, le.reset)),
  6549. e.heroLocations.length > 1 ? b(e, t, i) : (je.highlight.visible = !1,
  6550. je.tourControls.visible = !1),
  6551. de.on(pe.OPEN_INFO, Ze.bind(this, "info")),
  6552. z(),
  6553. g(i),
  6554. v(e, r),
  6555. e.on("floor.changed", C),
  6556. e.on("waiting", R.bind(this, e)),
  6557. e.on("waiting-done", P.bind(this, e)),
  6558. i.on(xe.ModeChanged, function(e, n) {
  6559. g(i),
  6560. o(t, i),
  6561. n === _e.PANORAMA && i.currentPano && !i.currentPano.isAligned() && (n = _e.OUTDOOR),
  6562. he.updateMode(n)
  6563. }),
  6564. n.on(Se.Move, Ze.bind(this, "move")),
  6565. i.on(xe.Ready, function() {
  6566. ie.init(n, i, i.tagManager, t),
  6567. i.on(xe.ModeChanged, function(e, t) {
  6568. e !== t && $(".vr-popup").is(":visible") && Ae.dismiss()
  6569. })
  6570. }),
  6571. i.on(xe.PanoChosen, function(e, t) {
  6572. g(i, t),
  6573. he.updateMode(t && !t.isAligned() ? _e.OUTDOOR : _e.PANORAMA)
  6574. }),
  6575. le.on(ce.CLOSE, function(e) {
  6576. switch (e) {
  6577. case "vr-modal":
  6578. Ae.dismiss();
  6579. break;
  6580. case "share-modal":
  6581. Ce.hide();
  6582. break;
  6583. case "terms-modal":
  6584. fe.hide()
  6585. }
  6586. });
  6587. var l = $("#play").eq(0)
  6588. , c = $("#pause").eq(0)
  6589. , h = $(".pinBottom").toArray()
  6590. , u = $("#drawer").eq(0)
  6591. , d = $("#playHead").eq(0)
  6592. , p = $("#progressBar").eq(0)
  6593. , f = $("#thumb-container").eq(0)
  6594. , y = f.children()
  6595. , I = p.children();
  6596. t.on("update.controls", function() {
  6597. var n = t.describe();
  6598. n.tourIsPlaying || i.isWarping() ? (je.tourControls.visible && (l.hide(),
  6599. c.show()),
  6600. n.tourInProgress && (h.forEach(function(e) {
  6601. e.classList.add("playing")
  6602. }),
  6603. u.addClass("playing"),
  6604. d.addClass("playing"))) : (je.tourControls.visible && (l.show(),
  6605. c.hide()),
  6606. n.tourInProgress || (ve.stopTour(),
  6607. h.forEach(function(e) {
  6608. e.classList.remove("playing")
  6609. }),
  6610. u.removeClass("playing"),
  6611. d.removeClass("playing")));
  6612. var r, a, s;
  6613. if (null !== n.currentItem) {
  6614. var p, f;
  6615. $("#status").find(".curIdx").text(n.currentItem + 1),
  6616. n.onTheBus ? (p = "active",
  6617. f = "recent") : (f = "active",
  6618. p = "recent");
  6619. var g = null === n.destinationItem || n.currentItem === n.destinationItem;
  6620. for (r = 0; r < e.heroLocations.length; r += 1)
  6621. s = y.eq(r),
  6622. a = I.eq(r),
  6623. s.removeClass(f),
  6624. a.removeClass(f),
  6625. n.onTheBus && r === n.destinationItem ? (s.addClass(p),
  6626. a.addClass(p),
  6627. W.activate(r)) : n.onTheBus && g && r === n.currentItem ? (s.addClass(p),
  6628. a.addClass(p)) : (s.removeClass(p),
  6629. a.removeClass(p))
  6630. } else
  6631. for (r = 0; r < e.heroLocations.length; r += 1)
  6632. s = y.eq(r),
  6633. a = I.eq(r),
  6634. s.removeClass("active recent"),
  6635. a.removeClass("active recent");
  6636. o(t, i)
  6637. }),
  6638. document.addEventListener("keydown", function(n) {
  6639. switch (J.updateInteraction(Se.InteractionKey),
  6640. n.which) {
  6641. case we.ZERO:
  6642. Q.debug && e.toggleAlpha();
  6643. break;
  6644. case we.NINE:
  6645. Q.debug && se.toggle();
  6646. break;
  6647. case we.ONE:
  6648. i.isInMode(_e.TRANSITIONING) || t.changeMode(_e.PANORAMA);
  6649. break;
  6650. case we.TWO:
  6651. e.outsideAllowed() && !i.isInMode(_e.DOLLHOUSE, _e.TRANSITIONING) && t.changeMode(_e.DOLLHOUSE);
  6652. break;
  6653. case we.THREE:
  6654. e.outsideAllowed() && !i.isInMode(_e.FLOORPLAN, _e.TRANSITIONING) && t.changeMode(_e.FLOORPLAN);
  6655. break;
  6656. case we.FOUR:
  6657. i.isInMode(_e.TRANSITIONING) || t.changeMode(_e.OUTDOOR);
  6658. break;
  6659. case we.SPACE:
  6660. je.tourControls.visible && ($("#playHead").hasClass("playing") || Ze("tour"));
  6661. break;
  6662. case we.RETURN:
  6663. Q.debug && e.toggleExplodeUp();
  6664. break;
  6665. case we.P:
  6666. k();
  6667. break;
  6668. case we.U:
  6669. B();
  6670. break;
  6671. case we.X:
  6672. Q.debug && e.toggleExplode();
  6673. break;
  6674. case we.PLUSEQUALS:
  6675. t.player.activatePersistentZooming(!0),
  6676. ie.hideUi();
  6677. break;
  6678. case we.DASHUNDERSCORE:
  6679. t.player.activatePersistentZooming(!1),
  6680. ie.hideUi();
  6681. break;
  6682. case we.SEVEN:
  6683. De.info("Zoom level: " + t.player.zoomLevel + ", FOV: " + t.player.zoomFov);
  6684. break;
  6685. case we.EIGHT:
  6686. t.player.decreaseZoomSpeed();
  6687. break;
  6688. case we.NINE:
  6689. t.player.increaseZoomSpeed()
  6690. }
  6691. return i && i.reticule.hide(),
  6692. !0
  6693. }
  6694. .bind(this)),
  6695. document.addEventListener("keyup", function(e) {
  6696. switch (e.which) {
  6697. case we.PLUSEQUALS:
  6698. t.player.deactivatePersistentZooming();
  6699. break;
  6700. case we.DASHUNDERSCORE:
  6701. t.player.deactivatePersistentZooming()
  6702. }
  6703. }
  6704. .bind(this)),
  6705. F(e),
  6706. L(e, t.player),
  6707. M(i),
  6708. te.setAutoPlay(e.heroCount()),
  6709. he.init(i, a.mode),
  6710. he.on(ue.OPENED, Ze.bind(this, "help")),
  6711. fe.init(),
  6712. fe.on(ge.OPENED, function() {
  6713. var e = document.getElementById("terms-modal");
  6714. return function() {
  6715. Ze("terms"),
  6716. le.open(e)
  6717. }
  6718. }()),
  6719. fe.on(ge.CLOSED, le.reset),
  6720. Q.quickstart.enabled || re.delayLanding(a.mode).then(re.showMessage.bind(this, i, t, je.coBrand.visible)),
  6721. (Q.quickstart.enabled || i.model.outsideAllowed()) && ie.init(n, i, i.tagManager, t),
  6722. Q.profiling.enabled && se.show(),
  6723. ve.init(t)
  6724. }
  6725. function M(e) {
  6726. var t = function(e, t) {
  6727. $(e).find("a").each(function(e, i) {
  6728. t ? $(i).removeClass("buttonZoomDisabled").addClass("buttonZoomEnabled") : $(i).addClass("buttonZoomDisabled").removeClass("buttonZoomEnabled"),
  6729. i.style.pointerEvents = t ? "auto" : "none"
  6730. })
  6731. }
  6732. , i = function() {
  6733. e.zoomLevel >= Q.zoom.max ? t("#gui-zoomin", !1) : t("#gui-zoomin", !0),
  6734. e.zoomLevel <= Q.zoom.min ? t("#gui-zoomout", !1) : t("#gui-zoomout", !0)
  6735. };
  6736. e.on(Ne.ZoomMax, function() {
  6737. t("#gui-zoomin", !1),
  6738. t("#gui-zoomout", !0)
  6739. }),
  6740. e.on(Ne.ZoomMin, function() {
  6741. t("#gui-zoomin", !0),
  6742. t("#gui-zoomout", !1)
  6743. }),
  6744. e.on(Ne.ZoomIn, function() {
  6745. t("#gui-zoomout", !0)
  6746. }),
  6747. e.on(Ne.ZoomOut, function() {
  6748. t("#gui-zoomin", !0)
  6749. }),
  6750. i()
  6751. }
  6752. function R(e) {
  6753. O(e)
  6754. }
  6755. function P(e) {
  6756. O(e)
  6757. }
  6758. function O(e) {
  6759. var t = e.waitQueue.length;
  6760. t <= 0 ? f() : Ge || p(Q.modelComponentLoadSpinnerDelay)
  6761. }
  6762. function L(e, t) {
  6763. He = {
  6764. gui: null,
  6765. visible: !1,
  6766. model: e,
  6767. player: t
  6768. }
  6769. }
  6770. function D(e, t) {
  6771. function i() {
  6772. var i = t.toJSON();
  6773. n.linkToLocation = window.location.protocol + "//" + window.location.host + window.location.pathname + "?m=" + e.sid + "&start=" + be.serialize(i),
  6774. t.tagManager.activeTag && (n.linkToLocation += "&tag=" + t.tagManager.activeTag.sid)
  6775. }
  6776. var n = {}
  6777. , r = new Le.GUI({
  6778. autoPlace: !0,
  6779. width: "60%"
  6780. });
  6781. i(),
  6782. t.on(xe.ViewChanged, i),
  6783. r.add(n, "linkToLocation").name(Re.LINK_TO_LOCATION).listen(),
  6784. r.domElement.id = "datLinks";
  6785. var o = [].slice.call(r.domElement.querySelectorAll(".property-name"));
  6786. return o.forEach(function(e) {
  6787. if (!K.detectSafari()) {
  6788. var t = document.createElement("button");
  6789. t.classList.add("btn-deep-link"),
  6790. t.innerText = Re.MENU_COPY,
  6791. e.nextSibling.appendChild(t);
  6792. var i = function() {
  6793. alert(Re.LINK_ALERT_COPY),
  6794. t.hide()
  6795. };
  6796. t.addEventListener("click", function(e) {
  6797. try {
  6798. var t = e.target.parentNode.childNodes[0];
  6799. t.select();
  6800. var n = document.execCommand("copy");
  6801. t.blur(),
  6802. n || i()
  6803. } catch (e) {
  6804. i()
  6805. }
  6806. })
  6807. }
  6808. }),
  6809. $(r.__closeButton).hide(),
  6810. r
  6811. }
  6812. function N(e) {
  6813. He.gui || (He.gui = D(He.model, He.player)),
  6814. He.visible = e,
  6815. e ? $(He.gui.domElement).show() : $(He.gui.domElement).hide()
  6816. }
  6817. function B() {
  6818. N(!He.visible)
  6819. }
  6820. function F(e) {
  6821. ke = {
  6822. gui: null,
  6823. visible: !1,
  6824. model: e
  6825. }
  6826. }
  6827. function V(e) {
  6828. var t = new Le.GUI;
  6829. return t.add(Q, "showSweeps").name("Show sweeps").onFinishChange(function() {
  6830. e.setSweepVisibility(Q.showSweeps)
  6831. }),
  6832. t.add(Q, "rotationAccelerationInside", .1, 10).name("Rotation speed").step(.1),
  6833. t.add(Q.transition, "flyTime", 0, 5e3).name("Transition time").onFinishChange(function() {
  6834. Q.transition.flySpeed = 0,
  6835. t.__controllers.forEach(function(e) {
  6836. e.updateDisplay()
  6837. })
  6838. }),
  6839. t.add(Q.path, "opacity", 0, 1).name("Path opacity"),
  6840. $(t.__closeButton).hide(),
  6841. t
  6842. }
  6843. function U(e) {
  6844. ke.gui || (ke.gui = V(ke.model)),
  6845. ke.visible = e,
  6846. e ? $(ke.gui.domElement).show() : $(ke.gui.domElement).hide()
  6847. }
  6848. function k() {
  6849. U(!ke.visible)
  6850. }
  6851. function H() {
  6852. function e(e) {
  6853. e.target === t || $.contains(t, e.target) || e.target === i || $.contains(i, e.target) || e.target === n || $.contains(n, e.target) || e.preventDefault()
  6854. }
  6855. $("body").css("touch-action", "none"),
  6856. $("#gui-parent").find("*:not(#tag-billboards)").on("touchmove", function(e) {
  6857. e.preventDefault()
  6858. });
  6859. var t = document.getElementById("terms-text")
  6860. , i = document.getElementById("more-help-wrapper")
  6861. , n = (document.getElementById("navigation-help-wrapper"),
  6862. document.getElementById("help-dialog"),
  6863. document.getElementById("tag-billboards"));
  6864. Q.useWheel && (document.body.addEventListener("mousewheel", e),
  6865. document.body.addEventListener("DOMMouseScroll", e)),
  6866. $("#terms-text, #more-help-wrapper, #navigation-help-wrapper").off("touchmove").on("touchmove", function(e) {
  6867. e.stopPropagation()
  6868. })
  6869. }
  6870. function G(e, t) {
  6871. for (var i = []; e; )
  6872. i.push(e),
  6873. e = e.parentNode;
  6874. for (; t && i.indexOf(t) === -1; )
  6875. t = t.parentNode;
  6876. return t
  6877. }
  6878. function z() {
  6879. var e, t = function(t) {
  6880. e = 0 === t.button || 1 === t.which ? t.target : null
  6881. }, i = function(t) {
  6882. e !== t.target && (e = G(e, t.target));
  6883. var i = document.getElementById("gui-parent");
  6884. if (G(i, e) !== i && (e = null),
  6885. e) {
  6886. var n;
  6887. try {
  6888. n = new MouseEvent("click",t)
  6889. } catch (e) {
  6890. n = document.createEvent("MouseEvents"),
  6891. 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)
  6892. }
  6893. n.syntheticClick = !0,
  6894. e.dispatchEvent(n),
  6895. e = null
  6896. }
  6897. };
  6898. document.body.addEventListener("mousedown", t, !0),
  6899. document.body.addEventListener("mouseup", i, !0),
  6900. document.getElementById("gui-parent").addEventListener("click", function(e) {
  6901. e.syntheticClick || (e.stopPropagation(),
  6902. "A" === e.target.nodeName && e.preventDefault())
  6903. }, !0)
  6904. }
  6905. var W, j, Y, X, Z, q, K = (e("three"),
  6906. e("../util/ajax"),
  6907. e("../util/browser")), Q = e("../settings"), J = e("../analytics"), ee = (e("../util/transitions"),
  6908. e("../util/camera"),
  6909. e("../util/logger")), te = (e("../objects/Snapshot"),
  6910. 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"),
  6911. e("../tag/Media/MediaEvent")), xe = (e("../enum/PathDiscardMode"),
  6912. e("../enum/PathDisplayMode"),
  6913. e("../enum/DirectorEvents"),
  6914. e("../enum/PlayerEvents")), Se = e("../enum/ControlEvents"), Me = e("./sharing/ShareEvents"), Re = e("../localization/localize"), Pe = (e("../enum/Vectors"),
  6915. e("../enum/WarpStyle"),
  6916. e("../enum/AlignmentType"),
  6917. e("../enum/VROption")), Oe = e("./konami"), Le = e("../lib/dat.gui"), De = new ee(i), Ne = (e("../util/showcase"),
  6918. e("../enum/ZoomEvents")), Be = _e.DOLLHOUSE, Fe = 0, Ve = 0, Ue = [".hideTarget"], ke = null, He = null, Ge = !1, ze = !1, We = !1, je = {
  6919. coBrand: {
  6920. visible: !0,
  6921. elements: [".co-brand", "#loaderCoBrand"]
  6922. },
  6923. help: {
  6924. visible: !0,
  6925. elements: [".nav-help", "#nav-help"]
  6926. },
  6927. tourControls: {
  6928. visible: !0,
  6929. elements: [".next", ".previous", "#play"]
  6930. },
  6931. highlight: {
  6932. visible: !0,
  6933. elements: ["#drawer", "#pullTab"]
  6934. },
  6935. share: {
  6936. visible: !0,
  6937. elements: [".socialButton", "#share"]
  6938. },
  6939. fullScreen: {
  6940. visible: !0,
  6941. elements: ["#gui-fullscreen"]
  6942. },
  6943. floors: {
  6944. visible: !0,
  6945. elements: [".gui-floor"]
  6946. }
  6947. }, Ye = function() {
  6948. var e = document.getElementById("drawer");
  6949. return function() {
  6950. $("#player").height() < 400 && e.classList.contains("open") && a()
  6951. }
  6952. }(), Xe = function() {
  6953. var e = document.getElementById("meta-info");
  6954. return function() {
  6955. $("#player").height() < 400 && e.classList.contains("expand") && de.toggleMeta(!0)
  6956. }
  6957. }(), Ze = function(e) {
  6958. function t() {
  6959. u.classList.contains("expand") && de.toggleMeta(!0)
  6960. }
  6961. function i() {
  6962. fe.hide()
  6963. }
  6964. function n() {
  6965. he.close()
  6966. }
  6967. function r() {
  6968. Ae.dismiss()
  6969. }
  6970. function o() {
  6971. p.hasClass("open") && a(!0)
  6972. }
  6973. function l() {
  6974. Ce.hide()
  6975. }
  6976. function c() {
  6977. f.hasClass("open") && f.removeClass("open")
  6978. }
  6979. function h() {
  6980. d.classList.contains("fadeIn") && (d.classList.contains("landing") ? re.dismissModal() : d.classList.contains("tour") && ve.dismissModal())
  6981. }
  6982. var u = document.getElementById("meta-info")
  6983. , d = document.getElementById("interaction-modal")
  6984. , p = $("#drawer").eq(0)
  6985. , f = $(".gui-floor").eq(0)
  6986. , g = $(".vr-popup").eq(0);
  6987. return function(e) {
  6988. switch (e) {
  6989. case "info":
  6990. i(),
  6991. n(),
  6992. Ye(),
  6993. l(),
  6994. c(),
  6995. r(),
  6996. h();
  6997. break;
  6998. case "terms":
  6999. t(),
  7000. n(),
  7001. o(),
  7002. l(),
  7003. c(),
  7004. r(),
  7005. h();
  7006. break;
  7007. case "help":
  7008. t(),
  7009. i(),
  7010. l(),
  7011. c(),
  7012. r(),
  7013. h();
  7014. break;
  7015. case "vr":
  7016. t(),
  7017. i(),
  7018. l(),
  7019. c(),
  7020. n(),
  7021. h(),
  7022. s(g) && o();
  7023. break;
  7024. case "highlights":
  7025. Xe(),
  7026. i(),
  7027. l(),
  7028. c();
  7029. break;
  7030. case "share":
  7031. t(),
  7032. i(),
  7033. n(),
  7034. c(),
  7035. r(),
  7036. h();
  7037. break;
  7038. case "floor":
  7039. i(),
  7040. l(),
  7041. r();
  7042. break;
  7043. case "view":
  7044. c(),
  7045. l(),
  7046. i(),
  7047. r();
  7048. break;
  7049. case "tour":
  7050. i(),
  7051. l(),
  7052. c(),
  7053. r();
  7054. break;
  7055. case "move":
  7056. i(),
  7057. l(),
  7058. c(),
  7059. r();
  7060. break;
  7061. case "resize":
  7062. t(),
  7063. Ye(),
  7064. c();
  7065. break;
  7066. case "tag":
  7067. i(),
  7068. n(),
  7069. l(),
  7070. c(),
  7071. r()
  7072. }
  7073. }
  7074. }();
  7075. $(document).on("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", function(e) {
  7076. $("#gui-fullscreen").toggle(!K.isFullscreen()),
  7077. $("#gui-fullscreen-exit").toggle(!!K.isFullscreen()),
  7078. setTimeout(function() {
  7079. $(".icon:visible").hide().show(0)
  7080. }, 100)
  7081. }),
  7082. $("#gui-fullscreen").find("a").on("click", function(e) {
  7083. l(e),
  7084. K.requestFullscreen($("body")[0]),
  7085. J.track("showcase_gui", {
  7086. gui_action: "click_enter_fullscreen",
  7087. interaction_source: "gui"
  7088. })
  7089. //czj
  7090. //W.reload()
  7091. }),
  7092. $("#gui-fullscreen-exit").find("a").on("click", function(e) {
  7093. l(e),
  7094. K.exitFullscreen(),
  7095. J.track("showcase_gui", {
  7096. gui_action: "click_exit_fullscreen",
  7097. interaction_source: "gui"
  7098. })
  7099. }),
  7100. $("#volume").find("a").on("click", function(e) {//xzw 声音
  7101. l(e);
  7102. if($("#volume img")[0].src.indexOf("btn_on.png")>-1)
  7103. {
  7104. g_play = 0;
  7105. //g_bgAudio.pause();
  7106. //g_tourAudio.pause(); //g_tourAudio.volume = 0;//ios 无法改变音量
  7107. g_playAudio && g_playAudio.pause();
  7108. $("#volume img").attr("src", "./images/Volume btn_off.png");
  7109. $("#volume").attr("title", "关闭声音");
  7110. }
  7111. else if($("#volume img")[0].src.indexOf("btn_off.png")>-1)
  7112. {
  7113. g_play = 1;
  7114. g_playAudio && g_playAudio.play()
  7115. /* if(g_tourAudio && g_tourAudio.src) g_tourAudio.play();
  7116. else if(g_bgAudio)g_bgAudio.play() */
  7117. $("#volume img").attr("src", "./images/Volume btn_on.png");
  7118. $("#volume").attr("title", "打开声音");
  7119. }
  7120. }),
  7121. $(window).on("resize", function(e) {
  7122. var t = e.target.innerHeight
  7123. , i = e.target.innerWidth;
  7124. t === X && i === Z || (je.highlight.visible && w(),
  7125. Ze("resize"),
  7126. $(".pinTop.right").removeClass("hideUnderMeta"),
  7127. c(),
  7128. X = t,
  7129. Z = i)
  7130. }).resize(),
  7131. K.supportsFullscreen() || $("#gui-fullscreen").hide(),
  7132. $("#pullTab").on("click", function(e) {
  7133. l(e),
  7134. $("#drawer").hasClass("open") ? (J.trackAlways("showcase_gui", {
  7135. gui_action: "hide_highlight_reel"
  7136. }),
  7137. $(this).addClass("open").children("img").attr("src","https://super.4dage.com/images/auto.png")) : (J.trackAlways("showcase_gui", {
  7138. gui_action: "show_highlight_reel"
  7139. }),
  7140. $(this).removeClass("open").children("img").attr("src", "https://super.4dage.com/images/auto-suspend.png")),
  7141. a()
  7142. }),
  7143. $("#more-menu-button").on("click", function(e) {
  7144. l(e);
  7145. var t = $("#more-menu");
  7146. t.toggleClass("open")
  7147. }),
  7148. t.exports.init = S,
  7149. t.exports.startLoading = x,
  7150. t.exports.endLoading = d,
  7151. t.exports.onProgress = u
  7152. }
  7153. ).call(this, "/js/gui/gui.js")
  7154. }
  7155. , {
  7156. "../analytics": 4,
  7157. "../controls/serializer": 14,
  7158. "../enum/AlignmentType": 17,
  7159. "../enum/BlackoutStyle": 18,
  7160. "../enum/ControlEvents": 21,
  7161. "../enum/DirectorEvents": 23,
  7162. "../enum/Keys": 30,
  7163. "../enum/PathDiscardMode": 38,
  7164. "../enum/PathDisplayMode": 39,
  7165. "../enum/PlayerEvents": 40,
  7166. "../enum/VROption": 47,
  7167. "../enum/Vectors": 50,
  7168. "../enum/Viewmode": 51,
  7169. "../enum/WarpStyle": 52,
  7170. "../enum/ZoomEvents": 53,
  7171. "../lib/dat.gui": 93,
  7172. "../localization/localize": 108,
  7173. "../tag/Media/MediaEvent": 131,
  7174. "../objects/Snapshot": 153,
  7175. "../settings": 166,
  7176. "../util/ajax": 181,
  7177. "../util/browser": 182,
  7178. "../util/camera": 183,
  7179. "../util/logger": 189,
  7180. "../util/showcase": 193,
  7181. "../util/transitions": 195,
  7182. "./closer/ModalCloserEvent": 61,
  7183. "./closer/modalCloser": 62,
  7184. "./help/HelpEvent": 66,
  7185. "./help/help": 67,
  7186. "./helpManager": 68,
  7187. "./immersiveMode": 69,
  7188. "./konami": 70,
  7189. "./landingScreen": 71,
  7190. "./loadingScreen": 72,
  7191. "./memoryUsage": 73,
  7192. "./playButton": 74,
  7193. "./populateModal": 75,
  7194. "./sharing/ShareEvents": 76,
  7195. "./sharing/modal": 77,
  7196. "./terms/TermsEvent": 78,
  7197. "./terms/terms": 79,
  7198. "./title/TitleEvents": 80,
  7199. "./title/tagToggle": 81,
  7200. "./title/titleBar": 82,
  7201. "./tourInteraction": 84,
  7202. "./vr/vrEvent": 85,
  7203. "./vr/vrModal": 87,
  7204. "./webvr/WebVrEvent": 88,
  7205. "./webvr/webVRgui": 89,
  7206. three: 217
  7207. }],
  7208. 66: [function(e, t, i) {
  7209. "use strict";
  7210. t.exports = Object.freeze({
  7211. OPENED: "help.opened",
  7212. CLOSED: "help.closed"
  7213. })
  7214. }
  7215. , {}],
  7216. 67: [function(e, t, i) {
  7217. "use strict";
  7218. function n() {
  7219. g.on("click", function(e) {
  7220. if (S && S !== l.TRANSITIONING) {
  7221. var t = window.getComputedStyle(y).getPropertyValue("opacity") > 0;
  7222. t && !M ? R.close() : r()
  7223. }
  7224. }),
  7225. w.on("click", function(e) {
  7226. R.close()
  7227. }),
  7228. E.on("click", function(e) {
  7229. S && S !== l.TRANSITIONING && (s(),
  7230. o())
  7231. }),
  7232. b.on("click", function(e) {
  7233. s(),
  7234. a()
  7235. })
  7236. }
  7237. function r() {
  7238. S && S !== l.TRANSITIONING && (M = !0,
  7239. setTimeout(function() {
  7240. M = !1
  7241. }, d.help.modalStayDuration),
  7242. R.emit(h.OPENED),
  7243. m.addClass("open " + S),
  7244. g.addClass("open"),
  7245. s(),
  7246. o(),
  7247. y.style.removeProperty ? y.style.removeProperty("display") : y.style.removeAttribute("display"),
  7248. y.classList.add("fadeIn"))
  7249. }
  7250. function o() {
  7251. E.addClass("underline-tab"),
  7252. u.fill(_, c.NAVIGATION, S),
  7253. m.addClass(S)
  7254. }
  7255. function a() {
  7256. b.addClass("underline-tab"),
  7257. u.fill(T, c.MORE_HELP),
  7258. m.addClass("more-help")
  7259. }
  7260. function s(e, t) {
  7261. m.removeClass("more-help " + l.PANORAMA + " " + l.DOLLHOUSE + " " + l.FLOORPLAN + " " + l.OUTDOOR),
  7262. I.forEach(function(e) {
  7263. e.classList.remove("underline-tab")
  7264. })
  7265. }
  7266. var l = e("../../enum/Viewmode")
  7267. , c = e("../../enum/HelpModalType")
  7268. , h = e("./HelpEvent")
  7269. , u = (e("../helpManager"),
  7270. e("./../populateModal"))
  7271. , d = e("../../settings")
  7272. , p = e("../../util/common")
  7273. , f = e("events").EventEmitter
  7274. , g = $(".footer-help").eq(0)
  7275. , m = $("#help-dialog").eq(0)
  7276. , v = document.querySelector("#quick-logo")
  7277. , A = document.querySelector("#loaderCoBrand")
  7278. , y = document.querySelector("#help-dialog")
  7279. , C = document.querySelector(".footer")
  7280. , I = $(".help-tabs").children().toArray()
  7281. , E = $(".navigation-tab").eq(0)
  7282. , b = $(".more-help-tab").eq(0)
  7283. , w = ($("#interaction-modal").eq(0).find(".interaction").toArray(),
  7284. m.find(".close").eq(0))
  7285. , _ = m.find(".interactions").toArray()
  7286. , T = m.find(".ui-instructions").toArray()
  7287. , x = l.PANORAMA
  7288. , S = l.PANORAMA
  7289. , M = !1
  7290. , R = {
  7291. init: function(e, t) {
  7292. S = t,
  7293. x = t,
  7294. [y, A, v, C].forEach(function(e) {
  7295. e.classList.add(u.deviceType)
  7296. }),
  7297. n()
  7298. },
  7299. close: function() {
  7300. if (m.hasClass("open") && (this.emit(h.CLOSED),
  7301. g.removeClass("open"),
  7302. m.removeClass("open"),
  7303. y.classList.contains("fadeIn"))) {
  7304. y.classList.remove("fadeIn");
  7305. var e = S === l.TRANSITIONING ? x : S;
  7306. u.clear(_, c.NAVIGATION, e)
  7307. }
  7308. },
  7309. updateMode: function(e) {
  7310. x = S,
  7311. S = e
  7312. }
  7313. };
  7314. p.extendObject(R, f.prototype),
  7315. t.exports = R
  7316. }
  7317. , {
  7318. "../../enum/HelpModalType": 28,
  7319. "../../enum/Viewmode": 51,
  7320. "../../settings": 166,
  7321. "../../util/common": 185,
  7322. "../helpManager": 68,
  7323. "./../populateModal": 75,
  7324. "./HelpEvent": 66,
  7325. events: 202
  7326. }],
  7327. 68: [function(e, t, i) {
  7328. (function(i) {
  7329. "use strict";
  7330. var n = e("../util/browser")
  7331. , r = e("./../util/logger")
  7332. , o = e("./../settings")
  7333. , a = new r(i)
  7334. , s = function() {
  7335. var e;
  7336. try {
  7337. return e = window.localStorage.getItem("visitCount") || "0",
  7338. e = (parseFloat(e) + 1).toString(),
  7339. window.localStorage.setItem("visitCount", e),
  7340. a.debug("visitCount = " + e),
  7341. e
  7342. } catch (t) {
  7343. e = "1",
  7344. a.debug("couldn't set local storage")
  7345. }
  7346. }()
  7347. , l = !1;
  7348. t.exports = {
  7349. isHelpDisabled: function() {
  7350. return "0" === n.valueFromHash("help", null) || l
  7351. },
  7352. isLargeHelpEnabled: function() {
  7353. return ("1" === s || "1" === n.valueFromHash("help", null)) && !this.isHelpDisabled()
  7354. },
  7355. isSmallHelpEnabled: function() {
  7356. return "2" === n.valueFromHash("help", null) && !this.isHelpDisabled()
  7357. },
  7358. isHelpEnabled: function() {
  7359. return this.isLargeHelpEnabled() || this.isSmallHelpEnabled()
  7360. },
  7361. setAutoPlay: function(e) {
  7362. l = o.warp.auto >= 0 && e > 1
  7363. }
  7364. }
  7365. }
  7366. ).call(this, "/js/gui/helpManager.js")
  7367. }
  7368. , {
  7369. "../util/browser": 182,
  7370. "./../settings": 166,
  7371. "./../util/logger": 189
  7372. }],
  7373. 69: [function(e, t, i) {
  7374. "use strict";
  7375. function n(e, t, i, n) {
  7376. F = n,
  7377. r(e, t, i, F),
  7378. o(),
  7379. N = t.mode
  7380. }
  7381. function r(e, t, i, n) {
  7382. [C.PANORAMA, C.DOLLHOUSE, C.FLOORPLAN].forEach(function(t) {
  7383. e.controls[t].on(v.Move, a),
  7384. e.controls[t].on(v.LongTap, c)
  7385. }),
  7386. M.on("mousewheel DOMMouseScroll", a),
  7387. i.on(m.TagActivated, a),
  7388. i.on(m.TagNavigation, a),
  7389. t.on(A.FlyingEnded, s),
  7390. t.on(A.ModeChanging, function(e, t) {
  7391. B = t !== C.PANORAMA && e !== C.PANORAMA
  7392. }),
  7393. t.on(A.ModeChanged, function(e, i) {
  7394. N = t.mode,
  7395. i !== C.TRANSITIONING ? l() : a("modeChange")
  7396. }),
  7397. n.on(y.TourStart, function() {
  7398. L = !0,
  7399. a()
  7400. }),
  7401. n.on(y.TourEnd, function() {
  7402. L = !1,
  7403. l()
  7404. }),
  7405. n.on(y.ActionInterrupted, function() {
  7406. L = !1
  7407. }),
  7408. R.addEventListener("touchend", function() {
  7409. $("#pullTab").hasClass("opened") && !L && l()
  7410. }, !0)
  7411. }
  7412. function o() {
  7413. p.isMobile() ? (b.forEach(function(e) {
  7414. e.classList.add("mobile")
  7415. }),
  7416. w.click(l)) : (b.forEach(function(e) {
  7417. e.addEventListener("mouseleave", function() {
  7418. !M.is(":hover") && b[0].classList.contains("detectHover") && l()
  7419. }, !0)
  7420. }),
  7421. M.mouseleave(function() {
  7422. b[0].classList.contains("detectHover") && l()
  7423. }))
  7424. }
  7425. function a(e) {
  7426. D || d(e) && _.hasClass("playing") || (clearTimeout(O),
  7427. P = !0,
  7428. g.close(),
  7429. h(e),
  7430. N !== C.DOLLHOUSE && N !== C.FLOORPLAN && (x.hasClass("expand") && !S.hasClass("closed") || 2 === p.valueFromHash("title", 1) ,
  7431. _.hasClass("playing") || (b.forEach(function(e) {
  7432. e.classList.add("detectHover")
  7433. }),
  7434. O = setTimeout(l, f.immersive.timeToShowAgain))))
  7435. }
  7436. function s() {
  7437. _.hasClass("playing") || (clearTimeout(O),
  7438. O = setTimeout(l, f.immersive.timeToShowAgain))
  7439. }
  7440. function l() {
  7441. clearTimeout(O),
  7442. P = !1,
  7443. I.forEach(function(e) {
  7444. e.classList.remove("drawerOpen")
  7445. }),
  7446. L || E.forEach(function(e) {
  7447. e.classList.remove("duringTour")
  7448. }),
  7449. b.forEach(function(e) {
  7450. e.classList.remove("detectHover")
  7451. })
  7452. }
  7453. function c() {
  7454. P ? l() : a(),
  7455. D = !0,
  7456. setTimeout(function() {
  7457. D = !1
  7458. }, f.immersive.uiStayDuration)
  7459. }
  7460. function h(e) {
  7461. !d(e) && L ? E.forEach(function(e) {
  7462. e.classList.remove("drawerOpen"),
  7463. e.classList.add("duringTour")
  7464. }) : _.hasClass("open") ? E.forEach(function(e) {
  7465. e.classList.remove("duringTour"),
  7466. e.classList.add("drawerOpen")
  7467. }) : B || N === C.FLOORPLAN || N === C.DOLLHOUSE || E.forEach(function(e) {
  7468. e.classList.add("fadeOut")
  7469. })
  7470. }
  7471. function u() {
  7472. T.hasClass("duringTour") || (L = !1,
  7473. a("gui"),
  7474. l())
  7475. }
  7476. function d(e) {
  7477. return "mouse" === e || "touch" === e || "key" === e || "gui" === e
  7478. }
  7479. var p = e("../util/browser")
  7480. , f = e("../settings")
  7481. , g = e("./help/help")
  7482. , m = e("../enum/tagEvents")
  7483. , v = e("../enum/ControlEvents")
  7484. , A = e("../enum/PlayerEvents")
  7485. , y = e("../enum/DirectorEvents")
  7486. , A = e("../enum/PlayerEvents")
  7487. , C = e("../enum/Viewmode")
  7488. , I = $(".pinTop.left, .pinBottom-container, #drawer-container, #drawer, .footer").toArray()
  7489. , E = $(".pinBottom-container, #drawer-container, .footer").toArray()
  7490. , b = $("#hover-bottom, #hover-top").toArray()
  7491. , w = ($("#pullTab").eq(0),
  7492. $("#playHead").eq(0),
  7493. $(".pinBottom-container").eq(0))
  7494. , _ = $("#drawer").eq(0)
  7495. , T = $("#drawer-container").eq(0)
  7496. , x = $("#meta-info").eq(0)
  7497. , S = $(".pinTop.left").eq(0)
  7498. , M = $("#player").eq(0)
  7499. , R = document.getElementById("pullTab")
  7500. , P = !1
  7501. , O = null
  7502. , L = !1
  7503. , D = !1
  7504. , N = null
  7505. , B = !1
  7506. , F = null;
  7507. t.exports.init = n,
  7508. t.exports.hideUi = a,
  7509. t.exports.resetDrawer = u
  7510. }
  7511. , {
  7512. "../enum/ControlEvents": 21,
  7513. "../enum/DirectorEvents": 23,
  7514. "../enum/tagEvents": 32,
  7515. "../enum/PlayerEvents": 40,
  7516. "../enum/Viewmode": 51,
  7517. "../settings": 166,
  7518. "../util/browser": 182,
  7519. "./help/help": 67
  7520. }],
  7521. 70: [function(e, t, i) {
  7522. (function(i) {
  7523. "use strict";
  7524. function n(e, t, i) {
  7525. l.debug("konami has the modelInstance");
  7526. var n = [];
  7527. $(window).on("keydown", function(e) {
  7528. n.push(e.which),
  7529. n.length > o.secretPanelWord.length && n.shift(),
  7530. s.equalLists(n, o.secretPanelWord) && (l.debug("Developer mode active."),
  7531. o.debug = !0)
  7532. }),
  7533. $(window).on("keydown", function n(r) {
  7534. o.debug && 72 === r.which && (e && i ? (a.toggle(e, t, i),
  7535. $(window).off("keydown", n)) : console.warn("sorry we're not ready yet"))
  7536. })
  7537. }
  7538. var r = e("./../util/logger")
  7539. , o = e("./../settings")
  7540. , a = e("./debug")
  7541. , s = e("./../util/common")
  7542. , l = (e("./gui"),
  7543. new r(i));
  7544. o.console && $("body").append('<div id="debug-console"></div>'),
  7545. t.exports.init = n
  7546. }
  7547. ).call(this, "/js/gui/konami.js")
  7548. }
  7549. , {
  7550. "./../settings": 166,
  7551. "./../util/common": 185,
  7552. "./../util/logger": 189,
  7553. "./debug": 63,
  7554. "./gui": 65
  7555. }],
  7556. 71: [function(e, t, i) {
  7557. "use strict";
  7558. function n(e, t) {
  7559. E = t.mode === p.PANORAMA && t.pano && !t.pano.isAligned() ? p.OUTDOOR : t.mode
  7560. }
  7561. function r(e) {
  7562. var t = $.Deferred();
  7563. e || t.resolve();
  7564. var i = c.startupFlyinDelay;
  7565. return e === p.PANORAMA && (i += c.dollhouse.transitionTime),
  7566. setTimeout(t.resolve.bind(t), i),
  7567. t
  7568. }
  7569. function o(e, t, i) {
  7570. var n = 0;
  7571. c.quickstart.enabled && (a(i),
  7572. n = c.quickstart.showTextDelay + c.quickstart.fadeOutDelay);
  7573. var r = function() {
  7574. e.once(g.Move, l),
  7575. t.once(f.TourStart, l)
  7576. };
  7577. s(n, r)
  7578. }
  7579. function a(e) {
  7580. return e && (y.addClass("quick-brand"),
  7581. v.before(y),
  7582. A = $(".quick-brand").toArray()),
  7583. m.addClass("fadeOut"),
  7584. setTimeout(function() {
  7585. A.forEach(function(e) {
  7586. e.classList.add("fadeIn")
  7587. })
  7588. }, c.quickstart.showTextDelay),
  7589. setTimeout(function() {
  7590. A.forEach(function(e) {
  7591. e.classList.add("fadeOut")
  7592. })
  7593. }, c.quickstart.fadeOutDelay),
  7594. !0
  7595. }
  7596. function s(e, t) {
  7597. setTimeout(function() {
  7598. if (h.isHelpEnabled()) {
  7599. if (t(),
  7600. u.init(),
  7601. C.addClass("fadeIn landing " + u.deviceType),
  7602. h.isSmallHelpEnabled())
  7603. return void C.addClass("small");
  7604. u.fill(I, d.LANDING[E]),
  7605. C.addClass(E)
  7606. }
  7607. }, e)
  7608. //csz 用户引导界面
  7609. var helpData = {
  7610. "pc":["https://super.4dage.com/images/pc_step1.png","https://super.4dage.com/images/pc_step2.png","https://super.4dage.com/images/pc_step3.png"],
  7611. "mobile":["https://super.4dage.com/images/phone_step1.png","https://super.4dage.com/images/phone_step2.png","https://super.4dage.com/images/phone_step3.png"]
  7612. }
  7613. var navIcon = $(".nav-icon .icon");
  7614. if(/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)) navIcon.attr("src",helpData.mobile[0]);
  7615. function paging(id){
  7616. id.on("click",function(){
  7617. var navPage = null;
  7618. $(this).attr("data-id") == "plus" ? navPage = +navIcon.attr("data-page")+1 : navPage = +navIcon.attr("data-page")-1;
  7619. if(navPage > helpData.length || navPage < 1) return false
  7620. if(/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)){
  7621. navIcon.attr({"data-page":navPage,"src":helpData.mobile[navPage - 1]});
  7622. }else{
  7623. navIcon.attr({"data-page":navPage,"src":helpData.pc[navPage - 1]});
  7624. }
  7625. })
  7626. };
  7627. paging($(".next-button"));
  7628. paging($(".prev-button"));
  7629. }
  7630. function l() {
  7631. u.clear(I, d.LANDING[E]),
  7632. C.removeClass("fadeIn")
  7633. }
  7634. var c = e("../settings")
  7635. , h = (e("./help/help"),
  7636. e("./helpManager"))
  7637. , u = e("./populateModal")
  7638. , d = e("../enum/HelpModalType")
  7639. , p = e("../enum/Viewmode")
  7640. , f = e("../enum/DirectorEvents")
  7641. , g = e("../enum/PlayerEvents")
  7642. , m = $("#quick-blackout").eq(0)
  7643. , v = $("#quick-logo").eq(0)
  7644. , A = $(".quick-brand").toArray()
  7645. , y = $("#loaderCoBrand").eq(0)
  7646. , C = $("#interaction-modal").eq(0)
  7647. , I = C.find(".interaction").toArray()
  7648. , E = ($("#model-title, .pinBottom-container, #drawer-container, #drawer, .footer").toArray(),
  7649. "");
  7650. t.exports.delayLanding = r,
  7651. t.exports.showMessage = o,
  7652. t.exports.init = n,
  7653. t.exports.dismissModal = l
  7654. }
  7655. , {
  7656. "../enum/DirectorEvents": 23,
  7657. "../enum/HelpModalType": 28,
  7658. "../enum/PlayerEvents": 40,
  7659. "../enum/Viewmode": 51,
  7660. "../settings": 166,
  7661. "./help/help": 67,
  7662. "./helpManager": 68,
  7663. "./populateModal": 75
  7664. }],
  7665. 72: [function(e, t, i) {
  7666. "use strict";
  7667. var n = e("./circleLoader").circleLoader;
  7668. t.exports = {
  7669. element: $("#gui-loading"),
  7670. hide: function(e) {
  7671. n.done(),
  7672. this.element.fadeOut(1500, e)
  7673. },
  7674. show: function(e) {
  7675. this.element.fadeIn(500, function() {
  7676. this.element.css("display", "table"),
  7677. e && e()
  7678. }
  7679. .bind(this))
  7680. },
  7681. progress: function(e) {
  7682. n.set(e)
  7683. }
  7684. }
  7685. }
  7686. , {
  7687. "./circleLoader": 60
  7688. }],
  7689. 73: [function(e, t, i) {
  7690. "use strict";
  7691. var n = e("../settings")
  7692. , r = $("#memory-info")
  7693. , o = r.find("#memory-gpu")
  7694. , a = !1;
  7695. t.exports = {
  7696. show: function() {
  7697. n.profiling.enabled && (r.show(),
  7698. a = !0)
  7699. },
  7700. hide: function() {
  7701. r.hide(),
  7702. a = !1
  7703. },
  7704. toggle: function() {
  7705. a ? this.hide() : this.show()
  7706. },
  7707. update: function(e) {
  7708. n.profiling.enabled && o.text(Math.floor(e / 1e6) + "MB")
  7709. }
  7710. }
  7711. }
  7712. , {
  7713. "../settings": 166
  7714. }],
  7715. 74: [function(e, t, i) {
  7716. "use strict";
  7717. var n = e("../util/browser")
  7718. , r = e("../analytics");
  7719. e("../settings");
  7720. t.exports = {
  7721. show: function(e, t) {
  7722. $("#gui-message").fadeOut(500, function() {
  7723. t()
  7724. })
  7725. }
  7726. }
  7727. }
  7728. , {
  7729. "../analytics": 4,
  7730. "../settings": 166,
  7731. "../util/browser": 182
  7732. }],
  7733. 75: [function(e, t, i) {
  7734. "use strict";
  7735. function n(e, t, i, n) {
  7736. function r(e) {
  7737. return e.classList.contains(a)
  7738. }
  7739. var o = i ? this.assets[t][i][this.deviceType] : this.assets[t][this.deviceType];
  7740. //for (var a in o) {
  7741. //var s = e.find(r);
  7742. //for (var l in o[a]) {
  7743. //var c = o[a][l];
  7744. //if ("top-info" === l || "bottom-info" === l) {
  7745. //var h = n ? c : "";
  7746. //czj 注释掉第一次打开的用户引导
  7747. //s.querySelector("." + l).textContent = h
  7748. //} else {
  7749. //var u = n ? c : "";
  7750. //, d = s.querySelector("." + l);
  7751. //d.src = u,
  7752. //n ? d.classList.remove("hidden") : d.classList.add("hidden")
  7753. //}
  7754. //}
  7755. //}
  7756. //var p = Array.prototype.slice.call(e[0].parentElement.querySelectorAll("hr"));
  7757. // p.forEach(function(e) {
  7758. // n ? e.classList.remove("hidden") : e.classList.add("hidden")
  7759. // })
  7760. }
  7761. var r = e("../util/browser")
  7762. , o = e("../localization/localize")
  7763. , a = e("../enum/HelpModalType")
  7764. , s = (e("../enum/HelpModalSize"),
  7765. e("../enum/Viewmode"));
  7766. t.exports = {
  7767. init: function() {
  7768. if (!this.hasInitialized) {
  7769. this.hasInitialized = !0,
  7770. this.deviceType = r.isMobile() ? "mobile" : "desktop",
  7771. this.assets = {},
  7772. this.assets[a.LANDING[s.PANORAMA]] = {
  7773. desktop: {
  7774. left: {
  7775. "top-info": o.ROTATE,
  7776. "big-image": "images/nav_help_mouse_drag_left.png",
  7777. keyboard: "images/nav_help_keyboard_left_right.png"
  7778. },
  7779. middle: {
  7780. "top-info": o.MOVE,
  7781. "big-image": "images/nav_help_mouse_click.png",
  7782. keyboard: "images/nav_help_keyboard_up_down.png"
  7783. },
  7784. right: {
  7785. "top-info": o.ZOOM,
  7786. "big-image": "images/nav_help_mouse_zoom.png",
  7787. keyboard: "images/nav_help_zoom_keys.png"
  7788. }
  7789. },
  7790. mobile: {
  7791. left: {
  7792. "top-info": o.ROTATE,
  7793. "big-image": "images/nav_help_gesture_drag.png"
  7794. },
  7795. middle: {
  7796. "top-info": o.MOVE,
  7797. "big-image": "images/nav_help_gesture_tap.png"
  7798. },
  7799. right: {
  7800. "top-info": o.ZOOM,
  7801. "big-image": "images/nav_help_gesture_pinch.png"
  7802. }
  7803. }
  7804. },
  7805. this.assets[a.LANDING[s.OUTDOOR]] = JSON.parse(JSON.stringify(this.assets[a.LANDING[s.PANORAMA]])),
  7806. this.assets[a.LANDING[s.DOLLHOUSE]] = {
  7807. desktop: {
  7808. left: {
  7809. "top-info": o.ROTATE,
  7810. "big-image": "images/nav_help_mouse_drag_left.png",
  7811. keyboard: "images/nav_help_keyboard_left_right.png"
  7812. },
  7813. middle: {
  7814. "top-info": o.MOVE,
  7815. "big-image": "images/nav_help_mouse_position_right.png"
  7816. }
  7817. },
  7818. mobile: {
  7819. left: {
  7820. "top-info": o.ROTATE,
  7821. "big-image": "images/nav_help_gesture_drag.png"
  7822. },
  7823. middle: {
  7824. "top-info": o.MOVE,
  7825. "big-image": "images/nav_help_gesture_position_two_finger.png"
  7826. }
  7827. }
  7828. },
  7829. this.assets[a.LANDING[s.FLOORPLAN]] = {
  7830. desktop: {
  7831. left: {
  7832. "top-info": o.MOVE,
  7833. "big-image": "images/nav_help_mouse_position_left.png"
  7834. },
  7835. middle: {
  7836. "top-info": o.ROTATE,
  7837. "big-image": "images/nav_help_mouse_drag_right.png",
  7838. keyboard: "images/nav_help_keyboard_left_right.png"
  7839. }
  7840. },
  7841. mobile: {
  7842. left: {
  7843. "top-info": o.MOVE,
  7844. "big-image": "images/nav_help_gesture_position.png"
  7845. },
  7846. middle: {
  7847. "top-info": o.ROTATE,
  7848. "big-image": "images/nav_help_gesture_drag_two_finger.png"
  7849. }
  7850. }
  7851. };
  7852. var e = {
  7853. "top-info": o.INSIDE,
  7854. "big-image": "images/nav_help_click_inside.png",
  7855. keyboard: "images/nav_help_inside_key.png"
  7856. };
  7857. this.assets[a.LANDING[s.OUTDOOR]].desktop.middle = e,
  7858. this.assets[a.LANDING[s.DOLLHOUSE]].desktop.right = e,
  7859. this.assets[a.LANDING[s.FLOORPLAN]].desktop.right = e;
  7860. var t = {
  7861. "top-info": o.INSIDE,
  7862. "big-image": "images/nav_help_tap_inside.png"
  7863. };
  7864. this.assets[a.LANDING[s.OUTDOOR]].mobile.middle = t,
  7865. this.assets[a.LANDING[s.DOLLHOUSE]].mobile.right = t,
  7866. this.assets[a.LANDING[s.FLOORPLAN]].mobile.right = t,
  7867. this.assets[a.NAVIGATION] = {},
  7868. this.assets[a.NAVIGATION][s.PANORAMA] = {
  7869. desktop: {
  7870. left: {
  7871. "top-info": o.HELP_DESKTOP_PANORAMA_1A,
  7872. "bottom-info": o.HELP_DESKTOP_PANORAMA_1B,
  7873. "big-image": "images/nav_help_mouse_drag_left.png",
  7874. keyboard: "images/nav_help_keyboard_left_right.png"
  7875. },
  7876. middle: {
  7877. "top-info": o.HELP_DESKTOP_PANORAMA_2A,
  7878. "bottom-info": o.HELP_DESKTOP_PANORAMA_2B,
  7879. "big-image": "images/nav_help_mouse_click.png",
  7880. keyboard: "images/nav_help_keyboard_up_down.png"
  7881. },
  7882. right: {
  7883. "top-info": o.HELP_DESKTOP_PANORAMA_3A,
  7884. "bottom-info": o.HELP_DESKTOP_PANORAMA_3B,
  7885. "big-image": "images/nav_help_mouse_zoom.png",
  7886. keyboard: "images/nav_help_zoom_keys.png"
  7887. }
  7888. },
  7889. mobile: {
  7890. left: {
  7891. "top-info": o.HELP_MOBILE_PANORAMA_1,
  7892. "big-image": "images/nav_help_gesture_drag.png"
  7893. },
  7894. middle: {
  7895. "top-info": o.HELP_MOBILE_PANORAMA_2,
  7896. "big-image": "images/nav_help_gesture_tap.png"
  7897. },
  7898. right: {
  7899. "top-info": o.HELP_MOBILE_3,
  7900. "big-image": "images/nav_help_gesture_pinch.png"
  7901. }
  7902. }
  7903. },
  7904. this.assets[a.NAVIGATION][s.DOLLHOUSE] = {
  7905. desktop: {
  7906. left: {
  7907. "top-info": o.HELP_DESKTOP_DOLLHOUSE_1A,
  7908. "bottom-info": o.HELP_DESKTOP_DOLLHOUSE_1B,
  7909. "big-image": "images/nav_help_mouse_drag_left.png",
  7910. keyboard: "images/nav_help_keyboard_all.png"
  7911. },
  7912. middle: {
  7913. "top-info": o.HELP_DESKTOP_DOLLHOUSE_2A,
  7914. "big-image": "images/nav_help_mouse_position_right.png"
  7915. },
  7916. right: {
  7917. "top-info": o.HELP_DESKTOP_DOLLHOUSE_3A,
  7918. "big-image": "images/nav_help_mouse_zoom.png"
  7919. }
  7920. },
  7921. mobile: {
  7922. left: {
  7923. "top-info": o.HELP_MOBILE_DOLLHOUSE_1,
  7924. "big-image": "images/nav_help_gesture_drag.png"
  7925. },
  7926. middle: {
  7927. "top-info": o.HELP_MOBILE_DOLLHOUSE_2,
  7928. "big-image": "images/nav_help_gesture_position_two_finger.png"
  7929. },
  7930. right: {
  7931. "top-info": o.HELP_MOBILE_3,
  7932. "big-image": "images/nav_help_gesture_pinch.png"
  7933. }
  7934. }
  7935. },
  7936. this.assets[a.NAVIGATION][s.FLOORPLAN] = {
  7937. desktop: {
  7938. left: {
  7939. "top-info": o.HELP_DESKTOP_FLOORPLAN_1A,
  7940. "big-image": "images/nav_help_mouse_position_left.png"
  7941. },
  7942. middle: {
  7943. "top-info": o.HELP_DESKTOP_FLOORPLAN_2A,
  7944. "bottom-info": o.HELP_DESKTOP_FLOORPLAN_2B,
  7945. "big-image": "images/nav_help_mouse_drag_right.png",
  7946. keyboard: "images/nav_help_keyboard_left_right.png"
  7947. },
  7948. right: {
  7949. "top-info": o.HELP_DESKTOP_FLOORPLAN_3A,
  7950. "bottom-info": o.HELP_DESKTOP_FLOORPLAN_3B,
  7951. "big-image": "images/nav_help_mouse_zoom.png",
  7952. keyboard: "images/nav_help_keyboard_up_down.png"
  7953. }
  7954. },
  7955. mobile: {
  7956. left: {
  7957. "top-info": o.HELP_MOBILE_FLOORPLAN_1,
  7958. "big-image": "images/nav_help_gesture_position.png"
  7959. },
  7960. middle: {
  7961. "top-info": o.HELP_MOBILE_FLOORPLAN_2,
  7962. "big-image": "images/nav_help_gesture_drag_two_finger.png"
  7963. },
  7964. right: {
  7965. "top-info": o.HELP_MOBILE_3,
  7966. "big-image": "images/nav_help_gesture_pinch.png"
  7967. }
  7968. }
  7969. },
  7970. this.assets[a.NAVIGATION][s.OUTDOOR] = JSON.parse(JSON.stringify(this.assets[a.NAVIGATION][s.PANORAMA])),
  7971. this.assets[a.NAVIGATION][s.OUTDOOR].desktop.middle = {
  7972. "top-info": o.HELP_DESKTOP_360_2A,
  7973. "bottom-info": o.HELP_DESKTOP_360_2B,
  7974. "big-image": "images/nav_help_click_inside.png",
  7975. keyboard: "images/nav_help_inside_key.png"
  7976. },
  7977. this.assets[a.NAVIGATION][s.OUTDOOR].mobile.middle = {
  7978. "top-info": o.HELP_MOBILE_360_2,
  7979. "big-image": "images/nav_help_tap_inside.png"
  7980. },
  7981. this.assets[a.MORE_HELP] = {
  7982. desktop: {
  7983. "more-help-hlr": {
  7984. "top-info": o.HELP_MORE_HLR_A,
  7985. "big-image": "images/nav_help_expand.svg",
  7986. "bottom-info": o.HELP_DESKTOP_MORE_HLR_B
  7987. },
  7988. "more-help-dollhouse": {
  7989. "top-info": o.HELP_MORE_DOLLHOUSE_A,
  7990. "big-image": "images/nav_help_dollhouse.svg",
  7991. "bottom-info": o.HELP_DESKTOP_MORE_DOLLHOUSE_B
  7992. },
  7993. "more-help-floors": {
  7994. "top-info": o.HELP_MORE_FLOORS_A,
  7995. "big-image": "images/nav_help_floor picker.svg",
  7996. "bottom-info": o.HELP_DESKTOP_MORE_FLOORS_B
  7997. },
  7998. "more-help-tag": {
  7999. "top-info": o.HELP_MORE_TAG_A,
  8000. "big-image": "images/nav_help_tag.svg",
  8001. "bottom-info": o.HELP_DESKTOP_MORE_TAG_B
  8002. },
  8003. "more-help-zoom": {
  8004. "top-info": o.HELP_MORE_ZOOM_A,
  8005. "big-image": "images/nav_help_zoom.svg",
  8006. "bottom-info": o.HELP_DESKTOP_MORE_ZOOM_B
  8007. },
  8008. "more-help-tour": {
  8009. "top-info": o.HELP_MORE_TOUR_A,
  8010. "big-image": "images/nav_help_play.png",
  8011. "bottom-info": o.HELP_DESKTOP_MORE_TOUR_B
  8012. },
  8013. "more-help-inside": {
  8014. "top-info": o.HELP_MORE_INSIDE_A,
  8015. "big-image": "images/nav_help_inside.svg",
  8016. "bottom-info": o.HELP_DESKTOP_MORE_INSIDE_B
  8017. },
  8018. "more-help-vr": {
  8019. "top-info": o.HELP_MORE_VR_A,
  8020. "big-image": "images/nav_help_vr.svg",
  8021. "bottom-info": o.HELP_DESKTOP_MORE_VR_B
  8022. },
  8023. "more-help-360": {
  8024. "top-info": o.HELP_MORE_360_A,
  8025. "big-image": "images/nav_help_360.svg",
  8026. "bottom-info": o.HELP_DESKTOP_MORE_360_B
  8027. },
  8028. "more-help-fullscreen": {
  8029. "top-info": o.HELP_MORE_FULLSCREEN_A,
  8030. "big-image": "images/nav_help_fullscreen.svg",
  8031. "bottom-info": o.HELP_DESKTOP_MORE_FULLSCREEN_B
  8032. }
  8033. },
  8034. mobile: {
  8035. "more-help-hlr": {
  8036. "top-info": o.HELP_MORE_HLR_A,
  8037. "big-image": "images/nav_help_expand.svg",
  8038. "bottom-info": o.HELP_DESKTOP_MORE_HLR_B
  8039. },
  8040. "more-help-dollhouse": {
  8041. "top-info": o.HELP_MORE_DOLLHOUSE_A,
  8042. "big-image": "images/nav_help_dollhouse.svg",
  8043. "bottom-info": o.HELP_MOBILE_MORE_DOLLHOUSE_B
  8044. },
  8045. "more-help-floors": {
  8046. "top-info": o.HELP_MORE_FLOORS_A,
  8047. "big-image": "images/nav_help_floor picker.svg",
  8048. "bottom-info": o.HELP_DESKTOP_MORE_FLOORS_B
  8049. },
  8050. "more-help-tag": {
  8051. "top-info": o.HELP_MORE_TAG_A,
  8052. "big-image": "images/nav_help_tag.svg",
  8053. "bottom-info": o.HELP_MOBILE_MORE_TAG_B
  8054. },
  8055. "more-help-tour": {
  8056. "top-info": o.HELP_MORE_TOUR_A,
  8057. "big-image": "images/nav_help_play.png",
  8058. "bottom-info": o.HELP_DESKTOP_MORE_TOUR_B
  8059. },
  8060. "more-help-inside": {
  8061. "top-info": o.HELP_MORE_INSIDE_A,
  8062. "big-image": "images/nav_help_inside.svg",
  8063. "bottom-info": o.HELP_MOBILE_MORE_INSIDE_B
  8064. },
  8065. "more-help-vr": {
  8066. "top-info": o.HELP_MORE_VR_A,
  8067. "big-image": "images/webvr.svg",
  8068. "bottom-info": o.HELP_MOBILE_MORE_VR_B
  8069. },
  8070. "more-help-360": {
  8071. "top-info": o.HELP_MORE_360_A,
  8072. "big-image": "images/nav_help_360.svg",
  8073. "bottom-info": o.HELP_MOBILE_MORE_360_B
  8074. }
  8075. }
  8076. },
  8077. this.assets[a.TOUR_INTERACTION[s.PANORAMA]] = {
  8078. desktop: {
  8079. left: {
  8080. "top-info": o.ROTATE,
  8081. "big-image": "images/nav_help_mouse_drag_left.png",
  8082. keyboard: "images/nav_help_keyboard_left_right.png"
  8083. },
  8084. middle: {
  8085. "top-info": o.MOVE,
  8086. "big-image": "images/nav_help_mouse_click.png",
  8087. keyboard: "images/nav_help_keyboard_up_down.png"
  8088. },
  8089. right: {
  8090. "top-info": o.PLAY,
  8091. "big-image": "images/Desktop-help-play-button.svg",
  8092. keyboard: "images/Desktop-help-spacebar-2.svg"
  8093. }
  8094. },
  8095. mobile: {
  8096. left: {
  8097. "top-info": o.ROTATE,
  8098. "big-image": "images/nav_help_gesture_drag.png"
  8099. },
  8100. middle: {
  8101. "top-info": o.MOVE,
  8102. "big-image": "images/nav_help_gesture_tap.png"
  8103. },
  8104. right: {
  8105. "top-info": o.PLAY,
  8106. "big-image": "images/mobile-help-play-button.svg"
  8107. }
  8108. }
  8109. },
  8110. this.assets[a.TOUR_INTERACTION[s.OUTDOOR]] = JSON.parse(JSON.stringify(this.assets[a.TOUR_INTERACTION[s.PANORAMA]])),
  8111. this.assets[a.TOUR_INTERACTION[s.OUTDOOR]].desktop.middle = this.assets[a.LANDING[s.OUTDOOR]].desktop.middle,
  8112. this.assets[a.TOUR_INTERACTION[s.OUTDOOR]].mobile.middle = this.assets[a.LANDING[s.OUTDOOR]].mobile.middle,
  8113. this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]] = JSON.parse(JSON.stringify(this.assets[a.TOUR_INTERACTION[s.OUTDOOR]])),
  8114. this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]].desktop.left = this.assets[a.LANDING[s.FLOORPLAN]].desktop.left,
  8115. this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]].mobile.left = this.assets[a.LANDING[s.FLOORPLAN]].mobile.left
  8116. }
  8117. },
  8118. fill: function(e, t, i) {
  8119. n.call(this, e, t, i, !0)
  8120. },
  8121. clear: function(e, t, i) {
  8122. n.call(this, e, t, i, !1)
  8123. }
  8124. }
  8125. }
  8126. , {
  8127. "../enum/HelpModalSize": 27,
  8128. "../enum/HelpModalType": 28,
  8129. "../enum/Viewmode": 51,
  8130. "../localization/localize": 108,
  8131. "../util/browser": 182
  8132. }],
  8133. 76: [function(e, t, i) {
  8134. "use strict";
  8135. t.exports = Object.freeze({
  8136. OPENED: "share.open",
  8137. CLOSED: "share.closed",
  8138. LINK_CLICKED: "share.linked"
  8139. })
  8140. }
  8141. , {}],
  8142. 77: [function(e, t, i) {
  8143. "use strict";
  8144. function n(e) {
  8145. function t(t, i) {
  8146. var n = window.screenY + ($("#player").height() - i) / 2
  8147. , r = window.screenX + ($("#player").width() - t) / 2
  8148. , o = "top=" + n + ",left=" + r + ",width=" + t + ",height=" + i;
  8149. I.emit(l.LINK_CLICKED, {
  8150. channel: e
  8151. }),
  8152. window.open(C[e], "shareWindow", o)
  8153. }
  8154. switch (e) {
  8155. case y.FACEBOOK:
  8156. t(580, 420);
  8157. break;
  8158. case y.TWITTER:
  8159. t(550, 440);
  8160. break;
  8161. case y.MAIL:
  8162. I.emit(l.LINK_CLICKED, {
  8163. channel: "email"
  8164. }),
  8165. window.open(C[e], "_blank");
  8166. break;
  8167. case y.LINKEDIN:
  8168. }
  8169. }
  8170. function r(e) {
  8171. I.emit(l.LINK_CLICKED, {
  8172. channel: "copylink"
  8173. });
  8174. var t = document.createRange();
  8175. t.selectNodeContents(v);
  8176. var i = window.getSelection();
  8177. i.removeAllRanges(),
  8178. i.addRange(t),
  8179. document.execCommand("copy"),
  8180. A.classList.remove("hidden"),
  8181. v.classList.add("highlighted")
  8182. }
  8183. function o(e) {
  8184. e && (e.stopPropagation(),
  8185. e.target === v) || (window.getSelection().removeAllRanges(),
  8186. v.classList.remove("highlighted"),
  8187. A.classList.add("hidden"))
  8188. }
  8189. var a = e("../../util/browser")
  8190. , s = e("../../localization/localize")
  8191. , l = e("./ShareEvents")
  8192. , c = e("../../util/common")
  8193. , h = e("events").EventEmitter
  8194. , u = document.getElementById("sharing")
  8195. , d = document.getElementById("share-modal")
  8196. , p = document.getElementById("share-close")
  8197. , f = document.getElementById("facebook-share")
  8198. , g = document.getElementById("twitter-share")
  8199. , m = document.getElementById("mail-share")
  8200. , v = document.getElementById("share-url-text")
  8201. , A = document.getElementById("copy-success")
  8202. , y = Object.freeze({
  8203. FACEBOOK: "facebook",
  8204. TWITTER: "twitter",
  8205. MAIL: "mail",
  8206. LINKEDIN: "linkedin"
  8207. })
  8208. , C = {};
  8209. C[y.FACEBOOK] = "http://www.facebook.com/sharer.php?u=" + encodeURIComponent(window.location.href + "&utm_source=1") + "&t=",
  8210. C[y.TWITTER] = "http://twitter.com/intent/tweet?text=",
  8211. C[y.MAIL] = "mailto:?subject=";
  8212. var I = {
  8213. init: function(e) {
  8214. var t = encodeURIComponent(s.SHARE_EXPLORE + e + " " + s.SHARE_AT + " ");
  8215. C[y.FACEBOOK] += t + encodeURIComponent(window.location.href + "&utm_source=1"),
  8216. C[y.TWITTER] += t + encodeURIComponent(window.location.href + "&utm_source=2 " + s.SHARE_WITH + " #port"),
  8217. C[y.MAIL] += encodeURIComponent(s.SHARE_EXPLORE + e + s.SHARE_3D) + "&body=" + t + encodeURIComponent(window.location.href + "&utm_source=3"),
  8218. u.addEventListener("click", this.toggle.bind(this)),
  8219. p.addEventListener("click", this.hide.bind(this)),
  8220. v.addEventListener("click", r),
  8221. d.addEventListener("click", o),
  8222. f.addEventListener("click", n.bind(this, y.FACEBOOK)),
  8223. g.addEventListener("click", n.bind(this, y.TWITTER)),
  8224. m.addEventListener("click", n.bind(this, y.MAIL)),
  8225. v.textContent = window.location.href + "&utm_source=4",
  8226. d.classList.add(a.isMobile() ? "mobile" : "desktop"),
  8227. u.classList.remove("hidden")
  8228. },
  8229. show: function() {
  8230. this.emit(l.OPENED),
  8231. d.classList.add("fadeIn")
  8232. },
  8233. hide: function() {
  8234. d.classList.contains("fadeIn") && (this.emit(l.CLOSED),
  8235. document.selection && document.selection.empty(),
  8236. window.getSelection().removeAllRanges(),
  8237. o(),
  8238. d.classList.remove("fadeIn"))
  8239. },
  8240. toggle: function() {
  8241. d.classList.contains("fadeIn") ? this.hide() : this.show()
  8242. }
  8243. };
  8244. c.extendObject(I, h.prototype),
  8245. t.exports = I
  8246. }
  8247. , {
  8248. "../../localization/localize": 108,
  8249. "../../util/browser": 182,
  8250. "../../util/common": 185,
  8251. "./ShareEvents": 76,
  8252. events: 202
  8253. }],
  8254. 78: [function(e, t, i) {
  8255. "use strict";
  8256. t.exports = Object.freeze({
  8257. OPENED: "terms.opened",
  8258. CLOSED: "terms.closed"
  8259. })
  8260. }
  8261. , {}],
  8262. 79: [function(e, t, i) {
  8263. "use strict";
  8264. var n = e("./TermsEvent")
  8265. , r = e("../../localization/localize")
  8266. , o = e("../../analytics")
  8267. , a = e("../../util/ajax")
  8268. , s = e("../../util/common")
  8269. , l = e("events").EventEmitter
  8270. , c = document.getElementById("terms-modal")
  8271. , h = {
  8272. init: function() {
  8273. $(".footer-terms").on("click", function(e) {
  8274. e.preventDefault(),
  8275. this.show()
  8276. }
  8277. .bind(this)),
  8278. $("#terms-modal .close").on("click", this.hide.bind(this))
  8279. },
  8280. show: function() {
  8281. this.emit(n.OPENED),
  8282. a.get("static/" + r.TERMS_TEXT_FILE).done(function(e) {
  8283. var t = $("#terms-text").html(e);
  8284. o.track("showcase_gui", {
  8285. gui_action: "click_terms_button",
  8286. interaction_source: "gui"
  8287. }),
  8288. t.find("a").attr("target", "_blank")
  8289. }).fail(function() {
  8290. $("#terms-text").html("<h1>" + r.TERMS_OF_USE + "</h1><p>" + r.TERMS_FAIL)
  8291. }),
  8292. c.classList.add("fadeIn")
  8293. },
  8294. hide: function(e) {
  8295. e && e.preventDefault(),
  8296. c.classList.contains("fadeIn") && this.emit(n.CLOSED),
  8297. c.classList.remove("fadeIn")
  8298. }
  8299. };
  8300. s.extendObject(h, l.prototype),
  8301. t.exports = h
  8302. }
  8303. , {
  8304. "../../analytics": 4,
  8305. "../../localization/localize": 108,
  8306. "../../util/ajax": 181,
  8307. "../../util/common": 185,
  8308. "./TermsEvent": 78,
  8309. events: 202
  8310. }],
  8311. 80: [function(e, t, i) {
  8312. "use strict";
  8313. t.exports = Object.freeze({
  8314. OPEN_INFO: "title.open.info",
  8315. CLOSE_INFO: "title.close.info",
  8316. SHOW_INFO: "title.show.info",
  8317. HIDE_INFO: "title.hide.info",
  8318. LINK_CLICKED: "title.link.click",
  8319. CONTACT_LINK_CLICKED: "title.contact.click",
  8320. ORIGIN_LINK_CLICKED: "title.origin.click"
  8321. })
  8322. }
  8323. , {}],
  8324. 81: [function(e, t, i) {
  8325. "use strict";
  8326. function n(e, t) {
  8327. o.tags.enabled && 0 !== Object.keys(e.tags).length && r(e, t)
  8328. }
  8329. function r(e, t) {
  8330. function i(i) {
  8331. e.shouldShowtags = "show" === this.value,
  8332. e.shouldShowtags ? t.showAlltags(o.tags.startup.fadeInDuration) : t.hideAlltags(o.tags.startup.fadeInDuration)
  8333. }
  8334. document.getElementById("tag-toggles").classList.remove("hidden"),
  8335. document.getElementById("radio-tag-show").checked = !0;
  8336. for (var n = document.getElementById("tag-inputs").querySelectorAll("input"), r = 0; r < n.length; r++)
  8337. n[r].addEventListener("change", i)
  8338. }
  8339. var o = e("../../settings");
  8340. t.exports.init = n
  8341. }
  8342. , {
  8343. "../../settings": 166
  8344. }],
  8345. 82: [function(e, t, i) {
  8346. (function(i) {
  8347. "use strict";
  8348. function n(e, t) {
  8349. return e && u.valueFromHash("title", 1) && 2 !== u.valueFromHash("mls", 0) ? (document.getElementsByClassName("titleText")[0].innerText = e, g_weixinObj.title = e,
  8350. e.length > g.minTooltipCharacters && I.parentElement.setAttribute("data-original-title", e),
  8351. t && 1 !== m.specialEdition && m.brand && !m.mls ? document.getElementById("cobrandTitle").innerText = t : (document.getElementsByClassName("co-brand")[0].classList.add("hidden"),
  8352. document.getElementById("gui-name").classList.add("noCoBrand"),
  8353. document.getElementById("cobrandTitle").classList.add("hidden")),
  8354. !0) : (document.getElementById("model-title").classList.add("hidden"),
  8355. !1)
  8356. }
  8357. function r(e) {
  8358. return e ? (L = !0,
  8359. void (_.innerHTML = e)) : void _.classList.add("hidden")
  8360. }
  8361. function o(e, t, i, n) {
  8362. if (!e && !t && !i || !m.brand || u.valueFromHash("mls", !1))
  8363. return void T.classList.add("hidden");
  8364. L = !0;
  8365. var r = []
  8366. , o = c(r, "<br>");
  8367. if (e && o('<span id="contactName">' + e + "</span>"),
  8368. t) {
  8369. var a = n || t
  8370. , s = u.isMobile() ? '<a id="phone" href="callto:' + t + '">' + a + "</a>" : "<span>" + a + "</span>";
  8371. o(s)
  8372. }
  8373. i && o('<a id="email" href="mailTo:' + i + '">' + i + "</a>"),
  8374. r[0] = "",
  8375. x.innerHTML = r.join("")
  8376. }
  8377. function a(e) {
  8378. if ("string" == typeof e)
  8379. try {
  8380. e = JSON.parse(e)
  8381. } catch (e) {
  8382. return y.warn("Unable to parse address data"),
  8383. void S.parentElement.classList.add("hidden")
  8384. }
  8385. if (!(e && (e.address_1 || e.address_2 || e.city || e.state || e.zip)))
  8386. return void S.parentElement.classList.add("hidden");
  8387. L = !0;
  8388. var t = []
  8389. , i = c(t, " ");
  8390. e.address_1 && i(e.address_1),
  8391. e.address_2 && i(e.address_2),
  8392. e.city && i(e.city, ", "),
  8393. e.state && i(e.state, ", "),
  8394. e.zip && i(e.zip, e.state ? " " : ", "),
  8395. t[0] = "",
  8396. S.innerText = t.join("")
  8397. }
  8398. function s(e) {
  8399. var t = document.createElement("a");
  8400. return t.id = "url",
  8401. t.target = "_blank",
  8402. t.href = e,
  8403. t.innerText = e,
  8404. t.addEventListener("click", N.emit.bind(N, v.ORIGIN_LINK_CLICKED)),
  8405. t
  8406. }
  8407. function l(e) {
  8408. return !(!e || u.inIframe() && document.referrer === e) && (R.classList.remove("hidden"),
  8409. P.innerHTML = f.WEBVR_LEARN_MORE + ": ",
  8410. P.appendChild(s(e)),
  8411. O.forEach(function(e) {
  8412. e.classList.add("share-link")
  8413. }),
  8414. !0)
  8415. }
  8416. function c(e, t) {
  8417. var i = e
  8418. , n = t;
  8419. return function(e, t) {
  8420. i.push(t || n, e)
  8421. }
  8422. }
  8423. function h() {
  8424. document.getElementById("title-toggle").addEventListener("click", N.toggleTitle.bind(N)),
  8425. L && I.addEventListener("click", N.toggleMeta.bind(N, !1));
  8426. var e = [].slice.call(_.querySelectorAll("a"));
  8427. e.forEach(function(e) {
  8428. e.addEventListener("click", N.emit.bind(N, v.LINK_CLICKED))
  8429. });
  8430. var t = [].slice.call(T.querySelectorAll("a"));
  8431. t.forEach(function(e) {
  8432. e.addEventListener("click", N.emit.bind(N, v.CONTACT_LINK_CLICKED, {
  8433. contact_type: e.getAttribute("id")
  8434. }))
  8435. })
  8436. }
  8437. var u = e("../../util/browser")
  8438. , d = e("../../util/common")
  8439. , p = e("../../util/logger")
  8440. , f = e("../../localization/localize")
  8441. , g = e("./titleBarSettings")
  8442. , m = e("../../settings")
  8443. , v = e("./TitleEvents")
  8444. , A = e("events").EventEmitter
  8445. , y = new p(i)
  8446. , C = document.querySelector(".pinTop.left")
  8447. , I = document.getElementsByClassName("title-container")[0]
  8448. , E = document.getElementById("title-toggle").querySelector("i")
  8449. , b = document.getElementById("meta-info-wrapper")
  8450. , w = document.getElementById("meta-info")
  8451. , _ = document.getElementById("meta-description")
  8452. , T = document.getElementsByClassName("contact-info")[0]
  8453. , x = document.getElementById("contact-data")
  8454. , S = document.getElementById("addressTxt")
  8455. , M = document.getElementById("tag-toggles")
  8456. , R = document.getElementById("share-origin")
  8457. , P = document.getElementById("share-link-wrapper")
  8458. , O = [w, b, I]
  8459. , L = !1
  8460. , D = !1
  8461. , N = {
  8462. populate: function(e) {
  8463. if (n(e.name, e.coBrand)) {
  8464. if (r(e.description),
  8465. o(e.contactName, e.phone, e.email, e.formatted_contact_phone),
  8466. a(e.address),
  8467. L) {
  8468. var t = document.createElement("br");
  8469. M.insertBefore(t, M.firstElementChild)
  8470. }
  8471. e.socialSharing && m.share.enabled && (D = l(e.url))
  8472. }
  8473. },
  8474. finishSetup: function(e) {
  8475. L = L || !!e,
  8476. h(),
  8477. L || (D ? I.classList.add("share-only") : I.classList.add("no-meta"))
  8478. },
  8479. toggleMeta: function(e, t) {
  8480. var title = document.getElementById("model-title");
  8481. t && t.preventDefault();
  8482. var i = w.classList.contains("expand");
  8483. e && !i || (i ? (O.forEach(function(e) {
  8484. e.classList.remove("expand")
  8485. }),
  8486. this.emit(v.CLOSE_INFO),title.classList.remove("expand")) : (O.forEach(function(e) {
  8487. e.classList.add("expand");
  8488. }),
  8489. title.classList.add("expand"),
  8490. this.emit(v.OPEN_INFO)))
  8491. },
  8492. setupToggling: function() {
  8493. b.style.height = w.offsetHeight + "px",
  8494. w.addEventListener("transitionend", function() {
  8495. b.style.height = w.offsetHeight + "px"
  8496. })
  8497. },
  8498. toggleTitle: function(e) {
  8499. e && e.preventDefault(),
  8500. C.classList.contains("closed") ? (C.classList.add("open"),
  8501. E.classList.remove("icon-dpad-right"),
  8502. E.classList.add("icon-dpad-left"),
  8503. this.emit(v.SHOW_INFO),
  8504. setTimeout(function() {
  8505. C.classList.remove("closed"),
  8506. C.classList.remove("open")
  8507. }, g.removeAnimationClasses)) : (C.classList.add("closed"),
  8508. E.classList.remove("icon-dpad-left"),
  8509. E.classList.add("icon-dpad-right"),
  8510. this.emit(v.HIDE_INFO))
  8511. }
  8512. };
  8513. d.extendObject(N, A.prototype),
  8514. t.exports = N
  8515. }
  8516. ).call(this, "/js/gui/title/titleBar.js")
  8517. }
  8518. , {
  8519. "../../localization/localize": 108,
  8520. "../../settings": 166,
  8521. "../../util/browser": 182,
  8522. "../../util/common": 185,
  8523. "../../util/logger": 189,
  8524. "./TitleEvents": 80,
  8525. "./titleBarSettings": 83,
  8526. events: 202
  8527. }],
  8528. 83: [function(e, t, i) {
  8529. "use strict";
  8530. t.exports = Object.freeze({
  8531. minTooltipCharacters: 19,
  8532. removeAnimationClasses: 500
  8533. })
  8534. }
  8535. , {}],
  8536. 84: [function(e, t, i) {
  8537. "use strict";
  8538. function n(e) {
  8539. C = e,
  8540. P.forEach(function(e) {
  8541. b.addEventListener(e, u.bind(this, !1), !0),
  8542. w.addEventListener(e, u.bind(this, !0), !0),
  8543. E.addEventListener(e, o, !0),
  8544. S.forEach(function(t) {
  8545. t.addEventListener(e, a, !0)
  8546. }),
  8547. $("#drawer img").on(e, a)
  8548. }),
  8549. document.addEventListener("keydown", u.bind(this, !1), !0),
  8550. C.on(v.TourStart, function() {
  8551. E.classList.add("playing")
  8552. })
  8553. }
  8554. function r() {
  8555. C.playTour(),
  8556. I && clearTimeout(I),
  8557. d(),
  8558. _.removeClass("fadeIn")
  8559. }
  8560. function o() {
  8561. E.classList.contains("playing") && (C.stopTour(),
  8562. _.addClass("fadeIn"),
  8563. setTimeout(function() {
  8564. _.removeClass("fadeIn")
  8565. }, p.tourInteraction.showPauseButton),
  8566. O || (clearTimeout(I),
  8567. I = setTimeout(h, p.tourInteraction.showModal)),
  8568. setTimeout(function() {
  8569. E.classList.remove("playing")
  8570. }, p.tourInteraction.allowNextClick))
  8571. }
  8572. function a() {
  8573. C.tourInProgress && (C.stopTour(),
  8574. C.endTourProgress(),
  8575. E.classList.remove("playing"))
  8576. }
  8577. function s() {
  8578. T.is(":visible") ? r() : o()
  8579. }
  8580. function l() {
  8581. x.hasClass("playing") && (clearTimeout(I),
  8582. C.atEndOfTour() ? c() : _.removeClass("fadeIn"))
  8583. }
  8584. function c() {
  8585. E.classList.remove("playing"),
  8586. h()
  8587. }
  8588. function h() {
  8589. if (!p.tourInteraction.disabled) {
  8590. M.removeClass("small landing " + g.FLOORPLAN + " " + g.OUTDOOR + " " + g.PANORAMA),
  8591. M.addClass("fadeIn tour " + m.deviceType);
  8592. var e = p.tourInteraction.smallModal ? y.SMALL : y.LARGE;
  8593. if (!p.tourInteraction.smallModal) {
  8594. var t;
  8595. 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,
  8596. m.fill(R, A.TOUR_INTERACTION[t]),
  8597. M.addClass(t)
  8598. }
  8599. M.addClass(e)
  8600. }
  8601. }
  8602. function u(e, t) {
  8603. if (t) {
  8604. var i = "keydown" === t.type
  8605. , n = t.which === f.SPACE || C.tourIsPlaying;
  8606. i && n || e || (O = !0),
  8607. C.atEndOfTour() && d(),
  8608. !C.tourIsPlaying && C.tourInProgress && (_.removeClass("fadeIn"),
  8609. d(),
  8610. t.which !== f.SPACE && a()),
  8611. i && n && s()
  8612. }
  8613. }
  8614. function d() {
  8615. M.removeClass("fadeIn")
  8616. }
  8617. var p = (e("../util/browser"),
  8618. e("../settings"))
  8619. , f = e("../enum/Keys")
  8620. , g = e("../enum/Viewmode")
  8621. , m = (e("./helpManager"),
  8622. e("./populateModal"))
  8623. , v = e("../enum/DirectorEvents")
  8624. , A = e("../enum/HelpModalType")
  8625. , y = e("../enum/HelpModalSize")
  8626. , C = null
  8627. , I = null
  8628. , E = document.getElementById("pause-overlay")
  8629. , b = document.getElementById("player")
  8630. , w = document.getElementById("gui")
  8631. , _ = $("#pause-icon").eq(0)
  8632. , T = $("#play").eq(0)
  8633. , x = $("#playHead").eq(0)
  8634. , S = $(".rightViewContainer, #previous, #next, #gui-modes-inside, #gui-modes-outside, #gui-modes-dollhouse, #gui-modes-floorplan").toArray()
  8635. , M = $("#interaction-modal").eq(0)
  8636. , R = $("#interaction-modal .interaction").toArray()
  8637. , P = ["touchstart", "mousedown", "pointerdown"]
  8638. , O = !1;
  8639. t.exports.init = n,
  8640. t.exports.play = r,
  8641. t.exports.pause = o,
  8642. t.exports.pauseWithoutCTA = a,
  8643. t.exports.togglePlay = s,
  8644. t.exports.stopTour = l,
  8645. t.exports.dismissModal = d
  8646. }
  8647. , {
  8648. "../enum/DirectorEvents": 23,
  8649. "../enum/HelpModalSize": 27,
  8650. "../enum/HelpModalType": 28,
  8651. "../enum/Keys": 30,
  8652. "../enum/Viewmode": 51,
  8653. "../settings": 166,
  8654. "../util/browser": 182,
  8655. "./helpManager": 68,
  8656. "./populateModal": 75
  8657. }],
  8658. 85: [function(e, t, i) {
  8659. "use strict";
  8660. t.exports = Object.freeze({
  8661. OPENED: "vr.modal.opened",
  8662. LAUNCH: "vr.modal.launch",
  8663. CLOSED: "vr.modal.closed",
  8664. NEXT: "vr.modal.next",
  8665. PREV: "vr.modal.prev",
  8666. STORE: "vr.modal.store",
  8667. falseICECHOSEN: "vr.modal.device"
  8668. })
  8669. }
  8670. , {}],
  8671. 86: [function(e, t, i) {
  8672. "use strict";
  8673. function n(e, t, i) {
  8674. function n(e, t, n, r) {
  8675. function o() {
  8676. return p + "&m=" + t + "&display=" + e
  8677. }
  8678. function s() {
  8679. var e = "&utm_medium=" + (a.inIframe() ? "embed" : "direct")
  8680. , t = "&utm_source=" + u
  8681. , n = "&utm_showcase_session_id=" + i;
  8682. return e + t + n
  8683. }
  8684. function l() {
  8685. return d + "&sids=" + t + "&lsid=" + t + "&ln=" + encodeURIComponent(n) + "&ld=" + encodeURIComponent(r) + "&display=" + e
  8686. }
  8687. return a.valueFromHash("vrcoll", !1) ? l() + s() : o() + s()
  8688. }
  8689. function r(e, t, i, r) {
  8690. var o = "https://api.branch.io/v1/url"
  8691. , a = n(e, t, i, r)
  8692. , s = {
  8693. responseType: "json",
  8694. data: {
  8695. branch_key: h.appConfig.branch_key,
  8696. data: {
  8697. m: t,
  8698. full_url: a,
  8699. $desktop_url: m,
  8700. $og_app_id: "331853976762864119",
  8701. $og_title: i,
  8702. $og_description: r,
  8703. $og_image_url: location.origin + "/api/v1/player/models/" + t + "/thumb",
  8704. $canonical_url: window.location.href
  8705. }
  8706. }
  8707. };
  8708. c.post(o, s).done(function(t) {
  8709. f[e] = t.url
  8710. }).fail(function(t) {
  8711. f[e] = t
  8712. }
  8713. .bind(this, a))
  8714. }
  8715. function o(e, t, i) {
  8716. for (var r in s) {
  8717. var o = s[r]
  8718. , a = n(o, e, t, i);
  8719. f[o] = a
  8720. }
  8721. }
  8722. var u = a.inIframe() ? encodeURIComponent(document.referrer) : encodeURIComponent(window.location.href)
  8723. , d = g + "/vr/dlist/?ret=" + u
  8724. , p = g + "/vr/show/?ret=" + u
  8725. , m = "";
  8726. switch (e) {
  8727. case l.IOS:
  8728. r(s.CardboardIOS, t.sid, t.name, t.summary);
  8729. break;
  8730. default:
  8731. o(t.sid, t.name, t.summary)
  8732. }
  8733. }
  8734. function r(e) {
  8735. var t = f[e];
  8736. window.open(t, "_blank")
  8737. }
  8738. function o(e) {
  8739. var t = u[e];
  8740. window.open(t, "_blank")
  8741. }
  8742. var a = e("../../util/browser")
  8743. , s = e("../../enum/VRApps")
  8744. , l = e("../../enum/VRPlatforms")
  8745. , c = e("../../util/ajax")
  8746. , h = e("../../settings")
  8747. , u = {};
  8748. u[s.CardboardAndroid] = "https://play.google.com/store/apps/details?id=com.port.mpvrcardboard&redirect_uri=",
  8749. u[s.CardboardIOS] = "https://itunes.apple.com/us/app/port-vr/id1168808473&redirect_uri=",
  8750. u[s.GearVR] = "https://www.oculus.com/experiences/gear-vr/811670972252145/?redirect_uri=";
  8751. for (var d in s) {
  8752. var p = s[d];
  8753. u[p] += encodeURIComponent(document.referrer + "&display=" + p)
  8754. }
  8755. var f = {}
  8756. , g = function() {
  8757. var e = window.location.host;
  8758. return e.indexOf(".port.com") === -1 && e.indexOf("localhost") === -1 && (e = "my.port.com"),
  8759. "https://" + e
  8760. }();
  8761. t.exports.init = n,
  8762. t.exports.launch = r,
  8763. t.exports.launchStore = o
  8764. }
  8765. , {
  8766. "../../enum/VRApps": 46,
  8767. "../../enum/VRPlatforms": 49,
  8768. "../../settings": 166,
  8769. "../../util/ajax": 181,
  8770. "../../util/browser": 182
  8771. }],
  8772. 87: [function(e, t, i) {
  8773. "use strict";
  8774. function n(e) {
  8775. var t;
  8776. switch (e) {
  8777. case m.IOS:
  8778. return t = p.iosVersion(),
  8779. t.major > 9 || 9 === t.major && t.minor >= 1;
  8780. case m.Android:
  8781. return t = p.androidVersion(),
  8782. t.major > 4 || 4 === t.major && t.minor > 4 || 4 === t.major && 4 === t.minor && t.patch >= 4
  8783. }
  8784. return !1
  8785. }
  8786. function r(e, t) {
  8787. function i(e) {
  8788. K.emit(A.STORE, {
  8789. type: e
  8790. }),
  8791. f.launchStore(e)
  8792. }
  8793. function r(e) {
  8794. switch (e !== _.pageCount && (a(e),
  8795. N.text(e + 1 + " / " + _.pageCount)),
  8796. e) {
  8797. case _.Title:
  8798. O.css("display", "none"),
  8799. L.text(u[e]),
  8800. o(s);
  8801. break;
  8802. case _.Cardboard:
  8803. O.css("display", "block"),
  8804. L.text(u[e]),
  8805. M.filter(".cardboard").off(),
  8806. M.filter(".gearvr").off(),
  8807. c(e, s),
  8808. h(H, X, Z);
  8809. break;
  8810. case _.Gear:
  8811. L.text(u[e]),
  8812. c(e, s),
  8813. T.addClass("lastPage"),
  8814. h(G, X, Z);
  8815. break;
  8816. case _.pageCount:
  8817. T.removeClass("fadeIn"),
  8818. K.emit(A.CLOSED)
  8819. }
  8820. B.filter("[src='']").hide()
  8821. }
  8822. var s = function() {
  8823. return p.detectAndroid() ? p.detectAndroidMobile() && n(m.Android) ? (T.addClass("supported"),
  8824. w = ".show-supported",
  8825. m.Android) : (T.addClass("unsupported"),
  8826. w = ".show-unsupported",
  8827. m.UnsupportedAndroid) : p.detectIPhone() || p.detectIPod() ? (T.addClass("ios"),
  8828. w = ".show-ios",
  8829. _ = v.ios,
  8830. m.IOS) : (T.addClass("desktop"),
  8831. w = ".show-desktop",
  8832. m.Desktop)
  8833. }();
  8834. f.init(s, e, t),
  8835. s !== m.Desktop && T.addClass("mobile");
  8836. var l = function(e) {
  8837. K.emit(A.LAUNCH, {
  8838. vr_platform: s,
  8839. vr_app: e
  8840. }),
  8841. f.launch(e)
  8842. };
  8843. q.cardboardAndroid = l.bind(this, g.CardboardAndroid),
  8844. q.gear = l.bind(this, g.GearVR),
  8845. q.cardboardIOS = l.bind(this, g.CardboardIOS),
  8846. d(),
  8847. $(".show-supported, .show-unsupported, .show-ios, .show-desktop").hide(),
  8848. $(w).show();
  8849. var u = [C.VR_LEARN_MORE_CAPS, C.VR_NEXT_CAPS, C.VR_GOT_IT_CAPS]
  8850. , y = ["vr_modal_learn_more", "vr_modal_next", "vr_modal_done"];
  8851. s === m.IOS && (u.splice(1, 1),
  8852. y.splice(1, 1)),
  8853. $("#vr").on("click", function(e) {
  8854. e.preventDefault(),
  8855. T.hasClass("fadeIn") ? K.dismiss() : (b = 0,
  8856. r(b),
  8857. T.addClass("fadeIn"),
  8858. K.emit(A.OPENED))
  8859. });
  8860. var I = "https://my.port.com/vr/show/?m=" + e.sid;
  8861. s === m.IOS ? $(".cardboardLink").on("click", i.bind(this, g.CardboardIOS)) : $(".cardboardLink").on("click", i.bind(this, g.CardboardAndroid)),
  8862. $(".gearLink").on("click", i.bind(this, g.GearVR)),
  8863. $("span.modelLink").text(I),
  8864. O.on("click", function(e) {
  8865. K.emit(A.PREV),
  8866. b--,
  8867. r(b)
  8868. }),
  8869. L.on("click", function(e) {
  8870. L.text();
  8871. K.emit(A.NEXT, {
  8872. nextAction: y[b]
  8873. }),
  8874. b++,
  8875. r(b)
  8876. }),
  8877. T.find(".close").on("click", K.dismiss)
  8878. }
  8879. function o(e) {
  8880. switch (e) {
  8881. case m.Android:
  8882. M.filter(".cardboard").off().on("click", q.cardboardAndroid),
  8883. M.filter(".gearvr").off().on("click", q.gear),
  8884. s(H, G, "logo-button", "same-line");
  8885. break;
  8886. case m.UnsupportedAndroid:
  8887. s("", z, "", "");
  8888. break;
  8889. case m.IOS:
  8890. M.filter(".cardboard").off().on("click", q.cardboardIOS),
  8891. s(H, "", "logo-button", "");
  8892. break;
  8893. case m.Desktop:
  8894. M.filter(".cardboard").off().on("click", l.bind(this, null, F, U)),
  8895. M.filter(".gearvr").off().on("click", l.bind(this, G, V, null)),
  8896. s(H, G, "logo-button", "same-line"),
  8897. Q.cardboard()
  8898. }
  8899. }
  8900. function a(e) {
  8901. $(".p1, .p2, .p3").hide(),
  8902. x.insertAfter(S),
  8903. T.removeClass("front-page"),
  8904. T.removeClass("details-page"),
  8905. T.removeClass("lastPage"),
  8906. M.removeClass("logo-button"),
  8907. M.removeClass("same-line"),
  8908. S.removeClass("headsetOptions"),
  8909. R.attr("src", ""),
  8910. R.filter(".second").removeClass("gear"),
  8911. R.css("display", "inline-block"),
  8912. R.off(),
  8913. P.filter(".second").css("display", ""),
  8914. D.css("display", "none"),
  8915. $(".p" + (e + 1) + w).show(),
  8916. R.filter(".third").insertBefore(P.filter(".third"))
  8917. }
  8918. function s(e, t, i, n) {
  8919. T.addClass("front-page"),
  8920. R.filter(".first").attr("src", e),
  8921. R.filter(".second").attr("src", t),
  8922. M.filter(".first").addClass(i),
  8923. M.filter(".second").addClass(i),
  8924. M.addClass(n),
  8925. ".show-desktop" === w && S.insertAfter(x)
  8926. }
  8927. function l(e, t, i) {
  8928. S.addClass("headsetOptions"),
  8929. M.off(),
  8930. R.filter(".second").attr("src", t),
  8931. D.css("display", "block"),
  8932. P.filter(".second").css("display", "none"),
  8933. D.on("click", function() {
  8934. a(_.Title),
  8935. o(m.Desktop)
  8936. }),
  8937. e && (K.emit(A.falseICECHOSEN, {
  8938. name: g.GearVR
  8939. }),
  8940. R.filter(".first").attr("src", e),
  8941. R.filter(".second").addClass("gear"),
  8942. R.filter(".second").on("click", f.launchStore.bind(this, g.GearVR)),
  8943. Q.gearvr()),
  8944. i && (K.emit(A.falseICECHOSEN, {
  8945. name: g.Cardboard
  8946. }),
  8947. R.filter(".third").attr("src", i),
  8948. R.filter(".third").show(),
  8949. R.filter(".third").insertAfter(R.filter(".second")),
  8950. R.filter(".third").addClass("link"),
  8951. R.filter(".second").addClass("link"),
  8952. R.filter(".second").on("click", f.launchStore.bind(this, g.CardboardIOS)),
  8953. R.filter(".third").on("click", f.launchStore.bind(this, g.CardboardAndroid)),
  8954. Q.cardboard())
  8955. }
  8956. function c(e, t) {
  8957. switch (t) {
  8958. case m.IOS:
  8959. X = Y,
  8960. Z = j;
  8961. break;
  8962. case m.Desktop:
  8963. e === _.Cardboard ? (X = F,
  8964. Z = U,
  8965. R.filter(".second").on("click", f.launchStore.bind(this, g.CardboardIOS)),
  8966. R.filter(".third").on("click", f.launchStore.bind(this, g.CardboardAndroid))) : (X = V,
  8967. R.filter(".second").on("click", f.launchStore.bind(this, g.GearVR)),
  8968. Z = "");
  8969. break;
  8970. default:
  8971. e === _.Cardboard ? (X = z,
  8972. Z = j) : (X = k,
  8973. Z = W)
  8974. }
  8975. }
  8976. function h(e, t, i) {
  8977. T.find(".inner").addClass("details-page"),
  8978. T.addClass("details-page"),
  8979. R.filter(".first").attr("src", e),
  8980. R.filter(".second").attr("src", t),
  8981. R.filter(".third").attr("src", i)
  8982. }
  8983. function u() {
  8984. T.hasClass("fadeIn") && (T.removeClass("fadeIn"),
  8985. K.emit(A.CLOSED))
  8986. }
  8987. function d() {
  8988. var e = p.aspectRatio() > 1 && p.isMobile();
  8989. T.toggleClass("landscape", e).toggleClass("portrait", !e),
  8990. T.toggleClass("tiny", $("#player").height() <= y.narrowLandscapeHeight),
  8991. T.toggleClass("tinier", $("#player").height() <= y.reallyNarrowLandscapeHeight)
  8992. }
  8993. var p = e("../../util/browser")
  8994. , f = e("./vrLink")
  8995. , g = e("../../enum/VRApps")
  8996. , m = e("../../enum/VRPlatforms")
  8997. , v = e("../../enum/VRPages")
  8998. , A = e("./vrEvent")
  8999. , y = (e("../../settings"),
  9000. e("../../constants"))
  9001. , C = e("../../localization/localize")
  9002. , I = e("../../util/common")
  9003. , E = e("events").EventEmitter
  9004. , b = 0
  9005. , w = null
  9006. , _ = v.standard
  9007. , T = $(".vr-popup")
  9008. , x = T.find(".vr-popup-body")
  9009. , S = T.find(".vr-images")
  9010. , M = T.find(".img-container")
  9011. , R = T.find(".vr-sm-image")
  9012. , P = M.find(".vr-img-caption")
  9013. , O = $(".vr-buttons").find(".prev-button")
  9014. , L = $(".vr-buttons").find(".next-button")
  9015. , D = S.find(".front-close")
  9016. , N = $(".vr-page")
  9017. , B = T.find("img")
  9018. , F = "images/apple-store.png"
  9019. , V = "images/badge-oculus.png"
  9020. , U = "images/badge-cardboard.png"
  9021. , k = "images/logo-samsung.png"
  9022. , H = "images/headset-cardboard.png"
  9023. , G = "images/headset-gearvr.png"
  9024. , z = "images/ico-android-robot.png"
  9025. , W = "images/ico-gearvr.png"
  9026. , j = "images/ico-vr.png"
  9027. , Y = "images/apple-logo-white.svg"
  9028. , X = null
  9029. , Z = null
  9030. , q = {}
  9031. , K = {
  9032. init: r,
  9033. dismiss: u,
  9034. isDeviceSupported: n
  9035. };
  9036. I.extendObject(K, E.prototype),
  9037. $(window).resize(d);
  9038. var Q = function() {
  9039. var e = P.filter(".first").find(".cardboard")
  9040. , t = P.filter(".first").find(".gearvr");
  9041. return {
  9042. cardboard: function() {
  9043. t.addClass("hidden"),
  9044. e.removeClass("hidden")
  9045. },
  9046. gearvr: function() {
  9047. e.addClass("hidden"),
  9048. t.removeClass("hidden")
  9049. }
  9050. }
  9051. }();
  9052. t.exports = K
  9053. }
  9054. , {
  9055. "../../constants": 8,
  9056. "../../enum/VRApps": 46,
  9057. "../../enum/VRPages": 48,
  9058. "../../enum/VRPlatforms": 49,
  9059. "../../localization/localize": 108,
  9060. "../../settings": 166,
  9061. "../../util/browser": 182,
  9062. "../../util/common": 185,
  9063. "./vrEvent": 85,
  9064. "./vrLink": 86,
  9065. events: 202
  9066. }],
  9067. 88: [function(e, t, i) {
  9068. "use strict";
  9069. t.exports = Object.freeze({
  9070. OPENED: "webvr.modal.opened",
  9071. SHOW_TERMS: "webvr.footer.show.terms"
  9072. })
  9073. }
  9074. , {}],
  9075. 89: [function(e, t, i) {
  9076. (function(i) {
  9077. "use strict";
  9078. function n(e, t, i, n) {
  9079. function r(e) {
  9080. e.preventDefault(),
  9081. a(e.currentTarget.id)
  9082. }
  9083. function a(e) {
  9084. ne[e](),
  9085. Object.keys(ne).map(function(t, i) {
  9086. $("#" + t).toggleClass("tabs-underlined", t === e)
  9087. })
  9088. }
  9089. y = i,
  9090. v = t,
  9091. w.init(E.Android, e, n),
  9092. m();
  9093. var l = new RegExp("daydream","i")
  9094. , c = l.test(y.displayName);
  9095. c ? (a("tabdaydream"),
  9096. B.filter(".device-headset-side").attr("src", H),
  9097. D.find(".title").text(x.localizeText("WEBVR_FOR_DAYDREAM"))) : (a("tabcardboard"),
  9098. B.filter(".device-headset-side").attr("src", Y),
  9099. D.find(".title").text(x.localizeText("WEBVR_FOR_CARDBOARD"))),
  9100. $("#vr").on("click", function(e) {
  9101. e.preventDefault(),
  9102. g("click_webvr_button"),
  9103. L.is(":hidden") && (ie.emit(_.OPENED),
  9104. o())
  9105. }),
  9106. $(".webvr-popup .close").on("click", function(e) {
  9107. e.preventDefault(),
  9108. D.hasClass("hidden") ? (g("webvr_help_close"),
  9109. p()) : s()
  9110. }),
  9111. $("#tabcardboard").on("click", r),
  9112. $("#tabdaydream").on("click", r),
  9113. $("#tabnative").on("click", r),
  9114. $(".webvr-popup .open-with-app").on("click", function(e) {
  9115. e.preventDefault(),
  9116. g("webvr_learn_more"),
  9117. a("tabnative"),
  9118. p()
  9119. }),
  9120. $(".webvr-popup .help").on("click", function(e) {
  9121. e.preventDefault(),
  9122. g(D.hasClass("hidden") ? "webvr_help_close" : "webvr_help_show"),
  9123. p()
  9124. }),
  9125. $(".webvr-popup .terms").on("click", function(e) {
  9126. e.preventDefault(),
  9127. g("webvr_click_terms"),
  9128. s(),
  9129. ie.emit(_.SHOW_TERMS)
  9130. }),
  9131. F.on("click", function(e) {
  9132. e.preventDefault(),
  9133. g(ee),
  9134. window.open(J, "_blank")
  9135. }),
  9136. V.on("click", function(e) {
  9137. e.preventDefault(),
  9138. g("webvr_phone_link"),
  9139. window.open(te, "_blank")
  9140. }),
  9141. $(".webvr-popup .badge-cardboard").on("click", function(e) {
  9142. e.preventDefault(),
  9143. g("webvr_cardboard_link"),
  9144. w.launch(b.CardboardAndroid)
  9145. }),
  9146. $(".webvr-popup .badge-oculus").on("click", function(e) {
  9147. e.preventDefault(),
  9148. g("webvr_oculus_link"),
  9149. w.launch(b.GearVR)
  9150. })
  9151. }
  9152. function r() {
  9153. function e() {
  9154. y.isPresenting || (f(),
  9155. window.removeEventListener("vrdisplaypresentchange", e))
  9156. }
  9157. R.info("Headset mounted"),
  9158. v.suspend();
  9159. var t = document.createElement("canvas");
  9160. for (t.getContext("webgl"),
  9161. t.className = "webvr-canvas",
  9162. document.bgColor = "#000",
  9163. document.body.style.backgroundColor = "#000"; document.body.firstChild; )
  9164. document.body.removeChild(document.body.firstChild);
  9165. document.body.appendChild(t),
  9166. g("webvr_enter_app"),
  9167. y.requestPresent([{
  9168. source: t,
  9169. predistorted: !0
  9170. }]).catch(function(t) {
  9171. R.error("Failed to present: " + t),
  9172. g("webvr_exit_calibrate"),
  9173. e()
  9174. }),
  9175. A.then(function() {
  9176. window.dispatchEvent(new Event("vrapp-start"))
  9177. }),
  9178. window.addEventListener("vrdisplaypresentchange", e)
  9179. }
  9180. function o() {
  9181. O.fadeOut(I.guiAnimationSpeed),
  9182. L.fadeIn(I.guiAnimationSpeed),
  9183. a()
  9184. }
  9185. function a() {
  9186. if (!A) {
  9187. var e = C.valueFromHash("webvr") || I.appConfig.webvr_version
  9188. , t = "https://static.port.com/webvr/" + e + "/js/main.js";
  9189. A = new Promise(function(e, i) {
  9190. var n = document.createElement("script");
  9191. n.type = "text/javascript",
  9192. n.src = t,
  9193. n.onload = e,
  9194. document.head.appendChild(n)
  9195. }
  9196. )
  9197. }
  9198. D.find(".enter-button").on("click", r)
  9199. }
  9200. function s() {
  9201. g("webvr_modal_close"),
  9202. D.find(".enter-button").off("click", r),
  9203. L.fadeOut(I.guiAnimationSpeed, function() {
  9204. D.toggleClass("hidden", !1),
  9205. N.toggleClass("hidden", !0),
  9206. C.exitFullscreen()
  9207. }),
  9208. O.fadeIn(I.guiAnimationSpeed)
  9209. }
  9210. function l() {
  9211. k.toggleClass("hidden", !1),
  9212. U.toggleClass("hidden", !0)
  9213. }
  9214. function c() {
  9215. k.toggleClass("hidden", !0),
  9216. U.toggleClass("hidden", !1)
  9217. }
  9218. function h() {
  9219. B.filter(".device-headset").attr("src", G),
  9220. B.filter(".device-phone").attr("src", z),
  9221. J = Z,
  9222. ee = K,
  9223. F.text(x.localizeText("WEBVR_DAYDREAM_VIEW")),
  9224. V.text(x.localizeText("VR_NEED_DAYDREAM_PHONE")),
  9225. $(".webvr-popup .detail.daydream-label").toggleClass("hidden", !1),
  9226. c()
  9227. }
  9228. function u() {
  9229. B.filter(".badge-cardboard").attr("src", j),
  9230. B.filter(".badge-oculus").attr("src", X),
  9231. l()
  9232. }
  9233. function d() {
  9234. B.filter(".device-headset").attr("src", Y),
  9235. B.filter(".device-phone").attr("src", W),
  9236. J = q,
  9237. ee = Q,
  9238. F.text(x.localizeText("VR_GOOGLE_CARDBOARD")),
  9239. V.text(x.localizeText("VR_COMPATIBLE_ANDROID_LONG")),
  9240. $(".webvr-popup .detail.daydream-label").toggleClass("hidden", !0),
  9241. c()
  9242. }
  9243. function p() {
  9244. D.toggleClass("hidden"),
  9245. N.toggleClass("hidden")
  9246. }
  9247. function f() {
  9248. R.info("exiting webVR"),
  9249. g("webvr_exit_app"),
  9250. window.location.search.indexOf("&qs=1") === -1 ? window.location = window.location + "&qs=1" : window.location = window.location
  9251. }
  9252. function g(e) {
  9253. var t = C.isLandscape() ? "landscape" : "portrait";
  9254. T.trackAlways("showcase_gui", {
  9255. gui_action: e,
  9256. orientation: t
  9257. })
  9258. }
  9259. function m() {
  9260. var e = C.isLandscape();
  9261. L.toggleClass("landscape", e).toggleClass("portrait", !e)
  9262. }
  9263. var v, A, y, C = e("../../util/browser"), I = e("../../settings"), E = (e("./../gui"),
  9264. e("../../enum/VRPlatforms")), b = e("../../enum/VRApps"), w = e("./../vr/vrLink"), _ = e("./WebVrEvent"), T = e("../../analytics"), x = (e("../../constants"),
  9265. 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 = {
  9266. init: n
  9267. }, ne = {
  9268. tabcardboard: d,
  9269. tabdaydream: h,
  9270. tabnative: u
  9271. };
  9272. S.extendObject(ie, P.prototype),
  9273. $(window).resize(m),
  9274. t.exports = ie
  9275. }
  9276. ).call(this, "/js/gui/webvr/webVRgui.js")
  9277. }
  9278. , {
  9279. "../../analytics": 4,
  9280. "../../constants": 8,
  9281. "../../enum/VRApps": 46,
  9282. "../../enum/VRPlatforms": 49,
  9283. "../../localization/localize": 108,
  9284. "../../settings": 166,
  9285. "../../util/browser": 182,
  9286. "../../util/common": 185,
  9287. "../../util/logger": 189,
  9288. "./../gui": 65,
  9289. "./../vr/vrLink": 86,
  9290. "./WebVrEvent": 88,
  9291. events: 202
  9292. }],
  9293. 90: [function(e, t, i) {
  9294. "use strict";
  9295. function n(e, t, i, n, o) {
  9296. n || 0 === n ? this.floorId = n : this.floorId = -1,
  9297. this.roomId = o || "",
  9298. this.labelId = e,
  9299. this.position = (new r.Vector3).copy(t),
  9300. this.text = i
  9301. }
  9302. var r = e("three")
  9303. , o = e("../util/browser");
  9304. n.prototype.build = function() {
  9305. var e = window.document.createElement("div");
  9306. o.isMobile() ? e.setAttribute("class", "gui-floorplan-label gui-floorplan-label-mobile") : e.setAttribute("class", "gui-floorplan-label");
  9307. var t = window.document.createElement("div");
  9308. t.setAttribute("class", "gui-floorplan-label-text");
  9309. var i = window.document.createTextNode(this.text);
  9310. t.appendChild(i),
  9311. e.appendChild(t),
  9312. window.document.body.appendChild(e),
  9313. this.labelGui = e,
  9314. this.textBlock = t,
  9315. $(this.labelGui).hide();
  9316. var n = window.getComputedStyle(this.labelGui);
  9317. this.initialTransform = n.transform || n.webkitTransform
  9318. }
  9319. ,
  9320. t.exports = n
  9321. }
  9322. , {
  9323. "../util/browser": 182,
  9324. three: 217
  9325. }],
  9326. 91: [function(e, t, i) {
  9327. "use strict";
  9328. function n() {
  9329. this.player = null,
  9330. this.modelManager = null,
  9331. this.container = null
  9332. }
  9333. var r = e("three")
  9334. , o = (e("../util/common"),
  9335. e("../enum/PlayerEvents"))
  9336. , a = (e("../enum/DirectorEvents"),
  9337. e("../enum/ModelManagerEvents"))
  9338. , s = e("../settings")
  9339. , l = e("../enum/Viewmode")
  9340. , c = (e("../enum/WarpStyle"),
  9341. e("../util/transitions"),
  9342. e("../util/lerp"),
  9343. e("../util/browser"));
  9344. n.prototype.init = function(e, t, i) {
  9345. this.player = e,
  9346. this.modelManager = t,
  9347. this.container = i,
  9348. this.updateModel(),
  9349. this.bindEvents()
  9350. }
  9351. ,
  9352. n.prototype.bindEvents = function() {
  9353. this.modelManager.on(a.ActiveModelChanged, this.updateModel.bind(this)),
  9354. this.player.on(o.ViewChanged, this.handlePlayerViewChanged.bind(this)),
  9355. this.player.on(o.ModeChanged, this.handlePlayerViewChanged.bind(this)),
  9356. this.player.on(o.StartInside, this.handleStartInside.bind(this)),
  9357. this.player.on(o.StartOutside, this.handleStartOutside.bind(this))
  9358. }
  9359. ,
  9360. n.prototype.updateModel = function() {
  9361. this.model = this.modelManager.getActiveModel()
  9362. }
  9363. ,
  9364. n.prototype.handlePlayerViewChanged = function() {
  9365. this.updateLabelVisibility(),
  9366. this.updateLabelDisplay()
  9367. }
  9368. ,
  9369. n.prototype.getLabelsForFloor = function(e, t) {
  9370. return t = t || [],
  9371. t.length = 0,
  9372. this.model.labels.forEach(function(i) {
  9373. this.labelVisibleForFloor(i, e) && t.push(i)
  9374. }
  9375. .bind(this)),
  9376. t
  9377. }
  9378. ,
  9379. n.prototype.getLabelsForCurrentFloor = function(e) {
  9380. return this.getLabelsForFloor(this.model.currentFloor.floorIndex, e)
  9381. }
  9382. ,
  9383. n.prototype.labelVisibleForFloor = function(e, t) {
  9384. var i = c.isMobile() && this.player.getLabelScaleFactor() < s.labels.zoomHideThreshhold.mobile || !c.isMobile() && this.player.getLabelScaleFactor() < s.labels.zoomHideThreshhold.desktop;
  9385. if (!this.model.showingLabels || !e.labelGui || !i)
  9386. return !1;
  9387. var n = e.floorId === this.model.floors.size() - 1;
  9388. return this.model.allFloorsVisible ? n : e.floorId === t
  9389. }
  9390. ,
  9391. n.prototype.updateLabelVisibility = function(e) {
  9392. this.model.labels.forEach(function(e) {
  9393. 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)
  9394. }
  9395. .bind(this))
  9396. }
  9397. ,
  9398. n.prototype.showAllLabels = function(e, t) {
  9399. this.model.labels.forEach(function(i) {
  9400. this.showLabel(i, e, t)
  9401. }
  9402. .bind(this))
  9403. }
  9404. ,
  9405. n.prototype.hideAllLabels = function(e, t) {
  9406. this.model.labels.forEach(function(i) {
  9407. this.hideLabel(i, e, t)
  9408. }
  9409. .bind(this))
  9410. }
  9411. ,
  9412. n.prototype.showLabel = function(e, t, i) {
  9413. this.model.showingLabels && (e.visible || (e.visible = !0,
  9414. e.labelGui.style.display = "block",
  9415. e.labelGui.style.opacity = 0,
  9416. $(e.labelGui).delay(t).fadeTo(i, 1)))
  9417. }
  9418. ,
  9419. n.prototype.hideLabel = function(e, t, i) {
  9420. e.visible && (e.visible = !1,
  9421. c.isMobile() ? $(e.labelGui).hide() : $(e.labelGui).delay(t).fadeOut(i))
  9422. }
  9423. ,
  9424. n.prototype.supportedMode = function() {
  9425. return this.player.mode === l.FLOORPLAN
  9426. }
  9427. ,
  9428. n.prototype.updateLabelDisplay = function() {
  9429. var e = (new r.Vector3,
  9430. new r.Vector3,
  9431. []);
  9432. return function() {
  9433. var t = this.player.getLabelScaleFactor()
  9434. , i = .6
  9435. , n = 1.2
  9436. , r = (1 - t) * n + i
  9437. , o = c.isMobile() ? s.labels.zoomTruncateThreshhold.mobile : s.labels.zoomTruncateThreshhold.desktop;
  9438. this.getLabelsForCurrentFloor(e);
  9439. for (var a = 0; a < e.length; a++) {
  9440. var l = e[a];
  9441. this.supportedMode() && l.labelGui && (this.updateProjectedGuiElement(l.labelGui, l.textBlock, l.position, r, r),
  9442. 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)
  9443. }
  9444. }
  9445. }(),
  9446. n.prototype.updateProjectedGuiElement = function() {
  9447. var e = new r.Vector3;
  9448. new r.Vector3;
  9449. return function(t, i, n, r, o) {
  9450. i.style.fontSize = 100 * o + "%";
  9451. var a = $("#player").width()
  9452. , s = $("#player").height()
  9453. , l = .5 * a
  9454. , c = .5 * s;
  9455. e.copy(n),
  9456. e.project(this.player.camera);
  9457. var h = e.x * l + l
  9458. , u = -(e.y * c) + c;
  9459. h -= t.offsetWidth / 2,
  9460. u -= t.offsetHeight / 2,
  9461. t.style.left = h + "px",
  9462. t.style.top = u + "px"
  9463. }
  9464. }(),
  9465. n.prototype.handleStartInside = function(e) {
  9466. this.updateLabelVisibility()
  9467. }
  9468. ,
  9469. n.prototype.handleStartOutside = function() {
  9470. this.updateLabelVisibility()
  9471. }
  9472. ,
  9473. t.exports = n
  9474. }
  9475. , {
  9476. "../enum/DirectorEvents": 23,
  9477. "../enum/ModelManagerEvents": 33,
  9478. "../enum/PlayerEvents": 40,
  9479. "../enum/Viewmode": 51,
  9480. "../enum/WarpStyle": 52,
  9481. "../settings": 166,
  9482. "../util/browser": 182,
  9483. "../util/common": 185,
  9484. "../util/lerp": 188,
  9485. "../util/transitions": 195,
  9486. three: 217
  9487. }],
  9488. 92: [function(e, t, i) {
  9489. "use strict";
  9490. Array.prototype.findIndex || (Array.prototype.findIndex = function(e) {
  9491. if (null == this)
  9492. throw new TypeError("Array.prototype.findIndex called on null or undefined");
  9493. if ("function" != typeof e)
  9494. throw new TypeError("predicate must be a function");
  9495. for (var t, i = Object(this), n = i.length >>> 0, r = arguments[1], o = 0; o < n; o++)
  9496. if (t = i[o],
  9497. e.call(r, t, o, i))
  9498. return o;
  9499. return -1
  9500. }
  9501. ),
  9502. Array.prototype.find || Object.defineProperty(Array.prototype, "find", {
  9503. value: function(e) {
  9504. if (null == this)
  9505. throw new TypeError('"this" is null or not defined');
  9506. var t = Object(this)
  9507. , i = t.length >>> 0;
  9508. if ("function" != typeof e)
  9509. throw new TypeError("predicate must be a function");
  9510. for (var n = arguments[1], r = 0; r < i; ) {
  9511. var o = t[r];
  9512. if (e.call(n, o, r, t))
  9513. return o;
  9514. r++
  9515. }
  9516. }
  9517. })
  9518. }
  9519. , {}],
  9520. 93: [function(e, t, i) {
  9521. "use strict";
  9522. var n = n || {};
  9523. t.exports = n,
  9524. n.gui = n.gui || {},
  9525. n.utils = n.utils || {},
  9526. n.controllers = n.controllers || {},
  9527. n.dom = n.dom || {},
  9528. n.color = n.color || {},
  9529. n.utils.css = function() {
  9530. return {
  9531. load: function(e, t) {
  9532. t = t || document;
  9533. var i = t.createElement("link");
  9534. i.type = "text/css",
  9535. i.rel = "stylesheet",
  9536. i.href = e,
  9537. t.getElementsByTagName("head")[0].appendChild(i)
  9538. },
  9539. inject: function(e, t) {
  9540. t = t || document;
  9541. var i = document.createElement("style");
  9542. i.type = "text/css",
  9543. i.innerHTML = e,
  9544. t.getElementsByTagName("head")[0].appendChild(i)
  9545. }
  9546. }
  9547. }(),
  9548. n.utils.common = function() {
  9549. var e = Array.prototype.forEach
  9550. , t = Array.prototype.slice;
  9551. return {
  9552. BREAK: {},
  9553. extend: function(e) {
  9554. return this.each(t.call(arguments, 1), function(t) {
  9555. for (var i in t)
  9556. this.isUndefined(t[i]) || (e[i] = t[i])
  9557. }, this),
  9558. e
  9559. },
  9560. defaults: function(e) {
  9561. return this.each(t.call(arguments, 1), function(t) {
  9562. for (var i in t)
  9563. this.isUndefined(e[i]) && (e[i] = t[i])
  9564. }, this),
  9565. e
  9566. },
  9567. compose: function() {
  9568. var e = t.call(arguments);
  9569. return function() {
  9570. for (var i = t.call(arguments), n = e.length - 1; n >= 0; n--)
  9571. i = [e[n].apply(this, i)];
  9572. return i[0]
  9573. }
  9574. },
  9575. each: function(t, i, n) {
  9576. if (t)
  9577. if (e && t.forEach && t.forEach === e)
  9578. t.forEach(i, n);
  9579. else if (t.length === t.length + 0) {
  9580. for (var r = 0, o = t.length; r < o; r++)
  9581. if (r in t && i.call(n, t[r], r) === this.BREAK)
  9582. return
  9583. } else
  9584. for (var r in t)
  9585. if (i.call(n, t[r], r) === this.BREAK)
  9586. return
  9587. },
  9588. defer: function(e) {
  9589. setTimeout(e, 0)
  9590. },
  9591. toArray: function(e) {
  9592. return e.toArray ? e.toArray() : t.call(e)
  9593. },
  9594. isUndefined: function(e) {
  9595. return void 0 === e
  9596. },
  9597. isNull: function(e) {
  9598. return null === e
  9599. },
  9600. isNaN: function(e) {
  9601. return e !== e
  9602. },
  9603. isArray: Array.isArray || function(e) {
  9604. return e.constructor === Array
  9605. }
  9606. ,
  9607. isObject: function(e) {
  9608. return e === Object(e)
  9609. },
  9610. isNumber: function(e) {
  9611. return e === e + 0
  9612. },
  9613. isString: function(e) {
  9614. return e === e + ""
  9615. },
  9616. isBoolean: function(e) {
  9617. return e === !1 || e === !0
  9618. },
  9619. isFunction: function(e) {
  9620. return "[object Function]" === Object.prototype.toString.call(e)
  9621. }
  9622. }
  9623. }(),
  9624. n.controllers.Controller = function(e) {
  9625. var t = function(e, t) {
  9626. this.initialValue = e[t],
  9627. this.domElement = document.createElement("div"),
  9628. this.object = e,
  9629. this.property = t,
  9630. this.__onChange = void 0,
  9631. this.__onFinishChange = void 0
  9632. };
  9633. return e.extend(t.prototype, {
  9634. onChange: function(e) {
  9635. return this.__onChange = e,
  9636. this
  9637. },
  9638. onFinishChange: function(e) {
  9639. return this.__onFinishChange = e,
  9640. this
  9641. },
  9642. setValue: function(e) {
  9643. return this.object[this.property] = e,
  9644. this.__onChange && this.__onChange.call(this, e),
  9645. this.updateDisplay(),
  9646. this
  9647. },
  9648. getValue: function() {
  9649. return this.object[this.property]
  9650. },
  9651. updateDisplay: function() {
  9652. return this
  9653. },
  9654. isModified: function() {
  9655. return this.initialValue !== this.getValue()
  9656. }
  9657. }),
  9658. t
  9659. }(n.utils.common),
  9660. n.dom.dom = function(e) {
  9661. function t(t) {
  9662. if ("0" === t || e.isUndefined(t))
  9663. return 0;
  9664. var i = t.match(r);
  9665. return e.isNull(i) ? 0 : parseFloat(i[1])
  9666. }
  9667. var i = {
  9668. HTMLEvents: ["change"],
  9669. MouseEvents: ["click", "mousemove", "mousedown", "mouseup", "mouseover"],
  9670. KeyboardEvents: ["keydown"]
  9671. }
  9672. , n = {};
  9673. e.each(i, function(t, i) {
  9674. e.each(t, function(e) {
  9675. n[e] = i
  9676. })
  9677. });
  9678. var r = /(\d+(\.\d+)?)px/
  9679. , o = {
  9680. makeSelectable: function(e, t) {
  9681. void 0 !== e && void 0 !== e.style && (e.onselectstart = t ? function() {
  9682. return !1
  9683. }
  9684. : function() {}
  9685. ,
  9686. e.style.MozUserSelect = t ? "auto" : "none",
  9687. e.style.KhtmlUserSelect = t ? "auto" : "none",
  9688. e.unselectable = t ? "on" : "off")
  9689. },
  9690. makeFullscreen: function(t, i, n) {
  9691. e.isUndefined(i) && (i = !0),
  9692. e.isUndefined(n) && (n = !0),
  9693. t.style.position = "absolute",
  9694. i && (t.style.left = 0,
  9695. t.style.right = 0),
  9696. n && (t.style.top = 0,
  9697. t.style.bottom = 0)
  9698. },
  9699. fakeEvent: function(t, i, r, o) {
  9700. r = r || {};
  9701. var a = n[i];
  9702. if (!a)
  9703. throw new Error("Event type " + i + " not supported.");
  9704. var s = document.createEvent(a);
  9705. switch (a) {
  9706. case "MouseEvents":
  9707. var l = r.x || r.clientX || 0
  9708. , c = r.y || r.clientY || 0;
  9709. s.initMouseEvent(i, r.bubbles || !1, r.cancelable || !0, window, r.clickCount || 1, 0, 0, l, c, !1, !1, !1, !1, 0, null);
  9710. break;
  9711. case "KeyboardEvents":
  9712. var h = s.initKeyboardEvent || s.initKeyEvent;
  9713. e.defaults(r, {
  9714. cancelable: !0,
  9715. ctrlKey: !1,
  9716. altKey: !1,
  9717. shiftKey: !1,
  9718. metaKey: !1,
  9719. keyCode: void 0,
  9720. charCode: void 0
  9721. }),
  9722. h(i, r.bubbles || !1, r.cancelable, window, r.ctrlKey, r.altKey, r.shiftKey, r.metaKey, r.keyCode, r.charCode);
  9723. break;
  9724. default:
  9725. s.initEvent(i, r.bubbles || !1, r.cancelable || !0)
  9726. }
  9727. e.defaults(s, o),
  9728. t.dispatchEvent(s)
  9729. },
  9730. bind: function(e, t, i, n) {
  9731. return n = n || !1,
  9732. e.addEventListener ? e.addEventListener(t, i, n) : e.attachEvent && e.attachEvent("on" + t, i),
  9733. o
  9734. },
  9735. unbind: function(e, t, i, n) {
  9736. return n = n || !1,
  9737. e.removeEventListener ? e.removeEventListener(t, i, n) : e.detachEvent && e.detachEvent("on" + t, i),
  9738. o
  9739. },
  9740. addClass: function(e, t) {
  9741. if (void 0 === e.className)
  9742. e.className = t;
  9743. else if (e.className !== t) {
  9744. var i = e.className.split(/ +/);
  9745. i.indexOf(t) == -1 && (i.push(t),
  9746. e.className = i.join(" ").replace(/^\s+/, "").replace(/\s+$/, ""))
  9747. }
  9748. return o
  9749. },
  9750. removeClass: function(e, t) {
  9751. if (t)
  9752. if (void 0 === e.className)
  9753. ;
  9754. else if (e.className === t)
  9755. e.removeAttribute("class");
  9756. else {
  9757. var i = e.className.split(/ +/)
  9758. , n = i.indexOf(t);
  9759. n != -1 && (i.splice(n, 1),
  9760. e.className = i.join(" "))
  9761. }
  9762. else
  9763. e.className = void 0;
  9764. return o
  9765. },
  9766. hasClass: function(e, t) {
  9767. return new RegExp("(?:^|\\s+)" + t + "(?:\\s+|$)").test(e.className) || !1
  9768. },
  9769. getWidth: function(e) {
  9770. var i = getComputedStyle(e);
  9771. return t(i["border-left-width"]) + t(i["border-right-width"]) + t(i["padding-left"]) + t(i["padding-right"]) + t(i.width)
  9772. },
  9773. getHeight: function(e) {
  9774. var i = getComputedStyle(e);
  9775. return t(i["border-top-width"]) + t(i["border-bottom-width"]) + t(i["padding-top"]) + t(i["padding-bottom"]) + t(i.height)
  9776. },
  9777. getOffset: function(e) {
  9778. var t = {
  9779. left: 0,
  9780. top: 0
  9781. };
  9782. if (e.offsetParent)
  9783. do
  9784. t.left += e.offsetLeft,
  9785. t.top += e.offsetTop;
  9786. while (e = e.offsetParent);return t
  9787. },
  9788. isActive: function(e) {
  9789. return e === document.activeElement && (e.type || e.href)
  9790. }
  9791. };
  9792. return o
  9793. }(n.utils.common),
  9794. n.controllers.OptionController = function(e, t, i) {
  9795. var n = function(e, r, o) {
  9796. n.superclass.call(this, e, r);
  9797. var a = this;
  9798. if (this.__select = document.createElement("select"),
  9799. i.isArray(o)) {
  9800. var s = {};
  9801. i.each(o, function(e) {
  9802. s[e] = e
  9803. }),
  9804. o = s
  9805. }
  9806. i.each(o, function(e, t) {
  9807. var i = document.createElement("option");
  9808. i.innerHTML = t,
  9809. i.setAttribute("value", e),
  9810. a.__select.appendChild(i)
  9811. }),
  9812. this.updateDisplay(),
  9813. t.bind(this.__select, "change", function() {
  9814. var e = this.options[this.selectedIndex].value;
  9815. a.setValue(e)
  9816. }),
  9817. this.domElement.appendChild(this.__select)
  9818. };
  9819. return n.superclass = e,
  9820. i.extend(n.prototype, e.prototype, {
  9821. setValue: function(e) {
  9822. var t = n.superclass.prototype.setValue.call(this, e);
  9823. return this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  9824. t
  9825. },
  9826. updateDisplay: function() {
  9827. return this.__select.value = this.getValue(),
  9828. n.superclass.prototype.updateDisplay.call(this)
  9829. }
  9830. }),
  9831. n
  9832. }(n.controllers.Controller, n.dom.dom, n.utils.common),
  9833. n.controllers.NumberController = function(e, t) {
  9834. function i(e) {
  9835. return e = e.toString(),
  9836. e.indexOf(".") > -1 ? e.length - e.indexOf(".") - 1 : 0
  9837. }
  9838. var n = function(e, r, o) {
  9839. n.superclass.call(this, e, r),
  9840. o = o || {},
  9841. this.__min = o.min,
  9842. this.__max = o.max,
  9843. this.__step = o.step,
  9844. 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,
  9845. this.__precision = i(this.__impliedStep)
  9846. };
  9847. return n.superclass = e,
  9848. t.extend(n.prototype, e.prototype, {
  9849. setValue: function(e) {
  9850. return void 0 !== this.__min && e < this.__min ? e = this.__min : void 0 !== this.__max && e > this.__max && (e = this.__max),
  9851. void 0 !== this.__step && e % this.__step != 0 && (e = Math.round(e / this.__step) * this.__step),
  9852. n.superclass.prototype.setValue.call(this, e)
  9853. },
  9854. min: function(e) {
  9855. return this.__min = e,
  9856. this
  9857. },
  9858. max: function(e) {
  9859. return this.__max = e,
  9860. this
  9861. },
  9862. step: function(e) {
  9863. return this.__step = e,
  9864. this.__impliedStep = e,
  9865. this.__precision = i(e),
  9866. this
  9867. }
  9868. }),
  9869. n
  9870. }(n.controllers.Controller, n.utils.common),
  9871. n.controllers.NumberControllerBox = function(e, t, i) {
  9872. function n(e, t) {
  9873. var i = Math.pow(10, t);
  9874. return Math.round(e * i) / i
  9875. }
  9876. var r = function(e, n, o) {
  9877. function a() {
  9878. var e = parseFloat(d.__input.value);
  9879. i.isNaN(e) || d.setValue(e)
  9880. }
  9881. function s() {
  9882. a(),
  9883. d.__onFinishChange && d.__onFinishChange.call(d, d.getValue())
  9884. }
  9885. function l(e) {
  9886. t.bind(window, "mousemove", c),
  9887. t.bind(window, "mouseup", h),
  9888. u = e.clientY
  9889. }
  9890. function c(e) {
  9891. var t = u - e.clientY;
  9892. d.setValue(d.getValue() + t * d.__impliedStep),
  9893. u = e.clientY
  9894. }
  9895. function h() {
  9896. t.unbind(window, "mousemove", c),
  9897. t.unbind(window, "mouseup", h)
  9898. }
  9899. this.__truncationSuspended = !1,
  9900. r.superclass.call(this, e, n, o);
  9901. var u, d = this;
  9902. this.__input = document.createElement("input"),
  9903. this.__input.setAttribute("type", "text"),
  9904. t.bind(this.__input, "change", a),
  9905. t.bind(this.__input, "blur", s),
  9906. t.bind(this.__input, "mousedown", l),
  9907. t.bind(this.__input, "keydown", function(e) {
  9908. 13 === e.keyCode && (d.__truncationSuspended = !0,
  9909. this.blur(),
  9910. d.__truncationSuspended = !1)
  9911. }),
  9912. this.updateDisplay(),
  9913. this.domElement.appendChild(this.__input)
  9914. };
  9915. return r.superclass = e,
  9916. i.extend(r.prototype, e.prototype, {
  9917. updateDisplay: function() {
  9918. return this.__input.value = this.__truncationSuspended ? this.getValue() : n(this.getValue(), this.__precision),
  9919. r.superclass.prototype.updateDisplay.call(this)
  9920. }
  9921. }),
  9922. r
  9923. }(n.controllers.NumberController, n.dom.dom, n.utils.common),
  9924. n.controllers.NumberControllerSlider = function(e, t, i, n, r) {
  9925. function o(e, t, i, n, r) {
  9926. return n + (r - n) * ((e - t) / (i - t))
  9927. }
  9928. var a = function(e, i, n, r, s) {
  9929. function l(e) {
  9930. t.bind(window, "mousemove", c),
  9931. t.bind(window, "mouseup", h),
  9932. c(e)
  9933. }
  9934. function c(e) {
  9935. e.preventDefault();
  9936. var i = t.getOffset(u.__background)
  9937. , n = t.getWidth(u.__background);
  9938. return u.setValue(o(e.clientX, i.left, i.left + n, u.__min, u.__max)),
  9939. !1
  9940. }
  9941. function h() {
  9942. t.unbind(window, "mousemove", c),
  9943. t.unbind(window, "mouseup", h),
  9944. u.__onFinishChange && u.__onFinishChange.call(u, u.getValue())
  9945. }
  9946. a.superclass.call(this, e, i, {
  9947. min: n,
  9948. max: r,
  9949. step: s
  9950. });
  9951. var u = this;
  9952. this.__background = document.createElement("div"),
  9953. this.__foreground = document.createElement("div"),
  9954. t.bind(this.__background, "mousedown", l),
  9955. t.addClass(this.__background, "slider"),
  9956. t.addClass(this.__foreground, "slider-fg"),
  9957. this.updateDisplay(),
  9958. this.__background.appendChild(this.__foreground),
  9959. this.domElement.appendChild(this.__background)
  9960. };
  9961. return a.superclass = e,
  9962. a.useDefaultStyles = function() {
  9963. i.inject(r)
  9964. }
  9965. ,
  9966. n.extend(a.prototype, e.prototype, {
  9967. updateDisplay: function() {
  9968. var e = (this.getValue() - this.__min) / (this.__max - this.__min);
  9969. return this.__foreground.style.width = 100 * e + "%",
  9970. a.superclass.prototype.updateDisplay.call(this)
  9971. }
  9972. }),
  9973. a
  9974. }(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}"),
  9975. n.controllers.FunctionController = function(e, t, i) {
  9976. var n = function(e, i, r) {
  9977. n.superclass.call(this, e, i);
  9978. var o = this;
  9979. this.__button = document.createElement("div"),
  9980. this.__button.innerHTML = void 0 === r ? "Fire" : r,
  9981. t.bind(this.__button, "click", function(e) {
  9982. return e.preventDefault(),
  9983. o.fire(),
  9984. !1
  9985. }),
  9986. t.addClass(this.__button, "button"),
  9987. this.domElement.appendChild(this.__button)
  9988. };
  9989. return n.superclass = e,
  9990. i.extend(n.prototype, e.prototype, {
  9991. fire: function() {
  9992. this.__onChange && this.__onChange.call(this),
  9993. this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  9994. this.getValue().call(this.object)
  9995. }
  9996. }),
  9997. n
  9998. }(n.controllers.Controller, n.dom.dom, n.utils.common),
  9999. n.controllers.BooleanController = function(e, t, i) {
  10000. var n = function(e, i) {
  10001. function r() {
  10002. o.setValue(!o.__prev)
  10003. }
  10004. n.superclass.call(this, e, i);
  10005. var o = this;
  10006. this.__prev = this.getValue(),
  10007. this.__checkbox = document.createElement("input"),
  10008. this.__checkbox.setAttribute("type", "checkbox"),
  10009. t.bind(this.__checkbox, "change", r, !1),
  10010. this.domElement.appendChild(this.__checkbox),
  10011. this.updateDisplay()
  10012. };
  10013. return n.superclass = e,
  10014. i.extend(n.prototype, e.prototype, {
  10015. setValue: function(e) {
  10016. var t = n.superclass.prototype.setValue.call(this, e);
  10017. return this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  10018. this.__prev = this.getValue(),
  10019. t
  10020. },
  10021. updateDisplay: function() {
  10022. return this.getValue() === !0 ? (this.__checkbox.setAttribute("checked", "checked"),
  10023. this.__checkbox.checked = !0) : this.__checkbox.checked = !1,
  10024. n.superclass.prototype.updateDisplay.call(this)
  10025. }
  10026. }),
  10027. n
  10028. }(n.controllers.Controller, n.dom.dom, n.utils.common),
  10029. n.color.toString = function(e) {
  10030. return function(t) {
  10031. if (1 == t.a || e.isUndefined(t.a)) {
  10032. for (var i = t.hex.toString(16); i.length < 6; )
  10033. i = "0" + i;
  10034. return "#" + i
  10035. }
  10036. return "rgba(" + Math.round(t.r) + "," + Math.round(t.g) + "," + Math.round(t.b) + "," + t.a + ")"
  10037. }
  10038. }(n.utils.common),
  10039. n.color.interpret = function(e, t) {
  10040. var i, n, r = function() {
  10041. n = !1;
  10042. var e = arguments.length > 1 ? t.toArray(arguments) : arguments[0];
  10043. return t.each(o, function(r) {
  10044. if (r.litmus(e))
  10045. return t.each(r.conversions, function(r, o) {
  10046. if (i = r.read(e),
  10047. n === !1 && i !== !1)
  10048. return n = i,
  10049. i.conversionName = o,
  10050. i.conversion = r,
  10051. t.BREAK
  10052. }),
  10053. t.BREAK
  10054. }),
  10055. n
  10056. }, o = [{
  10057. litmus: t.isString,
  10058. conversions: {
  10059. THREE_CHAR_HEX: {
  10060. read: function(e) {
  10061. var t = e.match(/^#([A-F0-9])([A-F0-9])([A-F0-9])$/i);
  10062. return null !== t && {
  10063. space: "HEX",
  10064. hex: parseInt("0x" + t[1].toString() + t[1].toString() + t[2].toString() + t[2].toString() + t[3].toString() + t[3].toString())
  10065. }
  10066. },
  10067. write: e
  10068. },
  10069. SIX_CHAR_HEX: {
  10070. read: function(e) {
  10071. var t = e.match(/^#([A-F0-9]{6})$/i);
  10072. return null !== t && {
  10073. space: "HEX",
  10074. hex: parseInt("0x" + t[1].toString())
  10075. }
  10076. },
  10077. write: e
  10078. },
  10079. CSS_RGB: {
  10080. read: function(e) {
  10081. var t = e.match(/^rgb\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\)/);
  10082. return null !== t && {
  10083. space: "RGB",
  10084. r: parseFloat(t[1]),
  10085. g: parseFloat(t[2]),
  10086. b: parseFloat(t[3])
  10087. }
  10088. },
  10089. write: e
  10090. },
  10091. CSS_RGBA: {
  10092. read: function(e) {
  10093. var t = e.match(/^rgba\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\,\s*(.+)\s*\)/);
  10094. return null !== t && {
  10095. space: "RGB",
  10096. r: parseFloat(t[1]),
  10097. g: parseFloat(t[2]),
  10098. b: parseFloat(t[3]),
  10099. a: parseFloat(t[4])
  10100. }
  10101. },
  10102. write: e
  10103. }
  10104. }
  10105. }, {
  10106. litmus: t.isNumber,
  10107. conversions: {
  10108. HEX: {
  10109. read: function(e) {
  10110. return {
  10111. space: "HEX",
  10112. hex: e,
  10113. conversionName: "HEX"
  10114. }
  10115. },
  10116. write: function(e) {
  10117. return e.hex
  10118. }
  10119. }
  10120. }
  10121. }, {
  10122. litmus: t.isArray,
  10123. conversions: {
  10124. RGB_ARRAY: {
  10125. read: function(e) {
  10126. return 3 == e.length && {
  10127. space: "RGB",
  10128. r: e[0],
  10129. g: e[1],
  10130. b: e[2]
  10131. }
  10132. },
  10133. write: function(e) {
  10134. return [e.r, e.g, e.b]
  10135. }
  10136. },
  10137. RGBA_ARRAY: {
  10138. read: function(e) {
  10139. return 4 == e.length && {
  10140. space: "RGB",
  10141. r: e[0],
  10142. g: e[1],
  10143. b: e[2],
  10144. a: e[3]
  10145. }
  10146. },
  10147. write: function(e) {
  10148. return [e.r, e.g, e.b, e.a]
  10149. }
  10150. }
  10151. }
  10152. }, {
  10153. litmus: t.isObject,
  10154. conversions: {
  10155. RGBA_OBJ: {
  10156. read: function(e) {
  10157. return !!(t.isNumber(e.r) && t.isNumber(e.g) && t.isNumber(e.b) && t.isNumber(e.a)) && {
  10158. space: "RGB",
  10159. r: e.r,
  10160. g: e.g,
  10161. b: e.b,
  10162. a: e.a
  10163. }
  10164. },
  10165. write: function(e) {
  10166. return {
  10167. r: e.r,
  10168. g: e.g,
  10169. b: e.b,
  10170. a: e.a
  10171. }
  10172. }
  10173. },
  10174. RGB_OBJ: {
  10175. read: function(e) {
  10176. return !!(t.isNumber(e.r) && t.isNumber(e.g) && t.isNumber(e.b)) && {
  10177. space: "RGB",
  10178. r: e.r,
  10179. g: e.g,
  10180. b: e.b
  10181. }
  10182. },
  10183. write: function(e) {
  10184. return {
  10185. r: e.r,
  10186. g: e.g,
  10187. b: e.b
  10188. }
  10189. }
  10190. },
  10191. HSVA_OBJ: {
  10192. read: function(e) {
  10193. return !!(t.isNumber(e.h) && t.isNumber(e.s) && t.isNumber(e.v) && t.isNumber(e.a)) && {
  10194. space: "HSV",
  10195. h: e.h,
  10196. s: e.s,
  10197. v: e.v,
  10198. a: e.a
  10199. }
  10200. },
  10201. write: function(e) {
  10202. return {
  10203. h: e.h,
  10204. s: e.s,
  10205. v: e.v,
  10206. a: e.a
  10207. }
  10208. }
  10209. },
  10210. HSV_OBJ: {
  10211. read: function(e) {
  10212. return !!(t.isNumber(e.h) && t.isNumber(e.s) && t.isNumber(e.v)) && {
  10213. space: "HSV",
  10214. h: e.h,
  10215. s: e.s,
  10216. v: e.v
  10217. }
  10218. },
  10219. write: function(e) {
  10220. return {
  10221. h: e.h,
  10222. s: e.s,
  10223. v: e.v
  10224. }
  10225. }
  10226. }
  10227. }
  10228. }];
  10229. return r
  10230. }(n.color.toString, n.utils.common),
  10231. n.GUI = n.gui.GUI = function(e, t, i, n, r, o, a, s, l, c, h, u, d, p, f) {
  10232. function g(e, t, i, o) {
  10233. if (void 0 === t[i])
  10234. throw new Error("Object " + t + ' has no property "' + i + '"');
  10235. var a;
  10236. if (o.color)
  10237. a = new h(t,i);
  10238. else {
  10239. var s = [t, i].concat(o.factoryArgs);
  10240. a = n.apply(e, s)
  10241. }
  10242. o.before instanceof r && (o.before = o.before.__li),
  10243. A(e, a),
  10244. p.addClass(a.domElement, "c");
  10245. var l = document.createElement("span");
  10246. p.addClass(l, "property-name"),
  10247. l.innerHTML = a.property;
  10248. var c = document.createElement("div");
  10249. c.appendChild(l),
  10250. c.appendChild(a.domElement);
  10251. var u = m(e, c, o.before);
  10252. return p.addClass(u, V.CLASS_CONTROLLER_ROW),
  10253. p.addClass(u, typeof a.getValue()),
  10254. v(e, u, a),
  10255. e.__controllers.push(a),
  10256. a
  10257. }
  10258. function m(e, t, i) {
  10259. var n = document.createElement("li");
  10260. return t && n.appendChild(t),
  10261. i ? e.__ul.insertBefore(n, params.before) : e.__ul.appendChild(n),
  10262. e.onResize(),
  10263. n
  10264. }
  10265. function v(e, t, i) {
  10266. if (i.__li = t,
  10267. i.__gui = e,
  10268. f.extend(i, {
  10269. options: function(t) {
  10270. return arguments.length > 1 ? (i.remove(),
  10271. g(e, i.object, i.property, {
  10272. before: i.__li.nextElementSibling,
  10273. factoryArgs: [f.toArray(arguments)]
  10274. })) : f.isArray(t) || f.isObject(t) ? (i.remove(),
  10275. g(e, i.object, i.property, {
  10276. before: i.__li.nextElementSibling,
  10277. factoryArgs: [t]
  10278. })) : void 0
  10279. },
  10280. name: function(e) {
  10281. return i.__li.firstElementChild.firstElementChild.innerHTML = e,
  10282. i
  10283. },
  10284. listen: function() {
  10285. return i.__gui.listen(i),
  10286. i
  10287. },
  10288. remove: function() {
  10289. return i.__gui.remove(i),
  10290. i
  10291. }
  10292. }),
  10293. i instanceof l) {
  10294. var n = new s(i.object,i.property,{
  10295. min: i.__min,
  10296. max: i.__max,
  10297. step: i.__step
  10298. });
  10299. f.each(["updateDisplay", "onChange", "onFinishChange"], function(e) {
  10300. var t = i[e]
  10301. , r = n[e];
  10302. i[e] = n[e] = function() {
  10303. var e = Array.prototype.slice.call(arguments);
  10304. return t.apply(i, e),
  10305. r.apply(n, e)
  10306. }
  10307. }),
  10308. p.addClass(t, "has-slider"),
  10309. i.domElement.insertBefore(n.domElement, i.domElement.firstElementChild)
  10310. } else if (i instanceof s) {
  10311. var r = function(t) {
  10312. return f.isNumber(i.__min) && f.isNumber(i.__max) ? (i.remove(),
  10313. g(e, i.object, i.property, {
  10314. before: i.__li.nextElementSibling,
  10315. factoryArgs: [i.__min, i.__max, i.__step]
  10316. })) : t
  10317. };
  10318. i.min = f.compose(r, i.min),
  10319. i.max = f.compose(r, i.max)
  10320. } else
  10321. i instanceof o ? (p.bind(t, "click", function() {
  10322. p.fakeEvent(i.__checkbox, "click")
  10323. }),
  10324. p.bind(i.__checkbox, "click", function(e) {
  10325. e.stopPropagation()
  10326. })) : i instanceof a ? (p.bind(t, "click", function() {
  10327. p.fakeEvent(i.__button, "click")
  10328. }),
  10329. p.bind(t, "mouseover", function() {
  10330. p.addClass(i.__button, "hover")
  10331. }),
  10332. p.bind(t, "mouseout", function() {
  10333. p.removeClass(i.__button, "hover")
  10334. })) : i instanceof h && (p.addClass(t, "color"),
  10335. i.updateDisplay = f.compose(function(e) {
  10336. return t.style.borderLeftColor = i.__color.toString(),
  10337. e
  10338. }, i.updateDisplay),
  10339. i.updateDisplay());
  10340. i.setValue = f.compose(function(t) {
  10341. return e.getRoot().__preset_select && i.isModified() && T(e.getRoot(), !0),
  10342. t
  10343. }, i.setValue)
  10344. }
  10345. function A(e, t) {
  10346. var i = e.getRoot()
  10347. , n = i.__rememberedObjects.indexOf(t.object);
  10348. if (n != -1) {
  10349. var r = i.__rememberedObjectIndecesToControllers[n];
  10350. if (void 0 === r && (r = {},
  10351. i.__rememberedObjectIndecesToControllers[n] = r),
  10352. r[t.property] = t,
  10353. i.load && i.load.remembered) {
  10354. var o, a = i.load.remembered;
  10355. if (a[e.preset])
  10356. o = a[e.preset];
  10357. else {
  10358. if (!a[L])
  10359. return;
  10360. o = a[L]
  10361. }
  10362. if (o[n] && void 0 !== o[n][t.property]) {
  10363. var s = o[n][t.property];
  10364. t.initialValue = s,
  10365. t.setValue(s)
  10366. }
  10367. }
  10368. }
  10369. }
  10370. function y(e, t) {
  10371. return document.location.href + "." + t
  10372. }
  10373. function C(e) {
  10374. var t = e.__save_row = document.createElement("li");
  10375. p.addClass(e.domElement, "has-save"),
  10376. e.__ul.insertBefore(t, e.__ul.firstChild),
  10377. p.addClass(t, "save-row");
  10378. var i = document.createElement("span");
  10379. i.innerHTML = "&nbsp;",
  10380. p.addClass(i, "button gears");
  10381. var n = document.createElement("span");
  10382. n.innerHTML = "Save",
  10383. p.addClass(n, "button"),
  10384. p.addClass(n, "save");
  10385. var r = document.createElement("span");
  10386. r.innerHTML = "New",
  10387. p.addClass(r, "button"),
  10388. p.addClass(r, "save-as");
  10389. var o = document.createElement("span");
  10390. o.innerHTML = "Revert",
  10391. p.addClass(o, "button"),
  10392. p.addClass(o, "revert");
  10393. var a = e.__preset_select = document.createElement("select");
  10394. if (e.load && e.load.remembered ? f.each(e.load.remembered, function(t, i) {
  10395. w(e, i, i == e.preset)
  10396. }) : w(e, L, !1),
  10397. p.bind(a, "change", function() {
  10398. for (var t = 0; t < e.__preset_select.length; t++)
  10399. e.__preset_select[t].innerHTML = e.__preset_select[t].value;
  10400. e.preset = this.value
  10401. }),
  10402. t.appendChild(a),
  10403. t.appendChild(i),
  10404. t.appendChild(n),
  10405. t.appendChild(r),
  10406. t.appendChild(o),
  10407. D) {
  10408. var s = document.getElementById("dg-save-locally")
  10409. , l = document.getElementById("dg-local-explain");
  10410. s.style.display = "block";
  10411. var c = document.getElementById("dg-local-storage");
  10412. "true" === localStorage.getItem(y(e, "isLocal")) && c.setAttribute("checked", "checked");
  10413. var h = function() {
  10414. l.style.display = e.useLocalStorage ? "block" : "none"
  10415. };
  10416. h(),
  10417. p.bind(c, "change", function() {
  10418. e.useLocalStorage = !e.useLocalStorage,
  10419. h()
  10420. })
  10421. }
  10422. var u = document.getElementById("dg-new-constructor");
  10423. p.bind(u, "keydown", function(e) {
  10424. !e.metaKey || 67 !== e.which && 67 != e.keyCode || S.hide()
  10425. }),
  10426. p.bind(i, "click", function() {
  10427. u.innerHTML = JSON.stringify(e.getSaveObject(), void 0, 2),
  10428. S.show(),
  10429. u.focus(),
  10430. u.select()
  10431. }),
  10432. p.bind(n, "click", function() {
  10433. e.save()
  10434. }),
  10435. p.bind(r, "click", function() {
  10436. var t = prompt("Enter a new preset name.");
  10437. t && e.saveAs(t)
  10438. }),
  10439. p.bind(o, "click", function() {
  10440. e.revert()
  10441. })
  10442. }
  10443. function I(e) {
  10444. function t(t) {
  10445. return t.preventDefault(),
  10446. r = t.clientX,
  10447. p.addClass(e.__closeButton, V.CLASS_DRAG),
  10448. p.bind(window, "mousemove", i),
  10449. p.bind(window, "mouseup", n),
  10450. !1
  10451. }
  10452. function i(t) {
  10453. return t.preventDefault(),
  10454. e.width += r - t.clientX,
  10455. e.onResize(),
  10456. r = t.clientX,
  10457. !1
  10458. }
  10459. function n() {
  10460. p.removeClass(e.__closeButton, V.CLASS_DRAG),
  10461. p.unbind(window, "mousemove", i),
  10462. p.unbind(window, "mouseup", n)
  10463. }
  10464. e.__resize_handle = document.createElement("div"),
  10465. f.extend(e.__resize_handle.style, {
  10466. width: "6px",
  10467. marginLeft: "-3px",
  10468. height: "200px",
  10469. cursor: "ew-resize",
  10470. position: "absolute"
  10471. });
  10472. var r;
  10473. p.bind(e.__resize_handle, "mousedown", t),
  10474. p.bind(e.__closeButton, "mousedown", t),
  10475. e.domElement.insertBefore(e.__resize_handle, e.domElement.firstElementChild)
  10476. }
  10477. function E(e, t) {
  10478. e.domElement.style.width = t + "px",
  10479. e.__save_row && e.autoPlace && (e.__save_row.style.width = t + "px"),
  10480. e.__closeButton && (e.__closeButton.style.width = t + "px")
  10481. }
  10482. function b(e, t) {
  10483. var i = {};
  10484. return f.each(e.__rememberedObjects, function(n, r) {
  10485. var o = {}
  10486. , a = e.__rememberedObjectIndecesToControllers[r];
  10487. f.each(a, function(e, i) {
  10488. o[i] = t ? e.initialValue : e.getValue()
  10489. }),
  10490. i[r] = o
  10491. }),
  10492. i
  10493. }
  10494. function w(e, t, i) {
  10495. var n = document.createElement("option");
  10496. n.innerHTML = t,
  10497. n.value = t,
  10498. e.__preset_select.appendChild(n),
  10499. i && (e.__preset_select.selectedIndex = e.__preset_select.length - 1)
  10500. }
  10501. function _(e) {
  10502. for (var t = 0; t < e.__preset_select.length; t++)
  10503. e.__preset_select[t].value == e.preset && (e.__preset_select.selectedIndex = t)
  10504. }
  10505. function T(e, t) {
  10506. var i = e.__preset_select[e.__preset_select.selectedIndex];
  10507. t ? i.innerHTML = i.value + "*" : i.innerHTML = i.value
  10508. }
  10509. function x(e) {
  10510. 0 != e.length && u(function() {
  10511. x(e)
  10512. }),
  10513. f.each(e, function(e) {
  10514. e.updateDisplay()
  10515. })
  10516. }
  10517. e.inject(i);
  10518. var S, M, R = "dg", P = 72, O = 20, L = "Default", D = function() {
  10519. try {
  10520. return "localStorage"in window && null !== window.localStorage
  10521. } catch (e) {
  10522. return !1
  10523. }
  10524. }(), N = !0, B = !1, F = [], V = function(e) {
  10525. function t() {
  10526. var e = i.getRoot();
  10527. e.width += 1,
  10528. f.defer(function() {
  10529. e.width -= 1
  10530. })
  10531. }
  10532. var i = this;
  10533. this.domElement = document.createElement("div"),
  10534. this.__ul = document.createElement("ul"),
  10535. this.domElement.appendChild(this.__ul),
  10536. p.addClass(this.domElement, R),
  10537. this.__folders = {},
  10538. this.__controllers = [],
  10539. this.__rememberedObjects = [],
  10540. this.__rememberedObjectIndecesToControllers = [],
  10541. this.__listening = [],
  10542. e = e || {},
  10543. e = f.defaults(e, {
  10544. autoPlace: !0,
  10545. width: V.DEFAULT_WIDTH
  10546. }),
  10547. e = f.defaults(e, {
  10548. resizable: e.autoPlace,
  10549. hideable: e.autoPlace
  10550. }),
  10551. f.isUndefined(e.load) ? e.load = {
  10552. preset: L
  10553. } : e.preset && (e.load.preset = e.preset),
  10554. f.isUndefined(e.parent) && e.hideable && F.push(this),
  10555. e.resizable = f.isUndefined(e.parent) && e.resizable,
  10556. e.autoPlace && f.isUndefined(e.scrollable) && (e.scrollable = !0);
  10557. var n, r = D && "true" === localStorage.getItem(y(this, "isLocal"));
  10558. if (Object.defineProperties(this, {
  10559. parent: {
  10560. get: function() {
  10561. return e.parent
  10562. }
  10563. },
  10564. scrollable: {
  10565. get: function() {
  10566. return e.scrollable
  10567. }
  10568. },
  10569. autoPlace: {
  10570. get: function() {
  10571. return e.autoPlace
  10572. }
  10573. },
  10574. preset: {
  10575. get: function() {
  10576. return i.parent ? i.getRoot().preset : e.load.preset
  10577. },
  10578. set: function(t) {
  10579. i.parent ? i.getRoot().preset = t : e.load.preset = t,
  10580. _(this),
  10581. i.revert()
  10582. }
  10583. },
  10584. width: {
  10585. get: function() {
  10586. return e.width
  10587. },
  10588. set: function(t) {
  10589. e.width = t,
  10590. E(i, t)
  10591. }
  10592. },
  10593. name: {
  10594. get: function() {
  10595. return e.name
  10596. },
  10597. set: function(t) {
  10598. e.name = t,
  10599. a && (a.innerHTML = e.name)
  10600. }
  10601. },
  10602. closed: {
  10603. get: function() {
  10604. return e.closed
  10605. },
  10606. set: function(t) {
  10607. e.closed = t,
  10608. e.closed ? p.addClass(i.__ul, V.CLASS_CLOSED) : p.removeClass(i.__ul, V.CLASS_CLOSED),
  10609. this.onResize(),
  10610. i.__closeButton && (i.__closeButton.innerHTML = t ? V.TEXT_OPEN : V.TEXT_CLOSED)
  10611. }
  10612. },
  10613. load: {
  10614. get: function() {
  10615. return e.load
  10616. }
  10617. },
  10618. useLocalStorage: {
  10619. get: function() {
  10620. return r
  10621. },
  10622. set: function(e) {
  10623. D && (r = e,
  10624. e ? p.bind(window, "unload", n) : p.unbind(window, "unload", n),
  10625. localStorage.setItem(y(i, "isLocal"), e))
  10626. }
  10627. }
  10628. }),
  10629. f.isUndefined(e.parent)) {
  10630. if (e.closed = !1,
  10631. p.addClass(this.domElement, V.CLASS_MAIN),
  10632. p.makeSelectable(this.domElement, !1),
  10633. D && r) {
  10634. i.useLocalStorage = !0;
  10635. var o = localStorage.getItem(y(this, "gui"));
  10636. o && (e.load = JSON.parse(o))
  10637. }
  10638. this.__closeButton = document.createElement("div"),
  10639. this.__closeButton.innerHTML = V.TEXT_CLOSED,
  10640. p.addClass(this.__closeButton, V.CLASS_CLOSE_BUTTON),
  10641. this.domElement.appendChild(this.__closeButton),
  10642. p.bind(this.__closeButton, "click", function() {
  10643. i.closed = !i.closed
  10644. })
  10645. } else {
  10646. void 0 === e.closed && (e.closed = !0);
  10647. var a = document.createTextNode(e.name);
  10648. p.addClass(a, "controller-name");
  10649. var s = m(i, a)
  10650. , l = function(e) {
  10651. return e.preventDefault(),
  10652. i.closed = !i.closed,
  10653. !1
  10654. };
  10655. p.addClass(this.__ul, V.CLASS_CLOSED),
  10656. p.addClass(s, "title"),
  10657. p.bind(s, "click", l),
  10658. e.closed || (this.closed = !1)
  10659. }
  10660. e.autoPlace && (f.isUndefined(e.parent) && (N && (M = document.createElement("div"),
  10661. p.addClass(M, R),
  10662. p.addClass(M, V.CLASS_AUTO_PLACE_CONTAINER),
  10663. document.body.appendChild(M),
  10664. N = !1),
  10665. M.appendChild(this.domElement),
  10666. p.addClass(this.domElement, V.CLASS_AUTO_PLACE)),
  10667. this.parent || E(i, e.width)),
  10668. p.bind(window, "resize", function() {
  10669. i.onResize()
  10670. }),
  10671. p.bind(this.__ul, "webkitTransitionEnd", function() {
  10672. i.onResize()
  10673. }),
  10674. p.bind(this.__ul, "transitionend", function() {
  10675. i.onResize()
  10676. }),
  10677. p.bind(this.__ul, "oTransitionEnd", function() {
  10678. i.onResize()
  10679. }),
  10680. this.onResize(),
  10681. e.resizable && I(this),
  10682. n = function() {
  10683. D && "true" === localStorage.getItem(y(i, "isLocal")) && localStorage.setItem(y(i, "gui"), JSON.stringify(i.getSaveObject()))
  10684. }
  10685. ,
  10686. this.saveToLocalStorageIfPossible = n;
  10687. i.getRoot();
  10688. e.parent || t()
  10689. };
  10690. return V.toggleHide = function() {
  10691. B = !B,
  10692. f.each(F, function(e) {
  10693. e.domElement.style.zIndex = B ? -999 : 999,
  10694. e.domElement.style.opacity = B ? 0 : 1
  10695. })
  10696. }
  10697. ,
  10698. V.CLASS_AUTO_PLACE = "a",
  10699. V.CLASS_AUTO_PLACE_CONTAINER = "ac",
  10700. V.CLASS_MAIN = "main",
  10701. V.CLASS_CONTROLLER_ROW = "cr",
  10702. V.CLASS_TOO_TALL = "taller-than-window",
  10703. V.CLASS_CLOSED = "closed",
  10704. V.CLASS_CLOSE_BUTTON = "close-button",
  10705. V.CLASS_DRAG = "drag",
  10706. V.DEFAULT_WIDTH = 245,
  10707. V.TEXT_CLOSED = "Close Controls",
  10708. V.TEXT_OPEN = "Open Controls",
  10709. p.bind(window, "keydown", function(e) {
  10710. "text" === document.activeElement.type || e.which !== P && e.keyCode != P || V.toggleHide()
  10711. }, !1),
  10712. f.extend(V.prototype, {
  10713. add: function(e, t) {
  10714. return g(this, e, t, {
  10715. factoryArgs: Array.prototype.slice.call(arguments, 2)
  10716. })
  10717. },
  10718. addColor: function(e, t) {
  10719. return g(this, e, t, {
  10720. color: !0
  10721. })
  10722. },
  10723. remove: function(e) {
  10724. this.__ul.removeChild(e.__li),
  10725. this.__controllers.slice(this.__controllers.indexOf(e), 1);
  10726. var t = this;
  10727. f.defer(function() {
  10728. t.onResize()
  10729. })
  10730. },
  10731. destroy: function() {
  10732. this.autoPlace && M.removeChild(this.domElement)
  10733. },
  10734. addFolder: function(e) {
  10735. if (void 0 !== this.__folders[e])
  10736. throw new Error('You already have a folder in this GUI by the name "' + e + '"');
  10737. var t = {
  10738. name: e,
  10739. parent: this
  10740. };
  10741. t.autoPlace = this.autoPlace,
  10742. this.load && this.load.folders && this.load.folders[e] && (t.closed = this.load.folders[e].closed,
  10743. t.load = this.load.folders[e]);
  10744. var i = new V(t);
  10745. this.__folders[e] = i;
  10746. var n = m(this, i.domElement);
  10747. return p.addClass(n, "folder"),
  10748. i
  10749. },
  10750. open: function() {
  10751. this.closed = !1
  10752. },
  10753. close: function() {
  10754. this.closed = !0
  10755. },
  10756. onResize: function() {
  10757. var e = this.getRoot();
  10758. if (e.scrollable) {
  10759. var t = p.getOffset(e.__ul).top
  10760. , i = 0;
  10761. f.each(e.__ul.childNodes, function(t) {
  10762. e.autoPlace && t === e.__save_row || (i += p.getHeight(t))
  10763. }),
  10764. $("#player").height() - t - O < i ? (p.addClass(e.domElement, V.CLASS_TOO_TALL),
  10765. e.__ul.style.height = $("#player").height() - t - O + "px") : (p.removeClass(e.domElement, V.CLASS_TOO_TALL),
  10766. e.__ul.style.height = "auto")
  10767. }
  10768. e.__resize_handle && f.defer(function() {
  10769. e.__resize_handle.style.height = e.__ul.offsetHeight + "px"
  10770. }),
  10771. e.__closeButton && (e.__closeButton.style.width = e.width + "px")
  10772. },
  10773. remember: function() {
  10774. if (f.isUndefined(S) && (S = new d,
  10775. S.domElement.innerHTML = t),
  10776. this.parent)
  10777. throw new Error("You can only call remember on a top level GUI.");
  10778. var e = this;
  10779. f.each(Array.prototype.slice.call(arguments), function(t) {
  10780. 0 == e.__rememberedObjects.length && C(e),
  10781. e.__rememberedObjects.indexOf(t) == -1 && e.__rememberedObjects.push(t)
  10782. }),
  10783. this.autoPlace && E(this, this.width)
  10784. },
  10785. getRoot: function() {
  10786. for (var e = this; e.parent; )
  10787. e = e.parent;
  10788. return e
  10789. },
  10790. getSaveObject: function() {
  10791. var e = this.load;
  10792. return e.closed = this.closed,
  10793. this.__rememberedObjects.length > 0 && (e.preset = this.preset,
  10794. e.remembered || (e.remembered = {}),
  10795. e.remembered[this.preset] = b(this)),
  10796. e.folders = {},
  10797. f.each(this.__folders, function(t, i) {
  10798. e.folders[i] = t.getSaveObject()
  10799. }),
  10800. e
  10801. },
  10802. save: function() {
  10803. this.load.remembered || (this.load.remembered = {}),
  10804. this.load.remembered[this.preset] = b(this),
  10805. T(this, !1),
  10806. this.saveToLocalStorageIfPossible()
  10807. },
  10808. saveAs: function(e) {
  10809. this.load.remembered || (this.load.remembered = {},
  10810. this.load.remembered[L] = b(this, !0)),
  10811. this.load.remembered[e] = b(this),
  10812. this.preset = e,
  10813. w(this, e, !0),
  10814. this.saveToLocalStorageIfPossible()
  10815. },
  10816. revert: function(e) {
  10817. f.each(this.__controllers, function(t) {
  10818. this.getRoot().load.remembered ? A(e || this.getRoot(), t) : t.setValue(t.initialValue)
  10819. }, this),
  10820. f.each(this.__folders, function(e) {
  10821. e.revert(e)
  10822. }),
  10823. e || T(this.getRoot(), !1)
  10824. },
  10825. listen: function(e) {
  10826. var t = 0 == this.__listening.length;
  10827. this.__listening.push(e),
  10828. t && x(this.__listening)
  10829. }
  10830. }),
  10831. V
  10832. }(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) {
  10833. return function(s, l) {
  10834. var c = s[l];
  10835. 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,{
  10836. min: arguments[2],
  10837. max: arguments[3]
  10838. }) : a.isString(c) ? new n(s,l) : a.isFunction(c) ? new r(s,l,"") : a.isBoolean(c) ? new o(s,l) : void 0
  10839. }
  10840. }(n.controllers.OptionController, n.controllers.NumberControllerBox, n.controllers.NumberControllerSlider, n.controllers.StringController = function(e, t, i) {
  10841. var n = function(e, i) {
  10842. function r() {
  10843. a.setValue(a.__input.value)
  10844. }
  10845. function o() {
  10846. a.__onFinishChange && a.__onFinishChange.call(a, a.getValue())
  10847. }
  10848. n.superclass.call(this, e, i);
  10849. var a = this;
  10850. this.__input = document.createElement("input"),
  10851. this.__input.setAttribute("type", "text"),
  10852. t.bind(this.__input, "keyup", r),
  10853. t.bind(this.__input, "change", r),
  10854. t.bind(this.__input, "blur", o),
  10855. t.bind(this.__input, "keydown", function(e) {
  10856. 13 === e.keyCode && this.blur()
  10857. }),
  10858. this.updateDisplay(),
  10859. this.domElement.appendChild(this.__input)
  10860. };
  10861. return n.superclass = e,
  10862. i.extend(n.prototype, e.prototype, {
  10863. updateDisplay: function() {
  10864. return t.isActive(this.__input) || (this.__input.value = this.getValue()),
  10865. n.superclass.prototype.updateDisplay.call(this)
  10866. }
  10867. }),
  10868. n
  10869. }(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) {
  10870. function o(e, t, i, n) {
  10871. e.style.background = "",
  10872. r.each(l, function(r) {
  10873. e.style.cssText += "background: " + r + "linear-gradient(" + t + ", " + i + " 0%, " + n + " 100%); "
  10874. })
  10875. }
  10876. function a(e) {
  10877. e.style.background = "",
  10878. e.style.cssText += "background: -moz-linear-gradient(top, #ff0000 0%, #ff00ff 17%, #0000ff 34%, #00ffff 50%, #00ff00 67%, #ffff00 84%, #ff0000 100%);",
  10879. e.style.cssText += "background: -webkit-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",
  10880. e.style.cssText += "background: -o-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",
  10881. e.style.cssText += "background: -ms-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",
  10882. e.style.cssText += "background: linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);"
  10883. }
  10884. var s = function(e, l) {
  10885. function c(e) {
  10886. p(e),
  10887. t.bind(window, "mousemove", p),
  10888. t.bind(window, "mouseup", h)
  10889. }
  10890. function h() {
  10891. t.unbind(window, "mousemove", p),
  10892. t.unbind(window, "mouseup", h)
  10893. }
  10894. function u() {
  10895. var e = n(this.value);
  10896. e !== !1 ? (g.__color.__state = e,
  10897. g.setValue(g.__color.toOriginal())) : this.value = g.__color.toString()
  10898. }
  10899. function d() {
  10900. t.unbind(window, "mousemove", f),
  10901. t.unbind(window, "mouseup", d)
  10902. }
  10903. function p(e) {
  10904. e.preventDefault();
  10905. var i = t.getWidth(g.__saturation_field)
  10906. , n = t.getOffset(g.__saturation_field)
  10907. , r = (e.clientX - n.left + document.body.scrollLeft) / i
  10908. , o = 1 - (e.clientY - n.top + document.body.scrollTop) / i;
  10909. return o > 1 ? o = 1 : o < 0 && (o = 0),
  10910. r > 1 ? r = 1 : r < 0 && (r = 0),
  10911. g.__color.v = o,
  10912. g.__color.s = r,
  10913. g.setValue(g.__color.toOriginal()),
  10914. !1
  10915. }
  10916. function f(e) {
  10917. e.preventDefault();
  10918. var i = t.getHeight(g.__hue_field)
  10919. , n = t.getOffset(g.__hue_field)
  10920. , r = 1 - (e.clientY - n.top + document.body.scrollTop) / i;
  10921. return r > 1 ? r = 1 : r < 0 && (r = 0),
  10922. g.__color.h = 360 * r,
  10923. g.setValue(g.__color.toOriginal()),
  10924. !1
  10925. }
  10926. s.superclass.call(this, e, l),
  10927. this.__color = new i(this.getValue()),
  10928. this.__temp = new i(0);
  10929. var g = this;
  10930. this.domElement = document.createElement("div"),
  10931. t.makeSelectable(this.domElement, !1),
  10932. this.__selector = document.createElement("div"),
  10933. this.__selector.className = "selector",
  10934. this.__saturation_field = document.createElement("div"),
  10935. this.__saturation_field.className = "saturation-field",
  10936. this.__field_knob = document.createElement("div"),
  10937. this.__field_knob.className = "field-knob",
  10938. this.__field_knob_border = "2px solid ",
  10939. this.__hue_knob = document.createElement("div"),
  10940. this.__hue_knob.className = "hue-knob",
  10941. this.__hue_field = document.createElement("div"),
  10942. this.__hue_field.className = "hue-field",
  10943. this.__input = document.createElement("input"),
  10944. this.__input.type = "text",
  10945. this.__input_textShadow = "0 1px 1px ",
  10946. t.bind(this.__input, "keydown", function(e) {
  10947. 13 === e.keyCode && u.call(this)
  10948. }),
  10949. t.bind(this.__input, "blur", u),
  10950. t.bind(this.__selector, "mousedown", function(e) {
  10951. t.addClass(this, "drag").bind(window, "mouseup", function(e) {
  10952. t.removeClass(g.__selector, "drag")
  10953. })
  10954. });
  10955. var m = document.createElement("div");
  10956. r.extend(this.__selector.style, {
  10957. width: "122px",
  10958. height: "102px",
  10959. padding: "3px",
  10960. backgroundColor: "#222",
  10961. boxShadow: "0px 1px 3px rgba(0,0,0,0.3)"
  10962. }),
  10963. r.extend(this.__field_knob.style, {
  10964. position: "absolute",
  10965. width: "12px",
  10966. height: "12px",
  10967. border: this.__field_knob_border + (this.__color.v < .5 ? "#fff" : "#000"),
  10968. boxShadow: "0px 1px 3px rgba(0,0,0,0.5)",
  10969. borderRadius: "12px",
  10970. zIndex: 1
  10971. }),
  10972. r.extend(this.__hue_knob.style, {
  10973. position: "absolute",
  10974. width: "15px",
  10975. height: "2px",
  10976. borderRight: "4px solid #fff",
  10977. zIndex: 1
  10978. }),
  10979. r.extend(this.__saturation_field.style, {
  10980. width: "100px",
  10981. height: "100px",
  10982. border: "1px solid #555",
  10983. marginRight: "3px",
  10984. display: "inline-block",
  10985. cursor: "pointer"
  10986. }),
  10987. r.extend(m.style, {
  10988. width: "100%",
  10989. height: "100%",
  10990. background: "none"
  10991. }),
  10992. o(m, "top", "rgba(0,0,0,0)", "#000"),
  10993. r.extend(this.__hue_field.style, {
  10994. width: "15px",
  10995. height: "100px",
  10996. display: "inline-block",
  10997. border: "1px solid #555",
  10998. cursor: "ns-resize"
  10999. }),
  11000. a(this.__hue_field),
  11001. r.extend(this.__input.style, {
  11002. outline: "none",
  11003. textAlign: "center",
  11004. color: "#fff",
  11005. border: 0,
  11006. fontWeight: "bold",
  11007. textShadow: this.__input_textShadow + "rgba(0,0,0,0.7)"
  11008. }),
  11009. t.bind(this.__saturation_field, "mousedown", c),
  11010. t.bind(this.__field_knob, "mousedown", c),
  11011. t.bind(this.__hue_field, "mousedown", function(e) {
  11012. f(e),
  11013. t.bind(window, "mousemove", f),
  11014. t.bind(window, "mouseup", d)
  11015. }),
  11016. this.__saturation_field.appendChild(m),
  11017. this.__selector.appendChild(this.__field_knob),
  11018. this.__selector.appendChild(this.__saturation_field),
  11019. this.__selector.appendChild(this.__hue_field),
  11020. this.__hue_field.appendChild(this.__hue_knob),
  11021. this.domElement.appendChild(this.__input),
  11022. this.domElement.appendChild(this.__selector),
  11023. this.updateDisplay()
  11024. };
  11025. s.superclass = e,
  11026. r.extend(s.prototype, e.prototype, {
  11027. updateDisplay: function() {
  11028. var e = n(this.getValue());
  11029. if (e !== !1) {
  11030. var t = !1;
  11031. r.each(i.COMPONENTS, function(i) {
  11032. if (!r.isUndefined(e[i]) && !r.isUndefined(this.__color.__state[i]) && e[i] !== this.__color.__state[i])
  11033. return t = !0,
  11034. {}
  11035. }, this),
  11036. t && r.extend(this.__color.__state, e)
  11037. }
  11038. r.extend(this.__temp.__state, this.__color.__state),
  11039. this.__temp.a = 1;
  11040. var a = this.__color.v < .5 || this.__color.s > .5 ? 255 : 0
  11041. , s = 255 - a;
  11042. r.extend(this.__field_knob.style, {
  11043. marginLeft: 100 * this.__color.s - 7 + "px",
  11044. marginTop: 100 * (1 - this.__color.v) - 7 + "px",
  11045. backgroundColor: this.__temp.toString(),
  11046. border: this.__field_knob_border + "rgb(" + a + "," + a + "," + a + ")"
  11047. }),
  11048. this.__hue_knob.style.marginTop = 100 * (1 - this.__color.h / 360) + "px",
  11049. this.__temp.s = 1,
  11050. this.__temp.v = 1,
  11051. o(this.__saturation_field, "left", "#fff", this.__temp.toString()),
  11052. r.extend(this.__input.style, {
  11053. backgroundColor: this.__input.value = this.__color.toString(),
  11054. color: "rgb(" + a + "," + a + "," + a + ")",
  11055. textShadow: this.__input_textShadow + "rgba(" + s + "," + s + "," + s + ",.7)"
  11056. })
  11057. }
  11058. });
  11059. var l = ["-moz-", "-o-", "-webkit-", "-ms-", ""];
  11060. return s
  11061. }(n.controllers.Controller, n.dom.dom, n.color.Color = function(e, t, i, n) {
  11062. function r(e, t, i) {
  11063. Object.defineProperty(e, t, {
  11064. get: function() {
  11065. return "RGB" === this.__state.space ? this.__state[t] : (a(this, t, i),
  11066. this.__state[t])
  11067. },
  11068. set: function(e) {
  11069. "RGB" !== this.__state.space && (a(this, t, i),
  11070. this.__state.space = "RGB"),
  11071. this.__state[t] = e
  11072. }
  11073. })
  11074. }
  11075. function o(e, t) {
  11076. Object.defineProperty(e, t, {
  11077. get: function() {
  11078. return "HSV" === this.__state.space ? this.__state[t] : (s(this),
  11079. this.__state[t])
  11080. },
  11081. set: function(e) {
  11082. "HSV" !== this.__state.space && (s(this),
  11083. this.__state.space = "HSV"),
  11084. this.__state[t] = e
  11085. }
  11086. })
  11087. }
  11088. function a(e, i, r) {
  11089. if ("HEX" === e.__state.space)
  11090. e.__state[i] = t.component_from_hex(e.__state.hex, r);
  11091. else {
  11092. if ("HSV" !== e.__state.space)
  11093. throw "Corrupted color state";
  11094. n.extend(e.__state, t.hsv_to_rgb(e.__state.h, e.__state.s, e.__state.v))
  11095. }
  11096. }
  11097. function s(e) {
  11098. var i = t.rgb_to_hsv(e.r, e.g, e.b);
  11099. n.extend(e.__state, {
  11100. s: i.s,
  11101. v: i.v
  11102. }),
  11103. n.isNaN(i.h) ? n.isUndefined(e.__state.h) && (e.__state.h = 0) : e.__state.h = i.h
  11104. }
  11105. var l = function() {
  11106. if (this.__state = e.apply(this, arguments),
  11107. this.__state === !1)
  11108. throw "Failed to interpret color arguments";
  11109. this.__state.a = this.__state.a || 1
  11110. };
  11111. return l.COMPONENTS = ["r", "g", "b", "h", "s", "v", "hex", "a"],
  11112. n.extend(l.prototype, {
  11113. toString: function() {
  11114. return i(this)
  11115. },
  11116. toOriginal: function() {
  11117. return this.__state.conversion.write(this)
  11118. }
  11119. }),
  11120. r(l.prototype, "r", 2),
  11121. r(l.prototype, "g", 1),
  11122. r(l.prototype, "b", 0),
  11123. o(l.prototype, "h"),
  11124. o(l.prototype, "s"),
  11125. o(l.prototype, "v"),
  11126. Object.defineProperty(l.prototype, "a", {
  11127. get: function() {
  11128. return this.__state.a
  11129. },
  11130. set: function(e) {
  11131. this.__state.a = e
  11132. }
  11133. }),
  11134. Object.defineProperty(l.prototype, "hex", {
  11135. get: function() {
  11136. return "HEX" !== !this.__state.space && (this.__state.hex = t.rgb_to_hex(this.r, this.g, this.b)),
  11137. this.__state.hex
  11138. },
  11139. set: function(e) {
  11140. this.__state.space = "HEX",
  11141. this.__state.hex = e
  11142. }
  11143. }),
  11144. l
  11145. }(n.color.interpret, n.color.math = function() {
  11146. var e;
  11147. return {
  11148. hsv_to_rgb: function(e, t, i) {
  11149. var n = Math.floor(e / 60) % 6
  11150. , r = e / 60 - Math.floor(e / 60)
  11151. , o = i * (1 - t)
  11152. , a = i * (1 - r * t)
  11153. , s = i * (1 - (1 - r) * t)
  11154. , l = [[i, s, o], [a, i, o], [o, i, s], [o, a, i], [s, o, i], [i, o, a]][n];
  11155. return {
  11156. r: 255 * l[0],
  11157. g: 255 * l[1],
  11158. b: 255 * l[2]
  11159. }
  11160. },
  11161. rgb_to_hsv: function(e, t, i) {
  11162. var n, r, o = Math.min(e, t, i), a = Math.max(e, t, i), s = a - o;
  11163. return 0 == a ? {
  11164. h: NaN,
  11165. s: 0,
  11166. v: 0
  11167. } : (r = s / a,
  11168. n = e == a ? (t - i) / s : t == a ? 2 + (i - e) / s : 4 + (e - t) / s,
  11169. n /= 6,
  11170. n < 0 && (n += 1),
  11171. {
  11172. h: 360 * n,
  11173. s: r,
  11174. v: a / 255
  11175. })
  11176. },
  11177. rgb_to_hex: function(e, t, i) {
  11178. var n = this.hex_with_component(0, 2, e);
  11179. return n = this.hex_with_component(n, 1, t),
  11180. n = this.hex_with_component(n, 0, i)
  11181. },
  11182. component_from_hex: function(e, t) {
  11183. return e >> 8 * t & 255
  11184. },
  11185. hex_with_component: function(t, i, n) {
  11186. return n << (e = 8 * i) | t & ~(255 << e)
  11187. }
  11188. }
  11189. }(), n.color.toString, n.utils.common), n.color.interpret, n.utils.common), n.utils.requestAnimationFrame = function() {
  11190. return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function(e, t) {
  11191. window.setTimeout(e, 1e3 / 60)
  11192. }
  11193. }(), n.dom.CenteredDiv = function(e, t) {
  11194. var i = function() {
  11195. this.backgroundElement = document.createElement("div"),
  11196. t.extend(this.backgroundElement.style, {
  11197. backgroundColor: "rgba(0,0,0,0.8)",
  11198. top: 0,
  11199. left: 0,
  11200. display: "none",
  11201. zIndex: "1000",
  11202. opacity: 0,
  11203. WebkitTransition: "opacity 0.2s linear"
  11204. }),
  11205. e.makeFullscreen(this.backgroundElement),
  11206. this.backgroundElement.style.position = "fixed",
  11207. this.domElement = document.createElement("div"),
  11208. t.extend(this.domElement.style, {
  11209. position: "fixed",
  11210. display: "none",
  11211. zIndex: "1001",
  11212. opacity: 0,
  11213. WebkitTransition: "-webkit-transform 0.2s ease-out, opacity 0.2s linear"
  11214. }),
  11215. document.body.appendChild(this.backgroundElement),
  11216. document.body.appendChild(this.domElement);
  11217. var i = this;
  11218. e.bind(this.backgroundElement, "click", function() {
  11219. i.hide()
  11220. })
  11221. };
  11222. return i.prototype.show = function() {
  11223. var e = this;
  11224. this.backgroundElement.style.display = "block",
  11225. this.domElement.style.display = "block",
  11226. this.domElement.style.opacity = 0,
  11227. this.domElement.style.webkitTransform = "scale(1.1)",
  11228. this.layout(),
  11229. t.defer(function() {
  11230. e.backgroundElement.style.opacity = 1,
  11231. e.domElement.style.opacity = 1,
  11232. e.domElement.style.webkitTransform = "scale(1)"
  11233. })
  11234. }
  11235. ,
  11236. i.prototype.hide = function() {
  11237. var t = this
  11238. , i = function() {
  11239. t.domElement.style.display = "none",
  11240. t.backgroundElement.style.display = "none",
  11241. e.unbind(t.domElement, "webkitTransitionEnd", i),
  11242. e.unbind(t.domElement, "transitionend", i),
  11243. e.unbind(t.domElement, "oTransitionEnd", i)
  11244. };
  11245. e.bind(this.domElement, "webkitTransitionEnd", i),
  11246. e.bind(this.domElement, "transitionend", i),
  11247. e.bind(this.domElement, "oTransitionEnd", i),
  11248. this.backgroundElement.style.opacity = 0,
  11249. this.domElement.style.opacity = 0,
  11250. this.domElement.style.webkitTransform = "scale(1.1)"
  11251. }
  11252. ,
  11253. i.prototype.layout = function() {
  11254. this.domElement.style.left = $("#player").width() / 2 - e.getWidth(this.domElement) / 2 + "px",
  11255. this.domElement.style.top = $("#player").height() / 2 - e.getHeight(this.domElement) / 2 + "px"
  11256. }
  11257. ,
  11258. i
  11259. }(n.dom.dom, n.utils.common), n.dom.dom, n.utils.common)
  11260. }
  11261. , {}],
  11262. 94: [function(e, t, i) {
  11263. (function(e) {
  11264. "use strict";
  11265. function i(t) {
  11266. function i(e) {
  11267. 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++) {
  11268. var n = _((t[i] * e + 50) / 100);
  11269. n < 1 ? n = 1 : n > 255 && (n = 255),
  11270. T[G[i]] = n
  11271. }
  11272. 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++) {
  11273. var a = _((r[o] * e + 50) / 100);
  11274. a < 1 ? a = 1 : a > 255 && (a = 255),
  11275. x[G[o]] = a
  11276. }
  11277. for (var s = [1, 1.387039845, 1.306562965, 1.175875602, 1, .785694958, .5411961, .275899379], l = 0, c = 0; c < 8; c++)
  11278. for (var h = 0; h < 8; h++)
  11279. S[l] = 1 / (T[G[l]] * s[c] * s[h] * 8),
  11280. M[l] = 1 / (x[G[l]] * s[c] * s[h] * 8),
  11281. l++
  11282. }
  11283. function n(e, t) {
  11284. for (var i = 0, n = 0, r = new Array, o = 1; o <= 16; o++) {
  11285. for (var a = 1; a <= e[o]; a++)
  11286. r[t[n]] = [],
  11287. r[t[n]][0] = i,
  11288. r[t[n]][1] = o,
  11289. n++,
  11290. i++;
  11291. i *= 2
  11292. }
  11293. return r
  11294. }
  11295. function r() {
  11296. C = n(z, W),
  11297. I = n(X, Z),
  11298. E = n(j, Y),
  11299. b = n(q, K)
  11300. }
  11301. function o() {
  11302. for (var e = 1, t = 2, i = 1; i <= 15; i++) {
  11303. for (var n = e; n < t; n++)
  11304. P[32767 + n] = i,
  11305. R[32767 + n] = [],
  11306. R[32767 + n][1] = i,
  11307. R[32767 + n][0] = n;
  11308. for (var r = -(t - 1); r <= -e; r++)
  11309. P[32767 + r] = i,
  11310. R[32767 + r] = [],
  11311. R[32767 + r][1] = i,
  11312. R[32767 + r][0] = t - 1 + r;
  11313. e <<= 1,
  11314. t <<= 1
  11315. }
  11316. }
  11317. function a() {
  11318. for (var e = 0; e < 256; e++)
  11319. H[e] = 19595 * e,
  11320. H[e + 256 >> 0] = 38470 * e,
  11321. H[e + 512 >> 0] = 7471 * e + 32768,
  11322. H[e + 768 >> 0] = -11059 * e,
  11323. H[e + 1024 >> 0] = -21709 * e,
  11324. H[e + 1280 >> 0] = 32768 * e + 8421375,
  11325. H[e + 1536 >> 0] = -27439 * e,
  11326. H[e + 1792 >> 0] = -5329 * e
  11327. }
  11328. function s(e) {
  11329. for (var t = e[0], i = e[1] - 1; i >= 0; )
  11330. t & 1 << i && (N |= 1 << B),
  11331. i--,
  11332. B--,
  11333. B < 0 && (255 == N ? (l(255),
  11334. l(0)) : l(N),
  11335. B = 7,
  11336. N = 0)
  11337. }
  11338. function l(e) {
  11339. D.push(e)
  11340. }
  11341. function c(e) {
  11342. l(e >> 8 & 255),
  11343. l(255 & e)
  11344. }
  11345. function h(e, t) {
  11346. var i, n, r, o, a, s, l, c, h, u = 0, d = 8, p = 64;
  11347. for (h = 0; h < d; ++h) {
  11348. i = e[u],
  11349. n = e[u + 1],
  11350. r = e[u + 2],
  11351. o = e[u + 3],
  11352. a = e[u + 4],
  11353. s = e[u + 5],
  11354. l = e[u + 6],
  11355. c = e[u + 7];
  11356. var f = i + c
  11357. , g = i - c
  11358. , m = n + l
  11359. , v = n - l
  11360. , A = r + s
  11361. , y = r - s
  11362. , C = o + a
  11363. , I = o - a
  11364. , E = f + C
  11365. , b = f - C
  11366. , w = m + A
  11367. , _ = m - A;
  11368. e[u] = E + w,
  11369. e[u + 4] = E - w;
  11370. var T = .707106781 * (_ + b);
  11371. e[u + 2] = b + T,
  11372. e[u + 6] = b - T,
  11373. E = I + y,
  11374. w = y + v,
  11375. _ = v + g;
  11376. var x = .382683433 * (E - _)
  11377. , S = .5411961 * E + x
  11378. , M = 1.306562965 * _ + x
  11379. , R = .707106781 * w
  11380. , P = g + R
  11381. , L = g - R;
  11382. e[u + 5] = L + S,
  11383. e[u + 3] = L - S,
  11384. e[u + 1] = P + M,
  11385. e[u + 7] = P - M,
  11386. u += 8
  11387. }
  11388. for (u = 0,
  11389. h = 0; h < d; ++h) {
  11390. i = e[u],
  11391. n = e[u + 8],
  11392. r = e[u + 16],
  11393. o = e[u + 24],
  11394. a = e[u + 32],
  11395. s = e[u + 40],
  11396. l = e[u + 48],
  11397. c = e[u + 56];
  11398. var D = i + c
  11399. , N = i - c
  11400. , B = n + l
  11401. , F = n - l
  11402. , V = r + s
  11403. , U = r - s
  11404. , k = o + a
  11405. , H = o - a
  11406. , G = D + k
  11407. , z = D - k
  11408. , W = B + V
  11409. , j = B - V;
  11410. e[u] = G + W,
  11411. e[u + 32] = G - W;
  11412. var Y = .707106781 * (j + z);
  11413. e[u + 16] = z + Y,
  11414. e[u + 48] = z - Y,
  11415. G = H + U,
  11416. W = U + F,
  11417. j = F + N;
  11418. var X = .382683433 * (G - j)
  11419. , Z = .5411961 * G + X
  11420. , q = 1.306562965 * j + X
  11421. , K = .707106781 * W
  11422. , Q = N + K
  11423. , J = N - K;
  11424. e[u + 40] = J + Z,
  11425. e[u + 24] = J - Z,
  11426. e[u + 8] = Q + q,
  11427. e[u + 56] = Q - q,
  11428. u++
  11429. }
  11430. var $;
  11431. for (h = 0; h < p; ++h)
  11432. $ = e[h] * t[h],
  11433. O[h] = $ > 0 ? $ + .5 | 0 : $ - .5 | 0;
  11434. return O
  11435. }
  11436. function u() {
  11437. c(65504),
  11438. c(16),
  11439. l(74),
  11440. l(70),
  11441. l(73),
  11442. l(70),
  11443. l(0),
  11444. l(1),
  11445. l(1),
  11446. l(0),
  11447. c(1),
  11448. c(1),
  11449. l(0),
  11450. l(0)
  11451. }
  11452. function d(e, t) {
  11453. c(65472),
  11454. c(17),
  11455. l(8),
  11456. c(t),
  11457. c(e),
  11458. l(3),
  11459. l(1),
  11460. l(17),
  11461. l(0),
  11462. l(2),
  11463. l(17),
  11464. l(1),
  11465. l(3),
  11466. l(17),
  11467. l(1)
  11468. }
  11469. function p() {
  11470. c(65499),
  11471. c(132),
  11472. l(0);
  11473. for (var e = 0; e < 64; e++)
  11474. l(T[e]);
  11475. l(1);
  11476. for (var t = 0; t < 64; t++)
  11477. l(x[t])
  11478. }
  11479. function f() {
  11480. c(65476),
  11481. c(418),
  11482. l(0);
  11483. for (var e = 0; e < 16; e++)
  11484. l(z[e + 1]);
  11485. for (var t = 0; t <= 11; t++)
  11486. l(W[t]);
  11487. l(16);
  11488. for (var i = 0; i < 16; i++)
  11489. l(j[i + 1]);
  11490. for (var n = 0; n <= 161; n++)
  11491. l(Y[n]);
  11492. l(1);
  11493. for (var r = 0; r < 16; r++)
  11494. l(X[r + 1]);
  11495. for (var o = 0; o <= 11; o++)
  11496. l(Z[o]);
  11497. l(17);
  11498. for (var a = 0; a < 16; a++)
  11499. l(q[a + 1]);
  11500. for (var s = 0; s <= 161; s++)
  11501. l(K[s])
  11502. }
  11503. function g() {
  11504. c(65498),
  11505. c(12),
  11506. l(3),
  11507. l(1),
  11508. l(0),
  11509. l(2),
  11510. l(17),
  11511. l(3),
  11512. l(17),
  11513. l(0),
  11514. l(63),
  11515. l(0)
  11516. }
  11517. function m(e, t, i, n, r) {
  11518. for (var o, a = r[0], l = r[240], c = 16, u = 63, d = 64, p = h(e, t), f = 0; f < d; ++f)
  11519. L[G[f]] = p[f];
  11520. var g = L[0] - i;
  11521. i = L[0],
  11522. 0 == g ? s(n[0]) : (o = 32767 + g,
  11523. s(n[P[o]]),
  11524. s(R[o]));
  11525. for (var m = 63; m > 0 && 0 == L[m]; m--)
  11526. ;
  11527. if (0 == m)
  11528. return s(a),
  11529. i;
  11530. for (var v, A = 1; A <= m; ) {
  11531. for (var y = A; 0 == L[A] && A <= m; ++A)
  11532. ;
  11533. var C = A - y;
  11534. if (C >= c) {
  11535. v = C >> 4;
  11536. for (var I = 1; I <= v; ++I)
  11537. s(l);
  11538. C &= 15
  11539. }
  11540. o = 32767 + L[A],
  11541. s(r[(C << 4) + P[o]]),
  11542. s(R[o]),
  11543. A++
  11544. }
  11545. return m != u && s(a),
  11546. i
  11547. }
  11548. function v() {
  11549. for (var e = String.fromCharCode, t = 0; t < 256; t++)
  11550. k[t] = e(t)
  11551. }
  11552. function A(e) {
  11553. if (e <= 0 && (e = 1),
  11554. e > 100 && (e = 100),
  11555. w != e) {
  11556. var t = 0;
  11557. t = e < 50 ? Math.floor(5e3 / e) : Math.floor(200 - 2 * e),
  11558. i(t),
  11559. w = e
  11560. }
  11561. }
  11562. function y() {
  11563. var e = (new Date).getTime();
  11564. t || (t = 50),
  11565. v(),
  11566. r(),
  11567. o(),
  11568. a(),
  11569. A(t);
  11570. (new Date).getTime() - e
  11571. }
  11572. var C, I, E, b, w, _ = (Math.round,
  11573. 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];
  11574. this.encode = function(t, i) {
  11575. var n = ((new Date).getTime(),
  11576. i.quality);
  11577. n && A(n),
  11578. D = new Array,
  11579. N = 0,
  11580. B = 7,
  11581. c(65496),
  11582. u(),
  11583. p(),
  11584. d(t.width, t.height),
  11585. f(),
  11586. g();
  11587. var r = 0
  11588. , o = 0
  11589. , a = 0;
  11590. N = 0,
  11591. B = 7,
  11592. this.encode.displayName = "_encode_";
  11593. 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; ) {
  11594. for (l = 0; l < G; ) {
  11595. for (w = G * z + l,
  11596. _ = w,
  11597. T = -1,
  11598. x = 0,
  11599. R = 0; R < 64; R++)
  11600. x = (k ? 63 - R : R) >> 3,
  11601. T = 4 * (7 & R),
  11602. _ = w + x * G + T,
  11603. z + x >= L && (_ -= G * (z + 1 + x - L)),
  11604. l + T >= G && (_ -= l + T - G + 4),
  11605. h = P[_++],
  11606. v = P[_++],
  11607. y = P[_++],
  11608. F[R] = (H[h] + H[v + 256 >> 0] + H[y + 512 >> 0] >> 16) - 128,
  11609. V[R] = (H[h + 768 >> 0] + H[v + 1024 >> 0] + H[y + 1280 >> 0] >> 16) - 128,
  11610. U[R] = (H[h + 1280 >> 0] + H[v + 1536 >> 0] + H[y + 1792 >> 0] >> 16) - 128;
  11611. r = m(F, S, r, C, E),
  11612. o = m(V, M, o, I, b),
  11613. a = m(U, M, a, I, b),
  11614. l += 32
  11615. }
  11616. z += W
  11617. }
  11618. if (B >= 0) {
  11619. var j = [];
  11620. j[1] = B + 1,
  11621. j[0] = (1 << B + 1) - 1,
  11622. s(j)
  11623. }
  11624. return c(65497),
  11625. new e(D)
  11626. }
  11627. ,
  11628. y()
  11629. }
  11630. function n(e, t) {
  11631. t = t || {},
  11632. t.quality = t.quality || 50;
  11633. var n = t.quality
  11634. , r = new i(n)
  11635. , o = r.encode(e, t);
  11636. return {
  11637. data: o,
  11638. width: e.width,
  11639. height: e.height
  11640. }
  11641. }
  11642. t.exports.encode = n
  11643. }
  11644. ).call(this, e("buffer").Buffer)
  11645. }
  11646. , {
  11647. buffer: 198
  11648. }],
  11649. 95: [function(e, t, i) {
  11650. "use strict";
  11651. !function() {
  11652. if ("performance"in window == !1 && (window.performance = {}),
  11653. Date.now = Date.now || function() {
  11654. return (new Date).getTime()
  11655. }
  11656. ,
  11657. "now"in window.performance == !1) {
  11658. var e = Date.now();
  11659. performance.timing && performance.timing.navigationStart && (e = performance.timing.navigationStart),
  11660. window.performance.now = function() {
  11661. return Date.now() - e
  11662. }
  11663. }
  11664. }()
  11665. }
  11666. , {}],
  11667. 96: [function(e, t, i) {
  11668. "use strict";
  11669. var n = e("three");
  11670. n.EffectComposer = function(e, t) {
  11671. if (this.renderer = e,
  11672. void 0 === t) {
  11673. var i = {
  11674. minFilter: n.LinearFilter,
  11675. magFilter: n.LinearFilter,
  11676. format: n.RGBAFormat,
  11677. stencilBuffer: !1
  11678. }
  11679. , r = e.getSize();
  11680. t = new n.WebGLRenderTarget(r.width,r.height,i)
  11681. }
  11682. this.renderTarget1 = t,
  11683. this.renderTarget2 = t.clone(),
  11684. this.writeBuffer = this.renderTarget1,
  11685. this.readBuffer = this.renderTarget2,
  11686. this.passes = [],
  11687. void 0 === n.CopyShader && console.error("THREE.EffectComposer relies on THREE.CopyShader"),
  11688. this.copyPass = new n.ShaderPass(n.CopyShader)
  11689. }
  11690. ,
  11691. n.EffectComposer.prototype = {
  11692. swapBuffers: function() {
  11693. var e = this.readBuffer;
  11694. this.readBuffer = this.writeBuffer,
  11695. this.writeBuffer = e
  11696. },
  11697. addPass: function(e) {
  11698. this.passes.push(e)
  11699. },
  11700. insertPass: function(e, t) {
  11701. this.passes.splice(t, 0, e)
  11702. },
  11703. render: function(e) {
  11704. this.writeBuffer = this.renderTarget1,
  11705. this.readBuffer = this.renderTarget2;
  11706. var t, i, r = !1, o = this.passes.length;
  11707. for (i = 0; i < o; i++)
  11708. if (t = this.passes[i],
  11709. t.enabled) {
  11710. if (t.render(this.renderer, this.writeBuffer, this.readBuffer, e, r),
  11711. t.needsSwap) {
  11712. if (r) {
  11713. var a = this.renderer.context;
  11714. a.stencilFunc(a.NOTEQUAL, 1, 4294967295),
  11715. this.copyPass.render(this.renderer, this.writeBuffer, this.readBuffer, e),
  11716. a.stencilFunc(a.EQUAL, 1, 4294967295)
  11717. }
  11718. this.swapBuffers()
  11719. }
  11720. t instanceof n.MaskPass ? r = !0 : t instanceof n.ClearMaskPass && (r = !1)
  11721. }
  11722. },
  11723. reset: function(e) {
  11724. if (void 0 === e) {
  11725. var t = this.renderer.getSize();
  11726. e = this.renderTarget1.clone(),
  11727. e.setSize(t.width, t.height)
  11728. }
  11729. this.renderTarget1.dispose(),
  11730. this.renderTarget2.dispose(),
  11731. this.renderTarget1 = e,
  11732. this.renderTarget2 = e.clone(),
  11733. this.writeBuffer = this.renderTarget1,
  11734. this.readBuffer = this.renderTarget2
  11735. },
  11736. setSize: function(e, t) {
  11737. this.renderTarget1.setSize(e, t),
  11738. this.renderTarget2.setSize(e, t)
  11739. }
  11740. }
  11741. }
  11742. , {
  11743. three: 217
  11744. }],
  11745. 97: [function(e, t, i) {
  11746. "use strict";
  11747. var n = e("three");
  11748. n.MaskPass = function(e, t) {
  11749. this.scene = e,
  11750. this.camera = t,
  11751. this.enabled = !0,
  11752. this.clear = !0,
  11753. this.needsSwap = !1,
  11754. this.inverse = !1
  11755. }
  11756. ,
  11757. n.MaskPass.prototype = {
  11758. render: function(e, t, i, n) {
  11759. var r = e.context;
  11760. r.colorMask(!1, !1, !1, !1),
  11761. r.depthMask(!1);
  11762. var o, a;
  11763. this.inverse ? (o = 0,
  11764. a = 1) : (o = 1,
  11765. a = 0),
  11766. r.enable(r.STENCIL_TEST),
  11767. r.stencilOp(r.REPLACE, r.REPLACE, r.REPLACE),
  11768. r.stencilFunc(r.ALWAYS, o, 4294967295),
  11769. r.clearStencil(a),
  11770. e.render(this.scene, this.camera, i, this.clear),
  11771. e.render(this.scene, this.camera, t, this.clear),
  11772. r.colorMask(!0, !0, !0, !0),
  11773. r.depthMask(!0),
  11774. r.stencilFunc(r.EQUAL, 1, 4294967295),
  11775. r.stencilOp(r.KEEP, r.KEEP, r.KEEP)
  11776. }
  11777. },
  11778. n.ClearMaskPass = function() {
  11779. this.enabled = !0
  11780. }
  11781. ,
  11782. n.ClearMaskPass.prototype = {
  11783. render: function(e, t, i, n) {
  11784. var r = e.context;
  11785. r.disable(r.STENCIL_TEST)
  11786. }
  11787. }
  11788. }
  11789. , {
  11790. three: 217
  11791. }],
  11792. 98: [function(e, t, i) {
  11793. "use strict";
  11794. var n = e("three");
  11795. n.RenderPass = function(e, t, i, r, o) {
  11796. this.scene = e,
  11797. this.camera = t,
  11798. this.overrideMaterial = i,
  11799. this.clearColor = r,
  11800. this.clearAlpha = void 0 !== o ? o : 1,
  11801. this.oldClearColor = new n.Color,
  11802. this.oldClearAlpha = 1,
  11803. this.enabled = !0,
  11804. this.clear = !0,
  11805. this.needsSwap = !1
  11806. }
  11807. ,
  11808. n.RenderPass.prototype = {
  11809. render: function(e, t, i, n) {
  11810. this.scene.overrideMaterial = this.overrideMaterial,
  11811. this.clearColor && (this.oldClearColor.copy(e.getClearColor()),
  11812. this.oldClearAlpha = e.getClearAlpha(),
  11813. e.setClearColor(this.clearColor, this.clearAlpha)),
  11814. e.render(this.scene, this.camera, i, this.clear),
  11815. this.clearColor && e.setClearColor(this.oldClearColor, this.oldClearAlpha),
  11816. this.scene.overrideMaterial = null
  11817. }
  11818. }
  11819. }
  11820. , {
  11821. three: 217
  11822. }],
  11823. 99: [function(e, t, i) {
  11824. "use strict";
  11825. var n = e("three");
  11826. n.ShaderPass = function(e, t) {
  11827. this.textureID = void 0 !== t ? t : "tDiffuse",
  11828. e instanceof n.ShaderMaterial ? (this.uniforms = e.uniforms,
  11829. this.material = e) : e && (this.uniforms = n.UniformsUtils.clone(e.uniforms),
  11830. this.material = new n.ShaderMaterial({
  11831. defines: e.defines || {},
  11832. uniforms: this.uniforms,
  11833. vertexShader: e.vertexShader,
  11834. fragmentShader: e.fragmentShader
  11835. })),
  11836. this.renderToScreen = !1,
  11837. this.enabled = !0,
  11838. this.needsSwap = !0,
  11839. this.clear = !1,
  11840. this.camera = new n.OrthographicCamera(-1,1,1,-1,0,1),
  11841. this.scene = new n.Scene,
  11842. this.quad = new n.Mesh(new n.PlaneBufferGeometry(2,2),null),
  11843. this.scene.add(this.quad)
  11844. }
  11845. ,
  11846. n.ShaderPass.prototype = {
  11847. render: function(e, t, i, n) {
  11848. this.uniforms[this.textureID] && (this.uniforms[this.textureID].value = i),
  11849. this.quad.material = this.material,
  11850. this.renderToScreen ? e.render(this.scene, this.camera) : e.render(this.scene, this.camera, t, this.clear)
  11851. }
  11852. }
  11853. }
  11854. , {
  11855. three: 217
  11856. }],
  11857. 100: [function(e, t, i) {
  11858. "use strict";
  11859. var n = e("three");
  11860. n.CopyShader = {
  11861. uniforms: {
  11862. tDiffuse: {
  11863. type: "t",
  11864. value: null
  11865. },
  11866. opacity: {
  11867. type: "f",
  11868. value: 1
  11869. }
  11870. },
  11871. vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  11872. fragmentShader: ["uniform float opacity;", "uniform sampler2D tDiffuse;", "varying vec2 vUv;", "void main() {", "vec4 texel = texture2D( tDiffuse, vUv );", "gl_FragColor = opacity * texel;", "}"].join("\n")
  11873. }
  11874. }
  11875. , {
  11876. three: 217
  11877. }],
  11878. 101: [function(e, t, i) {
  11879. "use strict";
  11880. var n = e("three");
  11881. n.HorizontalBlurShader = {
  11882. uniforms: {
  11883. tDiffuse: {
  11884. type: "t",
  11885. value: null
  11886. },
  11887. h: {
  11888. type: "f",
  11889. value: 1 / 512
  11890. }
  11891. },
  11892. vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  11893. 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")
  11894. }
  11895. }
  11896. , {
  11897. three: 217
  11898. }],
  11899. 102: [function(e, t, i) {
  11900. "use strict";
  11901. var n = e("three");
  11902. n.VerticalBlurShader = {
  11903. uniforms: {
  11904. tDiffuse: {
  11905. type: "t",
  11906. value: null
  11907. },
  11908. v: {
  11909. type: "f",
  11910. value: 1 / 512
  11911. }
  11912. },
  11913. vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  11914. 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")
  11915. }
  11916. }
  11917. , {
  11918. three: 217
  11919. }],
  11920. 103: [function(e, t, i) {
  11921. "use strict";
  11922. var n = e("three");
  11923. !function() {
  11924. if ("performance"in window == 0 && (window.performance = {}),
  11925. "now"in window.performance == 0) {
  11926. var e = Date.now();
  11927. performance.timing && performance.timing.navigationStart && (e = performance.timing.navigationStart),
  11928. window.performance.now = function() {
  11929. return Date.now() - e
  11930. }
  11931. }
  11932. }(),
  11933. n.WebGLRenderer.prototype.paramThreeToGL = function(e) {
  11934. var t, i = this.extensions, r = this.context;
  11935. if (e === n.RepeatWrapping)
  11936. return r.REPEAT;
  11937. if (e === n.ClampToEdgeWrapping)
  11938. return r.CLAMP_TO_EDGE;
  11939. if (e === n.MirroredRepeatWrapping)
  11940. return r.MIRRORED_REPEAT;
  11941. if (e === n.NearestFilter)
  11942. return r.NEAREST;
  11943. if (e === n.NearestMipMapNearestFilter)
  11944. return r.NEAREST_MIPMAP_NEAREST;
  11945. if (e === n.NearestMipMapLinearFilter)
  11946. return r.NEAREST_MIPMAP_LINEAR;
  11947. if (e === n.LinearFilter)
  11948. return r.LINEAR;
  11949. if (e === n.LinearMipMapNearestFilter)
  11950. return r.LINEAR_MIPMAP_NEAREST;
  11951. if (e === n.LinearMipMapLinearFilter)
  11952. return r.LINEAR_MIPMAP_LINEAR;
  11953. if (e === n.UnsignedByteType)
  11954. return r.UNSIGNED_BYTE;
  11955. if (e === n.UnsignedShort4444Type)
  11956. return r.UNSIGNED_SHORT_4_4_4_4;
  11957. if (e === n.UnsignedShort5551Type)
  11958. return r.UNSIGNED_SHORT_5_5_5_1;
  11959. if (e === n.UnsignedShort565Type)
  11960. return r.UNSIGNED_SHORT_5_6_5;
  11961. if (e === n.ByteType)
  11962. return r.BYTE;
  11963. if (e === n.ShortType)
  11964. return r.SHORT;
  11965. if (e === n.UnsignedShortType)
  11966. return r.UNSIGNED_SHORT;
  11967. if (e === n.IntType)
  11968. return r.INT;
  11969. if (e === n.UnsignedIntType)
  11970. return r.UNSIGNED_INT;
  11971. if (e === n.FloatType)
  11972. return r.FLOAT;
  11973. if (t = i.get("OES_texture_half_float"),
  11974. null !== t && e === n.HalfFloatType)
  11975. return t.HALF_FLOAT_OES;
  11976. if (e === n.AlphaFormat)
  11977. return r.ALPHA;
  11978. if (e === n.RGBFormat)
  11979. return r.RGB;
  11980. if (e === n.RGBAFormat)
  11981. return r.RGBA;
  11982. if (e === n.LuminanceFormat)
  11983. return r.LUMINANCE;
  11984. if (e === n.LuminanceAlphaFormat)
  11985. return r.LUMINANCE_ALPHA;
  11986. if (e === n.AddEquation)
  11987. return r.FUNC_ADD;
  11988. if (e === n.SubtractEquation)
  11989. return r.FUNC_SUBTRACT;
  11990. if (e === n.ReverseSubtractEquation)
  11991. return r.FUNC_REVERSE_SUBTRACT;
  11992. if (e === n.ZeroFactor)
  11993. return r.ZERO;
  11994. if (e === n.OneFactor)
  11995. return r.ONE;
  11996. if (e === n.SrcColorFactor)
  11997. return r.SRC_COLOR;
  11998. if (e === n.OneMinusSrcColorFactor)
  11999. return r.ONE_MINUS_SRC_COLOR;
  12000. if (e === n.SrcAlphaFactor)
  12001. return r.SRC_ALPHA;
  12002. if (e === n.OneMinusSrcAlphaFactor)
  12003. return r.ONE_MINUS_SRC_ALPHA;
  12004. if (e === n.DstAlphaFactor)
  12005. return r.DST_ALPHA;
  12006. if (e === n.OneMinusDstAlphaFactor)
  12007. return r.ONE_MINUS_DST_ALPHA;
  12008. if (e === n.DstColorFactor)
  12009. return r.DST_COLOR;
  12010. if (e === n.OneMinusDstColorFactor)
  12011. return r.ONE_MINUS_DST_COLOR;
  12012. if (e === n.SrcAlphaSaturateFactor)
  12013. return r.SRC_ALPHA_SATURATE;
  12014. if (t = i.get("WEBGL_compressed_texture_s3tc"),
  12015. null !== t) {
  12016. if (e === n.RGB_S3TC_DXT1_Format)
  12017. return t.COMPRESSED_RGB_S3TC_DXT1_EXT;
  12018. if (e === n.RGBA_S3TC_DXT1_Format)
  12019. return t.COMPRESSED_RGBA_S3TC_DXT1_EXT;
  12020. if (e === n.RGBA_S3TC_DXT3_Format)
  12021. return t.COMPRESSED_RGBA_S3TC_DXT3_EXT;
  12022. if (e === n.RGBA_S3TC_DXT5_Format)
  12023. return t.COMPRESSED_RGBA_S3TC_DXT5_EXT
  12024. }
  12025. if (t = i.get("WEBGL_compressed_texture_pvrtc"),
  12026. null !== t) {
  12027. if (e === n.RGB_PVRTC_4BPPV1_Format)
  12028. return t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;
  12029. if (e === n.RGB_PVRTC_2BPPV1_Format)
  12030. return t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;
  12031. if (e === n.RGBA_PVRTC_4BPPV1_Format)
  12032. return t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;
  12033. if (e === n.RGBA_PVRTC_2BPPV1_Format)
  12034. return t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG
  12035. }
  12036. if (t = i.get("WEBGL_compressed_texture_etc1"),
  12037. null !== t && e === n.RGB_ETC1_Format)
  12038. return t.COMPRESSED_RGB_ETC1_WEBGL;
  12039. if (t = i.get("EXT_blend_minmax"),
  12040. null !== t) {
  12041. if (e === n.MinEquation)
  12042. return t.MIN_EXT;
  12043. if (e === n.MaxEquation)
  12044. return t.MAX_EXT
  12045. }
  12046. return 0
  12047. }
  12048. ,
  12049. n.WebGLState = function(e, t, i) {
  12050. var r = this
  12051. , o = new n.Vector4
  12052. , a = e.getParameter(e.MAX_VERTEX_ATTRIBS)
  12053. , s = new Uint8Array(a)
  12054. , l = new Uint8Array(a)
  12055. , c = new Uint8Array(a)
  12056. , h = {}
  12057. , u = null
  12058. , d = null
  12059. , p = null
  12060. , f = null
  12061. , g = null
  12062. , m = null
  12063. , v = null
  12064. , A = null
  12065. , y = !1
  12066. , C = null
  12067. , I = null
  12068. , E = null
  12069. , b = null
  12070. , w = null
  12071. , _ = null
  12072. , T = null
  12073. , x = null
  12074. , S = null
  12075. , M = null
  12076. , R = null
  12077. , P = null
  12078. , O = null
  12079. , L = null
  12080. , D = null
  12081. , N = e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS)
  12082. , B = void 0
  12083. , F = {}
  12084. , V = new n.Vector4
  12085. , U = null
  12086. , k = null
  12087. , H = new n.Vector4
  12088. , G = new n.Vector4;
  12089. this.init = function() {
  12090. this.clearColor(0, 0, 0, 1),
  12091. this.clearDepth(1),
  12092. this.clearStencil(0),
  12093. this.enable(e.DEPTH_TEST),
  12094. e.depthFunc(e.LEQUAL),
  12095. e.frontFace(e.CCW),
  12096. e.cullFace(e.BACK),
  12097. this.enable(e.CULL_FACE),
  12098. this.enable(e.BLEND),
  12099. e.blendEquation(e.FUNC_ADD),
  12100. e.blendFunc(e.SRC_ALPHA, e.ONE_MINUS_SRC_ALPHA)
  12101. }
  12102. ,
  12103. this.initAttributes = function() {
  12104. for (var e = 0, t = s.length; e < t; e++)
  12105. s[e] = 0
  12106. }
  12107. ,
  12108. this.enableAttribute = function(i) {
  12109. if (s[i] = 1,
  12110. 0 === l[i] && (e.enableVertexAttribArray(i),
  12111. l[i] = 1),
  12112. 0 !== c[i]) {
  12113. var n = t.get("ANGLE_instanced_arrays");
  12114. n.vertexAttribDivisorANGLE(i, 0),
  12115. c[i] = 0
  12116. }
  12117. }
  12118. ,
  12119. this.enableAttributeAndDivisor = function(t, i, n) {
  12120. s[t] = 1,
  12121. 0 === l[t] && (e.enableVertexAttribArray(t),
  12122. l[t] = 1),
  12123. c[t] !== i && (n.vertexAttribDivisorANGLE(t, i),
  12124. c[t] = i)
  12125. }
  12126. ,
  12127. this.disableUnusedAttributes = function() {
  12128. for (var t = 0, i = l.length; t < i; t++)
  12129. l[t] !== s[t] && (e.disableVertexAttribArray(t),
  12130. l[t] = 0)
  12131. }
  12132. ,
  12133. this.enable = function(t) {
  12134. h[t] !== !0 && (e.enable(t),
  12135. h[t] = !0)
  12136. }
  12137. ,
  12138. this.disable = function(t) {
  12139. h[t] !== !1 && (e.disable(t),
  12140. h[t] = !1)
  12141. }
  12142. ,
  12143. this.getCompressedTextureFormats = function() {
  12144. if (null === u && (u = [],
  12145. t.get("WEBGL_compressed_texture_pvrtc") || t.get("WEBGL_compressed_texture_s3tc") || t.get("WEBGL_compressed_texture_etc1")))
  12146. for (var i = e.getParameter(e.COMPRESSED_TEXTURE_FORMATS), n = 0; n < i.length; n++)
  12147. u.push(i[n]);
  12148. return u
  12149. }
  12150. ,
  12151. this.setBlending = function(t, r, o, a, s, l, c, h) {
  12152. t === n.NoBlending ? this.disable(e.BLEND) : this.enable(e.BLEND),
  12153. t === d && h === y || (t === n.AdditiveBlending ? h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  12154. e.blendFuncSeparate(e.ONE, e.ONE, e.ONE, e.ONE)) : (e.blendEquation(e.FUNC_ADD),
  12155. e.blendFunc(e.SRC_ALPHA, e.ONE)) : t === n.SubtractiveBlending ? h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  12156. e.blendFuncSeparate(e.ZERO, e.ZERO, e.ONE_MINUS_SRC_COLOR, e.ONE_MINUS_SRC_ALPHA)) : (e.blendEquation(e.FUNC_ADD),
  12157. e.blendFunc(e.ZERO, e.ONE_MINUS_SRC_COLOR)) : t === n.MultiplyBlending ? h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  12158. e.blendFuncSeparate(e.ZERO, e.ZERO, e.SRC_COLOR, e.SRC_ALPHA)) : (e.blendEquation(e.FUNC_ADD),
  12159. e.blendFunc(e.ZERO, e.SRC_COLOR)) : h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  12160. e.blendFuncSeparate(e.ONE, e.ONE_MINUS_SRC_ALPHA, e.ONE, e.ONE_MINUS_SRC_ALPHA)) : (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  12161. e.blendFuncSeparate(e.SRC_ALPHA, e.ONE_MINUS_SRC_ALPHA, e.ONE, e.ONE_MINUS_SRC_ALPHA)),
  12162. d = t,
  12163. y = h),
  12164. t === n.CustomBlending ? (s = s || r,
  12165. l = l || o,
  12166. c = c || a,
  12167. r === p && s === m || (e.blendEquationSeparate(i(r), i(s)),
  12168. p = r,
  12169. m = s),
  12170. o === f && a === g && l === v && c === A || (e.blendFuncSeparate(i(o), i(a), i(l), i(c)),
  12171. f = o,
  12172. g = a,
  12173. v = l,
  12174. A = c)) : (p = null,
  12175. f = null,
  12176. g = null,
  12177. m = null,
  12178. v = null,
  12179. A = null)
  12180. }
  12181. ,
  12182. this.setDepthFunc = function(t) {
  12183. if (C !== t) {
  12184. if (t)
  12185. switch (t) {
  12186. case n.NeverDepth:
  12187. e.depthFunc(e.NEVER);
  12188. break;
  12189. case n.AlwaysDepth:
  12190. e.depthFunc(e.ALWAYS);
  12191. break;
  12192. case n.LessDepth:
  12193. e.depthFunc(e.LESS);
  12194. break;
  12195. case n.LessEqualDepth:
  12196. e.depthFunc(e.LEQUAL);
  12197. break;
  12198. case n.EqualDepth:
  12199. e.depthFunc(e.EQUAL);
  12200. break;
  12201. case n.GreaterEqualDepth:
  12202. e.depthFunc(e.GEQUAL);
  12203. break;
  12204. case n.GreaterDepth:
  12205. e.depthFunc(e.GREATER);
  12206. break;
  12207. case n.NotEqualDepth:
  12208. e.depthFunc(e.NOTEQUAL);
  12209. break;
  12210. default:
  12211. e.depthFunc(e.LEQUAL)
  12212. }
  12213. else
  12214. e.depthFunc(e.LEQUAL);
  12215. C = t
  12216. }
  12217. }
  12218. ,
  12219. this.setDepthTest = function(t) {
  12220. t ? this.enable(e.DEPTH_TEST) : this.disable(e.DEPTH_TEST)
  12221. }
  12222. ,
  12223. this.setDepthWrite = function(t) {
  12224. I !== t && (e.depthMask(t),
  12225. I = t)
  12226. }
  12227. ,
  12228. this.setColorWrite = function(t) {
  12229. E !== t && (e.colorMask(t, t, t, t),
  12230. E = t)
  12231. }
  12232. ,
  12233. this.setStencilFunc = function(t, i, n) {
  12234. w === t && _ === i && T === n || (e.stencilFunc(t, i, n),
  12235. w = t,
  12236. _ = i,
  12237. T = n)
  12238. }
  12239. ,
  12240. this.setStencilOp = function(t, i, n) {
  12241. x === t && S === i && M === n || (e.stencilOp(t, i, n),
  12242. x = t,
  12243. S = i,
  12244. M = n)
  12245. }
  12246. ,
  12247. this.setStencilTest = function(t) {
  12248. t ? this.enable(e.STENCIL_TEST) : this.disable(e.STENCIL_TEST)
  12249. }
  12250. ,
  12251. this.setStencilWrite = function(t) {
  12252. b !== t && (e.stencilMask(t),
  12253. b = t)
  12254. }
  12255. ,
  12256. this.setFlipSided = function(t) {
  12257. R !== t && (t ? e.frontFace(e.CW) : e.frontFace(e.CCW),
  12258. R = t)
  12259. }
  12260. ,
  12261. this.setLineWidth = function(t) {
  12262. t !== P && (e.lineWidth(t),
  12263. P = t)
  12264. }
  12265. ,
  12266. this.setPolygonOffset = function(t, i, n) {
  12267. t ? this.enable(e.POLYGON_OFFSET_FILL) : this.disable(e.POLYGON_OFFSET_FILL),
  12268. !t || O === i && L === n || (e.polygonOffset(i, n),
  12269. O = i,
  12270. L = n)
  12271. }
  12272. ,
  12273. this.getScissorTest = function() {
  12274. return D
  12275. }
  12276. ,
  12277. this.setScissorTest = function(t) {
  12278. D = t,
  12279. t ? this.enable(e.SCISSOR_TEST) : this.disable(e.SCISSOR_TEST)
  12280. }
  12281. ,
  12282. this.activeTexture = function(t) {
  12283. void 0 === t && (t = e.TEXTURE0 + N - 1),
  12284. B !== t && (e.activeTexture(t),
  12285. B = t)
  12286. }
  12287. ,
  12288. this.bindTexture = function(t, i) {
  12289. void 0 === B && r.activeTexture();
  12290. var n = F[B];
  12291. void 0 === n && (n = {
  12292. type: void 0,
  12293. texture: void 0
  12294. },
  12295. F[B] = n),
  12296. n.type === t && n.texture === i || (e.bindTexture(t, i),
  12297. n.type = t,
  12298. n.texture = i)
  12299. }
  12300. ,
  12301. this.compressedTexImage2D = function() {
  12302. try {
  12303. e.compressedTexImage2D.apply(e, arguments)
  12304. } catch (e) {
  12305. console.error(e)
  12306. }
  12307. }
  12308. ,
  12309. this.texImage2D = function() {
  12310. try {
  12311. e.texImage2D.apply(e, arguments)
  12312. } catch (e) {
  12313. console.error(e)
  12314. }
  12315. }
  12316. ,
  12317. this.clearColor = function(t, i, n, r) {
  12318. o.set(t, i, n, r),
  12319. V.equals(o) === !1 && (e.clearColor(t, i, n, r),
  12320. V.copy(o))
  12321. }
  12322. ,
  12323. this.clearDepth = function(t) {
  12324. U !== t && (e.clearDepth(t),
  12325. U = t)
  12326. }
  12327. ,
  12328. this.clearStencil = function(t) {
  12329. k !== t && (e.clearStencil(t),
  12330. k = t)
  12331. }
  12332. ,
  12333. this.scissor = function(t) {
  12334. H.equals(t) === !1 && (e.scissor(t.x, t.y, t.z, t.w),
  12335. H.copy(t))
  12336. }
  12337. ,
  12338. this.viewport = function(t) {
  12339. G.equals(t) === !1 && (e.viewport(t.x, t.y, t.z, t.w),
  12340. G.copy(t))
  12341. }
  12342. ,
  12343. this.reset = function() {
  12344. for (var t = 0; t < l.length; t++)
  12345. 1 === l[t] && (e.disableVertexAttribArray(t),
  12346. l[t] = 0);
  12347. h = {},
  12348. u = null,
  12349. B = void 0,
  12350. F = {},
  12351. d = null,
  12352. E = null,
  12353. I = null,
  12354. b = null,
  12355. R = null
  12356. }
  12357. }
  12358. }
  12359. , {
  12360. three: 217
  12361. }],
  12362. 104: [function(e, t, i) {
  12363. (function(i, n) {
  12364. "use strict";
  12365. function r(e) {
  12366. this.urls = e;
  12367. var t = i("bWVzc2FnZSBiaW5hcnlfbWVzaCB7CglyZXBlYXRlZCBjaHVua19zaW1wbGUgY2h1bmsgPSAxOwoJcmVwZWF0ZWQgY2h1bmtfcXVhbnRpemVkIHF1YW50aXplZF9jaHVuayA9IDI7Cn0KCi8vIERlZmluaXRpb24gb2YgdmVydGljZXM6IDNEIGNvb3JkaW5hdGVzLCBhbmQgMkQgdGV4dHVyZSBjb29yZGluYXRlcy4KbWVzc2FnZSB2ZXJ0aWNlc19zaW1wbGUgewoJcmVwZWF0ZWQgZmxvYXQgeHl6ID0gMSBbcGFja2VkPXRydWVdOyAgLy8geF8wLHlfMCx6XzAsIHhfMSx5XzEsel8xLCAuLi4KCXJlcGVhdGVkIGZsb2F0IHV2ID0gMiBbcGFja2VkPXRydWVdOyAgLy8gdV8wLHZfMCwgdV8xLHZfMSwgLi4uCn0KCi8vIEluZGV4ZXMgb2YgdmVydGljZXMgb2YgZmFjZXMKbWVzc2FnZSBmYWNlc19zaW1wbGUgewoJcmVwZWF0ZWQgdWludDMyIGZhY2VzID0gMSBbcGFja2VkPXRydWVdOyAvLyBpMDAsaTAxLGkwMiwgaTEwLGkxMSxpMTIsIC4uLgp9CgovLyBBIHNpbXBseSBlbmNvZGVkIGNodW5rLgovLyBUT0RPOiBhZGQgY2h1bmsgcHJvcGVyaXRlcyAoc3VjaCBhcyAicmVmbGVjdGl2ZSIpCm1lc3NhZ2UgY2h1bmtfc2ltcGxlIHsKCW9wdGlvbmFsIHZlcnRpY2VzX3NpbXBsZSB2ZXJ0aWNlcyA9IDE7CglvcHRpb25hbCBmYWNlc19zaW1wbGUgZmFjZXMgPSAyOwoJb3B0aW9uYWwgc3RyaW5nIGNodW5rX25hbWUgPSAzOwoJb3B0aW9uYWwgc3RyaW5nIG1hdGVyaWFsX25hbWUgPSA0Owp9CgovLyBRdWFudGl6ZWQgdmVyc2lvbnMgZm9sbG93OgptZXNzYWdlIHZlcnRpY2VzX3F1YW50aXplZCB7CglvcHRpb25hbCBmbG9hdCBxdWFudGl6YXRpb24gPSAxOwoJcmVwZWF0ZWQgZmxvYXQgdHJhbnNsYXRpb24gPSAyOwoJcmVwZWF0ZWQgc2ludDMyIHggPSAzIFtwYWNrZWQ9dHJ1ZV07CglyZXBlYXRlZCBzaW50MzIgeSA9IDQgW3BhY2tlZD10cnVlXTsKCXJlcGVhdGVkIHNpbnQzMiB6ID0gNSBbcGFja2VkPXRydWVdOwp9CgptZXNzYWdlIHV2X3F1YW50aXplZCB7CglvcHRpb25hbCBzdHJpbmcgbmFtZSA9IDE7CglvcHRpb25hbCBmbG9hdCBxdWFudGl6YXRpb24gPSAyOwoJcmVwZWF0ZWQgc2ludDMyIHUgPSAzIFtwYWNrZWQ9dHJ1ZV07CglyZXBlYXRlZCBzaW50MzIgdiA9IDQgW3BhY2tlZD10cnVlXTsKfQoKLy8gSW5kZXhlcyBvZiB2ZXJ0aWNlcyBvZiBmYWNlcwptZXNzYWdlIGZhY2VzX2NvbXByZXNzZWQgewoJcmVwZWF0ZWQgc2ludDMyIGZhY2VzID0gMSBbcGFja2VkPXRydWVdOyAvLyBpMDAsaTAxLGkwMiwgaTEwLGkxMSxpMTIsIC4uLgp9CgptZXNzYWdlIGNodW5rX3F1YW50aXplZCB7CglvcHRpb25hbCBzdHJpbmcgY2h1bmtfbmFtZSA9IDE7CglvcHRpb25hbCBzdHJpbmcgbWF0ZXJpYWxfbmFtZSA9IDI7CglvcHRpb25hbCB2ZXJ0aWNlc19xdWFudGl6ZWQgdmVydGljZXMgPSAzOwoJcmVwZWF0ZWQgdXZfcXVhbnRpemVkIHV2cyA9IDQ7CglvcHRpb25hbCBmYWNlc19zaW1wbGUgZmFjZXMgPSA1Owp9Cg==", "base64");
  12368. this.builder = a.loadProto(t),
  12369. this.decoder = this.builder.build("binary_mesh")
  12370. }
  12371. var o = e("three")
  12372. , a = e("protobufjs")
  12373. , s = e("../util/logger")
  12374. , l = (e("../util/common"),
  12375. e("../util/ajax"))
  12376. , c = e("../objects/Chunk")
  12377. , h = new s(n);
  12378. r.prototype = {
  12379. constructor: r,
  12380. load: function(e, t, i, n) {
  12381. return h.time("download"),
  12382. l.get(e, {
  12383. responseType: "arraybuffer"
  12384. }).done(function(r) {
  12385. h.timeEnd("download"),
  12386. this.parse(r, e, t, i, n)
  12387. }
  12388. .bind(this)).fail(n)
  12389. },
  12390. parse: function(e, t, i, n, r) {
  12391. var o = this.readProtobuf(e);
  12392. if (!o)
  12393. return r();
  12394. try {
  12395. h.time("convert to webgl"),
  12396. this.convertProtobufToSceneObject(o, t, i, n, r),
  12397. h.timeEnd("convert to webgl")
  12398. } catch (e) {
  12399. return h.error("failed parsing .dam"),
  12400. h.error(e.message),
  12401. r()
  12402. }
  12403. },
  12404. readProtobuf: function(e) {
  12405. var t;
  12406. try {
  12407. h.time("parse proto"),
  12408. t = this.decoder.decode(e),
  12409. h.timeEnd("parse proto")
  12410. } catch (e) {
  12411. return h.error("failed parsing proto for .dam"),
  12412. h.error(e.message),
  12413. null
  12414. }
  12415. return t
  12416. },
  12417. convertProtobufToSceneObject: function(e, t, i, n, r) {
  12418. function a(e) {
  12419. var i = new o.BufferGeometry;
  12420. return i.addAttribute("position", new o.BufferAttribute(new Float32Array(e.vertices.xyz,0,3),3)),
  12421. e.vertices.uv.length > 0 && i.addAttribute("uv", new o.BufferAttribute(new Float32Array(e.vertices.uv,0,2),2)),
  12422. i.setIndex(new o.BufferAttribute(new Uint32Array(e.faces.faces,0,1),1)),
  12423. i.applyMatrix(s),
  12424. i.computeBoundingBox(),
  12425. new c({
  12426. geometry: i,
  12427. textureName: e.material_name,
  12428. name: e.chunk_name,
  12429. meshUrl: t
  12430. })
  12431. }
  12432. if (0 === e.chunk.length)
  12433. return h.warn("No chunks in damfile..."),
  12434. i([]);
  12435. var s = new o.Matrix4;
  12436. s.set(1, 0, 0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1);
  12437. var l = e.chunk.map(a);
  12438. return l ? i(l) : (h.error(".dam protobuf came out with no chunks..."),
  12439. r())
  12440. }
  12441. },
  12442. t.exports = r
  12443. }
  12444. ).call(this, e("buffer").Buffer, "/js/loaders/DamLoader.js")
  12445. }
  12446. , {
  12447. "../objects/Chunk": 144,
  12448. "../util/ajax": 181,
  12449. "../util/common": 185,
  12450. "../util/logger": 189,
  12451. buffer: 198,
  12452. protobufjs: 214,
  12453. three: 217
  12454. }],
  12455. 105: [function(e, t, i) {
  12456. (function(i) {
  12457. "use strict";
  12458. var n = (e("three"),
  12459. e("../settings"),
  12460. e("../util/browser"),
  12461. e("./DamLoader"))
  12462. , r = e("../util/logger")
  12463. , o = (e("../ab"),
  12464. new r(i));
  12465. t.exports = {
  12466. getLoaders: function() {
  12467. return [["_50k", ".dam", n], ["", ".dam", n]]
  12468. },
  12469. load: function(e, t, i, n, r, a) {
  12470. var s = this.getLoaders();
  12471. a = a || 0;
  12472. var l = s[a];
  12473. if (!l)
  12474. return void (r && r("No suitable model file found..."));
  12475. var c = l[0]
  12476. , h = l[1]
  12477. , u = new l[2](t)
  12478. , d = t.get(e + c + h);
  12479. d ? (o.debug("Trying " + c + h),
  12480. u.load(d, i, n, function() {
  12481. this.load(e, t, i, n, r, ++a)
  12482. }
  12483. .bind(this))) : (o.debug("Skipping " + h + ", not available"),
  12484. this.load(e, t, i, n, r, ++a))
  12485. }
  12486. }
  12487. }
  12488. ).call(this, "/js/loaders/ModelLoader.js")
  12489. }
  12490. , {
  12491. "../ab": 3,
  12492. "../settings": 166,
  12493. "../util/browser": 182,
  12494. "../util/logger": 189,
  12495. "./DamLoader": 104,
  12496. three: 217
  12497. }],
  12498. 106: [function(e, t, i) {
  12499. (function(i) {
  12500. "use strict";
  12501. var n = e("../util/common")
  12502. , r = e("../util/texture")
  12503. , o = e("../util/browser")
  12504. , a = e("../util/logger")
  12505. , s = e("../settings")
  12506. , l = new a(i);
  12507. t.exports = {
  12508. load: function(e, t) {
  12509. function i(e, i) {
  12510. e || (t.push(i),
  12511. p++,
  12512. d.notify(p, a),
  12513. p === a && d.resolve())
  12514. }
  12515. if (!e.chunks[0] || !e.chunks[0].meshUrl)
  12516. return $.when();
  12517. var a = n.countUnique(e.chunks.map(function(e) {
  12518. return e.textureName
  12519. }))
  12520. , c = e.chunks[0].meshUrl.indexOf("_50k") !== -1 ? "_50k" : ""
  12521. , h = "_50k" === c ? "high" : "low";
  12522. s.minimalMemoryMode && "high" === h && (o.detectSamsungS6() ? (l.warn("Galaxy S6 cannot handle large textures, turning down quality."),
  12523. h = "low") : a > s.maxMobileTextures && (l.warn("Model probably too large for mobile, turning down quality."),
  12524. h = "low"));
  12525. var u = e.data.job.uuid + c + "_texture_jpg_" + h + "/"
  12526. , d = $.Deferred()
  12527. , p = 0;
  12528. return e.chunks.forEach(function(t) {
  12529. if (!t.material.map && t.textureName) {
  12530. var n = e.urls.get(u + t.textureName);
  12531. t.setTextureMap(r.load(n, i.bind(this, r.isLoaded(n))))
  12532. }
  12533. }),
  12534. d.promise()
  12535. }
  12536. }
  12537. }
  12538. ).call(this, "/js/loaders/ModelTextureLoader.js")
  12539. }
  12540. , {
  12541. "../settings": 166,
  12542. "../util/browser": 182,
  12543. "../util/common": 185,
  12544. "../util/logger": 189,
  12545. "../util/texture": 194
  12546. }],
  12547. 107: [function(e, t, i) {
  12548. (function(i, n) {
  12549. "use strict";
  12550. function r(e) {
  12551. this.model = e,
  12552. this.modelDataPath = this.model.urls.get("vision.modeldata"),
  12553. this.sweepLocationsPath = this.model.urls.get("sweep_locations.csv");
  12554. var t = i("Ly8gUHJvdG9jb2wgQnVmZmVyIGZvciBwdWNrIHZpc2liaWxpdHkgYW5kIHJlbGF0ZWQgZGF0YQovLwovLyBUbyBkdW1wIG91dCBhIGJpbnJheSBtYW5pZmVzdCBpbiB0ZXh0IGZvcm1hdCwgeW91IGNhbiB1c2UgcHJvdG9jIGRpcmVjdGx5OgovLyAgIHByb3RvYyAtLXByb3RvX3BhdGggfi9kZXYvbXBfdmlzaW9uLyAgLS1kZWNvZGU9ZW9zLnN0b3JhZ2UuVmlzaW9uTW9kZWxkYXRhIH4vZGV2L21wX3Zpc2lvbi9lb3Mvc3RvcmFnZS92aXNpb25fbW9kZWxkYXRhLnByb3RvIDwgdmlzaW9uLm1vZGVsZGF0YQoKLy8gcGFja2FnZSBlb3Muc3RvcmFnZTsKCi8vIGltcG9ydCAiZW9zL2luZnJhL2NvbW1vbi5wcm90byI7Ci8vIFRoZSBmb2xsb3dpbmcgd2VyZSBtYW51YWxseSBleHRyYWN0ZWQgaGVyZSwgSlMgZG9lcyBub3QgbGlrZSBwcm90b2J1ZiBpbXBvcnRzCgptZXNzYWdlIEFmZmluZTNmIHsKCW9wdGlvbmFsIFF1YXRlcm5pb25mIHJvdGF0aW9uID0gMTsKCW9wdGlvbmFsIFZlY3RvcjNmIHRyYW5zbGF0aW9uID0gMjsKfQoKbWVzc2FnZSBRdWF0ZXJuaW9uZiB7CglvcHRpb25hbCBmbG9hdCB3ID0gMTsKCW9wdGlvbmFsIGZsb2F0IHggPSAyOwoJb3B0aW9uYWwgZmxvYXQgeSA9IDM7CglvcHRpb25hbCBmbG9hdCB6ID0gNDsKfQoKbWVzc2FnZSBWZWN0b3IzZiB7CglvcHRpb25hbCBmbG9hdCB4ID0gMTsKCW9wdGlvbmFsIGZsb2F0IHkgPSAyOwoJb3B0aW9uYWwgZmxvYXQgeiA9IDM7Cn0KCi8vCi8vIE9uZSBzd2VlcCAvIHBhbm8KLy8KbWVzc2FnZSBTd2VlcExvY2F0aW9uIHsKCW9wdGlvbmFsIGJ5dGVzIHV1aWQgPSAxOyAgLyogdXVpZCAqLwoJb3B0aW9uYWwgQWZmaW5lM2YgcG9zZSA9IDI7ICAvKiBjYW1lcmEgcG9zZSAoeCwgeSx6KSBpbiBtZXRlciBhbmQgYSBxdWF0ZXJuaW9uKi8KCW9wdGlvbmFsIFZlY3RvcjNmIHB1Y2sgPSAzOyAgLyogcHVjayBsb2NhdGlvbiAtIHggYW55IGlzIGdlbmVyYWxseSB0aGUgc2FtZSBhcyBwb3NlLCB6IGlzIHRoZSBoZWlnaHQgb2YgdGhlIGNsb3Nlc3QgZmxvb3IgdW5kZXIgdGhlIGNhbWVyYSAqLwoJb3B0aW9uYWwgaW50MzIgZ3JvdXAgPSA0OyAgLyogZmxvb3IgaW5kZXggKi8KCW9wdGlvbmFsIGludDMyIHN1Ymdyb3VwID0gNTsgIC8qIHJvb20gaW5kZXggKi8KCXJlcGVhdGVkIGludDMyIHZpc2libGVzID0gNjsgIC8qIGxpc3Qgb2YgaW5kaWNlcyB0byBhbGwgcHVja3MgdmlzaWJsZSBmcm9tIHRoaXMgcHVjayAqLwoJcmVwZWF0ZWQgZmxvYXQgc2NvcmVzID0gNzsgLyogdXNlZCBhcyBwYXJ0IG9mIHNjb3JpbmcgZnVuY3Rpb24gZm9yIGRldGVybWluaW5nIHdoaWNoIHB1Y2sgdG8gZ28gdG8gbmV4dCAqLwogIG9wdGlvbmFsIHN0cmluZyBzd2VlcF9uYW1lID0gODsKCiAgLy8gV2l0aCBvdXRkb29yIHBhbm9zLCB3ZSBoYXZlIGEgY291cGxlIG9mIGRpZmZlcmVudCBzaXR1YXRpb25zIGZvciBhbGlnbm1lbnQuIFRoZSBjb21tb24KICAvLyBjYXNlIGlzIHRoYXQgdGhlIHBhbm8gYWxpZ25lZCBub3JtYWxseS4gSXQgY291bGQgYWxzbyBoYXZlIGJlZW4gcGxhY2VkIG1hbnVhbGx5IGluCiAgLy8gQ2FwdHVyZUFwcCBvciBXb3Jrc2hvcCwgb3IgbGVmdCB1bmFsaWduZWQgZm9yIGhpZ2hsaWdodC1yZWVsIHZpZXdpbmcuCiAgZW51bSBBbGlnbm1lbnRUeXBlCiAgewogICAgICBVTktOT1dOID0gMDsKICAgICAgQUxJR05FRCA9IDE7CiAgICAgIFVOQUxJR05FRCA9IDI7CiAgICAgIE1BTlVBTExZX1BMQUNFRCA9IDM7CiAgfQogIG9wdGlvbmFsIEFsaWdubWVudFR5cGUgYWxpZ25tZW50X3R5cGUgPSA5IFtkZWZhdWx0ID0gQUxJR05FRF07Cn0KCm1lc3NhZ2UgU3ViZ3JvdXBJbmZvIHsKCW9wdGlvbmFsIGludDMyIHN1Ymdyb3VwID0gMTsKCW9wdGlvbmFsIGZsb2F0IGFyZWEgPSAyOyAvKiBmbG9vciBhcmVhIGluIG1eMiAoc3F1YXJlIG1ldGVyYWdlKSAqLwp9CgovKiBBbGwgcHVja3MgaW4gYSBtb2RlbC4gUHVja3MgYXJlIHN0b3JlZCBpbiBzY2FubmluZyBvcmRlci4gKi8KbWVzc2FnZSBWaXNpb25Nb2RlbGRhdGEgewoJcmVwZWF0ZWQgU3dlZXBMb2NhdGlvbiBzd2VlcExvY2F0aW9ucyA9IDE7CglyZXBlYXRlZCBTdWJncm91cEluZm8gc3ViZ3JvdXBJbmZvcyA9IDI7Cn0K", "base64")
  12555. , n = o.loadProto(t);
  12556. this.decoder = n.build("VisionModeldata")
  12557. }
  12558. var o = e("protobufjs")
  12559. , a = e("../util/ajax")
  12560. , s = (e("../util/common"),
  12561. e("../util/math"))
  12562. , l = e("../util/logger")
  12563. , c = new l(n);
  12564. r.prototype.load = function() {
  12565. return this.modelDataPath ? (c.info("Using vision.modeldata"),
  12566. this.loadVisionModelData()) : this.sweepLocationsPath ? (c.warn("Using sweep_locations.csv"),
  12567. this.loadSweepLocationsCSV()) : (c.warn("No sweep file found"),
  12568. $.when([]))
  12569. }
  12570. ,
  12571. r.prototype.loadVisionModelData = function() {
  12572. return a.get(this.modelDataPath, {
  12573. responseType: "arraybuffer"
  12574. }).then(function(e) {
  12575. var t;
  12576. try {
  12577. t = this.decoder.decode(e)
  12578. } catch (e) {
  12579. return c.warn("Could not decode vision.modeldata, trying sweep_locations.csv"),
  12580. this.loadSweepLocationsCSV()
  12581. }
  12582. var i = t.sweepLocations.map(function(e) {
  12583. return {
  12584. uuid: e.uuid.toUTF8().replace(/-/g, ""),
  12585. position: {
  12586. x: e.pose.translation.x,
  12587. y: e.pose.translation.y,
  12588. z: e.pose.translation.z
  12589. },
  12590. quaternion: {
  12591. x: e.pose.rotation.x,
  12592. y: e.pose.rotation.y,
  12593. z: e.pose.rotation.z,
  12594. w: e.pose.rotation.w
  12595. },
  12596. puck: {
  12597. x: e.puck.x,
  12598. y: e.puck.y,
  12599. z: e.puck.z
  12600. },
  12601. floor: e.group,
  12602. neighbours: e.visibles,
  12603. alignmentType: e.alignment_type
  12604. }
  12605. }).map(function(e) {
  12606. return e.position = s.convertVisionVector(e.position),
  12607. e.quaternion = s.convertVisionQuaternion(e.quaternion),
  12608. e.puck = s.convertVisionVector(e.puck),
  12609. e
  12610. });
  12611. return i.forEach(function(e) {
  12612. e.neighbours = e.neighbours.map(function(e) {
  12613. return i[e].uuid
  12614. })
  12615. }),
  12616. i
  12617. }
  12618. .bind(this), function() {
  12619. return c.warn("Could not load vision.modeldata, trying sweep_locations.csv"),
  12620. this.loadSweepLocationsCSV()
  12621. }
  12622. .bind(this))
  12623. }
  12624. ,
  12625. r.prototype.loadSweepLocationsCSV = function() {
  12626. return a.get(this.sweepLocationsPath).then(function(e) {
  12627. var t = e.split("\n").map(function(e) {
  12628. return e.split(", ")
  12629. }).filter(function(e) {
  12630. return e.length > 1
  12631. }).map(function(e) {
  12632. return {
  12633. uuid: e[0],
  12634. position: {
  12635. x: parseFloat(e[1]),
  12636. y: parseFloat(e[2]),
  12637. z: parseFloat(e[3])
  12638. },
  12639. quaternion: {
  12640. x: parseFloat(e[4]),
  12641. y: parseFloat(e[5]),
  12642. z: parseFloat(e[6]),
  12643. w: parseFloat(e[7])
  12644. }
  12645. }
  12646. }).map(function(e) {
  12647. return e.position = s.convertVisionVector(e.position),
  12648. e.quaternion = s.convertVisionQuaternion(e.quaternion),
  12649. e
  12650. });
  12651. return t
  12652. }).fail(function() {
  12653. c.warn("Could not load sweep_locations.csv, no sweeps loaded.")
  12654. })
  12655. }
  12656. ,
  12657. t.exports = r
  12658. }
  12659. ).call(this, e("buffer").Buffer, "/js/loaders/SweepDataLoader.js")
  12660. }
  12661. , {
  12662. "../util/ajax": 181,
  12663. "../util/common": 185,
  12664. "../util/logger": 189,
  12665. "../util/math": 190,
  12666. buffer: 198,
  12667. protobufjs: 214
  12668. }],
  12669. 108: [function(e, t, i) {
  12670. (function(i) {
  12671. "use strict";
  12672. function n() {
  12673. this.locale = null
  12674. }
  12675. var r = e("../settings")
  12676. , o = e("../util/common")
  12677. , a = e("../util/logger")
  12678. , s = e("../enum/Locale")
  12679. , l = new a(i);
  12680. n.prototype.init = function() {
  12681. var t;
  12682. switch (r.languageTag) {
  12683. case null:
  12684. case "en":
  12685. case s.EN_US:
  12686. this.locale = s.EN_US,
  12687. t = e("./strings-en-US");
  12688. break;
  12689. case "es":
  12690. case s.ES_MX:
  12691. this.locale = s.ES_MX,
  12692. t = e("./strings-es-MX");
  12693. break;
  12694. case "fr":
  12695. case s.FR_FR:
  12696. this.locale = s.FR_FR,
  12697. t = e("./strings-fr-FR");
  12698. break;
  12699. case "de":
  12700. case s.DE_DE:
  12701. this.locale = s.DE_DE,
  12702. t = e("./strings-de-DE");
  12703. break;
  12704. case "ru":
  12705. case s.RU_RU:
  12706. this.locale = s.RU_RU,
  12707. t = e("./strings-ru-RU");
  12708. break;
  12709. case "cn":
  12710. case s.CN_CN:
  12711. this.locale = s.CN_CN,
  12712. t = e("./strings-cn-CN");
  12713. break;
  12714. case "jp":
  12715. case s.JP_JP:
  12716. this.locale = s.JP_JP,
  12717. t = e("./strings-jp-JP");
  12718. break;
  12719. default:
  12720. l.info("Unsupported language tag, defaulting to 'en-US'"),
  12721. this.locale = s.EN_US,
  12722. t = e("./strings-en-US")
  12723. }
  12724. l.info("Using locale '" + this.locale + "'"),
  12725. o.extendObject(this, t)
  12726. }
  12727. ,
  12728. n.prototype.localizeGUI = function() {
  12729. var e = document.querySelector("#gui-parent");
  12730. this.localizeTree(e),
  12731. this.localizeLoadingText()
  12732. }
  12733. ,
  12734. n.prototype.localizeLoadingText = function() {
  12735. // var e = document.querySelector("#loader-cont")
  12736. // , t = e.getAttribute("title");
  12737. // e.removeAttribute("title"),
  12738. // e.setAttribute("data-status", t),
  12739. // e.classList.add(this.locale),
  12740. document.querySelector("#help-dialog").classList.add(this.locale),
  12741. document.querySelector("#interaction-modal").classList.add(this.locale),
  12742. document.querySelector("#gui").classList.add(this.locale);
  12743. }
  12744. ,
  12745. n.prototype.localizeTree = function(e) {
  12746. var t, i, n = /{\[{ ?(\w+) ?}\]}/;
  12747. if (e.nodeType === Node.TEXT_NODE)
  12748. t = e.data.match(n),
  12749. t && (i = t[1],
  12750. e.data = this.localizeText(i) || i);
  12751. else if (e.nodeType === Node.ELEMENT_NODE) {
  12752. var r = e.getAttribute("title");
  12753. r && (t = r.match(n),
  12754. t && (i = t[1],
  12755. e.setAttribute("title", this.localizeText(i) || i)))
  12756. }
  12757. for (e = e.firstChild; e; )
  12758. this.localizeTree(e),
  12759. e = e.nextSibling
  12760. }
  12761. ,
  12762. n.prototype.localizeText = function(t) {
  12763. var i = this[t];
  12764. return i || this.locale === s.EN_US || (l.warn("Localization key '" + t + "' not available for locale '" + this.locale + "', defaulting to English."),
  12765. i = e("./strings-en-US")[t]),
  12766. i || l.warn("Localization key '" + t + "' not available for locale 'en-US'"),
  12767. i
  12768. }
  12769. ,
  12770. t.exports = new n
  12771. }
  12772. ).call(this, "/js/localization/localize.js")
  12773. }
  12774. , {
  12775. "../enum/Locale": 31,
  12776. "../settings": 166,
  12777. "../util/common": 185,
  12778. "../util/logger": 189,
  12779. "./strings-cn-CN": 109,
  12780. "./strings-de-DE": 110,
  12781. "./strings-en-US": 111,
  12782. "./strings-es-MX": 112,
  12783. "./strings-fr-FR": 113,
  12784. "./strings-jp-JP": 114,
  12785. "./strings-ru-RU": 115
  12786. }],
  12787. 109: [function(e, t, i) {
  12788. "use strict";
  12789. t.exports = {
  12790. PAGE_TITLE: "",
  12791. LOADING: "正在加载",
  12792. PRESENTED_BY_CAPS: "呈现者:",
  12793. POWERED_BY: "技术支持:",
  12794. POWERED_BY_CAPS: "技术支持:",
  12795. DESKTOP_SHORT_CTA: "点击一次以探索这个 3D 空间。",
  12796. MOBILE_SHORT_CTA: "点击一次以探索这个 3D 空间。",
  12797. PRESENTED_BY: "呈现者:",
  12798. MORE: "更多 ",
  12799. LESS: "更少 ",
  12800. TAG_CONTENT: "tag™ 内容",
  12801. SHOW: "显示",
  12802. HIDE: "隐藏",
  12803. DOLLHOUSE: "场景屋",
  12804. FLOOR_PLAN: "楼层平面图",
  12805. OPEN_HIGHLIGHTS: "打开精彩片段",
  12806. CLOSE_HIGHLIGHTS: "关闭",
  12807. PREVIOUS: "上一个",
  12808. PLAY: "播放",
  12809. PAUSE: "暂停",
  12810. NEXT: "下一个",
  12811. EXPLORE_3D_SPACE: "探索 3D 空间",
  12812. VIEW_DOLLHOUSE: "观看场景屋",
  12813. SOCIAL_SHARING: "分享这个空间",
  12814. VIEW_IN_VR: "以 VR 观看",
  12815. VIEW_FULLSCREEN: "全屏观看",
  12816. EXIT_FULLSCREEN: " 退出全屏",
  12817. ZOOM_IN: "放大",
  12818. ZOOM_OUT: "缩小",
  12819. FLOOR_NAME: "楼层",
  12820. FLOOR_ALL: "ALL",
  12821. FLOOR_Lang: ["Floor",""],
  12822. TERMS: "条款",
  12823. PORT_TERMS: "port 条款",
  12824. TERMS_OF_USE: "使用条款",
  12825. CLOSE_TERMS: "关闭",
  12826. TERMS_TEXT_FILE: "terms-cn-CN.html",
  12827. TERMS_FAIL: "无法获取条款。请确保您有互联网连接以查看使用条款。",
  12828. WEBVR_FOR_DAYDREAM: "用于 Daydream 视图",
  12829. WEBVR_ENTER_WEBVR: "进入 VR",
  12830. WEBVR_DIFFERENT_HEADSET: "有其他耳机吗?",
  12831. WEBVR_LEARN_MORE: "了解更多",
  12832. WEBVR_VIEW_SPACE: "在 VR 中观看空间",
  12833. WEBVR_DAYDREAM_VIEW: "Daydream 视图",
  12834. WEBVR_DAYDREAM_PHONE: "支持 Daydream 的手机",
  12835. WEBVR_FOR_CARDBOARD: "用于 Google Cardboard",
  12836. WEBVR_VIEW_CARDBOARD: "或在 Google Cardboard 上观看",
  12837. VR_VIEW_SPACE: "在虚拟现实中观看空间",
  12838. VR_LEARN_MORE_CAPS: "了解更多",
  12839. VR_PREVIOUS_CAPS: "上一个’,",
  12840. VR_NEXT_CAPS: "下一个",
  12841. VR_GOT_IT_CAPS: "明白了",
  12842. VR_SHOW_SUPPORTED: "点击以使用 VR 观看空间",
  12843. VR_SHOW_UNSUPPORTED: "很遗憾,您的设备不符合在 VR 中观看空间的最低要求。",
  12844. VR_SHOW_IOS_1: "点击以使用 VR 观看空间",
  12845. VR_SHOW_IOS_2: "需要有 port VR 应用程序和兼容的 iPhone 才能观看",
  12846. VR_WHAT_YOU_NEED: "关于...您需要什么",
  12847. VR_NEED_CARDBOARD: "您使用 Google Cardboard 时需要什么",
  12848. VR_NEED_SAMSUNG: "您使用 Samsung Gear VR 时需要什么",
  12849. VR_NEED_DAYDREAM: "需要事先与 DAYDREAM VIEW 配对",
  12850. VR_NEED_DAYDREAM_PHONE: "支持 Daydream 的手机",
  12851. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  12852. VR_GOOGLE_DAYDREAM: "Google Daydream",
  12853. VR_APP: "port VR 应用程序",
  12854. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  12855. VR_COMPATIBLE_IPHONES_1: "iPhones",
  12856. VR_COMPATIBLE_IPHONES_2: "iPhone 5s 和更高版本,运行 iOS 9.1 和更高版本",
  12857. VR_COMPATIBLE_IPHONES_3: "兼容的 iPhone",
  12858. VR_COMPATIBLE_ANDROID: "兼容的 Android 设备",
  12859. VR_COMPATIBLE_ANDROID_LONG: "4.5-5.5 英寸、运行 Android OS 4.4.4 和更高版本的兼容型 Android 设备显示屏",
  12860. VR_ANDROID_DETAIL: "4.5 至 5.5 英寸、运行 Android OS 4.4.4 和更高版本的显示屏",
  12861. VR_ANDROID_DVICES: "Android 设备",
  12862. VR_COMPATIBLE_SAMSUNG: "兼容的 Samsung 设备",
  12863. VR_SAMSUNG_DETAIL: "Galaxy S6 和更高版本",
  12864. VR_APP_FOR_CARDBOARD: "用于 Google Cardboard 的 port VR 应用程序",
  12865. VR_APP_FOR_SAMSUNG: "用于 Gear VR 的 port VR 应用程序",
  12866. VR_APP_FOR_ANDROID: "用于 Android 手机的 port VR 应用程序",
  12867. VR_APP_OPEN: "请使用 port VR 应用程序打开",
  12868. VR_DOWNLOAD_HERE: "在此下载",
  12869. VR_REQUIRE_HEADSET: "需要一副 VR 耳机并安装用于 Android 的 port VR 应用程序",
  12870. VR_REDIRECT_TO_STORE: "如果未安装应用程序,您将跳转到应用程序商店。",
  12871. VR_IMPROPER_EMBED: "port 空间未正确嵌入,无法在您的 Web 浏览器支持 VR。",
  12872. VR_OPEN_ANDROID_LINK: "在您的手机上打开链接",
  12873. VR_ANDROID_OPTIONS: "可用的 VR 耳机选项",
  12874. SHARE_TO: "分享到",
  12875. SHARE_LINK: "直接链接",
  12876. SHARE_EXPLORE: "探索",
  12877. SHARE_AT: "在",
  12878. SHARE_WITH: "使用",
  12879. SHARE_3D: "以 3D",
  12880. SHARE_COPIED: "已复制!",
  12881. ERROR_BROWSER_SOLUTION: "安装更新的浏览器以探索 3D。",
  12882. ERROR_BROWSER_EXPLANATION: "WebGL 需要现代的浏览器。",
  12883. ERROR_GENERIC_PROBLEM: "糟糕,出现问题。",
  12884. ERROR_GENERIC_SOLUTION: "重新启动您的浏览器。",
  12885. ERROR_GENERIC_ACTIONS_1: "如果问题仍然存在,",
  12886. ERROR_GENERIC_ACTIONS_2: "请安装支持的浏览器",
  12887. ERROR_GENERIC_ACTIONS_3: " 或",
  12888. ERROR_GENERIC_ACTIONS_4: "查看我们的故障排除指南",
  12889. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "浏览器不受支持。",
  12890. ERROR_WEBGL_IOS_PROBLEM: "iOS 版本不受支持。",
  12891. ERROR_WEBGL_IOS_SOLUTION: "升级到 iOS 8 或更高版本以在 3D 中探索。",
  12892. ERROR_WEBGL_IOS_ACTIONS_1: "点击 ",
  12893. ERROR_WEBGL_IOS_ACTIONS_2: "设置 > 通用 > 软件更新",
  12894. ERROR_WEBGL_SAFARI_PROBLEM: "启用 WebGL 以在 3D 中探索。",
  12895. ERROR_WEBGL_SAFARI_ACTIONS_1: "单击",
  12896. ERROR_WEBGL_SAFARI_ACTIONS_2: "菜单栏中的首选项 > 高级 > 显示开发菜单",
  12897. ERROR_WEBGL_SAFARI_ACTIONS_3: "然后单击",
  12898. ERROR_WEBGL_SAFARI_ACTIONS_4: "开发 > 启用 WebGL",
  12899. ERROR_MISSING_URLS_PROBLEM: "糟糕,没有此模型的全景。",
  12900. ERROR_MISSING_URLS_EXPLANATION: "这是较早的模型。网站所有者可能正在开发一种新模型。",
  12901. ERROR_LOADING_FAILED_PROBLEM: "糟糕,模式不可用。",
  12902. ERROR_LOADING_FAILED_ACTIONS_1: "如果问题仍然存在,",
  12903. ERROR_LOADING_FAILED_ACTIONS_2: "查看我们的故障排除指南",
  12904. ERROR_MAINTENANCE_PROBLEM: "正在进行维护",
  12905. ERROR_MAINTENANCE_SOLUTION: "请过几分钟再来。",
  12906. LINK_TO_LOCATION: "地点链接",
  12907. MENU_COPY: "复制",
  12908. LINK_ALERT_COPY: "请使用 CTRL/CMD + C 复制。",
  12909. ROTATE: "旋转",
  12910. MOVE: "移动",
  12911. INSIDE: "内部",
  12912. ZOOM: "缩放",
  12913. HELP: "小帮手",
  12914. HELP_NAVIGATION_TAB: "导航",
  12915. HELP_MORE_HELP_TAB: "更多帮助",
  12916. HELP_DESKTOP_PANORAMA_1A: "单击并拖动以环顾空间。",
  12917. HELP_DESKTOP_PANORAMA_2A: "单击整个空间内的圆环以四处移动。",
  12918. HELP_DESKTOP_PANORAMA_3A: "使用鼠标滚轮来放大和缩小。",
  12919. HELP_DESKTOP_PANORAMA_1B: "或者,使用箭头键向左向右转。",
  12920. HELP_DESKTOP_PANORAMA_2B: "或者,使用箭头键向前移动和向后移动。",
  12921. HELP_DESKTOP_PANORAMA_3B: "或者,使用加号和减号键来放大和缩小。",
  12922. HELP_DESKTOP_360_2A: "单击内部视图图标以进入空间。",
  12923. HELP_DESKTOP_360_2B: "或者,按 1 号键进入内部视图。 ",
  12924. HELP_DESKTOP_DOLLHOUSE_1A: "左键单击并向左、向右、向上和向下拖动以旋转场景屋。",
  12925. HELP_DESKTOP_DOLLHOUSE_2A: "右键单击并向左、向右、向上和向下拖动以改变场景屋在屏幕上的位置。",
  12926. HELP_DESKTOP_DOLLHOUSE_3A: "使用鼠标滚轮来放大和缩小。",
  12927. HELP_DESKTOP_DOLLHOUSE_1B: "或者,使用箭头键来旋转场景屋。",
  12928. HELP_DESKTOP_FLOORPLAN_1A: "左键单击并向左、向右、向上和向下拖动以改变楼层平面图在屏幕上的位置。",
  12929. HELP_DESKTOP_FLOORPLAN_2A: "右键单击并向左或向右拖动以旋转楼层平面图。",
  12930. HELP_DESKTOP_FLOORPLAN_3A: "使用鼠标滚轮来放大和缩小。",
  12931. HELP_DESKTOP_FLOORPLAN_2B: "或者,使用箭头键以向左或向右旋转。",
  12932. HELP_DESKTOP_FLOORPLAN_3B: "或者,使用箭头键来放大和缩小。",
  12933. HELP_MOBILE_PANORAMA_1: "触摸并拖动以环顾空间。",
  12934. HELP_MOBILE_PANORAMA_2: "点击整个空间内的圆环以四处移动。",
  12935. HELP_MOBILE_3: "使用捏合手势来放大和缩小。",
  12936. HELP_MOBILE_360_2: "点击内部视图图标以进入空间。",
  12937. HELP_MOBILE_DOLLHOUSE_1: "触摸并向上、向下、向左和向右拖动以旋转场景屋。",
  12938. HELP_MOBILE_DOLLHOUSE_2: "用两指触摸并拖动以定位场景屋。",
  12939. HELP_MOBILE_FLOORPLAN_1: "触摸并拖动以定位楼层平面图。",
  12940. HELP_MOBILE_FLOORPLAN_2: "用两指触摸并拖动以旋转楼层平面图。",
  12941. HELP_MORE_HLR_A: "精彩片段集锦",
  12942. HELP_DESKTOP_MORE_HLR_B: "打开以使用缩略图图像在空间中流览。",
  12943. HELP_MORE_DOLLHOUSE_A: "场景屋",
  12944. HELP_DESKTOP_MORE_DOLLHOUSE_B: "单击以查看和旋转 3D 内整个空间的俯视图。",
  12945. HELP_MOBILE_MORE_DOLLHOUSE_B: "点击以查看和旋转 3D 内整个空间的俯视图。",
  12946. HELP_MORE_FLOORS_A: "楼层选择器",
  12947. HELP_DESKTOP_MORE_FLOORS_B: "在空间中的楼层之间切换。",
  12948. HELP_MORE_TAG_A: "tag™ 贴文",
  12949. HELP_DESKTOP_MORE_TAG_B: "单击或悬停鼠标以查看空间中的功能信息。",
  12950. HELP_MOBILE_MORE_TAG_B: "点击以查看空间中的功能信息。",
  12951. HELP_MORE_ZOOM_A: "缩放控件",
  12952. HELP_DESKTOP_MORE_ZOOM_B: "使用这些控件来放大和缩小或使用滚轮。",
  12953. HELP_MORE_TOUR_A: "导览控件",
  12954. HELP_DESKTOP_MORE_TOUR_B: "通过导览播放、暂停以及向前和向后流览。",
  12955. HELP_MORE_INSIDE_A: "内部视图",
  12956. HELP_DESKTOP_MORE_INSIDE_B: "单击以探索空间内部。",
  12957. HELP_MOBILE_MORE_INSIDE_B: "点击以探索空间内部。",
  12958. HELP_MORE_VR_A: "VR 模式",
  12959. HELP_DESKTOP_MORE_VR_B: "单击以在虚拟现实中启动空间。",
  12960. HELP_MOBILE_MORE_VR_B: "点击以在虚拟现实中启动空间。",
  12961. HELP_MORE_360_A: "360° 视图",
  12962. HELP_DESKTOP_MORE_360_B: "单击精彩片段集锦中的 360 视图中以观看室外场景。",
  12963. HELP_MOBILE_MORE_360_B: "点击精彩片段集锦中的 360 视图中以观看室外场景。",
  12964. HELP_MORE_FULLSCREEN_A: "全屏",
  12965. HELP_DESKTOP_MORE_FULLSCREEN_B: "将 3D Showcase 扩展到全屏。",
  12966. CLOSE: "关闭"
  12967. }
  12968. }
  12969. , {}],
  12970. 110: [function(e, t, i) {
  12971. "use strict";
  12972. t.exports = {
  12973. PAGE_TITLE: "",
  12974. LOADING: "Lädt",
  12975. PRESENTED_BY_CAPS: "PRÄSENTIERT VON",
  12976. POWERED_BY: "Angetrieben von",
  12977. POWERED_BY_CAPS: "ANGETRIEBEN VON",
  12978. DESKTOP_SHORT_CTA: "Sehen sie sich in diesem 3D Raum um.",
  12979. MOBILE_SHORT_CTA: "Sehen sie sich in diesem 3D Raum um.",
  12980. PRESENTED_BY: "Präsentiert von ",
  12981. MORE: "Mehr ",
  12982. LESS: "Weniger ",
  12983. TAG_CONTENT: "tag™ Inhalt",
  12984. SHOW: "Anzeigen",
  12985. HIDE: "Verbergen",
  12986. DOLLHOUSE: "Puppenhaus",
  12987. FLOOR_PLAN: "Grundriss",
  12988. OPEN_HIGHLIGHTS: "Highlights anzeigen",
  12989. CLOSE_HIGHLIGHTS: "Schließen",
  12990. PREVIOUS: "Vorheriges",
  12991. PLAY: "Abspielen",
  12992. PAUSE: "Pausieren",
  12993. NEXT: "Nächstes",
  12994. EXPLORE_3D_SPACE: "Innenraum betreten",
  12995. VIEW_DOLLHOUSE: "Puppenhaus ansehen",
  12996. SOCIAL_SHARING: "Teilen Sie diesen Raum",
  12997. VIEW_IN_VR: "In VR ansehen",
  12998. VIEW_FULLSCREEN: "Ansicht im Vollbildmodus",
  12999. EXIT_FULLSCREEN: "Beenden des Vollbildmodus",
  13000. ZOOM_IN: "Vergrößern",
  13001. ZOOM_OUT: "Verkleinern",
  13002. FLOOR_NAME: "Etage ",
  13003. FLOOR_ALL: "Alle",
  13004. TERMS: "Bedingungen",
  13005. PORT_TERMS: "port Bedingungen",
  13006. TERMS_OF_USE: "Nutzungsbedingungen",
  13007. TERMS_TEXT_FILE: "terms-de-DE.html",
  13008. CLOSE_TERMS: "Schließen",
  13009. TERMS_FAIL: "Konnte die Nutzungsbedingungen nicht abrufen. Bitte stellen Sie sicher, dass Sie zum Internet verbunden sind.",
  13010. HELP: "Hilfe",
  13011. HELP_NAVIGATION_TAB: "Navigation",
  13012. HELP_MORE_HELP_TAB: "Hilfe-Details",
  13013. CLOSE: "Schließen",
  13014. HELP_DESKTOP_PANORAMA_1A: "Klicken und ziehen Sie um sich im Raum umzusehen.",
  13015. HELP_DESKTOP_PANORAMA_2A: "Klicken Sie auf die Ringe im Raum um sich zu bewegen.",
  13016. HELP_DESKTOP_PANORAMA_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  13017. HELP_DESKTOP_PANORAMA_1B: "Oder verwenden Sie die Pfeiltasten um sich nach links und rechts zu bewegen.",
  13018. HELP_DESKTOP_PANORAMA_2B: "Oder verwenden Sie die Pfeiltasten um sich vorwärts und rückwärts zubewegen.",
  13019. HELP_DESKTOP_PANORAMA_3B: "Oder verwenden Sie die Plus- und Minus-Tasten zum Vergrößern und Verkleinern.",
  13020. HELP_DESKTOP_360_2A: "Klicken Sie die Innenansicht ikone, um diesen Raum zu starten .",
  13021. HELP_DESKTOP_360_2B: "Oder, drücken Sie die 1-Taste um die Innenraumansicht zu starten.",
  13022. HELP_DESKTOP_DOLLHOUSE_1A: "Klicken Sie mit der linken Maustaste und ziehen Sie nach links, rechts, oben und unten um das Puppenhaus zu drehen.",
  13023. 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.",
  13024. HELP_DESKTOP_DOLLHOUSE_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  13025. HELP_DESKTOP_DOLLHOUSE_1B: "Oder verwenden Sie die Pfeiltasten um das Puppenhaus zu drehen.",
  13026. 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.",
  13027. HELP_DESKTOP_FLOORPLAN_2A: "Klicken Sie mit der rechten Maustaste und ziehen Sie nach links oder rechts um den Grundriss zu drehen.",
  13028. HELP_DESKTOP_FLOORPLAN_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  13029. HELP_DESKTOP_FLOORPLAN_2B: "Oder verwenden Sie die Pfeiltasten um das Modell nach links oder rechts zu drehen.",
  13030. HELP_DESKTOP_FLOORPLAN_3B: "Oder verwenden Sie die Pfeiltasten zum Vergrößern und Verkleinern.",
  13031. HELP_MOBILE_PANORAMA_1: "Berühren und ziehen an dem Raum um sich umzusehen.",
  13032. HELP_MOBILE_PANORAMA_2: "Klicken Sie auf die Ringe im Raum, um sich zu bewegen.",
  13033. HELP_MOBILE_3: "Benutzen Sie die Zoom-Gäste zum Vergrößern und Verkleinern.",
  13034. HELP_MOBILE_360_2: "Tippen Sie die Innenansicht ikone, um diesen Raum zu starten.",
  13035. HELP_MOBILE_DOLLHOUSE_1: "Berühren und nach oben, unten, links und rechts ziehen um das Puppenhaus zu drehen.",
  13036. HELP_MOBILE_DOLLHOUSE_2: "Berühren und mit zwei Fingern ziehen um das Puppenhaus zu positionieren.",
  13037. HELP_MOBILE_FLOORPLAN_1: "Berühren und ziehen, um den Grundriss zu positionieren.",
  13038. HELP_MOBILE_FLOORPLAN_2: "Berühren und ziehen mit zwei Fingern, um den Grundriss zu drehen.",
  13039. HELP_MORE_HLR_A: "Liste das Highlight",
  13040. HELP_DESKTOP_MORE_HLR_B: "Öffnen um durch den Raum mit Vorschau-Bildern zu navigieren.",
  13041. HELP_MORE_DOLLHOUSE_A: "Puppenhaus Ansicht",
  13042. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Klicken Sie um die von oben nach unten Sicht des gesamten Raumes in 3D anzuzeigen und zu drehen.",
  13043. HELP_MOBILE_MORE_DOLLHOUSE_B: "Tippen Sie um die von oben nach unten Sicht des gesamten Raumes in 3D anzuzeigen und zu drehen.",
  13044. HELP_MORE_FLOORS_A: "Etage auswählen",
  13045. HELP_DESKTOP_MORE_FLOORS_B: "Zwischen den Etagen im Raum wechseln.",
  13046. HELP_MORE_TAG_A: "tag™ Posts",
  13047. HELP_DESKTOP_MORE_TAG_B: "Klicken Sie auf oder bewegen Sie Ihren Mauszeiger über die Informationen über die Funktionen im Raum.",
  13048. HELP_MOBILE_MORE_TAG_B: "Tippen Sie für Informationen über die Funktionen im Raum.",
  13049. HELP_MORE_ZOOM_A: "Zoom Steuerung",
  13050. HELP_DESKTOP_MORE_ZOOM_B: "Verwenden Sie diese Steuerung oder das Scrollrad zum Vergrößern und Verkleinern.",
  13051. HELP_MORE_TOUR_A: "Tour Steuerung",
  13052. HELP_DESKTOP_MORE_TOUR_B: "Abspielen, pausieren und vorwärts und rückwärts durch eine geführte Tour navigieren.",
  13053. HELP_MORE_INSIDE_A: "Innenansicht",
  13054. HELP_DESKTOP_MORE_INSIDE_B: "Klicken Sie hier um sich im Raum umzusehen.",
  13055. HELP_MOBILE_MORE_INSIDE_B: "Sehen Sie sich in diesen 3D Raum um.",
  13056. HELP_MORE_VR_A: "VR Modus",
  13057. HELP_DESKTOP_MORE_VR_B: "Klicken Sie hier, um den Raum in der virtuellen Realität zu starten.",
  13058. HELP_MOBILE_MORE_VR_B: "Tippen Sie um den Raum in der virtuellen Realität zu starten.",
  13059. HELP_MORE_360_A: "360° Views Ansicht ",
  13060. HELP_DESKTOP_MORE_360_B: "Klicken Sie die 360° Views Ansicht in das Highlight um Aussen-Szenen zu sehen.",
  13061. HELP_MOBILE_MORE_360_B: "Tippen Sie die 360° Views Ansicht in das Highlight um Aussen-Szenen zu sehen.",
  13062. HELP_MORE_FULLSCREEN_A: "Vollbild",
  13063. HELP_DESKTOP_MORE_FULLSCREEN_B: "Erweitern Sie 3D Showcase im Vollbildmodus.",
  13064. WEBVR_FOR_CARDBOARD: "Für Google Cardboard",
  13065. WEBVR_FOR_DAYDREAM: "Für Daydream View",
  13066. WEBVR_ENTER_WEBVR: "Starten Sie VR",
  13067. WEBVR_DIFFERENT_HEADSET: "Haben Sie anderes Headset?",
  13068. WEBVR_LEARN_MORE: "Mehr Infos",
  13069. WEBVR_VIEW_SPACE: "Ansicht des Raumes in VR",
  13070. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13071. WEBVR_DAYDREAM_PHONE: "Daydream-fähiges Handy",
  13072. WEBVR_VIEW_CARDBOARD: "Oder mit Google Cardboard ansehen",
  13073. VR_WHAT_YOU_NEED: "Was Sie dafür brauchen...",
  13074. VR_NEED_DAYDREAM_PHONE: "Daydream-fähiges Handy",
  13075. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13076. VR_APP: "port VR App",
  13077. VR_APP_OPEN: "Oder öffnen Sie die port VR App",
  13078. 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",
  13079. VR_SAMSUNG_DETAIL: "Galaxy S6 und neuer",
  13080. VR_APP_FOR_ANDROID: "port VR app für Android",
  13081. VR_NEED_DAYDREAM: "ERFORDERT VOR DER 'PAIRING' MIT DAYDREAM VIEW",
  13082. VR_VIEW_SPACE: "Ansicht des Raumes in VR",
  13083. VR_LEARN_MORE_CAPS: "MEHR INFOS",
  13084. VR_PREVIOUS_CAPS: "ZURÜCK",
  13085. VR_NEXT_CAPS: "WEITER",
  13086. VR_GOT_IT_CAPS: "VERSTANDEN",
  13087. VR_SHOW_SUPPORTED: "Tippen Sie um den Raum in VR zu sehen",
  13088. VR_SHOW_UNSUPPORTED: "Schade, aber Ihr Gerät erfüllt nicht die Mindestanforderungen um den Raum in VR zu sehen.",
  13089. VR_SHOW_IOS_1: "Tippen Sie um den Raum in VR zu sehen",
  13090. VR_SHOW_IOS_2: "port VR App sowie kompatibles iPhone sind von nöten um diesen Raum zu sehen",
  13091. VR_NEED_CARDBOARD: "Was Sie dafür brauchen ist Google Cardboard",
  13092. VR_NEED_SAMSUNG: "Was Sie dafür brauchen ist Samsung Gear VR",
  13093. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13094. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13095. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13096. VR_COMPATIBLE_IPHONES_2: "iPhone 5s oder neuer, mit iOS 9.1 und später",
  13097. VR_COMPATIBLE_IPHONES_3: "Kompatibles iPhones",
  13098. VR_COMPATIBLE_ANDROID: "Kompatibles Android Gerät",
  13099. VR_ANDROID_DETAIL: "Bildschirmdiagonale von 11,5 bis 14 cm (4,5 - 5,5 Zoll) und Android 4.4.4 und neuer",
  13100. VR_ANDROID_DVICES: "Android Geräte",
  13101. VR_COMPATIBLE_SAMSUNG: "Kompatible Samsung Geräte",
  13102. VR_APP_FOR_CARDBOARD: "port VR App für Google Cardboard",
  13103. VR_APP_FOR_SAMSUNG: "port VR App für Gear VR",
  13104. VR_DOWNLOAD_HERE: "Hier runterladen",
  13105. VR_REQUIRE_HEADSET: "Benötigt das ein VR-Headset und port VR App für Android installiert wird",
  13106. VR_REDIRECT_TO_STORE: "Wenn App nicht installiert ist, werden Sie zum App Store umgeleitet.",
  13107. VR_IMPROPER_EMBED: "Der port Raum ist nicht richtig eingebettet um VR in Ihrem Webbrowser zu unterstützen.",
  13108. VR_OPEN_ANDROID_LINK: "Öffnen Sie den Link auf Ihrem Handy",
  13109. VR_ANDROID_OPTIONS: "VR Headset Optionen",
  13110. SHARE_TO: "Teilen auf",
  13111. SHARE_LINK: "Direkter Link",
  13112. SHARE_EXPLORE: "Umsehen",
  13113. SHARE_AT: "auf",
  13114. SHARE_WITH: "mit",
  13115. SHARE_3D: "in 3D",
  13116. SHARE_COPIED: "Kopiert!",
  13117. ERROR_BROWSER_SOLUTION: "Installieren Sie einen neueren Browser um sich in 3D umzusehen.",
  13118. ERROR_BROWSER_EXPLANATION: "WebGL benötigt einen modernen Browser.",
  13119. ERROR_GENERIC_PROBLEM: "Huch, etwas ist schief gelaufen.",
  13120. ERROR_GENERIC_SOLUTION: "Starten Sie Ihren Browser neu.",
  13121. ERROR_GENERIC_ACTIONS_1: "Wenn das Problem weiterhin besteht, ",
  13122. ERROR_GENERIC_ACTIONS_2: "Installieren Sie einen unterstützten Browser",
  13123. ERROR_GENERIC_ACTIONS_3: " oder ",
  13124. ERROR_GENERIC_ACTIONS_4: "Sehen Sie unseren Leitfaden zur Fehlerbehebung",
  13125. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Browser wird nicht unterstützt.",
  13126. ERROR_WEBGL_IOS_PROBLEM: "iOS-Version wird nicht unterstützt.",
  13127. ERROR_WEBGL_IOS_SOLUTION: "Aktualisieren Sie auf iOS 8 oder neuer um sich in 3D umzusehen.",
  13128. ERROR_WEBGL_IOS_ACTIONS_1: "Tippen ",
  13129. ERROR_WEBGL_IOS_ACTIONS_2: "Einstellungen > Allgemein > Softwareaktualisierung",
  13130. ERROR_WEBGL_SAFARI_PROBLEM: "Aktivieren Sie WebVR um sich in 3D umzusehen.",
  13131. ERROR_WEBGL_SAFARI_ACTIONS_1: "Klicken ",
  13132. ERROR_WEBGL_SAFARI_ACTIONS_2: "Präferenzen > Fortgeschrittene > Entwickler-Menü anzeigen",
  13133. ERROR_WEBGL_SAFARI_ACTIONS_3: "Klicken Sie dann ",
  13134. ERROR_WEBGL_SAFARI_ACTIONS_4: "Entwickler > WebGL Aktivieren",
  13135. ERROR_MISSING_URLS_PROBLEM: "Huch, es gibt keine Panoramen für dieses Modell .",
  13136. ERROR_MISSING_URLS_EXPLANATION: "Dies ist ein älteres Modell. Der Website-Besitzer hat eventuell ein neues Modell in Arbeit.",
  13137. ERROR_LOADING_FAILED_PROBLEM: "Huch, das Modell ist nicht verfügbar.",
  13138. ERROR_LOADING_FAILED_ACTIONS_1: "Wenn das Problem weiterhin besteht, ",
  13139. ERROR_LOADING_FAILED_ACTIONS_2: "sehen Sie unseren Leitfaden zur Fehlerbehebung",
  13140. ERROR_MAINTENANCE_PROBLEM: "Wartung im Gange.",
  13141. ERROR_MAINTENANCE_SOLUTION: "Bitte versuchen Sie es in ein paar Minuten nochmal.",
  13142. LINK_TO_LOCATION: "Link zu",
  13143. MENU_COPY: "Kopieren",
  13144. LINK_ALERT_COPY: "Bitte benutzen Sie CTRL/CMD + C zum kopieren.",
  13145. ROTATE: "Drehen",
  13146. INSIDE: "Drinnen",
  13147. MOVE: "Bewegen",
  13148. ZOOM: "Vergrößern"
  13149. }
  13150. }
  13151. , {}],
  13152. 111: [function(e, t, i) {
  13153. "use strict";
  13154. t.exports = {
  13155. PAGE_TITLE: "",
  13156. LOADING: "Loading",
  13157. PRESENTED_BY_CAPS: "PRESENTED BY",
  13158. POWERED_BY: "powered by ",
  13159. POWERED_BY_CAPS: "POWERED BY",
  13160. DESKTOP_SHORT_CTA: "Click to explore this 3D space.",
  13161. MOBILE_SHORT_CTA: "Tap to explore this 3D space.",
  13162. PRESENTED_BY: "Presented by ",
  13163. MORE: "More ",
  13164. LESS: "Less ",
  13165. TAG_CONTENT: "tag™ Content",
  13166. SHOW: "Show",
  13167. HIDE: "Hide",
  13168. DOLLHOUSE: "Dollhouse",
  13169. FLOOR_PLAN: "Floor plan",
  13170. OPEN_HIGHLIGHTS: "Open Highlights",
  13171. CLOSE_HIGHLIGHTS: "Close",
  13172. PREVIOUS: "Previous",
  13173. PLAY: "Play",
  13174. PAUSE: "Pause",
  13175. NEXT: "Next",
  13176. EXPLORE_3D_SPACE: "Explore 3D Space",
  13177. VIEW_DOLLHOUSE: "View dollhouse",
  13178. SOCIAL_SHARING: "Share this Space",
  13179. VIEW_IN_VR: "View in VR",
  13180. VIEW_FULLSCREEN: "全屏",
  13181. EXIT_FULLSCREEN: "退出全屏",
  13182. ZOOM_IN: "Zoom in",
  13183. ZOOM_OUT: "Zoom out",
  13184. FLOOR_NAME: "Floor ",
  13185. FLOOR_ALL: "全部",
  13186. TERMS: "Terms",
  13187. PORT_TERMS: "port terms",
  13188. TERMS_OF_USE: "Terms of Use",
  13189. TERMS_TEXT_FILE: "terms-en-US.html",
  13190. CLOSE_TERMS: "Close",
  13191. TERMS_FAIL: "Could not fetch terms. Please make sure you have an internet connection to view the terms of use.",
  13192. HELP: "Help",
  13193. HELP_NAVIGATION_TAB: "Navigation",
  13194. HELP_MORE_HELP_TAB: "More Help",
  13195. CLOSE: "Close",
  13196. HELP_DESKTOP_PANORAMA_1A: "Click and Drag to look around the Space.",
  13197. HELP_DESKTOP_PANORAMA_2A: "Click on the rings throughout the space to move around.",
  13198. HELP_DESKTOP_PANORAMA_3A: "Use the scroll wheel to zoom in and out.",
  13199. HELP_DESKTOP_PANORAMA_1B: "Or, use the arrow keys to turn left and right.",
  13200. HELP_DESKTOP_PANORAMA_2B: "Or, use the arrow keys to move forward and back.",
  13201. HELP_DESKTOP_PANORAMA_3B: "Or, use the plus and minus keys to zoom in and out.",
  13202. HELP_DESKTOP_360_2A: "Click the Inside View icon to enter the Space.",
  13203. HELP_DESKTOP_360_2B: "Or, press the number 1 key to enter Inside View.",
  13204. HELP_DESKTOP_DOLLHOUSE_1A: "Left click and drag left, right, up, and down to rotate the Dollhouse.",
  13205. HELP_DESKTOP_DOLLHOUSE_2A: "Right click and drag left, right, up, and down to change the Dollhouse position on screen.",
  13206. HELP_DESKTOP_DOLLHOUSE_3A: "Use the scroll wheel to zoom in and out.",
  13207. HELP_DESKTOP_DOLLHOUSE_1B: "Or, use the arrow keys to rotate the Dollhouse.",
  13208. HELP_DESKTOP_FLOORPLAN_1A: "Left click and drag left, right, up, and down to change the Floorplan position on screen.",
  13209. HELP_DESKTOP_FLOORPLAN_2A: "Right click and drag left or right to rotate the Floorplan.",
  13210. HELP_DESKTOP_FLOORPLAN_3A: "Use the scroll wheel to zoom in and out.",
  13211. HELP_DESKTOP_FLOORPLAN_2B: "Or, use the arrow keys to rotate left or right.",
  13212. HELP_DESKTOP_FLOORPLAN_3B: "Or, use the arrow keys to zoom in and out.",
  13213. HELP_MOBILE_PANORAMA_1: "Touch and Drag to look around the Space.",
  13214. HELP_MOBILE_PANORAMA_2: "Tap on the rings throughout the Space to move around.",
  13215. HELP_MOBILE_3: "Use a pinch gesture to zoom in and out.",
  13216. HELP_MOBILE_360_2: "Tap the Inside View icon to enter the Space.",
  13217. HELP_MOBILE_DOLLHOUSE_1: "Touch and drag up, down, left, and right to rotate the Dollhouse.",
  13218. HELP_MOBILE_DOLLHOUSE_2: "Touch and drag with two fingers to position the Dollhouse.",
  13219. HELP_MOBILE_FLOORPLAN_1: "Touch and drag to position the Floorplan.",
  13220. HELP_MOBILE_FLOORPLAN_2: "Touch and drag with two fingers to rotate the Floorplan.",
  13221. HELP_MORE_HLR_A: "Highlight Reel",
  13222. HELP_DESKTOP_MORE_HLR_B: "Open to navigate through the Space using thumbnail images.",
  13223. HELP_MORE_DOLLHOUSE_A: "Dollhouse View",
  13224. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Click to view and rotate a top-down view of the entire Space in 3D.",
  13225. HELP_MOBILE_MORE_DOLLHOUSE_B: "Tap to view and rotate a top-down view of the entire Space in 3D.",
  13226. HELP_MORE_FLOORS_A: "Floor Selector",
  13227. HELP_DESKTOP_MORE_FLOORS_B: "Switch between floors in the Space.",
  13228. HELP_MORE_TAG_A: "tag™ Posts",
  13229. HELP_DESKTOP_MORE_TAG_B: "Click or hover over for information about features in the Space.",
  13230. HELP_MOBILE_MORE_TAG_B: "Tap for information about features in the Space.",
  13231. HELP_MORE_ZOOM_A: "Zoom Controls",
  13232. HELP_DESKTOP_MORE_ZOOM_B: "Use these controls to zoom in and out or use the scroll wheel.",
  13233. HELP_MORE_TOUR_A: "Tour Controls",
  13234. HELP_DESKTOP_MORE_TOUR_B: "Play, pause, and navigate forward and backward through a Guided Tour.",
  13235. HELP_MORE_INSIDE_A: "Inside View",
  13236. HELP_DESKTOP_MORE_INSIDE_B: "Click to explore inside the Space.",
  13237. HELP_MOBILE_MORE_INSIDE_B: "Tap to explore inside the Space.",
  13238. HELP_MORE_VR_A: "VR Mode",
  13239. HELP_DESKTOP_MORE_VR_B: "Click to launch the Space in virtual reality.",
  13240. HELP_MOBILE_MORE_VR_B: "Tap to launch the Space in virtual reality.",
  13241. HELP_MORE_360_A: "360° Views",
  13242. HELP_DESKTOP_MORE_360_B: "Click 360 Views in the Highlight Reel to view outdoor scenes.",
  13243. HELP_MOBILE_MORE_360_B: "Tap 360 Views in the Highlight Reel to view outdoor scenes.",
  13244. HELP_MORE_FULLSCREEN_A: "Full screen",
  13245. HELP_DESKTOP_MORE_FULLSCREEN_B: "Expand 3D Showcase to full screen.",
  13246. WEBVR_FOR_CARDBOARD: "For Google Cardboard",
  13247. WEBVR_VIEW_CARDBOARD: "Or View on Google Cardboard",
  13248. WEBVR_FOR_DAYDREAM: "For Daydream View",
  13249. WEBVR_ENTER_WEBVR: "ENTER VR",
  13250. WEBVR_DIFFERENT_HEADSET: "Have a different headset?",
  13251. WEBVR_LEARN_MORE: "Learn more",
  13252. WEBVR_VIEW_SPACE: "View Space in VR",
  13253. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13254. WEBVR_DAYDREAM_PHONE: "Daydream-ready phone",
  13255. VR_VIEW_SPACE: "View Space in Virtual Reality",
  13256. VR_LEARN_MORE_CAPS: "LEARN MORE",
  13257. VR_PREVIOUS_CAPS: "PREVIOUS",
  13258. VR_NEXT_CAPS: "NEXT",
  13259. VR_GOT_IT_CAPS: "GOT IT",
  13260. VR_SHOW_SUPPORTED: "Tap to view the Space in VR with",
  13261. VR_SHOW_UNSUPPORTED: "Sorry, but your device doesn't meet the minimum requirements to view a space in VR.",
  13262. VR_SHOW_IOS_1: "Tap to view the space in VR",
  13263. VR_SHOW_IOS_2: "Requires port VR app and compatible iPhone to view",
  13264. VR_WHAT_YOU_NEED: "What You'll Need For...",
  13265. VR_NEED_CARDBOARD: "What you'll need with Google Cardboard",
  13266. VR_NEED_SAMSUNG: "What you'll need with Samsung Gear VR",
  13267. VR_NEED_DAYDREAM: "NEEDS PRIOR PAIRING WITH DAYDREAM VIEW",
  13268. VR_NEED_DAYDREAM_PHONE: "Daydream-ready phone",
  13269. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13270. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13271. VR_APP: "port VR App",
  13272. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13273. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13274. VR_COMPATIBLE_IPHONES_2: "iPhone 5s and newer, running iOS 9.1 and higher",
  13275. VR_COMPATIBLE_IPHONES_3: "Compatible iPhones",
  13276. VR_COMPATIBLE_ANDROID: "Compatible Android Devices",
  13277. VR_COMPATIBLE_ANDROID_LONG: 'Compatible Android Devices Displays from 4.5"-5.5" running Android OS 4.4.4 and higher',
  13278. VR_ANDROID_DETAIL: 'Displays from 4.5"-5.5" running Android OS 4.4.4 and higher',
  13279. VR_ANDROID_DVICES: "Android Devices",
  13280. VR_COMPATIBLE_SAMSUNG: "Compatible Samsung Devices",
  13281. VR_SAMSUNG_DETAIL: "Galaxy S6 and Above",
  13282. VR_APP_FOR_CARDBOARD: "port VR app for Google Cardboard",
  13283. VR_APP_FOR_SAMSUNG: "port VR app for Gear VR",
  13284. VR_APP_FOR_ANDROID: "port VR app for Android Phones",
  13285. VR_APP_OPEN: "Open with the port VR app instead",
  13286. VR_DOWNLOAD_HERE: "Download here",
  13287. VR_REQUIRE_HEADSET: "Requires a VR headset and port VR app for Android to be installed",
  13288. VR_REDIRECT_TO_STORE: "If app is not installed, you will be redirected to the app store.",
  13289. VR_IMPROPER_EMBED: "The port Space is not embedded properly to support VR in your web browser.",
  13290. VR_OPEN_ANDROID_LINK: "Open the Link on Your Mobile Phone",
  13291. VR_ANDROID_OPTIONS: "Available VR Headset Options",
  13292. SHARE_TO: "Share to",
  13293. SHARE_LINK: "Direct Link",
  13294. SHARE_EXPLORE: "Explore ",
  13295. SHARE_AT: "at",
  13296. SHARE_WITH: "with",
  13297. SHARE_3D: " in 3D",
  13298. SHARE_COPIED: "Copied!",
  13299. ERROR_BROWSER_SOLUTION: "Install a new browser to explore in 3D.",
  13300. ERROR_BROWSER_EXPLANATION: "WebGL requires a modern browser.",
  13301. ERROR_GENERIC_PROBLEM: "Oops, something went wrong.",
  13302. ERROR_GENERIC_SOLUTION: "Restart your browser.",
  13303. ERROR_GENERIC_ACTIONS_1: "If the problem persists, ",
  13304. ERROR_GENERIC_ACTIONS_2: "install a supported browser",
  13305. ERROR_GENERIC_ACTIONS_3: " or ",
  13306. ERROR_GENERIC_ACTIONS_4: "see our troubleshooting guide",
  13307. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Browser not supported.",
  13308. ERROR_WEBGL_IOS_PROBLEM: "iOS version not supported.",
  13309. ERROR_WEBGL_IOS_SOLUTION: "Upgrade to iOS 8 or higher to explore in 3D.",
  13310. ERROR_WEBGL_IOS_ACTIONS_1: "Tap ",
  13311. ERROR_WEBGL_IOS_ACTIONS_2: "Settings > General > Software Update",
  13312. ERROR_WEBGL_SAFARI_PROBLEM: "Enable WebGL to explore in 3D.",
  13313. ERROR_WEBGL_SAFARI_ACTIONS_1: "Click ",
  13314. ERROR_WEBGL_SAFARI_ACTIONS_2: "Preferences > Advanced > Show Develop menu",
  13315. ERROR_WEBGL_SAFARI_ACTIONS_3: "Then click ",
  13316. ERROR_WEBGL_SAFARI_ACTIONS_4: "Develop > Enable WebGL",
  13317. ERROR_MISSING_URLS_PROBLEM: "Oops, there are no panoramas for this model.",
  13318. ERROR_MISSING_URLS_EXPLANATION: "This is an older model. The website owner may have a new model on the way.",
  13319. ERROR_LOADING_FAILED_PROBLEM: "模型不可用.",
  13320. ERROR_LOADING_FAILED_ACTIONS_1: "If the problem persists, ",
  13321. ERROR_LOADING_FAILED_ACTIONS_2: "see our troubleshooting guide",
  13322. ERROR_MAINTENANCE_PROBLEM: "Maintenance in progress.",
  13323. ERROR_MAINTENANCE_SOLUTION: "Please come back in a few minutes.",
  13324. LINK_TO_LOCATION: "Link to location",
  13325. MENU_COPY: "Copy",
  13326. LINK_ALERT_COPY: "Please use CTRL/CMD + C to copy.",
  13327. ROTATE: "Rotate",
  13328. INSIDE: "Inside",
  13329. MOVE: "Move",
  13330. ZOOM: "Zoom"
  13331. }
  13332. }
  13333. , {}],
  13334. 112: [function(e, t, i) {
  13335. "use strict";
  13336. t.exports = {
  13337. PAGE_TITLE: "",
  13338. LOADING: "Cargando",
  13339. PRESENTED_BY_CAPS: "PRESENTADO POR",
  13340. POWERED_BY: "potenciando por ",
  13341. POWERED_BY_CAPS: "POTENCIADO POR ",
  13342. DESKTOP_SHORT_CTA: "Haga clic para explorar este Espacio 3D.",
  13343. MOBILE_SHORT_CTA: "Pulse para explorar este Espacio 3D.",
  13344. PRESENTED_BY: "Presentado por ",
  13345. MORE: "Más ",
  13346. LESS: "Menos ",
  13347. TAG_CONTENT: "Contenido de tag™",
  13348. SHOW: "Mostrar",
  13349. HIDE: "Ocultar",
  13350. DOLLHOUSE: "Dollhouse",
  13351. FLOOR_PLAN: "Planos",
  13352. OPEN_HIGHLIGHTS: "Aspectos Destacados",
  13353. CLOSE_HIGHLIGHTS: "Cerrar",
  13354. PREVIOUS: "Anterior",
  13355. PLAY: "Play",
  13356. PAUSE: "Pausa",
  13357. NEXT: "Siguiente",
  13358. EXPLORE_3D_SPACE: "Explorar el Espacio 3D",
  13359. VIEW_DOLLHOUSE: "Ver dollhouse",
  13360. SOCIAL_SHARING: "Compartir este espacio",
  13361. VIEW_IN_VR: "Ver en realidad virtual",
  13362. VIEW_FULLSCREEN: "Ver en pantalla completa",
  13363. EXIT_FULLSCREEN: "Salir de pantalla completa",
  13364. ZOOM_IN: "Acercar",
  13365. ZOOM_OUT: "Alejar",
  13366. FLOOR_NAME: "Piso ",
  13367. FLOOR_ALL: "Todas",
  13368. TERMS: "Condiciones",
  13369. PORT_TERMS: "port términos de uso",
  13370. TERMS_OF_USE: "Términos de uso",
  13371. TERMS_TEXT_FILE: "terms-es-MX.html",
  13372. CLOSE_TERMS: "Cerrar",
  13373. 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.",
  13374. HELP: "Ayuda",
  13375. HELP_NAVIGATION_TAB: "Navegación",
  13376. HELP_MORE_HELP_TAB: "Más Ayuda",
  13377. CLOSE: "Cerrar",
  13378. HELP_DESKTOP_PANORAMA_1A: "Haga clic y arrastre para mirar alrededor del espacio.",
  13379. HELP_DESKTOP_PANORAMA_2A: "Haga clic en los aros a lo largo del espacio para moverse.",
  13380. HELP_DESKTOP_PANORAMA_3A: "Use la rueda de desplazamiento para acercar o alejar.",
  13381. HELP_DESKTOP_PANORAMA_1B: "O use las teclas de flecha para girar a la izquierda y a la derecha.",
  13382. HELP_DESKTOP_PANORAMA_2B: "O use las teclas de dirección para adelantar o retroceder.",
  13383. HELP_DESKTOP_PANORAMA_3B: "O use la tecla más para acercar y la tecla menos para alejar.",
  13384. HELP_DESKTOP_360_2A: "Haga clic en el icono Vista Interior para ingresar al Espacio.",
  13385. HELP_DESKTOP_360_2B: "O bien, presione la tecla numero 1 para entrar en la Vista Interior.",
  13386. HELP_DESKTOP_DOLLHOUSE_1A: "Haga clic izquierdo y arrastre hacia la izquierda, derecha, arriba o abajo para girar la Dollhouse.",
  13387. HELP_DESKTOP_DOLLHOUSE_2A: "Haga clic derecho y arrastre hacia la izquierda, derecha, arriba o abajo para cambiar la posición della dollhouse.",
  13388. HELP_DESKTOP_DOLLHOUSE_3A: "Use la rueda de desplazamiento para acercar o alejar.",
  13389. HELP_DESKTOP_DOLLHOUSE_1B: "O use las teclas de dirección para girar la Dollhouse.",
  13390. 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.",
  13391. HELP_DESKTOP_FLOORPLAN_2A: "Haga clic derecho y arrastre hacia la izquierda o derecha para girar la planta.",
  13392. HELP_DESKTOP_FLOORPLAN_3A: "Use la rueda de desplazamiento para acercar o alejar.",
  13393. HELP_DESKTOP_FLOORPLAN_2B: "O use las teclas para girar hacia la izquierda o derecha.",
  13394. HELP_DESKTOP_FLOORPLAN_3B: "O use las teclas de dirección para acercar o alejar.",
  13395. HELP_MOBILE_PANORAMA_1: "Toque y arrastre para mirar alrededor del espacio.",
  13396. HELP_MOBILE_PANORAMA_2: "Toque en los aros a lo largo del espacio para moverse.",
  13397. HELP_MOBILE_3: "Use el gesto de pellizcar para acercar o alejar.",
  13398. HELP_MOBILE_360_2: "Toque el ícono Vista Interior para entrar en el Espacio.",
  13399. HELP_MOBILE_DOLLHOUSE_1: "Toque y arrastre con dos dedos para cambiar la posición della dollhouse.",
  13400. HELP_MOBILE_DOLLHOUSE_2: "Toque y arrastre con dos dedos para cambiar la posición de la vista aérea.",
  13401. HELP_MOBILE_FLOORPLAN_1: "Toque y arrastre para cambiar la posición de la planta.",
  13402. HELP_MOBILE_FLOORPLAN_2: "Toque y arrastre con dos dedos para girar la planta.",
  13403. HELP_MORE_HLR_A: "Galería destacada",
  13404. HELP_DESKTOP_MORE_HLR_B: "Abra para navegar a través del espacio utilizando imágenes en miniatura.",
  13405. HELP_MORE_DOLLHOUSE_A: "Vista aérea por pisos",
  13406. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Haga clic para ver y girar la Dollhouse del espacio completo en 3D.",
  13407. HELP_MOBILE_MORE_DOLLHOUSE_B: "Toque para ver y girar la vista Dollhouse del espacio completo en 3D.",
  13408. HELP_MORE_FLOORS_A: "Seleccionador de plantas",
  13409. HELP_DESKTOP_MORE_FLOORS_B: "Cambie de una planta a otra en el espacio.",
  13410. HELP_MORE_TAG_A: "tag™ Posts",
  13411. HELP_DESKTOP_MORE_TAG_B: "Haga clic o coloque el cursor para obtener más información acerca de las características del espacio.",
  13412. HELP_MOBILE_MORE_TAG_B: "Toque para obtener más información acerca de las características del espacio.",
  13413. HELP_MORE_ZOOM_A: "Controles de zoom",
  13414. HELP_DESKTOP_MORE_ZOOM_B: "Use estos controles o la rueda de desplazamiento para acercar o alejar.",
  13415. HELP_MORE_TOUR_A: "Controles de recorrido",
  13416. HELP_DESKTOP_MORE_TOUR_B: "Reproduzca, pause, adelante o retroceda a través de un recorrido guiado.",
  13417. HELP_MORE_INSIDE_A: "Vista interior",
  13418. HELP_DESKTOP_MORE_INSIDE_B: "Haga clic para explorar el interior del espacio.",
  13419. HELP_MOBILE_MORE_INSIDE_B: "Toque para explorar el interior del espacio.",
  13420. HELP_MORE_VR_A: "Modo de realidad virtual",
  13421. HELP_DESKTOP_MORE_VR_B: "Toque para ver el espacio en realidad virtual.",
  13422. HELP_MOBILE_MORE_VR_B: "Toque para ver el espacio en realidad virtual.",
  13423. HELP_MORE_360_A: "360° Views",
  13424. HELP_DESKTOP_MORE_360_B: "Una vez que se encuentre en galería destacada, haga clic en vistas de 360º para ver el exterior.",
  13425. HELP_MOBILE_MORE_360_B: "Una vez que se encuentre en galería destacada, toque en vistas de 360º para ver el exterior.",
  13426. HELP_MORE_FULLSCREEN_A: "Pantalla completa",
  13427. HELP_DESKTOP_MORE_FULLSCREEN_B: "Expanda el escenario 3D para verlo en pantalla completa.",
  13428. WEBVR_FOR_CARDBOARD: "Para Google Cardboard",
  13429. WEBVR_FOR_DAYDREAM: "Para Daydream View",
  13430. WEBVR_ENTER_WEBVR: "ENTRAR VR",
  13431. WEBVR_DIFFERENT_HEADSET: "¿Tiene un auricular diferente?",
  13432. WEBVR_LEARN_MORE: "Más información",
  13433. WEBVR_VIEW_SPACE: "Ver Espacio en VR",
  13434. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13435. WEBVR_DAYDREAM_PHONE: "Daydream Teléfono listos",
  13436. WEBVR_VIEW_CARDBOARD: "O Ver en Google Cardboard",
  13437. VR_NEED_DAYDREAM: "Necesidades antes de acoplarse con Daydream View",
  13438. VR_NEED_DAYDREAM_PHONE: "Teléfono listo para Daydream",
  13439. VR_GOOGLE_DAYDREAM: "Daydream de Google",
  13440. VR_APP: "port VR App",
  13441. VR_COMPATIBLE_ANDROID_LONG: 'Compatible con los Dispositivos Android con Pantallas de 4.5"-5.5" operando Android OS 4.4.4 y posteriores',
  13442. VR_APP_FOR_ANDROID: "Aplicación port VR para Teléfonos Android",
  13443. VR_APP_OPEN: "Abrir con la aplicación port VR en su lugar",
  13444. VR_VIEW_SPACE: "Ver Espacio en realidad virtual",
  13445. VR_LEARN_MORE_CAPS: "SABER MÁS",
  13446. VR_PREVIOUS_CAPS: "ANTERIOR",
  13447. VR_NEXT_CAPS: "SIGUIENTE",
  13448. VR_GOT_IT_CAPS: "COMPRENDIDO",
  13449. VR_SHOW_SUPPORTED: "Pulse para ver el Espacio en realidad virtual con",
  13450. VR_SHOW_UNSUPPORTED: "Lo sentimos, pero su dispositivo no cumple los requisitos mínimos para ver un Espacio en realidad virtual.",
  13451. VR_SHOW_IOS_1: "Pulse para ver el Espacio en realidad virtual",
  13452. VR_SHOW_IOS_2: "Necesita la aplicación port VR y un iPhone compatible para ver",
  13453. VR_WHAT_YOU_NEED: "Lo que necesitaras...",
  13454. VR_NEED_CARDBOARD: "Lo que necesitaras con Google Cardboard",
  13455. VR_NEED_SAMSUNG: "Lo que necesitaras con el Samsung Gear VR",
  13456. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13457. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13458. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13459. VR_COMPATIBLE_IPHONES_2: "Compatible con iPhone 6S o superior y con iOS 9.1 en adelante",
  13460. VR_COMPATIBLE_IPHONES_3: "iPhones compatibles",
  13461. VR_COMPATIBLE_ANDROID: "Dispositivos Android compatibles",
  13462. VR_ANDROID_DETAIL: "Pantallas de 11.43 cm a 13.97 cm con OS de Android 4.4.4 en adelante",
  13463. VR_ANDROID_DVICES: "Dispositivos Android",
  13464. VR_COMPATIBLE_SAMSUNG: "Dispositivos compatibles del Samsung",
  13465. VR_SAMSUNG_DETAIL: "Galaxy S5 en adelante",
  13466. VR_APP_FOR_CARDBOARD: "Aplicación port VR para Google Cardboard",
  13467. VR_APP_FOR_SAMSUNG: "Aplicación port VR para Gear VR",
  13468. VR_DOWNLOAD_HERE: "Descargar aquí",
  13469. VR_REQUIRE_HEADSET: "Necesita un casco de realidad virtual y que se instale la aplicación port VR para Android",
  13470. VR_REDIRECT_TO_STORE: "Si la aplicación no está instalada, se le redirigirá a la tienda de aplicaciones.",
  13471. VR_IMPROPER_EMBED: "El espacio de port no está incorporado correctamente para apoyar VR en su navegador web.",
  13472. VR_OPEN_ANDROID_LINK: "Abre el enlace en tu teléfono móvil",
  13473. VR_ANDROID_OPTIONS: "Opciones de auriculares en RV disponibles",
  13474. SHARE_TO: "Compartir en",
  13475. SHARE_LINK: "Enlace directo",
  13476. SHARE_EXPLORE: "Explorar ",
  13477. SHARE_AT: "en",
  13478. SHARE_WITH: "con",
  13479. SHARE_3D: " en 3D",
  13480. SHARE_COPIED: "¡Copiado!",
  13481. ERROR_BROWSER_SOLUTION: "Instale un nuevo navegador para explorar en 3D.",
  13482. ERROR_BROWSER_EXPLANATION: "WebGL requiere un navegador moderno.",
  13483. ERROR_GENERIC_PROBLEM: "Vaya, algo ha ido mal.",
  13484. ERROR_GENERIC_SOLUTION: "Reinicie su navegador.",
  13485. ERROR_GENERIC_ACTIONS_1: "Si el problema persiste, ",
  13486. ERROR_GENERIC_ACTIONS_2: "instale un navegador compatible",
  13487. ERROR_GENERIC_ACTIONS_3: " o ",
  13488. ERROR_GENERIC_ACTIONS_4: "consulte nuestra guía de solución de problemas",
  13489. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Navegador no compatible.",
  13490. ERROR_WEBGL_IOS_PROBLEM: "Versión de iOS no compatible.",
  13491. ERROR_WEBGL_IOS_SOLUTION: "Actualice a iOS 8 o superior para explorar en 3D.",
  13492. ERROR_WEBGL_IOS_ACTIONS_1: "Pulse ",
  13493. ERROR_WEBGL_IOS_ACTIONS_2: "Ajustes > General > Actualización de software",
  13494. ERROR_WEBGL_SAFARI_PROBLEM: "Habilite WebGL para explorar en 3D.",
  13495. ERROR_WEBGL_SAFARI_ACTIONS_1: "Haga clic en ",
  13496. ERROR_WEBGL_SAFARI_ACTIONS_2: "Preferencias > Avanzado > Mostrar el menú Desarrollar",
  13497. ERROR_WEBGL_SAFARI_ACTIONS_3: "Después, haga clic en ",
  13498. ERROR_WEBGL_SAFARI_ACTIONS_4: "Desarrollar > Habilitar WebGL",
  13499. ERROR_MISSING_URLS_PROBLEM: "Vaya, no hay panoramas para este modelo.",
  13500. ERROR_MISSING_URLS_EXPLANATION: "Este es un modelo antiguo. El propietario del sitio web puede tener un nuevo modelo en mente.",
  13501. ERROR_LOADING_FAILED_PROBLEM: "Vaya, modelo no disponible.",
  13502. ERROR_LOADING_FAILED_ACTIONS_1: "Si el problema persiste, ",
  13503. ERROR_LOADING_FAILED_ACTIONS_2: "consulte nuestra guía de solución de problemas",
  13504. ERROR_MAINTENANCE_PROBLEM: "Mantenimiento en progreso.",
  13505. ERROR_MAINTENANCE_SOLUTION: "Regrese en unos minutos.",
  13506. LINK_TO_LOCATION: "Enlace a la ubicación",
  13507. MENU_COPY: "Copiar",
  13508. LINK_ALERT_COPY: "Utilice CTRL/CMD + C para copiar.",
  13509. ROTATE: "Girar",
  13510. INSIDE: "Interior",
  13511. MOVE: "Moverse",
  13512. ZOOM: "Acercar o alejar"
  13513. }
  13514. }
  13515. , {}],
  13516. 113: [function(e, t, i) {
  13517. "use strict";
  13518. t.exports = {
  13519. PAGE_TITLE: "",
  13520. LOADING: "Chargement",
  13521. PRESENTED_BY_CAPS: "PRÉSENTÉ PAR",
  13522. POWERED_BY: "alimenté par ",
  13523. POWERED_BY_CAPS: "ALIMENTÉ PAR",
  13524. DESKTOP_SHORT_CTA: "Cliquez pour explorer l'Espace 3D.",
  13525. MOBILE_SHORT_CTA: "Cliquez pour explorer l'Espace 3D.",
  13526. PRESENTED_BY: "Présenté par ",
  13527. MORE: "Plus ",
  13528. LESS: "Moins ",
  13529. TAG_CONTENT: "Contenu tag™",
  13530. SHOW: "Montrer",
  13531. HIDE: "Cacher",
  13532. DOLLHOUSE: "Dollhouse",
  13533. FLOOR_PLAN: "Plan de sol",
  13534. OPEN_HIGHLIGHTS: "Ouvrir les faits saillants",
  13535. CLOSE_HIGHLIGHTS: "Fermer",
  13536. PREVIOUS: "Précédent",
  13537. PLAY: "Lecture",
  13538. PAUSE: "Pause",
  13539. NEXT: "Suivant",
  13540. EXPLORE_3D_SPACE: "Explorer l'Espace en 3D",
  13541. VIEW_DOLLHOUSE: "Voir dollhouse",
  13542. SOCIAL_SHARING: "Partager cet espace",
  13543. VIEW_IN_VR: "Voir en VR",
  13544. VIEW_FULLSCREEN: "Plein écran",
  13545. EXIT_FULLSCREEN: "Fermer plein écran",
  13546. ZOOM_IN: "Zoom avant",
  13547. ZOOM_OUT: "Zoom arrière",
  13548. FLOOR_NAME: "Étage ",
  13549. FLOOR_ALL: "Tous",
  13550. TERMS: "Mentions légales",
  13551. PORT_TERMS: "port mentions légales",
  13552. TERMS_OF_USE: "Conditions d'utilisation",
  13553. TERMS_TEXT_FILE: "terms-fr-FR.html",
  13554. CLOSE_TERMS: "Fermer",
  13555. TERMS_FAIL: "Impossible d'accéder aux mentions légales. Vérifiez que vous avez une connexion Internet pour afficher les conditions d'utilisation.",
  13556. HELP: "Aide",
  13557. HELP_NAVIGATION_TAB: "Navigation",
  13558. HELP_MORE_HELP_TAB: "Aide",
  13559. CLOSE: "Fermer",
  13560. HELP_DESKTOP_PANORAMA_1A: "Cliquez et faites glisser pour regarder autour de l’espace.",
  13561. HELP_DESKTOP_PANORAMA_2A: "Cliquez sur les anneaux pour vous déplacer.",
  13562. HELP_DESKTOP_PANORAMA_3A: "Utilisez la molette de votre souris pour zoomer.",
  13563. HELP_DESKTOP_PANORAMA_1B: "Ou utilisez les touches pour tourner.",
  13564. HELP_DESKTOP_PANORAMA_2B: "Ou utilisez les touches pour avancer et reculer.",
  13565. HELP_DESKTOP_PANORAMA_3B: "Ou utilisez les touches plus et moins pour zoomer.",
  13566. HELP_DESKTOP_360_2A: "Cliquez sur l’icône Vue Intérieure pour entrer dans l’Espace.",
  13567. HELP_DESKTOP_360_2B: "Ou, appuyez sur la touche numéro 1 pour entrer dans la Vue Intérieure.",
  13568. HELP_DESKTOP_DOLLHOUSE_1A: "Faites un clic gauche et bougez votre souris pour faire pivoter la vue Dollhouse.",
  13569. HELP_DESKTOP_DOLLHOUSE_2A: "Faites un clic droit et bougez votre souris pour changer la position de la vue Dollhouse.",
  13570. HELP_DESKTOP_DOLLHOUSE_3A: "Utilisez la molette de votre souris pour zoomer.",
  13571. HELP_DESKTOP_DOLLHOUSE_1B: "Ou utilisez les touches pour faire pivoter la vue Dollhouse.",
  13572. HELP_DESKTOP_FLOORPLAN_1A: "Faites un clic droit pour changer la position du plan sur l’écran.",
  13573. HELP_DESKTOP_FLOORPLAN_2A: "Faites un clic droit et faites glisser à gauche ou à droite pour faire pivoter le plan.",
  13574. HELP_DESKTOP_FLOORPLAN_3A: "Utilisez la molette de votre souris pour zoomer.",
  13575. HELP_DESKTOP_FLOORPLAN_2B: "Ou utilisez les touches pour faire pivoter à gauche ou à droite.",
  13576. HELP_DESKTOP_FLOORPLAN_3B: "Ou utilisez les touches pour effectuer un zoom avant ou arrière.",
  13577. HELP_MOBILE_PANORAMA_1: "Touchez et faites glisser pour regarder autour de l’espace.",
  13578. HELP_MOBILE_PANORAMA_2: "Tapez sur les anneaux dans tout l’espace pour vous déplacer.",
  13579. HELP_MOBILE_3: "Utilisez un geste de pincement pour zoomer avant/arrière.",
  13580. HELP_MOBILE_360_2: "Tapez sur l’icône Vue Intérieure pour entrer dans l’Espace.",
  13581. HELP_MOBILE_DOLLHOUSE_1: "Touchez et faites glisser vers le haut/bas/gauche/droite pour faire pivoter la vue Dollhouse.",
  13582. HELP_MOBILE_DOLLHOUSE_2: "Touchez et faites glisser avec deux doigts pour positionner vue en coupe.",
  13583. HELP_MOBILE_FLOORPLAN_1: "Touchez et faites glisser pour positionner le plan.",
  13584. HELP_MOBILE_FLOORPLAN_2: "Touchez et faites glisser avec deux doigts pour faire pivoter le plan.",
  13585. HELP_MORE_HLR_A: "Carrousel",
  13586. HELP_DESKTOP_MORE_HLR_B: "Ouvrez pour naviguer dans l’espace en utilisant les vignettes.",
  13587. HELP_MORE_DOLLHOUSE_A: "Vue en coupe",
  13588. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Cliquez pour afficher et faire pivoter l’espace entier en 3D.",
  13589. HELP_MOBILE_MORE_DOLLHOUSE_B: "Tapez pour afficher et faire pivoter l’espace entier en 3D.",
  13590. HELP_MORE_FLOORS_A: "Sélecteur d’étage",
  13591. HELP_DESKTOP_MORE_FLOORS_B: "Basculer entre les étages dans l’espace.",
  13592. HELP_MORE_TAG_A: "tag™ Posts",
  13593. HELP_DESKTOP_MORE_TAG_B: "Cliquez ou survolez pour obtenir des informations sur l’espace.",
  13594. HELP_MOBILE_MORE_TAG_B: "Tapez pour obtenir des informations sur l’espace.",
  13595. HELP_MORE_ZOOM_A: "Commandes de zoom",
  13596. HELP_DESKTOP_MORE_ZOOM_B: "Utilisez votre clavier ou la molette de votre souris pour zoomer.",
  13597. HELP_MORE_TOUR_A: "Commandes de la visite",
  13598. HELP_DESKTOP_MORE_TOUR_B: "Mettez en marche ou en pause, avancez et reculez lors d'une visite guidée.",
  13599. HELP_MORE_INSIDE_A: "Vue intérieure",
  13600. HELP_DESKTOP_MORE_INSIDE_B: "Cliquez pour explorer l’intérieur de l’espace.",
  13601. HELP_MOBILE_MORE_INSIDE_B: "Tapez pour explorer l’intérieur de l’espace.",
  13602. HELP_MORE_VR_A: "Mode RV",
  13603. HELP_DESKTOP_MORE_VR_B: "Cliquez pour lancer l’espace en réalité virtuelle.",
  13604. HELP_MOBILE_MORE_VR_B: "Tapez pour lancer l’espace en réalité virtuelle.",
  13605. HELP_MORE_360_A: "Vues 360°",
  13606. HELP_DESKTOP_MORE_360_B: "Cliquez sur vues 360°, dans le carrousel pour voir les scènes extérieures.",
  13607. HELP_MOBILE_MORE_360_B: "Tapez sur vues 360°, dans le carrousel pour voir les scènes extérieures.",
  13608. HELP_MORE_FULLSCREEN_A: "Plein écran",
  13609. HELP_DESKTOP_MORE_FULLSCREEN_B: "Voir 3D Showcase en plein écran.",
  13610. WEBVR_FOR_CARDBOARD: "Pour Google Cardboard",
  13611. WEBVR_FOR_DAYDREAM: "Pour Daydream View",
  13612. WEBVR_ENTER_WEBVR: "ENTRER VR",
  13613. WEBVR_DIFFERENT_HEADSET: "Avez-vous un casque différent?",
  13614. WEBVR_LEARN_MORE: "En savoir plus",
  13615. WEBVR_VIEW_SPACE: "Voir Espace en VR",
  13616. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13617. WEBVR_DAYDREAM_PHONE: "Téléphone compatibles Daydream",
  13618. WEBVR_VIEW_CARDBOARD: "Ou Afficher sur Google Cardboard",
  13619. VR_VIEW_SPACE: "Voir l'Espace en Réalité Virtuelle",
  13620. VR_LEARN_MORE_CAPS: "EN SAVOIR PLUS",
  13621. VR_PREVIOUS_CAPS: "PRÉCÉDENT",
  13622. VR_NEXT_CAPS: "SUIVANT",
  13623. VR_GOT_IT_CAPS: "BIEN COMPRIS",
  13624. VR_SHOW_SUPPORTED: "Taper pour voir l'Espace en VR avec",
  13625. VR_SHOW_UNSUPPORTED: "Désolé mais votre appareil ne répond pas aux critères minimaux pour voir cet Espace en mode VR.",
  13626. VR_SHOW_IOS_1: "Taper pour voir l’Espace en Realité Virtuelle",
  13627. VR_SHOW_IOS_2: "Nécessite l’application port VR et un iPhone compatible pour voir",
  13628. VR_WHAT_YOU_NEED: "Ce dont vous aurez besoin pour...",
  13629. VR_NEED_CARDBOARD: "Ce dont vous aurez besoin avec Google Cardboard",
  13630. VR_NEED_SAMSUNG: "Ce dont vous aurez besoin avec Samsung Gear VR",
  13631. VR_NEED_DAYDREAM: "BESOINS AVANT APPARIEMENT AVEC DAYDREAM VIEW",
  13632. VR_NEED_DAYDREAM_PHONE: "Téléphone compatible avec Daydream",
  13633. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13634. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13635. VR_APP: "port VR App",
  13636. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13637. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13638. VR_COMPATIBLE_IPHONES_2: "iPhone 5s et plus récent, avec iOS 9.1 et plus récent",
  13639. VR_COMPATIBLE_IPHONES_3: "iPhones compatibles",
  13640. VR_COMPATIBLE_ANDROID: "Appareils Android compatibles",
  13641. 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",
  13642. VR_ANDROID_DETAIL: 'Écrans 4.5" à 5.5" avec Android 4.4.4 ou plus récent',
  13643. VR_ANDROID_DVICES: "Appareils Android",
  13644. VR_COMPATIBLE_SAMSUNG: "Appareils Samsung Compatibles",
  13645. VR_SAMSUNG_DETAIL: "Galaxy S6 et plus récents",
  13646. VR_APP_FOR_CARDBOARD: "Application port VR pour Google Cardboard",
  13647. VR_APP_FOR_SAMSUNG: "Application port VR pour Gear VR",
  13648. VR_APP_FOR_ANDROID: "Application port VR pour téléphones Android",
  13649. VR_APP_OPEN: "Ouvrir plutôt avec l’application port VR",
  13650. VR_DOWNLOAD_HERE: "Télécharger ici",
  13651. VR_REQUIRE_HEADSET: "Nécessite un casque VR et l'application port VR pour Android afin d'être installé",
  13652. VR_REDIRECT_TO_STORE: "Si l'application n'est pas installée, vous serez rediriger vers l'App store.",
  13653. VR_IMPROPER_EMBED: "L'Espace port n'est pas correctement intégré pour supporter VR dans votre navigateur Web.",
  13654. VR_OPEN_ANDROID_LINK: "Ouvrez ce lien avec votre appareil mobile",
  13655. VR_ANDROID_OPTIONS: "Options disponibles pour casque VR sous",
  13656. SHARE_TO: "Partager sur",
  13657. SHARE_LINK: "Lien direct",
  13658. SHARE_EXPLORE: "Explorer ",
  13659. SHARE_AT: "à",
  13660. SHARE_WITH: "avec",
  13661. SHARE_3D: " en 3D",
  13662. SHARE_COPIED: "Copié!",
  13663. ERROR_BROWSER_SOLUTION: "Installer un nouveau navigateur pour explorer en 3D.",
  13664. ERROR_BROWSER_EXPLANATION: "WebGL a besoin d'un navigateur récent.",
  13665. ERROR_GENERIC_PROBLEM: "Il y eu un problème.",
  13666. ERROR_GENERIC_SOLUTION: "Redémarrer votre navigateur.",
  13667. ERROR_GENERIC_ACTIONS_1: "Si le problème persiste, ",
  13668. ERROR_GENERIC_ACTIONS_2: "installez un navigateur plus récent",
  13669. ERROR_GENERIC_ACTIONS_3: " ou ",
  13670. ERROR_GENERIC_ACTIONS_4: "voir notre guide de dépannage",
  13671. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Navigateur non-supporté.",
  13672. ERROR_WEBGL_IOS_PROBLEM: "Version iOS non-supportée.",
  13673. ERROR_WEBGL_IOS_SOLUTION: "Mettre à jour avec iOS8 au minimum pour voir l'Espace en 3D.",
  13674. ERROR_WEBGL_IOS_ACTIONS_1: "Tapez ",
  13675. ERROR_WEBGL_IOS_ACTIONS_2: "Paramètres > Général > Mise à jour Software",
  13676. ERROR_WEBGL_SAFARI_PROBLEM: "Activez WegGL pour explorer en 3D.",
  13677. ERROR_WEBGL_SAFARI_ACTIONS_1: "Cliquez ",
  13678. ERROR_WEBGL_SAFARI_ACTIONS_2: "Préferences > Avancés > Voir menu développeur",
  13679. ERROR_WEBGL_SAFARI_ACTIONS_3: "Puis cliquez ",
  13680. ERROR_WEBGL_SAFARI_ACTIONS_4: "Développe > Activé WebGL",
  13681. ERROR_MISSING_URLS_PROBLEM: "Il n'y a pas de panoromas pour ce modèle.",
  13682. ERROR_MISSING_URLS_EXPLANATION: "Ceci est un ancien modèle. Le propriétaire du site a peut-être un nouveau modèle en cours.",
  13683. ERROR_LOADING_FAILED_PROBLEM: "Ce modèle n'est pas disponible.",
  13684. ERROR_LOADING_FAILED_ACTIONS_1: "Si le problème persiste, ",
  13685. ERROR_LOADING_FAILED_ACTIONS_2: "voir notre guide de dépannage",
  13686. ERROR_MAINTENANCE_PROBLEM: "Maintenance en cours.",
  13687. ERROR_MAINTENANCE_SOLUTION: "Revenez dans quelques instants.",
  13688. LINK_TO_LOCATION: "Lien vers l'emplacement",
  13689. MENU_COPY: "Copie",
  13690. LINK_ALERT_COPY: "Utiliser CTRL+CMD C pour copier.",
  13691. ROTATE: "Faire pivoter",
  13692. INSIDE: "Intérieure",
  13693. MOVE: "Se déplacer",
  13694. ZOOM: "Zoom"
  13695. }
  13696. }
  13697. , {}],
  13698. 114: [function(e, t, i) {
  13699. "use strict";
  13700. t.exports = {
  13701. PAGE_TITLE: "",
  13702. LOADING: "読み込み中",
  13703. PRESENTED_BY_CAPS: "PRESENTED BY",
  13704. POWERED_BY: "powered by",
  13705. POWERED_BY_CAPS: "POWERED BY",
  13706. DESKTOP_SHORT_CTA: "クリックしてこの3D Spaceを探索",
  13707. MOBILE_SHORT_CTA: "タップしてこの3D Spaceを探索",
  13708. PRESENTED_BY: "Presented by ",
  13709. MORE: "全て表示 ",
  13710. LESS: "閉じる ",
  13711. TAG_CONTENT: "tag™コンテンツ ",
  13712. SHOW: "表示",
  13713. HIDE: "非表示",
  13714. DOLLHOUSE: "ドールハウス",
  13715. FLOOR_PLAN: "フロアプラン",
  13716. OPEN_HIGHLIGHTS: "ハイライトを開く",
  13717. CLOSE_HIGHLIGHTS: "閉じる",
  13718. PREVIOUS: "前へ",
  13719. PLAY: "再生",
  13720. PAUSE: "一時停止",
  13721. NEXT: "次へ",
  13722. EXPLORE_3D_SPACE: "3DSpaceの探索",
  13723. VIEW_DOLLHOUSE: "ドールハウスの表示",
  13724. SOCIAL_SHARING: "このSpaceを共有する",
  13725. VIEW_IN_VR: "VRで表示",
  13726. VIEW_FULLSCREEN: "フルスクリーン表示",
  13727. EXIT_FULLSCREEN: "フルスクリーン表示を終了",
  13728. ZOOM_IN: "ズームイン",
  13729. ZOOM_OUT: "ズームアウト",
  13730. FLOOR_NAME: "フロア ",
  13731. FLOOR_ALL: "すべて",
  13732. TERMS: "規約",
  13733. PORT_TERMS: "port規約",
  13734. TERMS_OF_USE: "利用規約",
  13735. CLOSE_TERMS: "閉じる",
  13736. TERMS_TEXT_FILE: "terms-jp-JP.html",
  13737. TERMS_FAIL: "規約を取得できませんでした。利用規約を表示するためにインターネットに接続されていることを確認してください。",
  13738. WEBVR_FOR_DAYDREAM: "Daydream View用",
  13739. WEBVR_ENTER_WEBVR: "VRに入る",
  13740. WEBVR_DIFFERENT_HEADSET: "別のヘッドセットをお持ちですか?",
  13741. WEBVR_LEARN_MORE: "もっと詳しく",
  13742. WEBVR_VIEW_SPACE: "VRでSpaceを表示",
  13743. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13744. WEBVR_DAYDREAM_PHONE: "Daydream対応スマホ",
  13745. WEBVR_FOR_CARDBOARD: "Google Cardboard用",
  13746. WEBVR_VIEW_CARDBOARD: "またはGoogle Cardboardで表示",
  13747. VR_VIEW_SPACE: "バーチャルリアリティでSpaceを表示",
  13748. VR_LEARN_MORE_CAPS: "もっと詳しく",
  13749. VR_PREVIOUS_CAPS: "前へ",
  13750. VR_NEXT_CAPS: "次へ",
  13751. VR_GOT_IT_CAPS: "了解",
  13752. VR_SHOW_SUPPORTED: "タップして次を使用してVRでSpaceを表示: ",
  13753. VR_SHOW_UNSUPPORTED: "お使いのデバイスはVRでSpaceを表示する最低要件を満たしていません",
  13754. VR_SHOW_IOS_1: "タップしてVRでSpaceを表示",
  13755. VR_SHOW_IOS_2: "表示するにはport VRアプリと互換性のあるiPhoneが必要です",
  13756. VR_WHAT_YOU_NEED: "必要なもの",
  13757. VR_NEED_CARDBOARD: "Google Cardboardに必要なもの",
  13758. VR_NEED_SAMSUNG: "Samsung Gear VRに必要なもの",
  13759. VR_NEED_DAYDREAM: "事前にDaydream Viewとのペアリングが必要です",
  13760. VR_NEED_DAYDREAM_PHONE: "Daydream対応スマホ",
  13761. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13762. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13763. VR_APP: "port VRアプリ",
  13764. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13765. VR_COMPATIBLE_IPHONES_1: "iPhone",
  13766. VR_COMPATIBLE_IPHONES_2: "iOS 9.1以降で動作するiPhone 5s以降のモデル",
  13767. VR_COMPATIBLE_IPHONES_3: "互換性のあるiPhone",
  13768. VR_COMPATIBLE_ANDROID: "互換性のあるAndroidデバイス",
  13769. VR_COMPATIBLE_ANDROID_LONG: "Android OS 4.4.4以降で動作する互換性のあるAndroidデバイスの4.5~5.5インチディスプレイ",
  13770. VR_ANDROID_DETAIL: "Android OS 4.4.4以降で動作する4.5~5.5インチディスプレイ",
  13771. VR_ANDROID_DVICES: "Androidデバイス",
  13772. VR_COMPATIBLE_SAMSUNG: "互換性のあるSamsungデバイス",
  13773. VR_SAMSUNG_DETAIL: "Galaxy S5以降のモデル",
  13774. VR_APP_FOR_CARDBOARD: "Google Cardboard用のport VRアプリ",
  13775. VR_APP_FOR_SAMSUNG: "Gear VR 用のport VRアプリ",
  13776. VR_APP_FOR_ANDROID: "Androidフォン用のport VRアプリ",
  13777. VR_APP_OPEN: "port VRアプリで開く",
  13778. VR_DOWNLOAD_HERE: "ここからダウンロード",
  13779. VR_REQUIRE_HEADSET: "Android 用のVRヘッドセットとport VRアプリ をインストールする必要があります",
  13780. VR_REDIRECT_TO_STORE: "アプリがインストールされていない場合、App Storeにリダイレクトされます",
  13781. VR_IMPROPER_EMBED: "お使いのウェブブラウザでVRがサポートされるようport Spaceが適切に埋め込まれていません。",
  13782. VR_OPEN_ANDROID_LINK: "お使いの携帯電話でリンクを開いてください",
  13783. VR_ANDROID_OPTIONS: "利用可能なVRヘッドセットオプション",
  13784. SHARE_TO: "共有先",
  13785. SHARE_LINK: "ダイレクトリンク",
  13786. SHARE_EXPLORE: "探索",
  13787. SHARE_AT: "場所",
  13788. SHARE_WITH: "使用アプリ",
  13789. SHARE_3D: "3Dで",
  13790. SHARE_COPIED: "コピーされました!",
  13791. ERROR_BROWSER_SOLUTION: "3D探索するには、新しいバージョンのブラウザをインストールしてください",
  13792. ERROR_BROWSER_EXPLANATION: "WebGLにはモダンブラウザが必要です。",
  13793. ERROR_GENERIC_PROBLEM: "問題が発生しました。",
  13794. ERROR_GENERIC_SOLUTION: "ブラウザを再起動してください。",
  13795. ERROR_GENERIC_ACTIONS_1: "問題が解決しない場合は、",
  13796. ERROR_GENERIC_ACTIONS_2: "サポートされているブラウザをインストールしてください",
  13797. ERROR_GENERIC_ACTIONS_3: "または",
  13798. ERROR_GENERIC_ACTIONS_4: "トラブルシューティングガイドを参照してください",
  13799. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "ブラウザがサポートされていません。",
  13800. ERROR_WEBGL_IOS_PROBLEM: "サポートされていないiOSバージョンです。",
  13801. ERROR_WEBGL_IOS_SOLUTION: "3D探索するには、iOS 8以降にアップグレードしてください。",
  13802. ERROR_WEBGL_IOS_ACTIONS_1: "以下の順にタップします:",
  13803. ERROR_WEBGL_IOS_ACTIONS_2: "設定 > 全般 > ソフトウェアの更新",
  13804. ERROR_WEBGL_SAFARI_PROBLEM: "WebGLを有効にして3Dで探索します。",
  13805. ERROR_WEBGL_SAFARI_ACTIONS_1: "以下の順にクリックします:",
  13806. ERROR_WEBGL_SAFARI_ACTIONS_2: "環境設定 > 詳細 > メニューバーに開発メニューを表示",
  13807. ERROR_WEBGL_SAFARI_ACTIONS_3: "その後、以下の順にクリックします:",
  13808. ERROR_WEBGL_SAFARI_ACTIONS_4: "開発 > WebGLを有効にする",
  13809. ERROR_MISSING_URLS_PROBLEM: "このモデルではパノラマを使用できません。",
  13810. ERROR_MISSING_URLS_EXPLANATION: "これは古いモデルです。ウェブサイト所有者が新しいモデルを開発中かもしれません。",
  13811. ERROR_LOADING_FAILED_PROBLEM: "モデルは利用できません。",
  13812. ERROR_LOADING_FAILED_ACTIONS_1: "問題が解決しない場合は、",
  13813. ERROR_LOADING_FAILED_ACTIONS_2: "トラブルシューティングガイドを参照してください",
  13814. ERROR_MAINTENANCE_PROBLEM: "メンテナンスは進行中です。",
  13815. ERROR_MAINTENANCE_SOLUTION: "しばらくしてからやり直し てください。",
  13816. LINK_TO_LOCATION: "ロケーションへのリンク",
  13817. MENU_COPY: "コピー",
  13818. LINK_ALERT_COPY: "コピーするにはCTRL/CMD + Cを使用してください。",
  13819. ROTATE: "回転",
  13820. MOVE: "移動",
  13821. INSIDE: "内側",
  13822. ZOOM: "ズーム",
  13823. HELP: "ヘルプ",
  13824. HELP_NAVIGATION_TAB: "ナビゲーション",
  13825. HELP_MORE_HELP_TAB: "その他のヘルプ",
  13826. HELP_DESKTOP_PANORAMA_1A: "Spaceを見回すには、クリックしてドラッグします。",
  13827. HELP_DESKTOP_PANORAMA_2A: "移動するには、Space全体にあるリングをクリックします。",
  13828. HELP_DESKTOP_PANORAMA_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
  13829. HELP_DESKTOP_PANORAMA_1B: "または、矢印キーを使用して左右に向きを変えます。",
  13830. HELP_DESKTOP_PANORAMA_2B: "または、矢印キーを使用して前後に向きを変えます。",
  13831. HELP_DESKTOP_PANORAMA_3B: "あるいは、プラス(+)キーまたはマイナス(-)キーを使用して、ズームイン、ズームアウトします。",
  13832. HELP_DESKTOP_360_2A: "内側ビューアイコンをクリックしてSpaceに入ります。",
  13833. HELP_DESKTOP_360_2B: "または、数字キー1を押して内側ビューに入ります。",
  13834. HELP_DESKTOP_DOLLHOUSE_1A: "左クリックと左右、上下のドラッグでドールハウスを回転します。",
  13835. HELP_DESKTOP_DOLLHOUSE_2A: "右クリックと左右、上下のドラッグでドールハウスの画面上の位置を変更します。",
  13836. HELP_DESKTOP_DOLLHOUSE_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
  13837. HELP_DESKTOP_DOLLHOUSE_1B: "または、矢印キーを使用してドールハウスを回転します。",
  13838. HELP_DESKTOP_FLOORPLAN_1A: "左ボタンを押しながら、上下左右にドラッグしてフロアプランの画面上の位置を変更します。",
  13839. HELP_DESKTOP_FLOORPLAN_2A: "右ボタンを押しながら左右にドラッグして、フロアプランを回転します。",
  13840. HELP_DESKTOP_FLOORPLAN_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
  13841. HELP_DESKTOP_FLOORPLAN_2B: "または、矢印キーを使用して左右に回転します。",
  13842. HELP_DESKTOP_FLOORPLAN_3B: "または、矢印キーを使用して、ズームイン、ズームアウトします。",
  13843. HELP_MOBILE_PANORAMA_1: "Spaceを見回すには、タッチしてドラッグします。",
  13844. HELP_MOBILE_PANORAMA_2: "移動するには、Space全体にあるリングをタップします。",
  13845. HELP_MOBILE_3: "ピンチジェスチャーを使用してズームイン、ズームアウトします。",
  13846. HELP_MOBILE_360_2: "内側ビューアイコンをタップしてSpaceに入ります。",
  13847. HELP_MOBILE_DOLLHOUSE_1: "タッチして上下左右にドラッグしてドールハウスを回転します。",
  13848. HELP_MOBILE_DOLLHOUSE_2: "タッチして、2本指でドラッグしてドールハウスを配置します。",
  13849. HELP_MOBILE_FLOORPLAN_1: "タッチ&ドラッグしてフロアプランを配置します。",
  13850. HELP_MOBILE_FLOORPLAN_2: "タッチして、2本指でドラッグしてフロアプランを回転します。",
  13851. HELP_MORE_HLR_A: "ハイライト",
  13852. HELP_DESKTOP_MORE_HLR_B: "サムネイル画像を使用してSpaceを移動するために開きます。",
  13853. HELP_MORE_DOLLHOUSE_A: "ドールハウス",
  13854. HELP_DESKTOP_MORE_DOLLHOUSE_B: "クリックして3DでSpace全体のトップダウンビューを表示して回転します。",
  13855. HELP_MOBILE_MORE_DOLLHOUSE_B: "タップして3DでSpace全体のトップダウンビューを表示して回転します。",
  13856. HELP_MORE_FLOORS_A: "フロアセレクター",
  13857. HELP_DESKTOP_MORE_FLOORS_B: "Space内のフロアを切り替えます。",
  13858. HELP_MORE_TAG_A: "tag™ Posts",
  13859. HELP_DESKTOP_MORE_TAG_B: "クリックするか、カーソルを置くとSpace内の機能についての説明が表示されます。",
  13860. HELP_MOBILE_MORE_TAG_B: "タップするとSpace内の機能についての説明が表示されます。",
  13861. HELP_MORE_ZOOM_A: "ズームコントロール",
  13862. HELP_DESKTOP_MORE_ZOOM_B: "これらのコントロールまたはスクロールホイールを使用して、ズームイン、ズームアウトします。",
  13863. HELP_MORE_TOUR_A: "ツアーコントロール",
  13864. HELP_DESKTOP_MORE_TOUR_B: "ガイド付きツアー中に再生、一時停止、前方・後方に移動します。",
  13865. HELP_MORE_INSIDE_A: "内側ビュー",
  13866. HELP_DESKTOP_MORE_INSIDE_B: "クリックしてSpace内を探索します。",
  13867. HELP_MOBILE_MORE_INSIDE_B: "タップしてSpace内を探索します。",
  13868. HELP_MORE_VR_A: "VRモード",
  13869. HELP_DESKTOP_MORE_VR_B: "クリックしてバーチャルリアリティでSpaceを起動します。",
  13870. HELP_MOBILE_MORE_VR_B: "タップしてバーチャルリアリティでSpaceを起動します。",
  13871. HELP_MORE_360_A: "360° Views",
  13872. HELP_DESKTOP_MORE_360_B: "Highlight Reelの360° Viewsをクリックして屋外シーンを表示します。",
  13873. HELP_MOBILE_MORE_360_B: "Highlight Reelの360° Viewsをタップして屋外シーンを表示します。",
  13874. HELP_MORE_FULLSCREEN_A: "フルスクリーン",
  13875. HELP_DESKTOP_MORE_FULLSCREEN_B: "3D Showcaseをフルスクリーン表示にします。",
  13876. CLOSE: "閉じる"
  13877. }
  13878. }
  13879. , {}],
  13880. 115: [function(e, t, i) {
  13881. "use strict";
  13882. t.exports = {
  13883. PAGE_TITLE: "",
  13884. LOADING: "Загрузка",
  13885. PRESENTED_BY_CAPS: "ПРЕДСТАВЛЕНО",
  13886. POWERED_BY: "разработано на платформе ",
  13887. POWERED_BY_CAPS: "РАЗРАБОТАНО НА ПЛАТФОРМЕ",
  13888. DESKTOP_SHORT_CTA: "Нажмите для просмотра.",
  13889. MOBILE_SHORT_CTA: "Нажмите для просмотра.",
  13890. PRESENTED_BY: "Представлено ",
  13891. MORE: "Больше ",
  13892. LESS: "Меньше ",
  13893. TAG_CONTENT: "tag™ Контент",
  13894. SHOW: "Показать",
  13895. HIDE: "Скрыть",
  13896. DOLLHOUSE: "Dollhouse",
  13897. FLOOR_PLAN: "Планировка",
  13898. OPEN_HIGHLIGHTS: "Открыть Фотоколлаж",
  13899. CLOSE_HIGHLIGHTS: "Закрыть",
  13900. PREVIOUS: "Предыдущий",
  13901. PLAY: "Воспроизвести",
  13902. PAUSE: "Пауза",
  13903. NEXT: "Следующий",
  13904. EXPLORE_3D_SPACE: "Просмотреть 3D модель",
  13905. VIEW_DOLLHOUSE: "Посмотреть Dollhouse",
  13906. SOCIAL_SHARING: "Поделиться этой моделью",
  13907. VIEW_IN_VR: "Посмотреть в VR",
  13908. VIEW_FULLSCREEN: "Полный экран",
  13909. EXIT_FULLSCREEN: "Выйти из полноэкранного режима",
  13910. ZOOM_IN: "Увеличить",
  13911. ZOOM_OUT: "Уменьшить",
  13912. FLOOR_NAME: "Этаж ",
  13913. FLOOR_ALL: "Все",
  13914. TERMS: "Условия",
  13915. PORT_TERMS: "Правила пользования",
  13916. TERMS_OF_USE: "Условия использования",
  13917. TERMS_TEXT_FILE: "terms-ru-RU.html",
  13918. CLOSE_TERMS: "Закрыть",
  13919. TERMS_FAIL: "Не удалось загрузить условия использования. Для просмотра условий использования, пожалуйста, убедитесь, что у Вас есть подключение к Интернету.",
  13920. HELP: "Помощь",
  13921. HELP_NAVIGATION_TAB: "Навигация",
  13922. HELP_MORE_HELP_TAB: "Доп. Помощь",
  13923. CLOSE: "Закрыть",
  13924. HELP_DESKTOP_PANORAMA_1A: "Нажмите и перетащите, чтобы осмотреть пространство вокруг.",
  13925. HELP_DESKTOP_PANORAMA_2A: "Для передвижения по модели нажимайте на круги .",
  13926. HELP_DESKTOP_PANORAMA_3A: "Используйте колесо прокрутки для увеличения и уменьшения.",
  13927. HELP_DESKTOP_PANORAMA_1B: "Или используйте клавиши со стрелками для поворота влево и вправо.",
  13928. HELP_DESKTOP_PANORAMA_2B: "Или используйте стрелки для перемещения вперед и назад.",
  13929. HELP_DESKTOP_PANORAMA_3B: "Или используйте клавиши ‘плюс’ и ‘минус’ для увеличения и уменьшения изображения.",
  13930. HELP_DESKTOP_360_2A: "Нажмите на значок ‘Вид Изнутри’, чтобы увидеть внутреннюю панораму.",
  13931. HELP_DESKTOP_360_2B: "или нажмите 1 на клавиатуре, чтобы увидеть внутреннюю панораму.",
  13932. HELP_DESKTOP_DOLLHOUSE_1A: "Нажмите левую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы повернуть Dollhouse.",
  13933. HELP_DESKTOP_DOLLHOUSE_2A: "Нажмите правую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы изменить позицию Dollhouse на экране.",
  13934. HELP_DESKTOP_DOLLHOUSE_3A: "Используйте колесо прокрутки чтобы увеличить и уменьшить.",
  13935. HELP_DESKTOP_DOLLHOUSE_1B: "Или используйте клавиши со стрелками, чтобы повернуть Dollhouse.",
  13936. HELP_DESKTOP_FLOORPLAN_1A: "Нажмите левую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы изменить положение Планировки на экране.",
  13937. HELP_DESKTOP_FLOORPLAN_2A: "Нажмите правую кнопку мыши и перетащите влево или вправо, чтобы повернуть Планировку.",
  13938. HELP_DESKTOP_FLOORPLAN_3A: "Используйте колесо прокрутки чтобы увеличить и уменьшить.",
  13939. HELP_DESKTOP_FLOORPLAN_2B: "Или используйте клавиши со стрелками для поворота влево или вправо.",
  13940. HELP_DESKTOP_FLOORPLAN_3B: "Или используйте стрелки для увеличения и уменьшения.",
  13941. HELP_MOBILE_PANORAMA_1: "Нажмите и перетащите, чтобы осмотреть модель.",
  13942. HELP_MOBILE_PANORAMA_2: "Для передвижения по модели нажимайте на круги.",
  13943. HELP_MOBILE_3: "Используйте движение двумя пальцами в разные стороны, чтобы увеличить и уменьшить.",
  13944. HELP_MOBILE_360_2: "Нажмите на значок ‘Вид Изнутри’, чтобы увидеть внутреннюю панораму.",
  13945. HELP_MOBILE_DOLLHOUSE_1: "Нажмите и перетащите вверх, вниз, влево и вправо, чтобы повернуть Dollhouse.",
  13946. HELP_MOBILE_DOLLHOUSE_2: "Нажмите и перетащите, чтобы расположить Dollhouse.",
  13947. HELP_MOBILE_FLOORPLAN_1: "Нажмите и перетащите, чтобы расположить план здания.",
  13948. HELP_MOBILE_FLOORPLAN_2: "Коснитесь и перетащите двумя пальцами, чтобы повернуть план здания.",
  13949. HELP_MORE_HLR_A: "Фотоколлаж",
  13950. HELP_DESKTOP_MORE_HLR_B: "Откройте для перемещения по модели, используя иконки изображений.",
  13951. HELP_MORE_DOLLHOUSE_A: "Dollhouse",
  13952. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Нажмите и поверните сверху вниз чтобы просмотреть всю 3D модель.",
  13953. HELP_MOBILE_MORE_DOLLHOUSE_B: "Нажмите и поверните сверху вниз чтобы просмотреть всю 3D модель.",
  13954. HELP_MORE_FLOORS_A: "Выбор Этажа",
  13955. HELP_DESKTOP_MORE_FLOORS_B: "Переключение между этажами.",
  13956. HELP_MORE_TAG_A: "tag™ Posts",
  13957. HELP_DESKTOP_MORE_TAG_B: "Нажмите или наведите курсор мыши для получения информации о функциях в Пространстве.",
  13958. HELP_MOBILE_MORE_TAG_B: "Нажмите для получения информации о функциях.",
  13959. HELP_MORE_ZOOM_A: "Масштаб",
  13960. HELP_DESKTOP_MORE_ZOOM_B: "Используйте эти кнопки для увеличения и уменьшения изображения или используйте колесо прокрутки.",
  13961. HELP_MORE_TOUR_A: "Управление Туром",
  13962. HELP_DESKTOP_MORE_TOUR_B: "Используйте кнопки Воспроизвести, Пауза, Вперед и Назад для управления фотоколлажем.",
  13963. HELP_MORE_INSIDE_A: "Вид Изнутри",
  13964. HELP_DESKTOP_MORE_INSIDE_B: "Нажмите, чтобы просмотреть модель изнутри.",
  13965. HELP_MOBILE_MORE_INSIDE_B: "Нажмите, чтобы просмотреть модель изнутри.",
  13966. HELP_MORE_VR_A: "Режим VR",
  13967. HELP_DESKTOP_MORE_VR_B: "Нажмите, чтобы запустить модель в виртуальной реальности.",
  13968. HELP_MOBILE_MORE_VR_B: "Нажмите, чтобы запустить модель в виртуальной реальности.",
  13969. HELP_MORE_360_A: "360° Views",
  13970. HELP_DESKTOP_MORE_360_B: "Нажмите на “360 Views” в фотоколлаже, чтобы просмотреть внешний пейзаж.",
  13971. HELP_MOBILE_MORE_360_B: "Нажмите на “360 Views” в фотоколлаже, чтобы просмотреть внешний пейзаж.",
  13972. HELP_MORE_FULLSCREEN_A: "Полный экран",
  13973. HELP_DESKTOP_MORE_FULLSCREEN_B: "Развернуть 3D Showcase во весь экран.",
  13974. WEBVR_FOR_CARDBOARD: "Для Google Cardboard",
  13975. WEBVR_FOR_DAYDREAM: "Для просмотра в Daydream",
  13976. WEBVR_ENTER_WEBVR: "ВОЙТИ В VR ",
  13977. WEBVR_DIFFERENT_HEADSET: "Есть другой VR-шлем?",
  13978. WEBVR_LEARN_MORE: "Узнать больше",
  13979. WEBVR_VIEW_SPACE: "Запустить модель в VR",
  13980. WEBVR_DAYDREAM_VIEW: "Посмотреть в Daydream",
  13981. WEBVR_DAYDREAM_PHONE: "Daydream-готовый телефон",
  13982. WEBVR_VIEW_CARDBOARD: "Или просмотреть в Google Cardboard",
  13983. VR_WHAT_YOU_NEED: "Что Вам потребуется...",
  13984. VR_NEED_DAYDREAM_PHONE: "Daydream-готовый телефон",
  13985. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13986. VR_APP: "port VR App",
  13987. VR_APP_OPEN: "Или открыть через приложение port VR",
  13988. VR_COMPATIBLE_ANDROID_LONG: 'Совместимые Android устройства с диагональю экрана 4.5"-5.5" дюймов и Android версией 4.4.4, и выше',
  13989. VR_SAMSUNG_DETAIL: "Galaxy S6 и выше",
  13990. VR_APP_FOR_ANDROID: "Приложение port VR для Android",
  13991. VR_NEED_DAYDREAM: "Необходимо для соединением с Daydream",
  13992. VR_VIEW_SPACE: "Запустить модель в VR",
  13993. VR_LEARN_MORE_CAPS: "УЗНАТЬ БОЛЬШЕ",
  13994. VR_PREVIOUS_CAPS: "ПРЕДЫДУЩИЙ",
  13995. VR_NEXT_CAPS: "СЛЕДУЮЩИЙ",
  13996. VR_GOT_IT_CAPS: "ЯСНО",
  13997. VR_SHOW_SUPPORTED: "Нажмите, чтобы просмотреть модель в VR с помощью",
  13998. VR_SHOW_UNSUPPORTED: "Извините, но Ваше устройство не соответствует минимальным требованиям для просмотра модели в VR.",
  13999. VR_SHOW_IOS_1: "Нажмите, чтобы просмотреть модель в VR",
  14000. VR_SHOW_IOS_2: "Для просмотра требуется приложение port VR и совместимый iPhone",
  14001. VR_NEED_CARDBOARD: "Что Вам потребуется для Google Cardboard",
  14002. VR_NEED_SAMSUNG: "Что Вам потребуется для Samsung Gear VR",
  14003. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  14004. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  14005. VR_COMPATIBLE_IPHONES_1: "iPhones",
  14006. VR_COMPATIBLE_IPHONES_2: "iPhone 5s или новее с iOS 9.1 и выше",
  14007. VR_COMPATIBLE_IPHONES_3: "Совместимые модели iPhone",
  14008. VR_COMPATIBLE_ANDROID: "Совместимые Android устройства",
  14009. VR_ANDROID_DETAIL: 'Экран от 4.5" до 5.5" и Android 4.4.4, и выше',
  14010. VR_ANDROID_DVICES: "Android устройства",
  14011. VR_COMPATIBLE_SAMSUNG: "Совместимые Samsung устройства",
  14012. VR_APP_FOR_CARDBOARD: "Приложение port VR для Google Cardboard",
  14013. VR_APP_FOR_SAMSUNG: "Приложение port VR для Gear VR",
  14014. VR_DOWNLOAD_HERE: "Скачать здесь",
  14015. VR_REQUIRE_HEADSET: "Требуется VR-шлем и установленное приложение port VR для Android",
  14016. VR_REDIRECT_TO_STORE: "Если приложение не установлено, Вы будете перенаправлены на страницу магазина приложений.",
  14017. VR_IMPROPER_EMBED: "port модель не встроена должным образом для поддержки VR в вашем веб-браузере.",
  14018. VR_OPEN_ANDROID_LINK: "Откройте ссылку на Вашем мобильном телефоне",
  14019. VR_ANDROID_OPTIONS: "Доступные опции VR-шлемов",
  14020. SHARE_TO: "Поделиться",
  14021. SHARE_LINK: "Прямая ссылка",
  14022. SHARE_EXPLORE: "просмотреть",
  14023. SHARE_AT: "на",
  14024. SHARE_WITH: "с",
  14025. SHARE_3D: "в 3D",
  14026. SHARE_COPIED: "Скопировано!",
  14027. ERROR_BROWSER_SOLUTION: "установите новый браузер, чтобы просмотреть 3D пространство.",
  14028. ERROR_BROWSER_EXPLANATION: "WebGL требует современный браузер.",
  14029. ERROR_GENERIC_PROBLEM: "Ой, что-то пошло не так.",
  14030. ERROR_GENERIC_SOLUTION: "Перезапустите браузер.",
  14031. ERROR_GENERIC_ACTIONS_1: "Если проблема не устранена, ",
  14032. ERROR_GENERIC_ACTIONS_2: "установите поддерживаемый браузер",
  14033. ERROR_GENERIC_ACTIONS_3: " или ",
  14034. ERROR_GENERIC_ACTIONS_4: "смотрите наше руководство по устранению неполадок",
  14035. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Браузер не поддерживается.",
  14036. ERROR_WEBGL_IOS_PROBLEM: "iOS-версия не поддерживается.",
  14037. ERROR_WEBGL_IOS_SOLUTION: "Обновите до iOS 8 или выше, чтобы просмотреть пространство в 3D.",
  14038. ERROR_WEBGL_IOS_ACTIONS_1: "Нажмите ",
  14039. ERROR_WEBGL_IOS_ACTIONS_2: "Настройки > Общие > Обновление ПО",
  14040. ERROR_WEBGL_SAFARI_PROBLEM: "Включите WebGL для 3D-просмотра.",
  14041. ERROR_WEBGL_SAFARI_ACTIONS_1: "Нажмите ",
  14042. ERROR_WEBGL_SAFARI_ACTIONS_2: "Настойки > Дополнения > Показывать меню “Разработка” в строке меню",
  14043. ERROR_WEBGL_SAFARI_ACTIONS_3: "Затем нажмите ",
  14044. ERROR_WEBGL_SAFARI_ACTIONS_4: "Разработка > Разрешить WebGL",
  14045. ERROR_MISSING_URLS_PROBLEM: "Ой, для этой модели нет панорамы.",
  14046. ERROR_MISSING_URLS_EXPLANATION: "Эта модель устарела. У владельца веб-сайта может быть новая модель.",
  14047. ERROR_LOADING_FAILED_PROBLEM: "Ой, модель недоступна.",
  14048. ERROR_LOADING_FAILED_ACTIONS_1: "Если проблема не устранена, ",
  14049. ERROR_LOADING_FAILED_ACTIONS_2: "посмотрите наше руководство по устранению неполадок",
  14050. ERROR_MAINTENANCE_PROBLEM: "Выполняется техническое обслуживание.",
  14051. ERROR_MAINTENANCE_SOLUTION: "Пожалуйста, попробуйте снова через несколько минут.",
  14052. LINK_TO_LOCATION: "Ссылка на местоположение",
  14053. MENU_COPY: "Копировать",
  14054. LINK_ALERT_COPY: "Для того, чтобы скопировать, пожалуйста, используйте CTRL/CMD + C.",
  14055. ROTATE: "Вращать",
  14056. MOVE: "Передвигаться",
  14057. INSIDE: "Вид изнутри",
  14058. ZOOM: "Масштаб"
  14059. }
  14060. }
  14061. , {}],
  14062. 116: [function(e, t, i) {//main.js
  14063. (function(t) {
  14064. "use strict";
  14065. var modelProgressBase = 0.4;
  14066. var progressUpdate = function(e){ // 0 <= e <= 1
  14067. console.log('e1:'+e)
  14068. e = Math.round(modelProgressBase * e * 100);
  14069. console.log('e2:'+e)
  14070. var t = $('.progressbar');
  14071. t.find('.bar').css('width',e+'%');
  14072. t.find('.label').css('left', t.width() * e / 100 - 15 + 'px' ); //上面跟着的字的百分比
  14073. t.find('.perc').text(e +'%'); //具体数字的百分比
  14074. }
  14075. $('#gui-loading').fadeIn(200);
  14076. progressUpdate(0.1)
  14077. var fileName = g_version ? 'modeldata.js' : 'someData.json' ;
  14078. $.ajax(g_Prefix + "data/"+window.number+"/"+fileName+"?"+randomTime().getTime(),{dataType: "json"}).done( function(e){ //改
  14079. var data = matcher(e);
  14080. data.files.templates[0] = g_Prefix + e.files.templates[0].replace("{{number}}",window.number);
  14081. data.user = {
  14082. "is_authenticated": false,
  14083. "flags": ["payment_show_past_due", "sc_imgopt_100", "mattertags", "labels", "fastly_v2_urls", "vr", "uhql", "sc_segment_100", "show_segment_metrics", "content_distribution", "workshop_webgl", "show360views", "showcase_vr", "ws_zooming", "model_settings", "ws_360snapshots", "img_multi_dl", "vrworkshop", "tag_links", "ws_img_multi_dl", "mattertag_links", "billing_tab_hidden", "static_cloud_ui", "metrics", "mattertag_media", "img_size_download", "show_360snapshots", "floorplan", "sc_tilegen_0", "showcase_webvr", "sc_mixpanel_0", "show_clickbait", "zooming", "showcase_tiling", "list_signed_urls_default_3", "fastly_image_opto"]
  14084. }
  14085. window.MP_PREFETCHED_MODELDATA = data;
  14086. progressUpdate(0.7);
  14087. StartLoad(); //xzw someData.js是我整合的 原本在html里 但这样每个场景的html都不一样了
  14088. })
  14089. function StartLoad(){//当加载完data后
  14090. function i() {
  14091. var e = Y.getModelIDFromQueryString();
  14092. if (!e)
  14093. return b(null, "loading-failed");
  14094. var t = Y.parseSidUrl(e)
  14095. , i = l()
  14096. , a = c()
  14097. , s = o()
  14098. , u = V.quickstart.enabled
  14099. , g = null
  14100. , m = null
  14101. , v = null
  14102. , w = null
  14103. , T = null
  14104. , x = null
  14105. , S = null
  14106. , M = null
  14107. , R = null
  14108. , P = null
  14109. , O = null
  14110. , L = null
  14111. , N = new ue;
  14112. r(s);
  14113. h({ //MP开头写法
  14114. urlBase: t.urlBase
  14115. }).then(function() {
  14116. return re.init(),
  14117. d(t, e) //getModel and load
  14118. }).then(function(e) {
  14119. progressUpdate(0.9)
  14120. return P = e,
  14121. p(P, V.appConfig.segment_key, V.appConfig.keen_write_key, V.appConfig.keen_project_id, {
  14122. startSource: i,
  14123. autoplay: V.autoplay,
  14124. quickstart: u
  14125. }),
  14126. P.urls.init()
  14127. }).then(function() {
  14128. return P.loadPanos()
  14129. }).then(function() {
  14130. m = X.getStartCameraOptions(P, P.panos),
  14131. S = A(P),
  14132. O = y(u, m.mode),
  14133. v = O.controls,
  14134. w = O.player,
  14135. T = O.director,
  14136. x = O.tagManager,
  14137. M = O.tileDownloader,
  14138. R = O.qualityManager,
  14139. L = O.panoRenderer,
  14140. C(P, S, O, s),
  14141. w.director = T,//xzw add
  14142. P.supportsTiles && M.start(),
  14143. !u || m.mode === D.PANORAMA && m.pano || (de.warn("Tried to quickstart, but failed as we are not starting in inside mode."),
  14144. u = !1);
  14145. var e = null;
  14146. if (u) {
  14147. de.warn("Quickstart engaged. Hold on to your knickers.");
  14148. var t = v.controls[D.PANORAMA];
  14149. g = new ie(R,S.scene,S.camera,t,s),
  14150. _(S, s, P),
  14151. e = g.load(m).then(function() {
  14152. S.addComponent(g),
  14153. S.once(le.AfterRender, function() {
  14154. de.warn("First render after quickstart load finished.")
  14155. })
  14156. })
  14157. }
  14158. window.flyToFirst = function(){//xzw add
  14159. var pano = w.model.panos.get("8d778e19657f433fb9cf8947d823bb70");
  14160. var q = new _x.Quaternion(0.7099827027821568,-0.07708150183830938,0.6958985789714591,0.07555241737970636);
  14161. var lookAtPoint = new _x.Vector3(0,0,-1).applyQuaternion(q).add(pano.position);
  14162. w.flyToPano({pano:pano, lookAtPoint:lookAtPoint})
  14163. };
  14164. return $.when(e, U.startLoading(P, w, T, V.autoplay, u, N))
  14165. }).then(function() {
  14166. return f(P, U.onProgress, i, !u, a)
  14167. }).then(function() {
  14168. if (m.quickstart = u,
  14169. I(P, S, O, s),
  14170. S.started || _(S, s, P),
  14171. H.modelLoaded(P, w, v, V.autoplay),
  14172. E(w, P, m, V.autoplay).done(function() {
  14173. T.autoTour()
  14174. }),
  14175. !P.supportsTiles) {
  14176. var e = new Z(P,w);
  14177. e.start()
  14178. }
  14179. u && (S.removeComponent(g),
  14180. g.destroy(),
  14181. m.pano.enter()),
  14182. U.init(P, T, w, v, S, m, H.getSessionId()),
  14183. U.endLoading(P, T, x),
  14184. S.once(le.AfterRender, function() {
  14185. N.setAppReadyTime();
  14186. var e = N.calcFullLoadingTime();
  14187. de.warn("Total load time: " + e / 1e3),
  14188. H.loadComplete(e),
  14189. de.warn("First render after model load finished.")
  14190. }),
  14191. S.on(le.MemoryUsageUpdated, n)
  14192. }).fail(b.bind(this, e))
  14193. }
  14194. function n(e) {
  14195. ce.update(e)
  14196. }
  14197. function r(e) {
  14198. de.info("Version", "2.25.6-0-gd87e5b1"),
  14199. q.defaultMaxListeners = 1e3,
  14200. a(e),
  14201. s()
  14202. }
  14203. function o() {
  14204. return document.getElementById("player")
  14205. }
  14206. function a(e) {
  14207. e.addEventListener("dragenter", T, !1),
  14208. e.addEventListener("dragover", T, !1)
  14209. }
  14210. function s() {
  14211. F.valueFromHash("title", !0) || $(document).ready(function() {
  14212. var e = $(".model-title");
  14213. e.hide()
  14214. })
  14215. }
  14216. function l() {
  14217. return F.valueFromHash("play", !1) ? "autoplay" : F.inIframe() ? "click" : "fullpage"
  14218. }
  14219. function c() {
  14220. return {
  14221. panoElementsToLoad: 6,
  14222. modelElementsToLoad: 0,
  14223. totalElementsLoaded: 0,
  14224. totalElementsToLoad: 0,
  14225. totalPercentageLoaded: 0,
  14226. progressCallback: null
  14227. }
  14228. }
  14229. function h(e) {
  14230. return K.loadFeatureFlags(e).done(function(e) {
  14231. K.updateDependentSettings(e, V)
  14232. })
  14233. }
  14234. // function u(e) {
  14235. // return Q.get(e.urlBase + "/api/v1/config/showcase", {
  14236. // responseType: "json",
  14237. // prefetchFrom: "config"
  14238. // }).then(function(e) {
  14239. // return e ? void j.extendObject(V.appConfig, e) : {}
  14240. // }, function(e) {
  14241. // return de.warn("Failed loading runtime config, using defaults."),
  14242. // $.when({})
  14243. // })
  14244. // }
  14245. function d(e, t) {
  14246. var i = B.getModel({
  14247. url: t,
  14248. floors: F.valueFromHash("f", !0),
  14249. autoload: !1
  14250. })
  14251. ;
  14252. return $.when(i, n).then(null, function(e) {
  14253. return this
  14254. })
  14255. }
  14256. function p(e, t, i, n, r) {
  14257. de.info("Model data loaded"),
  14258. de.debug("UUID: " + e.data.job.uuid),
  14259. J.init(K.getFlags()),
  14260. i && H.initKeen({
  14261. token: i,
  14262. appId: n
  14263. }),
  14264. H.initSegment({
  14265. model: e.sid,
  14266. version: "2.25.6-0-gd87e5b1",
  14267. startSource: r.startSource,
  14268. token: t,
  14269. autoplay: r.autoplay,
  14270. quickstart: r.quickstart
  14271. })
  14272. }
  14273. function f(e, t, i, n, r) {
  14274. return r.progressCallback = t,
  14275. H.sessionStart(),
  14276. e.load(n).progress(g.bind(this, r))
  14277. }
  14278. function g(e, t) {
  14279. e.modelElementsToLoad = t[1],
  14280. v(e),
  14281. m(e)
  14282. }
  14283. function m(e) {
  14284. e.totalElementsLoaded++,
  14285. e.totalPercentageLoaded = e.totalElementsLoaded / e.totalElementsToLoad,
  14286. //----许钟文-----------------模型进度条向后调整
  14287. isNaN(e.totalPercentageLoaded) && (e.totalPercentageLoaded = 0);
  14288. e.totalPercentageLoaded = modelProgressBase + (1-modelProgressBase)*e.totalPercentageLoaded;
  14289. console.log('pro:'+e.totalPercentageLoaded)
  14290. //---------------------------
  14291. e.progressCallback && e.progressCallback(100 * e.totalPercentageLoaded)
  14292. }
  14293. function v(e) {
  14294. e.totalElementsToLoad = e.modelElementsToLoad + e.panoElementsToLoad
  14295. }
  14296. function A(e) {
  14297. var t = new x.PerspectiveCamera;
  14298. t.layers.enable(he.PANOMARKERS),
  14299. t.layers.enable(he.RETICULE),
  14300. t.layers.enable(he.TAG);
  14301. var i = new x.Scene
  14302. , n = new x.AmbientLight(16777215);
  14303. i.add(n),
  14304. i.skybox = new W,
  14305. i.add(i.skybox),
  14306. i.plane = new x.Mesh(new x.PlaneBufferGeometry(1e5,1e5),new x.RawShaderMaterial({
  14307. side: x.DoubleSide
  14308. })),
  14309. i.plane.position.y = 0,
  14310. i.plane.rotateX(-Math.PI / 2),
  14311. i.plane.material.visible = !1,
  14312. i.add(i.plane),
  14313. i.updateMatrixWorld(),
  14314. V.showScreenshotLocations && e.data.images.forEach(function(e) {
  14315. if (e.metadata && e.metadata.camera_position) {
  14316. var t = e.metadata.camera_position
  14317. , n = new x.Mesh(new x.BoxGeometry(.3,.3,.3));
  14318. n.position = t.clone(),
  14319. i.add(n);
  14320. var r = e.metadata.camera_quaternion
  14321. , o = new x.Vector3(0,0,-1).applyQuaternion(r);
  14322. i.add(new x.ArrowHelper(o,t.clone(),1,16711680))
  14323. }
  14324. }),
  14325. V.showAxis && (i.add(new x.ArrowHelper(new x.Vector3(0,1,0),new x.Vector3(0,0,0),1,255)),
  14326. i.add(new x.ArrowHelper(new x.Vector3(0,0,1),new x.Vector3(0,0,0),1,16711680)),
  14327. i.add(new x.ArrowHelper(new x.Vector3(1,0,0),new x.Vector3(0,0,0),1,65280)));
  14328. var r = new te(i,t,z);
  14329. return r
  14330. }
  14331. function y(e, t) {
  14332. var i = e ? 1 : 1e3
  14333. , n = J.tilegen || J.imgopt ? 6 : 2;
  14334. n = F.valueFromHash("tileconc", n);
  14335. var r = new ne
  14336. , o = new ae({
  14337. concurrentDownloads: n
  14338. })
  14339. , a = new se
  14340. , s = new P
  14341. , l = new M
  14342. , c = new S(t)
  14343. , h = new R
  14344. , u = new O(i)
  14345. , d = new L
  14346. , p = new oe;
  14347. return {
  14348. qualityManager: r,
  14349. panoRenderer: a,
  14350. tileDownloader: o,
  14351. player: c,
  14352. director: l,
  14353. modelManager: s,
  14354. tagManager: p,
  14355. displayController: u,
  14356. labelDisplayController: d,
  14357. controls: h
  14358. }
  14359. }
  14360. function C(e, t, i, n) {
  14361. var r = i.controls
  14362. , o = i.qualityManager
  14363. , a = i.panoRenderer
  14364. , s = i.tileDownloader
  14365. , l = i.modelManager;
  14366. r.init(n, l),
  14367. ee.init(i.director, r, i.player, l, t),
  14368. o.init(l),
  14369. s.init(o),
  14370. a.init(t, s, o),
  14371. l.init(s, a, o),
  14372. l.addModel(e),
  14373. t.addComponent(G)
  14374. }
  14375. function I(e, t, i, n) {
  14376. var r = i.qualityManager
  14377. , o = i.panoRenderer
  14378. , a = i.tileDownloader
  14379. , s = i.modelManager
  14380. , l = i.player
  14381. , c = i.director
  14382. , h = i.tagManager
  14383. , u = i.displayController
  14384. , d = i.labelDisplayController
  14385. , p = i.controls;
  14386. t.scene.add(e),
  14387. t.qualityManager = r;
  14388. var f = {
  14389. camera: t.camera,
  14390. director: c,
  14391. modelManager: s,
  14392. tileDownloader: a,
  14393. panoRenderer: o,
  14394. qualityManager: r,
  14395. tagManager: h,
  14396. container: n,
  14397. controls: p
  14398. };
  14399. l.init(f),
  14400. l.setScene(t.scene),
  14401. h.init(s, l),
  14402. c.init(l, s),
  14403. u.init(c, l, s, h, n),
  14404. d.init(l, s, n),
  14405. z.bindEvents(l),
  14406. t.addComponent(h),
  14407. t.addComponent(l),
  14408. t.addComponent(o),
  14409. l.sceneRenderer = t; //xzw add 方便resize
  14410. }
  14411. function E(e, t, i, n) {
  14412. return de.info("Starting player in " + i.mode),
  14413. H.report(t.sid, "started-playing", n, i.quickstart),
  14414. e.start(i)
  14415. }
  14416. function b(e, t) {
  14417. de.error(t),
  14418. k.error(t),
  14419. H.report(e, "error-" + t)
  14420. }
  14421. function w(e) {
  14422. var t = F.details();
  14423. t && "Safari" === t.name && t.version > 500 && t.version < 600 ? (k.error("webgl-safari"),
  14424. H.report(e, "error-webgl-safari")) : (k.error("webgl-generic"),
  14425. H.report(e, "error-webgl-generic"))
  14426. }
  14427. function _(e, t, i) {
  14428. try {
  14429. e.start(t)
  14430. } catch (e) {
  14431. throw de.warn(e.message),
  14432. w(i.sid),
  14433. e
  14434. }
  14435. }
  14436. function T(e) {
  14437. e.stopPropagation(),
  14438. e.preventDefault()
  14439. }
  14440. //czj 判断someData 有没有hoticon字段 修改热点的样式
  14441. if (window.MP_PREFETCHED_MODELDATA.hoticon){
  14442. g_HotImage = {
  14443. "point": window.MP_PREFETCHED_MODELDATA.hoticon.default,
  14444. "point2": window.MP_PREFETCHED_MODELDATA.hoticon.higt
  14445. }
  14446. }
  14447. //czj 判断someData 有没有backgroundMusic 添加音乐
  14448. if (window.MP_PREFETCHED_MODELDATA.backgroundMusic) {
  14449. console.log
  14450. g_bgAudio.src = rootPath + window.MP_PREFETCHED_MODELDATA.backgroundMusic;
  14451. $("#volume").show();
  14452. }else if (g_version === "one"){
  14453. g_bgAudio.src = g_Prefix+"/audio/"+"audio"+window.number + "/background.mp3";
  14454. }
  14455. //隐藏公司logo
  14456. if(window.MP_PREFETCHED_MODELDATA.loadlogo){
  14457. showLogo();
  14458. }
  14459. e("./lib/three75-shim"),
  14460. e("./lib/array-polyfill"),
  14461. e("./lib/performance-polyfill"),
  14462. e("./lib/shaders/CopyShader.js"),
  14463. e("./lib/shaders/HorizontalBlurShader.js"),
  14464. e("./lib/shaders/VerticalBlurShader.js"),
  14465. e("./lib/postprocessing/EffectComposer.js"),
  14466. e("./lib/postprocessing/RenderPass.js"),
  14467. e("./lib/postprocessing/MaskPass.js"),
  14468. e("./lib/postprocessing/ShaderPass.js"),
  14469. window.Promise || (window.Promise = e("promise-polyfill"));
  14470. var x = e("three")
  14471. , _x = e("three")
  14472. , S = (e("./util/sentry"),
  14473. e("./player"))
  14474. , M = e("./director")
  14475. , R = e("./controls/CameraControls")
  14476. , P = e("./model/ModelManager")
  14477. , O = e("./DisplayController")
  14478. , L = e("./label/LabelDisplayController")
  14479. , D = e("./enum/Viewmode")
  14480. , N = e("./util/logger")
  14481. , B = e("./showcase")
  14482. , F = e("./util/browser")
  14483. , V = e("./settings")
  14484. , U = e("./gui/gui")
  14485. , k = e("./gui/error")
  14486. , H = e("./analytics")
  14487. , G = e("./util/transitions")
  14488. , z = e("./effects")
  14489. , W = e("./objects/Skybox")
  14490. , j = e("./util/common")
  14491. , Y = (e("./util/PanoramaCollection"),
  14492. e("./util/math"),
  14493. e("./util/showcase"))
  14494. , X = e("./util/camera")
  14495. , Z = (e("./objects/Panorama"),
  14496. e("./cameras/PanoramaCamera"),
  14497. e("./preloaders"))
  14498. , q = e("events").EventEmitter
  14499. , K = e("./featureflags")
  14500. , Q = (e("./util/lerp"),
  14501. e("./util/ajax"))
  14502. , J = e("./ab")
  14503. , ee = e("./sdk/automation.js")
  14504. , te = e("./scene/SceneRenderer")
  14505. , ie = e("./scene/QuickstartManager")
  14506. , ne = e("./tile/QualityManager.js")
  14507. , re = e("./localization/localize")
  14508. , oe = e("./tag/tagManager")
  14509. , ae = e("./tile/TileDownloader")
  14510. , se = e("./tile/PanoRenderer")
  14511. , le = (e("./enum/PanoSizeClass"),
  14512. e("./enum/PanoramaEvents"),
  14513. e("./enum/SceneRendererEvents"))
  14514. , ce = e("./gui/memoryUsage")
  14515. , he = e("./enum/RenderLayers")
  14516. , ue = e("./TimingData")
  14517. , de = new N(t);
  14518. N.level = V.logLevel,
  14519. N.consoleEnabled = V.console,
  14520. i()
  14521. }
  14522. }
  14523. ).call(this, "/js/main.js")
  14524. }
  14525. , {
  14526. "./DisplayController": 1,
  14527. "./TimingData": 2,
  14528. "./ab": 3,
  14529. "./analytics": 4,
  14530. "./cameras/PanoramaCamera": 7,
  14531. "./controls/CameraControls": 9,
  14532. "./director": 15,
  14533. "./effects": 16,
  14534. "./enum/PanoSizeClass": 36,
  14535. "./enum/PanoramaEvents": 37,
  14536. "./enum/RenderLayers": 41,
  14537. "./enum/SceneRendererEvents": 43,
  14538. "./enum/Viewmode": 51,
  14539. "./featureflags": 59,
  14540. "./gui/error": 64,
  14541. "./gui/gui": 65,
  14542. "./gui/memoryUsage": 73,
  14543. "./label/LabelDisplayController": 91,
  14544. "./lib/array-polyfill": 92,
  14545. "./lib/performance-polyfill": 95,
  14546. "./lib/postprocessing/EffectComposer.js": 96,
  14547. "./lib/postprocessing/MaskPass.js": 97,
  14548. "./lib/postprocessing/RenderPass.js": 98,
  14549. "./lib/postprocessing/ShaderPass.js": 99,
  14550. "./lib/shaders/CopyShader.js": 100,
  14551. "./lib/shaders/HorizontalBlurShader.js": 101,
  14552. "./lib/shaders/VerticalBlurShader.js": 102,
  14553. "./lib/three75-shim": 103,
  14554. "./localization/localize": 108,
  14555. "./tag/tagManager": 124,
  14556. "./model/ModelManager": 140,
  14557. "./objects/Panorama": 148,
  14558. "./objects/Skybox": 152,
  14559. "./player": 155,
  14560. "./preloaders": 156,
  14561. "./scene/QuickstartManager": 157,
  14562. "./scene/SceneRenderer": 158,
  14563. "./sdk/automation.js": 164,
  14564. "./settings": 166,
  14565. "./showcase": 168,
  14566. "./tile/PanoRenderer": 169,
  14567. "./tile/QualityManager.js": 170,
  14568. "./tile/TileDownloader": 171,
  14569. "./util/PanoramaCollection": 178,
  14570. "./util/ajax": 181,
  14571. "./util/browser": 182,
  14572. "./util/camera": 183,
  14573. "./util/common": 185,
  14574. "./util/lerp": 188,
  14575. "./util/logger": 189,
  14576. "./util/math": 190,
  14577. "./util/sentry": 192,
  14578. "./util/showcase": 193,
  14579. "./util/transitions": 195,
  14580. events: 202,
  14581. "promise-polyfill": 213,
  14582. three: 217
  14583. }],
  14584. 117: [function(e, t, i) {
  14585. "use strict";
  14586. function n(e) {
  14587. e = e || {},
  14588. r.RawShaderMaterial.call(this, a.extendObject({
  14589. fragmentShader: o.cube.fragmentShader,
  14590. vertexShader: o.cube.vertexShader,
  14591. uniforms: r.UniformsUtils.clone(o.cube.uniforms),
  14592. name: "CubemapMaterial"
  14593. }, e))
  14594. }
  14595. var r = e("three")
  14596. , o = e("../shaders")
  14597. , a = e("../util/common");
  14598. n.prototype = Object.create(r.RawShaderMaterial.prototype),
  14599. n.prototype.constructor = n,
  14600. t.exports = n
  14601. }
  14602. , {
  14603. "../shaders": 167,
  14604. "../util/common": 185,
  14605. three: 217
  14606. }],
  14607. 118: [function(e, t, i) {
  14608. "use strict";
  14609. function n(e) {
  14610. e = e || {},
  14611. r.RawShaderMaterial.call(this, a.extendObject({
  14612. fragmentShader: o.model.fragmentShader,
  14613. vertexShader: o.model.vertexShader,
  14614. uniforms: r.UniformsUtils.clone(o.model.uniforms),
  14615. name: "ModelTextureMaterial"
  14616. }, e))
  14617. }
  14618. var r = e("three")
  14619. , o = e("../shaders")
  14620. , a = e("../util/common");
  14621. n.prototype = Object.create(r.RawShaderMaterial.prototype),
  14622. n.prototype.constructor = n,
  14623. n.prototype.setProjectedPanos = function(e, t, i) {
  14624. i && (this.uniforms.progress.value = 0),
  14625. e.ensureSkyboxReadyForRender(),
  14626. this.uniforms.pano0Map.value = e.getSkyboxTexture(),
  14627. this.uniforms.pano0Position.value.copy(e.position),
  14628. this.uniforms.pano0Matrix.value.copy(e.skyboxMesh.matrixWorld),
  14629. t.ensureSkyboxReadyForRender(),
  14630. this.uniforms.pano1Map.value = t.getSkyboxTexture(),
  14631. this.uniforms.pano1Position.value.copy(t.position),
  14632. this.uniforms.pano1Matrix.value.copy(t.skyboxMesh.matrixWorld)
  14633. }
  14634. ,
  14635. t.exports = n
  14636. }
  14637. , {
  14638. "../shaders": 167,
  14639. "../util/common": 185,
  14640. three: 217
  14641. }],
  14642. 119: [function(e, t, i) {
  14643. (function(i) {
  14644. "use strict";
  14645. function n(e, t, i, n) {
  14646. this.div = null,
  14647. this.body = null,
  14648. this.label = e,
  14649. this.description = t,
  14650. this.parsedDescription = [],
  14651. this.media = i || {
  14652. type: null
  14653. },
  14654. this.loadingSpinner = null,
  14655. this.parser = new r({
  14656. supportLinks: !u.valueFromHash("mls"),
  14657. keepLinkLabels: !0
  14658. }),
  14659. this.state = I.CLOSED,
  14660. this.orientation = "",
  14661. this.initialTransform = "",
  14662. this.hovering = !1,
  14663. this.openTransition = null,
  14664. this.closeTransition = null,
  14665. this.openPromise = null,
  14666. this.closePromise = null,
  14667. this.animationTransition = null,
  14668. this.animationScale = 0
  14669. }
  14670. var r = e("../Parser/DescriptionParser")
  14671. , o = e("../Media/Link")
  14672. , a = e("../Media/Image")
  14673. , s = e("../Media/EmbedlyPlayer")
  14674. , l = e("../Media/EmbedlyEmbed")
  14675. , c = e("../../util/transitions")
  14676. , h = e("../../util/lerp")
  14677. , u = e("../../util/browser")
  14678. , d = e("./BillboardEvent")
  14679. , p = e("../Media/MediaEvent")
  14680. , f = e("../Parser/DescriptionChunkType")
  14681. , g = e("events").EventEmitter
  14682. , m = e("./billboardSettings")
  14683. , v = e("./overlaySettings")
  14684. , A = e("../../util/logger")
  14685. , y = new A(i)
  14686. , C = document.getElementById("tag-billboards");
  14687. C.addEventListener("touchend", function(e) {
  14688. C.style.pointerEvents = "none"
  14689. }),
  14690. C.addEventListener("touchcancel", function(e) {
  14691. C.style.pointerEvents = "none"
  14692. });
  14693. var I = {
  14694. CLOSED: "closed",
  14695. OPENING: "opening",
  14696. OPEN: "open",
  14697. CLOSING: "closing",
  14698. ACTIVE: "active"
  14699. };
  14700. n.prototype = Object.create(g.prototype),
  14701. n.prototype.build = function(e) {
  14702. this.parsedDescription = this.parser.parse(this.description);
  14703. var t = document.createElement("div");
  14704. t.className = "tag-container has-hotzone",
  14705. this.div = t,
  14706. this.body = document.createElement("div"),
  14707. this.body.className = "tag-body";
  14708. var i = document.createElement("div");
  14709. i.classList.add("tag-content");
  14710. var n = document.createElement("div");
  14711. n.classList.add("tag-text-content");
  14712. var r = document.createElement("div");
  14713. r.className = "tag-label",
  14714. r.textContent = this.label,
  14715. n.appendChild(r);
  14716. var o = document.createElement("div");
  14717. o.className = "tag-desc",
  14718. n.appendChild(o),
  14719. i.appendChild(n),
  14720. this.body.appendChild(i),
  14721. this.appendDescriptionElements(this.parsedDescription, o),
  14722. this.appendMedia(),
  14723. t.appendChild(this.body),
  14724. C.appendChild(t),
  14725. this.bindEvents(t, this.body)
  14726. }
  14727. ,
  14728. n.prototype.bindEvents = function(e, t) {
  14729. var i = function(e) {
  14730. return function(t) {
  14731. if (!this.div.classList.contains("overlay")) {
  14732. var i, n = document.getElementById("player");
  14733. try {
  14734. i = new MouseEvent(e,t)
  14735. } catch (n) {
  14736. i = document.createEvent("MouseEvents"),
  14737. 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)
  14738. }
  14739. n.dispatchEvent(i)
  14740. }
  14741. }
  14742. };
  14743. t.addEventListener("mousedown", function(e) {
  14744. e.stopPropagation()
  14745. }),
  14746. t.addEventListener("mouseup", function(e) {
  14747. e.stopPropagation()
  14748. }),
  14749. e.addEventListener("touchstart", function(e) {
  14750. C.style.pointerEvents = "auto"
  14751. }),
  14752. e.addEventListener("mousedown", i("mousedown").bind(this)),
  14753. e.addEventListener("mouseup", i("mouseup").bind(this)),
  14754. t.addEventListener("mouseover", function(t) {
  14755. this.state === I.OPEN && e.classList.remove("has-hotzone")
  14756. }
  14757. .bind(this)),
  14758. e.addEventListener("mouseenter", function(e) {
  14759. this.state !== I.CLOSING && (this.hovering = !0,
  14760. this.emit(d.ENTER))
  14761. }
  14762. .bind(this)),
  14763. e.addEventListener("mouseleave", function(e) {
  14764. this.hovering = !1,
  14765. this.emit(d.LEAVE)
  14766. }
  14767. .bind(this)),
  14768. e.addEventListener("gesturestart", function(e) {
  14769. e.preventDefault()
  14770. });
  14771. var n = e.querySelector(".tag-text-content")
  14772. , r = 0;
  14773. n.addEventListener("touchstart", function(e) {
  14774. r = e.changedTouches[0].clientY
  14775. }),
  14776. n.addEventListener("touchmove", function(t) {
  14777. function i(e) {
  14778. e && (0 === e.scrollTop && t.changedTouches[0].clientY > r || e.scrollTop + e.clientHeight - e.scrollHeight === 0 && t.changedTouches[0].clientY < r) && t.preventDefault()
  14779. }
  14780. return e.classList.contains("overlay") ? i(this.querySelector(".tag-desc")) : void i(this)
  14781. }),
  14782. e.addEventListener("touchmove", function(e) {
  14783. 0 === (n.compareDocumentPosition(e.target) & Node.DOCUMENT_POSITION_CONTAINED_BY) && e.preventDefault()
  14784. })
  14785. }
  14786. ,
  14787. n.prototype.appendDescriptionElements = function(e, t) {
  14788. e.length > 0 && this.div.classList.add("has-text"),
  14789. e.forEach(function(e, i) {
  14790. switch (e.type) {
  14791. case f.TEXT:
  14792. t.appendChild(this.createTextElement(e.text));
  14793. break;
  14794. case f.LINK:
  14795. t.appendChild(this.createLinkElement(e.link))
  14796. }
  14797. }
  14798. .bind(this))
  14799. }
  14800. ,
  14801. n.prototype.appendLoadingSpinner = function() {
  14802. this.loadingSpinner = document.createElement("div"),
  14803. this.loadingSpinner.classList.add("loading-spinner");
  14804. var e = document.createElement("div");
  14805. e.classList.add("gui-spinner-icon"),
  14806. this.loadingSpinner.appendChild(e),
  14807. this.body.appendChild(this.loadingSpinner)
  14808. }
  14809. ,
  14810. n.prototype.onMediaLoadFinished = function() {
  14811. this.loadingSpinner && (this.loadingSpinner.parentNode.removeChild(this.loadingSpinner),
  14812. this.applyOrientation(this.orientation),
  14813. this.loadingSpinner = null)
  14814. }
  14815. ,
  14816. n.prototype.appendMedia = function() {
  14817. if (this.media && this.media.type && "error" !== this.media.type && (!u.valueFromHash("mls", 0) || this.media.type === f.IMAGE)) {
  14818. this.appendLoadingSpinner();
  14819. var e = document.createElement("div");
  14820. e.classList.add("tag-media-content");
  14821. var t = document.createElement("i");
  14822. switch (["icon", "icon-close-thin", "close"].forEach(function(e) {
  14823. t.classList.add(e)
  14824. }),
  14825. this.body.appendChild(t),
  14826. this.body.appendChild(e),
  14827. this.media.type) {
  14828. case f.IMAGE:
  14829. e.appendChild(this.createImageElement(this.media, this.body));
  14830. break;
  14831. case f.VIDEO:
  14832. e.appendChild(this.createVideoElement(this.media, this.body));
  14833. break;
  14834. case f.RICH:
  14835. e.appendChild(this.createEmbedElement(this.media, this.body))
  14836. }
  14837. }
  14838. }
  14839. ,
  14840. n.prototype.createTextElement = function(e) {
  14841. var t = document.createElement("span");
  14842. return t.textContent = e,
  14843. t
  14844. }
  14845. ;
  14846. n.prototype.createLinkElement = function(e) {
  14847. var t = new o(e);
  14848. return t.on(p.LINK_CLICK, this.emit.bind(this, p.LINK_CLICK)),
  14849. t.createDomElement()
  14850. }
  14851. ,
  14852. n.prototype.createImageElement = function(e, t) {
  14853. function i() {
  14854. function e() {
  14855. m || (r.classList.remove("view-image"),
  14856. c.classList.add("overlay"),
  14857. i(),
  14858. window.addEventListener("resize", b),
  14859. c.addEventListener("click", a),
  14860. g.addEventListener("click", l),
  14861. f.addEventListener("click", s),
  14862. m = !0,
  14863. o.emit(p.IMAGE_OPENED))
  14864. }
  14865. function i() {
  14866. t.classList.add("show-info"),
  14867. h.classList.remove("collapsible"),
  14868. h.style.height = "";
  14869. var e = parseFloat(getComputedStyle(I).lineHeight)
  14870. , i = y + e
  14871. , r = c.clientWidth - 2 * v.boundaryWidth - C
  14872. , a = c.clientHeight - 2 * v.boundaryHeight - C - i
  14873. , s = a
  14874. , l = s * n.aspect;
  14875. l > r && (l = r,
  14876. s = l / n.aspect),
  14877. s > a && (s = a,
  14878. l = s * n.aspect),
  14879. l += C,
  14880. s += C + i,
  14881. t.style.width = l + "px",
  14882. t.style.height = s + "px",
  14883. u.style.paddingTop = e + C + "px",
  14884. o.description.length > 0 && (h.classList.add("collapsible"),
  14885. h.style.height = h.clientHeight + 12 + "px",
  14886. E.style.height = "calc(100% - " + I.clientHeight + "px)")
  14887. }
  14888. function a(e) {
  14889. e.target === c && s()
  14890. }
  14891. function s() {
  14892. m && (m = !1,
  14893. r.classList.add("view-image"),
  14894. c.classList.remove("overlay"),
  14895. h.style.height = "",
  14896. u.style.paddingTop = "",
  14897. t.style.width = "",
  14898. t.style.height = "",
  14899. window.removeEventListener("resize", b),
  14900. c.removeEventListener("click", a),
  14901. g.removeEventListener("click", l),
  14902. f.removeEventListener("click", s),
  14903. o.emit(p.IMAGE_CLOSED),
  14904. o.close(!0))
  14905. }
  14906. function l(e) {
  14907. t.classList.toggle("show-info")
  14908. }
  14909. var c = o.div
  14910. , h = c.getElementsByClassName("tag-content")[0]
  14911. , u = c.getElementsByClassName("tag-media-content")[0]
  14912. , f = t.getElementsByClassName("close")[0]
  14913. , g = h.getElementsByClassName("tag-label")[0];
  14914. c.classList.add("has-image"),
  14915. r.classList.add("view-image"),
  14916. c.classList.add(n.aspect >= 1 ? "image-landscape" : "image-portrait"),
  14917. o.applyOrientation(o.orientation);
  14918. var m = !1
  14919. , A = getComputedStyle(h)
  14920. , y = parseFloat(A.paddingTop) + parseFloat(A.paddingBottom)
  14921. , C = 2 * parseFloat(getComputedStyle(u).paddingLeft)
  14922. , I = h.querySelector(".tag-label")
  14923. , E = h.querySelector(".tag-desc")
  14924. , b = function() {
  14925. var e, t, n = 0;
  14926. return function() {
  14927. clearInterval(e),
  14928. clearTimeout(t),
  14929. e = setInterval(function() {
  14930. var e = c.clientHeight;
  14931. n !== e && (i(),
  14932. n = e)
  14933. }, 100),
  14934. t = setTimeout(clearInterval.bind(this, e), 1e3)
  14935. }
  14936. }();
  14937. n.on(p.IMAGE_OPENING, e),
  14938. o.on(d.ACTIVATE, e),
  14939. o.on(p.IMAGE_CLOSED, n.onClosed.bind(n)),
  14940. o.on(d.CLOSING, s)
  14941. }
  14942. var n = new a
  14943. , r = n.createDomElement();
  14944. this.once(d.OPENED, function() {
  14945. n.load(e.src).then(i).catch(function(t) {
  14946. y.warn("Failed to load image:", e.src),
  14947. y.warn("with error:", t)
  14948. }).then(this.onMediaLoadFinished.bind(this))
  14949. });
  14950. var o = this;
  14951. return r
  14952. }
  14953. ,
  14954. n.prototype.createVideoElement = function(e, t) {
  14955. var i = new s({
  14956. autoPlay: !0,
  14957. autoResume: !0,
  14958. startMuted: !1,
  14959. loop: !1
  14960. })
  14961. , n = i.createDomElement();
  14962. return this.once(d.OPENED, function() {
  14963. i.load(e.src).then(function() {
  14964. this.div.classList.add("has-video"),
  14965. this.state !== I.OPEN && this.state !== I.ACTIVE || (i.show(),
  14966. i.play()),
  14967. this.on(d.OPENING, i.show.bind(i)),
  14968. this.on(d.OPENED, i.play.bind(i)),
  14969. this.on(d.CLOSING, i.pause.bind(i)),
  14970. this.on(d.CLOSED, i.hide.bind(i))
  14971. }
  14972. .bind(this)).catch(function(t) {
  14973. y.warn("Failed to embed video:", e.src),
  14974. y.warn("with error:", t)
  14975. }).then(this.onMediaLoadFinished.bind(this))
  14976. }
  14977. .bind(this)),
  14978. n
  14979. }
  14980. ,
  14981. n.prototype.createEmbedElement = function(e, t) {
  14982. var i = new l
  14983. , n = i.createDomElement();
  14984. return this.once(d.OPENED, function() {
  14985. i.load(e.src).then(function() {
  14986. this.div.classList.add("has-embed"),
  14987. this.state !== I.OPEN && this.state !== I.ACTIVE || i.show(),
  14988. this.applyOrientation(this.orientation),
  14989. this.on(d.OPENING, i.show.bind(i)),
  14990. this.on(d.CLOSED, i.hide.bind(i))
  14991. }
  14992. .bind(this)).catch(function(t) {
  14993. y.warn("Failed to embed:", e.src),
  14994. y.warn("with error:", t)
  14995. }).then(this.onMediaLoadFinished.bind(this))
  14996. }
  14997. .bind(this)),
  14998. n
  14999. }
  15000. ,
  15001. n.prototype.open = function(e) {
  15002. return this.openPromise = $.Deferred(),
  15003. this.state === I.ACTIVE ? this.openPromise.resolve().promise() : (this.hovering || this.div.classList.add("has-hotzone"),
  15004. this.openTransition ? e && this.setActiveState() : this.openTransition = c.setTimeout(function() {
  15005. this.state !== I.OPEN && (this.emit(d.OPENING),
  15006. e && this.emit(d.ACTIVATING),
  15007. this.state = I.OPENING,
  15008. this.animateOpen(function() {
  15009. e && this.setActiveState(),
  15010. this.openPromise.resolve()
  15011. }
  15012. .bind(this)))
  15013. }
  15014. .bind(this), m.animation.openDelay),
  15015. c.cancel(this.closeTransition),
  15016. this.closePromise && this.closePromise.reject(),
  15017. this.closeTransition = void 0,
  15018. this.openPromise.promise())
  15019. }
  15020. ,
  15021. n.prototype.close = function(e) {
  15022. return this.closePromise = $.Deferred(),
  15023. !e && this.hovering ? this.closePromise.reject().promise() : (this.closeTransition || (this.closeTransition = c.setTimeout(function() {
  15024. this.state !== I.CLOSED && (this.emit(d.CLOSING),
  15025. this.state = I.CLOSING,
  15026. this.animateClose())
  15027. }
  15028. .bind(this), m.animation.closeDelay)),
  15029. c.cancel(this.openTransition),
  15030. this.openPromise && this.openPromise.reject(),
  15031. this.openTransition = void 0,
  15032. this.closePromise.resolve(),
  15033. this.closePromise.promise())
  15034. }
  15035. ,
  15036. n.prototype.setActiveState = function() {
  15037. this.state !== I.CLOSED && (this.state = I.ACTIVE,
  15038. this.emit(d.ACTIVATE),
  15039. this.div.classList.remove("has-hotzone"))
  15040. }
  15041. ,
  15042. n.prototype.animateOpen = function(e) {
  15043. if (this.state === I.OPENING) {
  15044. if (c.cancel(this.animationTransition),
  15045. u.detectSamsungNative())
  15046. return this.boardOrientation = null,
  15047. this.div.style.visibility = "visible",
  15048. this.emit(d.OPENED),
  15049. this.state = I.OPEN,
  15050. void (e && e());
  15051. this.div.style.webkitTransform = "scale(0)",
  15052. this.div.style.transform = "scale(0)",
  15053. this.div.style.visibility = "visible",
  15054. this.animationTransition = c.start(h.property(this, "animationScale", 1), m.animation.openDuration, function() {
  15055. this.emit(d.OPENED),
  15056. this.state = I.OPEN,
  15057. e && e()
  15058. }
  15059. .bind(this))
  15060. }
  15061. }
  15062. ,
  15063. n.prototype.animateClose = function(e) {
  15064. this.state === I.CLOSING && (c.cancel(this.animationTransition),
  15065. this.animationTransition = c.start(h.property(this, "animationScale", 0), m.animation.closeDuration, function() {
  15066. this.emit(d.CLOSED),
  15067. this.state = I.CLOSED,
  15068. this.div.style.visibility = "hidden",
  15069. this.div.classList.contains("has-hotzone") || this.div.classList.add("has-hotzone"),
  15070. e && e()
  15071. }
  15072. .bind(this)))
  15073. }
  15074. ,
  15075. n.prototype.needsUpdate = function() {
  15076. return this.state !== I.CLOSED
  15077. }
  15078. ,
  15079. n.prototype.update = function(e, t) {
  15080. if (this.needsUpdate()) {
  15081. var i = (this.updateOrientation(e),
  15082. this.calcScale(t))
  15083. , n = {
  15084. x: (e.x + 1) * $("#player").width() / 2,
  15085. y: (e.y + 1) * $("#player").height() / 2
  15086. };
  15087. this.div.screenTransform = this.initialTransform + " translate(" + n.x + "px, " + n.y + "px) scale(" + i * this.animationScale + ")",
  15088. this.div.style.webkitTransform = this.div.screenTransform,
  15089. this.div.style.transform = this.div.screenTransform
  15090. }
  15091. }
  15092. ,
  15093. n.prototype.getDimensions = function() {
  15094. return this.div.getBoundingClientRect()
  15095. }
  15096. ,
  15097. n.prototype.calcScale = function(e) {
  15098. return Math.sqrt(e / 40) * m.boardToDiscRatio
  15099. }
  15100. ,
  15101. n.prototype.updateOrientation = function(e) {
  15102. if (this.state !== I.ACTIVE) {
  15103. var t = 1 / 3
  15104. , i = e.y < -t ? 0 : e.y < t ? 1 : 2
  15105. , n = e.x < -t ? 0 : e.x < t ? 1 : 2
  15106. , r = "";
  15107. r += 0 === n ? "right" : 2 === n ? "left" : "",
  15108. r += 0 === i ? "-down" : 2 === i ? "-up" : "",
  15109. 1 === n && (r = 0 === i ? "bottom" : 2 === i ? "top" : "",
  15110. 1 === i && (r = $("#player").width() > $("#player").height() ? e.x < 0 ? "right" : "left" : e.y < 0 ? "bottom" : "top")),
  15111. 1 === n && 1 === i && r === this.orientation || this.applyOrientation(r)
  15112. }
  15113. }
  15114. ,
  15115. n.prototype.applyOrientation = function(e) {
  15116. this.div.style.transform = this.div.style.webkitTransform = "",
  15117. this.div.classList.remove("tag-container-" + this.orientation),
  15118. this.div.classList.add("tag-container-" + e);
  15119. var t = window.getComputedStyle(this.div);
  15120. this.initialTransform = t.transform || t.webkitTransform,
  15121. "none" === this.initialTransform && (this.initialTransform = "");
  15122. var i = t.transform.slice(7, -1).split(",")
  15123. , n = -i[4]
  15124. , r = -i[5];
  15125. this.div.style.webkitTransformOrigin = n + "px " + r + "px",
  15126. this.div.style.transformOrigin = n + "px " + r + "px",
  15127. this.orientation = e
  15128. }
  15129. ,
  15130. t.exports = n
  15131. }
  15132. ).call(this, "/js/tag/Billboard/Billboard.js")
  15133. }
  15134. , {
  15135. "../../util/browser": 182,
  15136. "../../util/lerp": 188,
  15137. "../../util/logger": 189,
  15138. "../../util/transitions": 195,
  15139. "../Media/EmbedlyEmbed": 125,
  15140. "../Media/EmbedlyPlayer": 126,
  15141. "../Media/Image": 128,
  15142. "../Media/Link": 129,
  15143. "../Media/MediaEvent": 131,
  15144. "../Parser/DescriptionChunkType": 133,
  15145. "../Parser/DescriptionParser": 134,
  15146. "./BillboardEvent": 120,
  15147. "./billboardSettings": 121,
  15148. "./overlaySettings": 122,
  15149. events: 202
  15150. }],
  15151. 120: [function(e, t, i) {
  15152. "use strict";
  15153. t.exports = Object.freeze({
  15154. ENTER: "billboard.enter",
  15155. LEAVE: "billboard.leave",
  15156. OPENING: "billboard.opening",
  15157. OPENED: "billboard.open",
  15158. CLOSING: "billboard.closing",
  15159. CLOSED: "billboard.closed",
  15160. ACTIVATING: "billboard.activating",
  15161. ACTIVATE: "billboard.activate"
  15162. })
  15163. }
  15164. , {}],
  15165. 121: [function(e, t, i) {
  15166. "use strict";
  15167. t.exports = Object.freeze({
  15168. animation: Object.freeze({
  15169. hoverOnClosing: !1,
  15170. openDelay: 100,
  15171. closeDelay: 50,
  15172. openDuration: 200,
  15173. closeDuration: 100
  15174. }),
  15175. boardToDiscRatio: 1.2
  15176. })
  15177. }
  15178. , {}],
  15179. 122: [function(e, t, i) {
  15180. "use strict";
  15181. t.exports = Object.freeze({
  15182. boundaryWidth: 30,
  15183. boundaryHeight: 0
  15184. })
  15185. }
  15186. , {}],
  15187. "hot": [function(e, t, i) {//热点
  15188. "use strict";
  15189. function hot(sid,d,model){
  15190. this.sid = sid;
  15191. this.position = this.conversionArray(d.position);
  15192. this.rotation = this.conversionArray(d.rotation);
  15193. this.link = d.link;
  15194. this.model = model;
  15195. this.size = d.size;
  15196. this.build();
  15197. }
  15198. var r = e("three")
  15199. , f = e("../shaders")
  15200. , a = e("../settings")
  15201. , s = e("../enum/Viewmode")
  15202. , p = e("../objects/Panorama")
  15203. , te = e("../util/texture");
  15204. var raycaster = new r.Raycaster;
  15205. var geometry = new r.PlaneBufferGeometry( g_HotMeshSize.g_HotMeshWidth, g_HotMeshSize.g_HotMeshHeight,1,1);
  15206. var shaderMaterial = new r.ShaderMaterial( {
  15207. uniforms: f.hot.uniforms,
  15208. vertexShader: f.hot.vertexShader,
  15209. fragmentShader: f.hot.fragmentShader
  15210. });
  15211. shaderMaterial.transparent = true;
  15212. //判断someData里面是否有special字段,如果有就会处理这些特殊的大场景
  15213. // if(window.MP_PREFETCHED_MODELDATA.special){
  15214. // specialScene.special().beforeImplement();
  15215. // }
  15216. f.hot.uniforms.texture1.value = te.load(g_HotImage.point);
  15217. f.hot.uniforms.texture2.value = te.load(g_HotImage.point2);
  15218. //czj 判断是否是数组 如果不是将对象转换为数组
  15219. hot.prototype.conversionArray = function(obj){
  15220. if(Object.prototype.toString.call(obj)=='[object Array]') return obj;
  15221. var arr = []
  15222. for (var i in obj) {
  15223. arr.push(obj[i]); //属性
  15224. }
  15225. return arr
  15226. }
  15227. hot.prototype.build = function(){
  15228. var sprite = new r.Mesh( geometry, shaderMaterial );
  15229. sprite.dynamic = true;
  15230. sprite.position.copy(new r.Vector3().fromArray(this.position));
  15231. sprite.rotation.copy(new r.Euler().fromArray(this.rotation));
  15232. this.size && sprite.scale.set(this.size,this.size,this.size);
  15233. sprite.name = this.sid;
  15234. sprite.type = "hotSprite";
  15235. sprite.belongHot = this;
  15236. if(this.link) sprite.hotLink = this.link;
  15237. this.mesh = sprite;
  15238. this.model.add(sprite);
  15239. g_HotMeshes.push(sprite);
  15240. }
  15241. hot.prototype.closestPanoTowardTag = function(e, t) {
  15242. var i = []
  15243. , o = []
  15244. , l = this.mesh.position;
  15245. if (e === s.PANORAMA) {
  15246. var c = .5
  15247. , h = t.position.clone().sub(l).normalize();
  15248. i.push(p.filters.isPanoAligned()),
  15249. i.push(p.filters.inPanoDirection(l, h, c)),
  15250. i.push(p.filters.isNeighbourPanoTo(t)),
  15251. o.push(p.scoreFunctions.direction(l, h))
  15252. }
  15253. var u = new r.Vector3
  15254. , d = function(e) {
  15255. u.copy(l).sub(e.position);
  15256. var t = -r.Math.radToDeg(Math.atan(u.y / Math.sqrt(u.x * u.x + u.z * u.z)))
  15257. , i = a.tags.navigate.tiltTolerance;
  15258. return a.insideLookLimitDown - i < t && t < a.insideLookLimitUp + i
  15259. }
  15260. , f = function(e) {
  15261. return Math.abs(e.position.x - l.x) > a.tags.visibility.cameraClearance || Math.abs(e.position.z - l.z) > a.tags.visibility.cameraClearance
  15262. };
  15263. i.push(f, d),
  15264. o.push(p.scoreFunctions.distanceSquared(this.mesh, -2));
  15265. var g = t.model.panos.sortByScore(i, o);
  15266. if (g && a.tags.navigate.lineOfSight) {
  15267. for (var m = 0; m < g.length; m++) {
  15268. var v = g[m].pano
  15269. , A = v.position.distanceTo(l);
  15270. raycaster.set(v.position, l.clone().sub(v.position).normalize());
  15271. var y = raycaster.intersectObjects(t.model.colliders);
  15272. if (0 === y.length || y[0].distance > A)
  15273. return v
  15274. }
  15275. return null
  15276. }
  15277. return g && g.length > 0 && g[0].pano
  15278. },
  15279. hot.prototype.examine = function(e) {
  15280. var hotPop = document.getElementById('popup');
  15281. //获取那个热点的链接
  15282. if(this.link){
  15283. g_currentHot = this;
  15284. hotPop.style.display = "block";
  15285. hotPop.classList.add("wait");
  15286. var myElement = document.createElement("iframe");
  15287. //打开热点的时候把背景音乐关闭了,避免与热点里面的音乐冲突
  15288. g_bgAudio && g_bgAudio.pause();
  15289. //给热点后面加上随机数,让热点确保是最新的
  15290. var hotLinkParameter = this.link.substring(this.link.indexOf("html")+4);
  15291. //如果热点的内容是英文版的
  15292. var lang = manage.number("lang") == "en" ? "&lang="+ manage.number("lang") : "" ;
  15293. hotLinkParameter.indexOf("?") == -1 ? myElement.src = this.link + "?time="+randomTime().getTime() + "&id=" + window.number +lang : myElement.src = this.link + "&time="+randomTime().getTime() + "&id=" + window.number + lang;
  15294. myElement.id = "id1";
  15295. myElement.allowTransparency = "true";
  15296. // myElement.scrolling = "no";
  15297. var element=document.getElementById("id1"); //判断页面是否有iframe
  15298. if (typeof(element)== "undefined" || element == null){
  15299. document.querySelector(".popup-content").appendChild(myElement);
  15300. //移动端自动播放
  15301. var videoLoaddingResult = false
  15302. window.loaddingSuccess = function() {
  15303. videoLoaddingResult = true
  15304. }
  15305. setTimeout(function func() {
  15306. if (videoLoaddingResult) {
  15307. var $iframe = document.querySelector('#id1').contentWindow.document;
  15308. if($iframe.querySelector('video')){
  15309. $iframe.querySelector('video').play();
  15310. // alert($iframe.querySelector('video'));
  15311. if(!$iframe.querySelector('video').paused && $iframe.querySelector('.playPause')){
  15312. $iframe.querySelector('.playPause').classList.add("fa-pause");
  15313. }
  15314. }
  15315. if($iframe.querySelector('audio')){
  15316. $iframe.querySelector('audio').play();
  15317. }
  15318. } else {
  15319. setTimeout(func, 300)
  15320. }
  15321. }, 800);
  15322. }
  15323. //setTimeout(function(){$('#player').on("click",e.closePopup);},20)
  15324. }
  15325. var t = e.mode
  15326. , i = a.tags.navigate.nearestPano && this.closestPanoTowardTag(t, e.currentPano) || e.currentPano
  15327. , n = this.mesh.position;
  15328. e.flyingToTag = true;
  15329. var o = function() {
  15330. e.flyingToTag = false;
  15331. if(this.link){
  15332. hotPop.classList.remove("wait");
  15333. }
  15334. }.bind(this);
  15335. if (t === s.PANORAMA){
  15336. var l = {
  15337. pano: i,
  15338. lookAtPoint: n,
  15339. duration: null,
  15340. maxDistanceOverride: null,
  15341. skipWarpingCheck: !1
  15342. };
  15343. e.flyToPano(l, o)
  15344. }else {
  15345. var c = {
  15346. pano: i
  15347. };
  15348. if (n) {
  15349. var h = (new r.Matrix4).lookAt(i.position, n, new r.Vector3(0,1,0));
  15350. c.quaternion = (new r.Quaternion).setFromRotationMatrix(h)
  15351. }
  15352. c.callback = o,
  15353. c.duration = 1500,
  15354. c.mode = s.PANORAMA,
  15355. e.flyToNewMode(c)
  15356. }
  15357. },
  15358. t.exports = hot;
  15359. }
  15360. , {
  15361. three: 217,
  15362. "../shaders":167,
  15363. "../enum/Viewmode":51,
  15364. "../objects/Panorama":148,
  15365. "../util/texture":194,
  15366. "../settings":166
  15367. }],
  15368. 123: [function(e, t, i) {//tag
  15369. (function(i) {
  15370. "use strict";
  15371. function n(e, t, i) {
  15372. var n = i.version || "0";
  15373. "0" !== n && I.info("tag defined using version " + n),
  15374. this.model = e,
  15375. this.sid = t,
  15376. this.color = (new r.Color).set(i.color || l.tagDefault),
  15377. this.hoverColor = l._darken(this.color, .2),
  15378. this.floor = null,
  15379. this.floorIndex = i.floor,
  15380. this.mode = s.PANORAMA,
  15381. i.preferred_camera && i.preferred_camera.mode && (this.mode = i.preferred_camera.mode),
  15382. this.obj3d = null,
  15383. this.disc = null,
  15384. this.materials = {
  15385. disc: null,
  15386. pole: null
  15387. },
  15388. this.position = (new r.Vector3).copy(i.position),
  15389. this.discPosition = (new r.Vector3).copy(i.stem.direction),
  15390. this.discWorldPosition = null,
  15391. this.discScale = .05,
  15392. this.poleEnabled = i.stem.enabled,
  15393. this.billboard = new o(i.label,i.description,i.media,this),
  15394. this.visibleTransition = null,
  15395. this.hoveringDisc = !1
  15396. }
  15397. var r = e("three")
  15398. , o = e("./Billboard/Billboard")
  15399. , a = e("../settings")
  15400. , s = e("../enum/Viewmode")
  15401. , l = e("../enum/Colors")
  15402. , c = e("../enum/RenderLayers")
  15403. , h = e("../enum/RenderOrder")
  15404. , u = (e("../util/common"),
  15405. e("../util/math"))
  15406. , d = e("../util/texture")
  15407. , p = e("../objects/Panorama")
  15408. , f = e("../shaders")
  15409. , g = e("../util/transitions")
  15410. , m = e("../util/lerp")
  15411. , v = e("../util/easing")
  15412. , A = e("./Billboard/BillboardEvent")
  15413. , y = e("events").EventEmitter
  15414. , C = e("../util/logger")
  15415. , I = new C(i)
  15416. , 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==")
  15417. , 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")
  15418. , w = new r.PlaneBufferGeometry(1,1);
  15419. n.prototype = Object.create(y.prototype),
  15420. n.raycaster = new r.Raycaster,
  15421. n.prototype.bindEvents = function() {
  15422. this.billboard.on(A.ENTER, this.setHoverState.bind(this)),
  15423. this.billboard.on(A.LEAVE, this.setFreeState.bind(this))
  15424. }
  15425. ,
  15426. n.prototype.build = function() {
  15427. return this.floor = this.model.floors.get(this.floorIndex) || this.model.floors.first(),
  15428. this.floor && (this.billboard.build(this.model.sid),
  15429. this.obj3d = this.buildObject3D(),
  15430. this.floor.add(this.obj3d)),
  15431. this
  15432. }
  15433. ,
  15434. n.prototype.buildObject3D = function() {
  15435. var e = new r.Object3D;
  15436. e.position.copy(this.position);
  15437. var t = r.UniformsUtils.clone(f.tagDisc.uniforms);
  15438. t.bg.value = b,
  15439. t.mask.value = E,
  15440. t.color.value.copy(this.color),
  15441. this.materials.disc = new r.RawShaderMaterial({
  15442. transparent: !0,
  15443. vertexShader: f.tagDisc.vertexShader,
  15444. fragmentShader: f.tagDisc.fragmentShader,
  15445. uniforms: t
  15446. }),
  15447. this.disc = new r.Mesh(w,this.materials.disc),
  15448. this.disc.layers.set(c.TAG),
  15449. this.disc.position.copy(this.discPosition),
  15450. this.disc.renderOrder = h.tagDisc,
  15451. this.disc.tag = this;
  15452. var i = this.buildPole();
  15453. return i.layers.set(c.TAG),
  15454. i.renderOrder = h.tagStem,
  15455. e.add(i),
  15456. e.layers.set(c.TAG),
  15457. e.add(this.disc)
  15458. }
  15459. ,
  15460. n.prototype.buildPole = function() {
  15461. var e = new r.BufferGeometry
  15462. , t = new Float32Array(6);
  15463. return t[0] = t[1] = t[2] = 0,
  15464. t[3] = this.discPosition.x,
  15465. t[4] = this.discPosition.y,
  15466. t[5] = this.discPosition.z,
  15467. e.addAttribute("position", new r.BufferAttribute(t,3)),
  15468. this.materials.pole = new r.LineBasicMaterial({
  15469. linewidth: a.tags.pole.width,
  15470. color: a.tags.pole.color,
  15471. opacity: 0,
  15472. visible: this.poleEnabled,
  15473. transparent: !0,
  15474. depthWrite: !1
  15475. }),
  15476. new r.Line(e,this.materials.pole)
  15477. }
  15478. ,
  15479. n.prototype.setFreeState = function(e) {
  15480. !e && this.hoveringDisc || this.billboard.close(e).then(function() {
  15481. this.materials.disc.uniforms.color.value = this.color
  15482. }
  15483. .bind(this))
  15484. }
  15485. ,
  15486. n.prototype.setHoverState = function(e) {
  15487. this.billboard.open(e),
  15488. this.materials.disc.uniforms.color.value = this.hoverColor
  15489. }
  15490. ,
  15491. n.prototype.hide = function(e, t) {
  15492. var i = $.Deferred();
  15493. if (0 === this.materials.disc.uniforms.opacity.value && !g.isRunning(this.visibleTransition))
  15494. return i.resolve().promise();
  15495. e = e || 0,
  15496. t = t || 0,
  15497. g.cancel(this.visibleTransition);
  15498. var n = this.materials.disc.uniforms.opacity.value / a.tags.disc.opacity
  15499. , r = t + e
  15500. , o = t / r;
  15501. return this.visibleTransition = g.start(function(e) {
  15502. var t = m.property(e.materials.disc.uniforms.opacity, "value", 0)
  15503. , i = m.property(e.materials.pole, "opacity", 0);
  15504. return function(n) {
  15505. t(n),
  15506. e.materials.pole && i(n)
  15507. }
  15508. }(this), r * n, function() {
  15509. i.resolve()
  15510. }, o, v[a.warp.blendEasing]),
  15511. i.promise()
  15512. }
  15513. ,
  15514. n.prototype.show = function(e, t) {
  15515. var i = $.Deferred();
  15516. if (this.materials.disc.uniforms.opacity.value === a.tags.disc.opacity && !g.isRunning(this.visibleTransition))
  15517. return i.resolve().promise();
  15518. e = e || 0,
  15519. t = t || 0,
  15520. g.cancel(this.visibleTransition);
  15521. var n = (a.tags.disc.opacity - this.materials.disc.uniforms.opacity.value) / a.tags.disc.opacity
  15522. , r = t + e
  15523. , o = t / r;
  15524. return this.visibleTransition = g.start(function(e) {
  15525. var t = m.property(e.materials.disc.uniforms.opacity, "value", a.tags.disc.opacity)
  15526. , i = m.property(e.materials.pole, "opacity", a.tags.pole.opacity);
  15527. return function(n) {
  15528. t(n),
  15529. e.materials.pole && i(n)
  15530. }
  15531. }(this), r * n, function() {
  15532. i.resolve()
  15533. }, o, v[a.warp.blendEasing]),
  15534. i.promise()
  15535. }
  15536. ,
  15537. n.prototype.closestPanoTowardTag = function(e, t) {
  15538. var i = []
  15539. , o = []
  15540. , l = this.disc.getWorldPosition();
  15541. if (e === s.PANORAMA) {
  15542. var c = .5
  15543. , h = t.position.clone().sub(l).normalize();
  15544. i.push(p.filters.isPanoAligned()),
  15545. i.push(p.filters.inPanoDirection(l, h, c)),
  15546. i.push(p.filters.isNeighbourPanoTo(t)),
  15547. o.push(p.scoreFunctions.direction(l, h))
  15548. }
  15549. var u = new r.Vector3
  15550. , d = function(e) {
  15551. u.copy(l).sub(e.position);
  15552. var t = -r.Math.radToDeg(Math.atan(u.y / Math.sqrt(u.x * u.x + u.z * u.z)))
  15553. , i = a.tags.navigate.tiltTolerance;
  15554. return a.insideLookLimitDown - i < t && t < a.insideLookLimitUp + i
  15555. }
  15556. , f = function(e) {
  15557. return Math.abs(e.position.x - l.x) > a.tags.visibility.cameraClearance || Math.abs(e.position.z - l.z) > a.tags.visibility.cameraClearance
  15558. };
  15559. i.push(f, d),
  15560. o.push(p.scoreFunctions.distanceSquared(this, -2));
  15561. var g = this.model.panos.sortByScore(i, o);
  15562. if (a.tags.navigate.lineOfSight) {
  15563. for (var m = 0; m < g.length; m++) {
  15564. var v = g[m].pano
  15565. , A = v.position.distanceTo(l);
  15566. if (!a.tags.visibility.anyDistance && A > a.tags.visibility.visibleDistance)
  15567. return null;
  15568. n.raycaster.set(v.position, l.clone().sub(v.position).normalize());
  15569. var y = n.raycaster.intersectObjects(this.model.colliders);
  15570. if (0 === y.length || y[0].distance > A)
  15571. return v
  15572. }
  15573. return null
  15574. }
  15575. return g.length > 0 && g[0].pano
  15576. }
  15577. ,
  15578. n.prototype.examine = function(e) {
  15579. var t = e.mode
  15580. , i = a.tags.navigate.nearestPano && this.closestPanoTowardTag(t, e.currentPano) || e.currentPano
  15581. , n = this.disc.getWorldPosition();
  15582. this.billboard.setActiveState();
  15583. var o = function() {
  15584. var t = this.billboard.getDimensions()
  15585. , n = new r.Vector3;
  15586. u.convertScreenPositionToNDC(t.left + t.width / 2, t.top + t.height / 2, n),
  15587. n.unproject(e.camera),
  15588. e.flyToPano({
  15589. pano: i,
  15590. lookAtPoint: n
  15591. })
  15592. }
  15593. .bind(this);
  15594. if (t === s.PANORAMA)
  15595. if (i !== e.currentPano) {
  15596. var l = {
  15597. pano: i,
  15598. lookAtPoint: n,
  15599. duration: null,
  15600. maxDistanceOverride: null,
  15601. skipWarpingCheck: !1
  15602. };
  15603. e.flyToPano(l, o)
  15604. } else
  15605. setTimeout(function() {
  15606. this.billboard.open().then(function() {
  15607. o()
  15608. })
  15609. }
  15610. .bind(this), 0);
  15611. else {
  15612. var c = {
  15613. pano: i
  15614. };
  15615. if (n) {
  15616. var h = (new r.Matrix4).lookAt(i.position, n, new r.Vector3(0,1,0));
  15617. c.quaternion = (new r.Quaternion).setFromRotationMatrix(h)
  15618. }
  15619. c.callback = o,
  15620. c.duration = 1500,
  15621. c.mode = s.PANORAMA,
  15622. e.flyToNewMode(c)
  15623. }
  15624. }
  15625. ,
  15626. n.prototype.update = function(e, t) {
  15627. var i = new r.Vector3;
  15628. return function(e, t) {
  15629. this.discWorldPosition = this.disc.getWorldPosition(),
  15630. this.updateDisc(e, t),
  15631. this.billboard.needsUpdate() && (i.copy(this.discWorldPosition).project(t),
  15632. i.z < 1 && (i.y *= -1,
  15633. this.billboard.update(i, this.getDiscRadius(i, t))))
  15634. }
  15635. }(),
  15636. n.prototype.updateDisc = function(e, t) {
  15637. var i = new r.Vector3
  15638. , o = new r.Vector3
  15639. , l = new r.Vector3
  15640. , c = new r.Vector3
  15641. , h = new r.Vector3;
  15642. return function(e, t) {
  15643. var u = a.tags.visibility
  15644. , d = a.tags.disc.scale
  15645. , p = e === s.DOLLHOUSE || e === s.FLOORPLAN ? a.tags.visibility.visibleDistance : t.position.distanceTo(this.discWorldPosition);
  15646. 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)),
  15647. this.obj3d.visible) {
  15648. this.disc.quaternion.copy(t.quaternion);
  15649. var f = d.maxSize - (d.maxSize - d.minSize) * r.Math.smoothstep(p, d.nearBound, d.farBound);
  15650. i.copy(this.discWorldPosition).project(t),
  15651. o.set($("#player").width() / 2, $("#player").height() / 2, 1).multiply(i),
  15652. l.set(f / 2, 0, 0).add(o),
  15653. c.set(2 / $("#player").width(), 2 / $("#player").height(), 1).multiply(l),
  15654. h.copy(c).unproject(t);
  15655. var g = h.distanceTo(this.discWorldPosition)
  15656. , m = 1 + a.tags.disc.scale.responsiveness / 100 * (n.viewportScale() - 1);
  15657. this.discScale = g * m,
  15658. this.disc.scale.set(this.discScale, this.discScale, this.discScale)
  15659. }
  15660. }
  15661. }(),
  15662. n.prototype.getDiscRadius = function(e, t) {
  15663. var i = new r.Vector3;
  15664. return function(e, t) {
  15665. return i.set(-this.discScale / 2, 0, 0).applyQuaternion(t.quaternion).add(this.discWorldPosition).project(t),
  15666. Math.abs(e.x - i.x) * $("#player").width()
  15667. }
  15668. }(),
  15669. n.prototype.tagVisibleOnCurrentFloor = function(e) {
  15670. return !(e === s.DOLLHOUSE || e === s.FLOORPLAN) || this.model.allFloorsVisible || !this.floor.hidden
  15671. }
  15672. ,
  15673. n.prototype.offScreen = function(e, t) {
  15674. var i = e.getWorldPosition().project(t);
  15675. return !(-1 < i.x && i.x < 1 && -1 < i.y && i.y < 1)
  15676. }
  15677. ,
  15678. n.viewportScale = function() {
  15679. return n.viewportWidth === $("#player").width() && n.viewportHeight === $("#player").height() || (n.viewportWidth = $("#player").width(),
  15680. n.viewportHeight = $("#player").height(),
  15681. n.currentViewportScale = Math.sqrt(Math.min(n.viewportWidth, n.viewportHeight) / a.tags.disc.scale.baseViewportSize)),
  15682. n.currentViewportScale
  15683. }
  15684. ,
  15685. t.exports = n
  15686. }
  15687. ).call(this, "/js/tag/tag.js")
  15688. }
  15689. , {
  15690. "../enum/Colors": 19,
  15691. "../enum/RenderLayers": 41,
  15692. "../enum/RenderOrder": 42,
  15693. "../enum/Viewmode": 51,
  15694. "../objects/Panorama": 148,
  15695. "../settings": 166,
  15696. "../shaders": 167,
  15697. "../util/common": 185,
  15698. "../util/easing": 186,
  15699. "../util/lerp": 188,
  15700. "../util/logger": 189,
  15701. "../util/math": 190,
  15702. "../util/texture": 194,
  15703. "../util/transitions": 195,
  15704. "./Billboard/Billboard": 119,
  15705. "./Billboard/BillboardEvent": 120,
  15706. events: 202,
  15707. three: 217
  15708. }],
  15709. 124: [function(e, t, i) {
  15710. (function(i) {
  15711. "use strict";
  15712. function n() {
  15713. this.tagState = y.IDLE,
  15714. this.intersectTag = null,
  15715. this.hoveredTag = null,
  15716. this.activeTag = null,
  15717. this.tagDiscs = [],
  15718. this.raycaster = new r.Raycaster,
  15719. this.modelManager = null,
  15720. this.player = null,
  15721. this.totaltags = 0,
  15722. this.navigatingViaTag = !1,
  15723. this.enabled = !1
  15724. }
  15725. var r = e("three")
  15726. , o = e("../util/logger")
  15727. , a = e("../util/common")
  15728. , s = e("../controls/serializer")
  15729. , l = e("../objects/Snapshot")
  15730. , c = e("../settings")
  15731. , h = e("./Billboard/BillboardEvent")
  15732. , u = e("./Media/MediaEvent")
  15733. , d = e("./Media/LinkType")
  15734. , p = e("../enum/Viewmode")
  15735. , f = e("../enum/WarpStyle")
  15736. , g = e("../enum/BlackoutStyle")
  15737. , m = e("../enum/ModelManagerEvents")
  15738. , v = e("../enum/tagEvents")
  15739. , A = e("../enum/PlayerEvents")
  15740. , y = (e("../util/lerp"),
  15741. e("../enum/TagStates"))
  15742. , C = e("events").EventEmitter
  15743. , I = new o(i);
  15744. a.extend(n, C),
  15745. n.prototype.init = function(e, t) {
  15746. this.modelManager = e,
  15747. this.player = t,
  15748. this.updateModel(),
  15749. this.bindEvents()
  15750. }
  15751. ,
  15752. n.prototype.update = function(e) {
  15753. this.updateTags(this.player.mode, this.player.camera, this.player.currentPano, this.player.flying)
  15754. }
  15755. ,
  15756. n.prototype.updateTags = function(e, t, i, n) {
  15757. for (var r in this.model.tags)
  15758. this.model.tags[r].update(e, t, i, n)
  15759. }
  15760. ,
  15761. n.prototype.updateModel = function() {
  15762. this.model = this.modelManager.getActiveModel(),
  15763. this.gettagsFromModel(),
  15764. this.totaltags = Object.keys(this.model.tags).length
  15765. }
  15766. ,
  15767. n.prototype.gettagsFromModel = function() {
  15768. this.tagDiscs = [];
  15769. for (var e in this.model.tags) {
  15770. var t = this.model.tags[e].disc;
  15771. t && this.tagDiscs.push(t)
  15772. }
  15773. }
  15774. ,
  15775. n.prototype.bindEvents = function() {
  15776. function e() {
  15777. Object.keys(this.model.tags).forEach(function(e) {
  15778. var t = this.model.tags[e];
  15779. t.bindEvents(),
  15780. t.billboard.on(u.LINK_CLICK, function(e) {
  15781. e.type === d.NAVIGATION && this.navigateViaLink(e.url)
  15782. }
  15783. .bind(this)),
  15784. t.billboard.on(u.IMAGE_OPENED, function() {
  15785. this.tagState = y.EXAMINE,
  15786. this.emit(u.IMAGE_OPENED)
  15787. }
  15788. .bind(this)),
  15789. t.billboard.on(h.CLOSING, this.dismissExaminedTag.bind(this))
  15790. }
  15791. .bind(this))
  15792. }
  15793. this.modelManager.on(m.ActiveModelChanged, this.updateModel.bind(this)),
  15794. this.modelManager.on(m.ActiveModelChanged, e.bind(this)),
  15795. this.player.on(A.ModeChanging, this.onPlayerModeChanging.bind(this)),
  15796. this.player.on(A.PanoChosen, this.onPanoChange.bind(this)),
  15797. this.player.on(A.Ready, this.onPlayerReady.bind(this)),
  15798. this.player.on(A.FlyingEnded, this.onPlayerFlyingEnded.bind(this)),
  15799. this.player.on(A.WarpStarted, this.handleWarpStart.bind(this)),
  15800. this.player.on(A.WarpInterrupted, this.handleWarpInterruption.bind(this)),
  15801. e.call(this)
  15802. }
  15803. ,
  15804. n.prototype.navigateViaLink = function(e) {
  15805. var t = s.deserialize(e);
  15806. if (t)
  15807. if (t.mode === p.PANORAMA) {
  15808. try {
  15809. this.player.model.panos.get(t.panoId)
  15810. } catch (e) {
  15811. return void I.warn("Unable to find panorama location", t.panoId)
  15812. }
  15813. this.player.warpToPanoById(t.panoId, t.quaternion, null, null, f.BLACK)
  15814. } else {
  15815. var i = {
  15816. cameraMode: t.mode,
  15817. position: t.position,
  15818. quaternion: t.quaternion,
  15819. scanId: t.panoId,
  15820. orthoZoom: t.zoom,
  15821. floorVisibility: t.floorVisibility,
  15822. thumbUrl: null,
  15823. name: null
  15824. };
  15825. this.player.flyToNewMode({
  15826. mode: t.mode,
  15827. duration: c.warp.outsideTime,
  15828. warpDest: new l(i),
  15829. force: !0
  15830. })
  15831. }
  15832. }
  15833. ,
  15834. n.prototype.handleWarpStart = function(e, t, i, n) {
  15835. this.dismissExaminedTag(),
  15836. t === f.BLACK && (null !== n && void 0 !== n || (n = c.warp.teleportTime),
  15837. e && (i = g.END),
  15838. this.hideShowTagsForBlackoutStyle(i, n))
  15839. }
  15840. ,
  15841. n.prototype.handleWarpInterruption = function(e, t, i) {
  15842. null !== i && void 0 !== i || (i = c.warp.teleportTime),
  15843. this.hideShowTagsForBlackoutStyle(t, i)
  15844. }
  15845. ,
  15846. n.prototype.hideShowTagsForBlackoutStyle = function(e, t) {
  15847. var i = 0
  15848. , n = 0
  15849. , r = t / 2;
  15850. switch (null !== e && void 0 !== e || (e = g.MIDDLE),
  15851. e) {
  15852. case g.END:
  15853. this.hideAlltags(r);
  15854. break;
  15855. case g.BEGINNING:
  15856. this.hideAlltags().done(this.showAlltags.bind(this, r));
  15857. break;
  15858. case g.NONE:
  15859. break;
  15860. case g.MIDDLE:
  15861. i = r,
  15862. n = r,
  15863. this.hideAlltags(n),
  15864. setTimeout(function() {
  15865. this.showAlltags(i)
  15866. }
  15867. .bind(this), n);
  15868. break;
  15869. case g.FADEIN:
  15870. setTimeout(function() {
  15871. this.showAlltags(r)
  15872. }
  15873. .bind(this), r)
  15874. }
  15875. }
  15876. ,
  15877. n.prototype.onPlayerModeChanging = function(e, t) {
  15878. t !== p.PANORAMA && this.dismissExaminedTag(),
  15879. t === p.PANORAMA && player.currentPano && !player.currentPano.isAligned() && (t = p.OUTDOOR);
  15880. var i = t !== p.OUTDOOR;
  15881. i !== this.model.tagsShown && (i ? this.showAlltags(c.tags.startup.fadeInDuration) : this.hideAlltags(c.tags.startup.fadeInDuration))
  15882. }
  15883. ,
  15884. n.prototype.onPanoChange = function(e, t) {
  15885. var i = this.navigatingViaTag;
  15886. if (this.navigatingViaTag = !1,
  15887. !i) {
  15888. this.dismissExaminedTag();
  15889. var n = e && !e.isAligned() ? p.OUTDOOR : p.PANORAMA
  15890. , r = t && !t.isAligned() ? p.OUTDOOR : p.PANORAMA;
  15891. n !== r && (r === p.PANORAMA ? this.showAlltags(c.tags.startup.fadeInDuration, null, !0) : this.hideAlltags(c.tags.startup.fadeInDuration))
  15892. }
  15893. }
  15894. ,
  15895. n.prototype.onPlayerReady = function(e, t, i) {
  15896. this.startAlltags(e, t ? i : null)
  15897. }
  15898. ,
  15899. n.prototype.onPlayerFlyingEnded = function(e, t) {
  15900. this.updateClosestTags(e)
  15901. }
  15902. ,
  15903. n.prototype.dismissExaminedTag = function() {
  15904. this.activeTag && this.tagState === y.EXAMINE && this.dismissActiveTag(),
  15905. this.hoveredTag && (this.hoveredTag.setFreeState(!0),
  15906. this.hoveredTag = null)
  15907. }
  15908. ,
  15909. n.prototype.startAlltags = function(e, t) {
  15910. this.model.shouldShowtags = c.tags.enabled,
  15911. this.enabled = !0,
  15912. e || (this.showAlltags(c.tags.startup.fadeInDuration, c.tags.startup.fadeInDelay),
  15913. t && setTimeout(function() {
  15914. this.activateTag(this.model.getTagBySid(t))
  15915. }
  15916. .bind(this), c.tags.startup.fadeInDuration / 2))
  15917. }
  15918. ,
  15919. n.prototype.showAlltags = function(e, t, i) {
  15920. function n() {
  15921. o++,
  15922. o === this.totaltags && (this.model.tagsShown = !0,
  15923. r.resolve())
  15924. }
  15925. var r = $.Deferred();
  15926. if (!i && this.player.mode === p.PANORAMA && this.player.currentPano && !this.player.currentPano.isAligned() || !this.model.shouldShowtags)
  15927. return r.resolve().promise();
  15928. var o = 0;
  15929. for (var a in this.model.tags) {
  15930. var s = this.model.tags[a];
  15931. s.show(e, t).done(n.bind(this))
  15932. }
  15933. return r.promise()
  15934. }
  15935. ,
  15936. n.prototype.hideAlltags = function(e, t) {
  15937. function i() {
  15938. r++,
  15939. r === this.totaltags && (this.model.tagsShown = !1,
  15940. n.resolve())
  15941. }
  15942. var n = $.Deferred()
  15943. , r = 0;
  15944. for (var o in this.model.tags) {
  15945. var a = this.model.tags[o];
  15946. a.hide(e, t).done(i.bind(this)),
  15947. a === this.activeTag && this.dismissActiveTag()
  15948. }
  15949. return n.promise()
  15950. }
  15951. ,
  15952. n.prototype.enableHovering = function() {
  15953. this.enabled = !0
  15954. }
  15955. ,
  15956. n.prototype.disableHovering = function() {
  15957. this.enabled = !1
  15958. }
  15959. ,
  15960. n.prototype.activateTag = function(e, t) {
  15961. t = t || y.EXAMINE,
  15962. this.activeTag = e,
  15963. this.activeTag.hoveringDisc = !0,
  15964. this.activeTag.setHoverState(t === y.EXAMINE),
  15965. this.tagState = t,
  15966. this.emit(v.TagActivated, e)
  15967. }
  15968. ,
  15969. n.prototype.dismissActiveTag = function() {
  15970. this.activeTag.hoveringDisc = !1,
  15971. this.activeTag.setFreeState(!0);
  15972. var e = this.activeTag;
  15973. this.activeTag = null,
  15974. this.tagState = y.IDLE,
  15975. this.emit(v.TagDismissed, e)
  15976. }
  15977. ,
  15978. n.prototype.clickedOnTag = function(e) {
  15979. var t = function() {
  15980. this.navigatingViaTag = !0,
  15981. this.activeTag.examine(this.player),
  15982. this.emit(v.TagNavigation, this.activeTag)
  15983. }
  15984. .bind(this);
  15985. return this.tagState !== y.EXAMINE ? (this.activateTag(this.intersectTag, y.EXAMINE),
  15986. this.activeTag = this.intersectTag,
  15987. t(),
  15988. !0) : (this.dismissActiveTag(),
  15989. !1)
  15990. }
  15991. ,
  15992. n.prototype.intersecttag = function() {
  15993. var e = new r.Vector3
  15994. , t = new r.Vector3
  15995. , i = new r.Vector3;
  15996. return function(n, r, o) {
  15997. if (!this.enabled)
  15998. return null;
  15999. var a = null
  16000. , s = this.tagDiscs.filter(function(e) {
  16001. return e.parent.visible
  16002. });
  16003. if (s.length > 0) {
  16004. var l = this.model.floors.reduce(function(e, t) {
  16005. return t.hidden ? e : e.concat(t.collider.children)
  16006. }, s);
  16007. e.set(n.x, n.y, -1).unproject(o),
  16008. t.set(n.x, n.y, 1).unproject(o),
  16009. i.copy(t).sub(e).normalize(),
  16010. this.raycaster.set(e, i);
  16011. var c = this.raycaster.intersectObjects(l);
  16012. c.length > 0 && s.indexOf(c[0].object) !== -1 && (a = c[0].object.tag)
  16013. }
  16014. return this.intersectTag = a,
  16015. r && (this.activeTag && a !== this.activeTag && (this.tagState === y.BROWSE || this.tagState === y.EXAMINE && a) && this.dismissActiveTag(),
  16016. a && a !== this.activeTag && (a.listeners(h.ENTER).length < 1 && (a.billboard.on(h.ENTER, function() {
  16017. this.hoveredTag = a
  16018. }
  16019. .bind(this)),
  16020. a.billboard.on(h.LEAVE, function() {
  16021. this.hoveredTag = null
  16022. }
  16023. .bind(this))),
  16024. this.activateTag(a, y.BROWSE))),
  16025. a
  16026. }
  16027. }(),
  16028. n.prototype.rankedtagInDirection = function() {
  16029. var e = []
  16030. , t = []
  16031. , i = new r.Vector3
  16032. , n = new r.Vector3
  16033. , o = new r.Vector3;
  16034. return function(r, a, s, l) {
  16035. var c = 0;
  16036. t.length = 0;
  16037. for (var h = 0; h < this.closesttags.length; h++) {
  16038. var u = this.closesttags[h];
  16039. n.copy(u.position),
  16040. n.add(u.discPosition),
  16041. i.copy(a),
  16042. i.sub(n).negate(),
  16043. i.normalize();
  16044. var d = i.dot(l);
  16045. if (d >= 0) {
  16046. o.copy(n),
  16047. o.project(s);
  16048. var p = this.intersecttag(o, !1, s);
  16049. if (p) {
  16050. if (c >= e.length)
  16051. for (var f = 0; f < 64; f++)
  16052. e.push({
  16053. tag: u,
  16054. dot: d
  16055. });
  16056. var g = e[c];
  16057. g.tag = u,
  16058. g.dot = d,
  16059. g.position = math.projectPositionToCanvas(n, s),
  16060. t.push(g),
  16061. c++
  16062. }
  16063. }
  16064. }
  16065. return t.sort(function(e, t) {
  16066. return e.dot > t.dot ? -1 : e.dot < t.dot ? 1 : 0
  16067. }),
  16068. r < t.length ? t[r].tag : null
  16069. }
  16070. }(),
  16071. n.prototype.updateClosestTags = function() {
  16072. var e = new r.Vector3
  16073. , t = 30;
  16074. return function(i) {
  16075. this.closesttags || (this.closesttags = []),
  16076. this.closesttags.length = 0;
  16077. var n = this.model.tags;
  16078. if (n)
  16079. for (var r in n)
  16080. if (n.hasOwnProperty(r)) {
  16081. var o = n[r]
  16082. , a = o.position;
  16083. e.copy(i),
  16084. e.sub(a).negate();
  16085. var s = e.lengthSq();
  16086. s < t && this.closesttags.push(o)
  16087. }
  16088. }
  16089. }(),
  16090. t.exports = n
  16091. }
  16092. ).call(this, "/js/tag/tagManager.js")
  16093. }
  16094. , {
  16095. "../controls/serializer": 14,
  16096. "../enum/BlackoutStyle": 18,
  16097. "../enum/tagEvents": 32,
  16098. "../enum/ModelManagerEvents": 33,
  16099. "../enum/PlayerEvents": 40,
  16100. "../enum/TagStates": 44,
  16101. "../enum/Viewmode": 51,
  16102. "../enum/WarpStyle": 52,
  16103. "../objects/Snapshot": 153,
  16104. "../settings": 166,
  16105. "../util/common": 185,
  16106. "../util/lerp": 188,
  16107. "../util/logger": 189,
  16108. "./Billboard/BillboardEvent": 120,
  16109. "./Media/LinkType": 130,
  16110. "./Media/MediaEvent": 131,
  16111. events: 202,
  16112. three: 217
  16113. }],
  16114. 125: [function(e, t, i) {
  16115. (function(i) {
  16116. "use strict";
  16117. function n() {
  16118. this.embedWrapper = null,
  16119. this.embedElement = null
  16120. }
  16121. var r = e("../../util/ajax")
  16122. , o = e("./mediaSettings")
  16123. , a = e("../../settings")
  16124. , s = e("../../util/logger")
  16125. , l = new s(i);
  16126. n.prototype.createDomElement = function() {
  16127. return this.embedWrapper = document.createElement("div"),
  16128. this.embedWrapper.classList.add("tag-embed"),
  16129. this.embedWrapper.classList.add("hidden"),
  16130. this.embedWrapper
  16131. }
  16132. ,
  16133. n.prototype.load = function(e) {
  16134. var t = "https://api.embedly.com/1/oembed?key=" + a.appConfig.embedly_key + "&url=" + encodeURIComponent(e) + "&maxwidth=" + o.maxEmbedWidth;
  16135. return new Promise(function(e, i) {
  16136. r.get(t).then(function(t) {
  16137. if (t = JSON.parse(t),
  16138. t.html && t.html.indexOf("<script") === -1) {
  16139. this.embedWrapper.innerHTML = t.html;
  16140. var n = Math.min(t.width, o.maxEmbedWidth) || o.maxEmbedWidth;
  16141. if (this.embedWrapper.style.width = n + "px",
  16142. t.height) {
  16143. var r = t.height / t.width;
  16144. this.embedWrapper.style.height = n * r + "px"
  16145. }
  16146. this.embedElement = this.embedWrapper.firstChild;
  16147. var a = [];
  16148. try {
  16149. a = [].slice.call(this.embedElement.querySelectorAll("a"))
  16150. } catch (e) {
  16151. l.debug("Error getting `a` elements for embed; was it an iframe?")
  16152. }
  16153. a.forEach(function(e) {
  16154. e.setAttribute("target", "_blank")
  16155. }),
  16156. this.embedElement.classList.add("hidden"),
  16157. this.embedWrapper.classList.remove("hidden"),
  16158. e()
  16159. } else
  16160. i("Not a valid embed")
  16161. }
  16162. .bind(this), function(e) {
  16163. i(e.response)
  16164. })
  16165. }
  16166. .bind(this))
  16167. }
  16168. ,
  16169. n.prototype.show = function() {
  16170. this.embedElement && this.embedElement.classList.remove("hidden")
  16171. }
  16172. ,
  16173. n.prototype.hide = function() {
  16174. this.embedElement && this.embedElement.classList.add("hidden")
  16175. }
  16176. ,
  16177. t.exports = n
  16178. }
  16179. ).call(this, "/js/tag/Media/EmbedlyEmbed.js")
  16180. }
  16181. , {
  16182. "../../settings": 166,
  16183. "../../util/ajax": 181,
  16184. "../../util/logger": 189,
  16185. "./mediaSettings": 132
  16186. }],
  16187. 126: [function(e, t, i) {
  16188. (function(i) {
  16189. "use strict";
  16190. function n(e) {
  16191. o.call(this),
  16192. this.options = e,
  16193. this.playerControls = null,
  16194. this.state = s.NOT_READY
  16195. }
  16196. var r = e("../../util/browser")
  16197. , o = e("./EmbedlyEmbed")
  16198. , a = e("../../util/logger")
  16199. , s = (new a(i),
  16200. Object.freeze({
  16201. NOT_READY: "player.not.ready",
  16202. CUED: "player.cued",
  16203. PLAYING: "player.playing",
  16204. PAUSED: "player.paused"
  16205. }));
  16206. n.prototype = Object.create(o.prototype),
  16207. n.prototype.createDomElement = function() {
  16208. return this.embedWrapper = document.createElement("div"),
  16209. this.embedWrapper.classList.add("tag-video"),
  16210. this.embedWrapper.classList.add("hidden"),
  16211. this.embedWrapper
  16212. }
  16213. ,
  16214. n.prototype.load = function(e) {
  16215. var t = function() {
  16216. function e(e) {
  16217. this.playerState = s.CUED,
  16218. this.options.startMuted && this.playerControls.mute()
  16219. }
  16220. function t(e) {
  16221. this.playerState = e
  16222. }
  16223. function i(e) {
  16224. this.playerControls.setCurrentTime(0),
  16225. this.options.loop ? this.playerControls.play() : this.playerControls.pause()
  16226. }
  16227. this.playerControls = new playerjs.Player(this.embedElement),
  16228. this.playerControls.on("ready", e.bind(this)),
  16229. this.playerControls.on("play", t.bind(this, s.PLAYING)),
  16230. this.playerControls.on("pause", t.bind(this, s.PAUSED)),
  16231. this.playerControls.on("ended", i.bind(this))
  16232. }
  16233. .bind(this);
  16234. return o.prototype.load.call(this, e).then(t.bind(this))
  16235. }
  16236. ,
  16237. n.prototype.play = function() {
  16238. var e = r.isMobile();
  16239. return function() {
  16240. this.playerState !== s.NOT_READY && this.playerControls && !e && (this.state === s.CUED && this.options.autoPlay || this.options.autoResume) && this.playerControls.play()
  16241. }
  16242. }(),
  16243. n.prototype.pause = function() {
  16244. this.playerState !== s.NOT_READY && this.playerControls && this.playerControls.pause()
  16245. }
  16246. ,
  16247. t.exports = n
  16248. }
  16249. ).call(this, "/js/tag/Media/EmbedlyPlayer.js")
  16250. }
  16251. , {
  16252. "../../util/browser": 182,
  16253. "../../util/logger": 189,
  16254. "./EmbedlyEmbed": 125
  16255. }],
  16256. 127: [function(e, t, i) {
  16257. (function(i) {
  16258. "use strict";
  16259. function n(e) {
  16260. function t() {
  16261. return a.debug("requesting file from embedly:", e.href),
  16262. r.get(e.href, {
  16263. responseType: e.responseType
  16264. }).then(function(t) {
  16265. return a.debug("requesting file finished:", e.href),
  16266. t
  16267. })
  16268. }
  16269. function i() {}
  16270. return s = new Promise(function(e, n) {
  16271. s.catch(i).then(function() {
  16272. t().then(e, n)
  16273. })
  16274. }
  16275. )
  16276. }
  16277. var r = e("../../util/ajax")
  16278. , o = (e("./mediaSettings"),
  16279. e("../../util/logger"))
  16280. , a = new o(i)
  16281. , s = Promise.resolve();
  16282. t.exports.enqueue = n
  16283. }
  16284. ).call(this, "/js/tag/Media/EmbedlyQueue.js")
  16285. }
  16286. , {
  16287. "../../util/ajax": 181,
  16288. "../../util/logger": 189,
  16289. "./mediaSettings": 132
  16290. }],
  16291. 128: [function(e, t, i) {
  16292. (function(i) {
  16293. "use strict";
  16294. function n() {
  16295. this.imageWrapper = null,
  16296. this.width = 0,
  16297. this.height = 0,
  16298. this.aspect = 1
  16299. }
  16300. var r = e("./MediaEvent")
  16301. , o = e("./EmbedlyQueue")
  16302. , a = e("events").EventEmitter
  16303. , s = e("../../util/logger")
  16304. , l = e("../../settings");
  16305. new s(i);
  16306. n.prototype = Object.create(a.prototype),
  16307. n.prototype.createDomElement = function() {
  16308. return this.imageWrapper = document.createElement("div"),
  16309. this.imageWrapper.classList.add("tag-image"),
  16310. this.imageWrapper.classList.add("hidden"),
  16311. this.imageWrapper.addEventListener("click", function(e) {
  16312. e.stopPropagation(),
  16313. this.emit(r.IMAGE_OPENING),
  16314. this.imageWrapper.style.pointerEvents = "none"
  16315. }
  16316. .bind(this)),
  16317. this.imageWrapper
  16318. }
  16319. ,
  16320. n.prototype.onClosed = function() {
  16321. this.imageWrapper.style.pointerEvents = "auto"
  16322. }
  16323. ,
  16324. n.prototype.load = function(e) {
  16325. var t = Math.max(window.screen.height, window.screen.width)
  16326. , i = "https://i.embed.ly/1/display/resize?key=" + l.appConfig.embedly_key + "&url=" + encodeURIComponent(e) + "&width=" + t + "&height=" + t;
  16327. return new Promise(function(e, t) {
  16328. function n(t) {
  16329. var i = t.target;
  16330. this.width = i.naturalWidth,
  16331. this.height = i.naturalHeight,
  16332. this.aspect = this.width / this.height;
  16333. var n = t.target.src;
  16334. this.imageWrapper.style.backgroundImage = 'url("' + n + '")',
  16335. this.imageWrapper.style.width = this.width + "px",
  16336. this.imageWrapper.style.height = this.height + "px",
  16337. this.imageWrapper.classList.remove("hidden"),
  16338. e()
  16339. }
  16340. o.enqueue({
  16341. href: i,
  16342. responseType: "arraybuffer"
  16343. }).then(function(e) {
  16344. var t = new Uint8Array(e)
  16345. , i = new Blob([t])
  16346. , r = new window.Image;
  16347. r.addEventListener("load", n.bind(this));
  16348. var o = URL.createObjectURL(i);
  16349. r.src = o
  16350. }
  16351. .bind(this), t)
  16352. }
  16353. .bind(this))
  16354. }
  16355. ,
  16356. t.exports = n
  16357. }
  16358. ).call(this, "/js/tag/Media/Image.js")
  16359. }
  16360. , {
  16361. "../../settings": 166,
  16362. "../../util/logger": 189,
  16363. "./EmbedlyQueue": 127,
  16364. "./MediaEvent": 131,
  16365. events: 202
  16366. }],
  16367. 129: [function(e, t, i) {
  16368. "use strict";
  16369. function n(e) {
  16370. this.label = e.label,
  16371. this.href = e.url,
  16372. this.type = this.updateLinkForType(),
  16373. this.domElement = null,
  16374. this.id = c++
  16375. }
  16376. var r = e("./LinkType")
  16377. , o = e("./MediaEvent")
  16378. , a = e("../../util/browser")
  16379. , s = e("../../analytics")
  16380. , l = e("events").EventEmitter
  16381. , c = 0;
  16382. n.prototype = Object.create(l.prototype),
  16383. n.prototype.updateLinkForType = function() {
  16384. function e(e) {
  16385. var t = new RegExp("[#&?]start=([^#&?]*)")
  16386. , i = t.exec(e);
  16387. return i[1]
  16388. }
  16389. function t(e) {
  16390. return e + "&play=1"
  16391. }
  16392. var i = a.valueFromHash("m") || a.valueFromHash("model");
  16393. 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),
  16394. r.NAVIGATION) : (this.href = t(this.href),
  16395. r.MODEL) : r.EXT_LINK
  16396. }
  16397. ;
  16398. var h = {};
  16399. n.prototype.createDomElement = function() {
  16400. function e(e) {
  16401. switch (e.stopPropagation(),
  16402. h[this.id] = !0,
  16403. s.trackAlways("click_tag_link", {
  16404. link_type: this.type,
  16405. link_count: c,
  16406. links_clicked: Object.keys(h).length
  16407. }),
  16408. this.type) {
  16409. case r.MODEL:
  16410. window.location.replace(this.href);
  16411. break;
  16412. case r.EXT_LINK:
  16413. window.open(this.href, "_blank")
  16414. }
  16415. this.emit(o.LINK_CLICK, {
  16416. type: this.type,
  16417. url: this.href
  16418. })
  16419. }
  16420. if (this.domElement = document.createElement("a"),
  16421. this.domElement.classList.add("tag-link"),
  16422. this.domElement.textContent = this.label,
  16423. this.type === r.EXT_LINK) {
  16424. this.domElement.textContent += " ";
  16425. var t = document.createElement("i");
  16426. t.classList.add("icon-ext-link"),
  16427. t.title = "Link to external web site",
  16428. this.domElement.appendChild(t)
  16429. }
  16430. return this.domElement.addEventListener("click", e.bind(this)),
  16431. this.domElement
  16432. }
  16433. ,
  16434. t.exports = n
  16435. }
  16436. , {
  16437. "../../analytics": 4,
  16438. "../../util/browser": 182,
  16439. "./LinkType": 130,
  16440. "./MediaEvent": 131,
  16441. events: 202
  16442. }],
  16443. 130: [function(e, t, i) {
  16444. "use strict";
  16445. t.exports = {
  16446. NAVIGATION: "navigation",
  16447. MODEL: "model",
  16448. EXT_LINK: "ext-link"
  16449. }
  16450. }
  16451. , {}],
  16452. 131: [function(e, t, i) {
  16453. "use strict";
  16454. t.exports = Object.freeze({
  16455. LINK_CLICK: "mtmedia.link",
  16456. IMAGE_LOADED: "mtmedia.image.loaded",
  16457. IMAGE_OPENING: "mtmedia.image.opening",
  16458. IMAGE_OPENED: "mtmedia.image.opened",
  16459. IMAGE_CLOSING: "mtmedia.image.closing",
  16460. IMAGE_CLOSED: "mtmedia.image.closed",
  16461. VIDEO_START: "mtmedia.video.start",
  16462. VIDEO_PAUSE: "mtmedia.video.pause",
  16463. VIDEO_ENDED: "mtmedia.video.end"
  16464. })
  16465. }
  16466. , {}],
  16467. 132: [function(e, t, i) {
  16468. "use strict";
  16469. t.exports = Object.freeze({
  16470. maxEmbedWidth: 350,
  16471. defaultAspectRatio: .75
  16472. })
  16473. }
  16474. , {}],
  16475. 133: [function(e, t, i) {
  16476. "use strict";
  16477. t.exports = Object.freeze({
  16478. TEXT: "text",
  16479. LINK: "link",
  16480. IMAGE: "photo",
  16481. VIDEO: "video",
  16482. RICH: "rich"
  16483. })
  16484. }
  16485. , {}],
  16486. 134: [function(e, t, i) {
  16487. "use strict";
  16488. function n(e) {
  16489. this.capabilities = {
  16490. links: {
  16491. enable: e.supportLinks,
  16492. keepLabels: e.keepLinkLabels
  16493. }
  16494. }
  16495. }
  16496. var r = e("./DescriptionChunkType");
  16497. n.prototype.parse = function(e, t) {
  16498. var i = []
  16499. , n = e.split("[").map(function(e, t) {
  16500. return 0 === t ? e : "[" + e
  16501. });
  16502. return n.forEach(function(e) {
  16503. var n = this.findMarkdown(e);
  16504. if (n) {
  16505. if (n.url.indexOf("javascript:") !== -1)
  16506. return;
  16507. this.addLinkChunk(i, n, t),
  16508. this.addTextChunk(i, e.slice(n.markdown.length))
  16509. } else
  16510. this.addTextChunk(i, e)
  16511. }
  16512. .bind(this)),
  16513. i
  16514. }
  16515. ,
  16516. n.prototype.findMarkdown = function(e) {
  16517. var t = /\[([^\]]*)\]\((.*)\)/
  16518. , i = e.match(t);
  16519. if (i) {
  16520. for (var n = i[2], r = 1, o = 0; o < n.length && ("(" === n[o] ? r++ : ")" === n[o] && r--,
  16521. 0 !== r); )
  16522. o++;
  16523. var a = n.length - o;
  16524. return {
  16525. markdown: i[0].substring(0, i[0].length - a),
  16526. label: i[1],
  16527. url: i[2].substring(0, o)
  16528. }
  16529. }
  16530. }
  16531. ,
  16532. n.prototype.addTextChunk = function(e, t) {
  16533. 0 !== t.length && e.push({
  16534. type: r.TEXT,
  16535. text: t
  16536. })
  16537. }
  16538. ,
  16539. n.prototype.addLinkChunk = function(e, t) {
  16540. if (!this.capabilities.links.enable)
  16541. return void (this.capabilities.links.keepLabels && this.addTextChunk(e, t.label));
  16542. var i = {
  16543. label: t.label,
  16544. url: t.url
  16545. };
  16546. i.url.indexOf("://") === -1 && (i.url = "http://" + i.url),
  16547. e.push({
  16548. type: r.LINK,
  16549. link: i
  16550. })
  16551. }
  16552. ,
  16553. t.exports = n
  16554. }
  16555. , {
  16556. "./DescriptionChunkType": 133
  16557. }],
  16558. 135: [function(e, t, i) {
  16559. (function(i) {
  16560. "use strict";
  16561. var n = e("../util/logger")
  16562. , r = new n(i)
  16563. , o = {
  16564. parseIdsFromChunkName: function(e, t) {
  16565. t.floorId = o.parseFloor(e),
  16566. t.roomId = o.parseRoom(e)
  16567. },
  16568. parseFloor: function(e) {
  16569. var t = e.match(/_group([0-9]+)/);
  16570. if (!t)
  16571. return 0;
  16572. try {
  16573. return parseInt(t[1], 10)
  16574. } catch (e) {
  16575. return r.warn('Non-int value "' + t[1] + '" for mesh group, defaulting to floor 0'),
  16576. 0
  16577. }
  16578. },
  16579. parseRoom: function(e) {
  16580. var t = e.match(/_sub([0-9]+)/);
  16581. if (!t)
  16582. return -1;
  16583. try {
  16584. return parseInt(t[1], 10)
  16585. } catch (e) {
  16586. return r.warn('Non-int value "' + t[1] + '" for mesh subgroup, defaulting to subgroup 0'),
  16587. 0
  16588. }
  16589. }
  16590. };
  16591. t.exports = o
  16592. }
  16593. ).call(this, "/js/model/Chunks.js")
  16594. }
  16595. , {
  16596. "../util/logger": 189
  16597. }],
  16598. 136: [function(e, t, i) {
  16599. (function(i) {
  16600. "use strict";
  16601. function n(e) {
  16602. s.call(this),
  16603. this.model = e,
  16604. this.exploded = !1
  16605. }
  16606. var r = e("../objects/Floor")
  16607. , o = (e("../settings"),
  16608. e("../util/logger"))
  16609. , a = e("../util/transitions")
  16610. , s = e("../util/IndexedCollection")
  16611. , l = e("../util/common")
  16612. , c = e("../util/easing");
  16613. new o(i);
  16614. l.inherit(n, s),
  16615. n.prototype.add = function(e) {
  16616. s.prototype.add.call(this, e),
  16617. this.model.add(e)
  16618. }
  16619. ,
  16620. n.prototype.getIndex = function(e) {
  16621. return e.floorIndex
  16622. }
  16623. ,
  16624. n.prototype.build = function() {
  16625. this.list.forEach(function(e) {
  16626. e.build()
  16627. })
  16628. }
  16629. ,
  16630. n.prototype.size = function() {
  16631. return this.length
  16632. }
  16633. ,
  16634. n.prototype.sort = function() {
  16635. s.prototype.sort.call(this, function(e, t) {
  16636. return e.floorIndex - t.floorIndex
  16637. })
  16638. }
  16639. ,
  16640. n.prototype.nextFloor = function(e, t) {
  16641. return this.index[e.floorIndex + t] || null
  16642. }
  16643. ,
  16644. n.prototype.getFloorAtPoint = function(e) {
  16645. for (var t = null, i = 1 / 0, n = 0; n < this.list.length; n++) {
  16646. var r = this.list[n]
  16647. , o = r.distanceToPoint(e);
  16648. (!t || i > o) && (i = o,
  16649. t = r)
  16650. }
  16651. return t
  16652. }
  16653. ,
  16654. n.prototype.getOrMakeFloor = function(e) {
  16655. var t = this.index[e];
  16656. return t || (t = new r(this.model,e),
  16657. this.add(t)),
  16658. t
  16659. }
  16660. ,
  16661. n.prototype.hide = function() {
  16662. this.list.forEach(function(e) {
  16663. e.hide()
  16664. })
  16665. }
  16666. ,
  16667. n.prototype.show = function() {
  16668. this.list.forEach(function(e) {
  16669. e.show()
  16670. })
  16671. }
  16672. ,
  16673. n.prototype.names = function() {
  16674. return this.list.reduce(function(e, t) {
  16675. return e.concat(t.name)
  16676. }, [])
  16677. }
  16678. ,
  16679. n.prototype.toggleExplodeHorizontal = function() {
  16680. function e(e, t) {
  16681. r.copy(e.position),
  16682. e.position.x = i[e.floorIndex] * t,
  16683. e.position.y = 1 * e.floorIndex * t,
  16684. r.sub(e.position).multiplyScalar(-1),
  16685. e.panos.forEach(function(e) {
  16686. e.translate(r)
  16687. })
  16688. }
  16689. var t, i = [], n = 0;
  16690. this.list.forEach(function(e, r, o) {
  16691. t = r > 0 ? Math.max(o[r - 1].boundingBox.max.x - e.boundingBox.min.x, e.boundingBox.size().x / 2) : 0,
  16692. n += t,
  16693. i[r] = n
  16694. }),
  16695. i = i.map(function(e) {
  16696. return e - n / 2
  16697. });
  16698. var r = this.list[0].position.clone();
  16699. this.exploded ? this.list.forEach(function(t) {
  16700. a.start(function(i) {
  16701. e(t, 1 - i)
  16702. }, 1500, null, 0, c.easeOutExpo)
  16703. }) : this.list.forEach(function(t) {
  16704. a.start(function(i) {
  16705. e(t, i)
  16706. }, 1500, null, 0, c.easeOutExpo)
  16707. }),
  16708. this.exploded = !this.exploded
  16709. }
  16710. ,
  16711. n.prototype.toggleExplodeVertical = function() {
  16712. function e(e, i) {
  16713. var n = n.copy(e.position);
  16714. e.position.y = (5 * e.floorIndex - t.y / 2) * i,
  16715. n.sub(e.position).multiplyScalar(-1),
  16716. e.panos.forEach(function(e) {
  16717. e.translate(n)
  16718. })
  16719. }
  16720. var t = this.model.size;
  16721. this.list[0].position.clone();
  16722. this.exploded ? this.list.forEach(function(t) {
  16723. a.start(function(i) {
  16724. e(t, 1 - i)
  16725. }, 1500, null, 0, c.easeOutExpo)
  16726. }) : this.list.forEach(function(t) {
  16727. a.start(function(i) {
  16728. e(t, i)
  16729. }, 1500, null, 0, c.easeOutExpo)
  16730. }),
  16731. this.exploded = !this.exploded
  16732. }
  16733. ,
  16734. t.exports = n
  16735. }
  16736. ).call(this, "/js/model/FloorCollection.js")
  16737. }
  16738. , {
  16739. "../objects/Floor": 146,
  16740. "../settings": 166,
  16741. "../util/IndexedCollection": 175,
  16742. "../util/common": 185,
  16743. "../util/easing": 186,
  16744. "../util/logger": 189,
  16745. "../util/transitions": 195
  16746. }],
  16747. 137: [function(e, t, i) {
  16748. (function(i) {
  16749. "use strict";
  16750. function n() {
  16751. c.call(this)
  16752. }
  16753. var r = e("../settings")
  16754. , o = e("../util/logger")
  16755. , a = e("../enum/Viewmode")
  16756. , s = e("../objects/Snapshot")
  16757. , l = (e("../util/math"),
  16758. e("../util/common"))
  16759. , c = e("../util/IndexedCollection")
  16760. , h = new o(i);
  16761. l.inherit(n, c),
  16762. n.prototype.getImage = function(e) {
  16763. return e && this.index.hasOwnProperty(e) ? this.index[e] : null
  16764. }
  16765. ,
  16766. n.prototype.filterByModesAndReel = function(e, t) {
  16767. for (var i = [], n = 0; n < t.length; n += 1) {
  16768. var r = t[n]
  16769. , o = this.index[r.sid];
  16770. o && i.push(o)
  16771. }
  16772. var s = e[a.DOLLHOUSE]
  16773. , l = e[a.FLOORPLAN];
  16774. i = i.filter(function(e) {
  16775. if (!e.metadata || void 0 === e.metadata.camera_mode)
  16776. return !0;
  16777. var t;
  16778. try {
  16779. t = a.convertWorkshopModeInt(e.metadata.camera_mode)
  16780. } catch (e) {
  16781. return h.debug(e.message),
  16782. !1
  16783. }
  16784. return t === a.PANORAMA || t === a.FLOORPLAN && l || t === a.DOLLHOUSE && s
  16785. }),
  16786. i.length !== this.list.length && h.info("Disallowed " + (this.list.length - i.length) + " highlight images"),
  16787. this.list = i,
  16788. this.reIndex()
  16789. }
  16790. ,
  16791. n.prototype.getHeroLocations = function(e) {
  16792. if (0 === this.list.length)
  16793. return [];
  16794. for (var t = [], i = 1; i < this.list.length; ++i) {
  16795. var o = this.list[i]
  16796. , l = rootPath.replace(/(http:|https:)/ig,'') + o.thumbnail_signed_src
  16797. , c = o.name || '';
  16798. if (o.metadata && void 0 !== o.metadata.camera_quaternion) {
  16799. if (!r.show360Views.enabled && o.metadata.scan_id) {
  16800. var h = e.get(o.metadata.scan_id);
  16801. if (h && !h.isAligned())
  16802. continue
  16803. }
  16804. var u = a.convertWorkshopModeInt(o.metadata.camera_mode);
  16805. if (u === a.MESH)
  16806. continue;
  16807. var d = {
  16808. cameraMode: u,
  16809. position: o.metadata.camera_position,
  16810. quaternion: o.metadata.camera_quaternion,
  16811. panoId: o.metadata.scan_id,
  16812. orthoZoom: o.metadata.ortho_zoom,
  16813. floorVisibility: void 0 !== o.metadata.floor_visibility ? o.metadata.floor_visibility.slice(0) : [],
  16814. thumbUrl: g_version === "one" ? g_Prefix + l + "?"+ randomTime().getTime() : '//' + l + "?"+ randomTime().getTime(),
  16815. name: n.filterImageName(c),
  16816. sid: o.sid //xzw add g_tourAudio要用
  16817. }
  16818. , p = new s(d);
  16819. t.push(p)
  16820. }
  16821. }
  16822. return t
  16823. }
  16824. ,
  16825. n.prototype.getIndex = function(e) {
  16826. return e.sid
  16827. }
  16828. ,
  16829. n.filterImageName = function(e) {
  16830. return "" === e || e.match(/^[0-9.]+_[0-9.]+$/) ? null : e
  16831. }
  16832. ,
  16833. t.exports = n
  16834. }
  16835. ).call(this, "/js/model/ImageCollection.js")
  16836. }
  16837. , {
  16838. "../enum/Viewmode": 51,
  16839. "../objects/Snapshot": 153,
  16840. "../settings": 166,
  16841. "../util/IndexedCollection": 175,
  16842. "../util/common": 185,
  16843. "../util/logger": 189,
  16844. "../util/math": 190
  16845. }],
  16846. 138: [function(e, t, i) {
  16847. (function(i) {
  16848. "use strict";
  16849. function n() {
  16850. u.call(this)
  16851. }
  16852. var r = e("../label/Label")
  16853. , o = e("../settings")
  16854. , a = e("../util/logger")
  16855. , s = e("../util/math")
  16856. , l = e("../util/ajax")
  16857. , c = e("./RoomCollection")
  16858. , h = e("../util/common")
  16859. , u = e("../util/IndexedCollection");
  16860. new a(i);
  16861. h.inherit(n, u),
  16862. n.prototype.getIndex = function(e) {
  16863. return e.labelId
  16864. }
  16865. ,
  16866. n.prototype.associateWithRooms = function(e) {
  16867. this.forEach(function(t) {
  16868. e.forEach(function(e) {
  16869. e.roomId === t.roomId && (t.room = e)
  16870. })
  16871. })
  16872. }
  16873. ,
  16874. n.prototype.createFromLabelData = function(e) {
  16875. e.forEach(function(e) {
  16876. var t = n.parseRoomIndexFromWorkshopRoomId(e.roomId);
  16877. t = c.generateRoomId(e.floorId, t);
  16878. var i = new r(e.sid,e.position || e.positions[0],e.text,e.floorId,t);
  16879. i.position = s.convertWorkshopVector(i.position),
  16880. this.add(i),
  16881. i.build()
  16882. }
  16883. .bind(this))
  16884. }
  16885. ,
  16886. n.prototype.load = function(e, t) {
  16887. return l.get(e, {
  16888. responseType: "json",
  16889. auth: t ? o.authorizationHeader : null
  16890. }).done(function(e) {
  16891. var t = [];
  16892. for (var i in e) {
  16893. var n = e[i];
  16894. t.push(n)
  16895. }
  16896. this.createFromLabelData(t)
  16897. }
  16898. .bind(this))
  16899. }
  16900. ,
  16901. n.parseRoomIndexFromWorkshopRoomId = function(e) {
  16902. var t = -1;
  16903. if (e) {
  16904. var i = e.split("_");
  16905. t = parseInt(i[0])
  16906. }
  16907. return t
  16908. }
  16909. ,
  16910. t.exports = n
  16911. }
  16912. ).call(this, "/js/model/LabelCollection.js")
  16913. }
  16914. , {
  16915. "../label/Label": 90,
  16916. "../settings": 166,
  16917. "../util/IndexedCollection": 175,
  16918. "../util/ajax": 181,
  16919. "../util/common": 185,
  16920. "../util/logger": 189,
  16921. "../util/math": 190,
  16922. "./RoomCollection": 141
  16923. }],
  16924. 139: [function(e, t, i) {
  16925. (function(i) {
  16926. "use strict";
  16927. function n(e, t) {
  16928. o.Object3D.call(this),
  16929. this.sid = t.sid,
  16930. this.data = t,
  16931. this.options = e,
  16932. this.urls = new s(e.urlFiles),
  16933. this.isPublic = void 0 !== t.is_public && t.is_public,
  16934. this.images = new _(this),
  16935. this.images.extend(t.images),
  16936. this.heroImage = this.images.getImage(t.icon),
  16937. this.heroLocations = [],
  16938. this.outdoorPanoLocations = [],
  16939. this.floors = new d(this),
  16940. this.floorsEnabled = void 0 === e.floors || e.floors,
  16941. this.changingFloor = !1,
  16942. this.chunks = [],
  16943. this.panos = new A,
  16944. this.colliders = [],
  16945. this.loadPanosPromise = null,
  16946. this.loadMeshTexturesPromise = null,
  16947. this.auxDataPromise = null,
  16948. this.meshTexturesLoaded = !1,
  16949. this.meshTextures = [],
  16950. this.tags = {},
  16951. this.tagsShown = !1,
  16952. this.shouldShowtags = !1,
  16953. this.has360Views = !1,
  16954. this.showingLabels = f.labels.enabled && t.player_options.labels,
  16955. this.supportedModes = {},
  16956. this.supportedModes[c.PANORAMA] = !0,
  16957. this.supportedModes[c.DOLLHOUSE] = !t.player_options || t.player_options.dollhouse && w.valueFromHash("dh", 1),
  16958. this.supportedModes[c.FLOORPLAN] = !t.player_options || t.player_options.floor_plan && w.valueFromHash("dh", 1),
  16959. this.supportedModes[c.TRANSITIONING] = !0,
  16960. this.supportsTiles = this.configureTiling(),
  16961. this.supportsVR = t.is_vr,
  16962. this.mode = c.DOLLHOUSE,
  16963. this.size = null,
  16964. this.center = null,
  16965. this.boundingBox = new o.Box3,
  16966. this.currentFloor = null,
  16967. this.allFloorsVisible = !0,
  16968. this.projectedPano0 = null,
  16969. this.projectedPano1 = null,
  16970. this.floorsEnabled && t.floors && t.floors.indexOf(",") !== -1 && t.floors.split(",").forEach(function(e, t) {
  16971. this.addFloor(new u(this,t,e.trim()))
  16972. }
  16973. .bind(this)),
  16974. this.waitQueue = [],
  16975. this.on("load", function(e) {
  16976. 0 !== this.waitQueue.length && (this.waitQueue = this.waitQueue.filter(function(e) {
  16977. return !e.isLoadedCallback()
  16978. }),
  16979. 0 === this.waitQueue.length && this.emit("waiting-done"))
  16980. }
  16981. .bind(this)),
  16982. this.setupCustomProperties()
  16983. this.hots = {};
  16984. }
  16985. function r() {
  16986. try {
  16987. var e = document.createElement("canvas")
  16988. , t = e.getContext("webgl");
  16989. t || (t = e.getContext("experimental-webgl"));
  16990. var i = t.getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE);
  16991. return i
  16992. } catch (e) {
  16993. return 0
  16994. }
  16995. }
  16996. var o = e("three")
  16997. , a = e("../util/ajax")
  16998. , s = e("../util/ModelUrls")
  16999. , l = e("../objects/BoundingTextureSkybox")
  17000. , c = e("../enum/Viewmode")
  17001. , h = e("../enum/RenderOrder")
  17002. , u = (e("../enum/AlignmentType"),
  17003. e("../objects/Floor"))
  17004. , d = e("./FloorCollection")
  17005. , p = e("../objects/Chunk")
  17006. , f = (e("../objects/Room"),
  17007. e("../objects/Snapshot"),
  17008. e("../label/Label"),
  17009. e("../util/math"),
  17010. e("../settings"))
  17011. ,ss = e("../shaders")
  17012. , g = e("../util/logger")
  17013. , m = e("../tag/tag")
  17014. , v = (e("../tag/tagManager"),
  17015. e("../objects/Panorama"))
  17016. , A = e("../util/PanoramaCollection")
  17017. , y = e("../loaders/ModelLoader")
  17018. , C = e("../loaders/ModelTextureLoader")
  17019. , I = e("../loaders/SweepDataLoader")
  17020. , E = e("../util/transitions")
  17021. , b = (e("../util/easing"),
  17022. e("../util/lerp"),
  17023. e("../util/common"))
  17024. , w = (e("../util/texture"),
  17025. e("./../util/browser"))
  17026. , _ = e("./ImageCollection")
  17027. , T = e("./RoomCollection")
  17028. , x = e("./LabelCollection")
  17029. , S = e("./Chunks")
  17030. , M = e("./../util/showcase")
  17031. , R = e("../exception/BasicException")
  17032. , P = (e("../constants")
  17033. ,e("events").EventEmitter)
  17034. ,Hot = e("hot")
  17035. , O = new g(i);
  17036. n.prototype = Object.create(o.Object3D.prototype),
  17037. b.extend(n, P),
  17038. n.prototype.setupCustomProperties = function() {
  17039. var e = f.modelAlpha;
  17040. Object.defineProperty(this, "alpha", {
  17041. get: function() {
  17042. return e
  17043. },
  17044. set: function(t) {
  17045. e = t,
  17046. this.chunks.forEach(function(t) {
  17047. t.material && t.material.uniforms.modelAlpha && (t.material.uniforms.modelAlpha.value = e)
  17048. })
  17049. }
  17050. })
  17051. }
  17052. ,
  17053. n.prototype.configureTiling = function() {
  17054. var e = r();
  17055. if (e < 2048)
  17056. return !1;
  17057. O.warn("Max cube texture size: " + e);
  17058. for (var t = 0; t < f.tiling.tilingFlagNames.length; t++) {
  17059. var i = f.tiling.tilingFlagNames[t];
  17060. if ("1" === w.valueFromHash(i, null))
  17061. return !0;
  17062. if ("0" === w.valueFromHash(i, null))
  17063. return !1
  17064. }
  17065. //--------------------------------------------许钟文-------------------------------------------
  17066. //return true;
  17067. return !!M.modelDataPromisesTiles(this.data) //免去访问mdoeldata.json的vision_version,不明白这是什么
  17068. //--------------------------------------------e n d -------------------------------------------
  17069. }
  17070. ,
  17071. n.prototype.toggleAlpha = function() {
  17072. this.alpha < 1 ? this.alpha = 1 : this.alpha = 0
  17073. }
  17074. ,
  17075. n.prototype.load = function(e) {
  17076. var t = function() {
  17077. return $.when(this.loadPanos(), this.loadMesh())
  17078. }
  17079. , i = this.urls.init().then(t.bind(this));
  17080. return e ? i = i.then(this.loadMeshTextures.bind(this)) : i.then(this.loadMeshTextures.bind(this)),
  17081. this.auxDataPromise = $.when( /*this.loadHighlightReel(), this.loadtags() */this.loadhots(), this.loadLabels()),
  17082. $.when(i, this.auxDataPromise).done(this.build.bind(this)) //不要另外使用active_reel文件
  17083. }
  17084. ,
  17085. n.prototype.loadMesh = function() {
  17086. function e(e) {
  17087. O.error(e),
  17088. n.reject("loading-failed")
  17089. }
  17090. function t(e, t) {
  17091. n.notify(e, t)
  17092. }
  17093. function i(e, t) {
  17094. if (0 === e.length) {
  17095. O.warn("No geometry found for model, loading faux geometry, disabling outside mode"),
  17096. r.supportedModes[c.DOLLHOUSE] = !1,
  17097. r.supportedModes[c.FLOORPLAN] = !1;
  17098. var i = new p({
  17099. geometry: new o.PlaneBufferGeometry(5,5,1,1)
  17100. });
  17101. i.material.visible = !1,
  17102. i.rotateX(-Math.PI / 2),
  17103. i.geometry.computeBoundingBox(),
  17104. e = [i]
  17105. }
  17106. e.forEach(function(e) {
  17107. var t = r.floorsEnabled ? S.parseFloor(e.name) : 0;
  17108. r.addChunk(t, e)
  17109. }),
  17110. r.floors.sort(),
  17111. n.resolve(r)
  17112. }
  17113. var n = $.Deferred()
  17114. , r = this;
  17115. return y.load(r.data.job.uuid, r.urls, i, t, e),
  17116. n.promise()
  17117. }
  17118. ,
  17119. n.prototype.loadMeshTextures = function() {
  17120. return this.loadTexturesPromise ? this.loadTexturesPromise : (this.loadTexturesPromise = C.load(this, this.meshTextures).then(function() {
  17121. this.meshTexturesLoaded = !0
  17122. }
  17123. .bind(this)),
  17124. this.loadTexturesPromise)
  17125. }
  17126. ,
  17127. /* n.prototype.loadtags = function() {//xzw改
  17128. var e = $.Deferred();
  17129. if (!f.tags.enabled)
  17130. return e.resolve();
  17131. //var t = this.options.urlBase + "/api/v1/jsonstore/model/tags/" + this.sid;
  17132. t = "data/" + this.sid + "/tags.json"
  17133. return a.get(t, {
  17134. responseType: "json",
  17135. auth: this.isPublic ? null : f.authorizationHeader
  17136. }).done(function(t) {
  17137. var i = 0
  17138. , n = 0;
  17139. for (var r in t) {
  17140. var o = t[r];
  17141. o.enabled && (n++,
  17142. (o.label.length || o.description.length) && (this.tags[r] = new m(this,r,o),
  17143. i++))
  17144. }
  17145. i !== n && O.warn("Disallowed " + (n - i) + " tags with no text data"),
  17146. e.resolve()
  17147. }
  17148. .bind(this)).fail(function() {
  17149. O.warn("Getting tags failed, not displaying tags."),
  17150. e.resolve()
  17151. }),
  17152. e
  17153. } */
  17154. n.prototype.shineHots = function(){ //xzw
  17155. E.trigger({
  17156. func: function(e) {
  17157. if(e<=0.5) ss.hot.uniforms.opac.value = 2*e;
  17158. else ss.hot.uniforms.opac.value = -2*e + 2;
  17159. }.bind(this),
  17160. cycling: true,
  17161. duration: 3000,
  17162. //easing: "easeInOutQuad",
  17163. name: "hotShine"
  17164. })
  17165. },
  17166. n.prototype.loadhots = function() {//xzw
  17167. var e = $.Deferred();
  17168. var t = g_Prefix+"data/" + this.sid + "/data2.js" +'?'+ randomTime().getTime();
  17169. return a.get(t, {
  17170. responseType: "json",
  17171. auth: this.isPublic ? null : f.authorizationHeader
  17172. }).done(function(t) {
  17173. g_data2 = hotMatcher(t);
  17174. this.hotsCount = 0;
  17175. for(var i in t.hots){
  17176. this.hotsCount ++;
  17177. this.hots[i] = new Hot(i, t.hots[i], this);
  17178. };
  17179. g_index = w.valueFromHash("m");
  17180. if(t.tourAudio){
  17181. g_tourAudio = new Audio;
  17182. g_tourAudio.loop = false;
  17183. g_tourAudio.addEventListener('ended', function () {
  17184. var ev = document.createEvent("MouseEvent");
  17185. ev.initEvent("tourAudioEnded",true,true);
  17186. window.dispatchEvent(ev);
  17187. });
  17188. };
  17189. if(t.weixinDesc){
  17190. g_weixinObj.desc = t.weixinDesc;
  17191. }
  17192. window.wx && manage.weixinShare();
  17193. e.resolve();
  17194. }.bind(this)).fail(function() {
  17195. console.log('没有热点');
  17196. window.wx && manage.weixinShare();
  17197. e.resolve()
  17198. }),
  17199. e
  17200. }
  17201. ,
  17202. n.prototype.loadPanos = function() {
  17203. if (this.loadPanosPromise)
  17204. return this.loadPanosPromise;
  17205. var e = new I(this);
  17206. return this.loadPanosPromise = e.load().then(function(e) {
  17207. return this.data.sweeps && Object.keys(this.data.sweeps).length > 0 && (e = e.filter(function(e) {
  17208. return this.data.sweeps[e.uuid].enabled
  17209. }
  17210. .bind(this))),
  17211. this.panos.extend(e.map(function(e) {
  17212. return new v(this,e.uuid,e,this.supportsTiles)
  17213. }
  17214. .bind(this))),
  17215. this.panos.forEach(function(e) {
  17216. e.neighbourUUIDs && (e.neighbourUUIDs.forEach(function(t) {
  17217. var i = this.panos.get(t);
  17218. i && this.panos.setNeighbour(e, i, !0)
  17219. }
  17220. .bind(this)),
  17221. e.neighbourPanos = this.panos.getNeighbours(e) || this.panos.setNeighbour(e, e, !0))
  17222. }
  17223. .bind(this)),
  17224. 0 === this.panos.length && (O.warn("Model has no panos, turning off inside mode"),
  17225. this.supportedModes[c.PANORAMA] = !1),
  17226. $.when(this)
  17227. }
  17228. .bind(this)),
  17229. this.loadPanosPromise
  17230. }
  17231. ,
  17232. n.prototype.loadHighlightReel = function() {//xzw
  17233. var e = $.Deferred()
  17234. // , t = this.options.urlBase + "/api/v1/jsonstore/model/highlights/" + this.sid + "/active_reel";
  17235. ,t = this.options.urlBase + "data/" + this.sid + "/active_reel.json";
  17236. return a.get(t, {
  17237. responseType: "json",
  17238. auth: this.isPublic ? null : f.authorizationHeader
  17239. }).done(function(t) {
  17240. t.reel ? (O.info("Got highlight reel with " + t.reel.length + " items"),
  17241. this.images.filterByModesAndReel(this.supportedModes, t.reel)) : O.info("No highlight reel found"),
  17242. e.resolve()
  17243. }
  17244. .bind(this)).fail(function() {
  17245. O.warn("Getting highlight reel failed, no highlights available"),
  17246. e.resolve()
  17247. }),
  17248. e
  17249. }
  17250. ,
  17251. n.prototype.waitForLoad = function(e, t) {
  17252. t() || (this.waitQueue.push({
  17253. object: e,
  17254. isLoadedCallback: t
  17255. }),
  17256. 1 === this.waitQueue.length && this.emit("waiting"))
  17257. }
  17258. ,
  17259. n.prototype.hide = function() {
  17260. this.floors.hide()
  17261. }
  17262. ,
  17263. n.prototype.show = function() {
  17264. this.floors.show()
  17265. }
  17266. ,
  17267. n.prototype.floorNames = function() {
  17268. return this.floors.names()
  17269. }
  17270. ,
  17271. n.prototype.warpDestFloors = function(e, t) {
  17272. if (!e || this.floors.length !== e.length)
  17273. return void this.toggleAllFloors(!0);
  17274. var i = e.findIndex(function(e) {
  17275. return e
  17276. }
  17277. .bind(this));
  17278. i !== -1 && this.setFloor(this.floors.list[i], null, t)
  17279. }
  17280. ,
  17281. n.prototype.setFloor = function(e, t, i) {
  17282. this.allFloorsVisible && this.emit("allfloors.toggled", !1, this.currentFloor),
  17283. this.allFloorsVisible = !1,
  17284. this._setFloor(e, t, i)
  17285. }
  17286. ,
  17287. n.prototype.toggleAllFloors = function(e) {
  17288. this.allFloorsVisible = void 0 !== e ? e : !this.allFloorsVisible,
  17289. this.emit("allfloors.toggled", this.allFloorsVisible, this.currentFloor),
  17290. this._setFloor(this.currentFloor)
  17291. }
  17292. ,
  17293. n.prototype._setFloor = function(e, t, i) {
  17294. t = t || this.mode,
  17295. this.emit("floor.changed", e, t, this.currentFloor),
  17296. this.currentFloor = e;
  17297. var n;
  17298. if (t === c.PANORAMA) {
  17299. if (this.show(),
  17300. this.shouldShowtags && this.tagsShown)
  17301. for (n in this.tags)
  17302. this.tags[n].show(f.showFloorDuration)
  17303. } else if ((t === c.FLOORPLAN || t === c.DOLLHOUSE) && (this.floors.list.forEach(function(e, t) {
  17304. e.toggle(e === this.currentFloor || this.allFloorsVisible, i || this.allFloorsVisible)
  17305. }
  17306. .bind(this)),
  17307. this.shouldShowtags && this.tagsShown))
  17308. for (n in this.tags) {
  17309. var r = this.tags[n];
  17310. this.allFloorsVisible ? r.show(f.showFloorDuration) : r.floor === this.currentFloor ? r.show(f.showFloorDuration, f.showFloorDelay) : r.hide(f.hideFloorDuration, f.hideFloorDelay)
  17311. }
  17312. var o = this
  17313. , a = e;
  17314. E.start(function() {}, f.showFloorDelay, function() {
  17315. o.floors.forEach(function(e) {
  17316. e.chunks.forEach(function(t) {
  17317. t.renderOrder = e === a ? h.visibleFloor : h.ghostFloor
  17318. })
  17319. })
  17320. }
  17321. .bind(this))
  17322. }
  17323. ,
  17324. n.prototype.toggleExplode = function() {
  17325. this.floors.toggleExplodeHorizontal()
  17326. }
  17327. ,
  17328. n.prototype.toggleExplodeUp = function() {
  17329. this.floors.toggleExplodeVertical()
  17330. }
  17331. ,
  17332. n.prototype.nextFloor = function(e) {
  17333. return this.floors.nextFloor(this.currentFloor, e)
  17334. }
  17335. ,
  17336. n.prototype.addFloor = function(e) {
  17337. this.floors.add(e)
  17338. }
  17339. ,
  17340. n.prototype.getFloorAtPoint = function(e) {
  17341. return this.floors.getFloorAtPoint(e)
  17342. }
  17343. ,
  17344. n.prototype.getTagBySid = function(e) {
  17345. return this.tags[e]
  17346. }
  17347. ,
  17348. n.prototype.addChunk = function(e, t) {
  17349. this.floors.getOrMakeFloor(e).addChunk(t),
  17350. this.chunks.push(t)
  17351. }
  17352. ,
  17353. n.prototype.setMode = function(e) {
  17354. if (!this.supportedModes[e])
  17355. throw new R("Mode not supported for this model: " + e);
  17356. this.mode = e,
  17357. this.chunks.forEach(function(t) {
  17358. t.setMode(e)
  17359. })
  17360. }
  17361. ,
  17362. n.prototype.build = function() {
  17363. this.heroLocations = this.images.getHeroLocations(this.panos);
  17364. var e = function() {
  17365. 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()
  17366. }
  17367. .bind(this)();
  17368. this.has360Views = f.show360Views.enabled && this.heroLocations.some(function(e) {
  17369. return e.cameraMode === c.PANORAMA && this.panos.get(e.panoId) && !this.panos.get(e.panoId).isAligned()
  17370. }
  17371. .bind(this)) || e,
  17372. null === this.heroImage && O.warn("No hero image defined."),
  17373. this.currentFloor = this.floors.last(),
  17374. this.floors.build(),
  17375. this.colliders = this.floors.reduce(function(e, t) {
  17376. return e.concat(t.collider.children)
  17377. }, []),
  17378. this.panos.forEach(function(e) {
  17379. e.build1(),
  17380. e.on("enter", function() {
  17381. e.floor !== this.currentFloor && this.setFloor(e.floor)
  17382. }
  17383. .bind(this))
  17384. }
  17385. .bind(this)),
  17386. this.panos.forEach(function(e) {
  17387. e.build2()
  17388. }),
  17389. this.floors.forEach(function(e) {
  17390. this.boundingBox.union(e.boundingBox)
  17391. }
  17392. .bind(this)),
  17393. this.size = this.boundingBox.size(),
  17394. this.center = this.boundingBox.center(),
  17395. this.floors.forEach(function(e) {
  17396. O.info("Floor " + e + ": " + e.children.length + " chunks, " + e.panos.length + " panos.")
  17397. }
  17398. .bind(this)),
  17399. this.panos.populate_path_graph(),
  17400. this.skybox = new l(this.boundingBox),
  17401. this.skybox.matrixWorldNeedsUpdate = !0,
  17402. this.add(this.skybox);
  17403. setTimeout(function(){
  17404. this.hotsCount && this.shineHots();
  17405. }.bind(this),1300);//xzw 热点开始闪烁
  17406. for (var t in this.tags)
  17407. this.tags[t].build();
  17408. return O.debug("Done building model"),
  17409. v.raycastsDone > 0 && (O.warn("raycasts: " + v.raycastsDone),
  17410. O.warn("raycasts skipped: " + v.raycastsSkipped)),
  17411. this.buildRooms(),
  17412. this.labels.associateWithRooms(this.rooms),
  17413. $.when(this)
  17414. }
  17415. ,
  17416. n.prototype.loadLabels = function() {//xzw
  17417. this.labels = new x(this);
  17418. var e = $.Deferred();
  17419. //加载俯视图的标签 注释这个备注就会加载
  17420. window.MP_PREFETCHED_MODELDATA.model.player_options.labels ? this.showingLabels = true : '';
  17421. if (!this.showingLabels)
  17422. return e.resolve();
  17423. // var t = this.options.urlBase + "/api/v1/jsonstore/model/labels/" + this.sid;
  17424. var t = g_Prefix + "data/" + this.sid + "/labels.json";
  17425. return this.labels.load(t, !this.isPublic).done(e.resolve.bind(e)).fail(function() {
  17426. O.warn("Getting labels failed, not displaying labels."),
  17427. e.resolve()
  17428. }),
  17429. e
  17430. }
  17431. ,
  17432. n.prototype.buildRooms = function() {
  17433. this.rooms = new T(this),
  17434. this.rooms.createFromChunks(this.chunks),
  17435. this.rooms.calcRoomBoundaries()
  17436. }
  17437. ,
  17438. n.prototype.updateProjectedPanos = function() {
  17439. this.projectedPano0 && this.projectedPano1 && this.setProjectedPanos(this.projectedPano0, this.projectedPano1, !1)
  17440. }
  17441. ,
  17442. n.prototype.setProjectedPanos = function(e, t, i) {
  17443. void 0 !== i && null !== i || (i = !0),
  17444. i = !!i,
  17445. this.projectedPano0 = e,
  17446. this.projectedPano1 = t,
  17447. this.skybox.material.setProjectedPanos(e, t, i),
  17448. this.chunks.forEach(function(n) {
  17449. n.materialInside.setProjectedPanos(e, t, i)
  17450. })
  17451. }
  17452. ,
  17453. n.prototype.setSide = function(e) {
  17454. this.floors.forEach(function(t) {
  17455. t.collider.material.side = e
  17456. })
  17457. }
  17458. ,
  17459. n.prototype.heroCount = function() {
  17460. return this.heroLocations ? this.heroLocations.length : 0
  17461. }
  17462. ,
  17463. n.prototype.getHeroDescriptorByIndex = function(e) {
  17464. if (e < 0)
  17465. return O.warn("Model.getHeroDescriptorByHeroIndex() -> heroIndex is less than 0."),
  17466. null;
  17467. var t = this.heroCount();
  17468. if (t < 1)
  17469. return O.warn("Model.getHeroDescriptorByIndex() -> No hero locations in this model"),
  17470. null;
  17471. var i = this.heroLocations[e];
  17472. return void 0 === i ? (O.warn("Model.getHeroDescriptorByIndex() -> Index " + e + " is not a validindex"),
  17473. null) : i
  17474. }
  17475. ,
  17476. n.prototype.findPanoramicHero = function() {
  17477. for (var e in this.heroLocations)
  17478. if (this.heroLocations[e].cameraMode === c.PANORAMA)
  17479. return this.heroLocations[e];
  17480. return null
  17481. }
  17482. ,
  17483. n.prototype.listImagePanos = function() {
  17484. var e = []
  17485. , t = this;
  17486. return this.images.forEach(function(i) {
  17487. if (i.metadata && i.metadata.scan_id) {
  17488. var n = t.panos.get(i.metadata.scan_id);
  17489. n && (t.supportsTiles || n.isLoaded("high") || e.push(n))
  17490. }
  17491. }),
  17492. e
  17493. }
  17494. ,
  17495. n.prototype.fadePanoMarkers = function(e, t) {
  17496. this.panos.fadeMarkerOpacity(e, t)
  17497. }
  17498. ,
  17499. n.prototype.setSweepVisibility = function(e) {
  17500. this.panos.forEach(function(t) {
  17501. t.marker && (t.marker.visible = e)
  17502. })
  17503. }
  17504. ,
  17505. n.prototype.outsideAllowed = function() {
  17506. return this.supportedModes[c.DOLLHOUSE] && this.supportedModes[c.FLOORPLAN]
  17507. }
  17508. ,
  17509. t.exports = n
  17510. }
  17511. ).call(this, "/js/model/Model.js")
  17512. }
  17513. , {
  17514. "../constants": 8,
  17515. "../enum/AlignmentType": 17,
  17516. "../enum/RenderOrder": 42,
  17517. "../enum/Viewmode": 51,
  17518. "../exception/BasicException": 55,
  17519. "../label/Label": 90,
  17520. "../loaders/ModelLoader": 105,
  17521. "../loaders/ModelTextureLoader": 106,
  17522. "../loaders/SweepDataLoader": 107,
  17523. "../tag/tag": 123,
  17524. "../tag/tagManager": 124,
  17525. "../objects/BoundingTextureSkybox": 143,
  17526. "../objects/Chunk": 144,
  17527. "../objects/Floor": 146,
  17528. "../objects/Panorama": 148,
  17529. "../objects/Room": 150,
  17530. "../objects/Snapshot": 153,
  17531. "../settings": 166,
  17532. "../shaders": 167,
  17533. "../util/ModelUrls": 177,
  17534. "../util/PanoramaCollection": 178,
  17535. "../util/ajax": 181,
  17536. "../util/common": 185,
  17537. "../util/easing": 186,
  17538. "../util/lerp": 188,
  17539. "../util/logger": 189,
  17540. "../util/math": 190,
  17541. "../util/texture": 194,
  17542. "../util/transitions": 195,
  17543. "./../util/browser": 182,
  17544. "./../util/showcase": 193,
  17545. "./Chunks": 135,
  17546. "./FloorCollection": 136,
  17547. "./ImageCollection": 137,
  17548. "./LabelCollection": 138,
  17549. "./RoomCollection": 141,
  17550. events: 202,
  17551. three: 217,
  17552. "hot": "hot"
  17553. }],
  17554. 140: [function(e, t, i) {
  17555. "use strict";
  17556. function n() {
  17557. this.modelMap = {},
  17558. this.activeModel = null,
  17559. this.modelCount = 0,
  17560. this.tileDownloader = null,
  17561. this.panoRenderer = null
  17562. }
  17563. var r = (e("three"),
  17564. e("../util/common"))
  17565. , o = e("../exception/BasicException")
  17566. , a = e("../enum/ModelManagerEvents")
  17567. , s = e("../enum/PanoRendererEvents")
  17568. , l = e("events").EventEmitter;
  17569. n.prototype.init = function(e, t, i) {
  17570. this.tileDownloader = e,
  17571. this.panoRenderer = t,
  17572. this.qualityManager = i,
  17573. this.bindEvents()
  17574. }
  17575. ,
  17576. n.prototype.bindEvents = function() {
  17577. this.panoRenderer.on(s.TileRenderSuccess, this.onTileRendered.bind(this))
  17578. }
  17579. ,
  17580. n.prototype.onTileRendered = function(e, t, i, n) {}
  17581. ,
  17582. n.prototype.addModel = function(e) {
  17583. this.modelMap[e.sid] = e,
  17584. 0 === this.modelCount && this.activateModel(e.sid),
  17585. this.modelCount++,
  17586. this.emit(a.ModelAdded)
  17587. }
  17588. ,
  17589. n.prototype.getModel = function(e) {
  17590. return this.modelMap[e]
  17591. }
  17592. ,
  17593. n.prototype.activateModel = function(e) {
  17594. var t = this.modelMap[e];
  17595. if (!t)
  17596. throw new o("Tried to activate invalid model!");
  17597. var i = this.activeModel;
  17598. this.activeModel = t,
  17599. this.tileDownloader.setPanoData(t.panos, t.listImagePanos(), t.sid),
  17600. this.tileDownloader.setUrls(t.urls),
  17601. t.panos.forEach(function(e) {
  17602. e.attachToPanoRenderer(this.panoRenderer),
  17603. e.tileDownloader = this.tileDownloader,
  17604. e.qualityManager = this.qualityManager
  17605. }
  17606. .bind(this)),
  17607. this.emit(a.ActiveModelChanged, {
  17608. oldModel: i,
  17609. model: t
  17610. })
  17611. }
  17612. ,
  17613. n.prototype.getActiveModel = function() {
  17614. return this.activeModel
  17615. }
  17616. ,
  17617. r.extend(n, l),
  17618. t.exports = n
  17619. }
  17620. , {
  17621. "../enum/ModelManagerEvents": 33,
  17622. "../enum/PanoRendererEvents": 35,
  17623. "../exception/BasicException": 55,
  17624. "../util/common": 185,
  17625. events: 202,
  17626. three: 217
  17627. }],
  17628. 141: [function(e, t, i) {
  17629. (function(i) {
  17630. "use strict";
  17631. function n() {
  17632. s.call(this)
  17633. }
  17634. var r = e("../objects/Room")
  17635. , o = (e("../settings"),
  17636. e("../util/logger"))
  17637. , a = (e("../util/transitions"),
  17638. e("../util/easing"),
  17639. e("../util/common"))
  17640. , s = e("../util/IndexedCollection")
  17641. , l = e("./Chunks");
  17642. new o(i);
  17643. a.inherit(n, s),
  17644. n.prototype.getIndex = function(e) {
  17645. return e.roomId
  17646. }
  17647. ,
  17648. n.prototype.calcRoomBoundaries = function() {
  17649. this.forEach(function(e) {
  17650. e.calcBoundaries()
  17651. })
  17652. }
  17653. ,
  17654. n.prototype.createFromChunks = function(e) {
  17655. var t = {
  17656. floorId: -1,
  17657. roomId: -1
  17658. }
  17659. , i = {};
  17660. e.forEach(function(e) {
  17661. l.parseIdsFromChunkName(e.name, t);
  17662. var o = i[t.roomId];
  17663. if (!o) {
  17664. var a = n.generateRoomId(t.floorId, t.roomId);
  17665. o = new r(t.floorId,a),
  17666. this.add(o),
  17667. i[t.roomId] = o
  17668. }
  17669. o.addChunk(e)
  17670. }
  17671. .bind(this)),
  17672. this.calcRoomBoundaries()
  17673. }
  17674. ,
  17675. n.generateRoomId = function(e, t) {
  17676. return e + "_" + t
  17677. }
  17678. ,
  17679. t.exports = n
  17680. }
  17681. ).call(this, "/js/model/RoomCollection.js")
  17682. }
  17683. , {
  17684. "../objects/Room": 150,
  17685. "../settings": 166,
  17686. "../util/IndexedCollection": 175,
  17687. "../util/common": 185,
  17688. "../util/easing": 186,
  17689. "../util/logger": 189,
  17690. "../util/transitions": 195,
  17691. "./Chunks": 135
  17692. }],
  17693. 142: [function(e, t, i) {
  17694. "use strict";
  17695. function n(e, t, i) {
  17696. e = e.clone();
  17697. var n = e.size()
  17698. , o = new r.BoxGeometry(n.x,n.y,n.z);
  17699. o.boundingBox = e,
  17700. r.Mesh.call(this, o, t),
  17701. this.position.copy(e.center()),
  17702. this.frustumCulled = !1,
  17703. i && this.add(new r.WireframeHelper(this))
  17704. }
  17705. var r = e("three");
  17706. n.prototype = Object.create(r.Mesh.prototype),
  17707. n.prototype.constructor = n,
  17708. t.exports = n
  17709. }
  17710. , {
  17711. three: 217
  17712. }],
  17713. 143: [function(e, t, i) {
  17714. (function(i) {
  17715. "use strict";
  17716. function n(e) {
  17717. h.time("Computing a nice bounding cubemap");
  17718. var t = new a({
  17719. side: r.BackSide,
  17720. transparent: !0
  17721. });
  17722. t.uniforms.modelAlpha.value = 0,
  17723. t.uniforms.opacity.value = 1 - s.modelAlpha,
  17724. this.renderOrder = l.boundingSkybox,
  17725. o.call(this, e, t),
  17726. h.timeEnd("Computing a nice bounding cubemap")
  17727. }
  17728. var r = e("three")
  17729. , o = (e("../enum/Viewmode"),
  17730. e("../shaders"),
  17731. e("./BoundingMesh"))
  17732. , a = e("../materials/ModelTextureMaterial")
  17733. , s = e("../settings")
  17734. , l = e("../enum/RenderOrder")
  17735. , c = e("../util/logger")
  17736. , h = new c(i);
  17737. n.prototype = Object.create(o.prototype),
  17738. n.prototype.constructor = n,
  17739. t.exports = n
  17740. }
  17741. ).call(this, "/js/objects/BoundingTextureSkybox.js")
  17742. }
  17743. , {
  17744. "../enum/RenderOrder": 42,
  17745. "../enum/Viewmode": 51,
  17746. "../materials/ModelTextureMaterial": 118,
  17747. "../settings": 166,
  17748. "../shaders": 167,
  17749. "../util/logger": 189,
  17750. "./BoundingMesh": 142,
  17751. three: 217
  17752. }],
  17753. 144: [function(e, t, i) {
  17754. "use strict";
  17755. function n(e) {
  17756. this.materialInside = new s({
  17757. side: r.DoubleSide
  17758. });
  17759. var t = r.UniformsUtils.clone(o.modelOutside.uniforms);
  17760. this.materialOutside = new r.RawShaderMaterial({
  17761. fragmentShader: o.modelOutside.fragmentShader,
  17762. vertexShader: o.modelOutside.vertexShader,
  17763. uniforms: t,
  17764. side: r.FrontSide,
  17765. name: "chunkOut"
  17766. }),
  17767. r.Mesh.call(this, e.geometry, this.materialInside),
  17768. this.name = e.name || "",
  17769. this.textureName = e.textureName,
  17770. this.meshUrl = e.meshUrl
  17771. }
  17772. var r = e("three")
  17773. , o = e("../shaders")
  17774. , a = e("../enum/Viewmode")
  17775. , s = e("../materials/ModelTextureMaterial");
  17776. n.prototype = Object.create(r.Mesh.prototype),
  17777. n.prototype.setTextureMap = function(e) {
  17778. this.materialInside.uniforms.map.value = e,
  17779. this.materialOutside.uniforms.map.value = e
  17780. }
  17781. ,
  17782. n.prototype.setMode = function(e) {
  17783. var t = e === a.DOLLHOUSE || e === a.FLOORPLAN ? this.materialOutside : this.materialInside;
  17784. t.side = e === a.PANORAMA ? r.DoubleSide : r.FrontSide,
  17785. t.transparent = this.material.transparent,
  17786. t.uniforms.opacity.value = this.material.uniforms.opacity.value,
  17787. this.material = t
  17788. }
  17789. ,
  17790. t.exports = n
  17791. }
  17792. , {
  17793. "../enum/Viewmode": 51,
  17794. "../materials/ModelTextureMaterial": 118,
  17795. "../shaders": 167,
  17796. three: 217
  17797. }],
  17798. 145: [function(e, t, i) {
  17799. "use strict";
  17800. function n(e) {
  17801. this.chunksize = e || 10,
  17802. this.chunks = {},
  17803. this.boundingBoxes = {},
  17804. this.children = [],
  17805. this.offset = new r.Vector3(0,.5,0),
  17806. this.material = new r.MeshBasicMaterial({
  17807. color: 16777215 * Math.random(),
  17808. side: r.DoubleSide
  17809. })
  17810. }
  17811. var r = e("three");
  17812. e("../enum/Viewmode");
  17813. n.prototype.add = function(e) {
  17814. var t, i, n, o, a, s, l, c, h, u, d, p, f, g, m = e.attributes;
  17815. m ? (t = m.position.array,
  17816. i = void 0 !== e.index ? e.index.array : void 0) : (t = e.vertices,
  17817. n = e.faces);
  17818. var v = new r.Vector3;
  17819. if (i)
  17820. for (o = 0,
  17821. a = i.length; o < a; o += 3) {
  17822. var A = 3 * i[o]
  17823. , y = 3 * i[o + 1]
  17824. , C = 3 * i[o + 2];
  17825. s = (t[A] + t[y] + t[C]) / 3,
  17826. l = (t[A + 1] + t[y + 1] + t[C + 1]) / 3,
  17827. c = (t[A + 2] + t[y + 2] + t[C + 2]) / 3,
  17828. h = Math.floor(s / this.chunksize),
  17829. u = Math.floor(l / this.chunksize),
  17830. d = Math.floor(c / this.chunksize),
  17831. p = h + "." + u + "." + d,
  17832. p in this.chunks ? (g = this.chunks[p],
  17833. f = this.boundingBoxes[p]) : (g = this.chunks[p] = [],
  17834. f = this.boundingBoxes[p] = new r.Box3),
  17835. 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]),
  17836. f.expandByPoint(v.set(t[A], t[A + 1], t[A + 2])),
  17837. f.expandByPoint(v.set(t[y], t[y + 1], t[y + 2])),
  17838. f.expandByPoint(v.set(t[C], t[C + 1], t[C + 2]))
  17839. }
  17840. else
  17841. for (o = 0,
  17842. a = t.length; o < a; o += 9)
  17843. s = (t[o] + t[o + 3] + t[o + 6]) / 3,
  17844. l = (t[o + 1] + t[o + 4] + t[o + 7]) / 3,
  17845. c = (t[o + 2] + t[o + 5] + t[o + 8]) / 3,
  17846. h = Math.floor(s / this.chunksize),
  17847. u = Math.floor(l / this.chunksize),
  17848. d = Math.floor(c / this.chunksize),
  17849. p = h + "." + u + "." + d,
  17850. p in this.chunks ? (g = this.chunks[p],
  17851. f = this.boundingBoxes[p]) : (g = this.chunks[p] = [],
  17852. f = this.boundingBoxes[p] = new r.Box3),
  17853. 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]),
  17854. f.expandByPoint(v.set(t[o], t[o + 1], t[o + 2])),
  17855. f.expandByPoint(v.set(t[o + 3], t[o + 4], t[o + 5])),
  17856. f.expandByPoint(v.set(t[o + 6], t[o + 7], t[o + 8]))
  17857. }
  17858. ,
  17859. n.prototype.build = function() {
  17860. var e = new r.Object3D;
  17861. e.material = this.material;
  17862. for (var t in this.chunks) {
  17863. var i = this.chunks[t]
  17864. , n = new r.BufferGeometry;
  17865. n.addAttribute("position", new r.BufferAttribute(new Float32Array(i),3)),
  17866. n.boundingBox = this.boundingBoxes[t];
  17867. var o = new r.Mesh(n,this.material);
  17868. o.material.visible = !1,
  17869. e.add(o),
  17870. this.chunks[t] = []
  17871. }
  17872. return e
  17873. }
  17874. ,
  17875. t.exports = n
  17876. }
  17877. , {
  17878. "../enum/Viewmode": 51,
  17879. three: 217
  17880. }],
  17881. 146: [function(e, t, i) {
  17882. "use strict";
  17883. var r = e("three")
  17884. , o = e("../settings")
  17885. , a = e("../util/common")
  17886. , s = e("../util/lerp")
  17887. , l = e("./ChunkedCollider")
  17888. , c = e("../util/transitions")
  17889. , h = e("../util/easing")
  17890. , u = (e("../objects/Panorama"),
  17891. e("../enum/RenderOrder"))
  17892. , d = e("../localization/localize");
  17893. function n(e, t, i) {
  17894. r.Object3D.call(this),
  17895. this.model = e,
  17896. this.floorIndex = t,
  17897. this.lang = o.languageTag,
  17898. this.name = i || o.languageTag === "cn" ? "Floor " + (t + 1) + "" : "第" + (t + 1) + "层",
  17899. this.panos = [],
  17900. this.chunks = [],
  17901. this.colliderBuilder = new l(3),
  17902. this.collider = null,
  17903. this.center = null,
  17904. this.boundingBox = new r.Box3,
  17905. this.size = null,
  17906. this.hidden = !1,
  17907. this.conservativeBoundingBox = new r.Box3,
  17908. this.debugColor = 16777215 * Math.random(),
  17909. this.transition = null
  17910. }
  17911. n.prototype = Object.create(r.Object3D.prototype),
  17912. n.prototype.enter = function(e) {
  17913. this.model.setFloor(this, e)
  17914. }
  17915. ,
  17916. n.prototype.hide = function(e) {
  17917. if (!this.hidden || this.transition) {
  17918. this.chunks.forEach(function(e) {
  17919. e.material.transparent = !0
  17920. }),
  17921. c.cancel(this.transition);
  17922. var t = e ? 0 : o.hideFloorDuration + o.hideFloorDelay
  17923. , i = e ? 0 : o.hideFloorDelay / t;
  17924. this.transition = c.start(s.allUniforms(this.chunks, "opacity", .08), t, function() {
  17925. this.hidden = !0
  17926. }
  17927. .bind(this), i, h.easeInOutQuad)
  17928. }
  17929. }
  17930. ,
  17931. n.prototype.show = function(e) {
  17932. if (this.hidden || this.transition) {
  17933. this.hidden = !1,
  17934. c.cancel(this.transition);
  17935. var t = e ? o.showFloorDuration : o.showFloorDuration + o.showFloorDelay
  17936. , i = e ? 0 : o.showFloorDelay / t;
  17937. this.transition = c.start(s.allUniforms(this.chunks, "opacity", 1), t, function() {
  17938. this.hidden || this.chunks.forEach(function(e) {
  17939. e.material.transparent = !1
  17940. })
  17941. }
  17942. .bind(this), i, h.easeInOutQuad)
  17943. }
  17944. }
  17945. ,
  17946. n.prototype.toggle = function(e, t) {
  17947. e = void 0 === e ? this.hidden : e,
  17948. e ? this.show(t) : this.hide(t)
  17949. }
  17950. ,
  17951. n.prototype.containsPoint = function(e) {
  17952. return this.collider.children.some(function(t) {
  17953. return t.geometry.boundingBox || t.geometry.computeBoundingBox(),
  17954. t.geometry.boundingBox.containsPoint(e)
  17955. })
  17956. }
  17957. ,
  17958. n.prototype.distanceToPoint = function(e) {
  17959. var t = null
  17960. , i = 1 / 0;
  17961. return this.collider.children.forEach(function(n) {
  17962. n.geometry.boundingBox || n.geometry.computeBoundingBox();
  17963. var r = n.geometry.boundingBox.distanceToPoint(e);
  17964. (!t || i > r) && (i = r,
  17965. t = n)
  17966. }),
  17967. i
  17968. }
  17969. ,
  17970. n.prototype.addChunk = function(e) {
  17971. e.renderOrder = u.ghostFloor,
  17972. this.add(e),
  17973. this.chunks.push(e),
  17974. this.boundingBox.union(e.geometry.boundingBox),
  17975. this.size = this.boundingBox.size(),
  17976. this.colliderBuilder.add(e.geometry)
  17977. }
  17978. ,
  17979. n.prototype.addPano = function(e) {
  17980. this.panos.push(e),
  17981. this.add(e.skyboxMesh),
  17982. e.marker && this.add(e.marker);
  17983. var t = new r.Vector3(1,1,1)
  17984. , i = (new r.Box3).setFromCenterAndSize(e.position, t);
  17985. this.boundingBox.union(i)
  17986. }
  17987. ,
  17988. n.prototype.build = function() {
  17989. this.collider = this.colliderBuilder.build(!0),
  17990. this.add(this.collider),
  17991. this.center = this.boundingBox.center(),
  17992. this.conservativeBoundingBox.copy(this.boundingBox),
  17993. this.conservativeBoundingBox.min.y = a.lowerMedian(this.collider.children.map(function(e) {
  17994. return e.geometry.boundingBox.min.y
  17995. }), 5),
  17996. this.conservativeBoundingBox.max.y = a.lowerMedian(this.collider.children.map(function(e) {
  17997. return e.geometry.boundingBox.max.y
  17998. }), 5),
  17999. this.colliderBuilder = null
  18000. }
  18001. ,
  18002. n.prototype.toShortString = function() {
  18003. return a.nth(this.floorIndex + 1)
  18004. }
  18005. ,
  18006. n.prototype.toString = function() {
  18007. return this.name
  18008. }
  18009. ,
  18010. t.exports = n
  18011. }
  18012. , {
  18013. "../enum/RenderOrder": 42,
  18014. "../localization/localize": 108,
  18015. "./strings-cn-CN": 109,
  18016. "../objects/Panorama": 148,
  18017. "../settings": 166,
  18018. "../util/common": 185,
  18019. "../util/easing": 186,
  18020. "../util/lerp": 188,
  18021. "../util/transitions": 195,
  18022. "./ChunkedCollider": 145,
  18023. three: 217
  18024. }],
  18025. 147: [function(e, t, i) {
  18026. "use strict";
  18027. function n(e) {
  18028. this.player = e,
  18029. this.obj3d = null,
  18030. this.UP = new r.Vector3(0,1,0)
  18031. }
  18032. var r = e("three")
  18033. , o = e("../settings");
  18034. n.prototype.prefs = {
  18035. linewidth: 3,
  18036. height: .07,
  18037. opacity: .45,
  18038. endScale: .05
  18039. },
  18040. n.prototype.discard = function() {
  18041. if (this.obj3d) {
  18042. var e = this.obj3d.parent;
  18043. e && e.remove(this.obj3d)
  18044. }
  18045. this.obj3d = null
  18046. }
  18047. ,
  18048. n.prototype.draw = function() {
  18049. if (this.discard(),
  18050. o.showNeighbors) {
  18051. var e = this.player.currentPano.floor;
  18052. this.obj3d = new r.Object3D;
  18053. var t = this.player.model.panos.getNeighbours(this.player.currentPano)
  18054. , i = this.player.currentPano.floorPosition.clone().sub(this.player.model.position);
  18055. i.y += this.prefs.height;
  18056. var n = .1525
  18057. , a = .127
  18058. , s = .0127
  18059. , l = .1
  18060. , c = .19
  18061. , h = .2032
  18062. , u = .2286
  18063. , d = .255
  18064. , p = new r.Matrix4;
  18065. for (var f in t)
  18066. if (t[f]) {
  18067. var g = this.player.model.panos.get(f)
  18068. , m = (g.position.clone().sub(this.player.model.position),
  18069. g.position.clone().sub(g.floorPosition))
  18070. , v = g.floorPosition.clone().sub(this.player.model.position);
  18071. v.y += this.prefs.height;
  18072. var A = new r.Geometry;
  18073. 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)),
  18074. 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)),
  18075. p.identity().setPosition(m),
  18076. A.applyMatrix(p),
  18077. A.vertices.push(new r.Vector3(0,-this.prefs.endScale,0)),
  18078. 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)),
  18079. p.lookAt(v, i, this.UP).setPosition(v),
  18080. A.applyMatrix(p),
  18081. A.vertices.push(v, i);
  18082. var y = new r.Line(A,new r.LineBasicMaterial({
  18083. color: g.debugColor.getHex(),
  18084. transparent: !0,
  18085. opacity: this.prefs.opacity,
  18086. depthWrite: !1,
  18087. name: "sLine" + f,
  18088. linewidth: this.prefs.linewidth
  18089. }));
  18090. this.obj3d.add(y)
  18091. }
  18092. e.add(this.obj3d)
  18093. }
  18094. }
  18095. ,
  18096. n.prototype.update = function() {
  18097. o.showNeighbors && this.obj3d && this.obj3d.updateMatrixWorld()
  18098. }
  18099. ,
  18100. t.exports = n
  18101. }
  18102. , {
  18103. "../settings": 166,
  18104. three: 217
  18105. }],
  18106. 148: [function(e, t, i) {
  18107. (function(i) {
  18108. "use strict";
  18109. function n(e, t, i, n) {
  18110. this.model = e,
  18111. this.id = t,
  18112. this.alignmentType = i.alignmentType || l.ALIGNED,
  18113. this.neighbourUUIDs = i.neighbours || null,
  18114. this.neighbourPanos = null,
  18115. this.floor = null,
  18116. this.floorIndex = i.floor,
  18117. this.failedLoadingAt = 0,
  18118. this.maxLoadRetries = 4,
  18119. this.origin = i.position.clone(),
  18120. this.position = this.alignmentType === l.UNALIGNED ? new r.Vector3(0,-5,0) : i.position.clone(),
  18121. this.quaternion = i.quaternion.clone(),
  18122. this.skyboxMesh = new r.Mesh(E),
  18123. this.skyboxMesh.position.copy(this.position),
  18124. this.skyboxMesh.quaternion.copy(this.quaternion),
  18125. this.skyboxMesh.name = "skybox",
  18126. this.skyboxMesh.visible = !1,
  18127. this.skyboxMesh.updateMatrix(),
  18128. this.skyboxMesh.updateMatrixWorld(),
  18129. this.marker = null,
  18130. this.isAligned() && (this.marker = new r.Mesh(b,new r.MeshBasicMaterial({
  18131. map: w,
  18132. side: r.DoubleSide,
  18133. opacity: 0,
  18134. transparent: !0,
  18135. depthWrite: !1
  18136. })),
  18137. this.marker.renderOrder = s.panoMarker,
  18138. this.marker.name = "marker",
  18139. this.marker.pano = this,
  18140. this.marker.layers.set(v.PANOMARKERS),
  18141. this.marker.updateMatrixWorld(),
  18142. a.colorMarkerOnLoad && this.on("load", function() {
  18143. this.marker.material.color.set(65280)
  18144. })),
  18145. this.debugColor = (new r.Color).setHSL(.06 + .53 * Math.random(), .8 + .2 * Math.random(), .5 + .2 * Math.random()),
  18146. this.floorPosition = i.puck ? i.puck.clone() : null,
  18147. this.tiled = n,
  18148. this.tiled ? this.solidSkybox = null : (this.solidSkybox = new r.Texture([null, null, null, null, null, null]),
  18149. this.solidSkybox.flipY = !1,
  18150. a.minimalMemoryMode && (this.solidSkybox.minFilter = r.LinearFilter,
  18151. this.solidSkybox.magFilter = r.LinearFilter,
  18152. this.solidSkybox.generateMipmaps = !1)),
  18153. this.zoomed = !1,
  18154. this.panoRenderer = null,
  18155. this.qualityManager = null,
  18156. this.tileDownloader = null,
  18157. this.tiledPanoRenderTarget = null,
  18158. this.minimumTiledPanoLoaded = !1,
  18159. this.highestPartialTileRenderOpCompleted = 0,
  18160. this.highestFullTileRenderOpCompleted = 0,
  18161. this.shouldRedrawOnBaseLoaded = !1,
  18162. this.lockUntilRenderingComplete = !1,
  18163. a.colorMarkerOnLoad && this.on("load", function() {
  18164. this.marker.material.color.set(65280)
  18165. })
  18166. }
  18167. var r = e("three")
  18168. , o = e("../util/logger")
  18169. , a = e("../settings")
  18170. , s = (e("../enum/Viewmode"),
  18171. e("../enum/RenderOrder"))
  18172. , l = e("../enum/AlignmentType")
  18173. , c = (e("../util/common"),
  18174. e("../util/transitions"))
  18175. , h = e("../util/lerp")
  18176. , u = e("../util/ajax")
  18177. , d = e("../util/texture")
  18178. , p = e("../util/panorama")
  18179. , f = (e("../enum/TileDownloaderEvents"),
  18180. e("../enum/PanoramaEvents"))
  18181. , g = e("../enum/PanoRendererEvents")
  18182. , m = e("../enum/PanoSizeClass")
  18183. , v = e("../enum/RenderLayers")
  18184. , A = (e("../scene/SceneRenderer"),
  18185. e("../enum/GLCubeFaces"),
  18186. e("../exception/BasicException"))
  18187. , y = e("../tile/TileUtils")
  18188. , C = e("events").EventEmitter
  18189. , I = new o(i)
  18190. , E = new r.SphereBufferGeometry(.1)
  18191. , b = new r.PlaneBufferGeometry(.4,.4,1,1)
  18192. , w = d.load(rootPath+"images/marker-256x256.png");
  18193. n.prototype = Object.create(C.prototype),
  18194. n.prototype.enter = function() {
  18195. var e = null;
  18196. return function() {
  18197. this.setZoomed(!1),
  18198. this.emit("enter", {
  18199. oldPano: e,
  18200. newPano: this
  18201. }),
  18202. e = this
  18203. }
  18204. }(),
  18205. n.prototype.exit = function() {
  18206. this.tiled ? (this.clearWaitDeferreds(),
  18207. this.minimumTiledPanoLoaded = !1,
  18208. this.tiledPanoRenderTarget = null,
  18209. this.setZoomed(!1),
  18210. this.panoRenderer.deactivateTiledPano(this),
  18211. this.highestPartialTileRenderOpCompleted = 0,
  18212. this.highestFullTileRenderOpCompleted = 0) : (this.solidSkybox.dispose(),
  18213. this.solidSkybox.loaded = !1,
  18214. this.solidSkybox.version = 0),
  18215. this.emit("exit")
  18216. }
  18217. ,
  18218. n.prototype.hoverOn = function(e) {
  18219. this.marker && (c.start(h.property(this.marker.material, "opacity", a[e].markerOpacityOnHover), 250),
  18220. a.navigation.panoScores & a.navigation.mouseDirection && this.addTextSprite("HIT", 12525854))
  18221. }
  18222. ,
  18223. n.prototype.hoverOff = function(e) {
  18224. this.marker && c.start(h.property(this.marker.material, "opacity", a[e].markerOpacity), 250)
  18225. }
  18226. ,
  18227. n.prototype.build1 = function() {
  18228. this.floor = this.floor || this.model.floors.get(this.floorIndex) || this.raycastToFindFloor() || this.model.getFloorAtPoint(this.position),
  18229. this.floor.addPano(this),
  18230. this.floorPosition = this.floorPosition || this.raycastFloorPosition(),
  18231. this.neighbourPanos = this.neighbourPanos || this.findNeighourPanos(),
  18232. a.colorMarkerByFloor && this.marker && this.marker.material.color.set(this.floor.debugColor)
  18233. }
  18234. ,
  18235. n.prototype.build2 = function() {
  18236. this.floorPosition = this.floorPosition || this.interpolateFloorPosition(),
  18237. this.height = this.position.distanceTo(this.floorPosition),
  18238. this.placeMarker()
  18239. }
  18240. ,
  18241. n.prototype.interpolateFloorPosition = function() {
  18242. var e = this.model.panos.filter(n.filters.isNeighbourPanoTo(this)).filter(function(e) {
  18243. return !!e.floorPosition
  18244. }).sort(function(e, t) {
  18245. return e.position.distanceTo(this.position) - t.position.distanceTo(this.position)
  18246. }
  18247. .bind(this))
  18248. , t = this.position.clone();
  18249. return e.length >= 2 ? t.y = (e[0].floorPosition.y + e[1].floorPosition.y) / 2 : t.add(a.noMeshFloorPositionOffset),
  18250. t
  18251. }
  18252. ,
  18253. n.prototype.raycastFloorPosition = function() {
  18254. I.warn("Performance warning: Raycasting to find floor position");
  18255. var e = new r.Raycaster(this.position,new r.Vector3(0,-1,0))
  18256. , t = e.intersectObjects(this.model.colliders);
  18257. return t.length ? t[0].point : null
  18258. }
  18259. ,
  18260. n.prototype.raycastToFindFloor = function() {
  18261. 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)];
  18262. return function() {
  18263. I.warn("Performance warning: Raycasting to find floor index");
  18264. for (var t = 0; t < e.length; t++) {
  18265. var i = new r.Raycaster(this.position.clone(),e[t].clone())
  18266. , n = i.intersectObjects(this.model.colliders);
  18267. if (n.length)
  18268. return n[0].object.parent.parent
  18269. }
  18270. return null
  18271. }
  18272. }(),
  18273. n.prototype.placeMarker = function() {
  18274. this.marker && (this.marker.position.copy(this.floorPosition),
  18275. this.marker.position.y += .05,
  18276. this.marker.lookAt(new r.Vector3(0,1,0).add(this.marker.position)))
  18277. }
  18278. ,
  18279. n.prototype.translate = function(e) {
  18280. this.position.add(e),
  18281. this.floorPosition.add(e)
  18282. }
  18283. ,
  18284. n.prototype.findClosestMidtpointPanoTo = function(e) {
  18285. (new r.Vector3).addVectors(this.position, e.position).divideScalar(2);
  18286. return this.model.panos.find([n.filters.notIn([this, e])], [n.sortFunctions.distanceToPoint(point)])
  18287. }
  18288. ,
  18289. n.prototype.attachToPanoRenderer = function(e) {
  18290. this.panoRenderer = e,
  18291. this.panoRenderer.on(g.TileRenderSuccess, this.onTileRendered.bind(this)),
  18292. this.panoRenderer.on(g.PanoRenderComplete, this.onPanoRendered.bind(this)),
  18293. this.panoRenderer.on(g.TileRenderFailure, this.onTileRenderFail.bind(this)),
  18294. this.panoRenderer.on(g.UploadAttemptedForAllTiles, this.onUploadAttemptedForAllTiles.bind(this))
  18295. }
  18296. ;
  18297. var _ = {};
  18298. n.prototype.getWaitDeferred = function(e) {
  18299. var t = _[this.id];
  18300. t || (t = {},
  18301. _[this.id] = t);
  18302. var i = t[e];
  18303. return i || (i = {
  18304. deferred: $.Deferred(),
  18305. active: !1
  18306. },
  18307. t[e] = i),
  18308. i
  18309. }
  18310. ,
  18311. n.prototype.resetWaitDeferred = function(e) {
  18312. var t = this.getWaitDeferred(e);
  18313. t.active = !1,
  18314. t.deferred = $.Deferred()
  18315. }
  18316. ,
  18317. n.prototype.clearWaitDeferreds = function() {
  18318. var e = _[this.id];
  18319. e || (e = {},
  18320. _[this.id] = e);
  18321. for (var t in e)
  18322. if (e.hasOwnProperty(t)) {
  18323. var i = e[t];
  18324. i.active = !1,
  18325. i.deferred = $.Deferred()
  18326. }
  18327. }
  18328. ,
  18329. n.prototype.loadTiledPano = function() {
  18330. var e = (new r.Vector3,
  18331. [])
  18332. , t = [];
  18333. return function(i, n, r, o, a, s) {
  18334. null !== o && void 0 !== o || (o = !0),
  18335. null !== a && void 0 !== a || (a = !0);
  18336. var l = this.getWaitDeferred(i)
  18337. , c = l.deferred
  18338. , h = null
  18339. , u = null;
  18340. if (r && ("number" == typeof r ? h = r : (h = r.hFov,
  18341. u = r.vFov)),
  18342. !this.isLoaded(i)) {
  18343. if (!l.active) {
  18344. if (l.active = !0,
  18345. r) {
  18346. var d = y.matchingTilesInDirection(this, i, n, h, u);
  18347. e[this.id + ":" + i] = {
  18348. tileCount: 0,
  18349. targetTileCount: d
  18350. },
  18351. I.info("Loading partial pano: " + this.id + " with " + d + " tiles")
  18352. }
  18353. t[this.id] || (t[this.id] = !0,
  18354. this.on(f.LoadComplete, function(e, t) {
  18355. var i = this.getWaitDeferred(e).deferred;
  18356. i && "pending" === i.state() && this.highestPartialTileRenderOpCompleted >= e && (i.resolve(e, t),
  18357. this.resetWaitDeferred(e))
  18358. }
  18359. .bind(this)),
  18360. this.on(f.LoadFailed, function(e) {
  18361. var t = this.getWaitDeferred(e).deferred;
  18362. t && "pending" === t.state() && this.highestPartialTileRenderOpCompleted >= e && (t.reject(e),
  18363. this.resetWaitDeferred(e))
  18364. }
  18365. .bind(this)),
  18366. this.on(f.TileLoaded, function(t, i, n) {
  18367. var r = this.getWaitDeferred(t).deferred;
  18368. if (r && "pending" === r.state()) {
  18369. r.notify(t, i, n);
  18370. var o = e[this.id + ":" + t];
  18371. o && (o.tileCount++,
  18372. o.tileCount === o.targetTileCount && (this.onPanoRendered(this.id, t, n, !0),
  18373. r.resolve(t, n),
  18374. this.resetWaitDeferred(t)))
  18375. }
  18376. }
  18377. .bind(this)))
  18378. }
  18379. this.tileDownloader.clearForceQueue(),
  18380. this.tileDownloader.forceQueueTilesForPano(this, i, n, h, u, s),
  18381. this.tiledPanoRenderTarget = this.panoRenderer.activateTiledPano(this, this.qualityManager.getMaxNavPanoSize(), o),
  18382. this.panoRenderer.renderPanoTiles(this.id, n, a)
  18383. }
  18384. return c.promise()
  18385. }
  18386. }(),
  18387. n.prototype.onUploadAttemptedForAllTiles = function(e, t, i) {
  18388. if (e === this.id) {
  18389. var n = this.qualityManager.getPanoSize(m.BASE);
  18390. t === n && this.shouldRedrawOnBaseLoaded && (this.shouldRedrawOnBaseLoaded = !1,
  18391. this.panoRenderer.resetRenderStatus(this.id, !0, !1),
  18392. this.panoRenderer.renderPanoTiles(this.id, null, !0, !0))
  18393. }
  18394. }
  18395. ,
  18396. n.prototype.onTileRendered = function(e, t, i, n) {
  18397. e === this.id && this.emit(f.TileLoaded, t, i, n)
  18398. }
  18399. ,
  18400. n.prototype.onPanoRendered = function(e, t, i, n) {
  18401. e === this.id && (this.minimumTiledPanoLoaded = !0,
  18402. this.updateSkyboxForZoomLevel(),
  18403. t > this.highestPartialTileRenderOpCompleted && (this.highestPartialTileRenderOpCompleted = t),
  18404. !n && t > this.highestFullTileRenderOpCompleted && (this.highestFullTileRenderOpCompleted = t),
  18405. this.emit("load", t),
  18406. this.model.emit("load", this),
  18407. this.emit(f.LoadComplete, t, i))
  18408. }
  18409. ,
  18410. n.prototype.setZoomed = function(e) {
  18411. this.zoomed = e,
  18412. this.updateSkyboxForZoomLevel()
  18413. }
  18414. ,
  18415. n.prototype.ensureSkyboxReadyForRender = function() {
  18416. this.tiled || (this.solidSkybox.loaded || (this.solidSkybox.needsUpdate = !0),
  18417. this.solidSkybox.loaded = !0)
  18418. }
  18419. ,
  18420. n.prototype.updateSkyboxForZoomLevel = function() {
  18421. this.minimumTiledPanoLoaded && this.model.updateProjectedPanos()
  18422. }
  18423. ,
  18424. n.prototype.getSkyboxTexture = function() {
  18425. return this.tiled ? this.minimumTiledPanoLoaded ? this.zoomed ? this.panoRenderer.zoomRenderTarget.texture : this.tiledPanoRenderTarget.texture : null : this.solidSkybox
  18426. }
  18427. ,
  18428. n.prototype.onTileRenderFail = function(e, t, i) {
  18429. e === this.id && this.emit(f.LoadFailed, t)
  18430. }
  18431. ,
  18432. n.prototype.isLoaded = function(e) {
  18433. if (this.tiled) {
  18434. if (e && "string" == typeof e)
  18435. throw new A("Wrong panoSize given to Panorama.isLoaded(); a tiled pano uses PanoSizeClass");
  18436. return !!this.minimumTiledPanoLoaded && (!e || this.highestPartialTileRenderOpCompleted >= e)
  18437. }
  18438. if (e && "number" == typeof e)
  18439. throw new A("Wrong panoSize given to Panorama.isLoaded(); a non-tiled pano uses high/low.");
  18440. return !!this.solidSkybox.high || e in this.solidSkybox
  18441. }
  18442. ,
  18443. n.prototype.loadCube = function(e) {
  18444. if (this.isLoaded(e))
  18445. return I.info("Skipping load of pano, already loaded"),
  18446. $.when();
  18447. this.emit("loading", e),
  18448. this.model.emit("loading", this);
  18449. var t = p.getCubemapUrls(this.model.urls, this.id, e)
  18450. , i = t.filter(function(e) {
  18451. return !e
  18452. });
  18453. "low" === e && i.length > 0 && (I.info("Pano", this.id, "not available in low res, loading high res right away"),
  18454. e = "high",
  18455. t = p.getCubemapUrls(this.model.urls, this.id, e));
  18456. var n = 0
  18457. , r = [0, 1, 2, 3, 4, 5].map(function(e, i, n) {
  18458. return u.getImage(t[i])
  18459. }
  18460. .bind(this));
  18461. return $.when(r[0], r[1], r[2], r[3], r[4], r[5]).then(function(t, i, n, r, o, a) {
  18462. return this.solidSkybox[e] = [t, i, n, r, o, a],
  18463. "high" !== e && this.solidSkybox.high || (this.solidSkybox.image = this.solidSkybox[e],
  18464. this.solidSkybox.low = null),
  18465. this.solidSkybox.needsUpdate = !0,
  18466. this.emit("load", e),
  18467. this.model.emit("load", this),
  18468. this
  18469. }
  18470. .bind(this), function() {
  18471. I.error("Downloading cubemap for pano", this.id, "failed"),
  18472. this.failedLoadingAt = Date.now()
  18473. }
  18474. .bind(this), function() {
  18475. return $.when(++n, 6)
  18476. })
  18477. }
  18478. ,
  18479. n.raycastsSkipped = 0,
  18480. n.raycastsDone = 0,
  18481. n.prototype.findNeighourPanos = function() {
  18482. return this.model.panos.setNeighbour(this.id, this.id, !1),
  18483. this.model.panos.forEach(function(e) {
  18484. if (e !== this && (!this.model.panos.neighbourMap[this.id] || void 0 === this.model.panos.neighbourMap[this.id][e.id])) {
  18485. var t = this.position.distanceTo(e.position);
  18486. if (t > a.panoramaNeighbourMaxDistance)
  18487. return this.model.panos.setNeighbour(this, e, !1),
  18488. void n.raycastsSkipped++;
  18489. var i = e.position.clone().sub(this.position).normalize()
  18490. , o = new r.Raycaster(this.position,i.clone(),0,t)
  18491. , s = o.intersectObjects(this.model.colliders);
  18492. n.raycastsDone++,
  18493. this.model.panos.setNeighbour(this, e, 0 === s.length),
  18494. 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)))
  18495. }
  18496. }
  18497. .bind(this)),
  18498. this.model.panos.neighbourMap[this.id]
  18499. }
  18500. ,
  18501. n.prototype.worldPosition = function() {
  18502. return this.position
  18503. }
  18504. ,
  18505. n.prototype.addTextSprite = function(e, t) {
  18506. this.removeTextSprite();
  18507. var i = document.createElement("canvas")
  18508. , n = i.getContext("2d");
  18509. i.width = 256,
  18510. i.height = 256;
  18511. var o = "Arial"
  18512. , a = 60;
  18513. n.font = "bold " + a + "px " + o,
  18514. n.fillStyle = "white";
  18515. var s = n.measureText(e).width;
  18516. n.fillText(e, (i.width - s) / 2, (i.height + a) / 2);
  18517. var l = new r.Texture(i);
  18518. l.needsUpdate = !0;
  18519. var c = new r.SpriteMaterial({
  18520. map: l,
  18521. color: t || 16428055
  18522. });
  18523. this.text3d = new r.Sprite(c),
  18524. this.text3d.position.copy(this.skyboxMesh.position),
  18525. this.floor.add(this.text3d)
  18526. }
  18527. ,
  18528. n.prototype.removeTextSprite = function() {
  18529. this.text3d && (this.floor.remove(this.text3d),
  18530. this.text3d = null)
  18531. }
  18532. ,
  18533. n.prototype.isAligned = function() {
  18534. return this.alignmentType === l.ALIGNED
  18535. }
  18536. ,
  18537. n.filters = {
  18538. inDirection: function(e, t, i) {
  18539. return function(n) {
  18540. var r = n.position.clone().sub(e).normalize();
  18541. return r.dot(t) > i
  18542. }
  18543. },
  18544. inFloorDirection: function(e, t, i) {
  18545. return function(n) {
  18546. var r = n.floorPosition.clone().sub(e).normalize();
  18547. return r.dot(t) > i
  18548. }
  18549. },
  18550. inPanoDirection: function(e, t, i) {
  18551. return i = a.navigation.panoScores ? a.navigation.filterStrictness : i,
  18552. function(n) {
  18553. var r = n.floorPosition.clone().sub(e).normalize()
  18554. , o = n.position.clone().sub(e).normalize();
  18555. return r.dot(t) > i || o.dot(t) > i
  18556. }
  18557. },
  18558. atFloor: function(e) {
  18559. return function(t) {
  18560. return !e || t.floor === e
  18561. }
  18562. },
  18563. not: function(e) {
  18564. return function(t) {
  18565. return t !== e
  18566. }
  18567. },
  18568. notIn: function(e) {
  18569. return function(t) {
  18570. return e.indexOf(t) === -1
  18571. }
  18572. },
  18573. isLoaded: function() {
  18574. return function(e) {
  18575. return e.isLoaded()
  18576. }
  18577. },
  18578. isNotLoaded: function() {
  18579. return function(e) {
  18580. return !e.isLoaded()
  18581. }
  18582. },
  18583. isCloseEnoughTo: function(e, t) {
  18584. return function(i) {
  18585. return e.distanceTo(i.floorPosition) < t
  18586. }
  18587. },
  18588. hasMinimumHeightDifferenceTo: function(e, t) {
  18589. return function(i) {
  18590. return Math.abs(i.position.y - e.y) > t
  18591. }
  18592. },
  18593. isNotBehindNormal: function(e, t) {
  18594. var i = new r.Vector3;
  18595. return t = t.clone(),
  18596. function(n) {
  18597. var r = i.copy(n.position).sub(e).normalize();
  18598. return r.dot(t) > 0
  18599. }
  18600. },
  18601. isNeighbourPanoTo: function(e) {
  18602. return function(t) {
  18603. return !e || !e.neighbourPanos || !!e.neighbourPanos[t.id]
  18604. }
  18605. },
  18606. isNeighbourOfNeighbourTo: function(e) {
  18607. return function(t) {
  18608. return !!e.neighbourPanos[t.id] || e.neighbourUUIDs.some(function(i) {
  18609. var n = e.model.panos.get(i);
  18610. return !!n && n.neighbourPanos[t.id]
  18611. })
  18612. }
  18613. },
  18614. isNotRecentlyFailed: function(e) {
  18615. return function(t) {
  18616. return Date.now() - t.failedLoadingAt > e
  18617. }
  18618. },
  18619. isOnVisibleFloor: function() {
  18620. return function(e) {
  18621. return !e.floor.hidden
  18622. }
  18623. },
  18624. isPanoAligned: function() {
  18625. return function(e) {
  18626. return e.isAligned()
  18627. }
  18628. }
  18629. },
  18630. n.sortFunctions = {
  18631. distanceToPoint: function(e) {
  18632. return function(t, i) {
  18633. return t.position.distanceTo(e) - i.position.distanceTo(e)
  18634. }
  18635. },
  18636. floorDistanceToPoint: function(e) {
  18637. return function(t, i) {
  18638. return t.floorPosition.distanceTo(e) - i.floorPosition.distanceTo(e)
  18639. }
  18640. },
  18641. choose: function(e) {
  18642. return function(t, i) {
  18643. return e.id === t.id ? -1 : e.id === i.id ? 1 : 0
  18644. }
  18645. }
  18646. },
  18647. n.scoreFunctions = {
  18648. distance: function(e, t) {
  18649. return t = t || a.navigation.distanceFactor,
  18650. function(i) {
  18651. return e ? e.position.distanceTo(i.position) * t : 0
  18652. }
  18653. },
  18654. distanceSquared: function(e, t) {
  18655. return t = t || a.navigation.distanceFactor,
  18656. function(i) {
  18657. return e ? e.position.distanceToSquared(i.position) * t : 0
  18658. }
  18659. },
  18660. direction: function(e, t) {
  18661. return function(i) {
  18662. var n = i.position.clone().sub(e).normalize();
  18663. return n.dot(t) * a.navigation.directionFactor
  18664. }
  18665. },
  18666. angle: function(e, t) {
  18667. return function(i) {
  18668. var n = i.position.clone().sub(e).normalize();
  18669. return n.angleTo(t) * a.navigation.angleFactor
  18670. }
  18671. },
  18672. inFieldOfView: function(e, t) {
  18673. return function(i) {
  18674. var n = i.position.clone().sub(e).normalize();
  18675. return n.dot(t) > .75 ? 10 : -1
  18676. }
  18677. },
  18678. optionality: function(e) {
  18679. return function(t) {
  18680. var i = t.neighbourUUIDs.filter(function(t) {
  18681. return !(t in e.neighbourUUIDs) && t !== e.id
  18682. });
  18683. return i.length * a.navigation.optionalityFactor
  18684. }
  18685. },
  18686. penalizeHeightDifferenceUnder: function(e, t) {
  18687. return function(i) {
  18688. return e.y - i.position.y < t ? -20 : 0
  18689. }
  18690. }
  18691. },
  18692. t.exports = n
  18693. }
  18694. ).call(this, "/js/objects/Panorama.js")
  18695. }
  18696. , {
  18697. "../enum/AlignmentType": 17,
  18698. "../enum/GLCubeFaces": 25,
  18699. "../enum/PanoRendererEvents": 35,
  18700. "../enum/PanoSizeClass": 36,
  18701. "../enum/PanoramaEvents": 37,
  18702. "../enum/RenderLayers": 41,
  18703. "../enum/RenderOrder": 42,
  18704. "../enum/TileDownloaderEvents": 45,
  18705. "../enum/Viewmode": 51,
  18706. "../exception/BasicException": 55,
  18707. "../scene/SceneRenderer": 158,
  18708. "../settings": 166,
  18709. "../tile/TileUtils": 174,
  18710. "../util/ajax": 181,
  18711. "../util/common": 185,
  18712. "../util/lerp": 188,
  18713. "../util/logger": 189,
  18714. "../util/panorama": 191,
  18715. "../util/texture": 194,
  18716. "../util/transitions": 195,
  18717. events: 202,
  18718. three: 217
  18719. }],
  18720. 149: [function(e, t, i) {
  18721. "use strict";
  18722. function n(e) {
  18723. var t = r.UniformsUtils.clone(c.waypoint.uniforms);
  18724. t.map.value = d,
  18725. t.opacity.value = 0,
  18726. t.color.value.set(o.reticuleColor),
  18727. r.Mesh.call(this, new r.PlaneBufferGeometry(.4,.4,1,1), new r.RawShaderMaterial({
  18728. side: r.DoubleSide,
  18729. depthWrite: !1,
  18730. depthTest: !1,
  18731. transparent: !0,
  18732. vertexShader: c.waypoint.vertexShader,
  18733. fragmentShader: c.waypoint.fragmentShader,
  18734. uniforms: t,
  18735. name: "waypoint",
  18736. opacity: 0
  18737. })),
  18738. this.layers.set(h.RETICULE),
  18739. this.renderOrder = u.reticule,
  18740. this.player = e,
  18741. this.direction = new r.Vector3,
  18742. this.hidden = !0,
  18743. this.mouseLastMoveTime = Date.now()
  18744. }
  18745. var r = e("three")
  18746. , o = e("../settings")
  18747. , a = e("../util/transitions")
  18748. , s = e("../util/texture")
  18749. , l = e("../util/lerp")
  18750. , c = e("../shaders")
  18751. , h = e("../enum/RenderLayers")
  18752. , u = e("../enum/RenderOrder")
  18753. , d = s.load(rootPath+"images/reticule-256x256.png");
  18754. n.prototype = Object.create(r.Mesh.prototype),
  18755. n.prototype.move = function(e, t, i) {
  18756. this.hidden = i,
  18757. this.mouseLastMoveTime = Date.now()
  18758. }
  18759. ,
  18760. n.prototype.hide = function() {
  18761. this.hidden || (this.hidden = !0,
  18762. a.start(l.property(this.material.uniforms.opacity, "value", 0), o.reticuleOpacityTransitionTime))
  18763. }
  18764. ,
  18765. n.prototype.show = function() {
  18766. this.hidden = !1,
  18767. this.material.opacity <= 0 && a.start(l.property(this.material.uniforms.opacity, "value", o[this.player.mode].reticuleOpacity), o.reticuleOpacityTransitionTime)
  18768. }
  18769. ,
  18770. n.prototype.update = function() {
  18771. Date.now() - this.mouseLastMoveTime > o.hideReticuleTimeout && !this.hidden && this.hide()
  18772. }
  18773. ,
  18774. n.prototype.updatePosition = function(e, t) {
  18775. if (!this.hidden) {
  18776. if (!t)
  18777. return this.hide();
  18778. var i = t.point
  18779. , n = e.distanceTo(i)
  18780. , r = 1 + .01 * n;
  18781. n < 1 && (r -= 1 - n),
  18782. this.show(),
  18783. this.scale.set(r, r, r),
  18784. this.direction = this.direction.multiplyScalar(.8),
  18785. this.direction.add(t.face.normal.clone().multiplyScalar(.2)),
  18786. this.position.copy(i).add(t.face.normal.clone().multiplyScalar(.01)),
  18787. this.lookAt(this.position.clone().add(this.direction))
  18788. }
  18789. }
  18790. ,
  18791. n.prototype.writeAstag = function() {
  18792. var e = Math.floor(4294967296 * (1 + Math.random())).toString(16) + Math.floor(16 * (1 + Math.random())).toString(16)
  18793. , t = new Date;
  18794. this.tagCount = "undefined" == typeof this.tagCount ? 1 : this.tagCount + 1;
  18795. var i = {
  18796. enabled: !0,
  18797. version: "0",
  18798. created: t.toISOString(),
  18799. created_by: "APITest",
  18800. position: this.position.clone(),
  18801. stem: {
  18802. enabled: o.tags.pole.enabled,
  18803. direction: this.direction.multiplyScalar(o.tags.pole.height)
  18804. },
  18805. label: "tag " + this.tagCount,
  18806. description: "Description " + e,
  18807. floor: function(e) {
  18808. if (e.currentFloor) {
  18809. var t = e.floors.indexOf(e.currentFloor);
  18810. return t > -1 ? t : void 0
  18811. }
  18812. }(this.player.model),
  18813. type: "info",
  18814. metadata: {
  18815. preferred_camera: {
  18816. mode: this.player.mode
  18817. }
  18818. }
  18819. };
  18820. console.log("--------------------------"),
  18821. console.log(JSON.stringify(i));
  18822. var n = this.player.model.addtag(e, i).build();
  18823. n && (n.disc && this.player.tagDiscs.push(n.disc),
  18824. n.visible || n.show(o.tags.startup.fadeInDuration))
  18825. }
  18826. ,
  18827. t.exports = n
  18828. }
  18829. , {
  18830. "../enum/RenderLayers": 41,
  18831. "../enum/RenderOrder": 42,
  18832. "../settings": 166,
  18833. "../shaders": 167,
  18834. "../util/lerp": 188,
  18835. "../util/texture": 194,
  18836. "../util/transitions": 195,
  18837. three: 217
  18838. }],
  18839. 150: [function(e, t, i) {
  18840. "use strict";
  18841. function n(e, t) {
  18842. this.chunks = [],
  18843. this.floorId = e,
  18844. this.roomId = t,
  18845. this.position = new r.Vector3
  18846. }
  18847. var r = e("three");
  18848. n.prototype.addChunk = function(e) {
  18849. this.chunks.push(e)
  18850. }
  18851. ,
  18852. n.prototype.calcBoundaries = function() {
  18853. 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++) {
  18854. var s = this.chunks[a]
  18855. , l = s.geometry.attributes.position;
  18856. if (l)
  18857. for (var c = 0; c < l.array.length; c += 3)
  18858. e.set(l.array[c], l.array[c + 1], l.array[c + 2]),
  18859. t.add(e),
  18860. 0 === c ? (i.copy(e),
  18861. n.copy(e)) : (i.max(e),
  18862. n.min(e)),
  18863. o++
  18864. }
  18865. o > 0 ? (t.multiplyScalar(1 / o),
  18866. this.average = t) : this.average = null,
  18867. this.boundsMax = i,
  18868. this.boundsMin = n,
  18869. this.center = new r.Vector3,
  18870. this.center.copy(i).sub(n).multiplyScalar(.5).add(n)
  18871. }
  18872. ,
  18873. t.exports = n
  18874. }
  18875. , {
  18876. three: 217
  18877. }],
  18878. 151: [function(e, t, i) {
  18879. (function(i) {
  18880. "use strict";
  18881. function n(e, t, i) {
  18882. this.obj3d = null,
  18883. this.nodes = [],
  18884. this.colorHull = [],
  18885. this.shortPaths = {},
  18886. this.floorHull = null,
  18887. this.cameraHull = null,
  18888. this.floorPathDistance = 0,
  18889. this.floorCurvePoints = null,
  18890. this.floorCurveColors = null,
  18891. this.camCurvePoints = null,
  18892. this.warpDestHeroLoc = null,
  18893. this.warpDestPano = null,
  18894. this.warpPathPoints = null,
  18895. this.warpPathLengths = [0],
  18896. this.warpLength = 0,
  18897. this.closeWarpDistance = 4,
  18898. this.UP = A.UP.clone(),
  18899. this.longestStep = 0,
  18900. this.upcomingTransType = null,
  18901. this.burnsDir = 1,
  18902. this.prevNextDist = 0,
  18903. this.nextI = 0,
  18904. this.activeTransType = null,
  18905. this.lastTransType = null,
  18906. this.bunnyObj = null,
  18907. this.director = e,
  18908. this.player = t,
  18909. this.playerControls = i,
  18910. this.modelManager = t.modelManager,
  18911. this.updateModel(),
  18912. this.updateDefaultsFromModelData(),
  18913. this.bindEvents(),
  18914. this.warping = !1,
  18915. this.waitingToWarp = !1,
  18916. this.warpInterrupted = !1,
  18917. this.warpInterruptionBlackoutStyle = null,
  18918. this.warpInterruptionTravelTime = null
  18919. }
  18920. var r = e("three")
  18921. , o = e("../util/logger")
  18922. , a = e("../enum/Viewmode")
  18923. , s = e("../enum/RenderOrder")
  18924. , l = e("../enum/WarpStyle")
  18925. , c = e("../settings")
  18926. , h = e("../util/math")
  18927. , u = e("../util/lerp")
  18928. , d = e("../util/easing")
  18929. , p = e("../util/transitions")
  18930. , f = e("../objects/Snapshot")
  18931. , g = e("../effects")
  18932. , m = e("../shaders")
  18933. , v = (e("../gui/gui"),
  18934. e("../util/texture"))
  18935. , A = e("../enum/Vectors")
  18936. , y = (e("../model/ModelManager"),
  18937. new o(i))
  18938. , C = e("../enum/PlayerEvents")
  18939. , I = e("../enum/BlackoutStyle")
  18940. , E = e("../enum/ModelManagerEvents")
  18941. , b = e("../constants")
  18942. , w = {
  18943. 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"),
  18944. pathEnd: v.load(rootPath + "images/End.png"),
  18945. 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==")
  18946. };
  18947. n.prototype.setScene = function(e) {
  18948. this.createCpm(e),
  18949. this.createBunnyObj(e)
  18950. }
  18951. ,
  18952. n.prototype.updateModel = function() {
  18953. this.model = this.modelManager.getActiveModel()
  18954. }
  18955. ,
  18956. n.prototype.bindEvents = function() {
  18957. this.modelManager.on(E.ActiveModelChanged, this.updateModel.bind(this))
  18958. }
  18959. ,
  18960. n.prototype.updateDefaultsFromModelData = function() {
  18961. this.model.data
  18962. }
  18963. ,
  18964. n.prototype.pointPathDistance = function(e) {
  18965. for (var t = 0, i = 1; i < e.length; i += 1)
  18966. t += e[i - 1].distanceTo(e[i]);
  18967. return t
  18968. }
  18969. ,
  18970. n.prototype.pointPathLengths = function(e) {
  18971. for (var t = [0], i = 1; i < e.length; i += 1)
  18972. t.push(t[i - 1] + e[i - 1].distanceTo(e[i]));
  18973. return t
  18974. }
  18975. ,
  18976. n.prototype.interpAlongPath = function(e, t, i) {
  18977. var n, o = new r.Vector3, a = t[t.length - 1];
  18978. if (i < 1) {
  18979. n = i * a;
  18980. for (var s = 1; s < t.length; s += 1)
  18981. if (t[s] > n) {
  18982. var l = (n - t[s - 1]) / (t[s] - t[s - 1]);
  18983. return o.copy(e[s]),
  18984. o.sub(e[s - 1]),
  18985. o.multiplyScalar(l),
  18986. o.add(e[s - 1]),
  18987. o
  18988. }
  18989. } else
  18990. o.copy(e[e.length - 1]);
  18991. return o
  18992. }
  18993. ,
  18994. n.prototype.pathHeight = function() {
  18995. return this.player.mode !== a.FLOORPLAN ? c.path.height : c.path.outsideHeight
  18996. }
  18997. ,
  18998. n.prototype.createBunnyObj = function(e) {
  18999. this.bunnyObj || (this.bunnyObj = new r.AxisHelper(.1),
  19000. this.bunnyObj.visible = c.warp.showBunny),
  19001. this.bunnyObj.parent && this.bunnyObj.parent.remove(bunnyObj),
  19002. e.add(this.bunnyObj)
  19003. }
  19004. ,
  19005. n.prototype.createCpm = function(e) {
  19006. if (!this.currentPanoMarker) {
  19007. var t = this.makeWaypointObj(w.pathEnd, "Current");
  19008. t.material.uniforms.opacity.value = 0,
  19009. this.currentPanoMarker = {
  19010. mesh: t,
  19011. placed: !1
  19012. }
  19013. }
  19014. this.currentPanoMarker.mesh.parent && this.currentPanoMarker.mesh.parent.remove(this.currentPanoMarker.mesh),
  19015. this.placeCpm(),
  19016. this.currentPanoMarker.mesh.parent || e.add(this.currentPanoMarker.mesh)
  19017. }
  19018. ,
  19019. n.prototype.placeCpm = function() {
  19020. if (c.path.mapGuides && this.player.currentPano && this.player.currentPano.isAligned()) {
  19021. var e = this.player.currentPano.floor;
  19022. this.currentPanoMarker.mesh.parent !== this.player.currentPano.floor && (this.currentPanoMarker.mesh.parent && this.currentPanoMarker.mesh.parent.remove(this.currentPanoMarker.mesh),
  19023. e.add(this.currentPanoMarker.mesh)),
  19024. this.currentPanoMarker.mesh.position.copy(this.player.currentPano.floorPosition).sub(e.position),
  19025. this.currentPanoMarker.mesh.position.y += this.pathHeight(),
  19026. this.currentPanoMarker.placed = !0
  19027. } else
  19028. this.popOutCpm()
  19029. }
  19030. ,
  19031. n.prototype.fadeInCpm = function(e) {
  19032. 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)
  19033. }
  19034. ,
  19035. n.prototype.fadeOutCpm = function(e) {
  19036. p.start(u.property(this.currentPanoMarker.mesh.material.uniforms.opacity, "value", 0), e)
  19037. }
  19038. ,
  19039. n.prototype.popInCpm = function() {
  19040. c.path.mapGuides && this.currentPanoMarker.placed && this.fadeInCpm(2)
  19041. }
  19042. ,
  19043. n.prototype.popOutCpm = function() {
  19044. this.fadeOutCpm(2)
  19045. }
  19046. ,
  19047. n.prototype.brushPrefs = {
  19048. linewidth: 7,
  19049. strokeWidth: 15,
  19050. cvSegments: 48,
  19051. paveStep: .1,
  19052. paveWidth: .2,
  19053. lookBlendDist: 3,
  19054. maxTurn: r.Math.degToRad(2)
  19055. },
  19056. n.prototype.panoPathDistance = function(e) {
  19057. var t = this.model.panos;
  19058. if (!e || e.length < 2)
  19059. return 0;
  19060. for (var i = [], n = 0; n < e.length; n += 1)
  19061. i.push(t.get(e[n]).floorPosition);
  19062. return this.pointPathDistance(i)
  19063. }
  19064. ,
  19065. n.prototype.loadTileTexture = function(e) {
  19066. var t = v.load(e, function(t) {
  19067. t.wrapS = r.RepeatWrapping,
  19068. t.wrapT = r.RepeatWrapping,
  19069. t.needsUpdate = !0,
  19070. y.debug('path texture "' + e + '" is ready')
  19071. }, function() {
  19072. y.error('path texture "' + e + '" failed')
  19073. });
  19074. return t.mapping = r.UVMapping,
  19075. t
  19076. }
  19077. ,
  19078. n.prototype.buildWarpDestinationDescriptor = function(e, t, i, n, r, o) {
  19079. var a = {
  19080. cameraMode: n,
  19081. position: e,
  19082. quaternion: t,
  19083. panoId: i,
  19084. orthoZoom: o,
  19085. floorVisibility: r,
  19086. thumbUrl: null,
  19087. name: null
  19088. };
  19089. return new f(a)
  19090. }
  19091. ,
  19092. n.prototype.buildWarpDestinationDescriptorFromHero = function(e) {
  19093. return this.buildWarpDestinationDescriptor(e.position, e.quaternion, this.getHeroId(e), e.cameraMode, e.floorVisibility, e.orthoZoom)
  19094. }
  19095. ,
  19096. n.prototype.setWarpDestination = function(e) {
  19097. this.warpDestHeroLoc = e
  19098. }
  19099. ,
  19100. n.prototype.setWarpDestinationByHeroIndex = function(e) {
  19101. var t = this.getHeroDescriptorByHeroIndex(e);
  19102. return null !== t && (this.setWarpDestination(t),
  19103. !0)
  19104. }
  19105. ,
  19106. n.prototype.setWarpDestinationByPano = function(e, t) {
  19107. var i = this.model.panos.get(e.id);
  19108. return !!i && this.setWarpDestinationByPanoId(e.id, t)
  19109. }
  19110. ,
  19111. n.prototype.setWarpDestinationByPanoId = function(e, t) {
  19112. var i = this.model.panos.get(e);
  19113. if (i) {
  19114. t = t || new r.Quaternion;
  19115. var n = this.buildWarpDestinationDescriptor(i.position, t, i.id, "panorama", [], -1);
  19116. return this.setWarpDestination(n),
  19117. !0
  19118. }
  19119. return !1
  19120. }
  19121. ,
  19122. n.prototype.getHeroDescriptorByHeroIndex = function(e) {
  19123. var t = this.model.heroCount();
  19124. if (null !== this.warpDestHeroLoc && t < 2)
  19125. return y.info("ShowPath.getHeroDescriptorByHeroIndex() -> Only one hero location is available."),
  19126. this.model.getHeroDescriptorByIndex(0);
  19127. var i = this.model.getHeroDescriptorByIndex(e);
  19128. if (i) {
  19129. var n = i.isPano() ? i.panoId : i.cameraMode;
  19130. y.debug('ShowPath.getHeroDescriptorByHeroIndex() -> New brush/warp destination: "' + n + '" out of ' + t + " choices.")
  19131. }
  19132. return i
  19133. }
  19134. ,
  19135. n.prototype.getHeroDescriptorByPano = function(e) {
  19136. var t = this.model.panos.get(e.id);
  19137. return t ? this.getHeroDescriptorByPanoId(e.id) : null
  19138. }
  19139. ,
  19140. n.prototype.getHeroDescriptorByPanoId = function(e) {
  19141. var t = this.getHeroIndexFromPanoId(e);
  19142. return this.getHeroDescriptorByHeroIndex(t)
  19143. }
  19144. ,
  19145. n.prototype.getHeroIndexFromPanoId = function(e) {
  19146. for (var t = 0; t < this.model.heroLocations.length; t++) {
  19147. var i = this.model.heroLocations[t]
  19148. , n = this.getHeroId(i);
  19149. if (n && n === e)
  19150. return t
  19151. }
  19152. return -1
  19153. }
  19154. ,
  19155. n.prototype.getHeroPano = function(e) {
  19156. if (null === e)
  19157. return y.warn("getHeroPano(): no destination"),
  19158. null;
  19159. var t = this.getHeroId(e)
  19160. , i = this.model.panos.get(t);
  19161. return void 0 === i && (i = null,
  19162. "" !== t && y.debug('unable to find pano "' + t + '"')),
  19163. i
  19164. }
  19165. ,
  19166. n.prototype.getHeroId = function(e) {
  19167. return e.panoId
  19168. }
  19169. ,
  19170. n.prototype.setWarpDestPano = function() {
  19171. return this.warpDestPano = this.getHeroPano(this.warpDestHeroLoc),
  19172. this.warpDestPano
  19173. }
  19174. ,
  19175. n.prototype.brushToWarpPano = function(e, t) {
  19176. if (this.discardPathObject(),
  19177. !this.setWarpDestPano())
  19178. return !1;
  19179. if (this.warpDestHeroLoc.cameraMode !== a.PANORAMA && y.warn("Can only brush from pano to pano"),
  19180. !this.warpDestPano)
  19181. return y.info("No brush"),
  19182. !1;
  19183. if (!this.player.currentPano)
  19184. return y.debug("No current pano, visibility undefined"),
  19185. !1;
  19186. if (!this.warpDestPano)
  19187. return y.info("No wPano, visibility undefined"),
  19188. !1;
  19189. if (!this.warpDestPano.isAligned())
  19190. return y.debug("Cannot brush to unaligned pano"),
  19191. !1;
  19192. var i = (e === l.STD || e === l.WALK) && c.path.mapGuides
  19193. , n = !0;
  19194. if (this.player.currentPano.id === this.warpDestPano.id)
  19195. y.debug("Already at destination pano");
  19196. else {
  19197. this.nodes = this.findShortestPath(this.player.currentPano, this.warpDestPano),
  19198. n = void 0 === this.nodes || null === this.nodes || this.nodes.length < 1,
  19199. this.obj3d = new r.Object3D,
  19200. y.debug('Brushing from "' + this.player.currentPano.id + '" to "' + this.warpDestPano.id + '" (' + (this.nodes ? this.nodes.length : 0) + ")"),
  19201. n ? (y.info('No "walkable" route, using fall-back warp style transition'),
  19202. e = t) : (this.setPathHulls(this.nodes),
  19203. this.setFloorCurves(),
  19204. 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)))),
  19205. this.player.currentPano.floor.add(this.obj3d);
  19206. var o = this.player.mode === a.DOLLHOUSE || this.player.mode === a.FLOORPLAN
  19207. , s = e === l.STD;
  19208. if (!n && (i || s)) {
  19209. if (o) {
  19210. var h = this.makeStartMarker(this.floorHull[0], this.floorCurvePoints);
  19211. this.obj3d.add(h)
  19212. }
  19213. var u = this.makeEndMarker(this.floorHull[this.floorHull.length - 1]);
  19214. this.obj3d.add(u)
  19215. }
  19216. this.appearSlow()
  19217. }
  19218. return this.upcomingTransType = e,
  19219. !n
  19220. }
  19221. ,
  19222. n.prototype.findShortestPath = function(e, t) {
  19223. if (!e || !t)
  19224. return null;
  19225. var i = c.warp.walkExtraPanosDistance
  19226. , n = e.id + ":" + t.id + ":" + i;
  19227. if (this.shortPaths.hasOwnProperty(n))
  19228. return this.shortPaths[n] ? this.shortPaths[n].slice() : null;
  19229. var r = t.id + ":" + e.id + ":" + i;
  19230. if (this.shortPaths.hasOwnProperty(r))
  19231. return this.shortPaths[r] ? this.shortPaths[r].slice().reverse() : null;
  19232. var o = this.model.panos.aStarSearch(e, t);
  19233. return this.model.panos.includeNodesNearPath(o, i),
  19234. this.shortPaths[n] = o ? o.slice() : null,
  19235. o
  19236. }
  19237. ,
  19238. n.prototype.makePathHulls = function(e) {
  19239. var t, i, n, r, o, a = 0, s = [], l = [], h = [], u = this.model.panos;
  19240. t = u.get(e[0]),
  19241. r = t.floor.floorIndex;
  19242. for (var d = 0; d < e.length; d += 1)
  19243. t = u.get(e[d]),
  19244. i = t.floorPosition.clone().sub(this.model.position),
  19245. i.y += this.pathHeight(),
  19246. s.push(i),
  19247. l.push(t.position.clone()),
  19248. n = t.floor.floorIndex,
  19249. h.push(n > r ? c.path.colorUp : n < r ? c.path.colorDown : c.path.color),
  19250. d > 0 && (o = l[d].distanceTo(l[d - 1]),
  19251. o > a && (a = o));
  19252. return a > this.longestStep && (this.longestStep = a,
  19253. y.debug("path contains " + a + " meter segment")),
  19254. {
  19255. floor: s,
  19256. camera: l,
  19257. color: h
  19258. }
  19259. }
  19260. ,
  19261. n.prototype.makeFloorCurves = function(e, t, i) {
  19262. var n = this.player.mode === a.PANORAMA ? c.path.waypointIndoorRadius : c.path.waypointRadius
  19263. , o = this.pointPathDistance(e) - 2 * n
  19264. , s = e.slice(0)
  19265. , l = s[1].clone().sub(s[0]);
  19266. l.y = 0,
  19267. l.normalize().multiplyScalar(n),
  19268. s[0] = (new r.Vector3).copy(s[0]).add(l),
  19269. l = s[s.length - 2].clone().sub(s[s.length - 1]),
  19270. l.y = 0,
  19271. l.normalize().multiplyScalar(n),
  19272. s[s.length - 1] = (new r.Vector3).copy(s[s.length - 1]).add(l);
  19273. var h = new r.CatmullRomCurve3(s)
  19274. , u = Math.floor(o / i);
  19275. u = 4 * Math.floor(u / 4),
  19276. u = Math.max(4, u);
  19277. for (var d, p, f, g = h.getSpacedPoints(u), m = [], v = new r.Vector3, A = 0; A < g.length; A += 1) {
  19278. f = 0,
  19279. d = g[A].distanceTo(e[0]);
  19280. for (var y = 1; y < e.length; y += 1)
  19281. v.copy(g[A]).sub(e[y]),
  19282. v.y *= 4,
  19283. p = v.length(),
  19284. p < d && (f = y);
  19285. m.push(t[f])
  19286. }
  19287. return {
  19288. distance: o,
  19289. points: g,
  19290. colors: m
  19291. }
  19292. }
  19293. ,
  19294. n.prototype.makeCameraCurvePoints = function(e, t) {
  19295. var i = this.pointPathDistance(e)
  19296. , n = new r.CatmullRomCurve3(e);
  19297. return n.getSpacedPoints(Math.max(2, Math.floor(i / t)))
  19298. }
  19299. ,
  19300. n.prototype.makeCameraCurveTangents = function(e, t) {
  19301. var i = this.pointPathDistance(e)
  19302. , n = new r.CatmullRomCurve3(e)
  19303. , o = Math.max(2, Math.floor(i / t));
  19304. o || (o = 5);
  19305. for (var a = [], s = 0; s <= o; s++)
  19306. a.push(n.getTangentAt(s / o));
  19307. return a
  19308. }
  19309. ,
  19310. n.prototype.setPathHulls = function(e) {
  19311. var t = this.makePathHulls(e);
  19312. this.floorHull = t.floor,
  19313. this.cameraHull = t.camera,
  19314. this.colorHull = t.color
  19315. }
  19316. ,
  19317. n.prototype.setFloorCurves = function() {
  19318. var e = this.makeFloorCurves(this.floorHull, this.colorHull, this.brushPrefs.paveStep);
  19319. this.floorPathDistance = e.distance,
  19320. this.floorCurvePoints = e.points,
  19321. this.floorCurveColors = e.colors
  19322. }
  19323. ,
  19324. n.prototype.setCameraCurvePoints = function() {
  19325. this.camCurvePoints = this.makeCameraCurvePoints(this.cameraHull, c.warp.stepFactor * this.brushPrefs.paveStep)
  19326. }
  19327. ,
  19328. n.prototype.chooseWarpPath = function(e) {
  19329. var t, i, n, o = this.playerControls.cameras[a.PANORAMA];
  19330. if (this.player.currentPano === this.warpDestPano || !e)
  19331. return this.warpPathPoints = null,
  19332. this.warpLength = 0,
  19333. !1;
  19334. this.nodes = this.findShortestPath(this.player.currentPano, this.warpDestPano),
  19335. void 0 === this.nodes || null === this.nodes || this.nodes.length < 1 ? (y.debug("warp path to unreachable node"),
  19336. t = this.warpDestPano.position.clone().sub(o.position),
  19337. i = t.clone().negate(),
  19338. t.multiplyScalar(.15).add(o.position),
  19339. i.multiplyScalar(.15).add(this.warpDestPano.position),
  19340. t.y = o.position.y,
  19341. i.y = this.warpDestPano.position.y,
  19342. n = new r.CubicBezierCurve3(o.position.clone(),t,i,this.warpDestPano.position.clone()),
  19343. this.warpPathPoints = n.getSpacedPoints(this.brushPrefs.cvSegments)) : (y.debug("follow warp path (path distance was " + this.nodes.length + " nodes, " + this.floorPathDistance + ")"),
  19344. this.setCameraCurvePoints(),
  19345. this.warpPathPoints = this.camCurvePoints.slice(0)),
  19346. this.warpLength = 0,
  19347. this.warpPathLengths = [0];
  19348. 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) {
  19349. s.copy(this.warpPathPoints[d - 1]).sub(this.warpPathPoints[d]);
  19350. var p = s.length();
  19351. s.y *= c.warp.climbEffort;
  19352. var f = s.length() / p;
  19353. if (d > 1) {
  19354. s.setY(0).normalize(),
  19355. l.copy(this.warpPathPoints[d - 2]).sub(this.warpPathPoints[d - 1]).setY(0).normalize();
  19356. var g = Math.min(1, s.dot(l))
  19357. , m = 1 + (c.warp.brakeStrength - 1) * (1 - r.Math.smoothstep(g, u, h));
  19358. f = Math.max(m, f)
  19359. }
  19360. this.warpLength += p * f,
  19361. this.warpPathLengths[d] = this.warpLength
  19362. }
  19363. return !0
  19364. }
  19365. ,
  19366. n.prototype.drawPathRibbon = function(e, t) {
  19367. this.bunnyObj.visible = c.warp.showBunny;
  19368. 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) {
  19369. h.copy(e[u]),
  19370. 0 === u ? h.sub(e[u + 1]) : h.sub(e[u - 1]).negate(),
  19371. h.normalize(),
  19372. n.crossVectors(h, A.UP),
  19373. n.multiplyScalar(i);
  19374. var d = (new r.Vector3).copy(e[u]).add(o);
  19375. d.sub(n),
  19376. l.vertices.push(d),
  19377. d = (new r.Vector3).copy(e[u]).add(o),
  19378. d.add(n),
  19379. l.vertices.push(d)
  19380. }
  19381. var p, f = 0;
  19382. for (u = 0; u < e.length - 1; u += 1) {
  19383. var g = 2 * u
  19384. , v = f;
  19385. f += e[u + 1].distanceTo(e[u]);
  19386. var y = f
  19387. , C = t[u]
  19388. , I = t[u + 1];
  19389. p = new r.Face3(g,g + 1,g + 2),
  19390. p.vertexColors = [new r.Color(C), new r.Color(C), new r.Color(I)],
  19391. l.faces.push(p),
  19392. l.faceVertexUvs[0].push([new r.Vector2(0,v), new r.Vector2(1,v), new r.Vector2(0,y)]),
  19393. p = new r.Face3(g + 2,g + 1,g + 3),
  19394. p.vertexColors = [new r.Color(I), new r.Color(C), new r.Color(I)],
  19395. l.faces.push(p),
  19396. l.faceVertexUvs[0].push([new r.Vector2(0,y), new r.Vector2(1,v), new r.Vector2(1,y)])
  19397. }
  19398. l.computeFaceNormals(),
  19399. l.computeVertexNormals();
  19400. var E, b;
  19401. this.player.mode === a.PANORAMA ? (b = r.UniformsUtils.clone(m.ribbon.uniforms),
  19402. b.map.value = w.path,
  19403. b.opacity.value = 0,
  19404. b.color.value.set(c.path.color),
  19405. E = new r.RawShaderMaterial({
  19406. side: r.DoubleSide,
  19407. depthWrite: !1,
  19408. transparent: !0,
  19409. vertexShader: m.ribbon.vertexShader,
  19410. fragmentShader: m.ribbon.fragmentShader,
  19411. uniforms: b,
  19412. name: "ribbonT",
  19413. opacity: 0
  19414. })) : E = new r.MeshBasicMaterial({
  19415. color: 16777215,
  19416. side: r.DoubleSide,
  19417. name: "ribbonOut",
  19418. vertexColors: r.VertexColors
  19419. });
  19420. var _ = new r.Mesh(l,E);
  19421. return _.name = "ribbon",
  19422. this.player.mode === a.PANORAMA && (_.renderOrder = s.ribbon),
  19423. _
  19424. }
  19425. ,
  19426. n.prototype.drawPathPavement = function(e) {
  19427. for (var t, i = .25, n = new r.Vector3, o = new r.Geometry, s = new r.Vector3, l = 0; l < e.length; l += 1)
  19428. s.copy(e[l]),
  19429. 0 === l ? s.sub(e[l + 1]).negate() : s.sub(e[l - 1]),
  19430. s.normalize(),
  19431. n.crossVectors(s, A.UP),
  19432. n.multiplyScalar(this.brushPrefs.paveWidth),
  19433. t = (new r.Vector3).copy(e[l]),
  19434. t.sub(n),
  19435. o.vertices.push(t),
  19436. o.vertices.push((new r.Vector3).copy(e[l])),
  19437. t = (new r.Vector3).copy(e[l]),
  19438. t.add(n),
  19439. o.vertices.push(t);
  19440. var h, u, d;
  19441. for (l = 0; l < e.length - 1; l += 1)
  19442. h = 3 * l + 1,
  19443. u = l * i,
  19444. d = u + i,
  19445. o.faces.push(new r.Face3(h - 1,h,h + 3)),
  19446. o.faceVertexUvs[0].push([new r.Vector2(0,u), new r.Vector2(.5,u), new r.Vector2(.5,d)]),
  19447. o.faces.push(new r.Face3(h + 3,h + 2,h - 1)),
  19448. o.faceVertexUvs[0].push([new r.Vector2(.5,d), new r.Vector2(0,d), new r.Vector2(0,u)]),
  19449. o.faces.push(new r.Face3(h + 3,h,h + 1)),
  19450. o.faceVertexUvs[0].push([new r.Vector2(.5,d), new r.Vector2(.5,u), new r.Vector2(1,u)]),
  19451. o.faces.push(new r.Face3(h + 3,h + 1,h + 4)),
  19452. o.faceVertexUvs[0].push([new r.Vector2(.5,d), new r.Vector2(1,u), new r.Vector2(1,d)]);
  19453. var p = this.player.mode === a.PANORAMA ? new r.MeshBasicMaterial({
  19454. color: c.path.color,
  19455. side: r.DoubleSide,
  19456. transparent: !0,
  19457. depthWrite: !1,
  19458. opacity: 0,
  19459. name: "paveT",
  19460. map: w.path
  19461. }) : new r.MeshBasicMaterial({
  19462. color: c.path.color,
  19463. side: r.DoubleSide,
  19464. transparent: !0,
  19465. depthWrite: !1,
  19466. opacity: 1,
  19467. name: "paveO",
  19468. map: w.path
  19469. });
  19470. return new r.Mesh(o,p)
  19471. }
  19472. ,
  19473. n.prototype.hintPrefs = {
  19474. rad: .18,
  19475. width: .0125,
  19476. depth: .0625,
  19477. setBack: -.04,
  19478. markRad: .25,
  19479. markInnerRad: .16
  19480. },
  19481. n.prototype.makeWaypointObj = function(e, t) {
  19482. var i = new r.Geometry
  19483. , n = this.player.mode === a.PANORAMA ? c.path.waypointIndoorRadius : c.path.waypointRadius
  19484. , o = this.pathHeight();
  19485. 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)),
  19486. i.faces.push(new r.Face3(0,1,2), new r.Face3(2,3,0)),
  19487. i.faceVertexUvs[0].push([new r.Vector2(0,0), new r.Vector2(1,0), new r.Vector2(1,1)]),
  19488. i.faceVertexUvs[0].push([new r.Vector2(1,1), new r.Vector2(0,1), new r.Vector2(0,0)]);
  19489. var s = r.UniformsUtils.clone(m.waypoint.uniforms);
  19490. s.map.value = e,
  19491. s.opacity.value = 0,
  19492. s.color.value.set(c.path.color);
  19493. var l = {
  19494. side: r.DoubleSide,
  19495. depthWrite: !1,
  19496. transparent: !0,
  19497. vertexShader: m.waypoint.vertexShader,
  19498. fragmentShader: m.waypoint.fragmentShader,
  19499. uniforms: s,
  19500. name: "waypoint",
  19501. opacity: 0
  19502. };
  19503. this.player.mode !== a.PANORAMA && (l.depthTest = !1,
  19504. l.name = "wayPtOut");
  19505. var h = new r.RawShaderMaterial(l)
  19506. , u = new r.Mesh(i,h);
  19507. return u.name = t,
  19508. u
  19509. }
  19510. ,
  19511. n.prototype.makeStartMarker = function(e, t) {
  19512. var i = (new r.Vector3).copy(t[1]).sub(t[0]);
  19513. i.y = 0,
  19514. i.normalize();
  19515. var n = Math.acos(i.x)
  19516. , o = this.makeWaypointObj(w.pathStart, "Start");
  19517. return o.rotateOnAxis(new r.Vector3(0,1,0), n),
  19518. o.position.copy(e),
  19519. o
  19520. }
  19521. ,
  19522. n.prototype.makeEndMarker = function(e) {
  19523. var t = this.makeWaypointObj(w.pathEnd, "End")
  19524. , i = this.model.panos.get(this.nodes[0]).floor.floorIndex
  19525. , n = this.model.panos.get(this.nodes[this.nodes.length - 1]).floor.floorIndex;
  19526. return i < n ? t.material.uniforms.color.value.set(c.path.colorUp) : i > n && t.material.uniforms.color.value.set(c.path.colorDown),
  19527. t.position.copy(e),
  19528. t
  19529. }
  19530. ,
  19531. n.prototype.pathClean = function(e) {
  19532. if (e) {
  19533. for (var t in e.children)
  19534. this.pathClean(e.children[t]);
  19535. e.geometry && e.geometry.dispose(),
  19536. e.material && e.material.dispose()
  19537. }
  19538. }
  19539. ,
  19540. n.prototype.discardPathObject = function() {
  19541. if (this.obj3d) {
  19542. var e = this.obj3d.parent;
  19543. e && e.remove(this.obj3d),
  19544. this.pathClean(this.obj3d)
  19545. }
  19546. this.obj3d = null,
  19547. this.popInCpm()
  19548. }
  19549. ,
  19550. n.prototype.discardSlow = function() {
  19551. if (this.obj3d) {
  19552. if (this.player.mode !== a.PANORAMA)
  19553. return void this.discardPathObject();
  19554. for (var e, t = this, i = 0, n = function() {
  19555. this.discardPathObject()
  19556. }
  19557. .bind(this), r = 0; r < t.obj3d.children.length; r += 1)
  19558. e = t.obj3d.children[r],
  19559. 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]),
  19560. i += 1,
  19561. n = null);
  19562. 0 === i && this.discardPathObject(),
  19563. this.player.mode !== a.PANORAMA && this.fadeInCpm(c.path.fadeInTime - 3)
  19564. }
  19565. }
  19566. ,
  19567. n.prototype.appearSlow = function() {
  19568. var e, t = this;
  19569. this.fadeOutCpm(c.path.fadeInTime);
  19570. for (var i = this.player.mode === a.PANORAMA ? c.path.opacity : 1, n = 0; n < t.obj3d.children.length; n += 1)
  19571. e = t.obj3d.children[n],
  19572. 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]))
  19573. }
  19574. ,
  19575. n.prototype.update = function() {
  19576. this.obj3d && this.obj3d.updateMatrixWorld()
  19577. }
  19578. ,
  19579. n.prototype.calcBurnsAmount = function(e) {
  19580. var t = r.Math.degToRad(c.warp.burnsAngle);
  19581. if (this.player.mode === a.PANORAMA) {
  19582. var i = this.burnsDir * t;
  19583. if (this.upcomingTransType === l.BLACK)
  19584. return i;
  19585. var n = e;
  19586. if (null === n)
  19587. return y.warn("Transition request for non-highlight"),
  19588. i;
  19589. var o = this.getHeroDescriptorByHeroIndex(n);
  19590. if (null === o)
  19591. return i;
  19592. if (!o.isPano())
  19593. return i;
  19594. var s = this.getHeroPano(o)
  19595. , h = this.playerControls.cameras[a.PANORAMA]
  19596. , u = A.FORWARD.clone().applyQuaternion(h.quaternion).setY(0).normalize()
  19597. , d = Math.min(r.Math.degToRad(c.warp.minBurnsAngle), t)
  19598. , p = function(e) {
  19599. var i = Math.acos(Math.min(1, e.dot(u)))
  19600. , n = (new r.Vector3).crossVectors(u, e);
  19601. return Math.max(d, Math.min(Math.abs(i), t)) * Math.sign(n.y)
  19602. };
  19603. if (s === this.player.currentPano)
  19604. return i = p(A.FORWARD.clone().applyQuaternion(o.quaternion).setY(0).normalize());
  19605. var f = this.findShortestPath(this.player.currentPano, s);
  19606. if (void 0 === f || null === f || f.length < 1)
  19607. return y.debug("Empty path ahead..."),
  19608. i;
  19609. var g = this.makePathHulls(f)
  19610. , m = new r.CatmullRomCurve3(g.camera)
  19611. , v = Math.min(.1, c.warp.lookAheadDist / m.getLength());
  19612. return i = p(m.getPointAt(v).clone().sub(h.position).setY(0).normalize())
  19613. }
  19614. return this.player.mode === a.DOLLHOUSE ? .02 * this.burnsDir : this.burnsDir
  19615. }
  19616. ,
  19617. n.prototype.waitNextStep = function(e, t, time) {//xzw 改时间
  19618. var i = (time==void 0)? c.warp.tourStepDelay : time;
  19619. i || (i = this.lastTransType === l.BLACK ? b.tourStepDelaySlideShow : b.tourStepDelayDefault);
  19620. var n = new r.Euler
  19621. , o = new r.Vector3;
  19622. y.debug("Starting wait: " + (void 0 !== t));
  19623. var s = this.calcBurnsAmount(e)
  19624. , h = function() {
  19625. this.endWarpState(),
  19626. this.player.mode === a.DOLLHOUSE && (this.playerControls.cameras[a.DOLLHOUSE].controls.rotationAcceleration.x = 0),
  19627. t && t()
  19628. }
  19629. .bind(this)
  19630. , u = function(e, t) {
  19631. if (this.warpInterrupted)
  19632. return h(),
  19633. !0;
  19634. var r = t || 1e3 / 60;
  19635. if (c.warp.doBurns)
  19636. if (this.player.mode === a.PANORAMA) {
  19637. var l = this.playerControls.cameras[a.PANORAMA];
  19638. n.setFromQuaternion(l.quaternion, c.warp.eOrder);
  19639. var u = r * s / i;
  19640. n.y += u,
  19641. o.set(0, 0, -1),
  19642. o.applyEuler(n),
  19643. o.add(l.position),
  19644. l.controls.lookAt(o),
  19645. l.controls.lookVector.copy(o),
  19646. l.lookAt(o)
  19647. } else
  19648. this.player.mode === a.DOLLHOUSE ? this.playerControls.controls[a.DOLLHOUSE].rotationAcceleration.x = s : this.playerControls.controls[a.FLOORPLAN].absoluteScale *= .9996
  19649. }
  19650. .bind(this);
  19651. this.startWarpState(),
  19652. p.start(u, i, h, 0, d.easeInOutQuad, "wait")
  19653. }
  19654. ,
  19655. n.prototype.warpToNonPano = function(e) {
  19656. if (this.discardPathObject(),
  19657. this.warpDestHeroLoc.cameraMode === a.DOLLHOUSE || this.warpDestHeroLoc.cameraMode === a.FLOORPLAN) {
  19658. var t = function() {
  19659. e && e()
  19660. }
  19661. .bind(this);
  19662. this.player.flyToNewMode({
  19663. mode: this.warpDestHeroLoc.cameraMode,
  19664. duration: c.warp.outsideTime,
  19665. warpDest: this.warpDestHeroLoc,
  19666. callback: t,
  19667. force: !0
  19668. })
  19669. } else
  19670. y.warn("no warp destination!!!"),
  19671. e && e()
  19672. }
  19673. ,
  19674. n.prototype._resetWarpShaderParams = function(e) {
  19675. this.player.mode === a.PANORAMA && (void 0 !== e.material.uniforms.blackout && (e.material.uniforms.blackout.value = 0),
  19676. void 0 !== e.material.uniforms.modelAlpha && (e.material.uniforms.modelAlpha.value = 0))
  19677. }
  19678. ,
  19679. n.prototype._clearWarpShading = function() {
  19680. for (var e = this.model.chunks, t = 0; t < e.length; t += 1)
  19681. this._resetWarpShaderParams(e[t]),
  19682. e[t].visible = !0;
  19683. this._resetWarpShaderParams(this.model.skybox)
  19684. }
  19685. ,
  19686. n.prototype._warpStopFlying = function() {
  19687. this.activeTransType = null,
  19688. this.placeCpm()
  19689. }
  19690. ,
  19691. n.prototype._wrapupTravelOnlyBits = function() {
  19692. this._warpStopFlying(),
  19693. this.warpPathPoints && (this.player.currentPano.exit(),
  19694. this.warpDestPano.enter(),
  19695. this.player.currentPano = this.warpDestPano),
  19696. this.player.spider.draw(),
  19697. this.placeCpm()
  19698. }
  19699. ,
  19700. n.prototype._wrapupTravel = function(e) {
  19701. this._wrapupTravelOnlyBits(),
  19702. this.warpCameraAim(e)
  19703. }
  19704. ,
  19705. n.prototype._wrapupWarpShading = function(e) {
  19706. this._clearWarpShading(),
  19707. this._wrapupTravel(e)
  19708. }
  19709. ,
  19710. n.prototype.wrapupWarpShadingOnly = function(e, t) {
  19711. t !== I.END && this._clearWarpShading(),
  19712. this._wrapupTravelOnlyBits(),
  19713. this.upcomingTransType = null,
  19714. e && e()
  19715. }
  19716. ,
  19717. n.prototype._warpCameraAim = function(e, t) {
  19718. var i = this.warpDestHeroLoc.quaternion
  19719. , n = this.playerControls.cameras[a.PANORAMA]
  19720. , o = new r.Vector3(0,0,1).applyQuaternion(i).normalize()
  19721. , s = new r.Vector3(0,0,1).applyQuaternion(n.quaternion).normalize()
  19722. , l = s.dot(o)
  19723. , u = r.Math.radToDeg(Math.acos(l))
  19724. , f = new r.Euler(0,0,0,c.warp.eOrder).setFromQuaternion(i, c.warp.eOrder)
  19725. , g = (new r.Euler).setFromQuaternion(n.quaternion, c.warp.eOrder)
  19726. , m = new r.Euler(f.x - g.x,f.y - g.y,f.z - g.z,c.warp.eOrder);
  19727. m.y = h.constrainedTurn(m.y),
  19728. this.burnsDir = Math.sign(m.y);
  19729. var v = new r.Euler(0,0,0,c.warp.eOrder)
  19730. , A = new r.Vector3
  19731. , C = function(e, t) {
  19732. return !!this.warpInterrupted || (v.x = g.x + e * m.x,
  19733. v.y = g.y + e * m.y,
  19734. v.z = g.z + e * m.z,
  19735. A.set(0, 0, -1),
  19736. A.applyEuler(v),
  19737. A.add(n.position),
  19738. n.controls.lookAt(A),
  19739. n.controls.lookVector.copy(A),
  19740. void n.lookAt(A))
  19741. }
  19742. .bind(this);
  19743. 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"),
  19744. void (t && t()))
  19745. }
  19746. ,
  19747. n.prototype._warpBendAim = function(e, t, i, n) {
  19748. var o = n || 0
  19749. , s = this.playerControls.cameras[a.PANORAMA]
  19750. , l = new r.Euler(0,0,0,c.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, c.warp.eOrder)
  19751. , u = (new r.Euler).setFromQuaternion(s.quaternion, c.warp.eOrder)
  19752. , f = new r.Euler(l.x - u.x,l.y - u.y,l.z - u.z,c.warp.eOrder);
  19753. f.y = h.constrainedTurn(f.y);
  19754. var g = Math.min(r.Math.degToRad(c.warp.softBendTilt), Math.abs(f.x));
  19755. f.x = g * Math.sign(f.x),
  19756. g = Math.min(r.Math.degToRad(Math.max(0, c.warp.softBendAngle)), g),
  19757. this.burnsDir = Math.sign(f.y),
  19758. g *= Math.sign(f.y),
  19759. f.y = g;
  19760. var m = new r.Euler(0,0,0,c.warp.eOrder)
  19761. , v = new r.Vector3
  19762. , A = function(e, t) {
  19763. if (e < .5)
  19764. m.x = u.x + e * f.x,
  19765. m.y = u.y + e * f.y,
  19766. m.z = u.z + e * f.z;
  19767. else {
  19768. var i = (1 - e) * c.warp.softBendEnd;
  19769. m.x = l.x - i * f.x,
  19770. m.y = l.y - i * f.y,
  19771. m.z = l.z - i * f.z
  19772. }
  19773. v.set(0, 0, -1),
  19774. v.applyEuler(m),
  19775. v.add(s.position),
  19776. s.controls.lookAt(v),
  19777. s.controls.lookVector.copy(v),
  19778. s.lookAt(v)
  19779. }
  19780. .bind(this);
  19781. return p.start(A, t, i, o, d[c.warp.movementEasing])
  19782. }
  19783. ,
  19784. n.prototype._warpStepCameraAim = function(e, t, i) {
  19785. var n = this.playerControls.cameras[a.PANORAMA]
  19786. , o = new r.Euler(0,0,0,c.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, c.warp.eOrder)
  19787. , s = (new r.Euler).setFromQuaternion(n.quaternion, c.warp.eOrder)
  19788. , l = new r.Euler(o.x - s.x,o.y - s.y,o.z - s.z,c.warp.eOrder);
  19789. l.y = h.constrainedTurn(l.y),
  19790. this.burnsDir = Math.sign(l.y);
  19791. var u = new r.Euler(0,0,0,c.warp.eOrder)
  19792. , f = new r.Vector3
  19793. , g = function(e, t) {
  19794. e < .5 ? u.copy(s) : u.copy(o),
  19795. f.set(0, 0, -1),
  19796. f.applyEuler(u),
  19797. f.add(n.position),
  19798. n.controls.lookAt(f),
  19799. n.controls.lookVector.copy(f),
  19800. n.lookAt(f)
  19801. }
  19802. .bind(this);
  19803. return p.start(g, t, i, 0, d[c.warp.movementEasing])
  19804. }
  19805. ,
  19806. n.prototype.setBurnsDir = function() {
  19807. var e = this.playerControls.cameras[a.PANORAMA]
  19808. , t = new r.Euler(0,0,0,c.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, c.warp.eOrder)
  19809. , i = (new r.Euler).setFromQuaternion(e.quaternion, c.warp.eOrder)
  19810. , n = new r.Euler(t.x - i.x,t.y - i.y,t.z - i.z,c.warp.eOrder);
  19811. n.y = h.constrainedTurn(n.y),
  19812. this.burnsDir = Math.sign(n.y)
  19813. }
  19814. ,
  19815. n.prototype.stepWarpPath = function(e, t) {
  19816. var i = this.playerControls.cameras[a.PANORAMA];
  19817. if (!this.warpPathPoints)
  19818. return i.position.copy(this.warpDestPano.position),
  19819. !0;
  19820. var n = this.warpPathPoints[0]
  19821. , o = this.warpDestPano.position;
  19822. if (null !== this.nodes && this.cameraHull.length > 1) {
  19823. var s = new r.Vector3;
  19824. 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),
  19825. i.position.copy(s)
  19826. } else
  19827. e < .5 ? i.position.copy(n) : i.position.copy(o)
  19828. }
  19829. ,
  19830. n.prototype.interruptAndFastForward = function(e, t) {
  19831. this.warping && (this.warpInterrupted = !0,
  19832. this.warpInterruptionBlackoutStyle = e,
  19833. this.warpInterruptionTravelTime = t,
  19834. null !== this.warpInterruptionBlackoutStyle && void 0 !== this.warpInterruptionBlackoutStyle || (this.warpInterruptionBlackoutStyle = I.MIDDLE),
  19835. null !== this.warpInterruptionTravelTime && void 0 !== this.warpInterruptionTravelTime || (this.warpInterruptionTravelTime = c.minWarpTime))
  19836. }
  19837. ,
  19838. n.prototype.warpCameraAim = function(e) {
  19839. var t = c.warp.minWarpTime;
  19840. if (this.upcomingTransType === l.BLACK)
  19841. t = c.warp.teleportTime;
  19842. else {
  19843. var i = this.playerControls.cameras[a.PANORAMA]
  19844. , n = new r.Euler(0,0,0,c.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, c.warp.eOrder)
  19845. , o = (new r.Euler).setFromQuaternion(i.quaternion, c.warp.eOrder)
  19846. , s = new r.Euler(n.x - o.x,n.y - o.y,n.z - o.z,c.warp.eOrder);
  19847. s.y = h.constrainedTurn(s.y);
  19848. var u = 1e3 * Math.abs(s.y) / r.Math.degToRad(c.warp.maxAimPerSec);
  19849. t = Math.max(t, u)
  19850. }
  19851. var d = function() {
  19852. this._warpStopFlying(),
  19853. this.discardSlow(),
  19854. e && e()
  19855. }
  19856. .bind(this);
  19857. this._warpCameraAim(t, d)
  19858. }
  19859. ,
  19860. n.prototype.warpCommonParameters = function(e, t, i, n) {
  19861. this.model.skybox.material.uniforms.blackout.value = n;
  19862. var r = u.uniform(this.model.skybox, "progress", 1)
  19863. , o = u.allUniforms(this.model.chunks, "progress", 1)
  19864. , a = !1
  19865. , s = function() {
  19866. if (this.warpInterrupted)
  19867. return a = !0,
  19868. !0
  19869. }
  19870. .bind(this)
  19871. , l = function(e, t) {
  19872. return i && a ? (this.model.skybox.material.uniforms.progress.value = 0,
  19873. !0) : void r(e, t)
  19874. }
  19875. .bind(this)
  19876. , h = function(e, t) {
  19877. return i && a ? (o(0),
  19878. !0) : void o(e, t)
  19879. }
  19880. .bind(this);
  19881. p.start(s, e, null, t, null, "safeHaltWatch"),
  19882. p.start(l, e, null, t, d[c.warp.blendEasing], "skyboxProgress"),
  19883. p.start(h, e, null, t, d[c.warp.blendEasing], "chunkProgress")
  19884. }
  19885. ,
  19886. n.prototype.warpTravel_STD = function(e) {
  19887. 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),
  19888. 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;
  19889. w += this.warpLength * c.warp.timePerMeter,
  19890. c.warp.flySpeed > .01 && (w = 1e3 * this.warpLength / c.warp.flySpeed);
  19891. var _ = !1
  19892. , T = this.warpDestHeroLoc.quaternion
  19893. , x = new r.Vector3(0,0,-1).applyQuaternion(T).normalize()
  19894. , S = this.warpPathPoints[this.warpPathPoints.length - 1].clone().sub(this.warpPathPoints[this.warpPathPoints.length - 2]).normalize()
  19895. , M = S.dot(x)
  19896. , R = r.Math.radToDeg(Math.acos(M))
  19897. , P = function(e) {
  19898. var t = o
  19899. , i = r.Math.smoothstep(e, 0, t) * (1 - r.Math.smoothstep(e, 1 - t, 1));
  19900. return i
  19901. }
  19902. , O = function() {
  19903. return E.lookAt(C, t, A.UP),
  19904. s.setFromRotationMatrix(E, c.warp.eOrder),
  19905. m.setFromQuaternion(n.quaternion, c.warp.eOrder),
  19906. b.set(s.x - m.x, s.y - m.y, s.z - m.z, c.warp.eOrder),
  19907. h.constrainedTurn(b.y)
  19908. }
  19909. .bind(this)
  19910. , L = function(e, t) {
  19911. if (this.warpInterrupted)
  19912. return _ = !0,
  19913. !0
  19914. }
  19915. .bind(this)
  19916. , D = function(e, t) {
  19917. return _ || !this.warpPathPoints ? (g.blur(0),
  19918. !0) : void g.blur(e)
  19919. }
  19920. .bind(this)
  19921. , N = u.allUniforms(this.model.chunks, "modelAlpha", 1)
  19922. , B = function(e, t) {
  19923. return _ || !this.warpPathPoints ? (N(0),
  19924. !0) : void N(e, t)
  19925. }
  19926. .bind(this)
  19927. , F = function(e, t) {
  19928. if (!this.warpPathPoints)
  19929. return n.position.copy(this.warpDestPano.position),
  19930. !0;
  19931. if (_)
  19932. return !0;
  19933. var i = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, e);
  19934. n.position.copy(i),
  19935. C = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, .99 * e)
  19936. }
  19937. .bind(this)
  19938. , V = function(e, n) {
  19939. return this.warpPathPoints ? !!_ || void (t = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, Math.min(e + i, 1))) : (y.debug("Lost bunny."),
  19940. !0)
  19941. }
  19942. .bind(this)
  19943. , U = function(e, o) {
  19944. if (_)
  19945. return y.debug(">>>> Walkthrough interupted at t=" + e),
  19946. !0;
  19947. if (!this.warpPathPoints)
  19948. return !0;
  19949. var a = this.warpLength * e
  19950. , l = r.Math.smoothstep(a, 0, this.brushPrefs.lookBlendDist)
  19951. , u = r.Math.smoothstep(a, this.warpLength - this.brushPrefs.lookBlendDist, this.warpLength);
  19952. c.warp.matchCam && (l *= 1 - u),
  19953. E.lookAt(C, t, A.UP),
  19954. s.setFromRotationMatrix(E, c.warp.eOrder),
  19955. m.setFromQuaternion(n.quaternion, c.warp.eOrder),
  19956. b.set(s.x - m.x, s.y - m.y, s.z - m.z, c.warp.eOrder),
  19957. b.y = h.constrainedTurn(b.y),
  19958. s.x = m.x + l * b.x,
  19959. s.y = m.y + l * b.y,
  19960. s.z = m.z + l * b.z,
  19961. b.set(s.x - v.x, s.y - v.y, s.z - v.z, c.warp.eOrder),
  19962. b.y = h.constrainedTurn(b.y);
  19963. var d = r.Math.degToRad(c.warp.maxTurnPerSec) * o / 1e3;
  19964. b.y = Math.sign(b.y) * Math.min(d, Math.abs(b.y)),
  19965. v.x = v.x + b.x * c.warp.turnFriction,
  19966. v.y = v.y + b.y * c.warp.turnFriction,
  19967. v.z = v.z + b.z * c.warp.turnFriction,
  19968. v.x = Math.max(r.Math.degToRad(c.warp.minDownAngle), v.x);
  19969. var p = t.clone().sub(C).normalize();
  19970. if (R < c.warp.maxAimRotation && u > 0) {
  19971. var g = 1 - u;
  19972. p.x = p.x * g + u * S.x,
  19973. p.y = p.y * g + u * S.y,
  19974. p.z = p.z * g + u * S.z,
  19975. p.normalize()
  19976. }
  19977. this.bunnyObj.position.copy(n.position).add(p),
  19978. f.set(0, 0, -1).applyEuler(v).normalize(),
  19979. f.multiplyScalar(8),
  19980. f.add(n.position),
  19981. e > 1 - i && c.warp.matchCam || (n.controls.lookAt(f),
  19982. n.controls.lookVector.copy(f),
  19983. n.lookAt(f))
  19984. }
  19985. .bind(this)
  19986. , k = function() {
  19987. _ ? (this.discardSlow(),
  19988. this.upcomingTransType = l.BLACK,
  19989. this.warpTravel_BLACK(-.5, this.warpInterruptionTravelTime, I.BEGINNING, e)) : this._wrapupWarpShading(e)
  19990. }
  19991. .bind(this);
  19992. V(0);
  19993. var H = c.warp.motionLeadTime + 1e3 * Math.abs(O()) / r.Math.degToRad(c.warp.maxTurnPerSec);
  19994. w += H;
  19995. var G = H / w;
  19996. this.warpCommonParameters(w, G, !0, I.NONE),
  19997. p.start(L, w, null, 0, null, "_haltWatcher"),
  19998. c.warp.blur > 0 && (g.blurStrength = c.warp.blur,
  19999. p.start(D, w, null, G, P, "blurring")),
  20000. p.start(B, w, null, G, P, "modelAlpha"),
  20001. p.start(F, w, null, G, d[c.warp.blendEasing], "followPath"),
  20002. p.start(V, w, null, G, d[c.warp.blendEasing], "goBunny"),
  20003. p.start(U, w, k, 0, d[c.warp.blendEasing], "lookAtBunny")
  20004. }
  20005. ,
  20006. n.prototype.warpTravel_BLACK = function(e, t, i, n) {
  20007. var r = e || 0;
  20008. void 0 !== t && null !== t || (t = c.warp.teleportTime),
  20009. this.warpCommonParameters(t, r, !1, i),
  20010. this.model.chunks.forEach(function(e) {
  20011. e.material.uniforms.blackout.value = i
  20012. }),
  20013. this._warpBendAim(null, t, null, r);
  20014. var o = function() {
  20015. this.wrapupWarpShadingOnly(n, i)
  20016. }
  20017. .bind(this);
  20018. p.start(this.stepWarpPath.bind(this), t, o, r, d[c.warp.blendEasing], "stepMotion")
  20019. }
  20020. ,
  20021. n.prototype.flightStepWalk = function(e, t, i) {
  20022. var n = .001
  20023. , o = 1
  20024. , a = 1.2
  20025. , s = new r.Vector3
  20026. , h = new r.Vector3
  20027. , u = function(e, t) {
  20028. var i = Math.min(this.player.position.distanceTo(e.position), c.transition.flytimeMaxDistanceThreshold)
  20029. , r = i * c.transition.flytimeDistanceMultiplier + c.transition.flyTime;
  20030. h.copy(A.FORWARD),
  20031. this.player.getDirection(h),
  20032. s.copy(t).sub(e.position).normalize();
  20033. var l = s.dot(h)
  20034. , u = Math.acos(l)
  20035. , d = u / r;
  20036. return d > n && (r *= d / n,
  20037. u < o && (r *= a)),
  20038. r
  20039. };
  20040. return function(e, t, i) {
  20041. if (this.warpInterrupted)
  20042. i && i();
  20043. else if (this.activeTransType !== l.WALK)
  20044. this._clearWarpShading(),
  20045. this._warpStopFlying(),
  20046. this.player.spider.draw(),
  20047. this.placeCpm(),
  20048. i && i();
  20049. else if (this.player.currentPano !== e) {
  20050. var n = {
  20051. pano: e,
  20052. lookAtPoint: t,
  20053. duration: null,
  20054. maxDistanceOverride: c.warp.walkMaxDist,
  20055. skipWarpingCheck: !1,
  20056. constantMoveSpeed: !0
  20057. };
  20058. n.duration = u.call(this, e, t),
  20059. this.player.nonInterruptingFlyToPano(n, i)
  20060. } else
  20061. i && i()
  20062. }
  20063. }(),
  20064. n.prototype.makeWalkFlightFunc = function(e, t, i) {
  20065. return this.flightStepWalk.bind(this, e, t, i)
  20066. }
  20067. ,
  20068. n.prototype.warpTravel_WALK = function() {
  20069. var e = [];
  20070. return function(t) {
  20071. var i = this.player.model.panos;
  20072. e.length = 0;
  20073. for (var n = null, o = !1, a = 0; a < this.nodes.length; a++) {
  20074. var s = this.nodes[a]
  20075. , l = i.get(s);
  20076. a === this.nodes.length - 1;
  20077. o = n && l.position.distanceTo(n.position) < c.warp.walkMinDist,
  20078. n && o || (e.push(s),
  20079. n = l)
  20080. }
  20081. o && this.nodes.length > 1 && (e[e.length - 1] = this.nodes[this.nodes.length - 1]);
  20082. var h = e.length
  20083. , u = i.get(e[h - 1])
  20084. , d = new Array(h + 1);
  20085. d[d.length - 1] = function() {
  20086. t && t()
  20087. }
  20088. .bind(this);
  20089. for (var p = h - 1, f = d.length - 1; f > 0; f -= 1) {
  20090. var g = e[p];
  20091. u = i.get(g);
  20092. var m = new r.Vector3;
  20093. this.getLookAtForWalkingTourNode(e, p, m),
  20094. d[f - 1] = this.makeWalkFlightFunc(u, m, d[f]),
  20095. p--
  20096. }
  20097. d[0]()
  20098. }
  20099. }(),
  20100. n.prototype.getLookAtForWalkingTourNode = function() {
  20101. var e = new r.Vector3
  20102. , t = new r.Vector3
  20103. , i = new r.Vector3
  20104. , n = new r.Vector3
  20105. , o = new r.Vector3
  20106. , a = .65
  20107. , s = .75
  20108. , l = .2
  20109. , c = .4
  20110. , h = .2
  20111. , u = 3;
  20112. return function(r, d, p) {
  20113. var f = r.length;
  20114. if (d >= f)
  20115. return !1;
  20116. var g = 1
  20117. , m = 1;
  20118. t.set(0, 0, 0),
  20119. o.set(0, 0, 0);
  20120. for (var v = null, A = d; A < d + u && !(A >= f); A++) {
  20121. if (v = this.player.model.panos.get(r[A]),
  20122. this.getOrientationForWalkingTourNode(r, A, i),
  20123. A === d && e.copy(i),
  20124. n.copy(i),
  20125. A > d) {
  20126. var y = n.dot(e) < a;
  20127. g *= y ? l : s,
  20128. m *= y ? h : c
  20129. }
  20130. i.multiplyScalar(g),
  20131. t.add(i),
  20132. o.lerp(v.position, m)
  20133. }
  20134. return t.normalize(),
  20135. p.copy(o),
  20136. p.add(t),
  20137. !0
  20138. }
  20139. }(),
  20140. n.prototype.getOrientationForWalkingTourNode = function(e, t, i) {
  20141. var n = e.length;
  20142. if (t >= n)
  20143. return !1;
  20144. if (t === n - 1)
  20145. i.copy(A.FORWARD).applyQuaternion(this.warpDestHeroLoc.quaternion);
  20146. else {
  20147. var r = this.player.model.panos.get(e[t])
  20148. , o = this.player.model.panos.get(e[t + 1]);
  20149. i.copy(o.position).sub(r.position)
  20150. }
  20151. return i.normalize(),
  20152. !0
  20153. }
  20154. ,
  20155. n.prototype.warpCameraTravel = function(e, t, i, n) {
  20156. if (this.activeTransType = this.upcomingTransType,
  20157. this.lastTransType = this.activeTransType,
  20158. this.upcomingTransType = null,
  20159. !e) {
  20160. var r = function() {
  20161. this._wrapupTravel(n)
  20162. }
  20163. .bind(this)
  20164. , o = {
  20165. pano: this.warpDestPano,
  20166. lookAtPoint: null,
  20167. duration: null,
  20168. maxDistanceOverride: null,
  20169. skipWarpingCheck: !1
  20170. };
  20171. return void this.player.flyToPano(o, r)
  20172. }
  20173. this.activeTransType === l.BLACK ? this.warpTravel_BLACK(null, i, t, n) : this.activeTransType === l.WALK ? this.warpTravel_WALK(function() {
  20174. this._clearWarpShading(),
  20175. this._warpStopFlying(),
  20176. this.player.spider.draw(),
  20177. this.placeCpm(),
  20178. n && n()
  20179. }
  20180. .bind(this)) : this.warpTravel_STD(n)
  20181. }
  20182. ,
  20183. n.prototype.startWarpState = function() {
  20184. this.warping = !0,
  20185. this.warpInterrupted = !1,
  20186. this.warpInterruptionBlackoutStyle = null,
  20187. this.warpInterruptionTravelTime = null
  20188. }
  20189. ,
  20190. n.prototype.endWarpState = function() {
  20191. this.warping = !1
  20192. }
  20193. ,
  20194. n.prototype.warpToPano = function(e, t, i, n) {
  20195. if (this.warping)
  20196. return void y.warn("Cannot warp when already warping");
  20197. if (this.upcomingTransType = e,
  20198. this.activeTransType = null,
  20199. !this.setWarpDestPano())
  20200. return this.upcomingTransType = null,
  20201. void this.warpToNonPano(n);
  20202. if (this.player.mode !== a.PANORAMA)
  20203. return this.upcomingTransType = null,
  20204. this.discardSlow(),
  20205. void this.player.flyToNewMode({
  20206. mode: a.PANORAMA,
  20207. pano: this.warpDestPano,
  20208. duration: c.warp.outsideTime,
  20209. warpDest: this.warpDestHeroLoc,
  20210. callback: n,
  20211. force: !0
  20212. });
  20213. if (!this.warpDestPano)
  20214. return y.warn("no warp destination, callback dropped"),
  20215. void (this.upcomingTransType = null);
  20216. 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)
  20217. , o = this.chooseWarpPath(r);
  20218. if (o && this.upcomingTransType !== l.WALK) {
  20219. var s = function() {
  20220. this.waitingToWarp = !1,
  20221. this.warpToPano(e, t, i, n)
  20222. }
  20223. .bind(this);
  20224. if (this.player.checkAndWaitForPanoLoad(this.warpDestPano, "high", "low", this.player.basePanoSize, s))
  20225. return void (this.waitingToWarp = !0)
  20226. }
  20227. this.player.currentPano || (y.warn("Arrived at a very strange spot!"),
  20228. this.player.currentPano = this.warpDestPano,
  20229. this.placeCpm(),
  20230. this.fadeOutCpm(c.path.fadeOutTime),
  20231. this.player.spider.draw()),
  20232. y.debug("Warping to pano ", this.warpDestPano.position),
  20233. this.upcomingTransType !== l.WALK && this.player.emit(C.PanoChosen, this.player.currentPano, this.warpDestPano),
  20234. this.startWarpState();
  20235. var h = function() {
  20236. this.endWarpState(),
  20237. n && n()
  20238. }
  20239. .bind(this);
  20240. o ? this.warpCameraTravel(r, t, i, h) : this.warpCameraAim(h),
  20241. this.player.smoothZoomToDefault(c.zoom.restoreTime)
  20242. }
  20243. ,
  20244. t.exports = n
  20245. }
  20246. ).call(this, "/js/objects/ShowPath.js")
  20247. }
  20248. , {
  20249. "../constants": 8,
  20250. "../effects": 16,
  20251. "../enum/BlackoutStyle": 18,
  20252. "../enum/ModelManagerEvents": 33,
  20253. "../enum/PlayerEvents": 40,
  20254. "../enum/RenderOrder": 42,
  20255. "../enum/Vectors": 50,
  20256. "../enum/Viewmode": 51,
  20257. "../enum/WarpStyle": 52,
  20258. "../gui/gui": 65,
  20259. "../model/ModelManager": 140,
  20260. "../objects/Snapshot": 153,
  20261. "../settings": 166,
  20262. "../shaders": 167,
  20263. "../util/easing": 186,
  20264. "../util/lerp": 188,
  20265. "../util/logger": 189,
  20266. "../util/math": 190,
  20267. "../util/texture": 194,
  20268. "../util/transitions": 195,
  20269. three: 217
  20270. }],
  20271. 152: [function(e, t, i) {
  20272. "use strict";
  20273. function n() {
  20274. var e = new r.SphereBufferGeometry(a.skyboxRadius,20,5)
  20275. , t = new r.RawShaderMaterial({
  20276. fragmentShader: o.skysphere.fragmentShader,
  20277. vertexShader: o.skysphere.vertexShader,
  20278. uniforms: r.UniformsUtils.clone(o.skysphere.uniforms),
  20279. side: r.BackSide,
  20280. name: "skysphere"
  20281. });
  20282. t.uniforms.radius.value = e.parameters.radius,
  20283. r.Mesh.call(this, e, t)
  20284. }
  20285. var r = e("three")
  20286. , o = e("../shaders")
  20287. , a = e("../settings");
  20288. n.prototype = Object.create(r.Mesh.prototype),
  20289. n.prototype.constructor = n,
  20290. t.exports = n
  20291. }
  20292. , {
  20293. "../settings": 166,
  20294. "../shaders": 167,
  20295. three: 217
  20296. }],
  20297. 153: [function(e, t, i) {
  20298. (function(i) {
  20299. "use strict";
  20300. function n(e) {
  20301. o.call(this, e),
  20302. this.sid = e.sid,//xzw add
  20303. this.panoId = e.panoId,
  20304. this.orthoZoom = e.orthoZoom,
  20305. this.floorVisibility = e.floorVisibility,
  20306. this.thumbUrl = e.thumbUrl,
  20307. this.name = e.name
  20308. }
  20309. var r = (e("three"),
  20310. e("../util/logger"))
  20311. , o = (e("../settings"),
  20312. e("../enum/Viewmode"),
  20313. e("../util/common"),
  20314. e("../util/transitions"),
  20315. e("../util/lerp"),
  20316. e("../util/ajax"),
  20317. e("../util/texture"),
  20318. e("./View"));
  20319. e("events").EventEmitter,
  20320. new r(i);
  20321. n.prototype = Object.create(o.prototype),
  20322. n.prototype.isPano = function() {
  20323. return this.panoId && "" !== this.panoId
  20324. }
  20325. ,
  20326. t.exports = n
  20327. }
  20328. ).call(this, "/js/objects/Snapshot.js")
  20329. }
  20330. , {
  20331. "../enum/Viewmode": 51,
  20332. "../settings": 166,
  20333. "../util/ajax": 181,
  20334. "../util/common": 185,
  20335. "../util/lerp": 188,
  20336. "../util/logger": 189,
  20337. "../util/texture": 194,
  20338. "../util/transitions": 195,
  20339. "./View": 154,
  20340. events: 202,
  20341. three: 217
  20342. }],
  20343. 154: [function(e, t, i) {
  20344. (function(i) {
  20345. "use strict";
  20346. function n(e) {
  20347. e = e || {},
  20348. this.position = new r.Vector3,
  20349. this.quaternion = new r.Quaternion,
  20350. this.update(e)
  20351. }
  20352. var r = e("three")
  20353. , o = e("../util/logger")
  20354. , a = (e("../settings"),
  20355. e("../enum/Viewmode"),
  20356. e("../util/common"),
  20357. e("../util/transitions"),
  20358. e("../util/lerp"),
  20359. e("../util/ajax"),
  20360. e("../util/texture"),
  20361. e("events").EventEmitter);
  20362. new o(i);
  20363. n.prototype = Object.create(a.prototype),
  20364. n.prototype.isValid = function() {
  20365. return !!this.cameraMode
  20366. }
  20367. ,
  20368. n.prototype.update = function(e) {
  20369. return this.cameraMode = e.cameraMode || this.cameraMode,
  20370. this.pano = e.pano || this.pano,
  20371. e.position && this.position.copy(e.position),
  20372. e.quaternion && this.quaternion.copy(e.quaternion),
  20373. this
  20374. }
  20375. ,
  20376. t.exports = n
  20377. }
  20378. ).call(this, "/js/objects/View.js")
  20379. }
  20380. , {
  20381. "../enum/Viewmode": 51,
  20382. "../settings": 166,
  20383. "../util/ajax": 181,
  20384. "../util/common": 185,
  20385. "../util/lerp": 188,
  20386. "../util/logger": 189,
  20387. "../util/texture": 194,
  20388. "../util/transitions": 195,
  20389. events: 202,
  20390. three: 217
  20391. }],
  20392. 155: [function(e, t, i) {//player.js
  20393. (function(i) {
  20394. "use strict";
  20395. function n(e) {
  20396. this.currentPano = null,
  20397. this.nextPano = null,
  20398. this.camera = null,
  20399. this.paused = !1,
  20400. this.flying = !1,
  20401. this.sceneIntersectionPlane = null,
  20402. this.target = new r.Vector3,
  20403. this.mouse = new r.Vector3(1.1,1.1,.5),
  20404. this.mouseAtMouseDown = new r.Vector2,
  20405. this.mouseCouldBeClickToMove = !1,
  20406. this.mouseLastMoveTime = Date.now(),
  20407. this.mouseDown = !1,
  20408. this.mouseDownTimer = null,
  20409. this.couldBeLongTap = !1,
  20410. this.containsMouse = !0,
  20411. this.isTouchEvent = !1,
  20412. this.isPanoHover = !1,
  20413. this.reticule = new a(this),
  20414. this.panoMarkers = [],
  20415. this.spider = new h(this),
  20416. this.quaternion = new r.Quaternion,
  20417. this.position = new r.Vector3(15,10,15),
  20418. this.previousState = null,
  20419. this.lastInsideView = new c,
  20420. this.last360View = new c,
  20421. this.raycaster = new r.Raycaster,
  20422. this.intersect = null,
  20423. this.lastChangeTime = Date.now(),
  20424. this.history = new I,
  20425. this.cameraControls = null,
  20426. this.path = null,
  20427. this.model = null,
  20428. this.domElement = null,
  20429. this.cachedPanoCandidates = null,
  20430. this.basePanoSize = 0,
  20431. this.standardPanoSize = 0,
  20432. this.highPanoSize = 0,
  20433. this.ultraHighPanoSize = 0,
  20434. this.zoomLevel = 1,
  20435. this.zooming = 0,
  20436. this.zoomSpeed = .5,
  20437. this.scrollZoomSpeed = .06,
  20438. this.zoomSpeedAdjust = .05,
  20439. this.defaultZoomIncrement = .2,
  20440. this.baseFov = f.insideFOV,
  20441. this.zoomFov = this.baseFov,
  20442. this.zoomEnabled = !0,
  20443. this.preRenderingEnabled = !1,
  20444. this.setupCustomProperties(e),
  20445. this.zoomStats = new L
  20446. }
  20447. var r = e("three")
  20448. , o = e("./util/logger")
  20449. , a = e("./objects/Reticule")
  20450. , s = e("./objects/Panorama")
  20451. , l = e("./objects/ShowPath")
  20452. , c = e("./objects/View")
  20453. , h = (e("./objects/Snapshot"),
  20454. e("./objects/NSpider"))
  20455. , u = e("./enum/Viewmode")
  20456. , d = (e("./enum/TagStates"),
  20457. e("./enum/Vectors"))
  20458. , p = e("./enum/Keys")
  20459. , f = (e("./enum/AlignmentType"),
  20460. e("./settings"))
  20461. , g = e("./util/common")
  20462. , m = (e("./util/browser"),
  20463. e("./util/math"))
  20464. , v = e("./util/lerp")
  20465. , A = e("./util/easing")
  20466. , y = e("./util/transitions")
  20467. , C = e("events").EventEmitter
  20468. , I = (e("./shaders"),
  20469. e("./util/history"))
  20470. , E = (e("./util/camera"),
  20471. e("./model/ModelManager"),
  20472. e("./enum/PathDiscardMode"))
  20473. , b = e("./enum/PathDisplayMode")
  20474. , w = e("./enum/PlayerEvents")
  20475. , _ = e("./enum/ControlEvents")
  20476. , T = e("./enum/ModelManagerEvents")
  20477. , x = e("./enum/WarpStyle")
  20478. , S = e("./enum/BlackoutStyle")
  20479. , M = e("./exception/BasicException")
  20480. , R = e("./enum/PanoSizeClass")
  20481. , P = (e("./tile/TileDownloader"),
  20482. e("./tile/TilePrioritizer"))
  20483. , O = (e("./enum/PanoramaEvents"),
  20484. e("./enum/ZoomEvents"))
  20485. , L = e("./util/ZoomStats")
  20486. , D = e("./constants")
  20487. , N = e("./util/common")
  20488. , B = e("./util/cameraLight")
  20489. , Hot = e('hot')
  20490. , F = new o(i)
  20491. , V = Object.freeze({
  20492. FlyToPano: y.getUniqueId(),
  20493. FlyToNewMode: y.getUniqueId(),
  20494. FlyToSameMode: y.getUniqueId(),
  20495. FlyToViewFloor: y.getUniqueId(),
  20496. LookTransition: y.getUniqueId(),
  20497. ZoomTransition: y.getUniqueId()
  20498. });
  20499. n.prototype = Object.create(C.prototype),
  20500. n.prototype.init = function(e) {
  20501. this.modelManager = e.modelManager,
  20502. this.tileDownloader = e.tileDownloader,
  20503. this.panoRenderer = e.panoRenderer,
  20504. this.qualityManager = e.qualityManager,
  20505. this.domElement = e.container,
  20506. this.camera = e.camera,
  20507. this.tagManager = e.tagManager,
  20508. this.cameraControls = e.controls,
  20509. this.path = new l(e.director,this,e.controls),
  20510. this.basePanoSize = this.qualityManager.getPanoSize(R.BASE),
  20511. this.standardPanoSize = this.qualityManager.getPanoSize(R.STANDARD),
  20512. this.highPanoSize = this.qualityManager.getPanoSize(R.HIGH),
  20513. this.ultraHighPanoSize = this.qualityManager.getPanoSize(R.ULTRAHIGH),
  20514. this.tileDownloader.processPriorityQueue = !1,
  20515. this.tileDownloader.tilePrioritizer = new P(this.qualityManager,this.basePanoSize,this.standardPanoSize,this.highPanoSize,this.ultraHighPanoSize),
  20516. this.bindEvents(e.container),
  20517. this.updateModel()
  20518. }
  20519. //xzw add: 截图
  20520. function dataURLtoBlob(dataurl) {
  20521. var arr = dataurl.split(','), mime = arr[0].match(/:(.*?);/)[1],
  20522. bstr = atob(arr[1]), n = bstr.length, u8arr = new Uint8Array(n);
  20523. while(n--){
  20524. u8arr[n] = bstr.charCodeAt(n);
  20525. };
  20526. return new Blob([u8arr], {type:mime});
  20527. }
  20528. n.prototype.screenShot = function(o){
  20529. if(this.flying || this.flyingToTag) return;
  20530. var R = this.sceneRenderer;
  20531. R.updateScreenSize(o);
  20532. for(var i in this.model.panos.index){
  20533. this.model.panos.index[i].marker.forceHide = this.model.panos.index[i].marker.visible;
  20534. this.model.panos.index[i].marker.visible = false;
  20535. }
  20536. for(var i in this.model.hots){
  20537. this.model.hots[i].mesh.visible = false;
  20538. }
  20539. this.reticule.visible = false;
  20540. this.reticule.forceUnvisible = true;
  20541. this.path.currentPanoMarker.mesh.visible = false;
  20542. setTimeout(function(){//因resize效用没办法立即生效(原因未知),故而延后
  20543. R.renderer.clear(true,true,true);
  20544. R.renderer.render(R.scene, R.camera);
  20545. var imgData = R.renderer.domElement.toDataURL(o.type,0.9);
  20546. o.f && o.f(imgData)
  20547. R.updateScreenSize({resize:true});
  20548. this.reticule.visible = true;
  20549. for(var i in this.model.hots){
  20550. this.model.hots[i].mesh.visible = true;
  20551. }
  20552. for(var i in this.model.panos.index){
  20553. this.model.panos.index[i].marker.visible = this.model.panos.index[i].marker.forceHide;
  20554. }
  20555. this.path.currentPanoMarker.mesh.visible = true;
  20556. R.renderer.render(R.scene, R.camera);
  20557. }.bind(this),30) //这个数字不能太小
  20558. }
  20559. var scaleImg = e("scaleImg");
  20560. var ResizeImg = function(img, option){
  20561. var img2; //不能直接改img 否则可能触发第二次img.onload
  20562. var compress = function(ratio,type){
  20563. var image = img2 || img;
  20564. var c = document.createElement('canvas');
  20565. c.width = image.width; c.height = image.height;
  20566. var ctx = c.getContext('2d');
  20567. ctx.drawImage(image,0,0,image.width,image.height);
  20568. img2 = scaleImg(ratio/* option.maxSize/oldSize */, c, type/* option.type||"png" */);//最大不能超过0.8M
  20569. }
  20570. var reCom = function(){ //如果有了img2 就只需要img2 否则创造新的img2
  20571. var image = img2 || img;
  20572. var blob = dataURLtoBlob(image.src);
  20573. if(option.maxWeight && blob.size > option.maxWeight){
  20574. compress(option.maxWeight/blob.size, "jpeg")
  20575. blob = dataURLtoBlob(image.src);
  20576. }
  20577. if(!img2){
  20578. img2 = new Image();
  20579. }
  20580. img2.base64Src = image.src;
  20581. img2.src = window.URL.createObjectURL(blob);
  20582. }
  20583. var oldSize = Math.max(img.width, img.height);
  20584. if(option.toType != "png"){//不是非要png的话
  20585. if(option.oldType == "jpeg"){//jpeg先判断尺寸,然后是尺寸
  20586. if(oldSize > option.maxSize){
  20587. compress(option.maxSize/oldSize, "jpeg");
  20588. }
  20589. reCom();
  20590. }else if(option.oldType == "png"){//png先判断数据量 如果数据量达标,就无视大小(有可能超出大小)
  20591. if(option.maxWeight && option.weight > option.maxWeight){//如果一开始大小不大就不压缩 还是png
  20592. compress(oldSize>option.maxSize ? option.maxSize/oldSize : 1, "jpeg");
  20593. reCom();
  20594. }
  20595. }
  20596. }else{
  20597. //?貌似png会越压缩越大?
  20598. }
  20599. return img2 || img;
  20600. }
  20601. var _fixType=function(type) {
  20602. type = type.toLowerCase().replace(/jpg/i, 'jpeg');
  20603. var r = type.match(/png|jpeg|bmp|gif/)[0];
  20604. return 'image/' + r;
  20605. };
  20606. var saveFile=function(data, filename){
  20607. var save_link = document.createElementNS('http://www.w3.org/1999/xhtml', 'a');
  20608. save_link.href = data;
  20609. save_link.download = filename;
  20610. var event = document.createEvent('MouseEvents');
  20611. event.initMouseEvent('click', true, false, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
  20612. save_link.dispatchEvent(event);
  20613. };
  20614. n.prototype.getWrapShot = function(){ //获取导览点截图和信息
  20615. var info = this.getSnapAngleInfo();
  20616. var str = ',{\r\t' + info;
  20617. var arg = arguments[0];
  20618. this.screenShot({ width:g_snapShotWidth*4, height:g_snapShotHeight*4, type:"image/jpeg", f:function(imgData){
  20619. if (arg && arg.__callback) {
  20620. return arg.__callback(imgData, info)
  20621. }
  20622. var img = new Image();
  20623. img.src = imgData;
  20624. img.onload = function(){
  20625. var img2 = ResizeImg(this,{maxSize: g_snapShotWidth, oldType:"jpeg"}); //暂定缩略图大小
  20626. img2.src.replace(_fixType("image/jpeg"),'image/octet-stream');
  20627. var filename = "snap" + (new Date()).getTime();
  20628. saveFile(img2.src,filename + ".jpg");
  20629. str +=(',\r\t"thumbnail_signed_src":"'+filename+'.jpg",');
  20630. str +=('\r\t"sid":"'+filename+'",');
  20631. str +=('\r\t"name":"'+filename+'"\r}');
  20632. logData(str)
  20633. }
  20634. }});
  20635. }
  20636. ,
  20637. n.prototype.getSnapAngleInfo = function(){
  20638. var info = {};
  20639. var str = '"metadata":{';
  20640. var q = this.camera.quaternion.clone();
  20641. switch (this.mode) {
  20642. case "panorama":
  20643. info.scan_id = this.currentPano.id;
  20644. str += ('"scan_id":"'+this.currentPano.id+'",');
  20645. break;
  20646. case "floorplan":
  20647. info.camera_mode = 1;
  20648. q = (new r.Quaternion).setFromAxisAngle(new r.Vector3(0,1,0), r.Math.degToRad(90))
  20649. q.multiply(this.camera.quaternion);
  20650. str += ('"camera_mode":1,');
  20651. //str += ('"ortho_zoom":'+m.toPrecision(this.cameraControls.activeControl.currentScale * $("#player").height() / $("#player").width() * D.workshopApsect * 16, 4)+",");
  20652. str += ('"ortho_zoom":'+ m.toPrecision(this.cameraControls.activeControl.currentScale, 4 )+",");
  20653. break;
  20654. case "dollhouse":
  20655. info.camera_mode = 2;
  20656. str += ('"camera_mode":2,');
  20657. break;
  20658. }
  20659. info.camera_position = m.toPrecision(this.camera.position.toArray(),4);
  20660. info.camera_quaternion = m.toPrecision(q.toArray(),4);
  20661. str += ( '"camera_position":['+ info.camera_position + '],"camera_quaternion":['+info.camera_quaternion+"]}");
  20662. return str;
  20663. }
  20664. //------end
  20665. n.prototype.closePopup = function() {//xzw 关闭热点页面
  20666. if(!g_currentHot) return;
  20667. g_currentHot = null;
  20668. var hotPop = document.getElementById('popup');
  20669. hotPop.style.display = "none";
  20670. document.querySelector(".popup-content").removeChild(document.getElementById("id1"));
  20671. $("#popup iframe:last").remove();
  20672. var _bgaudio = document.getElementById("bgaudio");
  20673. //判断音乐是否暂停或者是否存在
  20674. if(g_bgAudio && g_bgAudio.paused && g_bgAudio.readyState != 0)
  20675. {
  20676. g_bgAudio.play();
  20677. };
  20678. //$('#player').off("click",this.closePopup);
  20679. return false
  20680. }
  20681. n.prototype.setupCustomProperties = function(e) {
  20682. var t = e || u.PANORAMA;
  20683. Object.defineProperty(this, "mode", {
  20684. get: function() {
  20685. return t
  20686. },
  20687. set: function(e) {
  20688. var i = t;
  20689. t = e,
  20690. this.onModeUpdated(i, t)
  20691. }
  20692. })
  20693. }
  20694. ,
  20695. n.prototype.isInMode = function() {
  20696. for (var e = 0; e < arguments.length; e++)
  20697. if (this.mode === arguments[e])
  20698. return !0;
  20699. return !1
  20700. }
  20701. ,
  20702. n.prototype.isOutsideMode = function(e) {
  20703. return e = e || this.mode,
  20704. e === u.DOLLHOUSE || e === u.FLOORPLAN
  20705. }
  20706. ,
  20707. n.prototype.is360View = function(e, t) {
  20708. return e === u.PANORAMA && t && !t.isAligned()
  20709. }
  20710. ,
  20711. n.prototype.setScene = function(e) {
  20712. this.sceneIntersectionPlane = e.plane,
  20713. this.path.setScene(e),
  20714. this.moveReticuleToScene(e)
  20715. }
  20716. ,
  20717. n.prototype.moveReticuleToScene = function(e) {
  20718. this.reticule.parent && this.reticule.parent.remove(this.reticule),
  20719. e.add(this.reticule)
  20720. }
  20721. ,
  20722. n.prototype.updateModel = function() {
  20723. function e(e, t, n) {
  20724. this.mode === u.DOLLHOUSE && e !== n && i.call(this, e.center.y)
  20725. }
  20726. function t(e, t) {
  20727. if (this.mode === u.DOLLHOUSE) {
  20728. var n = e ? this.model.center.y : n = t.center.y;
  20729. i.call(this, n)
  20730. }
  20731. }
  20732. function i(e) {
  20733. var t = this.cameraControls.cameras[u.DOLLHOUSE]
  20734. , i = this.cameraControls.controls[u.DOLLHOUSE]
  20735. , n = t.position.y + (e - i.target.y)
  20736. , r = f.showFloorDuration + f.showFloorDelay;
  20737. y.start(v.property(i.target, "y", e), r, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToViewFloor),
  20738. y.start(v.property(t.position, "y", n), r, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToViewFloor)
  20739. }
  20740. this.model = this.modelManager.getActiveModel(),
  20741. this.model.on("floor.changed", e.bind(this)),
  20742. this.model.on("allfloors.toggled", t.bind(this)),
  20743. this.on(w.PanoChosen, this.model.setProjectedPanos.bind(this.model))
  20744. }
  20745. ,
  20746. n.prototype.updateModelDependentData = function() {
  20747. this.cameraControls.setModelForControls(this.model),
  20748. this.getPanoMarkersFromModel(this.model)
  20749. }
  20750. ,
  20751. n.prototype.onModelChanged = function() {
  20752. this.updateModel(),
  20753. this.updateModelDependentData()
  20754. }
  20755. ,
  20756. n.prototype.getPanoMarkersFromModel = function(e) {
  20757. this.panoMarkers = e.panos.list.reduce(function(e, t) {
  20758. return t.marker ? e.concat(t.marker) : e
  20759. }, [])
  20760. }
  20761. ,
  20762. n.prototype.handleControlMove = function(e) {
  20763. this.emit(w.Move, e)
  20764. }
  20765. ,
  20766. n.prototype.handleControlInputStart = function(e) {
  20767. this.emit(w.InputStart, e)
  20768. }
  20769. ,
  20770. n.prototype.onModeUpdated = function(e, t) {
  20771. this.cameraControls.activateControls(t),
  20772. this.emit(w.ModeChanged, e, t)
  20773. }
  20774. ,
  20775. n.prototype.isWarping = function() {
  20776. return this.path.warping
  20777. }
  20778. ,
  20779. n.prototype.isWaitingToWarp = function() {
  20780. return this.path.waitingToWarp
  20781. }
  20782. ,
  20783. n.prototype.getLabelScaleFactor = function() {
  20784. if (this.isOutsideMode()) {
  20785. var e = 10
  20786. , t = Math.sqrt(this.cameraControls.controls[u.FLOORPLAN].currentScale / e);
  20787. return t
  20788. }
  20789. return .5
  20790. }
  20791. ,
  20792. n.prototype.changeMusic = function() {//xzw add
  20793. if(!this.director.tourIsPlaying && g_play && g_bgAudio){
  20794. g_playAudio = g_bgAudio;
  20795. g_bgAudio.play();
  20796. }else{
  20797. if(!g_play){
  20798. g_playAudio = g_bgAudio;
  20799. }else{//防止再次播放时重播一遍
  20800. g_playAudio = null;
  20801. }
  20802. }
  20803. }
  20804. ,
  20805. n.prototype.bindEvents = function(e) {
  20806. e !== document && e.setAttribute("tabindex", -1),
  20807. e.addEventListener("mousedown", this.onMouseDown.bind(this)),
  20808. e.addEventListener("mousemove", this.onMouseMove.bind(this)),
  20809. e.addEventListener("mouseover", this.onMouseOver.bind(this)),
  20810. e.addEventListener("mouseout", this.onMouseOut.bind(this)),
  20811. e.addEventListener("mouseup", this.onMouseUp.bind(this)),
  20812. this.modelManager.on(T.ActiveModelChanged, this.onModelChanged.bind(this)),
  20813. e.addEventListener("touchstart", this.onTouchStart.bind(this)),
  20814. e.addEventListener("touchmove", this.onTouchMove.bind(this)),
  20815. e.addEventListener("touchend", this.onTouchEnd.bind(this)),
  20816. e.addEventListener("pointerdown", this.onPointerDown.bind(this)),
  20817. e.addEventListener("pointermove", this.onPointerMove.bind(this)),
  20818. e.addEventListener("pointerup", this.onPointerUp.bind(this)),
  20819. e.addEventListener("pointerout", this.onPointerOut.bind(this)),
  20820. e.addEventListener("pointercancel", this.onPointerCancel.bind(this)),
  20821. document.addEventListener("keydown", this.onKeyDown.bind(this)),
  20822. this.cameraControls.on(_.Move, this.handleControlMove.bind(this)),
  20823. this.cameraControls.on(_.InputStart, this.handleControlInputStart.bind(this)),
  20824. this.cameraControls.on(_.Pinch, this.handleControlPinch.bind(this)),
  20825. this.cameraControls.on(_.Scroll, this.handleControlScroll.bind(this)),
  20826. window.addEventListener("snapshotBegin", this.getWrapShot.bind(this)),//xzw add
  20827. window.addEventListener("tourAudioEnded", this.changeMusic.bind(this));//xzw add
  20828. // lzb
  20829. window.getSeft && getSeft(this);
  20830. //判断是否是移动端,如果是给关闭按钮添加touchstart事件
  20831. if(/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)){
  20832. $('#closepop').on("touchstart",this.closePopup.bind(this));
  20833. }else{
  20834. $('#closepop').on("click",this.closePopup.bind(this));
  20835. }
  20836. }
  20837. ,
  20838. n.prototype.onMouseDown = function(e) {
  20839. e.currentTarget !== document && e.currentTarget.focus(),
  20840. 0 === e.button && (this.handleInputStart.call(this, e.clientX, e.clientY, !1),
  20841. this.updateIntersect())
  20842. }
  20843. ,
  20844. n.prototype.onMouseMove = function(e) {
  20845. this.isTouchEvent = !1,
  20846. this.handleInputMove.call(this, e.clientX, e.clientY, !1)
  20847. }
  20848. ,
  20849. n.prototype.onMouseOver = function(e) {
  20850. this.containsMouse = !0,
  20851. !this.mouseDown || 0 !== e.which && 0 !== e.buttons || (this.mouseDown = !1)
  20852. }
  20853. ,
  20854. n.prototype.onMouseOut = function(e) {
  20855. this.containsMouse = !1
  20856. }
  20857. ,
  20858. n.prototype.onMouseUp = function(e) {
  20859. this.handleInputEnd.call(this, e.clientX, e.clientY, !1);
  20860. }
  20861. ,
  20862. n.prototype.onTouchStart = function(e) {
  20863. if (e.currentTarget !== document && e.currentTarget.focus(),
  20864. !this.mouseDown) {
  20865. this.couldBeLongTap = !0;
  20866. var t = g.average(e.changedTouches, "clientX")
  20867. , i = g.average(e.changedTouches, "clientY");
  20868. this.handleInputStart.call(this, t, i, !0),
  20869. this.mouseDownTimer = setTimeout(function() {
  20870. this.updateIntersect(),
  20871. this.handleInputEnd.call(this, t, i, !0)
  20872. }
  20873. .bind(this), f.input.longTapThreshold)
  20874. }
  20875. }
  20876. ,
  20877. n.prototype.onTouchMove = function(e) {
  20878. var t = g.average(e.changedTouches, "clientX")
  20879. , i = g.average(e.changedTouches, "clientY");
  20880. this.handleInputMove.call(this, t, i, !0)
  20881. }
  20882. ,
  20883. n.prototype.onTouchEnd = function(e) {
  20884. if (clearTimeout(this.mouseDownTimer),
  20885. this.mouseDown) {
  20886. this.couldBeLongTap = !1,
  20887. this.updateIntersect();
  20888. var t = g.average(e.changedTouches, "clientX")
  20889. , i = g.average(e.changedTouches, "clientY");
  20890. this.handleInputEnd.call(this, t, i, !0)
  20891. }
  20892. }
  20893. ,
  20894. n.prototype.onPointerDown = function(e) {
  20895. return e.currentTarget !== document && e.currentTarget.focus(),
  20896. this.mouseDown || "mouse" === e.pointerType ? this.onMouseDown(e) : (this.couldBeLongTap = !0,
  20897. this.handleInputStart.call(this, e.clientX, e.clientY, !0),
  20898. void (this.mouseDownTimer = setTimeout(function() {
  20899. this.updateIntersect(),
  20900. this.handleInputEnd.call(this, e.clientX, e.clientY, !0)
  20901. }
  20902. .bind(this), f.input.longTapThreshold)))
  20903. }
  20904. ,
  20905. n.prototype.onPointerMove = function(e) {
  20906. "mouse" !== e.pointerType ? this.handleInputMove.call(this, e.clientX, e.clientY, !0) : this.onMouseMove(e)
  20907. }
  20908. ,
  20909. n.prototype.onPointerUp = function(e) {
  20910. return this.mouseDown && "mouse" !== e.pointerType ? (clearTimeout(this.mouseDownTimer),
  20911. this.couldBeLongTap = !1,
  20912. this.updateIntersect(),
  20913. void this.handleInputEnd.call(this, e.clientX, e.clientY, !0)) : this.onMouseUp(e)
  20914. }
  20915. ,
  20916. n.prototype.onPointerOut = function(e) {
  20917. this.mouseDown = !1
  20918. }
  20919. ,
  20920. n.prototype.onPointerCancel = function(e) {
  20921. this.mouseDown = !1
  20922. }
  20923. ,
  20924. n.prototype.onKeyDown = function(e) {
  20925. var t = function() {
  20926. this.cameraControls.activeControl && this.cameraControls.activeControl.emit(_.Move, "key")
  20927. }
  20928. .bind(this)
  20929. , i = e.which;
  20930. switch (i) {
  20931. case p.F:
  20932. t(),
  20933. this.changeFloor(-1);
  20934. break;
  20935. case p.R:
  20936. t(),
  20937. this.changeFloor(1)
  20938. }
  20939. if (this.mode === u.PANORAMA)
  20940. switch (i) {
  20941. case p.UPARROW:
  20942. case p.W:
  20943. this.flyLocalDirection(d.FORWARD.clone());
  20944. break;
  20945. case p.DOWNARROW:
  20946. case p.S:
  20947. this.flyLocalDirection(d.BACK.clone());
  20948. break;
  20949. case p.A:
  20950. this.flyLocalDirection(d.LEFT.clone());
  20951. break;
  20952. case p.D:
  20953. this.flyLocalDirection(d.RIGHT.clone())
  20954. }
  20955. }
  20956. ,
  20957. n.prototype.handleScrollPinchZoom = function() {
  20958. return function(e) {
  20959. var t = e
  20960. , i = this.zoomLevel;
  20961. this.zoomBy(t),
  20962. this.currentPano && this.zoomStats.addZoomAction(i, this.zoomLevel, this.currentPano.id)
  20963. }
  20964. }(),
  20965. n.prototype.handleControlPinch = function(e) {
  20966. f.zoom.enabled ? this.handleScrollPinchZoom(1 - e) : this.flyLocalDirection(new r.Vector3(0,0,e).normalize())
  20967. }
  20968. ,
  20969. n.prototype.handleControlScroll = function(e) {
  20970. f.zoom.enabled ? (e > 0 ? e = 1 + this.scrollZoomSpeed : e < 0 && (e = 1 - this.scrollZoomSpeed),
  20971. 0 !== e && this.handleScrollPinchZoom(e)) : this.flyLocalDirection(new r.Vector3(0,0,-e).normalize())
  20972. }
  20973. ,
  20974. n.prototype.handleInputStart = function(e, t, i) {
  20975. //许钟文加
  20976. var pad = this.handelPadding(e, t);
  20977. e = pad.x;
  20978. t = pad.y;
  20979. this.isTouchEvent = i,
  20980. m.convertScreenPositionToNDC(e, t, this.mouse),
  20981. m.convertScreenPositionToNDC(e, t, this.mouseAtMouseDown),
  20982. this.mouseCouldBeClickToMove = !0,
  20983. this.mouseDown = !0;
  20984. if (this.mouseCouldBeClickToMove) {
  20985. //window.DownInterface && new DownInterface().state(this,Hot);
  20986. window.Hotpoint && new Hotpoint().state(this,Hot);
  20987. }
  20988. }
  20989. ,
  20990. n.prototype.handelPadding = function(x, y) {
  20991. //去除player左边和上面的宽高,因为pc的player左上有其他element 许钟文
  20992. if (!this.pad)
  20993. this.pad = {
  20994. x: dom.getOffset("left", $("#player")[0]),
  20995. y: dom.getOffset("top", $("#player")[0])
  20996. }
  20997. return {
  20998. x: x - this.pad.x,
  20999. y: y - this.pad.y
  21000. }
  21001. }
  21002. n.prototype.handleInputMove = function(e, t, i) {
  21003. //许钟文加
  21004. var pad = this.handelPadding(e, t);
  21005. e = pad.x;
  21006. t = pad.y;
  21007. this.isTouchEvent = i,
  21008. m.convertScreenPositionToNDC(e, t, this.mouse),
  21009. this.mouseAtMouseDown.distanceTo(this.mouse) > f.input.moveToleranceNDC && (this.mouseCouldBeClickToMove = !1,
  21010. this.couldBeLongTap = !1,
  21011. clearTimeout(this.mouseDownTimer)),
  21012. this.mouseLastMoveTime = Date.now(),
  21013. this.reticule.move(e, t, i)
  21014. }
  21015. ,
  21016. n.prototype.handleInputEnd = function(e, t, i) {//xzw
  21017. if (this.isTouchEvent = i,
  21018. this.mouseDown = !1,
  21019. this.cameraControls.controls[u.PANORAMA].emit("interaction.direct"),
  21020. !i && this.couldBeLongTap)
  21021. return !0;
  21022. if (this.handleLongTap())
  21023. return !0;
  21024. if (this.mouseCouldBeClickToMove) {
  21025. if (this.flying)
  21026. return this.path.activeTransType === x.WALK && this.emit(w.WarpInterruptedWithFlyTo, this.path.activeTransType),
  21027. !0;
  21028. if(this.checkHotClick())//add
  21029. return !0;
  21030. if (this.cameraControls.activeControl && this.cameraControls.activeControl.emit(_.Move, this.isTouchEvent ? "touch" : "mouse"),
  21031. this.history.invalidate(),
  21032. this.intersect)
  21033. return this.flyToPanoClosestToMouse();
  21034. if (this.mode === u.PANORAMA) {
  21035. var n = this.closestPanoInDirection(this.getMouseDirection());
  21036. return n ? this.flyToPano({
  21037. pano: n
  21038. }) : this.bump(this.getMouseDirection())
  21039. }
  21040. }
  21041. this.intersect && this.closestPano && this.closestPano.hoverOff(this.mode)
  21042. }
  21043. ,
  21044. n.prototype.handleLongTap = function() {
  21045. if (this.couldBeLongTap && (!this.isPanoHover || this.mode !== u.PANORAMA))
  21046. return this.cameraControls.activeControl && this.cameraControls.activeControl.emit(_.LongTap, "touch"),
  21047. !0
  21048. }
  21049. ,
  21050. n.prototype.checktagClick = function() {
  21051. if (this.tagManager.intersectTag) {
  21052. var e = this.isTouchEvent
  21053. , t = this.tagManager.clickedOnTag(e, this);
  21054. return e || t || y.cancelById(V.LookTransition),
  21055. !0
  21056. }
  21057. if (this.tagManager.activeTag)
  21058. return this.tagManager.dismissActiveTag(),
  21059. !1
  21060. }
  21061. ,
  21062. n.prototype.rankedtagInDirection = function(e, t) {
  21063. return this.tagManager.rankedtagInDirection(e, this.position, this.camera, t)
  21064. }
  21065. ,
  21066. n.prototype.start = function(e) {
  21067. var t = e.mode
  21068. , i = e.pano
  21069. , n = e.position
  21070. , r = e.quaternion
  21071. , o = e.tag
  21072. , a = e.quickstart
  21073. , s = $.Deferred();
  21074. this.updateModelDependentData(),
  21075. this.updateFromControls(),
  21076. this.findDefaultViews();
  21077. var l = this.is360View(t, i);
  21078. return !this.model.outsideAllowed() || l || a ? this.startInside(i, n, r, o, s) : this.startOutside(e, s),
  21079. s.done(function(e) {
  21080. this.emit(w.Ready, l, e, o)
  21081. }
  21082. .bind(this)),
  21083. s.promise()
  21084. }
  21085. ,
  21086. n.prototype.startOutside = function(e, t) {
  21087. var i = e.mode
  21088. , n = e.pano
  21089. , r = e.position
  21090. , o = e.quaternion
  21091. , a = e.zoom
  21092. , s = e.floorVisibility
  21093. , l = e.tag;
  21094. this.emit(w.StartOutside, f[i].transitionTime),
  21095. this.isOutsideMode(i) ? (this.model.warpDestFloors(s, !0),
  21096. y.cancelById(V.FlyToViewFloor),
  21097. i === u.FLOORPLAN ? this.floorplanMode(r, o, a) : this.dollhouseMode(r, o),
  21098. t.resolve(!1)) : this.startInsideWithFlyin(n, r, o, l, t)
  21099. }
  21100. ,
  21101. n.prototype.startInside = function(e, t, i, n, r) {
  21102. r = r || $.Deferred(),
  21103. this.currentPano = e;
  21104. var o = e && !e.isAligned();
  21105. if (t = o ? e.position : t || e.position,
  21106. i = i || e.quaternion,
  21107. e) {
  21108. var a = this.startInside.bind(this, e, t, i, n, r);
  21109. if (this.checkAndWaitForPanoLoad(e, "high", "low", this.basePanoSize, a))
  21110. return
  21111. }
  21112. return this.mode = u.PANORAMA,
  21113. e.floor.enter(this.mode),
  21114. this.emit(w.PanoChosen, this.currentPano, this.currentPano),
  21115. this.switchCameraMode(this.mode, i),
  21116. this.emit(w.StartInside, o),
  21117. r.resolve(!0),
  21118. r
  21119. }
  21120. ,
  21121. n.prototype.startInsideWithFlyin = function(e, t, i, n, r) {
  21122. if (r = r || $.Deferred(),
  21123. this.dollhouseMode(),
  21124. !e)
  21125. return F.warn("Player.startInsideWithFlyin() -> targetPano is invalid."),
  21126. r.resolve(!1),
  21127. r;
  21128. t = t || e.position;
  21129. var o = i || this.cameraControls.activeControl.camera.quaternion
  21130. , a = e.position;
  21131. return this.fitDollhouse(a, t, o),
  21132. setTimeout(function(t) {
  21133. this.cameraControls.activeControl && (this.cameraControls.activeControl.maxDistance = t);
  21134. var n = {
  21135. mode: u.PANORAMA,
  21136. pano: e,
  21137. quaternion: i,
  21138. callback: function() {
  21139. this.emit(w.FlyinFinished),
  21140. r.resolve(!0)
  21141. }
  21142. .bind(this)
  21143. };
  21144. this.flyToNewMode(n)
  21145. }.bind(this, this.cameraControls.activeControl.maxDistance), f.startupFlyinDelay),
  21146. r
  21147. }
  21148. ,
  21149. n.prototype.checkAndWaitForPanoLoad = function() {
  21150. var e = {}
  21151. , t = {}
  21152. , i = 5e3
  21153. , n = function() {
  21154. for (var n in e)
  21155. if (e.hasOwnProperty(n) && e[n]) {
  21156. var r = performance.now() - t[n];
  21157. if (r < i)
  21158. return !0
  21159. }
  21160. return !1
  21161. };
  21162. return function(r, o, a, s, l, c, h, u, d, p) {
  21163. if (n())
  21164. return !0;
  21165. var f = function(t, i, n) {
  21166. N.delayOneFrame(function() {
  21167. e[t] = !1,
  21168. l && l(i, n)
  21169. }
  21170. .bind(this))
  21171. }
  21172. .bind(this, r.id)
  21173. , g = function(t, i) {
  21174. N.delayOneFrame(function() {
  21175. e[t] = !1,
  21176. c && c(i)
  21177. }
  21178. .bind(this))
  21179. }
  21180. .bind(this, r.id);
  21181. try {
  21182. return null !== u && void 0 !== u || (u = !0),
  21183. 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),
  21184. e[r.id] && (t[r.id] = performance.now()),
  21185. e[r.id]
  21186. } catch (n) {
  21187. throw e[r.id] = !1,
  21188. t[r.id] = performance.now() - i,
  21189. n
  21190. }
  21191. }
  21192. }(),
  21193. n.prototype.checkAndWaitForWholePanoLoad = function(e, t, i, n, r) {
  21194. if (!e)
  21195. throw new M("Player.checkAndWaitForWholePanoLoad() -> Cannot load texture for null pano.");
  21196. return r && this.model.waitForLoad(e, function() {
  21197. return e.isLoaded(i)
  21198. }),
  21199. !e.isLoaded(t) && (e.loadCube(t).done(n),
  21200. !0)
  21201. }
  21202. ,
  21203. n.prototype.checkAndWaitForTiledPanoLoad = function() {
  21204. var e = new r.Vector3;
  21205. return function(t, i, n, r, o, a, s, l) {
  21206. if (!t)
  21207. throw new M("Player.checkAndWaitForTiledPanoLoad() -> Cannot load texture for null pano.");
  21208. return e.copy(d.FORWARD),
  21209. this.getDirection(e),
  21210. !t.isLoaded(i) && (a && this.model.waitForLoad(t, function() {
  21211. return t.isLoaded(i)
  21212. }),
  21213. t.loadTiledPano(i, e, null, s, l).done(function(e, t) {
  21214. n && n(e, t)
  21215. }
  21216. .bind(this)).fail(function(e) {
  21217. r && r(e)
  21218. }
  21219. .bind(this)).progress(function(e, t, i) {
  21220. o && o(e, t, i)
  21221. }
  21222. .bind(this)),
  21223. !0)
  21224. }
  21225. }(),
  21226. n.prototype.switchCameraMode = function(e, t) {
  21227. var i = this.cameraControls.controls[e]
  21228. , n = i.camera;
  21229. switch (e) {
  21230. case u.PANORAMA:
  21231. n.position.copy(this.currentPano.position);
  21232. var o = t ? d.FORWARD.clone().applyQuaternion(t) : this.getDirection().setY(0).normalize();
  21233. i.lookAt(o.add(n.position));
  21234. break;
  21235. case u.DOLLHOUSE:
  21236. var a = this.position.clone();
  21237. 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),
  21238. n.position.copy(a),
  21239. i.target.copy(this.target.clone().setY(this.model.center.y));
  21240. break;
  21241. case u.FLOORPLAN:
  21242. n.position.copy(this.model.center).setY(f.floorplan.cameraHeight),
  21243. i.target.copy(this.model.center).setY(0),
  21244. i.zoomToContain(this.model.size),
  21245. i.rotateToView(this.model.size, this.getDirection())
  21246. }
  21247. i.update(0)
  21248. }
  21249. ,
  21250. n.prototype.update = function() {
  21251. var e = (new r.Vector3,
  21252. {})
  21253. , t = [];
  21254. return function(i) {
  21255. this.updatePersistentZooming(i),
  21256. this.updateFromControls(i),
  21257. this.getCurrentNodePanos(t),
  21258. this.hasChanged(e) && (this.lastChangeTime = Date.now(),
  21259. !this.mouseDown && this.containsMouse && this.updateIntersect(),
  21260. this.emit(w.ViewChanged)),
  21261. this.model.supportsTiles && (this.updateTileDownloader(t),
  21262. this.updatePanoRenderer(t)),
  21263. this.updatePreRendering(t),
  21264. this.reticule.update(),
  21265. this.path.update(),
  21266. this.spider.update(),
  21267. this.cachedPanoCandidates && f.navigation.panoScores && this.model.panos.showPanoScores(this.cachedPanoCandidates),
  21268. this.updateControlLocks(),
  21269. this.model.supportsTiles && this.updateZoomPano()
  21270. }
  21271. }(),
  21272. n.prototype.updatePersistentZooming = function(e) {
  21273. 1 === this.zooming ? this.zoomBy(1 + this.zoomSpeed * e) : this.zooming === -1 && this.zoomBy(1 - this.zoomSpeed * e)
  21274. }
  21275. ,
  21276. n.prototype.updateControlLocks = function() {
  21277. this.currentPano && this.model.supportsTiles && (this.cameraControls.controls[u.PANORAMA].locked = !this.currentPano.highestFullTileRenderOpCompleted && this.currentPano.lockUntilRenderingComplete)
  21278. }
  21279. ,
  21280. n.prototype.updatePanoRenderer = function() {
  21281. var e = new r.Vector3;
  21282. return function(t) {
  21283. var i = this.nextPano || this.currentPano;
  21284. this.panoRenderer.hasQueuedTiles() && i && (e.copy(d.FORWARD),
  21285. this.getDirection(e),
  21286. this.panoRenderer.updateDirection(e))
  21287. }
  21288. }(),
  21289. n.prototype.cleanupInactivePanos = function() {
  21290. var e = []
  21291. , t = [];
  21292. return function() {
  21293. e.length = 0,
  21294. e.push(this.currentPano),
  21295. this.nextPano && e.push(this.nextPano),
  21296. t.length = 0;
  21297. for (var i = 0; i < this.panoRenderer.activePanos.length; i++)
  21298. t.push(this.panoRenderer.activePanos[i]);
  21299. for (var n = 0; n < t.length; n++) {
  21300. for (var r = t[n], o = !0, a = 0; a < e.length; a++)
  21301. r.id === e[a].id && (o = !1);
  21302. o && r.exit()
  21303. }
  21304. }
  21305. }(),
  21306. n.prototype.updatePreRendering = function() {
  21307. var e = {};
  21308. return function(t) {
  21309. if (1 === f.tiling.preRenderTourPanos && this.preRenderingEnabled) {
  21310. var i = this.nextPano || this.currentPano;
  21311. if (i && t && t.length > 1) {
  21312. var n = t.findIndex(function(e) {
  21313. if (e.id === i.id)
  21314. return !0
  21315. });
  21316. if (n >= 0 && n + 1 < t.length) {
  21317. var r = t[n + 1];
  21318. r.isLoaded(this.basePanoSize) || e[r.id] || (window.setTimeout(function(t) {
  21319. this.checkAndWaitForPanoLoad(t, "high", "low", this.basePanoSize, null, null, null, !1, !1, !1),
  21320. window.setTimeout(function(t) {
  21321. e[t.id] = !1
  21322. }
  21323. .bind(this, t), f.tiling.panoPreRenderRepeatDelay)
  21324. }
  21325. .bind(this, r), f.tiling.panoPreRenderDelay),
  21326. e[r.id] = !0)
  21327. }
  21328. }
  21329. }
  21330. }
  21331. }(),
  21332. n.prototype.enablePreRendering = function() {
  21333. this.preRenderingEnabled = !0
  21334. }
  21335. ,
  21336. n.prototype.disablePreRendering = function() {
  21337. this.preRenderingEnabled = !1,
  21338. this.cleanupInactivePanos()
  21339. }
  21340. ,
  21341. n.prototype.updateTileDownloader = function() {
  21342. var e = new r.Vector3;
  21343. return function(t) {
  21344. var i = this.nextPano || this.currentPano;
  21345. i && (e.copy(d.FORWARD),
  21346. this.getDirection(e),
  21347. this.tileDownloader.tilePrioritizer.updateCriteria(i, this.position, e, t.length > 0 ? t : null),
  21348. this.tileDownloader.processPriorityQueue = !0)
  21349. }
  21350. }(),
  21351. n.prototype.updateFromControls = function(e) {
  21352. null !== e && void 0 !== e || (e = 0),
  21353. this.cameraControls.activeControl && (this.cameraControls.activeControl.update(e),
  21354. this.quaternion.copy(this.cameraControls.activeControl.camera.quaternion),
  21355. this.position.copy(this.cameraControls.activeControl.camera.position),
  21356. this.target.copy(this.cameraControls.activeControl.target),
  21357. this.cameraControls.activeControl.camera.updateProjectionMatrix(),
  21358. this.camera.projectionMatrix.copy(this.cameraControls.activeControl.camera.projectionMatrix)),
  21359. this.camera.position.copy(this.position),
  21360. this.camera.quaternion.copy(this.quaternion),
  21361. this.camera.updateMatrix(),
  21362. this.camera.updateMatrixWorld()
  21363. }
  21364. ,
  21365. n.prototype.hasChanged = function(e) {
  21366. if (!this.previousState)
  21367. return this.previousState = {
  21368. allFloorsVisible: this.model.allFloorsVisible,
  21369. position: this.position.clone(),
  21370. quaternion: this.quaternion.clone(),
  21371. mouse: this.mouse.clone(),
  21372. labelScaleFactor: this.getLabelScaleFactor(),
  21373. currentFloor: this.model.currentFloor,
  21374. projectionMatrix: this.camera.projectionMatrix.clone(),
  21375. worldMatrix: this.camera.matrixWorld.clone(),
  21376. mode: this.mode,
  21377. modelPosition: this.model.position.clone(),
  21378. modelCenter: this.model.center.clone(),
  21379. zoomLevel: this.zoomLevel
  21380. },
  21381. !0;
  21382. 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;
  21383. return e.allFloorsVisible = this.model.allFloorsVisible !== this.previousState.allFloorsVisible,
  21384. e.moved = !this.position.equals(this.previousState.position),
  21385. e.rotated = !this.quaternion.equals(this.previousState.quaternion),
  21386. e.mouseMoved = !this.mouse.equals(this.previousState.mouse),
  21387. e.labelScaleFactor = this.getLabelScaleFactor() !== this.previousState.labelScaleFactor,
  21388. e.floorChanged = this.model.currentFloor !== this.previousState.currentFloor,
  21389. e.cameraProjectionChanged = !this.camera.projectionMatrix.equals(this.previousState.projectionMatrix),
  21390. e.cameraWorldMatrixChanged = !this.camera.matrixWorld.equals(this.previousState.worldMatrix),
  21391. e.modeChanged = this.mode !== this.previousState.mode,
  21392. e.modelPositionChanged = !this.model.position.equals(this.previousState.modelPosition),
  21393. e.modelCenterChanged = !this.model.center.equals(this.previousState.modelCenter),
  21394. e.nextPanoActive = null !== this.nextPano,
  21395. e.zoomLevel = this.zoomLevel !== this.previousState.zoomLevel,
  21396. this.previousState.allFloorsVisible = this.model.allFloorsVisible,
  21397. this.previousState.position.copy(this.position),
  21398. this.previousState.quaternion.copy(this.quaternion),
  21399. this.previousState.mouse.copy(this.mouse),
  21400. this.previousState.labelScaleFactor = this.getLabelScaleFactor(),
  21401. this.previousState.currentFloor = this.model.currentFloor,
  21402. this.previousState.projectionMatrix.copy(this.camera.projectionMatrix),
  21403. this.previousState.worldMatrix.copy(this.camera.matrixWorld),
  21404. this.previousState.mode = this.mode,
  21405. this.previousState.modelPosition.copy(this.model.position),
  21406. this.previousState.modelCenter.copy(this.model.center),
  21407. this.previousState.zoomLevel = this.zoomLevel,
  21408. !t
  21409. }
  21410. ,
  21411. n.prototype.updateIntersect = function() {
  21412. var e = this.flying || this.isWarping()
  21413. , t = this.isOutsideMode() && this.cameraControls.controls[this.mode].isEngaged()
  21414. , i = y.getById(V.LookTransition)
  21415. , n = !(e || t || this.isTouchEvent || i.length && i[0].running);
  21416. //this.tagManager.intersecttag(this.mouse, n, this.camera) || (this.intersect = this.getMouseIntersect(),//--MP
  21417. this.intersect = this.getMouseIntersect(); //xzw change
  21418. this.intersect && this.updateClosestPano(this.intersect),
  21419. this.closestPano || this.closestPanoInDirection(this.getMouseDirection()) ? (this.reticule.updatePosition(this.position, this.intersect),
  21420. f.navigation.panoScores && !f.navigation.mouseDirection && this.closestPanoInDirection(this.getDirection())) : this.reticule.hide()
  21421. }
  21422. ,
  21423. n.prototype.checkHotClick = function() {
  21424. if(this.intersectHot){
  21425. this.intersectHot.examine(this);
  21426. /* g_touraudio.pause();
  21427. g_bgaudio = false;
  21428. document.getElementById("bgaudio").pause();
  21429. var sWidth = document.body.scrollWidth;
  21430. var sHeight = document.body.scrollHeight;
  21431. var pop1 = document.getElementById('popup');
  21432. pop1.style.display = "block";
  21433. var myElement = document.createElement("iframe");
  21434. myElement.src = g_HotMeshes[i].hotLink;
  21435. myElement.id = "id1";
  21436. myElement.allowTransparency = "true";
  21437. myElement.style.width = "100%";
  21438. myElement.style.height = "100%";
  21439. myElement.scrolling = "no";
  21440. var element=document.getElementById("id1");
  21441. if (typeof(element)== "undefined" || element == null){
  21442. document.getElementById("popup").appendChild(myElement);
  21443. }
  21444. var oClose = document.getElementById("closepop");
  21445. oClose.onclick = function() {
  21446. pop1.style.display = "none";
  21447. document.getElementById("popup").removeChild(document.getElementById("id1"));
  21448. $("#popup iframe:last").remove();
  21449. document.getElementById("bgaudio").play();
  21450. } */
  21451. return true;
  21452. }
  21453. },
  21454. n.prototype.getMouseDirection = function(e) {
  21455. e = e || this.mouse;
  21456. var t = new r.Vector3(e.x,e.y,-1).unproject(this.camera)
  21457. , i = new r.Vector3(e.x,e.y,1).unproject(this.camera);
  21458. return i.sub(t).normalize()
  21459. }
  21460. ,
  21461. n.prototype.getMouseIntersect = function(e, t) {//xzw change
  21462. e = e || this.mouse.clone(),
  21463. t = t || this.model.floors.reduce(function(e, t) {
  21464. return t.hidden ? e : e.concat(t.collider.children)
  21465. }, this.mode === u.PANORAMA ? this.panoMarkers : []);
  21466. for(var i in this.model.hots){
  21467. t.push(this.model.hots[i].mesh);
  21468. }
  21469. var i = new r.Vector3(e.x,e.y,-1).unproject(this.camera);
  21470. this.raycaster.set(i, this.getMouseDirection(e));
  21471. var n = this.raycaster.intersectObjects(t);
  21472. if (0 === n.length){
  21473. this.intersectHot = null; //add
  21474. if(g_HotStatus!="add") $("#player").css("cursor","");
  21475. return null;
  21476. }
  21477. var o = n[0];
  21478. if(o.object.type == "hotSprite"){ //add
  21479. this.intersectHot = o.object.belongHot;
  21480. $("#player").css("cursor","pointer");
  21481. return;
  21482. }
  21483. this.intersectHot = null;
  21484. if(g_HotStatus!="add") $("#player").css("cursor","");
  21485. if (o.face) {
  21486. o.normal = o.face.normal.applyQuaternion(o.object.quaternion);
  21487. var a = this.position.clone().sub(o.point);
  21488. a.dot(o.normal) < 0 && o.normal.negate(),
  21489. this.currentPano ? o.onFloor = o.point.y < this.position.y - .5 * this.currentPano.height : o.onFloor = o.point.y < this.position.y - .5,
  21490. o.horizontal = o.normal.y > .8
  21491. }
  21492. return o
  21493. }
  21494. ,
  21495. n.prototype.updateClosestPano = function(e) {
  21496. var t = [s.filters.isPanoAligned()];
  21497. if (this.mode === u.PANORAMA) {
  21498. if (!this.currentPano)
  21499. return;
  21500. t.push(s.filters.not(this.currentPano)),
  21501. t.push(s.filters.inFloorDirection(this.currentPano.floorPosition, this.getDirection(), .25)),
  21502. t.push(s.filters.isNeighbourPanoTo(this.currentPano)),
  21503. t.push(s.filters.isCloseEnoughTo(e.point, f.panoFloorClickRadius)),
  21504. t.push(s.filters.isNotBehindNormal(e.point, e.normal))
  21505. } else
  21506. t.push(s.filters.isOnVisibleFloor()),
  21507. this.mode !== u.FLOORPLAN && t.push(s.filters.inDirection(this.position, this.getDirection(), .25));
  21508. var i = this.model.panos.find(t, [s.sortFunctions.floorDistanceToPoint(e.point)]);
  21509. i !== this.closestPano ? (i && (this.isPanoHover = !0),
  21510. this.emit(w.ClosestPanoChanging, this.closestPano, i, this.mode),
  21511. this.closestPano = i) : this.isPanoHover = !1
  21512. }
  21513. ,
  21514. n.prototype.dollhouseMode = function(e, t) {
  21515. this.emit(w.ModeChanging, this.mode, u.DOLLHOUSE),
  21516. this.mode = u.DOLLHOUSE,
  21517. this.cameraControls.controls[u.DOLLHOUSE].reset();
  21518. var i = new r.Vector3(this.model.center.x,0,this.model.center.z)
  21519. , n = new r.Vector3(15,10,15);
  21520. if (e && t) {
  21521. var o = d.FORWARD.clone().applyQuaternion(t)
  21522. , a = this.model.center.clone().sub(e)
  21523. , s = a.dot(o);
  21524. s > 0 ? (i = o.clone().multiplyScalar(s).add(e),
  21525. n.copy(e)) : F.warn("Tried to initiate dollhouse mode that wasn't looking at the model", e, t)
  21526. }
  21527. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(0, !0),
  21528. this.cameraControls.controls[u.DOLLHOUSE].target.copy(i),
  21529. this.cameraControls.cameras[u.DOLLHOUSE].position.copy(n),
  21530. this.updateFromControls(),
  21531. this.model.alpha = 1,
  21532. this.model.skybox.material.uniforms.opacity.value = 0
  21533. }
  21534. ,
  21535. n.prototype.insideMode = function(e, t) {
  21536. var i = $.Deferred()
  21537. , n = t || null;
  21538. if (this.mode !== u.PANORAMA && this.mode !== u.TRANSITIONING) {
  21539. var r = [s.filters.isPanoAligned()];
  21540. this.model.currentFloor && r.push(s.filters.atFloor(this.model.currentFloor)),
  21541. e = e || this.currentPano || this.model.panos.find(r, [s.sortFunctions.distanceToPoint(this.cameraControls.activeControl.target)]),
  21542. this.flyToNewMode({
  21543. mode: u.PANORAMA,
  21544. pano: e,
  21545. callback: n
  21546. }).done(i.resolve.bind(i)).fail(i.reject.bind(i))
  21547. } else {
  21548. var o = this.mode === u.PANORAMA ? "Already in panorama mode" : "Cannot change mode during mode transition";
  21549. i.reject(o)
  21550. }
  21551. return i.promise()
  21552. }
  21553. ,
  21554. n.prototype.fitDollhouse = function(e, t, i) {//许钟文改 飞入前寻找和初始视角最合适的位置
  21555. //if(urlHasValue('oldEntry')){
  21556. //搬自一代。
  21557. var n = d.FORWARD.clone().applyQuaternion(i)
  21558. , i = n.clone().add(e);
  21559. this.cameraControls.activeControl.target.copy(i),
  21560. this.cameraControls.activeControl.camera.position.set(0, 6, 0).add(e).add(n.multiplyScalar(-10))
  21561. //return;
  21562. //}//下面是二代代码,看不太懂。因为有的场景在靠近一端的某个方向截取的初始视角会甩镜头,也就是不是下去之后的方向
  21563. //直接用一代的这个 效果和二代几乎一样,且不会甩
  21564. /* var n = d.FORWARD.clone().applyQuaternion(i);
  21565. this.cameraControls.activeControl.target.copy(n).add(e);
  21566. var o = d.RIGHT.clone().applyQuaternion(i)
  21567. , a = d.UP.clone()
  21568. , s = o.clone().applyAxisAngle(a, Math.PI / 2)
  21569. , l = this.model.boundingBox.max.clone()
  21570. , c = this.model.boundingBox.min.clone()
  21571. , 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)]
  21572. , u = 0
  21573. , p = 0
  21574. , g = 0;
  21575. h.forEach(function(e, t, i) {
  21576. var n = Math.abs(e.dot(o))
  21577. , r = e.dot(s);
  21578. n > u && (u = n,
  21579. p = r),
  21580. r > g && (g = r)
  21581. });
  21582. 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)))
  21583. , v = s.clone().multiplyScalar(p).add(t)
  21584. , A = s.clone().multiplyScalar(g).add(t);
  21585. p = u / Math.tan(this.cameraControls.activeControl.camera.fov / 2 * this.cameraControls.activeControl.camera.aspect * (Math.PI / 180));
  21586. g = m / Math.tan(this.cameraControls.activeControl.camera.fov / 2 * (Math.PI / 180));
  21587. p = Math.max(p, 10),
  21588. g = Math.max(g, 10);
  21589. var y = n.clone().multiplyScalar(-p).add(v).sub(t).length()
  21590. , C = n.clone().multiplyScalar(-g).add(v).sub(t).length();
  21591. this.cameraControls.activeControl.maxDistance = f.skyboxRadius - 1;
  21592. y >= C ? this.cameraControls.activeControl.camera.position.set(0, 6, 0).add(v).add(n.multiplyScalar(1.1 * -p))
  21593. : this.cameraControls.activeControl.camera.position.set(0, 6, 0).add(A).add(n.multiplyScalar(1.1 * -g))
  21594. */
  21595. }
  21596. ,
  21597. n.prototype.floorplanMode = function(e, t, i) {
  21598. this.mode = u.FLOORPLAN;
  21599. var n = this.cameraControls.controls[u.FLOORPLAN];
  21600. n.reset();
  21601. var r = e ? e : this.model.center;
  21602. if (n.target.copy(r).setY(0),
  21603. n.camera.position.copy(r).setY(f.floorplan.cameraHeight),
  21604. i ? (n.currentScale = i / ($("#player").width() / $("#player").height()),
  21605. n.absoluteScale = n.currentScale) : n.zoomToContain(this.model.size),
  21606. t) {
  21607. var o = d.LEFT.clone().applyQuaternion(t);
  21608. n.rotateLeft(-Math.atan2(o.x, o.z))
  21609. } else
  21610. n.rotateToView(this.model.size, this.getDirection());
  21611. n.update(0)
  21612. }
  21613. ,
  21614. n.prototype.nonInterruptingFlyToPano = function(e, t) {
  21615. return e.skipWarpingCheck = !0,
  21616. this.flyToPano(e, t)
  21617. }
  21618. ,
  21619. n.prototype.flyToPano = function(e, t) {
  21620. var i = e.pano
  21621. , n = e.lookAtPoint
  21622. , o = e.duration
  21623. , a = e.aimDuration
  21624. , s = e.maxDistanceOverride
  21625. , l = e.skipWarpingCheck
  21626. , c = e.constantMoveSpeed
  21627. , h = null
  21628. , p = null;
  21629. window.specialScene && specialScene.special().specifySpot && specialScene.special().specifySpot(i);
  21630. if (this.isWarping() && !l && (this.path.activeTransType === x.BLACK || this.path.activeTransType === x.STD))
  21631. return F.warn("Player.flyToPano() -> Cannot fly when warping"),
  21632. t && t(),
  21633. !1;
  21634. if (this.updateLastView(),
  21635. this.mode !== u.PANORAMA) {
  21636. var m;
  21637. return n && (m = (new r.Quaternion).setFromUnitVectors(d.FORWARD, n.sub(i.position).normalize())),
  21638. void this.flyToNewMode({
  21639. mode: u.PANORAMA,
  21640. pano: i,
  21641. duration: o,
  21642. quaternion: m,
  21643. callback: t
  21644. })
  21645. }
  21646. if (!i || (h = g.deepExtend(e),
  21647. p = function() {
  21648. N.delayOneFrame(function() {
  21649. this.flyToPano(h, t)
  21650. }
  21651. .bind(this))
  21652. }
  21653. .bind(this),
  21654. !this.checkAndWaitForPanoLoad(i, "high", "low", this.basePanoSize, p))) {
  21655. var C = function(e) {
  21656. t && t(e)
  21657. }
  21658. .bind(this);
  21659. this.currentPano || (this.currentPano = i,
  21660. this.path.placeCpm(),
  21661. this.path.fadeOutCpm(f.path.fadeOutTime),
  21662. this.spider.draw());
  21663. var I = o;
  21664. if ("number" != typeof o) {
  21665. var E = s || f.transition.flytimeMaxDistanceThreshold;
  21666. I = Math.min(this.currentPano.position.distanceTo(i.position), E) * f.transition.flytimeDistanceMultiplier + f.transition.flyTime
  21667. }
  21668. if (f.transition.flySpeed > .01 && (I = 1e3 * this.currentPano.position.distanceTo(i.position) / f.transition.flySpeed),
  21669. 1 !== this.zoomLevel)
  21670. switch (f.zoom.transitionStyle) {
  21671. case 1:
  21672. this.smoothZoomToDefault(I / 2);
  21673. break;
  21674. case 2:
  21675. return h = g.deepExtend(e),
  21676. p = this.flyToPano.bind(this, h, t),
  21677. void this.smoothZoomToDefault(f.zoom.restoreTime * (this.zoomLevel - 1), p)
  21678. }
  21679. if (n) {
  21680. y.cancelById(V.LookTransition),
  21681. I *= f.transition.aimSlowFactor;
  21682. var b = this.cameraControls.activeControl.camera.quaternion.clone()
  21683. , _ = (new r.Matrix4).lookAt(i.position, n, d.UP)
  21684. , T = (new r.Quaternion).setFromRotationMatrix(_)
  21685. , S = b.clone()
  21686. , M = new r.Vector3;
  21687. if (i === this.currentPano) {
  21688. var R = d.FORWARD.clone().applyQuaternion(b)
  21689. , P = d.FORWARD.clone().applyQuaternion(T)
  21690. , O = R.angleTo(P);
  21691. return void 0 !== a && null !== a || (a = 1 * Math.sqrt(O) / f.tags.navigate.rotateSpeedFactor * 1e3),
  21692. void y.start(function(e) {
  21693. S.copy(b),
  21694. v.quaternion(S, T)(e),
  21695. M.copy(d.FORWARD).applyQuaternion(S).add(this.cameraControls.activeControl.camera.position),
  21696. this.cameraControls.activeControl.lookAt(M)
  21697. }
  21698. .bind(this), a, C, 0, A[f.transition.movementEasing], null, V.LookTransition)
  21699. }
  21700. }
  21701. if (i === this.currentPano || this.flying)
  21702. return void C();
  21703. this.flying = !0;
  21704. var L = this.position.clone()
  21705. , D = this.currentPano;
  21706. F.debug("Flying to pano ", i.position),
  21707. this.emit(w.PanoChosen, this.currentPano, i),
  21708. this.emit(w.FlyingStarted, i.position, L, i, D),
  21709. n && y.start(function(e) {
  21710. S.copy(b),
  21711. v.quaternion(S, T)(e),
  21712. M.copy(d.FORWARD).applyQuaternion(S).add(this.cameraControls.activeControl.camera.position),
  21713. this.cameraControls.activeControl.lookAt(M)
  21714. }
  21715. .bind(this), I, null, 0, A[f.transition.movementEasing], null, V.LookTransition);
  21716. var B = c ? null : A[f.transition.movementEasing];
  21717. this.nextPano = i,
  21718. y.start(v.uniform(this.model.skybox, "progress", 1), I, null, 0, A[f.transition.blendEasing], "skyFly", V.FlyToPano),
  21719. y.start(v.allUniforms(this.model.chunks, "progress", 1), I, null, 0, A[f.transition.blendEasing], "chunkFly", V.FlyToPano),
  21720. y.start(v.vector(this.cameraControls.cameras[u.PANORAMA].position, i.position), I, function(e) {
  21721. this.flying = !1,
  21722. this.currentPano !== i && this.currentPano.exit(),
  21723. i.enter(),
  21724. this.currentPano = i,
  21725. this.nextPano = null,
  21726. this.path.placeCpm(),
  21727. this.path.fadeOutCpm(f.path.fadeOutTime),
  21728. this.spider.draw(),
  21729. this.emit(w.FlyingEnded, i.position, L, i, D),
  21730. C(e)
  21731. }
  21732. .bind(this), 0, B, "camFly", V.FlyToPano)
  21733. }
  21734. }
  21735. ,
  21736. n.prototype.fastForwardActivePanoFlight = function(e) {
  21737. e = e || f.transition.fastForwardFactor / 10 * 4 + 1,
  21738. y.adjustSpeed(V.FlyToPano, e),
  21739. y.adjustSpeed(V.LookTransition, e)
  21740. }
  21741. ,
  21742. n.prototype.flyToPanoClosestToMouse = function() {
  21743. if (Date.now() - this.mouseLastMoveTime > 50 && (this.intersect = this.getMouseIntersect(),
  21744. this.intersect && this.updateClosestPano(this.intersect)),
  21745. this.closestPano)
  21746. return this.flyToPano({
  21747. pano: this.closestPano
  21748. });
  21749. var e = this.getMouseDirection();
  21750. this.flyDirection(e) || this.flyToPano({
  21751. pano: this.currentPano
  21752. })
  21753. }
  21754. ,
  21755. n.prototype.flyLocalDirection = function(e) {
  21756. var t = this.getDirection(e)
  21757. , i = 1 === e.z ? .4 : .75
  21758. , n = 1 === Math.abs(e.x);
  21759. return this.flyDirection(t, i, n)
  21760. }
  21761. ,
  21762. n.prototype.flyDirection = function(e, t, i) {
  21763. this.closePopup();//xzw add
  21764. var n = $.Deferred();
  21765. this.history.invalidate();
  21766. var r = this.closestPanoInDirection(e, t, i);
  21767. return r ? this.flyToPano({
  21768. pano: r
  21769. }, n.resolve.bind(n, !0)) : (this.bump(e),
  21770. n.resolve(!1)),
  21771. n.promise()
  21772. }
  21773. ,
  21774. n.prototype.closestPanoInDirection = function(e, t, i) {
  21775. return this.rankedPanoInDirection(0, e, t, i)
  21776. }
  21777. ,
  21778. n.prototype.rankedPanoInDirection = function() {
  21779. var e = {
  21780. pano: null,
  21781. candidates: []
  21782. };
  21783. return function(t, i, n, r) {
  21784. t || (t = 0),
  21785. n = void 0 !== n ? n : .75;
  21786. var o = r ? "angle" : "direction";
  21787. 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),
  21788. this.cachedPanoCandidates = e.candidates,
  21789. e.pano
  21790. }
  21791. }(),
  21792. n.prototype.bump = function(e) {
  21793. if (this.mode === u.PANORAMA && !this.flying && !this.isWarping()) {
  21794. 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;
  21795. if (s)
  21796. t = function() {
  21797. y.start(v.property(this.cameraControls.cameras[u.PANORAMA], "zoom", a > 0 ? 1.04 : .96), o, i, 0, A.easeInOutSine, "bumpZStart")
  21798. }
  21799. .bind(this),
  21800. i = function() {
  21801. y.start(v.property(this.cameraControls.cameras[u.PANORAMA], "zoom", 1), 5 * o, n, 0, A.easeInOutSine, "bumpZRelax")
  21802. }
  21803. .bind(this);
  21804. else {
  21805. var l = this.camera.position.clone()
  21806. , c = e.clone();
  21807. this.raycaster.set(l, c);
  21808. var h = this.model.floors.reduce(function(e, t) {
  21809. return e.concat(t.collider.children)
  21810. }, [])
  21811. , d = this.raycaster.intersectObjects(h)
  21812. , p = d.length > 0 ? d[0].distance / 25 : .04
  21813. , g = l.clone().add(c.multiplyScalar(p));
  21814. t = function() {
  21815. y.start(v.vector(this.cameraControls.cameras[u.PANORAMA].position, g), o, i, 0, A.easeInOutSine, "bumpTStart")
  21816. }
  21817. .bind(this),
  21818. i = function() {
  21819. y.start(v.vector(this.cameraControls.cameras[u.PANORAMA].position, l), 5 * o, n, 0, A.easeInOutSine, "bumpTRelax")
  21820. }
  21821. .bind(this)
  21822. }
  21823. n = function() {
  21824. this.flying = !1
  21825. }
  21826. .bind(this),
  21827. this.flying = !0,
  21828. t()
  21829. }
  21830. }
  21831. ,
  21832. n.prototype.changeFloor = function(e) {
  21833. if (!this.is360View(this.mode, this.currentPano))
  21834. if (this.mode === u.PANORAMA) {
  21835. var t = this.history.reversePano(e);
  21836. t && t.isAligned() ? this.flyToPano({
  21837. pano: t
  21838. }) : this.changeFloorByScore(e)
  21839. } else
  21840. this.model.setFloor(this.model.nextFloor(e) || this.model.currentFloor)
  21841. }
  21842. ,
  21843. n.prototype.changeFloorByScore = function() {
  21844. var e = {
  21845. pano: null,
  21846. candidates: []
  21847. };
  21848. return function(t) {
  21849. var i = this.model.nextFloor(t);
  21850. 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),
  21851. void (e.pano ? (this.cachedPanoCandidates = e.candidates,
  21852. this.history.push(t, this.currentPano),
  21853. this.flyToPano({
  21854. pano: e.pano
  21855. })) : F.warn("No pano found on selected floor, not moving there."))) : void F.debug("player.changeFloor(" + t + "): no such floor")
  21856. }
  21857. }(),
  21858. n.prototype.gotoFloor = function(e) {
  21859. var t = e - this.model.currentFloor.floorIndex;
  21860. this.changeFloor(t)
  21861. }
  21862. ,
  21863. n.prototype.getDirection = function(e) {
  21864. return e = e ? e : (new r.Vector3).copy(d.FORWARD),
  21865. e.applyQuaternion(this.camera.quaternion)
  21866. }
  21867. ,
  21868. n.prototype.flyToSameMode = function(e, t, i, n, o) {
  21869. if (o = o || $.Deferred(),
  21870. this.mode === u.TRANSITIONING)
  21871. return F.warn("should not be transitioning here"),
  21872. n && n(!1),
  21873. o.reject().promise();
  21874. var a = i || !1
  21875. , s = i ? i.position : this.position
  21876. , l = this.position.clone()
  21877. , c = this.currentPano;
  21878. if (F.debug("New pose in mode " + this.mode),
  21879. !e || (retryCallback = function() {
  21880. N.delayOneFrame(function() {
  21881. this.flyToSameMode(e, t, i, n, o)
  21882. }
  21883. .bind(this))
  21884. }
  21885. .bind(this),
  21886. !this.checkAndWaitForPanoLoad(e, "high", "low", this.basePanoSize, retryCallback))) {
  21887. var h = function() {
  21888. this.emit(w.FlyingEnded, s, l, e, c),
  21889. n && n(!0)
  21890. }
  21891. .bind(this)
  21892. , d = f[this.mode]
  21893. , p = void 0 !== t ? t : d.transitionTime
  21894. , g = new r.Vector3
  21895. , C = new r.Vector3;
  21896. if (this.emit(w.FlyingStarted, s, l, e, c),
  21897. this.mode === u.PANORAMA)
  21898. F.warn("we should not be here for panorama views");
  21899. else if (this.mode === u.DOLLHOUSE)
  21900. if (a) {
  21901. var I = new r.Vector3(0,1,0);
  21902. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(1, !0),
  21903. this.model.warpDestFloors(i.floorVisibility),
  21904. C.copy(i.position);
  21905. var E = new r.Vector3(0,0,-1).applyQuaternion(i.quaternion)
  21906. , b = new r.Raycaster(C.clone(),E.clone(),0,1 / 0)
  21907. , _ = b.intersectObjects(this.model.colliders)
  21908. , T = 3;
  21909. _.length ? (g.copy(_[0].point),
  21910. T = .75 * C.distanceTo(g)) : (g.copy(E).multiplyScalar(3).add(C),
  21911. F.debug("Tried to restore dollhouse mode that did not intersect...", i.position, i.quaternion));
  21912. var x = (new r.Matrix4).lookAt(C, g, I)
  21913. , S = (new r.Euler).setFromRotationMatrix(x, f.warp.eOrder)
  21914. , M = g.distanceTo(C)
  21915. , R = (new r.Matrix4).lookAt(this.cameraControls.cameras[u.DOLLHOUSE].position, this.cameraControls.controls[u.DOLLHOUSE].target, I)
  21916. , P = (new r.Euler).setFromRotationMatrix(R, f.warp.eOrder)
  21917. , O = this.cameraControls.cameras[u.DOLLHOUSE].position.distanceTo(this.cameraControls.controls[u.DOLLHOUSE].target);
  21918. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(Math.min(O, T), !0);
  21919. var L = new r.Euler(S.x - P.x,S.y - P.y,S.z - P.z,f.warp.eOrder);
  21920. L.y = L.y > Math.PI ? L.y -= 2 * Math.PI : L.y < -Math.PI ? L.y += 2 * Math.PI : L.y,
  21921. this.path.burnsDir = Math.sign(L.y);
  21922. var D = new r.Euler(0,0,0,f.warp.eOrder)
  21923. , B = new r.Vector3;
  21924. y.start(v.vector(this.cameraControls.controls[u.DOLLHOUSE].target, g), p, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToSameMode),
  21925. y.start(function(e, t) {
  21926. D.x = P.x + e * L.x,
  21927. D.y = P.y + e * L.y,
  21928. D.z = P.z + e * L.z;
  21929. var i = O + e * (M - O);
  21930. B.set(0, 0, i).applyEuler(D).add(this.cameraControls.controls[u.DOLLHOUSE].target),
  21931. this.cameraControls.cameras[u.DOLLHOUSE].position.copy(B).add(this.model.position)
  21932. }
  21933. .bind(this), p, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToSameMode),
  21934. y.start(function(e, t) {
  21935. this.cameraControls.controls[u.DOLLHOUSE].update(),
  21936. this.quaternion.copy(this.cameraControls.cameras[u.DOLLHOUSE].quaternion),
  21937. this.position.copy(this.cameraControls.cameras[u.DOLLHOUSE].position)
  21938. }
  21939. .bind(this), p, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToSameMode)
  21940. } else
  21941. F.warn("invalid warp destination in flyToSameMode()? ignore it then");
  21942. else if (this.path.placeCpm(),
  21943. this.path.fadeInCpm(f.path.fadeInTime),
  21944. i) {
  21945. this.model.warpDestFloors(i.floorVisibility);
  21946. var U = this.cameraControls.cameras[u.FLOORPLAN]
  21947. , k = this.cameraControls.controls[u.FLOORPLAN]
  21948. , H = k.target.clone()
  21949. , G = i.position.clone().sub(H)
  21950. , z = U.position.clone().sub(k.target)
  21951. , W = z.length()
  21952. , j = new r.Vector3(-1,0,0).applyQuaternion(i.quaternion).normalize()
  21953. , Y = Math.atan2(k.offset.x, k.offset.z)
  21954. , X = Math.atan2(j.x, j.z)
  21955. , Z = k.absoluteScale
  21956. , q = m.convertWorkshopOrthoZoom(i.orthoZoom);
  21957. y.start(function(e, t) {
  21958. k.target.copy(G).multiplyScalar(e).add(H);
  21959. var i = Y + (X - Y) * e;
  21960. k.offset.x = W * Math.sin(i),
  21961. k.offset.z = W * Math.cos(i),
  21962. U.position.copy(k.target).add(k.offset),
  21963. k.absoluteScale = Z + e * (q - Z),
  21964. k.update(),
  21965. this.quaternion.copy(U.quaternion),
  21966. this.position.copy(U.position),
  21967. this.target.copy(k.target),
  21968. this.camera.projectionMatrix.copy(U.projectionMatrix)
  21969. }
  21970. .bind(this), p, null, 0, A[f.flydown.movementEasing], null, V.FlyToSameMode)
  21971. } else
  21972. F.info("flyToSameMode() funny floorplan view? skipping");
  21973. return y.setTimeout(function(e) {
  21974. this.mode = e,
  21975. h(),
  21976. o.resolve(!0)
  21977. }
  21978. .bind(this, this.mode), p, V.FlyToSameMode),
  21979. this.mode = u.TRANSITIONING,
  21980. o.promise()
  21981. }
  21982. }
  21983. ,
  21984. n.prototype.flyToNewMode = function(e, t) {
  21985. e = e || {};
  21986. var i = e.mode
  21987. , n = e.pano
  21988. , o = e.duration
  21989. , a = e.warpDest
  21990. , s = e.callback
  21991. , l = e.force
  21992. , c = e.quaternion;
  21993. if (t = t || $.Deferred(),
  21994. this.isWarping())
  21995. return F.warn("Player.flyToNewMode() -> Cannot fly when warping"),
  21996. s && s(!1),
  21997. t.reject("Cannot change mode during tour transition").promise();
  21998. if (this.mode === u.TRANSITIONING)
  21999. return s && s(!1),
  22000. t.reject("Cannot change mode during mode transition").promise();
  22001. if (i === this.mode)
  22002. return l ? (this.flyToSameMode(n, o, a, s).done(t.resolve.bind(t)).fail(t.reject.bind(t)),
  22003. t.promise()) : (s && s(!1),
  22004. t.reject("Already in " + i + " mode").promise());
  22005. var h = a || !1;
  22006. F.debug("Switching mode to " + i);
  22007. var d = function() {
  22008. N.delayOneFrame(function() {
  22009. this.flyToNewMode(e, t)
  22010. }
  22011. .bind(this))
  22012. }
  22013. .bind(this);
  22014. if (n && this.checkAndWaitForPanoLoad(n, "low", "low", this.basePanoSize, d))
  22015. return t.promise();
  22016. if (!this.model.meshTexturesLoaded && this.isOutsideMode(i))
  22017. return F.info("Waiting for model textures to be loaded before going out to dollhouse"),
  22018. this.model.waitForLoad(this.model, function() {
  22019. return this.model.meshTexturesLoaded;
  22020. }
  22021. .bind(this)),
  22022. this.model.loadMeshTextures().done(d),
  22023. t.promise();
  22024. this.history.invalidate(),
  22025. this.updateLastView();
  22026. var p = this.mode
  22027. , C = this.cameraControls.cameras[i];
  22028. e = g.deepExtend({}, f[i], f[p + "-" + i]);
  22029. var I = void 0 !== o ? o : e.transitionTime;
  22030. this.emit(w.ModeChanging, p, i, n),
  22031. n && (this.currentPano = n),
  22032. this.switchCameraMode(i, c),
  22033. y.cancelById(V.LookTransition);
  22034. var _ = (new r.Vector3).copy(this.position);
  22035. if (i === u.PANORAMA)
  22036. this.emit(w.PanoChosen, n, n),
  22037. setTimeout(function() {
  22038. n.floor.enter(i)
  22039. }
  22040. .bind(this), I / 2),
  22041. this.path.fadeOutCpm(f.path.fadeOutTime);
  22042. else if (i === u.DOLLHOUSE) {
  22043. if (h && (this.model.stayPut = !0),
  22044. a ? (this.cameraControls.controls[u.DOLLHOUSE].resetRanges(1, !0),
  22045. this.model.warpDestFloors(a.floorVisibility)) : this.model.toggleAllFloors(!0),
  22046. this.path.placeCpm(),
  22047. this.path.fadeInCpm(f.path.fadeInTime),
  22048. h) {
  22049. var T = new r.Vector3(this.model.center.x,0,this.model.center.z);
  22050. _.set(15, 10, 15);
  22051. var M = new r.Vector3(0,0,-1).applyQuaternion(a.quaternion)
  22052. , R = new r.Raycaster(a.position.clone(),M.clone(),0,1 / 0)
  22053. , P = R.intersectObjects([this.sceneIntersectionPlane]);
  22054. P.length ? (T.copy(P[0].point),
  22055. _.copy(a.position),
  22056. 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),
  22057. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(3, !0)),
  22058. this.cameraControls.controls[u.DOLLHOUSE].target.copy(T),
  22059. _.add(this.model.position),
  22060. C.position.copy(_),
  22061. this.cameraControls.controls[u.DOLLHOUSE].update()
  22062. }
  22063. } else if (this.path.placeCpm(),
  22064. this.path.fadeInCpm(f.path.fadeInTime),
  22065. a) {
  22066. this.model.warpDestFloors(a.floorVisibility);
  22067. var O = this.cameraControls.cameras[u.FLOORPLAN]
  22068. , L = this.cameraControls.controls[u.FLOORPLAN]
  22069. , D = O.position.clone().sub(L.target)
  22070. , B = new r.Vector3(-1,0,0).applyQuaternion(a.quaternion).normalize()
  22071. , U = Math.atan2(B.x, B.z);
  22072. L.target.copy(a.position);
  22073. var k = D.length();
  22074. L.offset.x = k * Math.sin(U),
  22075. L.offset.y = 0,
  22076. L.offset.z = k * Math.cos(U),
  22077. O.position.copy(L.target).add(L.offset);
  22078. L.target.clone().sub(C.position);
  22079. C.quaternion.copy(a.quaternion),
  22080. L.currentScale = m.convertWorkshopOrthoZoom(a.orthoZoom),
  22081. L.absoluteScale = L.currentScale,
  22082. L.update()
  22083. } else
  22084. this.model.currentFloor.enter(i);
  22085. var H = this.currentPano
  22086. , G = this.position.clone();
  22087. return this.emit(w.FlyingStarted, _, G, n, this.currentPano),
  22088. this.flying = !0,
  22089. this.isOutsideMode(i) && this.is360View(p, H) ? (h || i !== u.DOLLHOUSE || (C.position.set(15, 10, 15),
  22090. C.controls.target.set(this.model.center.x, 0, this.model.center.z),
  22091. C.controls.update()),
  22092. e.blackoutStyle = S.FADEIN,
  22093. I = f.show360Views.transitionTime,
  22094. this.fade360View(I, C, e)) : this.isOutsideMode(p) && this.is360View(i, n) ? (h && this.switchCameraMode(i, h.quaternion),
  22095. this.mode = i,
  22096. this.path && this.path.popOutCpm(),
  22097. e.blackoutStyle = S.END,
  22098. I = f.show360Views.transitionTime,
  22099. this.fade360View(I, C, e)) : (y.start(v.property(this.model, "alpha", e.modelAlpha, null), I * e.modelAlphaLength, null, e.modelAlphaDelay, null, V.FlyToNewMode),
  22100. y.start(v.vector(this.position, C.position), I, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToNewMode),
  22101. y.start(v.quaternion(this.quaternion, C.quaternion), I * e.rotationDuration, null, e.rotationDelay, A[f.flydown.rotationEasing], null, V.FlyToNewMode),
  22102. y.start(v.matrix4(this.camera.projectionMatrix, C.projectionMatrix), I * e.cameraMatrixDuration, null, e.cameraMatrixDelay, e.cameraMatrixEase, null, V.FlyToNewMode),
  22103. y.start(v.uniform(this.model.skybox, "opacity", e.skyboxOpacity), I * e.skyboxOpacityLength, null, e.skyboxOpacityDelay, null, V.FlyToNewMode),
  22104. y.start(v.property(this.reticule.material.uniforms.opacity, "value", 0), I, null, V.FlyToNewMode)),
  22105. y.setTimeout(function() {
  22106. this.flying = !1,
  22107. p === u.PANORAMA && i !== u.PANORAMA ? this.currentPano.exit() : p !== u.PANORAMA && i === u.PANORAMA && (this.currentPano !== H && H.exit(),
  22108. this.currentPano.enter(),
  22109. this.path.placeCpm(),
  22110. this.path.fadeOutCpm(f.path.fadeOutTime),
  22111. this.spider.draw()),
  22112. p === u.DOLLHOUSE && this.cameraControls.controls[u.DOLLHOUSE].resetRanges(),
  22113. this.mode = i,
  22114. this.emit(w.FlyingEnded, _, G, this.currentPano, H),
  22115. h && p !== u.PANORAMA && i === u.PANORAMA ? this.startWarp(b.Retain, E.Retain, x.BLACK, null, null, s) : (s && s(),
  22116. t.resolve())
  22117. }
  22118. .bind(this), I, V.FlyToNewMode),
  22119. this.mode = u.TRANSITIONING,
  22120. t.promise()
  22121. }
  22122. ,
  22123. n.prototype.fade360View = function(e, t, i) {
  22124. this.tagManager.hideShowTagsForBlackoutStyle(i.blackoutStyle, e),
  22125. $(this.domElement).fadeOut(.5 * e, function() {
  22126. this.model.skybox.material.uniforms.opacity.value = i.skyboxOpacity,
  22127. this.model.alpha = i.modelAlpha,
  22128. this.position.copy(t.position),
  22129. this.quaternion.copy(t.quaternion),
  22130. this.camera.projectionMatrix.copy(t.projectionMatrix),
  22131. $(this.domElement).fadeIn(.5 * e)
  22132. }
  22133. .bind(this))
  22134. }
  22135. ,
  22136. n.prototype.findDefaultViews = function() {
  22137. this.findDefaultView(this.lastInsideView, !0),
  22138. this.findDefaultView(this.last360View, !1)
  22139. }
  22140. ,
  22141. n.prototype.findDefaultView = function(e, t) {
  22142. var i, n = this.model.heroLocations, r = this.model.panos, o = n.findIndex(function(e) {
  22143. if (e.cameraMode !== u.PANORAMA)
  22144. return !1;
  22145. var i = r.get(e.panoId);
  22146. return i && i.isAligned() === t
  22147. });
  22148. o >= 0 ? (i = r.get(n[o].panoId),
  22149. e.update({
  22150. cameraMode: u.PANORAMA,
  22151. pano: i,
  22152. position: n[o].position,
  22153. quaternion: n[o].quaternion
  22154. })) : (o = r.list.findIndex(function(e) {
  22155. return e.isAligned() === t
  22156. }),
  22157. o >= 0 ? (i = r.list[o],
  22158. e.update({
  22159. cameraMode: u.PANORAMA,
  22160. pano: i,
  22161. position: i.position
  22162. })) : F.warn("There are no", t ? "inside" : "360º", "views in this model"))
  22163. }
  22164. ,
  22165. n.prototype.updateLastView = function() {
  22166. if (this.mode === u.PANORAMA) {
  22167. var e = this.currentPano.isAligned() ? this.lastInsideView : this.last360View;
  22168. e.update({
  22169. pano: this.currentPano,
  22170. position: this.position,
  22171. quaternion: this.quaternion
  22172. })
  22173. }
  22174. }
  22175. ,
  22176. n.prototype.goToLastView = function(e, t) {
  22177. var i = $.Deferred()
  22178. , n = i.resolve.bind(i)
  22179. , r = i.reject.bind(i)
  22180. , o = e ? this.lastInsideView : this.last360View;
  22181. return this.isInMode(u.PANORAMA) && this.currentPano.isAligned() !== e && this.updateLastView(),
  22182. this.isInMode(u.PANORAMA) ? (this.path && this.path.popOutCpm(),
  22183. this.fadeToView(e, o, f.show360Views.transitionTime, t).done(n).fail(r)) : this.isOutsideMode() && this.flyToNewMode({
  22184. mode: o.cameraMode,
  22185. pano: o.pano,
  22186. quaternion: o.quaternion,
  22187. callback: t
  22188. }).done(n).fail(r),
  22189. i.promise()
  22190. }
  22191. ,
  22192. n.prototype.fadeToView = function(e, t, i, n) {
  22193. var r = $.Deferred()
  22194. , o = r.resolve.bind(r)
  22195. , a = r.reject.bind(r);
  22196. if (!t.isValid() || t.cameraMode === u.PANORAMA && !t.pano)
  22197. return F.warn("Tried to fade to an illegal view", t.cameraMode),
  22198. a("Cannot go to illegal view"),
  22199. r.promise();
  22200. var s = (f[t.cameraMode],
  22201. function() {
  22202. $(this.domElement).fadeIn(.5 * i),
  22203. n && n(),
  22204. o()
  22205. }
  22206. .bind(this))
  22207. , l = e ? S.FADEIN : S.END;
  22208. return this.tagManager.hideShowTagsForBlackoutStyle(l, i),
  22209. $(this.domElement).fadeOut(.5 * i, function() {
  22210. this.model.fadePanoMarkers(e ? f.panorama.markerOpacity : 0),
  22211. t.cameraMode === u.PANORAMA ? this.flyToPano({
  22212. pano: t.pano,
  22213. lookAtPoint: d.FORWARD.clone().applyQuaternion(t.quaternion).add(t.pano.position),
  22214. duration: 0
  22215. }, s) : this.flyToNewMode({
  22216. mode: t.cameraMode,
  22217. quaternion: t.quaternion,
  22218. duration: 0,
  22219. callback: s
  22220. })
  22221. }
  22222. .bind(this)),
  22223. r.promise()
  22224. }
  22225. ,
  22226. n.prototype.startWarp = function(e, t, i, n, r, o) {
  22227. if (this.cameraControls.activeControl && (this.cameraControls.activeControl.enabled = !1),
  22228. this.flying)
  22229. return F.warn("Player.startWarp() -> Cannot warp when flying"),
  22230. o && o(),
  22231. !1;
  22232. null !== e && void 0 !== e || (e = b.Show),
  22233. this.history.invalidate(),
  22234. e !== b.Retain ? this.path.brushToWarpPano(i, x.BLACK) || (i = x.BLACK) : i = this.path.upcomingTransType;
  22235. var a = this.path.warpDestPano && !this.path.warpDestPano.isAligned();
  22236. return this.emit(w.WarpStarted, a, i, n, r),
  22237. n = n || S.MIDDLE,
  22238. this.path.warpToPano(i, n, r, function() {
  22239. t === E.Slow ? this.path.discardSlow() : t === E.Standard && this.path.discardPathObject(),
  22240. this.emit(w.WarpEnded, i),
  22241. this.cameraControls.activeControl && (this.cameraControls.activeControl.enabled = !0),
  22242. o && o()
  22243. }
  22244. .bind(this)),
  22245. e === b.Hide && this.path.discardPathObject(),
  22246. !0
  22247. }
  22248. ,
  22249. n.prototype.warpToPanoById = function(e, t, i, n, r, o, a, s) {
  22250. return this.path.setWarpDestinationByPanoId(e, t) ? this.startWarp(i, n, r, o, a, s) : (F.warn("Player.warpToPanoById() -> Could not setWarpDestinationByPanoId()"),
  22251. s && s(),
  22252. !1)
  22253. }
  22254. ,
  22255. n.prototype.warpToPanoByHeroIndex = function(e, t, i, n, r, o, a) {
  22256. return this.path.setWarpDestinationByHeroIndex(e) ? this.startWarp(t, i, n, r, o, a) : (F.warn("Player.warpToPanoByHeroIndex() -> Could not setWarpDestinationByHeroIndex()"),
  22257. a && a(),
  22258. !1)
  22259. }
  22260. ,
  22261. n.prototype.warpToPano = function(e, t, i, n, r, o, a, s) {
  22262. return this.warpToPanoById(e.id, t, i, n, r, o, a, s)
  22263. }
  22264. ,
  22265. n.prototype.warpToNonPanoByHeroIndex = function(e, t) {
  22266. return this.path.setWarpDestinationByHeroIndex(e) ? (this.path.warpToNonPano(t),
  22267. !0) : (F.warn("Player.warpToNonPanoByHeroIndex() -> Could not setWarpDestinationByHeroIndex()"),
  22268. t && t(),
  22269. !1)
  22270. }
  22271. ,
  22272. n.prototype.aimTourCamera = function(e, t, i, n) {
  22273. return F.debug("player.aimTourCamera(" + e + ") calling warpToPanoByHeroIndex(" + e + ")"),
  22274. this.warpToPanoByHeroIndex(e, t, i, null, null, null, n)
  22275. }
  22276. ,
  22277. n.prototype.showPathToHeroLocation = function(e) {
  22278. this.path.setWarpDestinationByHeroIndex(e) && this.path.brushToWarpPano(x.STD, x.BLACK)
  22279. }
  22280. ,
  22281. n.prototype.tourInterlude = function(e, t) {
  22282. this.history.invalidate();
  22283. this.path.discardSlow();
  22284. //xzw:
  22285. var a = g_data2.tourAudio && g_data2.tourAudio[this.model.heroLocations[this.director.currentItem].sid];
  22286. var rotTime = a && a.time;
  22287. this.path.waitNextStep(e, function() {
  22288. t && t()
  22289. }.bind(this), rotTime)
  22290. }
  22291. ,
  22292. n.prototype.stopInterlude = function() {
  22293. this.interruptAndFastForward(null, 0)
  22294. }
  22295. ,
  22296. n.prototype.interruptAndFastForward = function(e, t) {
  22297. this.isWarping() && this.emit(w.WarpInterrupted, this.path.activeTransType, e, t),
  22298. this.flying && this.emit(w.FlyingInterrupted),
  22299. this.path.interruptAndFastForward(e, t)
  22300. }
  22301. ,
  22302. n.prototype.setSize = function(e, t) {
  22303. var i = e / t;
  22304. this.baseFov = B.clampVFOV(f.insideFOV, f.insideFOVMax, e, t);
  22305. var n = B.getHFOVFromVFOV(f.insideFOV, e, t);
  22306. n > f.insideFOVMax ? this.baseFov = B.getVFOVFromHFOV(f.insideFOVMax, e, t) : this.baseFov = f.insideFOV;
  22307. for (var r in this.cameraControls.cameras) {
  22308. var o = this.cameraControls.cameras[r];
  22309. o.fov = this.baseFov * (1 / this.zoomLevel),
  22310. o.updateAspect(i)
  22311. }
  22312. }
  22313. ,
  22314. n.prototype.toJSON = function() {
  22315. var e = {};
  22316. return this.cameraControls.activeControl ? (e = this.cameraControls.activeControl.toJSON(),
  22317. e.camera_mode = u.toInt(this.mode),
  22318. this.isOutsideMode() ? this.model.allFloorsVisible ? e.floor_visibility = [] : e.floor_visibility = this.model.floors.list.map(function(e) {
  22319. return e.hidden ? 0 : 1
  22320. }) : u.PANORAMA && (e.scan_id = this.currentPano.id),
  22321. e) : e
  22322. }
  22323. ,
  22324. n.prototype.getCurrentNodePanos = function(e) {
  22325. this.model.panos.map;
  22326. if (e.length = 0,
  22327. this.path.nodes)
  22328. for (var t = 0; t < this.path.nodes.length; t++) {
  22329. var i = this.path.nodes[t];
  22330. e.push(this.model.panos.get(i))
  22331. }
  22332. }
  22333. ,
  22334. n.prototype.zoomIncrementally = function(e) {
  22335. var t = this.zoomLevel;
  22336. this.zoomTo(this.zoomLevel + e),
  22337. t !== this.zoomLevel && this.currentPano && this.zoomStats.addZoomAction(t, this.zoomLevel, this.currentPano.id)
  22338. }
  22339. ,
  22340. n.prototype.zoomInIncrementally = function(e) {
  22341. e = e || this.defaultZoomIncrement,
  22342. this.zoomIncrementally(e)
  22343. }
  22344. ,
  22345. n.prototype.zoomOutIncrementally = function(e) {
  22346. e = e || -this.defaultZoomIncrement,
  22347. this.zoomIncrementally(e)
  22348. }
  22349. ,
  22350. n.prototype.zoomBy = function(e) {
  22351. this.zoomTo(this.zoomLevel * e)
  22352. }
  22353. ,
  22354. n.prototype.zoomIn = function() {
  22355. this.zoomBy(1 + this.zoomSpeed)
  22356. }
  22357. ,
  22358. n.prototype.zoomOut = function() {
  22359. this.zoomBy(1 - this.zoomSpeed)
  22360. }
  22361. ,
  22362. n.prototype.zoomTo = function(e, t) {
  22363. if (t || f.zoom.enabled && this.mode === u.PANORAMA && this.zoomEnabled) {
  22364. if (e < f.zoom.min && (e = f.zoom.min),
  22365. e > f.zoom.max && (e = f.zoom.max),
  22366. e > this.zoomLevel ? (this.emit(O.ZoomIn),
  22367. e === f.zoom.max && this.emit(O.ZoomMax)) : e < this.zoomLevel && (this.emit(O.ZoomOut),
  22368. e === f.zoom.min && this.emit(O.ZoomMin)),
  22369. this.cameraControls.activeControl) {
  22370. var i = this.cameraControls.activeControl.camera;
  22371. this.zoomLevel = e,
  22372. i.fov = this.baseFov * (1 / this.zoomLevel),
  22373. i.updateProjectionMatrix(),
  22374. this.zoomFov = i.fov
  22375. }
  22376. }
  22377. }
  22378. ,
  22379. n.prototype.increaseZoomSpeed = function() {
  22380. this.zoomSpeed = this.clampZoomSpeed(this.zoomSpeed + this.zoomSpeedAdjust)
  22381. }
  22382. ,
  22383. n.prototype.decreaseZoomSpeed = function() {
  22384. this.zoomSpeed = this.clampZoomSpeed(this.zoomSpeed - this.zoomSpeedAdjust)
  22385. }
  22386. ,
  22387. n.prototype.clampZoomSpeed = function(e) {
  22388. return e < 0 ? 0 : e
  22389. }
  22390. ,
  22391. n.prototype.activatePersistentZooming = function(e) {
  22392. this.zooming = e ? 1 : -1
  22393. }
  22394. ,
  22395. n.prototype.deactivatePersistentZooming = function() {
  22396. this.zooming = 0
  22397. }
  22398. ,
  22399. n.prototype.zoomDefault = function() {
  22400. this.zoomTo(1, !0)
  22401. }
  22402. ,
  22403. n.prototype.smoothZoomToDefault = function(e, t) {
  22404. var i, n = this.zoomLevel, r = function(e) {
  22405. e > 1 && (e = 1),
  22406. i = n * (1 - e) + e,
  22407. this.zoomTo(i, !0)
  22408. }
  22409. .bind(this), o = function() {
  22410. this.zoomDefault(),
  22411. t && window.setTimeout(t, 50)
  22412. }
  22413. .bind(this);
  22414. y.start(r, e, o, null, 0, A[f.transition.blendEasing])
  22415. }
  22416. ,
  22417. n.prototype.updateZoomPano = function() {
  22418. if (!this.panoRenderer.zoomPanoRenderingDisabled && this.mode === u.PANORAMA) {
  22419. var e = this.currentPano;
  22420. if (e) {
  22421. var t = this.zoomLevel > f.zoom.activationThreshold
  22422. , i = this.flying && this.nextPano && this.nextPano !== this.currentPano
  22423. , n = !i && !this.isWarping()
  22424. , r = t && n;
  22425. this.tileDownloader.tilePrioritizer.setZoomingActive(r),
  22426. this.panoRenderer.setZoomingActive(r, e, !0);
  22427. var o = function(e, t) {
  22428. this.panoRenderer.resetRenderStatus(e.id, !1, !0, this.qualityManager.getMaxNavPanoSize()),
  22429. this.panoRenderer.clearAllQueuedUploadsForPano(e.id),
  22430. this.panoRenderer.renderPanoTiles(e.id, null, !1, !1),
  22431. e.setZoomed(t)
  22432. }
  22433. .bind(this);
  22434. r && !e.zoomed ? (o(e, !0),
  22435. this.panoRenderer.enableUltraHighQualityMode(function() {
  22436. this.qualityManager.useUltraHighResolutionPanos && !f.zoom.overridemax && (f.zoom.max = D.ultraHighQualityMaxZoom),
  22437. r && o(e, !0)
  22438. }
  22439. .bind(this))) : !t && e.zoomed && o(e, !1)
  22440. }
  22441. }
  22442. }
  22443. ,
  22444. t.exports = n
  22445. }
  22446. ).call(this, "/js/player.js")
  22447. }
  22448. , {
  22449. "./constants": 8,
  22450. "./enum/AlignmentType": 17,
  22451. "./enum/BlackoutStyle": 18,
  22452. "./enum/ControlEvents": 21,
  22453. "./enum/Keys": 30,
  22454. "./enum/ModelManagerEvents": 33,
  22455. "./enum/PanoSizeClass": 36,
  22456. "./enum/PanoramaEvents": 37,
  22457. "./enum/PathDiscardMode": 38,
  22458. "./enum/PathDisplayMode": 39,
  22459. "./enum/PlayerEvents": 40,
  22460. "./enum/TagStates": 44,
  22461. "./enum/Vectors": 50,
  22462. "./enum/Viewmode": 51,
  22463. "./enum/WarpStyle": 52,
  22464. "./enum/ZoomEvents": 53,
  22465. "./exception/BasicException": 55,
  22466. "./model/ModelManager": 140,
  22467. "./objects/NSpider": 147,
  22468. "./objects/Panorama": 148,
  22469. "./objects/Reticule": 149,
  22470. "./objects/ShowPath": 151,
  22471. "./objects/Snapshot": 153,
  22472. "./objects/View": 154,
  22473. "./settings": 166,
  22474. "./shaders": 167,
  22475. "./tile/TileDownloader": 171,
  22476. "./tile/TilePrioritizer": 172,
  22477. "./util/ZoomStats": 179,
  22478. "./util/browser": 182,
  22479. "./util/camera": 183,
  22480. "./util/cameraLight": 184,
  22481. "./util/common": 185,
  22482. "./util/easing": 186,
  22483. "./util/history": 187,
  22484. "./util/lerp": 188,
  22485. "./util/logger": 189,
  22486. "./util/math": 190,
  22487. "./util/transitions": 195,
  22488. "hot":"hot",
  22489. "scaleImg":"scaleImg",
  22490. events: 202,
  22491. three: 217
  22492. }],
  22493. "scaleImg":[function(t, e){// xzw
  22494. var OUTPUT = e;
  22495. (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")}
  22496. function n(t){if(t){var e,a=G.getImageData(0,0,s,f),i=a.data;for(e=0;at>e;e+=4)
  22497. 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}
  22498. return G.getImageData(0,0,s,f)}
  22499. 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}
  22500. a||(a=t.input,i=t.output,r=t.inputRemovable,t.scale&&(t=t.scale));var u,d;if(a.src)
  22501. if(u=document.createElement("canvas"),null!=a.naturalWidth)
  22502. 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}
  22503. else
  22504. 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)
  22505. 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)
  22506. for(h(),J=n(),K=J.data,x=0;f>x;x++)
  22507. 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)
  22508. 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)
  22509. W=new Float32Array(at);else
  22510. for(W=[],et=0;at>et;++et)
  22511. W[et]=0;for(b=0;w>b;b++)
  22512. 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)
  22513. 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;}
  22514. delete p,h(),J=n(W)}
  22515. 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}
  22516. if("png-src"===i||"jpeg-src"===i)
  22517. return B.toDataURL("image/"+i.split("-")[0],0.85)}
  22518. return B}
  22519. var e=this;"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=t),exports.scale=t):c=t}).call(this);
  22520. OUTPUT.exports = c;
  22521. }, {}
  22522. ],
  22523. 156: [function(e, t, i) {
  22524. (function(i) {
  22525. "use strict";
  22526. function n(e, t) {
  22527. this.model = e,
  22528. this.panos = e.panos,
  22529. this.player = t,
  22530. this.imagePanos = this.listImagePanos(),
  22531. this.retryMinimumTime = 1e4
  22532. }
  22533. var r = (e("three"),
  22534. e("./enum/Viewmode"))
  22535. , o = (e("./settings"),
  22536. e("./objects/Panorama"))
  22537. , a = e("./util/logger")
  22538. , s = new a(i);
  22539. n.prototype.start = function() {
  22540. this.loadNextPano(function(e) {
  22541. e ? this.start() : (s.debug("No suitable pano loaded, waiting a little while before looking again"),
  22542. setTimeout(function() {
  22543. this.start()
  22544. }
  22545. .bind(this), 1e3))
  22546. }
  22547. .bind(this))
  22548. }
  22549. ,
  22550. n.prototype.validLoadTarget = function(e) {
  22551. return e && !e.isLoaded("high") && Date.now() - e.failedLoadingAt > this.retryMinimumTime
  22552. }
  22553. ,
  22554. n.prototype.listImagePanos = function() {
  22555. var e = []
  22556. , t = this;
  22557. return this.model.images.forEach(function(i) {
  22558. if (i.metadata && i.metadata.scan_id) {
  22559. var n = t.model.panos.get(i.metadata.scan_id);
  22560. n && !n.isLoaded("high") && e.push(n)
  22561. }
  22562. }),
  22563. e
  22564. }
  22565. ,
  22566. n.prototype.nextNotLoadedImage = function() {
  22567. for (; this.imagePanos.length > 0; ) {
  22568. var e = this.imagePanos[0];
  22569. if (!e.isLoaded("high"))
  22570. return e;
  22571. this.imagePanos.shift()
  22572. }
  22573. return null
  22574. }
  22575. ,
  22576. n.prototype.loadNextPano = function(e) {
  22577. var t, i, n = this.model.waitQueue.filter(function(e) {
  22578. return e.object instanceof o
  22579. });
  22580. n.length > 0 ? (t = n[0].object,
  22581. s.debug("Overrode pano selection: Flying to an unloaded pano " + t.id)) : this.validLoadTarget(this.player.currentPano) ? (t = this.player.currentPano,
  22582. s.debug("Overrode pano selection: Currently at an unloaded pano " + t.id)) : this.validLoadTarget(this.player.closestPano) ? (t = this.player.closestPano,
  22583. s.debug("Overrode pano selection: Hovering over an unloaded pano " + t.id)) : this.validLoadTarget(this.nextNotLoadedImage()) ? (i = "high",
  22584. t = this.imagePanos[0],
  22585. 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())]),
  22586. t && s.debug("Normal pano selection: neighbor " + t.id)),
  22587. t ? (i = i || t.isLoaded("low") ? "high" : "low",
  22588. s.debug("Preloading " + i + "-res pano " + t.id),
  22589. t.loadCube(i).done(e).fail(function() {
  22590. s.warn("Failed preloading pano", t.id, ", marking it as failed and forgetting it for a while"),
  22591. e()
  22592. })) : e && e(null)
  22593. }
  22594. ,
  22595. t.exports = n
  22596. }
  22597. ).call(this, "/js/preloaders.js")
  22598. }
  22599. , {
  22600. "./enum/Viewmode": 51,
  22601. "./objects/Panorama": 148,
  22602. "./settings": 166,
  22603. "./util/logger": 189,
  22604. three: 217
  22605. }],
  22606. 157: [function(e, t, i) {
  22607. (function(i) {
  22608. "use strict";
  22609. function n(e, t, i, n, r) {
  22610. this.qualityManager = e,
  22611. this.scene = t,
  22612. this.camera = i,
  22613. this.container = r,
  22614. this.controls = n,
  22615. this.controls.enabled = !0,
  22616. this.controls.locked = !0,
  22617. this.quickstartCamera = n.camera,
  22618. this.quickstartCamera.fov = h.clampVFOV(a.insideFOV, a.insideFOVMax, $("#player").width(), $("#player").height()),
  22619. this.skybox = null
  22620. }
  22621. var r = e("three")
  22622. , o = e("../util/logger")
  22623. , a = e("../constants")
  22624. , s = (e("../util/transitions"),
  22625. e("../util/lerp"),
  22626. e("../util/easing"),
  22627. e("../enum/Vectors"))
  22628. , l = e("../enum/PanoSizeClass")
  22629. , c = (e("../materials/ModelTextureMaterial"),
  22630. e("../materials/CubemapMaterial"))
  22631. , h = (e("../cameras/PanoramaCamera"),
  22632. e("../controls/PanoramaControls"),
  22633. e("../tile/TileUtils"),
  22634. e("../util/camera"),
  22635. e("../util/cameraLight"))
  22636. , u = (e("../util/browser"),
  22637. e("../settings"),
  22638. e("../gui/helpManager"),
  22639. new o(i));
  22640. n.prototype.load = function(e) {
  22641. e.pano.shouldRedrawOnBaseLoaded = !0;
  22642. var t, i, n = this, r = s.FORWARD.clone().applyQuaternion(e.quaternion), o = r.clone().negate();
  22643. this.controls.lookAt(r.add(this.quickstartCamera.position));
  22644. var a = this.qualityManager.getPanoSize(l.BASE)
  22645. , c = this.qualityManager.getPanoSize(l.STANDARD);
  22646. if (e.pano.tiled) {
  22647. u.warn("Loading startPano, TILED", e.pano.id);
  22648. var d = h.getHFOVForCamera(this.quickstartCamera, $("#player").width(), $("#player").height())
  22649. , p = this.quickstartCamera.fov;
  22650. u.warn("Quickstart loading tiles in frustum: [horizontal FOV: " + d + ", vertical FOV: " + p + "]"),
  22651. t = e.pano.loadTiledPano(c, r, {
  22652. hFov: d,
  22653. vFov: p
  22654. }, !1, !1, !0),
  22655. i = e.pano.loadTiledPano(a, o, null, !1, !1, !0)
  22656. } else
  22657. u.warn("Loading startPano", e.pano.id),
  22658. t = e.pano.loadCube("high");
  22659. return $.when(t).then(function() {
  22660. n.init(e.pano, e.quaternion),
  22661. e.pano.tiled ? i.done(function() {
  22662. e.pano.lockUntilRenderingComplete = !1,
  22663. this.controls.locked = !1
  22664. }
  22665. .bind(this)) : this.controls.locked = !1
  22666. }
  22667. .bind(this))
  22668. }
  22669. ,
  22670. n.prototype.init = function(e, t) {
  22671. u.info("Quickstart done loading, adding scene objects"),
  22672. e.lockUntilRenderingComplete = !0,
  22673. this.skybox = new r.Mesh(new r.CubeGeometry(1,1,1),new c({
  22674. side: r.BackSide
  22675. })),
  22676. this.skybox.material.uniforms.map.value = e.getSkyboxTexture(),
  22677. this.skybox.quaternion.copy(e.quaternion),
  22678. this.scene.add(this.skybox),
  22679. $(this.container).show()
  22680. }
  22681. ,
  22682. n.prototype.update = function(e) {
  22683. this.controls.update(e),
  22684. this.camera.copy(this.quickstartCamera)
  22685. }
  22686. ,
  22687. n.prototype.setSize = function(e, t) {
  22688. this.quickstartCamera.updateAspect(e / t)
  22689. }
  22690. ,
  22691. n.prototype.destroy = function() {
  22692. this.scene.remove(this.skybox)
  22693. }
  22694. ,
  22695. t.exports = n
  22696. }
  22697. ).call(this, "/js/scene/QuickstartManager.js")
  22698. }
  22699. , {
  22700. "../cameras/PanoramaCamera": 7,
  22701. "../constants": 8,
  22702. "../controls/PanoramaControls": 13,
  22703. "../enum/PanoSizeClass": 36,
  22704. "../enum/Vectors": 50,
  22705. "../gui/helpManager": 68,
  22706. "../materials/CubemapMaterial": 117,
  22707. "../materials/ModelTextureMaterial": 118,
  22708. "../settings": 166,
  22709. "../tile/TileUtils": 174,
  22710. "../util/browser": 182,
  22711. "../util/camera": 183,
  22712. "../util/cameraLight": 184,
  22713. "../util/easing": 186,
  22714. "../util/lerp": 188,
  22715. "../util/logger": 189,
  22716. "../util/transitions": 195,
  22717. three: 217
  22718. }],
  22719. 158: [function(e, t, i) {
  22720. "use strict";
  22721. function n(e, t, i) {
  22722. this.scene = e,
  22723. this.camera = t,
  22724. this.renderer = null,
  22725. this.effects = i,
  22726. this.animateCallback = null,
  22727. this.composer = null,
  22728. this.qualityManager = null,
  22729. e.renderWidth = 0,
  22730. e.renderHeight = 0,
  22731. this.updateClock = new r.Clock,
  22732. this.components = [],
  22733. this.updateListeners = [],
  22734. this.resizeListeners = [],
  22735. this.forceUpdateSize = !1,
  22736. this.started = !1,
  22737. this.textures = {},
  22738. this.suspendedObjects = []
  22739. }
  22740. var r = e("three")
  22741. , o = e("../shaders")
  22742. , a = e("../enum/SceneRendererEvents")
  22743. , s = e("../enum/GLTextureType")
  22744. , l = e("../enum/GLCubeFaces")
  22745. , c = e("../exception/BasicException")
  22746. , h = e("../exception/RendererCreationException")
  22747. , u = e("../settings")
  22748. , d = e("events").EventEmitter;
  22749. window.requestAnimationFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame,
  22750. n.prototype = Object.create(d.prototype),
  22751. n.prototype.addComponent = function(e) {
  22752. this.components.push(e),
  22753. e.update && this.updateListeners.push(e),
  22754. e.setSize && (this.resizeListeners.push(e),
  22755. this.forceUpdateSize = !0)
  22756. }
  22757. ,
  22758. n.prototype.removeComponent = function(e) {
  22759. var t = function(t) {
  22760. return t !== e
  22761. };
  22762. this.components = this.components.filter(t),
  22763. this.updateListeners = this.updateListeners.filter(t),
  22764. this.resizeListeners = this.resizeListeners.filter(t)
  22765. }
  22766. ,
  22767. n.prototype.start = function(e) {
  22768. if (this.started)
  22769. throw new c("Can't start SceneRenderer, already started");
  22770. this.createContext(e),
  22771. this.initComposer(),
  22772. this.started = !0,
  22773. (p = p.bind(this))()
  22774. }
  22775. ,
  22776. n.prototype.createContext = function(e) {
  22777. try {
  22778. this.renderer = new r.WebGLRenderer,
  22779. this.renderer.autoClear = !0,
  22780. this.renderer.setPixelRatio(window.devicePixelRatio ? window.devicePixelRatio : 1),
  22781. this.renderer.setSize($("#player").width(), $("#player").height(), false), //改
  22782. this.emit(a.ContextCreated)
  22783. } catch (e) {
  22784. throw new h("Unable to create a WebGL rendering context")
  22785. }
  22786. u.profiling.enabled && this.overrideTextures(),
  22787. e.appendChild(this.renderer.domElement)
  22788. }
  22789. ,
  22790. n.prototype.overrideTextures = function() {
  22791. var e = this.renderer.context
  22792. , t = 0
  22793. , i = e.createTexture;
  22794. e.createTexture = function() {
  22795. var n = i.call(e);
  22796. return n.id = t++,
  22797. this.textures[n.id] = n,
  22798. n
  22799. }
  22800. .bind(this);
  22801. var n = e.texImage2D;
  22802. e.texImage2D = function(t, i, r, o, a, l, c, h, u) {
  22803. var d, p = this.getTextureTypeFromTarget(e, t);
  22804. d = p === s.TextureCube ? e.getParameter(e.TEXTURE_BINDING_CUBE_MAP) : e.getParameter(e.TEXTURE_BINDING_2D),
  22805. void 0 !== c ? n.call(e, t, i, r, o, a, l, c, h, u) : (c = o,
  22806. h = a,
  22807. u = l,
  22808. o = u.naturalWidth,
  22809. a = u.naturalHeight,
  22810. n.call(e, t, i, r, c, h, u));
  22811. var f = this.textures[d.id];
  22812. f.width = p === s.TextureCube ? 6 * o : o,
  22813. f.height = a
  22814. }
  22815. .bind(this);
  22816. var r = e.deleteTexture;
  22817. e.deleteTexture = function(t) {
  22818. delete this.textures[t.id],
  22819. r.call(e, t)
  22820. }
  22821. .bind(this)
  22822. }
  22823. ,
  22824. n.prototype.updateTextureMemory = function() {
  22825. var e = null;
  22826. return function() {
  22827. var t = 0;
  22828. for (var i in this.textures) {
  22829. var n = this.textures[i];
  22830. n.width && n.height && (t += n.width * n.height * 4)
  22831. }
  22832. t !== e && this.emit(a.MemoryUsageUpdated, t),
  22833. e = t
  22834. }
  22835. }(),
  22836. n.prototype.getTextureTypeFromTarget = function(e, t) {
  22837. switch (t) {
  22838. case e.TEXTURE_CUBE_MAP_POSITIVE_X:
  22839. case e.TEXTURE_CUBE_MAP_NEGATIVE_X:
  22840. case e.TEXTURE_CUBE_MAP_POSITIVE_Y:
  22841. case e.TEXTURE_CUBE_MAP_NEGATIVE_Y:
  22842. case e.TEXTURE_CUBE_MAP_POSITIVE_Z:
  22843. case e.TEXTURE_CUBE_MAP_NEGATIVE_Z:
  22844. return s.TextureCube;
  22845. case e.TEXTURE_2D:
  22846. return s.Texture2D;
  22847. default:
  22848. return null
  22849. }
  22850. }
  22851. ,
  22852. n.prototype.initComposer = function() {
  22853. this.composer = new r.EffectComposer(this.renderer),
  22854. this.composer.addPass(new r.RenderPass(this.scene,this.camera)),
  22855. this.composer.addPass(this.effects.hblurPass),
  22856. this.composer.addPass(this.effects.vblurPass)
  22857. }
  22858. ,
  22859. n.prototype.setSize = function(e, t, devicePixelRatio) {
  22860. this.renderWidth = e,
  22861. this.renderHeight = t,
  22862. this.effects.aspect = e / t,
  22863. /* this.renderer.setSize(e, t), -----MP */
  22864. this.renderer.setSize(e, t, false, devicePixelRatio), //改 为了防止给canvas设置宽高
  22865. this.composer.setSize(e, t);
  22866. for (var i = 0; i < this.resizeListeners.length; i++)
  22867. this.resizeListeners[i].setSize(e, t)
  22868. }
  22869. ,
  22870. n.prototype.render = function() {
  22871. this.effects.currentBlur > 0 ? this.composer.render() : this.renderer.render(this.scene, this.camera)
  22872. }
  22873. ,
  22874. n.prototype.updateScreenSize = function() {//xzw 改 为了截屏 要改canvas大小 以及缩放时不模糊
  22875. var W,H;//当截屏时有setTimeout 期间不能恢复大小,所以要用W,H记录正常大小
  22876. return function(o){
  22877. var render = false;
  22878. var ratio;
  22879. var w, h; //记录应当render的大小
  22880. if(o && !o.resize && o.width!= void 0 && o.height!= void 0){
  22881. w = o.width, h = o.height, render = true, ratio=1;
  22882. }else{
  22883. w = $('#player').width();
  22884. h = $('#player').height();
  22885. o && o.resize && (W = this.renderWidth, H = this.renderHeight);
  22886. (w !== W || h !== H || this.forceUpdateSize) &&
  22887. (W = w, H = h, render = true, ratio = window.devicePixelRatio);
  22888. }
  22889. if(render){
  22890. this.setSize(w, h, ratio);
  22891. this.forceUpdateSize = !1
  22892. }
  22893. }
  22894. }()
  22895. ,
  22896. n.prototype.updateComponents = function() {
  22897. for (var e = Math.min(1, this.updateClock.getDelta()), t = 0; t < this.updateListeners.length; t++)
  22898. this.updateListeners[t].update(e)
  22899. }
  22900. ,
  22901. n.prototype.suspend = function() {
  22902. this.started = !1,
  22903. this.suspendedObjects = this.scene.children.map(function(e) {
  22904. return this.scene.remove(e),
  22905. e
  22906. }
  22907. .bind(this)),
  22908. this.render()
  22909. }
  22910. ,
  22911. n.prototype.resume = function() {
  22912. this.suspendedObjects.forEach(function(e) {
  22913. this.scene.add(e)
  22914. }
  22915. .bind(this)),
  22916. this.suspendedObjects = [],
  22917. this.started = !0,
  22918. p()
  22919. }
  22920. ;
  22921. var p = function() {
  22922. this.started && (window.requestAnimationFrame(p),
  22923. this.updateComponents(),
  22924. this.updateTextureMemory(),
  22925. this.render(),
  22926. this.emit(a.AfterRender))
  22927. };
  22928. n.prototype.getImageData = function() {
  22929. var e = document.createElement("canvas")
  22930. , t = e.getContext("2d");
  22931. return function(i, n, r) {
  22932. return e.width === n && e.height === r || (e.width = n,
  22933. e.height = r),
  22934. t.drawImage(i, 0, 0, n, r),
  22935. t.getImageData(0, 0, n, r)
  22936. }
  22937. }(),
  22938. n.prototype.initSizedTexture2D = function(e, t, i) {
  22939. var n = this.renderer
  22940. , o = n.context
  22941. , a = n.state
  22942. , s = new r.Texture(null);
  22943. s.flipY = !1,
  22944. i !== !0 && (i = !1),
  22945. s.generateMipmaps = i;
  22946. var l = n.paramThreeToGL(s.format)
  22947. , c = n.paramThreeToGL(s.type)
  22948. , h = n.properties.get(s)
  22949. , u = o.createTexture();
  22950. a.bindTexture(o.TEXTURE_2D, u),
  22951. o.pixelStorei(o.UNPACK_FLIP_Y_WEBGL, s.flipY),
  22952. o.texImage2D(o.TEXTURE_2D, 0, l, e, e, 0, l, c, null),
  22953. s.wrapS = t,
  22954. s.wrapT = t;
  22955. var d = n.paramThreeToGL(t);
  22956. return o.texParameteri(o.TEXTURE_2D, o.TEXTURE_WRAP_S, d),
  22957. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_WRAP_T, d),
  22958. i ? (s.magFilter = r.LinearFilter,
  22959. s.minFilter = r.LinearMipMapLinearFilter,
  22960. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_MAG_FILTER, o.LINEAR),
  22961. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_MIN_FILTER, o.LINEAR_MIPMAP_NEAREST),
  22962. o.generateMipmap(o.TEXTURE_2D)) : (s.magFilter = r.LinearFilter,
  22963. s.minFilter = r.LinearFilter,
  22964. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_MAG_FILTER, o.LINEAR),
  22965. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_MIN_FILTER, o.LINEAR)),
  22966. a.bindTexture(o.TEXTURE_2D, null),
  22967. h.__webglTexture = u,
  22968. s
  22969. }
  22970. ,
  22971. n.prototype.initSizedCubeMap = function(e, t) {
  22972. var i = this.renderer
  22973. , n = i.context
  22974. , o = i.state
  22975. , a = new r.CubeTexture([null, null, null, null, null, null]);
  22976. a.flipY = !1,
  22977. a.generateMipmaps = t;
  22978. var s = i.paramThreeToGL(a.format)
  22979. , l = i.paramThreeToGL(a.type)
  22980. , c = i.properties.get(a)
  22981. , h = n.createTexture();
  22982. o.bindTexture(n.TEXTURE_CUBE_MAP, h),
  22983. n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL, a.flipY);
  22984. for (var u = 0; u < 6; u++)
  22985. n.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X + u, 0, s, e, e, 0, s, l, null);
  22986. return t ? (a.magFilter = r.LinearFilter,
  22987. a.minFilter = r.LinearMipMapLinearFilter,
  22988. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MAG_FILTER, n.LINEAR),
  22989. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MIN_FILTER, n.LINEAR_MIPMAP_LINEAR),
  22990. n.texParameteri(n.TEXTURE_CUBE_MAP, n.GENERATE_MIPMAP, n.TRUE),
  22991. n.generateMipmap(n.TEXTURE_CUBE_MAP)) : (a.magFilter = r.LinearFilter,
  22992. a.minFilter = r.LinearFilter,
  22993. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MAG_FILTER, n.LINEAR),
  22994. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MIN_FILTER, n.LINEAR)),
  22995. o.bindTexture(n.TEXTURE_CUBE_MAP, null),
  22996. c.__image__webglTextureCube = h,
  22997. a
  22998. }
  22999. ,
  23000. n.prototype.deallocateCubeTexture = function(e) {
  23001. var t = this.renderer
  23002. , i = t.context
  23003. , n = t.properties.get(e);
  23004. i.deleteTexture(n.__image__webglTextureCube)
  23005. }
  23006. ,
  23007. n.prototype.uploadTexture2D = function(e, t, i, n, r, o) {
  23008. var a = this.renderer
  23009. , s = a.context
  23010. , l = a.state
  23011. , c = a.properties.get(t);
  23012. l.bindTexture(s.TEXTURE_2D, c.__webglTexture),
  23013. s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL, t.flipY),
  23014. s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL, t.premultiplyAlpha),
  23015. s.pixelStorei(s.UNPACK_ALIGNMENT, t.unpackAlignment),
  23016. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_WRAP_S, a.paramThreeToGL(t.wrapS)),
  23017. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_WRAP_T, a.paramThreeToGL(t.wrapT)),
  23018. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_MAG_FILTER, a.paramThreeToGL(t.magFilter)),
  23019. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_MIN_FILTER, a.paramThreeToGL(t.minFilter)),
  23020. s.texSubImage2D(s.TEXTURE_2D, 0, i, n, s.RGBA, s.UNSIGNED_BYTE, e),
  23021. t.generateMipmaps && s.generateMipmap(s.TEXTURE_2D),
  23022. l.bindTexture(s.TEXTURE_2D, null)
  23023. }
  23024. ,
  23025. n.prototype.uploadTexture3D = function(e, t, i, n, r, o, a) {
  23026. var s = this.renderer
  23027. , l = s.context
  23028. , c = s.state
  23029. , h = s.properties.get(t);
  23030. c.bindTexture(l.TEXTURE_CUBE_MAP, h.__image__webglTextureCube),
  23031. l.pixelStorei(l.UNPACK_FLIP_Y_WEBGL, t.flipY),
  23032. l.texSubImage2D(r, 0, i, n, l.RGBA, l.UNSIGNED_BYTE, e),
  23033. t.generateMipmaps && l.generateMipmap(l.TEXTURE_CUBE_MAP),
  23034. c.bindTexture(l.TEXTURE_CUBE_MAP, null)
  23035. }
  23036. ,
  23037. n.prototype.rebuildMipMaps2D = function(e) {
  23038. var t = this.renderer
  23039. , i = t.context
  23040. , n = t.state;
  23041. t.properties.get(e);
  23042. i.generateMipmap(i.TEXTURE_2D),
  23043. n.bindTexture(i.TEXTURE_2D, null)
  23044. }
  23045. ,
  23046. n.prototype.rebuildMipMaps3D = function(e) {
  23047. var t = this.renderer
  23048. , i = t.context
  23049. , n = t.state
  23050. , r = t.properties.get(e);
  23051. n.bindTexture(i.TEXTURE_CUBE_MAP, r.__image__webglTextureCube),
  23052. i.generateMipmap(i.TEXTURE_CUBE_MAP),
  23053. n.bindTexture(i.TEXTURE_CUBE_MAP, null)
  23054. }
  23055. ,
  23056. n.prototype.renderToCubeMap = function() {
  23057. var e = !1
  23058. , t = null
  23059. , i = null
  23060. , n = null
  23061. , a = null
  23062. , s = null
  23063. , l = 1;
  23064. return function(c, h, u, d, p, f, g, m, v, A, y, C, I, E, b, w) {
  23065. var _ = this.renderer;
  23066. _.context;
  23067. e || (i = new r.OrthographicCamera(l / -2,l / 2,l / 2,l / -2,-200,200),
  23068. i.position.z = 150,
  23069. t = new r.Scene,
  23070. t.add(i),
  23071. n = new r.ShaderMaterial({
  23072. uniforms: {
  23073. tDiffuse: {
  23074. type: "t",
  23075. value: null
  23076. },
  23077. alpha: {
  23078. type: "f",
  23079. value: 1
  23080. }
  23081. },
  23082. vertexShader: o.basicTextured.vertexShader,
  23083. fragmentShader: o.basicTextured.fragmentShader,
  23084. depthWrite: !1,
  23085. depthTest: !1,
  23086. side: r.DoubleSide
  23087. }),
  23088. a = new r.PlaneBufferGeometry(l,l),
  23089. s = new r.Mesh(a,n),
  23090. s.position.z = 0,
  23091. t.add(s),
  23092. e = !0);
  23093. var T = a.getAttribute("uv");
  23094. T.setDynamic(!0),
  23095. T.needsUpdate = !0;
  23096. var x = T.array
  23097. , S = p / u
  23098. , M = f / d
  23099. , R = g / u
  23100. , P = m / d;
  23101. x[0] = S,
  23102. x[1] = M + P,
  23103. x[2] = S + R,
  23104. x[3] = M + P,
  23105. x[4] = S,
  23106. x[5] = M,
  23107. x[6] = S + R,
  23108. x[7] = M;
  23109. var O = a.getAttribute("position");
  23110. O.setDynamic(!0),
  23111. O.needsUpdate = !0;
  23112. var L = O.array
  23113. , D = v / h.width - l / 2
  23114. , N = A / h.height - l / 2
  23115. , B = y / h.width
  23116. , F = C / h.height;
  23117. L[0] = D,
  23118. L[1] = N + F,
  23119. L[3] = D + B,
  23120. L[4] = N + F,
  23121. L[6] = D,
  23122. L[7] = N,
  23123. L[9] = D + B,
  23124. L[10] = N;
  23125. this.renderer.properties.get(c);
  23126. n.uniforms.tDiffuse.value = c,
  23127. n.blending = E || r.NoBlending,
  23128. n.transparent = !!b,
  23129. void 0 !== w && null !== w || (w = 1),
  23130. n.uniforms.alpha.value = w,
  23131. n.needUpdate = !0,
  23132. h.activeCubeFace = I,
  23133. h.viewport.set(0, 0, h.width, h.height);
  23134. var V = this.renderer.autoClear;
  23135. this.renderer.autoClear = !1,
  23136. this.renderer.render(t, i, h, !1),
  23137. this.renderer.autoClear = V
  23138. }
  23139. }(),
  23140. n.prototype.copyCubeMap = function() {
  23141. var e = !1
  23142. , t = null
  23143. , i = null
  23144. , a = null
  23145. , s = null
  23146. , l = null
  23147. , c = new r.Euler;
  23148. new r.Vector3;
  23149. return function(h, u, d, p, f, g, m, v, A) {
  23150. this.renderer;
  23151. if (!e) {
  23152. var y = 2;
  23153. i = new r.OrthographicCamera(y / -2,y / 2,y / 2,y / -2,0,200),
  23154. i.position.set(0, 0, 0),
  23155. t = new r.Scene,
  23156. t.add(i),
  23157. a = new r.ShaderMaterial({
  23158. uniforms: {
  23159. tDiffuse: {
  23160. type: "t",
  23161. value: null
  23162. },
  23163. alpha: {
  23164. type: "f",
  23165. value: 1
  23166. }
  23167. },
  23168. vertexShader: o.copyCubeMap.vertexShader,
  23169. fragmentShader: o.copyCubeMap.fragmentShader,
  23170. depthWrite: !1,
  23171. depthTest: !1,
  23172. side: r.DoubleSide
  23173. }),
  23174. s = new r.BoxGeometry(y,y,y),
  23175. l = new r.Mesh(s,a),
  23176. t.add(l),
  23177. e = !0
  23178. }
  23179. for (var C = 0; C < 6; C++)
  23180. n.getCubeOrientationForCubeFace(C, c),
  23181. l.rotation.copy(c),
  23182. l.matrixWorldNeedsUpdate = !0,
  23183. l.updateMatrixWorld(),
  23184. a.uniforms.tDiffuse.value = h,
  23185. a.blending = m || r.NoBlending,
  23186. a.transparent = !!v,
  23187. void 0 !== A && null !== A || (A = 1),
  23188. a.uniforms.alpha.value = A,
  23189. a.needUpdate = !0,
  23190. u.activeCubeFace = C,
  23191. u.viewport.set(0, 0, f, g),
  23192. this.renderer.render(t, i, u, !1)
  23193. }
  23194. }(),
  23195. n.getLookAtForCubeFace = function(e, t) {
  23196. switch (e) {
  23197. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  23198. t.set(1, 0, 0);
  23199. break;
  23200. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  23201. t.set(-1, 0, 0);
  23202. break;
  23203. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  23204. t.set(0, 1, 0);
  23205. break;
  23206. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  23207. t.set(0, -1, 0);
  23208. break;
  23209. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  23210. t.set(0, 0, 1);
  23211. break;
  23212. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  23213. t.set(0, 0, -1)
  23214. }
  23215. }
  23216. ,
  23217. n.getCubeOrientationForCubeFace = function(e, t) {
  23218. switch (e) {
  23219. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  23220. t.set(0, -Math.PI / 2, 0);
  23221. break;
  23222. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  23223. t.set(0, Math.PI / 2, 0);
  23224. break;
  23225. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  23226. t.set(Math.PI / 2, Math.PI, 0);
  23227. break;
  23228. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  23229. t.set(-Math.PI / 2, Math.PI, 0);
  23230. break;
  23231. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  23232. t.set(0, -Math.PI, 0);
  23233. break;
  23234. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  23235. t.set(0, 0, 0)
  23236. }
  23237. }
  23238. ,
  23239. t.exports = n
  23240. }
  23241. , {
  23242. "../enum/GLCubeFaces": 25,
  23243. "../enum/GLTextureType": 26,
  23244. "../enum/SceneRendererEvents": 43,
  23245. "../exception/BasicException": 55,
  23246. "../exception/RendererCreationException": 57,
  23247. "../settings": 166,
  23248. "../shaders": 167,
  23249. events: 202,
  23250. three: 217
  23251. }],
  23252. 159: [function(e, t, i) {
  23253. "use strict";
  23254. function n(e) {
  23255. this.messenger = new a(e),
  23256. this.clientKey = null
  23257. }
  23258. var r = e("../util/ajax")
  23259. , o = e("./PostMessageType")
  23260. , a = e("./postmessage")
  23261. , s = e("./VersionInfo")
  23262. , l = e("events").EventEmitter
  23263. , c = window.location.origin + "/api/v1/user/";
  23264. n.prototype = Object.create(l.prototype),
  23265. n.prototype.bindEvents = function() {
  23266. this.messenger.on(o.ACTION, this.onMessageReceived.bind(this))
  23267. }
  23268. ,
  23269. n.prototype.waitForConnection = function() {
  23270. var e = new Promise(function(e, t) {
  23271. this.messenger.on(o.CONNECT, function(i) {
  23272. this.onConnectionReceived(i).then(e.bind(this, i.sdkVersion), t.bind())
  23273. }
  23274. .bind(this))
  23275. }
  23276. .bind(this));
  23277. return e
  23278. }
  23279. ,
  23280. n.prototype.onConnectionReceived = function(e) {
  23281. return this.messenger.setTarget(e.source, e.origin),
  23282. this.verifyConnection(e).then(function(t, i) {
  23283. this.messenger.send({
  23284. type: o.ACCEPT,
  23285. toId: e.fromId,
  23286. warning: i
  23287. }),
  23288. this.clientKey = t,
  23289. this.messenger.removeAllListeners(o.CONNECT),
  23290. this.bindEvents()
  23291. }
  23292. .bind(this), function(t) {
  23293. this.messenger.send({
  23294. type: o.REJECT,
  23295. toId: e.fromId,
  23296. reason: t
  23297. }),
  23298. this.messenger.setTarget()
  23299. }
  23300. .bind(this))
  23301. }
  23302. ,
  23303. n.prototype.verifyConnection = function(e) {
  23304. return new Promise(function(t, i) {
  23305. var n;
  23306. if (s.isDeprecated(e.sdkVersion))
  23307. n = "这个版本正在被弃用";
  23308. else if (!s.isSupported(e.sdkVersion))
  23309. return i("不支持此版本的SDK");
  23310. var o = {
  23311. cache: !1,
  23312. headers: {
  23313. "X-port-Application-Key": e.applicationKey,
  23314. "X-port-Referrer": e.origin
  23315. }
  23316. };
  23317. r.get(c, o).done(t.bind(this, e.applicationKey, n)).fail(i.bind(this, "key/referrer mismatch"))
  23318. }
  23319. )
  23320. }
  23321. ,
  23322. n.prototype.onMessageReceived = function(e) {
  23323. if (this.validateClientApplicationKey(e.applicationKey)) {
  23324. var t = this;
  23325. e.onDone = function(i) {
  23326. i.toId = e.fromId,
  23327. i.uid = e.uid,
  23328. i.type = o.RESPONSE,
  23329. t.messenger.send(i)
  23330. }
  23331. ,
  23332. this.emit(o.ACTION, e)
  23333. }
  23334. }
  23335. ,
  23336. n.prototype.validateClientApplicationKey = function(e) {
  23337. return this.clientKey === e
  23338. }
  23339. ,
  23340. n.prototype.sendEvent = function(e, t) {
  23341. this.messenger.send({
  23342. type: o.EVENT,
  23343. eventType: e,
  23344. eventData: t
  23345. })
  23346. }
  23347. ,
  23348. t.exports = n
  23349. }
  23350. , {
  23351. "../util/ajax": 181,
  23352. "./PostMessageType": 160,
  23353. "./VersionInfo": 163,
  23354. "./postmessage": 165,
  23355. events: 202
  23356. }],
  23357. 160: [function(e, t, i) {
  23358. "use strict";
  23359. t.exports = Object.freeze({
  23360. CONNECT: "postmessage.connect",
  23361. ACCEPT: "postmessage.accept",
  23362. REJECT: "postmessage.reject",
  23363. ACTION: "postmessage.action",
  23364. RESPONSE: "postmessage.response",
  23365. EVENT: "postmessage.event"
  23366. })
  23367. }
  23368. , {}],
  23369. 161: [function(e, t, i) {
  23370. "use strict";
  23371. t.exports = Object.freeze({
  23372. MOVE: "sdk.move",
  23373. ENTER_PANO: "sdk.enterpano",
  23374. MODEL_LOADED: "sdk.modelloaded"
  23375. })
  23376. }
  23377. , {}],
  23378. 162: [function(e, t, i) {
  23379. "use strict";
  23380. t.exports = Object.freeze({
  23381. FLY: "transition.fly",
  23382. FADEOUT: "transition.fade",
  23383. INSTANT: "transition.instant"
  23384. })
  23385. }
  23386. , {}],
  23387. 163: [function(e, t, i) {
  23388. "use strict";
  23389. t.exports = {
  23390. current: "1.0",
  23391. supported: ["1.0"],
  23392. deprecated: [],
  23393. isSupported: function(e) {
  23394. return this.supported.indexOf(e) !== -1
  23395. },
  23396. isDeprecated: function(e) {
  23397. return this.deprecated.indexOf(e) !== -1
  23398. },
  23399. isValid: function(e) {
  23400. return this.isSupported(e) || this.isDeprecated(e)
  23401. }
  23402. }
  23403. }
  23404. , {}],
  23405. 164: [function(e, t, i) {
  23406. (function(i) {
  23407. "use strict";
  23408. function n(e, t, i) {
  23409. e && (e = e.toLowerCase().trim());
  23410. var n = new I.UP.clone
  23411. , r = Math.PI / 3
  23412. , o = Math.PI / 2;
  23413. switch (e) {
  23414. case "left":
  23415. i.copy(t),
  23416. i.applyAxisAngle(n, o);
  23417. break;
  23418. case "right":
  23419. i.copy(t),
  23420. i.applyAxisAngle(n, -o);
  23421. break;
  23422. case "forwardleft":
  23423. i.copy(t),
  23424. i.applyAxisAngle(n, r);
  23425. break;
  23426. case "forwardright":
  23427. i.copy(t),
  23428. i.applyAxisAngle(n, -r);
  23429. break;
  23430. case "forward":
  23431. default:
  23432. i.copy(t)
  23433. }
  23434. return i
  23435. }
  23436. function r(e, t) {
  23437. if (e) {
  23438. var i = {
  23439. pano: e,
  23440. lookAtPoint: null,
  23441. duration: null,
  23442. maxDistanceOverride: null,
  23443. skipWarpingCheck: !1
  23444. };
  23445. this.player.flyToPano(i, function() {
  23446. t && t({
  23447. success: !0,
  23448. message: "Transition complete."
  23449. })
  23450. })
  23451. } else
  23452. R.warn("Showcase -> clickPanoObject: Unable to find pano."),
  23453. t && t({
  23454. success: !1,
  23455. error: "Unable to find pano."
  23456. })
  23457. }
  23458. function o(e, t) {
  23459. var i = this.findRankedPano(e, t);
  23460. return i >= 0 ? this.handleToObject[i] : (R.warn("Showcase -> findRankedPanoObject: Unable to find nearby pano."),
  23461. null)
  23462. }
  23463. function a(e, t) {
  23464. var i = this.findRankedtag(e, t);
  23465. return i >= 0 ? this.handleToObject[i] : (R.warn("Showcase -> findRankedtagObject: Unable to find nearby tag."),
  23466. null)
  23467. }
  23468. function s(e, t) {
  23469. t.copy(I.FORWARD),
  23470. e.getDirection(t)
  23471. }
  23472. function l(e) {
  23473. function t(e) {
  23474. var t = (new c.Euler).setFromQuaternion(e.quaternion, "YXZ");
  23475. return {
  23476. x: c.Math.radToDeg(t._x),
  23477. y: c.Math.radToDeg(t._y),
  23478. z: c.Math.radToDeg(t._z)
  23479. }
  23480. }
  23481. var i = function(e) {
  23482. return e.alignmentType !== m.ALIGNED ? null : {
  23483. x: e.position.x,
  23484. y: e.position.y,
  23485. z: e.position.z
  23486. }
  23487. };
  23488. return {
  23489. panos: e.panos.list.map(function(n) {
  23490. var r = y.getCubemapUrls(e.urls, n.id, "high")[C.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z];
  23491. return {
  23492. uuid: n.id,
  23493. aligned: n.alignmentType === m.ALIGNED,
  23494. neighbourUUIDs: n.neighbourUUIDs.slice(),
  23495. position: i(n),
  23496. rotation: t(n),
  23497. thumbnail: r
  23498. }
  23499. })
  23500. }
  23501. }
  23502. var c = e("three")
  23503. , h = e("./ApiHost")
  23504. , u = e("../util/logger")
  23505. , d = e("../util/common")
  23506. , p = e("../util/math")
  23507. , f = e("../enum/ModelManagerEvents")
  23508. , g = e("./PostMessageType")
  23509. , m = e("../enum/AlignmentType")
  23510. , v = e("../enum/Direction")
  23511. , A = e("./TransitionStyles")
  23512. , y = e("../util/panorama")
  23513. , C = e("../enum/GLCubeFaces")
  23514. , I = e("../enum/Vectors")
  23515. , E = e("../enum/Viewmode")
  23516. , b = e("../enum/WarpStyle")
  23517. , w = (e("../enum/Keys"),
  23518. e("../enum/PlayerEvents"))
  23519. , _ = e("../sdk/SdkEvents")
  23520. , I = e("../enum/Vectors")
  23521. , T = e("../enum/ControlEvents")
  23522. , x = e("../enum/RenderLayers")
  23523. , S = (e("../constants"),
  23524. e("../settings"))
  23525. , M = e("../lib/jpeg_encoder")
  23526. , R = new u(i)
  23527. , P = function() {
  23528. var e = function e() {
  23529. e.playerDirection.copy(e.player.mode === E.FLOORPLAN ? I.UP : I.FORWARD),
  23530. e.player.getDirection(e.playerDirection),
  23531. e.projectVectors();
  23532. var t = e.playerDirection.angleTo(e.lastFacingDirection);
  23533. if (e.angleTravelled += Math.abs(t),
  23534. e.angleTravelled >= Math.abs(e.angle)) {
  23535. if (e.active = !1,
  23536. e.onDone) {
  23537. var i = e.onDone;
  23538. i()
  23539. }
  23540. } else
  23541. e.lastFacingDirection.copy(e.playerDirection),
  23542. window.setTimeout(e, 4)
  23543. };
  23544. return e.active = !1,
  23545. e.angle = 0,
  23546. e.angleTravelled = 0,
  23547. e.playerDirection = new c.Vector3,
  23548. e.lastFacingDirection = new c.Vector3,
  23549. e.onDone = null,
  23550. e.player = null,
  23551. e.start = function(t, i, n, r) {
  23552. e.active = !0,
  23553. t && i && (i = 0),
  23554. e.angle = t || i,
  23555. e.xAngle = t,
  23556. e.yAngle = i,
  23557. e.angleTravelled = 0,
  23558. e.playerDirection.copy(n.mode === E.FLOORPLAN ? I.UP : I.FORWARD),
  23559. n.getDirection(e.playerDirection),
  23560. e.lastFacingDirection.copy(e.playerDirection),
  23561. e.projectVectors(),
  23562. e.onDone = r,
  23563. e.player = n,
  23564. e()
  23565. }
  23566. ,
  23567. e.projectVectors = function() {
  23568. e.xAngle && (e.playerDirection.projectOnPlane(I.UP),
  23569. e.lastFacingDirection.projectOnPlane(I.UP))
  23570. }
  23571. ,
  23572. e
  23573. }()
  23574. , O = function() {
  23575. var e = new c.Vector3;
  23576. return function(t) {
  23577. t ? (e.copy(t.position),
  23578. e.add(t.discPosition),
  23579. p.projectPositionToCanvas(e, this.player.camera, e),
  23580. this.click(e.x, e.y)) : R.warn("Showcase -> clicktagObject: Unable to find tag.")
  23581. }
  23582. }()
  23583. , L = function() {
  23584. return this.player.mode === E.PANORAMA ? S.insideLookLimitUp : this.player.mode === E.DOLLHOUSE ? 90 - c.Math.radToDeg(S.dollhouseDefault.minPolarAngle) : null
  23585. }
  23586. , D = function() {
  23587. return this.player.mode === E.PANORAMA ? S.insideLookLimitDown : this.player.mode === E.DOLLHOUSE ? 90 - c.Math.radToDeg(S.dollhouseDefault.maxPolarAngle) : null
  23588. }
  23589. , N = function(e) {
  23590. var t = new c.Vector3;
  23591. return function(e) {
  23592. var i = this.player.getDirection();
  23593. t.copy(i);
  23594. var n = t.y;
  23595. t.y = 0,
  23596. t.normalize();
  23597. var r = c.Math.radToDeg(t.angleTo(i)) * (n < 0 ? -1 : 1);
  23598. if (this.player.mode !== E.DOLLHOUSE && this.player.mode !== E.PANORAMA)
  23599. return 0 !== e && R.warn("Cannot rotate in y direction when in " + this.player.mode + " mode"),
  23600. 0;
  23601. this.player.mode === E.DOLLHOUSE && (r = -r);
  23602. var o = L.call(this) - .1
  23603. , a = D.call(this) + .1
  23604. , s = r + e;
  23605. s > o ? s = o : s < a && (s = a);
  23606. var l = s - r;
  23607. return e > 0 && l < .01 && (l = 0),
  23608. e < 0 && l > -.01 && (l = 0),
  23609. l
  23610. }
  23611. }()
  23612. , B = function() {
  23613. var e = new c.Euler;
  23614. return function(t) {
  23615. return e.setFromQuaternion(t.quaternion, "YXZ"),
  23616. {
  23617. position: {
  23618. x: t.position.x,
  23619. y: t.position.y,
  23620. z: t.position.z
  23621. },
  23622. rotation: {
  23623. x: c.Math.radToDeg(e.x),
  23624. y: c.Math.radToDeg(e.y),
  23625. z: 0
  23626. },
  23627. pano: t.currentPano ? t.currentPano.id : null,
  23628. mode: t.mode
  23629. }
  23630. }
  23631. }()
  23632. , F = null;
  23633. t.exports = {
  23634. init: function(e, t, i, n, r) {
  23635. V.init(e, t, i, r),
  23636. F = new Promise(function(e, t) {
  23637. i.on(w.Ready, function() {
  23638. e()
  23639. })
  23640. }
  23641. .bind(this));
  23642. var o = new h(window)
  23643. , a = o.waitForConnection();
  23644. a.then(function(e) {
  23645. o.on(g.ACTION, V.onMessageReceive.bind(V))
  23646. });
  23647. var s = function() {
  23648. var e = Date.now();
  23649. return function() {
  23650. if (!(Date.now() - e < 100)) {
  23651. var t = B(i);
  23652. o.sendEvent(_.MOVE, {
  23653. state: t
  23654. }),
  23655. e = Date.now()
  23656. }
  23657. }
  23658. }();
  23659. i.on(w.Move, s),
  23660. i.on(w.ViewChanged, s),
  23661. n.on(f.ActiveModelChanged, function(e) {
  23662. function t(e) {
  23663. var t, i = e.newPano.id;
  23664. e.oldPano && (t = e.oldPano.id),
  23665. i !== t && o.sendEvent(_.ENTER_PANO, {
  23666. oldPano: t,
  23667. newPano: i
  23668. })
  23669. }
  23670. var i = e.model
  23671. , n = e.oldModel;
  23672. V.model = i,
  23673. a.then(function() {
  23674. o.sendEvent(_.MODEL_LOADED, {
  23675. metadata: l(i)
  23676. })
  23677. }),
  23678. n && n.panos.forEach(function(e) {
  23679. e.removeEventListener("enter", t)
  23680. }),
  23681. i.panos.forEach(function(e) {
  23682. e.on("enter", t)
  23683. })
  23684. })
  23685. }
  23686. };
  23687. var V = {
  23688. director: null,
  23689. player: null,
  23690. controls: null,
  23691. sceneRenderer: null,
  23692. model: null,
  23693. init: function(e, t, i, n) {
  23694. this.director = e,
  23695. this.player = i,
  23696. this.controls = t,
  23697. this.sceneRenderer = n
  23698. },
  23699. handleToObject: {},
  23700. objectToHandle: {},
  23701. handleCount: 0,
  23702. onMessageReceive: function(e) {
  23703. if (e) {
  23704. var t = e.targetFunction
  23705. , i = e.params
  23706. , n = e.onDone;
  23707. t && this[t] && this[t](i, n)
  23708. }
  23709. },
  23710. waitForInit: function(e, t) {
  23711. F.then(t.bind({
  23712. success: !0,
  23713. message: "Init complete."
  23714. }))
  23715. },
  23716. moveToPano: function(e, t) {
  23717. var i = new c.Euler(0,0,0,"YXZ")
  23718. , n = new c.Quaternion;
  23719. return function(e, t) {
  23720. var r = e.pano
  23721. , o = e.rotation
  23722. , a = e.transition;
  23723. if (!this.model)
  23724. return t({
  23725. success: !1,
  23726. error: "The model has not been loaded yet"
  23727. });
  23728. var s = this.model.panos.get(r);
  23729. if (!s)
  23730. return t({
  23731. success: !1,
  23732. error: r + " does not exist in this model"
  23733. });
  23734. if (!o)
  23735. return t({
  23736. sucess: !1,
  23737. erorr: o + " is not a valid rotation"
  23738. });
  23739. i.set(c.Math.degToRad(o.x || 0), c.Math.degToRad(o.y || 0), c.Math.degToRad(o.z || 0), "YXZ"),
  23740. console.log(o.z);
  23741. var l = {
  23742. success: !0,
  23743. message: r
  23744. };
  23745. if (a === A.FADEOUT)
  23746. n.setFromEuler(i),
  23747. this.player.warpToPano(s, n, null, null, b.BLACK, null, null, t.bind(this, l));
  23748. else {
  23749. var h, u;
  23750. a === A.INSTANT && (h = 0,
  23751. u = 0);
  23752. var d = I.FORWARD.clone().applyEuler(i).add(s.position);
  23753. this.player.flyToPano({
  23754. pano: s,
  23755. lookAtPoint: d,
  23756. duration: h,
  23757. aimDuration: u
  23758. }, t.bind(this, l))
  23759. }
  23760. }
  23761. }(),
  23762. moveInDirection: function(e, t) {
  23763. var i = e.direction;
  23764. return "undefined" == typeof v[i] ? (R.warn("Showcase -> moveInDirection: Cannot move in invalid direction."),
  23765. void (t && t({
  23766. success: !1,
  23767. error: "Invalid direction."
  23768. }))) : void this.player.flyLocalDirection(I[i].clone()).then(function(e) {
  23769. t(e ? {
  23770. success: !0,
  23771. message: "moved " + i
  23772. } : {
  23773. success: !1,
  23774. error: "Cannot move in direction: " + i
  23775. })
  23776. })
  23777. },
  23778. getPose: function(e, t) {
  23779. this.player.camera.position,
  23780. (new c.Euler).setFromQuaternion(this.player.camera.quaternion, "YXZ");
  23781. return t({
  23782. success: !0,
  23783. message: B(this.player)
  23784. })
  23785. },
  23786. takeScreenShot: function() {
  23787. var e = new c.PerspectiveCamera
  23788. , t = new c.WebGLRenderTarget;
  23789. return function(i, n) {
  23790. if (!i.resolution)
  23791. return n({
  23792. success: !1,
  23793. error: "An invalid resolution was specified"
  23794. });
  23795. if (i.resolution.width === -1 || i.resolution.height === -1) {
  23796. var r = this.sceneRenderer.renderer.getSize();
  23797. i.resolution.width = r.width,
  23798. i.resolution.height = r.height
  23799. }
  23800. e.layers.set(x.DEFAULT),
  23801. i.visibleObjects && (i.visibleObjects.showtags && e.layers.enable(x.TAG),
  23802. i.visibleObjects.showPucks && e.layers.enable(x.PANOMARKERS),
  23803. i.visibleObjects.showReticule && e.layers.enable(x.RETICULE));
  23804. var o = i.resolution.width
  23805. , a = i.resolution.height
  23806. , s = o / a;
  23807. e.position.copy(this.sceneRenderer.camera.position),
  23808. e.quaternion.copy(this.sceneRenderer.camera.quaternion),
  23809. e.projectionMatrix.copy(this.player.camera.projectionMatrix),
  23810. e.projectionMatrix.elements[0] = this.player.camera.projectionMatrix.elements[5] / s,
  23811. t.setSize(o, a),
  23812. this.sceneRenderer.renderer.render(this.sceneRenderer.scene, e, t);
  23813. var l = new Uint8Array(o * a * 4);
  23814. this.sceneRenderer.renderer.readRenderTargetPixels(t, 0, 0, o, a, l);
  23815. var c = M.encode({
  23816. data: l,
  23817. width: o,
  23818. height: a,
  23819. heading: 180,
  23820. pitch: 0
  23821. }, {
  23822. quality: 75,
  23823. flipY: !0
  23824. })
  23825. , h = "data:image/jpg;base64," + d.uint8ToBase64(c.data);
  23826. n({
  23827. success: !0,
  23828. message: h
  23829. })
  23830. }
  23831. }(),
  23832. findRankedPano: function(e, t) {
  23833. var i = new c.Vector3
  23834. , r = new c.Vector3;
  23835. return function(e, t) {
  23836. s(this.player, r),
  23837. n(t, r, i);
  23838. var o = this.player.rankedPanoInDirection(e, i);
  23839. if (o) {
  23840. var a = this.objectToHandle[o.id];
  23841. return a || (this.objectToHandle[o.id] = a = this.handleCount++,
  23842. this.handleToObject[a] = o),
  23843. a
  23844. }
  23845. return R.warn("Showcase -> findRankedPano: Unable to find nearby pano."),
  23846. -1
  23847. }
  23848. }(),
  23849. findRankedtag: function(e, t) {
  23850. var i = new c.Vector3
  23851. , r = new c.Vector3;
  23852. return function(e, t) {
  23853. s(this.player, r),
  23854. n(t, r, i);
  23855. var o = this.player.rankedtagInDirection(e, i);
  23856. if (o) {
  23857. var a = this.objectToHandle[o.sid];
  23858. return a || (this.objectToHandle[o.sid] = a = this.handleCount++,
  23859. this.handleToObject[a] = o),
  23860. a
  23861. }
  23862. return R.warn("Showcase -> findRankedtag: Unable to find nearby tag."),
  23863. -1
  23864. }
  23865. }(),
  23866. clickNearesttag: function(e) {
  23867. this.clickRankedtag(0, e)
  23868. },
  23869. clickRankedtag: function(e, t) {
  23870. var i = a.call(this, e, t);
  23871. i && O.call(this, i)
  23872. },
  23873. clickNearestPano: function(e, t) {
  23874. this.clickRankedPano(0, e, t)
  23875. },
  23876. clickRankedPano: function(e, t, i) {
  23877. var n = o.call(this, e, t);
  23878. n ? r.call(this, n, i) : i(null)
  23879. },
  23880. clickPano: function(e, t) {
  23881. var i = this.handleTable[e];
  23882. i ? r.call(this, i, t) : t(null)
  23883. },
  23884. rotateDirection: function() {
  23885. return function(e, t) {
  23886. var i = e.direction
  23887. , n = e.angle;
  23888. if (!P.active) {
  23889. var r = 0
  23890. , o = 0
  23891. , a = 0
  23892. , s = 0;
  23893. if (!n || isNaN(n))
  23894. return R.warn("Showcase -> rotateDirection: Invalid rotation angle."),
  23895. void (t && t({
  23896. success: !1,
  23897. error: "Invalid rotation angle."
  23898. }));
  23899. if (this.player.mode === E.TRANSITIONING)
  23900. return R.warn("Automation -> rotateDirection: Cannot rotate while transitioning"),
  23901. void (t && t({
  23902. success: !1,
  23903. error: "Cannot rotate while transitioning"
  23904. }));
  23905. if (i === v.RIGHT || i === v.LEFT)
  23906. i === v.RIGHT && (n = -n),
  23907. r = n > 0 ? -1 : 1,
  23908. a = n;
  23909. else {
  23910. if (i !== v.UP && i !== v.DOWN)
  23911. return R.warn("Showcase -> rotateDirection: Invalid direction for rotation: " + i),
  23912. void (t && t({
  23913. success: !1,
  23914. error: "Invalid direction for rotation."
  23915. }));
  23916. if (this.player.mode === E.FLOORPLAN)
  23917. return R.warn("Showcase -> rotateDirection: Cannot rotate " + i + " in floorplan mode"),
  23918. void (t && t({
  23919. success: !1,
  23920. error: "Cannot rotate " + i + " in floorplan mode"
  23921. }));
  23922. if (i === v.DOWN && (n = -n),
  23923. n = N.call(this, n),
  23924. 0 === n)
  23925. return R.warn("Showcase -> rotateDirection: Already at maximum rotation in direction: " + i),
  23926. void (t && t({
  23927. success: !1,
  23928. error: "Already at maximum rotation in direction: " + i
  23929. }));
  23930. o = n > 0 ? 1 : -1,
  23931. s = n
  23932. }
  23933. var l = n;
  23934. n = c.Math.degToRad(n),
  23935. a = c.Math.degToRad(a),
  23936. s = c.Math.degToRad(s);
  23937. var h = this.controls.activeControl
  23938. , u = function() {
  23939. h.stopRotating(!0),
  23940. t && t({
  23941. success: !0,
  23942. message: "Rotated " + l.toFixed(2) + "° in direction: " + e.direction
  23943. })
  23944. };
  23945. h.startRotating(r, o),
  23946. P.start(a, s, this.player, u)
  23947. }
  23948. }
  23949. }(),
  23950. rotate: function() {
  23951. var e = new c.Vector3
  23952. , t = new c.Vector3;
  23953. return function(i, n) {
  23954. var r = i.xAngle
  23955. , o = i.yAngle;
  23956. if (!P.active) {
  23957. if (r = r || 0,
  23958. o = o || 0,
  23959. isNaN(r) || isNaN(o))
  23960. return R.warn("Showcase -> rotate: Invalid rotation angle."),
  23961. void (n && n({
  23962. success: !1,
  23963. error: "Invalid rotation angle."
  23964. }));
  23965. if (this.player.mode === E.TRANSITIONING)
  23966. return R.warn("Automation -> rotate: Cannot rotate while transitioning"),
  23967. void (n && n({
  23968. success: !1,
  23969. error: "Cannot rotate while transitioning"
  23970. }));
  23971. Math.abs(r) < .01 && (r = 0),
  23972. Math.abs(o) < .01 && (o = 0);
  23973. var a = o;
  23974. o = N.call(this, o),
  23975. r = -r;
  23976. var s = a > 0 ? "UP" : "DOWN";
  23977. if (!r && a && !o)
  23978. return R.warn("Showcase -> rotate: Already at maximum rotation in direction: " + s),
  23979. void (n && n({
  23980. success: !1,
  23981. error: "Already at maximum rotation in direction: " + s
  23982. }));
  23983. a > o && R.warn("Showcase -> rotate: Reached maximum rotation in direction: " + s);
  23984. var l = o;
  23985. o = c.Math.degToRad(o),
  23986. r = c.Math.degToRad(r),
  23987. e.copy(this.player.mode === E.FLOORPLAN ? I.UP : I.FORWARD),
  23988. this.player.getDirection(e),
  23989. t.copy(e).applyAxisAngle(I.UP, r),
  23990. t.applyAxisAngle(I.RIGHT, o);
  23991. var h = (e.angleTo(t),
  23992. r > 0 ? -1 : r < 0 ? 1 : 0)
  23993. , u = o > 0 ? 1 : o < 0 ? -1 : 0;
  23994. Math.abs(r) > Math.abs(o) ? u *= Math.abs(o / r) : Math.abs(o) > Math.abs(r) && (h *= Math.abs(r / o));
  23995. var d = this.controls.activeControl
  23996. , p = function() {
  23997. d.stopRotating(!0),
  23998. n && n({
  23999. success: !0,
  24000. message: "Rotated " + i.xAngle.toFixed(2) + "° horizontally, " + l.toFixed(2) + "° vertically"
  24001. })
  24002. };
  24003. d.startRotating(h, u),
  24004. P.start(r, o, this.player, p)
  24005. }
  24006. }
  24007. }(),
  24008. panCamera: function(e, t) {
  24009. function i(e) {
  24010. switch (r.removeAllListeners(T.AutoPanComplete),
  24011. r.removeAllListeners(T.AutoPanInterrupt),
  24012. r.removeAllListeners(T.AutoPanClamped),
  24013. e) {
  24014. case T.AutoPanInterrupt:
  24015. t({
  24016. success: !0,
  24017. message: "Camera panning interrupted."
  24018. });
  24019. break;
  24020. case T.AutoPanClamped:
  24021. if (r.autoPanPosition.x !== n.x || r.autoPanPosition.z !== n.z) {
  24022. if (Math.abs(this.player.position.x - r.autoPanPosition.x) < .01 && Math.abs(this.player.position.z - r.autoPanPosition.z) < .01)
  24023. return void t({
  24024. success: !1,
  24025. error: "Already at edge of current model bounds."
  24026. });
  24027. var i = "The view point is outside the bounds for the current model. ";
  24028. i += "The view point was clamped to " + o(r.target.x, r.target.z),
  24029. console.warn(i)
  24030. }
  24031. case T.AutoPanComplete:
  24032. t({
  24033. success: !0,
  24034. message: "Panned camera to position " + o(r.autoPanPosition.x, r.autoPanPosition.z)
  24035. })
  24036. }
  24037. }
  24038. if (this.player.mode !== E.DOLLHOUSE && this.player.mode !== E.FLOORPLAN)
  24039. return t({
  24040. success: !1,
  24041. error: "Camera panning is not available in the current mode: " + this.player.mode
  24042. });
  24043. var n = e.position
  24044. , r = this.player.control;
  24045. r.setAutoPanPosition(n.x, n.z),
  24046. r.autoPan = !0;
  24047. var o = function(e, t) {
  24048. return "(" + e.toFixed(2) + ", " + t.toFixed(2) + ")"
  24049. };
  24050. r.on(T.AutoPanComplete, i.bind(this, T.AutoPanComplete)),
  24051. r.on(T.AutoPanInterrupt, i.bind(this, T.AutoPanInterrupt)),
  24052. r.on(T.AutoPanClamped, i.bind(this, T.AutoPanClamped))
  24053. },
  24054. click: function(e, t) {
  24055. var i = e.x
  24056. , n = e.y
  24057. , r = e.percentage;
  24058. r === !0 && (i = i / 100 * $("#player").width(),
  24059. n = n / 100 * $("#player").height()),
  24060. this.player.handleInputStart(i, n),
  24061. this.player.updateIntersect(),
  24062. this.player.handleInputEnd(i, n)
  24063. },
  24064. mouseOver: function(e, t) {
  24065. var i = e.x
  24066. , n = e.y
  24067. , r = e.percentage;
  24068. r === !0 && (i = i / 100 * $("#player").width(),
  24069. n = n / 100 * $("#player").height()),
  24070. this.player.handleInputMove(i, n),
  24071. this.player.updateIntersect()
  24072. },
  24073. moveToMode: function(e, t) {
  24074. function i(e) {
  24075. t(e ? {
  24076. success: !1,
  24077. error: "Failed to load new mode: " + e
  24078. } : {
  24079. success: !0,
  24080. message: "Moved to new mode: " + n
  24081. })
  24082. }
  24083. var n = e.mode;
  24084. n === E.PANORAMA || n === E.DOLLHOUSE || n === E.FLOORPLAN ? this.director.changeMode(n).then(function() {
  24085. i()
  24086. }, function(e) {
  24087. i(e)
  24088. }) : t({
  24089. success: !1,
  24090. error: "Invalid mode selection"
  24091. })
  24092. }
  24093. }
  24094. }
  24095. ).call(this, "/js/sdk/automation.js")
  24096. }
  24097. , {
  24098. "../constants": 8,
  24099. "../enum/AlignmentType": 17,
  24100. "../enum/ControlEvents": 21,
  24101. "../enum/Direction": 22,
  24102. "../enum/GLCubeFaces": 25,
  24103. "../enum/Keys": 30,
  24104. "../enum/ModelManagerEvents": 33,
  24105. "../enum/PlayerEvents": 40,
  24106. "../enum/RenderLayers": 41,
  24107. "../enum/Vectors": 50,
  24108. "../enum/Viewmode": 51,
  24109. "../enum/WarpStyle": 52,
  24110. "../lib/jpeg_encoder": 94,
  24111. "../sdk/SdkEvents": 161,
  24112. "../settings": 166,
  24113. "../util/common": 185,
  24114. "../util/logger": 189,
  24115. "../util/math": 190,
  24116. "../util/panorama": 191,
  24117. "./ApiHost": 159,
  24118. "./PostMessageType": 160,
  24119. "./TransitionStyles": 162,
  24120. three: 217
  24121. }],
  24122. 165: [function(e, t, i) {
  24123. "use strict";
  24124. function n(e) {
  24125. this.sourceWindow = e,
  24126. this.targetWindow = null,
  24127. this.targetOrigin = null,
  24128. this.id = Math.floor(1e5 * Math.random()),
  24129. this.bindEvents()
  24130. }
  24131. var r = e("./PostMessageType")
  24132. , o = e("events").EventEmitter;
  24133. n.prototype = Object.create(o.prototype),
  24134. n.prototype.bindEvents = function() {
  24135. this.sourceWindow.addEventListener("message", this.onPostmessageReceived.bind(this))
  24136. }
  24137. ,
  24138. n.prototype.setTarget = function(e, t) {
  24139. this.targetWindow = e,
  24140. this.targetOrigin = t
  24141. }
  24142. ,
  24143. n.prototype.onPostmessageReceived = function(e) {
  24144. var t = e.origin || e.originalEvent.origin
  24145. , i = e.source;
  24146. switch (e.data.type) {
  24147. case r.CONNECT:
  24148. break;
  24149. case r.RESPONSE:
  24150. if (this.id !== e.data.toId)
  24151. return;
  24152. default:
  24153. if (!this.validateMessageOrigin(t))
  24154. return
  24155. }
  24156. var n = e.data;
  24157. n.source = i,
  24158. n.origin = t,
  24159. n.timestamp = Date.now(),
  24160. this.emit(e.data.type, n)
  24161. }
  24162. ,
  24163. n.prototype.validateMessageOrigin = function(e) {
  24164. return "*" === this.targetOrigin || e === this.targetOrigin
  24165. }
  24166. ,
  24167. n.prototype.send = function(e) {
  24168. this.targetWindow && this.targetOrigin && (e.fromId = this.id,
  24169. this.targetWindow.postMessage(e, this.targetOrigin))
  24170. }
  24171. ,
  24172. t.exports = n
  24173. }
  24174. , {
  24175. "./PostMessageType": 160,
  24176. events: 202
  24177. }],
  24178. 166: [function(e, t, i) {
  24179. "use strict";
  24180. var n = e("three")
  24181. , r = e("./util/browser")
  24182. , o = e("./enum/Viewmode")
  24183. , a = e("./enum/VROption")
  24184. , s = e("./enum/Colors")
  24185. , l = e("./enum/WarpStyle")
  24186. , c = e("./util/easing")
  24187. , h = e("./util/common")
  24188. , u = e("./util/showcase")
  24189. , d = e("./constants")
  24190. , p = {
  24191. debug: !1,
  24192. version: "2.25.6-0-gd87e5b1",
  24193. languageTag: r.valueFromHash("lang", null),
  24194. pageTitle: "四维虚拟漫游",
  24195. authorizationHeader: u.getAuthorizationHeader(),
  24196. autoplay: r.valueFromHash("play", !1) || !r.inIframe(),
  24197. logLevel: r.valueFromHash("log", 2),
  24198. skyboxRadius: 2500,
  24199. modelBoundsPadding: 5,
  24200. showNeighbors: !1,
  24201. brand: r.valueFromHash("brand", !0),
  24202. showHighlights: r.valueFromHash("hhl", !0) && r.valueFromHash("hr", 1),
  24203. startHighlights: r.valueFromHash("hl", -1),
  24204. specialEdition: r.valueFromHash("bn", 0),
  24205. useWheel: r.valueFromHash("wh", !0),
  24206. crossOrigin: "anonymous",
  24207. fancierTransition: !1,
  24208. wireframe: !1,
  24209. skyboxWireframe: !1,
  24210. modelAlpha: 1,
  24211. highlightPanoSelection: !1,
  24212. showSweeps: !0,
  24213. showSkyboxes: !1,
  24214. showMesh: !0,
  24215. showFloors: !1,
  24216. showFloorDuration: 300,
  24217. showFloorDelay: 300,
  24218. hideFloorDuration: 300,
  24219. hideFloorDelay: 0,
  24220. reticuleOpacityTransitionTime: 250,
  24221. reticuleColor: s.newBlue,
  24222. markerOpacityTransitionTime: 500,
  24223. guiAnimationSpeed: 250,
  24224. highlightAnimationDuration: 500,
  24225. modelComponentLoadSpinnerDelay: 150,
  24226. captureErrors: !1,
  24227. maxMobileTextures: 6,
  24228. minimalMemoryMode: r.valueFromHash("m3", r.isMobile()),
  24229. startupFlyinDelay: 3e3,
  24230. dollhouseDefault: {
  24231. minDistance: 15,
  24232. maxDistance: 50,
  24233. minPolarAngle: n.Math.degToRad(10),
  24234. maxPolarAngle: n.Math.degToRad(90)
  24235. },
  24236. hideReticuleTimeout: 1e3,
  24237. analytics: {
  24238. inactivityThreshold: 30,
  24239. sessionTrackingRate: .15,
  24240. maxTrackedErrors: 20,
  24241. sessionDurationPingFrequency: 10,
  24242. sessionDurationTimeout: 15
  24243. },
  24244. flydown: {
  24245. movementEasing: "easeInOutQuad",
  24246. movementDelay: .001,
  24247. rotationEasing: "easeInOutQuad",
  24248. rotationDelay: .5,
  24249. modelTextureDelay: .75,
  24250. skyboxDelay: .75
  24251. },
  24252. transition: {
  24253. flySpeed: .01,
  24254. flyTime: 750,
  24255. flytimeMaxDistanceThreshold: 5,
  24256. flytimeDistanceMultiplier: 150,
  24257. aimTime: 1500,
  24258. aimSlowFactor: 1.5,
  24259. blur: .8,
  24260. movementEasing: "easeInOutQuad",
  24261. blendEasing: "easeInOutQuad",
  24262. fastForwardFactor: r.valueFromHash("mfis", 3)
  24263. },
  24264. show360Views: {
  24265. enabled: !0,
  24266. transitionTime: 1e3
  24267. },
  24268. quickstart: {
  24269. enabled: 1 === r.valueFromHash("qust", 0) || 1 === r.valueFromHash("qs", 0),
  24270. animation: 1400,
  24271. showTextDelay: 500,
  24272. fadeOutDelay: 3e3,
  24273. fovChange: 10
  24274. },
  24275. appConfig: {
  24276. webvr_version: null,
  24277. segment_key: null,
  24278. embedly_key: null,
  24279. branch_key: null,
  24280. keen_write_key: null,
  24281. keen_project_id: null
  24282. },
  24283. vr: {
  24284. enabled: !0,
  24285. allowWebVR: !1,
  24286. option: r.valueFromHash("vr", a.CONTEXTUAL)
  24287. },
  24288. share: {
  24289. enabled: !r.valueFromHash("mls", 0) && r.valueFromHash("brand", !0)
  24290. },
  24291. input: {
  24292. longTapThreshold: 200,
  24293. moveToleranceNDC: .08,
  24294. touchMoveThreshold: 25
  24295. },
  24296. help: {
  24297. modalStayDuration: 600
  24298. },
  24299. immersive: {
  24300. timeToShowAgain: 1250,
  24301. uiStayDuration: 600
  24302. },
  24303. tourInteraction: {
  24304. disabled: "0" === r.valueFromHash("tourcta", null),
  24305. showPauseButton: 1e3,
  24306. showModal: 1500,
  24307. allowNextClick: 200,
  24308. largeModal: "1" === r.valueFromHash("tourcta", null),
  24309. smallModal: "2" === r.valueFromHash("tourcta", null)
  24310. },
  24311. labels: {
  24312. enabled: !1,
  24313. hideUntilStart: !0,
  24314. fadeInDuration: 250,
  24315. fadeInDelay: 250,
  24316. fadeOutDuration: 250,
  24317. fadeOutDelay: 0,
  24318. zoomHideThreshhold: {
  24319. mobile: r.isSmallScreen() ? .45 : .6,
  24320. desktop: 2
  24321. },
  24322. zoomTruncateThreshhold: {
  24323. mobile: r.isSmallScreen() ? .35 : .45,
  24324. desktop: .85
  24325. },
  24326. minLengthForTruncate: 16,
  24327. truncateLength: 12,
  24328. truncateSuffix: "..."
  24329. },
  24330. tags: {
  24331. enabled: r.valueFromHash("mt", 1),
  24332. startup: {
  24333. hideUntilStart: !0,
  24334. fadeInDuration: 500,
  24335. fadeInDelay: 100
  24336. },
  24337. visibility: {
  24338. anyDistance: !0,
  24339. visibleDistance: 8,
  24340. cameraClearance: .1,
  24341. alphaTestLevel: .05,
  24342. hideViaFloor: !0,
  24343. hideOffScreenDisc: !1,
  24344. hideOffScreenObject: !1
  24345. },
  24346. disc: {
  24347. opacity: 1,
  24348. disabledOpacity: .5,
  24349. scale: {
  24350. nearBound: 1.5,
  24351. farBound: 4.8,
  24352. linkFarBound: !1,
  24353. linkPercent: 40,
  24354. maxSize: 80,
  24355. minSize: 40,
  24356. baseViewportSize: 800,
  24357. responsiveness: 100
  24358. }
  24359. },
  24360. pole: {
  24361. enabled: !0,
  24362. height: .5,
  24363. width: 2,
  24364. opacity: .5,
  24365. color: "white"
  24366. },
  24367. navigate: {
  24368. nearestPano: !0,
  24369. lineOfSight: !0,
  24370. reactivate: !0,
  24371. aimAt: "disc",
  24372. tiltTolerance: 25,
  24373. rotateSpeedFactor: .6
  24374. }
  24375. },
  24376. path: {
  24377. color: s.newBlue,
  24378. colorUp: s._desat(s.newBlue, .5),
  24379. colorDown: s._darken(s.newBlue, .35),
  24380. opacity: .5,
  24381. style: "ribbon",
  24382. height: .025,
  24383. ribbonWidth: .24,
  24384. outsideHeight: .5,
  24385. waypointRadius: .5,
  24386. waypointIndoorRadius: .24,
  24387. waypointPulse: 1e3,
  24388. typ: l.BLACK,
  24389. meshFree: r.valueFromHash("mf", 1),
  24390. mapGuides: r.valueFromHash("guides", !0),
  24391. fadeInTime: 400,
  24392. fadeOutTime: 300
  24393. },
  24394. warp: {
  24395. nearPanoDist: .1,
  24396. matchCam: !1,
  24397. blur: .33,
  24398. fastTime: 1500,
  24399. teleportTime: 1500,
  24400. outsideTime: 2e3,
  24401. lookAheadMax: .3,
  24402. lookAheadDist: 2.5,
  24403. softPushDist: .37,
  24404. softPushEnd: .3,
  24405. softBendAngle: 8,
  24406. softBendTilt: 4,
  24407. softBendEnd: .3,
  24408. doBurns: r.valueFromHash("kb", !0),
  24409. burnsAngle: 35,
  24410. minBurnsAngle: 35,
  24411. minDownAngle: -35,
  24412. maxTurnPerSec: 280,
  24413. maxAimPerSec: 35,
  24414. minRotation: 12,
  24415. maxAimRotation: 33.2,
  24416. turnFriction: .2,
  24417. flySpeed: .01,
  24418. minWarpTime: 1200,
  24419. warpInterruptionRedirectTime: 500,
  24420. tourStepDelay: r.valueFromHash("st", 0),
  24421. walkDelay: 0,
  24422. walkMaxDist: 50,
  24423. walkMinDist: .8,
  24424. walkSlideShowThreshhold: 3e3,
  24425. walkExtraPanosDistance: .4,
  24426. timePerMeter: 800,
  24427. motionLeadTime: 500,
  24428. movementEasing: "easeInOutQuad",
  24429. blendEasing: "easeInOutQuad",
  24430. showBunny: !1,
  24431. loop: r.valueFromHash("lp", !1),
  24432. auto: r.valueFromHash("ts", -1),
  24433. eOrder: "YXZ",
  24434. stepFactor: .25,
  24435. brakeStrength: 2,
  24436. minBrakeAngle: .1,
  24437. maxBrakeAngle: 1.8,
  24438. climbEffort: 4
  24439. },
  24440. rotationFriction: .05,
  24441. rotationAccelerationInside: 4.5,
  24442. rotationAccelerationOutside: .15,
  24443. rotationAfterMoveMultiplier: 40,
  24444. rotationAfterMoveHistoryCount: 5,
  24445. panFriction: .09,
  24446. panAccelerationOutside: 60,
  24447. onload: r.valueFromHash("onload", o.PANORAMA),
  24448. zoomNearLimit: .1,
  24449. zoomFarLimit: 10,
  24450. navigation: {
  24451. panoScores: !1,
  24452. mouseDirection: !0,
  24453. filterStrictness: .75,
  24454. angleFactor: -30,
  24455. directionFactor: 10,
  24456. distanceFactor: -1,
  24457. optionalityFactor: 3
  24458. },
  24459. sdkInit: !1,
  24460. secretPanelWord: [38, 38, 40, 40, 37, 39, 37, 39, 66, 65],
  24461. console: r.valueFromHash("console", !1),
  24462. noMeshFloorPositionOffset: new n.Vector3(0,-1.2,0),
  24463. panoramaNeighbourMaxDistance: 5,
  24464. panoFloorClickRadius: .35,
  24465. showScreenshotLocations: !1,
  24466. showAxis: !1,
  24467. showNeighbourRaycasts: !1,
  24468. colorMarkerOnLoad: !1,
  24469. colorMarkerByFloor: !1,
  24470. tiling: {
  24471. panoPreRenderRepeatDelay: 2500,
  24472. panoPreRenderDelay: 500,
  24473. preRenderTourPanos: r.valueFromHash("tileprerender", 0),
  24474. tilingFlagNames: ["usetiles", "tiles"],
  24475. maxNavPanoQuality: r.valueFromHash("maxtileq", null),
  24476. maxZoomPanoQuality: r.valueFromHash("maxztileq", null),
  24477. overlayStyle: r.valueFromHash("tileoverlay", 0),
  24478. uploadIntervalDelay: r.valueFromHash("tileupdelay", 10),
  24479. initialIntervalDelay: r.valueFromHash("itiledelay", 0),
  24480. maxNonBaseUploadsPerFrame: r.valueFromHash("maxnbtpf", 2),
  24481. maxBaseUploadsPerFrame: r.valueFromHash("maxbtpf", 6),
  24482. customCompression: r.valueFromHash("tilecustcomp", 0),
  24483. mobileHighQualityOverride: !1,
  24484. allowUltraHighResolution: !1
  24485. },
  24486. zoom: {
  24487. enabled: !1,
  24488. forceOff: r.valueFromHash("nozoom", 0),
  24489. overridemax: r.valueFromHash("maxzoom", null),
  24490. overridemin: r.valueFromHash("minzoom", null),
  24491. max: d.highQualityMaxZoom,
  24492. min: 1,
  24493. transitionStyle: r.valueFromHash("zoomtrans", 1),
  24494. activationThreshold: 1.1,
  24495. restoreTime: 500
  24496. },
  24497. profiling: {
  24498. enabled: r.valueFromHash("mem", !1)
  24499. }
  24500. };
  24501. p = h.deepExtend(p, d, {
  24502. insideFOV: r.valueFromHash("fov", d.insideFOV),
  24503. insideFOVMax: r.valueFromHash("fovmax", d.insideFOVMax),
  24504. panorama: {
  24505. transitionTime: 1e3,
  24506. modelAlpha: 0,
  24507. modelAlphaDelay: p.flydown.modelTextureDelay,
  24508. modelAlphaLength: 1,
  24509. skyboxOpacity: 1,
  24510. skyboxOpacityDelay: p.flydown.skyboxDelay,
  24511. skyboxOpacityLength: .9,
  24512. fovLength: 1,
  24513. fovDelay: 0,
  24514. cameraMatrixDuration: .8,
  24515. cameraMatrixDelay: 0,
  24516. cameraMatrixEase: c.easeInCubic,
  24517. reticuleOpacity: 1,
  24518. markerOpacity: .3,
  24519. markerOpacityOnHover: 1
  24520. },
  24521. dollhouse: {
  24522. transitionTime: 1e3,
  24523. modelAlpha: 1,
  24524. modelAlphaDelay: 0,
  24525. modelAlphaLength: 1 - p.flydown.modelTextureDelay,
  24526. skyboxOpacity: 0,
  24527. skyboxOpacityDelay: 0,
  24528. skyboxOpacityLength: 1 - p.flydown.skyboxDelay,
  24529. fovLength: 1,
  24530. fovDelay: 0,
  24531. cameraMatrixDuration: .8,
  24532. cameraMatrixDelay: .3,
  24533. cameraMatrixEase: c.easeInCubic,
  24534. reticuleOpacity: 1,
  24535. markerOpacity: 0,
  24536. markerOpacityOnHover: 0
  24537. },
  24538. floorplan: {
  24539. transitionTime: 1e3,
  24540. modelAlpha: 1,
  24541. modelAlphaDelay: 0,
  24542. modelAlphaLength: 1 - p.flydown.modelTextureDelay,
  24543. skyboxOpacity: 0,
  24544. skyboxOpacityDelay: 0,
  24545. skyboxOpacityLength: 1 - p.flydown.skyboxDelay,
  24546. fovLength: 1,
  24547. fovDelay: 0,
  24548. cameraMatrixDuration: .5,
  24549. cameraMatrixDelay: 0,
  24550. cameraMatrixEase: c.easeOutCubic,
  24551. reticuleOpacity: 1,
  24552. markerOpacity: 0,
  24553. markerOpacityOnHover: 0,
  24554. cameraHeight: 50
  24555. },
  24556. transitioning: {
  24557. reticuleOpacity: 0,
  24558. markerOpacity: .3,
  24559. markerOpacityOnHover: 1
  24560. },
  24561. "floorplan-dollhouse": {
  24562. rotationDelay: 0,
  24563. rotationDuration: 1
  24564. },
  24565. "floorplan-panorama": {
  24566. rotationDelay: .5,
  24567. rotationDuration: 1
  24568. },
  24569. "dollhouse-panorama": {
  24570. rotationDelay: .5,
  24571. rotationDuration: 1
  24572. },
  24573. "dollhouse-floorplan": {
  24574. rotationDelay: 0,
  24575. rotationDuration: 1,
  24576. cameraMatrixDuration: 1.05,
  24577. cameraMatrixDelay: .5
  24578. },
  24579. "panorama-dollhouse": {
  24580. rotationDelay: 0,
  24581. rotationDuration: .5
  24582. },
  24583. "panorama-floorplan": {
  24584. transitionTime: 1500,
  24585. rotationDelay: 0,
  24586. rotationDuration: .5
  24587. }
  24588. }),
  24589. p.path.meshFree && (p.path.typ = l.WALK),
  24590. p.zoom.max = p.zoom.overridemax || p.zoom.max,
  24591. p.zoom.min = p.zoom.overridemin || p.zoom.min,
  24592. t.exports = p
  24593. }
  24594. , {
  24595. "./constants": 8,
  24596. "./enum/Colors": 19,
  24597. "./enum/VROption": 47,
  24598. "./enum/Viewmode": 51,
  24599. "./enum/WarpStyle": 52,
  24600. "./util/browser": 182,
  24601. "./util/common": 185,
  24602. "./util/easing": 186,
  24603. "./util/showcase": 193,
  24604. three: 217
  24605. }],
  24606. 167: [function(e, t, i) {
  24607. "use strict";
  24608. var n = e("three")
  24609. , r = e("./settings")
  24610. , 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"
  24611. , a = "precision highp float;\nprecision highp int;\n\nuniform mat4 viewMatrix;\nuniform vec3 cameraPosition;\n";
  24612. t.exports = {
  24613. basicTextured: {
  24614. uniforms: {
  24615. tDiffuse: {
  24616. type: "t",
  24617. value: null
  24618. },
  24619. alpha: {
  24620. type: "f",
  24621. value: 1
  24622. }
  24623. },
  24624. vertexShader: "varying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}",
  24625. 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}"
  24626. },
  24627. copyCubeMap: {
  24628. uniforms: {
  24629. tDiffuse: {
  24630. type: "t",
  24631. value: null
  24632. },
  24633. alpha: {
  24634. type: "f",
  24635. value: 1
  24636. }
  24637. },
  24638. 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}",
  24639. 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}"
  24640. },
  24641. cube: {
  24642. uniforms: {
  24643. map: {
  24644. type: "t",
  24645. value: null
  24646. },
  24647. opacity: {
  24648. type: "f",
  24649. value: 1
  24650. }
  24651. },
  24652. vertexShader: o + "varying vec3 vWorldPosition;\n\nvoid main() {\n vWorldPosition = position;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}\n",
  24653. 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"
  24654. },
  24655. model: {
  24656. uniforms: {
  24657. map: {
  24658. type: "t",
  24659. value: null
  24660. },
  24661. modelAlpha: {
  24662. type: "f",
  24663. value: r.modelAlpha
  24664. },
  24665. opacity: {
  24666. type: "f",
  24667. value: 1
  24668. },
  24669. progress: {
  24670. type: "f",
  24671. value: 0
  24672. },
  24673. blackout: {
  24674. type: "i",
  24675. value: 0
  24676. },
  24677. pano0Map: {
  24678. type: "t",
  24679. value: null
  24680. },
  24681. pano0Position: {
  24682. type: "v3",
  24683. value: new n.Vector3
  24684. },
  24685. pano0Matrix: {
  24686. type: "m4",
  24687. value: new n.Matrix4
  24688. },
  24689. pano1Map: {
  24690. type: "t",
  24691. value: null
  24692. },
  24693. pano1Position: {
  24694. type: "v3",
  24695. value: new n.Vector3
  24696. },
  24697. pano1Matrix: {
  24698. type: "m4",
  24699. value: new n.Matrix4
  24700. }
  24701. },
  24702. 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",
  24703. 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"
  24704. },
  24705. hot:{
  24706. uniforms:{
  24707. color:{
  24708. type: "c",
  24709. value: new n.Color( 0xff2200 )
  24710. },
  24711. opac:{
  24712. type: "f",
  24713. value: 0
  24714. },
  24715. texture1:{
  24716. type: "t",
  24717. value: null
  24718. },
  24719. texture2:{
  24720. type: "t",
  24721. value: null
  24722. }
  24723. },
  24724. vertexShader:"varying vec2 vUv;\n\nvoid main() {\n\n vUv = uv ;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n",
  24725. fragmentShader:"varying vec3 vNormal;\n\nvarying vec2 vUv;\n\nuniform float opac;\n\nuniform vec3 color;\n\nuniform sampler2D texture1;\n\nuniform sampler2D texture2;\n\nvoid main() {\n\nvec4 tcolor1 = texture2D( texture1, vUv );\n\nvec4 tcolor2 = texture2D( texture2, vUv );\n\ngl_FragColor = mix(tcolor1,tcolor2 ,opac) + tcolor2*0.2; }\n"
  24726. },
  24727. modelOutside: {
  24728. uniforms: {
  24729. map: {
  24730. type: "t",
  24731. value: null
  24732. },
  24733. opacity: {
  24734. type: "f",
  24735. value: 1
  24736. }
  24737. },
  24738. vertexShader: o + "varying vec2 vUv;\n\nvoid main() {\n\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n",
  24739. 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"
  24740. },
  24741. ribbon: {
  24742. uniforms: {
  24743. map: {
  24744. type: "t",
  24745. value: null
  24746. },
  24747. opacity: {
  24748. type: "f",
  24749. value: 1
  24750. },
  24751. color: {
  24752. type: "c",
  24753. value: new n.Color(r.path.color)
  24754. }
  24755. },
  24756. 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",
  24757. 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"
  24758. },
  24759. waypoint: {
  24760. uniforms: {
  24761. map: {
  24762. type: "t",
  24763. value: null
  24764. },
  24765. opacity: {
  24766. type: "f",
  24767. value: 1
  24768. },
  24769. pulse: {
  24770. type: "f",
  24771. value: 1
  24772. },
  24773. nearFade: {
  24774. type: "v2",
  24775. value: new n.Vector2(2 * r.insideNear,2 * r.path.waypointIndoorRadius)
  24776. },
  24777. color: {
  24778. type: "c",
  24779. value: new n.Color(r.reticuleColor)
  24780. }
  24781. },
  24782. 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",
  24783. 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"
  24784. },
  24785. modelDebug: {
  24786. uniforms: {
  24787. map: {
  24788. type: "t",
  24789. value: null
  24790. },
  24791. modelAlpha: {
  24792. type: "f",
  24793. value: r.modelAlpha
  24794. },
  24795. depthmapRatio: {
  24796. type: "f",
  24797. value: 0
  24798. },
  24799. opacity: {
  24800. type: "f",
  24801. value: 1
  24802. },
  24803. progress: {
  24804. type: "f",
  24805. value: 0
  24806. },
  24807. considerOcclusion: {
  24808. type: "i",
  24809. value: r.fancierTransition
  24810. },
  24811. highlightPanoSelection: {
  24812. type: "i",
  24813. value: 0
  24814. },
  24815. useThirdPano: {
  24816. type: "i",
  24817. value: r.useThirdPano
  24818. },
  24819. pano0Map: {
  24820. type: "t",
  24821. value: null
  24822. },
  24823. pano0Depth: {
  24824. type: "t",
  24825. value: null
  24826. },
  24827. pano0Position: {
  24828. type: "v3",
  24829. value: new n.Vector3
  24830. },
  24831. pano0Matrix: {
  24832. type: "m4",
  24833. value: new n.Matrix4
  24834. },
  24835. pano0Weight: {
  24836. type: "f",
  24837. value: r.transition.pano0Weight
  24838. },
  24839. pano1Map: {
  24840. type: "t",
  24841. value: null
  24842. },
  24843. pano1Depth: {
  24844. type: "t",
  24845. value: null
  24846. },
  24847. pano1Position: {
  24848. type: "v3",
  24849. value: new n.Vector3
  24850. },
  24851. pano1Matrix: {
  24852. type: "m4",
  24853. value: new n.Matrix4
  24854. },
  24855. pano1Weight: {
  24856. type: "f",
  24857. value: r.transition.pano1Weight
  24858. },
  24859. pano2Map: {
  24860. type: "t",
  24861. value: null
  24862. },
  24863. pano2Depth: {
  24864. type: "t",
  24865. value: null
  24866. },
  24867. pano2Position: {
  24868. type: "v3",
  24869. value: new n.Vector3
  24870. },
  24871. pano2Matrix: {
  24872. type: "m4",
  24873. value: new n.Matrix4
  24874. },
  24875. pano2Weight: {
  24876. type: "f",
  24877. value: r.transition.pano2Weight
  24878. }
  24879. },
  24880. 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",
  24881. 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"
  24882. },
  24883. customDepth: {
  24884. uniforms: {
  24885. panoPosition: {
  24886. type: "v3",
  24887. value: new n.Vector3
  24888. }
  24889. },
  24890. 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",
  24891. 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"
  24892. },
  24893. skysphere: {
  24894. uniforms: {
  24895. radius: {
  24896. type: "f",
  24897. value: 0
  24898. }
  24899. },
  24900. 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",
  24901. 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"
  24902. },
  24903. tagDisc: {
  24904. uniforms: {
  24905. opacity: {
  24906. type: "f",
  24907. value: 0
  24908. },
  24909. color: {
  24910. type: "c",
  24911. value: new n.Color
  24912. },
  24913. bg: {
  24914. type: "t",
  24915. value: null
  24916. },
  24917. mask: {
  24918. type: "t",
  24919. value: null
  24920. }
  24921. },
  24922. vertexShader: o + "varying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}",
  24923. 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"
  24924. }
  24925. }
  24926. }
  24927. , {
  24928. "./settings": 166,
  24929. three: 217
  24930. }],
  24931. 168: [function(e, t, i) {
  24932. (function(i) {
  24933. "use strict";
  24934. var n = e("three")
  24935. , r = (e("url"),
  24936. e("./util/ajax"))
  24937. , o = e("./settings")
  24938. , a = e("./util/logger")
  24939. , s = e("./util/math")
  24940. , l = e("./util/showcase")
  24941. , c = e("./objects/Panorama")
  24942. , h = new a(i)
  24943. , u = e("./model/Model")
  24944. , d = e("./shaders")
  24945. , p = e("./util/transitions")
  24946. , f = e("./objects/Chunk")
  24947. , g = e("./objects/Reticule")
  24948. , m = e("./objects/Skybox")
  24949. , v = e("./objects/Floor")
  24950. , A = e("./cameras/DollhouseCamera")
  24951. , y = e("./cameras/FloorplanCamera")
  24952. , C = e("./cameras/PanoramaCamera")
  24953. , I = e("./controls/DollhouseControls")
  24954. , E = e("./controls/FloorplanControls")
  24955. , b = e("./controls/PanoramaControls");
  24956. n.ImageUtils.crossOrigin = o.crossOrigin,
  24957. t.exports = {
  24958. shaders: d,
  24959. transitions: p,
  24960. Model: u,
  24961. Chunk: f,
  24962. Floor: v,
  24963. Skybox: m,
  24964. Reticule: g,
  24965. Panorama: c,
  24966. DollhouseCamera: A,
  24967. FloorplanCamera: y,
  24968. PanoramaCamera: C,
  24969. DollhouseControls: I,
  24970. FloorplanControls: E,
  24971. PanoramaControls: b,
  24972. getModel: function(e) {
  24973. if (!e.url)
  24974. throw 'getModel(): missing parameter "url"';
  24975. e.autoload = void 0 === e.autoload || e.autoload;
  24976. var t = l.parseSidUrl(e.url);
  24977. e.urlBase = t.urlBase,
  24978. e.urlModel = t.urlModel,
  24979. e.urlFiles = t.urlFiles;
  24980. var i = this._getPlatformError();
  24981. return i ? $.Deferred().reject(i).promise() : (this.options = e,
  24982. this._loadModel().then(this._buildModel.bind(this)))
  24983. },
  24984. _getPlatformError: function() {
  24985. 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"
  24986. },
  24987. _loadModel: function() {
  24988. return r.get(this.options.urlModel, {
  24989. responseType: "json",
  24990. prefetchFrom: "model",
  24991. auth: l.getAuthorizationHeader()
  24992. }).then(null, function() {
  24993. return h.warn("Model loading failed at initial metadata load"),
  24994. "loading-failed"
  24995. })
  24996. },
  24997. _buildModel: function(e) {
  24998. e = l.normalizeModeldata(e, s);
  24999. var t = new u(this.options,e);
  25000. return this.options.autoload ? t.load(!0) : $.when(t)
  25001. }
  25002. }
  25003. }
  25004. ).call(this, "/js/showcase.js")
  25005. }
  25006. , {
  25007. "./cameras/DollhouseCamera": 5,
  25008. "./cameras/FloorplanCamera": 6,
  25009. "./cameras/PanoramaCamera": 7,
  25010. "./controls/DollhouseControls": 10,
  25011. "./controls/FloorplanControls": 11,
  25012. "./controls/PanoramaControls": 13,
  25013. "./model/Model": 139,
  25014. "./objects/Chunk": 144,
  25015. "./objects/Floor": 146,
  25016. "./objects/Panorama": 148,
  25017. "./objects/Reticule": 149,
  25018. "./objects/Skybox": 152,
  25019. "./settings": 166,
  25020. "./shaders": 167,
  25021. "./util/ajax": 181,
  25022. "./util/logger": 189,
  25023. "./util/math": 190,
  25024. "./util/showcase": 193,
  25025. "./util/transitions": 195,
  25026. three: 217,
  25027. url: 208
  25028. }],
  25029. 169: [function(e, t, i) {
  25030. "use strict";
  25031. function n() {
  25032. var e = {
  25033. renderTarget: null,
  25034. inUse: !1,
  25035. size: -1,
  25036. pano: null
  25037. };
  25038. return e
  25039. }
  25040. function r(e) {
  25041. M.push(e)
  25042. }
  25043. function o(e) {
  25044. var t = n();
  25045. return t.inUse = !0,
  25046. t.size = e,
  25047. r(t),
  25048. t
  25049. }
  25050. function a(e) {
  25051. for (var t = 0; t < M.length; t++) {
  25052. var i = M[t];
  25053. if (!i.inUse && i.size === e)
  25054. return i.inUse = !0,
  25055. i
  25056. }
  25057. return null
  25058. }
  25059. function s(e) {
  25060. for (var t = 0; t < M.length; t++) {
  25061. var i = M[t];
  25062. if (i.renderTarget === e)
  25063. return i.inUse = !1,
  25064. !0
  25065. }
  25066. return !1
  25067. }
  25068. function l() {
  25069. this.tileDirectory = {},
  25070. this.activeRenderTargetDescriptors = {},
  25071. this.activePanos = [],
  25072. this.panoLODDescriptors = {},
  25073. this.panoDescriptors = {},
  25074. this.tileTrees = {},
  25075. this.sceneRenderer = null,
  25076. this.tileDownloader = null,
  25077. this.forceQueue = [],
  25078. this.uploadQueues = {},
  25079. this.uploadInterval = null,
  25080. this.uploadIntervalCancelled = !1,
  25081. this.usingTileOverlay = !1,
  25082. this.overlayTilesLoaded = !1,
  25083. this.overlayTileBase = null,
  25084. this.overlayTilesBasic = {},
  25085. this.overlayTilesEnhanced = {},
  25086. this.zoomRenderTarget = null,
  25087. this.zoomPano = null,
  25088. this.zoomingActive = !1,
  25089. this.zoomPanoId = null,
  25090. this.zoomPanoRenderingDisabled = !1,
  25091. this.direction = new h.Vector3,
  25092. this.initTime = -1,
  25093. this.maxBaseUploadsPerFrame = x,
  25094. this.maxNonBaseUploadsPerFrame = T
  25095. }
  25096. function c() {
  25097. this.uploadIntervalCancelled || (this.overlayTilesLoaded || !this.usingTileOverlay ? (b = !0,
  25098. this.updateUploadQueue(this.maxNonBaseUploadsPerFrame, this.maxBaseUploadsPerFrame),
  25099. this.peekNextFromUploadQueue() ? this.refreshUploadInterval(w) : this.uploadInterval = null) : this.refreshUploadInterval(this.uploadIntervalDelay))
  25100. }
  25101. var h = e("three")
  25102. , u = e("../exception/BasicException")
  25103. , d = e("../settings")
  25104. , p = e("../enum/PanoSizeClass")
  25105. , f = (e("../objects/Panorama"),
  25106. e("../enum/PanoRendererEvents"))
  25107. , g = e("../enum/SceneRendererEvents")
  25108. , m = e("../enum/TileDownloaderEvents")
  25109. , v = e("../enum/Vectors")
  25110. , A = (e("../enum/GLCubeFaces"),
  25111. e("../objects/Panorama"),
  25112. e("./TileTree"))
  25113. , y = (e("./TileDownloader"),
  25114. e("./TilePrioritizer"))
  25115. , C = e("./TileUtils")
  25116. , p = e("../enum/PanoSizeClass")
  25117. , I = (e("../util/browser"),
  25118. e("../util/panorama"))
  25119. , E = e("events").EventEmitter
  25120. , b = !1
  25121. , w = d.tiling.uploadIntervalDelay
  25122. , _ = d.tiling.initialIntervalDelay
  25123. , T = d.tiling.maxNonBaseUploadsPerFrame
  25124. , x = d.tiling.maxBaseUploadsPerFrame
  25125. , S = {
  25126. Base: 0,
  25127. Remaining: 1
  25128. }
  25129. , M = [];
  25130. l.prototype = Object.create(E.prototype),
  25131. l.prototype.init = function(e, t, i) {
  25132. this.sceneRenderer = e,
  25133. this.tileDownloader = t,
  25134. this.qualityManager = i,
  25135. this.bindEvents(),
  25136. this.sceneRenderer.on(g.ContextCreated, this.loadOverlayTiles.bind(this)),
  25137. this.initTime = performance.now()
  25138. }
  25139. ,
  25140. l.prototype.getActivePanoTextures = function(e) {
  25141. e = e || [];
  25142. for (var t = 0; t < M.length; t++) {
  25143. var i = M[t];
  25144. i.renderTarget && i.renderTarget.texture && e.push(i.renderTarget.texture)
  25145. }
  25146. }
  25147. ,
  25148. l.prototype.hasQueuedTiles = function() {
  25149. var e = this.peekNextFromUploadQueue();
  25150. return null !== e && void 0 !== e
  25151. }
  25152. ,
  25153. l.prototype.getActiveRenderTargetDescriptor = function(e) {
  25154. return this.activeRenderTargetDescriptors[e]
  25155. }
  25156. ,
  25157. l.prototype.setActiveRenderTargetDescriptor = function(e, t) {
  25158. this.activeRenderTargetDescriptors[e] = t
  25159. }
  25160. ,
  25161. l.prototype.loadOverlayTiles = function() {
  25162. if (0 !== d.tiling.overlayStyle) {
  25163. var e = 0
  25164. , t = function(t, n, r) {
  25165. t = n ? t[n] = this.sceneRenderer.initSizedTexture2D(C.TILE_SIZE, h.ClampToEdgeWrapping) : this.overlayTileBase = this.sceneRenderer.initSizedTexture2D(C.TILE_SIZE, h.ClampToEdgeWrapping),
  25166. this.sceneRenderer.uploadTexture2D(r, t, 0, 0, C.TILE_SIZE, C.TILE_SIZE),
  25167. e++,
  25168. e === i.length && (this.overlayTilesLoaded = !0)
  25169. }
  25170. .bind(this)
  25171. , 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)]];
  25172. i.forEach(function(e) {
  25173. this.tileDownloader.loadImage(e[0], 0, e[1])
  25174. }
  25175. .bind(this)),
  25176. this.usingTileOverlay = !0
  25177. } else
  25178. this.usingTileOverlay = !1
  25179. }
  25180. ,
  25181. l.prototype.bindEvents = function() {
  25182. this.tileDownloader.on(m.TileDownloadSuccess, this.onTileDownloaded.bind(this))
  25183. }
  25184. ,
  25185. l.prototype.setupZoomRenderTarget = function() {
  25186. if (this.qualityManager.getMaxZoomPanoSize() >= this.qualityManager.getMaxNavPanoSize()) {
  25187. if (this.zoomRenderTarget && this.zoomRenderTarget.width === this.qualityManager.getMaxZoomPanoSize())
  25188. return;
  25189. var e = this.zoomRenderTarget;
  25190. if (this.zoomRenderTarget = this.initTiledPano(this.qualityManager.getMaxZoomPanoSize(), !1),
  25191. e) {
  25192. var t = e.width
  25193. , i = this.zoomRenderTarget.width;
  25194. this.sceneRenderer.copyCubeMap(e.texture, this.zoomRenderTarget, t, t, i, i),
  25195. e.texture.dispose(),
  25196. e.texture.loaded = !1,
  25197. e.texture.version = 0,
  25198. this.sceneRenderer.deallocateCubeTexture(e.texture),
  25199. e.texture = null
  25200. }
  25201. this.zoomPanoRenderingDisabled = !1
  25202. } else
  25203. this.zoomPanoRenderingDisabled = !0
  25204. }
  25205. ,
  25206. l.prototype.enableUltraHighQualityMode = function(e) {
  25207. if (!this.qualityManager.ultraHighQualityModeEnabled()) {
  25208. var t = this.qualityManager.getPanoSize(p.ULTRAHIGH);
  25209. this.tileDownloader.testDownload(t, C.TILE_SIZE, function(t) {
  25210. t && (this.qualityManager.enableUltraHighQualityMode(),
  25211. this.setupZoomRenderTarget(),
  25212. e())
  25213. }
  25214. .bind(this))
  25215. }
  25216. }
  25217. ,
  25218. l.prototype.activateTiledPano = function(e, t, i) {
  25219. i && this.clearAllQueuedUploads();
  25220. for (var n = 0; n < C.FACES_PER_PANO; n++)
  25221. this.initTileTree(e.id, n, this.qualityManager.getMaxPossiblePanoSize());
  25222. this.linkAllTilesAndNodes(e);
  25223. var r = this.getActiveRenderTargetDescriptor(e.id)
  25224. , l = t;
  25225. if (l > this.qualityManager.getMaxNavPanoSize() && (l = this.qualityManager.getMaxNavPanoSize()),
  25226. !r || l !== r.size) {
  25227. if (r && s(r.renderTarget),
  25228. r = a(l),
  25229. !r) {
  25230. var c = this.initTiledPano(l, !1);
  25231. r = o(c.width),
  25232. r.renderTarget = c
  25233. }
  25234. r.pano = e,
  25235. this.resetPanoDescriptor(e.id),
  25236. this.resetPanoLODDescriptors(e.id),
  25237. this.resetRenderStatus(e.id, !0, !0)
  25238. }
  25239. this.setActiveRenderTargetDescriptor(e.id, r);
  25240. var h = i ? 0 : 1;
  25241. return this.updateActivePanos(e, h),
  25242. r.renderTarget
  25243. }
  25244. ,
  25245. l.prototype.deactivateTiledPano = function(e) {
  25246. var t = this.getActiveRenderTargetDescriptor(e.id);
  25247. this.isRenderTargetDescriptorValid(t) && s(t.renderTarget),
  25248. this.setActiveRenderTargetDescriptor(e.id, null);
  25249. var i = this.getUploadQueueForPano(e.id);
  25250. this.clearUploadQueue(i),
  25251. this.updateActivePanos()
  25252. }
  25253. ,
  25254. l.prototype.updateActivePanos = function() {
  25255. var e = [];
  25256. return function(t, i) {
  25257. e.length = 0;
  25258. for (var n = 0; n < this.activePanos.length; n++) {
  25259. t && e.length === i && e.push(t);
  25260. var r = this.activePanos[n]
  25261. , o = this.getActiveRenderTargetDescriptor(r.id);
  25262. t && r.id === t.id || !this.isRenderTargetDescriptorValid(o) || e.push(r)
  25263. }
  25264. t && i >= e.length && e.push(t),
  25265. this.activePanos.length = 0,
  25266. this.activePanos.push.apply(this.activePanos, e)
  25267. }
  25268. }(),
  25269. l.prototype.getActivePanoCount = function() {
  25270. return this.activePanos.length
  25271. }
  25272. ,
  25273. l.prototype.resetRenderStatus = function(e, t, i, n) {
  25274. var r = null;
  25275. n && (r = A.getLevelCountForSize(C.TILE_SIZE, n) + 1);
  25276. for (var o = function(e, n, r, o) {
  25277. i && (n.tile.zoomUploaded = !1),
  25278. t && (n.tile.uploaded = !1)
  25279. }, a = 0; a < C.FACES_PER_PANO; a++) {
  25280. var s = this.getTileTree(e, a);
  25281. s.breadthFirst({
  25282. callback: o.bind(this, a),
  25283. minLevel: r
  25284. })
  25285. }
  25286. }
  25287. ,
  25288. l.prototype.copyBaseRenderStatusToZoomed = function(e) {
  25289. for (var t = A.getLevelCountForSize(C.TILE_SIZE, this.qualityManager.getMaxNavPanoSize()), i = function(e, t, i, n) {
  25290. t.tile.zoomUploaded = t.tile.uploaded,
  25291. t.zoomCovered = t.covered
  25292. }, n = 0; n < C.FACES_PER_PANO; n++) {
  25293. var r = this.getTileTree(e, n);
  25294. r.breadthFirst({
  25295. callback: i.bind(this, n),
  25296. maxLevel: t
  25297. })
  25298. }
  25299. }
  25300. ,
  25301. l.prototype.renderPanoTiles = function() {
  25302. var e = [];
  25303. return function(t, i, n, r) {
  25304. this.zoomRenderTarget && this.zoomRenderTarget.width === this.qualityManager.getMaxZoomPanoSize() || this.zoomPanoRenderingDisabled || this.setupZoomRenderTarget(),
  25305. i = i || this.direction || v.FORWARD;
  25306. var o = this.getActiveRenderTargetDescriptor(t);
  25307. if (!this.isRenderTargetDescriptorValid(o))
  25308. throw new u("PanoRenderer.renderPanoTiles() -> Cannot render to a pano that is not activated.");
  25309. for (var a = 0; a < C.FACES_PER_PANO; a++) {
  25310. var s = this.getTileTree(t, a);
  25311. e.length = 0,
  25312. s.breadthFirst({
  25313. saveVisited: e
  25314. });
  25315. for (var l = 0; l < e.length; l++) {
  25316. var c = e[l];
  25317. this.queueTileUpload(c.tile, !1, r || 0 === l && n)
  25318. }
  25319. }
  25320. this.updateDirection(i)
  25321. }
  25322. }(),
  25323. l.prototype.isRenderTargetDescriptorValid = function(e) {
  25324. return e && e.renderTarget
  25325. }
  25326. ,
  25327. l.prototype.isPanoActive = function(e) {
  25328. var t = this.getActiveRenderTargetDescriptor(e);
  25329. return this.isRenderTargetDescriptorValid(t)
  25330. }
  25331. ,
  25332. l.prototype.isPanoZoomed = function(e) {
  25333. return this.zoomingActive && this.zoomPanoId === e
  25334. }
  25335. ,
  25336. l.prototype.initTileTree = function(e, t, i) {
  25337. var n = this.tileTrees[e];
  25338. n || (n = [],
  25339. this.tileTrees[e] = n);
  25340. var r = n[t];
  25341. if (!r) {
  25342. var o = A.getLevelCountForSize(C.TILE_SIZE, i);
  25343. r = new A(C.TILE_SIZE,o),
  25344. n[t] = r
  25345. }
  25346. }
  25347. ,
  25348. l.prototype.getTileTree = function(e, t) {
  25349. var i = this.tileTrees[e];
  25350. if (!i)
  25351. throw new u("PanoRenderer.getTileTree() -> Tree array not yet initialized!");
  25352. var n = i[t];
  25353. if (!n)
  25354. throw new u("PanoRenderer.getTileTree() -> Tree not yet initialized!");
  25355. return n
  25356. }
  25357. ,
  25358. l.prototype.initTiledPano = function(e, t) {
  25359. var i = this.sceneRenderer.renderer
  25360. , n = (i.context,
  25361. new h.WebGLRenderTargetCube(e,e,{
  25362. stencilBuffer: !1
  25363. }))
  25364. , r = new h.CubeTexture([]);
  25365. n.texture = r,
  25366. r.image = [null, null, null, null, null, null],
  25367. r.flipY = !0,
  25368. t ? (r.generateMipmaps = !0,
  25369. r.magFilter = h.LinearFilter,
  25370. r.minFilter = h.LinearMipMapLinearFilter) : (r.generateMipmaps = !1,
  25371. r.magFilter = h.LinearFilter,
  25372. r.minFilter = h.LinearFilter),
  25373. r.format = h.RGBAFormat,
  25374. i.setRenderTarget(n),
  25375. i.setRenderTarget(null);
  25376. var o = i.properties.get(r);
  25377. return o.__image__webglTextureCube = o.__webglTexture,
  25378. n
  25379. }
  25380. ,
  25381. l.prototype.getUploadQueueForPano = function(e) {
  25382. var t = this.uploadQueues[e];
  25383. return t || (t = [],
  25384. this.uploadQueues[e] = t),
  25385. t
  25386. }
  25387. ,
  25388. l.prototype.isTileUploaded = function(e) {
  25389. return this.isPanoZoomed(e.panoId) ? e.zoomUploaded : e.uploaded
  25390. }
  25391. ,
  25392. l.prototype.setUploaded = function(e, t) {
  25393. this.isPanoZoomed(e.panoId) ? e.zoomUploaded = t : e.uploaded = t
  25394. }
  25395. ,
  25396. l.prototype.queueTileUpload = function(e, t, i) {
  25397. var n = this.getActiveRenderTargetDescriptor(e.panoId);
  25398. if (this.isRenderTargetDescriptorValid(n) && e.downloaded && !this.isTileUploaded(e) && (!e.uploadQueued || i) && (!(e.panoSize > this.qualityManager.getMaxNavPanoSize()) || this.zoomingActive)) {
  25399. var r = this.getUploadQueueForPano(e.panoId);
  25400. 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),
  25401. e.uploadQueued = !0,
  25402. this.uploadInterval || this.uploadIntervalCancelled || this.refreshUploadInterval(0))
  25403. }
  25404. }
  25405. ,
  25406. l.prototype.shoulPushToFrontOfQueue = function(e) {
  25407. return 0 === A.getLevelCountForSize(C.TILE_SIZE, e.panoSize)
  25408. }
  25409. ,
  25410. l.prototype.getTopUploadQueue = function() {
  25411. for (var e = null, t = null, i = S.Base; i <= S.Remaining; i++)
  25412. for (var n = 0; n < this.activePanos.length; n++)
  25413. if (e = this.activePanos[n],
  25414. t = this.getUploadQueueForPano(e.id),
  25415. t.length > 0)
  25416. switch (i) {
  25417. case S.Base:
  25418. if (0 === t[0].level)
  25419. return t;
  25420. break;
  25421. case S.Remaining:
  25422. return t
  25423. }
  25424. return null
  25425. }
  25426. ,
  25427. l.prototype.getNextFromUploadQueue = function() {
  25428. var e = function(e) {
  25429. var t = e.shift();
  25430. return t.uploadQueued = !1,
  25431. t
  25432. };
  25433. return function() {
  25434. if (this.forceQueue.length > 0)
  25435. return e(this.forceQueue);
  25436. var t = this.getTopUploadQueue();
  25437. return t && t.length > 0 ? e(t) : null
  25438. }
  25439. }(),
  25440. l.prototype.peekNextFromUploadQueue = function() {
  25441. if (this.forceQueue.length > 0)
  25442. return this.forceQueue[0];
  25443. var e = this.getTopUploadQueue();
  25444. return e && e.length > 0 ? e[0] : null
  25445. }
  25446. ,
  25447. l.prototype.clearAllQueuedUploads = function() {
  25448. this.clearAllUploadQueues(null, 0)
  25449. }
  25450. ,
  25451. l.prototype.clearAllQueuedUploadsForPano = function(e) {
  25452. this.clearAllUploadQueues(e, 0)
  25453. }
  25454. ,
  25455. l.prototype.clearAllUploadQueues = function(e, t) {
  25456. if (e)
  25457. this.clearUploadQueue(this.getUploadQueueForPano(e), t),
  25458. this.clearUploadQueue(this.forceQueue, t, e);
  25459. else {
  25460. for (var i = 0; i < this.activePanos.length; i++) {
  25461. var n = this.activePanos[i];
  25462. this.clearUploadQueue(this.getUploadQueueForPano(n.id), t)
  25463. }
  25464. this.clearUploadQueue(this.forceQueue, t)
  25465. }
  25466. }
  25467. ,
  25468. l.prototype.clearUploadQueue = function(e, t, i) {
  25469. void 0 !== t && null !== t || (t = 0);
  25470. for (var n = 0; n < e.length; ) {
  25471. var r = e[n];
  25472. (!i || i && i === r.tile.panoId) && r.level >= t ? (r.uploadQueued = !1,
  25473. e.splice(n, 1)) : n++
  25474. }
  25475. }
  25476. ,
  25477. l.prototype.refreshUploadInterval = function() {
  25478. var e = null;
  25479. return function(t) {
  25480. this.uploadIntervalCancelled || (e || (e = c.bind(this)),
  25481. null !== t && void 0 !== t || (t = w),
  25482. b || (t = _),
  25483. this.uploadInterval = window.setTimeout(e, t),
  25484. this.uploadIntervalDelay = t)
  25485. }
  25486. }(),
  25487. l.prototype.update = function() {
  25488. var e = performance.now()
  25489. , t = 0;
  25490. return function() {
  25491. this.uploadIntervalCancelled = !0,
  25492. window.clearTimeout(this.uploadInterval),
  25493. this.uploadInterval = null;
  25494. var i = performance.now() - e;
  25495. !(i > w || 0 === t) || !this.overlayTilesLoaded && this.usingTileOverlay || (this.updateUploadQueue(this.maxNonBaseUploadsPerFrame, this.maxBaseUploadsPerFrame),
  25496. e = performance.now()),
  25497. t++
  25498. }
  25499. }(),
  25500. l.prototype.updateUploadQueue = function(e, t) {
  25501. e || (e = 1);
  25502. for (var i = 0, n = 0; ; ) {
  25503. if (n >= t || i >= e)
  25504. break;
  25505. var r = this.getNextFromUploadQueue();
  25506. if (!r)
  25507. break;
  25508. if (0 !== r.level ? i++ : n++,
  25509. !(r.panoSize > this.qualityManager.getMaxNavPanoSize()) || this.zoomingActive) {
  25510. var o = this.getActiveRenderTargetDescriptor(r.panoId);
  25511. this.isRenderTargetDescriptorValid(o) && this.uploadTile(r, r.forceUpload)
  25512. }
  25513. }
  25514. }
  25515. ,
  25516. l.prototype.updateDirection = function(e) {
  25517. if (e = e || this.direction) {
  25518. this.direction = e;
  25519. for (var t = 0; t < this.activePanos.length; t++) {
  25520. var i = this.activePanos[t]
  25521. , n = this.getUploadQueueForPano(i.id);
  25522. y.sortPanoTiles(n, i, this.direction)
  25523. }
  25524. }
  25525. }
  25526. ,
  25527. l.prototype.uploadTile = function() {
  25528. var e = {}
  25529. , t = (new h.Vector4,
  25530. d.tiling.overlayStyle);
  25531. return function(i, n) {
  25532. var r = i.panoId
  25533. , o = i.image
  25534. , a = i.tileSize
  25535. , s = i.panoSize
  25536. , l = i.tileIndex
  25537. , c = (i.faceTileIndex,
  25538. i.totalTiles)
  25539. , u = (i.face,
  25540. i.tileX)
  25541. , d = i.tileY
  25542. , p = !0
  25543. , g = !1
  25544. , m = (this.getPanoDescriptor(r),
  25545. this.getPanoLODDescriptor(r, s))
  25546. , v = this.getActiveRenderTargetDescriptor(r)
  25547. , A = v.renderTarget
  25548. , y = v.size;
  25549. if (this.isPanoZoomed(r) && (A = this.zoomRenderTarget,
  25550. y = this.qualityManager.getMaxZoomPanoSize()),
  25551. this.isRenderTargetDescriptorValid(v) || (p = !1,
  25552. g = !1),
  25553. n || (this.anyUploaded(i.node) && (p = !1,
  25554. g = !0),
  25555. this.isTileUploaded(i) && (p = !1,
  25556. g = !1)),
  25557. p) {
  25558. var C = u * a
  25559. , I = d * a
  25560. , E = a / s * y
  25561. , b = C / s * y
  25562. , w = I / s * y;
  25563. e[a] || (e[a] = this.sceneRenderer.initSizedTexture2D(a, h.ClampToEdgeWrapping));
  25564. var _ = e[a];
  25565. if (this.sceneRenderer.uploadTexture2D(o, _, 0, 0, a, a),
  25566. 1 === t || 2 === t) {
  25567. var T = 1 === t ? this.overlayTilesBasic : this.overlayTilesEnhanced;
  25568. this.sceneRenderer.renderToCubeMap(_, A, a, a, 0, 0, a, a, b, w, E, E, i.cubeFace),
  25569. this.sceneRenderer.renderToCubeMap(T[s], A, a, a, 0, 0, a, a, b, w, E, E, i.cubeFace, h.NormalBlending, !0, .5)
  25570. } else
  25571. this.sceneRenderer.renderToCubeMap(_, A, a, a, 0, 0, a, a, b, w, E, E, i.cubeFace);
  25572. m.uploadCount++,
  25573. this.emit(f.TileRenderSuccess, r, s, l, c),
  25574. m.uploadCount === c && this.emit(f.PanoRenderComplete, r, s, c),
  25575. this.setUploaded(i, !0),
  25576. this.addCoverageForNode(i.node)
  25577. } else
  25578. this.setUploaded(i, !1);
  25579. return i.uploadAttempted || (m.uploadAttempts++,
  25580. this.emit(f.TileUploadAttempted, r, s, l, c)),
  25581. i.uploadAttempted = !0,
  25582. m.uploadAttempts === c && this.emit(f.UploadAttemptedForAllTiles, r, s, c),
  25583. g
  25584. }
  25585. }(),
  25586. l.prototype.linkTileAndNode = function(e, t) {
  25587. t.tile = e,
  25588. e.node = t
  25589. }
  25590. ,
  25591. l.prototype.linkAllTilesAndNodes = function(e) {
  25592. for (var t = function(t, i, n, r, o) {
  25593. var a = this.getTileDirectoryEntry(e.id, i, r, o);
  25594. this.linkTileAndNode(a, n)
  25595. }, i = 0; i < C.FACES_PER_PANO; i++) {
  25596. var n = this.getTileTree(e.id, i);
  25597. n.breadthFirst({
  25598. callback: t.bind(this, n, i)
  25599. })
  25600. }
  25601. }
  25602. ,
  25603. l.prototype.anyUploaded = function(e) {
  25604. if (!e)
  25605. return !1;
  25606. if (e.tile && this.isTileUploaded(e.tile))
  25607. return !0;
  25608. if (e.children)
  25609. for (var t = 0; t < e.children.length; t++) {
  25610. var i = e.children[t];
  25611. if (this.anyUploaded(i))
  25612. return !0
  25613. }
  25614. return !1
  25615. }
  25616. ,
  25617. l.prototype.setNodeCovered = function(e, t) {
  25618. this.isPanoZoomed(e.tile.panoId) ? e.zoomCovered = t : e.covered = t
  25619. }
  25620. ,
  25621. l.prototype.isNodeCovered = function(e) {
  25622. return !!e && (this.isPanoZoomed(e.tile.panoId) ? e.zoomCovered : e.covered)
  25623. }
  25624. ,
  25625. l.prototype.addCoverageForNode = function(e) {
  25626. if (this.setNodeCovered(e, !0),
  25627. e.parent && e.covered) {
  25628. var t = e.parent;
  25629. this.nodeSubcovered(t) && this.addCoverageForNode(t, !0)
  25630. }
  25631. }
  25632. ,
  25633. l.prototype.calcFullCoverage = function(e) {
  25634. var t = !1;
  25635. if (e.children)
  25636. for (var i = 0; i < e.children.length; i++) {
  25637. var n = e.children[i];
  25638. t = t || this.calcFullCoverage(n)
  25639. }
  25640. e.covered = e.tile.uploaded || t
  25641. }
  25642. ,
  25643. l.prototype.nodeSubcovered = function(e) {
  25644. if (!e.children)
  25645. return !1;
  25646. for (var t = 0; t < e.children.length; t++)
  25647. if (!e.children[t] || !this.isNodeCovered(e.children[t]))
  25648. return !1;
  25649. return !0
  25650. }
  25651. ,
  25652. l.prototype.resetPanoDescriptor = function(e) {
  25653. this.getPanoDescriptor(e)
  25654. }
  25655. ,
  25656. l.prototype.getPanoDescriptor = function(e) {
  25657. var t = this.panoDescriptors[e];
  25658. return t || (t = {},
  25659. this.panoDescriptors[e] = t),
  25660. t
  25661. }
  25662. ,
  25663. l.prototype.resetPanoLODDescriptors = function(e) {
  25664. var t = this.getPanoLODDescriptors(e);
  25665. for (var i in t)
  25666. if (t.hasOwnProperty(i)) {
  25667. var n = t[i];
  25668. n.uploadCount = 0,
  25669. n.uploadAttempts = 0
  25670. }
  25671. }
  25672. ,
  25673. l.prototype.getPanoLODDescriptor = function(e, t) {
  25674. var i = this.getPanoLODDescriptors(e)
  25675. , n = i[t];
  25676. return n || (n = {
  25677. uploadCount: 0,
  25678. uploadAttempts: 0
  25679. },
  25680. i[t] = n),
  25681. n
  25682. }
  25683. ,
  25684. l.prototype.getPanoLODDescriptors = function(e) {
  25685. var t = this.panoLODDescriptors[e];
  25686. return t || (t = {},
  25687. this.panoLODDescriptors[e] = t),
  25688. t
  25689. }
  25690. ,
  25691. l.prototype.onTileDownloaded = function(e) {
  25692. var t = A.getLevelCountForSize(C.TILE_SIZE, e.panoSize)
  25693. , i = this.getTileDirectoryEntry(e.panoId, e.face, t, e.faceTileIndex);
  25694. if (i.downloaded = !0,
  25695. i.image = e.image,
  25696. i.panoSize = e.panoSize,
  25697. i.tileX = e.tileX,
  25698. i.tileY = e.tileY,
  25699. i.totalTiles = e.totalTiles,
  25700. i.tileIndex = e.tileIndex,
  25701. i.faceTileIndex = e.faceTileIndex,
  25702. i.face = e.face,
  25703. i.cubeFace = I.mapFaceToCubemapFace(e.face),
  25704. i.panoId = e.panoId,
  25705. i.tileSize = e.tileSize,
  25706. i.direction = (new h.Vector3).copy(e.direction),
  25707. i.node = null,
  25708. i.level = A.getLevelCountForSize(C.TILE_SIZE, i.panoSize),
  25709. this.isPanoActive(i.panoId)) {
  25710. var n = this.getTileTree(i.panoId, i.face)
  25711. , r = n.getSubNode(i.panoSize, i.tileX, i.tileY);
  25712. this.linkTileAndNode(i, r),
  25713. this.queueTileUpload(i, !0)
  25714. }
  25715. }
  25716. ,
  25717. l.prototype.getTileDirectoryEntry = function(e, t, i, n) {
  25718. var r = this.tileDirectory[e];
  25719. r || (r = {},
  25720. this.tileDirectory[e] = r);
  25721. var o = 16384 * t + 1024 * i + n
  25722. , a = r[o];
  25723. return a || (a = {
  25724. downloaded: !1,
  25725. uploaded: !1,
  25726. zoomUploaded: !1
  25727. },
  25728. r[o] = a),
  25729. a._key = e + ":" + t + ":" + i + ":" + n,
  25730. a._tileKey = o,
  25731. a
  25732. }
  25733. ,
  25734. l.prototype.setZoomingActive = function(e, t, i) {
  25735. this.zoomPanoRenderingDisabled || e === this.zoomingActive && this.zoomPanoId === t.id || (this.zoomingActive = e,
  25736. this.zoomPanoId = t.id,
  25737. this.zoomingActive && (this.zoomPanoId !== t.id || i) && this.updateZoomedPanoFromBase(t))
  25738. }
  25739. ,
  25740. l.prototype.updateZoomedPanoFromBase = function(e) {
  25741. if (!this.zoomPanoRenderingDisabled) {
  25742. var t = this.getActiveRenderTargetDescriptor(e.id);
  25743. if (t && t.renderTarget) {
  25744. var i = this.qualityManager.getMaxZoomPanoSize()
  25745. , n = t.renderTarget
  25746. , r = t.size;
  25747. this.sceneRenderer.copyCubeMap(n.texture, this.zoomRenderTarget, r, r, i, i),
  25748. this.copyBaseRenderStatusToZoomed(e.id)
  25749. }
  25750. }
  25751. }
  25752. ,
  25753. t.exports = l
  25754. }
  25755. , {
  25756. "../enum/GLCubeFaces": 25,
  25757. "../enum/PanoRendererEvents": 35,
  25758. "../enum/PanoSizeClass": 36,
  25759. "../enum/SceneRendererEvents": 43,
  25760. "../enum/TileDownloaderEvents": 45,
  25761. "../enum/Vectors": 50,
  25762. "../exception/BasicException": 55,
  25763. "../objects/Panorama": 148,
  25764. "../settings": 166,
  25765. "../util/browser": 182,
  25766. "../util/panorama": 191,
  25767. "./TileDownloader": 171,
  25768. "./TilePrioritizer": 172,
  25769. "./TileTree": 173,
  25770. "./TileUtils": 174,
  25771. events: 202,
  25772. three: 217
  25773. }],
  25774. 170: [function(e, t, i) {
  25775. "use strict";
  25776. function n(e, t, i) {
  25777. this.maxNavPanoSize = -1,
  25778. this.maxZoomPanoSize = -1,
  25779. this.devicePixelDensity = e,
  25780. this.deviceScreenSize = t,
  25781. this.clientBandwidth = i,
  25782. this.panoSizeClassMap = {},
  25783. this.useHighResolutionPanos = !0,
  25784. this.useUltraHighResolutionPanos = !1,
  25785. this.modelHasUltraHighPanos = !1
  25786. }
  25787. var r = e("../enum/PanoSizeClass")
  25788. , o = e("../settings")
  25789. , a = e("../util/browser")
  25790. , s = e("../constants")
  25791. , l = e("../util/showcase")
  25792. , c = e("../enum/ModelManagerEvents");
  25793. n.prototype.init = function(e) {
  25794. this.buildPanoSizeClassMap(this.devicePixelDensity, this.deviceScreenSize, this.clientBandwidth),
  25795. this.ultraHighSize = this.getPanoSize(r.ULTRAHIGH),
  25796. this.highSize = this.getPanoSize(r.HIGH),
  25797. this.standardSize = this.getPanoSize(r.STANDARD),
  25798. this.baseSize = this.getPanoSize(r.BASE),
  25799. o.tiling.maxZoomPanoQuality && this.ultraHighSize <= o.tiling.maxZoomPanoQuality && (o.tiling.allowUltraHighResolution = !0),
  25800. this.highQualityThreshold = a.valueFromHash("threshold2k", s.windowHeightHighQualityThreshold),
  25801. this.updateMaximums(),
  25802. e.on(c.ActiveModelChanged, this.onModelChanged.bind(this))
  25803. }
  25804. ,
  25805. n.prototype.updateFromModel = function(e) {
  25806. this.updateHighResolutionSettings(e),
  25807. this.updateUltraHighResolutionSettings(e)
  25808. }
  25809. ,
  25810. n.prototype.updateHighResolutionSettings = function(e) {
  25811. //---------------------许钟文---------原始的会判断modeldata里version,以致useHighResolutionPanos为false,所以我直接变为true啦----------------------------------
  25812. l.modelDataPromisesTiles(e.data) ? this.useHighResolutionPanos = !0 : this.useHighResolutionPanos = !1,
  25813. //this.useHighResolutionPanos = !0;
  25814. //----------------------e n d -----------------------------------------------------------------
  25815. this.updateMaximums()
  25816. }
  25817. ,
  25818. n.prototype.updateUltraHighResolutionSettings = function(e) {
  25819. o.tiling.allowUltraHighResolution && this.modelHasUltraHighPanos ? this.useUltraHighResolutionPanos = !0 : this.useUltraHighResolutionPanos = !1,
  25820. this.updateMaximums()
  25821. }
  25822. ,
  25823. n.prototype.enableUltraHighQualityMode = function() {
  25824. this.modelHasUltraHighPanos = !0,
  25825. this.updateUltraHighResolutionSettings(null)
  25826. }
  25827. ,
  25828. n.prototype.ultraHighQualityModeEnabled = function() {
  25829. return this.modelHasUltraHighPanos
  25830. }
  25831. ,
  25832. n.prototype.onModelChanged = function(e) {
  25833. this.updateFromModel(e.model),
  25834. this.updateMaximums()
  25835. }
  25836. ,
  25837. n.prototype.updateMaximums = function() {
  25838. this.maxNavPanoSize = o.tiling.maxNavPanoQuality || this.detectMaxNavPanoSize(),
  25839. this.maxZoomPanoSize = o.tiling.maxZoomPanoQuality || this.detectMaxZoomPanoSize(),
  25840. this.maxZoomPanoSize < this.maxNavPanoSize && (this.maxNavPanoSize = this.maxZoomPanoSize)
  25841. }
  25842. ,
  25843. n.prototype.buildPanoSizeClassMap = function() {
  25844. this.panoSizeClassMap[r.BASE] = 512,
  25845. this.panoSizeClassMap[r.STANDARD] = 1024,
  25846. this.panoSizeClassMap[r.HIGH] = 2048,
  25847. this.panoSizeClassMap[r.ULTRAHIGH] = 4096
  25848. }
  25849. ,
  25850. n.prototype.getPanoSize = function(e) {
  25851. return this.panoSizeClassMap[e]
  25852. }
  25853. ,
  25854. n.prototype.getMaxPossiblePanoSize = function() {
  25855. return this.getPanoSize(r.ULTRAHIGH)
  25856. }
  25857. ,
  25858. n.prototype.getMaxPanoSize = function() {
  25859. return this.maxZoomPanoSize
  25860. }
  25861. ,
  25862. n.prototype.getMaxNavPanoSize = function() {
  25863. return this.maxNavPanoSize
  25864. }
  25865. ,
  25866. n.prototype.getMaxZoomPanoSize = function() {
  25867. return this.maxZoomPanoSize
  25868. }
  25869. ,
  25870. n.prototype.detectMaxNavPanoSizeClass = function() {
  25871. return this.useHighResolutionPanos ? a.isMobile() ? r.STANDARD : $("#player").height() < this.highQualityThreshold ? r.STANDARD : r.HIGH : r.STANDARD
  25872. }
  25873. ,
  25874. n.prototype.detectMaxNavPanoSize = function() {
  25875. var e = this.detectMaxNavPanoSizeClass();
  25876. return this.getPanoSize(e)
  25877. }
  25878. ,
  25879. n.prototype.detectMaxZoomPanoSize = function() {
  25880. 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)
  25881. }
  25882. ,
  25883. t.exports = n
  25884. }
  25885. , {
  25886. "../constants": 8,
  25887. "../enum/ModelManagerEvents": 33,
  25888. "../enum/PanoSizeClass": 36,
  25889. "../settings": 166,
  25890. "../util/browser": 182,
  25891. "../util/showcase": 193
  25892. }],
  25893. 171: [function(e, t, i) {
  25894. (function(i) {
  25895. "use strict";
  25896. function n(e) {
  25897. this.panos = null,
  25898. this.retryMinimumTime = 1e4,
  25899. this.urls = null,
  25900. this.panoLoadCallbacks = {},
  25901. this.downloadDescriptors = {},
  25902. this.priorityQueue = [],
  25903. this.forceQueue = [],
  25904. this.activeDownloads = [],
  25905. this.qualityManager = null,
  25906. this.tilePrioritizer = null,
  25907. this.refreshInterval = null,
  25908. this.processPriorityQueue = !1,
  25909. this.concurrentDownloads = e.concurrentDownloads || 1,
  25910. this.downloadTestResults = {}
  25911. }
  25912. var r = e("three")
  25913. , o = (e("../enum/Viewmode"),
  25914. e("../settings"))
  25915. , a = (e("../objects/Panorama"),
  25916. e("../util/logger"))
  25917. , s = (e("../enum/Vectors"),
  25918. e("../enum/PanoSizeClass"),
  25919. e("../enum/TileDownloaderEvents"))
  25920. , l = e("./TilePrioritizer")
  25921. , c = e("./TileUtils")
  25922. , h = (e("../enum/GLCubeFaces"),
  25923. e("../enum/DownloadStatus"))
  25924. , u = e("../util/panorama")
  25925. , d = e("../util/ajax")
  25926. , p = e("../ab")
  25927. , f = e("events").EventEmitter
  25928. , g = (new a(i),
  25929. Object.freeze({
  25930. Testing: 1,
  25931. Success: 2,
  25932. Fail: 3
  25933. }));
  25934. n.prototype = Object.create(f.prototype),
  25935. n.IDLE_REFRESH_DELAY = 500,
  25936. n.ACTIVE_REFRESH_DELAY = 16,
  25937. n.DOWNLOAD_RETRIES = 4,
  25938. n.prototype.init = function(e) {
  25939. this.qualityManager = e
  25940. }
  25941. ,
  25942. n.prototype.setUrls = function(e) {
  25943. this.urls = e
  25944. }
  25945. ,
  25946. n.prototype.setPanoData = function(e, t, i) {
  25947. this.panos = e,
  25948. this.imagePanos = t,
  25949. this.panoGroupId = i
  25950. }
  25951. ,
  25952. n.prototype.start = function() {
  25953. this.refreshUpdateInterval(0)
  25954. }
  25955. ,
  25956. n.prototype.stop = function() {
  25957. window.cancel(this.refreshInterval)
  25958. }
  25959. ,
  25960. n.prototype.refreshUpdateInterval = function(e) {
  25961. e || (e = 0),
  25962. this.refreshInterval = window.setTimeout(function() {
  25963. var e = this.update();
  25964. e ? this.refreshUpdateInterval(n.ACTIVE_REFRESH_DELAY) : this.refreshUpdateInterval(n.IDLE_REFRESH_DELAY)
  25965. }
  25966. .bind(this), e)
  25967. }
  25968. ,
  25969. n.prototype.update = function() {
  25970. var e = this.forceQueue.length > 0;
  25971. return this.processQueueForDownloading(this.forceQueue),
  25972. this.processPriorityQueue && (this.queuePrioritizedTilesForPanos(this.panos),
  25973. this.priorityQueue.length > 0 && (e = !0),
  25974. this.processQueueForDownloading(this.priorityQueue)),
  25975. e
  25976. }
  25977. ,
  25978. n.prototype.forceQueueTilesForPano = function() {
  25979. var e = []
  25980. , t = [];
  25981. return function(i, n, r, o, a, s) {
  25982. e.length = 0;
  25983. for (var u = this.getTileDownloadDescriptors(i, n), d = 0; d < u.length; d++) {
  25984. var p = u[d];
  25985. p.status !== h.None && p.status !== h.Queued || e.push(p)
  25986. }
  25987. if (r && e.length > 0) {
  25988. l.sortPanoTiles(e, i, r),
  25989. t.length = 0,
  25990. c.matchingTilesInDirection(i, n, r, o, a, t);
  25991. for (var f = 0, g = function(e) {
  25992. return e.face === m.face && e.faceTileIndex === m.faceTileIndex
  25993. }; f < e.length; ) {
  25994. var m = e[f]
  25995. , v = t.findIndex(g);
  25996. v < 0 ? e.splice(f, 1) : f++
  25997. }
  25998. }
  25999. for (var A = 0; A < e.length; A++)
  26000. this.forceQueue.push(e[A]);
  26001. this.setStatusForAllDescriptors(this.forceQueue, h.ForceQueued),
  26002. this.clearFromQueue(this.priorityQueue, h.ForceQueued, !1),
  26003. s && this.processQueueForDownloading(this.forceQueue, !0)
  26004. }
  26005. }(),
  26006. n.prototype.clearForceQueue = function() {
  26007. this.clearQueue(this.forceQueue)
  26008. }
  26009. ,
  26010. n.prototype.queuePrioritizedTilesForPanos = function(e) {
  26011. this.tilePrioritizer && (this.clearQueue(this.priorityQueue),
  26012. this.tilePrioritizer.filterAndPrioritize(this.priorityQueue, e, this),
  26013. this.clearFromQueue(this.priorityQueue, h.None, !0),
  26014. this.setStatusOrRemoveForAllDescriptors(this.priorityQueue, h.Queued))
  26015. }
  26016. ,
  26017. n.prototype.clearQueue = function(e) {
  26018. this.setStatusForAllDescriptors(e, h.None),
  26019. e.length = 0
  26020. }
  26021. ,
  26022. n.prototype.clearFromQueue = function(e, t, i) {
  26023. for (var n = 0; n < e.length; n++) {
  26024. var r = e[n];
  26025. r && (t === r.status && !i || t !== r.status && i) && (e[n] = null)
  26026. }
  26027. }
  26028. ,
  26029. n.prototype.setStatusForAllDescriptors = function(e, t) {
  26030. for (var i = 0; i < e.length; i++) {
  26031. var n = e[i];
  26032. n && (n.status = t)
  26033. }
  26034. }
  26035. ,
  26036. n.prototype.setStatusOrRemoveForAllDescriptors = function(e, t) {
  26037. for (var i = 0; i < e.length; i++) {
  26038. var n = e[i];
  26039. n && (n.status !== t ? n.status = t : e[i] = null)
  26040. }
  26041. }
  26042. ,
  26043. n.prototype.getTileDownloadDescriptors = function(e, t) {
  26044. var i = this.getAllTileDownloadDescriptorsForPano(e)
  26045. , n = i[t];
  26046. return n || (n = this.buildDownloadDescriptorArray(t),
  26047. i[t] = n,
  26048. this.initTileDownloadDescriptors(n, e, t)),
  26049. n
  26050. }
  26051. ,
  26052. n.prototype.getAllTileDownloadDescriptorsForPano = function(e) {
  26053. var t = this.downloadDescriptors[e.id];
  26054. return t || (t = {},
  26055. this.downloadDescriptors[e.id] = t),
  26056. t
  26057. }
  26058. ,
  26059. n.prototype.processQueueForDownloading = function(e, t) {
  26060. if (this.cleanupActiveDownloads(),
  26061. this.activeDownloads.length < this.concurrentDownloads || t)
  26062. for (var i = t ? e.length : this.concurrentDownloads - this.activeDownloads.length, n = 0, r = 0; n < i && e.length > 0; r++) {
  26063. var o = e.shift();
  26064. o && (this.startDownload(o),
  26065. n++)
  26066. }
  26067. }
  26068. ,
  26069. n.prototype.testDownload = function(e, t, i) {
  26070. var n = this.downloadTestResults[e];
  26071. if (n)
  26072. return void (n === g.Success ? i(!0) : n === g.Fail && i(!1));
  26073. this.downloadTestResults[e] = g.Testing;
  26074. var r = this.panos.list[0]
  26075. , o = this.getTileUrl(r.id, e, t, 0)
  26076. , a = function(t) {
  26077. this.downloadTestResults[e] = g.Success,
  26078. i(!0)
  26079. }
  26080. .bind(this)
  26081. , s = function() {
  26082. this.downloadTestResults[e] = g.Fail,
  26083. i(!1)
  26084. }
  26085. .bind(this);
  26086. this.loadImage(o, 0, a, s)
  26087. }
  26088. ,
  26089. n.prototype.startDownload = function(e) {
  26090. e.status = h.Downloading;
  26091. var t = this.getTileUrl(e.pano.id, e.panoSize, e.tileSize, e.tileIndex);
  26092. this.activeDownloads.push(e),
  26093. this.loadImage(t, n.DOWNLOAD_RETRIES, this.downloadComplete.bind(this, e), this.downloadFailed.bind(this, e))
  26094. }
  26095. ,
  26096. n.prototype.downloadFailed = function(e, t) {}
  26097. ,
  26098. n.prototype.downloadComplete = function(e, t) {
  26099. if (e.panoGroupId === this.panoGroupId) {
  26100. var i = this.getPanoLoadCallbacks(e.pano, e.panoSize);
  26101. e.status = h.Downloaded,
  26102. i && i.onProgress && i.onProgress(e.pano, e.panoSize);
  26103. var n = {
  26104. panoId: e.pano.id,
  26105. image: t,
  26106. tileSize: e.tileSize,
  26107. panoSize: e.panoSize,
  26108. tileIndex: e.tileIndex,
  26109. faceTileIndex: e.faceTileIndex,
  26110. totalTiles: e.totalTiles,
  26111. face: e.face,
  26112. tileX: e.tileX,
  26113. tileY: e.tileY,
  26114. direction: e.direction
  26115. };
  26116. e.image = t,
  26117. this.emit(s.TileDownloadSuccess, n),
  26118. this.isPanoDownloaded(e.pano, e.panoSize) && (n = {
  26119. panoId: e.pano.id,
  26120. tileSize: e.tileSize,
  26121. panoSize: e.panoSize
  26122. },
  26123. this.emit(s.PanoDownloadComplete, n),
  26124. i && i.onLoad && i.onLoad(e.pano, e.panoSize))
  26125. }
  26126. }
  26127. ,
  26128. n.prototype.cleanupActiveDownloads = function() {
  26129. var e = [];
  26130. return function() {
  26131. e.length = 0;
  26132. for (var t = 0; t < this.activeDownloads.length; t++) {
  26133. var i = this.activeDownloads[t];
  26134. i.status !== h.Downloaded && i.status !== h.Failed && e.push(i)
  26135. }
  26136. this.activeDownloads.length = 0,
  26137. this.activeDownloads.push.apply(this.activeDownloads, e)
  26138. }
  26139. }(),
  26140. n.prototype.isPanoDownloaded = function(e, t) {
  26141. var i = this.getTileDownloadDescriptors(e, t);
  26142. if (i.length <= 0)
  26143. return !1;
  26144. for (var n = 0; n < i.length; n++) {
  26145. var r = i[n];
  26146. if (r.status !== h.Downloaded)
  26147. return !1
  26148. }
  26149. return !0
  26150. }
  26151. ,
  26152. n.prototype.setPanoLoadCallbacks = function(e, t, i, n, r) {
  26153. var o = e.id + ":" + this.qualityManager.getPanoSize(t);
  26154. this.panoLoadCallbacks[o] = {
  26155. onLoad: i,
  26156. onFail: n,
  26157. onProgress: r
  26158. }
  26159. }
  26160. ,
  26161. n.prototype.getPanoLoadCallbacks = function(e, t) {
  26162. var i = e.id + ":" + t;
  26163. return this.panoLoadCallbacks[i]
  26164. }
  26165. ,
  26166. n.prototype.buildDownloadDescriptorArray = function(e) {
  26167. for (var t = c.getTileCountForSize(e), i = [], n = 0; n < t; n++) {
  26168. var r = this.buildDownloadDescriptor();
  26169. i.push(r)
  26170. }
  26171. return i
  26172. }
  26173. ,
  26174. n.prototype.buildDownloadDescriptor = function() {
  26175. var e = {
  26176. panoGroupId: null,
  26177. pano: null,
  26178. panoSize: -1,
  26179. tileSize: -1,
  26180. tileIndex: -1,
  26181. totalTiles: -1,
  26182. faceTileIndex: -1,
  26183. status: h.None,
  26184. url: null,
  26185. image: null,
  26186. direction: new r.Vector3,
  26187. face: -1,
  26188. cubeFace: -1,
  26189. tileX: -1,
  26190. tileY: -1
  26191. };
  26192. return e
  26193. }
  26194. ,
  26195. n.prototype.initTileDownloadDescriptors = function(e, t, i) {
  26196. for (var n = 0; n < e.length; n++) {
  26197. var r = e[n];
  26198. this.initTileDownloadDescriptor(r, t, i, n)
  26199. }
  26200. }
  26201. ,
  26202. n.prototype.initTileDownloadDescriptor = function(e, t, i, n) {
  26203. var r = i >= c.TILE_SIZE ? c.TILE_SIZE : i;
  26204. e.face = c.getFaceForTile(i, n),
  26205. e.cubeFace = u.mapFaceToCubemapFace(e.face),
  26206. e.panoGroupId = this.panoGroupId,
  26207. e.pano = t,
  26208. e.panoSize = i,
  26209. e.tileSize = r,
  26210. e.tileIndex = n,
  26211. e.totalTiles = c.getTileCountForSize(i),
  26212. e.status = h.None,
  26213. e.image = null,
  26214. c.getTileLocation(e.panoSize, e.tileIndex, e),
  26215. c.getTileVector(e.panoSize, e.tileSize, e.cubeFace, e.tileX, e.tileY, c.LocationOnTile.Center, 0, e.direction)
  26216. }
  26217. ,
  26218. n.prototype.getTileUrl = function() {
  26219. var e = {
  26220. 256: "256",
  26221. 512: "512",
  26222. 1024: "1k",
  26223. 2048: "2k",
  26224. 4096: "4k"
  26225. }
  26226. , t = {
  26227. face: -1,
  26228. faceTileIndex: -1,
  26229. tileX: -1,
  26230. tileY: -1
  26231. };
  26232. return function(i, n, r, a) {
  26233. c.getTileLocation(n, a, t);
  26234. var s = Math.floor(n / r)
  26235. , l = s * s
  26236. , h = Math.floor(a / l)
  26237. , u = "";
  26238. 1 === o.tiling.customCompression && (u = "_" + o.tiling["q" + e[n]]);
  26239. var d = this.urls.get("tiles/" + i + "/" + e[n] + u + "_face" + h + "_" + t.tileX + "_" + t.tileY + ".jpg");
  26240. return d = p.changeIfTileGenerating(d)
  26241. }
  26242. }(),
  26243. n.prototype.loadImage = function(e, t, i, n) {
  26244. d.getImage(e, t).then(function(e) {
  26245. i(e)
  26246. }).fail(n)
  26247. }
  26248. ,
  26249. t.exports = n
  26250. }
  26251. ).call(this, "/js/tile/TileDownloader.js")
  26252. }
  26253. , {
  26254. "../ab": 3,
  26255. "../enum/DownloadStatus": 24,
  26256. "../enum/GLCubeFaces": 25,
  26257. "../enum/PanoSizeClass": 36,
  26258. "../enum/TileDownloaderEvents": 45,
  26259. "../enum/Vectors": 50,
  26260. "../enum/Viewmode": 51,
  26261. "../objects/Panorama": 148,
  26262. "../settings": 166,
  26263. "../util/ajax": 181,
  26264. "../util/logger": 189,
  26265. "../util/panorama": 191,
  26266. "./TilePrioritizer": 172,
  26267. "./TileUtils": 174,
  26268. events: 202,
  26269. three: 217
  26270. }],
  26271. 172: [function(e, t, i) {
  26272. (function(i) {
  26273. "use strict";
  26274. function n(e, t, i, o, a) {
  26275. this.qualityManager = e,
  26276. this.maxNavQuality = this.qualityManager.getMaxNavPanoSize(),
  26277. this.maxZoomQuality = this.qualityManager.getMaxZoomPanoSize(),
  26278. this.baseSize = t,
  26279. this.standardSize = i,
  26280. this.highSize = o,
  26281. this.ultraHighSize = a,
  26282. this.priorityCriteria = new n.PriorityCriteria(null,new r.Vector3(0,0,0),new r.Vector3(0,0,-1),new r.Vector3(0,0,-1))
  26283. }
  26284. var r = e("three")
  26285. , o = (e("../enum/Viewmode"),
  26286. e("../settings"),
  26287. e("../settings"),
  26288. e("../objects/Panorama"))
  26289. , a = e("../util/logger")
  26290. , s = (e("../enum/Vectors"),
  26291. e("../enum/PanoSizeClass"),
  26292. e("../enum/ModelManagerEvents"),
  26293. e("../enum/GLCubeFaces"),
  26294. e("../enum/DownloadStatus"))
  26295. , l = (e("../util/browser"),
  26296. e("./TileUtils"))
  26297. , c = e("../util/math")
  26298. , h = (e("events").EventEmitter,
  26299. new a(i),
  26300. Object.freeze({
  26301. None: 0,
  26302. DirectionalFOV: 1
  26303. }));
  26304. n.PriorityCriteria = function(e, t, i, n, o) {
  26305. this.pano = e,
  26306. this.cameraPosition = (new r.Vector3).copy(t),
  26307. this.cameraDir = (new r.Vector3).copy(i),
  26308. this.panoSpaceDir = (new r.Vector3).copy(n),
  26309. this.upcomingPanos = o,
  26310. this.copy = function(e) {
  26311. this.pano = e.pano,
  26312. this.cameraPosition.copy(e.cameraPosition),
  26313. this.cameraDir.copy(e.cameraDir),
  26314. this.panoSpaceDir.copy(e.panoSpaceDir),
  26315. this.upcomingPanos = o
  26316. }
  26317. ,
  26318. this.zoomingActive = !1
  26319. }
  26320. ,
  26321. n.DIRECTIONAL_FOV = 180,
  26322. n.DIRECTIONAL_FOV_NARROW = 120,
  26323. n.MAX_SCORED_PANOS_TOCONSIDER = 6,
  26324. n.MAX_SCORED_PANOS_TOADD = 2,
  26325. n.MAX_UPCOMING_PANOS_TOADD = 3,
  26326. n.DIRECTION_SCORE_STRICTNESS = .75,
  26327. n.appendQueue = function(e, t) {
  26328. if (e && t)
  26329. for (var i = 0; i < t.length; i++)
  26330. e.push(t[i])
  26331. }
  26332. ,
  26333. n.prototype.updateCriteria = function(e, t, i, n) {
  26334. this.priorityCriteria.pano = e,
  26335. this.priorityCriteria.cameraPosition.copy(t),
  26336. this.priorityCriteria.cameraDir.copy(i),
  26337. this.priorityCriteria.upcomingPanos = n,
  26338. this.maxNavQuality = this.qualityManager.getMaxNavPanoSize(),
  26339. this.maxZoomQuality = this.qualityManager.getMaxZoomPanoSize()
  26340. }
  26341. ,
  26342. n.prototype.filterAndPrioritize = function() {
  26343. var e = []
  26344. , t = []
  26345. , i = [];
  26346. return function(r, o, a) {
  26347. this.populateNeighborPanos(this.priorityCriteria.pano, o, e),
  26348. this.populateScoredPanos(this.priorityCriteria.pano, o, t, this.priorityCriteria.cameraDir, n.MAX_SCORED_PANOS_TOCONSIDER);
  26349. var s = this.baseSize
  26350. , l = this.standardSize
  26351. , c = this.highSize
  26352. , h = this.ultraHighSize;
  26353. this.queueTilesForPano(r, a, this.priorityCriteria.pano, s),
  26354. this.priorityCriteria.upcomingPanos && this.queueTilesForPanos(r, this.priorityCriteria.upcomingPanos, a, s, n.MAX_UPCOMING_PANOS_TOADD),
  26355. i.length = 0,
  26356. this.canDownloadSize(l) && this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, l, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV_NARROW),
  26357. n.sortPanoTiles(i, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  26358. n.appendQueue(r, i),
  26359. this.queueTilesForPanos(r, t, a, s, n.MAX_SCORED_PANOS_TOADD),
  26360. i.length = 0,
  26361. this.canDownloadSize(c) && this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, c, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV_NARROW),
  26362. this.canDownloadSize(h) && this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, h, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV_NARROW),
  26363. n.sortPanoTiles(i, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  26364. n.appendQueue(r, i),
  26365. i.length = 0,
  26366. this.canDownloadSize(l) && this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, l, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV),
  26367. this.canDownloadSize(c) && this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, c, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV),
  26368. this.canDownloadSize(h) && this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, h, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV),
  26369. n.sortPanoTiles(i, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  26370. n.appendQueue(r, i),
  26371. this.queueTilesForPanos(r, e, a, s)
  26372. }
  26373. }(),
  26374. n.prototype.canDownloadSize = function(e) {
  26375. return this.maxNavQuality >= e || this.maxZoomQuality >= e && this.zoomingActive
  26376. }
  26377. ,
  26378. n.prototype.populateNeighborPanos = function(e, t, i) {
  26379. i = i || [],
  26380. i.length = 0;
  26381. var n = t.getNeighbours(e);
  26382. for (var r in n)
  26383. if (n.hasOwnProperty(r)) {
  26384. var o = t.get(r);
  26385. i.push(o)
  26386. }
  26387. return i
  26388. }
  26389. ,
  26390. n.prototype.populateScoredPanos = function(e, t, i, r, a) {
  26391. i = i || [],
  26392. i.length = 0;
  26393. var s = [o.filters.inPanoDirection(e.position, r, n.DIRECTION_SCORE_STRICTNESS), o.filters.not(e)]
  26394. , l = [o.scoreFunctions.distanceSquared(e), o.scoreFunctions.direction(e.position, r)]
  26395. , c = t.sortByScore(s, l);
  26396. if (c)
  26397. for (var h = 0; h < c.length && h < a; h++) {
  26398. var u = c[h].pano;
  26399. i.push(u)
  26400. }
  26401. return i
  26402. }
  26403. ,
  26404. n.prototype.queueTilesForPanos = function(e, t, i, n, r) {
  26405. for (var o = 0, a = 0; a < t.length; a++) {
  26406. var s = t[a]
  26407. , l = this.queueTilesForPano(e, i, s, n);
  26408. if (o += l > 0 ? 1 : 0,
  26409. r && o >= r)
  26410. break
  26411. }
  26412. return o
  26413. }
  26414. ,
  26415. n.prototype.queueTilesForPano = function() {
  26416. var e = {
  26417. filter: h.None
  26418. };
  26419. return function(t, i, n, r) {
  26420. return this.filterAndQueueTileDownloadDescriptors(t, i, n, r, e)
  26421. }
  26422. }(),
  26423. n.prototype.queueTilesForPanosInDirection = function() {
  26424. var e = new r.Vector3;
  26425. return function(t, i, n, r, o, a, s, l) {
  26426. for (var h = 0, u = 0; u < n.length; u++) {
  26427. var d = n[u];
  26428. e.copy(d.position),
  26429. e.sub(o),
  26430. e.normalize();
  26431. var p = Math.max(Math.min(a.dot(e), 1), -1)
  26432. , f = c.getFOVDotThreshold(s);
  26433. if (p >= f) {
  26434. var g = this.queueTilesInDirectionForPano(t, i, d, r, o, a, s);
  26435. if (h += g > 0 ? 1 : 0,
  26436. l && h >= l)
  26437. break
  26438. }
  26439. }
  26440. return h
  26441. }
  26442. }(),
  26443. n.prototype.queueTilesInDirectionForPanos = function(e, t, i, n, r, o, a, s) {
  26444. for (var l = 0, c = 0; c < i.length; c++) {
  26445. var h = i[c]
  26446. , u = this.queueTilesInDirectionForPano(e, t, h, n, o, a);
  26447. if (l += u > 0 ? 1 : 0,
  26448. s && l >= s)
  26449. break
  26450. }
  26451. return l
  26452. }
  26453. ,
  26454. n.prototype.queueTilesInDirectionForPano = function() {
  26455. var e = {
  26456. filter: h.DirectionalFOV,
  26457. direction: new r.Vector3,
  26458. fov: 60
  26459. }
  26460. , t = new r.Vector3;
  26461. return function(i, n, r, o, a, s, c) {
  26462. return t.copy(s),
  26463. l.getRelativeDirection(r.quaternion, t),
  26464. e.direction.copy(t),
  26465. e.fov = c,
  26466. this.filterAndQueueTileDownloadDescriptors(i, n, r, o, e)
  26467. }
  26468. }(),
  26469. n.prototype.filterAndQueueTileDownloadDescriptors = function() {
  26470. var e = [];
  26471. return function(t, i, n, r, o) {
  26472. var a = i.getTileDownloadDescriptors(n, r);
  26473. e.length = 0,
  26474. this.filterTileDownloadDescriptors(n, a, e, o);
  26475. for (var s = 0, l = 0; l < e.length; l++) {
  26476. var c = e[l];
  26477. c && (t.push(c),
  26478. s++)
  26479. }
  26480. return s
  26481. }
  26482. }(),
  26483. n.prototype.filterTileDownloadDescriptors = function() {
  26484. new r.Vector3;
  26485. return function(e, t, i, n) {
  26486. var r, o;
  26487. switch (n.filter) {
  26488. case h.DirectionalFOV:
  26489. for (r = 0; r < t.length; r++)
  26490. o = t[r],
  26491. l.isTileWithinFOV(o.panoSize, o.tileSize, o.face, o.tileX, o.tileY, n.direction, n.fov) && i.push(o);
  26492. break;
  26493. default:
  26494. for (r = 0; r < t.length; r++)
  26495. o = t[r],
  26496. i.push(o)
  26497. }
  26498. for (r = 0; r < i.length; r++)
  26499. o = i[r],
  26500. this.canIncludeDescriptor(o) || (i[r] = null)
  26501. }
  26502. }(),
  26503. n.prototype.canIncludeDescriptor = function(e) {
  26504. return e.status !== s.Downloading && e.status !== s.Downloaded
  26505. }
  26506. ,
  26507. n.prototype.canIncludePano = function(e, t) {
  26508. return !e.isLoaded(t)
  26509. }
  26510. ,
  26511. n.getFOVDotThreshold = function(e) {
  26512. return Math.cos(r.Math.degToRad(e / 2))
  26513. }
  26514. ;
  26515. var u = function() {
  26516. var e = function e(t, i) {
  26517. var n = e._panoSpaceDir
  26518. , r = e._fovThreshold
  26519. , o = e._fovThresholdNarrow
  26520. , a = Math.max(Math.min(n.dot(t.direction), 1), -1)
  26521. , s = Math.max(Math.min(n.dot(i.direction), 1), -1);
  26522. return t._dot = a,
  26523. i._dot = s,
  26524. 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)
  26525. };
  26526. return e._panoSpaceDir = new r.Vector3,
  26527. e._fovThreshold = -1,
  26528. e._fovThresholdNarrow = -1,
  26529. e
  26530. }();
  26531. n.sortPanoTiles = function(e, t, i) {
  26532. u._panoSpaceDir.copy(i),
  26533. l.getRelativeDirection(t.quaternion, u._panoSpaceDir),
  26534. u._fovThresholdNarrow = c.getFOVDotThreshold(n.DIRECTIONAL_FOV_NARROW),
  26535. u._fovThreshold = c.getFOVDotThreshold(n.DIRECTIONAL_FOV),
  26536. e.sort(u)
  26537. }
  26538. ,
  26539. n.insertSortedPanoTile = function(e, t, i, r) {
  26540. u._panoSpaceDir.copy(r),
  26541. l.getRelativeDirection(i.quaternion, u._panoSpaceDir),
  26542. u._fovThresholdNarrow = c.getFOVDotThreshold(n.DIRECTIONAL_FOV_NARROW),
  26543. u._fovThreshold = c.getFOVDotThreshold(n.DIRECTIONAL_FOV);
  26544. for (var o = -1, a = 0; a < e.length; a++) {
  26545. var s = u(t, e[a]);
  26546. if (s <= 0) {
  26547. o = a;
  26548. break
  26549. }
  26550. }
  26551. if (o === -1)
  26552. e[e.length] = t;
  26553. else {
  26554. for (var h = e.length; h > o; h--)
  26555. e[h] = e[h - 1];
  26556. e[o] = t
  26557. }
  26558. }
  26559. ,
  26560. n.prototype.setZoomingActive = function(e) {
  26561. e !== this.zoomingActive && (this.zoomingActive = e)
  26562. }
  26563. ,
  26564. t.exports = n
  26565. }
  26566. ).call(this, "/js/tile/TilePrioritizer.js")
  26567. }
  26568. , {
  26569. "../enum/DownloadStatus": 24,
  26570. "../enum/GLCubeFaces": 25,
  26571. "../enum/ModelManagerEvents": 33,
  26572. "../enum/PanoSizeClass": 36,
  26573. "../enum/Vectors": 50,
  26574. "../enum/Viewmode": 51,
  26575. "../objects/Panorama": 148,
  26576. "../settings": 166,
  26577. "../util/browser": 182,
  26578. "../util/logger": 189,
  26579. "../util/math": 190,
  26580. "./TileUtils": 174,
  26581. events: 202,
  26582. three: 217
  26583. }],
  26584. 173: [function(e, t, i) {
  26585. "use strict";
  26586. function n(e, t) {
  26587. this.levels = t,
  26588. this.tileSize = e,
  26589. this.root = null,
  26590. this.allNodes = [],
  26591. a(this)
  26592. }
  26593. function r(e, t) {
  26594. this.tree = e,
  26595. this.parent = t,
  26596. this.children = [],
  26597. this.id = ++u
  26598. }
  26599. function o(e, t, i, r, a, s, l, h) {
  26600. if (e) {
  26601. l = l || n.TraversalType.PreOrder;
  26602. var u = r * c + i;
  26603. if (l === n.TraversalType.PreOrder && (a && a(e, t, u, i, r),
  26604. s && s.push(e)),
  26605. e.children && 0 !== e.children.length) {
  26606. for (var d = r * c, p = i * c, f = 0; f < c; f++)
  26607. for (var g = 0; g < c; g++)
  26608. o(e.children[g * c + f], t + 1, p + f, d + g, a, s, l, h);
  26609. l === n.TraversalType.PostOrder && (a && a(e, t, u, i, r),
  26610. s && s.push(e))
  26611. }
  26612. }
  26613. }
  26614. function a(e) {
  26615. e.root = s(e, null, 0)
  26616. }
  26617. function s(e, t, i) {
  26618. if (i > e.levels)
  26619. return null;
  26620. var n = new r(e,t);
  26621. e.allNodes.push(n);
  26622. for (var o = 0; o < h; o++)
  26623. n.children[o] = s(e, n, i + 1);
  26624. return n
  26625. }
  26626. function l(e, t, i, n, r) {
  26627. if (!e)
  26628. return null;
  26629. if (0 === i)
  26630. return e;
  26631. if (!e.children || 0 === e.children.length)
  26632. return null;
  26633. var o = Math.pow(c, i)
  26634. , a = o / c
  26635. , s = n % a
  26636. , h = r % a
  26637. , u = Math.floor(r / a)
  26638. , d = Math.floor(n / a)
  26639. , p = u * c + d
  26640. , f = e.children[p];
  26641. return l(f, t + 1, i - 1, s, h)
  26642. }
  26643. var c = (e("three"),
  26644. e("./TileUtils"),
  26645. e("../objects/Panorama"),
  26646. e("../util/panorama"),
  26647. e("events").EventEmitter,
  26648. 2)
  26649. , h = c * c;
  26650. n.TraversalType = Object.freeze({
  26651. PreOrder: 0,
  26652. PostOrder: 1
  26653. });
  26654. var u = 0;
  26655. n.getLevelCountForSize = function(e, t) {
  26656. var i = 0;
  26657. for (t < e && (t = e); ; ) {
  26658. if (t /= c,
  26659. t < e)
  26660. break;
  26661. i++
  26662. }
  26663. return i
  26664. }
  26665. ,
  26666. n.getSizeForLevel = function(e, t) {
  26667. return Math.pow(c, t) * e
  26668. }
  26669. ,
  26670. n.prototype.getSubNode = function(e, t, i) {
  26671. (!t || e < this.tileSize) && (t = 0),
  26672. (!i || e < this.tileSize) && (i = 0),
  26673. e < this.tileSize && (e = this.tileSize);
  26674. var r = n.getLevelCountForSize(this.tileSize, e)
  26675. , o = l(this.root, 0, r, t, i);
  26676. return o
  26677. }
  26678. ,
  26679. n.prototype.breadthFirst = function(e) {
  26680. e = e || {};
  26681. var t = !!e.nullLevelEnd
  26682. , i = e.maxLevel
  26683. , n = e.minLevel
  26684. , r = e.callback
  26685. , o = e.saveVisited
  26686. , a = []
  26687. , s = {}
  26688. , l = 0
  26689. , c = 0;
  26690. for (a.push(this.root),
  26691. a.push(s); a.length > 0 && !(i && l > i); ) {
  26692. var h = a.shift();
  26693. if (h === s)
  26694. (!n || l >= n) && (r && t && r(null),
  26695. o && t && o.push(null)),
  26696. a.length > 0 && a.push(s),
  26697. l++,
  26698. c = 0;
  26699. else {
  26700. if (h.children)
  26701. for (var u = 0; u < h.children.length; u++) {
  26702. var d = h.children[u];
  26703. d && a.push(h.children[u])
  26704. }
  26705. var p = this.getFaceIndexFromNode(h);
  26706. (!n || l >= n) && (r && r(h, l, p),
  26707. o && o.push(h)),
  26708. c++
  26709. }
  26710. }
  26711. }
  26712. ,
  26713. n.prototype.getFaceIndexFromNode = function(e) {
  26714. if (!e)
  26715. return -1;
  26716. for (var t = 1, i = e, n = 0, r = 0; ; ) {
  26717. var o = i.parent;
  26718. if (!o)
  26719. break;
  26720. for (var a = -1, s = 0; s < o.children.length; s++)
  26721. o.children[s] === i && (a = s);
  26722. var l = a % c
  26723. , h = Math.floor(a / c);
  26724. n = l * t + n,
  26725. r = h * t + r,
  26726. t *= c,
  26727. i = o
  26728. }
  26729. return r * t + n
  26730. }
  26731. ,
  26732. n.prototype.depthFirst = function(e, t, i) {
  26733. o(this.root, 0, 0, 0, e, t, i, this.tileSize)
  26734. }
  26735. ,
  26736. t.exports = n
  26737. }
  26738. , {
  26739. "../objects/Panorama": 148,
  26740. "../util/panorama": 191,
  26741. "./TileUtils": 174,
  26742. events: 202,
  26743. three: 217
  26744. }],
  26745. 174: [function(e, t, i) {
  26746. "use strict";
  26747. var n = e("../enum/GLCubeFaces")
  26748. , r = e("../util/MathLight")
  26749. , o = {};
  26750. o.TILE_SIZE = 512,
  26751. o.FACES_PER_PANO = 6,
  26752. o.LocationOnTile = {
  26753. Center: 0,
  26754. UpperLeft: 1,
  26755. UpperRight: 2,
  26756. LowerRight: 3,
  26757. LowerLeft: 4
  26758. },
  26759. o.getTileVector = function() {
  26760. return function(e, t, i, a, s, l, c, h) {
  26761. l = l || o.LocationOnTile.Center;
  26762. var u = e / t
  26763. , d = a / u;
  26764. s = -s + (u - 1);
  26765. var p = s / u
  26766. , f = t / e
  26767. , g = 2 * f
  26768. , m = g / 2
  26769. , v = 2 * d - 1 + m
  26770. , A = 2 * p - 1 + m;
  26771. switch (l) {
  26772. case o.LocationOnTile.UpperLeft:
  26773. v -= m,
  26774. A += m,
  26775. v += c * g;
  26776. break;
  26777. case o.LocationOnTile.UpperRight:
  26778. v += m,
  26779. A += m,
  26780. A -= c * g;
  26781. break;
  26782. case o.LocationOnTile.LowerRight:
  26783. v += m,
  26784. A -= m,
  26785. v -= c * g;
  26786. break;
  26787. case o.LocationOnTile.LowerLeft:
  26788. v -= m,
  26789. A -= m,
  26790. A += c * g;
  26791. break;
  26792. case o.LocationOnTile.Center:
  26793. }
  26794. switch (i) {
  26795. case n.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  26796. r.setVector(h, -1, A, -v);
  26797. break;
  26798. case n.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  26799. r.setVector(h, 1, A, v);
  26800. break;
  26801. case n.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  26802. r.setVector(h, -v, 1, -A);
  26803. break;
  26804. case n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  26805. r.setVector(h, -v, -1, A);
  26806. break;
  26807. case n.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  26808. r.setVector(h, -v, A, 1);
  26809. break;
  26810. case n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  26811. r.setVector(h, v, A, -1)
  26812. }
  26813. r.normalize(h)
  26814. }
  26815. }(),
  26816. o.getFaceForTile = function(e, t) {
  26817. var i = o.TILE_SIZE;
  26818. e < o.TILE_SIZE && (i = e);
  26819. var n = Math.floor(e / i)
  26820. , r = n * n;
  26821. return Math.floor(t / r)
  26822. }
  26823. ,
  26824. o.getTileLocation = function(e, t, i) {
  26825. var n = o.TILE_SIZE;
  26826. e < o.TILE_SIZE && (n = e);
  26827. var r = o.getFaceForTile(e, t)
  26828. , a = Math.floor(e / n)
  26829. , s = a * a
  26830. , l = t - r * s;
  26831. i.tileX = l % a,
  26832. i.tileY = Math.floor(l / a),
  26833. i.face = r,
  26834. i.faceTileIndex = l
  26835. }
  26836. ,
  26837. o.getTileCountForSize = function(e) {
  26838. if (e <= o.TILE_SIZE)
  26839. return o.FACES_PER_PANO;
  26840. var t = Math.floor(e / o.TILE_SIZE)
  26841. , i = t * t
  26842. , n = i * o.FACES_PER_PANO;
  26843. return n
  26844. }
  26845. ,
  26846. o.getRelativeDirection = function() {
  26847. var e = new r.Matrix4
  26848. , t = new r.Quaternion;
  26849. return function(i, n) {
  26850. t.copy(i),
  26851. t.inverse(),
  26852. e.makeRotationFromQuaternion(t),
  26853. e.applyToVector3(n),
  26854. r.normalize(n)
  26855. }
  26856. }(),
  26857. o.matchingTilesInDirection = function() {
  26858. var e = new r.Vector3
  26859. , t = new r.Vector3(0,0,-1)
  26860. , i = new r.Quaternion
  26861. , n = function(e, t) {
  26862. e.push({
  26863. face: t.face,
  26864. faceTileIndex: t.faceTileIndex,
  26865. tileX: t.tileX,
  26866. tileY: t.tileY
  26867. })
  26868. }
  26869. , a = function() {
  26870. var e = {
  26871. face: -1,
  26872. faceTileIndex: -1,
  26873. tileX: -1,
  26874. tileY: -1
  26875. };
  26876. return function(t, i, r) {
  26877. for (var a = o.getTileCountForSize(t), s = 0, l = 0; l < a; l++)
  26878. o.getTileLocation(t, l, e),
  26879. i && !i(e) || (s++,
  26880. r && n(r, e));
  26881. return s
  26882. }
  26883. }();
  26884. return function(n, s, l, c, h, u) {
  26885. var d = s < o.TILE_SIZE ? s : o.TILE_SIZE;
  26886. o.getTileCountForSize(s);
  26887. if (!c && !h)
  26888. return a(s, null, u);
  26889. var p = !!h;
  26890. if (h = h || c,
  26891. h = Math.max(0, Math.min(h, 360)),
  26892. c = Math.max(0, Math.min(c, 360)),
  26893. r.copyVector(l, e),
  26894. o.getRelativeDirection(n.quaternion, e),
  26895. p) {
  26896. i.setFromUnitVectors(e, t);
  26897. var f = function(e) {
  26898. return o.isTileWithinFrustum(s, d, e.face, e.tileX, e.tileY, i, c, h)
  26899. };
  26900. return a(s, f, u)
  26901. }
  26902. var g = function(t) {
  26903. return o.isTileWithinFOV(s, d, t.face, t.tileX, t.tileY, e, c)
  26904. };
  26905. return a(s, g, u)
  26906. }
  26907. }(),
  26908. o.isTileWithinFrustum = function() {
  26909. var e = new r.Vector3
  26910. , t = 1e-5;
  26911. return function(i, n, a, s, l, c, h, u) {
  26912. 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++)
  26913. if (o.getTileVector(i, n, m, s, l, b, 0, e),
  26914. r.applyQuaternionToVector(c, e),
  26915. e.z >= -t)
  26916. I++;
  26917. else {
  26918. var w = -1 / e.z
  26919. , _ = e.x * w
  26920. , T = e.y * w;
  26921. T > d ? v++ : T < p && A++,
  26922. _ > f ? y++ : _ < g && C++,
  26923. E++
  26924. }
  26925. return A !== E && v !== E && y !== E && C !== E
  26926. }
  26927. }(),
  26928. o.isTileWithinFOV = function() {
  26929. var e = new r.Vector3
  26930. , t = new r.Vector3(0,1,0)
  26931. , i = new r.Vector3(1,0,0);
  26932. return function(n, a, s, l, c, h, u) {
  26933. var d = o.mapFaceToCubemapFace(s);
  26934. if (r.cross(h, t, i),
  26935. o.getTileVector(n, a, d, l, c, o.LocationOnTile.Center, 0, e),
  26936. o.isWithinFOV(e, h, u, null))
  26937. return !0;
  26938. for (var p = u / 360, f = Math.floor(1 / p), g = 0, m = 0; m < f; m++) {
  26939. for (var v = o.LocationOnTile.UpperLeft; v <= o.LocationOnTile.LowerLeft; v++)
  26940. if (o.getTileVector(n, a, d, l, c, v, g, e),
  26941. o.isWithinFOV(e, h, u, null))
  26942. return !0;
  26943. g += p
  26944. }
  26945. return !1
  26946. }
  26947. }(),
  26948. o.isWithinFOV = function() {
  26949. var e = new r.Vector3
  26950. , t = new r.Vector3;
  26951. return function(i, n, o, a) {
  26952. if (r.copyVector(i, t),
  26953. a) {
  26954. r.copyVector(a, e),
  26955. r.normalize(e);
  26956. var s = r.dot(e, i);
  26957. e.x *= s,
  26958. e.y *= s,
  26959. e.z *= s,
  26960. r.subVector(t, e)
  26961. }
  26962. var l = o / 2 * r.RADIANS_PER_DEGREE
  26963. , c = Math.cos(l)
  26964. , h = r.dot(t, n);
  26965. return h >= c
  26966. }
  26967. }(),
  26968. o.mapFaceToCubemapFace = function() {
  26969. var e = {
  26970. 0: n.GL_TEXTURE_CUBE_MAP_POSITIVE_Y,
  26971. 1: n.GL_TEXTURE_CUBE_MAP_POSITIVE_Z,
  26972. 2: n.GL_TEXTURE_CUBE_MAP_POSITIVE_X,
  26973. 3: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,
  26974. 4: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
  26975. 5: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
  26976. };
  26977. return function(t) {
  26978. return e[t]
  26979. }
  26980. }(),
  26981. t.exports = o
  26982. }
  26983. , {
  26984. "../enum/GLCubeFaces": 25,
  26985. "../util/MathLight": 176
  26986. }],
  26987. 175: [function(e, t, i) {
  26988. (function(i) {
  26989. "use strict";
  26990. function n() {
  26991. this.list = [],
  26992. this.index = {},
  26993. Object.defineProperty(this, "length", {
  26994. get: function() {
  26995. return this.list.length
  26996. }
  26997. })
  26998. }
  26999. var r = (e("./common"),
  27000. e("./logger"));
  27001. new r(i);
  27002. n.prototype.forEach = function(e) {
  27003. this.list.forEach(e)
  27004. }
  27005. ,
  27006. n.prototype.add = function(e) {
  27007. this.list.push(e),
  27008. this.index[this.getIndex(e)] = e
  27009. }
  27010. ,
  27011. n.prototype.getIndex = function(e) {
  27012. throw new Error("IndexedCollection.getIndex not implemented in subclass.")
  27013. }
  27014. ,
  27015. n.prototype.extend = function(e) {
  27016. for (var t = 0; t < e.length; t++)
  27017. this.add(e[t])
  27018. }
  27019. ,
  27020. n.prototype.get = function(e) {
  27021. return this.index[e]
  27022. }
  27023. ,
  27024. n.prototype.first = function() {
  27025. return this.list[0]
  27026. }
  27027. ,
  27028. n.prototype.last = function() {
  27029. return this.list[this.list.length - 1]
  27030. }
  27031. ,
  27032. n.prototype.reIndex = function() {
  27033. this.index = {};
  27034. var e = this;
  27035. this.forEach(function(t) {
  27036. e.index[e.getIndex(t)] = t
  27037. })
  27038. }
  27039. ,
  27040. n.prototype.filter = function(e) {
  27041. var t = this.list.filter(e);
  27042. return this.reIndex(),
  27043. t
  27044. }
  27045. ,
  27046. n.prototype.reduce = function(e, t) {
  27047. return this.list.reduce(e, t)
  27048. }
  27049. ,
  27050. n.prototype.sort = function(e) {
  27051. return this.list.sort(e)
  27052. }
  27053. ,
  27054. n.prototype.indexOf = function(e) {
  27055. for (var t = 0; t < this.list.length; ++t)
  27056. if (this.list[t] === e)
  27057. return t;
  27058. return -1
  27059. }
  27060. ,
  27061. t.exports = n
  27062. }
  27063. ).call(this, "/js/util/IndexedCollection.js")
  27064. }
  27065. , {
  27066. "./common": 185,
  27067. "./logger": 189
  27068. }],
  27069. 176: [function(e, t, i) {
  27070. "use strict";
  27071. var n = e("../constants")
  27072. , r = {};
  27073. r.RADIANS_PER_DEGREE = Math.PI / 180,
  27074. r.DEGREES_PER_RADIAN = 180 / Math.PI,
  27075. r.Vector3 = function(e, t, i) {
  27076. this.x = e || 0,
  27077. this.y = t || 0,
  27078. this.z = i || 0
  27079. }
  27080. ,
  27081. r.Matrix4 = function() {
  27082. this.elements = new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]),
  27083. arguments.length > 0 && console.error("MathLight.Matrix4: the constructor no longer reads arguments. use .set() instead.")
  27084. }
  27085. ,
  27086. r.Matrix4.prototype = {
  27087. identity: function() {
  27088. return this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
  27089. this
  27090. },
  27091. copy: function(e) {
  27092. return this.elements.set(e.elements),
  27093. this
  27094. },
  27095. applyToVector3: function(e) {
  27096. var t = e.x
  27097. , i = e.y
  27098. , n = e.z
  27099. , r = this.elements;
  27100. return e.x = r[0] * t + r[4] * i + r[8] * n + r[12],
  27101. e.y = r[1] * t + r[5] * i + r[9] * n + r[13],
  27102. e.z = r[2] * t + r[6] * i + r[10] * n + r[14],
  27103. this
  27104. },
  27105. getInverse: function(e, t) {
  27106. var i = this.elements
  27107. , n = e.elements
  27108. , r = n[0]
  27109. , o = n[1]
  27110. , a = n[2]
  27111. , s = n[3]
  27112. , l = n[4]
  27113. , c = n[5]
  27114. , h = n[6]
  27115. , u = n[7]
  27116. , d = n[8]
  27117. , p = n[9]
  27118. , f = n[10]
  27119. , g = n[11]
  27120. , m = n[12]
  27121. , v = n[13]
  27122. , A = n[14]
  27123. , y = n[15]
  27124. , C = p * A * u - v * f * u + v * h * g - c * A * g - p * h * y + c * f * y
  27125. , I = m * f * u - d * A * u - m * h * g + l * A * g + d * h * y - l * f * y
  27126. , E = d * v * u - m * p * u + m * c * g - l * v * g - d * c * y + l * p * y
  27127. , b = m * p * h - d * v * h - m * c * f + l * v * f + d * c * A - l * p * A
  27128. , w = r * C + o * I + a * E + s * b;
  27129. if (0 === w) {
  27130. var _ = "MathLight.Matrix4.getInverse(): can't invert matrix, determinant is 0";
  27131. if (t)
  27132. throw new Error(_);
  27133. return console.warn(_),
  27134. this.identity()
  27135. }
  27136. var T = 1 / w;
  27137. return i[0] = C * T,
  27138. i[1] = (v * f * s - p * A * s - v * a * g + o * A * g + p * a * y - o * f * y) * T,
  27139. i[2] = (c * A * s - v * h * s + v * a * u - o * A * u - c * a * y + o * h * y) * T,
  27140. i[3] = (p * h * s - c * f * s - p * a * u + o * f * u + c * a * g - o * h * g) * T,
  27141. i[4] = I * T,
  27142. i[5] = (d * A * s - m * f * s + m * a * g - r * A * g - d * a * y + r * f * y) * T,
  27143. i[6] = (m * h * s - l * A * s - m * a * u + r * A * u + l * a * y - r * h * y) * T,
  27144. i[7] = (l * f * s - d * h * s + d * a * u - r * f * u - l * a * g + r * h * g) * T,
  27145. i[8] = E * T,
  27146. i[9] = (m * p * s - d * v * s - m * o * g + r * v * g + d * o * y - r * p * y) * T,
  27147. i[10] = (l * v * s - m * c * s + m * o * u - r * v * u - l * o * y + r * c * y) * T,
  27148. i[11] = (d * c * s - l * p * s - d * o * u + r * p * u + l * o * g - r * c * g) * T,
  27149. i[12] = b * T,
  27150. i[13] = (d * v * a - m * p * a + m * o * f - r * v * f - d * o * A + r * p * A) * T,
  27151. i[14] = (m * c * a - l * v * a - m * o * h + r * v * h + l * o * A - r * c * A) * T,
  27152. i[15] = (l * p * a - d * c * a + d * o * h - r * p * h - l * o * f + r * c * f) * T,
  27153. this
  27154. },
  27155. makeRotationFromQuaternion: function(e) {
  27156. var t = this.elements
  27157. , i = e.x
  27158. , n = e.y
  27159. , r = e.z
  27160. , o = e.w
  27161. , a = i + i
  27162. , s = n + n
  27163. , l = r + r
  27164. , c = i * a
  27165. , h = i * s
  27166. , u = i * l
  27167. , d = n * s
  27168. , p = n * l
  27169. , f = r * l
  27170. , g = o * a
  27171. , m = o * s
  27172. , v = o * l;
  27173. return t[0] = 1 - (d + f),
  27174. t[4] = h - v,
  27175. t[8] = u + m,
  27176. t[1] = h + v,
  27177. t[5] = 1 - (c + f),
  27178. t[9] = p - g,
  27179. t[2] = u - m,
  27180. t[6] = p + g,
  27181. t[10] = 1 - (c + d),
  27182. t[3] = 0,
  27183. t[7] = 0,
  27184. t[11] = 0,
  27185. t[12] = 0,
  27186. t[13] = 0,
  27187. t[14] = 0,
  27188. t[15] = 1,
  27189. this
  27190. }
  27191. },
  27192. r.Quaternion = function(e, t, i, n) {
  27193. this._x = e || 0,
  27194. this._y = t || 0,
  27195. this._z = i || 0,
  27196. this._w = void 0 !== n ? n : 1
  27197. }
  27198. ,
  27199. r.Quaternion.prototype = {
  27200. get x() {
  27201. return this._x
  27202. },
  27203. set x(e) {
  27204. this._x = e
  27205. },
  27206. get y() {
  27207. return this._y
  27208. },
  27209. set y(e) {
  27210. this._y = e
  27211. },
  27212. get z() {
  27213. return this._z
  27214. },
  27215. set z(e) {
  27216. this._z = e
  27217. },
  27218. get w() {
  27219. return this._w
  27220. },
  27221. set w(e) {
  27222. this._w = e
  27223. },
  27224. copy: function(e) {
  27225. this._x = e.x,
  27226. this._y = e.y,
  27227. this._z = e.z,
  27228. this._w = e.w
  27229. },
  27230. inverse: function() {
  27231. return this.conjugate().normalize()
  27232. },
  27233. conjugate: function() {
  27234. return this._x *= -1,
  27235. this._y *= -1,
  27236. this._z *= -1,
  27237. this
  27238. },
  27239. length: function() {
  27240. return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w)
  27241. },
  27242. normalize: function() {
  27243. var e = this.length();
  27244. return 0 === e ? (this._x = 0,
  27245. this._y = 0,
  27246. this._z = 0,
  27247. this._w = 1) : (e = 1 / e,
  27248. this._x = this._x * e,
  27249. this._y = this._y * e,
  27250. this._z = this._z * e,
  27251. this._w = this._w * e),
  27252. this
  27253. },
  27254. setFromAxisAngle: function(e, t) {
  27255. var i = t / 2
  27256. , n = Math.sin(i);
  27257. return this._x = e.x * n,
  27258. this._y = e.y * n,
  27259. this._z = e.z * n,
  27260. this._w = Math.cos(i),
  27261. this
  27262. },
  27263. setFromUnitVectors: function() {
  27264. var e, t, i = 1e-6;
  27265. return function(n, o) {
  27266. return void 0 === e && (e = new r.Vector3),
  27267. t = r.dot(n, o) + 1,
  27268. t < i ? (t = 0,
  27269. 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),
  27270. this._x = e.x,
  27271. this._y = e.y,
  27272. this._z = e.z,
  27273. this._w = t,
  27274. this.normalize()
  27275. }
  27276. }(),
  27277. multiply: function(e) {
  27278. return this.multiplyQuaternions(this, e)
  27279. },
  27280. premultiply: function(e) {
  27281. return this.multiplyQuaternions(e, this)
  27282. },
  27283. multiplyQuaternions: function(e, t) {
  27284. var i = e._x
  27285. , n = e._y
  27286. , r = e._z
  27287. , o = e._w
  27288. , a = t._x
  27289. , s = t._y
  27290. , l = t._z
  27291. , c = t._w;
  27292. return this._x = i * c + o * a + n * l - r * s,
  27293. this._y = n * c + o * s + r * a - i * l,
  27294. this._z = r * c + o * l + i * s - n * a,
  27295. this._w = o * c - i * a - n * s - r * l,
  27296. this
  27297. }
  27298. },
  27299. r.convertWorkshopVector = function(e) {
  27300. return new r.Vector3(-e.x,e.y,e.z)
  27301. }
  27302. ,
  27303. r.convertWorkshopQuaternion = function(e) {
  27304. 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))
  27305. }
  27306. ;
  27307. r.convertWorkshopOrthoZoom = function(e) {//xzw
  27308. //return e === -1 ? -1 : e / 16 * ($("#player").width() / $("#player").height()) / n.workshopApsect
  27309. return e === -1 ? -1 : e * ($("#player").width() / $("#player").height()) / g_snapShotWidth * g_snapShotHeight;
  27310. }
  27311. ,
  27312. r.convertWorkshopPanoramaQuaternion = function(e) {
  27313. 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))
  27314. }
  27315. ,
  27316. r.normalize = function(e) {
  27317. var t = e.x * e.x + e.y * e.y + e.z * e.z
  27318. , i = Math.sqrt(t);
  27319. e.x /= i,
  27320. e.y /= i,
  27321. e.z /= i
  27322. }
  27323. ,
  27324. r.dot = function(e, t) {
  27325. return e.x * t.x + e.y * t.y + e.z * t.z
  27326. }
  27327. ,
  27328. r.cross = function(e, t, i) {
  27329. var n = e.x
  27330. , r = e.y
  27331. , o = e.z;
  27332. i.x = r * t.z - o * t.y,
  27333. i.y = o * t.x - n * t.z,
  27334. i.z = n * t.y - r * t.x
  27335. }
  27336. ,
  27337. r.setVector = function(e, t, i, n) {
  27338. e.x = t,
  27339. e.y = i,
  27340. e.z = n
  27341. }
  27342. ,
  27343. r.copyVector = function(e, t) {
  27344. t.x = e.x,
  27345. t.y = e.y,
  27346. t.z = e.z
  27347. }
  27348. ,
  27349. r.addVector = function(e, t) {
  27350. e.x += t.x,
  27351. e.y += t.y,
  27352. e.z += t.z
  27353. }
  27354. ,
  27355. r.subVector = function(e, t) {
  27356. e.x -= t.x,
  27357. e.y -= t.y,
  27358. e.z -= t.z
  27359. }
  27360. ,
  27361. r.applyQuaternionToVector = function(e, t) {
  27362. var i = t.x
  27363. , n = t.y
  27364. , r = t.z
  27365. , o = e.x
  27366. , a = e.y
  27367. , s = e.z
  27368. , l = e.w
  27369. , c = l * i + a * r - s * n
  27370. , h = l * n + s * i - o * r
  27371. , u = l * r + o * n - a * i
  27372. , d = -o * i - a * n - s * r;
  27373. t.x = c * l + d * -o + h * -s - u * -a,
  27374. t.y = h * l + d * -a + u * -o - c * -s,
  27375. t.z = u * l + d * -s + c * -a - h * -o
  27376. }
  27377. ,
  27378. r.angleBetweenVectors = function(e, t) {
  27379. return Math.acos(r.dot(e, t))
  27380. }
  27381. ,
  27382. t.exports = r
  27383. }
  27384. , {
  27385. "../constants": 8
  27386. }],
  27387. 177: [function(e, t, i) {
  27388. (function(i) {
  27389. "use strict";
  27390. function n(e) {
  27391. this.cache = null,
  27392. this.expires = 0
  27393. }
  27394. function r() {
  27395. this.baseUrl = null,
  27396. this.cache = null,
  27397. this.expires = 0
  27398. }
  27399. function o() {
  27400. this.baseUrl = null,
  27401. this.expires = 0
  27402. }
  27403. function a(e) {
  27404. this.initialLoadingPromise = null,
  27405. this.endpoint = e + "?type=3",
  27406. this.urlContainer = null,
  27407. this.authorizationHeader = h.getAuthorizationHeader(),
  27408. this.containerClasses = [o, r, n]
  27409. }
  27410. var s = e("./ajax")
  27411. , l = e("./logger")
  27412. , c = e("../constants")
  27413. , h = e("./showcase")
  27414. , u = (e("../ab"),
  27415. new l(i));
  27416. n.prototype = {
  27417. version: 1,
  27418. validate: function(e) {
  27419. return "catalog.json"in e && Object.keys(e).length > 0
  27420. },
  27421. update: function(e) {
  27422. return this.cache = e,
  27423. this.expires = Date.now() + c.signedUrlDefaultExpireTime,
  27424. $.when()
  27425. },
  27426. get: function(e) {
  27427. return this.cache[e]
  27428. }
  27429. },
  27430. r.prototype = {
  27431. version: 2,
  27432. validate: function(e) {
  27433. return "catalog.json"in e && "base.url"in e && Object.keys(e).length > 1
  27434. },
  27435. update: function(e) {
  27436. return this.baseUrl = e["base.url"],
  27437. this.cache = e,
  27438. this.expires = Date.now() + c.signedUrlDefaultExpireTime,
  27439. $.when()
  27440. },
  27441. get: function(e) {
  27442. var t = this.cache[e];
  27443. return t ? this.baseUrl.replace("{{filename}}", e) + t : null
  27444. }
  27445. },
  27446. o.prototype = {
  27447. version: 3,
  27448. validate: function(e) {
  27449. return e.templates && e.catalog_file && (!e.expires || 1e3 * e.expires > Date.now())
  27450. },
  27451. update: function(e) {
  27452. return this.baseUrl = e.templates[0],
  27453. e.expires ? this.expires = 1e3 * e.expires : this.expires = Date.now() + c.signedUrlDefaultExpireTime,
  27454. $.when()
  27455. },
  27456. get: function(e) {
  27457. return this.baseUrl.replace("{{filename}}", e)
  27458. }
  27459. },
  27460. a.prototype = {
  27461. init: function() {
  27462. return this.initialLoadingPromise ? this.initialLoadingPromise : (setInterval(function() {
  27463. var e = this.urlContainer ? this.urlContainer.expires : Date.now();
  27464. Date.now() + c.signedUrlRefreshBuffer > e && (u.debug("Refreshing urls..."),
  27465. this.refresh().done(function() {
  27466. u.debug("Refreshed")
  27467. }).fail(function() {
  27468. u.error("Failed url refresh, urls might go stale soon")
  27469. }))
  27470. }
  27471. .bind(this), c.signedUrlCheckInterval),
  27472. this.initialLoadingPromise = this.refresh(),
  27473. this.initialLoadingPromise)
  27474. },
  27475. refresh: function(e) { //已经在someData.js里加载过了 不用再加载file了吧
  27476. e = e || {};
  27477. /*var t = void 0 === e.cache || e.cache;
  27478. return s.get( this.endpoint , { //file
  27479. responseType: "json",
  27480. prefetchFrom: t ? "files" : null,
  27481. cache: t,
  27482. auth: this.authorizationHeader
  27483. }).then(function(e) {
  27484. if (this.urlContainer && this.urlContainer.validate(e))
  27485. return this.urlContainer.update(e);
  27486. for (var i = 0; i < this.containerClasses.length; i++) {
  27487. var n = this.containerClasses[i]
  27488. , r = new n;
  27489. if (r.validate(e))
  27490. return u.info("Using urls version " + r.version),
  27491. this.urlContainer = r,
  27492. this.urlContainer.update(e)
  27493. }
  27494. return t ? this.refresh({
  27495. cache: !1
  27496. }) : $.Deferred().reject("missing-urls")
  27497. }
  27498. .bind(this), function(e) {
  27499. return "loading-failed"
  27500. }) */
  27501. return $.Deferred().resolve();
  27502. },
  27503. get: function(e) {
  27504. //return this.urlContainer.get(e)
  27505. return window.MP_PREFETCHED_MODELDATA.files.templates[0].replace("{{filename}}", e)
  27506. }
  27507. },
  27508. t.exports = a
  27509. }
  27510. ).call(this, "/js/util/ModelUrls.js")
  27511. }
  27512. , {
  27513. "../ab": 3,
  27514. "../constants": 8,
  27515. "./ajax": 181,
  27516. "./logger": 189,
  27517. "./showcase": 193
  27518. }],
  27519. 178: [function(e, t, i) {
  27520. (function(i) {
  27521. "use strict";
  27522. function n() {
  27523. u.call(this),
  27524. this.neighbourMap = {},
  27525. this.map = null
  27526. }
  27527. var r = e("three")
  27528. , o = e("./common")
  27529. , a = e("../settings")
  27530. , s = e("../objects/Panorama")
  27531. , a = e("../settings")
  27532. , l = e("./aStar")
  27533. , c = e("./logger")
  27534. , h = new c(i)
  27535. , u = e("./IndexedCollection")
  27536. , d = e("./transitions");
  27537. o.inherit(n, u),
  27538. n.prototype.getIndex = function(e) {
  27539. return e.id
  27540. }
  27541. ,
  27542. n.prototype.find = function(e, t) {
  27543. var i = o.filterAll(this.list, e);
  27544. return 0 === i.length ? null : (t && t.forEach(function(e) {
  27545. i = o.stableSort(i, e)
  27546. }),
  27547. i[0])
  27548. }
  27549. ,
  27550. n.prototype.sortByScore = function(e, t) {
  27551. var i = o.filterAll(this.list, e);
  27552. return 0 === i.length ? null : i = i.map(function(e) {
  27553. return {
  27554. pano: e,
  27555. score: t.reduce(function(t, i) {
  27556. return t + i(e)
  27557. }, 0)
  27558. }
  27559. }).sort(function(e, t) {
  27560. return t.score - e.score;
  27561. })
  27562. }
  27563. ,
  27564. n.prototype.lowestByScore = function(e, t, i) {
  27565. return this.findRankedByScore(0, e, t, i)
  27566. }
  27567. ,
  27568. n.prototype.findRankedByScore = function(e, t, i, n) {
  27569. n && (n.candidates = null,
  27570. n.pano = null),
  27571. e || (e = 0);
  27572. var r = this.sortByScore(t, i);
  27573. return !r || 0 === r.length || e >= r.length ? null : (n && (n.candidates = r,
  27574. n.pano = r[e].pano),
  27575. r[e].pano)
  27576. }
  27577. ,
  27578. n.prototype.showPanoScores = function(e) {
  27579. this.list.forEach(function(e) {
  27580. e.removeTextSprite()
  27581. });
  27582. var t = 6344768;
  27583. e.forEach(function(e) {
  27584. e.pano.addTextSprite(e.score.toFixed(2), t),
  27585. t = 16428055
  27586. })
  27587. }
  27588. ,
  27589. n.prototype.isNeighbour = function(e, t) {
  27590. return this.neighbourMap[e.id][t.id]
  27591. }
  27592. ,
  27593. n.prototype.getNeighbours = function(e) {
  27594. return this.neighbourMap[e.id]
  27595. }
  27596. ,
  27597. n.prototype.setNeighbour = function(e, t, i) {
  27598. return this.neighbourMap[e.id] || (this.neighbourMap[e.id] = {}),
  27599. this.neighbourMap[t.id] || (this.neighbourMap[t.id] = {}),
  27600. this.neighbourMap[e.id][e.id] = !0,
  27601. this.neighbourMap[t.id][t.id] = !0,
  27602. this.neighbourMap[e.id][t.id] = i,
  27603. this.neighbourMap[t.id][e.id] = i,
  27604. this.neighbourMap[e.id]
  27605. }
  27606. ,
  27607. n.prototype.findClosest = function(e, t) {
  27608. var i = [s.filters.isPanoAligned()];
  27609. return t && i.push(s.filters.inDirection(e, t, .75)),
  27610. this.find(i, [s.sortFunctions.distanceToPoint(e)])
  27611. }
  27612. ,
  27613. n.prototype.dualNeighbors = function(e, t) {
  27614. var i, n = [];
  27615. for (i in this.neighbourMap[e.id])
  27616. this.neighbourMap[t.id][i] && n.push(i);
  27617. return n
  27618. }
  27619. ,
  27620. n.prototype.populate_path_graph = function() {
  27621. 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;
  27622. for (e = 0; e < this.list.length; e += 1) {
  27623. o = this.list[e],
  27624. s = {},
  27625. l = !1,
  27626. i = o.neighbourPanos || o.findNeighourPanos();
  27627. for (t in i)
  27628. if (i[t]) {
  27629. a = this.index[t],
  27630. p.copy(o.floorPosition),
  27631. p.sub(a.floorPosition);
  27632. var m = Math.sqrt(p.x * p.x + p.z * p.z)
  27633. , v = (Math.abs(p.y) / Math.max(m, .01),
  27634. Math.max(0, Math.abs(p.y) - .2));
  27635. v > 0 ? (f += 1,
  27636. v = Math.pow(4 * v, 2),
  27637. m = Math.pow(m, 2),
  27638. n = Math.sqrt(v * v + m * m)) : (g += 1,
  27639. n = p.length()),
  27640. s[a.id] = n,
  27641. l = !0
  27642. }
  27643. l ? u[o.id] = s : d += 1
  27644. }
  27645. this.map = u,
  27646. h.info("graph ready in " + (Date.now() - c) + "ms, " + d + " had no neighbors")
  27647. }
  27648. ,
  27649. n.prototype.aStarSearch = function(e, t) {
  27650. var i = Date.now()
  27651. , n = new l({
  27652. start: e,
  27653. isEnd: function(e) {
  27654. return e === t
  27655. },
  27656. neighbor: function(e) {
  27657. var t = e.neighbourPanos || e.findNeighourPanos()
  27658. , i = [];
  27659. for (var n in t)
  27660. i.push(this.index[n]);
  27661. return i
  27662. }
  27663. .bind(this),
  27664. distance: function(e, t) {
  27665. var i = this.map[e.id]
  27666. , n = i[t.id];
  27667. return n
  27668. }
  27669. .bind(this),
  27670. heuristic: function(e, t) {
  27671. return 1
  27672. }
  27673. .bind(this),
  27674. hash: function(e) {
  27675. return e.id
  27676. },
  27677. timeout: 5e3
  27678. });
  27679. if (h.debug("A* search in " + (Date.now() - i) + "ms"),
  27680. "success" !== n.status)
  27681. return h.debug("Did not find A* path from " + e + " to " + t),
  27682. null;
  27683. h.debug("Total cost " + n.cost.toPrecision(3) + ", " + n.path.length + " steps");
  27684. var r = [];
  27685. return n.path.forEach(function(e) {
  27686. r.push(e.id)
  27687. }),
  27688. r
  27689. }
  27690. ,
  27691. n.prototype.includeNodesNearPath = function() {
  27692. var e = new r.Vector3
  27693. , t = new r.Vector3
  27694. , i = new r.Vector3
  27695. , n = new r.Vector3
  27696. , o = new r.Vector3
  27697. , a = new r.Vector3
  27698. , s = new r.Vector3
  27699. , l = new r.Vector3
  27700. , c = []
  27701. , h = new r.Vector3
  27702. , u = new r.Vector3;
  27703. return function(r, d) {
  27704. if (r)
  27705. for (var p = function(e, t, i) {
  27706. return o.copy(t).sub(e),
  27707. o.dot(i)
  27708. }, f = function(e, t) {
  27709. return p(h, e.position, i) - p(h, t.position, i)
  27710. }, g = 0; g < r.length - 1; ) {
  27711. var m = r[g]
  27712. , v = r[g + 1]
  27713. , A = this.index[m]
  27714. , y = this.index[v];
  27715. h.copy(A.position),
  27716. u.copy(y.position),
  27717. c.length = 0,
  27718. e.copy(u).sub(h),
  27719. i.copy(e).normalize();
  27720. for (var C = 0; C < this.list.length; C++) {
  27721. var I = this.list[C];
  27722. o.copy(I.position).sub(h);
  27723. var E = o.dot(i);
  27724. if (E > 0) {
  27725. s.copy(i),
  27726. s.multiplyScalar(E),
  27727. a.copy(o),
  27728. a.sub(s);
  27729. var b = a.length();
  27730. if (b < d) {
  27731. t.copy(e).negate(),
  27732. n.copy(t).normalize(),
  27733. l.copy(I.position).sub(u);
  27734. var w = l.dot(n);
  27735. w > 0 && c.push(I)
  27736. }
  27737. }
  27738. }
  27739. if (c.length > 0) {
  27740. c.sort(f);
  27741. for (var _ = r.length + c.length - 1; _ >= g + c.length; _--)
  27742. r[_] = r[_ - c.length];
  27743. for (var T = 0; T < c.length; T++)
  27744. r[T + g + 1] = c[T].id
  27745. }
  27746. g += c.length + 1
  27747. }
  27748. }
  27749. }(),
  27750. n.prototype.fadeMarkerOpacity = function(e, t) {
  27751. var i = void 0 === e ? a.panorama.markerOpacity : e
  27752. , n = this.list.findIndex(function(e) {
  27753. return e.marker
  27754. });
  27755. if (!(n < 0)) {
  27756. var r = this.list[n].marker.material.opacity;
  27757. if (r !== e) {
  27758. var o = i - r;
  27759. d.trigger({
  27760. func: function(e, t) {
  27761. var i = r + e * o;
  27762. this.forEach(function(e) {
  27763. e.marker && (e.marker.material.opacity = i)
  27764. })
  27765. }
  27766. .bind(this),
  27767. duration: void 0 === t ? a.markerOpacityTransitionTime : t,
  27768. name: "_fpm"
  27769. })
  27770. }
  27771. }
  27772. }
  27773. ,
  27774. t.exports = n
  27775. }
  27776. ).call(this, "/js/util/PanoramaCollection.js")
  27777. }
  27778. , {
  27779. "../objects/Panorama": 148,
  27780. "../settings": 166,
  27781. "./IndexedCollection": 175,
  27782. "./aStar": 180,
  27783. "./common": 185,
  27784. "./logger": 189,
  27785. "./transitions": 195,
  27786. three: 217
  27787. }],
  27788. 179: [function(e, t, i) {
  27789. "use strict";
  27790. function n() {
  27791. this.actionSequence = [],
  27792. this.actionSequenceInProgress = !1
  27793. }
  27794. function r(e, t, i, n) {
  27795. s.trackAlways("zoom_" + e, {
  27796. from: t,
  27797. to: i,
  27798. pano: n
  27799. })
  27800. }
  27801. function o(e, t) {
  27802. r("initial", 1, e, t)
  27803. }
  27804. function a(e, t, i) {
  27805. r("followup", e, t, i)
  27806. }
  27807. var s = e("../analytics");
  27808. n.prototype.reset = function(e) {
  27809. this.actionSequenceInProgress = !1,
  27810. this.actionSequence.length = 0
  27811. }
  27812. ,
  27813. n.prototype.addZoomAction = function() {
  27814. var e = null
  27815. , t = null
  27816. , i = !1
  27817. , n = function() {
  27818. if (e = null,
  27819. this.actionSequence.length > 0) {
  27820. var i = this.actionSequence[0].start
  27821. , n = this.actionSequence[this.actionSequence.length - 1].end;
  27822. 1 === i ? o(n, t) : a(i, n, t)
  27823. }
  27824. this.reset()
  27825. };
  27826. return function(r, o, a) {
  27827. if (r !== o) {
  27828. i || (n = n.bind(this),
  27829. i = !0),
  27830. e && (window.clearTimeout(e),
  27831. e = null),
  27832. a === t && this.actionSequenceInProgress || (this.reset(),
  27833. t = a),
  27834. this.actionSequenceInProgress = !0;
  27835. var s = {
  27836. start: r,
  27837. end: o
  27838. };
  27839. this.actionSequence.push(s),
  27840. e = window.setTimeout(n, 150)
  27841. }
  27842. }
  27843. }(),
  27844. t.exports = n
  27845. }
  27846. , {
  27847. "../analytics": 4
  27848. }],
  27849. 180: [function(e, t, i) {
  27850. "use strict";
  27851. function n(e) {
  27852. void 0 === e.timeout && (e.timeout = 1 / 0);
  27853. var t = e.hash || o
  27854. , i = {
  27855. data: e.start,
  27856. g: 0,
  27857. h: e.heuristic(e.start)
  27858. }
  27859. , n = i;
  27860. i.f = i.h;
  27861. var h = new s
  27862. , u = new l(a)
  27863. , d = c();
  27864. u.push(i),
  27865. d.set(t(i.data), i);
  27866. for (var p = new Date; u.size(); ) {
  27867. if (new Date - p > e.timeout)
  27868. return {
  27869. status: "timeout",
  27870. cost: n.g,
  27871. path: r(n)
  27872. };
  27873. var f = u.pop();
  27874. if (d.delete(t(f.data)),
  27875. e.isEnd(f.data))
  27876. return {
  27877. status: "success",
  27878. cost: f.g,
  27879. path: r(f)
  27880. };
  27881. h.add(t(f.data));
  27882. for (var g = e.neighbor(f.data), m = 0; m < g.length; m++) {
  27883. var v = g[m];
  27884. if (!h.contains(t(v))) {
  27885. var A = f.g + e.distance(f.data, v)
  27886. , y = d.get(t(v))
  27887. , C = !1;
  27888. if (void 0 === y)
  27889. y = {
  27890. data: v
  27891. },
  27892. d.set(t(v), y);
  27893. else {
  27894. if (y.g < A)
  27895. continue;
  27896. C = !0
  27897. }
  27898. y.parent = f,
  27899. y.g = A,
  27900. y.h = e.heuristic(v),
  27901. y.f = A + y.h,
  27902. y.h < n.h && (n = y),
  27903. C ? u.heapify() : u.push(y)
  27904. }
  27905. }
  27906. }
  27907. return {
  27908. status: "noPath",
  27909. cost: n.g,
  27910. path: r(n)
  27911. }
  27912. }
  27913. function r(e) {
  27914. if (void 0 !== e.parent) {
  27915. var t = r(e.parent);
  27916. return t.push(e.data),
  27917. t
  27918. }
  27919. return [e.data]
  27920. }
  27921. function o(e) {
  27922. return e.toString()
  27923. }
  27924. function a(e, t) {
  27925. return e.f - t.f
  27926. }
  27927. var s = e("Set")
  27928. , l = e("heap")
  27929. , c = e("dict");
  27930. t.exports = n
  27931. }
  27932. , {
  27933. Set: 196,
  27934. dict: 210,
  27935. heap: 211
  27936. }],
  27937. 181: [function(e, t, i) {
  27938. (function(i) {
  27939. "use strict";
  27940. function n(e, t, i) {
  27941. var n = new XMLHttpRequest;
  27942. if (i && "withCredentials"in n)
  27943. n.open(e, t, i);
  27944. else if ("undefined" != typeof XDomainRequest)
  27945. n = new XDomainRequest,
  27946. n.open(e, t);
  27947. else {
  27948. if (i)
  27949. throw "Browser does not support CORS!";
  27950. n.open(e, t)
  27951. }
  27952. return n
  27953. }
  27954. function r(e, t, i) {
  27955. function o() {
  27956. u.warn("Retrying ", t),
  27957. r(e, t, i).done(c.resolve.bind(c)).progress(c.notify.bind(c)).fail(c.reject.bind(c))
  27958. }
  27959. function a(e, t) {
  27960. var i = e.response;
  27961. if ("json" === t && "object" != typeof i)
  27962. try {
  27963. i = JSON.parse(e.responseText)
  27964. } catch (e) {
  27965. return void c.reject({
  27966. error: "Failed parsing JSON"
  27967. })
  27968. }
  27969. else if ("image/jpeg" === t) {
  27970. var n = new Uint8Array(e.response)
  27971. , r = new Blob([n],{
  27972. type: "image/jpeg"
  27973. })
  27974. , o = URL.createObjectURL(r);
  27975. i = new Image,
  27976. i.src = o,
  27977. i.crossOrigin = "Anonymous",
  27978. i.onload = function() {
  27979. URL.revokeObjectURL(o)
  27980. }
  27981. }
  27982. return i
  27983. }
  27984. var s = n(e, t, !1);
  27985. if (i = i || {},
  27986. i.retries = void 0 !== i.retries ? i.retries : 0,
  27987. i.retry = void 0 !== i.retry ? i.retry : "get" === e.toLowerCase(),
  27988. i.responseType)
  27989. if (["arraybuffer", "text", "json"].indexOf(i.responseType) > -1)
  27990. s.responseType = i.responseType;
  27991. else {
  27992. if ("image/jpeg" !== i.responseType)
  27993. throw new Error('reponseType can only be one of "arraybuffer", "text" or "json", "image/jpeg"');
  27994. s.responseType = "arraybuffer"
  27995. }
  27996. if ("json" === i.responseType && s.setRequestHeader("Accept", "application/json"),
  27997. i.auth && s.setRequestHeader("Authorization", i.auth),
  27998. "object" == typeof i.data && (i.data = JSON.stringify(i.data),
  27999. s.setRequestHeader("Content-Type", "application/json")),
  28000. "object" == typeof i.headers)
  28001. for (var l in i.headers)
  28002. s.setRequestHeader(l, i.headers[l]);
  28003. var c = $.Deferred();
  28004. return s.onreadystatechange = function(e) {
  28005. if (4 === this.readyState)
  28006. if (this.status >= 500 && this.status <= 600 && i.retry && i.retries < 3)
  28007. i.retries++,
  28008. setTimeout(o, 1e3);
  28009. else if (200 === this.status) {
  28010. var t = a(this, i.responseType);
  28011. c.resolve(t)
  28012. } else
  28013. c.reject(this)
  28014. }
  28015. ,
  28016. s.onprogress = function(e) {
  28017. c.notify(e)
  28018. }
  28019. ,
  28020. s.send(i.data),
  28021. c.promise()
  28022. }
  28023. function o(e) {
  28024. return Object.keys(e).sort().map(function(t) {
  28025. return {
  28026. key: t,
  28027. value: e[t]
  28028. }
  28029. })
  28030. }
  28031. function a(e, t) {
  28032. var i = t.responseType || null
  28033. , n = t.auth || null
  28034. , r = t.prefetchFrom || null
  28035. , a = e + "__" + i + "__" + n + "__" + r;
  28036. return t.headers && o(t.headers).forEach(function(e) {
  28037. a += "__" + e.key + ":" + e.value
  28038. }),
  28039. a
  28040. }
  28041. function s(e, t) {
  28042. return window.MP_REQUEST_CACHE ? window.MP_REQUEST_CACHE[a(e, t)] : null
  28043. }
  28044. function l(e, t, i) {
  28045. window.MP_REQUEST_CACHE && (window.MP_REQUEST_CACHE[a(e, t)] = i)
  28046. }
  28047. var c = e("./logger")
  28048. , h = e("../ab")
  28049. , u = new c(i);
  28050. window.URL = window.URL || window.webkitURL,
  28051. window.MP_REQUEST_CACHE = window.MP_REQUEST_CACHE || {},
  28052. window.MP_PREFETCHED_MODELDATA = window.MP_PREFETCHED_MODELDATA || {}
  28053. /* setTimeout(function() {//MP-- xzw delete
  28054. window.MP_REQUEST_CACHE = null,
  28055. window.MP_PREFETCHED_MODELDATA = {}
  28056. }, 6e4),
  28057. window.onpageshow = function(e) {
  28058. e.persisted && (window.MP_REQUEST_CACHE = null,
  28059. window.MP_PREFETCHED_MODELDATA = {})
  28060. } */
  28061. ,
  28062. t.exports = {
  28063. get: function(e, t) {
  28064. t = t || {};
  28065. var i = void 0 === t.cache || t.cache;
  28066. if (i) {
  28067. var n = s(e, t);
  28068. if (n)
  28069. return n
  28070. }
  28071. var o;
  28072. return o = t.prefetchFrom && window.MP_PREFETCHED_MODELDATA[t.prefetchFrom] ? $.when(window.MP_PREFETCHED_MODELDATA[t.prefetchFrom]) : r("GET", e, t),
  28073. i && l(e, t, o),
  28074. o
  28075. },
  28076. post: function(e, t) {
  28077. return r("POST", e, t)
  28078. },
  28079. patch: function(e, t) {
  28080. return r("PATCH", e, t)
  28081. },
  28082. getImage: function(e, t) {
  28083. function i() {
  28084. u.warn("Retrying ", e),
  28085. o.getImage(e, t - 1).done(n.resolve.bind(n)).progress(n.notify.bind(n)).fail(n.reject.bind(n))
  28086. }
  28087. var n = $.Deferred()
  28088. , r = new Image
  28089. , o = this;
  28090. return e = h.changeIfImageOptimzing(e),
  28091. null !== t && void 0 !== t || (t = 3),
  28092. r.onerror = function() {
  28093. t > 0 ? setTimeout(i, 1e3) : n.reject()
  28094. }
  28095. ,
  28096. r.onload = function() {
  28097. n.resolve(r)
  28098. }
  28099. ,
  28100. r.crossOrigin = "anonymous",
  28101. r.src = e,
  28102. n
  28103. }
  28104. }
  28105. }
  28106. ).call(this, "/js/util/ajax.js")
  28107. }
  28108. , {
  28109. "../ab": 3,
  28110. "./logger": 189
  28111. }],
  28112. 182: [function(e, t, i) {
  28113. "use strict";
  28114. function n(e, t) {
  28115. var i = window.navigator.userAgent
  28116. , n = i.match(e);
  28117. return n = n ? n[1].split(t) : [],
  28118. {
  28119. major: parseInt(n[0]) || 0,
  28120. minor: parseInt(n[1]) || 0,
  28121. patch: parseInt(n[2]) || 0
  28122. }
  28123. }
  28124. var r = e("../exception/DeviceMismatchException");
  28125. t.exports = {
  28126. isFullscreen: function() {
  28127. return document.fullscreenElement || document.mozFullscreenElement || document.mozFullScreenElement || document.webkitFullscreenElement || document.msFullscreenElement
  28128. },
  28129. supportsFullscreen: function() {
  28130. return document.fullscreenEnabled || document.mozFullscreenEnabled || document.mozFullScreenEnabled || document.webkitFullscreenEnabled || document.msFullscreenEnabled
  28131. },
  28132. isPointerLocked: function() {
  28133. return document.pointerLockElement || document.mozPointerLockElement || document.webkitPointerLockElement
  28134. },
  28135. requestFullscreen: function(e, t) {
  28136. e.requestFullscreen ? e.requestFullscreen() : e.mozRequestFullScreen ? e.mozRequestFullScreen() : e.webkitRequestFullscreen ? e.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT) : e.msRequestFullscreen && e.msRequestFullscreen(),
  28137. t && $(document).on("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", browser.requestPointerLock)
  28138. },
  28139. requestPointerLock: function() {
  28140. var e;
  28141. if (document.fullscreenElement)
  28142. e = document.fullscreenElement();
  28143. else if (document.mozFullscreenElement)
  28144. e = document.mozFullscreenElement();
  28145. else if (document.mozFullScreenElement)
  28146. e = document.mozFullScreenElement();
  28147. else {
  28148. if (!document.webkitFullscreenElement)
  28149. return;
  28150. e = document.webkitFullscreenElement()
  28151. }
  28152. e.requestPointerLock = e.requestPointerLock || e.mozRequestPointerLock || e.webkitRequestPointerLock,
  28153. e.requestPointerLock(),
  28154. $(document).off("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", this)
  28155. },
  28156. exitPointerLock: function() {
  28157. document.exitPointerLock = document.exitPointerLock || document.mozExitPointerLock || document.webkitExitPointerLock,
  28158. document.exitPointerLock()
  28159. },
  28160. exitFullscreen: function() {
  28161. document.exitFullscreen ? document.exitFullscreen() : document.msExitFullscreen ? document.msExitFullscreen() : document.mozCancelFullScreen ? document.mozCancelFullScreen() : document.webkitExitFullscreen && document.webkitExitFullscreen()
  28162. },
  28163. details: function() {
  28164. var e = navigator.userAgent.match("(Firefox|Chrome|Safari)/([\\d]+)");
  28165. return e ? {
  28166. name: e[1],
  28167. version: parseInt(e[2]),
  28168. platform: navigator.platform
  28169. } : {}
  28170. },
  28171. is: function(e) {
  28172. return this.details() && this.details().name === e
  28173. },
  28174. inIframe: function() {
  28175. return window.parent !== window
  28176. },
  28177. aspectRatio: function() {
  28178. var e = $("#player").width() / $("#player").height();
  28179. return isFinite(e) ? e : 0
  28180. },
  28181. userAgent: function() {
  28182. return window.navigator.userAgent
  28183. },
  28184. isMobile: function() {
  28185. var e = navigator.userAgent || navigator.vendor || window.opera;
  28186. 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))
  28187. },
  28188. isLandscape: function() {
  28189. return this.isMobile && this.aspectRatio() > 1
  28190. },
  28191. isSmallScreen: function() {
  28192. var e = screen.width / window.devicePixelRatio;
  28193. return e < 240
  28194. },
  28195. detectIE: function() {
  28196. var e = window.navigator.userAgent
  28197. , t = e.indexOf("MSIE ");
  28198. return t !== -1 || !!navigator.userAgent.match(/Trident.*rv\:11\./)
  28199. },
  28200. detectSafari: function() {
  28201. var e = window.navigator.userAgent
  28202. , t = e.indexOf("Safari");
  28203. return t !== -1 && !this.detectChrome()
  28204. },
  28205. detectFirefox: function() {
  28206. var e = window.navigator.userAgent;
  28207. return e.indexOf("Firefox") !== -1
  28208. },
  28209. detectChrome: function() {
  28210. var e = window.navigator.userAgent;
  28211. return e.indexOf("Chrome") !== -1 && !this.detectOpera()
  28212. },
  28213. detectOpera: function() {
  28214. var e = window.navigator.userAgent;
  28215. return e.indexOf("OPR") !== -1
  28216. },
  28217. detectIOS: function() {
  28218. return this.detectIPhone() || this.detectIPad() || this.detectIPod()
  28219. },
  28220. detectIPad: function() {
  28221. var e = window.navigator.userAgent
  28222. , t = /iPad/;
  28223. return t.test(e)
  28224. },
  28225. detectIPod: function() {
  28226. var e = window.navigator.userAgent
  28227. , t = /iPod/;
  28228. return t.test(e)
  28229. },
  28230. detectIPhone: function() {
  28231. var e = window.navigator.userAgent
  28232. , t = /iPhone/;
  28233. return t.test(e)
  28234. },
  28235. detectAndroid: function() {
  28236. var e = window.navigator.userAgent;
  28237. return e.indexOf("Android") !== -1
  28238. },
  28239. detectAndroidMobile: function() {
  28240. var e = window.navigator.userAgent;
  28241. return this.detectAndroid() && e.indexOf("Mobile") !== -1
  28242. },
  28243. detectSamsungNative: function() {
  28244. var e = window.navigator.userAgent;
  28245. return e.indexOf("SM-G900H") !== -1 || e.indexOf("GT-I9500") !== -1 || e.indexOf("SM-N900") !== -1
  28246. },
  28247. detectSamsungS6: function() {
  28248. var e = window.navigator.userAgent;
  28249. return e.indexOf("SM-G92") !== -1
  28250. },
  28251. detectWebVR: function() {
  28252. return !(!window.navigator.getVRDisplays || !window.VRDisplay)
  28253. },
  28254. getVRDisplay: function() {
  28255. var e = $.Deferred();
  28256. return this.detectWebVR() ? (navigator.getVRDisplays().then(function(t) {
  28257. t.length >= 1 && e.resolve(t[0]),
  28258. e.reject(null)
  28259. }),
  28260. e) : e.reject(null)
  28261. },
  28262. iosVersion: function() {
  28263. if (!this.detectIOS())
  28264. throw new r("Did not detect an iDevice");
  28265. var e = /((?:\d+\_?){1,3}) like Mac OS/
  28266. , t = "_";
  28267. return n(e, t)
  28268. },
  28269. androidVersion: function() {
  28270. if (!this.detectAndroid())
  28271. throw new r("Did not detect an Android based device");
  28272. var e = /Android ((?:\d+\.?){1,3})/
  28273. , t = ".";
  28274. return n(e, t)
  28275. },
  28276. valueFromCookie: function(e, t) {
  28277. var i = new RegExp(e + "=([0-9a-f]+)(; ?|$)").exec(document.cookie);
  28278. if (!i)
  28279. return t;
  28280. var n = i[1];
  28281. return "boolean" == typeof t ? "true" === n || "1" === n : "number" == typeof t ? parseFloat(n) : n
  28282. },
  28283. valueFromHash: function(e, t) {
  28284. var i = new RegExp("[#&?]" + e + "=([^#&?]*)")
  28285. , n = i.exec(window.location.href);
  28286. if (!n)
  28287. return t;
  28288. var r = n[1];
  28289. return "boolean" == typeof t ? "true" === r || "1" === r : "number" == typeof t ? parseFloat(r) : window.decodeURIComponent(r)
  28290. }
  28291. }
  28292. }
  28293. , {
  28294. "../exception/DeviceMismatchException": 56
  28295. }],
  28296. 183: [function(e, t, i) {
  28297. (function(i) {
  28298. "use strict";
  28299. function n(e, t) {
  28300. var i = r(t);
  28301. if (Object.keys(i).length > 0)
  28302. return i;
  28303. if (e.heroImage)
  28304. i = o(e, t);
  28305. else if (e.data.camera_start) {
  28306. var n = e.data.camera_start;
  28307. try {
  28308. Object.keys(n).length > 0 && !l.isEmptyQuaternion(n.camera.quaternion) && (i.mode = h.convertWorkshopModeInt(n.mode),
  28309. i.position = n.camera.position,
  28310. //i.quaternion = n.camera.quaternion,
  28311. i.quaternion = new th.Quaternion().fromArray(n.camera.quaternion),//xzw
  28312. i.zoom = l.convertWorkshopOrthoZoom(n.camera.zoom),
  28313. n.pano && (i.pano = t.get(n.pano.uuid) || t.findClosest(i.position),
  28314. d.debug("Using camera_start"),
  28315. d.debug("Modeldata pano: ", i.pano.quaternion),
  28316. d.debug("Camera start pano: ", n.pano.quaternion)),
  28317. i.mode !== h.PANORAMA && (i.floorVisibility = e.heroImage.metadata.floor_visibility))
  28318. } catch (e) {
  28319. d.warn(e.message)
  28320. }
  28321. }
  28322. if (e.outsideAllowed() || i.mode === h.PANORAMA || (i = {}),
  28323. i.mode === h.MESH && i.position && (i.mode = h.PANORAMA,
  28324. i.pano = t.findClosest(i.position),
  28325. i.quaternion = i.pano.quaternion),
  28326. 0 === Object.keys(i).length) {
  28327. var a = t.list[0];
  28328. a && (i.mode = h.PANORAMA,
  28329. i.pano = a,
  28330. i.position = a.position,
  28331. i.quaternion = a.quaternion,
  28332. d.info("Starting at 1st pano " + a.id))
  28333. }
  28334. return i.mode = i.mode || h.DOLLHOUSE,
  28335. i
  28336. }
  28337. function r(e) {
  28338. var t = c.valueFromHash("start", "")
  28339. , i = {};
  28340. if ("" !== t) {
  28341. d.debug("Start override found in parameters, trying to parse..."),
  28342. i = a(t) || {};
  28343. var n = c.valueFromHash("tag", null);
  28344. n && (i.tag = n),
  28345. i.panoId && (i.pano = e.get(i.panoId))
  28346. }
  28347. return i
  28348. }
  28349. function o(e, t) {
  28350. if (!e.heroImage || !e.heroImage.metadata.camera_position)
  28351. return {};
  28352. var i = {}
  28353. , n = e.heroImage.metadata;
  28354. d.debug("Using start position from thumbnail image"),
  28355. i.position = n.camera_position,
  28356. i.quaternion = n.camera_quaternion;
  28357. try {
  28358. i.mode = h.convertWorkshopModeInt(n.camera_mode),
  28359. i.mode === h.PANORAMA ? i.pano = t.get(n.scan_id) : i.floorVisibility = n.floor_visibility
  28360. } catch (e) {
  28361. d.debug(e.message)
  28362. }
  28363. return i
  28364. }
  28365. function a(e) {
  28366. return s.deserialize(e)
  28367. }
  28368. var s = e("../controls/serializer")
  28369. , l = e("../util/math")
  28370. , c = e("./browser")
  28371. , h = e("../enum/Viewmode")
  28372. , u = e("../util/logger")
  28373. , th = e("three")//xzw
  28374. , d = new u(i);
  28375. t.exports = {
  28376. getStartCameraOptions: n
  28377. }
  28378. }
  28379. ).call(this, "/js/util/camera.js")
  28380. }
  28381. , {
  28382. "../controls/serializer": 14,
  28383. "../enum/Viewmode": 51,
  28384. "../util/logger": 189,
  28385. "../util/math": 190,
  28386. "./browser": 182,
  28387. "three": 217
  28388. }],
  28389. 184: [function(e, t, i) {
  28390. "use strict";
  28391. function n(e, t, i) {
  28392. return o(e.fov, t, i)
  28393. }
  28394. var r = e("./MathLight")
  28395. , o = function(e, t, i) {
  28396. var n = t
  28397. , o = i
  28398. , a = 2 * Math.atan(Math.tan(e * r.RADIANS_PER_DEGREE / 2) * (n / o)) * r.DEGREES_PER_RADIAN;
  28399. return a
  28400. }
  28401. , a = function(e, t, i) {
  28402. var n = t
  28403. , o = i
  28404. , a = 2 * Math.atan(Math.tan(e * r.RADIANS_PER_DEGREE / 2) * (o / n)) * r.DEGREES_PER_RADIAN;
  28405. return a
  28406. }
  28407. , s = function(e, t, i, n) {
  28408. var r = o(e, i, n);
  28409. return r > t ? a(t, i, n) : e
  28410. };
  28411. t.exports = {
  28412. clampVFOV: s,
  28413. getHFOVForCamera: n,
  28414. getHFOVFromVFOV: o,
  28415. getVFOVFromHFOV: a
  28416. }
  28417. }
  28418. , {
  28419. "./MathLight": 176
  28420. }],
  28421. 185: [function(e, t, i) {
  28422. "use strict";
  28423. var n = e("three");
  28424. t.exports = {
  28425. delayOneFrame: function(e) {
  28426. window.setTimeout(e, 1)
  28427. },
  28428. normalizeUrl: function(e) {
  28429. return e.replace("https://", "http://")
  28430. },
  28431. domainFromUrl: function(e) {
  28432. var t = /^([^:]*:\/\/)?(www\.)?([^\/]+)/.exec(e);
  28433. return t ? t[3] : e
  28434. },
  28435. average: function(e, t) {
  28436. if (0 === e.length)
  28437. return null;
  28438. for (var i = 0, n = 0, r = 0; r < e.length; r++) {
  28439. var o = t ? e[r][t] : e[r];
  28440. i += o,
  28441. n++
  28442. }
  28443. return i / n
  28444. },
  28445. countUnique: function(e) {
  28446. for (var t = {}, i = 0; i < e.length; i++)
  28447. t[e[i]] = 1 + (t[e[i]] || 0);
  28448. return Object.keys(t).length
  28449. },
  28450. averageVectors: function(e, t) {
  28451. var i = new n.Vector3;
  28452. if (0 === e.length)
  28453. return i;
  28454. for (var r = 0, o = 0; o < e.length; o++) {
  28455. var a = t ? e[o][t] : e[o];
  28456. i.add(a),
  28457. r++
  28458. }
  28459. return i.divideScalar(r)
  28460. },
  28461. equalLists: function(e, t) {
  28462. if (e.length !== t.length)
  28463. return !1;
  28464. for (var i = 0; i < e.length; i++)
  28465. if (e[i] !== t[i])
  28466. return !1;
  28467. return !0
  28468. },
  28469. lowerMedian: function(e, t) {
  28470. if (0 === e.length)
  28471. return null;
  28472. t = t || 2,
  28473. e.sort(function(e, t) {
  28474. return e - t
  28475. });
  28476. var i = Math.floor(e.length / t);
  28477. return e[i]
  28478. },
  28479. stableSort: function(e, t) {
  28480. return e.map(function(e, t) {
  28481. return {
  28482. value: e,
  28483. index: t
  28484. }
  28485. }).sort(function(e, i) {
  28486. var n = t(e.value, i.value);
  28487. return 0 !== n ? n : e.index - i.index
  28488. }).map(function(e) {
  28489. return e.value
  28490. })
  28491. },
  28492. filterAll: function(e, t) {
  28493. return e.filter(function(e) {
  28494. return t.every(function(t) {
  28495. return t(e)
  28496. })
  28497. })
  28498. },
  28499. formatDate: function(e) {
  28500. return [e.getFullYear(), e.getMonth() + 1, e.getDate()].join("-")
  28501. },
  28502. formatDatetime: function(e) {
  28503. return [e.getFullYear(), e.getMonth() + 1, e.getDate(), e.getHours(), e.getMinutes()].join("-")
  28504. },
  28505. randomString: function(e) {
  28506. for (var t = "", i = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", n = 0; n < e; n++)
  28507. t += i.charAt(Math.floor(Math.random() * i.length));
  28508. return t
  28509. },
  28510. uint8ToBase64: function(e, t) {
  28511. t && "number" == typeof t || (t = 8192);
  28512. for (var i = [], n = 0; n < e.length; n += t)
  28513. i.push(String.fromCharCode.apply(null, e.subarray(n, n + t)));
  28514. return btoa(i.join(""))
  28515. },
  28516. uuid4: function e(t) {
  28517. return t ? (t ^ 16 * Math.random() >> t / 4).toString(16) : ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, e)
  28518. },
  28519. nth: function(e) {
  28520. return e %= 10,
  28521. 1 === e ? e + "st" : 2 === e ? e + "nd" : 3 === e ? e + "rd" : e + "th"
  28522. },
  28523. extendObject: function(e, t) {
  28524. return Object.keys(t).forEach(function(i) {
  28525. e[i] = t[i]
  28526. }),
  28527. e
  28528. },
  28529. deepExtend: function e(t) {
  28530. t = t || {};
  28531. for (var i = 1; i < arguments.length; i++) {
  28532. var n = arguments[i];
  28533. if (n)
  28534. for (var r in n)
  28535. n.hasOwnProperty(r) && ("object" == typeof n[r] ? t[r] = e(t[r], n[r]) : t[r] = n[r])
  28536. }
  28537. return t
  28538. },
  28539. inherit: function(e, t) {
  28540. e.prototype = Object.create(t.prototype),
  28541. e.prototype.constructor = e
  28542. },
  28543. extend: function(e, t) {
  28544. for (var i in t.prototype)
  28545. e.prototype[i] = t.prototype[i]
  28546. }
  28547. },
  28548. Math.sign = function(e) {
  28549. return e < 0 ? -1 : 1
  28550. }
  28551. }
  28552. , {
  28553. three: 217
  28554. }],
  28555. 186: [function(e, t, i) {
  28556. "use strict";
  28557. var n = {};
  28558. n.linearTween = function(e, t, i, n) {
  28559. return i * e / n + t
  28560. }
  28561. ,
  28562. n.easeInQuad = function(e, t, i, n) {
  28563. return e /= n,
  28564. i * e * e + t
  28565. }
  28566. ,
  28567. n.easeOutQuad = function(e, t, i, n) {
  28568. return e /= n,
  28569. -i * e * (e - 2) + t
  28570. }
  28571. ,
  28572. n.easeInOutQuad = function(e, t, i, n) {
  28573. return e /= n / 2,
  28574. e < 1 ? i / 2 * e * e + t : (e--,
  28575. -i / 2 * (e * (e - 2) - 1) + t)
  28576. }
  28577. ,
  28578. n.easeInCubic = function(e, t, i, n) {
  28579. return e /= n,
  28580. i * e * e * e + t
  28581. }
  28582. ,
  28583. n.easeOutCubic = function(e, t, i, n) {
  28584. return e /= n,
  28585. e--,
  28586. i * (e * e * e + 1) + t
  28587. }
  28588. ,
  28589. n.easeInOutCubic = function(e, t, i, n) {
  28590. return e /= n / 2,
  28591. e < 1 ? i / 2 * e * e * e + t : (e -= 2,
  28592. i / 2 * (e * e * e + 2) + t)
  28593. }
  28594. ,
  28595. n.easeInQuart = function(e, t, i, n) {
  28596. return e /= n,
  28597. i * e * e * e * e + t
  28598. }
  28599. ,
  28600. n.easeOutQuart = function(e, t, i, n) {
  28601. return e /= n,
  28602. e--,
  28603. -i * (e * e * e * e - 1) + t
  28604. }
  28605. ,
  28606. n.easeInOutQuart = function(e, t, i, n) {
  28607. return e /= n / 2,
  28608. e < 1 ? i / 2 * e * e * e * e + t : (e -= 2,
  28609. -i / 2 * (e * e * e * e - 2) + t)
  28610. }
  28611. ,
  28612. n.easeInQuint = function(e, t, i, n) {
  28613. return e /= n,
  28614. i * e * e * e * e * e + t
  28615. }
  28616. ,
  28617. n.easeOutQuint = function(e, t, i, n) {
  28618. return e /= n,
  28619. e--,
  28620. i * (e * e * e * e * e + 1) + t
  28621. }
  28622. ,
  28623. n.easeInOutQuint = function(e, t, i, n) {
  28624. return e /= n / 2,
  28625. e < 1 ? i / 2 * e * e * e * e * e + t : (e -= 2,
  28626. i / 2 * (e * e * e * e * e + 2) + t)
  28627. }
  28628. ,
  28629. n.easeInSine = function(e, t, i, n) {
  28630. return -i * Math.cos(e / n * (Math.PI / 2)) + i + t
  28631. }
  28632. ,
  28633. n.easeOutSine = function(e, t, i, n) {
  28634. return i * Math.sin(e / n * (Math.PI / 2)) + t
  28635. }
  28636. ,
  28637. n.easeInOutSine = function(e, t, i, n) {
  28638. return -i / 2 * (Math.cos(Math.PI * e / n) - 1) + t
  28639. }
  28640. ,
  28641. n.easeInExpo = function(e, t, i, n) {
  28642. return i * Math.pow(2, 10 * (e / n - 1)) + t
  28643. }
  28644. ,
  28645. n.easeOutExpo = function(e, t, i, n) {
  28646. return i * (-Math.pow(2, -10 * e / n) + 1) + t
  28647. }
  28648. ,
  28649. n.easeInOutExpo = function(e, t, i, n) {
  28650. return e /= n / 2,
  28651. e < 1 ? i / 2 * Math.pow(2, 10 * (e - 1)) + t : (e--,
  28652. i / 2 * (-Math.pow(2, -10 * e) + 2) + t)
  28653. }
  28654. ,
  28655. n.easeInCirc = function(e, t, i, n) {
  28656. return e /= n,
  28657. -i * (Math.sqrt(1 - e * e) - 1) + t
  28658. }
  28659. ,
  28660. n.easeOutCirc = function(e, t, i, n) {
  28661. return e /= n,
  28662. e--,
  28663. i * Math.sqrt(1 - e * e) + t
  28664. }
  28665. ,
  28666. n.easeInOutCirc = function(e, t, i, n) {
  28667. return e /= n / 2,
  28668. e < 1 ? -i / 2 * (Math.sqrt(1 - e * e) - 1) + t : (e -= 2,
  28669. i / 2 * (Math.sqrt(1 - e * e) + 1) + t)
  28670. }
  28671. ,
  28672. n.easeInElastic = function(e, t, i, n) {
  28673. var r = 1.70158
  28674. , o = 0
  28675. , a = i;
  28676. return 0 === e ? t : 1 === (e /= n) ? t + i : (o || (o = .3 * n),
  28677. a < Math.abs(i) ? (a = i,
  28678. r = o / 4) : r = o / (2 * Math.PI) * Math.asin(i / a),
  28679. -(a * Math.pow(2, 10 * (e -= 1)) * Math.sin((e * n - r) * (2 * Math.PI) / o)) + t)
  28680. }
  28681. ,
  28682. n.easeOutElastic = function(e, t, i, n) {
  28683. var r = 1.70158
  28684. , o = 0
  28685. , a = i;
  28686. return 0 === e ? t : 1 === (e /= n) ? t + i : (o || (o = .3 * n),
  28687. a < Math.abs(i) ? (a = i,
  28688. r = o / 4) : r = o / (2 * Math.PI) * Math.asin(i / a),
  28689. a * Math.pow(2, -10 * e) * Math.sin((e * n - r) * (2 * Math.PI) / o) + i + t)
  28690. }
  28691. ,
  28692. n.easeInOutElastic = function(e, t, i, n) {
  28693. var r = 1.70158
  28694. , o = 0
  28695. , a = i;
  28696. return 0 === e ? t : 2 === (e /= n / 2) ? t + i : (o || (o = n * (.3 * 1.5)),
  28697. a < Math.abs(i) ? (a = i,
  28698. r = o / 4) : r = o / (2 * Math.PI) * Math.asin(i / a),
  28699. 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)
  28700. }
  28701. ,
  28702. n.easeInBack = function(e, t, i, n, r) {
  28703. return void 0 === r && (r = 1.70158),
  28704. i * (e /= n) * e * ((r + 1) * e - r) + t
  28705. }
  28706. ,
  28707. n.easeOutBack = function(e, t, i, n, r) {
  28708. return void 0 === r && (r = 1.70158),
  28709. i * ((e = e / n - 1) * e * ((r + 1) * e + r) + 1) + t
  28710. }
  28711. ,
  28712. n.easeInOutBack = function(e, t, i, n, r) {
  28713. return void 0 === r && (r = 1.70158),
  28714. (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
  28715. }
  28716. ,
  28717. n.easeOutBounce = function(e, t, i, n) {
  28718. 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
  28719. }
  28720. ,
  28721. n.easeInBounce = function(e, t, i, r) {
  28722. return i - n.easeOutBounce(r - e, 0, i, r) + t
  28723. }
  28724. ,
  28725. n.easeInOutBounce = function(e, t, i, r) {
  28726. 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
  28727. }
  28728. ,
  28729. t.exports = n
  28730. }
  28731. , {}],
  28732. 187: [function(e, t, i) {
  28733. "use strict";
  28734. function n() {
  28735. this.events = [],
  28736. this.valid = !1
  28737. }
  28738. var r = e("../enum/Joystick");
  28739. n.prototype.push = function(e, t) {
  28740. this.events.push({
  28741. direction: e,
  28742. pano: t
  28743. }),
  28744. this.valid = !0
  28745. }
  28746. ,
  28747. n.prototype.pop = function(e) {
  28748. var t = this.events.pop();
  28749. return this.events.length < 1 && (this.valid = !1),
  28750. t
  28751. }
  28752. ,
  28753. n.prototype.peek = function() {
  28754. return this.events.length ? this.events[this.events.length - 1] : {
  28755. direction: null,
  28756. pano: null
  28757. }
  28758. }
  28759. ,
  28760. n.prototype.invalidate = function() {
  28761. this.events = [],
  28762. this.valid = !1
  28763. }
  28764. ,
  28765. n.prototype.reversePano = function(e) {
  28766. if (!this.valid)
  28767. return null;
  28768. var t = this.peek();
  28769. return r.opposite(e) === t.direction ? (this.pop(),
  28770. t.pano) : null
  28771. }
  28772. ,
  28773. t.exports = n
  28774. }
  28775. , {
  28776. "../enum/Joystick": 29
  28777. }],
  28778. 188: [function(e, t, i) {
  28779. "use strict";
  28780. t.exports = {
  28781. vector: function(e, t) {
  28782. var i = e.clone();
  28783. return t = t.clone(),
  28784. function(n) {
  28785. e.set(i.x * (1 - n) + t.x * n, i.y * (1 - n) + t.y * n, i.z * (1 - n) + t.z * n)
  28786. }
  28787. },
  28788. quaternion: function(e, t) {
  28789. var i = e.clone();
  28790. return function(n) {
  28791. e.copy(i).slerp(t, n)
  28792. }
  28793. },
  28794. property: function(e, t, i, n) {
  28795. var r = e[t];
  28796. return function(o) {
  28797. e[t] = r * (1 - o) + i * o,
  28798. n && n(e[t])
  28799. }
  28800. },
  28801. uniform: function(e, t, i) {
  28802. var n = e.material.uniforms[t].value;
  28803. return function(r) {
  28804. e.material.uniforms[t] && (e.material.uniforms[t].value = n * (1 - r) + i * r)
  28805. }
  28806. },
  28807. matrix4: function(e, t) {
  28808. var i = e.clone();
  28809. return function(n) {
  28810. for (var r = e.elements, o = i.elements, a = t.elements, s = 0; s < 16; s++)
  28811. r[s] = o[s] * (1 - n) + a[s] * n
  28812. }
  28813. },
  28814. allUniforms: function(e, t, i) {
  28815. var n = e.map(function(e) {
  28816. return this.uniform(e, t, i)
  28817. }
  28818. .bind(this));
  28819. return function(e) {
  28820. n.forEach(function(t) {
  28821. t(e)
  28822. })
  28823. }
  28824. }
  28825. }
  28826. }
  28827. , {}],
  28828. 189: [function(e, t, i) {
  28829. "use strict";
  28830. function n(e) {
  28831. var t, i, o, a, s = e.split("/"), l = "[" + s[s.length - 1].replace(".js", "") + "]", c = {};
  28832. if (n.consoleEnabled) {
  28833. var h = function(e) {
  28834. $("#debug-console").append("<p>" + e + "</p>"),
  28835. $("#debug-console")[0].scrollTop = $("#debug-console")[0].scrollHeight
  28836. };
  28837. t = function(e) {
  28838. h(Array.prototype.slice.call(arguments).join(" "))
  28839. }
  28840. ,
  28841. i = function(e) {
  28842. h(Array.prototype.slice.call(arguments).join(" "))
  28843. }
  28844. ,
  28845. o = function(e) {
  28846. h("WARN: " + Array.prototype.slice.call(arguments).join(" "))
  28847. }
  28848. ,
  28849. a = function(e) {
  28850. h("ERROR: " + Array.prototype.slice.call(arguments).join(" "))
  28851. }
  28852. } else
  28853. console.log ? (t = console.log,
  28854. i = console.info ? console.info : console.log,
  28855. o = console.warn ? console.warn : console.log,
  28856. a = console.error ? console.error : console.log) : t = i = o = a = function() {}
  28857. ;
  28858. var u = function(e) {
  28859. return [l, n.timestamp()].concat(Array.prototype.slice.call(e))
  28860. }
  28861. , d = function(t, i) {
  28862. if (r) {
  28863. var o = Array.prototype.slice.call(t).join(" ");
  28864. r.captureMessage(o, {
  28865. level: i,
  28866. path: e,
  28867. timestamp: n.timestamp()
  28868. })
  28869. }
  28870. }
  28871. , p = function(t, i) {
  28872. if (r) {
  28873. var o = Array.prototype.slice.call(t).join(" ");
  28874. r.captureException(new Error(o), {
  28875. level: i,
  28876. path: e,
  28877. timestamp: n.timestamp()
  28878. })
  28879. }
  28880. };
  28881. return {
  28882. debug: function() {
  28883. n.level >= n.levels.debug && t.apply(console, u(arguments))
  28884. },
  28885. info: function() {
  28886. n.level >= n.levels.info && i.apply(console, u(arguments))
  28887. },
  28888. warn: function() {
  28889. d(arguments, "warn"),
  28890. n.level >= n.levels.warn && o.apply(console, u(arguments))
  28891. },
  28892. error: function() {
  28893. p(arguments, "error"),
  28894. n.level >= n.levels.error && a.apply(console, u(arguments))
  28895. },
  28896. v3str: function(e, t) {
  28897. var i = void 0 === t ? 2 : t;
  28898. return "(" + e.x.toPrecision(i) + ", " + e.y.toPrecision(i) + ", " + e.z.toPrecision(i) + ")"
  28899. },
  28900. eulstr: function(e, t) {
  28901. var i = void 0 === t ? 2 : t;
  28902. return "(" + THREE.Math.radToDeg(e.x).toPrecision(i) + ", " + THREE.Math.radToDeg(e.y).toPrecision(i) + ", " + THREE.Math.radToDeg(e.z).toPrecision(i) + ' "' + e.order + '")'
  28903. },
  28904. time: function(e) {
  28905. n.level >= n.levels.debug && (c[e] = Date.now())
  28906. },
  28907. timeEnd: function(e) {
  28908. if (n.level >= n.levels.debug) {
  28909. var t = c[e];
  28910. if (!t)
  28911. return;
  28912. var i = (Date.now() - t) / 1e3;
  28913. this.debug(e, i + "s")
  28914. }
  28915. }
  28916. }
  28917. }
  28918. var r = window.Raven;
  28919. n.timestamp = function() {
  28920. return (Date.now() - window.navigationStart) / 1e3 + "s"
  28921. }
  28922. ,
  28923. n.levels = {
  28924. debug: 3,
  28925. info: 2,
  28926. warn: 1,
  28927. error: 0
  28928. },
  28929. n.level = n.levels.info,
  28930. t.exports = n
  28931. }
  28932. , {}],
  28933. 190: [function(e, t, i) {
  28934. "use strict";
  28935. var n = e("three")
  28936. , r = e("../enum/GLCubeFaces")
  28937. , o = e("../constants");
  28938. t.exports = {
  28939. convertVisionVector: function(e) {
  28940. return new n.Vector3(e.x,e.z,-e.y)
  28941. },
  28942. convertVisionQuaternion: function(e) {
  28943. 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)))
  28944. },
  28945. convertWorkshopVector: function(e) {
  28946. return new n.Vector3(-e.x,e.y,e.z)
  28947. },
  28948. convertWorkshopQuaternion: function(e) {
  28949. 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))
  28950. },
  28951. convertWorkshopPanoramaQuaternion: function(e) {
  28952. 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)))
  28953. },
  28954. convertWorkshopOrthoZoom: function(e) {// xzw
  28955. //return e === -1 ? -1 : e / 16 * ($("#player").width() / $("#player").height()) / o.workshopApsect
  28956. //return e;
  28957. return e === -1 ? -1 : e * ($("#player").width() / $("#player").height()) / g_snapShotWidth * g_snapShotHeight;
  28958. },
  28959. toPrecision: function(e, t) {//xzw change
  28960. var f = function(e, t){
  28961. var i = Math.pow(10, t);
  28962. return Math.round(e * i) / i
  28963. }
  28964. if(e instanceof Array){
  28965. for(var s=0; s<e.length; s++){
  28966. e[s] = f(e[s],t);
  28967. }
  28968. return e;
  28969. }
  28970. else return f(e,t)
  28971. },
  28972. isEmptyQuaternion: function(e) {
  28973. return 0 === Math.abs(e.x) && 0 === Math.abs(e.y) && 0 === Math.abs(e.z) && 0 === Math.abs(e.w)
  28974. },
  28975. projectPositionToCanvas: function(e, t, i) {
  28976. i = i || new n.Vector3,
  28977. i.copy(e);
  28978. var r = .5 * $("#player").width()
  28979. , o = .5 * $("#player").height();
  28980. return i.project(t),
  28981. i.x = i.x * r + r,
  28982. i.y = -(i.y * o) + o,
  28983. i
  28984. },
  28985. convertScreenPositionToNDC: function(e, t, i) {
  28986. return i = i || new n.Vector2,
  28987. i.x = e / $("#player").width() * 2 - 1,
  28988. i.y = 2 * -(t / $("#player").height()) + 1,
  28989. i
  28990. },
  28991. constrainedTurn: function(e) {
  28992. var t = e % (2 * Math.PI);
  28993. return t = t > Math.PI ? t -= 2 * Math.PI : t < -Math.PI ? t += 2 * Math.PI : t
  28994. },
  28995. getFOVDotThreshold: function(e) {
  28996. return Math.cos(n.Math.degToRad(e / 2))
  28997. },
  28998. transform2DForwardVectorByCubeFace: function(e, t, i, n) {
  28999. switch (e) {
  29000. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  29001. i.set(1, t.y, t.x);
  29002. break;
  29003. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  29004. i.set(-1, t.y, -t.x);
  29005. break;
  29006. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  29007. i.set(-t.x, 1, -t.y);
  29008. break;
  29009. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  29010. i.set(-t.x, -1, t.y);
  29011. break;
  29012. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  29013. i.set(-t.x, t.y, 1);
  29014. break;
  29015. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  29016. i.set(t.x, t.y, -1)
  29017. }
  29018. n && i.normalize()
  29019. }
  29020. }
  29021. }
  29022. , {
  29023. "../constants": 8,
  29024. "../enum/GLCubeFaces": 25,
  29025. three: 217
  29026. }],
  29027. 191: [function(e, t, i) {
  29028. "use strict";
  29029. function n(e, t, i) {
  29030. return a.map(function(n, o) {
  29031. return e.get("pan/" + i + "/" + t + "_skybox" + r(n) + ".jpg")
  29032. }
  29033. .bind(this))
  29034. }
  29035. function r(e) {
  29036. return s[e]
  29037. }
  29038. var o = e("../enum/GLCubeFaces")
  29039. , a = [0, 1, 2, 3, 4, 5]
  29040. , s = {
  29041. 0: o.GL_TEXTURE_CUBE_MAP_POSITIVE_Y,
  29042. 1: o.GL_TEXTURE_CUBE_MAP_POSITIVE_Z,
  29043. 2: o.GL_TEXTURE_CUBE_MAP_POSITIVE_X,
  29044. 3: o.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,
  29045. 4: o.GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
  29046. 5: o.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
  29047. };
  29048. t.exports = {
  29049. mapFaceToCubemapFace: r,
  29050. getCubemapUrls: n
  29051. }
  29052. }
  29053. , {
  29054. "../enum/GLCubeFaces": 25
  29055. }],
  29056. 192: [function(e, t, i) {
  29057. "use strict";
  29058. t.exports = {
  29059. captureErrors: function(e, t, i) {
  29060. if ("Raven"in window) {
  29061. Raven.config(e, t).install(),
  29062. i && Raven.setTagsContext(i);
  29063. var n = console.warn
  29064. , r = console.error;
  29065. console.warn = function() {
  29066. var e = Array.prototype.slice.call(arguments);
  29067. Raven.captureMessage(e.join(" "), {
  29068. level: "warning"
  29069. }),
  29070. n.apply(console, e)
  29071. }
  29072. ,
  29073. console.error = function() {
  29074. var e = Array.prototype.slice.call(arguments);
  29075. Raven.captureException(new Error(e.join(" ")), {
  29076. level: "error"
  29077. }),
  29078. r.apply(console, e)
  29079. }
  29080. } else
  29081. console.error("Raven not found, not capturing errors.")
  29082. }
  29083. }
  29084. }
  29085. , {}],
  29086. 193: [function(e, t, i) {
  29087. (function(i) {
  29088. "use strict";
  29089. var n = e("./browser")
  29090. , r = e("../constants")
  29091. , o = e("url")
  29092. , a = e("./logger")
  29093. , ss = e('three')
  29094. , s = new a(i)
  29095. , l = {
  29096. getAuthorizationHeader: function() {
  29097. var e = n.valueFromHash("auth");
  29098. if (e)
  29099. return e.replace(",", " ");
  29100. var t = n.valueFromCookie("token");
  29101. return t ? "Token " + t : null
  29102. },
  29103. parseSidUrl: function(e) {
  29104. var t, i;
  29105. t=g_Prefix;
  29106. if (e = e || "",
  29107. e.match(/^https?/)) {
  29108. var n = o.parse(e);
  29109. t = g_Prefix,
  29110. i = e
  29111. } else{
  29112. //xzw 原先的不能用
  29113. //t = window.location.protocol + "//" + window.location.host, //MP
  29114. t = g_Prefix
  29115. //i = t + "/api/player/models/" + e; //MP
  29116. i = t + "data/" + e;
  29117. }
  29118. return {
  29119. urlBase: t,
  29120. urlModel: i,
  29121. urlFiles: i + (i.match(/\/$/) ? "files" : "/files"),
  29122. urlThumb: i + (i.match(/\/$/) ? "thumb" : "/thumb")
  29123. }
  29124. },
  29125. getModelIDFromQueryString: function() {
  29126. return n.valueFromHash("model") || n.valueFromHash("m")
  29127. },
  29128. normalizeModeldata: function(e, t) {//xzw 修改导览images数据
  29129. e = JSON.parse(JSON.stringify(e));
  29130. var i = null;
  29131. if (e.images.forEach(function(n) {
  29132. if(!n.metadata) return;
  29133. if ("string" == typeof n.metadata)
  29134. try {
  29135. n.metadata = JSON.parse(n.metadata)
  29136. } catch (e) {
  29137. s.warn("Unable to parse image metadata"),
  29138. n.metadata = null
  29139. }
  29140. else{
  29141. "object" == typeof n.metadata && s.debug("image.metadata already a JSON object");
  29142. }
  29143. if(n.metadata.camera_position instanceof Array){//xzw 改的格式
  29144. n.metadata.camera_position = new ss.Vector3().fromArray(n.metadata.camera_position);
  29145. n.metadata.camera_quaternion = new ss.Quaternion().fromArray(n.metadata.camera_quaternion);
  29146. }else{
  29147. n.metadata.camera_quaternion && (n.metadata.camera_quaternion = t.convertWorkshopQuaternion(n.metadata.camera_quaternion)),
  29148. n.metadata.camera_position && (n.metadata.camera_position = t.convertWorkshopVector(n.metadata.camera_position))
  29149. }
  29150. !i && e.icon && e.icon === n.sid && (i = n.metadata)
  29151. }),
  29152. //icon初始视角的:
  29153. i && i.camera_quaternion && i.camera_position && i.scan_position && i.scan_quaternion) {
  29154. var n = {};
  29155. n.pano = {
  29156. quaternion: t.convertWorkshopPanoramaQuaternion(i.scan_quaternion),
  29157. position: t.convertWorkshopVector(i.scan_position),
  29158. uuid: i.scan_id
  29159. },
  29160. n.camera = {
  29161. quaternion: i.camera_quaternion,
  29162. position: i.camera_position
  29163. },
  29164. e.startPano = n
  29165. }
  29166. return e
  29167. },
  29168. visionVersionToInt: function() {
  29169. var e = new RegExp(["(?:[0-9.]+\\.){1,4}", "([0-9]+)", "[^\\.]*$"].join(""));
  29170. return function(t) {
  29171. if (!t)
  29172. throw new Error("Vision version is required");
  29173. var i = e.exec(t);
  29174. if (null === i)
  29175. throw new Error("String is not a vision version: " + t);
  29176. return parseInt(i[1])
  29177. }
  29178. }(),
  29179. modelDataPromisesTiles: function(e) {
  29180. var vision_version = e.vision_version || window.MP_PREFETCHED_MODELDATA.vision_version
  29181. if (vision_version)
  29182. try {
  29183. return l.visionVersionToInt(vision_version) >= l.visionVersionToInt(r.visionTilingStartVersion)
  29184. } catch (t) {
  29185. s.warn("Invalid vision version: " + vision_version)
  29186. }
  29187. // var t = e.created ? new Date(e.created) : null;
  29188. // return t && t >= r.visionTilingStartDate
  29189. return false
  29190. }
  29191. };
  29192. t.exports = l
  29193. }
  29194. ).call(this, "/js/util/showcase.js")
  29195. }
  29196. , {
  29197. "../constants": 8,
  29198. "./browser": 182,
  29199. "./logger": 189,
  29200. three:217,
  29201. url: 208
  29202. }],
  29203. 194: [function(e, t, i) {
  29204. "use strict";
  29205. var n = e("../util/ajax")
  29206. , r = e("three")
  29207. , o = e("../settings")
  29208. , a = {};
  29209. t.exports = {
  29210. load: function(e, t, i) {
  29211. var s = a[e];
  29212. return s ? (t && setTimeout(function() {
  29213. t(s)
  29214. }, 1),
  29215. s) : (s = new r.Texture,
  29216. o.minimalMemoryMode && (s.minFilter = r.LinearFilter,
  29217. s.magFilter = r.LinearFilter,
  29218. s.generateMipmaps = !1),
  29219. s.sourceFile = e,
  29220. a[e] = s,
  29221. n.getImage(e).then(function(e) {
  29222. s.image = e,
  29223. s.needsUpdate = !0,
  29224. t && t(s)
  29225. }).fail(i),
  29226. s)
  29227. },
  29228. loadBase64: function(e, t) {
  29229. t = t || "png";
  29230. var i = new r.Texture;
  29231. return i.image = document.createElement("img"),
  29232. i.image.setAttribute("src", "data:image/" + t + ";base64," + e),
  29233. o.minimalMemoryMode && (i.minFilter = r.LinearFilter,
  29234. i.magFilter = r.LinearFilter,
  29235. i.generateMipmaps = !1),
  29236. i.needsUpdate = !0,
  29237. i
  29238. },
  29239. isLoaded: function(e) {
  29240. return !!a[e]
  29241. }
  29242. }
  29243. }
  29244. , {
  29245. "../settings": 166,
  29246. "../util/ajax": 181,
  29247. three: 217
  29248. }],
  29249. 195: [function(e, t, i) {
  29250. "use strict";
  29251. var n = e("./easing");
  29252. t.exports = {
  29253. globalDone: null,
  29254. funcs: [],
  29255. counter: 0,
  29256. uniqueID: 0,
  29257. start: function(e, t, i, r, o, a, s) {
  29258. return r = r || 0,
  29259. this.funcs.push({
  29260. func: e,
  29261. current: -r * Math.abs(t),
  29262. duration: (1 - Math.max(r, 0)) * Math.abs(t),
  29263. done: i,
  29264. easing: o || n.linearTween,
  29265. cycling: t < 0,
  29266. running: !0,
  29267. debug: r < 0,
  29268. name: a || "T" + this.counter,
  29269. id: void 0 === s ? this.counter : s,
  29270. paused: !1
  29271. }),
  29272. e(0, 16),
  29273. this.counter += 1,
  29274. e
  29275. },
  29276. trigger: function(e) {
  29277. var t = void 0 === e.delayRatio ? 0 : e.delayRatio
  29278. , i = e.func || function() {}
  29279. , r = void 0 === e.duration ? 0 : e.duration;
  29280. void 0 !== e.cycling && e.cycling && (r = -Math.abs(r));
  29281. var o = e.done || null
  29282. , a = e.easing || n.linearTween
  29283. , s = e.name || "R" + this.counter
  29284. , l = void 0 === e.id ? this.counter : e.id;
  29285. return this.start(i, r, o, t, a, s, l)
  29286. },
  29287. setTimeout: function(e, t, i) {
  29288. var n = void 0 === i ? this.counter : i;
  29289. return this.trigger({
  29290. done: e,
  29291. duration: void 0 === t ? 0 : t,
  29292. name: "O" + this.counter,
  29293. id: n
  29294. })
  29295. },
  29296. pause: function() {
  29297. this.paused = !0
  29298. },
  29299. resume: function() {
  29300. this.paused = !1
  29301. },
  29302. update: function(e) {
  29303. this.funcs.forEach(function(t) {
  29304. if (!(t.paused || (t.current += 1e3 * e,
  29305. t.current < 0)))
  29306. if (t.current >= t.duration && !t.cycling) {
  29307. var i = t.easing(1, 0, 1, 1);
  29308. t.func(i, 1e3 * e),
  29309. t.done && t.done(),
  29310. t.running = !1
  29311. } else {
  29312. var n = t.easing(t.current % t.duration / t.duration, 0, 1, 1)
  29313. , r = t.func(n, 1e3 * e) || !1;
  29314. r && (t.done && t.done(),
  29315. t.running = !1)
  29316. }
  29317. });
  29318. var t = this.funcs.length;
  29319. this.funcs = this.funcs.filter(function(e) {
  29320. return e.running
  29321. });
  29322. var i = this.funcs.length;
  29323. if (t > 0 && 0 === i && this.globalDone) {
  29324. var n = this.globalDone;
  29325. this.globalDone = null,
  29326. n()
  29327. }
  29328. },
  29329. adjustSpeed: function(e, t) {
  29330. for (var i = this.getById(e), n = 0; n < i.length; n++) {
  29331. var r = i[n];
  29332. r.duration /= t,
  29333. r.current /= t
  29334. }
  29335. },
  29336. getById: function(e) {
  29337. return this.funcs.filter(function(t) {
  29338. return e === t.id
  29339. })
  29340. },
  29341. get: function(e) {
  29342. for (var t = 0; t < this.funcs.length; t += 1)
  29343. if (this.funcs[t].func === e)
  29344. return this.funcs[t];
  29345. return null
  29346. },
  29347. isRunning: function(e) {
  29348. var t = this.get(e);
  29349. return null !== t && t.running
  29350. },
  29351. countActive: function() {
  29352. for (var e = 0, t = 0; t < this.funcs.length; t += 1)
  29353. e += this.funcs[t].running;
  29354. return e
  29355. },
  29356. listActive: function() {
  29357. for (var e = [], t = 0; t < this.funcs.length; t += 1)
  29358. this.funcs[t].running && e.push(this.funcs[t].name);
  29359. return e
  29360. },
  29361. done: function(e) {
  29362. this.globalDone = e
  29363. },
  29364. cancelById: function(e) {
  29365. var t = void 0 === e ? 0 : e;
  29366. this.funcs = this.funcs.filter(function(e) {
  29367. return e.id !== t
  29368. })
  29369. },
  29370. cancel: function(e) {
  29371. this.funcs = this.funcs.filter(function(t) {
  29372. return t.func !== e
  29373. })
  29374. },
  29375. getUniqueId: function() {
  29376. return this.uniqueID -= 1,
  29377. this.uniqueID
  29378. }
  29379. }
  29380. }
  29381. , {
  29382. "./easing": 186
  29383. }],
  29384. 196: [function(e, t, i) {
  29385. function n(e) {
  29386. if (this.set = {},
  29387. this.infContains = function() {
  29388. return !0
  29389. }
  29390. ,
  29391. "object" == typeof e)
  29392. if (e instanceof Array)
  29393. for (var t = 0; t < e.length; t++)
  29394. this.set[e[t]] = !0;
  29395. else
  29396. this.set = e;
  29397. else if ("function" == typeof e)
  29398. this.infContains = e;
  29399. else if ("undefined" != typeof e)
  29400. throw new Error("set must be either an array or an object.")
  29401. }
  29402. t.exports = n,
  29403. n.prototype.contains = function(e) {
  29404. return !!this.set[e]
  29405. }
  29406. ,
  29407. n.prototype.has = n.prototype.contains,
  29408. n.prototype.add = function(e) {
  29409. if (1 == arguments.length)
  29410. this.set[e] = !0;
  29411. else
  29412. for (var t = 0; t < arguments.length; t++)
  29413. this.set[arguments[t]] = !0
  29414. }
  29415. ,
  29416. n.prototype.addAll = function(e) {
  29417. if ("object" != typeof e && !(e instanceof Array))
  29418. throw new Error("arr must be an array.");
  29419. for (var t = 0; t < e.length; t++)
  29420. this.add(e[t])
  29421. }
  29422. ,
  29423. n.prototype.remove = function(e) {
  29424. if (1 == arguments.length)
  29425. delete this.set[e];
  29426. else
  29427. for (var t = 0; t < arguments.length; t++)
  29428. delete this.set[arguments[t]]
  29429. }
  29430. ,
  29431. n.prototype.delete = n.prototype.remove,
  29432. n.prototype.clear = function() {
  29433. this.set = {}
  29434. }
  29435. ,
  29436. n.prototype.size = function() {
  29437. return Object.keys(this.set).length
  29438. }
  29439. ,
  29440. n.prototype.toString = function() {
  29441. return "{" + Object.keys(this.set).toString() + "}"
  29442. }
  29443. ,
  29444. n.prototype.toArray = function() {
  29445. return "undefined" == typeof this.set ? [] : Object.keys(this.set)
  29446. }
  29447. ,
  29448. n.prototype["*values"] = n.prototype.toArray
  29449. }
  29450. , {}],
  29451. 197: [function(e, t, i) {}
  29452. , {}],
  29453. 198: [function(e, t, i) {
  29454. (function(t) {
  29455. "use strict";
  29456. function n() {
  29457. try {
  29458. var e = new Uint8Array(1);
  29459. return e.__proto__ = {
  29460. __proto__: Uint8Array.prototype,
  29461. foo: function() {
  29462. return 42
  29463. }
  29464. },
  29465. 42 === e.foo() && "function" == typeof e.subarray && 0 === e.subarray(1, 1).byteLength
  29466. } catch (e) {
  29467. return !1
  29468. }
  29469. }
  29470. function r() {
  29471. return a.TYPED_ARRAY_SUPPORT ? 2147483647 : 1073741823
  29472. }
  29473. function o(e, t) {
  29474. if (r() < t)
  29475. throw new RangeError("Invalid typed array length");
  29476. return a.TYPED_ARRAY_SUPPORT ? (e = new Uint8Array(t),
  29477. e.__proto__ = a.prototype) : (null === e && (e = new a(t)),
  29478. e.length = t),
  29479. e
  29480. }
  29481. function a(e, t, i) {
  29482. if (!(a.TYPED_ARRAY_SUPPORT || this instanceof a))
  29483. return new a(e,t,i);
  29484. if ("number" == typeof e) {
  29485. if ("string" == typeof t)
  29486. throw new Error("If encoding is specified then the first argument must be a string");
  29487. return h(this, e)
  29488. }
  29489. return s(this, e, t, i)
  29490. }
  29491. function s(e, t, i, n) {
  29492. if ("number" == typeof t)
  29493. throw new TypeError('"value" argument must not be a number');
  29494. return "undefined" != typeof ArrayBuffer && t instanceof ArrayBuffer ? p(e, t, i, n) : "string" == typeof t ? u(e, t, i) : f(e, t)
  29495. }
  29496. function l(e) {
  29497. if ("number" != typeof e)
  29498. throw new TypeError('"size" argument must be a number');
  29499. if (e < 0)
  29500. throw new RangeError('"size" argument must not be negative')
  29501. }
  29502. function c(e, t, i, n) {
  29503. return l(t),
  29504. 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)
  29505. }
  29506. function h(e, t) {
  29507. if (l(t),
  29508. e = o(e, t < 0 ? 0 : 0 | g(t)),
  29509. !a.TYPED_ARRAY_SUPPORT)
  29510. for (var i = 0; i < t; ++i)
  29511. e[i] = 0;
  29512. return e
  29513. }
  29514. function u(e, t, i) {
  29515. if ("string" == typeof i && "" !== i || (i = "utf8"),
  29516. !a.isEncoding(i))
  29517. throw new TypeError('"encoding" must be a valid string encoding');
  29518. var n = 0 | v(t, i);
  29519. e = o(e, n);
  29520. var r = e.write(t, i);
  29521. return r !== n && (e = e.slice(0, r)),
  29522. e
  29523. }
  29524. function d(e, t) {
  29525. var i = t.length < 0 ? 0 : 0 | g(t.length);
  29526. e = o(e, i);
  29527. for (var n = 0; n < i; n += 1)
  29528. e[n] = 255 & t[n];
  29529. return e
  29530. }
  29531. function p(e, t, i, n) {
  29532. if (t.byteLength,
  29533. i < 0 || t.byteLength < i)
  29534. throw new RangeError("'offset' is out of bounds");
  29535. if (t.byteLength < i + (n || 0))
  29536. throw new RangeError("'length' is out of bounds");
  29537. return t = void 0 === i && void 0 === n ? new Uint8Array(t) : void 0 === n ? new Uint8Array(t,i) : new Uint8Array(t,i,n),
  29538. a.TYPED_ARRAY_SUPPORT ? (e = t,
  29539. e.__proto__ = a.prototype) : e = d(e, t),
  29540. e
  29541. }
  29542. function f(e, t) {
  29543. if (a.isBuffer(t)) {
  29544. var i = 0 | g(t.length);
  29545. return e = o(e, i),
  29546. 0 === e.length ? e : (t.copy(e, 0, 0, i),
  29547. e)
  29548. }
  29549. if (t) {
  29550. if ("undefined" != typeof ArrayBuffer && t.buffer instanceof ArrayBuffer || "length"in t)
  29551. return "number" != typeof t.length || K(t.length) ? o(e, 0) : d(e, t);
  29552. if ("Buffer" === t.type && $(t.data))
  29553. return d(e, t.data)
  29554. }
  29555. throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")
  29556. }
  29557. function g(e) {
  29558. if (e >= r())
  29559. throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + r().toString(16) + " bytes");
  29560. return 0 | e
  29561. }
  29562. function m(e) {
  29563. return +e != e && (e = 0),
  29564. a.alloc(+e)
  29565. }
  29566. function v(e, t) {
  29567. if (a.isBuffer(e))
  29568. return e.length;
  29569. if ("undefined" != typeof ArrayBuffer && "function" == typeof ArrayBuffer.isView && (ArrayBuffer.isView(e) || e instanceof ArrayBuffer))
  29570. return e.byteLength;
  29571. "string" != typeof e && (e = "" + e);
  29572. var i = e.length;
  29573. if (0 === i)
  29574. return 0;
  29575. for (var n = !1; ; )
  29576. switch (t) {
  29577. case "ascii":
  29578. case "latin1":
  29579. case "binary":
  29580. return i;
  29581. case "utf8":
  29582. case "utf-8":
  29583. case void 0:
  29584. return j(e).length;
  29585. case "ucs2":
  29586. case "ucs-2":
  29587. case "utf16le":
  29588. case "utf-16le":
  29589. return 2 * i;
  29590. case "hex":
  29591. return i >>> 1;
  29592. case "base64":
  29593. return Z(e).length;
  29594. default:
  29595. if (n)
  29596. return j(e).length;
  29597. t = ("" + t).toLowerCase(),
  29598. n = !0
  29599. }
  29600. }
  29601. function A(e, t, i) {
  29602. var n = !1;
  29603. if ((void 0 === t || t < 0) && (t = 0),
  29604. t > this.length)
  29605. return "";
  29606. if ((void 0 === i || i > this.length) && (i = this.length),
  29607. i <= 0)
  29608. return "";
  29609. if (i >>>= 0,
  29610. t >>>= 0,
  29611. i <= t)
  29612. return "";
  29613. for (e || (e = "utf8"); ; )
  29614. switch (e) {
  29615. case "hex":
  29616. return L(this, t, i);
  29617. case "utf8":
  29618. case "utf-8":
  29619. return M(this, t, i);
  29620. case "ascii":
  29621. return P(this, t, i);
  29622. case "latin1":
  29623. case "binary":
  29624. return O(this, t, i);
  29625. case "base64":
  29626. return S(this, t, i);
  29627. case "ucs2":
  29628. case "ucs-2":
  29629. case "utf16le":
  29630. case "utf-16le":
  29631. return D(this, t, i);
  29632. default:
  29633. if (n)
  29634. throw new TypeError("Unknown encoding: " + e);
  29635. e = (e + "").toLowerCase(),
  29636. n = !0
  29637. }
  29638. }
  29639. function y(e, t, i) {
  29640. var n = e[t];
  29641. e[t] = e[i],
  29642. e[i] = n
  29643. }
  29644. function C(e, t, i, n, r) {
  29645. if (0 === e.length)
  29646. return -1;
  29647. if ("string" == typeof i ? (n = i,
  29648. i = 0) : i > 2147483647 ? i = 2147483647 : i < -2147483648 && (i = -2147483648),
  29649. i = +i,
  29650. isNaN(i) && (i = r ? 0 : e.length - 1),
  29651. i < 0 && (i = e.length + i),
  29652. i >= e.length) {
  29653. if (r)
  29654. return -1;
  29655. i = e.length - 1
  29656. } else if (i < 0) {
  29657. if (!r)
  29658. return -1;
  29659. i = 0
  29660. }
  29661. if ("string" == typeof t && (t = a.from(t, n)),
  29662. a.isBuffer(t))
  29663. return 0 === t.length ? -1 : I(e, t, i, n, r);
  29664. if ("number" == typeof t)
  29665. return t &= 255,
  29666. 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);
  29667. throw new TypeError("val must be string, number or Buffer")
  29668. }
  29669. function I(e, t, i, n, r) {
  29670. function o(e, t) {
  29671. return 1 === a ? e[t] : e.readUInt16BE(t * a)
  29672. }
  29673. var a = 1
  29674. , s = e.length
  29675. , l = t.length;
  29676. if (void 0 !== n && (n = String(n).toLowerCase(),
  29677. "ucs2" === n || "ucs-2" === n || "utf16le" === n || "utf-16le" === n)) {
  29678. if (e.length < 2 || t.length < 2)
  29679. return -1;
  29680. a = 2,
  29681. s /= 2,
  29682. l /= 2,
  29683. i /= 2
  29684. }
  29685. var c;
  29686. if (r) {
  29687. var h = -1;
  29688. for (c = i; c < s; c++)
  29689. if (o(e, c) === o(t, h === -1 ? 0 : c - h)) {
  29690. if (h === -1 && (h = c),
  29691. c - h + 1 === l)
  29692. return h * a
  29693. } else
  29694. h !== -1 && (c -= c - h),
  29695. h = -1
  29696. } else
  29697. for (i + l > s && (i = s - l),
  29698. c = i; c >= 0; c--) {
  29699. for (var u = !0, d = 0; d < l; d++)
  29700. if (o(e, c + d) !== o(t, d)) {
  29701. u = !1;
  29702. break
  29703. }
  29704. if (u)
  29705. return c
  29706. }
  29707. return -1
  29708. }
  29709. function E(e, t, i, n) {
  29710. i = Number(i) || 0;
  29711. var r = e.length - i;
  29712. n ? (n = Number(n),
  29713. n > r && (n = r)) : n = r;
  29714. var o = t.length;
  29715. if (o % 2 !== 0)
  29716. throw new TypeError("Invalid hex string");
  29717. n > o / 2 && (n = o / 2);
  29718. for (var a = 0; a < n; ++a) {
  29719. var s = parseInt(t.substr(2 * a, 2), 16);
  29720. if (isNaN(s))
  29721. return a;
  29722. e[i + a] = s
  29723. }
  29724. return a
  29725. }
  29726. function b(e, t, i, n) {
  29727. return q(j(t, e.length - i), e, i, n)
  29728. }
  29729. function w(e, t, i, n) {
  29730. return q(Y(t), e, i, n)
  29731. }
  29732. function _(e, t, i, n) {
  29733. return w(e, t, i, n)
  29734. }
  29735. function T(e, t, i, n) {
  29736. return q(Z(t), e, i, n)
  29737. }
  29738. function x(e, t, i, n) {
  29739. return q(X(t, e.length - i), e, i, n)
  29740. }
  29741. function S(e, t, i) {
  29742. return 0 === t && i === e.length ? Q.fromByteArray(e) : Q.fromByteArray(e.slice(t, i))
  29743. }
  29744. function M(e, t, i) {
  29745. i = Math.min(e.length, i);
  29746. for (var n = [], r = t; r < i; ) {
  29747. var o = e[r]
  29748. , a = null
  29749. , s = o > 239 ? 4 : o > 223 ? 3 : o > 191 ? 2 : 1;
  29750. if (r + s <= i) {
  29751. var l, c, h, u;
  29752. switch (s) {
  29753. case 1:
  29754. o < 128 && (a = o);
  29755. break;
  29756. case 2:
  29757. l = e[r + 1],
  29758. 128 === (192 & l) && (u = (31 & o) << 6 | 63 & l,
  29759. u > 127 && (a = u));
  29760. break;
  29761. case 3:
  29762. l = e[r + 1],
  29763. c = e[r + 2],
  29764. 128 === (192 & l) && 128 === (192 & c) && (u = (15 & o) << 12 | (63 & l) << 6 | 63 & c,
  29765. u > 2047 && (u < 55296 || u > 57343) && (a = u));
  29766. break;
  29767. case 4:
  29768. l = e[r + 1],
  29769. c = e[r + 2],
  29770. h = e[r + 3],
  29771. 128 === (192 & l) && 128 === (192 & c) && 128 === (192 & h) && (u = (15 & o) << 18 | (63 & l) << 12 | (63 & c) << 6 | 63 & h,
  29772. u > 65535 && u < 1114112 && (a = u))
  29773. }
  29774. }
  29775. null === a ? (a = 65533,
  29776. s = 1) : a > 65535 && (a -= 65536,
  29777. n.push(a >>> 10 & 1023 | 55296),
  29778. a = 56320 | 1023 & a),
  29779. n.push(a),
  29780. r += s
  29781. }
  29782. return R(n)
  29783. }
  29784. function R(e) {
  29785. var t = e.length;
  29786. if (t <= ee)
  29787. return String.fromCharCode.apply(String, e);
  29788. for (var i = "", n = 0; n < t; )
  29789. i += String.fromCharCode.apply(String, e.slice(n, n += ee));
  29790. return i
  29791. }
  29792. function P(e, t, i) {
  29793. var n = "";
  29794. i = Math.min(e.length, i);
  29795. for (var r = t; r < i; ++r)
  29796. n += String.fromCharCode(127 & e[r]);
  29797. return n
  29798. }
  29799. function O(e, t, i) {
  29800. var n = "";
  29801. i = Math.min(e.length, i);
  29802. for (var r = t; r < i; ++r)
  29803. n += String.fromCharCode(e[r]);
  29804. return n
  29805. }
  29806. function L(e, t, i) {
  29807. var n = e.length;
  29808. (!t || t < 0) && (t = 0),
  29809. (!i || i < 0 || i > n) && (i = n);
  29810. for (var r = "", o = t; o < i; ++o)
  29811. r += W(e[o]);
  29812. return r
  29813. }
  29814. function D(e, t, i) {
  29815. for (var n = e.slice(t, i), r = "", o = 0; o < n.length; o += 2)
  29816. r += String.fromCharCode(n[o] + 256 * n[o + 1]);
  29817. return r
  29818. }
  29819. function N(e, t, i) {
  29820. if (e % 1 !== 0 || e < 0)
  29821. throw new RangeError("offset is not uint");
  29822. if (e + t > i)
  29823. throw new RangeError("Trying to access beyond buffer length")
  29824. }
  29825. function B(e, t, i, n, r, o) {
  29826. if (!a.isBuffer(e))
  29827. throw new TypeError('"buffer" argument must be a Buffer instance');
  29828. if (t > r || t < o)
  29829. throw new RangeError('"value" argument is out of bounds');
  29830. if (i + n > e.length)
  29831. throw new RangeError("Index out of range")
  29832. }
  29833. function F(e, t, i, n) {
  29834. t < 0 && (t = 65535 + t + 1);
  29835. for (var r = 0, o = Math.min(e.length - i, 2); r < o; ++r)
  29836. e[i + r] = (t & 255 << 8 * (n ? r : 1 - r)) >>> 8 * (n ? r : 1 - r)
  29837. }
  29838. function V(e, t, i, n) {
  29839. t < 0 && (t = 4294967295 + t + 1);
  29840. for (var r = 0, o = Math.min(e.length - i, 4); r < o; ++r)
  29841. e[i + r] = t >>> 8 * (n ? r : 3 - r) & 255
  29842. }
  29843. function U(e, t, i, n, r, o) {
  29844. if (i + n > e.length)
  29845. throw new RangeError("Index out of range");
  29846. if (i < 0)
  29847. throw new RangeError("Index out of range")
  29848. }
  29849. function k(e, t, i, n, r) {
  29850. return r || U(e, t, i, 4, 3.4028234663852886e38, -3.4028234663852886e38),
  29851. J.write(e, t, i, n, 23, 4),
  29852. i + 4
  29853. }
  29854. function H(e, t, i, n, r) {
  29855. return r || U(e, t, i, 8, 1.7976931348623157e308, -1.7976931348623157e308),
  29856. J.write(e, t, i, n, 52, 8),
  29857. i + 8
  29858. }
  29859. function G(e) {
  29860. if (e = z(e).replace(te, ""),
  29861. e.length < 2)
  29862. return "";
  29863. for (; e.length % 4 !== 0; )
  29864. e += "=";
  29865. return e
  29866. }
  29867. function z(e) {
  29868. return e.trim ? e.trim() : e.replace(/^\s+|\s+$/g, "")
  29869. }
  29870. function W(e) {
  29871. return e < 16 ? "0" + e.toString(16) : e.toString(16)
  29872. }
  29873. function j(e, t) {
  29874. t = t || 1 / 0;
  29875. for (var i, n = e.length, r = null, o = [], a = 0; a < n; ++a) {
  29876. if (i = e.charCodeAt(a),
  29877. i > 55295 && i < 57344) {
  29878. if (!r) {
  29879. if (i > 56319) {
  29880. (t -= 3) > -1 && o.push(239, 191, 189);
  29881. continue
  29882. }
  29883. if (a + 1 === n) {
  29884. (t -= 3) > -1 && o.push(239, 191, 189);
  29885. continue
  29886. }
  29887. r = i;
  29888. continue
  29889. }
  29890. if (i < 56320) {
  29891. (t -= 3) > -1 && o.push(239, 191, 189),
  29892. r = i;
  29893. continue
  29894. }
  29895. i = (r - 55296 << 10 | i - 56320) + 65536
  29896. } else
  29897. r && (t -= 3) > -1 && o.push(239, 191, 189);
  29898. if (r = null,
  29899. i < 128) {
  29900. if ((t -= 1) < 0)
  29901. break;
  29902. o.push(i)
  29903. } else if (i < 2048) {
  29904. if ((t -= 2) < 0)
  29905. break;
  29906. o.push(i >> 6 | 192, 63 & i | 128)
  29907. } else if (i < 65536) {
  29908. if ((t -= 3) < 0)
  29909. break;
  29910. o.push(i >> 12 | 224, i >> 6 & 63 | 128, 63 & i | 128)
  29911. } else {
  29912. if (!(i < 1114112))
  29913. throw new Error("Invalid code point");
  29914. if ((t -= 4) < 0)
  29915. break;
  29916. o.push(i >> 18 | 240, i >> 12 & 63 | 128, i >> 6 & 63 | 128, 63 & i | 128)
  29917. }
  29918. }
  29919. return o
  29920. }
  29921. function Y(e) {
  29922. for (var t = [], i = 0; i < e.length; ++i)
  29923. t.push(255 & e.charCodeAt(i));
  29924. return t
  29925. }
  29926. function X(e, t) {
  29927. for (var i, n, r, o = [], a = 0; a < e.length && !((t -= 2) < 0); ++a)
  29928. i = e.charCodeAt(a),
  29929. n = i >> 8,
  29930. r = i % 256,
  29931. o.push(r),
  29932. o.push(n);
  29933. return o
  29934. }
  29935. function Z(e) {
  29936. return Q.toByteArray(G(e))
  29937. }
  29938. function q(e, t, i, n) {
  29939. for (var r = 0; r < n && !(r + i >= t.length || r >= e.length); ++r)
  29940. t[r + i] = e[r];
  29941. return r
  29942. }
  29943. function K(e) {
  29944. return e !== e
  29945. }
  29946. var Q = e("base64-js")
  29947. , J = e("ieee754")
  29948. , $ = e("isarray");
  29949. i.Buffer = a,
  29950. i.SlowBuffer = m,
  29951. i.INSPECT_MAX_BYTES = 50,
  29952. a.TYPED_ARRAY_SUPPORT = void 0 !== t.TYPED_ARRAY_SUPPORT ? t.TYPED_ARRAY_SUPPORT : n(),
  29953. i.kMaxLength = r(),
  29954. a.poolSize = 8192,
  29955. a._augment = function(e) {
  29956. return e.__proto__ = a.prototype,
  29957. e
  29958. }
  29959. ,
  29960. a.from = function(e, t, i) {
  29961. return s(null, e, t, i)
  29962. }
  29963. ,
  29964. a.TYPED_ARRAY_SUPPORT && (a.prototype.__proto__ = Uint8Array.prototype,
  29965. a.__proto__ = Uint8Array,
  29966. "undefined" != typeof Symbol && Symbol.species && a[Symbol.species] === a && Object.defineProperty(a, Symbol.species, {
  29967. value: null,
  29968. configurable: !0
  29969. })),
  29970. a.alloc = function(e, t, i) {
  29971. return c(null, e, t, i)
  29972. }
  29973. ,
  29974. a.allocUnsafe = function(e) {
  29975. return h(null, e)
  29976. }
  29977. ,
  29978. a.allocUnsafeSlow = function(e) {
  29979. return h(null, e)
  29980. }
  29981. ,
  29982. a.isBuffer = function(e) {
  29983. return !(null == e || !e._isBuffer)
  29984. }
  29985. ,
  29986. a.compare = function(e, t) {
  29987. if (!a.isBuffer(e) || !a.isBuffer(t))
  29988. throw new TypeError("Arguments must be Buffers");
  29989. if (e === t)
  29990. return 0;
  29991. for (var i = e.length, n = t.length, r = 0, o = Math.min(i, n); r < o; ++r)
  29992. if (e[r] !== t[r]) {
  29993. i = e[r],
  29994. n = t[r];
  29995. break
  29996. }
  29997. return i < n ? -1 : n < i ? 1 : 0
  29998. }
  29999. ,
  30000. a.isEncoding = function(e) {
  30001. switch (String(e).toLowerCase()) {
  30002. case "hex":
  30003. case "utf8":
  30004. case "utf-8":
  30005. case "ascii":
  30006. case "latin1":
  30007. case "binary":
  30008. case "base64":
  30009. case "ucs2":
  30010. case "ucs-2":
  30011. case "utf16le":
  30012. case "utf-16le":
  30013. return !0;
  30014. default:
  30015. return !1
  30016. }
  30017. }
  30018. ,
  30019. a.concat = function(e, t) {
  30020. if (!$(e))
  30021. throw new TypeError('"list" argument must be an Array of Buffers');
  30022. if (0 === e.length)
  30023. return a.alloc(0);
  30024. var i;
  30025. if (void 0 === t)
  30026. for (t = 0,
  30027. i = 0; i < e.length; ++i)
  30028. t += e[i].length;
  30029. var n = a.allocUnsafe(t)
  30030. , r = 0;
  30031. for (i = 0; i < e.length; ++i) {
  30032. var o = e[i];
  30033. if (!a.isBuffer(o))
  30034. throw new TypeError('"list" argument must be an Array of Buffers');
  30035. o.copy(n, r),
  30036. r += o.length
  30037. }
  30038. return n
  30039. }
  30040. ,
  30041. a.byteLength = v,
  30042. a.prototype._isBuffer = !0,
  30043. a.prototype.swap16 = function() {
  30044. var e = this.length;
  30045. if (e % 2 !== 0)
  30046. throw new RangeError("Buffer size must be a multiple of 16-bits");
  30047. for (var t = 0; t < e; t += 2)
  30048. y(this, t, t + 1);
  30049. return this
  30050. }
  30051. ,
  30052. a.prototype.swap32 = function() {
  30053. var e = this.length;
  30054. if (e % 4 !== 0)
  30055. throw new RangeError("Buffer size must be a multiple of 32-bits");
  30056. for (var t = 0; t < e; t += 4)
  30057. y(this, t, t + 3),
  30058. y(this, t + 1, t + 2);
  30059. return this
  30060. }
  30061. ,
  30062. a.prototype.swap64 = function() {
  30063. var e = this.length;
  30064. if (e % 8 !== 0)
  30065. throw new RangeError("Buffer size must be a multiple of 64-bits");
  30066. for (var t = 0; t < e; t += 8)
  30067. y(this, t, t + 7),
  30068. y(this, t + 1, t + 6),
  30069. y(this, t + 2, t + 5),
  30070. y(this, t + 3, t + 4);
  30071. return this
  30072. }
  30073. ,
  30074. a.prototype.toString = function() {
  30075. var e = 0 | this.length;
  30076. return 0 === e ? "" : 0 === arguments.length ? M(this, 0, e) : A.apply(this, arguments)
  30077. }
  30078. ,
  30079. a.prototype.equals = function(e) {
  30080. if (!a.isBuffer(e))
  30081. throw new TypeError("Argument must be a Buffer");
  30082. return this === e || 0 === a.compare(this, e)
  30083. }
  30084. ,
  30085. a.prototype.inspect = function() {
  30086. var e = ""
  30087. , t = i.INSPECT_MAX_BYTES;
  30088. return this.length > 0 && (e = this.toString("hex", 0, t).match(/.{2}/g).join(" "),
  30089. this.length > t && (e += " ... ")),
  30090. "<Buffer " + e + ">"
  30091. }
  30092. ,
  30093. a.prototype.compare = function(e, t, i, n, r) {
  30094. if (!a.isBuffer(e))
  30095. throw new TypeError("Argument must be a Buffer");
  30096. if (void 0 === t && (t = 0),
  30097. void 0 === i && (i = e ? e.length : 0),
  30098. void 0 === n && (n = 0),
  30099. void 0 === r && (r = this.length),
  30100. t < 0 || i > e.length || n < 0 || r > this.length)
  30101. throw new RangeError("out of range index");
  30102. if (n >= r && t >= i)
  30103. return 0;
  30104. if (n >= r)
  30105. return -1;
  30106. if (t >= i)
  30107. return 1;
  30108. if (t >>>= 0,
  30109. i >>>= 0,
  30110. n >>>= 0,
  30111. r >>>= 0,
  30112. this === e)
  30113. return 0;
  30114. 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)
  30115. if (c[u] !== h[u]) {
  30116. o = c[u],
  30117. s = h[u];
  30118. break
  30119. }
  30120. return o < s ? -1 : s < o ? 1 : 0
  30121. }
  30122. ,
  30123. a.prototype.includes = function(e, t, i) {
  30124. return this.indexOf(e, t, i) !== -1
  30125. }
  30126. ,
  30127. a.prototype.indexOf = function(e, t, i) {
  30128. return C(this, e, t, i, !0)
  30129. }
  30130. ,
  30131. a.prototype.lastIndexOf = function(e, t, i) {
  30132. return C(this, e, t, i, !1)
  30133. }
  30134. ,
  30135. a.prototype.write = function(e, t, i, n) {
  30136. if (void 0 === t)
  30137. n = "utf8",
  30138. i = this.length,
  30139. t = 0;
  30140. else if (void 0 === i && "string" == typeof t)
  30141. n = t,
  30142. i = this.length,
  30143. t = 0;
  30144. else {
  30145. if (!isFinite(t))
  30146. throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");
  30147. t |= 0,
  30148. isFinite(i) ? (i |= 0,
  30149. void 0 === n && (n = "utf8")) : (n = i,
  30150. i = void 0)
  30151. }
  30152. var r = this.length - t;
  30153. if ((void 0 === i || i > r) && (i = r),
  30154. e.length > 0 && (i < 0 || t < 0) || t > this.length)
  30155. throw new RangeError("Attempt to write outside buffer bounds");
  30156. n || (n = "utf8");
  30157. for (var o = !1; ; )
  30158. switch (n) {
  30159. case "hex":
  30160. return E(this, e, t, i);
  30161. case "utf8":
  30162. case "utf-8":
  30163. return b(this, e, t, i);
  30164. case "ascii":
  30165. return w(this, e, t, i);
  30166. case "latin1":
  30167. case "binary":
  30168. return _(this, e, t, i);
  30169. case "base64":
  30170. return T(this, e, t, i);
  30171. case "ucs2":
  30172. case "ucs-2":
  30173. case "utf16le":
  30174. case "utf-16le":
  30175. return x(this, e, t, i);
  30176. default:
  30177. if (o)
  30178. throw new TypeError("Unknown encoding: " + n);
  30179. n = ("" + n).toLowerCase(),
  30180. o = !0
  30181. }
  30182. }
  30183. ,
  30184. a.prototype.toJSON = function() {
  30185. return {
  30186. type: "Buffer",
  30187. data: Array.prototype.slice.call(this._arr || this, 0)
  30188. }
  30189. }
  30190. ;
  30191. var ee = 4096;
  30192. a.prototype.slice = function(e, t) {
  30193. var i = this.length;
  30194. e = ~~e,
  30195. t = void 0 === t ? i : ~~t,
  30196. e < 0 ? (e += i,
  30197. e < 0 && (e = 0)) : e > i && (e = i),
  30198. t < 0 ? (t += i,
  30199. t < 0 && (t = 0)) : t > i && (t = i),
  30200. t < e && (t = e);
  30201. var n;
  30202. if (a.TYPED_ARRAY_SUPPORT)
  30203. n = this.subarray(e, t),
  30204. n.__proto__ = a.prototype;
  30205. else {
  30206. var r = t - e;
  30207. n = new a(r,void 0);
  30208. for (var o = 0; o < r; ++o)
  30209. n[o] = this[o + e]
  30210. }
  30211. return n
  30212. }
  30213. ,
  30214. a.prototype.readUIntLE = function(e, t, i) {
  30215. e |= 0,
  30216. t |= 0,
  30217. i || N(e, t, this.length);
  30218. for (var n = this[e], r = 1, o = 0; ++o < t && (r *= 256); )
  30219. n += this[e + o] * r;
  30220. return n
  30221. }
  30222. ,
  30223. a.prototype.readUIntBE = function(e, t, i) {
  30224. e |= 0,
  30225. t |= 0,
  30226. i || N(e, t, this.length);
  30227. for (var n = this[e + --t], r = 1; t > 0 && (r *= 256); )
  30228. n += this[e + --t] * r;
  30229. return n
  30230. }
  30231. ,
  30232. a.prototype.readUInt8 = function(e, t) {
  30233. return t || N(e, 1, this.length),
  30234. this[e]
  30235. }
  30236. ,
  30237. a.prototype.readUInt16LE = function(e, t) {
  30238. return t || N(e, 2, this.length),
  30239. this[e] | this[e + 1] << 8
  30240. }
  30241. ,
  30242. a.prototype.readUInt16BE = function(e, t) {
  30243. return t || N(e, 2, this.length),
  30244. this[e] << 8 | this[e + 1]
  30245. }
  30246. ,
  30247. a.prototype.readUInt32LE = function(e, t) {
  30248. return t || N(e, 4, this.length),
  30249. (this[e] | this[e + 1] << 8 | this[e + 2] << 16) + 16777216 * this[e + 3]
  30250. }
  30251. ,
  30252. a.prototype.readUInt32BE = function(e, t) {
  30253. return t || N(e, 4, this.length),
  30254. 16777216 * this[e] + (this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3])
  30255. }
  30256. ,
  30257. a.prototype.readIntLE = function(e, t, i) {
  30258. e |= 0,
  30259. t |= 0,
  30260. i || N(e, t, this.length);
  30261. for (var n = this[e], r = 1, o = 0; ++o < t && (r *= 256); )
  30262. n += this[e + o] * r;
  30263. return r *= 128,
  30264. n >= r && (n -= Math.pow(2, 8 * t)),
  30265. n
  30266. }
  30267. ,
  30268. a.prototype.readIntBE = function(e, t, i) {
  30269. e |= 0,
  30270. t |= 0,
  30271. i || N(e, t, this.length);
  30272. for (var n = t, r = 1, o = this[e + --n]; n > 0 && (r *= 256); )
  30273. o += this[e + --n] * r;
  30274. return r *= 128,
  30275. o >= r && (o -= Math.pow(2, 8 * t)),
  30276. o
  30277. }
  30278. ,
  30279. a.prototype.readInt8 = function(e, t) {
  30280. return t || N(e, 1, this.length),
  30281. 128 & this[e] ? (255 - this[e] + 1) * -1 : this[e]
  30282. }
  30283. ,
  30284. a.prototype.readInt16LE = function(e, t) {
  30285. t || N(e, 2, this.length);
  30286. var i = this[e] | this[e + 1] << 8;
  30287. return 32768 & i ? 4294901760 | i : i
  30288. }
  30289. ,
  30290. a.prototype.readInt16BE = function(e, t) {
  30291. t || N(e, 2, this.length);
  30292. var i = this[e + 1] | this[e] << 8;
  30293. return 32768 & i ? 4294901760 | i : i
  30294. }
  30295. ,
  30296. a.prototype.readInt32LE = function(e, t) {
  30297. return t || N(e, 4, this.length),
  30298. this[e] | this[e + 1] << 8 | this[e + 2] << 16 | this[e + 3] << 24
  30299. }
  30300. ,
  30301. a.prototype.readInt32BE = function(e, t) {
  30302. return t || N(e, 4, this.length),
  30303. this[e] << 24 | this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3]
  30304. }
  30305. ,
  30306. a.prototype.readFloatLE = function(e, t) {
  30307. return t || N(e, 4, this.length),
  30308. J.read(this, e, !0, 23, 4)
  30309. }
  30310. ,
  30311. a.prototype.readFloatBE = function(e, t) {
  30312. return t || N(e, 4, this.length),
  30313. J.read(this, e, !1, 23, 4)
  30314. }
  30315. ,
  30316. a.prototype.readDoubleLE = function(e, t) {
  30317. return t || N(e, 8, this.length),
  30318. J.read(this, e, !0, 52, 8)
  30319. }
  30320. ,
  30321. a.prototype.readDoubleBE = function(e, t) {
  30322. return t || N(e, 8, this.length),
  30323. J.read(this, e, !1, 52, 8)
  30324. }
  30325. ,
  30326. a.prototype.writeUIntLE = function(e, t, i, n) {
  30327. if (e = +e,
  30328. t |= 0,
  30329. i |= 0,
  30330. !n) {
  30331. var r = Math.pow(2, 8 * i) - 1;
  30332. B(this, e, t, i, r, 0)
  30333. }
  30334. var o = 1
  30335. , a = 0;
  30336. for (this[t] = 255 & e; ++a < i && (o *= 256); )
  30337. this[t + a] = e / o & 255;
  30338. return t + i
  30339. }
  30340. ,
  30341. a.prototype.writeUIntBE = function(e, t, i, n) {
  30342. if (e = +e,
  30343. t |= 0,
  30344. i |= 0,
  30345. !n) {
  30346. var r = Math.pow(2, 8 * i) - 1;
  30347. B(this, e, t, i, r, 0)
  30348. }
  30349. var o = i - 1
  30350. , a = 1;
  30351. for (this[t + o] = 255 & e; --o >= 0 && (a *= 256); )
  30352. this[t + o] = e / a & 255;
  30353. return t + i
  30354. }
  30355. ,
  30356. a.prototype.writeUInt8 = function(e, t, i) {
  30357. return e = +e,
  30358. t |= 0,
  30359. i || B(this, e, t, 1, 255, 0),
  30360. a.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)),
  30361. this[t] = 255 & e,
  30362. t + 1
  30363. }
  30364. ,
  30365. a.prototype.writeUInt16LE = function(e, t, i) {
  30366. return e = +e,
  30367. t |= 0,
  30368. i || B(this, e, t, 2, 65535, 0),
  30369. a.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e,
  30370. this[t + 1] = e >>> 8) : F(this, e, t, !0),
  30371. t + 2
  30372. }
  30373. ,
  30374. a.prototype.writeUInt16BE = function(e, t, i) {
  30375. return e = +e,
  30376. t |= 0,
  30377. i || B(this, e, t, 2, 65535, 0),
  30378. a.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 8,
  30379. this[t + 1] = 255 & e) : F(this, e, t, !1),
  30380. t + 2
  30381. }
  30382. ,
  30383. a.prototype.writeUInt32LE = function(e, t, i) {
  30384. return e = +e,
  30385. t |= 0,
  30386. i || B(this, e, t, 4, 4294967295, 0),
  30387. a.TYPED_ARRAY_SUPPORT ? (this[t + 3] = e >>> 24,
  30388. this[t + 2] = e >>> 16,
  30389. this[t + 1] = e >>> 8,
  30390. this[t] = 255 & e) : V(this, e, t, !0),
  30391. t + 4
  30392. }
  30393. ,
  30394. a.prototype.writeUInt32BE = function(e, t, i) {
  30395. return e = +e,
  30396. t |= 0,
  30397. i || B(this, e, t, 4, 4294967295, 0),
  30398. a.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 24,
  30399. this[t + 1] = e >>> 16,
  30400. this[t + 2] = e >>> 8,
  30401. this[t + 3] = 255 & e) : V(this, e, t, !1),
  30402. t + 4
  30403. }
  30404. ,
  30405. a.prototype.writeIntLE = function(e, t, i, n) {
  30406. if (e = +e,
  30407. t |= 0,
  30408. !n) {
  30409. var r = Math.pow(2, 8 * i - 1);
  30410. B(this, e, t, i, r - 1, -r)
  30411. }
  30412. var o = 0
  30413. , a = 1
  30414. , s = 0;
  30415. for (this[t] = 255 & e; ++o < i && (a *= 256); )
  30416. e < 0 && 0 === s && 0 !== this[t + o - 1] && (s = 1),
  30417. this[t + o] = (e / a >> 0) - s & 255;
  30418. return t + i
  30419. }
  30420. ,
  30421. a.prototype.writeIntBE = function(e, t, i, n) {
  30422. if (e = +e,
  30423. t |= 0,
  30424. !n) {
  30425. var r = Math.pow(2, 8 * i - 1);
  30426. B(this, e, t, i, r - 1, -r)
  30427. }
  30428. var o = i - 1
  30429. , a = 1
  30430. , s = 0;
  30431. for (this[t + o] = 255 & e; --o >= 0 && (a *= 256); )
  30432. e < 0 && 0 === s && 0 !== this[t + o + 1] && (s = 1),
  30433. this[t + o] = (e / a >> 0) - s & 255;
  30434. return t + i
  30435. }
  30436. ,
  30437. a.prototype.writeInt8 = function(e, t, i) {
  30438. return e = +e,
  30439. t |= 0,
  30440. i || B(this, e, t, 1, 127, -128),
  30441. a.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)),
  30442. e < 0 && (e = 255 + e + 1),
  30443. this[t] = 255 & e,
  30444. t + 1
  30445. }
  30446. ,
  30447. a.prototype.writeInt16LE = function(e, t, i) {
  30448. return e = +e,
  30449. t |= 0,
  30450. i || B(this, e, t, 2, 32767, -32768),
  30451. a.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e,
  30452. this[t + 1] = e >>> 8) : F(this, e, t, !0),
  30453. t + 2
  30454. }
  30455. ,
  30456. a.prototype.writeInt16BE = function(e, t, i) {
  30457. return e = +e,
  30458. t |= 0,
  30459. i || B(this, e, t, 2, 32767, -32768),
  30460. a.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 8,
  30461. this[t + 1] = 255 & e) : F(this, e, t, !1),
  30462. t + 2
  30463. }
  30464. ,
  30465. a.prototype.writeInt32LE = function(e, t, i) {
  30466. return e = +e,
  30467. t |= 0,
  30468. i || B(this, e, t, 4, 2147483647, -2147483648),
  30469. a.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e,
  30470. this[t + 1] = e >>> 8,
  30471. this[t + 2] = e >>> 16,
  30472. this[t + 3] = e >>> 24) : V(this, e, t, !0),
  30473. t + 4
  30474. }
  30475. ,
  30476. a.prototype.writeInt32BE = function(e, t, i) {
  30477. return e = +e,
  30478. t |= 0,
  30479. i || B(this, e, t, 4, 2147483647, -2147483648),
  30480. e < 0 && (e = 4294967295 + e + 1),
  30481. a.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 24,
  30482. this[t + 1] = e >>> 16,
  30483. this[t + 2] = e >>> 8,
  30484. this[t + 3] = 255 & e) : V(this, e, t, !1),
  30485. t + 4
  30486. }
  30487. ,
  30488. a.prototype.writeFloatLE = function(e, t, i) {
  30489. return k(this, e, t, !0, i)
  30490. }
  30491. ,
  30492. a.prototype.writeFloatBE = function(e, t, i) {
  30493. return k(this, e, t, !1, i)
  30494. }
  30495. ,
  30496. a.prototype.writeDoubleLE = function(e, t, i) {
  30497. return H(this, e, t, !0, i)
  30498. }
  30499. ,
  30500. a.prototype.writeDoubleBE = function(e, t, i) {
  30501. return H(this, e, t, !1, i)
  30502. }
  30503. ,
  30504. a.prototype.copy = function(e, t, i, n) {
  30505. if (i || (i = 0),
  30506. n || 0 === n || (n = this.length),
  30507. t >= e.length && (t = e.length),
  30508. t || (t = 0),
  30509. n > 0 && n < i && (n = i),
  30510. n === i)
  30511. return 0;
  30512. if (0 === e.length || 0 === this.length)
  30513. return 0;
  30514. if (t < 0)
  30515. throw new RangeError("targetStart out of bounds");
  30516. if (i < 0 || i >= this.length)
  30517. throw new RangeError("sourceStart out of bounds");
  30518. if (n < 0)
  30519. throw new RangeError("sourceEnd out of bounds");
  30520. n > this.length && (n = this.length),
  30521. e.length - t < n - i && (n = e.length - t + i);
  30522. var r, o = n - i;
  30523. if (this === e && i < t && t < n)
  30524. for (r = o - 1; r >= 0; --r)
  30525. e[r + t] = this[r + i];
  30526. else if (o < 1e3 || !a.TYPED_ARRAY_SUPPORT)
  30527. for (r = 0; r < o; ++r)
  30528. e[r + t] = this[r + i];
  30529. else
  30530. Uint8Array.prototype.set.call(e, this.subarray(i, i + o), t);
  30531. return o
  30532. }
  30533. ,
  30534. a.prototype.fill = function(e, t, i, n) {
  30535. if ("string" == typeof e) {
  30536. if ("string" == typeof t ? (n = t,
  30537. t = 0,
  30538. i = this.length) : "string" == typeof i && (n = i,
  30539. i = this.length),
  30540. 1 === e.length) {
  30541. var r = e.charCodeAt(0);
  30542. r < 256 && (e = r)
  30543. }
  30544. if (void 0 !== n && "string" != typeof n)
  30545. throw new TypeError("encoding must be a string");
  30546. if ("string" == typeof n && !a.isEncoding(n))
  30547. throw new TypeError("Unknown encoding: " + n)
  30548. } else
  30549. "number" == typeof e && (e &= 255);
  30550. if (t < 0 || this.length < t || this.length < i)
  30551. throw new RangeError("Out of range index");
  30552. if (i <= t)
  30553. return this;
  30554. t >>>= 0,
  30555. i = void 0 === i ? this.length : i >>> 0,
  30556. e || (e = 0);
  30557. var o;
  30558. if ("number" == typeof e)
  30559. for (o = t; o < i; ++o)
  30560. this[o] = e;
  30561. else {
  30562. var s = a.isBuffer(e) ? e : j(new a(e,n).toString())
  30563. , l = s.length;
  30564. for (o = 0; o < i - t; ++o)
  30565. this[o + t] = s[o % l]
  30566. }
  30567. return this
  30568. }
  30569. ;
  30570. var te = /[^+\/0-9A-Za-z-_]/g
  30571. }
  30572. ).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
  30573. }
  30574. , {
  30575. "base64-js": 199,
  30576. ieee754: 200,
  30577. isarray: 201
  30578. }],
  30579. 199: [function(e, t, i) {
  30580. "use strict";
  30581. function n(e) {
  30582. var t = e.length;
  30583. if (t % 4 > 0)
  30584. throw new Error("Invalid string. Length must be a multiple of 4");
  30585. return "=" === e[t - 2] ? 2 : "=" === e[t - 1] ? 1 : 0
  30586. }
  30587. function r(e) {
  30588. return 3 * e.length / 4 - n(e)
  30589. }
  30590. function o(e) {
  30591. var t, i, r, o, a, s, l = e.length;
  30592. a = n(e),
  30593. s = new u(3 * l / 4 - a),
  30594. r = a > 0 ? l - 4 : l;
  30595. var c = 0;
  30596. for (t = 0,
  30597. i = 0; t < r; t += 4,
  30598. i += 3)
  30599. o = h[e.charCodeAt(t)] << 18 | h[e.charCodeAt(t + 1)] << 12 | h[e.charCodeAt(t + 2)] << 6 | h[e.charCodeAt(t + 3)],
  30600. s[c++] = o >> 16 & 255,
  30601. s[c++] = o >> 8 & 255,
  30602. s[c++] = 255 & o;
  30603. return 2 === a ? (o = h[e.charCodeAt(t)] << 2 | h[e.charCodeAt(t + 1)] >> 4,
  30604. s[c++] = 255 & o) : 1 === a && (o = h[e.charCodeAt(t)] << 10 | h[e.charCodeAt(t + 1)] << 4 | h[e.charCodeAt(t + 2)] >> 2,
  30605. s[c++] = o >> 8 & 255,
  30606. s[c++] = 255 & o),
  30607. s
  30608. }
  30609. function a(e) {
  30610. return c[e >> 18 & 63] + c[e >> 12 & 63] + c[e >> 6 & 63] + c[63 & e]
  30611. }
  30612. function s(e, t, i) {
  30613. for (var n, r = [], o = t; o < i; o += 3)
  30614. n = (e[o] << 16) + (e[o + 1] << 8) + e[o + 2],
  30615. r.push(a(n));
  30616. return r.join("")
  30617. }
  30618. function l(e) {
  30619. for (var t, i = e.length, n = i % 3, r = "", o = [], a = 16383, l = 0, h = i - n; l < h; l += a)
  30620. o.push(s(e, l, l + a > h ? h : l + a));
  30621. return 1 === n ? (t = e[i - 1],
  30622. r += c[t >> 2],
  30623. r += c[t << 4 & 63],
  30624. r += "==") : 2 === n && (t = (e[i - 2] << 8) + e[i - 1],
  30625. r += c[t >> 10],
  30626. r += c[t >> 4 & 63],
  30627. r += c[t << 2 & 63],
  30628. r += "="),
  30629. o.push(r),
  30630. o.join("")
  30631. }
  30632. i.byteLength = r,
  30633. i.toByteArray = o,
  30634. i.fromByteArray = l;
  30635. for (var c = [], h = [], u = "undefined" != typeof Uint8Array ? Uint8Array : Array, d = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", p = 0, f = d.length; p < f; ++p)
  30636. c[p] = d[p],
  30637. h[d.charCodeAt(p)] = p;
  30638. h["-".charCodeAt(0)] = 62,
  30639. h["_".charCodeAt(0)] = 63
  30640. }
  30641. , {}],
  30642. 200: [function(e, t, i) {
  30643. i.read = function(e, t, i, n, r) {
  30644. 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];
  30645. for (u += d,
  30646. o = p & (1 << -h) - 1,
  30647. p >>= -h,
  30648. h += s; h > 0; o = 256 * o + e[t + u],
  30649. u += d,
  30650. h -= 8)
  30651. ;
  30652. for (a = o & (1 << -h) - 1,
  30653. o >>= -h,
  30654. h += n; h > 0; a = 256 * a + e[t + u],
  30655. u += d,
  30656. h -= 8)
  30657. ;
  30658. if (0 === o)
  30659. o = 1 - c;
  30660. else {
  30661. if (o === l)
  30662. return a ? NaN : (p ? -1 : 1) * (1 / 0);
  30663. a += Math.pow(2, n),
  30664. o -= c
  30665. }
  30666. return (p ? -1 : 1) * a * Math.pow(2, o - n)
  30667. }
  30668. ,
  30669. i.write = function(e, t, i, n, r, o) {
  30670. 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;
  30671. for (t = Math.abs(t),
  30672. isNaN(t) || t === 1 / 0 ? (s = isNaN(t) ? 1 : 0,
  30673. a = h) : (a = Math.floor(Math.log(t) / Math.LN2),
  30674. t * (l = Math.pow(2, -a)) < 1 && (a--,
  30675. l *= 2),
  30676. t += a + u >= 1 ? d / l : d * Math.pow(2, 1 - u),
  30677. t * l >= 2 && (a++,
  30678. l /= 2),
  30679. a + u >= h ? (s = 0,
  30680. a = h) : a + u >= 1 ? (s = (t * l - 1) * Math.pow(2, r),
  30681. a += u) : (s = t * Math.pow(2, u - 1) * Math.pow(2, r),
  30682. a = 0)); r >= 8; e[i + p] = 255 & s,
  30683. p += f,
  30684. s /= 256,
  30685. r -= 8)
  30686. ;
  30687. for (a = a << r | s,
  30688. c += r; c > 0; e[i + p] = 255 & a,
  30689. p += f,
  30690. a /= 256,
  30691. c -= 8)
  30692. ;
  30693. e[i + p - f] |= 128 * g
  30694. }
  30695. }
  30696. , {}],
  30697. 201: [function(e, t, i) {
  30698. var n = {}.toString;
  30699. t.exports = Array.isArray || function(e) {
  30700. return "[object Array]" == n.call(e)
  30701. }
  30702. }
  30703. , {}],
  30704. 202: [function(e, t, i) {
  30705. function n() {
  30706. this._events = this._events || {},
  30707. this._maxListeners = this._maxListeners || void 0
  30708. }
  30709. function r(e) {
  30710. return "function" == typeof e
  30711. }
  30712. function o(e) {
  30713. return "number" == typeof e
  30714. }
  30715. function a(e) {
  30716. return "object" == typeof e && null !== e
  30717. }
  30718. function s(e) {
  30719. return void 0 === e
  30720. }
  30721. t.exports = n,
  30722. n.EventEmitter = n,
  30723. n.prototype._events = void 0,
  30724. n.prototype._maxListeners = void 0,
  30725. n.defaultMaxListeners = 10,
  30726. n.prototype.setMaxListeners = function(e) {
  30727. if (!o(e) || e < 0 || isNaN(e))
  30728. throw TypeError("n must be a positive number");
  30729. return this._maxListeners = e,
  30730. this
  30731. }
  30732. ,
  30733. n.prototype.emit = function(e) {
  30734. var t, i, n, o, l, c;
  30735. if (this._events || (this._events = {}),
  30736. "error" === e && (!this._events.error || a(this._events.error) && !this._events.error.length)) {
  30737. if (t = arguments[1],
  30738. t instanceof Error)
  30739. throw t;
  30740. var h = new Error('Uncaught, unspecified "error" event. (' + t + ")");
  30741. throw h.context = t,
  30742. h
  30743. }
  30744. if (i = this._events[e],
  30745. s(i))
  30746. return !1;
  30747. if (r(i))
  30748. switch (arguments.length) {
  30749. case 1:
  30750. i.call(this);
  30751. break;
  30752. case 2:
  30753. i.call(this, arguments[1]);
  30754. break;
  30755. case 3:
  30756. i.call(this, arguments[1], arguments[2]);
  30757. break;
  30758. default:
  30759. o = Array.prototype.slice.call(arguments, 1),
  30760. i.apply(this, o)
  30761. }
  30762. else if (a(i))
  30763. for (o = Array.prototype.slice.call(arguments, 1),
  30764. c = i.slice(),
  30765. n = c.length,
  30766. l = 0; l < n; l++)
  30767. c[l].apply(this, o);
  30768. return !0
  30769. }
  30770. ,
  30771. n.prototype.addListener = function(e, t) {
  30772. var i;
  30773. if (!r(t))
  30774. throw TypeError("listener must be a function");
  30775. return this._events || (this._events = {}),
  30776. this._events.newListener && this.emit("newListener", e, r(t.listener) ? t.listener : t),
  30777. this._events[e] ? a(this._events[e]) ? this._events[e].push(t) : this._events[e] = [this._events[e], t] : this._events[e] = t,
  30778. a(this._events[e]) && !this._events[e].warned && (i = s(this._maxListeners) ? n.defaultMaxListeners : this._maxListeners,
  30779. i && i > 0 && this._events[e].length > i && (this._events[e].warned = !0,
  30780. console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.", this._events[e].length),
  30781. "function" == typeof console.trace && console.trace())),
  30782. this
  30783. }
  30784. ,
  30785. n.prototype.on = n.prototype.addListener,
  30786. n.prototype.once = function(e, t) {
  30787. function i() {
  30788. this.removeListener(e, i),
  30789. n || (n = !0,
  30790. t.apply(this, arguments))
  30791. }
  30792. if (!r(t))
  30793. throw TypeError("listener must be a function");
  30794. var n = !1;
  30795. return i.listener = t,
  30796. this.on(e, i),
  30797. this
  30798. }
  30799. ,
  30800. n.prototype.removeListener = function(e, t) {
  30801. var i, n, o, s;
  30802. if (!r(t))
  30803. throw TypeError("listener must be a function");
  30804. if (!this._events || !this._events[e])
  30805. return this;
  30806. if (i = this._events[e],
  30807. o = i.length,
  30808. n = -1,
  30809. i === t || r(i.listener) && i.listener === t)
  30810. delete this._events[e],
  30811. this._events.removeListener && this.emit("removeListener", e, t);
  30812. else if (a(i)) {
  30813. for (s = o; s-- > 0; )
  30814. if (i[s] === t || i[s].listener && i[s].listener === t) {
  30815. n = s;
  30816. break
  30817. }
  30818. if (n < 0)
  30819. return this;
  30820. 1 === i.length ? (i.length = 0,
  30821. delete this._events[e]) : i.splice(n, 1),
  30822. this._events.removeListener && this.emit("removeListener", e, t)
  30823. }
  30824. return this
  30825. }
  30826. ,
  30827. n.prototype.removeAllListeners = function(e) {
  30828. var t, i;
  30829. if (!this._events)
  30830. return this;
  30831. if (!this._events.removeListener)
  30832. return 0 === arguments.length ? this._events = {} : this._events[e] && delete this._events[e],
  30833. this;
  30834. if (0 === arguments.length) {
  30835. for (t in this._events)
  30836. "removeListener" !== t && this.removeAllListeners(t);
  30837. return this.removeAllListeners("removeListener"),
  30838. this._events = {},
  30839. this
  30840. }
  30841. if (i = this._events[e],
  30842. r(i))
  30843. this.removeListener(e, i);
  30844. else if (i)
  30845. for (; i.length; )
  30846. this.removeListener(e, i[i.length - 1]);
  30847. return delete this._events[e],
  30848. this
  30849. }
  30850. ,
  30851. n.prototype.listeners = function(e) {
  30852. var t;
  30853. return t = this._events && this._events[e] ? r(this._events[e]) ? [this._events[e]] : this._events[e].slice() : []
  30854. }
  30855. ,
  30856. n.prototype.listenerCount = function(e) {
  30857. if (this._events) {
  30858. var t = this._events[e];
  30859. if (r(t))
  30860. return 1;
  30861. if (t)
  30862. return t.length
  30863. }
  30864. return 0
  30865. }
  30866. ,
  30867. n.listenerCount = function(e, t) {
  30868. return e.listenerCount(t)
  30869. }
  30870. }
  30871. , {}],
  30872. 203: [function(e, t, i) {
  30873. function n() {
  30874. throw new Error("setTimeout has not been defined")
  30875. }
  30876. function r() {
  30877. throw new Error("clearTimeout has not been defined")
  30878. }
  30879. function o(e) {
  30880. if (u === setTimeout)
  30881. return setTimeout(e, 0);
  30882. if ((u === n || !u) && setTimeout)
  30883. return u = setTimeout,
  30884. setTimeout(e, 0);
  30885. try {
  30886. return u(e, 0)
  30887. } catch (t) {
  30888. try {
  30889. return u.call(null, e, 0)
  30890. } catch (t) {
  30891. return u.call(this, e, 0)
  30892. }
  30893. }
  30894. }
  30895. function a(e) {
  30896. if (d === clearTimeout)
  30897. return clearTimeout(e);
  30898. if ((d === r || !d) && clearTimeout)
  30899. return d = clearTimeout,
  30900. clearTimeout(e);
  30901. try {
  30902. return d(e)
  30903. } catch (t) {
  30904. try {
  30905. return d.call(null, e)
  30906. } catch (t) {
  30907. return d.call(this, e)
  30908. }
  30909. }
  30910. }
  30911. function s() {
  30912. m && f && (m = !1,
  30913. f.length ? g = f.concat(g) : v = -1,
  30914. g.length && l())
  30915. }
  30916. function l() {
  30917. if (!m) {
  30918. var e = o(s);
  30919. m = !0;
  30920. for (var t = g.length; t; ) {
  30921. for (f = g,
  30922. g = []; ++v < t; )
  30923. f && f[v].run();
  30924. v = -1,
  30925. t = g.length
  30926. }
  30927. f = null,
  30928. m = !1,
  30929. a(e)
  30930. }
  30931. }
  30932. function c(e, t) {
  30933. this.fun = e,
  30934. this.array = t
  30935. }
  30936. function h() {}
  30937. var u, d, p = t.exports = {};
  30938. !function() {
  30939. try {
  30940. u = "function" == typeof setTimeout ? setTimeout : n
  30941. } catch (e) {
  30942. u = n
  30943. }
  30944. try {
  30945. d = "function" == typeof clearTimeout ? clearTimeout : r
  30946. } catch (e) {
  30947. d = r
  30948. }
  30949. }();
  30950. var f, g = [], m = !1, v = -1;
  30951. p.nextTick = function(e) {
  30952. var t = new Array(arguments.length - 1);
  30953. if (arguments.length > 1)
  30954. for (var i = 1; i < arguments.length; i++)
  30955. t[i - 1] = arguments[i];
  30956. g.push(new c(e,t)),
  30957. 1 !== g.length || m || o(l)
  30958. }
  30959. ,
  30960. c.prototype.run = function() {
  30961. this.fun.apply(null, this.array)
  30962. }
  30963. ,
  30964. p.title = "browser",
  30965. p.browser = !0,
  30966. p.env = {},
  30967. p.argv = [],
  30968. p.version = "",
  30969. p.versions = {},
  30970. p.on = h,
  30971. p.addListener = h,
  30972. p.once = h,
  30973. p.off = h,
  30974. p.removeListener = h,
  30975. p.removeAllListeners = h,
  30976. p.emit = h,
  30977. p.binding = function(e) {
  30978. throw new Error("process.binding is not supported")
  30979. }
  30980. ,
  30981. p.cwd = function() {
  30982. return "/"
  30983. }
  30984. ,
  30985. p.chdir = function(e) {
  30986. throw new Error("process.chdir is not supported")
  30987. }
  30988. ,
  30989. p.umask = function() {
  30990. return 0
  30991. }
  30992. }
  30993. , {}],
  30994. 204: [function(e, t, i) {
  30995. (function(e) {
  30996. !function(n) {
  30997. function r(e) {
  30998. throw new RangeError(L[e])
  30999. }
  31000. function o(e, t) {
  31001. for (var i = e.length, n = []; i--; )
  31002. n[i] = t(e[i]);
  31003. return n
  31004. }
  31005. function a(e, t) {
  31006. var i = e.split("@")
  31007. , n = "";
  31008. i.length > 1 && (n = i[0] + "@",
  31009. e = i[1]),
  31010. e = e.replace(O, ".");
  31011. var r = e.split(".")
  31012. , a = o(r, t).join(".");
  31013. return n + a
  31014. }
  31015. function s(e) {
  31016. for (var t, i, n = [], r = 0, o = e.length; r < o; )
  31017. t = e.charCodeAt(r++),
  31018. t >= 55296 && t <= 56319 && r < o ? (i = e.charCodeAt(r++),
  31019. 56320 == (64512 & i) ? n.push(((1023 & t) << 10) + (1023 & i) + 65536) : (n.push(t),
  31020. r--)) : n.push(t);
  31021. return n
  31022. }
  31023. function l(e) {
  31024. return o(e, function(e) {
  31025. var t = "";
  31026. return e > 65535 && (e -= 65536,
  31027. t += B(e >>> 10 & 1023 | 55296),
  31028. e = 56320 | 1023 & e),
  31029. t += B(e)
  31030. }).join("")
  31031. }
  31032. function c(e) {
  31033. return e - 48 < 10 ? e - 22 : e - 65 < 26 ? e - 65 : e - 97 < 26 ? e - 97 : E
  31034. }
  31035. function h(e, t) {
  31036. return e + 22 + 75 * (e < 26) - ((0 != t) << 5)
  31037. }
  31038. function u(e, t, i) {
  31039. var n = 0;
  31040. for (e = i ? N(e / T) : e >> 1,
  31041. e += N(e / t); e > D * w >> 1; n += E)
  31042. e = N(e / D);
  31043. return N(n + (D + 1) * e / (e + _))
  31044. }
  31045. function d(e) {
  31046. var t, i, n, o, a, s, h, d, p, f, g = [], m = e.length, v = 0, A = S, y = x;
  31047. for (i = e.lastIndexOf(M),
  31048. i < 0 && (i = 0),
  31049. n = 0; n < i; ++n)
  31050. e.charCodeAt(n) >= 128 && r("not-basic"),
  31051. g.push(e.charCodeAt(n));
  31052. for (o = i > 0 ? i + 1 : 0; o < m; ) {
  31053. for (a = v,
  31054. s = 1,
  31055. h = E; o >= m && r("invalid-input"),
  31056. d = c(e.charCodeAt(o++)),
  31057. (d >= E || d > N((I - v) / s)) && r("overflow"),
  31058. v += d * s,
  31059. p = h <= y ? b : h >= y + w ? w : h - y,
  31060. !(d < p); h += E)
  31061. f = E - p,
  31062. s > N(I / f) && r("overflow"),
  31063. s *= f;
  31064. t = g.length + 1,
  31065. y = u(v - a, t, 0 == a),
  31066. N(v / t) > I - A && r("overflow"),
  31067. A += N(v / t),
  31068. v %= t,
  31069. g.splice(v++, 0, A)
  31070. }
  31071. return l(g)
  31072. }
  31073. function p(e) {
  31074. var t, i, n, o, a, l, c, d, p, f, g, m, v, A, y, C = [];
  31075. for (e = s(e),
  31076. m = e.length,
  31077. t = S,
  31078. i = 0,
  31079. a = x,
  31080. l = 0; l < m; ++l)
  31081. g = e[l],
  31082. g < 128 && C.push(B(g));
  31083. for (n = o = C.length,
  31084. o && C.push(M); n < m; ) {
  31085. for (c = I,
  31086. l = 0; l < m; ++l)
  31087. g = e[l],
  31088. g >= t && g < c && (c = g);
  31089. for (v = n + 1,
  31090. c - t > N((I - i) / v) && r("overflow"),
  31091. i += (c - t) * v,
  31092. t = c,
  31093. l = 0; l < m; ++l)
  31094. if (g = e[l],
  31095. g < t && ++i > I && r("overflow"),
  31096. g == t) {
  31097. for (d = i,
  31098. p = E; f = p <= a ? b : p >= a + w ? w : p - a,
  31099. !(d < f); p += E)
  31100. y = d - f,
  31101. A = E - f,
  31102. C.push(B(h(f + y % A, 0))),
  31103. d = N(y / A);
  31104. C.push(B(h(d, 0))),
  31105. a = u(i, v, n == o),
  31106. i = 0,
  31107. ++n
  31108. }
  31109. ++i,
  31110. ++t
  31111. }
  31112. return C.join("")
  31113. }
  31114. function f(e) {
  31115. return a(e, function(e) {
  31116. return R.test(e) ? d(e.slice(4).toLowerCase()) : e
  31117. })
  31118. }
  31119. function g(e) {
  31120. return a(e, function(e) {
  31121. return P.test(e) ? "xn--" + p(e) : e
  31122. })
  31123. }
  31124. var m = "object" == typeof i && i && !i.nodeType && i
  31125. , v = "object" == typeof t && t && !t.nodeType && t
  31126. , A = "object" == typeof e && e;
  31127. A.global !== A && A.window !== A && A.self !== A || (n = A);
  31128. 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 = {
  31129. overflow: "Overflow: input needs wider integers to process",
  31130. "not-basic": "Illegal input >= 0x80 (not a basic code point)",
  31131. "invalid-input": "Invalid input"
  31132. }, D = E - b, N = Math.floor, B = String.fromCharCode;
  31133. if (y = {
  31134. version: "1.4.1",
  31135. ucs2: {
  31136. decode: s,
  31137. encode: l
  31138. },
  31139. decode: d,
  31140. encode: p,
  31141. toASCII: g,
  31142. toUnicode: f
  31143. },
  31144. "function" == typeof define && "object" == typeof define.amd && define.amd)
  31145. define("punycode", function() {
  31146. return y
  31147. });
  31148. else if (m && v)
  31149. if (t.exports == m)
  31150. v.exports = y;
  31151. else
  31152. for (C in y)
  31153. y.hasOwnProperty(C) && (m[C] = y[C]);
  31154. else
  31155. n.punycode = y
  31156. }(this)
  31157. }
  31158. ).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
  31159. }
  31160. , {}],
  31161. 205: [function(e, t, i) {
  31162. "use strict";
  31163. function n(e, t) {
  31164. return Object.prototype.hasOwnProperty.call(e, t)
  31165. }
  31166. t.exports = function(e, t, i, o) {
  31167. t = t || "&",
  31168. i = i || "=";
  31169. var a = {};
  31170. if ("string" != typeof e || 0 === e.length)
  31171. return a;
  31172. var s = /\+/g;
  31173. e = e.split(t);
  31174. var l = 1e3;
  31175. o && "number" == typeof o.maxKeys && (l = o.maxKeys);
  31176. var c = e.length;
  31177. l > 0 && c > l && (c = l);
  31178. for (var h = 0; h < c; ++h) {
  31179. var u, d, p, f, g = e[h].replace(s, "%20"), m = g.indexOf(i);
  31180. m >= 0 ? (u = g.substr(0, m),
  31181. d = g.substr(m + 1)) : (u = g,
  31182. d = ""),
  31183. p = decodeURIComponent(u),
  31184. f = decodeURIComponent(d),
  31185. n(a, p) ? r(a[p]) ? a[p].push(f) : a[p] = [a[p], f] : a[p] = f
  31186. }
  31187. return a
  31188. }
  31189. ;
  31190. var r = Array.isArray || function(e) {
  31191. return "[object Array]" === Object.prototype.toString.call(e)
  31192. }
  31193. }
  31194. , {}],
  31195. 206: [function(e, t, i) {
  31196. "use strict";
  31197. function n(e, t) {
  31198. if (e.map)
  31199. return e.map(t);
  31200. for (var i = [], n = 0; n < e.length; n++)
  31201. i.push(t(e[n], n));
  31202. return i
  31203. }
  31204. var r = function(e) {
  31205. switch (typeof e) {
  31206. case "string":
  31207. return e;
  31208. case "boolean":
  31209. return e ? "true" : "false";
  31210. case "number":
  31211. return isFinite(e) ? e : "";
  31212. default:
  31213. return ""
  31214. }
  31215. };
  31216. t.exports = function(e, t, i, s) {
  31217. return t = t || "&",
  31218. i = i || "=",
  31219. null === e && (e = void 0),
  31220. "object" == typeof e ? n(a(e), function(a) {
  31221. var s = encodeURIComponent(r(a)) + i;
  31222. return o(e[a]) ? n(e[a], function(e) {
  31223. return s + encodeURIComponent(r(e))
  31224. }).join(t) : s + encodeURIComponent(r(e[a]))
  31225. }).join(t) : s ? encodeURIComponent(r(s)) + i + encodeURIComponent(r(e)) : ""
  31226. }
  31227. ;
  31228. var o = Array.isArray || function(e) {
  31229. return "[object Array]" === Object.prototype.toString.call(e)
  31230. }
  31231. , a = Object.keys || function(e) {
  31232. var t = [];
  31233. for (var i in e)
  31234. Object.prototype.hasOwnProperty.call(e, i) && t.push(i);
  31235. return t
  31236. }
  31237. }
  31238. , {}],
  31239. 207: [function(e, t, i) {
  31240. "use strict";
  31241. i.decode = i.parse = e("./decode"),
  31242. i.encode = i.stringify = e("./encode")
  31243. }
  31244. , {
  31245. "./decode": 205,
  31246. "./encode": 206
  31247. }],
  31248. 208: [function(e, t, i) {
  31249. "use strict";
  31250. function n() {
  31251. this.protocol = null,
  31252. this.slashes = null,
  31253. this.auth = null,
  31254. this.host = null,
  31255. this.port = null,
  31256. this.hostname = null,
  31257. this.hash = null,
  31258. this.search = null,
  31259. this.query = null,
  31260. this.pathname = null,
  31261. this.path = null,
  31262. this.href = null
  31263. }
  31264. function r(e, t, i) {
  31265. if (e && c.isObject(e) && e instanceof n)
  31266. return e;
  31267. var r = new n;
  31268. return r.parse(e, t, i),
  31269. r
  31270. }
  31271. function o(e) {
  31272. return c.isString(e) && (e = r(e)),
  31273. e instanceof n ? e.format() : n.prototype.format.call(e)
  31274. }
  31275. function a(e, t) {
  31276. return r(e, !1, !0).resolve(t)
  31277. }
  31278. function s(e, t) {
  31279. return e ? r(e, !1, !0).resolveObject(t) : t
  31280. }
  31281. var l = e("punycode")
  31282. , c = e("./util");
  31283. i.parse = r,
  31284. i.resolve = a,
  31285. i.resolveObject = s,
  31286. i.format = o,
  31287. i.Url = n;
  31288. var h = /^([a-z0-9.+-]+:)/i
  31289. , u = /:[0-9]*$/
  31290. , d = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/
  31291. , p = ["<", ">", '"', "`", " ", "\r", "\n", "\t"]
  31292. , f = ["{", "}", "|", "\\", "^", "`"].concat(p)
  31293. , g = ["'"].concat(f)
  31294. , m = ["%", "/", "?", ";", "#"].concat(g)
  31295. , v = ["/", "?", "#"]
  31296. , A = 255
  31297. , y = /^[+a-z0-9A-Z_-]{0,63}$/
  31298. , C = /^([+a-z0-9A-Z_-]{0,63})(.*)$/
  31299. , I = {
  31300. javascript: !0,
  31301. "javascript:": !0
  31302. }
  31303. , E = {
  31304. javascript: !0,
  31305. "javascript:": !0
  31306. }
  31307. , b = {
  31308. http: !0,
  31309. https: !0,
  31310. ftp: !0,
  31311. gopher: !0,
  31312. file: !0,
  31313. "http:": !0,
  31314. "https:": !0,
  31315. "ftp:": !0,
  31316. "gopher:": !0,
  31317. "file:": !0
  31318. }
  31319. , w = e("querystring");
  31320. n.prototype.parse = function(e, t, i) {
  31321. if (!c.isString(e))
  31322. throw new TypeError("Parameter 'url' must be a string, not " + typeof e);
  31323. var n = e.indexOf("?")
  31324. , r = n !== -1 && n < e.indexOf("#") ? "?" : "#"
  31325. , o = e.split(r)
  31326. , a = /\\/g;
  31327. o[0] = o[0].replace(a, "/"),
  31328. e = o.join(r);
  31329. var s = e;
  31330. if (s = s.trim(),
  31331. !i && 1 === e.split("#").length) {
  31332. var u = d.exec(s);
  31333. if (u)
  31334. return this.path = s,
  31335. this.href = s,
  31336. this.pathname = u[1],
  31337. u[2] ? (this.search = u[2],
  31338. t ? this.query = w.parse(this.search.substr(1)) : this.query = this.search.substr(1)) : t && (this.search = "",
  31339. this.query = {}),
  31340. this
  31341. }
  31342. var p = h.exec(s);
  31343. if (p) {
  31344. p = p[0];
  31345. var f = p.toLowerCase();
  31346. this.protocol = f,
  31347. s = s.substr(p.length)
  31348. }
  31349. if (i || p || s.match(/^\/\/[^@\/]+@[^@\/]+/)) {
  31350. var _ = "//" === s.substr(0, 2);
  31351. !_ || p && E[p] || (s = s.substr(2),
  31352. this.slashes = !0)
  31353. }
  31354. if (!E[p] && (_ || p && !b[p])) {
  31355. for (var T = -1, x = 0; x < v.length; x++) {
  31356. var S = s.indexOf(v[x]);
  31357. S !== -1 && (T === -1 || S < T) && (T = S)
  31358. }
  31359. var M, R;
  31360. R = T === -1 ? s.lastIndexOf("@") : s.lastIndexOf("@", T),
  31361. R !== -1 && (M = s.slice(0, R),
  31362. s = s.slice(R + 1),
  31363. this.auth = decodeURIComponent(M)),
  31364. T = -1;
  31365. for (var x = 0; x < m.length; x++) {
  31366. var S = s.indexOf(m[x]);
  31367. S !== -1 && (T === -1 || S < T) && (T = S)
  31368. }
  31369. T === -1 && (T = s.length),
  31370. this.host = s.slice(0, T),
  31371. s = s.slice(T),
  31372. this.parseHost(),
  31373. this.hostname = this.hostname || "";
  31374. var P = "[" === this.hostname[0] && "]" === this.hostname[this.hostname.length - 1];
  31375. if (!P)
  31376. for (var O = this.hostname.split(/\./), x = 0, L = O.length; x < L; x++) {
  31377. var D = O[x];
  31378. if (D && !D.match(y)) {
  31379. for (var N = "", B = 0, F = D.length; B < F; B++)
  31380. N += D.charCodeAt(B) > 127 ? "x" : D[B];
  31381. if (!N.match(y)) {
  31382. var V = O.slice(0, x)
  31383. , U = O.slice(x + 1)
  31384. , k = D.match(C);
  31385. k && (V.push(k[1]),
  31386. U.unshift(k[2])),
  31387. U.length && (s = "/" + U.join(".") + s),
  31388. this.hostname = V.join(".");
  31389. break
  31390. }
  31391. }
  31392. }
  31393. this.hostname.length > A ? this.hostname = "" : this.hostname = this.hostname.toLowerCase(),
  31394. P || (this.hostname = l.toASCII(this.hostname));
  31395. var H = this.port ? ":" + this.port : ""
  31396. , G = this.hostname || "";
  31397. this.host = G + H,
  31398. this.href += this.host,
  31399. P && (this.hostname = this.hostname.substr(1, this.hostname.length - 2),
  31400. "/" !== s[0] && (s = "/" + s))
  31401. }
  31402. if (!I[f])
  31403. for (var x = 0, L = g.length; x < L; x++) {
  31404. var z = g[x];
  31405. if (s.indexOf(z) !== -1) {
  31406. var W = encodeURIComponent(z);
  31407. W === z && (W = escape(z)),
  31408. s = s.split(z).join(W)
  31409. }
  31410. }
  31411. var j = s.indexOf("#");
  31412. j !== -1 && (this.hash = s.substr(j),
  31413. s = s.slice(0, j));
  31414. var Y = s.indexOf("?");
  31415. if (Y !== -1 ? (this.search = s.substr(Y),
  31416. this.query = s.substr(Y + 1),
  31417. t && (this.query = w.parse(this.query)),
  31418. s = s.slice(0, Y)) : t && (this.search = "",
  31419. this.query = {}),
  31420. s && (this.pathname = s),
  31421. b[f] && this.hostname && !this.pathname && (this.pathname = "/"),
  31422. this.pathname || this.search) {
  31423. var H = this.pathname || ""
  31424. , X = this.search || "";
  31425. this.path = H + X
  31426. }
  31427. return this.href = this.format(),
  31428. this
  31429. }
  31430. ,
  31431. n.prototype.format = function() {
  31432. var e = this.auth || "";
  31433. e && (e = encodeURIComponent(e),
  31434. e = e.replace(/%3A/i, ":"),
  31435. e += "@");
  31436. var t = this.protocol || ""
  31437. , i = this.pathname || ""
  31438. , n = this.hash || ""
  31439. , r = !1
  31440. , o = "";
  31441. this.host ? r = e + this.host : this.hostname && (r = e + (this.hostname.indexOf(":") === -1 ? this.hostname : "[" + this.hostname + "]"),
  31442. this.port && (r += ":" + this.port)),
  31443. this.query && c.isObject(this.query) && Object.keys(this.query).length && (o = w.stringify(this.query));
  31444. var a = this.search || o && "?" + o || "";
  31445. return t && ":" !== t.substr(-1) && (t += ":"),
  31446. this.slashes || (!t || b[t]) && r !== !1 ? (r = "//" + (r || ""),
  31447. i && "/" !== i.charAt(0) && (i = "/" + i)) : r || (r = ""),
  31448. n && "#" !== n.charAt(0) && (n = "#" + n),
  31449. a && "?" !== a.charAt(0) && (a = "?" + a),
  31450. i = i.replace(/[?#]/g, function(e) {
  31451. return encodeURIComponent(e)
  31452. }),
  31453. a = a.replace("#", "%23"),
  31454. t + r + i + a + n
  31455. }
  31456. ,
  31457. n.prototype.resolve = function(e) {
  31458. return this.resolveObject(r(e, !1, !0)).format()
  31459. }
  31460. ,
  31461. n.prototype.resolveObject = function(e) {
  31462. if (c.isString(e)) {
  31463. var t = new n;
  31464. t.parse(e, !1, !0),
  31465. e = t
  31466. }
  31467. for (var i = new n, r = Object.keys(this), o = 0; o < r.length; o++) {
  31468. var a = r[o];
  31469. i[a] = this[a]
  31470. }
  31471. if (i.hash = e.hash,
  31472. "" === e.href)
  31473. return i.href = i.format(),
  31474. i;
  31475. if (e.slashes && !e.protocol) {
  31476. for (var s = Object.keys(e), l = 0; l < s.length; l++) {
  31477. var h = s[l];
  31478. "protocol" !== h && (i[h] = e[h])
  31479. }
  31480. return b[i.protocol] && i.hostname && !i.pathname && (i.path = i.pathname = "/"),
  31481. i.href = i.format(),
  31482. i
  31483. }
  31484. if (e.protocol && e.protocol !== i.protocol) {
  31485. if (!b[e.protocol]) {
  31486. for (var u = Object.keys(e), d = 0; d < u.length; d++) {
  31487. var p = u[d];
  31488. i[p] = e[p]
  31489. }
  31490. return i.href = i.format(),
  31491. i
  31492. }
  31493. if (i.protocol = e.protocol,
  31494. e.host || E[e.protocol])
  31495. i.pathname = e.pathname;
  31496. else {
  31497. for (var f = (e.pathname || "").split("/"); f.length && !(e.host = f.shift()); )
  31498. ;
  31499. e.host || (e.host = ""),
  31500. e.hostname || (e.hostname = ""),
  31501. "" !== f[0] && f.unshift(""),
  31502. f.length < 2 && f.unshift(""),
  31503. i.pathname = f.join("/")
  31504. }
  31505. if (i.search = e.search,
  31506. i.query = e.query,
  31507. i.host = e.host || "",
  31508. i.auth = e.auth,
  31509. i.hostname = e.hostname || e.host,
  31510. i.port = e.port,
  31511. i.pathname || i.search) {
  31512. var g = i.pathname || ""
  31513. , m = i.search || "";
  31514. i.path = g + m
  31515. }
  31516. return i.slashes = i.slashes || e.slashes,
  31517. i.href = i.format(),
  31518. i
  31519. }
  31520. var v = i.pathname && "/" === i.pathname.charAt(0)
  31521. , A = e.host || e.pathname && "/" === e.pathname.charAt(0)
  31522. , y = A || v || i.host && e.pathname
  31523. , C = y
  31524. , I = i.pathname && i.pathname.split("/") || []
  31525. , f = e.pathname && e.pathname.split("/") || []
  31526. , w = i.protocol && !b[i.protocol];
  31527. if (w && (i.hostname = "",
  31528. i.port = null,
  31529. i.host && ("" === I[0] ? I[0] = i.host : I.unshift(i.host)),
  31530. i.host = "",
  31531. e.protocol && (e.hostname = null,
  31532. e.port = null,
  31533. e.host && ("" === f[0] ? f[0] = e.host : f.unshift(e.host)),
  31534. e.host = null),
  31535. y = y && ("" === f[0] || "" === I[0])),
  31536. A)
  31537. i.host = e.host || "" === e.host ? e.host : i.host,
  31538. i.hostname = e.hostname || "" === e.hostname ? e.hostname : i.hostname,
  31539. i.search = e.search,
  31540. i.query = e.query,
  31541. I = f;
  31542. else if (f.length)
  31543. I || (I = []),
  31544. I.pop(),
  31545. I = I.concat(f),
  31546. i.search = e.search,
  31547. i.query = e.query;
  31548. else if (!c.isNullOrUndefined(e.search)) {
  31549. if (w) {
  31550. i.hostname = i.host = I.shift();
  31551. var _ = !!(i.host && i.host.indexOf("@") > 0) && i.host.split("@");
  31552. _ && (i.auth = _.shift(),
  31553. i.host = i.hostname = _.shift())
  31554. }
  31555. return i.search = e.search,
  31556. i.query = e.query,
  31557. c.isNull(i.pathname) && c.isNull(i.search) || (i.path = (i.pathname ? i.pathname : "") + (i.search ? i.search : "")),
  31558. i.href = i.format(),
  31559. i
  31560. }
  31561. if (!I.length)
  31562. return i.pathname = null,
  31563. i.search ? i.path = "/" + i.search : i.path = null,
  31564. i.href = i.format(),
  31565. i;
  31566. 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--)
  31567. T = I[M],
  31568. "." === T ? I.splice(M, 1) : ".." === T ? (I.splice(M, 1),
  31569. S++) : S && (I.splice(M, 1),
  31570. S--);
  31571. if (!y && !C)
  31572. for (; S--; S)
  31573. I.unshift("..");
  31574. !y || "" === I[0] || I[0] && "/" === I[0].charAt(0) || I.unshift(""),
  31575. x && "/" !== I.join("/").substr(-1) && I.push("");
  31576. var R = "" === I[0] || I[0] && "/" === I[0].charAt(0);
  31577. if (w) {
  31578. i.hostname = i.host = R ? "" : I.length ? I.shift() : "";
  31579. var _ = !!(i.host && i.host.indexOf("@") > 0) && i.host.split("@");
  31580. _ && (i.auth = _.shift(),
  31581. i.host = i.hostname = _.shift())
  31582. }
  31583. return y = y || i.host && I.length,
  31584. y && !R && I.unshift(""),
  31585. I.length ? i.pathname = I.join("/") : (i.pathname = null,
  31586. i.path = null),
  31587. c.isNull(i.pathname) && c.isNull(i.search) || (i.path = (i.pathname ? i.pathname : "") + (i.search ? i.search : "")),
  31588. i.auth = e.auth || i.auth,
  31589. i.slashes = i.slashes || e.slashes,
  31590. i.href = i.format(),
  31591. i
  31592. }
  31593. ,
  31594. n.prototype.parseHost = function() {
  31595. var e = this.host
  31596. , t = u.exec(e);
  31597. t && (t = t[0],
  31598. ":" !== t && (this.port = t.substr(1)),
  31599. e = e.substr(0, e.length - t.length)),
  31600. e && (this.hostname = e)
  31601. }
  31602. }
  31603. , {
  31604. "./util": 209,
  31605. punycode: 204,
  31606. querystring: 207
  31607. }],
  31608. 209: [function(e, t, i) {
  31609. "use strict";
  31610. t.exports = {
  31611. isString: function(e) {
  31612. return "string" == typeof e
  31613. },
  31614. isObject: function(e) {
  31615. return "object" == typeof e && null !== e
  31616. },
  31617. isNull: function(e) {
  31618. return null === e
  31619. },
  31620. isNullOrUndefined: function(e) {
  31621. return null == e
  31622. }
  31623. }
  31624. }
  31625. , {}],
  31626. 210: [function(e, t, i) {
  31627. "use strict";
  31628. function n(e) {
  31629. return l + e
  31630. }
  31631. function r(e) {
  31632. return e.substring(l.length)
  31633. }
  31634. function o(e, t) {
  31635. for (var i in t)
  31636. Object.defineProperty(e, i, {
  31637. value: t[i],
  31638. configurable: !0,
  31639. writable: !0
  31640. })
  31641. }
  31642. function a(e) {
  31643. if ("string" != typeof e)
  31644. throw new TypeError("key must be a string.")
  31645. }
  31646. var s = Object.prototype.hasOwnProperty
  31647. , l = "~";
  31648. t.exports = function(e) {
  31649. var t = Object.create(null)
  31650. , i = 0
  31651. , l = {};
  31652. return o(l, {
  31653. get: function(e, i) {
  31654. a(e);
  31655. var r = n(e);
  31656. return r in t ? t[r] : i
  31657. },
  31658. set: function(e, r) {
  31659. a(e);
  31660. var o = n(e);
  31661. return o in t || ++i,
  31662. t[o] = r
  31663. },
  31664. has: function(e) {
  31665. return a(e),
  31666. n(e)in t
  31667. },
  31668. delete: function(e) {
  31669. a(e);
  31670. var r = n(e);
  31671. return r in t && (--i,
  31672. delete t[r],
  31673. !0)
  31674. },
  31675. clear: function() {
  31676. t = Object.create(null),
  31677. i = 0
  31678. },
  31679. forEach: function(e, i) {
  31680. if ("function" != typeof e)
  31681. throw new TypeError("`callback` must be a function");
  31682. for (var n in t)
  31683. if (s.call(t, n)) {
  31684. var o = r(n)
  31685. , a = t[n];
  31686. e.call(i, a, o, l)
  31687. }
  31688. }
  31689. }),
  31690. Object.defineProperty(l, "size", {
  31691. get: function() {
  31692. return i
  31693. },
  31694. configurable: !0
  31695. }),
  31696. "object" == typeof e && null !== e && Object.keys(e).forEach(function(t) {
  31697. l.set(t, e[t])
  31698. }),
  31699. l
  31700. }
  31701. }
  31702. , {}],
  31703. 211: [function(e, t, i) {
  31704. t.exports = e("./lib/heap")
  31705. }
  31706. , {
  31707. "./lib/heap": 212
  31708. }],
  31709. 212: [function(e, t, i) {
  31710. (function() {
  31711. var e, n, r, o, a, s, l, c, h, u, d, p, f, g, m;
  31712. r = Math.floor,
  31713. u = Math.min,
  31714. n = function(e, t) {
  31715. return e < t ? -1 : e > t ? 1 : 0
  31716. }
  31717. ,
  31718. h = function(e, t, i, o, a) {
  31719. var s;
  31720. if (null == i && (i = 0),
  31721. null == a && (a = n),
  31722. i < 0)
  31723. throw new Error("lo must be non-negative");
  31724. for (null == o && (o = e.length); i < o; )
  31725. s = r((i + o) / 2),
  31726. a(t, e[s]) < 0 ? o = s : i = s + 1;
  31727. return [].splice.apply(e, [i, i - i].concat(t)),
  31728. t
  31729. }
  31730. ,
  31731. s = function(e, t, i) {
  31732. return null == i && (i = n),
  31733. e.push(t),
  31734. g(e, 0, e.length - 1, i)
  31735. }
  31736. ,
  31737. a = function(e, t) {
  31738. var i, r;
  31739. return null == t && (t = n),
  31740. i = e.pop(),
  31741. e.length ? (r = e[0],
  31742. e[0] = i,
  31743. m(e, 0, t)) : r = i,
  31744. r
  31745. }
  31746. ,
  31747. c = function(e, t, i) {
  31748. var r;
  31749. return null == i && (i = n),
  31750. r = e[0],
  31751. e[0] = t,
  31752. m(e, 0, i),
  31753. r
  31754. }
  31755. ,
  31756. l = function(e, t, i) {
  31757. var r;
  31758. return null == i && (i = n),
  31759. e.length && i(e[0], t) < 0 && (r = [e[0], t],
  31760. t = r[0],
  31761. e[0] = r[1],
  31762. m(e, 0, i)),
  31763. t
  31764. }
  31765. ,
  31766. o = function(e, t) {
  31767. var i, o, a, s, l, c;
  31768. for (null == t && (t = n),
  31769. s = function() {
  31770. c = [];
  31771. for (var t = 0, i = r(e.length / 2); 0 <= i ? t < i : t > i; 0 <= i ? t++ : t--)
  31772. c.push(t);
  31773. return c
  31774. }
  31775. .apply(this).reverse(),
  31776. l = [],
  31777. o = 0,
  31778. a = s.length; o < a; o++)
  31779. i = s[o],
  31780. l.push(m(e, i, t));
  31781. return l
  31782. }
  31783. ,
  31784. f = function(e, t, i) {
  31785. var r;
  31786. if (null == i && (i = n),
  31787. r = e.indexOf(t),
  31788. r !== -1)
  31789. return g(e, 0, r, i),
  31790. m(e, r, i)
  31791. }
  31792. ,
  31793. d = function(e, t, i) {
  31794. var r, a, s, c, h;
  31795. if (null == i && (i = n),
  31796. a = e.slice(0, t),
  31797. !a.length)
  31798. return a;
  31799. for (o(a, i),
  31800. h = e.slice(t),
  31801. s = 0,
  31802. c = h.length; s < c; s++)
  31803. r = h[s],
  31804. l(a, r, i);
  31805. return a.sort(i).reverse()
  31806. }
  31807. ,
  31808. p = function(e, t, i) {
  31809. var r, s, l, c, d, p, f, g, m, v;
  31810. if (null == i && (i = n),
  31811. 10 * t <= e.length) {
  31812. if (c = e.slice(0, t).sort(i),
  31813. !c.length)
  31814. return c;
  31815. for (l = c[c.length - 1],
  31816. g = e.slice(t),
  31817. d = 0,
  31818. f = g.length; d < f; d++)
  31819. r = g[d],
  31820. i(r, l) < 0 && (h(c, r, 0, null, i),
  31821. c.pop(),
  31822. l = c[c.length - 1]);
  31823. return c
  31824. }
  31825. for (o(e, i),
  31826. v = [],
  31827. s = p = 0,
  31828. m = u(t, e.length); 0 <= m ? p < m : p > m; s = 0 <= m ? ++p : --p)
  31829. v.push(a(e, i));
  31830. return v
  31831. }
  31832. ,
  31833. g = function(e, t, i, r) {
  31834. var o, a, s;
  31835. for (null == r && (r = n),
  31836. o = e[i]; i > t && (s = i - 1 >> 1,
  31837. a = e[s],
  31838. r(o, a) < 0); )
  31839. e[i] = a,
  31840. i = s;
  31841. return e[i] = o
  31842. }
  31843. ,
  31844. m = function(e, t, i) {
  31845. var r, o, a, s, l;
  31846. for (null == i && (i = n),
  31847. o = e.length,
  31848. l = t,
  31849. a = e[t],
  31850. r = 2 * t + 1; r < o; )
  31851. s = r + 1,
  31852. s < o && !(i(e[r], e[s]) < 0) && (r = s),
  31853. e[t] = e[r],
  31854. t = r,
  31855. r = 2 * t + 1;
  31856. return e[t] = a,
  31857. g(e, l, t, i)
  31858. }
  31859. ,
  31860. e = function() {
  31861. function e(e) {
  31862. this.cmp = null != e ? e : n,
  31863. this.nodes = []
  31864. }
  31865. return e.push = s,
  31866. e.pop = a,
  31867. e.replace = c,
  31868. e.pushpop = l,
  31869. e.heapify = o,
  31870. e.updateItem = f,
  31871. e.nlargest = d,
  31872. e.nsmallest = p,
  31873. e.prototype.push = function(e) {
  31874. return s(this.nodes, e, this.cmp)
  31875. }
  31876. ,
  31877. e.prototype.pop = function() {
  31878. return a(this.nodes, this.cmp)
  31879. }
  31880. ,
  31881. e.prototype.peek = function() {
  31882. return this.nodes[0]
  31883. }
  31884. ,
  31885. e.prototype.contains = function(e) {
  31886. return this.nodes.indexOf(e) !== -1
  31887. }
  31888. ,
  31889. e.prototype.replace = function(e) {
  31890. return c(this.nodes, e, this.cmp)
  31891. }
  31892. ,
  31893. e.prototype.pushpop = function(e) {
  31894. return l(this.nodes, e, this.cmp)
  31895. }
  31896. ,
  31897. e.prototype.heapify = function() {
  31898. return o(this.nodes, this.cmp)
  31899. }
  31900. ,
  31901. e.prototype.updateItem = function(e) {
  31902. return f(this.nodes, e, this.cmp)
  31903. }
  31904. ,
  31905. e.prototype.clear = function() {
  31906. return this.nodes = []
  31907. }
  31908. ,
  31909. e.prototype.empty = function() {
  31910. return 0 === this.nodes.length
  31911. }
  31912. ,
  31913. e.prototype.size = function() {
  31914. return this.nodes.length
  31915. }
  31916. ,
  31917. e.prototype.clone = function() {
  31918. var t;
  31919. return t = new e,
  31920. t.nodes = this.nodes.slice(0),
  31921. t
  31922. }
  31923. ,
  31924. e.prototype.toArray = function() {
  31925. return this.nodes.slice(0)
  31926. }
  31927. ,
  31928. e.prototype.insert = e.prototype.push,
  31929. e.prototype.top = e.prototype.peek,
  31930. e.prototype.front = e.prototype.peek,
  31931. e.prototype.has = e.prototype.contains,
  31932. e.prototype.copy = e.prototype.clone,
  31933. e
  31934. }(),
  31935. function(e, n) {
  31936. return "function" == typeof define && define.amd ? define([], n) : "object" == typeof i ? t.exports = n() : e.Heap = n()
  31937. }(this, function() {
  31938. return e
  31939. })
  31940. }
  31941. ).call(this)
  31942. }
  31943. , {}],
  31944. 213: [function(e, t, i) {
  31945. !function(e) {
  31946. function i() {}
  31947. function n(e, t) {
  31948. return function() {
  31949. e.apply(t, arguments)
  31950. }
  31951. }
  31952. function r(e) {
  31953. if ("object" != typeof this)
  31954. throw new TypeError("Promises must be constructed via new");
  31955. if ("function" != typeof e)
  31956. throw new TypeError("not a function");
  31957. this._state = 0,
  31958. this._handled = !1,
  31959. this._value = void 0,
  31960. this._deferreds = [],
  31961. h(e, this)
  31962. }
  31963. function o(e, t) {
  31964. for (; 3 === e._state; )
  31965. e = e._value;
  31966. return 0 === e._state ? void e._deferreds.push(t) : (e._handled = !0,
  31967. void r._immediateFn(function() {
  31968. var i = 1 === e._state ? t.onFulfilled : t.onRejected;
  31969. if (null === i)
  31970. return void (1 === e._state ? a : s)(t.promise, e._value);
  31971. var n;
  31972. try {
  31973. n = i(e._value)
  31974. } catch (e) {
  31975. return void s(t.promise, e)
  31976. }
  31977. a(t.promise, n)
  31978. }))
  31979. }
  31980. function a(e, t) {
  31981. try {
  31982. if (t === e)
  31983. throw new TypeError("A promise cannot be resolved with itself.");
  31984. if (t && ("object" == typeof t || "function" == typeof t)) {
  31985. var i = t.then;
  31986. if (t instanceof r)
  31987. return e._state = 3,
  31988. e._value = t,
  31989. void l(e);
  31990. if ("function" == typeof i)
  31991. return void h(n(i, t), e)
  31992. }
  31993. e._state = 1,
  31994. e._value = t,
  31995. l(e)
  31996. } catch (t) {
  31997. s(e, t)
  31998. }
  31999. }
  32000. function s(e, t) {
  32001. e._state = 2,
  32002. e._value = t,
  32003. l(e)
  32004. }
  32005. function l(e) {
  32006. 2 === e._state && 0 === e._deferreds.length && r._immediateFn(function() {
  32007. e._handled || r._unhandledRejectionFn(e._value)
  32008. });
  32009. for (var t = 0, i = e._deferreds.length; t < i; t++)
  32010. o(e, e._deferreds[t]);
  32011. e._deferreds = null
  32012. }
  32013. function c(e, t, i) {
  32014. this.onFulfilled = "function" == typeof e ? e : null,
  32015. this.onRejected = "function" == typeof t ? t : null,
  32016. this.promise = i
  32017. }
  32018. function h(e, t) {
  32019. var i = !1;
  32020. try {
  32021. e(function(e) {
  32022. i || (i = !0,
  32023. a(t, e))
  32024. }, function(e) {
  32025. i || (i = !0,
  32026. s(t, e))
  32027. })
  32028. } catch (e) {
  32029. if (i)
  32030. return;
  32031. i = !0,
  32032. s(t, e)
  32033. }
  32034. }
  32035. var u = setTimeout;
  32036. r.prototype.catch = function(e) {
  32037. return this.then(null, e)
  32038. }
  32039. ,
  32040. r.prototype.then = function(e, t) {
  32041. var n = new this.constructor(i);
  32042. return o(this, new c(e,t,n)),
  32043. n
  32044. }
  32045. ,
  32046. r.all = function(e) {
  32047. var t = Array.prototype.slice.call(e);
  32048. return new r(function(e, i) {
  32049. function n(o, a) {
  32050. try {
  32051. if (a && ("object" == typeof a || "function" == typeof a)) {
  32052. var s = a.then;
  32053. if ("function" == typeof s)
  32054. return void s.call(a, function(e) {
  32055. n(o, e)
  32056. }, i)
  32057. }
  32058. t[o] = a,
  32059. 0 === --r && e(t)
  32060. } catch (e) {
  32061. i(e)
  32062. }
  32063. }
  32064. if (0 === t.length)
  32065. return e([]);
  32066. for (var r = t.length, o = 0; o < t.length; o++)
  32067. n(o, t[o])
  32068. }
  32069. )
  32070. }
  32071. ,
  32072. r.resolve = function(e) {
  32073. return e && "object" == typeof e && e.constructor === r ? e : new r(function(t) {
  32074. t(e)
  32075. }
  32076. )
  32077. }
  32078. ,
  32079. r.reject = function(e) {
  32080. return new r(function(t, i) {
  32081. i(e)
  32082. }
  32083. )
  32084. }
  32085. ,
  32086. r.race = function(e) {
  32087. return new r(function(t, i) {
  32088. for (var n = 0, r = e.length; n < r; n++)
  32089. e[n].then(t, i)
  32090. }
  32091. )
  32092. }
  32093. ,
  32094. r._immediateFn = "function" == typeof setImmediate && function(e) {
  32095. setImmediate(e)
  32096. }
  32097. || function(e) {
  32098. u(e, 0)
  32099. }
  32100. ,
  32101. r._unhandledRejectionFn = function(e) {
  32102. "undefined" != typeof console && console && console.warn("Possible Unhandled Promise Rejection:", e)
  32103. }
  32104. ,
  32105. r._setImmediateFn = function(e) {
  32106. r._immediateFn = e
  32107. }
  32108. ,
  32109. r._setUnhandledRejectionFn = function(e) {
  32110. r._unhandledRejectionFn = e
  32111. }
  32112. ,
  32113. "undefined" != typeof t && t.exports ? t.exports = r : e.Promise || (e.Promise = r)
  32114. }(this)
  32115. }
  32116. , {}],
  32117. 214: [function(e, t, i) {
  32118. (function(i) {
  32119. !function(i, n) {
  32120. "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)
  32121. }(this, function(t, n) {
  32122. "use strict";
  32123. var r = {};
  32124. return r.ByteBuffer = t,
  32125. r.Long = t.Long || null,
  32126. r.VERSION = "5.0.1",
  32127. r.WIRE_TYPES = {},
  32128. r.WIRE_TYPES.VARINT = 0,
  32129. r.WIRE_TYPES.BITS64 = 1,
  32130. r.WIRE_TYPES.LDELIM = 2,
  32131. r.WIRE_TYPES.STARTGROUP = 3,
  32132. r.WIRE_TYPES.ENDGROUP = 4,
  32133. r.WIRE_TYPES.BITS32 = 5,
  32134. r.PACKABLE_WIRE_TYPES = [r.WIRE_TYPES.VARINT, r.WIRE_TYPES.BITS64, r.WIRE_TYPES.BITS32],
  32135. r.TYPES = {
  32136. int32: {
  32137. name: "int32",
  32138. wireType: r.WIRE_TYPES.VARINT,
  32139. defaultValue: 0
  32140. },
  32141. uint32: {
  32142. name: "uint32",
  32143. wireType: r.WIRE_TYPES.VARINT,
  32144. defaultValue: 0
  32145. },
  32146. sint32: {
  32147. name: "sint32",
  32148. wireType: r.WIRE_TYPES.VARINT,
  32149. defaultValue: 0
  32150. },
  32151. int64: {
  32152. name: "int64",
  32153. wireType: r.WIRE_TYPES.VARINT,
  32154. defaultValue: r.Long ? r.Long.ZERO : void 0
  32155. },
  32156. uint64: {
  32157. name: "uint64",
  32158. wireType: r.WIRE_TYPES.VARINT,
  32159. defaultValue: r.Long ? r.Long.UZERO : void 0
  32160. },
  32161. sint64: {
  32162. name: "sint64",
  32163. wireType: r.WIRE_TYPES.VARINT,
  32164. defaultValue: r.Long ? r.Long.ZERO : void 0
  32165. },
  32166. bool: {
  32167. name: "bool",
  32168. wireType: r.WIRE_TYPES.VARINT,
  32169. defaultValue: !1
  32170. },
  32171. double: {
  32172. name: "double",
  32173. wireType: r.WIRE_TYPES.BITS64,
  32174. defaultValue: 0
  32175. },
  32176. string: {
  32177. name: "string",
  32178. wireType: r.WIRE_TYPES.LDELIM,
  32179. defaultValue: ""
  32180. },
  32181. bytes: {
  32182. name: "bytes",
  32183. wireType: r.WIRE_TYPES.LDELIM,
  32184. defaultValue: null
  32185. },
  32186. fixed32: {
  32187. name: "fixed32",
  32188. wireType: r.WIRE_TYPES.BITS32,
  32189. defaultValue: 0
  32190. },
  32191. sfixed32: {
  32192. name: "sfixed32",
  32193. wireType: r.WIRE_TYPES.BITS32,
  32194. defaultValue: 0
  32195. },
  32196. fixed64: {
  32197. name: "fixed64",
  32198. wireType: r.WIRE_TYPES.BITS64,
  32199. defaultValue: r.Long ? r.Long.UZERO : void 0
  32200. },
  32201. sfixed64: {
  32202. name: "sfixed64",
  32203. wireType: r.WIRE_TYPES.BITS64,
  32204. defaultValue: r.Long ? r.Long.ZERO : void 0
  32205. },
  32206. float: {
  32207. name: "float",
  32208. wireType: r.WIRE_TYPES.BITS32,
  32209. defaultValue: 0
  32210. },
  32211. enum: {
  32212. name: "enum",
  32213. wireType: r.WIRE_TYPES.VARINT,
  32214. defaultValue: 0
  32215. },
  32216. message: {
  32217. name: "message",
  32218. wireType: r.WIRE_TYPES.LDELIM,
  32219. defaultValue: null
  32220. },
  32221. group: {
  32222. name: "group",
  32223. wireType: r.WIRE_TYPES.STARTGROUP,
  32224. defaultValue: null
  32225. }
  32226. },
  32227. 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],
  32228. r.ID_MIN = 1,
  32229. r.ID_MAX = 536870911,
  32230. r.convertFieldsToCamelCase = !1,
  32231. r.populateAccessors = !0,
  32232. r.populateDefaults = !0,
  32233. r.Util = function() {
  32234. var t = {};
  32235. return t.IS_NODE = !("object" != typeof i || i + "" != "[object process]" || i.browser),
  32236. t.XHR = function() {
  32237. for (var e = [function() {
  32238. return new XMLHttpRequest
  32239. }
  32240. , function() {
  32241. return new ActiveXObject("Msxml2.XMLHTTP")
  32242. }
  32243. , function() {
  32244. return new ActiveXObject("Msxml3.XMLHTTP")
  32245. }
  32246. , function() {
  32247. return new ActiveXObject("Microsoft.XMLHTTP")
  32248. }
  32249. ], t = null, i = 0; i < e.length; i++) {
  32250. try {
  32251. t = e[i]()
  32252. } catch (e) {
  32253. continue
  32254. }
  32255. break
  32256. }
  32257. if (!t)
  32258. throw Error("XMLHttpRequest is not supported");
  32259. return t
  32260. }
  32261. ,
  32262. t.fetch = function(i, n) {
  32263. if (n && "function" != typeof n && (n = null),
  32264. t.IS_NODE) {
  32265. var r = e("fs");
  32266. if (n)
  32267. r.readFile(i, function(e, t) {
  32268. n(e ? null : "" + t)
  32269. });
  32270. else
  32271. try {
  32272. return r.readFileSync(i)
  32273. } catch (e) {
  32274. return null
  32275. }
  32276. } else {
  32277. var o = t.XHR();
  32278. if (o.open("GET", i, !!n),
  32279. o.setRequestHeader("Accept", "text/plain"),
  32280. "function" == typeof o.overrideMimeType && o.overrideMimeType("text/plain"),
  32281. !n)
  32282. return o.send(null),
  32283. 200 == o.status || 0 == o.status && "string" == typeof o.responseText ? o.responseText : null;
  32284. if (o.onreadystatechange = function() {
  32285. 4 == o.readyState && n(200 == o.status || 0 == o.status && "string" == typeof o.responseText ? o.responseText : null)
  32286. }
  32287. ,
  32288. 4 == o.readyState)
  32289. return;
  32290. o.send(null)
  32291. }
  32292. }
  32293. ,
  32294. t.toCamelCase = function(e) {
  32295. return e.replace(/_([a-zA-Z])/g, function(e, t) {
  32296. return t.toUpperCase()
  32297. })
  32298. }
  32299. ,
  32300. t
  32301. }(),
  32302. r.Lang = {
  32303. DELIM: /[\s\{\}=;:\[\],'"\(\)<>]/g,
  32304. RULE: /^(?:required|optional|repeated|map)$/,
  32305. TYPE: /^(?:double|float|int32|uint32|sint32|int64|uint64|sint64|fixed32|sfixed32|fixed64|sfixed64|bool|string|bytes)$/,
  32306. NAME: /^[a-zA-Z_][a-zA-Z_0-9]*$/,
  32307. TYPEDEF: /^[a-zA-Z][a-zA-Z_0-9]*$/,
  32308. TYPEREF: /^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)+$/,
  32309. FQTYPEREF: /^(?:\.[a-zA-Z][a-zA-Z_0-9]*)+$/,
  32310. NUMBER: /^-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+|([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?)|inf|nan)$/,
  32311. NUMBER_DEC: /^(?:[1-9][0-9]*|0)$/,
  32312. NUMBER_HEX: /^0[xX][0-9a-fA-F]+$/,
  32313. NUMBER_OCT: /^0[0-7]+$/,
  32314. NUMBER_FLT: /^([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?|inf|nan)$/,
  32315. BOOL: /^(?:true|false)$/i,
  32316. ID: /^(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,
  32317. NEGID: /^\-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,
  32318. WHITESPACE: /\s/,
  32319. STRING: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")|(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,
  32320. STRING_DQ: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,
  32321. STRING_SQ: /(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g
  32322. },
  32323. r.DotProto = function(e, t) {
  32324. function i(e, i) {
  32325. var n = -1
  32326. , r = 1;
  32327. if ("-" == e.charAt(0) && (r = -1,
  32328. e = e.substring(1)),
  32329. t.NUMBER_DEC.test(e))
  32330. n = parseInt(e);
  32331. else if (t.NUMBER_HEX.test(e))
  32332. n = parseInt(e.substring(2), 16);
  32333. else {
  32334. if (!t.NUMBER_OCT.test(e))
  32335. throw Error("illegal id value: " + (r < 0 ? "-" : "") + e);
  32336. n = parseInt(e.substring(1), 8)
  32337. }
  32338. if (n = r * n | 0,
  32339. !i && n < 0)
  32340. throw Error("illegal id value: " + (r < 0 ? "-" : "") + e);
  32341. return n
  32342. }
  32343. function n(e) {
  32344. var i = 1;
  32345. if ("-" == e.charAt(0) && (i = -1,
  32346. e = e.substring(1)),
  32347. t.NUMBER_DEC.test(e))
  32348. return i * parseInt(e, 10);
  32349. if (t.NUMBER_HEX.test(e))
  32350. return i * parseInt(e.substring(2), 16);
  32351. if (t.NUMBER_OCT.test(e))
  32352. return i * parseInt(e.substring(1), 8);
  32353. if ("inf" === e)
  32354. return i * (1 / 0);
  32355. if ("nan" === e)
  32356. return NaN;
  32357. if (t.NUMBER_FLT.test(e))
  32358. return i * parseFloat(e);
  32359. throw Error("illegal number value: " + (i < 0 ? "-" : "") + e)
  32360. }
  32361. function r(e, t, i) {
  32362. "undefined" == typeof e[t] ? e[t] = i : (Array.isArray(e[t]) || (e[t] = [e[t]]),
  32363. e[t].push(i))
  32364. }
  32365. var o = {}
  32366. , a = function(e) {
  32367. this.source = e + "",
  32368. this.index = 0,
  32369. this.line = 1,
  32370. this.stack = [],
  32371. this._stringOpen = null
  32372. }
  32373. , s = a.prototype;
  32374. s._readString = function() {
  32375. var e = '"' === this._stringOpen ? t.STRING_DQ : t.STRING_SQ;
  32376. e.lastIndex = this.index - 1;
  32377. var i = e.exec(this.source);
  32378. if (!i)
  32379. throw Error("unterminated string");
  32380. return this.index = e.lastIndex,
  32381. this.stack.push(this._stringOpen),
  32382. this._stringOpen = null,
  32383. i[1]
  32384. }
  32385. ,
  32386. s.next = function() {
  32387. if (this.stack.length > 0)
  32388. return this.stack.shift();
  32389. if (this.index >= this.source.length)
  32390. return null;
  32391. if (null !== this._stringOpen)
  32392. return this._readString();
  32393. var e, i, n;
  32394. do {
  32395. for (e = !1; t.WHITESPACE.test(n = this.source.charAt(this.index)); )
  32396. if ("\n" === n && ++this.line,
  32397. ++this.index === this.source.length)
  32398. return null;
  32399. if ("/" === this.source.charAt(this.index))
  32400. if (++this.index,
  32401. "/" === this.source.charAt(this.index)) {
  32402. for (; "\n" !== this.source.charAt(++this.index); )
  32403. if (this.index == this.source.length)
  32404. return null;
  32405. ++this.index,
  32406. ++this.line,
  32407. e = !0
  32408. } else {
  32409. if ("*" !== (n = this.source.charAt(this.index)))
  32410. return "/";
  32411. do {
  32412. if ("\n" === n && ++this.line,
  32413. ++this.index === this.source.length)
  32414. return null;
  32415. i = n,
  32416. n = this.source.charAt(this.index)
  32417. } while ("*" !== i || "/" !== n);++this.index,
  32418. e = !0
  32419. }
  32420. } while (e);if (this.index === this.source.length)
  32421. return null;
  32422. var r = this.index;
  32423. t.DELIM.lastIndex = 0;
  32424. var o = t.DELIM.test(this.source.charAt(r++));
  32425. if (!o)
  32426. for (; r < this.source.length && !t.DELIM.test(this.source.charAt(r)); )
  32427. ++r;
  32428. var a = this.source.substring(this.index, this.index = r);
  32429. return '"' !== a && "'" !== a || (this._stringOpen = a),
  32430. a
  32431. }
  32432. ,
  32433. s.peek = function() {
  32434. if (0 === this.stack.length) {
  32435. var e = this.next();
  32436. if (null === e)
  32437. return null;
  32438. this.stack.push(e)
  32439. }
  32440. return this.stack[0]
  32441. }
  32442. ,
  32443. s.skip = function(e) {
  32444. var t = this.next();
  32445. if (t !== e)
  32446. throw Error("illegal '" + t + "', '" + e + "' expected")
  32447. }
  32448. ,
  32449. s.omit = function(e) {
  32450. return this.peek() === e && (this.next(),
  32451. !0)
  32452. }
  32453. ,
  32454. s.toString = function() {
  32455. return "Tokenizer (" + this.index + "/" + this.source.length + " at line " + this.line + ")"
  32456. }
  32457. ,
  32458. o.Tokenizer = a;
  32459. var l = function(e) {
  32460. this.tn = new a(e),
  32461. this.proto3 = !1
  32462. }
  32463. , c = l.prototype;
  32464. return c.parse = function() {
  32465. var e, i, n = {
  32466. name: "[ROOT]",
  32467. package: null,
  32468. messages: [],
  32469. enums: [],
  32470. imports: [],
  32471. options: {},
  32472. services: []
  32473. }, r = !0;
  32474. try {
  32475. for (; e = this.tn.next(); )
  32476. switch (e) {
  32477. case "package":
  32478. if (!r || null !== n.package)
  32479. throw Error("unexpected 'package'");
  32480. if (e = this.tn.next(),
  32481. !t.TYPEREF.test(e))
  32482. throw Error("illegal package name: " + e);
  32483. this.tn.skip(";"),
  32484. n.package = e;
  32485. break;
  32486. case "import":
  32487. if (!r)
  32488. throw Error("unexpected 'import'");
  32489. e = this.tn.peek(),
  32490. ("public" === e || (i = "weak" === e)) && this.tn.next(),
  32491. e = this._readString(),
  32492. this.tn.skip(";"),
  32493. i || n.imports.push(e);
  32494. break;
  32495. case "syntax":
  32496. if (!r)
  32497. throw Error("unexpected 'syntax'");
  32498. this.tn.skip("="),
  32499. "proto3" === (n.syntax = this._readString()) && (this.proto3 = !0),
  32500. this.tn.skip(";");
  32501. break;
  32502. case "message":
  32503. this._parseMessage(n, null),
  32504. r = !1;
  32505. break;
  32506. case "enum":
  32507. this._parseEnum(n),
  32508. r = !1;
  32509. break;
  32510. case "option":
  32511. this._parseOption(n);
  32512. break;
  32513. case "service":
  32514. this._parseService(n);
  32515. break;
  32516. case "extend":
  32517. this._parseExtend(n);
  32518. break;
  32519. default:
  32520. throw Error("unexpected '" + e + "'")
  32521. }
  32522. } catch (e) {
  32523. throw e.message = "Parse error at line " + this.tn.line + ": " + e.message,
  32524. e
  32525. }
  32526. return delete n.name,
  32527. n
  32528. }
  32529. ,
  32530. l.parse = function(e) {
  32531. return new l(e).parse()
  32532. }
  32533. ,
  32534. c._readString = function() {
  32535. var e, t, i = "";
  32536. do {
  32537. if (t = this.tn.next(),
  32538. "'" !== t && '"' !== t)
  32539. throw Error("illegal string delimiter: " + t);
  32540. i += this.tn.next(),
  32541. this.tn.skip(t),
  32542. e = this.tn.peek()
  32543. } while ('"' === e || '"' === e);return i
  32544. }
  32545. ,
  32546. c._readValue = function(e) {
  32547. var i = this.tn.peek();
  32548. if ('"' === i || "'" === i)
  32549. return this._readString();
  32550. if (this.tn.next(),
  32551. t.NUMBER.test(i))
  32552. return n(i);
  32553. if (t.BOOL.test(i))
  32554. return "true" === i.toLowerCase();
  32555. if (e && t.TYPEREF.test(i))
  32556. return i;
  32557. throw Error("illegal value: " + i)
  32558. }
  32559. ,
  32560. c._parseOption = function(e, i) {
  32561. var n = this.tn.next()
  32562. , r = !1;
  32563. if ("(" === n && (r = !0,
  32564. n = this.tn.next()),
  32565. !t.TYPEREF.test(n))
  32566. throw Error("illegal option name: " + n);
  32567. var o = n;
  32568. r && (this.tn.skip(")"),
  32569. o = "(" + o + ")",
  32570. n = this.tn.peek(),
  32571. t.FQTYPEREF.test(n) && (o += n,
  32572. this.tn.next())),
  32573. this.tn.skip("="),
  32574. this._parseOptionValue(e, o),
  32575. i || this.tn.skip(";")
  32576. }
  32577. ,
  32578. c._parseOptionValue = function(e, i) {
  32579. var n = this.tn.peek();
  32580. if ("{" !== n)
  32581. r(e.options, i, this._readValue(!0));
  32582. else
  32583. for (this.tn.skip("{"); "}" !== (n = this.tn.next()); ) {
  32584. if (!t.NAME.test(n))
  32585. throw Error("illegal option name: " + i + "." + n);
  32586. this.tn.omit(":") ? r(e.options, i + "." + n, this._readValue(!0)) : this._parseOptionValue(e, i + "." + n)
  32587. }
  32588. }
  32589. ,
  32590. c._parseService = function(e) {
  32591. var i = this.tn.next();
  32592. if (!t.NAME.test(i))
  32593. throw Error("illegal service name at line " + this.tn.line + ": " + i);
  32594. var n = i
  32595. , r = {
  32596. name: n,
  32597. rpc: {},
  32598. options: {}
  32599. };
  32600. for (this.tn.skip("{"); "}" !== (i = this.tn.next()); )
  32601. if ("option" === i)
  32602. this._parseOption(r);
  32603. else {
  32604. if ("rpc" !== i)
  32605. throw Error("illegal service token: " + i);
  32606. this._parseServiceRPC(r)
  32607. }
  32608. this.tn.omit(";"),
  32609. e.services.push(r)
  32610. }
  32611. ,
  32612. c._parseServiceRPC = function(e) {
  32613. var i = "rpc"
  32614. , n = this.tn.next();
  32615. if (!t.NAME.test(n))
  32616. throw Error("illegal rpc service method name: " + n);
  32617. var r = n
  32618. , o = {
  32619. request: null,
  32620. response: null,
  32621. request_stream: !1,
  32622. response_stream: !1,
  32623. options: {}
  32624. };
  32625. if (this.tn.skip("("),
  32626. n = this.tn.next(),
  32627. "stream" === n.toLowerCase() && (o.request_stream = !0,
  32628. n = this.tn.next()),
  32629. !t.TYPEREF.test(n))
  32630. throw Error("illegal rpc service request type: " + n);
  32631. if (o.request = n,
  32632. this.tn.skip(")"),
  32633. n = this.tn.next(),
  32634. "returns" !== n.toLowerCase())
  32635. throw Error("illegal rpc service request type delimiter: " + n);
  32636. if (this.tn.skip("("),
  32637. n = this.tn.next(),
  32638. "stream" === n.toLowerCase() && (o.response_stream = !0,
  32639. n = this.tn.next()),
  32640. o.response = n,
  32641. this.tn.skip(")"),
  32642. n = this.tn.peek(),
  32643. "{" === n) {
  32644. for (this.tn.next(); "}" !== (n = this.tn.next()); ) {
  32645. if ("option" !== n)
  32646. throw Error("illegal rpc service token: " + n);
  32647. this._parseOption(o)
  32648. }
  32649. this.tn.omit(";")
  32650. } else
  32651. this.tn.skip(";");
  32652. "undefined" == typeof e[i] && (e[i] = {}),
  32653. e[i][r] = o
  32654. }
  32655. ,
  32656. c._parseMessage = function(e, n) {
  32657. var r = !!n
  32658. , o = this.tn.next()
  32659. , a = {
  32660. name: "",
  32661. fields: [],
  32662. enums: [],
  32663. messages: [],
  32664. options: {},
  32665. services: [],
  32666. oneofs: {}
  32667. };
  32668. if (!t.NAME.test(o))
  32669. throw Error("illegal " + (r ? "group" : "message") + " name: " + o);
  32670. for (a.name = o,
  32671. r && (this.tn.skip("="),
  32672. n.id = i(this.tn.next()),
  32673. a.isGroup = !0),
  32674. o = this.tn.peek(),
  32675. "[" === o && n && this._parseFieldOptions(n),
  32676. this.tn.skip("{"); "}" !== (o = this.tn.next()); )
  32677. if (t.RULE.test(o))
  32678. this._parseMessageField(a, o);
  32679. else if ("oneof" === o)
  32680. this._parseMessageOneOf(a);
  32681. else if ("enum" === o)
  32682. this._parseEnum(a);
  32683. else if ("message" === o)
  32684. this._parseMessage(a);
  32685. else if ("option" === o)
  32686. this._parseOption(a);
  32687. else if ("service" === o)
  32688. this._parseService(a);
  32689. else if ("extensions" === o)
  32690. a.extensions = this._parseExtensionRanges();
  32691. else if ("reserved" === o)
  32692. this._parseIgnored();
  32693. else if ("extend" === o)
  32694. this._parseExtend(a);
  32695. else {
  32696. if (!t.TYPEREF.test(o))
  32697. throw Error("illegal message token: " + o);
  32698. if (!this.proto3)
  32699. throw Error("illegal field rule: " + o);
  32700. this._parseMessageField(a, "optional", o)
  32701. }
  32702. return this.tn.omit(";"),
  32703. e.messages.push(a),
  32704. a
  32705. }
  32706. ,
  32707. c._parseIgnored = function() {
  32708. for (; ";" !== this.tn.peek(); )
  32709. this.tn.next();
  32710. this.tn.skip(";")
  32711. }
  32712. ,
  32713. c._parseMessageField = function(e, n, r) {
  32714. if (!t.RULE.test(n))
  32715. throw Error("illegal message field rule: " + n);
  32716. var o, a = {
  32717. rule: n,
  32718. type: "",
  32719. name: "",
  32720. options: {},
  32721. id: 0
  32722. };
  32723. if ("map" === n) {
  32724. if (r)
  32725. throw Error("illegal type: " + r);
  32726. if (this.tn.skip("<"),
  32727. o = this.tn.next(),
  32728. !t.TYPE.test(o) && !t.TYPEREF.test(o))
  32729. throw Error("illegal message field type: " + o);
  32730. if (a.keytype = o,
  32731. this.tn.skip(","),
  32732. o = this.tn.next(),
  32733. !t.TYPE.test(o) && !t.TYPEREF.test(o))
  32734. throw Error("illegal message field: " + o);
  32735. if (a.type = o,
  32736. this.tn.skip(">"),
  32737. o = this.tn.next(),
  32738. !t.NAME.test(o))
  32739. throw Error("illegal message field name: " + o);
  32740. a.name = o,
  32741. this.tn.skip("="),
  32742. a.id = i(this.tn.next()),
  32743. o = this.tn.peek(),
  32744. "[" === o && this._parseFieldOptions(a),
  32745. this.tn.skip(";")
  32746. } else if (r = "undefined" != typeof r ? r : this.tn.next(),
  32747. "group" === r) {
  32748. var s = this._parseMessage(e, a);
  32749. if (!/^[A-Z]/.test(s.name))
  32750. throw Error("illegal group name: " + s.name);
  32751. a.type = s.name,
  32752. a.name = s.name.toLowerCase(),
  32753. this.tn.omit(";")
  32754. } else {
  32755. if (!t.TYPE.test(r) && !t.TYPEREF.test(r))
  32756. throw Error("illegal message field type: " + r);
  32757. if (a.type = r,
  32758. o = this.tn.next(),
  32759. !t.NAME.test(o))
  32760. throw Error("illegal message field name: " + o);
  32761. a.name = o,
  32762. this.tn.skip("="),
  32763. a.id = i(this.tn.next()),
  32764. o = this.tn.peek(),
  32765. "[" === o && this._parseFieldOptions(a),
  32766. this.tn.skip(";")
  32767. }
  32768. return e.fields.push(a),
  32769. a
  32770. }
  32771. ,
  32772. c._parseMessageOneOf = function(e) {
  32773. var i = this.tn.next();
  32774. if (!t.NAME.test(i))
  32775. throw Error("illegal oneof name: " + i);
  32776. var n, r = i, o = [];
  32777. for (this.tn.skip("{"); "}" !== (i = this.tn.next()); )
  32778. n = this._parseMessageField(e, "optional", i),
  32779. n.oneof = r,
  32780. o.push(n.id);
  32781. this.tn.omit(";"),
  32782. e.oneofs[r] = o
  32783. }
  32784. ,
  32785. c._parseFieldOptions = function(e) {
  32786. this.tn.skip("[");
  32787. for (var t, i = !0; "]" !== (t = this.tn.peek()); )
  32788. i || this.tn.skip(","),
  32789. this._parseOption(e, !0),
  32790. i = !1;
  32791. this.tn.next()
  32792. }
  32793. ,
  32794. c._parseEnum = function(e) {
  32795. var n = {
  32796. name: "",
  32797. values: [],
  32798. options: {}
  32799. }
  32800. , r = this.tn.next();
  32801. if (!t.NAME.test(r))
  32802. throw Error("illegal name: " + r);
  32803. for (n.name = r,
  32804. this.tn.skip("{"); "}" !== (r = this.tn.next()); )
  32805. if ("option" === r)
  32806. this._parseOption(n);
  32807. else {
  32808. if (!t.NAME.test(r))
  32809. throw Error("illegal name: " + r);
  32810. this.tn.skip("=");
  32811. var o = {
  32812. name: r,
  32813. id: i(this.tn.next(), !0)
  32814. };
  32815. r = this.tn.peek(),
  32816. "[" === r && this._parseFieldOptions({
  32817. options: {}
  32818. }),
  32819. this.tn.skip(";"),
  32820. n.values.push(o)
  32821. }
  32822. this.tn.omit(";"),
  32823. e.enums.push(n)
  32824. }
  32825. ,
  32826. c._parseExtensionRanges = function() {
  32827. var t, i, r, o = [];
  32828. do {
  32829. for (i = []; ; ) {
  32830. switch (t = this.tn.next()) {
  32831. case "min":
  32832. r = e.ID_MIN;
  32833. break;
  32834. case "max":
  32835. r = e.ID_MAX;
  32836. break;
  32837. default:
  32838. r = n(t)
  32839. }
  32840. if (i.push(r),
  32841. 2 === i.length)
  32842. break;
  32843. if ("to" !== this.tn.peek()) {
  32844. i.push(r);
  32845. break
  32846. }
  32847. this.tn.next()
  32848. }
  32849. o.push(i)
  32850. } while (this.tn.omit(","));return this.tn.skip(";"),
  32851. o
  32852. }
  32853. ,
  32854. c._parseExtend = function(e) {
  32855. var i = this.tn.next();
  32856. if (!t.TYPEREF.test(i))
  32857. throw Error("illegal extend reference: " + i);
  32858. var n = {
  32859. ref: i,
  32860. fields: []
  32861. };
  32862. for (this.tn.skip("{"); "}" !== (i = this.tn.next()); )
  32863. if (t.RULE.test(i))
  32864. this._parseMessageField(n, i);
  32865. else {
  32866. if (!t.TYPEREF.test(i))
  32867. throw Error("illegal extend token: " + i);
  32868. if (!this.proto3)
  32869. throw Error("illegal field rule: " + i);
  32870. this._parseMessageField(n, "optional", i)
  32871. }
  32872. return this.tn.omit(";"),
  32873. e.messages.push(n),
  32874. n
  32875. }
  32876. ,
  32877. c.toString = function() {
  32878. return "Parser at line " + this.tn.line
  32879. }
  32880. ,
  32881. o.Parser = l,
  32882. o
  32883. }(r, r.Lang),
  32884. r.Reflect = function(e) {
  32885. function i(i) {
  32886. if ("string" == typeof i && (i = e.TYPES[i]),
  32887. "undefined" == typeof i.defaultValue)
  32888. throw Error("default value for type " + i.name + " is not supported");
  32889. return i == e.TYPES.bytes ? new t(0) : i.defaultValue
  32890. }
  32891. function n(t, i) {
  32892. if (t && "number" == typeof t.low && "number" == typeof t.high && "boolean" == typeof t.unsigned && t.low === t.low && t.high === t.high)
  32893. return new e.Long(t.low,t.high,"undefined" == typeof i ? t.unsigned : i);
  32894. if ("string" == typeof t)
  32895. return e.Long.fromString(t, i || !1, 10);
  32896. if ("number" == typeof t)
  32897. return e.Long.fromNumber(t, i || !1);
  32898. throw Error("not convertible to Long")
  32899. }
  32900. function r(t, i) {
  32901. var n = i.readVarint32()
  32902. , o = 7 & n
  32903. , a = n >>> 3;
  32904. switch (o) {
  32905. case e.WIRE_TYPES.VARINT:
  32906. do
  32907. n = i.readUint8();
  32908. while (128 === (128 & n));break;
  32909. case e.WIRE_TYPES.BITS64:
  32910. i.offset += 8;
  32911. break;
  32912. case e.WIRE_TYPES.LDELIM:
  32913. n = i.readVarint32(),
  32914. i.offset += n;
  32915. break;
  32916. case e.WIRE_TYPES.STARTGROUP:
  32917. r(a, i);
  32918. break;
  32919. case e.WIRE_TYPES.ENDGROUP:
  32920. if (a === t)
  32921. return !1;
  32922. throw Error("Illegal GROUPEND after unknown group: " + a + " (" + t + " expected)");
  32923. case e.WIRE_TYPES.BITS32:
  32924. i.offset += 4;
  32925. break;
  32926. default:
  32927. throw Error("Illegal wire type in unknown group " + t + ": " + o)
  32928. }
  32929. return !0
  32930. }
  32931. var o = {}
  32932. , a = function(e, t, i) {
  32933. this.builder = e,
  32934. this.parent = t,
  32935. this.name = i,
  32936. this.className
  32937. }
  32938. , s = a.prototype;
  32939. s.fqn = function() {
  32940. for (var e = this.name, t = this; ; ) {
  32941. if (t = t.parent,
  32942. null == t)
  32943. break;
  32944. e = t.name + "." + e
  32945. }
  32946. return e
  32947. }
  32948. ,
  32949. s.toString = function(e) {
  32950. return (e ? this.className + " " : "") + this.fqn()
  32951. }
  32952. ,
  32953. s.build = function() {
  32954. throw Error(this.toString(!0) + " cannot be built directly")
  32955. }
  32956. ,
  32957. o.T = a;
  32958. var l = function(e, t, i, n, r) {
  32959. a.call(this, e, t, i),
  32960. this.className = "Namespace",
  32961. this.children = [],
  32962. this.options = n || {},
  32963. this.syntax = r || "proto2"
  32964. }
  32965. , c = l.prototype = Object.create(a.prototype);
  32966. c.getChildren = function(e) {
  32967. if (e = e || null,
  32968. null == e)
  32969. return this.children.slice();
  32970. for (var t = [], i = 0, n = this.children.length; i < n; ++i)
  32971. this.children[i]instanceof e && t.push(this.children[i]);
  32972. return t
  32973. }
  32974. ,
  32975. c.addChild = function(e) {
  32976. var t;
  32977. if (t = this.getChild(e.name))
  32978. if (t instanceof d.Field && t.name !== t.originalName && null === this.getChild(t.originalName))
  32979. t.name = t.originalName;
  32980. else {
  32981. if (!(e instanceof d.Field && e.name !== e.originalName && null === this.getChild(e.originalName)))
  32982. throw Error("Duplicate name in namespace " + this.toString(!0) + ": " + e.name);
  32983. e.name = e.originalName
  32984. }
  32985. this.children.push(e)
  32986. }
  32987. ,
  32988. c.getChild = function(e) {
  32989. for (var t = "number" == typeof e ? "id" : "name", i = 0, n = this.children.length; i < n; ++i)
  32990. if (this.children[i][t] === e)
  32991. return this.children[i];
  32992. return null
  32993. }
  32994. ,
  32995. c.resolve = function(e, t) {
  32996. var i = "string" == typeof e ? e.split(".") : e
  32997. , n = this
  32998. , r = 0;
  32999. if ("" === i[r]) {
  33000. for (; null !== n.parent; )
  33001. n = n.parent;
  33002. r++
  33003. }
  33004. var a;
  33005. do {
  33006. do {
  33007. if (!(n instanceof o.Namespace)) {
  33008. n = null;
  33009. break
  33010. }
  33011. if (a = n.getChild(i[r]),
  33012. !a || !(a instanceof o.T) || t && !(a instanceof o.Namespace)) {
  33013. n = null;
  33014. break
  33015. }
  33016. n = a,
  33017. r++
  33018. } while (r < i.length);if (null != n)
  33019. break;
  33020. if (null !== this.parent)
  33021. return this.parent.resolve(e, t)
  33022. } while (null != n);return n
  33023. }
  33024. ,
  33025. c.qn = function(e) {
  33026. var t = []
  33027. , i = e;
  33028. do
  33029. t.unshift(i.name),
  33030. i = i.parent;
  33031. while (null !== i);for (var n = 1; n <= t.length; n++) {
  33032. var r = t.slice(t.length - n);
  33033. if (e === this.resolve(r, e instanceof o.Namespace))
  33034. return r.join(".")
  33035. }
  33036. return e.fqn()
  33037. }
  33038. ,
  33039. c.build = function() {
  33040. for (var e, t = {}, i = this.children, n = 0, r = i.length; n < r; ++n)
  33041. e = i[n],
  33042. e instanceof l && (t[e.name] = e.build());
  33043. return Object.defineProperty && Object.defineProperty(t, "$options", {
  33044. value: this.buildOpt()
  33045. }),
  33046. t
  33047. }
  33048. ,
  33049. c.buildOpt = function() {
  33050. for (var e = {}, t = Object.keys(this.options), i = 0, n = t.length; i < n; ++i) {
  33051. var r = t[i]
  33052. , o = this.options[t[i]];
  33053. e[r] = o
  33054. }
  33055. return e
  33056. }
  33057. ,
  33058. c.getOption = function(e) {
  33059. return "undefined" == typeof e ? this.options : "undefined" != typeof this.options[e] ? this.options[e] : null
  33060. }
  33061. ,
  33062. o.Namespace = l;
  33063. var h = function(t, i, n, r) {
  33064. if (this.type = t,
  33065. this.resolvedType = i,
  33066. this.isMapKey = n,
  33067. this.syntax = r,
  33068. n && e.MAP_KEY_TYPES.indexOf(t) < 0)
  33069. throw Error("Invalid map key type: " + t.name)
  33070. }
  33071. , u = h.prototype;
  33072. h.defaultFieldValue = i,
  33073. u.verifyValue = function(i) {
  33074. function r(e, t) {
  33075. throw Error("Illegal value for " + o.toString(!0) + " of type " + o.type.name + ": " + e + " (" + t + ")")
  33076. }
  33077. var o = this;
  33078. switch (this.type) {
  33079. case e.TYPES.int32:
  33080. case e.TYPES.sint32:
  33081. case e.TYPES.sfixed32:
  33082. return ("number" != typeof i || i === i && i % 1 !== 0) && r(typeof i, "not an integer"),
  33083. i > 4294967295 ? 0 | i : i;
  33084. case e.TYPES.uint32:
  33085. case e.TYPES.fixed32:
  33086. return ("number" != typeof i || i === i && i % 1 !== 0) && r(typeof i, "not an integer"),
  33087. i < 0 ? i >>> 0 : i;
  33088. case e.TYPES.int64:
  33089. case e.TYPES.sint64:
  33090. case e.TYPES.sfixed64:
  33091. if (e.Long)
  33092. try {
  33093. return n(i, !1)
  33094. } catch (e) {
  33095. r(typeof i, e.message)
  33096. }
  33097. else
  33098. r(typeof i, "requires Long.js");
  33099. case e.TYPES.uint64:
  33100. case e.TYPES.fixed64:
  33101. if (e.Long)
  33102. try {
  33103. return n(i, !0)
  33104. } catch (e) {
  33105. r(typeof i, e.message)
  33106. }
  33107. else
  33108. r(typeof i, "requires Long.js");
  33109. case e.TYPES.bool:
  33110. return "boolean" != typeof i && r(typeof i, "not a boolean"),
  33111. i;
  33112. case e.TYPES.float:
  33113. case e.TYPES.double:
  33114. return "number" != typeof i && r(typeof i, "not a number"),
  33115. i;
  33116. case e.TYPES.string:
  33117. return "string" == typeof i || i && i instanceof String || r(typeof i, "not a string"),
  33118. "" + i;
  33119. case e.TYPES.bytes:
  33120. return t.isByteBuffer(i) ? i : t.wrap(i, "base64");
  33121. case e.TYPES.enum:
  33122. var a = this.resolvedType.getChildren(e.Reflect.Enum.Value);
  33123. for (l = 0; l < a.length; l++) {
  33124. if (a[l].name == i)
  33125. return a[l].id;
  33126. if (a[l].id == i)
  33127. return a[l].id
  33128. }
  33129. if ("proto3" === this.syntax)
  33130. return ("number" != typeof i || i === i && i % 1 !== 0) && r(typeof i, "not an integer"),
  33131. (i > 4294967295 || i < 0) && r(typeof i, "not in range for uint32"),
  33132. i;
  33133. r(i, "not a valid enum value");
  33134. case e.TYPES.group:
  33135. case e.TYPES.message:
  33136. if (i && "object" == typeof i || r(typeof i, "object expected"),
  33137. i instanceof this.resolvedType.clazz)
  33138. return i;
  33139. if (i instanceof e.Builder.Message) {
  33140. var s = {};
  33141. for (var l in i)
  33142. i.hasOwnProperty(l) && (s[l] = i[l]);
  33143. i = s
  33144. }
  33145. return new this.resolvedType.clazz(i)
  33146. }
  33147. throw Error("[INTERNAL] Illegal value for " + this.toString(!0) + ": " + i + " (undefined type " + this.type + ")")
  33148. }
  33149. ,
  33150. u.calculateLength = function(i, n) {
  33151. if (null === n)
  33152. return 0;
  33153. var r;
  33154. switch (this.type) {
  33155. case e.TYPES.int32:
  33156. return n < 0 ? t.calculateVarint64(n) : t.calculateVarint32(n);
  33157. case e.TYPES.uint32:
  33158. return t.calculateVarint32(n);
  33159. case e.TYPES.sint32:
  33160. return t.calculateVarint32(t.zigZagEncode32(n));
  33161. case e.TYPES.fixed32:
  33162. case e.TYPES.sfixed32:
  33163. case e.TYPES.float:
  33164. return 4;
  33165. case e.TYPES.int64:
  33166. case e.TYPES.uint64:
  33167. return t.calculateVarint64(n);
  33168. case e.TYPES.sint64:
  33169. return t.calculateVarint64(t.zigZagEncode64(n));
  33170. case e.TYPES.fixed64:
  33171. case e.TYPES.sfixed64:
  33172. return 8;
  33173. case e.TYPES.bool:
  33174. return 1;
  33175. case e.TYPES.enum:
  33176. return t.calculateVarint32(n);
  33177. case e.TYPES.double:
  33178. return 8;
  33179. case e.TYPES.string:
  33180. return r = t.calculateUTF8Bytes(n),
  33181. t.calculateVarint32(r) + r;
  33182. case e.TYPES.bytes:
  33183. if (n.remaining() < 0)
  33184. throw Error("Illegal value for " + this.toString(!0) + ": " + n.remaining() + " bytes remaining");
  33185. return t.calculateVarint32(n.remaining()) + n.remaining();
  33186. case e.TYPES.message:
  33187. return r = this.resolvedType.calculate(n),
  33188. t.calculateVarint32(r) + r;
  33189. case e.TYPES.group:
  33190. return r = this.resolvedType.calculate(n),
  33191. r + t.calculateVarint32(i << 3 | e.WIRE_TYPES.ENDGROUP)
  33192. }
  33193. throw Error("[INTERNAL] Illegal value to encode in " + this.toString(!0) + ": " + n + " (unknown type)")
  33194. }
  33195. ,
  33196. u.encodeValue = function(i, n, r) {
  33197. if (null === n)
  33198. return r;
  33199. switch (this.type) {
  33200. case e.TYPES.int32:
  33201. n < 0 ? r.writeVarint64(n) : r.writeVarint32(n);
  33202. break;
  33203. case e.TYPES.uint32:
  33204. r.writeVarint32(n);
  33205. break;
  33206. case e.TYPES.sint32:
  33207. r.writeVarint32ZigZag(n);
  33208. break;
  33209. case e.TYPES.fixed32:
  33210. r.writeUint32(n);
  33211. break;
  33212. case e.TYPES.sfixed32:
  33213. r.writeInt32(n);
  33214. break;
  33215. case e.TYPES.int64:
  33216. case e.TYPES.uint64:
  33217. r.writeVarint64(n);
  33218. break;
  33219. case e.TYPES.sint64:
  33220. r.writeVarint64ZigZag(n);
  33221. break;
  33222. case e.TYPES.fixed64:
  33223. r.writeUint64(n);
  33224. break;
  33225. case e.TYPES.sfixed64:
  33226. r.writeInt64(n);
  33227. break;
  33228. case e.TYPES.bool:
  33229. "string" == typeof n ? r.writeVarint32("false" === n.toLowerCase() ? 0 : !!n) : r.writeVarint32(n ? 1 : 0);
  33230. break;
  33231. case e.TYPES.enum:
  33232. r.writeVarint32(n);
  33233. break;
  33234. case e.TYPES.float:
  33235. r.writeFloat32(n);
  33236. break;
  33237. case e.TYPES.double:
  33238. r.writeFloat64(n);
  33239. break;
  33240. case e.TYPES.string:
  33241. r.writeVString(n);
  33242. break;
  33243. case e.TYPES.bytes:
  33244. if (n.remaining() < 0)
  33245. throw Error("Illegal value for " + this.toString(!0) + ": " + n.remaining() + " bytes remaining");
  33246. var o = n.offset;
  33247. r.writeVarint32(n.remaining()),
  33248. r.append(n),
  33249. n.offset = o;
  33250. break;
  33251. case e.TYPES.message:
  33252. var a = (new t).LE();
  33253. this.resolvedType.encode(n, a),
  33254. r.writeVarint32(a.offset),
  33255. r.append(a.flip());
  33256. break;
  33257. case e.TYPES.group:
  33258. this.resolvedType.encode(n, r),
  33259. r.writeVarint32(i << 3 | e.WIRE_TYPES.ENDGROUP);
  33260. break;
  33261. default:
  33262. throw Error("[INTERNAL] Illegal value to encode in " + this.toString(!0) + ": " + n + " (unknown type)")
  33263. }
  33264. return r
  33265. }
  33266. ,
  33267. u.decode = function(t, i, n) {
  33268. if (i != this.type.wireType)
  33269. throw Error("Unexpected wire type for element");
  33270. var r, o;
  33271. switch (this.type) {
  33272. case e.TYPES.int32:
  33273. return 0 | t.readVarint32();
  33274. case e.TYPES.uint32:
  33275. return t.readVarint32() >>> 0;
  33276. case e.TYPES.sint32:
  33277. return 0 | t.readVarint32ZigZag();
  33278. case e.TYPES.fixed32:
  33279. return t.readUint32() >>> 0;
  33280. case e.TYPES.sfixed32:
  33281. return 0 | t.readInt32();
  33282. case e.TYPES.int64:
  33283. return t.readVarint64();
  33284. case e.TYPES.uint64:
  33285. return t.readVarint64().toUnsigned();
  33286. case e.TYPES.sint64:
  33287. return t.readVarint64ZigZag();
  33288. case e.TYPES.fixed64:
  33289. return t.readUint64();
  33290. case e.TYPES.sfixed64:
  33291. return t.readInt64();
  33292. case e.TYPES.bool:
  33293. return !!t.readVarint32();
  33294. case e.TYPES.enum:
  33295. return t.readVarint32();
  33296. case e.TYPES.float:
  33297. return t.readFloat();
  33298. case e.TYPES.double:
  33299. return t.readDouble();
  33300. case e.TYPES.string:
  33301. return t.readVString();
  33302. case e.TYPES.bytes:
  33303. if (o = t.readVarint32(),
  33304. t.remaining() < o)
  33305. throw Error("Illegal number of bytes for " + this.toString(!0) + ": " + o + " required but got only " + t.remaining());
  33306. return r = t.clone(),
  33307. r.limit = r.offset + o,
  33308. t.offset += o,
  33309. r;
  33310. case e.TYPES.message:
  33311. return o = t.readVarint32(),
  33312. this.resolvedType.decode(t, o);
  33313. case e.TYPES.group:
  33314. return this.resolvedType.decode(t, -1, n)
  33315. }
  33316. throw Error("[INTERNAL] Illegal decode type")
  33317. }
  33318. ,
  33319. u.valueFromString = function(i) {
  33320. if (!this.isMapKey)
  33321. throw Error("valueFromString() called on non-map-key element");
  33322. switch (this.type) {
  33323. case e.TYPES.int32:
  33324. case e.TYPES.sint32:
  33325. case e.TYPES.sfixed32:
  33326. case e.TYPES.uint32:
  33327. case e.TYPES.fixed32:
  33328. return this.verifyValue(parseInt(i));
  33329. case e.TYPES.int64:
  33330. case e.TYPES.sint64:
  33331. case e.TYPES.sfixed64:
  33332. case e.TYPES.uint64:
  33333. case e.TYPES.fixed64:
  33334. return this.verifyValue(i);
  33335. case e.TYPES.bool:
  33336. return "true" === i;
  33337. case e.TYPES.string:
  33338. return this.verifyValue(i);
  33339. case e.TYPES.bytes:
  33340. return t.fromBinary(i)
  33341. }
  33342. }
  33343. ,
  33344. u.valueToString = function(t) {
  33345. if (!this.isMapKey)
  33346. throw Error("valueToString() called on non-map-key element");
  33347. return this.type === e.TYPES.bytes ? t.toString("binary") : t.toString()
  33348. }
  33349. ,
  33350. o.Element = h;
  33351. var d = function(e, t, i, n, r, o) {
  33352. l.call(this, e, t, i, n, o),
  33353. this.className = "Message",
  33354. this.extensions = void 0,
  33355. this.clazz = null,
  33356. this.isGroup = !!r,
  33357. this._fields = null,
  33358. this._fieldsById = null,
  33359. this._fieldsByName = null
  33360. }
  33361. , p = d.prototype = Object.create(l.prototype);
  33362. p.build = function(i) {
  33363. if (this.clazz && !i)
  33364. return this.clazz;
  33365. var n = function(e, i) {
  33366. function n(i, r, o, a) {
  33367. if (null === i || "object" != typeof i) {
  33368. if (a && a instanceof e.Reflect.Enum) {
  33369. var s = e.Reflect.Enum.getName(a.object, i);
  33370. if (null !== s)
  33371. return s
  33372. }
  33373. return i
  33374. }
  33375. if (t.isByteBuffer(i))
  33376. return r ? i.toBase64() : i.toBuffer();
  33377. if (e.Long.isLong(i))
  33378. return o ? i.toString() : e.Long.fromValue(i);
  33379. var l;
  33380. if (Array.isArray(i))
  33381. return l = [],
  33382. i.forEach(function(e, t) {
  33383. l[t] = n(e, r, o, a)
  33384. }),
  33385. l;
  33386. if (l = {},
  33387. i instanceof e.Map) {
  33388. for (var c = i.entries(), h = c.next(); !h.done; h = c.next())
  33389. l[i.keyElem.valueToString(h.value[0])] = n(h.value[1], r, o, i.valueElem.resolvedType);
  33390. return l
  33391. }
  33392. var u = i.$type
  33393. , d = void 0;
  33394. for (var p in i)
  33395. i.hasOwnProperty(p) && (u && (d = u.getChild(p)) ? l[p] = n(i[p], r, o, d.resolvedType) : l[p] = n(i[p], r, o));
  33396. return l
  33397. }
  33398. var r = i.getChildren(e.Reflect.Message.Field)
  33399. , o = i.getChildren(e.Reflect.Message.OneOf)
  33400. , a = function(n, s) {
  33401. e.Builder.Message.call(this);
  33402. for (var l = 0, c = o.length; l < c; ++l)
  33403. this[o[l].name] = null;
  33404. for (l = 0,
  33405. c = r.length; l < c; ++l) {
  33406. var h = r[l];
  33407. this[h.name] = h.repeated ? [] : h.map ? new e.Map(h) : null,
  33408. !h.required && "proto3" !== i.syntax || null === h.defaultValue || (this[h.name] = h.defaultValue)
  33409. }
  33410. if (arguments.length > 0) {
  33411. var u;
  33412. 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)
  33413. for (l = 0,
  33414. c = arguments.length; l < c; ++l)
  33415. "undefined" != typeof (u = arguments[l]) && this.$set(r[l].name, u);
  33416. else
  33417. this.$set(n)
  33418. }
  33419. }
  33420. , s = a.prototype = Object.create(e.Builder.Message.prototype);
  33421. s.add = function(t, n, r) {
  33422. var o = i._fieldsByName[t];
  33423. if (!r) {
  33424. if (!o)
  33425. throw Error(this + "#" + t + " is undefined");
  33426. if (!(o instanceof e.Reflect.Message.Field))
  33427. throw Error(this + "#" + t + " is not a field: " + o.toString(!0));
  33428. if (!o.repeated)
  33429. throw Error(this + "#" + t + " is not a repeated field");
  33430. n = o.verifyValue(n, !0)
  33431. }
  33432. return null === this[t] && (this[t] = []),
  33433. this[t].push(n),
  33434. this
  33435. }
  33436. ,
  33437. s.$add = s.add,
  33438. s.set = function(t, n, r) {
  33439. if (t && "object" == typeof t) {
  33440. r = n;
  33441. for (var o in t)
  33442. t.hasOwnProperty(o) && "undefined" != typeof (n = t[o]) && this.$set(o, n, r);
  33443. return this
  33444. }
  33445. var a = i._fieldsByName[t];
  33446. if (r)
  33447. this[t] = n;
  33448. else {
  33449. if (!a)
  33450. throw Error(this + "#" + t + " is not a field: undefined");
  33451. if (!(a instanceof e.Reflect.Message.Field))
  33452. throw Error(this + "#" + t + " is not a field: " + a.toString(!0));
  33453. this[a.name] = n = a.verifyValue(n)
  33454. }
  33455. if (a && a.oneof) {
  33456. var s = this[a.oneof.name];
  33457. null !== n ? (null !== s && s !== a.name && (this[s] = null),
  33458. this[a.oneof.name] = a.name) : s === t && (this[a.oneof.name] = null)
  33459. }
  33460. return this
  33461. }
  33462. ,
  33463. s.$set = s.set,
  33464. s.get = function(t, n) {
  33465. if (n)
  33466. return this[t];
  33467. var r = i._fieldsByName[t];
  33468. if (!(r && r instanceof e.Reflect.Message.Field))
  33469. throw Error(this + "#" + t + " is not a field: undefined");
  33470. if (!(r instanceof e.Reflect.Message.Field))
  33471. throw Error(this + "#" + t + " is not a field: " + r.toString(!0));
  33472. return this[r.name]
  33473. }
  33474. ,
  33475. s.$get = s.get;
  33476. for (var l = 0; l < r.length; l++) {
  33477. var c = r[l];
  33478. c instanceof e.Reflect.Message.ExtensionField || i.builder.options.populateAccessors && function(e) {
  33479. var t = e.originalName.replace(/(_[a-zA-Z])/g, function(e) {
  33480. return e.toUpperCase().replace("_", "")
  33481. });
  33482. t = t.substring(0, 1).toUpperCase() + t.substring(1);
  33483. var n = e.originalName.replace(/([A-Z])/g, function(e) {
  33484. return "_" + e
  33485. })
  33486. , r = function(t, i) {
  33487. return this[e.name] = i ? t : e.verifyValue(t),
  33488. this
  33489. }
  33490. , o = function() {
  33491. return this[e.name]
  33492. };
  33493. null === i.getChild("set" + t) && (s["set" + t] = r),
  33494. null === i.getChild("set_" + n) && (s["set_" + n] = r),
  33495. null === i.getChild("get" + t) && (s["get" + t] = o),
  33496. null === i.getChild("get_" + n) && (s["get_" + n] = o)
  33497. }(c)
  33498. }
  33499. s.encode = function(e, n) {
  33500. "boolean" == typeof e && (n = e,
  33501. e = void 0);
  33502. var r = !1;
  33503. e || (e = new t,
  33504. r = !0);
  33505. var o = e.littleEndian;
  33506. try {
  33507. return i.encode(this, e.LE(), n),
  33508. (r ? e.flip() : e).LE(o)
  33509. } catch (t) {
  33510. throw e.LE(o),
  33511. t
  33512. }
  33513. }
  33514. ,
  33515. a.encode = function(e, t, i) {
  33516. return new a(e).encode(t, i)
  33517. }
  33518. ,
  33519. s.calculate = function() {
  33520. return i.calculate(this)
  33521. }
  33522. ,
  33523. s.encodeDelimited = function(e, n) {
  33524. var r = !1;
  33525. e || (e = new t,
  33526. r = !0);
  33527. var o = (new t).LE();
  33528. return i.encode(this, o, n).flip(),
  33529. e.writeVarint32(o.remaining()),
  33530. e.append(o),
  33531. r ? e.flip() : e
  33532. }
  33533. ,
  33534. s.encodeAB = function() {
  33535. try {
  33536. return this.encode().toArrayBuffer()
  33537. } catch (e) {
  33538. throw e.encoded && (e.encoded = e.encoded.toArrayBuffer()),
  33539. e
  33540. }
  33541. }
  33542. ,
  33543. s.toArrayBuffer = s.encodeAB,
  33544. s.encodeNB = function() {
  33545. try {
  33546. return this.encode().toBuffer()
  33547. } catch (e) {
  33548. throw e.encoded && (e.encoded = e.encoded.toBuffer()),
  33549. e
  33550. }
  33551. }
  33552. ,
  33553. s.toBuffer = s.encodeNB,
  33554. s.encode64 = function() {
  33555. try {
  33556. return this.encode().toBase64()
  33557. } catch (e) {
  33558. throw e.encoded && (e.encoded = e.encoded.toBase64()),
  33559. e
  33560. }
  33561. }
  33562. ,
  33563. s.toBase64 = s.encode64,
  33564. s.encodeHex = function() {
  33565. try {
  33566. return this.encode().toHex()
  33567. } catch (e) {
  33568. throw e.encoded && (e.encoded = e.encoded.toHex()),
  33569. e
  33570. }
  33571. }
  33572. ,
  33573. s.toHex = s.encodeHex,
  33574. s.toRaw = function(e, t) {
  33575. return n(this, !!e, !!t, this.$type)
  33576. }
  33577. ,
  33578. s.encodeJSON = function() {
  33579. return JSON.stringify(n(this, !0, !0, this.$type))
  33580. }
  33581. ,
  33582. a.decode = function(e, n, r) {
  33583. "string" == typeof n && (r = n,
  33584. n = -1),
  33585. "string" == typeof e && (e = t.wrap(e, r ? r : "base64")),
  33586. e = t.isByteBuffer(e) ? e : t.wrap(e);
  33587. var o = e.littleEndian;
  33588. try {
  33589. var a = i.decode(e.LE());
  33590. return e.LE(o),
  33591. a
  33592. } catch (t) {
  33593. throw e.LE(o),
  33594. t
  33595. }
  33596. }
  33597. ,
  33598. a.decodeDelimited = function(e, n) {
  33599. if ("string" == typeof e && (e = t.wrap(e, n ? n : "base64")),
  33600. e = t.isByteBuffer(e) ? e : t.wrap(e),
  33601. e.remaining() < 1)
  33602. return null;
  33603. var r = e.offset
  33604. , o = e.readVarint32();
  33605. if (e.remaining() < o)
  33606. return e.offset = r,
  33607. null;
  33608. try {
  33609. var a = i.decode(e.slice(e.offset, e.offset + o).LE());
  33610. return e.offset += o,
  33611. a
  33612. } catch (t) {
  33613. throw e.offset += o,
  33614. t
  33615. }
  33616. }
  33617. ,
  33618. a.decode64 = function(e) {
  33619. return a.decode(e, "base64")
  33620. }
  33621. ,
  33622. a.decodeHex = function(e) {
  33623. return a.decode(e, "hex")
  33624. }
  33625. ,
  33626. a.decodeJSON = function(e) {
  33627. return new a(JSON.parse(e))
  33628. }
  33629. ,
  33630. s.toString = function() {
  33631. return i.toString()
  33632. }
  33633. ;
  33634. return Object.defineProperty && (Object.defineProperty(a, "$options", {
  33635. value: i.buildOpt()
  33636. }),
  33637. Object.defineProperty(s, "$options", {
  33638. value: a.$options
  33639. }),
  33640. Object.defineProperty(a, "$type", {
  33641. value: i
  33642. }),
  33643. Object.defineProperty(s, "$type", {
  33644. value: i
  33645. })),
  33646. a
  33647. }(e, this);
  33648. this._fields = [],
  33649. this._fieldsById = {},
  33650. this._fieldsByName = {};
  33651. for (var r, o = 0, a = this.children.length; o < a; o++)
  33652. if (r = this.children[o],
  33653. r instanceof A || r instanceof d || r instanceof E) {
  33654. if (n.hasOwnProperty(r.name))
  33655. throw Error("Illegal reflect child of " + this.toString(!0) + ": " + r.toString(!0) + " cannot override static property '" + r.name + "'");
  33656. n[r.name] = r.build()
  33657. } else if (r instanceof d.Field)
  33658. r.build(),
  33659. this._fields.push(r),
  33660. this._fieldsById[r.id] = r,
  33661. this._fieldsByName[r.name] = r;
  33662. else if (!(r instanceof d.OneOf || r instanceof I))
  33663. throw Error("Illegal reflect child of " + this.toString(!0) + ": " + this.children[o].toString(!0));
  33664. return this.clazz = n
  33665. }
  33666. ,
  33667. p.encode = function(e, t, i) {
  33668. for (var n, r, o = null, a = 0, s = this._fields.length; a < s; ++a)
  33669. n = this._fields[a],
  33670. r = e[n.name],
  33671. n.required && null === r ? null === o && (o = n) : n.encode(i ? r : n.verifyValue(r), t, e);
  33672. if (null !== o) {
  33673. var l = Error("Missing at least one required field for " + this.toString(!0) + ": " + o);
  33674. throw l.encoded = t,
  33675. l
  33676. }
  33677. return t
  33678. }
  33679. ,
  33680. p.calculate = function(e) {
  33681. for (var t, i, n = 0, r = 0, o = this._fields.length; r < o; ++r) {
  33682. if (t = this._fields[r],
  33683. i = e[t.name],
  33684. t.required && null === i)
  33685. throw Error("Missing at least one required field for " + this.toString(!0) + ": " + t);
  33686. n += t.calculate(i, e)
  33687. }
  33688. return n
  33689. }
  33690. ,
  33691. p.decode = function(t, i, n) {
  33692. i = "number" == typeof i ? i : -1;
  33693. for (var o, a, s, l, c = t.offset, h = new this.clazz; t.offset < c + i || i === -1 && t.remaining() > 0; ) {
  33694. if (o = t.readVarint32(),
  33695. a = 7 & o,
  33696. s = o >>> 3,
  33697. a === e.WIRE_TYPES.ENDGROUP) {
  33698. if (s !== n)
  33699. throw Error("Illegal group end indicator for " + this.toString(!0) + ": " + s + " (" + (n ? n + " expected" : "not a group") + ")");
  33700. break
  33701. }
  33702. if (l = this._fieldsById[s]) {
  33703. if (l.repeated && !l.options.packed)
  33704. h[l.name].push(l.decode(a, t));
  33705. else if (l.map) {
  33706. var u = l.decode(a, t);
  33707. h[l.name].set(u[0], u[1])
  33708. } else if (h[l.name] = l.decode(a, t),
  33709. l.oneof) {
  33710. var d = h[l.oneof.name];
  33711. null !== d && d !== l.name && (h[d] = null),
  33712. h[l.oneof.name] = l.name
  33713. }
  33714. } else
  33715. switch (a) {
  33716. case e.WIRE_TYPES.VARINT:
  33717. t.readVarint32();
  33718. break;
  33719. case e.WIRE_TYPES.BITS32:
  33720. t.offset += 4;
  33721. break;
  33722. case e.WIRE_TYPES.BITS64:
  33723. t.offset += 8;
  33724. break;
  33725. case e.WIRE_TYPES.LDELIM:
  33726. var p = t.readVarint32();
  33727. t.offset += p;
  33728. break;
  33729. case e.WIRE_TYPES.STARTGROUP:
  33730. for (; r(s, t); )
  33731. ;
  33732. break;
  33733. default:
  33734. throw Error("Illegal wire type for unknown field " + s + " in " + this.toString(!0) + "#decode: " + a)
  33735. }
  33736. }
  33737. for (var f = 0, g = this._fields.length; f < g; ++f)
  33738. if (l = this._fields[f],
  33739. null === h[l.name])
  33740. if ("proto3" === this.syntax)
  33741. h[l.name] = l.defaultValue;
  33742. else {
  33743. if (l.required) {
  33744. var m = Error("Missing at least one required field for " + this.toString(!0) + ": " + l.name);
  33745. throw m.decoded = h,
  33746. m
  33747. }
  33748. e.populateDefaults && null !== l.defaultValue && (h[l.name] = l.defaultValue)
  33749. }
  33750. return h
  33751. }
  33752. ,
  33753. o.Message = d;
  33754. var f = function(t, i, n, r, o, s, l, c, h, u) {
  33755. a.call(this, t, i, s),
  33756. this.className = "Message.Field",
  33757. this.required = "required" === n,
  33758. this.repeated = "repeated" === n,
  33759. this.map = "map" === n,
  33760. this.keyType = r || null,
  33761. this.type = o,
  33762. this.resolvedType = null,
  33763. this.id = l,
  33764. this.options = c || {},
  33765. this.defaultValue = null,
  33766. this.oneof = h || null,
  33767. this.syntax = u || "proto2",
  33768. this.originalName = this.name,
  33769. this.element = null,
  33770. this.keyElement = null,
  33771. !this.builder.options.convertFieldsToCamelCase || this instanceof d.ExtensionField || (this.name = e.Util.toCamelCase(this.name))
  33772. }
  33773. , g = f.prototype = Object.create(a.prototype);
  33774. g.build = function() {
  33775. this.element = new h(this.type,this.resolvedType,!1,this.syntax),
  33776. this.map && (this.keyElement = new h(this.keyType,void 0,!0,this.syntax)),
  33777. "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)
  33778. }
  33779. ,
  33780. g.verifyValue = function(t, i) {
  33781. function n(e, t) {
  33782. throw Error("Illegal value for " + r.toString(!0) + " of type " + r.type.name + ": " + e + " (" + t + ")")
  33783. }
  33784. i = i || !1;
  33785. var r = this;
  33786. if (null === t)
  33787. return this.required && n(typeof t, "required"),
  33788. "proto3" === this.syntax && this.type !== e.TYPES.message && n(typeof t, "proto3 field without field presence cannot be null"),
  33789. null;
  33790. var o;
  33791. if (this.repeated && !i) {
  33792. Array.isArray(t) || (t = [t]);
  33793. var a = [];
  33794. for (o = 0; o < t.length; o++)
  33795. a.push(this.element.verifyValue(t[o]));
  33796. return a
  33797. }
  33798. return this.map && !i ? t instanceof e.Map ? t : (t instanceof Object || n(typeof t, "expected ProtoBuf.Map or raw object for map field"),
  33799. new e.Map(this,t)) : (!this.repeated && Array.isArray(t) && n(typeof t, "no array expected"),
  33800. this.element.verifyValue(t))
  33801. }
  33802. ,
  33803. g.hasWirePresence = function(t, i) {
  33804. if ("proto3" !== this.syntax)
  33805. return null !== t;
  33806. if (this.oneof && i[this.oneof.name] === this.name)
  33807. return !0;
  33808. switch (this.type) {
  33809. case e.TYPES.int32:
  33810. case e.TYPES.sint32:
  33811. case e.TYPES.sfixed32:
  33812. case e.TYPES.uint32:
  33813. case e.TYPES.fixed32:
  33814. return 0 !== t;
  33815. case e.TYPES.int64:
  33816. case e.TYPES.sint64:
  33817. case e.TYPES.sfixed64:
  33818. case e.TYPES.uint64:
  33819. case e.TYPES.fixed64:
  33820. return 0 !== t.low || 0 !== t.high;
  33821. case e.TYPES.bool:
  33822. return t;
  33823. case e.TYPES.float:
  33824. case e.TYPES.double:
  33825. return 0 !== t;
  33826. case e.TYPES.string:
  33827. return t.length > 0;
  33828. case e.TYPES.bytes:
  33829. return t.remaining() > 0;
  33830. case e.TYPES.enum:
  33831. return 0 !== t;
  33832. case e.TYPES.message:
  33833. return null !== t;
  33834. default:
  33835. return !0
  33836. }
  33837. }
  33838. ,
  33839. g.encode = function(i, n, r) {
  33840. if (null === this.type || "object" != typeof this.type)
  33841. throw Error("[INTERNAL] Unresolved type in " + this.toString(!0) + ": " + this.type);
  33842. if (null === i || this.repeated && 0 == i.length)
  33843. return n;
  33844. try {
  33845. if (this.repeated) {
  33846. var o;
  33847. if (this.options.packed && e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0) {
  33848. n.writeVarint32(this.id << 3 | e.WIRE_TYPES.LDELIM),
  33849. n.ensureCapacity(n.offset += 1);
  33850. var a = n.offset;
  33851. for (o = 0; o < i.length; o++)
  33852. this.element.encodeValue(this.id, i[o], n);
  33853. var s = n.offset - a
  33854. , l = t.calculateVarint32(s);
  33855. if (l > 1) {
  33856. var c = n.slice(a, n.offset);
  33857. a += l - 1,
  33858. n.offset = a,
  33859. n.append(c)
  33860. }
  33861. n.writeVarint32(s, a - l)
  33862. } else
  33863. for (o = 0; o < i.length; o++)
  33864. n.writeVarint32(this.id << 3 | this.type.wireType),
  33865. this.element.encodeValue(this.id, i[o], n)
  33866. } else
  33867. this.map ? i.forEach(function(i, r, o) {
  33868. var a = t.calculateVarint32(8 | this.keyType.wireType) + this.keyElement.calculateLength(1, r) + t.calculateVarint32(16 | this.type.wireType) + this.element.calculateLength(2, i);
  33869. n.writeVarint32(this.id << 3 | e.WIRE_TYPES.LDELIM),
  33870. n.writeVarint32(a),
  33871. n.writeVarint32(8 | this.keyType.wireType),
  33872. this.keyElement.encodeValue(1, r, n),
  33873. n.writeVarint32(16 | this.type.wireType),
  33874. this.element.encodeValue(2, i, n)
  33875. }, this) : this.hasWirePresence(i, r) && (n.writeVarint32(this.id << 3 | this.type.wireType),
  33876. this.element.encodeValue(this.id, i, n))
  33877. } catch (e) {
  33878. throw Error("Illegal value for " + this.toString(!0) + ": " + i + " (" + e + ")")
  33879. }
  33880. return n
  33881. }
  33882. ,
  33883. g.calculate = function(i, n) {
  33884. if (i = this.verifyValue(i),
  33885. null === this.type || "object" != typeof this.type)
  33886. throw Error("[INTERNAL] Unresolved type in " + this.toString(!0) + ": " + this.type);
  33887. if (null === i || this.repeated && 0 == i.length)
  33888. return 0;
  33889. var r = 0;
  33890. try {
  33891. if (this.repeated) {
  33892. var o, a;
  33893. if (this.options.packed && e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0) {
  33894. for (r += t.calculateVarint32(this.id << 3 | e.WIRE_TYPES.LDELIM),
  33895. a = 0,
  33896. o = 0; o < i.length; o++)
  33897. a += this.element.calculateLength(this.id, i[o]);
  33898. r += t.calculateVarint32(a),
  33899. r += a
  33900. } else
  33901. for (o = 0; o < i.length; o++)
  33902. r += t.calculateVarint32(this.id << 3 | this.type.wireType),
  33903. r += this.element.calculateLength(this.id, i[o])
  33904. } else
  33905. this.map ? i.forEach(function(i, n, o) {
  33906. var a = t.calculateVarint32(8 | this.keyType.wireType) + this.keyElement.calculateLength(1, n) + t.calculateVarint32(16 | this.type.wireType) + this.element.calculateLength(2, i);
  33907. r += t.calculateVarint32(this.id << 3 | e.WIRE_TYPES.LDELIM),
  33908. r += t.calculateVarint32(a),
  33909. r += a
  33910. }, this) : this.hasWirePresence(i, n) && (r += t.calculateVarint32(this.id << 3 | this.type.wireType),
  33911. r += this.element.calculateLength(this.id, i))
  33912. } catch (e) {
  33913. throw Error("Illegal value for " + this.toString(!0) + ": " + i + " (" + e + ")")
  33914. }
  33915. return r
  33916. }
  33917. ,
  33918. g.decode = function(t, i, n) {
  33919. 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;
  33920. if (!a)
  33921. throw Error("Illegal wire type for field " + this.toString(!0) + ": " + t + " (" + this.type.wireType + " expected)");
  33922. if (t == e.WIRE_TYPES.LDELIM && this.repeated && this.options.packed && e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0 && !n) {
  33923. o = i.readVarint32(),
  33924. o = i.offset + o;
  33925. for (var s = []; i.offset < o; )
  33926. s.push(this.decode(this.type.wireType, i, !0));
  33927. return s
  33928. }
  33929. if (this.map) {
  33930. var l = h.defaultFieldValue(this.keyType);
  33931. if (r = h.defaultFieldValue(this.type),
  33932. o = i.readVarint32(),
  33933. i.remaining() < o)
  33934. throw Error("Illegal number of bytes for " + this.toString(!0) + ": " + o + " required but got only " + i.remaining());
  33935. var c = i.clone();
  33936. for (c.limit = c.offset + o,
  33937. i.offset += o; c.remaining() > 0; ) {
  33938. var u = c.readVarint32();
  33939. t = 7 & u;
  33940. var d = u >>> 3;
  33941. if (1 === d)
  33942. l = this.keyElement.decode(c, t, d);
  33943. else {
  33944. if (2 !== d)
  33945. throw Error("Unexpected tag in map field key/value submessage");
  33946. r = this.element.decode(c, t, d)
  33947. }
  33948. }
  33949. return [l, r]
  33950. }
  33951. return this.element.decode(i, t, this.id)
  33952. }
  33953. ,
  33954. o.Message.Field = f;
  33955. var m = function(e, t, i, n, r, o, a) {
  33956. f.call(this, e, t, i, null, n, r, o, a),
  33957. this.extension
  33958. };
  33959. m.prototype = Object.create(f.prototype),
  33960. o.Message.ExtensionField = m;
  33961. var v = function(e, t, i) {
  33962. a.call(this, e, t, i),
  33963. this.fields = []
  33964. };
  33965. o.Message.OneOf = v;
  33966. var A = function(e, t, i, n, r) {
  33967. l.call(this, e, t, i, n, r),
  33968. this.className = "Enum",
  33969. this.object = null
  33970. };
  33971. A.getName = function(e, t) {
  33972. for (var i, n = Object.keys(e), r = 0; r < n.length; ++r)
  33973. if (e[i = n[r]] === t)
  33974. return i;
  33975. return null
  33976. }
  33977. ;
  33978. var y = A.prototype = Object.create(l.prototype);
  33979. y.build = function(t) {
  33980. if (this.object && !t)
  33981. return this.object;
  33982. for (var i = new e.Builder.Enum, n = this.getChildren(A.Value), r = 0, o = n.length; r < o; ++r)
  33983. i[n[r].name] = n[r].id;
  33984. return Object.defineProperty && Object.defineProperty(i, "$options", {
  33985. value: this.buildOpt(),
  33986. enumerable: !1
  33987. }),
  33988. this.object = i
  33989. }
  33990. ,
  33991. o.Enum = A;
  33992. var C = function(e, t, i, n) {
  33993. a.call(this, e, t, i),
  33994. this.className = "Enum.Value",
  33995. this.id = n
  33996. };
  33997. C.prototype = Object.create(a.prototype),
  33998. o.Enum.Value = C;
  33999. var I = function(e, t, i, n) {
  34000. a.call(this, e, t, i),
  34001. this.field = n
  34002. };
  34003. I.prototype = Object.create(a.prototype),
  34004. o.Extension = I;
  34005. var E = function(e, t, i, n) {
  34006. l.call(this, e, t, i, n),
  34007. this.className = "Service",
  34008. this.clazz = null
  34009. }
  34010. , b = E.prototype = Object.create(l.prototype);
  34011. b.build = function(i) {
  34012. return this.clazz && !i ? this.clazz : this.clazz = function(e, i) {
  34013. for (var n = function(t) {
  34014. e.Builder.Service.call(this),
  34015. this.rpcImpl = t || function(e, t, i) {
  34016. setTimeout(i.bind(this, Error("Not implemented, see: https://github.com/dcodeIO/ProtoBuf.js/wiki/Services")), 0)
  34017. }
  34018. }, r = n.prototype = Object.create(e.Builder.Service.prototype), o = i.getChildren(e.Reflect.Service.RPCMethod), a = 0; a < o.length; a++)
  34019. !function(e) {
  34020. r[e.name] = function(n, r) {
  34021. try {
  34022. try {
  34023. n = e.resolvedRequestType.clazz.decode(t.wrap(n))
  34024. } catch (e) {
  34025. if (!(e instanceof TypeError))
  34026. throw e
  34027. }
  34028. if (null === n || "object" != typeof n)
  34029. throw Error("Illegal arguments");
  34030. n instanceof e.resolvedRequestType.clazz || (n = new e.resolvedRequestType.clazz(n)),
  34031. this.rpcImpl(e.fqn(), n, function(t, n) {
  34032. if (t)
  34033. return void r(t);
  34034. null === n && (n = "");
  34035. try {
  34036. n = e.resolvedResponseType.clazz.decode(n)
  34037. } catch (e) {}
  34038. 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))
  34039. })
  34040. } catch (e) {
  34041. setTimeout(r.bind(this, e), 0)
  34042. }
  34043. }
  34044. ,
  34045. n[e.name] = function(t, i, r) {
  34046. new n(t)[e.name](i, r)
  34047. }
  34048. ,
  34049. Object.defineProperty && (Object.defineProperty(n[e.name], "$options", {
  34050. value: e.buildOpt()
  34051. }),
  34052. Object.defineProperty(r[e.name], "$options", {
  34053. value: n[e.name].$options
  34054. }))
  34055. }(o[a]);
  34056. return Object.defineProperty && (Object.defineProperty(n, "$options", {
  34057. value: i.buildOpt()
  34058. }),
  34059. Object.defineProperty(r, "$options", {
  34060. value: n.$options
  34061. }),
  34062. Object.defineProperty(n, "$type", {
  34063. value: i
  34064. }),
  34065. Object.defineProperty(r, "$type", {
  34066. value: i
  34067. })),
  34068. n
  34069. }(e, this)
  34070. }
  34071. ,
  34072. o.Service = E;
  34073. var w = function(e, t, i, n) {
  34074. a.call(this, e, t, i),
  34075. this.className = "Service.Method",
  34076. this.options = n || {}
  34077. }
  34078. , _ = w.prototype = Object.create(a.prototype);
  34079. _.buildOpt = c.buildOpt,
  34080. o.Service.Method = w;
  34081. var T = function(e, t, i, n, r, o, a, s) {
  34082. w.call(this, e, t, i, s),
  34083. this.className = "Service.RPCMethod",
  34084. this.requestName = n,
  34085. this.responseName = r,
  34086. this.requestStream = o,
  34087. this.responseStream = a,
  34088. this.resolvedRequestType = null,
  34089. this.resolvedResponseType = null
  34090. };
  34091. return T.prototype = Object.create(w.prototype),
  34092. o.Service.RPCMethod = T,
  34093. o
  34094. }(r),
  34095. r.Builder = function(t, i, n) {
  34096. function r(e) {
  34097. e.messages && e.messages.forEach(function(t) {
  34098. t.syntax = e.syntax,
  34099. r(t)
  34100. }),
  34101. e.enums && e.enums.forEach(function(t) {
  34102. t.syntax = e.syntax
  34103. })
  34104. }
  34105. var o = function(e) {
  34106. this.ns = new n.Namespace(this,null,""),
  34107. this.ptr = this.ns,
  34108. this.resolved = !1,
  34109. this.result = null,
  34110. this.files = {},
  34111. this.importRoot = null,
  34112. this.options = e || {}
  34113. }
  34114. , a = o.prototype;
  34115. return o.isMessage = function(e) {
  34116. return "string" == typeof e.name && ("undefined" == typeof e.values && "undefined" == typeof e.rpc)
  34117. }
  34118. ,
  34119. o.isMessageField = function(e) {
  34120. return "string" == typeof e.rule && "string" == typeof e.name && "string" == typeof e.type && "undefined" != typeof e.id
  34121. }
  34122. ,
  34123. o.isEnum = function(e) {
  34124. return "string" == typeof e.name && !("undefined" == typeof e.values || !Array.isArray(e.values) || 0 === e.values.length)
  34125. }
  34126. ,
  34127. o.isService = function(e) {
  34128. return !("string" != typeof e.name || "object" != typeof e.rpc || !e.rpc)
  34129. }
  34130. ,
  34131. o.isExtend = function(e) {
  34132. return "string" == typeof e.ref
  34133. }
  34134. ,
  34135. a.reset = function() {
  34136. return this.ptr = this.ns,
  34137. this
  34138. }
  34139. ,
  34140. a.define = function(e) {
  34141. if ("string" != typeof e || !i.TYPEREF.test(e))
  34142. throw Error("illegal namespace: " + e);
  34143. return e.split(".").forEach(function(e) {
  34144. var t = this.ptr.getChild(e);
  34145. null === t && this.ptr.addChild(t = new n.Namespace(this,this.ptr,e)),
  34146. this.ptr = t
  34147. }, this),
  34148. this
  34149. }
  34150. ,
  34151. a.create = function(e) {
  34152. if (!e)
  34153. return this;
  34154. if (Array.isArray(e)) {
  34155. if (0 === e.length)
  34156. return this;
  34157. e = e.slice()
  34158. } else
  34159. e = [e];
  34160. for (var i = [e]; i.length > 0; ) {
  34161. if (e = i.pop(),
  34162. !Array.isArray(e))
  34163. throw Error("not a valid namespace: " + JSON.stringify(e));
  34164. for (; e.length > 0; ) {
  34165. var r = e.shift();
  34166. if (o.isMessage(r)) {
  34167. var a = new n.Message(this,this.ptr,r.name,r.options,r.isGroup,r.syntax)
  34168. , s = {};
  34169. r.oneofs && Object.keys(r.oneofs).forEach(function(e) {
  34170. a.addChild(s[e] = new n.Message.OneOf(this,a,e))
  34171. }, this),
  34172. r.fields && r.fields.forEach(function(e) {
  34173. if (null !== a.getChild(0 | e.id))
  34174. throw Error("duplicate or invalid field id in " + a.name + ": " + e.id);
  34175. if (e.options && "object" != typeof e.options)
  34176. throw Error("illegal field options in " + a.name + "#" + e.name);
  34177. var t = null;
  34178. if ("string" == typeof e.oneof && !(t = s[e.oneof]))
  34179. throw Error("illegal oneof in " + a.name + "#" + e.name + ": " + e.oneof);
  34180. e = new n.Message.Field(this,a,e.rule,e.keytype,e.type,e.name,e.id,e.options,t,r.syntax),
  34181. t && t.fields.push(e),
  34182. a.addChild(e)
  34183. }, this);
  34184. var l = [];
  34185. if (r.enums && r.enums.forEach(function(e) {
  34186. l.push(e)
  34187. }),
  34188. r.messages && r.messages.forEach(function(e) {
  34189. l.push(e)
  34190. }),
  34191. r.services && r.services.forEach(function(e) {
  34192. l.push(e)
  34193. }),
  34194. r.extensions && ("number" == typeof r.extensions[0] ? a.extensions = [r.extensions] : a.extensions = r.extensions),
  34195. this.ptr.addChild(a),
  34196. l.length > 0) {
  34197. i.push(e),
  34198. e = l,
  34199. l = null,
  34200. this.ptr = a,
  34201. a = null;
  34202. continue
  34203. }
  34204. l = null
  34205. } else if (o.isEnum(r))
  34206. a = new n.Enum(this,this.ptr,r.name,r.options,r.syntax),
  34207. r.values.forEach(function(e) {
  34208. a.addChild(new n.Enum.Value(this,a,e.name,e.id))
  34209. }, this),
  34210. this.ptr.addChild(a);
  34211. else if (o.isService(r))
  34212. a = new n.Service(this,this.ptr,r.name,r.options),
  34213. Object.keys(r.rpc).forEach(function(e) {
  34214. var t = r.rpc[e];
  34215. a.addChild(new n.Service.RPCMethod(this,a,e,t.request,t.response,!!t.request_stream,!!t.response_stream,t.options))
  34216. }, this),
  34217. this.ptr.addChild(a);
  34218. else {
  34219. if (!o.isExtend(r))
  34220. throw Error("not a valid definition: " + JSON.stringify(r));
  34221. if (a = this.ptr.resolve(r.ref, !0))
  34222. r.fields.forEach(function(e) {
  34223. if (null !== a.getChild(0 | e.id))
  34224. throw Error("duplicate extended field id in " + a.name + ": " + e.id);
  34225. if (a.extensions) {
  34226. var i = !1;
  34227. if (a.extensions.forEach(function(t) {
  34228. e.id >= t[0] && e.id <= t[1] && (i = !0)
  34229. }),
  34230. !i)
  34231. throw Error("illegal extended field id in " + a.name + ": " + e.id + " (not within valid ranges)")
  34232. }
  34233. var r = e.name;
  34234. this.options.convertFieldsToCamelCase && (r = t.Util.toCamelCase(r));
  34235. var o = new n.Message.ExtensionField(this,a,e.rule,e.type,this.ptr.fqn() + "." + r,e.id,e.options)
  34236. , s = new n.Extension(this,this.ptr,e.name,o);
  34237. o.extension = s,
  34238. this.ptr.addChild(s),
  34239. a.addChild(o)
  34240. }, this);
  34241. else if (!/\.?google\.protobuf\./.test(r.ref))
  34242. throw Error("extended message " + r.ref + " is not defined")
  34243. }
  34244. r = null,
  34245. a = null
  34246. }
  34247. e = null,
  34248. this.ptr = this.ptr.parent
  34249. }
  34250. return this.resolved = !1,
  34251. this.result = null,
  34252. this
  34253. }
  34254. ,
  34255. a.import = function(i, n) {
  34256. var o = "/";
  34257. if ("string" == typeof n) {
  34258. if (t.Util.IS_NODE && (n = e("path").resolve(n)),
  34259. this.files[n] === !0)
  34260. return this.reset();
  34261. this.files[n] = !0
  34262. } else if ("object" == typeof n) {
  34263. var a = n.root;
  34264. t.Util.IS_NODE && (a = e("path").resolve(a)),
  34265. (a.indexOf("\\") >= 0 || n.file.indexOf("\\") >= 0) && (o = "\\");
  34266. var s = a + o + n.file;
  34267. if (this.files[s] === !0)
  34268. return this.reset();
  34269. this.files[s] = !0
  34270. }
  34271. if (i.imports && i.imports.length > 0) {
  34272. var l, c = !1;
  34273. "object" == typeof n ? (this.importRoot = n.root,
  34274. c = !0,
  34275. l = this.importRoot,
  34276. n = n.file,
  34277. (l.indexOf("\\") >= 0 || n.indexOf("\\") >= 0) && (o = "\\")) : "string" == typeof n ? this.importRoot ? l = this.importRoot : n.indexOf("/") >= 0 ? (l = n.replace(/\/[^\/]*$/, ""),
  34278. "" === l && (l = "/")) : n.indexOf("\\") >= 0 ? (l = n.replace(/\\[^\\]*$/, ""),
  34279. o = "\\") : l = "." : l = null;
  34280. for (var h = 0; h < i.imports.length; h++)
  34281. if ("string" == typeof i.imports[h]) {
  34282. if (!l)
  34283. throw Error("cannot determine import root");
  34284. var u = i.imports[h];
  34285. if ("google/protobuf/descriptor.proto" === u)
  34286. continue;
  34287. if (u = l + o + u,
  34288. this.files[u] === !0)
  34289. continue;
  34290. /\.proto$/i.test(u) && !t.DotProto && (u = u.replace(/\.proto$/, ".json"));
  34291. var d = t.Util.fetch(u);
  34292. if (null === d)
  34293. throw Error("failed to import '" + u + "' in '" + n + "': file not found");
  34294. /\.json$/i.test(u) ? this.import(JSON.parse(d + ""), u) : this.import(t.DotProto.Parser.parse(d), u)
  34295. } else
  34296. n ? /\.(\w+)$/.test(n) ? this.import(i.imports[h], n.replace(/^(.+)\.(\w+)$/, function(e, t, i) {
  34297. return t + "_import" + h + "." + i
  34298. })) : this.import(i.imports[h], n + "_import" + h) : this.import(i.imports[h]);
  34299. c && (this.importRoot = null)
  34300. }
  34301. i.package && this.define(i.package),
  34302. i.syntax && r(i);
  34303. var p = this.ptr;
  34304. return i.options && Object.keys(i.options).forEach(function(e) {
  34305. p.options[e] = i.options[e]
  34306. }),
  34307. i.messages && (this.create(i.messages),
  34308. this.ptr = p),
  34309. i.enums && (this.create(i.enums),
  34310. this.ptr = p),
  34311. i.services && (this.create(i.services),
  34312. this.ptr = p),
  34313. i.extends && this.create(i.extends),
  34314. this.reset()
  34315. }
  34316. ,
  34317. a.resolveAll = function() {
  34318. var e;
  34319. if (null == this.ptr || "object" == typeof this.ptr.type)
  34320. return this;
  34321. if (this.ptr instanceof n.Namespace)
  34322. this.ptr.children.forEach(function(e) {
  34323. this.ptr = e,
  34324. this.resolveAll()
  34325. }, this);
  34326. else if (this.ptr instanceof n.Message.Field) {
  34327. if (i.TYPE.test(this.ptr.type))
  34328. this.ptr.type = t.TYPES[this.ptr.type];
  34329. else {
  34330. if (!i.TYPEREF.test(this.ptr.type))
  34331. throw Error("illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  34332. if (e = (this.ptr instanceof n.Message.ExtensionField ? this.ptr.extension.parent : this.ptr.parent).resolve(this.ptr.type, !0),
  34333. !e)
  34334. throw Error("unresolvable type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  34335. if (this.ptr.resolvedType = e,
  34336. e instanceof n.Enum) {
  34337. if (this.ptr.type = t.TYPES.enum,
  34338. "proto3" === this.ptr.syntax && "proto3" !== e.syntax)
  34339. throw Error("proto3 message cannot reference proto2 enum")
  34340. } else {
  34341. if (!(e instanceof n.Message))
  34342. throw Error("illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  34343. this.ptr.type = e.isGroup ? t.TYPES.group : t.TYPES.message
  34344. }
  34345. }
  34346. if (this.ptr.map) {
  34347. if (!i.TYPE.test(this.ptr.keyType))
  34348. throw Error("illegal key type for map field in " + this.ptr.toString(!0) + ": " + this.ptr.keyType);
  34349. this.ptr.keyType = t.TYPES[this.ptr.keyType]
  34350. }
  34351. } else if (this.ptr instanceof t.Reflect.Service.Method) {
  34352. if (!(this.ptr instanceof t.Reflect.Service.RPCMethod))
  34353. throw Error("illegal service type in " + this.ptr.toString(!0));
  34354. if (e = this.ptr.parent.resolve(this.ptr.requestName, !0),
  34355. !(e && e instanceof t.Reflect.Message))
  34356. throw Error("Illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.requestName);
  34357. if (this.ptr.resolvedRequestType = e,
  34358. e = this.ptr.parent.resolve(this.ptr.responseName, !0),
  34359. !(e && e instanceof t.Reflect.Message))
  34360. throw Error("Illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.responseName);
  34361. this.ptr.resolvedResponseType = e
  34362. } else if (!(this.ptr instanceof t.Reflect.Message.OneOf || this.ptr instanceof t.Reflect.Extension || this.ptr instanceof t.Reflect.Enum.Value))
  34363. throw Error("illegal object in namespace: " + typeof this.ptr + ": " + this.ptr);
  34364. return this.reset()
  34365. }
  34366. ,
  34367. a.build = function(e) {
  34368. if (this.reset(),
  34369. this.resolved || (this.resolveAll(),
  34370. this.resolved = !0,
  34371. this.result = null),
  34372. null === this.result && (this.result = this.ns.build()),
  34373. !e)
  34374. return this.result;
  34375. for (var t = "string" == typeof e ? e.split(".") : e, i = this.result, n = 0; n < t.length; n++) {
  34376. if (!i[t[n]]) {
  34377. i = null;
  34378. break
  34379. }
  34380. i = i[t[n]]
  34381. }
  34382. return i
  34383. }
  34384. ,
  34385. a.lookup = function(e, t) {
  34386. return e ? this.ns.resolve(e, t) : this.ns
  34387. }
  34388. ,
  34389. a.toString = function() {
  34390. return "Builder"
  34391. }
  34392. ,
  34393. o.Message = function() {}
  34394. ,
  34395. o.Enum = function() {}
  34396. ,
  34397. o.Service = function() {}
  34398. ,
  34399. o
  34400. }(r, r.Lang, r.Reflect),
  34401. r.Map = function(e, t) {
  34402. function i(e) {
  34403. var t = 0;
  34404. return {
  34405. next: function() {
  34406. return t < e.length ? {
  34407. done: !1,
  34408. value: e[t++]
  34409. } : {
  34410. done: !0
  34411. }
  34412. }
  34413. }
  34414. }
  34415. var n = function(e, i) {
  34416. if (!e.map)
  34417. throw Error("field is not a map");
  34418. if (this.field = e,
  34419. this.keyElem = new t.Element(e.keyType,null,!0,e.syntax),
  34420. this.valueElem = new t.Element(e.type,e.resolvedType,!1,e.syntax),
  34421. this.map = {},
  34422. Object.defineProperty(this, "size", {
  34423. get: function() {
  34424. return Object.keys(this.map).length
  34425. }
  34426. }),
  34427. i)
  34428. for (var n = Object.keys(i), r = 0; r < n.length; r++) {
  34429. var o = this.keyElem.valueFromString(n[r])
  34430. , a = this.valueElem.verifyValue(i[n[r]]);
  34431. this.map[this.keyElem.valueToString(o)] = {
  34432. key: o,
  34433. value: a
  34434. }
  34435. }
  34436. }
  34437. , r = n.prototype;
  34438. return r.clear = function() {
  34439. this.map = {}
  34440. }
  34441. ,
  34442. r.delete = function(e) {
  34443. var t = this.keyElem.valueToString(this.keyElem.verifyValue(e))
  34444. , i = t in this.map;
  34445. return delete this.map[t],
  34446. i
  34447. }
  34448. ,
  34449. r.entries = function() {
  34450. for (var e, t = [], n = Object.keys(this.map), r = 0; r < n.length; r++)
  34451. t.push([(e = this.map[n[r]]).key, e.value]);
  34452. return i(t)
  34453. }
  34454. ,
  34455. r.keys = function() {
  34456. for (var e = [], t = Object.keys(this.map), n = 0; n < t.length; n++)
  34457. e.push(this.map[t[n]].key);
  34458. return i(e)
  34459. }
  34460. ,
  34461. r.values = function() {
  34462. for (var e = [], t = Object.keys(this.map), n = 0; n < t.length; n++)
  34463. e.push(this.map[t[n]].value);
  34464. return i(e)
  34465. }
  34466. ,
  34467. r.forEach = function(e, t) {
  34468. for (var i, n = Object.keys(this.map), r = 0; r < n.length; r++)
  34469. e.call(t, (i = this.map[n[r]]).value, i.key, this)
  34470. }
  34471. ,
  34472. r.set = function(e, t) {
  34473. var i = this.keyElem.verifyValue(e)
  34474. , n = this.valueElem.verifyValue(t);
  34475. return this.map[this.keyElem.valueToString(i)] = {
  34476. key: i,
  34477. value: n
  34478. },
  34479. this
  34480. }
  34481. ,
  34482. r.get = function(e) {
  34483. var t = this.keyElem.valueToString(this.keyElem.verifyValue(e));
  34484. if (t in this.map)
  34485. return this.map[t].value
  34486. }
  34487. ,
  34488. r.has = function(e) {
  34489. var t = this.keyElem.valueToString(this.keyElem.verifyValue(e));
  34490. return t in this.map
  34491. }
  34492. ,
  34493. n
  34494. }(r, r.Reflect),
  34495. r.loadProto = function(e, t, i) {
  34496. return ("string" == typeof t || t && "string" == typeof t.file && "string" == typeof t.root) && (i = t,
  34497. t = void 0),
  34498. r.loadJson(r.DotProto.Parser.parse(e), t, i)
  34499. }
  34500. ,
  34501. r.protoFromString = r.loadProto,
  34502. r.loadProtoFile = function(e, t, i) {
  34503. if (t && "object" == typeof t ? (i = t,
  34504. t = null) : t && "function" == typeof t || (t = null),
  34505. t)
  34506. return r.Util.fetch("string" == typeof e ? e : e.root + "/" + e.file, function(n) {
  34507. if (null === n)
  34508. return void t(Error("Failed to fetch file"));
  34509. try {
  34510. t(null, r.loadProto(n, i, e))
  34511. } catch (e) {
  34512. t(e)
  34513. }
  34514. });
  34515. var n = r.Util.fetch("object" == typeof e ? e.root + "/" + e.file : e);
  34516. return null === n ? null : r.loadProto(n, i, e)
  34517. }
  34518. ,
  34519. r.protoFromFile = r.loadProtoFile,
  34520. r.newBuilder = function(e) {
  34521. return e = e || {},
  34522. "undefined" == typeof e.convertFieldsToCamelCase && (e.convertFieldsToCamelCase = r.convertFieldsToCamelCase),
  34523. "undefined" == typeof e.populateAccessors && (e.populateAccessors = r.populateAccessors),
  34524. new r.Builder(e)
  34525. }
  34526. ,
  34527. r.loadJson = function(e, t, i) {
  34528. return ("string" == typeof t || t && "string" == typeof t.file && "string" == typeof t.root) && (i = t,
  34529. t = null),
  34530. t && "object" == typeof t || (t = r.newBuilder()),
  34531. "string" == typeof e && (e = JSON.parse(e)),
  34532. t.import(e, i),
  34533. t.resolveAll(),
  34534. t
  34535. }
  34536. ,
  34537. r.loadJsonFile = function(e, t, i) {
  34538. if (t && "object" == typeof t ? (i = t,
  34539. t = null) : t && "function" == typeof t || (t = null),
  34540. t)
  34541. return r.Util.fetch("string" == typeof e ? e : e.root + "/" + e.file, function(n) {
  34542. if (null === n)
  34543. return void t(Error("Failed to fetch file"));
  34544. try {
  34545. t(null, r.loadJson(JSON.parse(n), i, e))
  34546. } catch (e) {
  34547. t(e)
  34548. }
  34549. });
  34550. var n = r.Util.fetch("object" == typeof e ? e.root + "/" + e.file : e);
  34551. return null === n ? null : r.loadJson(JSON.parse(n), i, e)
  34552. }
  34553. ,
  34554. r
  34555. })
  34556. }
  34557. ).call(this, e("_process"))
  34558. }
  34559. , {
  34560. _process: 203,
  34561. bytebuffer: 215,
  34562. fs: 197,
  34563. path: 197
  34564. }],
  34565. 215: [function(e, t, i) {
  34566. !function(i, n) {
  34567. "function" == typeof define && define.amd ? define(["long"], n) : "function" == typeof e && "object" == typeof t && t && t.exports ? t.exports = function() {
  34568. var t;
  34569. try {
  34570. t = e("long")
  34571. } catch (e) {}
  34572. return n(t)
  34573. }() : (i.dcodeIO = i.dcodeIO || {}).ByteBuffer = n(i.dcodeIO.Long)
  34574. }(this, function(e) {
  34575. "use strict";
  34576. function t(e) {
  34577. var t = 0;
  34578. return function() {
  34579. return t < e.length ? e.charCodeAt(t++) : null
  34580. }
  34581. }
  34582. function i() {
  34583. var e = []
  34584. , t = [];
  34585. return function() {
  34586. return 0 === arguments.length ? t.join("") + l.apply(String, e) : (e.length + arguments.length > 1024 && (t.push(l.apply(String, e)),
  34587. e.length = 0),
  34588. void Array.prototype.push.apply(e, arguments))
  34589. }
  34590. }
  34591. function n(e, t, i, n, r) {
  34592. 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];
  34593. for (u += d,
  34594. o = p & (1 << -h) - 1,
  34595. p >>= -h,
  34596. h += s; h > 0; o = 256 * o + e[t + u],
  34597. u += d,
  34598. h -= 8)
  34599. ;
  34600. for (a = o & (1 << -h) - 1,
  34601. o >>= -h,
  34602. h += n; h > 0; a = 256 * a + e[t + u],
  34603. u += d,
  34604. h -= 8)
  34605. ;
  34606. if (0 === o)
  34607. o = 1 - c;
  34608. else {
  34609. if (o === l)
  34610. return a ? NaN : (p ? -1 : 1) * (1 / 0);
  34611. a += Math.pow(2, n),
  34612. o -= c
  34613. }
  34614. return (p ? -1 : 1) * a * Math.pow(2, o - n)
  34615. }
  34616. function r(e, t, i, n, r, o) {
  34617. 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;
  34618. for (t = Math.abs(t),
  34619. isNaN(t) || t === 1 / 0 ? (s = isNaN(t) ? 1 : 0,
  34620. a = h) : (a = Math.floor(Math.log(t) / Math.LN2),
  34621. t * (l = Math.pow(2, -a)) < 1 && (a--,
  34622. l *= 2),
  34623. t += a + u >= 1 ? d / l : d * Math.pow(2, 1 - u),
  34624. t * l >= 2 && (a++,
  34625. l /= 2),
  34626. a + u >= h ? (s = 0,
  34627. a = h) : a + u >= 1 ? (s = (t * l - 1) * Math.pow(2, r),
  34628. a += u) : (s = t * Math.pow(2, u - 1) * Math.pow(2, r),
  34629. a = 0)); r >= 8; e[i + p] = 255 & s,
  34630. p += f,
  34631. s /= 256,
  34632. r -= 8)
  34633. ;
  34634. for (a = a << r | s,
  34635. c += r; c > 0; e[i + p] = 255 & a,
  34636. p += f,
  34637. a /= 256,
  34638. c -= 8)
  34639. ;
  34640. e[i + p - f] |= 128 * g
  34641. }
  34642. var o = function(e, t, i) {
  34643. if ("undefined" == typeof e && (e = o.DEFAULT_CAPACITY),
  34644. "undefined" == typeof t && (t = o.DEFAULT_ENDIAN),
  34645. "undefined" == typeof i && (i = o.DEFAULT_NOASSERT),
  34646. !i) {
  34647. if (e |= 0,
  34648. e < 0)
  34649. throw RangeError("Illegal capacity");
  34650. t = !!t,
  34651. i = !!i
  34652. }
  34653. this.buffer = 0 === e ? s : new ArrayBuffer(e),
  34654. this.view = 0 === e ? null : new Uint8Array(this.buffer),
  34655. this.offset = 0,
  34656. this.markedOffset = -1,
  34657. this.limit = e,
  34658. this.littleEndian = t,
  34659. this.noAssert = i
  34660. };
  34661. o.VERSION = "5.0.1",
  34662. o.LITTLE_ENDIAN = !0,
  34663. o.BIG_ENDIAN = !1,
  34664. o.DEFAULT_CAPACITY = 16,
  34665. o.DEFAULT_ENDIAN = o.BIG_ENDIAN,
  34666. o.DEFAULT_NOASSERT = !1,
  34667. o.Long = e || null;
  34668. var a = o.prototype;
  34669. a.__isByteBuffer__,
  34670. Object.defineProperty(a, "__isByteBuffer__", {
  34671. value: !0,
  34672. enumerable: !1,
  34673. configurable: !1
  34674. });
  34675. var s = new ArrayBuffer(0)
  34676. , l = String.fromCharCode;
  34677. o.accessor = function() {
  34678. return Uint8Array
  34679. }
  34680. ,
  34681. o.allocate = function(e, t, i) {
  34682. return new o(e,t,i)
  34683. }
  34684. ,
  34685. o.concat = function(e, t, i, n) {
  34686. "boolean" != typeof t && "string" == typeof t || (n = i,
  34687. i = t,
  34688. t = void 0);
  34689. for (var r, a = 0, s = 0, l = e.length; s < l; ++s)
  34690. o.isByteBuffer(e[s]) || (e[s] = o.wrap(e[s], t)),
  34691. r = e[s].limit - e[s].offset,
  34692. r > 0 && (a += r);
  34693. if (0 === a)
  34694. return new o(0,i,n);
  34695. var c, h = new o(a,i,n);
  34696. for (s = 0; s < l; )
  34697. c = e[s++],
  34698. r = c.limit - c.offset,
  34699. r <= 0 || (h.view.set(c.view.subarray(c.offset, c.limit), h.offset),
  34700. h.offset += r);
  34701. return h.limit = h.offset,
  34702. h.offset = 0,
  34703. h
  34704. }
  34705. ,
  34706. o.isByteBuffer = function(e) {
  34707. return (e && e.__isByteBuffer__) === !0
  34708. }
  34709. ,
  34710. o.type = function() {
  34711. return ArrayBuffer
  34712. }
  34713. ,
  34714. o.wrap = function(e, t, i, n) {
  34715. if ("string" != typeof t && (n = i,
  34716. i = t,
  34717. t = void 0),
  34718. "string" == typeof e)
  34719. switch ("undefined" == typeof t && (t = "utf8"),
  34720. t) {
  34721. case "base64":
  34722. return o.fromBase64(e, i);
  34723. case "hex":
  34724. return o.fromHex(e, i);
  34725. case "binary":
  34726. return o.fromBinary(e, i);
  34727. case "utf8":
  34728. return o.fromUTF8(e, i);
  34729. case "debug":
  34730. return o.fromDebug(e, i);
  34731. default:
  34732. throw Error("Unsupported encoding: " + t)
  34733. }
  34734. if (null === e || "object" != typeof e)
  34735. throw TypeError("Illegal buffer");
  34736. var r;
  34737. if (o.isByteBuffer(e))
  34738. return r = a.clone.call(e),
  34739. r.markedOffset = -1,
  34740. r;
  34741. if (e instanceof Uint8Array)
  34742. r = new o(0,i,n),
  34743. e.length > 0 && (r.buffer = e.buffer,
  34744. r.offset = e.byteOffset,
  34745. r.limit = e.byteOffset + e.byteLength,
  34746. r.view = new Uint8Array(e.buffer));
  34747. else if (e instanceof ArrayBuffer)
  34748. r = new o(0,i,n),
  34749. e.byteLength > 0 && (r.buffer = e,
  34750. r.offset = 0,
  34751. r.limit = e.byteLength,
  34752. r.view = e.byteLength > 0 ? new Uint8Array(e) : null);
  34753. else {
  34754. if ("[object Array]" !== Object.prototype.toString.call(e))
  34755. throw TypeError("Illegal buffer");
  34756. r = new o(e.length,i,n),
  34757. r.limit = e.length;
  34758. for (var s = 0; s < e.length; ++s)
  34759. r.view[s] = e[s]
  34760. }
  34761. return r
  34762. }
  34763. ,
  34764. a.writeBitSet = function(e, t) {
  34765. var i = "undefined" == typeof t;
  34766. if (i && (t = this.offset),
  34767. !this.noAssert) {
  34768. if (!(e instanceof Array))
  34769. throw TypeError("Illegal BitSet: Not an array");
  34770. if ("number" != typeof t || t % 1 !== 0)
  34771. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34772. if (t >>>= 0,
  34773. t < 0 || t + 0 > this.buffer.byteLength)
  34774. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34775. }
  34776. var n, r = t, o = e.length, a = o >> 3, s = 0;
  34777. for (t += this.writeVarint32(o, t); a--; )
  34778. 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,
  34779. this.writeByte(n, t++);
  34780. if (s < o) {
  34781. var l = 0;
  34782. for (n = 0; s < o; )
  34783. n |= (1 & !!e[s++]) << l++;
  34784. this.writeByte(n, t++)
  34785. }
  34786. return i ? (this.offset = t,
  34787. this) : t - r
  34788. }
  34789. ,
  34790. a.readBitSet = function(e) {
  34791. var t = "undefined" == typeof e;
  34792. t && (e = this.offset);
  34793. var i, n = this.readVarint32(e), r = n.value, o = r >> 3, a = 0, s = [];
  34794. for (e += n.length; o--; )
  34795. i = this.readByte(e++),
  34796. s[a++] = !!(1 & i),
  34797. s[a++] = !!(2 & i),
  34798. s[a++] = !!(4 & i),
  34799. s[a++] = !!(8 & i),
  34800. s[a++] = !!(16 & i),
  34801. s[a++] = !!(32 & i),
  34802. s[a++] = !!(64 & i),
  34803. s[a++] = !!(128 & i);
  34804. if (a < r) {
  34805. var l = 0;
  34806. for (i = this.readByte(e++); a < r; )
  34807. s[a++] = !!(i >> l++ & 1)
  34808. }
  34809. return t && (this.offset = e),
  34810. s
  34811. }
  34812. ,
  34813. a.readBytes = function(e, t) {
  34814. var i = "undefined" == typeof t;
  34815. if (i && (t = this.offset),
  34816. !this.noAssert) {
  34817. if ("number" != typeof t || t % 1 !== 0)
  34818. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34819. if (t >>>= 0,
  34820. t < 0 || t + e > this.buffer.byteLength)
  34821. throw RangeError("Illegal offset: 0 <= " + t + " (+" + e + ") <= " + this.buffer.byteLength)
  34822. }
  34823. var n = this.slice(t, t + e);
  34824. return i && (this.offset += e),
  34825. n
  34826. }
  34827. ,
  34828. a.writeBytes = a.append,
  34829. a.writeInt8 = function(e, t) {
  34830. var i = "undefined" == typeof t;
  34831. if (i && (t = this.offset),
  34832. !this.noAssert) {
  34833. if ("number" != typeof e || e % 1 !== 0)
  34834. throw TypeError("Illegal value: " + e + " (not an integer)");
  34835. if (e |= 0,
  34836. "number" != typeof t || t % 1 !== 0)
  34837. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34838. if (t >>>= 0,
  34839. t < 0 || t + 0 > this.buffer.byteLength)
  34840. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34841. }
  34842. t += 1;
  34843. var n = this.buffer.byteLength;
  34844. return t > n && this.resize((n *= 2) > t ? n : t),
  34845. t -= 1,
  34846. this.view[t] = e,
  34847. i && (this.offset += 1),
  34848. this
  34849. }
  34850. ,
  34851. a.writeByte = a.writeInt8,
  34852. a.readInt8 = function(e) {
  34853. var t = "undefined" == typeof e;
  34854. if (t && (e = this.offset),
  34855. !this.noAssert) {
  34856. if ("number" != typeof e || e % 1 !== 0)
  34857. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34858. if (e >>>= 0,
  34859. e < 0 || e + 1 > this.buffer.byteLength)
  34860. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  34861. }
  34862. var i = this.view[e];
  34863. return 128 === (128 & i) && (i = -(255 - i + 1)),
  34864. t && (this.offset += 1),
  34865. i
  34866. }
  34867. ,
  34868. a.readByte = a.readInt8,
  34869. a.writeUint8 = function(e, t) {
  34870. var i = "undefined" == typeof t;
  34871. if (i && (t = this.offset),
  34872. !this.noAssert) {
  34873. if ("number" != typeof e || e % 1 !== 0)
  34874. throw TypeError("Illegal value: " + e + " (not an integer)");
  34875. if (e >>>= 0,
  34876. "number" != typeof t || t % 1 !== 0)
  34877. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34878. if (t >>>= 0,
  34879. t < 0 || t + 0 > this.buffer.byteLength)
  34880. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34881. }
  34882. t += 1;
  34883. var n = this.buffer.byteLength;
  34884. return t > n && this.resize((n *= 2) > t ? n : t),
  34885. t -= 1,
  34886. this.view[t] = e,
  34887. i && (this.offset += 1),
  34888. this
  34889. }
  34890. ,
  34891. a.writeUInt8 = a.writeUint8,
  34892. a.readUint8 = function(e) {
  34893. var t = "undefined" == typeof e;
  34894. if (t && (e = this.offset),
  34895. !this.noAssert) {
  34896. if ("number" != typeof e || e % 1 !== 0)
  34897. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34898. if (e >>>= 0,
  34899. e < 0 || e + 1 > this.buffer.byteLength)
  34900. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  34901. }
  34902. var i = this.view[e];
  34903. return t && (this.offset += 1),
  34904. i
  34905. }
  34906. ,
  34907. a.readUInt8 = a.readUint8,
  34908. a.writeInt16 = function(e, t) {
  34909. var i = "undefined" == typeof t;
  34910. if (i && (t = this.offset),
  34911. !this.noAssert) {
  34912. if ("number" != typeof e || e % 1 !== 0)
  34913. throw TypeError("Illegal value: " + e + " (not an integer)");
  34914. if (e |= 0,
  34915. "number" != typeof t || t % 1 !== 0)
  34916. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34917. if (t >>>= 0,
  34918. t < 0 || t + 0 > this.buffer.byteLength)
  34919. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34920. }
  34921. t += 2;
  34922. var n = this.buffer.byteLength;
  34923. return t > n && this.resize((n *= 2) > t ? n : t),
  34924. t -= 2,
  34925. this.littleEndian ? (this.view[t + 1] = (65280 & e) >>> 8,
  34926. this.view[t] = 255 & e) : (this.view[t] = (65280 & e) >>> 8,
  34927. this.view[t + 1] = 255 & e),
  34928. i && (this.offset += 2),
  34929. this
  34930. }
  34931. ,
  34932. a.writeShort = a.writeInt16,
  34933. a.readInt16 = function(e) {
  34934. var t = "undefined" == typeof e;
  34935. if (t && (e = this.offset),
  34936. !this.noAssert) {
  34937. if ("number" != typeof e || e % 1 !== 0)
  34938. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34939. if (e >>>= 0,
  34940. e < 0 || e + 2 > this.buffer.byteLength)
  34941. throw RangeError("Illegal offset: 0 <= " + e + " (+2) <= " + this.buffer.byteLength)
  34942. }
  34943. var i = 0;
  34944. return this.littleEndian ? (i = this.view[e],
  34945. i |= this.view[e + 1] << 8) : (i = this.view[e] << 8,
  34946. i |= this.view[e + 1]),
  34947. 32768 === (32768 & i) && (i = -(65535 - i + 1)),
  34948. t && (this.offset += 2),
  34949. i
  34950. }
  34951. ,
  34952. a.readShort = a.readInt16,
  34953. a.writeUint16 = function(e, t) {
  34954. var i = "undefined" == typeof t;
  34955. if (i && (t = this.offset),
  34956. !this.noAssert) {
  34957. if ("number" != typeof e || e % 1 !== 0)
  34958. throw TypeError("Illegal value: " + e + " (not an integer)");
  34959. if (e >>>= 0,
  34960. "number" != typeof t || t % 1 !== 0)
  34961. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34962. if (t >>>= 0,
  34963. t < 0 || t + 0 > this.buffer.byteLength)
  34964. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34965. }
  34966. t += 2;
  34967. var n = this.buffer.byteLength;
  34968. return t > n && this.resize((n *= 2) > t ? n : t),
  34969. t -= 2,
  34970. this.littleEndian ? (this.view[t + 1] = (65280 & e) >>> 8,
  34971. this.view[t] = 255 & e) : (this.view[t] = (65280 & e) >>> 8,
  34972. this.view[t + 1] = 255 & e),
  34973. i && (this.offset += 2),
  34974. this
  34975. }
  34976. ,
  34977. a.writeUInt16 = a.writeUint16,
  34978. a.readUint16 = function(e) {
  34979. var t = "undefined" == typeof e;
  34980. if (t && (e = this.offset),
  34981. !this.noAssert) {
  34982. if ("number" != typeof e || e % 1 !== 0)
  34983. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34984. if (e >>>= 0,
  34985. e < 0 || e + 2 > this.buffer.byteLength)
  34986. throw RangeError("Illegal offset: 0 <= " + e + " (+2) <= " + this.buffer.byteLength)
  34987. }
  34988. var i = 0;
  34989. return this.littleEndian ? (i = this.view[e],
  34990. i |= this.view[e + 1] << 8) : (i = this.view[e] << 8,
  34991. i |= this.view[e + 1]),
  34992. t && (this.offset += 2),
  34993. i
  34994. }
  34995. ,
  34996. a.readUInt16 = a.readUint16,
  34997. a.writeInt32 = function(e, t) {
  34998. var i = "undefined" == typeof t;
  34999. if (i && (t = this.offset),
  35000. !this.noAssert) {
  35001. if ("number" != typeof e || e % 1 !== 0)
  35002. throw TypeError("Illegal value: " + e + " (not an integer)");
  35003. if (e |= 0,
  35004. "number" != typeof t || t % 1 !== 0)
  35005. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35006. if (t >>>= 0,
  35007. t < 0 || t + 0 > this.buffer.byteLength)
  35008. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35009. }
  35010. t += 4;
  35011. var n = this.buffer.byteLength;
  35012. return t > n && this.resize((n *= 2) > t ? n : t),
  35013. t -= 4,
  35014. this.littleEndian ? (this.view[t + 3] = e >>> 24 & 255,
  35015. this.view[t + 2] = e >>> 16 & 255,
  35016. this.view[t + 1] = e >>> 8 & 255,
  35017. this.view[t] = 255 & e) : (this.view[t] = e >>> 24 & 255,
  35018. this.view[t + 1] = e >>> 16 & 255,
  35019. this.view[t + 2] = e >>> 8 & 255,
  35020. this.view[t + 3] = 255 & e),
  35021. i && (this.offset += 4),
  35022. this
  35023. }
  35024. ,
  35025. a.writeInt = a.writeInt32,
  35026. a.readInt32 = function(e) {
  35027. var t = "undefined" == typeof e;
  35028. if (t && (e = this.offset),
  35029. !this.noAssert) {
  35030. if ("number" != typeof e || e % 1 !== 0)
  35031. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35032. if (e >>>= 0,
  35033. e < 0 || e + 4 > this.buffer.byteLength)
  35034. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  35035. }
  35036. var i = 0;
  35037. return this.littleEndian ? (i = this.view[e + 2] << 16,
  35038. i |= this.view[e + 1] << 8,
  35039. i |= this.view[e],
  35040. i += this.view[e + 3] << 24 >>> 0) : (i = this.view[e + 1] << 16,
  35041. i |= this.view[e + 2] << 8,
  35042. i |= this.view[e + 3],
  35043. i += this.view[e] << 24 >>> 0),
  35044. i |= 0,
  35045. t && (this.offset += 4),
  35046. i
  35047. }
  35048. ,
  35049. a.readInt = a.readInt32,
  35050. a.writeUint32 = function(e, t) {
  35051. var i = "undefined" == typeof t;
  35052. if (i && (t = this.offset),
  35053. !this.noAssert) {
  35054. if ("number" != typeof e || e % 1 !== 0)
  35055. throw TypeError("Illegal value: " + e + " (not an integer)");
  35056. if (e >>>= 0,
  35057. "number" != typeof t || t % 1 !== 0)
  35058. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35059. if (t >>>= 0,
  35060. t < 0 || t + 0 > this.buffer.byteLength)
  35061. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35062. }
  35063. t += 4;
  35064. var n = this.buffer.byteLength;
  35065. return t > n && this.resize((n *= 2) > t ? n : t),
  35066. t -= 4,
  35067. this.littleEndian ? (this.view[t + 3] = e >>> 24 & 255,
  35068. this.view[t + 2] = e >>> 16 & 255,
  35069. this.view[t + 1] = e >>> 8 & 255,
  35070. this.view[t] = 255 & e) : (this.view[t] = e >>> 24 & 255,
  35071. this.view[t + 1] = e >>> 16 & 255,
  35072. this.view[t + 2] = e >>> 8 & 255,
  35073. this.view[t + 3] = 255 & e),
  35074. i && (this.offset += 4),
  35075. this
  35076. }
  35077. ,
  35078. a.writeUInt32 = a.writeUint32,
  35079. a.readUint32 = function(e) {
  35080. var t = "undefined" == typeof e;
  35081. if (t && (e = this.offset),
  35082. !this.noAssert) {
  35083. if ("number" != typeof e || e % 1 !== 0)
  35084. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35085. if (e >>>= 0,
  35086. e < 0 || e + 4 > this.buffer.byteLength)
  35087. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  35088. }
  35089. var i = 0;
  35090. return this.littleEndian ? (i = this.view[e + 2] << 16,
  35091. i |= this.view[e + 1] << 8,
  35092. i |= this.view[e],
  35093. i += this.view[e + 3] << 24 >>> 0) : (i = this.view[e + 1] << 16,
  35094. i |= this.view[e + 2] << 8,
  35095. i |= this.view[e + 3],
  35096. i += this.view[e] << 24 >>> 0),
  35097. t && (this.offset += 4),
  35098. i
  35099. }
  35100. ,
  35101. a.readUInt32 = a.readUint32,
  35102. e && (a.writeInt64 = function(t, i) {
  35103. var n = "undefined" == typeof i;
  35104. if (n && (i = this.offset),
  35105. !this.noAssert) {
  35106. if ("number" == typeof t)
  35107. t = e.fromNumber(t);
  35108. else if ("string" == typeof t)
  35109. t = e.fromString(t);
  35110. else if (!(t && t instanceof e))
  35111. throw TypeError("Illegal value: " + t + " (not an integer or Long)");
  35112. if ("number" != typeof i || i % 1 !== 0)
  35113. throw TypeError("Illegal offset: " + i + " (not an integer)");
  35114. if (i >>>= 0,
  35115. i < 0 || i + 0 > this.buffer.byteLength)
  35116. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  35117. }
  35118. "number" == typeof t ? t = e.fromNumber(t) : "string" == typeof t && (t = e.fromString(t)),
  35119. i += 8;
  35120. var r = this.buffer.byteLength;
  35121. i > r && this.resize((r *= 2) > i ? r : i),
  35122. i -= 8;
  35123. var o = t.low
  35124. , a = t.high;
  35125. return this.littleEndian ? (this.view[i + 3] = o >>> 24 & 255,
  35126. this.view[i + 2] = o >>> 16 & 255,
  35127. this.view[i + 1] = o >>> 8 & 255,
  35128. this.view[i] = 255 & o,
  35129. i += 4,
  35130. this.view[i + 3] = a >>> 24 & 255,
  35131. this.view[i + 2] = a >>> 16 & 255,
  35132. this.view[i + 1] = a >>> 8 & 255,
  35133. this.view[i] = 255 & a) : (this.view[i] = a >>> 24 & 255,
  35134. this.view[i + 1] = a >>> 16 & 255,
  35135. this.view[i + 2] = a >>> 8 & 255,
  35136. this.view[i + 3] = 255 & a,
  35137. i += 4,
  35138. this.view[i] = o >>> 24 & 255,
  35139. this.view[i + 1] = o >>> 16 & 255,
  35140. this.view[i + 2] = o >>> 8 & 255,
  35141. this.view[i + 3] = 255 & o),
  35142. n && (this.offset += 8),
  35143. this
  35144. }
  35145. ,
  35146. a.writeLong = a.writeInt64,
  35147. a.readInt64 = function(t) {
  35148. var i = "undefined" == typeof t;
  35149. if (i && (t = this.offset),
  35150. !this.noAssert) {
  35151. if ("number" != typeof t || t % 1 !== 0)
  35152. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35153. if (t >>>= 0,
  35154. t < 0 || t + 8 > this.buffer.byteLength)
  35155. throw RangeError("Illegal offset: 0 <= " + t + " (+8) <= " + this.buffer.byteLength)
  35156. }
  35157. var n = 0
  35158. , r = 0;
  35159. this.littleEndian ? (n = this.view[t + 2] << 16,
  35160. n |= this.view[t + 1] << 8,
  35161. n |= this.view[t],
  35162. n += this.view[t + 3] << 24 >>> 0,
  35163. t += 4,
  35164. r = this.view[t + 2] << 16,
  35165. r |= this.view[t + 1] << 8,
  35166. r |= this.view[t],
  35167. r += this.view[t + 3] << 24 >>> 0) : (r = this.view[t + 1] << 16,
  35168. r |= this.view[t + 2] << 8,
  35169. r |= this.view[t + 3],
  35170. r += this.view[t] << 24 >>> 0,
  35171. t += 4,
  35172. n = this.view[t + 1] << 16,
  35173. n |= this.view[t + 2] << 8,
  35174. n |= this.view[t + 3],
  35175. n += this.view[t] << 24 >>> 0);
  35176. var o = new e(n,r,!1);
  35177. return i && (this.offset += 8),
  35178. o
  35179. }
  35180. ,
  35181. a.readLong = a.readInt64,
  35182. a.writeUint64 = function(t, i) {
  35183. var n = "undefined" == typeof i;
  35184. if (n && (i = this.offset),
  35185. !this.noAssert) {
  35186. if ("number" == typeof t)
  35187. t = e.fromNumber(t);
  35188. else if ("string" == typeof t)
  35189. t = e.fromString(t);
  35190. else if (!(t && t instanceof e))
  35191. throw TypeError("Illegal value: " + t + " (not an integer or Long)");
  35192. if ("number" != typeof i || i % 1 !== 0)
  35193. throw TypeError("Illegal offset: " + i + " (not an integer)");
  35194. if (i >>>= 0,
  35195. i < 0 || i + 0 > this.buffer.byteLength)
  35196. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  35197. }
  35198. "number" == typeof t ? t = e.fromNumber(t) : "string" == typeof t && (t = e.fromString(t)),
  35199. i += 8;
  35200. var r = this.buffer.byteLength;
  35201. i > r && this.resize((r *= 2) > i ? r : i),
  35202. i -= 8;
  35203. var o = t.low
  35204. , a = t.high;
  35205. return this.littleEndian ? (this.view[i + 3] = o >>> 24 & 255,
  35206. this.view[i + 2] = o >>> 16 & 255,
  35207. this.view[i + 1] = o >>> 8 & 255,
  35208. this.view[i] = 255 & o,
  35209. i += 4,
  35210. this.view[i + 3] = a >>> 24 & 255,
  35211. this.view[i + 2] = a >>> 16 & 255,
  35212. this.view[i + 1] = a >>> 8 & 255,
  35213. this.view[i] = 255 & a) : (this.view[i] = a >>> 24 & 255,
  35214. this.view[i + 1] = a >>> 16 & 255,
  35215. this.view[i + 2] = a >>> 8 & 255,
  35216. this.view[i + 3] = 255 & a,
  35217. i += 4,
  35218. this.view[i] = o >>> 24 & 255,
  35219. this.view[i + 1] = o >>> 16 & 255,
  35220. this.view[i + 2] = o >>> 8 & 255,
  35221. this.view[i + 3] = 255 & o),
  35222. n && (this.offset += 8),
  35223. this
  35224. }
  35225. ,
  35226. a.writeUInt64 = a.writeUint64,
  35227. a.readUint64 = function(t) {
  35228. var i = "undefined" == typeof t;
  35229. if (i && (t = this.offset),
  35230. !this.noAssert) {
  35231. if ("number" != typeof t || t % 1 !== 0)
  35232. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35233. if (t >>>= 0,
  35234. t < 0 || t + 8 > this.buffer.byteLength)
  35235. throw RangeError("Illegal offset: 0 <= " + t + " (+8) <= " + this.buffer.byteLength)
  35236. }
  35237. var n = 0
  35238. , r = 0;
  35239. this.littleEndian ? (n = this.view[t + 2] << 16,
  35240. n |= this.view[t + 1] << 8,
  35241. n |= this.view[t],
  35242. n += this.view[t + 3] << 24 >>> 0,
  35243. t += 4,
  35244. r = this.view[t + 2] << 16,
  35245. r |= this.view[t + 1] << 8,
  35246. r |= this.view[t],
  35247. r += this.view[t + 3] << 24 >>> 0) : (r = this.view[t + 1] << 16,
  35248. r |= this.view[t + 2] << 8,
  35249. r |= this.view[t + 3],
  35250. r += this.view[t] << 24 >>> 0,
  35251. t += 4,
  35252. n = this.view[t + 1] << 16,
  35253. n |= this.view[t + 2] << 8,
  35254. n |= this.view[t + 3],
  35255. n += this.view[t] << 24 >>> 0);
  35256. var o = new e(n,r,!0);
  35257. return i && (this.offset += 8),
  35258. o
  35259. }
  35260. ,
  35261. a.readUInt64 = a.readUint64),
  35262. a.writeFloat32 = function(e, t) {
  35263. var i = "undefined" == typeof t;
  35264. if (i && (t = this.offset),
  35265. !this.noAssert) {
  35266. if ("number" != typeof e)
  35267. throw TypeError("Illegal value: " + e + " (not a number)");
  35268. if ("number" != typeof t || t % 1 !== 0)
  35269. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35270. if (t >>>= 0,
  35271. t < 0 || t + 0 > this.buffer.byteLength)
  35272. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35273. }
  35274. t += 4;
  35275. var n = this.buffer.byteLength;
  35276. return t > n && this.resize((n *= 2) > t ? n : t),
  35277. t -= 4,
  35278. r(this.view, e, t, this.littleEndian, 23, 4),
  35279. i && (this.offset += 4),
  35280. this
  35281. }
  35282. ,
  35283. a.writeFloat = a.writeFloat32,
  35284. a.readFloat32 = function(e) {
  35285. var t = "undefined" == typeof e;
  35286. if (t && (e = this.offset),
  35287. !this.noAssert) {
  35288. if ("number" != typeof e || e % 1 !== 0)
  35289. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35290. if (e >>>= 0,
  35291. e < 0 || e + 4 > this.buffer.byteLength)
  35292. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  35293. }
  35294. var i = n(this.view, e, this.littleEndian, 23, 4);
  35295. return t && (this.offset += 4),
  35296. i
  35297. }
  35298. ,
  35299. a.readFloat = a.readFloat32,
  35300. a.writeFloat64 = function(e, t) {
  35301. var i = "undefined" == typeof t;
  35302. if (i && (t = this.offset),
  35303. !this.noAssert) {
  35304. if ("number" != typeof e)
  35305. throw TypeError("Illegal value: " + e + " (not a number)");
  35306. if ("number" != typeof t || t % 1 !== 0)
  35307. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35308. if (t >>>= 0,
  35309. t < 0 || t + 0 > this.buffer.byteLength)
  35310. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35311. }
  35312. t += 8;
  35313. var n = this.buffer.byteLength;
  35314. return t > n && this.resize((n *= 2) > t ? n : t),
  35315. t -= 8,
  35316. r(this.view, e, t, this.littleEndian, 52, 8),
  35317. i && (this.offset += 8),
  35318. this
  35319. }
  35320. ,
  35321. a.writeDouble = a.writeFloat64,
  35322. a.readFloat64 = function(e) {
  35323. var t = "undefined" == typeof e;
  35324. if (t && (e = this.offset),
  35325. !this.noAssert) {
  35326. if ("number" != typeof e || e % 1 !== 0)
  35327. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35328. if (e >>>= 0,
  35329. e < 0 || e + 8 > this.buffer.byteLength)
  35330. throw RangeError("Illegal offset: 0 <= " + e + " (+8) <= " + this.buffer.byteLength)
  35331. }
  35332. var i = n(this.view, e, this.littleEndian, 52, 8);
  35333. return t && (this.offset += 8),
  35334. i
  35335. }
  35336. ,
  35337. a.readDouble = a.readFloat64,
  35338. o.MAX_VARINT32_BYTES = 5,
  35339. o.calculateVarint32 = function(e) {
  35340. return e >>>= 0,
  35341. e < 128 ? 1 : e < 16384 ? 2 : e < 1 << 21 ? 3 : e < 1 << 28 ? 4 : 5
  35342. }
  35343. ,
  35344. o.zigZagEncode32 = function(e) {
  35345. return ((e |= 0) << 1 ^ e >> 31) >>> 0
  35346. }
  35347. ,
  35348. o.zigZagDecode32 = function(e) {
  35349. return e >>> 1 ^ -(1 & e) | 0
  35350. }
  35351. ,
  35352. a.writeVarint32 = function(e, t) {
  35353. var i = "undefined" == typeof t;
  35354. if (i && (t = this.offset),
  35355. !this.noAssert) {
  35356. if ("number" != typeof e || e % 1 !== 0)
  35357. throw TypeError("Illegal value: " + e + " (not an integer)");
  35358. if (e |= 0,
  35359. "number" != typeof t || t % 1 !== 0)
  35360. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35361. if (t >>>= 0,
  35362. t < 0 || t + 0 > this.buffer.byteLength)
  35363. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35364. }
  35365. var n, r = o.calculateVarint32(e);
  35366. t += r;
  35367. var a = this.buffer.byteLength;
  35368. for (t > a && this.resize((a *= 2) > t ? a : t),
  35369. t -= r,
  35370. e >>>= 0; e >= 128; )
  35371. n = 127 & e | 128,
  35372. this.view[t++] = n,
  35373. e >>>= 7;
  35374. return this.view[t++] = e,
  35375. i ? (this.offset = t,
  35376. this) : r
  35377. }
  35378. ,
  35379. a.writeVarint32ZigZag = function(e, t) {
  35380. return this.writeVarint32(o.zigZagEncode32(e), t)
  35381. }
  35382. ,
  35383. a.readVarint32 = function(e) {
  35384. var t = "undefined" == typeof e;
  35385. if (t && (e = this.offset),
  35386. !this.noAssert) {
  35387. if ("number" != typeof e || e % 1 !== 0)
  35388. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35389. if (e >>>= 0,
  35390. e < 0 || e + 1 > this.buffer.byteLength)
  35391. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  35392. }
  35393. var i, n = 0, r = 0;
  35394. do {
  35395. if (!this.noAssert && e > this.limit) {
  35396. var o = Error("Truncated");
  35397. throw o.truncated = !0,
  35398. o
  35399. }
  35400. i = this.view[e++],
  35401. n < 5 && (r |= (127 & i) << 7 * n),
  35402. ++n
  35403. } while (0 !== (128 & i));return r |= 0,
  35404. t ? (this.offset = e,
  35405. r) : {
  35406. value: r,
  35407. length: n
  35408. }
  35409. }
  35410. ,
  35411. a.readVarint32ZigZag = function(e) {
  35412. var t = this.readVarint32(e);
  35413. return "object" == typeof t ? t.value = o.zigZagDecode32(t.value) : t = o.zigZagDecode32(t),
  35414. t
  35415. }
  35416. ,
  35417. e && (o.MAX_VARINT64_BYTES = 10,
  35418. o.calculateVarint64 = function(t) {
  35419. "number" == typeof t ? t = e.fromNumber(t) : "string" == typeof t && (t = e.fromString(t));
  35420. var i = t.toInt() >>> 0
  35421. , n = t.shiftRightUnsigned(28).toInt() >>> 0
  35422. , r = t.shiftRightUnsigned(56).toInt() >>> 0;
  35423. 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
  35424. }
  35425. ,
  35426. o.zigZagEncode64 = function(t) {
  35427. return "number" == typeof t ? t = e.fromNumber(t, !1) : "string" == typeof t ? t = e.fromString(t, !1) : t.unsigned !== !1 && (t = t.toSigned()),
  35428. t.shiftLeft(1).xor(t.shiftRight(63)).toUnsigned()
  35429. }
  35430. ,
  35431. o.zigZagDecode64 = function(t) {
  35432. return "number" == typeof t ? t = e.fromNumber(t, !1) : "string" == typeof t ? t = e.fromString(t, !1) : t.unsigned !== !1 && (t = t.toSigned()),
  35433. t.shiftRightUnsigned(1).xor(t.and(e.ONE).toSigned().negate()).toSigned()
  35434. }
  35435. ,
  35436. a.writeVarint64 = function(t, i) {
  35437. var n = "undefined" == typeof i;
  35438. if (n && (i = this.offset),
  35439. !this.noAssert) {
  35440. if ("number" == typeof t)
  35441. t = e.fromNumber(t);
  35442. else if ("string" == typeof t)
  35443. t = e.fromString(t);
  35444. else if (!(t && t instanceof e))
  35445. throw TypeError("Illegal value: " + t + " (not an integer or Long)");
  35446. if ("number" != typeof i || i % 1 !== 0)
  35447. throw TypeError("Illegal offset: " + i + " (not an integer)");
  35448. if (i >>>= 0,
  35449. i < 0 || i + 0 > this.buffer.byteLength)
  35450. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  35451. }
  35452. "number" == typeof t ? t = e.fromNumber(t, !1) : "string" == typeof t ? t = e.fromString(t, !1) : t.unsigned !== !1 && (t = t.toSigned());
  35453. var r = o.calculateVarint64(t)
  35454. , a = t.toInt() >>> 0
  35455. , s = t.shiftRightUnsigned(28).toInt() >>> 0
  35456. , l = t.shiftRightUnsigned(56).toInt() >>> 0;
  35457. i += r;
  35458. var c = this.buffer.byteLength;
  35459. switch (i > c && this.resize((c *= 2) > i ? c : i),
  35460. i -= r,
  35461. r) {
  35462. case 10:
  35463. this.view[i + 9] = l >>> 7 & 1;
  35464. case 9:
  35465. this.view[i + 8] = 9 !== r ? 128 | l : 127 & l;
  35466. case 8:
  35467. this.view[i + 7] = 8 !== r ? s >>> 21 | 128 : s >>> 21 & 127;
  35468. case 7:
  35469. this.view[i + 6] = 7 !== r ? s >>> 14 | 128 : s >>> 14 & 127;
  35470. case 6:
  35471. this.view[i + 5] = 6 !== r ? s >>> 7 | 128 : s >>> 7 & 127;
  35472. case 5:
  35473. this.view[i + 4] = 5 !== r ? 128 | s : 127 & s;
  35474. case 4:
  35475. this.view[i + 3] = 4 !== r ? a >>> 21 | 128 : a >>> 21 & 127;
  35476. case 3:
  35477. this.view[i + 2] = 3 !== r ? a >>> 14 | 128 : a >>> 14 & 127;
  35478. case 2:
  35479. this.view[i + 1] = 2 !== r ? a >>> 7 | 128 : a >>> 7 & 127;
  35480. case 1:
  35481. this.view[i] = 1 !== r ? 128 | a : 127 & a
  35482. }
  35483. return n ? (this.offset += r,
  35484. this) : r
  35485. }
  35486. ,
  35487. a.writeVarint64ZigZag = function(e, t) {
  35488. return this.writeVarint64(o.zigZagEncode64(e), t)
  35489. }
  35490. ,
  35491. a.readVarint64 = function(t) {
  35492. var i = "undefined" == typeof t;
  35493. if (i && (t = this.offset),
  35494. !this.noAssert) {
  35495. if ("number" != typeof t || t % 1 !== 0)
  35496. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35497. if (t >>>= 0,
  35498. t < 0 || t + 1 > this.buffer.byteLength)
  35499. throw RangeError("Illegal offset: 0 <= " + t + " (+1) <= " + this.buffer.byteLength)
  35500. }
  35501. var n = t
  35502. , r = 0
  35503. , o = 0
  35504. , a = 0
  35505. , s = 0;
  35506. if (s = this.view[t++],
  35507. r = 127 & s,
  35508. 128 & s && (s = this.view[t++],
  35509. r |= (127 & s) << 7,
  35510. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  35511. r |= (127 & s) << 14,
  35512. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  35513. r |= (127 & s) << 21,
  35514. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  35515. o = 127 & s,
  35516. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  35517. o |= (127 & s) << 7,
  35518. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  35519. o |= (127 & s) << 14,
  35520. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  35521. o |= (127 & s) << 21,
  35522. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  35523. a = 127 & s,
  35524. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  35525. a |= (127 & s) << 7,
  35526. 128 & s || this.noAssert && "undefined" == typeof s))))))))))
  35527. throw Error("Buffer overrun");
  35528. var l = e.fromBits(r | o << 28, o >>> 4 | a << 24, !1);
  35529. return i ? (this.offset = t,
  35530. l) : {
  35531. value: l,
  35532. length: t - n
  35533. }
  35534. }
  35535. ,
  35536. a.readVarint64ZigZag = function(t) {
  35537. var i = this.readVarint64(t);
  35538. return i && i.value instanceof e ? i.value = o.zigZagDecode64(i.value) : i = o.zigZagDecode64(i),
  35539. i
  35540. }
  35541. ),
  35542. a.writeCString = function(e, i) {
  35543. var n = "undefined" == typeof i;
  35544. n && (i = this.offset);
  35545. var r, o = e.length;
  35546. if (!this.noAssert) {
  35547. if ("string" != typeof e)
  35548. throw TypeError("Illegal str: Not a string");
  35549. for (r = 0; r < o; ++r)
  35550. if (0 === e.charCodeAt(r))
  35551. throw RangeError("Illegal str: Contains NULL-characters");
  35552. if ("number" != typeof i || i % 1 !== 0)
  35553. throw TypeError("Illegal offset: " + i + " (not an integer)");
  35554. if (i >>>= 0,
  35555. i < 0 || i + 0 > this.buffer.byteLength)
  35556. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  35557. }
  35558. o = h.calculateUTF16asUTF8(t(e))[1],
  35559. i += o + 1;
  35560. var a = this.buffer.byteLength;
  35561. return i > a && this.resize((a *= 2) > i ? a : i),
  35562. i -= o + 1,
  35563. h.encodeUTF16toUTF8(t(e), function(e) {
  35564. this.view[i++] = e
  35565. }
  35566. .bind(this)),
  35567. this.view[i++] = 0,
  35568. n ? (this.offset = i,
  35569. this) : o
  35570. }
  35571. ,
  35572. a.readCString = function(e) {
  35573. var t = "undefined" == typeof e;
  35574. if (t && (e = this.offset),
  35575. !this.noAssert) {
  35576. if ("number" != typeof e || e % 1 !== 0)
  35577. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35578. if (e >>>= 0,
  35579. e < 0 || e + 1 > this.buffer.byteLength)
  35580. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  35581. }
  35582. var n, r = e, o = -1;
  35583. return h.decodeUTF8toUTF16(function() {
  35584. if (0 === o)
  35585. return null;
  35586. if (e >= this.limit)
  35587. throw RangeError("Illegal range: Truncated data, " + e + " < " + this.limit);
  35588. return o = this.view[e++],
  35589. 0 === o ? null : o
  35590. }
  35591. .bind(this), n = i(), !0),
  35592. t ? (this.offset = e,
  35593. n()) : {
  35594. string: n(),
  35595. length: e - r
  35596. }
  35597. }
  35598. ,
  35599. a.writeIString = function(e, i) {
  35600. var n = "undefined" == typeof i;
  35601. if (n && (i = this.offset),
  35602. !this.noAssert) {
  35603. if ("string" != typeof e)
  35604. throw TypeError("Illegal str: Not a string");
  35605. if ("number" != typeof i || i % 1 !== 0)
  35606. throw TypeError("Illegal offset: " + i + " (not an integer)");
  35607. if (i >>>= 0,
  35608. i < 0 || i + 0 > this.buffer.byteLength)
  35609. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  35610. }
  35611. var r, o = i;
  35612. r = h.calculateUTF16asUTF8(t(e), this.noAssert)[1],
  35613. i += 4 + r;
  35614. var a = this.buffer.byteLength;
  35615. if (i > a && this.resize((a *= 2) > i ? a : i),
  35616. i -= 4 + r,
  35617. this.littleEndian ? (this.view[i + 3] = r >>> 24 & 255,
  35618. this.view[i + 2] = r >>> 16 & 255,
  35619. this.view[i + 1] = r >>> 8 & 255,
  35620. this.view[i] = 255 & r) : (this.view[i] = r >>> 24 & 255,
  35621. this.view[i + 1] = r >>> 16 & 255,
  35622. this.view[i + 2] = r >>> 8 & 255,
  35623. this.view[i + 3] = 255 & r),
  35624. i += 4,
  35625. h.encodeUTF16toUTF8(t(e), function(e) {
  35626. this.view[i++] = e
  35627. }
  35628. .bind(this)),
  35629. i !== o + 4 + r)
  35630. throw RangeError("Illegal range: Truncated data, " + i + " == " + (i + 4 + r));
  35631. return n ? (this.offset = i,
  35632. this) : i - o
  35633. }
  35634. ,
  35635. a.readIString = function(e) {
  35636. var t = "undefined" == typeof e;
  35637. if (t && (e = this.offset),
  35638. !this.noAssert) {
  35639. if ("number" != typeof e || e % 1 !== 0)
  35640. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35641. if (e >>>= 0,
  35642. e < 0 || e + 4 > this.buffer.byteLength)
  35643. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  35644. }
  35645. var i = e
  35646. , n = this.readUint32(e)
  35647. , r = this.readUTF8String(n, o.METRICS_BYTES, e += 4);
  35648. return e += r.length,
  35649. t ? (this.offset = e,
  35650. r.string) : {
  35651. string: r.string,
  35652. length: e - i
  35653. }
  35654. }
  35655. ,
  35656. o.METRICS_CHARS = "c",
  35657. o.METRICS_BYTES = "b",
  35658. a.writeUTF8String = function(e, i) {
  35659. var n = "undefined" == typeof i;
  35660. if (n && (i = this.offset),
  35661. !this.noAssert) {
  35662. if ("number" != typeof i || i % 1 !== 0)
  35663. throw TypeError("Illegal offset: " + i + " (not an integer)");
  35664. if (i >>>= 0,
  35665. i < 0 || i + 0 > this.buffer.byteLength)
  35666. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  35667. }
  35668. var r, o = i;
  35669. r = h.calculateUTF16asUTF8(t(e))[1],
  35670. i += r;
  35671. var a = this.buffer.byteLength;
  35672. return i > a && this.resize((a *= 2) > i ? a : i),
  35673. i -= r,
  35674. h.encodeUTF16toUTF8(t(e), function(e) {
  35675. this.view[i++] = e
  35676. }
  35677. .bind(this)),
  35678. n ? (this.offset = i,
  35679. this) : i - o
  35680. }
  35681. ,
  35682. a.writeString = a.writeUTF8String,
  35683. o.calculateUTF8Chars = function(e) {
  35684. return h.calculateUTF16asUTF8(t(e))[0]
  35685. }
  35686. ,
  35687. o.calculateUTF8Bytes = function(e) {
  35688. return h.calculateUTF16asUTF8(t(e))[1]
  35689. }
  35690. ,
  35691. o.calculateString = o.calculateUTF8Bytes,
  35692. a.readUTF8String = function(e, t, n) {
  35693. "number" == typeof t && (n = t,
  35694. t = void 0);
  35695. var r = "undefined" == typeof n;
  35696. if (r && (n = this.offset),
  35697. "undefined" == typeof t && (t = o.METRICS_CHARS),
  35698. !this.noAssert) {
  35699. if ("number" != typeof e || e % 1 !== 0)
  35700. throw TypeError("Illegal length: " + e + " (not an integer)");
  35701. if (e |= 0,
  35702. "number" != typeof n || n % 1 !== 0)
  35703. throw TypeError("Illegal offset: " + n + " (not an integer)");
  35704. if (n >>>= 0,
  35705. n < 0 || n + 0 > this.buffer.byteLength)
  35706. throw RangeError("Illegal offset: 0 <= " + n + " (+0) <= " + this.buffer.byteLength)
  35707. }
  35708. var a, s = 0, l = n;
  35709. if (t === o.METRICS_CHARS) {
  35710. if (a = i(),
  35711. h.decodeUTF8(function() {
  35712. return s < e && n < this.limit ? this.view[n++] : null
  35713. }
  35714. .bind(this), function(e) {
  35715. ++s,
  35716. h.UTF8toUTF16(e, a)
  35717. }),
  35718. s !== e)
  35719. throw RangeError("Illegal range: Truncated data, " + s + " == " + e);
  35720. return r ? (this.offset = n,
  35721. a()) : {
  35722. string: a(),
  35723. length: n - l
  35724. }
  35725. }
  35726. if (t === o.METRICS_BYTES) {
  35727. if (!this.noAssert) {
  35728. if ("number" != typeof n || n % 1 !== 0)
  35729. throw TypeError("Illegal offset: " + n + " (not an integer)");
  35730. if (n >>>= 0,
  35731. n < 0 || n + e > this.buffer.byteLength)
  35732. throw RangeError("Illegal offset: 0 <= " + n + " (+" + e + ") <= " + this.buffer.byteLength)
  35733. }
  35734. var c = n + e;
  35735. if (h.decodeUTF8toUTF16(function() {
  35736. return n < c ? this.view[n++] : null
  35737. }
  35738. .bind(this), a = i(), this.noAssert),
  35739. n !== c)
  35740. throw RangeError("Illegal range: Truncated data, " + n + " == " + c);
  35741. return r ? (this.offset = n,
  35742. a()) : {
  35743. string: a(),
  35744. length: n - l
  35745. }
  35746. }
  35747. throw TypeError("Unsupported metrics: " + t)
  35748. }
  35749. ,
  35750. a.readString = a.readUTF8String,
  35751. a.writeVString = function(e, i) {
  35752. var n = "undefined" == typeof i;
  35753. if (n && (i = this.offset),
  35754. !this.noAssert) {
  35755. if ("string" != typeof e)
  35756. throw TypeError("Illegal str: Not a string");
  35757. if ("number" != typeof i || i % 1 !== 0)
  35758. throw TypeError("Illegal offset: " + i + " (not an integer)");
  35759. if (i >>>= 0,
  35760. i < 0 || i + 0 > this.buffer.byteLength)
  35761. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  35762. }
  35763. var r, a, s = i;
  35764. r = h.calculateUTF16asUTF8(t(e), this.noAssert)[1],
  35765. a = o.calculateVarint32(r),
  35766. i += a + r;
  35767. var l = this.buffer.byteLength;
  35768. if (i > l && this.resize((l *= 2) > i ? l : i),
  35769. i -= a + r,
  35770. i += this.writeVarint32(r, i),
  35771. h.encodeUTF16toUTF8(t(e), function(e) {
  35772. this.view[i++] = e
  35773. }
  35774. .bind(this)),
  35775. i !== s + r + a)
  35776. throw RangeError("Illegal range: Truncated data, " + i + " == " + (i + r + a));
  35777. return n ? (this.offset = i,
  35778. this) : i - s
  35779. }
  35780. ,
  35781. a.readVString = function(e) {
  35782. var t = "undefined" == typeof e;
  35783. if (t && (e = this.offset),
  35784. !this.noAssert) {
  35785. if ("number" != typeof e || e % 1 !== 0)
  35786. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35787. if (e >>>= 0,
  35788. e < 0 || e + 1 > this.buffer.byteLength)
  35789. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  35790. }
  35791. var i = e
  35792. , n = this.readVarint32(e)
  35793. , r = this.readUTF8String(n.value, o.METRICS_BYTES, e += n.length);
  35794. return e += r.length,
  35795. t ? (this.offset = e,
  35796. r.string) : {
  35797. string: r.string,
  35798. length: e - i
  35799. }
  35800. }
  35801. ,
  35802. a.append = function(e, t, i) {
  35803. "number" != typeof t && "string" == typeof t || (i = t,
  35804. t = void 0);
  35805. var n = "undefined" == typeof i;
  35806. if (n && (i = this.offset),
  35807. !this.noAssert) {
  35808. if ("number" != typeof i || i % 1 !== 0)
  35809. throw TypeError("Illegal offset: " + i + " (not an integer)");
  35810. if (i >>>= 0,
  35811. i < 0 || i + 0 > this.buffer.byteLength)
  35812. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  35813. }
  35814. e instanceof o || (e = o.wrap(e, t));
  35815. var r = e.limit - e.offset;
  35816. if (r <= 0)
  35817. return this;
  35818. i += r;
  35819. var a = this.buffer.byteLength;
  35820. return i > a && this.resize((a *= 2) > i ? a : i),
  35821. i -= r,
  35822. this.view.set(e.view.subarray(e.offset, e.limit), i),
  35823. e.offset += r,
  35824. n && (this.offset += r),
  35825. this
  35826. }
  35827. ,
  35828. a.appendTo = function(e, t) {
  35829. return e.append(this, t),
  35830. this
  35831. }
  35832. ,
  35833. a.assert = function(e) {
  35834. return this.noAssert = !e,
  35835. this
  35836. }
  35837. ,
  35838. a.capacity = function() {
  35839. return this.buffer.byteLength
  35840. }
  35841. ,
  35842. a.clear = function() {
  35843. return this.offset = 0,
  35844. this.limit = this.buffer.byteLength,
  35845. this.markedOffset = -1,
  35846. this
  35847. }
  35848. ,
  35849. a.clone = function(e) {
  35850. var t = new o(0,this.littleEndian,this.noAssert);
  35851. return e ? (t.buffer = new ArrayBuffer(this.buffer.byteLength),
  35852. t.view = new Uint8Array(t.buffer)) : (t.buffer = this.buffer,
  35853. t.view = this.view),
  35854. t.offset = this.offset,
  35855. t.markedOffset = this.markedOffset,
  35856. t.limit = this.limit,
  35857. t
  35858. }
  35859. ,
  35860. a.compact = function(e, t) {
  35861. if ("undefined" == typeof e && (e = this.offset),
  35862. "undefined" == typeof t && (t = this.limit),
  35863. !this.noAssert) {
  35864. if ("number" != typeof e || e % 1 !== 0)
  35865. throw TypeError("Illegal begin: Not an integer");
  35866. if (e >>>= 0,
  35867. "number" != typeof t || t % 1 !== 0)
  35868. throw TypeError("Illegal end: Not an integer");
  35869. if (t >>>= 0,
  35870. e < 0 || e > t || t > this.buffer.byteLength)
  35871. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  35872. }
  35873. if (0 === e && t === this.buffer.byteLength)
  35874. return this;
  35875. var i = t - e;
  35876. if (0 === i)
  35877. return this.buffer = s,
  35878. this.view = null,
  35879. this.markedOffset >= 0 && (this.markedOffset -= e),
  35880. this.offset = 0,
  35881. this.limit = 0,
  35882. this;
  35883. var n = new ArrayBuffer(i)
  35884. , r = new Uint8Array(n);
  35885. return r.set(this.view.subarray(e, t)),
  35886. this.buffer = n,
  35887. this.view = r,
  35888. this.markedOffset >= 0 && (this.markedOffset -= e),
  35889. this.offset = 0,
  35890. this.limit = i,
  35891. this
  35892. }
  35893. ,
  35894. a.copy = function(e, t) {
  35895. if ("undefined" == typeof e && (e = this.offset),
  35896. "undefined" == typeof t && (t = this.limit),
  35897. !this.noAssert) {
  35898. if ("number" != typeof e || e % 1 !== 0)
  35899. throw TypeError("Illegal begin: Not an integer");
  35900. if (e >>>= 0,
  35901. "number" != typeof t || t % 1 !== 0)
  35902. throw TypeError("Illegal end: Not an integer");
  35903. if (t >>>= 0,
  35904. e < 0 || e > t || t > this.buffer.byteLength)
  35905. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  35906. }
  35907. if (e === t)
  35908. return new o(0,this.littleEndian,this.noAssert);
  35909. var i = t - e
  35910. , n = new o(i,this.littleEndian,this.noAssert);
  35911. return n.offset = 0,
  35912. n.limit = i,
  35913. n.markedOffset >= 0 && (n.markedOffset -= e),
  35914. this.copyTo(n, 0, e, t),
  35915. n
  35916. }
  35917. ,
  35918. a.copyTo = function(e, t, i, n) {
  35919. var r, a;
  35920. if (!this.noAssert && !o.isByteBuffer(e))
  35921. throw TypeError("Illegal target: Not a ByteBuffer");
  35922. if (t = (a = "undefined" == typeof t) ? e.offset : 0 | t,
  35923. i = (r = "undefined" == typeof i) ? this.offset : 0 | i,
  35924. n = "undefined" == typeof n ? this.limit : 0 | n,
  35925. t < 0 || t > e.buffer.byteLength)
  35926. throw RangeError("Illegal target range: 0 <= " + t + " <= " + e.buffer.byteLength);
  35927. if (i < 0 || n > this.buffer.byteLength)
  35928. throw RangeError("Illegal source range: 0 <= " + i + " <= " + this.buffer.byteLength);
  35929. var s = n - i;
  35930. return 0 === s ? e : (e.ensureCapacity(t + s),
  35931. e.view.set(this.view.subarray(i, n), t),
  35932. r && (this.offset += s),
  35933. a && (e.offset += s),
  35934. this)
  35935. }
  35936. ,
  35937. a.ensureCapacity = function(e) {
  35938. var t = this.buffer.byteLength;
  35939. return t < e ? this.resize((t *= 2) > e ? t : e) : this
  35940. }
  35941. ,
  35942. a.fill = function(e, t, i) {
  35943. var n = "undefined" == typeof t;
  35944. if (n && (t = this.offset),
  35945. "string" == typeof e && e.length > 0 && (e = e.charCodeAt(0)),
  35946. "undefined" == typeof t && (t = this.offset),
  35947. "undefined" == typeof i && (i = this.limit),
  35948. !this.noAssert) {
  35949. if ("number" != typeof e || e % 1 !== 0)
  35950. throw TypeError("Illegal value: " + e + " (not an integer)");
  35951. if (e |= 0,
  35952. "number" != typeof t || t % 1 !== 0)
  35953. throw TypeError("Illegal begin: Not an integer");
  35954. if (t >>>= 0,
  35955. "number" != typeof i || i % 1 !== 0)
  35956. throw TypeError("Illegal end: Not an integer");
  35957. if (i >>>= 0,
  35958. t < 0 || t > i || i > this.buffer.byteLength)
  35959. throw RangeError("Illegal range: 0 <= " + t + " <= " + i + " <= " + this.buffer.byteLength)
  35960. }
  35961. if (t >= i)
  35962. return this;
  35963. for (; t < i; )
  35964. this.view[t++] = e;
  35965. return n && (this.offset = t),
  35966. this
  35967. }
  35968. ,
  35969. a.flip = function() {
  35970. return this.limit = this.offset,
  35971. this.offset = 0,
  35972. this
  35973. }
  35974. ,
  35975. a.mark = function(e) {
  35976. if (e = "undefined" == typeof e ? this.offset : e,
  35977. !this.noAssert) {
  35978. if ("number" != typeof e || e % 1 !== 0)
  35979. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35980. if (e >>>= 0,
  35981. e < 0 || e + 0 > this.buffer.byteLength)
  35982. throw RangeError("Illegal offset: 0 <= " + e + " (+0) <= " + this.buffer.byteLength)
  35983. }
  35984. return this.markedOffset = e,
  35985. this
  35986. }
  35987. ,
  35988. a.order = function(e) {
  35989. if (!this.noAssert && "boolean" != typeof e)
  35990. throw TypeError("Illegal littleEndian: Not a boolean");
  35991. return this.littleEndian = !!e,
  35992. this
  35993. }
  35994. ,
  35995. a.LE = function(e) {
  35996. return this.littleEndian = "undefined" == typeof e || !!e,
  35997. this
  35998. }
  35999. ,
  36000. a.BE = function(e) {
  36001. return this.littleEndian = "undefined" != typeof e && !e,
  36002. this
  36003. }
  36004. ,
  36005. a.prepend = function(e, t, i) {
  36006. "number" != typeof t && "string" == typeof t || (i = t,
  36007. t = void 0);
  36008. var n = "undefined" == typeof i;
  36009. if (n && (i = this.offset),
  36010. !this.noAssert) {
  36011. if ("number" != typeof i || i % 1 !== 0)
  36012. throw TypeError("Illegal offset: " + i + " (not an integer)");
  36013. if (i >>>= 0,
  36014. i < 0 || i + 0 > this.buffer.byteLength)
  36015. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  36016. }
  36017. e instanceof o || (e = o.wrap(e, t));
  36018. var r = e.limit - e.offset;
  36019. if (r <= 0)
  36020. return this;
  36021. var a = r - i;
  36022. if (a > 0) {
  36023. var s = new ArrayBuffer(this.buffer.byteLength + a)
  36024. , l = new Uint8Array(s);
  36025. l.set(this.view.subarray(i, this.buffer.byteLength), r),
  36026. this.buffer = s,
  36027. this.view = l,
  36028. this.offset += a,
  36029. this.markedOffset >= 0 && (this.markedOffset += a),
  36030. this.limit += a,
  36031. i += a
  36032. } else {
  36033. new Uint8Array(this.buffer)
  36034. }
  36035. return this.view.set(e.view.subarray(e.offset, e.limit), i - r),
  36036. e.offset = e.limit,
  36037. n && (this.offset -= r),
  36038. this
  36039. }
  36040. ,
  36041. a.prependTo = function(e, t) {
  36042. return e.prepend(this, t),
  36043. this
  36044. }
  36045. ,
  36046. a.printDebug = function(e) {
  36047. "function" != typeof e && (e = console.log.bind(console)),
  36048. e(this.toString() + "\n-------------------------------------------------------------------\n" + this.toDebug(!0))
  36049. }
  36050. ,
  36051. a.remaining = function() {
  36052. return this.limit - this.offset
  36053. }
  36054. ,
  36055. a.reset = function() {
  36056. return this.markedOffset >= 0 ? (this.offset = this.markedOffset,
  36057. this.markedOffset = -1) : this.offset = 0,
  36058. this
  36059. }
  36060. ,
  36061. a.resize = function(e) {
  36062. if (!this.noAssert) {
  36063. if ("number" != typeof e || e % 1 !== 0)
  36064. throw TypeError("Illegal capacity: " + e + " (not an integer)");
  36065. if (e |= 0,
  36066. e < 0)
  36067. throw RangeError("Illegal capacity: 0 <= " + e)
  36068. }
  36069. if (this.buffer.byteLength < e) {
  36070. var t = new ArrayBuffer(e)
  36071. , i = new Uint8Array(t);
  36072. i.set(this.view),
  36073. this.buffer = t,
  36074. this.view = i
  36075. }
  36076. return this
  36077. }
  36078. ,
  36079. a.reverse = function(e, t) {
  36080. if ("undefined" == typeof e && (e = this.offset),
  36081. "undefined" == typeof t && (t = this.limit),
  36082. !this.noAssert) {
  36083. if ("number" != typeof e || e % 1 !== 0)
  36084. throw TypeError("Illegal begin: Not an integer");
  36085. if (e >>>= 0,
  36086. "number" != typeof t || t % 1 !== 0)
  36087. throw TypeError("Illegal end: Not an integer");
  36088. if (t >>>= 0,
  36089. e < 0 || e > t || t > this.buffer.byteLength)
  36090. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  36091. }
  36092. return e === t ? this : (Array.prototype.reverse.call(this.view.subarray(e, t)),
  36093. this)
  36094. }
  36095. ,
  36096. a.skip = function(e) {
  36097. if (!this.noAssert) {
  36098. if ("number" != typeof e || e % 1 !== 0)
  36099. throw TypeError("Illegal length: " + e + " (not an integer)");
  36100. e |= 0
  36101. }
  36102. var t = this.offset + e;
  36103. if (!this.noAssert && (t < 0 || t > this.buffer.byteLength))
  36104. throw RangeError("Illegal length: 0 <= " + this.offset + " + " + e + " <= " + this.buffer.byteLength);
  36105. return this.offset = t,
  36106. this
  36107. }
  36108. ,
  36109. a.slice = function(e, t) {
  36110. if ("undefined" == typeof e && (e = this.offset),
  36111. "undefined" == typeof t && (t = this.limit),
  36112. !this.noAssert) {
  36113. if ("number" != typeof e || e % 1 !== 0)
  36114. throw TypeError("Illegal begin: Not an integer");
  36115. if (e >>>= 0,
  36116. "number" != typeof t || t % 1 !== 0)
  36117. throw TypeError("Illegal end: Not an integer");
  36118. if (t >>>= 0,
  36119. e < 0 || e > t || t > this.buffer.byteLength)
  36120. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  36121. }
  36122. var i = this.clone();
  36123. return i.offset = e,
  36124. i.limit = t,
  36125. i
  36126. }
  36127. ,
  36128. a.toBuffer = function(e) {
  36129. var t = this.offset
  36130. , i = this.limit;
  36131. if (!this.noAssert) {
  36132. if ("number" != typeof t || t % 1 !== 0)
  36133. throw TypeError("Illegal offset: Not an integer");
  36134. if (t >>>= 0,
  36135. "number" != typeof i || i % 1 !== 0)
  36136. throw TypeError("Illegal limit: Not an integer");
  36137. if (i >>>= 0,
  36138. t < 0 || t > i || i > this.buffer.byteLength)
  36139. throw RangeError("Illegal range: 0 <= " + t + " <= " + i + " <= " + this.buffer.byteLength)
  36140. }
  36141. if (!e && 0 === t && i === this.buffer.byteLength)
  36142. return this.buffer;
  36143. if (t === i)
  36144. return s;
  36145. var n = new ArrayBuffer(i - t);
  36146. return new Uint8Array(n).set(new Uint8Array(this.buffer).subarray(t, i), 0),
  36147. n
  36148. }
  36149. ,
  36150. a.toArrayBuffer = a.toBuffer,
  36151. a.toString = function(e, t, i) {
  36152. if ("undefined" == typeof e)
  36153. return "ByteBufferAB(offset=" + this.offset + ",markedOffset=" + this.markedOffset + ",limit=" + this.limit + ",capacity=" + this.capacity() + ")";
  36154. switch ("number" == typeof e && (e = "utf8",
  36155. t = e,
  36156. i = t),
  36157. e) {
  36158. case "utf8":
  36159. return this.toUTF8(t, i);
  36160. case "base64":
  36161. return this.toBase64(t, i);
  36162. case "hex":
  36163. return this.toHex(t, i);
  36164. case "binary":
  36165. return this.toBinary(t, i);
  36166. case "debug":
  36167. return this.toDebug();
  36168. case "columns":
  36169. return this.toColumns();
  36170. default:
  36171. throw Error("Unsupported encoding: " + e)
  36172. }
  36173. }
  36174. ;
  36175. var c = function() {
  36176. 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)
  36177. i[t[n]] = n;
  36178. return e.encode = function(e, i) {
  36179. for (var n, r; null !== (n = e()); )
  36180. i(t[n >> 2 & 63]),
  36181. r = (3 & n) << 4,
  36182. null !== (n = e()) ? (r |= n >> 4 & 15,
  36183. i(t[63 & (r | n >> 4 & 15)]),
  36184. r = (15 & n) << 2,
  36185. null !== (n = e()) ? (i(t[63 & (r | n >> 6 & 3)]),
  36186. i(t[63 & n])) : (i(t[63 & r]),
  36187. i(61))) : (i(t[63 & r]),
  36188. i(61),
  36189. i(61))
  36190. }
  36191. ,
  36192. e.decode = function(e, t) {
  36193. function n(e) {
  36194. throw Error("Illegal character code: " + e)
  36195. }
  36196. for (var r, o, a; null !== (r = e()); )
  36197. if (o = i[r],
  36198. "undefined" == typeof o && n(r),
  36199. null !== (r = e()) && (a = i[r],
  36200. "undefined" == typeof a && n(r),
  36201. t(o << 2 >>> 0 | (48 & a) >> 4),
  36202. null !== (r = e()))) {
  36203. if (o = i[r],
  36204. "undefined" == typeof o) {
  36205. if (61 === r)
  36206. break;
  36207. n(r)
  36208. }
  36209. if (t((15 & a) << 4 >>> 0 | (60 & o) >> 2),
  36210. null !== (r = e())) {
  36211. if (a = i[r],
  36212. "undefined" == typeof a) {
  36213. if (61 === r)
  36214. break;
  36215. n(r)
  36216. }
  36217. t((3 & o) << 6 >>> 0 | a)
  36218. }
  36219. }
  36220. }
  36221. ,
  36222. e.test = function(e) {
  36223. return /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.test(e)
  36224. }
  36225. ,
  36226. e
  36227. }();
  36228. a.toBase64 = function(e, t) {
  36229. if ("undefined" == typeof e && (e = this.offset),
  36230. "undefined" == typeof t && (t = this.limit),
  36231. e |= 0,
  36232. t |= 0,
  36233. e < 0 || t > this.capacity || e > t)
  36234. throw RangeError("begin, end");
  36235. var n;
  36236. return c.encode(function() {
  36237. return e < t ? this.view[e++] : null
  36238. }
  36239. .bind(this), n = i()),
  36240. n()
  36241. }
  36242. ,
  36243. o.fromBase64 = function(e, i) {
  36244. if ("string" != typeof e)
  36245. throw TypeError("str");
  36246. var n = new o(e.length / 4 * 3,i)
  36247. , r = 0;
  36248. return c.decode(t(e), function(e) {
  36249. n.view[r++] = e
  36250. }),
  36251. n.limit = r,
  36252. n
  36253. }
  36254. ,
  36255. o.btoa = function(e) {
  36256. return o.fromBinary(e).toBase64()
  36257. }
  36258. ,
  36259. o.atob = function(e) {
  36260. return o.fromBase64(e).toBinary()
  36261. }
  36262. ,
  36263. a.toBinary = function(e, t) {
  36264. if ("undefined" == typeof e && (e = this.offset),
  36265. "undefined" == typeof t && (t = this.limit),
  36266. e |= 0,
  36267. t |= 0,
  36268. e < 0 || t > this.capacity() || e > t)
  36269. throw RangeError("begin, end");
  36270. if (e === t)
  36271. return "";
  36272. for (var i = [], n = []; e < t; )
  36273. i.push(this.view[e++]),
  36274. i.length >= 1024 && (n.push(String.fromCharCode.apply(String, i)),
  36275. i = []);
  36276. return n.join("") + String.fromCharCode.apply(String, i)
  36277. }
  36278. ,
  36279. o.fromBinary = function(e, t) {
  36280. if ("string" != typeof e)
  36281. throw TypeError("str");
  36282. for (var i, n = 0, r = e.length, a = new o(r,t); n < r; ) {
  36283. if (i = e.charCodeAt(n),
  36284. i > 255)
  36285. throw RangeError("illegal char code: " + i);
  36286. a.view[n++] = i
  36287. }
  36288. return a.limit = r,
  36289. a
  36290. }
  36291. ,
  36292. a.toDebug = function(e) {
  36293. for (var t, i = -1, n = this.buffer.byteLength, r = "", o = "", a = ""; i < n; ) {
  36294. if (i !== -1 && (t = this.view[i],
  36295. r += t < 16 ? "0" + t.toString(16).toUpperCase() : t.toString(16).toUpperCase(),
  36296. e && (o += t > 32 && t < 127 ? String.fromCharCode(t) : ".")),
  36297. ++i,
  36298. e && i > 0 && i % 16 === 0 && i !== n) {
  36299. for (; r.length < 51; )
  36300. r += " ";
  36301. a += r + o + "\n",
  36302. r = o = ""
  36303. }
  36304. 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 ? " " : ""
  36305. }
  36306. if (e && " " !== r) {
  36307. for (; r.length < 51; )
  36308. r += " ";
  36309. a += r + o + "\n"
  36310. }
  36311. return e ? a : r
  36312. }
  36313. ,
  36314. o.fromDebug = function(e, t, i) {
  36315. 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; ) {
  36316. switch (n = e.charAt(l++)) {
  36317. case "!":
  36318. if (!i) {
  36319. if (u || d || p) {
  36320. f = !0;
  36321. break
  36322. }
  36323. u = d = p = !0
  36324. }
  36325. s.offset = s.markedOffset = s.limit = c,
  36326. h = !1;
  36327. break;
  36328. case "|":
  36329. if (!i) {
  36330. if (u || p) {
  36331. f = !0;
  36332. break
  36333. }
  36334. u = p = !0
  36335. }
  36336. s.offset = s.limit = c,
  36337. h = !1;
  36338. break;
  36339. case "[":
  36340. if (!i) {
  36341. if (u || d) {
  36342. f = !0;
  36343. break
  36344. }
  36345. u = d = !0
  36346. }
  36347. s.offset = s.markedOffset = c,
  36348. h = !1;
  36349. break;
  36350. case "<":
  36351. if (!i) {
  36352. if (u) {
  36353. f = !0;
  36354. break
  36355. }
  36356. u = !0
  36357. }
  36358. s.offset = c,
  36359. h = !1;
  36360. break;
  36361. case "]":
  36362. if (!i) {
  36363. if (p || d) {
  36364. f = !0;
  36365. break
  36366. }
  36367. p = d = !0
  36368. }
  36369. s.limit = s.markedOffset = c,
  36370. h = !1;
  36371. break;
  36372. case ">":
  36373. if (!i) {
  36374. if (p) {
  36375. f = !0;
  36376. break
  36377. }
  36378. p = !0
  36379. }
  36380. s.limit = c,
  36381. h = !1;
  36382. break;
  36383. case "'":
  36384. if (!i) {
  36385. if (d) {
  36386. f = !0;
  36387. break
  36388. }
  36389. d = !0
  36390. }
  36391. s.markedOffset = c,
  36392. h = !1;
  36393. break;
  36394. case " ":
  36395. h = !1;
  36396. break;
  36397. default:
  36398. if (!i && h) {
  36399. f = !0;
  36400. break
  36401. }
  36402. if (r = parseInt(n + e.charAt(l++), 16),
  36403. !i && (isNaN(r) || r < 0 || r > 255))
  36404. throw TypeError("Illegal str: Not a debug encoded string");
  36405. s.view[c++] = r,
  36406. h = !0
  36407. }
  36408. if (f)
  36409. throw TypeError("Illegal str: Invalid symbol at " + l)
  36410. }
  36411. if (!i) {
  36412. if (!u || !p)
  36413. throw TypeError("Illegal str: Missing offset or limit");
  36414. if (c < s.buffer.byteLength)
  36415. throw TypeError("Illegal str: Not a debug encoded string (is it hex?) " + c + " < " + a)
  36416. }
  36417. return s
  36418. }
  36419. ,
  36420. a.toHex = function(e, t) {
  36421. if (e = "undefined" == typeof e ? this.offset : e,
  36422. t = "undefined" == typeof t ? this.limit : t,
  36423. !this.noAssert) {
  36424. if ("number" != typeof e || e % 1 !== 0)
  36425. throw TypeError("Illegal begin: Not an integer");
  36426. if (e >>>= 0,
  36427. "number" != typeof t || t % 1 !== 0)
  36428. throw TypeError("Illegal end: Not an integer");
  36429. if (t >>>= 0,
  36430. e < 0 || e > t || t > this.buffer.byteLength)
  36431. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  36432. }
  36433. for (var i, n = new Array(t - e); e < t; )
  36434. i = this.view[e++],
  36435. i < 16 ? n.push("0", i.toString(16)) : n.push(i.toString(16));
  36436. return n.join("")
  36437. }
  36438. ,
  36439. o.fromHex = function(e, t, i) {
  36440. if (!i) {
  36441. if ("string" != typeof e)
  36442. throw TypeError("Illegal str: Not a string");
  36443. if (e.length % 2 !== 0)
  36444. throw TypeError("Illegal str: Length not a multiple of 2")
  36445. }
  36446. for (var n, r = e.length, a = new o(r / 2 | 0,t), s = 0, l = 0; s < r; s += 2) {
  36447. if (n = parseInt(e.substring(s, s + 2), 16),
  36448. !i && (!isFinite(n) || n < 0 || n > 255))
  36449. throw TypeError("Illegal str: Contains non-hex characters");
  36450. a.view[l++] = n
  36451. }
  36452. return a.limit = l,
  36453. a
  36454. }
  36455. ;
  36456. var h = function() {
  36457. var e = {};
  36458. return e.MAX_CODEPOINT = 1114111,
  36459. e.encodeUTF8 = function(e, t) {
  36460. var i = null;
  36461. for ("number" == typeof e && (i = e,
  36462. e = function() {
  36463. return null
  36464. }
  36465. ); null !== i || null !== (i = e()); )
  36466. i < 128 ? t(127 & i) : i < 2048 ? (t(i >> 6 & 31 | 192),
  36467. t(63 & i | 128)) : i < 65536 ? (t(i >> 12 & 15 | 224),
  36468. t(i >> 6 & 63 | 128),
  36469. t(63 & i | 128)) : (t(i >> 18 & 7 | 240),
  36470. t(i >> 12 & 63 | 128),
  36471. t(i >> 6 & 63 | 128),
  36472. t(63 & i | 128)),
  36473. i = null
  36474. }
  36475. ,
  36476. e.decodeUTF8 = function(e, t) {
  36477. for (var i, n, r, o, a = function(e) {
  36478. e = e.slice(0, e.indexOf(null));
  36479. var t = Error(e.toString());
  36480. throw t.name = "TruncatedError",
  36481. t.bytes = e,
  36482. t
  36483. }; null !== (i = e()); )
  36484. if (0 === (128 & i))
  36485. t(i);
  36486. else if (192 === (224 & i))
  36487. null === (n = e()) && a([i, n]),
  36488. t((31 & i) << 6 | 63 & n);
  36489. else if (224 === (240 & i))
  36490. (null === (n = e()) || null === (r = e())) && a([i, n, r]),
  36491. t((15 & i) << 12 | (63 & n) << 6 | 63 & r);
  36492. else {
  36493. if (240 !== (248 & i))
  36494. throw RangeError("Illegal starting byte: " + i);
  36495. (null === (n = e()) || null === (r = e()) || null === (o = e())) && a([i, n, r, o]),
  36496. t((7 & i) << 18 | (63 & n) << 12 | (63 & r) << 6 | 63 & o)
  36497. }
  36498. }
  36499. ,
  36500. e.UTF16toUTF8 = function(e, t) {
  36501. for (var i, n = null; ; ) {
  36502. if (null === (i = null !== n ? n : e()))
  36503. break;
  36504. i >= 55296 && i <= 57343 && null !== (n = e()) && n >= 56320 && n <= 57343 ? (t(1024 * (i - 55296) + n - 56320 + 65536),
  36505. n = null) : t(i)
  36506. }
  36507. null !== n && t(n)
  36508. }
  36509. ,
  36510. e.UTF8toUTF16 = function(e, t) {
  36511. var i = null;
  36512. for ("number" == typeof e && (i = e,
  36513. e = function() {
  36514. return null
  36515. }
  36516. ); null !== i || null !== (i = e()); )
  36517. i <= 65535 ? t(i) : (i -= 65536,
  36518. t((i >> 10) + 55296),
  36519. t(i % 1024 + 56320)),
  36520. i = null
  36521. }
  36522. ,
  36523. e.encodeUTF16toUTF8 = function(t, i) {
  36524. e.UTF16toUTF8(t, function(t) {
  36525. e.encodeUTF8(t, i)
  36526. })
  36527. }
  36528. ,
  36529. e.decodeUTF8toUTF16 = function(t, i) {
  36530. e.decodeUTF8(t, function(t) {
  36531. e.UTF8toUTF16(t, i)
  36532. })
  36533. }
  36534. ,
  36535. e.calculateCodePoint = function(e) {
  36536. return e < 128 ? 1 : e < 2048 ? 2 : e < 65536 ? 3 : 4
  36537. }
  36538. ,
  36539. e.calculateUTF8 = function(e) {
  36540. for (var t, i = 0; null !== (t = e()); )
  36541. i += t < 128 ? 1 : t < 2048 ? 2 : t < 65536 ? 3 : 4;
  36542. return i
  36543. }
  36544. ,
  36545. e.calculateUTF16asUTF8 = function(t) {
  36546. var i = 0
  36547. , n = 0;
  36548. return e.UTF16toUTF8(t, function(e) {
  36549. ++i,
  36550. n += e < 128 ? 1 : e < 2048 ? 2 : e < 65536 ? 3 : 4
  36551. }),
  36552. [i, n]
  36553. }
  36554. ,
  36555. e
  36556. }();
  36557. return a.toUTF8 = function(e, t) {
  36558. if ("undefined" == typeof e && (e = this.offset),
  36559. "undefined" == typeof t && (t = this.limit),
  36560. !this.noAssert) {
  36561. if ("number" != typeof e || e % 1 !== 0)
  36562. throw TypeError("Illegal begin: Not an integer");
  36563. if (e >>>= 0,
  36564. "number" != typeof t || t % 1 !== 0)
  36565. throw TypeError("Illegal end: Not an integer");
  36566. if (t >>>= 0,
  36567. e < 0 || e > t || t > this.buffer.byteLength)
  36568. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  36569. }
  36570. var n;
  36571. try {
  36572. h.decodeUTF8toUTF16(function() {
  36573. return e < t ? this.view[e++] : null
  36574. }
  36575. .bind(this), n = i())
  36576. } catch (i) {
  36577. if (e !== t)
  36578. throw RangeError("Illegal range: Truncated data, " + e + " != " + t)
  36579. }
  36580. return n()
  36581. }
  36582. ,
  36583. o.fromUTF8 = function(e, i, n) {
  36584. if (!n && "string" != typeof e)
  36585. throw TypeError("Illegal str: Not a string");
  36586. var r = new o(h.calculateUTF16asUTF8(t(e), !0)[1],i,n)
  36587. , a = 0;
  36588. return h.encodeUTF16toUTF8(t(e), function(e) {
  36589. r.view[a++] = e
  36590. }),
  36591. r.limit = a,
  36592. r
  36593. }
  36594. ,
  36595. o
  36596. })
  36597. }
  36598. , {
  36599. long: 216
  36600. }],
  36601. 216: [function(e, t, i) {
  36602. !function(i, n) {
  36603. "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()
  36604. }(this, function() {
  36605. "use strict";
  36606. function e(e, t, i) {
  36607. this.low = 0 | e,
  36608. this.high = 0 | t,
  36609. this.unsigned = !!i
  36610. }
  36611. function t(e) {
  36612. return (e && e.__isLong__) === !0
  36613. }
  36614. function i(e, t) {
  36615. var i, n, o;
  36616. return t ? (e >>>= 0,
  36617. (o = 0 <= e && e < 256) && (n = l[e]) ? n : (i = r(e, (0 | e) < 0 ? -1 : 0, !0),
  36618. o && (l[e] = i),
  36619. i)) : (e |= 0,
  36620. (o = -128 <= e && e < 128) && (n = s[e]) ? n : (i = r(e, e < 0 ? -1 : 0, !1),
  36621. o && (s[e] = i),
  36622. i))
  36623. }
  36624. function n(e, t) {
  36625. if (isNaN(e) || !isFinite(e))
  36626. return t ? m : g;
  36627. if (t) {
  36628. if (e < 0)
  36629. return m;
  36630. if (e >= d)
  36631. return I
  36632. } else {
  36633. if (e <= -p)
  36634. return E;
  36635. if (e + 1 >= p)
  36636. return C
  36637. }
  36638. return e < 0 ? n(-e, t).neg() : r(e % u | 0, e / u | 0, t)
  36639. }
  36640. function r(t, i, n) {
  36641. return new e(t,i,n)
  36642. }
  36643. function o(e, t, i) {
  36644. if (0 === e.length)
  36645. throw Error("empty string");
  36646. if ("NaN" === e || "Infinity" === e || "+Infinity" === e || "-Infinity" === e)
  36647. return g;
  36648. if ("number" == typeof t ? (i = t,
  36649. t = !1) : t = !!t,
  36650. i = i || 10,
  36651. i < 2 || 36 < i)
  36652. throw RangeError("radix");
  36653. var r;
  36654. if ((r = e.indexOf("-")) > 0)
  36655. throw Error("interior hyphen");
  36656. if (0 === r)
  36657. return o(e.substring(1), t, i).neg();
  36658. for (var a = n(c(i, 8)), s = g, l = 0; l < e.length; l += 8) {
  36659. var h = Math.min(8, e.length - l)
  36660. , u = parseInt(e.substring(l, l + h), i);
  36661. if (h < 8) {
  36662. var d = n(c(i, h));
  36663. s = s.mul(d).add(n(u))
  36664. } else
  36665. s = s.mul(a),
  36666. s = s.add(n(u))
  36667. }
  36668. return s.unsigned = t,
  36669. s
  36670. }
  36671. function a(t) {
  36672. return t instanceof e ? t : "number" == typeof t ? n(t) : "string" == typeof t ? o(t) : r(t.low, t.high, t.unsigned)
  36673. }
  36674. e.prototype.__isLong__,
  36675. Object.defineProperty(e.prototype, "__isLong__", {
  36676. value: !0,
  36677. enumerable: !1,
  36678. configurable: !1
  36679. }),
  36680. e.isLong = t;
  36681. var s = {}
  36682. , l = {};
  36683. e.fromInt = i,
  36684. e.fromNumber = n,
  36685. e.fromBits = r;
  36686. var c = Math.pow;
  36687. e.fromString = o,
  36688. e.fromValue = a;
  36689. var h = 1 << 24
  36690. , u = 4294967296
  36691. , d = 0x10000000000000000
  36692. , p = d / 2
  36693. , f = i(h)
  36694. , g = i(0);
  36695. e.ZERO = g;
  36696. var m = i(0, !0);
  36697. e.UZERO = m;
  36698. var v = i(1);
  36699. e.ONE = v;
  36700. var A = i(1, !0);
  36701. e.UONE = A;
  36702. var y = i(-1);
  36703. e.NEG_ONE = y;
  36704. var C = r(-1, 2147483647, !1);
  36705. e.MAX_VALUE = C;
  36706. var I = r(-1, -1, !0);
  36707. e.MAX_UNSIGNED_VALUE = I;
  36708. var E = r(0, -2147483648, !1);
  36709. e.MIN_VALUE = E;
  36710. var b = e.prototype;
  36711. return b.toInt = function() {
  36712. return this.unsigned ? this.low >>> 0 : this.low
  36713. }
  36714. ,
  36715. b.toNumber = function() {
  36716. return this.unsigned ? (this.high >>> 0) * u + (this.low >>> 0) : this.high * u + (this.low >>> 0)
  36717. }
  36718. ,
  36719. b.toString = function(e) {
  36720. if (e = e || 10,
  36721. e < 2 || 36 < e)
  36722. throw RangeError("radix");
  36723. if (this.isZero())
  36724. return "0";
  36725. if (this.isNegative()) {
  36726. if (this.eq(E)) {
  36727. var t = n(e)
  36728. , i = this.div(t)
  36729. , r = i.mul(t).sub(this);
  36730. return i.toString(e) + r.toInt().toString(e)
  36731. }
  36732. return "-" + this.neg().toString(e)
  36733. }
  36734. for (var o = n(c(e, 6), this.unsigned), a = this, s = ""; ; ) {
  36735. var l = a.div(o)
  36736. , h = a.sub(l.mul(o)).toInt() >>> 0
  36737. , u = h.toString(e);
  36738. if (a = l,
  36739. a.isZero())
  36740. return u + s;
  36741. for (; u.length < 6; )
  36742. u = "0" + u;
  36743. s = "" + u + s
  36744. }
  36745. }
  36746. ,
  36747. b.getHighBits = function() {
  36748. return this.high
  36749. }
  36750. ,
  36751. b.getHighBitsUnsigned = function() {
  36752. return this.high >>> 0
  36753. }
  36754. ,
  36755. b.getLowBits = function() {
  36756. return this.low
  36757. }
  36758. ,
  36759. b.getLowBitsUnsigned = function() {
  36760. return this.low >>> 0
  36761. }
  36762. ,
  36763. b.getNumBitsAbs = function() {
  36764. if (this.isNegative())
  36765. return this.eq(E) ? 64 : this.neg().getNumBitsAbs();
  36766. for (var e = 0 != this.high ? this.high : this.low, t = 31; t > 0 && 0 == (e & 1 << t); t--)
  36767. ;
  36768. return 0 != this.high ? t + 33 : t + 1
  36769. }
  36770. ,
  36771. b.isZero = function() {
  36772. return 0 === this.high && 0 === this.low
  36773. }
  36774. ,
  36775. b.isNegative = function() {
  36776. return !this.unsigned && this.high < 0
  36777. }
  36778. ,
  36779. b.isPositive = function() {
  36780. return this.unsigned || this.high >= 0
  36781. }
  36782. ,
  36783. b.isOdd = function() {
  36784. return 1 === (1 & this.low)
  36785. }
  36786. ,
  36787. b.isEven = function() {
  36788. return 0 === (1 & this.low)
  36789. }
  36790. ,
  36791. b.equals = function(e) {
  36792. return t(e) || (e = a(e)),
  36793. (this.unsigned === e.unsigned || this.high >>> 31 !== 1 || e.high >>> 31 !== 1) && (this.high === e.high && this.low === e.low)
  36794. }
  36795. ,
  36796. b.eq = b.equals,
  36797. b.notEquals = function(e) {
  36798. return !this.eq(e)
  36799. }
  36800. ,
  36801. b.neq = b.notEquals,
  36802. b.lessThan = function(e) {
  36803. return this.comp(e) < 0
  36804. }
  36805. ,
  36806. b.lt = b.lessThan,
  36807. b.lessThanOrEqual = function(e) {
  36808. return this.comp(e) <= 0
  36809. }
  36810. ,
  36811. b.lte = b.lessThanOrEqual,
  36812. b.greaterThan = function(e) {
  36813. return this.comp(e) > 0
  36814. }
  36815. ,
  36816. b.gt = b.greaterThan,
  36817. b.greaterThanOrEqual = function(e) {
  36818. return this.comp(e) >= 0
  36819. }
  36820. ,
  36821. b.gte = b.greaterThanOrEqual,
  36822. b.compare = function(e) {
  36823. if (t(e) || (e = a(e)),
  36824. this.eq(e))
  36825. return 0;
  36826. var i = this.isNegative()
  36827. , n = e.isNegative();
  36828. 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
  36829. }
  36830. ,
  36831. b.comp = b.compare,
  36832. b.negate = function() {
  36833. return !this.unsigned && this.eq(E) ? E : this.not().add(v)
  36834. }
  36835. ,
  36836. b.neg = b.negate,
  36837. b.add = function(e) {
  36838. t(e) || (e = a(e));
  36839. var i = this.high >>> 16
  36840. , n = 65535 & this.high
  36841. , o = this.low >>> 16
  36842. , s = 65535 & this.low
  36843. , l = e.high >>> 16
  36844. , c = 65535 & e.high
  36845. , h = e.low >>> 16
  36846. , u = 65535 & e.low
  36847. , d = 0
  36848. , p = 0
  36849. , f = 0
  36850. , g = 0;
  36851. return g += s + u,
  36852. f += g >>> 16,
  36853. g &= 65535,
  36854. f += o + h,
  36855. p += f >>> 16,
  36856. f &= 65535,
  36857. p += n + c,
  36858. d += p >>> 16,
  36859. p &= 65535,
  36860. d += i + l,
  36861. d &= 65535,
  36862. r(f << 16 | g, d << 16 | p, this.unsigned)
  36863. }
  36864. ,
  36865. b.subtract = function(e) {
  36866. return t(e) || (e = a(e)),
  36867. this.add(e.neg())
  36868. }
  36869. ,
  36870. b.sub = b.subtract,
  36871. b.multiply = function(e) {
  36872. if (this.isZero())
  36873. return g;
  36874. if (t(e) || (e = a(e)),
  36875. e.isZero())
  36876. return g;
  36877. if (this.eq(E))
  36878. return e.isOdd() ? E : g;
  36879. if (e.eq(E))
  36880. return this.isOdd() ? E : g;
  36881. if (this.isNegative())
  36882. return e.isNegative() ? this.neg().mul(e.neg()) : this.neg().mul(e).neg();
  36883. if (e.isNegative())
  36884. return this.mul(e.neg()).neg();
  36885. if (this.lt(f) && e.lt(f))
  36886. return n(this.toNumber() * e.toNumber(), this.unsigned);
  36887. var i = this.high >>> 16
  36888. , o = 65535 & this.high
  36889. , s = this.low >>> 16
  36890. , l = 65535 & this.low
  36891. , c = e.high >>> 16
  36892. , h = 65535 & e.high
  36893. , u = e.low >>> 16
  36894. , d = 65535 & e.low
  36895. , p = 0
  36896. , m = 0
  36897. , v = 0
  36898. , A = 0;
  36899. return A += l * d,
  36900. v += A >>> 16,
  36901. A &= 65535,
  36902. v += s * d,
  36903. m += v >>> 16,
  36904. v &= 65535,
  36905. v += l * u,
  36906. m += v >>> 16,
  36907. v &= 65535,
  36908. m += o * d,
  36909. p += m >>> 16,
  36910. m &= 65535,
  36911. m += s * u,
  36912. p += m >>> 16,
  36913. m &= 65535,
  36914. m += l * h,
  36915. p += m >>> 16,
  36916. m &= 65535,
  36917. p += i * d + o * u + s * h + l * c,
  36918. p &= 65535,
  36919. r(v << 16 | A, p << 16 | m, this.unsigned)
  36920. }
  36921. ,
  36922. b.mul = b.multiply,
  36923. b.divide = function(e) {
  36924. if (t(e) || (e = a(e)),
  36925. e.isZero())
  36926. throw Error("division by zero");
  36927. if (this.isZero())
  36928. return this.unsigned ? m : g;
  36929. var i, r, o;
  36930. if (this.unsigned) {
  36931. if (e.unsigned || (e = e.toUnsigned()),
  36932. e.gt(this))
  36933. return m;
  36934. if (e.gt(this.shru(1)))
  36935. return A;
  36936. o = m
  36937. } else {
  36938. if (this.eq(E)) {
  36939. if (e.eq(v) || e.eq(y))
  36940. return E;
  36941. if (e.eq(E))
  36942. return v;
  36943. var s = this.shr(1);
  36944. return i = s.div(e).shl(1),
  36945. i.eq(g) ? e.isNegative() ? v : y : (r = this.sub(e.mul(i)),
  36946. o = i.add(r.div(e)))
  36947. }
  36948. if (e.eq(E))
  36949. return this.unsigned ? m : g;
  36950. if (this.isNegative())
  36951. return e.isNegative() ? this.neg().div(e.neg()) : this.neg().div(e).neg();
  36952. if (e.isNegative())
  36953. return this.div(e.neg()).neg();
  36954. o = g
  36955. }
  36956. for (r = this; r.gte(e); ) {
  36957. i = Math.max(1, Math.floor(r.toNumber() / e.toNumber()));
  36958. 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); )
  36959. i -= h,
  36960. u = n(i, this.unsigned),
  36961. d = u.mul(e);
  36962. u.isZero() && (u = v),
  36963. o = o.add(u),
  36964. r = r.sub(d)
  36965. }
  36966. return o
  36967. }
  36968. ,
  36969. b.div = b.divide,
  36970. b.modulo = function(e) {
  36971. return t(e) || (e = a(e)),
  36972. this.sub(this.div(e).mul(e))
  36973. }
  36974. ,
  36975. b.mod = b.modulo,
  36976. b.not = function() {
  36977. return r(~this.low, ~this.high, this.unsigned)
  36978. }
  36979. ,
  36980. b.and = function(e) {
  36981. return t(e) || (e = a(e)),
  36982. r(this.low & e.low, this.high & e.high, this.unsigned)
  36983. }
  36984. ,
  36985. b.or = function(e) {
  36986. return t(e) || (e = a(e)),
  36987. r(this.low | e.low, this.high | e.high, this.unsigned)
  36988. }
  36989. ,
  36990. b.xor = function(e) {
  36991. return t(e) || (e = a(e)),
  36992. r(this.low ^ e.low, this.high ^ e.high, this.unsigned)
  36993. }
  36994. ,
  36995. b.shiftLeft = function(e) {
  36996. return t(e) && (e = e.toInt()),
  36997. 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)
  36998. }
  36999. ,
  37000. b.shl = b.shiftLeft,
  37001. b.shiftRight = function(e) {
  37002. return t(e) && (e = e.toInt()),
  37003. 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)
  37004. }
  37005. ,
  37006. b.shr = b.shiftRight,
  37007. b.shiftRightUnsigned = function(e) {
  37008. if (t(e) && (e = e.toInt()),
  37009. e &= 63,
  37010. 0 === e)
  37011. return this;
  37012. var i = this.high;
  37013. if (e < 32) {
  37014. var n = this.low;
  37015. return r(n >>> e | i << 32 - e, i >>> e, this.unsigned)
  37016. }
  37017. return 32 === e ? r(i, 0, this.unsigned) : r(i >>> e - 32, 0, this.unsigned)
  37018. }
  37019. ,
  37020. b.shru = b.shiftRightUnsigned,
  37021. b.toSigned = function() {
  37022. return this.unsigned ? r(this.low, this.high, !1) : this
  37023. }
  37024. ,
  37025. b.toUnsigned = function() {
  37026. return this.unsigned ? this : r(this.low, this.high, !0)
  37027. }
  37028. ,
  37029. b.toBytes = function(e) {
  37030. return e ? this.toBytesLE() : this.toBytesBE()
  37031. }
  37032. ,
  37033. b.toBytesLE = function() {
  37034. var e = this.high
  37035. , t = this.low;
  37036. return [255 & t, t >>> 8 & 255, t >>> 16 & 255, t >>> 24 & 255, 255 & e, e >>> 8 & 255, e >>> 16 & 255, e >>> 24 & 255]
  37037. }
  37038. ,
  37039. b.toBytesBE = function() {
  37040. var e = this.high
  37041. , t = this.low;
  37042. return [e >>> 24 & 255, e >>> 16 & 255, e >>> 8 & 255, 255 & e, t >>> 24 & 255, t >>> 16 & 255, t >>> 8 & 255, 255 & t]
  37043. }
  37044. ,
  37045. e
  37046. })
  37047. }
  37048. , {}],
  37049. 217: [function(e, t, i) {
  37050. var n = {
  37051. REVISION: "75"
  37052. };
  37053. "function" == typeof define && define.amd ? define("three", n) : "undefined" != typeof i && "undefined" != typeof t && (t.exports = n),
  37054. void 0 === Number.EPSILON && (Number.EPSILON = Math.pow(2, -52)),
  37055. void 0 === Math.sign && (Math.sign = function(e) {
  37056. return e < 0 ? -1 : e > 0 ? 1 : +e
  37057. }
  37058. ),
  37059. void 0 === Function.prototype.name && void 0 !== Object.defineProperty && Object.defineProperty(Function.prototype, "name", {
  37060. get: function() {
  37061. return this.toString().match(/^\s*function\s*(\S*)\s*\(/)[1]
  37062. }
  37063. }),
  37064. void 0 === Object.assign && Object.defineProperty(Object, "assign", {
  37065. writable: !0,
  37066. configurable: !0,
  37067. value: function(e) {
  37068. "use strict";
  37069. if (void 0 === e || null === e)
  37070. throw new TypeError("Cannot convert first argument to object");
  37071. for (var t = Object(e), i = 1, n = arguments.length; i !== n; ++i) {
  37072. var r = arguments[i];
  37073. if (void 0 !== r && null !== r) {
  37074. r = Object(r);
  37075. for (var o = Object.keys(r), a = 0, s = o.length; a !== s; ++a) {
  37076. var l = o[a]
  37077. , c = Object.getOwnPropertyDescriptor(r, l);
  37078. void 0 !== c && c.enumerable && (t[l] = r[l])
  37079. }
  37080. }
  37081. }
  37082. return t
  37083. }
  37084. }),
  37085. n.MOUSE = {
  37086. LEFT: 0,
  37087. MIDDLE: 1,
  37088. RIGHT: 2
  37089. },
  37090. n.CullFaceNone = 0,
  37091. n.CullFaceBack = 1,
  37092. n.CullFaceFront = 2,
  37093. n.CullFaceFrontBack = 3,
  37094. n.FrontFaceDirectionCW = 0,
  37095. n.FrontFaceDirectionCCW = 1,
  37096. n.BasicShadowMap = 0,
  37097. n.PCFShadowMap = 1,
  37098. n.PCFSoftShadowMap = 2,
  37099. n.FrontSide = 0,
  37100. n.BackSide = 1,
  37101. n.DoubleSide = 2,
  37102. n.FlatShading = 1,
  37103. n.SmoothShading = 2,
  37104. n.NoColors = 0,
  37105. n.FaceColors = 1,
  37106. n.VertexColors = 2,
  37107. n.NoBlending = 0,
  37108. n.NormalBlending = 1,
  37109. n.AdditiveBlending = 2,
  37110. n.SubtractiveBlending = 3,
  37111. n.MultiplyBlending = 4,
  37112. n.CustomBlending = 5,
  37113. n.AddEquation = 100,
  37114. n.SubtractEquation = 101,
  37115. n.ReverseSubtractEquation = 102,
  37116. n.MinEquation = 103,
  37117. n.MaxEquation = 104,
  37118. n.ZeroFactor = 200,
  37119. n.OneFactor = 201,
  37120. n.SrcColorFactor = 202,
  37121. n.OneMinusSrcColorFactor = 203,
  37122. n.SrcAlphaFactor = 204,
  37123. n.OneMinusSrcAlphaFactor = 205,
  37124. n.DstAlphaFactor = 206,
  37125. n.OneMinusDstAlphaFactor = 207,
  37126. n.DstColorFactor = 208,
  37127. n.OneMinusDstColorFactor = 209,
  37128. n.SrcAlphaSaturateFactor = 210,
  37129. n.NeverDepth = 0,
  37130. n.AlwaysDepth = 1,
  37131. n.LessDepth = 2,
  37132. n.LessEqualDepth = 3,
  37133. n.EqualDepth = 4,
  37134. n.GreaterEqualDepth = 5,
  37135. n.GreaterDepth = 6,
  37136. n.NotEqualDepth = 7,
  37137. n.MultiplyOperation = 0,
  37138. n.MixOperation = 1,
  37139. n.AddOperation = 2,
  37140. n.NoToneMapping = 0,
  37141. n.LinearToneMapping = 1,
  37142. n.ReinhardToneMapping = 2,
  37143. n.Uncharted2ToneMapping = 3,
  37144. n.CineonToneMapping = 4,
  37145. n.UVMapping = 300,
  37146. n.CubeReflectionMapping = 301,
  37147. n.CubeRefractionMapping = 302,
  37148. n.EquirectangularReflectionMapping = 303,
  37149. n.EquirectangularRefractionMapping = 304,
  37150. n.SphericalReflectionMapping = 305,
  37151. n.CubeUVReflectionMapping = 306,
  37152. n.CubeUVRefractionMapping = 307,
  37153. n.RepeatWrapping = 1e3,
  37154. n.ClampToEdgeWrapping = 1001,
  37155. n.MirroredRepeatWrapping = 1002,
  37156. n.NearestFilter = 1003,
  37157. n.NearestMipMapNearestFilter = 1004,
  37158. n.NearestMipMapLinearFilter = 1005,
  37159. n.LinearFilter = 1006,
  37160. n.LinearMipMapNearestFilter = 1007,
  37161. n.LinearMipMapLinearFilter = 1008,
  37162. n.UnsignedByteType = 1009,
  37163. n.ByteType = 1010,
  37164. n.ShortType = 1011,
  37165. n.UnsignedShortType = 1012,
  37166. n.IntType = 1013,
  37167. n.UnsignedIntType = 1014,
  37168. n.FloatType = 1015,
  37169. n.HalfFloatType = 1025,
  37170. n.UnsignedShort4444Type = 1016,
  37171. n.UnsignedShort5551Type = 1017,
  37172. n.UnsignedShort565Type = 1018,
  37173. n.AlphaFormat = 1019,
  37174. n.RGBFormat = 1020,
  37175. n.RGBAFormat = 1021,
  37176. n.LuminanceFormat = 1022,
  37177. n.LuminanceAlphaFormat = 1023,
  37178. n.RGBEFormat = n.RGBAFormat,
  37179. n.RGB_S3TC_DXT1_Format = 2001,
  37180. n.RGBA_S3TC_DXT1_Format = 2002,
  37181. n.RGBA_S3TC_DXT3_Format = 2003,
  37182. n.RGBA_S3TC_DXT5_Format = 2004,
  37183. n.RGB_PVRTC_4BPPV1_Format = 2100,
  37184. n.RGB_PVRTC_2BPPV1_Format = 2101,
  37185. n.RGBA_PVRTC_4BPPV1_Format = 2102,
  37186. n.RGBA_PVRTC_2BPPV1_Format = 2103,
  37187. n.RGB_ETC1_Format = 2151,
  37188. n.LoopOnce = 2200,
  37189. n.LoopRepeat = 2201,
  37190. n.LoopPingPong = 2202,
  37191. n.InterpolateDiscrete = 2300,
  37192. n.InterpolateLinear = 2301,
  37193. n.InterpolateSmooth = 2302,
  37194. n.ZeroCurvatureEnding = 2400,
  37195. n.ZeroSlopeEnding = 2401,
  37196. n.WrapAroundEnding = 2402,
  37197. n.TrianglesDrawMode = 0,
  37198. n.TriangleStripDrawMode = 1,
  37199. n.TriangleFanDrawMode = 2,
  37200. n.LinearEncoding = 3e3,
  37201. n.sRGBEncoding = 3001,
  37202. n.GammaEncoding = 3007,
  37203. n.RGBEEncoding = 3002,
  37204. n.LogLuvEncoding = 3003,
  37205. n.RGBM7Encoding = 3004,
  37206. n.RGBM16Encoding = 3005,
  37207. n.RGBDEncoding = 3006,
  37208. n.Color = function(e) {
  37209. return 3 === arguments.length ? this.fromArray(arguments) : this.set(e)
  37210. }
  37211. ,
  37212. n.Color.prototype = {
  37213. constructor: n.Color,
  37214. r: 1,
  37215. g: 1,
  37216. b: 1,
  37217. set: function(e) {
  37218. return e instanceof n.Color ? this.copy(e) : "number" == typeof e ? this.setHex(e) : "string" == typeof e && this.setStyle(e),
  37219. this
  37220. },
  37221. setScalar: function(e) {
  37222. this.r = e,
  37223. this.g = e,
  37224. this.b = e
  37225. },
  37226. setHex: function(e) {
  37227. return e = Math.floor(e),
  37228. this.r = (e >> 16 & 255) / 255,
  37229. this.g = (e >> 8 & 255) / 255,
  37230. this.b = (255 & e) / 255,
  37231. this
  37232. },
  37233. setRGB: function(e, t, i) {
  37234. return this.r = e,
  37235. this.g = t,
  37236. this.b = i,
  37237. this
  37238. },
  37239. setHSL: function() {
  37240. function e(e, t, i) {
  37241. return i < 0 && (i += 1),
  37242. i > 1 && (i -= 1),
  37243. i < 1 / 6 ? e + 6 * (t - e) * i : i < .5 ? t : i < 2 / 3 ? e + 6 * (t - e) * (2 / 3 - i) : e
  37244. }
  37245. return function(t, i, r) {
  37246. if (t = n.Math.euclideanModulo(t, 1),
  37247. i = n.Math.clamp(i, 0, 1),
  37248. r = n.Math.clamp(r, 0, 1),
  37249. 0 === i)
  37250. this.r = this.g = this.b = r;
  37251. else {
  37252. var o = r <= .5 ? r * (1 + i) : r + i - r * i
  37253. , a = 2 * r - o;
  37254. this.r = e(a, o, t + 1 / 3),
  37255. this.g = e(a, o, t),
  37256. this.b = e(a, o, t - 1 / 3)
  37257. }
  37258. return this
  37259. }
  37260. }(),
  37261. setStyle: function(e) {
  37262. function t(t) {
  37263. void 0 !== t && parseFloat(t) < 1 && console.warn("THREE.Color: Alpha component of " + e + " will be ignored.")
  37264. }
  37265. var i;
  37266. if (i = /^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(e)) {
  37267. var r, o = i[1], a = i[2];
  37268. switch (o) {
  37269. case "rgb":
  37270. case "rgba":
  37271. if (r = /^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a))
  37272. return this.r = Math.min(255, parseInt(r[1], 10)) / 255,
  37273. this.g = Math.min(255, parseInt(r[2], 10)) / 255,
  37274. this.b = Math.min(255, parseInt(r[3], 10)) / 255,
  37275. t(r[5]),
  37276. this;
  37277. if (r = /^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a))
  37278. return this.r = Math.min(100, parseInt(r[1], 10)) / 100,
  37279. this.g = Math.min(100, parseInt(r[2], 10)) / 100,
  37280. this.b = Math.min(100, parseInt(r[3], 10)) / 100,
  37281. t(r[5]),
  37282. this;
  37283. break;
  37284. case "hsl":
  37285. case "hsla":
  37286. if (r = /^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a)) {
  37287. var s = parseFloat(r[1]) / 360
  37288. , l = parseInt(r[2], 10) / 100
  37289. , c = parseInt(r[3], 10) / 100;
  37290. return t(r[5]),
  37291. this.setHSL(s, l, c)
  37292. }
  37293. }
  37294. } else if (i = /^\#([A-Fa-f0-9]+)$/.exec(e)) {
  37295. var h = i[1]
  37296. , u = h.length;
  37297. if (3 === u)
  37298. return this.r = parseInt(h.charAt(0) + h.charAt(0), 16) / 255,
  37299. this.g = parseInt(h.charAt(1) + h.charAt(1), 16) / 255,
  37300. this.b = parseInt(h.charAt(2) + h.charAt(2), 16) / 255,
  37301. this;
  37302. if (6 === u)
  37303. return this.r = parseInt(h.charAt(0) + h.charAt(1), 16) / 255,
  37304. this.g = parseInt(h.charAt(2) + h.charAt(3), 16) / 255,
  37305. this.b = parseInt(h.charAt(4) + h.charAt(5), 16) / 255,
  37306. this
  37307. }
  37308. if (e && e.length > 0) {
  37309. var h = n.ColorKeywords[e];
  37310. void 0 !== h ? this.setHex(h) : console.warn("THREE.Color: Unknown color " + e)
  37311. }
  37312. return this
  37313. },
  37314. clone: function() {
  37315. return new this.constructor(this.r,this.g,this.b)
  37316. },
  37317. copy: function(e) {
  37318. return this.r = e.r,
  37319. this.g = e.g,
  37320. this.b = e.b,
  37321. this
  37322. },
  37323. copyGammaToLinear: function(e, t) {
  37324. return void 0 === t && (t = 2),
  37325. this.r = Math.pow(e.r, t),
  37326. this.g = Math.pow(e.g, t),
  37327. this.b = Math.pow(e.b, t),
  37328. this
  37329. },
  37330. copyLinearToGamma: function(e, t) {
  37331. void 0 === t && (t = 2);
  37332. var i = t > 0 ? 1 / t : 1;
  37333. return this.r = Math.pow(e.r, i),
  37334. this.g = Math.pow(e.g, i),
  37335. this.b = Math.pow(e.b, i),
  37336. this
  37337. },
  37338. convertGammaToLinear: function() {
  37339. var e = this.r
  37340. , t = this.g
  37341. , i = this.b;
  37342. return this.r = e * e,
  37343. this.g = t * t,
  37344. this.b = i * i,
  37345. this
  37346. },
  37347. convertLinearToGamma: function() {
  37348. return this.r = Math.sqrt(this.r),
  37349. this.g = Math.sqrt(this.g),
  37350. this.b = Math.sqrt(this.b),
  37351. this
  37352. },
  37353. getHex: function() {
  37354. return 255 * this.r << 16 ^ 255 * this.g << 8 ^ 255 * this.b << 0
  37355. },
  37356. getHexString: function() {
  37357. return ("000000" + this.getHex().toString(16)).slice(-6)
  37358. },
  37359. getHSL: function(e) {
  37360. var t, i, n = e || {
  37361. h: 0,
  37362. s: 0,
  37363. l: 0
  37364. }, 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;
  37365. if (l === s)
  37366. t = 0,
  37367. i = 0;
  37368. else {
  37369. var h = s - l;
  37370. switch (i = c <= .5 ? h / (s + l) : h / (2 - s - l),
  37371. s) {
  37372. case r:
  37373. t = (o - a) / h + (o < a ? 6 : 0);
  37374. break;
  37375. case o:
  37376. t = (a - r) / h + 2;
  37377. break;
  37378. case a:
  37379. t = (r - o) / h + 4
  37380. }
  37381. t /= 6
  37382. }
  37383. return n.h = t,
  37384. n.s = i,
  37385. n.l = c,
  37386. n
  37387. },
  37388. getStyle: function() {
  37389. return "rgb(" + (255 * this.r | 0) + "," + (255 * this.g | 0) + "," + (255 * this.b | 0) + ")"
  37390. },
  37391. offsetHSL: function(e, t, i) {
  37392. var n = this.getHSL();
  37393. return n.h += e,
  37394. n.s += t,
  37395. n.l += i,
  37396. this.setHSL(n.h, n.s, n.l),
  37397. this
  37398. },
  37399. add: function(e) {
  37400. return this.r += e.r,
  37401. this.g += e.g,
  37402. this.b += e.b,
  37403. this
  37404. },
  37405. addColors: function(e, t) {
  37406. return this.r = e.r + t.r,
  37407. this.g = e.g + t.g,
  37408. this.b = e.b + t.b,
  37409. this
  37410. },
  37411. addScalar: function(e) {
  37412. return this.r += e,
  37413. this.g += e,
  37414. this.b += e,
  37415. this
  37416. },
  37417. multiply: function(e) {
  37418. return this.r *= e.r,
  37419. this.g *= e.g,
  37420. this.b *= e.b,
  37421. this
  37422. },
  37423. multiplyScalar: function(e) {
  37424. return this.r *= e,
  37425. this.g *= e,
  37426. this.b *= e,
  37427. this
  37428. },
  37429. lerp: function(e, t) {
  37430. return this.r += (e.r - this.r) * t,
  37431. this.g += (e.g - this.g) * t,
  37432. this.b += (e.b - this.b) * t,
  37433. this
  37434. },
  37435. equals: function(e) {
  37436. return e.r === this.r && e.g === this.g && e.b === this.b
  37437. },
  37438. fromArray: function(e, t) {
  37439. return void 0 === t && (t = 0),
  37440. this.r = e[t],
  37441. this.g = e[t + 1],
  37442. this.b = e[t + 2],
  37443. this
  37444. },
  37445. toArray: function(e, t) {
  37446. return void 0 === e && (e = []),
  37447. void 0 === t && (t = 0),
  37448. e[t] = this.r,
  37449. e[t + 1] = this.g,
  37450. e[t + 2] = this.b,
  37451. e
  37452. }
  37453. },
  37454. n.ColorKeywords = {
  37455. aliceblue: 15792383,
  37456. antiquewhite: 16444375,
  37457. aqua: 65535,
  37458. aquamarine: 8388564,
  37459. azure: 15794175,
  37460. beige: 16119260,
  37461. bisque: 16770244,
  37462. black: 0,
  37463. blanchedalmond: 16772045,
  37464. blue: 255,
  37465. blueviolet: 9055202,
  37466. brown: 10824234,
  37467. burlywood: 14596231,
  37468. cadetblue: 6266528,
  37469. chartreuse: 8388352,
  37470. chocolate: 13789470,
  37471. coral: 16744272,
  37472. cornflowerblue: 6591981,
  37473. cornsilk: 16775388,
  37474. crimson: 14423100,
  37475. cyan: 65535,
  37476. darkblue: 139,
  37477. darkcyan: 35723,
  37478. darkgoldenrod: 12092939,
  37479. darkgray: 11119017,
  37480. darkgreen: 25600,
  37481. darkgrey: 11119017,
  37482. darkkhaki: 12433259,
  37483. darkmagenta: 9109643,
  37484. darkolivegreen: 5597999,
  37485. darkorange: 16747520,
  37486. darkorchid: 10040012,
  37487. darkred: 9109504,
  37488. darksalmon: 15308410,
  37489. darkseagreen: 9419919,
  37490. darkslateblue: 4734347,
  37491. darkslategray: 3100495,
  37492. darkslategrey: 3100495,
  37493. darkturquoise: 52945,
  37494. darkviolet: 9699539,
  37495. deeppink: 16716947,
  37496. deepskyblue: 49151,
  37497. dimgray: 6908265,
  37498. dimgrey: 6908265,
  37499. dodgerblue: 2003199,
  37500. firebrick: 11674146,
  37501. floralwhite: 16775920,
  37502. forestgreen: 2263842,
  37503. fuchsia: 16711935,
  37504. gainsboro: 14474460,
  37505. ghostwhite: 16316671,
  37506. gold: 16766720,
  37507. goldenrod: 14329120,
  37508. gray: 8421504,
  37509. green: 32768,
  37510. greenyellow: 11403055,
  37511. grey: 8421504,
  37512. honeydew: 15794160,
  37513. hotpink: 16738740,
  37514. indianred: 13458524,
  37515. indigo: 4915330,
  37516. ivory: 16777200,
  37517. khaki: 15787660,
  37518. lavender: 15132410,
  37519. lavenderblush: 16773365,
  37520. lawngreen: 8190976,
  37521. lemonchiffon: 16775885,
  37522. lightblue: 11393254,
  37523. lightcoral: 15761536,
  37524. lightcyan: 14745599,
  37525. lightgoldenrodyellow: 16448210,
  37526. lightgray: 13882323,
  37527. lightgreen: 9498256,
  37528. lightgrey: 13882323,
  37529. lightpink: 16758465,
  37530. lightsalmon: 16752762,
  37531. lightseagreen: 2142890,
  37532. lightskyblue: 8900346,
  37533. lightslategray: 7833753,
  37534. lightslategrey: 7833753,
  37535. lightsteelblue: 11584734,
  37536. lightyellow: 16777184,
  37537. lime: 65280,
  37538. limegreen: 3329330,
  37539. linen: 16445670,
  37540. magenta: 16711935,
  37541. maroon: 8388608,
  37542. mediumaquamarine: 6737322,
  37543. mediumblue: 205,
  37544. mediumorchid: 12211667,
  37545. mediumpurple: 9662683,
  37546. mediumseagreen: 3978097,
  37547. mediumslateblue: 8087790,
  37548. mediumspringgreen: 64154,
  37549. mediumturquoise: 4772300,
  37550. mediumvioletred: 13047173,
  37551. midnightblue: 1644912,
  37552. mintcream: 16121850,
  37553. mistyrose: 16770273,
  37554. moccasin: 16770229,
  37555. navajowhite: 16768685,
  37556. navy: 128,
  37557. oldlace: 16643558,
  37558. olive: 8421376,
  37559. olivedrab: 7048739,
  37560. orange: 16753920,
  37561. orangered: 16729344,
  37562. orchid: 14315734,
  37563. palegoldenrod: 15657130,
  37564. palegreen: 10025880,
  37565. paleturquoise: 11529966,
  37566. palevioletred: 14381203,
  37567. papayawhip: 16773077,
  37568. peachpuff: 16767673,
  37569. peru: 13468991,
  37570. pink: 16761035,
  37571. plum: 14524637,
  37572. powderblue: 11591910,
  37573. purple: 8388736,
  37574. red: 16711680,
  37575. rosybrown: 12357519,
  37576. royalblue: 4286945,
  37577. saddlebrown: 9127187,
  37578. salmon: 16416882,
  37579. sandybrown: 16032864,
  37580. seagreen: 3050327,
  37581. seashell: 16774638,
  37582. sienna: 10506797,
  37583. silver: 12632256,
  37584. skyblue: 8900331,
  37585. slateblue: 6970061,
  37586. slategray: 7372944,
  37587. slategrey: 7372944,
  37588. snow: 16775930,
  37589. springgreen: 65407,
  37590. steelblue: 4620980,
  37591. tan: 13808780,
  37592. teal: 32896,
  37593. thistle: 14204888,
  37594. tomato: 16737095,
  37595. turquoise: 4251856,
  37596. violet: 15631086,
  37597. wheat: 16113331,
  37598. white: 16777215,
  37599. whitesmoke: 16119285,
  37600. yellow: 16776960,
  37601. yellowgreen: 10145074
  37602. },
  37603. n.Quaternion = function(e, t, i, n) {
  37604. this._x = e || 0,
  37605. this._y = t || 0,
  37606. this._z = i || 0,
  37607. this._w = void 0 !== n ? n : 1
  37608. }
  37609. ,
  37610. n.Quaternion.prototype = {
  37611. constructor: n.Quaternion,
  37612. get x() {
  37613. return this._x
  37614. },
  37615. set x(e) {
  37616. this._x = e,
  37617. this.onChangeCallback()
  37618. },
  37619. get y() {
  37620. return this._y
  37621. },
  37622. set y(e) {
  37623. this._y = e,
  37624. this.onChangeCallback()
  37625. },
  37626. get z() {
  37627. return this._z
  37628. },
  37629. set z(e) {
  37630. this._z = e,
  37631. this.onChangeCallback()
  37632. },
  37633. get w() {
  37634. return this._w
  37635. },
  37636. set w(e) {
  37637. this._w = e,
  37638. this.onChangeCallback()
  37639. },
  37640. set: function(e, t, i, n) {
  37641. return this._x = e,
  37642. this._y = t,
  37643. this._z = i,
  37644. this._w = n,
  37645. this.onChangeCallback(),
  37646. this
  37647. },
  37648. clone: function() {
  37649. return new this.constructor(this._x,this._y,this._z,this._w)
  37650. },
  37651. copy: function(e) {
  37652. return this._x = e.x,
  37653. this._y = e.y,
  37654. this._z = e.z,
  37655. this._w = e.w,
  37656. this.onChangeCallback(),
  37657. this
  37658. },
  37659. setFromEuler: function(e, t) {
  37660. if (e instanceof n.Euler == !1)
  37661. throw new Error("THREE.Quaternion: .setFromEuler() now expects a Euler rotation rather than a Vector3 and order.");
  37662. var i = Math.cos(e._x / 2)
  37663. , r = Math.cos(e._y / 2)
  37664. , o = Math.cos(e._z / 2)
  37665. , a = Math.sin(e._x / 2)
  37666. , s = Math.sin(e._y / 2)
  37667. , l = Math.sin(e._z / 2)
  37668. , c = e.order;
  37669. return "XYZ" === c ? (this._x = a * r * o + i * s * l,
  37670. this._y = i * s * o - a * r * l,
  37671. this._z = i * r * l + a * s * o,
  37672. this._w = i * r * o - a * s * l) : "YXZ" === c ? (this._x = a * r * o + i * s * l,
  37673. this._y = i * s * o - a * r * l,
  37674. this._z = i * r * l - a * s * o,
  37675. this._w = i * r * o + a * s * l) : "ZXY" === c ? (this._x = a * r * o - i * s * l,
  37676. this._y = i * s * o + a * r * l,
  37677. this._z = i * r * l + a * s * o,
  37678. this._w = i * r * o - a * s * l) : "ZYX" === c ? (this._x = a * r * o - i * s * l,
  37679. this._y = i * s * o + a * r * l,
  37680. this._z = i * r * l - a * s * o,
  37681. this._w = i * r * o + a * s * l) : "YZX" === c ? (this._x = a * r * o + i * s * l,
  37682. this._y = i * s * o + a * r * l,
  37683. this._z = i * r * l - a * s * o,
  37684. this._w = i * r * o - a * s * l) : "XZY" === c && (this._x = a * r * o - i * s * l,
  37685. this._y = i * s * o - a * r * l,
  37686. this._z = i * r * l + a * s * o,
  37687. this._w = i * r * o + a * s * l),
  37688. t !== !1 && this.onChangeCallback(),
  37689. this
  37690. },
  37691. setFromAxisAngle: function(e, t) {
  37692. var i = t / 2
  37693. , n = Math.sin(i);
  37694. return this._x = e.x * n,
  37695. this._y = e.y * n,
  37696. this._z = e.z * n,
  37697. this._w = Math.cos(i),
  37698. this.onChangeCallback(),
  37699. this
  37700. },
  37701. setFromRotationMatrix: function(e) {
  37702. 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;
  37703. return d > 0 ? (t = .5 / Math.sqrt(d + 1),
  37704. this._w = .25 / t,
  37705. this._x = (h - l) * t,
  37706. this._y = (o - c) * t,
  37707. this._z = (a - r) * t) : n > s && n > u ? (t = 2 * Math.sqrt(1 + n - s - u),
  37708. this._w = (h - l) / t,
  37709. this._x = .25 * t,
  37710. this._y = (r + a) / t,
  37711. this._z = (o + c) / t) : s > u ? (t = 2 * Math.sqrt(1 + s - n - u),
  37712. this._w = (o - c) / t,
  37713. this._x = (r + a) / t,
  37714. this._y = .25 * t,
  37715. this._z = (l + h) / t) : (t = 2 * Math.sqrt(1 + u - n - s),
  37716. this._w = (a - r) / t,
  37717. this._x = (o + c) / t,
  37718. this._y = (l + h) / t,
  37719. this._z = .25 * t),
  37720. this.onChangeCallback(),
  37721. this
  37722. },
  37723. setFromUnitVectors: function() {
  37724. var e, t, i = 1e-6;
  37725. return function(r, o) {
  37726. return void 0 === e && (e = new n.Vector3),
  37727. t = r.dot(o) + 1,
  37728. t < i ? (t = 0,
  37729. 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),
  37730. this._x = e.x,
  37731. this._y = e.y,
  37732. this._z = e.z,
  37733. this._w = t,
  37734. this.normalize(),
  37735. this
  37736. }
  37737. }(),
  37738. inverse: function() {
  37739. return this.conjugate().normalize(),
  37740. this
  37741. },
  37742. conjugate: function() {
  37743. return this._x *= -1,
  37744. this._y *= -1,
  37745. this._z *= -1,
  37746. this.onChangeCallback(),
  37747. this
  37748. },
  37749. dot: function(e) {
  37750. return this._x * e._x + this._y * e._y + this._z * e._z + this._w * e._w
  37751. },
  37752. lengthSq: function() {
  37753. return this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w
  37754. },
  37755. length: function() {
  37756. return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w)
  37757. },
  37758. normalize: function() {
  37759. var e = this.length();
  37760. return 0 === e ? (this._x = 0,
  37761. this._y = 0,
  37762. this._z = 0,
  37763. this._w = 1) : (e = 1 / e,
  37764. this._x = this._x * e,
  37765. this._y = this._y * e,
  37766. this._z = this._z * e,
  37767. this._w = this._w * e),
  37768. this.onChangeCallback(),
  37769. this
  37770. },
  37771. multiply: function(e, t) {
  37772. return void 0 !== t ? (console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),
  37773. this.multiplyQuaternions(e, t)) : this.multiplyQuaternions(this, e)
  37774. },
  37775. multiplyQuaternions: function(e, t) {
  37776. var i = e._x
  37777. , n = e._y
  37778. , r = e._z
  37779. , o = e._w
  37780. , a = t._x
  37781. , s = t._y
  37782. , l = t._z
  37783. , c = t._w;
  37784. return this._x = i * c + o * a + n * l - r * s,
  37785. this._y = n * c + o * s + r * a - i * l,
  37786. this._z = r * c + o * l + i * s - n * a,
  37787. this._w = o * c - i * a - n * s - r * l,
  37788. this.onChangeCallback(),
  37789. this
  37790. },
  37791. slerp: function(e, t) {
  37792. if (0 === t)
  37793. return this;
  37794. if (1 === t)
  37795. return this.copy(e);
  37796. var i = this._x
  37797. , n = this._y
  37798. , r = this._z
  37799. , o = this._w
  37800. , a = o * e._w + i * e._x + n * e._y + r * e._z;
  37801. if (a < 0 ? (this._w = -e._w,
  37802. this._x = -e._x,
  37803. this._y = -e._y,
  37804. this._z = -e._z,
  37805. a = -a) : this.copy(e),
  37806. a >= 1)
  37807. return this._w = o,
  37808. this._x = i,
  37809. this._y = n,
  37810. this._z = r,
  37811. this;
  37812. var s = Math.sqrt(1 - a * a);
  37813. if (Math.abs(s) < .001)
  37814. return this._w = .5 * (o + this._w),
  37815. this._x = .5 * (i + this._x),
  37816. this._y = .5 * (n + this._y),
  37817. this._z = .5 * (r + this._z),
  37818. this;
  37819. var l = Math.atan2(s, a)
  37820. , c = Math.sin((1 - t) * l) / s
  37821. , h = Math.sin(t * l) / s;
  37822. return this._w = o * c + this._w * h,
  37823. this._x = i * c + this._x * h,
  37824. this._y = n * c + this._y * h,
  37825. this._z = r * c + this._z * h,
  37826. this.onChangeCallback(),
  37827. this
  37828. },
  37829. equals: function(e) {
  37830. return e._x === this._x && e._y === this._y && e._z === this._z && e._w === this._w
  37831. },
  37832. fromArray: function(e, t) {
  37833. return void 0 === t && (t = 0),
  37834. this._x = e[t],
  37835. this._y = e[t + 1],
  37836. this._z = e[t + 2],
  37837. this._w = e[t + 3],
  37838. this.onChangeCallback(),
  37839. this
  37840. },
  37841. toArray: function(e, t) {
  37842. return void 0 === e && (e = []),
  37843. void 0 === t && (t = 0),
  37844. e[t] = this._x,
  37845. e[t + 1] = this._y,
  37846. e[t + 2] = this._z,
  37847. e[t + 3] = this._w,
  37848. e
  37849. },
  37850. onChange: function(e) {
  37851. return this.onChangeCallback = e,
  37852. this
  37853. },
  37854. onChangeCallback: function() {}
  37855. },
  37856. Object.assign(n.Quaternion, {
  37857. slerp: function(e, t, i, n) {
  37858. return i.copy(e).slerp(t, n)
  37859. },
  37860. slerpFlat: function(e, t, i, n, r, o, a) {
  37861. var s = i[n + 0]
  37862. , l = i[n + 1]
  37863. , c = i[n + 2]
  37864. , h = i[n + 3]
  37865. , u = r[o + 0]
  37866. , d = r[o + 1]
  37867. , p = r[o + 2]
  37868. , f = r[o + 3];
  37869. if (h !== f || s !== u || l !== d || c !== p) {
  37870. var g = 1 - a
  37871. , m = s * u + l * d + c * p + h * f
  37872. , v = m >= 0 ? 1 : -1
  37873. , A = 1 - m * m;
  37874. if (A > Number.EPSILON) {
  37875. var y = Math.sqrt(A)
  37876. , C = Math.atan2(y, m * v);
  37877. g = Math.sin(g * C) / y,
  37878. a = Math.sin(a * C) / y
  37879. }
  37880. var I = a * v;
  37881. if (s = s * g + u * I,
  37882. l = l * g + d * I,
  37883. c = c * g + p * I,
  37884. h = h * g + f * I,
  37885. g === 1 - a) {
  37886. var E = 1 / Math.sqrt(s * s + l * l + c * c + h * h);
  37887. s *= E,
  37888. l *= E,
  37889. c *= E,
  37890. h *= E
  37891. }
  37892. }
  37893. e[t] = s,
  37894. e[t + 1] = l,
  37895. e[t + 2] = c,
  37896. e[t + 3] = h
  37897. }
  37898. }),
  37899. n.Vector2 = function(e, t) {
  37900. this.x = e || 0,
  37901. this.y = t || 0
  37902. }
  37903. ,
  37904. n.Vector2.prototype = {
  37905. constructor: n.Vector2,
  37906. get width() {
  37907. return this.x
  37908. },
  37909. set width(e) {
  37910. this.x = e
  37911. },
  37912. get height() {
  37913. return this.y
  37914. },
  37915. set height(e) {
  37916. this.y = e
  37917. },
  37918. set: function(e, t) {
  37919. return this.x = e,
  37920. this.y = t,
  37921. this
  37922. },
  37923. setScalar: function(e) {
  37924. return this.x = e,
  37925. this.y = e,
  37926. this
  37927. },
  37928. setX: function(e) {
  37929. return this.x = e,
  37930. this
  37931. },
  37932. setY: function(e) {
  37933. return this.y = e,
  37934. this
  37935. },
  37936. setComponent: function(e, t) {
  37937. switch (e) {
  37938. case 0:
  37939. this.x = t;
  37940. break;
  37941. case 1:
  37942. this.y = t;
  37943. break;
  37944. default:
  37945. throw new Error("index is out of range: " + e)
  37946. }
  37947. },
  37948. getComponent: function(e) {
  37949. switch (e) {
  37950. case 0:
  37951. return this.x;
  37952. case 1:
  37953. return this.y;
  37954. default:
  37955. throw new Error("index is out of range: " + e)
  37956. }
  37957. },
  37958. clone: function() {
  37959. return new this.constructor(this.x,this.y)
  37960. },
  37961. copy: function(e) {
  37962. return this.x = e.x,
  37963. this.y = e.y,
  37964. this
  37965. },
  37966. add: function(e, t) {
  37967. return void 0 !== t ? (console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),
  37968. this.addVectors(e, t)) : (this.x += e.x,
  37969. this.y += e.y,
  37970. this)
  37971. },
  37972. addScalar: function(e) {
  37973. return this.x += e,
  37974. this.y += e,
  37975. this
  37976. },
  37977. addVectors: function(e, t) {
  37978. return this.x = e.x + t.x,
  37979. this.y = e.y + t.y,
  37980. this
  37981. },
  37982. addScaledVector: function(e, t) {
  37983. return this.x += e.x * t,
  37984. this.y += e.y * t,
  37985. this
  37986. },
  37987. sub: function(e, t) {
  37988. return void 0 !== t ? (console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
  37989. this.subVectors(e, t)) : (this.x -= e.x,
  37990. this.y -= e.y,
  37991. this)
  37992. },
  37993. subScalar: function(e) {
  37994. return this.x -= e,
  37995. this.y -= e,
  37996. this
  37997. },
  37998. subVectors: function(e, t) {
  37999. return this.x = e.x - t.x,
  38000. this.y = e.y - t.y,
  38001. this
  38002. },
  38003. multiply: function(e) {
  38004. return this.x *= e.x,
  38005. this.y *= e.y,
  38006. this
  38007. },
  38008. multiplyScalar: function(e) {
  38009. return isFinite(e) ? (this.x *= e,
  38010. this.y *= e) : (this.x = 0,
  38011. this.y = 0),
  38012. this
  38013. },
  38014. divide: function(e) {
  38015. return this.x /= e.x,
  38016. this.y /= e.y,
  38017. this
  38018. },
  38019. divideScalar: function(e) {
  38020. return this.multiplyScalar(1 / e)
  38021. },
  38022. min: function(e) {
  38023. return this.x = Math.min(this.x, e.x),
  38024. this.y = Math.min(this.y, e.y),
  38025. this
  38026. },
  38027. max: function(e) {
  38028. return this.x = Math.max(this.x, e.x),
  38029. this.y = Math.max(this.y, e.y),
  38030. this
  38031. },
  38032. clamp: function(e, t) {
  38033. return this.x = Math.max(e.x, Math.min(t.x, this.x)),
  38034. this.y = Math.max(e.y, Math.min(t.y, this.y)),
  38035. this
  38036. },
  38037. clampScalar: function() {
  38038. var e, t;
  38039. return function(i, r) {
  38040. return void 0 === e && (e = new n.Vector2,
  38041. t = new n.Vector2),
  38042. e.set(i, i),
  38043. t.set(r, r),
  38044. this.clamp(e, t)
  38045. }
  38046. }(),
  38047. clampLength: function(e, t) {
  38048. var i = this.length();
  38049. return this.multiplyScalar(Math.max(e, Math.min(t, i)) / i),
  38050. this
  38051. },
  38052. floor: function() {
  38053. return this.x = Math.floor(this.x),
  38054. this.y = Math.floor(this.y),
  38055. this
  38056. },
  38057. ceil: function() {
  38058. return this.x = Math.ceil(this.x),
  38059. this.y = Math.ceil(this.y),
  38060. this
  38061. },
  38062. round: function() {
  38063. return this.x = Math.round(this.x),
  38064. this.y = Math.round(this.y),
  38065. this
  38066. },
  38067. roundToZero: function() {
  38068. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x),
  38069. this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y),
  38070. this
  38071. },
  38072. negate: function() {
  38073. return this.x = -this.x,
  38074. this.y = -this.y,
  38075. this
  38076. },
  38077. dot: function(e) {
  38078. return this.x * e.x + this.y * e.y
  38079. },
  38080. lengthSq: function() {
  38081. return this.x * this.x + this.y * this.y
  38082. },
  38083. length: function() {
  38084. return Math.sqrt(this.x * this.x + this.y * this.y)
  38085. },
  38086. lengthManhattan: function() {
  38087. return Math.abs(this.x) + Math.abs(this.y)
  38088. },
  38089. normalize: function() {
  38090. return this.divideScalar(this.length())
  38091. },
  38092. angle: function() {
  38093. var e = Math.atan2(this.y, this.x);
  38094. return e < 0 && (e += 2 * Math.PI),
  38095. e
  38096. },
  38097. distanceTo: function(e) {
  38098. return Math.sqrt(this.distanceToSquared(e))
  38099. },
  38100. distanceToSquared: function(e) {
  38101. var t = this.x - e.x
  38102. , i = this.y - e.y;
  38103. return t * t + i * i
  38104. },
  38105. setLength: function(e) {
  38106. return this.multiplyScalar(e / this.length())
  38107. },
  38108. lerp: function(e, t) {
  38109. return this.x += (e.x - this.x) * t,
  38110. this.y += (e.y - this.y) * t,
  38111. this
  38112. },
  38113. lerpVectors: function(e, t, i) {
  38114. return this.subVectors(t, e).multiplyScalar(i).add(e),
  38115. this
  38116. },
  38117. equals: function(e) {
  38118. return e.x === this.x && e.y === this.y
  38119. },
  38120. fromArray: function(e, t) {
  38121. return void 0 === t && (t = 0),
  38122. this.x = e[t],
  38123. this.y = e[t + 1],
  38124. this
  38125. },
  38126. toArray: function(e, t) {
  38127. return void 0 === e && (e = []),
  38128. void 0 === t && (t = 0),
  38129. e[t] = this.x,
  38130. e[t + 1] = this.y,
  38131. e
  38132. },
  38133. fromAttribute: function(e, t, i) {
  38134. return void 0 === i && (i = 0),
  38135. t = t * e.itemSize + i,
  38136. this.x = e.array[t],
  38137. this.y = e.array[t + 1],
  38138. this
  38139. },
  38140. rotateAround: function(e, t) {
  38141. var i = Math.cos(t)
  38142. , n = Math.sin(t)
  38143. , r = this.x - e.x
  38144. , o = this.y - e.y;
  38145. return this.x = r * i - o * n + e.x,
  38146. this.y = r * n + o * i + e.y,
  38147. this
  38148. }
  38149. },
  38150. n.Vector3 = function(e, t, i) {
  38151. this.x = e || 0,
  38152. this.y = t || 0,
  38153. this.z = i || 0
  38154. }
  38155. ,
  38156. n.Vector3.prototype = {
  38157. constructor: n.Vector3,
  38158. set: function(e, t, i) {
  38159. return this.x = e,
  38160. this.y = t,
  38161. this.z = i,
  38162. this
  38163. },
  38164. setScalar: function(e) {
  38165. return this.x = e,
  38166. this.y = e,
  38167. this.z = e,
  38168. this
  38169. },
  38170. setX: function(e) {
  38171. return this.x = e,
  38172. this
  38173. },
  38174. setY: function(e) {
  38175. return this.y = e,
  38176. this
  38177. },
  38178. setZ: function(e) {
  38179. return this.z = e,
  38180. this
  38181. },
  38182. setComponent: function(e, t) {
  38183. switch (e) {
  38184. case 0:
  38185. this.x = t;
  38186. break;
  38187. case 1:
  38188. this.y = t;
  38189. break;
  38190. case 2:
  38191. this.z = t;
  38192. break;
  38193. default:
  38194. throw new Error("index is out of range: " + e)
  38195. }
  38196. },
  38197. getComponent: function(e) {
  38198. switch (e) {
  38199. case 0:
  38200. return this.x;
  38201. case 1:
  38202. return this.y;
  38203. case 2:
  38204. return this.z;
  38205. default:
  38206. throw new Error("index is out of range: " + e)
  38207. }
  38208. },
  38209. clone: function() {
  38210. return new this.constructor(this.x,this.y,this.z)
  38211. },
  38212. copy: function(e) {
  38213. return this.x = e.x,
  38214. this.y = e.y,
  38215. this.z = e.z,
  38216. this
  38217. },
  38218. add: function(e, t) {
  38219. return void 0 !== t ? (console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),
  38220. this.addVectors(e, t)) : (this.x += e.x,
  38221. this.y += e.y,
  38222. this.z += e.z,
  38223. this)
  38224. },
  38225. addScalar: function(e) {
  38226. return this.x += e,
  38227. this.y += e,
  38228. this.z += e,
  38229. this
  38230. },
  38231. addVectors: function(e, t) {
  38232. return this.x = e.x + t.x,
  38233. this.y = e.y + t.y,
  38234. this.z = e.z + t.z,
  38235. this
  38236. },
  38237. addScaledVector: function(e, t) {
  38238. return this.x += e.x * t,
  38239. this.y += e.y * t,
  38240. this.z += e.z * t,
  38241. this
  38242. },
  38243. sub: function(e, t) {
  38244. return void 0 !== t ? (console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
  38245. this.subVectors(e, t)) : (this.x -= e.x,
  38246. this.y -= e.y,
  38247. this.z -= e.z,
  38248. this)
  38249. },
  38250. subScalar: function(e) {
  38251. return this.x -= e,
  38252. this.y -= e,
  38253. this.z -= e,
  38254. this
  38255. },
  38256. subVectors: function(e, t) {
  38257. return this.x = e.x - t.x,
  38258. this.y = e.y - t.y,
  38259. this.z = e.z - t.z,
  38260. this
  38261. },
  38262. multiply: function(e, t) {
  38263. return void 0 !== t ? (console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),
  38264. this.multiplyVectors(e, t)) : (this.x *= e.x,
  38265. this.y *= e.y,
  38266. this.z *= e.z,
  38267. this)
  38268. },
  38269. multiplyScalar: function(e) {
  38270. return isFinite(e) ? (this.x *= e,
  38271. this.y *= e,
  38272. this.z *= e) : (this.x = 0,
  38273. this.y = 0,
  38274. this.z = 0),
  38275. this
  38276. },
  38277. multiplyVectors: function(e, t) {
  38278. return this.x = e.x * t.x,
  38279. this.y = e.y * t.y,
  38280. this.z = e.z * t.z,
  38281. this
  38282. },
  38283. applyEuler: function() {
  38284. var e;
  38285. return function(t) {
  38286. return t instanceof n.Euler == !1 && console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),
  38287. void 0 === e && (e = new n.Quaternion),
  38288. this.applyQuaternion(e.setFromEuler(t)),
  38289. this
  38290. }
  38291. }(),
  38292. applyAxisAngle: function() {
  38293. var e;
  38294. return function(t, i) {
  38295. return void 0 === e && (e = new n.Quaternion),
  38296. this.applyQuaternion(e.setFromAxisAngle(t, i)),
  38297. this
  38298. }
  38299. }(),
  38300. applyMatrix3: function(e) {
  38301. var t = this.x
  38302. , i = this.y
  38303. , n = this.z
  38304. , r = e.elements;
  38305. return this.x = r[0] * t + r[3] * i + r[6] * n,
  38306. this.y = r[1] * t + r[4] * i + r[7] * n,
  38307. this.z = r[2] * t + r[5] * i + r[8] * n,
  38308. this
  38309. },
  38310. applyMatrix4: function(e) {
  38311. var t = this.x
  38312. , i = this.y
  38313. , n = this.z
  38314. , r = e.elements;
  38315. return this.x = r[0] * t + r[4] * i + r[8] * n + r[12],
  38316. this.y = r[1] * t + r[5] * i + r[9] * n + r[13],
  38317. this.z = r[2] * t + r[6] * i + r[10] * n + r[14],
  38318. this
  38319. },
  38320. applyProjection: function(e) {
  38321. var t = this.x
  38322. , i = this.y
  38323. , n = this.z
  38324. , r = e.elements
  38325. , o = 1 / (r[3] * t + r[7] * i + r[11] * n + r[15]);
  38326. return this.x = (r[0] * t + r[4] * i + r[8] * n + r[12]) * o,
  38327. this.y = (r[1] * t + r[5] * i + r[9] * n + r[13]) * o,
  38328. this.z = (r[2] * t + r[6] * i + r[10] * n + r[14]) * o,
  38329. this
  38330. },
  38331. applyQuaternion: function(e) {
  38332. var t = this.x
  38333. , i = this.y
  38334. , n = this.z
  38335. , r = e.x
  38336. , o = e.y
  38337. , a = e.z
  38338. , s = e.w
  38339. , l = s * t + o * n - a * i
  38340. , c = s * i + a * t - r * n
  38341. , h = s * n + r * i - o * t
  38342. , u = -r * t - o * i - a * n;
  38343. return this.x = l * s + u * -r + c * -a - h * -o,
  38344. this.y = c * s + u * -o + h * -r - l * -a,
  38345. this.z = h * s + u * -a + l * -o - c * -r,
  38346. this
  38347. },
  38348. project: function() {
  38349. var e;
  38350. return function(t) {
  38351. return void 0 === e && (e = new n.Matrix4),
  38352. e.multiplyMatrices(t.projectionMatrix, e.getInverse(t.matrixWorld)),
  38353. this.applyProjection(e)
  38354. }
  38355. }(),
  38356. unproject: function() {
  38357. var e;
  38358. return function(t) {
  38359. return void 0 === e && (e = new n.Matrix4),
  38360. e.multiplyMatrices(t.matrixWorld, e.getInverse(t.projectionMatrix)),
  38361. this.applyProjection(e)
  38362. }
  38363. }(),
  38364. transformDirection: function(e) {
  38365. var t = this.x
  38366. , i = this.y
  38367. , n = this.z
  38368. , r = e.elements;
  38369. return this.x = r[0] * t + r[4] * i + r[8] * n,
  38370. this.y = r[1] * t + r[5] * i + r[9] * n,
  38371. this.z = r[2] * t + r[6] * i + r[10] * n,
  38372. this.normalize(),
  38373. this
  38374. },
  38375. divide: function(e) {
  38376. return this.x /= e.x,
  38377. this.y /= e.y,
  38378. this.z /= e.z,
  38379. this
  38380. },
  38381. divideScalar: function(e) {
  38382. return this.multiplyScalar(1 / e)
  38383. },
  38384. min: function(e) {
  38385. return this.x = Math.min(this.x, e.x),
  38386. this.y = Math.min(this.y, e.y),
  38387. this.z = Math.min(this.z, e.z),
  38388. this
  38389. },
  38390. max: function(e) {
  38391. return this.x = Math.max(this.x, e.x),
  38392. this.y = Math.max(this.y, e.y),
  38393. this.z = Math.max(this.z, e.z),
  38394. this
  38395. },
  38396. clamp: function(e, t) {
  38397. return this.x = Math.max(e.x, Math.min(t.x, this.x)),
  38398. this.y = Math.max(e.y, Math.min(t.y, this.y)),
  38399. this.z = Math.max(e.z, Math.min(t.z, this.z)),
  38400. this
  38401. },
  38402. clampScalar: function() {
  38403. var e, t;
  38404. return function(i, r) {
  38405. return void 0 === e && (e = new n.Vector3,
  38406. t = new n.Vector3),
  38407. e.set(i, i, i),
  38408. t.set(r, r, r),
  38409. this.clamp(e, t)
  38410. }
  38411. }(),
  38412. clampLength: function(e, t) {
  38413. var i = this.length();
  38414. return this.multiplyScalar(Math.max(e, Math.min(t, i)) / i),
  38415. this
  38416. },
  38417. floor: function() {
  38418. return this.x = Math.floor(this.x),
  38419. this.y = Math.floor(this.y),
  38420. this.z = Math.floor(this.z),
  38421. this
  38422. },
  38423. ceil: function() {
  38424. return this.x = Math.ceil(this.x),
  38425. this.y = Math.ceil(this.y),
  38426. this.z = Math.ceil(this.z),
  38427. this
  38428. },
  38429. round: function() {
  38430. return this.x = Math.round(this.x),
  38431. this.y = Math.round(this.y),
  38432. this.z = Math.round(this.z),
  38433. this
  38434. },
  38435. roundToZero: function() {
  38436. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x),
  38437. this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y),
  38438. this.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z),
  38439. this
  38440. },
  38441. negate: function() {
  38442. return this.x = -this.x,
  38443. this.y = -this.y,
  38444. this.z = -this.z,
  38445. this
  38446. },
  38447. dot: function(e) {
  38448. return this.x * e.x + this.y * e.y + this.z * e.z
  38449. },
  38450. lengthSq: function() {
  38451. return this.x * this.x + this.y * this.y + this.z * this.z
  38452. },
  38453. length: function() {
  38454. return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z)
  38455. },
  38456. lengthManhattan: function() {
  38457. return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z)
  38458. },
  38459. normalize: function() {
  38460. return this.divideScalar(this.length())
  38461. },
  38462. setLength: function(e) {
  38463. return this.multiplyScalar(e / this.length())
  38464. },
  38465. lerp: function(e, t) {
  38466. return this.x += (e.x - this.x) * t,
  38467. this.y += (e.y - this.y) * t,
  38468. this.z += (e.z - this.z) * t,
  38469. this
  38470. },
  38471. lerpVectors: function(e, t, i) {
  38472. return this.subVectors(t, e).multiplyScalar(i).add(e),
  38473. this
  38474. },
  38475. cross: function(e, t) {
  38476. if (void 0 !== t)
  38477. return console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),
  38478. this.crossVectors(e, t);
  38479. var i = this.x
  38480. , n = this.y
  38481. , r = this.z;
  38482. return this.x = n * e.z - r * e.y,
  38483. this.y = r * e.x - i * e.z,
  38484. this.z = i * e.y - n * e.x,
  38485. this
  38486. },
  38487. crossVectors: function(e, t) {
  38488. var i = e.x
  38489. , n = e.y
  38490. , r = e.z
  38491. , o = t.x
  38492. , a = t.y
  38493. , s = t.z;
  38494. return this.x = n * s - r * a,
  38495. this.y = r * o - i * s,
  38496. this.z = i * a - n * o,
  38497. this
  38498. },
  38499. projectOnVector: function() {
  38500. var e, t;
  38501. return function(i) {
  38502. return void 0 === e && (e = new n.Vector3),
  38503. e.copy(i).normalize(),
  38504. t = this.dot(e),
  38505. this.copy(e).multiplyScalar(t)
  38506. }
  38507. }(),
  38508. projectOnPlane: function() {
  38509. var e;
  38510. return function(t) {
  38511. return void 0 === e && (e = new n.Vector3),
  38512. e.copy(this).projectOnVector(t),
  38513. this.sub(e)
  38514. }
  38515. }(),
  38516. reflect: function() {
  38517. var e;
  38518. return function(t) {
  38519. return void 0 === e && (e = new n.Vector3),
  38520. this.sub(e.copy(t).multiplyScalar(2 * this.dot(t)))
  38521. }
  38522. }(),
  38523. angleTo: function(e) {
  38524. var t = this.dot(e) / Math.sqrt(this.lengthSq() * e.lengthSq());
  38525. return Math.acos(n.Math.clamp(t, -1, 1))
  38526. },
  38527. distanceTo: function(e) {
  38528. return Math.sqrt(this.distanceToSquared(e))
  38529. },
  38530. distanceToSquared: function(e) {
  38531. var t = this.x - e.x
  38532. , i = this.y - e.y
  38533. , n = this.z - e.z;
  38534. return t * t + i * i + n * n
  38535. },
  38536. setFromSpherical: function(e) {
  38537. var t = Math.sin(e.phi) * e.radius;
  38538. return this.x = t * Math.sin(e.theta),
  38539. this.y = Math.cos(e.phi) * e.radius,
  38540. this.z = t * Math.cos(e.theta),
  38541. this
  38542. },
  38543. setFromMatrixPosition: function(e) {
  38544. return this.setFromMatrixColumn(e, 3)
  38545. },
  38546. setFromMatrixScale: function(e) {
  38547. var t = this.setFromMatrixColumn(e, 0).length()
  38548. , i = this.setFromMatrixColumn(e, 1).length()
  38549. , n = this.setFromMatrixColumn(e, 2).length();
  38550. return this.x = t,
  38551. this.y = i,
  38552. this.z = n,
  38553. this
  38554. },
  38555. setFromMatrixColumn: function(e, t) {
  38556. return "number" == typeof e && (console.warn("THREE.Vector3: setFromMatrixColumn now expects ( matrix, index )."),
  38557. e = arguments[1],
  38558. t = arguments[0]),
  38559. this.fromArray(e.elements, 4 * t)
  38560. },
  38561. equals: function(e) {
  38562. return e.x === this.x && e.y === this.y && e.z === this.z
  38563. },
  38564. fromArray: function(e, t) {
  38565. return void 0 === t && (t = 0),
  38566. this.x = e[t],
  38567. this.y = e[t + 1],
  38568. this.z = e[t + 2],
  38569. this
  38570. },
  38571. toArray: function(e, t) {
  38572. return void 0 === e && (e = []),
  38573. void 0 === t && (t = 0),
  38574. e[t] = this.x,
  38575. e[t + 1] = this.y,
  38576. e[t + 2] = this.z,
  38577. e
  38578. },
  38579. fromAttribute: function(e, t, i) {
  38580. return void 0 === i && (i = 0),
  38581. t = t * e.itemSize + i,
  38582. this.x = e.array[t],
  38583. this.y = e.array[t + 1],
  38584. this.z = e.array[t + 2],
  38585. this
  38586. }
  38587. },
  38588. n.Vector4 = function(e, t, i, n) {
  38589. this.x = e || 0,
  38590. this.y = t || 0,
  38591. this.z = i || 0,
  38592. this.w = void 0 !== n ? n : 1
  38593. }
  38594. ,
  38595. n.Vector4.prototype = {
  38596. constructor: n.Vector4,
  38597. set: function(e, t, i, n) {
  38598. return this.x = e,
  38599. this.y = t,
  38600. this.z = i,
  38601. this.w = n,
  38602. this
  38603. },
  38604. setScalar: function(e) {
  38605. return this.x = e,
  38606. this.y = e,
  38607. this.z = e,
  38608. this.w = e,
  38609. this
  38610. },
  38611. setX: function(e) {
  38612. return this.x = e,
  38613. this
  38614. },
  38615. setY: function(e) {
  38616. return this.y = e,
  38617. this
  38618. },
  38619. setZ: function(e) {
  38620. return this.z = e,
  38621. this
  38622. },
  38623. setW: function(e) {
  38624. return this.w = e,
  38625. this
  38626. },
  38627. setComponent: function(e, t) {
  38628. switch (e) {
  38629. case 0:
  38630. this.x = t;
  38631. break;
  38632. case 1:
  38633. this.y = t;
  38634. break;
  38635. case 2:
  38636. this.z = t;
  38637. break;
  38638. case 3:
  38639. this.w = t;
  38640. break;
  38641. default:
  38642. throw new Error("index is out of range: " + e)
  38643. }
  38644. },
  38645. getComponent: function(e) {
  38646. switch (e) {
  38647. case 0:
  38648. return this.x;
  38649. case 1:
  38650. return this.y;
  38651. case 2:
  38652. return this.z;
  38653. case 3:
  38654. return this.w;
  38655. default:
  38656. throw new Error("index is out of range: " + e)
  38657. }
  38658. },
  38659. clone: function() {
  38660. return new this.constructor(this.x,this.y,this.z,this.w)
  38661. },
  38662. copy: function(e) {
  38663. return this.x = e.x,
  38664. this.y = e.y,
  38665. this.z = e.z,
  38666. this.w = void 0 !== e.w ? e.w : 1,
  38667. this
  38668. },
  38669. add: function(e, t) {
  38670. return void 0 !== t ? (console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),
  38671. this.addVectors(e, t)) : (this.x += e.x,
  38672. this.y += e.y,
  38673. this.z += e.z,
  38674. this.w += e.w,
  38675. this)
  38676. },
  38677. addScalar: function(e) {
  38678. return this.x += e,
  38679. this.y += e,
  38680. this.z += e,
  38681. this.w += e,
  38682. this
  38683. },
  38684. addVectors: function(e, t) {
  38685. return this.x = e.x + t.x,
  38686. this.y = e.y + t.y,
  38687. this.z = e.z + t.z,
  38688. this.w = e.w + t.w,
  38689. this
  38690. },
  38691. addScaledVector: function(e, t) {
  38692. return this.x += e.x * t,
  38693. this.y += e.y * t,
  38694. this.z += e.z * t,
  38695. this.w += e.w * t,
  38696. this
  38697. },
  38698. sub: function(e, t) {
  38699. return void 0 !== t ? (console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
  38700. this.subVectors(e, t)) : (this.x -= e.x,
  38701. this.y -= e.y,
  38702. this.z -= e.z,
  38703. this.w -= e.w,
  38704. this)
  38705. },
  38706. subScalar: function(e) {
  38707. return this.x -= e,
  38708. this.y -= e,
  38709. this.z -= e,
  38710. this.w -= e,
  38711. this
  38712. },
  38713. subVectors: function(e, t) {
  38714. return this.x = e.x - t.x,
  38715. this.y = e.y - t.y,
  38716. this.z = e.z - t.z,
  38717. this.w = e.w - t.w,
  38718. this
  38719. },
  38720. multiplyScalar: function(e) {
  38721. return isFinite(e) ? (this.x *= e,
  38722. this.y *= e,
  38723. this.z *= e,
  38724. this.w *= e) : (this.x = 0,
  38725. this.y = 0,
  38726. this.z = 0,
  38727. this.w = 0),
  38728. this
  38729. },
  38730. applyMatrix4: function(e) {
  38731. var t = this.x
  38732. , i = this.y
  38733. , n = this.z
  38734. , r = this.w
  38735. , o = e.elements;
  38736. return this.x = o[0] * t + o[4] * i + o[8] * n + o[12] * r,
  38737. this.y = o[1] * t + o[5] * i + o[9] * n + o[13] * r,
  38738. this.z = o[2] * t + o[6] * i + o[10] * n + o[14] * r,
  38739. this.w = o[3] * t + o[7] * i + o[11] * n + o[15] * r,
  38740. this
  38741. },
  38742. divideScalar: function(e) {
  38743. return this.multiplyScalar(1 / e)
  38744. },
  38745. setAxisAngleFromQuaternion: function(e) {
  38746. this.w = 2 * Math.acos(e.w);
  38747. var t = Math.sqrt(1 - e.w * e.w);
  38748. return t < 1e-4 ? (this.x = 1,
  38749. this.y = 0,
  38750. this.z = 0) : (this.x = e.x / t,
  38751. this.y = e.y / t,
  38752. this.z = e.z / t),
  38753. this
  38754. },
  38755. setAxisAngleFromRotationMatrix: function(e) {
  38756. 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];
  38757. if (Math.abs(c - u) < o && Math.abs(h - f) < o && Math.abs(p - g) < o) {
  38758. if (Math.abs(c + u) < a && Math.abs(h + f) < a && Math.abs(p + g) < a && Math.abs(l + d + m - 3) < a)
  38759. return this.set(1, 0, 0, 0),
  38760. this;
  38761. t = Math.PI;
  38762. var v = (l + 1) / 2
  38763. , A = (d + 1) / 2
  38764. , y = (m + 1) / 2
  38765. , C = (c + u) / 4
  38766. , I = (h + f) / 4
  38767. , E = (p + g) / 4;
  38768. return v > A && v > y ? v < o ? (i = 0,
  38769. n = .707106781,
  38770. r = .707106781) : (i = Math.sqrt(v),
  38771. n = C / i,
  38772. r = I / i) : A > y ? A < o ? (i = .707106781,
  38773. n = 0,
  38774. r = .707106781) : (n = Math.sqrt(A),
  38775. i = C / n,
  38776. r = E / n) : y < o ? (i = .707106781,
  38777. n = .707106781,
  38778. r = 0) : (r = Math.sqrt(y),
  38779. i = I / r,
  38780. n = E / r),
  38781. this.set(i, n, r, t),
  38782. this
  38783. }
  38784. var b = Math.sqrt((g - p) * (g - p) + (h - f) * (h - f) + (u - c) * (u - c));
  38785. return Math.abs(b) < .001 && (b = 1),
  38786. this.x = (g - p) / b,
  38787. this.y = (h - f) / b,
  38788. this.z = (u - c) / b,
  38789. this.w = Math.acos((l + d + m - 1) / 2),
  38790. this
  38791. },
  38792. min: function(e) {
  38793. return this.x = Math.min(this.x, e.x),
  38794. this.y = Math.min(this.y, e.y),
  38795. this.z = Math.min(this.z, e.z),
  38796. this.w = Math.min(this.w, e.w),
  38797. this
  38798. },
  38799. max: function(e) {
  38800. return this.x = Math.max(this.x, e.x),
  38801. this.y = Math.max(this.y, e.y),
  38802. this.z = Math.max(this.z, e.z),
  38803. this.w = Math.max(this.w, e.w),
  38804. this
  38805. },
  38806. clamp: function(e, t) {
  38807. return this.x = Math.max(e.x, Math.min(t.x, this.x)),
  38808. this.y = Math.max(e.y, Math.min(t.y, this.y)),
  38809. this.z = Math.max(e.z, Math.min(t.z, this.z)),
  38810. this.w = Math.max(e.w, Math.min(t.w, this.w)),
  38811. this
  38812. },
  38813. clampScalar: function() {
  38814. var e, t;
  38815. return function(i, r) {
  38816. return void 0 === e && (e = new n.Vector4,
  38817. t = new n.Vector4),
  38818. e.set(i, i, i, i),
  38819. t.set(r, r, r, r),
  38820. this.clamp(e, t)
  38821. }
  38822. }(),
  38823. floor: function() {
  38824. return this.x = Math.floor(this.x),
  38825. this.y = Math.floor(this.y),
  38826. this.z = Math.floor(this.z),
  38827. this.w = Math.floor(this.w),
  38828. this
  38829. },
  38830. ceil: function() {
  38831. return this.x = Math.ceil(this.x),
  38832. this.y = Math.ceil(this.y),
  38833. this.z = Math.ceil(this.z),
  38834. this.w = Math.ceil(this.w),
  38835. this
  38836. },
  38837. round: function() {
  38838. return this.x = Math.round(this.x),
  38839. this.y = Math.round(this.y),
  38840. this.z = Math.round(this.z),
  38841. this.w = Math.round(this.w),
  38842. this
  38843. },
  38844. roundToZero: function() {
  38845. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x),
  38846. this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y),
  38847. this.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z),
  38848. this.w = this.w < 0 ? Math.ceil(this.w) : Math.floor(this.w),
  38849. this
  38850. },
  38851. negate: function() {
  38852. return this.x = -this.x,
  38853. this.y = -this.y,
  38854. this.z = -this.z,
  38855. this.w = -this.w,
  38856. this
  38857. },
  38858. dot: function(e) {
  38859. return this.x * e.x + this.y * e.y + this.z * e.z + this.w * e.w
  38860. },
  38861. lengthSq: function() {
  38862. return this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w
  38863. },
  38864. length: function() {
  38865. return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w)
  38866. },
  38867. lengthManhattan: function() {
  38868. return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z) + Math.abs(this.w)
  38869. },
  38870. normalize: function() {
  38871. return this.divideScalar(this.length())
  38872. },
  38873. setLength: function(e) {
  38874. return this.multiplyScalar(e / this.length())
  38875. },
  38876. lerp: function(e, t) {
  38877. return this.x += (e.x - this.x) * t,
  38878. this.y += (e.y - this.y) * t,
  38879. this.z += (e.z - this.z) * t,
  38880. this.w += (e.w - this.w) * t,
  38881. this
  38882. },
  38883. lerpVectors: function(e, t, i) {
  38884. return this.subVectors(t, e).multiplyScalar(i).add(e),
  38885. this
  38886. },
  38887. equals: function(e) {
  38888. return e.x === this.x && e.y === this.y && e.z === this.z && e.w === this.w
  38889. },
  38890. fromArray: function(e, t) {
  38891. return void 0 === t && (t = 0),
  38892. this.x = e[t],
  38893. this.y = e[t + 1],
  38894. this.z = e[t + 2],
  38895. this.w = e[t + 3],
  38896. this
  38897. },
  38898. toArray: function(e, t) {
  38899. return void 0 === e && (e = []),
  38900. void 0 === t && (t = 0),
  38901. e[t] = this.x,
  38902. e[t + 1] = this.y,
  38903. e[t + 2] = this.z,
  38904. e[t + 3] = this.w,
  38905. e
  38906. },
  38907. fromAttribute: function(e, t, i) {
  38908. return void 0 === i && (i = 0),
  38909. t = t * e.itemSize + i,
  38910. this.x = e.array[t],
  38911. this.y = e.array[t + 1],
  38912. this.z = e.array[t + 2],
  38913. this.w = e.array[t + 3],
  38914. this
  38915. }
  38916. },
  38917. n.Euler = function(e, t, i, r) {
  38918. this._x = e || 0,
  38919. this._y = t || 0,
  38920. this._z = i || 0,
  38921. this._order = r || n.Euler.DefaultOrder
  38922. }
  38923. ,
  38924. n.Euler.RotationOrders = ["XYZ", "YZX", "ZXY", "XZY", "YXZ", "ZYX"],
  38925. n.Euler.DefaultOrder = "XYZ",
  38926. n.Euler.prototype = {
  38927. constructor: n.Euler,
  38928. get x() {
  38929. return this._x
  38930. },
  38931. set x(e) {
  38932. this._x = e,
  38933. this.onChangeCallback()
  38934. },
  38935. get y() {
  38936. return this._y
  38937. },
  38938. set y(e) {
  38939. this._y = e,
  38940. this.onChangeCallback()
  38941. },
  38942. get z() {
  38943. return this._z
  38944. },
  38945. set z(e) {
  38946. this._z = e,
  38947. this.onChangeCallback()
  38948. },
  38949. get order() {
  38950. return this._order
  38951. },
  38952. set order(e) {
  38953. this._order = e,
  38954. this.onChangeCallback()
  38955. },
  38956. set: function(e, t, i, n) {
  38957. return this._x = e,
  38958. this._y = t,
  38959. this._z = i,
  38960. this._order = n || this._order,
  38961. this.onChangeCallback(),
  38962. this
  38963. },
  38964. clone: function() {
  38965. return new this.constructor(this._x,this._y,this._z,this._order)
  38966. },
  38967. copy: function(e) {
  38968. return this._x = e._x,
  38969. this._y = e._y,
  38970. this._z = e._z,
  38971. this._order = e._order,
  38972. this.onChangeCallback(),
  38973. this
  38974. },
  38975. setFromRotationMatrix: function(e, t, i) {
  38976. var r = n.Math.clamp
  38977. , o = e.elements
  38978. , a = o[0]
  38979. , s = o[4]
  38980. , l = o[8]
  38981. , c = o[1]
  38982. , h = o[5]
  38983. , u = o[9]
  38984. , d = o[2]
  38985. , p = o[6]
  38986. , f = o[10];
  38987. return t = t || this._order,
  38988. "XYZ" === t ? (this._y = Math.asin(r(l, -1, 1)),
  38989. Math.abs(l) < .99999 ? (this._x = Math.atan2(-u, f),
  38990. this._z = Math.atan2(-s, a)) : (this._x = Math.atan2(p, h),
  38991. this._z = 0)) : "YXZ" === t ? (this._x = Math.asin(-r(u, -1, 1)),
  38992. Math.abs(u) < .99999 ? (this._y = Math.atan2(l, f),
  38993. this._z = Math.atan2(c, h)) : (this._y = Math.atan2(-d, a),
  38994. this._z = 0)) : "ZXY" === t ? (this._x = Math.asin(r(p, -1, 1)),
  38995. Math.abs(p) < .99999 ? (this._y = Math.atan2(-d, f),
  38996. this._z = Math.atan2(-s, h)) : (this._y = 0,
  38997. this._z = Math.atan2(c, a))) : "ZYX" === t ? (this._y = Math.asin(-r(d, -1, 1)),
  38998. Math.abs(d) < .99999 ? (this._x = Math.atan2(p, f),
  38999. this._z = Math.atan2(c, a)) : (this._x = 0,
  39000. this._z = Math.atan2(-s, h))) : "YZX" === t ? (this._z = Math.asin(r(c, -1, 1)),
  39001. Math.abs(c) < .99999 ? (this._x = Math.atan2(-u, h),
  39002. this._y = Math.atan2(-d, a)) : (this._x = 0,
  39003. this._y = Math.atan2(l, f))) : "XZY" === t ? (this._z = Math.asin(-r(s, -1, 1)),
  39004. Math.abs(s) < .99999 ? (this._x = Math.atan2(p, h),
  39005. this._y = Math.atan2(l, a)) : (this._x = Math.atan2(-u, f),
  39006. this._y = 0)) : console.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: " + t),
  39007. this._order = t,
  39008. i !== !1 && this.onChangeCallback(),
  39009. this
  39010. },
  39011. setFromQuaternion: function() {
  39012. var e;
  39013. return function(t, i, r) {
  39014. return void 0 === e && (e = new n.Matrix4),
  39015. e.makeRotationFromQuaternion(t),
  39016. this.setFromRotationMatrix(e, i, r),
  39017. this
  39018. }
  39019. }(),
  39020. setFromVector3: function(e, t) {
  39021. return this.set(e.x, e.y, e.z, t || this._order)
  39022. },
  39023. reorder: function() {
  39024. var e = new n.Quaternion;
  39025. return function(t) {
  39026. e.setFromEuler(this),
  39027. this.setFromQuaternion(e, t)
  39028. }
  39029. }(),
  39030. equals: function(e) {
  39031. return e._x === this._x && e._y === this._y && e._z === this._z && e._order === this._order
  39032. },
  39033. fromArray: function(e) {
  39034. return this._x = e[0],
  39035. this._y = e[1],
  39036. this._z = e[2],
  39037. void 0 !== e[3] && (this._order = e[3]),
  39038. this.onChangeCallback(),
  39039. this
  39040. },
  39041. toArray: function(e, t) {
  39042. return void 0 === e && (e = []),
  39043. void 0 === t && (t = 0),
  39044. e[t] = this._x,
  39045. e[t + 1] = this._y,
  39046. e[t + 2] = this._z,
  39047. e[t + 3] = this._order,
  39048. e
  39049. },
  39050. toVector3: function(e) {
  39051. return e ? e.set(this._x, this._y, this._z) : new n.Vector3(this._x,this._y,this._z)
  39052. },
  39053. onChange: function(e) {
  39054. return this.onChangeCallback = e,
  39055. this
  39056. },
  39057. onChangeCallback: function() {}
  39058. },
  39059. n.Line3 = function(e, t) {
  39060. this.start = void 0 !== e ? e : new n.Vector3,
  39061. this.end = void 0 !== t ? t : new n.Vector3
  39062. }
  39063. ,
  39064. n.Line3.prototype = {
  39065. constructor: n.Line3,
  39066. set: function(e, t) {
  39067. return this.start.copy(e),
  39068. this.end.copy(t),
  39069. this
  39070. },
  39071. clone: function() {
  39072. return (new this.constructor).copy(this)
  39073. },
  39074. copy: function(e) {
  39075. return this.start.copy(e.start),
  39076. this.end.copy(e.end),
  39077. this
  39078. },
  39079. center: function(e) {
  39080. var t = e || new n.Vector3;
  39081. return t.addVectors(this.start, this.end).multiplyScalar(.5)
  39082. },
  39083. delta: function(e) {
  39084. var t = e || new n.Vector3;
  39085. return t.subVectors(this.end, this.start)
  39086. },
  39087. distanceSq: function() {
  39088. return this.start.distanceToSquared(this.end)
  39089. },
  39090. distance: function() {
  39091. return this.start.distanceTo(this.end)
  39092. },
  39093. at: function(e, t) {
  39094. var i = t || new n.Vector3;
  39095. return this.delta(i).multiplyScalar(e).add(this.start)
  39096. },
  39097. closestPointToPointParameter: function() {
  39098. var e = new n.Vector3
  39099. , t = new n.Vector3;
  39100. return function(i, r) {
  39101. e.subVectors(i, this.start),
  39102. t.subVectors(this.end, this.start);
  39103. var o = t.dot(t)
  39104. , a = t.dot(e)
  39105. , s = a / o;
  39106. return r && (s = n.Math.clamp(s, 0, 1)),
  39107. s
  39108. }
  39109. }(),
  39110. closestPointToPoint: function(e, t, i) {
  39111. var r = this.closestPointToPointParameter(e, t)
  39112. , o = i || new n.Vector3;
  39113. return this.delta(o).multiplyScalar(r).add(this.start)
  39114. },
  39115. applyMatrix4: function(e) {
  39116. return this.start.applyMatrix4(e),
  39117. this.end.applyMatrix4(e),
  39118. this
  39119. },
  39120. equals: function(e) {
  39121. return e.start.equals(this.start) && e.end.equals(this.end)
  39122. }
  39123. },
  39124. n.Box2 = function(e, t) {
  39125. this.min = void 0 !== e ? e : new n.Vector2(+(1 / 0),+(1 / 0)),
  39126. this.max = void 0 !== t ? t : new n.Vector2(-(1 / 0),-(1 / 0))
  39127. }
  39128. ,
  39129. n.Box2.prototype = {
  39130. constructor: n.Box2,
  39131. set: function(e, t) {
  39132. return this.min.copy(e),
  39133. this.max.copy(t),
  39134. this
  39135. },
  39136. setFromPoints: function(e) {
  39137. this.makeEmpty();
  39138. for (var t = 0, i = e.length; t < i; t++)
  39139. this.expandByPoint(e[t]);
  39140. return this
  39141. },
  39142. setFromCenterAndSize: function() {
  39143. var e = new n.Vector2;
  39144. return function(t, i) {
  39145. var n = e.copy(i).multiplyScalar(.5);
  39146. return this.min.copy(t).sub(n),
  39147. this.max.copy(t).add(n),
  39148. this
  39149. }
  39150. }(),
  39151. clone: function() {
  39152. return (new this.constructor).copy(this)
  39153. },
  39154. copy: function(e) {
  39155. return this.min.copy(e.min),
  39156. this.max.copy(e.max),
  39157. this
  39158. },
  39159. makeEmpty: function() {
  39160. return this.min.x = this.min.y = +(1 / 0),
  39161. this.max.x = this.max.y = -(1 / 0),
  39162. this
  39163. },
  39164. isEmpty: function() {
  39165. return this.max.x < this.min.x || this.max.y < this.min.y
  39166. },
  39167. center: function(e) {
  39168. var t = e || new n.Vector2;
  39169. return t.addVectors(this.min, this.max).multiplyScalar(.5)
  39170. },
  39171. size: function(e) {
  39172. var t = e || new n.Vector2;
  39173. return t.subVectors(this.max, this.min)
  39174. },
  39175. expandByPoint: function(e) {
  39176. return this.min.min(e),
  39177. this.max.max(e),
  39178. this
  39179. },
  39180. expandByVector: function(e) {
  39181. return this.min.sub(e),
  39182. this.max.add(e),
  39183. this
  39184. },
  39185. expandByScalar: function(e) {
  39186. return this.min.addScalar(-e),
  39187. this.max.addScalar(e),
  39188. this
  39189. },
  39190. containsPoint: function(e) {
  39191. return !(e.x < this.min.x || e.x > this.max.x || e.y < this.min.y || e.y > this.max.y)
  39192. },
  39193. containsBox: function(e) {
  39194. 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
  39195. },
  39196. getParameter: function(e, t) {
  39197. var i = t || new n.Vector2;
  39198. 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))
  39199. },
  39200. intersectsBox: function(e) {
  39201. 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)
  39202. },
  39203. clampPoint: function(e, t) {
  39204. var i = t || new n.Vector2;
  39205. return i.copy(e).clamp(this.min, this.max)
  39206. },
  39207. distanceToPoint: function() {
  39208. var e = new n.Vector2;
  39209. return function(t) {
  39210. var i = e.copy(t).clamp(this.min, this.max);
  39211. return i.sub(t).length()
  39212. }
  39213. }(),
  39214. intersect: function(e) {
  39215. return this.min.max(e.min),
  39216. this.max.min(e.max),
  39217. this
  39218. },
  39219. union: function(e) {
  39220. return this.min.min(e.min),
  39221. this.max.max(e.max),
  39222. this
  39223. },
  39224. translate: function(e) {
  39225. return this.min.add(e),
  39226. this.max.add(e),
  39227. this
  39228. },
  39229. equals: function(e) {
  39230. return e.min.equals(this.min) && e.max.equals(this.max)
  39231. }
  39232. },
  39233. n.Box3 = function(e, t) {
  39234. this.min = void 0 !== e ? e : new n.Vector3(+(1 / 0),+(1 / 0),+(1 / 0)),
  39235. this.max = void 0 !== t ? t : new n.Vector3(-(1 / 0),-(1 / 0),-(1 / 0))
  39236. }
  39237. ,
  39238. n.Box3.prototype = {
  39239. constructor: n.Box3,
  39240. set: function(e, t) {
  39241. return this.min.copy(e),
  39242. this.max.copy(t),
  39243. this
  39244. },
  39245. setFromArray: function(e) {
  39246. this.makeEmpty();
  39247. 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) {
  39248. var c = e[s]
  39249. , h = e[s + 1]
  39250. , u = e[s + 2];
  39251. c < t && (t = c),
  39252. h < i && (i = h),
  39253. u < n && (n = u),
  39254. c > r && (r = c),
  39255. h > o && (o = h),
  39256. u > a && (a = u)
  39257. }
  39258. this.min.set(t, i, n),
  39259. this.max.set(r, o, a)
  39260. },
  39261. setFromPoints: function(e) {
  39262. this.makeEmpty();
  39263. for (var t = 0, i = e.length; t < i; t++)
  39264. this.expandByPoint(e[t]);
  39265. return this
  39266. },
  39267. setFromCenterAndSize: function() {
  39268. var e = new n.Vector3;
  39269. return function(t, i) {
  39270. var n = e.copy(i).multiplyScalar(.5);
  39271. return this.min.copy(t).sub(n),
  39272. this.max.copy(t).add(n),
  39273. this
  39274. }
  39275. }(),
  39276. setFromObject: function() {
  39277. var e;
  39278. return function(t) {
  39279. void 0 === e && (e = new n.Box3);
  39280. var i = this;
  39281. return this.makeEmpty(),
  39282. t.updateMatrixWorld(!0),
  39283. t.traverse(function(t) {
  39284. var n = t.geometry;
  39285. void 0 !== n && (null === n.boundingBox && n.computeBoundingBox(),
  39286. n.boundingBox.isEmpty() === !1 && (e.copy(n.boundingBox),
  39287. e.applyMatrix4(t.matrixWorld),
  39288. i.union(e)))
  39289. }),
  39290. this
  39291. }
  39292. }(),
  39293. clone: function() {
  39294. return (new this.constructor).copy(this)
  39295. },
  39296. copy: function(e) {
  39297. return this.min.copy(e.min),
  39298. this.max.copy(e.max),
  39299. this
  39300. },
  39301. makeEmpty: function() {
  39302. return this.min.x = this.min.y = this.min.z = +(1 / 0),
  39303. this.max.x = this.max.y = this.max.z = -(1 / 0),
  39304. this
  39305. },
  39306. isEmpty: function() {
  39307. return this.max.x < this.min.x || this.max.y < this.min.y || this.max.z < this.min.z
  39308. },
  39309. center: function(e) {
  39310. var t = e || new n.Vector3;
  39311. return t.addVectors(this.min, this.max).multiplyScalar(.5)
  39312. },
  39313. size: function(e) {
  39314. var t = e || new n.Vector3;
  39315. return t.subVectors(this.max, this.min)
  39316. },
  39317. expandByPoint: function(e) {
  39318. return this.min.min(e),
  39319. this.max.max(e),
  39320. this
  39321. },
  39322. expandByVector: function(e) {
  39323. return this.min.sub(e),
  39324. this.max.add(e),
  39325. this
  39326. },
  39327. expandByScalar: function(e) {
  39328. return this.min.addScalar(-e),
  39329. this.max.addScalar(e),
  39330. this
  39331. },
  39332. containsPoint: function(e) {
  39333. 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)
  39334. },
  39335. containsBox: function(e) {
  39336. 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
  39337. },
  39338. getParameter: function(e, t) {
  39339. var i = t || new n.Vector3;
  39340. 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))
  39341. },
  39342. intersectsBox: function(e) {
  39343. 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)
  39344. },
  39345. intersectsSphere: function() {
  39346. var e;
  39347. return function(t) {
  39348. return void 0 === e && (e = new n.Vector3),
  39349. this.clampPoint(t.center, e),
  39350. e.distanceToSquared(t.center) <= t.radius * t.radius
  39351. }
  39352. }(),
  39353. intersectsPlane: function(e) {
  39354. var t, i;
  39355. return e.normal.x > 0 ? (t = e.normal.x * this.min.x,
  39356. i = e.normal.x * this.max.x) : (t = e.normal.x * this.max.x,
  39357. i = e.normal.x * this.min.x),
  39358. e.normal.y > 0 ? (t += e.normal.y * this.min.y,
  39359. i += e.normal.y * this.max.y) : (t += e.normal.y * this.max.y,
  39360. i += e.normal.y * this.min.y),
  39361. e.normal.z > 0 ? (t += e.normal.z * this.min.z,
  39362. i += e.normal.z * this.max.z) : (t += e.normal.z * this.max.z,
  39363. i += e.normal.z * this.min.z),
  39364. t <= e.constant && i >= e.constant
  39365. },
  39366. clampPoint: function(e, t) {
  39367. var i = t || new n.Vector3;
  39368. return i.copy(e).clamp(this.min, this.max)
  39369. },
  39370. distanceToPoint: function() {
  39371. var e = new n.Vector3;
  39372. return function(t) {
  39373. var i = e.copy(t).clamp(this.min, this.max);
  39374. return i.sub(t).length()
  39375. }
  39376. }(),
  39377. getBoundingSphere: function() {
  39378. var e = new n.Vector3;
  39379. return function(t) {
  39380. var i = t || new n.Sphere;
  39381. return i.center = this.center(),
  39382. i.radius = .5 * this.size(e).length(),
  39383. i
  39384. }
  39385. }(),
  39386. intersect: function(e) {
  39387. return this.min.max(e.min),
  39388. this.max.min(e.max),
  39389. this
  39390. },
  39391. union: function(e) {
  39392. return this.min.min(e.min),
  39393. this.max.max(e.max),
  39394. this
  39395. },
  39396. applyMatrix4: function() {
  39397. 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];
  39398. return function(t) {
  39399. return e[0].set(this.min.x, this.min.y, this.min.z).applyMatrix4(t),
  39400. e[1].set(this.min.x, this.min.y, this.max.z).applyMatrix4(t),
  39401. e[2].set(this.min.x, this.max.y, this.min.z).applyMatrix4(t),
  39402. e[3].set(this.min.x, this.max.y, this.max.z).applyMatrix4(t),
  39403. e[4].set(this.max.x, this.min.y, this.min.z).applyMatrix4(t),
  39404. e[5].set(this.max.x, this.min.y, this.max.z).applyMatrix4(t),
  39405. e[6].set(this.max.x, this.max.y, this.min.z).applyMatrix4(t),
  39406. e[7].set(this.max.x, this.max.y, this.max.z).applyMatrix4(t),
  39407. this.makeEmpty(),
  39408. this.setFromPoints(e),
  39409. this
  39410. }
  39411. }(),
  39412. translate: function(e) {
  39413. return this.min.add(e),
  39414. this.max.add(e),
  39415. this
  39416. },
  39417. equals: function(e) {
  39418. return e.min.equals(this.min) && e.max.equals(this.max)
  39419. }
  39420. },
  39421. n.Matrix3 = function() {
  39422. this.elements = new Float32Array([1, 0, 0, 0, 1, 0, 0, 0, 1]),
  39423. arguments.length > 0 && console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")
  39424. }
  39425. ,
  39426. n.Matrix3.prototype = {
  39427. constructor: n.Matrix3,
  39428. set: function(e, t, i, n, r, o, a, s, l) {
  39429. var c = this.elements;
  39430. return c[0] = e,
  39431. c[1] = n,
  39432. c[2] = a,
  39433. c[3] = t,
  39434. c[4] = r,
  39435. c[5] = s,
  39436. c[6] = i,
  39437. c[7] = o,
  39438. c[8] = l,
  39439. this
  39440. },
  39441. identity: function() {
  39442. return this.set(1, 0, 0, 0, 1, 0, 0, 0, 1),
  39443. this
  39444. },
  39445. clone: function() {
  39446. return (new this.constructor).fromArray(this.elements)
  39447. },
  39448. copy: function(e) {
  39449. var t = e.elements;
  39450. return this.set(t[0], t[3], t[6], t[1], t[4], t[7], t[2], t[5], t[8]),
  39451. this
  39452. },
  39453. setFromMatrix4: function(e) {
  39454. var t = e.elements;
  39455. return this.set(t[0], t[4], t[8], t[1], t[5], t[9], t[2], t[6], t[10]),
  39456. this
  39457. },
  39458. applyToVector3Array: function() {
  39459. var e;
  39460. return function(t, i, r) {
  39461. void 0 === e && (e = new n.Vector3),
  39462. void 0 === i && (i = 0),
  39463. void 0 === r && (r = t.length);
  39464. for (var o = 0, a = i; o < r; o += 3,
  39465. a += 3)
  39466. e.fromArray(t, a),
  39467. e.applyMatrix3(this),
  39468. e.toArray(t, a);
  39469. return t
  39470. }
  39471. }(),
  39472. applyToBuffer: function() {
  39473. var e;
  39474. return function(t, i, r) {
  39475. void 0 === e && (e = new n.Vector3),
  39476. void 0 === i && (i = 0),
  39477. void 0 === r && (r = t.length / t.itemSize);
  39478. for (var o = 0, a = i; o < r; o++,
  39479. a++)
  39480. e.x = t.getX(a),
  39481. e.y = t.getY(a),
  39482. e.z = t.getZ(a),
  39483. e.applyMatrix3(this),
  39484. t.setXYZ(e.x, e.y, e.z);
  39485. return t
  39486. }
  39487. }(),
  39488. multiplyScalar: function(e) {
  39489. var t = this.elements;
  39490. return t[0] *= e,
  39491. t[3] *= e,
  39492. t[6] *= e,
  39493. t[1] *= e,
  39494. t[4] *= e,
  39495. t[7] *= e,
  39496. t[2] *= e,
  39497. t[5] *= e,
  39498. t[8] *= e,
  39499. this
  39500. },
  39501. determinant: function() {
  39502. var e = this.elements
  39503. , t = e[0]
  39504. , i = e[1]
  39505. , n = e[2]
  39506. , r = e[3]
  39507. , o = e[4]
  39508. , a = e[5]
  39509. , s = e[6]
  39510. , l = e[7]
  39511. , c = e[8];
  39512. return t * o * c - t * a * l - i * r * c + i * a * s + n * r * l - n * o * s
  39513. },
  39514. getInverse: function(e, t) {
  39515. e instanceof n.Matrix4 && console.warn("THREE.Matrix3.getInverse no longer takes a Matrix4 argument.");
  39516. var i = e.elements
  39517. , r = this.elements
  39518. , o = i[0]
  39519. , a = i[1]
  39520. , s = i[2]
  39521. , l = i[3]
  39522. , c = i[4]
  39523. , h = i[5]
  39524. , u = i[6]
  39525. , d = i[7]
  39526. , p = i[8]
  39527. , f = p * c - h * d
  39528. , g = h * u - p * l
  39529. , m = d * l - c * u
  39530. , v = o * f + a * g + s * m;
  39531. if (0 === v) {
  39532. var A = "THREE.Matrix3.getInverse(): can't invert matrix, determinant is 0";
  39533. if (t)
  39534. throw new Error(A);
  39535. return console.warn(A),
  39536. this.identity()
  39537. }
  39538. return r[0] = f,
  39539. r[1] = s * d - p * a,
  39540. r[2] = h * a - s * c,
  39541. r[3] = g,
  39542. r[4] = p * o - s * u,
  39543. r[5] = s * l - h * o,
  39544. r[6] = m,
  39545. r[7] = a * u - d * o,
  39546. r[8] = c * o - a * l,
  39547. this.multiplyScalar(1 / v)
  39548. },
  39549. transpose: function() {
  39550. var e, t = this.elements;
  39551. return e = t[1],
  39552. t[1] = t[3],
  39553. t[3] = e,
  39554. e = t[2],
  39555. t[2] = t[6],
  39556. t[6] = e,
  39557. e = t[5],
  39558. t[5] = t[7],
  39559. t[7] = e,
  39560. this
  39561. },
  39562. flattenToArrayOffset: function(e, t) {
  39563. var i = this.elements;
  39564. return e[t] = i[0],
  39565. e[t + 1] = i[1],
  39566. e[t + 2] = i[2],
  39567. e[t + 3] = i[3],
  39568. e[t + 4] = i[4],
  39569. e[t + 5] = i[5],
  39570. e[t + 6] = i[6],
  39571. e[t + 7] = i[7],
  39572. e[t + 8] = i[8],
  39573. e
  39574. },
  39575. getNormalMatrix: function(e) {
  39576. return this.setFromMatrix4(e).getInverse(this).transpose()
  39577. },
  39578. transposeIntoArray: function(e) {
  39579. var t = this.elements;
  39580. return e[0] = t[0],
  39581. e[1] = t[3],
  39582. e[2] = t[6],
  39583. e[3] = t[1],
  39584. e[4] = t[4],
  39585. e[5] = t[7],
  39586. e[6] = t[2],
  39587. e[7] = t[5],
  39588. e[8] = t[8],
  39589. this
  39590. },
  39591. fromArray: function(e) {
  39592. return this.elements.set(e),
  39593. this
  39594. },
  39595. toArray: function() {
  39596. var e = this.elements;
  39597. return [e[0], e[1], e[2], e[3], e[4], e[5], e[6], e[7], e[8]]
  39598. }
  39599. },
  39600. n.Matrix4 = function() {
  39601. this.elements = new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]),
  39602. arguments.length > 0 && console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")
  39603. }
  39604. ,
  39605. n.Matrix4.prototype = {
  39606. constructor: n.Matrix4,
  39607. set: function(e, t, i, n, r, o, a, s, l, c, h, u, d, p, f, g) {
  39608. var m = this.elements;
  39609. return m[0] = e,
  39610. m[4] = t,
  39611. m[8] = i,
  39612. m[12] = n,
  39613. m[1] = r,
  39614. m[5] = o,
  39615. m[9] = a,
  39616. m[13] = s,
  39617. m[2] = l,
  39618. m[6] = c,
  39619. m[10] = h,
  39620. m[14] = u,
  39621. m[3] = d,
  39622. m[7] = p,
  39623. m[11] = f,
  39624. m[15] = g,
  39625. this
  39626. },
  39627. identity: function() {
  39628. return this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
  39629. this
  39630. },
  39631. clone: function() {
  39632. return (new n.Matrix4).fromArray(this.elements)
  39633. },
  39634. copy: function(e) {
  39635. return this.elements.set(e.elements),
  39636. this
  39637. },
  39638. copyPosition: function(e) {
  39639. var t = this.elements
  39640. , i = e.elements;
  39641. return t[12] = i[12],
  39642. t[13] = i[13],
  39643. t[14] = i[14],
  39644. this
  39645. },
  39646. extractBasis: function(e, t, i) {
  39647. return e.setFromMatrixColumn(this, 0),
  39648. t.setFromMatrixColumn(this, 1),
  39649. i.setFromMatrixColumn(this, 2),
  39650. this
  39651. },
  39652. makeBasis: function(e, t, i) {
  39653. 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),
  39654. this
  39655. },
  39656. extractRotation: function() {
  39657. var e;
  39658. return function(t) {
  39659. void 0 === e && (e = new n.Vector3);
  39660. var i = this.elements
  39661. , r = t.elements
  39662. , o = 1 / e.setFromMatrixColumn(t, 0).length()
  39663. , a = 1 / e.setFromMatrixColumn(t, 1).length()
  39664. , s = 1 / e.setFromMatrixColumn(t, 2).length();
  39665. return i[0] = r[0] * o,
  39666. i[1] = r[1] * o,
  39667. i[2] = r[2] * o,
  39668. i[4] = r[4] * a,
  39669. i[5] = r[5] * a,
  39670. i[6] = r[6] * a,
  39671. i[8] = r[8] * s,
  39672. i[9] = r[9] * s,
  39673. i[10] = r[10] * s,
  39674. this
  39675. }
  39676. }(),
  39677. makeRotationFromEuler: function(e) {
  39678. e instanceof n.Euler == !1 && console.error("THREE.Matrix: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");
  39679. var t = this.elements
  39680. , i = e.x
  39681. , r = e.y
  39682. , o = e.z
  39683. , a = Math.cos(i)
  39684. , s = Math.sin(i)
  39685. , l = Math.cos(r)
  39686. , c = Math.sin(r)
  39687. , h = Math.cos(o)
  39688. , u = Math.sin(o);
  39689. if ("XYZ" === e.order) {
  39690. var d = a * h
  39691. , p = a * u
  39692. , f = s * h
  39693. , g = s * u;
  39694. t[0] = l * h,
  39695. t[4] = -l * u,
  39696. t[8] = c,
  39697. t[1] = p + f * c,
  39698. t[5] = d - g * c,
  39699. t[9] = -s * l,
  39700. t[2] = g - d * c,
  39701. t[6] = f + p * c,
  39702. t[10] = a * l
  39703. } else if ("YXZ" === e.order) {
  39704. var m = l * h
  39705. , v = l * u
  39706. , A = c * h
  39707. , y = c * u;
  39708. t[0] = m + y * s,
  39709. t[4] = A * s - v,
  39710. t[8] = a * c,
  39711. t[1] = a * u,
  39712. t[5] = a * h,
  39713. t[9] = -s,
  39714. t[2] = v * s - A,
  39715. t[6] = y + m * s,
  39716. t[10] = a * l
  39717. } else if ("ZXY" === e.order) {
  39718. var m = l * h
  39719. , v = l * u
  39720. , A = c * h
  39721. , y = c * u;
  39722. t[0] = m - y * s,
  39723. t[4] = -a * u,
  39724. t[8] = A + v * s,
  39725. t[1] = v + A * s,
  39726. t[5] = a * h,
  39727. t[9] = y - m * s,
  39728. t[2] = -a * c,
  39729. t[6] = s,
  39730. t[10] = a * l
  39731. } else if ("ZYX" === e.order) {
  39732. var d = a * h
  39733. , p = a * u
  39734. , f = s * h
  39735. , g = s * u;
  39736. t[0] = l * h,
  39737. t[4] = f * c - p,
  39738. t[8] = d * c + g,
  39739. t[1] = l * u,
  39740. t[5] = g * c + d,
  39741. t[9] = p * c - f,
  39742. t[2] = -c,
  39743. t[6] = s * l,
  39744. t[10] = a * l
  39745. } else if ("YZX" === e.order) {
  39746. var C = a * l
  39747. , I = a * c
  39748. , E = s * l
  39749. , b = s * c;
  39750. t[0] = l * h,
  39751. t[4] = b - C * u,
  39752. t[8] = E * u + I,
  39753. t[1] = u,
  39754. t[5] = a * h,
  39755. t[9] = -s * h,
  39756. t[2] = -c * h,
  39757. t[6] = I * u + E,
  39758. t[10] = C - b * u
  39759. } else if ("XZY" === e.order) {
  39760. var C = a * l
  39761. , I = a * c
  39762. , E = s * l
  39763. , b = s * c;
  39764. t[0] = l * h,
  39765. t[4] = -u,
  39766. t[8] = c * h,
  39767. t[1] = C * u + b,
  39768. t[5] = a * h,
  39769. t[9] = I * u - E,
  39770. t[2] = E * u - I,
  39771. t[6] = s * h,
  39772. t[10] = b * u + C
  39773. }
  39774. return t[3] = 0,
  39775. t[7] = 0,
  39776. t[11] = 0,
  39777. t[12] = 0,
  39778. t[13] = 0,
  39779. t[14] = 0,
  39780. t[15] = 1,
  39781. this
  39782. },
  39783. makeRotationFromQuaternion: function(e) {
  39784. var t = this.elements
  39785. , i = e.x
  39786. , n = e.y
  39787. , r = e.z
  39788. , o = e.w
  39789. , a = i + i
  39790. , s = n + n
  39791. , l = r + r
  39792. , c = i * a
  39793. , h = i * s
  39794. , u = i * l
  39795. , d = n * s
  39796. , p = n * l
  39797. , f = r * l
  39798. , g = o * a
  39799. , m = o * s
  39800. , v = o * l;
  39801. return t[0] = 1 - (d + f),
  39802. t[4] = h - v,
  39803. t[8] = u + m,
  39804. t[1] = h + v,
  39805. t[5] = 1 - (c + f),
  39806. t[9] = p - g,
  39807. t[2] = u - m,
  39808. t[6] = p + g,
  39809. t[10] = 1 - (c + d),
  39810. t[3] = 0,
  39811. t[7] = 0,
  39812. t[11] = 0,
  39813. t[12] = 0,
  39814. t[13] = 0,
  39815. t[14] = 0,
  39816. t[15] = 1,
  39817. this
  39818. },
  39819. lookAt: function() {
  39820. var e, t, i;
  39821. return function(r, o, a) {
  39822. void 0 === e && (e = new n.Vector3),
  39823. void 0 === t && (t = new n.Vector3),
  39824. void 0 === i && (i = new n.Vector3);
  39825. var s = this.elements;
  39826. return i.subVectors(r, o).normalize(),
  39827. 0 === i.lengthSq() && (i.z = 1),
  39828. e.crossVectors(a, i).normalize(),
  39829. 0 === e.lengthSq() && (i.x += 1e-4,
  39830. e.crossVectors(a, i).normalize()),
  39831. t.crossVectors(i, e),
  39832. s[0] = e.x,
  39833. s[4] = t.x,
  39834. s[8] = i.x,
  39835. s[1] = e.y,
  39836. s[5] = t.y,
  39837. s[9] = i.y,
  39838. s[2] = e.z,
  39839. s[6] = t.z,
  39840. s[10] = i.z,
  39841. this
  39842. }
  39843. }(),
  39844. multiply: function(e, t) {
  39845. return void 0 !== t ? (console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),
  39846. this.multiplyMatrices(e, t)) : this.multiplyMatrices(this, e)
  39847. },
  39848. multiplyMatrices: function(e, t) {
  39849. var i = e.elements
  39850. , n = t.elements
  39851. , r = this.elements
  39852. , o = i[0]
  39853. , a = i[4]
  39854. , s = i[8]
  39855. , l = i[12]
  39856. , c = i[1]
  39857. , h = i[5]
  39858. , u = i[9]
  39859. , d = i[13]
  39860. , p = i[2]
  39861. , f = i[6]
  39862. , g = i[10]
  39863. , m = i[14]
  39864. , v = i[3]
  39865. , A = i[7]
  39866. , y = i[11]
  39867. , C = i[15]
  39868. , I = n[0]
  39869. , E = n[4]
  39870. , b = n[8]
  39871. , w = n[12]
  39872. , _ = n[1]
  39873. , T = n[5]
  39874. , x = n[9]
  39875. , S = n[13]
  39876. , M = n[2]
  39877. , R = n[6]
  39878. , P = n[10]
  39879. , O = n[14]
  39880. , L = n[3]
  39881. , D = n[7]
  39882. , N = n[11]
  39883. , B = n[15];
  39884. return r[0] = o * I + a * _ + s * M + l * L,
  39885. r[4] = o * E + a * T + s * R + l * D,
  39886. r[8] = o * b + a * x + s * P + l * N,
  39887. r[12] = o * w + a * S + s * O + l * B,
  39888. r[1] = c * I + h * _ + u * M + d * L,
  39889. r[5] = c * E + h * T + u * R + d * D,
  39890. r[9] = c * b + h * x + u * P + d * N,
  39891. r[13] = c * w + h * S + u * O + d * B,
  39892. r[2] = p * I + f * _ + g * M + m * L,
  39893. r[6] = p * E + f * T + g * R + m * D,
  39894. r[10] = p * b + f * x + g * P + m * N,
  39895. r[14] = p * w + f * S + g * O + m * B,
  39896. r[3] = v * I + A * _ + y * M + C * L,
  39897. r[7] = v * E + A * T + y * R + C * D,
  39898. r[11] = v * b + A * x + y * P + C * N,
  39899. r[15] = v * w + A * S + y * O + C * B,
  39900. this
  39901. },
  39902. multiplyToArray: function(e, t, i) {
  39903. var n = this.elements;
  39904. return this.multiplyMatrices(e, t),
  39905. i[0] = n[0],
  39906. i[1] = n[1],
  39907. i[2] = n[2],
  39908. i[3] = n[3],
  39909. i[4] = n[4],
  39910. i[5] = n[5],
  39911. i[6] = n[6],
  39912. i[7] = n[7],
  39913. i[8] = n[8],
  39914. i[9] = n[9],
  39915. i[10] = n[10],
  39916. i[11] = n[11],
  39917. i[12] = n[12],
  39918. i[13] = n[13],
  39919. i[14] = n[14],
  39920. i[15] = n[15],
  39921. this
  39922. },
  39923. multiplyScalar: function(e) {
  39924. var t = this.elements;
  39925. return t[0] *= e,
  39926. t[4] *= e,
  39927. t[8] *= e,
  39928. t[12] *= e,
  39929. t[1] *= e,
  39930. t[5] *= e,
  39931. t[9] *= e,
  39932. t[13] *= e,
  39933. t[2] *= e,
  39934. t[6] *= e,
  39935. t[10] *= e,
  39936. t[14] *= e,
  39937. t[3] *= e,
  39938. t[7] *= e,
  39939. t[11] *= e,
  39940. t[15] *= e,
  39941. this
  39942. },
  39943. applyToVector3Array: function() {
  39944. var e;
  39945. return function(t, i, r) {
  39946. void 0 === e && (e = new n.Vector3),
  39947. void 0 === i && (i = 0),
  39948. void 0 === r && (r = t.length);
  39949. for (var o = 0, a = i; o < r; o += 3,
  39950. a += 3)
  39951. e.fromArray(t, a),
  39952. e.applyMatrix4(this),
  39953. e.toArray(t, a);
  39954. return t
  39955. }
  39956. }(),
  39957. applyToBuffer: function() {
  39958. var e;
  39959. return function(t, i, r) {
  39960. void 0 === e && (e = new n.Vector3),
  39961. void 0 === i && (i = 0),
  39962. void 0 === r && (r = t.length / t.itemSize);
  39963. for (var o = 0, a = i; o < r; o++,
  39964. a++)
  39965. e.x = t.getX(a),
  39966. e.y = t.getY(a),
  39967. e.z = t.getZ(a),
  39968. e.applyMatrix4(this),
  39969. t.setXYZ(e.x, e.y, e.z);
  39970. return t
  39971. }
  39972. }(),
  39973. determinant: function() {
  39974. var e = this.elements
  39975. , t = e[0]
  39976. , i = e[4]
  39977. , n = e[8]
  39978. , r = e[12]
  39979. , o = e[1]
  39980. , a = e[5]
  39981. , s = e[9]
  39982. , l = e[13]
  39983. , c = e[2]
  39984. , h = e[6]
  39985. , u = e[10]
  39986. , d = e[14]
  39987. , p = e[3]
  39988. , f = e[7]
  39989. , g = e[11]
  39990. , m = e[15];
  39991. 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)
  39992. },
  39993. transpose: function() {
  39994. var e, t = this.elements;
  39995. return e = t[1],
  39996. t[1] = t[4],
  39997. t[4] = e,
  39998. e = t[2],
  39999. t[2] = t[8],
  40000. t[8] = e,
  40001. e = t[6],
  40002. t[6] = t[9],
  40003. t[9] = e,
  40004. e = t[3],
  40005. t[3] = t[12],
  40006. t[12] = e,
  40007. e = t[7],
  40008. t[7] = t[13],
  40009. t[13] = e,
  40010. e = t[11],
  40011. t[11] = t[14],
  40012. t[14] = e,
  40013. this
  40014. },
  40015. flattenToArrayOffset: function(e, t) {
  40016. var i = this.elements;
  40017. return e[t] = i[0],
  40018. e[t + 1] = i[1],
  40019. e[t + 2] = i[2],
  40020. e[t + 3] = i[3],
  40021. e[t + 4] = i[4],
  40022. e[t + 5] = i[5],
  40023. e[t + 6] = i[6],
  40024. e[t + 7] = i[7],
  40025. e[t + 8] = i[8],
  40026. e[t + 9] = i[9],
  40027. e[t + 10] = i[10],
  40028. e[t + 11] = i[11],
  40029. e[t + 12] = i[12],
  40030. e[t + 13] = i[13],
  40031. e[t + 14] = i[14],
  40032. e[t + 15] = i[15],
  40033. e
  40034. },
  40035. getPosition: function() {
  40036. var e;
  40037. return function() {
  40038. return void 0 === e && (e = new n.Vector3),
  40039. console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),
  40040. e.setFromMatrixColumn(this, 3)
  40041. }
  40042. }(),
  40043. setPosition: function(e) {
  40044. var t = this.elements;
  40045. return t[12] = e.x,
  40046. t[13] = e.y,
  40047. t[14] = e.z,
  40048. this
  40049. },
  40050. getInverse: function(e, t) {
  40051. var i = this.elements
  40052. , n = e.elements
  40053. , r = n[0]
  40054. , o = n[1]
  40055. , a = n[2]
  40056. , s = n[3]
  40057. , l = n[4]
  40058. , c = n[5]
  40059. , h = n[6]
  40060. , u = n[7]
  40061. , d = n[8]
  40062. , p = n[9]
  40063. , f = n[10]
  40064. , g = n[11]
  40065. , m = n[12]
  40066. , v = n[13]
  40067. , A = n[14]
  40068. , y = n[15]
  40069. , C = p * A * u - v * f * u + v * h * g - c * A * g - p * h * y + c * f * y
  40070. , I = m * f * u - d * A * u - m * h * g + l * A * g + d * h * y - l * f * y
  40071. , E = d * v * u - m * p * u + m * c * g - l * v * g - d * c * y + l * p * y
  40072. , b = m * p * h - d * v * h - m * c * f + l * v * f + d * c * A - l * p * A
  40073. , w = r * C + o * I + a * E + s * b;
  40074. if (0 === w) {
  40075. var _ = "THREE.Matrix4.getInverse(): can't invert matrix, determinant is 0";
  40076. if (t)
  40077. throw new Error(_);
  40078. return console.warn(_),
  40079. this.identity()
  40080. }
  40081. return i[0] = C,
  40082. i[1] = v * f * s - p * A * s - v * a * g + o * A * g + p * a * y - o * f * y,
  40083. i[2] = c * A * s - v * h * s + v * a * u - o * A * u - c * a * y + o * h * y,
  40084. i[3] = p * h * s - c * f * s - p * a * u + o * f * u + c * a * g - o * h * g,
  40085. i[4] = I,
  40086. i[5] = d * A * s - m * f * s + m * a * g - r * A * g - d * a * y + r * f * y,
  40087. i[6] = m * h * s - l * A * s - m * a * u + r * A * u + l * a * y - r * h * y,
  40088. i[7] = l * f * s - d * h * s + d * a * u - r * f * u - l * a * g + r * h * g,
  40089. i[8] = E,
  40090. i[9] = m * p * s - d * v * s - m * o * g + r * v * g + d * o * y - r * p * y,
  40091. i[10] = l * v * s - m * c * s + m * o * u - r * v * u - l * o * y + r * c * y,
  40092. i[11] = d * c * s - l * p * s - d * o * u + r * p * u + l * o * g - r * c * g,
  40093. i[12] = b,
  40094. i[13] = d * v * a - m * p * a + m * o * f - r * v * f - d * o * A + r * p * A,
  40095. i[14] = m * c * a - l * v * a - m * o * h + r * v * h + l * o * A - r * c * A,
  40096. i[15] = l * p * a - d * c * a + d * o * h - r * p * h - l * o * f + r * c * f,
  40097. this.multiplyScalar(1 / w)
  40098. },
  40099. scale: function(e) {
  40100. var t = this.elements
  40101. , i = e.x
  40102. , n = e.y
  40103. , r = e.z;
  40104. return t[0] *= i,
  40105. t[4] *= n,
  40106. t[8] *= r,
  40107. t[1] *= i,
  40108. t[5] *= n,
  40109. t[9] *= r,
  40110. t[2] *= i,
  40111. t[6] *= n,
  40112. t[10] *= r,
  40113. t[3] *= i,
  40114. t[7] *= n,
  40115. t[11] *= r,
  40116. this
  40117. },
  40118. getMaxScaleOnAxis: function() {
  40119. var e = this.elements
  40120. , t = e[0] * e[0] + e[1] * e[1] + e[2] * e[2]
  40121. , i = e[4] * e[4] + e[5] * e[5] + e[6] * e[6]
  40122. , n = e[8] * e[8] + e[9] * e[9] + e[10] * e[10];
  40123. return Math.sqrt(Math.max(t, i, n))
  40124. },
  40125. makeTranslation: function(e, t, i) {
  40126. return this.set(1, 0, 0, e, 0, 1, 0, t, 0, 0, 1, i, 0, 0, 0, 1),
  40127. this
  40128. },
  40129. makeRotationX: function(e) {
  40130. var t = Math.cos(e)
  40131. , i = Math.sin(e);
  40132. return this.set(1, 0, 0, 0, 0, t, -i, 0, 0, i, t, 0, 0, 0, 0, 1),
  40133. this
  40134. },
  40135. makeRotationY: function(e) {
  40136. var t = Math.cos(e)
  40137. , i = Math.sin(e);
  40138. return this.set(t, 0, i, 0, 0, 1, 0, 0, -i, 0, t, 0, 0, 0, 0, 1),
  40139. this
  40140. },
  40141. makeRotationZ: function(e) {
  40142. var t = Math.cos(e)
  40143. , i = Math.sin(e);
  40144. return this.set(t, -i, 0, 0, i, t, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
  40145. this
  40146. },
  40147. makeRotationAxis: function(e, t) {
  40148. var i = Math.cos(t)
  40149. , n = Math.sin(t)
  40150. , r = 1 - i
  40151. , o = e.x
  40152. , a = e.y
  40153. , s = e.z
  40154. , l = r * o
  40155. , c = r * a;
  40156. 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),
  40157. this
  40158. },
  40159. makeScale: function(e, t, i) {
  40160. return this.set(e, 0, 0, 0, 0, t, 0, 0, 0, 0, i, 0, 0, 0, 0, 1),
  40161. this
  40162. },
  40163. compose: function(e, t, i) {
  40164. return this.makeRotationFromQuaternion(t),
  40165. this.scale(i),
  40166. this.setPosition(e),
  40167. this
  40168. },
  40169. decompose: function() {
  40170. var e, t;
  40171. return function(i, r, o) {
  40172. void 0 === e && (e = new n.Vector3),
  40173. void 0 === t && (t = new n.Matrix4);
  40174. var a = this.elements
  40175. , s = e.set(a[0], a[1], a[2]).length()
  40176. , l = e.set(a[4], a[5], a[6]).length()
  40177. , c = e.set(a[8], a[9], a[10]).length()
  40178. , h = this.determinant();
  40179. h < 0 && (s = -s),
  40180. i.x = a[12],
  40181. i.y = a[13],
  40182. i.z = a[14],
  40183. t.elements.set(this.elements);
  40184. var u = 1 / s
  40185. , d = 1 / l
  40186. , p = 1 / c;
  40187. return t.elements[0] *= u,
  40188. t.elements[1] *= u,
  40189. t.elements[2] *= u,
  40190. t.elements[4] *= d,
  40191. t.elements[5] *= d,
  40192. t.elements[6] *= d,
  40193. t.elements[8] *= p,
  40194. t.elements[9] *= p,
  40195. t.elements[10] *= p,
  40196. r.setFromRotationMatrix(t),
  40197. o.x = s,
  40198. o.y = l,
  40199. o.z = c,
  40200. this
  40201. }
  40202. }(),
  40203. makeFrustum: function(e, t, i, n, r, o) {
  40204. var a = this.elements
  40205. , s = 2 * r / (t - e)
  40206. , l = 2 * r / (n - i)
  40207. , c = (t + e) / (t - e)
  40208. , h = (n + i) / (n - i)
  40209. , u = -(o + r) / (o - r)
  40210. , d = -2 * o * r / (o - r);
  40211. return a[0] = s,
  40212. a[4] = 0,
  40213. a[8] = c,
  40214. a[12] = 0,
  40215. a[1] = 0,
  40216. a[5] = l,
  40217. a[9] = h,
  40218. a[13] = 0,
  40219. a[2] = 0,
  40220. a[6] = 0,
  40221. a[10] = u,
  40222. a[14] = d,
  40223. a[3] = 0,
  40224. a[7] = 0,
  40225. a[11] = -1,
  40226. a[15] = 0,
  40227. this
  40228. },
  40229. makePerspective: function(e, t, i, r) {
  40230. var o = i * Math.tan(n.Math.degToRad(.5 * e))
  40231. , a = -o
  40232. , s = a * t
  40233. , l = o * t;
  40234. return this.makeFrustum(s, l, a, o, i, r)
  40235. },
  40236. makeOrthographic: function(e, t, i, n, r, o) {
  40237. var a = this.elements
  40238. , s = 1 / (t - e)
  40239. , l = 1 / (i - n)
  40240. , c = 1 / (o - r)
  40241. , h = (t + e) * s
  40242. , u = (i + n) * l
  40243. , d = (o + r) * c;
  40244. return a[0] = 2 * s,
  40245. a[4] = 0,
  40246. a[8] = 0,
  40247. a[12] = -h,
  40248. a[1] = 0,
  40249. a[5] = 2 * l,
  40250. a[9] = 0,
  40251. a[13] = -u,
  40252. a[2] = 0,
  40253. a[6] = 0,
  40254. a[10] = -2 * c,
  40255. a[14] = -d,
  40256. a[3] = 0,
  40257. a[7] = 0,
  40258. a[11] = 0,
  40259. a[15] = 1,
  40260. this
  40261. },
  40262. equals: function(e) {
  40263. for (var t = this.elements, i = e.elements, n = 0; n < 16; n++)
  40264. if (t[n] !== i[n])
  40265. return !1;
  40266. return !0
  40267. },
  40268. fromArray: function(e) {
  40269. return this.elements.set(e),
  40270. this
  40271. },
  40272. toArray: function() {
  40273. var e = this.elements;
  40274. 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]]
  40275. }
  40276. },
  40277. n.Ray = function(e, t) {
  40278. this.origin = void 0 !== e ? e : new n.Vector3,
  40279. this.direction = void 0 !== t ? t : new n.Vector3
  40280. }
  40281. ,
  40282. n.Ray.prototype = {
  40283. constructor: n.Ray,
  40284. set: function(e, t) {
  40285. return this.origin.copy(e),
  40286. this.direction.copy(t),
  40287. this
  40288. },
  40289. clone: function() {
  40290. return (new this.constructor).copy(this)
  40291. },
  40292. copy: function(e) {
  40293. return this.origin.copy(e.origin),
  40294. this.direction.copy(e.direction),
  40295. this
  40296. },
  40297. at: function(e, t) {
  40298. var i = t || new n.Vector3;
  40299. return i.copy(this.direction).multiplyScalar(e).add(this.origin)
  40300. },
  40301. lookAt: function(e) {
  40302. this.direction.copy(e).sub(this.origin).normalize()
  40303. },
  40304. recast: function() {
  40305. var e = new n.Vector3;
  40306. return function(t) {
  40307. return this.origin.copy(this.at(t, e)),
  40308. this
  40309. }
  40310. }(),
  40311. closestPointToPoint: function(e, t) {
  40312. var i = t || new n.Vector3;
  40313. i.subVectors(e, this.origin);
  40314. var r = i.dot(this.direction);
  40315. return r < 0 ? i.copy(this.origin) : i.copy(this.direction).multiplyScalar(r).add(this.origin)
  40316. },
  40317. distanceToPoint: function(e) {
  40318. return Math.sqrt(this.distanceSqToPoint(e))
  40319. },
  40320. distanceSqToPoint: function() {
  40321. var e = new n.Vector3;
  40322. return function(t) {
  40323. var i = e.subVectors(t, this.origin).dot(this.direction);
  40324. return i < 0 ? this.origin.distanceToSquared(t) : (e.copy(this.direction).multiplyScalar(i).add(this.origin),
  40325. e.distanceToSquared(t))
  40326. }
  40327. }(),
  40328. distanceSqToSegment: function() {
  40329. var e = new n.Vector3
  40330. , t = new n.Vector3
  40331. , i = new n.Vector3;
  40332. return function(n, r, o, a) {
  40333. e.copy(n).add(r).multiplyScalar(.5),
  40334. t.copy(r).sub(n).normalize(),
  40335. i.copy(this.origin).sub(e);
  40336. 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);
  40337. if (m > 0)
  40338. if (s = d * f - p,
  40339. l = d * p - f,
  40340. h = u * m,
  40341. s >= 0)
  40342. if (l >= -h)
  40343. if (l <= h) {
  40344. var v = 1 / m;
  40345. s *= v,
  40346. l *= v,
  40347. c = s * (s + d * l + 2 * p) + l * (d * s + l + 2 * f) + g
  40348. } else
  40349. l = u,
  40350. s = Math.max(0, -(d * l + p)),
  40351. c = -s * s + l * (l + 2 * f) + g;
  40352. else
  40353. l = -u,
  40354. s = Math.max(0, -(d * l + p)),
  40355. c = -s * s + l * (l + 2 * f) + g;
  40356. else
  40357. l <= -h ? (s = Math.max(0, -(-d * u + p)),
  40358. l = s > 0 ? -u : Math.min(Math.max(-u, -f), u),
  40359. c = -s * s + l * (l + 2 * f) + g) : l <= h ? (s = 0,
  40360. l = Math.min(Math.max(-u, -f), u),
  40361. c = l * (l + 2 * f) + g) : (s = Math.max(0, -(d * u + p)),
  40362. l = s > 0 ? u : Math.min(Math.max(-u, -f), u),
  40363. c = -s * s + l * (l + 2 * f) + g);
  40364. else
  40365. l = d > 0 ? -u : u,
  40366. s = Math.max(0, -(d * l + p)),
  40367. c = -s * s + l * (l + 2 * f) + g;
  40368. return o && o.copy(this.direction).multiplyScalar(s).add(this.origin),
  40369. a && a.copy(t).multiplyScalar(l).add(e),
  40370. c
  40371. }
  40372. }(),
  40373. intersectSphere: function() {
  40374. var e = new n.Vector3;
  40375. return function(t, i) {
  40376. e.subVectors(t.center, this.origin);
  40377. var n = e.dot(this.direction)
  40378. , r = e.dot(e) - n * n
  40379. , o = t.radius * t.radius;
  40380. if (r > o)
  40381. return null;
  40382. var a = Math.sqrt(o - r)
  40383. , s = n - a
  40384. , l = n + a;
  40385. return s < 0 && l < 0 ? null : s < 0 ? this.at(l, i) : this.at(s, i)
  40386. }
  40387. }(),
  40388. intersectsSphere: function(e) {
  40389. return this.distanceToPoint(e.center) <= e.radius
  40390. },
  40391. distanceToPlane: function(e) {
  40392. var t = e.normal.dot(this.direction);
  40393. if (0 === t)
  40394. return 0 === e.distanceToPoint(this.origin) ? 0 : null;
  40395. var i = -(this.origin.dot(e.normal) + e.constant) / t;
  40396. return i >= 0 ? i : null
  40397. },
  40398. intersectPlane: function(e, t) {
  40399. var i = this.distanceToPlane(e);
  40400. return null === i ? null : this.at(i, t)
  40401. },
  40402. intersectsPlane: function(e) {
  40403. var t = e.distanceToPoint(this.origin);
  40404. if (0 === t)
  40405. return !0;
  40406. var i = e.normal.dot(this.direction);
  40407. return i * t < 0
  40408. },
  40409. intersectBox: function(e, t) {
  40410. 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;
  40411. return l >= 0 ? (i = (e.min.x - u.x) * l,
  40412. n = (e.max.x - u.x) * l) : (i = (e.max.x - u.x) * l,
  40413. n = (e.min.x - u.x) * l),
  40414. c >= 0 ? (r = (e.min.y - u.y) * c,
  40415. o = (e.max.y - u.y) * c) : (r = (e.max.y - u.y) * c,
  40416. o = (e.min.y - u.y) * c),
  40417. i > o || r > n ? null : ((r > i || i !== i) && (i = r),
  40418. (o < n || n !== n) && (n = o),
  40419. h >= 0 ? (a = (e.min.z - u.z) * h,
  40420. s = (e.max.z - u.z) * h) : (a = (e.max.z - u.z) * h,
  40421. s = (e.min.z - u.z) * h),
  40422. i > s || a > n ? null : ((a > i || i !== i) && (i = a),
  40423. (s < n || n !== n) && (n = s),
  40424. n < 0 ? null : this.at(i >= 0 ? i : n, t)))
  40425. },
  40426. intersectsBox: function() {
  40427. var e = new n.Vector3;
  40428. return function(t) {
  40429. return null !== this.intersectBox(t, e)
  40430. }
  40431. }(),
  40432. intersectTriangle: function() {
  40433. var e = new n.Vector3
  40434. , t = new n.Vector3
  40435. , i = new n.Vector3
  40436. , r = new n.Vector3;
  40437. return function(n, o, a, s, l) {
  40438. t.subVectors(o, n),
  40439. i.subVectors(a, n),
  40440. r.crossVectors(t, i);
  40441. var c, h = this.direction.dot(r);
  40442. if (h > 0) {
  40443. if (s)
  40444. return null;
  40445. c = 1
  40446. } else {
  40447. if (!(h < 0))
  40448. return null;
  40449. c = -1,
  40450. h = -h
  40451. }
  40452. e.subVectors(this.origin, n);
  40453. var u = c * this.direction.dot(i.crossVectors(e, i));
  40454. if (u < 0)
  40455. return null;
  40456. var d = c * this.direction.dot(t.cross(e));
  40457. if (d < 0)
  40458. return null;
  40459. if (u + d > h)
  40460. return null;
  40461. var p = -c * e.dot(r);
  40462. return p < 0 ? null : this.at(p / h, l)
  40463. }
  40464. }(),
  40465. applyMatrix4: function(e) {
  40466. return this.direction.add(this.origin).applyMatrix4(e),
  40467. this.origin.applyMatrix4(e),
  40468. this.direction.sub(this.origin),
  40469. this.direction.normalize(),
  40470. this
  40471. },
  40472. equals: function(e) {
  40473. return e.origin.equals(this.origin) && e.direction.equals(this.direction)
  40474. }
  40475. },
  40476. n.Sphere = function(e, t) {
  40477. this.center = void 0 !== e ? e : new n.Vector3,
  40478. this.radius = void 0 !== t ? t : 0
  40479. }
  40480. ,
  40481. n.Sphere.prototype = {
  40482. constructor: n.Sphere,
  40483. set: function(e, t) {
  40484. return this.center.copy(e),
  40485. this.radius = t,
  40486. this
  40487. },
  40488. setFromPoints: function() {
  40489. var e = new n.Box3;
  40490. return function(t, i) {
  40491. var n = this.center;
  40492. void 0 !== i ? n.copy(i) : e.setFromPoints(t).center(n);
  40493. for (var r = 0, o = 0, a = t.length; o < a; o++)
  40494. r = Math.max(r, n.distanceToSquared(t[o]));
  40495. return this.radius = Math.sqrt(r),
  40496. this
  40497. }
  40498. }(),
  40499. clone: function() {
  40500. return (new this.constructor).copy(this)
  40501. },
  40502. copy: function(e) {
  40503. return this.center.copy(e.center),
  40504. this.radius = e.radius,
  40505. this
  40506. },
  40507. empty: function() {
  40508. return this.radius <= 0
  40509. },
  40510. containsPoint: function(e) {
  40511. return e.distanceToSquared(this.center) <= this.radius * this.radius
  40512. },
  40513. distanceToPoint: function(e) {
  40514. return e.distanceTo(this.center) - this.radius
  40515. },
  40516. intersectsSphere: function(e) {
  40517. var t = this.radius + e.radius;
  40518. return e.center.distanceToSquared(this.center) <= t * t
  40519. },
  40520. intersectsBox: function(e) {
  40521. return e.intersectsSphere(this)
  40522. },
  40523. intersectsPlane: function(e) {
  40524. return Math.abs(this.center.dot(e.normal) - e.constant) <= this.radius
  40525. },
  40526. clampPoint: function(e, t) {
  40527. var i = this.center.distanceToSquared(e)
  40528. , r = t || new n.Vector3;
  40529. return r.copy(e),
  40530. i > this.radius * this.radius && (r.sub(this.center).normalize(),
  40531. r.multiplyScalar(this.radius).add(this.center)),
  40532. r
  40533. },
  40534. getBoundingBox: function(e) {
  40535. var t = e || new n.Box3;
  40536. return t.set(this.center, this.center),
  40537. t.expandByScalar(this.radius),
  40538. t
  40539. },
  40540. applyMatrix4: function(e) {
  40541. return this.center.applyMatrix4(e),
  40542. this.radius = this.radius * e.getMaxScaleOnAxis(),
  40543. this
  40544. },
  40545. translate: function(e) {
  40546. return this.center.add(e),
  40547. this
  40548. },
  40549. equals: function(e) {
  40550. return e.center.equals(this.center) && e.radius === this.radius
  40551. }
  40552. },
  40553. n.Frustum = function(e, t, i, r, o, a) {
  40554. 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]
  40555. }
  40556. ,
  40557. n.Frustum.prototype = {
  40558. constructor: n.Frustum,
  40559. set: function(e, t, i, n, r, o) {
  40560. var a = this.planes;
  40561. return a[0].copy(e),
  40562. a[1].copy(t),
  40563. a[2].copy(i),
  40564. a[3].copy(n),
  40565. a[4].copy(r),
  40566. a[5].copy(o),
  40567. this
  40568. },
  40569. clone: function() {
  40570. return (new this.constructor).copy(this)
  40571. },
  40572. copy: function(e) {
  40573. for (var t = this.planes, i = 0; i < 6; i++)
  40574. t[i].copy(e.planes[i]);
  40575. return this
  40576. },
  40577. setFromMatrix: function(e) {
  40578. var t = this.planes
  40579. , i = e.elements
  40580. , n = i[0]
  40581. , r = i[1]
  40582. , o = i[2]
  40583. , a = i[3]
  40584. , s = i[4]
  40585. , l = i[5]
  40586. , c = i[6]
  40587. , h = i[7]
  40588. , u = i[8]
  40589. , d = i[9]
  40590. , p = i[10]
  40591. , f = i[11]
  40592. , g = i[12]
  40593. , m = i[13]
  40594. , v = i[14]
  40595. , A = i[15];
  40596. return t[0].setComponents(a - n, h - s, f - u, A - g).normalize(),
  40597. t[1].setComponents(a + n, h + s, f + u, A + g).normalize(),
  40598. t[2].setComponents(a + r, h + l, f + d, A + m).normalize(),
  40599. t[3].setComponents(a - r, h - l, f - d, A - m).normalize(),
  40600. t[4].setComponents(a - o, h - c, f - p, A - v).normalize(),
  40601. t[5].setComponents(a + o, h + c, f + p, A + v).normalize(),
  40602. this
  40603. },
  40604. intersectsObject: function() {
  40605. var e = new n.Sphere;
  40606. return function(t) {
  40607. var i = t.geometry;
  40608. return null === i.boundingSphere && i.computeBoundingSphere(),
  40609. e.copy(i.boundingSphere),
  40610. e.applyMatrix4(t.matrixWorld),
  40611. this.intersectsSphere(e)
  40612. }
  40613. }(),
  40614. intersectsSphere: function(e) {
  40615. for (var t = this.planes, i = e.center, n = -e.radius, r = 0; r < 6; r++) {
  40616. var o = t[r].distanceToPoint(i);
  40617. if (o < n)
  40618. return !1
  40619. }
  40620. return !0
  40621. },
  40622. intersectsBox: function() {
  40623. var e = new n.Vector3
  40624. , t = new n.Vector3;
  40625. return function(i) {
  40626. for (var n = this.planes, r = 0; r < 6; r++) {
  40627. var o = n[r];
  40628. e.x = o.normal.x > 0 ? i.min.x : i.max.x,
  40629. t.x = o.normal.x > 0 ? i.max.x : i.min.x,
  40630. e.y = o.normal.y > 0 ? i.min.y : i.max.y,
  40631. t.y = o.normal.y > 0 ? i.max.y : i.min.y,
  40632. e.z = o.normal.z > 0 ? i.min.z : i.max.z,
  40633. t.z = o.normal.z > 0 ? i.max.z : i.min.z;
  40634. var a = o.distanceToPoint(e)
  40635. , s = o.distanceToPoint(t);
  40636. if (a < 0 && s < 0)
  40637. return !1
  40638. }
  40639. return !0
  40640. }
  40641. }(),
  40642. containsPoint: function(e) {
  40643. for (var t = this.planes, i = 0; i < 6; i++)
  40644. if (t[i].distanceToPoint(e) < 0)
  40645. return !1;
  40646. return !0
  40647. }
  40648. },
  40649. n.Plane = function(e, t) {
  40650. this.normal = void 0 !== e ? e : new n.Vector3(1,0,0),
  40651. this.constant = void 0 !== t ? t : 0
  40652. }
  40653. ,
  40654. n.Plane.prototype = {
  40655. constructor: n.Plane,
  40656. set: function(e, t) {
  40657. return this.normal.copy(e),
  40658. this.constant = t,
  40659. this
  40660. },
  40661. setComponents: function(e, t, i, n) {
  40662. return this.normal.set(e, t, i),
  40663. this.constant = n,
  40664. this
  40665. },
  40666. setFromNormalAndCoplanarPoint: function(e, t) {
  40667. return this.normal.copy(e),
  40668. this.constant = -t.dot(this.normal),
  40669. this
  40670. },
  40671. setFromCoplanarPoints: function() {
  40672. var e = new n.Vector3
  40673. , t = new n.Vector3;
  40674. return function(i, n, r) {
  40675. var o = e.subVectors(r, n).cross(t.subVectors(i, n)).normalize();
  40676. return this.setFromNormalAndCoplanarPoint(o, i),
  40677. this
  40678. }
  40679. }(),
  40680. clone: function() {
  40681. return (new this.constructor).copy(this)
  40682. },
  40683. copy: function(e) {
  40684. return this.normal.copy(e.normal),
  40685. this.constant = e.constant,
  40686. this
  40687. },
  40688. normalize: function() {
  40689. var e = 1 / this.normal.length();
  40690. return this.normal.multiplyScalar(e),
  40691. this.constant *= e,
  40692. this
  40693. },
  40694. negate: function() {
  40695. return this.constant *= -1,
  40696. this.normal.negate(),
  40697. this
  40698. },
  40699. distanceToPoint: function(e) {
  40700. return this.normal.dot(e) + this.constant
  40701. },
  40702. distanceToSphere: function(e) {
  40703. return this.distanceToPoint(e.center) - e.radius
  40704. },
  40705. projectPoint: function(e, t) {
  40706. return this.orthoPoint(e, t).sub(e).negate()
  40707. },
  40708. orthoPoint: function(e, t) {
  40709. var i = this.distanceToPoint(e)
  40710. , r = t || new n.Vector3;
  40711. return r.copy(this.normal).multiplyScalar(i)
  40712. },
  40713. intersectLine: function() {
  40714. var e = new n.Vector3;
  40715. return function(t, i) {
  40716. var r = i || new n.Vector3
  40717. , o = t.delta(e)
  40718. , a = this.normal.dot(o);
  40719. if (0 !== a) {
  40720. var s = -(t.start.dot(this.normal) + this.constant) / a;
  40721. if (!(s < 0 || s > 1))
  40722. return r.copy(o).multiplyScalar(s).add(t.start)
  40723. } else if (0 === this.distanceToPoint(t.start))
  40724. return r.copy(t.start)
  40725. }
  40726. }(),
  40727. intersectsLine: function(e) {
  40728. var t = this.distanceToPoint(e.start)
  40729. , i = this.distanceToPoint(e.end);
  40730. return t < 0 && i > 0 || i < 0 && t > 0
  40731. },
  40732. intersectsBox: function(e) {
  40733. return e.intersectsPlane(this)
  40734. },
  40735. intersectsSphere: function(e) {
  40736. return e.intersectsPlane(this)
  40737. },
  40738. coplanarPoint: function(e) {
  40739. var t = e || new n.Vector3;
  40740. return t.copy(this.normal).multiplyScalar(-this.constant)
  40741. },
  40742. applyMatrix4: function() {
  40743. var e = new n.Vector3
  40744. , t = new n.Vector3
  40745. , i = new n.Matrix3;
  40746. return function(n, r) {
  40747. var o = r || i.getNormalMatrix(n)
  40748. , a = e.copy(this.normal).applyMatrix3(o)
  40749. , s = this.coplanarPoint(t);
  40750. return s.applyMatrix4(n),
  40751. this.setFromNormalAndCoplanarPoint(a, s),
  40752. this
  40753. }
  40754. }(),
  40755. translate: function(e) {
  40756. return this.constant = this.constant - e.dot(this.normal),
  40757. this
  40758. },
  40759. equals: function(e) {
  40760. return e.normal.equals(this.normal) && e.constant === this.constant
  40761. }
  40762. },
  40763. n.Spherical = function(e, t, i) {
  40764. return this.radius = void 0 !== e ? e : 1,
  40765. this.phi = void 0 !== t ? t : 0,
  40766. this.theta = void 0 !== i ? i : 0,
  40767. this
  40768. }
  40769. ,
  40770. n.Spherical.prototype = {
  40771. constructor: n.Spherical,
  40772. set: function(e, t, i) {
  40773. this.radius = e,
  40774. this.phi = t,
  40775. this.theta = i
  40776. },
  40777. clone: function() {
  40778. return (new this.constructor).copy(this)
  40779. },
  40780. copy: function(e) {
  40781. return this.radius.copy(e.radius),
  40782. this.phi.copy(e.phi),
  40783. this.theta.copy(e.theta),
  40784. this
  40785. },
  40786. makeSafe: function() {
  40787. var e = 1e-6;
  40788. this.phi = Math.max(e, Math.min(Math.PI - e, this.phi))
  40789. },
  40790. setFromVector3: function(e) {
  40791. return this.radius = e.length(),
  40792. 0 === this.radius ? (this.theta = 0,
  40793. this.phi = 0) : (this.theta = Math.atan2(e.x, e.z),
  40794. this.phi = Math.acos(n.Math.clamp(e.y / this.radius, -1, 1))),
  40795. this
  40796. }
  40797. },
  40798. n.Math = {
  40799. generateUUID: function() {
  40800. var e, t = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""), i = new Array(36), n = 0;
  40801. return function() {
  40802. for (var r = 0; r < 36; r++)
  40803. 8 === r || 13 === r || 18 === r || 23 === r ? i[r] = "-" : 14 === r ? i[r] = "4" : (n <= 2 && (n = 33554432 + 16777216 * Math.random() | 0),
  40804. e = 15 & n,
  40805. n >>= 4,
  40806. i[r] = t[19 === r ? 3 & e | 8 : e]);
  40807. return i.join("")
  40808. }
  40809. }(),
  40810. clamp: function(e, t, i) {
  40811. return Math.max(t, Math.min(i, e))
  40812. },
  40813. euclideanModulo: function(e, t) {
  40814. return (e % t + t) % t
  40815. },
  40816. mapLinear: function(e, t, i, n, r) {
  40817. return n + (e - t) * (r - n) / (i - t)
  40818. },
  40819. smoothstep: function(e, t, i) {
  40820. return e <= t ? 0 : e >= i ? 1 : (e = (e - t) / (i - t),
  40821. e * e * (3 - 2 * e))
  40822. },
  40823. smootherstep: function(e, t, i) {
  40824. return e <= t ? 0 : e >= i ? 1 : (e = (e - t) / (i - t),
  40825. e * e * e * (e * (6 * e - 15) + 10))
  40826. },
  40827. random16: function() {
  40828. return console.warn("THREE.Math.random16() has been deprecated. Use Math.random() instead."),
  40829. Math.random()
  40830. },
  40831. randInt: function(e, t) {
  40832. return e + Math.floor(Math.random() * (t - e + 1))
  40833. },
  40834. randFloat: function(e, t) {
  40835. return e + Math.random() * (t - e)
  40836. },
  40837. randFloatSpread: function(e) {
  40838. return e * (.5 - Math.random())
  40839. },
  40840. degToRad: function() {
  40841. var e = Math.PI / 180;
  40842. return function(t) {
  40843. return t * e
  40844. }
  40845. }(),
  40846. radToDeg: function() {
  40847. var e = 180 / Math.PI;
  40848. return function(t) {
  40849. return t * e
  40850. }
  40851. }(),
  40852. isPowerOfTwo: function(e) {
  40853. return 0 === (e & e - 1) && 0 !== e
  40854. },
  40855. nearestPowerOfTwo: function(e) {
  40856. return Math.pow(2, Math.round(Math.log(e) / Math.LN2))
  40857. },
  40858. nextPowerOfTwo: function(e) {
  40859. return e--,
  40860. e |= e >> 1,
  40861. e |= e >> 2,
  40862. e |= e >> 4,
  40863. e |= e >> 8,
  40864. e |= e >> 16,
  40865. e++,
  40866. e
  40867. }
  40868. },
  40869. n.Spline = function(e) {
  40870. function t(e, t, i, n, r, o, a) {
  40871. var s = .5 * (i - e)
  40872. , l = .5 * (n - t);
  40873. return (2 * (t - i) + s + l) * a + (-3 * (t - i) - 2 * s - l) * o + s * r + t
  40874. }
  40875. this.points = e;
  40876. var i, r, o, a, s, l, c, h, u, d = [], p = {
  40877. x: 0,
  40878. y: 0,
  40879. z: 0
  40880. };
  40881. this.initFromArray = function(e) {
  40882. this.points = [];
  40883. for (var t = 0; t < e.length; t++)
  40884. this.points[t] = {
  40885. x: e[t][0],
  40886. y: e[t][1],
  40887. z: e[t][2]
  40888. }
  40889. }
  40890. ,
  40891. this.getPoint = function(e) {
  40892. return i = (this.points.length - 1) * e,
  40893. r = Math.floor(i),
  40894. o = i - r,
  40895. d[0] = 0 === r ? r : r - 1,
  40896. d[1] = r,
  40897. d[2] = r > this.points.length - 2 ? this.points.length - 1 : r + 1,
  40898. d[3] = r > this.points.length - 3 ? this.points.length - 1 : r + 2,
  40899. l = this.points[d[0]],
  40900. c = this.points[d[1]],
  40901. h = this.points[d[2]],
  40902. u = this.points[d[3]],
  40903. a = o * o,
  40904. s = o * a,
  40905. p.x = t(l.x, c.x, h.x, u.x, o, a, s),
  40906. p.y = t(l.y, c.y, h.y, u.y, o, a, s),
  40907. p.z = t(l.z, c.z, h.z, u.z, o, a, s),
  40908. p
  40909. }
  40910. ,
  40911. this.getControlPointsArray = function() {
  40912. var e, t, i = this.points.length, n = [];
  40913. for (e = 0; e < i; e++)
  40914. t = this.points[e],
  40915. n[e] = [t.x, t.y, t.z];
  40916. return n
  40917. }
  40918. ,
  40919. this.getLength = function(e) {
  40920. var t, i, r, o, a = 0, s = 0, l = 0, c = new n.Vector3, h = new n.Vector3, u = [], d = 0;
  40921. for (u[0] = 0,
  40922. e || (e = 100),
  40923. r = this.points.length * e,
  40924. c.copy(this.points[0]),
  40925. t = 1; t < r; t++)
  40926. i = t / r,
  40927. o = this.getPoint(i),
  40928. h.copy(o),
  40929. d += h.distanceTo(c),
  40930. c.copy(o),
  40931. a = (this.points.length - 1) * i,
  40932. s = Math.floor(a),
  40933. s !== l && (u[s] = d,
  40934. l = s);
  40935. return u[u.length] = d,
  40936. {
  40937. chunks: u,
  40938. total: d
  40939. }
  40940. }
  40941. ,
  40942. this.reparametrizeByArcLength = function(e) {
  40943. var t, i, r, o, a, s, l, c, h = [], u = new n.Vector3, d = this.getLength();
  40944. for (h.push(u.copy(this.points[0]).clone()),
  40945. t = 1; t < this.points.length; t++) {
  40946. for (s = d.chunks[t] - d.chunks[t - 1],
  40947. l = Math.ceil(e * s / d.total),
  40948. o = (t - 1) / (this.points.length - 1),
  40949. a = t / (this.points.length - 1),
  40950. i = 1; i < l - 1; i++)
  40951. r = o + i * (1 / l) * (a - o),
  40952. c = this.getPoint(r),
  40953. h.push(u.copy(c).clone());
  40954. h.push(u.copy(this.points[t]).clone())
  40955. }
  40956. this.points = h
  40957. }
  40958. }
  40959. ,
  40960. n.Triangle = function(e, t, i) {
  40961. this.a = void 0 !== e ? e : new n.Vector3,
  40962. this.b = void 0 !== t ? t : new n.Vector3,
  40963. this.c = void 0 !== i ? i : new n.Vector3
  40964. }
  40965. ,
  40966. n.Triangle.normal = function() {
  40967. var e = new n.Vector3;
  40968. return function(t, i, r, o) {
  40969. var a = o || new n.Vector3;
  40970. a.subVectors(r, i),
  40971. e.subVectors(t, i),
  40972. a.cross(e);
  40973. var s = a.lengthSq();
  40974. return s > 0 ? a.multiplyScalar(1 / Math.sqrt(s)) : a.set(0, 0, 0)
  40975. }
  40976. }(),
  40977. n.Triangle.barycoordFromPoint = function() {
  40978. var e = new n.Vector3
  40979. , t = new n.Vector3
  40980. , i = new n.Vector3;
  40981. return function(r, o, a, s, l) {
  40982. e.subVectors(s, o),
  40983. t.subVectors(a, o),
  40984. i.subVectors(r, o);
  40985. var c = e.dot(e)
  40986. , h = e.dot(t)
  40987. , u = e.dot(i)
  40988. , d = t.dot(t)
  40989. , p = t.dot(i)
  40990. , f = c * d - h * h
  40991. , g = l || new n.Vector3;
  40992. if (0 === f)
  40993. return g.set(-2, -1, -1);
  40994. var m = 1 / f
  40995. , v = (d * u - h * p) * m
  40996. , A = (c * p - h * u) * m;
  40997. return g.set(1 - v - A, A, v)
  40998. }
  40999. }(),
  41000. n.Triangle.containsPoint = function() {
  41001. var e = new n.Vector3;
  41002. return function(t, i, r, o) {
  41003. var a = n.Triangle.barycoordFromPoint(t, i, r, o, e);
  41004. return a.x >= 0 && a.y >= 0 && a.x + a.y <= 1
  41005. }
  41006. }(),
  41007. n.Triangle.prototype = {
  41008. constructor: n.Triangle,
  41009. set: function(e, t, i) {
  41010. return this.a.copy(e),
  41011. this.b.copy(t),
  41012. this.c.copy(i),
  41013. this
  41014. },
  41015. setFromPointsAndIndices: function(e, t, i, n) {
  41016. return this.a.copy(e[t]),
  41017. this.b.copy(e[i]),
  41018. this.c.copy(e[n]),
  41019. this
  41020. },
  41021. clone: function() {
  41022. return (new this.constructor).copy(this)
  41023. },
  41024. copy: function(e) {
  41025. return this.a.copy(e.a),
  41026. this.b.copy(e.b),
  41027. this.c.copy(e.c),
  41028. this
  41029. },
  41030. area: function() {
  41031. var e = new n.Vector3
  41032. , t = new n.Vector3;
  41033. return function() {
  41034. return e.subVectors(this.c, this.b),
  41035. t.subVectors(this.a, this.b),
  41036. .5 * e.cross(t).length()
  41037. }
  41038. }(),
  41039. midpoint: function(e) {
  41040. var t = e || new n.Vector3;
  41041. return t.addVectors(this.a, this.b).add(this.c).multiplyScalar(1 / 3)
  41042. },
  41043. normal: function(e) {
  41044. return n.Triangle.normal(this.a, this.b, this.c, e)
  41045. },
  41046. plane: function(e) {
  41047. var t = e || new n.Plane;
  41048. return t.setFromCoplanarPoints(this.a, this.b, this.c)
  41049. },
  41050. barycoordFromPoint: function(e, t) {
  41051. return n.Triangle.barycoordFromPoint(e, this.a, this.b, this.c, t)
  41052. },
  41053. containsPoint: function(e) {
  41054. return n.Triangle.containsPoint(e, this.a, this.b, this.c)
  41055. },
  41056. equals: function(e) {
  41057. return e.a.equals(this.a) && e.b.equals(this.b) && e.c.equals(this.c)
  41058. }
  41059. },
  41060. n.Interpolant = function(e, t, i, n) {
  41061. this.parameterPositions = e,
  41062. this._cachedIndex = 0,
  41063. this.resultBuffer = void 0 !== n ? n : new t.constructor(i),
  41064. this.sampleValues = t,
  41065. this.valueSize = i
  41066. }
  41067. ,
  41068. n.Interpolant.prototype = {
  41069. constructor: n.Interpolant,
  41070. evaluate: function(e) {
  41071. var t = this.parameterPositions
  41072. , i = this._cachedIndex
  41073. , n = t[i]
  41074. , r = t[i - 1];
  41075. e: {
  41076. t: {
  41077. var o;
  41078. i: {
  41079. n: if (!(e < n)) {
  41080. for (var a = i + 2; ; ) {
  41081. if (void 0 === n) {
  41082. if (e < r)
  41083. break n;
  41084. return i = t.length,
  41085. this._cachedIndex = i,
  41086. this.afterEnd_(i - 1, e, r)
  41087. }
  41088. if (i === a)
  41089. break;
  41090. if (r = n,
  41091. n = t[++i],
  41092. e < n)
  41093. break t
  41094. }
  41095. o = t.length;
  41096. break i
  41097. }
  41098. {
  41099. if (e >= r)
  41100. break e;
  41101. var s = t[1];
  41102. e < s && (i = 2,
  41103. r = s);
  41104. for (var a = i - 2; ; ) {
  41105. if (void 0 === r)
  41106. return this._cachedIndex = 0,
  41107. this.beforeStart_(0, e, n);
  41108. if (i === a)
  41109. break;
  41110. if (n = r,
  41111. r = t[--i - 1],
  41112. e >= r)
  41113. break t
  41114. }
  41115. o = i,
  41116. i = 0
  41117. }
  41118. }
  41119. for (; i < o; ) {
  41120. var l = i + o >>> 1;
  41121. e < t[l] ? o = l : i = l + 1
  41122. }
  41123. if (n = t[i],
  41124. r = t[i - 1],
  41125. void 0 === r)
  41126. return this._cachedIndex = 0,
  41127. this.beforeStart_(0, e, n);
  41128. if (void 0 === n)
  41129. return i = t.length,
  41130. this._cachedIndex = i,
  41131. this.afterEnd_(i - 1, r, e)
  41132. }
  41133. this._cachedIndex = i,
  41134. this.intervalChanged_(i, r, n)
  41135. }
  41136. return this.interpolate_(i, r, e, n)
  41137. },
  41138. settings: null,
  41139. DefaultSettings_: {},
  41140. getSettings_: function() {
  41141. return this.settings || this.DefaultSettings_
  41142. },
  41143. copySampleValue_: function(e) {
  41144. for (var t = this.resultBuffer, i = this.sampleValues, n = this.valueSize, r = e * n, o = 0; o !== n; ++o)
  41145. t[o] = i[r + o];
  41146. return t
  41147. },
  41148. interpolate_: function(e, t, i, n) {
  41149. throw new Error("call to abstract method")
  41150. },
  41151. intervalChanged_: function(e, t, i) {}
  41152. },
  41153. Object.assign(n.Interpolant.prototype, {
  41154. beforeStart_: n.Interpolant.prototype.copySampleValue_,
  41155. afterEnd_: n.Interpolant.prototype.copySampleValue_
  41156. }),
  41157. n.CubicInterpolant = function(e, t, i, r) {
  41158. n.Interpolant.call(this, e, t, i, r),
  41159. this._weightPrev = -0,
  41160. this._offsetPrev = -0,
  41161. this._weightNext = -0,
  41162. this._offsetNext = -0
  41163. }
  41164. ,
  41165. n.CubicInterpolant.prototype = Object.assign(Object.create(n.Interpolant.prototype), {
  41166. constructor: n.CubicInterpolant,
  41167. DefaultSettings_: {
  41168. endingStart: n.ZeroCurvatureEnding,
  41169. endingEnd: n.ZeroCurvatureEnding
  41170. },
  41171. intervalChanged_: function(e, t, i) {
  41172. var r = this.parameterPositions
  41173. , o = e - 2
  41174. , a = e + 1
  41175. , s = r[o]
  41176. , l = r[a];
  41177. if (void 0 === s)
  41178. switch (this.getSettings_().endingStart) {
  41179. case n.ZeroSlopeEnding:
  41180. o = e,
  41181. s = 2 * t - i;
  41182. break;
  41183. case n.WrapAroundEnding:
  41184. o = r.length - 2,
  41185. s = t + r[o] - r[o + 1];
  41186. break;
  41187. default:
  41188. o = e,
  41189. s = i
  41190. }
  41191. if (void 0 === l)
  41192. switch (this.getSettings_().endingEnd) {
  41193. case n.ZeroSlopeEnding:
  41194. a = e,
  41195. l = 2 * i - t;
  41196. break;
  41197. case n.WrapAroundEnding:
  41198. a = 1,
  41199. l = i + r[1] - r[0];
  41200. break;
  41201. default:
  41202. a = e - 1,
  41203. l = t
  41204. }
  41205. var c = .5 * (i - t)
  41206. , h = this.valueSize;
  41207. this._weightPrev = c / (t - s),
  41208. this._weightNext = c / (l - i),
  41209. this._offsetPrev = o * h,
  41210. this._offsetNext = a * h
  41211. },
  41212. interpolate_: function(e, t, i, n) {
  41213. 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)
  41214. r[C] = m * o[c + C] + v * o[l + C] + A * o[s + C] + y * o[h + C];
  41215. return r
  41216. }
  41217. }),
  41218. n.DiscreteInterpolant = function(e, t, i, r) {
  41219. n.Interpolant.call(this, e, t, i, r)
  41220. }
  41221. ,
  41222. n.DiscreteInterpolant.prototype = Object.assign(Object.create(n.Interpolant.prototype), {
  41223. constructor: n.DiscreteInterpolant,
  41224. interpolate_: function(e, t, i, n) {
  41225. return this.copySampleValue_(e - 1)
  41226. }
  41227. }),
  41228. n.LinearInterpolant = function(e, t, i, r) {
  41229. n.Interpolant.call(this, e, t, i, r)
  41230. }
  41231. ,
  41232. n.LinearInterpolant.prototype = Object.assign(Object.create(n.Interpolant.prototype), {
  41233. constructor: n.LinearInterpolant,
  41234. interpolate_: function(e, t, i, n) {
  41235. 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)
  41236. r[u] = o[l + u] * h + o[s + u] * c;
  41237. return r
  41238. }
  41239. }),
  41240. n.QuaternionLinearInterpolant = function(e, t, i, r) {
  41241. n.Interpolant.call(this, e, t, i, r)
  41242. }
  41243. ,
  41244. n.QuaternionLinearInterpolant.prototype = Object.assign(Object.create(n.Interpolant.prototype), {
  41245. constructor: n.QuaternionLinearInterpolant,
  41246. interpolate_: function(e, t, i, r) {
  41247. 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)
  41248. n.Quaternion.slerpFlat(o, 0, a, l - s, a, l, c);
  41249. return o
  41250. }
  41251. }),
  41252. n.Clock = function(e) {
  41253. this.autoStart = void 0 === e || e,
  41254. this.startTime = 0,
  41255. this.oldTime = 0,
  41256. this.elapsedTime = 0,
  41257. this.running = !1
  41258. }
  41259. ,
  41260. n.Clock.prototype = {
  41261. constructor: n.Clock,
  41262. start: function() {
  41263. this.startTime = performance.now(),
  41264. this.oldTime = this.startTime,
  41265. this.running = !0
  41266. },
  41267. stop: function() {
  41268. this.getElapsedTime(),
  41269. this.running = !1
  41270. },
  41271. getElapsedTime: function() {
  41272. return this.getDelta(),
  41273. this.elapsedTime
  41274. },
  41275. getDelta: function() {
  41276. var e = 0;
  41277. if (this.autoStart && !this.running && this.start(),
  41278. this.running) {
  41279. var t = performance.now();
  41280. e = .001 * (t - this.oldTime),
  41281. this.oldTime = t,
  41282. this.elapsedTime += e
  41283. }
  41284. return e
  41285. }
  41286. },
  41287. n.EventDispatcher = function() {}
  41288. ,
  41289. n.EventDispatcher.prototype = {
  41290. constructor: n.EventDispatcher,
  41291. apply: function(e) {
  41292. e.addEventListener = n.EventDispatcher.prototype.addEventListener,
  41293. e.hasEventListener = n.EventDispatcher.prototype.hasEventListener,
  41294. e.removeEventListener = n.EventDispatcher.prototype.removeEventListener,
  41295. e.dispatchEvent = n.EventDispatcher.prototype.dispatchEvent
  41296. },
  41297. addEventListener: function(e, t) {
  41298. void 0 === this._listeners && (this._listeners = {});
  41299. var i = this._listeners;
  41300. void 0 === i[e] && (i[e] = []),
  41301. i[e].indexOf(t) === -1 && i[e].push(t)
  41302. },
  41303. hasEventListener: function(e, t) {
  41304. if (void 0 === this._listeners)
  41305. return !1;
  41306. var i = this._listeners;
  41307. return void 0 !== i[e] && i[e].indexOf(t) !== -1
  41308. },
  41309. removeEventListener: function(e, t) {
  41310. if (void 0 !== this._listeners) {
  41311. var i = this._listeners
  41312. , n = i[e];
  41313. if (void 0 !== n) {
  41314. var r = n.indexOf(t);
  41315. r !== -1 && n.splice(r, 1)
  41316. }
  41317. }
  41318. },
  41319. dispatchEvent: function(e) {
  41320. if (void 0 !== this._listeners) {
  41321. var t = this._listeners
  41322. , i = t[e.type];
  41323. if (void 0 !== i) {
  41324. e.target = this;
  41325. for (var n = [], r = i.length, o = 0; o < r; o++)
  41326. n[o] = i[o];
  41327. for (var o = 0; o < r; o++)
  41328. n[o].call(this, e)
  41329. }
  41330. }
  41331. }
  41332. },
  41333. n.Layers = function() {
  41334. this.mask = 1
  41335. }
  41336. ,
  41337. n.Layers.prototype = {
  41338. constructor: n.Layers,
  41339. set: function(e) {
  41340. this.mask = 1 << e
  41341. },
  41342. enable: function(e) {
  41343. this.mask |= 1 << e
  41344. },
  41345. toggle: function(e) {
  41346. this.mask ^= 1 << e
  41347. },
  41348. disable: function(e) {
  41349. this.mask &= ~(1 << e)
  41350. },
  41351. test: function(e) {
  41352. return 0 !== (this.mask & e.mask)
  41353. }
  41354. },
  41355. function(e) {
  41356. function t(e, t) {
  41357. return e.distance - t.distance
  41358. }
  41359. function i(e, t, n, r) {
  41360. if (e.visible !== !1 && (e.raycast(t, n),
  41361. r === !0))
  41362. for (var o = e.children, a = 0, s = o.length; a < s; a++)
  41363. i(o[a], t, n, !0)
  41364. }
  41365. e.Raycaster = function(t, i, n, r) {
  41366. this.ray = new e.Ray(t,i),
  41367. this.near = n || 0,
  41368. this.far = r || 1 / 0,
  41369. this.params = {
  41370. Mesh: {},
  41371. Line: {},
  41372. LOD: {},
  41373. Points: {
  41374. threshold: 1
  41375. },
  41376. Sprite: {}
  41377. },
  41378. Object.defineProperties(this.params, {
  41379. PointCloud: {
  41380. get: function() {
  41381. return console.warn("THREE.Raycaster: params.PointCloud has been renamed to params.Points."),
  41382. this.Points
  41383. }
  41384. }
  41385. })
  41386. }
  41387. ,
  41388. e.Raycaster.prototype = {
  41389. constructor: e.Raycaster,
  41390. linePrecision: 1,
  41391. set: function(e, t) {
  41392. this.ray.set(e, t)
  41393. },
  41394. setFromCamera: function(t, i) {
  41395. i instanceof e.PerspectiveCamera ? (this.ray.origin.setFromMatrixPosition(i.matrixWorld),
  41396. 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),
  41397. this.ray.direction.set(0, 0, -1).transformDirection(i.matrixWorld)) : console.error("THREE.Raycaster: Unsupported camera type.")
  41398. },
  41399. intersectObject: function(e, n) {
  41400. var r = [];
  41401. return i(e, this, r, n),
  41402. r.sort(t),
  41403. r
  41404. },
  41405. intersectObjects: function(e, n) {
  41406. var r = [];
  41407. if (Array.isArray(e) === !1)
  41408. return console.warn("THREE.Raycaster.intersectObjects: objects is not an Array."),
  41409. r;
  41410. for (var o = 0, a = e.length; o < a; o++)
  41411. i(e[o], this, r, n);
  41412. return r.sort(t),
  41413. r
  41414. }
  41415. }
  41416. }(n),
  41417. n.Object3D = function() {
  41418. function e() {
  41419. o.setFromEuler(r, !1)
  41420. }
  41421. function t() {
  41422. r.setFromQuaternion(o, void 0, !1)
  41423. }
  41424. Object.defineProperty(this, "id", {
  41425. value: n.Object3DIdCount++
  41426. }),
  41427. this.uuid = n.Math.generateUUID(),
  41428. this.name = "",
  41429. this.type = "Object3D",
  41430. this.parent = null,
  41431. this.children = [],
  41432. this.up = n.Object3D.DefaultUp.clone();
  41433. var i = new n.Vector3
  41434. , r = new n.Euler
  41435. , o = new n.Quaternion
  41436. , a = new n.Vector3(1,1,1);
  41437. r.onChange(e),
  41438. o.onChange(t),
  41439. Object.defineProperties(this, {
  41440. position: {
  41441. enumerable: !0,
  41442. value: i
  41443. },
  41444. rotation: {
  41445. enumerable: !0,
  41446. value: r
  41447. },
  41448. quaternion: {
  41449. enumerable: !0,
  41450. value: o
  41451. },
  41452. scale: {
  41453. enumerable: !0,
  41454. value: a
  41455. },
  41456. modelViewMatrix: {
  41457. value: new n.Matrix4
  41458. },
  41459. normalMatrix: {
  41460. value: new n.Matrix3
  41461. }
  41462. }),
  41463. this.rotationAutoUpdate = !0,
  41464. this.matrix = new n.Matrix4,
  41465. this.matrixWorld = new n.Matrix4,
  41466. this.matrixAutoUpdate = n.Object3D.DefaultMatrixAutoUpdate,
  41467. this.matrixWorldNeedsUpdate = !1,
  41468. this.layers = new n.Layers,
  41469. this.visible = !0,
  41470. this.castShadow = !1,
  41471. this.receiveShadow = !1,
  41472. this.frustumCulled = !0,
  41473. this.renderOrder = 0,
  41474. this.userData = {}
  41475. }
  41476. ,
  41477. n.Object3D.DefaultUp = new n.Vector3(0,1,0),
  41478. n.Object3D.DefaultMatrixAutoUpdate = !0,
  41479. n.Object3D.prototype = {
  41480. constructor: n.Object3D,
  41481. applyMatrix: function(e) {
  41482. this.matrix.multiplyMatrices(e, this.matrix),
  41483. this.matrix.decompose(this.position, this.quaternion, this.scale)
  41484. },
  41485. setRotationFromAxisAngle: function(e, t) {
  41486. this.quaternion.setFromAxisAngle(e, t)
  41487. },
  41488. setRotationFromEuler: function(e) {
  41489. this.quaternion.setFromEuler(e, !0)
  41490. },
  41491. setRotationFromMatrix: function(e) {
  41492. this.quaternion.setFromRotationMatrix(e)
  41493. },
  41494. setRotationFromQuaternion: function(e) {
  41495. this.quaternion.copy(e)
  41496. },
  41497. rotateOnAxis: function() {
  41498. var e = new n.Quaternion;
  41499. return function(t, i) {
  41500. return e.setFromAxisAngle(t, i),
  41501. this.quaternion.multiply(e),
  41502. this
  41503. }
  41504. }(),
  41505. rotateX: function() {
  41506. var e = new n.Vector3(1,0,0);
  41507. return function(t) {
  41508. return this.rotateOnAxis(e, t)
  41509. }
  41510. }(),
  41511. rotateY: function() {
  41512. var e = new n.Vector3(0,1,0);
  41513. return function(t) {
  41514. return this.rotateOnAxis(e, t)
  41515. }
  41516. }(),
  41517. rotateZ: function() {
  41518. var e = new n.Vector3(0,0,1);
  41519. return function(t) {
  41520. return this.rotateOnAxis(e, t)
  41521. }
  41522. }(),
  41523. translateOnAxis: function() {
  41524. var e = new n.Vector3;
  41525. return function(t, i) {
  41526. return e.copy(t).applyQuaternion(this.quaternion),
  41527. this.position.add(e.multiplyScalar(i)),
  41528. this
  41529. }
  41530. }(),
  41531. translateX: function() {
  41532. var e = new n.Vector3(1,0,0);
  41533. return function(t) {
  41534. return this.translateOnAxis(e, t)
  41535. }
  41536. }(),
  41537. translateY: function() {
  41538. var e = new n.Vector3(0,1,0);
  41539. return function(t) {
  41540. return this.translateOnAxis(e, t)
  41541. }
  41542. }(),
  41543. translateZ: function() {
  41544. var e = new n.Vector3(0,0,1);
  41545. return function(t) {
  41546. return this.translateOnAxis(e, t)
  41547. }
  41548. }(),
  41549. localToWorld: function(e) {
  41550. return e.applyMatrix4(this.matrixWorld)
  41551. },
  41552. worldToLocal: function() {
  41553. var e = new n.Matrix4;
  41554. return function(t) {
  41555. return t.applyMatrix4(e.getInverse(this.matrixWorld))
  41556. }
  41557. }(),
  41558. lookAt: function() {
  41559. var e = new n.Matrix4;
  41560. return function(t) {
  41561. e.lookAt(t, this.position, this.up),
  41562. this.quaternion.setFromRotationMatrix(e)
  41563. }
  41564. }(),
  41565. add: function(e) {
  41566. if (arguments.length > 1) {
  41567. for (var t = 0; t < arguments.length; t++)
  41568. this.add(arguments[t]);
  41569. return this
  41570. }
  41571. return e === this ? (console.error("THREE.Object3D.add: object can't be added as a child of itself.", e),
  41572. this) : (e instanceof n.Object3D ? (null !== e.parent && e.parent.remove(e),
  41573. e.parent = this,
  41574. e.dispatchEvent({
  41575. type: "added"
  41576. }),
  41577. this.children.push(e)) : console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.", e),
  41578. this)
  41579. },
  41580. remove: function(e) {
  41581. if (arguments.length > 1)
  41582. for (var t = 0; t < arguments.length; t++)
  41583. this.remove(arguments[t]);
  41584. var i = this.children.indexOf(e);
  41585. i !== -1 && (e.parent = null,
  41586. e.dispatchEvent({
  41587. type: "removed"
  41588. }),
  41589. this.children.splice(i, 1))
  41590. },
  41591. getObjectById: function(e) {
  41592. return this.getObjectByProperty("id", e)
  41593. },
  41594. getObjectByName: function(e) {
  41595. return this.getObjectByProperty("name", e)
  41596. },
  41597. getObjectByProperty: function(e, t) {
  41598. if (this[e] === t)
  41599. return this;
  41600. for (var i = 0, n = this.children.length; i < n; i++) {
  41601. var r = this.children[i]
  41602. , o = r.getObjectByProperty(e, t);
  41603. if (void 0 !== o)
  41604. return o
  41605. }
  41606. },
  41607. getWorldPosition: function(e) {
  41608. var t = e || new n.Vector3;
  41609. return this.updateMatrixWorld(!0),
  41610. t.setFromMatrixPosition(this.matrixWorld)
  41611. },
  41612. getWorldQuaternion: function() {
  41613. var e = new n.Vector3
  41614. , t = new n.Vector3;
  41615. return function(i) {
  41616. var r = i || new n.Quaternion;
  41617. return this.updateMatrixWorld(!0),
  41618. this.matrixWorld.decompose(e, r, t),
  41619. r
  41620. }
  41621. }(),
  41622. getWorldRotation: function() {
  41623. var e = new n.Quaternion;
  41624. return function(t) {
  41625. var i = t || new n.Euler;
  41626. return this.getWorldQuaternion(e),
  41627. i.setFromQuaternion(e, this.rotation.order, !1)
  41628. }
  41629. }(),
  41630. getWorldScale: function() {
  41631. var e = new n.Vector3
  41632. , t = new n.Quaternion;
  41633. return function(i) {
  41634. var r = i || new n.Vector3;
  41635. return this.updateMatrixWorld(!0),
  41636. this.matrixWorld.decompose(e, t, r),
  41637. r
  41638. }
  41639. }(),
  41640. getWorldDirection: function() {
  41641. var e = new n.Quaternion;
  41642. return function(t) {
  41643. var i = t || new n.Vector3;
  41644. return this.getWorldQuaternion(e),
  41645. i.set(0, 0, 1).applyQuaternion(e)
  41646. }
  41647. }(),
  41648. raycast: function() {},
  41649. traverse: function(e) {
  41650. e(this);
  41651. for (var t = this.children, i = 0, n = t.length; i < n; i++)
  41652. t[i].traverse(e)
  41653. },
  41654. traverseVisible: function(e) {
  41655. if (this.visible !== !1) {
  41656. e(this);
  41657. for (var t = this.children, i = 0, n = t.length; i < n; i++)
  41658. t[i].traverseVisible(e)
  41659. }
  41660. },
  41661. traverseAncestors: function(e) {
  41662. var t = this.parent;
  41663. null !== t && (e(t),
  41664. t.traverseAncestors(e))
  41665. },
  41666. updateMatrix: function() {
  41667. this.matrix.compose(this.position, this.quaternion, this.scale),
  41668. this.matrixWorldNeedsUpdate = !0
  41669. },
  41670. updateMatrixWorld: function(e) {
  41671. this.matrixAutoUpdate === !0 && this.updateMatrix(),
  41672. this.matrixWorldNeedsUpdate !== !0 && e !== !0 || (null === this.parent ? this.matrixWorld.copy(this.matrix) : this.matrixWorld.multiplyMatrices(this.parent.matrixWorld, this.matrix),
  41673. this.matrixWorldNeedsUpdate = !1,
  41674. e = !0);
  41675. for (var t = 0, i = this.children.length; t < i; t++)
  41676. this.children[t].updateMatrixWorld(e)
  41677. },
  41678. toJSON: function(e) {
  41679. function t(e) {
  41680. var t = [];
  41681. for (var i in e) {
  41682. var n = e[i];
  41683. delete n.metadata,
  41684. t.push(n)
  41685. }
  41686. return t
  41687. }
  41688. var i = void 0 === e
  41689. , n = {};
  41690. i && (e = {
  41691. geometries: {},
  41692. materials: {},
  41693. textures: {},
  41694. images: {}
  41695. },
  41696. n.metadata = {
  41697. version: 4.4,
  41698. type: "Object",
  41699. generator: "Object3D.toJSON"
  41700. });
  41701. var r = {};
  41702. if (r.uuid = this.uuid,
  41703. r.type = this.type,
  41704. "" !== this.name && (r.name = this.name),
  41705. "{}" !== JSON.stringify(this.userData) && (r.userData = this.userData),
  41706. this.castShadow === !0 && (r.castShadow = !0),
  41707. this.receiveShadow === !0 && (r.receiveShadow = !0),
  41708. this.visible === !1 && (r.visible = !1),
  41709. r.matrix = this.matrix.toArray(),
  41710. void 0 !== this.geometry && (void 0 === e.geometries[this.geometry.uuid] && (e.geometries[this.geometry.uuid] = this.geometry.toJSON(e)),
  41711. r.geometry = this.geometry.uuid),
  41712. void 0 !== this.material && (void 0 === e.materials[this.material.uuid] && (e.materials[this.material.uuid] = this.material.toJSON(e)),
  41713. r.material = this.material.uuid),
  41714. this.children.length > 0) {
  41715. r.children = [];
  41716. for (var o = 0; o < this.children.length; o++)
  41717. r.children.push(this.children[o].toJSON(e).object)
  41718. }
  41719. if (i) {
  41720. var a = t(e.geometries)
  41721. , s = t(e.materials)
  41722. , l = t(e.textures)
  41723. , c = t(e.images);
  41724. a.length > 0 && (n.geometries = a),
  41725. s.length > 0 && (n.materials = s),
  41726. l.length > 0 && (n.textures = l),
  41727. c.length > 0 && (n.images = c)
  41728. }
  41729. return n.object = r,
  41730. n
  41731. },
  41732. clone: function(e) {
  41733. return (new this.constructor).copy(this, e)
  41734. },
  41735. copy: function(e, t) {
  41736. if (void 0 === t && (t = !0),
  41737. this.name = e.name,
  41738. this.up.copy(e.up),
  41739. this.position.copy(e.position),
  41740. this.quaternion.copy(e.quaternion),
  41741. this.scale.copy(e.scale),
  41742. this.rotationAutoUpdate = e.rotationAutoUpdate,
  41743. this.matrix.copy(e.matrix),
  41744. this.matrixWorld.copy(e.matrixWorld),
  41745. this.matrixAutoUpdate = e.matrixAutoUpdate,
  41746. this.matrixWorldNeedsUpdate = e.matrixWorldNeedsUpdate,
  41747. this.visible = e.visible,
  41748. this.castShadow = e.castShadow,
  41749. this.receiveShadow = e.receiveShadow,
  41750. this.frustumCulled = e.frustumCulled,
  41751. this.renderOrder = e.renderOrder,
  41752. this.userData = JSON.parse(JSON.stringify(e.userData)),
  41753. t === !0)
  41754. for (var i = 0; i < e.children.length; i++) {
  41755. var n = e.children[i];
  41756. this.add(n.clone())
  41757. }
  41758. return this
  41759. }
  41760. },
  41761. n.EventDispatcher.prototype.apply(n.Object3D.prototype),
  41762. n.Object3DIdCount = 0,
  41763. n.Face3 = function(e, t, i, r, o, a) {
  41764. this.a = e,
  41765. this.b = t,
  41766. this.c = i,
  41767. this.normal = r instanceof n.Vector3 ? r : new n.Vector3,
  41768. this.vertexNormals = Array.isArray(r) ? r : [],
  41769. this.color = o instanceof n.Color ? o : new n.Color,
  41770. this.vertexColors = Array.isArray(o) ? o : [],
  41771. this.materialIndex = void 0 !== a ? a : 0
  41772. }
  41773. ,
  41774. n.Face3.prototype = {
  41775. constructor: n.Face3,
  41776. clone: function() {
  41777. return (new this.constructor).copy(this)
  41778. },
  41779. copy: function(e) {
  41780. this.a = e.a,
  41781. this.b = e.b,
  41782. this.c = e.c,
  41783. this.normal.copy(e.normal),
  41784. this.color.copy(e.color),
  41785. this.materialIndex = e.materialIndex;
  41786. for (var t = 0, i = e.vertexNormals.length; t < i; t++)
  41787. this.vertexNormals[t] = e.vertexNormals[t].clone();
  41788. for (var t = 0, i = e.vertexColors.length; t < i; t++)
  41789. this.vertexColors[t] = e.vertexColors[t].clone();
  41790. return this
  41791. }
  41792. },
  41793. n.BufferAttribute = function(e, t) {
  41794. this.uuid = n.Math.generateUUID(),
  41795. this.array = e,
  41796. this.itemSize = t,
  41797. this.dynamic = !1,
  41798. this.updateRange = {
  41799. offset: 0,
  41800. count: -1
  41801. },
  41802. this.version = 0
  41803. }
  41804. ,
  41805. n.BufferAttribute.prototype = {
  41806. constructor: n.BufferAttribute,
  41807. get count() {
  41808. return this.array.length / this.itemSize
  41809. },
  41810. set needsUpdate(e) {
  41811. e === !0 && this.version++
  41812. },
  41813. setDynamic: function(e) {
  41814. return this.dynamic = e,
  41815. this
  41816. },
  41817. copy: function(e) {
  41818. return this.array = new e.array.constructor(e.array),
  41819. this.itemSize = e.itemSize,
  41820. this.dynamic = e.dynamic,
  41821. this
  41822. },
  41823. copyAt: function(e, t, i) {
  41824. e *= this.itemSize,
  41825. i *= t.itemSize;
  41826. for (var n = 0, r = this.itemSize; n < r; n++)
  41827. this.array[e + n] = t.array[i + n];
  41828. return this
  41829. },
  41830. copyArray: function(e) {
  41831. return this.array.set(e),
  41832. this
  41833. },
  41834. copyColorsArray: function(e) {
  41835. for (var t = this.array, i = 0, r = 0, o = e.length; r < o; r++) {
  41836. var a = e[r];
  41837. void 0 === a && (console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined", r),
  41838. a = new n.Color),
  41839. t[i++] = a.r,
  41840. t[i++] = a.g,
  41841. t[i++] = a.b
  41842. }
  41843. return this
  41844. },
  41845. copyIndicesArray: function(e) {
  41846. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  41847. var o = e[n];
  41848. t[i++] = o.a,
  41849. t[i++] = o.b,
  41850. t[i++] = o.c
  41851. }
  41852. return this
  41853. },
  41854. copyVector2sArray: function(e) {
  41855. for (var t = this.array, i = 0, r = 0, o = e.length; r < o; r++) {
  41856. var a = e[r];
  41857. void 0 === a && (console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined", r),
  41858. a = new n.Vector2),
  41859. t[i++] = a.x,
  41860. t[i++] = a.y
  41861. }
  41862. return this
  41863. },
  41864. copyVector3sArray: function(e) {
  41865. for (var t = this.array, i = 0, r = 0, o = e.length; r < o; r++) {
  41866. var a = e[r];
  41867. void 0 === a && (console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined", r),
  41868. a = new n.Vector3),
  41869. t[i++] = a.x,
  41870. t[i++] = a.y,
  41871. t[i++] = a.z
  41872. }
  41873. return this
  41874. },
  41875. copyVector4sArray: function(e) {
  41876. for (var t = this.array, i = 0, r = 0, o = e.length; r < o; r++) {
  41877. var a = e[r];
  41878. void 0 === a && (console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined", r),
  41879. a = new n.Vector4),
  41880. t[i++] = a.x,
  41881. t[i++] = a.y,
  41882. t[i++] = a.z,
  41883. t[i++] = a.w
  41884. }
  41885. return this
  41886. },
  41887. set: function(e, t) {
  41888. return void 0 === t && (t = 0),
  41889. this.array.set(e, t),
  41890. this
  41891. },
  41892. getX: function(e) {
  41893. return this.array[e * this.itemSize]
  41894. },
  41895. setX: function(e, t) {
  41896. return this.array[e * this.itemSize] = t,
  41897. this
  41898. },
  41899. getY: function(e) {
  41900. return this.array[e * this.itemSize + 1]
  41901. },
  41902. setY: function(e, t) {
  41903. return this.array[e * this.itemSize + 1] = t,
  41904. this
  41905. },
  41906. getZ: function(e) {
  41907. return this.array[e * this.itemSize + 2]
  41908. },
  41909. setZ: function(e, t) {
  41910. return this.array[e * this.itemSize + 2] = t,
  41911. this
  41912. },
  41913. getW: function(e) {
  41914. return this.array[e * this.itemSize + 3]
  41915. },
  41916. setW: function(e, t) {
  41917. return this.array[e * this.itemSize + 3] = t,
  41918. this
  41919. },
  41920. setXY: function(e, t, i) {
  41921. return e *= this.itemSize,
  41922. this.array[e + 0] = t,
  41923. this.array[e + 1] = i,
  41924. this
  41925. },
  41926. setXYZ: function(e, t, i, n) {
  41927. return e *= this.itemSize,
  41928. this.array[e + 0] = t,
  41929. this.array[e + 1] = i,
  41930. this.array[e + 2] = n,
  41931. this
  41932. },
  41933. setXYZW: function(e, t, i, n, r) {
  41934. return e *= this.itemSize,
  41935. this.array[e + 0] = t,
  41936. this.array[e + 1] = i,
  41937. this.array[e + 2] = n,
  41938. this.array[e + 3] = r,
  41939. this
  41940. },
  41941. clone: function() {
  41942. return (new this.constructor).copy(this)
  41943. }
  41944. },
  41945. n.Int8Attribute = function(e, t) {
  41946. return new n.BufferAttribute(new Int8Array(e),t)
  41947. }
  41948. ,
  41949. n.Uint8Attribute = function(e, t) {
  41950. return new n.BufferAttribute(new Uint8Array(e),t)
  41951. }
  41952. ,
  41953. n.Uint8ClampedAttribute = function(e, t) {
  41954. return new n.BufferAttribute(new Uint8ClampedArray(e),t)
  41955. }
  41956. ,
  41957. n.Int16Attribute = function(e, t) {
  41958. return new n.BufferAttribute(new Int16Array(e),t)
  41959. }
  41960. ,
  41961. n.Uint16Attribute = function(e, t) {
  41962. return new n.BufferAttribute(new Uint16Array(e),t)
  41963. }
  41964. ;
  41965. n.Int32Attribute = function(e, t) {
  41966. return new n.BufferAttribute(new Int32Array(e),t)
  41967. }
  41968. ;
  41969. n.Uint32Attribute = function(e, t) {
  41970. return new n.BufferAttribute(new Uint32Array(e),t)
  41971. }
  41972. ,
  41973. n.Float32Attribute = function(e, t) {
  41974. return new n.BufferAttribute(new Float32Array(e),t)
  41975. }
  41976. ,
  41977. n.Float64Attribute = function(e, t) {
  41978. return new n.BufferAttribute(new Float64Array(e),t)
  41979. }
  41980. ,
  41981. n.DynamicBufferAttribute = function(e, t) {
  41982. return console.warn("THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setDynamic( true ) instead."),
  41983. new n.BufferAttribute(e,t).setDynamic(!0)
  41984. }
  41985. ,
  41986. n.InstancedBufferAttribute = function(e, t, i) {
  41987. n.BufferAttribute.call(this, e, t),
  41988. this.meshPerAttribute = i || 1
  41989. }
  41990. ,
  41991. n.InstancedBufferAttribute.prototype = Object.create(n.BufferAttribute.prototype),
  41992. n.InstancedBufferAttribute.prototype.constructor = n.InstancedBufferAttribute,
  41993. n.InstancedBufferAttribute.prototype.copy = function(e) {
  41994. return n.BufferAttribute.prototype.copy.call(this, e),
  41995. this.meshPerAttribute = e.meshPerAttribute,
  41996. this
  41997. }
  41998. ,
  41999. n.InterleavedBuffer = function(e, t) {
  42000. this.uuid = n.Math.generateUUID(),
  42001. this.array = e,
  42002. this.stride = t,
  42003. this.dynamic = !1,
  42004. this.updateRange = {
  42005. offset: 0,
  42006. count: -1
  42007. },
  42008. this.version = 0
  42009. }
  42010. ,
  42011. n.InterleavedBuffer.prototype = {
  42012. constructor: n.InterleavedBuffer,
  42013. get length() {
  42014. return this.array.length
  42015. },
  42016. get count() {
  42017. return this.array.length / this.stride
  42018. },
  42019. set needsUpdate(e) {
  42020. e === !0 && this.version++
  42021. },
  42022. setDynamic: function(e) {
  42023. return this.dynamic = e,
  42024. this
  42025. },
  42026. copy: function(e) {
  42027. return this.array = new e.array.constructor(e.array),
  42028. this.stride = e.stride,
  42029. this.dynamic = e.dynamic,
  42030. this
  42031. },
  42032. copyAt: function(e, t, i) {
  42033. e *= this.stride,
  42034. i *= t.stride;
  42035. for (var n = 0, r = this.stride; n < r; n++)
  42036. this.array[e + n] = t.array[i + n];
  42037. return this
  42038. },
  42039. set: function(e, t) {
  42040. return void 0 === t && (t = 0),
  42041. this.array.set(e, t),
  42042. this
  42043. },
  42044. clone: function() {
  42045. return (new this.constructor).copy(this)
  42046. }
  42047. },
  42048. n.InstancedInterleavedBuffer = function(e, t, i) {
  42049. n.InterleavedBuffer.call(this, e, t),
  42050. this.meshPerAttribute = i || 1
  42051. }
  42052. ,
  42053. n.InstancedInterleavedBuffer.prototype = Object.create(n.InterleavedBuffer.prototype),
  42054. n.InstancedInterleavedBuffer.prototype.constructor = n.InstancedInterleavedBuffer,
  42055. n.InstancedInterleavedBuffer.prototype.copy = function(e) {
  42056. return n.InterleavedBuffer.prototype.copy.call(this, e),
  42057. this.meshPerAttribute = e.meshPerAttribute,
  42058. this
  42059. }
  42060. ,
  42061. n.InterleavedBufferAttribute = function(e, t, i) {
  42062. this.uuid = n.Math.generateUUID(),
  42063. this.data = e,
  42064. this.itemSize = t,
  42065. this.offset = i
  42066. }
  42067. ,
  42068. n.InterleavedBufferAttribute.prototype = {
  42069. constructor: n.InterleavedBufferAttribute,
  42070. get length() {
  42071. return console.warn("THREE.BufferAttribute: .length has been deprecated. Please use .count."),
  42072. this.array.length
  42073. },
  42074. get count() {
  42075. return this.data.count
  42076. },
  42077. setX: function(e, t) {
  42078. return this.data.array[e * this.data.stride + this.offset] = t,
  42079. this
  42080. },
  42081. setY: function(e, t) {
  42082. return this.data.array[e * this.data.stride + this.offset + 1] = t,
  42083. this
  42084. },
  42085. setZ: function(e, t) {
  42086. return this.data.array[e * this.data.stride + this.offset + 2] = t,
  42087. this
  42088. },
  42089. setW: function(e, t) {
  42090. return this.data.array[e * this.data.stride + this.offset + 3] = t,
  42091. this
  42092. },
  42093. getX: function(e) {
  42094. return this.data.array[e * this.data.stride + this.offset]
  42095. },
  42096. getY: function(e) {
  42097. return this.data.array[e * this.data.stride + this.offset + 1]
  42098. },
  42099. getZ: function(e) {
  42100. return this.data.array[e * this.data.stride + this.offset + 2]
  42101. },
  42102. getW: function(e) {
  42103. return this.data.array[e * this.data.stride + this.offset + 3]
  42104. },
  42105. setXY: function(e, t, i) {
  42106. return e = e * this.data.stride + this.offset,
  42107. this.data.array[e + 0] = t,
  42108. this.data.array[e + 1] = i,
  42109. this
  42110. },
  42111. setXYZ: function(e, t, i, n) {
  42112. return e = e * this.data.stride + this.offset,
  42113. this.data.array[e + 0] = t,
  42114. this.data.array[e + 1] = i,
  42115. this.data.array[e + 2] = n,
  42116. this
  42117. },
  42118. setXYZW: function(e, t, i, n, r) {
  42119. return e = e * this.data.stride + this.offset,
  42120. this.data.array[e + 0] = t,
  42121. this.data.array[e + 1] = i,
  42122. this.data.array[e + 2] = n,
  42123. this.data.array[e + 3] = r,
  42124. this
  42125. }
  42126. },
  42127. n.Geometry = function() {
  42128. Object.defineProperty(this, "id", {
  42129. value: n.GeometryIdCount++
  42130. }),
  42131. this.uuid = n.Math.generateUUID(),
  42132. this.name = "",
  42133. this.type = "Geometry",
  42134. this.vertices = [],
  42135. this.colors = [],
  42136. this.faces = [],
  42137. this.faceVertexUvs = [[]],
  42138. this.morphTargets = [],
  42139. this.morphNormals = [],
  42140. this.skinWeights = [],
  42141. this.skinIndices = [],
  42142. this.lineDistances = [],
  42143. this.boundingBox = null,
  42144. this.boundingSphere = null,
  42145. this.verticesNeedUpdate = !1,
  42146. this.elementsNeedUpdate = !1,
  42147. this.uvsNeedUpdate = !1,
  42148. this.normalsNeedUpdate = !1,
  42149. this.colorsNeedUpdate = !1,
  42150. this.lineDistancesNeedUpdate = !1,
  42151. this.groupsNeedUpdate = !1
  42152. }
  42153. ,
  42154. n.Geometry.prototype = {
  42155. constructor: n.Geometry,
  42156. applyMatrix: function(e) {
  42157. for (var t = (new n.Matrix3).getNormalMatrix(e), i = 0, r = this.vertices.length; i < r; i++) {
  42158. var o = this.vertices[i];
  42159. o.applyMatrix4(e)
  42160. }
  42161. for (var i = 0, r = this.faces.length; i < r; i++) {
  42162. var a = this.faces[i];
  42163. a.normal.applyMatrix3(t).normalize();
  42164. for (var s = 0, l = a.vertexNormals.length; s < l; s++)
  42165. a.vertexNormals[s].applyMatrix3(t).normalize()
  42166. }
  42167. return null !== this.boundingBox && this.computeBoundingBox(),
  42168. null !== this.boundingSphere && this.computeBoundingSphere(),
  42169. this.verticesNeedUpdate = !0,
  42170. this.normalsNeedUpdate = !0,
  42171. this
  42172. },
  42173. rotateX: function() {
  42174. var e;
  42175. return function(t) {
  42176. return void 0 === e && (e = new n.Matrix4),
  42177. e.makeRotationX(t),
  42178. this.applyMatrix(e),
  42179. this
  42180. }
  42181. }(),
  42182. rotateY: function() {
  42183. var e;
  42184. return function(t) {
  42185. return void 0 === e && (e = new n.Matrix4),
  42186. e.makeRotationY(t),
  42187. this.applyMatrix(e),
  42188. this
  42189. }
  42190. }(),
  42191. rotateZ: function() {
  42192. var e;
  42193. return function(t) {
  42194. return void 0 === e && (e = new n.Matrix4),
  42195. e.makeRotationZ(t),
  42196. this.applyMatrix(e),
  42197. this
  42198. }
  42199. }(),
  42200. translate: function() {
  42201. var e;
  42202. return function(t, i, r) {
  42203. return void 0 === e && (e = new n.Matrix4),
  42204. e.makeTranslation(t, i, r),
  42205. this.applyMatrix(e),
  42206. this
  42207. }
  42208. }(),
  42209. scale: function() {
  42210. var e;
  42211. return function(t, i, r) {
  42212. return void 0 === e && (e = new n.Matrix4),
  42213. e.makeScale(t, i, r),
  42214. this.applyMatrix(e),
  42215. this
  42216. }
  42217. }(),
  42218. lookAt: function() {
  42219. var e;
  42220. return function(t) {
  42221. void 0 === e && (e = new n.Object3D),
  42222. e.lookAt(t),
  42223. e.updateMatrix(),
  42224. this.applyMatrix(e.matrix)
  42225. }
  42226. }(),
  42227. fromBufferGeometry: function(e) {
  42228. function t(e, t, r, o) {
  42229. var a = void 0 !== s ? [u[e].clone(), u[t].clone(), u[r].clone()] : []
  42230. , f = void 0 !== l ? [i.colors[e].clone(), i.colors[t].clone(), i.colors[r].clone()] : []
  42231. , g = new n.Face3(e,t,r,a,f,o);
  42232. i.faces.push(g),
  42233. void 0 !== c && i.faceVertexUvs[0].push([d[e].clone(), d[t].clone(), d[r].clone()]),
  42234. void 0 !== h && i.faceVertexUvs[1].push([p[e].clone(), p[t].clone(), p[r].clone()])
  42235. }
  42236. var i = this
  42237. , r = null !== e.index ? e.index.array : void 0
  42238. , o = e.attributes
  42239. , a = o.position.array
  42240. , s = void 0 !== o.normal ? o.normal.array : void 0
  42241. , l = void 0 !== o.color ? o.color.array : void 0
  42242. , c = void 0 !== o.uv ? o.uv.array : void 0
  42243. , h = void 0 !== o.uv2 ? o.uv2.array : void 0;
  42244. void 0 !== h && (this.faceVertexUvs[1] = []);
  42245. for (var u = [], d = [], p = [], f = 0, g = 0; f < a.length; f += 3,
  42246. g += 2)
  42247. i.vertices.push(new n.Vector3(a[f],a[f + 1],a[f + 2])),
  42248. void 0 !== s && u.push(new n.Vector3(s[f],s[f + 1],s[f + 2])),
  42249. void 0 !== l && i.colors.push(new n.Color(l[f],l[f + 1],l[f + 2])),
  42250. void 0 !== c && d.push(new n.Vector2(c[g],c[g + 1])),
  42251. void 0 !== h && p.push(new n.Vector2(h[g],h[g + 1]));
  42252. if (void 0 !== r) {
  42253. var m = e.groups;
  42254. if (m.length > 0)
  42255. for (var f = 0; f < m.length; f++)
  42256. for (var v = m[f], A = v.start, y = v.count, g = A, C = A + y; g < C; g += 3)
  42257. t(r[g], r[g + 1], r[g + 2], v.materialIndex);
  42258. else
  42259. for (var f = 0; f < r.length; f += 3)
  42260. t(r[f], r[f + 1], r[f + 2])
  42261. } else
  42262. for (var f = 0; f < a.length / 3; f += 3)
  42263. t(f, f + 1, f + 2);
  42264. return this.computeFaceNormals(),
  42265. null !== e.boundingBox && (this.boundingBox = e.boundingBox.clone()),
  42266. null !== e.boundingSphere && (this.boundingSphere = e.boundingSphere.clone()),
  42267. this
  42268. },
  42269. center: function() {
  42270. this.computeBoundingBox();
  42271. var e = this.boundingBox.center().negate();
  42272. return this.translate(e.x, e.y, e.z),
  42273. e
  42274. },
  42275. normalize: function() {
  42276. this.computeBoundingSphere();
  42277. var e = this.boundingSphere.center
  42278. , t = this.boundingSphere.radius
  42279. , i = 0 === t ? 1 : 1 / t
  42280. , r = new n.Matrix4;
  42281. 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),
  42282. this.applyMatrix(r),
  42283. this
  42284. },
  42285. computeFaceNormals: function() {
  42286. for (var e = new n.Vector3, t = new n.Vector3, i = 0, r = this.faces.length; i < r; i++) {
  42287. var o = this.faces[i]
  42288. , a = this.vertices[o.a]
  42289. , s = this.vertices[o.b]
  42290. , l = this.vertices[o.c];
  42291. e.subVectors(l, s),
  42292. t.subVectors(a, s),
  42293. e.cross(t),
  42294. e.normalize(),
  42295. o.normal.copy(e)
  42296. }
  42297. },
  42298. computeVertexNormals: function(e) {
  42299. void 0 === e && (e = !0);
  42300. var t, i, r, o, a, s;
  42301. for (s = new Array(this.vertices.length),
  42302. t = 0,
  42303. i = this.vertices.length; t < i; t++)
  42304. s[t] = new n.Vector3;
  42305. if (e) {
  42306. var l, c, h, u = new n.Vector3, d = new n.Vector3;
  42307. for (r = 0,
  42308. o = this.faces.length; r < o; r++)
  42309. a = this.faces[r],
  42310. l = this.vertices[a.a],
  42311. c = this.vertices[a.b],
  42312. h = this.vertices[a.c],
  42313. u.subVectors(h, c),
  42314. d.subVectors(l, c),
  42315. u.cross(d),
  42316. s[a.a].add(u),
  42317. s[a.b].add(u),
  42318. s[a.c].add(u)
  42319. } else
  42320. for (r = 0,
  42321. o = this.faces.length; r < o; r++)
  42322. a = this.faces[r],
  42323. s[a.a].add(a.normal),
  42324. s[a.b].add(a.normal),
  42325. s[a.c].add(a.normal);
  42326. for (t = 0,
  42327. i = this.vertices.length; t < i; t++)
  42328. s[t].normalize();
  42329. for (r = 0,
  42330. o = this.faces.length; r < o; r++) {
  42331. a = this.faces[r];
  42332. var p = a.vertexNormals;
  42333. 3 === p.length ? (p[0].copy(s[a.a]),
  42334. p[1].copy(s[a.b]),
  42335. p[2].copy(s[a.c])) : (p[0] = s[a.a].clone(),
  42336. p[1] = s[a.b].clone(),
  42337. p[2] = s[a.c].clone())
  42338. }
  42339. this.faces.length > 0 && (this.normalsNeedUpdate = !0)
  42340. },
  42341. computeMorphNormals: function() {
  42342. var e, t, i, r, o;
  42343. for (i = 0,
  42344. r = this.faces.length; i < r; i++)
  42345. for (o = this.faces[i],
  42346. o.__originalFaceNormal ? o.__originalFaceNormal.copy(o.normal) : o.__originalFaceNormal = o.normal.clone(),
  42347. o.__originalVertexNormals || (o.__originalVertexNormals = []),
  42348. e = 0,
  42349. t = o.vertexNormals.length; e < t; e++)
  42350. o.__originalVertexNormals[e] ? o.__originalVertexNormals[e].copy(o.vertexNormals[e]) : o.__originalVertexNormals[e] = o.vertexNormals[e].clone();
  42351. var a = new n.Geometry;
  42352. for (a.faces = this.faces,
  42353. e = 0,
  42354. t = this.morphTargets.length; e < t; e++) {
  42355. if (!this.morphNormals[e]) {
  42356. this.morphNormals[e] = {},
  42357. this.morphNormals[e].faceNormals = [],
  42358. this.morphNormals[e].vertexNormals = [];
  42359. var s, l, c = this.morphNormals[e].faceNormals, h = this.morphNormals[e].vertexNormals;
  42360. for (i = 0,
  42361. r = this.faces.length; i < r; i++)
  42362. s = new n.Vector3,
  42363. l = {
  42364. a: new n.Vector3,
  42365. b: new n.Vector3,
  42366. c: new n.Vector3
  42367. },
  42368. c.push(s),
  42369. h.push(l)
  42370. }
  42371. var u = this.morphNormals[e];
  42372. a.vertices = this.morphTargets[e].vertices,
  42373. a.computeFaceNormals(),
  42374. a.computeVertexNormals();
  42375. var s, l;
  42376. for (i = 0,
  42377. r = this.faces.length; i < r; i++)
  42378. o = this.faces[i],
  42379. s = u.faceNormals[i],
  42380. l = u.vertexNormals[i],
  42381. s.copy(o.normal),
  42382. l.a.copy(o.vertexNormals[0]),
  42383. l.b.copy(o.vertexNormals[1]),
  42384. l.c.copy(o.vertexNormals[2])
  42385. }
  42386. for (i = 0,
  42387. r = this.faces.length; i < r; i++)
  42388. o = this.faces[i],
  42389. o.normal = o.__originalFaceNormal,
  42390. o.vertexNormals = o.__originalVertexNormals
  42391. },
  42392. computeTangents: function() {
  42393. console.warn("THREE.Geometry: .computeTangents() has been removed.")
  42394. },
  42395. computeLineDistances: function() {
  42396. for (var e = 0, t = this.vertices, i = 0, n = t.length; i < n; i++)
  42397. i > 0 && (e += t[i].distanceTo(t[i - 1])),
  42398. this.lineDistances[i] = e
  42399. },
  42400. computeBoundingBox: function() {
  42401. null === this.boundingBox && (this.boundingBox = new n.Box3),
  42402. this.boundingBox.setFromPoints(this.vertices)
  42403. },
  42404. computeBoundingSphere: function() {
  42405. null === this.boundingSphere && (this.boundingSphere = new n.Sphere),
  42406. this.boundingSphere.setFromPoints(this.vertices)
  42407. },
  42408. merge: function(e, t, i) {
  42409. if (e instanceof n.Geometry == !1)
  42410. return void console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.", e);
  42411. 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];
  42412. void 0 === i && (i = 0),
  42413. void 0 !== t && (r = (new n.Matrix3).getNormalMatrix(t));
  42414. for (var d = 0, p = s.length; d < p; d++) {
  42415. var f = s[d]
  42416. , g = f.clone();
  42417. void 0 !== t && g.applyMatrix4(t),
  42418. a.push(g)
  42419. }
  42420. for (d = 0,
  42421. p = c.length; d < p; d++) {
  42422. var m, v, A, y = c[d], C = y.vertexNormals, I = y.vertexColors;
  42423. m = new n.Face3(y.a + o,y.b + o,y.c + o),
  42424. m.normal.copy(y.normal),
  42425. void 0 !== r && m.normal.applyMatrix3(r).normalize();
  42426. for (var E = 0, b = C.length; E < b; E++)
  42427. v = C[E].clone(),
  42428. void 0 !== r && v.applyMatrix3(r).normalize(),
  42429. m.vertexNormals.push(v);
  42430. m.color.copy(y.color);
  42431. for (var E = 0, b = I.length; E < b; E++)
  42432. A = I[E],
  42433. m.vertexColors.push(A.clone());
  42434. m.materialIndex = y.materialIndex + i,
  42435. l.push(m)
  42436. }
  42437. for (d = 0,
  42438. p = u.length; d < p; d++) {
  42439. var w = u[d]
  42440. , _ = [];
  42441. if (void 0 !== w) {
  42442. for (var E = 0, b = w.length; E < b; E++)
  42443. _.push(w[E].clone());
  42444. h.push(_)
  42445. }
  42446. }
  42447. },
  42448. mergeMesh: function(e) {
  42449. return e instanceof n.Mesh == !1 ? void console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.", e) : (e.matrixAutoUpdate && e.updateMatrix(),
  42450. void this.merge(e.geometry, e.matrix))
  42451. },
  42452. mergeVertices: function() {
  42453. var e, t, i, n, r, o, a, s, l = {}, c = [], h = [], u = 4, d = Math.pow(10, u);
  42454. for (i = 0,
  42455. n = this.vertices.length; i < n; i++)
  42456. e = this.vertices[i],
  42457. t = Math.round(e.x * d) + "_" + Math.round(e.y * d) + "_" + Math.round(e.z * d),
  42458. void 0 === l[t] ? (l[t] = i,
  42459. c.push(this.vertices[i]),
  42460. h[i] = c.length - 1) : h[i] = h[l[t]];
  42461. var p = [];
  42462. for (i = 0,
  42463. n = this.faces.length; i < n; i++) {
  42464. r = this.faces[i],
  42465. r.a = h[r.a],
  42466. r.b = h[r.b],
  42467. r.c = h[r.c],
  42468. o = [r.a, r.b, r.c];
  42469. for (var f = -1, g = 0; g < 3; g++)
  42470. if (o[g] === o[(g + 1) % 3]) {
  42471. f = g,
  42472. p.push(i);
  42473. break
  42474. }
  42475. }
  42476. for (i = p.length - 1; i >= 0; i--) {
  42477. var m = p[i];
  42478. for (this.faces.splice(m, 1),
  42479. a = 0,
  42480. s = this.faceVertexUvs.length; a < s; a++)
  42481. this.faceVertexUvs[a].splice(m, 1)
  42482. }
  42483. var v = this.vertices.length - c.length;
  42484. return this.vertices = c,
  42485. v
  42486. },
  42487. sortFacesByMaterialIndex: function() {
  42488. function e(e, t) {
  42489. return e.materialIndex - t.materialIndex
  42490. }
  42491. for (var t = this.faces, i = t.length, n = 0; n < i; n++)
  42492. t[n]._id = n;
  42493. t.sort(e);
  42494. var r, o, a = this.faceVertexUvs[0], s = this.faceVertexUvs[1];
  42495. a && a.length === i && (r = []),
  42496. s && s.length === i && (o = []);
  42497. for (var n = 0; n < i; n++) {
  42498. var l = t[n]._id;
  42499. r && r.push(a[l]),
  42500. o && o.push(s[l])
  42501. }
  42502. r && (this.faceVertexUvs[0] = r),
  42503. o && (this.faceVertexUvs[1] = o)
  42504. },
  42505. toJSON: function() {
  42506. function e(e, t, i) {
  42507. return i ? e | 1 << t : e & ~(1 << t)
  42508. }
  42509. function t(e) {
  42510. var t = e.x.toString() + e.y.toString() + e.z.toString();
  42511. return void 0 !== d[t] ? d[t] : (d[t] = u.length / 3,
  42512. u.push(e.x, e.y, e.z),
  42513. d[t])
  42514. }
  42515. function i(e) {
  42516. var t = e.r.toString() + e.g.toString() + e.b.toString();
  42517. return void 0 !== f[t] ? f[t] : (f[t] = p.length,
  42518. p.push(e.getHex()),
  42519. f[t])
  42520. }
  42521. function n(e) {
  42522. var t = e.x.toString() + e.y.toString();
  42523. return void 0 !== m[t] ? m[t] : (m[t] = g.length / 2,
  42524. g.push(e.x, e.y),
  42525. m[t])
  42526. }
  42527. var r = {
  42528. metadata: {
  42529. version: 4.4,
  42530. type: "Geometry",
  42531. generator: "Geometry.toJSON"
  42532. }
  42533. };
  42534. if (r.uuid = this.uuid,
  42535. r.type = this.type,
  42536. "" !== this.name && (r.name = this.name),
  42537. void 0 !== this.parameters) {
  42538. var o = this.parameters;
  42539. for (var a in o)
  42540. void 0 !== o[a] && (r[a] = o[a]);
  42541. return r
  42542. }
  42543. for (var s = [], l = 0; l < this.vertices.length; l++) {
  42544. var c = this.vertices[l];
  42545. s.push(c.x, c.y, c.z)
  42546. }
  42547. for (var h = [], u = [], d = {}, p = [], f = {}, g = [], m = {}, l = 0; l < this.faces.length; l++) {
  42548. var v = this.faces[l]
  42549. , A = !0
  42550. , y = !1
  42551. , C = void 0 !== this.faceVertexUvs[0][l]
  42552. , I = v.normal.length() > 0
  42553. , E = v.vertexNormals.length > 0
  42554. , b = 1 !== v.color.r || 1 !== v.color.g || 1 !== v.color.b
  42555. , w = v.vertexColors.length > 0
  42556. , _ = 0;
  42557. if (_ = e(_, 0, 0),
  42558. _ = e(_, 1, A),
  42559. _ = e(_, 2, y),
  42560. _ = e(_, 3, C),
  42561. _ = e(_, 4, I),
  42562. _ = e(_, 5, E),
  42563. _ = e(_, 6, b),
  42564. _ = e(_, 7, w),
  42565. h.push(_),
  42566. h.push(v.a, v.b, v.c),
  42567. h.push(v.materialIndex),
  42568. C) {
  42569. var T = this.faceVertexUvs[0][l];
  42570. h.push(n(T[0]), n(T[1]), n(T[2]))
  42571. }
  42572. if (I && h.push(t(v.normal)),
  42573. E) {
  42574. var x = v.vertexNormals;
  42575. h.push(t(x[0]), t(x[1]), t(x[2]))
  42576. }
  42577. if (b && h.push(i(v.color)),
  42578. w) {
  42579. var S = v.vertexColors;
  42580. h.push(i(S[0]), i(S[1]), i(S[2]))
  42581. }
  42582. }
  42583. return r.data = {},
  42584. r.data.vertices = s,
  42585. r.data.normals = u,
  42586. p.length > 0 && (r.data.colors = p),
  42587. g.length > 0 && (r.data.uvs = [g]),
  42588. r.data.faces = h,
  42589. r
  42590. },
  42591. clone: function() {
  42592. return (new n.Geometry).copy(this)
  42593. },
  42594. copy: function(e) {
  42595. this.vertices = [],
  42596. this.faces = [],
  42597. this.faceVertexUvs = [[]];
  42598. for (var t = e.vertices, i = 0, n = t.length; i < n; i++)
  42599. this.vertices.push(t[i].clone());
  42600. for (var r = e.faces, i = 0, n = r.length; i < n; i++)
  42601. this.faces.push(r[i].clone());
  42602. for (var i = 0, n = e.faceVertexUvs.length; i < n; i++) {
  42603. var o = e.faceVertexUvs[i];
  42604. void 0 === this.faceVertexUvs[i] && (this.faceVertexUvs[i] = []);
  42605. for (var a = 0, s = o.length; a < s; a++) {
  42606. for (var l = o[a], c = [], h = 0, u = l.length; h < u; h++) {
  42607. var d = l[h];
  42608. c.push(d.clone())
  42609. }
  42610. this.faceVertexUvs[i].push(c)
  42611. }
  42612. }
  42613. return this
  42614. },
  42615. dispose: function() {
  42616. this.dispatchEvent({
  42617. type: "dispose"
  42618. })
  42619. }
  42620. },
  42621. n.EventDispatcher.prototype.apply(n.Geometry.prototype),
  42622. n.GeometryIdCount = 0,
  42623. n.DirectGeometry = function() {
  42624. Object.defineProperty(this, "id", {
  42625. value: n.GeometryIdCount++
  42626. }),
  42627. this.uuid = n.Math.generateUUID(),
  42628. this.name = "",
  42629. this.type = "DirectGeometry",
  42630. this.indices = [],
  42631. this.vertices = [],
  42632. this.normals = [],
  42633. this.colors = [],
  42634. this.uvs = [],
  42635. this.uvs2 = [],
  42636. this.groups = [],
  42637. this.morphTargets = {},
  42638. this.skinWeights = [],
  42639. this.skinIndices = [],
  42640. this.boundingBox = null,
  42641. this.boundingSphere = null,
  42642. this.verticesNeedUpdate = !1,
  42643. this.normalsNeedUpdate = !1,
  42644. this.colorsNeedUpdate = !1,
  42645. this.uvsNeedUpdate = !1,
  42646. this.groupsNeedUpdate = !1
  42647. }
  42648. ,
  42649. n.DirectGeometry.prototype = {
  42650. constructor: n.DirectGeometry,
  42651. computeBoundingBox: n.Geometry.prototype.computeBoundingBox,
  42652. computeBoundingSphere: n.Geometry.prototype.computeBoundingSphere,
  42653. computeFaceNormals: function() {
  42654. console.warn("THREE.DirectGeometry: computeFaceNormals() is not a method of this type of geometry.")
  42655. },
  42656. computeVertexNormals: function() {
  42657. console.warn("THREE.DirectGeometry: computeVertexNormals() is not a method of this type of geometry.")
  42658. },
  42659. computeGroups: function(e) {
  42660. for (var t, i, n = [], r = e.faces, o = 0; o < r.length; o++) {
  42661. var a = r[o];
  42662. a.materialIndex !== i && (i = a.materialIndex,
  42663. void 0 !== t && (t.count = 3 * o - t.start,
  42664. n.push(t)),
  42665. t = {
  42666. start: 3 * o,
  42667. materialIndex: i
  42668. })
  42669. }
  42670. void 0 !== t && (t.count = 3 * o - t.start,
  42671. n.push(t)),
  42672. this.groups = n
  42673. },
  42674. fromGeometry: function(e) {
  42675. 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;
  42676. if (c > 0) {
  42677. t = [];
  42678. for (var h = 0; h < c; h++)
  42679. t[h] = [];
  42680. this.morphTargets.position = t
  42681. }
  42682. var u, d = e.morphNormals, p = d.length;
  42683. if (p > 0) {
  42684. u = [];
  42685. for (var h = 0; h < p; h++)
  42686. u[h] = [];
  42687. this.morphTargets.normal = u
  42688. }
  42689. for (var f = e.skinIndices, g = e.skinWeights, m = f.length === r.length, v = g.length === r.length, h = 0; h < i.length; h++) {
  42690. var A = i[h];
  42691. this.vertices.push(r[A.a], r[A.b], r[A.c]);
  42692. var y = A.vertexNormals;
  42693. if (3 === y.length)
  42694. this.normals.push(y[0], y[1], y[2]);
  42695. else {
  42696. var C = A.normal;
  42697. this.normals.push(C, C, C)
  42698. }
  42699. var I = A.vertexColors;
  42700. if (3 === I.length)
  42701. this.colors.push(I[0], I[1], I[2]);
  42702. else {
  42703. var E = A.color;
  42704. this.colors.push(E, E, E)
  42705. }
  42706. if (a === !0) {
  42707. var b = o[0][h];
  42708. void 0 !== b ? this.uvs.push(b[0], b[1], b[2]) : (console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ", h),
  42709. this.uvs.push(new n.Vector2, new n.Vector2, new n.Vector2))
  42710. }
  42711. if (s === !0) {
  42712. var b = o[1][h];
  42713. void 0 !== b ? this.uvs2.push(b[0], b[1], b[2]) : (console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ", h),
  42714. this.uvs2.push(new n.Vector2, new n.Vector2, new n.Vector2))
  42715. }
  42716. for (var w = 0; w < c; w++) {
  42717. var _ = l[w].vertices;
  42718. t[w].push(_[A.a], _[A.b], _[A.c])
  42719. }
  42720. for (var w = 0; w < p; w++) {
  42721. var T = d[w].vertexNormals[h];
  42722. u[w].push(T.a, T.b, T.c)
  42723. }
  42724. m && this.skinIndices.push(f[A.a], f[A.b], f[A.c]),
  42725. v && this.skinWeights.push(g[A.a], g[A.b], g[A.c])
  42726. }
  42727. return this.computeGroups(e),
  42728. this.verticesNeedUpdate = e.verticesNeedUpdate,
  42729. this.normalsNeedUpdate = e.normalsNeedUpdate,
  42730. this.colorsNeedUpdate = e.colorsNeedUpdate,
  42731. this.uvsNeedUpdate = e.uvsNeedUpdate,
  42732. this.groupsNeedUpdate = e.groupsNeedUpdate,
  42733. this
  42734. },
  42735. dispose: function() {
  42736. this.dispatchEvent({
  42737. type: "dispose"
  42738. })
  42739. }
  42740. },
  42741. n.EventDispatcher.prototype.apply(n.DirectGeometry.prototype),
  42742. n.BufferGeometry = function() {
  42743. Object.defineProperty(this, "id", {
  42744. value: n.GeometryIdCount++
  42745. }),
  42746. this.uuid = n.Math.generateUUID(),
  42747. this.name = "",
  42748. this.type = "BufferGeometry",
  42749. this.index = null,
  42750. this.attributes = {},
  42751. this.morphAttributes = {},
  42752. this.groups = [],
  42753. this.boundingBox = null,
  42754. this.boundingSphere = null,
  42755. this.drawRange = {
  42756. start: 0,
  42757. count: 1 / 0
  42758. }
  42759. }
  42760. ,
  42761. n.BufferGeometry.prototype = {
  42762. constructor: n.BufferGeometry,
  42763. getIndex: function() {
  42764. return this.index
  42765. },
  42766. setIndex: function(e) {
  42767. this.index = e
  42768. },
  42769. addAttribute: function(e, t) {
  42770. return t instanceof n.BufferAttribute == !1 && t instanceof n.InterleavedBufferAttribute == !1 ? (console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),
  42771. void this.addAttribute(e, new n.BufferAttribute(arguments[1],arguments[2]))) : "index" === e ? (console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),
  42772. void this.setIndex(t)) : (this.attributes[e] = t,
  42773. this)
  42774. },
  42775. getAttribute: function(e) {
  42776. return this.attributes[e]
  42777. },
  42778. removeAttribute: function(e) {
  42779. return delete this.attributes[e],
  42780. this
  42781. },
  42782. addGroup: function(e, t, i) {
  42783. this.groups.push({
  42784. start: e,
  42785. count: t,
  42786. materialIndex: void 0 !== i ? i : 0
  42787. })
  42788. },
  42789. clearGroups: function() {
  42790. this.groups = []
  42791. },
  42792. setDrawRange: function(e, t) {
  42793. this.drawRange.start = e,
  42794. this.drawRange.count = t
  42795. },
  42796. applyMatrix: function(e) {
  42797. var t = this.attributes.position;
  42798. void 0 !== t && (e.applyToVector3Array(t.array),
  42799. t.needsUpdate = !0);
  42800. var i = this.attributes.normal;
  42801. if (void 0 !== i) {
  42802. var r = (new n.Matrix3).getNormalMatrix(e);
  42803. r.applyToVector3Array(i.array),
  42804. i.needsUpdate = !0
  42805. }
  42806. return null !== this.boundingBox && this.computeBoundingBox(),
  42807. null !== this.boundingSphere && this.computeBoundingSphere(),
  42808. this
  42809. },
  42810. rotateX: function() {
  42811. var e;
  42812. return function(t) {
  42813. return void 0 === e && (e = new n.Matrix4),
  42814. e.makeRotationX(t),
  42815. this.applyMatrix(e),
  42816. this
  42817. }
  42818. }(),
  42819. rotateY: function() {
  42820. var e;
  42821. return function(t) {
  42822. return void 0 === e && (e = new n.Matrix4),
  42823. e.makeRotationY(t),
  42824. this.applyMatrix(e),
  42825. this
  42826. }
  42827. }(),
  42828. rotateZ: function() {
  42829. var e;
  42830. return function(t) {
  42831. return void 0 === e && (e = new n.Matrix4),
  42832. e.makeRotationZ(t),
  42833. this.applyMatrix(e),
  42834. this
  42835. }
  42836. }(),
  42837. translate: function() {
  42838. var e;
  42839. return function(t, i, r) {
  42840. return void 0 === e && (e = new n.Matrix4),
  42841. e.makeTranslation(t, i, r),
  42842. this.applyMatrix(e),
  42843. this
  42844. }
  42845. }(),
  42846. scale: function() {
  42847. var e;
  42848. return function(t, i, r) {
  42849. return void 0 === e && (e = new n.Matrix4),
  42850. e.makeScale(t, i, r),
  42851. this.applyMatrix(e),
  42852. this
  42853. }
  42854. }(),
  42855. lookAt: function() {
  42856. var e;
  42857. return function(t) {
  42858. void 0 === e && (e = new n.Object3D),
  42859. e.lookAt(t),
  42860. e.updateMatrix(),
  42861. this.applyMatrix(e.matrix)
  42862. }
  42863. }(),
  42864. center: function() {
  42865. this.computeBoundingBox();
  42866. var e = this.boundingBox.center().negate();
  42867. return this.translate(e.x, e.y, e.z),
  42868. e
  42869. },
  42870. setFromObject: function(e) {
  42871. var t = e.geometry;
  42872. if (e instanceof n.Points || e instanceof n.Line) {
  42873. var i = new n.Float32Attribute(3 * t.vertices.length,3)
  42874. , r = new n.Float32Attribute(3 * t.colors.length,3);
  42875. if (this.addAttribute("position", i.copyVector3sArray(t.vertices)),
  42876. this.addAttribute("color", r.copyColorsArray(t.colors)),
  42877. t.lineDistances && t.lineDistances.length === t.vertices.length) {
  42878. var o = new n.Float32Attribute(t.lineDistances.length,1);
  42879. this.addAttribute("lineDistance", o.copyArray(t.lineDistances))
  42880. }
  42881. null !== t.boundingSphere && (this.boundingSphere = t.boundingSphere.clone()),
  42882. null !== t.boundingBox && (this.boundingBox = t.boundingBox.clone())
  42883. } else
  42884. e instanceof n.Mesh && t instanceof n.Geometry && this.fromGeometry(t);
  42885. return this
  42886. },
  42887. updateFromObject: function(e) {
  42888. var t = e.geometry;
  42889. if (e instanceof n.Mesh) {
  42890. var i = t.__directGeometry;
  42891. if (void 0 === i)
  42892. return this.fromGeometry(t);
  42893. i.verticesNeedUpdate = t.verticesNeedUpdate,
  42894. i.normalsNeedUpdate = t.normalsNeedUpdate,
  42895. i.colorsNeedUpdate = t.colorsNeedUpdate,
  42896. i.uvsNeedUpdate = t.uvsNeedUpdate,
  42897. i.groupsNeedUpdate = t.groupsNeedUpdate,
  42898. t.verticesNeedUpdate = !1,
  42899. t.normalsNeedUpdate = !1,
  42900. t.colorsNeedUpdate = !1,
  42901. t.uvsNeedUpdate = !1,
  42902. t.groupsNeedUpdate = !1,
  42903. t = i
  42904. }
  42905. if (t.verticesNeedUpdate === !0) {
  42906. var r = this.attributes.position;
  42907. void 0 !== r && (r.copyVector3sArray(t.vertices),
  42908. r.needsUpdate = !0),
  42909. t.verticesNeedUpdate = !1
  42910. }
  42911. if (t.normalsNeedUpdate === !0) {
  42912. var r = this.attributes.normal;
  42913. void 0 !== r && (r.copyVector3sArray(t.normals),
  42914. r.needsUpdate = !0),
  42915. t.normalsNeedUpdate = !1
  42916. }
  42917. if (t.colorsNeedUpdate === !0) {
  42918. var r = this.attributes.color;
  42919. void 0 !== r && (r.copyColorsArray(t.colors),
  42920. r.needsUpdate = !0),
  42921. t.colorsNeedUpdate = !1
  42922. }
  42923. if (t.uvsNeedUpdate) {
  42924. var r = this.attributes.uv;
  42925. void 0 !== r && (r.copyVector2sArray(t.uvs),
  42926. r.needsUpdate = !0),
  42927. t.uvsNeedUpdate = !1
  42928. }
  42929. if (t.lineDistancesNeedUpdate) {
  42930. var r = this.attributes.lineDistance;
  42931. void 0 !== r && (r.copyArray(t.lineDistances),
  42932. r.needsUpdate = !0),
  42933. t.lineDistancesNeedUpdate = !1
  42934. }
  42935. return t.groupsNeedUpdate && (t.computeGroups(e.geometry),
  42936. this.groups = t.groups,
  42937. t.groupsNeedUpdate = !1),
  42938. this
  42939. },
  42940. fromGeometry: function(e) {
  42941. return e.__directGeometry = (new n.DirectGeometry).fromGeometry(e),
  42942. this.fromDirectGeometry(e.__directGeometry)
  42943. },
  42944. fromDirectGeometry: function(e) {
  42945. var t = new Float32Array(3 * e.vertices.length);
  42946. if (this.addAttribute("position", new n.BufferAttribute(t,3).copyVector3sArray(e.vertices)),
  42947. e.normals.length > 0) {
  42948. var i = new Float32Array(3 * e.normals.length);
  42949. this.addAttribute("normal", new n.BufferAttribute(i,3).copyVector3sArray(e.normals))
  42950. }
  42951. if (e.colors.length > 0) {
  42952. var r = new Float32Array(3 * e.colors.length);
  42953. this.addAttribute("color", new n.BufferAttribute(r,3).copyColorsArray(e.colors))
  42954. }
  42955. if (e.uvs.length > 0) {
  42956. var o = new Float32Array(2 * e.uvs.length);
  42957. this.addAttribute("uv", new n.BufferAttribute(o,2).copyVector2sArray(e.uvs))
  42958. }
  42959. if (e.uvs2.length > 0) {
  42960. var a = new Float32Array(2 * e.uvs2.length);
  42961. this.addAttribute("uv2", new n.BufferAttribute(a,2).copyVector2sArray(e.uvs2))
  42962. }
  42963. if (e.indices.length > 0) {
  42964. var s = e.vertices.length > 65535 ? Uint32Array : Uint16Array
  42965. , l = new s(3 * e.indices.length);
  42966. this.setIndex(new n.BufferAttribute(l,1).copyIndicesArray(e.indices))
  42967. }
  42968. this.groups = e.groups;
  42969. for (var c in e.morphTargets) {
  42970. for (var h = [], u = e.morphTargets[c], d = 0, p = u.length; d < p; d++) {
  42971. var f = u[d]
  42972. , g = new n.Float32Attribute(3 * f.length,3);
  42973. h.push(g.copyVector3sArray(f))
  42974. }
  42975. this.morphAttributes[c] = h
  42976. }
  42977. if (e.skinIndices.length > 0) {
  42978. var m = new n.Float32Attribute(4 * e.skinIndices.length,4);
  42979. this.addAttribute("skinIndex", m.copyVector4sArray(e.skinIndices))
  42980. }
  42981. if (e.skinWeights.length > 0) {
  42982. var v = new n.Float32Attribute(4 * e.skinWeights.length,4);
  42983. this.addAttribute("skinWeight", v.copyVector4sArray(e.skinWeights))
  42984. }
  42985. return null !== e.boundingSphere && (this.boundingSphere = e.boundingSphere.clone()),
  42986. null !== e.boundingBox && (this.boundingBox = e.boundingBox.clone()),
  42987. this
  42988. },
  42989. computeBoundingBox: function() {
  42990. new n.Vector3;
  42991. return function() {
  42992. null === this.boundingBox && (this.boundingBox = new n.Box3);
  42993. var e = this.attributes.position.array;
  42994. e && this.boundingBox.setFromArray(e),
  42995. void 0 !== e && 0 !== e.length || (this.boundingBox.min.set(0, 0, 0),
  42996. this.boundingBox.max.set(0, 0, 0)),
  42997. (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)
  42998. }
  42999. }(),
  43000. computeBoundingSphere: function() {
  43001. var e = new n.Box3
  43002. , t = new n.Vector3;
  43003. return function() {
  43004. null === this.boundingSphere && (this.boundingSphere = new n.Sphere);
  43005. var i = this.attributes.position.array;
  43006. if (i) {
  43007. var r = this.boundingSphere.center;
  43008. e.setFromArray(i),
  43009. e.center(r);
  43010. for (var o = 0, a = 0, s = i.length; a < s; a += 3)
  43011. t.fromArray(i, a),
  43012. o = Math.max(o, r.distanceToSquared(t));
  43013. this.boundingSphere.radius = Math.sqrt(o),
  43014. isNaN(this.boundingSphere.radius) && console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.', this)
  43015. }
  43016. }
  43017. }(),
  43018. computeFaceNormals: function() {},
  43019. computeVertexNormals: function() {
  43020. var e = this.index
  43021. , t = this.attributes
  43022. , i = this.groups;
  43023. if (t.position) {
  43024. var r = t.position.array;
  43025. if (void 0 === t.normal)
  43026. this.addAttribute("normal", new n.BufferAttribute(new Float32Array(r.length),3));
  43027. else
  43028. for (var o = t.normal.array, a = 0, s = o.length; a < s; a++)
  43029. o[a] = 0;
  43030. 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;
  43031. if (e) {
  43032. var v = e.array;
  43033. 0 === i.length && this.addGroup(0, v.length);
  43034. for (var A = 0, y = i.length; A < y; ++A)
  43035. for (var C = i[A], I = C.start, E = C.count, a = I, s = I + E; a < s; a += 3)
  43036. l = 3 * v[a + 0],
  43037. c = 3 * v[a + 1],
  43038. h = 3 * v[a + 2],
  43039. d.fromArray(r, l),
  43040. p.fromArray(r, c),
  43041. f.fromArray(r, h),
  43042. g.subVectors(f, p),
  43043. m.subVectors(d, p),
  43044. g.cross(m),
  43045. u[l] += g.x,
  43046. u[l + 1] += g.y,
  43047. u[l + 2] += g.z,
  43048. u[c] += g.x,
  43049. u[c + 1] += g.y,
  43050. u[c + 2] += g.z,
  43051. u[h] += g.x,
  43052. u[h + 1] += g.y,
  43053. u[h + 2] += g.z
  43054. } else
  43055. for (var a = 0, s = r.length; a < s; a += 9)
  43056. d.fromArray(r, a),
  43057. p.fromArray(r, a + 3),
  43058. f.fromArray(r, a + 6),
  43059. g.subVectors(f, p),
  43060. m.subVectors(d, p),
  43061. g.cross(m),
  43062. u[a] = g.x,
  43063. u[a + 1] = g.y,
  43064. u[a + 2] = g.z,
  43065. u[a + 3] = g.x,
  43066. u[a + 4] = g.y,
  43067. u[a + 5] = g.z,
  43068. u[a + 6] = g.x,
  43069. u[a + 7] = g.y,
  43070. u[a + 8] = g.z;
  43071. this.normalizeNormals(),
  43072. t.normal.needsUpdate = !0
  43073. }
  43074. },
  43075. merge: function(e, t) {
  43076. if (e instanceof n.BufferGeometry == !1)
  43077. return void console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.", e);
  43078. void 0 === t && (t = 0);
  43079. var i = this.attributes;
  43080. for (var r in i)
  43081. if (void 0 !== e.attributes[r])
  43082. 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++,
  43083. u++)
  43084. a[u] = l[h];
  43085. return this
  43086. },
  43087. normalizeNormals: function() {
  43088. for (var e, t, i, n, r = this.attributes.normal.array, o = 0, a = r.length; o < a; o += 3)
  43089. e = r[o],
  43090. t = r[o + 1],
  43091. i = r[o + 2],
  43092. n = 1 / Math.sqrt(e * e + t * t + i * i),
  43093. r[o] *= n,
  43094. r[o + 1] *= n,
  43095. r[o + 2] *= n
  43096. },
  43097. toNonIndexed: function() {
  43098. if (null === this.index)
  43099. return console.warn("THREE.BufferGeometry.toNonIndexed(): Geometry is already non-indexed."),
  43100. this;
  43101. var e = new n.BufferGeometry
  43102. , t = this.index.array
  43103. , i = this.attributes;
  43104. for (var r in i) {
  43105. 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++) {
  43106. c = t[u] * s;
  43107. for (var p = 0; p < s; p++)
  43108. l[h++] = a[c++]
  43109. }
  43110. e.addAttribute(r, new n.BufferAttribute(l,s))
  43111. }
  43112. return e
  43113. },
  43114. toJSON: function() {
  43115. var e = {
  43116. metadata: {
  43117. version: 4.4,
  43118. type: "BufferGeometry",
  43119. generator: "BufferGeometry.toJSON"
  43120. }
  43121. };
  43122. if (e.uuid = this.uuid,
  43123. e.type = this.type,
  43124. "" !== this.name && (e.name = this.name),
  43125. void 0 !== this.parameters) {
  43126. var t = this.parameters;
  43127. for (var i in t)
  43128. void 0 !== t[i] && (e[i] = t[i]);
  43129. return e
  43130. }
  43131. e.data = {
  43132. attributes: {}
  43133. };
  43134. var n = this.index;
  43135. if (null !== n) {
  43136. var r = Array.prototype.slice.call(n.array);
  43137. e.data.index = {
  43138. type: n.array.constructor.name,
  43139. array: r
  43140. }
  43141. }
  43142. var o = this.attributes;
  43143. for (var i in o) {
  43144. var a = o[i]
  43145. , r = Array.prototype.slice.call(a.array);
  43146. e.data.attributes[i] = {
  43147. itemSize: a.itemSize,
  43148. type: a.array.constructor.name,
  43149. array: r
  43150. }
  43151. }
  43152. var s = this.groups;
  43153. s.length > 0 && (e.data.groups = JSON.parse(JSON.stringify(s)));
  43154. var l = this.boundingSphere;
  43155. return null !== l && (e.data.boundingSphere = {
  43156. center: l.center.toArray(),
  43157. radius: l.radius
  43158. }),
  43159. e
  43160. },
  43161. clone: function() {
  43162. return (new n.BufferGeometry).copy(this)
  43163. },
  43164. copy: function(e) {
  43165. var t = e.index;
  43166. null !== t && this.setIndex(t.clone());
  43167. var i = e.attributes;
  43168. for (var n in i) {
  43169. var r = i[n];
  43170. this.addAttribute(n, r.clone())
  43171. }
  43172. for (var o = e.groups, a = 0, s = o.length; a < s; a++) {
  43173. var l = o[a];
  43174. this.addGroup(l.start, l.count)
  43175. }
  43176. return this
  43177. },
  43178. dispose: function() {
  43179. this.dispatchEvent({
  43180. type: "dispose"
  43181. })
  43182. }
  43183. },
  43184. n.EventDispatcher.prototype.apply(n.BufferGeometry.prototype),
  43185. n.BufferGeometry.MaxIndex = 65535,
  43186. n.InstancedBufferGeometry = function() {
  43187. n.BufferGeometry.call(this),
  43188. this.type = "InstancedBufferGeometry",
  43189. this.maxInstancedCount = void 0
  43190. }
  43191. ,
  43192. n.InstancedBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  43193. n.InstancedBufferGeometry.prototype.constructor = n.InstancedBufferGeometry,
  43194. n.InstancedBufferGeometry.prototype.addGroup = function(e, t, i) {
  43195. this.groups.push({
  43196. start: e,
  43197. count: t,
  43198. instances: i
  43199. })
  43200. }
  43201. ,
  43202. n.InstancedBufferGeometry.prototype.copy = function(e) {
  43203. var t = e.index;
  43204. null !== t && this.setIndex(t.clone());
  43205. var i = e.attributes;
  43206. for (var n in i) {
  43207. var r = i[n];
  43208. this.addAttribute(n, r.clone())
  43209. }
  43210. for (var o = e.groups, a = 0, s = o.length; a < s; a++) {
  43211. var l = o[a];
  43212. this.addGroup(l.start, l.count, l.instances)
  43213. }
  43214. return this
  43215. }
  43216. ,
  43217. n.EventDispatcher.prototype.apply(n.InstancedBufferGeometry.prototype),
  43218. n.Uniform = function(e, t) {
  43219. this.type = e,
  43220. this.value = t,
  43221. this.dynamic = !1
  43222. }
  43223. ,
  43224. n.Uniform.prototype = {
  43225. constructor: n.Uniform,
  43226. onUpdate: function(e) {
  43227. return this.dynamic = !0,
  43228. this.onUpdateCallback = e,
  43229. this
  43230. }
  43231. },
  43232. n.AnimationClip = function(e, t, i) {
  43233. this.name = e || n.Math.generateUUID(),
  43234. this.tracks = i,
  43235. this.duration = void 0 !== t ? t : -1,
  43236. this.duration < 0 && this.resetDuration(),
  43237. this.trim(),
  43238. this.optimize()
  43239. }
  43240. ,
  43241. n.AnimationClip.prototype = {
  43242. constructor: n.AnimationClip,
  43243. resetDuration: function() {
  43244. for (var e = this.tracks, t = 0, i = 0, n = e.length; i !== n; ++i) {
  43245. var r = this.tracks[i];
  43246. t = Math.max(t, r.times[r.times.length - 1])
  43247. }
  43248. this.duration = t
  43249. },
  43250. trim: function() {
  43251. for (var e = 0; e < this.tracks.length; e++)
  43252. this.tracks[e].trim(0, this.duration);
  43253. return this
  43254. },
  43255. optimize: function() {
  43256. for (var e = 0; e < this.tracks.length; e++)
  43257. this.tracks[e].optimize();
  43258. return this
  43259. }
  43260. },
  43261. Object.assign(n.AnimationClip, {
  43262. parse: function(e) {
  43263. for (var t = [], i = e.tracks, r = 1 / (e.fps || 1), o = 0, a = i.length; o !== a; ++o)
  43264. t.push(n.KeyframeTrack.parse(i[o]).scale(r));
  43265. return new n.AnimationClip(e.name,e.duration,t)
  43266. },
  43267. toJSON: function(e) {
  43268. for (var t = [], i = e.tracks, r = {
  43269. name: e.name,
  43270. duration: e.duration,
  43271. tracks: t
  43272. }, o = 0, a = i.length; o !== a; ++o)
  43273. t.push(n.KeyframeTrack.toJSON(i[o]));
  43274. return r
  43275. },
  43276. CreateFromMorphTargetSequence: function(e, t, i) {
  43277. for (var r = t.length, o = [], a = 0; a < r; a++) {
  43278. var s = []
  43279. , l = [];
  43280. s.push((a + r - 1) % r, a, (a + 1) % r),
  43281. l.push(0, 1, 0);
  43282. var c = n.AnimationUtils.getKeyframeOrder(s);
  43283. s = n.AnimationUtils.sortedArray(s, 1, c),
  43284. l = n.AnimationUtils.sortedArray(l, 1, c),
  43285. 0 === s[0] && (s.push(r),
  43286. l.push(l[0])),
  43287. o.push(new n.NumberKeyframeTrack(".morphTargetInfluences[" + t[a].name + "]",s,l).scale(1 / i))
  43288. }
  43289. return new n.AnimationClip(e,-1,o)
  43290. },
  43291. findByName: function(e, t) {
  43292. for (var i = 0; i < e.length; i++)
  43293. if (e[i].name === t)
  43294. return e[i];
  43295. return null
  43296. },
  43297. CreateClipsFromMorphTargetSequences: function(e, t) {
  43298. for (var i = {}, r = /^([\w-]*?)([\d]+)$/, o = 0, a = e.length; o < a; o++) {
  43299. var s = e[o]
  43300. , l = s.name.match(r);
  43301. if (l && l.length > 1) {
  43302. var c = l[1]
  43303. , h = i[c];
  43304. h || (i[c] = h = []),
  43305. h.push(s)
  43306. }
  43307. }
  43308. var u = [];
  43309. for (var c in i)
  43310. u.push(n.AnimationClip.CreateFromMorphTargetSequence(c, i[c], t));
  43311. return u
  43312. },
  43313. parseAnimation: function(e, t, i) {
  43314. if (!e)
  43315. return console.error(" no animation in JSONLoader data"),
  43316. null;
  43317. for (var r = function(e, t, i, r, o) {
  43318. if (0 !== i.length) {
  43319. var a = []
  43320. , s = [];
  43321. n.AnimationUtils.flattenJSON(i, a, s, r),
  43322. 0 !== a.length && o.push(new e(t,a,s))
  43323. }
  43324. }, o = [], a = e.name || "default", s = e.length || -1, l = e.fps || 30, c = e.hierarchy || [], h = 0; h < c.length; h++) {
  43325. var u = c[h].keys;
  43326. if (u && 0 != u.length)
  43327. if (u[0].morphTargets) {
  43328. for (var d = {}, p = 0; p < u.length; p++)
  43329. if (u[p].morphTargets)
  43330. for (var f = 0; f < u[p].morphTargets.length; f++)
  43331. d[u[p].morphTargets[f]] = -1;
  43332. for (var g in d) {
  43333. for (var m = [], v = [], f = 0; f !== u[p].morphTargets.length; ++f) {
  43334. var A = u[p];
  43335. m.push(A.time),
  43336. v.push(A.morphTarget === g ? 1 : 0)
  43337. }
  43338. o.push(new n.NumberKeyframeTrack(".morphTargetInfluence[" + g + "]",m,v))
  43339. }
  43340. s = d.length * (l || 1)
  43341. } else {
  43342. var y = ".bones[" + t[h].name + "]";
  43343. r(n.VectorKeyframeTrack, y + ".position", u, "pos", o),
  43344. r(n.QuaternionKeyframeTrack, y + ".quaternion", u, "rot", o),
  43345. r(n.VectorKeyframeTrack, y + ".scale", u, "scl", o)
  43346. }
  43347. }
  43348. if (0 === o.length)
  43349. return null;
  43350. var C = new n.AnimationClip(a,s,o);
  43351. return C
  43352. }
  43353. }),
  43354. n.AnimationMixer = function(e) {
  43355. this._root = e,
  43356. this._initMemoryManager(),
  43357. this._accuIndex = 0,
  43358. this.time = 0,
  43359. this.timeScale = 1
  43360. }
  43361. ,
  43362. n.AnimationMixer.prototype = {
  43363. constructor: n.AnimationMixer,
  43364. clipAction: function(e, t) {
  43365. 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];
  43366. if (void 0 !== l) {
  43367. var c = l.actionByRoot[o];
  43368. if (void 0 !== c)
  43369. return c;
  43370. if (i = l.knownActions[0],
  43371. s = i._clip,
  43372. e !== a && e !== s)
  43373. throw new Error("Different clips with the same name detected!")
  43374. }
  43375. if (null === s)
  43376. return null;
  43377. var h = new n.AnimationMixer._Action(this,s,t);
  43378. return this._bindAction(h, i),
  43379. this._addInactiveAction(h, a, o),
  43380. h
  43381. },
  43382. existingAction: function(e, t) {
  43383. var i = t || this._root
  43384. , n = i.uuid
  43385. , r = "string" == typeof e ? e : e.name
  43386. , o = this._actionsByClip[r];
  43387. return void 0 !== o ? o.actionByRoot[n] || null : null
  43388. },
  43389. stopAllAction: function() {
  43390. var e = this._actions
  43391. , t = this._nActiveActions
  43392. , i = this._bindings
  43393. , n = this._nActiveBindings;
  43394. this._nActiveActions = 0,
  43395. this._nActiveBindings = 0;
  43396. for (var r = 0; r !== t; ++r)
  43397. e[r].reset();
  43398. for (var r = 0; r !== n; ++r)
  43399. i[r].useCount = 0;
  43400. return this
  43401. },
  43402. update: function(e) {
  43403. e *= this.timeScale;
  43404. 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) {
  43405. var s = t[a];
  43406. s.enabled && s._update(n, e, r, o)
  43407. }
  43408. for (var l = this._bindings, c = this._nActiveBindings, a = 0; a !== c; ++a)
  43409. l[a].apply(o);
  43410. return this
  43411. },
  43412. getRoot: function() {
  43413. return this._root
  43414. },
  43415. uncacheClip: function(e) {
  43416. var t = this._actions
  43417. , i = e.name
  43418. , n = this._actionsByClip
  43419. , r = n[i];
  43420. if (void 0 !== r) {
  43421. for (var o = r.knownActions, a = 0, s = o.length; a !== s; ++a) {
  43422. var l = o[a];
  43423. this._deactivateAction(l);
  43424. var c = l._cacheIndex
  43425. , h = t[t.length - 1];
  43426. l._cacheIndex = null,
  43427. l._byClipCacheIndex = null,
  43428. h._cacheIndex = c,
  43429. t[c] = h,
  43430. t.pop(),
  43431. this._removeInactiveBindingsForAction(l)
  43432. }
  43433. delete n[i]
  43434. }
  43435. },
  43436. uncacheRoot: function(e) {
  43437. var t = e.uuid
  43438. , i = this._actionsByClip;
  43439. for (var n in i) {
  43440. var r = i[n].actionByRoot
  43441. , o = r[t];
  43442. void 0 !== o && (this._deactivateAction(o),
  43443. this._removeInactiveAction(o))
  43444. }
  43445. var a = this._bindingsByRootAndName
  43446. , s = a[t];
  43447. if (void 0 !== s)
  43448. for (var l in s) {
  43449. var c = s[l];
  43450. c.restoreOriginalState(),
  43451. this._removeInactiveBinding(c)
  43452. }
  43453. },
  43454. uncacheAction: function(e, t) {
  43455. var i = this.existingAction(e, t);
  43456. null !== i && (this._deactivateAction(i),
  43457. this._removeInactiveAction(i))
  43458. }
  43459. },
  43460. n.EventDispatcher.prototype.apply(n.AnimationMixer.prototype),
  43461. n.AnimationMixer._Action = function(e, t, i) {
  43462. this._mixer = e,
  43463. this._clip = t,
  43464. this._localRoot = i || null;
  43465. for (var r = t.tracks, o = r.length, a = new Array(o), s = {
  43466. endingStart: n.ZeroCurvatureEnding,
  43467. endingEnd: n.ZeroCurvatureEnding
  43468. }, l = 0; l !== o; ++l) {
  43469. var c = r[l].createInterpolant(null);
  43470. a[l] = c,
  43471. c.settings = s
  43472. }
  43473. this._interpolantSettings = s,
  43474. this._interpolants = a,
  43475. this._propertyBindings = new Array(o),
  43476. this._cacheIndex = null,
  43477. this._byClipCacheIndex = null,
  43478. this._timeScaleInterpolant = null,
  43479. this._weightInterpolant = null,
  43480. this.loop = n.LoopRepeat,
  43481. this._loopCount = -1,
  43482. this._startTime = null,
  43483. this.time = 0,
  43484. this.timeScale = 1,
  43485. this._effectiveTimeScale = 1,
  43486. this.weight = 1,
  43487. this._effectiveWeight = 1,
  43488. this.repetitions = 1 / 0,
  43489. this.paused = !1,
  43490. this.enabled = !0,
  43491. this.clampWhenFinished = !1,
  43492. this.zeroSlopeAtStart = !0,
  43493. this.zeroSlopeAtEnd = !0
  43494. }
  43495. ,
  43496. n.AnimationMixer._Action.prototype = {
  43497. constructor: n.AnimationMixer._Action,
  43498. play: function() {
  43499. return this._mixer._activateAction(this),
  43500. this
  43501. },
  43502. stop: function() {
  43503. return this._mixer._deactivateAction(this),
  43504. this.reset()
  43505. },
  43506. reset: function() {
  43507. return this.paused = !1,
  43508. this.enabled = !0,
  43509. this.time = 0,
  43510. this._loopCount = -1,
  43511. this._startTime = null,
  43512. this.stopFading().stopWarping()
  43513. },
  43514. isRunning: function() {
  43515. this._startTime;
  43516. return this.enabled && !this.paused && 0 !== this.timeScale && null === this._startTime && this._mixer._isActiveAction(this)
  43517. },
  43518. isScheduled: function() {
  43519. return this._mixer._isActiveAction(this)
  43520. },
  43521. startAt: function(e) {
  43522. return this._startTime = e,
  43523. this
  43524. },
  43525. setLoop: function(e, t) {
  43526. return this.loop = e,
  43527. this.repetitions = t,
  43528. this
  43529. },
  43530. setEffectiveWeight: function(e) {
  43531. return this.weight = e,
  43532. this._effectiveWeight = this.enabled ? e : 0,
  43533. this.stopFading()
  43534. },
  43535. getEffectiveWeight: function() {
  43536. return this._effectiveWeight
  43537. },
  43538. fadeIn: function(e) {
  43539. return this._scheduleFading(e, 0, 1)
  43540. },
  43541. fadeOut: function(e) {
  43542. return this._scheduleFading(e, 1, 0)
  43543. },
  43544. crossFadeFrom: function(e, t, i) {
  43545. this._mixer;
  43546. if (e.fadeOut(t),
  43547. this.fadeIn(t),
  43548. i) {
  43549. var n = this._clip.duration
  43550. , r = e._clip.duration
  43551. , o = r / n
  43552. , a = n / r;
  43553. e.warp(1, o, t),
  43554. this.warp(a, 1, t)
  43555. }
  43556. return this
  43557. },
  43558. crossFadeTo: function(e, t, i) {
  43559. return e.crossFadeFrom(this, t, i)
  43560. },
  43561. stopFading: function() {
  43562. var e = this._weightInterpolant;
  43563. return null !== e && (this._weightInterpolant = null,
  43564. this._mixer._takeBackControlInterpolant(e)),
  43565. this
  43566. },
  43567. setEffectiveTimeScale: function(e) {
  43568. return this.timeScale = e,
  43569. this._effectiveTimeScale = this.paused ? 0 : e,
  43570. this.stopWarping()
  43571. },
  43572. getEffectiveTimeScale: function() {
  43573. return this._effectiveTimeScale
  43574. },
  43575. setDuration: function(e) {
  43576. return this.timeScale = this._clip.duration / e,
  43577. this.stopWarping()
  43578. },
  43579. syncWith: function(e) {
  43580. return this.time = e.time,
  43581. this.timeScale = e.timeScale,
  43582. this.stopWarping()
  43583. },
  43584. halt: function(e) {
  43585. return this.warp(this._currentTimeScale, 0, e)
  43586. },
  43587. warp: function(e, t, i) {
  43588. var n = this._mixer
  43589. , r = n.time
  43590. , o = this._timeScaleInterpolant
  43591. , a = this.timeScale;
  43592. null === o && (o = n._lendControlInterpolant(),
  43593. this._timeScaleInterpolant = o);
  43594. var s = o.parameterPositions
  43595. , l = o.sampleValues;
  43596. return s[0] = r,
  43597. s[1] = r + i,
  43598. l[0] = e / a,
  43599. l[1] = t / a,
  43600. this
  43601. },
  43602. stopWarping: function() {
  43603. var e = this._timeScaleInterpolant;
  43604. return null !== e && (this._timeScaleInterpolant = null,
  43605. this._mixer._takeBackControlInterpolant(e)),
  43606. this
  43607. },
  43608. getMixer: function() {
  43609. return this._mixer
  43610. },
  43611. getClip: function() {
  43612. return this._clip
  43613. },
  43614. getRoot: function() {
  43615. return this._localRoot || this._mixer._root
  43616. },
  43617. _update: function(e, t, i, n) {
  43618. var r = this._startTime;
  43619. if (null !== r) {
  43620. var o = (e - r) * i;
  43621. if (o < 0 || 0 === i)
  43622. return;
  43623. this._startTime = null,
  43624. t = i * o
  43625. }
  43626. t *= this._updateTimeScale(e);
  43627. var a = this._updateTime(t)
  43628. , s = this._updateWeight(e);
  43629. if (s > 0)
  43630. for (var l = this._interpolants, c = this._propertyBindings, h = 0, u = l.length; h !== u; ++h)
  43631. l[h].evaluate(a),
  43632. c[h].accumulate(n, s)
  43633. },
  43634. _updateWeight: function(e) {
  43635. var t = 0;
  43636. if (this.enabled) {
  43637. t = this.weight;
  43638. var i = this._weightInterpolant;
  43639. if (null !== i) {
  43640. var n = i.evaluate(e)[0];
  43641. t *= n,
  43642. e > i.parameterPositions[1] && (this.stopFading(),
  43643. 0 === n && (this.enabled = !1))
  43644. }
  43645. }
  43646. return this._effectiveWeight = t,
  43647. t
  43648. },
  43649. _updateTimeScale: function(e) {
  43650. var t = 0;
  43651. if (!this.paused) {
  43652. t = this.timeScale;
  43653. var i = this._timeScaleInterpolant;
  43654. if (null !== i) {
  43655. var n = i.evaluate(e)[0];
  43656. t *= n,
  43657. e > i.parameterPositions[1] && (this.stopWarping(),
  43658. 0 === t ? this.pause = !0 : this.timeScale = t)
  43659. }
  43660. }
  43661. return this._effectiveTimeScale = t,
  43662. t
  43663. },
  43664. _updateTime: function(e) {
  43665. var t = this.time + e;
  43666. if (0 === e)
  43667. return t;
  43668. var i = this._clip.duration
  43669. , r = this.loop
  43670. , o = this._loopCount
  43671. , a = !1;
  43672. switch (r) {
  43673. case n.LoopOnce:
  43674. if (o === -1 && (this.loopCount = 0,
  43675. this._setEndings(!0, !0, !1)),
  43676. t >= i)
  43677. t = i;
  43678. else {
  43679. if (!(t < 0))
  43680. break;
  43681. t = 0
  43682. }
  43683. this.clampWhenFinished ? this.pause = !0 : this.enabled = !1,
  43684. this._mixer.dispatchEvent({
  43685. type: "finished",
  43686. action: this,
  43687. direction: e < 0 ? -1 : 1
  43688. });
  43689. break;
  43690. case n.LoopPingPong:
  43691. a = !0;
  43692. case n.LoopRepeat:
  43693. if (o === -1 && (e > 0 ? (o = 0,
  43694. this._setEndings(!0, 0 === this.repetitions, a)) : this._setEndings(0 === this.repetitions, !0, a)),
  43695. t >= i || t < 0) {
  43696. var s = Math.floor(t / i);
  43697. t -= i * s,
  43698. o += Math.abs(s);
  43699. var l = this.repetitions - o;
  43700. if (l < 0) {
  43701. this.clampWhenFinished ? this.paused = !0 : this.enabled = !1,
  43702. t = e > 0 ? i : 0,
  43703. this._mixer.dispatchEvent({
  43704. type: "finished",
  43705. action: this,
  43706. direction: e > 0 ? 1 : -1
  43707. });
  43708. break
  43709. }
  43710. if (0 === l) {
  43711. var c = e < 0;
  43712. this._setEndings(c, !c, a)
  43713. } else
  43714. this._setEndings(!1, !1, a);
  43715. this._loopCount = o,
  43716. this._mixer.dispatchEvent({
  43717. type: "loop",
  43718. action: this,
  43719. loopDelta: s
  43720. })
  43721. }
  43722. if (r === n.LoopPingPong && 1 === (1 & o))
  43723. return this.time = t,
  43724. i - t
  43725. }
  43726. return this.time = t,
  43727. t
  43728. },
  43729. _setEndings: function(e, t, i) {
  43730. var r = this._interpolantSettings;
  43731. i ? (r.endingStart = n.ZeroSlopeEnding,
  43732. r.endingEnd = n.ZeroSlopeEnding) : (e ? r.endingStart = this.zeroSlopeAtStart ? n.ZeroSlopeEnding : n.ZeroCurvatureEnding : r.endingStart = n.WrapAroundEnding,
  43733. t ? r.endingEnd = this.zeroSlopeAtEnd ? n.ZeroSlopeEnding : n.ZeroCurvatureEnding : r.endingEnd = n.WrapAroundEnding)
  43734. },
  43735. _scheduleFading: function(e, t, i) {
  43736. var n = this._mixer
  43737. , r = n.time
  43738. , o = this._weightInterpolant;
  43739. null === o && (o = n._lendControlInterpolant(),
  43740. this._weightInterpolant = o);
  43741. var a = o.parameterPositions
  43742. , s = o.sampleValues;
  43743. return a[0] = r,
  43744. s[0] = t,
  43745. a[1] = r + e,
  43746. s[1] = i,
  43747. this
  43748. }
  43749. },
  43750. Object.assign(n.AnimationMixer.prototype, {
  43751. _bindAction: function(e, t) {
  43752. var i = e._localRoot || this._root
  43753. , r = e._clip.tracks
  43754. , o = r.length
  43755. , a = e._propertyBindings
  43756. , s = e._interpolants
  43757. , l = i.uuid
  43758. , c = this._bindingsByRootAndName
  43759. , h = c[l];
  43760. void 0 === h && (h = {},
  43761. c[l] = h);
  43762. for (var u = 0; u !== o; ++u) {
  43763. var d = r[u]
  43764. , p = d.name
  43765. , f = h[p];
  43766. if (void 0 !== f)
  43767. a[u] = f;
  43768. else {
  43769. if (f = a[u],
  43770. void 0 !== f) {
  43771. null === f._cacheIndex && (++f.referenceCount,
  43772. this._addInactiveBinding(f, l, p));
  43773. continue
  43774. }
  43775. var g = t && t._propertyBindings[u].binding.parsedPath;
  43776. f = new n.PropertyMixer(n.PropertyBinding.create(i, p, g),d.ValueTypeName,d.getValueSize()),
  43777. ++f.referenceCount,
  43778. this._addInactiveBinding(f, l, p),
  43779. a[u] = f
  43780. }
  43781. s[u].resultBuffer = f.buffer
  43782. }
  43783. },
  43784. _activateAction: function(e) {
  43785. if (!this._isActiveAction(e)) {
  43786. if (null === e._cacheIndex) {
  43787. var t = (e._localRoot || this._root).uuid
  43788. , i = e._clip.name
  43789. , n = this._actionsByClip[i];
  43790. this._bindAction(e, n && n.knownActions[0]),
  43791. this._addInactiveAction(e, i, t)
  43792. }
  43793. for (var r = e._propertyBindings, o = 0, a = r.length; o !== a; ++o) {
  43794. var s = r[o];
  43795. 0 === s.useCount++ && (this._lendBinding(s),
  43796. s.saveOriginalState())
  43797. }
  43798. this._lendAction(e)
  43799. }
  43800. },
  43801. _deactivateAction: function(e) {
  43802. if (this._isActiveAction(e)) {
  43803. for (var t = e._propertyBindings, i = 0, n = t.length; i !== n; ++i) {
  43804. var r = t[i];
  43805. 0 === --r.useCount && (r.restoreOriginalState(),
  43806. this._takeBackBinding(r))
  43807. }
  43808. this._takeBackAction(e)
  43809. }
  43810. },
  43811. _initMemoryManager: function() {
  43812. this._actions = [],
  43813. this._nActiveActions = 0,
  43814. this._actionsByClip = {},
  43815. this._bindings = [],
  43816. this._nActiveBindings = 0,
  43817. this._bindingsByRootAndName = {},
  43818. this._controlInterpolants = [],
  43819. this._nActiveControlInterpolants = 0;
  43820. var e = this;
  43821. this.stats = {
  43822. actions: {
  43823. get total() {
  43824. return e._actions.length
  43825. },
  43826. get inUse() {
  43827. return e._nActiveActions
  43828. }
  43829. },
  43830. bindings: {
  43831. get total() {
  43832. return e._bindings.length
  43833. },
  43834. get inUse() {
  43835. return e._nActiveBindings
  43836. }
  43837. },
  43838. controlInterpolants: {
  43839. get total() {
  43840. return e._controlInterpolants.length
  43841. },
  43842. get inUse() {
  43843. return e._nActiveControlInterpolants
  43844. }
  43845. }
  43846. }
  43847. },
  43848. _isActiveAction: function(e) {
  43849. var t = e._cacheIndex;
  43850. return null !== t && t < this._nActiveActions
  43851. },
  43852. _addInactiveAction: function(e, t, i) {
  43853. var n = this._actions
  43854. , r = this._actionsByClip
  43855. , o = r[t];
  43856. if (void 0 === o)
  43857. o = {
  43858. knownActions: [e],
  43859. actionByRoot: {}
  43860. },
  43861. e._byClipCacheIndex = 0,
  43862. r[t] = o;
  43863. else {
  43864. var a = o.knownActions;
  43865. e._byClipCacheIndex = a.length,
  43866. a.push(e)
  43867. }
  43868. e._cacheIndex = n.length,
  43869. n.push(e),
  43870. o.actionByRoot[i] = e
  43871. },
  43872. _removeInactiveAction: function(e) {
  43873. var t = this._actions
  43874. , i = t[t.length - 1]
  43875. , n = e._cacheIndex;
  43876. i._cacheIndex = n,
  43877. t[n] = i,
  43878. t.pop(),
  43879. e._cacheIndex = null;
  43880. var r = e._clip.name
  43881. , o = this._actionsByClip
  43882. , a = o[r]
  43883. , s = a.knownActions
  43884. , l = s[s.length - 1]
  43885. , c = e._byClipCacheIndex;
  43886. l._byClipCacheIndex = c,
  43887. s[c] = l,
  43888. s.pop(),
  43889. e._byClipCacheIndex = null;
  43890. var h = a.actionByRoot
  43891. , u = (t._localRoot || this._root).uuid;
  43892. delete h[u],
  43893. 0 === s.length && delete o[r],
  43894. this._removeInactiveBindingsForAction(e)
  43895. },
  43896. _removeInactiveBindingsForAction: function(e) {
  43897. for (var t = e._propertyBindings, i = 0, n = t.length; i !== n; ++i) {
  43898. var r = t[i];
  43899. 0 === --r.referenceCount && this._removeInactiveBinding(r)
  43900. }
  43901. },
  43902. _lendAction: function(e) {
  43903. var t = this._actions
  43904. , i = e._cacheIndex
  43905. , n = this._nActiveActions++
  43906. , r = t[n];
  43907. e._cacheIndex = n,
  43908. t[n] = e,
  43909. r._cacheIndex = i,
  43910. t[i] = r
  43911. },
  43912. _takeBackAction: function(e) {
  43913. var t = this._actions
  43914. , i = e._cacheIndex
  43915. , n = --this._nActiveActions
  43916. , r = t[n];
  43917. e._cacheIndex = n,
  43918. t[n] = e,
  43919. r._cacheIndex = i,
  43920. t[i] = r
  43921. },
  43922. _addInactiveBinding: function(e, t, i) {
  43923. var n = this._bindingsByRootAndName
  43924. , r = n[t]
  43925. , o = this._bindings;
  43926. void 0 === r && (r = {},
  43927. n[t] = r),
  43928. r[i] = e,
  43929. e._cacheIndex = o.length,
  43930. o.push(e)
  43931. },
  43932. _removeInactiveBinding: function(e) {
  43933. var t = this._bindings
  43934. , i = e.binding
  43935. , n = i.rootNode.uuid
  43936. , r = i.path
  43937. , o = this._bindingsByRootAndName
  43938. , a = o[n]
  43939. , s = t[t.length - 1]
  43940. , l = e._cacheIndex;
  43941. s._cacheIndex = l,
  43942. t[l] = s,
  43943. t.pop(),
  43944. delete a[r];
  43945. e: {
  43946. for (var c in a)
  43947. break e;
  43948. delete o[n]
  43949. }
  43950. },
  43951. _lendBinding: function(e) {
  43952. var t = this._bindings
  43953. , i = e._cacheIndex
  43954. , n = this._nActiveBindings++
  43955. , r = t[n];
  43956. e._cacheIndex = n,
  43957. t[n] = e,
  43958. r._cacheIndex = i,
  43959. t[i] = r
  43960. },
  43961. _takeBackBinding: function(e) {
  43962. var t = this._bindings
  43963. , i = e._cacheIndex
  43964. , n = --this._nActiveBindings
  43965. , r = t[n];
  43966. e._cacheIndex = n,
  43967. t[n] = e,
  43968. r._cacheIndex = i,
  43969. t[i] = r
  43970. },
  43971. _lendControlInterpolant: function() {
  43972. var e = this._controlInterpolants
  43973. , t = this._nActiveControlInterpolants++
  43974. , i = e[t];
  43975. return void 0 === i && (i = new n.LinearInterpolant(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer),
  43976. i.__cacheIndex = t,
  43977. e[t] = i),
  43978. i
  43979. },
  43980. _takeBackControlInterpolant: function(e) {
  43981. var t = this._controlInterpolants
  43982. , i = e.__cacheIndex
  43983. , n = --this._nActiveControlInterpolants
  43984. , r = t[n];
  43985. e.__cacheIndex = n,
  43986. t[n] = e,
  43987. r.__cacheIndex = i,
  43988. t[i] = r
  43989. },
  43990. _controlInterpolantsResultBuffer: new Float32Array(1)
  43991. }),
  43992. n.AnimationObjectGroup = function(e) {
  43993. this.uuid = n.Math.generateUUID(),
  43994. this._objects = Array.prototype.slice.call(arguments),
  43995. this.nCachedObjects_ = 0;
  43996. var t = {};
  43997. this._indicesByUUID = t;
  43998. for (var i = 0, r = arguments.length; i !== r; ++i)
  43999. t[arguments[i].uuid] = i;
  44000. this._paths = [],
  44001. this._parsedPaths = [],
  44002. this._bindings = [],
  44003. this._bindingsIndicesByPath = {};
  44004. var o = this;
  44005. this.stats = {
  44006. objects: {
  44007. get total() {
  44008. return o._objects.length
  44009. },
  44010. get inUse() {
  44011. return this.total - o.nCachedObjects_
  44012. }
  44013. },
  44014. get bindingsPerObject() {
  44015. return o._bindings.length
  44016. }
  44017. }
  44018. }
  44019. ,
  44020. n.AnimationObjectGroup.prototype = {
  44021. constructor: n.AnimationObjectGroup,
  44022. add: function(e) {
  44023. 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) {
  44024. var d = arguments[h]
  44025. , p = d.uuid
  44026. , f = o[p];
  44027. if (void 0 === f) {
  44028. f = i++,
  44029. o[p] = f,
  44030. t.push(d);
  44031. for (var g = 0, m = c; g !== m; ++g)
  44032. l[g].push(new n.PropertyBinding(d,a[g],s[g]))
  44033. } else if (f < r) {
  44034. var v = t[f]
  44035. , A = --r
  44036. , y = t[A];
  44037. o[y.uuid] = f,
  44038. t[f] = y,
  44039. o[p] = A,
  44040. t[A] = d;
  44041. for (var g = 0, m = c; g !== m; ++g) {
  44042. var C = l[g]
  44043. , I = C[A]
  44044. , E = C[f];
  44045. C[f] = I,
  44046. void 0 === E && (E = new n.PropertyBinding(d,a[g],s[g])),
  44047. C[A] = E
  44048. }
  44049. } else
  44050. t[f] !== v && console.error("Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes...")
  44051. }
  44052. this.nCachedObjects_ = r
  44053. },
  44054. remove: function(e) {
  44055. for (var t = this._objects, i = (t.length,
  44056. this.nCachedObjects_), n = this._indicesByUUID, r = this._bindings, o = r.length, a = 0, s = arguments.length; a !== s; ++a) {
  44057. var l = arguments[a]
  44058. , c = l.uuid
  44059. , h = n[c];
  44060. if (void 0 !== h && h >= i) {
  44061. var u = i++
  44062. , d = t[u];
  44063. n[d.uuid] = h,
  44064. t[h] = d,
  44065. n[c] = u,
  44066. t[u] = l;
  44067. for (var p = 0, f = o; p !== f; ++p) {
  44068. var g = r[p]
  44069. , m = g[u]
  44070. , v = g[h];
  44071. g[h] = m,
  44072. g[u] = v
  44073. }
  44074. }
  44075. }
  44076. this.nCachedObjects_ = i
  44077. },
  44078. uncache: function(e) {
  44079. 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) {
  44080. var c = arguments[s]
  44081. , h = c.uuid
  44082. , u = r[h];
  44083. if (void 0 !== u)
  44084. if (delete r[h],
  44085. u < n) {
  44086. var d = --n
  44087. , p = t[d]
  44088. , f = --i
  44089. , g = t[f];
  44090. r[p.uuid] = u,
  44091. t[u] = p,
  44092. r[g.uuid] = d,
  44093. t[d] = g,
  44094. t.pop();
  44095. for (var m = 0, v = a; m !== v; ++m) {
  44096. var A = o[m]
  44097. , y = A[d]
  44098. , C = A[f];
  44099. A[u] = y,
  44100. A[d] = C,
  44101. A.pop()
  44102. }
  44103. } else {
  44104. var f = --i
  44105. , g = t[f];
  44106. r[g.uuid] = u,
  44107. t[u] = g,
  44108. t.pop();
  44109. for (var m = 0, v = a; m !== v; ++m) {
  44110. var A = o[m];
  44111. A[u] = A[f],
  44112. A.pop()
  44113. }
  44114. }
  44115. }
  44116. this.nCachedObjects_ = n
  44117. },
  44118. subscribe_: function(e, t) {
  44119. var i = this._bindingsIndicesByPath
  44120. , r = i[e]
  44121. , o = this._bindings;
  44122. if (void 0 !== r)
  44123. return o[r];
  44124. var a = this._paths
  44125. , s = this._parsedPaths
  44126. , l = this._objects
  44127. , c = l.length
  44128. , h = this.nCachedObjects_
  44129. , u = new Array(c);
  44130. r = o.length,
  44131. i[e] = r,
  44132. a.push(e),
  44133. s.push(t),
  44134. o.push(u);
  44135. for (var d = h, p = l.length; d !== p; ++d) {
  44136. var f = l[d];
  44137. u[d] = new n.PropertyBinding(f,e,t)
  44138. }
  44139. return u
  44140. },
  44141. unsubscribe_: function(e) {
  44142. var t = this._bindingsIndicesByPath
  44143. , i = t[e];
  44144. if (void 0 !== i) {
  44145. var n = this._paths
  44146. , r = this._parsedPaths
  44147. , o = this._bindings
  44148. , a = o.length - 1
  44149. , s = o[a]
  44150. , l = e[a];
  44151. t[l] = i,
  44152. o[i] = s,
  44153. o.pop(),
  44154. r[i] = r[a],
  44155. r.pop(),
  44156. n[i] = n[a],
  44157. n.pop()
  44158. }
  44159. }
  44160. },
  44161. n.AnimationUtils = {
  44162. arraySlice: function(e, t, i) {
  44163. return n.AnimationUtils.isTypedArray(e) ? new e.constructor(e.subarray(t, i)) : e.slice(t, i)
  44164. },
  44165. convertArray: function(e, t, i) {
  44166. return !e || !i && e.constructor === t ? e : "number" == typeof t.BYTES_PER_ELEMENT ? new t(e) : Array.prototype.slice.call(e)
  44167. },
  44168. isTypedArray: function(e) {
  44169. return ArrayBuffer.isView(e) && !(e instanceof DataView)
  44170. },
  44171. getKeyframeOrder: function(e) {
  44172. function t(t, i) {
  44173. return e[t] - e[i]
  44174. }
  44175. for (var i = e.length, n = new Array(i), r = 0; r !== i; ++r)
  44176. n[r] = r;
  44177. return n.sort(t),
  44178. n
  44179. },
  44180. sortedArray: function(e, t, i) {
  44181. for (var n = e.length, r = new e.constructor(n), o = 0, a = 0; a !== n; ++o)
  44182. for (var s = i[o] * t, l = 0; l !== t; ++l)
  44183. r[a++] = e[s + l];
  44184. return r
  44185. },
  44186. flattenJSON: function(e, t, i, n) {
  44187. for (var r = 1, o = e[0]; void 0 !== o && void 0 === o[n]; )
  44188. o = e[r++];
  44189. if (void 0 !== o) {
  44190. var a = o[n];
  44191. if (void 0 !== a)
  44192. if (Array.isArray(a)) {
  44193. do
  44194. a = o[n],
  44195. void 0 !== a && (t.push(o.time),
  44196. i.push.apply(i, a)),
  44197. o = e[r++];
  44198. while (void 0 !== o)
  44199. } else if (void 0 !== a.toArray) {
  44200. do
  44201. a = o[n],
  44202. void 0 !== a && (t.push(o.time),
  44203. a.toArray(i, i.length)),
  44204. o = e[r++];
  44205. while (void 0 !== o)
  44206. } else
  44207. do
  44208. a = o[n],
  44209. void 0 !== a && (t.push(o.time),
  44210. i.push(a)),
  44211. o = e[r++];
  44212. while (void 0 !== o)
  44213. }
  44214. }
  44215. },
  44216. n.KeyframeTrack = function(e, t, i, r) {
  44217. if (void 0 === e)
  44218. throw new Error("track name is undefined");
  44219. if (void 0 === t || 0 === t.length)
  44220. throw new Error("no keyframes in track named " + e);
  44221. this.name = e,
  44222. this.times = n.AnimationUtils.convertArray(t, this.TimeBufferType),
  44223. this.values = n.AnimationUtils.convertArray(i, this.ValueBufferType),
  44224. this.setInterpolation(r || this.DefaultInterpolation),
  44225. this.validate(),
  44226. this.optimize()
  44227. }
  44228. ,
  44229. n.KeyframeTrack.prototype = {
  44230. constructor: n.KeyframeTrack,
  44231. TimeBufferType: Float32Array,
  44232. ValueBufferType: Float32Array,
  44233. DefaultInterpolation: n.InterpolateLinear,
  44234. InterpolantFactoryMethodDiscrete: function(e) {
  44235. return new n.DiscreteInterpolant(this.times,this.values,this.getValueSize(),e)
  44236. },
  44237. InterpolantFactoryMethodLinear: function(e) {
  44238. return new n.LinearInterpolant(this.times,this.values,this.getValueSize(),e)
  44239. },
  44240. InterpolantFactoryMethodSmooth: function(e) {
  44241. return new n.CubicInterpolant(this.times,this.values,this.getValueSize(),e)
  44242. },
  44243. setInterpolation: function(e) {
  44244. var t = void 0;
  44245. switch (e) {
  44246. case n.InterpolateDiscrete:
  44247. t = this.InterpolantFactoryMethodDiscrete;
  44248. break;
  44249. case n.InterpolateLinear:
  44250. t = this.InterpolantFactoryMethodLinear;
  44251. break;
  44252. case n.InterpolateSmooth:
  44253. t = this.InterpolantFactoryMethodSmooth
  44254. }
  44255. if (void 0 === t) {
  44256. var i = "unsupported interpolation for " + this.ValueTypeName + " keyframe track named " + this.name;
  44257. if (void 0 === this.createInterpolant) {
  44258. if (e === this.DefaultInterpolation)
  44259. throw new Error(i);
  44260. this.setInterpolation(this.DefaultInterpolation)
  44261. }
  44262. return void console.warn(i)
  44263. }
  44264. this.createInterpolant = t
  44265. },
  44266. getInterpolation: function() {
  44267. switch (this.createInterpolant) {
  44268. case this.InterpolantFactoryMethodDiscrete:
  44269. return n.InterpolateDiscrete;
  44270. case this.InterpolantFactoryMethodLinear:
  44271. return n.InterpolateLinear;
  44272. case this.InterpolantFactoryMethodSmooth:
  44273. return n.InterpolateSmooth
  44274. }
  44275. },
  44276. getValueSize: function() {
  44277. return this.values.length / this.times.length
  44278. },
  44279. shift: function(e) {
  44280. if (0 !== e)
  44281. for (var t = this.times, i = 0, n = t.length; i !== n; ++i)
  44282. t[i] += e;
  44283. return this
  44284. },
  44285. scale: function(e) {
  44286. if (1 !== e)
  44287. for (var t = this.times, i = 0, n = t.length; i !== n; ++i)
  44288. t[i] *= e;
  44289. return this
  44290. },
  44291. trim: function(e, t) {
  44292. for (var i = this.times, r = i.length, o = 0, a = r - 1; o !== r && i[o] < e; )
  44293. ++o;
  44294. for (; a !== -1 && i[a] > t; )
  44295. --a;
  44296. if (++a,
  44297. 0 !== o || a !== r) {
  44298. o >= a && (a = Math.max(a, 1),
  44299. o = a - 1);
  44300. var s = this.getValueSize();
  44301. this.times = n.AnimationUtils.arraySlice(i, o, a),
  44302. this.values = n.AnimationUtils.arraySlice(this.values, o * s, a * s)
  44303. }
  44304. return this
  44305. },
  44306. validate: function() {
  44307. var e = !0
  44308. , t = this.getValueSize();
  44309. t - Math.floor(t) !== 0 && (console.error("invalid value size in track", this),
  44310. e = !1);
  44311. var i = this.times
  44312. , r = this.values
  44313. , o = i.length;
  44314. 0 === o && (console.error("track is empty", this),
  44315. e = !1);
  44316. for (var a = null, s = 0; s !== o; s++) {
  44317. var l = i[s];
  44318. if ("number" == typeof l && isNaN(l)) {
  44319. console.error("time is not a valid number", this, s, l),
  44320. e = !1;
  44321. break
  44322. }
  44323. if (null !== a && a > l) {
  44324. console.error("out of order keys", this, s, l, a),
  44325. e = !1;
  44326. break
  44327. }
  44328. a = l
  44329. }
  44330. if (void 0 !== r && n.AnimationUtils.isTypedArray(r))
  44331. for (var s = 0, c = r.length; s !== c; ++s) {
  44332. var h = r[s];
  44333. if (isNaN(h)) {
  44334. console.error("value is not a valid number", this, s, h),
  44335. e = !1;
  44336. break
  44337. }
  44338. }
  44339. return e
  44340. },
  44341. optimize: function() {
  44342. for (var e = this.times, t = this.values, i = this.getValueSize(), r = 1, o = 1, a = e.length - 1; o <= a; ++o) {
  44343. var s = !1
  44344. , l = e[o]
  44345. , c = e[o + 1];
  44346. if (l !== c && (1 !== o || l !== l[0]))
  44347. for (var h = o * i, u = h - i, d = h + i, p = 0; p !== i; ++p) {
  44348. var f = t[h + p];
  44349. if (f !== t[u + p] || f !== t[d + p]) {
  44350. s = !0;
  44351. break
  44352. }
  44353. }
  44354. if (s) {
  44355. if (o !== r) {
  44356. e[r] = e[o];
  44357. for (var g = o * i, m = r * i, p = 0; p !== i; ++p)
  44358. t[m + p] = t[g + p]
  44359. }
  44360. ++r
  44361. }
  44362. }
  44363. return r !== e.length && (this.times = n.AnimationUtils.arraySlice(e, 0, r),
  44364. this.values = n.AnimationUtils.arraySlice(t, 0, r * i)),
  44365. this
  44366. }
  44367. },
  44368. Object.assign(n.KeyframeTrack, {
  44369. parse: function(e) {
  44370. if (void 0 === e.type)
  44371. throw new Error("track type undefined, can not parse");
  44372. var t = n.KeyframeTrack._getTrackTypeForValueTypeName(e.type);
  44373. if (void 0 === e.times) {
  44374. console.warn("legacy JSON format detected, converting");
  44375. var i = []
  44376. , r = [];
  44377. n.AnimationUtils.flattenJSON(e.keys, i, r, "value"),
  44378. e.times = i,
  44379. e.values = r
  44380. }
  44381. return void 0 !== t.parse ? t.parse(e) : new t(e.name,e.times,e.values,e.interpolation)
  44382. },
  44383. toJSON: function(e) {
  44384. var t, i = e.constructor;
  44385. if (void 0 !== i.toJSON)
  44386. t = i.toJSON(e);
  44387. else {
  44388. t = {
  44389. name: e.name,
  44390. times: n.AnimationUtils.convertArray(e.times, Array),
  44391. values: n.AnimationUtils.convertArray(e.values, Array)
  44392. };
  44393. var r = e.getInterpolation();
  44394. r !== e.DefaultInterpolation && (t.interpolation = r)
  44395. }
  44396. return t.type = e.ValueTypeName,
  44397. t
  44398. },
  44399. _getTrackTypeForValueTypeName: function(e) {
  44400. switch (e.toLowerCase()) {
  44401. case "scalar":
  44402. case "double":
  44403. case "float":
  44404. case "number":
  44405. case "integer":
  44406. return n.NumberKeyframeTrack;
  44407. case "vector":
  44408. case "vector2":
  44409. case "vector3":
  44410. case "vector4":
  44411. return n.VectorKeyframeTrack;
  44412. case "color":
  44413. return n.ColorKeyframeTrack;
  44414. case "quaternion":
  44415. return n.QuaternionKeyframeTrack;
  44416. case "bool":
  44417. case "boolean":
  44418. return n.BooleanKeyframeTrack;
  44419. case "string":
  44420. return n.StringKeyframeTrack
  44421. }
  44422. throw new Error("Unsupported typeName: " + e)
  44423. }
  44424. }),
  44425. n.PropertyBinding = function(e, t, i) {
  44426. this.path = t,
  44427. this.parsedPath = i || n.PropertyBinding.parseTrackName(t),
  44428. this.node = n.PropertyBinding.findNode(e, this.parsedPath.nodeName) || e,
  44429. this.rootNode = e
  44430. }
  44431. ,
  44432. n.PropertyBinding.prototype = {
  44433. constructor: n.PropertyBinding,
  44434. getValue: function(e, t) {
  44435. this.bind(),
  44436. this.getValue(e, t)
  44437. },
  44438. setValue: function(e, t) {
  44439. this.bind(),
  44440. this.setValue(e, t)
  44441. },
  44442. bind: function() {
  44443. var e = this.node
  44444. , t = this.parsedPath
  44445. , i = t.objectName
  44446. , r = t.propertyName
  44447. , o = t.propertyIndex;
  44448. if (e || (e = n.PropertyBinding.findNode(this.rootNode, t.nodeName) || this.rootNode,
  44449. this.node = e),
  44450. this.getValue = this._getValue_unavailable,
  44451. this.setValue = this._setValue_unavailable,
  44452. !e)
  44453. return void console.error(" trying to update node for track: " + this.path + " but it wasn't found.");
  44454. if (i) {
  44455. var a = t.objectIndex;
  44456. switch (i) {
  44457. case "materials":
  44458. if (!e.material)
  44459. return void console.error(" can not bind to material as node does not have a material", this);
  44460. if (!e.material.materials)
  44461. return void console.error(" can not bind to material.materials as node.material does not have a materials array", this);
  44462. e = e.material.materials;
  44463. break;
  44464. case "bones":
  44465. if (!e.skeleton)
  44466. return void console.error(" can not bind to bones as node does not have a skeleton", this);
  44467. e = e.skeleton.bones;
  44468. for (var s = 0; s < e.length; s++)
  44469. if (e[s].name === a) {
  44470. a = s;
  44471. break
  44472. }
  44473. break;
  44474. default:
  44475. if (void 0 === e[i])
  44476. return void console.error(" can not bind to objectName of node, undefined", this);
  44477. e = e[i]
  44478. }
  44479. if (void 0 !== a) {
  44480. if (void 0 === e[a])
  44481. return void console.error(" trying to bind to objectIndex of objectName, but is undefined:", this, e);
  44482. e = e[a]
  44483. }
  44484. }
  44485. var l = e[r];
  44486. if (!l) {
  44487. var c = t.nodeName;
  44488. return void console.error(" trying to update property for track: " + c + "." + r + " but it wasn't found.", e)
  44489. }
  44490. var h = this.Versioning.None;
  44491. void 0 !== e.needsUpdate ? (h = this.Versioning.NeedsUpdate,
  44492. this.targetObject = e) : void 0 !== e.matrixWorldNeedsUpdate && (h = this.Versioning.MatrixWorldNeedsUpdate,
  44493. this.targetObject = e);
  44494. var u = this.BindingType.Direct;
  44495. if (void 0 !== o) {
  44496. if ("morphTargetInfluences" === r) {
  44497. if (!e.geometry)
  44498. return void console.error(" can not bind to morphTargetInfluences becasuse node does not have a geometry", this);
  44499. if (!e.geometry.morphTargets)
  44500. return void console.error(" can not bind to morphTargetInfluences becasuse node does not have a geometry.morphTargets", this);
  44501. for (var s = 0; s < this.node.geometry.morphTargets.length; s++)
  44502. if (e.geometry.morphTargets[s].name === o) {
  44503. o = s;
  44504. break
  44505. }
  44506. }
  44507. u = this.BindingType.ArrayElement,
  44508. this.resolvedProperty = l,
  44509. this.propertyIndex = o
  44510. } else
  44511. void 0 !== l.fromArray && void 0 !== l.toArray ? (u = this.BindingType.HasFromToArray,
  44512. this.resolvedProperty = l) : void 0 !== l.length ? (u = this.BindingType.EntireArray,
  44513. this.resolvedProperty = l) : this.propertyName = r;
  44514. this.getValue = this.GetterByBindingType[u],
  44515. this.setValue = this.SetterByBindingTypeAndVersioning[u][h]
  44516. },
  44517. unbind: function() {
  44518. this.node = null,
  44519. this.getValue = this._getValue_unbound,
  44520. this.setValue = this._setValue_unbound
  44521. }
  44522. },
  44523. Object.assign(n.PropertyBinding.prototype, {
  44524. _getValue_unavailable: function() {},
  44525. _setValue_unavailable: function() {},
  44526. _getValue_unbound: n.PropertyBinding.prototype.getValue,
  44527. _setValue_unbound: n.PropertyBinding.prototype.setValue,
  44528. BindingType: {
  44529. Direct: 0,
  44530. EntireArray: 1,
  44531. ArrayElement: 2,
  44532. HasFromToArray: 3
  44533. },
  44534. Versioning: {
  44535. None: 0,
  44536. NeedsUpdate: 1,
  44537. MatrixWorldNeedsUpdate: 2
  44538. },
  44539. GetterByBindingType: [function(e, t) {
  44540. e[t] = this.node[this.propertyName]
  44541. }
  44542. , function(e, t) {
  44543. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  44544. e[t++] = i[n]
  44545. }
  44546. , function(e, t) {
  44547. e[t] = this.resolvedProperty[this.propertyIndex]
  44548. }
  44549. , function(e, t) {
  44550. this.resolvedProperty.toArray(e, t)
  44551. }
  44552. ],
  44553. SetterByBindingTypeAndVersioning: [[function(e, t) {
  44554. this.node[this.propertyName] = e[t]
  44555. }
  44556. , function(e, t) {
  44557. this.node[this.propertyName] = e[t],
  44558. this.targetObject.needsUpdate = !0
  44559. }
  44560. , function(e, t) {
  44561. this.node[this.propertyName] = e[t],
  44562. this.targetObject.matrixWorldNeedsUpdate = !0
  44563. }
  44564. ], [function(e, t) {
  44565. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  44566. i[n] = e[t++]
  44567. }
  44568. , function(e, t) {
  44569. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  44570. i[n] = e[t++];
  44571. this.targetObject.needsUpdate = !0
  44572. }
  44573. , function(e, t) {
  44574. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  44575. i[n] = e[t++];
  44576. this.targetObject.matrixWorldNeedsUpdate = !0
  44577. }
  44578. ], [function(e, t) {
  44579. this.resolvedProperty[this.propertyIndex] = e[t]
  44580. }
  44581. , function(e, t) {
  44582. this.resolvedProperty[this.propertyIndex] = e[t],
  44583. this.targetObject.needsUpdate = !0
  44584. }
  44585. , function(e, t) {
  44586. this.resolvedProperty[this.propertyIndex] = e[t],
  44587. this.targetObject.matrixWorldNeedsUpdate = !0
  44588. }
  44589. ], [function(e, t) {
  44590. this.resolvedProperty.fromArray(e, t)
  44591. }
  44592. , function(e, t) {
  44593. this.resolvedProperty.fromArray(e, t),
  44594. this.targetObject.needsUpdate = !0
  44595. }
  44596. , function(e, t) {
  44597. this.resolvedProperty.fromArray(e, t),
  44598. this.targetObject.matrixWorldNeedsUpdate = !0
  44599. }
  44600. ]]
  44601. }),
  44602. n.PropertyBinding.Composite = function(e, t, i) {
  44603. var r = i || n.PropertyBinding.parseTrackName(t);
  44604. this._targetGroup = e,
  44605. this._bindings = e.subscribe_(t, r)
  44606. }
  44607. ,
  44608. n.PropertyBinding.Composite.prototype = {
  44609. constructor: n.PropertyBinding.Composite,
  44610. getValue: function(e, t) {
  44611. this.bind();
  44612. var i = this._targetGroup.nCachedObjects_
  44613. , n = this._bindings[i];
  44614. void 0 !== n && n.getValue(e, t)
  44615. },
  44616. setValue: function(e, t) {
  44617. for (var i = this._bindings, n = this._targetGroup.nCachedObjects_, r = i.length; n !== r; ++n)
  44618. i[n].setValue(e, t)
  44619. },
  44620. bind: function() {
  44621. for (var e = this._bindings, t = this._targetGroup.nCachedObjects_, i = e.length; t !== i; ++t)
  44622. e[t].bind()
  44623. },
  44624. unbind: function() {
  44625. for (var e = this._bindings, t = this._targetGroup.nCachedObjects_, i = e.length; t !== i; ++t)
  44626. e[t].unbind()
  44627. }
  44628. },
  44629. n.PropertyBinding.create = function(e, t, i) {
  44630. return e instanceof n.AnimationObjectGroup ? new n.PropertyBinding.Composite(e,t,i) : new n.PropertyBinding(e,t,i)
  44631. }
  44632. ,
  44633. n.PropertyBinding.parseTrackName = function(e) {
  44634. var t = /^(([\w]+\/)*)([\w-\d]+)?(\.([\w]+)(\[([\w\d\[\]\_.:\- ]+)\])?)?(\.([\w.]+)(\[([\w\d\[\]\_. ]+)\])?)$/
  44635. , i = t.exec(e);
  44636. if (!i)
  44637. throw new Error("cannot parse trackName at all: " + e);
  44638. i.index === t.lastIndex && t.lastIndex++;
  44639. var n = {
  44640. nodeName: i[3],
  44641. objectName: i[5],
  44642. objectIndex: i[7],
  44643. propertyName: i[9],
  44644. propertyIndex: i[11]
  44645. };
  44646. if (null === n.propertyName || 0 === n.propertyName.length)
  44647. throw new Error("can not parse propertyName from trackName: " + e);
  44648. return n
  44649. }
  44650. ,
  44651. n.PropertyBinding.findNode = function(e, t) {
  44652. if (!t || "" === t || "root" === t || "." === t || t === -1 || t === e.name || t === e.uuid)
  44653. return e;
  44654. if (e.skeleton) {
  44655. var i = function(e) {
  44656. for (var i = 0; i < e.bones.length; i++) {
  44657. var n = e.bones[i];
  44658. if (n.name === t)
  44659. return n
  44660. }
  44661. return null
  44662. }
  44663. , n = i(e.skeleton);
  44664. if (n)
  44665. return n
  44666. }
  44667. if (e.children) {
  44668. var r = function(e) {
  44669. for (var i = 0; i < e.length; i++) {
  44670. var n = e[i];
  44671. if (n.name === t || n.uuid === t)
  44672. return n;
  44673. var o = r(n.children);
  44674. if (o)
  44675. return o
  44676. }
  44677. return null
  44678. }
  44679. , o = r(e.children);
  44680. if (o)
  44681. return o
  44682. }
  44683. return null
  44684. }
  44685. ,
  44686. n.PropertyMixer = function(e, t, i) {
  44687. this.binding = e,
  44688. this.valueSize = i;
  44689. var n, r = Float64Array;
  44690. switch (t) {
  44691. case "quaternion":
  44692. n = this._slerp;
  44693. break;
  44694. case "string":
  44695. case "bool":
  44696. r = Array,
  44697. n = this._select;
  44698. break;
  44699. default:
  44700. n = this._lerp
  44701. }
  44702. this.buffer = new r(4 * i),
  44703. this._mixBufferRegion = n,
  44704. this.cumulativeWeight = 0,
  44705. this.useCount = 0,
  44706. this.referenceCount = 0
  44707. }
  44708. ,
  44709. n.PropertyMixer.prototype = {
  44710. constructor: n.PropertyMixer,
  44711. accumulate: function(e, t) {
  44712. var i = this.buffer
  44713. , n = this.valueSize
  44714. , r = e * n + n
  44715. , o = this.cumulativeWeight;
  44716. if (0 === o) {
  44717. for (var a = 0; a !== n; ++a)
  44718. i[r + a] = i[a];
  44719. o = t
  44720. } else {
  44721. o += t;
  44722. var s = t / o;
  44723. this._mixBufferRegion(i, r, 0, s, n)
  44724. }
  44725. this.cumulativeWeight = o
  44726. },
  44727. apply: function(e) {
  44728. var t = this.valueSize
  44729. , i = this.buffer
  44730. , n = e * t + t
  44731. , r = this.cumulativeWeight
  44732. , o = this.binding;
  44733. if (this.cumulativeWeight = 0,
  44734. r < 1) {
  44735. var a = 3 * t;
  44736. this._mixBufferRegion(i, n, a, 1 - r, t)
  44737. }
  44738. for (var s = t, l = t + t; s !== l; ++s)
  44739. if (i[s] !== i[s + t]) {
  44740. o.setValue(i, n);
  44741. break
  44742. }
  44743. },
  44744. saveOriginalState: function() {
  44745. var e = this.binding
  44746. , t = this.buffer
  44747. , i = this.valueSize
  44748. , n = 3 * i;
  44749. e.getValue(t, n);
  44750. for (var r = i, o = n; r !== o; ++r)
  44751. t[r] = t[n + r % i];
  44752. this.cumulativeWeight = 0
  44753. },
  44754. restoreOriginalState: function() {
  44755. var e = 3 * this.valueSize;
  44756. this.binding.setValue(this.buffer, e)
  44757. },
  44758. _select: function(e, t, i, n, r) {
  44759. if (n >= .5)
  44760. for (var o = 0; o !== r; ++o)
  44761. e[t + o] = e[i + o]
  44762. },
  44763. _slerp: function(e, t, i, r, o) {
  44764. n.Quaternion.slerpFlat(e, t, e, t, e, i, r)
  44765. },
  44766. _lerp: function(e, t, i, n, r) {
  44767. for (var o = 1 - n, a = 0; a !== r; ++a) {
  44768. var s = t + a;
  44769. e[s] = e[s] * o + e[i + a] * n
  44770. }
  44771. }
  44772. },
  44773. n.BooleanKeyframeTrack = function(e, t, i) {
  44774. n.KeyframeTrack.call(this, e, t, i)
  44775. }
  44776. ,
  44777. n.BooleanKeyframeTrack.prototype = Object.assign(Object.create(n.KeyframeTrack.prototype), {
  44778. constructor: n.BooleanKeyframeTrack,
  44779. ValueTypeName: "bool",
  44780. ValueBufferType: Array,
  44781. DefaultInterpolation: n.IntepolateDiscrete,
  44782. InterpolantFactoryMethodLinear: void 0,
  44783. InterpolantFactoryMethodSmooth: void 0
  44784. }),
  44785. n.NumberKeyframeTrack = function(e, t, i, r) {
  44786. n.KeyframeTrack.call(this, e, t, i, r)
  44787. }
  44788. ,
  44789. n.NumberKeyframeTrack.prototype = Object.assign(Object.create(n.KeyframeTrack.prototype), {
  44790. constructor: n.NumberKeyframeTrack,
  44791. ValueTypeName: "number"
  44792. }),
  44793. n.QuaternionKeyframeTrack = function(e, t, i, r) {
  44794. n.KeyframeTrack.call(this, e, t, i, r)
  44795. }
  44796. ,
  44797. n.QuaternionKeyframeTrack.prototype = Object.assign(Object.create(n.KeyframeTrack.prototype), {
  44798. constructor: n.QuaternionKeyframeTrack,
  44799. ValueTypeName: "quaternion",
  44800. DefaultInterpolation: n.InterpolateLinear,
  44801. InterpolantFactoryMethodLinear: function(e) {
  44802. return new n.QuaternionLinearInterpolant(this.times,this.values,this.getValueSize(),e)
  44803. },
  44804. InterpolantFactoryMethodSmooth: void 0
  44805. }),
  44806. n.StringKeyframeTrack = function(e, t, i, r) {
  44807. n.KeyframeTrack.call(this, e, t, i, r)
  44808. }
  44809. ,
  44810. n.StringKeyframeTrack.prototype = Object.assign(Object.create(n.KeyframeTrack.prototype), {
  44811. constructor: n.StringKeyframeTrack,
  44812. ValueTypeName: "string",
  44813. ValueBufferType: Array,
  44814. DefaultInterpolation: n.IntepolateDiscrete,
  44815. InterpolantFactoryMethodLinear: void 0,
  44816. InterpolantFactoryMethodSmooth: void 0
  44817. }),
  44818. n.VectorKeyframeTrack = function(e, t, i, r) {
  44819. n.KeyframeTrack.call(this, e, t, i, r)
  44820. }
  44821. ,
  44822. n.VectorKeyframeTrack.prototype = Object.assign(Object.create(n.KeyframeTrack.prototype), {
  44823. constructor: n.VectorKeyframeTrack,
  44824. ValueTypeName: "vector"
  44825. }),
  44826. n.Audio = function(e) {
  44827. n.Object3D.call(this),
  44828. this.type = "Audio",
  44829. this.context = e.context,
  44830. this.source = this.context.createBufferSource(),
  44831. this.source.onended = this.onEnded.bind(this),
  44832. this.gain = this.context.createGain(),
  44833. this.gain.connect(e.getInput()),
  44834. this.autoplay = !1,
  44835. this.startTime = 0,
  44836. this.playbackRate = 1,
  44837. this.isPlaying = !1,
  44838. this.hasPlaybackControl = !0,
  44839. this.sourceType = "empty",
  44840. this.filter = null
  44841. }
  44842. ,
  44843. n.Audio.prototype = Object.create(n.Object3D.prototype),
  44844. n.Audio.prototype.constructor = n.Audio,
  44845. n.Audio.prototype.getOutput = function() {
  44846. return this.gain
  44847. }
  44848. ,
  44849. n.Audio.prototype.load = function(e) {
  44850. var t = new n.AudioBuffer(this.context);
  44851. return t.load(e),
  44852. this.setBuffer(t),
  44853. this
  44854. }
  44855. ,
  44856. n.Audio.prototype.setNodeSource = function(e) {
  44857. return this.hasPlaybackControl = !1,
  44858. this.sourceType = "audioNode",
  44859. this.source = e,
  44860. this.connect(),
  44861. this
  44862. }
  44863. ,
  44864. n.Audio.prototype.setBuffer = function(e) {
  44865. var t = this;
  44866. return e.onReady(function(e) {
  44867. t.source.buffer = e,
  44868. t.sourceType = "buffer",
  44869. t.autoplay && t.play()
  44870. }),
  44871. this
  44872. }
  44873. ,
  44874. n.Audio.prototype.play = function() {
  44875. if (this.isPlaying === !0)
  44876. return void console.warn("THREE.Audio: Audio is already playing.");
  44877. if (this.hasPlaybackControl === !1)
  44878. return void console.warn("THREE.Audio: this Audio has no playback control.");
  44879. var e = this.context.createBufferSource();
  44880. e.buffer = this.source.buffer,
  44881. e.loop = this.source.loop,
  44882. e.onended = this.source.onended,
  44883. e.start(0, this.startTime),
  44884. e.playbackRate.value = this.playbackRate,
  44885. this.isPlaying = !0,
  44886. this.source = e,
  44887. this.connect()
  44888. }
  44889. ,
  44890. n.Audio.prototype.pause = function() {
  44891. return this.hasPlaybackControl === !1 ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.source.stop(),
  44892. void (this.startTime = this.context.currentTime))
  44893. }
  44894. ,
  44895. n.Audio.prototype.stop = function() {
  44896. return this.hasPlaybackControl === !1 ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.source.stop(),
  44897. void (this.startTime = 0))
  44898. }
  44899. ,
  44900. n.Audio.prototype.connect = function() {
  44901. null !== this.filter ? (this.source.connect(this.filter),
  44902. this.filter.connect(this.getOutput())) : this.source.connect(this.getOutput())
  44903. }
  44904. ,
  44905. n.Audio.prototype.disconnect = function() {
  44906. null !== this.filter ? (this.source.disconnect(this.filter),
  44907. this.filter.disconnect(this.getOutput())) : this.source.disconnect(this.getOutput())
  44908. }
  44909. ,
  44910. n.Audio.prototype.getFilter = function() {
  44911. return this.filter
  44912. }
  44913. ,
  44914. n.Audio.prototype.setFilter = function(e) {
  44915. void 0 === e && (e = null),
  44916. this.isPlaying === !0 ? (this.disconnect(),
  44917. this.filter = e,
  44918. this.connect()) : this.filter = e
  44919. }
  44920. ,
  44921. n.Audio.prototype.setPlaybackRate = function(e) {
  44922. return this.hasPlaybackControl === !1 ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.playbackRate = e,
  44923. void (this.isPlaying === !0 && (this.source.playbackRate.value = this.playbackRate)))
  44924. }
  44925. ,
  44926. n.Audio.prototype.getPlaybackRate = function() {
  44927. return this.playbackRate
  44928. }
  44929. ,
  44930. n.Audio.prototype.onEnded = function() {
  44931. this.isPlaying = !1
  44932. }
  44933. ,
  44934. n.Audio.prototype.setLoop = function(e) {
  44935. return this.hasPlaybackControl === !1 ? void console.warn("THREE.Audio: this Audio has no playback control.") : void (this.source.loop = e)
  44936. }
  44937. ,
  44938. n.Audio.prototype.getLoop = function() {
  44939. return this.hasPlaybackControl === !1 ? (console.warn("THREE.Audio: this Audio has no playback control."),
  44940. !1) : this.source.loop
  44941. }
  44942. ,
  44943. n.Audio.prototype.setVolume = function(e) {
  44944. this.gain.gain.value = e
  44945. }
  44946. ,
  44947. n.Audio.prototype.getVolume = function() {
  44948. return this.gain.gain.value
  44949. }
  44950. ,
  44951. n.AudioAnalyser = function(e, t) {
  44952. this.analyser = e.context.createAnalyser(),
  44953. this.analyser.fftSize = void 0 !== t ? t : 2048,
  44954. this.data = new Uint8Array(this.analyser.frequencyBinCount),
  44955. e.getOutput().connect(this.analyser)
  44956. }
  44957. ,
  44958. n.AudioAnalyser.prototype = {
  44959. constructor: n.AudioAnalyser,
  44960. getData: function() {
  44961. return this.analyser.getByteFrequencyData(this.data),
  44962. this.data
  44963. }
  44964. },
  44965. n.AudioBuffer = function(e) {
  44966. this.context = e,
  44967. this.ready = !1,
  44968. this.readyCallbacks = []
  44969. }
  44970. ,
  44971. n.AudioBuffer.prototype.load = function(e) {
  44972. var t = this
  44973. , i = new XMLHttpRequest;
  44974. return i.open("GET", e, !0),
  44975. i.responseType = "arraybuffer",
  44976. i.onload = function(e) {
  44977. t.context.decodeAudioData(this.response, function(e) {
  44978. t.buffer = e,
  44979. t.ready = !0;
  44980. for (var i = 0; i < t.readyCallbacks.length; i++)
  44981. t.readyCallbacks[i](t.buffer);
  44982. t.readyCallbacks = []
  44983. })
  44984. }
  44985. ,
  44986. i.send(),
  44987. this
  44988. }
  44989. ,
  44990. n.AudioBuffer.prototype.onReady = function(e) {
  44991. this.ready ? e(this.buffer) : this.readyCallbacks.push(e)
  44992. }
  44993. ,
  44994. n.PositionalAudio = function(e) {
  44995. n.Audio.call(this, e),
  44996. this.panner = this.context.createPanner(),
  44997. this.panner.connect(this.gain)
  44998. }
  44999. ,
  45000. n.PositionalAudio.prototype = Object.create(n.Audio.prototype),
  45001. n.PositionalAudio.prototype.constructor = n.PositionalAudio,
  45002. n.PositionalAudio.prototype.getOutput = function() {
  45003. return this.panner
  45004. }
  45005. ,
  45006. n.PositionalAudio.prototype.setRefDistance = function(e) {
  45007. this.panner.refDistance = e
  45008. }
  45009. ,
  45010. n.PositionalAudio.prototype.getRefDistance = function() {
  45011. return this.panner.refDistance
  45012. }
  45013. ,
  45014. n.PositionalAudio.prototype.setRolloffFactor = function(e) {
  45015. this.panner.rolloffFactor = e
  45016. }
  45017. ,
  45018. n.PositionalAudio.prototype.getRolloffFactor = function() {
  45019. return this.panner.rolloffFactor
  45020. }
  45021. ,
  45022. n.PositionalAudio.prototype.setDistanceModel = function(e) {
  45023. this.panner.distanceModel = e
  45024. }
  45025. ,
  45026. n.PositionalAudio.prototype.getDistanceModel = function() {
  45027. return this.panner.distanceModel
  45028. }
  45029. ,
  45030. n.PositionalAudio.prototype.setMaxDistance = function(e) {
  45031. this.panner.maxDistance = e
  45032. }
  45033. ,
  45034. n.PositionalAudio.prototype.getMaxDistance = function() {
  45035. return this.panner.maxDistance
  45036. }
  45037. ,
  45038. n.PositionalAudio.prototype.updateMatrixWorld = function() {
  45039. var e = new n.Vector3;
  45040. return function(t) {
  45041. n.Object3D.prototype.updateMatrixWorld.call(this, t),
  45042. e.setFromMatrixPosition(this.matrixWorld),
  45043. this.panner.setPosition(e.x, e.y, e.z)
  45044. }
  45045. }(),
  45046. n.AudioListener = function() {
  45047. n.Object3D.call(this),
  45048. this.type = "AudioListener",
  45049. this.context = new (window.AudioContext || window.webkitAudioContext),
  45050. this.gain = this.context.createGain(),
  45051. this.gain.connect(this.context.destination),
  45052. this.filter = null
  45053. }
  45054. ,
  45055. n.AudioListener.prototype = Object.create(n.Object3D.prototype),
  45056. n.AudioListener.prototype.constructor = n.AudioListener,
  45057. n.AudioListener.prototype.getInput = function() {
  45058. return this.gain
  45059. }
  45060. ,
  45061. n.AudioListener.prototype.removeFilter = function() {
  45062. null !== this.filter && (this.gain.disconnect(this.filter),
  45063. this.filter.disconnect(this.context.destination),
  45064. this.gain.connect(this.context.destination),
  45065. this.filter = null)
  45066. }
  45067. ,
  45068. n.AudioListener.prototype.setFilter = function(e) {
  45069. null !== this.filter ? (this.gain.disconnect(this.filter),
  45070. this.filter.disconnect(this.context.destination)) : this.gain.disconnect(this.context.destination),
  45071. this.filter = e,
  45072. this.gain.connect(this.filter),
  45073. this.filter.connect(this.context.destination)
  45074. }
  45075. ,
  45076. n.AudioListener.prototype.getFilter = function() {
  45077. return this.filter
  45078. }
  45079. ,
  45080. n.AudioListener.prototype.setMasterVolume = function(e) {
  45081. this.gain.gain.value = e
  45082. }
  45083. ,
  45084. n.AudioListener.prototype.getMasterVolume = function() {
  45085. return this.gain.gain.value
  45086. }
  45087. ,
  45088. n.AudioListener.prototype.updateMatrixWorld = function() {
  45089. var e = new n.Vector3
  45090. , t = new n.Quaternion
  45091. , i = new n.Vector3
  45092. , r = new n.Vector3;
  45093. return function(o) {
  45094. n.Object3D.prototype.updateMatrixWorld.call(this, o);
  45095. var a = this.context.listener
  45096. , s = this.up;
  45097. this.matrixWorld.decompose(e, t, i),
  45098. r.set(0, 0, -1).applyQuaternion(t),
  45099. a.setPosition(e.x, e.y, e.z),
  45100. a.setOrientation(r.x, r.y, r.z, s.x, s.y, s.z)
  45101. }
  45102. }(),
  45103. n.Camera = function() {
  45104. n.Object3D.call(this),
  45105. this.type = "Camera",
  45106. this.matrixWorldInverse = new n.Matrix4,
  45107. this.projectionMatrix = new n.Matrix4
  45108. }
  45109. ,
  45110. n.Camera.prototype = Object.create(n.Object3D.prototype),
  45111. n.Camera.prototype.constructor = n.Camera,
  45112. n.Camera.prototype.getWorldDirection = function() {
  45113. var e = new n.Quaternion;
  45114. return function(t) {
  45115. var i = t || new n.Vector3;
  45116. return this.getWorldQuaternion(e),
  45117. i.set(0, 0, -1).applyQuaternion(e)
  45118. }
  45119. }(),
  45120. n.Camera.prototype.lookAt = function() {
  45121. var e = new n.Matrix4;
  45122. return function(t) {
  45123. e.lookAt(this.position, t, this.up),
  45124. this.quaternion.setFromRotationMatrix(e)
  45125. }
  45126. }(),
  45127. n.Camera.prototype.clone = function() {
  45128. return (new this.constructor).copy(this)
  45129. }
  45130. ,
  45131. n.Camera.prototype.copy = function(e) {
  45132. return n.Object3D.prototype.copy.call(this, e),
  45133. this.matrixWorldInverse.copy(e.matrixWorldInverse),
  45134. this.projectionMatrix.copy(e.projectionMatrix),
  45135. this
  45136. }
  45137. ,
  45138. n.CubeCamera = function(e, t, i) {
  45139. n.Object3D.call(this),
  45140. this.type = "CubeCamera";
  45141. var r = 90
  45142. , o = 1
  45143. , a = new n.PerspectiveCamera(r,o,e,t);
  45144. a.up.set(0, -1, 0),
  45145. a.lookAt(new n.Vector3(1,0,0)),
  45146. this.add(a);
  45147. var s = new n.PerspectiveCamera(r,o,e,t);
  45148. s.up.set(0, -1, 0),
  45149. s.lookAt(new n.Vector3(-1,0,0)),
  45150. this.add(s);
  45151. var l = new n.PerspectiveCamera(r,o,e,t);
  45152. l.up.set(0, 0, 1),
  45153. l.lookAt(new n.Vector3(0,1,0)),
  45154. this.add(l);
  45155. var c = new n.PerspectiveCamera(r,o,e,t);
  45156. c.up.set(0, 0, -1),
  45157. c.lookAt(new n.Vector3(0,-1,0)),
  45158. this.add(c);
  45159. var h = new n.PerspectiveCamera(r,o,e,t);
  45160. h.up.set(0, -1, 0),
  45161. h.lookAt(new n.Vector3(0,0,1)),
  45162. this.add(h);
  45163. var u = new n.PerspectiveCamera(r,o,e,t);
  45164. u.up.set(0, -1, 0),
  45165. u.lookAt(new n.Vector3(0,0,-1)),
  45166. this.add(u);
  45167. var d = {
  45168. format: n.RGBFormat,
  45169. magFilter: n.LinearFilter,
  45170. minFilter: n.LinearFilter
  45171. };
  45172. this.renderTarget = new n.WebGLRenderTargetCube(i,i,d),
  45173. this.updateCubeMap = function(e, t) {
  45174. null === this.parent && this.updateMatrixWorld();
  45175. var i = this.renderTarget
  45176. , n = i.texture.generateMipmaps;
  45177. i.texture.generateMipmaps = !1,
  45178. i.activeCubeFace = 0,
  45179. e.render(t, a, i),
  45180. i.activeCubeFace = 1,
  45181. e.render(t, s, i),
  45182. i.activeCubeFace = 2,
  45183. e.render(t, l, i),
  45184. i.activeCubeFace = 3,
  45185. e.render(t, c, i),
  45186. i.activeCubeFace = 4,
  45187. e.render(t, h, i),
  45188. i.texture.generateMipmaps = n,
  45189. i.activeCubeFace = 5,
  45190. e.render(t, u, i),
  45191. e.setRenderTarget(null)
  45192. }
  45193. }
  45194. ,
  45195. n.CubeCamera.prototype = Object.create(n.Object3D.prototype),
  45196. n.CubeCamera.prototype.constructor = n.CubeCamera,
  45197. n.OrthographicCamera = function(e, t, i, r, o, a) {
  45198. n.Camera.call(this),
  45199. this.type = "OrthographicCamera",
  45200. this.zoom = 1,
  45201. this.left = e,
  45202. this.right = t,
  45203. this.top = i,
  45204. this.bottom = r,
  45205. this.near = void 0 !== o ? o : .1,
  45206. this.far = void 0 !== a ? a : 2e3,
  45207. this.updateProjectionMatrix()
  45208. }
  45209. ,
  45210. n.OrthographicCamera.prototype = Object.create(n.Camera.prototype),
  45211. n.OrthographicCamera.prototype.constructor = n.OrthographicCamera,
  45212. n.OrthographicCamera.prototype.updateProjectionMatrix = function() {
  45213. var e = (this.right - this.left) / (2 * this.zoom)
  45214. , t = (this.top - this.bottom) / (2 * this.zoom)
  45215. , i = (this.right + this.left) / 2
  45216. , n = (this.top + this.bottom) / 2;
  45217. this.projectionMatrix.makeOrthographic(i - e, i + e, n + t, n - t, this.near, this.far)
  45218. }
  45219. ,
  45220. n.OrthographicCamera.prototype.copy = function(e) {
  45221. return n.Camera.prototype.copy.call(this, e),
  45222. this.left = e.left,
  45223. this.right = e.right,
  45224. this.top = e.top,
  45225. this.bottom = e.bottom,
  45226. this.near = e.near,
  45227. this.far = e.far,
  45228. this.zoom = e.zoom,
  45229. this
  45230. }
  45231. ,
  45232. n.OrthographicCamera.prototype.toJSON = function(e) {
  45233. var t = n.Object3D.prototype.toJSON.call(this, e);
  45234. return t.object.zoom = this.zoom,
  45235. t.object.left = this.left,
  45236. t.object.right = this.right,
  45237. t.object.top = this.top,
  45238. t.object.bottom = this.bottom,
  45239. t.object.near = this.near,
  45240. t.object.far = this.far,
  45241. t
  45242. }
  45243. ,
  45244. n.PerspectiveCamera = function(e, t, i, r) {
  45245. n.Camera.call(this),
  45246. this.type = "PerspectiveCamera",
  45247. this.focalLength = 10,
  45248. this.zoom = 1,
  45249. this.fov = void 0 !== e ? e : 50,
  45250. this.aspect = void 0 !== t ? t : 1,
  45251. this.near = void 0 !== i ? i : .1,
  45252. this.far = void 0 !== r ? r : 2e3,
  45253. this.updateProjectionMatrix()
  45254. }
  45255. ,
  45256. n.PerspectiveCamera.prototype = Object.create(n.Camera.prototype),
  45257. n.PerspectiveCamera.prototype.constructor = n.PerspectiveCamera,
  45258. n.PerspectiveCamera.prototype.setLens = function(e, t) {
  45259. void 0 === t && (t = 24),
  45260. this.fov = 2 * n.Math.radToDeg(Math.atan(t / (2 * e))),
  45261. this.updateProjectionMatrix()
  45262. }
  45263. ,
  45264. n.PerspectiveCamera.prototype.setViewOffset = function(e, t, i, n, r, o) {
  45265. this.fullWidth = e,
  45266. this.fullHeight = t,
  45267. this.x = i,
  45268. this.y = n,
  45269. this.width = r,
  45270. this.height = o,
  45271. this.updateProjectionMatrix()
  45272. }
  45273. ,
  45274. n.PerspectiveCamera.prototype.updateProjectionMatrix = function() {
  45275. var e = n.Math.radToDeg(2 * Math.atan(Math.tan(.5 * n.Math.degToRad(this.fov)) / this.zoom));
  45276. if (this.fullWidth) {
  45277. var t = this.fullWidth / this.fullHeight
  45278. , i = Math.tan(n.Math.degToRad(.5 * e)) * this.near
  45279. , r = -i
  45280. , o = t * r
  45281. , a = t * i
  45282. , s = Math.abs(a - o)
  45283. , l = Math.abs(i - r);
  45284. 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)
  45285. } else
  45286. this.projectionMatrix.makePerspective(e, this.aspect, this.near, this.far)
  45287. }
  45288. ,
  45289. n.PerspectiveCamera.prototype.copy = function(e) {
  45290. return n.Camera.prototype.copy.call(this, e),
  45291. this.focalLength = e.focalLength,
  45292. this.zoom = e.zoom,
  45293. this.fov = e.fov,
  45294. this.aspect = e.aspect,
  45295. this.near = e.near,
  45296. this.far = e.far,
  45297. this
  45298. }
  45299. ,
  45300. n.PerspectiveCamera.prototype.toJSON = function(e) {
  45301. var t = n.Object3D.prototype.toJSON.call(this, e);
  45302. return t.object.focalLength = this.focalLength,
  45303. t.object.zoom = this.zoom,
  45304. t.object.fov = this.fov,
  45305. t.object.aspect = this.aspect,
  45306. t.object.near = this.near,
  45307. t.object.far = this.far,
  45308. t
  45309. }
  45310. ,
  45311. n.StereoCamera = function() {
  45312. this.type = "StereoCamera",
  45313. this.aspect = 1,
  45314. this.cameraL = new n.PerspectiveCamera,
  45315. this.cameraL.layers.enable(1),
  45316. this.cameraL.matrixAutoUpdate = !1,
  45317. this.cameraR = new n.PerspectiveCamera,
  45318. this.cameraR.layers.enable(2),
  45319. this.cameraR.matrixAutoUpdate = !1
  45320. }
  45321. ,
  45322. n.StereoCamera.prototype = {
  45323. constructor: n.StereoCamera,
  45324. update: function() {
  45325. var e, t, i, r, o, a = new n.Matrix4, s = new n.Matrix4;
  45326. return function(l) {
  45327. var c = e !== l.focalLength || t !== l.fov || i !== l.aspect * this.aspect || r !== l.near || o !== l.far;
  45328. if (c) {
  45329. e = l.focalLength,
  45330. t = l.fov,
  45331. i = l.aspect * this.aspect,
  45332. r = l.near,
  45333. o = l.far;
  45334. var h, u, d = l.projectionMatrix.clone(), p = .032, f = p * r / e, g = r * Math.tan(n.Math.degToRad(.5 * t));
  45335. s.elements[12] = -p,
  45336. a.elements[12] = p,
  45337. h = -g * i + f,
  45338. u = g * i + f,
  45339. d.elements[0] = 2 * r / (u - h),
  45340. d.elements[8] = (u + h) / (u - h),
  45341. this.cameraL.projectionMatrix.copy(d),
  45342. h = -g * i - f,
  45343. u = g * i - f,
  45344. d.elements[0] = 2 * r / (u - h),
  45345. d.elements[8] = (u + h) / (u - h),
  45346. this.cameraR.projectionMatrix.copy(d)
  45347. }
  45348. this.cameraL.matrixWorld.copy(l.matrixWorld).multiply(s),
  45349. this.cameraR.matrixWorld.copy(l.matrixWorld).multiply(a)
  45350. }
  45351. }()
  45352. },
  45353. n.Light = function(e, t) {
  45354. n.Object3D.call(this),
  45355. this.type = "Light",
  45356. this.color = new n.Color(e),
  45357. this.intensity = void 0 !== t ? t : 1,
  45358. this.receiveShadow = void 0
  45359. }
  45360. ,
  45361. n.Light.prototype = Object.create(n.Object3D.prototype),
  45362. n.Light.prototype.constructor = n.Light,
  45363. n.Light.prototype.copy = function(e) {
  45364. return n.Object3D.prototype.copy.call(this, e),
  45365. this.color.copy(e.color),
  45366. this.intensity = e.intensity,
  45367. this
  45368. }
  45369. ,
  45370. n.Light.prototype.toJSON = function(e) {
  45371. var t = n.Object3D.prototype.toJSON.call(this, e);
  45372. return t.object.color = this.color.getHex(),
  45373. t.object.intensity = this.intensity,
  45374. void 0 !== this.groundColor && (t.object.groundColor = this.groundColor.getHex()),
  45375. void 0 !== this.distance && (t.object.distance = this.distance),
  45376. void 0 !== this.angle && (t.object.angle = this.angle),
  45377. void 0 !== this.decay && (t.object.decay = this.decay),
  45378. void 0 !== this.penumbra && (t.object.penumbra = this.penumbra),
  45379. t
  45380. }
  45381. ,
  45382. n.LightShadow = function(e) {
  45383. this.camera = e,
  45384. this.bias = 0,
  45385. this.radius = 1,
  45386. this.mapSize = new n.Vector2(512,512),
  45387. this.map = null,
  45388. this.matrix = new n.Matrix4
  45389. }
  45390. ,
  45391. n.LightShadow.prototype = {
  45392. constructor: n.LightShadow,
  45393. copy: function(e) {
  45394. return this.camera = e.camera.clone(),
  45395. this.bias = e.bias,
  45396. this.radius = e.radius,
  45397. this.mapSize.copy(e.mapSize),
  45398. this
  45399. },
  45400. clone: function() {
  45401. return (new this.constructor).copy(this)
  45402. }
  45403. },
  45404. n.AmbientLight = function(e, t) {
  45405. n.Light.call(this, e, t),
  45406. this.type = "AmbientLight",
  45407. this.castShadow = void 0
  45408. }
  45409. ,
  45410. n.AmbientLight.prototype = Object.create(n.Light.prototype),
  45411. n.AmbientLight.prototype.constructor = n.AmbientLight,
  45412. n.DirectionalLight = function(e, t) {
  45413. n.Light.call(this, e, t),
  45414. this.type = "DirectionalLight",
  45415. this.position.set(0, 1, 0),
  45416. this.updateMatrix(),
  45417. this.target = new n.Object3D,
  45418. this.shadow = new n.LightShadow(new n.OrthographicCamera(-5,5,5,-5,.5,500))
  45419. }
  45420. ,
  45421. n.DirectionalLight.prototype = Object.create(n.Light.prototype),
  45422. n.DirectionalLight.prototype.constructor = n.DirectionalLight,
  45423. n.DirectionalLight.prototype.copy = function(e) {
  45424. return n.Light.prototype.copy.call(this, e),
  45425. this.target = e.target.clone(),
  45426. this.shadow = e.shadow.clone(),
  45427. this
  45428. }
  45429. ,
  45430. n.HemisphereLight = function(e, t, i) {
  45431. n.Light.call(this, e, i),
  45432. this.type = "HemisphereLight",
  45433. this.castShadow = void 0,
  45434. this.position.set(0, 1, 0),
  45435. this.updateMatrix(),
  45436. this.groundColor = new n.Color(t)
  45437. }
  45438. ,
  45439. n.HemisphereLight.prototype = Object.create(n.Light.prototype),
  45440. n.HemisphereLight.prototype.constructor = n.HemisphereLight,
  45441. n.HemisphereLight.prototype.copy = function(e) {
  45442. return n.Light.prototype.copy.call(this, e),
  45443. this.groundColor.copy(e.groundColor),
  45444. this
  45445. }
  45446. ,
  45447. n.PointLight = function(e, t, i, r) {
  45448. n.Light.call(this, e, t),
  45449. this.type = "PointLight",
  45450. this.distance = void 0 !== i ? i : 0,
  45451. this.decay = void 0 !== r ? r : 1,
  45452. this.shadow = new n.LightShadow(new n.PerspectiveCamera(90,1,.5,500))
  45453. }
  45454. ,
  45455. n.PointLight.prototype = Object.create(n.Light.prototype),
  45456. n.PointLight.prototype.constructor = n.PointLight,
  45457. Object.defineProperty(n.PointLight.prototype, "power", {
  45458. get: function() {
  45459. return 4 * this.intensity * Math.PI
  45460. },
  45461. set: function(e) {
  45462. this.intensity = e / (4 * Math.PI)
  45463. }
  45464. }),
  45465. n.PointLight.prototype.copy = function(e) {
  45466. return n.Light.prototype.copy.call(this, e),
  45467. this.distance = e.distance,
  45468. this.decay = e.decay,
  45469. this.shadow = e.shadow.clone(),
  45470. this
  45471. }
  45472. ,
  45473. n.SpotLight = function(e, t, i, r, o, a) {
  45474. n.Light.call(this, e, t),
  45475. this.type = "SpotLight",
  45476. this.position.set(0, 1, 0),
  45477. this.updateMatrix(),
  45478. this.target = new n.Object3D,
  45479. this.distance = void 0 !== i ? i : 0,
  45480. this.angle = void 0 !== r ? r : Math.PI / 3,
  45481. this.penumbra = void 0 !== o ? o : 0,
  45482. this.decay = void 0 !== a ? a : 1,
  45483. this.shadow = new n.LightShadow(new n.PerspectiveCamera(50,1,.5,500))
  45484. }
  45485. ,
  45486. n.SpotLight.prototype = Object.create(n.Light.prototype),
  45487. n.SpotLight.prototype.constructor = n.SpotLight,
  45488. Object.defineProperty(n.SpotLight.prototype, "power", {
  45489. get: function() {
  45490. return this.intensity * Math.PI
  45491. },
  45492. set: function(e) {
  45493. this.intensity = e / Math.PI
  45494. }
  45495. }),
  45496. n.SpotLight.prototype.copy = function(e) {
  45497. return n.Light.prototype.copy.call(this, e),
  45498. this.distance = e.distance,
  45499. this.angle = e.angle,
  45500. this.penumbra = e.penumbra,
  45501. this.decay = e.decay,
  45502. this.target = e.target.clone(),
  45503. this.shadow = e.shadow.clone(),
  45504. this
  45505. }
  45506. ,
  45507. n.Cache = {
  45508. enabled: !1,
  45509. files: {},
  45510. add: function(e, t) {
  45511. this.enabled !== !1 && (this.files[e] = t)
  45512. },
  45513. get: function(e) {
  45514. if (this.enabled !== !1)
  45515. return this.files[e]
  45516. },
  45517. remove: function(e) {
  45518. delete this.files[e]
  45519. },
  45520. clear: function() {
  45521. this.files = {}
  45522. }
  45523. },
  45524. n.Loader = function() {
  45525. this.onLoadStart = function() {}
  45526. ,
  45527. this.onLoadProgress = function() {}
  45528. ,
  45529. this.onLoadComplete = function() {}
  45530. }
  45531. ,
  45532. n.Loader.prototype = {
  45533. constructor: n.Loader,
  45534. crossOrigin: void 0,
  45535. extractUrlBase: function(e) {
  45536. var t = e.split("/");
  45537. return 1 === t.length ? "./" : (t.pop(),
  45538. t.join("/") + "/")
  45539. },
  45540. initMaterials: function(e, t, i) {
  45541. for (var n = [], r = 0; r < e.length; ++r)
  45542. n[r] = this.createMaterial(e[r], t, i);
  45543. return n
  45544. },
  45545. createMaterial: function() {
  45546. var e, t, i;
  45547. return function(r, o, a) {
  45548. function s(e, i, r, s, c) {
  45549. var h, u = o + e, d = n.Loader.Handlers.get(u);
  45550. null !== d ? h = d.load(u) : (t.setCrossOrigin(a),
  45551. h = t.load(u)),
  45552. void 0 !== i && (h.repeat.fromArray(i),
  45553. 1 !== i[0] && (h.wrapS = n.RepeatWrapping),
  45554. 1 !== i[1] && (h.wrapT = n.RepeatWrapping)),
  45555. void 0 !== r && h.offset.fromArray(r),
  45556. void 0 !== s && ("repeat" === s[0] && (h.wrapS = n.RepeatWrapping),
  45557. "mirror" === s[0] && (h.wrapS = n.MirroredRepeatWrapping),
  45558. "repeat" === s[1] && (h.wrapT = n.RepeatWrapping),
  45559. "mirror" === s[1] && (h.wrapT = n.MirroredRepeatWrapping)),
  45560. void 0 !== c && (h.anisotropy = c);
  45561. var p = n.Math.generateUUID();
  45562. return l[p] = h,
  45563. p
  45564. }
  45565. void 0 === e && (e = new n.Color),
  45566. void 0 === t && (t = new n.TextureLoader),
  45567. void 0 === i && (i = new n.MaterialLoader);
  45568. var l = {}
  45569. , c = {
  45570. uuid: n.Math.generateUUID(),
  45571. type: "MeshLambertMaterial"
  45572. };
  45573. for (var h in r) {
  45574. var u = r[h];
  45575. switch (h) {
  45576. case "DbgColor":
  45577. case "DbgIndex":
  45578. case "opticalDensity":
  45579. case "illumination":
  45580. break;
  45581. case "DbgName":
  45582. c.name = u;
  45583. break;
  45584. case "blending":
  45585. c.blending = n[u];
  45586. break;
  45587. case "colorAmbient":
  45588. case "mapAmbient":
  45589. console.warn("THREE.Loader.createMaterial:", h, "is no longer supported.");
  45590. break;
  45591. case "colorDiffuse":
  45592. c.color = e.fromArray(u).getHex();
  45593. break;
  45594. case "colorSpecular":
  45595. c.specular = e.fromArray(u).getHex();
  45596. break;
  45597. case "colorEmissive":
  45598. c.emissive = e.fromArray(u).getHex();
  45599. break;
  45600. case "specularCoef":
  45601. c.shininess = u;
  45602. break;
  45603. case "shading":
  45604. "basic" === u.toLowerCase() && (c.type = "MeshBasicMaterial"),
  45605. "phong" === u.toLowerCase() && (c.type = "MeshPhongMaterial");
  45606. break;
  45607. case "mapDiffuse":
  45608. c.map = s(u, r.mapDiffuseRepeat, r.mapDiffuseOffset, r.mapDiffuseWrap, r.mapDiffuseAnisotropy);
  45609. break;
  45610. case "mapDiffuseRepeat":
  45611. case "mapDiffuseOffset":
  45612. case "mapDiffuseWrap":
  45613. case "mapDiffuseAnisotropy":
  45614. break;
  45615. case "mapLight":
  45616. c.lightMap = s(u, r.mapLightRepeat, r.mapLightOffset, r.mapLightWrap, r.mapLightAnisotropy);
  45617. break;
  45618. case "mapLightRepeat":
  45619. case "mapLightOffset":
  45620. case "mapLightWrap":
  45621. case "mapLightAnisotropy":
  45622. break;
  45623. case "mapAO":
  45624. c.aoMap = s(u, r.mapAORepeat, r.mapAOOffset, r.mapAOWrap, r.mapAOAnisotropy);
  45625. break;
  45626. case "mapAORepeat":
  45627. case "mapAOOffset":
  45628. case "mapAOWrap":
  45629. case "mapAOAnisotropy":
  45630. break;
  45631. case "mapBump":
  45632. c.bumpMap = s(u, r.mapBumpRepeat, r.mapBumpOffset, r.mapBumpWrap, r.mapBumpAnisotropy);
  45633. break;
  45634. case "mapBumpScale":
  45635. c.bumpScale = u;
  45636. break;
  45637. case "mapBumpRepeat":
  45638. case "mapBumpOffset":
  45639. case "mapBumpWrap":
  45640. case "mapBumpAnisotropy":
  45641. break;
  45642. case "mapNormal":
  45643. c.normalMap = s(u, r.mapNormalRepeat, r.mapNormalOffset, r.mapNormalWrap, r.mapNormalAnisotropy);
  45644. break;
  45645. case "mapNormalFactor":
  45646. c.normalScale = [u, u];
  45647. break;
  45648. case "mapNormalRepeat":
  45649. case "mapNormalOffset":
  45650. case "mapNormalWrap":
  45651. case "mapNormalAnisotropy":
  45652. break;
  45653. case "mapSpecular":
  45654. c.specularMap = s(u, r.mapSpecularRepeat, r.mapSpecularOffset, r.mapSpecularWrap, r.mapSpecularAnisotropy);
  45655. break;
  45656. case "mapSpecularRepeat":
  45657. case "mapSpecularOffset":
  45658. case "mapSpecularWrap":
  45659. case "mapSpecularAnisotropy":
  45660. break;
  45661. case "mapAlpha":
  45662. c.alphaMap = s(u, r.mapAlphaRepeat, r.mapAlphaOffset, r.mapAlphaWrap, r.mapAlphaAnisotropy);
  45663. break;
  45664. case "mapAlphaRepeat":
  45665. case "mapAlphaOffset":
  45666. case "mapAlphaWrap":
  45667. case "mapAlphaAnisotropy":
  45668. break;
  45669. case "flipSided":
  45670. c.side = n.BackSide;
  45671. break;
  45672. case "doubleSided":
  45673. c.side = n.DoubleSide;
  45674. break;
  45675. case "transparency":
  45676. console.warn("THREE.Loader.createMaterial: transparency has been renamed to opacity"),
  45677. c.opacity = u;
  45678. break;
  45679. case "depthTest":
  45680. case "depthWrite":
  45681. case "colorWrite":
  45682. case "opacity":
  45683. case "reflectivity":
  45684. case "transparent":
  45685. case "visible":
  45686. case "wireframe":
  45687. c[h] = u;
  45688. break;
  45689. case "vertexColors":
  45690. u === !0 && (c.vertexColors = n.VertexColors),
  45691. "face" === u && (c.vertexColors = n.FaceColors);
  45692. break;
  45693. default:
  45694. console.error("THREE.Loader.createMaterial: Unsupported", h, u)
  45695. }
  45696. }
  45697. return "MeshBasicMaterial" === c.type && delete c.emissive,
  45698. "MeshPhongMaterial" !== c.type && delete c.specular,
  45699. c.opacity < 1 && (c.transparent = !0),
  45700. i.setTextures(l),
  45701. i.parse(c)
  45702. }
  45703. }()
  45704. },
  45705. n.Loader.Handlers = {
  45706. handlers: [],
  45707. add: function(e, t) {
  45708. this.handlers.push(e, t)
  45709. },
  45710. get: function(e) {
  45711. for (var t = this.handlers, i = 0, n = t.length; i < n; i += 2) {
  45712. var r = t[i]
  45713. , o = t[i + 1];
  45714. if (r.test(e))
  45715. return o
  45716. }
  45717. return null
  45718. }
  45719. },
  45720. n.XHRLoader = function(e) {
  45721. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  45722. }
  45723. ,
  45724. n.XHRLoader.prototype = {
  45725. constructor: n.XHRLoader,
  45726. load: function(e, t, i, r) {
  45727. void 0 !== this.path && (e = this.path + e);
  45728. var o = this
  45729. , a = n.Cache.get(e);
  45730. if (void 0 !== a)
  45731. return t && setTimeout(function() {
  45732. t(a)
  45733. }, 0),
  45734. a;
  45735. var s = new XMLHttpRequest;
  45736. return s.overrideMimeType("text/plain"),
  45737. s.open("GET", e, !0),
  45738. s.addEventListener("load", function(i) {
  45739. var a = i.target.response;
  45740. n.Cache.add(e, a),
  45741. 200 === this.status ? (t && t(a),
  45742. o.manager.itemEnd(e)) : 0 === this.status ? (console.warn("THREE.XHRLoader: HTTP Status 0 received."),
  45743. t && t(a),
  45744. o.manager.itemEnd(e)) : (r && r(i),
  45745. o.manager.itemError(e))
  45746. }, !1),
  45747. void 0 !== i && s.addEventListener("progress", function(e) {
  45748. i(e)
  45749. }, !1),
  45750. s.addEventListener("error", function(t) {
  45751. r && r(t),
  45752. o.manager.itemError(e)
  45753. }, !1),
  45754. void 0 !== this.responseType && (s.responseType = this.responseType),
  45755. void 0 !== this.withCredentials && (s.withCredentials = this.withCredentials),
  45756. s.send(null),
  45757. o.manager.itemStart(e),
  45758. s
  45759. },
  45760. setPath: function(e) {
  45761. this.path = e
  45762. },
  45763. setResponseType: function(e) {
  45764. this.responseType = e
  45765. },
  45766. setWithCredentials: function(e) {
  45767. this.withCredentials = e
  45768. }
  45769. },
  45770. n.FontLoader = function(e) {
  45771. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  45772. }
  45773. ,
  45774. n.FontLoader.prototype = {
  45775. constructor: n.FontLoader,
  45776. load: function(e, t, i, r) {
  45777. var o = new n.XHRLoader(this.manager);
  45778. o.load(e, function(e) {
  45779. t(new n.Font(JSON.parse(e.substring(65, e.length - 2))))
  45780. }, i, r)
  45781. }
  45782. },
  45783. n.ImageLoader = function(e) {
  45784. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  45785. }
  45786. ,
  45787. n.ImageLoader.prototype = {
  45788. constructor: n.ImageLoader,
  45789. load: function(e, t, i, r) {
  45790. void 0 !== this.path && (e = this.path + e);
  45791. var o = this
  45792. , a = n.Cache.get(e);
  45793. if (void 0 !== a)
  45794. return o.manager.itemStart(e),
  45795. t ? setTimeout(function() {
  45796. t(a),
  45797. o.manager.itemEnd(e)
  45798. }, 0) : o.manager.itemEnd(e),
  45799. a;
  45800. var s = document.createElement("img");
  45801. return s.addEventListener("load", function(i) {
  45802. n.Cache.add(e, this),
  45803. t && t(this),
  45804. o.manager.itemEnd(e)
  45805. }, !1),
  45806. void 0 !== i && s.addEventListener("progress", function(e) {
  45807. i(e)
  45808. }, !1),
  45809. s.addEventListener("error", function(t) {
  45810. r && r(t),
  45811. o.manager.itemError(e)
  45812. }, !1),
  45813. void 0 !== this.crossOrigin && (s.crossOrigin = this.crossOrigin),
  45814. o.manager.itemStart(e),
  45815. s.src = e,
  45816. s
  45817. },
  45818. setCrossOrigin: function(e) {
  45819. this.crossOrigin = e
  45820. },
  45821. setPath: function(e) {
  45822. this.path = e
  45823. }
  45824. },
  45825. n.JSONLoader = function(e) {
  45826. "boolean" == typeof e && (console.warn("THREE.JSONLoader: showStatus parameter has been removed from constructor."),
  45827. e = void 0),
  45828. this.manager = void 0 !== e ? e : n.DefaultLoadingManager,
  45829. this.withCredentials = !1
  45830. }
  45831. ,
  45832. n.JSONLoader.prototype = {
  45833. constructor: n.JSONLoader,
  45834. get statusDomElement() {
  45835. return void 0 === this._statusDomElement && (this._statusDomElement = document.createElement("div")),
  45836. console.warn("THREE.JSONLoader: .statusDomElement has been removed."),
  45837. this._statusDomElement
  45838. },
  45839. load: function(e, t, i, r) {
  45840. var o = this
  45841. , a = this.texturePath && "string" == typeof this.texturePath ? this.texturePath : n.Loader.prototype.extractUrlBase(e)
  45842. , s = new n.XHRLoader(this.manager);
  45843. s.setWithCredentials(this.withCredentials),
  45844. s.load(e, function(i) {
  45845. var n = JSON.parse(i)
  45846. , r = n.metadata;
  45847. if (void 0 !== r) {
  45848. var s = r.type;
  45849. if (void 0 !== s) {
  45850. if ("object" === s.toLowerCase())
  45851. return void console.error("THREE.JSONLoader: " + e + " should be loaded with THREE.ObjectLoader instead.");
  45852. if ("scene" === s.toLowerCase())
  45853. return void console.error("THREE.JSONLoader: " + e + " should be loaded with THREE.SceneLoader instead.")
  45854. }
  45855. }
  45856. var l = o.parse(n, a);
  45857. t(l.geometry, l.materials)
  45858. }, i, r)
  45859. },
  45860. setTexturePath: function(e) {
  45861. this.texturePath = e
  45862. },
  45863. parse: function(e, t) {
  45864. function i(t) {
  45865. function i(e, t) {
  45866. return e & 1 << t
  45867. }
  45868. 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;
  45869. if (void 0 !== e.uvs) {
  45870. for (r = 0; r < e.uvs.length; r++)
  45871. e.uvs[r].length && B++;
  45872. for (r = 0; r < B; r++)
  45873. s.faceVertexUvs[r] = []
  45874. }
  45875. for (l = 0,
  45876. c = L.length; l < c; )
  45877. E = new n.Vector3,
  45878. E.x = L[l++] * t,
  45879. E.y = L[l++] * t,
  45880. E.z = L[l++] * t,
  45881. s.vertices.push(E);
  45882. for (l = 0,
  45883. c = O.length; l < c; )
  45884. if (f = O[l++],
  45885. g = i(f, 0),
  45886. m = i(f, 1),
  45887. v = i(f, 3),
  45888. A = i(f, 4),
  45889. y = i(f, 5),
  45890. C = i(f, 6),
  45891. I = i(f, 7),
  45892. g) {
  45893. if (w = new n.Face3,
  45894. w.a = O[l],
  45895. w.b = O[l + 1],
  45896. w.c = O[l + 3],
  45897. _ = new n.Face3,
  45898. _.a = O[l + 1],
  45899. _.b = O[l + 2],
  45900. _.c = O[l + 3],
  45901. l += 4,
  45902. m && (p = O[l++],
  45903. w.materialIndex = p,
  45904. _.materialIndex = p),
  45905. a = s.faces.length,
  45906. v)
  45907. for (r = 0; r < B; r++)
  45908. for (S = e.uvs[r],
  45909. s.faceVertexUvs[r][a] = [],
  45910. s.faceVertexUvs[r][a + 1] = [],
  45911. o = 0; o < 4; o++)
  45912. d = O[l++],
  45913. R = S[2 * d],
  45914. P = S[2 * d + 1],
  45915. M = new n.Vector2(R,P),
  45916. 2 !== o && s.faceVertexUvs[r][a].push(M),
  45917. 0 !== o && s.faceVertexUvs[r][a + 1].push(M);
  45918. if (A && (u = 3 * O[l++],
  45919. w.normal.set(D[u++], D[u++], D[u]),
  45920. _.normal.copy(w.normal)),
  45921. y)
  45922. for (r = 0; r < 4; r++)
  45923. u = 3 * O[l++],
  45924. x = new n.Vector3(D[u++],D[u++],D[u]),
  45925. 2 !== r && w.vertexNormals.push(x),
  45926. 0 !== r && _.vertexNormals.push(x);
  45927. if (C && (h = O[l++],
  45928. T = N[h],
  45929. w.color.setHex(T),
  45930. _.color.setHex(T)),
  45931. I)
  45932. for (r = 0; r < 4; r++)
  45933. h = O[l++],
  45934. T = N[h],
  45935. 2 !== r && w.vertexColors.push(new n.Color(T)),
  45936. 0 !== r && _.vertexColors.push(new n.Color(T));
  45937. s.faces.push(w),
  45938. s.faces.push(_)
  45939. } else {
  45940. if (b = new n.Face3,
  45941. b.a = O[l++],
  45942. b.b = O[l++],
  45943. b.c = O[l++],
  45944. m && (p = O[l++],
  45945. b.materialIndex = p),
  45946. a = s.faces.length,
  45947. v)
  45948. for (r = 0; r < B; r++)
  45949. for (S = e.uvs[r],
  45950. s.faceVertexUvs[r][a] = [],
  45951. o = 0; o < 3; o++)
  45952. d = O[l++],
  45953. R = S[2 * d],
  45954. P = S[2 * d + 1],
  45955. M = new n.Vector2(R,P),
  45956. s.faceVertexUvs[r][a].push(M);
  45957. if (A && (u = 3 * O[l++],
  45958. b.normal.set(D[u++], D[u++], D[u])),
  45959. y)
  45960. for (r = 0; r < 3; r++)
  45961. u = 3 * O[l++],
  45962. x = new n.Vector3(D[u++],D[u++],D[u]),
  45963. b.vertexNormals.push(x);
  45964. if (C && (h = O[l++],
  45965. b.color.setHex(N[h])),
  45966. I)
  45967. for (r = 0; r < 3; r++)
  45968. h = O[l++],
  45969. b.vertexColors.push(new n.Color(N[h]));
  45970. s.faces.push(b)
  45971. }
  45972. }
  45973. function r() {
  45974. var t = void 0 !== e.influencesPerVertex ? e.influencesPerVertex : 2;
  45975. if (e.skinWeights)
  45976. for (var i = 0, r = e.skinWeights.length; i < r; i += t) {
  45977. var o = e.skinWeights[i]
  45978. , a = t > 1 ? e.skinWeights[i + 1] : 0
  45979. , l = t > 2 ? e.skinWeights[i + 2] : 0
  45980. , c = t > 3 ? e.skinWeights[i + 3] : 0;
  45981. s.skinWeights.push(new n.Vector4(o,a,l,c))
  45982. }
  45983. if (e.skinIndices)
  45984. for (var i = 0, r = e.skinIndices.length; i < r; i += t) {
  45985. var h = e.skinIndices[i]
  45986. , u = t > 1 ? e.skinIndices[i + 1] : 0
  45987. , d = t > 2 ? e.skinIndices[i + 2] : 0
  45988. , p = t > 3 ? e.skinIndices[i + 3] : 0;
  45989. s.skinIndices.push(new n.Vector4(h,u,d,p))
  45990. }
  45991. s.bones = e.bones,
  45992. 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.")
  45993. }
  45994. function o(t) {
  45995. if (void 0 !== e.morphTargets)
  45996. for (var i = 0, r = e.morphTargets.length; i < r; i++) {
  45997. s.morphTargets[i] = {},
  45998. s.morphTargets[i].name = e.morphTargets[i].name,
  45999. s.morphTargets[i].vertices = [];
  46000. for (var o = s.morphTargets[i].vertices, a = e.morphTargets[i].vertices, l = 0, c = a.length; l < c; l += 3) {
  46001. var h = new n.Vector3;
  46002. h.x = a[l] * t,
  46003. h.y = a[l + 1] * t,
  46004. h.z = a[l + 2] * t,
  46005. o.push(h)
  46006. }
  46007. }
  46008. if (void 0 !== e.morphColors && e.morphColors.length > 0) {
  46009. console.warn('THREE.JSONLoader: "morphColors" no longer supported. Using them as face colors.');
  46010. for (var u = s.faces, d = e.morphColors[0].colors, i = 0, r = u.length; i < r; i++)
  46011. u[i].color.fromArray(d, 3 * i)
  46012. }
  46013. }
  46014. function a() {
  46015. var t = []
  46016. , i = [];
  46017. void 0 !== e.animation && i.push(e.animation),
  46018. void 0 !== e.animations && (e.animations.length ? i = i.concat(e.animations) : i.push(e.animations));
  46019. for (var r = 0; r < i.length; r++) {
  46020. var o = n.AnimationClip.parseAnimation(i[r], s.bones);
  46021. o && t.push(o)
  46022. }
  46023. if (s.morphTargets) {
  46024. var a = n.AnimationClip.CreateClipsFromMorphTargetSequences(s.morphTargets, 10);
  46025. t = t.concat(a)
  46026. }
  46027. t.length > 0 && (s.animations = t)
  46028. }
  46029. var s = new n.Geometry
  46030. , l = void 0 !== e.scale ? 1 / e.scale : 1;
  46031. if (i(l),
  46032. r(),
  46033. o(l),
  46034. a(),
  46035. s.computeFaceNormals(),
  46036. s.computeBoundingSphere(),
  46037. void 0 === e.materials || 0 === e.materials.length)
  46038. return {
  46039. geometry: s
  46040. };
  46041. var c = n.Loader.prototype.initMaterials(e.materials, t, this.crossOrigin);
  46042. return {
  46043. geometry: s,
  46044. materials: c
  46045. }
  46046. }
  46047. },
  46048. n.LoadingManager = function(e, t, i) {
  46049. var n = this
  46050. , r = !1
  46051. , o = 0
  46052. , a = 0;
  46053. this.onStart = void 0,
  46054. this.onLoad = e,
  46055. this.onProgress = t,
  46056. this.onError = i,
  46057. this.itemStart = function(e) {
  46058. a++,
  46059. r === !1 && void 0 !== n.onStart && n.onStart(e, o, a),
  46060. r = !0
  46061. }
  46062. ,
  46063. this.itemEnd = function(e) {
  46064. o++,
  46065. void 0 !== n.onProgress && n.onProgress(e, o, a),
  46066. o === a && (r = !1,
  46067. void 0 !== n.onLoad && n.onLoad())
  46068. }
  46069. ,
  46070. this.itemError = function(e) {
  46071. void 0 !== n.onError && n.onError(e)
  46072. }
  46073. }
  46074. ,
  46075. n.DefaultLoadingManager = new n.LoadingManager,
  46076. n.BufferGeometryLoader = function(e) {
  46077. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  46078. }
  46079. ,
  46080. n.BufferGeometryLoader.prototype = {
  46081. constructor: n.BufferGeometryLoader,
  46082. load: function(e, t, i, r) {
  46083. var o = this
  46084. , a = new n.XHRLoader(o.manager);
  46085. a.load(e, function(e) {
  46086. t(o.parse(JSON.parse(e)))
  46087. }, i, r)
  46088. },
  46089. parse: function(e) {
  46090. var t = new n.BufferGeometry
  46091. , i = e.data.index
  46092. , r = {
  46093. Int8Array: Int8Array,
  46094. Uint8Array: Uint8Array,
  46095. Uint8ClampedArray: Uint8ClampedArray,
  46096. Int16Array: Int16Array,
  46097. Uint16Array: Uint16Array,
  46098. Int32Array: Int32Array,
  46099. Uint32Array: Uint32Array,
  46100. Float32Array: Float32Array,
  46101. Float64Array: Float64Array
  46102. };
  46103. if (void 0 !== i) {
  46104. var o = new r[i.type](i.array);
  46105. t.setIndex(new n.BufferAttribute(o,1))
  46106. }
  46107. var a = e.data.attributes;
  46108. for (var s in a) {
  46109. var l = a[s]
  46110. , o = new r[l.type](l.array);
  46111. t.addAttribute(s, new n.BufferAttribute(o,l.itemSize))
  46112. }
  46113. var c = e.data.groups || e.data.drawcalls || e.data.offsets;
  46114. if (void 0 !== c)
  46115. for (var h = 0, u = c.length; h !== u; ++h) {
  46116. var d = c[h];
  46117. t.addGroup(d.start, d.count, d.materialIndex)
  46118. }
  46119. var p = e.data.boundingSphere;
  46120. if (void 0 !== p) {
  46121. var f = new n.Vector3;
  46122. void 0 !== p.center && f.fromArray(p.center),
  46123. t.boundingSphere = new n.Sphere(f,p.radius)
  46124. }
  46125. return t
  46126. }
  46127. },
  46128. n.MaterialLoader = function(e) {
  46129. this.manager = void 0 !== e ? e : n.DefaultLoadingManager,
  46130. this.textures = {}
  46131. }
  46132. ,
  46133. n.MaterialLoader.prototype = {
  46134. constructor: n.MaterialLoader,
  46135. load: function(e, t, i, r) {
  46136. var o = this
  46137. , a = new n.XHRLoader(o.manager);
  46138. a.load(e, function(e) {
  46139. t(o.parse(JSON.parse(e)))
  46140. }, i, r)
  46141. },
  46142. setTextures: function(e) {
  46143. this.textures = e
  46144. },
  46145. getTexture: function(e) {
  46146. var t = this.textures;
  46147. return void 0 === t[e] && console.warn("THREE.MaterialLoader: Undefined texture", e),
  46148. t[e]
  46149. },
  46150. parse: function(e) {
  46151. var t = new n[e.type];
  46152. if (void 0 !== e.uuid && (t.uuid = e.uuid),
  46153. void 0 !== e.name && (t.name = e.name),
  46154. void 0 !== e.color && t.color.setHex(e.color),
  46155. void 0 !== e.roughness && (t.roughness = e.roughness),
  46156. void 0 !== e.metalness && (t.metalness = e.metalness),
  46157. void 0 !== e.emissive && t.emissive.setHex(e.emissive),
  46158. void 0 !== e.specular && t.specular.setHex(e.specular),
  46159. void 0 !== e.shininess && (t.shininess = e.shininess),
  46160. void 0 !== e.uniforms && (t.uniforms = e.uniforms),
  46161. void 0 !== e.vertexShader && (t.vertexShader = e.vertexShader),
  46162. void 0 !== e.fragmentShader && (t.fragmentShader = e.fragmentShader),
  46163. void 0 !== e.vertexColors && (t.vertexColors = e.vertexColors),
  46164. void 0 !== e.shading && (t.shading = e.shading),
  46165. void 0 !== e.blending && (t.blending = e.blending),
  46166. void 0 !== e.side && (t.side = e.side),
  46167. void 0 !== e.opacity && (t.opacity = e.opacity),
  46168. void 0 !== e.transparent && (t.transparent = e.transparent),
  46169. void 0 !== e.alphaTest && (t.alphaTest = e.alphaTest),
  46170. void 0 !== e.depthTest && (t.depthTest = e.depthTest),
  46171. void 0 !== e.depthWrite && (t.depthWrite = e.depthWrite),
  46172. void 0 !== e.colorWrite && (t.colorWrite = e.colorWrite),
  46173. void 0 !== e.wireframe && (t.wireframe = e.wireframe),
  46174. void 0 !== e.wireframeLinewidth && (t.wireframeLinewidth = e.wireframeLinewidth),
  46175. void 0 !== e.size && (t.size = e.size),
  46176. void 0 !== e.sizeAttenuation && (t.sizeAttenuation = e.sizeAttenuation),
  46177. void 0 !== e.map && (t.map = this.getTexture(e.map)),
  46178. void 0 !== e.alphaMap && (t.alphaMap = this.getTexture(e.alphaMap),
  46179. t.transparent = !0),
  46180. void 0 !== e.bumpMap && (t.bumpMap = this.getTexture(e.bumpMap)),
  46181. void 0 !== e.bumpScale && (t.bumpScale = e.bumpScale),
  46182. void 0 !== e.normalMap && (t.normalMap = this.getTexture(e.normalMap)),
  46183. void 0 !== e.normalScale) {
  46184. var i = e.normalScale;
  46185. Array.isArray(i) === !1 && (i = [i, i]),
  46186. t.normalScale = (new n.Vector2).fromArray(i)
  46187. }
  46188. if (void 0 !== e.displacementMap && (t.displacementMap = this.getTexture(e.displacementMap)),
  46189. void 0 !== e.displacementScale && (t.displacementScale = e.displacementScale),
  46190. void 0 !== e.displacementBias && (t.displacementBias = e.displacementBias),
  46191. void 0 !== e.roughnessMap && (t.roughnessMap = this.getTexture(e.roughnessMap)),
  46192. void 0 !== e.metalnessMap && (t.metalnessMap = this.getTexture(e.metalnessMap)),
  46193. void 0 !== e.emissiveMap && (t.emissiveMap = this.getTexture(e.emissiveMap)),
  46194. void 0 !== e.emissiveIntensity && (t.emissiveIntensity = e.emissiveIntensity),
  46195. void 0 !== e.specularMap && (t.specularMap = this.getTexture(e.specularMap)),
  46196. void 0 !== e.envMap && (t.envMap = this.getTexture(e.envMap),
  46197. t.combine = n.MultiplyOperation),
  46198. e.reflectivity && (t.reflectivity = e.reflectivity),
  46199. void 0 !== e.lightMap && (t.lightMap = this.getTexture(e.lightMap)),
  46200. void 0 !== e.lightMapIntensity && (t.lightMapIntensity = e.lightMapIntensity),
  46201. void 0 !== e.aoMap && (t.aoMap = this.getTexture(e.aoMap)),
  46202. void 0 !== e.aoMapIntensity && (t.aoMapIntensity = e.aoMapIntensity),
  46203. void 0 !== e.materials)
  46204. for (var r = 0, o = e.materials.length; r < o; r++)
  46205. t.materials.push(this.parse(e.materials[r]));
  46206. return t
  46207. }
  46208. },
  46209. n.ObjectLoader = function(e) {
  46210. this.manager = void 0 !== e ? e : n.DefaultLoadingManager,
  46211. this.texturePath = ""
  46212. }
  46213. ,
  46214. n.ObjectLoader.prototype = {
  46215. constructor: n.ObjectLoader,
  46216. load: function(e, t, i, r) {
  46217. "" === this.texturePath && (this.texturePath = e.substring(0, e.lastIndexOf("/") + 1));
  46218. var o = this
  46219. , a = new n.XHRLoader(o.manager);
  46220. a.load(e, function(e) {
  46221. o.parse(JSON.parse(e), t)
  46222. }, i, r)
  46223. },
  46224. setTexturePath: function(e) {
  46225. this.texturePath = e
  46226. },
  46227. setCrossOrigin: function(e) {
  46228. this.crossOrigin = e
  46229. },
  46230. parse: function(e, t) {
  46231. var i = this.parseGeometries(e.geometries)
  46232. , n = this.parseImages(e.images, function() {
  46233. void 0 !== t && t(a)
  46234. })
  46235. , r = this.parseTextures(e.textures, n)
  46236. , o = this.parseMaterials(e.materials, r)
  46237. , a = this.parseObject(e.object, i, o);
  46238. return e.animations && (a.animations = this.parseAnimations(e.animations)),
  46239. void 0 !== e.images && 0 !== e.images.length || void 0 !== t && t(a),
  46240. a
  46241. },
  46242. parseGeometries: function(e) {
  46243. var t = {};
  46244. if (void 0 !== e)
  46245. for (var i = new n.JSONLoader, r = new n.BufferGeometryLoader, o = 0, a = e.length; o < a; o++) {
  46246. var s, l = e[o];
  46247. switch (l.type) {
  46248. case "PlaneGeometry":
  46249. case "PlaneBufferGeometry":
  46250. s = new n[l.type](l.width,l.height,l.widthSegments,l.heightSegments);
  46251. break;
  46252. case "BoxGeometry":
  46253. case "BoxBufferGeometry":
  46254. case "CubeGeometry":
  46255. s = new n[l.type](l.width,l.height,l.depth,l.widthSegments,l.heightSegments,l.depthSegments);
  46256. break;
  46257. case "CircleGeometry":
  46258. case "CircleBufferGeometry":
  46259. s = new n[l.type](l.radius,l.segments,l.thetaStart,l.thetaLength);
  46260. break;
  46261. case "CylinderGeometry":
  46262. case "CylinderBufferGeometry":
  46263. s = new n[l.type](l.radiusTop,l.radiusBottom,l.height,l.radialSegments,l.heightSegments,l.openEnded,l.thetaStart,l.thetaLength);
  46264. break;
  46265. case "SphereGeometry":
  46266. case "SphereBufferGeometry":
  46267. s = new n[l.type](l.radius,l.widthSegments,l.heightSegments,l.phiStart,l.phiLength,l.thetaStart,l.thetaLength);
  46268. break;
  46269. case "DodecahedronGeometry":
  46270. s = new n.DodecahedronGeometry(l.radius,l.detail);
  46271. break;
  46272. case "IcosahedronGeometry":
  46273. s = new n.IcosahedronGeometry(l.radius,l.detail);
  46274. break;
  46275. case "OctahedronGeometry":
  46276. s = new n.OctahedronGeometry(l.radius,l.detail);
  46277. break;
  46278. case "TetrahedronGeometry":
  46279. s = new n.TetrahedronGeometry(l.radius,l.detail);
  46280. break;
  46281. case "RingGeometry":
  46282. case "RingBufferGeometry":
  46283. s = new n[l.type](l.innerRadius,l.outerRadius,l.thetaSegments,l.phiSegments,l.thetaStart,l.thetaLength);
  46284. break;
  46285. case "TorusGeometry":
  46286. case "TorusBufferGeometry":
  46287. s = new n[l.type](l.radius,l.tube,l.radialSegments,l.tubularSegments,l.arc);
  46288. break;
  46289. case "TorusKnotGeometry":
  46290. case "TorusKnotBufferGeometry":
  46291. s = new n[l.type](l.radius,l.tube,l.tubularSegments,l.radialSegments,l.p,l.q);
  46292. break;
  46293. case "LatheGeometry":
  46294. s = new n.LatheGeometry(l.points,l.segments,l.phiStart,l.phiLength);
  46295. break;
  46296. case "BufferGeometry":
  46297. s = r.parse(l);
  46298. break;
  46299. case "Geometry":
  46300. s = i.parse(l.data, this.texturePath).geometry;
  46301. break;
  46302. default:
  46303. console.warn('THREE.ObjectLoader: Unsupported geometry type "' + l.type + '"');
  46304. continue
  46305. }
  46306. s.uuid = l.uuid,
  46307. void 0 !== l.name && (s.name = l.name),
  46308. t[l.uuid] = s
  46309. }
  46310. return t
  46311. },
  46312. parseMaterials: function(e, t) {
  46313. var i = {};
  46314. if (void 0 !== e) {
  46315. var r = new n.MaterialLoader;
  46316. r.setTextures(t);
  46317. for (var o = 0, a = e.length; o < a; o++) {
  46318. var s = r.parse(e[o]);
  46319. i[s.uuid] = s
  46320. }
  46321. }
  46322. return i
  46323. },
  46324. parseAnimations: function(e) {
  46325. for (var t = [], i = 0; i < e.length; i++) {
  46326. var r = n.AnimationClip.parse(e[i]);
  46327. t.push(r)
  46328. }
  46329. return t
  46330. },
  46331. parseImages: function(e, t) {
  46332. function i(e) {
  46333. return r.manager.itemStart(e),
  46334. s.load(e, function() {
  46335. r.manager.itemEnd(e)
  46336. })
  46337. }
  46338. var r = this
  46339. , o = {};
  46340. if (void 0 !== e && e.length > 0) {
  46341. var a = new n.LoadingManager(t)
  46342. , s = new n.ImageLoader(a);
  46343. s.setCrossOrigin(this.crossOrigin);
  46344. for (var l = 0, c = e.length; l < c; l++) {
  46345. var h = e[l]
  46346. , u = /^(\/\/)|([a-z]+:(\/\/)?)/i.test(h.url) ? h.url : r.texturePath + h.url;
  46347. o[h.uuid] = i(u)
  46348. }
  46349. }
  46350. return o
  46351. },
  46352. parseTextures: function(e, t) {
  46353. function i(e) {
  46354. return "number" == typeof e ? e : (console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.", e),
  46355. n[e])
  46356. }
  46357. var r = {};
  46358. if (void 0 !== e)
  46359. for (var o = 0, a = e.length; o < a; o++) {
  46360. var s = e[o];
  46361. void 0 === s.image && console.warn('THREE.ObjectLoader: No "image" specified for', s.uuid),
  46362. void 0 === t[s.image] && console.warn("THREE.ObjectLoader: Undefined image", s.image);
  46363. var l = new n.Texture(t[s.image]);
  46364. l.needsUpdate = !0,
  46365. l.uuid = s.uuid,
  46366. void 0 !== s.name && (l.name = s.name),
  46367. void 0 !== s.mapping && (l.mapping = i(s.mapping)),
  46368. void 0 !== s.offset && (l.offset = new n.Vector2(s.offset[0],s.offset[1])),
  46369. void 0 !== s.repeat && (l.repeat = new n.Vector2(s.repeat[0],s.repeat[1])),
  46370. void 0 !== s.minFilter && (l.minFilter = i(s.minFilter)),
  46371. void 0 !== s.magFilter && (l.magFilter = i(s.magFilter)),
  46372. void 0 !== s.anisotropy && (l.anisotropy = s.anisotropy),
  46373. Array.isArray(s.wrap) && (l.wrapS = i(s.wrap[0]),
  46374. l.wrapT = i(s.wrap[1])),
  46375. r[s.uuid] = l
  46376. }
  46377. return r
  46378. },
  46379. parseObject: function() {
  46380. var e = new n.Matrix4;
  46381. return function(t, i, r) {
  46382. function o(e) {
  46383. return void 0 === i[e] && console.warn("THREE.ObjectLoader: Undefined geometry", e),
  46384. i[e]
  46385. }
  46386. function a(e) {
  46387. if (void 0 !== e)
  46388. return void 0 === r[e] && console.warn("THREE.ObjectLoader: Undefined material", e),
  46389. r[e]
  46390. }
  46391. var s;
  46392. switch (t.type) {
  46393. case "Scene":
  46394. s = new n.Scene;
  46395. break;
  46396. case "PerspectiveCamera":
  46397. s = new n.PerspectiveCamera(t.fov,t.aspect,t.near,t.far);
  46398. break;
  46399. case "OrthographicCamera":
  46400. s = new n.OrthographicCamera(t.left,t.right,t.top,t.bottom,t.near,t.far);
  46401. break;
  46402. case "AmbientLight":
  46403. s = new n.AmbientLight(t.color,t.intensity);
  46404. break;
  46405. case "DirectionalLight":
  46406. s = new n.DirectionalLight(t.color,t.intensity);
  46407. break;
  46408. case "PointLight":
  46409. s = new n.PointLight(t.color,t.intensity,t.distance,t.decay);
  46410. break;
  46411. case "SpotLight":
  46412. s = new n.SpotLight(t.color,t.intensity,t.distance,t.angle,t.penumbra,t.decay);
  46413. break;
  46414. case "HemisphereLight":
  46415. s = new n.HemisphereLight(t.color,t.groundColor,t.intensity);
  46416. break;
  46417. case "Mesh":
  46418. var l = o(t.geometry)
  46419. , c = a(t.material);
  46420. s = l.bones && l.bones.length > 0 ? new n.SkinnedMesh(l,c) : new n.Mesh(l,c);
  46421. break;
  46422. case "LOD":
  46423. s = new n.LOD;
  46424. break;
  46425. case "Line":
  46426. s = new n.Line(o(t.geometry),a(t.material),t.mode);
  46427. break;
  46428. case "PointCloud":
  46429. case "Points":
  46430. s = new n.Points(o(t.geometry),a(t.material));
  46431. break;
  46432. case "Sprite":
  46433. s = new n.Sprite(a(t.material));
  46434. break;
  46435. case "Group":
  46436. s = new n.Group;
  46437. break;
  46438. default:
  46439. s = new n.Object3D
  46440. }
  46441. if (s.uuid = t.uuid,
  46442. void 0 !== t.name && (s.name = t.name),
  46443. void 0 !== t.matrix ? (e.fromArray(t.matrix),
  46444. e.decompose(s.position, s.quaternion, s.scale)) : (void 0 !== t.position && s.position.fromArray(t.position),
  46445. void 0 !== t.rotation && s.rotation.fromArray(t.rotation),
  46446. void 0 !== t.scale && s.scale.fromArray(t.scale)),
  46447. void 0 !== t.castShadow && (s.castShadow = t.castShadow),
  46448. void 0 !== t.receiveShadow && (s.receiveShadow = t.receiveShadow),
  46449. void 0 !== t.visible && (s.visible = t.visible),
  46450. void 0 !== t.userData && (s.userData = t.userData),
  46451. void 0 !== t.children)
  46452. for (var h in t.children)
  46453. s.add(this.parseObject(t.children[h], i, r));
  46454. if ("LOD" === t.type)
  46455. for (var u = t.levels, d = 0; d < u.length; d++) {
  46456. var p = u[d]
  46457. , h = s.getObjectByProperty("uuid", p.object);
  46458. void 0 !== h && s.addLevel(h, p.distance)
  46459. }
  46460. return s
  46461. }
  46462. }()
  46463. },
  46464. n.TextureLoader = function(e) {
  46465. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  46466. }
  46467. ,
  46468. n.TextureLoader.prototype = {
  46469. constructor: n.TextureLoader,
  46470. load: function(e, t, i, r) {
  46471. var o = new n.Texture
  46472. , a = new n.ImageLoader(this.manager);
  46473. return a.setCrossOrigin(this.crossOrigin),
  46474. a.setPath(this.path),
  46475. a.load(e, function(e) {
  46476. o.image = e,
  46477. o.needsUpdate = !0,
  46478. void 0 !== t && t(o)
  46479. }, i, r),
  46480. o
  46481. },
  46482. setCrossOrigin: function(e) {
  46483. this.crossOrigin = e
  46484. },
  46485. setPath: function(e) {
  46486. this.path = e
  46487. }
  46488. },
  46489. n.CubeTextureLoader = function(e) {
  46490. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  46491. }
  46492. ,
  46493. n.CubeTextureLoader.prototype = {
  46494. constructor: n.CubeTextureLoader,
  46495. load: function(e, t, i, r) {
  46496. function o(i) {
  46497. s.load(e[i], function(e) {
  46498. a.images[i] = e,
  46499. l++,
  46500. 6 === l && (a.needsUpdate = !0,
  46501. t && t(a))
  46502. }, void 0, r)
  46503. }
  46504. var a = new n.CubeTexture
  46505. , s = new n.ImageLoader(this.manager);
  46506. s.setCrossOrigin(this.crossOrigin),
  46507. s.setPath(this.path);
  46508. for (var l = 0, c = 0; c < e.length; ++c)
  46509. o(c);
  46510. return a
  46511. },
  46512. setCrossOrigin: function(e) {
  46513. this.crossOrigin = e
  46514. },
  46515. setPath: function(e) {
  46516. this.path = e
  46517. }
  46518. },
  46519. n.DataTextureLoader = n.BinaryTextureLoader = function(e) {
  46520. this.manager = void 0 !== e ? e : n.DefaultLoadingManager,
  46521. this._parser = null
  46522. }
  46523. ,
  46524. n.BinaryTextureLoader.prototype = {
  46525. constructor: n.BinaryTextureLoader,
  46526. load: function(e, t, i, r) {
  46527. var o = this
  46528. , a = new n.DataTexture
  46529. , s = new n.XHRLoader(this.manager);
  46530. return s.setResponseType("arraybuffer"),
  46531. s.load(e, function(e) {
  46532. var i = o._parser(e);
  46533. i && (void 0 !== i.image ? a.image = i.image : void 0 !== i.data && (a.image.width = i.width,
  46534. a.image.height = i.height,
  46535. a.image.data = i.data),
  46536. a.wrapS = void 0 !== i.wrapS ? i.wrapS : n.ClampToEdgeWrapping,
  46537. a.wrapT = void 0 !== i.wrapT ? i.wrapT : n.ClampToEdgeWrapping,
  46538. a.magFilter = void 0 !== i.magFilter ? i.magFilter : n.LinearFilter,
  46539. a.minFilter = void 0 !== i.minFilter ? i.minFilter : n.LinearMipMapLinearFilter,
  46540. a.anisotropy = void 0 !== i.anisotropy ? i.anisotropy : 1,
  46541. void 0 !== i.format && (a.format = i.format),
  46542. void 0 !== i.type && (a.type = i.type),
  46543. void 0 !== i.mipmaps && (a.mipmaps = i.mipmaps),
  46544. 1 === i.mipmapCount && (a.minFilter = n.LinearFilter),
  46545. a.needsUpdate = !0,
  46546. t && t(a, i))
  46547. }, i, r),
  46548. a
  46549. }
  46550. },
  46551. n.CompressedTextureLoader = function(e) {
  46552. this.manager = void 0 !== e ? e : n.DefaultLoadingManager,
  46553. this._parser = null
  46554. }
  46555. ;
  46556. n.CompressedTextureLoader.prototype = {
  46557. constructor: n.CompressedTextureLoader,
  46558. load: function(e, t, i, r) {
  46559. function o(o) {
  46560. c.load(e[o], function(e) {
  46561. var i = a._parser(e, !0);
  46562. s[o] = {
  46563. width: i.width,
  46564. height: i.height,
  46565. format: i.format,
  46566. mipmaps: i.mipmaps
  46567. },
  46568. h += 1,
  46569. 6 === h && (1 === i.mipmapCount && (l.minFilter = n.LinearFilter),
  46570. l.format = i.format,
  46571. l.needsUpdate = !0,
  46572. t && t(l))
  46573. }, i, r)
  46574. }
  46575. var a = this
  46576. , s = []
  46577. , l = new n.CompressedTexture;
  46578. l.image = s;
  46579. var c = new n.XHRLoader(this.manager);
  46580. if (c.setPath(this.path),
  46581. c.setResponseType("arraybuffer"),
  46582. Array.isArray(e))
  46583. for (var h = 0, u = 0, d = e.length; u < d; ++u)
  46584. o(u);
  46585. else
  46586. c.load(e, function(e) {
  46587. var i = a._parser(e, !0);
  46588. if (i.isCubemap)
  46589. for (var r = i.mipmaps.length / i.mipmapCount, o = 0; o < r; o++) {
  46590. s[o] = {
  46591. mipmaps: []
  46592. };
  46593. for (var c = 0; c < i.mipmapCount; c++)
  46594. s[o].mipmaps.push(i.mipmaps[o * i.mipmapCount + c]),
  46595. s[o].format = i.format,
  46596. s[o].width = i.width,
  46597. s[o].height = i.height
  46598. }
  46599. else
  46600. l.image.width = i.width,
  46601. l.image.height = i.height,
  46602. l.mipmaps = i.mipmaps;
  46603. 1 === i.mipmapCount && (l.minFilter = n.LinearFilter),
  46604. l.format = i.format,
  46605. l.needsUpdate = !0,
  46606. t && t(l)
  46607. }, i, r);
  46608. return l
  46609. },
  46610. setPath: function(e) {
  46611. this.path = e
  46612. }
  46613. };
  46614. n.Material = function() {
  46615. Object.defineProperty(this, "id", {
  46616. value: n.MaterialIdCount++
  46617. }),
  46618. this.uuid = n.Math.generateUUID(),
  46619. this.name = "",
  46620. this.type = "Material",
  46621. this.side = n.FrontSide,
  46622. this.opacity = 1,
  46623. this.transparent = !1,
  46624. this.blending = n.NormalBlending,
  46625. this.blendSrc = n.SrcAlphaFactor,
  46626. this.blendDst = n.OneMinusSrcAlphaFactor,
  46627. this.blendEquation = n.AddEquation,
  46628. this.blendSrcAlpha = null,
  46629. this.blendDstAlpha = null,
  46630. this.blendEquationAlpha = null,
  46631. this.depthFunc = n.LessEqualDepth,
  46632. this.depthTest = !0,
  46633. this.depthWrite = !0,
  46634. this.colorWrite = !0,
  46635. this.precision = null,
  46636. this.polygonOffset = !1,
  46637. this.polygonOffsetFactor = 0,
  46638. this.polygonOffsetUnits = 0,
  46639. this.alphaTest = 0,
  46640. this.premultipliedAlpha = !1,
  46641. this.overdraw = 0,
  46642. this.visible = !0,
  46643. this._needsUpdate = !0
  46644. }
  46645. ,
  46646. n.Material.prototype = {
  46647. constructor: n.Material,
  46648. get needsUpdate() {
  46649. return this._needsUpdate
  46650. },
  46651. set needsUpdate(e) {
  46652. e === !0 && this.update(),
  46653. this._needsUpdate = e
  46654. },
  46655. setValues: function(e) {
  46656. if (void 0 !== e)
  46657. for (var t in e) {
  46658. var i = e[t];
  46659. if (void 0 !== i) {
  46660. var r = this[t];
  46661. 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.")
  46662. } else
  46663. console.warn("THREE.Material: '" + t + "' parameter is undefined.")
  46664. }
  46665. },
  46666. toJSON: function(e) {
  46667. function t(e) {
  46668. var t = [];
  46669. for (var i in e) {
  46670. var n = e[i];
  46671. delete n.metadata,
  46672. t.push(n)
  46673. }
  46674. return t
  46675. }
  46676. var i = void 0 === e;
  46677. i && (e = {
  46678. textures: {},
  46679. images: {}
  46680. });
  46681. var r = {
  46682. metadata: {
  46683. version: 4.4,
  46684. type: "Material",
  46685. generator: "Material.toJSON"
  46686. }
  46687. };
  46688. if (r.uuid = this.uuid,
  46689. r.type = this.type,
  46690. "" !== this.name && (r.name = this.name),
  46691. this.color instanceof n.Color && (r.color = this.color.getHex()),
  46692. .5 !== this.roughness && (r.roughness = this.roughness),
  46693. .5 !== this.metalness && (r.metalness = this.metalness),
  46694. this.emissive instanceof n.Color && (r.emissive = this.emissive.getHex()),
  46695. this.specular instanceof n.Color && (r.specular = this.specular.getHex()),
  46696. void 0 !== this.shininess && (r.shininess = this.shininess),
  46697. this.map instanceof n.Texture && (r.map = this.map.toJSON(e).uuid),
  46698. this.alphaMap instanceof n.Texture && (r.alphaMap = this.alphaMap.toJSON(e).uuid),
  46699. this.lightMap instanceof n.Texture && (r.lightMap = this.lightMap.toJSON(e).uuid),
  46700. this.bumpMap instanceof n.Texture && (r.bumpMap = this.bumpMap.toJSON(e).uuid,
  46701. r.bumpScale = this.bumpScale),
  46702. this.normalMap instanceof n.Texture && (r.normalMap = this.normalMap.toJSON(e).uuid,
  46703. r.normalScale = this.normalScale.toArray()),
  46704. this.displacementMap instanceof n.Texture && (r.displacementMap = this.displacementMap.toJSON(e).uuid,
  46705. r.displacementScale = this.displacementScale,
  46706. r.displacementBias = this.displacementBias),
  46707. this.roughnessMap instanceof n.Texture && (r.roughnessMap = this.roughnessMap.toJSON(e).uuid),
  46708. this.metalnessMap instanceof n.Texture && (r.metalnessMap = this.metalnessMap.toJSON(e).uuid),
  46709. this.emissiveMap instanceof n.Texture && (r.emissiveMap = this.emissiveMap.toJSON(e).uuid),
  46710. this.specularMap instanceof n.Texture && (r.specularMap = this.specularMap.toJSON(e).uuid),
  46711. this.envMap instanceof n.Texture && (r.envMap = this.envMap.toJSON(e).uuid,
  46712. r.reflectivity = this.reflectivity),
  46713. void 0 !== this.size && (r.size = this.size),
  46714. void 0 !== this.sizeAttenuation && (r.sizeAttenuation = this.sizeAttenuation),
  46715. void 0 !== this.vertexColors && this.vertexColors !== n.NoColors && (r.vertexColors = this.vertexColors),
  46716. void 0 !== this.shading && this.shading !== n.SmoothShading && (r.shading = this.shading),
  46717. void 0 !== this.blending && this.blending !== n.NormalBlending && (r.blending = this.blending),
  46718. void 0 !== this.side && this.side !== n.FrontSide && (r.side = this.side),
  46719. this.opacity < 1 && (r.opacity = this.opacity),
  46720. this.transparent === !0 && (r.transparent = this.transparent),
  46721. this.alphaTest > 0 && (r.alphaTest = this.alphaTest),
  46722. this.premultipliedAlpha === !0 && (r.premultipliedAlpha = this.premultipliedAlpha),
  46723. this.wireframe === !0 && (r.wireframe = this.wireframe),
  46724. this.wireframeLinewidth > 1 && (r.wireframeLinewidth = this.wireframeLinewidth),
  46725. i) {
  46726. var o = t(e.textures)
  46727. , a = t(e.images);
  46728. o.length > 0 && (r.textures = o),
  46729. a.length > 0 && (r.images = a)
  46730. }
  46731. return r
  46732. },
  46733. clone: function() {
  46734. return (new this.constructor).copy(this)
  46735. },
  46736. copy: function(e) {
  46737. return this.name = e.name,
  46738. this.side = e.side,
  46739. this.opacity = e.opacity,
  46740. this.transparent = e.transparent,
  46741. this.blending = e.blending,
  46742. this.blendSrc = e.blendSrc,
  46743. this.blendDst = e.blendDst,
  46744. this.blendEquation = e.blendEquation,
  46745. this.blendSrcAlpha = e.blendSrcAlpha,
  46746. this.blendDstAlpha = e.blendDstAlpha,
  46747. this.blendEquationAlpha = e.blendEquationAlpha,
  46748. this.depthFunc = e.depthFunc,
  46749. this.depthTest = e.depthTest,
  46750. this.depthWrite = e.depthWrite,
  46751. this.colorWrite = e.colorWrite,
  46752. this.precision = e.precision,
  46753. this.polygonOffset = e.polygonOffset,
  46754. this.polygonOffsetFactor = e.polygonOffsetFactor,
  46755. this.polygonOffsetUnits = e.polygonOffsetUnits,
  46756. this.alphaTest = e.alphaTest,
  46757. this.premultipliedAlpha = e.premultipliedAlpha,
  46758. this.overdraw = e.overdraw,
  46759. this.visible = e.visible,
  46760. this
  46761. },
  46762. update: function() {
  46763. this.dispatchEvent({
  46764. type: "update"
  46765. })
  46766. },
  46767. dispose: function() {
  46768. this.dispatchEvent({
  46769. type: "dispose"
  46770. })
  46771. }
  46772. },
  46773. n.EventDispatcher.prototype.apply(n.Material.prototype),
  46774. n.MaterialIdCount = 0,
  46775. n.LineBasicMaterial = function(e) {
  46776. n.Material.call(this),
  46777. this.type = "LineBasicMaterial",
  46778. this.color = new n.Color(16777215),
  46779. this.linewidth = 1,
  46780. this.linecap = "round",
  46781. this.linejoin = "round",
  46782. this.blending = n.NormalBlending,
  46783. this.vertexColors = n.NoColors,
  46784. this.fog = !0,
  46785. this.setValues(e)
  46786. }
  46787. ,
  46788. n.LineBasicMaterial.prototype = Object.create(n.Material.prototype),
  46789. n.LineBasicMaterial.prototype.constructor = n.LineBasicMaterial,
  46790. n.LineBasicMaterial.prototype.copy = function(e) {
  46791. return n.Material.prototype.copy.call(this, e),
  46792. this.color.copy(e.color),
  46793. this.linewidth = e.linewidth,
  46794. this.linecap = e.linecap,
  46795. this.linejoin = e.linejoin,
  46796. this.vertexColors = e.vertexColors,
  46797. this.fog = e.fog,
  46798. this
  46799. }
  46800. ,
  46801. n.LineDashedMaterial = function(e) {
  46802. n.Material.call(this),
  46803. this.type = "LineDashedMaterial",
  46804. this.color = new n.Color(16777215),
  46805. this.linewidth = 1,
  46806. this.scale = 1,
  46807. this.dashSize = 3,
  46808. this.gapSize = 1,
  46809. this.blending = n.NormalBlending,
  46810. this.vertexColors = n.NoColors,
  46811. this.fog = !0,
  46812. this.setValues(e)
  46813. }
  46814. ,
  46815. n.LineDashedMaterial.prototype = Object.create(n.Material.prototype),
  46816. n.LineDashedMaterial.prototype.constructor = n.LineDashedMaterial,
  46817. n.LineDashedMaterial.prototype.copy = function(e) {
  46818. return n.Material.prototype.copy.call(this, e),
  46819. this.color.copy(e.color),
  46820. this.linewidth = e.linewidth,
  46821. this.scale = e.scale,
  46822. this.dashSize = e.dashSize,
  46823. this.gapSize = e.gapSize,
  46824. this.vertexColors = e.vertexColors,
  46825. this.fog = e.fog,
  46826. this
  46827. }
  46828. ,
  46829. n.MeshBasicMaterial = function(e) {
  46830. n.Material.call(this),
  46831. this.type = "MeshBasicMaterial",
  46832. this.color = new n.Color(16777215),
  46833. this.map = null,
  46834. this.aoMap = null,
  46835. this.aoMapIntensity = 1,
  46836. this.specularMap = null,
  46837. this.alphaMap = null,
  46838. this.envMap = null,
  46839. this.combine = n.MultiplyOperation,
  46840. this.reflectivity = 1,
  46841. this.refractionRatio = .98,
  46842. this.fog = !0,
  46843. this.shading = n.SmoothShading,
  46844. this.blending = n.NormalBlending,
  46845. this.wireframe = !1,
  46846. this.wireframeLinewidth = 1,
  46847. this.wireframeLinecap = "round",
  46848. this.wireframeLinejoin = "round",
  46849. this.vertexColors = n.NoColors,
  46850. this.skinning = !1,
  46851. this.morphTargets = !1,
  46852. this.setValues(e)
  46853. }
  46854. ,
  46855. n.MeshBasicMaterial.prototype = Object.create(n.Material.prototype),
  46856. n.MeshBasicMaterial.prototype.constructor = n.MeshBasicMaterial,
  46857. n.MeshBasicMaterial.prototype.copy = function(e) {
  46858. return n.Material.prototype.copy.call(this, e),
  46859. this.color.copy(e.color),
  46860. this.map = e.map,
  46861. this.aoMap = e.aoMap,
  46862. this.aoMapIntensity = e.aoMapIntensity,
  46863. this.specularMap = e.specularMap,
  46864. this.alphaMap = e.alphaMap,
  46865. this.envMap = e.envMap,
  46866. this.combine = e.combine,
  46867. this.reflectivity = e.reflectivity,
  46868. this.refractionRatio = e.refractionRatio,
  46869. this.fog = e.fog,
  46870. this.shading = e.shading,
  46871. this.wireframe = e.wireframe,
  46872. this.wireframeLinewidth = e.wireframeLinewidth,
  46873. this.wireframeLinecap = e.wireframeLinecap,
  46874. this.wireframeLinejoin = e.wireframeLinejoin,
  46875. this.vertexColors = e.vertexColors,
  46876. this.skinning = e.skinning,
  46877. this.morphTargets = e.morphTargets,
  46878. this
  46879. }
  46880. ,
  46881. n.MeshLambertMaterial = function(e) {
  46882. n.Material.call(this),
  46883. this.type = "MeshLambertMaterial",
  46884. this.color = new n.Color(16777215),
  46885. this.map = null,
  46886. this.lightMap = null,
  46887. this.lightMapIntensity = 1,
  46888. this.aoMap = null,
  46889. this.aoMapIntensity = 1,
  46890. this.emissive = new n.Color(0),
  46891. this.emissiveIntensity = 1,
  46892. this.emissiveMap = null,
  46893. this.specularMap = null,
  46894. this.alphaMap = null,
  46895. this.envMap = null,
  46896. this.combine = n.MultiplyOperation,
  46897. this.reflectivity = 1,
  46898. this.refractionRatio = .98,
  46899. this.fog = !0,
  46900. this.blending = n.NormalBlending,
  46901. this.wireframe = !1,
  46902. this.wireframeLinewidth = 1,
  46903. this.wireframeLinecap = "round",
  46904. this.wireframeLinejoin = "round",
  46905. this.vertexColors = n.NoColors,
  46906. this.skinning = !1,
  46907. this.morphTargets = !1,
  46908. this.morphNormals = !1,
  46909. this.setValues(e)
  46910. }
  46911. ,
  46912. n.MeshLambertMaterial.prototype = Object.create(n.Material.prototype),
  46913. n.MeshLambertMaterial.prototype.constructor = n.MeshLambertMaterial,
  46914. n.MeshLambertMaterial.prototype.copy = function(e) {
  46915. return n.Material.prototype.copy.call(this, e),
  46916. this.color.copy(e.color),
  46917. this.map = e.map,
  46918. this.lightMap = e.lightMap,
  46919. this.lightMapIntensity = e.lightMapIntensity,
  46920. this.aoMap = e.aoMap,
  46921. this.aoMapIntensity = e.aoMapIntensity,
  46922. this.emissive.copy(e.emissive),
  46923. this.emissiveMap = e.emissiveMap,
  46924. this.emissiveIntensity = e.emissiveIntensity,
  46925. this.specularMap = e.specularMap,
  46926. this.alphaMap = e.alphaMap,
  46927. this.envMap = e.envMap,
  46928. this.combine = e.combine,
  46929. this.reflectivity = e.reflectivity,
  46930. this.refractionRatio = e.refractionRatio,
  46931. this.fog = e.fog,
  46932. this.wireframe = e.wireframe,
  46933. this.wireframeLinewidth = e.wireframeLinewidth,
  46934. this.wireframeLinecap = e.wireframeLinecap,
  46935. this.wireframeLinejoin = e.wireframeLinejoin,
  46936. this.vertexColors = e.vertexColors,
  46937. this.skinning = e.skinning,
  46938. this.morphTargets = e.morphTargets,
  46939. this.morphNormals = e.morphNormals,
  46940. this
  46941. }
  46942. ,
  46943. n.MeshPhongMaterial = function(e) {
  46944. n.Material.call(this),
  46945. this.type = "MeshPhongMaterial",
  46946. this.color = new n.Color(16777215),
  46947. this.specular = new n.Color(1118481),
  46948. this.shininess = 30,
  46949. this.map = null,
  46950. this.lightMap = null,
  46951. this.lightMapIntensity = 1,
  46952. this.aoMap = null,
  46953. this.aoMapIntensity = 1,
  46954. this.emissive = new n.Color(0),
  46955. this.emissiveIntensity = 1,
  46956. this.emissiveMap = null,
  46957. this.bumpMap = null,
  46958. this.bumpScale = 1,
  46959. this.normalMap = null,
  46960. this.normalScale = new n.Vector2(1,1),
  46961. this.displacementMap = null,
  46962. this.displacementScale = 1,
  46963. this.displacementBias = 0,
  46964. this.specularMap = null,
  46965. this.alphaMap = null,
  46966. this.envMap = null,
  46967. this.combine = n.MultiplyOperation,
  46968. this.reflectivity = 1,
  46969. this.refractionRatio = .98,
  46970. this.fog = !0,
  46971. this.shading = n.SmoothShading,
  46972. this.blending = n.NormalBlending,
  46973. this.wireframe = !1,
  46974. this.wireframeLinewidth = 1,
  46975. this.wireframeLinecap = "round",
  46976. this.wireframeLinejoin = "round",
  46977. this.vertexColors = n.NoColors,
  46978. this.skinning = !1,
  46979. this.morphTargets = !1,
  46980. this.morphNormals = !1,
  46981. this.setValues(e)
  46982. }
  46983. ,
  46984. n.MeshPhongMaterial.prototype = Object.create(n.Material.prototype),
  46985. n.MeshPhongMaterial.prototype.constructor = n.MeshPhongMaterial,
  46986. n.MeshPhongMaterial.prototype.copy = function(e) {
  46987. return n.Material.prototype.copy.call(this, e),
  46988. this.color.copy(e.color),
  46989. this.specular.copy(e.specular),
  46990. this.shininess = e.shininess,
  46991. this.map = e.map,
  46992. this.lightMap = e.lightMap,
  46993. this.lightMapIntensity = e.lightMapIntensity,
  46994. this.aoMap = e.aoMap,
  46995. this.aoMapIntensity = e.aoMapIntensity,
  46996. this.emissive.copy(e.emissive),
  46997. this.emissiveMap = e.emissiveMap,
  46998. this.emissiveIntensity = e.emissiveIntensity,
  46999. this.bumpMap = e.bumpMap,
  47000. this.bumpScale = e.bumpScale,
  47001. this.normalMap = e.normalMap,
  47002. this.normalScale.copy(e.normalScale),
  47003. this.displacementMap = e.displacementMap,
  47004. this.displacementScale = e.displacementScale,
  47005. this.displacementBias = e.displacementBias,
  47006. this.specularMap = e.specularMap,
  47007. this.alphaMap = e.alphaMap,
  47008. this.envMap = e.envMap,
  47009. this.combine = e.combine,
  47010. this.reflectivity = e.reflectivity,
  47011. this.refractionRatio = e.refractionRatio,
  47012. this.fog = e.fog,
  47013. this.shading = e.shading,
  47014. this.wireframe = e.wireframe,
  47015. this.wireframeLinewidth = e.wireframeLinewidth,
  47016. this.wireframeLinecap = e.wireframeLinecap,
  47017. this.wireframeLinejoin = e.wireframeLinejoin,
  47018. this.vertexColors = e.vertexColors,
  47019. this.skinning = e.skinning,
  47020. this.morphTargets = e.morphTargets,
  47021. this.morphNormals = e.morphNormals,
  47022. this
  47023. }
  47024. ,
  47025. n.MeshStandardMaterial = function(e) {
  47026. n.Material.call(this),
  47027. this.type = "MeshStandardMaterial",
  47028. this.color = new n.Color(16777215),
  47029. this.roughness = .5,
  47030. this.metalness = .5,
  47031. this.map = null,
  47032. this.lightMap = null,
  47033. this.lightMapIntensity = 1,
  47034. this.aoMap = null,
  47035. this.aoMapIntensity = 1,
  47036. this.emissive = new n.Color(0),
  47037. this.emissiveIntensity = 1,
  47038. this.emissiveMap = null,
  47039. this.bumpMap = null,
  47040. this.bumpScale = 1,
  47041. this.normalMap = null,
  47042. this.normalScale = new n.Vector2(1,1),
  47043. this.displacementMap = null,
  47044. this.displacementScale = 1,
  47045. this.displacementBias = 0,
  47046. this.roughnessMap = null,
  47047. this.metalnessMap = null,
  47048. this.alphaMap = null,
  47049. this.envMap = null,
  47050. this.envMapIntensity = 1,
  47051. this.refractionRatio = .98,
  47052. this.fog = !0,
  47053. this.shading = n.SmoothShading,
  47054. this.blending = n.NormalBlending,
  47055. this.wireframe = !1,
  47056. this.wireframeLinewidth = 1,
  47057. this.wireframeLinecap = "round",
  47058. this.wireframeLinejoin = "round",
  47059. this.vertexColors = n.NoColors,
  47060. this.skinning = !1,
  47061. this.morphTargets = !1,
  47062. this.morphNormals = !1,
  47063. this.setValues(e)
  47064. }
  47065. ,
  47066. n.MeshStandardMaterial.prototype = Object.create(n.Material.prototype),
  47067. n.MeshStandardMaterial.prototype.constructor = n.MeshStandardMaterial,
  47068. n.MeshStandardMaterial.prototype.copy = function(e) {
  47069. return n.Material.prototype.copy.call(this, e),
  47070. this.color.copy(e.color),
  47071. this.roughness = e.roughness,
  47072. this.metalness = e.metalness,
  47073. this.map = e.map,
  47074. this.lightMap = e.lightMap,
  47075. this.lightMapIntensity = e.lightMapIntensity,
  47076. this.aoMap = e.aoMap,
  47077. this.aoMapIntensity = e.aoMapIntensity,
  47078. this.emissive.copy(e.emissive),
  47079. this.emissiveMap = e.emissiveMap,
  47080. this.emissiveIntensity = e.emissiveIntensity,
  47081. this.bumpMap = e.bumpMap,
  47082. this.bumpScale = e.bumpScale,
  47083. this.normalMap = e.normalMap,
  47084. this.normalScale.copy(e.normalScale),
  47085. this.displacementMap = e.displacementMap,
  47086. this.displacementScale = e.displacementScale,
  47087. this.displacementBias = e.displacementBias,
  47088. this.roughnessMap = e.roughnessMap,
  47089. this.metalnessMap = e.metalnessMap,
  47090. this.alphaMap = e.alphaMap,
  47091. this.envMap = e.envMap,
  47092. this.envMapIntensity = e.envMapIntensity,
  47093. this.refractionRatio = e.refractionRatio,
  47094. this.fog = e.fog,
  47095. this.shading = e.shading,
  47096. this.wireframe = e.wireframe,
  47097. this.wireframeLinewidth = e.wireframeLinewidth,
  47098. this.wireframeLinecap = e.wireframeLinecap,
  47099. this.wireframeLinejoin = e.wireframeLinejoin,
  47100. this.vertexColors = e.vertexColors,
  47101. this.skinning = e.skinning,
  47102. this.morphTargets = e.morphTargets,
  47103. this.morphNormals = e.morphNormals,
  47104. this
  47105. }
  47106. ,
  47107. n.MeshDepthMaterial = function(e) {
  47108. n.Material.call(this),
  47109. this.type = "MeshDepthMaterial",
  47110. this.morphTargets = !1,
  47111. this.wireframe = !1,
  47112. this.wireframeLinewidth = 1,
  47113. this.setValues(e)
  47114. }
  47115. ,
  47116. n.MeshDepthMaterial.prototype = Object.create(n.Material.prototype),
  47117. n.MeshDepthMaterial.prototype.constructor = n.MeshDepthMaterial,
  47118. n.MeshDepthMaterial.prototype.copy = function(e) {
  47119. return n.Material.prototype.copy.call(this, e),
  47120. this.wireframe = e.wireframe,
  47121. this.wireframeLinewidth = e.wireframeLinewidth,
  47122. this
  47123. }
  47124. ,
  47125. n.MeshNormalMaterial = function(e) {
  47126. n.Material.call(this, e),
  47127. this.type = "MeshNormalMaterial",
  47128. this.wireframe = !1,
  47129. this.wireframeLinewidth = 1,
  47130. this.morphTargets = !1,
  47131. this.setValues(e)
  47132. }
  47133. ,
  47134. n.MeshNormalMaterial.prototype = Object.create(n.Material.prototype),
  47135. n.MeshNormalMaterial.prototype.constructor = n.MeshNormalMaterial,
  47136. n.MeshNormalMaterial.prototype.copy = function(e) {
  47137. return n.Material.prototype.copy.call(this, e),
  47138. this.wireframe = e.wireframe,
  47139. this.wireframeLinewidth = e.wireframeLinewidth,
  47140. this
  47141. }
  47142. ,
  47143. n.MultiMaterial = function(e) {
  47144. this.uuid = n.Math.generateUUID(),
  47145. this.type = "MultiMaterial",
  47146. this.materials = e instanceof Array ? e : [],
  47147. this.visible = !0
  47148. }
  47149. ,
  47150. n.MultiMaterial.prototype = {
  47151. constructor: n.MultiMaterial,
  47152. toJSON: function(e) {
  47153. for (var t = {
  47154. metadata: {
  47155. version: 4.2,
  47156. type: "material",
  47157. generator: "MaterialExporter"
  47158. },
  47159. uuid: this.uuid,
  47160. type: this.type,
  47161. materials: []
  47162. }, i = this.materials, n = 0, r = i.length; n < r; n++) {
  47163. var o = i[n].toJSON(e);
  47164. delete o.metadata,
  47165. t.materials.push(o)
  47166. }
  47167. return t.visible = this.visible,
  47168. t
  47169. },
  47170. clone: function() {
  47171. for (var e = new this.constructor, t = 0; t < this.materials.length; t++)
  47172. e.materials.push(this.materials[t].clone());
  47173. return e.visible = this.visible,
  47174. e
  47175. }
  47176. },
  47177. n.PointsMaterial = function(e) {
  47178. n.Material.call(this),
  47179. this.type = "PointsMaterial",
  47180. this.color = new n.Color(16777215),
  47181. this.map = null,
  47182. this.size = 1,
  47183. this.sizeAttenuation = !0,
  47184. this.blending = n.NormalBlending,
  47185. this.vertexColors = n.NoColors,
  47186. this.fog = !0,
  47187. this.setValues(e)
  47188. }
  47189. ,
  47190. n.PointsMaterial.prototype = Object.create(n.Material.prototype),
  47191. n.PointsMaterial.prototype.constructor = n.PointsMaterial,
  47192. n.PointsMaterial.prototype.copy = function(e) {
  47193. return n.Material.prototype.copy.call(this, e),
  47194. this.color.copy(e.color),
  47195. this.map = e.map,
  47196. this.size = e.size,
  47197. this.sizeAttenuation = e.sizeAttenuation,
  47198. this.vertexColors = e.vertexColors,
  47199. this.fog = e.fog,
  47200. this
  47201. }
  47202. ,
  47203. n.ShaderMaterial = function(e) {
  47204. n.Material.call(this),
  47205. this.type = "ShaderMaterial",
  47206. this.defines = {},
  47207. this.uniforms = {},
  47208. this.vertexShader = "void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",
  47209. this.fragmentShader = "void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}",
  47210. this.shading = n.SmoothShading,
  47211. this.linewidth = 1,
  47212. this.wireframe = !1,
  47213. this.wireframeLinewidth = 1,
  47214. this.fog = !1,
  47215. this.lights = !1,
  47216. this.vertexColors = n.NoColors,
  47217. this.skinning = !1,
  47218. this.morphTargets = !1,
  47219. this.morphNormals = !1,
  47220. this.extensions = {
  47221. derivatives: !1,
  47222. fragDepth: !1,
  47223. drawBuffers: !1,
  47224. shaderTextureLOD: !1
  47225. },
  47226. this.defaultAttributeValues = {
  47227. color: [1, 1, 1],
  47228. uv: [0, 0],
  47229. uv2: [0, 0]
  47230. },
  47231. this.index0AttributeName = void 0,
  47232. void 0 !== e && (void 0 !== e.attributes && console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."),
  47233. this.setValues(e))
  47234. }
  47235. ,
  47236. n.ShaderMaterial.prototype = Object.create(n.Material.prototype),
  47237. n.ShaderMaterial.prototype.constructor = n.ShaderMaterial,
  47238. n.ShaderMaterial.prototype.copy = function(e) {
  47239. return n.Material.prototype.copy.call(this, e),
  47240. this.fragmentShader = e.fragmentShader,
  47241. this.vertexShader = e.vertexShader,
  47242. this.uniforms = n.UniformsUtils.clone(e.uniforms),
  47243. this.defines = e.defines,
  47244. this.shading = e.shading,
  47245. this.wireframe = e.wireframe,
  47246. this.wireframeLinewidth = e.wireframeLinewidth,
  47247. this.fog = e.fog,
  47248. this.lights = e.lights,
  47249. this.vertexColors = e.vertexColors,
  47250. this.skinning = e.skinning,
  47251. this.morphTargets = e.morphTargets,
  47252. this.morphNormals = e.morphNormals,
  47253. this.extensions = e.extensions,
  47254. this
  47255. }
  47256. ,
  47257. n.ShaderMaterial.prototype.toJSON = function(e) {
  47258. var t = n.Material.prototype.toJSON.call(this, e);
  47259. return t.uniforms = this.uniforms,
  47260. t.vertexShader = this.vertexShader,
  47261. t.fragmentShader = this.fragmentShader,
  47262. t
  47263. }
  47264. ,
  47265. n.RawShaderMaterial = function(e) {
  47266. n.ShaderMaterial.call(this, e),
  47267. this.type = "RawShaderMaterial"
  47268. }
  47269. ,
  47270. n.RawShaderMaterial.prototype = Object.create(n.ShaderMaterial.prototype),
  47271. n.RawShaderMaterial.prototype.constructor = n.RawShaderMaterial,
  47272. n.SpriteMaterial = function(e) {
  47273. n.Material.call(this),
  47274. this.type = "SpriteMaterial",
  47275. this.color = new n.Color(16777215),
  47276. this.map = null,
  47277. this.rotation = 0,
  47278. this.fog = !1,
  47279. this.setValues(e)
  47280. }
  47281. ,
  47282. n.SpriteMaterial.prototype = Object.create(n.Material.prototype),
  47283. n.SpriteMaterial.prototype.constructor = n.SpriteMaterial,
  47284. n.SpriteMaterial.prototype.copy = function(e) {
  47285. return n.Material.prototype.copy.call(this, e),
  47286. this.color.copy(e.color),
  47287. this.map = e.map,
  47288. this.rotation = e.rotation,
  47289. this.fog = e.fog,
  47290. this
  47291. }
  47292. ,
  47293. n.Texture = function(e, t, i, r, o, a, s, l, c) {
  47294. Object.defineProperty(this, "id", {
  47295. value: n.TextureIdCount++
  47296. }),
  47297. this.uuid = n.Math.generateUUID(),
  47298. this.name = "",
  47299. this.sourceFile = "",
  47300. this.image = void 0 !== e ? e : n.Texture.DEFAULT_IMAGE,
  47301. this.mipmaps = [],
  47302. this.mapping = void 0 !== t ? t : n.Texture.DEFAULT_MAPPING,
  47303. this.wrapS = void 0 !== i ? i : n.ClampToEdgeWrapping,
  47304. this.wrapT = void 0 !== r ? r : n.ClampToEdgeWrapping,
  47305. this.magFilter = void 0 !== o ? o : n.LinearFilter,
  47306. this.minFilter = void 0 !== a ? a : n.LinearMipMapLinearFilter,
  47307. this.anisotropy = void 0 !== c ? c : 1,
  47308. this.format = void 0 !== s ? s : n.RGBAFormat,
  47309. this.type = void 0 !== l ? l : n.UnsignedByteType,
  47310. this.offset = new n.Vector2(0,0),
  47311. this.repeat = new n.Vector2(1,1),
  47312. this.generateMipmaps = !0,
  47313. this.premultiplyAlpha = !1,
  47314. this.flipY = !0,
  47315. this.unpackAlignment = 4,
  47316. this.encoding = n.LinearEncoding,
  47317. this.version = 0,
  47318. this.onUpdate = null
  47319. }
  47320. ,
  47321. n.Texture.DEFAULT_IMAGE = void 0,
  47322. n.Texture.DEFAULT_MAPPING = n.UVMapping,
  47323. n.Texture.prototype = {
  47324. constructor: n.Texture,
  47325. set needsUpdate(e) {
  47326. e === !0 && this.version++
  47327. },
  47328. clone: function() {
  47329. return (new this.constructor).copy(this)
  47330. },
  47331. copy: function(e) {
  47332. return this.image = e.image,
  47333. this.mipmaps = e.mipmaps.slice(0),
  47334. this.mapping = e.mapping,
  47335. this.wrapS = e.wrapS,
  47336. this.wrapT = e.wrapT,
  47337. this.magFilter = e.magFilter,
  47338. this.minFilter = e.minFilter,
  47339. this.anisotropy = e.anisotropy,
  47340. this.format = e.format,
  47341. this.type = e.type,
  47342. this.offset.copy(e.offset),
  47343. this.repeat.copy(e.repeat),
  47344. this.generateMipmaps = e.generateMipmaps,
  47345. this.premultiplyAlpha = e.premultiplyAlpha,
  47346. this.flipY = e.flipY,
  47347. this.unpackAlignment = e.unpackAlignment,
  47348. this.encoding = e.encoding,
  47349. this
  47350. },
  47351. toJSON: function(e) {
  47352. function t(e) {
  47353. var t;
  47354. return void 0 !== e.toDataURL ? t = e : (t = document.createElement("canvas"),
  47355. t.width = e.width,
  47356. t.height = e.height,
  47357. t.getContext("2d").drawImage(e, 0, 0, e.width, e.height)),
  47358. t.width > 2048 || t.height > 2048 ? t.toDataURL("image/jpeg", .6) : t.toDataURL("image/png")
  47359. }
  47360. if (void 0 !== e.textures[this.uuid])
  47361. return e.textures[this.uuid];
  47362. var i = {
  47363. metadata: {
  47364. version: 4.4,
  47365. type: "Texture",
  47366. generator: "Texture.toJSON"
  47367. },
  47368. uuid: this.uuid,
  47369. name: this.name,
  47370. mapping: this.mapping,
  47371. repeat: [this.repeat.x, this.repeat.y],
  47372. offset: [this.offset.x, this.offset.y],
  47373. wrap: [this.wrapS, this.wrapT],
  47374. minFilter: this.minFilter,
  47375. magFilter: this.magFilter,
  47376. anisotropy: this.anisotropy
  47377. };
  47378. if (void 0 !== this.image) {
  47379. var r = this.image;
  47380. void 0 === r.uuid && (r.uuid = n.Math.generateUUID()),
  47381. void 0 === e.images[r.uuid] && (e.images[r.uuid] = {
  47382. uuid: r.uuid,
  47383. url: t(r)
  47384. }),
  47385. i.image = r.uuid
  47386. }
  47387. return e.textures[this.uuid] = i,
  47388. i
  47389. },
  47390. dispose: function() {
  47391. this.dispatchEvent({
  47392. type: "dispose"
  47393. })
  47394. },
  47395. transformUv: function(e) {
  47396. if (this.mapping === n.UVMapping) {
  47397. if (e.multiply(this.repeat),
  47398. e.add(this.offset),
  47399. e.x < 0 || e.x > 1)
  47400. switch (this.wrapS) {
  47401. case n.RepeatWrapping:
  47402. e.x = e.x - Math.floor(e.x);
  47403. break;
  47404. case n.ClampToEdgeWrapping:
  47405. e.x = e.x < 0 ? 0 : 1;
  47406. break;
  47407. case n.MirroredRepeatWrapping:
  47408. 1 === Math.abs(Math.floor(e.x) % 2) ? e.x = Math.ceil(e.x) - e.x : e.x = e.x - Math.floor(e.x)
  47409. }
  47410. if (e.y < 0 || e.y > 1)
  47411. switch (this.wrapT) {
  47412. case n.RepeatWrapping:
  47413. e.y = e.y - Math.floor(e.y);
  47414. break;
  47415. case n.ClampToEdgeWrapping:
  47416. e.y = e.y < 0 ? 0 : 1;
  47417. break;
  47418. case n.MirroredRepeatWrapping:
  47419. 1 === Math.abs(Math.floor(e.y) % 2) ? e.y = Math.ceil(e.y) - e.y : e.y = e.y - Math.floor(e.y)
  47420. }
  47421. this.flipY && (e.y = 1 - e.y)
  47422. }
  47423. }
  47424. },
  47425. n.EventDispatcher.prototype.apply(n.Texture.prototype),
  47426. n.TextureIdCount = 0,
  47427. n.CanvasTexture = function(e, t, i, r, o, a, s, l, c) {
  47428. n.Texture.call(this, e, t, i, r, o, a, s, l, c),
  47429. this.needsUpdate = !0
  47430. }
  47431. ,
  47432. n.CanvasTexture.prototype = Object.create(n.Texture.prototype),
  47433. n.CanvasTexture.prototype.constructor = n.CanvasTexture,
  47434. n.CubeTexture = function(e, t, i, r, o, a, s, l, c) {
  47435. e = void 0 !== e ? e : [],
  47436. t = void 0 !== t ? t : n.CubeReflectionMapping,
  47437. n.Texture.call(this, e, t, i, r, o, a, s, l, c),
  47438. this.flipY = !1
  47439. }
  47440. ,
  47441. n.CubeTexture.prototype = Object.create(n.Texture.prototype),
  47442. n.CubeTexture.prototype.constructor = n.CubeTexture,
  47443. Object.defineProperty(n.CubeTexture.prototype, "images", {
  47444. get: function() {
  47445. return this.image
  47446. },
  47447. set: function(e) {
  47448. this.image = e
  47449. }
  47450. }),
  47451. n.CompressedTexture = function(e, t, i, r, o, a, s, l, c, h, u) {
  47452. n.Texture.call(this, null, a, s, l, c, h, r, o, u),
  47453. this.image = {
  47454. width: t,
  47455. height: i
  47456. },
  47457. this.mipmaps = e,
  47458. this.flipY = !1,
  47459. this.generateMipmaps = !1
  47460. }
  47461. ,
  47462. n.CompressedTexture.prototype = Object.create(n.Texture.prototype),
  47463. n.CompressedTexture.prototype.constructor = n.CompressedTexture,
  47464. n.DataTexture = function(e, t, i, r, o, a, s, l, c, h, u) {
  47465. n.Texture.call(this, null, a, s, l, c, h, r, o, u),
  47466. this.image = {
  47467. data: e,
  47468. width: t,
  47469. height: i
  47470. },
  47471. this.magFilter = void 0 !== c ? c : n.NearestFilter,
  47472. this.minFilter = void 0 !== h ? h : n.NearestFilter,
  47473. this.flipY = !1,
  47474. this.generateMipmaps = !1
  47475. }
  47476. ,
  47477. n.DataTexture.prototype = Object.create(n.Texture.prototype),
  47478. n.DataTexture.prototype.constructor = n.DataTexture,
  47479. n.VideoTexture = function(e, t, i, r, o, a, s, l, c) {
  47480. function h() {
  47481. requestAnimationFrame(h),
  47482. e.readyState === e.HAVE_ENOUGH_DATA && (u.needsUpdate = !0)
  47483. }
  47484. n.Texture.call(this, e, t, i, r, o, a, s, l, c),
  47485. this.generateMipmaps = !1;
  47486. var u = this;
  47487. h()
  47488. }
  47489. ,
  47490. n.VideoTexture.prototype = Object.create(n.Texture.prototype),
  47491. n.VideoTexture.prototype.constructor = n.VideoTexture,
  47492. n.Group = function() {
  47493. n.Object3D.call(this),
  47494. this.type = "Group"
  47495. }
  47496. ,
  47497. n.Group.prototype = Object.create(n.Object3D.prototype),
  47498. n.Group.prototype.constructor = n.Group,
  47499. n.Points = function(e, t) {
  47500. n.Object3D.call(this),
  47501. this.type = "Points",
  47502. this.geometry = void 0 !== e ? e : new n.Geometry,
  47503. this.material = void 0 !== t ? t : new n.PointsMaterial({
  47504. color: 16777215 * Math.random()
  47505. })
  47506. }
  47507. ,
  47508. n.Points.prototype = Object.create(n.Object3D.prototype),
  47509. n.Points.prototype.constructor = n.Points,
  47510. n.Points.prototype.raycast = function() {
  47511. var e = new n.Matrix4
  47512. , t = new n.Ray
  47513. , i = new n.Sphere;
  47514. return function(r, o) {
  47515. function a(e, i) {
  47516. var n = t.distanceSqToPoint(e);
  47517. if (n < d) {
  47518. var a = t.closestPointToPoint(e);
  47519. a.applyMatrix4(c);
  47520. var l = r.ray.origin.distanceTo(a);
  47521. if (l < r.near || l > r.far)
  47522. return;
  47523. o.push({
  47524. distance: l,
  47525. distanceToRay: Math.sqrt(n),
  47526. point: a.clone(),
  47527. index: i,
  47528. face: null,
  47529. object: s
  47530. })
  47531. }
  47532. }
  47533. var s = this
  47534. , l = this.geometry
  47535. , c = this.matrixWorld
  47536. , h = r.params.Points.threshold;
  47537. if (null === l.boundingSphere && l.computeBoundingSphere(),
  47538. i.copy(l.boundingSphere),
  47539. i.applyMatrix4(c),
  47540. r.ray.intersectsSphere(i) !== !1) {
  47541. e.getInverse(c),
  47542. t.copy(r.ray).applyMatrix4(e);
  47543. var u = h / ((this.scale.x + this.scale.y + this.scale.z) / 3)
  47544. , d = u * u
  47545. , p = new n.Vector3;
  47546. if (l instanceof n.BufferGeometry) {
  47547. var f = l.index
  47548. , g = l.attributes
  47549. , m = g.position.array;
  47550. if (null !== f)
  47551. for (var v = f.array, A = 0, y = v.length; A < y; A++) {
  47552. var C = v[A];
  47553. p.fromArray(m, 3 * C),
  47554. a(p, C)
  47555. }
  47556. else
  47557. for (var A = 0, I = m.length / 3; A < I; A++)
  47558. p.fromArray(m, 3 * A),
  47559. a(p, A)
  47560. } else
  47561. for (var E = l.vertices, A = 0, I = E.length; A < I; A++)
  47562. a(E[A], A)
  47563. }
  47564. }
  47565. }(),
  47566. n.Points.prototype.clone = function() {
  47567. return new this.constructor(this.geometry,this.material).copy(this)
  47568. }
  47569. ,
  47570. n.Line = function(e, t, i) {
  47571. return 1 === i ? (console.warn("THREE.Line: parameter THREE.LinePieces no longer supported. Created THREE.LineSegments instead."),
  47572. new n.LineSegments(e,t)) : (n.Object3D.call(this),
  47573. this.type = "Line",
  47574. this.geometry = void 0 !== e ? e : new n.Geometry,
  47575. void (this.material = void 0 !== t ? t : new n.LineBasicMaterial({
  47576. color: 16777215 * Math.random()
  47577. })))
  47578. }
  47579. ,
  47580. n.Line.prototype = Object.create(n.Object3D.prototype),
  47581. n.Line.prototype.constructor = n.Line,
  47582. n.Line.prototype.raycast = function() {
  47583. var e = new n.Matrix4
  47584. , t = new n.Ray
  47585. , i = new n.Sphere;
  47586. return function(r, o) {
  47587. var a = r.linePrecision
  47588. , s = a * a
  47589. , l = this.geometry
  47590. , c = this.matrixWorld;
  47591. if (null === l.boundingSphere && l.computeBoundingSphere(),
  47592. i.copy(l.boundingSphere),
  47593. i.applyMatrix4(c),
  47594. r.ray.intersectsSphere(i) !== !1) {
  47595. e.getInverse(c),
  47596. t.copy(r.ray).applyMatrix4(e);
  47597. var h = new n.Vector3
  47598. , u = new n.Vector3
  47599. , d = new n.Vector3
  47600. , p = new n.Vector3
  47601. , f = this instanceof n.LineSegments ? 2 : 1;
  47602. if (l instanceof n.BufferGeometry) {
  47603. var g = l.index
  47604. , m = l.attributes
  47605. , v = m.position.array;
  47606. if (null !== g)
  47607. for (var A = g.array, y = 0, C = A.length - 1; y < C; y += f) {
  47608. var I = A[y]
  47609. , E = A[y + 1];
  47610. h.fromArray(v, 3 * I),
  47611. u.fromArray(v, 3 * E);
  47612. var b = t.distanceSqToSegment(h, u, p, d);
  47613. if (!(b > s)) {
  47614. p.applyMatrix4(this.matrixWorld);
  47615. var w = r.ray.origin.distanceTo(p);
  47616. w < r.near || w > r.far || o.push({
  47617. distance: w,
  47618. point: d.clone().applyMatrix4(this.matrixWorld),
  47619. index: y,
  47620. face: null,
  47621. faceIndex: null,
  47622. object: this
  47623. })
  47624. }
  47625. }
  47626. else
  47627. for (var y = 0, C = v.length / 3 - 1; y < C; y += f) {
  47628. h.fromArray(v, 3 * y),
  47629. u.fromArray(v, 3 * y + 3);
  47630. var b = t.distanceSqToSegment(h, u, p, d);
  47631. if (!(b > s)) {
  47632. p.applyMatrix4(this.matrixWorld);
  47633. var w = r.ray.origin.distanceTo(p);
  47634. w < r.near || w > r.far || o.push({
  47635. distance: w,
  47636. point: d.clone().applyMatrix4(this.matrixWorld),
  47637. index: y,
  47638. face: null,
  47639. faceIndex: null,
  47640. object: this
  47641. })
  47642. }
  47643. }
  47644. } else if (l instanceof n.Geometry)
  47645. for (var _ = l.vertices, T = _.length, y = 0; y < T - 1; y += f) {
  47646. var b = t.distanceSqToSegment(_[y], _[y + 1], p, d);
  47647. if (!(b > s)) {
  47648. p.applyMatrix4(this.matrixWorld);
  47649. var w = r.ray.origin.distanceTo(p);
  47650. w < r.near || w > r.far || o.push({
  47651. distance: w,
  47652. point: d.clone().applyMatrix4(this.matrixWorld),
  47653. index: y,
  47654. face: null,
  47655. faceIndex: null,
  47656. object: this
  47657. })
  47658. }
  47659. }
  47660. }
  47661. }
  47662. }(),
  47663. n.Line.prototype.clone = function() {
  47664. return new this.constructor(this.geometry,this.material).copy(this)
  47665. }
  47666. ,
  47667. n.LineStrip = 0,
  47668. n.LinePieces = 1,
  47669. n.LineSegments = function(e, t) {
  47670. n.Line.call(this, e, t),
  47671. this.type = "LineSegments"
  47672. }
  47673. ,
  47674. n.LineSegments.prototype = Object.create(n.Line.prototype),
  47675. n.LineSegments.prototype.constructor = n.LineSegments,
  47676. n.Mesh = function(e, t) {
  47677. n.Object3D.call(this),
  47678. this.type = "Mesh",
  47679. this.geometry = void 0 !== e ? e : new n.Geometry,
  47680. this.material = void 0 !== t ? t : new n.MeshBasicMaterial({
  47681. color: 16777215 * Math.random()
  47682. }),
  47683. this.drawMode = n.TrianglesDrawMode,
  47684. this.updateMorphTargets()
  47685. }
  47686. ,
  47687. n.Mesh.prototype = Object.create(n.Object3D.prototype),
  47688. n.Mesh.prototype.constructor = n.Mesh,
  47689. n.Mesh.prototype.setDrawMode = function(e) {
  47690. this.drawMode = e
  47691. }
  47692. ,
  47693. n.Mesh.prototype.updateMorphTargets = function() {
  47694. if (void 0 !== this.geometry.morphTargets && this.geometry.morphTargets.length > 0) {
  47695. this.morphTargetBase = -1,
  47696. this.morphTargetInfluences = [],
  47697. this.morphTargetDictionary = {};
  47698. for (var e = 0, t = this.geometry.morphTargets.length; e < t; e++)
  47699. this.morphTargetInfluences.push(0),
  47700. this.morphTargetDictionary[this.geometry.morphTargets[e].name] = e
  47701. }
  47702. }
  47703. ,
  47704. n.Mesh.prototype.getMorphTargetIndexByName = function(e) {
  47705. return void 0 !== this.morphTargetDictionary[e] ? this.morphTargetDictionary[e] : (console.warn("THREE.Mesh.getMorphTargetIndexByName: morph target " + e + " does not exist. Returning 0."),
  47706. 0)
  47707. }
  47708. ,
  47709. n.Mesh.prototype.raycast = function() {
  47710. function e(e, t, i, r, o, a, s) {
  47711. return n.Triangle.barycoordFromPoint(e, t, i, r, m),
  47712. o.multiplyScalar(m.x),
  47713. a.multiplyScalar(m.y),
  47714. s.multiplyScalar(m.z),
  47715. o.add(a).add(s),
  47716. o.clone()
  47717. }
  47718. function t(e, t, i, r, o, a, s) {
  47719. var l, c = e.material;
  47720. if (l = c.side === n.BackSide ? i.intersectTriangle(a, o, r, !0, s) : i.intersectTriangle(r, o, a, c.side !== n.DoubleSide, s),
  47721. null === l)
  47722. return null;
  47723. A.copy(s),
  47724. A.applyMatrix4(e.matrixWorld);
  47725. var h = t.ray.origin.distanceTo(A);
  47726. return h < t.near || h > t.far ? null : {
  47727. distance: h,
  47728. point: A.clone(),
  47729. object: e
  47730. }
  47731. }
  47732. function i(i, r, o, a, h, u, d, m) {
  47733. s.fromArray(a, 3 * u),
  47734. l.fromArray(a, 3 * d),
  47735. c.fromArray(a, 3 * m);
  47736. var A = t(i, r, o, s, l, c, v);
  47737. return A && (h && (p.fromArray(h, 2 * u),
  47738. f.fromArray(h, 2 * d),
  47739. g.fromArray(h, 2 * m),
  47740. A.uv = e(v, s, l, c, p, f, g)),
  47741. A.face = new n.Face3(u,d,m,n.Triangle.normal(s, l, c)),
  47742. A.faceIndex = u),
  47743. A
  47744. }
  47745. var r = new n.Matrix4
  47746. , o = new n.Ray
  47747. , a = new n.Sphere
  47748. , s = new n.Vector3
  47749. , l = new n.Vector3
  47750. , c = new n.Vector3
  47751. , h = new n.Vector3
  47752. , u = new n.Vector3
  47753. , d = new n.Vector3
  47754. , p = new n.Vector2
  47755. , f = new n.Vector2
  47756. , g = new n.Vector2
  47757. , m = new n.Vector3
  47758. , v = new n.Vector3
  47759. , A = new n.Vector3;
  47760. return function(m, A) {
  47761. var y = this.geometry
  47762. , C = this.material
  47763. , I = this.matrixWorld;
  47764. if (void 0 !== C && (null === y.boundingSphere && y.computeBoundingSphere(),
  47765. a.copy(y.boundingSphere),
  47766. a.applyMatrix4(I),
  47767. m.ray.intersectsSphere(a) !== !1 && (r.getInverse(I),
  47768. o.copy(m.ray).applyMatrix4(r),
  47769. null === y.boundingBox || o.intersectsBox(y.boundingBox) !== !1))) {
  47770. var E, b;
  47771. if (y instanceof n.BufferGeometry) {
  47772. var w, _, T, x = y.index, S = y.attributes, M = S.position.array;
  47773. if (void 0 !== S.uv && (E = S.uv.array),
  47774. null !== x)
  47775. for (var R = x.array, P = 0, O = R.length; P < O; P += 3)
  47776. w = R[P],
  47777. _ = R[P + 1],
  47778. T = R[P + 2],
  47779. b = i(this, m, o, M, E, w, _, T),
  47780. b && (b.faceIndex = Math.floor(P / 3),
  47781. A.push(b));
  47782. else
  47783. for (var P = 0, O = M.length; P < O; P += 9)
  47784. w = P / 3,
  47785. _ = w + 1,
  47786. T = w + 2,
  47787. b = i(this, m, o, M, E, w, _, T),
  47788. b && (b.index = w,
  47789. A.push(b))
  47790. } else if (y instanceof n.Geometry) {
  47791. 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];
  47792. k.length > 0 && (E = k);
  47793. for (var H = 0, G = U.length; H < G; H++) {
  47794. var z = U[H]
  47795. , W = B === !0 ? F[z.materialIndex] : C;
  47796. if (void 0 !== W) {
  47797. if (L = V[z.a],
  47798. D = V[z.b],
  47799. N = V[z.c],
  47800. W.morphTargets === !0) {
  47801. var j = y.morphTargets
  47802. , Y = this.morphTargetInfluences;
  47803. s.set(0, 0, 0),
  47804. l.set(0, 0, 0),
  47805. c.set(0, 0, 0);
  47806. for (var X = 0, Z = j.length; X < Z; X++) {
  47807. var q = Y[X];
  47808. if (0 !== q) {
  47809. var K = j[X].vertices;
  47810. s.addScaledVector(h.subVectors(K[z.a], L), q),
  47811. l.addScaledVector(u.subVectors(K[z.b], D), q),
  47812. c.addScaledVector(d.subVectors(K[z.c], N), q)
  47813. }
  47814. }
  47815. s.add(L),
  47816. l.add(D),
  47817. c.add(N),
  47818. L = s,
  47819. D = l,
  47820. N = c
  47821. }
  47822. if (b = t(this, m, o, L, D, N, v)) {
  47823. if (E) {
  47824. var Q = E[H];
  47825. p.copy(Q[0]),
  47826. f.copy(Q[1]),
  47827. g.copy(Q[2]),
  47828. b.uv = e(v, L, D, N, p, f, g)
  47829. }
  47830. b.face = z,
  47831. b.faceIndex = H,
  47832. A.push(b)
  47833. }
  47834. }
  47835. }
  47836. }
  47837. }
  47838. }
  47839. }(),
  47840. n.Mesh.prototype.clone = function() {
  47841. return new this.constructor(this.geometry,this.material).copy(this)
  47842. }
  47843. ,
  47844. n.Bone = function(e) {
  47845. n.Object3D.call(this),
  47846. this.type = "Bone",
  47847. this.skin = e
  47848. }
  47849. ,
  47850. n.Bone.prototype = Object.create(n.Object3D.prototype),
  47851. n.Bone.prototype.constructor = n.Bone,
  47852. n.Bone.prototype.copy = function(e) {
  47853. return n.Object3D.prototype.copy.call(this, e),
  47854. this.skin = e.skin,
  47855. this
  47856. }
  47857. ,
  47858. n.Skeleton = function(e, t, i) {
  47859. if (this.useVertexTexture = void 0 === i || i,
  47860. this.identityMatrix = new n.Matrix4,
  47861. e = e || [],
  47862. this.bones = e.slice(0),
  47863. this.useVertexTexture) {
  47864. var r = Math.sqrt(4 * this.bones.length);
  47865. r = n.Math.nextPowerOfTwo(Math.ceil(r)),
  47866. r = Math.max(r, 4),
  47867. this.boneTextureWidth = r,
  47868. this.boneTextureHeight = r,
  47869. this.boneMatrices = new Float32Array(this.boneTextureWidth * this.boneTextureHeight * 4),
  47870. this.boneTexture = new n.DataTexture(this.boneMatrices,this.boneTextureWidth,this.boneTextureHeight,n.RGBAFormat,n.FloatType)
  47871. } else
  47872. this.boneMatrices = new Float32Array(16 * this.bones.length);
  47873. if (void 0 === t)
  47874. this.calculateInverses();
  47875. else if (this.bones.length === t.length)
  47876. this.boneInverses = t.slice(0);
  47877. else {
  47878. console.warn("THREE.Skeleton bonInverses is the wrong length."),
  47879. this.boneInverses = [];
  47880. for (var o = 0, a = this.bones.length; o < a; o++)
  47881. this.boneInverses.push(new n.Matrix4)
  47882. }
  47883. }
  47884. ,
  47885. n.Skeleton.prototype.calculateInverses = function() {
  47886. this.boneInverses = [];
  47887. for (var e = 0, t = this.bones.length; e < t; e++) {
  47888. var i = new n.Matrix4;
  47889. this.bones[e] && i.getInverse(this.bones[e].matrixWorld),
  47890. this.boneInverses.push(i)
  47891. }
  47892. }
  47893. ,
  47894. n.Skeleton.prototype.pose = function() {
  47895. for (var e, t = 0, i = this.bones.length; t < i; t++)
  47896. e = this.bones[t],
  47897. e && e.matrixWorld.getInverse(this.boneInverses[t]);
  47898. for (var t = 0, i = this.bones.length; t < i; t++)
  47899. e = this.bones[t],
  47900. e && (e.parent ? (e.matrix.getInverse(e.parent.matrixWorld),
  47901. e.matrix.multiply(e.matrixWorld)) : e.matrix.copy(e.matrixWorld),
  47902. e.matrix.decompose(e.position, e.quaternion, e.scale));
  47903. }
  47904. ,
  47905. n.Skeleton.prototype.update = function() {
  47906. var e = new n.Matrix4;
  47907. return function() {
  47908. for (var t = 0, i = this.bones.length; t < i; t++) {
  47909. var n = this.bones[t] ? this.bones[t].matrixWorld : this.identityMatrix;
  47910. e.multiplyMatrices(n, this.boneInverses[t]),
  47911. e.flattenToArrayOffset(this.boneMatrices, 16 * t)
  47912. }
  47913. this.useVertexTexture && (this.boneTexture.needsUpdate = !0)
  47914. }
  47915. }(),
  47916. n.Skeleton.prototype.clone = function() {
  47917. return new n.Skeleton(this.bones,this.boneInverses,this.useVertexTexture)
  47918. }
  47919. ,
  47920. n.SkinnedMesh = function(e, t, i) {
  47921. n.Mesh.call(this, e, t),
  47922. this.type = "SkinnedMesh",
  47923. this.bindMode = "attached",
  47924. this.bindMatrix = new n.Matrix4,
  47925. this.bindMatrixInverse = new n.Matrix4;
  47926. var r = [];
  47927. if (this.geometry && void 0 !== this.geometry.bones) {
  47928. for (var o, a, s = 0, l = this.geometry.bones.length; s < l; ++s)
  47929. a = this.geometry.bones[s],
  47930. o = new n.Bone(this),
  47931. r.push(o),
  47932. o.name = a.name,
  47933. o.position.fromArray(a.pos),
  47934. o.quaternion.fromArray(a.rotq),
  47935. void 0 !== a.scl && o.scale.fromArray(a.scl);
  47936. for (var s = 0, l = this.geometry.bones.length; s < l; ++s)
  47937. a = this.geometry.bones[s],
  47938. a.parent !== -1 && null !== a.parent ? r[a.parent].add(r[s]) : this.add(r[s])
  47939. }
  47940. this.normalizeSkinWeights(),
  47941. this.updateMatrixWorld(!0),
  47942. this.bind(new n.Skeleton(r,void 0,i), this.matrixWorld)
  47943. }
  47944. ,
  47945. n.SkinnedMesh.prototype = Object.create(n.Mesh.prototype),
  47946. n.SkinnedMesh.prototype.constructor = n.SkinnedMesh,
  47947. n.SkinnedMesh.prototype.bind = function(e, t) {
  47948. this.skeleton = e,
  47949. void 0 === t && (this.updateMatrixWorld(!0),
  47950. this.skeleton.calculateInverses(),
  47951. t = this.matrixWorld),
  47952. this.bindMatrix.copy(t),
  47953. this.bindMatrixInverse.getInverse(t)
  47954. }
  47955. ,
  47956. n.SkinnedMesh.prototype.pose = function() {
  47957. this.skeleton.pose()
  47958. }
  47959. ,
  47960. n.SkinnedMesh.prototype.normalizeSkinWeights = function() {
  47961. if (this.geometry instanceof n.Geometry)
  47962. for (var e = 0; e < this.geometry.skinWeights.length; e++) {
  47963. var t = this.geometry.skinWeights[e]
  47964. , i = 1 / t.lengthManhattan();
  47965. i !== 1 / 0 ? t.multiplyScalar(i) : t.set(1, 0, 0, 0)
  47966. }
  47967. else if (this.geometry instanceof n.BufferGeometry)
  47968. for (var r = new n.Vector4, o = this.geometry.attributes.skinWeight, e = 0; e < o.count; e++) {
  47969. r.x = o.getX(e),
  47970. r.y = o.getY(e),
  47971. r.z = o.getZ(e),
  47972. r.w = o.getW(e);
  47973. var i = 1 / r.lengthManhattan();
  47974. i !== 1 / 0 ? r.multiplyScalar(i) : r.set(1, 0, 0, 0),
  47975. o.setXYZW(e, r.x, r.y, r.z, r.w)
  47976. }
  47977. }
  47978. ,
  47979. n.SkinnedMesh.prototype.updateMatrixWorld = function(e) {
  47980. n.Mesh.prototype.updateMatrixWorld.call(this, !0),
  47981. "attached" === this.bindMode ? this.bindMatrixInverse.getInverse(this.matrixWorld) : "detached" === this.bindMode ? this.bindMatrixInverse.getInverse(this.bindMatrix) : console.warn("THREE.SkinnedMesh unrecognized bindMode: " + this.bindMode)
  47982. }
  47983. ,
  47984. n.SkinnedMesh.prototype.clone = function() {
  47985. return new this.constructor(this.geometry,this.material,this.useVertexTexture).copy(this)
  47986. }
  47987. ,
  47988. n.LOD = function() {
  47989. n.Object3D.call(this),
  47990. this.type = "LOD",
  47991. Object.defineProperties(this, {
  47992. levels: {
  47993. enumerable: !0,
  47994. value: []
  47995. },
  47996. objects: {
  47997. get: function() {
  47998. return console.warn("THREE.LOD: .objects has been renamed to .levels."),
  47999. this.levels
  48000. }
  48001. }
  48002. })
  48003. }
  48004. ,
  48005. n.LOD.prototype = Object.create(n.Object3D.prototype),
  48006. n.LOD.prototype.constructor = n.LOD,
  48007. n.LOD.prototype.addLevel = function(e, t) {
  48008. void 0 === t && (t = 0),
  48009. t = Math.abs(t);
  48010. for (var i = this.levels, n = 0; n < i.length && !(t < i[n].distance); n++)
  48011. ;
  48012. i.splice(n, 0, {
  48013. distance: t,
  48014. object: e
  48015. }),
  48016. this.add(e)
  48017. }
  48018. ,
  48019. n.LOD.prototype.getObjectForDistance = function(e) {
  48020. for (var t = this.levels, i = 1, n = t.length; i < n && !(e < t[i].distance); i++)
  48021. ;
  48022. return t[i - 1].object
  48023. }
  48024. ,
  48025. n.LOD.prototype.raycast = function() {
  48026. var e = new n.Vector3;
  48027. return function(t, i) {
  48028. e.setFromMatrixPosition(this.matrixWorld);
  48029. var n = t.ray.origin.distanceTo(e);
  48030. this.getObjectForDistance(n).raycast(t, i)
  48031. }
  48032. }(),
  48033. n.LOD.prototype.update = function() {
  48034. var e = new n.Vector3
  48035. , t = new n.Vector3;
  48036. return function(i) {
  48037. var n = this.levels;
  48038. if (n.length > 1) {
  48039. e.setFromMatrixPosition(i.matrixWorld),
  48040. t.setFromMatrixPosition(this.matrixWorld);
  48041. var r = e.distanceTo(t);
  48042. n[0].object.visible = !0;
  48043. for (var o = 1, a = n.length; o < a && r >= n[o].distance; o++)
  48044. n[o - 1].object.visible = !1,
  48045. n[o].object.visible = !0;
  48046. for (; o < a; o++)
  48047. n[o].object.visible = !1
  48048. }
  48049. }
  48050. }(),
  48051. n.LOD.prototype.copy = function(e) {
  48052. n.Object3D.prototype.copy.call(this, e, !1);
  48053. for (var t = e.levels, i = 0, r = t.length; i < r; i++) {
  48054. var o = t[i];
  48055. this.addLevel(o.object.clone(), o.distance)
  48056. }
  48057. return this
  48058. }
  48059. ,
  48060. n.LOD.prototype.toJSON = function(e) {
  48061. var t = n.Object3D.prototype.toJSON.call(this, e);
  48062. t.object.levels = [];
  48063. for (var i = this.levels, r = 0, o = i.length; r < o; r++) {
  48064. var a = i[r];
  48065. t.object.levels.push({
  48066. object: a.object.uuid,
  48067. distance: a.distance
  48068. })
  48069. }
  48070. return t
  48071. }
  48072. ,
  48073. n.Sprite = function() {
  48074. var e = new Uint16Array([0, 1, 2, 0, 2, 3])
  48075. , t = new Float32Array([-.5, -.5, 0, .5, -.5, 0, .5, .5, 0, -.5, .5, 0])
  48076. , i = new Float32Array([0, 0, 1, 0, 1, 1, 0, 1])
  48077. , r = new n.BufferGeometry;
  48078. return r.setIndex(new n.BufferAttribute(e,1)),
  48079. r.addAttribute("position", new n.BufferAttribute(t,3)),
  48080. r.addAttribute("uv", new n.BufferAttribute(i,2)),
  48081. function(e) {
  48082. n.Object3D.call(this),
  48083. this.type = "Sprite",
  48084. this.geometry = r,
  48085. this.material = void 0 !== e ? e : new n.SpriteMaterial
  48086. }
  48087. }(),
  48088. n.Sprite.prototype = Object.create(n.Object3D.prototype),
  48089. n.Sprite.prototype.constructor = n.Sprite,
  48090. n.Sprite.prototype.raycast = function() {
  48091. var e = new n.Vector3;
  48092. return function(t, i) {
  48093. e.setFromMatrixPosition(this.matrixWorld);
  48094. var n = t.ray.distanceSqToPoint(e)
  48095. , r = this.scale.x * this.scale.y;
  48096. n > r || i.push({
  48097. distance: Math.sqrt(n),
  48098. point: this.position,
  48099. face: null,
  48100. object: this
  48101. })
  48102. }
  48103. }(),
  48104. n.Sprite.prototype.clone = function() {
  48105. return new this.constructor(this.material).copy(this)
  48106. }
  48107. ,
  48108. n.Particle = n.Sprite,
  48109. n.LensFlare = function(e, t, i, r, o) {
  48110. n.Object3D.call(this),
  48111. this.lensFlares = [],
  48112. this.positionScreen = new n.Vector3,
  48113. this.customUpdateCallback = void 0,
  48114. void 0 !== e && this.add(e, t, i, r, o)
  48115. }
  48116. ,
  48117. n.LensFlare.prototype = Object.create(n.Object3D.prototype),
  48118. n.LensFlare.prototype.constructor = n.LensFlare,
  48119. n.LensFlare.prototype.add = function(e, t, i, r, o, a) {
  48120. void 0 === t && (t = -1),
  48121. void 0 === i && (i = 0),
  48122. void 0 === a && (a = 1),
  48123. void 0 === o && (o = new n.Color(16777215)),
  48124. void 0 === r && (r = n.NormalBlending),
  48125. i = Math.min(i, Math.max(0, i)),
  48126. this.lensFlares.push({
  48127. texture: e,
  48128. size: t,
  48129. distance: i,
  48130. x: 0,
  48131. y: 0,
  48132. z: 0,
  48133. scale: 1,
  48134. rotation: 0,
  48135. opacity: a,
  48136. color: o,
  48137. blending: r
  48138. })
  48139. }
  48140. ,
  48141. n.LensFlare.prototype.updateLensFlares = function() {
  48142. var e, t, i = this.lensFlares.length, n = 2 * -this.positionScreen.x, r = 2 * -this.positionScreen.y;
  48143. for (e = 0; e < i; e++)
  48144. t = this.lensFlares[e],
  48145. t.x = this.positionScreen.x + n * t.distance,
  48146. t.y = this.positionScreen.y + r * t.distance,
  48147. t.wantedRotation = t.x * Math.PI * .25,
  48148. t.rotation += .25 * (t.wantedRotation - t.rotation)
  48149. }
  48150. ,
  48151. n.LensFlare.prototype.copy = function(e) {
  48152. n.Object3D.prototype.copy.call(this, e),
  48153. this.positionScreen.copy(e.positionScreen),
  48154. this.customUpdateCallback = e.customUpdateCallback;
  48155. for (var t = 0, i = e.lensFlares.length; t < i; t++)
  48156. this.lensFlares.push(e.lensFlares[t]);
  48157. return this
  48158. }
  48159. ,
  48160. n.Scene = function() {
  48161. n.Object3D.call(this),
  48162. this.type = "Scene",
  48163. this.fog = null,
  48164. this.overrideMaterial = null,
  48165. this.autoUpdate = !0
  48166. }
  48167. ,
  48168. n.Scene.prototype = Object.create(n.Object3D.prototype),
  48169. n.Scene.prototype.constructor = n.Scene,
  48170. n.Scene.prototype.copy = function(e, t) {
  48171. return n.Object3D.prototype.copy.call(this, e, t),
  48172. null !== e.fog && (this.fog = e.fog.clone()),
  48173. null !== e.overrideMaterial && (this.overrideMaterial = e.overrideMaterial.clone()),
  48174. this.autoUpdate = e.autoUpdate,
  48175. this.matrixAutoUpdate = e.matrixAutoUpdate,
  48176. this
  48177. }
  48178. ,
  48179. n.Fog = function(e, t, i) {
  48180. this.name = "",
  48181. this.color = new n.Color(e),
  48182. this.near = void 0 !== t ? t : 1,
  48183. this.far = void 0 !== i ? i : 1e3
  48184. }
  48185. ,
  48186. n.Fog.prototype.clone = function() {
  48187. return new n.Fog(this.color.getHex(),this.near,this.far)
  48188. }
  48189. ,
  48190. n.FogExp2 = function(e, t) {
  48191. this.name = "",
  48192. this.color = new n.Color(e),
  48193. this.density = void 0 !== t ? t : 25e-5
  48194. }
  48195. ,
  48196. n.FogExp2.prototype.clone = function() {
  48197. return new n.FogExp2(this.color.getHex(),this.density)
  48198. }
  48199. ,
  48200. n.ShaderChunk = {},
  48201. n.ShaderChunk.alphamap_fragment = "#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif\n",
  48202. n.ShaderChunk.alphamap_pars_fragment = "#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif\n",
  48203. n.ShaderChunk.alphatest_fragment = "#ifdef ALPHATEST\n\tif ( diffuseColor.a < ALPHATEST ) discard;\n#endif\n",
  48204. 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",
  48205. n.ShaderChunk.aomap_pars_fragment = "#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",
  48206. n.ShaderChunk.begin_vertex = "\nvec3 transformed = vec3( position );\n",
  48207. n.ShaderChunk.beginnormal_vertex = "\nvec3 objectNormal = vec3( normal );\n",
  48208. 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",
  48209. 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",
  48210. n.ShaderChunk.color_fragment = "#ifdef USE_COLOR\n\tdiffuseColor.rgb *= vColor;\n#endif",
  48211. n.ShaderChunk.color_pars_fragment = "#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif\n",
  48212. n.ShaderChunk.color_pars_vertex = "#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",
  48213. n.ShaderChunk.color_vertex = "#ifdef USE_COLOR\n\tvColor.xyz = color.xyz;\n#endif",
  48214. 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",
  48215. 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",
  48216. n.ShaderChunk.defaultnormal_vertex = "#ifdef FLIP_SIDED\n\tobjectNormal = -objectNormal;\n#endif\nvec3 transformedNormal = normalMatrix * objectNormal;\n",
  48217. n.ShaderChunk.displacementmap_vertex = "#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normal * ( texture2D( displacementMap, uv ).x * displacementScale + displacementBias );\n#endif\n",
  48218. n.ShaderChunk.displacementmap_pars_vertex = "#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif\n",
  48219. 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",
  48220. n.ShaderChunk.emissivemap_pars_fragment = "#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif\n",
  48221. 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",
  48222. n.ShaderChunk.encodings_fragment = " gl_FragColor = linearToOutputTexel( gl_FragColor );\n",
  48223. 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",
  48224. 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",
  48225. 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",
  48226. 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",
  48227. 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",
  48228. 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",
  48229. n.ShaderChunk.lightmap_fragment = "#ifdef USE_LIGHTMAP\n\treflectedLight.indirectDiffuse += PI * texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n#endif\n",
  48230. n.ShaderChunk.lightmap_pars_fragment = "#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",
  48231. 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",
  48232. 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",
  48233. n.ShaderChunk.lights_phong_fragment = "BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;\n",
  48234. 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",
  48235. n.ShaderChunk.lights_phong_pars_vertex = "#ifdef USE_ENVMAP\n\tvarying vec3 vWorldPosition;\n#endif\n",
  48236. n.ShaderChunk.lights_phong_vertex = "#ifdef USE_ENVMAP\n\tvWorldPosition = worldPosition.xyz;\n#endif\n",
  48237. 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",
  48238. 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",
  48239. 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",
  48240. n.ShaderChunk.logdepthbuf_fragment = "#if defined(USE_LOGDEPTHBUF) && defined(USE_LOGDEPTHBUF_EXT)\n\tgl_FragDepthEXT = log2(vFragDepth) * logDepthBufFC * 0.5;\n#endif",
  48241. 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",
  48242. 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",
  48243. 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",
  48244. n.ShaderChunk.map_fragment = "#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif\n",
  48245. n.ShaderChunk.map_pars_fragment = "#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n",
  48246. 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",
  48247. n.ShaderChunk.map_particle_pars_fragment = "#ifdef USE_MAP\n\tuniform vec4 offsetRepeat;\n\tuniform sampler2D map;\n#endif\n",
  48248. n.ShaderChunk.metalnessmap_fragment = "float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.r;\n#endif\n",
  48249. n.ShaderChunk.metalnessmap_pars_fragment = "#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",
  48250. 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",
  48251. 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";
  48252. 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";
  48253. 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",
  48254. 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",
  48255. n.ShaderChunk.premultiplied_alpha_fragment = "#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif\n",
  48256. 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",
  48257. n.ShaderChunk.roughnessmap_fragment = "float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.r;\n#endif\n",
  48258. n.ShaderChunk.roughnessmap_pars_fragment = "#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",
  48259. 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",
  48260. 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",
  48261. 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",
  48262. 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",
  48263. 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",
  48264. 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",
  48265. 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",
  48266. 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",
  48267. 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",
  48268. n.ShaderChunk.specularmap_pars_fragment = "#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",
  48269. n.ShaderChunk.tonemapping_fragment = "#if defined( TONE_MAPPING )\n gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif\n",
  48270. 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",
  48271. n.ShaderChunk.uv2_pars_fragment = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif",
  48272. n.ShaderChunk.uv2_pars_vertex = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n#endif",
  48273. n.ShaderChunk.uv2_vertex = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = uv2;\n#endif",
  48274. 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",
  48275. 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",
  48276. 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",
  48277. 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",
  48278. n.UniformsUtils = {
  48279. merge: function(e) {
  48280. for (var t = {}, i = 0; i < e.length; i++) {
  48281. var n = this.clone(e[i]);
  48282. for (var r in n)
  48283. t[r] = n[r]
  48284. }
  48285. return t
  48286. },
  48287. clone: function(e) {
  48288. var t = {};
  48289. for (var i in e) {
  48290. t[i] = {};
  48291. for (var r in e[i]) {
  48292. var o = e[i][r];
  48293. 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
  48294. }
  48295. }
  48296. return t
  48297. }
  48298. },
  48299. n.UniformsLib = {
  48300. common: {
  48301. diffuse: {
  48302. type: "c",
  48303. value: new n.Color(15658734)
  48304. },
  48305. opacity: {
  48306. type: "f",
  48307. value: 1
  48308. },
  48309. map: {
  48310. type: "t",
  48311. value: null
  48312. },
  48313. offsetRepeat: {
  48314. type: "v4",
  48315. value: new n.Vector4(0,0,1,1)
  48316. },
  48317. specularMap: {
  48318. type: "t",
  48319. value: null
  48320. },
  48321. alphaMap: {
  48322. type: "t",
  48323. value: null
  48324. },
  48325. envMap: {
  48326. type: "t",
  48327. value: null
  48328. },
  48329. flipEnvMap: {
  48330. type: "f",
  48331. value: -1
  48332. },
  48333. reflectivity: {
  48334. type: "f",
  48335. value: 1
  48336. },
  48337. refractionRatio: {
  48338. type: "f",
  48339. value: .98
  48340. }
  48341. },
  48342. aomap: {
  48343. aoMap: {
  48344. type: "t",
  48345. value: null
  48346. },
  48347. aoMapIntensity: {
  48348. type: "f",
  48349. value: 1
  48350. }
  48351. },
  48352. lightmap: {
  48353. lightMap: {
  48354. type: "t",
  48355. value: null
  48356. },
  48357. lightMapIntensity: {
  48358. type: "f",
  48359. value: 1
  48360. }
  48361. },
  48362. emissivemap: {
  48363. emissiveMap: {
  48364. type: "t",
  48365. value: null
  48366. }
  48367. },
  48368. bumpmap: {
  48369. bumpMap: {
  48370. type: "t",
  48371. value: null
  48372. },
  48373. bumpScale: {
  48374. type: "f",
  48375. value: 1
  48376. }
  48377. },
  48378. normalmap: {
  48379. normalMap: {
  48380. type: "t",
  48381. value: null
  48382. },
  48383. normalScale: {
  48384. type: "v2",
  48385. value: new n.Vector2(1,1)
  48386. }
  48387. },
  48388. displacementmap: {
  48389. displacementMap: {
  48390. type: "t",
  48391. value: null
  48392. },
  48393. displacementScale: {
  48394. type: "f",
  48395. value: 1
  48396. },
  48397. displacementBias: {
  48398. type: "f",
  48399. value: 0
  48400. }
  48401. },
  48402. roughnessmap: {
  48403. roughnessMap: {
  48404. type: "t",
  48405. value: null
  48406. }
  48407. },
  48408. metalnessmap: {
  48409. metalnessMap: {
  48410. type: "t",
  48411. value: null
  48412. }
  48413. },
  48414. fog: {
  48415. fogDensity: {
  48416. type: "f",
  48417. value: 25e-5
  48418. },
  48419. fogNear: {
  48420. type: "f",
  48421. value: 1
  48422. },
  48423. fogFar: {
  48424. type: "f",
  48425. value: 2e3
  48426. },
  48427. fogColor: {
  48428. type: "c",
  48429. value: new n.Color(16777215)
  48430. }
  48431. },
  48432. lights: {
  48433. ambientLightColor: {
  48434. type: "fv",
  48435. value: []
  48436. },
  48437. directionalLights: {
  48438. type: "sa",
  48439. value: [],
  48440. properties: {
  48441. direction: {
  48442. type: "v3"
  48443. },
  48444. color: {
  48445. type: "c"
  48446. },
  48447. shadow: {
  48448. type: "i"
  48449. },
  48450. shadowBias: {
  48451. type: "f"
  48452. },
  48453. shadowRadius: {
  48454. type: "f"
  48455. },
  48456. shadowMapSize: {
  48457. type: "v2"
  48458. }
  48459. }
  48460. },
  48461. directionalShadowMap: {
  48462. type: "tv",
  48463. value: []
  48464. },
  48465. directionalShadowMatrix: {
  48466. type: "m4v",
  48467. value: []
  48468. },
  48469. spotLights: {
  48470. type: "sa",
  48471. value: [],
  48472. properties: {
  48473. color: {
  48474. type: "c"
  48475. },
  48476. position: {
  48477. type: "v3"
  48478. },
  48479. direction: {
  48480. type: "v3"
  48481. },
  48482. distance: {
  48483. type: "f"
  48484. },
  48485. coneCos: {
  48486. type: "f"
  48487. },
  48488. penumbraCos: {
  48489. type: "f"
  48490. },
  48491. decay: {
  48492. type: "f"
  48493. },
  48494. shadow: {
  48495. type: "i"
  48496. },
  48497. shadowBias: {
  48498. type: "f"
  48499. },
  48500. shadowRadius: {
  48501. type: "f"
  48502. },
  48503. shadowMapSize: {
  48504. type: "v2"
  48505. }
  48506. }
  48507. },
  48508. spotShadowMap: {
  48509. type: "tv",
  48510. value: []
  48511. },
  48512. spotShadowMatrix: {
  48513. type: "m4v",
  48514. value: []
  48515. },
  48516. pointLights: {
  48517. type: "sa",
  48518. value: [],
  48519. properties: {
  48520. color: {
  48521. type: "c"
  48522. },
  48523. position: {
  48524. type: "v3"
  48525. },
  48526. decay: {
  48527. type: "f"
  48528. },
  48529. distance: {
  48530. type: "f"
  48531. },
  48532. shadow: {
  48533. type: "i"
  48534. },
  48535. shadowBias: {
  48536. type: "f"
  48537. },
  48538. shadowRadius: {
  48539. type: "f"
  48540. },
  48541. shadowMapSize: {
  48542. type: "v2"
  48543. }
  48544. }
  48545. },
  48546. pointShadowMap: {
  48547. type: "tv",
  48548. value: []
  48549. },
  48550. pointShadowMatrix: {
  48551. type: "m4v",
  48552. value: []
  48553. },
  48554. hemisphereLights: {
  48555. type: "sa",
  48556. value: [],
  48557. properties: {
  48558. direction: {
  48559. type: "v3"
  48560. },
  48561. skyColor: {
  48562. type: "c"
  48563. },
  48564. groundColor: {
  48565. type: "c"
  48566. }
  48567. }
  48568. }
  48569. },
  48570. points: {
  48571. diffuse: {
  48572. type: "c",
  48573. value: new n.Color(15658734)
  48574. },
  48575. opacity: {
  48576. type: "f",
  48577. value: 1
  48578. },
  48579. size: {
  48580. type: "f",
  48581. value: 1
  48582. },
  48583. scale: {
  48584. type: "f",
  48585. value: 1
  48586. },
  48587. map: {
  48588. type: "t",
  48589. value: null
  48590. },
  48591. offsetRepeat: {
  48592. type: "v4",
  48593. value: new n.Vector4(0,0,1,1)
  48594. }
  48595. }
  48596. },
  48597. 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",
  48598. 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",
  48599. 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",
  48600. 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",
  48601. 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",
  48602. 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",
  48603. 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",
  48604. 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",
  48605. 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",
  48606. 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",
  48607. 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",
  48608. 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",
  48609. 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",
  48610. 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",
  48611. 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",
  48612. 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",
  48613. 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",
  48614. 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",
  48615. 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",
  48616. 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",
  48617. 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",
  48618. 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",
  48619. 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",
  48620. 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",
  48621. n.ShaderLib = {
  48622. basic: {
  48623. uniforms: n.UniformsUtils.merge([n.UniformsLib.common, n.UniformsLib.aomap, n.UniformsLib.fog]),
  48624. vertexShader: n.ShaderChunk.meshbasic_vert,
  48625. fragmentShader: n.ShaderChunk.meshbasic_frag
  48626. },
  48627. lambert: {
  48628. uniforms: n.UniformsUtils.merge([n.UniformsLib.common, n.UniformsLib.aomap, n.UniformsLib.lightmap, n.UniformsLib.emissivemap, n.UniformsLib.fog, n.UniformsLib.lights, {
  48629. emissive: {
  48630. type: "c",
  48631. value: new n.Color(0)
  48632. }
  48633. }]),
  48634. vertexShader: n.ShaderChunk.meshlambert_vert,
  48635. fragmentShader: n.ShaderChunk.meshlambert_frag
  48636. },
  48637. phong: {
  48638. 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, {
  48639. emissive: {
  48640. type: "c",
  48641. value: new n.Color(0)
  48642. },
  48643. specular: {
  48644. type: "c",
  48645. value: new n.Color(1118481)
  48646. },
  48647. shininess: {
  48648. type: "f",
  48649. value: 30
  48650. }
  48651. }]),
  48652. vertexShader: n.ShaderChunk.meshphong_vert,
  48653. fragmentShader: n.ShaderChunk.meshphong_frag
  48654. },
  48655. standard: {
  48656. 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, {
  48657. emissive: {
  48658. type: "c",
  48659. value: new n.Color(0)
  48660. },
  48661. roughness: {
  48662. type: "f",
  48663. value: .5
  48664. },
  48665. metalness: {
  48666. type: "f",
  48667. value: 0
  48668. },
  48669. envMapIntensity: {
  48670. type: "f",
  48671. value: 1
  48672. }
  48673. }]),
  48674. vertexShader: n.ShaderChunk.meshstandard_vert,
  48675. fragmentShader: n.ShaderChunk.meshstandard_frag
  48676. },
  48677. points: {
  48678. uniforms: n.UniformsUtils.merge([n.UniformsLib.points, n.UniformsLib.fog]),
  48679. vertexShader: n.ShaderChunk.points_vert,
  48680. fragmentShader: n.ShaderChunk.points_frag
  48681. },
  48682. dashed: {
  48683. uniforms: n.UniformsUtils.merge([n.UniformsLib.common, n.UniformsLib.fog, {
  48684. scale: {
  48685. type: "f",
  48686. value: 1
  48687. },
  48688. dashSize: {
  48689. type: "f",
  48690. value: 1
  48691. },
  48692. totalSize: {
  48693. type: "f",
  48694. value: 2
  48695. }
  48696. }]),
  48697. vertexShader: n.ShaderChunk.linedashed_vert,
  48698. fragmentShader: n.ShaderChunk.linedashed_frag
  48699. },
  48700. depth: {
  48701. uniforms: {
  48702. mNear: {
  48703. type: "f",
  48704. value: 1
  48705. },
  48706. mFar: {
  48707. type: "f",
  48708. value: 2e3
  48709. },
  48710. opacity: {
  48711. type: "f",
  48712. value: 1
  48713. }
  48714. },
  48715. vertexShader: n.ShaderChunk.depth_vert,
  48716. fragmentShader: n.ShaderChunk.depth_frag
  48717. },
  48718. normal: {
  48719. uniforms: {
  48720. opacity: {
  48721. type: "f",
  48722. value: 1
  48723. }
  48724. },
  48725. vertexShader: n.ShaderChunk.normal_vert,
  48726. fragmentShader: n.ShaderChunk.normal_frag
  48727. },
  48728. cube: {
  48729. uniforms: {
  48730. tCube: {
  48731. type: "t",
  48732. value: null
  48733. },
  48734. tFlip: {
  48735. type: "f",
  48736. value: -1
  48737. }
  48738. },
  48739. vertexShader: n.ShaderChunk.cube_vert,
  48740. fragmentShader: n.ShaderChunk.cube_frag
  48741. },
  48742. equirect: {
  48743. uniforms: {
  48744. tEquirect: {
  48745. type: "t",
  48746. value: null
  48747. },
  48748. tFlip: {
  48749. type: "f",
  48750. value: -1
  48751. }
  48752. },
  48753. vertexShader: n.ShaderChunk.equirect_vert,
  48754. fragmentShader: n.ShaderChunk.equirect_frag
  48755. },
  48756. depthRGBA: {
  48757. uniforms: {},
  48758. vertexShader: n.ShaderChunk.depthRGBA_vert,
  48759. fragmentShader: n.ShaderChunk.depthRGBA_frag
  48760. },
  48761. distanceRGBA: {
  48762. uniforms: {
  48763. lightPos: {
  48764. type: "v3",
  48765. value: new n.Vector3(0,0,0)
  48766. }
  48767. },
  48768. vertexShader: n.ShaderChunk.distanceRGBA_vert,
  48769. fragmentShader: n.ShaderChunk.distanceRGBA_frag
  48770. }
  48771. },
  48772. n.WebGLRenderer = function(e) {
  48773. function t() {
  48774. return null === ye ? Oe : 1
  48775. }
  48776. function i(e, t, i, n) {
  48777. se === !0 && (e *= n,
  48778. t *= n,
  48779. i *= n),
  48780. Ye.clearColor(e, t, i, n)
  48781. }
  48782. function r() {
  48783. Ye.init(),
  48784. Ye.scissor(we.copy(Le).multiplyScalar(Oe)),
  48785. Ye.viewport(Te.copy(Ne).multiplyScalar(Oe)),
  48786. i(Se.r, Se.g, Se.b, Me)
  48787. }
  48788. function o() {
  48789. Ae = null,
  48790. be = null,
  48791. Ee = "",
  48792. Ie = -1,
  48793. Ye.reset()
  48794. }
  48795. function a(e) {
  48796. e.preventDefault(),
  48797. o(),
  48798. r(),
  48799. Xe.clear()
  48800. }
  48801. function s(e) {
  48802. var t = e.target;
  48803. t.removeEventListener("dispose", s),
  48804. h(t),
  48805. ke.textures--
  48806. }
  48807. function l(e) {
  48808. var t = e.target;
  48809. t.removeEventListener("dispose", l),
  48810. u(t),
  48811. ke.textures--
  48812. }
  48813. function c(e) {
  48814. var t = e.target;
  48815. t.removeEventListener("dispose", c),
  48816. d(t)
  48817. }
  48818. function h(e) {
  48819. var t = Xe.get(e);
  48820. if (e.image && t.__image__webglTextureCube)
  48821. Ge.deleteTexture(t.__image__webglTextureCube);
  48822. else {
  48823. if (void 0 === t.__webglInit)
  48824. return;
  48825. Ge.deleteTexture(t.__webglTexture)
  48826. }
  48827. Xe.delete(e)
  48828. }
  48829. function u(e) {
  48830. var t = Xe.get(e)
  48831. , i = Xe.get(e.texture);
  48832. if (e && void 0 !== i.__webglTexture) {
  48833. if (Ge.deleteTexture(i.__webglTexture),
  48834. e instanceof n.WebGLRenderTargetCube)
  48835. for (var r = 0; r < 6; r++)
  48836. Ge.deleteFramebuffer(t.__webglFramebuffer[r]),
  48837. Ge.deleteRenderbuffer(t.__webglDepthbuffer[r]);
  48838. else
  48839. Ge.deleteFramebuffer(t.__webglFramebuffer),
  48840. Ge.deleteRenderbuffer(t.__webglDepthbuffer);
  48841. Xe.delete(e.texture),
  48842. Xe.delete(e)
  48843. }
  48844. }
  48845. function d(e) {
  48846. p(e),
  48847. Xe.delete(e)
  48848. }
  48849. function p(e) {
  48850. var t = Xe.get(e).program;
  48851. e.program = void 0,
  48852. void 0 !== t && qe.releaseProgram(t)
  48853. }
  48854. function f(e, t, i, r) {
  48855. var o;
  48856. if (i instanceof n.InstancedBufferGeometry && (o = We.get("ANGLE_instanced_arrays"),
  48857. null === o))
  48858. return void console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");
  48859. void 0 === r && (r = 0),
  48860. Ye.initAttributes();
  48861. var a = i.attributes
  48862. , s = t.getAttributes()
  48863. , l = e.defaultAttributeValues;
  48864. for (var c in s) {
  48865. var h = s[c];
  48866. if (h >= 0) {
  48867. var u = a[c];
  48868. if (void 0 !== u) {
  48869. var d = u.itemSize
  48870. , p = Ze.getAttributeBuffer(u);
  48871. if (u instanceof n.InterleavedBufferAttribute) {
  48872. var f = u.data
  48873. , g = f.stride
  48874. , m = u.offset;
  48875. f instanceof n.InstancedInterleavedBuffer ? (Ye.enableAttributeAndDivisor(h, f.meshPerAttribute, o),
  48876. void 0 === i.maxInstancedCount && (i.maxInstancedCount = f.meshPerAttribute * f.count)) : Ye.enableAttribute(h),
  48877. Ge.bindBuffer(Ge.ARRAY_BUFFER, p),
  48878. Ge.vertexAttribPointer(h, d, Ge.FLOAT, !1, g * f.array.BYTES_PER_ELEMENT, (r * g + m) * f.array.BYTES_PER_ELEMENT)
  48879. } else
  48880. u instanceof n.InstancedBufferAttribute ? (Ye.enableAttributeAndDivisor(h, u.meshPerAttribute, o),
  48881. void 0 === i.maxInstancedCount && (i.maxInstancedCount = u.meshPerAttribute * u.count)) : Ye.enableAttribute(h),
  48882. Ge.bindBuffer(Ge.ARRAY_BUFFER, p),
  48883. Ge.vertexAttribPointer(h, d, Ge.FLOAT, !1, 0, r * d * 4)
  48884. } else if (void 0 !== l) {
  48885. var v = l[c];
  48886. if (void 0 !== v)
  48887. switch (v.length) {
  48888. case 2:
  48889. Ge.vertexAttrib2fv(h, v);
  48890. break;
  48891. case 3:
  48892. Ge.vertexAttrib3fv(h, v);
  48893. break;
  48894. case 4:
  48895. Ge.vertexAttrib4fv(h, v);
  48896. break;
  48897. default:
  48898. Ge.vertexAttrib1fv(h, v)
  48899. }
  48900. }
  48901. }
  48902. }
  48903. Ye.disableUnusedAttributes()
  48904. }
  48905. function g(e, t) {
  48906. return Math.abs(t[0]) - Math.abs(e[0])
  48907. }
  48908. function m(e, t) {
  48909. 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
  48910. }
  48911. function v(e, t) {
  48912. 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
  48913. }
  48914. function A(e, t, i, n, r) {
  48915. var o, a;
  48916. i.transparent ? (o = de,
  48917. a = ++pe) : (o = he,
  48918. a = ++ue);
  48919. var s = o[a];
  48920. void 0 !== s ? (s.id = e.id,
  48921. s.object = e,
  48922. s.geometry = t,
  48923. s.material = i,
  48924. s.z = Ve.z,
  48925. s.group = r) : (s = {
  48926. id: e.id,
  48927. object: e,
  48928. geometry: t,
  48929. material: i,
  48930. z: Ve.z,
  48931. group: r
  48932. },
  48933. o.push(s))
  48934. }
  48935. function y(e, t) {
  48936. if (e.visible !== !1) {
  48937. if (e.layers.test(t.layers))
  48938. if (e instanceof n.Light)
  48939. ce.push(e);
  48940. else if (e instanceof n.Sprite)
  48941. e.frustumCulled !== !1 && Be.intersectsObject(e) !== !0 || ge.push(e);
  48942. else if (e instanceof n.LensFlare)
  48943. me.push(e);
  48944. else if (e instanceof n.ImmediateRenderObject)
  48945. ve.sortObjects === !0 && (Ve.setFromMatrixPosition(e.matrixWorld),
  48946. Ve.applyProjection(Fe)),
  48947. A(e, null, e.material, Ve.z, null);
  48948. else if ((e instanceof n.Mesh || e instanceof n.Line || e instanceof n.Points) && (e instanceof n.SkinnedMesh && e.skeleton.update(),
  48949. e.frustumCulled === !1 || Be.intersectsObject(e) === !0)) {
  48950. var i = e.material;
  48951. if (i.visible === !0) {
  48952. ve.sortObjects === !0 && (Ve.setFromMatrixPosition(e.matrixWorld),
  48953. Ve.applyProjection(Fe));
  48954. var r = Ze.update(e);
  48955. if (i instanceof n.MultiMaterial)
  48956. for (var o = r.groups, a = i.materials, s = 0, l = o.length; s < l; s++) {
  48957. var c = o[s]
  48958. , h = a[c.materialIndex];
  48959. h.visible === !0 && A(e, r, h, Ve.z, c)
  48960. }
  48961. else
  48962. A(e, r, i, Ve.z, null)
  48963. }
  48964. }
  48965. for (var u = e.children, s = 0, l = u.length; s < l; s++)
  48966. y(u[s], t)
  48967. }
  48968. }
  48969. function C(e, t, i, r) {
  48970. for (var o = 0, a = e.length; o < a; o++) {
  48971. var s = e[o]
  48972. , l = s.object
  48973. , c = s.geometry
  48974. , h = void 0 === r ? s.material : r
  48975. , u = s.group;
  48976. if (l.modelViewMatrix.multiplyMatrices(t.matrixWorldInverse, l.matrixWorld),
  48977. l.normalMatrix.getNormalMatrix(l.modelViewMatrix),
  48978. l instanceof n.ImmediateRenderObject) {
  48979. E(h);
  48980. var d = w(t, i, h, l);
  48981. Ee = "",
  48982. l.render(function(e) {
  48983. ve.renderBufferImmediate(e, d, h)
  48984. })
  48985. } else
  48986. ve.renderBufferDirect(t, i, c, h, l, u)
  48987. }
  48988. }
  48989. function I(e, t, i) {
  48990. var r = Xe.get(e)
  48991. , o = qe.getParameters(e, Ue, t, i)
  48992. , a = qe.getProgramCode(e, o)
  48993. , s = r.program
  48994. , l = !0;
  48995. if (void 0 === s)
  48996. e.addEventListener("dispose", c);
  48997. else if (s.code !== a)
  48998. p(e);
  48999. else {
  49000. if (void 0 !== o.shaderID)
  49001. return;
  49002. l = !1
  49003. }
  49004. if (l) {
  49005. if (o.shaderID) {
  49006. var h = n.ShaderLib[o.shaderID];
  49007. r.__webglShader = {
  49008. name: e.type,
  49009. uniforms: n.UniformsUtils.clone(h.uniforms),
  49010. vertexShader: h.vertexShader,
  49011. fragmentShader: h.fragmentShader
  49012. }
  49013. } else
  49014. r.__webglShader = {
  49015. name: e.type,
  49016. uniforms: e.uniforms,
  49017. vertexShader: e.vertexShader,
  49018. fragmentShader: e.fragmentShader
  49019. };
  49020. e.__webglShader = r.__webglShader,
  49021. s = qe.acquireProgram(e, o, a),
  49022. r.program = s,
  49023. e.program = s
  49024. }
  49025. var u = s.getAttributes();
  49026. if (e.morphTargets) {
  49027. e.numSupportedMorphTargets = 0;
  49028. for (var d = 0; d < ve.maxMorphTargets; d++)
  49029. u["morphTarget" + d] >= 0 && e.numSupportedMorphTargets++
  49030. }
  49031. if (e.morphNormals) {
  49032. e.numSupportedMorphNormals = 0;
  49033. for (var d = 0; d < ve.maxMorphNormals; d++)
  49034. u["morphNormal" + d] >= 0 && e.numSupportedMorphNormals++
  49035. }
  49036. r.uniformsList = [];
  49037. var f = r.__webglShader.uniforms
  49038. , g = r.program.getUniforms();
  49039. for (var m in f) {
  49040. var v = g[m];
  49041. v && r.uniformsList.push([r.__webglShader.uniforms[m], v])
  49042. }
  49043. (e instanceof n.MeshPhongMaterial || e instanceof n.MeshLambertMaterial || e instanceof n.MeshStandardMaterial || e.lights) && (r.lightsHash = Ue.hash,
  49044. f.ambientLightColor.value = Ue.ambient,
  49045. f.directionalLights.value = Ue.directional,
  49046. f.spotLights.value = Ue.spot,
  49047. f.pointLights.value = Ue.point,
  49048. f.hemisphereLights.value = Ue.hemi,
  49049. f.directionalShadowMap.value = Ue.directionalShadowMap,
  49050. f.directionalShadowMatrix.value = Ue.directionalShadowMatrix,
  49051. f.spotShadowMap.value = Ue.spotShadowMap,
  49052. f.spotShadowMatrix.value = Ue.spotShadowMatrix,
  49053. f.pointShadowMap.value = Ue.pointShadowMap,
  49054. f.pointShadowMatrix.value = Ue.pointShadowMatrix),
  49055. r.hasDynamicUniforms = !1;
  49056. for (var A = 0, y = r.uniformsList.length; A < y; A++) {
  49057. var C = r.uniformsList[A][0];
  49058. if (C.dynamic === !0) {
  49059. r.hasDynamicUniforms = !0;
  49060. break
  49061. }
  49062. }
  49063. }
  49064. function E(e) {
  49065. b(e),
  49066. 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),
  49067. Ye.setDepthFunc(e.depthFunc),
  49068. Ye.setDepthTest(e.depthTest),
  49069. Ye.setDepthWrite(e.depthWrite),
  49070. Ye.setColorWrite(e.colorWrite),
  49071. Ye.setPolygonOffset(e.polygonOffset, e.polygonOffsetFactor, e.polygonOffsetUnits)
  49072. }
  49073. function b(e) {
  49074. e.side !== n.DoubleSide ? Ye.enable(Ge.CULL_FACE) : Ye.disable(Ge.CULL_FACE),
  49075. Ye.setFlipSided(e.side === n.BackSide)
  49076. }
  49077. function w(e, t, i, r) {
  49078. xe = 0;
  49079. var o = Xe.get(i);
  49080. void 0 === o.program && (i.needsUpdate = !0),
  49081. void 0 !== o.lightsHash && o.lightsHash !== Ue.hash && (i.needsUpdate = !0),
  49082. i.needsUpdate && (I(i, t, r),
  49083. i.needsUpdate = !1);
  49084. var a = !1
  49085. , s = !1
  49086. , l = !1
  49087. , c = o.program
  49088. , h = c.getUniforms()
  49089. , u = o.__webglShader.uniforms;
  49090. if (c.id !== Ae && (Ge.useProgram(c.program),
  49091. Ae = c.id,
  49092. a = !0,
  49093. s = !0,
  49094. l = !0),
  49095. i.id !== Ie && (Ie = i.id,
  49096. s = !0),
  49097. (a || e !== be) && (Ge.uniformMatrix4fv(h.projectionMatrix, !1, e.projectionMatrix.elements),
  49098. je.logarithmicDepthBuffer && Ge.uniform1f(h.logDepthBufFC, 2 / (Math.log(e.far + 1) / Math.LN2)),
  49099. e !== be && (be = e,
  49100. s = !0,
  49101. l = !0),
  49102. (i instanceof n.ShaderMaterial || i instanceof n.MeshPhongMaterial || i instanceof n.MeshStandardMaterial || i.envMap) && void 0 !== h.cameraPosition && (Ve.setFromMatrixPosition(e.matrixWorld),
  49103. Ge.uniform3f(h.cameraPosition, Ve.x, Ve.y, Ve.z)),
  49104. (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),
  49105. void 0 !== h.toneMappingExposure && Ge.uniform1f(h.toneMappingExposure, ve.toneMappingExposure),
  49106. void 0 !== h.toneMappingWhitePoint && Ge.uniform1f(h.toneMappingWhitePoint, ve.toneMappingWhitePoint)),
  49107. i.skinning)
  49108. if (r.bindMatrix && void 0 !== h.bindMatrix && Ge.uniformMatrix4fv(h.bindMatrix, !1, r.bindMatrix.elements),
  49109. r.bindMatrixInverse && void 0 !== h.bindMatrixInverse && Ge.uniformMatrix4fv(h.bindMatrixInverse, !1, r.bindMatrixInverse.elements),
  49110. je.floatVertexTextures && r.skeleton && r.skeleton.useVertexTexture) {
  49111. if (void 0 !== h.boneTexture) {
  49112. var d = B();
  49113. Ge.uniform1i(h.boneTexture, d),
  49114. ve.setTexture(r.skeleton.boneTexture, d)
  49115. }
  49116. void 0 !== h.boneTextureWidth && Ge.uniform1i(h.boneTextureWidth, r.skeleton.boneTextureWidth),
  49117. void 0 !== h.boneTextureHeight && Ge.uniform1i(h.boneTextureHeight, r.skeleton.boneTextureHeight)
  49118. } else
  49119. r.skeleton && r.skeleton.boneMatrices && void 0 !== h.boneGlobalMatrices && Ge.uniformMatrix4fv(h.boneGlobalMatrices, !1, r.skeleton.boneMatrices);
  49120. return s && ((i instanceof n.MeshPhongMaterial || i instanceof n.MeshLambertMaterial || i instanceof n.MeshStandardMaterial || i.lights) && D(u, l),
  49121. t && i.fog && R(u, t),
  49122. (i instanceof n.MeshBasicMaterial || i instanceof n.MeshLambertMaterial || i instanceof n.MeshPhongMaterial || i instanceof n.MeshStandardMaterial) && T(u, i),
  49123. i instanceof n.LineBasicMaterial ? x(u, i) : i instanceof n.LineDashedMaterial ? (x(u, i),
  49124. 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,
  49125. u.mFar.value = e.far,
  49126. u.opacity.value = i.opacity) : i instanceof n.MeshNormalMaterial && (u.opacity.value = i.opacity),
  49127. V(o.uniformsList)),
  49128. N(h, r),
  49129. void 0 !== h.modelMatrix && Ge.uniformMatrix4fv(h.modelMatrix, !1, r.matrixWorld.elements),
  49130. o.hasDynamicUniforms === !0 && _(o.uniformsList, r, e),
  49131. c
  49132. }
  49133. function _(e, t, i) {
  49134. for (var n = [], r = 0, o = e.length; r < o; r++) {
  49135. var a = e[r][0]
  49136. , s = a.onUpdateCallback;
  49137. void 0 !== s && (s.bind(a)(t, i),
  49138. n.push(e[r]))
  49139. }
  49140. V(n)
  49141. }
  49142. function T(e, t) {
  49143. e.opacity.value = t.opacity,
  49144. e.diffuse.value = t.color,
  49145. t.emissive && e.emissive.value.copy(t.emissive).multiplyScalar(t.emissiveIntensity),
  49146. e.map.value = t.map,
  49147. e.specularMap.value = t.specularMap,
  49148. e.alphaMap.value = t.alphaMap,
  49149. t.aoMap && (e.aoMap.value = t.aoMap,
  49150. e.aoMapIntensity.value = t.aoMapIntensity);
  49151. var i;
  49152. 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),
  49153. void 0 !== i) {
  49154. i instanceof n.WebGLRenderTarget && (i = i.texture);
  49155. var r = i.offset
  49156. , o = i.repeat;
  49157. e.offsetRepeat.value.set(r.x, r.y, o.x, o.y)
  49158. }
  49159. e.envMap.value = t.envMap,
  49160. e.flipEnvMap.value = t.envMap instanceof n.WebGLRenderTargetCube ? 1 : -1,
  49161. e.reflectivity.value = t.reflectivity,
  49162. e.refractionRatio.value = t.refractionRatio
  49163. }
  49164. function x(e, t) {
  49165. e.diffuse.value = t.color,
  49166. e.opacity.value = t.opacity
  49167. }
  49168. function S(e, t) {
  49169. e.dashSize.value = t.dashSize,
  49170. e.totalSize.value = t.dashSize + t.gapSize,
  49171. e.scale.value = t.scale
  49172. }
  49173. function M(e, t) {
  49174. if (e.diffuse.value = t.color,
  49175. e.opacity.value = t.opacity,
  49176. e.size.value = t.size * Oe,
  49177. e.scale.value = te.clientHeight / 2,
  49178. e.map.value = t.map,
  49179. null !== t.map) {
  49180. var i = t.map.offset
  49181. , n = t.map.repeat;
  49182. e.offsetRepeat.value.set(i.x, i.y, n.x, n.y)
  49183. }
  49184. }
  49185. function R(e, t) {
  49186. e.fogColor.value = t.color,
  49187. t instanceof n.Fog ? (e.fogNear.value = t.near,
  49188. e.fogFar.value = t.far) : t instanceof n.FogExp2 && (e.fogDensity.value = t.density)
  49189. }
  49190. function P(e, t) {
  49191. t.lightMap && (e.lightMap.value = t.lightMap,
  49192. e.lightMapIntensity.value = t.lightMapIntensity),
  49193. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap)
  49194. }
  49195. function O(e, t) {
  49196. e.specular.value = t.specular,
  49197. e.shininess.value = Math.max(t.shininess, 1e-4),
  49198. t.lightMap && (e.lightMap.value = t.lightMap,
  49199. e.lightMapIntensity.value = t.lightMapIntensity),
  49200. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap),
  49201. t.bumpMap && (e.bumpMap.value = t.bumpMap,
  49202. e.bumpScale.value = t.bumpScale),
  49203. t.normalMap && (e.normalMap.value = t.normalMap,
  49204. e.normalScale.value.copy(t.normalScale)),
  49205. t.displacementMap && (e.displacementMap.value = t.displacementMap,
  49206. e.displacementScale.value = t.displacementScale,
  49207. e.displacementBias.value = t.displacementBias)
  49208. }
  49209. function L(e, t) {
  49210. e.roughness.value = t.roughness,
  49211. e.metalness.value = t.metalness,
  49212. t.roughnessMap && (e.roughnessMap.value = t.roughnessMap),
  49213. t.metalnessMap && (e.metalnessMap.value = t.metalnessMap),
  49214. t.lightMap && (e.lightMap.value = t.lightMap,
  49215. e.lightMapIntensity.value = t.lightMapIntensity),
  49216. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap),
  49217. t.bumpMap && (e.bumpMap.value = t.bumpMap,
  49218. e.bumpScale.value = t.bumpScale),
  49219. t.normalMap && (e.normalMap.value = t.normalMap,
  49220. e.normalScale.value.copy(t.normalScale)),
  49221. t.displacementMap && (e.displacementMap.value = t.displacementMap,
  49222. e.displacementScale.value = t.displacementScale,
  49223. e.displacementBias.value = t.displacementBias),
  49224. t.envMap && (e.envMapIntensity.value = t.envMapIntensity)
  49225. }
  49226. function D(e, t) {
  49227. e.ambientLightColor.needsUpdate = t,
  49228. e.directionalLights.needsUpdate = t,
  49229. e.pointLights.needsUpdate = t,
  49230. e.spotLights.needsUpdate = t,
  49231. e.hemisphereLights.needsUpdate = t
  49232. }
  49233. function N(e, t) {
  49234. Ge.uniformMatrix4fv(e.modelViewMatrix, !1, t.modelViewMatrix.elements),
  49235. e.normalMatrix && Ge.uniformMatrix3fv(e.normalMatrix, !1, t.normalMatrix.elements)
  49236. }
  49237. function B() {
  49238. var e = xe;
  49239. return e >= je.maxTextures && console.warn("WebGLRenderer: trying to use " + e + " texture units while this GPU supports only " + je.maxTextures),
  49240. xe += 1,
  49241. e
  49242. }
  49243. function F(e, t, i, r) {
  49244. var o, a;
  49245. if ("1i" === t)
  49246. Ge.uniform1i(i, r);
  49247. else if ("1f" === t)
  49248. Ge.uniform1f(i, r);
  49249. else if ("2f" === t)
  49250. Ge.uniform2f(i, r[0], r[1]);
  49251. else if ("3f" === t)
  49252. Ge.uniform3f(i, r[0], r[1], r[2]);
  49253. else if ("4f" === t)
  49254. Ge.uniform4f(i, r[0], r[1], r[2], r[3]);
  49255. else if ("1iv" === t)
  49256. Ge.uniform1iv(i, r);
  49257. else if ("3iv" === t)
  49258. Ge.uniform3iv(i, r);
  49259. else if ("1fv" === t)
  49260. Ge.uniform1fv(i, r);
  49261. else if ("2fv" === t)
  49262. Ge.uniform2fv(i, r);
  49263. else if ("3fv" === t)
  49264. Ge.uniform3fv(i, r);
  49265. else if ("4fv" === t)
  49266. Ge.uniform4fv(i, r);
  49267. else if ("Matrix2fv" === t)
  49268. Ge.uniformMatrix2fv(i, !1, r);
  49269. else if ("Matrix3fv" === t)
  49270. Ge.uniformMatrix3fv(i, !1, r);
  49271. else if ("Matrix4fv" === t)
  49272. Ge.uniformMatrix4fv(i, !1, r);
  49273. else if ("i" === t)
  49274. Ge.uniform1i(i, r);
  49275. else if ("f" === t)
  49276. Ge.uniform1f(i, r);
  49277. else if ("v2" === t)
  49278. Ge.uniform2f(i, r.x, r.y);
  49279. else if ("v3" === t)
  49280. Ge.uniform3f(i, r.x, r.y, r.z);
  49281. else if ("v4" === t)
  49282. Ge.uniform4f(i, r.x, r.y, r.z, r.w);
  49283. else if ("c" === t)
  49284. Ge.uniform3f(i, r.r, r.g, r.b);
  49285. else if ("s" === t) {
  49286. var s = e.properties;
  49287. for (var l in s) {
  49288. var c = s[l]
  49289. , h = i[l]
  49290. , u = r[l];
  49291. F(c, c.type, h, u)
  49292. }
  49293. } else if ("sa" === t)
  49294. for (var s = e.properties, d = 0, p = r.length; d < p; d++)
  49295. for (var l in s) {
  49296. var c = s[l]
  49297. , h = i[d][l]
  49298. , u = r[d][l];
  49299. F(c, c.type, h, u)
  49300. }
  49301. else if ("iv1" === t)
  49302. Ge.uniform1iv(i, r);
  49303. else if ("iv" === t)
  49304. Ge.uniform3iv(i, r);
  49305. else if ("fv1" === t)
  49306. Ge.uniform1fv(i, r);
  49307. else if ("fv" === t)
  49308. Ge.uniform3fv(i, r);
  49309. else if ("v2v" === t) {
  49310. void 0 === e._array && (e._array = new Float32Array(2 * r.length));
  49311. for (var d = 0, f = 0, g = r.length; d < g; d++,
  49312. f += 2)
  49313. e._array[f + 0] = r[d].x,
  49314. e._array[f + 1] = r[d].y;
  49315. Ge.uniform2fv(i, e._array)
  49316. } else if ("v3v" === t) {
  49317. void 0 === e._array && (e._array = new Float32Array(3 * r.length));
  49318. for (var d = 0, m = 0, g = r.length; d < g; d++,
  49319. m += 3)
  49320. e._array[m + 0] = r[d].x,
  49321. e._array[m + 1] = r[d].y,
  49322. e._array[m + 2] = r[d].z;
  49323. Ge.uniform3fv(i, e._array)
  49324. } else if ("v4v" === t) {
  49325. void 0 === e._array && (e._array = new Float32Array(4 * r.length));
  49326. for (var d = 0, v = 0, g = r.length; d < g; d++,
  49327. v += 4)
  49328. e._array[v + 0] = r[d].x,
  49329. e._array[v + 1] = r[d].y,
  49330. e._array[v + 2] = r[d].z,
  49331. e._array[v + 3] = r[d].w;
  49332. Ge.uniform4fv(i, e._array)
  49333. } else if ("m2" === t)
  49334. Ge.uniformMatrix2fv(i, !1, r.elements);
  49335. else if ("m3" === t)
  49336. Ge.uniformMatrix3fv(i, !1, r.elements);
  49337. else if ("m3v" === t) {
  49338. void 0 === e._array && (e._array = new Float32Array(9 * r.length));
  49339. for (var d = 0, g = r.length; d < g; d++)
  49340. r[d].flattenToArrayOffset(e._array, 9 * d);
  49341. Ge.uniformMatrix3fv(i, !1, e._array)
  49342. } else if ("m4" === t)
  49343. Ge.uniformMatrix4fv(i, !1, r.elements);
  49344. else if ("m4v" === t) {
  49345. void 0 === e._array && (e._array = new Float32Array(16 * r.length));
  49346. for (var d = 0, g = r.length; d < g; d++)
  49347. r[d].flattenToArrayOffset(e._array, 16 * d);
  49348. Ge.uniformMatrix4fv(i, !1, e._array)
  49349. } else if ("t" === t) {
  49350. if (o = r,
  49351. a = B(),
  49352. Ge.uniform1i(i, a),
  49353. !o)
  49354. return;
  49355. 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)
  49356. } else if ("tv" === t) {
  49357. void 0 === e._array && (e._array = []);
  49358. for (var d = 0, g = e.value.length; d < g; d++)
  49359. e._array[d] = B();
  49360. Ge.uniform1iv(i, e._array);
  49361. for (var d = 0, g = e.value.length; d < g; d++)
  49362. o = e.value[d],
  49363. a = e._array[d],
  49364. 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))
  49365. } else
  49366. console.warn("THREE.WebGLRenderer: Unknown uniform type: " + t)
  49367. }
  49368. function V(e) {
  49369. for (var t = 0, i = e.length; t < i; t++) {
  49370. var n = e[t][0];
  49371. if (n.needsUpdate !== !1) {
  49372. var r = n.type
  49373. , o = e[t][1]
  49374. , a = n.value;
  49375. F(n, r, o, a)
  49376. }
  49377. }
  49378. }
  49379. function U(e, t) {
  49380. 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;
  49381. for (Ue.shadowsPointLight = 0,
  49382. i = 0,
  49383. r = e.length; i < r; i++)
  49384. if (o = e[i],
  49385. a = o.color,
  49386. s = o.intensity,
  49387. l = o.distance,
  49388. o instanceof n.AmbientLight)
  49389. c += a.r * s,
  49390. h += a.g * s,
  49391. u += a.b * s;
  49392. else if (o instanceof n.DirectionalLight) {
  49393. var A = Ke.get(o);
  49394. A.color.copy(o.color).multiplyScalar(o.intensity),
  49395. A.direction.setFromMatrixPosition(o.matrixWorld),
  49396. Ve.setFromMatrixPosition(o.target.matrixWorld),
  49397. A.direction.sub(Ve),
  49398. A.direction.transformDirection(d),
  49399. A.shadow = o.castShadow,
  49400. o.castShadow && (A.shadowBias = o.shadow.bias,
  49401. A.shadowRadius = o.shadow.radius,
  49402. A.shadowMapSize = o.shadow.mapSize,
  49403. Ue.shadows[v++] = o),
  49404. Ue.directionalShadowMap[p] = o.shadow.map,
  49405. Ue.directionalShadowMatrix[p] = o.shadow.matrix,
  49406. Ue.directional[p++] = A
  49407. } else if (o instanceof n.SpotLight) {
  49408. var A = Ke.get(o);
  49409. A.position.setFromMatrixPosition(o.matrixWorld),
  49410. A.position.applyMatrix4(d),
  49411. A.color.copy(a).multiplyScalar(s),
  49412. A.distance = l,
  49413. A.direction.setFromMatrixPosition(o.matrixWorld),
  49414. Ve.setFromMatrixPosition(o.target.matrixWorld),
  49415. A.direction.sub(Ve),
  49416. A.direction.transformDirection(d),
  49417. A.coneCos = Math.cos(o.angle),
  49418. A.penumbraCos = Math.cos(o.angle * (1 - o.penumbra)),
  49419. A.decay = 0 === o.distance ? 0 : o.decay,
  49420. A.shadow = o.castShadow,
  49421. o.castShadow && (A.shadowBias = o.shadow.bias,
  49422. A.shadowRadius = o.shadow.radius,
  49423. A.shadowMapSize = o.shadow.mapSize,
  49424. Ue.shadows[v++] = o),
  49425. Ue.spotShadowMap[g] = o.shadow.map,
  49426. Ue.spotShadowMatrix[g] = o.shadow.matrix,
  49427. Ue.spot[g++] = A
  49428. } else if (o instanceof n.PointLight) {
  49429. var A = Ke.get(o);
  49430. A.position.setFromMatrixPosition(o.matrixWorld),
  49431. A.position.applyMatrix4(d),
  49432. A.color.copy(o.color).multiplyScalar(o.intensity),
  49433. A.distance = o.distance,
  49434. A.decay = 0 === o.distance ? 0 : o.decay,
  49435. A.shadow = o.castShadow,
  49436. o.castShadow && (A.shadowBias = o.shadow.bias,
  49437. A.shadowRadius = o.shadow.radius,
  49438. A.shadowMapSize = o.shadow.mapSize,
  49439. Ue.shadows[v++] = o),
  49440. Ue.pointShadowMap[f] = o.shadow.map,
  49441. void 0 === Ue.pointShadowMatrix[f] && (Ue.pointShadowMatrix[f] = new n.Matrix4),
  49442. Ve.setFromMatrixPosition(o.matrixWorld).negate(),
  49443. Ue.pointShadowMatrix[f].identity().setPosition(Ve),
  49444. Ue.point[f++] = A
  49445. } else if (o instanceof n.HemisphereLight) {
  49446. var A = Ke.get(o);
  49447. A.direction.setFromMatrixPosition(o.matrixWorld),
  49448. A.direction.transformDirection(d),
  49449. A.direction.normalize(),
  49450. A.skyColor.copy(o.color).multiplyScalar(s),
  49451. A.groundColor.copy(o.groundColor).multiplyScalar(s),
  49452. Ue.hemi[m++] = A
  49453. }
  49454. Ue.ambient[0] = c,
  49455. Ue.ambient[1] = h,
  49456. Ue.ambient[2] = u,
  49457. Ue.directional.length = p,
  49458. Ue.spot.length = g,
  49459. Ue.point.length = f,
  49460. Ue.hemi.length = m,
  49461. Ue.shadows.length = v,
  49462. Ue.hash = p + "," + f + "," + g + "," + m + "," + v
  49463. }
  49464. function k(e, t, i) {
  49465. var r;
  49466. if (i ? (Ge.texParameteri(e, Ge.TEXTURE_WRAP_S, ee(t.wrapS)),
  49467. Ge.texParameteri(e, Ge.TEXTURE_WRAP_T, ee(t.wrapT)),
  49468. Ge.texParameteri(e, Ge.TEXTURE_MAG_FILTER, ee(t.magFilter)),
  49469. Ge.texParameteri(e, Ge.TEXTURE_MIN_FILTER, ee(t.minFilter))) : (Ge.texParameteri(e, Ge.TEXTURE_WRAP_S, Ge.CLAMP_TO_EDGE),
  49470. Ge.texParameteri(e, Ge.TEXTURE_WRAP_T, Ge.CLAMP_TO_EDGE),
  49471. 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),
  49472. Ge.texParameteri(e, Ge.TEXTURE_MAG_FILTER, $(t.magFilter)),
  49473. Ge.texParameteri(e, Ge.TEXTURE_MIN_FILTER, $(t.minFilter)),
  49474. 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)),
  49475. r = We.get("EXT_texture_filter_anisotropic")) {
  49476. if (t.type === n.FloatType && null === We.get("OES_texture_float_linear"))
  49477. return;
  49478. if (t.type === n.HalfFloatType && null === We.get("OES_texture_half_float_linear"))
  49479. return;
  49480. (t.anisotropy > 1 || Xe.get(t).__currentAnisotropy) && (Ge.texParameterf(e, r.TEXTURE_MAX_ANISOTROPY_EXT, Math.min(t.anisotropy, ve.getMaxAnisotropy())),
  49481. Xe.get(t).__currentAnisotropy = t.anisotropy)
  49482. }
  49483. }
  49484. function H(e, t, i) {
  49485. void 0 === e.__webglInit && (e.__webglInit = !0,
  49486. t.addEventListener("dispose", s),
  49487. e.__webglTexture = Ge.createTexture(),
  49488. ke.textures++),
  49489. Ye.activeTexture(Ge.TEXTURE0 + i),
  49490. Ye.bindTexture(Ge.TEXTURE_2D, e.__webglTexture),
  49491. Ge.pixelStorei(Ge.UNPACK_FLIP_Y_WEBGL, t.flipY),
  49492. Ge.pixelStorei(Ge.UNPACK_PREMULTIPLY_ALPHA_WEBGL, t.premultiplyAlpha),
  49493. Ge.pixelStorei(Ge.UNPACK_ALIGNMENT, t.unpackAlignment);
  49494. var r = G(t.image, je.maxTextureSize);
  49495. W(t) && z(r) === !1 && (r = j(r));
  49496. var o = z(r)
  49497. , a = ee(t.format)
  49498. , l = ee(t.type);
  49499. k(Ge.TEXTURE_2D, t, o);
  49500. var c, h = t.mipmaps;
  49501. if (t instanceof n.DataTexture)
  49502. if (h.length > 0 && o) {
  49503. for (var u = 0, d = h.length; u < d; u++)
  49504. c = h[u],
  49505. Ye.texImage2D(Ge.TEXTURE_2D, u, a, c.width, c.height, 0, a, l, c.data);
  49506. t.generateMipmaps = !1
  49507. } else
  49508. Ye.texImage2D(Ge.TEXTURE_2D, 0, a, r.width, r.height, 0, a, l, r.data);
  49509. else if (t instanceof n.CompressedTexture)
  49510. for (var u = 0, d = h.length; u < d; u++)
  49511. c = h[u],
  49512. 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);
  49513. else if (h.length > 0 && o) {
  49514. for (var u = 0, d = h.length; u < d; u++)
  49515. c = h[u],
  49516. Ye.texImage2D(Ge.TEXTURE_2D, u, a, a, l, c);
  49517. t.generateMipmaps = !1
  49518. } else
  49519. Ye.texImage2D(Ge.TEXTURE_2D, 0, a, a, l, r);
  49520. t.generateMipmaps && o && Ge.generateMipmap(Ge.TEXTURE_2D),
  49521. e.__version = t.version,
  49522. t.onUpdate && t.onUpdate(t)
  49523. }
  49524. function G(e, t) {
  49525. if (e.width > t || e.height > t) {
  49526. var i = t / Math.max(e.width, e.height)
  49527. , n = document.createElement("canvas");
  49528. n.width = Math.floor(e.width * i),
  49529. n.height = Math.floor(e.height * i);
  49530. var r = n.getContext("2d");
  49531. return r.drawImage(e, 0, 0, e.width, e.height, 0, 0, n.width, n.height),
  49532. console.warn("THREE.WebGLRenderer: image is too big (" + e.width + "x" + e.height + "). Resized to " + n.width + "x" + n.height, e),
  49533. n
  49534. }
  49535. return e
  49536. }
  49537. function z(e) {
  49538. return n.Math.isPowerOfTwo(e.width) && n.Math.isPowerOfTwo(e.height)
  49539. }
  49540. function W(e) {
  49541. return e.wrapS !== n.ClampToEdgeWrapping || e.wrapT !== n.ClampToEdgeWrapping || e.minFilter !== n.NearestFilter && e.minFilter !== n.LinearFilter
  49542. }
  49543. function j(e) {
  49544. if (e instanceof HTMLImageElement || e instanceof HTMLCanvasElement) {
  49545. var t = document.createElement("canvas");
  49546. t.width = n.Math.nearestPowerOfTwo(e.width),
  49547. t.height = n.Math.nearestPowerOfTwo(e.height);
  49548. var i = t.getContext("2d");
  49549. return i.drawImage(e, 0, 0, t.width, t.height),
  49550. console.warn("THREE.WebGLRenderer: image is not power of two (" + e.width + "x" + e.height + "). Resized to " + t.width + "x" + t.height, e),
  49551. t
  49552. }
  49553. return e
  49554. }
  49555. function Y(e, t) {
  49556. var i = Xe.get(e);
  49557. if (6 === e.image.length)
  49558. if (e.version > 0 && i.__version !== e.version) {
  49559. i.__image__webglTextureCube || (e.addEventListener("dispose", s),
  49560. i.__image__webglTextureCube = Ge.createTexture(),
  49561. ke.textures++),
  49562. Ye.activeTexture(Ge.TEXTURE0 + t),
  49563. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, i.__image__webglTextureCube),
  49564. Ge.pixelStorei(Ge.UNPACK_FLIP_Y_WEBGL, e.flipY);
  49565. for (var r = e instanceof n.CompressedTexture, o = e.image[0]instanceof n.DataTexture, a = [], l = 0; l < 6; l++)
  49566. !ve.autoScaleCubemaps || r || o ? a[l] = o ? e.image[l].image : e.image[l] : a[l] = G(e.image[l], je.maxCubemapSize);
  49567. var c = a[0]
  49568. , h = z(c)
  49569. , u = ee(e.format)
  49570. , d = ee(e.type);
  49571. k(Ge.TEXTURE_CUBE_MAP, e, h);
  49572. for (var l = 0; l < 6; l++)
  49573. if (r)
  49574. for (var p, f = a[l].mipmaps, g = 0, m = f.length; g < m; g++)
  49575. p = f[g],
  49576. 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);
  49577. else
  49578. 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]);
  49579. e.generateMipmaps && h && Ge.generateMipmap(Ge.TEXTURE_CUBE_MAP),
  49580. i.__version = e.version,
  49581. e.onUpdate && e.onUpdate(e)
  49582. } else
  49583. Ye.activeTexture(Ge.TEXTURE0 + t),
  49584. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, i.__image__webglTextureCube)
  49585. }
  49586. function X(e, t) {
  49587. Ye.activeTexture(Ge.TEXTURE0 + t),
  49588. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, Xe.get(e).__webglTexture)
  49589. }
  49590. function Z(e, t, i, n) {
  49591. var r = ee(t.texture.format)
  49592. , o = ee(t.texture.type);
  49593. Ye.texImage2D(n, 0, r, t.width, t.height, 0, r, o, null),
  49594. Ge.bindFramebuffer(Ge.FRAMEBUFFER, e),
  49595. Ge.framebufferTexture2D(Ge.FRAMEBUFFER, i, n, Xe.get(t.texture).__webglTexture, 0),
  49596. Ge.bindFramebuffer(Ge.FRAMEBUFFER, null)
  49597. }
  49598. function q(e, t) {
  49599. Ge.bindRenderbuffer(Ge.RENDERBUFFER, e),
  49600. t.depthBuffer && !t.stencilBuffer ? (Ge.renderbufferStorage(Ge.RENDERBUFFER, Ge.DEPTH_COMPONENT16, t.width, t.height),
  49601. 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),
  49602. Ge.framebufferRenderbuffer(Ge.FRAMEBUFFER, Ge.DEPTH_STENCIL_ATTACHMENT, Ge.RENDERBUFFER, e)) : Ge.renderbufferStorage(Ge.RENDERBUFFER, Ge.RGBA4, t.width, t.height),
  49603. Ge.bindRenderbuffer(Ge.RENDERBUFFER, null)
  49604. }
  49605. function K(e) {
  49606. var t = Xe.get(e)
  49607. , i = e instanceof n.WebGLRenderTargetCube;
  49608. if (i) {
  49609. t.__webglDepthbuffer = [];
  49610. for (var r = 0; r < 6; r++)
  49611. Ge.bindFramebuffer(Ge.FRAMEBUFFER, t.__webglFramebuffer[r]),
  49612. t.__webglDepthbuffer[r] = Ge.createRenderbuffer(),
  49613. q(t.__webglDepthbuffer[r], e)
  49614. } else
  49615. Ge.bindFramebuffer(Ge.FRAMEBUFFER, t.__webglFramebuffer),
  49616. t.__webglDepthbuffer = Ge.createRenderbuffer(),
  49617. q(t.__webglDepthbuffer, e);
  49618. Ge.bindFramebuffer(Ge.FRAMEBUFFER, null)
  49619. }
  49620. function Q(e) {
  49621. var t = Xe.get(e)
  49622. , i = Xe.get(e.texture);
  49623. e.addEventListener("dispose", l),
  49624. i.__webglTexture = Ge.createTexture(),
  49625. ke.textures++;
  49626. var r = e instanceof n.WebGLRenderTargetCube
  49627. , o = n.Math.isPowerOfTwo(e.width) && n.Math.isPowerOfTwo(e.height);
  49628. if (r) {
  49629. t.__webglFramebuffer = [];
  49630. for (var a = 0; a < 6; a++)
  49631. t.__webglFramebuffer[a] = Ge.createFramebuffer()
  49632. } else
  49633. t.__webglFramebuffer = Ge.createFramebuffer();
  49634. if (r) {
  49635. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, i.__webglTexture),
  49636. k(Ge.TEXTURE_CUBE_MAP, e.texture, o);
  49637. for (var a = 0; a < 6; a++)
  49638. Z(t.__webglFramebuffer[a], e, Ge.COLOR_ATTACHMENT0, Ge.TEXTURE_CUBE_MAP_POSITIVE_X + a);
  49639. e.texture.generateMipmaps && o && Ge.generateMipmap(Ge.TEXTURE_CUBE_MAP),
  49640. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, null)
  49641. } else
  49642. Ye.bindTexture(Ge.TEXTURE_2D, i.__webglTexture),
  49643. k(Ge.TEXTURE_2D, e.texture, o),
  49644. Z(t.__webglFramebuffer, e, Ge.COLOR_ATTACHMENT0, Ge.TEXTURE_2D),
  49645. e.texture.generateMipmaps && o && Ge.generateMipmap(Ge.TEXTURE_2D),
  49646. Ye.bindTexture(Ge.TEXTURE_2D, null);
  49647. e.depthBuffer && K(e)
  49648. }
  49649. function J(e) {
  49650. var t = e instanceof n.WebGLRenderTargetCube ? Ge.TEXTURE_CUBE_MAP : Ge.TEXTURE_2D
  49651. , i = Xe.get(e.texture).__webglTexture;
  49652. Ye.bindTexture(t, i),
  49653. Ge.generateMipmap(t),
  49654. Ye.bindTexture(t, null)
  49655. }
  49656. function $(e) {
  49657. return e === n.NearestFilter || e === n.NearestMipMapNearestFilter || e === n.NearestMipMapLinearFilter ? Ge.NEAREST : Ge.LINEAR
  49658. }
  49659. function ee(e) {
  49660. var t;
  49661. if (e === n.RepeatWrapping)
  49662. return Ge.REPEAT;
  49663. if (e === n.ClampToEdgeWrapping)
  49664. return Ge.CLAMP_TO_EDGE;
  49665. if (e === n.MirroredRepeatWrapping)
  49666. return Ge.MIRRORED_REPEAT;
  49667. if (e === n.NearestFilter)
  49668. return Ge.NEAREST;
  49669. if (e === n.NearestMipMapNearestFilter)
  49670. return Ge.NEAREST_MIPMAP_NEAREST;
  49671. if (e === n.NearestMipMapLinearFilter)
  49672. return Ge.NEAREST_MIPMAP_LINEAR;
  49673. if (e === n.LinearFilter)
  49674. return Ge.LINEAR;
  49675. if (e === n.LinearMipMapNearestFilter)
  49676. return Ge.LINEAR_MIPMAP_NEAREST;
  49677. if (e === n.LinearMipMapLinearFilter)
  49678. return Ge.LINEAR_MIPMAP_LINEAR;
  49679. if (e === n.UnsignedByteType)
  49680. return Ge.UNSIGNED_BYTE;
  49681. if (e === n.UnsignedShort4444Type)
  49682. return Ge.UNSIGNED_SHORT_4_4_4_4;
  49683. if (e === n.UnsignedShort5551Type)
  49684. return Ge.UNSIGNED_SHORT_5_5_5_1;
  49685. if (e === n.UnsignedShort565Type)
  49686. return Ge.UNSIGNED_SHORT_5_6_5;
  49687. if (e === n.ByteType)
  49688. return Ge.BYTE;
  49689. if (e === n.ShortType)
  49690. return Ge.SHORT;
  49691. if (e === n.UnsignedShortType)
  49692. return Ge.UNSIGNED_SHORT;
  49693. if (e === n.IntType)
  49694. return Ge.INT;
  49695. if (e === n.UnsignedIntType)
  49696. return Ge.UNSIGNED_INT;
  49697. if (e === n.FloatType)
  49698. return Ge.FLOAT;
  49699. if (t = We.get("OES_texture_half_float"),
  49700. null !== t && e === n.HalfFloatType)
  49701. return t.HALF_FLOAT_OES;
  49702. if (e === n.AlphaFormat)
  49703. return Ge.ALPHA;
  49704. if (e === n.RGBFormat)
  49705. return Ge.RGB;
  49706. if (e === n.RGBAFormat)
  49707. return Ge.RGBA;
  49708. if (e === n.LuminanceFormat)
  49709. return Ge.LUMINANCE;
  49710. if (e === n.LuminanceAlphaFormat)
  49711. return Ge.LUMINANCE_ALPHA;
  49712. if (e === n.AddEquation)
  49713. return Ge.FUNC_ADD;
  49714. if (e === n.SubtractEquation)
  49715. return Ge.FUNC_SUBTRACT;
  49716. if (e === n.ReverseSubtractEquation)
  49717. return Ge.FUNC_REVERSE_SUBTRACT;
  49718. if (e === n.ZeroFactor)
  49719. return Ge.ZERO;
  49720. if (e === n.OneFactor)
  49721. return Ge.ONE;
  49722. if (e === n.SrcColorFactor)
  49723. return Ge.SRC_COLOR;
  49724. if (e === n.OneMinusSrcColorFactor)
  49725. return Ge.ONE_MINUS_SRC_COLOR;
  49726. if (e === n.SrcAlphaFactor)
  49727. return Ge.SRC_ALPHA;
  49728. if (e === n.OneMinusSrcAlphaFactor)
  49729. return Ge.ONE_MINUS_SRC_ALPHA;
  49730. if (e === n.DstAlphaFactor)
  49731. return Ge.DST_ALPHA;
  49732. if (e === n.OneMinusDstAlphaFactor)
  49733. return Ge.ONE_MINUS_DST_ALPHA;
  49734. if (e === n.DstColorFactor)
  49735. return Ge.DST_COLOR;
  49736. if (e === n.OneMinusDstColorFactor)
  49737. return Ge.ONE_MINUS_DST_COLOR;
  49738. if (e === n.SrcAlphaSaturateFactor)
  49739. return Ge.SRC_ALPHA_SATURATE;
  49740. if (t = We.get("WEBGL_compressed_texture_s3tc"),
  49741. null !== t) {
  49742. if (e === n.RGB_S3TC_DXT1_Format)
  49743. return t.COMPRESSED_RGB_S3TC_DXT1_EXT;
  49744. if (e === n.RGBA_S3TC_DXT1_Format)
  49745. return t.COMPRESSED_RGBA_S3TC_DXT1_EXT;
  49746. if (e === n.RGBA_S3TC_DXT3_Format)
  49747. return t.COMPRESSED_RGBA_S3TC_DXT3_EXT;
  49748. if (e === n.RGBA_S3TC_DXT5_Format)
  49749. return t.COMPRESSED_RGBA_S3TC_DXT5_EXT
  49750. }
  49751. if (t = We.get("WEBGL_compressed_texture_pvrtc"),
  49752. null !== t) {
  49753. if (e === n.RGB_PVRTC_4BPPV1_Format)
  49754. return t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;
  49755. if (e === n.RGB_PVRTC_2BPPV1_Format)
  49756. return t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;
  49757. if (e === n.RGBA_PVRTC_4BPPV1_Format)
  49758. return t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;
  49759. if (e === n.RGBA_PVRTC_2BPPV1_Format)
  49760. return t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG
  49761. }
  49762. if (t = We.get("WEBGL_compressed_texture_etc1"),
  49763. null !== t && e === n.RGB_ETC1_Format)
  49764. return t.COMPRESSED_RGB_ETC1_WEBGL;
  49765. if (t = We.get("EXT_blend_minmax"),
  49766. null !== t) {
  49767. if (e === n.MinEquation)
  49768. return t.MIN_EXT;
  49769. if (e === n.MaxEquation)
  49770. return t.MAX_EXT
  49771. }
  49772. return 0
  49773. }
  49774. console.log("THREE.WebGLRenderer", n.REVISION),
  49775. e = e || {};
  49776. var te = void 0 !== e.canvas ? e.canvas : document.createElement("canvas")
  49777. , ie = void 0 !== e.context ? e.context : null
  49778. , ne = void 0 !== e.alpha && e.alpha
  49779. , re = void 0 === e.depth || e.depth
  49780. , oe = void 0 === e.stencil || e.stencil
  49781. , ae = void 0 !== e.antialias && e.antialias
  49782. , se = void 0 === e.premultipliedAlpha || e.premultipliedAlpha
  49783. , le = void 0 !== e.preserveDrawingBuffer && e.preserveDrawingBuffer
  49784. , ce = []
  49785. , he = []
  49786. , ue = -1
  49787. , de = []
  49788. , pe = -1
  49789. , fe = new Float32Array(8)
  49790. , ge = []
  49791. , me = [];
  49792. this.domElement = te,
  49793. this.context = null,
  49794. this.autoClear = !0,
  49795. this.autoClearColor = !0,
  49796. this.autoClearDepth = !0,
  49797. this.autoClearStencil = !0,
  49798. this.sortObjects = !0,
  49799. this.gammaFactor = 2,
  49800. this.gammaInput = !1,
  49801. this.gammaOutput = !1,
  49802. this.physicallyCorrectLights = !1,
  49803. this.toneMapping = n.LinearToneMapping,
  49804. this.toneMappingExposure = 1,
  49805. this.toneMappingWhitePoint = 1,
  49806. this.maxMorphTargets = 8,
  49807. this.maxMorphNormals = 4,
  49808. this.autoScaleCubemaps = !0;
  49809. var ve = this
  49810. , Ae = null
  49811. , ye = null
  49812. , Ce = null
  49813. , Ie = -1
  49814. , Ee = ""
  49815. , be = null
  49816. , we = new n.Vector4
  49817. , _e = null
  49818. , Te = new n.Vector4
  49819. , xe = 0
  49820. , Se = new n.Color(0)
  49821. , Me = 0
  49822. , Re = te.width
  49823. , Pe = te.height
  49824. , Oe = 1
  49825. , Le = new n.Vector4(0,0,Re,Pe)
  49826. , De = !1
  49827. , Ne = new n.Vector4(0,0,Re,Pe)
  49828. , Be = new n.Frustum
  49829. , Fe = new n.Matrix4
  49830. , Ve = new n.Vector3
  49831. , Ue = {
  49832. hash: "",
  49833. ambient: [0, 0, 0],
  49834. directional: [],
  49835. directionalShadowMap: [],
  49836. directionalShadowMatrix: [],
  49837. spot: [],
  49838. spotShadowMap: [],
  49839. spotShadowMatrix: [],
  49840. point: [],
  49841. pointShadowMap: [],
  49842. pointShadowMatrix: [],
  49843. hemi: [],
  49844. shadows: [],
  49845. shadowsPointLight: 0
  49846. }
  49847. , ke = {
  49848. geometries: 0,
  49849. textures: 0
  49850. }
  49851. , He = {
  49852. calls: 0,
  49853. vertices: 0,
  49854. faces: 0,
  49855. points: 0
  49856. };
  49857. this.info = {
  49858. render: He,
  49859. memory: ke,
  49860. programs: null
  49861. };
  49862. var Ge;
  49863. try {
  49864. var ze = {
  49865. alpha: ne,
  49866. depth: re,
  49867. stencil: oe,
  49868. antialias: ae,
  49869. premultipliedAlpha: se,
  49870. preserveDrawingBuffer: le
  49871. };
  49872. if (Ge = ie || te.getContext("webgl", ze) || te.getContext("experimental-webgl", ze),
  49873. null === Ge)
  49874. throw null !== te.getContext("webgl") ? "Error creating WebGL context with your selected attributes." : "Error creating WebGL context.";
  49875. void 0 === Ge.getShaderPrecisionFormat && (Ge.getShaderPrecisionFormat = function() {
  49876. return {
  49877. rangeMin: 1,
  49878. rangeMax: 1,
  49879. precision: 1
  49880. }
  49881. }
  49882. ),
  49883. te.addEventListener("webglcontextlost", a, !1)
  49884. } catch (e) {
  49885. console.error("THREE.WebGLRenderer: " + e)
  49886. }
  49887. var We = new n.WebGLExtensions(Ge);
  49888. We.get("OES_texture_float"),
  49889. We.get("OES_texture_float_linear"),
  49890. We.get("OES_texture_half_float"),
  49891. We.get("OES_texture_half_float_linear"),
  49892. We.get("OES_standard_derivatives"),
  49893. We.get("ANGLE_instanced_arrays"),
  49894. We.get("OES_element_index_uint") && (n.BufferGeometry.MaxIndex = 4294967296);
  49895. var je = new n.WebGLCapabilities(Ge,We,e)
  49896. , Ye = new n.WebGLState(Ge,We,ee)
  49897. , Xe = new n.WebGLProperties
  49898. , Ze = new n.WebGLObjects(Ge,Xe,this.info)
  49899. , qe = new n.WebGLPrograms(this,je)
  49900. , Ke = new n.WebGLLights;
  49901. this.info.programs = qe.programs;
  49902. var Qe = new n.WebGLBufferRenderer(Ge,We,He)
  49903. , Je = new n.WebGLIndexedBufferRenderer(Ge,We,He);
  49904. r(),
  49905. this.context = Ge,
  49906. this.capabilities = je,
  49907. this.extensions = We,
  49908. this.properties = Xe,
  49909. this.state = Ye;
  49910. var $e = new n.WebGLShadowMap(this,Ue,Ze);
  49911. this.shadowMap = $e;
  49912. var et = new n.SpritePlugin(this,ge)
  49913. , tt = new n.LensFlarePlugin(this,me);
  49914. this.getContext = function() {
  49915. return Ge
  49916. }
  49917. ,
  49918. this.getContextAttributes = function() {
  49919. return Ge.getContextAttributes()
  49920. }
  49921. ,
  49922. this.forceContextLoss = function() {
  49923. We.get("WEBGL_lose_context").loseContext()
  49924. }
  49925. ,
  49926. this.getMaxAnisotropy = function() {
  49927. var e;
  49928. return function() {
  49929. if (void 0 !== e)
  49930. return e;
  49931. var t = We.get("EXT_texture_filter_anisotropic");
  49932. return e = null !== t ? Ge.getParameter(t.MAX_TEXTURE_MAX_ANISOTROPY_EXT) : 0
  49933. }
  49934. }(),
  49935. this.getPrecision = function() {
  49936. return je.precision
  49937. }
  49938. ,
  49939. this.getPixelRatio = function() {
  49940. return Oe
  49941. }
  49942. ,
  49943. this.setPixelRatio = function(e) {
  49944. void 0 !== e && (Oe = e,
  49945. this.setSize(Ne.z, Ne.w, !1))
  49946. }
  49947. ,
  49948. this.getSize = function() {
  49949. return {
  49950. width: Re,
  49951. height: Pe
  49952. }
  49953. }
  49954. ,
  49955. this.setSize = function(e, t, i, devicePixelRatio) {
  49956. if(devicePixelRatio != void 0) Oe = devicePixelRatio; //xzw add 改分辨率 始终保持清晰
  49957. Re = e,
  49958. Pe = t,
  49959. te.width = e * Oe,
  49960. te.height = t * Oe,
  49961. i !== !1 && (te.style.width = e + "px",
  49962. te.style.height = t + "px"),
  49963. this.setViewport(0, 0, e, t)
  49964. }
  49965. ,
  49966. this.setViewport = function(e, t, i, n) {
  49967. Ye.viewport(Ne.set(e, t, i, n))
  49968. }
  49969. ,
  49970. this.setScissor = function(e, t, i, n) {
  49971. Ye.scissor(Le.set(e, t, i, n))
  49972. }
  49973. ,
  49974. this.setScissorTest = function(e) {
  49975. Ye.setScissorTest(De = e)
  49976. }
  49977. ,
  49978. this.getClearColor = function() {
  49979. return Se
  49980. }
  49981. ,
  49982. this.setClearColor = function(e, t) {
  49983. Se.set(e),
  49984. Me = void 0 !== t ? t : 1,
  49985. i(Se.r, Se.g, Se.b, Me)
  49986. }
  49987. ,
  49988. this.getClearAlpha = function() {
  49989. return Me
  49990. }
  49991. ,
  49992. this.setClearAlpha = function(e) {
  49993. Me = e,
  49994. i(Se.r, Se.g, Se.b, Me)
  49995. }
  49996. ,
  49997. this.clear = function(e, t, i) {
  49998. var n = 0;
  49999. (void 0 === e || e) && (n |= Ge.COLOR_BUFFER_BIT),
  50000. (void 0 === t || t) && (n |= Ge.DEPTH_BUFFER_BIT),
  50001. (void 0 === i || i) && (n |= Ge.STENCIL_BUFFER_BIT),
  50002. Ge.clear(n)
  50003. }
  50004. ,
  50005. this.clearColor = function() {
  50006. this.clear(!0, !1, !1)
  50007. }
  50008. ,
  50009. this.clearDepth = function() {
  50010. this.clear(!1, !0, !1)
  50011. }
  50012. ,
  50013. this.clearStencil = function() {
  50014. this.clear(!1, !1, !0)
  50015. }
  50016. ,
  50017. this.clearTarget = function(e, t, i, n) {
  50018. this.setRenderTarget(e),
  50019. this.clear(t, i, n)
  50020. }
  50021. ,
  50022. this.resetGLState = o,
  50023. this.dispose = function() {
  50024. te.removeEventListener("webglcontextlost", a, !1)
  50025. }
  50026. ,
  50027. this.renderBufferImmediate = function(e, t, i) {
  50028. Ye.initAttributes();
  50029. var r = Xe.get(e);
  50030. e.hasPositions && !r.position && (r.position = Ge.createBuffer()),
  50031. e.hasNormals && !r.normal && (r.normal = Ge.createBuffer()),
  50032. e.hasUvs && !r.uv && (r.uv = Ge.createBuffer()),
  50033. e.hasColors && !r.color && (r.color = Ge.createBuffer());
  50034. var o = t.getAttributes();
  50035. if (e.hasPositions && (Ge.bindBuffer(Ge.ARRAY_BUFFER, r.position),
  50036. Ge.bufferData(Ge.ARRAY_BUFFER, e.positionArray, Ge.DYNAMIC_DRAW),
  50037. Ye.enableAttribute(o.position),
  50038. Ge.vertexAttribPointer(o.position, 3, Ge.FLOAT, !1, 0, 0)),
  50039. e.hasNormals) {
  50040. if (Ge.bindBuffer(Ge.ARRAY_BUFFER, r.normal),
  50041. "MeshPhongMaterial" !== i.type && "MeshStandardMaterial" !== i.type && i.shading === n.FlatShading)
  50042. for (var a = 0, s = 3 * e.count; a < s; a += 9) {
  50043. var l = e.normalArray
  50044. , c = (l[a + 0] + l[a + 3] + l[a + 6]) / 3
  50045. , h = (l[a + 1] + l[a + 4] + l[a + 7]) / 3
  50046. , u = (l[a + 2] + l[a + 5] + l[a + 8]) / 3;
  50047. l[a + 0] = c,
  50048. l[a + 1] = h,
  50049. l[a + 2] = u,
  50050. l[a + 3] = c,
  50051. l[a + 4] = h,
  50052. l[a + 5] = u,
  50053. l[a + 6] = c,
  50054. l[a + 7] = h,
  50055. l[a + 8] = u
  50056. }
  50057. Ge.bufferData(Ge.ARRAY_BUFFER, e.normalArray, Ge.DYNAMIC_DRAW),
  50058. Ye.enableAttribute(o.normal),
  50059. Ge.vertexAttribPointer(o.normal, 3, Ge.FLOAT, !1, 0, 0)
  50060. }
  50061. e.hasUvs && i.map && (Ge.bindBuffer(Ge.ARRAY_BUFFER, r.uv),
  50062. Ge.bufferData(Ge.ARRAY_BUFFER, e.uvArray, Ge.DYNAMIC_DRAW),
  50063. Ye.enableAttribute(o.uv),
  50064. Ge.vertexAttribPointer(o.uv, 2, Ge.FLOAT, !1, 0, 0)),
  50065. e.hasColors && i.vertexColors !== n.NoColors && (Ge.bindBuffer(Ge.ARRAY_BUFFER, r.color),
  50066. Ge.bufferData(Ge.ARRAY_BUFFER, e.colorArray, Ge.DYNAMIC_DRAW),
  50067. Ye.enableAttribute(o.color),
  50068. Ge.vertexAttribPointer(o.color, 3, Ge.FLOAT, !1, 0, 0)),
  50069. Ye.disableUnusedAttributes(),
  50070. Ge.drawArrays(Ge.TRIANGLES, 0, e.count),
  50071. e.count = 0
  50072. }
  50073. ,
  50074. this.renderBufferDirect = function(e, i, r, o, a, s) {
  50075. E(o);
  50076. var l = w(e, i, o, a)
  50077. , c = !1
  50078. , h = r.id + "_" + l.id + "_" + o.wireframe;
  50079. h !== Ee && (Ee = h,
  50080. c = !0);
  50081. var u = a.morphTargetInfluences;
  50082. if (void 0 !== u) {
  50083. for (var d = [], p = 0, m = u.length; p < m; p++) {
  50084. var v = u[p];
  50085. d.push([v, p])
  50086. }
  50087. d.sort(g),
  50088. d.length > 8 && (d.length = 8);
  50089. for (var A = r.morphAttributes, p = 0, m = d.length; p < m; p++) {
  50090. var v = d[p];
  50091. if (fe[p] = v[0],
  50092. 0 !== v[0]) {
  50093. var y = v[1];
  50094. o.morphTargets === !0 && A.position && r.addAttribute("morphTarget" + p, A.position[y]),
  50095. o.morphNormals === !0 && A.normal && r.addAttribute("morphNormal" + p, A.normal[y])
  50096. } else
  50097. o.morphTargets === !0 && r.removeAttribute("morphTarget" + p),
  50098. o.morphNormals === !0 && r.removeAttribute("morphNormal" + p)
  50099. }
  50100. var C = l.getUniforms();
  50101. null !== C.morphTargetInfluences && Ge.uniform1fv(C.morphTargetInfluences, fe),
  50102. c = !0
  50103. }
  50104. var y = r.index
  50105. , I = r.attributes.position;
  50106. o.wireframe === !0 && (y = Ze.getWireframeAttribute(r));
  50107. var b;
  50108. null !== y ? (b = Je,
  50109. b.setIndex(y)) : b = Qe,
  50110. c && (f(o, l, r),
  50111. null !== y && Ge.bindBuffer(Ge.ELEMENT_ARRAY_BUFFER, Ze.getAttributeBuffer(y)));
  50112. var _ = 0
  50113. , T = 1 / 0;
  50114. null !== y ? T = y.count : void 0 !== I && (T = I.count);
  50115. var x = r.drawRange.start
  50116. , S = r.drawRange.count
  50117. , M = null !== s ? s.start : 0
  50118. , R = null !== s ? s.count : 1 / 0
  50119. , P = Math.max(_, x, M)
  50120. , O = Math.min(_ + T, x + S, M + R) - 1
  50121. , L = Math.max(0, O - P + 1);
  50122. if (a instanceof n.Mesh)
  50123. if (o.wireframe === !0)
  50124. Ye.setLineWidth(o.wireframeLinewidth * t()),
  50125. b.setMode(Ge.LINES);
  50126. else
  50127. switch (a.drawMode) {
  50128. case n.TrianglesDrawMode:
  50129. b.setMode(Ge.TRIANGLES);
  50130. break;
  50131. case n.TriangleStripDrawMode:
  50132. b.setMode(Ge.TRIANGLE_STRIP);
  50133. break;
  50134. case n.TriangleFanDrawMode:
  50135. b.setMode(Ge.TRIANGLE_FAN)
  50136. }
  50137. else if (a instanceof n.Line) {
  50138. var D = o.linewidth;
  50139. void 0 === D && (D = 1),
  50140. Ye.setLineWidth(D * t()),
  50141. a instanceof n.LineSegments ? b.setMode(Ge.LINES) : b.setMode(Ge.LINE_STRIP)
  50142. } else
  50143. a instanceof n.Points && b.setMode(Ge.POINTS);
  50144. r instanceof n.InstancedBufferGeometry ? r.maxInstancedCount > 0 && b.renderInstances(r, P, L) : b.render(P, L)
  50145. }
  50146. ,
  50147. this.render = function(e, t, i, r) {
  50148. if (t instanceof n.Camera == !1)
  50149. return void console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");
  50150. var o = e.fog;
  50151. if (Ee = "",
  50152. Ie = -1,
  50153. be = null,
  50154. e.autoUpdate === !0 && e.updateMatrixWorld(),
  50155. null === t.parent && t.updateMatrixWorld(),
  50156. t.matrixWorldInverse.getInverse(t.matrixWorld),
  50157. Fe.multiplyMatrices(t.projectionMatrix, t.matrixWorldInverse),
  50158. Be.setFromMatrix(Fe),
  50159. ce.length = 0,
  50160. ue = -1,
  50161. pe = -1,
  50162. ge.length = 0,
  50163. me.length = 0,
  50164. y(e, t),
  50165. he.length = ue + 1,
  50166. de.length = pe + 1,
  50167. ve.sortObjects === !0 && (he.sort(m),
  50168. de.sort(v)),
  50169. U(ce, t),
  50170. $e.render(e, t),
  50171. He.calls = 0,
  50172. He.vertices = 0,
  50173. He.faces = 0,
  50174. He.points = 0,
  50175. void 0 === i && (i = null),
  50176. this.setRenderTarget(i),
  50177. (this.autoClear || r) && this.clear(this.autoClearColor, this.autoClearDepth, this.autoClearStencil),
  50178. e.overrideMaterial) {
  50179. var a = e.overrideMaterial;
  50180. C(he, t, o, a),
  50181. C(de, t, o, a)
  50182. } else
  50183. Ye.setBlending(n.NoBlending),
  50184. C(he, t, o),
  50185. C(de, t, o);
  50186. if (et.render(e, t),
  50187. tt.render(e, t, Te),
  50188. i) {
  50189. var s = i.texture;
  50190. s.generateMipmaps && z(i) && s.minFilter !== n.NearestFilter && s.minFilter !== n.LinearFilter && J(i)
  50191. }
  50192. Ye.setDepthTest(!0),
  50193. Ye.setDepthWrite(!0),
  50194. Ye.setColorWrite(!0)
  50195. }
  50196. ,
  50197. this.setFaceCulling = function(e, t) {
  50198. e === n.CullFaceNone ? Ye.disable(Ge.CULL_FACE) : (t === n.FrontFaceDirectionCW ? Ge.frontFace(Ge.CW) : Ge.frontFace(Ge.CCW),
  50199. e === n.CullFaceBack ? Ge.cullFace(Ge.BACK) : e === n.CullFaceFront ? Ge.cullFace(Ge.FRONT) : Ge.cullFace(Ge.FRONT_AND_BACK),
  50200. Ye.enable(Ge.CULL_FACE))
  50201. }
  50202. ,
  50203. this.setTexture = function(e, t) {
  50204. var i = Xe.get(e);
  50205. if (e.version > 0 && i.__version !== e.version) {
  50206. var n = e.image;
  50207. 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)
  50208. }
  50209. Ye.activeTexture(Ge.TEXTURE0 + t),
  50210. Ye.bindTexture(Ge.TEXTURE_2D, i.__webglTexture)
  50211. }
  50212. ,
  50213. this.getCurrentRenderTarget = function() {
  50214. return ye
  50215. }
  50216. ,
  50217. this.setRenderTarget = function(e) {
  50218. ye = e,
  50219. e && void 0 === Xe.get(e).__webglFramebuffer && Q(e);
  50220. var t, i = e instanceof n.WebGLRenderTargetCube;
  50221. if (e) {
  50222. var r = Xe.get(e);
  50223. t = i ? r.__webglFramebuffer[e.activeCubeFace] : r.__webglFramebuffer,
  50224. we.copy(e.scissor),
  50225. _e = e.scissorTest,
  50226. Te.copy(e.viewport)
  50227. } else
  50228. t = null,
  50229. we.copy(Le).multiplyScalar(Oe),
  50230. _e = De,
  50231. Te.copy(Ne).multiplyScalar(Oe);
  50232. if (Ce !== t && (Ge.bindFramebuffer(Ge.FRAMEBUFFER, t),
  50233. Ce = t),
  50234. Ye.scissor(we),
  50235. Ye.setScissorTest(_e),
  50236. Ye.viewport(Te),
  50237. i) {
  50238. var o = Xe.get(e.texture);
  50239. Ge.framebufferTexture2D(Ge.FRAMEBUFFER, Ge.COLOR_ATTACHMENT0, Ge.TEXTURE_CUBE_MAP_POSITIVE_X + e.activeCubeFace, o.__webglTexture, e.activeMipMapLevel)
  50240. }
  50241. }
  50242. ,
  50243. this.readRenderTargetPixels = function(e, t, i, r, o, a) {
  50244. if (e instanceof n.WebGLRenderTarget == !1)
  50245. return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");
  50246. var s = Xe.get(e).__webglFramebuffer;
  50247. if (s) {
  50248. var l = !1;
  50249. s !== Ce && (Ge.bindFramebuffer(Ge.FRAMEBUFFER, s),
  50250. l = !0);
  50251. try {
  50252. var c = e.texture;
  50253. if (c.format !== n.RGBAFormat && ee(c.format) !== Ge.getParameter(Ge.IMPLEMENTATION_COLOR_READ_FORMAT))
  50254. return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");
  50255. 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")))
  50256. return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");
  50257. 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.")
  50258. } finally {
  50259. l && Ge.bindFramebuffer(Ge.FRAMEBUFFER, Ce)
  50260. }
  50261. }
  50262. }
  50263. }
  50264. ,
  50265. n.WebGLRenderTarget = function(e, t, i) {
  50266. this.uuid = n.Math.generateUUID(),
  50267. this.width = e,
  50268. this.height = t,
  50269. this.scissor = new n.Vector4(0,0,e,t),
  50270. this.scissorTest = !1,
  50271. this.viewport = new n.Vector4(0,0,e,t),
  50272. i = i || {},
  50273. void 0 === i.minFilter && (i.minFilter = n.LinearFilter),
  50274. this.texture = new n.Texture(void 0,void 0,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy),
  50275. this.depthBuffer = void 0 === i.depthBuffer || i.depthBuffer,
  50276. this.stencilBuffer = void 0 === i.stencilBuffer || i.stencilBuffer
  50277. }
  50278. ,
  50279. n.WebGLRenderTarget.prototype = {
  50280. constructor: n.WebGLRenderTarget,
  50281. setSize: function(e, t) {
  50282. this.width === e && this.height === t || (this.width = e,
  50283. this.height = t,
  50284. this.dispose()),
  50285. this.viewport.set(0, 0, e, t),
  50286. this.scissor.set(0, 0, e, t)
  50287. },
  50288. clone: function() {
  50289. return (new this.constructor).copy(this)
  50290. },
  50291. copy: function(e) {
  50292. return this.width = e.width,
  50293. this.height = e.height,
  50294. this.viewport.copy(e.viewport),
  50295. this.texture = e.texture.clone(),
  50296. this.depthBuffer = e.depthBuffer,
  50297. this.stencilBuffer = e.stencilBuffer,
  50298. this
  50299. },
  50300. dispose: function() {
  50301. this.dispatchEvent({
  50302. type: "dispose"
  50303. })
  50304. }
  50305. },
  50306. n.EventDispatcher.prototype.apply(n.WebGLRenderTarget.prototype),
  50307. n.WebGLRenderTargetCube = function(e, t, i) {
  50308. n.WebGLRenderTarget.call(this, e, t, i),
  50309. this.activeCubeFace = 0,
  50310. this.activeMipMapLevel = 0
  50311. }
  50312. ,
  50313. n.WebGLRenderTargetCube.prototype = Object.create(n.WebGLRenderTarget.prototype),
  50314. n.WebGLRenderTargetCube.prototype.constructor = n.WebGLRenderTargetCube,
  50315. n.WebGLBufferRenderer = function(e, t, i) {
  50316. function r(e) {
  50317. s = e
  50318. }
  50319. function o(t, n) {
  50320. e.drawArrays(s, t, n),
  50321. i.calls++,
  50322. i.vertices += n,
  50323. s === e.TRIANGLES && (i.faces += n / 3)
  50324. }
  50325. function a(r) {
  50326. var o = t.get("ANGLE_instanced_arrays");
  50327. if (null === o)
  50328. return void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");
  50329. var a = r.attributes.position
  50330. , l = 0;
  50331. a instanceof n.InterleavedBufferAttribute ? (l = a.data.count,
  50332. o.drawArraysInstancedANGLE(s, 0, l, r.maxInstancedCount)) : (l = a.count,
  50333. o.drawArraysInstancedANGLE(s, 0, l, r.maxInstancedCount)),
  50334. i.calls++,
  50335. i.vertices += l * r.maxInstancedCount,
  50336. s === e.TRIANGLES && (i.faces += r.maxInstancedCount * l / 3)
  50337. }
  50338. var s;
  50339. this.setMode = r,
  50340. this.render = o,
  50341. this.renderInstances = a
  50342. }
  50343. ,
  50344. n.WebGLIndexedBufferRenderer = function(e, t, i) {
  50345. function n(e) {
  50346. s = e
  50347. }
  50348. function r(i) {
  50349. i.array instanceof Uint32Array && t.get("OES_element_index_uint") ? (l = e.UNSIGNED_INT,
  50350. c = 4) : (l = e.UNSIGNED_SHORT,
  50351. c = 2)
  50352. }
  50353. function o(t, n) {
  50354. e.drawElements(s, n, l, t * c),
  50355. i.calls++,
  50356. i.vertices += n,
  50357. s === e.TRIANGLES && (i.faces += n / 3)
  50358. }
  50359. function a(n, r, o) {
  50360. var a = t.get("ANGLE_instanced_arrays");
  50361. 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),
  50362. i.calls++,
  50363. i.vertices += o * n.maxInstancedCount,
  50364. void (s === e.TRIANGLES && (i.faces += n.maxInstancedCount * o / 3)))
  50365. }
  50366. var s, l, c;
  50367. this.setMode = n,
  50368. this.setIndex = r,
  50369. this.render = o,
  50370. this.renderInstances = a
  50371. }
  50372. ,
  50373. n.WebGLExtensions = function(e) {
  50374. var t = {};
  50375. this.get = function(i) {
  50376. if (void 0 !== t[i])
  50377. return t[i];
  50378. var n;
  50379. switch (i) {
  50380. case "EXT_texture_filter_anisotropic":
  50381. n = e.getExtension("EXT_texture_filter_anisotropic") || e.getExtension("MOZ_EXT_texture_filter_anisotropic") || e.getExtension("WEBKIT_EXT_texture_filter_anisotropic");
  50382. break;
  50383. case "WEBGL_compressed_texture_s3tc":
  50384. n = e.getExtension("WEBGL_compressed_texture_s3tc") || e.getExtension("MOZ_WEBGL_compressed_texture_s3tc") || e.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");
  50385. break;
  50386. case "WEBGL_compressed_texture_pvrtc":
  50387. n = e.getExtension("WEBGL_compressed_texture_pvrtc") || e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");
  50388. break;
  50389. case "WEBGL_compressed_texture_etc1":
  50390. n = e.getExtension("WEBGL_compressed_texture_etc1");
  50391. break;
  50392. default:
  50393. n = e.getExtension(i)
  50394. }
  50395. return null === n && console.warn("THREE.WebGLRenderer: " + i + " extension not supported."),
  50396. t[i] = n,
  50397. n
  50398. }
  50399. }
  50400. ,
  50401. n.WebGLCapabilities = function(e, t, i) {
  50402. function n(t) {
  50403. if ("highp" === t) {
  50404. if (e.getShaderPrecisionFormat(e.VERTEX_SHADER, e.HIGH_FLOAT).precision > 0 && e.getShaderPrecisionFormat(e.FRAGMENT_SHADER, e.HIGH_FLOAT).precision > 0)
  50405. return "highp";
  50406. t = "mediump"
  50407. }
  50408. 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"
  50409. }
  50410. this.getMaxPrecision = n,
  50411. this.precision = void 0 !== i.precision ? i.precision : "highp",
  50412. this.logarithmicDepthBuffer = void 0 !== i.logarithmicDepthBuffer && i.logarithmicDepthBuffer,
  50413. this.maxTextures = e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),
  50414. this.maxVertexTextures = e.getParameter(e.MAX_VERTEX_TEXTURE_IMAGE_UNITS),
  50415. this.maxTextureSize = e.getParameter(e.MAX_TEXTURE_SIZE),
  50416. this.maxCubemapSize = e.getParameter(e.MAX_CUBE_MAP_TEXTURE_SIZE),
  50417. this.maxAttributes = e.getParameter(e.MAX_VERTEX_ATTRIBS),
  50418. this.maxVertexUniforms = e.getParameter(e.MAX_VERTEX_UNIFORM_VECTORS),
  50419. this.maxVaryings = e.getParameter(e.MAX_VARYING_VECTORS),
  50420. this.maxFragmentUniforms = e.getParameter(e.MAX_FRAGMENT_UNIFORM_VECTORS),
  50421. this.vertexTextures = this.maxVertexTextures > 0,
  50422. this.floatFragmentTextures = !!t.get("OES_texture_float"),
  50423. this.floatVertexTextures = this.vertexTextures && this.floatFragmentTextures;
  50424. var r = n(this.precision);
  50425. r !== this.precision && (console.warn("THREE.WebGLRenderer:", this.precision, "not supported, using", r, "instead."),
  50426. this.precision = r),
  50427. this.logarithmicDepthBuffer && (this.logarithmicDepthBuffer = !!t.get("EXT_frag_depth"))
  50428. }
  50429. ,
  50430. n.WebGLGeometries = function(e, t, i) {
  50431. function r(e) {
  50432. var t = e.geometry;
  50433. if (void 0 !== h[t.id])
  50434. return h[t.id];
  50435. t.addEventListener("dispose", o);
  50436. var r;
  50437. return t instanceof n.BufferGeometry ? r = t : t instanceof n.Geometry && (void 0 === t._bufferGeometry && (t._bufferGeometry = (new n.BufferGeometry).setFromObject(e)),
  50438. r = t._bufferGeometry),
  50439. h[t.id] = r,
  50440. i.memory.geometries++,
  50441. r
  50442. }
  50443. function o(e) {
  50444. var n = e.target
  50445. , r = h[n.id];
  50446. null !== r.index && s(r.index),
  50447. l(r.attributes),
  50448. n.removeEventListener("dispose", o),
  50449. delete h[n.id];
  50450. var a = t.get(n);
  50451. a.wireframe && s(a.wireframe),
  50452. t.delete(n);
  50453. var c = t.get(r);
  50454. c.wireframe && s(c.wireframe),
  50455. t.delete(r),
  50456. i.memory.geometries--
  50457. }
  50458. function a(e) {
  50459. return e instanceof n.InterleavedBufferAttribute ? t.get(e.data).__webglBuffer : t.get(e).__webglBuffer
  50460. }
  50461. function s(t) {
  50462. var i = a(t);
  50463. void 0 !== i && (e.deleteBuffer(i),
  50464. c(t))
  50465. }
  50466. function l(e) {
  50467. for (var t in e)
  50468. s(e[t])
  50469. }
  50470. function c(e) {
  50471. e instanceof n.InterleavedBufferAttribute ? t.delete(e.data) : t.delete(e)
  50472. }
  50473. var h = {};
  50474. this.get = r
  50475. }
  50476. ,
  50477. n.WebGLLights = function() {
  50478. var e = {};
  50479. this.get = function(t) {
  50480. if (void 0 !== e[t.id])
  50481. return e[t.id];
  50482. var i;
  50483. switch (t.type) {
  50484. case "DirectionalLight":
  50485. i = {
  50486. direction: new n.Vector3,
  50487. color: new n.Color,
  50488. shadow: !1,
  50489. shadowBias: 0,
  50490. shadowRadius: 1,
  50491. shadowMapSize: new n.Vector2
  50492. };
  50493. break;
  50494. case "SpotLight":
  50495. i = {
  50496. position: new n.Vector3,
  50497. direction: new n.Vector3,
  50498. color: new n.Color,
  50499. distance: 0,
  50500. coneCos: 0,
  50501. penumbraCos: 0,
  50502. decay: 0,
  50503. shadow: !1,
  50504. shadowBias: 0,
  50505. shadowRadius: 1,
  50506. shadowMapSize: new n.Vector2
  50507. };
  50508. break;
  50509. case "PointLight":
  50510. i = {
  50511. position: new n.Vector3,
  50512. color: new n.Color,
  50513. distance: 0,
  50514. decay: 0,
  50515. shadow: !1,
  50516. shadowBias: 0,
  50517. shadowRadius: 1,
  50518. shadowMapSize: new n.Vector2
  50519. };
  50520. break;
  50521. case "HemisphereLight":
  50522. i = {
  50523. direction: new n.Vector3,
  50524. skyColor: new n.Color,
  50525. groundColor: new n.Color
  50526. }
  50527. }
  50528. return e[t.id] = i,
  50529. i
  50530. }
  50531. }
  50532. ,
  50533. n.WebGLObjects = function(e, t, i) {
  50534. function r(t) {
  50535. var i = u.get(t);
  50536. t.geometry instanceof n.Geometry && i.updateFromObject(t);
  50537. var r = i.index
  50538. , a = i.attributes;
  50539. null !== r && o(r, e.ELEMENT_ARRAY_BUFFER);
  50540. for (var s in a)
  50541. o(a[s], e.ARRAY_BUFFER);
  50542. var l = i.morphAttributes;
  50543. for (var s in l)
  50544. for (var c = l[s], h = 0, d = c.length; h < d; h++)
  50545. o(c[h], e.ARRAY_BUFFER);
  50546. return i
  50547. }
  50548. function o(e, i) {
  50549. var r = e instanceof n.InterleavedBufferAttribute ? e.data : e
  50550. , o = t.get(r);
  50551. void 0 === o.__webglBuffer ? a(o, r, i) : o.version !== r.version && s(o, r, i)
  50552. }
  50553. function a(t, i, n) {
  50554. t.__webglBuffer = e.createBuffer(),
  50555. e.bindBuffer(n, t.__webglBuffer);
  50556. var r = i.dynamic ? e.DYNAMIC_DRAW : e.STATIC_DRAW;
  50557. e.bufferData(n, i.array, r),
  50558. t.version = i.version
  50559. }
  50560. function s(t, i, n) {
  50561. e.bindBuffer(n, t.__webglBuffer),
  50562. 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)),
  50563. i.updateRange.count = 0),
  50564. t.version = i.version
  50565. }
  50566. function l(e) {
  50567. return e instanceof n.InterleavedBufferAttribute ? t.get(e.data).__webglBuffer : t.get(e).__webglBuffer
  50568. }
  50569. function c(i) {
  50570. var r = t.get(i);
  50571. if (void 0 !== r.wireframe)
  50572. return r.wireframe;
  50573. var a = []
  50574. , s = i.index
  50575. , l = i.attributes
  50576. , c = l.position;
  50577. if (null !== s)
  50578. for (var u = {}, d = s.array, p = 0, f = d.length; p < f; p += 3) {
  50579. var g = d[p + 0]
  50580. , m = d[p + 1]
  50581. , v = d[p + 2];
  50582. h(u, g, m) && a.push(g, m),
  50583. h(u, m, v) && a.push(m, v),
  50584. h(u, v, g) && a.push(v, g)
  50585. }
  50586. else
  50587. for (var d = l.position.array, p = 0, f = d.length / 3 - 1; p < f; p += 3) {
  50588. var g = p + 0
  50589. , m = p + 1
  50590. , v = p + 2;
  50591. a.push(g, m, m, v, v, g)
  50592. }
  50593. var A = c.count > 65535 ? Uint32Array : Uint16Array
  50594. , y = new n.BufferAttribute(new A(a),1);
  50595. return o(y, e.ELEMENT_ARRAY_BUFFER),
  50596. r.wireframe = y,
  50597. y
  50598. }
  50599. function h(e, t, i) {
  50600. if (t > i) {
  50601. var n = t;
  50602. t = i,
  50603. i = n
  50604. }
  50605. var r = e[t];
  50606. return void 0 === r ? (e[t] = [i],
  50607. !0) : r.indexOf(i) === -1 && (r.push(i),
  50608. !0)
  50609. }
  50610. var u = new n.WebGLGeometries(e,t,i);
  50611. this.getAttributeBuffer = l,
  50612. this.getWireframeAttribute = c,
  50613. this.update = r
  50614. }
  50615. ,
  50616. n.WebGLProgram = function() {
  50617. function e(e) {
  50618. switch (e) {
  50619. case n.LinearEncoding:
  50620. return ["Linear", "( value )"];
  50621. case n.sRGBEncoding:
  50622. return ["sRGB", "( value )"];
  50623. case n.RGBEEncoding:
  50624. return ["RGBE", "( value )"];
  50625. case n.RGBM7Encoding:
  50626. return ["RGBM", "( value, 7.0 )"];
  50627. case n.RGBM16Encoding:
  50628. return ["RGBM", "( value, 16.0 )"];
  50629. case n.RGBDEncoding:
  50630. return ["RGBD", "( value, 256.0 )"];
  50631. case n.GammaEncoding:
  50632. return ["Gamma", "( value, float( GAMMA_FACTOR ) )"];
  50633. default:
  50634. throw new Error("unsupported encoding: " + e)
  50635. }
  50636. }
  50637. function t(t, i) {
  50638. var n = e(i);
  50639. return "vec4 " + t + "( vec4 value ) { return " + n[0] + "ToLinear" + n[1] + "; }"
  50640. }
  50641. function i(t, i) {
  50642. var n = e(i);
  50643. return "vec4 " + t + "( vec4 value ) { return LinearTo" + n[0] + n[1] + "; }"
  50644. }
  50645. function r(e, t) {
  50646. var i;
  50647. switch (t) {
  50648. case n.LinearToneMapping:
  50649. i = "Linear";
  50650. break;
  50651. case n.ReinhardToneMapping:
  50652. i = "Reinhard";
  50653. break;
  50654. case n.Uncharted2ToneMapping:
  50655. i = "Uncharted2";
  50656. break;
  50657. case n.CineonToneMapping:
  50658. i = "OptimizedCineon";
  50659. break;
  50660. default:
  50661. throw new Error("unsupported toneMapping: " + t)
  50662. }
  50663. return "vec3 " + e + "( vec3 color ) { return " + i + "ToneMapping( color ); }"
  50664. }
  50665. function o(e, t, i) {
  50666. e = e || {};
  50667. 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" : ""];
  50668. return n.filter(c).join("\n")
  50669. }
  50670. function a(e) {
  50671. var t = [];
  50672. for (var i in e) {
  50673. var n = e[i];
  50674. n !== !1 && t.push("#define " + i + " " + n)
  50675. }
  50676. return t.join("\n")
  50677. }
  50678. function s(e, t, i) {
  50679. for (var n = {}, r = e.getProgramParameter(t, e.ACTIVE_UNIFORMS), o = 0; o < r; o++) {
  50680. var a = e.getActiveUniform(t, o)
  50681. , s = a.name
  50682. , l = e.getUniformLocation(t, s)
  50683. , c = f.exec(s);
  50684. if (c) {
  50685. var h = c[1]
  50686. , u = c[2]
  50687. , d = n[h];
  50688. d || (d = n[h] = {}),
  50689. d[u] = l
  50690. } else if (c = g.exec(s)) {
  50691. var p = c[1]
  50692. , v = c[2]
  50693. , A = c[3]
  50694. , y = n[p];
  50695. y || (y = n[p] = []);
  50696. var C = y[v];
  50697. C || (C = y[v] = {}),
  50698. C[A] = l
  50699. } else if (c = m.exec(s)) {
  50700. var p = c[1];
  50701. n[p] = l
  50702. } else
  50703. n[s] = l
  50704. }
  50705. return n
  50706. }
  50707. function l(e, t, i) {
  50708. for (var n = {}, r = e.getProgramParameter(t, e.ACTIVE_ATTRIBUTES), o = 0; o < r; o++) {
  50709. var a = e.getActiveAttrib(t, o)
  50710. , s = a.name;
  50711. n[s] = e.getAttribLocation(t, s)
  50712. }
  50713. return n
  50714. }
  50715. function c(e) {
  50716. return "" !== e
  50717. }
  50718. function h(e, t) {
  50719. 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)
  50720. }
  50721. function u(e) {
  50722. function t(e, t) {
  50723. var i = n.ShaderChunk[t];
  50724. if (void 0 === i)
  50725. throw new Error("Can not resolve #include <" + t + ">");
  50726. return u(i)
  50727. }
  50728. var i = /#include +<([\w\d.]+)>/g;
  50729. return e.replace(i, t)
  50730. }
  50731. function d(e) {
  50732. function t(e, t, i, n) {
  50733. for (var r = "", o = parseInt(t); o < parseInt(i); o++)
  50734. r += n.replace(/\[ i \]/g, "[ " + o + " ]");
  50735. return r
  50736. }
  50737. var i = /for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g;
  50738. return e.replace(i, t)
  50739. }
  50740. var p = 0
  50741. , f = /^([\w\d_]+)\.([\w\d_]+)$/
  50742. , g = /^([\w\d_]+)\[(\d+)\]\.([\w\d_]+)$/
  50743. , m = /^([\w\d_]+)\[0\]$/;
  50744. return function(e, f, g, m) {
  50745. var v = e.context
  50746. , A = g.extensions
  50747. , y = g.defines
  50748. , C = g.__webglShader.vertexShader
  50749. , I = g.__webglShader.fragmentShader
  50750. , E = "SHADOWMAP_TYPE_BASIC";
  50751. m.shadowMapType === n.PCFShadowMap ? E = "SHADOWMAP_TYPE_PCF" : m.shadowMapType === n.PCFSoftShadowMap && (E = "SHADOWMAP_TYPE_PCF_SOFT");
  50752. var b = "ENVMAP_TYPE_CUBE"
  50753. , w = "ENVMAP_MODE_REFLECTION"
  50754. , _ = "ENVMAP_BLENDING_MULTIPLY";
  50755. if (m.envMap) {
  50756. switch (g.envMap.mapping) {
  50757. case n.CubeReflectionMapping:
  50758. case n.CubeRefractionMapping:
  50759. b = "ENVMAP_TYPE_CUBE";
  50760. break;
  50761. case n.CubeUVReflectionMapping:
  50762. case n.CubeUVRefractionMapping:
  50763. b = "ENVMAP_TYPE_CUBE_UV";
  50764. break;
  50765. case n.EquirectangularReflectionMapping:
  50766. case n.EquirectangularRefractionMapping:
  50767. b = "ENVMAP_TYPE_EQUIREC";
  50768. break;
  50769. case n.SphericalReflectionMapping:
  50770. b = "ENVMAP_TYPE_SPHERE"
  50771. }
  50772. switch (g.envMap.mapping) {
  50773. case n.CubeRefractionMapping:
  50774. case n.EquirectangularRefractionMapping:
  50775. w = "ENVMAP_MODE_REFRACTION"
  50776. }
  50777. switch (g.combine) {
  50778. case n.MultiplyOperation:
  50779. _ = "ENVMAP_BLENDING_MULTIPLY";
  50780. break;
  50781. case n.MixOperation:
  50782. _ = "ENVMAP_BLENDING_MIX";
  50783. break;
  50784. case n.AddOperation:
  50785. _ = "ENVMAP_BLENDING_ADD"
  50786. }
  50787. }
  50788. var T, x, S = e.gammaFactor > 0 ? e.gammaFactor : 1, M = o(A, m, e.extensions), R = a(y), P = v.createProgram();
  50789. g instanceof n.RawShaderMaterial ? (T = "",
  50790. 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"),
  50791. 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")),
  50792. C = u(C, m),
  50793. C = h(C, m),
  50794. I = u(I, m),
  50795. I = h(I, m),
  50796. g instanceof n.ShaderMaterial == !1 && (C = d(C),
  50797. I = d(I));
  50798. var O = T + C
  50799. , L = x + I
  50800. , D = n.WebGLShader(v, v.VERTEX_SHADER, O)
  50801. , N = n.WebGLShader(v, v.FRAGMENT_SHADER, L);
  50802. v.attachShader(P, D),
  50803. v.attachShader(P, N),
  50804. void 0 !== g.index0AttributeName ? v.bindAttribLocation(P, 0, g.index0AttributeName) : m.morphTargets === !0 && v.bindAttribLocation(P, 0, "position"),
  50805. v.linkProgram(P);
  50806. var B = v.getProgramInfoLog(P)
  50807. , F = v.getShaderInfoLog(D)
  50808. , V = v.getShaderInfoLog(N)
  50809. , U = !0
  50810. , k = !0;
  50811. v.getProgramParameter(P, v.LINK_STATUS) === !1 ? (U = !1,
  50812. 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),
  50813. k && (this.diagnostics = {
  50814. runnable: U,
  50815. material: g,
  50816. programLog: B,
  50817. vertexShader: {
  50818. log: F,
  50819. prefix: T
  50820. },
  50821. fragmentShader: {
  50822. log: V,
  50823. prefix: x
  50824. }
  50825. }),
  50826. v.deleteShader(D),
  50827. v.deleteShader(N);
  50828. var H;
  50829. this.getUniforms = function() {
  50830. return void 0 === H && (H = s(v, P)),
  50831. H
  50832. }
  50833. ;
  50834. var G;
  50835. return this.getAttributes = function() {
  50836. return void 0 === G && (G = l(v, P)),
  50837. G
  50838. }
  50839. ,
  50840. this.destroy = function() {
  50841. v.deleteProgram(P),
  50842. this.program = void 0
  50843. }
  50844. ,
  50845. Object.defineProperties(this, {
  50846. uniforms: {
  50847. get: function() {
  50848. return console.warn("THREE.WebGLProgram: .uniforms is now .getUniforms()."),
  50849. this.getUniforms()
  50850. }
  50851. },
  50852. attributes: {
  50853. get: function() {
  50854. return console.warn("THREE.WebGLProgram: .attributes is now .getAttributes()."),
  50855. this.getAttributes()
  50856. }
  50857. }
  50858. }),
  50859. this.id = p++,
  50860. this.code = f,
  50861. this.usedTimes = 1,
  50862. this.program = P,
  50863. this.vertexShader = D,
  50864. this.fragmentShader = N,
  50865. this
  50866. }
  50867. }(),
  50868. n.WebGLPrograms = function(e, t) {
  50869. function i(e) {
  50870. if (t.floatVertexTextures && e && e.skeleton && e.skeleton.useVertexTexture)
  50871. return 1024;
  50872. var i = t.maxVertexUniforms
  50873. , r = Math.floor((i - 20) / 4)
  50874. , o = r;
  50875. return void 0 !== e && e instanceof n.SkinnedMesh && (o = Math.min(e.skeleton.bones.length, o),
  50876. 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)")),
  50877. o
  50878. }
  50879. function r(e, t) {
  50880. var i;
  50881. return e ? e instanceof n.Texture ? i = e.encoding : e instanceof n.WebGLRenderTarget && (i = e.texture.encoding) : i = n.LinearEncoding,
  50882. i === n.LinearEncoding && t && (i = n.GammaEncoding),
  50883. i
  50884. }
  50885. var o = []
  50886. , a = {
  50887. MeshDepthMaterial: "depth",
  50888. MeshNormalMaterial: "normal",
  50889. MeshBasicMaterial: "basic",
  50890. MeshLambertMaterial: "lambert",
  50891. MeshPhongMaterial: "phong",
  50892. MeshStandardMaterial: "standard",
  50893. LineBasicMaterial: "basic",
  50894. LineDashedMaterial: "dashed",
  50895. PointsMaterial: "points"
  50896. }
  50897. , 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"];
  50898. this.getParameters = function(o, s, l, c) {
  50899. var h = a[o.type]
  50900. , u = i(c)
  50901. , d = e.getPrecision();
  50902. null !== o.precision && (d = t.getMaxPrecision(o.precision),
  50903. d !== o.precision && console.warn("THREE.WebGLProgram.getParameters:", o.precision, "not supported, using", d, "instead."));
  50904. var p = {
  50905. shaderID: h,
  50906. precision: d,
  50907. supportsVertexTextures: t.vertexTextures,
  50908. outputEncoding: r(e.getCurrentRenderTarget(), e.gammaOutput),
  50909. map: !!o.map,
  50910. mapEncoding: r(o.map, e.gammaInput),
  50911. envMap: !!o.envMap,
  50912. envMapMode: o.envMap && o.envMap.mapping,
  50913. envMapEncoding: r(o.envMap, e.gammaInput),
  50914. envMapCubeUV: !!o.envMap && (o.envMap.mapping === n.CubeUVReflectionMapping || o.envMap.mapping === n.CubeUVRefractionMapping),
  50915. lightMap: !!o.lightMap,
  50916. aoMap: !!o.aoMap,
  50917. emissiveMap: !!o.emissiveMap,
  50918. emissiveMapEncoding: r(o.emissiveMap, e.gammaInput),
  50919. bumpMap: !!o.bumpMap,
  50920. normalMap: !!o.normalMap,
  50921. displacementMap: !!o.displacementMap,
  50922. roughnessMap: !!o.roughnessMap,
  50923. metalnessMap: !!o.metalnessMap,
  50924. specularMap: !!o.specularMap,
  50925. alphaMap: !!o.alphaMap,
  50926. combine: o.combine,
  50927. vertexColors: o.vertexColors,
  50928. fog: l,
  50929. useFog: o.fog,
  50930. fogExp: l instanceof n.FogExp2,
  50931. flatShading: o.shading === n.FlatShading,
  50932. sizeAttenuation: o.sizeAttenuation,
  50933. logarithmicDepthBuffer: t.logarithmicDepthBuffer,
  50934. skinning: o.skinning,
  50935. maxBones: u,
  50936. useVertexTexture: t.floatVertexTextures && c && c.skeleton && c.skeleton.useVertexTexture,
  50937. morphTargets: o.morphTargets,
  50938. morphNormals: o.morphNormals,
  50939. maxMorphTargets: e.maxMorphTargets,
  50940. maxMorphNormals: e.maxMorphNormals,
  50941. numDirLights: s.directional.length,
  50942. numPointLights: s.point.length,
  50943. numSpotLights: s.spot.length,
  50944. numHemiLights: s.hemi.length,
  50945. pointLightShadows: s.shadowsPointLight,
  50946. shadowMapEnabled: e.shadowMap.enabled && c.receiveShadow && s.shadows.length > 0,
  50947. shadowMapType: e.shadowMap.type,
  50948. toneMapping: e.toneMapping,
  50949. physicallyCorrectLights: e.physicallyCorrectLights,
  50950. premultipliedAlpha: o.premultipliedAlpha,
  50951. alphaTest: o.alphaTest,
  50952. doubleSided: o.side === n.DoubleSide,
  50953. flipSided: o.side === n.BackSide
  50954. };
  50955. return p
  50956. }
  50957. ,
  50958. this.getProgramCode = function(e, t) {
  50959. var i = [];
  50960. if (t.shaderID ? i.push(t.shaderID) : (i.push(e.fragmentShader),
  50961. i.push(e.vertexShader)),
  50962. void 0 !== e.defines)
  50963. for (var n in e.defines)
  50964. i.push(n),
  50965. i.push(e.defines[n]);
  50966. for (var r = 0; r < s.length; r++) {
  50967. var o = s[r];
  50968. i.push(o),
  50969. i.push(t[o])
  50970. }
  50971. return i.join()
  50972. }
  50973. ,
  50974. this.acquireProgram = function(t, i, r) {
  50975. for (var a, s = 0, l = o.length; s < l; s++) {
  50976. var c = o[s];
  50977. if (c.code === r) {
  50978. a = c,
  50979. ++a.usedTimes;
  50980. break
  50981. }
  50982. }
  50983. return void 0 === a && (a = new n.WebGLProgram(e,r,t,i),
  50984. o.push(a)),
  50985. a
  50986. }
  50987. ,
  50988. this.releaseProgram = function(e) {
  50989. if (0 === --e.usedTimes) {
  50990. var t = o.indexOf(e);
  50991. o[t] = o[o.length - 1],
  50992. o.pop(),
  50993. e.destroy()
  50994. }
  50995. }
  50996. ,
  50997. this.programs = o
  50998. }
  50999. ,
  51000. n.WebGLProperties = function() {
  51001. var e = {};
  51002. this.get = function(t) {
  51003. var i = t.uuid
  51004. , n = e[i];
  51005. return void 0 === n && (n = {},
  51006. e[i] = n),
  51007. n
  51008. }
  51009. ,
  51010. this.delete = function(t) {
  51011. delete e[t.uuid]
  51012. }
  51013. ,
  51014. this.clear = function() {
  51015. e = {}
  51016. }
  51017. }
  51018. ,
  51019. n.WebGLShader = function() {
  51020. function e(e) {
  51021. for (var t = e.split("\n"), i = 0; i < t.length; i++)
  51022. t[i] = i + 1 + ": " + t[i];
  51023. return t.join("\n")
  51024. }
  51025. return function(t, i, n) {
  51026. var r = t.createShader(i);
  51027. return t.shaderSource(r, n),
  51028. t.compileShader(r),
  51029. t.getShaderParameter(r, t.COMPILE_STATUS) === !1 && console.error("THREE.WebGLShader: Shader couldn't compile."),
  51030. "" !== t.getShaderInfoLog(r) && console.warn("THREE.WebGLShader: gl.getShaderInfoLog()", i === t.VERTEX_SHADER ? "vertex" : "fragment", t.getShaderInfoLog(r), e(n)),
  51031. r
  51032. }
  51033. }(),
  51034. n.WebGLShadowMap = function(e, t, i) {
  51035. function r(e, t, i, r) {
  51036. var o = e.geometry
  51037. , a = null
  51038. , s = v
  51039. , l = e.customDepthMaterial;
  51040. if (i && (s = A,
  51041. l = e.customDistanceMaterial),
  51042. l)
  51043. a = l;
  51044. else {
  51045. var c = void 0 !== o.morphTargets && o.morphTargets.length > 0 && t.morphTargets
  51046. , h = e instanceof n.SkinnedMesh && t.skinning
  51047. , u = 0;
  51048. c && (u |= f),
  51049. h && (u |= g),
  51050. a = s[u]
  51051. }
  51052. return a.visible = t.visible,
  51053. a.wireframe = t.wireframe,
  51054. a.wireframeLinewidth = t.wireframeLinewidth,
  51055. i && void 0 !== a.uniforms.lightPos && a.uniforms.lightPos.value.copy(r),
  51056. a
  51057. }
  51058. function o(e, t, i) {
  51059. if (e.visible !== !1) {
  51060. 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)) {
  51061. var r = e.material;
  51062. r.visible === !0 && (e.modelViewMatrix.multiplyMatrices(i.matrixWorldInverse, e.matrixWorld),
  51063. p.push(e))
  51064. }
  51065. for (var a = e.children, s = 0, c = a.length; s < c; s++)
  51066. o(a[s], t, i)
  51067. }
  51068. }
  51069. 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) {
  51070. var x = 0 !== (T & f)
  51071. , S = 0 !== (T & g)
  51072. , M = new n.ShaderMaterial({
  51073. uniforms: b,
  51074. vertexShader: E.vertexShader,
  51075. fragmentShader: E.fragmentShader,
  51076. morphTargets: x,
  51077. skinning: S
  51078. });
  51079. v[T] = M;
  51080. var R = new n.ShaderMaterial({
  51081. defines: {
  51082. USE_SHADOWMAP: ""
  51083. },
  51084. uniforms: _,
  51085. vertexShader: w.vertexShader,
  51086. fragmentShader: w.fragmentShader,
  51087. morphTargets: x,
  51088. skinning: S
  51089. });
  51090. A[T] = R
  51091. }
  51092. var P = this;
  51093. this.enabled = !1,
  51094. this.autoUpdate = !0,
  51095. this.needsUpdate = !1,
  51096. this.type = n.PCFShadowMap,
  51097. this.cullFace = n.CullFaceFront,
  51098. this.render = function(f, g) {
  51099. var m, v, A = t.shadows;
  51100. if (0 !== A.length && P.enabled !== !1 && (P.autoUpdate !== !1 || P.needsUpdate !== !1)) {
  51101. s.clearColor(1, 1, 1, 1),
  51102. s.disable(a.BLEND),
  51103. s.enable(a.CULL_FACE),
  51104. a.frontFace(a.CCW),
  51105. a.cullFace(P.cullFace === n.CullFaceFront ? a.FRONT : a.BACK),
  51106. s.setDepthTest(!0),
  51107. s.setScissorTest(!1);
  51108. for (var E = 0, b = A.length; E < b; E++) {
  51109. var w = A[E]
  51110. , _ = w.shadow
  51111. , T = _.camera;
  51112. if (h.copy(_.mapSize),
  51113. w instanceof n.PointLight) {
  51114. m = 6,
  51115. v = !0;
  51116. var x = h.x
  51117. , S = h.y;
  51118. I[0].set(2 * x, S, x, S),
  51119. I[1].set(0, S, x, S),
  51120. I[2].set(3 * x, S, x, S),
  51121. I[3].set(x, S, x, S),
  51122. I[4].set(3 * x, 0, x, S),
  51123. I[5].set(x, 0, x, S),
  51124. h.x *= 4,
  51125. h.y *= 2
  51126. } else
  51127. m = 1,
  51128. v = !1;
  51129. if (null === _.map) {
  51130. var M = {
  51131. minFilter: n.NearestFilter,
  51132. magFilter: n.NearestFilter,
  51133. format: n.RGBAFormat
  51134. };
  51135. _.map = new n.WebGLRenderTarget(h.x,h.y,M),
  51136. w instanceof n.SpotLight && (T.aspect = h.x / h.y),
  51137. T.updateProjectionMatrix()
  51138. }
  51139. var R = _.map
  51140. , O = _.matrix;
  51141. d.setFromMatrixPosition(w.matrixWorld),
  51142. T.position.copy(d),
  51143. e.setRenderTarget(R),
  51144. e.clear();
  51145. for (var L = 0; L < m; L++) {
  51146. if (v) {
  51147. u.copy(T.position),
  51148. u.add(y[L]),
  51149. T.up.copy(C[L]),
  51150. T.lookAt(u);
  51151. var D = I[L];
  51152. s.viewport(D)
  51153. } else
  51154. u.setFromMatrixPosition(w.target.matrixWorld),
  51155. T.lookAt(u);
  51156. T.updateMatrixWorld(),
  51157. T.matrixWorldInverse.getInverse(T.matrixWorld),
  51158. O.set(.5, 0, 0, .5, 0, .5, 0, .5, 0, 0, .5, .5, 0, 0, 0, 1),
  51159. O.multiply(T.projectionMatrix),
  51160. O.multiply(T.matrixWorldInverse),
  51161. c.multiplyMatrices(T.projectionMatrix, T.matrixWorldInverse),
  51162. l.setFromMatrix(c),
  51163. p.length = 0,
  51164. o(f, g, T);
  51165. for (var N = 0, B = p.length; N < B; N++) {
  51166. var F = p[N]
  51167. , V = i.update(F)
  51168. , U = F.material;
  51169. if (U instanceof n.MultiMaterial)
  51170. for (var k = V.groups, H = U.materials, G = 0, z = k.length; G < z; G++) {
  51171. var W = k[G]
  51172. , j = H[W.materialIndex];
  51173. if (j.visible === !0) {
  51174. var Y = r(F, j, v, d);
  51175. e.renderBufferDirect(T, null, V, Y, F, W)
  51176. }
  51177. }
  51178. else {
  51179. var Y = r(F, U, v, d);
  51180. e.renderBufferDirect(T, null, V, Y, F, null)
  51181. }
  51182. }
  51183. }
  51184. }
  51185. var X = e.getClearColor()
  51186. , Z = e.getClearAlpha();
  51187. e.setClearColor(X, Z),
  51188. s.enable(a.BLEND),
  51189. P.cullFace === n.CullFaceFront && a.cullFace(a.BACK),
  51190. P.needsUpdate = !1
  51191. }
  51192. }
  51193. }
  51194. ,
  51195. n.WebGLState = function(e, t, i) {
  51196. var r = this
  51197. , o = new n.Vector4
  51198. , a = new Uint8Array(16)
  51199. , s = new Uint8Array(16)
  51200. , l = new Uint8Array(16)
  51201. , c = {}
  51202. , h = null
  51203. , u = null
  51204. , d = null
  51205. , p = null
  51206. , f = null
  51207. , g = null
  51208. , m = null
  51209. , v = null
  51210. , A = !1
  51211. , y = null
  51212. , C = null
  51213. , I = null
  51214. , E = null
  51215. , b = null
  51216. , w = null
  51217. , _ = null
  51218. , T = null
  51219. , x = null
  51220. , S = null
  51221. , M = null
  51222. , R = null
  51223. , P = null
  51224. , O = null
  51225. , L = null
  51226. , D = e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS)
  51227. , N = void 0
  51228. , B = {}
  51229. , F = new n.Vector4
  51230. , V = null
  51231. , U = null
  51232. , k = new n.Vector4
  51233. , H = new n.Vector4
  51234. , G = e.createTexture();
  51235. e.bindTexture(e.TEXTURE_2D, G),
  51236. e.texParameteri(e.TEXTURE_2D, e.TEXTURE_MIN_FILTER, e.LINEAR),
  51237. e.texImage2D(e.TEXTURE_2D, 0, e.RGB, 1, 1, 0, e.RGB, e.UNSIGNED_BYTE, new Uint8Array(3)),
  51238. this.init = function() {
  51239. this.clearColor(0, 0, 0, 1),
  51240. this.clearDepth(1),
  51241. this.clearStencil(0),
  51242. this.enable(e.DEPTH_TEST),
  51243. e.depthFunc(e.LEQUAL),
  51244. e.frontFace(e.CCW),
  51245. e.cullFace(e.BACK),
  51246. this.enable(e.CULL_FACE),
  51247. this.enable(e.BLEND),
  51248. e.blendEquation(e.FUNC_ADD),
  51249. e.blendFunc(e.SRC_ALPHA, e.ONE_MINUS_SRC_ALPHA)
  51250. }
  51251. ,
  51252. this.initAttributes = function() {
  51253. for (var e = 0, t = a.length; e < t; e++)
  51254. a[e] = 0
  51255. }
  51256. ,
  51257. this.enableAttribute = function(i) {
  51258. if (a[i] = 1,
  51259. 0 === s[i] && (e.enableVertexAttribArray(i),
  51260. s[i] = 1),
  51261. 0 !== l[i]) {
  51262. var n = t.get("ANGLE_instanced_arrays");
  51263. n.vertexAttribDivisorANGLE(i, 0),
  51264. l[i] = 0
  51265. }
  51266. }
  51267. ,
  51268. this.enableAttributeAndDivisor = function(t, i, n) {
  51269. a[t] = 1,
  51270. 0 === s[t] && (e.enableVertexAttribArray(t),
  51271. s[t] = 1),
  51272. l[t] !== i && (n.vertexAttribDivisorANGLE(t, i),
  51273. l[t] = i)
  51274. }
  51275. ,
  51276. this.disableUnusedAttributes = function() {
  51277. for (var t = 0, i = s.length; t < i; t++)
  51278. s[t] !== a[t] && (e.disableVertexAttribArray(t),
  51279. s[t] = 0)
  51280. }
  51281. ,
  51282. this.enable = function(t) {
  51283. c[t] !== !0 && (e.enable(t),
  51284. c[t] = !0)
  51285. }
  51286. ,
  51287. this.disable = function(t) {
  51288. c[t] !== !1 && (e.disable(t),
  51289. c[t] = !1)
  51290. }
  51291. ,
  51292. this.getCompressedTextureFormats = function() {
  51293. if (null === h && (h = [],
  51294. t.get("WEBGL_compressed_texture_pvrtc") || t.get("WEBGL_compressed_texture_s3tc") || t.get("WEBGL_compressed_texture_etc1")))
  51295. for (var i = e.getParameter(e.COMPRESSED_TEXTURE_FORMATS), n = 0; n < i.length; n++)
  51296. h.push(i[n]);
  51297. return h
  51298. }
  51299. ,
  51300. this.setBlending = function(t, r, o, a, s, l, c, h) {
  51301. t === n.NoBlending ? this.disable(e.BLEND) : this.enable(e.BLEND),
  51302. t === u && h === A || (t === n.AdditiveBlending ? h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  51303. e.blendFuncSeparate(e.ONE, e.ONE, e.ONE, e.ONE)) : (e.blendEquation(e.FUNC_ADD),
  51304. e.blendFunc(e.SRC_ALPHA, e.ONE)) : t === n.SubtractiveBlending ? h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  51305. e.blendFuncSeparate(e.ZERO, e.ZERO, e.ONE_MINUS_SRC_COLOR, e.ONE_MINUS_SRC_ALPHA)) : (e.blendEquation(e.FUNC_ADD),
  51306. e.blendFunc(e.ZERO, e.ONE_MINUS_SRC_COLOR)) : t === n.MultiplyBlending ? h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  51307. e.blendFuncSeparate(e.ZERO, e.ZERO, e.SRC_COLOR, e.SRC_ALPHA)) : (e.blendEquation(e.FUNC_ADD),
  51308. e.blendFunc(e.ZERO, e.SRC_COLOR)) : h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  51309. e.blendFuncSeparate(e.ONE, e.ONE_MINUS_SRC_ALPHA, e.ONE, e.ONE_MINUS_SRC_ALPHA)) : (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  51310. e.blendFuncSeparate(e.SRC_ALPHA, e.ONE_MINUS_SRC_ALPHA, e.ONE, e.ONE_MINUS_SRC_ALPHA)),
  51311. u = t,
  51312. A = h),
  51313. t === n.CustomBlending ? (s = s || r,
  51314. l = l || o,
  51315. c = c || a,
  51316. r === d && s === g || (e.blendEquationSeparate(i(r), i(s)),
  51317. d = r,
  51318. g = s),
  51319. o === p && a === f && l === m && c === v || (e.blendFuncSeparate(i(o), i(a), i(l), i(c)),
  51320. p = o,
  51321. f = a,
  51322. m = l,
  51323. v = c)) : (d = null,
  51324. p = null,
  51325. f = null,
  51326. g = null,
  51327. m = null,
  51328. v = null)
  51329. }
  51330. ,
  51331. this.setDepthFunc = function(t) {
  51332. if (y !== t) {
  51333. if (t)
  51334. switch (t) {
  51335. case n.NeverDepth:
  51336. e.depthFunc(e.NEVER);
  51337. break;
  51338. case n.AlwaysDepth:
  51339. e.depthFunc(e.ALWAYS);
  51340. break;
  51341. case n.LessDepth:
  51342. e.depthFunc(e.LESS);
  51343. break;
  51344. case n.LessEqualDepth:
  51345. e.depthFunc(e.LEQUAL);
  51346. break;
  51347. case n.EqualDepth:
  51348. e.depthFunc(e.EQUAL);
  51349. break;
  51350. case n.GreaterEqualDepth:
  51351. e.depthFunc(e.GEQUAL);
  51352. break;
  51353. case n.GreaterDepth:
  51354. e.depthFunc(e.GREATER);
  51355. break;
  51356. case n.NotEqualDepth:
  51357. e.depthFunc(e.NOTEQUAL);
  51358. break;
  51359. default:
  51360. e.depthFunc(e.LEQUAL)
  51361. }
  51362. else
  51363. e.depthFunc(e.LEQUAL);
  51364. y = t
  51365. }
  51366. }
  51367. ,
  51368. this.setDepthTest = function(t) {
  51369. t ? this.enable(e.DEPTH_TEST) : this.disable(e.DEPTH_TEST)
  51370. }
  51371. ,
  51372. this.setDepthWrite = function(t) {
  51373. C !== t && (e.depthMask(t),
  51374. C = t)
  51375. }
  51376. ,
  51377. this.setColorWrite = function(t) {
  51378. I !== t && (e.colorMask(t, t, t, t),
  51379. I = t)
  51380. }
  51381. ,
  51382. this.setStencilFunc = function(t, i, n) {
  51383. b === t && w === i && _ === n || (e.stencilFunc(t, i, n),
  51384. b = t,
  51385. w = i,
  51386. _ = n)
  51387. }
  51388. ,
  51389. this.setStencilOp = function(t, i, n) {
  51390. T === t && x === i && S === n || (e.stencilOp(t, i, n),
  51391. T = t,
  51392. x = i,
  51393. S = n)
  51394. }
  51395. ,
  51396. this.setStencilTest = function(t) {
  51397. t ? this.enable(e.STENCIL_TEST) : this.disable(e.STENCIL_TEST)
  51398. }
  51399. ,
  51400. this.setStencilWrite = function(t) {
  51401. E !== t && (e.stencilMask(t),
  51402. E = t)
  51403. }
  51404. ,
  51405. this.setFlipSided = function(t) {
  51406. M !== t && (t ? e.frontFace(e.CW) : e.frontFace(e.CCW),
  51407. M = t)
  51408. }
  51409. ,
  51410. this.setLineWidth = function(t) {
  51411. t !== R && (e.lineWidth(t),
  51412. R = t)
  51413. }
  51414. ,
  51415. this.setPolygonOffset = function(t, i, n) {
  51416. t ? this.enable(e.POLYGON_OFFSET_FILL) : this.disable(e.POLYGON_OFFSET_FILL),
  51417. !t || P === i && O === n || (e.polygonOffset(i, n),
  51418. P = i,
  51419. O = n)
  51420. }
  51421. ,
  51422. this.getScissorTest = function() {
  51423. return L
  51424. }
  51425. ,
  51426. this.setScissorTest = function(t) {
  51427. L = t,
  51428. t ? this.enable(e.SCISSOR_TEST) : this.disable(e.SCISSOR_TEST)
  51429. }
  51430. ,
  51431. this.activeTexture = function(t) {
  51432. void 0 === t && (t = e.TEXTURE0 + D - 1),
  51433. N !== t && (e.activeTexture(t),
  51434. N = t)
  51435. }
  51436. ,
  51437. this.bindTexture = function(t, i) {
  51438. void 0 === N && r.activeTexture();
  51439. var n = B[N];
  51440. void 0 === n && (n = {
  51441. type: void 0,
  51442. texture: void 0
  51443. },
  51444. B[N] = n),
  51445. n.type === t && n.texture === i || (e.bindTexture(t, i || G),
  51446. n.type = t,
  51447. n.texture = i)
  51448. }
  51449. ,
  51450. this.compressedTexImage2D = function() {
  51451. try {
  51452. e.compressedTexImage2D.apply(e, arguments)
  51453. } catch (e) {
  51454. console.error(e)
  51455. }
  51456. }
  51457. ,
  51458. this.texImage2D = function() {
  51459. try {
  51460. e.texImage2D.apply(e, arguments)
  51461. } catch (e) {
  51462. console.error(e)
  51463. }
  51464. }
  51465. ,
  51466. this.clearColor = function(t, i, n, r) {
  51467. o.set(t, i, n, r),
  51468. F.equals(o) === !1 && (e.clearColor(t, i, n, r),
  51469. F.copy(o))
  51470. }
  51471. ,
  51472. this.clearDepth = function(t) {
  51473. V !== t && (e.clearDepth(t),
  51474. V = t)
  51475. }
  51476. ,
  51477. this.clearStencil = function(t) {
  51478. U !== t && (e.clearStencil(t),
  51479. U = t)
  51480. }
  51481. ,
  51482. this.scissor = function(t) {
  51483. k.equals(t) === !1 && (e.scissor(t.x, t.y, t.z, t.w),
  51484. k.copy(t))
  51485. }
  51486. ,
  51487. this.viewport = function(t) {
  51488. H.equals(t) === !1 && (e.viewport(t.x, t.y, t.z, t.w),
  51489. H.copy(t))
  51490. }
  51491. ,
  51492. this.reset = function() {
  51493. for (var t = 0; t < s.length; t++)
  51494. 1 === s[t] && (e.disableVertexAttribArray(t),
  51495. s[t] = 0);
  51496. c = {},
  51497. h = null,
  51498. N = void 0,
  51499. B = {},
  51500. u = null,
  51501. I = null,
  51502. C = null,
  51503. E = null,
  51504. M = null
  51505. }
  51506. }
  51507. ,
  51508. n.LensFlarePlugin = function(e, t) {
  51509. function i() {
  51510. var e = new Float32Array([-1, -1, 0, 0, 1, -1, 1, 0, 1, 1, 1, 1, -1, 1, 0, 1])
  51511. , t = new Uint16Array([0, 1, 2, 0, 2, 3]);
  51512. o = p.createBuffer(),
  51513. a = p.createBuffer(),
  51514. p.bindBuffer(p.ARRAY_BUFFER, o),
  51515. p.bufferData(p.ARRAY_BUFFER, e, p.STATIC_DRAW),
  51516. p.bindBuffer(p.ELEMENT_ARRAY_BUFFER, a),
  51517. p.bufferData(p.ELEMENT_ARRAY_BUFFER, t, p.STATIC_DRAW),
  51518. u = p.createTexture(),
  51519. d = p.createTexture(),
  51520. f.bindTexture(p.TEXTURE_2D, u),
  51521. p.texImage2D(p.TEXTURE_2D, 0, p.RGB, 16, 16, 0, p.RGB, p.UNSIGNED_BYTE, null),
  51522. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_WRAP_S, p.CLAMP_TO_EDGE),
  51523. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_WRAP_T, p.CLAMP_TO_EDGE),
  51524. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_MAG_FILTER, p.NEAREST),
  51525. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_MIN_FILTER, p.NEAREST),
  51526. f.bindTexture(p.TEXTURE_2D, d),
  51527. p.texImage2D(p.TEXTURE_2D, 0, p.RGBA, 16, 16, 0, p.RGBA, p.UNSIGNED_BYTE, null),
  51528. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_WRAP_S, p.CLAMP_TO_EDGE),
  51529. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_WRAP_T, p.CLAMP_TO_EDGE),
  51530. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_MAG_FILTER, p.NEAREST),
  51531. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_MIN_FILTER, p.NEAREST),
  51532. h = p.getParameter(p.MAX_VERTEX_TEXTURE_IMAGE_UNITS) > 0;
  51533. var i;
  51534. i = h ? {
  51535. 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"),
  51536. 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")
  51537. } : {
  51538. 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"),
  51539. 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")
  51540. },
  51541. s = r(i),
  51542. l = {
  51543. vertex: p.getAttribLocation(s, "position"),
  51544. uv: p.getAttribLocation(s, "uv")
  51545. },
  51546. c = {
  51547. renderType: p.getUniformLocation(s, "renderType"),
  51548. map: p.getUniformLocation(s, "map"),
  51549. occlusionMap: p.getUniformLocation(s, "occlusionMap"),
  51550. opacity: p.getUniformLocation(s, "opacity"),
  51551. color: p.getUniformLocation(s, "color"),
  51552. scale: p.getUniformLocation(s, "scale"),
  51553. rotation: p.getUniformLocation(s, "rotation"),
  51554. screenPosition: p.getUniformLocation(s, "screenPosition")
  51555. }
  51556. }
  51557. function r(t) {
  51558. var i = p.createProgram()
  51559. , n = p.createShader(p.FRAGMENT_SHADER)
  51560. , r = p.createShader(p.VERTEX_SHADER)
  51561. , o = "precision " + e.getPrecision() + " float;\n";
  51562. return p.shaderSource(n, o + t.fragmentShader),
  51563. p.shaderSource(r, o + t.vertexShader),
  51564. p.compileShader(n),
  51565. p.compileShader(r),
  51566. p.attachShader(i, n),
  51567. p.attachShader(i, r),
  51568. p.linkProgram(i),
  51569. i
  51570. }
  51571. var o, a, s, l, c, h, u, d, p = e.context, f = e.state;
  51572. this.render = function(r, g, m) {
  51573. if (0 !== t.length) {
  51574. var v = new n.Vector3
  51575. , A = m.w / m.z
  51576. , y = .5 * m.z
  51577. , C = .5 * m.w
  51578. , I = 16 / m.w
  51579. , E = new n.Vector2(I * A,I)
  51580. , b = new n.Vector3(1,1,0)
  51581. , w = new n.Vector2(1,1);
  51582. void 0 === s && i(),
  51583. p.useProgram(s),
  51584. f.initAttributes(),
  51585. f.enableAttribute(l.vertex),
  51586. f.enableAttribute(l.uv),
  51587. f.disableUnusedAttributes(),
  51588. p.uniform1i(c.occlusionMap, 0),
  51589. p.uniform1i(c.map, 1),
  51590. p.bindBuffer(p.ARRAY_BUFFER, o),
  51591. p.vertexAttribPointer(l.vertex, 2, p.FLOAT, !1, 16, 0),
  51592. p.vertexAttribPointer(l.uv, 2, p.FLOAT, !1, 16, 8),
  51593. p.bindBuffer(p.ELEMENT_ARRAY_BUFFER, a),
  51594. f.disable(p.CULL_FACE),
  51595. f.setDepthWrite(!1);
  51596. for (var _ = 0, T = t.length; _ < T; _++) {
  51597. I = 16 / m.w,
  51598. E.set(I * A, I);
  51599. var x = t[_];
  51600. if (v.set(x.matrixWorld.elements[12], x.matrixWorld.elements[13], x.matrixWorld.elements[14]),
  51601. v.applyMatrix4(g.matrixWorldInverse),
  51602. v.applyProjection(g.projectionMatrix),
  51603. b.copy(v),
  51604. w.x = b.x * y + y,
  51605. w.y = b.y * C + C,
  51606. h || w.x > 0 && w.x < m.z && w.y > 0 && w.y < m.w) {
  51607. f.activeTexture(p.TEXTURE0),
  51608. f.bindTexture(p.TEXTURE_2D, null),
  51609. f.activeTexture(p.TEXTURE1),
  51610. f.bindTexture(p.TEXTURE_2D, u),
  51611. p.copyTexImage2D(p.TEXTURE_2D, 0, p.RGB, m.x + w.x - 8, m.y + w.y - 8, 16, 16, 0),
  51612. p.uniform1i(c.renderType, 0),
  51613. p.uniform2f(c.scale, E.x, E.y),
  51614. p.uniform3f(c.screenPosition, b.x, b.y, b.z),
  51615. f.disable(p.BLEND),
  51616. f.enable(p.DEPTH_TEST),
  51617. p.drawElements(p.TRIANGLES, 6, p.UNSIGNED_SHORT, 0),
  51618. f.activeTexture(p.TEXTURE0),
  51619. f.bindTexture(p.TEXTURE_2D, d),
  51620. p.copyTexImage2D(p.TEXTURE_2D, 0, p.RGBA, m.x + w.x - 8, m.y + w.y - 8, 16, 16, 0),
  51621. p.uniform1i(c.renderType, 1),
  51622. f.disable(p.DEPTH_TEST),
  51623. f.activeTexture(p.TEXTURE1),
  51624. f.bindTexture(p.TEXTURE_2D, u),
  51625. p.drawElements(p.TRIANGLES, 6, p.UNSIGNED_SHORT, 0),
  51626. x.positionScreen.copy(b),
  51627. x.customUpdateCallback ? x.customUpdateCallback(x) : x.updateLensFlares(),
  51628. p.uniform1i(c.renderType, 2),
  51629. f.enable(p.BLEND);
  51630. for (var S = 0, M = x.lensFlares.length; S < M; S++) {
  51631. var R = x.lensFlares[S];
  51632. R.opacity > .001 && R.scale > .001 && (b.x = R.x,
  51633. b.y = R.y,
  51634. b.z = R.z,
  51635. I = R.size * R.scale / m.w,
  51636. E.x = I * A,
  51637. E.y = I,
  51638. p.uniform3f(c.screenPosition, b.x, b.y, b.z),
  51639. p.uniform2f(c.scale, E.x, E.y),
  51640. p.uniform1f(c.rotation, R.rotation),
  51641. p.uniform1f(c.opacity, R.opacity),
  51642. p.uniform3f(c.color, R.color.r, R.color.g, R.color.b),
  51643. f.setBlending(R.blending, R.blendEquation, R.blendSrc, R.blendDst),
  51644. e.setTexture(R.texture, 1),
  51645. p.drawElements(p.TRIANGLES, 6, p.UNSIGNED_SHORT, 0))
  51646. }
  51647. }
  51648. }
  51649. f.enable(p.CULL_FACE),
  51650. f.enable(p.DEPTH_TEST),
  51651. f.setDepthWrite(!0),
  51652. e.resetGLState()
  51653. }
  51654. }
  51655. }
  51656. ,
  51657. n.SpritePlugin = function(e, t) {
  51658. function i() {
  51659. var e = new Float32Array([-.5, -.5, 0, 0, .5, -.5, 1, 0, .5, .5, 1, 1, -.5, .5, 0, 1])
  51660. , t = new Uint16Array([0, 1, 2, 0, 2, 3]);
  51661. a = d.createBuffer(),
  51662. s = d.createBuffer(),
  51663. d.bindBuffer(d.ARRAY_BUFFER, a),
  51664. d.bufferData(d.ARRAY_BUFFER, e, d.STATIC_DRAW),
  51665. d.bindBuffer(d.ELEMENT_ARRAY_BUFFER, s),
  51666. d.bufferData(d.ELEMENT_ARRAY_BUFFER, t, d.STATIC_DRAW),
  51667. l = r(),
  51668. c = {
  51669. position: d.getAttribLocation(l, "position"),
  51670. uv: d.getAttribLocation(l, "uv")
  51671. },
  51672. h = {
  51673. uvOffset: d.getUniformLocation(l, "uvOffset"),
  51674. uvScale: d.getUniformLocation(l, "uvScale"),
  51675. rotation: d.getUniformLocation(l, "rotation"),
  51676. scale: d.getUniformLocation(l, "scale"),
  51677. color: d.getUniformLocation(l, "color"),
  51678. map: d.getUniformLocation(l, "map"),
  51679. opacity: d.getUniformLocation(l, "opacity"),
  51680. modelViewMatrix: d.getUniformLocation(l, "modelViewMatrix"),
  51681. projectionMatrix: d.getUniformLocation(l, "projectionMatrix"),
  51682. fogType: d.getUniformLocation(l, "fogType"),
  51683. fogDensity: d.getUniformLocation(l, "fogDensity"),
  51684. fogNear: d.getUniformLocation(l, "fogNear"),
  51685. fogFar: d.getUniformLocation(l, "fogFar"),
  51686. fogColor: d.getUniformLocation(l, "fogColor"),
  51687. alphaTest: d.getUniformLocation(l, "alphaTest")
  51688. };
  51689. var i = document.createElement("canvas");
  51690. i.width = 8,
  51691. i.height = 8;
  51692. var o = i.getContext("2d");
  51693. o.fillStyle = "white",
  51694. o.fillRect(0, 0, 8, 8),
  51695. u = new n.Texture(i),
  51696. u.needsUpdate = !0
  51697. }
  51698. function r() {
  51699. var t = d.createProgram()
  51700. , i = d.createShader(d.VERTEX_SHADER)
  51701. , n = d.createShader(d.FRAGMENT_SHADER);
  51702. 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")),
  51703. 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")),
  51704. d.compileShader(i),
  51705. d.compileShader(n),
  51706. d.attachShader(t, i),
  51707. d.attachShader(t, n),
  51708. d.linkProgram(t),
  51709. t
  51710. }
  51711. function o(e, t) {
  51712. return e.renderOrder !== t.renderOrder ? e.renderOrder - t.renderOrder : e.z !== t.z ? t.z - e.z : t.id - e.id
  51713. }
  51714. 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;
  51715. this.render = function(r, v) {
  51716. if (0 !== t.length) {
  51717. void 0 === l && i(),
  51718. d.useProgram(l),
  51719. p.initAttributes(),
  51720. p.enableAttribute(c.position),
  51721. p.enableAttribute(c.uv),
  51722. p.disableUnusedAttributes(),
  51723. p.disable(d.CULL_FACE),
  51724. p.enable(d.BLEND),
  51725. d.bindBuffer(d.ARRAY_BUFFER, a),
  51726. d.vertexAttribPointer(c.position, 2, d.FLOAT, !1, 16, 0),
  51727. d.vertexAttribPointer(c.uv, 2, d.FLOAT, !1, 16, 8),
  51728. d.bindBuffer(d.ELEMENT_ARRAY_BUFFER, s),
  51729. d.uniformMatrix4fv(h.projectionMatrix, !1, v.projectionMatrix.elements),
  51730. p.activeTexture(d.TEXTURE0),
  51731. d.uniform1i(h.map, 0);
  51732. var A = 0
  51733. , y = 0
  51734. , C = r.fog;
  51735. C ? (d.uniform3f(h.fogColor, C.color.r, C.color.g, C.color.b),
  51736. C instanceof n.Fog ? (d.uniform1f(h.fogNear, C.near),
  51737. d.uniform1f(h.fogFar, C.far),
  51738. d.uniform1i(h.fogType, 1),
  51739. A = 1,
  51740. y = 1) : C instanceof n.FogExp2 && (d.uniform1f(h.fogDensity, C.density),
  51741. d.uniform1i(h.fogType, 2),
  51742. A = 2,
  51743. y = 2)) : (d.uniform1i(h.fogType, 0),
  51744. A = 0,
  51745. y = 0);
  51746. for (var I = 0, E = t.length; I < E; I++) {
  51747. var b = t[I];
  51748. b.modelViewMatrix.multiplyMatrices(v.matrixWorldInverse, b.matrixWorld),
  51749. b.z = -b.modelViewMatrix.elements[14]
  51750. }
  51751. t.sort(o);
  51752. for (var w = [], I = 0, E = t.length; I < E; I++) {
  51753. var b = t[I]
  51754. , _ = b.material;
  51755. d.uniform1f(h.alphaTest, _.alphaTest),
  51756. d.uniformMatrix4fv(h.modelViewMatrix, !1, b.modelViewMatrix.elements),
  51757. b.matrixWorld.decompose(f, g, m),
  51758. w[0] = m.x,
  51759. w[1] = m.y;
  51760. var T = 0;
  51761. r.fog && _.fog && (T = y),
  51762. A !== T && (d.uniform1i(h.fogType, T),
  51763. A = T),
  51764. null !== _.map ? (d.uniform2f(h.uvOffset, _.map.offset.x, _.map.offset.y),
  51765. d.uniform2f(h.uvScale, _.map.repeat.x, _.map.repeat.y)) : (d.uniform2f(h.uvOffset, 0, 0),
  51766. d.uniform2f(h.uvScale, 1, 1)),
  51767. d.uniform1f(h.opacity, _.opacity),
  51768. d.uniform3f(h.color, _.color.r, _.color.g, _.color.b),
  51769. d.uniform1f(h.rotation, _.rotation),
  51770. d.uniform2fv(h.scale, w),
  51771. p.setBlending(_.blending, _.blendEquation, _.blendSrc, _.blendDst),
  51772. p.setDepthTest(_.depthTest),
  51773. p.setDepthWrite(_.depthWrite),
  51774. _.map && _.map.image && _.map.image.width ? e.setTexture(_.map, 0) : e.setTexture(u, 0),
  51775. d.drawElements(d.TRIANGLES, 6, d.UNSIGNED_SHORT, 0)
  51776. }
  51777. p.enable(d.CULL_FACE),
  51778. e.resetGLState()
  51779. }
  51780. }
  51781. }
  51782. ,
  51783. Object.defineProperties(n.Box2.prototype, {
  51784. empty: {
  51785. value: function() {
  51786. return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."),
  51787. this.isEmpty()
  51788. }
  51789. },
  51790. isIntersectionBox: {
  51791. value: function(e) {
  51792. return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."),
  51793. this.intersectsBox(e)
  51794. }
  51795. }
  51796. }),
  51797. Object.defineProperties(n.Box3.prototype, {
  51798. empty: {
  51799. value: function() {
  51800. return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),
  51801. this.isEmpty()
  51802. }
  51803. },
  51804. isIntersectionBox: {
  51805. value: function(e) {
  51806. return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),
  51807. this.intersectsBox(e)
  51808. }
  51809. },
  51810. isIntersectionSphere: {
  51811. value: function(e) {
  51812. return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),
  51813. this.intersectsSphere(e)
  51814. }
  51815. }
  51816. }),
  51817. Object.defineProperties(n.Matrix3.prototype, {
  51818. multiplyVector3: {
  51819. value: function(e) {
  51820. return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),
  51821. e.applyMatrix3(this)
  51822. }
  51823. },
  51824. multiplyVector3Array: {
  51825. value: function(e) {
  51826. return console.warn("THREE.Matrix3: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead."),
  51827. this.applyToVector3Array(e)
  51828. }
  51829. }
  51830. }),
  51831. Object.defineProperties(n.Matrix4.prototype, {
  51832. extractPosition: {
  51833. value: function(e) {
  51834. return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),
  51835. this.copyPosition(e)
  51836. }
  51837. },
  51838. setRotationFromQuaternion: {
  51839. value: function(e) {
  51840. return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),
  51841. this.makeRotationFromQuaternion(e)
  51842. }
  51843. },
  51844. multiplyVector3: {
  51845. value: function(e) {
  51846. return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) or vector.applyProjection( matrix ) instead."),
  51847. e.applyProjection(this)
  51848. }
  51849. },
  51850. multiplyVector4: {
  51851. value: function(e) {
  51852. return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),
  51853. e.applyMatrix4(this)
  51854. }
  51855. },
  51856. multiplyVector3Array: {
  51857. value: function(e) {
  51858. return console.warn("THREE.Matrix4: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead."),
  51859. this.applyToVector3Array(e)
  51860. }
  51861. },
  51862. rotateAxis: {
  51863. value: function(e) {
  51864. console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),
  51865. e.transformDirection(this)
  51866. }
  51867. },
  51868. crossVector: {
  51869. value: function(e) {
  51870. return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),
  51871. e.applyMatrix4(this)
  51872. }
  51873. },
  51874. translate: {
  51875. value: function(e) {
  51876. console.error("THREE.Matrix4: .translate() has been removed.")
  51877. }
  51878. },
  51879. rotateX: {
  51880. value: function(e) {
  51881. console.error("THREE.Matrix4: .rotateX() has been removed.")
  51882. }
  51883. },
  51884. rotateY: {
  51885. value: function(e) {
  51886. console.error("THREE.Matrix4: .rotateY() has been removed.")
  51887. }
  51888. },
  51889. rotateZ: {
  51890. value: function(e) {
  51891. console.error("THREE.Matrix4: .rotateZ() has been removed.")
  51892. }
  51893. },
  51894. rotateByAxis: {
  51895. value: function(e, t) {
  51896. console.error("THREE.Matrix4: .rotateByAxis() has been removed.")
  51897. }
  51898. }
  51899. }),
  51900. Object.defineProperties(n.Plane.prototype, {
  51901. isIntersectionLine: {
  51902. value: function(e) {
  51903. return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),
  51904. this.intersectsLine(e)
  51905. }
  51906. }
  51907. }),
  51908. Object.defineProperties(n.Quaternion.prototype, {
  51909. multiplyVector3: {
  51910. value: function(e) {
  51911. return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),
  51912. e.applyQuaternion(this)
  51913. }
  51914. }
  51915. }),
  51916. Object.defineProperties(n.Ray.prototype, {
  51917. isIntersectionBox: {
  51918. value: function(e) {
  51919. return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),
  51920. this.intersectsBox(e)
  51921. }
  51922. },
  51923. isIntersectionPlane: {
  51924. value: function(e) {
  51925. return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),
  51926. this.intersectsPlane(e)
  51927. }
  51928. },
  51929. isIntersectionSphere: {
  51930. value: function(e) {
  51931. return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),
  51932. this.intersectsSphere(e)
  51933. }
  51934. }
  51935. }),
  51936. Object.defineProperties(n.Vector3.prototype, {
  51937. setEulerFromRotationMatrix: {
  51938. value: function() {
  51939. console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")
  51940. }
  51941. },
  51942. setEulerFromQuaternion: {
  51943. value: function() {
  51944. console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")
  51945. }
  51946. },
  51947. getPositionFromMatrix: {
  51948. value: function(e) {
  51949. return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),
  51950. this.setFromMatrixPosition(e)
  51951. }
  51952. },
  51953. getScaleFromMatrix: {
  51954. value: function(e) {
  51955. return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),
  51956. this.setFromMatrixScale(e)
  51957. }
  51958. },
  51959. getColumnFromMatrix: {
  51960. value: function(e, t) {
  51961. return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),
  51962. this.setFromMatrixColumn(e, t)
  51963. }
  51964. }
  51965. }),
  51966. n.Face4 = function(e, t, i, r, o, a, s) {
  51967. return console.warn("THREE.Face4 has been removed. A THREE.Face3 will be created instead."),
  51968. new n.Face3(e,t,i,o,a,s)
  51969. }
  51970. ,
  51971. n.Vertex = function(e, t, i) {
  51972. return console.warn("THREE.Vertex has been removed. Use THREE.Vector3 instead."),
  51973. new n.Vector3(e,t,i)
  51974. }
  51975. ,
  51976. Object.defineProperties(n.Object3D.prototype, {
  51977. eulerOrder: {
  51978. get: function() {
  51979. return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),
  51980. this.rotation.order
  51981. },
  51982. set: function(e) {
  51983. console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),
  51984. this.rotation.order = e
  51985. }
  51986. },
  51987. getChildByName: {
  51988. value: function(e) {
  51989. return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),
  51990. this.getObjectByName(e)
  51991. }
  51992. },
  51993. renderDepth: {
  51994. set: function(e) {
  51995. console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")
  51996. }
  51997. },
  51998. translate: {
  51999. value: function(e, t) {
  52000. return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),
  52001. this.translateOnAxis(t, e)
  52002. }
  52003. },
  52004. useQuaternion: {
  52005. get: function() {
  52006. console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")
  52007. },
  52008. set: function(e) {
  52009. console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")
  52010. }
  52011. }
  52012. }),
  52013. Object.defineProperties(n, {
  52014. PointCloud: {
  52015. value: function(e, t) {
  52016. return console.warn("THREE.PointCloud has been renamed to THREE.Points."),
  52017. new n.Points(e,t)
  52018. }
  52019. },
  52020. ParticleSystem: {
  52021. value: function(e, t) {
  52022. return console.warn("THREE.ParticleSystem has been renamed to THREE.Points."),
  52023. new n.Points(e,t)
  52024. }
  52025. }
  52026. }),
  52027. Object.defineProperties(n.Light.prototype, {
  52028. onlyShadow: {
  52029. set: function(e) {
  52030. console.warn("THREE.Light: .onlyShadow has been removed.")
  52031. }
  52032. },
  52033. shadowCameraFov: {
  52034. set: function(e) {
  52035. console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."),
  52036. this.shadow.camera.fov = e
  52037. }
  52038. },
  52039. shadowCameraLeft: {
  52040. set: function(e) {
  52041. console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."),
  52042. this.shadow.camera.left = e
  52043. }
  52044. },
  52045. shadowCameraRight: {
  52046. set: function(e) {
  52047. console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),
  52048. this.shadow.camera.right = e
  52049. }
  52050. },
  52051. shadowCameraTop: {
  52052. set: function(e) {
  52053. console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),
  52054. this.shadow.camera.top = e
  52055. }
  52056. },
  52057. shadowCameraBottom: {
  52058. set: function(e) {
  52059. console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),
  52060. this.shadow.camera.bottom = e
  52061. }
  52062. },
  52063. shadowCameraNear: {
  52064. set: function(e) {
  52065. console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),
  52066. this.shadow.camera.near = e
  52067. }
  52068. },
  52069. shadowCameraFar: {
  52070. set: function(e) {
  52071. console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),
  52072. this.shadow.camera.far = e
  52073. }
  52074. },
  52075. shadowCameraVisible: {
  52076. set: function(e) {
  52077. console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")
  52078. }
  52079. },
  52080. shadowBias: {
  52081. set: function(e) {
  52082. console.warn("THREE.Light: .shadowBias is now .shadow.bias."),
  52083. this.shadow.bias = e
  52084. }
  52085. },
  52086. shadowDarkness: {
  52087. set: function(e) {
  52088. console.warn("THREE.Light: .shadowDarkness has been removed.")
  52089. }
  52090. },
  52091. shadowMapWidth: {
  52092. set: function(e) {
  52093. console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),
  52094. this.shadow.mapSize.width = e
  52095. }
  52096. },
  52097. shadowMapHeight: {
  52098. set: function(e) {
  52099. console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),
  52100. this.shadow.mapSize.height = e
  52101. }
  52102. }
  52103. }),
  52104. Object.defineProperties(n.BufferAttribute.prototype, {
  52105. length: {
  52106. get: function() {
  52107. return console.warn("THREE.BufferAttribute: .length has been deprecated. Please use .count."),
  52108. this.array.length
  52109. }
  52110. }
  52111. }),
  52112. Object.defineProperties(n.BufferGeometry.prototype, {
  52113. drawcalls: {
  52114. get: function() {
  52115. return console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups."),
  52116. this.groups
  52117. }
  52118. },
  52119. offsets: {
  52120. get: function() {
  52121. return console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups."),
  52122. this.groups
  52123. }
  52124. },
  52125. addIndex: {
  52126. value: function(e) {
  52127. console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),
  52128. this.setIndex(e)
  52129. }
  52130. },
  52131. addDrawCall: {
  52132. value: function(e, t, i) {
  52133. void 0 !== i && console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),
  52134. console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),
  52135. this.addGroup(e, t)
  52136. }
  52137. },
  52138. clearDrawCalls: {
  52139. value: function() {
  52140. console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."),
  52141. this.clearGroups()
  52142. }
  52143. },
  52144. computeTangents: {
  52145. value: function() {
  52146. console.warn("THREE.BufferGeometry: .computeTangents() has been removed.")
  52147. }
  52148. },
  52149. computeOffsets: {
  52150. value: function() {
  52151. console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")
  52152. }
  52153. }
  52154. }),
  52155. Object.defineProperties(n.Material.prototype, {
  52156. wrapAround: {
  52157. get: function() {
  52158. console.warn("THREE." + this.type + ": .wrapAround has been removed.")
  52159. },
  52160. set: function(e) {
  52161. console.warn("THREE." + this.type + ": .wrapAround has been removed.")
  52162. }
  52163. },
  52164. wrapRGB: {
  52165. get: function() {
  52166. return console.warn("THREE." + this.type + ": .wrapRGB has been removed."),
  52167. new n.Color
  52168. }
  52169. }
  52170. }),
  52171. Object.defineProperties(n, {
  52172. PointCloudMaterial: {
  52173. value: function(e) {
  52174. return console.warn("THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial."),
  52175. new n.PointsMaterial(e)
  52176. }
  52177. },
  52178. ParticleBasicMaterial: {
  52179. value: function(e) {
  52180. return console.warn("THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial."),
  52181. new n.PointsMaterial(e)
  52182. }
  52183. },
  52184. ParticleSystemMaterial: {
  52185. value: function(e) {
  52186. return console.warn("THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial."),
  52187. new n.PointsMaterial(e)
  52188. }
  52189. }
  52190. }),
  52191. Object.defineProperties(n.MeshPhongMaterial.prototype, {
  52192. metal: {
  52193. get: function() {
  52194. return console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead."),
  52195. !1
  52196. },
  52197. set: function(e) {
  52198. console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead")
  52199. }
  52200. }
  52201. }),
  52202. Object.defineProperties(n.ShaderMaterial.prototype, {
  52203. derivatives: {
  52204. get: function() {
  52205. return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),
  52206. this.extensions.derivatives
  52207. },
  52208. set: function(e) {
  52209. console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),
  52210. this.extensions.derivatives = e
  52211. }
  52212. }
  52213. }),
  52214. Object.defineProperties(n.WebGLRenderer.prototype, {
  52215. supportsFloatTextures: {
  52216. value: function() {
  52217. return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."),
  52218. this.extensions.get("OES_texture_float")
  52219. }
  52220. },
  52221. supportsHalfFloatTextures: {
  52222. value: function() {
  52223. return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."),
  52224. this.extensions.get("OES_texture_half_float")
  52225. }
  52226. },
  52227. supportsStandardDerivatives: {
  52228. value: function() {
  52229. return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."),
  52230. this.extensions.get("OES_standard_derivatives")
  52231. }
  52232. },
  52233. supportsCompressedTextureS3TC: {
  52234. value: function() {
  52235. return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),
  52236. this.extensions.get("WEBGL_compressed_texture_s3tc")
  52237. }
  52238. },
  52239. supportsCompressedTexturePVRTC: {
  52240. value: function() {
  52241. return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),
  52242. this.extensions.get("WEBGL_compressed_texture_pvrtc")
  52243. }
  52244. },
  52245. supportsBlendMinMax: {
  52246. value: function() {
  52247. return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."),
  52248. this.extensions.get("EXT_blend_minmax")
  52249. }
  52250. },
  52251. supportsVertexTextures: {
  52252. value: function() {
  52253. return this.capabilities.vertexTextures
  52254. }
  52255. },
  52256. supportsInstancedArrays: {
  52257. value: function() {
  52258. return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."),
  52259. this.extensions.get("ANGLE_instanced_arrays")
  52260. }
  52261. },
  52262. enableScissorTest: {
  52263. value: function(e) {
  52264. console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),
  52265. this.setScissorTest(e)
  52266. }
  52267. },
  52268. initMaterial: {
  52269. value: function() {
  52270. console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")
  52271. }
  52272. },
  52273. addPrePlugin: {
  52274. value: function() {
  52275. console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")
  52276. }
  52277. },
  52278. addPostPlugin: {
  52279. value: function() {
  52280. console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")
  52281. }
  52282. },
  52283. updateShadowMap: {
  52284. value: function() {
  52285. console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")
  52286. }
  52287. },
  52288. shadowMapEnabled: {
  52289. get: function() {
  52290. return this.shadowMap.enabled
  52291. },
  52292. set: function(e) {
  52293. console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),
  52294. this.shadowMap.enabled = e
  52295. }
  52296. },
  52297. shadowMapType: {
  52298. get: function() {
  52299. return this.shadowMap.type
  52300. },
  52301. set: function(e) {
  52302. console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),
  52303. this.shadowMap.type = e
  52304. }
  52305. },
  52306. shadowMapCullFace: {
  52307. get: function() {
  52308. return this.shadowMap.cullFace
  52309. },
  52310. set: function(e) {
  52311. console.warn("THREE.WebGLRenderer: .shadowMapCullFace is now .shadowMap.cullFace."),
  52312. this.shadowMap.cullFace = e
  52313. }
  52314. }
  52315. }),
  52316. Object.defineProperties(n.WebGLRenderTarget.prototype, {
  52317. wrapS: {
  52318. get: function() {
  52319. return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),
  52320. this.texture.wrapS
  52321. },
  52322. set: function(e) {
  52323. console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),
  52324. this.texture.wrapS = e
  52325. }
  52326. },
  52327. wrapT: {
  52328. get: function() {
  52329. return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),
  52330. this.texture.wrapT
  52331. },
  52332. set: function(e) {
  52333. console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),
  52334. this.texture.wrapT = e
  52335. }
  52336. },
  52337. magFilter: {
  52338. get: function() {
  52339. return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),
  52340. this.texture.magFilter
  52341. },
  52342. set: function(e) {
  52343. console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),
  52344. this.texture.magFilter = e
  52345. }
  52346. },
  52347. minFilter: {
  52348. get: function() {
  52349. return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),
  52350. this.texture.minFilter
  52351. },
  52352. set: function(e) {
  52353. console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),
  52354. this.texture.minFilter = e
  52355. }
  52356. },
  52357. anisotropy: {
  52358. get: function() {
  52359. return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),
  52360. this.texture.anisotropy
  52361. },
  52362. set: function(e) {
  52363. console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),
  52364. this.texture.anisotropy = e
  52365. }
  52366. },
  52367. offset: {
  52368. get: function() {
  52369. return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),
  52370. this.texture.offset
  52371. },
  52372. set: function(e) {
  52373. console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),
  52374. this.texture.offset = e
  52375. }
  52376. },
  52377. repeat: {
  52378. get: function() {
  52379. return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),
  52380. this.texture.repeat
  52381. },
  52382. set: function(e) {
  52383. console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),
  52384. this.texture.repeat = e
  52385. }
  52386. },
  52387. format: {
  52388. get: function() {
  52389. return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),
  52390. this.texture.format
  52391. },
  52392. set: function(e) {
  52393. console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),
  52394. this.texture.format = e
  52395. }
  52396. },
  52397. type: {
  52398. get: function() {
  52399. return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),
  52400. this.texture.type
  52401. },
  52402. set: function(e) {
  52403. console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),
  52404. this.texture.type = e
  52405. }
  52406. },
  52407. generateMipmaps: {
  52408. get: function() {
  52409. return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),
  52410. this.texture.generateMipmaps
  52411. },
  52412. set: function(e) {
  52413. console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),
  52414. this.texture.generateMipmaps = e
  52415. }
  52416. }
  52417. }),
  52418. n.GeometryUtils = {
  52419. merge: function(e, t, i) {
  52420. console.warn("THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead.");
  52421. var r;
  52422. t instanceof n.Mesh && (t.matrixAutoUpdate && t.updateMatrix(),
  52423. r = t.matrix,
  52424. t = t.geometry),
  52425. e.merge(t, r, i)
  52426. },
  52427. center: function(e) {
  52428. return console.warn("THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead."),
  52429. e.center()
  52430. }
  52431. },
  52432. n.ImageUtils = {
  52433. crossOrigin: void 0,
  52434. loadTexture: function(e, t, i, r) {
  52435. console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");
  52436. var o = new n.TextureLoader;
  52437. o.setCrossOrigin(this.crossOrigin);
  52438. var a = o.load(e, i, void 0, r);
  52439. return t && (a.mapping = t),
  52440. a
  52441. },
  52442. loadTextureCube: function(e, t, i, r) {
  52443. console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");
  52444. var o = new n.CubeTextureLoader;
  52445. o.setCrossOrigin(this.crossOrigin);
  52446. var a = o.load(e, i, void 0, r);
  52447. return t && (a.mapping = t),
  52448. a
  52449. },
  52450. loadCompressedTexture: function() {
  52451. console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")
  52452. },
  52453. loadCompressedTextureCube: function() {
  52454. console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")
  52455. }
  52456. },
  52457. n.Projector = function() {
  52458. console.error("THREE.Projector has been moved to /examples/js/renderers/Projector.js."),
  52459. this.projectVector = function(e, t) {
  52460. console.warn("THREE.Projector: .projectVector() is now vector.project()."),
  52461. e.project(t)
  52462. }
  52463. ,
  52464. this.unprojectVector = function(e, t) {
  52465. console.warn("THREE.Projector: .unprojectVector() is now vector.unproject()."),
  52466. e.unproject(t)
  52467. }
  52468. ,
  52469. this.pickingRay = function(e, t) {
  52470. console.error("THREE.Projector: .pickingRay() is now raycaster.setFromCamera().")
  52471. }
  52472. }
  52473. ,
  52474. n.CanvasRenderer = function() {
  52475. console.error("THREE.CanvasRenderer has been moved to /examples/js/renderers/CanvasRenderer.js"),
  52476. this.domElement = document.createElement("canvas"),
  52477. this.clear = function() {}
  52478. ,
  52479. this.render = function() {}
  52480. ,
  52481. this.setClearColor = function() {}
  52482. ,
  52483. this.setSize = function() {}
  52484. }
  52485. ,
  52486. n.MeshFaceMaterial = n.MultiMaterial,
  52487. n.CurveUtils = {
  52488. tangentQuadraticBezier: function(e, t, i, n) {
  52489. return 2 * (1 - e) * (i - t) + 2 * e * (n - i)
  52490. },
  52491. tangentCubicBezier: function(e, t, i, n, r) {
  52492. 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
  52493. },
  52494. tangentSpline: function(e, t, i, n, r) {
  52495. var o = 6 * e * e - 6 * e
  52496. , a = 3 * e * e - 4 * e + 1
  52497. , s = -6 * e * e + 6 * e
  52498. , l = 3 * e * e - 2 * e;
  52499. return o + a + s + l
  52500. },
  52501. interpolate: function(e, t, i, n, r) {
  52502. var o = .5 * (i - e)
  52503. , a = .5 * (n - t)
  52504. , s = r * r
  52505. , l = r * s;
  52506. return (2 * t - 2 * i + o + a) * l + (-3 * t + 3 * i - 2 * o - a) * s + o * r + t
  52507. }
  52508. },
  52509. n.SceneUtils = {
  52510. createMultiMaterialObject: function(e, t) {
  52511. for (var i = new n.Group, r = 0, o = t.length; r < o; r++)
  52512. i.add(new n.Mesh(e,t[r]));
  52513. return i
  52514. },
  52515. detach: function(e, t, i) {
  52516. e.applyMatrix(t.matrixWorld),
  52517. t.remove(e),
  52518. i.add(e)
  52519. },
  52520. attach: function(e, t, i) {
  52521. var r = new n.Matrix4;
  52522. r.getInverse(i.matrixWorld),
  52523. e.applyMatrix(r),
  52524. t.remove(e),
  52525. i.add(e)
  52526. }
  52527. },
  52528. n.ShapeUtils = {
  52529. area: function(e) {
  52530. for (var t = e.length, i = 0, n = t - 1, r = 0; r < t; n = r++)
  52531. i += e[n].x * e[r].y - e[r].x * e[n].y;
  52532. return .5 * i
  52533. },
  52534. triangulate: function() {
  52535. function e(e, t, i, n, r, o) {
  52536. var a, s, l, c, h, u, d, p, f;
  52537. if (s = e[o[t]].x,
  52538. l = e[o[t]].y,
  52539. c = e[o[i]].x,
  52540. h = e[o[i]].y,
  52541. u = e[o[n]].x,
  52542. d = e[o[n]].y,
  52543. Number.EPSILON > (c - s) * (d - l) - (h - l) * (u - s))
  52544. return !1;
  52545. var g, m, v, A, y, C, I, E, b, w, _, T, x, S, M;
  52546. for (g = u - c,
  52547. m = d - h,
  52548. v = s - u,
  52549. A = l - d,
  52550. y = c - s,
  52551. C = h - l,
  52552. a = 0; a < r; a++)
  52553. if (p = e[o[a]].x,
  52554. f = e[o[a]].y,
  52555. !(p === s && f === l || p === c && f === h || p === u && f === d) && (I = p - s,
  52556. E = f - l,
  52557. b = p - c,
  52558. w = f - h,
  52559. _ = p - u,
  52560. T = f - d,
  52561. M = g * w - m * b,
  52562. x = y * E - C * I,
  52563. S = v * T - A * _,
  52564. M >= -Number.EPSILON && S >= -Number.EPSILON && x >= -Number.EPSILON))
  52565. return !1;
  52566. return !0
  52567. }
  52568. return function(t, i) {
  52569. var r = t.length;
  52570. if (r < 3)
  52571. return null;
  52572. var o, a, s, l = [], c = [], h = [];
  52573. if (n.ShapeUtils.area(t) > 0)
  52574. for (a = 0; a < r; a++)
  52575. c[a] = a;
  52576. else
  52577. for (a = 0; a < r; a++)
  52578. c[a] = r - 1 - a;
  52579. var u = r
  52580. , d = 2 * u;
  52581. for (a = u - 1; u > 2; ) {
  52582. if (d-- <= 0)
  52583. return console.warn("THREE.ShapeUtils: Unable to triangulate polygon! in triangulate()"),
  52584. i ? h : l;
  52585. if (o = a,
  52586. u <= o && (o = 0),
  52587. a = o + 1,
  52588. u <= a && (a = 0),
  52589. s = a + 1,
  52590. u <= s && (s = 0),
  52591. e(t, o, a, s, u, c)) {
  52592. var p, f, g, m, v;
  52593. for (p = c[o],
  52594. f = c[a],
  52595. g = c[s],
  52596. l.push([t[p], t[f], t[g]]),
  52597. h.push([c[o], c[a], c[s]]),
  52598. m = a,
  52599. v = a + 1; v < u; m++,
  52600. v++)
  52601. c[m] = c[v];
  52602. u--,
  52603. d = 2 * u
  52604. }
  52605. }
  52606. return i ? h : l
  52607. }
  52608. }(),
  52609. triangulateShape: function(e, t) {
  52610. function i(e, t, i) {
  52611. 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
  52612. }
  52613. function r(e, t, n, r, o) {
  52614. var a = t.x - e.x
  52615. , s = t.y - e.y
  52616. , l = r.x - n.x
  52617. , c = r.y - n.y
  52618. , h = e.x - n.x
  52619. , u = e.y - n.y
  52620. , d = s * l - a * c
  52621. , p = s * h - a * u;
  52622. if (Math.abs(d) > Number.EPSILON) {
  52623. var f;
  52624. if (d > 0) {
  52625. if (p < 0 || p > d)
  52626. return [];
  52627. if (f = c * h - l * u,
  52628. f < 0 || f > d)
  52629. return []
  52630. } else {
  52631. if (p > 0 || p < d)
  52632. return [];
  52633. if (f = c * h - l * u,
  52634. f > 0 || f < d)
  52635. return []
  52636. }
  52637. if (0 === f)
  52638. return !o || 0 !== p && p !== d ? [e] : [];
  52639. if (f === d)
  52640. return !o || 0 !== p && p !== d ? [t] : [];
  52641. if (0 === p)
  52642. return [n];
  52643. if (p === d)
  52644. return [r];
  52645. var g = f / d;
  52646. return [{
  52647. x: e.x + g * a,
  52648. y: e.y + g * s
  52649. }]
  52650. }
  52651. if (0 !== p || c * h !== l * u)
  52652. return [];
  52653. var m = 0 === a && 0 === s
  52654. , v = 0 === l && 0 === c;
  52655. if (m && v)
  52656. return e.x !== n.x || e.y !== n.y ? [] : [e];
  52657. if (m)
  52658. return i(n, r, e) ? [e] : [];
  52659. if (v)
  52660. return i(e, t, n) ? [n] : [];
  52661. var A, y, C, I, E, b, w, _;
  52662. return 0 !== a ? (e.x < t.x ? (A = e,
  52663. C = e.x,
  52664. y = t,
  52665. I = t.x) : (A = t,
  52666. C = t.x,
  52667. y = e,
  52668. I = e.x),
  52669. n.x < r.x ? (E = n,
  52670. w = n.x,
  52671. b = r,
  52672. _ = r.x) : (E = r,
  52673. w = r.x,
  52674. b = n,
  52675. _ = n.x)) : (e.y < t.y ? (A = e,
  52676. C = e.y,
  52677. y = t,
  52678. I = t.y) : (A = t,
  52679. C = t.y,
  52680. y = e,
  52681. I = e.y),
  52682. n.y < r.y ? (E = n,
  52683. w = n.y,
  52684. b = r,
  52685. _ = r.y) : (E = r,
  52686. w = r.y,
  52687. b = n,
  52688. _ = n.y)),
  52689. C <= w ? I < w ? [] : I === w ? o ? [] : [E] : I <= _ ? [E, y] : [E, b] : C > _ ? [] : C === _ ? o ? [] : [A] : I <= _ ? [A, y] : [A, b]
  52690. }
  52691. function o(e, t, i, n) {
  52692. var r = t.x - e.x
  52693. , o = t.y - e.y
  52694. , a = i.x - e.x
  52695. , s = i.y - e.y
  52696. , l = n.x - e.x
  52697. , c = n.y - e.y
  52698. , h = r * s - o * a
  52699. , u = r * c - o * l;
  52700. if (Math.abs(h) > Number.EPSILON) {
  52701. var d = l * s - c * a;
  52702. return h > 0 ? u >= 0 && d >= 0 : u >= 0 || d >= 0
  52703. }
  52704. return u > 0
  52705. }
  52706. function a(e, t) {
  52707. function i(e, t) {
  52708. var i = A.length - 1
  52709. , n = e - 1;
  52710. n < 0 && (n = i);
  52711. var r = e + 1;
  52712. r > i && (r = 0);
  52713. var a = o(A[e], A[n], A[r], s[t]);
  52714. if (!a)
  52715. return !1;
  52716. var l = s.length - 1
  52717. , c = t - 1;
  52718. c < 0 && (c = l);
  52719. var h = t + 1;
  52720. return h > l && (h = 0),
  52721. a = o(s[t], s[c], s[h], A[e]),
  52722. !!a
  52723. }
  52724. function n(e, t) {
  52725. var i, n, o;
  52726. for (i = 0; i < A.length; i++)
  52727. if (n = i + 1,
  52728. n %= A.length,
  52729. o = r(e, t, A[i], A[n], !0),
  52730. o.length > 0)
  52731. return !0;
  52732. return !1
  52733. }
  52734. function a(e, i) {
  52735. var n, o, a, s, l;
  52736. for (n = 0; n < y.length; n++)
  52737. for (o = t[y[n]],
  52738. a = 0; a < o.length; a++)
  52739. if (s = a + 1,
  52740. s %= o.length,
  52741. l = r(e, i, o[a], o[s], !0),
  52742. l.length > 0)
  52743. return !0;
  52744. return !1
  52745. }
  52746. 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++)
  52747. y.push(I);
  52748. for (var b = 0, w = 2 * y.length; y.length > 0; ) {
  52749. if (w--,
  52750. w < 0) {
  52751. console.log("Infinite Loop! Holes left:" + y.length + ", Probably Hole outside Shape!");
  52752. break
  52753. }
  52754. for (c = b; c < A.length; c++) {
  52755. h = A[c],
  52756. l = -1;
  52757. for (var I = 0; I < y.length; I++)
  52758. if (d = y[I],
  52759. p = h.x + ":" + h.y + ":" + d,
  52760. void 0 === C[p]) {
  52761. s = t[d];
  52762. for (var _ = 0; _ < s.length; _++)
  52763. if (u = s[_],
  52764. i(c, _) && !n(h, u) && !a(h, u)) {
  52765. l = _,
  52766. y.splice(I, 1),
  52767. f = A.slice(0, c + 1),
  52768. g = A.slice(c),
  52769. m = s.slice(l),
  52770. v = s.slice(0, l + 1),
  52771. A = f.concat(m).concat(v).concat(g),
  52772. b = c;
  52773. break
  52774. }
  52775. if (l >= 0)
  52776. break;
  52777. C[p] = !0
  52778. }
  52779. if (l >= 0)
  52780. break
  52781. }
  52782. }
  52783. return A
  52784. }
  52785. for (var s, l, c, h, u, d, p = {}, f = e.concat(), g = 0, m = t.length; g < m; g++)
  52786. Array.prototype.push.apply(f, t[g]);
  52787. for (s = 0,
  52788. l = f.length; s < l; s++)
  52789. u = f[s].x + ":" + f[s].y,
  52790. void 0 !== p[u] && console.warn("THREE.Shape: Duplicate point", u),
  52791. p[u] = s;
  52792. var v = a(e, t)
  52793. , A = n.ShapeUtils.triangulate(v, !1);
  52794. for (s = 0,
  52795. l = A.length; s < l; s++)
  52796. for (h = A[s],
  52797. c = 0; c < 3; c++)
  52798. u = h[c].x + ":" + h[c].y,
  52799. d = p[u],
  52800. void 0 !== d && (h[c] = d);
  52801. return A.concat()
  52802. },
  52803. isClockWise: function(e) {
  52804. return n.ShapeUtils.area(e) < 0
  52805. },
  52806. b2: function() {
  52807. function e(e, t) {
  52808. var i = 1 - e;
  52809. return i * i * t
  52810. }
  52811. function t(e, t) {
  52812. return 2 * (1 - e) * e * t
  52813. }
  52814. function i(e, t) {
  52815. return e * e * t
  52816. }
  52817. return function(n, r, o, a) {
  52818. return e(n, r) + t(n, o) + i(n, a)
  52819. }
  52820. }(),
  52821. b3: function() {
  52822. function e(e, t) {
  52823. var i = 1 - e;
  52824. return i * i * i * t
  52825. }
  52826. function t(e, t) {
  52827. var i = 1 - e;
  52828. return 3 * i * i * e * t
  52829. }
  52830. function i(e, t) {
  52831. var i = 1 - e;
  52832. return 3 * i * e * e * t
  52833. }
  52834. function n(e, t) {
  52835. return e * e * e * t
  52836. }
  52837. return function(r, o, a, s, l) {
  52838. return e(r, o) + t(r, a) + i(r, s) + n(r, l)
  52839. }
  52840. }()
  52841. },
  52842. n.Curve = function() {}
  52843. ,
  52844. n.Curve.prototype = {
  52845. constructor: n.Curve,
  52846. getPoint: function(e) {
  52847. return console.warn("THREE.Curve: Warning, getPoint() not implemented!"),
  52848. null
  52849. },
  52850. getPointAt: function(e) {
  52851. var t = this.getUtoTmapping(e);
  52852. return this.getPoint(t)
  52853. },
  52854. getPoints: function(e) {
  52855. e || (e = 5);
  52856. var t, i = [];
  52857. for (t = 0; t <= e; t++)
  52858. i.push(this.getPoint(t / e));
  52859. return i
  52860. },
  52861. getSpacedPoints: function(e) {
  52862. e || (e = 5);
  52863. var t, i = [];
  52864. for (t = 0; t <= e; t++)
  52865. i.push(this.getPointAt(t / e));
  52866. return i
  52867. },
  52868. getLength: function() {
  52869. var e = this.getLengths();
  52870. return e[e.length - 1]
  52871. },
  52872. getLengths: function(e) {
  52873. if (e || (e = this.__arcLengthDivisions ? this.__arcLengthDivisions : 200),
  52874. this.cacheArcLengths && this.cacheArcLengths.length === e + 1 && !this.needsUpdate)
  52875. return this.cacheArcLengths;
  52876. this.needsUpdate = !1;
  52877. var t, i, n = [], r = this.getPoint(0), o = 0;
  52878. for (n.push(0),
  52879. i = 1; i <= e; i++)
  52880. t = this.getPoint(i / e),
  52881. o += t.distanceTo(r),
  52882. n.push(o),
  52883. r = t;
  52884. return this.cacheArcLengths = n,
  52885. n
  52886. },
  52887. updateArcLengths: function() {
  52888. this.needsUpdate = !0,
  52889. this.getLengths()
  52890. },
  52891. getUtoTmapping: function(e, t) {
  52892. var i, n = this.getLengths(), r = 0, o = n.length;
  52893. i = t ? t : e * n[o - 1];
  52894. for (var a, s = 0, l = o - 1; s <= l; )
  52895. if (r = Math.floor(s + (l - s) / 2),
  52896. a = n[r] - i,
  52897. a < 0)
  52898. s = r + 1;
  52899. else {
  52900. if (!(a > 0)) {
  52901. l = r;
  52902. break
  52903. }
  52904. l = r - 1
  52905. }
  52906. if (r = l,
  52907. n[r] === i) {
  52908. var c = r / (o - 1);
  52909. return c
  52910. }
  52911. var h = n[r]
  52912. , u = n[r + 1]
  52913. , d = u - h
  52914. , p = (i - h) / d
  52915. , c = (r + p) / (o - 1);
  52916. return c
  52917. },
  52918. getTangent: function(e) {
  52919. var t = 1e-4
  52920. , i = e - t
  52921. , n = e + t;
  52922. i < 0 && (i = 0),
  52923. n > 1 && (n = 1);
  52924. var r = this.getPoint(i)
  52925. , o = this.getPoint(n)
  52926. , a = o.clone().sub(r);
  52927. return a.normalize()
  52928. },
  52929. getTangentAt: function(e) {
  52930. var t = this.getUtoTmapping(e);
  52931. return this.getTangent(t)
  52932. }
  52933. },
  52934. n.Curve.create = function(e, t) {
  52935. return e.prototype = Object.create(n.Curve.prototype),
  52936. e.prototype.constructor = e,
  52937. e.prototype.getPoint = t,
  52938. e
  52939. }
  52940. ,
  52941. n.CurvePath = function() {
  52942. this.curves = [],
  52943. this.autoClose = !1
  52944. }
  52945. ,
  52946. n.CurvePath.prototype = Object.create(n.Curve.prototype),
  52947. n.CurvePath.prototype.constructor = n.CurvePath,
  52948. n.CurvePath.prototype.add = function(e) {
  52949. this.curves.push(e)
  52950. }
  52951. ,
  52952. n.CurvePath.prototype.closePath = function() {
  52953. var e = this.curves[0].getPoint(0)
  52954. , t = this.curves[this.curves.length - 1].getPoint(1);
  52955. e.equals(t) || this.curves.push(new n.LineCurve(t,e))
  52956. }
  52957. ,
  52958. n.CurvePath.prototype.getPoint = function(e) {
  52959. for (var t = e * this.getLength(), i = this.getCurveLengths(), n = 0; n < i.length; ) {
  52960. if (i[n] >= t) {
  52961. var r = i[n] - t
  52962. , o = this.curves[n]
  52963. , a = 1 - r / o.getLength();
  52964. return o.getPointAt(a)
  52965. }
  52966. n++
  52967. }
  52968. return null
  52969. }
  52970. ,
  52971. n.CurvePath.prototype.getLength = function() {
  52972. var e = this.getCurveLengths();
  52973. return e[e.length - 1]
  52974. }
  52975. ,
  52976. n.CurvePath.prototype.getCurveLengths = function() {
  52977. if (this.cacheLengths && this.cacheLengths.length === this.curves.length)
  52978. return this.cacheLengths;
  52979. for (var e = [], t = 0, i = 0, n = this.curves.length; i < n; i++)
  52980. t += this.curves[i].getLength(),
  52981. e.push(t);
  52982. return this.cacheLengths = e,
  52983. e
  52984. }
  52985. ,
  52986. n.CurvePath.prototype.createPointsGeometry = function(e) {
  52987. var t = this.getPoints(e);
  52988. return this.createGeometry(t)
  52989. }
  52990. ,
  52991. n.CurvePath.prototype.createSpacedPointsGeometry = function(e) {
  52992. var t = this.getSpacedPoints(e);
  52993. return this.createGeometry(t)
  52994. }
  52995. ,
  52996. n.CurvePath.prototype.createGeometry = function(e) {
  52997. for (var t = new n.Geometry, i = 0, r = e.length; i < r; i++) {
  52998. var o = e[i];
  52999. t.vertices.push(new n.Vector3(o.x,o.y,o.z || 0))
  53000. }
  53001. return t
  53002. }
  53003. ,
  53004. n.Font = function(e) {
  53005. this.data = e
  53006. }
  53007. ,
  53008. n.Font.prototype = {
  53009. constructor: n.Font,
  53010. generateShapes: function(e, t, i) {
  53011. function r(e) {
  53012. for (var i = String(e).split(""), n = t / a.resolution, r = 0, s = [], l = 0; l < i.length; l++) {
  53013. var c = o(i[l], n, r);
  53014. r += c.offset,
  53015. s.push(c.path)
  53016. }
  53017. return s
  53018. }
  53019. function o(e, t, r) {
  53020. var o = a.glyphs[e] || a.glyphs["?"];
  53021. if (o) {
  53022. 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;
  53023. if (o.o)
  53024. for (var E = o._cachedOutline || (o._cachedOutline = o.o.split(" ")), b = 0, w = E.length; b < w; ) {
  53025. var _ = E[b++];
  53026. switch (_) {
  53027. case "m":
  53028. s = E[b++] * t + r,
  53029. l = E[b++] * t,
  53030. A.moveTo(s, l);
  53031. break;
  53032. case "l":
  53033. s = E[b++] * t + r,
  53034. l = E[b++] * t,
  53035. A.lineTo(s, l);
  53036. break;
  53037. case "q":
  53038. if (c = E[b++] * t + r,
  53039. h = E[b++] * t,
  53040. p = E[b++] * t + r,
  53041. f = E[b++] * t,
  53042. A.quadraticCurveTo(p, f, c, h),
  53043. v = y[y.length - 1]) {
  53044. u = v.x,
  53045. d = v.y;
  53046. for (var T = 1; T <= i; T++) {
  53047. var x = T / i;
  53048. C(x, u, p, c),
  53049. C(x, d, f, h)
  53050. }
  53051. }
  53052. break;
  53053. case "b":
  53054. if (c = E[b++] * t + r,
  53055. h = E[b++] * t,
  53056. p = E[b++] * t + r,
  53057. f = E[b++] * t,
  53058. g = E[b++] * t + r,
  53059. m = E[b++] * t,
  53060. A.bezierCurveTo(p, f, g, m, c, h),
  53061. v = y[y.length - 1]) {
  53062. u = v.x,
  53063. d = v.y;
  53064. for (var T = 1; T <= i; T++) {
  53065. var x = T / i;
  53066. I(x, u, p, g, c),
  53067. I(x, d, f, m, h)
  53068. }
  53069. }
  53070. }
  53071. }
  53072. return {
  53073. offset: o.ha * t,
  53074. path: A
  53075. }
  53076. }
  53077. }
  53078. void 0 === t && (t = 100),
  53079. void 0 === i && (i = 4);
  53080. for (var a = this.data, s = r(e), l = [], c = 0, h = s.length; c < h; c++)
  53081. Array.prototype.push.apply(l, s[c].toShapes());
  53082. return l
  53083. }
  53084. },
  53085. n.Path = function(e) {
  53086. n.CurvePath.call(this),
  53087. this.actions = [],
  53088. e && this.fromPoints(e)
  53089. }
  53090. ,
  53091. n.Path.prototype = Object.create(n.CurvePath.prototype),
  53092. n.Path.prototype.constructor = n.Path,
  53093. n.Path.prototype.fromPoints = function(e) {
  53094. this.moveTo(e[0].x, e[0].y);
  53095. for (var t = 1, i = e.length; t < i; t++)
  53096. this.lineTo(e[t].x, e[t].y)
  53097. }
  53098. ,
  53099. n.Path.prototype.moveTo = function(e, t) {
  53100. this.actions.push({
  53101. action: "moveTo",
  53102. args: [e, t]
  53103. })
  53104. }
  53105. ,
  53106. n.Path.prototype.lineTo = function(e, t) {
  53107. var i = this.actions[this.actions.length - 1].args
  53108. , r = i[i.length - 2]
  53109. , o = i[i.length - 1]
  53110. , a = new n.LineCurve(new n.Vector2(r,o),new n.Vector2(e,t));
  53111. this.curves.push(a),
  53112. this.actions.push({
  53113. action: "lineTo",
  53114. args: [e, t]
  53115. })
  53116. }
  53117. ,
  53118. n.Path.prototype.quadraticCurveTo = function(e, t, i, r) {
  53119. var o = this.actions[this.actions.length - 1].args
  53120. , a = o[o.length - 2]
  53121. , s = o[o.length - 1]
  53122. , l = new n.QuadraticBezierCurve(new n.Vector2(a,s),new n.Vector2(e,t),new n.Vector2(i,r));
  53123. this.curves.push(l),
  53124. this.actions.push({
  53125. action: "quadraticCurveTo",
  53126. args: [e, t, i, r]
  53127. })
  53128. }
  53129. ,
  53130. n.Path.prototype.bezierCurveTo = function(e, t, i, r, o, a) {
  53131. var s = this.actions[this.actions.length - 1].args
  53132. , l = s[s.length - 2]
  53133. , c = s[s.length - 1]
  53134. , h = new n.CubicBezierCurve(new n.Vector2(l,c),new n.Vector2(e,t),new n.Vector2(i,r),new n.Vector2(o,a));
  53135. this.curves.push(h),
  53136. this.actions.push({
  53137. action: "bezierCurveTo",
  53138. args: [e, t, i, r, o, a]
  53139. })
  53140. }
  53141. ,
  53142. n.Path.prototype.splineThru = function(e) {
  53143. var t = Array.prototype.slice.call(arguments)
  53144. , i = this.actions[this.actions.length - 1].args
  53145. , r = i[i.length - 2]
  53146. , o = i[i.length - 1]
  53147. , a = [new n.Vector2(r,o)];
  53148. Array.prototype.push.apply(a, e);
  53149. var s = new n.SplineCurve(a);
  53150. this.curves.push(s),
  53151. this.actions.push({
  53152. action: "splineThru",
  53153. args: t
  53154. })
  53155. }
  53156. ,
  53157. n.Path.prototype.arc = function(e, t, i, n, r, o) {
  53158. var a = this.actions[this.actions.length - 1].args
  53159. , s = a[a.length - 2]
  53160. , l = a[a.length - 1];
  53161. this.absarc(e + s, t + l, i, n, r, o)
  53162. }
  53163. ,
  53164. n.Path.prototype.absarc = function(e, t, i, n, r, o) {
  53165. this.absellipse(e, t, i, i, n, r, o)
  53166. }
  53167. ,
  53168. n.Path.prototype.ellipse = function(e, t, i, n, r, o, a, s) {
  53169. var l = this.actions[this.actions.length - 1].args
  53170. , c = l[l.length - 2]
  53171. , h = l[l.length - 1];
  53172. this.absellipse(e + c, t + h, i, n, r, o, a, s)
  53173. }
  53174. ,
  53175. n.Path.prototype.absellipse = function(e, t, i, r, o, a, s, l) {
  53176. var c = [e, t, i, r, o, a, s, l || 0]
  53177. , h = new n.EllipseCurve(e,t,i,r,o,a,s,l);
  53178. this.curves.push(h);
  53179. var u = h.getPoint(1);
  53180. c.push(u.x),
  53181. c.push(u.y),
  53182. this.actions.push({
  53183. action: "ellipse",
  53184. args: c
  53185. })
  53186. }
  53187. ,
  53188. n.Path.prototype.getSpacedPoints = function(e) {
  53189. e || (e = 40);
  53190. for (var t = [], i = 0; i < e; i++)
  53191. t.push(this.getPoint(i / e));
  53192. return this.autoClose && t.push(t[0]),
  53193. t
  53194. }
  53195. ,
  53196. n.Path.prototype.getPoints = function(e) {
  53197. e = e || 12;
  53198. 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++) {
  53199. var A = this.actions[m]
  53200. , y = A.action
  53201. , C = A.args;
  53202. switch (y) {
  53203. case "moveTo":
  53204. g.push(new n.Vector2(C[0],C[1]));
  53205. break;
  53206. case "lineTo":
  53207. g.push(new n.Vector2(C[0],C[1]));
  53208. break;
  53209. case "quadraticCurveTo":
  53210. t = C[2],
  53211. i = C[3],
  53212. a = C[0],
  53213. s = C[1],
  53214. g.length > 0 ? (h = g[g.length - 1],
  53215. l = h.x,
  53216. c = h.y) : (h = this.actions[m - 1].args,
  53217. l = h[h.length - 2],
  53218. c = h[h.length - 1]);
  53219. for (var I = 1; I <= e; I++) {
  53220. var E = I / e;
  53221. u = p(E, l, a, t),
  53222. d = p(E, c, s, i),
  53223. g.push(new n.Vector2(u,d))
  53224. }
  53225. break;
  53226. case "bezierCurveTo":
  53227. t = C[4],
  53228. i = C[5],
  53229. a = C[0],
  53230. s = C[1],
  53231. r = C[2],
  53232. o = C[3],
  53233. g.length > 0 ? (h = g[g.length - 1],
  53234. l = h.x,
  53235. c = h.y) : (h = this.actions[m - 1].args,
  53236. l = h[h.length - 2],
  53237. c = h[h.length - 1]);
  53238. for (var I = 1; I <= e; I++) {
  53239. var E = I / e;
  53240. u = f(E, l, a, r, t),
  53241. d = f(E, c, s, o, i),
  53242. g.push(new n.Vector2(u,d))
  53243. }
  53244. break;
  53245. case "splineThru":
  53246. h = this.actions[m - 1].args;
  53247. var b = new n.Vector2(h[h.length - 2],h[h.length - 1])
  53248. , w = [b]
  53249. , _ = e * C[0].length;
  53250. w = w.concat(C[0]);
  53251. for (var T = new n.SplineCurve(w), I = 1; I <= _; I++)
  53252. g.push(T.getPointAt(I / _));
  53253. break;
  53254. case "arc":
  53255. 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++) {
  53256. var E = I / N;
  53257. L || (E = 1 - E),
  53258. x = P + E * D,
  53259. u = S + R * Math.cos(x),
  53260. d = M + R * Math.sin(x),
  53261. g.push(new n.Vector2(u,d))
  53262. }
  53263. break;
  53264. case "ellipse":
  53265. 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;
  53266. 0 !== k && (B = Math.cos(k),
  53267. F = Math.sin(k));
  53268. for (var I = 1; I <= N; I++) {
  53269. var E = I / N;
  53270. if (L || (E = 1 - E),
  53271. x = P + E * D,
  53272. u = S + V * Math.cos(x),
  53273. d = M + U * Math.sin(x),
  53274. 0 !== k) {
  53275. var H = u
  53276. , G = d;
  53277. u = (H - S) * B - (G - M) * F + S,
  53278. d = (H - S) * F + (G - M) * B + M
  53279. }
  53280. g.push(new n.Vector2(u,d))
  53281. }
  53282. }
  53283. }
  53284. var z = g[g.length - 1];
  53285. 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),
  53286. this.autoClose && g.push(g[0]),
  53287. g
  53288. }
  53289. ,
  53290. n.Path.prototype.toShapes = function(e, t) {
  53291. function i(e) {
  53292. for (var t = [], i = new n.Path, r = 0, o = e.length; r < o; r++) {
  53293. var a = e[r]
  53294. , s = a.args
  53295. , l = a.action;
  53296. "moveTo" === l && 0 !== i.actions.length && (t.push(i),
  53297. i = new n.Path),
  53298. i[l].apply(i, s)
  53299. }
  53300. return 0 !== i.actions.length && t.push(i),
  53301. t
  53302. }
  53303. function r(e) {
  53304. for (var t = [], i = 0, r = e.length; i < r; i++) {
  53305. var o = e[i]
  53306. , a = new n.Shape;
  53307. a.actions = o.actions,
  53308. a.curves = o.curves,
  53309. t.push(a)
  53310. }
  53311. return t
  53312. }
  53313. function o(e, t) {
  53314. for (var i = t.length, n = !1, r = i - 1, o = 0; o < i; r = o++) {
  53315. var a = t[r]
  53316. , s = t[o]
  53317. , l = s.x - a.x
  53318. , c = s.y - a.y;
  53319. if (Math.abs(c) > Number.EPSILON) {
  53320. if (c < 0 && (a = t[o],
  53321. l = -l,
  53322. s = t[r],
  53323. c = -c),
  53324. e.y < a.y || e.y > s.y)
  53325. continue;
  53326. if (e.y === a.y) {
  53327. if (e.x === a.x)
  53328. return !0
  53329. } else {
  53330. var h = c * (e.x - a.x) - l * (e.y - a.y);
  53331. if (0 === h)
  53332. return !0;
  53333. if (h < 0)
  53334. continue;
  53335. n = !n
  53336. }
  53337. } else {
  53338. if (e.y !== a.y)
  53339. continue;
  53340. if (s.x <= e.x && e.x <= a.x || a.x <= e.x && e.x <= s.x)
  53341. return !0
  53342. }
  53343. }
  53344. return n
  53345. }
  53346. var a = n.ShapeUtils.isClockWise
  53347. , s = i(this.actions);
  53348. if (0 === s.length)
  53349. return [];
  53350. if (t === !0)
  53351. return r(s);
  53352. var l, c, h, u = [];
  53353. if (1 === s.length)
  53354. return c = s[0],
  53355. h = new n.Shape,
  53356. h.actions = c.actions,
  53357. h.curves = c.curves,
  53358. u.push(h),
  53359. u;
  53360. var d = !a(s[0].getPoints());
  53361. d = e ? !d : d;
  53362. var p, f = [], g = [], m = [], v = 0;
  53363. g[v] = void 0,
  53364. m[v] = [];
  53365. for (var A = 0, y = s.length; A < y; A++)
  53366. c = s[A],
  53367. p = c.getPoints(),
  53368. l = a(p),
  53369. l = e ? !l : l,
  53370. l ? (!d && g[v] && v++,
  53371. g[v] = {
  53372. s: new n.Shape,
  53373. p: p
  53374. },
  53375. g[v].s.actions = c.actions,
  53376. g[v].s.curves = c.curves,
  53377. d && v++,
  53378. m[v] = []) : m[v].push({
  53379. h: c,
  53380. p: p[0]
  53381. });
  53382. if (!g[0])
  53383. return r(s);
  53384. if (g.length > 1) {
  53385. for (var C = !1, I = [], E = 0, b = g.length; E < b; E++)
  53386. f[E] = [];
  53387. for (var E = 0, b = g.length; E < b; E++)
  53388. for (var w = m[E], _ = 0; _ < w.length; _++) {
  53389. for (var T = w[_], x = !0, S = 0; S < g.length; S++)
  53390. o(T.p, g[S].p) && (E !== S && I.push({
  53391. froms: E,
  53392. tos: S,
  53393. hole: _
  53394. }),
  53395. x ? (x = !1,
  53396. f[S].push(T)) : C = !0);
  53397. x && f[E].push(T)
  53398. }
  53399. I.length > 0 && (C || (m = f))
  53400. }
  53401. for (var M, A = 0, R = g.length; A < R; A++) {
  53402. h = g[A].s,
  53403. u.push(h),
  53404. M = m[A];
  53405. for (var P = 0, O = M.length; P < O; P++)
  53406. h.holes.push(M[P].h)
  53407. }
  53408. return u
  53409. }
  53410. ,
  53411. n.Shape = function() {
  53412. n.Path.apply(this, arguments),
  53413. this.holes = []
  53414. }
  53415. ,
  53416. n.Shape.prototype = Object.create(n.Path.prototype),
  53417. n.Shape.prototype.constructor = n.Shape,
  53418. n.Shape.prototype.extrude = function(e) {
  53419. return new n.ExtrudeGeometry(this,e)
  53420. }
  53421. ,
  53422. n.Shape.prototype.makeGeometry = function(e) {
  53423. return new n.ShapeGeometry(this,e)
  53424. }
  53425. ,
  53426. n.Shape.prototype.getPointsHoles = function(e) {
  53427. for (var t = [], i = 0, n = this.holes.length; i < n; i++)
  53428. t[i] = this.holes[i].getPoints(e);
  53429. return t
  53430. }
  53431. ,
  53432. n.Shape.prototype.extractAllPoints = function(e) {
  53433. return {
  53434. shape: this.getPoints(e),
  53435. holes: this.getPointsHoles(e)
  53436. }
  53437. }
  53438. ,
  53439. n.Shape.prototype.extractPoints = function(e) {
  53440. return this.extractAllPoints(e)
  53441. }
  53442. ,
  53443. n.LineCurve = function(e, t) {
  53444. this.v1 = e,
  53445. this.v2 = t
  53446. }
  53447. ,
  53448. n.LineCurve.prototype = Object.create(n.Curve.prototype),
  53449. n.LineCurve.prototype.constructor = n.LineCurve,
  53450. n.LineCurve.prototype.getPoint = function(e) {
  53451. var t = this.v2.clone().sub(this.v1);
  53452. return t.multiplyScalar(e).add(this.v1),
  53453. t
  53454. }
  53455. ,
  53456. n.LineCurve.prototype.getPointAt = function(e) {
  53457. return this.getPoint(e)
  53458. }
  53459. ,
  53460. n.LineCurve.prototype.getTangent = function(e) {
  53461. var t = this.v2.clone().sub(this.v1);
  53462. return t.normalize()
  53463. }
  53464. ,
  53465. n.QuadraticBezierCurve = function(e, t, i) {
  53466. this.v0 = e,
  53467. this.v1 = t,
  53468. this.v2 = i
  53469. }
  53470. ,
  53471. n.QuadraticBezierCurve.prototype = Object.create(n.Curve.prototype),
  53472. n.QuadraticBezierCurve.prototype.constructor = n.QuadraticBezierCurve,
  53473. n.QuadraticBezierCurve.prototype.getPoint = function(e) {
  53474. var t = n.ShapeUtils.b2;
  53475. 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))
  53476. }
  53477. ,
  53478. n.QuadraticBezierCurve.prototype.getTangent = function(e) {
  53479. var t = n.CurveUtils.tangentQuadraticBezier;
  53480. 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()
  53481. }
  53482. ,
  53483. n.CubicBezierCurve = function(e, t, i, n) {
  53484. this.v0 = e,
  53485. this.v1 = t,
  53486. this.v2 = i,
  53487. this.v3 = n
  53488. }
  53489. ,
  53490. n.CubicBezierCurve.prototype = Object.create(n.Curve.prototype),
  53491. n.CubicBezierCurve.prototype.constructor = n.CubicBezierCurve,
  53492. n.CubicBezierCurve.prototype.getPoint = function(e) {
  53493. var t = n.ShapeUtils.b3;
  53494. 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))
  53495. }
  53496. ,
  53497. n.CubicBezierCurve.prototype.getTangent = function(e) {
  53498. var t = n.CurveUtils.tangentCubicBezier;
  53499. 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()
  53500. }
  53501. ,
  53502. n.SplineCurve = function(e) {
  53503. this.points = void 0 == e ? [] : e
  53504. }
  53505. ,
  53506. n.SplineCurve.prototype = Object.create(n.Curve.prototype),
  53507. n.SplineCurve.prototype.constructor = n.SplineCurve,
  53508. n.SplineCurve.prototype.getPoint = function(e) {
  53509. var t = this.points
  53510. , i = (t.length - 1) * e
  53511. , r = Math.floor(i)
  53512. , o = i - r
  53513. , a = t[0 === r ? r : r - 1]
  53514. , s = t[r]
  53515. , l = t[r > t.length - 2 ? t.length - 1 : r + 1]
  53516. , c = t[r > t.length - 3 ? t.length - 1 : r + 2]
  53517. , h = n.CurveUtils.interpolate;
  53518. return new n.Vector2(h(a.x, s.x, l.x, c.x, o),h(a.y, s.y, l.y, c.y, o))
  53519. }
  53520. ,
  53521. n.EllipseCurve = function(e, t, i, n, r, o, a, s) {
  53522. this.aX = e,
  53523. this.aY = t,
  53524. this.xRadius = i,
  53525. this.yRadius = n,
  53526. this.aStartAngle = r,
  53527. this.aEndAngle = o,
  53528. this.aClockwise = a,
  53529. this.aRotation = s || 0
  53530. }
  53531. ,
  53532. n.EllipseCurve.prototype = Object.create(n.Curve.prototype),
  53533. n.EllipseCurve.prototype.constructor = n.EllipseCurve,
  53534. n.EllipseCurve.prototype.getPoint = function(e) {
  53535. var t = this.aEndAngle - this.aStartAngle;
  53536. t < 0 && (t += 2 * Math.PI),
  53537. t > 2 * Math.PI && (t -= 2 * Math.PI);
  53538. var i;
  53539. i = this.aClockwise === !0 ? this.aEndAngle + (1 - e) * (2 * Math.PI - t) : this.aStartAngle + e * t;
  53540. var r = this.aX + this.xRadius * Math.cos(i)
  53541. , o = this.aY + this.yRadius * Math.sin(i);
  53542. if (0 !== this.aRotation) {
  53543. var a = Math.cos(this.aRotation)
  53544. , s = Math.sin(this.aRotation)
  53545. , l = r
  53546. , c = o;
  53547. r = (l - this.aX) * a - (c - this.aY) * s + this.aX,
  53548. o = (l - this.aX) * s + (c - this.aY) * a + this.aY
  53549. }
  53550. return new n.Vector2(r,o)
  53551. }
  53552. ,
  53553. n.ArcCurve = function(e, t, i, r, o, a) {
  53554. n.EllipseCurve.call(this, e, t, i, i, r, o, a)
  53555. }
  53556. ,
  53557. n.ArcCurve.prototype = Object.create(n.EllipseCurve.prototype),
  53558. n.ArcCurve.prototype.constructor = n.ArcCurve,
  53559. n.LineCurve3 = n.Curve.create(function(e, t) {
  53560. this.v1 = e,
  53561. this.v2 = t
  53562. }, function(e) {
  53563. var t = new n.Vector3;
  53564. return t.subVectors(this.v2, this.v1),
  53565. t.multiplyScalar(e),
  53566. t.add(this.v1),
  53567. t
  53568. }),
  53569. n.QuadraticBezierCurve3 = n.Curve.create(function(e, t, i) {
  53570. this.v0 = e,
  53571. this.v1 = t,
  53572. this.v2 = i
  53573. }, function(e) {
  53574. var t = n.ShapeUtils.b2;
  53575. 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))
  53576. }),
  53577. n.CubicBezierCurve3 = n.Curve.create(function(e, t, i, n) {
  53578. this.v0 = e,
  53579. this.v1 = t,
  53580. this.v2 = i,
  53581. this.v3 = n
  53582. }, function(e) {
  53583. var t = n.ShapeUtils.b3;
  53584. 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))
  53585. }),
  53586. n.SplineCurve3 = n.Curve.create(function(e) {
  53587. console.warn("THREE.SplineCurve3 will be deprecated. Please use THREE.CatmullRomCurve3"),
  53588. this.points = void 0 == e ? [] : e
  53589. }, function(e) {
  53590. var t = this.points
  53591. , i = (t.length - 1) * e
  53592. , r = Math.floor(i)
  53593. , o = i - r
  53594. , a = t[0 == r ? r : r - 1]
  53595. , s = t[r]
  53596. , l = t[r > t.length - 2 ? t.length - 1 : r + 1]
  53597. , c = t[r > t.length - 3 ? t.length - 1 : r + 2]
  53598. , h = n.CurveUtils.interpolate;
  53599. 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))
  53600. }),
  53601. n.CatmullRomCurve3 = function() {
  53602. function e() {}
  53603. var t = new n.Vector3
  53604. , i = new e
  53605. , r = new e
  53606. , o = new e;
  53607. return e.prototype.init = function(e, t, i, n) {
  53608. this.c0 = e,
  53609. this.c1 = i,
  53610. this.c2 = -3 * e + 3 * t - 2 * i - n,
  53611. this.c3 = 2 * e - 2 * t + i + n
  53612. }
  53613. ,
  53614. e.prototype.initNonuniformCatmullRom = function(e, t, i, n, r, o, a) {
  53615. var s = (t - e) / r - (i - e) / (r + o) + (i - t) / o
  53616. , l = (i - t) / o - (n - t) / (o + a) + (n - i) / a;
  53617. s *= o,
  53618. l *= o,
  53619. this.init(t, i, s, l)
  53620. }
  53621. ,
  53622. e.prototype.initCatmullRom = function(e, t, i, n, r) {
  53623. this.init(t, i, r * (i - e), r * (n - t))
  53624. }
  53625. ,
  53626. e.prototype.calc = function(e) {
  53627. var t = e * e
  53628. , i = t * e;
  53629. return this.c0 + this.c1 * e + this.c2 * t + this.c3 * i
  53630. }
  53631. ,
  53632. n.Curve.create(function(e) {
  53633. this.points = e || [],
  53634. this.closed = !1
  53635. }, function(e) {
  53636. var a, s, l, c, h = this.points;
  53637. c = h.length,
  53638. c < 2 && console.log("duh, you need at least 2 points"),
  53639. a = (c - (this.closed ? 0 : 1)) * e,
  53640. s = Math.floor(a),
  53641. l = a - s,
  53642. this.closed ? s += s > 0 ? 0 : (Math.floor(Math.abs(s) / h.length) + 1) * h.length : 0 === l && s === c - 1 && (s = c - 2,
  53643. l = 1);
  53644. var u, d, p, f;
  53645. if (this.closed || s > 0 ? u = h[(s - 1) % c] : (t.subVectors(h[0], h[1]).add(h[0]),
  53646. u = t),
  53647. d = h[s % c],
  53648. p = h[(s + 1) % c],
  53649. this.closed || s + 2 < c ? f = h[(s + 2) % c] : (t.subVectors(h[c - 1], h[c - 2]).add(h[c - 1]),
  53650. f = t),
  53651. void 0 === this.type || "centripetal" === this.type || "chordal" === this.type) {
  53652. var g = "chordal" === this.type ? .5 : .25
  53653. , m = Math.pow(u.distanceToSquared(d), g)
  53654. , v = Math.pow(d.distanceToSquared(p), g)
  53655. , A = Math.pow(p.distanceToSquared(f), g);
  53656. v < 1e-4 && (v = 1),
  53657. m < 1e-4 && (m = v),
  53658. A < 1e-4 && (A = v),
  53659. i.initNonuniformCatmullRom(u.x, d.x, p.x, f.x, m, v, A),
  53660. r.initNonuniformCatmullRom(u.y, d.y, p.y, f.y, m, v, A),
  53661. o.initNonuniformCatmullRom(u.z, d.z, p.z, f.z, m, v, A)
  53662. } else if ("catmullrom" === this.type) {
  53663. var y = void 0 !== this.tension ? this.tension : .5;
  53664. i.initCatmullRom(u.x, d.x, p.x, f.x, y),
  53665. r.initCatmullRom(u.y, d.y, p.y, f.y, y),
  53666. o.initCatmullRom(u.z, d.z, p.z, f.z, y)
  53667. }
  53668. var C = new n.Vector3(i.calc(l),r.calc(l),o.calc(l));
  53669. return C
  53670. })
  53671. }(),
  53672. n.ClosedSplineCurve3 = function(e) {
  53673. console.warn("THREE.ClosedSplineCurve3 has been deprecated. Please use THREE.CatmullRomCurve3."),
  53674. n.CatmullRomCurve3.call(this, e),
  53675. this.type = "catmullrom",
  53676. this.closed = !0
  53677. }
  53678. ,
  53679. n.ClosedSplineCurve3.prototype = Object.create(n.CatmullRomCurve3.prototype),
  53680. n.BoxGeometry = function(e, t, i, r, o, a) {
  53681. n.Geometry.call(this),
  53682. this.type = "BoxGeometry",
  53683. this.parameters = {
  53684. width: e,
  53685. height: t,
  53686. depth: i,
  53687. widthSegments: r,
  53688. heightSegments: o,
  53689. depthSegments: a
  53690. },
  53691. this.fromBufferGeometry(new n.BoxBufferGeometry(e,t,i,r,o,a)),
  53692. this.mergeVertices()
  53693. }
  53694. ,
  53695. n.BoxGeometry.prototype = Object.create(n.Geometry.prototype),
  53696. n.BoxGeometry.prototype.constructor = n.BoxGeometry,
  53697. n.CubeGeometry = n.BoxGeometry,
  53698. n.BoxBufferGeometry = function(e, t, i, r, o, a) {
  53699. function s(e, t, i) {
  53700. var n = 0;
  53701. return n += e * t * 2,
  53702. n += e * i * 2,
  53703. n += i * t * 2,
  53704. 4 * n
  53705. }
  53706. function l(e, t, i, r, o, a, s, l, h, u, I) {
  53707. 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++)
  53708. for (var L = O * b - _, D = 0; D < x; D++) {
  53709. var N = D * E - w;
  53710. P[e] = N * r,
  53711. P[t] = L * o,
  53712. P[i] = T,
  53713. p[m] = P.x,
  53714. p[m + 1] = P.y,
  53715. p[m + 2] = P.z,
  53716. P[e] = 0,
  53717. P[t] = 0,
  53718. P[i] = l > 0 ? 1 : -1,
  53719. f[m] = P.x,
  53720. f[m + 1] = P.y,
  53721. f[m + 2] = P.z,
  53722. g[v] = D / h,
  53723. g[v + 1] = 1 - O / u,
  53724. m += 3,
  53725. v += 2,
  53726. M += 1
  53727. }
  53728. for (O = 0; O < u; O++)
  53729. for (D = 0; D < h; D++) {
  53730. var B = y + D + x * O
  53731. , F = y + D + x * (O + 1)
  53732. , V = y + (D + 1) + x * (O + 1)
  53733. , U = y + (D + 1) + x * O;
  53734. d[A] = B,
  53735. d[A + 1] = F,
  53736. d[A + 2] = U,
  53737. d[A + 3] = F,
  53738. d[A + 4] = V,
  53739. d[A + 5] = U,
  53740. A += 6,
  53741. R += 6
  53742. }
  53743. c.addGroup(C, R, I),
  53744. C += R,
  53745. y += M
  53746. }
  53747. n.BufferGeometry.call(this),
  53748. this.type = "BoxBufferGeometry",
  53749. this.parameters = {
  53750. width: e,
  53751. height: t,
  53752. depth: i,
  53753. widthSegments: r,
  53754. heightSegments: o,
  53755. depthSegments: a
  53756. };
  53757. var c = this;
  53758. r = Math.floor(r) || 1,
  53759. o = Math.floor(o) || 1,
  53760. a = Math.floor(a) || 1;
  53761. var h = s(r, o, a)
  53762. , u = h / 4 * 6
  53763. , d = new (u > 65535 ? Uint32Array : Uint16Array)(u)
  53764. , p = new Float32Array(3 * h)
  53765. , f = new Float32Array(3 * h)
  53766. , g = new Float32Array(2 * h)
  53767. , m = 0
  53768. , v = 0
  53769. , A = 0
  53770. , y = 0
  53771. , C = 0;
  53772. l("z", "y", "x", -1, -1, i, t, e, a, o, 0),
  53773. l("z", "y", "x", 1, -1, i, t, -e, a, o, 1),
  53774. l("x", "z", "y", 1, 1, e, i, t, r, a, 2),
  53775. l("x", "z", "y", 1, -1, e, i, -t, r, a, 3),
  53776. l("x", "y", "z", 1, -1, e, t, i, r, o, 4),
  53777. l("x", "y", "z", -1, -1, e, t, -i, r, o, 5),
  53778. this.setIndex(new n.BufferAttribute(d,1)),
  53779. this.addAttribute("position", new n.BufferAttribute(p,3)),
  53780. this.addAttribute("normal", new n.BufferAttribute(f,3)),
  53781. this.addAttribute("uv", new n.BufferAttribute(g,2))
  53782. }
  53783. ,
  53784. n.BoxBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  53785. n.BoxBufferGeometry.prototype.constructor = n.BoxBufferGeometry,
  53786. n.CircleGeometry = function(e, t, i, r) {
  53787. n.Geometry.call(this),
  53788. this.type = "CircleGeometry",
  53789. this.parameters = {
  53790. radius: e,
  53791. segments: t,
  53792. thetaStart: i,
  53793. thetaLength: r
  53794. },
  53795. this.fromBufferGeometry(new n.CircleBufferGeometry(e,t,i,r))
  53796. }
  53797. ,
  53798. n.CircleGeometry.prototype = Object.create(n.Geometry.prototype),
  53799. n.CircleGeometry.prototype.constructor = n.CircleGeometry,
  53800. n.CircleBufferGeometry = function(e, t, i, r) {
  53801. n.BufferGeometry.call(this),
  53802. this.type = "CircleBufferGeometry",
  53803. this.parameters = {
  53804. radius: e,
  53805. segments: t,
  53806. thetaStart: i,
  53807. thetaLength: r
  53808. },
  53809. e = e || 50,
  53810. t = void 0 !== t ? Math.max(3, t) : 8,
  53811. i = void 0 !== i ? i : 0,
  53812. r = void 0 !== r ? r : 2 * Math.PI;
  53813. var o = t + 2
  53814. , a = new Float32Array(3 * o)
  53815. , s = new Float32Array(3 * o)
  53816. , l = new Float32Array(2 * o);
  53817. s[2] = 1,
  53818. l[0] = .5,
  53819. l[1] = .5;
  53820. for (var c = 0, h = 3, u = 2; c <= t; c++,
  53821. h += 3,
  53822. u += 2) {
  53823. var d = i + c / t * r;
  53824. a[h] = e * Math.cos(d),
  53825. a[h + 1] = e * Math.sin(d),
  53826. s[h + 2] = 1,
  53827. l[u] = (a[h] / e + 1) / 2,
  53828. l[u + 1] = (a[h + 1] / e + 1) / 2
  53829. }
  53830. for (var p = [], h = 1; h <= t; h++)
  53831. p.push(h, h + 1, 0);
  53832. this.setIndex(new n.BufferAttribute(new Uint16Array(p),1)),
  53833. this.addAttribute("position", new n.BufferAttribute(a,3)),
  53834. this.addAttribute("normal", new n.BufferAttribute(s,3)),
  53835. this.addAttribute("uv", new n.BufferAttribute(l,2)),
  53836. this.boundingSphere = new n.Sphere(new n.Vector3,e)
  53837. }
  53838. ,
  53839. n.CircleBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  53840. n.CircleBufferGeometry.prototype.constructor = n.CircleBufferGeometry,
  53841. n.CylinderBufferGeometry = function(e, t, i, r, o, a, s, l) {
  53842. function c() {
  53843. var e = (r + 1) * (o + 1);
  53844. return a === !1 && (e += 2 * (r + 1) + 2 * r),
  53845. e
  53846. }
  53847. function h() {
  53848. var e = r * o * 2 * 3;
  53849. return a === !1 && (e += 2 * r * 3),
  53850. e
  53851. }
  53852. function u() {
  53853. var a, c, h = new n.Vector3, u = new n.Vector3, d = (t - e) / i;
  53854. for (c = 0; c <= o; c++) {
  53855. var p = []
  53856. , f = c / o
  53857. , b = f * (t - e) + e;
  53858. for (a = 0; a <= r; a++) {
  53859. var w = a / r;
  53860. u.x = b * Math.sin(w * l + s),
  53861. u.y = -f * i + E,
  53862. u.z = b * Math.cos(w * l + s),
  53863. m.setXYZ(y, u.x, u.y, u.z),
  53864. h.copy(u),
  53865. (0 === e && 0 === c || 0 === t && c === o) && (h.x = Math.sin(w * l + s),
  53866. h.z = Math.cos(w * l + s)),
  53867. h.setY(Math.sqrt(h.x * h.x + h.z * h.z) * d).normalize(),
  53868. v.setXYZ(y, h.x, h.y, h.z),
  53869. A.setXY(y, w, 1 - f),
  53870. p.push(y),
  53871. y++
  53872. }
  53873. I.push(p)
  53874. }
  53875. for (a = 0; a < r; a++)
  53876. for (c = 0; c < o; c++) {
  53877. var _ = I[c][a]
  53878. , T = I[c + 1][a]
  53879. , x = I[c + 1][a + 1]
  53880. , S = I[c][a + 1];
  53881. g.setX(C, _),
  53882. C++,
  53883. g.setX(C, T),
  53884. C++,
  53885. g.setX(C, S),
  53886. C++,
  53887. g.setX(C, T),
  53888. C++,
  53889. g.setX(C, x),
  53890. C++,
  53891. g.setX(C, S),
  53892. C++
  53893. }
  53894. }
  53895. function d(i) {
  53896. var o, a, c, h = new n.Vector2, u = new n.Vector3, d = i === !0 ? e : t, p = i === !0 ? 1 : -1;
  53897. for (a = y,
  53898. o = 1; o <= r; o++)
  53899. m.setXYZ(y, 0, E * p, 0),
  53900. v.setXYZ(y, 0, p, 0),
  53901. i === !0 ? (h.x = o / r,
  53902. h.y = 0) : (h.x = (o - 1) / r,
  53903. h.y = 1),
  53904. A.setXY(y, h.x, h.y),
  53905. y++;
  53906. for (c = y,
  53907. o = 0; o <= r; o++) {
  53908. var f = o / r;
  53909. u.x = d * Math.sin(f * l + s),
  53910. u.y = E * p,
  53911. u.z = d * Math.cos(f * l + s),
  53912. m.setXYZ(y, u.x, u.y, u.z),
  53913. v.setXYZ(y, 0, p, 0),
  53914. A.setXY(y, f, i === !0 ? 1 : 0),
  53915. y++
  53916. }
  53917. for (o = 0; o < r; o++) {
  53918. var I = a + o
  53919. , b = c + o;
  53920. i === !0 ? (g.setX(C, b),
  53921. C++,
  53922. g.setX(C, b + 1),
  53923. C++,
  53924. g.setX(C, I),
  53925. C++) : (g.setX(C, b + 1),
  53926. C++,
  53927. g.setX(C, b),
  53928. C++,
  53929. g.setX(C, I),
  53930. C++)
  53931. }
  53932. }
  53933. n.BufferGeometry.call(this),
  53934. this.type = "CylinderBufferGeometry",
  53935. this.parameters = {
  53936. radiusTop: e,
  53937. radiusBottom: t,
  53938. height: i,
  53939. radialSegments: r,
  53940. heightSegments: o,
  53941. openEnded: a,
  53942. thetaStart: s,
  53943. thetaLength: l
  53944. },
  53945. e = void 0 !== e ? e : 20,
  53946. t = void 0 !== t ? t : 20,
  53947. i = void 0 !== i ? i : 100,
  53948. r = Math.floor(r) || 8,
  53949. o = Math.floor(o) || 1,
  53950. a = void 0 !== a && a,
  53951. s = void 0 !== s ? s : 0,
  53952. l = void 0 !== l ? l : 2 * Math.PI;
  53953. var p = c()
  53954. , f = h()
  53955. , g = new n.BufferAttribute(new (f > 65535 ? Uint32Array : Uint16Array)(f),1)
  53956. , m = new n.BufferAttribute(new Float32Array(3 * p),3)
  53957. , v = new n.BufferAttribute(new Float32Array(3 * p),3)
  53958. , A = new n.BufferAttribute(new Float32Array(2 * p),2)
  53959. , y = 0
  53960. , C = 0
  53961. , I = []
  53962. , E = i / 2;
  53963. u(),
  53964. a === !1 && (e > 0 && d(!0),
  53965. t > 0 && d(!1)),
  53966. this.setIndex(g),
  53967. this.addAttribute("position", m),
  53968. this.addAttribute("normal", v),
  53969. this.addAttribute("uv", A)
  53970. }
  53971. ,
  53972. n.CylinderBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  53973. n.CylinderBufferGeometry.prototype.constructor = n.CylinderBufferGeometry,
  53974. n.CylinderGeometry = function(e, t, i, r, o, a, s, l) {
  53975. n.Geometry.call(this),
  53976. this.type = "CylinderGeometry",
  53977. this.parameters = {
  53978. radiusTop: e,
  53979. radiusBottom: t,
  53980. height: i,
  53981. radialSegments: r,
  53982. heightSegments: o,
  53983. openEnded: a,
  53984. thetaStart: s,
  53985. thetaLength: l
  53986. },
  53987. this.fromBufferGeometry(new n.CylinderBufferGeometry(e,t,i,r,o,a,s,l)),
  53988. this.mergeVertices()
  53989. }
  53990. ,
  53991. n.CylinderGeometry.prototype = Object.create(n.Geometry.prototype),
  53992. n.CylinderGeometry.prototype.constructor = n.CylinderGeometry,
  53993. n.EdgesGeometry = function(e, t) {
  53994. function i(e, t) {
  53995. return e - t
  53996. }
  53997. n.BufferGeometry.call(this),
  53998. t = void 0 !== t ? t : 1;
  53999. var r, o = Math.cos(n.Math.degToRad(t)), a = [0, 0], s = {}, l = ["a", "b", "c"];
  54000. e instanceof n.BufferGeometry ? (r = new n.Geometry,
  54001. r.fromBufferGeometry(e)) : r = e.clone(),
  54002. r.mergeVertices(),
  54003. r.computeFaceNormals();
  54004. for (var c = r.vertices, h = r.faces, u = 0, d = h.length; u < d; u++)
  54005. for (var p = h[u], f = 0; f < 3; f++) {
  54006. a[0] = p[l[f]],
  54007. a[1] = p[l[(f + 1) % 3]],
  54008. a.sort(i);
  54009. var g = a.toString();
  54010. void 0 === s[g] ? s[g] = {
  54011. vert1: a[0],
  54012. vert2: a[1],
  54013. face1: u,
  54014. face2: void 0
  54015. } : s[g].face2 = u
  54016. }
  54017. var m = [];
  54018. for (var g in s) {
  54019. var v = s[g];
  54020. if (void 0 === v.face2 || h[v.face1].normal.dot(h[v.face2].normal) <= o) {
  54021. var A = c[v.vert1];
  54022. m.push(A.x),
  54023. m.push(A.y),
  54024. m.push(A.z),
  54025. A = c[v.vert2],
  54026. m.push(A.x),
  54027. m.push(A.y),
  54028. m.push(A.z)
  54029. }
  54030. }
  54031. this.addAttribute("position", new n.BufferAttribute(new Float32Array(m),3))
  54032. }
  54033. ,
  54034. n.EdgesGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  54035. n.EdgesGeometry.prototype.constructor = n.EdgesGeometry,
  54036. n.ExtrudeGeometry = function(e, t) {
  54037. return "undefined" == typeof e ? void (e = []) : (n.Geometry.call(this),
  54038. this.type = "ExtrudeGeometry",
  54039. e = Array.isArray(e) ? e : [e],
  54040. this.addShapeList(e, t),
  54041. void this.computeFaceNormals())
  54042. }
  54043. ;
  54044. n.ExtrudeGeometry.prototype = Object.create(n.Geometry.prototype);
  54045. n.ExtrudeGeometry.prototype.constructor = n.ExtrudeGeometry,
  54046. n.ExtrudeGeometry.prototype.addShapeList = function(e, t) {
  54047. for (var i = e.length, n = 0; n < i; n++) {
  54048. var r = e[n];
  54049. this.addShape(r, t)
  54050. }
  54051. }
  54052. ,
  54053. n.ExtrudeGeometry.prototype.addShape = function(e, t) {
  54054. function i(e, t, i) {
  54055. return t || console.error("THREE.ExtrudeGeometry: vec does not exist"),
  54056. t.clone().multiplyScalar(i).add(e)
  54057. }
  54058. function r(e, t, i) {
  54059. 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;
  54060. if (Math.abs(d) > Number.EPSILON) {
  54061. var p = Math.sqrt(u)
  54062. , f = Math.sqrt(c * c + h * h)
  54063. , g = t.x - l / p
  54064. , m = t.y + s / p
  54065. , v = i.x - h / f
  54066. , A = i.y + c / f
  54067. , y = ((v - g) * h - (A - m) * c) / (s * h - l * c);
  54068. r = g + s * y - e.x,
  54069. o = m + l * y - e.y;
  54070. var C = r * r + o * o;
  54071. if (C <= 2)
  54072. return new n.Vector2(r,o);
  54073. a = Math.sqrt(C / 2)
  54074. } else {
  54075. var I = !1;
  54076. s > Number.EPSILON ? c > Number.EPSILON && (I = !0) : s < -Number.EPSILON ? c < -Number.EPSILON && (I = !0) : Math.sign(l) === Math.sign(h) && (I = !0),
  54077. I ? (r = -l,
  54078. o = s,
  54079. a = Math.sqrt(u)) : (r = s,
  54080. o = l,
  54081. a = Math.sqrt(u / 2))
  54082. }
  54083. return new n.Vector2(r / a,o / a)
  54084. }
  54085. function o() {
  54086. if (C) {
  54087. var e = 0
  54088. , t = z * e;
  54089. for (Y = 0; Y < W; Y++)
  54090. G = N[Y],
  54091. c(G[2] + t, G[1] + t, G[0] + t);
  54092. for (e = E + 2 * y,
  54093. t = z * e,
  54094. Y = 0; Y < W; Y++)
  54095. G = N[Y],
  54096. c(G[0] + t, G[1] + t, G[2] + t)
  54097. } else {
  54098. for (Y = 0; Y < W; Y++)
  54099. G = N[Y],
  54100. c(G[2], G[1], G[0]);
  54101. for (Y = 0; Y < W; Y++)
  54102. G = N[Y],
  54103. c(G[0] + z * E, G[1] + z * E, G[2] + z * E)
  54104. }
  54105. }
  54106. function a() {
  54107. var e = 0;
  54108. for (s(B, e),
  54109. e += B.length,
  54110. x = 0,
  54111. S = L.length; x < S; x++)
  54112. T = L[x],
  54113. s(T, e),
  54114. e += T.length
  54115. }
  54116. function s(e, t) {
  54117. var i, n;
  54118. for (Y = e.length; --Y >= 0; ) {
  54119. i = Y,
  54120. n = Y - 1,
  54121. n < 0 && (n = e.length - 1);
  54122. var r = 0
  54123. , o = E + 2 * y;
  54124. for (r = 0; r < o; r++) {
  54125. var a = z * r
  54126. , s = z * (r + 1)
  54127. , l = t + i + a
  54128. , c = t + n + a
  54129. , u = t + n + s
  54130. , d = t + i + s;
  54131. h(l, c, u, d, e, r, o, i, n)
  54132. }
  54133. }
  54134. }
  54135. function l(e, t, i) {
  54136. M.vertices.push(new n.Vector3(e,t,i))
  54137. }
  54138. function c(e, t, i) {
  54139. e += R,
  54140. t += R,
  54141. i += R,
  54142. M.faces.push(new n.Face3(e,t,i,null,null,0));
  54143. var r = _.generateTopUV(M, e, t, i);
  54144. M.faceVertexUvs[0].push(r)
  54145. }
  54146. function h(e, t, i, r, o, a, s, l, c) {
  54147. e += R,
  54148. t += R,
  54149. i += R,
  54150. r += R,
  54151. M.faces.push(new n.Face3(e,t,r,null,null,1)),
  54152. M.faces.push(new n.Face3(t,i,r,null,null,1));
  54153. var h = _.generateSideWallUV(M, e, t, i, r);
  54154. M.faceVertexUvs[0].push([h[0], h[1], h[3]]),
  54155. M.faceVertexUvs[0].push([h[1], h[2], h[3]])
  54156. }
  54157. 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;
  54158. b && (u = b.getSpacedPoints(E),
  54159. w = !0,
  54160. C = !1,
  54161. d = void 0 !== t.frames ? t.frames : new n.TubeGeometry.FrenetFrames(b,E,!1),
  54162. p = new n.Vector3,
  54163. f = new n.Vector3,
  54164. g = new n.Vector3),
  54165. C || (y = 0,
  54166. v = 0,
  54167. A = 0);
  54168. 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);
  54169. if (D) {
  54170. for (O = O.reverse(),
  54171. x = 0,
  54172. S = L.length; x < S; x++)
  54173. T = L[x],
  54174. n.ShapeUtils.isClockWise(T) && (L[x] = T.reverse());
  54175. D = !1
  54176. }
  54177. var N = n.ShapeUtils.triangulateShape(O, L)
  54178. , B = O;
  54179. for (x = 0,
  54180. S = L.length; x < S; x++)
  54181. T = L[x],
  54182. O = O.concat(T);
  54183. 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++,
  54184. Z++,
  54185. q++)
  54186. Z === X && (Z = 0),
  54187. q === X && (q = 0),
  54188. j[Y] = r(B[Y], B[Z], B[q]);
  54189. var K, Q = [], J = j.concat();
  54190. for (x = 0,
  54191. S = L.length; x < S; x++) {
  54192. for (T = L[x],
  54193. K = [],
  54194. Y = 0,
  54195. X = T.length,
  54196. Z = X - 1,
  54197. q = Y + 1; Y < X; Y++,
  54198. Z++,
  54199. q++)
  54200. Z === X && (Z = 0),
  54201. q === X && (q = 0),
  54202. K[Y] = r(T[Y], T[Z], T[q]);
  54203. Q.push(K),
  54204. J = J.concat(K)
  54205. }
  54206. for (F = 0; F < y; F++) {
  54207. for (U = F / y,
  54208. k = v * (1 - U),
  54209. V = A * Math.sin(U * Math.PI / 2),
  54210. Y = 0,
  54211. X = B.length; Y < X; Y++)
  54212. H = i(B[Y], j[Y], V),
  54213. l(H.x, H.y, -k);
  54214. for (x = 0,
  54215. S = L.length; x < S; x++)
  54216. for (T = L[x],
  54217. K = Q[x],
  54218. Y = 0,
  54219. X = T.length; Y < X; Y++)
  54220. H = i(T[Y], K[Y], V),
  54221. l(H.x, H.y, -k)
  54222. }
  54223. for (V = A,
  54224. Y = 0; Y < z; Y++)
  54225. H = C ? i(O[Y], J[Y], V) : O[Y],
  54226. w ? (f.copy(d.normals[0]).multiplyScalar(H.x),
  54227. p.copy(d.binormals[0]).multiplyScalar(H.y),
  54228. g.copy(u[0]).add(f).add(p),
  54229. l(g.x, g.y, g.z)) : l(H.x, H.y, 0);
  54230. var $;
  54231. for ($ = 1; $ <= E; $++)
  54232. for (Y = 0; Y < z; Y++)
  54233. H = C ? i(O[Y], J[Y], V) : O[Y],
  54234. w ? (f.copy(d.normals[$]).multiplyScalar(H.x),
  54235. p.copy(d.binormals[$]).multiplyScalar(H.y),
  54236. g.copy(u[$]).add(f).add(p),
  54237. l(g.x, g.y, g.z)) : l(H.x, H.y, m / E * $);
  54238. for (F = y - 1; F >= 0; F--) {
  54239. for (U = F / y,
  54240. k = v * (1 - U),
  54241. V = A * Math.sin(U * Math.PI / 2),
  54242. Y = 0,
  54243. X = B.length; Y < X; Y++)
  54244. H = i(B[Y], j[Y], V),
  54245. l(H.x, H.y, m + k);
  54246. for (x = 0,
  54247. S = L.length; x < S; x++)
  54248. for (T = L[x],
  54249. K = Q[x],
  54250. Y = 0,
  54251. X = T.length; Y < X; Y++)
  54252. H = i(T[Y], K[Y], V),
  54253. w ? l(H.x, H.y + u[E - 1].y, u[E - 1].x + k) : l(H.x, H.y, m + k)
  54254. }
  54255. o(),
  54256. a()
  54257. }
  54258. ,
  54259. n.ExtrudeGeometry.WorldUVGenerator = {
  54260. generateTopUV: function(e, t, i, r) {
  54261. var o = e.vertices
  54262. , a = o[t]
  54263. , s = o[i]
  54264. , l = o[r];
  54265. return [new n.Vector2(a.x,a.y), new n.Vector2(s.x,s.y), new n.Vector2(l.x,l.y)]
  54266. },
  54267. generateSideWallUV: function(e, t, i, r, o) {
  54268. var a = e.vertices
  54269. , s = a[t]
  54270. , l = a[i]
  54271. , c = a[r]
  54272. , h = a[o];
  54273. 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)]
  54274. }
  54275. },
  54276. n.ShapeGeometry = function(e, t) {
  54277. n.Geometry.call(this),
  54278. this.type = "ShapeGeometry",
  54279. Array.isArray(e) === !1 && (e = [e]),
  54280. this.addShapeList(e, t),
  54281. this.computeFaceNormals()
  54282. }
  54283. ,
  54284. n.ShapeGeometry.prototype = Object.create(n.Geometry.prototype),
  54285. n.ShapeGeometry.prototype.constructor = n.ShapeGeometry,
  54286. n.ShapeGeometry.prototype.addShapeList = function(e, t) {
  54287. for (var i = 0, n = e.length; i < n; i++)
  54288. this.addShape(e[i], t);
  54289. return this
  54290. }
  54291. ,
  54292. n.ShapeGeometry.prototype.addShape = function(e, t) {
  54293. void 0 === t && (t = {});
  54294. 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);
  54295. if (p) {
  54296. for (u = u.reverse(),
  54297. i = 0,
  54298. r = d.length; i < r; i++)
  54299. o = d[i],
  54300. n.ShapeUtils.isClockWise(o) && (d[i] = o.reverse());
  54301. p = !1
  54302. }
  54303. var f = n.ShapeUtils.triangulateShape(u, d);
  54304. for (i = 0,
  54305. r = d.length; i < r; i++)
  54306. o = d[i],
  54307. u = u.concat(o);
  54308. var g, m, v = u.length, A = f.length;
  54309. for (i = 0; i < v; i++)
  54310. g = u[i],
  54311. this.vertices.push(new n.Vector3(g.x,g.y,0));
  54312. for (i = 0; i < A; i++) {
  54313. m = f[i];
  54314. var y = m[0] + c
  54315. , C = m[1] + c
  54316. , I = m[2] + c;
  54317. this.faces.push(new n.Face3(y,C,I,null,null,s)),
  54318. this.faceVertexUvs[0].push(l.generateTopUV(this, y, C, I))
  54319. }
  54320. }
  54321. ,
  54322. n.LatheBufferGeometry = function(e, t, i, r) {
  54323. n.BufferGeometry.call(this),
  54324. this.type = "LatheBufferGeometry",
  54325. this.parameters = {
  54326. points: e,
  54327. segments: t,
  54328. phiStart: i,
  54329. phiLength: r
  54330. },
  54331. t = Math.floor(t) || 12,
  54332. i = i || 0,
  54333. r = r || 2 * Math.PI,
  54334. r = n.Math.clamp(r, 0, 2 * Math.PI);
  54335. 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),
  54336. 1 / t), m = new n.Vector3, v = new n.Vector2;
  54337. for (a = 0; a <= t; a++) {
  54338. var A = i + a * g * r
  54339. , y = Math.sin(A)
  54340. , C = Math.cos(A);
  54341. for (s = 0; s <= e.length - 1; s++)
  54342. m.x = e[s].x * y,
  54343. m.y = e[s].y,
  54344. m.z = e[s].x * C,
  54345. u.setXYZ(p, m.x, m.y, m.z),
  54346. v.x = a / t,
  54347. v.y = s / (e.length - 1),
  54348. d.setXY(p, v.x, v.y),
  54349. p++
  54350. }
  54351. for (a = 0; a < t; a++)
  54352. for (s = 0; s < e.length - 1; s++) {
  54353. o = s + a * e.length;
  54354. var I = o
  54355. , E = o + e.length
  54356. , b = o + e.length + 1
  54357. , w = o + 1;
  54358. h.setX(f, I),
  54359. f++,
  54360. h.setX(f, E),
  54361. f++,
  54362. h.setX(f, w),
  54363. f++,
  54364. h.setX(f, E),
  54365. f++,
  54366. h.setX(f, b),
  54367. f++,
  54368. h.setX(f, w),
  54369. f++
  54370. }
  54371. if (this.setIndex(h),
  54372. this.addAttribute("position", u),
  54373. this.addAttribute("uv", d),
  54374. this.computeVertexNormals(),
  54375. r === 2 * Math.PI) {
  54376. var _ = this.attributes.normal.array
  54377. , T = new n.Vector3
  54378. , x = new n.Vector3
  54379. , S = new n.Vector3;
  54380. for (o = t * e.length * 3,
  54381. a = 0,
  54382. s = 0; a < e.length; a++,
  54383. s += 3)
  54384. T.x = _[s + 0],
  54385. T.y = _[s + 1],
  54386. T.z = _[s + 2],
  54387. x.x = _[o + s + 0],
  54388. x.y = _[o + s + 1],
  54389. x.z = _[o + s + 2],
  54390. S.addVectors(T, x).normalize(),
  54391. _[s + 0] = _[o + s + 0] = S.x,
  54392. _[s + 1] = _[o + s + 1] = S.y,
  54393. _[s + 2] = _[o + s + 2] = S.z
  54394. }
  54395. }
  54396. ,
  54397. n.LatheBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  54398. n.LatheBufferGeometry.prototype.constructor = n.LatheBufferGeometry,
  54399. n.LatheGeometry = function(e, t, i, r) {
  54400. n.Geometry.call(this),
  54401. this.type = "LatheGeometry",
  54402. this.parameters = {
  54403. points: e,
  54404. segments: t,
  54405. phiStart: i,
  54406. phiLength: r
  54407. },
  54408. this.fromBufferGeometry(new n.LatheBufferGeometry(e,t,i,r)),
  54409. this.mergeVertices()
  54410. }
  54411. ,
  54412. n.LatheGeometry.prototype = Object.create(n.Geometry.prototype),
  54413. n.LatheGeometry.prototype.constructor = n.LatheGeometry,
  54414. n.PlaneGeometry = function(e, t, i, r) {
  54415. n.Geometry.call(this),
  54416. this.type = "PlaneGeometry",
  54417. this.parameters = {
  54418. width: e,
  54419. height: t,
  54420. widthSegments: i,
  54421. heightSegments: r
  54422. },
  54423. this.fromBufferGeometry(new n.PlaneBufferGeometry(e,t,i,r))
  54424. }
  54425. ,
  54426. n.PlaneGeometry.prototype = Object.create(n.Geometry.prototype),
  54427. n.PlaneGeometry.prototype.constructor = n.PlaneGeometry,
  54428. n.PlaneBufferGeometry = function(e, t, i, r) {
  54429. n.BufferGeometry.call(this),
  54430. this.type = "PlaneBufferGeometry",
  54431. this.parameters = {
  54432. width: e,
  54433. height: t,
  54434. widthSegments: i,
  54435. heightSegments: r
  54436. };
  54437. 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++)
  54438. for (var y = A * d - a, C = 0; C < c; C++) {
  54439. var I = C * u - o;
  54440. p[m] = I,
  54441. p[m + 1] = -y,
  54442. f[m + 2] = 1,
  54443. g[v] = C / s,
  54444. g[v + 1] = 1 - A / l,
  54445. m += 3,
  54446. v += 2
  54447. }
  54448. m = 0;
  54449. for (var E = new (p.length / 3 > 65535 ? Uint32Array : Uint16Array)(s * l * 6), A = 0; A < l; A++)
  54450. for (var C = 0; C < s; C++) {
  54451. var b = C + c * A
  54452. , w = C + c * (A + 1)
  54453. , _ = C + 1 + c * (A + 1)
  54454. , T = C + 1 + c * A;
  54455. E[m] = b,
  54456. E[m + 1] = w,
  54457. E[m + 2] = T,
  54458. E[m + 3] = w,
  54459. E[m + 4] = _,
  54460. E[m + 5] = T,
  54461. m += 6
  54462. }
  54463. this.setIndex(new n.BufferAttribute(E,1)),
  54464. this.addAttribute("position", new n.BufferAttribute(p,3)),
  54465. this.addAttribute("normal", new n.BufferAttribute(f,3)),
  54466. this.addAttribute("uv", new n.BufferAttribute(g,2))
  54467. }
  54468. ,
  54469. n.PlaneBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  54470. n.PlaneBufferGeometry.prototype.constructor = n.PlaneBufferGeometry,
  54471. n.RingBufferGeometry = function(e, t, i, r, o, a) {
  54472. n.BufferGeometry.call(this),
  54473. this.type = "RingBufferGeometry",
  54474. this.parameters = {
  54475. innerRadius: e,
  54476. outerRadius: t,
  54477. thetaSegments: i,
  54478. phiSegments: r,
  54479. thetaStart: o,
  54480. thetaLength: a
  54481. },
  54482. e = e || 20,
  54483. t = t || 50,
  54484. o = void 0 !== o ? o : 0,
  54485. a = void 0 !== a ? a : 2 * Math.PI,
  54486. i = void 0 !== i ? Math.max(3, i) : 8,
  54487. r = void 0 !== r ? Math.max(1, r) : 1;
  54488. 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;
  54489. for (l = 0; l <= r; l++) {
  54490. for (c = 0; c <= i; c++)
  54491. s = o + c / i * a,
  54492. C.x = A * Math.cos(s),
  54493. C.y = A * Math.sin(s),
  54494. p.setXYZ(m, C.x, C.y, C.z),
  54495. f.setXYZ(m, 0, 0, 1),
  54496. I.x = (C.x / t + 1) / 2,
  54497. I.y = (C.y / t + 1) / 2,
  54498. g.setXY(m, I.x, I.y),
  54499. m++;
  54500. A += y
  54501. }
  54502. for (l = 0; l < r; l++) {
  54503. var E = l * (i + 1);
  54504. for (c = 0; c < i; c++) {
  54505. s = c + E;
  54506. var b = s
  54507. , w = s + i + 1
  54508. , _ = s + i + 2
  54509. , T = s + 1;
  54510. d.setX(v, b),
  54511. v++,
  54512. d.setX(v, w),
  54513. v++,
  54514. d.setX(v, _),
  54515. v++,
  54516. d.setX(v, b),
  54517. v++,
  54518. d.setX(v, _),
  54519. v++,
  54520. d.setX(v, T),
  54521. v++
  54522. }
  54523. }
  54524. this.setIndex(d),
  54525. this.addAttribute("position", p),
  54526. this.addAttribute("normal", f),
  54527. this.addAttribute("uv", g)
  54528. }
  54529. ,
  54530. n.RingBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  54531. n.RingBufferGeometry.prototype.constructor = n.RingBufferGeometry,
  54532. n.RingGeometry = function(e, t, i, r, o, a) {
  54533. n.Geometry.call(this),
  54534. this.type = "RingGeometry",
  54535. this.parameters = {
  54536. innerRadius: e,
  54537. outerRadius: t,
  54538. thetaSegments: i,
  54539. phiSegments: r,
  54540. thetaStart: o,
  54541. thetaLength: a
  54542. },
  54543. this.fromBufferGeometry(new n.RingBufferGeometry(e,t,i,r,o,a))
  54544. }
  54545. ,
  54546. n.RingGeometry.prototype = Object.create(n.Geometry.prototype),
  54547. n.RingGeometry.prototype.constructor = n.RingGeometry,
  54548. n.SphereGeometry = function(e, t, i, r, o, a, s) {
  54549. n.Geometry.call(this),
  54550. this.type = "SphereGeometry",
  54551. this.parameters = {
  54552. radius: e,
  54553. widthSegments: t,
  54554. heightSegments: i,
  54555. phiStart: r,
  54556. phiLength: o,
  54557. thetaStart: a,
  54558. thetaLength: s
  54559. },
  54560. this.fromBufferGeometry(new n.SphereBufferGeometry(e,t,i,r,o,a,s))
  54561. }
  54562. ,
  54563. n.SphereGeometry.prototype = Object.create(n.Geometry.prototype),
  54564. n.SphereGeometry.prototype.constructor = n.SphereGeometry,
  54565. n.SphereBufferGeometry = function(e, t, i, r, o, a, s) {
  54566. n.BufferGeometry.call(this),
  54567. this.type = "SphereBufferGeometry",
  54568. this.parameters = {
  54569. radius: e,
  54570. widthSegments: t,
  54571. heightSegments: i,
  54572. phiStart: r,
  54573. phiLength: o,
  54574. thetaStart: a,
  54575. thetaLength: s
  54576. },
  54577. e = e || 50,
  54578. t = Math.max(3, Math.floor(t) || 8),
  54579. i = Math.max(2, Math.floor(i) || 6),
  54580. r = void 0 !== r ? r : 0,
  54581. o = void 0 !== o ? o : 2 * Math.PI,
  54582. a = void 0 !== a ? a : 0,
  54583. s = void 0 !== s ? s : Math.PI;
  54584. 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++) {
  54585. for (var v = [], A = m / i, y = 0; y <= t; y++) {
  54586. var C = y / t
  54587. , I = -e * Math.cos(r + C * o) * Math.sin(a + A * s)
  54588. , E = e * Math.cos(a + A * s)
  54589. , b = e * Math.sin(r + C * o) * Math.sin(a + A * s);
  54590. g.set(I, E, b).normalize(),
  54591. h.setXYZ(p, I, E, b),
  54592. u.setXYZ(p, g.x, g.y, g.z),
  54593. d.setXY(p, C, 1 - A),
  54594. v.push(p),
  54595. p++
  54596. }
  54597. f.push(v)
  54598. }
  54599. for (var w = [], m = 0; m < i; m++)
  54600. for (var y = 0; y < t; y++) {
  54601. var _ = f[m][y + 1]
  54602. , T = f[m][y]
  54603. , x = f[m + 1][y]
  54604. , S = f[m + 1][y + 1];
  54605. (0 !== m || a > 0) && w.push(_, T, S),
  54606. (m !== i - 1 || l < Math.PI) && w.push(T, x, S)
  54607. }
  54608. this.setIndex(new (h.count > 65535 ? n.Uint32Attribute : n.Uint16Attribute)(w,1)),
  54609. this.addAttribute("position", h),
  54610. this.addAttribute("normal", u),
  54611. this.addAttribute("uv", d),
  54612. this.boundingSphere = new n.Sphere(new n.Vector3,e)
  54613. }
  54614. ,
  54615. n.SphereBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  54616. n.SphereBufferGeometry.prototype.constructor = n.SphereBufferGeometry,
  54617. n.TextGeometry = function(e, t) {
  54618. t = t || {};
  54619. var i = t.font;
  54620. if (i instanceof n.Font == !1)
  54621. return console.error("THREE.TextGeometry: font parameter is not an instance of THREE.Font."),
  54622. new n.Geometry;
  54623. var r = i.generateShapes(e, t.size, t.curveSegments);
  54624. t.amount = void 0 !== t.height ? t.height : 50,
  54625. void 0 === t.bevelThickness && (t.bevelThickness = 10),
  54626. void 0 === t.bevelSize && (t.bevelSize = 8),
  54627. void 0 === t.bevelEnabled && (t.bevelEnabled = !1),
  54628. n.ExtrudeGeometry.call(this, r, t),
  54629. this.type = "TextGeometry"
  54630. }
  54631. ,
  54632. n.TextGeometry.prototype = Object.create(n.ExtrudeGeometry.prototype),
  54633. n.TextGeometry.prototype.constructor = n.TextGeometry,
  54634. n.TorusBufferGeometry = function(e, t, i, r, o) {
  54635. n.BufferGeometry.call(this),
  54636. this.type = "TorusBufferGeometry",
  54637. this.parameters = {
  54638. radius: e,
  54639. tube: t,
  54640. radialSegments: i,
  54641. tubularSegments: r,
  54642. arc: o
  54643. },
  54644. e = e || 100,
  54645. t = t || 40,
  54646. i = Math.floor(i) || 8,
  54647. r = Math.floor(r) || 6,
  54648. o = o || 2 * Math.PI;
  54649. 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;
  54650. for (a = 0; a <= i; a++)
  54651. for (s = 0; s <= r; s++) {
  54652. var C = s / r * o
  54653. , I = a / i * Math.PI * 2;
  54654. A.x = (e + t * Math.cos(I)) * Math.cos(C),
  54655. A.y = (e + t * Math.cos(I)) * Math.sin(C),
  54656. A.z = t * Math.sin(I),
  54657. u[f] = A.x,
  54658. u[f + 1] = A.y,
  54659. u[f + 2] = A.z,
  54660. v.x = e * Math.cos(C),
  54661. v.y = e * Math.sin(C),
  54662. y.subVectors(A, v).normalize(),
  54663. d[f] = y.x,
  54664. d[f + 1] = y.y,
  54665. d[f + 2] = y.z,
  54666. p[g] = s / r,
  54667. p[g + 1] = a / i,
  54668. f += 3,
  54669. g += 2
  54670. }
  54671. for (a = 1; a <= i; a++)
  54672. for (s = 1; s <= r; s++) {
  54673. var E = (r + 1) * a + s - 1
  54674. , b = (r + 1) * (a - 1) + s - 1
  54675. , w = (r + 1) * (a - 1) + s
  54676. , _ = (r + 1) * a + s;
  54677. h[m] = E,
  54678. h[m + 1] = b,
  54679. h[m + 2] = _,
  54680. h[m + 3] = b,
  54681. h[m + 4] = w,
  54682. h[m + 5] = _,
  54683. m += 6
  54684. }
  54685. this.setIndex(new n.BufferAttribute(h,1)),
  54686. this.addAttribute("position", new n.BufferAttribute(u,3)),
  54687. this.addAttribute("normal", new n.BufferAttribute(d,3)),
  54688. this.addAttribute("uv", new n.BufferAttribute(p,2))
  54689. }
  54690. ,
  54691. n.TorusBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  54692. n.TorusBufferGeometry.prototype.constructor = n.TorusBufferGeometry,
  54693. n.TorusGeometry = function(e, t, i, r, o) {
  54694. n.Geometry.call(this),
  54695. this.type = "TorusGeometry",
  54696. this.parameters = {
  54697. radius: e,
  54698. tube: t,
  54699. radialSegments: i,
  54700. tubularSegments: r,
  54701. arc: o
  54702. },
  54703. this.fromBufferGeometry(new n.TorusBufferGeometry(e,t,i,r,o))
  54704. }
  54705. ,
  54706. n.TorusGeometry.prototype = Object.create(n.Geometry.prototype),
  54707. n.TorusGeometry.prototype.constructor = n.TorusGeometry,
  54708. n.TorusKnotBufferGeometry = function(e, t, i, r, o, a) {
  54709. function s(e, t, i, n, r) {
  54710. var o = Math.cos(e)
  54711. , a = Math.sin(e)
  54712. , s = i / t * e
  54713. , l = Math.cos(s);
  54714. r.x = n * (2 + l) * .5 * o,
  54715. r.y = n * (2 + l) * a * .5,
  54716. r.z = n * Math.sin(s) * .5
  54717. }
  54718. n.BufferGeometry.call(this),
  54719. this.type = "TorusKnotBufferGeometry",
  54720. this.parameters = {
  54721. radius: e,
  54722. tube: t,
  54723. tubularSegments: i,
  54724. radialSegments: r,
  54725. p: o,
  54726. q: a
  54727. },
  54728. e = e || 100,
  54729. t = t || 40,
  54730. i = Math.floor(i) || 64,
  54731. r = Math.floor(r) || 8,
  54732. o = o || 2,
  54733. a = a || 3;
  54734. 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;
  54735. for (l = 0; l <= i; ++l) {
  54736. var T = l / i * o * Math.PI * 2;
  54737. for (s(T, o, a, e, I),
  54738. s(T + .01, o, a, e, E),
  54739. w.subVectors(E, I),
  54740. _.addVectors(E, I),
  54741. b.crossVectors(w, _),
  54742. _.crossVectors(b, w),
  54743. b.normalize(),
  54744. _.normalize(),
  54745. c = 0; c <= r; ++c) {
  54746. var x = c / r * Math.PI * 2
  54747. , S = -t * Math.cos(x)
  54748. , M = t * Math.sin(x);
  54749. A.x = I.x + (S * _.x + M * b.x),
  54750. A.y = I.y + (S * _.y + M * b.y),
  54751. A.z = I.z + (S * _.z + M * b.z),
  54752. p.setXYZ(m, A.x, A.y, A.z),
  54753. y.subVectors(A, I).normalize(),
  54754. f.setXYZ(m, y.x, y.y, y.z),
  54755. C.x = l / i,
  54756. C.y = c / r,
  54757. g.setXY(m, C.x, C.y),
  54758. m++
  54759. }
  54760. }
  54761. for (c = 1; c <= i; c++)
  54762. for (l = 1; l <= r; l++) {
  54763. var R = (r + 1) * (c - 1) + (l - 1)
  54764. , P = (r + 1) * c + (l - 1)
  54765. , O = (r + 1) * c + l
  54766. , L = (r + 1) * (c - 1) + l;
  54767. d.setX(v, R),
  54768. v++,
  54769. d.setX(v, P),
  54770. v++,
  54771. d.setX(v, L),
  54772. v++,
  54773. d.setX(v, P),
  54774. v++,
  54775. d.setX(v, O),
  54776. v++,
  54777. d.setX(v, L),
  54778. v++
  54779. }
  54780. this.setIndex(d),
  54781. this.addAttribute("position", p),
  54782. this.addAttribute("normal", f),
  54783. this.addAttribute("uv", g)
  54784. }
  54785. ,
  54786. n.TorusKnotBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  54787. n.TorusKnotBufferGeometry.prototype.constructor = n.TorusKnotBufferGeometry,
  54788. n.TorusKnotGeometry = function(e, t, i, r, o, a, s) {
  54789. n.Geometry.call(this),
  54790. this.type = "TorusKnotGeometry",
  54791. this.parameters = {
  54792. radius: e,
  54793. tube: t,
  54794. tubularSegments: i,
  54795. radialSegments: r,
  54796. p: o,
  54797. q: a
  54798. },
  54799. void 0 !== s && console.warn("THREE.TorusKnotGeometry: heightScale has been deprecated. Use .scale( x, y, z ) instead."),
  54800. this.fromBufferGeometry(new n.TorusKnotBufferGeometry(e,t,i,r,o,a)),
  54801. this.mergeVertices()
  54802. }
  54803. ,
  54804. n.TorusKnotGeometry.prototype = Object.create(n.Geometry.prototype),
  54805. n.TorusKnotGeometry.prototype.constructor = n.TorusKnotGeometry,
  54806. n.TubeGeometry = function(e, t, i, r, o, a) {
  54807. function s(e, t, i) {
  54808. return R.vertices.push(new n.Vector3(e,t,i)) - 1
  54809. }
  54810. n.Geometry.call(this),
  54811. this.type = "TubeGeometry",
  54812. this.parameters = {
  54813. path: e,
  54814. segments: t,
  54815. radius: i,
  54816. radialSegments: r,
  54817. closed: o,
  54818. taper: a
  54819. },
  54820. t = t || 64,
  54821. i = i || 1,
  54822. r = r || 8,
  54823. o = o || !1,
  54824. a = a || n.TubeGeometry.NoTaper;
  54825. 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;
  54826. for (this.tangents = D,
  54827. this.normals = N,
  54828. this.binormals = B,
  54829. v = 0; v < P; v++)
  54830. for (M[v] = [],
  54831. u = v / (P - 1),
  54832. m = e.getPointAt(u),
  54833. l = D[v],
  54834. c = N[v],
  54835. h = B[v],
  54836. p = i * a(u),
  54837. A = 0; A < r; A++)
  54838. d = A / r * 2 * Math.PI,
  54839. f = -p * Math.cos(d),
  54840. g = p * Math.sin(d),
  54841. O.copy(m),
  54842. O.x += f * c.x + g * h.x,
  54843. O.y += f * c.y + g * h.y,
  54844. O.z += f * c.z + g * h.z,
  54845. M[v][A] = s(O.x, O.y, O.z);
  54846. for (v = 0; v < t; v++)
  54847. for (A = 0; A < r; A++)
  54848. y = o ? (v + 1) % t : v + 1,
  54849. C = (A + 1) % r,
  54850. I = M[v][A],
  54851. E = M[y][A],
  54852. b = M[y][C],
  54853. w = M[v][C],
  54854. _ = new n.Vector2(v / t,A / r),
  54855. T = new n.Vector2((v + 1) / t,A / r),
  54856. x = new n.Vector2((v + 1) / t,(A + 1) / r),
  54857. S = new n.Vector2(v / t,(A + 1) / r),
  54858. this.faces.push(new n.Face3(I,E,w)),
  54859. this.faceVertexUvs[0].push([_, T, S]),
  54860. this.faces.push(new n.Face3(E,b,w)),
  54861. this.faceVertexUvs[0].push([T.clone(), x, S.clone()]);
  54862. this.computeFaceNormals(),
  54863. this.computeVertexNormals()
  54864. }
  54865. ,
  54866. n.TubeGeometry.prototype = Object.create(n.Geometry.prototype),
  54867. n.TubeGeometry.prototype.constructor = n.TubeGeometry,
  54868. n.TubeGeometry.NoTaper = function(e) {
  54869. return 1
  54870. }
  54871. ,
  54872. n.TubeGeometry.SinusoidalTaper = function(e) {
  54873. return Math.sin(Math.PI * e)
  54874. }
  54875. ,
  54876. n.TubeGeometry.FrenetFrames = function(e, t, i) {
  54877. function r() {
  54878. f[0] = new n.Vector3,
  54879. g[0] = new n.Vector3,
  54880. a = Number.MAX_VALUE,
  54881. s = Math.abs(p[0].x),
  54882. l = Math.abs(p[0].y),
  54883. c = Math.abs(p[0].z),
  54884. s <= a && (a = s,
  54885. d.set(1, 0, 0)),
  54886. l <= a && (a = l,
  54887. d.set(0, 1, 0)),
  54888. c <= a && d.set(0, 0, 1),
  54889. m.crossVectors(p[0], d).normalize(),
  54890. f[0].crossVectors(p[0], m),
  54891. g[0].crossVectors(p[0], f[0])
  54892. }
  54893. 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;
  54894. for (this.tangents = p,
  54895. this.normals = f,
  54896. this.binormals = g,
  54897. h = 0; h < A; h++)
  54898. u = h / (A - 1),
  54899. p[h] = e.getTangentAt(u),
  54900. p[h].normalize();
  54901. for (r(),
  54902. h = 1; h < A; h++)
  54903. f[h] = f[h - 1].clone(),
  54904. g[h] = g[h - 1].clone(),
  54905. m.crossVectors(p[h - 1], p[h]),
  54906. m.length() > Number.EPSILON && (m.normalize(),
  54907. o = Math.acos(n.Math.clamp(p[h - 1].dot(p[h]), -1, 1)),
  54908. f[h].applyMatrix4(v.makeRotationAxis(m, o))),
  54909. g[h].crossVectors(p[h], f[h]);
  54910. if (i)
  54911. for (o = Math.acos(n.Math.clamp(f[0].dot(f[A - 1]), -1, 1)),
  54912. o /= A - 1,
  54913. p[0].dot(m.crossVectors(f[0], f[A - 1])) > 0 && (o = -o),
  54914. h = 1; h < A; h++)
  54915. f[h].applyMatrix4(v.makeRotationAxis(p[h], o * h)),
  54916. g[h].crossVectors(p[h], f[h])
  54917. }
  54918. ,
  54919. n.PolyhedronGeometry = function(e, t, i, r) {
  54920. function o(e) {
  54921. var t = e.normalize().clone();
  54922. t.index = u.vertices.push(t) - 1;
  54923. var i = l(e) / 2 / Math.PI + .5
  54924. , r = c(e) / Math.PI + .5;
  54925. return t.uv = new n.Vector2(i,1 - r),
  54926. t
  54927. }
  54928. function a(e, t, i, r) {
  54929. var o = new n.Face3(e.index,t.index,i.index,[e.clone(), t.clone(), i.clone()],void 0,r);
  54930. u.faces.push(o),
  54931. C.copy(e).add(t).add(i).divideScalar(3);
  54932. var a = l(C);
  54933. u.faceVertexUvs[0].push([h(e.uv, e, a), h(t.uv, t, a), h(i.uv, i, a)])
  54934. }
  54935. function s(e, t) {
  54936. 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++) {
  54937. l[h] = [];
  54938. 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++)
  54939. 0 === g && h === i ? l[h][g] = d : l[h][g] = o(d.clone().lerp(p, g / f))
  54940. }
  54941. for (var h = 0; h < i; h++)
  54942. for (var g = 0; g < 2 * (i - h) - 1; g++) {
  54943. var m = Math.floor(g / 2);
  54944. 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)
  54945. }
  54946. }
  54947. function l(e) {
  54948. return Math.atan2(e.z, -e.x)
  54949. }
  54950. function c(e) {
  54951. return Math.atan2(-e.y, Math.sqrt(e.x * e.x + e.z * e.z))
  54952. }
  54953. function h(e, t, i) {
  54954. return i < 0 && 1 === e.x && (e = new n.Vector2(e.x - 1,e.y)),
  54955. 0 === t.x && 0 === t.z && (e = new n.Vector2(i / 2 / Math.PI + .5,e.y)),
  54956. e.clone()
  54957. }
  54958. n.Geometry.call(this),
  54959. this.type = "PolyhedronGeometry",
  54960. this.parameters = {
  54961. vertices: e,
  54962. indices: t,
  54963. radius: i,
  54964. detail: r
  54965. },
  54966. i = i || 1,
  54967. r = r || 0;
  54968. for (var u = this, d = 0, p = e.length; d < p; d += 3)
  54969. o(new n.Vector3(e[d],e[d + 1],e[d + 2]));
  54970. for (var f = this.vertices, g = [], d = 0, m = 0, p = t.length; d < p; d += 3,
  54971. m++) {
  54972. var v = f[t[d]]
  54973. , A = f[t[d + 1]]
  54974. , y = f[t[d + 2]];
  54975. g[m] = new n.Face3(v.index,A.index,y.index,[v.clone(), A.clone(), y.clone()],void 0,m)
  54976. }
  54977. for (var C = new n.Vector3, d = 0, p = g.length; d < p; d++)
  54978. s(g[d], r);
  54979. for (var d = 0, p = this.faceVertexUvs[0].length; d < p; d++) {
  54980. var I = this.faceVertexUvs[0][d]
  54981. , E = I[0].x
  54982. , b = I[1].x
  54983. , w = I[2].x
  54984. , _ = Math.max(E, b, w)
  54985. , T = Math.min(E, b, w);
  54986. _ > .9 && T < .1 && (E < .2 && (I[0].x += 1),
  54987. b < .2 && (I[1].x += 1),
  54988. w < .2 && (I[2].x += 1))
  54989. }
  54990. for (var d = 0, p = this.vertices.length; d < p; d++)
  54991. this.vertices[d].multiplyScalar(i);
  54992. this.mergeVertices(),
  54993. this.computeFaceNormals(),
  54994. this.boundingSphere = new n.Sphere(new n.Vector3,i)
  54995. }
  54996. ,
  54997. n.PolyhedronGeometry.prototype = Object.create(n.Geometry.prototype),
  54998. n.PolyhedronGeometry.prototype.constructor = n.PolyhedronGeometry,
  54999. n.DodecahedronGeometry = function(e, t) {
  55000. var i = (1 + Math.sqrt(5)) / 2
  55001. , r = 1 / i
  55002. , 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]
  55003. , 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];
  55004. n.PolyhedronGeometry.call(this, o, a, e, t),
  55005. this.type = "DodecahedronGeometry",
  55006. this.parameters = {
  55007. radius: e,
  55008. detail: t
  55009. }
  55010. }
  55011. ,
  55012. n.DodecahedronGeometry.prototype = Object.create(n.PolyhedronGeometry.prototype),
  55013. n.DodecahedronGeometry.prototype.constructor = n.DodecahedronGeometry,
  55014. n.IcosahedronGeometry = function(e, t) {
  55015. var i = (1 + Math.sqrt(5)) / 2
  55016. , 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]
  55017. , 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];
  55018. n.PolyhedronGeometry.call(this, r, o, e, t),
  55019. this.type = "IcosahedronGeometry",
  55020. this.parameters = {
  55021. radius: e,
  55022. detail: t
  55023. }
  55024. }
  55025. ,
  55026. n.IcosahedronGeometry.prototype = Object.create(n.PolyhedronGeometry.prototype),
  55027. n.IcosahedronGeometry.prototype.constructor = n.IcosahedronGeometry,
  55028. n.OctahedronGeometry = function(e, t) {
  55029. var i = [1, 0, 0, -1, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 1, 0, 0, -1]
  55030. , 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];
  55031. n.PolyhedronGeometry.call(this, i, r, e, t),
  55032. this.type = "OctahedronGeometry",
  55033. this.parameters = {
  55034. radius: e,
  55035. detail: t
  55036. }
  55037. }
  55038. ,
  55039. n.OctahedronGeometry.prototype = Object.create(n.PolyhedronGeometry.prototype),
  55040. n.OctahedronGeometry.prototype.constructor = n.OctahedronGeometry,
  55041. n.TetrahedronGeometry = function(e, t) {
  55042. var i = [1, 1, 1, -1, -1, 1, -1, 1, -1, 1, -1, -1]
  55043. , r = [2, 1, 0, 0, 3, 2, 1, 3, 0, 2, 3, 1];
  55044. n.PolyhedronGeometry.call(this, i, r, e, t),
  55045. this.type = "TetrahedronGeometry",
  55046. this.parameters = {
  55047. radius: e,
  55048. detail: t
  55049. }
  55050. }
  55051. ,
  55052. n.TetrahedronGeometry.prototype = Object.create(n.PolyhedronGeometry.prototype),
  55053. n.TetrahedronGeometry.prototype.constructor = n.TetrahedronGeometry,
  55054. n.ParametricGeometry = function(e, t, i) {
  55055. n.Geometry.call(this),
  55056. this.type = "ParametricGeometry",
  55057. this.parameters = {
  55058. func: e,
  55059. slices: t,
  55060. stacks: i
  55061. };
  55062. var r, o, a, s, l, c = this.vertices, h = this.faces, u = this.faceVertexUvs[0], d = t + 1;
  55063. for (r = 0; r <= i; r++)
  55064. for (l = r / i,
  55065. o = 0; o <= t; o++)
  55066. s = o / t,
  55067. a = e(s, l),
  55068. c.push(a);
  55069. var p, f, g, m, v, A, y, C;
  55070. for (r = 0; r < i; r++)
  55071. for (o = 0; o < t; o++)
  55072. p = r * d + o,
  55073. f = r * d + o + 1,
  55074. g = (r + 1) * d + o + 1,
  55075. m = (r + 1) * d + o,
  55076. v = new n.Vector2(o / t,r / i),
  55077. A = new n.Vector2((o + 1) / t,r / i),
  55078. y = new n.Vector2((o + 1) / t,(r + 1) / i),
  55079. C = new n.Vector2(o / t,(r + 1) / i),
  55080. h.push(new n.Face3(p,f,m)),
  55081. u.push([v, A, C]),
  55082. h.push(new n.Face3(f,g,m)),
  55083. u.push([A.clone(), y, C.clone()]);
  55084. this.computeFaceNormals(),
  55085. this.computeVertexNormals()
  55086. }
  55087. ,
  55088. n.ParametricGeometry.prototype = Object.create(n.Geometry.prototype),
  55089. n.ParametricGeometry.prototype.constructor = n.ParametricGeometry,
  55090. n.WireframeGeometry = function(e) {
  55091. function t(e, t) {
  55092. return e - t
  55093. }
  55094. n.BufferGeometry.call(this);
  55095. var i = [0, 0]
  55096. , r = {}
  55097. , o = ["a", "b", "c"];
  55098. if (e instanceof n.Geometry) {
  55099. for (var a = e.vertices, s = e.faces, l = 0, c = new Uint32Array(6 * s.length), h = 0, u = s.length; h < u; h++)
  55100. for (var d = s[h], p = 0; p < 3; p++) {
  55101. i[0] = d[o[p]],
  55102. i[1] = d[o[(p + 1) % 3]],
  55103. i.sort(t);
  55104. var f = i.toString();
  55105. void 0 === r[f] && (c[2 * l] = i[0],
  55106. c[2 * l + 1] = i[1],
  55107. r[f] = !0,
  55108. l++)
  55109. }
  55110. for (var g = new Float32Array(2 * l * 3), h = 0, u = l; h < u; h++)
  55111. for (var p = 0; p < 2; p++) {
  55112. var m = a[c[2 * h + p]]
  55113. , v = 6 * h + 3 * p;
  55114. g[v + 0] = m.x,
  55115. g[v + 1] = m.y,
  55116. g[v + 2] = m.z
  55117. }
  55118. this.addAttribute("position", new n.BufferAttribute(g,3))
  55119. } else if (e instanceof n.BufferGeometry)
  55120. if (null !== e.index) {
  55121. var A = e.index.array
  55122. , a = e.attributes.position
  55123. , y = e.groups
  55124. , l = 0;
  55125. 0 === y.length && e.addGroup(0, A.length);
  55126. for (var c = new Uint32Array(2 * A.length), C = 0, I = y.length; C < I; ++C)
  55127. for (var E = y[C], b = E.start, w = E.count, h = b, _ = b + w; h < _; h += 3)
  55128. for (var p = 0; p < 3; p++) {
  55129. i[0] = A[h + p],
  55130. i[1] = A[h + (p + 1) % 3],
  55131. i.sort(t);
  55132. var f = i.toString();
  55133. void 0 === r[f] && (c[2 * l] = i[0],
  55134. c[2 * l + 1] = i[1],
  55135. r[f] = !0,
  55136. l++)
  55137. }
  55138. for (var g = new Float32Array(2 * l * 3), h = 0, u = l; h < u; h++)
  55139. for (var p = 0; p < 2; p++) {
  55140. var v = 6 * h + 3 * p
  55141. , T = c[2 * h + p];
  55142. g[v + 0] = a.getX(T),
  55143. g[v + 1] = a.getY(T),
  55144. g[v + 2] = a.getZ(T)
  55145. }
  55146. this.addAttribute("position", new n.BufferAttribute(g,3))
  55147. } else {
  55148. 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++)
  55149. for (var p = 0; p < 3; p++) {
  55150. var v = 18 * h + 6 * p
  55151. , S = 9 * h + 3 * p;
  55152. g[v + 0] = a[S],
  55153. g[v + 1] = a[S + 1],
  55154. g[v + 2] = a[S + 2];
  55155. var T = 9 * h + 3 * ((p + 1) % 3);
  55156. g[v + 3] = a[T],
  55157. g[v + 4] = a[T + 1],
  55158. g[v + 5] = a[T + 2]
  55159. }
  55160. this.addAttribute("position", new n.BufferAttribute(g,3))
  55161. }
  55162. }
  55163. ,
  55164. n.WireframeGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  55165. n.WireframeGeometry.prototype.constructor = n.WireframeGeometry,
  55166. n.AxisHelper = function(e) {
  55167. e = e || 1;
  55168. var t = new Float32Array([0, 0, 0, e, 0, 0, 0, 0, 0, 0, e, 0, 0, 0, 0, 0, 0, e])
  55169. , i = new Float32Array([1, 0, 0, 1, .6, 0, 0, 1, 0, .6, 1, 0, 0, 0, 1, 0, .6, 1])
  55170. , r = new n.BufferGeometry;
  55171. r.addAttribute("position", new n.BufferAttribute(t,3)),
  55172. r.addAttribute("color", new n.BufferAttribute(i,3));
  55173. var o = new n.LineBasicMaterial({
  55174. vertexColors: n.VertexColors
  55175. });
  55176. n.LineSegments.call(this, r, o)
  55177. }
  55178. ,
  55179. n.AxisHelper.prototype = Object.create(n.LineSegments.prototype),
  55180. n.AxisHelper.prototype.constructor = n.AxisHelper,
  55181. n.ArrowHelper = function() {
  55182. var e = new n.Geometry;
  55183. e.vertices.push(new n.Vector3(0,0,0), new n.Vector3(0,1,0));
  55184. var t = new n.CylinderGeometry(0,.5,1,5,1);
  55185. return t.translate(0, -.5, 0),
  55186. function(i, r, o, a, s, l) {
  55187. n.Object3D.call(this),
  55188. void 0 === a && (a = 16776960),
  55189. void 0 === o && (o = 1),
  55190. void 0 === s && (s = .2 * o),
  55191. void 0 === l && (l = .2 * s),
  55192. this.position.copy(r),
  55193. this.line = new n.Line(e,new n.LineBasicMaterial({
  55194. color: a
  55195. })),
  55196. this.line.matrixAutoUpdate = !1,
  55197. this.add(this.line),
  55198. this.cone = new n.Mesh(t,new n.MeshBasicMaterial({
  55199. color: a
  55200. })),
  55201. this.cone.matrixAutoUpdate = !1,
  55202. this.add(this.cone),
  55203. this.setDirection(i),
  55204. this.setLength(o, s, l)
  55205. }
  55206. }(),
  55207. n.ArrowHelper.prototype = Object.create(n.Object3D.prototype),
  55208. n.ArrowHelper.prototype.constructor = n.ArrowHelper,
  55209. n.ArrowHelper.prototype.setDirection = function() {
  55210. var e, t = new n.Vector3;
  55211. return function(i) {
  55212. 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(),
  55213. e = Math.acos(i.y),
  55214. this.quaternion.setFromAxisAngle(t, e))
  55215. }
  55216. }(),
  55217. n.ArrowHelper.prototype.setLength = function(e, t, i) {
  55218. void 0 === t && (t = .2 * e),
  55219. void 0 === i && (i = .2 * t),
  55220. this.line.scale.set(1, Math.max(0, e - t), 1),
  55221. this.line.updateMatrix(),
  55222. this.cone.scale.set(i, t, i),
  55223. this.cone.position.y = e,
  55224. this.cone.updateMatrix()
  55225. }
  55226. ,
  55227. n.ArrowHelper.prototype.setColor = function(e) {
  55228. this.line.material.color.set(e),
  55229. this.cone.material.color.set(e)
  55230. }
  55231. ,
  55232. n.BoxHelper = function(e) {
  55233. 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])
  55234. , i = new Float32Array(24)
  55235. , r = new n.BufferGeometry;
  55236. r.setIndex(new n.BufferAttribute(t,1)),
  55237. r.addAttribute("position", new n.BufferAttribute(i,3)),
  55238. n.LineSegments.call(this, r, new n.LineBasicMaterial({
  55239. color: 16776960
  55240. })),
  55241. void 0 !== e && this.update(e)
  55242. }
  55243. ,
  55244. n.BoxHelper.prototype = Object.create(n.LineSegments.prototype),
  55245. n.BoxHelper.prototype.constructor = n.BoxHelper,
  55246. n.BoxHelper.prototype.update = function() {
  55247. var e = new n.Box3;
  55248. return function(t) {
  55249. if (e.setFromObject(t),
  55250. !e.isEmpty()) {
  55251. var i = e.min
  55252. , n = e.max
  55253. , r = this.geometry.attributes.position
  55254. , o = r.array;
  55255. o[0] = n.x,
  55256. o[1] = n.y,
  55257. o[2] = n.z,
  55258. o[3] = i.x,
  55259. o[4] = n.y,
  55260. o[5] = n.z,
  55261. o[6] = i.x,
  55262. o[7] = i.y,
  55263. o[8] = n.z,
  55264. o[9] = n.x,
  55265. o[10] = i.y,
  55266. o[11] = n.z,
  55267. o[12] = n.x,
  55268. o[13] = n.y,
  55269. o[14] = i.z,
  55270. o[15] = i.x,
  55271. o[16] = n.y,
  55272. o[17] = i.z,
  55273. o[18] = i.x,
  55274. o[19] = i.y,
  55275. o[20] = i.z,
  55276. o[21] = n.x,
  55277. o[22] = i.y,
  55278. o[23] = i.z,
  55279. r.needsUpdate = !0,
  55280. this.geometry.computeBoundingSphere()
  55281. }
  55282. }
  55283. }(),
  55284. n.BoundingBoxHelper = function(e, t) {
  55285. var i = void 0 !== t ? t : 8947848;
  55286. this.object = e,
  55287. this.box = new n.Box3,
  55288. n.Mesh.call(this, new n.BoxGeometry(1,1,1), new n.MeshBasicMaterial({
  55289. color: i,
  55290. wireframe: !0
  55291. }))
  55292. }
  55293. ,
  55294. n.BoundingBoxHelper.prototype = Object.create(n.Mesh.prototype),
  55295. n.BoundingBoxHelper.prototype.constructor = n.BoundingBoxHelper,
  55296. n.BoundingBoxHelper.prototype.update = function() {
  55297. this.box.setFromObject(this.object),
  55298. this.box.size(this.scale),
  55299. this.box.center(this.position)
  55300. }
  55301. ,
  55302. n.CameraHelper = function(e) {
  55303. function t(e, t, n) {
  55304. i(e, n),
  55305. i(t, n)
  55306. }
  55307. function i(e, t) {
  55308. r.vertices.push(new n.Vector3),
  55309. r.colors.push(new n.Color(t)),
  55310. void 0 === a[e] && (a[e] = []),
  55311. a[e].push(r.vertices.length - 1)
  55312. }
  55313. var r = new n.Geometry
  55314. , o = new n.LineBasicMaterial({
  55315. color: 16777215,
  55316. vertexColors: n.FaceColors
  55317. })
  55318. , a = {}
  55319. , s = 16755200
  55320. , l = 16711680
  55321. , c = 43775
  55322. , h = 16777215
  55323. , u = 3355443;
  55324. t("n1", "n2", s),
  55325. t("n2", "n4", s),
  55326. t("n4", "n3", s),
  55327. t("n3", "n1", s),
  55328. t("f1", "f2", s),
  55329. t("f2", "f4", s),
  55330. t("f4", "f3", s),
  55331. t("f3", "f1", s),
  55332. t("n1", "f1", s),
  55333. t("n2", "f2", s),
  55334. t("n3", "f3", s),
  55335. t("n4", "f4", s),
  55336. t("p", "n1", l),
  55337. t("p", "n2", l),
  55338. t("p", "n3", l),
  55339. t("p", "n4", l),
  55340. t("u1", "u2", c),
  55341. t("u2", "u3", c),
  55342. t("u3", "u1", c),
  55343. t("c", "t", h),
  55344. t("p", "c", u),
  55345. t("cn1", "cn2", u),
  55346. t("cn3", "cn4", u),
  55347. t("cf1", "cf2", u),
  55348. t("cf3", "cf4", u),
  55349. n.LineSegments.call(this, r, o),
  55350. this.camera = e,
  55351. this.camera.updateProjectionMatrix(),
  55352. this.matrix = e.matrixWorld,
  55353. this.matrixAutoUpdate = !1,
  55354. this.pointMap = a,
  55355. this.update()
  55356. }
  55357. ,
  55358. n.CameraHelper.prototype = Object.create(n.LineSegments.prototype),
  55359. n.CameraHelper.prototype.constructor = n.CameraHelper,
  55360. n.CameraHelper.prototype.update = function() {
  55361. function e(e, n, a, s) {
  55362. r.set(n, a, s).unproject(o);
  55363. var l = i[e];
  55364. if (void 0 !== l)
  55365. for (var c = 0, h = l.length; c < h; c++)
  55366. t.vertices[l[c]].copy(r)
  55367. }
  55368. var t, i, r = new n.Vector3, o = new n.Camera;
  55369. return function() {
  55370. t = this.geometry,
  55371. i = this.pointMap;
  55372. var n = 1
  55373. , r = 1;
  55374. o.projectionMatrix.copy(this.camera.projectionMatrix),
  55375. e("c", 0, 0, -1),
  55376. e("t", 0, 0, 1),
  55377. e("n1", -n, -r, -1),
  55378. e("n2", n, -r, -1),
  55379. e("n3", -n, r, -1),
  55380. e("n4", n, r, -1),
  55381. e("f1", -n, -r, 1),
  55382. e("f2", n, -r, 1),
  55383. e("f3", -n, r, 1),
  55384. e("f4", n, r, 1),
  55385. e("u1", .7 * n, 1.1 * r, -1),
  55386. e("u2", .7 * -n, 1.1 * r, -1),
  55387. e("u3", 0, 2 * r, -1),
  55388. e("cf1", -n, 0, 1),
  55389. e("cf2", n, 0, 1),
  55390. e("cf3", 0, -r, 1),
  55391. e("cf4", 0, r, 1),
  55392. e("cn1", -n, 0, -1),
  55393. e("cn2", n, 0, -1),
  55394. e("cn3", 0, -r, -1),
  55395. e("cn4", 0, r, -1),
  55396. t.verticesNeedUpdate = !0
  55397. }
  55398. }(),
  55399. n.DirectionalLightHelper = function(e, t) {
  55400. n.Object3D.call(this),
  55401. this.light = e,
  55402. this.light.updateMatrixWorld(),
  55403. this.matrix = e.matrixWorld,
  55404. this.matrixAutoUpdate = !1,
  55405. t = t || 1;
  55406. var i = new n.Geometry;
  55407. 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));
  55408. var r = new n.LineBasicMaterial({
  55409. fog: !1
  55410. });
  55411. r.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  55412. this.lightPlane = new n.Line(i,r),
  55413. this.add(this.lightPlane),
  55414. i = new n.Geometry,
  55415. i.vertices.push(new n.Vector3, new n.Vector3),
  55416. r = new n.LineBasicMaterial({
  55417. fog: !1
  55418. }),
  55419. r.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  55420. this.targetLine = new n.Line(i,r),
  55421. this.add(this.targetLine),
  55422. this.update()
  55423. }
  55424. ,
  55425. n.DirectionalLightHelper.prototype = Object.create(n.Object3D.prototype),
  55426. n.DirectionalLightHelper.prototype.constructor = n.DirectionalLightHelper,
  55427. n.DirectionalLightHelper.prototype.dispose = function() {
  55428. this.lightPlane.geometry.dispose(),
  55429. this.lightPlane.material.dispose(),
  55430. this.targetLine.geometry.dispose(),
  55431. this.targetLine.material.dispose()
  55432. }
  55433. ,
  55434. n.DirectionalLightHelper.prototype.update = function() {
  55435. var e = new n.Vector3
  55436. , t = new n.Vector3
  55437. , i = new n.Vector3;
  55438. return function() {
  55439. e.setFromMatrixPosition(this.light.matrixWorld),
  55440. t.setFromMatrixPosition(this.light.target.matrixWorld),
  55441. i.subVectors(t, e),
  55442. this.lightPlane.lookAt(i),
  55443. this.lightPlane.material.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  55444. this.targetLine.geometry.vertices[1].copy(i),
  55445. this.targetLine.geometry.verticesNeedUpdate = !0,
  55446. this.targetLine.material.color.copy(this.lightPlane.material.color)
  55447. }
  55448. }(),
  55449. n.EdgesHelper = function(e, t, i) {
  55450. var r = void 0 !== t ? t : 16777215;
  55451. n.LineSegments.call(this, new n.EdgesGeometry(e.geometry,i), new n.LineBasicMaterial({
  55452. color: r
  55453. })),
  55454. this.matrix = e.matrixWorld,
  55455. this.matrixAutoUpdate = !1
  55456. }
  55457. ,
  55458. n.EdgesHelper.prototype = Object.create(n.LineSegments.prototype),
  55459. n.EdgesHelper.prototype.constructor = n.EdgesHelper,
  55460. n.FaceNormalsHelper = function(e, t, i, r) {
  55461. this.object = e,
  55462. this.size = void 0 !== t ? t : 1;
  55463. var o = void 0 !== i ? i : 16776960
  55464. , a = void 0 !== r ? r : 1
  55465. , s = 0
  55466. , l = this.object.geometry;
  55467. l instanceof n.Geometry ? s = l.faces.length : console.warn("THREE.FaceNormalsHelper: only THREE.Geometry is supported. Use THREE.VertexNormalsHelper, instead.");
  55468. var c = new n.BufferGeometry
  55469. , h = new n.Float32Attribute(2 * s * 3,3);
  55470. c.addAttribute("position", h),
  55471. n.LineSegments.call(this, c, new n.LineBasicMaterial({
  55472. color: o,
  55473. linewidth: a
  55474. })),
  55475. this.matrixAutoUpdate = !1,
  55476. this.update()
  55477. }
  55478. ,
  55479. n.FaceNormalsHelper.prototype = Object.create(n.LineSegments.prototype),
  55480. n.FaceNormalsHelper.prototype.constructor = n.FaceNormalsHelper,
  55481. n.FaceNormalsHelper.prototype.update = function() {
  55482. var e = new n.Vector3
  55483. , t = new n.Vector3
  55484. , i = new n.Matrix3;
  55485. return function() {
  55486. this.object.updateMatrixWorld(!0),
  55487. i.getNormalMatrix(this.object.matrixWorld);
  55488. 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++) {
  55489. var u = s[c]
  55490. , d = u.normal;
  55491. e.copy(a[u.a]).add(a[u.b]).add(a[u.c]).divideScalar(3).applyMatrix4(n),
  55492. t.copy(d).applyMatrix3(i).normalize().multiplyScalar(this.size).add(e),
  55493. r.setXYZ(l, e.x, e.y, e.z),
  55494. l += 1,
  55495. r.setXYZ(l, t.x, t.y, t.z),
  55496. l += 1
  55497. }
  55498. return r.needsUpdate = !0,
  55499. this
  55500. }
  55501. }(),
  55502. n.GridHelper = function(e, t) {
  55503. var i = new n.Geometry
  55504. , r = new n.LineBasicMaterial({
  55505. vertexColors: n.VertexColors
  55506. });
  55507. this.color1 = new n.Color(4473924),
  55508. this.color2 = new n.Color(8947848);
  55509. for (var o = -e; o <= e; o += t) {
  55510. 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));
  55511. var a = 0 === o ? this.color1 : this.color2;
  55512. i.colors.push(a, a, a, a)
  55513. }
  55514. n.LineSegments.call(this, i, r)
  55515. }
  55516. ,
  55517. n.GridHelper.prototype = Object.create(n.LineSegments.prototype),
  55518. n.GridHelper.prototype.constructor = n.GridHelper,
  55519. n.GridHelper.prototype.setColors = function(e, t) {
  55520. this.color1.set(e),
  55521. this.color2.set(t),
  55522. this.geometry.colorsNeedUpdate = !0
  55523. }
  55524. ,
  55525. n.HemisphereLightHelper = function(e, t) {
  55526. n.Object3D.call(this),
  55527. this.light = e,
  55528. this.light.updateMatrixWorld(),
  55529. this.matrix = e.matrixWorld,
  55530. this.matrixAutoUpdate = !1,
  55531. this.colors = [new n.Color, new n.Color];
  55532. var i = new n.SphereGeometry(t,4,2);
  55533. i.rotateX(-Math.PI / 2);
  55534. for (var r = 0, o = 8; r < o; r++)
  55535. i.faces[r].color = this.colors[r < 4 ? 0 : 1];
  55536. var a = new n.MeshBasicMaterial({
  55537. vertexColors: n.FaceColors,
  55538. wireframe: !0
  55539. });
  55540. this.lightSphere = new n.Mesh(i,a),
  55541. this.add(this.lightSphere),
  55542. this.update()
  55543. }
  55544. ,
  55545. n.HemisphereLightHelper.prototype = Object.create(n.Object3D.prototype),
  55546. n.HemisphereLightHelper.prototype.constructor = n.HemisphereLightHelper,
  55547. n.HemisphereLightHelper.prototype.dispose = function() {
  55548. this.lightSphere.geometry.dispose(),
  55549. this.lightSphere.material.dispose()
  55550. }
  55551. ,
  55552. n.HemisphereLightHelper.prototype.update = function() {
  55553. var e = new n.Vector3;
  55554. return function() {
  55555. this.colors[0].copy(this.light.color).multiplyScalar(this.light.intensity),
  55556. this.colors[1].copy(this.light.groundColor).multiplyScalar(this.light.intensity),
  55557. this.lightSphere.lookAt(e.setFromMatrixPosition(this.light.matrixWorld).negate()),
  55558. this.lightSphere.geometry.colorsNeedUpdate = !0
  55559. }
  55560. }(),
  55561. n.PointLightHelper = function(e, t) {
  55562. this.light = e,
  55563. this.light.updateMatrixWorld();
  55564. var i = new n.SphereGeometry(t,4,2)
  55565. , r = new n.MeshBasicMaterial({
  55566. wireframe: !0,
  55567. fog: !1
  55568. });
  55569. r.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  55570. n.Mesh.call(this, i, r),
  55571. this.matrix = this.light.matrixWorld,
  55572. this.matrixAutoUpdate = !1
  55573. }
  55574. ,
  55575. n.PointLightHelper.prototype = Object.create(n.Mesh.prototype),
  55576. n.PointLightHelper.prototype.constructor = n.PointLightHelper,
  55577. n.PointLightHelper.prototype.dispose = function() {
  55578. this.geometry.dispose(),
  55579. this.material.dispose()
  55580. }
  55581. ,
  55582. n.PointLightHelper.prototype.update = function() {
  55583. this.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)
  55584. }
  55585. ,
  55586. n.SkeletonHelper = function(e) {
  55587. this.bones = this.getBoneList(e);
  55588. for (var t = new n.Geometry, i = 0; i < this.bones.length; i++) {
  55589. var r = this.bones[i];
  55590. r.parent instanceof n.Bone && (t.vertices.push(new n.Vector3),
  55591. t.vertices.push(new n.Vector3),
  55592. t.colors.push(new n.Color(0,0,1)),
  55593. t.colors.push(new n.Color(0,1,0)))
  55594. }
  55595. t.dynamic = !0;
  55596. var o = new n.LineBasicMaterial({
  55597. vertexColors: n.VertexColors,
  55598. depthTest: !1,
  55599. depthWrite: !1,
  55600. transparent: !0
  55601. });
  55602. n.LineSegments.call(this, t, o),
  55603. this.root = e,
  55604. this.matrix = e.matrixWorld,
  55605. this.matrixAutoUpdate = !1,
  55606. this.update()
  55607. }
  55608. ,
  55609. n.SkeletonHelper.prototype = Object.create(n.LineSegments.prototype),
  55610. n.SkeletonHelper.prototype.constructor = n.SkeletonHelper,
  55611. n.SkeletonHelper.prototype.getBoneList = function(e) {
  55612. var t = [];
  55613. e instanceof n.Bone && t.push(e);
  55614. for (var i = 0; i < e.children.length; i++)
  55615. t.push.apply(t, this.getBoneList(e.children[i]));
  55616. return t
  55617. }
  55618. ,
  55619. n.SkeletonHelper.prototype.update = function() {
  55620. 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++) {
  55621. var a = this.bones[o];
  55622. a.parent instanceof n.Bone && (i.multiplyMatrices(t, a.matrixWorld),
  55623. e.vertices[r].setFromMatrixPosition(i),
  55624. i.multiplyMatrices(t, a.parent.matrixWorld),
  55625. e.vertices[r + 1].setFromMatrixPosition(i),
  55626. r += 2)
  55627. }
  55628. e.verticesNeedUpdate = !0,
  55629. e.computeBoundingSphere()
  55630. }
  55631. ,
  55632. n.SpotLightHelper = function(e) {
  55633. n.Object3D.call(this),
  55634. this.light = e,
  55635. this.light.updateMatrixWorld(),
  55636. this.matrix = e.matrixWorld,
  55637. this.matrixAutoUpdate = !1;
  55638. var t = new n.CylinderGeometry(0,1,1,8,1,!0);
  55639. t.translate(0, -.5, 0),
  55640. t.rotateX(-Math.PI / 2);
  55641. var i = new n.MeshBasicMaterial({
  55642. wireframe: !0,
  55643. fog: !1
  55644. });
  55645. this.cone = new n.Mesh(t,i),
  55646. this.add(this.cone),
  55647. this.update()
  55648. }
  55649. ,
  55650. n.SpotLightHelper.prototype = Object.create(n.Object3D.prototype),
  55651. n.SpotLightHelper.prototype.constructor = n.SpotLightHelper,
  55652. n.SpotLightHelper.prototype.dispose = function() {
  55653. this.cone.geometry.dispose(),
  55654. this.cone.material.dispose()
  55655. }
  55656. ,
  55657. n.SpotLightHelper.prototype.update = function() {
  55658. var e = new n.Vector3
  55659. , t = new n.Vector3;
  55660. return function() {
  55661. var i = this.light.distance ? this.light.distance : 1e4
  55662. , n = i * Math.tan(this.light.angle);
  55663. this.cone.scale.set(n, n, i),
  55664. e.setFromMatrixPosition(this.light.matrixWorld),
  55665. t.setFromMatrixPosition(this.light.target.matrixWorld),
  55666. this.cone.lookAt(t.sub(e)),
  55667. this.cone.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)
  55668. }
  55669. }(),
  55670. n.VertexNormalsHelper = function(e, t, i, r) {
  55671. this.object = e,
  55672. this.size = void 0 !== t ? t : 1;
  55673. var o = void 0 !== i ? i : 16711680
  55674. , a = void 0 !== r ? r : 1
  55675. , s = 0
  55676. , l = this.object.geometry;
  55677. l instanceof n.Geometry ? s = 3 * l.faces.length : l instanceof n.BufferGeometry && (s = l.attributes.normal.count);
  55678. var c = new n.BufferGeometry
  55679. , h = new n.Float32Attribute(2 * s * 3,3);
  55680. c.addAttribute("position", h),
  55681. n.LineSegments.call(this, c, new n.LineBasicMaterial({
  55682. color: o,
  55683. linewidth: a
  55684. })),
  55685. this.matrixAutoUpdate = !1,
  55686. this.update()
  55687. }
  55688. ,
  55689. n.VertexNormalsHelper.prototype = Object.create(n.LineSegments.prototype),
  55690. n.VertexNormalsHelper.prototype.constructor = n.VertexNormalsHelper,
  55691. n.VertexNormalsHelper.prototype.update = function() {
  55692. var e = new n.Vector3
  55693. , t = new n.Vector3
  55694. , i = new n.Matrix3;
  55695. return function() {
  55696. var r = ["a", "b", "c"];
  55697. this.object.updateMatrixWorld(!0),
  55698. i.getNormalMatrix(this.object.matrixWorld);
  55699. var o = this.object.matrixWorld
  55700. , a = this.geometry.attributes.position
  55701. , s = this.object.geometry;
  55702. if (s instanceof n.Geometry)
  55703. for (var l = s.vertices, c = s.faces, h = 0, u = 0, d = c.length; u < d; u++)
  55704. for (var p = c[u], f = 0, g = p.vertexNormals.length; f < g; f++) {
  55705. var m = l[p[r[f]]]
  55706. , v = p.vertexNormals[f];
  55707. e.copy(m).applyMatrix4(o),
  55708. t.copy(v).applyMatrix3(i).normalize().multiplyScalar(this.size).add(e),
  55709. a.setXYZ(h, e.x, e.y, e.z),
  55710. h += 1,
  55711. a.setXYZ(h, t.x, t.y, t.z),
  55712. h += 1
  55713. }
  55714. else if (s instanceof n.BufferGeometry)
  55715. for (var A = s.attributes.position, y = s.attributes.normal, h = 0, f = 0, g = A.count; f < g; f++)
  55716. e.set(A.getX(f), A.getY(f), A.getZ(f)).applyMatrix4(o),
  55717. t.set(y.getX(f), y.getY(f), y.getZ(f)),
  55718. t.applyMatrix3(i).normalize().multiplyScalar(this.size).add(e),
  55719. a.setXYZ(h, e.x, e.y, e.z),
  55720. h += 1,
  55721. a.setXYZ(h, t.x, t.y, t.z),
  55722. h += 1;
  55723. return a.needsUpdate = !0,
  55724. this
  55725. }
  55726. }(),
  55727. n.WireframeHelper = function(e, t) {
  55728. var i = void 0 !== t ? t : 16777215;
  55729. n.LineSegments.call(this, new n.WireframeGeometry(e.geometry), new n.LineBasicMaterial({
  55730. color: i
  55731. })),
  55732. this.matrix = e.matrixWorld,
  55733. this.matrixAutoUpdate = !1
  55734. }
  55735. ,
  55736. n.WireframeHelper.prototype = Object.create(n.LineSegments.prototype),
  55737. n.WireframeHelper.prototype.constructor = n.WireframeHelper,
  55738. n.ImmediateRenderObject = function(e) {
  55739. n.Object3D.call(this),
  55740. this.material = e,
  55741. this.render = function(e) {}
  55742. }
  55743. ,
  55744. n.ImmediateRenderObject.prototype = Object.create(n.Object3D.prototype),
  55745. n.ImmediateRenderObject.prototype.constructor = n.ImmediateRenderObject,
  55746. n.MorphBlendMesh = function(e, t) {
  55747. n.Mesh.call(this, e, t),
  55748. this.animationsMap = {},
  55749. this.animationsList = [];
  55750. var i = this.geometry.morphTargets.length
  55751. , r = "__default"
  55752. , o = 0
  55753. , a = i - 1
  55754. , s = i / 1;
  55755. this.createAnimation(r, o, a, s),
  55756. this.setAnimationWeight(r, 1)
  55757. }
  55758. ,
  55759. n.MorphBlendMesh.prototype = Object.create(n.Mesh.prototype),
  55760. n.MorphBlendMesh.prototype.constructor = n.MorphBlendMesh,
  55761. n.MorphBlendMesh.prototype.createAnimation = function(e, t, i, n) {
  55762. var r = {
  55763. start: t,
  55764. end: i,
  55765. length: i - t + 1,
  55766. fps: n,
  55767. duration: (i - t) / n,
  55768. lastFrame: 0,
  55769. currentFrame: 0,
  55770. active: !1,
  55771. time: 0,
  55772. direction: 1,
  55773. weight: 1,
  55774. directionBackwards: !1,
  55775. mirroredLoop: !1
  55776. };
  55777. this.animationsMap[e] = r,
  55778. this.animationsList.push(r)
  55779. }
  55780. ,
  55781. n.MorphBlendMesh.prototype.autoCreateAnimations = function(e) {
  55782. for (var t, i = /([a-z]+)_?(\d+)/i, n = {}, r = this.geometry, o = 0, a = r.morphTargets.length; o < a; o++) {
  55783. var s = r.morphTargets[o]
  55784. , l = s.name.match(i);
  55785. if (l && l.length > 1) {
  55786. var c = l[1];
  55787. n[c] || (n[c] = {
  55788. start: 1 / 0,
  55789. end: -(1 / 0)
  55790. });
  55791. var h = n[c];
  55792. o < h.start && (h.start = o),
  55793. o > h.end && (h.end = o),
  55794. t || (t = c)
  55795. }
  55796. }
  55797. for (var c in n) {
  55798. var h = n[c];
  55799. this.createAnimation(c, h.start, h.end, e)
  55800. }
  55801. this.firstAnimation = t
  55802. }
  55803. ,
  55804. n.MorphBlendMesh.prototype.setAnimationDirectionForward = function(e) {
  55805. var t = this.animationsMap[e];
  55806. t && (t.direction = 1,
  55807. t.directionBackwards = !1)
  55808. }
  55809. ,
  55810. n.MorphBlendMesh.prototype.setAnimationDirectionBackward = function(e) {
  55811. var t = this.animationsMap[e];
  55812. t && (t.direction = -1,
  55813. t.directionBackwards = !0)
  55814. }
  55815. ,
  55816. n.MorphBlendMesh.prototype.setAnimationFPS = function(e, t) {
  55817. var i = this.animationsMap[e];
  55818. i && (i.fps = t,
  55819. i.duration = (i.end - i.start) / i.fps)
  55820. }
  55821. ,
  55822. n.MorphBlendMesh.prototype.setAnimationDuration = function(e, t) {
  55823. var i = this.animationsMap[e];
  55824. i && (i.duration = t,
  55825. i.fps = (i.end - i.start) / i.duration)
  55826. }
  55827. ,
  55828. n.MorphBlendMesh.prototype.setAnimationWeight = function(e, t) {
  55829. var i = this.animationsMap[e];
  55830. i && (i.weight = t)
  55831. }
  55832. ,
  55833. n.MorphBlendMesh.prototype.setAnimationTime = function(e, t) {
  55834. var i = this.animationsMap[e];
  55835. i && (i.time = t)
  55836. }
  55837. ,
  55838. n.MorphBlendMesh.prototype.getAnimationTime = function(e) {
  55839. var t = 0
  55840. , i = this.animationsMap[e];
  55841. return i && (t = i.time),
  55842. t
  55843. }
  55844. ,
  55845. n.MorphBlendMesh.prototype.getAnimationDuration = function(e) {
  55846. var t = -1
  55847. , i = this.animationsMap[e];
  55848. return i && (t = i.duration),
  55849. t
  55850. }
  55851. ,
  55852. n.MorphBlendMesh.prototype.playAnimation = function(e) {
  55853. var t = this.animationsMap[e];
  55854. t ? (t.time = 0,
  55855. t.active = !0) : console.warn("THREE.MorphBlendMesh: animation[" + e + "] undefined in .playAnimation()")
  55856. }
  55857. ,
  55858. n.MorphBlendMesh.prototype.stopAnimation = function(e) {
  55859. var t = this.animationsMap[e];
  55860. t && (t.active = !1)
  55861. }
  55862. ,
  55863. n.MorphBlendMesh.prototype.update = function(e) {
  55864. for (var t = 0, i = this.animationsList.length; t < i; t++) {
  55865. var r = this.animationsList[t];
  55866. if (r.active) {
  55867. var o = r.duration / r.length;
  55868. r.time += r.direction * e,
  55869. r.mirroredLoop ? (r.time > r.duration || r.time < 0) && (r.direction *= -1,
  55870. r.time > r.duration && (r.time = r.duration,
  55871. r.directionBackwards = !0),
  55872. r.time < 0 && (r.time = 0,
  55873. r.directionBackwards = !1)) : (r.time = r.time % r.duration,
  55874. r.time < 0 && (r.time += r.duration));
  55875. var a = r.start + n.Math.clamp(Math.floor(r.time / o), 0, r.length - 1)
  55876. , s = r.weight;
  55877. a !== r.currentFrame && (this.morphTargetInfluences[r.lastFrame] = 0,
  55878. this.morphTargetInfluences[r.currentFrame] = 1 * s,
  55879. this.morphTargetInfluences[a] = 0,
  55880. r.lastFrame = r.currentFrame,
  55881. r.currentFrame = a);
  55882. var l = r.time % o / o;
  55883. r.directionBackwards && (l = 1 - l),
  55884. r.currentFrame !== r.lastFrame ? (this.morphTargetInfluences[r.currentFrame] = l * s,
  55885. this.morphTargetInfluences[r.lastFrame] = (1 - l) * s) : this.morphTargetInfluences[r.currentFrame] = s
  55886. }
  55887. }
  55888. }
  55889. ,
  55890. "undefined" != typeof i ? ("undefined" != typeof t && t.exports && (i = t.exports = n),
  55891. i.THREE = n) : this.THREE = n
  55892. }
  55893. , {}]
  55894. }, {}, [116]);