main_2020_show.js 2.5 MB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478194791948019481194821948319484194851948619487194881948919490194911949219493194941949519496194971949819499195001950119502195031950419505195061950719508195091951019511195121951319514195151951619517195181951919520195211952219523195241952519526195271952819529195301953119532195331953419535195361953719538195391954019541195421954319544195451954619547195481954919550195511955219553195541955519556195571955819559195601956119562195631956419565195661956719568195691957019571195721957319574195751957619577195781957919580195811958219583195841958519586195871958819589195901959119592195931959419595195961959719598195991960019601196021960319604196051960619607196081960919610196111961219613196141961519616196171961819619196201962119622196231962419625196261962719628196291963019631196321963319634196351963619637196381963919640196411964219643196441964519646196471964819649196501965119652196531965419655196561965719658196591966019661196621966319664196651966619667196681966919670196711967219673196741967519676196771967819679196801968119682196831968419685196861968719688196891969019691196921969319694196951969619697196981969919700197011970219703197041970519706197071970819709197101971119712197131971419715197161971719718197191972019721197221972319724197251972619727197281972919730197311973219733197341973519736197371973819739197401974119742197431974419745197461974719748197491975019751197521975319754197551975619757197581975919760197611976219763197641976519766197671976819769197701977119772197731977419775197761977719778197791978019781197821978319784197851978619787197881978919790197911979219793197941979519796197971979819799198001980119802198031980419805198061980719808198091981019811198121981319814198151981619817198181981919820198211982219823198241982519826198271982819829198301983119832198331983419835198361983719838198391984019841198421984319844198451984619847198481984919850198511985219853198541985519856198571985819859198601986119862198631986419865198661986719868198691987019871198721987319874198751987619877198781987919880198811988219883198841988519886198871988819889198901989119892198931989419895198961989719898198991990019901199021990319904199051990619907199081990919910199111991219913199141991519916199171991819919199201992119922199231992419925199261992719928199291993019931199321993319934199351993619937199381993919940199411994219943199441994519946199471994819949199501995119952199531995419955199561995719958199591996019961199621996319964199651996619967199681996919970199711997219973199741997519976199771997819979199801998119982199831998419985199861998719988199891999019991199921999319994199951999619997199981999920000200012000220003200042000520006200072000820009200102001120012200132001420015200162001720018200192002020021200222002320024200252002620027200282002920030200312003220033200342003520036200372003820039200402004120042200432004420045200462004720048200492005020051200522005320054200552005620057200582005920060200612006220063200642006520066200672006820069200702007120072200732007420075200762007720078200792008020081200822008320084200852008620087200882008920090200912009220093200942009520096200972009820099201002010120102201032010420105201062010720108201092011020111201122011320114201152011620117201182011920120201212012220123201242012520126201272012820129201302013120132201332013420135201362013720138201392014020141201422014320144201452014620147201482014920150201512015220153201542015520156201572015820159201602016120162201632016420165201662016720168201692017020171201722017320174201752017620177201782017920180201812018220183201842018520186201872018820189201902019120192201932019420195201962019720198201992020020201202022020320204202052020620207202082020920210202112021220213202142021520216202172021820219202202022120222202232022420225202262022720228202292023020231202322023320234202352023620237202382023920240202412024220243202442024520246202472024820249202502025120252202532025420255202562025720258202592026020261202622026320264202652026620267202682026920270202712027220273202742027520276202772027820279202802028120282202832028420285202862028720288202892029020291202922029320294202952029620297202982029920300203012030220303203042030520306203072030820309203102031120312203132031420315203162031720318203192032020321203222032320324203252032620327203282032920330203312033220333203342033520336203372033820339203402034120342203432034420345203462034720348203492035020351203522035320354203552035620357203582035920360203612036220363203642036520366203672036820369203702037120372203732037420375203762037720378203792038020381203822038320384203852038620387203882038920390203912039220393203942039520396203972039820399204002040120402204032040420405204062040720408204092041020411204122041320414204152041620417204182041920420204212042220423204242042520426204272042820429204302043120432204332043420435204362043720438204392044020441204422044320444204452044620447204482044920450204512045220453204542045520456204572045820459204602046120462204632046420465204662046720468204692047020471204722047320474204752047620477204782047920480204812048220483204842048520486204872048820489204902049120492204932049420495204962049720498204992050020501205022050320504205052050620507205082050920510205112051220513205142051520516205172051820519205202052120522205232052420525205262052720528205292053020531205322053320534205352053620537205382053920540205412054220543205442054520546205472054820549205502055120552205532055420555205562055720558205592056020561205622056320564205652056620567205682056920570205712057220573205742057520576205772057820579205802058120582205832058420585205862058720588205892059020591205922059320594205952059620597205982059920600206012060220603206042060520606206072060820609206102061120612206132061420615206162061720618206192062020621206222062320624206252062620627206282062920630206312063220633206342063520636206372063820639206402064120642206432064420645206462064720648206492065020651206522065320654206552065620657206582065920660206612066220663206642066520666206672066820669206702067120672206732067420675206762067720678206792068020681206822068320684206852068620687206882068920690206912069220693206942069520696206972069820699207002070120702207032070420705207062070720708207092071020711207122071320714207152071620717207182071920720207212072220723207242072520726207272072820729207302073120732207332073420735207362073720738207392074020741207422074320744207452074620747207482074920750207512075220753207542075520756207572075820759207602076120762207632076420765207662076720768207692077020771207722077320774207752077620777207782077920780207812078220783207842078520786207872078820789207902079120792207932079420795207962079720798207992080020801208022080320804208052080620807208082080920810208112081220813208142081520816208172081820819208202082120822208232082420825208262082720828208292083020831208322083320834208352083620837208382083920840208412084220843208442084520846208472084820849208502085120852208532085420855208562085720858208592086020861208622086320864208652086620867208682086920870208712087220873208742087520876208772087820879208802088120882208832088420885208862088720888208892089020891208922089320894208952089620897208982089920900209012090220903209042090520906209072090820909209102091120912209132091420915209162091720918209192092020921209222092320924209252092620927209282092920930209312093220933209342093520936209372093820939209402094120942209432094420945209462094720948209492095020951209522095320954209552095620957209582095920960209612096220963209642096520966209672096820969209702097120972209732097420975209762097720978209792098020981209822098320984209852098620987209882098920990209912099220993209942099520996209972099820999210002100121002210032100421005210062100721008210092101021011210122101321014210152101621017210182101921020210212102221023210242102521026210272102821029210302103121032210332103421035210362103721038210392104021041210422104321044210452104621047210482104921050210512105221053210542105521056210572105821059210602106121062210632106421065210662106721068210692107021071210722107321074210752107621077210782107921080210812108221083210842108521086210872108821089210902109121092210932109421095210962109721098210992110021101211022110321104211052110621107211082110921110211112111221113211142111521116211172111821119211202112121122211232112421125211262112721128211292113021131211322113321134211352113621137211382113921140211412114221143211442114521146211472114821149211502115121152211532115421155211562115721158211592116021161211622116321164211652116621167211682116921170211712117221173211742117521176211772117821179211802118121182211832118421185211862118721188211892119021191211922119321194211952119621197211982119921200212012120221203212042120521206212072120821209212102121121212212132121421215212162121721218212192122021221212222122321224212252122621227212282122921230212312123221233212342123521236212372123821239212402124121242212432124421245212462124721248212492125021251212522125321254212552125621257212582125921260212612126221263212642126521266212672126821269212702127121272212732127421275212762127721278212792128021281212822128321284212852128621287212882128921290212912129221293212942129521296212972129821299213002130121302213032130421305213062130721308213092131021311213122131321314213152131621317213182131921320213212132221323213242132521326213272132821329213302133121332213332133421335213362133721338213392134021341213422134321344213452134621347213482134921350213512135221353213542135521356213572135821359213602136121362213632136421365213662136721368213692137021371213722137321374213752137621377213782137921380213812138221383213842138521386213872138821389213902139121392213932139421395213962139721398213992140021401214022140321404214052140621407214082140921410214112141221413214142141521416214172141821419214202142121422214232142421425214262142721428214292143021431214322143321434214352143621437214382143921440214412144221443214442144521446214472144821449214502145121452214532145421455214562145721458214592146021461214622146321464214652146621467214682146921470214712147221473214742147521476214772147821479214802148121482214832148421485214862148721488214892149021491214922149321494214952149621497214982149921500215012150221503215042150521506215072150821509215102151121512215132151421515215162151721518215192152021521215222152321524215252152621527215282152921530215312153221533215342153521536215372153821539215402154121542215432154421545215462154721548215492155021551215522155321554215552155621557215582155921560215612156221563215642156521566215672156821569215702157121572215732157421575215762157721578215792158021581215822158321584215852158621587215882158921590215912159221593215942159521596215972159821599216002160121602216032160421605216062160721608216092161021611216122161321614216152161621617216182161921620216212162221623216242162521626216272162821629216302163121632216332163421635216362163721638216392164021641216422164321644216452164621647216482164921650216512165221653216542165521656216572165821659216602166121662216632166421665216662166721668216692167021671216722167321674216752167621677216782167921680216812168221683216842168521686216872168821689216902169121692216932169421695216962169721698216992170021701217022170321704217052170621707217082170921710217112171221713217142171521716217172171821719217202172121722217232172421725217262172721728217292173021731217322173321734217352173621737217382173921740217412174221743217442174521746217472174821749217502175121752217532175421755217562175721758217592176021761217622176321764217652176621767217682176921770217712177221773217742177521776217772177821779217802178121782217832178421785217862178721788217892179021791217922179321794217952179621797217982179921800218012180221803218042180521806218072180821809218102181121812218132181421815218162181721818218192182021821218222182321824218252182621827218282182921830218312183221833218342183521836218372183821839218402184121842218432184421845218462184721848218492185021851218522185321854218552185621857218582185921860218612186221863218642186521866218672186821869218702187121872218732187421875218762187721878218792188021881218822188321884218852188621887218882188921890218912189221893218942189521896218972189821899219002190121902219032190421905219062190721908219092191021911219122191321914219152191621917219182191921920219212192221923219242192521926219272192821929219302193121932219332193421935219362193721938219392194021941219422194321944219452194621947219482194921950219512195221953219542195521956219572195821959219602196121962219632196421965219662196721968219692197021971219722197321974219752197621977219782197921980219812198221983219842198521986219872198821989219902199121992219932199421995219962199721998219992200022001220022200322004220052200622007220082200922010220112201222013220142201522016220172201822019220202202122022220232202422025220262202722028220292203022031220322203322034220352203622037220382203922040220412204222043220442204522046220472204822049220502205122052220532205422055220562205722058220592206022061220622206322064220652206622067220682206922070220712207222073220742207522076220772207822079220802208122082220832208422085220862208722088220892209022091220922209322094220952209622097220982209922100221012210222103221042210522106221072210822109221102211122112221132211422115221162211722118221192212022121221222212322124221252212622127221282212922130221312213222133221342213522136221372213822139221402214122142221432214422145221462214722148221492215022151221522215322154221552215622157221582215922160221612216222163221642216522166221672216822169221702217122172221732217422175221762217722178221792218022181221822218322184221852218622187221882218922190221912219222193221942219522196221972219822199222002220122202222032220422205222062220722208222092221022211222122221322214222152221622217222182221922220222212222222223222242222522226222272222822229222302223122232222332223422235222362223722238222392224022241222422224322244222452224622247222482224922250222512225222253222542225522256222572225822259222602226122262222632226422265222662226722268222692227022271222722227322274222752227622277222782227922280222812228222283222842228522286222872228822289222902229122292222932229422295222962229722298222992230022301223022230322304223052230622307223082230922310223112231222313223142231522316223172231822319223202232122322223232232422325223262232722328223292233022331223322233322334223352233622337223382233922340223412234222343223442234522346223472234822349223502235122352223532235422355223562235722358223592236022361223622236322364223652236622367223682236922370223712237222373223742237522376223772237822379223802238122382223832238422385223862238722388223892239022391223922239322394223952239622397223982239922400224012240222403224042240522406224072240822409224102241122412224132241422415224162241722418224192242022421224222242322424224252242622427224282242922430224312243222433224342243522436224372243822439224402244122442224432244422445224462244722448224492245022451224522245322454224552245622457224582245922460224612246222463224642246522466224672246822469224702247122472224732247422475224762247722478224792248022481224822248322484224852248622487224882248922490224912249222493224942249522496224972249822499225002250122502225032250422505225062250722508225092251022511225122251322514225152251622517225182251922520225212252222523225242252522526225272252822529225302253122532225332253422535225362253722538225392254022541225422254322544225452254622547225482254922550225512255222553225542255522556225572255822559225602256122562225632256422565225662256722568225692257022571225722257322574225752257622577225782257922580225812258222583225842258522586225872258822589225902259122592225932259422595225962259722598225992260022601226022260322604226052260622607226082260922610226112261222613226142261522616226172261822619226202262122622226232262422625226262262722628226292263022631226322263322634226352263622637226382263922640226412264222643226442264522646226472264822649226502265122652226532265422655226562265722658226592266022661226622266322664226652266622667226682266922670226712267222673226742267522676226772267822679226802268122682226832268422685226862268722688226892269022691226922269322694226952269622697226982269922700227012270222703227042270522706227072270822709227102271122712227132271422715227162271722718227192272022721227222272322724227252272622727227282272922730227312273222733227342273522736227372273822739227402274122742227432274422745227462274722748227492275022751227522275322754227552275622757227582275922760227612276222763227642276522766227672276822769227702277122772227732277422775227762277722778227792278022781227822278322784227852278622787227882278922790227912279222793227942279522796227972279822799228002280122802228032280422805228062280722808228092281022811228122281322814228152281622817228182281922820228212282222823228242282522826228272282822829228302283122832228332283422835228362283722838228392284022841228422284322844228452284622847228482284922850228512285222853228542285522856228572285822859228602286122862228632286422865228662286722868228692287022871228722287322874228752287622877228782287922880228812288222883228842288522886228872288822889228902289122892228932289422895228962289722898228992290022901229022290322904229052290622907229082290922910229112291222913229142291522916229172291822919229202292122922229232292422925229262292722928229292293022931229322293322934229352293622937229382293922940229412294222943229442294522946229472294822949229502295122952229532295422955229562295722958229592296022961229622296322964229652296622967229682296922970229712297222973229742297522976229772297822979229802298122982229832298422985229862298722988229892299022991229922299322994229952299622997229982299923000230012300223003230042300523006230072300823009230102301123012230132301423015230162301723018230192302023021230222302323024230252302623027230282302923030230312303223033230342303523036230372303823039230402304123042230432304423045230462304723048230492305023051230522305323054230552305623057230582305923060230612306223063230642306523066230672306823069230702307123072230732307423075230762307723078230792308023081230822308323084230852308623087230882308923090230912309223093230942309523096230972309823099231002310123102231032310423105231062310723108231092311023111231122311323114231152311623117231182311923120231212312223123231242312523126231272312823129231302313123132231332313423135231362313723138231392314023141231422314323144231452314623147231482314923150231512315223153231542315523156231572315823159231602316123162231632316423165231662316723168231692317023171231722317323174231752317623177231782317923180231812318223183231842318523186231872318823189231902319123192231932319423195231962319723198231992320023201232022320323204232052320623207232082320923210232112321223213232142321523216232172321823219232202322123222232232322423225232262322723228232292323023231232322323323234232352323623237232382323923240232412324223243232442324523246232472324823249232502325123252232532325423255232562325723258232592326023261232622326323264232652326623267232682326923270232712327223273232742327523276232772327823279232802328123282232832328423285232862328723288232892329023291232922329323294232952329623297232982329923300233012330223303233042330523306233072330823309233102331123312233132331423315233162331723318233192332023321233222332323324233252332623327233282332923330233312333223333233342333523336233372333823339233402334123342233432334423345233462334723348233492335023351233522335323354233552335623357233582335923360233612336223363233642336523366233672336823369233702337123372233732337423375233762337723378233792338023381233822338323384233852338623387233882338923390233912339223393233942339523396233972339823399234002340123402234032340423405234062340723408234092341023411234122341323414234152341623417234182341923420234212342223423234242342523426234272342823429234302343123432234332343423435234362343723438234392344023441234422344323444234452344623447234482344923450234512345223453234542345523456234572345823459234602346123462234632346423465234662346723468234692347023471234722347323474234752347623477234782347923480234812348223483234842348523486234872348823489234902349123492234932349423495234962349723498234992350023501235022350323504235052350623507235082350923510235112351223513235142351523516235172351823519235202352123522235232352423525235262352723528235292353023531235322353323534235352353623537235382353923540235412354223543235442354523546235472354823549235502355123552235532355423555235562355723558235592356023561235622356323564235652356623567235682356923570235712357223573235742357523576235772357823579235802358123582235832358423585235862358723588235892359023591235922359323594235952359623597235982359923600236012360223603236042360523606236072360823609236102361123612236132361423615236162361723618236192362023621236222362323624236252362623627236282362923630236312363223633236342363523636236372363823639236402364123642236432364423645236462364723648236492365023651236522365323654236552365623657236582365923660236612366223663236642366523666236672366823669236702367123672236732367423675236762367723678236792368023681236822368323684236852368623687236882368923690236912369223693236942369523696236972369823699237002370123702237032370423705237062370723708237092371023711237122371323714237152371623717237182371923720237212372223723237242372523726237272372823729237302373123732237332373423735237362373723738237392374023741237422374323744237452374623747237482374923750237512375223753237542375523756237572375823759237602376123762237632376423765237662376723768237692377023771237722377323774237752377623777237782377923780237812378223783237842378523786237872378823789237902379123792237932379423795237962379723798237992380023801238022380323804238052380623807238082380923810238112381223813238142381523816238172381823819238202382123822238232382423825238262382723828238292383023831238322383323834238352383623837238382383923840238412384223843238442384523846238472384823849238502385123852238532385423855238562385723858238592386023861238622386323864238652386623867238682386923870238712387223873238742387523876238772387823879238802388123882238832388423885238862388723888238892389023891238922389323894238952389623897238982389923900239012390223903239042390523906239072390823909239102391123912239132391423915239162391723918239192392023921239222392323924239252392623927239282392923930239312393223933239342393523936239372393823939239402394123942239432394423945239462394723948239492395023951239522395323954239552395623957239582395923960239612396223963239642396523966239672396823969239702397123972239732397423975239762397723978239792398023981239822398323984239852398623987239882398923990239912399223993239942399523996239972399823999240002400124002240032400424005240062400724008240092401024011240122401324014240152401624017240182401924020240212402224023240242402524026240272402824029240302403124032240332403424035240362403724038240392404024041240422404324044240452404624047240482404924050240512405224053240542405524056240572405824059240602406124062240632406424065240662406724068240692407024071240722407324074240752407624077240782407924080240812408224083240842408524086240872408824089240902409124092240932409424095240962409724098240992410024101241022410324104241052410624107241082410924110241112411224113241142411524116241172411824119241202412124122241232412424125241262412724128241292413024131241322413324134241352413624137241382413924140241412414224143241442414524146241472414824149241502415124152241532415424155241562415724158241592416024161241622416324164241652416624167241682416924170241712417224173241742417524176241772417824179241802418124182241832418424185241862418724188241892419024191241922419324194241952419624197241982419924200242012420224203242042420524206242072420824209242102421124212242132421424215242162421724218242192422024221242222422324224242252422624227242282422924230242312423224233242342423524236242372423824239242402424124242242432424424245242462424724248242492425024251242522425324254242552425624257242582425924260242612426224263242642426524266242672426824269242702427124272242732427424275242762427724278242792428024281242822428324284242852428624287242882428924290242912429224293242942429524296242972429824299243002430124302243032430424305243062430724308243092431024311243122431324314243152431624317243182431924320243212432224323243242432524326243272432824329243302433124332243332433424335243362433724338243392434024341243422434324344243452434624347243482434924350243512435224353243542435524356243572435824359243602436124362243632436424365243662436724368243692437024371243722437324374243752437624377243782437924380243812438224383243842438524386243872438824389243902439124392243932439424395243962439724398243992440024401244022440324404244052440624407244082440924410244112441224413244142441524416244172441824419244202442124422244232442424425244262442724428244292443024431244322443324434244352443624437244382443924440244412444224443244442444524446244472444824449244502445124452244532445424455244562445724458244592446024461244622446324464244652446624467244682446924470244712447224473244742447524476244772447824479244802448124482244832448424485244862448724488244892449024491244922449324494244952449624497244982449924500245012450224503245042450524506245072450824509245102451124512245132451424515245162451724518245192452024521245222452324524245252452624527245282452924530245312453224533245342453524536245372453824539245402454124542245432454424545245462454724548245492455024551245522455324554245552455624557245582455924560245612456224563245642456524566245672456824569245702457124572245732457424575245762457724578245792458024581245822458324584245852458624587245882458924590245912459224593245942459524596245972459824599246002460124602246032460424605246062460724608246092461024611246122461324614246152461624617246182461924620246212462224623246242462524626246272462824629246302463124632246332463424635246362463724638246392464024641246422464324644246452464624647246482464924650246512465224653246542465524656246572465824659246602466124662246632466424665246662466724668246692467024671246722467324674246752467624677246782467924680246812468224683246842468524686246872468824689246902469124692246932469424695246962469724698246992470024701247022470324704247052470624707247082470924710247112471224713247142471524716247172471824719247202472124722247232472424725247262472724728247292473024731247322473324734247352473624737247382473924740247412474224743247442474524746247472474824749247502475124752247532475424755247562475724758247592476024761247622476324764247652476624767247682476924770247712477224773247742477524776247772477824779247802478124782247832478424785247862478724788247892479024791247922479324794247952479624797247982479924800248012480224803248042480524806248072480824809248102481124812248132481424815248162481724818248192482024821248222482324824248252482624827248282482924830248312483224833248342483524836248372483824839248402484124842248432484424845248462484724848248492485024851248522485324854248552485624857248582485924860248612486224863248642486524866248672486824869248702487124872248732487424875248762487724878248792488024881248822488324884248852488624887248882488924890248912489224893248942489524896248972489824899249002490124902249032490424905249062490724908249092491024911249122491324914249152491624917249182491924920249212492224923249242492524926249272492824929249302493124932249332493424935249362493724938249392494024941249422494324944249452494624947249482494924950249512495224953249542495524956249572495824959249602496124962249632496424965249662496724968249692497024971249722497324974249752497624977249782497924980249812498224983249842498524986249872498824989249902499124992249932499424995249962499724998249992500025001250022500325004250052500625007250082500925010250112501225013250142501525016250172501825019250202502125022250232502425025250262502725028250292503025031250322503325034250352503625037250382503925040250412504225043250442504525046250472504825049250502505125052250532505425055250562505725058250592506025061250622506325064250652506625067250682506925070250712507225073250742507525076250772507825079250802508125082250832508425085250862508725088250892509025091250922509325094250952509625097250982509925100251012510225103251042510525106251072510825109251102511125112251132511425115251162511725118251192512025121251222512325124251252512625127251282512925130251312513225133251342513525136251372513825139251402514125142251432514425145251462514725148251492515025151251522515325154251552515625157251582515925160251612516225163251642516525166251672516825169251702517125172251732517425175251762517725178251792518025181251822518325184251852518625187251882518925190251912519225193251942519525196251972519825199252002520125202252032520425205252062520725208252092521025211252122521325214252152521625217252182521925220252212522225223252242522525226252272522825229252302523125232252332523425235252362523725238252392524025241252422524325244252452524625247252482524925250252512525225253252542525525256252572525825259252602526125262252632526425265252662526725268252692527025271252722527325274252752527625277252782527925280252812528225283252842528525286252872528825289252902529125292252932529425295252962529725298252992530025301253022530325304253052530625307253082530925310253112531225313253142531525316253172531825319253202532125322253232532425325253262532725328253292533025331253322533325334253352533625337253382533925340253412534225343253442534525346253472534825349253502535125352253532535425355253562535725358253592536025361253622536325364253652536625367253682536925370253712537225373253742537525376253772537825379253802538125382253832538425385253862538725388253892539025391253922539325394253952539625397253982539925400254012540225403254042540525406254072540825409254102541125412254132541425415254162541725418254192542025421254222542325424254252542625427254282542925430254312543225433254342543525436254372543825439254402544125442254432544425445254462544725448254492545025451254522545325454254552545625457254582545925460254612546225463254642546525466254672546825469254702547125472254732547425475254762547725478254792548025481254822548325484254852548625487254882548925490254912549225493254942549525496254972549825499255002550125502255032550425505255062550725508255092551025511255122551325514255152551625517255182551925520255212552225523255242552525526255272552825529255302553125532255332553425535255362553725538255392554025541255422554325544255452554625547255482554925550255512555225553255542555525556255572555825559255602556125562255632556425565255662556725568255692557025571255722557325574255752557625577255782557925580255812558225583255842558525586255872558825589255902559125592255932559425595255962559725598255992560025601256022560325604256052560625607256082560925610256112561225613256142561525616256172561825619256202562125622256232562425625256262562725628256292563025631256322563325634256352563625637256382563925640256412564225643256442564525646256472564825649256502565125652256532565425655256562565725658256592566025661256622566325664256652566625667256682566925670256712567225673256742567525676256772567825679256802568125682256832568425685256862568725688256892569025691256922569325694256952569625697256982569925700257012570225703257042570525706257072570825709257102571125712257132571425715257162571725718257192572025721257222572325724257252572625727257282572925730257312573225733257342573525736257372573825739257402574125742257432574425745257462574725748257492575025751257522575325754257552575625757257582575925760257612576225763257642576525766257672576825769257702577125772257732577425775257762577725778257792578025781257822578325784257852578625787257882578925790257912579225793257942579525796257972579825799258002580125802258032580425805258062580725808258092581025811258122581325814258152581625817258182581925820258212582225823258242582525826258272582825829258302583125832258332583425835258362583725838258392584025841258422584325844258452584625847258482584925850258512585225853258542585525856258572585825859258602586125862258632586425865258662586725868258692587025871258722587325874258752587625877258782587925880258812588225883258842588525886258872588825889258902589125892258932589425895258962589725898258992590025901259022590325904259052590625907259082590925910259112591225913259142591525916259172591825919259202592125922259232592425925259262592725928259292593025931259322593325934259352593625937259382593925940259412594225943259442594525946259472594825949259502595125952259532595425955259562595725958259592596025961259622596325964259652596625967259682596925970259712597225973259742597525976259772597825979259802598125982259832598425985259862598725988259892599025991259922599325994259952599625997259982599926000260012600226003260042600526006260072600826009260102601126012260132601426015260162601726018260192602026021260222602326024260252602626027260282602926030260312603226033260342603526036260372603826039260402604126042260432604426045260462604726048260492605026051260522605326054260552605626057260582605926060260612606226063260642606526066260672606826069260702607126072260732607426075260762607726078260792608026081260822608326084260852608626087260882608926090260912609226093260942609526096260972609826099261002610126102261032610426105261062610726108261092611026111261122611326114261152611626117261182611926120261212612226123261242612526126261272612826129261302613126132261332613426135261362613726138261392614026141261422614326144261452614626147261482614926150261512615226153261542615526156261572615826159261602616126162261632616426165261662616726168261692617026171261722617326174261752617626177261782617926180261812618226183261842618526186261872618826189261902619126192261932619426195261962619726198261992620026201262022620326204262052620626207262082620926210262112621226213262142621526216262172621826219262202622126222262232622426225262262622726228262292623026231262322623326234262352623626237262382623926240262412624226243262442624526246262472624826249262502625126252262532625426255262562625726258262592626026261262622626326264262652626626267262682626926270262712627226273262742627526276262772627826279262802628126282262832628426285262862628726288262892629026291262922629326294262952629626297262982629926300263012630226303263042630526306263072630826309263102631126312263132631426315263162631726318263192632026321263222632326324263252632626327263282632926330263312633226333263342633526336263372633826339263402634126342263432634426345263462634726348263492635026351263522635326354263552635626357263582635926360263612636226363263642636526366263672636826369263702637126372263732637426375263762637726378263792638026381263822638326384263852638626387263882638926390263912639226393263942639526396263972639826399264002640126402264032640426405264062640726408264092641026411264122641326414264152641626417264182641926420264212642226423264242642526426264272642826429264302643126432264332643426435264362643726438264392644026441264422644326444264452644626447264482644926450264512645226453264542645526456264572645826459264602646126462264632646426465264662646726468264692647026471264722647326474264752647626477264782647926480264812648226483264842648526486264872648826489264902649126492264932649426495264962649726498264992650026501265022650326504265052650626507265082650926510265112651226513265142651526516265172651826519265202652126522265232652426525265262652726528265292653026531265322653326534265352653626537265382653926540265412654226543265442654526546265472654826549265502655126552265532655426555265562655726558265592656026561265622656326564265652656626567265682656926570265712657226573265742657526576265772657826579265802658126582265832658426585265862658726588265892659026591265922659326594265952659626597265982659926600266012660226603266042660526606266072660826609266102661126612266132661426615266162661726618266192662026621266222662326624266252662626627266282662926630266312663226633266342663526636266372663826639266402664126642266432664426645266462664726648266492665026651266522665326654266552665626657266582665926660266612666226663266642666526666266672666826669266702667126672266732667426675266762667726678266792668026681266822668326684266852668626687266882668926690266912669226693266942669526696266972669826699267002670126702267032670426705267062670726708267092671026711267122671326714267152671626717267182671926720267212672226723267242672526726267272672826729267302673126732267332673426735267362673726738267392674026741267422674326744267452674626747267482674926750267512675226753267542675526756267572675826759267602676126762267632676426765267662676726768267692677026771267722677326774267752677626777267782677926780267812678226783267842678526786267872678826789267902679126792267932679426795267962679726798267992680026801268022680326804268052680626807268082680926810268112681226813268142681526816268172681826819268202682126822268232682426825268262682726828268292683026831268322683326834268352683626837268382683926840268412684226843268442684526846268472684826849268502685126852268532685426855268562685726858268592686026861268622686326864268652686626867268682686926870268712687226873268742687526876268772687826879268802688126882268832688426885268862688726888268892689026891268922689326894268952689626897268982689926900269012690226903269042690526906269072690826909269102691126912269132691426915269162691726918269192692026921269222692326924269252692626927269282692926930269312693226933269342693526936269372693826939269402694126942269432694426945269462694726948269492695026951269522695326954269552695626957269582695926960269612696226963269642696526966269672696826969269702697126972269732697426975269762697726978269792698026981269822698326984269852698626987269882698926990269912699226993269942699526996269972699826999270002700127002270032700427005270062700727008270092701027011270122701327014270152701627017270182701927020270212702227023270242702527026270272702827029270302703127032270332703427035270362703727038270392704027041270422704327044270452704627047270482704927050270512705227053270542705527056270572705827059270602706127062270632706427065270662706727068270692707027071270722707327074270752707627077270782707927080270812708227083270842708527086270872708827089270902709127092270932709427095270962709727098270992710027101271022710327104271052710627107271082710927110271112711227113271142711527116271172711827119271202712127122271232712427125271262712727128271292713027131271322713327134271352713627137271382713927140271412714227143271442714527146271472714827149271502715127152271532715427155271562715727158271592716027161271622716327164271652716627167271682716927170271712717227173271742717527176271772717827179271802718127182271832718427185271862718727188271892719027191271922719327194271952719627197271982719927200272012720227203272042720527206272072720827209272102721127212272132721427215272162721727218272192722027221272222722327224272252722627227272282722927230272312723227233272342723527236272372723827239272402724127242272432724427245272462724727248272492725027251272522725327254272552725627257272582725927260272612726227263272642726527266272672726827269272702727127272272732727427275272762727727278272792728027281272822728327284272852728627287272882728927290272912729227293272942729527296272972729827299273002730127302273032730427305273062730727308273092731027311273122731327314273152731627317273182731927320273212732227323273242732527326273272732827329273302733127332273332733427335273362733727338273392734027341273422734327344273452734627347273482734927350273512735227353273542735527356273572735827359273602736127362273632736427365273662736727368273692737027371273722737327374273752737627377273782737927380273812738227383273842738527386273872738827389273902739127392273932739427395273962739727398273992740027401274022740327404274052740627407274082740927410274112741227413274142741527416274172741827419274202742127422274232742427425274262742727428274292743027431274322743327434274352743627437274382743927440274412744227443274442744527446274472744827449274502745127452274532745427455274562745727458274592746027461274622746327464274652746627467274682746927470274712747227473274742747527476274772747827479274802748127482274832748427485274862748727488274892749027491274922749327494274952749627497274982749927500275012750227503275042750527506275072750827509275102751127512275132751427515275162751727518275192752027521275222752327524275252752627527275282752927530275312753227533275342753527536275372753827539275402754127542275432754427545275462754727548275492755027551275522755327554275552755627557275582755927560275612756227563275642756527566275672756827569275702757127572275732757427575275762757727578275792758027581275822758327584275852758627587275882758927590275912759227593275942759527596275972759827599276002760127602276032760427605276062760727608276092761027611276122761327614276152761627617276182761927620276212762227623276242762527626276272762827629276302763127632276332763427635276362763727638276392764027641276422764327644276452764627647276482764927650276512765227653276542765527656276572765827659276602766127662276632766427665276662766727668276692767027671276722767327674276752767627677276782767927680276812768227683276842768527686276872768827689276902769127692276932769427695276962769727698276992770027701277022770327704277052770627707277082770927710277112771227713277142771527716277172771827719277202772127722277232772427725277262772727728277292773027731277322773327734277352773627737277382773927740277412774227743277442774527746277472774827749277502775127752277532775427755277562775727758277592776027761277622776327764277652776627767277682776927770277712777227773277742777527776277772777827779277802778127782277832778427785277862778727788277892779027791277922779327794277952779627797277982779927800278012780227803278042780527806278072780827809278102781127812278132781427815278162781727818278192782027821278222782327824278252782627827278282782927830278312783227833278342783527836278372783827839278402784127842278432784427845278462784727848278492785027851278522785327854278552785627857278582785927860278612786227863278642786527866278672786827869278702787127872278732787427875278762787727878278792788027881278822788327884278852788627887278882788927890278912789227893278942789527896278972789827899279002790127902279032790427905279062790727908279092791027911279122791327914279152791627917279182791927920279212792227923279242792527926279272792827929279302793127932279332793427935279362793727938279392794027941279422794327944279452794627947279482794927950279512795227953279542795527956279572795827959279602796127962279632796427965279662796727968279692797027971279722797327974279752797627977279782797927980279812798227983279842798527986279872798827989279902799127992279932799427995279962799727998279992800028001280022800328004280052800628007280082800928010280112801228013280142801528016280172801828019280202802128022280232802428025280262802728028280292803028031280322803328034280352803628037280382803928040280412804228043280442804528046280472804828049280502805128052280532805428055280562805728058280592806028061280622806328064280652806628067280682806928070280712807228073280742807528076280772807828079280802808128082280832808428085280862808728088280892809028091280922809328094280952809628097280982809928100281012810228103281042810528106281072810828109281102811128112281132811428115281162811728118281192812028121281222812328124281252812628127281282812928130281312813228133281342813528136281372813828139281402814128142281432814428145281462814728148281492815028151281522815328154281552815628157281582815928160281612816228163281642816528166281672816828169281702817128172281732817428175281762817728178281792818028181281822818328184281852818628187281882818928190281912819228193281942819528196281972819828199282002820128202282032820428205282062820728208282092821028211282122821328214282152821628217282182821928220282212822228223282242822528226282272822828229282302823128232282332823428235282362823728238282392824028241282422824328244282452824628247282482824928250282512825228253282542825528256282572825828259282602826128262282632826428265282662826728268282692827028271282722827328274282752827628277282782827928280282812828228283282842828528286282872828828289282902829128292282932829428295282962829728298282992830028301283022830328304283052830628307283082830928310283112831228313283142831528316283172831828319283202832128322283232832428325283262832728328283292833028331283322833328334283352833628337283382833928340283412834228343283442834528346283472834828349283502835128352283532835428355283562835728358283592836028361283622836328364283652836628367283682836928370283712837228373283742837528376283772837828379283802838128382283832838428385283862838728388283892839028391283922839328394283952839628397283982839928400284012840228403284042840528406284072840828409284102841128412284132841428415284162841728418284192842028421284222842328424284252842628427284282842928430284312843228433284342843528436284372843828439284402844128442284432844428445284462844728448284492845028451284522845328454284552845628457284582845928460284612846228463284642846528466284672846828469284702847128472284732847428475284762847728478284792848028481284822848328484284852848628487284882848928490284912849228493284942849528496284972849828499285002850128502285032850428505285062850728508285092851028511285122851328514285152851628517285182851928520285212852228523285242852528526285272852828529285302853128532285332853428535285362853728538285392854028541285422854328544285452854628547285482854928550285512855228553285542855528556285572855828559285602856128562285632856428565285662856728568285692857028571285722857328574285752857628577285782857928580285812858228583285842858528586285872858828589285902859128592285932859428595285962859728598285992860028601286022860328604286052860628607286082860928610286112861228613286142861528616286172861828619286202862128622286232862428625286262862728628286292863028631286322863328634286352863628637286382863928640286412864228643286442864528646286472864828649286502865128652286532865428655286562865728658286592866028661286622866328664286652866628667286682866928670286712867228673286742867528676286772867828679286802868128682286832868428685286862868728688286892869028691286922869328694286952869628697286982869928700287012870228703287042870528706287072870828709287102871128712287132871428715287162871728718287192872028721287222872328724287252872628727287282872928730287312873228733287342873528736287372873828739287402874128742287432874428745287462874728748287492875028751287522875328754287552875628757287582875928760287612876228763287642876528766287672876828769287702877128772287732877428775287762877728778287792878028781287822878328784287852878628787287882878928790287912879228793287942879528796287972879828799288002880128802288032880428805288062880728808288092881028811288122881328814288152881628817288182881928820288212882228823288242882528826288272882828829288302883128832288332883428835288362883728838288392884028841288422884328844288452884628847288482884928850288512885228853288542885528856288572885828859288602886128862288632886428865288662886728868288692887028871288722887328874288752887628877288782887928880288812888228883288842888528886288872888828889288902889128892288932889428895288962889728898288992890028901289022890328904289052890628907289082890928910289112891228913289142891528916289172891828919289202892128922289232892428925289262892728928289292893028931289322893328934289352893628937289382893928940289412894228943289442894528946289472894828949289502895128952289532895428955289562895728958289592896028961289622896328964289652896628967289682896928970289712897228973289742897528976289772897828979289802898128982289832898428985289862898728988289892899028991289922899328994289952899628997289982899929000290012900229003290042900529006290072900829009290102901129012290132901429015290162901729018290192902029021290222902329024290252902629027290282902929030290312903229033290342903529036290372903829039290402904129042290432904429045290462904729048290492905029051290522905329054290552905629057290582905929060290612906229063290642906529066290672906829069290702907129072290732907429075290762907729078290792908029081290822908329084290852908629087290882908929090290912909229093290942909529096290972909829099291002910129102291032910429105291062910729108291092911029111291122911329114291152911629117291182911929120291212912229123291242912529126291272912829129291302913129132291332913429135291362913729138291392914029141291422914329144291452914629147291482914929150291512915229153291542915529156291572915829159291602916129162291632916429165291662916729168291692917029171291722917329174291752917629177291782917929180291812918229183291842918529186291872918829189291902919129192291932919429195291962919729198291992920029201292022920329204292052920629207292082920929210292112921229213292142921529216292172921829219292202922129222292232922429225292262922729228292292923029231292322923329234292352923629237292382923929240292412924229243292442924529246292472924829249292502925129252292532925429255292562925729258292592926029261292622926329264292652926629267292682926929270292712927229273292742927529276292772927829279292802928129282292832928429285292862928729288292892929029291292922929329294292952929629297292982929929300293012930229303293042930529306293072930829309293102931129312293132931429315293162931729318293192932029321293222932329324293252932629327293282932929330293312933229333293342933529336293372933829339293402934129342293432934429345293462934729348293492935029351293522935329354293552935629357293582935929360293612936229363293642936529366293672936829369293702937129372293732937429375293762937729378293792938029381293822938329384293852938629387293882938929390293912939229393293942939529396293972939829399294002940129402294032940429405294062940729408294092941029411294122941329414294152941629417294182941929420294212942229423294242942529426294272942829429294302943129432294332943429435294362943729438294392944029441294422944329444294452944629447294482944929450294512945229453294542945529456294572945829459294602946129462294632946429465294662946729468294692947029471294722947329474294752947629477294782947929480294812948229483294842948529486294872948829489294902949129492294932949429495294962949729498294992950029501295022950329504295052950629507295082950929510295112951229513295142951529516295172951829519295202952129522295232952429525295262952729528295292953029531295322953329534295352953629537295382953929540295412954229543295442954529546295472954829549295502955129552295532955429555295562955729558295592956029561295622956329564295652956629567295682956929570295712957229573295742957529576295772957829579295802958129582295832958429585295862958729588295892959029591295922959329594295952959629597295982959929600296012960229603296042960529606296072960829609296102961129612296132961429615296162961729618296192962029621296222962329624296252962629627296282962929630296312963229633296342963529636296372963829639296402964129642296432964429645296462964729648296492965029651296522965329654296552965629657296582965929660296612966229663296642966529666296672966829669296702967129672296732967429675296762967729678296792968029681296822968329684296852968629687296882968929690296912969229693296942969529696296972969829699297002970129702297032970429705297062970729708297092971029711297122971329714297152971629717297182971929720297212972229723297242972529726297272972829729297302973129732297332973429735297362973729738297392974029741297422974329744297452974629747297482974929750297512975229753297542975529756297572975829759297602976129762297632976429765297662976729768297692977029771297722977329774297752977629777297782977929780297812978229783297842978529786297872978829789297902979129792297932979429795297962979729798297992980029801298022980329804298052980629807298082980929810298112981229813298142981529816298172981829819298202982129822298232982429825298262982729828298292983029831298322983329834298352983629837298382983929840298412984229843298442984529846298472984829849298502985129852298532985429855298562985729858298592986029861298622986329864298652986629867298682986929870298712987229873298742987529876298772987829879298802988129882298832988429885298862988729888298892989029891298922989329894298952989629897298982989929900299012990229903299042990529906299072990829909299102991129912299132991429915299162991729918299192992029921299222992329924299252992629927299282992929930299312993229933299342993529936299372993829939299402994129942299432994429945299462994729948299492995029951299522995329954299552995629957299582995929960299612996229963299642996529966299672996829969299702997129972299732997429975299762997729978299792998029981299822998329984299852998629987299882998929990299912999229993299942999529996299972999829999300003000130002300033000430005300063000730008300093001030011300123001330014300153001630017300183001930020300213002230023300243002530026300273002830029300303003130032300333003430035300363003730038300393004030041300423004330044300453004630047300483004930050300513005230053300543005530056300573005830059300603006130062300633006430065300663006730068300693007030071300723007330074300753007630077300783007930080300813008230083300843008530086300873008830089300903009130092300933009430095300963009730098300993010030101301023010330104301053010630107301083010930110301113011230113301143011530116301173011830119301203012130122301233012430125301263012730128301293013030131301323013330134301353013630137301383013930140301413014230143301443014530146301473014830149301503015130152301533015430155301563015730158301593016030161301623016330164301653016630167301683016930170301713017230173301743017530176301773017830179301803018130182301833018430185301863018730188301893019030191301923019330194301953019630197301983019930200302013020230203302043020530206302073020830209302103021130212302133021430215302163021730218302193022030221302223022330224302253022630227302283022930230302313023230233302343023530236302373023830239302403024130242302433024430245302463024730248302493025030251302523025330254302553025630257302583025930260302613026230263302643026530266302673026830269302703027130272302733027430275302763027730278302793028030281302823028330284302853028630287302883028930290302913029230293302943029530296302973029830299303003030130302303033030430305303063030730308303093031030311303123031330314303153031630317303183031930320303213032230323303243032530326303273032830329303303033130332303333033430335303363033730338303393034030341303423034330344303453034630347303483034930350303513035230353303543035530356303573035830359303603036130362303633036430365303663036730368303693037030371303723037330374303753037630377303783037930380303813038230383303843038530386303873038830389303903039130392303933039430395303963039730398303993040030401304023040330404304053040630407304083040930410304113041230413304143041530416304173041830419304203042130422304233042430425304263042730428304293043030431304323043330434304353043630437304383043930440304413044230443304443044530446304473044830449304503045130452304533045430455304563045730458304593046030461304623046330464304653046630467304683046930470304713047230473304743047530476304773047830479304803048130482304833048430485304863048730488304893049030491304923049330494304953049630497304983049930500305013050230503305043050530506305073050830509305103051130512305133051430515305163051730518305193052030521305223052330524305253052630527305283052930530305313053230533305343053530536305373053830539305403054130542305433054430545305463054730548305493055030551305523055330554305553055630557305583055930560305613056230563305643056530566305673056830569305703057130572305733057430575305763057730578305793058030581305823058330584305853058630587305883058930590305913059230593305943059530596305973059830599306003060130602306033060430605306063060730608306093061030611306123061330614306153061630617306183061930620306213062230623306243062530626306273062830629306303063130632306333063430635306363063730638306393064030641306423064330644306453064630647306483064930650306513065230653306543065530656306573065830659306603066130662306633066430665306663066730668306693067030671306723067330674306753067630677306783067930680306813068230683306843068530686306873068830689306903069130692306933069430695306963069730698306993070030701307023070330704307053070630707307083070930710307113071230713307143071530716307173071830719307203072130722307233072430725307263072730728307293073030731307323073330734307353073630737307383073930740307413074230743307443074530746307473074830749307503075130752307533075430755307563075730758307593076030761307623076330764307653076630767307683076930770307713077230773307743077530776307773077830779307803078130782307833078430785307863078730788307893079030791307923079330794307953079630797307983079930800308013080230803308043080530806308073080830809308103081130812308133081430815308163081730818308193082030821308223082330824308253082630827308283082930830308313083230833308343083530836308373083830839308403084130842308433084430845308463084730848308493085030851308523085330854308553085630857308583085930860308613086230863308643086530866308673086830869308703087130872308733087430875308763087730878308793088030881308823088330884308853088630887308883088930890308913089230893308943089530896308973089830899309003090130902309033090430905309063090730908309093091030911309123091330914309153091630917309183091930920309213092230923309243092530926309273092830929309303093130932309333093430935309363093730938309393094030941309423094330944309453094630947309483094930950309513095230953309543095530956309573095830959309603096130962309633096430965309663096730968309693097030971309723097330974309753097630977309783097930980309813098230983309843098530986309873098830989309903099130992309933099430995309963099730998309993100031001310023100331004310053100631007310083100931010310113101231013310143101531016310173101831019310203102131022310233102431025310263102731028310293103031031310323103331034310353103631037310383103931040310413104231043310443104531046310473104831049310503105131052310533105431055310563105731058310593106031061310623106331064310653106631067310683106931070310713107231073310743107531076310773107831079310803108131082310833108431085310863108731088310893109031091310923109331094310953109631097310983109931100311013110231103311043110531106311073110831109311103111131112311133111431115311163111731118311193112031121311223112331124311253112631127311283112931130311313113231133311343113531136311373113831139311403114131142311433114431145311463114731148311493115031151311523115331154311553115631157311583115931160311613116231163311643116531166311673116831169311703117131172311733117431175311763117731178311793118031181311823118331184311853118631187311883118931190311913119231193311943119531196311973119831199312003120131202312033120431205312063120731208312093121031211312123121331214312153121631217312183121931220312213122231223312243122531226312273122831229312303123131232312333123431235312363123731238312393124031241312423124331244312453124631247312483124931250312513125231253312543125531256312573125831259312603126131262312633126431265312663126731268312693127031271312723127331274312753127631277312783127931280312813128231283312843128531286312873128831289312903129131292312933129431295312963129731298312993130031301313023130331304313053130631307313083130931310313113131231313313143131531316313173131831319313203132131322313233132431325313263132731328313293133031331313323133331334313353133631337313383133931340313413134231343313443134531346313473134831349313503135131352313533135431355313563135731358313593136031361313623136331364313653136631367313683136931370313713137231373313743137531376313773137831379313803138131382313833138431385313863138731388313893139031391313923139331394313953139631397313983139931400314013140231403314043140531406314073140831409314103141131412314133141431415314163141731418314193142031421314223142331424314253142631427314283142931430314313143231433314343143531436314373143831439314403144131442314433144431445314463144731448314493145031451314523145331454314553145631457314583145931460314613146231463314643146531466314673146831469314703147131472314733147431475314763147731478314793148031481314823148331484314853148631487314883148931490314913149231493314943149531496314973149831499315003150131502315033150431505315063150731508315093151031511315123151331514315153151631517315183151931520315213152231523315243152531526315273152831529315303153131532315333153431535315363153731538315393154031541315423154331544315453154631547315483154931550315513155231553315543155531556315573155831559315603156131562315633156431565315663156731568315693157031571315723157331574315753157631577315783157931580315813158231583315843158531586315873158831589315903159131592315933159431595315963159731598315993160031601316023160331604316053160631607316083160931610316113161231613316143161531616316173161831619316203162131622316233162431625316263162731628316293163031631316323163331634316353163631637316383163931640316413164231643316443164531646316473164831649316503165131652316533165431655316563165731658316593166031661316623166331664316653166631667316683166931670316713167231673316743167531676316773167831679316803168131682316833168431685316863168731688316893169031691316923169331694316953169631697316983169931700317013170231703317043170531706317073170831709317103171131712317133171431715317163171731718317193172031721317223172331724317253172631727317283172931730317313173231733317343173531736317373173831739317403174131742317433174431745317463174731748317493175031751317523175331754317553175631757317583175931760317613176231763317643176531766317673176831769317703177131772317733177431775317763177731778317793178031781317823178331784317853178631787317883178931790317913179231793317943179531796317973179831799318003180131802318033180431805318063180731808318093181031811318123181331814318153181631817318183181931820318213182231823318243182531826318273182831829318303183131832318333183431835318363183731838318393184031841318423184331844318453184631847318483184931850318513185231853318543185531856318573185831859318603186131862318633186431865318663186731868318693187031871318723187331874318753187631877318783187931880318813188231883318843188531886318873188831889318903189131892318933189431895318963189731898318993190031901319023190331904319053190631907319083190931910319113191231913319143191531916319173191831919319203192131922319233192431925319263192731928319293193031931319323193331934319353193631937319383193931940319413194231943319443194531946319473194831949319503195131952319533195431955319563195731958319593196031961319623196331964319653196631967319683196931970319713197231973319743197531976319773197831979319803198131982319833198431985319863198731988319893199031991319923199331994319953199631997319983199932000320013200232003320043200532006320073200832009320103201132012320133201432015320163201732018320193202032021320223202332024320253202632027320283202932030320313203232033320343203532036320373203832039320403204132042320433204432045320463204732048320493205032051320523205332054320553205632057320583205932060320613206232063320643206532066320673206832069320703207132072320733207432075320763207732078320793208032081320823208332084320853208632087320883208932090320913209232093320943209532096320973209832099321003210132102321033210432105321063210732108321093211032111321123211332114321153211632117321183211932120321213212232123321243212532126321273212832129321303213132132321333213432135321363213732138321393214032141321423214332144321453214632147321483214932150321513215232153321543215532156321573215832159321603216132162321633216432165321663216732168321693217032171321723217332174321753217632177321783217932180321813218232183321843218532186321873218832189321903219132192321933219432195321963219732198321993220032201322023220332204322053220632207322083220932210322113221232213322143221532216322173221832219322203222132222322233222432225322263222732228322293223032231322323223332234322353223632237322383223932240322413224232243322443224532246322473224832249322503225132252322533225432255322563225732258322593226032261322623226332264322653226632267322683226932270322713227232273322743227532276322773227832279322803228132282322833228432285322863228732288322893229032291322923229332294322953229632297322983229932300323013230232303323043230532306323073230832309323103231132312323133231432315323163231732318323193232032321323223232332324323253232632327323283232932330323313233232333323343233532336323373233832339323403234132342323433234432345323463234732348323493235032351323523235332354323553235632357323583235932360323613236232363323643236532366323673236832369323703237132372323733237432375323763237732378323793238032381323823238332384323853238632387323883238932390323913239232393323943239532396323973239832399324003240132402324033240432405324063240732408324093241032411324123241332414324153241632417324183241932420324213242232423324243242532426324273242832429324303243132432324333243432435324363243732438324393244032441324423244332444324453244632447324483244932450324513245232453324543245532456324573245832459324603246132462324633246432465324663246732468324693247032471324723247332474324753247632477324783247932480324813248232483324843248532486324873248832489324903249132492324933249432495324963249732498324993250032501325023250332504325053250632507325083250932510325113251232513325143251532516325173251832519325203252132522325233252432525325263252732528325293253032531325323253332534325353253632537325383253932540325413254232543325443254532546325473254832549325503255132552325533255432555325563255732558325593256032561325623256332564325653256632567325683256932570325713257232573325743257532576325773257832579325803258132582325833258432585325863258732588325893259032591325923259332594325953259632597325983259932600326013260232603326043260532606326073260832609326103261132612326133261432615326163261732618326193262032621326223262332624326253262632627326283262932630326313263232633326343263532636326373263832639326403264132642326433264432645326463264732648326493265032651326523265332654326553265632657326583265932660326613266232663326643266532666326673266832669326703267132672326733267432675326763267732678326793268032681326823268332684326853268632687326883268932690326913269232693326943269532696326973269832699327003270132702327033270432705327063270732708327093271032711327123271332714327153271632717327183271932720327213272232723327243272532726327273272832729327303273132732327333273432735327363273732738327393274032741327423274332744327453274632747327483274932750327513275232753327543275532756327573275832759327603276132762327633276432765327663276732768327693277032771327723277332774327753277632777327783277932780327813278232783327843278532786327873278832789327903279132792327933279432795327963279732798327993280032801328023280332804328053280632807328083280932810328113281232813328143281532816328173281832819328203282132822328233282432825328263282732828328293283032831328323283332834328353283632837328383283932840328413284232843328443284532846328473284832849328503285132852328533285432855328563285732858328593286032861328623286332864328653286632867328683286932870328713287232873328743287532876328773287832879328803288132882328833288432885328863288732888328893289032891328923289332894328953289632897328983289932900329013290232903329043290532906329073290832909329103291132912329133291432915329163291732918329193292032921329223292332924329253292632927329283292932930329313293232933329343293532936329373293832939329403294132942329433294432945329463294732948329493295032951329523295332954329553295632957329583295932960329613296232963329643296532966329673296832969329703297132972329733297432975329763297732978329793298032981329823298332984329853298632987329883298932990329913299232993329943299532996329973299832999330003300133002330033300433005330063300733008330093301033011330123301333014330153301633017330183301933020330213302233023330243302533026330273302833029330303303133032330333303433035330363303733038330393304033041330423304333044330453304633047330483304933050330513305233053330543305533056330573305833059330603306133062330633306433065330663306733068330693307033071330723307333074330753307633077330783307933080330813308233083330843308533086330873308833089330903309133092330933309433095330963309733098330993310033101331023310333104331053310633107331083310933110331113311233113331143311533116331173311833119331203312133122331233312433125331263312733128331293313033131331323313333134331353313633137331383313933140331413314233143331443314533146331473314833149331503315133152331533315433155331563315733158331593316033161331623316333164331653316633167331683316933170331713317233173331743317533176331773317833179331803318133182331833318433185331863318733188331893319033191331923319333194331953319633197331983319933200332013320233203332043320533206332073320833209332103321133212332133321433215332163321733218332193322033221332223322333224332253322633227332283322933230332313323233233332343323533236332373323833239332403324133242332433324433245332463324733248332493325033251332523325333254332553325633257332583325933260332613326233263332643326533266332673326833269332703327133272332733327433275332763327733278332793328033281332823328333284332853328633287332883328933290332913329233293332943329533296332973329833299333003330133302333033330433305333063330733308333093331033311333123331333314333153331633317333183331933320333213332233323333243332533326333273332833329333303333133332333333333433335333363333733338333393334033341333423334333344333453334633347333483334933350333513335233353333543335533356333573335833359333603336133362333633336433365333663336733368333693337033371333723337333374333753337633377333783337933380333813338233383333843338533386333873338833389333903339133392333933339433395333963339733398333993340033401334023340333404334053340633407334083340933410334113341233413334143341533416334173341833419334203342133422334233342433425334263342733428334293343033431334323343333434334353343633437334383343933440334413344233443334443344533446334473344833449334503345133452334533345433455334563345733458334593346033461334623346333464334653346633467334683346933470334713347233473334743347533476334773347833479334803348133482334833348433485334863348733488334893349033491334923349333494334953349633497334983349933500335013350233503335043350533506335073350833509335103351133512335133351433515335163351733518335193352033521335223352333524335253352633527335283352933530335313353233533335343353533536335373353833539335403354133542335433354433545335463354733548335493355033551335523355333554335553355633557335583355933560335613356233563335643356533566335673356833569335703357133572335733357433575335763357733578335793358033581335823358333584335853358633587335883358933590335913359233593335943359533596335973359833599336003360133602336033360433605336063360733608336093361033611336123361333614336153361633617336183361933620336213362233623336243362533626336273362833629336303363133632336333363433635336363363733638336393364033641336423364333644336453364633647336483364933650336513365233653336543365533656336573365833659336603366133662336633366433665336663366733668336693367033671336723367333674336753367633677336783367933680336813368233683336843368533686336873368833689336903369133692336933369433695336963369733698336993370033701337023370333704337053370633707337083370933710337113371233713337143371533716337173371833719337203372133722337233372433725337263372733728337293373033731337323373333734337353373633737337383373933740337413374233743337443374533746337473374833749337503375133752337533375433755337563375733758337593376033761337623376333764337653376633767337683376933770337713377233773337743377533776337773377833779337803378133782337833378433785337863378733788337893379033791337923379333794337953379633797337983379933800338013380233803338043380533806338073380833809338103381133812338133381433815338163381733818338193382033821338223382333824338253382633827338283382933830338313383233833338343383533836338373383833839338403384133842338433384433845338463384733848338493385033851338523385333854338553385633857338583385933860338613386233863338643386533866338673386833869338703387133872338733387433875338763387733878338793388033881338823388333884338853388633887338883388933890338913389233893338943389533896338973389833899339003390133902339033390433905339063390733908339093391033911339123391333914339153391633917339183391933920339213392233923339243392533926339273392833929339303393133932339333393433935339363393733938339393394033941339423394333944339453394633947339483394933950339513395233953339543395533956339573395833959339603396133962339633396433965339663396733968339693397033971339723397333974339753397633977339783397933980339813398233983339843398533986339873398833989339903399133992339933399433995339963399733998339993400034001340023400334004340053400634007340083400934010340113401234013340143401534016340173401834019340203402134022340233402434025340263402734028340293403034031340323403334034340353403634037340383403934040340413404234043340443404534046340473404834049340503405134052340533405434055340563405734058340593406034061340623406334064340653406634067340683406934070340713407234073340743407534076340773407834079340803408134082340833408434085340863408734088340893409034091340923409334094340953409634097340983409934100341013410234103341043410534106341073410834109341103411134112341133411434115341163411734118341193412034121341223412334124341253412634127341283412934130341313413234133341343413534136341373413834139341403414134142341433414434145341463414734148341493415034151341523415334154341553415634157341583415934160341613416234163341643416534166341673416834169341703417134172341733417434175341763417734178341793418034181341823418334184341853418634187341883418934190341913419234193341943419534196341973419834199342003420134202342033420434205342063420734208342093421034211342123421334214342153421634217342183421934220342213422234223342243422534226342273422834229342303423134232342333423434235342363423734238342393424034241342423424334244342453424634247342483424934250342513425234253342543425534256342573425834259342603426134262342633426434265342663426734268342693427034271342723427334274342753427634277342783427934280342813428234283342843428534286342873428834289342903429134292342933429434295342963429734298342993430034301343023430334304343053430634307343083430934310343113431234313343143431534316343173431834319343203432134322343233432434325343263432734328343293433034331343323433334334343353433634337343383433934340343413434234343343443434534346343473434834349343503435134352343533435434355343563435734358343593436034361343623436334364343653436634367343683436934370343713437234373343743437534376343773437834379343803438134382343833438434385343863438734388343893439034391343923439334394343953439634397343983439934400344013440234403344043440534406344073440834409344103441134412344133441434415344163441734418344193442034421344223442334424344253442634427344283442934430344313443234433344343443534436344373443834439344403444134442344433444434445344463444734448344493445034451344523445334454344553445634457344583445934460344613446234463344643446534466344673446834469344703447134472344733447434475344763447734478344793448034481344823448334484344853448634487344883448934490344913449234493344943449534496344973449834499345003450134502345033450434505345063450734508345093451034511345123451334514345153451634517345183451934520345213452234523345243452534526345273452834529345303453134532345333453434535345363453734538345393454034541345423454334544345453454634547345483454934550345513455234553345543455534556345573455834559345603456134562345633456434565345663456734568345693457034571345723457334574345753457634577345783457934580345813458234583345843458534586345873458834589345903459134592345933459434595345963459734598345993460034601346023460334604346053460634607346083460934610346113461234613346143461534616346173461834619346203462134622346233462434625346263462734628346293463034631346323463334634346353463634637346383463934640346413464234643346443464534646346473464834649346503465134652346533465434655346563465734658346593466034661346623466334664346653466634667346683466934670346713467234673346743467534676346773467834679346803468134682346833468434685346863468734688346893469034691346923469334694346953469634697346983469934700347013470234703347043470534706347073470834709347103471134712347133471434715347163471734718347193472034721347223472334724347253472634727347283472934730347313473234733347343473534736347373473834739347403474134742347433474434745347463474734748347493475034751347523475334754347553475634757347583475934760347613476234763347643476534766347673476834769347703477134772347733477434775347763477734778347793478034781347823478334784347853478634787347883478934790347913479234793347943479534796347973479834799348003480134802348033480434805348063480734808348093481034811348123481334814348153481634817348183481934820348213482234823348243482534826348273482834829348303483134832348333483434835348363483734838348393484034841348423484334844348453484634847348483484934850348513485234853348543485534856348573485834859348603486134862348633486434865348663486734868348693487034871348723487334874348753487634877348783487934880348813488234883348843488534886348873488834889348903489134892348933489434895348963489734898348993490034901349023490334904349053490634907349083490934910349113491234913349143491534916349173491834919349203492134922349233492434925349263492734928349293493034931349323493334934349353493634937349383493934940349413494234943349443494534946349473494834949349503495134952349533495434955349563495734958349593496034961349623496334964349653496634967349683496934970349713497234973349743497534976349773497834979349803498134982349833498434985349863498734988349893499034991349923499334994349953499634997349983499935000350013500235003350043500535006350073500835009350103501135012350133501435015350163501735018350193502035021350223502335024350253502635027350283502935030350313503235033350343503535036350373503835039350403504135042350433504435045350463504735048350493505035051350523505335054350553505635057350583505935060350613506235063350643506535066350673506835069350703507135072350733507435075350763507735078350793508035081350823508335084350853508635087350883508935090350913509235093350943509535096350973509835099351003510135102351033510435105351063510735108351093511035111351123511335114351153511635117351183511935120351213512235123351243512535126351273512835129351303513135132351333513435135351363513735138351393514035141351423514335144351453514635147351483514935150351513515235153351543515535156351573515835159351603516135162351633516435165351663516735168351693517035171351723517335174351753517635177351783517935180351813518235183351843518535186351873518835189351903519135192351933519435195351963519735198351993520035201352023520335204352053520635207352083520935210352113521235213352143521535216352173521835219352203522135222352233522435225352263522735228352293523035231352323523335234352353523635237352383523935240352413524235243352443524535246352473524835249352503525135252352533525435255352563525735258352593526035261352623526335264352653526635267352683526935270352713527235273352743527535276352773527835279352803528135282352833528435285352863528735288352893529035291352923529335294352953529635297352983529935300353013530235303353043530535306353073530835309353103531135312353133531435315353163531735318353193532035321353223532335324353253532635327353283532935330353313533235333353343533535336353373533835339353403534135342353433534435345353463534735348353493535035351353523535335354353553535635357353583535935360353613536235363353643536535366353673536835369353703537135372353733537435375353763537735378353793538035381353823538335384353853538635387353883538935390353913539235393353943539535396353973539835399354003540135402354033540435405354063540735408354093541035411354123541335414354153541635417354183541935420354213542235423354243542535426354273542835429354303543135432354333543435435354363543735438354393544035441354423544335444354453544635447354483544935450354513545235453354543545535456354573545835459354603546135462354633546435465354663546735468354693547035471354723547335474354753547635477354783547935480354813548235483354843548535486354873548835489354903549135492354933549435495354963549735498354993550035501355023550335504355053550635507355083550935510355113551235513355143551535516355173551835519355203552135522355233552435525355263552735528355293553035531355323553335534355353553635537355383553935540355413554235543355443554535546355473554835549355503555135552355533555435555355563555735558355593556035561355623556335564355653556635567355683556935570355713557235573355743557535576355773557835579355803558135582355833558435585355863558735588355893559035591355923559335594355953559635597355983559935600356013560235603356043560535606356073560835609356103561135612356133561435615356163561735618356193562035621356223562335624356253562635627356283562935630356313563235633356343563535636356373563835639356403564135642356433564435645356463564735648356493565035651356523565335654356553565635657356583565935660356613566235663356643566535666356673566835669356703567135672356733567435675356763567735678356793568035681356823568335684356853568635687356883568935690356913569235693356943569535696356973569835699357003570135702357033570435705357063570735708357093571035711357123571335714357153571635717357183571935720357213572235723357243572535726357273572835729357303573135732357333573435735357363573735738357393574035741357423574335744357453574635747357483574935750357513575235753357543575535756357573575835759357603576135762357633576435765357663576735768357693577035771357723577335774357753577635777357783577935780357813578235783357843578535786357873578835789357903579135792357933579435795357963579735798357993580035801358023580335804358053580635807358083580935810358113581235813358143581535816358173581835819358203582135822358233582435825358263582735828358293583035831358323583335834358353583635837358383583935840358413584235843358443584535846358473584835849358503585135852358533585435855358563585735858358593586035861358623586335864358653586635867358683586935870358713587235873358743587535876358773587835879358803588135882358833588435885358863588735888358893589035891358923589335894358953589635897358983589935900359013590235903359043590535906359073590835909359103591135912359133591435915359163591735918359193592035921359223592335924359253592635927359283592935930359313593235933359343593535936359373593835939359403594135942359433594435945359463594735948359493595035951359523595335954359553595635957359583595935960359613596235963359643596535966359673596835969359703597135972359733597435975359763597735978359793598035981359823598335984359853598635987359883598935990359913599235993359943599535996359973599835999360003600136002360033600436005360063600736008360093601036011360123601336014360153601636017360183601936020360213602236023360243602536026360273602836029360303603136032360333603436035360363603736038360393604036041360423604336044360453604636047360483604936050360513605236053360543605536056360573605836059360603606136062360633606436065360663606736068360693607036071360723607336074360753607636077360783607936080360813608236083360843608536086360873608836089360903609136092360933609436095360963609736098360993610036101361023610336104361053610636107361083610936110361113611236113361143611536116361173611836119361203612136122361233612436125361263612736128361293613036131361323613336134361353613636137361383613936140361413614236143361443614536146361473614836149361503615136152361533615436155361563615736158361593616036161361623616336164361653616636167361683616936170361713617236173361743617536176361773617836179361803618136182361833618436185361863618736188361893619036191361923619336194361953619636197361983619936200362013620236203362043620536206362073620836209362103621136212362133621436215362163621736218362193622036221362223622336224362253622636227362283622936230362313623236233362343623536236362373623836239362403624136242362433624436245362463624736248362493625036251362523625336254362553625636257362583625936260362613626236263362643626536266362673626836269362703627136272362733627436275362763627736278362793628036281362823628336284362853628636287362883628936290362913629236293362943629536296362973629836299363003630136302363033630436305363063630736308363093631036311363123631336314363153631636317363183631936320363213632236323363243632536326363273632836329363303633136332363333633436335363363633736338363393634036341363423634336344363453634636347363483634936350363513635236353363543635536356363573635836359363603636136362363633636436365363663636736368363693637036371363723637336374363753637636377363783637936380363813638236383363843638536386363873638836389363903639136392363933639436395363963639736398363993640036401364023640336404364053640636407364083640936410364113641236413364143641536416364173641836419364203642136422364233642436425364263642736428364293643036431364323643336434364353643636437364383643936440364413644236443364443644536446364473644836449364503645136452364533645436455364563645736458364593646036461364623646336464364653646636467364683646936470364713647236473364743647536476364773647836479364803648136482364833648436485364863648736488364893649036491364923649336494364953649636497364983649936500365013650236503365043650536506365073650836509365103651136512365133651436515365163651736518365193652036521365223652336524365253652636527365283652936530365313653236533365343653536536365373653836539365403654136542365433654436545365463654736548365493655036551365523655336554365553655636557365583655936560365613656236563365643656536566365673656836569365703657136572365733657436575365763657736578365793658036581365823658336584365853658636587365883658936590365913659236593365943659536596365973659836599366003660136602366033660436605366063660736608366093661036611366123661336614366153661636617366183661936620366213662236623366243662536626366273662836629366303663136632366333663436635366363663736638366393664036641366423664336644366453664636647366483664936650366513665236653366543665536656366573665836659366603666136662366633666436665366663666736668366693667036671366723667336674366753667636677366783667936680366813668236683366843668536686366873668836689366903669136692366933669436695366963669736698366993670036701367023670336704367053670636707367083670936710367113671236713367143671536716367173671836719367203672136722367233672436725367263672736728367293673036731367323673336734367353673636737367383673936740367413674236743367443674536746367473674836749367503675136752367533675436755367563675736758367593676036761367623676336764367653676636767367683676936770367713677236773367743677536776367773677836779367803678136782367833678436785367863678736788367893679036791367923679336794367953679636797367983679936800368013680236803368043680536806368073680836809368103681136812368133681436815368163681736818368193682036821368223682336824368253682636827368283682936830368313683236833368343683536836368373683836839368403684136842368433684436845368463684736848368493685036851368523685336854368553685636857368583685936860368613686236863368643686536866368673686836869368703687136872368733687436875368763687736878368793688036881368823688336884368853688636887368883688936890368913689236893368943689536896368973689836899369003690136902369033690436905369063690736908369093691036911369123691336914369153691636917369183691936920369213692236923369243692536926369273692836929369303693136932369333693436935369363693736938369393694036941369423694336944369453694636947369483694936950369513695236953369543695536956369573695836959369603696136962369633696436965369663696736968369693697036971369723697336974369753697636977369783697936980369813698236983369843698536986369873698836989369903699136992369933699436995369963699736998369993700037001370023700337004370053700637007370083700937010370113701237013370143701537016370173701837019370203702137022370233702437025370263702737028370293703037031370323703337034370353703637037370383703937040370413704237043370443704537046370473704837049370503705137052370533705437055370563705737058370593706037061370623706337064370653706637067370683706937070370713707237073370743707537076370773707837079370803708137082370833708437085370863708737088370893709037091370923709337094370953709637097370983709937100371013710237103371043710537106371073710837109371103711137112371133711437115371163711737118371193712037121371223712337124371253712637127371283712937130371313713237133371343713537136371373713837139371403714137142371433714437145371463714737148371493715037151371523715337154371553715637157371583715937160371613716237163371643716537166371673716837169371703717137172371733717437175371763717737178371793718037181371823718337184371853718637187371883718937190371913719237193371943719537196371973719837199372003720137202372033720437205372063720737208372093721037211372123721337214372153721637217372183721937220372213722237223372243722537226372273722837229372303723137232372333723437235372363723737238372393724037241372423724337244372453724637247372483724937250372513725237253372543725537256372573725837259372603726137262372633726437265372663726737268372693727037271372723727337274372753727637277372783727937280372813728237283372843728537286372873728837289372903729137292372933729437295372963729737298372993730037301373023730337304373053730637307373083730937310373113731237313373143731537316373173731837319373203732137322373233732437325373263732737328373293733037331373323733337334373353733637337373383733937340373413734237343373443734537346373473734837349373503735137352373533735437355373563735737358373593736037361373623736337364373653736637367373683736937370373713737237373373743737537376373773737837379373803738137382373833738437385373863738737388373893739037391373923739337394373953739637397373983739937400374013740237403374043740537406374073740837409374103741137412374133741437415374163741737418374193742037421374223742337424374253742637427374283742937430374313743237433374343743537436374373743837439374403744137442374433744437445374463744737448374493745037451374523745337454374553745637457374583745937460374613746237463374643746537466374673746837469374703747137472374733747437475374763747737478374793748037481374823748337484374853748637487374883748937490374913749237493374943749537496374973749837499375003750137502375033750437505375063750737508375093751037511375123751337514375153751637517375183751937520375213752237523375243752537526375273752837529375303753137532375333753437535375363753737538375393754037541375423754337544375453754637547375483754937550375513755237553375543755537556375573755837559375603756137562375633756437565375663756737568375693757037571375723757337574375753757637577375783757937580375813758237583375843758537586375873758837589375903759137592375933759437595375963759737598375993760037601376023760337604376053760637607376083760937610376113761237613376143761537616376173761837619376203762137622376233762437625376263762737628376293763037631376323763337634376353763637637376383763937640376413764237643376443764537646376473764837649376503765137652376533765437655376563765737658376593766037661376623766337664376653766637667376683766937670376713767237673376743767537676376773767837679376803768137682376833768437685376863768737688376893769037691376923769337694376953769637697376983769937700377013770237703377043770537706377073770837709377103771137712377133771437715377163771737718377193772037721377223772337724377253772637727377283772937730377313773237733377343773537736377373773837739377403774137742377433774437745377463774737748377493775037751377523775337754377553775637757377583775937760377613776237763377643776537766377673776837769377703777137772377733777437775377763777737778377793778037781377823778337784377853778637787377883778937790377913779237793377943779537796377973779837799378003780137802378033780437805378063780737808378093781037811378123781337814378153781637817378183781937820378213782237823378243782537826378273782837829378303783137832378333783437835378363783737838378393784037841378423784337844378453784637847378483784937850378513785237853378543785537856378573785837859378603786137862378633786437865378663786737868378693787037871378723787337874378753787637877378783787937880378813788237883378843788537886378873788837889378903789137892378933789437895378963789737898378993790037901379023790337904379053790637907379083790937910379113791237913379143791537916379173791837919379203792137922379233792437925379263792737928379293793037931379323793337934379353793637937379383793937940379413794237943379443794537946379473794837949379503795137952379533795437955379563795737958379593796037961379623796337964379653796637967379683796937970379713797237973379743797537976379773797837979379803798137982379833798437985379863798737988379893799037991379923799337994379953799637997379983799938000380013800238003380043800538006380073800838009380103801138012380133801438015380163801738018380193802038021380223802338024380253802638027380283802938030380313803238033380343803538036380373803838039380403804138042380433804438045380463804738048380493805038051380523805338054380553805638057380583805938060380613806238063380643806538066380673806838069380703807138072380733807438075380763807738078380793808038081380823808338084380853808638087380883808938090380913809238093380943809538096380973809838099381003810138102381033810438105381063810738108381093811038111381123811338114381153811638117381183811938120381213812238123381243812538126381273812838129381303813138132381333813438135381363813738138381393814038141381423814338144381453814638147381483814938150381513815238153381543815538156381573815838159381603816138162381633816438165381663816738168381693817038171381723817338174381753817638177381783817938180381813818238183381843818538186381873818838189381903819138192381933819438195381963819738198381993820038201382023820338204382053820638207382083820938210382113821238213382143821538216382173821838219382203822138222382233822438225382263822738228382293823038231382323823338234382353823638237382383823938240382413824238243382443824538246382473824838249382503825138252382533825438255382563825738258382593826038261382623826338264382653826638267382683826938270382713827238273382743827538276382773827838279382803828138282382833828438285382863828738288382893829038291382923829338294382953829638297382983829938300383013830238303383043830538306383073830838309383103831138312383133831438315383163831738318383193832038321383223832338324383253832638327383283832938330383313833238333383343833538336383373833838339383403834138342383433834438345383463834738348383493835038351383523835338354383553835638357383583835938360383613836238363383643836538366383673836838369383703837138372383733837438375383763837738378383793838038381383823838338384383853838638387383883838938390383913839238393383943839538396383973839838399384003840138402384033840438405384063840738408384093841038411384123841338414384153841638417384183841938420384213842238423384243842538426384273842838429384303843138432384333843438435384363843738438384393844038441384423844338444384453844638447384483844938450384513845238453384543845538456384573845838459384603846138462384633846438465384663846738468384693847038471384723847338474384753847638477384783847938480384813848238483384843848538486384873848838489384903849138492384933849438495384963849738498384993850038501385023850338504385053850638507385083850938510385113851238513385143851538516385173851838519385203852138522385233852438525385263852738528385293853038531385323853338534385353853638537385383853938540385413854238543385443854538546385473854838549385503855138552385533855438555385563855738558385593856038561385623856338564385653856638567385683856938570385713857238573385743857538576385773857838579385803858138582385833858438585385863858738588385893859038591385923859338594385953859638597385983859938600386013860238603386043860538606386073860838609386103861138612386133861438615386163861738618386193862038621386223862338624386253862638627386283862938630386313863238633386343863538636386373863838639386403864138642386433864438645386463864738648386493865038651386523865338654386553865638657386583865938660386613866238663386643866538666386673866838669386703867138672386733867438675386763867738678386793868038681386823868338684386853868638687386883868938690386913869238693386943869538696386973869838699387003870138702387033870438705387063870738708387093871038711387123871338714387153871638717387183871938720387213872238723387243872538726387273872838729387303873138732387333873438735387363873738738387393874038741387423874338744387453874638747387483874938750387513875238753387543875538756387573875838759387603876138762387633876438765387663876738768387693877038771387723877338774387753877638777387783877938780387813878238783387843878538786387873878838789387903879138792387933879438795387963879738798387993880038801388023880338804388053880638807388083880938810388113881238813388143881538816388173881838819388203882138822388233882438825388263882738828388293883038831388323883338834388353883638837388383883938840388413884238843388443884538846388473884838849388503885138852388533885438855388563885738858388593886038861388623886338864388653886638867388683886938870388713887238873388743887538876388773887838879388803888138882388833888438885388863888738888388893889038891388923889338894388953889638897388983889938900389013890238903389043890538906389073890838909389103891138912389133891438915389163891738918389193892038921389223892338924389253892638927389283892938930389313893238933389343893538936389373893838939389403894138942389433894438945389463894738948389493895038951389523895338954389553895638957389583895938960389613896238963389643896538966389673896838969389703897138972389733897438975389763897738978389793898038981389823898338984389853898638987389883898938990389913899238993389943899538996389973899838999390003900139002390033900439005390063900739008390093901039011390123901339014390153901639017390183901939020390213902239023390243902539026390273902839029390303903139032390333903439035390363903739038390393904039041390423904339044390453904639047390483904939050390513905239053390543905539056390573905839059390603906139062390633906439065390663906739068390693907039071390723907339074390753907639077390783907939080390813908239083390843908539086390873908839089390903909139092390933909439095390963909739098390993910039101391023910339104391053910639107391083910939110391113911239113391143911539116391173911839119391203912139122391233912439125391263912739128391293913039131391323913339134391353913639137391383913939140391413914239143391443914539146391473914839149391503915139152391533915439155391563915739158391593916039161391623916339164391653916639167391683916939170391713917239173391743917539176391773917839179391803918139182391833918439185391863918739188391893919039191391923919339194391953919639197391983919939200392013920239203392043920539206392073920839209392103921139212392133921439215392163921739218392193922039221392223922339224392253922639227392283922939230392313923239233392343923539236392373923839239392403924139242392433924439245392463924739248392493925039251392523925339254392553925639257392583925939260392613926239263392643926539266392673926839269392703927139272392733927439275392763927739278392793928039281392823928339284392853928639287392883928939290392913929239293392943929539296392973929839299393003930139302393033930439305393063930739308393093931039311393123931339314393153931639317393183931939320393213932239323393243932539326393273932839329393303933139332393333933439335393363933739338393393934039341393423934339344393453934639347393483934939350393513935239353393543935539356393573935839359393603936139362393633936439365393663936739368393693937039371393723937339374393753937639377393783937939380393813938239383393843938539386393873938839389393903939139392393933939439395393963939739398393993940039401394023940339404394053940639407394083940939410394113941239413394143941539416394173941839419394203942139422394233942439425394263942739428394293943039431394323943339434394353943639437394383943939440394413944239443394443944539446394473944839449394503945139452394533945439455394563945739458394593946039461394623946339464394653946639467394683946939470394713947239473394743947539476394773947839479394803948139482394833948439485394863948739488394893949039491394923949339494394953949639497394983949939500395013950239503395043950539506395073950839509395103951139512395133951439515395163951739518395193952039521395223952339524395253952639527395283952939530395313953239533395343953539536395373953839539395403954139542395433954439545395463954739548395493955039551395523955339554395553955639557395583955939560395613956239563395643956539566395673956839569395703957139572395733957439575395763957739578395793958039581395823958339584395853958639587395883958939590395913959239593395943959539596395973959839599396003960139602396033960439605396063960739608396093961039611396123961339614396153961639617396183961939620396213962239623396243962539626396273962839629396303963139632396333963439635396363963739638396393964039641396423964339644396453964639647396483964939650396513965239653396543965539656396573965839659396603966139662396633966439665396663966739668396693967039671396723967339674396753967639677396783967939680396813968239683396843968539686396873968839689396903969139692396933969439695396963969739698396993970039701397023970339704397053970639707397083970939710397113971239713397143971539716397173971839719397203972139722397233972439725397263972739728397293973039731397323973339734397353973639737397383973939740397413974239743397443974539746397473974839749397503975139752397533975439755397563975739758397593976039761397623976339764397653976639767397683976939770397713977239773397743977539776397773977839779397803978139782397833978439785397863978739788397893979039791397923979339794397953979639797397983979939800398013980239803398043980539806398073980839809398103981139812398133981439815398163981739818398193982039821398223982339824398253982639827398283982939830398313983239833398343983539836398373983839839398403984139842398433984439845398463984739848398493985039851398523985339854398553985639857398583985939860398613986239863398643986539866398673986839869398703987139872398733987439875398763987739878398793988039881398823988339884398853988639887398883988939890398913989239893398943989539896398973989839899399003990139902399033990439905399063990739908399093991039911399123991339914399153991639917399183991939920399213992239923399243992539926399273992839929399303993139932399333993439935399363993739938399393994039941399423994339944399453994639947399483994939950399513995239953399543995539956399573995839959399603996139962399633996439965399663996739968399693997039971399723997339974399753997639977399783997939980399813998239983399843998539986399873998839989399903999139992399933999439995399963999739998399994000040001400024000340004400054000640007400084000940010400114001240013400144001540016400174001840019400204002140022400234002440025400264002740028400294003040031400324003340034400354003640037400384003940040400414004240043400444004540046400474004840049400504005140052400534005440055400564005740058400594006040061400624006340064400654006640067400684006940070400714007240073400744007540076400774007840079400804008140082400834008440085400864008740088400894009040091400924009340094400954009640097400984009940100401014010240103401044010540106401074010840109401104011140112401134011440115401164011740118401194012040121401224012340124401254012640127401284012940130401314013240133401344013540136401374013840139401404014140142401434014440145401464014740148401494015040151401524015340154401554015640157401584015940160401614016240163401644016540166401674016840169401704017140172401734017440175401764017740178401794018040181401824018340184401854018640187401884018940190401914019240193401944019540196401974019840199402004020140202402034020440205402064020740208402094021040211402124021340214402154021640217402184021940220402214022240223402244022540226402274022840229402304023140232402334023440235402364023740238402394024040241402424024340244402454024640247402484024940250402514025240253402544025540256402574025840259402604026140262402634026440265402664026740268402694027040271402724027340274402754027640277402784027940280402814028240283402844028540286402874028840289402904029140292402934029440295402964029740298402994030040301403024030340304403054030640307403084030940310403114031240313403144031540316403174031840319403204032140322403234032440325403264032740328403294033040331403324033340334403354033640337403384033940340403414034240343403444034540346403474034840349403504035140352403534035440355403564035740358403594036040361403624036340364403654036640367403684036940370403714037240373403744037540376403774037840379403804038140382403834038440385403864038740388403894039040391403924039340394403954039640397403984039940400404014040240403404044040540406404074040840409404104041140412404134041440415404164041740418404194042040421404224042340424404254042640427404284042940430404314043240433404344043540436404374043840439404404044140442404434044440445404464044740448404494045040451404524045340454404554045640457404584045940460404614046240463404644046540466404674046840469404704047140472404734047440475404764047740478404794048040481404824048340484404854048640487404884048940490404914049240493404944049540496404974049840499405004050140502405034050440505405064050740508405094051040511405124051340514405154051640517405184051940520405214052240523405244052540526405274052840529405304053140532405334053440535405364053740538405394054040541405424054340544405454054640547405484054940550405514055240553405544055540556405574055840559405604056140562405634056440565405664056740568405694057040571405724057340574405754057640577405784057940580405814058240583405844058540586405874058840589405904059140592405934059440595405964059740598405994060040601406024060340604406054060640607406084060940610406114061240613406144061540616406174061840619406204062140622406234062440625406264062740628406294063040631406324063340634406354063640637406384063940640406414064240643406444064540646406474064840649406504065140652406534065440655406564065740658406594066040661406624066340664406654066640667406684066940670406714067240673406744067540676406774067840679406804068140682406834068440685406864068740688406894069040691406924069340694406954069640697406984069940700407014070240703407044070540706407074070840709407104071140712407134071440715407164071740718407194072040721407224072340724407254072640727407284072940730407314073240733407344073540736407374073840739407404074140742407434074440745407464074740748407494075040751407524075340754407554075640757407584075940760407614076240763407644076540766407674076840769407704077140772407734077440775407764077740778407794078040781407824078340784407854078640787407884078940790407914079240793407944079540796407974079840799408004080140802408034080440805408064080740808408094081040811408124081340814408154081640817408184081940820408214082240823408244082540826408274082840829408304083140832408334083440835408364083740838408394084040841408424084340844408454084640847408484084940850408514085240853408544085540856408574085840859408604086140862408634086440865408664086740868408694087040871408724087340874408754087640877408784087940880408814088240883408844088540886408874088840889408904089140892408934089440895408964089740898408994090040901409024090340904409054090640907409084090940910409114091240913409144091540916409174091840919409204092140922409234092440925409264092740928409294093040931409324093340934409354093640937409384093940940409414094240943409444094540946409474094840949409504095140952409534095440955409564095740958409594096040961409624096340964409654096640967409684096940970409714097240973409744097540976409774097840979409804098140982409834098440985409864098740988409894099040991409924099340994409954099640997409984099941000410014100241003410044100541006410074100841009410104101141012410134101441015410164101741018410194102041021410224102341024410254102641027410284102941030410314103241033410344103541036410374103841039410404104141042410434104441045410464104741048410494105041051410524105341054410554105641057410584105941060410614106241063410644106541066410674106841069410704107141072410734107441075410764107741078410794108041081410824108341084410854108641087410884108941090410914109241093410944109541096410974109841099411004110141102411034110441105411064110741108411094111041111411124111341114411154111641117411184111941120411214112241123411244112541126411274112841129411304113141132411334113441135411364113741138411394114041141411424114341144411454114641147411484114941150411514115241153411544115541156411574115841159411604116141162411634116441165411664116741168411694117041171411724117341174411754117641177411784117941180411814118241183411844118541186411874118841189411904119141192411934119441195411964119741198411994120041201412024120341204412054120641207412084120941210412114121241213412144121541216412174121841219412204122141222412234122441225412264122741228412294123041231412324123341234412354123641237412384123941240412414124241243412444124541246412474124841249412504125141252412534125441255412564125741258412594126041261412624126341264412654126641267412684126941270412714127241273412744127541276412774127841279412804128141282412834128441285412864128741288412894129041291412924129341294412954129641297412984129941300413014130241303413044130541306413074130841309413104131141312413134131441315413164131741318413194132041321413224132341324413254132641327413284132941330413314133241333413344133541336413374133841339413404134141342413434134441345413464134741348413494135041351413524135341354413554135641357413584135941360413614136241363413644136541366413674136841369413704137141372413734137441375413764137741378413794138041381413824138341384413854138641387413884138941390413914139241393413944139541396413974139841399414004140141402414034140441405414064140741408414094141041411414124141341414414154141641417414184141941420414214142241423414244142541426414274142841429414304143141432414334143441435414364143741438414394144041441414424144341444414454144641447414484144941450414514145241453414544145541456414574145841459414604146141462414634146441465414664146741468414694147041471414724147341474414754147641477414784147941480414814148241483414844148541486414874148841489414904149141492414934149441495414964149741498414994150041501415024150341504415054150641507415084150941510415114151241513415144151541516415174151841519415204152141522415234152441525415264152741528415294153041531415324153341534415354153641537415384153941540415414154241543415444154541546415474154841549415504155141552415534155441555415564155741558415594156041561415624156341564415654156641567415684156941570415714157241573415744157541576415774157841579415804158141582415834158441585415864158741588415894159041591415924159341594415954159641597415984159941600416014160241603416044160541606416074160841609416104161141612416134161441615416164161741618416194162041621416224162341624416254162641627416284162941630416314163241633416344163541636416374163841639416404164141642416434164441645416464164741648416494165041651416524165341654416554165641657416584165941660416614166241663416644166541666416674166841669416704167141672416734167441675416764167741678416794168041681416824168341684416854168641687416884168941690416914169241693416944169541696416974169841699417004170141702417034170441705417064170741708417094171041711417124171341714417154171641717417184171941720417214172241723417244172541726417274172841729417304173141732417334173441735417364173741738417394174041741417424174341744417454174641747417484174941750417514175241753417544175541756417574175841759417604176141762417634176441765417664176741768417694177041771417724177341774417754177641777417784177941780417814178241783417844178541786417874178841789417904179141792417934179441795417964179741798417994180041801418024180341804418054180641807418084180941810418114181241813418144181541816418174181841819418204182141822418234182441825418264182741828418294183041831418324183341834418354183641837418384183941840418414184241843418444184541846418474184841849418504185141852418534185441855418564185741858418594186041861418624186341864418654186641867418684186941870418714187241873418744187541876418774187841879418804188141882418834188441885418864188741888418894189041891418924189341894418954189641897418984189941900419014190241903419044190541906419074190841909419104191141912419134191441915419164191741918419194192041921419224192341924419254192641927419284192941930419314193241933419344193541936419374193841939419404194141942419434194441945419464194741948419494195041951419524195341954419554195641957419584195941960419614196241963419644196541966419674196841969419704197141972419734197441975419764197741978419794198041981419824198341984419854198641987419884198941990419914199241993419944199541996419974199841999420004200142002420034200442005420064200742008420094201042011420124201342014420154201642017420184201942020420214202242023420244202542026420274202842029420304203142032420334203442035420364203742038420394204042041420424204342044420454204642047420484204942050420514205242053420544205542056420574205842059420604206142062420634206442065420664206742068420694207042071420724207342074420754207642077420784207942080420814208242083420844208542086420874208842089420904209142092420934209442095420964209742098420994210042101421024210342104421054210642107421084210942110421114211242113421144211542116421174211842119421204212142122421234212442125421264212742128421294213042131421324213342134421354213642137421384213942140421414214242143421444214542146421474214842149421504215142152421534215442155421564215742158421594216042161421624216342164421654216642167421684216942170421714217242173421744217542176421774217842179421804218142182421834218442185421864218742188421894219042191421924219342194421954219642197421984219942200422014220242203422044220542206422074220842209422104221142212422134221442215422164221742218422194222042221422224222342224422254222642227422284222942230422314223242233422344223542236422374223842239422404224142242422434224442245422464224742248422494225042251422524225342254422554225642257422584225942260422614226242263422644226542266422674226842269422704227142272422734227442275422764227742278422794228042281422824228342284422854228642287422884228942290422914229242293422944229542296422974229842299423004230142302423034230442305423064230742308423094231042311423124231342314423154231642317423184231942320423214232242323423244232542326423274232842329423304233142332423334233442335423364233742338423394234042341423424234342344423454234642347423484234942350423514235242353423544235542356423574235842359423604236142362423634236442365423664236742368423694237042371423724237342374423754237642377423784237942380423814238242383423844238542386423874238842389423904239142392423934239442395423964239742398423994240042401424024240342404424054240642407424084240942410424114241242413424144241542416424174241842419424204242142422424234242442425424264242742428424294243042431424324243342434424354243642437424384243942440424414244242443424444244542446424474244842449424504245142452424534245442455424564245742458424594246042461424624246342464424654246642467424684246942470424714247242473424744247542476424774247842479424804248142482424834248442485424864248742488424894249042491424924249342494424954249642497424984249942500425014250242503425044250542506425074250842509425104251142512425134251442515425164251742518425194252042521425224252342524425254252642527425284252942530425314253242533425344253542536425374253842539425404254142542425434254442545425464254742548425494255042551425524255342554425554255642557425584255942560425614256242563425644256542566425674256842569425704257142572425734257442575425764257742578425794258042581425824258342584425854258642587425884258942590425914259242593425944259542596425974259842599426004260142602426034260442605426064260742608426094261042611426124261342614426154261642617426184261942620426214262242623426244262542626426274262842629426304263142632426334263442635426364263742638426394264042641426424264342644426454264642647426484264942650426514265242653426544265542656426574265842659426604266142662426634266442665426664266742668426694267042671426724267342674426754267642677426784267942680426814268242683426844268542686426874268842689426904269142692426934269442695426964269742698426994270042701427024270342704427054270642707427084270942710427114271242713427144271542716427174271842719427204272142722427234272442725427264272742728427294273042731427324273342734427354273642737427384273942740427414274242743427444274542746427474274842749427504275142752427534275442755427564275742758427594276042761427624276342764427654276642767427684276942770427714277242773427744277542776427774277842779427804278142782427834278442785427864278742788427894279042791427924279342794427954279642797427984279942800428014280242803428044280542806428074280842809428104281142812428134281442815428164281742818428194282042821428224282342824428254282642827428284282942830428314283242833428344283542836428374283842839428404284142842428434284442845428464284742848428494285042851428524285342854428554285642857428584285942860428614286242863428644286542866428674286842869428704287142872428734287442875428764287742878428794288042881428824288342884428854288642887428884288942890428914289242893428944289542896428974289842899429004290142902429034290442905429064290742908429094291042911429124291342914429154291642917429184291942920429214292242923429244292542926429274292842929429304293142932429334293442935429364293742938429394294042941429424294342944429454294642947429484294942950429514295242953429544295542956429574295842959429604296142962429634296442965429664296742968429694297042971429724297342974429754297642977429784297942980429814298242983429844298542986429874298842989429904299142992429934299442995429964299742998429994300043001430024300343004430054300643007430084300943010430114301243013430144301543016430174301843019430204302143022430234302443025430264302743028430294303043031430324303343034430354303643037430384303943040430414304243043430444304543046430474304843049430504305143052430534305443055430564305743058430594306043061430624306343064430654306643067430684306943070430714307243073430744307543076430774307843079430804308143082430834308443085430864308743088430894309043091430924309343094430954309643097430984309943100431014310243103431044310543106431074310843109431104311143112431134311443115431164311743118431194312043121431224312343124431254312643127431284312943130431314313243133431344313543136431374313843139431404314143142431434314443145431464314743148431494315043151431524315343154431554315643157431584315943160431614316243163431644316543166431674316843169431704317143172431734317443175431764317743178431794318043181431824318343184431854318643187431884318943190431914319243193431944319543196431974319843199432004320143202432034320443205432064320743208432094321043211432124321343214432154321643217432184321943220432214322243223432244322543226432274322843229432304323143232432334323443235432364323743238432394324043241432424324343244432454324643247432484324943250432514325243253432544325543256432574325843259432604326143262432634326443265432664326743268432694327043271432724327343274432754327643277432784327943280432814328243283432844328543286432874328843289432904329143292432934329443295432964329743298432994330043301433024330343304433054330643307433084330943310433114331243313433144331543316433174331843319433204332143322433234332443325433264332743328433294333043331433324333343334433354333643337433384333943340433414334243343433444334543346433474334843349433504335143352433534335443355433564335743358433594336043361433624336343364433654336643367433684336943370433714337243373433744337543376433774337843379433804338143382433834338443385433864338743388433894339043391433924339343394433954339643397433984339943400434014340243403434044340543406434074340843409434104341143412434134341443415434164341743418434194342043421434224342343424434254342643427434284342943430434314343243433434344343543436434374343843439434404344143442434434344443445434464344743448434494345043451434524345343454434554345643457434584345943460434614346243463434644346543466434674346843469434704347143472434734347443475434764347743478434794348043481434824348343484434854348643487434884348943490434914349243493434944349543496434974349843499435004350143502435034350443505435064350743508435094351043511435124351343514435154351643517435184351943520435214352243523435244352543526435274352843529435304353143532435334353443535435364353743538435394354043541435424354343544435454354643547435484354943550435514355243553435544355543556435574355843559435604356143562435634356443565435664356743568435694357043571435724357343574435754357643577435784357943580435814358243583435844358543586435874358843589435904359143592435934359443595435964359743598435994360043601436024360343604436054360643607436084360943610436114361243613436144361543616436174361843619436204362143622436234362443625436264362743628436294363043631436324363343634436354363643637436384363943640436414364243643436444364543646436474364843649436504365143652436534365443655436564365743658436594366043661436624366343664436654366643667436684366943670436714367243673436744367543676436774367843679436804368143682436834368443685436864368743688436894369043691436924369343694436954369643697436984369943700437014370243703437044370543706437074370843709437104371143712437134371443715437164371743718437194372043721437224372343724437254372643727437284372943730437314373243733437344373543736437374373843739437404374143742437434374443745437464374743748437494375043751437524375343754437554375643757437584375943760437614376243763437644376543766437674376843769437704377143772437734377443775437764377743778437794378043781437824378343784437854378643787437884378943790437914379243793437944379543796437974379843799438004380143802438034380443805438064380743808438094381043811438124381343814438154381643817438184381943820438214382243823438244382543826438274382843829438304383143832438334383443835438364383743838438394384043841438424384343844438454384643847438484384943850438514385243853438544385543856438574385843859438604386143862438634386443865438664386743868438694387043871438724387343874438754387643877438784387943880438814388243883438844388543886438874388843889438904389143892438934389443895438964389743898438994390043901439024390343904439054390643907439084390943910439114391243913439144391543916439174391843919439204392143922439234392443925439264392743928439294393043931439324393343934439354393643937439384393943940439414394243943439444394543946439474394843949439504395143952439534395443955439564395743958439594396043961439624396343964439654396643967439684396943970439714397243973439744397543976439774397843979439804398143982439834398443985439864398743988439894399043991439924399343994439954399643997439984399944000440014400244003440044400544006440074400844009440104401144012440134401444015440164401744018440194402044021440224402344024440254402644027440284402944030440314403244033440344403544036440374403844039440404404144042440434404444045440464404744048440494405044051440524405344054440554405644057440584405944060440614406244063440644406544066440674406844069440704407144072440734407444075440764407744078440794408044081440824408344084440854408644087440884408944090440914409244093440944409544096440974409844099441004410144102441034410444105441064410744108441094411044111441124411344114441154411644117441184411944120441214412244123441244412544126441274412844129441304413144132441334413444135441364413744138441394414044141441424414344144441454414644147441484414944150441514415244153441544415544156441574415844159441604416144162441634416444165441664416744168441694417044171441724417344174441754417644177441784417944180441814418244183441844418544186441874418844189441904419144192441934419444195441964419744198441994420044201442024420344204442054420644207442084420944210442114421244213442144421544216442174421844219442204422144222442234422444225442264422744228442294423044231442324423344234442354423644237442384423944240442414424244243442444424544246442474424844249442504425144252442534425444255442564425744258442594426044261442624426344264442654426644267442684426944270442714427244273442744427544276442774427844279442804428144282442834428444285442864428744288442894429044291442924429344294442954429644297442984429944300443014430244303443044430544306443074430844309443104431144312443134431444315443164431744318443194432044321443224432344324443254432644327443284432944330443314433244333443344433544336443374433844339443404434144342443434434444345443464434744348443494435044351443524435344354443554435644357443584435944360443614436244363443644436544366443674436844369443704437144372443734437444375443764437744378443794438044381443824438344384443854438644387443884438944390443914439244393443944439544396443974439844399444004440144402444034440444405444064440744408444094441044411444124441344414444154441644417444184441944420444214442244423444244442544426444274442844429444304443144432444334443444435444364443744438444394444044441444424444344444444454444644447444484444944450444514445244453444544445544456444574445844459444604446144462444634446444465444664446744468444694447044471444724447344474444754447644477444784447944480444814448244483444844448544486444874448844489444904449144492444934449444495444964449744498444994450044501445024450344504445054450644507445084450944510445114451244513445144451544516445174451844519445204452144522445234452444525445264452744528445294453044531445324453344534445354453644537445384453944540445414454244543445444454544546445474454844549445504455144552445534455444555445564455744558445594456044561445624456344564445654456644567445684456944570445714457244573445744457544576445774457844579445804458144582445834458444585445864458744588445894459044591445924459344594445954459644597445984459944600446014460244603446044460544606446074460844609446104461144612446134461444615446164461744618446194462044621446224462344624446254462644627446284462944630446314463244633446344463544636446374463844639446404464144642446434464444645446464464744648446494465044651446524465344654446554465644657446584465944660446614466244663446644466544666446674466844669446704467144672446734467444675446764467744678446794468044681446824468344684446854468644687446884468944690446914469244693446944469544696446974469844699447004470144702447034470444705447064470744708447094471044711447124471344714447154471644717447184471944720447214472244723447244472544726447274472844729447304473144732447334473444735447364473744738447394474044741447424474344744447454474644747447484474944750447514475244753447544475544756447574475844759447604476144762447634476444765447664476744768447694477044771447724477344774447754477644777447784477944780447814478244783447844478544786447874478844789447904479144792447934479444795447964479744798447994480044801448024480344804448054480644807448084480944810448114481244813448144481544816448174481844819448204482144822448234482444825448264482744828448294483044831448324483344834448354483644837448384483944840448414484244843448444484544846448474484844849448504485144852448534485444855448564485744858448594486044861448624486344864448654486644867448684486944870448714487244873448744487544876448774487844879448804488144882448834488444885448864488744888448894489044891448924489344894448954489644897448984489944900449014490244903449044490544906449074490844909449104491144912449134491444915449164491744918449194492044921449224492344924449254492644927449284492944930449314493244933449344493544936449374493844939449404494144942449434494444945449464494744948449494495044951449524495344954449554495644957449584495944960449614496244963449644496544966449674496844969449704497144972449734497444975449764497744978449794498044981449824498344984449854498644987449884498944990449914499244993449944499544996449974499844999450004500145002450034500445005450064500745008450094501045011450124501345014450154501645017450184501945020450214502245023450244502545026450274502845029450304503145032450334503445035450364503745038450394504045041450424504345044450454504645047450484504945050450514505245053450544505545056450574505845059450604506145062450634506445065450664506745068450694507045071450724507345074450754507645077450784507945080450814508245083450844508545086450874508845089450904509145092450934509445095450964509745098450994510045101451024510345104451054510645107451084510945110451114511245113451144511545116451174511845119451204512145122451234512445125451264512745128451294513045131451324513345134451354513645137451384513945140451414514245143451444514545146451474514845149451504515145152451534515445155451564515745158451594516045161451624516345164451654516645167451684516945170451714517245173451744517545176451774517845179451804518145182451834518445185451864518745188451894519045191451924519345194451954519645197451984519945200452014520245203452044520545206452074520845209452104521145212452134521445215452164521745218452194522045221452224522345224452254522645227452284522945230452314523245233452344523545236452374523845239452404524145242452434524445245452464524745248452494525045251452524525345254452554525645257452584525945260452614526245263452644526545266452674526845269452704527145272452734527445275452764527745278452794528045281452824528345284452854528645287452884528945290452914529245293452944529545296452974529845299453004530145302453034530445305453064530745308453094531045311453124531345314453154531645317453184531945320453214532245323453244532545326453274532845329453304533145332453334533445335453364533745338453394534045341453424534345344453454534645347453484534945350453514535245353453544535545356453574535845359453604536145362453634536445365453664536745368453694537045371453724537345374453754537645377453784537945380453814538245383453844538545386453874538845389453904539145392453934539445395453964539745398453994540045401454024540345404454054540645407454084540945410454114541245413454144541545416454174541845419454204542145422454234542445425454264542745428454294543045431454324543345434454354543645437454384543945440454414544245443454444544545446454474544845449454504545145452454534545445455454564545745458454594546045461454624546345464454654546645467454684546945470454714547245473454744547545476454774547845479454804548145482454834548445485454864548745488454894549045491454924549345494454954549645497454984549945500455014550245503455044550545506455074550845509455104551145512455134551445515455164551745518455194552045521455224552345524455254552645527455284552945530455314553245533455344553545536455374553845539455404554145542455434554445545455464554745548455494555045551455524555345554455554555645557455584555945560455614556245563455644556545566455674556845569455704557145572455734557445575455764557745578455794558045581455824558345584455854558645587455884558945590455914559245593455944559545596455974559845599456004560145602456034560445605456064560745608456094561045611456124561345614456154561645617456184561945620456214562245623456244562545626456274562845629456304563145632456334563445635456364563745638456394564045641456424564345644456454564645647456484564945650456514565245653456544565545656456574565845659456604566145662456634566445665456664566745668456694567045671456724567345674456754567645677456784567945680456814568245683456844568545686456874568845689456904569145692456934569445695456964569745698456994570045701457024570345704457054570645707457084570945710457114571245713457144571545716457174571845719457204572145722457234572445725457264572745728457294573045731457324573345734457354573645737457384573945740457414574245743457444574545746457474574845749457504575145752457534575445755457564575745758457594576045761457624576345764457654576645767457684576945770457714577245773457744577545776457774577845779457804578145782457834578445785457864578745788457894579045791457924579345794457954579645797457984579945800458014580245803458044580545806458074580845809458104581145812458134581445815458164581745818458194582045821458224582345824458254582645827458284582945830458314583245833458344583545836458374583845839458404584145842458434584445845458464584745848458494585045851458524585345854458554585645857458584585945860458614586245863458644586545866458674586845869458704587145872458734587445875458764587745878458794588045881458824588345884458854588645887458884588945890458914589245893458944589545896458974589845899459004590145902459034590445905459064590745908459094591045911459124591345914459154591645917459184591945920459214592245923459244592545926459274592845929459304593145932459334593445935459364593745938459394594045941459424594345944459454594645947459484594945950459514595245953459544595545956459574595845959459604596145962459634596445965459664596745968459694597045971459724597345974459754597645977459784597945980459814598245983459844598545986459874598845989459904599145992459934599445995459964599745998459994600046001460024600346004460054600646007460084600946010460114601246013460144601546016460174601846019460204602146022460234602446025460264602746028460294603046031460324603346034460354603646037460384603946040460414604246043460444604546046460474604846049460504605146052460534605446055460564605746058460594606046061460624606346064460654606646067460684606946070460714607246073460744607546076460774607846079460804608146082460834608446085460864608746088460894609046091460924609346094460954609646097460984609946100461014610246103461044610546106461074610846109461104611146112461134611446115461164611746118461194612046121461224612346124461254612646127461284612946130461314613246133461344613546136461374613846139461404614146142461434614446145461464614746148461494615046151461524615346154461554615646157461584615946160461614616246163461644616546166461674616846169461704617146172461734617446175461764617746178461794618046181461824618346184461854618646187461884618946190461914619246193461944619546196461974619846199462004620146202462034620446205462064620746208462094621046211462124621346214462154621646217462184621946220462214622246223462244622546226462274622846229462304623146232462334623446235462364623746238462394624046241462424624346244462454624646247462484624946250462514625246253462544625546256462574625846259462604626146262462634626446265462664626746268462694627046271462724627346274462754627646277462784627946280462814628246283462844628546286462874628846289462904629146292462934629446295462964629746298462994630046301463024630346304463054630646307463084630946310463114631246313463144631546316463174631846319463204632146322463234632446325463264632746328463294633046331463324633346334463354633646337463384633946340463414634246343463444634546346463474634846349463504635146352463534635446355463564635746358463594636046361463624636346364463654636646367463684636946370463714637246373463744637546376463774637846379463804638146382463834638446385463864638746388463894639046391463924639346394463954639646397463984639946400464014640246403464044640546406464074640846409464104641146412464134641446415464164641746418464194642046421464224642346424464254642646427464284642946430464314643246433464344643546436464374643846439464404644146442464434644446445464464644746448464494645046451464524645346454464554645646457464584645946460464614646246463464644646546466464674646846469464704647146472464734647446475464764647746478464794648046481464824648346484464854648646487464884648946490464914649246493464944649546496464974649846499465004650146502465034650446505465064650746508465094651046511465124651346514465154651646517465184651946520465214652246523465244652546526465274652846529465304653146532465334653446535465364653746538465394654046541465424654346544465454654646547465484654946550465514655246553465544655546556465574655846559465604656146562465634656446565465664656746568465694657046571465724657346574465754657646577465784657946580465814658246583465844658546586465874658846589465904659146592465934659446595465964659746598465994660046601466024660346604466054660646607466084660946610466114661246613466144661546616466174661846619466204662146622466234662446625466264662746628466294663046631466324663346634466354663646637466384663946640466414664246643466444664546646466474664846649466504665146652466534665446655466564665746658466594666046661466624666346664466654666646667466684666946670466714667246673466744667546676466774667846679466804668146682466834668446685466864668746688466894669046691466924669346694466954669646697466984669946700467014670246703467044670546706467074670846709467104671146712467134671446715467164671746718467194672046721467224672346724467254672646727467284672946730467314673246733467344673546736467374673846739467404674146742467434674446745467464674746748467494675046751467524675346754467554675646757467584675946760467614676246763467644676546766467674676846769467704677146772467734677446775467764677746778467794678046781467824678346784467854678646787467884678946790467914679246793467944679546796467974679846799468004680146802468034680446805468064680746808468094681046811468124681346814468154681646817468184681946820468214682246823468244682546826468274682846829468304683146832468334683446835468364683746838468394684046841468424684346844468454684646847468484684946850468514685246853468544685546856468574685846859468604686146862468634686446865468664686746868468694687046871468724687346874468754687646877468784687946880468814688246883468844688546886468874688846889468904689146892468934689446895468964689746898468994690046901469024690346904469054690646907469084690946910469114691246913469144691546916469174691846919469204692146922469234692446925469264692746928469294693046931469324693346934469354693646937469384693946940469414694246943469444694546946469474694846949469504695146952469534695446955469564695746958469594696046961469624696346964469654696646967469684696946970469714697246973469744697546976469774697846979469804698146982469834698446985469864698746988469894699046991469924699346994469954699646997469984699947000470014700247003470044700547006470074700847009470104701147012470134701447015470164701747018470194702047021470224702347024470254702647027470284702947030470314703247033470344703547036470374703847039470404704147042470434704447045470464704747048470494705047051470524705347054470554705647057470584705947060470614706247063470644706547066470674706847069470704707147072470734707447075470764707747078470794708047081470824708347084470854708647087470884708947090470914709247093470944709547096470974709847099471004710147102471034710447105471064710747108471094711047111471124711347114471154711647117471184711947120471214712247123471244712547126471274712847129471304713147132471334713447135471364713747138471394714047141471424714347144471454714647147471484714947150471514715247153471544715547156471574715847159471604716147162471634716447165471664716747168471694717047171471724717347174471754717647177471784717947180471814718247183471844718547186471874718847189471904719147192471934719447195471964719747198471994720047201472024720347204472054720647207472084720947210472114721247213472144721547216472174721847219472204722147222472234722447225472264722747228472294723047231472324723347234472354723647237472384723947240472414724247243472444724547246472474724847249472504725147252472534725447255472564725747258472594726047261472624726347264472654726647267472684726947270472714727247273472744727547276472774727847279472804728147282472834728447285472864728747288472894729047291472924729347294472954729647297472984729947300473014730247303473044730547306473074730847309473104731147312473134731447315473164731747318473194732047321473224732347324473254732647327473284732947330473314733247333473344733547336473374733847339473404734147342473434734447345473464734747348473494735047351473524735347354473554735647357473584735947360473614736247363473644736547366473674736847369473704737147372473734737447375473764737747378473794738047381473824738347384473854738647387473884738947390473914739247393473944739547396473974739847399474004740147402474034740447405474064740747408474094741047411474124741347414474154741647417474184741947420474214742247423474244742547426474274742847429474304743147432474334743447435474364743747438474394744047441474424744347444474454744647447474484744947450474514745247453474544745547456474574745847459474604746147462474634746447465474664746747468474694747047471474724747347474474754747647477474784747947480474814748247483474844748547486474874748847489474904749147492474934749447495474964749747498474994750047501475024750347504475054750647507475084750947510475114751247513475144751547516475174751847519475204752147522475234752447525475264752747528475294753047531475324753347534475354753647537475384753947540475414754247543475444754547546475474754847549475504755147552475534755447555475564755747558475594756047561475624756347564475654756647567475684756947570475714757247573475744757547576475774757847579475804758147582475834758447585475864758747588475894759047591475924759347594475954759647597475984759947600476014760247603476044760547606476074760847609476104761147612476134761447615476164761747618476194762047621476224762347624476254762647627476284762947630476314763247633476344763547636476374763847639476404764147642476434764447645476464764747648476494765047651476524765347654476554765647657476584765947660476614766247663476644766547666476674766847669476704767147672476734767447675476764767747678476794768047681476824768347684476854768647687476884768947690476914769247693476944769547696476974769847699477004770147702477034770447705477064770747708477094771047711477124771347714477154771647717477184771947720477214772247723477244772547726477274772847729477304773147732477334773447735477364773747738477394774047741477424774347744477454774647747477484774947750477514775247753477544775547756477574775847759477604776147762477634776447765477664776747768477694777047771477724777347774477754777647777477784777947780477814778247783477844778547786477874778847789477904779147792477934779447795477964779747798477994780047801478024780347804478054780647807478084780947810478114781247813478144781547816478174781847819478204782147822478234782447825478264782747828478294783047831478324783347834478354783647837478384783947840478414784247843478444784547846478474784847849478504785147852478534785447855478564785747858478594786047861478624786347864478654786647867478684786947870478714787247873478744787547876478774787847879478804788147882478834788447885478864788747888478894789047891478924789347894478954789647897478984789947900479014790247903479044790547906479074790847909479104791147912479134791447915479164791747918479194792047921479224792347924479254792647927479284792947930479314793247933479344793547936479374793847939479404794147942479434794447945479464794747948479494795047951479524795347954479554795647957479584795947960479614796247963479644796547966479674796847969479704797147972479734797447975479764797747978479794798047981479824798347984479854798647987479884798947990479914799247993479944799547996479974799847999480004800148002480034800448005480064800748008480094801048011480124801348014480154801648017480184801948020480214802248023480244802548026480274802848029480304803148032480334803448035480364803748038480394804048041480424804348044480454804648047480484804948050480514805248053480544805548056480574805848059480604806148062480634806448065480664806748068480694807048071480724807348074480754807648077480784807948080480814808248083480844808548086480874808848089480904809148092480934809448095480964809748098480994810048101481024810348104481054810648107481084810948110481114811248113481144811548116481174811848119481204812148122481234812448125481264812748128481294813048131481324813348134481354813648137481384813948140481414814248143481444814548146481474814848149481504815148152481534815448155481564815748158481594816048161481624816348164481654816648167481684816948170481714817248173481744817548176481774817848179481804818148182481834818448185481864818748188481894819048191481924819348194481954819648197481984819948200482014820248203482044820548206482074820848209482104821148212482134821448215482164821748218482194822048221482224822348224482254822648227482284822948230482314823248233482344823548236482374823848239482404824148242482434824448245482464824748248482494825048251482524825348254482554825648257482584825948260482614826248263482644826548266482674826848269482704827148272482734827448275482764827748278482794828048281482824828348284482854828648287482884828948290482914829248293482944829548296482974829848299483004830148302483034830448305483064830748308483094831048311483124831348314483154831648317483184831948320483214832248323483244832548326483274832848329483304833148332483334833448335483364833748338483394834048341483424834348344483454834648347483484834948350483514835248353483544835548356483574835848359483604836148362483634836448365483664836748368483694837048371483724837348374483754837648377483784837948380483814838248383483844838548386483874838848389483904839148392483934839448395483964839748398483994840048401484024840348404484054840648407484084840948410484114841248413484144841548416484174841848419484204842148422484234842448425484264842748428484294843048431484324843348434484354843648437484384843948440484414844248443484444844548446484474844848449484504845148452484534845448455484564845748458484594846048461484624846348464484654846648467484684846948470484714847248473484744847548476484774847848479484804848148482484834848448485484864848748488484894849048491484924849348494484954849648497484984849948500485014850248503485044850548506485074850848509485104851148512485134851448515485164851748518485194852048521485224852348524485254852648527485284852948530485314853248533485344853548536485374853848539485404854148542485434854448545485464854748548485494855048551485524855348554485554855648557485584855948560485614856248563485644856548566485674856848569485704857148572485734857448575485764857748578485794858048581485824858348584485854858648587485884858948590485914859248593485944859548596485974859848599486004860148602486034860448605486064860748608486094861048611486124861348614486154861648617486184861948620486214862248623486244862548626486274862848629486304863148632486334863448635486364863748638486394864048641486424864348644486454864648647486484864948650486514865248653486544865548656486574865848659486604866148662486634866448665486664866748668486694867048671486724867348674486754867648677486784867948680486814868248683486844868548686486874868848689486904869148692486934869448695486964869748698486994870048701487024870348704487054870648707487084870948710487114871248713487144871548716487174871848719487204872148722487234872448725487264872748728487294873048731487324873348734487354873648737487384873948740487414874248743487444874548746487474874848749487504875148752487534875448755487564875748758487594876048761487624876348764487654876648767487684876948770487714877248773487744877548776487774877848779487804878148782487834878448785487864878748788487894879048791487924879348794487954879648797487984879948800488014880248803488044880548806488074880848809488104881148812488134881448815488164881748818488194882048821488224882348824488254882648827488284882948830488314883248833488344883548836488374883848839488404884148842488434884448845488464884748848488494885048851488524885348854488554885648857488584885948860488614886248863488644886548866488674886848869488704887148872488734887448875488764887748878488794888048881488824888348884488854888648887488884888948890488914889248893488944889548896488974889848899489004890148902489034890448905489064890748908489094891048911489124891348914489154891648917489184891948920489214892248923489244892548926489274892848929489304893148932489334893448935489364893748938489394894048941489424894348944489454894648947489484894948950489514895248953489544895548956489574895848959489604896148962489634896448965489664896748968489694897048971489724897348974489754897648977489784897948980489814898248983489844898548986489874898848989489904899148992489934899448995489964899748998489994900049001490024900349004490054900649007490084900949010490114901249013490144901549016490174901849019490204902149022490234902449025490264902749028490294903049031490324903349034490354903649037490384903949040490414904249043490444904549046490474904849049490504905149052490534905449055490564905749058490594906049061490624906349064490654906649067490684906949070490714907249073490744907549076490774907849079490804908149082490834908449085490864908749088490894909049091490924909349094490954909649097490984909949100491014910249103491044910549106491074910849109491104911149112491134911449115491164911749118491194912049121491224912349124491254912649127491284912949130491314913249133491344913549136491374913849139491404914149142491434914449145491464914749148491494915049151491524915349154491554915649157491584915949160491614916249163491644916549166491674916849169491704917149172491734917449175491764917749178491794918049181491824918349184491854918649187491884918949190491914919249193491944919549196491974919849199492004920149202492034920449205492064920749208492094921049211492124921349214492154921649217492184921949220492214922249223492244922549226492274922849229492304923149232492334923449235492364923749238492394924049241492424924349244492454924649247492484924949250492514925249253492544925549256492574925849259492604926149262492634926449265492664926749268492694927049271492724927349274492754927649277492784927949280492814928249283492844928549286492874928849289492904929149292492934929449295492964929749298492994930049301493024930349304493054930649307493084930949310493114931249313493144931549316493174931849319493204932149322493234932449325493264932749328493294933049331493324933349334493354933649337493384933949340493414934249343493444934549346493474934849349493504935149352493534935449355493564935749358493594936049361493624936349364493654936649367493684936949370493714937249373493744937549376493774937849379493804938149382493834938449385493864938749388493894939049391493924939349394493954939649397493984939949400494014940249403494044940549406494074940849409494104941149412494134941449415494164941749418494194942049421494224942349424494254942649427494284942949430494314943249433494344943549436494374943849439494404944149442494434944449445494464944749448494494945049451494524945349454494554945649457494584945949460494614946249463494644946549466494674946849469494704947149472494734947449475494764947749478494794948049481494824948349484494854948649487494884948949490494914949249493494944949549496494974949849499495004950149502495034950449505495064950749508495094951049511495124951349514495154951649517495184951949520495214952249523495244952549526495274952849529495304953149532495334953449535495364953749538495394954049541495424954349544495454954649547495484954949550495514955249553495544955549556495574955849559495604956149562495634956449565495664956749568495694957049571495724957349574495754957649577495784957949580495814958249583495844958549586495874958849589495904959149592495934959449595495964959749598495994960049601496024960349604496054960649607496084960949610496114961249613496144961549616496174961849619496204962149622496234962449625496264962749628496294963049631496324963349634496354963649637496384963949640496414964249643496444964549646496474964849649496504965149652496534965449655496564965749658496594966049661496624966349664496654966649667496684966949670496714967249673496744967549676496774967849679496804968149682496834968449685496864968749688496894969049691496924969349694496954969649697496984969949700497014970249703497044970549706497074970849709497104971149712497134971449715497164971749718497194972049721497224972349724497254972649727497284972949730497314973249733497344973549736497374973849739497404974149742497434974449745497464974749748497494975049751497524975349754497554975649757497584975949760497614976249763497644976549766497674976849769497704977149772497734977449775497764977749778497794978049781497824978349784497854978649787497884978949790497914979249793497944979549796497974979849799498004980149802498034980449805498064980749808498094981049811498124981349814498154981649817498184981949820498214982249823498244982549826498274982849829498304983149832498334983449835498364983749838498394984049841498424984349844498454984649847498484984949850498514985249853498544985549856498574985849859498604986149862498634986449865498664986749868498694987049871498724987349874498754987649877498784987949880498814988249883498844988549886498874988849889498904989149892498934989449895498964989749898498994990049901499024990349904499054990649907499084990949910499114991249913499144991549916499174991849919499204992149922499234992449925499264992749928499294993049931499324993349934499354993649937499384993949940499414994249943499444994549946499474994849949499504995149952499534995449955499564995749958499594996049961499624996349964499654996649967499684996949970499714997249973499744997549976499774997849979499804998149982499834998449985499864998749988499894999049991499924999349994499954999649997499984999950000500015000250003500045000550006500075000850009500105001150012500135001450015500165001750018500195002050021500225002350024500255002650027500285002950030500315003250033500345003550036500375003850039500405004150042500435004450045500465004750048500495005050051500525005350054500555005650057500585005950060500615006250063500645006550066500675006850069500705007150072500735007450075500765007750078500795008050081500825008350084500855008650087500885008950090500915009250093500945009550096500975009850099501005010150102501035010450105501065010750108501095011050111501125011350114501155011650117501185011950120501215012250123501245012550126501275012850129501305013150132501335013450135501365013750138501395014050141501425014350144501455014650147501485014950150501515015250153501545015550156501575015850159501605016150162501635016450165501665016750168501695017050171501725017350174501755017650177501785017950180501815018250183501845018550186501875018850189501905019150192501935019450195501965019750198501995020050201502025020350204502055020650207502085020950210502115021250213502145021550216502175021850219502205022150222502235022450225502265022750228502295023050231502325023350234502355023650237502385023950240502415024250243502445024550246502475024850249502505025150252502535025450255502565025750258502595026050261502625026350264502655026650267502685026950270502715027250273502745027550276502775027850279502805028150282502835028450285502865028750288502895029050291502925029350294502955029650297502985029950300503015030250303503045030550306503075030850309503105031150312503135031450315503165031750318503195032050321503225032350324503255032650327503285032950330503315033250333503345033550336503375033850339503405034150342503435034450345503465034750348503495035050351503525035350354503555035650357503585035950360503615036250363503645036550366503675036850369503705037150372503735037450375503765037750378503795038050381503825038350384503855038650387503885038950390503915039250393503945039550396503975039850399504005040150402504035040450405504065040750408504095041050411504125041350414504155041650417504185041950420504215042250423504245042550426504275042850429504305043150432504335043450435504365043750438504395044050441504425044350444504455044650447504485044950450504515045250453504545045550456504575045850459504605046150462504635046450465504665046750468504695047050471504725047350474504755047650477504785047950480504815048250483504845048550486504875048850489504905049150492504935049450495504965049750498504995050050501505025050350504505055050650507505085050950510505115051250513505145051550516505175051850519505205052150522505235052450525505265052750528505295053050531505325053350534505355053650537505385053950540505415054250543505445054550546505475054850549505505055150552505535055450555505565055750558505595056050561505625056350564505655056650567505685056950570505715057250573505745057550576505775057850579505805058150582505835058450585505865058750588505895059050591505925059350594505955059650597505985059950600506015060250603506045060550606506075060850609506105061150612506135061450615506165061750618506195062050621506225062350624506255062650627506285062950630506315063250633506345063550636506375063850639506405064150642506435064450645506465064750648506495065050651506525065350654506555065650657506585065950660506615066250663506645066550666506675066850669506705067150672506735067450675506765067750678506795068050681506825068350684506855068650687506885068950690506915069250693506945069550696506975069850699507005070150702507035070450705507065070750708507095071050711507125071350714507155071650717507185071950720507215072250723507245072550726507275072850729507305073150732507335073450735507365073750738507395074050741507425074350744507455074650747507485074950750507515075250753507545075550756507575075850759507605076150762507635076450765507665076750768507695077050771507725077350774507755077650777507785077950780507815078250783507845078550786507875078850789507905079150792507935079450795507965079750798507995080050801508025080350804508055080650807508085080950810508115081250813508145081550816508175081850819508205082150822508235082450825508265082750828508295083050831508325083350834508355083650837508385083950840508415084250843508445084550846508475084850849508505085150852508535085450855508565085750858508595086050861508625086350864508655086650867508685086950870508715087250873508745087550876508775087850879508805088150882508835088450885508865088750888508895089050891508925089350894508955089650897508985089950900509015090250903509045090550906509075090850909509105091150912509135091450915509165091750918509195092050921509225092350924509255092650927509285092950930509315093250933509345093550936509375093850939509405094150942509435094450945509465094750948509495095050951509525095350954509555095650957509585095950960509615096250963509645096550966509675096850969509705097150972509735097450975509765097750978509795098050981509825098350984509855098650987509885098950990509915099250993509945099550996509975099850999510005100151002510035100451005510065100751008510095101051011510125101351014510155101651017510185101951020510215102251023510245102551026510275102851029510305103151032510335103451035510365103751038510395104051041510425104351044510455104651047510485104951050510515105251053510545105551056510575105851059510605106151062510635106451065510665106751068510695107051071510725107351074510755107651077510785107951080510815108251083510845108551086510875108851089510905109151092510935109451095510965109751098510995110051101511025110351104511055110651107511085110951110511115111251113511145111551116511175111851119511205112151122511235112451125511265112751128511295113051131511325113351134511355113651137511385113951140511415114251143511445114551146511475114851149511505115151152511535115451155511565115751158511595116051161511625116351164511655116651167511685116951170511715117251173511745117551176511775117851179511805118151182511835118451185511865118751188511895119051191511925119351194511955119651197511985119951200512015120251203512045120551206512075120851209512105121151212512135121451215512165121751218512195122051221512225122351224512255122651227512285122951230512315123251233512345123551236512375123851239512405124151242512435124451245512465124751248512495125051251512525125351254512555125651257512585125951260512615126251263512645126551266512675126851269512705127151272512735127451275512765127751278512795128051281512825128351284512855128651287512885128951290512915129251293512945129551296512975129851299513005130151302513035130451305513065130751308513095131051311513125131351314513155131651317513185131951320513215132251323513245132551326513275132851329513305133151332513335133451335513365133751338513395134051341513425134351344513455134651347513485134951350513515135251353513545135551356513575135851359513605136151362513635136451365513665136751368513695137051371513725137351374513755137651377513785137951380513815138251383513845138551386513875138851389513905139151392513935139451395513965139751398513995140051401514025140351404514055140651407514085140951410514115141251413514145141551416514175141851419514205142151422514235142451425514265142751428514295143051431514325143351434514355143651437514385143951440514415144251443514445144551446514475144851449514505145151452514535145451455514565145751458514595146051461514625146351464514655146651467514685146951470514715147251473514745147551476514775147851479514805148151482514835148451485514865148751488514895149051491514925149351494514955149651497514985149951500515015150251503515045150551506515075150851509515105151151512515135151451515515165151751518515195152051521515225152351524515255152651527515285152951530515315153251533515345153551536515375153851539515405154151542515435154451545515465154751548515495155051551515525155351554515555155651557515585155951560515615156251563515645156551566515675156851569515705157151572515735157451575515765157751578515795158051581515825158351584515855158651587515885158951590515915159251593515945159551596515975159851599516005160151602516035160451605516065160751608516095161051611516125161351614516155161651617516185161951620516215162251623516245162551626516275162851629516305163151632516335163451635516365163751638516395164051641516425164351644516455164651647516485164951650516515165251653516545165551656516575165851659516605166151662516635166451665516665166751668516695167051671516725167351674516755167651677516785167951680516815168251683516845168551686516875168851689516905169151692516935169451695516965169751698516995170051701517025170351704517055170651707517085170951710517115171251713517145171551716517175171851719517205172151722517235172451725517265172751728517295173051731517325173351734517355173651737517385173951740517415174251743517445174551746517475174851749517505175151752517535175451755517565175751758517595176051761517625176351764517655176651767517685176951770517715177251773517745177551776517775177851779517805178151782517835178451785517865178751788517895179051791517925179351794517955179651797517985179951800518015180251803518045180551806518075180851809518105181151812518135181451815518165181751818518195182051821518225182351824518255182651827518285182951830518315183251833518345183551836518375183851839518405184151842518435184451845518465184751848518495185051851518525185351854518555185651857518585185951860518615186251863518645186551866518675186851869518705187151872518735187451875518765187751878518795188051881518825188351884518855188651887518885188951890518915189251893518945189551896518975189851899519005190151902519035190451905519065190751908519095191051911519125191351914519155191651917519185191951920519215192251923519245192551926519275192851929519305193151932519335193451935519365193751938519395194051941519425194351944519455194651947519485194951950519515195251953519545195551956519575195851959519605196151962519635196451965519665196751968519695197051971519725197351974519755197651977519785197951980519815198251983519845198551986519875198851989519905199151992519935199451995519965199751998519995200052001520025200352004520055200652007520085200952010520115201252013520145201552016520175201852019520205202152022520235202452025520265202752028520295203052031520325203352034520355203652037520385203952040520415204252043520445204552046520475204852049520505205152052520535205452055520565205752058520595206052061520625206352064520655206652067520685206952070520715207252073520745207552076520775207852079520805208152082520835208452085520865208752088520895209052091520925209352094520955209652097520985209952100521015210252103521045210552106521075210852109521105211152112521135211452115521165211752118521195212052121521225212352124521255212652127521285212952130521315213252133521345213552136521375213852139521405214152142521435214452145521465214752148521495215052151521525215352154521555215652157521585215952160521615216252163521645216552166521675216852169521705217152172521735217452175521765217752178521795218052181521825218352184521855218652187521885218952190521915219252193521945219552196521975219852199522005220152202522035220452205522065220752208522095221052211522125221352214522155221652217522185221952220522215222252223522245222552226522275222852229522305223152232522335223452235522365223752238522395224052241522425224352244522455224652247522485224952250522515225252253522545225552256522575225852259522605226152262522635226452265522665226752268522695227052271522725227352274522755227652277522785227952280522815228252283522845228552286522875228852289522905229152292522935229452295522965229752298522995230052301523025230352304523055230652307523085230952310523115231252313523145231552316523175231852319523205232152322523235232452325523265232752328523295233052331523325233352334523355233652337523385233952340523415234252343523445234552346523475234852349523505235152352523535235452355523565235752358523595236052361523625236352364523655236652367523685236952370523715237252373523745237552376523775237852379523805238152382523835238452385523865238752388523895239052391523925239352394523955239652397523985239952400524015240252403524045240552406524075240852409524105241152412524135241452415524165241752418524195242052421524225242352424524255242652427524285242952430524315243252433524345243552436524375243852439524405244152442524435244452445524465244752448524495245052451524525245352454524555245652457524585245952460524615246252463524645246552466524675246852469524705247152472524735247452475524765247752478524795248052481524825248352484524855248652487524885248952490524915249252493524945249552496524975249852499525005250152502525035250452505525065250752508525095251052511525125251352514525155251652517525185251952520525215252252523525245252552526525275252852529525305253152532525335253452535525365253752538525395254052541525425254352544525455254652547525485254952550525515255252553525545255552556525575255852559525605256152562525635256452565525665256752568525695257052571525725257352574525755257652577525785257952580525815258252583525845258552586525875258852589525905259152592525935259452595525965259752598525995260052601526025260352604526055260652607526085260952610526115261252613526145261552616526175261852619526205262152622526235262452625526265262752628526295263052631526325263352634526355263652637526385263952640526415264252643526445264552646526475264852649526505265152652526535265452655526565265752658526595266052661526625266352664526655266652667526685266952670526715267252673526745267552676526775267852679526805268152682526835268452685526865268752688526895269052691526925269352694526955269652697526985269952700527015270252703527045270552706527075270852709527105271152712527135271452715527165271752718527195272052721527225272352724527255272652727527285272952730527315273252733527345273552736527375273852739527405274152742527435274452745527465274752748527495275052751527525275352754527555275652757527585275952760527615276252763527645276552766527675276852769527705277152772527735277452775527765277752778527795278052781527825278352784527855278652787527885278952790527915279252793527945279552796527975279852799528005280152802528035280452805528065280752808528095281052811528125281352814528155281652817528185281952820528215282252823528245282552826528275282852829528305283152832528335283452835528365283752838528395284052841528425284352844528455284652847528485284952850528515285252853528545285552856528575285852859528605286152862528635286452865528665286752868528695287052871528725287352874528755287652877528785287952880528815288252883528845288552886528875288852889528905289152892528935289452895528965289752898528995290052901529025290352904529055290652907529085290952910529115291252913529145291552916529175291852919529205292152922529235292452925529265292752928529295293052931529325293352934529355293652937529385293952940529415294252943529445294552946529475294852949529505295152952529535295452955529565295752958529595296052961529625296352964529655296652967529685296952970529715297252973529745297552976529775297852979529805298152982529835298452985529865298752988529895299052991529925299352994529955299652997529985299953000530015300253003530045300553006530075300853009530105301153012530135301453015530165301753018530195302053021530225302353024530255302653027530285302953030530315303253033530345303553036530375303853039530405304153042530435304453045530465304753048530495305053051530525305353054530555305653057530585305953060530615306253063530645306553066530675306853069530705307153072530735307453075530765307753078530795308053081530825308353084530855308653087530885308953090530915309253093530945309553096530975309853099531005310153102531035310453105531065310753108531095311053111531125311353114531155311653117531185311953120531215312253123531245312553126531275312853129531305313153132531335313453135531365313753138531395314053141531425314353144531455314653147531485314953150531515315253153531545315553156531575315853159531605316153162531635316453165531665316753168531695317053171531725317353174531755317653177531785317953180531815318253183531845318553186531875318853189531905319153192531935319453195531965319753198531995320053201532025320353204532055320653207532085320953210532115321253213532145321553216532175321853219532205322153222532235322453225532265322753228532295323053231532325323353234532355323653237532385323953240532415324253243532445324553246532475324853249532505325153252532535325453255532565325753258532595326053261532625326353264532655326653267532685326953270532715327253273532745327553276532775327853279532805328153282532835328453285532865328753288532895329053291532925329353294532955329653297532985329953300533015330253303533045330553306533075330853309533105331153312533135331453315533165331753318533195332053321533225332353324533255332653327533285332953330533315333253333533345333553336533375333853339533405334153342533435334453345533465334753348533495335053351533525335353354533555335653357533585335953360533615336253363533645336553366533675336853369533705337153372533735337453375533765337753378533795338053381533825338353384533855338653387533885338953390533915339253393533945339553396533975339853399534005340153402534035340453405534065340753408534095341053411534125341353414534155341653417534185341953420534215342253423534245342553426534275342853429534305343153432534335343453435534365343753438534395344053441534425344353444534455344653447534485344953450534515345253453534545345553456534575345853459534605346153462534635346453465534665346753468534695347053471534725347353474534755347653477534785347953480534815348253483534845348553486534875348853489534905349153492534935349453495534965349753498534995350053501535025350353504535055350653507535085350953510535115351253513535145351553516535175351853519535205352153522535235352453525535265352753528535295353053531535325353353534535355353653537535385353953540535415354253543535445354553546535475354853549535505355153552535535355453555535565355753558535595356053561535625356353564535655356653567535685356953570535715357253573535745357553576535775357853579535805358153582535835358453585535865358753588535895359053591535925359353594535955359653597535985359953600536015360253603536045360553606536075360853609536105361153612536135361453615536165361753618536195362053621536225362353624536255362653627536285362953630536315363253633536345363553636536375363853639536405364153642536435364453645536465364753648536495365053651536525365353654536555365653657536585365953660536615366253663536645366553666536675366853669536705367153672536735367453675536765367753678536795368053681536825368353684536855368653687536885368953690536915369253693536945369553696536975369853699537005370153702537035370453705537065370753708537095371053711537125371353714537155371653717537185371953720537215372253723537245372553726537275372853729537305373153732537335373453735537365373753738537395374053741537425374353744537455374653747537485374953750537515375253753537545375553756537575375853759537605376153762537635376453765537665376753768537695377053771537725377353774537755377653777537785377953780537815378253783537845378553786537875378853789537905379153792537935379453795537965379753798537995380053801538025380353804538055380653807538085380953810538115381253813538145381553816538175381853819538205382153822538235382453825538265382753828538295383053831538325383353834538355383653837538385383953840538415384253843538445384553846538475384853849538505385153852538535385453855538565385753858538595386053861538625386353864538655386653867538685386953870538715387253873538745387553876538775387853879538805388153882538835388453885538865388753888538895389053891538925389353894538955389653897538985389953900539015390253903539045390553906539075390853909539105391153912539135391453915539165391753918539195392053921539225392353924539255392653927539285392953930539315393253933539345393553936539375393853939539405394153942539435394453945539465394753948539495395053951539525395353954539555395653957539585395953960539615396253963539645396553966539675396853969539705397153972539735397453975539765397753978539795398053981539825398353984539855398653987539885398953990539915399253993539945399553996539975399853999540005400154002540035400454005540065400754008540095401054011540125401354014540155401654017540185401954020540215402254023540245402554026540275402854029540305403154032540335403454035540365403754038540395404054041540425404354044540455404654047540485404954050540515405254053540545405554056540575405854059540605406154062540635406454065540665406754068540695407054071540725407354074540755407654077540785407954080540815408254083540845408554086540875408854089540905409154092540935409454095540965409754098540995410054101541025410354104541055410654107541085410954110541115411254113541145411554116541175411854119541205412154122541235412454125541265412754128541295413054131541325413354134541355413654137541385413954140541415414254143541445414554146541475414854149541505415154152541535415454155541565415754158541595416054161541625416354164541655416654167541685416954170541715417254173541745417554176541775417854179541805418154182541835418454185541865418754188541895419054191541925419354194541955419654197541985419954200542015420254203542045420554206542075420854209542105421154212542135421454215542165421754218542195422054221542225422354224542255422654227542285422954230542315423254233542345423554236542375423854239542405424154242542435424454245542465424754248542495425054251542525425354254542555425654257542585425954260542615426254263542645426554266542675426854269542705427154272542735427454275542765427754278542795428054281542825428354284542855428654287542885428954290542915429254293542945429554296542975429854299543005430154302543035430454305543065430754308543095431054311543125431354314543155431654317543185431954320543215432254323543245432554326543275432854329543305433154332543335433454335543365433754338543395434054341543425434354344543455434654347543485434954350543515435254353543545435554356543575435854359543605436154362543635436454365543665436754368543695437054371543725437354374543755437654377543785437954380543815438254383543845438554386543875438854389543905439154392543935439454395543965439754398543995440054401544025440354404544055440654407544085440954410544115441254413544145441554416544175441854419544205442154422544235442454425544265442754428544295443054431544325443354434544355443654437544385443954440544415444254443544445444554446544475444854449544505445154452544535445454455544565445754458544595446054461544625446354464544655446654467544685446954470544715447254473544745447554476544775447854479544805448154482544835448454485544865448754488544895449054491544925449354494544955449654497544985449954500545015450254503545045450554506545075450854509545105451154512545135451454515545165451754518545195452054521545225452354524545255452654527545285452954530545315453254533545345453554536545375453854539545405454154542545435454454545545465454754548545495455054551545525455354554545555455654557545585455954560545615456254563545645456554566545675456854569545705457154572545735457454575545765457754578545795458054581545825458354584545855458654587545885458954590545915459254593545945459554596545975459854599546005460154602546035460454605546065460754608546095461054611546125461354614546155461654617546185461954620546215462254623546245462554626546275462854629546305463154632546335463454635546365463754638546395464054641546425464354644546455464654647546485464954650546515465254653546545465554656546575465854659546605466154662546635466454665546665466754668546695467054671546725467354674546755467654677546785467954680546815468254683546845468554686546875468854689546905469154692546935469454695546965469754698546995470054701547025470354704547055470654707547085470954710547115471254713547145471554716547175471854719547205472154722547235472454725547265472754728547295473054731547325473354734547355473654737547385473954740547415474254743547445474554746547475474854749547505475154752547535475454755547565475754758547595476054761547625476354764547655476654767547685476954770547715477254773547745477554776547775477854779547805478154782547835478454785547865478754788547895479054791547925479354794547955479654797547985479954800548015480254803548045480554806548075480854809548105481154812548135481454815548165481754818548195482054821548225482354824548255482654827548285482954830548315483254833548345483554836548375483854839548405484154842548435484454845548465484754848548495485054851548525485354854548555485654857548585485954860548615486254863548645486554866548675486854869548705487154872548735487454875548765487754878548795488054881548825488354884548855488654887548885488954890548915489254893548945489554896548975489854899549005490154902549035490454905549065490754908549095491054911549125491354914549155491654917549185491954920549215492254923549245492554926549275492854929549305493154932549335493454935549365493754938549395494054941549425494354944549455494654947549485494954950549515495254953549545495554956549575495854959549605496154962549635496454965549665496754968549695497054971549725497354974549755497654977549785497954980549815498254983549845498554986549875498854989549905499154992549935499454995549965499754998549995500055001550025500355004550055500655007550085500955010550115501255013550145501555016550175501855019550205502155022550235502455025550265502755028550295503055031550325503355034550355503655037550385503955040550415504255043550445504555046550475504855049550505505155052550535505455055550565505755058550595506055061550625506355064550655506655067550685506955070550715507255073550745507555076550775507855079550805508155082550835508455085550865508755088550895509055091550925509355094550955509655097550985509955100551015510255103551045510555106551075510855109551105511155112551135511455115551165511755118551195512055121551225512355124551255512655127551285512955130551315513255133551345513555136551375513855139551405514155142551435514455145551465514755148551495515055151551525515355154551555515655157551585515955160551615516255163551645516555166551675516855169551705517155172551735517455175551765517755178551795518055181551825518355184551855518655187551885518955190551915519255193551945519555196551975519855199552005520155202552035520455205552065520755208552095521055211552125521355214552155521655217552185521955220552215522255223552245522555226552275522855229552305523155232552335523455235552365523755238552395524055241552425524355244552455524655247552485524955250552515525255253552545525555256552575525855259552605526155262552635526455265552665526755268552695527055271552725527355274552755527655277552785527955280552815528255283552845528555286552875528855289552905529155292552935529455295552965529755298552995530055301553025530355304553055530655307553085530955310553115531255313553145531555316553175531855319553205532155322553235532455325553265532755328553295533055331553325533355334553355533655337553385533955340553415534255343553445534555346553475534855349553505535155352553535535455355553565535755358553595536055361553625536355364553655536655367553685536955370553715537255373553745537555376553775537855379553805538155382553835538455385553865538755388553895539055391553925539355394553955539655397553985539955400554015540255403554045540555406554075540855409554105541155412554135541455415554165541755418554195542055421554225542355424554255542655427554285542955430554315543255433554345543555436554375543855439554405544155442554435544455445554465544755448554495545055451554525545355454554555545655457554585545955460554615546255463554645546555466554675546855469554705547155472554735547455475554765547755478554795548055481554825548355484554855548655487554885548955490554915549255493554945549555496554975549855499555005550155502555035550455505555065550755508555095551055511555125551355514555155551655517555185551955520555215552255523555245552555526555275552855529555305553155532555335553455535555365553755538555395554055541555425554355544555455554655547555485554955550555515555255553555545555555556555575555855559555605556155562555635556455565555665556755568555695557055571555725557355574555755557655577555785557955580555815558255583555845558555586555875558855589555905559155592555935559455595555965559755598555995560055601556025560355604556055560655607556085560955610556115561255613556145561555616556175561855619556205562155622556235562455625556265562755628556295563055631556325563355634556355563655637556385563955640556415564255643556445564555646556475564855649556505565155652556535565455655556565565755658556595566055661556625566355664556655566655667556685566955670556715567255673556745567555676556775567855679556805568155682556835568455685556865568755688556895569055691556925569355694556955569655697556985569955700557015570255703557045570555706557075570855709557105571155712557135571455715557165571755718557195572055721557225572355724557255572655727557285572955730557315573255733557345573555736557375573855739557405574155742557435574455745557465574755748557495575055751557525575355754557555575655757557585575955760557615576255763557645576555766557675576855769557705577155772557735577455775557765577755778557795578055781557825578355784557855578655787557885578955790557915579255793557945579555796557975579855799558005580155802558035580455805558065580755808558095581055811558125581355814558155581655817558185581955820558215582255823558245582555826558275582855829558305583155832558335583455835558365583755838558395584055841558425584355844558455584655847558485584955850558515585255853558545585555856558575585855859558605586155862558635586455865558665586755868558695587055871558725587355874558755587655877558785587955880558815588255883558845588555886558875588855889558905589155892558935589455895558965589755898558995590055901559025590355904559055590655907559085590955910559115591255913559145591555916559175591855919559205592155922559235592455925559265592755928559295593055931559325593355934559355593655937559385593955940559415594255943559445594555946559475594855949559505595155952559535595455955559565595755958559595596055961559625596355964559655596655967559685596955970559715597255973559745597555976559775597855979559805598155982559835598455985559865598755988559895599055991559925599355994559955599655997559985599956000560015600256003560045600556006560075600856009560105601156012560135601456015560165601756018560195602056021560225602356024560255602656027560285602956030560315603256033560345603556036560375603856039560405604156042560435604456045560465604756048560495605056051560525605356054560555605656057560585605956060560615606256063560645606556066560675606856069560705607156072560735607456075560765607756078560795608056081560825608356084560855608656087560885608956090560915609256093560945609556096560975609856099561005610156102561035610456105561065610756108561095611056111561125611356114561155611656117561185611956120561215612256123561245612556126561275612856129561305613156132561335613456135561365613756138561395614056141561425614356144561455614656147561485614956150561515615256153561545615556156561575615856159561605616156162561635616456165561665616756168561695617056171561725617356174561755617656177561785617956180561815618256183561845618556186561875618856189561905619156192561935619456195561965619756198561995620056201562025620356204562055620656207562085620956210562115621256213562145621556216562175621856219562205622156222562235622456225562265622756228562295623056231562325623356234562355623656237562385623956240562415624256243562445624556246562475624856249562505625156252562535625456255562565625756258562595626056261562625626356264562655626656267562685626956270562715627256273562745627556276562775627856279562805628156282562835628456285562865628756288562895629056291562925629356294562955629656297562985629956300563015630256303563045630556306563075630856309563105631156312563135631456315563165631756318563195632056321563225632356324563255632656327563285632956330563315633256333563345633556336563375633856339563405634156342563435634456345563465634756348563495635056351563525635356354563555635656357563585635956360563615636256363563645636556366563675636856369563705637156372563735637456375563765637756378563795638056381563825638356384563855638656387563885638956390563915639256393563945639556396563975639856399564005640156402564035640456405564065640756408564095641056411564125641356414564155641656417564185641956420564215642256423564245642556426564275642856429564305643156432564335643456435564365643756438564395644056441564425644356444564455644656447564485644956450564515645256453564545645556456564575645856459564605646156462564635646456465564665646756468564695647056471564725647356474564755647656477564785647956480564815648256483564845648556486564875648856489564905649156492564935649456495564965649756498564995650056501565025650356504565055650656507565085650956510565115651256513565145651556516565175651856519565205652156522565235652456525565265652756528565295653056531565325653356534565355653656537565385653956540565415654256543565445654556546565475654856549565505655156552565535655456555565565655756558565595656056561565625656356564565655656656567565685656956570565715657256573565745657556576565775657856579565805658156582565835658456585565865658756588565895659056591565925659356594565955659656597565985659956600566015660256603566045660556606566075660856609566105661156612566135661456615566165661756618566195662056621566225662356624566255662656627566285662956630566315663256633566345663556636566375663856639566405664156642566435664456645566465664756648566495665056651566525665356654566555665656657566585665956660566615666256663566645666556666566675666856669566705667156672566735667456675566765667756678566795668056681566825668356684566855668656687566885668956690566915669256693566945669556696566975669856699567005670156702567035670456705567065670756708567095671056711567125671356714567155671656717567185671956720567215672256723567245672556726567275672856729567305673156732567335673456735567365673756738567395674056741567425674356744567455674656747567485674956750567515675256753567545675556756567575675856759567605676156762567635676456765567665676756768567695677056771567725677356774567755677656777567785677956780567815678256783567845678556786567875678856789567905679156792567935679456795567965679756798567995680056801568025680356804568055680656807568085680956810568115681256813568145681556816568175681856819568205682156822568235682456825568265682756828568295683056831568325683356834568355683656837568385683956840568415684256843568445684556846568475684856849568505685156852568535685456855568565685756858568595686056861568625686356864568655686656867568685686956870568715687256873568745687556876568775687856879568805688156882568835688456885568865688756888568895689056891568925689356894568955689656897568985689956900569015690256903569045690556906569075690856909569105691156912569135691456915569165691756918569195692056921569225692356924569255692656927569285692956930569315693256933569345693556936569375693856939569405694156942569435694456945569465694756948569495695056951569525695356954569555695656957569585695956960569615696256963569645696556966569675696856969569705697156972569735697456975569765697756978569795698056981569825698356984569855698656987569885698956990569915699256993569945699556996569975699856999570005700157002570035700457005570065700757008570095701057011570125701357014570155701657017570185701957020570215702257023570245702557026570275702857029570305703157032570335703457035570365703757038570395704057041570425704357044570455704657047570485704957050570515705257053570545705557056570575705857059570605706157062570635706457065570665706757068570695707057071570725707357074570755707657077570785707957080570815708257083570845708557086570875708857089570905709157092570935709457095570965709757098570995710057101571025710357104571055710657107571085710957110571115711257113571145711557116571175711857119571205712157122571235712457125571265712757128571295713057131571325713357134571355713657137571385713957140571415714257143571445714557146571475714857149571505715157152571535715457155571565715757158571595716057161571625716357164571655716657167571685716957170571715717257173571745717557176571775717857179571805718157182571835718457185571865718757188571895719057191571925719357194571955719657197571985719957200572015720257203572045720557206572075720857209572105721157212572135721457215572165721757218572195722057221572225722357224572255722657227572285722957230572315723257233572345723557236572375723857239572405724157242572435724457245572465724757248572495725057251572525725357254572555725657257572585725957260572615726257263572645726557266572675726857269572705727157272572735727457275572765727757278572795728057281572825728357284572855728657287572885728957290572915729257293572945729557296572975729857299573005730157302573035730457305573065730757308573095731057311573125731357314573155731657317573185731957320573215732257323573245732557326573275732857329573305733157332573335733457335573365733757338573395734057341573425734357344573455734657347573485734957350573515735257353573545735557356573575735857359573605736157362573635736457365573665736757368573695737057371573725737357374573755737657377573785737957380573815738257383573845738557386573875738857389573905739157392573935739457395573965739757398573995740057401574025740357404574055740657407574085740957410574115741257413574145741557416574175741857419574205742157422574235742457425574265742757428574295743057431574325743357434574355743657437574385743957440574415744257443574445744557446574475744857449574505745157452574535745457455574565745757458574595746057461574625746357464574655746657467574685746957470574715747257473574745747557476574775747857479574805748157482574835748457485574865748757488574895749057491574925749357494574955749657497574985749957500575015750257503575045750557506575075750857509575105751157512575135751457515575165751757518575195752057521575225752357524575255752657527575285752957530575315753257533575345753557536575375753857539575405754157542575435754457545575465754757548575495755057551575525755357554575555755657557575585755957560575615756257563575645756557566575675756857569575705757157572575735757457575575765757757578575795758057581575825758357584575855758657587575885758957590575915759257593575945759557596575975759857599576005760157602576035760457605576065760757608576095761057611576125761357614576155761657617576185761957620576215762257623576245762557626576275762857629576305763157632576335763457635576365763757638576395764057641576425764357644576455764657647576485764957650576515765257653576545765557656576575765857659576605766157662576635766457665576665766757668576695767057671576725767357674576755767657677576785767957680576815768257683576845768557686576875768857689576905769157692576935769457695576965769757698576995770057701577025770357704577055770657707577085770957710577115771257713577145771557716577175771857719577205772157722577235772457725577265772757728577295773057731577325773357734577355773657737577385773957740577415774257743577445774557746577475774857749577505775157752577535775457755577565775757758577595776057761577625776357764577655776657767577685776957770577715777257773577745777557776577775777857779577805778157782577835778457785577865778757788577895779057791577925779357794577955779657797577985779957800578015780257803578045780557806
  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. hardwareHotList = {}
  16. //热点 设备控制
  17. $("#hotPannel .close").on('click',()=>{
  18. $("#hotPannel>div").css("display","");
  19. window.hotNeedUpdatePannel = null;
  20. })
  21. $("#hotPannel input.mui-switch").on('change',()=>{
  22. var ifOn = $('#hotPannel input.mui-switch').is(':checked');
  23. console.log('切换')
  24. })
  25. !function() {
  26. "use strict";
  27. function t(t, i) {
  28. return typeof t === i
  29. }
  30. function i(t, i) {
  31. return t instanceof i
  32. }
  33. function n(t) {
  34. return t && t.nodeType
  35. }
  36. function e(t) {
  37. return n(t) ? t : i(t, g) ? t[0] : void 0
  38. }
  39. function o(t, i, n) {
  40. return g.each(t, function(t, e) {
  41. n = i.call(e, n, t, e)
  42. }),
  43. n
  44. }
  45. function r(t, i, n) {
  46. var e, o, r;
  47. if (t === i)
  48. return !0;
  49. if (!t || !i || t.constructor !== i.constructor)
  50. return !1;
  51. for (e = 0,
  52. o = n.length; o > e; e += 1) {
  53. if (r = n[e],
  54. t[r] && y(t[r].equals) && !t[r].equals(i[r]))
  55. return !1;
  56. if (t[r] !== i[r])
  57. return !1
  58. }
  59. return !0
  60. }
  61. function s(t, i, n, e) {
  62. this.left = E(t),
  63. this.top = E(i),
  64. this.width = E(n),
  65. this.height = E(e),
  66. this.right = this.left + this.width,
  67. this.bottom = this.top + this.height
  68. }
  69. function h(t, i, n, e) {
  70. this.visible = t || 0,
  71. this.viewport = i || 0,
  72. this.possible = n || 0,
  73. this.rects = e && T({}, e) || null
  74. }
  75. function l(t, i) {
  76. this.els = t,
  77. this.viewport = i
  78. }
  79. function c(t, i, n) {
  80. var e;
  81. return g.inArray(n, q) >= 0 ? e = s.ofElement(t) : g.inArray(n, S) >= 0 && (e = h.of(t, i)),
  82. e ? e[n] : 0
  83. }
  84. function u(t, i) {
  85. return t.val - i.val
  86. }
  87. function a(t, i) {
  88. return i.val - t.val
  89. }
  90. function f(t) {
  91. var i = s.ofContent(t, !0)
  92. , n = s.ofViewport(t, !0)
  93. , e = i.width - n.width
  94. , o = i.height - n.height;
  95. this.content = i,
  96. this.viewport = n,
  97. this.width = 0 >= e ? null : n.left / e,
  98. this.height = 0 >= o ? null : n.top / o,
  99. this.left = n.left,
  100. this.top = n.top,
  101. this.right = i.right - n.right,
  102. this.bottom = i.bottom - n.bottom
  103. }
  104. function p(t) {
  105. this.el = t || window
  106. }
  107. function d(t, i) {
  108. this.context = t,
  109. this.viewport = i,
  110. this.init()
  111. }
  112. function v(t, i, n, e) {
  113. this.context = new l(t,i),
  114. this.property = n,
  115. this.descending = e,
  116. this.init()
  117. }
  118. function w(t) {
  119. t && t !== window && t !== document ? (this.context = t,
  120. this.$autoTarget = g(t)) : this.context = window,
  121. this.init()
  122. }
  123. var g = jQuery
  124. , m = g(window)
  125. , b = g(document)
  126. , T = g.extend
  127. , y = g.isFunction
  128. , k = Math.max
  129. , V = Math.min
  130. , E = Math.round
  131. , x = function() {
  132. var t = {}
  133. , i = 1;
  134. return function(n) {
  135. return n ? (t[n] || (t[n] = i,
  136. i += 1),
  137. t[n]) : 0
  138. }
  139. }();
  140. T(s.prototype, {
  141. equals: function(t) {
  142. return r(this, t, ["left", "top", "width", "height"])
  143. },
  144. area: function() {
  145. return this.width * this.height
  146. },
  147. relativeTo: function(t) {
  148. return new s(this.left - t.left,this.top - t.top,this.width,this.height)
  149. },
  150. intersection: function(t) {
  151. if (!i(t, s))
  152. return null;
  153. var n = k(this.left, t.left)
  154. , e = V(this.right, t.right)
  155. , o = k(this.top, t.top)
  156. , r = V(this.bottom, t.bottom)
  157. , h = e - n
  158. , l = r - o;
  159. return h >= 0 && l >= 0 ? new s(n,o,h,l) : null
  160. },
  161. envelope: function(t) {
  162. if (!i(t, s))
  163. return this;
  164. var n = V(this.left, t.left)
  165. , e = k(this.right, t.right)
  166. , o = V(this.top, t.top)
  167. , r = k(this.bottom, t.bottom)
  168. , h = e - n
  169. , l = r - o;
  170. return new s(n,o,h,l)
  171. }
  172. }),
  173. T(s, {
  174. ofContent: function(t, i) {
  175. 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())
  176. },
  177. ofViewport: function(t, i) {
  178. 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())
  179. },
  180. ofElement: function(t) {
  181. var i = g(t);
  182. if (!i.is(":visible"))
  183. return null;
  184. var n = i.offset();
  185. return new s(n.left,n.top,i.outerWidth(),i.outerHeight())
  186. }
  187. }),
  188. T(h.prototype, {
  189. equals: function(t) {
  190. return this.fracsEqual(t) && this.rectsEqual(t)
  191. },
  192. fracsEqual: function(t) {
  193. return r(this, t, ["visible", "viewport", "possible"])
  194. },
  195. rectsEqual: function(t) {
  196. return r(this.rects, t.rects, ["document", "element", "viewport"])
  197. }
  198. }),
  199. T(h, {
  200. of: function(t, i) {
  201. var e, o, r;
  202. return t = n(t) && s.ofElement(t) || t,
  203. i = n(i) && s.ofViewport(i) || i || s.ofViewport(),
  204. t instanceof s && (e = t.intersection(i)) ? (o = e.area(),
  205. r = V(t.width, i.width) * V(t.height, i.height),
  206. new h(o / t.area(),o / i.area(),o / r,{
  207. document: e,
  208. element: e.relativeTo(t),
  209. viewport: e.relativeTo(i)
  210. })) : new h
  211. }
  212. });
  213. var q = ["width", "height", "left", "right", "top", "bottom"]
  214. , S = ["possible", "visible", "viewport"];
  215. T(l.prototype, {
  216. sorted: function(t, i) {
  217. var n = this.viewport;
  218. return g.map(this.els, function(i) {
  219. return {
  220. el: i,
  221. val: c(i, n, t)
  222. }
  223. }).sort(i ? a : u)
  224. },
  225. best: function(t, i) {
  226. return this.els.length ? this.sorted(t, i)[0] : null
  227. }
  228. }),
  229. T(f.prototype, {
  230. equals: function(t) {
  231. return r(this, t, ["width", "height", "left", "top", "right", "bottom", "content", "viewport"])
  232. }
  233. }),
  234. T(p.prototype, {
  235. equals: function(t) {
  236. return r(this, t, ["el"])
  237. },
  238. scrollState: function() {
  239. return new f(this.el)
  240. },
  241. scrollTo: function(t, i, n) {
  242. var e = g(this.el === window ? "html,body" : this.el);
  243. t = t || 0,
  244. i = i || 0,
  245. n = isNaN(n) ? 1e3 : n,
  246. e.stop(!0).animate({
  247. scrollLeft: t,
  248. scrollTop: i
  249. }, n)
  250. },
  251. scroll: function(t, i, n) {
  252. var e = this.el === window ? m : g(this.el);
  253. t = t || 0,
  254. i = i || 0,
  255. this.scrollTo(e.scrollLeft() + t, e.scrollTop() + i, n)
  256. },
  257. scrollToRect: function(t, i, n, e) {
  258. i = i || 0,
  259. n = n || 0,
  260. this.scrollTo(t.left - i, t.top - n, e)
  261. },
  262. scrollToElement: function(t, i, n, e) {
  263. var o = s.ofElement(t).relativeTo(s.ofContent(this.el));
  264. this.scrollToRect(o, i, n, e)
  265. }
  266. });
  267. var C = {
  268. init: function() {
  269. this.callbacks = g.Callbacks("memory unique"),
  270. this.currVal = null,
  271. this.prevVal = null,
  272. this.checkProxy = g.proxy(this.check, this),
  273. this.autoCheck()
  274. },
  275. bind: function(t) {
  276. this.callbacks.add(t)
  277. },
  278. unbind: function(t) {
  279. t ? this.callbacks.remove(t) : this.callbacks.empty()
  280. },
  281. trigger: function() {
  282. this.callbacks.fireWith(this.context, [this.currVal, this.prevVal])
  283. },
  284. check: function(t) {
  285. var i = this.updatedValue(t);
  286. return void 0 !== i && (this.prevVal = this.currVal,
  287. this.currVal = i,
  288. this.trigger(),
  289. !0)
  290. },
  291. $autoTarget: m,
  292. autoEvents: "load resize scroll",
  293. autoCheck: function(t) {
  294. this.$autoTarget[t === !1 ? "off" : "on"](this.autoEvents, this.checkProxy)
  295. }
  296. };
  297. T(d.prototype, C, {
  298. updatedValue: function() {
  299. var t = h.of(this.context, this.viewport);
  300. return this.currVal && this.currVal.equals(t) ? void 0 : t
  301. }
  302. }),
  303. T(v.prototype, C, {
  304. updatedValue: function() {
  305. var t = this.context.best(this.property, this.descending);
  306. return t && (t = t.val > 0 ? t.el : null,
  307. this.currVal !== t) ? t : void 0
  308. }
  309. }),
  310. T(w.prototype, C, {
  311. updatedValue: function() {
  312. var t = new f(this.context);
  313. return this.currVal && this.currVal.equals(t) ? void 0 : t
  314. }
  315. });
  316. var L = function(t, i) {
  317. var n = [].slice
  318. , e = jQuery
  319. , o = e.extend
  320. , r = e.isFunction
  321. , s = o({}, i)
  322. , h = function(i, n, o, s) {
  323. return o = r(o) ? o.apply(i, n) : o,
  324. r(s[o]) ? s[o].apply(i, n) : void e.error('Method "' + o + '" does not exist on jQuery.' + t)
  325. }
  326. , l = function() {
  327. return h(this, n.call(arguments), s.defaultStatic, l)
  328. }
  329. , c = function(t) {
  330. return r(c[t]) ? c[t].apply(this, n.call(arguments, 1)) : h(this, n.call(arguments), s.defaultMethod, c)
  331. }
  332. , u = function(t) {
  333. t && (o(l, t.statics),
  334. o(c, t.methods)),
  335. l.modplug = u
  336. };
  337. u.prev = {
  338. statics: e[t],
  339. methods: e.fn[t]
  340. },
  341. u(i),
  342. e[t] = l,
  343. e.fn[t] = c
  344. }
  345. , M = "fracs";
  346. L(M, {
  347. statics: {
  348. version: "0.15.0",
  349. Rect: s,
  350. Fractions: h,
  351. Group: l,
  352. ScrollState: f,
  353. Viewport: p,
  354. FracsCallbacks: d,
  355. GroupCallbacks: v,
  356. ScrollStateCallbacks: w,
  357. fracs: function(t, i) {
  358. return h.of(t, i)
  359. }
  360. },
  361. methods: {
  362. content: function(t) {
  363. return this.length ? s.ofContent(this[0], t) : null
  364. },
  365. envelope: function() {
  366. return o(this, function(t) {
  367. var i = s.ofElement(this);
  368. return t ? t.envelope(i) : i
  369. })
  370. },
  371. fracs: function(i, n, o) {
  372. t(i, "string") || (o = n,
  373. n = i,
  374. i = null),
  375. y(n) || (o = n,
  376. n = null),
  377. o = e(o);
  378. var r = M + ".fracs." + x(o);
  379. return "unbind" === i ? this.each(function() {
  380. var t = g(this).data(r);
  381. t && t.unbind(n)
  382. }) : "check" === i ? this.each(function() {
  383. var t = g(this).data(r);
  384. t && t.check()
  385. }) : y(n) ? this.each(function() {
  386. var t = g(this)
  387. , i = t.data(r);
  388. i || (i = new d(this,o),
  389. t.data(r, i)),
  390. i.bind(n)
  391. }) : this.length ? h.of(this[0], o) : null
  392. },
  393. intersection: function() {
  394. return o(this, function(t) {
  395. var i = s.ofElement(this);
  396. return t ? t.intersection(i) : i
  397. })
  398. },
  399. max: function(t, i, n) {
  400. return y(i) || (n = i,
  401. i = null),
  402. n = e(n),
  403. i ? (new v(this,n,t,!0).bind(i),
  404. this) : this.pushStack(new l(this,n).best(t, !0).el)
  405. },
  406. min: function(t, i, n) {
  407. return y(i) || (n = i,
  408. i = null),
  409. n = e(n),
  410. i ? (new v(this,n,t).bind(i),
  411. this) : this.pushStack(new l(this,n).best(t).el)
  412. },
  413. rect: function() {
  414. return this.length ? s.ofElement(this[0]) : null
  415. },
  416. scrollState: function(i, n) {
  417. var e = M + ".scrollState";
  418. return t(i, "string") || (n = i,
  419. i = null),
  420. "unbind" === i ? this.each(function() {
  421. var t = g(this).data(e);
  422. t && t.unbind(n)
  423. }) : "check" === i ? this.each(function() {
  424. var t = g(this).data(e);
  425. t && t.check()
  426. }) : y(n) ? this.each(function() {
  427. var t = g(this)
  428. , i = t.data(e);
  429. i || (i = new w(this),
  430. t.data(e, i)),
  431. i.bind(n)
  432. }) : this.length ? new f(this[0]) : null
  433. },
  434. scroll: function(t, i, n) {
  435. return this.each(function() {
  436. new p(this).scroll(t, i, n)
  437. })
  438. },
  439. scrollTo: function(t, i, n, o) {
  440. return g.isNumeric(t) && (o = n,
  441. n = i,
  442. i = t,
  443. t = null),
  444. t = e(t),
  445. this.each(function() {
  446. t ? new p(this).scrollToElement(t, i, n, o) : new p(this).scrollTo(i, n, o)
  447. })
  448. },
  449. scrollToThis: function(t, i, n, o) {
  450. return o = new p(e(o)),
  451. o.scrollToElement(this[0], t, i, n),
  452. this
  453. },
  454. softLink: function(t, i, n, o) {
  455. return o = new p(e(o)),
  456. this.filter("a[href^=#]").each(function() {
  457. var e = g(this);
  458. e.on("click", function() {
  459. o.scrollToElement(g(e.attr("href"))[0], t, i, n)
  460. })
  461. })
  462. },
  463. sort: function(i, n, o) {
  464. return t(n, "boolean") || (o = n,
  465. n = null),
  466. o = e(o),
  467. this.pushStack(g.map(new l(this,o).sorted(i, !n), function(t) {
  468. return t.el
  469. }))
  470. },
  471. viewport: function(t) {
  472. return this.length ? s.ofViewport(this[0], t) : null
  473. }
  474. },
  475. defaultStatic: "fracs",
  476. defaultMethod: "fracs"
  477. })
  478. }();
  479. if ("undefined" == typeof jQuery)
  480. throw new Error("Bootstrap's JavaScript requires jQuery");
  481. +function(t) {
  482. "use strict";
  483. function e(e) {
  484. return this.each(function() {
  485. var o = t(this)
  486. , s = o.data("bs.tooltip")
  487. , n = "object" == typeof e && e;
  488. (s || "destroy" != e) && (s || o.data("bs.tooltip", s = new i(this,n)),
  489. "string" == typeof e && s[e]())
  490. })
  491. }
  492. var i = function(t, e) {
  493. this.type = this.options = this.enabled = this.timeout = this.hoverState = this.$element = null,
  494. this.init("tooltip", t, e)
  495. };
  496. i.VERSION = "3.2.0",
  497. i.DEFAULTS = {
  498. animation: !0,
  499. placement: "top",
  500. selector: !1,
  501. template: '<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',
  502. trigger: "hover focus",
  503. title: "",
  504. delay: 0,
  505. html: !1,
  506. container: !1,
  507. viewport: {
  508. selector: "body",
  509. padding: 0
  510. }
  511. },
  512. i.prototype.init = function(e, i, o) {
  513. this.enabled = !0,
  514. this.type = e,
  515. this.$element = t(i),
  516. this.options = this.getOptions(o),
  517. this.$viewport = this.options.viewport && t(this.options.viewport.selector || this.options.viewport);
  518. for (var s = this.options.trigger.split(" "), n = s.length; n--; ) {
  519. var r = s[n];
  520. if ("click" == r)
  521. this.$element.on("click." + this.type, this.options.selector, t.proxy(this.toggle, this));
  522. else if ("manual" != r) {
  523. var a = "hover" == r ? "mouseenter" : "focusin"
  524. , l = "hover" == r ? "mouseleave" : "focusout";
  525. this.$element.on(a + "." + this.type, this.options.selector, t.proxy(this.enter, this)),
  526. this.$element.on(l + "." + this.type, this.options.selector, t.proxy(this.leave, this))
  527. }
  528. }
  529. this.options.selector ? this._options = t.extend({}, this.options, {
  530. trigger: "manual",
  531. selector: ""
  532. }) : this.fixTitle()
  533. }
  534. ,
  535. i.prototype.getDefaults = function() {
  536. return i.DEFAULTS
  537. }
  538. ,
  539. i.prototype.getOptions = function(e) {
  540. return e = t.extend({}, this.getDefaults(), this.$element.data(), e),
  541. e.delay && "number" == typeof e.delay && (e.delay = {
  542. show: e.delay,
  543. hide: e.delay
  544. }),
  545. e
  546. }
  547. ,
  548. i.prototype.getDelegateOptions = function() {
  549. var e = {}
  550. , i = this.getDefaults();
  551. return this._options && t.each(this._options, function(t, o) {
  552. i[t] != o && (e[t] = o)
  553. }),
  554. e
  555. }
  556. ,
  557. i.prototype.enter = function(e) {
  558. var i = e instanceof this.constructor ? e : t(e.currentTarget).data("bs." + this.type);
  559. return i || (i = new this.constructor(e.currentTarget,this.getDelegateOptions()),
  560. t(e.currentTarget).data("bs." + this.type, i)),
  561. clearTimeout(i.timeout),
  562. i.hoverState = "in",
  563. i.options.delay && i.options.delay.show ? void (i.timeout = setTimeout(function() {
  564. // "in" == i.hoverState && i.show()
  565. }, i.options.delay.show)) : i.show()
  566. }
  567. ,
  568. i.prototype.leave = function(e) {
  569. var i = e instanceof this.constructor ? e : t(e.currentTarget).data("bs." + this.type);
  570. return i || (i = new this.constructor(e.currentTarget,this.getDelegateOptions()),
  571. t(e.currentTarget).data("bs." + this.type, i)),
  572. clearTimeout(i.timeout),
  573. i.hoverState = "out",
  574. i.options.delay && i.options.delay.hide ? void (i.timeout = setTimeout(function() {
  575. "out" == i.hoverState && i.hide()
  576. }, i.options.delay.hide)) : i.hide()
  577. }
  578. ,
  579. i.prototype.show = function() {
  580. var e = t.Event("show.bs." + this.type);
  581. if (this.hasContent() && this.enabled) {
  582. this.$element.trigger(e);
  583. var i = t.contains(document.documentElement, this.$element[0]);
  584. if (e.isDefaultPrevented() || !i)
  585. return;
  586. var o = this
  587. , s = this.tip()
  588. , n = this.getUID(this.type);
  589. this.setContent(),
  590. s.attr("id", n),
  591. this.$element.attr("aria-describedby", n),
  592. this.options.animation && s.addClass("fade");
  593. var r = "function" == typeof this.options.placement ? this.options.placement.call(this, s[0], this.$element[0]) : this.options.placement
  594. , a = /\s?auto?\s?/i
  595. , l = a.test(r);
  596. l && (r = r.replace(a, "") || "top"),
  597. s.detach().css({
  598. top: 0,
  599. left: 0,
  600. display: "block"
  601. }).addClass(r).data("bs." + this.type, this),
  602. this.options.container ? s.appendTo(this.options.container) : s.insertAfter(this.$element);
  603. var p = this.getPosition()
  604. , h = s[0].offsetWidth
  605. , f = s[0].offsetHeight;
  606. if (l) {
  607. var u = r
  608. , c = this.$element.parent()
  609. , d = this.getPosition(c);
  610. 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,
  611. s.removeClass(u).addClass(r)
  612. }
  613. var g = this.getCalculatedOffset(r, p, h, f);
  614. this.applyPlacement(g, r);
  615. var y = function() {
  616. o.$element.trigger("shown.bs." + o.type),
  617. o.hoverState = null
  618. };
  619. t.support.transition && this.$tip.hasClass("fade") ? s.one("bsTransitionEnd", y).emulateTransitionEnd(150) : y()
  620. }
  621. }
  622. ,
  623. i.prototype.applyPlacement = function(e, i) {
  624. var o = this.tip()
  625. , s = o[0].offsetWidth
  626. , n = o[0].offsetHeight
  627. , r = parseInt(o.css("margin-top"), 10)
  628. , a = parseInt(o.css("margin-left"), 10);
  629. isNaN(r) && (r = 0),
  630. isNaN(a) && (a = 0),
  631. e.top = e.top + r,
  632. e.left = e.left + a,
  633. t.offset.setOffset(o[0], t.extend({
  634. using: function(t) {
  635. o.css({
  636. top: Math.round(t.top),
  637. left: Math.round(t.left)
  638. })
  639. }
  640. }, e), 0),
  641. o.addClass("in");
  642. var l = o[0].offsetWidth
  643. , p = o[0].offsetHeight;
  644. "top" == i && p != n && (e.top = e.top + n - p);
  645. var h = this.getViewportAdjustedDelta(i, e, l, p);
  646. h.left ? e.left += h.left : e.top += h.top;
  647. var f = h.left ? 2 * h.left - s + l : 2 * h.top - n + p
  648. , u = h.left ? "left" : "top"
  649. , c = h.left ? "offsetWidth" : "offsetHeight";
  650. o.offset(e),
  651. this.replaceArrow(f, o[0][c], u)
  652. }
  653. ,
  654. i.prototype.replaceArrow = function(t, e, i) {
  655. this.arrow().css(i, t ? 50 * (1 - t / e) + "%" : "")
  656. }
  657. ,
  658. i.prototype.setContent = function() {
  659. var t = this.tip()
  660. , e = this.getTitle();
  661. t.find(".tooltip-inner")[this.options.html ? "html" : "text"](e),
  662. t.removeClass("fade in top bottom left right")
  663. }
  664. ,
  665. i.prototype.hide = function() {
  666. function e() {
  667. "in" != i.hoverState && o.detach(),
  668. i.$element.trigger("hidden.bs." + i.type)
  669. }
  670. var i = this
  671. , o = this.tip()
  672. , s = t.Event("hide.bs." + this.type);
  673. if (this.$element.removeAttr("aria-describedby"),
  674. this.$element.trigger(s),
  675. !s.isDefaultPrevented())
  676. return o.removeClass("in"),
  677. t.support.transition && this.$tip.hasClass("fade") ? o.one("bsTransitionEnd", e).emulateTransitionEnd(150) : e(),
  678. this.hoverState = null,
  679. this
  680. }
  681. ,
  682. i.prototype.fixTitle = function() {
  683. var t = this.$element;
  684. (t.attr("title") || "string" != typeof t.attr("data-original-title")) && t.attr("data-original-title", t.attr("title") || "").attr("title", "")
  685. }
  686. ,
  687. i.prototype.hasContent = function() {
  688. return this.getTitle()
  689. }
  690. ,
  691. i.prototype.getPosition = function(e) {
  692. e = e || this.$element;
  693. var i = e[0]
  694. , o = "BODY" == i.tagName;
  695. return t.extend({}, "function" == typeof i.getBoundingClientRect ? i.getBoundingClientRect() : null, {
  696. scroll: o ? document.documentElement.scrollTop || document.body.scrollTop : e.scrollTop(),
  697. width: o ? t(window).width() : e.outerWidth(),
  698. height: o ? t(window).height() : e.outerHeight()
  699. }, o ? {
  700. top: 0,
  701. left: 0
  702. } : e.offset())
  703. }
  704. ,
  705. i.prototype.getCalculatedOffset = function(t, e, i, o) {
  706. return "bottom" == t ? {
  707. top: e.top + e.height,
  708. left: e.left + e.width / 2 - i / 2
  709. } : "top" == t ? {
  710. top: e.top - o,
  711. left: e.left + e.width / 2 - i / 2
  712. } : "left" == t ? {
  713. top: e.top + e.height / 2 - o / 2,
  714. left: e.left - i
  715. } : {
  716. top: e.top + e.height / 2 - o / 2,
  717. left: e.left + e.width
  718. }
  719. }
  720. ,
  721. i.prototype.getViewportAdjustedDelta = function(t, e, i, o) {
  722. var s = {
  723. top: 0,
  724. left: 0
  725. };
  726. if (!this.$viewport)
  727. return s;
  728. var n = this.options.viewport && this.options.viewport.padding || 0
  729. , r = this.getPosition(this.$viewport);
  730. if (/right|left/.test(t)) {
  731. var a = e.top - n - r.scroll
  732. , l = e.top + n - r.scroll + o;
  733. a < r.top ? s.top = r.top - a : l > r.top + r.height && (s.top = r.top + r.height - l)
  734. } else {
  735. var p = e.left - n
  736. , h = e.left + n + i;
  737. p < r.left ? s.left = r.left - p : h > r.width && (s.left = r.left + r.width - h)
  738. }
  739. return s
  740. }
  741. ,
  742. i.prototype.getTitle = function() {
  743. var t, e = this.$element, i = this.options;
  744. return t = e.attr("data-original-title") || ("function" == typeof i.title ? i.title.call(e[0]) : i.title)
  745. }
  746. ,
  747. i.prototype.getUID = function(t) {
  748. do
  749. t += ~~(1e6 * Math.random());
  750. while (document.getElementById(t));return t
  751. }
  752. ,
  753. i.prototype.tip = function() {
  754. return this.$tip = this.$tip || t(this.options.template)
  755. }
  756. ,
  757. i.prototype.arrow = function() {
  758. return this.$arrow = this.$arrow || this.tip().find(".tooltip-arrow")
  759. }
  760. ,
  761. i.prototype.validate = function() {
  762. this.$element[0].parentNode || (this.hide(),
  763. this.$element = null,
  764. this.options = null)
  765. }
  766. ,
  767. i.prototype.enable = function() {
  768. this.enabled = !0
  769. }
  770. ,
  771. i.prototype.disable = function() {
  772. this.enabled = !1
  773. }
  774. ,
  775. i.prototype.toggleEnabled = function() {
  776. this.enabled = !this.enabled
  777. }
  778. ,
  779. i.prototype.toggle = function(e) {
  780. var i = this;
  781. e && (i = t(e.currentTarget).data("bs." + this.type),
  782. i || (i = new this.constructor(e.currentTarget,this.getDelegateOptions()),
  783. t(e.currentTarget).data("bs." + this.type, i))),
  784. i.tip().hasClass("in") ? i.leave(i) : i.enter(i)
  785. }
  786. ,
  787. i.prototype.destroy = function() {
  788. clearTimeout(this.timeout),
  789. this.hide().$element.off("." + this.type).removeData("bs." + this.type)
  790. }
  791. ;
  792. var o = t.fn.tooltip;
  793. t.fn.tooltip = e,
  794. t.fn.tooltip.Constructor = i,
  795. t.fn.tooltip.noConflict = function() {
  796. return t.fn.tooltip = o,
  797. this
  798. }
  799. }(jQuery);
  800. !function(e, t, n) {
  801. "undefined" != typeof module && module.exports ? module.exports = n() : "function" == typeof define && define.amd ? define(n) : t[e] = n()
  802. }("Keen", this, function() {
  803. "use strict";
  804. function Keen() {
  805. return _init.apply(this, arguments)
  806. }
  807. function _init(e) {
  808. if (_isUndefined(e))
  809. throw new Error("Check out our JavaScript SDK Usage Guide: https://keen.io/docs/clients/javascript/usage-guide/");
  810. if (_isUndefined(e.projectId) || "String" !== _type(e.projectId) || e.projectId.length < 1)
  811. throw new Error("Please provide a projectId");
  812. this.configure(e)
  813. }
  814. function _extend(e) {
  815. for (var t = 1; t < arguments.length; t++)
  816. for (var n in arguments[t])
  817. e[n] = arguments[t][n];
  818. return e
  819. }
  820. function _isUndefined(e) {
  821. return void 0 === e
  822. }
  823. function _type(e) {
  824. var t = e && e.constructor ? e.constructor.toString() : void 0;
  825. return t ? t.match(/function (.*)\(/)[1] : "Null"
  826. }
  827. function _each(e, t, n) {
  828. var r;
  829. if (!e)
  830. return 0;
  831. if (n = n ? n : e,
  832. "array" === _type(e)) {
  833. for (r = 0; r < e.length; r++)
  834. if (t.call(n, e[r], r, e) === !1)
  835. return 0
  836. } else
  837. for (r in e)
  838. if (e.hasOwnProperty(r) && t.call(n, e[r], r, e) === !1)
  839. return 0;
  840. return 1
  841. }
  842. function _parse_params(e) {
  843. for (var t, n = {}, r = /\+/g, i = /([^&=]+)=?([^&]*)/g, o = function(e) {
  844. return decodeURIComponent(e.replace(r, " "))
  845. }, a = e.split("?")[1]; t = i.exec(a); )
  846. n[o(t[1])] = o(t[2]);
  847. return n
  848. }
  849. function _set_protocol(e) {
  850. switch (e) {
  851. case "http":
  852. return "http";
  853. case "auto":
  854. return location.protocol.replace(/:/g, "");
  855. case "https":
  856. case void 0:
  857. default:
  858. return "https"
  859. }
  860. }
  861. function _set_request_type(e) {
  862. var t = e || "jsonp"
  863. , n = !1;
  864. return ("Object" === _type(XMLHttpRequest) || "Function" === _type(XMLHttpRequest)) && "withCredentials"in new XMLHttpRequest && (n = !0),
  865. null == t || "xhr" == t ? n ? "xhr" : "jsonp" : t
  866. }
  867. function _build_url(e) {
  868. return this.client.endpoint + "/projects/" + this.client.projectId + e
  869. }
  870. function _uploadEvent(e, t, n, r, i) {
  871. var o = _build_url.apply(this, ["/events/" + e])
  872. , a = {};
  873. n = n !== !1,
  874. this.client.globalProperties && (a = this.client.globalProperties(e));
  875. for (var c in t)
  876. t.hasOwnProperty(c) && (a[c] = t[c]);
  877. switch (this.client.requestType) {
  878. case "xhr":
  879. _request.xhr.apply(this, ["POST", o, null, a, this.client.writeKey, n, r, i]);
  880. break;
  881. case "jsonp":
  882. var s = JSON.stringify(a)
  883. , l = Keen.Base64.encode(s);
  884. o = o + "?api_key=" + this.client.writeKey,
  885. o = o + "&data=" + l,
  886. o = o + "&modified=" + (new Date).getTime(),
  887. _request.jsonp.apply(this, [o, this.client.writeKey, r, i]);
  888. break;
  889. case "beacon":
  890. var s = JSON.stringify(a)
  891. , l = Keen.Base64.encode(s);
  892. o = o + "?api_key=" + encodeURIComponent(this.client.writeKey),
  893. o = o + "&data=" + encodeURIComponent(l),
  894. o = o + "&modified=" + encodeURIComponent((new Date).getTime()),
  895. o += "&c=clv1",
  896. _request.beacon.apply(this, [o, null, r, i])
  897. }
  898. }
  899. Keen.prototype.configure = function(e) {
  900. return e.host = _isUndefined(e.host) ? "api.keen.io/3.0" : e.host.replace(/.*?:\/\//g, ""),
  901. e.protocol = _set_protocol(e.protocol),
  902. e.requestType = _set_request_type(e.requestType),
  903. this.client = {
  904. projectId: e.projectId,
  905. writeKey: e.writeKey,
  906. readKey: e.readKey,
  907. globalProperties: null,
  908. endpoint: e.protocol + "://" + e.host,
  909. requestType: e.requestType
  910. },
  911. Keen.trigger("client", this, e),
  912. this.trigger("ready"),
  913. this
  914. }
  915. ;
  916. var _request = {
  917. xhr: function(e, t, n, r, i, o, a, c) {
  918. if (!i)
  919. return Keen.log("Please provide a writeKey for https://keen.io/project/" + this.client.projectId);
  920. var s = new XMLHttpRequest;
  921. if (s.onreadystatechange = function() {
  922. if (4 == s.readyState)
  923. if (s.status >= 200 && s.status < 300) {
  924. var e;
  925. try {
  926. e = JSON.parse(s.responseText)
  927. } catch (e) {
  928. Keen.log("Could not JSON parse HTTP response: " + s.responseText),
  929. c && c(s, e)
  930. }
  931. a && e && a(e)
  932. } else
  933. Keen.log("HTTP request failed."),
  934. c && c(s, null)
  935. }
  936. ,
  937. s.open(e, t, o),
  938. i && s.setRequestHeader("Authorization", i),
  939. r && s.setRequestHeader("Content-Type", "application/json"),
  940. n)
  941. for (var l in n)
  942. n.hasOwnProperty(l) && s.setRequestHeader(l, n[l]);
  943. var u = r ? JSON.stringify(r) : null;
  944. s.send(u)
  945. },
  946. jsonp: function(e, t, n, r) {
  947. if (!t)
  948. return Keen.log("Please provide a writeKey for https://keen.io/project/" + this.client.projectId);
  949. if (t && e.indexOf("api_key") < 0) {
  950. var i = e.indexOf("?") > 0 ? "&" : "?";
  951. e = e + i + "api_key=" + t
  952. }
  953. for (var o = "keenJSONPCallback" + (new Date).getTime(); o in window; )
  954. o += "a";
  955. var a = !1;
  956. window[o] = function(e) {
  957. a = !0,
  958. n && e && n(e),
  959. window[o] = void 0
  960. }
  961. ,
  962. e = e + "&jsonp=" + o;
  963. var c = document.createElement("script");
  964. c.id = "keen-jsonp",
  965. c.src = e,
  966. document.getElementsByTagName("head")[0].appendChild(c),
  967. c.onreadystatechange = function() {
  968. a === !1 && "loaded" === this.readyState && (a = !0,
  969. r && r())
  970. }
  971. ,
  972. c.onerror = function() {
  973. a === !1 && (a = !0,
  974. r && r())
  975. }
  976. },
  977. beacon: function(e, t, n, r) {
  978. if (t && e.indexOf("api_key") < 0) {
  979. var i = e.indexOf("?") > 0 ? "&" : "?";
  980. e = e + i + "api_key=" + t
  981. }
  982. var o = !1
  983. , a = document.createElement("img");
  984. a.onload = function() {
  985. if (o = !0,
  986. "naturalHeight"in this) {
  987. if (this.naturalHeight + this.naturalWidth === 0)
  988. return void this.onerror()
  989. } else if (this.width + this.height === 0)
  990. return void this.onerror();
  991. n && n({
  992. created: !0
  993. })
  994. }
  995. ,
  996. a.onerror = function() {
  997. o = !0,
  998. r && r()
  999. }
  1000. ,
  1001. a.src = e
  1002. }
  1003. }
  1004. , Events = Keen.Events = {
  1005. on: function(e, t) {
  1006. this.listeners || (this.listeners = {});
  1007. var n = this.listeners[e] || (this.listeners[e] = []);
  1008. return n.push({
  1009. callback: t
  1010. }),
  1011. this
  1012. },
  1013. off: function(e, t) {
  1014. if (!e && !t)
  1015. return this.listeners = void 0,
  1016. delete this.listeners,
  1017. this;
  1018. for (var n = this.listeners[e] || [], r = n.length; r--; )
  1019. t && t == n[r].callback && this.listeners[e].splice(r, 1),
  1020. t && 0 != n.length || (this.listeners[e] = void 0,
  1021. delete this.listeners[e]);
  1022. return this
  1023. },
  1024. trigger: function(e) {
  1025. if (!this.listeners)
  1026. return this;
  1027. for (var t = Array.prototype.slice.call(arguments, 1), n = this.listeners[e] || [], r = 0; r < n.length; r++)
  1028. n[r].callback.apply(this, t);
  1029. return this
  1030. }
  1031. };
  1032. _extend(Keen.prototype, Events),
  1033. _extend(Keen, Events),
  1034. Keen.loaded = !0,
  1035. Keen.utils = {
  1036. each: _each,
  1037. extend: _extend,
  1038. parseParams: _parse_params
  1039. },
  1040. Keen.ready = function(e) {
  1041. Keen.loaded ? e() : Keen.on("ready", e)
  1042. }
  1043. ,
  1044. Keen.log = function(e) {
  1045. "object" == typeof console && console.log("[Keen IO]", e)
  1046. }
  1047. ;
  1048. var Plugins = Keen.Plugins = {};
  1049. Keen.prototype.addEvent = function() {
  1050. _uploadEvent.apply(this, arguments)
  1051. }
  1052. ,
  1053. Keen.prototype.addEventSync = function(e, t, n, r) {
  1054. _uploadEvent.apply(this, [e, t, !1, n, r])
  1055. }
  1056. ,
  1057. Keen.prototype.trackExternalLink = function(e, t, n, r, i) {
  1058. var o = e
  1059. , a = o.metaKey
  1060. , c = o.target
  1061. , s = !1
  1062. , l = function() {};
  1063. return void 0 === r && (r = 500),
  1064. "A" === c.nodeName ? l = function() {
  1065. a || s || (s = !0,
  1066. window.location = c.href)
  1067. }
  1068. : "FORM" === c.nodeName && (l = function() {
  1069. s || (s = !0,
  1070. c.submit())
  1071. }
  1072. ),
  1073. i && (l = function() {
  1074. s || (s = !0,
  1075. i())
  1076. }
  1077. ),
  1078. _uploadEvent.call(this, t, n, l, l),
  1079. setTimeout(function() {
  1080. l()
  1081. }, r),
  1082. !!a && void 0
  1083. }
  1084. ,
  1085. Keen.prototype.setGlobalProperties = function(e) {
  1086. if (!this.client)
  1087. return Keen.log("Check out our JavaScript SDK Usage Guide: https://keen.io/docs/clients/javascript/usage-guide/");
  1088. if (!e || "function" != typeof e)
  1089. throw new Error("Invalid value for global properties: " + e);
  1090. this.client.globalProperties = e
  1091. }
  1092. ,
  1093. Keen.Base64 = {
  1094. map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
  1095. encode: function(e) {
  1096. var t, n, r, i, o, a, c, s = "", l = 0, u = this.map;
  1097. for (e = this.utf8.encode(e); l < e.length; )
  1098. t = e.charCodeAt(l++),
  1099. n = e.charCodeAt(l++),
  1100. r = e.charCodeAt(l++),
  1101. i = t >> 2,
  1102. o = (3 & t) << 4 | n >> 4,
  1103. a = isNaN(n) ? 64 : (15 & n) << 2 | r >> 6,
  1104. c = isNaN(n) || isNaN(r) ? 64 : 63 & r,
  1105. s = s + u.charAt(i) + u.charAt(o) + u.charAt(a) + u.charAt(c);
  1106. return s
  1107. },
  1108. decode: function(e) {
  1109. var t, n, r, i, o, a, c, s = "", l = 0, u = this.map, f = String.fromCharCode;
  1110. for (e = e.replace(/[^A-Za-z0-9\+\/\=]/g, ""); l < e.length; )
  1111. t = u.indexOf(e.charAt(l++)),
  1112. n = u.indexOf(e.charAt(l++)),
  1113. r = u.indexOf(e.charAt(l++)),
  1114. i = u.indexOf(e.charAt(l++)),
  1115. o = t << 2 | n >> 4,
  1116. a = (15 & n) << 4 | r >> 2,
  1117. c = (3 & r) << 6 | i,
  1118. s = s + (f(o) + (64 != r ? f(a) : "")) + (64 != i ? f(c) : "");
  1119. return this.utf8.decode(s)
  1120. },
  1121. utf8: {
  1122. encode: function(e) {
  1123. for (var t, n = "", r = 0, i = String.fromCharCode; r < e.length; )
  1124. t = e.charCodeAt(r++),
  1125. 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);
  1126. return n
  1127. },
  1128. decode: function(e) {
  1129. for (var t, n, r = "", i = 0, o = String.fromCharCode; i < e.length; )
  1130. n = e.charCodeAt(i),
  1131. 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];
  1132. return r
  1133. }
  1134. }
  1135. },
  1136. "object" != typeof JSON && (JSON = {}),
  1137. function() {
  1138. function f(e) {
  1139. return 10 > e ? "0" + e : e
  1140. }
  1141. function quote(e) {
  1142. return escapable.lastIndex = 0,
  1143. escapable.test(e) ? '"' + e.replace(escapable, function(e) {
  1144. var t = meta[e];
  1145. return "string" == typeof t ? t : "\\u" + ("0000" + e.charCodeAt(0).toString(16)).slice(-4)
  1146. }) + '"' : '"' + e + '"'
  1147. }
  1148. function str(e, t) {
  1149. var n, r, i, o, a, c = gap, s = t[e];
  1150. switch (s && "object" == typeof s && "function" == typeof s.toJSON && (s = s.toJSON(e)),
  1151. "function" == typeof rep && (s = rep.call(t, e, s)),
  1152. typeof s) {
  1153. case "string":
  1154. return quote(s);
  1155. case "number":
  1156. return isFinite(s) ? String(s) : "null";
  1157. case "boolean":
  1158. case "null":
  1159. return String(s);
  1160. case "object":
  1161. if (!s)
  1162. return "null";
  1163. if (gap += indent,
  1164. a = [],
  1165. "[object Array]" === Object.prototype.toString.apply(s)) {
  1166. for (o = s.length,
  1167. n = 0; o > n; n += 1)
  1168. a[n] = str(n, s) || "null";
  1169. return i = 0 === a.length ? "[]" : gap ? "[\n" + gap + a.join(",\n" + gap) + "\n" + c + "]" : "[" + a.join(",") + "]",
  1170. gap = c,
  1171. i
  1172. }
  1173. if (rep && "object" == typeof rep)
  1174. for (o = rep.length,
  1175. n = 0; o > n; n += 1)
  1176. "string" == typeof rep[n] && (r = rep[n],
  1177. i = str(r, s),
  1178. i && a.push(quote(r) + (gap ? ": " : ":") + i));
  1179. else
  1180. for (r in s)
  1181. Object.prototype.hasOwnProperty.call(s, r) && (i = str(r, s),
  1182. i && a.push(quote(r) + (gap ? ": " : ":") + i));
  1183. return i = 0 === a.length ? "{}" : gap ? "{\n" + gap + a.join(",\n" + gap) + "\n" + c + "}" : "{" + a.join(",") + "}",
  1184. gap = c,
  1185. i
  1186. }
  1187. }
  1188. "function" != typeof Date.prototype.toJSON && (Date.prototype.toJSON = function() {
  1189. 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
  1190. }
  1191. ,
  1192. String.prototype.toJSON = Number.prototype.toJSON = Boolean.prototype.toJSON = function() {
  1193. return this.valueOf()
  1194. }
  1195. );
  1196. 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 = {
  1197. "\b": "\\b",
  1198. "\t": "\\t",
  1199. "\n": "\\n",
  1200. "\f": "\\f",
  1201. "\r": "\\r",
  1202. '"': '\\"',
  1203. "\\": "\\\\"
  1204. }, rep;
  1205. "function" != typeof JSON.stringify && (JSON.stringify = function(e, t, n) {
  1206. var r;
  1207. if (gap = "",
  1208. indent = "",
  1209. "number" == typeof n)
  1210. for (r = 0; n > r; r += 1)
  1211. indent += " ";
  1212. else
  1213. "string" == typeof n && (indent = n);
  1214. if (rep = t,
  1215. t && "function" != typeof t && ("object" != typeof t || "number" != typeof t.length))
  1216. throw new Error("JSON.stringify");
  1217. return str("", {
  1218. "": e
  1219. })
  1220. }
  1221. ),
  1222. "function" != typeof JSON.parse && (JSON.parse = function(text, reviver) {
  1223. function walk(e, t) {
  1224. var n, r, i = e[t];
  1225. if (i && "object" == typeof i)
  1226. for (n in i)
  1227. Object.prototype.hasOwnProperty.call(i, n) && (r = walk(i, n),
  1228. void 0 !== r ? i[n] = r : delete i[n]);
  1229. return reviver.call(e, t, i)
  1230. }
  1231. var j;
  1232. if (text = String(text),
  1233. cx.lastIndex = 0,
  1234. cx.test(text) && (text = text.replace(cx, function(e) {
  1235. return "\\u" + ("0000" + e.charCodeAt(0).toString(16)).slice(-4)
  1236. })),
  1237. /^[\],:{}\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, "")))
  1238. return j = eval("(" + text + ")"),
  1239. "function" == typeof reviver ? walk({
  1240. "": j
  1241. }, "") : j;
  1242. throw new SyntaxError("JSON.parse")
  1243. }
  1244. )
  1245. }(),
  1246. !function(e, t, n) {
  1247. "undefined" != typeof module && module.exports ? module.exports = n() : "function" == typeof define && define.amd ? define(n) : t[e] = n()
  1248. }("domready", Keen.utils, function(e) {
  1249. function t(e) {
  1250. for (d = 1; e = r.shift(); )
  1251. e()
  1252. }
  1253. 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]);
  1254. return o[l] && o[l](s, n = function() {
  1255. o.removeEventListener(s, n, i),
  1256. t()
  1257. }
  1258. , i),
  1259. c && o.attachEvent(u, n = function() {
  1260. /^c/.test(o[f]) && (o.detachEvent(u, n),
  1261. t())
  1262. }
  1263. ),
  1264. e = c ? function(t) {
  1265. self != top ? d ? t() : r.push(t) : function() {
  1266. try {
  1267. a.doScroll("left")
  1268. } catch (n) {
  1269. return setTimeout(function() {
  1270. e(t)
  1271. }, 50)
  1272. }
  1273. t()
  1274. }()
  1275. }
  1276. : function(e) {
  1277. d ? e() : r.push(e)
  1278. }
  1279. });
  1280. var loaded = window.Keen, cached = window._Keen || {}, clients, ready;
  1281. if (loaded && cached) {
  1282. clients = cached.clients || {},
  1283. ready = cached.ready || [];
  1284. for (var instance in clients)
  1285. if (clients.hasOwnProperty(instance)) {
  1286. var client = clients[instance];
  1287. for (var method in Keen.prototype)
  1288. Keen.prototype.hasOwnProperty(method) && (loaded.prototype[method] = Keen.prototype[method]);
  1289. if (loaded.Query = Keen.Query ? Keen.Query : function() {}
  1290. ,
  1291. loaded.Visualization = Keen.Visualization ? Keen.Visualization : function() {}
  1292. ,
  1293. client._config && (client.configure.call(client, client._config),
  1294. delete client._config),
  1295. client._setGlobalProperties) {
  1296. for (var globals = client._setGlobalProperties, i = 0; i < globals.length; i++)
  1297. client.setGlobalProperties.apply(client, globals[i]);
  1298. delete client._setGlobalProperties
  1299. }
  1300. if (client._addEvent) {
  1301. for (var queue = client._addEvent || [], i = 0; i < queue.length; i++)
  1302. client.addEvent.apply(client, queue[i]);
  1303. delete client._addEvent
  1304. }
  1305. var callback = client._on || [];
  1306. if (client._on) {
  1307. for (var i = 0; i < callback.length; i++)
  1308. client.on.apply(client, callback[i]);
  1309. client.trigger("ready"),
  1310. delete client._on
  1311. }
  1312. }
  1313. for (var i = 0; i < ready.length; i++) {
  1314. var callback = ready[i];
  1315. Keen.on("ready", function() {
  1316. callback()
  1317. })
  1318. }
  1319. }
  1320. return Keen.loaded && setTimeout(function() {
  1321. Keen.utils.domready(function() {
  1322. Keen.trigger("ready")
  1323. })
  1324. }, 0),
  1325. Keen
  1326. });
  1327. !function() {
  1328. var t = window.analytics = window.analytics || [];
  1329. if (!t.initialize) {
  1330. if (t.invoked)
  1331. return void (window.console && console.error && console.error("Segment snippet included twice."));
  1332. t.invoked = !0,
  1333. t.methods = ["trackSubmit", "trackClick", "trackLink", "trackForm", "pageview", "identify", "reset", "group", "track", "ready", "alias", "debug", "page", "once", "off", "on"],
  1334. t.factory = function(e) {
  1335. return function() {
  1336. var n = Array.prototype.slice.call(arguments);
  1337. return n.unshift(e),
  1338. t.push(n),
  1339. t
  1340. }
  1341. }
  1342. ;
  1343. for (var e = 0; e < t.methods.length; e++) {
  1344. var n = t.methods[e];
  1345. t[n] = t.factory(n)
  1346. }
  1347. t.load = function(t) {
  1348. var e = document.createElement("script");
  1349. e.type = "text/javascript",
  1350. e.async = !0,
  1351. e.src = ("https:" === document.location.protocol ? "https://" : "http://") + "cdn.segment.com/analytics.js/v1/" + t + "/analytics.min.js";
  1352. var n = document.getElementsByTagName("script")[0];
  1353. n.parentNode.insertBefore(e, n)
  1354. }
  1355. ,
  1356. t.SNIPPET_VERSION = "4.0.0"
  1357. }
  1358. }();
  1359. !function(i, e) {
  1360. "use strict";
  1361. var s = ""
  1362. , r = "?"
  1363. , o = "function"
  1364. , a = "undefined"
  1365. , n = "object"
  1366. , t = "major"
  1367. , d = "model"
  1368. , w = "name"
  1369. , l = "type"
  1370. , p = "vendor"
  1371. , m = "version"
  1372. , c = "architecture"
  1373. , u = "console"
  1374. , g = "mobile"
  1375. , f = "tablet"
  1376. , h = "smarttv"
  1377. , b = {
  1378. has: function(i, e) {
  1379. return e.toLowerCase().indexOf(i.toLowerCase()) !== -1
  1380. },
  1381. lowerize: function(i) {
  1382. return i.toLowerCase()
  1383. }
  1384. }
  1385. , y = {
  1386. rgx: function() {
  1387. for (var i, s, r, t, d, w, l, p = 0, m = arguments; p < m.length; p += 2) {
  1388. var c = m[p]
  1389. , u = m[p + 1];
  1390. if (typeof i === a) {
  1391. i = {};
  1392. for (t in u)
  1393. d = u[t],
  1394. typeof d === n ? i[d[0]] = e : i[d] = e
  1395. }
  1396. for (s = r = 0; s < c.length; s++)
  1397. if (w = c[s].exec(this.getUA())) {
  1398. for (t = 0; t < u.length; t++)
  1399. l = w[++r],
  1400. d = u[t],
  1401. 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;
  1402. break
  1403. }
  1404. if (w)
  1405. break
  1406. }
  1407. return i
  1408. },
  1409. str: function(i, s) {
  1410. for (var o in s)
  1411. if (typeof s[o] === n && s[o].length > 0) {
  1412. for (var a = 0; a < s[o].length; a++)
  1413. if (b.has(s[o][a], i))
  1414. return o === r ? e : o
  1415. } else if (b.has(s[o], i))
  1416. return o === r ? e : o;
  1417. return i
  1418. }
  1419. }
  1420. , v = {
  1421. browser: {
  1422. oldsafari: {
  1423. major: {
  1424. 1: ["/8", "/1", "/3"],
  1425. 2: "/4",
  1426. "?": "/"
  1427. },
  1428. version: {
  1429. "1.0": "/8",
  1430. 1.2: "/1",
  1431. 1.3: "/3",
  1432. "2.0": "/412",
  1433. "2.0.2": "/416",
  1434. "2.0.3": "/417",
  1435. "2.0.4": "/419",
  1436. "?": "/"
  1437. }
  1438. }
  1439. },
  1440. device: {
  1441. sprint: {
  1442. model: {
  1443. "Evo Shift 4G": "7373KT"
  1444. },
  1445. vendor: {
  1446. HTC: "APA",
  1447. Sprint: "Sprint"
  1448. }
  1449. }
  1450. },
  1451. os: {
  1452. windows: {
  1453. version: {
  1454. ME: "4.90",
  1455. "NT 3.11": "NT3.51",
  1456. "NT 4.0": "NT4.0",
  1457. 2e3: "NT 5.0",
  1458. XP: ["NT 5.1", "NT 5.2"],
  1459. Vista: "NT 6.0",
  1460. 7: "NT 6.1",
  1461. 8: "NT 6.2",
  1462. 8.1: "NT 6.3",
  1463. RT: "ARM"
  1464. }
  1465. }
  1466. }
  1467. }
  1468. , k = {
  1469. 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]],
  1470. 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]],
  1471. 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]],
  1472. 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]],
  1473. 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]]
  1474. }
  1475. , x = function(e) {
  1476. var r = e || (i && i.navigator && i.navigator.userAgent ? i.navigator.userAgent : s);
  1477. return this instanceof x ? (this.getBrowser = function() {
  1478. return y.rgx.apply(this, k.browser)
  1479. }
  1480. ,
  1481. this.getCPU = function() {
  1482. return y.rgx.apply(this, k.cpu)
  1483. }
  1484. ,
  1485. this.getDevice = function() {
  1486. return y.rgx.apply(this, k.device)
  1487. }
  1488. ,
  1489. this.getEngine = function() {
  1490. return y.rgx.apply(this, k.engine)
  1491. }
  1492. ,
  1493. this.getOS = function() {
  1494. return y.rgx.apply(this, k.os)
  1495. }
  1496. ,
  1497. this.getResult = function() {
  1498. return {
  1499. ua: this.getUA(),
  1500. browser: this.getBrowser(),
  1501. engine: this.getEngine(),
  1502. os: this.getOS(),
  1503. device: this.getDevice(),
  1504. cpu: this.getCPU()
  1505. }
  1506. }
  1507. ,
  1508. this.getUA = function() {
  1509. return r
  1510. }
  1511. ,
  1512. this.setUA = function(i) {
  1513. return r = i,
  1514. this
  1515. }
  1516. ,
  1517. void this.setUA(r)) : new x(e).getResult()
  1518. };
  1519. if (typeof exports !== a)
  1520. typeof module !== a && module.exports && (exports = module.exports = x),
  1521. exports.UAParser = x;
  1522. else if (i.UAParser = x,
  1523. typeof define === o && define.amd && define(function() {
  1524. return x
  1525. }),
  1526. typeof i.jQuery !== a) {
  1527. var A = i.jQuery
  1528. , _ = new x;
  1529. A.ua = _.getResult(),
  1530. A.ua.get = function() {
  1531. return _.getUA()
  1532. }
  1533. ,
  1534. A.ua.set = function(i) {
  1535. _.setUA(i);
  1536. var e = _.getResult();
  1537. for (var s in e)
  1538. A.ua[s] = e[s]
  1539. }
  1540. }
  1541. }(this);
  1542. window.Modernizr = function(n, e, t) {
  1543. function o(n) {
  1544. d.cssText = n
  1545. }
  1546. function r(n, e) {
  1547. return typeof n === e
  1548. }
  1549. var i, c, u, a = "2.8.2", f = {}, s = e.documentElement, l = "modernizr", p = e.createElement(l), d = p.style, y = ({}.toString,
  1550. {}), w = [], b = w.slice, v = {}.hasOwnProperty;
  1551. u = r(v, "undefined") || r(v.call, "undefined") ? function(n, e) {
  1552. return e in n && r(n.constructor.prototype[e], "undefined")
  1553. }
  1554. : function(n, e) {
  1555. return v.call(n, e)
  1556. }
  1557. ,
  1558. Function.prototype.bind || (Function.prototype.bind = function(n) {
  1559. var e = this;
  1560. if ("function" != typeof e)
  1561. throw new TypeError;
  1562. var t = b.call(arguments, 1)
  1563. , o = function() {
  1564. if (this instanceof o) {
  1565. var r = function() {};
  1566. r.prototype = e.prototype;
  1567. var i = new r
  1568. , c = e.apply(i, t.concat(b.call(arguments)));
  1569. return Object(c) === c ? c : i
  1570. }
  1571. return e.apply(n, t.concat(b.call(arguments)))
  1572. };
  1573. return o
  1574. }
  1575. ),
  1576. y.webgl = function() {
  1577. return !!n.WebGLRenderingContext
  1578. }
  1579. ;
  1580. for (var h in y)
  1581. u(y, h) && (c = h.toLowerCase(),
  1582. f[c] = y[h](),
  1583. w.push((f[c] ? "" : "no-") + c));
  1584. return f.addTest = function(n, e) {
  1585. if ("object" == typeof n)
  1586. for (var o in n)
  1587. u(n, o) && f.addTest(o, n[o]);
  1588. else {
  1589. if (n = n.toLowerCase(),
  1590. f[n] !== t)
  1591. return f;
  1592. e = "function" == typeof e ? e() : e,
  1593. "undefined" != typeof enableClasses && enableClasses && (s.className += " " + (e ? "" : "no-") + n),
  1594. f[n] = e
  1595. }
  1596. return f
  1597. }
  1598. ,
  1599. o(""),
  1600. p = i = null,
  1601. f._version = a,
  1602. f
  1603. }(this, this.document);
  1604. !function(e, t, a) {
  1605. "use strict";
  1606. function n(t, h, m) {
  1607. function H(a) {
  1608. var n = 0
  1609. , i = Ee.length;
  1610. if (Ce.old = e.extend({}, Ce),
  1611. Ie = we ? 0 : be[ge.horizontal ? "width" : "height"](),
  1612. ke = Be[ge.horizontal ? "width" : "height"](),
  1613. ze = we ? t : Pe[ge.horizontal ? "outerWidth" : "outerHeight"](),
  1614. Ee.length = 0,
  1615. Ce.start = 0,
  1616. Ce.end = q(ze - Ie, 0),
  1617. Re) {
  1618. n = Ne.length,
  1619. qe = Pe.children(ge.itemSelector),
  1620. Ne.length = 0;
  1621. 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;
  1622. ze = 0,
  1623. qe.each(function(t, a) {
  1624. var n = e(a)
  1625. , i = a.getBoundingClientRect()
  1626. , l = E(ge.horizontal ? i.width || i.right - i.left : i.height || i.bottom - i.top)
  1627. , d = c(n, ge.horizontal ? "marginLeft" : "marginTop")
  1628. , p = c(n, ge.horizontal ? "marginRight" : "marginBottom")
  1629. , h = l + d + p
  1630. , m = !d || !p
  1631. , g = {};
  1632. g.el = a,
  1633. g.size = m ? l : h,
  1634. g.half = g.size / 2,
  1635. g.start = ze + (m ? d : 0),
  1636. g.center = g.start - E(Ie / 2 - g.size / 2),
  1637. g.end = g.start - Ie + g.size,
  1638. t || (ze += s),
  1639. ze += h,
  1640. ge.horizontal || u || p && d && t > 0 && (ze -= N(d, p)),
  1641. t === v && (g.end += o,
  1642. ze += o,
  1643. f = m ? p : 0),
  1644. Ne.push(g),
  1645. r = g
  1646. }),
  1647. Pe[0].style[ge.horizontal ? "width" : "height"] = (l ? ze : ze - s - o) + "px",
  1648. ze -= f,
  1649. Ne.length ? (Ce.start = Ne[0][Me ? "center" : "start"],
  1650. Ce.end = Me ? r.center : ze > Ie ? r.end : Ce.start) : Ce.start = Ce.end = 0
  1651. }
  1652. if (Ce.center = E(Ce.end / 2 + Ce.start / 2),
  1653. Q(),
  1654. Se.length && ke > 0 && (ge.dynamicHandle ? (Te = Ce.start === Ce.end ? ke : E(ke * Ie / ze),
  1655. Te = d(Te, ge.minHandleSize, ke),
  1656. Se[0].style[ge.horizontal ? "width" : "height"] = Te + "px") : Te = Se[ge.horizontal ? "outerWidth" : "outerHeight"](),
  1657. xe.end = ke - Te,
  1658. it || j()),
  1659. !we && Ie > 0) {
  1660. var p = Ce.start
  1661. , h = "";
  1662. if (Re)
  1663. e.each(Ne, function(e, t) {
  1664. Me ? Ee.push(t.center) : t.start + t.size > p && p <= Ce.end && (p = t.start,
  1665. Ee.push(p),
  1666. p += Ie,
  1667. p > Ce.end && p < Ce.end + Ie && Ee.push(Ce.end))
  1668. });
  1669. else
  1670. for (; p - Ie < Ce.end; )
  1671. Ee.push(p),
  1672. p += Ie;
  1673. if (De[0] && i !== Ee.length) {
  1674. for (var m = 0; m < Ee.length; m++)
  1675. h += ge.pageBuilder.call(ye, m);
  1676. Ae = De.html(h).children(),
  1677. Ae.eq(Oe.activePage).addClass(ge.activeClass)
  1678. }
  1679. }
  1680. if (Oe.slideeSize = ze,
  1681. Oe.frameSize = Ie,
  1682. Oe.sbSize = ke,
  1683. Oe.handleSize = Te,
  1684. Re) {
  1685. a && null != ge.startAt && (W(ge.startAt),
  1686. ye[Le ? "toCenter" : "toStart"](ge.startAt));
  1687. var g = Ne[Oe.activeItem];
  1688. X(Le && g ? g.center : d(Ce.dest, Ce.start, Ce.end))
  1689. } else
  1690. a ? null != ge.startAt && X(ge.startAt, 1) : X(d(Ce.dest, Ce.start, Ce.end));
  1691. pe("load")
  1692. }
  1693. function X(e, t, a) {
  1694. if (Re && at.released && !a) {
  1695. var n = $(e)
  1696. , i = e > Ce.start && e < Ce.end;
  1697. Le ? (i && (e = Ne[n.centerItem].center),
  1698. Me && ge.activateMiddle && W(n.centerItem)) : i && (e = Ne[n.firstItem].start)
  1699. }
  1700. 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),
  1701. et.start = +new Date,
  1702. et.time = 0,
  1703. et.from = Ce.cur,
  1704. et.to = e,
  1705. et.delta = e - Ce.cur,
  1706. et.tweesing = at.tweese || at.init && !at.slidee,
  1707. et.immediate = !et.tweesing && (t || at.init && at.slidee || !ge.speed),
  1708. at.tweese = 0,
  1709. e !== Ce.dest && (Ce.dest = e,
  1710. pe("change"),
  1711. it || Y()),
  1712. K(),
  1713. Q(),
  1714. Z(),
  1715. F()
  1716. }
  1717. function Y() {
  1718. if (ye.initialized) {
  1719. if (!it)
  1720. return it = w(Y),
  1721. void (at.released && pe("moveStart"));
  1722. et.immediate ? Ce.cur = et.to : et.tweesing ? (et.tweeseDelta = et.to - Ce.cur,
  1723. 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),
  1724. Ce.cur = et.from + et.delta * e.easing[ge.easing](et.time / ge.speed, et.time, 0, 1, ge.speed)),
  1725. et.to === Ce.cur ? (Ce.cur = et.to,
  1726. at.tweese = it = 0) : it = w(Y),
  1727. pe("move"),
  1728. 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"),
  1729. !it && at.released && pe("moveEnd"),
  1730. j()
  1731. }
  1732. }
  1733. function j() {
  1734. 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,
  1735. xe.cur = d(E(xe.cur), xe.start, xe.end),
  1736. _e.hPos !== xe.cur && (_e.hPos = xe.cur,
  1737. f ? Se[0].style[f] = v + (ge.horizontal ? "translateX" : "translateY") + "(" + xe.cur + "px)" : Se[0].style[ge.horizontal ? "left" : "top"] = xe.cur + "px"))
  1738. }
  1739. function F() {
  1740. Ae[0] && _e.page !== Oe.activePage && (_e.page = Oe.activePage,
  1741. Ae.removeClass(ge.activeClass).eq(Oe.activePage).addClass(ge.activeClass),
  1742. pe("activePage", _e.page))
  1743. }
  1744. function M() {
  1745. tt.speed && Ce.cur !== (tt.speed > 0 ? Ce.end : Ce.start) || ye.stop(),
  1746. ot = at.init ? w(M) : 0,
  1747. tt.now = +new Date,
  1748. tt.pos = Ce.cur + (tt.now - tt.lastTime) / 1e3 * tt.speed,
  1749. X(at.init ? tt.pos : E(tt.pos)),
  1750. at.init || Ce.cur !== Ce.dest || pe("moveEnd"),
  1751. tt.lastTime = tt.now
  1752. }
  1753. function L(e, t, n) {
  1754. if ("boolean" === i(t) && (n = t,
  1755. t = a),
  1756. t === a)
  1757. X(Ce[e], n);
  1758. else {
  1759. if (Le && "center" !== e)
  1760. return;
  1761. var r = ye.getPos(t);
  1762. r && X(r[e], n, !Le)
  1763. }
  1764. }
  1765. function R(e) {
  1766. return null != e ? l(e) ? e >= 0 && e < Ne.length ? e : -1 : qe.index(e) : -1
  1767. }
  1768. function U(e) {
  1769. return R(l(e) && 0 > e ? e + Ne.length : e)
  1770. }
  1771. function W(e, t) {
  1772. var a = R(e);
  1773. return !(!Re || 0 > a) && ((_e.active !== a || t) && (qe.eq(Oe.activeItem).removeClass(ge.activeClass),
  1774. qe.eq(a).addClass(ge.activeClass),
  1775. _e.active = Oe.activeItem = a,
  1776. Z(),
  1777. pe("active", a)),
  1778. a)
  1779. }
  1780. function $(e) {
  1781. e = d(l(e) ? e : Ce.dest, Ce.start, Ce.end);
  1782. var t = {}
  1783. , a = Me ? 0 : Ie / 2;
  1784. if (!we)
  1785. for (var n = 0, i = Ee.length; i > n; n++) {
  1786. if (e >= Ce.end || n === Ee.length - 1) {
  1787. t.activePage = Ee.length - 1;
  1788. break
  1789. }
  1790. if (e <= Ee[n] + a) {
  1791. t.activePage = n;
  1792. break
  1793. }
  1794. }
  1795. if (Re) {
  1796. for (var r = !1, s = !1, o = !1, c = 0, u = Ne.length; u > c; c++)
  1797. if (r === !1 && e <= Ne[c].start + Ne[c].half && (r = c),
  1798. o === !1 && e <= Ne[c].center + Ne[c].half && (o = c),
  1799. c === u - 1 || e <= Ne[c].end + Ne[c].half) {
  1800. s = c;
  1801. break
  1802. }
  1803. t.firstItem = l(r) ? r : 0,
  1804. t.centerItem = l(o) ? o : t.firstItem,
  1805. t.lastItem = l(s) ? s : t.centerItem
  1806. }
  1807. return t
  1808. }
  1809. function Q(t) {
  1810. e.extend(Oe, $(t))
  1811. }
  1812. function Z() {
  1813. var e = Ce.dest <= Ce.start
  1814. , t = Ce.dest >= Ce.end
  1815. , a = (e ? 1 : 0) | (t ? 2 : 0);
  1816. if (_e.slideePosState !== a && (_e.slideePosState = a,
  1817. Je.is("button,input") && Je.prop("disabled", e),
  1818. Ke.is("button,input") && Ke.prop("disabled", t),
  1819. Je.add(Qe)[e ? "addClass" : "removeClass"](ge.disabledClass),
  1820. Ke.add($e)[t ? "addClass" : "removeClass"](ge.disabledClass)),
  1821. _e.fwdbwdState !== a && at.released && (_e.fwdbwdState = a,
  1822. Qe.is("button,input") && Qe.prop("disabled", e),
  1823. $e.is("button,input") && $e.prop("disabled", t)),
  1824. Re && null != Oe.activeItem) {
  1825. var n = 0 === Oe.activeItem
  1826. , i = Oe.activeItem >= Ne.length - 1
  1827. , r = (n ? 1 : 0) | (i ? 2 : 0);
  1828. _e.itemsButtonState !== r && (_e.itemsButtonState = r,
  1829. Ze.is("button,input") && Ze.prop("disabled", n),
  1830. Ge.is("button,input") && Ge.prop("disabled", i),
  1831. Ze[n ? "addClass" : "removeClass"](ge.disabledClass),
  1832. Ge[i ? "addClass" : "removeClass"](ge.disabledClass))
  1833. }
  1834. }
  1835. function G(e, t, a) {
  1836. if (e = U(e),
  1837. t = U(t),
  1838. e > -1 && t > -1 && e !== t && (!a || t !== e - 1) && (a || t !== e + 1)) {
  1839. qe.eq(e)[a ? "insertAfter" : "insertBefore"](Ne[t].el);
  1840. var n = t > e ? e : a ? t : t - 1
  1841. , i = e > t ? e : a ? t + 1 : t
  1842. , r = e > t;
  1843. 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)),
  1844. H()
  1845. }
  1846. }
  1847. function J(e, t) {
  1848. for (var a = 0, n = Ve[e].length; n > a; a++)
  1849. if (Ve[e][a] === t)
  1850. return a;
  1851. return -1
  1852. }
  1853. function K() {
  1854. at.released && !ye.isPaused && ye.resume()
  1855. }
  1856. function V(e) {
  1857. return E(d(e, xe.start, xe.end) / xe.end * (Ce.end - Ce.start)) + Ce.start
  1858. }
  1859. function _() {
  1860. at.history[0] = at.history[1],
  1861. at.history[1] = at.history[2],
  1862. at.history[2] = at.history[3],
  1863. at.history[3] = at.delta
  1864. }
  1865. function ee(e) {
  1866. at.released = 0,
  1867. at.source = e,
  1868. at.slidee = "slidee" === e
  1869. }
  1870. function te(t) {
  1871. var a = "touchstart" === t.type
  1872. , n = t.data.source
  1873. , i = "slidee" === n;
  1874. 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),
  1875. ee(n),
  1876. at.init = 0,
  1877. at.$source = e(t.target),
  1878. at.touch = a,
  1879. at.pointer = a ? t.originalEvent.touches[0] : t,
  1880. at.initX = at.pointer.pageX,
  1881. at.initY = at.pointer.pageY,
  1882. at.initPos = i ? Ce.cur : xe.cur,
  1883. at.start = +new Date,
  1884. at.time = 0,
  1885. at.path = 0,
  1886. at.delta = 0,
  1887. at.locked = 0,
  1888. at.history = [0, 0, 0, 0],
  1889. at.pathToLock = i ? a ? 30 : 10 : 0,
  1890. b.on(a ? z : I, ae),
  1891. ye.pause(1),
  1892. (i ? Pe : Se).addClass(ge.draggedClass),
  1893. pe("moveStart"),
  1894. i && (rt = setInterval(_, 10)))
  1895. }
  1896. function ae(e) {
  1897. if (at.released = "mouseup" === e.type || "touchend" === e.type,
  1898. at.pointer = at.touch ? e.originalEvent[at.released ? "changedTouches" : "touches"][0] : e,
  1899. at.pathX = at.pointer.pageX - at.initX,
  1900. at.pathY = at.pointer.pageY - at.initY,
  1901. at.path = D(A(at.pathX, 2) + A(at.pathY, 2)),
  1902. at.delta = ge.horizontal ? at.pathX : at.pathY,
  1903. at.released || !(at.path < 1)) {
  1904. if (!at.init) {
  1905. if (!(ge.horizontal ? x(at.pathX) > x(at.pathY) : x(at.pathX) < x(at.pathY)))
  1906. return ne();
  1907. at.init = 1
  1908. }
  1909. r(e),
  1910. !at.locked && at.path > at.pathToLock && at.slidee && (at.locked = 1,
  1911. at.$source.on(B, s)),
  1912. at.released && (ne(),
  1913. ge.releaseSwing && at.slidee && (at.swing = (at.delta - at.history[0]) / 40 * 300,
  1914. at.delta += at.swing,
  1915. at.tweese = x(at.swing) > 10)),
  1916. X(at.slidee ? E(at.initPos - at.delta) : V(at.initPos + at.delta))
  1917. }
  1918. }
  1919. function ne() {
  1920. clearInterval(rt),
  1921. at.released = !0,
  1922. b.off(at.touch ? z : I, ae),
  1923. (at.slidee ? Pe : Se).removeClass(ge.draggedClass),
  1924. setTimeout(function() {
  1925. at.$source.off(B, s)
  1926. }),
  1927. Ce.cur === Ce.dest && at.init && pe("moveEnd"),
  1928. ye.resume(1),
  1929. at.init = 0
  1930. }
  1931. function ie(t) {
  1932. return ~e.inArray(t.nodeName, k) || e(t).is(ge.interactive)
  1933. }
  1934. function re() {
  1935. ye.stop(),
  1936. b.off("mouseup", re)
  1937. }
  1938. function se(e) {
  1939. switch (r(e),
  1940. this) {
  1941. case $e[0]:
  1942. case Qe[0]:
  1943. ye.moveBy($e.is(this) ? ge.moveBy : -ge.moveBy),
  1944. b.on("mouseup", re);
  1945. break;
  1946. case Ze[0]:
  1947. ye.prev();
  1948. break;
  1949. case Ge[0]:
  1950. ye.next();
  1951. break;
  1952. case Je[0]:
  1953. ye.prevPage();
  1954. break;
  1955. case Ke[0]:
  1956. ye.nextPage()
  1957. }
  1958. }
  1959. function oe(e) {
  1960. return nt.curDelta = (ge.horizontal ? e.deltaY || e.deltaX : e.deltaY) || -e.wheelDelta,
  1961. nt.curDelta /= 1 === e.deltaMode ? 3 : 100,
  1962. Re ? (p = +new Date,
  1963. nt.last < p - nt.resetTime && (nt.delta = 0),
  1964. nt.last = p,
  1965. nt.delta += nt.curDelta,
  1966. x(nt.delta) < 1 ? nt.finalDelta = 0 : (nt.finalDelta = E(nt.delta / 1),
  1967. nt.delta %= 1),
  1968. nt.finalDelta) : nt.curDelta
  1969. }
  1970. function le(e) {
  1971. e.originalEvent[g] = ye;
  1972. var t = +new Date;
  1973. if (O + ge.scrollHijack > t && Ue[0] !== document && Ue[0] !== window)
  1974. return void (O = t);
  1975. if (ge.scrollBy && Ce.start !== Ce.end) {
  1976. var a = oe(e.originalEvent);
  1977. (ge.scrollTrap || a > 0 && Ce.dest < Ce.end || 0 > a && Ce.dest > Ce.start) && r(e, 1),
  1978. ye.slideBy(ge.scrollBy * a)
  1979. }
  1980. }
  1981. function ce(e) {
  1982. ge.clickBar && e.target === Be[0] && (r(e),
  1983. X(V((ge.horizontal ? e.pageX - Be.offset().left : e.pageY - Be.offset().top) - Te / 2)))
  1984. }
  1985. function de(e) {
  1986. if (ge.keyboardNavBy)
  1987. switch (e.which) {
  1988. case ge.horizontal ? 37 : 38:
  1989. r(e),
  1990. ye["pages" === ge.keyboardNavBy ? "prevPage" : "prev"]();
  1991. break;
  1992. case ge.horizontal ? 39 : 40:
  1993. r(e),
  1994. ye["pages" === ge.keyboardNavBy ? "nextPage" : "next"]()
  1995. }
  1996. }
  1997. function ue(e) {
  1998. return ie(this) ? void (e.originalEvent[g + "ignore"] = !0) : void (this.parentNode !== Pe[0] || e.originalEvent[g + "ignore"] || ye.activate(this))
  1999. }
  2000. function fe() {
  2001. this.parentNode === De[0] && ye.activatePage(Ae.index(this))
  2002. }
  2003. function ve(e) {
  2004. ge.pauseOnHover && ye["mouseenter" === e.type ? "pause" : "resume"](2)
  2005. }
  2006. function pe(e, t) {
  2007. if (Ve[e]) {
  2008. for (me = Ve[e].length,
  2009. T.length = 0,
  2010. he = 0; me > he; he++)
  2011. T.push(Ve[e][he]);
  2012. for (he = 0; me > he; he++)
  2013. T[he].call(ye, e, t)
  2014. }
  2015. }
  2016. 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 = {
  2017. start: 0,
  2018. center: 0,
  2019. end: 0,
  2020. cur: 0,
  2021. dest: 0
  2022. }, Be = e(ge.scrollBar).eq(0), Se = Be.children().eq(0), ke = 0, Te = 0, xe = {
  2023. start: 0,
  2024. end: 0,
  2025. cur: 0
  2026. }, De = e(ge.pagesBar), Ae = 0, Ee = [], qe = 0, Ne = [], Oe = {
  2027. firstItem: 0,
  2028. lastItem: 0,
  2029. centerItem: 0,
  2030. activeItem: null,
  2031. activePage: 0
  2032. }, 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 = {
  2033. released: 1
  2034. }, nt = {
  2035. last: 0,
  2036. delta: 0,
  2037. resetTime: 200
  2038. }, it = 0, rt = 0, st = 0, ot = 0;
  2039. we || (t = be[0]),
  2040. ye.initialized = 0,
  2041. ye.frame = t,
  2042. ye.slidee = Pe[0],
  2043. ye.pos = Ce,
  2044. ye.rel = Oe,
  2045. ye.items = Ne,
  2046. ye.pages = Ee,
  2047. ye.isPaused = 0,
  2048. ye.options = ge,
  2049. ye.dragging = at,
  2050. ye.reload = function() {
  2051. H()
  2052. }
  2053. ,
  2054. ye.getPos = function(e) {
  2055. if (Re) {
  2056. var t = R(e);
  2057. return -1 !== t && Ne[t]
  2058. }
  2059. var a = Pe.find(e).eq(0);
  2060. if (a[0]) {
  2061. var n = ge.horizontal ? a.offset().left - Pe.offset().left : a.offset().top - Pe.offset().top
  2062. , i = a[ge.horizontal ? "outerWidth" : "outerHeight"]();
  2063. return {
  2064. start: n,
  2065. center: n - Ie / 2 + i / 2,
  2066. end: n - Ie + i,
  2067. size: i
  2068. }
  2069. }
  2070. return !1
  2071. }
  2072. ,
  2073. ye.moveBy = function(e) {
  2074. tt.speed = e,
  2075. !at.init && tt.speed && Ce.cur !== (tt.speed > 0 ? Ce.end : Ce.start) && (tt.lastTime = +new Date,
  2076. tt.startPos = Ce.cur,
  2077. ee("button"),
  2078. at.init = 1,
  2079. pe("moveStart"),
  2080. y(ot),
  2081. M())
  2082. }
  2083. ,
  2084. ye.stop = function() {
  2085. "button" === at.source && (at.init = 0,
  2086. at.released = 1)
  2087. }
  2088. ,
  2089. ye.prev = function() {
  2090. ye.activate(null == Oe.activeItem ? 0 : Oe.activeItem - 1)
  2091. }
  2092. ,
  2093. ye.next = function() {
  2094. ye.activate(null == Oe.activeItem ? 0 : Oe.activeItem + 1)
  2095. }
  2096. ,
  2097. ye.prevPage = function() {
  2098. ye.activatePage(Oe.activePage - 1)
  2099. }
  2100. ,
  2101. ye.nextPage = function() {
  2102. ye.activatePage(Oe.activePage + 1)
  2103. }
  2104. ,
  2105. ye.slideBy = function(e, t) {
  2106. e && (Re ? ye[Le ? "toCenter" : "toStart"](d((Le ? Oe.centerItem : Oe.firstItem) + ge.scrollBy * e, 0, Ne.length)) : X(Ce.dest + e, t))
  2107. }
  2108. ,
  2109. ye.slideTo = function(e, t) {
  2110. X(e, t)
  2111. }
  2112. ,
  2113. ye.toStart = function(e, t) {
  2114. L("start", e, t)
  2115. }
  2116. ,
  2117. ye.toEnd = function(e, t) {
  2118. L("end", e, t)
  2119. }
  2120. ,
  2121. ye.toCenter = function(e, t) {
  2122. L("center", e, t)
  2123. }
  2124. ,
  2125. ye.getIndex = R,
  2126. ye.activate = function(e, t) {
  2127. var a = W(e);
  2128. ge.smart && a !== !1 && (Le ? ye.toCenter(a, t) : a >= Oe.lastItem ? ye.toStart(a, t) : a <= Oe.firstItem ? ye.toEnd(a, t) : K())
  2129. }
  2130. ,
  2131. ye.activatePage = function(e, t) {
  2132. l(e) && X(Ee[d(e, 0, Ee.length - 1)], t)
  2133. }
  2134. ,
  2135. ye.resume = function(e) {
  2136. ge.cycleBy && ge.cycleInterval && ("items" !== ge.cycleBy || Ne[0] && null != Oe.activeItem) && !(e < ye.isPaused) && (ye.isPaused = 0,
  2137. st ? st = clearTimeout(st) : pe("resume"),
  2138. st = setTimeout(function() {
  2139. switch (pe("cycle"),
  2140. ge.cycleBy) {
  2141. case "items":
  2142. ye.activate(Oe.activeItem >= Ne.length - 1 ? 0 : Oe.activeItem + 1);
  2143. break;
  2144. case "pages":
  2145. ye.activatePage(Oe.activePage >= Ee.length - 1 ? 0 : Oe.activePage + 1)
  2146. }
  2147. }, ge.cycleInterval))
  2148. }
  2149. ,
  2150. ye.pause = function(e) {
  2151. e < ye.isPaused || (ye.isPaused = e || 100,
  2152. st && (st = clearTimeout(st),
  2153. pe("pause")))
  2154. }
  2155. ,
  2156. ye.toggle = function() {
  2157. ye[st ? "pause" : "resume"]()
  2158. }
  2159. ,
  2160. ye.set = function(t, a) {
  2161. e.isPlainObject(t) ? e.extend(ge, t) : ge.hasOwnProperty(t) && (ge[t] = a)
  2162. }
  2163. ,
  2164. ye.add = function(t, a) {
  2165. var n = e(t);
  2166. Re ? (null == a || !Ne[0] || a >= Ne.length ? n.appendTo(Pe) : Ne.length && n.insertBefore(Ne[a].el),
  2167. null != Oe.activeItem && a <= Oe.activeItem && (_e.active = Oe.activeItem += n.length)) : Pe.append(n),
  2168. H()
  2169. }
  2170. ,
  2171. ye.remove = function(t) {
  2172. if (Re) {
  2173. var a = U(t);
  2174. if (a > -1) {
  2175. qe.eq(a).remove();
  2176. var n = a === Oe.activeItem;
  2177. null != Oe.activeItem && a < Oe.activeItem && (_e.active = --Oe.activeItem),
  2178. H(),
  2179. n && (_e.active = null,
  2180. ye.activate(Oe.activeItem))
  2181. }
  2182. } else
  2183. e(t).remove(),
  2184. H()
  2185. }
  2186. ,
  2187. ye.moveAfter = function(e, t) {
  2188. G(e, t, 1)
  2189. }
  2190. ,
  2191. ye.moveBefore = function(e, t) {
  2192. G(e, t)
  2193. }
  2194. ,
  2195. ye.on = function(e, t) {
  2196. if ("object" === i(e))
  2197. for (var a in e)
  2198. e.hasOwnProperty(a) && ye.on(a, e[a]);
  2199. else if ("function" === i(t))
  2200. for (var n = e.split(" "), r = 0, s = n.length; s > r; r++)
  2201. Ve[n[r]] = Ve[n[r]] || [],
  2202. -1 === J(n[r], t) && Ve[n[r]].push(t);
  2203. else if ("array" === i(t))
  2204. for (var o = 0, l = t.length; l > o; o++)
  2205. ye.on(e, t[o])
  2206. }
  2207. ,
  2208. ye.one = function(e, t) {
  2209. function a() {
  2210. t.apply(ye, arguments),
  2211. ye.off(e, a)
  2212. }
  2213. ye.on(e, a)
  2214. }
  2215. ,
  2216. ye.off = function(e, t) {
  2217. if (t instanceof Array)
  2218. for (var a = 0, n = t.length; n > a; a++)
  2219. ye.off(e, t[a]);
  2220. else
  2221. for (var i = e.split(" "), r = 0, s = i.length; s > r; r++)
  2222. if (Ve[i[r]] = Ve[i[r]] || [],
  2223. null == t)
  2224. Ve[i[r]].length = 0;
  2225. else {
  2226. var o = J(i[r], t);
  2227. -1 !== o && Ve[i[r]].splice(o, 1)
  2228. }
  2229. }
  2230. ,
  2231. ye.destroy = function() {
  2232. return Ue.add(Se).add(Be).add(De).add($e).add(Qe).add(Ze).add(Ge).add(Je).add(Ke).off("." + g),
  2233. b.off("keydown", de),
  2234. Ze.add(Ge).add(Je).add(Ke).removeClass(ge.disabledClass),
  2235. qe && null != Oe.activeItem && qe.eq(Oe.activeItem).removeClass(ge.activeClass),
  2236. De.empty(),
  2237. we || (be.off("." + g),
  2238. He.restore(),
  2239. Xe.restore(),
  2240. Ye.restore(),
  2241. je.restore(),
  2242. e.removeData(t, g)),
  2243. Ne.length = Ee.length = 0,
  2244. _e = {},
  2245. ye.initialized = 0,
  2246. ye
  2247. }
  2248. ,
  2249. ye.init = function() {
  2250. if (!ye.initialized) {
  2251. ye.on(m);
  2252. var e = ["overflow", "position"]
  2253. , t = ["position", "webkitTransform", "msTransform", "transform", "left", "top", "width", "height"];
  2254. He.save.apply(He, e),
  2255. Ye.save.apply(Ye, e),
  2256. Xe.save.apply(Xe, t),
  2257. je.save.apply(je, t);
  2258. var a = Se;
  2259. return we || (a = a.add(Pe),
  2260. be.css("overflow", "hidden"),
  2261. f || "static" !== be.css("position") || be.css("position", "relative")),
  2262. f ? v && a.css(f, v) : ("static" === Be.css("position") && Be.css("position", "relative"),
  2263. a.css({
  2264. position: "absolute"
  2265. })),
  2266. ge.forward && $e.on(S, se),
  2267. ge.backward && Qe.on(S, se),
  2268. ge.prev && Ze.on(B, se),
  2269. ge.next && Ge.on(B, se),
  2270. ge.prevPage && Je.on(B, se),
  2271. ge.nextPage && Ke.on(B, se),
  2272. Ue.on(C, le),
  2273. Be[0] && Be.on(B, ce),
  2274. Re && ge.activateOn && be.on(ge.activateOn + "." + g, "*", ue),
  2275. De[0] && ge.activatePageOn && De.on(ge.activatePageOn + "." + g, "*", fe),
  2276. We.on(P, {
  2277. source: "slidee"
  2278. }, te),
  2279. Se && Se.on(P, {
  2280. source: "handle"
  2281. }, te),
  2282. b.on("keydown", de),
  2283. we || (be.on("mouseenter." + g + " mouseleave." + g, ve),
  2284. be.on("scroll." + g, o)),
  2285. ye.initialized = 1,
  2286. H(!0),
  2287. ge.cycleBy && !we && ye[ge.startPaused ? "pause" : "resume"](),
  2288. ye
  2289. }
  2290. }
  2291. }
  2292. function i(e) {
  2293. 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
  2294. }
  2295. function r(e, t) {
  2296. e.preventDefault(),
  2297. t && e.stopPropagation()
  2298. }
  2299. function s(t) {
  2300. r(t, 1),
  2301. e(this).off(t.type, s)
  2302. }
  2303. function o() {
  2304. this.scrollLeft = 0,
  2305. this.scrollTop = 0
  2306. }
  2307. function l(e) {
  2308. return !isNaN(parseFloat(e)) && isFinite(e)
  2309. }
  2310. function c(e, t) {
  2311. return 0 | E(String(e.css(t)).replace(/[^\-0-9.]/g, ""))
  2312. }
  2313. function d(e, t, a) {
  2314. return t > e ? t : e > a ? a : e
  2315. }
  2316. function u(e) {
  2317. var t = {};
  2318. return t.style = {},
  2319. t.save = function() {
  2320. if (e && e.nodeType) {
  2321. for (var a = 0; a < arguments.length; a++)
  2322. t.style[arguments[a]] = e.style[arguments[a]];
  2323. return t
  2324. }
  2325. }
  2326. ,
  2327. t.restore = function() {
  2328. if (e && e.nodeType) {
  2329. for (var a in t.style)
  2330. t.style.hasOwnProperty(a) && (e.style[a] = t.style[a]);
  2331. return t
  2332. }
  2333. }
  2334. ,
  2335. t
  2336. }
  2337. 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;
  2338. b.on(C, function(e) {
  2339. var t = e.originalEvent[g]
  2340. , a = +new Date;
  2341. (!t || t.options.scrollHijack < a - O) && (O = a)
  2342. }),
  2343. function(e) {
  2344. function t(e) {
  2345. var t = (new Date).getTime()
  2346. , n = Math.max(0, 16 - (t - a))
  2347. , i = setTimeout(e, n);
  2348. return a = t,
  2349. i
  2350. }
  2351. w = e.requestAnimationFrame || e.webkitRequestAnimationFrame || t;
  2352. var a = (new Date).getTime()
  2353. , n = e.cancelAnimationFrame || e.webkitCancelAnimationFrame || e.clearTimeout;
  2354. y = function(t) {
  2355. n.call(e, t)
  2356. }
  2357. }(window),
  2358. function() {
  2359. function e(e) {
  2360. for (var n = 0, i = t.length; i > n; n++) {
  2361. var r = t[n] ? t[n] + e.charAt(0).toUpperCase() + e.slice(1) : e;
  2362. if (null != a.style[r])
  2363. return r
  2364. }
  2365. }
  2366. var t = ["", "webkit", "moz", "ms", "o"]
  2367. , a = document.createElement("div");
  2368. f = e("transform"),
  2369. v = e("perspective") ? "translateZ(0) " : ""
  2370. }(),
  2371. t[m] = n,
  2372. e.fn[h] = function(t, a) {
  2373. var r, s;
  2374. return e.isPlainObject(t) || (("string" === i(t) || t === !1) && (r = t === !1 ? "destroy" : t,
  2375. s = Array.prototype.slice.call(arguments, 1)),
  2376. t = {}),
  2377. this.each(function(i, o) {
  2378. var l = e.data(o, g);
  2379. l || r ? l && r && l[r] && l[r].apply(l, s) : l = e.data(o, g, new n(o,t,a).init())
  2380. })
  2381. }
  2382. ,
  2383. n.defaults = {
  2384. slidee: null,
  2385. horizontal: !1,
  2386. itemNav: null,
  2387. itemSelector: null,
  2388. smart: !1,
  2389. activateOn: null,
  2390. activateMiddle: !1,
  2391. scrollSource: null,
  2392. scrollBy: 0,
  2393. scrollHijack: 300,
  2394. scrollTrap: !1,
  2395. dragSource: null,
  2396. mouseDragging: !1,
  2397. touchDragging: !1,
  2398. releaseSwing: !1,
  2399. swingSpeed: .2,
  2400. elasticBounds: !1,
  2401. interactive: null,
  2402. scrollBar: null,
  2403. dragHandle: !1,
  2404. dynamicHandle: !1,
  2405. minHandleSize: 50,
  2406. clickBar: !1,
  2407. syncSpeed: .5,
  2408. pagesBar: null,
  2409. activatePageOn: null,
  2410. pageBuilder: function(e) {
  2411. return "<li>" + (e + 1) + "</li>"
  2412. },
  2413. forward: null,
  2414. backward: null,
  2415. prev: null,
  2416. next: null,
  2417. prevPage: null,
  2418. nextPage: null,
  2419. cycleBy: null,
  2420. cycleInterval: 5e3,
  2421. pauseOnHover: !1,
  2422. startPaused: !1,
  2423. moveBy: 300,
  2424. speed: 0,
  2425. easing: "swing",
  2426. startAt: null,
  2427. keyboardNavBy: null,
  2428. draggedClass: "dragged",
  2429. activeClass: "active",
  2430. disabledClass: "disabled"
  2431. }
  2432. }(jQuery, window);
  2433. !function e(t, i, n) {
  2434. function r(a, s) {
  2435. if (!i[a]) {
  2436. if (!t[a]) {
  2437. var l = "function" == typeof require && require;
  2438. if (!s && l)
  2439. return l(a, !0);
  2440. if (o)
  2441. return o(a, !0);
  2442. var c = new Error("Cannot find module '" + a + "'");
  2443. throw c.code = "MODULE_NOT_FOUND",
  2444. c
  2445. }
  2446. var h = i[a] = {
  2447. exports: {}
  2448. };
  2449. t[a][0].call(h.exports, function(e) {
  2450. var i = t[a][1][e];
  2451. return r(i ? i : e)
  2452. }, h, h.exports, e, t, i, n)
  2453. }
  2454. return i[a].exports
  2455. }
  2456. for (var o = "function" == typeof require && require, a = 0; a < n.length; a++)
  2457. r(n[a]);
  2458. return r
  2459. }({
  2460. 1: [function(e, t, i) {
  2461. (function(i) {
  2462. "use strict";
  2463. function n(e) {
  2464. this.player = null,
  2465. this.director = null,
  2466. this.modelManager = null,
  2467. this.container = null,
  2468. this.tagManager = null,
  2469. this.fadeInSpeed = e,
  2470. null !== this.fadeInSpeed && void 0 !== this.fadeInSpeed || (this.fadeInSpeed = 0)
  2471. }
  2472. var r = e("three")
  2473. , o = e("./util/logger")
  2474. , a = (e("./util/common"),
  2475. e("./enum/PlayerEvents"))
  2476. , s = e("./enum/DirectorEvents")
  2477. , l = e("./settings")
  2478. , c = e("./enum/Viewmode")
  2479. , h = (e("./enum/WarpStyle"),
  2480. e("./enum/BlackoutStyle"),
  2481. e("./enum/ModelManagerEvents"))
  2482. , u = e("./enum/tagEvents")
  2483. , d = e("./util/transitions")
  2484. , p = e("./util/lerp")
  2485. , f = new o(i);
  2486. window.THREE = r;
  2487. n.prototype.init = function(e, t, i, n, r) {
  2488. window.app = this;
  2489. this.player = t,
  2490. this.director = e,
  2491. this.modelManager = i,
  2492. this.tagManager = n,
  2493. this.container = r,
  2494. this.updateModel(),
  2495. this.bindEvents()
  2496. }
  2497. ,
  2498. n.prototype.bindEvents = function() {
  2499. this.modelManager.on(h.ActiveModelChanged, this.updateModel.bind(this)),
  2500. this.player.on(a.ModeChanging, this.handlePlayerModeChanging.bind(this)),
  2501. this.player.on(a.ModeChanged, this.handlePlayerModeChanged.bind(this)),
  2502. this.player.on(a.ClosestPanoChanging, this.handleClosestPanoChanging.bind(this)),
  2503. this.player.on(a.StartInside, this.handleStartInside.bind(this)),
  2504. this.player.on(a.StartOutside, this.handleStartOutside.bind(this)),
  2505. this.player.on(a.WarpStarted, this.handleWarpStarted.bind(this)),
  2506. this.director.on(s.ActionInterrupted, this.handleActionInterruption.bind(this)),
  2507. this.tagManager.on(u.TagActivated, this.ontagActivated.bind(this)),
  2508. this.tagManager.on(u.TagNavigation, this.onNavigationTotag.bind(this))
  2509. }
  2510. ,
  2511. n.prototype.updateModel = function() {
  2512. //模型this.model
  2513. this.model = this.modelManager.getActiveModel()
  2514. }
  2515. ,
  2516. n.prototype.handleWarpStarted = function() {
  2517. this.hidePlayerReticule()
  2518. }
  2519. ,
  2520. n.prototype.ontagActivated = function() {
  2521. this.hidePlayerReticule()
  2522. }
  2523. ,
  2524. n.prototype.onNavigationTotag = function() {
  2525. this.hidePlayerReticule()
  2526. }
  2527. ,
  2528. n.prototype.handlePlayerModeChanging = function(e, t, i) {
  2529. var n = this.modelManager.getActiveModel()
  2530. , r = this.player.is360View(t, i) || this.director.tourIsPlaying ? 0 : l[t].markerOpacity;
  2531. n.fadePanoMarkers(r),
  2532. n.setMode(t)
  2533. }
  2534. ,
  2535. n.prototype.handlePlayerModeChanged = function(e, t) {
  2536. var i = this.modelManager.getActiveModel()
  2537. , n = t === c.PANORAMA ? r.DoubleSide : r.FrontSide;
  2538. i.setSide(n),
  2539. i.setMode(t)
  2540. }
  2541. ,
  2542. n.prototype.handleClosestPanoChanging = function(e, t, i) {
  2543. i !== c.TRANSITIONING && (e && !this.director.tourIsPlaying && e.hoverOff(i),
  2544. t && !this.director.tourIsPlaying && t.hoverOn(i))
  2545. }
  2546. ,
  2547. n.prototype.handleActionInterruption = function() {}
  2548. ,
  2549. n.prototype.handleStartInside = function(e) {
  2550. var t = l[this.player.mode]
  2551. , i = e ? 0 : t.transitionTime * t.skyboxOpacityLength;
  2552. this.fadeIn(this.fadeInSpeed),
  2553. this.model.alpha = 0,
  2554. this.model.skybox.material.uniforms.opacity.value = 1,
  2555. this.model.fadePanoMarkers(e ? 0 : t.markerOpacity);
  2556. var n = this.player.reticule;
  2557. d.start(p.property(n.material, "opacity", 0), i, null, 0, null, "retReOpac")
  2558. }
  2559. ,
  2560. n.prototype.handleStartOutside = function(e) {
  2561. this.fadeIn(e)
  2562. }
  2563. ,
  2564. n.prototype.fadeIn = function(e) {
  2565. null !== e && void 0 !== e || (e = 2e3,
  2566. f.warn("DisplayController.fadeIn -> no transition time specified, defaulting to 2000 ms.")),
  2567. $(this.container).fadeIn(e)
  2568. }
  2569. ,
  2570. n.prototype.hidePlayerReticule = function() {
  2571. this.player.reticule.hide()
  2572. }
  2573. ,
  2574. t.exports = n
  2575. }
  2576. ).call(this, "/js/DisplayController.js")
  2577. }
  2578. , {
  2579. "./enum/BlackoutStyle": 18,
  2580. "./enum/DirectorEvents": 23,
  2581. "./enum/tagEvents": 32,
  2582. "./enum/ModelManagerEvents": 33,
  2583. "./enum/PlayerEvents": 40,
  2584. "./enum/Viewmode": 51,
  2585. "./enum/WarpStyle": 52,
  2586. "./settings": 166,
  2587. "./util/common": 185,
  2588. "./util/lerp": 188,
  2589. "./util/logger": 189,
  2590. "./util/transitions": 195,
  2591. three: 217
  2592. }],
  2593. 2: [function(e, t, i) {
  2594. "use strict";
  2595. function n() {
  2596. this.baseStartTime = performance.timing.navigationStart,
  2597. this.loadingStartTime = null,
  2598. this.waitingStartTime = null,
  2599. this.appReadyTime = null
  2600. }
  2601. n.prototype.setBaseStartTime = function(e) {
  2602. this.baseStartTime = e || Date.now()
  2603. }
  2604. ,
  2605. n.prototype.setWaitingStartTime = function(e) {
  2606. this.waitingStartTime = e || Date.now()
  2607. }
  2608. ,
  2609. n.prototype.setLoadingStartTime = function(e) {
  2610. this.loadingStartTime = e || Date.now()
  2611. }
  2612. ,
  2613. n.prototype.setAppReadyTime = function(e) {
  2614. this.appReadyTime = e || Date.now()
  2615. }
  2616. ,
  2617. n.prototype.calcFullLoadingTime = function() {
  2618. var e = this.appReadyTime - this.baseStartTime;
  2619. return this.waitingStartTime && (e -= this.loadingStartTime - this.waitingStartTime),
  2620. e
  2621. }
  2622. ,
  2623. t.exports = n
  2624. }
  2625. , {}],
  2626. 3: [function(e, t, i) {
  2627. (function(i) {
  2628. "use strict";
  2629. function n() {
  2630. return 100 * Math.random()
  2631. }
  2632. var r = e("./util/logger")
  2633. , o = e("./util/browser")
  2634. , a = new r(i)
  2635. , s = window.MP_AB_TESTS = window.MP_AB_TESTS || {
  2636. initialized: !1,
  2637. init: function(e, t) {
  2638. if (t = t || {},
  2639. !this.initialized) {
  2640. this.initialized = !0,
  2641. o.valueFromHash("tilegen") && (t.tilegen = 1 === o.valueFromHash("tilegen", 0)),
  2642. o.valueFromHash("imgopt") && (t.imgopt = 1 === o.valueFromHash("imgopt", 0));
  2643. for (var i in e) {
  2644. var r = i.match("^sc_tilegen_([0-9]+)$");
  2645. r && (s.tilegen = n() < parseInt(r[1]));
  2646. var l = i.match("^sc_imgopt_([0-9]+)$");
  2647. l && (s.imgopt = n() < parseInt(l[1]))
  2648. }
  2649. for (var c in t)
  2650. s[c] = t[c],
  2651. a.debug("A/B override:", c, s[c])
  2652. }
  2653. },
  2654. changeIfTileGenerating: function(e) {
  2655. return s.tilegen && (e += e.indexOf("?") === -1 ? "?" : "&",
  2656. e += ""),
  2657. e
  2658. },
  2659. changeIfImageOptimzing: function(e) {
  2660. return s.imgopt && e.indexOf("imgopt=1") === -1 && (e += e.indexOf("?") === -1 ? "?" : "&",
  2661. e += ""),
  2662. e
  2663. },
  2664. tilegen: !1,
  2665. imgopt: !1
  2666. };
  2667. t.exports = s
  2668. }
  2669. ).call(this, "/js/ab.js")
  2670. }
  2671. , {
  2672. "./util/browser": 182,
  2673. "./util/logger": 189
  2674. }],
  2675. 4: [function(e, t, i) {
  2676. (function(i) {
  2677. "use strict";
  2678. function n() {
  2679. return {
  2680. addons: [{
  2681. name: "keen:ua_parser",
  2682. input: {
  2683. ua_string: "user_agent"
  2684. },
  2685. output: "parsed_user_agent"
  2686. }]
  2687. }
  2688. }
  2689. function r(e, t, i, n) {
  2690. function r(t) {
  2691. l[t.sid] = !0;
  2692. var i = t.billboard.media && t.billboard.media.type
  2693. , n = {
  2694. tag_id: t.sid,
  2695. tags_visited: Object.keys(l).length,
  2696. tag_count: Object.keys(e.tags).length,
  2697. tag_view_count: ++E,
  2698. has_media: !!i
  2699. };
  2700. i && (n.media_type = i),
  2701. u("tag_opened", n)
  2702. }
  2703. var l = {}
  2704. , h = Date.now() - N
  2705. , f = null;
  2706. n && (f = Date.now() - window.navigationStart);
  2707. var g;
  2708. try {
  2709. g = /* e.data.player_options.highlight_reel && */ e.heroLocations.length > 0
  2710. } catch (e) {
  2711. g = !1
  2712. }
  2713. var v, A = e.supportsVR;
  2714. A || (v = "VR disabled at the model/account level",
  2715. 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"))),
  2716. u("model_loaded", {
  2717. duration: h,
  2718. duration_from_navigation_start: f,
  2719. has_hlr: g,
  2720. has_vr: A,
  2721. vr_reason: v
  2722. });
  2723. var I = 0;
  2724. e.panos.forEach(function(e) {
  2725. e.on("enter", function() {
  2726. c("pano_viewed", {
  2727. pano_id: e.id,
  2728. pano_view_count: ++I,
  2729. alignment_type: e.alignmentType,
  2730. interaction_source: O,
  2731. navigation_source: p
  2732. })
  2733. })
  2734. });
  2735. var E = 0;
  2736. for (var T in e.tags)
  2737. e.tags[T].billboard.on(M.OPENED, r.bind(this, e.tags[T]));
  2738. t.on("tour_auto", function(e) {
  2739. p = "tour_" + e
  2740. }),
  2741. t.on("tour_manual", function(e) {
  2742. O = "gui-" + e,
  2743. p = "tour_manual"
  2744. }),
  2745. i.on(C.InteractionKey, function() {
  2746. t.mode === y.TRANSITIONING || t.flying || d(C.InteractionKey)
  2747. }),
  2748. i.on(C.InteractionDirect, function() {
  2749. t.mode === y.TRANSITIONING || t.flying || d(C.InteractionDirect)
  2750. }),
  2751. o(t),
  2752. a(),
  2753. s()
  2754. }
  2755. function o(e) {
  2756. I.on(T.OPENED, function() {
  2757. c("showcase_share_intent", {
  2758. pano_id: e.currentPano && e.currentPano.id
  2759. })
  2760. }),
  2761. I.on(T.LINK_CLICKED, function(t) {
  2762. c("showcase_share_action", {
  2763. channel: t.channel,
  2764. pano_id: e.currentPano && e.currentPano.id
  2765. })
  2766. }),
  2767. E.on(x.ORIGIN_LINK_CLICKED, function() {
  2768. c("showcase_share_origin_link_clicked")
  2769. })
  2770. }
  2771. function a() {}
  2772. function s() {
  2773. b.on(S.OPENED, c.bind(this, "showcase_gui", {
  2774. gui_action: "click_vr_button"
  2775. })),
  2776. b.on(S.LAUNCH, function(e) {
  2777. c("showcase_gui", {
  2778. gui_action: "launch_vr",
  2779. vr_platform: e.vr_platform,
  2780. vr_app: e.vr_app
  2781. })
  2782. }),
  2783. b.on(S.PREV, c.bind(this, "showcase_gui", {
  2784. gui_action: "vr_modal_prev"
  2785. })),
  2786. b.on(S.NEXT, function(e) {
  2787. c("showcase_gui", {
  2788. gui_action: e.nextAction
  2789. })
  2790. }),
  2791. b.on(S.CLOSED, c.bind(this, "showcase_gui", {
  2792. gui_action: "vr_modal_close"
  2793. })),
  2794. b.on(S.falseICECHOSEN, function(e) {
  2795. c("showcase_gui", {
  2796. gui_action: e.name + " "
  2797. })
  2798. }),
  2799. b.on(S.STORE, function(e) {
  2800. c("showcase_gui", {
  2801. gui_action: "launch_store",
  2802. store: e
  2803. })
  2804. })
  2805. }
  2806. function l(e, t) {
  2807. if (f)
  2808. try {
  2809. f.addEvent(e, v.extendObject({
  2810. host: window.location.host,
  2811. keen: n(),
  2812. user_agent: "${keen.user_agent}",
  2813. referrer: {
  2814. url: v.normalizeUrl(document.referrer),
  2815. domain: v.domainFromUrl(document.referrer),
  2816. url_original: document.referrer
  2817. },
  2818. embedded: m.inIframe(),
  2819. is_mobile: m.isMobile(),
  2820. version: "2.25.6-0-gd87e5b1"
  2821. }, t))
  2822. } catch (e) {
  2823. P.warn("analytics.report -> client.addEvent() error (is there blocking software installed?). Error message: " + e)
  2824. }
  2825. }
  2826. function c(e, t) {
  2827. if (t = t || {},
  2828. L)
  2829. try {
  2830. window.analytics.track(e, v.extendObject(t, B), {
  2831. context: {
  2832. app: {
  2833. name: "showcase",
  2834. version: "2.25.6-0-gd87e5b1"
  2835. },
  2836. screen: {
  2837. width: window.screen.width,
  2838. height: window.screen.height,
  2839. density: window.devicePixelRatio
  2840. }
  2841. }
  2842. })
  2843. } catch (t) {
  2844. console.warn("Failed to send data to segment for " + e)
  2845. }
  2846. }
  2847. function h(e, t) {
  2848. if (t = t || {},
  2849. navigator.sendBeacon && L)
  2850. try {
  2851. navigator.sendBeacon("https://api.segment.io/v1/t", JSON.stringify({
  2852. event: e,
  2853. anonymousId: window.analytics.user().anonymousId(),
  2854. properties: v.extendObject(t, B),
  2855. writeKey: L,
  2856. sentAt: Date.now(),
  2857. type: "track",
  2858. context: {
  2859. userAgent: m.userAgent(),
  2860. library: {
  2861. name: "showcase-beacon",
  2862. version: "2.25.6-0-gd87e5b1"
  2863. },
  2864. app: {
  2865. name: "showcase",
  2866. version: "2.25.6-0-gd87e5b1"
  2867. }
  2868. }
  2869. }))
  2870. } catch (e) {
  2871. console.warn("Failed to send async segment request")
  2872. }
  2873. }
  2874. function u(e, t) {
  2875. t = t || {},
  2876. c(e, t)
  2877. }
  2878. function d(e, t) {
  2879. O = e === C.InteractionGui ? "gui-" + t : e,
  2880. p = "self_guided"
  2881. }
  2882. var p, f, g = (e("three"),
  2883. e("./util/ajax"),
  2884. e("./ab")), m = e("./util/browser"), v = e("./util/common"), A = e("./settings"), y = (e("./localization/localize"),
  2885. 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"),
  2886. "direct"), L = null, D = !1, N = null, B = null, F = v.uuid4();
  2887. t.exports = {
  2888. report: function(e, t, i, n) {
  2889. l("Session starts", {
  2890. model: e,
  2891. status: t,
  2892. loadtime: Date.now() - (N || Date.now()),
  2893. loadtime_from_navigation_start: i ? Date.now() - window.navigationStart : null,
  2894. autoplay: i,
  2895. quickstart: n,
  2896. ab_tilegen: g.tilegen,
  2897. ab_imgopt: g.imgopt
  2898. })
  2899. },
  2900. impression: function(e) {
  2901. e = e || {};
  2902. var t = void 0 === e.isVisible || e.isVisible
  2903. , i = (void 0 !== e.immediate && e.immediate,
  2904. window.location.search.substr(1).split("&"));
  2905. u("impression", {
  2906. visible: t,
  2907. url_params: i
  2908. })
  2909. },
  2910. initKeen: function(e) {
  2911. return e.token && e.appId ? void (f = new Keen({
  2912. projectId: e.appId,
  2913. writeKey: e.token,
  2914. readKey: "",
  2915. requestType: "xhr"
  2916. })) : void P.warn("no keen token/appId")
  2917. },
  2918. initSegment: function(e) {
  2919. return e.token ? (L = e.token,
  2920. window.analytics.load(e.token),
  2921. B = {
  2922. model_id: e.model,
  2923. start_source: e.startSource,
  2924. autoplay: e.autoplay,
  2925. quickstart: e.quickstart,
  2926. language_tag: A.languageTag,
  2927. is_mobile: m.isMobile(),
  2928. iframe: m.inIframe(),
  2929. aspect_ratio: m.aspectRatio(),
  2930. session_id: F,
  2931. window: {
  2932. width: $("#player").width(),
  2933. height: $("#player").height()
  2934. },
  2935. platform: {
  2936. browser: {
  2937. name: $.ua.browser.name,
  2938. major: $.ua.browser.major,
  2939. version: $.ua.browser.version
  2940. },
  2941. os: {
  2942. name: $.ua.os.name,
  2943. version: $.ua.os.version
  2944. },
  2945. device: {
  2946. vendor: $.ua.device.vendor,
  2947. model: $.ua.device.model,
  2948. type: $.ua.device.type
  2949. }
  2950. }
  2951. },
  2952. D = Math.random() < A.analytics.sessionTrackingRate,
  2953. P.debug("tracking sample rate = " + A.analytics.sessionTrackingRate),
  2954. void P.debug("tracking this session = " + D)) : void P.warn("no segment token")
  2955. },
  2956. sessionStart: function(e) {
  2957. P.debug("analytics user_session_start"),
  2958. c("session_started"),
  2959. N = Date.now(),
  2960. window.addEventListener("unload", function() {
  2961. h("session_ended", {
  2962. duration: Date.now() - N
  2963. })
  2964. })
  2965. },
  2966. modelLoaded: function(e, t, i, n) {
  2967. r(e, t, i, n)
  2968. },
  2969. loadComplete: function(e) {
  2970. var t = {
  2971. time_to_app_start: e
  2972. };
  2973. c("load_times", t)
  2974. },
  2975. track: function(e, t) {
  2976. D && (P.debug('analytics.track("' + e + '", ' + JSON.stringify(t) + " )"),
  2977. c(e, t))
  2978. },
  2979. trackAlways: function(e, t) {
  2980. P.debug('analytics.trackAlways("' + e + '", ' + JSON.stringify(t) + " )"),
  2981. c(e, t)
  2982. },
  2983. getSessionId: function() {
  2984. return F
  2985. },
  2986. updateInteraction: d
  2987. }
  2988. }
  2989. ).call(this, "/js/analytics.js")
  2990. }
  2991. , {
  2992. "./ab": 3,
  2993. "./enum/ControlEvents": 21,
  2994. "./enum/PlayerEvents": 40,
  2995. "./enum/VROption": 47,
  2996. "./enum/VRPlatforms": 49,
  2997. "./enum/Viewmode": 51,
  2998. "./gui/sharing/ShareEvents": 76,
  2999. "./gui/sharing/modal": 77,
  3000. "./gui/title/TitleEvents": 80,
  3001. "./gui/title/titleBar": 82,
  3002. "./gui/vr/vrEvent": 85,
  3003. "./gui/vr/vrModal": 87,
  3004. "./localization/localize": 108,
  3005. "./tag/Billboard/BillboardEvent": 120,
  3006. "./settings": 166,
  3007. "./util/ajax": 181,
  3008. "./util/browser": 182,
  3009. "./util/common": 185,
  3010. "./util/logger": 189,
  3011. three: 217
  3012. }],
  3013. 5: [function(e, t, i) {
  3014. "use strict";
  3015. function n() {
  3016. r.PerspectiveCamera.call(this, a.clampVFOV(o.dollhouseFOV), $("#player").width() / $("#player").height(), o.dollhouseNear, o.dollhouseFar),
  3017. this.controls = null
  3018. }
  3019. var r = e("three")
  3020. , o = e("../constants")
  3021. , a = e("../util/cameraLight");
  3022. n.prototype = Object.create(r.PerspectiveCamera.prototype),
  3023. n.prototype.updateAspect = function(e) {
  3024. this.aspect = e,
  3025. this.updateProjectionMatrix()
  3026. }
  3027. ,
  3028. t.exports = n
  3029. }
  3030. , {
  3031. "../constants": 8,
  3032. "../util/cameraLight": 184,
  3033. three: 217
  3034. }],
  3035. 6: [function(e, t, i) {
  3036. "use strict";
  3037. function n() {
  3038. var e = $("#player").width() / $("#player").height();
  3039. r.OrthographicCamera.call(this, -o.orthoBase, o.orthoBase, o.orthoBase / e, -o.orthoBase / e, o.orthoNear, o.orthoFar),
  3040. this.controls = null,
  3041. this.updateAspect(e)
  3042. }
  3043. var r = e("three")
  3044. , o = e("../constants");
  3045. n.prototype = Object.create(r.OrthographicCamera.prototype),
  3046. n.prototype.updateAspect = function(e) {
  3047. this.aspect = e,
  3048. this.top = o.orthoBase / e,
  3049. this.bottom = -o.orthoBase / e,
  3050. this.updateProjectionMatrix()
  3051. }
  3052. ,
  3053. t.exports = n
  3054. }
  3055. , {
  3056. "../constants": 8,
  3057. three: 217
  3058. }],
  3059. 7: [function(e, t, i) {
  3060. "use strict";
  3061. function n() {
  3062. r.PerspectiveCamera.call(this, a.clampVFOV(o.insideFOV), $("#player").width() / $("#player").height(), o.insideNear, o.insideFar),
  3063. this.controls = null
  3064. }
  3065. var r = e("three")
  3066. , o = e("../settings")
  3067. , a = e("../util/cameraLight");
  3068. n.prototype = Object.create(r.PerspectiveCamera.prototype),
  3069. n.prototype.updateAspect = function(e) {
  3070. this.aspect = e,
  3071. this.updateProjectionMatrix()
  3072. }
  3073. ,
  3074. t.exports = n
  3075. }
  3076. , {
  3077. "../settings": 166,
  3078. "../util/cameraLight": 184,
  3079. three: 217
  3080. }],
  3081. 8: [function(e, t, i) {
  3082. "use strict";
  3083. t.exports = {
  3084. signedUrlDefaultExpireTime: 24e4,
  3085. signedUrlCheckInterval: 1e4,
  3086. signedUrlRefreshBuffer: 15e3,
  3087. dollhouseFOV: 70,
  3088. dollhouseNear: 1,
  3089. dollhouseFar: 5e3,
  3090. insideFOV: 70,
  3091. insideFOVMax: 120,
  3092. insideNear: .1,
  3093. insideFar: 5e3,
  3094. insideLookSpeed: .12,
  3095. insideLookLimitUp: 40,
  3096. insideLookLimitDown: -40,
  3097. orthoNear: 1,
  3098. orthoFar: 5e3,
  3099. orthoBase: 10,
  3100. narrowLandscapeHeight: 290,
  3101. reallyNarrowLandscapeHeight: 250,
  3102. visionTilingStartDate: new Date("8/26/2016"),
  3103. visionTilingStartVersion: "1.1.407.13667",
  3104. windowHeightHighQualityThreshold: 900,
  3105. tourStepDelayDefault: 3500,
  3106. tourStepDelaySlideShow: 5e3,
  3107. workshopApsect: 9 / 16,
  3108. highQualityMaxZoom: 2,
  3109. ultraHighQualityMaxZoom: 3
  3110. }
  3111. }
  3112. , {}],
  3113. 9: [function(e, t, i) {
  3114. "use strict";
  3115. function n() {
  3116. this.activeControl = null,
  3117. this.controls = {},
  3118. this.cameras = {}
  3119. }
  3120. var r = e("./PanoramaControls")
  3121. , o = e("./DollhouseControls")
  3122. , a = e("./FloorplanControls")
  3123. , s = e("../cameras/PanoramaCamera")
  3124. , l = e("../cameras/DollhouseCamera")
  3125. , c = e("../cameras/FloorplanCamera")
  3126. , h = e("events").EventEmitter
  3127. , u = e("../enum/ControlEvents")
  3128. , d = e("../enum/ModelManagerEvents")
  3129. , p = e("../enum/Viewmode")
  3130. , f = e("../settings");
  3131. n.prototype = Object.create(h.prototype),
  3132. n.prototype.init = function(e, t) {
  3133. this.setUpControls(),
  3134. this.bindEvents(e, t)
  3135. }
  3136. ,
  3137. n.prototype.activateControls = function(e) {
  3138. this.activeControl && (this.activeControl.reset(),
  3139. this.activeControl.enabled = !1),
  3140. this.controls[e] && (this.controls[e].enabled = !0),
  3141. this.activeControl = this.controls[e]
  3142. }
  3143. ,
  3144. n.prototype.setUpControls = function() {
  3145. var e = {}
  3146. , t = {}
  3147. , i = [p.PANORAMA, p.DOLLHOUSE, p.FLOORPLAN]
  3148. , n = [s, l, c]
  3149. , h = [r, o, a];
  3150. i.forEach(function(i, r) {
  3151. e[i] = new n[r],
  3152. t[i] = new h[r](e[i]),
  3153. t[i].on(u.Move, this.emit.bind(this, u.Move)),
  3154. t[i].on(u.InputStart, this.emit.bind(this, u.InputStart)),
  3155. t[i].on(u.InteractionDirect, this.emit.bind(this, u.InteractionDirect)),
  3156. t[i].on(u.InteractionKey, this.emit.bind(this, u.InteractionKey)),
  3157. t[i].on(u.Pinch, this.emit.bind(this, u.Pinch)),
  3158. t[i].on(u.Scroll, this.emit.bind(this, u.Scroll))
  3159. }
  3160. .bind(this)),
  3161. this.controls = t,
  3162. this.cameras = e
  3163. }
  3164. ,
  3165. n.prototype.bindEvents = function(e, t) {
  3166. e.addEventListener("mousemove", this.onMouseMove.bind(this)),
  3167. e.addEventListener("mousedown", this.onMouseDown.bind(this)),
  3168. e.addEventListener("mouseup", this.onMouseUp.bind(this)),
  3169. e.addEventListener("mouseover", this.onMouseOver.bind(this)),
  3170. f.useWheel && (e.addEventListener("mousewheel", this.onMouseWheel.bind(this),{ passive: false }),
  3171. e.addEventListener("DOMMouseScroll", this.onMouseWheel.bind(this))),
  3172. e.addEventListener("touchstart", this.onTouchStart.bind(this)),
  3173. e.addEventListener("touchmove", this.onTouchMove.bind(this)),
  3174. e.addEventListener("touchend", this.onTouchEnd.bind(this)),
  3175. e.addEventListener("contextmenu", function(e) {
  3176. e.preventDefault()
  3177. }),
  3178. e.addEventListener("pointerdown", this.onPointerDown.bind(this)),
  3179. e.addEventListener("pointermove", this.onPointerMove.bind(this)),
  3180. e.addEventListener("pointerup", this.onPointerUp.bind(this)),
  3181. e.addEventListener("pointerout", this.onPointerCancel.bind(this)),
  3182. e.addEventListener("pointercancel", this.onPointerCancel.bind(this)),
  3183. document.addEventListener("keydown", this.onKeyDown.bind(this)),
  3184. document.addEventListener("keyup", this.onKeyUp.bind(this)),
  3185. t.on(d.ActiveModelChanged, function(e) {
  3186. this.setModelForControls(e.model)
  3187. }
  3188. .bind(this))
  3189. }
  3190. ,
  3191. n.prototype.setModelForControls = function(e) {
  3192. this.controls[p.DOLLHOUSE].setZoomBounds(e.boundingBox);
  3193. var t = e.boundingBox.clone().expandByScalar(f.modelBoundsPadding);
  3194. [p.DOLLHOUSE, p.FLOORPLAN].forEach(function(e) {
  3195. this.controls[e].setBounds(t)
  3196. }
  3197. .bind(this))
  3198. }
  3199. ,
  3200. n.prototype.onMouseDown = function(e) {
  3201. e.preventDefault(),
  3202. this.activeControl && this.activeControl.onMouseDown(e)
  3203. }
  3204. ,
  3205. n.prototype.onMouseMove = function(e) {
  3206. e.preventDefault(),
  3207. this.activeControl && this.activeControl.onMouseMove(e)
  3208. }
  3209. ,
  3210. n.prototype.onMouseUp = function(e) {
  3211. e.preventDefault(),
  3212. this.activeControl && this.activeControl.onMouseUp(e)
  3213. }
  3214. ,
  3215. n.prototype.onMouseOver = function(e) {
  3216. e.preventDefault(),
  3217. this.activeControl && this.activeControl.onMouseOver(e)
  3218. }
  3219. ,
  3220. n.prototype.onMouseWheel = function(e) {
  3221. e.preventDefault(),
  3222. this.activeControl && this.activeControl.onMouseWheel(e)
  3223. }
  3224. ,
  3225. n.prototype.onTouchStart = function(e) {
  3226. e.preventDefault(),
  3227. this.activeControl && this.activeControl.onTouchStart(e);
  3228. var hotList = $('#hotListWrap')[0];
  3229. hotList.classList.remove('hotListActive');
  3230. $('#hotListContent ul .active').removeClass('active');
  3231. $('#hotList')[0].classList.remove('active')
  3232. }
  3233. ,
  3234. n.prototype.onTouchMove = function(e) {
  3235. e.preventDefault(),
  3236. this.activeControl && this.activeControl.onTouchMove(e)
  3237. }
  3238. ,
  3239. n.prototype.onTouchEnd = function(e) {
  3240. e.preventDefault(),
  3241. this.activeControl && this.activeControl.onTouchEnd(e)
  3242. }
  3243. ,
  3244. n.prototype.onPointerDown = function(e) {
  3245. if (e.preventDefault(),
  3246. this.activeControl)
  3247. switch (e.pointerType) {
  3248. case "mouse":
  3249. this.activeControl.onMouseDown(e);
  3250. break;
  3251. default:
  3252. this.activeControl.onPointerDown(e)
  3253. }
  3254. }
  3255. ,
  3256. n.prototype.onPointerMove = function(e) {
  3257. if (e.preventDefault(),
  3258. this.activeControl)
  3259. switch (e.pointerType) {
  3260. case "mouse":
  3261. this.activeControl.onMouseMove(e);
  3262. break;
  3263. default:
  3264. this.activeControl.onPointerMove(e)
  3265. }
  3266. }
  3267. ,
  3268. n.prototype.onPointerUp = function(e) {
  3269. if (e.preventDefault(),
  3270. this.activeControl)
  3271. switch (e.pointerType) {
  3272. case "mouse":
  3273. this.activeControl.onMouseUp(e);
  3274. break;
  3275. default:
  3276. this.activeControl.onPointerUp(e)
  3277. }
  3278. }
  3279. ,
  3280. n.prototype.onPointerCancel = function(e) {
  3281. e.preventDefault(),
  3282. this.activeControl && "mouse" !== e.pointerType && this.activeControl.onPointerUp(e)
  3283. }
  3284. ,
  3285. n.prototype.onKeyDown = function(e) {
  3286. e.metaKey || e.ctrlKey || (e.preventDefault(),
  3287. this.activeControl && this.activeControl.onKeyDown(e))
  3288. }
  3289. ,
  3290. n.prototype.onKeyUp = function(e) {
  3291. e.preventDefault(),
  3292. this.activeControl && this.activeControl.onKeyUp(e)
  3293. }
  3294. ,
  3295. t.exports = n
  3296. }
  3297. , {
  3298. "../cameras/DollhouseCamera": 5,
  3299. "../cameras/FloorplanCamera": 6,
  3300. "../cameras/PanoramaCamera": 7,
  3301. "../enum/ControlEvents": 21,
  3302. "../enum/ModelManagerEvents": 33,
  3303. "../enum/Viewmode": 51,
  3304. "../settings": 166,
  3305. "./DollhouseControls": 10,
  3306. "./FloorplanControls": 11,
  3307. "./PanoramaControls": 13,
  3308. events: 202
  3309. }],
  3310. 10: [function(e, t, i) {
  3311. "use strict";
  3312. function n(e) {
  3313. a.call(this, e),
  3314. this.minPolarAngle = o.dollhouseDefault.minPolarAngle,
  3315. this.maxPolarAngle = o.dollhouseDefault.maxPolarAngle,
  3316. this.minDistance = o.dollhouseDefault.minDistance,
  3317. this.maxDistance = o.dollhouseDefault.maxDistance,
  3318. this.adjustedMinDistance = this.minDistance,
  3319. this.adjustedMaxDistance = this.maxDistance
  3320. }
  3321. var r = e("three")
  3322. , o = e("../settings")
  3323. , a = e("./OutsideControls");
  3324. n.prototype = Object.create(a.prototype),
  3325. n.prototype.pan = function(e, t) {
  3326. this.camera.updateMatrix();
  3327. var i = this.camera.position.clone().sub(this.target).length();
  3328. i *= Math.tan(this.camera.fov / 2 * Math.PI / 180),
  3329. this.panLeft(2 * e * i / $("#player").height()),
  3330. this.panUp(-2 * t * i / $("#player").height())
  3331. }
  3332. ,
  3333. n.prototype.updateZoom = function() {
  3334. var e = this.offset.length();
  3335. return e * this.scale
  3336. }
  3337. ,
  3338. n.prototype.setZoomBounds = function(e) {
  3339. var t = e.min.distanceTo(e.max);
  3340. this.adjustedMinDistance = Math.max(Math.min(t / 2, o.dollhouseDefault.minDistance), 0),
  3341. this.adjustedMaxDistance = Math.min(Math.max(t, o.dollhouseDefault.maxDistance), o.skyboxRadius),
  3342. this.minDistance = this.adjustedMinDistance,
  3343. this.maxDistance = this.adjustedMaxDistance
  3344. }
  3345. ,
  3346. n.prototype.resetRanges = function(e, t) {
  3347. e ? (this.minDistance = Math.min(e, this.minDistance),
  3348. this.maxDistance = Math.max(e, this.maxDistance)) : (this.minDistance = this.adjustedMinDistance,
  3349. this.maxDistance = this.adjustedMaxDistance),
  3350. t ? (this.minPolarAngle = r.Math.degToRad(-15),
  3351. this.maxPolarAngle = r.Math.degToRad(89.9)) : (this.minPolarAngle = o.dollhouseDefault.minPolarAngle,
  3352. this.maxPolarAngle = o.dollhouseDefault.maxPolarAngle)
  3353. }
  3354. ,
  3355. n.prototype.toJSON = function() {
  3356. return a.prototype.toJSON.call(this)
  3357. }
  3358. ,
  3359. t.exports = n
  3360. }
  3361. , {
  3362. "../settings": 166,
  3363. "./OutsideControls": 12,
  3364. three: 217
  3365. }],
  3366. 11: [function(e, t, i) {
  3367. "use strict";
  3368. function n(e) {
  3369. a.call(this, e),
  3370. this.minDistance = 15,
  3371. this.maxDistance = 50,
  3372. this.noRotateUpDown = !0,
  3373. this.minPolarAngle = 0,
  3374. this.maxPolarAngle = 0,
  3375. this.mouseActions[l.LEFT] = s.PAN,
  3376. this.mouseActions[l.MIDDLE] = s.DOLLY,
  3377. this.mouseActions[l.RIGHT] = s.ROTATE,
  3378. this.touchActions[1] = s.PAN,
  3379. this.touchActions[2] = s.ROTATE_DOLLY,
  3380. this.absoluteScale = 1,
  3381. this.currentScale = 1
  3382. }
  3383. var r = e("three")
  3384. , o = e("../settings")
  3385. , a = e("./OutsideControls")
  3386. , s = e("../enum/ControlActions")
  3387. , l = e("../enum/MouseButton")
  3388. , c = e("../util/math")
  3389. , h = e("../util/browser");
  3390. n.prototype = Object.create(a.prototype),
  3391. n.prototype.zoomToContain = function(e) {
  3392. this.absoluteScale = this.getDefaultAbsoluteScale(e);
  3393. this.currentScale = this.absoluteScale
  3394. }
  3395. ,
  3396. n.prototype.getDefaultAbsoluteScale = function(modelSize) {
  3397. var t = Math.max(modelSize.x, modelSize.z)
  3398. , i = Math.min(modelSize.x, modelSize.z)
  3399. , n = Math.max(t, i * this.camera.aspect)
  3400. , r = Math.max(i, t * this.camera.aspect);
  3401. var absoluteScale = (h.aspectRatio() < 1 ? r : n) / 2 / o.orthoBase * 1.2
  3402. return absoluteScale
  3403. },
  3404. n.prototype.rotateToView = function(e, t) {
  3405. var i = 0
  3406. , n = h.aspectRatio() < 1
  3407. , r = e.x < e.z;
  3408. n === r ? t.z > 0 && (i = Math.PI) : i = t.x > 0 ? Math.PI / 2 : -Math.PI / 2,
  3409. this.rotateLeft(i),
  3410. this.update(0)
  3411. }
  3412. ,
  3413. n.prototype.pan = function(e, t) {
  3414. this.camera.updateMatrix(),
  3415. this.panLeft(e * (this.camera.right - this.camera.left) / $("#player").width()),
  3416. this.panUp(-t * (this.camera.top - this.camera.bottom) / $("#player").height())
  3417. }
  3418. ,
  3419. n.prototype.updateZoom = function() {
  3420. return this.absoluteScale *= this.scale - .03 * this.keyboardZoomSpeed,
  3421. this.absoluteScale = Math.max(o.zoomNearLimit, Math.min(this.absoluteScale, o.zoomFarLimit)),
  3422. this.currentScale = .8 * this.currentScale + .2 * this.absoluteScale,
  3423. this.camera.left = -o.orthoBase * this.currentScale,
  3424. this.camera.right = o.orthoBase * this.currentScale,
  3425. this.camera.top = o.orthoBase * this.currentScale / this.camera.aspect,
  3426. this.camera.bottom = -o.orthoBase * this.currentScale / this.camera.aspect,
  3427. this.camera.updateProjectionMatrix(),
  3428. this.offset.length()
  3429. }
  3430. ,
  3431. n.prototype.toJSON = function() {
  3432. var e = new r.Quaternion
  3433. , t = (new r.Quaternion).setFromAxisAngle(new r.Vector3(0,1,0), r.Math.degToRad(90))
  3434. , i = new r.Quaternion;
  3435. return function() {
  3436. var n = a.prototype.toJSON.call(this);
  3437. return e.copy(n.camera_quaternion),
  3438. i.copy(t),
  3439. i.multiply(e),
  3440. n.camera_quaternion.x = c.toPrecision(i.x, 4),
  3441. n.camera_quaternion.y = c.toPrecision(i.y, 4),
  3442. n.camera_quaternion.z = c.toPrecision(i.z, 4),
  3443. n.camera_quaternion.w = c.toPrecision(i.w, 4),
  3444. n.ortho_zoom = c.toPrecision(this.currentScale * this.camera.aspect, 4),
  3445. n
  3446. }
  3447. }(),
  3448. t.exports = n
  3449. }
  3450. , {
  3451. "../enum/ControlActions": 20,
  3452. "../enum/MouseButton": 34,
  3453. "../settings": 166,
  3454. "../util/browser": 182,
  3455. "../util/math": 190,
  3456. "./OutsideControls": 12,
  3457. three: 217
  3458. }],
  3459. 12: [function(e, t, i) {
  3460. "use strict";
  3461. function n(e) {
  3462. this.camera = e,
  3463. this.camera.controls = this,
  3464. this.enabled = !1,
  3465. this.target = new r.Vector3,
  3466. this.targetBounds = new r.Box3,
  3467. this.zoomSpeed = 1,
  3468. this.minDistance = 0,
  3469. this.maxDistance = 1 / 0,
  3470. this.noRotateUpDown = !1,
  3471. this.rotateSpeed = 1,
  3472. this.keyboardZoomSpeed = 0,
  3473. this.keyPanSpeed = 7,
  3474. this.autoRotate = !1,
  3475. this.autoRotateSpeed = 2,
  3476. this.autoPan = !1,
  3477. this.autoPanPosition = new r.Vector3,
  3478. this.minPolarAngle = r.Math.degToRad(25),
  3479. this.maxPolarAngle = r.Math.degToRad(65),
  3480. this.rotationAcceleration = new r.Vector2,
  3481. this.rotationSpeed = new r.Vector2,
  3482. this.panAcceleration = new r.Vector2,
  3483. this.panSpeed = new r.Vector2,
  3484. this.rotateStart = new r.Vector2,
  3485. this.rotateEnd = new r.Vector2,
  3486. this.rotateDelta = new r.Vector2,
  3487. this.panStart = new r.Vector2,
  3488. this.panEnd = new r.Vector2,
  3489. this.panDelta = new r.Vector2,
  3490. this.panOffset = new r.Vector3,
  3491. this.offset = new r.Vector3,
  3492. this.dollyStart = new r.Vector2,
  3493. this.dollyEnd = new r.Vector2,
  3494. this.dollyDelta = new r.Vector2,
  3495. this.phiDelta = 0,
  3496. this.thetaDelta = 0,
  3497. this.scale = 1,
  3498. this.panVector = new r.Vector3,
  3499. this.lastPosition = new r.Vector3,
  3500. this.state = c.NONE,
  3501. this.mouseActions = {},
  3502. this.mouseActions[h.LEFT] = c.ROTATE,
  3503. this.mouseActions[h.MIDDLE] = c.DOLLY,
  3504. this.mouseActions[h.RIGHT] = c.PAN,
  3505. this.touchActions = {},
  3506. this.touchActions[1] = c.ROTATE,
  3507. this.touchActions[2] = c.PAN_DOLLY,
  3508. this.lastMoveTime = 0,
  3509. this.pointersLimit = 2,
  3510. this.pointers = []
  3511. }
  3512. var r = e("three")
  3513. , o = e("../settings")
  3514. , a = e("../util/common")
  3515. , s = e("../util/math")
  3516. , l = e("../enum/Vectors")
  3517. , c = e("../enum/ControlActions")
  3518. , h = e("../enum/MouseButton")
  3519. , u = e("../enum/Keys")
  3520. , d = e("../enum/ControlEvents")
  3521. , p = e("events").EventEmitter
  3522. , f = 1e-6;
  3523. n.prototype = Object.create(p.prototype),
  3524. n.prototype.setBounds = function(e) {
  3525. this.targetBounds = e
  3526. }
  3527. ,
  3528. n.prototype.isEngaged = function() {
  3529. return this.state !== c.NONE
  3530. }
  3531. ,
  3532. n.prototype.rotateLeft = function(e) {
  3533. void 0 === e && (e = this.getAutoRotationAngle()),
  3534. this.thetaDelta -= e
  3535. }
  3536. ,
  3537. n.prototype.rotateUp = function(e) {
  3538. this.noRotateUpDown || (void 0 === e && (e = this.getAutoRotationAngle()),
  3539. this.phiDelta -= e)
  3540. }
  3541. ,
  3542. n.prototype.panLeft = function(e) {
  3543. var t = this.camera.matrix.elements;
  3544. this.panOffset.set(t[0], 0, t[2]).normalize(),
  3545. this.panOffset.multiplyScalar(-e),
  3546. this.panVector.add(this.panOffset)
  3547. }
  3548. ,
  3549. n.prototype.panUp = function(e) {
  3550. var t = this.camera.matrix.elements;
  3551. this.panOffset.set(t[4], 0, t[6]).normalize(),
  3552. this.panOffset.multiplyScalar(-e),
  3553. this.panVector.add(this.panOffset)
  3554. }
  3555. ,
  3556. n.prototype.startRotating = function(e, t) {
  3557. e && this.navRotationAcc("x", e),
  3558. t && this.navRotationAcc("y", t)
  3559. }
  3560. ,
  3561. n.prototype.stopRotating = function(e) {
  3562. e && (this.rotationSpeed.x = this.rotationSpeed.y = 0),
  3563. this.navRotationAcc("x", 0),
  3564. this.navRotationAcc("y", 0)
  3565. }
  3566. ,
  3567. n.prototype.setAutoPanPosition = function(e, t) {
  3568. var i = new r.Vector3
  3569. , n = new r.Vector3;
  3570. return function(e, t) {
  3571. i.copy(this.camera.position),
  3572. void 0 === e && null === e || i.setX(e),
  3573. void 0 === t && null === t || i.setZ(t);
  3574. var r = this.camera.position.distanceTo(this.target)
  3575. , o = l.FORWARD.clone().applyQuaternion(this.camera.quaternion);
  3576. this.targetClamped = !1,
  3577. n.copy(i).addScaledVector(o, r),
  3578. this.targetBounds.containsPoint(n) || (this.targetBounds.clampPoint(n, n),
  3579. i.copy(n).addScaledVector(o, -r),
  3580. this.targetClamped = !0),
  3581. this.autoPanPosition.x = i.x,
  3582. this.autoPanPosition.z = i.z,
  3583. this.autoPan && this.stopAutoPanning()
  3584. }
  3585. }(),
  3586. n.prototype.stopAutoPanning = function() {
  3587. var e = this.autoPan;
  3588. this.autoPan = !1,
  3589. this.emit(this.targetClamped ? d.AutoPanClamped : e ? d.AutoPanInterrupt : d.AutoPanComplete)
  3590. }
  3591. ,
  3592. n.prototype.dollyIn = function(e) {
  3593. void 0 === e && (e = this.getZoomScale()),
  3594. this.scale /= e
  3595. }
  3596. ,
  3597. n.prototype.dollyOut = function(e) {
  3598. void 0 === e && (e = this.getZoomScale()),
  3599. this.scale *= e
  3600. }
  3601. ,
  3602. n.prototype.updatePan = function(e) {
  3603. if (this.panSpeed.multiplyScalar(1 - o.panFriction).addScaledVector(this.panAcceleration, o.panAccelerationOutside * e),
  3604. this.pan(-this.panSpeed.x, this.panSpeed.y),
  3605. this.autoPan) {
  3606. var t = (new r.Vector3).copy(this.autoPanPosition).sub(this.camera.position);
  3607. t.setY(0).clampLength(0, 50 * e),
  3608. this.target.add(t),
  3609. this.camera.position.add(t),
  3610. this.autoPanPosition.x === this.camera.position.x && this.autoPanPosition.z === this.camera.position.z && (this.autoPan = !1,
  3611. this.stopAutoPanning())
  3612. }
  3613. }
  3614. ,
  3615. n.prototype.update = function(e) {
  3616. e || (e = 1 / 60),
  3617. this.rotationSpeed.multiplyScalar(1 - o.rotationFriction).addScaledVector(this.rotationAcceleration, o.rotationAccelerationOutside * e),
  3618. this.rotateLeft(-this.rotationSpeed.x),
  3619. this.noRotateUpDown || this.rotateUp(this.rotationSpeed.y),
  3620. this.updatePan(e);
  3621. var t = this.camera.position;
  3622. this.offset.copy(t).sub(this.target);
  3623. var i = Math.atan2(this.offset.x, this.offset.z)
  3624. , n = Math.atan2(Math.sqrt(this.offset.x * this.offset.x + this.offset.z * this.offset.z), this.offset.y);
  3625. this.autoRotate && this.rotateLeft(this.getAutoRotationAngle()),
  3626. i += this.thetaDelta,
  3627. n += this.phiDelta,
  3628. n = Math.max(this.minPolarAngle, Math.min(this.maxPolarAngle, n)),
  3629. n = Math.max(f, Math.min(Math.PI - f, n));
  3630. var r = this.updateZoom();
  3631. r = Math.max(this.minDistance, Math.min(this.maxDistance, r)),
  3632. this.target.add(this.panVector),
  3633. this.targetBounds.clampPoint(this.target, this.target),
  3634. this.offset.x = r * Math.sin(n) * Math.sin(i),
  3635. this.offset.y = r * Math.cos(n),
  3636. this.offset.z = r * Math.sin(n) * Math.cos(i),
  3637. t.copy(this.target).add(this.offset),
  3638. this.camera.lookAt(this.target),
  3639. this.thetaDelta = 0,
  3640. this.phiDelta = 0,
  3641. this.scale = 1,
  3642. this.panVector.set(0, 0, 0),
  3643. this.lastPosition.distanceTo(this.camera.position) > 0 && this.lastPosition.copy(this.camera.position)
  3644. }
  3645. ,
  3646. n.prototype.getAutoRotationAngle = function() {
  3647. return 2 * Math.PI / 60 / 60 * this.autoRotateSpeed
  3648. }
  3649. ,
  3650. n.prototype.getZoomScale = function() {
  3651. return Math.pow(.95, this.zoomSpeed)
  3652. }
  3653. ,
  3654. n.prototype.onMouseDown = function(e) {
  3655. if (this.enabled) {
  3656. switch (e.preventDefault(),
  3657. this.stopAutoPanning(),
  3658. this.mouseDown = !0,
  3659. this.state = this.mouseActions[e.button],
  3660. this.state) {
  3661. case c.ROTATE:
  3662. this.rotateStart.set(e.clientX, this.noRotateUpDown ? 0 : e.clientY),
  3663. this.rotationSpeed.set(0, 0);
  3664. break;
  3665. case c.DOLLY:
  3666. this.dollyStart.set(e.clientX, e.clientY);
  3667. break;
  3668. case c.PAN:
  3669. this.panStart.set(e.clientX, e.clientY)
  3670. }
  3671. this.emit(d.InputStart, "mouse")
  3672. }
  3673. }
  3674. ,
  3675. n.prototype.onMouseMove = function(e) {
  3676. if (this.enabled && this.mouseDown && 0 !== e.buttons) {
  3677. switch (e.preventDefault(),
  3678. this.state) {
  3679. case c.ROTATE:
  3680. this.rotateEnd.set(e.clientX, this.noRotateUpDown ? 0 : e.clientY),
  3681. this.rotateDelta.subVectors(this.rotateEnd, this.rotateStart),
  3682. this.rotateLeft(2 * Math.PI * this.rotateDelta.x / $("#player").width() * this.rotateSpeed),
  3683. this.rotateUp(2 * Math.PI * this.rotateDelta.y / $("#player").height() * this.rotateSpeed),
  3684. this.rotateStart.copy(this.rotateEnd);
  3685. break;
  3686. case c.DOLLY:
  3687. this.dollyEnd.set(e.clientX, e.clientY),
  3688. this.dollyDelta.subVectors(this.dollyEnd, this.dollyStart);
  3689. var t = this.dollyDelta.y > 0 ? this.dollyIn : this.dollyOut;
  3690. t.call(this),
  3691. this.dollyStart.copy(this.dollyEnd);
  3692. break;
  3693. case c.PAN:
  3694. this.panEnd.set(e.clientX, e.clientY),
  3695. this.panDelta.subVectors(this.panEnd, this.panStart),
  3696. this.pan(this.panDelta.x, this.panDelta.y),
  3697. this.panStart.copy(this.panEnd)
  3698. }
  3699. this.emit(d.Move, "mouse"),
  3700. this.lastMoveTime = e.timeStamp,
  3701. this.update()
  3702. }
  3703. }
  3704. ,
  3705. n.prototype.onMouseUp = function(e) {
  3706. this.enabled && (this.mouseDown = !1,
  3707. this.state = c.NONE,
  3708. "mouseover" !== e.type && (e.timeStamp > this.lastMoveTime + 100 ? (this.rotationSpeed.set(0, 0),
  3709. this.rotationAcceleration.set(0, 0)) : this.rotationAcceleration.set(-this.rotateDelta.x, this.rotateDelta.y),
  3710. this.update(),
  3711. this.rotationAcceleration.set(0, 0),
  3712. this.rotateDelta.set(0, 0)))
  3713. }
  3714. ,
  3715. n.prototype.onMouseOver = function(e) {
  3716. 0 !== e.which && 0 !== e.buttons || this.onMouseUp(e)
  3717. }
  3718. ,
  3719. n.prototype.onMouseWheel = function(e) {
  3720. if (this.enabled && o.useWheel) {
  3721. this.emit(d.Move, "wheel");
  3722. var t = e.wheelDelta || -e.detail
  3723. , i = t > 0 ? this.dollyOut : this.dollyIn;
  3724. i.call(this),
  3725. this.update()
  3726. }
  3727. }
  3728. ,
  3729. n.prototype.onKeyDown = function(e) {
  3730. this.enabled && (e.metaKey || e.ctrlKey || (e.preventDefault(),
  3731. this.handleKeyDown(e.which)))
  3732. }
  3733. ,
  3734. n.prototype.navRotationAcc = function(e, t) {
  3735. "y" === e ? this.noRotateUpDown ? this.keyboardZoomSpeed = t : this.rotationAcceleration.y = t : this.rotationAcceleration.x = t
  3736. }
  3737. ,
  3738. n.prototype.navPanAcc = function(e, t) {
  3739. this.stopAutoPanning(),
  3740. this.panAcceleration[e] = t
  3741. }
  3742. ,
  3743. n.prototype.handleKeyDown = function(e) {
  3744. var t = !0;
  3745. switch (e) {
  3746. case u.UPARROW:
  3747. case u.I:
  3748. this.navRotationAcc("y", 1);
  3749. break;
  3750. case u.DOWNARROW:
  3751. case u.K:
  3752. this.navRotationAcc("y", -1);
  3753. break;
  3754. case u.LEFTARROW:
  3755. case u.J:
  3756. this.navRotationAcc("x", -1);
  3757. break;
  3758. case u.RIGHTARROW:
  3759. case u.L:
  3760. this.navRotationAcc("x", 1);
  3761. break;
  3762. case u.W:
  3763. this.navPanAcc("y", 1);
  3764. break;
  3765. case u.S:
  3766. this.navPanAcc("y", -1);
  3767. break;
  3768. case u.A:
  3769. this.navPanAcc("x", -1);
  3770. break;
  3771. case u.D:
  3772. this.navPanAcc("x", 1);
  3773. break;
  3774. default:
  3775. t = !1
  3776. }
  3777. t && this.emit(d.Move, "key")
  3778. }
  3779. ,
  3780. n.prototype.onKeyUp = function(e) {
  3781. this.enabled && (e.preventDefault(),
  3782. e.stopPropagation(),
  3783. this.handleKeyUp(e.which))
  3784. }
  3785. ,
  3786. n.prototype.handleKeyUp = function(e) {
  3787. switch (e) {
  3788. case u.I:
  3789. case u.K:
  3790. case u.UPARROW:
  3791. case u.DOWNARROW:
  3792. this.keyboardZoomSpeed = 0,
  3793. this.rotationAcceleration.y = 0;
  3794. break;
  3795. case u.J:
  3796. case u.L:
  3797. case u.LEFTARROW:
  3798. case u.RIGHTARROW:
  3799. this.rotationAcceleration.x = 0;
  3800. break;
  3801. case u.S:
  3802. case u.W:
  3803. this.panAcceleration.y = 0;
  3804. break;
  3805. case u.A:
  3806. case u.D:
  3807. this.panAcceleration.x = 0
  3808. }
  3809. }
  3810. ,
  3811. n.prototype.onTouchStart = function(e) {
  3812. if (this.enabled || this.state === c.NONE) {
  3813. e.preventDefault(),
  3814. e.stopPropagation(),
  3815. this.stopAutoPanning();
  3816. var t = function() {
  3817. if (2 === e.touches.length) {
  3818. var t = e.touches[0].pageX - e.touches[1].pageX
  3819. , i = e.touches[0].pageY - e.touches[1].pageY;
  3820. this.dollyStart.set(t, i)
  3821. }
  3822. }
  3823. .bind(this)
  3824. , i = function() {
  3825. this.panStart.set(a.average(e.touches, "pageX"), a.average(e.touches, "pageY"))
  3826. }
  3827. .bind(this)
  3828. , n = function() {
  3829. this.rotateStart.set(a.average(e.touches, "pageX"), a.average(e.touches, "pageY"))
  3830. }
  3831. .bind(this);
  3832. switch (this.state = this.touchActions[e.touches.length],
  3833. this.state) {
  3834. case c.PAN_DOLLY:
  3835. t();
  3836. case c.PAN:
  3837. i();
  3838. break;
  3839. case c.ROTATE_DOLLY:
  3840. t();
  3841. case c.ROTATE:
  3842. n()
  3843. }
  3844. this.rotationSpeed.set(0, 0),
  3845. this.emit(d.InputStart, "touch")
  3846. }
  3847. }
  3848. ,
  3849. n.prototype.onTouchMove = function(e) {
  3850. if (this.enabled && this.state !== c.NONE) {
  3851. e.preventDefault(),
  3852. e.stopPropagation();
  3853. var t = function() {
  3854. var t = e.touches[0].pageX - e.touches[1].pageX
  3855. , i = e.touches[0].pageY - e.touches[1].pageY;
  3856. this.dollyEnd.set(t, i);
  3857. var n = this.dollyStart.length() - this.dollyEnd.length();
  3858. n > 0 ? this.dollyOut(1 + n / 500) : this.dollyIn(1 - n / 500),
  3859. this.dollyStart.copy(this.dollyEnd)
  3860. }
  3861. .bind(this)
  3862. , i = function() {
  3863. this.panEnd.set(a.average(e.touches, "pageX"), a.average(e.touches, "pageY")),
  3864. this.panDelta.subVectors(this.panEnd, this.panStart),
  3865. this.pan(this.panDelta.x, this.panDelta.y),
  3866. this.panStart.copy(this.panEnd),
  3867. this.rotateDelta.set(0, 0)
  3868. }
  3869. .bind(this)
  3870. , n = function() {
  3871. this.rotateEnd.set(a.average(e.touches, "pageX"), a.average(e.touches, "pageY")),
  3872. this.rotateDelta.subVectors(this.rotateEnd, this.rotateStart),
  3873. this.rotateLeft(2 * Math.PI * this.rotateDelta.x / $("#player").width() * this.rotateSpeed),
  3874. this.rotateUp(2 * Math.PI * this.rotateDelta.y / $("#player").height() * this.rotateSpeed),
  3875. this.rotateStart.copy(this.rotateEnd)
  3876. }
  3877. .bind(this)
  3878. , r = function() {
  3879. if (2 === e.touches.length) {
  3880. var i = window.devicePixelRatio || 1
  3881. , r = e.touches[1].pageX - e.touches[0].pageX
  3882. , s = e.touches[1].pageY - e.touches[0].pageY
  3883. , l = Math.sqrt(r * r + s * s)
  3884. , h = Math.abs(this.dollyStart.length() - l);
  3885. if (h > o.input.touchMoveThreshold * i)
  3886. this.state = c.DOLLY,
  3887. t();
  3888. else {
  3889. var u = a.average(e.touches, "pageX")
  3890. , d = a.average(e.touches, "pageY")
  3891. , p = this.rotateDelta.set(u, d).sub(this.rotateStart).length();
  3892. p > o.input.touchMoveThreshold && (this.state = c.ROTATE,
  3893. this.rotateStart.set(u, d),
  3894. n())
  3895. }
  3896. }
  3897. }
  3898. .bind(this);
  3899. switch (this.state) {
  3900. case c.PAN_DOLLY:
  3901. t();
  3902. case c.PAN:
  3903. i();
  3904. break;
  3905. case c.ROTATE_DOLLY:
  3906. r();
  3907. break;
  3908. case c.DOLLY:
  3909. t();
  3910. break;
  3911. case c.ROTATE:
  3912. n();
  3913. break;
  3914. default:
  3915. this.state = c.NONE
  3916. }
  3917. this.lastMoveTime = e.timeStamp,
  3918. this.emit(d.Move, "touch")
  3919. }
  3920. }
  3921. ,
  3922. n.prototype.onTouchEnd = function(e) {
  3923. this.enabled && (this.state === c.ROTATE && (e.timeStamp > this.lastMoveTime + 100 ? (this.rotationSpeed.set(0, 0),
  3924. this.rotationAcceleration.set(0, 0)) : this.rotationAcceleration.set(-this.rotateDelta.x, this.rotateDelta.y)),
  3925. this.state = c.NONE,
  3926. this.update(),
  3927. this.rotationAcceleration.set(0, 0),
  3928. this.rotateDelta.set(0, 0))
  3929. }
  3930. ,
  3931. n.prototype.onPointerDown = function(e) {
  3932. this.enabled && ("touch" === e.pointerType && (this.pointers.length < this.pointersLimit && this.pointers.push({
  3933. id: e.pointerId,
  3934. pageX: e.pageX,
  3935. pageY: e.pageY
  3936. }),
  3937. e.touches = this.pointers,
  3938. this.onTouchStart(e)),
  3939. this.emit(d.InputStart, "pointer"))
  3940. }
  3941. ,
  3942. n.prototype.onPointerMove = function(e) {
  3943. this.enabled && "touch" === e.pointerType && (this.pointers.forEach(function(t) {
  3944. e.pointerId === t.id && (t.pageX = e.pageX,
  3945. t.pageY = e.pageY)
  3946. }),
  3947. e.touches = this.pointers,
  3948. this.onTouchMove(e))
  3949. }
  3950. ,
  3951. n.prototype.onPointerUp = function(e) {
  3952. this.enabled && "touch" === e.pointerType && (this.pointers.forEach(function(t, i) {
  3953. e.pointerId === t.id && this.pointers.splice(i, 1)
  3954. }
  3955. .bind(this)),
  3956. e.touches = this.pointers,
  3957. this.onTouchEnd(e))
  3958. }
  3959. ,
  3960. n.prototype.reset = function() {
  3961. this.state = c.NONE,
  3962. this.stopAutoPanning(),
  3963. this.rotationSpeed.set(0, 0),
  3964. this.rotationAcceleration.set(0, 0),
  3965. this.panSpeed.set(0, 0),
  3966. this.panAcceleration.set(0, 0)
  3967. }
  3968. ,
  3969. n.prototype.toJSON = function() {
  3970. var e = {
  3971. camera_position: {
  3972. x: s.toPrecision(this.camera.position.x, 4),
  3973. y: s.toPrecision(this.camera.position.y, 4),
  3974. z: s.toPrecision(this.camera.position.z, 4)
  3975. },
  3976. camera_quaternion: {
  3977. x: s.toPrecision(this.camera.quaternion.x, 4),
  3978. y: s.toPrecision(this.camera.quaternion.y, 4),
  3979. z: s.toPrecision(this.camera.quaternion.z, 4),
  3980. w: s.toPrecision(this.camera.quaternion.w, 4)
  3981. }
  3982. };
  3983. return e
  3984. }
  3985. ,
  3986. t.exports = n
  3987. }
  3988. , {
  3989. "../enum/ControlActions": 20,
  3990. "../enum/ControlEvents": 21,
  3991. "../enum/Keys": 30,
  3992. "../enum/MouseButton": 34,
  3993. "../enum/Vectors": 50,
  3994. "../settings": 166,
  3995. "../util/common": 185,
  3996. "../util/math": 190,
  3997. events: 202,
  3998. three: 217
  3999. }],
  4000. 13: [function(e, t, i) {
  4001. (function(i) {
  4002. "use strict";
  4003. function n(e) {
  4004. this.camera = e,
  4005. this.camera.controls = this,
  4006. this.target = new r.Vector3(0,0,0),
  4007. this.lookVector = new r.Vector3,
  4008. this.lookSpeed = .05,
  4009. this.rotationAcc = new r.Vector2,
  4010. this.rotationSpeed = new r.Vector2,
  4011. this.lat = 0,
  4012. this.lon = 0,
  4013. this.phi = 0,
  4014. this.theta = 0,
  4015. this.enabled = !1,
  4016. this.locked = !1,
  4017. this.pointer = new r.Vector2(0,0),
  4018. this.rotationHistory = [],
  4019. this.rotationDifference = new r.Vector2,
  4020. this.pointerDragOn = !1,
  4021. this.pointerDragStart = new r.Vector2(0,0),
  4022. this.pinchDistance = 0,
  4023. this.moveStart = new r.Vector2,
  4024. this.moveTolerance = .01,
  4025. this.pointersLimit = 2,
  4026. this.pointers = []
  4027. }
  4028. var r = e("three")
  4029. , o = e("../util/logger")
  4030. , a = e("../settings")
  4031. , s = e("../util/common")
  4032. , l = e("../util/math")
  4033. , c = (e("../enum/Vectors"),
  4034. e("../enum/MouseButton"))
  4035. , h = e("../enum/Keys")
  4036. , u = e("../enum/ControlEvents")
  4037. , d = e("events").EventEmitter;
  4038. new o(i);
  4039. n.prototype = Object.create(d.prototype),
  4040. n.prototype.usable = function() {
  4041. return this.enabled && !this.locked
  4042. }
  4043. ,
  4044. n.prototype.lookAt = function(e) {
  4045. var t = this.camera.position.clone().sub(e)
  4046. , i = Math.atan(t.z / t.x);
  4047. i += t.x < 0 ? Math.PI : 0,
  4048. i += t.x > 0 && t.z < 0 ? 2 * Math.PI : 0,
  4049. this.lon = r.Math.radToDeg(i) + 180;
  4050. var n = Math.sqrt(t.x * t.x + t.z * t.z)
  4051. , o = Math.atan(t.y / n);
  4052. this.lat = -r.Math.radToDeg(o)
  4053. }
  4054. ,
  4055. n.prototype.startRotationFrom = function(e, t) {
  4056. l.convertScreenPositionToNDC(e, t, this.pointer),
  4057. this.pointerDragOn = !0,
  4058. this.pointerDragStart.copy(this.pointer),
  4059. this.moveStart.copy(this.pointer),
  4060. this.rotationHistory = [],
  4061. this.rotationSpeed.set(0, 0)
  4062. }
  4063. ,
  4064. n.prototype.onMouseOver = function(e) {
  4065. !this.pointerDragOn || 0 !== e.which && 0 !== e.buttons || this.onMouseUp(e)
  4066. }
  4067. ,
  4068. n.prototype.onTouchStart = function(e) {
  4069. if (this.usable()) {
  4070. switch (e.preventDefault(),
  4071. e.stopPropagation(),
  4072. e.touches.length) {
  4073. case 1:
  4074. this.startRotationFrom(e.touches[0].clientX, e.touches[0].clientY);
  4075. break;
  4076. case 2:
  4077. var t = (e.touches[0].clientX - e.touches[1].clientX) / $("#player").width()
  4078. , i = (e.touches[0].clientY - e.touches[1].clientY) / $("#player").height();
  4079. this.pinchDistance = Math.sqrt(t * t + i * i)
  4080. }
  4081. this.emit(u.InputStart, "touch")
  4082. }
  4083. }
  4084. ,
  4085. n.prototype.onPointerDown = function(e) {
  4086. this.usable() && "touch" === e.pointerType && (this.pointers.length < this.pointersLimit && this.pointers.push({
  4087. id: e.pointerId,
  4088. clientX: e.clientX,
  4089. clientY: e.clientY
  4090. }),
  4091. e.touches = this.pointers,
  4092. this.onTouchStart(e),
  4093. this.emit(u.InputStart, "pointer"))
  4094. }
  4095. ,
  4096. n.prototype.onMouseDown = function(e) {
  4097. if (this.usable()) {
  4098. switch (e.preventDefault(),
  4099. e.stopPropagation(),
  4100. e.button) {
  4101. case c.LEFT:
  4102. this.startRotationFrom(e.clientX, e.clientY)
  4103. }
  4104. this.emit(u.InputStart, "mouse")
  4105. }
  4106. }
  4107. ,
  4108. n.prototype.updateRotation = function() {
  4109. if (this.usable() && this.pointerDragOn) {
  4110. var e = new r.Vector3(this.pointerDragStart.x,this.pointerDragStart.y,-1).unproject(this.camera)
  4111. , t = new r.Vector3(this.pointer.x,this.pointer.y,-1).unproject(this.camera)
  4112. , i = Math.sqrt(e.x * e.x + e.z * e.z)
  4113. , n = Math.sqrt(t.x * t.x + t.z * t.z)
  4114. , o = Math.atan2(e.y, i)
  4115. , a = Math.atan2(t.y, n);
  4116. this.rotationDifference.y = r.Math.radToDeg(o - a),
  4117. e.y = 0,
  4118. t.y = 0;
  4119. var s = Math.acos(e.dot(t) / e.length() / t.length());
  4120. isNaN(s) || (this.rotationDifference.x = r.Math.radToDeg(s),
  4121. this.pointerDragStart.x < this.pointer.x && (this.rotationDifference.x *= -1)),
  4122. this.pointerDragStart.copy(this.pointer)
  4123. }
  4124. }
  4125. ,
  4126. n.prototype.onMouseMove = function(e) {
  4127. this.usable() && (l.convertScreenPositionToNDC(e.clientX, e.clientY, this.pointer),
  4128. 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"))
  4129. }
  4130. ,
  4131. n.prototype.onTouchMove = function(e) {
  4132. if (this.usable())
  4133. switch (this.emit(u.Move, "touch"),
  4134. e.touches.length) {
  4135. case 1:
  4136. l.convertScreenPositionToNDC(e.touches[0].clientX, e.touches[0].clientY, this.pointer);
  4137. break;
  4138. case 2:
  4139. var t = (e.touches[0].clientX - e.touches[1].clientX) / $("#player").width()
  4140. , i = (e.touches[0].clientY - e.touches[1].clientY) / $("#player").height()
  4141. , n = this.pinchDistance - Math.sqrt(t * t + i * i);
  4142. Math.abs(n) > .01 && (this.emit(u.InteractionDirect),
  4143. this.emit(u.Pinch, n),
  4144. this.pinchDistance -= n)
  4145. }
  4146. }
  4147. ,
  4148. n.prototype.onPointerMove = function(e) {
  4149. this.usable() && "touch" === e.pointerType && (this.pointers.forEach(function(t) {
  4150. e.pointerId === t.id && (t.clientX = e.clientX,
  4151. t.clientY = e.clientY)
  4152. }),
  4153. e.touches = this.pointers,
  4154. this.onTouchMove(e))
  4155. }
  4156. ,
  4157. n.prototype.endRotation = function() {
  4158. this.pointerDragOn = !1;
  4159. var e = s.averageVectors(this.rotationHistory);
  4160. this.rotationSpeed.set(e.x * a.rotationAfterMoveMultiplier, e.y * a.rotationAfterMoveMultiplier)
  4161. }
  4162. ,
  4163. n.prototype.onTouchEnd = function(e) {
  4164. this.usable() && (e.preventDefault(),
  4165. e.stopPropagation(),
  4166. this.endRotation())
  4167. }
  4168. ,
  4169. n.prototype.onMouseUp = function(e) {
  4170. this.usable() && (e.preventDefault(),
  4171. e.stopPropagation(),
  4172. this.endRotation())
  4173. }
  4174. ,
  4175. n.prototype.onPointerUp = function(e) {
  4176. this.usable() && "touch" === e.pointerType && (this.pointers.forEach(function(t, i) {
  4177. e.pointerId === t.id && this.pointers.splice(i, 1)
  4178. }
  4179. .bind(this)),
  4180. e.touches = this.pointers,
  4181. this.onTouchEnd(e))
  4182. }
  4183. ,
  4184. n.prototype.update = function(e) {
  4185. this.lon,
  4186. this.lat;
  4187. for (this.updateRotation(),
  4188. this.rotationHistory.push(this.rotationDifference.clone()); this.rotationHistory.length > a.rotationAfterMoveHistoryCount; )
  4189. this.rotationHistory.shift();
  4190. this.lon += this.rotationDifference.x,
  4191. this.lat += this.rotationDifference.y,
  4192. this.rotationDifference.set(0, 0),
  4193. this.rotationSpeed.x = this.rotationSpeed.x * (1 - a.rotationFriction) + this.rotationAcc.x * a.rotationAccelerationInside,
  4194. this.rotationSpeed.y = this.rotationSpeed.y * (1 - a.rotationFriction) + this.rotationAcc.y * a.rotationAccelerationInside,
  4195. this.lon += this.rotationSpeed.x * e,
  4196. this.lat += this.rotationSpeed.y * e,
  4197. this.lat = Math.max(a.insideLookLimitDown, Math.min(a.insideLookLimitUp, this.lat)),
  4198. this.phi = r.Math.degToRad(90 - this.lat),
  4199. this.theta = r.Math.degToRad(this.lon),
  4200. this.lookVector.x = Math.sin(this.phi) * Math.cos(this.theta),
  4201. this.lookVector.y = Math.cos(this.phi),
  4202. this.lookVector.z = Math.sin(this.phi) * Math.sin(this.theta),
  4203. this.target.copy(this.lookVector).add(this.camera.position),
  4204. this.camera.lookAt(this.target)
  4205. }
  4206. ,
  4207. n.prototype.onMouseWheel = function(e) {
  4208. if (this.usable()) {
  4209. var t = e.wheelDelta || -e.detail;
  4210. this.emit(u.InteractionDirect),
  4211. this.emit(u.Scroll, t)
  4212. }
  4213. }
  4214. ,
  4215. n.prototype.onKeyDown = function(e) {
  4216. this.usable() && (e.metaKey || e.ctrlKey || (e.preventDefault(),
  4217. this.handleKeyDown(e.which)))
  4218. }
  4219. ,
  4220. n.prototype.handleKeyDown = function(e) {
  4221. var t = function(e, t) {
  4222. this.rotationAcc[e] = t
  4223. }
  4224. .bind(this);
  4225. this.emit(u.InteractionKey);
  4226. var i = !0;
  4227. switch (e) {
  4228. case h.LEFTARROW:
  4229. case h.J:
  4230. t("x", -1);
  4231. break;
  4232. case h.RIGHTARROW:
  4233. case h.L:
  4234. t("x", 1);
  4235. break;
  4236. case h.I:
  4237. t("y", 1);
  4238. break;
  4239. case h.K:
  4240. t("y", -1);
  4241. break;
  4242. default:
  4243. i = !1
  4244. }
  4245. i && this.emit(u.Move, "key")
  4246. }
  4247. ,
  4248. n.prototype.onKeyUp = function(e) {
  4249. this.usable() && (e.preventDefault(),
  4250. e.stopPropagation(),
  4251. this.handleKeyUp(e.which))
  4252. }
  4253. ,
  4254. n.prototype.handleKeyUp = function(e) {
  4255. switch (e) {
  4256. case h.LEFTARROW:
  4257. case h.J:
  4258. case h.RIGHTARROW:
  4259. case h.L:
  4260. this.rotationAcc.x = 0;
  4261. break;
  4262. case h.I:
  4263. case h.K:
  4264. this.rotationAcc.y = 0
  4265. }
  4266. }
  4267. ,
  4268. n.prototype.startRotating = function(e, t) {
  4269. e && (this.rotationAcc.x = e),
  4270. t && (this.rotationAcc.y = t)
  4271. }
  4272. ,
  4273. n.prototype.stopRotating = function(e) {
  4274. e && (this.rotationSpeed.x = this.rotationSpeed.y = 0),
  4275. this.rotationAcc.set(0, 0)
  4276. }
  4277. ,
  4278. n.prototype.reset = function() {
  4279. this.pointerDragOn = !1,
  4280. this.rotationAcc.set(0, 0),
  4281. this.rotationSpeed.set(0, 0),
  4282. this.pointers = []
  4283. }
  4284. ,
  4285. n.prototype.toJSON = function() {
  4286. var e = {
  4287. camera_position: {
  4288. x: l.toPrecision(this.camera.position.x, 4),
  4289. y: l.toPrecision(this.camera.position.y, 4),
  4290. z: l.toPrecision(this.camera.position.z, 4)
  4291. },
  4292. camera_quaternion: {
  4293. x: l.toPrecision(this.camera.quaternion.x, 4),
  4294. y: l.toPrecision(this.camera.quaternion.y, 4),
  4295. z: l.toPrecision(this.camera.quaternion.z, 4),
  4296. w: l.toPrecision(this.camera.quaternion.w, 4)
  4297. }
  4298. };
  4299. return e
  4300. }
  4301. ,
  4302. n.prototype.setStateFromJSON = function(e) {
  4303. this.camera.position.copy(e.camera_position),
  4304. this.camera.quaternion.copy(e.camera_quaternion)
  4305. }
  4306. ,
  4307. t.exports = n
  4308. }
  4309. ).call(this, "/js/controls/PanoramaControls.js")
  4310. }
  4311. , {
  4312. "../enum/ControlEvents": 21,
  4313. "../enum/Keys": 30,
  4314. "../enum/MouseButton": 34,
  4315. "../enum/Vectors": 50,
  4316. "../settings": 166,
  4317. "../util/common": 185,
  4318. "../util/logger": 189,
  4319. "../util/math": 190,
  4320. events: 202,
  4321. three: 217
  4322. }],
  4323. 14: [function(e, t, i) {
  4324. (function(i) {
  4325. "use strict";
  4326. var n = e("three")
  4327. , r = e("../enum/Viewmode")
  4328. , o = e("../util/logger")
  4329. , a = new o(i);
  4330. t.exports = {
  4331. serialize: function(e) {
  4332. return encodeURI(JSON.stringify(e))
  4333. },
  4334. deserialize: function(e) {
  4335. function t(e) {
  4336. function t(e, t) {
  4337. return e && "number" == typeof t && !isNaN(t)
  4338. }
  4339. return e.reduce(t, !0)
  4340. }
  4341. try {
  4342. var i = JSON.parse(decodeURI(e))
  4343. , o = {
  4344. mode: r.fromInt(i.camera_mode),
  4345. panoId: i.scan_id,
  4346. position: (new n.Vector3).copy(i.camera_position),
  4347. quaternion: (new n.Quaternion).copy(i.camera_quaternion),
  4348. zoom: i.ortho_zoom,
  4349. floorVisibility: i.floor_visibility
  4350. }
  4351. , s = o.position;
  4352. t([s.x, s.y, s.z]) || o.position.set(0, 0, 0);
  4353. var l = o.quaternion;
  4354. return t([l.x, l.y, l.z, l.w]) || o.quaternion.set(0, 0, 0, 1),
  4355. o
  4356. } catch (i) {
  4357. a.debug("Not able to parse start location as JSON; falling back to old array style parsing");
  4358. try {
  4359. var c = e.split(",")
  4360. , h = {
  4361. x: parseFloat(c[2]),
  4362. y: parseFloat(c[3]),
  4363. z: parseFloat(c[4])
  4364. }
  4365. , u = {
  4366. x: parseFloat(c[5]),
  4367. y: parseFloat(c[6]),
  4368. z: parseFloat(c[7]),
  4369. w: parseFloat(c[8])
  4370. };
  4371. return t([h.x, h.y, h.z]) || (h.x = 0,
  4372. h.y = 0,
  4373. h.z = 0),
  4374. t([u.x, u.y, u.z, u.w]) || (u.x = 0,
  4375. u.y = 0,
  4376. u.z = 0,
  4377. u.w = 1),
  4378. {
  4379. mode: r.fromInt(c[0]),
  4380. panoId: c[1],
  4381. position: (new n.Vector3).copy(h),
  4382. quaternion: (new n.Quaternion).copy(u)
  4383. }
  4384. } catch (t) {
  4385. a.warn('Invalid start override, ignoring: "' + e + '"', t.message)
  4386. }
  4387. }
  4388. return null
  4389. }
  4390. }
  4391. }
  4392. ).call(this, "/js/controls/serializer.js")
  4393. }
  4394. , {
  4395. "../enum/Viewmode": 51,
  4396. "../util/logger": 189,
  4397. three: 217
  4398. }],
  4399. 15: [function(e, t, i) {
  4400. (function(i) {
  4401. "use strict";
  4402. function n() {
  4403. this.endlessLoop = a.warp.loop,
  4404. this.clock = new r.Clock(!0),
  4405. this.model = null,
  4406. this.player = null,
  4407. this.currentItem = null,
  4408. this.destinationItem = null,
  4409. this.tourIsPlaying = !1,
  4410. this.transitionStage = y.None,
  4411. this.nextFunc = null,
  4412. this.onTheBus = !1,
  4413. this.tourInProgress = !1,
  4414. this.reachSource = null,
  4415. this.interrupted = !1,
  4416. this.nItems = 0,
  4417. this.walkingSectionPaused = !1
  4418. }
  4419. var r = e("three")
  4420. , o = e("./util/logger")
  4421. , a = e("./settings")
  4422. , s = e("./util/transitions")
  4423. , l = e("events").EventEmitter
  4424. , c = e("./enum/Viewmode")
  4425. , h = e("./analytics")
  4426. , u = e("./enum/WarpStyle")
  4427. , s = e("./util/transitions")
  4428. , d = (e("./model/ModelManager"),
  4429. e("./enum/ModelManagerEvents"))
  4430. , p = e("./enum/DirectorEvents")
  4431. , f = e("./enum/PlayerEvents")
  4432. , g = (e("./enum/ControlEvents"),
  4433. e("./enum/BlackoutStyle"))
  4434. , m = e("./enum/PathDiscardMode")
  4435. , v = e("./enum/PathDisplayMode")
  4436. , A = (e("./player"),
  4437. new o(i))
  4438. , y = Object.freeze({
  4439. None: 0,
  4440. Moving: 1,
  4441. Aiming: 2,
  4442. Interlude: 3
  4443. })
  4444. , C = Object.freeze({
  4445. Forward: 1,
  4446. NoChange: 0,
  4447. Backwards: -1
  4448. })
  4449. , I = s.getUniqueId();
  4450. n.prototype = Object.create(l.prototype),
  4451. n.prototype.init = function(e, t) {
  4452. this.player = e,
  4453. this.modelManager = t,
  4454. this.updateModel(),
  4455. this.resetAll(),
  4456. this.bindEvents()
  4457. }
  4458. ,
  4459. n.prototype.resetAll = function() {
  4460. if (this.currentItem = null,
  4461. this.destinationItem = null,
  4462. this.tourIsPlaying = !1,
  4463. this.bgmReplay(),//xzw
  4464. this.transitionStage = y.None,
  4465. this.nextFunc = null,
  4466. this.onTheBus = !1,
  4467. this.reachSource = null,
  4468. this.interrupted = !1,
  4469. this.model) {
  4470. var e = a.path.typ === u.WALK ? u.WALK : u.STD;
  4471. this.defaultWarpStyle = this.model.data.hasOwnProperty("player_options") && this.model.data.player_options && this.model.data.player_options.fast_transitions === !1 ? e : u.BLACK
  4472. } else
  4473. this.defaultWarpStyle = u.BLACK,
  4474. A.warn('No model yet, choosing "' + this.defaultWarpStyle + '" transitions');
  4475. this.resetSpecialTransition()
  4476. }
  4477. ,
  4478. n.prototype.updateModel = function() {
  4479. this.model = this.modelManager.getActiveModel(),
  4480. this.nItems = this.model.heroLocations.length
  4481. }
  4482. ,
  4483. n.prototype.bindEvents = function() {
  4484. this.modelManager.on(d.ActiveModelChanged, this.updateModel.bind(this)),
  4485. this.player.on(f.WarpInterruptedWithFlyTo, this.checkAndHandleWalkingtourInterruption.bind(this)),
  4486. this.player.on(f.Move, this.handlePlayerMove.bind(this)),
  4487. this.player.on(f.PanoChosen, this.handlePlayerPanoChosen.bind(this)),
  4488. this.player.on(f.ModeChanged, this.handlePlayerModeChanged.bind(this)),
  4489. this.player.on(f.InputStart, this.handlePlayerInputStart.bind(this)),
  4490. this.player.on(f.FlyingStarted, this.handlePlayerFlyingStarted.bind(this)),
  4491. this.player.once(f.Move, function() {
  4492. s.cancelById(I)
  4493. })
  4494. }
  4495. ,
  4496. n.prototype.checkAndHandleWalkingtourInterruption = function(e) {
  4497. return e === u.WALK && (this.interrupt(g.NONE),
  4498. this.pauseWalkingSection(),
  4499. this.player.fastForwardActivePanoFlight(),
  4500. !0)
  4501. }
  4502. ,
  4503. n.prototype.handlePlayerMove = function(e) {
  4504. this.transitionStage === y.Interlude && this.interrupt(g.NONE),
  4505. this.emit("update.controls")
  4506. }
  4507. ,
  4508. n.prototype.handlePlayerPanoChosen = function(e, t) {
  4509. this.intermediateState() || e.id === t.id || (this.onTheBus = !1,
  4510. this.emit("update.controls"))
  4511. }
  4512. ,
  4513. n.prototype.handlePlayerModeChanged = function(e, t) {
  4514. this.intermediateState() || e === t || (this.onTheBus = !1,
  4515. this.emit("update.controls"))
  4516. }
  4517. ,
  4518. n.prototype.handlePlayerInputStart = function(e) {
  4519. this.transitionStage === y.Interlude && this.interrupt(g.NONE)
  4520. }
  4521. ,
  4522. n.prototype.handlePlayerFlyingStarted = function() {
  4523. this.clearWalkingSectionPaused()
  4524. }
  4525. ,
  4526. n.prototype.describe = function() {
  4527. return {
  4528. nItems: this.nItems,
  4529. currentItem: this.currentItem,
  4530. destinationItem: this.destinationItem,
  4531. tourIsPlaying: this.tourIsPlaying,
  4532. onTheBus: this.onTheBus,
  4533. endlessLoop: this.endlessLoop,
  4534. viewMode: this.player.mode,
  4535. inTransition: this._inTransition(),
  4536. transitionStage: this.transitionStage,
  4537. tourInProgress: this.tourInProgress
  4538. }
  4539. }
  4540. ,
  4541. n.prototype._inTransition = function() {
  4542. return this.player.flying || this.player.isWarping() || this.player.isWaitingToWarp() || this.player.mode === c.TRANSITIONING || this.tourIsPlaying
  4543. }
  4544. ,
  4545. n.prototype.bounceable = function() {
  4546. var e = this.clock.getDelta();
  4547. return this.isInterrupted() || e < .9 && e > .01 || this.player.flying && !this.player.isWarping()
  4548. }
  4549. ,
  4550. n.prototype.currentMoveDirection = function() {
  4551. return null === this.currentItem || void 0 === this.currentItem ? C.Forward : this.destinationItem === this.currentItem ? C.NoChange : this.destinationItem > this.currentItem ? C.Forward : C.Backwards
  4552. }
  4553. ,
  4554. n.prototype.clearPath = function() {
  4555. this._inTransition() || this.player.path.discardPathObject()
  4556. }
  4557. ,
  4558. n.prototype.allFloors = function() {
  4559. this.model.toggleAllFloors()
  4560. }
  4561. ,
  4562. n.prototype.actionComplete = function(e) {
  4563. if (this.interrupted = !1,
  4564. this.transitionStage = y.None,
  4565. this.resetSpecialTransition(),
  4566. null !== this.destinationItem && this.setCurrentItem(this.destinationItem),
  4567. this.tourIsPlaying || (this.player.disablePreRendering(),
  4568. this.player.mode === c.PANORAMA && this.player.currentPano.isAligned() && this.model.fadePanoMarkers()),
  4569. this.emit("update.controls"),
  4570. this.nextFunc) {
  4571. var t = this.nextFunc;
  4572. this.nextFunc = null,
  4573. t()
  4574. }
  4575. }
  4576. ,
  4577. n.prototype.awaitCompletion = function(e, t) {
  4578. this.nextFunc = t,
  4579. e()
  4580. }
  4581. ,
  4582. n.prototype.updateSuccessFunction = function(e) {
  4583. this.nextFunc = e
  4584. }
  4585. ,
  4586. n.prototype.interrupt = function(e, t) {
  4587. return !!this.wouldInterrupt() && (this.tourIsPlaying && (this.player.zoomEnabled = this.wasZoomEnabled),
  4588. this.tourIsPlaying = !1,
  4589. this.bgmReplay(),//xzw
  4590. this.interrupted = !0,
  4591. this.nextFunc = null,
  4592. this.emit(p.ActionInterrupted),
  4593. null !== e && void 0 !== e || (e = g.BEGINNING),
  4594. this.player.interruptAndFastForward(e, t),
  4595. !0)
  4596. }
  4597. ,
  4598. n.prototype.wouldInterrupt = function() {
  4599. return this.transitionStage !== y.None
  4600. }
  4601. ,
  4602. n.prototype.intermediateState = function() {
  4603. return this.transitionStage !== y.None
  4604. }
  4605. ,
  4606. n.prototype.isInterrupted = function() {
  4607. return this.interrupted
  4608. }
  4609. ,
  4610. n.prototype.pauseWalkingSection = function() {
  4611. this.walkingSectionPaused = !0
  4612. }
  4613. ,
  4614. n.prototype.clearWalkingSectionPaused = function() {
  4615. this.walkingSectionPaused = !1
  4616. }
  4617. ,
  4618. n.prototype.autoTour = function() {
  4619. var e = Date.now();
  4620. this.model.auxDataPromise.then(function() {
  4621. e = Date.now() - e;
  4622. var t = a.warp.auto
  4623. , i = this.model.data && this.model.data.player_options /* && this.model.data.player_options.highlight_reel */;
  4624. t >= 0 && this.model.heroCount() > 1 && i && s.trigger({
  4625. duration: Math.max(1e3 * Math.min(300, t) - e, 0),
  4626. done: function() {
  4627. this.playTour()
  4628. }
  4629. .bind(this),
  4630. name: "_atr",
  4631. id: I
  4632. })
  4633. }
  4634. .bind(this))
  4635. }
  4636. ,
  4637. n.prototype.atDestinationPano = function() {
  4638. if (!this.player.currentPano || null === this.destinationItem)
  4639. return !1;
  4640. var e = this.player.currentPano.id;
  4641. if (void 0 === e)
  4642. return !1;
  4643. var t = this.model.heroLocations;
  4644. return null !== this.destinationItem && void 0 !== t[this.destinationItem] && e === t[this.destinationItem].panoId
  4645. }
  4646. ,
  4647. n.prototype.redirectToItem = function(e, t) {
  4648. if (null === e || void 0 === e)
  4649. return void A.warn("Director.redirectToItem() -> Redirecting to null item.");
  4650. if (!this.wouldInterrupt())
  4651. return void A.warn("Director.redirectToItem() -> Director cannot redirect if there is nothing to interrupt.");
  4652. if (this.player.mode === c.TRANSITIONING)
  4653. return void A.debug("Director.redirectToItem() -> Cannot redirect while transitioning.");
  4654. A.debug("Director.redirectToItem() -> Redirecting to " + e + " via " + t);
  4655. var i = function() {
  4656. s.setTimeout(function() {
  4657. this.setDestinationItem(e),
  4658. this.goToDestination(!0, g.BEGINNING, a.warp.warpInterruptionRedirectTime, !1)
  4659. }
  4660. .bind(this), 0)
  4661. }
  4662. .bind(this);
  4663. this.interrupt(g.END, 0),
  4664. this.updateSuccessFunction(i)
  4665. }
  4666. ,
  4667. n.prototype.useSpecialTransition = function(e) {
  4668. void 0 !== e && this.defaultWarpStyle !== u.BLACK && A.debug("useSpecialTransition(): " + e),
  4669. this.nextWarpStyle = u.BLACK
  4670. }
  4671. ,
  4672. n.prototype.resetSpecialTransition = function() {
  4673. this.nextWarpStyle = this.defaultWarpStyle
  4674. }
  4675. ,
  4676. n.prototype.arrivedAtDestination = function(e) {
  4677. if (this.player.flying || this.player.isWarping())
  4678. A.warn("Cannot advance to interlude or aiming while player is flying or warping.");
  4679. else {
  4680. this.transitionStage = y.Aiming;
  4681. var t = this.tourIsPlaying ? this.tourInterlude.bind(this, this.nextItem(this.currentItem)) : null;
  4682. this.player.model.fadePanoMarkers(0),
  4683. this.awaitCompletion(function() {
  4684. this.resetSpecialTransition(),
  4685. e ? this.player.aimTourCamera(this.destinationItem, v.Retain, v.Slow, this.actionComplete.bind(this)) : this.actionComplete()
  4686. }
  4687. .bind(this), t)
  4688. }
  4689. }
  4690. ,
  4691. n.prototype.goToDestination = function(e, t, i, n) {
  4692. if(typeof g_data2.tourAudio !== 'undefined' && g_data2.tourAudio !== null){
  4693. var tM = g_data2.tourAudio[this.model.heroLocations[this.destinationItem].sid];
  4694. if(tM && tM.music.length > 0){
  4695. var s = tM.music.includes(g_Prefix.slice(-10)) ? tM.music : g_Prefix + tM.music;
  4696. g_tourAudio.src = manage.dealURL(s);
  4697. g_tourAudio.load();
  4698. g_tourAudio.crossOrigin = "anonymous"
  4699. g_tourAudio.oncanplaythrough = function() {
  4700. g_tourAudio.play();
  4701. //$("#volume").addClass("unable")
  4702. if(g_bgAudio && !g_bgAudio.paused){
  4703. manage.switchBgmState(false);
  4704. g_bgAudio.pauseByTour = true
  4705. }
  4706. g_playAudio = g_tourAudio;
  4707. }
  4708. }
  4709. };
  4710. if (this.onTheBus = !0,
  4711. this.emit("update.controls"),
  4712. this.player.updateLastView(),
  4713. !n && this.atDestinationPano())
  4714. return void this.arrivedAtDestination(!0);
  4715. if (this.player.flying || this.player.isWarping())
  4716. A.warn("Cannot go to new destination while player is flying or warping.");
  4717. else {
  4718. var r = this.model.getHeroDescriptorByIndex(this.destinationItem)
  4719. , o = null
  4720. , a = null;
  4721. if (r.isPano()) {
  4722. //var s = 0 === this.destinationItem || e ? u.BLACK : this.nextWarpStyle;
  4723. //var walk = window.MP_PREFETCHED_MODELDATA.black ? 'black' : 'walk';
  4724. var s = window.MP_PREFETCHED_MODELDATA.momentTour || 'walk';
  4725. a = this.player.warpToPanoByHeroIndex.bind(this.player, this.destinationItem, v.Show, m.Slow, s, true, i, this.actionComplete.bind(this)),
  4726. o = this.arrivedAtDestination.bind(this, !0)
  4727. } else
  4728. a = this.player.warpToNonPanoByHeroIndex.bind(this.player, this.destinationItem, this.actionComplete.bind(this)),
  4729. o = this.arrivedAtDestination.bind(this, !1);
  4730. this.transitionStage = y.Moving,
  4731. this.model.fadePanoMarkers(0),
  4732. this.awaitCompletion(function() {
  4733. a();
  4734. }
  4735. .bind(this), o),
  4736. this.emit("update.controls")
  4737. }
  4738. }
  4739. ,
  4740. n.prototype.tourInterlude = function() {
  4741. if (h.trackAlways("reach_highlight", {
  4742. reach_source: this.reachSource
  4743. }),
  4744. this.model.fadePanoMarkers(0),
  4745. this.emit("update.controls"),
  4746. this.tourIsPlaying)
  4747. return this.atEndOfTour() && !this.endlessLoop ? (this.tourInProgress = !1,
  4748. this.stopTour(true),
  4749. this.emit(p.TourEnd),
  4750. void (this.player.mode === c.PANORAMA && this.model.fadePanoMarkers(a.panorama.markerOpacity))) : void this.awaitCompletion(function() {
  4751. this.transitionStage = y.Interlude,
  4752. this.player.tourInterlude(this.nextItem(this.currentItem),this.actionComplete.bind(this))
  4753. }
  4754. .bind(this), this.goNext.bind(this))
  4755. }
  4756. ,
  4757. n.prototype.playTour = function() {
  4758. if (!this.bounceable())
  4759. return this.tourIsPlaying ? void A.info("tour is already playing") : void (this.wouldInterrupt() || (this.player.emit("tour_auto", this.defaultWarpStyle),
  4760. this.tourInProgress = !0,
  4761. this.reachSource = "play",
  4762. this.tourIsPlaying = !0,
  4763. this.wasZoomEnabled = this.player.zoomEnabled,
  4764. this.player.zoomEnabled = !1,
  4765. this.resetSpecialTransition(),
  4766. this.emit("update.controls"),
  4767. this.emit(p.TourStart),
  4768. this.player.enablePreRendering(),
  4769. this.walkingSectionPaused ? (this.clearWalkingSectionPaused(),
  4770. this.goToDestination()) : this.goNext()))
  4771. }
  4772. ,
  4773. n.prototype.bgmReplay = function() {//xzw add 结束tour后可能要继续播放背景音乐
  4774. //if(g_tourAudio && g_tourAudio.paused && g_bgAudio && g_bgAudio.paused){
  4775. if(g_bgAudio && g_bgAudio.paused && g_bgAudio.pauseByTour){
  4776. g_playAudio = g_bgAudio;
  4777. g_tourAudio && g_tourAudio.pause();
  4778. //window.tourAudio && window.tourAudio.pause();
  4779. manage.switchBgmState(true);
  4780. }
  4781. }
  4782. ,
  4783. n.prototype.stopTour = function(isAutoStop) {//停止导览 isAutoStop 希望仅在飞完结束自动停止时的stopTour不停止tourSound, 这样才能完整播放tourSound. 不过似乎会在倒数第二个片段点击按钮停止导览时也视作自动结束的(执行this.interrupt() )。
  4784. this.isInterrupted() || this.transitionStage === y.Moving && this.checkAndHandleWalkingtourInterruption(this.nextWarpStyle) || (this.tourIsPlaying && (this.player.zoomEnabled = this.wasZoomEnabled),
  4785. this.tourIsPlaying = !1,
  4786. (!isAutoStop || g_tourAudio && g_tourAudio.paused )&&this.bgmReplay(),//xzw
  4787. this.interrupt(),
  4788. this.clearWalkingSectionPaused(),
  4789. this.resetSpecialTransition(),
  4790. this.emit("update.controls"))
  4791. //window.tourAudio && window.tourAudio.pause();
  4792. if(!isAutoStop && g_tourAudio && g_tourAudio.paused == false )
  4793. {
  4794. g_tourAudio.pause();
  4795. g_tourAudio.src = ""
  4796. }
  4797. }
  4798. ,
  4799. n.prototype.endTourProgress = function() {
  4800. this.tourInProgress = !1,
  4801. this.emit("update.controls"),
  4802. this.emit(p.TourEnd)
  4803. }
  4804. ,
  4805. n.prototype.goToHighlight = function(e) {
  4806. if (this.wouldInterrupt())
  4807. e === this.destinationItem ? this.interrupt() : this.redirectToItem(e, "goToHighlight");
  4808. else {
  4809. if (A.debug("<tour.goto " + e + ">"),
  4810. this.isInterrupted())
  4811. return;
  4812. this.clearWalkingSectionPaused(),
  4813. this.setDestinationItem(e),
  4814. this.useSpecialTransition("Hilight"),
  4815. this.goToDestination(),
  4816. h.trackAlways("reach_highlight", {
  4817. reach_source: "thumb"
  4818. })
  4819. }
  4820. }
  4821. ,
  4822. n.prototype.prevHighlight = function() {
  4823. this.bounceable() || (this.player.emit("tour_manual", "prev"),
  4824. this.interrupt(g.BEGINNING) || this.isInterrupted() || (this.clearWalkingSectionPaused(),
  4825. this.reachSource = "prev",
  4826. this.goPrev()))
  4827. }
  4828. ,
  4829. n.prototype.nextHighlight = function() {
  4830. this.bounceable() || (this.player.emit("tour_manual", "next"),
  4831. this.interrupt(g.BEGINNING) || this.isInterrupted() || (this.clearWalkingSectionPaused(),
  4832. this.reachSource = "next",
  4833. this.goNext()))
  4834. }
  4835. ,
  4836. n.prototype.changeMode = function(e) {
  4837. var t = $.Deferred()
  4838. , i = t.resolve.bind(t)
  4839. , n = t.reject.bind(t);
  4840. this.emit(p.StartModeChange);
  4841. var r = function() {
  4842. return this.clearWalkingSectionPaused(),
  4843. !!this.wouldInterrupt() && (this.interrupt(),
  4844. !0)
  4845. }
  4846. .bind(this);
  4847. if (!r()) {
  4848. switch (e) {
  4849. case c.PANORAMA:
  4850. 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);
  4851. break;
  4852. case c.DOLLHOUSE:
  4853. case c.FLOORPLAN:
  4854. this.player.flyToNewMode({
  4855. mode: e
  4856. }).done(i).fail(n);
  4857. break;
  4858. case c.OUTDOOR:
  4859. 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)
  4860. }
  4861. return t.promise()
  4862. }
  4863. }
  4864. ,
  4865. n.prototype.atEndOfTour = function() {
  4866. var e = this.currentItem >= this.nItems - 1;
  4867. return e
  4868. }
  4869. ,
  4870. n.prototype.firstDestination = function() {
  4871. return this.nItems > 0 ? 0 : null
  4872. }
  4873. ,
  4874. n.prototype.finalDestination = function() {
  4875. return this.nItems > 0 ? this.nItems - 1 : null
  4876. }
  4877. ,
  4878. n.prototype.goPrev = function() {
  4879. this.tourAdvance(-1)
  4880. }
  4881. ,
  4882. n.prototype.goNext = function() {
  4883. this.tourAdvance(1)
  4884. }
  4885. ,
  4886. n.prototype.setDestinationItem = function(e) {
  4887. this.destinationItem = e,
  4888. this.emit("update.controls")
  4889. }
  4890. ,
  4891. n.prototype.setCurrentItem = function(e) {
  4892. this.currentItem = e,
  4893. this.emit("update.controls")
  4894. }
  4895. ,
  4896. n.prototype.nextItem = function(e) {
  4897. return null === e ? this.firstDestination() : e >= this.nItems - 1 ? this.endlessLoop ? this.firstDestination() : null : e + 1
  4898. }
  4899. ,
  4900. n.prototype.prevItem = function(e) {
  4901. return null === e ? this.firstDestination() : e < 0 ? this.endlessLoop ? this.lastDestination() : null : e - 1
  4902. }
  4903. ,
  4904. n.prototype.tourAdvance = function(e) {
  4905. A.debug("tourAdvance(" + e + ")"),
  4906. null === this.currentItem || void 0 === this.currentItem ? this.setDestinationItem(this.firstDestination()) : this.setDestinationItem(this.currentItem + e),
  4907. this.destinationItem < 0 ? (this.setDestinationItem(this.finalDestination()),
  4908. this.useSpecialTransition("reverse-looping to end")) : this.destinationItem >= this.nItems && (this.setDestinationItem(this.firstDestination()),
  4909. this.useSpecialTransition("looping back to start"));
  4910. // 方奕卓 瞬间过渡, 相机缩放至1
  4911. if(window.MP_PREFETCHED_MODELDATA.momentTour === 'black') {
  4912. var zoomLevel = this.player.zoomLevel;
  4913. this.player.zoomEnabled = true;
  4914. var zoom = function(e, d) {
  4915. this.player.zoomTo((1-e)*zoomLevel, true)
  4916. }.bind(this)
  4917. s.start(zoom, 1500, function(){
  4918. }, 0, d.easeOutQuad, "zoom")
  4919. }
  4920. this.goToDestination()
  4921. }
  4922. ,
  4923. t.exports = n
  4924. }
  4925. ).call(this, "/js/director.js")
  4926. }
  4927. , {
  4928. "./analytics": 4,
  4929. "./enum/BlackoutStyle": 18,
  4930. "./enum/ControlEvents": 21,
  4931. "./enum/DirectorEvents": 23,
  4932. "./enum/ModelManagerEvents": 33,
  4933. "./enum/PathDiscardMode": 38,
  4934. "./enum/PathDisplayMode": 39,
  4935. "./enum/PlayerEvents": 40,
  4936. "./enum/Viewmode": 51,
  4937. "./enum/WarpStyle": 52,
  4938. "./model/ModelManager": 140,
  4939. "./player": 155,
  4940. "./settings": 166,
  4941. "./util/logger": 189,
  4942. "./util/transitions": 195,
  4943. events: 202,
  4944. three: 217
  4945. }],
  4946. 16: [function(e, t, i) {
  4947. "use strict";
  4948. var n = e("three")
  4949. , r = e("./enum/Viewmode")
  4950. , o = (e("./settings"),
  4951. e("./util/transitions"))
  4952. , a = e("./enum/PlayerEvents")
  4953. , s = new n.ShaderPass(n.HorizontalBlurShader)
  4954. , l = new n.ShaderPass(n.VerticalBlurShader);
  4955. l.renderToScreen = !0;
  4956. var c = $("#player").width() / $("#player").height();
  4957. isNaN(c) && (c = 1);
  4958. var h = {
  4959. currentBlur: 0,
  4960. aspect: c,
  4961. blurStrength: 1,
  4962. hblurPass: s,
  4963. vblurPass: l,
  4964. bindEvents: function(e) {
  4965. e.on(a.ModeChanged, function(e, t) {
  4966. e === r.PANORAMA && (o.cancel(h.blur),
  4967. o.cancel(h.addBlur),
  4968. o.start(h.removeBlur, 500, null, 0, null, "deblur"))
  4969. })
  4970. },
  4971. blur: function(e) {
  4972. h.currentBlur = e;
  4973. var t = e * h.blurStrength;
  4974. l.uniforms.v.value = t / 512 * h.aspect,
  4975. s.uniforms.h.value = t / 512
  4976. },
  4977. addBlur: function(e) {
  4978. e = Math.max(e, h.currentBlur),
  4979. h.blur(e)
  4980. },
  4981. removeBlur: function(e) {
  4982. e = Math.min(1 - e, h.currentBlur),
  4983. h.blur(e)
  4984. }
  4985. };
  4986. h.blur(0),
  4987. t.exports = h
  4988. }
  4989. , {
  4990. "./enum/PlayerEvents": 40,
  4991. "./enum/Viewmode": 51,
  4992. "./settings": 166,
  4993. "./util/transitions": 195,
  4994. three: 217
  4995. }],
  4996. 17: [function(e, t, i) {
  4997. "use strict";
  4998. t.exports = {
  4999. UNKNOWN: 0,
  5000. ALIGNED: 1,
  5001. UNALIGNED: 2,
  5002. PLACED: 3
  5003. }
  5004. }
  5005. , {}],
  5006. 18: [function(e, t, i) {
  5007. "use strict";
  5008. t.exports = {
  5009. NONE: 0,
  5010. MIDDLE: 1,
  5011. END: 2,
  5012. BEGINNING: 3,
  5013. FADEIN: 4
  5014. }
  5015. }
  5016. , {}],
  5017. 19: [function(e, t, i) {
  5018. "use strict";
  5019. var n = e("three");
  5020. t.exports = {
  5021. newBlue: new n.Color(4967932),
  5022. altBlue: new n.Color(47355),
  5023. tagDefault: new n.Color(223357),
  5024. classicBlue: new n.Color(53759),
  5025. mpYellow: new n.Color(16502016),
  5026. mpOrange: new n.Color(16428055),
  5027. mpBlue: new n.Color(12096),
  5028. mpLtGrey: new n.Color(13751252),
  5029. mpDkGrey: new n.Color(10000019),
  5030. mpRed: new n.Color(12525854),
  5031. mpOrangeDesat: new n.Color(16764529),
  5032. mpBlueDesat: new n.Color(4034734),
  5033. mpRedDesat: new n.Color(14705505),
  5034. white: new n.Color(16777215),
  5035. black: new n.Color(0),
  5036. _desat: function(e, t) {
  5037. var i = t || .3
  5038. , r = (new n.Color).copy(e).getHSL();
  5039. return (new n.Color).setHSL(r.h, r.s * (1 - i), r.l)
  5040. },
  5041. _darken: function(e, t) {
  5042. var i = t || .2
  5043. , r = e.getHSL();
  5044. return (new n.Color).setHSL(r.h, r.s, r.l * (1 - i))
  5045. }
  5046. }
  5047. }
  5048. , {
  5049. three: 217
  5050. }],
  5051. 20: [function(e, t, i) {
  5052. "use strict";
  5053. t.exports = {
  5054. NONE: -1,
  5055. ROTATE: 0,
  5056. DOLLY: 1,
  5057. PAN: 2,
  5058. ROTATE_DOLLY: 3,
  5059. PAN_DOLLY: 4
  5060. }
  5061. }
  5062. , {}],
  5063. 21: [function(e, t, i) {
  5064. "use strict";
  5065. t.exports = {
  5066. Move: "move",
  5067. InteractionDirect: "interaction.direct",
  5068. InteractionKey: "interaction.key",
  5069. InteractionGui: "interaction.gui",
  5070. FlyInDirection: "fly.direction",
  5071. InputStart: "input.start",
  5072. Pinch: "input.pinch",
  5073. Scroll: "input.scroll",
  5074. AutoPanInterrupt: "autopan.interrupt",
  5075. AutoPanComplete: "autopan.complete",
  5076. AutoPanClamped: "autopan.clamped",
  5077. LongTap: "longtap"
  5078. }
  5079. }
  5080. , {}],
  5081. 22: [function(e, t, i) {
  5082. "use strict";
  5083. t.exports = Object.freeze({
  5084. FORWARD: "FORWARD",
  5085. LEFT: "LEFT",
  5086. RIGHT: "RIGHT",
  5087. BACK: "BACK",
  5088. UP: "UP",
  5089. DOWN: "DOWN"
  5090. })
  5091. }
  5092. , {}],
  5093. 23: [function(e, t, i) {
  5094. "use strict";
  5095. t.exports = {
  5096. ActionInterrupted: "action.interrupted",
  5097. TourStart: "tour.start",
  5098. TourEnd: "tour.end",
  5099. StartModeChange: "mode.startChange"
  5100. }
  5101. }
  5102. , {}],
  5103. 24: [function(e, t, i) {
  5104. "use strict";
  5105. t.exports = Object.freeze({
  5106. None: 0,
  5107. Queued: 1,
  5108. ForceQueued: 2,
  5109. Downloading: 3,
  5110. Downloaded: 4,
  5111. DownloadFailed: 5
  5112. })
  5113. }
  5114. , {}],
  5115. 25: [function(e, t, i) {
  5116. "use strict";
  5117. t.exports = {
  5118. GL_TEXTURE_CUBE_MAP_POSITIVE_X: 0,
  5119. GL_TEXTURE_CUBE_MAP_NEGATIVE_X: 1,
  5120. GL_TEXTURE_CUBE_MAP_POSITIVE_Y: 2,
  5121. GL_TEXTURE_CUBE_MAP_NEGATIVE_Y: 3,
  5122. GL_TEXTURE_CUBE_MAP_POSITIVE_Z: 4,
  5123. GL_TEXTURE_CUBE_MAP_NEGATIVE_Z: 5
  5124. }
  5125. }
  5126. , {}],
  5127. 26: [function(e, t, i) {
  5128. "use strict";
  5129. t.exports = {
  5130. Texture2D: 0,
  5131. TextureCube: 1
  5132. }
  5133. }
  5134. , {}],
  5135. 27: [function(e, t, i) {
  5136. "use strict";
  5137. t.exports = {
  5138. SMALL: "small",
  5139. LARGE: "large"
  5140. }
  5141. }
  5142. , {}],
  5143. 28: [function(e, t, i) {
  5144. "use strict";
  5145. var n = e("./Viewmode")
  5146. , r = {
  5147. LANDING: {},
  5148. NAVIGATION: "navigation",
  5149. MORE_HELP: "moreHelp",
  5150. TOUR_INTERACTION: {}
  5151. };
  5152. r.LANDING[n.PANORAMA] = "panorama.landing",
  5153. r.LANDING[n.OUTDOOR] = "outdoor.landing",
  5154. r.LANDING[n.DOLLHOUSE] = "dollhouse.landing",
  5155. r.LANDING[n.FLOORPLAN] = "floorplan.landing",
  5156. r.TOUR_INTERACTION.standard = "standard.tour",
  5157. r.TOUR_INTERACTION[n.OUTDOOR] = "outdoor.tour",
  5158. r.TOUR_INTERACTION[n.FLOORPLAN] = "floorplan.tour",
  5159. t.exports = r
  5160. }
  5161. , {
  5162. "./Viewmode": 51
  5163. }],
  5164. 29: [function(e, t, i) {
  5165. "use strict";
  5166. var n = {
  5167. UP: 1,
  5168. DOWN: -1,
  5169. LEFT: "L",
  5170. RIGHT: "R",
  5171. FORWARD: "F",
  5172. BACK: "B",
  5173. reverse: {},
  5174. opposite: function(e) {
  5175. return this.reverse[e.toString()]
  5176. }
  5177. };
  5178. !function() {
  5179. n.reverse[n.UP] = n.DOWN,
  5180. n.reverse[n.DOWN] = n.UP,
  5181. n.reverse[n.LEFT] = n.RIGHT,
  5182. n.reverse[n.RIGHT] = n.LEFT,
  5183. n.reverse[n.FORWARD] = n.BACK,
  5184. n.reverse[n.BACK] = n.FORWARD
  5185. }(),
  5186. t.exports = n
  5187. }
  5188. , {}],
  5189. 30: [function(e, t, i) {
  5190. "use strict";
  5191. var n = e("../util/browser")
  5192. , r = {
  5193. ZERO: 48,
  5194. ONE: 49,
  5195. TWO: 50,
  5196. THREE: 51,
  5197. FOUR: 52,
  5198. FIVE: 53,
  5199. SIX: 54,
  5200. SEVEN: 55,
  5201. EIGHT: 56,
  5202. NINE: 57,
  5203. LEFTARROW: 37,
  5204. UPARROW: 38,
  5205. RIGHTARROW: 39,
  5206. DOWNARROW: 40,
  5207. A: 65,
  5208. B: 66,
  5209. C: 67,
  5210. D: 68,
  5211. E: 69,
  5212. F: 70,
  5213. G: 71,
  5214. H: 72,
  5215. I: 73,
  5216. J: 74,
  5217. K: 75,
  5218. L: 76,
  5219. M: 77,
  5220. N: 78,
  5221. O: 79,
  5222. P: 80,
  5223. Q: 81,
  5224. R: 82,
  5225. S: 83,
  5226. T: 84,
  5227. U: 85,
  5228. V: 86,
  5229. W: 87,
  5230. X: 88,
  5231. Y: 89,
  5232. Z: 90,
  5233. SPACE: 32,
  5234. RETURN: 13,
  5235. SEMICOLON: 186,
  5236. PLUSEQUALS: 187,
  5237. DASHUNDERSCORE: 189,
  5238. OPENBRACKET: 219
  5239. };
  5240. n.detectFirefox() && (r.SEMICOLON = 59,
  5241. r.PLUSEQUALS = 61,
  5242. r.DASHUNDERSCORE = 173),
  5243. t.exports = r
  5244. }
  5245. , {
  5246. "../util/browser": 182
  5247. }],
  5248. 31: [function(e, t, i) {
  5249. "use strict";
  5250. t.exports = {
  5251. EN_US: "en-US",
  5252. ES_MX: "es-MX",
  5253. FR_FR: "fr-FR",
  5254. DE_DE: "de-DE",
  5255. RU_RU: "ru-RU",
  5256. CN_CN: "cn-CN",
  5257. JP_JP: "jp-JP"
  5258. }
  5259. }
  5260. , {}],
  5261. 32: [function(e, t, i) {
  5262. "use strict";
  5263. t.exports = {
  5264. TagActivated: "tag.activated",
  5265. TagDismissed: "tag.dismissed",
  5266. TagNavigation: "tag.navigation"
  5267. }
  5268. }
  5269. , {}],
  5270. 33: [function(e, t, i) {
  5271. "use strict";
  5272. t.exports = {
  5273. ModelAdded: "model-added",
  5274. ActiveModelChanged: "active-model-changed"
  5275. }
  5276. }
  5277. , {}],
  5278. 34: [function(e, t, i) {
  5279. "use strict";
  5280. t.exports = {
  5281. LEFT: 0,
  5282. MIDDLE: 1,
  5283. RIGHT: 2
  5284. }
  5285. }
  5286. , {}],
  5287. 35: [function(e, t, i) {
  5288. "use strict";
  5289. t.exports = {
  5290. PanoRenderComplete: "panorama.render.complete",
  5291. TileRenderFailure: "panorama.tile.render.failed",
  5292. TileRenderSuccess: "panorama.tile.render.success",
  5293. TileUploadAttempted: "panorama.tile.upload.attempted",
  5294. UploadAttemptedForAllTiles: "panorama.upload.attempted.all.tiles",
  5295. ZoomLevelRenderStarted: "panorama.zoom.render.started"
  5296. }
  5297. }
  5298. , {}],
  5299. 36: [function(e, t, i) {
  5300. "use strict";
  5301. t.exports = {
  5302. BASE: 1,
  5303. STANDARD: 2,
  5304. HIGH: 3,
  5305. ULTRAHIGH: 4
  5306. }
  5307. }
  5308. , {}],
  5309. 37: [function(e, t, i) {
  5310. "use strict";
  5311. t.exports = {
  5312. LoadComplete: "panorama.load.complete",
  5313. LoadFailed: "panorama.load.failed",
  5314. TileLoaded: "panorama.tile.loaded"
  5315. }
  5316. }
  5317. , {}],
  5318. 38: [function(e, t, i) {
  5319. "use strict";
  5320. t.exports = Object.freeze({
  5321. Standard: 0,
  5322. Slow: 1,
  5323. Retain: 2
  5324. })
  5325. }
  5326. , {}],
  5327. 39: [function(e, t, i) {
  5328. "use strict";
  5329. t.exports = Object.freeze({
  5330. Show: 0,
  5331. Hide: 1,
  5332. Retain: 2
  5333. })
  5334. }
  5335. , {}],
  5336. 40: [function(e, t, i) {
  5337. "use strict";
  5338. t.exports = {
  5339. Move: "move",
  5340. MoveComplete: "move.complete",
  5341. ModeChanged: "mode.changed",
  5342. ModeChanging: "mode.changing",
  5343. PanoChosen: "pano.chosen",
  5344. ClosestPanoChanging: "closest.pano.changing",
  5345. WarpStarted: "warp.started",
  5346. WarpInterrupted: "warp.interrupted",
  5347. WarpEnded: "warp.ended",
  5348. FlyinFinished: "flyin.finished",
  5349. FlyingStarted: "flying.started",
  5350. FlyingInterrupted: "flying.interrupted",
  5351. FlyingEnded: "flying.ended",
  5352. Ready: "ready",
  5353. StartInside: "start.inside",
  5354. StartOutside: "start.outside",
  5355. ViewChanged: "view.changed",
  5356. WarpInterruptedWithFlyTo: "warp.interrupted.flyto",
  5357. InputStart: "input.start"
  5358. }
  5359. }
  5360. , {}],
  5361. 41: [function(e, t, i) {
  5362. "use strict";
  5363. t.exports = Object.freeze({
  5364. DEFAULT: 0,
  5365. PANOMARKERS: 1,
  5366. RETICULE: 2,
  5367. TAG: 3
  5368. })
  5369. }
  5370. , {}],
  5371. 42: [function(e, t, i) {
  5372. "use strict";
  5373. t.exports = {
  5374. visibleFloor: 1,
  5375. ghostFloor: 3,
  5376. boundingSkybox: 1,
  5377. panoMarker: 2,
  5378. reticule: 3,
  5379. tagStem: 4,
  5380. tagDisc: 5,
  5381. ribbon: 100
  5382. }
  5383. }
  5384. , {}],
  5385. 43: [function(e, t, i) {
  5386. "use strict";
  5387. t.exports = {
  5388. ContextCreated: "scene-renderer-context-created",
  5389. AfterRender: "after-render",
  5390. MemoryUsageUpdated: "scene-renderer-memory-usage-updated"
  5391. }
  5392. }
  5393. , {}],
  5394. 44: [function(e, t, i) {
  5395. "use strict";
  5396. t.exports = {
  5397. IDLE: "idle",
  5398. BROWSE: "browse",
  5399. EXAMINE: "examine"
  5400. }
  5401. }
  5402. , {}],
  5403. 45: [function(e, t, i) {
  5404. "use strict";
  5405. t.exports = {
  5406. TileDownloadSuccess: "tiledownloader.download.success",
  5407. TileDownloadFailure: "tiledownloader.download.failure",
  5408. PanoDownloadComplete: "tiledownloader.pano.download.complete"
  5409. }
  5410. }
  5411. , {}],
  5412. 46: [function(e, t, i) {
  5413. "use strict";
  5414. t.exports = {
  5415. CardboardAndroid: "googlevr",
  5416. GearVR: "gearvr",
  5417. CardboardIOS: "googlevrios",
  5418. Cardboard: "googlevr"
  5419. }
  5420. }
  5421. , {}],
  5422. 47: [function(e, t, i) {
  5423. "use strict";
  5424. t.exports = {
  5425. NONE: 0,
  5426. CONTEXTUAL: 1,
  5427. ANDROID: 2
  5428. }
  5429. }
  5430. , {}],
  5431. 48: [function(e, t, i) {
  5432. "use strict";
  5433. var n = {
  5434. Title: 0,
  5435. Cardboard: 1
  5436. }
  5437. , r = {
  5438. Title: 0,
  5439. Cardboard: 1,
  5440. Gear: 2
  5441. };
  5442. !function() {
  5443. [n, r].forEach(function(e) {
  5444. e.pageCount = Object.keys(e).length
  5445. })
  5446. }(),
  5447. t.exports.ios = n,
  5448. t.exports.standard = r
  5449. }
  5450. , {}],
  5451. 49: [function(e, t, i) {
  5452. "use strict";
  5453. t.exports = {
  5454. Android: "android",
  5455. IOS: "ios",
  5456. Desktop: "desktop",
  5457. UnsupportedAndroid: "android-unsupported"
  5458. }
  5459. }
  5460. , {}],
  5461. 50: [function(e, t, i) {
  5462. "use strict";
  5463. var n = e("three");
  5464. t.exports = {
  5465. UP: new n.Vector3(0,1,0),
  5466. DOWN: new n.Vector3(0,-1,0),
  5467. LEFT: new n.Vector3(-1,0,0),
  5468. RIGHT: new n.Vector3(1,0,0),
  5469. FORWARD: new n.Vector3(0,0,-1),
  5470. BACK: new n.Vector3(0,0,1)
  5471. }
  5472. }
  5473. , {
  5474. three: 217
  5475. }],
  5476. 51: [function(e, t, i) {
  5477. "use strict";
  5478. var n = e("../exception/ViewmodeConvertException")
  5479. , r = e("./coreViewmodes")
  5480. , o = e("../util/common")
  5481. , a = {
  5482. MESH: "mesh",
  5483. OUTDOOR: "outdoor",
  5484. TRANSITIONING: "transitioning",
  5485. toInt: function(e) {
  5486. switch (e) {
  5487. case this.PANORAMA:
  5488. return 1;
  5489. case this.DOLLHOUSE:
  5490. return 2;
  5491. case this.FLOORPLAN:
  5492. return 3;
  5493. case this.OUTDOOR:
  5494. return 4;
  5495. case this.TRANSITIONING:
  5496. return -1
  5497. }
  5498. throw new n("No known conversion for Viewmode to int for mode: " + e)
  5499. },
  5500. fromInt: function(e) {
  5501. switch (e) {
  5502. case "1":
  5503. case 1:
  5504. return this.PANORAMA;
  5505. case "2":
  5506. case 2:
  5507. return this.DOLLHOUSE;
  5508. case "3":
  5509. case 3:
  5510. return this.FLOORPLAN;
  5511. case "4":
  5512. case 4:
  5513. return this.OUTDOOR
  5514. }
  5515. throw new n("No known conversion for int to viewmode for int: " + e)
  5516. },
  5517. convertWorkshopModeInt: function(e) {
  5518. switch (e) {
  5519. case "0":
  5520. case 0:
  5521. case undefined: //xzw add
  5522. return this.PANORAMA;
  5523. case "1":
  5524. case 1:
  5525. return this.FLOORPLAN;
  5526. case "2":
  5527. case 2:
  5528. return this.DOLLHOUSE;
  5529. case "3":
  5530. case 3:
  5531. return this.MESH
  5532. }
  5533. throw new n("No known conversion for Workshop int to viewmode for int: " + e)
  5534. }
  5535. };
  5536. o.extendObject(a, r),
  5537. t.exports = a
  5538. }
  5539. , {
  5540. "../exception/ViewmodeConvertException": 58,
  5541. "../util/common": 185,
  5542. "./coreViewmodes": 54
  5543. }],
  5544. 52: [function(e, t, i) {
  5545. "use strict";
  5546. t.exports = {
  5547. BLACK: "black",
  5548. STD: "std",
  5549. WALK: "walk"
  5550. }
  5551. }
  5552. , {}],
  5553. 53: [function(e, t, i) {
  5554. "use strict";
  5555. t.exports = {
  5556. ZoomIn: "zoom.in",
  5557. ZoomOut: "zoom.out",
  5558. ZoomMax: "zoom.max",
  5559. ZoomMin: "zoom.min"
  5560. }
  5561. }
  5562. , {}],
  5563. 54: [function(e, t, i) {
  5564. "use strict";
  5565. t.exports = {
  5566. PANORAMA: "panorama",
  5567. DOLLHOUSE: "dollhouse",
  5568. FLOORPLAN: "floorplan"
  5569. }
  5570. }
  5571. , {}],
  5572. 55: [function(e, t, i) {
  5573. "use strict";
  5574. function n(e) {
  5575. this.message = e
  5576. }
  5577. t.exports = n
  5578. }
  5579. , {}],
  5580. 56: [function(e, t, i) {
  5581. "use strict";
  5582. function n(e) {
  5583. r.call(this, e)
  5584. }
  5585. var r = e("./BasicException");
  5586. n.prototype = Object.create(r.prototype),
  5587. t.exports = n
  5588. }
  5589. , {
  5590. "./BasicException": 55
  5591. }],
  5592. 57: [function(e, t, i) {
  5593. "use strict";
  5594. function n(e) {
  5595. r.call(this, e)
  5596. }
  5597. var r = e("./BasicException");
  5598. n.prototype = Object.create(r.prototype),
  5599. t.exports = n
  5600. }
  5601. , {
  5602. "./BasicException": 55
  5603. }],
  5604. 58: [function(e, t, i) {
  5605. "use strict";
  5606. function n(e) {
  5607. r.call(this, e)
  5608. }
  5609. var r = e("./BasicException");
  5610. n.prototype = Object.create(r.prototype),
  5611. t.exports = n
  5612. }
  5613. , {
  5614. "./BasicException": 55
  5615. }],
  5616. 59: [function(e, t, i) {
  5617. (function(i) {
  5618. "use strict";
  5619. function n(e) {
  5620. var t = {};
  5621. if (e) {
  5622. var i = e.flags;
  5623. if (i)
  5624. for (var n in i)
  5625. i.hasOwnProperty(n) && (t[i[n]] = !0);
  5626. return t
  5627. }
  5628. return l.debug("Feature flags -> parseFeatureFlags: rawData is null."),
  5629. null
  5630. }
  5631. var r = e("./util/ajax")
  5632. , o = e("./util/showcase")
  5633. , a = e("./util/logger")
  5634. , s = ""
  5635. , l = new a(i)
  5636. , c = {};
  5637. t.exports = {
  5638. loadFeatureFlags: function(e) {
  5639. var t = $.Deferred();
  5640. return r.get(e.urlBase + s, {
  5641. responseType: "json",
  5642. prefetchFrom: "user",
  5643. auth: o.getAuthorizationHeader()
  5644. }).done(function(e) {
  5645. c = n(e),
  5646. c ? t.resolve(c) : t.reject("loading-failed")
  5647. }).fail(function() {
  5648. l.debug("Retrieval of feature flags failed."),
  5649. t.reject("loading-failed")
  5650. }),
  5651. t.promise()
  5652. },
  5653. getFlags: function() {
  5654. return c
  5655. },
  5656. updateDependentSettings: function(e, t) {
  5657. e = e || c,
  5658. e.labels && (t.labels.enabled = !0),
  5659. e.zooming && !t.zoom.forceOff && (t.zoom.enabled = !0),
  5660. e.showcase_sdk && (t.sdkInit = !0),
  5661. e.mobile_highq_override && (t.tiling.mobileHighQualityOverride = !0),
  5662. e.showcase_webvr && (t.vr.allowWebVR = !0),
  5663. e.uhql && (t.tiling.allowUltraHighResolution = !0),
  5664. e.hide_sc_sharing && (t.share.enabled = !1)
  5665. }
  5666. }
  5667. }
  5668. ).call(this, "/js/featureflags.js")
  5669. }
  5670. , {
  5671. "./util/ajax": 181,
  5672. "./util/logger": 189,
  5673. "./util/showcase": 193
  5674. }],
  5675. 60: [function(e, t, i) {
  5676. "use strict";
  5677. var n = (e("../util/common"),
  5678. {
  5679. status: 0,
  5680. set: function(e) {
  5681. if (isNaN(e))
  5682. return !1;
  5683. var t = $('.progressbar');
  5684. 0 > e && (e = 0);
  5685. e > 100 && (e = 100);
  5686. var width = parseInt(t.css('width').replace("px",""))/100; //获取进度条总长度除以100
  5687. var barperc = e*width;
  5688. var perc = Math.round(e);
  5689. var labelpos = (parseInt(barperc)-15);
  5690. t.find('.bar').css('width',barperc); //已经再跑颜色的百分比
  5691. t.find('.label').css('left', labelpos); //上面跟着的字的百分比
  5692. t.find('.perc').text(perc+'%'); //具体数字的百分比
  5693. this.status = e
  5694. },
  5695. done: function(e) {
  5696. return e || this.status ? (this.status = null,
  5697. this.set(100)) : this
  5698. }
  5699. });
  5700. t.exports.circleLoader = n
  5701. }
  5702. , {
  5703. "../util/common": 185
  5704. }],
  5705. 61: [function(e, t, i) {
  5706. "use strict";
  5707. t.exports = Object.freeze({
  5708. CLOSE: "modal.closer.close"
  5709. })
  5710. }
  5711. , {}],
  5712. 62: [function(e, t, i) {
  5713. "use strict";
  5714. function n(e, t) {
  5715. t && (t.stopPropagation(),
  5716. t.preventDefault()),
  5717. e && this.emit(l.CLOSE, e),
  5718. g.reset()
  5719. }
  5720. function r(e, t) {
  5721. function i() {
  5722. var t = e.offsetHeight >= $("#player").height() && e.offsetWidth >= $("#player").width();
  5723. t !== f && (f = t,
  5724. t ? (e.classList.add("closeByFooter"),
  5725. h.classList.add("closeByFooter")) : (e.classList.remove("closeByFooter"),
  5726. h.classList.remove("closeByFooter")))
  5727. }
  5728. t ? setTimeout(i, o.guiAnimationSpeed) : i()
  5729. }
  5730. var o = e("../../settings")
  5731. , a = (e("../../tag/Media/MediaEvent"),
  5732. e("../../util/browser"))
  5733. , s = e("../../util/common")
  5734. , l = e("./ModalCloserEvent")
  5735. , c = e("events").EventEmitter
  5736. , h = document.getElementsByClassName("footer")[0]
  5737. , u = h.querySelectorAll(".close")[0]
  5738. , d = null
  5739. , p = null
  5740. , f = null
  5741. , g = (a.isMobile(),
  5742. {
  5743. open: function(e) {
  5744. e && (r(e),
  5745. d && u.removeEventListener("click", d, !0),
  5746. d = n.bind(this, e.id),
  5747. u.addEventListener("click", d, !0),
  5748. p && window.removeEventListener("resize", p, !0),
  5749. p = r.bind(this, e),
  5750. window.addEventListener("resize", p, !0))
  5751. },
  5752. reset: function() {
  5753. h.classList.remove("closeByFooter"),
  5754. u.removeEventListener("click", d, !0),
  5755. window.removeEventListener("resize", p, !0),
  5756. d = p = f = null
  5757. }
  5758. });
  5759. s.extendObject(g, c.prototype),
  5760. t.exports = g
  5761. }
  5762. , {
  5763. "../../tag/Media/MediaEvent": 131,
  5764. "../../settings": 166,
  5765. "../../util/browser": 182,
  5766. "../../util/common": 185,
  5767. "./ModalCloserEvent": 61,
  5768. events: 202
  5769. }],
  5770. 63: [function(e, t, i) {
  5771. "use strict";
  5772. function n(e, t, i) {
  5773. var n = new r.GUI({
  5774. width: 400
  5775. })
  5776. , u = n.addFolder("Flydown from Dollhouse");
  5777. u.add(h.flydown, "movementEasing", Object.keys(a)),
  5778. u.add(h.flydown, "movementDelay", 0, 1).step(.01),
  5779. u.add(h.flydown, "rotationEasing", Object.keys(a)),
  5780. u.add(h.flydown, "rotationDelay", 0, 1).step(.01),
  5781. u.add(h.flydown, "modelTextureDelay", 0, 1).step(.01),
  5782. u.add(h.flydown, "skyboxDelay", 0, 1).step(.01),
  5783. u.add(h.dollhouseDefault, "minPolarAngle", 0, o.Math.degToRad(50)),
  5784. u.add(h.dollhouseDefault, "maxPolarAngle", o.Math.degToRad(50), o.Math.degToRad(170));
  5785. var d = n.addFolder("Transition between panos");
  5786. d.add(h.transition, "blur", 0, 10).onFinishChange(function() {}),
  5787. d.add(h.transition, "flySpeed", 0, 10).step(.01).onFinishChange(function() {
  5788. h.transition.flyTime = 0,
  5789. d.__controllers.forEach(function(e) {
  5790. e.updateDisplay()
  5791. })
  5792. }),
  5793. d.add(h.transition, "flyTime", 0, 5e3).onFinishChange(function() {
  5794. h.transition.flySpeed = 0,
  5795. d.__controllers.forEach(function(e) {
  5796. e.updateDisplay()
  5797. })
  5798. }),
  5799. d.add(h.transition, "aimTime", 500, 2500).step(50),
  5800. d.add(h.transition, "aimSlowFactor", 1, 3).step(.1),
  5801. d.add(h.transition, "movementEasing", Object.keys(a));
  5802. var p = n.addFolder("Path Display");
  5803. p.add(h.path, "opacity", 0, 1).step(.01).onFinishChange(function() {}),
  5804. p.add(h.path, "height", 0, .2).step(.01).onFinishChange(function() {}),
  5805. p.add(h.path, "outsideHeight", 0, 2).step(.01).onFinishChange(function() {}),
  5806. p.add(h.path, "ribbonWidth", .01, .35).step(.01).onFinishChange(function() {}),
  5807. p.add(h.path, "waypointRadius", .01, 1.2).step(.01).onFinishChange(function() {}),
  5808. p.add(h.path, "waypointPulse", 0, 3600).step(20).onFinishChange(function() {}),
  5809. p.add(h.path, "waypointIndoorRadius", .01, 1.2).step(.01).onFinishChange(function() {}),
  5810. p.add(h.path, "fadeInTime", 0, 1200).step(10).onFinishChange(function() {}),
  5811. p.add(h.path, "fadeOutTime", 0, 1200).step(10).onFinishChange(function() {}),
  5812. p.add(h.path, "color", Object.keys(l)).onFinishChange(function() {
  5813. h.path.color = l[h.path.color],
  5814. h.path.colorUp = l._desat(h.path.color),
  5815. h.path.colorDown = l.darken(h.path.color)
  5816. }),
  5817. p.add(h, "reticuleColor", Object.keys(l)).onFinishChange(function() {
  5818. h.reticuleColor = l[h.reticuleColor]
  5819. });
  5820. var f = n.addFolder("Warping")
  5821. , g = f.addFolder("Warp/Teleport");
  5822. g.add(h.warp, "softPushDist", 0, 2).onFinishChange(function() {}),
  5823. g.add(h.warp, "softPushEnd", 0, 1).step(.01).onFinishChange(function() {}),
  5824. g.add(h.warp, "softBendAngle", 0, 45).onFinishChange(function() {}),
  5825. g.add(h.warp, "softBendTilt", 0, 45).onFinishChange(function() {}),
  5826. g.add(h.warp, "softBendEnd", 0, 1).step(.01).onFinishChange(function() {}),
  5827. g.add(h.warp, "burnsAngle", 0, 30).onFinishChange(function() {}),
  5828. g.add(h.warp, "minBurnsAngle", 0, 10).onFinishChange(function() {}),
  5829. g.add(h.warp, "brakeStrength", 1, 8).onFinishChange(function() {}),
  5830. g.add(h.warp, "minBrakeAngle", 0, 5).step(.01).onFinishChange(function() {}),
  5831. g.add(h.warp, "maxBrakeAngle", 0, 5).step(.01).onFinishChange(function() {}),
  5832. g.add(h.path, "mapGuides").onFinishChange(function() {}),
  5833. g.add(h.warp, "teleportTime", 0, 5e3).step(10).onFinishChange(function() {}),
  5834. g.add(h.warp, "outsideTime", 0, 5e3).step(10).onFinishChange(function() {}),
  5835. g.add(h.path, "typ", Object.keys(c)).onFinishChange(function() {
  5836. h.path.typ = c[h.path.typ]
  5837. }),
  5838. g.add(h.warp, "loop").onChange(function() {}).onFinishChange(function() {
  5839. t.endlessLoop = h.warp.loop
  5840. }),
  5841. g.add(h.warp, "walkSlideShowThreshhold", 1, 1e4).step(1).onFinishChange(function() {}),
  5842. g.add(h.warp, "walkExtraPanosDistance", 0, 3).step(.1).onFinishChange(function() {}),
  5843. g.add(h.transition, "fastForwardFactor", 1, 10).step(1).onFinishChange(function() {});
  5844. var m = f.addFolder("Long Warp Only");
  5845. m.add(h.warp, "minWarpTime", 0, 5e3).step(10).onFinishChange(function() {
  5846. h.warp.flySpeed = 0,
  5847. m.__controllers.forEach(function(e) {
  5848. e.updateDisplay()
  5849. })
  5850. }),
  5851. m.add(h.warp, "timePerMeter", 0, 5e3).step(10).onFinishChange(function() {}),
  5852. m.add(h.warp, "lookAheadMax", .01, 1).step(.01).onFinishChange(function() {}),
  5853. m.add(h.warp, "lookAheadDist", .01, 4).step(.01).onFinishChange(function() {}),
  5854. m.add(h.warp, "maxTurnPerSec", 0, 720).step(1).onFinishChange(function() {}),
  5855. m.add(h.warp, "maxAimPerSec", 0, 720).step(1).onFinishChange(function() {}),
  5856. m.add(h.warp, "turnFriction", 0, 1).step(.01).onFinishChange(function() {}),
  5857. m.add(h.warp, "walkDelay", 0, 2e3).step(10).onFinishChange(function() {}),
  5858. m.add(h.transition, "flytimeMaxDistanceThreshold", 0, 25).step(10).onFinishChange(function() {}),
  5859. m.add(h.warp, "walkMaxDist", 0, 100).step(1).onFinishChange(function() {});
  5860. var v = n.addFolder("Warp Esoterica");
  5861. v.add(h.warp, "nearPanoDist", .01, 12).step(0).onFinishChange(function() {}),
  5862. v.add(h.warp, "blur", .01, 1).onFinishChange(function() {}),
  5863. v.add(h.warp, "flySpeed", 0, 10).step(.01).onFinishChange(function() {
  5864. h.warp.minWarpTime = 0,
  5865. v.__controllers.forEach(function(e) {
  5866. e.updateDisplay()
  5867. })
  5868. }),
  5869. v.add(h.warp, "showBunny").onFinishChange(function() {}),
  5870. v.add(h.warp, "fastTime", 0, 2500).step(10).onFinishChange(function() {}),
  5871. v.add(h.warp, "movementEasing", Object.keys(a));
  5872. var A = n.addFolder("Misc");
  5873. A.add(h, "dollhouseFOV", 10, 180).onChange(function() {
  5874. i.cameras[s.DOLLHOUSE].fov = h.dollhouseFOV
  5875. }),
  5876. A.add(h, "insideFOV", 10, 180).onChange(function() {
  5877. i.cameras[s.PANORAMA].fov = h.insideFOV
  5878. }),
  5879. A.add(h, "insideLookSpeed", .01, .3).step(.01).onChange(function() {}),
  5880. A.add(h, "rotationAccelerationInside", .1, 10).step(.1).onChange(function() {}),
  5881. A.add(h, "rotationAccelerationOutside", .1, 10).step(.1).onChange(function() {});
  5882. var y = n.addFolder("Navigation");
  5883. y.add(h.navigation, "panoScores").onFinishChange(function() {
  5884. h.navigation.panoScores || e.panos.forEach(function(e) {
  5885. e.floor.remove(e.text3d),
  5886. e.text3d = null
  5887. })
  5888. }),
  5889. y.add(h.navigation, "mouseDirection"),
  5890. y.add(h.navigation, "filterStrictness", 0, 1),
  5891. y.add(h.navigation, "angleFactor", -60, 0),
  5892. y.add(h.navigation, "directionFactor", 1, 20),
  5893. y.add(h.navigation, "distanceFactor", -5, 5),
  5894. y.add(h.navigation, "optionalityFactor", .1, 10);
  5895. var C = n.addFolder("tags")
  5896. , I = C.addFolder("Tag Creation");
  5897. I.add(h.tags.pole, "enabled").name("poleEnabled"),
  5898. I.add(h.tags.pole, "height", 0, 2.5).step(.01).name("poleHeight"),
  5899. I.add(h.tags.pole, "width", 1, 10).step(1).name("poleWidth"),
  5900. I.add(h.tags.pole, "opacity", .1, 1).step(.1).name("poleOpacity");
  5901. var E = C.addFolder("Visibility");
  5902. E.add(h.tags.visibility, "anyDistance"),
  5903. E.add(h.tags.visibility, "visibleDistance", .1, 30).step(.1),
  5904. E.add(h.tags.visibility, "cameraClearance", 0, 1).step(.01),
  5905. E.add(h.tags.visibility, "hideViaFloor"),
  5906. E.add(h.tags.visibility, "hideOffScreenDisc").name("hideEdgeDisc"),
  5907. E.add(h.tags.visibility, "hideOffScreenObject").name("hideEdgeObject");
  5908. var b = C.addFolder("Disc Parameters");
  5909. b.add(h.tags.disc.scale, "nearBound", .1, 10).step(.1),
  5910. b.add(h.tags.disc.scale, "farBound", .1, 20).step(.1).listen(),
  5911. b.add(h.tags.disc.scale, "linkFarBound").onChange(function(e) {
  5912. e && (h.tags.disc.scale.farBound = h.tags.visibility.visibleDistance * (1 - h.tags.disc.scale.linkPercent / 100))
  5913. }),
  5914. b.add(h.tags.disc.scale, "linkPercent", 0, 100).step(1).onChange(function(e) {
  5915. h.tags.disc.scale.linkFarBound && (h.tags.disc.scale.farBound = h.tags.visibility.visibleDistance * (1 - e / 100))
  5916. }),
  5917. b.add(h.tags.disc.scale, "maxSize", 40, 200).step(1),
  5918. b.add(h.tags.disc.scale, "minSize", 20, 100).step(1),
  5919. b.add(h.tags.disc.scale, "responsiveness", 0, 100).step(1);
  5920. var w = C.addFolder("Navigate");
  5921. w.add(h.tags.navigate, "nearestPano").name("nearestPano"),
  5922. w.add(h.tags.navigate, "lineOfSight").name("lineOfSight"),
  5923. w.add(h.tags.navigate, "reactivate").name("reactivate"),
  5924. w.add(h.tags.navigate, "aimAt", ["disc", "object", "pole", "nothing"]).name("aim at"),
  5925. w.add(h.tags.navigate, "tiltTolerance", 0, 50).step(1),
  5926. w.add(h.tags.navigate, "rotateSpeedFactor", 0, 5).step(.1);
  5927. var _ = n.addFolder("Debug");
  5928. _.add(h, "wireframe").onFinishChange(function() {
  5929. e.chunks.forEach(function(t) {
  5930. t.material && (t.wireframeTwin || (t.wireframeTwin = new o.WireframeHelper(t),
  5931. t.wireframeTwin.material.depthWrite = !1,
  5932. t.wireframeTwin.material.depthTest = !1,
  5933. t.wireframeTwin.material.opacity = .5,
  5934. t.wireframeTwin.material.transparent = !0),
  5935. h.wireframe ? e.add(t.wireframeTwin) : e.remove(t.wireframeTwin))
  5936. })
  5937. }),
  5938. _.add(h, "skyboxWireframe").onFinishChange(function() {
  5939. h.skyboxWireframe ? (e.skybox.wireframe = new o.WireframeHelper(e.skybox),
  5940. e.add(e.skybox.wireframe)) : (e.remove(e.skybox.wireframe),
  5941. e.skybox.wireframe = null)
  5942. }),
  5943. _.add(h, "showSweeps").onFinishChange(function() {
  5944. e.setSweepVisibility(h.showSweeps)
  5945. }),
  5946. _.add(h, "showMesh").onFinishChange(function() {
  5947. e.chunks.forEach(function(e) {
  5948. e.visible = h.showMesh
  5949. })
  5950. }),
  5951. _.add(h, "showFloors").onFinishChange(function() {
  5952. e.floors.forEach(function(e) {
  5953. e.collider.children.forEach(function(e) {
  5954. e.material.visible = h.showFloors
  5955. })
  5956. })
  5957. }),
  5958. _.add(h, "showSkyboxes").onFinishChange(function() {
  5959. e.panos.forEach(function(e) {
  5960. e.skyboxMesh.visible = h.showSkyboxes
  5961. })
  5962. }),
  5963. _.add(h, "showNeighbors").onChange(function() {}),
  5964. _.add(e, "alpha", 0, 1)
  5965. }
  5966. var r = e("../lib/dat.gui")
  5967. , o = e("three")
  5968. , a = e("../util/easing")
  5969. , s = e("../enum/Viewmode")
  5970. , l = e("../enum/Colors")
  5971. , c = e("../enum/WarpStyle")
  5972. , h = e("../settings");
  5973. e("../tag/tag");
  5974. r.GUI.prototype.removeFolder = function(e) {
  5975. var t = this.__folders[e];
  5976. t && (t.close(),
  5977. this.__ul.removeChild(t.domElement.parentNode),
  5978. delete this.__folders[e],
  5979. this.onResize())
  5980. }
  5981. ,
  5982. t.exports.toggle = n
  5983. }
  5984. , {
  5985. "../enum/Colors": 19,
  5986. "../enum/Viewmode": 51,
  5987. "../enum/WarpStyle": 52,
  5988. "../lib/dat.gui": 93,
  5989. "../tag/tag": 123,
  5990. "../settings": 166,
  5991. "../util/easing": 186,
  5992. three: 217
  5993. }],
  5994. 64: [function(e, t, i) {
  5995. (function(i) {
  5996. "use strict";
  5997. function n(e, t, i, n) {
  5998. $(".gui-error .error-problem-text").text(e),
  5999. $(".gui-error .error-solution-text").text(t),
  6000. $(".gui-error .error-explanation").text(i),
  6001. $(".gui-error .error-actions").html(n),
  6002. $(window).resize(),
  6003. $(".gui-error").fadeIn(),
  6004. $("#bottom-logo").fadeIn()
  6005. }
  6006. function r(e) {
  6007. 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("");
  6008. n(e, h.ERROR_BROWSER_SOLUTION, h.ERROR_BROWSER_EXPLANATION, t),
  6009. s.isMobile() || $("[rel=tiletip]").tooltip({
  6010. placement: "bottom",
  6011. delay: {
  6012. show: 50,
  6013. hide: 0
  6014. },
  6015. trigger: "hover",
  6016. viewport: {
  6017. selector: "body",
  6018. padding: 10
  6019. }
  6020. })
  6021. }
  6022. function o() {
  6023. var e = s.isMobile() ? "" : '<span class="link install-browser">' + h.ERROR_GENERIC_ACTIONS_2 + "</span>" + h.ERROR_GENERIC_ACTIONS_3
  6024. , t = [h.ERROR_GENERIC_ACTIONS_1, e,].join("");
  6025. n(h.ERROR_GENERIC_PROBLEM, h.ERROR_GENERIC_SOLUTION, "", t),
  6026. s.isMobile() || $(".install-browser").on("click touchstart", function(e) {
  6027. e.preventDefault(),
  6028. e.stopPropagation(),
  6029. r(" ")
  6030. })
  6031. }
  6032. function a(e) {
  6033. if ($("head title").text(c.pageTitle),
  6034. $("#gui-message, #gui-loading, #nprogress, #gui-thumb, #bottom-logo").hide(),
  6035. $("#gui-loading").fadeOut(250),
  6036. $("#quick-blackout").hide(),
  6037. l.track("showcase_error", {
  6038. error_key: e
  6039. }),
  6040. h.locale || h.init(),
  6041. "webgl-unsupported" === e)
  6042. s.isMobile() ? o() : r(h.ERROR_WEBGL_UNSUPPORTED_PROBLEM);
  6043. else if ("webgl-ios" === e)
  6044. 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>.");
  6045. else if ("webgl-safari" === e)
  6046. 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>.");
  6047. else if ("webgl-generic" === e)
  6048. o();
  6049. else if ("missing-urls" === e)
  6050. n(h.ERROR_MISSING_URLS_PROBLEM, "", h.ERROR_MISSING_URLS_EXPLANATION);
  6051. else if ("loading-failed" === e)
  6052. 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>.");
  6053. else {
  6054. if ("loading-failed-maintenance" !== e)
  6055. return void d.error("Unhandled error: " + e);
  6056. n(h.ERROR_MAINTENANCE_PROBLEM, h.ERROR_MAINTENANCE_SOLUTION)
  6057. }
  6058. }
  6059. var s = e("./../util/browser")
  6060. , l = e("./../analytics")
  6061. , c = e("./../settings")
  6062. , h = e("../localization/localize")
  6063. , u = e("./../util/logger")
  6064. , d = new u(i)
  6065. , p = '"https://support.port.com/hc/articles/208220058"';
  6066. t.exports.error = a
  6067. }
  6068. ).call(this, "/js/gui/error.js")
  6069. }
  6070. , {
  6071. "../localization/localize": 108,
  6072. "./../analytics": 4,
  6073. "./../settings": 166,
  6074. "./../util/browser": 182,
  6075. "./../util/logger": 189
  6076. }],
  6077. 65: [function(e, t, i) {
  6078. (function(i) {
  6079. "use strict";
  6080. function n() {
  6081. Ue = [],
  6082. je.floors.visible && Ue.push(".gui-floor", ".gui-floor-title"),
  6083. Ue.push(".hideTarget", ".pinTop.right")
  6084. }
  6085. function r() {
  6086. for (var e in je)
  6087. if (je.hasOwnProperty(e)) {
  6088. var t = je[e];
  6089. if (!t.visible)
  6090. for (var i = 0; i < t.elements.length; i++)
  6091. $(t.elements[i]).hide()
  6092. }
  6093. je.highlight.visible && $(".pinBottom").addClass("highlightExists"),
  6094. je.tourControls.visible === !1 && $("#drawer").addClass("fullWidth"),
  6095. n()
  6096. }
  6097. function o(e, t) {
  6098. var i = !K.isMobile() && Q.zoom.enabled && t.mode === _e.PANORAMA && !e.tourIsPlaying;
  6099. $("#gui-zoomin").toggle(i),
  6100. $("#gui-zoomout").toggle(i)
  6101. }
  6102. function a() {
  6103. c(),
  6104. $(".pinBottom").toggleClass("open"),
  6105. $("#drawer").toggleClass("open"),
  6106. $(".footer").toggleClass("open"),
  6107. $("#drawer").hasClass("open") ? ($("#pullTab .icon").attr("data-original-title", Re.CLOSE_HIGHLIGHTS),
  6108. Ze("highlights")) : ($("#pullTab .icon").attr("data-original-title", Re.OPEN_HIGHLIGHTS),
  6109. ie.resetDrawer()),
  6110. setTimeout(function() {
  6111. $("#pullTab").toggleClass("opened");
  6112. }, $("#drawer").hasClass("open") ? 0 : Q.highlightAnimationDuration),
  6113. $(".pinBottom").hasClass("open") && s($(".vr-popup")) && $(".vr-popup").is(":visible") && Ae.dismiss()
  6114. }
  6115. function s(e) {
  6116. var t;
  6117. "none" !== e.css("display") ? t = e.position().top + e.outerHeight() : (e.attr("style", "visibility: hidden"),
  6118. t = e.position().top + e.outerHeight(),
  6119. e.attr("style", "display: none"));
  6120. var i = $("#player").outerHeight()
  6121. , n = i - 130;
  6122. return n < t + 25
  6123. }
  6124. function l(e) {
  6125. "touchstart" === e.type && e.preventDefault(),
  6126. e.stopPropagation()
  6127. }
  6128. function c() {
  6129. W && (W.reload(),
  6130. W.init())
  6131. }
  6132. function h(e) {
  6133. ne.show(e),
  6134. r()
  6135. }
  6136. function u(e) {
  6137. ne.progress(e)
  6138. }
  6139. function d(e, t, i) {
  6140. var n = t.player;
  6141. $("#gui-thumb").fadeOut(2500),
  6142. ne.hide(function() {
  6143. Ge = !1
  6144. }),
  6145. me.init(e, i),
  6146. de.finishSetup(Object.keys(e.tags).length),
  6147. i.on(Te.IMAGE_OPENED, Ze.bind(this, "tag"));
  6148. var s = function() {
  6149. i.dismissExaminedTag(),
  6150. i.disableHovering()
  6151. };
  6152. Ae.on(ye.OPENED, s),
  6153. Ce.on(Me.OPENED, s),
  6154. he.on(ue.OPENED, s),
  6155. fe.on(ge.OPENED, s);
  6156. var l = i.enableHovering.bind(i);
  6157. if (Ae.on(ye.CLOSED, l),
  6158. Ce.on(Me.CLOSED, l),
  6159. he.on(ue.CLOSED, l),
  6160. fe.on(ge.CLOSED, l),
  6161. Q.labels.enabled && Object.keys(e.labels).length,
  6162. e.floors.length <= 1 || !je.floors.visible ? je.floors.visible = !1 : (y(e, t),
  6163. C(e.currentFloor, n.mode)),
  6164. getQueryVariable('m') === '372'&& (je.floors.visible = 1, y(e,t)),
  6165. r(),
  6166. o(t, t.player),
  6167. $("#gui").fadeIn(1500),
  6168. je.highlight.visible && (2 !== Q.startHighlights || e.has360Views) && setTimeout(function() {
  6169. a(),
  6170. (!e.has360Views && 1 !== Q.startHighlights || e.has360Views && 0 === Q.startHighlights) && setTimeout(a, 2e3)
  6171. }, 2e3),
  6172. !K.isMobile())
  6173. for (var c = ["a", "#title-toggle", ".next-button", ".prev-button", ".gui-floor", ".meta-toggle", ".thumbImg", "logo-button"], h = 0; h < c.length; h++)
  6174. $(c[h]).addClass("hasHover");
  6175. O(e),
  6176. de.setupToggling();
  6177. //xzw:
  6178. window.editHotPanel && editHotPanel();
  6179. //czj
  6180. navBorderRadius(e);
  6181. //czj 编辑界面
  6182. //window.EditingInterface && new EditingInterface(n.sceneRenderer);
  6183. window.EditTools && new EditTools(n.sceneRenderer);
  6184. }
  6185. function navBorderRadius(e){
  6186. var pullTab = $("#pullTab"),
  6187. mobileRadius = {
  6188. "bottom":{"border-bottom-left-radius":"10px","border-bottom-right-radius":"10px"},
  6189. "top":{"border-top-left-radius":"10px","border-top-right-radius":"10px"}
  6190. },
  6191. topRadius = {
  6192. "bottom":{"border-top-right-radius":"10px","border-bottom-right-radius":"10px"},
  6193. "top":{"border-bottom-left-radius":"10px","border-top-left-radius":"10px"}
  6194. };
  6195. function BorderRadius(bottom,top){
  6196. $("#gui-modes-map > div:visible:last").css(bottom);
  6197. if(pullTab.is(':visible')){
  6198. $(".viewContainer > div:visible:first").css(top);
  6199. }else{
  6200. $("#gui-modes-map > div:visible:first").css(top);
  6201. }
  6202. }
  6203. if(/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)){
  6204. BorderRadius(mobileRadius.bottom,mobileRadius.top);
  6205. }else{
  6206. BorderRadius(topRadius.bottom,topRadius.top);
  6207. }
  6208. //判断someData里面是否有special字段,如果有就会处理这些特殊的大场景
  6209. if(window.MP_PREFETCHED_MODELDATA.model.special || window.MP_PREFETCHED_MODELDATA.special){
  6210. window.specialScene && specialScene.special().afterImplement();
  6211. }
  6212. }
  6213. function p(e) {
  6214. e || (e = 0),
  6215. We = !1,
  6216. window.setTimeout(function() {
  6217. We || (ze = !0,
  6218. $("#gui-spinner").stop(!0, !0).show())
  6219. }
  6220. .bind(this), e)
  6221. }
  6222. function f() {
  6223. $("#gui-spinner").stop(!0, !0),
  6224. $("#gui-spinner").fadeOut(1e3),
  6225. We = !0,
  6226. ze = !1
  6227. }
  6228. function g(e, t) {
  6229. var i = e.mode
  6230. , n = t || e.currentPano;
  6231. $("#gui-modes-dollhouse").toggleClass("active", i === _e.DOLLHOUSE),
  6232. $("#gui-modes-floorplan").toggleClass("active", i === _e.FLOORPLAN),
  6233. $("#gui-modes-inside").toggleClass("active", i === _e.PANORAMA),
  6234. i === _e.PANORAMA ? ($("#view-controllers").slideUp(500),
  6235. Q.show360Views.enabled && !n.isAligned() ? (
  6236. $(".gui-floor").addClass("hidden"),
  6237. $("#gui-modes-outside").addClass("desktop-only")) : (
  6238. $(".gui-floor").removeClass("hidden"),
  6239. $("#gui-modes-outside").removeClass("desktop-only")),
  6240. $("#gui-modes-outside").removeClass("hidden")) : i !== _e.TRANSITIONING && (f(),
  6241. Be = i,
  6242. $("#gui-modes-outside").addClass("hidden"),
  6243. e.model.has360Views && $(".gui-floor").removeClass("hidden"),
  6244. $("#view-controllers").is(":visible") || $("#view-controllers").slideDown(Q.guiAnimationSpeed))
  6245. }
  6246. function m(e, t) {
  6247. var i = t.player;
  6248. $("#gui-modes-inside").on("mousedown touchstart", function(e) {
  6249. l(e),
  6250. J.updateInteraction(Se.InteractionGui, "inside-button"),
  6251. J.track("USER", {
  6252. event_type: "showcase_gui",
  6253. gui_action: "click_inside_mode_button"
  6254. }),
  6255. t.changeMode(_e.PANORAMA);
  6256. }),
  6257. $("#gui-modes-outside").find("a").on("click", function(e) {
  6258. l(e),
  6259. J.track("showcase_gui", {
  6260. gui_action: "click_outside_mode_button"
  6261. }),
  6262. t.changeMode(Be)
  6263. }),
  6264. $("#gui-modes-floorplan").on("click", function(e) {
  6265. l(e),
  6266. i.mode !== _e.FLOORPLAN && (J.track("showcase_gui", {
  6267. gui_action: "click_floorplan_mode_button"
  6268. }),
  6269. t.changeMode(_e.FLOORPLAN));
  6270. }),
  6271. $("#gui-modes-dollhouse").on("click", function(e) {
  6272. l(e),
  6273. i.mode !== _e.DOLLHOUSE && (J.track("showcase_gui", {
  6274. gui_action: "click_dollhouse_mode_button"
  6275. }),
  6276. t.changeMode(_e.DOLLHOUSE));
  6277. })
  6278. }
  6279. function v(e, t) {
  6280. function i() {
  6281. document.getElementById("vr").classList.remove("hidden"),
  6282. Q.vr.allowWebVR ? K.getVRDisplay().then(function(e) {
  6283. K.supportsFullscreen() ? n(e) : (De.warn("Unable to use WebVR when full screen is not supported"),
  6284. $(".improper-embed").toggleClass("hidden", !1),
  6285. r())
  6286. }, function(e) {
  6287. r()
  6288. }) : r()
  6289. }
  6290. function n(i) {
  6291. De.info(i.displayName + " detected, VR button activates WebVR experience"),
  6292. Ie.init(e.data, t, i, q),
  6293. Ie.on(Ee.OPENED, Ze.bind(gui, "vr")),
  6294. Ie.on(Ee.SHOW_TERMS, fe.show.bind(fe))
  6295. }
  6296. function r() {
  6297. De.info("WebVR support not found, VR button activates native app VR modal"),
  6298. Ae.init(e.data, q),
  6299. Ae.on(ye.OPENED, function() {
  6300. var e = document.getElementById("vr-modal");
  6301. return function() {
  6302. Ze("vr"),
  6303. le.open(e)
  6304. }
  6305. }()),
  6306. Ae.on(ye.CLOSED, le.reset)
  6307. }
  6308. if (Q.vr.enabled && e.supportsVR && !K.valueFromHash("mls", 0)){
  6309. /*********************** 方奕卓 VR功能事件监听 ********************/
  6310. K.isMobile() && $('#vr').css('display', ''); // 显示vr功能按钮
  6311. switch (Q.vr.option) {
  6312. case Pe.CONTEXTUAL:
  6313. i();
  6314. break;
  6315. case Pe.ANDROID:
  6316. K.detectAndroid() && i();
  6317. break;
  6318. case Pe.NONE:
  6319. }
  6320. }
  6321. }
  6322. function A(e, t) {
  6323. $("#play").on("mousedown touchstart", function(e) {
  6324. l(e);
  6325. Ze("tour");
  6326. ve.play();
  6327. J.trackAlways("showcase_gui", {
  6328. gui_action: "play_highlights"
  6329. })
  6330. }),
  6331. window.startAndPlay = function(e) {
  6332. // l(e);
  6333. Ze("tour");
  6334. ve.play();
  6335. J.trackAlways("showcase_gui", {
  6336. gui_action: "play_highlights"
  6337. })
  6338. };
  6339. $("#pause").on("mousedown touchstart", function(e) {
  6340. l(e),
  6341. ve.pause(),
  6342. J.trackAlways("showcase_gui", {
  6343. gui_action: "pause_highlights"
  6344. })
  6345. }),
  6346. $("#gui-zoomin").find("a").on("click", function(e) {
  6347. l(e),
  6348. t.player.zoomInIncrementally()
  6349. }),
  6350. $("#gui-zoomout").find("a").on("click", function(e) {
  6351. l(e),
  6352. t.player.zoomOutIncrementally()
  6353. })
  6354. }
  6355. function y(e, t) {
  6356. for (var i = $(".gui-floor"), n = 0; n < e.floors.length; n++) {
  6357. if(getQueryVariable('m') === '372') continue;
  6358. var r = $('<div class="floorChoice" data-index="' + n + '"></div>').text(e.floors.get(n).name);
  6359. $(".gui-floor").find(".container").prepend(r)
  6360. //cxz 本来一开始是prepend 后来改了append 按顺序插入
  6361. }
  6362. i.find(".container").prepend('<div class="floorChoice darkGlass allFloorBtn" data-index="all" style="display:none">' + Re.FLOOR_ALL + "</div>"),
  6363. i.on("click", function(e) {
  6364. l(e),
  6365. Ze("floor"),
  6366. i.toggleClass("open")
  6367. }),
  6368. $(".floorChoice").on("click", function(e) {
  6369. l(e);
  6370. var n = $(this).data("index");
  6371. "all" !== n ? (J.updateInteraction(Se.InteractionGui, "floor-control"),
  6372. t.player.gotoFloor(n),
  6373. J.track("showcase_gui", {
  6374. gui_action: "click_floor_select_button",
  6375. interaction_source: "gui"
  6376. })) : (J.updateInteraction(Se.InteractionGui, "floor-control"),
  6377. Ze("move"),
  6378. t.allFloors(),
  6379. J.track("showcase_gui", {
  6380. gui_action: "click_toggle_all_floors_button",
  6381. interaction_source: "gui"
  6382. })),
  6383. i.removeClass("open")
  6384. })
  6385. }
  6386. function C(e, t) {
  6387. 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()),
  6388. e.model.allFloorsVisible ? ($(".gui-floor-title").text(Re.FLOOR_ALL),
  6389. $(".gui-floor-number").text(Re.FLOOR_ALL),
  6390. $(".floorChoice").removeClass("active"),
  6391. $('.floorChoice[data-index="all"]').addClass("active")) : ($(".gui-floor-title").text(e.name),
  6392. $(".gui-floor-number").text(" " + (e.floorIndex + 1)),
  6393. $(".floorChoice").removeClass("active"),
  6394. $(".floorChoice[data-index=" + e.floorIndex + "]").addClass("active")))
  6395. }
  6396. function I(e) {
  6397. return e.describe().inTransition
  6398. }
  6399. function b(e, t, i) {
  6400. Fe = e.heroLocations.length;
  6401. var n = '<li class="thumbImg" data-index=""><img src=""></li>'
  6402. , r = 100 / Fe + "%"
  6403. , o = $("#thumb-container")
  6404. , a = $("#progressBar");
  6405. $("#status").find(".totalSteps").text(Fe);
  6406. for (var s = 0; s < Fe; s++) {
  6407. var c = e.heroLocations[s]
  6408. , h = $(n);
  6409. if (h.attr("data-index", s),
  6410. je.highlight.visible && h.find("img").attr("src", c.thumbUrl),
  6411. c.name) {
  6412. var u = $('<div class="overlay"></div>').text(c.name);
  6413. h.prepend(u)
  6414. }
  6415. if (e.has360Views && c.cameraMode === _e.PANORAMA) {
  6416. var d = e.panos.get(c.panoId)
  6417. , p = d && !d.isAligned()
  6418. , 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>';
  6419. h.prepend(f)
  6420. }
  6421. o.append(h),
  6422. a.append('<div class="step" data-idx="' + s + '" style="width:' + r + '"></div>')
  6423. }
  6424. j = 144 * Fe,
  6425. Y = 111 * Fe,
  6426. $(".thumbImg").on("mouseover", function() {
  6427. I(t) || i.showPathToHeroLocation($(this).data("index"))
  6428. }),
  6429. $(".thumbImg").on("mouseout", function() {
  6430. t.clearPath()
  6431. }),
  6432. $(".thumbImg").on("click", function(e) {
  6433. l(e);
  6434. var i = $(this);
  6435. J.updateInteraction(Se.InteractionGui, "thumbnail"),
  6436. J.trackAlways("showcase_gui", {
  6437. gui_action: "click_highlight"
  6438. }),
  6439. t.goToHighlight(i.data("index"))
  6440. }),
  6441. $(".previous").find("a").on("click", function(e) {
  6442. l(e),
  6443. J.trackAlways("showcase_gui", {
  6444. gui_action: "prev_highlight"
  6445. }),
  6446. t.prevHighlight()
  6447. }),
  6448. $(".next").find("a").on("click", function(e) {
  6449. l(e),
  6450. J.trackAlways("showcase_gui", {
  6451. gui_action: "next_highlight"
  6452. }),
  6453. t.nextHighlight()
  6454. }),
  6455. $("#drawer").on("mouseleave", function(e) {
  6456. l(e);
  6457. var t;
  6458. try {
  6459. t = new MouseEvent("mouseup",{
  6460. clientX: e.clientX,
  6461. clientY: e.clientY,
  6462. screenX: e.screenX,
  6463. screenY: e.screenY
  6464. })
  6465. } catch (i) {
  6466. t = document.createEvent("MouseEvents"),
  6467. 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)
  6468. }
  6469. document.dispatchEvent(t)
  6470. }),
  6471. W = new Sly($("#scrollFrame"),{
  6472. horizontal: !0,
  6473. itemNav: "centered",
  6474. smart: !0,
  6475. scrollTrap: !0,
  6476. scrollBy: 1,
  6477. mouseDragging: !0,
  6478. touchDragging: !0,
  6479. speed: 300,
  6480. dragHandle: !0,
  6481. dynamicHandle: !0,
  6482. clickBar: !0,
  6483. scrollBar: $("#scroller"),
  6484. activateOn: null
  6485. }).init(),
  6486. W.on("active", function(e, t) {
  6487. Ve = t,
  6488. Ze("tour"),
  6489. $(".step").removeClass("active"),
  6490. $("#status").find(".curIdx").text(t + 1);
  6491. for (var i = 0; i <= t; i++)
  6492. $("#progressBar").find("[data-idx='" + i + "']").addClass("active")
  6493. }),
  6494. w()
  6495. }
  6496. function w() {
  6497. var e = $("#player").width() - 20
  6498. , t = $("#scroller")
  6499. , i = $("#drawer")
  6500. , n = $(".pinBottom");
  6501. if ($("#player").width() < 488 || $("#player").height() < 488)
  6502. t.addClass("hidden"),
  6503. i.addClass("noScroll"),
  6504. n.addClass("noScroll");
  6505. else {
  6506. var r = j > e
  6507. , o = !i.hasClass("noScroll")
  6508. , a = r !== o;
  6509. a && (t.toggleClass("hidden"),
  6510. i.toggleClass("noScroll"),
  6511. n.toggleClass("noScroll"))
  6512. }
  6513. }
  6514. function _(e) {
  6515. je.tourControls.visible = true//e.tour_buttons && K.valueFromHash("gt", 1),
  6516. je.coBrand.visible = e.presented_by && 1 !== Q.specialEdition && Q.brand && !K.valueFromHash("mls", !1),
  6517. je.highlight.visible = /* e.highlight_reel && */ 1 !== Q.specialEdition && Q.showHighlights
  6518. }
  6519. function T(e) {
  6520. function t(t, i) {
  6521. return !!e.player_options[t] && e[i || t]
  6522. }
  6523. $(".model-title").text(e.name);
  6524. var i = Q.pageTitle;
  6525. // 2 !== K.valueFromHash("mls", 0) && (i = e.name + " - " + i),
  6526. 2 !== K.valueFromHash("mls", 0) && e.name && (i = e.name),
  6527. document.title = i ,
  6528. K.isMobile() ? $("#gui-fullscreen").css("display", "none") : ($("[rel=tooltip]").tooltip({
  6529. delay: {
  6530. show: 50,
  6531. hide: 0
  6532. },
  6533. trigger: "hover",
  6534. html: !1,
  6535. viewport: {
  6536. selector: "body",
  6537. padding: 10
  6538. }
  6539. }),
  6540. K.inIframe() && document.getElementsByClassName("pinBottom-container")[0].classList.add("embed")),
  6541. // 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"),
  6542. de.populate({
  6543. name: t("model_name", "name"),
  6544. coBrand: t("presented_by"),
  6545. description: t("model_summary", "summary") || "暂无内容",
  6546. contactName: t("contact_name"),
  6547. address: t("address"),
  6548. phone: t("contact_phone"),
  6549. formattedPhone: e.formatted_contact_phone,
  6550. email: t("contact_email"),
  6551. url: t("external_url"),
  6552. socialSharing: e.enable_social_sharing && e.is_public
  6553. })
  6554. }
  6555. function x(e, t, i, n, r, o) {
  6556. function a() {
  6557. o.setLoadingStartTime(),
  6558. H(),
  6559. r ? (re.showMessage(t, i, je.coBrand.visible),
  6560. l()) : h(l)
  6561. }
  6562. var s = $.Deferred()
  6563. , l = s.resolve.bind(s);
  6564. return Ge = !0,
  6565. O(e),
  6566. e.data.player_options && _(e.data.player_options),
  6567. 1 === Q.specialEdition && $("body").addClass("specialEdition"),
  6568. Re.localizeGUI(),
  6569. T(e.data),
  6570. r || $(".quick").addClass("hidden"),
  6571. //e.data.image && !r && E(e.data.image),
  6572. n ? (J.impression(),
  6573. a()) : (o.setWaitingStartTime(),
  6574. oe.show(r, a)),
  6575. s
  6576. }
  6577. function S(e, t, i, n, r, a, s) {
  6578. q = s,
  6579. e.outsideAllowed() || $("#gui-modes-outside").addClass("invisible"),
  6580. e.supportedModes[_e.PANORAMA] || $("#gui-modes-inside").addClass("invisible"),
  6581. ae.init(),
  6582. re.init(e, a),
  6583. Oe.init(e, t, n),
  6584. $(".icon").on("mouseover", function() {
  6585. t.player && t.player.reticule.hide()
  6586. }),
  6587. m(e, t),
  6588. A(e, t),
  6589. e.data.enable_social_sharing && e.data.is_public && Q.share.enabled && (Ce.init(MP_PREFETCHED_MODELDATA.name/* e.data.name */),
  6590. Ce.on(Me.OPENED, function() {
  6591. var e = document.getElementById("share-modal");
  6592. return function() {
  6593. Ze("share"),
  6594. le.open(e)
  6595. }
  6596. }()),
  6597. Ce.on(Me.CLOSED, le.reset)),
  6598. e.heroLocations.length > 1 ? b(e, t, i) : (je.highlight.visible = !1,
  6599. je.tourControls.visible = !1),
  6600. de.on(pe.OPEN_INFO, Ze.bind(this, "info")),
  6601. z(),
  6602. g(i),
  6603. v(e, r),
  6604. e.on("floor.changed", C),
  6605. e.on("waiting", R.bind(this, e)),
  6606. e.on("waiting-done", P.bind(this, e)),
  6607. i.on(xe.ModeChanged, function(e, n) {
  6608. g(i),
  6609. o(t, i),
  6610. n === _e.PANORAMA && i.currentPano && !i.currentPano.isAligned() && (n = _e.OUTDOOR),
  6611. he.updateMode(n)
  6612. }),
  6613. n.on(Se.Move, Ze.bind(this, "move")),
  6614. i.on(xe.Ready, function() {
  6615. ie.init(n, i, i.tagManager, t),
  6616. i.on(xe.ModeChanged, function(e, t) {
  6617. e !== t && $(".vr-popup").is(":visible") && Ae.dismiss()
  6618. })
  6619. }),
  6620. i.on(xe.PanoChosen, function(e, t) {
  6621. g(i, t),
  6622. he.updateMode(t && !t.isAligned() ? _e.OUTDOOR : _e.PANORAMA)
  6623. }),
  6624. le.on(ce.CLOSE, function(e) {
  6625. switch (e) {
  6626. case "vr-modal":
  6627. Ae.dismiss();
  6628. break;
  6629. case "share-modal":
  6630. Ce.hide();
  6631. break;
  6632. case "terms-modal":
  6633. fe.hide()
  6634. }
  6635. });
  6636. var l = $("#play").eq(0)
  6637. , c = $("#pause").eq(0)
  6638. , h = $(".pinBottom").toArray()
  6639. , u = $("#drawer").eq(0)
  6640. , d = $("#playHead").eq(0)
  6641. , p = $("#progressBar").eq(0)
  6642. , f = $("#thumb-container").eq(0)
  6643. , y = f.children()
  6644. , I = p.children();
  6645. t.on("update.controls", function() {
  6646. var n = t.describe();
  6647. n.tourIsPlaying || i.isWarping() ? (je.tourControls.visible && (l.hide(),
  6648. c.show()),
  6649. n.tourInProgress && (h.forEach(function(e) {
  6650. e.classList.add("playing")
  6651. }),
  6652. u.addClass("playing"),
  6653. d.addClass("playing"))) : (je.tourControls.visible && (l.show(),
  6654. c.hide()),
  6655. n.tourInProgress || (ve.stopTour(),
  6656. h.forEach(function(e) {
  6657. e.classList.remove("playing")
  6658. }),
  6659. u.removeClass("playing"),
  6660. d.removeClass("playing")));
  6661. var r, a, s;
  6662. if (null !== n.currentItem) {
  6663. var p, f;
  6664. $("#status").find(".curIdx").text(n.currentItem + 1),
  6665. n.onTheBus ? (p = "active",
  6666. f = "recent") : (f = "active",
  6667. p = "recent");
  6668. var g = null === n.destinationItem || n.currentItem === n.destinationItem;
  6669. for (r = 0; r < e.heroLocations.length; r += 1)
  6670. s = y.eq(r),
  6671. a = I.eq(r),
  6672. s.removeClass(f),
  6673. a.removeClass(f),
  6674. n.onTheBus && r === n.destinationItem ? (s.addClass(p),
  6675. a.addClass(p),
  6676. W.activate(r)) : n.onTheBus && g && r === n.currentItem ? (s.addClass(p),
  6677. a.addClass(p)) : (s.removeClass(p),
  6678. a.removeClass(p))
  6679. } else
  6680. for (r = 0; r < e.heroLocations.length; r += 1)
  6681. s = y.eq(r),
  6682. a = I.eq(r),
  6683. s.removeClass("active recent"),
  6684. a.removeClass("active recent");
  6685. o(t, i)
  6686. }),
  6687. document.addEventListener("keydown", function(n) {
  6688. switch (J.updateInteraction(Se.InteractionKey),
  6689. n.which) {
  6690. case we.ZERO:
  6691. Q.debug && e.toggleAlpha();
  6692. break;
  6693. case we.NINE:
  6694. Q.debug && se.toggle();
  6695. break;
  6696. case we.ONE:
  6697. i.isInMode(_e.TRANSITIONING) || t.changeMode(_e.PANORAMA);
  6698. break;
  6699. case we.TWO:
  6700. e.outsideAllowed() && !i.isInMode(_e.DOLLHOUSE, _e.TRANSITIONING) && t.changeMode(_e.DOLLHOUSE);
  6701. break;
  6702. case we.THREE:
  6703. e.outsideAllowed() && !i.isInMode(_e.FLOORPLAN, _e.TRANSITIONING) && t.changeMode(_e.FLOORPLAN);
  6704. break;
  6705. case we.FOUR:
  6706. i.isInMode(_e.TRANSITIONING) || t.changeMode(_e.OUTDOOR);
  6707. break;
  6708. case we.SPACE:
  6709. je.tourControls.visible && ($("#playHead").hasClass("playing") || Ze("tour"));
  6710. break;
  6711. case we.RETURN:
  6712. Q.debug && e.toggleExplodeUp();
  6713. break;
  6714. case we.P:
  6715. k();
  6716. break;
  6717. case we.U:
  6718. B();
  6719. break;
  6720. case we.X:
  6721. Q.debug && e.toggleExplode();
  6722. break;
  6723. case we.PLUSEQUALS:
  6724. t.player.activatePersistentZooming(!0),
  6725. ie.hideUi();
  6726. break;
  6727. case we.DASHUNDERSCORE:
  6728. t.player.activatePersistentZooming(!1),
  6729. ie.hideUi();
  6730. break;
  6731. case we.SEVEN:
  6732. De.info("Zoom level: " + t.player.zoomLevel + ", FOV: " + t.player.zoomFov);
  6733. break;
  6734. case we.EIGHT:
  6735. t.player.decreaseZoomSpeed();
  6736. break;
  6737. case we.NINE:
  6738. t.player.increaseZoomSpeed()
  6739. }
  6740. return i && i.reticule.hide(),
  6741. !0
  6742. }
  6743. .bind(this)),
  6744. document.addEventListener("keyup", function(e) {
  6745. switch (e.which) {
  6746. case we.PLUSEQUALS:
  6747. t.player.deactivatePersistentZooming();
  6748. break;
  6749. case we.DASHUNDERSCORE:
  6750. t.player.deactivatePersistentZooming()
  6751. }
  6752. }
  6753. .bind(this)),
  6754. F(e),
  6755. L(e, t.player),
  6756. M(i),
  6757. te.setAutoPlay(e.heroCount()),
  6758. he.init(i, a.mode),
  6759. he.on(ue.OPENED, Ze.bind(this, "help")),
  6760. fe.init(),
  6761. fe.on(ge.OPENED, function() {
  6762. var e = document.getElementById("terms-modal");
  6763. return function() {
  6764. Ze("terms"),
  6765. le.open(e)
  6766. }
  6767. }()),
  6768. fe.on(ge.CLOSED, le.reset),
  6769. Q.quickstart.enabled || re.delayLanding(a.mode).then(re.showMessage.bind(this, i, t, je.coBrand.visible)),
  6770. (Q.quickstart.enabled || i.model.outsideAllowed()) && ie.init(n, i, i.tagManager, t),
  6771. Q.profiling.enabled && se.show(),
  6772. ve.init(t)
  6773. }
  6774. function M(e) {
  6775. var t = function(e, t) {
  6776. $(e).find("a").each(function(e, i) {
  6777. t ? $(i).removeClass("buttonZoomDisabled").addClass("buttonZoomEnabled") : $(i).addClass("buttonZoomDisabled").removeClass("buttonZoomEnabled"),
  6778. i.style.pointerEvents = t ? "auto" : "none"
  6779. })
  6780. }
  6781. , i = function() {
  6782. e.zoomLevel >= Q.zoom.max ? t("#gui-zoomin", !1) : t("#gui-zoomin", !0),
  6783. e.zoomLevel <= Q.zoom.min ? t("#gui-zoomout", !1) : t("#gui-zoomout", !0)
  6784. };
  6785. e.on(Ne.ZoomMax, function() {
  6786. t("#gui-zoomin", !1),
  6787. t("#gui-zoomout", !0)
  6788. }),
  6789. e.on(Ne.ZoomMin, function() {
  6790. t("#gui-zoomin", !0),
  6791. t("#gui-zoomout", !1)
  6792. }),
  6793. e.on(Ne.ZoomIn, function() {
  6794. t("#gui-zoomout", !0)
  6795. }),
  6796. e.on(Ne.ZoomOut, function() {
  6797. t("#gui-zoomin", !0)
  6798. }),
  6799. i()
  6800. }
  6801. function R(e) {
  6802. O(e)
  6803. }
  6804. function P(e) {
  6805. O(e)
  6806. }
  6807. function O(e) {
  6808. var t = e.waitQueue.length;
  6809. t <= 0 ? f() : Ge || p(Q.modelComponentLoadSpinnerDelay)
  6810. }
  6811. function L(e, t) {
  6812. He = {
  6813. gui: null,
  6814. visible: !1,
  6815. model: e,
  6816. player: t
  6817. }
  6818. }
  6819. function D(e, t) {
  6820. function i() {
  6821. var i = t.toJSON();
  6822. n.linkToLocation = window.location.protocol + "//" + window.location.host + window.location.pathname + "?m=" + e.sid + "&start=" + be.serialize(i),
  6823. t.tagManager.activeTag && (n.linkToLocation += "&tag=" + t.tagManager.activeTag.sid)
  6824. }
  6825. var n = {}
  6826. , r = new Le.GUI({
  6827. autoPlace: !0,
  6828. width: "60%"
  6829. });
  6830. i(),
  6831. t.on(xe.ViewChanged, i),
  6832. r.add(n, "linkToLocation").name(Re.LINK_TO_LOCATION).listen(),
  6833. r.domElement.id = "datLinks";
  6834. var o = [].slice.call(r.domElement.querySelectorAll(".property-name"));
  6835. return o.forEach(function(e) {
  6836. if (!K.detectSafari()) {
  6837. var t = document.createElement("button");
  6838. t.classList.add("btn-deep-link"),
  6839. t.innerText = Re.MENU_COPY,
  6840. e.nextSibling.appendChild(t);
  6841. var i = function() {
  6842. alert(Re.LINK_ALERT_COPY),
  6843. t.hide()
  6844. };
  6845. t.addEventListener("click", function(e) {
  6846. try {
  6847. var t = e.target.parentNode.childNodes[0];
  6848. t.select();
  6849. var n = document.execCommand("copy");
  6850. t.blur(),
  6851. n || i()
  6852. } catch (e) {
  6853. i()
  6854. }
  6855. })
  6856. }
  6857. }),
  6858. $(r.__closeButton).hide(),
  6859. r
  6860. }
  6861. function N(e) {
  6862. He.gui || (He.gui = D(He.model, He.player)),
  6863. He.visible = e,
  6864. e ? $(He.gui.domElement).show() : $(He.gui.domElement).hide()
  6865. }
  6866. function B() {
  6867. N(!He.visible)
  6868. }
  6869. function F(e) {
  6870. ke = {
  6871. gui: null,
  6872. visible: !1,
  6873. model: e
  6874. }
  6875. }
  6876. function V(e) {
  6877. var t = new Le.GUI;
  6878. return t.add(Q, "showSweeps").name("Show sweeps").onFinishChange(function() {
  6879. e.setSweepVisibility(Q.showSweeps)
  6880. }),
  6881. t.add(Q, "rotationAccelerationInside", .1, 10).name("Rotation speed").step(.1),
  6882. t.add(Q.transition, "flyTime", 0, 5e3).name("Transition time").onFinishChange(function() {
  6883. Q.transition.flySpeed = 0,
  6884. t.__controllers.forEach(function(e) {
  6885. e.updateDisplay()
  6886. })
  6887. }),
  6888. t.add(Q.path, "opacity", 0, 1).name("Path opacity"),
  6889. $(t.__closeButton).hide(),
  6890. t
  6891. }
  6892. function U(e) {
  6893. ke.gui || (ke.gui = V(ke.model)),
  6894. ke.visible = e,
  6895. e ? $(ke.gui.domElement).show() : $(ke.gui.domElement).hide()
  6896. }
  6897. function k() {
  6898. U(!ke.visible)
  6899. }
  6900. function H() {
  6901. function e(e) {
  6902. e.target === t || $.contains(t, e.target) || e.target === i || $.contains(i, e.target) || e.target === n || $.contains(n, e.target)/* || e.preventDefault()*/
  6903. }
  6904. $("body").css("touch-action", "none"),
  6905. $("#gui-parent").find("*:not(#tag-billboards)").on("touchmove", function(e) {
  6906. // e.preventDefault()
  6907. });
  6908. var t = document.getElementById("terms-text")
  6909. , i = document.getElementById("more-help-wrapper")
  6910. , n = (document.getElementById("navigation-help-wrapper"),
  6911. document.getElementById("help-dialog"),
  6912. document.getElementById("tag-billboards"));
  6913. Q.useWheel && (document.body.addEventListener("mousewheel", e, { passive: false }),
  6914. document.body.addEventListener("DOMMouseScroll", e)),
  6915. $("#terms-text, #more-help-wrapper, #navigation-help-wrapper").off("touchmove").on("touchmove", function(e) {
  6916. e.stopPropagation()
  6917. })
  6918. }
  6919. function G(e, t) {
  6920. for (var i = []; e; )
  6921. i.push(e),
  6922. e = e.parentNode;
  6923. for (; t && i.indexOf(t) === -1; )
  6924. t = t.parentNode;
  6925. return t
  6926. }
  6927. function z() {
  6928. var e, t = function(t) {
  6929. e = 0 === t.button || 1 === t.which ? t.target : null
  6930. }, i = function(t) {
  6931. e !== t.target && (e = G(e, t.target));
  6932. var i = document.getElementById("gui-parent");
  6933. if (G(i, e) !== i && (e = null),
  6934. e) {
  6935. var n;
  6936. try {
  6937. n = new MouseEvent("click",t)
  6938. } catch (e) {
  6939. n = document.createEvent("MouseEvents"),
  6940. 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)
  6941. }
  6942. n.syntheticClick = !0,
  6943. e.dispatchEvent(n),
  6944. e = null
  6945. }
  6946. };
  6947. document.body.addEventListener("mousedown", t, !0),
  6948. document.body.addEventListener("mouseup", i, !0),
  6949. document.getElementById("gui-parent").addEventListener("click", function(e) {
  6950. e.syntheticClick || (e.stopPropagation(),
  6951. "A" === e.target.nodeName && e.preventDefault())
  6952. }, !0)
  6953. }
  6954. var W, j, Y, X, Z, q, K = (e("three"),
  6955. e("../util/ajax"),
  6956. e("../util/browser")), Q = e("../settings"), J = e("../analytics"), ee = (e("../util/transitions"),
  6957. e("../util/camera"),
  6958. e("../util/logger")), te = (e("../objects/Snapshot"),
  6959. 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"),
  6960. e("../tag/Media/MediaEvent")), xe = (e("../enum/PathDiscardMode"),
  6961. e("../enum/PathDisplayMode"),
  6962. e("../enum/DirectorEvents"),
  6963. e("../enum/PlayerEvents")), Se = e("../enum/ControlEvents"), Me = e("./sharing/ShareEvents"), Re = e("../localization/localize"), Pe = (e("../enum/Vectors"),
  6964. e("../enum/WarpStyle"),
  6965. e("../enum/AlignmentType"),
  6966. e("../enum/VROption")), Oe = e("./konami"), Le = e("../lib/dat.gui"), De = new ee(i), Ne = (e("../util/showcase"),
  6967. e("../enum/ZoomEvents")), Be = _e.DOLLHOUSE, Fe = 0, Ve = 0, Ue = [".hideTarget"], ke = null, He = null, Ge = !1, ze = !1, We = !1, je = {
  6968. coBrand: {
  6969. visible: !0,
  6970. elements: [".co-brand", "#loaderCoBrand"]
  6971. },
  6972. help: {
  6973. visible: !0,
  6974. elements: [".nav-help", "#nav-help"]
  6975. },
  6976. tourControls: {
  6977. visible: !0,
  6978. elements: [".next", ".previous", "#play"]
  6979. },
  6980. highlight: {
  6981. visible: !0,
  6982. elements: ["#drawer", "#pullTab"]
  6983. },
  6984. share: {
  6985. visible: !0,
  6986. elements: [".socialButton", "#share"]
  6987. },
  6988. fullScreen: {
  6989. visible: !0,
  6990. elements: ["#gui-fullscreen"]
  6991. },
  6992. floors: {
  6993. visible: !0,
  6994. elements: [".gui-floor"]
  6995. }
  6996. }, Ye = function() {
  6997. var e = document.getElementById("drawer");
  6998. return function() {
  6999. $("#player").height() < 400 && e.classList.contains("open") && a()
  7000. }
  7001. }(), Xe = function() {
  7002. var e = document.getElementById("meta-info");
  7003. return function() {
  7004. $("#player").height() < 400 && e.classList.contains("expand") && de.toggleMeta(!0)
  7005. }
  7006. }(), Ze = function(e) {
  7007. function t() {
  7008. u.classList.contains("expand") && de.toggleMeta(!0)
  7009. }
  7010. function i() {
  7011. fe.hide()
  7012. }
  7013. function n() {
  7014. he.close()
  7015. }
  7016. function r() {
  7017. Ae.dismiss()
  7018. }
  7019. function o() {
  7020. p.hasClass("open") && a(!0)
  7021. }
  7022. function l() {
  7023. Ce.hide()
  7024. }
  7025. function c() {
  7026. f.hasClass("open") && f.removeClass("open")
  7027. }
  7028. function h() {
  7029. d.classList.contains("fadeIn") && (d.classList.contains("landing") ? re.dismissModal() : d.classList.contains("tour") && ve.dismissModal())
  7030. }
  7031. var u = document.getElementById("meta-info")
  7032. , d = document.getElementById("interaction-modal")
  7033. , p = $("#drawer").eq(0)
  7034. , f = $(".gui-floor").eq(0)
  7035. , g = $(".vr-popup").eq(0);
  7036. return function(e) {
  7037. switch (e) {
  7038. case "info":
  7039. i(),
  7040. n(),
  7041. Ye(),
  7042. l(),
  7043. c(),
  7044. r(),
  7045. h();
  7046. break;
  7047. case "terms":
  7048. t(),
  7049. n(),
  7050. o(),
  7051. l(),
  7052. c(),
  7053. r(),
  7054. h();
  7055. break;
  7056. case "help":
  7057. t(),
  7058. i(),
  7059. l(),
  7060. c(),
  7061. r(),
  7062. h();
  7063. break;
  7064. case "vr":
  7065. t(),
  7066. i(),
  7067. l(),
  7068. c(),
  7069. n(),
  7070. h(),
  7071. s(g) && o();
  7072. break;
  7073. case "highlights":
  7074. Xe(),
  7075. i(),
  7076. l(),
  7077. c();
  7078. break;
  7079. case "share":
  7080. t(),
  7081. i(),
  7082. n(),
  7083. c(),
  7084. r(),
  7085. h();
  7086. break;
  7087. case "floor":
  7088. i(),
  7089. l(),
  7090. r();
  7091. break;
  7092. case "view":
  7093. c(),
  7094. l(),
  7095. i(),
  7096. r();
  7097. break;
  7098. case "tour":
  7099. i(),
  7100. l(),
  7101. c(),
  7102. r();
  7103. break;
  7104. case "move":
  7105. i(),
  7106. l(),
  7107. c(),
  7108. r();
  7109. break;
  7110. case "resize":
  7111. t(),
  7112. Ye(),
  7113. c();
  7114. break;
  7115. case "tag":
  7116. i(),
  7117. n(),
  7118. l(),
  7119. c(),
  7120. r()
  7121. }
  7122. }
  7123. }();
  7124. $(document).on("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", function(e) {
  7125. $("#gui-fullscreen").toggle(!K.isFullscreen()),
  7126. $("#gui-fullscreen-exit").toggle(!!K.isFullscreen()),
  7127. setTimeout(function() {
  7128. $(".icon:visible").hide().show(0)
  7129. }, 100)
  7130. }),
  7131. $("#gui-fullscreen").find("a").on("click", function(e) {
  7132. l(e),
  7133. K.requestFullscreen($("body")[0]),
  7134. J.track("showcase_gui", {
  7135. gui_action: "click_enter_fullscreen",
  7136. interaction_source: "gui"
  7137. })
  7138. //czj
  7139. //W.reload()
  7140. }),
  7141. $("#gui-fullscreen-exit").find("a").on("click", function(e) {
  7142. l(e),
  7143. K.exitFullscreen(),
  7144. J.track("showcase_gui", {
  7145. gui_action: "click_exit_fullscreen",
  7146. interaction_source: "gui"
  7147. })
  7148. })
  7149. $(window).on("resize", function(e) {
  7150. var t = e.target.innerHeight
  7151. , i = e.target.innerWidth;
  7152. t === X && i === Z || (je.highlight.visible && w(),
  7153. Ze("resize"),
  7154. $(".pinTop.right").removeClass("hideUnderMeta"),
  7155. c(),
  7156. X = t,
  7157. Z = i)
  7158. }).resize(),
  7159. K.supportsFullscreen() || $("#gui-fullscreen").hide(),
  7160. $("#pullTab").on("click", function(e) {
  7161. l(e),
  7162. $("#drawer").hasClass("open") ? (J.trackAlways("showcase_gui", {
  7163. gui_action: "hide_highlight_reel"
  7164. }),
  7165. $(this).addClass("open").children("img").attr("src","images/auto.png")) : (J.trackAlways("showcase_gui", {
  7166. gui_action: "show_highlight_reel"
  7167. }),
  7168. $(this).removeClass("open").children("img").attr("src","images/auto-suspend.png"));
  7169. a()
  7170. });
  7171. /***********************方奕卓 热点列表事件监听 ************************/
  7172. if(window.MP_PREFETCHED_MODELDATA.showHotListSta) {
  7173. $('#hotList').css('display', '');
  7174. $('#hotList').on('click',function(e){
  7175. l(e);
  7176. var hotList = $('#hotListWrap')[0];
  7177. var isActive = hotList.classList.contains('hotListActive');
  7178. if(isActive){
  7179. hotList.classList.remove('hotListActive');
  7180. this.classList.remove('active')
  7181. }else{
  7182. hotList.classList.add('hotListActive');
  7183. this.classList.add('active')
  7184. }
  7185. }),
  7186. $('#hotListContent ul').on('mouseover', function(e){
  7187. l(e);
  7188. var target = e.target;
  7189. var hotList = document.getElementById('hotListWrap');
  7190. if(target.tagName === 'SPAN'){
  7191. var targetParent = target.parentElement.parentElement;
  7192. if(target.offsetWidth + 116 >= targetParent.clientWidth){
  7193. hotList.style.width = target.offsetWidth + 116 + 'px';
  7194. }else{
  7195. hotList.style.width = '';
  7196. }
  7197. }else if(target.tagName === 'LI'){
  7198. var targetParent = target.parentElement;
  7199. if(target.children[0].offsetWidth + 116 >= targetParent.clientWidth){
  7200. hotList.style.width = target.children[0].offsetWidth + 116 + 'px';
  7201. }else{
  7202. hotList.style.width = ''
  7203. }
  7204. }else {
  7205. hotList.style.width = '';
  7206. }
  7207. });
  7208. $('#hotListContent ul').on('click', function(e){
  7209. l(e);
  7210. this.preElem && this.preElem.classList.remove('active');
  7211. if(e.target.tagName === 'SPAN'){
  7212. e.target.parentElement.classList.add('active');
  7213. e.target.parentElement.hot && e.target.parentElement.hot.examine(window.player,true); // 打开热点
  7214. this.preElem = e.target.parentElement;
  7215. }else{
  7216. e.target.classList.add('active');
  7217. e.target.hot && e.target.hot.examine(window.player,true); // 打开热点
  7218. this.preElem = e.target;
  7219. }
  7220. })
  7221. $('#hotListClose').on('click', function(e){
  7222. l(e);
  7223. var hotList = $('#hotListWrap')[0];
  7224. hotList.classList.remove('hotListActive');
  7225. $('#hotListContent ul .active').removeClass('active');
  7226. $('#hotList')[0].classList.remove('active')
  7227. })
  7228. }
  7229. /*****************************************************************/
  7230. $("#more-menu-button").on("click", function(e) {
  7231. l(e);
  7232. var t = $("#more-menu");
  7233. t.toggleClass("open")
  7234. }),
  7235. t.exports.init = S,
  7236. t.exports.startLoading = x,
  7237. t.exports.endLoading = d,
  7238. t.exports.onProgress = u
  7239. }
  7240. ).call(this, "/js/gui/gui.js")
  7241. }
  7242. , {
  7243. "../analytics": 4,
  7244. "../controls/serializer": 14,
  7245. "../enum/AlignmentType": 17,
  7246. "../enum/BlackoutStyle": 18,
  7247. "../enum/ControlEvents": 21,
  7248. "../enum/DirectorEvents": 23,
  7249. "../enum/Keys": 30,
  7250. "../enum/PathDiscardMode": 38,
  7251. "../enum/PathDisplayMode": 39,
  7252. "../enum/PlayerEvents": 40,
  7253. "../enum/VROption": 47,
  7254. "../enum/Vectors": 50,
  7255. "../enum/Viewmode": 51,
  7256. "../enum/WarpStyle": 52,
  7257. "../enum/ZoomEvents": 53,
  7258. "../lib/dat.gui": 93,
  7259. "../localization/localize": 108,
  7260. "../tag/Media/MediaEvent": 131,
  7261. "../objects/Snapshot": 153,
  7262. "../settings": 166,
  7263. "../util/ajax": 181,
  7264. "../util/browser": 182,
  7265. "../util/camera": 183,
  7266. "../util/logger": 189,
  7267. "../util/showcase": 193,
  7268. "../util/transitions": 195,
  7269. "./closer/ModalCloserEvent": 61,
  7270. "./closer/modalCloser": 62,
  7271. "./help/HelpEvent": 66,
  7272. "./help/help": 67,
  7273. "./helpManager": 68,
  7274. "./immersiveMode": 69,
  7275. "./konami": 70,
  7276. "./landingScreen": 71,
  7277. "./loadingScreen": 72,
  7278. "./memoryUsage": 73,
  7279. "./playButton": 74,
  7280. "./populateModal": 75,
  7281. "./sharing/ShareEvents": 76,
  7282. "./sharing/modal": 77,
  7283. "./terms/TermsEvent": 78,
  7284. "./terms/terms": 79,
  7285. "./title/TitleEvents": 80,
  7286. "./title/tagToggle": 81,
  7287. "./title/titleBar": 82,
  7288. "./tourInteraction": 84,
  7289. "./vr/vrEvent": 85,
  7290. "./vr/vrModal": 87,
  7291. "./webvr/WebVrEvent": 88,
  7292. "./webvr/webVRgui": 89,
  7293. three: 217
  7294. }],
  7295. 66: [function(e, t, i) {
  7296. "use strict";
  7297. t.exports = Object.freeze({
  7298. OPENED: "help.opened",
  7299. CLOSED: "help.closed"
  7300. })
  7301. }
  7302. , {}],
  7303. 67: [function(e, t, i) {
  7304. "use strict";
  7305. function n() {
  7306. g.on("click", function(e) {
  7307. if (S && S !== l.TRANSITIONING) {
  7308. var t = window.getComputedStyle(y).getPropertyValue("opacity") > 0;
  7309. t && !M ? R.close() : r()
  7310. }
  7311. }),
  7312. w.on("click", function(e) {
  7313. R.close()
  7314. }),
  7315. E.on("click", function(e) {
  7316. S && S !== l.TRANSITIONING && (s(),
  7317. o())
  7318. }),
  7319. b.on("click", function(e) {
  7320. s(),
  7321. a()
  7322. })
  7323. }
  7324. function r() {
  7325. S && S !== l.TRANSITIONING && (M = !0,
  7326. setTimeout(function() {
  7327. M = !1
  7328. }, d.help.modalStayDuration),
  7329. R.emit(h.OPENED),
  7330. m.addClass("open " + S),
  7331. g.addClass("open"),
  7332. s(),
  7333. o(),
  7334. y.style.removeProperty ? y.style.removeProperty("display") : y.style.removeAttribute("display"),
  7335. y.classList.add("fadeIn"))
  7336. }
  7337. function o() {
  7338. E.addClass("underline-tab"),
  7339. u.fill(_, c.NAVIGATION, S),
  7340. m.addClass(S)
  7341. }
  7342. function a() {
  7343. b.addClass("underline-tab"),
  7344. u.fill(T, c.MORE_HELP),
  7345. m.addClass("more-help")
  7346. }
  7347. function s(e, t) {
  7348. m.removeClass("more-help " + l.PANORAMA + " " + l.DOLLHOUSE + " " + l.FLOORPLAN + " " + l.OUTDOOR),
  7349. I.forEach(function(e) {
  7350. e.classList.remove("underline-tab")
  7351. })
  7352. }
  7353. var l = e("../../enum/Viewmode")
  7354. , c = e("../../enum/HelpModalType")
  7355. , h = e("./HelpEvent")
  7356. , u = (e("../helpManager"),
  7357. e("./../populateModal"))
  7358. , d = e("../../settings")
  7359. , p = e("../../util/common")
  7360. , f = e("events").EventEmitter
  7361. , g = $(".footer-help").eq(0)
  7362. , m = $("#help-dialog").eq(0)
  7363. , v = document.querySelector("#quick-logo")
  7364. , A = document.querySelector("#loaderCoBrand")
  7365. , y = document.querySelector("#help-dialog")
  7366. , C = document.querySelector(".footer")
  7367. , I = $(".help-tabs").children().toArray()
  7368. , E = $(".navigation-tab").eq(0)
  7369. , b = $(".more-help-tab").eq(0)
  7370. , w = ($("#interaction-modal").eq(0).find(".interaction").toArray(),
  7371. m.find(".close").eq(0))
  7372. , _ = m.find(".interactions").toArray()
  7373. , T = m.find(".ui-instructions").toArray()
  7374. , x = l.PANORAMA
  7375. , S = l.PANORAMA
  7376. , M = !1
  7377. , R = {
  7378. init: function(e, t) {
  7379. S = t,
  7380. x = t,
  7381. [y, A, v, C].forEach(function(e) {
  7382. e.classList.add(u.deviceType)
  7383. }),
  7384. n()
  7385. },
  7386. close: function() {
  7387. if (m.hasClass("open") && (this.emit(h.CLOSED),
  7388. g.removeClass("open"),
  7389. m.removeClass("open"),
  7390. y.classList.contains("fadeIn"))) {
  7391. y.classList.remove("fadeIn");
  7392. var e = S === l.TRANSITIONING ? x : S;
  7393. u.clear(_, c.NAVIGATION, e)
  7394. }
  7395. },
  7396. updateMode: function(e) {
  7397. x = S,
  7398. S = e
  7399. }
  7400. };
  7401. p.extendObject(R, f.prototype),
  7402. t.exports = R
  7403. }
  7404. , {
  7405. "../../enum/HelpModalType": 28,
  7406. "../../enum/Viewmode": 51,
  7407. "../../settings": 166,
  7408. "../../util/common": 185,
  7409. "../helpManager": 68,
  7410. "./../populateModal": 75,
  7411. "./HelpEvent": 66,
  7412. events: 202
  7413. }],
  7414. 68: [function(e, t, i) {
  7415. (function(i) {
  7416. "use strict";
  7417. var n = e("../util/browser")
  7418. , r = e("./../util/logger")
  7419. , o = e("./../settings")
  7420. , a = new r(i)
  7421. , s = function() {
  7422. var e;
  7423. try {
  7424. return e = window.localStorage.getItem("visitCount") || "0",
  7425. e = (parseFloat(e) + 1).toString(),
  7426. window.localStorage.setItem("visitCount", e),
  7427. a.debug("visitCount = " + e),
  7428. e
  7429. } catch (t) {
  7430. e = "1",
  7431. a.debug("couldn't set local storage")
  7432. }
  7433. }()
  7434. , l = !1;
  7435. t.exports = {
  7436. isHelpDisabled: function() {
  7437. return "0" === n.valueFromHash("help", null) || l
  7438. },
  7439. isLargeHelpEnabled: function() {
  7440. return ("1" === s || "1" === n.valueFromHash("help", null)) && !this.isHelpDisabled()
  7441. },
  7442. isSmallHelpEnabled: function() {
  7443. return "2" === n.valueFromHash("help", null) && !this.isHelpDisabled()
  7444. },
  7445. isHelpEnabled: function() {
  7446. return this.isLargeHelpEnabled() || this.isSmallHelpEnabled()
  7447. },
  7448. setAutoPlay: function(e) {
  7449. l = o.warp.auto >= 0 && e > 1
  7450. }
  7451. }
  7452. }
  7453. ).call(this, "/js/gui/helpManager.js")
  7454. }
  7455. , {
  7456. "../util/browser": 182,
  7457. "./../settings": 166,
  7458. "./../util/logger": 189
  7459. }],
  7460. 69: [function(e, t, i) {
  7461. "use strict";
  7462. function n(e, t, i, n) {
  7463. F = n,
  7464. r(e, t, i, F),
  7465. o(),
  7466. N = t.mode
  7467. }
  7468. function r(e, t, i, n) {
  7469. [C.PANORAMA, C.DOLLHOUSE, C.FLOORPLAN].forEach(function(t) {
  7470. e.controls[t].on(v.Move, a),
  7471. e.controls[t].on(v.LongTap, c)
  7472. }),
  7473. M.on("mousewheel DOMMouseScroll", a),
  7474. i.on(m.TagActivated, a),
  7475. i.on(m.TagNavigation, a),
  7476. t.on(A.FlyingEnded, s),
  7477. t.on(A.ModeChanging, function(e, t) {
  7478. B = t !== C.PANORAMA && e !== C.PANORAMA
  7479. }),
  7480. t.on(A.ModeChanged, function(e, i) {
  7481. N = t.mode,
  7482. i !== C.TRANSITIONING ? l() : a("modeChange")
  7483. }),
  7484. n.on(y.TourStart, function() {
  7485. L = !0,
  7486. a()
  7487. }),
  7488. n.on(y.TourEnd, function() {
  7489. L = !1,
  7490. l()
  7491. }),
  7492. n.on(y.ActionInterrupted, function() {
  7493. L = !1
  7494. }),
  7495. R.addEventListener("touchend", function() {
  7496. $("#pullTab").hasClass("opened") && !L && l()
  7497. }, !0)
  7498. }
  7499. function o() {
  7500. p.isMobile() ? (b.forEach(function(e) {
  7501. e.classList.add("mobile")
  7502. }),
  7503. w.click(l)) : (b.forEach(function(e) {
  7504. e.addEventListener("mouseleave", function() {
  7505. !M.is(":hover") && b[0].classList.contains("detectHover") && l()
  7506. }, !0)
  7507. }),
  7508. M.mouseleave(function() {
  7509. b[0].classList.contains("detectHover") && l()
  7510. }))
  7511. }
  7512. function a(e) {
  7513. D || d(e) && _.hasClass("playing") || (clearTimeout(O),
  7514. P = !0,
  7515. g.close(),
  7516. h(e),
  7517. N !== C.DOLLHOUSE && N !== C.FLOORPLAN && (x.hasClass("expand") && !S.hasClass("closed") || 2 === p.valueFromHash("title", 1) ,
  7518. _.hasClass("playing") || (b.forEach(function(e) {
  7519. e.classList.add("detectHover")
  7520. }),
  7521. O = setTimeout(l, f.immersive.timeToShowAgain))))
  7522. }
  7523. function s() {
  7524. _.hasClass("playing") || (clearTimeout(O),
  7525. O = setTimeout(l, f.immersive.timeToShowAgain))
  7526. }
  7527. function l() {
  7528. clearTimeout(O),
  7529. P = !1,
  7530. I.forEach(function(e) {
  7531. e.classList.remove("drawerOpen")
  7532. }),
  7533. L || E.forEach(function(e) {
  7534. e.classList.remove("duringTour")
  7535. }),
  7536. b.forEach(function(e) {
  7537. e.classList.remove("detectHover")
  7538. })
  7539. }
  7540. function c() {
  7541. P ? l() : a(),
  7542. D = !0,
  7543. setTimeout(function() {
  7544. D = !1
  7545. }, f.immersive.uiStayDuration)
  7546. }
  7547. function h(e) {
  7548. !d(e) && L ? E.forEach(function(e) {
  7549. e.classList.remove("drawerOpen"),
  7550. e.classList.add("duringTour")
  7551. }) : _.hasClass("open") ? E.forEach(function(e) {
  7552. e.classList.remove("duringTour"),
  7553. e.classList.add("drawerOpen")
  7554. }) : B || N === C.FLOORPLAN || N === C.DOLLHOUSE || E.forEach(function(e) {
  7555. e.classList.add("fadeOut")
  7556. })
  7557. }
  7558. function u() {
  7559. T.hasClass("duringTour") || (L = !1,
  7560. a("gui"),
  7561. l())
  7562. }
  7563. function d(e) {
  7564. return "mouse" === e || "touch" === e || "key" === e || "gui" === e
  7565. }
  7566. var p = e("../util/browser")
  7567. , f = e("../settings")
  7568. , g = e("./help/help")
  7569. , m = e("../enum/tagEvents")
  7570. , v = e("../enum/ControlEvents")
  7571. , A = e("../enum/PlayerEvents")
  7572. , y = e("../enum/DirectorEvents")
  7573. , A = e("../enum/PlayerEvents")
  7574. , C = e("../enum/Viewmode")
  7575. , I = $(".pinTop.left, .pinBottom-container, #drawer-container, #drawer, .footer").toArray()
  7576. , E = $(".pinBottom-container, #drawer-container, .footer").toArray()
  7577. , b = $("#hover-bottom, #hover-top").toArray()
  7578. , w = ($("#pullTab").eq(0),
  7579. $("#playHead").eq(0),
  7580. $(".pinBottom-container").eq(0))
  7581. , _ = $("#drawer").eq(0)
  7582. , T = $("#drawer-container").eq(0)
  7583. , x = $("#meta-info").eq(0)
  7584. , S = $(".pinTop.left").eq(0)
  7585. , M = $("#player").eq(0)
  7586. , R = document.getElementById("pullTab")
  7587. , P = !1
  7588. , O = null
  7589. , L = !1
  7590. , D = !1
  7591. , N = null
  7592. , B = !1
  7593. , F = null;
  7594. t.exports.init = n,
  7595. t.exports.hideUi = a,
  7596. t.exports.resetDrawer = u
  7597. }
  7598. , {
  7599. "../enum/ControlEvents": 21,
  7600. "../enum/DirectorEvents": 23,
  7601. "../enum/tagEvents": 32,
  7602. "../enum/PlayerEvents": 40,
  7603. "../enum/Viewmode": 51,
  7604. "../settings": 166,
  7605. "../util/browser": 182,
  7606. "./help/help": 67
  7607. }],
  7608. 70: [function(e, t, i) {
  7609. (function(i) {
  7610. "use strict";
  7611. function n(e, t, i) {
  7612. l.debug("konami has the modelInstance");
  7613. var n = [];
  7614. $(window).on("keydown", function(e) {
  7615. n.push(e.which),
  7616. n.length > o.secretPanelWord.length && n.shift(),
  7617. s.equalLists(n, o.secretPanelWord) && (l.debug("Developer mode active."),
  7618. o.debug = !0)
  7619. }),
  7620. $(window).on("keydown", function n(r) {
  7621. o.debug && 72 === r.which && (e && i ? (a.toggle(e, t, i),
  7622. $(window).off("keydown", n)) : console.warn("sorry we're not ready yet"))
  7623. })
  7624. }
  7625. var r = e("./../util/logger")
  7626. , o = e("./../settings")
  7627. , a = e("./debug")
  7628. , s = e("./../util/common")
  7629. , l = (e("./gui"),
  7630. new r(i));
  7631. o.console && $("body").append('<div id="debug-console"></div>'),
  7632. t.exports.init = n
  7633. }
  7634. ).call(this, "/js/gui/konami.js")
  7635. }
  7636. , {
  7637. "./../settings": 166,
  7638. "./../util/common": 185,
  7639. "./../util/logger": 189,
  7640. "./debug": 63,
  7641. "./gui": 65
  7642. }],
  7643. 71: [function(e, t, i) {
  7644. "use strict";
  7645. function n(e, t) {
  7646. E = t.mode === p.PANORAMA && t.pano && !t.pano.isAligned() ? p.OUTDOOR : t.mode
  7647. }
  7648. function r(e) {
  7649. var t = $.Deferred();
  7650. e || t.resolve();
  7651. var i = c.startupFlyinDelay;
  7652. return e === p.PANORAMA && (i += c.dollhouse.transitionTime),
  7653. setTimeout(t.resolve.bind(t), i),
  7654. t
  7655. }
  7656. function o(e, t, i) {
  7657. var n = 0;
  7658. c.quickstart.enabled && (a(i),
  7659. n = c.quickstart.showTextDelay + c.quickstart.fadeOutDelay);
  7660. var r = function() {
  7661. e.once(g.Move, l),
  7662. t.once(f.TourStart, l)
  7663. };
  7664. s(n, r)
  7665. }
  7666. function a(e) {
  7667. return /* e && (y.addClass("quick-brand"), //quick-brand样式有问题 会遮住屏幕
  7668. v.before(y),
  7669. A = $(".quick-brand").toArray()),*/
  7670. m.addClass("fadeOut"),
  7671. setTimeout(function() {
  7672. A.forEach(function(e) {
  7673. e.classList.add("fadeIn")
  7674. })
  7675. }, c.quickstart.showTextDelay),
  7676. setTimeout(function() {
  7677. A.forEach(function(e) {
  7678. e.classList.add("fadeOut")
  7679. })
  7680. }, c.quickstart.fadeOutDelay),
  7681. !0
  7682. }
  7683. function s(e, t) {
  7684. setTimeout(function() {
  7685. if (h.isHelpEnabled()) {
  7686. if (t(),
  7687. u.init(),
  7688. C.addClass("fadeIn landing " + u.deviceType),
  7689. h.isSmallHelpEnabled())
  7690. return void C.addClass("small");
  7691. u.fill(I, d.LANDING[E]),
  7692. C.addClass(E)
  7693. }
  7694. }, e)
  7695. //csz 用户引导界面
  7696. var helpData = {
  7697. "pc":["images/pc_step1.png","images/pc_step2.png","images/pc_step3.png"],
  7698. "mobile":["images/phone_step1.png","images/phone_step2.png","images/phone_step3.png"]
  7699. }
  7700. var navIcon = $(".nav-icon .icon");
  7701. if(/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)) navIcon.attr("src",helpData.mobile[0]);
  7702. function paging(id){
  7703. id.on("click",function(){
  7704. var navPage = null;
  7705. $(this).attr("data-id") == "plus" ? navPage = +navIcon.attr("data-page")+1 : navPage = +navIcon.attr("data-page")-1;
  7706. if(navPage > helpData.length || navPage < 1) return false
  7707. if(/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)){
  7708. navIcon.attr({"data-page":navPage,"src":helpData.mobile[navPage - 1]});
  7709. }else{
  7710. navIcon.attr({"data-page":navPage,"src":helpData.pc[navPage - 1]});
  7711. }
  7712. })
  7713. };
  7714. paging($(".next-button"));
  7715. paging($(".prev-button"));
  7716. }
  7717. function l() {
  7718. u.clear(I, d.LANDING[E]),
  7719. C.removeClass("fadeIn")
  7720. }
  7721. var c = e("../settings")
  7722. , h = (e("./help/help"),
  7723. e("./helpManager"))
  7724. , u = e("./populateModal")
  7725. , d = e("../enum/HelpModalType")
  7726. , p = e("../enum/Viewmode")
  7727. , f = e("../enum/DirectorEvents")
  7728. , g = e("../enum/PlayerEvents")
  7729. , m = $("#quick-blackout").eq(0)
  7730. , v = $("#quick-logo").eq(0)
  7731. , A = $(".quick-brand").toArray()
  7732. , y = $("#loaderCoBrand").eq(0)
  7733. , C = $("#interaction-modal").eq(0)
  7734. , I = C.find(".interaction").toArray()
  7735. , E = ($("#model-title, .pinBottom-container, #drawer-container, #drawer, .footer").toArray(),
  7736. "");
  7737. t.exports.delayLanding = r,
  7738. t.exports.showMessage = o,
  7739. t.exports.init = n,
  7740. t.exports.dismissModal = l
  7741. }
  7742. , {
  7743. "../enum/DirectorEvents": 23,
  7744. "../enum/HelpModalType": 28,
  7745. "../enum/PlayerEvents": 40,
  7746. "../enum/Viewmode": 51,
  7747. "../settings": 166,
  7748. "./help/help": 67,
  7749. "./helpManager": 68,
  7750. "./populateModal": 75
  7751. }],
  7752. 72: [function(e, t, i) {
  7753. "use strict";
  7754. var n = e("./circleLoader").circleLoader;
  7755. t.exports = {
  7756. element: $("#gui-loading"),
  7757. hide: function(e) {
  7758. n.done(),
  7759. this.element.fadeOut(1500, e)
  7760. },
  7761. show: function(e) {
  7762. this.element.fadeIn(500, function() {
  7763. this.element.css("display", "table"),
  7764. e && e()
  7765. }
  7766. .bind(this))
  7767. },
  7768. progress: function(e) {
  7769. n.set(e)
  7770. }
  7771. }
  7772. }
  7773. , {
  7774. "./circleLoader": 60
  7775. }],
  7776. 73: [function(e, t, i) {
  7777. "use strict";
  7778. var n = e("../settings")
  7779. , r = $("#memory-info")
  7780. , o = r.find("#memory-gpu")
  7781. , a = !1;
  7782. t.exports = {
  7783. show: function() {
  7784. n.profiling.enabled && (r.show(),
  7785. a = !0)
  7786. },
  7787. hide: function() {
  7788. r.hide(),
  7789. a = !1
  7790. },
  7791. toggle: function() {
  7792. a ? this.hide() : this.show()
  7793. },
  7794. update: function(e) {
  7795. n.profiling.enabled && o.text(Math.floor(e / 1e6) + "MB")
  7796. }
  7797. }
  7798. }
  7799. , {
  7800. "../settings": 166
  7801. }],
  7802. 74: [function(e, t, i) {
  7803. "use strict";
  7804. var n = e("../util/browser")
  7805. , r = e("../analytics");
  7806. e("../settings");
  7807. t.exports = {
  7808. show: function(e, t) {
  7809. $("#gui-message").fadeOut(500, function() {
  7810. t()
  7811. })
  7812. }
  7813. }
  7814. }
  7815. , {
  7816. "../analytics": 4,
  7817. "../settings": 166,
  7818. "../util/browser": 182
  7819. }],
  7820. 75: [function(e, t, i) {
  7821. "use strict";
  7822. function n(e, t, i, n) {
  7823. function r(e) {
  7824. return e.classList.contains(a)
  7825. }
  7826. var o = i ? this.assets[t][i][this.deviceType] : this.assets[t][this.deviceType];
  7827. //for (var a in o) {
  7828. //var s = e.find(r);
  7829. //for (var l in o[a]) {
  7830. //var c = o[a][l];
  7831. //if ("top-info" === l || "bottom-info" === l) {
  7832. //var h = n ? c : "";
  7833. //czj 注释掉第一次打开的用户引导
  7834. //s.querySelector("." + l).textContent = h
  7835. //} else {
  7836. //var u = n ? c : "";
  7837. //, d = s.querySelector("." + l);
  7838. //d.src = u,
  7839. //n ? d.classList.remove("hidden") : d.classList.add("hidden")
  7840. //}
  7841. //}
  7842. //}
  7843. //var p = Array.prototype.slice.call(e[0].parentElement.querySelectorAll("hr"));
  7844. // p.forEach(function(e) {
  7845. // n ? e.classList.remove("hidden") : e.classList.add("hidden")
  7846. // })
  7847. }
  7848. var r = e("../util/browser")
  7849. , o = e("../localization/localize")
  7850. , a = e("../enum/HelpModalType")
  7851. , s = (e("../enum/HelpModalSize"),
  7852. e("../enum/Viewmode"));
  7853. t.exports = {
  7854. init: function() {
  7855. if (!this.hasInitialized) {
  7856. this.hasInitialized = !0,
  7857. this.deviceType = r.isMobile() ? "mobile" : "desktop",
  7858. this.assets = {},
  7859. this.assets[a.LANDING[s.PANORAMA]] = {
  7860. desktop: {
  7861. left: {
  7862. "top-info": o.ROTATE,
  7863. "big-image": "images/nav_help_mouse_drag_left.png",
  7864. keyboard: "images/nav_help_keyboard_left_right.png"
  7865. },
  7866. middle: {
  7867. "top-info": o.MOVE,
  7868. "big-image": "images/nav_help_mouse_click.png",
  7869. keyboard: "images/nav_help_keyboard_up_down.png"
  7870. },
  7871. right: {
  7872. "top-info": o.ZOOM,
  7873. "big-image": "images/nav_help_mouse_zoom.png",
  7874. keyboard: "images/nav_help_zoom_keys.png"
  7875. }
  7876. },
  7877. mobile: {
  7878. left: {
  7879. "top-info": o.ROTATE,
  7880. "big-image": "images/nav_help_gesture_drag.png"
  7881. },
  7882. middle: {
  7883. "top-info": o.MOVE,
  7884. "big-image": "images/nav_help_gesture_tap.png"
  7885. },
  7886. right: {
  7887. "top-info": o.ZOOM,
  7888. "big-image": "images/nav_help_gesture_pinch.png"
  7889. }
  7890. }
  7891. },
  7892. this.assets[a.LANDING[s.OUTDOOR]] = JSON.parse(JSON.stringify(this.assets[a.LANDING[s.PANORAMA]])),
  7893. this.assets[a.LANDING[s.DOLLHOUSE]] = {
  7894. desktop: {
  7895. left: {
  7896. "top-info": o.ROTATE,
  7897. "big-image": "images/nav_help_mouse_drag_left.png",
  7898. keyboard: "images/nav_help_keyboard_left_right.png"
  7899. },
  7900. middle: {
  7901. "top-info": o.MOVE,
  7902. "big-image": "images/nav_help_mouse_position_right.png"
  7903. }
  7904. },
  7905. mobile: {
  7906. left: {
  7907. "top-info": o.ROTATE,
  7908. "big-image": "images/nav_help_gesture_drag.png"
  7909. },
  7910. middle: {
  7911. "top-info": o.MOVE,
  7912. "big-image": "images/nav_help_gesture_position_two_finger.png"
  7913. }
  7914. }
  7915. },
  7916. this.assets[a.LANDING[s.FLOORPLAN]] = {
  7917. desktop: {
  7918. left: {
  7919. "top-info": o.MOVE,
  7920. "big-image": "images/nav_help_mouse_position_left.png"
  7921. },
  7922. middle: {
  7923. "top-info": o.ROTATE,
  7924. "big-image": "images/nav_help_mouse_drag_right.png",
  7925. keyboard: "images/nav_help_keyboard_left_right.png"
  7926. }
  7927. },
  7928. mobile: {
  7929. left: {
  7930. "top-info": o.MOVE,
  7931. "big-image": "images/nav_help_gesture_position.png"
  7932. },
  7933. middle: {
  7934. "top-info": o.ROTATE,
  7935. "big-image": "images/nav_help_gesture_drag_two_finger.png"
  7936. }
  7937. }
  7938. };
  7939. var e = {
  7940. "top-info": o.INSIDE,
  7941. "big-image": "images/nav_help_click_inside.png",
  7942. keyboard: "images/nav_help_inside_key.png"
  7943. };
  7944. this.assets[a.LANDING[s.OUTDOOR]].desktop.middle = e,
  7945. this.assets[a.LANDING[s.DOLLHOUSE]].desktop.right = e,
  7946. this.assets[a.LANDING[s.FLOORPLAN]].desktop.right = e;
  7947. var t = {
  7948. "top-info": o.INSIDE,
  7949. "big-image": "images/nav_help_tap_inside.png"
  7950. };
  7951. this.assets[a.LANDING[s.OUTDOOR]].mobile.middle = t,
  7952. this.assets[a.LANDING[s.DOLLHOUSE]].mobile.right = t,
  7953. this.assets[a.LANDING[s.FLOORPLAN]].mobile.right = t,
  7954. this.assets[a.NAVIGATION] = {},
  7955. this.assets[a.NAVIGATION][s.PANORAMA] = {
  7956. desktop: {
  7957. left: {
  7958. "top-info": o.HELP_DESKTOP_PANORAMA_1A,
  7959. "bottom-info": o.HELP_DESKTOP_PANORAMA_1B,
  7960. "big-image": "images/nav_help_mouse_drag_left.png",
  7961. keyboard: "images/nav_help_keyboard_left_right.png"
  7962. },
  7963. middle: {
  7964. "top-info": o.HELP_DESKTOP_PANORAMA_2A,
  7965. "bottom-info": o.HELP_DESKTOP_PANORAMA_2B,
  7966. "big-image": "images/nav_help_mouse_click.png",
  7967. keyboard: "images/nav_help_keyboard_up_down.png"
  7968. },
  7969. right: {
  7970. "top-info": o.HELP_DESKTOP_PANORAMA_3A,
  7971. "bottom-info": o.HELP_DESKTOP_PANORAMA_3B,
  7972. "big-image": "images/nav_help_mouse_zoom.png",
  7973. keyboard: "images/nav_help_zoom_keys.png"
  7974. }
  7975. },
  7976. mobile: {
  7977. left: {
  7978. "top-info": o.HELP_MOBILE_PANORAMA_1,
  7979. "big-image": "images/nav_help_gesture_drag.png"
  7980. },
  7981. middle: {
  7982. "top-info": o.HELP_MOBILE_PANORAMA_2,
  7983. "big-image": "images/nav_help_gesture_tap.png"
  7984. },
  7985. right: {
  7986. "top-info": o.HELP_MOBILE_3,
  7987. "big-image": "images/nav_help_gesture_pinch.png"
  7988. }
  7989. }
  7990. },
  7991. this.assets[a.NAVIGATION][s.DOLLHOUSE] = {
  7992. desktop: {
  7993. left: {
  7994. "top-info": o.HELP_DESKTOP_DOLLHOUSE_1A,
  7995. "bottom-info": o.HELP_DESKTOP_DOLLHOUSE_1B,
  7996. "big-image": "images/nav_help_mouse_drag_left.png",
  7997. keyboard: "images/nav_help_keyboard_all.png"
  7998. },
  7999. middle: {
  8000. "top-info": o.HELP_DESKTOP_DOLLHOUSE_2A,
  8001. "big-image": "images/nav_help_mouse_position_right.png"
  8002. },
  8003. right: {
  8004. "top-info": o.HELP_DESKTOP_DOLLHOUSE_3A,
  8005. "big-image": "images/nav_help_mouse_zoom.png"
  8006. }
  8007. },
  8008. mobile: {
  8009. left: {
  8010. "top-info": o.HELP_MOBILE_DOLLHOUSE_1,
  8011. "big-image": "images/nav_help_gesture_drag.png"
  8012. },
  8013. middle: {
  8014. "top-info": o.HELP_MOBILE_DOLLHOUSE_2,
  8015. "big-image": "images/nav_help_gesture_position_two_finger.png"
  8016. },
  8017. right: {
  8018. "top-info": o.HELP_MOBILE_3,
  8019. "big-image": "images/nav_help_gesture_pinch.png"
  8020. }
  8021. }
  8022. },
  8023. this.assets[a.NAVIGATION][s.FLOORPLAN] = {
  8024. desktop: {
  8025. left: {
  8026. "top-info": o.HELP_DESKTOP_FLOORPLAN_1A,
  8027. "big-image": "images/nav_help_mouse_position_left.png"
  8028. },
  8029. middle: {
  8030. "top-info": o.HELP_DESKTOP_FLOORPLAN_2A,
  8031. "bottom-info": o.HELP_DESKTOP_FLOORPLAN_2B,
  8032. "big-image": "images/nav_help_mouse_drag_right.png",
  8033. keyboard: "images/nav_help_keyboard_left_right.png"
  8034. },
  8035. right: {
  8036. "top-info": o.HELP_DESKTOP_FLOORPLAN_3A,
  8037. "bottom-info": o.HELP_DESKTOP_FLOORPLAN_3B,
  8038. "big-image": "images/nav_help_mouse_zoom.png",
  8039. keyboard: "images/nav_help_keyboard_up_down.png"
  8040. }
  8041. },
  8042. mobile: {
  8043. left: {
  8044. "top-info": o.HELP_MOBILE_FLOORPLAN_1,
  8045. "big-image": "images/nav_help_gesture_position.png"
  8046. },
  8047. middle: {
  8048. "top-info": o.HELP_MOBILE_FLOORPLAN_2,
  8049. "big-image": "images/nav_help_gesture_drag_two_finger.png"
  8050. },
  8051. right: {
  8052. "top-info": o.HELP_MOBILE_3,
  8053. "big-image": "images/nav_help_gesture_pinch.png"
  8054. }
  8055. }
  8056. },
  8057. this.assets[a.NAVIGATION][s.OUTDOOR] = JSON.parse(JSON.stringify(this.assets[a.NAVIGATION][s.PANORAMA])),
  8058. this.assets[a.NAVIGATION][s.OUTDOOR].desktop.middle = {
  8059. "top-info": o.HELP_DESKTOP_360_2A,
  8060. "bottom-info": o.HELP_DESKTOP_360_2B,
  8061. "big-image": "images/nav_help_click_inside.png",
  8062. keyboard: "images/nav_help_inside_key.png"
  8063. },
  8064. this.assets[a.NAVIGATION][s.OUTDOOR].mobile.middle = {
  8065. "top-info": o.HELP_MOBILE_360_2,
  8066. "big-image": "images/nav_help_tap_inside.png"
  8067. },
  8068. this.assets[a.MORE_HELP] = {
  8069. desktop: {
  8070. "more-help-hlr": {
  8071. "top-info": o.HELP_MORE_HLR_A,
  8072. "big-image": "images/nav_help_expand.svg",
  8073. "bottom-info": o.HELP_DESKTOP_MORE_HLR_B
  8074. },
  8075. "more-help-dollhouse": {
  8076. "top-info": o.HELP_MORE_DOLLHOUSE_A,
  8077. "big-image": "images/nav_help_dollhouse.svg",
  8078. "bottom-info": o.HELP_DESKTOP_MORE_DOLLHOUSE_B
  8079. },
  8080. "more-help-floors": {
  8081. "top-info": o.HELP_MORE_FLOORS_A,
  8082. "big-image": "images/nav_help_floor picker.svg",
  8083. "bottom-info": o.HELP_DESKTOP_MORE_FLOORS_B
  8084. },
  8085. "more-help-tag": {
  8086. "top-info": o.HELP_MORE_TAG_A,
  8087. "big-image": "images/nav_help_tag.svg",
  8088. "bottom-info": o.HELP_DESKTOP_MORE_TAG_B
  8089. },
  8090. "more-help-zoom": {
  8091. "top-info": o.HELP_MORE_ZOOM_A,
  8092. "big-image": "images/nav_help_zoom.svg",
  8093. "bottom-info": o.HELP_DESKTOP_MORE_ZOOM_B
  8094. },
  8095. "more-help-tour": {
  8096. "top-info": o.HELP_MORE_TOUR_A,
  8097. "big-image": "images/nav_help_play.png",
  8098. "bottom-info": o.HELP_DESKTOP_MORE_TOUR_B
  8099. },
  8100. "more-help-inside": {
  8101. "top-info": o.HELP_MORE_INSIDE_A,
  8102. "big-image": "images/nav_help_inside.svg",
  8103. "bottom-info": o.HELP_DESKTOP_MORE_INSIDE_B
  8104. },
  8105. "more-help-vr": {
  8106. "top-info": o.HELP_MORE_VR_A,
  8107. "big-image": "images/nav_help_vr.svg",
  8108. "bottom-info": o.HELP_DESKTOP_MORE_VR_B
  8109. },
  8110. "more-help-360": {
  8111. "top-info": o.HELP_MORE_360_A,
  8112. "big-image": "images/nav_help_360.svg",
  8113. "bottom-info": o.HELP_DESKTOP_MORE_360_B
  8114. },
  8115. "more-help-fullscreen": {
  8116. "top-info": o.HELP_MORE_FULLSCREEN_A,
  8117. "big-image": "images/nav_help_fullscreen.svg",
  8118. "bottom-info": o.HELP_DESKTOP_MORE_FULLSCREEN_B
  8119. }
  8120. },
  8121. mobile: {
  8122. "more-help-hlr": {
  8123. "top-info": o.HELP_MORE_HLR_A,
  8124. "big-image": "images/nav_help_expand.svg",
  8125. "bottom-info": o.HELP_DESKTOP_MORE_HLR_B
  8126. },
  8127. "more-help-dollhouse": {
  8128. "top-info": o.HELP_MORE_DOLLHOUSE_A,
  8129. "big-image": "images/nav_help_dollhouse.svg",
  8130. "bottom-info": o.HELP_MOBILE_MORE_DOLLHOUSE_B
  8131. },
  8132. "more-help-floors": {
  8133. "top-info": o.HELP_MORE_FLOORS_A,
  8134. "big-image": "images/nav_help_floor picker.svg",
  8135. "bottom-info": o.HELP_DESKTOP_MORE_FLOORS_B
  8136. },
  8137. "more-help-tag": {
  8138. "top-info": o.HELP_MORE_TAG_A,
  8139. "big-image": "images/nav_help_tag.svg",
  8140. "bottom-info": o.HELP_MOBILE_MORE_TAG_B
  8141. },
  8142. "more-help-tour": {
  8143. "top-info": o.HELP_MORE_TOUR_A,
  8144. "big-image": "images/nav_help_play.png",
  8145. "bottom-info": o.HELP_DESKTOP_MORE_TOUR_B
  8146. },
  8147. "more-help-inside": {
  8148. "top-info": o.HELP_MORE_INSIDE_A,
  8149. "big-image": "images/nav_help_inside.svg",
  8150. "bottom-info": o.HELP_MOBILE_MORE_INSIDE_B
  8151. },
  8152. "more-help-vr": {
  8153. "top-info": o.HELP_MORE_VR_A,
  8154. "big-image": "images/webvr.svg",
  8155. "bottom-info": o.HELP_MOBILE_MORE_VR_B
  8156. },
  8157. "more-help-360": {
  8158. "top-info": o.HELP_MORE_360_A,
  8159. "big-image": "images/nav_help_360.svg",
  8160. "bottom-info": o.HELP_MOBILE_MORE_360_B
  8161. }
  8162. }
  8163. },
  8164. this.assets[a.TOUR_INTERACTION[s.PANORAMA]] = {
  8165. desktop: {
  8166. left: {
  8167. "top-info": o.ROTATE,
  8168. "big-image": "images/nav_help_mouse_drag_left.png",
  8169. keyboard: "images/nav_help_keyboard_left_right.png"
  8170. },
  8171. middle: {
  8172. "top-info": o.MOVE,
  8173. "big-image": "images/nav_help_mouse_click.png",
  8174. keyboard: "images/nav_help_keyboard_up_down.png"
  8175. },
  8176. right: {
  8177. "top-info": o.PLAY,
  8178. "big-image": "images/Desktop-help-play-button.svg",
  8179. keyboard: "images/Desktop-help-spacebar-2.svg"
  8180. }
  8181. },
  8182. mobile: {
  8183. left: {
  8184. "top-info": o.ROTATE,
  8185. "big-image": "images/nav_help_gesture_drag.png"
  8186. },
  8187. middle: {
  8188. "top-info": o.MOVE,
  8189. "big-image": "images/nav_help_gesture_tap.png"
  8190. },
  8191. right: {
  8192. "top-info": o.PLAY,
  8193. "big-image": "images/mobile-help-play-button.svg"
  8194. }
  8195. }
  8196. },
  8197. this.assets[a.TOUR_INTERACTION[s.OUTDOOR]] = JSON.parse(JSON.stringify(this.assets[a.TOUR_INTERACTION[s.PANORAMA]])),
  8198. this.assets[a.TOUR_INTERACTION[s.OUTDOOR]].desktop.middle = this.assets[a.LANDING[s.OUTDOOR]].desktop.middle,
  8199. this.assets[a.TOUR_INTERACTION[s.OUTDOOR]].mobile.middle = this.assets[a.LANDING[s.OUTDOOR]].mobile.middle,
  8200. this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]] = JSON.parse(JSON.stringify(this.assets[a.TOUR_INTERACTION[s.OUTDOOR]])),
  8201. this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]].desktop.left = this.assets[a.LANDING[s.FLOORPLAN]].desktop.left,
  8202. this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]].mobile.left = this.assets[a.LANDING[s.FLOORPLAN]].mobile.left
  8203. }
  8204. },
  8205. fill: function(e, t, i) {
  8206. n.call(this, e, t, i, !0)
  8207. },
  8208. clear: function(e, t, i) {
  8209. n.call(this, e, t, i, !1)
  8210. }
  8211. }
  8212. }
  8213. , {
  8214. "../enum/HelpModalSize": 27,
  8215. "../enum/HelpModalType": 28,
  8216. "../enum/Viewmode": 51,
  8217. "../localization/localize": 108,
  8218. "../util/browser": 182
  8219. }],
  8220. 76: [function(e, t, i) {
  8221. "use strict";
  8222. t.exports = Object.freeze({
  8223. OPENED: "share.open",
  8224. CLOSED: "share.closed",
  8225. LINK_CLICKED: "share.linked"
  8226. })
  8227. }
  8228. , {}],
  8229. 77: [function(e, t, i) {
  8230. "use strict";
  8231. function n(e) {
  8232. function t(t, i) {
  8233. var n = window.screenY + ($("#player").height() - i) / 2
  8234. , r = window.screenX + ($("#player").width() - t) / 2
  8235. , o = "top=" + n + ",left=" + r + ",width=" + t + ",height=" + i;
  8236. I.emit(l.LINK_CLICKED, {
  8237. channel: e
  8238. }),
  8239. window.open(C[e], "shareWindow", o)
  8240. }
  8241. switch (e) {
  8242. case y.FACEBOOK:
  8243. t(580, 420);
  8244. break;
  8245. case y.TWITTER:
  8246. t(550, 440);
  8247. break;
  8248. case y.MAIL:
  8249. I.emit(l.LINK_CLICKED, {
  8250. channel: "email"
  8251. }),
  8252. window.open(C[e], "_blank");
  8253. break;
  8254. case y.LINKEDIN:
  8255. }
  8256. }
  8257. function r(e) {
  8258. I.emit(l.LINK_CLICKED, {
  8259. channel: "copylink"
  8260. });
  8261. var t = document.createRange();
  8262. t.selectNodeContents(v);
  8263. var i = window.getSelection();
  8264. i.removeAllRanges(),
  8265. i.addRange(t),
  8266. document.execCommand("copy"),
  8267. A.classList.remove("hidden"),
  8268. v.classList.add("highlighted")
  8269. }
  8270. function o(e) {
  8271. e && (e.stopPropagation(),
  8272. e.target === v) || (window.getSelection().removeAllRanges(),
  8273. v.classList.remove("highlighted"),
  8274. A.classList.add("hidden"))
  8275. }
  8276. var a = e("../../util/browser")
  8277. , s = e("../../localization/localize")
  8278. , l = e("./ShareEvents")
  8279. , c = e("../../util/common")
  8280. , h = e("events").EventEmitter
  8281. , u = document.getElementById("sharing")
  8282. , d = document.getElementById("share-modal")
  8283. , p = document.getElementById("share-close")
  8284. , f = document.getElementById("facebook-share")
  8285. , g = document.getElementById("twitter-share")
  8286. , m = document.getElementById("mail-share")
  8287. , v = document.getElementById("share-url-text")
  8288. , A = document.getElementById("copy-success")
  8289. , y = Object.freeze({
  8290. FACEBOOK: "facebook",
  8291. TWITTER: "twitter",
  8292. MAIL: "mail",
  8293. LINKEDIN: "linkedin"
  8294. })
  8295. , C = {};
  8296. C[y.FACEBOOK] = "http://www.facebook.com/sharer.php?u=" + encodeURIComponent(window.location.href + "&utm_source=1") + "&t=",
  8297. C[y.TWITTER] = "http://twitter.com/intent/tweet?text=",
  8298. C[y.MAIL] = "mailto:?subject=";
  8299. var I = {
  8300. init: function(e) {
  8301. var t = encodeURIComponent(s.SHARE_EXPLORE + e + " " + s.SHARE_AT + " ");
  8302. C[y.FACEBOOK] += t + encodeURIComponent(window.location.href + "&utm_source=1"),
  8303. C[y.TWITTER] += t + encodeURIComponent(window.location.href + "&utm_source=2 " + s.SHARE_WITH + " #port"),
  8304. C[y.MAIL] += encodeURIComponent(s.SHARE_EXPLORE + e + s.SHARE_3D) + "&body=" + t + encodeURIComponent(window.location.href + "&utm_source=3"),
  8305. u.addEventListener("click", this.toggle.bind(this)),
  8306. p.addEventListener("click", this.hide.bind(this)),
  8307. v.addEventListener("click", r),
  8308. d.addEventListener("click", o),
  8309. f.addEventListener("click", n.bind(this, y.FACEBOOK)),
  8310. g.addEventListener("click", n.bind(this, y.TWITTER)),
  8311. m.addEventListener("click", n.bind(this, y.MAIL)),
  8312. v.textContent = window.location.href + "&utm_source=4",
  8313. d.classList.add(a.isMobile() ? "mobile" : "desktop"),
  8314. u.classList.remove("hidden")
  8315. },
  8316. show: function() {
  8317. this.emit(l.OPENED),
  8318. d.classList.add("fadeIn")
  8319. },
  8320. hide: function() {
  8321. d.classList.contains("fadeIn") && (this.emit(l.CLOSED),
  8322. document.selection && document.selection.empty(),
  8323. window.getSelection().removeAllRanges(),
  8324. o(),
  8325. d.classList.remove("fadeIn"))
  8326. },
  8327. toggle: function() {
  8328. d.classList.contains("fadeIn") ? this.hide() : this.show()
  8329. }
  8330. };
  8331. c.extendObject(I, h.prototype),
  8332. t.exports = I
  8333. }
  8334. , {
  8335. "../../localization/localize": 108,
  8336. "../../util/browser": 182,
  8337. "../../util/common": 185,
  8338. "./ShareEvents": 76,
  8339. events: 202
  8340. }],
  8341. 78: [function(e, t, i) {
  8342. "use strict";
  8343. t.exports = Object.freeze({
  8344. OPENED: "terms.opened",
  8345. CLOSED: "terms.closed"
  8346. })
  8347. }
  8348. , {}],
  8349. 79: [function(e, t, i) {
  8350. "use strict";
  8351. var n = e("./TermsEvent")
  8352. , r = e("../../localization/localize")
  8353. , o = e("../../analytics")
  8354. , a = e("../../util/ajax")
  8355. , s = e("../../util/common")
  8356. , l = e("events").EventEmitter
  8357. , c = document.getElementById("terms-modal")
  8358. , h = {
  8359. init: function() {
  8360. $(".footer-terms").on("click", function(e) {
  8361. e.preventDefault(),
  8362. this.show()
  8363. }
  8364. .bind(this)),
  8365. $("#terms-modal .close").on("click", this.hide.bind(this))
  8366. },
  8367. show: function() {
  8368. this.emit(n.OPENED),
  8369. a.get("static/" + r.TERMS_TEXT_FILE).done(function(e) {
  8370. var t = $("#terms-text").html(e);
  8371. o.track("showcase_gui", {
  8372. gui_action: "click_terms_button",
  8373. interaction_source: "gui"
  8374. }),
  8375. t.find("a").attr("target", "_blank")
  8376. }).fail(function() {
  8377. $("#terms-text").html("<h1>" + r.TERMS_OF_USE + "</h1><p>" + r.TERMS_FAIL)
  8378. }),
  8379. c.classList.add("fadeIn")
  8380. },
  8381. hide: function(e) {
  8382. e && e.preventDefault(),
  8383. c.classList.contains("fadeIn") && this.emit(n.CLOSED),
  8384. c.classList.remove("fadeIn")
  8385. }
  8386. };
  8387. s.extendObject(h, l.prototype),
  8388. t.exports = h
  8389. }
  8390. , {
  8391. "../../analytics": 4,
  8392. "../../localization/localize": 108,
  8393. "../../util/ajax": 181,
  8394. "../../util/common": 185,
  8395. "./TermsEvent": 78,
  8396. events: 202
  8397. }],
  8398. 80: [function(e, t, i) {
  8399. "use strict";
  8400. t.exports = Object.freeze({
  8401. OPEN_INFO: "title.open.info",
  8402. CLOSE_INFO: "title.close.info",
  8403. SHOW_INFO: "title.show.info",
  8404. HIDE_INFO: "title.hide.info",
  8405. LINK_CLICKED: "title.link.click",
  8406. CONTACT_LINK_CLICKED: "title.contact.click",
  8407. ORIGIN_LINK_CLICKED: "title.origin.click"
  8408. })
  8409. }
  8410. , {}],
  8411. 81: [function(e, t, i) {
  8412. "use strict";
  8413. function n(e, t) {
  8414. o.tags.enabled && 0 !== Object.keys(e.tags).length && r(e, t)
  8415. }
  8416. function r(e, t) {
  8417. function i(i) {
  8418. e.shouldShowtags = "show" === this.value,
  8419. e.shouldShowtags ? t.showAlltags(o.tags.startup.fadeInDuration) : t.hideAlltags(o.tags.startup.fadeInDuration)
  8420. }
  8421. document.getElementById("tag-toggles").classList.remove("hidden"),
  8422. document.getElementById("radio-tag-show").checked = !0;
  8423. for (var n = document.getElementById("tag-inputs").querySelectorAll("input"), r = 0; r < n.length; r++)
  8424. n[r].addEventListener("change", i)
  8425. }
  8426. var o = e("../../settings");
  8427. t.exports.init = n
  8428. }
  8429. , {
  8430. "../../settings": 166
  8431. }],
  8432. 82: [function(e, t, i) {
  8433. (function(i) {
  8434. "use strict";
  8435. function n(e, t) {
  8436. return e && u.valueFromHash("title", 1) && 2 !== u.valueFromHash("mls", 0) ? (document.getElementsByClassName("titleText")[0].innerText = e, g_weixinObj.title = e,
  8437. e.length > g.minTooltipCharacters && I.parentElement.setAttribute("data-original-title", e),
  8438. t && 1 !== m.specialEdition && m.brand && !m.mls ? document.getElementById("cobrandTitle").innerText = t : (document.getElementsByClassName("co-brand")[0].classList.add("hidden"),
  8439. document.getElementById("gui-name").classList.add("noCoBrand"),
  8440. document.getElementById("cobrandTitle").classList.add("hidden")),
  8441. !0) : (document.getElementById("model-title").classList.add("hidden"),
  8442. !1)
  8443. }
  8444. function r(e) {
  8445. return e ? (L = !0,
  8446. void (_.innerHTML = e)) : void _.classList.add("hidden")
  8447. }
  8448. function o(e, t, i, n) {
  8449. if (!e && !t && !i || !m.brand || u.valueFromHash("mls", !1))
  8450. return void T.classList.add("hidden");
  8451. L = !0;
  8452. var r = []
  8453. , o = c(r, "<br>");
  8454. if (e && o('<span id="contactName">' + e + "</span>"),
  8455. t) {
  8456. var a = n || t
  8457. , s = u.isMobile() ? '<a id="phone" href="callto:' + t + '">' + a + "</a>" : "<span>" + a + "</span>";
  8458. o(s)
  8459. }
  8460. i && o('<a id="email" href="mailTo:' + i + '">' + i + "</a>"),
  8461. r[0] = "",
  8462. x.innerHTML = r.join("")
  8463. }
  8464. function a(e) {
  8465. if ("string" == typeof e)
  8466. try {
  8467. e = JSON.parse(e)
  8468. } catch (e) {
  8469. return y.warn("Unable to parse address data"),
  8470. void S.parentElement.classList.add("hidden")
  8471. }
  8472. if (!(e && (e.address_1 || e.address_2 || e.city || e.state || e.zip)))
  8473. return void S.parentElement.classList.add("hidden");
  8474. L = !0;
  8475. var t = []
  8476. , i = c(t, " ");
  8477. e.address_1 && i(e.address_1),
  8478. e.address_2 && i(e.address_2),
  8479. e.city && i(e.city, ", "),
  8480. e.state && i(e.state, ", "),
  8481. e.zip && i(e.zip, e.state ? " " : ", "),
  8482. t[0] = "",
  8483. S.innerText = t.join("")
  8484. }
  8485. function s(e) {
  8486. var t = document.createElement("a");
  8487. return t.id = "url",
  8488. t.target = "_blank",
  8489. t.href = e,
  8490. t.innerText = e,
  8491. t.addEventListener("click", N.emit.bind(N, v.ORIGIN_LINK_CLICKED)),
  8492. t
  8493. }
  8494. function l(e) {
  8495. return !(!e || u.inIframe() && document.referrer === e) && (R.classList.remove("hidden"),
  8496. P.innerHTML = f.WEBVR_LEARN_MORE + ": ",
  8497. P.appendChild(s(e)),
  8498. O.forEach(function(e) {
  8499. e.classList.add("share-link")
  8500. }),
  8501. !0)
  8502. }
  8503. function c(e, t) {
  8504. var i = e
  8505. , n = t;
  8506. return function(e, t) {
  8507. i.push(t || n, e)
  8508. }
  8509. }
  8510. function h() {
  8511. document.getElementById("title-toggle").addEventListener("click", N.toggleTitle.bind(N)),
  8512. L && I.addEventListener("click", N.toggleMeta.bind(N, !1));
  8513. var e = [].slice.call(_.querySelectorAll("a"));
  8514. e.forEach(function(e) {
  8515. e.addEventListener("click", N.emit.bind(N, v.LINK_CLICKED))
  8516. });
  8517. var t = [].slice.call(T.querySelectorAll("a"));
  8518. t.forEach(function(e) {
  8519. e.addEventListener("click", N.emit.bind(N, v.CONTACT_LINK_CLICKED, {
  8520. contact_type: e.getAttribute("id")
  8521. }))
  8522. })
  8523. }
  8524. var u = e("../../util/browser")
  8525. , d = e("../../util/common")
  8526. , p = e("../../util/logger")
  8527. , f = e("../../localization/localize")
  8528. , g = e("./titleBarSettings")
  8529. , m = e("../../settings")
  8530. , v = e("./TitleEvents")
  8531. , A = e("events").EventEmitter
  8532. , y = new p(i)
  8533. , C = document.querySelector(".pinTop.left")
  8534. , I = document.getElementsByClassName("title-container")[0]
  8535. , E = document.getElementById("title-toggle").querySelector("i")
  8536. , b = document.getElementById("meta-info-wrapper")
  8537. , w = document.getElementById("meta-info")
  8538. , _ = document.getElementById("meta-description")
  8539. , T = document.getElementsByClassName("contact-info")[0]
  8540. , x = document.getElementById("contact-data")
  8541. , S = document.getElementById("addressTxt")
  8542. , M = document.getElementById("tag-toggles")
  8543. , R = document.getElementById("share-origin")
  8544. , P = document.getElementById("share-link-wrapper")
  8545. , O = [w, b, I]
  8546. , L = !1
  8547. , D = !1
  8548. , N = {
  8549. populate: function(e) {
  8550. if (n(MP_PREFETCHED_MODELDATA.name, e.coBrand)) {
  8551. if (r(e.description),
  8552. o(e.contactName, e.phone, e.email, e.formatted_contact_phone),
  8553. a(e.address),
  8554. L) {
  8555. var t = document.createElement("br");
  8556. M.insertBefore(t, M.firstElementChild)
  8557. }
  8558. e.socialSharing && m.share.enabled && (D = l(e.url))
  8559. }
  8560. },
  8561. finishSetup: function(e) {
  8562. L = L || !!e,
  8563. h(),
  8564. L || (D ? I.classList.add("share-only") : I.classList.add("no-meta"))
  8565. },
  8566. toggleMeta: function(e, t) {
  8567. var title = document.getElementById("model-title");
  8568. t && t.preventDefault();
  8569. var i = w.classList.contains("expand");
  8570. e && !i || (i ? (O.forEach(function(e) {
  8571. e.classList.remove("expand")
  8572. }),
  8573. this.emit(v.CLOSE_INFO),title.classList.remove("expand")) : (O.forEach(function(e) {
  8574. e.classList.add("expand");
  8575. }),
  8576. title.classList.add("expand"),
  8577. this.emit(v.OPEN_INFO)))
  8578. },
  8579. setupToggling: function() {
  8580. b.style.height = w.offsetHeight + "px",
  8581. w.addEventListener("transitionend", function() {
  8582. b.style.height = w.offsetHeight + "px"
  8583. })
  8584. },
  8585. toggleTitle: function(e) {
  8586. e && e.preventDefault(),
  8587. C.classList.contains("closed") ? (C.classList.add("open"),
  8588. E.classList.remove("icon-dpad-right"),
  8589. E.classList.add("icon-dpad-left"),
  8590. this.emit(v.SHOW_INFO),
  8591. setTimeout(function() {
  8592. C.classList.remove("closed"),
  8593. C.classList.remove("open")
  8594. }, g.removeAnimationClasses)) : (C.classList.add("closed"),
  8595. E.classList.remove("icon-dpad-left"),
  8596. E.classList.add("icon-dpad-right"),
  8597. this.emit(v.HIDE_INFO))
  8598. }
  8599. };
  8600. d.extendObject(N, A.prototype),
  8601. t.exports = N
  8602. }
  8603. ).call(this, "/js/gui/title/titleBar.js")
  8604. }
  8605. , {
  8606. "../../localization/localize": 108,
  8607. "../../settings": 166,
  8608. "../../util/browser": 182,
  8609. "../../util/common": 185,
  8610. "../../util/logger": 189,
  8611. "./TitleEvents": 80,
  8612. "./titleBarSettings": 83,
  8613. events: 202
  8614. }],
  8615. 83: [function(e, t, i) {
  8616. "use strict";
  8617. t.exports = Object.freeze({
  8618. minTooltipCharacters: 19,
  8619. removeAnimationClasses: 500
  8620. })
  8621. }
  8622. , {}],
  8623. 84: [function(e, t, i) {
  8624. "use strict";
  8625. function n(e) {
  8626. C = e,
  8627. P.forEach(function(e) {
  8628. b.addEventListener(e, u.bind(this, !1), !0),
  8629. w.addEventListener(e, u.bind(this, !0), !0),
  8630. E.addEventListener(e, o, !0),
  8631. S.forEach(function(t) {
  8632. t.addEventListener(e, a, !0)
  8633. }),
  8634. $("#drawer img").on(e, a)
  8635. }),
  8636. document.addEventListener("keydown", u.bind(this, !1), !0),
  8637. C.on(v.TourStart, function() {
  8638. E.classList.add("playing")
  8639. })
  8640. }
  8641. function r() {
  8642. C.playTour(),
  8643. I && clearTimeout(I),
  8644. d(),
  8645. _.removeClass("fadeIn")
  8646. }
  8647. function o() {
  8648. E.classList.contains("playing") && (C.stopTour(),
  8649. _.addClass("fadeIn"),
  8650. setTimeout(function() {
  8651. _.removeClass("fadeIn")
  8652. }, p.tourInteraction.showPauseButton),
  8653. O || (clearTimeout(I),
  8654. I = setTimeout(h, p.tourInteraction.showModal)),
  8655. setTimeout(function() {
  8656. E.classList.remove("playing")
  8657. }, p.tourInteraction.allowNextClick))
  8658. }
  8659. function a() {
  8660. C.tourInProgress && (C.stopTour(),
  8661. C.endTourProgress(),
  8662. E.classList.remove("playing"))
  8663. }
  8664. function s() {
  8665. T.is(":visible") ? r() : o()
  8666. }
  8667. function l() {
  8668. x.hasClass("playing") && (clearTimeout(I),
  8669. C.atEndOfTour() ? c() : _.removeClass("fadeIn"))
  8670. }
  8671. function c() {
  8672. E.classList.remove("playing"),
  8673. h()
  8674. }
  8675. function h() {//去掉导览结束时的提示
  8676. /* if (!p.tourInteraction.disabled) {
  8677. M.removeClass("small landing " + g.FLOORPLAN + " " + g.OUTDOOR + " " + g.PANORAMA),
  8678. M.addClass("fadeIn tour " + m.deviceType);
  8679. var e = p.tourInteraction.smallModal ? y.SMALL : y.LARGE;
  8680. if (!p.tourInteraction.smallModal) {
  8681. var t;
  8682. 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,
  8683. m.fill(R, A.TOUR_INTERACTION[t]),
  8684. M.addClass(t)
  8685. }
  8686. M.addClass(e)
  8687. } */
  8688. }
  8689. function u(e, t) {
  8690. if (t) {
  8691. var i = "keydown" === t.type
  8692. , n = t.which === f.SPACE || C.tourIsPlaying;
  8693. i && n || e || (O = !0),
  8694. C.atEndOfTour() && d(),
  8695. !C.tourIsPlaying && C.tourInProgress && (_.removeClass("fadeIn"),
  8696. d(),
  8697. t.which !== f.SPACE && a()),
  8698. i && n && s()
  8699. }
  8700. }
  8701. function d() {
  8702. M.removeClass("fadeIn")
  8703. }
  8704. var p = (e("../util/browser"),
  8705. e("../settings"))
  8706. , f = e("../enum/Keys")
  8707. , g = e("../enum/Viewmode")
  8708. , m = (e("./helpManager"),
  8709. e("./populateModal"))
  8710. , v = e("../enum/DirectorEvents")
  8711. , A = e("../enum/HelpModalType")
  8712. , y = e("../enum/HelpModalSize")
  8713. , C = null
  8714. , I = null
  8715. , E = document.getElementById("pause-overlay")
  8716. , b = document.getElementById("player")
  8717. , w = document.getElementById("gui")
  8718. , _ = $("#pause-icon").eq(0)
  8719. , T = $("#play").eq(0)
  8720. , x = $("#playHead").eq(0)
  8721. , S = $(".rightViewContainer, #previous, #next, #gui-modes-inside, #gui-modes-outside, #gui-modes-dollhouse, #gui-modes-floorplan").toArray()
  8722. , M = $("#interaction-modal").eq(0)
  8723. , R = $("#interaction-modal .interaction").toArray()
  8724. , P = ["touchstart", "mousedown", "pointerdown"]
  8725. , O = !1;
  8726. t.exports.init = n,
  8727. t.exports.play = r,
  8728. t.exports.pause = o,
  8729. t.exports.pauseWithoutCTA = a,
  8730. t.exports.togglePlay = s,
  8731. t.exports.stopTour = l,
  8732. t.exports.dismissModal = d
  8733. }
  8734. , {
  8735. "../enum/DirectorEvents": 23,
  8736. "../enum/HelpModalSize": 27,
  8737. "../enum/HelpModalType": 28,
  8738. "../enum/Keys": 30,
  8739. "../enum/Viewmode": 51,
  8740. "../settings": 166,
  8741. "../util/browser": 182,
  8742. "./helpManager": 68,
  8743. "./populateModal": 75
  8744. }],
  8745. 85: [function(e, t, i) {
  8746. "use strict";
  8747. t.exports = Object.freeze({
  8748. OPENED: "vr.modal.opened",
  8749. LAUNCH: "vr.modal.launch",
  8750. CLOSED: "vr.modal.closed",
  8751. NEXT: "vr.modal.next",
  8752. PREV: "vr.modal.prev",
  8753. STORE: "vr.modal.store",
  8754. falseICECHOSEN: "vr.modal.device"
  8755. })
  8756. }
  8757. , {}],
  8758. 86: [function(e, t, i) {
  8759. "use strict";
  8760. function n(e, t, i) {
  8761. function n(e, t, n, r) {
  8762. function o() {
  8763. return p + "&m=" + t + "&display=" + e
  8764. }
  8765. function s() {
  8766. var e = "&utm_medium=" + (a.inIframe() ? "embed" : "direct")
  8767. , t = "&utm_source=" + u
  8768. , n = "&utm_showcase_session_id=" + i;
  8769. return e + t + n
  8770. }
  8771. function l() {
  8772. return d + "&sids=" + t + "&lsid=" + t + "&ln=" + encodeURIComponent(n) + "&ld=" + encodeURIComponent(r) + "&display=" + e
  8773. }
  8774. return a.valueFromHash("vrcoll", !1) ? l() + s() : o() + s()
  8775. }
  8776. function r(e, t, i, r) {
  8777. var o = "https://api.branch.io/v1/url"
  8778. , a = n(e, t, i, r)
  8779. , s = {
  8780. responseType: "json",
  8781. data: {
  8782. branch_key: h.appConfig.branch_key,
  8783. data: {
  8784. m: t,
  8785. full_url: a,
  8786. $desktop_url: m,
  8787. $og_app_id: "331853976762864119",
  8788. $og_title: i,
  8789. $og_description: r,
  8790. $og_image_url: location.origin + "/api/v1/player/models/" + t + "/thumb",
  8791. $canonical_url: window.location.href
  8792. }
  8793. }
  8794. };
  8795. c.post(o, s).done(function(t) {
  8796. f[e] = t.url
  8797. }).fail(function(t) {
  8798. f[e] = t
  8799. }
  8800. .bind(this, a))
  8801. }
  8802. function o(e, t, i) {
  8803. for (var r in s) {
  8804. var o = s[r]
  8805. , a = n(o, e, t, i);
  8806. f[o] = a
  8807. }
  8808. }
  8809. var u = a.inIframe() ? encodeURIComponent(document.referrer) : encodeURIComponent(window.location.href)
  8810. , d = g + "/vr/dlist/?ret=" + u
  8811. , p = g + "/vr/show/?ret=" + u
  8812. , m = "";
  8813. switch (e) {
  8814. case l.IOS:
  8815. r(s.CardboardIOS, t.sid, t.name, t.summary);
  8816. break;
  8817. default:
  8818. o(t.sid, t.name, t.summary)
  8819. }
  8820. }
  8821. function r(e) {
  8822. var t = f[e];
  8823. window.open(t, "_blank")
  8824. }
  8825. function o(e) {
  8826. var t = u[e];
  8827. window.open(t, "_blank")
  8828. }
  8829. var a = e("../../util/browser")
  8830. , s = e("../../enum/VRApps")
  8831. , l = e("../../enum/VRPlatforms")
  8832. , c = e("../../util/ajax")
  8833. , h = e("../../settings")
  8834. , u = {};
  8835. u[s.CardboardAndroid] = "https://play.google.com/store/apps/details?id=com.port.mpvrcardboard&redirect_uri=",
  8836. u[s.CardboardIOS] = "https://itunes.apple.com/us/app/port-vr/id1168808473&redirect_uri=",
  8837. u[s.GearVR] = "https://www.oculus.com/experiences/gear-vr/811670972252145/?redirect_uri=";
  8838. for (var d in s) {
  8839. var p = s[d];
  8840. u[p] += encodeURIComponent(document.referrer + "&display=" + p)
  8841. }
  8842. var f = {}
  8843. , g = function() {
  8844. var e = window.location.host;
  8845. return e.indexOf(".port.com") === -1 && e.indexOf("localhost") === -1 && (e = "my.port.com"),
  8846. "https://" + e
  8847. }();
  8848. t.exports.init = n,
  8849. t.exports.launch = r,
  8850. t.exports.launchStore = o
  8851. }
  8852. , {
  8853. "../../enum/VRApps": 46,
  8854. "../../enum/VRPlatforms": 49,
  8855. "../../settings": 166,
  8856. "../../util/ajax": 181,
  8857. "../../util/browser": 182
  8858. }],
  8859. 87: [function(e, t, i) {
  8860. "use strict";
  8861. function n(e) {
  8862. var t;
  8863. switch (e) {
  8864. case m.IOS:
  8865. return t = p.iosVersion(),
  8866. t.major > 9 || 9 === t.major && t.minor >= 1;
  8867. case m.Android:
  8868. return t = p.androidVersion(),
  8869. t.major > 4 || 4 === t.major && t.minor > 4 || 4 === t.major && 4 === t.minor && t.patch >= 4
  8870. }
  8871. return !1
  8872. }
  8873. function r(e, t) {
  8874. function i(e) {
  8875. K.emit(A.STORE, {
  8876. type: e
  8877. }),
  8878. f.launchStore(e)
  8879. }
  8880. function r(e) {
  8881. switch (e !== _.pageCount && (a(e),
  8882. N.text(e + 1 + " / " + _.pageCount)),
  8883. e) {
  8884. case _.Title:
  8885. O.css("display", "none"),
  8886. L.text(u[e]),
  8887. o(s);
  8888. break;
  8889. case _.Cardboard:
  8890. O.css("display", "block"),
  8891. L.text(u[e]),
  8892. M.filter(".cardboard").off(),
  8893. M.filter(".gearvr").off(),
  8894. c(e, s),
  8895. h(H, X, Z);
  8896. break;
  8897. case _.Gear:
  8898. L.text(u[e]),
  8899. c(e, s),
  8900. T.addClass("lastPage"),
  8901. h(G, X, Z);
  8902. break;
  8903. case _.pageCount:
  8904. T.removeClass("fadeIn"),
  8905. K.emit(A.CLOSED)
  8906. }
  8907. B.filter("[src='']").hide()
  8908. }
  8909. var s = function() {
  8910. return p.detectAndroid() ? p.detectAndroidMobile() && n(m.Android) ? (T.addClass("supported"),
  8911. w = ".show-supported",
  8912. m.Android) : (T.addClass("unsupported"),
  8913. w = ".show-unsupported",
  8914. m.UnsupportedAndroid) : p.detectIPhone() || p.detectIPod() ? (T.addClass("ios"),
  8915. w = ".show-ios",
  8916. _ = v.ios,
  8917. m.IOS) : (T.addClass("desktop"),
  8918. w = ".show-desktop",
  8919. m.Desktop)
  8920. }();
  8921. f.init(s, e, t),
  8922. s !== m.Desktop && T.addClass("mobile");
  8923. var l = function(e) {
  8924. K.emit(A.LAUNCH, {
  8925. vr_platform: s,
  8926. vr_app: e
  8927. }),
  8928. f.launch(e)
  8929. };
  8930. q.cardboardAndroid = l.bind(this, g.CardboardAndroid),
  8931. q.gear = l.bind(this, g.GearVR),
  8932. q.cardboardIOS = l.bind(this, g.CardboardIOS),
  8933. d(),
  8934. $(".show-supported, .show-unsupported, .show-ios, .show-desktop").hide(),
  8935. $(w).show();
  8936. var u = [C.VR_LEARN_MORE_CAPS, C.VR_NEXT_CAPS, C.VR_GOT_IT_CAPS]
  8937. , y = ["vr_modal_learn_more", "vr_modal_next", "vr_modal_done"];
  8938. s === m.IOS && (u.splice(1, 1),
  8939. y.splice(1, 1)),
  8940. $("#vr").on("click", function(e) {
  8941. e.preventDefault();
  8942. if(!window.vrEnabled) { // 开启VR
  8943. window.vrEnabled = true;
  8944. this.classList.add('active');
  8945. $('#gui div').not('#vrOff').addClass('vrHide');
  8946. $('#vrOffImg').css({'display':'inline-block'});
  8947. }else{
  8948. }
  8949. // T.hasClass("fadeIn") ? K.dismiss() : (b = 0,
  8950. // r(b),
  8951. // T.addClass("fadeIn"),
  8952. // K.emit(A.OPENED))
  8953. });
  8954. $('#vrOff').on('click', function(){
  8955. window.vrEnabled = false;
  8956. $('#gui div').not('#vrOff').removeClass('vrHide');
  8957. $('#vrOffImg').css({'display':'none'});
  8958. $('#player canvas').css({width:'', 'height': ''}); // 清楚vr下给canvas设置的宽高, 避免横竖屏切换的时候出现宽高错误的现象
  8959. $('#vr').removeClass('active'); // 清除vr按钮的激活样式
  8960. })
  8961. var I = "https://my.port.com/vr/show/?m=" + e.sid;
  8962. s === m.IOS ? $(".cardboardLink").on("click", i.bind(this, g.CardboardIOS)) : $(".cardboardLink").on("click", i.bind(this, g.CardboardAndroid)),
  8963. $(".gearLink").on("click", i.bind(this, g.GearVR)),
  8964. $("span.modelLink").text(I),
  8965. O.on("click", function(e) {
  8966. K.emit(A.PREV),
  8967. b--,
  8968. r(b)
  8969. }),
  8970. L.on("click", function(e) {
  8971. L.text();
  8972. K.emit(A.NEXT, {
  8973. nextAction: y[b]
  8974. }),
  8975. b++,
  8976. r(b)
  8977. }),
  8978. T.find(".close").on("click", K.dismiss)
  8979. }
  8980. function o(e) {
  8981. switch (e) {
  8982. case m.Android:
  8983. M.filter(".cardboard").off().on("click", q.cardboardAndroid),
  8984. M.filter(".gearvr").off().on("click", q.gear),
  8985. s(H, G, "logo-button", "same-line");
  8986. break;
  8987. case m.UnsupportedAndroid:
  8988. s("", z, "", "");
  8989. break;
  8990. case m.IOS:
  8991. M.filter(".cardboard").off().on("click", q.cardboardIOS),
  8992. s(H, "", "logo-button", "");
  8993. break;
  8994. case m.Desktop:
  8995. M.filter(".cardboard").off().on("click", l.bind(this, null, F, U)),
  8996. M.filter(".gearvr").off().on("click", l.bind(this, G, V, null)),
  8997. s(H, G, "logo-button", "same-line"),
  8998. Q.cardboard()
  8999. }
  9000. }
  9001. function a(e) {
  9002. $(".p1, .p2, .p3").hide(),
  9003. x.insertAfter(S),
  9004. T.removeClass("front-page"),
  9005. T.removeClass("details-page"),
  9006. T.removeClass("lastPage"),
  9007. M.removeClass("logo-button"),
  9008. M.removeClass("same-line"),
  9009. S.removeClass("headsetOptions"),
  9010. R.attr("src", ""),
  9011. R.filter(".second").removeClass("gear"),
  9012. R.css("display", "inline-block"),
  9013. R.off(),
  9014. P.filter(".second").css("display", ""),
  9015. D.css("display", "none"),
  9016. $(".p" + (e + 1) + w).show(),
  9017. R.filter(".third").insertBefore(P.filter(".third"))
  9018. }
  9019. function s(e, t, i, n) {
  9020. T.addClass("front-page"),
  9021. R.filter(".first").attr("src", e),
  9022. R.filter(".second").attr("src", t),
  9023. M.filter(".first").addClass(i),
  9024. M.filter(".second").addClass(i),
  9025. M.addClass(n),
  9026. ".show-desktop" === w && S.insertAfter(x)
  9027. }
  9028. function l(e, t, i) {
  9029. S.addClass("headsetOptions"),
  9030. M.off(),
  9031. R.filter(".second").attr("src", t),
  9032. D.css("display", "block"),
  9033. P.filter(".second").css("display", "none"),
  9034. D.on("click", function() {
  9035. a(_.Title),
  9036. o(m.Desktop)
  9037. }),
  9038. e && (K.emit(A.falseICECHOSEN, {
  9039. name: g.GearVR
  9040. }),
  9041. R.filter(".first").attr("src", e),
  9042. R.filter(".second").addClass("gear"),
  9043. R.filter(".second").on("click", f.launchStore.bind(this, g.GearVR)),
  9044. Q.gearvr()),
  9045. i && (K.emit(A.falseICECHOSEN, {
  9046. name: g.Cardboard
  9047. }),
  9048. R.filter(".third").attr("src", i),
  9049. R.filter(".third").show(),
  9050. R.filter(".third").insertAfter(R.filter(".second")),
  9051. R.filter(".third").addClass("link"),
  9052. R.filter(".second").addClass("link"),
  9053. R.filter(".second").on("click", f.launchStore.bind(this, g.CardboardIOS)),
  9054. R.filter(".third").on("click", f.launchStore.bind(this, g.CardboardAndroid)),
  9055. Q.cardboard())
  9056. }
  9057. function c(e, t) {
  9058. switch (t) {
  9059. case m.IOS:
  9060. X = Y,
  9061. Z = j;
  9062. break;
  9063. case m.Desktop:
  9064. e === _.Cardboard ? (X = F,
  9065. Z = U,
  9066. R.filter(".second").on("click", f.launchStore.bind(this, g.CardboardIOS)),
  9067. R.filter(".third").on("click", f.launchStore.bind(this, g.CardboardAndroid))) : (X = V,
  9068. R.filter(".second").on("click", f.launchStore.bind(this, g.GearVR)),
  9069. Z = "");
  9070. break;
  9071. default:
  9072. e === _.Cardboard ? (X = z,
  9073. Z = j) : (X = k,
  9074. Z = W)
  9075. }
  9076. }
  9077. function h(e, t, i) {
  9078. T.find(".inner").addClass("details-page"),
  9079. T.addClass("details-page"),
  9080. R.filter(".first").attr("src", e),
  9081. R.filter(".second").attr("src", t),
  9082. R.filter(".third").attr("src", i)
  9083. }
  9084. function u() {
  9085. T.hasClass("fadeIn") && (T.removeClass("fadeIn"),
  9086. K.emit(A.CLOSED))
  9087. }
  9088. function d() {
  9089. var e = p.aspectRatio() > 1 && p.isMobile();
  9090. T.toggleClass("landscape", e).toggleClass("portrait", !e),
  9091. T.toggleClass("tiny", $("#player").height() <= y.narrowLandscapeHeight),
  9092. T.toggleClass("tinier", $("#player").height() <= y.reallyNarrowLandscapeHeight)
  9093. }
  9094. var p = e("../../util/browser")
  9095. , f = e("./vrLink")
  9096. , g = e("../../enum/VRApps")
  9097. , m = e("../../enum/VRPlatforms")
  9098. , v = e("../../enum/VRPages")
  9099. , A = e("./vrEvent")
  9100. , y = (e("../../settings"),
  9101. e("../../constants"))
  9102. , C = e("../../localization/localize")
  9103. , I = e("../../util/common")
  9104. , E = e("events").EventEmitter
  9105. , b = 0
  9106. , w = null
  9107. , _ = v.standard
  9108. , T = $(".vr-popup")
  9109. , x = T.find(".vr-popup-body")
  9110. , S = T.find(".vr-images")
  9111. , M = T.find(".img-container")
  9112. , R = T.find(".vr-sm-image")
  9113. , P = M.find(".vr-img-caption")
  9114. , O = $(".vr-buttons").find(".prev-button")
  9115. , L = $(".vr-buttons").find(".next-button")
  9116. , D = S.find(".front-close")
  9117. , N = $(".vr-page")
  9118. , B = T.find("img")
  9119. , F = "images/apple-store.png"
  9120. , V = "images/badge-oculus.png"
  9121. , U = "images/badge-cardboard.png"
  9122. , k = "images/logo-samsung.png"
  9123. , H = "images/headset-cardboard.png"
  9124. , G = "images/headset-gearvr.png"
  9125. , z = "images/ico-android-robot.png"
  9126. , W = "images/ico-gearvr.png"
  9127. , j = "images/ico-vr.png"
  9128. , Y = "images/apple-logo-white.svg"
  9129. , X = null
  9130. , Z = null
  9131. , q = {}
  9132. , K = {
  9133. init: r,
  9134. dismiss: u,
  9135. isDeviceSupported: n
  9136. };
  9137. I.extendObject(K, E.prototype),
  9138. $(window).resize(d);
  9139. var Q = function() {
  9140. var e = P.filter(".first").find(".cardboard")
  9141. , t = P.filter(".first").find(".gearvr");
  9142. return {
  9143. cardboard: function() {
  9144. t.addClass("hidden"),
  9145. e.removeClass("hidden")
  9146. },
  9147. gearvr: function() {
  9148. e.addClass("hidden"),
  9149. t.removeClass("hidden")
  9150. }
  9151. }
  9152. }();
  9153. t.exports = K
  9154. }
  9155. , {
  9156. "../../constants": 8,
  9157. "../../enum/VRApps": 46,
  9158. "../../enum/VRPages": 48,
  9159. "../../enum/VRPlatforms": 49,
  9160. "../../localization/localize": 108,
  9161. "../../settings": 166,
  9162. "../../util/browser": 182,
  9163. "../../util/common": 185,
  9164. "./vrEvent": 85,
  9165. "./vrLink": 86,
  9166. events: 202
  9167. }],
  9168. 88: [function(e, t, i) {
  9169. "use strict";
  9170. t.exports = Object.freeze({
  9171. OPENED: "webvr.modal.opened",
  9172. SHOW_TERMS: "webvr.footer.show.terms"
  9173. })
  9174. }
  9175. , {}],
  9176. 89: [function(e, t, i) {
  9177. (function(i) {
  9178. "use strict";
  9179. function n(e, t, i, n) {
  9180. function r(e) {
  9181. e.preventDefault(),
  9182. a(e.currentTarget.id)
  9183. }
  9184. function a(e) {
  9185. ne[e](),
  9186. Object.keys(ne).map(function(t, i) {
  9187. $("#" + t).toggleClass("tabs-underlined", t === e)
  9188. })
  9189. }
  9190. y = i,
  9191. v = t,
  9192. w.init(E.Android, e, n),
  9193. m();
  9194. var l = new RegExp("daydream","i")
  9195. , c = l.test(y.displayName);
  9196. c ? (a("tabdaydream"),
  9197. B.filter(".device-headset-side").attr("src", H),
  9198. D.find(".title").text(x.localizeText("WEBVR_FOR_DAYDREAM"))) : (a("tabcardboard"),
  9199. B.filter(".device-headset-side").attr("src", Y),
  9200. D.find(".title").text(x.localizeText("WEBVR_FOR_CARDBOARD"))),
  9201. $("#vr").on("click", function(e) {
  9202. e.preventDefault(),
  9203. g("click_webvr_button"),
  9204. L.is(":hidden") && (ie.emit(_.OPENED),
  9205. o())
  9206. }),
  9207. $(".webvr-popup .close").on("click", function(e) {
  9208. e.preventDefault(),
  9209. D.hasClass("hidden") ? (g("webvr_help_close"),
  9210. p()) : s()
  9211. }),
  9212. $("#tabcardboard").on("click", r),
  9213. $("#tabdaydream").on("click", r),
  9214. $("#tabnative").on("click", r),
  9215. $(".webvr-popup .open-with-app").on("click", function(e) {
  9216. e.preventDefault(),
  9217. g("webvr_learn_more"),
  9218. a("tabnative"),
  9219. p()
  9220. }),
  9221. $(".webvr-popup .help").on("click", function(e) {
  9222. e.preventDefault(),
  9223. g(D.hasClass("hidden") ? "webvr_help_close" : "webvr_help_show"),
  9224. p()
  9225. }),
  9226. $(".webvr-popup .terms").on("click", function(e) {
  9227. e.preventDefault(),
  9228. g("webvr_click_terms"),
  9229. s(),
  9230. ie.emit(_.SHOW_TERMS)
  9231. }),
  9232. F.on("click", function(e) {
  9233. e.preventDefault(),
  9234. g(ee),
  9235. window.open(J, "_blank")
  9236. }),
  9237. V.on("click", function(e) {
  9238. e.preventDefault(),
  9239. g("webvr_phone_link"),
  9240. window.open(te, "_blank")
  9241. }),
  9242. $(".webvr-popup .badge-cardboard").on("click", function(e) {
  9243. e.preventDefault(),
  9244. g("webvr_cardboard_link"),
  9245. w.launch(b.CardboardAndroid)
  9246. }),
  9247. $(".webvr-popup .badge-oculus").on("click", function(e) {
  9248. e.preventDefault(),
  9249. g("webvr_oculus_link"),
  9250. w.launch(b.GearVR)
  9251. })
  9252. }
  9253. function r() {
  9254. function e() {
  9255. y.isPresenting || (f(),
  9256. window.removeEventListener("vrdisplaypresentchange", e))
  9257. }
  9258. R.info("Headset mounted"),
  9259. v.suspend();
  9260. var t = document.createElement("canvas");
  9261. for (t.getContext("webgl"),
  9262. t.className = "webvr-canvas",
  9263. document.bgColor = "#000",
  9264. document.body.style.backgroundColor = "#000"; document.body.firstChild; )
  9265. document.body.removeChild(document.body.firstChild);
  9266. document.body.appendChild(t),
  9267. g("webvr_enter_app"),
  9268. y.requestPresent([{
  9269. source: t,
  9270. predistorted: !0
  9271. }]).catch(function(t) {
  9272. R.error("Failed to present: " + t),
  9273. g("webvr_exit_calibrate"),
  9274. e()
  9275. }),
  9276. A.then(function() {
  9277. window.dispatchEvent(new Event("vrapp-start"))
  9278. }),
  9279. window.addEventListener("vrdisplaypresentchange", e)
  9280. }
  9281. function o() {
  9282. O.fadeOut(I.guiAnimationSpeed),
  9283. L.fadeIn(I.guiAnimationSpeed),
  9284. a()
  9285. }
  9286. function a() {
  9287. if (!A) {
  9288. var e = C.valueFromHash("webvr") || I.appConfig.webvr_version
  9289. , t = "https://static.port.com/webvr/" + e + "/js/main.js";
  9290. A = new Promise(function(e, i) {
  9291. var n = document.createElement("script");
  9292. n.type = "text/javascript",
  9293. n.src = t,
  9294. n.onload = e,
  9295. document.head.appendChild(n)
  9296. }
  9297. )
  9298. }
  9299. D.find(".enter-button").on("click", r)
  9300. }
  9301. function s() {
  9302. g("webvr_modal_close"),
  9303. D.find(".enter-button").off("click", r),
  9304. L.fadeOut(I.guiAnimationSpeed, function() {
  9305. D.toggleClass("hidden", !1),
  9306. N.toggleClass("hidden", !0),
  9307. C.exitFullscreen()
  9308. }),
  9309. O.fadeIn(I.guiAnimationSpeed)
  9310. }
  9311. function l() {
  9312. k.toggleClass("hidden", !1),
  9313. U.toggleClass("hidden", !0)
  9314. }
  9315. function c() {
  9316. k.toggleClass("hidden", !0),
  9317. U.toggleClass("hidden", !1)
  9318. }
  9319. function h() {
  9320. B.filter(".device-headset").attr("src", G),
  9321. B.filter(".device-phone").attr("src", z),
  9322. J = Z,
  9323. ee = K,
  9324. F.text(x.localizeText("WEBVR_DAYDREAM_VIEW")),
  9325. V.text(x.localizeText("VR_NEED_DAYDREAM_PHONE")),
  9326. $(".webvr-popup .detail.daydream-label").toggleClass("hidden", !1),
  9327. c()
  9328. }
  9329. function u() {
  9330. B.filter(".badge-cardboard").attr("src", j),
  9331. B.filter(".badge-oculus").attr("src", X),
  9332. l()
  9333. }
  9334. function d() {
  9335. B.filter(".device-headset").attr("src", Y),
  9336. B.filter(".device-phone").attr("src", W),
  9337. J = q,
  9338. ee = Q,
  9339. F.text(x.localizeText("VR_GOOGLE_CARDBOARD")),
  9340. V.text(x.localizeText("VR_COMPATIBLE_ANDROID_LONG")),
  9341. $(".webvr-popup .detail.daydream-label").toggleClass("hidden", !0),
  9342. c()
  9343. }
  9344. function p() {
  9345. D.toggleClass("hidden"),
  9346. N.toggleClass("hidden")
  9347. }
  9348. function f() {
  9349. R.info("exiting webVR"),
  9350. g("webvr_exit_app"),
  9351. window.location.search.indexOf("&qs=1") === -1 ? window.location = window.location + "&qs=1" : window.location = window.location
  9352. }
  9353. function g(e) {
  9354. var t = C.isLandscape() ? "landscape" : "portrait";
  9355. T.trackAlways("showcase_gui", {
  9356. gui_action: e,
  9357. orientation: t
  9358. })
  9359. }
  9360. function m() {
  9361. var e = C.isLandscape();
  9362. L.toggleClass("landscape", e).toggleClass("portrait", !e)
  9363. }
  9364. var v, A, y, C = e("../../util/browser"), I = e("../../settings"), E = (e("./../gui"),
  9365. e("../../enum/VRPlatforms")), b = e("../../enum/VRApps"), w = e("./../vr/vrLink"), _ = e("./WebVrEvent"), T = e("../../analytics"), x = (e("../../constants"),
  9366. 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 = {
  9367. init: n
  9368. }, ne = {
  9369. tabcardboard: d,
  9370. tabdaydream: h,
  9371. tabnative: u
  9372. };
  9373. S.extendObject(ie, P.prototype),
  9374. $(window).resize(m),
  9375. t.exports = ie
  9376. }
  9377. ).call(this, "/js/gui/webvr/webVRgui.js")
  9378. }
  9379. , {
  9380. "../../analytics": 4,
  9381. "../../constants": 8,
  9382. "../../enum/VRApps": 46,
  9383. "../../enum/VRPlatforms": 49,
  9384. "../../localization/localize": 108,
  9385. "../../settings": 166,
  9386. "../../util/browser": 182,
  9387. "../../util/common": 185,
  9388. "../../util/logger": 189,
  9389. "./../gui": 65,
  9390. "./../vr/vrLink": 86,
  9391. "./WebVrEvent": 88,
  9392. events: 202
  9393. }],
  9394. 90: [function(e, t, i) {
  9395. "use strict";
  9396. function n(e, t, i, n, o) {
  9397. n || 0 === n ? this.floorId = n : this.floorId = -1,
  9398. this.roomId = o || "",
  9399. this.labelId = e,
  9400. this.position = (new r.Vector3).copy(t),
  9401. this.text = i
  9402. }
  9403. var r = e("three")
  9404. , o = e("../util/browser");
  9405. n.prototype.build = function() {
  9406. var e = window.document.createElement("div");
  9407. o.isMobile() ? e.setAttribute("class", "gui-floorplan-label gui-floorplan-label-mobile") : e.setAttribute("class", "gui-floorplan-label");
  9408. var t = window.document.createElement("div");
  9409. t.setAttribute("class", "gui-floorplan-label-text");
  9410. var i = window.document.createTextNode(this.text);
  9411. t.appendChild(i),
  9412. e.appendChild(t),
  9413. window.document.body.appendChild(e),
  9414. this.labelGui = e,
  9415. this.textBlock = t,
  9416. $(this.labelGui).hide();
  9417. var n = window.getComputedStyle(this.labelGui);
  9418. this.initialTransform = n.transform || n.webkitTransform
  9419. }
  9420. ,
  9421. t.exports = n
  9422. }
  9423. , {
  9424. "../util/browser": 182,
  9425. three: 217
  9426. }],
  9427. 91: [function(e, t, i) {
  9428. "use strict";
  9429. function n() {
  9430. this.player = null,
  9431. this.modelManager = null,
  9432. this.container = null
  9433. }
  9434. var r = e("three")
  9435. , o = (e("../util/common"),
  9436. e("../enum/PlayerEvents"))
  9437. , a = (e("../enum/DirectorEvents"),
  9438. e("../enum/ModelManagerEvents"))
  9439. , s = e("../settings")
  9440. , l = e("../enum/Viewmode")
  9441. , c = (e("../enum/WarpStyle"),
  9442. e("../util/transitions"),
  9443. e("../util/lerp"),
  9444. e("../util/browser"));
  9445. //场景初始化
  9446. n.prototype.init = function(e, t, i) {
  9447. this.player = e,
  9448. this.modelManager = t,
  9449. this.container = i,
  9450. this.updateModel(),
  9451. this.bindEvents()
  9452. }
  9453. ,
  9454. n.prototype.bindEvents = function() {
  9455. this.modelManager.on(a.ActiveModelChanged, this.updateModel.bind(this)),
  9456. this.player.on(o.ViewChanged, this.handlePlayerViewChanged.bind(this)),
  9457. this.player.on(o.ModeChanged, this.handlePlayerViewChanged.bind(this)),
  9458. this.player.on(o.StartInside, this.handleStartInside.bind(this)),
  9459. this.player.on(o.StartOutside, this.handleStartOutside.bind(this))
  9460. }
  9461. ,
  9462. n.prototype.updateModel = function() {
  9463. this.model = this.modelManager.getActiveModel()
  9464. }
  9465. ,
  9466. n.prototype.handlePlayerViewChanged = function() {
  9467. this.updateLabelVisibility(),
  9468. this.updateLabelDisplay()
  9469. }
  9470. ,
  9471. n.prototype.getLabelsForFloor = function(e, t) {
  9472. return t = t || [],
  9473. t.length = 0,
  9474. this.model.labels.forEach(function(i) {
  9475. this.labelVisibleForFloor(i, e) && t.push(i)
  9476. }
  9477. .bind(this)),
  9478. t
  9479. }
  9480. ,
  9481. n.prototype.getLabelsForCurrentFloor = function(e) {
  9482. return this.getLabelsForFloor(this.model.currentFloor.floorIndex, e)
  9483. }
  9484. ,
  9485. n.prototype.labelVisibleForFloor = function(e, t) {
  9486. var i = c.isMobile() && this.player.getLabelScaleFactor() < s.labels.zoomHideThreshhold.mobile || !c.isMobile() && this.player.getLabelScaleFactor() < s.labels.zoomHideThreshhold.desktop;
  9487. if (!this.model.showingLabels || !e.labelGui || !i)
  9488. return !1;
  9489. var n = e.floorId === this.model.floors.size() - 1;
  9490. return this.model.allFloorsVisible ? n : e.floorId === t
  9491. }
  9492. ,
  9493. n.prototype.updateLabelVisibility = function(e) {
  9494. this.model.labels.forEach(function(e) {
  9495. 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)
  9496. }
  9497. .bind(this))
  9498. }
  9499. ,
  9500. n.prototype.showAllLabels = function(e, t) {
  9501. this.model.labels.forEach(function(i) {
  9502. this.showLabel(i, e, t)
  9503. }
  9504. .bind(this))
  9505. }
  9506. ,
  9507. n.prototype.hideAllLabels = function(e, t) {
  9508. this.model.labels.forEach(function(i) {
  9509. this.hideLabel(i, e, t)
  9510. }
  9511. .bind(this))
  9512. }
  9513. ,
  9514. n.prototype.showLabel = function(e, t, i) {
  9515. this.model.showingLabels && (e.visible || (e.visible = !0,
  9516. e.labelGui.style.display = "block",
  9517. e.labelGui.style.opacity = 0,
  9518. $(e.labelGui).delay(t).fadeTo(i, 1)))
  9519. }
  9520. ,
  9521. n.prototype.hideLabel = function(e, t, i) {
  9522. e.visible && (e.visible = !1,
  9523. c.isMobile() ? $(e.labelGui).hide() : $(e.labelGui).delay(t).fadeOut(i))
  9524. }
  9525. ,
  9526. n.prototype.supportedMode = function() {
  9527. return this.player.mode === l.FLOORPLAN
  9528. }
  9529. ,
  9530. n.prototype.updateLabelDisplay = function() {
  9531. var e = (new r.Vector3,
  9532. new r.Vector3,
  9533. []);
  9534. return function() {
  9535. var t = this.player.getLabelScaleFactor()
  9536. , i = .6
  9537. , n = 1.2
  9538. , r = (1 - t) * n + i
  9539. , o = c.isMobile() ? s.labels.zoomTruncateThreshhold.mobile : s.labels.zoomTruncateThreshhold.desktop;
  9540. this.getLabelsForCurrentFloor(e);
  9541. for (var a = 0; a < e.length; a++) {
  9542. var l = e[a];
  9543. this.supportedMode() && l.labelGui && (this.updateProjectedGuiElement(l.labelGui, l.textBlock, l.position, r, r),
  9544. 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)
  9545. }
  9546. }
  9547. }(),
  9548. n.prototype.updateProjectedGuiElement = function() {
  9549. var e = new r.Vector3;
  9550. new r.Vector3;
  9551. return function(t, i, n, r, o) {
  9552. i.style.fontSize = 100 * o + "%";
  9553. var a = $("#player").width()
  9554. , s = $("#player").height()
  9555. , l = .5 * a
  9556. , c = .5 * s;
  9557. e.copy(n),
  9558. e.project(this.player.camera);
  9559. var h = e.x * l + l
  9560. , u = -(e.y * c) + c;
  9561. h -= t.offsetWidth / 2,
  9562. u -= t.offsetHeight / 2,
  9563. t.style.left = h + "px",
  9564. t.style.top = u + "px"
  9565. }
  9566. }(),
  9567. n.prototype.handleStartInside = function(e) {
  9568. this.updateLabelVisibility()
  9569. }
  9570. ,
  9571. n.prototype.handleStartOutside = function() {
  9572. this.updateLabelVisibility()
  9573. }
  9574. ,
  9575. t.exports = n
  9576. }
  9577. , {
  9578. "../enum/DirectorEvents": 23,
  9579. "../enum/ModelManagerEvents": 33,
  9580. "../enum/PlayerEvents": 40,
  9581. "../enum/Viewmode": 51,
  9582. "../enum/WarpStyle": 52,
  9583. "../settings": 166,
  9584. "../util/browser": 182,
  9585. "../util/common": 185,
  9586. "../util/lerp": 188,
  9587. "../util/transitions": 195,
  9588. three: 217
  9589. }],
  9590. 92: [function(e, t, i) {
  9591. "use strict";
  9592. Array.prototype.findIndex || (Array.prototype.findIndex = function(e) {
  9593. if (null == this)
  9594. throw new TypeError("Array.prototype.findIndex called on null or undefined");
  9595. if ("function" != typeof e)
  9596. throw new TypeError("predicate must be a function");
  9597. for (var t, i = Object(this), n = i.length >>> 0, r = arguments[1], o = 0; o < n; o++)
  9598. if (t = i[o],
  9599. e.call(r, t, o, i))
  9600. return o;
  9601. return -1
  9602. }
  9603. ),
  9604. Array.prototype.find || Object.defineProperty(Array.prototype, "find", {
  9605. value: function(e) {
  9606. if (null == this)
  9607. throw new TypeError('"this" is null or not defined');
  9608. var t = Object(this)
  9609. , i = t.length >>> 0;
  9610. if ("function" != typeof e)
  9611. throw new TypeError("predicate must be a function");
  9612. for (var n = arguments[1], r = 0; r < i; ) {
  9613. var o = t[r];
  9614. if (e.call(n, o, r, t))
  9615. return o;
  9616. r++
  9617. }
  9618. }
  9619. })
  9620. }
  9621. , {}],
  9622. 93: [function(e, t, i) {
  9623. "use strict";
  9624. var n = n || {};
  9625. t.exports = n,
  9626. n.gui = n.gui || {},
  9627. n.utils = n.utils || {},
  9628. n.controllers = n.controllers || {},
  9629. n.dom = n.dom || {},
  9630. n.color = n.color || {},
  9631. n.utils.css = function() {
  9632. return {
  9633. load: function(e, t) {
  9634. t = t || document;
  9635. var i = t.createElement("link");
  9636. i.type = "text/css",
  9637. i.rel = "stylesheet",
  9638. i.href = e,
  9639. t.getElementsByTagName("head")[0].appendChild(i)
  9640. },
  9641. inject: function(e, t) {
  9642. t = t || document;
  9643. var i = document.createElement("style");
  9644. i.type = "text/css",
  9645. i.innerHTML = e,
  9646. t.getElementsByTagName("head")[0].appendChild(i)
  9647. }
  9648. }
  9649. }(),
  9650. n.utils.common = function() {
  9651. var e = Array.prototype.forEach
  9652. , t = Array.prototype.slice;
  9653. return {
  9654. BREAK: {},
  9655. extend: function(e) {
  9656. return this.each(t.call(arguments, 1), function(t) {
  9657. for (var i in t)
  9658. this.isUndefined(t[i]) || (e[i] = t[i])
  9659. }, this),
  9660. e
  9661. },
  9662. defaults: function(e) {
  9663. return this.each(t.call(arguments, 1), function(t) {
  9664. for (var i in t)
  9665. this.isUndefined(e[i]) && (e[i] = t[i])
  9666. }, this),
  9667. e
  9668. },
  9669. compose: function() {
  9670. var e = t.call(arguments);
  9671. return function() {
  9672. for (var i = t.call(arguments), n = e.length - 1; n >= 0; n--)
  9673. i = [e[n].apply(this, i)];
  9674. return i[0]
  9675. }
  9676. },
  9677. each: function(t, i, n) {
  9678. if (t)
  9679. if (e && t.forEach && t.forEach === e)
  9680. t.forEach(i, n);
  9681. else if (t.length === t.length + 0) {
  9682. for (var r = 0, o = t.length; r < o; r++)
  9683. if (r in t && i.call(n, t[r], r) === this.BREAK)
  9684. return
  9685. } else
  9686. for (var r in t)
  9687. if (i.call(n, t[r], r) === this.BREAK)
  9688. return
  9689. },
  9690. defer: function(e) {
  9691. setTimeout(e, 0)
  9692. },
  9693. toArray: function(e) {
  9694. return e.toArray ? e.toArray() : t.call(e)
  9695. },
  9696. isUndefined: function(e) {
  9697. return void 0 === e
  9698. },
  9699. isNull: function(e) {
  9700. return null === e
  9701. },
  9702. isNaN: function(e) {
  9703. return e !== e
  9704. },
  9705. isArray: Array.isArray || function(e) {
  9706. return e.constructor === Array
  9707. }
  9708. ,
  9709. isObject: function(e) {
  9710. return e === Object(e)
  9711. },
  9712. isNumber: function(e) {
  9713. return e === e + 0
  9714. },
  9715. isString: function(e) {
  9716. return e === e + ""
  9717. },
  9718. isBoolean: function(e) {
  9719. return e === !1 || e === !0
  9720. },
  9721. isFunction: function(e) {
  9722. return "[object Function]" === Object.prototype.toString.call(e)
  9723. }
  9724. }
  9725. }(),
  9726. n.controllers.Controller = function(e) {
  9727. var t = function(e, t) {
  9728. this.initialValue = e[t],
  9729. this.domElement = document.createElement("div"),
  9730. this.object = e,
  9731. this.property = t,
  9732. this.__onChange = void 0,
  9733. this.__onFinishChange = void 0
  9734. };
  9735. return e.extend(t.prototype, {
  9736. onChange: function(e) {
  9737. return this.__onChange = e,
  9738. this
  9739. },
  9740. onFinishChange: function(e) {
  9741. return this.__onFinishChange = e,
  9742. this
  9743. },
  9744. setValue: function(e) {
  9745. return this.object[this.property] = e,
  9746. this.__onChange && this.__onChange.call(this, e),
  9747. this.updateDisplay(),
  9748. this
  9749. },
  9750. getValue: function() {
  9751. return this.object[this.property]
  9752. },
  9753. updateDisplay: function() {
  9754. return this
  9755. },
  9756. isModified: function() {
  9757. return this.initialValue !== this.getValue()
  9758. }
  9759. }),
  9760. t
  9761. }(n.utils.common),
  9762. n.dom.dom = function(e) {
  9763. function t(t) {
  9764. if ("0" === t || e.isUndefined(t))
  9765. return 0;
  9766. var i = t.match(r);
  9767. return e.isNull(i) ? 0 : parseFloat(i[1])
  9768. }
  9769. var i = {
  9770. HTMLEvents: ["change"],
  9771. MouseEvents: ["click", "mousemove", "mousedown", "mouseup", "mouseover"],
  9772. KeyboardEvents: ["keydown"]
  9773. }
  9774. , n = {};
  9775. e.each(i, function(t, i) {
  9776. e.each(t, function(e) {
  9777. n[e] = i
  9778. })
  9779. });
  9780. var r = /(\d+(\.\d+)?)px/
  9781. , o = {
  9782. makeSelectable: function(e, t) {
  9783. void 0 !== e && void 0 !== e.style && (e.onselectstart = t ? function() {
  9784. return !1
  9785. }
  9786. : function() {}
  9787. ,
  9788. e.style.MozUserSelect = t ? "auto" : "none",
  9789. e.style.KhtmlUserSelect = t ? "auto" : "none",
  9790. e.unselectable = t ? "on" : "off")
  9791. },
  9792. makeFullscreen: function(t, i, n) {
  9793. e.isUndefined(i) && (i = !0),
  9794. e.isUndefined(n) && (n = !0),
  9795. t.style.position = "absolute",
  9796. i && (t.style.left = 0,
  9797. t.style.right = 0),
  9798. n && (t.style.top = 0,
  9799. t.style.bottom = 0)
  9800. },
  9801. fakeEvent: function(t, i, r, o) {
  9802. r = r || {};
  9803. var a = n[i];
  9804. if (!a)
  9805. throw new Error("Event type " + i + " not supported.");
  9806. var s = document.createEvent(a);
  9807. switch (a) {
  9808. case "MouseEvents":
  9809. var l = r.x || r.clientX || 0
  9810. , c = r.y || r.clientY || 0;
  9811. s.initMouseEvent(i, r.bubbles || !1, r.cancelable || !0, window, r.clickCount || 1, 0, 0, l, c, !1, !1, !1, !1, 0, null);
  9812. break;
  9813. case "KeyboardEvents":
  9814. var h = s.initKeyboardEvent || s.initKeyEvent;
  9815. e.defaults(r, {
  9816. cancelable: !0,
  9817. ctrlKey: !1,
  9818. altKey: !1,
  9819. shiftKey: !1,
  9820. metaKey: !1,
  9821. keyCode: void 0,
  9822. charCode: void 0
  9823. }),
  9824. h(i, r.bubbles || !1, r.cancelable, window, r.ctrlKey, r.altKey, r.shiftKey, r.metaKey, r.keyCode, r.charCode);
  9825. break;
  9826. default:
  9827. s.initEvent(i, r.bubbles || !1, r.cancelable || !0)
  9828. }
  9829. e.defaults(s, o),
  9830. t.dispatchEvent(s)
  9831. },
  9832. bind: function(e, t, i, n) {
  9833. return n = n || !1,
  9834. e.addEventListener ? e.addEventListener(t, i, n) : e.attachEvent && e.attachEvent("on" + t, i),
  9835. o
  9836. },
  9837. unbind: function(e, t, i, n) {
  9838. return n = n || !1,
  9839. e.removeEventListener ? e.removeEventListener(t, i, n) : e.detachEvent && e.detachEvent("on" + t, i),
  9840. o
  9841. },
  9842. addClass: function(e, t) {
  9843. if (void 0 === e.className)
  9844. e.className = t;
  9845. else if (e.className !== t) {
  9846. var i = e.className.split(/ +/);
  9847. i.indexOf(t) == -1 && (i.push(t),
  9848. e.className = i.join(" ").replace(/^\s+/, "").replace(/\s+$/, ""))
  9849. }
  9850. return o
  9851. },
  9852. removeClass: function(e, t) {
  9853. if (t)
  9854. if (void 0 === e.className)
  9855. ;
  9856. else if (e.className === t)
  9857. e.removeAttribute("class");
  9858. else {
  9859. var i = e.className.split(/ +/)
  9860. , n = i.indexOf(t);
  9861. n != -1 && (i.splice(n, 1),
  9862. e.className = i.join(" "))
  9863. }
  9864. else
  9865. e.className = void 0;
  9866. return o
  9867. },
  9868. hasClass: function(e, t) {
  9869. return new RegExp("(?:^|\\s+)" + t + "(?:\\s+|$)").test(e.className) || !1
  9870. },
  9871. getWidth: function(e) {
  9872. var i = getComputedStyle(e);
  9873. return t(i["border-left-width"]) + t(i["border-right-width"]) + t(i["padding-left"]) + t(i["padding-right"]) + t(i.width)
  9874. },
  9875. getHeight: function(e) {
  9876. var i = getComputedStyle(e);
  9877. return t(i["border-top-width"]) + t(i["border-bottom-width"]) + t(i["padding-top"]) + t(i["padding-bottom"]) + t(i.height)
  9878. },
  9879. getOffset: function(e) {
  9880. var t = {
  9881. left: 0,
  9882. top: 0
  9883. };
  9884. if (e.offsetParent)
  9885. do
  9886. t.left += e.offsetLeft,
  9887. t.top += e.offsetTop;
  9888. while (e = e.offsetParent);return t
  9889. },
  9890. isActive: function(e) {
  9891. return e === document.activeElement && (e.type || e.href)
  9892. }
  9893. };
  9894. return o
  9895. }(n.utils.common),
  9896. n.controllers.OptionController = function(e, t, i) {
  9897. var n = function(e, r, o) {
  9898. n.superclass.call(this, e, r);
  9899. var a = this;
  9900. if (this.__select = document.createElement("select"),
  9901. i.isArray(o)) {
  9902. var s = {};
  9903. i.each(o, function(e) {
  9904. s[e] = e
  9905. }),
  9906. o = s
  9907. }
  9908. i.each(o, function(e, t) {
  9909. var i = document.createElement("option");
  9910. i.innerHTML = t,
  9911. i.setAttribute("value", e),
  9912. a.__select.appendChild(i)
  9913. }),
  9914. this.updateDisplay(),
  9915. t.bind(this.__select, "change", function() {
  9916. var e = this.options[this.selectedIndex].value;
  9917. a.setValue(e)
  9918. }),
  9919. this.domElement.appendChild(this.__select)
  9920. };
  9921. return n.superclass = e,
  9922. i.extend(n.prototype, e.prototype, {
  9923. setValue: function(e) {
  9924. var t = n.superclass.prototype.setValue.call(this, e);
  9925. return this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  9926. t
  9927. },
  9928. updateDisplay: function() {
  9929. return this.__select.value = this.getValue(),
  9930. n.superclass.prototype.updateDisplay.call(this)
  9931. }
  9932. }),
  9933. n
  9934. }(n.controllers.Controller, n.dom.dom, n.utils.common),
  9935. n.controllers.NumberController = function(e, t) {
  9936. function i(e) {
  9937. return e = e.toString(),
  9938. e.indexOf(".") > -1 ? e.length - e.indexOf(".") - 1 : 0
  9939. }
  9940. var n = function(e, r, o) {
  9941. n.superclass.call(this, e, r),
  9942. o = o || {},
  9943. this.__min = o.min,
  9944. this.__max = o.max,
  9945. this.__step = o.step,
  9946. 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,
  9947. this.__precision = i(this.__impliedStep)
  9948. };
  9949. return n.superclass = e,
  9950. t.extend(n.prototype, e.prototype, {
  9951. setValue: function(e) {
  9952. return void 0 !== this.__min && e < this.__min ? e = this.__min : void 0 !== this.__max && e > this.__max && (e = this.__max),
  9953. void 0 !== this.__step && e % this.__step != 0 && (e = Math.round(e / this.__step) * this.__step),
  9954. n.superclass.prototype.setValue.call(this, e)
  9955. },
  9956. min: function(e) {
  9957. return this.__min = e,
  9958. this
  9959. },
  9960. max: function(e) {
  9961. return this.__max = e,
  9962. this
  9963. },
  9964. step: function(e) {
  9965. return this.__step = e,
  9966. this.__impliedStep = e,
  9967. this.__precision = i(e),
  9968. this
  9969. }
  9970. }),
  9971. n
  9972. }(n.controllers.Controller, n.utils.common),
  9973. n.controllers.NumberControllerBox = function(e, t, i) {
  9974. function n(e, t) {
  9975. var i = Math.pow(10, t);
  9976. return Math.round(e * i) / i
  9977. }
  9978. var r = function(e, n, o) {
  9979. function a() {
  9980. var e = parseFloat(d.__input.value);
  9981. i.isNaN(e) || d.setValue(e)
  9982. }
  9983. function s() {
  9984. a(),
  9985. d.__onFinishChange && d.__onFinishChange.call(d, d.getValue())
  9986. }
  9987. function l(e) {
  9988. t.bind(window, "mousemove", c),
  9989. t.bind(window, "mouseup", h),
  9990. u = e.clientY
  9991. }
  9992. function c(e) {
  9993. var t = u - e.clientY;
  9994. d.setValue(d.getValue() + t * d.__impliedStep),
  9995. u = e.clientY
  9996. }
  9997. function h() {
  9998. t.unbind(window, "mousemove", c),
  9999. t.unbind(window, "mouseup", h)
  10000. }
  10001. this.__truncationSuspended = !1,
  10002. r.superclass.call(this, e, n, o);
  10003. var u, d = this;
  10004. this.__input = document.createElement("input"),
  10005. this.__input.setAttribute("type", "text"),
  10006. t.bind(this.__input, "change", a),
  10007. t.bind(this.__input, "blur", s),
  10008. t.bind(this.__input, "mousedown", l),
  10009. t.bind(this.__input, "keydown", function(e) {
  10010. 13 === e.keyCode && (d.__truncationSuspended = !0,
  10011. this.blur(),
  10012. d.__truncationSuspended = !1)
  10013. }),
  10014. this.updateDisplay(),
  10015. this.domElement.appendChild(this.__input)
  10016. };
  10017. return r.superclass = e,
  10018. i.extend(r.prototype, e.prototype, {
  10019. updateDisplay: function() {
  10020. return this.__input.value = this.__truncationSuspended ? this.getValue() : n(this.getValue(), this.__precision),
  10021. r.superclass.prototype.updateDisplay.call(this)
  10022. }
  10023. }),
  10024. r
  10025. }(n.controllers.NumberController, n.dom.dom, n.utils.common),
  10026. n.controllers.NumberControllerSlider = function(e, t, i, n, r) {
  10027. function o(e, t, i, n, r) {
  10028. return n + (r - n) * ((e - t) / (i - t))
  10029. }
  10030. var a = function(e, i, n, r, s) {
  10031. function l(e) {
  10032. t.bind(window, "mousemove", c),
  10033. t.bind(window, "mouseup", h),
  10034. c(e)
  10035. }
  10036. function c(e) {
  10037. e.preventDefault();
  10038. var i = t.getOffset(u.__background)
  10039. , n = t.getWidth(u.__background);
  10040. return u.setValue(o(e.clientX, i.left, i.left + n, u.__min, u.__max)),
  10041. !1
  10042. }
  10043. function h() {
  10044. t.unbind(window, "mousemove", c),
  10045. t.unbind(window, "mouseup", h),
  10046. u.__onFinishChange && u.__onFinishChange.call(u, u.getValue())
  10047. }
  10048. a.superclass.call(this, e, i, {
  10049. min: n,
  10050. max: r,
  10051. step: s
  10052. });
  10053. var u = this;
  10054. this.__background = document.createElement("div"),
  10055. this.__foreground = document.createElement("div"),
  10056. t.bind(this.__background, "mousedown", l),
  10057. t.addClass(this.__background, "slider"),
  10058. t.addClass(this.__foreground, "slider-fg"),
  10059. this.updateDisplay(),
  10060. this.__background.appendChild(this.__foreground),
  10061. this.domElement.appendChild(this.__background)
  10062. };
  10063. return a.superclass = e,
  10064. a.useDefaultStyles = function() {
  10065. i.inject(r)
  10066. }
  10067. ,
  10068. n.extend(a.prototype, e.prototype, {
  10069. updateDisplay: function() {
  10070. var e = (this.getValue() - this.__min) / (this.__max - this.__min);
  10071. return this.__foreground.style.width = 100 * e + "%",
  10072. a.superclass.prototype.updateDisplay.call(this)
  10073. }
  10074. }),
  10075. a
  10076. }(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}"),
  10077. n.controllers.FunctionController = function(e, t, i) {
  10078. var n = function(e, i, r) {
  10079. n.superclass.call(this, e, i);
  10080. var o = this;
  10081. this.__button = document.createElement("div"),
  10082. this.__button.innerHTML = void 0 === r ? "Fire" : r,
  10083. t.bind(this.__button, "click", function(e) {
  10084. return e.preventDefault(),
  10085. o.fire(),
  10086. !1
  10087. }),
  10088. t.addClass(this.__button, "button"),
  10089. this.domElement.appendChild(this.__button)
  10090. };
  10091. return n.superclass = e,
  10092. i.extend(n.prototype, e.prototype, {
  10093. fire: function() {
  10094. this.__onChange && this.__onChange.call(this),
  10095. this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  10096. this.getValue().call(this.object)
  10097. }
  10098. }),
  10099. n
  10100. }(n.controllers.Controller, n.dom.dom, n.utils.common),
  10101. n.controllers.BooleanController = function(e, t, i) {
  10102. var n = function(e, i) {
  10103. function r() {
  10104. o.setValue(!o.__prev)
  10105. }
  10106. n.superclass.call(this, e, i);
  10107. var o = this;
  10108. this.__prev = this.getValue(),
  10109. this.__checkbox = document.createElement("input"),
  10110. this.__checkbox.setAttribute("type", "checkbox"),
  10111. t.bind(this.__checkbox, "change", r, !1),
  10112. this.domElement.appendChild(this.__checkbox),
  10113. this.updateDisplay()
  10114. };
  10115. return n.superclass = e,
  10116. i.extend(n.prototype, e.prototype, {
  10117. setValue: function(e) {
  10118. var t = n.superclass.prototype.setValue.call(this, e);
  10119. return this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  10120. this.__prev = this.getValue(),
  10121. t
  10122. },
  10123. updateDisplay: function() {
  10124. return this.getValue() === !0 ? (this.__checkbox.setAttribute("checked", "checked"),
  10125. this.__checkbox.checked = !0) : this.__checkbox.checked = !1,
  10126. n.superclass.prototype.updateDisplay.call(this)
  10127. }
  10128. }),
  10129. n
  10130. }(n.controllers.Controller, n.dom.dom, n.utils.common),
  10131. n.color.toString = function(e) {
  10132. return function(t) {
  10133. if (1 == t.a || e.isUndefined(t.a)) {
  10134. for (var i = t.hex.toString(16); i.length < 6; )
  10135. i = "0" + i;
  10136. return "#" + i
  10137. }
  10138. return "rgba(" + Math.round(t.r) + "," + Math.round(t.g) + "," + Math.round(t.b) + "," + t.a + ")"
  10139. }
  10140. }(n.utils.common),
  10141. n.color.interpret = function(e, t) {
  10142. var i, n, r = function() {
  10143. n = !1;
  10144. var e = arguments.length > 1 ? t.toArray(arguments) : arguments[0];
  10145. return t.each(o, function(r) {
  10146. if (r.litmus(e))
  10147. return t.each(r.conversions, function(r, o) {
  10148. if (i = r.read(e),
  10149. n === !1 && i !== !1)
  10150. return n = i,
  10151. i.conversionName = o,
  10152. i.conversion = r,
  10153. t.BREAK
  10154. }),
  10155. t.BREAK
  10156. }),
  10157. n
  10158. }, o = [{
  10159. litmus: t.isString,
  10160. conversions: {
  10161. THREE_CHAR_HEX: {
  10162. read: function(e) {
  10163. var t = e.match(/^#([A-F0-9])([A-F0-9])([A-F0-9])$/i);
  10164. return null !== t && {
  10165. space: "HEX",
  10166. hex: parseInt("0x" + t[1].toString() + t[1].toString() + t[2].toString() + t[2].toString() + t[3].toString() + t[3].toString())
  10167. }
  10168. },
  10169. write: e
  10170. },
  10171. SIX_CHAR_HEX: {
  10172. read: function(e) {
  10173. var t = e.match(/^#([A-F0-9]{6})$/i);
  10174. return null !== t && {
  10175. space: "HEX",
  10176. hex: parseInt("0x" + t[1].toString())
  10177. }
  10178. },
  10179. write: e
  10180. },
  10181. CSS_RGB: {
  10182. read: function(e) {
  10183. var t = e.match(/^rgb\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\)/);
  10184. return null !== t && {
  10185. space: "RGB",
  10186. r: parseFloat(t[1]),
  10187. g: parseFloat(t[2]),
  10188. b: parseFloat(t[3])
  10189. }
  10190. },
  10191. write: e
  10192. },
  10193. CSS_RGBA: {
  10194. read: function(e) {
  10195. var t = e.match(/^rgba\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\,\s*(.+)\s*\)/);
  10196. return null !== t && {
  10197. space: "RGB",
  10198. r: parseFloat(t[1]),
  10199. g: parseFloat(t[2]),
  10200. b: parseFloat(t[3]),
  10201. a: parseFloat(t[4])
  10202. }
  10203. },
  10204. write: e
  10205. }
  10206. }
  10207. }, {
  10208. litmus: t.isNumber,
  10209. conversions: {
  10210. HEX: {
  10211. read: function(e) {
  10212. return {
  10213. space: "HEX",
  10214. hex: e,
  10215. conversionName: "HEX"
  10216. }
  10217. },
  10218. write: function(e) {
  10219. return e.hex
  10220. }
  10221. }
  10222. }
  10223. }, {
  10224. litmus: t.isArray,
  10225. conversions: {
  10226. RGB_ARRAY: {
  10227. read: function(e) {
  10228. return 3 == e.length && {
  10229. space: "RGB",
  10230. r: e[0],
  10231. g: e[1],
  10232. b: e[2]
  10233. }
  10234. },
  10235. write: function(e) {
  10236. return [e.r, e.g, e.b]
  10237. }
  10238. },
  10239. RGBA_ARRAY: {
  10240. read: function(e) {
  10241. return 4 == e.length && {
  10242. space: "RGB",
  10243. r: e[0],
  10244. g: e[1],
  10245. b: e[2],
  10246. a: e[3]
  10247. }
  10248. },
  10249. write: function(e) {
  10250. return [e.r, e.g, e.b, e.a]
  10251. }
  10252. }
  10253. }
  10254. }, {
  10255. litmus: t.isObject,
  10256. conversions: {
  10257. RGBA_OBJ: {
  10258. read: function(e) {
  10259. return !!(t.isNumber(e.r) && t.isNumber(e.g) && t.isNumber(e.b) && t.isNumber(e.a)) && {
  10260. space: "RGB",
  10261. r: e.r,
  10262. g: e.g,
  10263. b: e.b,
  10264. a: e.a
  10265. }
  10266. },
  10267. write: function(e) {
  10268. return {
  10269. r: e.r,
  10270. g: e.g,
  10271. b: e.b,
  10272. a: e.a
  10273. }
  10274. }
  10275. },
  10276. RGB_OBJ: {
  10277. read: function(e) {
  10278. return !!(t.isNumber(e.r) && t.isNumber(e.g) && t.isNumber(e.b)) && {
  10279. space: "RGB",
  10280. r: e.r,
  10281. g: e.g,
  10282. b: e.b
  10283. }
  10284. },
  10285. write: function(e) {
  10286. return {
  10287. r: e.r,
  10288. g: e.g,
  10289. b: e.b
  10290. }
  10291. }
  10292. },
  10293. HSVA_OBJ: {
  10294. read: function(e) {
  10295. return !!(t.isNumber(e.h) && t.isNumber(e.s) && t.isNumber(e.v) && t.isNumber(e.a)) && {
  10296. space: "HSV",
  10297. h: e.h,
  10298. s: e.s,
  10299. v: e.v,
  10300. a: e.a
  10301. }
  10302. },
  10303. write: function(e) {
  10304. return {
  10305. h: e.h,
  10306. s: e.s,
  10307. v: e.v,
  10308. a: e.a
  10309. }
  10310. }
  10311. },
  10312. HSV_OBJ: {
  10313. read: function(e) {
  10314. return !!(t.isNumber(e.h) && t.isNumber(e.s) && t.isNumber(e.v)) && {
  10315. space: "HSV",
  10316. h: e.h,
  10317. s: e.s,
  10318. v: e.v
  10319. }
  10320. },
  10321. write: function(e) {
  10322. return {
  10323. h: e.h,
  10324. s: e.s,
  10325. v: e.v
  10326. }
  10327. }
  10328. }
  10329. }
  10330. }];
  10331. return r
  10332. }(n.color.toString, n.utils.common),
  10333. n.GUI = n.gui.GUI = function(e, t, i, n, r, o, a, s, l, c, h, u, d, p, f) {
  10334. function g(e, t, i, o) {
  10335. if (void 0 === t[i])
  10336. throw new Error("Object " + t + ' has no property "' + i + '"');
  10337. var a;
  10338. if (o.color)
  10339. a = new h(t,i);
  10340. else {
  10341. var s = [t, i].concat(o.factoryArgs);
  10342. a = n.apply(e, s)
  10343. }
  10344. o.before instanceof r && (o.before = o.before.__li),
  10345. A(e, a),
  10346. p.addClass(a.domElement, "c");
  10347. var l = document.createElement("span");
  10348. p.addClass(l, "property-name"),
  10349. l.innerHTML = a.property;
  10350. var c = document.createElement("div");
  10351. c.appendChild(l),
  10352. c.appendChild(a.domElement);
  10353. var u = m(e, c, o.before);
  10354. return p.addClass(u, V.CLASS_CONTROLLER_ROW),
  10355. p.addClass(u, typeof a.getValue()),
  10356. v(e, u, a),
  10357. e.__controllers.push(a),
  10358. a
  10359. }
  10360. function m(e, t, i) {
  10361. var n = document.createElement("li");
  10362. return t && n.appendChild(t),
  10363. i ? e.__ul.insertBefore(n, params.before) : e.__ul.appendChild(n),
  10364. e.onResize(),
  10365. n
  10366. }
  10367. function v(e, t, i) {
  10368. if (i.__li = t,
  10369. i.__gui = e,
  10370. f.extend(i, {
  10371. options: function(t) {
  10372. return arguments.length > 1 ? (i.remove(),
  10373. g(e, i.object, i.property, {
  10374. before: i.__li.nextElementSibling,
  10375. factoryArgs: [f.toArray(arguments)]
  10376. })) : f.isArray(t) || f.isObject(t) ? (i.remove(),
  10377. g(e, i.object, i.property, {
  10378. before: i.__li.nextElementSibling,
  10379. factoryArgs: [t]
  10380. })) : void 0
  10381. },
  10382. name: function(e) {
  10383. return i.__li.firstElementChild.firstElementChild.innerHTML = e,
  10384. i
  10385. },
  10386. listen: function() {
  10387. return i.__gui.listen(i),
  10388. i
  10389. },
  10390. remove: function() {
  10391. return i.__gui.remove(i),
  10392. i
  10393. }
  10394. }),
  10395. i instanceof l) {
  10396. var n = new s(i.object,i.property,{
  10397. min: i.__min,
  10398. max: i.__max,
  10399. step: i.__step
  10400. });
  10401. f.each(["updateDisplay", "onChange", "onFinishChange"], function(e) {
  10402. var t = i[e]
  10403. , r = n[e];
  10404. i[e] = n[e] = function() {
  10405. var e = Array.prototype.slice.call(arguments);
  10406. return t.apply(i, e),
  10407. r.apply(n, e)
  10408. }
  10409. }),
  10410. p.addClass(t, "has-slider"),
  10411. i.domElement.insertBefore(n.domElement, i.domElement.firstElementChild)
  10412. } else if (i instanceof s) {
  10413. var r = function(t) {
  10414. return f.isNumber(i.__min) && f.isNumber(i.__max) ? (i.remove(),
  10415. g(e, i.object, i.property, {
  10416. before: i.__li.nextElementSibling,
  10417. factoryArgs: [i.__min, i.__max, i.__step]
  10418. })) : t
  10419. };
  10420. i.min = f.compose(r, i.min),
  10421. i.max = f.compose(r, i.max)
  10422. } else
  10423. i instanceof o ? (p.bind(t, "click", function() {
  10424. p.fakeEvent(i.__checkbox, "click")
  10425. }),
  10426. p.bind(i.__checkbox, "click", function(e) {
  10427. e.stopPropagation()
  10428. })) : i instanceof a ? (p.bind(t, "click", function() {
  10429. p.fakeEvent(i.__button, "click")
  10430. }),
  10431. p.bind(t, "mouseover", function() {
  10432. p.addClass(i.__button, "hover")
  10433. }),
  10434. p.bind(t, "mouseout", function() {
  10435. p.removeClass(i.__button, "hover")
  10436. })) : i instanceof h && (p.addClass(t, "color"),
  10437. i.updateDisplay = f.compose(function(e) {
  10438. return t.style.borderLeftColor = i.__color.toString(),
  10439. e
  10440. }, i.updateDisplay),
  10441. i.updateDisplay());
  10442. i.setValue = f.compose(function(t) {
  10443. return e.getRoot().__preset_select && i.isModified() && T(e.getRoot(), !0),
  10444. t
  10445. }, i.setValue)
  10446. }
  10447. function A(e, t) {
  10448. var i = e.getRoot()
  10449. , n = i.__rememberedObjects.indexOf(t.object);
  10450. if (n != -1) {
  10451. var r = i.__rememberedObjectIndecesToControllers[n];
  10452. if (void 0 === r && (r = {},
  10453. i.__rememberedObjectIndecesToControllers[n] = r),
  10454. r[t.property] = t,
  10455. i.load && i.load.remembered) {
  10456. var o, a = i.load.remembered;
  10457. if (a[e.preset])
  10458. o = a[e.preset];
  10459. else {
  10460. if (!a[L])
  10461. return;
  10462. o = a[L]
  10463. }
  10464. if (o[n] && void 0 !== o[n][t.property]) {
  10465. var s = o[n][t.property];
  10466. t.initialValue = s,
  10467. t.setValue(s)
  10468. }
  10469. }
  10470. }
  10471. }
  10472. function y(e, t) {
  10473. return document.location.href + "." + t
  10474. }
  10475. function C(e) {
  10476. var t = e.__save_row = document.createElement("li");
  10477. p.addClass(e.domElement, "has-save"),
  10478. e.__ul.insertBefore(t, e.__ul.firstChild),
  10479. p.addClass(t, "save-row");
  10480. var i = document.createElement("span");
  10481. i.innerHTML = "&nbsp;",
  10482. p.addClass(i, "button gears");
  10483. var n = document.createElement("span");
  10484. n.innerHTML = "Save",
  10485. p.addClass(n, "button"),
  10486. p.addClass(n, "save");
  10487. var r = document.createElement("span");
  10488. r.innerHTML = "New",
  10489. p.addClass(r, "button"),
  10490. p.addClass(r, "save-as");
  10491. var o = document.createElement("span");
  10492. o.innerHTML = "Revert",
  10493. p.addClass(o, "button"),
  10494. p.addClass(o, "revert");
  10495. var a = e.__preset_select = document.createElement("select");
  10496. if (e.load && e.load.remembered ? f.each(e.load.remembered, function(t, i) {
  10497. w(e, i, i == e.preset)
  10498. }) : w(e, L, !1),
  10499. p.bind(a, "change", function() {
  10500. for (var t = 0; t < e.__preset_select.length; t++)
  10501. e.__preset_select[t].innerHTML = e.__preset_select[t].value;
  10502. e.preset = this.value
  10503. }),
  10504. t.appendChild(a),
  10505. t.appendChild(i),
  10506. t.appendChild(n),
  10507. t.appendChild(r),
  10508. t.appendChild(o),
  10509. D) {
  10510. var s = document.getElementById("dg-save-locally")
  10511. , l = document.getElementById("dg-local-explain");
  10512. s.style.display = "block";
  10513. var c = document.getElementById("dg-local-storage");
  10514. "true" === localStorage.getItem(y(e, "isLocal")) && c.setAttribute("checked", "checked");
  10515. var h = function() {
  10516. l.style.display = e.useLocalStorage ? "block" : "none"
  10517. };
  10518. h(),
  10519. p.bind(c, "change", function() {
  10520. e.useLocalStorage = !e.useLocalStorage,
  10521. h()
  10522. })
  10523. }
  10524. var u = document.getElementById("dg-new-constructor");
  10525. p.bind(u, "keydown", function(e) {
  10526. !e.metaKey || 67 !== e.which && 67 != e.keyCode || S.hide()
  10527. }),
  10528. p.bind(i, "click", function() {
  10529. u.innerHTML = JSON.stringify(e.getSaveObject(), void 0, 2),
  10530. S.show(),
  10531. u.focus(),
  10532. u.select()
  10533. }),
  10534. p.bind(n, "click", function() {
  10535. e.save()
  10536. }),
  10537. p.bind(r, "click", function() {
  10538. var t = prompt("Enter a new preset name.");
  10539. t && e.saveAs(t)
  10540. }),
  10541. p.bind(o, "click", function() {
  10542. e.revert()
  10543. })
  10544. }
  10545. function I(e) {
  10546. function t(t) {
  10547. return t.preventDefault(),
  10548. r = t.clientX,
  10549. p.addClass(e.__closeButton, V.CLASS_DRAG),
  10550. p.bind(window, "mousemove", i),
  10551. p.bind(window, "mouseup", n),
  10552. !1
  10553. }
  10554. function i(t) {
  10555. return t.preventDefault(),
  10556. e.width += r - t.clientX,
  10557. e.onResize(),
  10558. r = t.clientX,
  10559. !1
  10560. }
  10561. function n() {
  10562. p.removeClass(e.__closeButton, V.CLASS_DRAG),
  10563. p.unbind(window, "mousemove", i),
  10564. p.unbind(window, "mouseup", n)
  10565. }
  10566. e.__resize_handle = document.createElement("div"),
  10567. f.extend(e.__resize_handle.style, {
  10568. width: "6px",
  10569. marginLeft: "-3px",
  10570. height: "200px",
  10571. cursor: "ew-resize",
  10572. position: "absolute"
  10573. });
  10574. var r;
  10575. p.bind(e.__resize_handle, "mousedown", t),
  10576. p.bind(e.__closeButton, "mousedown", t),
  10577. e.domElement.insertBefore(e.__resize_handle, e.domElement.firstElementChild)
  10578. }
  10579. function E(e, t) {
  10580. e.domElement.style.width = t + "px",
  10581. e.__save_row && e.autoPlace && (e.__save_row.style.width = t + "px"),
  10582. e.__closeButton && (e.__closeButton.style.width = t + "px")
  10583. }
  10584. function b(e, t) {
  10585. var i = {};
  10586. return f.each(e.__rememberedObjects, function(n, r) {
  10587. var o = {}
  10588. , a = e.__rememberedObjectIndecesToControllers[r];
  10589. f.each(a, function(e, i) {
  10590. o[i] = t ? e.initialValue : e.getValue()
  10591. }),
  10592. i[r] = o
  10593. }),
  10594. i
  10595. }
  10596. function w(e, t, i) {
  10597. var n = document.createElement("option");
  10598. n.innerHTML = t,
  10599. n.value = t,
  10600. e.__preset_select.appendChild(n),
  10601. i && (e.__preset_select.selectedIndex = e.__preset_select.length - 1)
  10602. }
  10603. function _(e) {
  10604. for (var t = 0; t < e.__preset_select.length; t++)
  10605. e.__preset_select[t].value == e.preset && (e.__preset_select.selectedIndex = t)
  10606. }
  10607. function T(e, t) {
  10608. var i = e.__preset_select[e.__preset_select.selectedIndex];
  10609. t ? i.innerHTML = i.value + "*" : i.innerHTML = i.value
  10610. }
  10611. function x(e) {
  10612. 0 != e.length && u(function() {
  10613. x(e)
  10614. }),
  10615. f.each(e, function(e) {
  10616. e.updateDisplay()
  10617. })
  10618. }
  10619. e.inject(i);
  10620. var S, M, R = "dg", P = 72, O = 20, L = "Default", D = function() {
  10621. try {
  10622. return "localStorage"in window && null !== window.localStorage
  10623. } catch (e) {
  10624. return !1
  10625. }
  10626. }(), N = !0, B = !1, F = [], V = function(e) {
  10627. function t() {
  10628. var e = i.getRoot();
  10629. e.width += 1,
  10630. f.defer(function() {
  10631. e.width -= 1
  10632. })
  10633. }
  10634. var i = this;
  10635. this.domElement = document.createElement("div"),
  10636. this.__ul = document.createElement("ul"),
  10637. this.domElement.appendChild(this.__ul),
  10638. p.addClass(this.domElement, R),
  10639. this.__folders = {},
  10640. this.__controllers = [],
  10641. this.__rememberedObjects = [],
  10642. this.__rememberedObjectIndecesToControllers = [],
  10643. this.__listening = [],
  10644. e = e || {},
  10645. e = f.defaults(e, {
  10646. autoPlace: !0,
  10647. width: V.DEFAULT_WIDTH
  10648. }),
  10649. e = f.defaults(e, {
  10650. resizable: e.autoPlace,
  10651. hideable: e.autoPlace
  10652. }),
  10653. f.isUndefined(e.load) ? e.load = {
  10654. preset: L
  10655. } : e.preset && (e.load.preset = e.preset),
  10656. f.isUndefined(e.parent) && e.hideable && F.push(this),
  10657. e.resizable = f.isUndefined(e.parent) && e.resizable,
  10658. e.autoPlace && f.isUndefined(e.scrollable) && (e.scrollable = !0);
  10659. var n, r = D && "true" === localStorage.getItem(y(this, "isLocal"));
  10660. if (Object.defineProperties(this, {
  10661. parent: {
  10662. get: function() {
  10663. return e.parent
  10664. }
  10665. },
  10666. scrollable: {
  10667. get: function() {
  10668. return e.scrollable
  10669. }
  10670. },
  10671. autoPlace: {
  10672. get: function() {
  10673. return e.autoPlace
  10674. }
  10675. },
  10676. preset: {
  10677. get: function() {
  10678. return i.parent ? i.getRoot().preset : e.load.preset
  10679. },
  10680. set: function(t) {
  10681. i.parent ? i.getRoot().preset = t : e.load.preset = t,
  10682. _(this),
  10683. i.revert()
  10684. }
  10685. },
  10686. width: {
  10687. get: function() {
  10688. return e.width
  10689. },
  10690. set: function(t) {
  10691. e.width = t,
  10692. E(i, t)
  10693. }
  10694. },
  10695. name: {
  10696. get: function() {
  10697. return e.name
  10698. },
  10699. set: function(t) {
  10700. e.name = t,
  10701. a && (a.innerHTML = e.name)
  10702. }
  10703. },
  10704. closed: {
  10705. get: function() {
  10706. return e.closed
  10707. },
  10708. set: function(t) {
  10709. e.closed = t,
  10710. e.closed ? p.addClass(i.__ul, V.CLASS_CLOSED) : p.removeClass(i.__ul, V.CLASS_CLOSED),
  10711. this.onResize(),
  10712. i.__closeButton && (i.__closeButton.innerHTML = t ? V.TEXT_OPEN : V.TEXT_CLOSED)
  10713. }
  10714. },
  10715. load: {
  10716. get: function() {
  10717. return e.load
  10718. }
  10719. },
  10720. useLocalStorage: {
  10721. get: function() {
  10722. return r
  10723. },
  10724. set: function(e) {
  10725. D && (r = e,
  10726. e ? p.bind(window, "unload", n) : p.unbind(window, "unload", n),
  10727. localStorage.setItem(y(i, "isLocal"), e))
  10728. }
  10729. }
  10730. }),
  10731. f.isUndefined(e.parent)) {
  10732. if (e.closed = !1,
  10733. p.addClass(this.domElement, V.CLASS_MAIN),
  10734. p.makeSelectable(this.domElement, !1),
  10735. D && r) {
  10736. i.useLocalStorage = !0;
  10737. var o = localStorage.getItem(y(this, "gui"));
  10738. o && (e.load = JSON.parse(o))
  10739. }
  10740. this.__closeButton = document.createElement("div"),
  10741. this.__closeButton.innerHTML = V.TEXT_CLOSED,
  10742. p.addClass(this.__closeButton, V.CLASS_CLOSE_BUTTON),
  10743. this.domElement.appendChild(this.__closeButton),
  10744. p.bind(this.__closeButton, "click", function() {
  10745. i.closed = !i.closed
  10746. })
  10747. } else {
  10748. void 0 === e.closed && (e.closed = !0);
  10749. var a = document.createTextNode(e.name);
  10750. p.addClass(a, "controller-name");
  10751. var s = m(i, a)
  10752. , l = function(e) {
  10753. return e.preventDefault(),
  10754. i.closed = !i.closed,
  10755. !1
  10756. };
  10757. p.addClass(this.__ul, V.CLASS_CLOSED),
  10758. p.addClass(s, "title"),
  10759. p.bind(s, "click", l),
  10760. e.closed || (this.closed = !1)
  10761. }
  10762. e.autoPlace && (f.isUndefined(e.parent) && (N && (M = document.createElement("div"),
  10763. p.addClass(M, R),
  10764. p.addClass(M, V.CLASS_AUTO_PLACE_CONTAINER),
  10765. document.body.appendChild(M),
  10766. N = !1),
  10767. M.appendChild(this.domElement),
  10768. p.addClass(this.domElement, V.CLASS_AUTO_PLACE)),
  10769. this.parent || E(i, e.width)),
  10770. p.bind(window, "resize", function() {
  10771. i.onResize()
  10772. }),
  10773. p.bind(this.__ul, "webkitTransitionEnd", function() {
  10774. i.onResize()
  10775. }),
  10776. p.bind(this.__ul, "transitionend", function() {
  10777. i.onResize()
  10778. }),
  10779. p.bind(this.__ul, "oTransitionEnd", function() {
  10780. i.onResize()
  10781. }),
  10782. this.onResize(),
  10783. e.resizable && I(this),
  10784. n = function() {
  10785. D && "true" === localStorage.getItem(y(i, "isLocal")) && localStorage.setItem(y(i, "gui"), JSON.stringify(i.getSaveObject()))
  10786. }
  10787. ,
  10788. this.saveToLocalStorageIfPossible = n;
  10789. i.getRoot();
  10790. e.parent || t()
  10791. };
  10792. return V.toggleHide = function() {
  10793. B = !B,
  10794. f.each(F, function(e) {
  10795. e.domElement.style.zIndex = B ? -999 : 999,
  10796. e.domElement.style.opacity = B ? 0 : 1
  10797. })
  10798. }
  10799. ,
  10800. V.CLASS_AUTO_PLACE = "a",
  10801. V.CLASS_AUTO_PLACE_CONTAINER = "ac",
  10802. V.CLASS_MAIN = "main",
  10803. V.CLASS_CONTROLLER_ROW = "cr",
  10804. V.CLASS_TOO_TALL = "taller-than-window",
  10805. V.CLASS_CLOSED = "closed",
  10806. V.CLASS_CLOSE_BUTTON = "close-button",
  10807. V.CLASS_DRAG = "drag",
  10808. V.DEFAULT_WIDTH = 245,
  10809. V.TEXT_CLOSED = "Close Controls",
  10810. V.TEXT_OPEN = "Open Controls",
  10811. p.bind(window, "keydown", function(e) {
  10812. "text" === document.activeElement.type || e.which !== P && e.keyCode != P || V.toggleHide()
  10813. }, !1),
  10814. f.extend(V.prototype, {
  10815. add: function(e, t) {
  10816. return g(this, e, t, {
  10817. factoryArgs: Array.prototype.slice.call(arguments, 2)
  10818. })
  10819. },
  10820. addColor: function(e, t) {
  10821. return g(this, e, t, {
  10822. color: !0
  10823. })
  10824. },
  10825. remove: function(e) {
  10826. this.__ul.removeChild(e.__li),
  10827. this.__controllers.slice(this.__controllers.indexOf(e), 1);
  10828. var t = this;
  10829. f.defer(function() {
  10830. t.onResize()
  10831. })
  10832. },
  10833. destroy: function() {
  10834. this.autoPlace && M.removeChild(this.domElement)
  10835. },
  10836. addFolder: function(e) {
  10837. if (void 0 !== this.__folders[e])
  10838. throw new Error('You already have a folder in this GUI by the name "' + e + '"');
  10839. var t = {
  10840. name: e,
  10841. parent: this
  10842. };
  10843. t.autoPlace = this.autoPlace,
  10844. this.load && this.load.folders && this.load.folders[e] && (t.closed = this.load.folders[e].closed,
  10845. t.load = this.load.folders[e]);
  10846. var i = new V(t);
  10847. this.__folders[e] = i;
  10848. var n = m(this, i.domElement);
  10849. return p.addClass(n, "folder"),
  10850. i
  10851. },
  10852. open: function() {
  10853. this.closed = !1
  10854. },
  10855. close: function() {
  10856. this.closed = !0
  10857. },
  10858. onResize: function() {
  10859. var e = this.getRoot();
  10860. if (e.scrollable) {
  10861. var t = p.getOffset(e.__ul).top
  10862. , i = 0;
  10863. f.each(e.__ul.childNodes, function(t) {
  10864. e.autoPlace && t === e.__save_row || (i += p.getHeight(t))
  10865. }),
  10866. $("#player").height() - t - O < i ? (p.addClass(e.domElement, V.CLASS_TOO_TALL),
  10867. e.__ul.style.height = $("#player").height() - t - O + "px") : (p.removeClass(e.domElement, V.CLASS_TOO_TALL),
  10868. e.__ul.style.height = "auto")
  10869. }
  10870. e.__resize_handle && f.defer(function() {
  10871. e.__resize_handle.style.height = e.__ul.offsetHeight + "px"
  10872. }),
  10873. e.__closeButton && (e.__closeButton.style.width = e.width + "px")
  10874. },
  10875. remember: function() {
  10876. if (f.isUndefined(S) && (S = new d,
  10877. S.domElement.innerHTML = t),
  10878. this.parent)
  10879. throw new Error("You can only call remember on a top level GUI.");
  10880. var e = this;
  10881. f.each(Array.prototype.slice.call(arguments), function(t) {
  10882. 0 == e.__rememberedObjects.length && C(e),
  10883. e.__rememberedObjects.indexOf(t) == -1 && e.__rememberedObjects.push(t)
  10884. }),
  10885. this.autoPlace && E(this, this.width)
  10886. },
  10887. getRoot: function() {
  10888. for (var e = this; e.parent; )
  10889. e = e.parent;
  10890. return e
  10891. },
  10892. getSaveObject: function() {
  10893. var e = this.load;
  10894. return e.closed = this.closed,
  10895. this.__rememberedObjects.length > 0 && (e.preset = this.preset,
  10896. e.remembered || (e.remembered = {}),
  10897. e.remembered[this.preset] = b(this)),
  10898. e.folders = {},
  10899. f.each(this.__folders, function(t, i) {
  10900. e.folders[i] = t.getSaveObject()
  10901. }),
  10902. e
  10903. },
  10904. save: function() {
  10905. this.load.remembered || (this.load.remembered = {}),
  10906. this.load.remembered[this.preset] = b(this),
  10907. T(this, !1),
  10908. this.saveToLocalStorageIfPossible()
  10909. },
  10910. saveAs: function(e) {
  10911. this.load.remembered || (this.load.remembered = {},
  10912. this.load.remembered[L] = b(this, !0)),
  10913. this.load.remembered[e] = b(this),
  10914. this.preset = e,
  10915. w(this, e, !0),
  10916. this.saveToLocalStorageIfPossible()
  10917. },
  10918. revert: function(e) {
  10919. f.each(this.__controllers, function(t) {
  10920. this.getRoot().load.remembered ? A(e || this.getRoot(), t) : t.setValue(t.initialValue)
  10921. }, this),
  10922. f.each(this.__folders, function(e) {
  10923. e.revert(e)
  10924. }),
  10925. e || T(this.getRoot(), !1)
  10926. },
  10927. listen: function(e) {
  10928. var t = 0 == this.__listening.length;
  10929. this.__listening.push(e),
  10930. t && x(this.__listening)
  10931. }
  10932. }),
  10933. V
  10934. }(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) {
  10935. return function(s, l) {
  10936. var c = s[l];
  10937. 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,{
  10938. min: arguments[2],
  10939. max: arguments[3]
  10940. }) : a.isString(c) ? new n(s,l) : a.isFunction(c) ? new r(s,l,"") : a.isBoolean(c) ? new o(s,l) : void 0
  10941. }
  10942. }(n.controllers.OptionController, n.controllers.NumberControllerBox, n.controllers.NumberControllerSlider, n.controllers.StringController = function(e, t, i) {
  10943. var n = function(e, i) {
  10944. function r() {
  10945. a.setValue(a.__input.value)
  10946. }
  10947. function o() {
  10948. a.__onFinishChange && a.__onFinishChange.call(a, a.getValue())
  10949. }
  10950. n.superclass.call(this, e, i);
  10951. var a = this;
  10952. this.__input = document.createElement("input"),
  10953. this.__input.setAttribute("type", "text"),
  10954. t.bind(this.__input, "keyup", r),
  10955. t.bind(this.__input, "change", r),
  10956. t.bind(this.__input, "blur", o),
  10957. t.bind(this.__input, "keydown", function(e) {
  10958. 13 === e.keyCode && this.blur()
  10959. }),
  10960. this.updateDisplay(),
  10961. this.domElement.appendChild(this.__input)
  10962. };
  10963. return n.superclass = e,
  10964. i.extend(n.prototype, e.prototype, {
  10965. updateDisplay: function() {
  10966. return t.isActive(this.__input) || (this.__input.value = this.getValue()),
  10967. n.superclass.prototype.updateDisplay.call(this)
  10968. }
  10969. }),
  10970. n
  10971. }(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) {
  10972. function o(e, t, i, n) {
  10973. e.style.background = "",
  10974. r.each(l, function(r) {
  10975. e.style.cssText += "background: " + r + "linear-gradient(" + t + ", " + i + " 0%, " + n + " 100%); "
  10976. })
  10977. }
  10978. function a(e) {
  10979. e.style.background = "",
  10980. e.style.cssText += "background: -moz-linear-gradient(top, #ff0000 0%, #ff00ff 17%, #0000ff 34%, #00ffff 50%, #00ff00 67%, #ffff00 84%, #ff0000 100%);",
  10981. e.style.cssText += "background: -webkit-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",
  10982. e.style.cssText += "background: -o-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",
  10983. e.style.cssText += "background: -ms-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",
  10984. e.style.cssText += "background: linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);"
  10985. }
  10986. var s = function(e, l) {
  10987. function c(e) {
  10988. p(e),
  10989. t.bind(window, "mousemove", p),
  10990. t.bind(window, "mouseup", h)
  10991. }
  10992. function h() {
  10993. t.unbind(window, "mousemove", p),
  10994. t.unbind(window, "mouseup", h)
  10995. }
  10996. function u() {
  10997. var e = n(this.value);
  10998. e !== !1 ? (g.__color.__state = e,
  10999. g.setValue(g.__color.toOriginal())) : this.value = g.__color.toString()
  11000. }
  11001. function d() {
  11002. t.unbind(window, "mousemove", f),
  11003. t.unbind(window, "mouseup", d)
  11004. }
  11005. function p(e) {
  11006. e.preventDefault();
  11007. var i = t.getWidth(g.__saturation_field)
  11008. , n = t.getOffset(g.__saturation_field)
  11009. , r = (e.clientX - n.left + document.body.scrollLeft) / i
  11010. , o = 1 - (e.clientY - n.top + document.body.scrollTop) / i;
  11011. return o > 1 ? o = 1 : o < 0 && (o = 0),
  11012. r > 1 ? r = 1 : r < 0 && (r = 0),
  11013. g.__color.v = o,
  11014. g.__color.s = r,
  11015. g.setValue(g.__color.toOriginal()),
  11016. !1
  11017. }
  11018. function f(e) {
  11019. e.preventDefault();
  11020. var i = t.getHeight(g.__hue_field)
  11021. , n = t.getOffset(g.__hue_field)
  11022. , r = 1 - (e.clientY - n.top + document.body.scrollTop) / i;
  11023. return r > 1 ? r = 1 : r < 0 && (r = 0),
  11024. g.__color.h = 360 * r,
  11025. g.setValue(g.__color.toOriginal()),
  11026. !1
  11027. }
  11028. s.superclass.call(this, e, l),
  11029. this.__color = new i(this.getValue()),
  11030. this.__temp = new i(0);
  11031. var g = this;
  11032. this.domElement = document.createElement("div"),
  11033. t.makeSelectable(this.domElement, !1),
  11034. this.__selector = document.createElement("div"),
  11035. this.__selector.className = "selector",
  11036. this.__saturation_field = document.createElement("div"),
  11037. this.__saturation_field.className = "saturation-field",
  11038. this.__field_knob = document.createElement("div"),
  11039. this.__field_knob.className = "field-knob",
  11040. this.__field_knob_border = "2px solid ",
  11041. this.__hue_knob = document.createElement("div"),
  11042. this.__hue_knob.className = "hue-knob",
  11043. this.__hue_field = document.createElement("div"),
  11044. this.__hue_field.className = "hue-field",
  11045. this.__input = document.createElement("input"),
  11046. this.__input.type = "text",
  11047. this.__input_textShadow = "0 1px 1px ",
  11048. t.bind(this.__input, "keydown", function(e) {
  11049. 13 === e.keyCode && u.call(this)
  11050. }),
  11051. t.bind(this.__input, "blur", u),
  11052. t.bind(this.__selector, "mousedown", function(e) {
  11053. t.addClass(this, "drag").bind(window, "mouseup", function(e) {
  11054. t.removeClass(g.__selector, "drag")
  11055. })
  11056. });
  11057. var m = document.createElement("div");
  11058. r.extend(this.__selector.style, {
  11059. width: "122px",
  11060. height: "102px",
  11061. padding: "3px",
  11062. backgroundColor: "#222",
  11063. boxShadow: "0px 1px 3px rgba(0,0,0,0.3)"
  11064. }),
  11065. r.extend(this.__field_knob.style, {
  11066. position: "absolute",
  11067. width: "12px",
  11068. height: "12px",
  11069. border: this.__field_knob_border + (this.__color.v < .5 ? "#fff" : "#000"),
  11070. boxShadow: "0px 1px 3px rgba(0,0,0,0.5)",
  11071. borderRadius: "12px",
  11072. zIndex: 1
  11073. }),
  11074. r.extend(this.__hue_knob.style, {
  11075. position: "absolute",
  11076. width: "15px",
  11077. height: "2px",
  11078. borderRight: "4px solid #fff",
  11079. zIndex: 1
  11080. }),
  11081. r.extend(this.__saturation_field.style, {
  11082. width: "100px",
  11083. height: "100px",
  11084. border: "1px solid #555",
  11085. marginRight: "3px",
  11086. display: "inline-block",
  11087. cursor: "pointer"
  11088. }),
  11089. r.extend(m.style, {
  11090. width: "100%",
  11091. height: "100%",
  11092. background: "none"
  11093. }),
  11094. o(m, "top", "rgba(0,0,0,0)", "#000"),
  11095. r.extend(this.__hue_field.style, {
  11096. width: "15px",
  11097. height: "100px",
  11098. display: "inline-block",
  11099. border: "1px solid #555",
  11100. cursor: "ns-resize"
  11101. }),
  11102. a(this.__hue_field),
  11103. r.extend(this.__input.style, {
  11104. outline: "none",
  11105. textAlign: "center",
  11106. color: "#fff",
  11107. border: 0,
  11108. fontWeight: "bold",
  11109. textShadow: this.__input_textShadow + "rgba(0,0,0,0.7)"
  11110. }),
  11111. t.bind(this.__saturation_field, "mousedown", c),
  11112. t.bind(this.__field_knob, "mousedown", c),
  11113. t.bind(this.__hue_field, "mousedown", function(e) {
  11114. f(e),
  11115. t.bind(window, "mousemove", f),
  11116. t.bind(window, "mouseup", d)
  11117. }),
  11118. this.__saturation_field.appendChild(m),
  11119. this.__selector.appendChild(this.__field_knob),
  11120. this.__selector.appendChild(this.__saturation_field),
  11121. this.__selector.appendChild(this.__hue_field),
  11122. this.__hue_field.appendChild(this.__hue_knob),
  11123. this.domElement.appendChild(this.__input),
  11124. this.domElement.appendChild(this.__selector),
  11125. this.updateDisplay()
  11126. };
  11127. s.superclass = e,
  11128. r.extend(s.prototype, e.prototype, {
  11129. updateDisplay: function() {
  11130. var e = n(this.getValue());
  11131. if (e !== !1) {
  11132. var t = !1;
  11133. r.each(i.COMPONENTS, function(i) {
  11134. if (!r.isUndefined(e[i]) && !r.isUndefined(this.__color.__state[i]) && e[i] !== this.__color.__state[i])
  11135. return t = !0,
  11136. {}
  11137. }, this),
  11138. t && r.extend(this.__color.__state, e)
  11139. }
  11140. r.extend(this.__temp.__state, this.__color.__state),
  11141. this.__temp.a = 1;
  11142. var a = this.__color.v < .5 || this.__color.s > .5 ? 255 : 0
  11143. , s = 255 - a;
  11144. r.extend(this.__field_knob.style, {
  11145. marginLeft: 100 * this.__color.s - 7 + "px",
  11146. marginTop: 100 * (1 - this.__color.v) - 7 + "px",
  11147. backgroundColor: this.__temp.toString(),
  11148. border: this.__field_knob_border + "rgb(" + a + "," + a + "," + a + ")"
  11149. }),
  11150. this.__hue_knob.style.marginTop = 100 * (1 - this.__color.h / 360) + "px",
  11151. this.__temp.s = 1,
  11152. this.__temp.v = 1,
  11153. o(this.__saturation_field, "left", "#fff", this.__temp.toString()),
  11154. r.extend(this.__input.style, {
  11155. backgroundColor: this.__input.value = this.__color.toString(),
  11156. color: "rgb(" + a + "," + a + "," + a + ")",
  11157. textShadow: this.__input_textShadow + "rgba(" + s + "," + s + "," + s + ",.7)"
  11158. })
  11159. }
  11160. });
  11161. var l = ["-moz-", "-o-", "-webkit-", "-ms-", ""];
  11162. return s
  11163. }(n.controllers.Controller, n.dom.dom, n.color.Color = function(e, t, i, n) {
  11164. function r(e, t, i) {
  11165. Object.defineProperty(e, t, {
  11166. get: function() {
  11167. return "RGB" === this.__state.space ? this.__state[t] : (a(this, t, i),
  11168. this.__state[t])
  11169. },
  11170. set: function(e) {
  11171. "RGB" !== this.__state.space && (a(this, t, i),
  11172. this.__state.space = "RGB"),
  11173. this.__state[t] = e
  11174. }
  11175. })
  11176. }
  11177. function o(e, t) {
  11178. Object.defineProperty(e, t, {
  11179. get: function() {
  11180. return "HSV" === this.__state.space ? this.__state[t] : (s(this),
  11181. this.__state[t])
  11182. },
  11183. set: function(e) {
  11184. "HSV" !== this.__state.space && (s(this),
  11185. this.__state.space = "HSV"),
  11186. this.__state[t] = e
  11187. }
  11188. })
  11189. }
  11190. function a(e, i, r) {
  11191. if ("HEX" === e.__state.space)
  11192. e.__state[i] = t.component_from_hex(e.__state.hex, r);
  11193. else {
  11194. if ("HSV" !== e.__state.space)
  11195. throw "Corrupted color state";
  11196. n.extend(e.__state, t.hsv_to_rgb(e.__state.h, e.__state.s, e.__state.v))
  11197. }
  11198. }
  11199. function s(e) {
  11200. var i = t.rgb_to_hsv(e.r, e.g, e.b);
  11201. n.extend(e.__state, {
  11202. s: i.s,
  11203. v: i.v
  11204. }),
  11205. n.isNaN(i.h) ? n.isUndefined(e.__state.h) && (e.__state.h = 0) : e.__state.h = i.h
  11206. }
  11207. var l = function() {
  11208. if (this.__state = e.apply(this, arguments),
  11209. this.__state === !1)
  11210. throw "Failed to interpret color arguments";
  11211. this.__state.a = this.__state.a || 1
  11212. };
  11213. return l.COMPONENTS = ["r", "g", "b", "h", "s", "v", "hex", "a"],
  11214. n.extend(l.prototype, {
  11215. toString: function() {
  11216. return i(this)
  11217. },
  11218. toOriginal: function() {
  11219. return this.__state.conversion.write(this)
  11220. }
  11221. }),
  11222. r(l.prototype, "r", 2),
  11223. r(l.prototype, "g", 1),
  11224. r(l.prototype, "b", 0),
  11225. o(l.prototype, "h"),
  11226. o(l.prototype, "s"),
  11227. o(l.prototype, "v"),
  11228. Object.defineProperty(l.prototype, "a", {
  11229. get: function() {
  11230. return this.__state.a
  11231. },
  11232. set: function(e) {
  11233. this.__state.a = e
  11234. }
  11235. }),
  11236. Object.defineProperty(l.prototype, "hex", {
  11237. get: function() {
  11238. return "HEX" !== !this.__state.space && (this.__state.hex = t.rgb_to_hex(this.r, this.g, this.b)),
  11239. this.__state.hex
  11240. },
  11241. set: function(e) {
  11242. this.__state.space = "HEX",
  11243. this.__state.hex = e
  11244. }
  11245. }),
  11246. l
  11247. }(n.color.interpret, n.color.math = function() {
  11248. var e;
  11249. return {
  11250. hsv_to_rgb: function(e, t, i) {
  11251. var n = Math.floor(e / 60) % 6
  11252. , r = e / 60 - Math.floor(e / 60)
  11253. , o = i * (1 - t)
  11254. , a = i * (1 - r * t)
  11255. , s = i * (1 - (1 - r) * t)
  11256. , l = [[i, s, o], [a, i, o], [o, i, s], [o, a, i], [s, o, i], [i, o, a]][n];
  11257. return {
  11258. r: 255 * l[0],
  11259. g: 255 * l[1],
  11260. b: 255 * l[2]
  11261. }
  11262. },
  11263. rgb_to_hsv: function(e, t, i) {
  11264. var n, r, o = Math.min(e, t, i), a = Math.max(e, t, i), s = a - o;
  11265. return 0 == a ? {
  11266. h: NaN,
  11267. s: 0,
  11268. v: 0
  11269. } : (r = s / a,
  11270. n = e == a ? (t - i) / s : t == a ? 2 + (i - e) / s : 4 + (e - t) / s,
  11271. n /= 6,
  11272. n < 0 && (n += 1),
  11273. {
  11274. h: 360 * n,
  11275. s: r,
  11276. v: a / 255
  11277. })
  11278. },
  11279. rgb_to_hex: function(e, t, i) {
  11280. var n = this.hex_with_component(0, 2, e);
  11281. return n = this.hex_with_component(n, 1, t),
  11282. n = this.hex_with_component(n, 0, i)
  11283. },
  11284. component_from_hex: function(e, t) {
  11285. return e >> 8 * t & 255
  11286. },
  11287. hex_with_component: function(t, i, n) {
  11288. return n << (e = 8 * i) | t & ~(255 << e)
  11289. }
  11290. }
  11291. }(), n.color.toString, n.utils.common), n.color.interpret, n.utils.common), n.utils.requestAnimationFrame = function() {
  11292. return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function(e, t) {
  11293. window.setTimeout(e, 1e3 / 60)
  11294. }
  11295. }(), n.dom.CenteredDiv = function(e, t) {
  11296. var i = function() {
  11297. this.backgroundElement = document.createElement("div"),
  11298. t.extend(this.backgroundElement.style, {
  11299. backgroundColor: "rgba(0,0,0,0.8)",
  11300. top: 0,
  11301. left: 0,
  11302. display: "none",
  11303. zIndex: "1000",
  11304. opacity: 0,
  11305. WebkitTransition: "opacity 0.2s linear"
  11306. }),
  11307. e.makeFullscreen(this.backgroundElement),
  11308. this.backgroundElement.style.position = "fixed",
  11309. this.domElement = document.createElement("div"),
  11310. t.extend(this.domElement.style, {
  11311. position: "fixed",
  11312. display: "none",
  11313. zIndex: "1001",
  11314. opacity: 0,
  11315. WebkitTransition: "-webkit-transform 0.2s ease-out, opacity 0.2s linear"
  11316. }),
  11317. document.body.appendChild(this.backgroundElement),
  11318. document.body.appendChild(this.domElement);
  11319. var i = this;
  11320. e.bind(this.backgroundElement, "click", function() {
  11321. i.hide()
  11322. })
  11323. };
  11324. return i.prototype.show = function() {
  11325. var e = this;
  11326. this.backgroundElement.style.display = "block",
  11327. this.domElement.style.display = "block",
  11328. this.domElement.style.opacity = 0,
  11329. this.domElement.style.webkitTransform = "scale(1.1)",
  11330. this.layout(),
  11331. t.defer(function() {
  11332. e.backgroundElement.style.opacity = 1,
  11333. e.domElement.style.opacity = 1,
  11334. e.domElement.style.webkitTransform = "scale(1)"
  11335. })
  11336. }
  11337. ,
  11338. i.prototype.hide = function() {
  11339. var t = this
  11340. , i = function() {
  11341. t.domElement.style.display = "none",
  11342. t.backgroundElement.style.display = "none",
  11343. e.unbind(t.domElement, "webkitTransitionEnd", i),
  11344. e.unbind(t.domElement, "transitionend", i),
  11345. e.unbind(t.domElement, "oTransitionEnd", i)
  11346. };
  11347. e.bind(this.domElement, "webkitTransitionEnd", i),
  11348. e.bind(this.domElement, "transitionend", i),
  11349. e.bind(this.domElement, "oTransitionEnd", i),
  11350. this.backgroundElement.style.opacity = 0,
  11351. this.domElement.style.opacity = 0,
  11352. this.domElement.style.webkitTransform = "scale(1.1)"
  11353. }
  11354. ,
  11355. i.prototype.layout = function() {
  11356. this.domElement.style.left = $("#player").width() / 2 - e.getWidth(this.domElement) / 2 + "px",
  11357. this.domElement.style.top = $("#player").height() / 2 - e.getHeight(this.domElement) / 2 + "px"
  11358. }
  11359. ,
  11360. i
  11361. }(n.dom.dom, n.utils.common), n.dom.dom, n.utils.common)
  11362. }
  11363. , {}],
  11364. 94: [function(e, t, i) {
  11365. (function(e) {
  11366. "use strict";
  11367. function i(t) {
  11368. function i(e) {
  11369. 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++) {
  11370. var n = _((t[i] * e + 50) / 100);
  11371. n < 1 ? n = 1 : n > 255 && (n = 255),
  11372. T[G[i]] = n
  11373. }
  11374. 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++) {
  11375. var a = _((r[o] * e + 50) / 100);
  11376. a < 1 ? a = 1 : a > 255 && (a = 255),
  11377. x[G[o]] = a
  11378. }
  11379. for (var s = [1, 1.387039845, 1.306562965, 1.175875602, 1, .785694958, .5411961, .275899379], l = 0, c = 0; c < 8; c++)
  11380. for (var h = 0; h < 8; h++)
  11381. S[l] = 1 / (T[G[l]] * s[c] * s[h] * 8),
  11382. M[l] = 1 / (x[G[l]] * s[c] * s[h] * 8),
  11383. l++
  11384. }
  11385. function n(e, t) {
  11386. for (var i = 0, n = 0, r = new Array, o = 1; o <= 16; o++) {
  11387. for (var a = 1; a <= e[o]; a++)
  11388. r[t[n]] = [],
  11389. r[t[n]][0] = i,
  11390. r[t[n]][1] = o,
  11391. n++,
  11392. i++;
  11393. i *= 2
  11394. }
  11395. return r
  11396. }
  11397. function r() {
  11398. C = n(z, W),
  11399. I = n(X, Z),
  11400. E = n(j, Y),
  11401. b = n(q, K)
  11402. }
  11403. function o() {
  11404. for (var e = 1, t = 2, i = 1; i <= 15; i++) {
  11405. for (var n = e; n < t; n++)
  11406. P[32767 + n] = i,
  11407. R[32767 + n] = [],
  11408. R[32767 + n][1] = i,
  11409. R[32767 + n][0] = n;
  11410. for (var r = -(t - 1); r <= -e; r++)
  11411. P[32767 + r] = i,
  11412. R[32767 + r] = [],
  11413. R[32767 + r][1] = i,
  11414. R[32767 + r][0] = t - 1 + r;
  11415. e <<= 1,
  11416. t <<= 1
  11417. }
  11418. }
  11419. function a() {
  11420. for (var e = 0; e < 256; e++)
  11421. H[e] = 19595 * e,
  11422. H[e + 256 >> 0] = 38470 * e,
  11423. H[e + 512 >> 0] = 7471 * e + 32768,
  11424. H[e + 768 >> 0] = -11059 * e,
  11425. H[e + 1024 >> 0] = -21709 * e,
  11426. H[e + 1280 >> 0] = 32768 * e + 8421375,
  11427. H[e + 1536 >> 0] = -27439 * e,
  11428. H[e + 1792 >> 0] = -5329 * e
  11429. }
  11430. function s(e) {
  11431. for (var t = e[0], i = e[1] - 1; i >= 0; )
  11432. t & 1 << i && (N |= 1 << B),
  11433. i--,
  11434. B--,
  11435. B < 0 && (255 == N ? (l(255),
  11436. l(0)) : l(N),
  11437. B = 7,
  11438. N = 0)
  11439. }
  11440. function l(e) {
  11441. D.push(e)
  11442. }
  11443. function c(e) {
  11444. l(e >> 8 & 255),
  11445. l(255 & e)
  11446. }
  11447. function h(e, t) {
  11448. var i, n, r, o, a, s, l, c, h, u = 0, d = 8, p = 64;
  11449. for (h = 0; h < d; ++h) {
  11450. i = e[u],
  11451. n = e[u + 1],
  11452. r = e[u + 2],
  11453. o = e[u + 3],
  11454. a = e[u + 4],
  11455. s = e[u + 5],
  11456. l = e[u + 6],
  11457. c = e[u + 7];
  11458. var f = i + c
  11459. , g = i - c
  11460. , m = n + l
  11461. , v = n - l
  11462. , A = r + s
  11463. , y = r - s
  11464. , C = o + a
  11465. , I = o - a
  11466. , E = f + C
  11467. , b = f - C
  11468. , w = m + A
  11469. , _ = m - A;
  11470. e[u] = E + w,
  11471. e[u + 4] = E - w;
  11472. var T = .707106781 * (_ + b);
  11473. e[u + 2] = b + T,
  11474. e[u + 6] = b - T,
  11475. E = I + y,
  11476. w = y + v,
  11477. _ = v + g;
  11478. var x = .382683433 * (E - _)
  11479. , S = .5411961 * E + x
  11480. , M = 1.306562965 * _ + x
  11481. , R = .707106781 * w
  11482. , P = g + R
  11483. , L = g - R;
  11484. e[u + 5] = L + S,
  11485. e[u + 3] = L - S,
  11486. e[u + 1] = P + M,
  11487. e[u + 7] = P - M,
  11488. u += 8
  11489. }
  11490. for (u = 0,
  11491. h = 0; h < d; ++h) {
  11492. i = e[u],
  11493. n = e[u + 8],
  11494. r = e[u + 16],
  11495. o = e[u + 24],
  11496. a = e[u + 32],
  11497. s = e[u + 40],
  11498. l = e[u + 48],
  11499. c = e[u + 56];
  11500. var D = i + c
  11501. , N = i - c
  11502. , B = n + l
  11503. , F = n - l
  11504. , V = r + s
  11505. , U = r - s
  11506. , k = o + a
  11507. , H = o - a
  11508. , G = D + k
  11509. , z = D - k
  11510. , W = B + V
  11511. , j = B - V;
  11512. e[u] = G + W,
  11513. e[u + 32] = G - W;
  11514. var Y = .707106781 * (j + z);
  11515. e[u + 16] = z + Y,
  11516. e[u + 48] = z - Y,
  11517. G = H + U,
  11518. W = U + F,
  11519. j = F + N;
  11520. var X = .382683433 * (G - j)
  11521. , Z = .5411961 * G + X
  11522. , q = 1.306562965 * j + X
  11523. , K = .707106781 * W
  11524. , Q = N + K
  11525. , J = N - K;
  11526. e[u + 40] = J + Z,
  11527. e[u + 24] = J - Z,
  11528. e[u + 8] = Q + q,
  11529. e[u + 56] = Q - q,
  11530. u++
  11531. }
  11532. var $;
  11533. for (h = 0; h < p; ++h)
  11534. $ = e[h] * t[h],
  11535. O[h] = $ > 0 ? $ + .5 | 0 : $ - .5 | 0;
  11536. return O
  11537. }
  11538. function u() {
  11539. c(65504),
  11540. c(16),
  11541. l(74),
  11542. l(70),
  11543. l(73),
  11544. l(70),
  11545. l(0),
  11546. l(1),
  11547. l(1),
  11548. l(0),
  11549. c(1),
  11550. c(1),
  11551. l(0),
  11552. l(0)
  11553. }
  11554. function d(e, t) {
  11555. c(65472),
  11556. c(17),
  11557. l(8),
  11558. c(t),
  11559. c(e),
  11560. l(3),
  11561. l(1),
  11562. l(17),
  11563. l(0),
  11564. l(2),
  11565. l(17),
  11566. l(1),
  11567. l(3),
  11568. l(17),
  11569. l(1)
  11570. }
  11571. function p() {
  11572. c(65499),
  11573. c(132),
  11574. l(0);
  11575. for (var e = 0; e < 64; e++)
  11576. l(T[e]);
  11577. l(1);
  11578. for (var t = 0; t < 64; t++)
  11579. l(x[t])
  11580. }
  11581. function f() {
  11582. c(65476),
  11583. c(418),
  11584. l(0);
  11585. for (var e = 0; e < 16; e++)
  11586. l(z[e + 1]);
  11587. for (var t = 0; t <= 11; t++)
  11588. l(W[t]);
  11589. l(16);
  11590. for (var i = 0; i < 16; i++)
  11591. l(j[i + 1]);
  11592. for (var n = 0; n <= 161; n++)
  11593. l(Y[n]);
  11594. l(1);
  11595. for (var r = 0; r < 16; r++)
  11596. l(X[r + 1]);
  11597. for (var o = 0; o <= 11; o++)
  11598. l(Z[o]);
  11599. l(17);
  11600. for (var a = 0; a < 16; a++)
  11601. l(q[a + 1]);
  11602. for (var s = 0; s <= 161; s++)
  11603. l(K[s])
  11604. }
  11605. function g() {
  11606. c(65498),
  11607. c(12),
  11608. l(3),
  11609. l(1),
  11610. l(0),
  11611. l(2),
  11612. l(17),
  11613. l(3),
  11614. l(17),
  11615. l(0),
  11616. l(63),
  11617. l(0)
  11618. }
  11619. function m(e, t, i, n, r) {
  11620. for (var o, a = r[0], l = r[240], c = 16, u = 63, d = 64, p = h(e, t), f = 0; f < d; ++f)
  11621. L[G[f]] = p[f];
  11622. var g = L[0] - i;
  11623. i = L[0],
  11624. 0 == g ? s(n[0]) : (o = 32767 + g,
  11625. s(n[P[o]]),
  11626. s(R[o]));
  11627. for (var m = 63; m > 0 && 0 == L[m]; m--)
  11628. ;
  11629. if (0 == m)
  11630. return s(a),
  11631. i;
  11632. for (var v, A = 1; A <= m; ) {
  11633. for (var y = A; 0 == L[A] && A <= m; ++A)
  11634. ;
  11635. var C = A - y;
  11636. if (C >= c) {
  11637. v = C >> 4;
  11638. for (var I = 1; I <= v; ++I)
  11639. s(l);
  11640. C &= 15
  11641. }
  11642. o = 32767 + L[A],
  11643. s(r[(C << 4) + P[o]]),
  11644. s(R[o]),
  11645. A++
  11646. }
  11647. return m != u && s(a),
  11648. i
  11649. }
  11650. function v() {
  11651. for (var e = String.fromCharCode, t = 0; t < 256; t++)
  11652. k[t] = e(t)
  11653. }
  11654. function A(e) {
  11655. if (e <= 0 && (e = 1),
  11656. e > 100 && (e = 100),
  11657. w != e) {
  11658. var t = 0;
  11659. t = e < 50 ? Math.floor(5e3 / e) : Math.floor(200 - 2 * e),
  11660. i(t),
  11661. w = e
  11662. }
  11663. }
  11664. function y() {
  11665. var e = (new Date).getTime();
  11666. t || (t = 50),
  11667. v(),
  11668. r(),
  11669. o(),
  11670. a(),
  11671. A(t);
  11672. (new Date).getTime() - e
  11673. }
  11674. var C, I, E, b, w, _ = (Math.round,
  11675. 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];
  11676. this.encode = function(t, i) {
  11677. var n = ((new Date).getTime(),
  11678. i.quality);
  11679. n && A(n),
  11680. D = new Array,
  11681. N = 0,
  11682. B = 7,
  11683. c(65496),
  11684. u(),
  11685. p(),
  11686. d(t.width, t.height),
  11687. f(),
  11688. g();
  11689. var r = 0
  11690. , o = 0
  11691. , a = 0;
  11692. N = 0,
  11693. B = 7,
  11694. this.encode.displayName = "_encode_";
  11695. 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; ) {
  11696. for (l = 0; l < G; ) {
  11697. for (w = G * z + l,
  11698. _ = w,
  11699. T = -1,
  11700. x = 0,
  11701. R = 0; R < 64; R++)
  11702. x = (k ? 63 - R : R) >> 3,
  11703. T = 4 * (7 & R),
  11704. _ = w + x * G + T,
  11705. z + x >= L && (_ -= G * (z + 1 + x - L)),
  11706. l + T >= G && (_ -= l + T - G + 4),
  11707. h = P[_++],
  11708. v = P[_++],
  11709. y = P[_++],
  11710. F[R] = (H[h] + H[v + 256 >> 0] + H[y + 512 >> 0] >> 16) - 128,
  11711. V[R] = (H[h + 768 >> 0] + H[v + 1024 >> 0] + H[y + 1280 >> 0] >> 16) - 128,
  11712. U[R] = (H[h + 1280 >> 0] + H[v + 1536 >> 0] + H[y + 1792 >> 0] >> 16) - 128;
  11713. r = m(F, S, r, C, E),
  11714. o = m(V, M, o, I, b),
  11715. a = m(U, M, a, I, b),
  11716. l += 32
  11717. }
  11718. z += W
  11719. }
  11720. if (B >= 0) {
  11721. var j = [];
  11722. j[1] = B + 1,
  11723. j[0] = (1 << B + 1) - 1,
  11724. s(j)
  11725. }
  11726. return c(65497),
  11727. new e(D)
  11728. }
  11729. ,
  11730. y()
  11731. }
  11732. function n(e, t) {
  11733. t = t || {},
  11734. t.quality = t.quality || 50;
  11735. var n = t.quality
  11736. , r = new i(n)
  11737. , o = r.encode(e, t);
  11738. return {
  11739. data: o,
  11740. width: e.width,
  11741. height: e.height
  11742. }
  11743. }
  11744. t.exports.encode = n
  11745. }
  11746. ).call(this, e("buffer").Buffer)
  11747. }
  11748. , {
  11749. buffer: 198
  11750. }],
  11751. 95: [function(e, t, i) {
  11752. "use strict";
  11753. !function() {
  11754. if ("performance"in window == !1 && (window.performance = {}),
  11755. Date.now = Date.now || function() {
  11756. return (new Date).getTime()
  11757. }
  11758. ,
  11759. "now"in window.performance == !1) {
  11760. var e = Date.now();
  11761. performance.timing && performance.timing.navigationStart && (e = performance.timing.navigationStart),
  11762. window.performance.now = function() {
  11763. return Date.now() - e
  11764. }
  11765. }
  11766. }()
  11767. }
  11768. , {}],
  11769. 96: [function(e, t, i) {
  11770. "use strict";
  11771. var n = e("three");
  11772. n.EffectComposer = function(e, t) {
  11773. if (this.renderer = e,
  11774. void 0 === t) {
  11775. var i = {
  11776. minFilter: n.LinearFilter,
  11777. magFilter: n.LinearFilter,
  11778. format: n.RGBAFormat,
  11779. stencilBuffer: !1
  11780. }
  11781. , r = e.getSize();
  11782. t = new n.WebGLRenderTarget(r.width,r.height,i)
  11783. }
  11784. this.renderTarget1 = t,
  11785. this.renderTarget2 = t.clone(),
  11786. this.writeBuffer = this.renderTarget1,
  11787. this.readBuffer = this.renderTarget2,
  11788. this.passes = [],
  11789. void 0 === n.CopyShader && console.error("THREE.EffectComposer relies on THREE.CopyShader"),
  11790. this.copyPass = new n.ShaderPass(n.CopyShader)
  11791. }
  11792. ,
  11793. n.EffectComposer.prototype = {
  11794. swapBuffers: function() {
  11795. var e = this.readBuffer;
  11796. this.readBuffer = this.writeBuffer,
  11797. this.writeBuffer = e
  11798. },
  11799. addPass: function(e) {
  11800. this.passes.push(e)
  11801. },
  11802. insertPass: function(e, t) {
  11803. this.passes.splice(t, 0, e)
  11804. },
  11805. render: function(e) {
  11806. this.writeBuffer = this.renderTarget1,
  11807. this.readBuffer = this.renderTarget2;
  11808. var t, i, r = !1, o = this.passes.length;
  11809. for (i = 0; i < o; i++)
  11810. if (t = this.passes[i],
  11811. t.enabled) {
  11812. if (t.render(this.renderer, this.writeBuffer, this.readBuffer, e, r),
  11813. t.needsSwap) {
  11814. if (r) {
  11815. var a = this.renderer.context;
  11816. a.stencilFunc(a.NOTEQUAL, 1, 4294967295),
  11817. this.copyPass.render(this.renderer, this.writeBuffer, this.readBuffer, e),
  11818. a.stencilFunc(a.EQUAL, 1, 4294967295)
  11819. }
  11820. this.swapBuffers()
  11821. }
  11822. t instanceof n.MaskPass ? r = !0 : t instanceof n.ClearMaskPass && (r = !1)
  11823. }
  11824. },
  11825. reset: function(e) {
  11826. if (void 0 === e) {
  11827. var t = this.renderer.getSize();
  11828. e = this.renderTarget1.clone(),
  11829. e.setSize(t.width, t.height)
  11830. }
  11831. this.renderTarget1.dispose(),
  11832. this.renderTarget2.dispose(),
  11833. this.renderTarget1 = e,
  11834. this.renderTarget2 = e.clone(),
  11835. this.writeBuffer = this.renderTarget1,
  11836. this.readBuffer = this.renderTarget2
  11837. },
  11838. setSize: function(e, t) {
  11839. this.renderTarget1.setSize(e, t),
  11840. this.renderTarget2.setSize(e, t)
  11841. }
  11842. }
  11843. }
  11844. , {
  11845. three: 217
  11846. }],
  11847. 97: [function(e, t, i) {
  11848. "use strict";
  11849. var n = e("three");
  11850. n.MaskPass = function(e, t) {
  11851. this.scene = e,
  11852. this.camera = t,
  11853. this.enabled = !0,
  11854. this.clear = !0,
  11855. this.needsSwap = !1,
  11856. this.inverse = !1
  11857. }
  11858. ,
  11859. n.MaskPass.prototype = {
  11860. render: function(e, t, i, n) {
  11861. var r = e.context;
  11862. r.colorMask(!1, !1, !1, !1),
  11863. r.depthMask(!1);
  11864. var o, a;
  11865. this.inverse ? (o = 0,
  11866. a = 1) : (o = 1,
  11867. a = 0),
  11868. r.enable(r.STENCIL_TEST),
  11869. r.stencilOp(r.REPLACE, r.REPLACE, r.REPLACE),
  11870. r.stencilFunc(r.ALWAYS, o, 4294967295),
  11871. r.clearStencil(a),
  11872. e.render(this.scene, this.camera, i, this.clear),
  11873. e.render(this.scene, this.camera, t, this.clear),
  11874. r.colorMask(!0, !0, !0, !0),
  11875. r.depthMask(!0),
  11876. r.stencilFunc(r.EQUAL, 1, 4294967295),
  11877. r.stencilOp(r.KEEP, r.KEEP, r.KEEP)
  11878. }
  11879. },
  11880. n.ClearMaskPass = function() {
  11881. this.enabled = !0
  11882. }
  11883. ,
  11884. n.ClearMaskPass.prototype = {
  11885. render: function(e, t, i, n) {
  11886. var r = e.context;
  11887. r.disable(r.STENCIL_TEST)
  11888. }
  11889. }
  11890. }
  11891. , {
  11892. three: 217
  11893. }],
  11894. 98: [function(e, t, i) {
  11895. "use strict";
  11896. var n = e("three");
  11897. n.RenderPass = function(e, t, i, r, o) {
  11898. this.scene = e,
  11899. this.camera = t,
  11900. this.overrideMaterial = i,
  11901. this.clearColor = r,
  11902. this.clearAlpha = void 0 !== o ? o : 1,
  11903. this.oldClearColor = new n.Color,
  11904. this.oldClearAlpha = 1,
  11905. this.enabled = !0,
  11906. this.clear = !0,
  11907. this.needsSwap = !1
  11908. }
  11909. ,
  11910. n.RenderPass.prototype = {
  11911. render: function(e, t, i, n) {
  11912. this.scene.overrideMaterial = this.overrideMaterial,
  11913. this.clearColor && (this.oldClearColor.copy(e.getClearColor()),
  11914. this.oldClearAlpha = e.getClearAlpha(),
  11915. e.setClearColor(this.clearColor, this.clearAlpha)),
  11916. e.render(this.scene, this.camera, i, this.clear),
  11917. this.clearColor && e.setClearColor(this.oldClearColor, this.oldClearAlpha),
  11918. this.scene.overrideMaterial = null
  11919. }
  11920. }
  11921. }
  11922. , {
  11923. three: 217
  11924. }],
  11925. 99: [function(e, t, i) {
  11926. "use strict";
  11927. var n = e("three");
  11928. n.ShaderPass = function(e, t) {
  11929. this.textureID = void 0 !== t ? t : "tDiffuse",
  11930. e instanceof n.ShaderMaterial ? (this.uniforms = e.uniforms,
  11931. this.material = e) : e && (this.uniforms = n.UniformsUtils.clone(e.uniforms),
  11932. this.material = new n.ShaderMaterial({
  11933. defines: e.defines || {},
  11934. uniforms: this.uniforms,
  11935. vertexShader: e.vertexShader,
  11936. fragmentShader: e.fragmentShader
  11937. })),
  11938. this.renderToScreen = !1,
  11939. this.enabled = !0,
  11940. this.needsSwap = !0,
  11941. this.clear = !1,
  11942. this.camera = new n.OrthographicCamera(-1,1,1,-1,0,1),
  11943. this.scene = new n.Scene,
  11944. this.quad = new n.Mesh(new n.PlaneBufferGeometry(2,2),null),
  11945. this.scene.add(this.quad)
  11946. }
  11947. ,
  11948. n.ShaderPass.prototype = {
  11949. render: function(e, t, i, n) {
  11950. this.uniforms[this.textureID] && (this.uniforms[this.textureID].value = i),
  11951. this.quad.material = this.material,
  11952. this.renderToScreen ? e.render(this.scene, this.camera) : e.render(this.scene, this.camera, t, this.clear)
  11953. }
  11954. }
  11955. }
  11956. , {
  11957. three: 217
  11958. }],
  11959. 100: [function(e, t, i) {
  11960. "use strict";
  11961. var n = e("three");
  11962. n.CopyShader = {
  11963. uniforms: {
  11964. tDiffuse: {
  11965. type: "t",
  11966. value: null
  11967. },
  11968. opacity: {
  11969. type: "f",
  11970. value: 1
  11971. }
  11972. },
  11973. vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  11974. fragmentShader: ["uniform float opacity;", "uniform sampler2D tDiffuse;", "varying vec2 vUv;", "void main() {", "vec4 texel = texture2D( tDiffuse, vUv );", "gl_FragColor = opacity * texel;", "}"].join("\n")
  11975. }
  11976. }
  11977. , {
  11978. three: 217
  11979. }],
  11980. 101: [function(e, t, i) {
  11981. "use strict";
  11982. var n = e("three");
  11983. n.HorizontalBlurShader = {
  11984. uniforms: {
  11985. tDiffuse: {
  11986. type: "t",
  11987. value: null
  11988. },
  11989. h: {
  11990. type: "f",
  11991. value: 1 / 512
  11992. }
  11993. },
  11994. vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  11995. 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")
  11996. }
  11997. }
  11998. , {
  11999. three: 217
  12000. }],
  12001. 102: [function(e, t, i) {
  12002. "use strict";
  12003. var n = e("three");
  12004. n.VerticalBlurShader = {
  12005. uniforms: {
  12006. tDiffuse: {
  12007. type: "t",
  12008. value: null
  12009. },
  12010. v: {
  12011. type: "f",
  12012. value: 1 / 512
  12013. }
  12014. },
  12015. vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  12016. 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")
  12017. }
  12018. }
  12019. , {
  12020. three: 217
  12021. }],
  12022. 103: [function(e, t, i) {
  12023. "use strict";
  12024. var n = e("three");
  12025. !function() {
  12026. if ("performance"in window == 0 && (window.performance = {}),
  12027. "now"in window.performance == 0) {
  12028. var e = Date.now();
  12029. performance.timing && performance.timing.navigationStart && (e = performance.timing.navigationStart),
  12030. window.performance.now = function() {
  12031. return Date.now() - e
  12032. }
  12033. }
  12034. }(),
  12035. n.WebGLRenderer.prototype.paramThreeToGL = function(e) {
  12036. var t, i = this.extensions, r = this.context;
  12037. if (e === n.RepeatWrapping)
  12038. return r.REPEAT;
  12039. if (e === n.ClampToEdgeWrapping)
  12040. return r.CLAMP_TO_EDGE;
  12041. if (e === n.MirroredRepeatWrapping)
  12042. return r.MIRRORED_REPEAT;
  12043. if (e === n.NearestFilter)
  12044. return r.NEAREST;
  12045. if (e === n.NearestMipMapNearestFilter)
  12046. return r.NEAREST_MIPMAP_NEAREST;
  12047. if (e === n.NearestMipMapLinearFilter)
  12048. return r.NEAREST_MIPMAP_LINEAR;
  12049. if (e === n.LinearFilter)
  12050. return r.LINEAR;
  12051. if (e === n.LinearMipMapNearestFilter)
  12052. return r.LINEAR_MIPMAP_NEAREST;
  12053. if (e === n.LinearMipMapLinearFilter)
  12054. return r.LINEAR_MIPMAP_LINEAR;
  12055. if (e === n.UnsignedByteType)
  12056. return r.UNSIGNED_BYTE;
  12057. if (e === n.UnsignedShort4444Type)
  12058. return r.UNSIGNED_SHORT_4_4_4_4;
  12059. if (e === n.UnsignedShort5551Type)
  12060. return r.UNSIGNED_SHORT_5_5_5_1;
  12061. if (e === n.UnsignedShort565Type)
  12062. return r.UNSIGNED_SHORT_5_6_5;
  12063. if (e === n.ByteType)
  12064. return r.BYTE;
  12065. if (e === n.ShortType)
  12066. return r.SHORT;
  12067. if (e === n.UnsignedShortType)
  12068. return r.UNSIGNED_SHORT;
  12069. if (e === n.IntType)
  12070. return r.INT;
  12071. if (e === n.UnsignedIntType)
  12072. return r.UNSIGNED_INT;
  12073. if (e === n.FloatType)
  12074. return r.FLOAT;
  12075. if (t = i.get("OES_texture_half_float"),
  12076. null !== t && e === n.HalfFloatType)
  12077. return t.HALF_FLOAT_OES;
  12078. if (e === n.AlphaFormat)
  12079. return r.ALPHA;
  12080. if (e === n.RGBFormat)
  12081. return r.RGB;
  12082. if (e === n.RGBAFormat)
  12083. return r.RGBA;
  12084. if (e === n.LuminanceFormat)
  12085. return r.LUMINANCE;
  12086. if (e === n.LuminanceAlphaFormat)
  12087. return r.LUMINANCE_ALPHA;
  12088. if (e === n.AddEquation)
  12089. return r.FUNC_ADD;
  12090. if (e === n.SubtractEquation)
  12091. return r.FUNC_SUBTRACT;
  12092. if (e === n.ReverseSubtractEquation)
  12093. return r.FUNC_REVERSE_SUBTRACT;
  12094. if (e === n.ZeroFactor)
  12095. return r.ZERO;
  12096. if (e === n.OneFactor)
  12097. return r.ONE;
  12098. if (e === n.SrcColorFactor)
  12099. return r.SRC_COLOR;
  12100. if (e === n.OneMinusSrcColorFactor)
  12101. return r.ONE_MINUS_SRC_COLOR;
  12102. if (e === n.SrcAlphaFactor)
  12103. return r.SRC_ALPHA;
  12104. if (e === n.OneMinusSrcAlphaFactor)
  12105. return r.ONE_MINUS_SRC_ALPHA;
  12106. if (e === n.DstAlphaFactor)
  12107. return r.DST_ALPHA;
  12108. if (e === n.OneMinusDstAlphaFactor)
  12109. return r.ONE_MINUS_DST_ALPHA;
  12110. if (e === n.DstColorFactor)
  12111. return r.DST_COLOR;
  12112. if (e === n.OneMinusDstColorFactor)
  12113. return r.ONE_MINUS_DST_COLOR;
  12114. if (e === n.SrcAlphaSaturateFactor)
  12115. return r.SRC_ALPHA_SATURATE;
  12116. if (t = i.get("WEBGL_compressed_texture_s3tc"),
  12117. null !== t) {
  12118. if (e === n.RGB_S3TC_DXT1_Format)
  12119. return t.COMPRESSED_RGB_S3TC_DXT1_EXT;
  12120. if (e === n.RGBA_S3TC_DXT1_Format)
  12121. return t.COMPRESSED_RGBA_S3TC_DXT1_EXT;
  12122. if (e === n.RGBA_S3TC_DXT3_Format)
  12123. return t.COMPRESSED_RGBA_S3TC_DXT3_EXT;
  12124. if (e === n.RGBA_S3TC_DXT5_Format)
  12125. return t.COMPRESSED_RGBA_S3TC_DXT5_EXT
  12126. }
  12127. if (t = i.get("WEBGL_compressed_texture_pvrtc"),
  12128. null !== t) {
  12129. if (e === n.RGB_PVRTC_4BPPV1_Format)
  12130. return t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;
  12131. if (e === n.RGB_PVRTC_2BPPV1_Format)
  12132. return t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;
  12133. if (e === n.RGBA_PVRTC_4BPPV1_Format)
  12134. return t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;
  12135. if (e === n.RGBA_PVRTC_2BPPV1_Format)
  12136. return t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG
  12137. }
  12138. if (t = i.get("WEBGL_compressed_texture_etc1"),
  12139. null !== t && e === n.RGB_ETC1_Format)
  12140. return t.COMPRESSED_RGB_ETC1_WEBGL;
  12141. if (t = i.get("EXT_blend_minmax"),
  12142. null !== t) {
  12143. if (e === n.MinEquation)
  12144. return t.MIN_EXT;
  12145. if (e === n.MaxEquation)
  12146. return t.MAX_EXT
  12147. }
  12148. return 0
  12149. }
  12150. ,
  12151. n.WebGLState = function(e, t, i) {
  12152. var r = this
  12153. , o = new n.Vector4
  12154. , a = e.getParameter(e.MAX_VERTEX_ATTRIBS)
  12155. , s = new Uint8Array(a)
  12156. , l = new Uint8Array(a)
  12157. , c = new Uint8Array(a)
  12158. , h = {}
  12159. , u = null
  12160. , d = null
  12161. , p = null
  12162. , f = null
  12163. , g = null
  12164. , m = null
  12165. , v = null
  12166. , A = null
  12167. , y = !1
  12168. , C = null
  12169. , I = null
  12170. , E = null
  12171. , b = null
  12172. , w = null
  12173. , _ = null
  12174. , T = null
  12175. , x = null
  12176. , S = null
  12177. , M = null
  12178. , R = null
  12179. , P = null
  12180. , O = null
  12181. , L = null
  12182. , D = null
  12183. , N = e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS)
  12184. , B = void 0
  12185. , F = {}
  12186. , V = new n.Vector4
  12187. , U = null
  12188. , k = null
  12189. , H = new n.Vector4
  12190. , G = new n.Vector4;
  12191. this.init = function() {
  12192. this.clearColor(0, 0, 0, 1),
  12193. this.clearDepth(1),
  12194. this.clearStencil(0),
  12195. this.enable(e.DEPTH_TEST),
  12196. e.depthFunc(e.LEQUAL),
  12197. e.frontFace(e.CCW),
  12198. e.cullFace(e.BACK),
  12199. this.enable(e.CULL_FACE),
  12200. this.enable(e.BLEND),
  12201. e.blendEquation(e.FUNC_ADD),
  12202. e.blendFunc(e.SRC_ALPHA, e.ONE_MINUS_SRC_ALPHA)
  12203. }
  12204. ,
  12205. this.initAttributes = function() {
  12206. for (var e = 0, t = s.length; e < t; e++)
  12207. s[e] = 0
  12208. }
  12209. ,
  12210. this.enableAttribute = function(i) {
  12211. if (s[i] = 1,
  12212. 0 === l[i] && (e.enableVertexAttribArray(i),
  12213. l[i] = 1),
  12214. 0 !== c[i]) {
  12215. var n = t.get("ANGLE_instanced_arrays");
  12216. n.vertexAttribDivisorANGLE(i, 0),
  12217. c[i] = 0
  12218. }
  12219. }
  12220. ,
  12221. this.enableAttributeAndDivisor = function(t, i, n) {
  12222. s[t] = 1,
  12223. 0 === l[t] && (e.enableVertexAttribArray(t),
  12224. l[t] = 1),
  12225. c[t] !== i && (n.vertexAttribDivisorANGLE(t, i),
  12226. c[t] = i)
  12227. }
  12228. ,
  12229. this.disableUnusedAttributes = function() {
  12230. for (var t = 0, i = l.length; t < i; t++)
  12231. l[t] !== s[t] && (e.disableVertexAttribArray(t),
  12232. l[t] = 0)
  12233. }
  12234. ,
  12235. this.enable = function(t) {
  12236. h[t] !== !0 && (e.enable(t),
  12237. h[t] = !0)
  12238. }
  12239. ,
  12240. this.disable = function(t) {
  12241. h[t] !== !1 && (e.disable(t),
  12242. h[t] = !1)
  12243. }
  12244. ,
  12245. this.getCompressedTextureFormats = function() {
  12246. if (null === u && (u = [],
  12247. t.get("WEBGL_compressed_texture_pvrtc") || t.get("WEBGL_compressed_texture_s3tc") || t.get("WEBGL_compressed_texture_etc1")))
  12248. for (var i = e.getParameter(e.COMPRESSED_TEXTURE_FORMATS), n = 0; n < i.length; n++)
  12249. u.push(i[n]);
  12250. return u
  12251. }
  12252. ,
  12253. this.setBlending = function(t, r, o, a, s, l, c, h) {
  12254. t === n.NoBlending ? this.disable(e.BLEND) : this.enable(e.BLEND),
  12255. t === d && h === y || (t === n.AdditiveBlending ? h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  12256. e.blendFuncSeparate(e.ONE, e.ONE, e.ONE, e.ONE)) : (e.blendEquation(e.FUNC_ADD),
  12257. e.blendFunc(e.SRC_ALPHA, e.ONE)) : t === n.SubtractiveBlending ? h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  12258. e.blendFuncSeparate(e.ZERO, e.ZERO, e.ONE_MINUS_SRC_COLOR, e.ONE_MINUS_SRC_ALPHA)) : (e.blendEquation(e.FUNC_ADD),
  12259. e.blendFunc(e.ZERO, e.ONE_MINUS_SRC_COLOR)) : t === n.MultiplyBlending ? h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  12260. e.blendFuncSeparate(e.ZERO, e.ZERO, e.SRC_COLOR, e.SRC_ALPHA)) : (e.blendEquation(e.FUNC_ADD),
  12261. e.blendFunc(e.ZERO, e.SRC_COLOR)) : h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  12262. e.blendFuncSeparate(e.ONE, e.ONE_MINUS_SRC_ALPHA, e.ONE, e.ONE_MINUS_SRC_ALPHA)) : (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  12263. e.blendFuncSeparate(e.SRC_ALPHA, e.ONE_MINUS_SRC_ALPHA, e.ONE, e.ONE_MINUS_SRC_ALPHA)),
  12264. d = t,
  12265. y = h),
  12266. t === n.CustomBlending ? (s = s || r,
  12267. l = l || o,
  12268. c = c || a,
  12269. r === p && s === m || (e.blendEquationSeparate(i(r), i(s)),
  12270. p = r,
  12271. m = s),
  12272. o === f && a === g && l === v && c === A || (e.blendFuncSeparate(i(o), i(a), i(l), i(c)),
  12273. f = o,
  12274. g = a,
  12275. v = l,
  12276. A = c)) : (p = null,
  12277. f = null,
  12278. g = null,
  12279. m = null,
  12280. v = null,
  12281. A = null)
  12282. }
  12283. ,
  12284. this.setDepthFunc = function(t) {
  12285. if (C !== t) {
  12286. if (t)
  12287. switch (t) {
  12288. case n.NeverDepth:
  12289. e.depthFunc(e.NEVER);
  12290. break;
  12291. case n.AlwaysDepth:
  12292. e.depthFunc(e.ALWAYS);
  12293. break;
  12294. case n.LessDepth:
  12295. e.depthFunc(e.LESS);
  12296. break;
  12297. case n.LessEqualDepth:
  12298. e.depthFunc(e.LEQUAL);
  12299. break;
  12300. case n.EqualDepth:
  12301. e.depthFunc(e.EQUAL);
  12302. break;
  12303. case n.GreaterEqualDepth:
  12304. e.depthFunc(e.GEQUAL);
  12305. break;
  12306. case n.GreaterDepth:
  12307. e.depthFunc(e.GREATER);
  12308. break;
  12309. case n.NotEqualDepth:
  12310. e.depthFunc(e.NOTEQUAL);
  12311. break;
  12312. default:
  12313. e.depthFunc(e.LEQUAL)
  12314. }
  12315. else
  12316. e.depthFunc(e.LEQUAL);
  12317. C = t
  12318. }
  12319. }
  12320. ,
  12321. this.setDepthTest = function(t) {
  12322. t ? this.enable(e.DEPTH_TEST) : this.disable(e.DEPTH_TEST)
  12323. }
  12324. ,
  12325. this.setDepthWrite = function(t) {
  12326. I !== t && (e.depthMask(t),
  12327. I = t)
  12328. }
  12329. ,
  12330. this.setColorWrite = function(t) {
  12331. E !== t && (e.colorMask(t, t, t, t),
  12332. E = t)
  12333. }
  12334. ,
  12335. this.setStencilFunc = function(t, i, n) {
  12336. w === t && _ === i && T === n || (e.stencilFunc(t, i, n),
  12337. w = t,
  12338. _ = i,
  12339. T = n)
  12340. }
  12341. ,
  12342. this.setStencilOp = function(t, i, n) {
  12343. x === t && S === i && M === n || (e.stencilOp(t, i, n),
  12344. x = t,
  12345. S = i,
  12346. M = n)
  12347. }
  12348. ,
  12349. this.setStencilTest = function(t) {
  12350. t ? this.enable(e.STENCIL_TEST) : this.disable(e.STENCIL_TEST)
  12351. }
  12352. ,
  12353. this.setStencilWrite = function(t) {
  12354. b !== t && (e.stencilMask(t),
  12355. b = t)
  12356. }
  12357. ,
  12358. this.setFlipSided = function(t) {
  12359. R !== t && (t ? e.frontFace(e.CW) : e.frontFace(e.CCW),
  12360. R = t)
  12361. }
  12362. ,
  12363. this.setLineWidth = function(t) {
  12364. t !== P && (e.lineWidth(t),
  12365. P = t)
  12366. }
  12367. ,
  12368. this.setPolygonOffset = function(t, i, n) {
  12369. t ? this.enable(e.POLYGON_OFFSET_FILL) : this.disable(e.POLYGON_OFFSET_FILL),
  12370. !t || O === i && L === n || (e.polygonOffset(i, n),
  12371. O = i,
  12372. L = n)
  12373. }
  12374. ,
  12375. this.getScissorTest = function() {
  12376. return D
  12377. }
  12378. ,
  12379. this.setScissorTest = function(t) {
  12380. D = t,
  12381. t ? this.enable(e.SCISSOR_TEST) : this.disable(e.SCISSOR_TEST)
  12382. }
  12383. ,
  12384. this.activeTexture = function(t) {
  12385. void 0 === t && (t = e.TEXTURE0 + N - 1),
  12386. B !== t && (e.activeTexture(t),
  12387. B = t)
  12388. }
  12389. ,
  12390. this.bindTexture = function(t, i) {
  12391. void 0 === B && r.activeTexture();
  12392. var n = F[B];
  12393. void 0 === n && (n = {
  12394. type: void 0,
  12395. texture: void 0
  12396. },
  12397. F[B] = n),
  12398. n.type === t && n.texture === i || (e.bindTexture(t, i),
  12399. n.type = t,
  12400. n.texture = i)
  12401. }
  12402. ,
  12403. this.compressedTexImage2D = function() {
  12404. try {
  12405. e.compressedTexImage2D.apply(e, arguments)
  12406. } catch (e) {
  12407. console.error(e)
  12408. }
  12409. }
  12410. ,
  12411. this.texImage2D = function() {
  12412. try {
  12413. e.texImage2D.apply(e, arguments)
  12414. } catch (e) {
  12415. console.error(e)
  12416. }
  12417. }
  12418. ,
  12419. this.clearColor = function(t, i, n, r) {
  12420. o.set(t, i, n, r),
  12421. V.equals(o) === !1 && (e.clearColor(t, i, n, r),
  12422. V.copy(o))
  12423. }
  12424. ,
  12425. this.clearDepth = function(t) {
  12426. U !== t && (e.clearDepth(t),
  12427. U = t)
  12428. }
  12429. ,
  12430. this.clearStencil = function(t) {
  12431. k !== t && (e.clearStencil(t),
  12432. k = t)
  12433. }
  12434. ,
  12435. this.scissor = function(t) {
  12436. H.equals(t) === !1 && (e.scissor(t.x, t.y, t.z, t.w),
  12437. H.copy(t))
  12438. }
  12439. ,
  12440. this.viewport = function(t) {
  12441. G.equals(t) === !1 && (e.viewport(t.x, t.y, t.z, t.w),
  12442. G.copy(t))
  12443. }
  12444. ,
  12445. this.reset = function() {
  12446. for (var t = 0; t < l.length; t++)
  12447. 1 === l[t] && (e.disableVertexAttribArray(t),
  12448. l[t] = 0);
  12449. h = {},
  12450. u = null,
  12451. B = void 0,
  12452. F = {},
  12453. d = null,
  12454. E = null,
  12455. I = null,
  12456. b = null,
  12457. R = null
  12458. }
  12459. }
  12460. }
  12461. , {
  12462. three: 217
  12463. }],
  12464. 104: [function(e, t, i) {
  12465. (function(i, n) {
  12466. "use strict";
  12467. function r(e) {
  12468. this.urls = e;
  12469. var t = i("bWVzc2FnZSBiaW5hcnlfbWVzaCB7CglyZXBlYXRlZCBjaHVua19zaW1wbGUgY2h1bmsgPSAxOwoJcmVwZWF0ZWQgY2h1bmtfcXVhbnRpemVkIHF1YW50aXplZF9jaHVuayA9IDI7Cn0KCi8vIERlZmluaXRpb24gb2YgdmVydGljZXM6IDNEIGNvb3JkaW5hdGVzLCBhbmQgMkQgdGV4dHVyZSBjb29yZGluYXRlcy4KbWVzc2FnZSB2ZXJ0aWNlc19zaW1wbGUgewoJcmVwZWF0ZWQgZmxvYXQgeHl6ID0gMSBbcGFja2VkPXRydWVdOyAgLy8geF8wLHlfMCx6XzAsIHhfMSx5XzEsel8xLCAuLi4KCXJlcGVhdGVkIGZsb2F0IHV2ID0gMiBbcGFja2VkPXRydWVdOyAgLy8gdV8wLHZfMCwgdV8xLHZfMSwgLi4uCn0KCi8vIEluZGV4ZXMgb2YgdmVydGljZXMgb2YgZmFjZXMKbWVzc2FnZSBmYWNlc19zaW1wbGUgewoJcmVwZWF0ZWQgdWludDMyIGZhY2VzID0gMSBbcGFja2VkPXRydWVdOyAvLyBpMDAsaTAxLGkwMiwgaTEwLGkxMSxpMTIsIC4uLgp9CgovLyBBIHNpbXBseSBlbmNvZGVkIGNodW5rLgovLyBUT0RPOiBhZGQgY2h1bmsgcHJvcGVyaXRlcyAoc3VjaCBhcyAicmVmbGVjdGl2ZSIpCm1lc3NhZ2UgY2h1bmtfc2ltcGxlIHsKCW9wdGlvbmFsIHZlcnRpY2VzX3NpbXBsZSB2ZXJ0aWNlcyA9IDE7CglvcHRpb25hbCBmYWNlc19zaW1wbGUgZmFjZXMgPSAyOwoJb3B0aW9uYWwgc3RyaW5nIGNodW5rX25hbWUgPSAzOwoJb3B0aW9uYWwgc3RyaW5nIG1hdGVyaWFsX25hbWUgPSA0Owp9CgovLyBRdWFudGl6ZWQgdmVyc2lvbnMgZm9sbG93OgptZXNzYWdlIHZlcnRpY2VzX3F1YW50aXplZCB7CglvcHRpb25hbCBmbG9hdCBxdWFudGl6YXRpb24gPSAxOwoJcmVwZWF0ZWQgZmxvYXQgdHJhbnNsYXRpb24gPSAyOwoJcmVwZWF0ZWQgc2ludDMyIHggPSAzIFtwYWNrZWQ9dHJ1ZV07CglyZXBlYXRlZCBzaW50MzIgeSA9IDQgW3BhY2tlZD10cnVlXTsKCXJlcGVhdGVkIHNpbnQzMiB6ID0gNSBbcGFja2VkPXRydWVdOwp9CgptZXNzYWdlIHV2X3F1YW50aXplZCB7CglvcHRpb25hbCBzdHJpbmcgbmFtZSA9IDE7CglvcHRpb25hbCBmbG9hdCBxdWFudGl6YXRpb24gPSAyOwoJcmVwZWF0ZWQgc2ludDMyIHUgPSAzIFtwYWNrZWQ9dHJ1ZV07CglyZXBlYXRlZCBzaW50MzIgdiA9IDQgW3BhY2tlZD10cnVlXTsKfQoKLy8gSW5kZXhlcyBvZiB2ZXJ0aWNlcyBvZiBmYWNlcwptZXNzYWdlIGZhY2VzX2NvbXByZXNzZWQgewoJcmVwZWF0ZWQgc2ludDMyIGZhY2VzID0gMSBbcGFja2VkPXRydWVdOyAvLyBpMDAsaTAxLGkwMiwgaTEwLGkxMSxpMTIsIC4uLgp9CgptZXNzYWdlIGNodW5rX3F1YW50aXplZCB7CglvcHRpb25hbCBzdHJpbmcgY2h1bmtfbmFtZSA9IDE7CglvcHRpb25hbCBzdHJpbmcgbWF0ZXJpYWxfbmFtZSA9IDI7CglvcHRpb25hbCB2ZXJ0aWNlc19xdWFudGl6ZWQgdmVydGljZXMgPSAzOwoJcmVwZWF0ZWQgdXZfcXVhbnRpemVkIHV2cyA9IDQ7CglvcHRpb25hbCBmYWNlc19zaW1wbGUgZmFjZXMgPSA1Owp9Cg==", "base64");
  12470. this.builder = a.loadProto(t),
  12471. this.decoder = this.builder.build("binary_mesh")
  12472. }
  12473. var o = e("three")
  12474. , a = e("protobufjs")
  12475. , s = e("../util/logger")
  12476. , l = (e("../util/common"),
  12477. e("../util/ajax"))
  12478. , c = e("../objects/Chunk")
  12479. , h = new s(n);
  12480. r.prototype = {
  12481. constructor: r,
  12482. load: function(e, t, i, n) {
  12483. return h.time("download"),
  12484. l.get(e, {
  12485. responseType: "arraybuffer"
  12486. }).done(function(r) {
  12487. h.timeEnd("download"),
  12488. this.parse(r, e, t, i, n)
  12489. }
  12490. .bind(this)).fail(n)
  12491. },
  12492. parse: function(e, t, i, n, r) {
  12493. var o = this.readProtobuf(e);
  12494. if (!o)
  12495. return r();
  12496. try {
  12497. h.time("convert to webgl"),
  12498. this.convertProtobufToSceneObject(o, t, i, n, r),
  12499. h.timeEnd("convert to webgl")
  12500. } catch (e) {
  12501. return h.error("failed parsing .dam"),
  12502. h.error(e.message),
  12503. r()
  12504. }
  12505. },
  12506. readProtobuf: function(e) {
  12507. var t;
  12508. try {
  12509. h.time("parse proto"),
  12510. t = this.decoder.decode(e),
  12511. h.timeEnd("parse proto")
  12512. } catch (e) {
  12513. return h.error("failed parsing proto for .dam"),
  12514. h.error(e.message),
  12515. null
  12516. }
  12517. return t
  12518. },
  12519. convertProtobufToSceneObject: function(e, t, i, n, r) {
  12520. function a(e) {
  12521. var i = new o.BufferGeometry;
  12522. return i.addAttribute("position", new o.BufferAttribute(new Float32Array(e.vertices.xyz,0,3),3)),
  12523. e.vertices.uv.length > 0 && i.addAttribute("uv", new o.BufferAttribute(new Float32Array(e.vertices.uv,0,2),2)),
  12524. i.setIndex(new o.BufferAttribute(new Uint32Array(e.faces.faces,0,1),1)),
  12525. i.applyMatrix(s),
  12526. i.computeBoundingBox(),
  12527. new c({
  12528. geometry: i,
  12529. textureName: e.material_name,
  12530. name: e.chunk_name,
  12531. meshUrl: t
  12532. })
  12533. }
  12534. if (0 === e.chunk.length)
  12535. return h.warn("No chunks in damfile..."),
  12536. i([]);
  12537. var s = new o.Matrix4;
  12538. s.set(1, 0, 0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1);
  12539. var l = e.chunk.map(a);
  12540. return l ? i(l) : (h.error(".dam protobuf came out with no chunks..."),
  12541. r())
  12542. }
  12543. },
  12544. t.exports = r
  12545. }
  12546. ).call(this, e("buffer").Buffer, "/js/loaders/DamLoader.js")
  12547. }
  12548. , {
  12549. "../objects/Chunk": 144,
  12550. "../util/ajax": 181,
  12551. "../util/common": 185,
  12552. "../util/logger": 189,
  12553. buffer: 198,
  12554. protobufjs: 214,
  12555. three: 217
  12556. }],
  12557. 105: [function(e, t, i) {
  12558. (function(i) {
  12559. "use strict";
  12560. var n = (e("three"),
  12561. e("../settings"),
  12562. e("../util/browser"),
  12563. e("./DamLoader"))
  12564. , r = e("../util/logger")
  12565. , o = (e("../ab"),
  12566. new r(i));
  12567. t.exports = {
  12568. getLoaders: function() {
  12569. return [["_50k", ".dam", n], ["", ".dam", n]]
  12570. },
  12571. load: function(e, t, i, n, r, a) {
  12572. var s = this.getLoaders();
  12573. a = a || 0;
  12574. var l = s[a];
  12575. if (!l)
  12576. return void (r && r("No suitable model file found..."));
  12577. var c = l[0]
  12578. , h = l[1]
  12579. , u = new l[2](t)
  12580. , d = t.get(e + c + h);
  12581. d ? (o.debug("Trying " + c + h),
  12582. u.load(d, i, n, function() {
  12583. this.load(e, t, i, n, r, ++a)
  12584. }
  12585. .bind(this))) : (o.debug("Skipping " + h + ", not available"),
  12586. this.load(e, t, i, n, r, ++a))
  12587. }
  12588. }
  12589. }
  12590. ).call(this, "/js/loaders/ModelLoader.js")
  12591. }
  12592. , {
  12593. "../ab": 3,
  12594. "../settings": 166,
  12595. "../util/browser": 182,
  12596. "../util/logger": 189,
  12597. "./DamLoader": 104,
  12598. three: 217
  12599. }],
  12600. 106: [function(e, t, i) {
  12601. (function(i) {
  12602. "use strict";
  12603. var n = e("../util/common")
  12604. , r = e("../util/texture")
  12605. , o = e("../util/browser")
  12606. , a = e("../util/logger")
  12607. , s = e("../settings")
  12608. , l = new a(i);
  12609. t.exports = {
  12610. load: function(e, t) {
  12611. function i(e, i) {
  12612. e || (t.push(i),
  12613. p++,
  12614. d.notify(p, a),
  12615. p === a && d.resolve())
  12616. }
  12617. if (!e.chunks[0] || !e.chunks[0].meshUrl)
  12618. return $.when();
  12619. var a = n.countUnique(e.chunks.map(function(e) {
  12620. return e.textureName
  12621. }))
  12622. , c = e.chunks[0].meshUrl.indexOf("_50k") !== -1 ? "_50k" : ""
  12623. , h = "_50k" === c ? "high" : "low";
  12624. s.minimalMemoryMode && "high" === h && (o.detectSamsungS6() ? (l.warn("Galaxy S6 cannot handle large textures, turning down quality."),
  12625. h = "low") : a > s.maxMobileTextures && (l.warn("Model probably too large for mobile, turning down quality."),
  12626. h = "low"));
  12627. var u = e.data.job.uuid + c + "_texture_jpg_" + h + "/"
  12628. , d = $.Deferred()
  12629. , p = 0;
  12630. return e.chunks.forEach(function(t) {
  12631. if (!t.material.map && t.textureName) {
  12632. var n = e.urls.get(u + t.textureName);
  12633. t.setTextureMap(r.load(n, i.bind(this, r.isLoaded(n))))
  12634. }
  12635. }),
  12636. d.promise()
  12637. }
  12638. }
  12639. }
  12640. ).call(this, "/js/loaders/ModelTextureLoader.js")
  12641. }
  12642. , {
  12643. "../settings": 166,
  12644. "../util/browser": 182,
  12645. "../util/common": 185,
  12646. "../util/logger": 189,
  12647. "../util/texture": 194
  12648. }],
  12649. 107: [function(e, t, i) {
  12650. (function(i, n) {
  12651. "use strict";
  12652. function r(e) {
  12653. this.model = e,
  12654. this.modelDataPath = this.model.urls.get("vision.modeldata")+"?m="+new Date().getTime(),
  12655. this.sweepLocationsPath = this.model.urls.get("sweep_locations.csv");
  12656. var t = i("Ly8gUHJvdG9jb2wgQnVmZmVyIGZvciBwdWNrIHZpc2liaWxpdHkgYW5kIHJlbGF0ZWQgZGF0YQovLwovLyBUbyBkdW1wIG91dCBhIGJpbnJheSBtYW5pZmVzdCBpbiB0ZXh0IGZvcm1hdCwgeW91IGNhbiB1c2UgcHJvdG9jIGRpcmVjdGx5OgovLyAgIHByb3RvYyAtLXByb3RvX3BhdGggfi9kZXYvbXBfdmlzaW9uLyAgLS1kZWNvZGU9ZW9zLnN0b3JhZ2UuVmlzaW9uTW9kZWxkYXRhIH4vZGV2L21wX3Zpc2lvbi9lb3Mvc3RvcmFnZS92aXNpb25fbW9kZWxkYXRhLnByb3RvIDwgdmlzaW9uLm1vZGVsZGF0YQoKLy8gcGFja2FnZSBlb3Muc3RvcmFnZTsKCi8vIGltcG9ydCAiZW9zL2luZnJhL2NvbW1vbi5wcm90byI7Ci8vIFRoZSBmb2xsb3dpbmcgd2VyZSBtYW51YWxseSBleHRyYWN0ZWQgaGVyZSwgSlMgZG9lcyBub3QgbGlrZSBwcm90b2J1ZiBpbXBvcnRzCgptZXNzYWdlIEFmZmluZTNmIHsKCW9wdGlvbmFsIFF1YXRlcm5pb25mIHJvdGF0aW9uID0gMTsKCW9wdGlvbmFsIFZlY3RvcjNmIHRyYW5zbGF0aW9uID0gMjsKfQoKbWVzc2FnZSBRdWF0ZXJuaW9uZiB7CglvcHRpb25hbCBmbG9hdCB3ID0gMTsKCW9wdGlvbmFsIGZsb2F0IHggPSAyOwoJb3B0aW9uYWwgZmxvYXQgeSA9IDM7CglvcHRpb25hbCBmbG9hdCB6ID0gNDsKfQoKbWVzc2FnZSBWZWN0b3IzZiB7CglvcHRpb25hbCBmbG9hdCB4ID0gMTsKCW9wdGlvbmFsIGZsb2F0IHkgPSAyOwoJb3B0aW9uYWwgZmxvYXQgeiA9IDM7Cn0KCi8vCi8vIE9uZSBzd2VlcCAvIHBhbm8KLy8KbWVzc2FnZSBTd2VlcExvY2F0aW9uIHsKCW9wdGlvbmFsIGJ5dGVzIHV1aWQgPSAxOyAgLyogdXVpZCAqLwoJb3B0aW9uYWwgQWZmaW5lM2YgcG9zZSA9IDI7ICAvKiBjYW1lcmEgcG9zZSAoeCwgeSx6KSBpbiBtZXRlciBhbmQgYSBxdWF0ZXJuaW9uKi8KCW9wdGlvbmFsIFZlY3RvcjNmIHB1Y2sgPSAzOyAgLyogcHVjayBsb2NhdGlvbiAtIHggYW55IGlzIGdlbmVyYWxseSB0aGUgc2FtZSBhcyBwb3NlLCB6IGlzIHRoZSBoZWlnaHQgb2YgdGhlIGNsb3Nlc3QgZmxvb3IgdW5kZXIgdGhlIGNhbWVyYSAqLwoJb3B0aW9uYWwgaW50MzIgZ3JvdXAgPSA0OyAgLyogZmxvb3IgaW5kZXggKi8KCW9wdGlvbmFsIGludDMyIHN1Ymdyb3VwID0gNTsgIC8qIHJvb20gaW5kZXggKi8KCXJlcGVhdGVkIGludDMyIHZpc2libGVzID0gNjsgIC8qIGxpc3Qgb2YgaW5kaWNlcyB0byBhbGwgcHVja3MgdmlzaWJsZSBmcm9tIHRoaXMgcHVjayAqLwoJcmVwZWF0ZWQgZmxvYXQgc2NvcmVzID0gNzsgLyogdXNlZCBhcyBwYXJ0IG9mIHNjb3JpbmcgZnVuY3Rpb24gZm9yIGRldGVybWluaW5nIHdoaWNoIHB1Y2sgdG8gZ28gdG8gbmV4dCAqLwogIG9wdGlvbmFsIHN0cmluZyBzd2VlcF9uYW1lID0gODsKCiAgLy8gV2l0aCBvdXRkb29yIHBhbm9zLCB3ZSBoYXZlIGEgY291cGxlIG9mIGRpZmZlcmVudCBzaXR1YXRpb25zIGZvciBhbGlnbm1lbnQuIFRoZSBjb21tb24KICAvLyBjYXNlIGlzIHRoYXQgdGhlIHBhbm8gYWxpZ25lZCBub3JtYWxseS4gSXQgY291bGQgYWxzbyBoYXZlIGJlZW4gcGxhY2VkIG1hbnVhbGx5IGluCiAgLy8gQ2FwdHVyZUFwcCBvciBXb3Jrc2hvcCwgb3IgbGVmdCB1bmFsaWduZWQgZm9yIGhpZ2hsaWdodC1yZWVsIHZpZXdpbmcuCiAgZW51bSBBbGlnbm1lbnRUeXBlCiAgewogICAgICBVTktOT1dOID0gMDsKICAgICAgQUxJR05FRCA9IDE7CiAgICAgIFVOQUxJR05FRCA9IDI7CiAgICAgIE1BTlVBTExZX1BMQUNFRCA9IDM7CiAgfQogIG9wdGlvbmFsIEFsaWdubWVudFR5cGUgYWxpZ25tZW50X3R5cGUgPSA5IFtkZWZhdWx0ID0gQUxJR05FRF07Cn0KCm1lc3NhZ2UgU3ViZ3JvdXBJbmZvIHsKCW9wdGlvbmFsIGludDMyIHN1Ymdyb3VwID0gMTsKCW9wdGlvbmFsIGZsb2F0IGFyZWEgPSAyOyAvKiBmbG9vciBhcmVhIGluIG1eMiAoc3F1YXJlIG1ldGVyYWdlKSAqLwp9CgovKiBBbGwgcHVja3MgaW4gYSBtb2RlbC4gUHVja3MgYXJlIHN0b3JlZCBpbiBzY2FubmluZyBvcmRlci4gKi8KbWVzc2FnZSBWaXNpb25Nb2RlbGRhdGEgewoJcmVwZWF0ZWQgU3dlZXBMb2NhdGlvbiBzd2VlcExvY2F0aW9ucyA9IDE7CglyZXBlYXRlZCBTdWJncm91cEluZm8gc3ViZ3JvdXBJbmZvcyA9IDI7Cn0K", "base64")
  12657. , n = o.loadProto(t);
  12658. this.decoder = n.build("VisionModeldata")
  12659. }
  12660. var o = e("protobufjs")
  12661. , a = e("../util/ajax")
  12662. , s = (e("../util/common"),
  12663. e("../util/math"))
  12664. , l = e("../util/logger")
  12665. , c = new l(n);
  12666. r.prototype.load = function() {
  12667. return this.modelDataPath ? (c.info("Using vision.modeldata"),
  12668. this.loadVisionModelData()) : this.sweepLocationsPath ? (c.warn("Using sweep_locations.csv"),
  12669. this.loadSweepLocationsCSV()) : (c.warn("No sweep file found"),
  12670. $.when([]))
  12671. }
  12672. ,
  12673. r.prototype.loadVisionModelData = function() {
  12674. return a.get(this.modelDataPath, {
  12675. responseType: "arraybuffer"
  12676. }).then(function(e) {
  12677. var t;
  12678. try {
  12679. t = this.decoder.decode(e)
  12680. } catch (e) {
  12681. return c.warn("Could not decode vision.modeldata, trying sweep_locations.csv"),
  12682. this.loadSweepLocationsCSV()
  12683. }
  12684. var i = t.sweepLocations.map(function(e) {
  12685. return {
  12686. uuid: e.uuid.toUTF8().replace(/-/g, ""),
  12687. position: {
  12688. x: e.pose.translation.x,
  12689. y: e.pose.translation.y,
  12690. z: e.pose.translation.z
  12691. },
  12692. quaternion: {
  12693. x: e.pose.rotation.x,
  12694. y: e.pose.rotation.y,
  12695. z: e.pose.rotation.z,
  12696. w: e.pose.rotation.w
  12697. },
  12698. puck: {
  12699. x: e.puck.x,
  12700. y: e.puck.y,
  12701. z: e.puck.z
  12702. },
  12703. floor: e.group,
  12704. neighbours: e.visibles,
  12705. alignmentType: e.alignment_type
  12706. }
  12707. }).map(function(e) {
  12708. return e.position = s.convertVisionVector(e.position),
  12709. e.quaternion = s.convertVisionQuaternion(e.quaternion),
  12710. e.puck = s.convertVisionVector(e.puck),
  12711. e
  12712. });
  12713. return i.forEach(function(e) {
  12714. e.neighbours = e.neighbours.map(function(e) {
  12715. return i[e].uuid
  12716. })
  12717. }),
  12718. i
  12719. }
  12720. .bind(this), function() {
  12721. return c.warn("Could not load vision.modeldata, trying sweep_locations.csv"),
  12722. this.loadSweepLocationsCSV()
  12723. }
  12724. .bind(this))
  12725. }
  12726. ,
  12727. r.prototype.loadSweepLocationsCSV = function() {
  12728. return a.get(this.sweepLocationsPath).then(function(e) {
  12729. var t = e.split("\n").map(function(e) {
  12730. return e.split(", ")
  12731. }).filter(function(e) {
  12732. return e.length > 1
  12733. }).map(function(e) {
  12734. return {
  12735. uuid: e[0],
  12736. position: {
  12737. x: parseFloat(e[1]),
  12738. y: parseFloat(e[2]),
  12739. z: parseFloat(e[3])
  12740. },
  12741. quaternion: {
  12742. x: parseFloat(e[4]),
  12743. y: parseFloat(e[5]),
  12744. z: parseFloat(e[6]),
  12745. w: parseFloat(e[7])
  12746. }
  12747. }
  12748. }).map(function(e) {
  12749. return e.position = s.convertVisionVector(e.position),
  12750. e.quaternion = s.convertVisionQuaternion(e.quaternion),
  12751. e
  12752. });
  12753. return t
  12754. }).fail(function() {
  12755. c.warn("Could not load sweep_locations.csv, no sweeps loaded.")
  12756. })
  12757. }
  12758. ,
  12759. t.exports = r
  12760. }
  12761. ).call(this, e("buffer").Buffer, "/js/loaders/SweepDataLoader.js")
  12762. }
  12763. , {
  12764. "../util/ajax": 181,
  12765. "../util/common": 185,
  12766. "../util/logger": 189,
  12767. "../util/math": 190,
  12768. buffer: 198,
  12769. protobufjs: 214
  12770. }],
  12771. 108: [function(e, t, i) {
  12772. (function(i) {
  12773. "use strict";
  12774. function n() {
  12775. this.locale = null
  12776. }
  12777. var r = e("../settings")
  12778. , o = e("../util/common")
  12779. , a = e("../util/logger")
  12780. , s = e("../enum/Locale")
  12781. , l = new a(i);
  12782. n.prototype.init = function() {
  12783. var t;
  12784. switch (r.languageTag) {
  12785. case null:
  12786. case "en":
  12787. case s.EN_US:
  12788. this.locale = s.EN_US,
  12789. t = e("./strings-en-US");
  12790. break;
  12791. case "es":
  12792. case s.ES_MX:
  12793. this.locale = s.ES_MX,
  12794. t = e("./strings-es-MX");
  12795. break;
  12796. case "fr":
  12797. case s.FR_FR:
  12798. this.locale = s.FR_FR,
  12799. t = e("./strings-fr-FR");
  12800. break;
  12801. case "de":
  12802. case s.DE_DE:
  12803. this.locale = s.DE_DE,
  12804. t = e("./strings-de-DE");
  12805. break;
  12806. case "ru":
  12807. case s.RU_RU:
  12808. this.locale = s.RU_RU,
  12809. t = e("./strings-ru-RU");
  12810. break;
  12811. case "cn":
  12812. case s.CN_CN:
  12813. this.locale = s.CN_CN,
  12814. t = e("./strings-cn-CN");
  12815. break;
  12816. case "jp":
  12817. case s.JP_JP:
  12818. this.locale = s.JP_JP,
  12819. t = e("./strings-jp-JP");
  12820. break;
  12821. default:
  12822. l.info("Unsupported language tag, defaulting to 'en-US'"),
  12823. this.locale = s.EN_US,
  12824. t = e("./strings-en-US")
  12825. }
  12826. l.info("Using locale '" + this.locale + "'"),
  12827. o.extendObject(this, t)
  12828. }
  12829. ,
  12830. n.prototype.localizeGUI = function() {
  12831. var e = document.querySelector("#gui-parent");
  12832. this.localizeTree(e),
  12833. this.localizeLoadingText()
  12834. }
  12835. ,
  12836. n.prototype.localizeLoadingText = function() {
  12837. // var e = document.querySelector("#loader-cont")
  12838. // , t = e.getAttribute("title");
  12839. // e.removeAttribute("title"),
  12840. // e.setAttribute("data-status", t),
  12841. // e.classList.add(this.locale),
  12842. document.querySelector("#help-dialog").classList.add(this.locale),
  12843. document.querySelector("#interaction-modal").classList.add(this.locale),
  12844. document.querySelector("#gui").classList.add(this.locale);
  12845. }
  12846. ,
  12847. n.prototype.localizeTree = function(e) {
  12848. var t, i, n = /{\[{ ?(\w+) ?}\]}/;
  12849. if (e.nodeType === Node.TEXT_NODE)
  12850. t = e.data.match(n),
  12851. t && (i = t[1],
  12852. e.data = this.localizeText(i) || i);
  12853. else if (e.nodeType === Node.ELEMENT_NODE) {
  12854. var r = e.getAttribute("title");
  12855. r && (t = r.match(n),
  12856. t && (i = t[1],
  12857. e.setAttribute("title", this.localizeText(i) || i)))
  12858. }
  12859. for (e = e.firstChild; e; )
  12860. this.localizeTree(e),
  12861. e = e.nextSibling
  12862. }
  12863. ,
  12864. n.prototype.localizeText = function(t) {
  12865. var i = this[t];
  12866. return i || this.locale === s.EN_US || (l.warn("Localization key '" + t + "' not available for locale '" + this.locale + "', defaulting to English."),
  12867. i = e("./strings-en-US")[t]),
  12868. i || l.warn("Localization key '" + t + "' not available for locale 'en-US'"),
  12869. i
  12870. }
  12871. ,
  12872. t.exports = new n
  12873. }
  12874. ).call(this, "/js/localization/localize.js")
  12875. }
  12876. , {
  12877. "../enum/Locale": 31,
  12878. "../settings": 166,
  12879. "../util/common": 185,
  12880. "../util/logger": 189,
  12881. "./strings-cn-CN": 109,
  12882. "./strings-de-DE": 110,
  12883. "./strings-en-US": 111,
  12884. "./strings-es-MX": 112,
  12885. "./strings-fr-FR": 113,
  12886. "./strings-jp-JP": 114,
  12887. "./strings-ru-RU": 115
  12888. }],
  12889. 109: [function(e, t, i) {
  12890. "use strict";
  12891. t.exports = {
  12892. PAGE_TITLE: "",
  12893. LOADING: "正在加载",
  12894. PRESENTED_BY_CAPS: "呈现者:",
  12895. POWERED_BY: "技术支持:",
  12896. POWERED_BY_CAPS: "技术支持:",
  12897. DESKTOP_SHORT_CTA: "点击一次以探索这个 3D 空间。",
  12898. MOBILE_SHORT_CTA: "点击一次以探索这个 3D 空间。",
  12899. PRESENTED_BY: "呈现者:",
  12900. MORE: "更多 ",
  12901. LESS: "更少 ",
  12902. TAG_CONTENT: "tag™ 内容",
  12903. SHOW: "显示",
  12904. HIDE: "隐藏",
  12905. DOLLHOUSE: "场景屋",
  12906. FLOOR_PLAN: "楼层平面图",
  12907. OPEN_HIGHLIGHTS: "打开精彩片段",
  12908. CLOSE_HIGHLIGHTS: "关闭",
  12909. PREVIOUS: "上一个",
  12910. PLAY: "播放",
  12911. PAUSE: "暂停",
  12912. NEXT: "下一个",
  12913. EXPLORE_3D_SPACE: "探索 3D 空间",
  12914. VIEW_DOLLHOUSE: "观看场景屋",
  12915. SOCIAL_SHARING: "分享这个空间",
  12916. VIEW_IN_VR: "以 VR 观看",
  12917. VIEW_FULLSCREEN: "全屏观看",
  12918. EXIT_FULLSCREEN: " 退出全屏",
  12919. ZOOM_IN: "放大",
  12920. ZOOM_OUT: "缩小",
  12921. FLOOR_NAME: "楼层",
  12922. FLOOR_ALL: "ALL",
  12923. FLOOR_Lang: ["Floor",""],
  12924. TERMS: "条款",
  12925. PORT_TERMS: "port 条款",
  12926. TERMS_OF_USE: "使用条款",
  12927. CLOSE_TERMS: "关闭",
  12928. TERMS_TEXT_FILE: "terms-cn-CN.html",
  12929. TERMS_FAIL: "无法获取条款。请确保您有互联网连接以查看使用条款。",
  12930. WEBVR_FOR_DAYDREAM: "用于 Daydream 视图",
  12931. WEBVR_ENTER_WEBVR: "进入 VR",
  12932. WEBVR_DIFFERENT_HEADSET: "有其他耳机吗?",
  12933. WEBVR_LEARN_MORE: "了解更多",
  12934. WEBVR_VIEW_SPACE: "在 VR 中观看空间",
  12935. WEBVR_DAYDREAM_VIEW: "Daydream 视图",
  12936. WEBVR_DAYDREAM_PHONE: "支持 Daydream 的手机",
  12937. WEBVR_FOR_CARDBOARD: "用于 Google Cardboard",
  12938. WEBVR_VIEW_CARDBOARD: "或在 Google Cardboard 上观看",
  12939. VR_VIEW_SPACE: "在虚拟现实中观看空间",
  12940. VR_LEARN_MORE_CAPS: "了解更多",
  12941. VR_PREVIOUS_CAPS: "上一个’,",
  12942. VR_NEXT_CAPS: "下一个",
  12943. VR_GOT_IT_CAPS: "明白了",
  12944. VR_SHOW_SUPPORTED: "点击以使用 VR 观看空间",
  12945. VR_SHOW_UNSUPPORTED: "很遗憾,您的设备不符合在 VR 中观看空间的最低要求。",
  12946. VR_SHOW_IOS_1: "点击以使用 VR 观看空间",
  12947. VR_SHOW_IOS_2: "需要有 port VR 应用程序和兼容的 iPhone 才能观看",
  12948. VR_WHAT_YOU_NEED: "关于...您需要什么",
  12949. VR_NEED_CARDBOARD: "您使用 Google Cardboard 时需要什么",
  12950. VR_NEED_SAMSUNG: "您使用 Samsung Gear VR 时需要什么",
  12951. VR_NEED_DAYDREAM: "需要事先与 DAYDREAM VIEW 配对",
  12952. VR_NEED_DAYDREAM_PHONE: "支持 Daydream 的手机",
  12953. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  12954. VR_GOOGLE_DAYDREAM: "Google Daydream",
  12955. VR_APP: "port VR 应用程序",
  12956. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  12957. VR_COMPATIBLE_IPHONES_1: "iPhones",
  12958. VR_COMPATIBLE_IPHONES_2: "iPhone 5s 和更高版本,运行 iOS 9.1 和更高版本",
  12959. VR_COMPATIBLE_IPHONES_3: "兼容的 iPhone",
  12960. VR_COMPATIBLE_ANDROID: "兼容的 Android 设备",
  12961. VR_COMPATIBLE_ANDROID_LONG: "4.5-5.5 英寸、运行 Android OS 4.4.4 和更高版本的兼容型 Android 设备显示屏",
  12962. VR_ANDROID_DETAIL: "4.5 至 5.5 英寸、运行 Android OS 4.4.4 和更高版本的显示屏",
  12963. VR_ANDROID_DVICES: "Android 设备",
  12964. VR_COMPATIBLE_SAMSUNG: "兼容的 Samsung 设备",
  12965. VR_SAMSUNG_DETAIL: "Galaxy S6 和更高版本",
  12966. VR_APP_FOR_CARDBOARD: "用于 Google Cardboard 的 port VR 应用程序",
  12967. VR_APP_FOR_SAMSUNG: "用于 Gear VR 的 port VR 应用程序",
  12968. VR_APP_FOR_ANDROID: "用于 Android 手机的 port VR 应用程序",
  12969. VR_APP_OPEN: "请使用 port VR 应用程序打开",
  12970. VR_DOWNLOAD_HERE: "在此下载",
  12971. VR_REQUIRE_HEADSET: "需要一副 VR 耳机并安装用于 Android 的 port VR 应用程序",
  12972. VR_REDIRECT_TO_STORE: "如果未安装应用程序,您将跳转到应用程序商店。",
  12973. VR_IMPROPER_EMBED: "port 空间未正确嵌入,无法在您的 Web 浏览器支持 VR。",
  12974. VR_OPEN_ANDROID_LINK: "在您的手机上打开链接",
  12975. VR_ANDROID_OPTIONS: "可用的 VR 耳机选项",
  12976. SHARE_TO: "分享到",
  12977. SHARE_LINK: "直接链接",
  12978. SHARE_EXPLORE: "探索",
  12979. SHARE_AT: "在",
  12980. SHARE_WITH: "使用",
  12981. SHARE_3D: "以 3D",
  12982. SHARE_COPIED: "已复制!",
  12983. ERROR_BROWSER_SOLUTION: "安装更新的浏览器以探索 3D。",
  12984. ERROR_BROWSER_EXPLANATION: "WebGL 需要现代的浏览器。",
  12985. ERROR_GENERIC_PROBLEM: "糟糕,出现问题。",
  12986. ERROR_GENERIC_SOLUTION: "重新启动您的浏览器。",
  12987. ERROR_GENERIC_ACTIONS_1: "如果问题仍然存在,",
  12988. ERROR_GENERIC_ACTIONS_2: "请安装支持的浏览器",
  12989. ERROR_GENERIC_ACTIONS_3: " 或",
  12990. ERROR_GENERIC_ACTIONS_4: "查看我们的故障排除指南",
  12991. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "浏览器不受支持。",
  12992. ERROR_WEBGL_IOS_PROBLEM: "iOS 版本不受支持。",
  12993. ERROR_WEBGL_IOS_SOLUTION: "升级到 iOS 8 或更高版本以在 3D 中探索。",
  12994. ERROR_WEBGL_IOS_ACTIONS_1: "点击 ",
  12995. ERROR_WEBGL_IOS_ACTIONS_2: "设置 > 通用 > 软件更新",
  12996. ERROR_WEBGL_SAFARI_PROBLEM: "启用 WebGL 以在 3D 中探索。",
  12997. ERROR_WEBGL_SAFARI_ACTIONS_1: "单击",
  12998. ERROR_WEBGL_SAFARI_ACTIONS_2: "菜单栏中的首选项 > 高级 > 显示开发菜单",
  12999. ERROR_WEBGL_SAFARI_ACTIONS_3: "然后单击",
  13000. ERROR_WEBGL_SAFARI_ACTIONS_4: "开发 > 启用 WebGL",
  13001. ERROR_MISSING_URLS_PROBLEM: "糟糕,没有此模型的全景。",
  13002. ERROR_MISSING_URLS_EXPLANATION: "这是较早的模型。网站所有者可能正在开发一种新模型。",
  13003. ERROR_LOADING_FAILED_PROBLEM: "糟糕,模式不可用。",
  13004. ERROR_LOADING_FAILED_ACTIONS_1: "如果问题仍然存在,",
  13005. ERROR_LOADING_FAILED_ACTIONS_2: "查看我们的故障排除指南",
  13006. ERROR_MAINTENANCE_PROBLEM: "正在进行维护",
  13007. ERROR_MAINTENANCE_SOLUTION: "请过几分钟再来。",
  13008. LINK_TO_LOCATION: "地点链接",
  13009. MENU_COPY: "复制",
  13010. LINK_ALERT_COPY: "请使用 CTRL/CMD + C 复制。",
  13011. ROTATE: "旋转",
  13012. MOVE: "移动",
  13013. INSIDE: "内部",
  13014. ZOOM: "缩放",
  13015. HELP: "小帮手",
  13016. HELP_NAVIGATION_TAB: "导航",
  13017. HELP_MORE_HELP_TAB: "更多帮助",
  13018. HELP_DESKTOP_PANORAMA_1A: "单击并拖动以环顾空间。",
  13019. HELP_DESKTOP_PANORAMA_2A: "单击整个空间内的圆环以四处移动。",
  13020. HELP_DESKTOP_PANORAMA_3A: "使用鼠标滚轮来放大和缩小。",
  13021. HELP_DESKTOP_PANORAMA_1B: "或者,使用箭头键向左向右转。",
  13022. HELP_DESKTOP_PANORAMA_2B: "或者,使用箭头键向前移动和向后移动。",
  13023. HELP_DESKTOP_PANORAMA_3B: "或者,使用加号和减号键来放大和缩小。",
  13024. HELP_DESKTOP_360_2A: "单击内部视图图标以进入空间。",
  13025. HELP_DESKTOP_360_2B: "或者,按 1 号键进入内部视图。 ",
  13026. HELP_DESKTOP_DOLLHOUSE_1A: "左键单击并向左、向右、向上和向下拖动以旋转场景屋。",
  13027. HELP_DESKTOP_DOLLHOUSE_2A: "右键单击并向左、向右、向上和向下拖动以改变场景屋在屏幕上的位置。",
  13028. HELP_DESKTOP_DOLLHOUSE_3A: "使用鼠标滚轮来放大和缩小。",
  13029. HELP_DESKTOP_DOLLHOUSE_1B: "或者,使用箭头键来旋转场景屋。",
  13030. HELP_DESKTOP_FLOORPLAN_1A: "左键单击并向左、向右、向上和向下拖动以改变楼层平面图在屏幕上的位置。",
  13031. HELP_DESKTOP_FLOORPLAN_2A: "右键单击并向左或向右拖动以旋转楼层平面图。",
  13032. HELP_DESKTOP_FLOORPLAN_3A: "使用鼠标滚轮来放大和缩小。",
  13033. HELP_DESKTOP_FLOORPLAN_2B: "或者,使用箭头键以向左或向右旋转。",
  13034. HELP_DESKTOP_FLOORPLAN_3B: "或者,使用箭头键来放大和缩小。",
  13035. HELP_MOBILE_PANORAMA_1: "触摸并拖动以环顾空间。",
  13036. HELP_MOBILE_PANORAMA_2: "点击整个空间内的圆环以四处移动。",
  13037. HELP_MOBILE_3: "使用捏合手势来放大和缩小。",
  13038. HELP_MOBILE_360_2: "点击内部视图图标以进入空间。",
  13039. HELP_MOBILE_DOLLHOUSE_1: "触摸并向上、向下、向左和向右拖动以旋转场景屋。",
  13040. HELP_MOBILE_DOLLHOUSE_2: "用两指触摸并拖动以定位场景屋。",
  13041. HELP_MOBILE_FLOORPLAN_1: "触摸并拖动以定位楼层平面图。",
  13042. HELP_MOBILE_FLOORPLAN_2: "用两指触摸并拖动以旋转楼层平面图。",
  13043. HELP_MORE_HLR_A: "精彩片段集锦",
  13044. HELP_DESKTOP_MORE_HLR_B: "打开以使用缩略图图像在空间中流览。",
  13045. HELP_MORE_DOLLHOUSE_A: "场景屋",
  13046. HELP_DESKTOP_MORE_DOLLHOUSE_B: "单击以查看和旋转 3D 内整个空间的俯视图。",
  13047. HELP_MOBILE_MORE_DOLLHOUSE_B: "点击以查看和旋转 3D 内整个空间的俯视图。",
  13048. HELP_MORE_FLOORS_A: "楼层选择器",
  13049. HELP_DESKTOP_MORE_FLOORS_B: "在空间中的楼层之间切换。",
  13050. HELP_MORE_TAG_A: "tag™ 贴文",
  13051. HELP_DESKTOP_MORE_TAG_B: "单击或悬停鼠标以查看空间中的功能信息。",
  13052. HELP_MOBILE_MORE_TAG_B: "点击以查看空间中的功能信息。",
  13053. HELP_MORE_ZOOM_A: "缩放控件",
  13054. HELP_DESKTOP_MORE_ZOOM_B: "使用这些控件来放大和缩小或使用滚轮。",
  13055. HELP_MORE_TOUR_A: "导览控件",
  13056. HELP_DESKTOP_MORE_TOUR_B: "通过导览播放、暂停以及向前和向后流览。",
  13057. HELP_MORE_INSIDE_A: "内部视图",
  13058. HELP_DESKTOP_MORE_INSIDE_B: "单击以探索空间内部。",
  13059. HELP_MOBILE_MORE_INSIDE_B: "点击以探索空间内部。",
  13060. HELP_MORE_VR_A: "VR 模式",
  13061. HELP_DESKTOP_MORE_VR_B: "单击以在虚拟现实中启动空间。",
  13062. HELP_MOBILE_MORE_VR_B: "点击以在虚拟现实中启动空间。",
  13063. HELP_MORE_360_A: "360° 视图",
  13064. HELP_DESKTOP_MORE_360_B: "单击精彩片段集锦中的 360 视图中以观看室外场景。",
  13065. HELP_MOBILE_MORE_360_B: "点击精彩片段集锦中的 360 视图中以观看室外场景。",
  13066. HELP_MORE_FULLSCREEN_A: "全屏",
  13067. HELP_DESKTOP_MORE_FULLSCREEN_B: "将 3D Showcase 扩展到全屏。",
  13068. CLOSE: "关闭"
  13069. }
  13070. }
  13071. , {}],
  13072. 110: [function(e, t, i) {
  13073. "use strict";
  13074. t.exports = {
  13075. PAGE_TITLE: "",
  13076. LOADING: "Lädt",
  13077. PRESENTED_BY_CAPS: "PRÄSENTIERT VON",
  13078. POWERED_BY: "Angetrieben von",
  13079. POWERED_BY_CAPS: "ANGETRIEBEN VON",
  13080. DESKTOP_SHORT_CTA: "Sehen sie sich in diesem 3D Raum um.",
  13081. MOBILE_SHORT_CTA: "Sehen sie sich in diesem 3D Raum um.",
  13082. PRESENTED_BY: "Präsentiert von ",
  13083. MORE: "Mehr ",
  13084. LESS: "Weniger ",
  13085. TAG_CONTENT: "tag™ Inhalt",
  13086. SHOW: "Anzeigen",
  13087. HIDE: "Verbergen",
  13088. DOLLHOUSE: "Puppenhaus",
  13089. FLOOR_PLAN: "Grundriss",
  13090. OPEN_HIGHLIGHTS: "Highlights anzeigen",
  13091. CLOSE_HIGHLIGHTS: "Schließen",
  13092. PREVIOUS: "Vorheriges",
  13093. PLAY: "Abspielen",
  13094. PAUSE: "Pausieren",
  13095. NEXT: "Nächstes",
  13096. EXPLORE_3D_SPACE: "Innenraum betreten",
  13097. VIEW_DOLLHOUSE: "Puppenhaus ansehen",
  13098. SOCIAL_SHARING: "Teilen Sie diesen Raum",
  13099. VIEW_IN_VR: "In VR ansehen",
  13100. VIEW_FULLSCREEN: "Ansicht im Vollbildmodus",
  13101. EXIT_FULLSCREEN: "Beenden des Vollbildmodus",
  13102. ZOOM_IN: "Vergrößern",
  13103. ZOOM_OUT: "Verkleinern",
  13104. FLOOR_NAME: "Etage ",
  13105. FLOOR_ALL: "Alle",
  13106. TERMS: "Bedingungen",
  13107. PORT_TERMS: "port Bedingungen",
  13108. TERMS_OF_USE: "Nutzungsbedingungen",
  13109. TERMS_TEXT_FILE: "terms-de-DE.html",
  13110. CLOSE_TERMS: "Schließen",
  13111. TERMS_FAIL: "Konnte die Nutzungsbedingungen nicht abrufen. Bitte stellen Sie sicher, dass Sie zum Internet verbunden sind.",
  13112. HELP: "Hilfe",
  13113. HELP_NAVIGATION_TAB: "Navigation",
  13114. HELP_MORE_HELP_TAB: "Hilfe-Details",
  13115. CLOSE: "Schließen",
  13116. HELP_DESKTOP_PANORAMA_1A: "Klicken und ziehen Sie um sich im Raum umzusehen.",
  13117. HELP_DESKTOP_PANORAMA_2A: "Klicken Sie auf die Ringe im Raum um sich zu bewegen.",
  13118. HELP_DESKTOP_PANORAMA_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  13119. HELP_DESKTOP_PANORAMA_1B: "Oder verwenden Sie die Pfeiltasten um sich nach links und rechts zu bewegen.",
  13120. HELP_DESKTOP_PANORAMA_2B: "Oder verwenden Sie die Pfeiltasten um sich vorwärts und rückwärts zubewegen.",
  13121. HELP_DESKTOP_PANORAMA_3B: "Oder verwenden Sie die Plus- und Minus-Tasten zum Vergrößern und Verkleinern.",
  13122. HELP_DESKTOP_360_2A: "Klicken Sie die Innenansicht ikone, um diesen Raum zu starten .",
  13123. HELP_DESKTOP_360_2B: "Oder, drücken Sie die 1-Taste um die Innenraumansicht zu starten.",
  13124. HELP_DESKTOP_DOLLHOUSE_1A: "Klicken Sie mit der linken Maustaste und ziehen Sie nach links, rechts, oben und unten um das Puppenhaus zu drehen.",
  13125. 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.",
  13126. HELP_DESKTOP_DOLLHOUSE_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  13127. HELP_DESKTOP_DOLLHOUSE_1B: "Oder verwenden Sie die Pfeiltasten um das Puppenhaus zu drehen.",
  13128. 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.",
  13129. HELP_DESKTOP_FLOORPLAN_2A: "Klicken Sie mit der rechten Maustaste und ziehen Sie nach links oder rechts um den Grundriss zu drehen.",
  13130. HELP_DESKTOP_FLOORPLAN_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  13131. HELP_DESKTOP_FLOORPLAN_2B: "Oder verwenden Sie die Pfeiltasten um das Modell nach links oder rechts zu drehen.",
  13132. HELP_DESKTOP_FLOORPLAN_3B: "Oder verwenden Sie die Pfeiltasten zum Vergrößern und Verkleinern.",
  13133. HELP_MOBILE_PANORAMA_1: "Berühren und ziehen an dem Raum um sich umzusehen.",
  13134. HELP_MOBILE_PANORAMA_2: "Klicken Sie auf die Ringe im Raum, um sich zu bewegen.",
  13135. HELP_MOBILE_3: "Benutzen Sie die Zoom-Gäste zum Vergrößern und Verkleinern.",
  13136. HELP_MOBILE_360_2: "Tippen Sie die Innenansicht ikone, um diesen Raum zu starten.",
  13137. HELP_MOBILE_DOLLHOUSE_1: "Berühren und nach oben, unten, links und rechts ziehen um das Puppenhaus zu drehen.",
  13138. HELP_MOBILE_DOLLHOUSE_2: "Berühren und mit zwei Fingern ziehen um das Puppenhaus zu positionieren.",
  13139. HELP_MOBILE_FLOORPLAN_1: "Berühren und ziehen, um den Grundriss zu positionieren.",
  13140. HELP_MOBILE_FLOORPLAN_2: "Berühren und ziehen mit zwei Fingern, um den Grundriss zu drehen.",
  13141. HELP_MORE_HLR_A: "Liste das Highlight",
  13142. HELP_DESKTOP_MORE_HLR_B: "Öffnen um durch den Raum mit Vorschau-Bildern zu navigieren.",
  13143. HELP_MORE_DOLLHOUSE_A: "Puppenhaus Ansicht",
  13144. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Klicken Sie um die von oben nach unten Sicht des gesamten Raumes in 3D anzuzeigen und zu drehen.",
  13145. HELP_MOBILE_MORE_DOLLHOUSE_B: "Tippen Sie um die von oben nach unten Sicht des gesamten Raumes in 3D anzuzeigen und zu drehen.",
  13146. HELP_MORE_FLOORS_A: "Etage auswählen",
  13147. HELP_DESKTOP_MORE_FLOORS_B: "Zwischen den Etagen im Raum wechseln.",
  13148. HELP_MORE_TAG_A: "tag™ Posts",
  13149. HELP_DESKTOP_MORE_TAG_B: "Klicken Sie auf oder bewegen Sie Ihren Mauszeiger über die Informationen über die Funktionen im Raum.",
  13150. HELP_MOBILE_MORE_TAG_B: "Tippen Sie für Informationen über die Funktionen im Raum.",
  13151. HELP_MORE_ZOOM_A: "Zoom Steuerung",
  13152. HELP_DESKTOP_MORE_ZOOM_B: "Verwenden Sie diese Steuerung oder das Scrollrad zum Vergrößern und Verkleinern.",
  13153. HELP_MORE_TOUR_A: "Tour Steuerung",
  13154. HELP_DESKTOP_MORE_TOUR_B: "Abspielen, pausieren und vorwärts und rückwärts durch eine geführte Tour navigieren.",
  13155. HELP_MORE_INSIDE_A: "Innenansicht",
  13156. HELP_DESKTOP_MORE_INSIDE_B: "Klicken Sie hier um sich im Raum umzusehen.",
  13157. HELP_MOBILE_MORE_INSIDE_B: "Sehen Sie sich in diesen 3D Raum um.",
  13158. HELP_MORE_VR_A: "VR Modus",
  13159. HELP_DESKTOP_MORE_VR_B: "Klicken Sie hier, um den Raum in der virtuellen Realität zu starten.",
  13160. HELP_MOBILE_MORE_VR_B: "Tippen Sie um den Raum in der virtuellen Realität zu starten.",
  13161. HELP_MORE_360_A: "360° Views Ansicht ",
  13162. HELP_DESKTOP_MORE_360_B: "Klicken Sie die 360° Views Ansicht in das Highlight um Aussen-Szenen zu sehen.",
  13163. HELP_MOBILE_MORE_360_B: "Tippen Sie die 360° Views Ansicht in das Highlight um Aussen-Szenen zu sehen.",
  13164. HELP_MORE_FULLSCREEN_A: "Vollbild",
  13165. HELP_DESKTOP_MORE_FULLSCREEN_B: "Erweitern Sie 3D Showcase im Vollbildmodus.",
  13166. WEBVR_FOR_CARDBOARD: "Für Google Cardboard",
  13167. WEBVR_FOR_DAYDREAM: "Für Daydream View",
  13168. WEBVR_ENTER_WEBVR: "Starten Sie VR",
  13169. WEBVR_DIFFERENT_HEADSET: "Haben Sie anderes Headset?",
  13170. WEBVR_LEARN_MORE: "Mehr Infos",
  13171. WEBVR_VIEW_SPACE: "Ansicht des Raumes in VR",
  13172. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13173. WEBVR_DAYDREAM_PHONE: "Daydream-fähiges Handy",
  13174. WEBVR_VIEW_CARDBOARD: "Oder mit Google Cardboard ansehen",
  13175. VR_WHAT_YOU_NEED: "Was Sie dafür brauchen...",
  13176. VR_NEED_DAYDREAM_PHONE: "Daydream-fähiges Handy",
  13177. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13178. VR_APP: "port VR App",
  13179. VR_APP_OPEN: "Oder öffnen Sie die port VR App",
  13180. 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",
  13181. VR_SAMSUNG_DETAIL: "Galaxy S6 und neuer",
  13182. VR_APP_FOR_ANDROID: "port VR app für Android",
  13183. VR_NEED_DAYDREAM: "ERFORDERT VOR DER 'PAIRING' MIT DAYDREAM VIEW",
  13184. VR_VIEW_SPACE: "Ansicht des Raumes in VR",
  13185. VR_LEARN_MORE_CAPS: "MEHR INFOS",
  13186. VR_PREVIOUS_CAPS: "ZURÜCK",
  13187. VR_NEXT_CAPS: "WEITER",
  13188. VR_GOT_IT_CAPS: "VERSTANDEN",
  13189. VR_SHOW_SUPPORTED: "Tippen Sie um den Raum in VR zu sehen",
  13190. VR_SHOW_UNSUPPORTED: "Schade, aber Ihr Gerät erfüllt nicht die Mindestanforderungen um den Raum in VR zu sehen.",
  13191. VR_SHOW_IOS_1: "Tippen Sie um den Raum in VR zu sehen",
  13192. VR_SHOW_IOS_2: "port VR App sowie kompatibles iPhone sind von nöten um diesen Raum zu sehen",
  13193. VR_NEED_CARDBOARD: "Was Sie dafür brauchen ist Google Cardboard",
  13194. VR_NEED_SAMSUNG: "Was Sie dafür brauchen ist Samsung Gear VR",
  13195. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13196. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13197. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13198. VR_COMPATIBLE_IPHONES_2: "iPhone 5s oder neuer, mit iOS 9.1 und später",
  13199. VR_COMPATIBLE_IPHONES_3: "Kompatibles iPhones",
  13200. VR_COMPATIBLE_ANDROID: "Kompatibles Android Gerät",
  13201. VR_ANDROID_DETAIL: "Bildschirmdiagonale von 11,5 bis 14 cm (4,5 - 5,5 Zoll) und Android 4.4.4 und neuer",
  13202. VR_ANDROID_DVICES: "Android Geräte",
  13203. VR_COMPATIBLE_SAMSUNG: "Kompatible Samsung Geräte",
  13204. VR_APP_FOR_CARDBOARD: "port VR App für Google Cardboard",
  13205. VR_APP_FOR_SAMSUNG: "port VR App für Gear VR",
  13206. VR_DOWNLOAD_HERE: "Hier runterladen",
  13207. VR_REQUIRE_HEADSET: "Benötigt das ein VR-Headset und port VR App für Android installiert wird",
  13208. VR_REDIRECT_TO_STORE: "Wenn App nicht installiert ist, werden Sie zum App Store umgeleitet.",
  13209. VR_IMPROPER_EMBED: "Der port Raum ist nicht richtig eingebettet um VR in Ihrem Webbrowser zu unterstützen.",
  13210. VR_OPEN_ANDROID_LINK: "Öffnen Sie den Link auf Ihrem Handy",
  13211. VR_ANDROID_OPTIONS: "VR Headset Optionen",
  13212. SHARE_TO: "Teilen auf",
  13213. SHARE_LINK: "Direkter Link",
  13214. SHARE_EXPLORE: "Umsehen",
  13215. SHARE_AT: "auf",
  13216. SHARE_WITH: "mit",
  13217. SHARE_3D: "in 3D",
  13218. SHARE_COPIED: "Kopiert!",
  13219. ERROR_BROWSER_SOLUTION: "Installieren Sie einen neueren Browser um sich in 3D umzusehen.",
  13220. ERROR_BROWSER_EXPLANATION: "WebGL benötigt einen modernen Browser.",
  13221. ERROR_GENERIC_PROBLEM: "Huch, etwas ist schief gelaufen.",
  13222. ERROR_GENERIC_SOLUTION: "Starten Sie Ihren Browser neu.",
  13223. ERROR_GENERIC_ACTIONS_1: "Wenn das Problem weiterhin besteht, ",
  13224. ERROR_GENERIC_ACTIONS_2: "Installieren Sie einen unterstützten Browser",
  13225. ERROR_GENERIC_ACTIONS_3: " oder ",
  13226. ERROR_GENERIC_ACTIONS_4: "Sehen Sie unseren Leitfaden zur Fehlerbehebung",
  13227. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Browser wird nicht unterstützt.",
  13228. ERROR_WEBGL_IOS_PROBLEM: "iOS-Version wird nicht unterstützt.",
  13229. ERROR_WEBGL_IOS_SOLUTION: "Aktualisieren Sie auf iOS 8 oder neuer um sich in 3D umzusehen.",
  13230. ERROR_WEBGL_IOS_ACTIONS_1: "Tippen ",
  13231. ERROR_WEBGL_IOS_ACTIONS_2: "Einstellungen > Allgemein > Softwareaktualisierung",
  13232. ERROR_WEBGL_SAFARI_PROBLEM: "Aktivieren Sie WebVR um sich in 3D umzusehen.",
  13233. ERROR_WEBGL_SAFARI_ACTIONS_1: "Klicken ",
  13234. ERROR_WEBGL_SAFARI_ACTIONS_2: "Präferenzen > Fortgeschrittene > Entwickler-Menü anzeigen",
  13235. ERROR_WEBGL_SAFARI_ACTIONS_3: "Klicken Sie dann ",
  13236. ERROR_WEBGL_SAFARI_ACTIONS_4: "Entwickler > WebGL Aktivieren",
  13237. ERROR_MISSING_URLS_PROBLEM: "Huch, es gibt keine Panoramen für dieses Modell .",
  13238. ERROR_MISSING_URLS_EXPLANATION: "Dies ist ein älteres Modell. Der Website-Besitzer hat eventuell ein neues Modell in Arbeit.",
  13239. ERROR_LOADING_FAILED_PROBLEM: "Huch, das Modell ist nicht verfügbar.",
  13240. ERROR_LOADING_FAILED_ACTIONS_1: "Wenn das Problem weiterhin besteht, ",
  13241. ERROR_LOADING_FAILED_ACTIONS_2: "sehen Sie unseren Leitfaden zur Fehlerbehebung",
  13242. ERROR_MAINTENANCE_PROBLEM: "Wartung im Gange.",
  13243. ERROR_MAINTENANCE_SOLUTION: "Bitte versuchen Sie es in ein paar Minuten nochmal.",
  13244. LINK_TO_LOCATION: "Link zu",
  13245. MENU_COPY: "Kopieren",
  13246. LINK_ALERT_COPY: "Bitte benutzen Sie CTRL/CMD + C zum kopieren.",
  13247. ROTATE: "Drehen",
  13248. INSIDE: "Drinnen",
  13249. MOVE: "Bewegen",
  13250. ZOOM: "Vergrößern"
  13251. }
  13252. }
  13253. , {}],
  13254. 111: [function(e, t, i) {
  13255. "use strict";
  13256. t.exports = {
  13257. PAGE_TITLE: "",
  13258. LOADING: "Loading",
  13259. PRESENTED_BY_CAPS: "PRESENTED BY",
  13260. POWERED_BY: "powered by ",
  13261. POWERED_BY_CAPS: "POWERED BY",
  13262. DESKTOP_SHORT_CTA: "Click to explore this 3D space.",
  13263. MOBILE_SHORT_CTA: "Tap to explore this 3D space.",
  13264. PRESENTED_BY: "Presented by ",
  13265. MORE: "More ",
  13266. LESS: "Less ",
  13267. TAG_CONTENT: "tag™ Content",
  13268. SHOW: "Show",
  13269. HIDE: "Hide",
  13270. DOLLHOUSE: "Dollhouse",
  13271. FLOOR_PLAN: "Floor plan",
  13272. OPEN_HIGHLIGHTS: "Open Highlights",
  13273. CLOSE_HIGHLIGHTS: "Close",
  13274. PREVIOUS: "Previous",
  13275. PLAY: "Play",
  13276. PAUSE: "Pause",
  13277. NEXT: "Next",
  13278. EXPLORE_3D_SPACE: "Explore 3D Space",
  13279. VIEW_DOLLHOUSE: "View dollhouse",
  13280. SOCIAL_SHARING: "Share this Space",
  13281. VIEW_IN_VR: "View in VR",
  13282. VIEW_FULLSCREEN: "全屏",
  13283. EXIT_FULLSCREEN: "退出全屏",
  13284. ZOOM_IN: "Zoom in",
  13285. ZOOM_OUT: "Zoom out",
  13286. FLOOR_NAME: "Floor ",
  13287. FLOOR_ALL: "全部",
  13288. TERMS: "Terms",
  13289. PORT_TERMS: "port terms",
  13290. TERMS_OF_USE: "Terms of Use",
  13291. TERMS_TEXT_FILE: "terms-en-US.html",
  13292. CLOSE_TERMS: "Close",
  13293. TERMS_FAIL: "Could not fetch terms. Please make sure you have an internet connection to view the terms of use.",
  13294. HELP: "Help",
  13295. HELP_NAVIGATION_TAB: "Navigation",
  13296. HELP_MORE_HELP_TAB: "More Help",
  13297. CLOSE: "Close",
  13298. HELP_DESKTOP_PANORAMA_1A: "Click and Drag to look around the Space.",
  13299. HELP_DESKTOP_PANORAMA_2A: "Click on the rings throughout the space to move around.",
  13300. HELP_DESKTOP_PANORAMA_3A: "Use the scroll wheel to zoom in and out.",
  13301. HELP_DESKTOP_PANORAMA_1B: "Or, use the arrow keys to turn left and right.",
  13302. HELP_DESKTOP_PANORAMA_2B: "Or, use the arrow keys to move forward and back.",
  13303. HELP_DESKTOP_PANORAMA_3B: "Or, use the plus and minus keys to zoom in and out.",
  13304. HELP_DESKTOP_360_2A: "Click the Inside View icon to enter the Space.",
  13305. HELP_DESKTOP_360_2B: "Or, press the number 1 key to enter Inside View.",
  13306. HELP_DESKTOP_DOLLHOUSE_1A: "Left click and drag left, right, up, and down to rotate the Dollhouse.",
  13307. HELP_DESKTOP_DOLLHOUSE_2A: "Right click and drag left, right, up, and down to change the Dollhouse position on screen.",
  13308. HELP_DESKTOP_DOLLHOUSE_3A: "Use the scroll wheel to zoom in and out.",
  13309. HELP_DESKTOP_DOLLHOUSE_1B: "Or, use the arrow keys to rotate the Dollhouse.",
  13310. HELP_DESKTOP_FLOORPLAN_1A: "Left click and drag left, right, up, and down to change the Floorplan position on screen.",
  13311. HELP_DESKTOP_FLOORPLAN_2A: "Right click and drag left or right to rotate the Floorplan.",
  13312. HELP_DESKTOP_FLOORPLAN_3A: "Use the scroll wheel to zoom in and out.",
  13313. HELP_DESKTOP_FLOORPLAN_2B: "Or, use the arrow keys to rotate left or right.",
  13314. HELP_DESKTOP_FLOORPLAN_3B: "Or, use the arrow keys to zoom in and out.",
  13315. HELP_MOBILE_PANORAMA_1: "Touch and Drag to look around the Space.",
  13316. HELP_MOBILE_PANORAMA_2: "Tap on the rings throughout the Space to move around.",
  13317. HELP_MOBILE_3: "Use a pinch gesture to zoom in and out.",
  13318. HELP_MOBILE_360_2: "Tap the Inside View icon to enter the Space.",
  13319. HELP_MOBILE_DOLLHOUSE_1: "Touch and drag up, down, left, and right to rotate the Dollhouse.",
  13320. HELP_MOBILE_DOLLHOUSE_2: "Touch and drag with two fingers to position the Dollhouse.",
  13321. HELP_MOBILE_FLOORPLAN_1: "Touch and drag to position the Floorplan.",
  13322. HELP_MOBILE_FLOORPLAN_2: "Touch and drag with two fingers to rotate the Floorplan.",
  13323. HELP_MORE_HLR_A: "Highlight Reel",
  13324. HELP_DESKTOP_MORE_HLR_B: "Open to navigate through the Space using thumbnail images.",
  13325. HELP_MORE_DOLLHOUSE_A: "Dollhouse View",
  13326. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Click to view and rotate a top-down view of the entire Space in 3D.",
  13327. HELP_MOBILE_MORE_DOLLHOUSE_B: "Tap to view and rotate a top-down view of the entire Space in 3D.",
  13328. HELP_MORE_FLOORS_A: "Floor Selector",
  13329. HELP_DESKTOP_MORE_FLOORS_B: "Switch between floors in the Space.",
  13330. HELP_MORE_TAG_A: "tag™ Posts",
  13331. HELP_DESKTOP_MORE_TAG_B: "Click or hover over for information about features in the Space.",
  13332. HELP_MOBILE_MORE_TAG_B: "Tap for information about features in the Space.",
  13333. HELP_MORE_ZOOM_A: "Zoom Controls",
  13334. HELP_DESKTOP_MORE_ZOOM_B: "Use these controls to zoom in and out or use the scroll wheel.",
  13335. HELP_MORE_TOUR_A: "Tour Controls",
  13336. HELP_DESKTOP_MORE_TOUR_B: "Play, pause, and navigate forward and backward through a Guided Tour.",
  13337. HELP_MORE_INSIDE_A: "Inside View",
  13338. HELP_DESKTOP_MORE_INSIDE_B: "Click to explore inside the Space.",
  13339. HELP_MOBILE_MORE_INSIDE_B: "Tap to explore inside the Space.",
  13340. HELP_MORE_VR_A: "VR Mode",
  13341. HELP_DESKTOP_MORE_VR_B: "Click to launch the Space in virtual reality.",
  13342. HELP_MOBILE_MORE_VR_B: "Tap to launch the Space in virtual reality.",
  13343. HELP_MORE_360_A: "360° Views",
  13344. HELP_DESKTOP_MORE_360_B: "Click 360 Views in the Highlight Reel to view outdoor scenes.",
  13345. HELP_MOBILE_MORE_360_B: "Tap 360 Views in the Highlight Reel to view outdoor scenes.",
  13346. HELP_MORE_FULLSCREEN_A: "Full screen",
  13347. HELP_DESKTOP_MORE_FULLSCREEN_B: "Expand 3D Showcase to full screen.",
  13348. WEBVR_FOR_CARDBOARD: "For Google Cardboard",
  13349. WEBVR_VIEW_CARDBOARD: "Or View on Google Cardboard",
  13350. WEBVR_FOR_DAYDREAM: "For Daydream View",
  13351. WEBVR_ENTER_WEBVR: "ENTER VR",
  13352. WEBVR_DIFFERENT_HEADSET: "Have a different headset?",
  13353. WEBVR_LEARN_MORE: "Learn more",
  13354. WEBVR_VIEW_SPACE: "View Space in VR",
  13355. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13356. WEBVR_DAYDREAM_PHONE: "Daydream-ready phone",
  13357. VR_VIEW_SPACE: "View Space in Virtual Reality",
  13358. VR_LEARN_MORE_CAPS: "LEARN MORE",
  13359. VR_PREVIOUS_CAPS: "PREVIOUS",
  13360. VR_NEXT_CAPS: "NEXT",
  13361. VR_GOT_IT_CAPS: "GOT IT",
  13362. VR_SHOW_SUPPORTED: "Tap to view the Space in VR with",
  13363. VR_SHOW_UNSUPPORTED: "Sorry, but your device doesn't meet the minimum requirements to view a space in VR.",
  13364. VR_SHOW_IOS_1: "Tap to view the space in VR",
  13365. VR_SHOW_IOS_2: "Requires port VR app and compatible iPhone to view",
  13366. VR_WHAT_YOU_NEED: "What You'll Need For...",
  13367. VR_NEED_CARDBOARD: "What you'll need with Google Cardboard",
  13368. VR_NEED_SAMSUNG: "What you'll need with Samsung Gear VR",
  13369. VR_NEED_DAYDREAM: "NEEDS PRIOR PAIRING WITH DAYDREAM VIEW",
  13370. VR_NEED_DAYDREAM_PHONE: "Daydream-ready phone",
  13371. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13372. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13373. VR_APP: "port VR App",
  13374. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13375. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13376. VR_COMPATIBLE_IPHONES_2: "iPhone 5s and newer, running iOS 9.1 and higher",
  13377. VR_COMPATIBLE_IPHONES_3: "Compatible iPhones",
  13378. VR_COMPATIBLE_ANDROID: "Compatible Android Devices",
  13379. VR_COMPATIBLE_ANDROID_LONG: 'Compatible Android Devices Displays from 4.5"-5.5" running Android OS 4.4.4 and higher',
  13380. VR_ANDROID_DETAIL: 'Displays from 4.5"-5.5" running Android OS 4.4.4 and higher',
  13381. VR_ANDROID_DVICES: "Android Devices",
  13382. VR_COMPATIBLE_SAMSUNG: "Compatible Samsung Devices",
  13383. VR_SAMSUNG_DETAIL: "Galaxy S6 and Above",
  13384. VR_APP_FOR_CARDBOARD: "port VR app for Google Cardboard",
  13385. VR_APP_FOR_SAMSUNG: "port VR app for Gear VR",
  13386. VR_APP_FOR_ANDROID: "port VR app for Android Phones",
  13387. VR_APP_OPEN: "Open with the port VR app instead",
  13388. VR_DOWNLOAD_HERE: "Download here",
  13389. VR_REQUIRE_HEADSET: "Requires a VR headset and port VR app for Android to be installed",
  13390. VR_REDIRECT_TO_STORE: "If app is not installed, you will be redirected to the app store.",
  13391. VR_IMPROPER_EMBED: "The port Space is not embedded properly to support VR in your web browser.",
  13392. VR_OPEN_ANDROID_LINK: "Open the Link on Your Mobile Phone",
  13393. VR_ANDROID_OPTIONS: "Available VR Headset Options",
  13394. SHARE_TO: "Share to",
  13395. SHARE_LINK: "Direct Link",
  13396. SHARE_EXPLORE: "Explore ",
  13397. SHARE_AT: "at",
  13398. SHARE_WITH: "with",
  13399. SHARE_3D: " in 3D",
  13400. SHARE_COPIED: "Copied!",
  13401. ERROR_BROWSER_SOLUTION: "Install a new browser to explore in 3D.",
  13402. ERROR_BROWSER_EXPLANATION: "WebGL requires a modern browser.",
  13403. ERROR_GENERIC_PROBLEM: "Oops, something went wrong.",
  13404. ERROR_GENERIC_SOLUTION: "Restart your browser.",
  13405. ERROR_GENERIC_ACTIONS_1: "If the problem persists, ",
  13406. ERROR_GENERIC_ACTIONS_2: "install a supported browser",
  13407. ERROR_GENERIC_ACTIONS_3: " or ",
  13408. ERROR_GENERIC_ACTIONS_4: "see our troubleshooting guide",
  13409. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Browser not supported.",
  13410. ERROR_WEBGL_IOS_PROBLEM: "iOS version not supported.",
  13411. ERROR_WEBGL_IOS_SOLUTION: "Upgrade to iOS 8 or higher to explore in 3D.",
  13412. ERROR_WEBGL_IOS_ACTIONS_1: "Tap ",
  13413. ERROR_WEBGL_IOS_ACTIONS_2: "Settings > General > Software Update",
  13414. ERROR_WEBGL_SAFARI_PROBLEM: "Enable WebGL to explore in 3D.",
  13415. ERROR_WEBGL_SAFARI_ACTIONS_1: "Click ",
  13416. ERROR_WEBGL_SAFARI_ACTIONS_2: "Preferences > Advanced > Show Develop menu",
  13417. ERROR_WEBGL_SAFARI_ACTIONS_3: "Then click ",
  13418. ERROR_WEBGL_SAFARI_ACTIONS_4: "Develop > Enable WebGL",
  13419. ERROR_MISSING_URLS_PROBLEM: "Oops, there are no panoramas for this model.",
  13420. ERROR_MISSING_URLS_EXPLANATION: "This is an older model. The website owner may have a new model on the way.",
  13421. ERROR_LOADING_FAILED_PROBLEM: "模型不可用.",
  13422. ERROR_LOADING_FAILED_ACTIONS_1: "If the problem persists, ",
  13423. ERROR_LOADING_FAILED_ACTIONS_2: "see our troubleshooting guide",
  13424. ERROR_MAINTENANCE_PROBLEM: "Maintenance in progress.",
  13425. ERROR_MAINTENANCE_SOLUTION: "Please come back in a few minutes.",
  13426. LINK_TO_LOCATION: "Link to location",
  13427. MENU_COPY: "Copy",
  13428. LINK_ALERT_COPY: "Please use CTRL/CMD + C to copy.",
  13429. ROTATE: "Rotate",
  13430. INSIDE: "Inside",
  13431. MOVE: "Move",
  13432. ZOOM: "Zoom"
  13433. }
  13434. }
  13435. , {}],
  13436. 112: [function(e, t, i) {
  13437. "use strict";
  13438. t.exports = {
  13439. PAGE_TITLE: "",
  13440. LOADING: "Cargando",
  13441. PRESENTED_BY_CAPS: "PRESENTADO POR",
  13442. POWERED_BY: "potenciando por ",
  13443. POWERED_BY_CAPS: "POTENCIADO POR ",
  13444. DESKTOP_SHORT_CTA: "Haga clic para explorar este Espacio 3D.",
  13445. MOBILE_SHORT_CTA: "Pulse para explorar este Espacio 3D.",
  13446. PRESENTED_BY: "Presentado por ",
  13447. MORE: "Más ",
  13448. LESS: "Menos ",
  13449. TAG_CONTENT: "Contenido de tag™",
  13450. SHOW: "Mostrar",
  13451. HIDE: "Ocultar",
  13452. DOLLHOUSE: "Dollhouse",
  13453. FLOOR_PLAN: "Planos",
  13454. OPEN_HIGHLIGHTS: "Aspectos Destacados",
  13455. CLOSE_HIGHLIGHTS: "Cerrar",
  13456. PREVIOUS: "Anterior",
  13457. PLAY: "Play",
  13458. PAUSE: "Pausa",
  13459. NEXT: "Siguiente",
  13460. EXPLORE_3D_SPACE: "Explorar el Espacio 3D",
  13461. VIEW_DOLLHOUSE: "Ver dollhouse",
  13462. SOCIAL_SHARING: "Compartir este espacio",
  13463. VIEW_IN_VR: "Ver en realidad virtual",
  13464. VIEW_FULLSCREEN: "Ver en pantalla completa",
  13465. EXIT_FULLSCREEN: "Salir de pantalla completa",
  13466. ZOOM_IN: "Acercar",
  13467. ZOOM_OUT: "Alejar",
  13468. FLOOR_NAME: "Piso ",
  13469. FLOOR_ALL: "Todas",
  13470. TERMS: "Condiciones",
  13471. PORT_TERMS: "port términos de uso",
  13472. TERMS_OF_USE: "Términos de uso",
  13473. TERMS_TEXT_FILE: "terms-es-MX.html",
  13474. CLOSE_TERMS: "Cerrar",
  13475. 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.",
  13476. HELP: "Ayuda",
  13477. HELP_NAVIGATION_TAB: "Navegación",
  13478. HELP_MORE_HELP_TAB: "Más Ayuda",
  13479. CLOSE: "Cerrar",
  13480. HELP_DESKTOP_PANORAMA_1A: "Haga clic y arrastre para mirar alrededor del espacio.",
  13481. HELP_DESKTOP_PANORAMA_2A: "Haga clic en los aros a lo largo del espacio para moverse.",
  13482. HELP_DESKTOP_PANORAMA_3A: "Use la rueda de desplazamiento para acercar o alejar.",
  13483. HELP_DESKTOP_PANORAMA_1B: "O use las teclas de flecha para girar a la izquierda y a la derecha.",
  13484. HELP_DESKTOP_PANORAMA_2B: "O use las teclas de dirección para adelantar o retroceder.",
  13485. HELP_DESKTOP_PANORAMA_3B: "O use la tecla más para acercar y la tecla menos para alejar.",
  13486. HELP_DESKTOP_360_2A: "Haga clic en el icono Vista Interior para ingresar al Espacio.",
  13487. HELP_DESKTOP_360_2B: "O bien, presione la tecla numero 1 para entrar en la Vista Interior.",
  13488. HELP_DESKTOP_DOLLHOUSE_1A: "Haga clic izquierdo y arrastre hacia la izquierda, derecha, arriba o abajo para girar la Dollhouse.",
  13489. HELP_DESKTOP_DOLLHOUSE_2A: "Haga clic derecho y arrastre hacia la izquierda, derecha, arriba o abajo para cambiar la posición della dollhouse.",
  13490. HELP_DESKTOP_DOLLHOUSE_3A: "Use la rueda de desplazamiento para acercar o alejar.",
  13491. HELP_DESKTOP_DOLLHOUSE_1B: "O use las teclas de dirección para girar la Dollhouse.",
  13492. 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.",
  13493. HELP_DESKTOP_FLOORPLAN_2A: "Haga clic derecho y arrastre hacia la izquierda o derecha para girar la planta.",
  13494. HELP_DESKTOP_FLOORPLAN_3A: "Use la rueda de desplazamiento para acercar o alejar.",
  13495. HELP_DESKTOP_FLOORPLAN_2B: "O use las teclas para girar hacia la izquierda o derecha.",
  13496. HELP_DESKTOP_FLOORPLAN_3B: "O use las teclas de dirección para acercar o alejar.",
  13497. HELP_MOBILE_PANORAMA_1: "Toque y arrastre para mirar alrededor del espacio.",
  13498. HELP_MOBILE_PANORAMA_2: "Toque en los aros a lo largo del espacio para moverse.",
  13499. HELP_MOBILE_3: "Use el gesto de pellizcar para acercar o alejar.",
  13500. HELP_MOBILE_360_2: "Toque el ícono Vista Interior para entrar en el Espacio.",
  13501. HELP_MOBILE_DOLLHOUSE_1: "Toque y arrastre con dos dedos para cambiar la posición della dollhouse.",
  13502. HELP_MOBILE_DOLLHOUSE_2: "Toque y arrastre con dos dedos para cambiar la posición de la vista aérea.",
  13503. HELP_MOBILE_FLOORPLAN_1: "Toque y arrastre para cambiar la posición de la planta.",
  13504. HELP_MOBILE_FLOORPLAN_2: "Toque y arrastre con dos dedos para girar la planta.",
  13505. HELP_MORE_HLR_A: "Galería destacada",
  13506. HELP_DESKTOP_MORE_HLR_B: "Abra para navegar a través del espacio utilizando imágenes en miniatura.",
  13507. HELP_MORE_DOLLHOUSE_A: "Vista aérea por pisos",
  13508. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Haga clic para ver y girar la Dollhouse del espacio completo en 3D.",
  13509. HELP_MOBILE_MORE_DOLLHOUSE_B: "Toque para ver y girar la vista Dollhouse del espacio completo en 3D.",
  13510. HELP_MORE_FLOORS_A: "Seleccionador de plantas",
  13511. HELP_DESKTOP_MORE_FLOORS_B: "Cambie de una planta a otra en el espacio.",
  13512. HELP_MORE_TAG_A: "tag™ Posts",
  13513. HELP_DESKTOP_MORE_TAG_B: "Haga clic o coloque el cursor para obtener más información acerca de las características del espacio.",
  13514. HELP_MOBILE_MORE_TAG_B: "Toque para obtener más información acerca de las características del espacio.",
  13515. HELP_MORE_ZOOM_A: "Controles de zoom",
  13516. HELP_DESKTOP_MORE_ZOOM_B: "Use estos controles o la rueda de desplazamiento para acercar o alejar.",
  13517. HELP_MORE_TOUR_A: "Controles de recorrido",
  13518. HELP_DESKTOP_MORE_TOUR_B: "Reproduzca, pause, adelante o retroceda a través de un recorrido guiado.",
  13519. HELP_MORE_INSIDE_A: "Vista interior",
  13520. HELP_DESKTOP_MORE_INSIDE_B: "Haga clic para explorar el interior del espacio.",
  13521. HELP_MOBILE_MORE_INSIDE_B: "Toque para explorar el interior del espacio.",
  13522. HELP_MORE_VR_A: "Modo de realidad virtual",
  13523. HELP_DESKTOP_MORE_VR_B: "Toque para ver el espacio en realidad virtual.",
  13524. HELP_MOBILE_MORE_VR_B: "Toque para ver el espacio en realidad virtual.",
  13525. HELP_MORE_360_A: "360° Views",
  13526. HELP_DESKTOP_MORE_360_B: "Una vez que se encuentre en galería destacada, haga clic en vistas de 360º para ver el exterior.",
  13527. HELP_MOBILE_MORE_360_B: "Una vez que se encuentre en galería destacada, toque en vistas de 360º para ver el exterior.",
  13528. HELP_MORE_FULLSCREEN_A: "Pantalla completa",
  13529. HELP_DESKTOP_MORE_FULLSCREEN_B: "Expanda el escenario 3D para verlo en pantalla completa.",
  13530. WEBVR_FOR_CARDBOARD: "Para Google Cardboard",
  13531. WEBVR_FOR_DAYDREAM: "Para Daydream View",
  13532. WEBVR_ENTER_WEBVR: "ENTRAR VR",
  13533. WEBVR_DIFFERENT_HEADSET: "¿Tiene un auricular diferente?",
  13534. WEBVR_LEARN_MORE: "Más información",
  13535. WEBVR_VIEW_SPACE: "Ver Espacio en VR",
  13536. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13537. WEBVR_DAYDREAM_PHONE: "Daydream Teléfono listos",
  13538. WEBVR_VIEW_CARDBOARD: "O Ver en Google Cardboard",
  13539. VR_NEED_DAYDREAM: "Necesidades antes de acoplarse con Daydream View",
  13540. VR_NEED_DAYDREAM_PHONE: "Teléfono listo para Daydream",
  13541. VR_GOOGLE_DAYDREAM: "Daydream de Google",
  13542. VR_APP: "port VR App",
  13543. VR_COMPATIBLE_ANDROID_LONG: 'Compatible con los Dispositivos Android con Pantallas de 4.5"-5.5" operando Android OS 4.4.4 y posteriores',
  13544. VR_APP_FOR_ANDROID: "Aplicación port VR para Teléfonos Android",
  13545. VR_APP_OPEN: "Abrir con la aplicación port VR en su lugar",
  13546. VR_VIEW_SPACE: "Ver Espacio en realidad virtual",
  13547. VR_LEARN_MORE_CAPS: "SABER MÁS",
  13548. VR_PREVIOUS_CAPS: "ANTERIOR",
  13549. VR_NEXT_CAPS: "SIGUIENTE",
  13550. VR_GOT_IT_CAPS: "COMPRENDIDO",
  13551. VR_SHOW_SUPPORTED: "Pulse para ver el Espacio en realidad virtual con",
  13552. VR_SHOW_UNSUPPORTED: "Lo sentimos, pero su dispositivo no cumple los requisitos mínimos para ver un Espacio en realidad virtual.",
  13553. VR_SHOW_IOS_1: "Pulse para ver el Espacio en realidad virtual",
  13554. VR_SHOW_IOS_2: "Necesita la aplicación port VR y un iPhone compatible para ver",
  13555. VR_WHAT_YOU_NEED: "Lo que necesitaras...",
  13556. VR_NEED_CARDBOARD: "Lo que necesitaras con Google Cardboard",
  13557. VR_NEED_SAMSUNG: "Lo que necesitaras con el Samsung Gear VR",
  13558. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13559. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13560. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13561. VR_COMPATIBLE_IPHONES_2: "Compatible con iPhone 6S o superior y con iOS 9.1 en adelante",
  13562. VR_COMPATIBLE_IPHONES_3: "iPhones compatibles",
  13563. VR_COMPATIBLE_ANDROID: "Dispositivos Android compatibles",
  13564. VR_ANDROID_DETAIL: "Pantallas de 11.43 cm a 13.97 cm con OS de Android 4.4.4 en adelante",
  13565. VR_ANDROID_DVICES: "Dispositivos Android",
  13566. VR_COMPATIBLE_SAMSUNG: "Dispositivos compatibles del Samsung",
  13567. VR_SAMSUNG_DETAIL: "Galaxy S5 en adelante",
  13568. VR_APP_FOR_CARDBOARD: "Aplicación port VR para Google Cardboard",
  13569. VR_APP_FOR_SAMSUNG: "Aplicación port VR para Gear VR",
  13570. VR_DOWNLOAD_HERE: "Descargar aquí",
  13571. VR_REQUIRE_HEADSET: "Necesita un casco de realidad virtual y que se instale la aplicación port VR para Android",
  13572. VR_REDIRECT_TO_STORE: "Si la aplicación no está instalada, se le redirigirá a la tienda de aplicaciones.",
  13573. VR_IMPROPER_EMBED: "El espacio de port no está incorporado correctamente para apoyar VR en su navegador web.",
  13574. VR_OPEN_ANDROID_LINK: "Abre el enlace en tu teléfono móvil",
  13575. VR_ANDROID_OPTIONS: "Opciones de auriculares en RV disponibles",
  13576. SHARE_TO: "Compartir en",
  13577. SHARE_LINK: "Enlace directo",
  13578. SHARE_EXPLORE: "Explorar ",
  13579. SHARE_AT: "en",
  13580. SHARE_WITH: "con",
  13581. SHARE_3D: " en 3D",
  13582. SHARE_COPIED: "¡Copiado!",
  13583. ERROR_BROWSER_SOLUTION: "Instale un nuevo navegador para explorar en 3D.",
  13584. ERROR_BROWSER_EXPLANATION: "WebGL requiere un navegador moderno.",
  13585. ERROR_GENERIC_PROBLEM: "Vaya, algo ha ido mal.",
  13586. ERROR_GENERIC_SOLUTION: "Reinicie su navegador.",
  13587. ERROR_GENERIC_ACTIONS_1: "Si el problema persiste, ",
  13588. ERROR_GENERIC_ACTIONS_2: "instale un navegador compatible",
  13589. ERROR_GENERIC_ACTIONS_3: " o ",
  13590. ERROR_GENERIC_ACTIONS_4: "consulte nuestra guía de solución de problemas",
  13591. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Navegador no compatible.",
  13592. ERROR_WEBGL_IOS_PROBLEM: "Versión de iOS no compatible.",
  13593. ERROR_WEBGL_IOS_SOLUTION: "Actualice a iOS 8 o superior para explorar en 3D.",
  13594. ERROR_WEBGL_IOS_ACTIONS_1: "Pulse ",
  13595. ERROR_WEBGL_IOS_ACTIONS_2: "Ajustes > General > Actualización de software",
  13596. ERROR_WEBGL_SAFARI_PROBLEM: "Habilite WebGL para explorar en 3D.",
  13597. ERROR_WEBGL_SAFARI_ACTIONS_1: "Haga clic en ",
  13598. ERROR_WEBGL_SAFARI_ACTIONS_2: "Preferencias > Avanzado > Mostrar el menú Desarrollar",
  13599. ERROR_WEBGL_SAFARI_ACTIONS_3: "Después, haga clic en ",
  13600. ERROR_WEBGL_SAFARI_ACTIONS_4: "Desarrollar > Habilitar WebGL",
  13601. ERROR_MISSING_URLS_PROBLEM: "Vaya, no hay panoramas para este modelo.",
  13602. ERROR_MISSING_URLS_EXPLANATION: "Este es un modelo antiguo. El propietario del sitio web puede tener un nuevo modelo en mente.",
  13603. ERROR_LOADING_FAILED_PROBLEM: "Vaya, modelo no disponible.",
  13604. ERROR_LOADING_FAILED_ACTIONS_1: "Si el problema persiste, ",
  13605. ERROR_LOADING_FAILED_ACTIONS_2: "consulte nuestra guía de solución de problemas",
  13606. ERROR_MAINTENANCE_PROBLEM: "Mantenimiento en progreso.",
  13607. ERROR_MAINTENANCE_SOLUTION: "Regrese en unos minutos.",
  13608. LINK_TO_LOCATION: "Enlace a la ubicación",
  13609. MENU_COPY: "Copiar",
  13610. LINK_ALERT_COPY: "Utilice CTRL/CMD + C para copiar.",
  13611. ROTATE: "Girar",
  13612. INSIDE: "Interior",
  13613. MOVE: "Moverse",
  13614. ZOOM: "Acercar o alejar"
  13615. }
  13616. }
  13617. , {}],
  13618. 113: [function(e, t, i) {
  13619. "use strict";
  13620. t.exports = {
  13621. PAGE_TITLE: "",
  13622. LOADING: "Chargement",
  13623. PRESENTED_BY_CAPS: "PRÉSENTÉ PAR",
  13624. POWERED_BY: "alimenté par ",
  13625. POWERED_BY_CAPS: "ALIMENTÉ PAR",
  13626. DESKTOP_SHORT_CTA: "Cliquez pour explorer l'Espace 3D.",
  13627. MOBILE_SHORT_CTA: "Cliquez pour explorer l'Espace 3D.",
  13628. PRESENTED_BY: "Présenté par ",
  13629. MORE: "Plus ",
  13630. LESS: "Moins ",
  13631. TAG_CONTENT: "Contenu tag™",
  13632. SHOW: "Montrer",
  13633. HIDE: "Cacher",
  13634. DOLLHOUSE: "Dollhouse",
  13635. FLOOR_PLAN: "Plan de sol",
  13636. OPEN_HIGHLIGHTS: "Ouvrir les faits saillants",
  13637. CLOSE_HIGHLIGHTS: "Fermer",
  13638. PREVIOUS: "Précédent",
  13639. PLAY: "Lecture",
  13640. PAUSE: "Pause",
  13641. NEXT: "Suivant",
  13642. EXPLORE_3D_SPACE: "Explorer l'Espace en 3D",
  13643. VIEW_DOLLHOUSE: "Voir dollhouse",
  13644. SOCIAL_SHARING: "Partager cet espace",
  13645. VIEW_IN_VR: "Voir en VR",
  13646. VIEW_FULLSCREEN: "Plein écran",
  13647. EXIT_FULLSCREEN: "Fermer plein écran",
  13648. ZOOM_IN: "Zoom avant",
  13649. ZOOM_OUT: "Zoom arrière",
  13650. FLOOR_NAME: "Étage ",
  13651. FLOOR_ALL: "Tous",
  13652. TERMS: "Mentions légales",
  13653. PORT_TERMS: "port mentions légales",
  13654. TERMS_OF_USE: "Conditions d'utilisation",
  13655. TERMS_TEXT_FILE: "terms-fr-FR.html",
  13656. CLOSE_TERMS: "Fermer",
  13657. TERMS_FAIL: "Impossible d'accéder aux mentions légales. Vérifiez que vous avez une connexion Internet pour afficher les conditions d'utilisation.",
  13658. HELP: "Aide",
  13659. HELP_NAVIGATION_TAB: "Navigation",
  13660. HELP_MORE_HELP_TAB: "Aide",
  13661. CLOSE: "Fermer",
  13662. HELP_DESKTOP_PANORAMA_1A: "Cliquez et faites glisser pour regarder autour de l’espace.",
  13663. HELP_DESKTOP_PANORAMA_2A: "Cliquez sur les anneaux pour vous déplacer.",
  13664. HELP_DESKTOP_PANORAMA_3A: "Utilisez la molette de votre souris pour zoomer.",
  13665. HELP_DESKTOP_PANORAMA_1B: "Ou utilisez les touches pour tourner.",
  13666. HELP_DESKTOP_PANORAMA_2B: "Ou utilisez les touches pour avancer et reculer.",
  13667. HELP_DESKTOP_PANORAMA_3B: "Ou utilisez les touches plus et moins pour zoomer.",
  13668. HELP_DESKTOP_360_2A: "Cliquez sur l’icône Vue Intérieure pour entrer dans l’Espace.",
  13669. HELP_DESKTOP_360_2B: "Ou, appuyez sur la touche numéro 1 pour entrer dans la Vue Intérieure.",
  13670. HELP_DESKTOP_DOLLHOUSE_1A: "Faites un clic gauche et bougez votre souris pour faire pivoter la vue Dollhouse.",
  13671. HELP_DESKTOP_DOLLHOUSE_2A: "Faites un clic droit et bougez votre souris pour changer la position de la vue Dollhouse.",
  13672. HELP_DESKTOP_DOLLHOUSE_3A: "Utilisez la molette de votre souris pour zoomer.",
  13673. HELP_DESKTOP_DOLLHOUSE_1B: "Ou utilisez les touches pour faire pivoter la vue Dollhouse.",
  13674. HELP_DESKTOP_FLOORPLAN_1A: "Faites un clic droit pour changer la position du plan sur l’écran.",
  13675. HELP_DESKTOP_FLOORPLAN_2A: "Faites un clic droit et faites glisser à gauche ou à droite pour faire pivoter le plan.",
  13676. HELP_DESKTOP_FLOORPLAN_3A: "Utilisez la molette de votre souris pour zoomer.",
  13677. HELP_DESKTOP_FLOORPLAN_2B: "Ou utilisez les touches pour faire pivoter à gauche ou à droite.",
  13678. HELP_DESKTOP_FLOORPLAN_3B: "Ou utilisez les touches pour effectuer un zoom avant ou arrière.",
  13679. HELP_MOBILE_PANORAMA_1: "Touchez et faites glisser pour regarder autour de l’espace.",
  13680. HELP_MOBILE_PANORAMA_2: "Tapez sur les anneaux dans tout l’espace pour vous déplacer.",
  13681. HELP_MOBILE_3: "Utilisez un geste de pincement pour zoomer avant/arrière.",
  13682. HELP_MOBILE_360_2: "Tapez sur l’icône Vue Intérieure pour entrer dans l’Espace.",
  13683. HELP_MOBILE_DOLLHOUSE_1: "Touchez et faites glisser vers le haut/bas/gauche/droite pour faire pivoter la vue Dollhouse.",
  13684. HELP_MOBILE_DOLLHOUSE_2: "Touchez et faites glisser avec deux doigts pour positionner vue en coupe.",
  13685. HELP_MOBILE_FLOORPLAN_1: "Touchez et faites glisser pour positionner le plan.",
  13686. HELP_MOBILE_FLOORPLAN_2: "Touchez et faites glisser avec deux doigts pour faire pivoter le plan.",
  13687. HELP_MORE_HLR_A: "Carrousel",
  13688. HELP_DESKTOP_MORE_HLR_B: "Ouvrez pour naviguer dans l’espace en utilisant les vignettes.",
  13689. HELP_MORE_DOLLHOUSE_A: "Vue en coupe",
  13690. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Cliquez pour afficher et faire pivoter l’espace entier en 3D.",
  13691. HELP_MOBILE_MORE_DOLLHOUSE_B: "Tapez pour afficher et faire pivoter l’espace entier en 3D.",
  13692. HELP_MORE_FLOORS_A: "Sélecteur d’étage",
  13693. HELP_DESKTOP_MORE_FLOORS_B: "Basculer entre les étages dans l’espace.",
  13694. HELP_MORE_TAG_A: "tag™ Posts",
  13695. HELP_DESKTOP_MORE_TAG_B: "Cliquez ou survolez pour obtenir des informations sur l’espace.",
  13696. HELP_MOBILE_MORE_TAG_B: "Tapez pour obtenir des informations sur l’espace.",
  13697. HELP_MORE_ZOOM_A: "Commandes de zoom",
  13698. HELP_DESKTOP_MORE_ZOOM_B: "Utilisez votre clavier ou la molette de votre souris pour zoomer.",
  13699. HELP_MORE_TOUR_A: "Commandes de la visite",
  13700. HELP_DESKTOP_MORE_TOUR_B: "Mettez en marche ou en pause, avancez et reculez lors d'une visite guidée.",
  13701. HELP_MORE_INSIDE_A: "Vue intérieure",
  13702. HELP_DESKTOP_MORE_INSIDE_B: "Cliquez pour explorer l’intérieur de l’espace.",
  13703. HELP_MOBILE_MORE_INSIDE_B: "Tapez pour explorer l’intérieur de l’espace.",
  13704. HELP_MORE_VR_A: "Mode RV",
  13705. HELP_DESKTOP_MORE_VR_B: "Cliquez pour lancer l’espace en réalité virtuelle.",
  13706. HELP_MOBILE_MORE_VR_B: "Tapez pour lancer l’espace en réalité virtuelle.",
  13707. HELP_MORE_360_A: "Vues 360°",
  13708. HELP_DESKTOP_MORE_360_B: "Cliquez sur vues 360°, dans le carrousel pour voir les scènes extérieures.",
  13709. HELP_MOBILE_MORE_360_B: "Tapez sur vues 360°, dans le carrousel pour voir les scènes extérieures.",
  13710. HELP_MORE_FULLSCREEN_A: "Plein écran",
  13711. HELP_DESKTOP_MORE_FULLSCREEN_B: "Voir 3D Showcase en plein écran.",
  13712. WEBVR_FOR_CARDBOARD: "Pour Google Cardboard",
  13713. WEBVR_FOR_DAYDREAM: "Pour Daydream View",
  13714. WEBVR_ENTER_WEBVR: "ENTRER VR",
  13715. WEBVR_DIFFERENT_HEADSET: "Avez-vous un casque différent?",
  13716. WEBVR_LEARN_MORE: "En savoir plus",
  13717. WEBVR_VIEW_SPACE: "Voir Espace en VR",
  13718. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13719. WEBVR_DAYDREAM_PHONE: "Téléphone compatibles Daydream",
  13720. WEBVR_VIEW_CARDBOARD: "Ou Afficher sur Google Cardboard",
  13721. VR_VIEW_SPACE: "Voir l'Espace en Réalité Virtuelle",
  13722. VR_LEARN_MORE_CAPS: "EN SAVOIR PLUS",
  13723. VR_PREVIOUS_CAPS: "PRÉCÉDENT",
  13724. VR_NEXT_CAPS: "SUIVANT",
  13725. VR_GOT_IT_CAPS: "BIEN COMPRIS",
  13726. VR_SHOW_SUPPORTED: "Taper pour voir l'Espace en VR avec",
  13727. VR_SHOW_UNSUPPORTED: "Désolé mais votre appareil ne répond pas aux critères minimaux pour voir cet Espace en mode VR.",
  13728. VR_SHOW_IOS_1: "Taper pour voir l’Espace en Realité Virtuelle",
  13729. VR_SHOW_IOS_2: "Nécessite l’application port VR et un iPhone compatible pour voir",
  13730. VR_WHAT_YOU_NEED: "Ce dont vous aurez besoin pour...",
  13731. VR_NEED_CARDBOARD: "Ce dont vous aurez besoin avec Google Cardboard",
  13732. VR_NEED_SAMSUNG: "Ce dont vous aurez besoin avec Samsung Gear VR",
  13733. VR_NEED_DAYDREAM: "BESOINS AVANT APPARIEMENT AVEC DAYDREAM VIEW",
  13734. VR_NEED_DAYDREAM_PHONE: "Téléphone compatible avec Daydream",
  13735. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13736. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13737. VR_APP: "port VR App",
  13738. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13739. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13740. VR_COMPATIBLE_IPHONES_2: "iPhone 5s et plus récent, avec iOS 9.1 et plus récent",
  13741. VR_COMPATIBLE_IPHONES_3: "iPhones compatibles",
  13742. VR_COMPATIBLE_ANDROID: "Appareils Android compatibles",
  13743. 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",
  13744. VR_ANDROID_DETAIL: 'Écrans 4.5" à 5.5" avec Android 4.4.4 ou plus récent',
  13745. VR_ANDROID_DVICES: "Appareils Android",
  13746. VR_COMPATIBLE_SAMSUNG: "Appareils Samsung Compatibles",
  13747. VR_SAMSUNG_DETAIL: "Galaxy S6 et plus récents",
  13748. VR_APP_FOR_CARDBOARD: "Application port VR pour Google Cardboard",
  13749. VR_APP_FOR_SAMSUNG: "Application port VR pour Gear VR",
  13750. VR_APP_FOR_ANDROID: "Application port VR pour téléphones Android",
  13751. VR_APP_OPEN: "Ouvrir plutôt avec l’application port VR",
  13752. VR_DOWNLOAD_HERE: "Télécharger ici",
  13753. VR_REQUIRE_HEADSET: "Nécessite un casque VR et l'application port VR pour Android afin d'être installé",
  13754. VR_REDIRECT_TO_STORE: "Si l'application n'est pas installée, vous serez rediriger vers l'App store.",
  13755. VR_IMPROPER_EMBED: "L'Espace port n'est pas correctement intégré pour supporter VR dans votre navigateur Web.",
  13756. VR_OPEN_ANDROID_LINK: "Ouvrez ce lien avec votre appareil mobile",
  13757. VR_ANDROID_OPTIONS: "Options disponibles pour casque VR sous",
  13758. SHARE_TO: "Partager sur",
  13759. SHARE_LINK: "Lien direct",
  13760. SHARE_EXPLORE: "Explorer ",
  13761. SHARE_AT: "à",
  13762. SHARE_WITH: "avec",
  13763. SHARE_3D: " en 3D",
  13764. SHARE_COPIED: "Copié!",
  13765. ERROR_BROWSER_SOLUTION: "Installer un nouveau navigateur pour explorer en 3D.",
  13766. ERROR_BROWSER_EXPLANATION: "WebGL a besoin d'un navigateur récent.",
  13767. ERROR_GENERIC_PROBLEM: "Il y eu un problème.",
  13768. ERROR_GENERIC_SOLUTION: "Redémarrer votre navigateur.",
  13769. ERROR_GENERIC_ACTIONS_1: "Si le problème persiste, ",
  13770. ERROR_GENERIC_ACTIONS_2: "installez un navigateur plus récent",
  13771. ERROR_GENERIC_ACTIONS_3: " ou ",
  13772. ERROR_GENERIC_ACTIONS_4: "voir notre guide de dépannage",
  13773. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Navigateur non-supporté.",
  13774. ERROR_WEBGL_IOS_PROBLEM: "Version iOS non-supportée.",
  13775. ERROR_WEBGL_IOS_SOLUTION: "Mettre à jour avec iOS8 au minimum pour voir l'Espace en 3D.",
  13776. ERROR_WEBGL_IOS_ACTIONS_1: "Tapez ",
  13777. ERROR_WEBGL_IOS_ACTIONS_2: "Paramètres > Général > Mise à jour Software",
  13778. ERROR_WEBGL_SAFARI_PROBLEM: "Activez WegGL pour explorer en 3D.",
  13779. ERROR_WEBGL_SAFARI_ACTIONS_1: "Cliquez ",
  13780. ERROR_WEBGL_SAFARI_ACTIONS_2: "Préferences > Avancés > Voir menu développeur",
  13781. ERROR_WEBGL_SAFARI_ACTIONS_3: "Puis cliquez ",
  13782. ERROR_WEBGL_SAFARI_ACTIONS_4: "Développe > Activé WebGL",
  13783. ERROR_MISSING_URLS_PROBLEM: "Il n'y a pas de panoromas pour ce modèle.",
  13784. ERROR_MISSING_URLS_EXPLANATION: "Ceci est un ancien modèle. Le propriétaire du site a peut-être un nouveau modèle en cours.",
  13785. ERROR_LOADING_FAILED_PROBLEM: "Ce modèle n'est pas disponible.",
  13786. ERROR_LOADING_FAILED_ACTIONS_1: "Si le problème persiste, ",
  13787. ERROR_LOADING_FAILED_ACTIONS_2: "voir notre guide de dépannage",
  13788. ERROR_MAINTENANCE_PROBLEM: "Maintenance en cours.",
  13789. ERROR_MAINTENANCE_SOLUTION: "Revenez dans quelques instants.",
  13790. LINK_TO_LOCATION: "Lien vers l'emplacement",
  13791. MENU_COPY: "Copie",
  13792. LINK_ALERT_COPY: "Utiliser CTRL+CMD C pour copier.",
  13793. ROTATE: "Faire pivoter",
  13794. INSIDE: "Intérieure",
  13795. MOVE: "Se déplacer",
  13796. ZOOM: "Zoom"
  13797. }
  13798. }
  13799. , {}],
  13800. 114: [function(e, t, i) {
  13801. "use strict";
  13802. t.exports = {
  13803. PAGE_TITLE: "",
  13804. LOADING: "読み込み中",
  13805. PRESENTED_BY_CAPS: "PRESENTED BY",
  13806. POWERED_BY: "powered by",
  13807. POWERED_BY_CAPS: "POWERED BY",
  13808. DESKTOP_SHORT_CTA: "クリックしてこの3D Spaceを探索",
  13809. MOBILE_SHORT_CTA: "タップしてこの3D Spaceを探索",
  13810. PRESENTED_BY: "Presented by ",
  13811. MORE: "全て表示 ",
  13812. LESS: "閉じる ",
  13813. TAG_CONTENT: "tag™コンテンツ ",
  13814. SHOW: "表示",
  13815. HIDE: "非表示",
  13816. DOLLHOUSE: "ドールハウス",
  13817. FLOOR_PLAN: "フロアプラン",
  13818. OPEN_HIGHLIGHTS: "ハイライトを開く",
  13819. CLOSE_HIGHLIGHTS: "閉じる",
  13820. PREVIOUS: "前へ",
  13821. PLAY: "再生",
  13822. PAUSE: "一時停止",
  13823. NEXT: "次へ",
  13824. EXPLORE_3D_SPACE: "3DSpaceの探索",
  13825. VIEW_DOLLHOUSE: "ドールハウスの表示",
  13826. SOCIAL_SHARING: "このSpaceを共有する",
  13827. VIEW_IN_VR: "VRで表示",
  13828. VIEW_FULLSCREEN: "フルスクリーン表示",
  13829. EXIT_FULLSCREEN: "フルスクリーン表示を終了",
  13830. ZOOM_IN: "ズームイン",
  13831. ZOOM_OUT: "ズームアウト",
  13832. FLOOR_NAME: "フロア ",
  13833. FLOOR_ALL: "すべて",
  13834. TERMS: "規約",
  13835. PORT_TERMS: "port規約",
  13836. TERMS_OF_USE: "利用規約",
  13837. CLOSE_TERMS: "閉じる",
  13838. TERMS_TEXT_FILE: "terms-jp-JP.html",
  13839. TERMS_FAIL: "規約を取得できませんでした。利用規約を表示するためにインターネットに接続されていることを確認してください。",
  13840. WEBVR_FOR_DAYDREAM: "Daydream View用",
  13841. WEBVR_ENTER_WEBVR: "VRに入る",
  13842. WEBVR_DIFFERENT_HEADSET: "別のヘッドセットをお持ちですか?",
  13843. WEBVR_LEARN_MORE: "もっと詳しく",
  13844. WEBVR_VIEW_SPACE: "VRでSpaceを表示",
  13845. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13846. WEBVR_DAYDREAM_PHONE: "Daydream対応スマホ",
  13847. WEBVR_FOR_CARDBOARD: "Google Cardboard用",
  13848. WEBVR_VIEW_CARDBOARD: "またはGoogle Cardboardで表示",
  13849. VR_VIEW_SPACE: "バーチャルリアリティでSpaceを表示",
  13850. VR_LEARN_MORE_CAPS: "もっと詳しく",
  13851. VR_PREVIOUS_CAPS: "前へ",
  13852. VR_NEXT_CAPS: "次へ",
  13853. VR_GOT_IT_CAPS: "了解",
  13854. VR_SHOW_SUPPORTED: "タップして次を使用してVRでSpaceを表示: ",
  13855. VR_SHOW_UNSUPPORTED: "お使いのデバイスはVRでSpaceを表示する最低要件を満たしていません",
  13856. VR_SHOW_IOS_1: "タップしてVRでSpaceを表示",
  13857. VR_SHOW_IOS_2: "表示するにはport VRアプリと互換性のあるiPhoneが必要です",
  13858. VR_WHAT_YOU_NEED: "必要なもの",
  13859. VR_NEED_CARDBOARD: "Google Cardboardに必要なもの",
  13860. VR_NEED_SAMSUNG: "Samsung Gear VRに必要なもの",
  13861. VR_NEED_DAYDREAM: "事前にDaydream Viewとのペアリングが必要です",
  13862. VR_NEED_DAYDREAM_PHONE: "Daydream対応スマホ",
  13863. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13864. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13865. VR_APP: "port VRアプリ",
  13866. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13867. VR_COMPATIBLE_IPHONES_1: "iPhone",
  13868. VR_COMPATIBLE_IPHONES_2: "iOS 9.1以降で動作するiPhone 5s以降のモデル",
  13869. VR_COMPATIBLE_IPHONES_3: "互換性のあるiPhone",
  13870. VR_COMPATIBLE_ANDROID: "互換性のあるAndroidデバイス",
  13871. VR_COMPATIBLE_ANDROID_LONG: "Android OS 4.4.4以降で動作する互換性のあるAndroidデバイスの4.5~5.5インチディスプレイ",
  13872. VR_ANDROID_DETAIL: "Android OS 4.4.4以降で動作する4.5~5.5インチディスプレイ",
  13873. VR_ANDROID_DVICES: "Androidデバイス",
  13874. VR_COMPATIBLE_SAMSUNG: "互換性のあるSamsungデバイス",
  13875. VR_SAMSUNG_DETAIL: "Galaxy S5以降のモデル",
  13876. VR_APP_FOR_CARDBOARD: "Google Cardboard用のport VRアプリ",
  13877. VR_APP_FOR_SAMSUNG: "Gear VR 用のport VRアプリ",
  13878. VR_APP_FOR_ANDROID: "Androidフォン用のport VRアプリ",
  13879. VR_APP_OPEN: "port VRアプリで開く",
  13880. VR_DOWNLOAD_HERE: "ここからダウンロード",
  13881. VR_REQUIRE_HEADSET: "Android 用のVRヘッドセットとport VRアプリ をインストールする必要があります",
  13882. VR_REDIRECT_TO_STORE: "アプリがインストールされていない場合、App Storeにリダイレクトされます",
  13883. VR_IMPROPER_EMBED: "お使いのウェブブラウザでVRがサポートされるようport Spaceが適切に埋め込まれていません。",
  13884. VR_OPEN_ANDROID_LINK: "お使いの携帯電話でリンクを開いてください",
  13885. VR_ANDROID_OPTIONS: "利用可能なVRヘッドセットオプション",
  13886. SHARE_TO: "共有先",
  13887. SHARE_LINK: "ダイレクトリンク",
  13888. SHARE_EXPLORE: "探索",
  13889. SHARE_AT: "場所",
  13890. SHARE_WITH: "使用アプリ",
  13891. SHARE_3D: "3Dで",
  13892. SHARE_COPIED: "コピーされました!",
  13893. ERROR_BROWSER_SOLUTION: "3D探索するには、新しいバージョンのブラウザをインストールしてください",
  13894. ERROR_BROWSER_EXPLANATION: "WebGLにはモダンブラウザが必要です。",
  13895. ERROR_GENERIC_PROBLEM: "問題が発生しました。",
  13896. ERROR_GENERIC_SOLUTION: "ブラウザを再起動してください。",
  13897. ERROR_GENERIC_ACTIONS_1: "問題が解決しない場合は、",
  13898. ERROR_GENERIC_ACTIONS_2: "サポートされているブラウザをインストールしてください",
  13899. ERROR_GENERIC_ACTIONS_3: "または",
  13900. ERROR_GENERIC_ACTIONS_4: "トラブルシューティングガイドを参照してください",
  13901. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "ブラウザがサポートされていません。",
  13902. ERROR_WEBGL_IOS_PROBLEM: "サポートされていないiOSバージョンです。",
  13903. ERROR_WEBGL_IOS_SOLUTION: "3D探索するには、iOS 8以降にアップグレードしてください。",
  13904. ERROR_WEBGL_IOS_ACTIONS_1: "以下の順にタップします:",
  13905. ERROR_WEBGL_IOS_ACTIONS_2: "設定 > 全般 > ソフトウェアの更新",
  13906. ERROR_WEBGL_SAFARI_PROBLEM: "WebGLを有効にして3Dで探索します。",
  13907. ERROR_WEBGL_SAFARI_ACTIONS_1: "以下の順にクリックします:",
  13908. ERROR_WEBGL_SAFARI_ACTIONS_2: "環境設定 > 詳細 > メニューバーに開発メニューを表示",
  13909. ERROR_WEBGL_SAFARI_ACTIONS_3: "その後、以下の順にクリックします:",
  13910. ERROR_WEBGL_SAFARI_ACTIONS_4: "開発 > WebGLを有効にする",
  13911. ERROR_MISSING_URLS_PROBLEM: "このモデルではパノラマを使用できません。",
  13912. ERROR_MISSING_URLS_EXPLANATION: "これは古いモデルです。ウェブサイト所有者が新しいモデルを開発中かもしれません。",
  13913. ERROR_LOADING_FAILED_PROBLEM: "モデルは利用できません。",
  13914. ERROR_LOADING_FAILED_ACTIONS_1: "問題が解決しない場合は、",
  13915. ERROR_LOADING_FAILED_ACTIONS_2: "トラブルシューティングガイドを参照してください",
  13916. ERROR_MAINTENANCE_PROBLEM: "メンテナンスは進行中です。",
  13917. ERROR_MAINTENANCE_SOLUTION: "しばらくしてからやり直し てください。",
  13918. LINK_TO_LOCATION: "ロケーションへのリンク",
  13919. MENU_COPY: "コピー",
  13920. LINK_ALERT_COPY: "コピーするにはCTRL/CMD + Cを使用してください。",
  13921. ROTATE: "回転",
  13922. MOVE: "移動",
  13923. INSIDE: "内側",
  13924. ZOOM: "ズーム",
  13925. HELP: "ヘルプ",
  13926. HELP_NAVIGATION_TAB: "ナビゲーション",
  13927. HELP_MORE_HELP_TAB: "その他のヘルプ",
  13928. HELP_DESKTOP_PANORAMA_1A: "Spaceを見回すには、クリックしてドラッグします。",
  13929. HELP_DESKTOP_PANORAMA_2A: "移動するには、Space全体にあるリングをクリックします。",
  13930. HELP_DESKTOP_PANORAMA_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
  13931. HELP_DESKTOP_PANORAMA_1B: "または、矢印キーを使用して左右に向きを変えます。",
  13932. HELP_DESKTOP_PANORAMA_2B: "または、矢印キーを使用して前後に向きを変えます。",
  13933. HELP_DESKTOP_PANORAMA_3B: "あるいは、プラス(+)キーまたはマイナス(-)キーを使用して、ズームイン、ズームアウトします。",
  13934. HELP_DESKTOP_360_2A: "内側ビューアイコンをクリックしてSpaceに入ります。",
  13935. HELP_DESKTOP_360_2B: "または、数字キー1を押して内側ビューに入ります。",
  13936. HELP_DESKTOP_DOLLHOUSE_1A: "左クリックと左右、上下のドラッグでドールハウスを回転します。",
  13937. HELP_DESKTOP_DOLLHOUSE_2A: "右クリックと左右、上下のドラッグでドールハウスの画面上の位置を変更します。",
  13938. HELP_DESKTOP_DOLLHOUSE_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
  13939. HELP_DESKTOP_DOLLHOUSE_1B: "または、矢印キーを使用してドールハウスを回転します。",
  13940. HELP_DESKTOP_FLOORPLAN_1A: "左ボタンを押しながら、上下左右にドラッグしてフロアプランの画面上の位置を変更します。",
  13941. HELP_DESKTOP_FLOORPLAN_2A: "右ボタンを押しながら左右にドラッグして、フロアプランを回転します。",
  13942. HELP_DESKTOP_FLOORPLAN_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
  13943. HELP_DESKTOP_FLOORPLAN_2B: "または、矢印キーを使用して左右に回転します。",
  13944. HELP_DESKTOP_FLOORPLAN_3B: "または、矢印キーを使用して、ズームイン、ズームアウトします。",
  13945. HELP_MOBILE_PANORAMA_1: "Spaceを見回すには、タッチしてドラッグします。",
  13946. HELP_MOBILE_PANORAMA_2: "移動するには、Space全体にあるリングをタップします。",
  13947. HELP_MOBILE_3: "ピンチジェスチャーを使用してズームイン、ズームアウトします。",
  13948. HELP_MOBILE_360_2: "内側ビューアイコンをタップしてSpaceに入ります。",
  13949. HELP_MOBILE_DOLLHOUSE_1: "タッチして上下左右にドラッグしてドールハウスを回転します。",
  13950. HELP_MOBILE_DOLLHOUSE_2: "タッチして、2本指でドラッグしてドールハウスを配置します。",
  13951. HELP_MOBILE_FLOORPLAN_1: "タッチ&ドラッグしてフロアプランを配置します。",
  13952. HELP_MOBILE_FLOORPLAN_2: "タッチして、2本指でドラッグしてフロアプランを回転します。",
  13953. HELP_MORE_HLR_A: "ハイライト",
  13954. HELP_DESKTOP_MORE_HLR_B: "サムネイル画像を使用してSpaceを移動するために開きます。",
  13955. HELP_MORE_DOLLHOUSE_A: "ドールハウス",
  13956. HELP_DESKTOP_MORE_DOLLHOUSE_B: "クリックして3DでSpace全体のトップダウンビューを表示して回転します。",
  13957. HELP_MOBILE_MORE_DOLLHOUSE_B: "タップして3DでSpace全体のトップダウンビューを表示して回転します。",
  13958. HELP_MORE_FLOORS_A: "フロアセレクター",
  13959. HELP_DESKTOP_MORE_FLOORS_B: "Space内のフロアを切り替えます。",
  13960. HELP_MORE_TAG_A: "tag™ Posts",
  13961. HELP_DESKTOP_MORE_TAG_B: "クリックするか、カーソルを置くとSpace内の機能についての説明が表示されます。",
  13962. HELP_MOBILE_MORE_TAG_B: "タップするとSpace内の機能についての説明が表示されます。",
  13963. HELP_MORE_ZOOM_A: "ズームコントロール",
  13964. HELP_DESKTOP_MORE_ZOOM_B: "これらのコントロールまたはスクロールホイールを使用して、ズームイン、ズームアウトします。",
  13965. HELP_MORE_TOUR_A: "ツアーコントロール",
  13966. HELP_DESKTOP_MORE_TOUR_B: "ガイド付きツアー中に再生、一時停止、前方・後方に移動します。",
  13967. HELP_MORE_INSIDE_A: "内側ビュー",
  13968. HELP_DESKTOP_MORE_INSIDE_B: "クリックしてSpace内を探索します。",
  13969. HELP_MOBILE_MORE_INSIDE_B: "タップしてSpace内を探索します。",
  13970. HELP_MORE_VR_A: "VRモード",
  13971. HELP_DESKTOP_MORE_VR_B: "クリックしてバーチャルリアリティでSpaceを起動します。",
  13972. HELP_MOBILE_MORE_VR_B: "タップしてバーチャルリアリティでSpaceを起動します。",
  13973. HELP_MORE_360_A: "360° Views",
  13974. HELP_DESKTOP_MORE_360_B: "Highlight Reelの360° Viewsをクリックして屋外シーンを表示します。",
  13975. HELP_MOBILE_MORE_360_B: "Highlight Reelの360° Viewsをタップして屋外シーンを表示します。",
  13976. HELP_MORE_FULLSCREEN_A: "フルスクリーン",
  13977. HELP_DESKTOP_MORE_FULLSCREEN_B: "3D Showcaseをフルスクリーン表示にします。",
  13978. CLOSE: "閉じる"
  13979. }
  13980. }
  13981. , {}],
  13982. 115: [function(e, t, i) {
  13983. "use strict";
  13984. t.exports = {
  13985. PAGE_TITLE: "",
  13986. LOADING: "Загрузка",
  13987. PRESENTED_BY_CAPS: "ПРЕДСТАВЛЕНО",
  13988. POWERED_BY: "разработано на платформе ",
  13989. POWERED_BY_CAPS: "РАЗРАБОТАНО НА ПЛАТФОРМЕ",
  13990. DESKTOP_SHORT_CTA: "Нажмите для просмотра.",
  13991. MOBILE_SHORT_CTA: "Нажмите для просмотра.",
  13992. PRESENTED_BY: "Представлено ",
  13993. MORE: "Больше ",
  13994. LESS: "Меньше ",
  13995. TAG_CONTENT: "tag™ Контент",
  13996. SHOW: "Показать",
  13997. HIDE: "Скрыть",
  13998. DOLLHOUSE: "Dollhouse",
  13999. FLOOR_PLAN: "Планировка",
  14000. OPEN_HIGHLIGHTS: "Открыть Фотоколлаж",
  14001. CLOSE_HIGHLIGHTS: "Закрыть",
  14002. PREVIOUS: "Предыдущий",
  14003. PLAY: "Воспроизвести",
  14004. PAUSE: "Пауза",
  14005. NEXT: "Следующий",
  14006. EXPLORE_3D_SPACE: "Просмотреть 3D модель",
  14007. VIEW_DOLLHOUSE: "Посмотреть Dollhouse",
  14008. SOCIAL_SHARING: "Поделиться этой моделью",
  14009. VIEW_IN_VR: "Посмотреть в VR",
  14010. VIEW_FULLSCREEN: "Полный экран",
  14011. EXIT_FULLSCREEN: "Выйти из полноэкранного режима",
  14012. ZOOM_IN: "Увеличить",
  14013. ZOOM_OUT: "Уменьшить",
  14014. FLOOR_NAME: "Этаж ",
  14015. FLOOR_ALL: "Все",
  14016. TERMS: "Условия",
  14017. PORT_TERMS: "Правила пользования",
  14018. TERMS_OF_USE: "Условия использования",
  14019. TERMS_TEXT_FILE: "terms-ru-RU.html",
  14020. CLOSE_TERMS: "Закрыть",
  14021. TERMS_FAIL: "Не удалось загрузить условия использования. Для просмотра условий использования, пожалуйста, убедитесь, что у Вас есть подключение к Интернету.",
  14022. HELP: "Помощь",
  14023. HELP_NAVIGATION_TAB: "Навигация",
  14024. HELP_MORE_HELP_TAB: "Доп. Помощь",
  14025. CLOSE: "Закрыть",
  14026. HELP_DESKTOP_PANORAMA_1A: "Нажмите и перетащите, чтобы осмотреть пространство вокруг.",
  14027. HELP_DESKTOP_PANORAMA_2A: "Для передвижения по модели нажимайте на круги .",
  14028. HELP_DESKTOP_PANORAMA_3A: "Используйте колесо прокрутки для увеличения и уменьшения.",
  14029. HELP_DESKTOP_PANORAMA_1B: "Или используйте клавиши со стрелками для поворота влево и вправо.",
  14030. HELP_DESKTOP_PANORAMA_2B: "Или используйте стрелки для перемещения вперед и назад.",
  14031. HELP_DESKTOP_PANORAMA_3B: "Или используйте клавиши ‘плюс’ и ‘минус’ для увеличения и уменьшения изображения.",
  14032. HELP_DESKTOP_360_2A: "Нажмите на значок ‘Вид Изнутри’, чтобы увидеть внутреннюю панораму.",
  14033. HELP_DESKTOP_360_2B: "или нажмите 1 на клавиатуре, чтобы увидеть внутреннюю панораму.",
  14034. HELP_DESKTOP_DOLLHOUSE_1A: "Нажмите левую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы повернуть Dollhouse.",
  14035. HELP_DESKTOP_DOLLHOUSE_2A: "Нажмите правую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы изменить позицию Dollhouse на экране.",
  14036. HELP_DESKTOP_DOLLHOUSE_3A: "Используйте колесо прокрутки чтобы увеличить и уменьшить.",
  14037. HELP_DESKTOP_DOLLHOUSE_1B: "Или используйте клавиши со стрелками, чтобы повернуть Dollhouse.",
  14038. HELP_DESKTOP_FLOORPLAN_1A: "Нажмите левую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы изменить положение Планировки на экране.",
  14039. HELP_DESKTOP_FLOORPLAN_2A: "Нажмите правую кнопку мыши и перетащите влево или вправо, чтобы повернуть Планировку.",
  14040. HELP_DESKTOP_FLOORPLAN_3A: "Используйте колесо прокрутки чтобы увеличить и уменьшить.",
  14041. HELP_DESKTOP_FLOORPLAN_2B: "Или используйте клавиши со стрелками для поворота влево или вправо.",
  14042. HELP_DESKTOP_FLOORPLAN_3B: "Или используйте стрелки для увеличения и уменьшения.",
  14043. HELP_MOBILE_PANORAMA_1: "Нажмите и перетащите, чтобы осмотреть модель.",
  14044. HELP_MOBILE_PANORAMA_2: "Для передвижения по модели нажимайте на круги.",
  14045. HELP_MOBILE_3: "Используйте движение двумя пальцами в разные стороны, чтобы увеличить и уменьшить.",
  14046. HELP_MOBILE_360_2: "Нажмите на значок ‘Вид Изнутри’, чтобы увидеть внутреннюю панораму.",
  14047. HELP_MOBILE_DOLLHOUSE_1: "Нажмите и перетащите вверх, вниз, влево и вправо, чтобы повернуть Dollhouse.",
  14048. HELP_MOBILE_DOLLHOUSE_2: "Нажмите и перетащите, чтобы расположить Dollhouse.",
  14049. HELP_MOBILE_FLOORPLAN_1: "Нажмите и перетащите, чтобы расположить план здания.",
  14050. HELP_MOBILE_FLOORPLAN_2: "Коснитесь и перетащите двумя пальцами, чтобы повернуть план здания.",
  14051. HELP_MORE_HLR_A: "Фотоколлаж",
  14052. HELP_DESKTOP_MORE_HLR_B: "Откройте для перемещения по модели, используя иконки изображений.",
  14053. HELP_MORE_DOLLHOUSE_A: "Dollhouse",
  14054. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Нажмите и поверните сверху вниз чтобы просмотреть всю 3D модель.",
  14055. HELP_MOBILE_MORE_DOLLHOUSE_B: "Нажмите и поверните сверху вниз чтобы просмотреть всю 3D модель.",
  14056. HELP_MORE_FLOORS_A: "Выбор Этажа",
  14057. HELP_DESKTOP_MORE_FLOORS_B: "Переключение между этажами.",
  14058. HELP_MORE_TAG_A: "tag™ Posts",
  14059. HELP_DESKTOP_MORE_TAG_B: "Нажмите или наведите курсор мыши для получения информации о функциях в Пространстве.",
  14060. HELP_MOBILE_MORE_TAG_B: "Нажмите для получения информации о функциях.",
  14061. HELP_MORE_ZOOM_A: "Масштаб",
  14062. HELP_DESKTOP_MORE_ZOOM_B: "Используйте эти кнопки для увеличения и уменьшения изображения или используйте колесо прокрутки.",
  14063. HELP_MORE_TOUR_A: "Управление Туром",
  14064. HELP_DESKTOP_MORE_TOUR_B: "Используйте кнопки Воспроизвести, Пауза, Вперед и Назад для управления фотоколлажем.",
  14065. HELP_MORE_INSIDE_A: "Вид Изнутри",
  14066. HELP_DESKTOP_MORE_INSIDE_B: "Нажмите, чтобы просмотреть модель изнутри.",
  14067. HELP_MOBILE_MORE_INSIDE_B: "Нажмите, чтобы просмотреть модель изнутри.",
  14068. HELP_MORE_VR_A: "Режим VR",
  14069. HELP_DESKTOP_MORE_VR_B: "Нажмите, чтобы запустить модель в виртуальной реальности.",
  14070. HELP_MOBILE_MORE_VR_B: "Нажмите, чтобы запустить модель в виртуальной реальности.",
  14071. HELP_MORE_360_A: "360° Views",
  14072. HELP_DESKTOP_MORE_360_B: "Нажмите на “360 Views” в фотоколлаже, чтобы просмотреть внешний пейзаж.",
  14073. HELP_MOBILE_MORE_360_B: "Нажмите на “360 Views” в фотоколлаже, чтобы просмотреть внешний пейзаж.",
  14074. HELP_MORE_FULLSCREEN_A: "Полный экран",
  14075. HELP_DESKTOP_MORE_FULLSCREEN_B: "Развернуть 3D Showcase во весь экран.",
  14076. WEBVR_FOR_CARDBOARD: "Для Google Cardboard",
  14077. WEBVR_FOR_DAYDREAM: "Для просмотра в Daydream",
  14078. WEBVR_ENTER_WEBVR: "ВОЙТИ В VR ",
  14079. WEBVR_DIFFERENT_HEADSET: "Есть другой VR-шлем?",
  14080. WEBVR_LEARN_MORE: "Узнать больше",
  14081. WEBVR_VIEW_SPACE: "Запустить модель в VR",
  14082. WEBVR_DAYDREAM_VIEW: "Посмотреть в Daydream",
  14083. WEBVR_DAYDREAM_PHONE: "Daydream-готовый телефон",
  14084. WEBVR_VIEW_CARDBOARD: "Или просмотреть в Google Cardboard",
  14085. VR_WHAT_YOU_NEED: "Что Вам потребуется...",
  14086. VR_NEED_DAYDREAM_PHONE: "Daydream-готовый телефон",
  14087. VR_GOOGLE_DAYDREAM: "Google Daydream",
  14088. VR_APP: "port VR App",
  14089. VR_APP_OPEN: "Или открыть через приложение port VR",
  14090. VR_COMPATIBLE_ANDROID_LONG: 'Совместимые Android устройства с диагональю экрана 4.5"-5.5" дюймов и Android версией 4.4.4, и выше',
  14091. VR_SAMSUNG_DETAIL: "Galaxy S6 и выше",
  14092. VR_APP_FOR_ANDROID: "Приложение port VR для Android",
  14093. VR_NEED_DAYDREAM: "Необходимо для соединением с Daydream",
  14094. VR_VIEW_SPACE: "Запустить модель в VR",
  14095. VR_LEARN_MORE_CAPS: "УЗНАТЬ БОЛЬШЕ",
  14096. VR_PREVIOUS_CAPS: "ПРЕДЫДУЩИЙ",
  14097. VR_NEXT_CAPS: "СЛЕДУЮЩИЙ",
  14098. VR_GOT_IT_CAPS: "ЯСНО",
  14099. VR_SHOW_SUPPORTED: "Нажмите, чтобы просмотреть модель в VR с помощью",
  14100. VR_SHOW_UNSUPPORTED: "Извините, но Ваше устройство не соответствует минимальным требованиям для просмотра модели в VR.",
  14101. VR_SHOW_IOS_1: "Нажмите, чтобы просмотреть модель в VR",
  14102. VR_SHOW_IOS_2: "Для просмотра требуется приложение port VR и совместимый iPhone",
  14103. VR_NEED_CARDBOARD: "Что Вам потребуется для Google Cardboard",
  14104. VR_NEED_SAMSUNG: "Что Вам потребуется для Samsung Gear VR",
  14105. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  14106. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  14107. VR_COMPATIBLE_IPHONES_1: "iPhones",
  14108. VR_COMPATIBLE_IPHONES_2: "iPhone 5s или новее с iOS 9.1 и выше",
  14109. VR_COMPATIBLE_IPHONES_3: "Совместимые модели iPhone",
  14110. VR_COMPATIBLE_ANDROID: "Совместимые Android устройства",
  14111. VR_ANDROID_DETAIL: 'Экран от 4.5" до 5.5" и Android 4.4.4, и выше',
  14112. VR_ANDROID_DVICES: "Android устройства",
  14113. VR_COMPATIBLE_SAMSUNG: "Совместимые Samsung устройства",
  14114. VR_APP_FOR_CARDBOARD: "Приложение port VR для Google Cardboard",
  14115. VR_APP_FOR_SAMSUNG: "Приложение port VR для Gear VR",
  14116. VR_DOWNLOAD_HERE: "Скачать здесь",
  14117. VR_REQUIRE_HEADSET: "Требуется VR-шлем и установленное приложение port VR для Android",
  14118. VR_REDIRECT_TO_STORE: "Если приложение не установлено, Вы будете перенаправлены на страницу магазина приложений.",
  14119. VR_IMPROPER_EMBED: "port модель не встроена должным образом для поддержки VR в вашем веб-браузере.",
  14120. VR_OPEN_ANDROID_LINK: "Откройте ссылку на Вашем мобильном телефоне",
  14121. VR_ANDROID_OPTIONS: "Доступные опции VR-шлемов",
  14122. SHARE_TO: "Поделиться",
  14123. SHARE_LINK: "Прямая ссылка",
  14124. SHARE_EXPLORE: "просмотреть",
  14125. SHARE_AT: "на",
  14126. SHARE_WITH: "с",
  14127. SHARE_3D: "в 3D",
  14128. SHARE_COPIED: "Скопировано!",
  14129. ERROR_BROWSER_SOLUTION: "установите новый браузер, чтобы просмотреть 3D пространство.",
  14130. ERROR_BROWSER_EXPLANATION: "WebGL требует современный браузер.",
  14131. ERROR_GENERIC_PROBLEM: "Ой, что-то пошло не так.",
  14132. ERROR_GENERIC_SOLUTION: "Перезапустите браузер.",
  14133. ERROR_GENERIC_ACTIONS_1: "Если проблема не устранена, ",
  14134. ERROR_GENERIC_ACTIONS_2: "установите поддерживаемый браузер",
  14135. ERROR_GENERIC_ACTIONS_3: " или ",
  14136. ERROR_GENERIC_ACTIONS_4: "смотрите наше руководство по устранению неполадок",
  14137. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Браузер не поддерживается.",
  14138. ERROR_WEBGL_IOS_PROBLEM: "iOS-версия не поддерживается.",
  14139. ERROR_WEBGL_IOS_SOLUTION: "Обновите до iOS 8 или выше, чтобы просмотреть пространство в 3D.",
  14140. ERROR_WEBGL_IOS_ACTIONS_1: "Нажмите ",
  14141. ERROR_WEBGL_IOS_ACTIONS_2: "Настройки > Общие > Обновление ПО",
  14142. ERROR_WEBGL_SAFARI_PROBLEM: "Включите WebGL для 3D-просмотра.",
  14143. ERROR_WEBGL_SAFARI_ACTIONS_1: "Нажмите ",
  14144. ERROR_WEBGL_SAFARI_ACTIONS_2: "Настойки > Дополнения > Показывать меню “Разработка” в строке меню",
  14145. ERROR_WEBGL_SAFARI_ACTIONS_3: "Затем нажмите ",
  14146. ERROR_WEBGL_SAFARI_ACTIONS_4: "Разработка > Разрешить WebGL",
  14147. ERROR_MISSING_URLS_PROBLEM: "Ой, для этой модели нет панорамы.",
  14148. ERROR_MISSING_URLS_EXPLANATION: "Эта модель устарела. У владельца веб-сайта может быть новая модель.",
  14149. ERROR_LOADING_FAILED_PROBLEM: "Ой, модель недоступна.",
  14150. ERROR_LOADING_FAILED_ACTIONS_1: "Если проблема не устранена, ",
  14151. ERROR_LOADING_FAILED_ACTIONS_2: "посмотрите наше руководство по устранению неполадок",
  14152. ERROR_MAINTENANCE_PROBLEM: "Выполняется техническое обслуживание.",
  14153. ERROR_MAINTENANCE_SOLUTION: "Пожалуйста, попробуйте снова через несколько минут.",
  14154. LINK_TO_LOCATION: "Ссылка на местоположение",
  14155. MENU_COPY: "Копировать",
  14156. LINK_ALERT_COPY: "Для того, чтобы скопировать, пожалуйста, используйте CTRL/CMD + C.",
  14157. ROTATE: "Вращать",
  14158. MOVE: "Передвигаться",
  14159. INSIDE: "Вид изнутри",
  14160. ZOOM: "Масштаб"
  14161. }
  14162. }
  14163. , {}],
  14164. 116: [function(e, t, i) {//main.js
  14165. (function(t) {
  14166. "use strict";
  14167. var modelProgressBase = 0.4;
  14168. var progressUpdate = function(e){ // 0 <= e <= 1
  14169. console.log('e1:'+e)
  14170. e = Math.round(modelProgressBase * e * 100);
  14171. console.log('e2:'+e)
  14172. var t = $('.progressbar');
  14173. t.find('.bar').css('width',e+'%');
  14174. t.find('.label').css('left', t.width() * e / 100 - 15 + 'px' ); //上面跟着的字的百分比
  14175. t.find('.perc').text(e +'%'); //具体数字的百分比
  14176. }
  14177. $('#gui-loading').fadeIn(200);
  14178. progressUpdate(0.1)
  14179. var fileName = g_version ? 'modeldata.js' : 'someData.json' ;
  14180. $.ajax(g_Prefix + "data/"+window.number+"/"+fileName+"?"+randomTime().getTime(),{dataType: "json"}).done( function(e){ //改
  14181. var data = matcher(e);
  14182. data.files.templates[0] = g_Prefix + e.files.templates[0].replace("{{number}}",window.number);
  14183. data.user = {
  14184. "is_authenticated": false,
  14185. "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"]
  14186. }
  14187. try{//处理一下导览数据,旧的曾有导览数据是错误的,将它删除
  14188. var newImages = [];
  14189. data.model.images.forEach((tourImg)=>{tourImg.thumbnail_signed_src && newImages.push(tourImg)})
  14190. data.model.images = newImages
  14191. }catch(e){console.log(e) }
  14192. //data.flyInOnlyBySwitch = true
  14193. window.MP_PREFETCHED_MODELDATA = data;
  14194. data.model.summary = data.summary
  14195. data.model.name = data.name
  14196. for(let i in data){
  14197. data[i] == "false" && (data[i] = false)
  14198. }
  14199. progressUpdate(0.7);
  14200. StartLoad(); //xzw someData.js是我整合的 原本在html里 但这样每个场景的html都不一样了
  14201. if(data.weixinDesc){
  14202. g_weixinObj.desc = data.weixinDesc;
  14203. }
  14204. if(data.shareImgUrl){
  14205. g_weixinObj.imgUrl = data.shareImgUrl
  14206. }
  14207. window.wx && manage.weixinShare();
  14208. //初始画面
  14209. data.camera_start && data.camera_start.thumbImg && E(data.camera_start.thumbImg)
  14210. function E(e) {
  14211. $("<img/>").attr("src", e).on("load", function() {
  14212. $("#gui-thumb").css("backgroundImage", "url(" + e + ")").fadeIn(500),
  14213. $(this).remove()
  14214. })
  14215. }
  14216. })
  14217. function StartLoad(){//当加载完data后
  14218. function i() {
  14219. var e = Y.getModelIDFromQueryString();
  14220. if (!e)
  14221. return b(null, "loading-failed");
  14222. var t = Y.parseSidUrl(e)
  14223. , i = l()
  14224. , a = c()
  14225. , s = o()
  14226. , u = V.quickstart.enabled
  14227. , g = null
  14228. , m = null
  14229. , v = null
  14230. , w = null
  14231. , T = null
  14232. , x = null
  14233. , S = null
  14234. , M = null
  14235. , R = null
  14236. , P = null
  14237. , O = null
  14238. , L = null
  14239. , N = new ue;
  14240. r(s);
  14241. h({ //MP开头写法
  14242. urlBase: t.urlBase
  14243. }).then(function() {
  14244. return re.init(),
  14245. d(t, e) //getModel and load
  14246. }).then(function(e) {
  14247. progressUpdate(0.9)
  14248. return P = e,
  14249. p(P, V.appConfig.segment_key, V.appConfig.keen_write_key, V.appConfig.keen_project_id, {
  14250. startSource: i,
  14251. autoplay: V.autoplay,
  14252. quickstart: u
  14253. }),
  14254. P.urls.init()
  14255. }).then(function() {
  14256. return P.loadPanos()
  14257. }).then(function() {
  14258. m = X.getStartCameraOptions(P, P.panos),
  14259. S = A(P),
  14260. O = y(u, m.mode),
  14261. v = O.controls,
  14262. w = O.player,
  14263. T = O.director,
  14264. x = O.tagManager,
  14265. M = O.tileDownloader,
  14266. R = O.qualityManager,
  14267. L = O.panoRenderer,
  14268. C(P, S, O, s),
  14269. w.director = T,//xzw add
  14270. P.supportsTiles && M.start(),
  14271. !u || m.mode === D.PANORAMA && m.pano || (de.warn("Tried to quickstart, but failed as we are not starting in inside mode."),
  14272. u = !1);
  14273. var e = null;
  14274. if (u) {
  14275. de.warn("Quickstart engaged. Hold on to your knickers.");
  14276. var t = v.controls[D.PANORAMA];
  14277. g = new ie(R,S.scene,S.camera,t,s),
  14278. _(S, s, P),
  14279. e = g.load(m).then(function() {
  14280. S.addComponent(g),
  14281. S.once(le.AfterRender, function() {
  14282. de.warn("First render after quickstart load finished.")
  14283. })
  14284. })
  14285. }
  14286. window.flyToFirst = function(){//xzw add
  14287. var pano = w.model.panos.get("8d778e19657f433fb9cf8947d823bb70");
  14288. var q = new _x.Quaternion(0.7099827027821568,-0.07708150183830938,0.6958985789714591,0.07555241737970636);
  14289. var lookAtPoint = new _x.Vector3(0,0,-1).applyQuaternion(q).add(pano.position);
  14290. w.flyToPano({pano:pano, lookAtPoint:lookAtPoint})
  14291. };
  14292. return $.when(e, U.startLoading(P, w, T, V.autoplay, u, N))
  14293. }).then(function() {
  14294. return f(P, U.onProgress, i, !u, a)
  14295. }).then(function() {
  14296. if (m.quickstart = u,
  14297. I(P, S, O, s),
  14298. S.started || _(S, s, P),
  14299. H.modelLoaded(P, w, v, V.autoplay),
  14300. E(w, P, m, V.autoplay).done(function() {
  14301. T.autoTour()
  14302. }),
  14303. !P.supportsTiles) {
  14304. var e = new Z(P,w);
  14305. e.start()
  14306. }
  14307. u && (S.removeComponent(g),
  14308. g.destroy(),
  14309. m.pano.enter()),
  14310. U.init(P, T, w, v, S, m, H.getSessionId()),
  14311. U.endLoading(P, T, x),
  14312. S.once(le.AfterRender, function() {
  14313. N.setAppReadyTime();
  14314. var e = N.calcFullLoadingTime();
  14315. de.warn("Total load time: " + e / 1e3),
  14316. H.loadComplete(e),
  14317. de.warn("First render after model load finished.")
  14318. }),
  14319. S.on(le.MemoryUsageUpdated, n)
  14320. }).fail(b.bind(this, e))
  14321. }
  14322. function n(e) {
  14323. ce.update(e)
  14324. }
  14325. function r(e) {
  14326. de.info("Version", "2.25.6-0-gd87e5b1"),
  14327. q.defaultMaxListeners = 1e3,
  14328. a(e),
  14329. s()
  14330. }
  14331. function o() {
  14332. return document.getElementById("player")
  14333. }
  14334. function a(e) {
  14335. e.addEventListener("dragenter", T, !1),
  14336. e.addEventListener("dragover", T, !1)
  14337. }
  14338. function s() {
  14339. F.valueFromHash("title", !0) || $(document).ready(function() {
  14340. var e = $(".model-title");
  14341. e.hide()
  14342. })
  14343. }
  14344. function l() {
  14345. return F.valueFromHash("play", !1) ? "autoplay" : F.inIframe() ? "click" : "fullpage"
  14346. }
  14347. function c() {
  14348. return {
  14349. panoElementsToLoad: 6,
  14350. modelElementsToLoad: 0,
  14351. totalElementsLoaded: 0,
  14352. totalElementsToLoad: 0,
  14353. totalPercentageLoaded: 0,
  14354. progressCallback: null
  14355. }
  14356. }
  14357. function h(e) {
  14358. return K.loadFeatureFlags(e).done(function(e) {
  14359. K.updateDependentSettings(e, V)
  14360. })
  14361. }
  14362. // function u(e) {
  14363. // return Q.get(e.urlBase + "/api/v1/config/showcase", {
  14364. // responseType: "json",
  14365. // prefetchFrom: "config"
  14366. // }).then(function(e) {
  14367. // return e ? void j.extendObject(V.appConfig, e) : {}
  14368. // }, function(e) {
  14369. // return de.warn("Failed loading runtime config, using defaults."),
  14370. // $.when({})
  14371. // })
  14372. // }
  14373. function d(e, t) {
  14374. var i = B.getModel({
  14375. url: t,
  14376. floors: F.valueFromHash("f", !0),
  14377. autoload: !1
  14378. })
  14379. ;
  14380. return $.when(i, n).then(null, function(e) {
  14381. return this
  14382. })
  14383. }
  14384. function p(e, t, i, n, r) {
  14385. de.info("Model data loaded"),
  14386. de.debug("UUID: " + e.data.job.uuid),
  14387. J.init(K.getFlags()),
  14388. i && H.initKeen({
  14389. token: i,
  14390. appId: n
  14391. }),
  14392. H.initSegment({
  14393. model: e.sid,
  14394. version: "2.25.6-0-gd87e5b1",
  14395. startSource: r.startSource,
  14396. token: t,
  14397. autoplay: r.autoplay,
  14398. quickstart: r.quickstart
  14399. })
  14400. }
  14401. function f(e, t, i, n, r) {
  14402. return r.progressCallback = t,
  14403. H.sessionStart(),
  14404. e.load(n).progress(g.bind(this, r))
  14405. }
  14406. function g(e, t) {
  14407. e.modelElementsToLoad = t[1],
  14408. v(e),
  14409. m(e)
  14410. }
  14411. function m(e) {
  14412. e.totalElementsLoaded++,
  14413. e.totalPercentageLoaded = e.totalElementsLoaded / e.totalElementsToLoad,
  14414. //----许钟文-----------------模型进度条向后调整
  14415. isNaN(e.totalPercentageLoaded) && (e.totalPercentageLoaded = 0);
  14416. e.totalPercentageLoaded = modelProgressBase + (1-modelProgressBase)*e.totalPercentageLoaded;
  14417. console.log('pro:'+e.totalPercentageLoaded)
  14418. //---------------------------
  14419. e.progressCallback && e.progressCallback(100 * e.totalPercentageLoaded)
  14420. }
  14421. function v(e) {
  14422. e.totalElementsToLoad = e.modelElementsToLoad + e.panoElementsToLoad
  14423. }
  14424. function A(e) {
  14425. var t = new x.PerspectiveCamera;
  14426. t.layers.enable(he.PANOMARKERS),
  14427. t.layers.enable(he.RETICULE),
  14428. t.layers.enable(he.TAG);
  14429. var i = new x.Scene
  14430. , n = new x.AmbientLight(16777215);
  14431. i.add(n),
  14432. i.skybox = new W,
  14433. i.add(i.skybox),
  14434. i.plane = new x.Mesh(new x.PlaneBufferGeometry(1e5,1e5),new x.RawShaderMaterial({
  14435. side: x.DoubleSide
  14436. })),
  14437. i.plane.position.y = 0,
  14438. i.plane.rotateX(-Math.PI / 2),
  14439. i.plane.material.visible = !1,
  14440. i.add(i.plane),
  14441. i.updateMatrixWorld(),
  14442. V.showScreenshotLocations && e.data.images.forEach(function(e) {
  14443. if (e.metadata && e.metadata.camera_position) {
  14444. var t = e.metadata.camera_position
  14445. , n = new x.Mesh(new x.BoxGeometry(.3,.3,.3));
  14446. n.position = t.clone(),
  14447. i.add(n);
  14448. var r = e.metadata.camera_quaternion
  14449. , o = new x.Vector3(0,0,-1).applyQuaternion(r);
  14450. i.add(new x.ArrowHelper(o,t.clone(),1,16711680))
  14451. }
  14452. }),
  14453. V.showAxis && (i.add(new x.ArrowHelper(new x.Vector3(0,1,0),new x.Vector3(0,0,0),1,255)),
  14454. i.add(new x.ArrowHelper(new x.Vector3(0,0,1),new x.Vector3(0,0,0),1,16711680)),
  14455. i.add(new x.ArrowHelper(new x.Vector3(1,0,0),new x.Vector3(0,0,0),1,65280)));
  14456. var r = new te(i,t,z);
  14457. return r
  14458. }
  14459. function y(e, t) {
  14460. var i = e ? 1 : 1e3
  14461. , n = J.tilegen || J.imgopt ? 6 : 2;
  14462. n = F.valueFromHash("tileconc", n);
  14463. var r = new ne
  14464. , o = new ae({
  14465. concurrentDownloads: n
  14466. })
  14467. , a = new se
  14468. , s = new P
  14469. , l = new M
  14470. , c = new S(t)
  14471. , h = new R
  14472. , u = new O(i)
  14473. , d = new L
  14474. , p = new oe;
  14475. return {
  14476. qualityManager: r,
  14477. panoRenderer: a,
  14478. tileDownloader: o,
  14479. player: c,
  14480. director: l,
  14481. modelManager: s,
  14482. tagManager: p,
  14483. displayController: u,
  14484. labelDisplayController: d,
  14485. controls: h
  14486. }
  14487. }
  14488. function C(e, t, i, n) {
  14489. var r = i.controls
  14490. , o = i.qualityManager
  14491. , a = i.panoRenderer
  14492. , s = i.tileDownloader
  14493. , l = i.modelManager;
  14494. r.init(n, l),
  14495. ee.init(i.director, r, i.player, l, t),
  14496. o.init(l),
  14497. s.init(o),
  14498. a.init(t, s, o),
  14499. l.init(s, a, o),
  14500. l.addModel(e),
  14501. t.addComponent(G)
  14502. }
  14503. function I(e, t, i, n) {
  14504. var r = i.qualityManager
  14505. , o = i.panoRenderer
  14506. , a = i.tileDownloader
  14507. , s = i.modelManager
  14508. , l = i.player
  14509. , c = i.director
  14510. , h = i.tagManager
  14511. , u = i.displayController
  14512. , d = i.labelDisplayController
  14513. , p = i.controls;
  14514. t.scene.add(e),
  14515. t.qualityManager = r;
  14516. var f = {
  14517. camera: t.camera,
  14518. director: c,
  14519. modelManager: s,
  14520. tileDownloader: a,
  14521. panoRenderer: o,
  14522. qualityManager: r,
  14523. tagManager: h,
  14524. container: n,
  14525. controls: p
  14526. };
  14527. l.init(f),
  14528. l.setScene(t.scene),
  14529. h.init(s, l),
  14530. c.init(l, s),
  14531. u.init(c, l, s, h, n),
  14532. d.init(l, s, n),
  14533. z.bindEvents(l),
  14534. t.addComponent(h),
  14535. t.addComponent(l),
  14536. t.addComponent(o),
  14537. l.sceneRenderer = t; //xzw add 方便resize
  14538. }
  14539. function E(e, t, i, n) {
  14540. return de.info("Starting player in " + i.mode),
  14541. H.report(t.sid, "started-playing", n, i.quickstart),
  14542. e.start(i)
  14543. }
  14544. function b(e, t) {
  14545. de.error(t),
  14546. k.error(t),
  14547. H.report(e, "error-" + t)
  14548. }
  14549. function w(e) {
  14550. var t = F.details();
  14551. t && "Safari" === t.name && t.version > 500 && t.version < 600 ? (k.error("webgl-safari"),
  14552. H.report(e, "error-webgl-safari")) : (k.error("webgl-generic"),
  14553. H.report(e, "error-webgl-generic"))
  14554. }
  14555. function _(e, t, i) {
  14556. try {
  14557. e.start(t)
  14558. } catch (e) {
  14559. throw de.warn(e.message),
  14560. w(i.sid),
  14561. e
  14562. }
  14563. }
  14564. function T(e) {
  14565. e.stopPropagation(),
  14566. e.preventDefault()
  14567. }
  14568. //czj 判断someData 有没有hoticon字段 修改热点的样式
  14569. if (window.MP_PREFETCHED_MODELDATA.hoticon){
  14570. g_HotImage = {
  14571. point: window.MP_PREFETCHED_MODELDATA.hoticon.default || "https://super.4dage.com/images/4dagePoint2.png",
  14572. point2: window.MP_PREFETCHED_MODELDATA.hoticon.higt || "https://super.4dage.com/images/4dagePoint.png"
  14573. } ;
  14574. }
  14575. //czj 判断someData 有没有backgroundMusic 添加音乐
  14576. if (window.MP_PREFETCHED_MODELDATA.backgroundMusic) {
  14577. if(window.isLocal) g_bgAudio.src = manage.dealURL(window.MP_PREFETCHED_MODELDATA.backgroundMusic) ;
  14578. else g_bgAudio.src = window.MP_PREFETCHED_MODELDATA.backgroundMusic.substr(0,4)=="http" ? window.MP_PREFETCHED_MODELDATA.backgroundMusic : "//" + window.MP_PREFETCHED_MODELDATA.backgroundMusic;
  14579. $("#volume").show();
  14580. }else if (g_version === "one"){
  14581. g_bgAudio.src = g_Prefix+"/audio/"+"audio"+window.number + "/background.mp3";
  14582. //g_bgAudio.src = manage.dealURL(src) ;
  14583. }
  14584. //隐藏公司logo
  14585. if(window.MP_PREFETCHED_MODELDATA.loadlogo){
  14586. showLogo();
  14587. }
  14588. e("./lib/three75-shim"),
  14589. e("./lib/array-polyfill"),
  14590. e("./lib/performance-polyfill"),
  14591. e("./lib/shaders/CopyShader.js"),
  14592. e("./lib/shaders/HorizontalBlurShader.js"),
  14593. e("./lib/shaders/VerticalBlurShader.js"),
  14594. e("./lib/postprocessing/EffectComposer.js"),
  14595. e("./lib/postprocessing/RenderPass.js"),
  14596. e("./lib/postprocessing/MaskPass.js"),
  14597. e("./lib/postprocessing/ShaderPass.js"),
  14598. window.Promise || (window.Promise = e("promise-polyfill"));
  14599. var x = e("three")
  14600. , _x = e("three")
  14601. , S = (e("./util/sentry"),
  14602. e("./player"))
  14603. , M = e("./director")
  14604. , R = e("./controls/CameraControls")
  14605. , P = e("./model/ModelManager")
  14606. , O = e("./DisplayController")
  14607. , L = e("./label/LabelDisplayController")
  14608. , D = e("./enum/Viewmode")
  14609. , N = e("./util/logger")
  14610. , B = e("./showcase")
  14611. , F = e("./util/browser")
  14612. , V = e("./settings")
  14613. , U = e("./gui/gui")
  14614. , k = e("./gui/error")
  14615. , H = e("./analytics")
  14616. , G = e("./util/transitions")
  14617. , z = e("./effects")
  14618. , W = e("./objects/Skybox")
  14619. , j = e("./util/common")
  14620. , Y = (e("./util/PanoramaCollection"),
  14621. e("./util/math"),
  14622. e("./util/showcase"))
  14623. , X = e("./util/camera")
  14624. , Z = (e("./objects/Panorama"),
  14625. e("./cameras/PanoramaCamera"),
  14626. e("./preloaders"))
  14627. , q = e("events").EventEmitter
  14628. , K = e("./featureflags")
  14629. , Q = (e("./util/lerp"),
  14630. e("./util/ajax"))
  14631. , J = e("./ab")
  14632. , ee = e("./sdk/automation.js")
  14633. , te = e("./scene/SceneRenderer")
  14634. , ie = e("./scene/QuickstartManager")
  14635. , ne = e("./tile/QualityManager.js")
  14636. , re = e("./localization/localize")
  14637. , oe = e("./tag/tagManager")
  14638. , ae = e("./tile/TileDownloader")
  14639. , se = e("./tile/PanoRenderer")
  14640. , le = (e("./enum/PanoSizeClass"),
  14641. e("./enum/PanoramaEvents"),
  14642. e("./enum/SceneRendererEvents"))
  14643. , ce = e("./gui/memoryUsage")
  14644. , he = e("./enum/RenderLayers")
  14645. , ue = e("./TimingData")
  14646. , de = new N(t);
  14647. N.level = V.logLevel,
  14648. N.consoleEnabled = V.console,
  14649. i()
  14650. }
  14651. }
  14652. ).call(this, "/js/main.js")
  14653. }
  14654. , {
  14655. "./DisplayController": 1,
  14656. "./TimingData": 2,
  14657. "./ab": 3,
  14658. "./analytics": 4,
  14659. "./cameras/PanoramaCamera": 7,
  14660. "./controls/CameraControls": 9,
  14661. "./director": 15,
  14662. "./effects": 16,
  14663. "./enum/PanoSizeClass": 36,
  14664. "./enum/PanoramaEvents": 37,
  14665. "./enum/RenderLayers": 41,
  14666. "./enum/SceneRendererEvents": 43,
  14667. "./enum/Viewmode": 51,
  14668. "./featureflags": 59,
  14669. "./gui/error": 64,
  14670. "./gui/gui": 65,
  14671. "./gui/memoryUsage": 73,
  14672. "./label/LabelDisplayController": 91,
  14673. "./lib/array-polyfill": 92,
  14674. "./lib/performance-polyfill": 95,
  14675. "./lib/postprocessing/EffectComposer.js": 96,
  14676. "./lib/postprocessing/MaskPass.js": 97,
  14677. "./lib/postprocessing/RenderPass.js": 98,
  14678. "./lib/postprocessing/ShaderPass.js": 99,
  14679. "./lib/shaders/CopyShader.js": 100,
  14680. "./lib/shaders/HorizontalBlurShader.js": 101,
  14681. "./lib/shaders/VerticalBlurShader.js": 102,
  14682. "./lib/three75-shim": 103,
  14683. "./localization/localize": 108,
  14684. "./tag/tagManager": 124,
  14685. "./model/ModelManager": 140,
  14686. "./objects/Panorama": 148,
  14687. "./objects/Skybox": 152,
  14688. "./player": 155,
  14689. "./preloaders": 156,
  14690. "./scene/QuickstartManager": 157,
  14691. "./scene/SceneRenderer": 158,
  14692. "./sdk/automation.js": 164,
  14693. "./settings": 166,
  14694. "./showcase": 168,
  14695. "./tile/PanoRenderer": 169,
  14696. "./tile/QualityManager.js": 170,
  14697. "./tile/TileDownloader": 171,
  14698. "./util/PanoramaCollection": 178,
  14699. "./util/ajax": 181,
  14700. "./util/browser": 182,
  14701. "./util/camera": 183,
  14702. "./util/common": 185,
  14703. "./util/lerp": 188,
  14704. "./util/logger": 189,
  14705. "./util/math": 190,
  14706. "./util/sentry": 192,
  14707. "./util/showcase": 193,
  14708. "./util/transitions": 195,
  14709. events: 202,
  14710. "promise-polyfill": 213,
  14711. three: 217
  14712. }],
  14713. 117: [function(e, t, i) {
  14714. "use strict";
  14715. function n(e) {
  14716. e = e || {},
  14717. r.RawShaderMaterial.call(this, a.extendObject({
  14718. fragmentShader: o.cube.fragmentShader,
  14719. vertexShader: o.cube.vertexShader,
  14720. uniforms: r.UniformsUtils.clone(o.cube.uniforms),
  14721. name: "CubemapMaterial"
  14722. }, e))
  14723. }
  14724. var r = e("three")
  14725. , o = e("../shaders")
  14726. , a = e("../util/common");
  14727. n.prototype = Object.create(r.RawShaderMaterial.prototype),
  14728. n.prototype.constructor = n,
  14729. t.exports = n
  14730. }
  14731. , {
  14732. "../shaders": 167,
  14733. "../util/common": 185,
  14734. three: 217
  14735. }],
  14736. 118: [function(e, t, i) {
  14737. "use strict";
  14738. function n(e) {
  14739. e = e || {},
  14740. r.RawShaderMaterial.call(this, a.extendObject({
  14741. fragmentShader: o.model.fragmentShader,
  14742. vertexShader: o.model.vertexShader,
  14743. uniforms: r.UniformsUtils.clone(o.model.uniforms),
  14744. name: "ModelTextureMaterial"
  14745. }, e))
  14746. }
  14747. var r = e("three")
  14748. , o = e("../shaders")
  14749. , a = e("../util/common");
  14750. n.prototype = Object.create(r.RawShaderMaterial.prototype),
  14751. n.prototype.constructor = n,
  14752. n.prototype.setProjectedPanos = function(e, t, i) {
  14753. i && (this.uniforms.progress.value = 0),
  14754. e.ensureSkyboxReadyForRender(),
  14755. this.uniforms.pano0Map.value = e.getSkyboxTexture(),
  14756. this.uniforms.pano0Position.value.copy(e.position),
  14757. this.uniforms.pano0Matrix.value.copy(e.skyboxMesh.matrixWorld),
  14758. t.ensureSkyboxReadyForRender(),
  14759. this.uniforms.pano1Map.value = t.getSkyboxTexture(),
  14760. this.uniforms.pano1Position.value.copy(t.position),
  14761. this.uniforms.pano1Matrix.value.copy(t.skyboxMesh.matrixWorld)
  14762. }
  14763. ,
  14764. t.exports = n
  14765. }
  14766. , {
  14767. "../shaders": 167,
  14768. "../util/common": 185,
  14769. three: 217
  14770. }],
  14771. 119: [function(e, t, i) {
  14772. (function(i) {
  14773. "use strict";
  14774. function n(e, t, i, n) {
  14775. this.div = null,
  14776. this.body = null,
  14777. this.label = e,
  14778. this.description = t,
  14779. this.parsedDescription = [],
  14780. this.media = i || {
  14781. type: null
  14782. },
  14783. this.loadingSpinner = null,
  14784. this.parser = new r({
  14785. supportLinks: !u.valueFromHash("mls"),
  14786. keepLinkLabels: !0
  14787. }),
  14788. this.state = I.CLOSED,
  14789. this.orientation = "",
  14790. this.initialTransform = "",
  14791. this.hovering = !1,
  14792. this.openTransition = null,
  14793. this.closeTransition = null,
  14794. this.openPromise = null,
  14795. this.closePromise = null,
  14796. this.animationTransition = null,
  14797. this.animationScale = 0
  14798. }
  14799. var r = e("../Parser/DescriptionParser")
  14800. , o = e("../Media/Link")
  14801. , a = e("../Media/Image")
  14802. , s = e("../Media/EmbedlyPlayer")
  14803. , l = e("../Media/EmbedlyEmbed")
  14804. , c = e("../../util/transitions")
  14805. , h = e("../../util/lerp")
  14806. , u = e("../../util/browser")
  14807. , d = e("./BillboardEvent")
  14808. , p = e("../Media/MediaEvent")
  14809. , f = e("../Parser/DescriptionChunkType")
  14810. , g = e("events").EventEmitter
  14811. , m = e("./billboardSettings")
  14812. , v = e("./overlaySettings")
  14813. , A = e("../../util/logger")
  14814. , y = new A(i)
  14815. , C = document.getElementById("tag-billboards");
  14816. C.addEventListener("touchend", function(e) {
  14817. C.style.pointerEvents = "none"
  14818. }),
  14819. C.addEventListener("touchcancel", function(e) {
  14820. C.style.pointerEvents = "none"
  14821. });
  14822. var I = {
  14823. CLOSED: "closed",
  14824. OPENING: "opening",
  14825. OPEN: "open",
  14826. CLOSING: "closing",
  14827. ACTIVE: "active"
  14828. };
  14829. n.prototype = Object.create(g.prototype),
  14830. n.prototype.build = function(e) {
  14831. this.parsedDescription = this.parser.parse(this.description);
  14832. var t = document.createElement("div");
  14833. t.className = "tag-container has-hotzone",
  14834. this.div = t,
  14835. this.body = document.createElement("div"),
  14836. this.body.className = "tag-body";
  14837. var i = document.createElement("div");
  14838. i.classList.add("tag-content");
  14839. var n = document.createElement("div");
  14840. n.classList.add("tag-text-content");
  14841. var r = document.createElement("div");
  14842. r.className = "tag-label",
  14843. r.textContent = this.label,
  14844. n.appendChild(r);
  14845. var o = document.createElement("div");
  14846. o.className = "tag-desc",
  14847. n.appendChild(o),
  14848. i.appendChild(n),
  14849. this.body.appendChild(i),
  14850. this.appendDescriptionElements(this.parsedDescription, o),
  14851. this.appendMedia(),
  14852. t.appendChild(this.body),
  14853. C.appendChild(t),
  14854. this.bindEvents(t, this.body)
  14855. }
  14856. ,
  14857. n.prototype.bindEvents = function(e, t) {
  14858. var i = function(e) {
  14859. return function(t) {
  14860. if (!this.div.classList.contains("overlay")) {
  14861. var i, n = document.getElementById("player");
  14862. try {
  14863. i = new MouseEvent(e,t)
  14864. } catch (n) {
  14865. i = document.createEvent("MouseEvents"),
  14866. 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)
  14867. }
  14868. n.dispatchEvent(i)
  14869. }
  14870. }
  14871. };
  14872. t.addEventListener("mousedown", function(e) {
  14873. e.stopPropagation()
  14874. }),
  14875. t.addEventListener("mouseup", function(e) {
  14876. e.stopPropagation()
  14877. }),
  14878. e.addEventListener("touchstart", function(e) {
  14879. C.style.pointerEvents = "auto"
  14880. }),
  14881. e.addEventListener("mousedown", i("mousedown").bind(this)),
  14882. e.addEventListener("mouseup", i("mouseup").bind(this)),
  14883. t.addEventListener("mouseover", function(t) {
  14884. this.state === I.OPEN && e.classList.remove("has-hotzone")
  14885. }
  14886. .bind(this)),
  14887. e.addEventListener("mouseenter", function(e) {
  14888. this.state !== I.CLOSING && (this.hovering = !0,
  14889. this.emit(d.ENTER))
  14890. }
  14891. .bind(this)),
  14892. e.addEventListener("mouseleave", function(e) {
  14893. this.hovering = !1,
  14894. this.emit(d.LEAVE)
  14895. }
  14896. .bind(this)),
  14897. e.addEventListener("gesturestart", function(e) {
  14898. e.preventDefault()
  14899. });
  14900. var n = e.querySelector(".tag-text-content")
  14901. , r = 0;
  14902. n.addEventListener("touchstart", function(e) {
  14903. r = e.changedTouches[0].clientY
  14904. }),
  14905. n.addEventListener("touchmove", function(t) {
  14906. function i(e) {
  14907. e && (0 === e.scrollTop && t.changedTouches[0].clientY > r || e.scrollTop + e.clientHeight - e.scrollHeight === 0 && t.changedTouches[0].clientY < r) && t.preventDefault()
  14908. }
  14909. return e.classList.contains("overlay") ? i(this.querySelector(".tag-desc")) : void i(this)
  14910. }),
  14911. e.addEventListener("touchmove", function(e) {
  14912. 0 === (n.compareDocumentPosition(e.target) & Node.DOCUMENT_POSITION_CONTAINED_BY) && e.preventDefault()
  14913. })
  14914. }
  14915. ,
  14916. n.prototype.appendDescriptionElements = function(e, t) {
  14917. e.length > 0 && this.div.classList.add("has-text"),
  14918. e.forEach(function(e, i) {
  14919. switch (e.type) {
  14920. case f.TEXT:
  14921. t.appendChild(this.createTextElement(e.text));
  14922. break;
  14923. case f.LINK:
  14924. t.appendChild(this.createLinkElement(e.link))
  14925. }
  14926. }
  14927. .bind(this))
  14928. }
  14929. ,
  14930. n.prototype.appendLoadingSpinner = function() {
  14931. this.loadingSpinner = document.createElement("div"),
  14932. this.loadingSpinner.classList.add("loading-spinner");
  14933. var e = document.createElement("div");
  14934. e.classList.add("gui-spinner-icon"),
  14935. this.loadingSpinner.appendChild(e),
  14936. this.body.appendChild(this.loadingSpinner)
  14937. }
  14938. ,
  14939. n.prototype.onMediaLoadFinished = function() {
  14940. this.loadingSpinner && (this.loadingSpinner.parentNode.removeChild(this.loadingSpinner),
  14941. this.applyOrientation(this.orientation),
  14942. this.loadingSpinner = null)
  14943. }
  14944. ,
  14945. n.prototype.appendMedia = function() {
  14946. if (this.media && this.media.type && "error" !== this.media.type && (!u.valueFromHash("mls", 0) || this.media.type === f.IMAGE)) {
  14947. this.appendLoadingSpinner();
  14948. var e = document.createElement("div");
  14949. e.classList.add("tag-media-content");
  14950. var t = document.createElement("i");
  14951. switch (["icon", "icon-close-thin", "close"].forEach(function(e) {
  14952. t.classList.add(e)
  14953. }),
  14954. this.body.appendChild(t),
  14955. this.body.appendChild(e),
  14956. this.media.type) {
  14957. case f.IMAGE:
  14958. e.appendChild(this.createImageElement(this.media, this.body));
  14959. break;
  14960. case f.VIDEO:
  14961. e.appendChild(this.createVideoElement(this.media, this.body));
  14962. break;
  14963. case f.RICH:
  14964. e.appendChild(this.createEmbedElement(this.media, this.body))
  14965. }
  14966. }
  14967. }
  14968. ,
  14969. n.prototype.createTextElement = function(e) {
  14970. var t = document.createElement("span");
  14971. return t.textContent = e,
  14972. t
  14973. }
  14974. ;
  14975. n.prototype.createLinkElement = function(e) {
  14976. var t = new o(e);
  14977. return t.on(p.LINK_CLICK, this.emit.bind(this, p.LINK_CLICK)),
  14978. t.createDomElement()
  14979. }
  14980. ,
  14981. n.prototype.createImageElement = function(e, t) {
  14982. function i() {
  14983. function e() {
  14984. m || (r.classList.remove("view-image"),
  14985. c.classList.add("overlay"),
  14986. i(),
  14987. window.addEventListener("resize", b),
  14988. c.addEventListener("click", a),
  14989. g.addEventListener("click", l),
  14990. f.addEventListener("click", s),
  14991. m = !0,
  14992. o.emit(p.IMAGE_OPENED))
  14993. }
  14994. function i() {
  14995. t.classList.add("show-info"),
  14996. h.classList.remove("collapsible"),
  14997. h.style.height = "";
  14998. var e = parseFloat(getComputedStyle(I).lineHeight)
  14999. , i = y + e
  15000. , r = c.clientWidth - 2 * v.boundaryWidth - C
  15001. , a = c.clientHeight - 2 * v.boundaryHeight - C - i
  15002. , s = a
  15003. , l = s * n.aspect;
  15004. l > r && (l = r,
  15005. s = l / n.aspect),
  15006. s > a && (s = a,
  15007. l = s * n.aspect),
  15008. l += C,
  15009. s += C + i,
  15010. t.style.width = l + "px",
  15011. t.style.height = s + "px",
  15012. u.style.paddingTop = e + C + "px",
  15013. o.description.length > 0 && (h.classList.add("collapsible"),
  15014. h.style.height = h.clientHeight + 12 + "px",
  15015. E.style.height = "calc(100% - " + I.clientHeight + "px)")
  15016. }
  15017. function a(e) {
  15018. e.target === c && s()
  15019. }
  15020. function s() {
  15021. m && (m = !1,
  15022. r.classList.add("view-image"),
  15023. c.classList.remove("overlay"),
  15024. h.style.height = "",
  15025. u.style.paddingTop = "",
  15026. t.style.width = "",
  15027. t.style.height = "",
  15028. window.removeEventListener("resize", b),
  15029. c.removeEventListener("click", a),
  15030. g.removeEventListener("click", l),
  15031. f.removeEventListener("click", s),
  15032. o.emit(p.IMAGE_CLOSED),
  15033. o.close(!0))
  15034. }
  15035. function l(e) {
  15036. t.classList.toggle("show-info")
  15037. }
  15038. var c = o.div
  15039. , h = c.getElementsByClassName("tag-content")[0]
  15040. , u = c.getElementsByClassName("tag-media-content")[0]
  15041. , f = t.getElementsByClassName("close")[0]
  15042. , g = h.getElementsByClassName("tag-label")[0];
  15043. c.classList.add("has-image"),
  15044. r.classList.add("view-image"),
  15045. c.classList.add(n.aspect >= 1 ? "image-landscape" : "image-portrait"),
  15046. o.applyOrientation(o.orientation);
  15047. var m = !1
  15048. , A = getComputedStyle(h)
  15049. , y = parseFloat(A.paddingTop) + parseFloat(A.paddingBottom)
  15050. , C = 2 * parseFloat(getComputedStyle(u).paddingLeft)
  15051. , I = h.querySelector(".tag-label")
  15052. , E = h.querySelector(".tag-desc")
  15053. , b = function() {
  15054. var e, t, n = 0;
  15055. return function() {
  15056. clearInterval(e),
  15057. clearTimeout(t),
  15058. e = setInterval(function() {
  15059. var e = c.clientHeight;
  15060. n !== e && (i(),
  15061. n = e)
  15062. }, 100),
  15063. t = setTimeout(clearInterval.bind(this, e), 1e3)
  15064. }
  15065. }();
  15066. n.on(p.IMAGE_OPENING, e),
  15067. o.on(d.ACTIVATE, e),
  15068. o.on(p.IMAGE_CLOSED, n.onClosed.bind(n)),
  15069. o.on(d.CLOSING, s)
  15070. }
  15071. var n = new a
  15072. , r = n.createDomElement();
  15073. this.once(d.OPENED, function() {
  15074. n.load(e.src).then(i).catch(function(t) {
  15075. y.warn("Failed to load image:", e.src),
  15076. y.warn("with error:", t)
  15077. }).then(this.onMediaLoadFinished.bind(this))
  15078. });
  15079. var o = this;
  15080. return r
  15081. }
  15082. ,
  15083. n.prototype.createVideoElement = function(e, t) {
  15084. var i = new s({
  15085. autoPlay: !0,
  15086. autoResume: !0,
  15087. startMuted: !1,
  15088. loop: !1
  15089. })
  15090. , n = i.createDomElement();
  15091. return this.once(d.OPENED, function() {
  15092. i.load(e.src).then(function() {
  15093. this.div.classList.add("has-video"),
  15094. this.state !== I.OPEN && this.state !== I.ACTIVE || (i.show(),
  15095. i.play()),
  15096. this.on(d.OPENING, i.show.bind(i)),
  15097. this.on(d.OPENED, i.play.bind(i)),
  15098. this.on(d.CLOSING, i.pause.bind(i)),
  15099. this.on(d.CLOSED, i.hide.bind(i))
  15100. }
  15101. .bind(this)).catch(function(t) {
  15102. y.warn("Failed to embed video:", e.src),
  15103. y.warn("with error:", t)
  15104. }).then(this.onMediaLoadFinished.bind(this))
  15105. }
  15106. .bind(this)),
  15107. n
  15108. }
  15109. ,
  15110. n.prototype.createEmbedElement = function(e, t) {
  15111. var i = new l
  15112. , n = i.createDomElement();
  15113. return this.once(d.OPENED, function() {
  15114. i.load(e.src).then(function() {
  15115. this.div.classList.add("has-embed"),
  15116. this.state !== I.OPEN && this.state !== I.ACTIVE || i.show(),
  15117. this.applyOrientation(this.orientation),
  15118. this.on(d.OPENING, i.show.bind(i)),
  15119. this.on(d.CLOSED, i.hide.bind(i))
  15120. }
  15121. .bind(this)).catch(function(t) {
  15122. y.warn("Failed to embed:", e.src),
  15123. y.warn("with error:", t)
  15124. }).then(this.onMediaLoadFinished.bind(this))
  15125. }
  15126. .bind(this)),
  15127. n
  15128. }
  15129. ,
  15130. n.prototype.open = function(e) {
  15131. return this.openPromise = $.Deferred(),
  15132. this.state === I.ACTIVE ? this.openPromise.resolve().promise() : (this.hovering || this.div.classList.add("has-hotzone"),
  15133. this.openTransition ? e && this.setActiveState() : this.openTransition = c.setTimeout(function() {
  15134. this.state !== I.OPEN && (this.emit(d.OPENING),
  15135. e && this.emit(d.ACTIVATING),
  15136. this.state = I.OPENING,
  15137. this.animateOpen(function() {
  15138. e && this.setActiveState(),
  15139. this.openPromise.resolve()
  15140. }
  15141. .bind(this)))
  15142. }
  15143. .bind(this), m.animation.openDelay),
  15144. c.cancel(this.closeTransition),
  15145. this.closePromise && this.closePromise.reject(),
  15146. this.closeTransition = void 0,
  15147. this.openPromise.promise())
  15148. }
  15149. ,
  15150. n.prototype.close = function(e) {
  15151. return this.closePromise = $.Deferred(),
  15152. !e && this.hovering ? this.closePromise.reject().promise() : (this.closeTransition || (this.closeTransition = c.setTimeout(function() {
  15153. this.state !== I.CLOSED && (this.emit(d.CLOSING),
  15154. this.state = I.CLOSING,
  15155. this.animateClose())
  15156. }
  15157. .bind(this), m.animation.closeDelay)),
  15158. c.cancel(this.openTransition),
  15159. this.openPromise && this.openPromise.reject(),
  15160. this.openTransition = void 0,
  15161. this.closePromise.resolve(),
  15162. this.closePromise.promise())
  15163. }
  15164. ,
  15165. n.prototype.setActiveState = function() {
  15166. this.state !== I.CLOSED && (this.state = I.ACTIVE,
  15167. this.emit(d.ACTIVATE),
  15168. this.div.classList.remove("has-hotzone"))
  15169. }
  15170. ,
  15171. n.prototype.animateOpen = function(e) {
  15172. if (this.state === I.OPENING) {
  15173. if (c.cancel(this.animationTransition),
  15174. u.detectSamsungNative())
  15175. return this.boardOrientation = null,
  15176. this.div.style.visibility = "visible",
  15177. this.emit(d.OPENED),
  15178. this.state = I.OPEN,
  15179. void (e && e());
  15180. this.div.style.webkitTransform = "scale(0)",
  15181. this.div.style.transform = "scale(0)",
  15182. this.div.style.visibility = "visible",
  15183. this.animationTransition = c.start(h.property(this, "animationScale", 1), m.animation.openDuration, function() {
  15184. this.emit(d.OPENED),
  15185. this.state = I.OPEN,
  15186. e && e()
  15187. }
  15188. .bind(this))
  15189. }
  15190. }
  15191. ,
  15192. n.prototype.animateClose = function(e) {
  15193. this.state === I.CLOSING && (c.cancel(this.animationTransition),
  15194. this.animationTransition = c.start(h.property(this, "animationScale", 0), m.animation.closeDuration, function() {
  15195. this.emit(d.CLOSED),
  15196. this.state = I.CLOSED,
  15197. this.div.style.visibility = "hidden",
  15198. this.div.classList.contains("has-hotzone") || this.div.classList.add("has-hotzone"),
  15199. e && e()
  15200. }
  15201. .bind(this)))
  15202. }
  15203. ,
  15204. n.prototype.needsUpdate = function() {
  15205. return this.state !== I.CLOSED
  15206. }
  15207. ,
  15208. n.prototype.update = function(e, t) {
  15209. if (this.needsUpdate()) {
  15210. var i = (this.updateOrientation(e),
  15211. this.calcScale(t))
  15212. , n = {
  15213. x: (e.x + 1) * $("#player").width() / 2,
  15214. y: (e.y + 1) * $("#player").height() / 2
  15215. };
  15216. this.div.screenTransform = this.initialTransform + " translate(" + n.x + "px, " + n.y + "px) scale(" + i * this.animationScale + ")",
  15217. this.div.style.webkitTransform = this.div.screenTransform,
  15218. this.div.style.transform = this.div.screenTransform
  15219. }
  15220. }
  15221. ,
  15222. n.prototype.getDimensions = function() {
  15223. return this.div.getBoundingClientRect()
  15224. }
  15225. ,
  15226. n.prototype.calcScale = function(e) {
  15227. return Math.sqrt(e / 40) * m.boardToDiscRatio
  15228. }
  15229. ,
  15230. n.prototype.updateOrientation = function(e) {
  15231. if (this.state !== I.ACTIVE) {
  15232. var t = 1 / 3
  15233. , i = e.y < -t ? 0 : e.y < t ? 1 : 2
  15234. , n = e.x < -t ? 0 : e.x < t ? 1 : 2
  15235. , r = "";
  15236. r += 0 === n ? "right" : 2 === n ? "left" : "",
  15237. r += 0 === i ? "-down" : 2 === i ? "-up" : "",
  15238. 1 === n && (r = 0 === i ? "bottom" : 2 === i ? "top" : "",
  15239. 1 === i && (r = $("#player").width() > $("#player").height() ? e.x < 0 ? "right" : "left" : e.y < 0 ? "bottom" : "top")),
  15240. 1 === n && 1 === i && r === this.orientation || this.applyOrientation(r)
  15241. }
  15242. }
  15243. ,
  15244. n.prototype.applyOrientation = function(e) {
  15245. this.div.style.transform = this.div.style.webkitTransform = "",
  15246. this.div.classList.remove("tag-container-" + this.orientation),
  15247. this.div.classList.add("tag-container-" + e);
  15248. var t = window.getComputedStyle(this.div);
  15249. this.initialTransform = t.transform || t.webkitTransform,
  15250. "none" === this.initialTransform && (this.initialTransform = "");
  15251. var i = t.transform.slice(7, -1).split(",")
  15252. , n = -i[4]
  15253. , r = -i[5];
  15254. this.div.style.webkitTransformOrigin = n + "px " + r + "px",
  15255. this.div.style.transformOrigin = n + "px " + r + "px",
  15256. this.orientation = e
  15257. }
  15258. ,
  15259. t.exports = n
  15260. }
  15261. ).call(this, "/js/tag/Billboard/Billboard.js")
  15262. }
  15263. , {
  15264. "../../util/browser": 182,
  15265. "../../util/lerp": 188,
  15266. "../../util/logger": 189,
  15267. "../../util/transitions": 195,
  15268. "../Media/EmbedlyEmbed": 125,
  15269. "../Media/EmbedlyPlayer": 126,
  15270. "../Media/Image": 128,
  15271. "../Media/Link": 129,
  15272. "../Media/MediaEvent": 131,
  15273. "../Parser/DescriptionChunkType": 133,
  15274. "../Parser/DescriptionParser": 134,
  15275. "./BillboardEvent": 120,
  15276. "./billboardSettings": 121,
  15277. "./overlaySettings": 122,
  15278. events: 202
  15279. }],
  15280. 120: [function(e, t, i) {
  15281. "use strict";
  15282. t.exports = Object.freeze({
  15283. ENTER: "billboard.enter",
  15284. LEAVE: "billboard.leave",
  15285. OPENING: "billboard.opening",
  15286. OPENED: "billboard.open",
  15287. CLOSING: "billboard.closing",
  15288. CLOSED: "billboard.closed",
  15289. ACTIVATING: "billboard.activating",
  15290. ACTIVATE: "billboard.activate"
  15291. })
  15292. }
  15293. , {}],
  15294. 121: [function(e, t, i) {
  15295. "use strict";
  15296. t.exports = Object.freeze({
  15297. animation: Object.freeze({
  15298. hoverOnClosing: !1,
  15299. openDelay: 100,
  15300. closeDelay: 50,
  15301. openDuration: 200,
  15302. closeDuration: 100
  15303. }),
  15304. boardToDiscRatio: 1.2
  15305. })
  15306. }
  15307. , {}],
  15308. 122: [function(e, t, i) {
  15309. "use strict";
  15310. t.exports = Object.freeze({
  15311. boundaryWidth: 30,
  15312. boundaryHeight: 0
  15313. })
  15314. }
  15315. , {}],
  15316. /*********************************创建热点模型************************************************** */
  15317. "hot": [function(e, t, i) {//热点
  15318. "use strict";
  15319. function hot(sid,d,model){
  15320. this.sid = sid;
  15321. /* this.position = (new r.Vector3).fromArray( this.conversionArray(d.position) )
  15322. if(d.quaternion){
  15323. this.quaternion = d.quaternion;
  15324. }else{
  15325. this.rotation = this.conversionArray(d.rotation)
  15326. } */
  15327. this.position = this.convertValue(d.position, r.Vector3)
  15328. if(d.quaternion){
  15329. this.quaternion = this.convertValue(d.quaternion, r.Quaternion)
  15330. }else{
  15331. this.rotation = new r.Euler().setFromVector3(this.convertValue(d.rotation, r.Vector3 ))
  15332. }
  15333. this.quaternion || (this.quaternion = new THREE.Quaternion().setFromEuler(this.rotation))
  15334. this.isSprite = d.isSprite
  15335. this.noAction = d.noAction
  15336. this.linkType = d.linkType || "common"
  15337. this.link = d.link;
  15338. this.model = model;
  15339. this.size = d.size;
  15340. this.styleTex = [] // 存储热点icon的图片 [{src:...}, {src:...} ] 最多两个,里面是带有src的object, 可以是img
  15341. this.build();
  15342. if(d.infoAttribute && d.infoAttribute.title){
  15343. if(window.MP_PREFETCHED_MODELDATA.flyInOnlyBySwitch){
  15344. }else{
  15345. this.createTitleElem(d.infoAttribute.title)
  15346. }
  15347. }
  15348. if(d.infoAttribute.hardware){
  15349. var Code = d.infoAttribute.hardware.deviceCode;
  15350. if(Code!= void 0){
  15351. window.hardwareHotList[Code] = this//硬件列表
  15352. }
  15353. }
  15354. this.changeTex()
  15355. this.setVisiblePanos(d.visiblePanos);
  15356. this.infoAttribute = d.infoAttribute;
  15357. }
  15358. var r = e("three")
  15359. , f = e("../shaders")
  15360. , a = e("../settings")
  15361. , s = e("../enum/Viewmode")
  15362. , p = e("../objects/Panorama")
  15363. , math = e("../util/math")
  15364. , te = e("../util/texture");
  15365. var raycaster = new r.Raycaster;
  15366. //热点大小
  15367. var geometry = new r.PlaneBufferGeometry( g_HotMeshSize.g_HotMeshWidth, g_HotMeshSize.g_HotMeshHeight,1,1);
  15368. var defaultTex1 = te.load(g_HotImage.point);
  15369. var defaultTex2 = te.load(g_HotImage.point2);
  15370. hot.prototype.changeTex = function(){
  15371. var u = this.mesh.material.uniforms
  15372. if(this.styleTex.length){
  15373. u.texture1.value = te.load(this.styleTex[0].src);
  15374. u.texture2.value = te.load(this.styleTex[1]&&this.styleTex[1].src || this.styleTex[0].src);
  15375. }else{
  15376. u.texture1.value = defaultTex1;
  15377. u.texture2.value = defaultTex2;
  15378. console.log(this.sid)
  15379. }
  15380. }
  15381. hot.prototype.initStyleImg = function(t){
  15382. this.styleTex = []
  15383. t.styleImg = t.styleImg || [];
  15384. t.styleImg.forEach((src)=>{
  15385. this.styleTex.push({src:manage.dealURL(src)})
  15386. })
  15387. this.changeTex()
  15388. }
  15389. hot.prototype.update = function(camera) {
  15390. if(this.isSprite){
  15391. this.mesh.quaternion.copy(camera.quaternion)
  15392. }
  15393. if(window.hotNeedUpdatePannel == this){
  15394. this.updatePannel()
  15395. }
  15396. }
  15397. hot.prototype.setVisiblePanos = function(visibleData){
  15398. if (visibleData) {
  15399. this.visiblePanos = visibleData;
  15400. }
  15401. }
  15402. //绘制热点
  15403. hot.prototype.build = function(){
  15404. var t = r.UniformsUtils.clone(f.hot.uniforms);
  15405. var shaderMaterial = new r.ShaderMaterial({
  15406. uniforms: t,
  15407. vertexShader: f.hot.vertexShader,
  15408. fragmentShader: f.hot.fragmentShader,
  15409. transparent: !0
  15410. })
  15411. var sprite = new r.Mesh( geometry, shaderMaterial );
  15412. var hotIconScale = parseFloat(window.MP_PREFETCHED_MODELDATA.hotIconScale);
  15413. sprite.dynamic = true;
  15414. sprite.position.copy(this.position);
  15415. sprite.quaternion.copy(this.quaternion)
  15416. hotIconScale && sprite.scale.set(hotIconScale, hotIconScale, hotIconScale)
  15417. // this.size && sprite.scale.set(this.size,this.size,this.size);
  15418. sprite.name = this.sid;
  15419. sprite.type = "hotSprite";
  15420. sprite.belongHot = this;
  15421. if(this.link) sprite.hotLink = this.link;
  15422. this.mesh = sprite;
  15423. this.model.add(sprite);
  15424. g_HotMeshes.push(sprite);
  15425. }
  15426. hot.prototype.createTitleElem = function(title){
  15427. var root = $("#hot");
  15428. var elem = $(`<div> ${title}</div>`)
  15429. root.append(elem);
  15430. this.titleElem = elem;
  15431. }
  15432. hot.prototype.showPannel = function(o={}){
  15433. var hardware = this.infoAttribute.hardware
  15434. if(hardware && hardware.id!=void 0){
  15435. $("#hotPannel>div").css("display","block");
  15436. $("#hotPannel .title").text(hardware.name);
  15437. this.updatePannel()
  15438. window.hotNeedUpdatePannel = this
  15439. if(o.focus){
  15440. if(player.mode == 'panorama'){
  15441. this.examine(player)
  15442. }else if(player.mode != 'transitioning'){
  15443. player.focusPoint({/* modelSize: size, */aim: this.mesh.position})
  15444. }
  15445. }
  15446. return true
  15447. }else{
  15448. $("#hotPannel>div").css("display","");
  15449. }
  15450. }
  15451. hot.prototype.updatePannel = function(){
  15452. var pos = math.getPos2d(this.position, player.camera, $("#player")[0]);
  15453. if(pos.trueSide){
  15454. $("#hotPannel>div").css( {display:'block', "left" : `${pos.pos.x}px`, "top": `${pos.pos.y}px ` });
  15455. }else{
  15456. $("#hotPannel>div").css({display:'none'})
  15457. }
  15458. }
  15459. hot.prototype.showTitle = function(){
  15460. if(!this.titleElem)return;
  15461. var pos = math.getPos2d(this.position, player.camera, $("#player")[0])
  15462. this.titleElem.css( { "left" : `${pos.pos.x}px`, "top": `${pos.pos.y}px ` });
  15463. this.titleElem.css("display","block");
  15464. }
  15465. hot.prototype.hideTitle = function(){
  15466. if(!this.titleElem)return;
  15467. this.titleElem.css("display","none");
  15468. }
  15469. hot.prototype.closestPanoTowardTag = function(e, t) {
  15470. var i = []
  15471. , o = []
  15472. , l = this.mesh.position;
  15473. if (e === s.PANORAMA) {
  15474. var c = .5
  15475. , h = t.position.clone().sub(l).normalize();
  15476. // 方奕卓 注释掉下面的筛选条件, 使热点列表能点击过渡
  15477. // i.push(p.filters.isPanoAligned()),
  15478. // i.push(p.filters.inPanoDirection(l, h, c)),
  15479. // i.push(p.filters.isNeighbourPanoTo(t)),
  15480. o.push(p.scoreFunctions.direction(l, h))
  15481. }
  15482. var u = new r.Vector3
  15483. , d = function(e) {
  15484. u.copy(l).sub(e.position);
  15485. var t = -r.Math.radToDeg(Math.atan(u.y / Math.sqrt(u.x * u.x + u.z * u.z)))
  15486. , i = a.tags.navigate.tiltTolerance;
  15487. return a.insideLookLimitDown - i < t && t < a.insideLookLimitUp + i
  15488. }
  15489. , f = function(e) {
  15490. return Math.abs(e.position.x - l.x) > a.tags.visibility.cameraClearance || Math.abs(e.position.z - l.z) > a.tags.visibility.cameraClearance
  15491. };
  15492. i.push(f, d, (pano)=>{ // add
  15493. return player.checkHasNeighbor(pano)
  15494. }),
  15495. o.push(p.scoreFunctions.distanceSquared(this.mesh, -2));
  15496. var g = t.model.panos.sortByScore(i, o);
  15497. if (g && a.tags.navigate.lineOfSight) {
  15498. for (var m = 0; m < g.length; m++) {
  15499. var v = g[m].pano
  15500. , A = v.position.distanceTo(l);
  15501. raycaster.set(v.position, l.clone().sub(v.position).normalize());
  15502. var y = raycaster.intersectObjects(t.model.colliders);
  15503. // return g[0].pano;
  15504. if (0 === y.length || y[0].distance > A) {
  15505. console.log(m);
  15506. return v
  15507. }
  15508. }
  15509. return null
  15510. }
  15511. return g && g.length > 0 && g[0].pano
  15512. }
  15513. var getLink = function(link){
  15514. var src = '';
  15515. var r = link.substring(link.indexOf("html") + 4)//给热点后面加上随机数,让热点确保是最新的
  15516. , o = "en" == manage.number("lang") ? "&lang=" + manage.number("lang") : "";//如果热点的内容是英文版的
  15517. -1 == r.indexOf("?") ? src = link + "?time=" + randomTime().getTime() + "&id=" + window.number + o : src = link + "&time=" + randomTime().getTime() + "&id=" + window.number + o
  15518. return src
  15519. }
  15520. hot.prototype.examine = function(e, options) {
  15521. options = options || {}
  15522. var hotPop = document.getElementById('popup');
  15523. var hasHardware;
  15524. if(window.MP_PREFETCHED_MODELDATA.flyInOnlyBySwitch){
  15525. hasHardware = this.showPannel();
  15526. if(player.mode != 'panorama' || !player.currentPano)return;
  15527. }else{
  15528. if(this.linkType!="common" && this.infoAttribute.iframe && this.infoAttribute.iframe[0] && !options.dontOpen){
  15529. var src = getLink(this.infoAttribute.iframe[0]);
  15530. if(this.linkType=="jumpLink"){
  15531. /* var newPage = window.open(src, "_blank" );
  15532. newPage.focus(); */
  15533. var href = window.location.href
  15534. var index = href.indexOf("&")
  15535. if(index>-1) href = href.substr(0,index) /* pushState replaceState*/
  15536. history.pushState(null, "", href+'&qs=1&firstView=pano:'+player.currentPano.id+',qua:'+ player.quaternion.toArray());
  15537. window.location.href = src
  15538. }else if(this.linkType=="iframeDiv"){
  15539. var div = document.createElement("div");
  15540. $("body").append(div);
  15541. div.style.position = 'fixed';
  15542. div.style.width = div.style.height = "100%";
  15543. div.style.left = div.style.top = '0';
  15544. div.style["z-index"] = "999"
  15545. var exit = document.createElement("div");
  15546. exit.style["background-image"] = "url(images/vrOffImg.png)";
  15547. exit.style.position = 'absolute';
  15548. exit.style.width = exit.style.height = "50px";
  15549. exit.style.left = '17px'; exit.style.top = "20px"
  15550. exit.style.cursor = "pointer";
  15551. exit.style["background-repeat"] = "no-repeat";
  15552. exit.style["background-size"] = "25%";
  15553. exit.style["background-position"] = "center center";
  15554. exit.style["background-color"] = "rgba(0, 0, 0, 0.2)";
  15555. exit.style["border-radius"] = "50%";
  15556. exit.style["z-index"] = "3"
  15557. exit.onclick = ()=>{
  15558. $(div).remove()
  15559. if(g_bgAudio && g_bgAudio.pauseByHot){
  15560. manage.switchBgmState(true)
  15561. }
  15562. }
  15563. var myElement = document.createElement("iframe");
  15564. myElement.style.position = 'absolute';
  15565. myElement.style.width = myElement.style.height = "100%";
  15566. myElement.style.left = myElement.style.top = '0';
  15567. myElement.src = src
  15568. div.appendChild(exit);
  15569. div.appendChild(myElement)
  15570. //打开热点的时候把背景音乐关闭了,避免与热点里面的音乐冲突
  15571. //g_bgAudio && g_bgAudio.pause();
  15572. if(g_bgAudio && !g_bgAudio.paused){
  15573. manage.switchBgmState(false);
  15574. g_bgAudio.pauseByHot = true
  15575. }
  15576. if(g_tourAudio)g_tourAudio.pause()
  15577. }
  15578. return;
  15579. }
  15580. if(!player.currentPano)return;
  15581. //获取那个热点的链接
  15582. if(this.link && !hasHardware){
  15583. g_currentHot = this;
  15584. hotPop.style.display = "block";
  15585. hotPop.classList.add("wait");
  15586. var myElement = document.createElement("iframe");
  15587. //打开热点的时候把背景音乐关闭了,避免与热点里面的音乐冲突
  15588. //g_bgAudio && g_bgAudio.pause();
  15589. if(g_bgAudio && !g_bgAudio.paused){
  15590. manage.switchBgmState(false);
  15591. g_bgAudio.pauseByHot = true
  15592. }
  15593. if(g_tourAudio)g_tourAudio.pause()
  15594. var src = getLink(this.link )
  15595. myElement.src = src;
  15596. myElement.id = "id1";
  15597. myElement.allowTransparency = "true";
  15598. // myElement.scrolling = "no";
  15599. var element=document.getElementById("id1"); //判断页面是否有iframe
  15600. if (typeof(element)== "undefined" || element == null){
  15601. document.querySelector(".popup-content").appendChild(myElement);
  15602. //移动端自动播放
  15603. var videoLoaddingResult = false
  15604. window.loaddingSuccess = function() {
  15605. videoLoaddingResult = true
  15606. }
  15607. setTimeout(function func() {
  15608. if (videoLoaddingResult) {
  15609. var $iframe = document.querySelector('#id1').contentWindow.document;
  15610. if($iframe.querySelector('video')){
  15611. $iframe.querySelector('video').play();
  15612. // alert($iframe.querySelector('video'));
  15613. if(!$iframe.querySelector('video').paused && $iframe.querySelector('.playPause')){
  15614. $iframe.querySelector('.playPause').classList.add("fa-pause");
  15615. }
  15616. }
  15617. if($iframe.querySelector('audio')){
  15618. $iframe.querySelector('audio').play();
  15619. }
  15620. } else {
  15621. setTimeout(func, 300)
  15622. }
  15623. }, 800);
  15624. }
  15625. //setTimeout(function(){$('#player').on("click",e.closePopup);},20)
  15626. }
  15627. }
  15628. // if(hotListSta) {
  15629. // hotPop.classList.remove("wait");
  15630. // return;
  15631. // }
  15632. var t = e.mode
  15633. , i = a.tags.navigate.nearestPano && this.closestPanoTowardTag(t, e.currentPano) || e.currentPano
  15634. , n = this.mesh.position;
  15635. e.flyingToTag = true;
  15636. var o = function() {
  15637. e.flyingToTag = false;
  15638. if(this.link){
  15639. hotPop && hotPop.classList.remove("wait");
  15640. }
  15641. }.bind(this);
  15642. if(settings.dontExamHot){
  15643. o();
  15644. return;
  15645. }
  15646. if (t === s.PANORAMA){
  15647. var l = {
  15648. pano: i,
  15649. lookAtPoint: n,
  15650. duration: null,
  15651. maxDistanceOverride: null,
  15652. skipWarpingCheck: !1
  15653. };
  15654. e.flyToPano(l, o)
  15655. }else {
  15656. var c = {
  15657. pano: i
  15658. };
  15659. if (n) {
  15660. var h = (new r.Matrix4).lookAt(i.position, n, new r.Vector3(0,1,0));
  15661. c.quaternion = (new r.Quaternion).setFromRotationMatrix(h)
  15662. }
  15663. c.callback = o,
  15664. c.duration = 1500,
  15665. c.mode = s.PANORAMA,
  15666. e.flyToNewMode(c)
  15667. }
  15668. },
  15669. //判断someData里面是否有special字段,如果有就会处理这些特殊的大场景
  15670. // if(window.MP_PREFETCHED_MODELDATA.special){
  15671. // specialScene.special().beforeImplement();
  15672. // }
  15673. //czj 判断是否是数组 如果不是将对象转换为数组
  15674. /* hot.prototype.conversionArray = function(obj){
  15675. if(Object.prototype.toString.call(obj)=='[object Array]') return obj;
  15676. var arr = []
  15677. for (var i in obj) {
  15678. arr.push(obj[i]); //属性
  15679. }
  15680. return arr
  15681. } */
  15682. hot.prototype.convertValue = function(v ,Type){
  15683. var value;
  15684. if(v instanceof Array){
  15685. v.forEach((v1)=>{v1 = parseFloat(v1)})
  15686. value = new Type().fromArray(v);
  15687. }else{
  15688. for(let i in v){v[i] = parseFloat(v[i])}
  15689. value = new Type().copy(v);
  15690. }
  15691. return value
  15692. }
  15693. t.exports = hot;
  15694. }
  15695. , {
  15696. three: 217,
  15697. "../shaders":167,
  15698. "../enum/Viewmode":51,
  15699. "../objects/Panorama":148,
  15700. "../util/texture":194,
  15701. "../settings":166,
  15702. "../util/math": 190,
  15703. }],
  15704. /************************************创建热点模型************************************ */
  15705. 123: [function(e, t, i) {//tag
  15706. (function(i) {
  15707. "use strict";
  15708. function n(e, t, i) {
  15709. var n = i.version || "0";
  15710. "0" !== n && I.info("tag defined using version " + n),
  15711. this.model = e,
  15712. this.sid = t,
  15713. this.color = (new r.Color).set(i.color || l.tagDefault),
  15714. this.hoverColor = l._darken(this.color, .2),
  15715. this.floor = null,
  15716. this.floorIndex = i.floor,
  15717. this.mode = s.PANORAMA,
  15718. i.preferred_camera && i.preferred_camera.mode && (this.mode = i.preferred_camera.mode),
  15719. this.obj3d = null,
  15720. this.disc = null,
  15721. this.materials = {
  15722. disc: null,
  15723. pole: null
  15724. },
  15725. this.position = (new r.Vector3).copy(i.position),
  15726. this.discPosition = (new r.Vector3).copy(i.stem.direction),
  15727. this.discWorldPosition = null,
  15728. this.discScale = .05,
  15729. this.poleEnabled = i.stem.enabled,
  15730. this.billboard = new o(i.label,i.description,i.media,this),
  15731. this.visibleTransition = null,
  15732. this.hoveringDisc = !1
  15733. }
  15734. var r = e("three")
  15735. , o = e("./Billboard/Billboard")
  15736. , a = e("../settings")
  15737. , s = e("../enum/Viewmode")
  15738. , l = e("../enum/Colors")
  15739. , c = e("../enum/RenderLayers")
  15740. , h = e("../enum/RenderOrder")
  15741. , u = (e("../util/common"),
  15742. e("../util/math"))
  15743. , d = e("../util/texture")
  15744. , p = e("../objects/Panorama")
  15745. , f = e("../shaders")
  15746. , g = e("../util/transitions")
  15747. , m = e("../util/lerp")
  15748. , v = e("../util/easing")
  15749. , A = e("./Billboard/BillboardEvent")
  15750. , y = e("events").EventEmitter
  15751. , C = e("../util/logger")
  15752. , I = new C(i)
  15753. , 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==")
  15754. , 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")
  15755. , w = new r.PlaneBufferGeometry(1,1);
  15756. n.prototype = Object.create(y.prototype),
  15757. n.raycaster = new r.Raycaster,
  15758. n.prototype.bindEvents = function() {
  15759. this.billboard.on(A.ENTER, this.setHoverState.bind(this)),
  15760. this.billboard.on(A.LEAVE, this.setFreeState.bind(this))
  15761. }
  15762. ,
  15763. n.prototype.build = function() {
  15764. return this.floor = this.model.floors.get(this.floorIndex) || this.model.floors.first(),
  15765. this.floor && (this.billboard.build(this.model.sid),
  15766. this.obj3d = this.buildObject3D(),
  15767. this.floor.add(this.obj3d)),
  15768. this
  15769. }
  15770. ,
  15771. n.prototype.buildObject3D = function() {
  15772. var e = new r.Object3D;
  15773. e.position.copy(this.position);
  15774. var t = r.UniformsUtils.clone(f.tagDisc.uniforms);
  15775. t.bg.value = b,
  15776. t.mask.value = E,
  15777. t.color.value.copy(this.color),
  15778. this.materials.disc = new r.RawShaderMaterial({
  15779. transparent: !0,
  15780. vertexShader: f.tagDisc.vertexShader,
  15781. fragmentShader: f.tagDisc.fragmentShader,
  15782. uniforms: t
  15783. }),
  15784. this.disc = new r.Mesh(w,this.materials.disc),
  15785. this.disc.layers.set(c.TAG),
  15786. this.disc.position.copy(this.discPosition),
  15787. this.disc.renderOrder = h.tagDisc,
  15788. this.disc.tag = this;
  15789. var i = this.buildPole();
  15790. return i.layers.set(c.TAG),
  15791. i.renderOrder = h.tagStem,
  15792. e.add(i),
  15793. e.layers.set(c.TAG),
  15794. e.add(this.disc)
  15795. }
  15796. ,
  15797. n.prototype.buildPole = function() {
  15798. var e = new r.BufferGeometry
  15799. , t = new Float32Array(6);
  15800. return t[0] = t[1] = t[2] = 0,
  15801. t[3] = this.discPosition.x,
  15802. t[4] = this.discPosition.y,
  15803. t[5] = this.discPosition.z,
  15804. e.addAttribute("position", new r.BufferAttribute(t,3)),
  15805. this.materials.pole = new r.LineBasicMaterial({
  15806. linewidth: a.tags.pole.width,
  15807. color: a.tags.pole.color,
  15808. opacity: 0,
  15809. visible: this.poleEnabled,
  15810. transparent: !0,
  15811. depthWrite: !1
  15812. }),
  15813. new r.Line(e,this.materials.pole)
  15814. }
  15815. ,
  15816. n.prototype.setFreeState = function(e) {
  15817. !e && this.hoveringDisc || this.billboard.close(e).then(function() {
  15818. this.materials.disc.uniforms.color.value = this.color
  15819. }
  15820. .bind(this))
  15821. }
  15822. ,
  15823. n.prototype.setHoverState = function(e) {
  15824. this.billboard.open(e),
  15825. this.materials.disc.uniforms.color.value = this.hoverColor
  15826. }
  15827. ,
  15828. n.prototype.hide = function(e, t) {
  15829. var i = $.Deferred();
  15830. if (0 === this.materials.disc.uniforms.opacity.value && !g.isRunning(this.visibleTransition))
  15831. return i.resolve().promise();
  15832. e = e || 0,
  15833. t = t || 0,
  15834. g.cancel(this.visibleTransition);
  15835. var n = this.materials.disc.uniforms.opacity.value / a.tags.disc.opacity
  15836. , r = t + e
  15837. , o = t / r;
  15838. return this.visibleTransition = g.start(function(e) {
  15839. var t = m.property(e.materials.disc.uniforms.opacity, "value", 0)
  15840. , i = m.property(e.materials.pole, "opacity", 0);
  15841. return function(n) {
  15842. t(n),
  15843. e.materials.pole && i(n)
  15844. }
  15845. }(this), r * n, function() {
  15846. i.resolve()
  15847. }, o, v[a.warp.blendEasing]),
  15848. i.promise()
  15849. }
  15850. ,
  15851. n.prototype.show = function(e, t) {
  15852. var i = $.Deferred();
  15853. if (this.materials.disc.uniforms.opacity.value === a.tags.disc.opacity && !g.isRunning(this.visibleTransition))
  15854. return i.resolve().promise();
  15855. e = e || 0,
  15856. t = t || 0,
  15857. g.cancel(this.visibleTransition);
  15858. var n = (a.tags.disc.opacity - this.materials.disc.uniforms.opacity.value) / a.tags.disc.opacity
  15859. , r = t + e
  15860. , o = t / r;
  15861. return this.visibleTransition = g.start(function(e) {
  15862. var t = m.property(e.materials.disc.uniforms.opacity, "value", a.tags.disc.opacity)
  15863. , i = m.property(e.materials.pole, "opacity", a.tags.pole.opacity);
  15864. return function(n) {
  15865. t(n),
  15866. e.materials.pole && i(n)
  15867. }
  15868. }(this), r * n, function() {
  15869. i.resolve()
  15870. }, o, v[a.warp.blendEasing]),
  15871. i.promise()
  15872. }
  15873. ,
  15874. n.prototype.closestPanoTowardTag = function(e, t) {
  15875. var i = []
  15876. , o = []
  15877. , l = this.disc.getWorldPosition();
  15878. if (e === s.PANORAMA) {
  15879. var c = .5
  15880. , h = t.position.clone().sub(l).normalize();
  15881. i.push(p.filters.isPanoAligned()),
  15882. i.push(p.filters.inPanoDirection(l, h, c)),
  15883. i.push(p.filters.isNeighbourPanoTo(t)),
  15884. o.push(p.scoreFunctions.direction(l, h))
  15885. }
  15886. var u = new r.Vector3
  15887. , d = function(e) {
  15888. u.copy(l).sub(e.position);
  15889. var t = -r.Math.radToDeg(Math.atan(u.y / Math.sqrt(u.x * u.x + u.z * u.z)))
  15890. , i = a.tags.navigate.tiltTolerance;
  15891. return a.insideLookLimitDown - i < t && t < a.insideLookLimitUp + i
  15892. }
  15893. , f = function(e) {
  15894. return Math.abs(e.position.x - l.x) > a.tags.visibility.cameraClearance || Math.abs(e.position.z - l.z) > a.tags.visibility.cameraClearance
  15895. };
  15896. i.push(f, d),
  15897. o.push(p.scoreFunctions.distanceSquared(this, -2));
  15898. var g = this.model.panos.sortByScore(i, o);
  15899. if (a.tags.navigate.lineOfSight) {
  15900. for (var m = 0; m < g.length; m++) {
  15901. var v = g[m].pano
  15902. , A = v.position.distanceTo(l);
  15903. if (!a.tags.visibility.anyDistance && A > a.tags.visibility.visibleDistance)
  15904. return null;
  15905. n.raycaster.set(v.position, l.clone().sub(v.position).normalize());
  15906. var y = n.raycaster.intersectObjects(this.model.colliders);
  15907. if (0 === y.length || y[0].distance > A)
  15908. return v
  15909. }
  15910. return null
  15911. }
  15912. return g.length > 0 && g[0].pano
  15913. }
  15914. ,
  15915. n.prototype.examine = function(e) {
  15916. var t = e.mode
  15917. , i = a.tags.navigate.nearestPano && this.closestPanoTowardTag(t, e.currentPano) || e.currentPano
  15918. , n = this.disc.getWorldPosition();
  15919. this.billboard.setActiveState();
  15920. var o = function() {
  15921. var t = this.billboard.getDimensions()
  15922. , n = new r.Vector3;
  15923. u.convertScreenPositionToNDC(t.left + t.width / 2, t.top + t.height / 2, n),
  15924. n.unproject(e.camera),
  15925. e.flyToPano({
  15926. pano: i,
  15927. lookAtPoint: n
  15928. })
  15929. }
  15930. .bind(this);
  15931. if (t === s.PANORAMA)
  15932. if (i !== e.currentPano) {
  15933. var l = {
  15934. pano: i,
  15935. lookAtPoint: n,
  15936. duration: null,
  15937. maxDistanceOverride: null,
  15938. skipWarpingCheck: !1
  15939. };
  15940. e.flyToPano(l, o)
  15941. } else
  15942. setTimeout(function() {
  15943. this.billboard.open().then(function() {
  15944. o()
  15945. })
  15946. }
  15947. .bind(this), 0);
  15948. else {
  15949. var c = {
  15950. pano: i
  15951. };
  15952. if (n) {
  15953. var h = (new r.Matrix4).lookAt(i.position, n, new r.Vector3(0,1,0));
  15954. c.quaternion = (new r.Quaternion).setFromRotationMatrix(h)
  15955. }
  15956. c.callback = o,
  15957. c.duration = 1500,
  15958. c.mode = s.PANORAMA,
  15959. e.flyToNewMode(c)
  15960. }
  15961. }
  15962. ,
  15963. n.prototype.update = function(e, t) {
  15964. var i = new r.Vector3;
  15965. return function(e, t) {
  15966. this.discWorldPosition = this.disc.getWorldPosition(),
  15967. this.updateDisc(e, t),
  15968. this.billboard.needsUpdate() && (i.copy(this.discWorldPosition).project(t),
  15969. i.z < 1 && (i.y *= -1,
  15970. this.billboard.update(i, this.getDiscRadius(i, t))))
  15971. }
  15972. }(),
  15973. n.prototype.updateDisc = function(e, t) {
  15974. var i = new r.Vector3
  15975. , o = new r.Vector3
  15976. , l = new r.Vector3
  15977. , c = new r.Vector3
  15978. , h = new r.Vector3;
  15979. return function(e, t) {
  15980. var u = a.tags.visibility
  15981. , d = a.tags.disc.scale
  15982. , p = e === s.DOLLHOUSE || e === s.FLOORPLAN ? a.tags.visibility.visibleDistance : t.position.distanceTo(this.discWorldPosition);
  15983. 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)),
  15984. this.obj3d.visible) {
  15985. this.disc.quaternion.copy(t.quaternion);
  15986. var f = d.maxSize - (d.maxSize - d.minSize) * r.Math.smoothstep(p, d.nearBound, d.farBound);
  15987. i.copy(this.discWorldPosition).project(t),
  15988. o.set($("#player").width() / 2, $("#player").height() / 2, 1).multiply(i),
  15989. l.set(f / 2, 0, 0).add(o),
  15990. c.set(2 / $("#player").width(), 2 / $("#player").height(), 1).multiply(l),
  15991. h.copy(c).unproject(t);
  15992. var g = h.distanceTo(this.discWorldPosition)
  15993. , m = 1 + a.tags.disc.scale.responsiveness / 100 * (n.viewportScale() - 1);
  15994. this.discScale = g * m,
  15995. this.disc.scale.set(this.discScale, this.discScale, this.discScale)
  15996. }
  15997. }
  15998. }(),
  15999. n.prototype.getDiscRadius = function(e, t) {
  16000. var i = new r.Vector3;
  16001. return function(e, t) {
  16002. return i.set(-this.discScale / 2, 0, 0).applyQuaternion(t.quaternion).add(this.discWorldPosition).project(t),
  16003. Math.abs(e.x - i.x) * $("#player").width()
  16004. }
  16005. }(),
  16006. n.prototype.tagVisibleOnCurrentFloor = function(e) {
  16007. return !(e === s.DOLLHOUSE || e === s.FLOORPLAN) || this.model.allFloorsVisible || !this.floor.hidden
  16008. }
  16009. ,
  16010. n.prototype.offScreen = function(e, t) {
  16011. var i = e.getWorldPosition().project(t);
  16012. return !(-1 < i.x && i.x < 1 && -1 < i.y && i.y < 1)
  16013. }
  16014. ,
  16015. n.viewportScale = function() {
  16016. return n.viewportWidth === $("#player").width() && n.viewportHeight === $("#player").height() || (n.viewportWidth = $("#player").width(),
  16017. n.viewportHeight = $("#player").height(),
  16018. n.currentViewportScale = Math.sqrt(Math.min(n.viewportWidth, n.viewportHeight) / a.tags.disc.scale.baseViewportSize)),
  16019. n.currentViewportScale
  16020. }
  16021. ,
  16022. t.exports = n
  16023. }
  16024. ).call(this, "/js/tag/tag.js")
  16025. }
  16026. , {
  16027. "../enum/Colors": 19,
  16028. "../enum/RenderLayers": 41,
  16029. "../enum/RenderOrder": 42,
  16030. "../enum/Viewmode": 51,
  16031. "../objects/Panorama": 148,
  16032. "../settings": 166,
  16033. "../shaders": 167,
  16034. "../util/common": 185,
  16035. "../util/easing": 186,
  16036. "../util/lerp": 188,
  16037. "../util/logger": 189,
  16038. "../util/math": 190,
  16039. "../util/texture": 194,
  16040. "../util/transitions": 195,
  16041. "./Billboard/Billboard": 119,
  16042. "./Billboard/BillboardEvent": 120,
  16043. events: 202,
  16044. three: 217
  16045. }],
  16046. 124: [function(e, t, i) {
  16047. (function(i) {
  16048. "use strict";
  16049. function n() {
  16050. this.tagState = y.IDLE,
  16051. this.intersectTag = null,
  16052. this.hoveredTag = null,
  16053. this.activeTag = null,
  16054. this.tagDiscs = [],
  16055. this.raycaster = new r.Raycaster,
  16056. this.modelManager = null,
  16057. this.player = null,
  16058. this.totaltags = 0,
  16059. this.navigatingViaTag = !1,
  16060. this.enabled = !1
  16061. }
  16062. var r = e("three")
  16063. , o = e("../util/logger")
  16064. , a = e("../util/common")
  16065. , s = e("../controls/serializer")
  16066. , l = e("../objects/Snapshot")
  16067. , c = e("../settings")
  16068. , h = e("./Billboard/BillboardEvent")
  16069. , u = e("./Media/MediaEvent")
  16070. , d = e("./Media/LinkType")
  16071. , p = e("../enum/Viewmode")
  16072. , f = e("../enum/WarpStyle")
  16073. , g = e("../enum/BlackoutStyle")
  16074. , m = e("../enum/ModelManagerEvents")
  16075. , v = e("../enum/tagEvents")
  16076. , A = e("../enum/PlayerEvents")
  16077. , y = (e("../util/lerp"),
  16078. e("../enum/TagStates"))
  16079. , C = e("events").EventEmitter
  16080. , I = new o(i);
  16081. a.extend(n, C),
  16082. n.prototype.init = function(e, t) {
  16083. this.modelManager = e,
  16084. this.player = t,
  16085. this.updateModel(),
  16086. this.bindEvents()
  16087. }
  16088. ,
  16089. n.prototype.update = function(e) {
  16090. this.updateTags(this.player.mode, this.player.camera, this.player.currentPano, this.player.flying)
  16091. }
  16092. ,
  16093. n.prototype.updateTags = function(e, t, i, n) {
  16094. for (var r in this.model.tags)
  16095. this.model.tags[r].update(e, t, i, n)
  16096. }
  16097. ,
  16098. n.prototype.updateModel = function() {
  16099. this.model = this.modelManager.getActiveModel(),
  16100. this.gettagsFromModel(),
  16101. this.totaltags = Object.keys(this.model.tags).length
  16102. }
  16103. ,
  16104. n.prototype.gettagsFromModel = function() {
  16105. this.tagDiscs = [];
  16106. for (var e in this.model.tags) {
  16107. var t = this.model.tags[e].disc;
  16108. t && this.tagDiscs.push(t)
  16109. }
  16110. }
  16111. ,
  16112. n.prototype.bindEvents = function() {
  16113. function e() {
  16114. Object.keys(this.model.tags).forEach(function(e) {
  16115. var t = this.model.tags[e];
  16116. t.bindEvents(),
  16117. t.billboard.on(u.LINK_CLICK, function(e) {
  16118. e.type === d.NAVIGATION && this.navigateViaLink(e.url)
  16119. }
  16120. .bind(this)),
  16121. t.billboard.on(u.IMAGE_OPENED, function() {
  16122. this.tagState = y.EXAMINE,
  16123. this.emit(u.IMAGE_OPENED)
  16124. }
  16125. .bind(this)),
  16126. t.billboard.on(h.CLOSING, this.dismissExaminedTag.bind(this))
  16127. }
  16128. .bind(this))
  16129. }
  16130. this.modelManager.on(m.ActiveModelChanged, this.updateModel.bind(this)),
  16131. this.modelManager.on(m.ActiveModelChanged, e.bind(this)),
  16132. this.player.on(A.ModeChanging, this.onPlayerModeChanging.bind(this)),
  16133. this.player.on(A.PanoChosen, this.onPanoChange.bind(this)),
  16134. this.player.on(A.Ready, this.onPlayerReady.bind(this)),
  16135. this.player.on(A.FlyingEnded, this.onPlayerFlyingEnded.bind(this)),
  16136. this.player.on(A.WarpStarted, this.handleWarpStart.bind(this)),
  16137. this.player.on(A.WarpInterrupted, this.handleWarpInterruption.bind(this)),
  16138. e.call(this)
  16139. }
  16140. ,
  16141. n.prototype.navigateViaLink = function(e) {
  16142. var t = s.deserialize(e);
  16143. if (t)
  16144. if (t.mode === p.PANORAMA) {
  16145. try {
  16146. this.player.model.panos.get(t.panoId)
  16147. } catch (e) {
  16148. return void I.warn("Unable to find panorama location", t.panoId)
  16149. }
  16150. this.player.warpToPanoById(t.panoId, t.quaternion, null, null, f.BLACK)
  16151. } else {
  16152. var i = {
  16153. cameraMode: t.mode,
  16154. position: t.position,
  16155. quaternion: t.quaternion,
  16156. scanId: t.panoId,
  16157. orthoZoom: t.zoom,
  16158. floorVisibility: t.floorVisibility,
  16159. thumbUrl: null,
  16160. name: null
  16161. };
  16162. this.player.flyToNewMode({
  16163. mode: t.mode,
  16164. duration: c.warp.outsideTime,
  16165. warpDest: new l(i),
  16166. force: !0
  16167. })
  16168. }
  16169. }
  16170. ,
  16171. n.prototype.handleWarpStart = function(e, t, i, n) {
  16172. this.dismissExaminedTag(),
  16173. t === f.BLACK && (null !== n && void 0 !== n || (n = c.warp.teleportTime),
  16174. e && (i = g.END),
  16175. this.hideShowTagsForBlackoutStyle(i, n))
  16176. }
  16177. ,
  16178. n.prototype.handleWarpInterruption = function(e, t, i) {
  16179. null !== i && void 0 !== i || (i = c.warp.teleportTime),
  16180. this.hideShowTagsForBlackoutStyle(t, i)
  16181. }
  16182. ,
  16183. n.prototype.hideShowTagsForBlackoutStyle = function(e, t) {
  16184. var i = 0
  16185. , n = 0
  16186. , r = t / 2;
  16187. switch (null !== e && void 0 !== e || (e = g.MIDDLE),
  16188. e) {
  16189. case g.END:
  16190. this.hideAlltags(r);
  16191. break;
  16192. case g.BEGINNING:
  16193. this.hideAlltags().done(this.showAlltags.bind(this, r));
  16194. break;
  16195. case g.NONE:
  16196. break;
  16197. case g.MIDDLE:
  16198. i = r,
  16199. n = r,
  16200. this.hideAlltags(n),
  16201. setTimeout(function() {
  16202. this.showAlltags(i)
  16203. }
  16204. .bind(this), n);
  16205. break;
  16206. case g.FADEIN:
  16207. setTimeout(function() {
  16208. this.showAlltags(r)
  16209. }
  16210. .bind(this), r)
  16211. }
  16212. }
  16213. ,
  16214. n.prototype.onPlayerModeChanging = function(e, t) {
  16215. t !== p.PANORAMA && this.dismissExaminedTag(),
  16216. t === p.PANORAMA && player.currentPano && !player.currentPano.isAligned() && (t = p.OUTDOOR);
  16217. var i = t !== p.OUTDOOR;
  16218. i !== this.model.tagsShown && (i ? this.showAlltags(c.tags.startup.fadeInDuration) : this.hideAlltags(c.tags.startup.fadeInDuration))
  16219. }
  16220. ,
  16221. n.prototype.onPanoChange = function(e, t) {
  16222. var i = this.navigatingViaTag;
  16223. if (this.navigatingViaTag = !1,
  16224. !i) {
  16225. this.dismissExaminedTag();
  16226. var n = e && !e.isAligned() ? p.OUTDOOR : p.PANORAMA
  16227. , r = t && !t.isAligned() ? p.OUTDOOR : p.PANORAMA;
  16228. n !== r && (r === p.PANORAMA ? this.showAlltags(c.tags.startup.fadeInDuration, null, !0) : this.hideAlltags(c.tags.startup.fadeInDuration))
  16229. }
  16230. }
  16231. ,
  16232. n.prototype.onPlayerReady = function(e, t, i) {
  16233. this.startAlltags(e, t ? i : null)
  16234. }
  16235. ,
  16236. n.prototype.onPlayerFlyingEnded = function(e, t) {
  16237. this.updateClosestTags(e)
  16238. }
  16239. ,
  16240. n.prototype.dismissExaminedTag = function() {
  16241. this.activeTag && this.tagState === y.EXAMINE && this.dismissActiveTag(),
  16242. this.hoveredTag && (this.hoveredTag.setFreeState(!0),
  16243. this.hoveredTag = null)
  16244. }
  16245. ,
  16246. n.prototype.startAlltags = function(e, t) {
  16247. this.model.shouldShowtags = c.tags.enabled,
  16248. this.enabled = !0,
  16249. e || (this.showAlltags(c.tags.startup.fadeInDuration, c.tags.startup.fadeInDelay),
  16250. t && setTimeout(function() {
  16251. this.activateTag(this.model.getTagBySid(t))
  16252. }
  16253. .bind(this), c.tags.startup.fadeInDuration / 2))
  16254. }
  16255. ,
  16256. n.prototype.showAlltags = function(e, t, i) {
  16257. function n() {
  16258. o++,
  16259. o === this.totaltags && (this.model.tagsShown = !0,
  16260. r.resolve())
  16261. }
  16262. var r = $.Deferred();
  16263. if (!i && this.player.mode === p.PANORAMA && this.player.currentPano && !this.player.currentPano.isAligned() || !this.model.shouldShowtags)
  16264. return r.resolve().promise();
  16265. var o = 0;
  16266. for (var a in this.model.tags) {
  16267. var s = this.model.tags[a];
  16268. s.show(e, t).done(n.bind(this))
  16269. }
  16270. return r.promise()
  16271. }
  16272. ,
  16273. n.prototype.hideAlltags = function(e, t) {
  16274. function i() {
  16275. r++,
  16276. r === this.totaltags && (this.model.tagsShown = !1,
  16277. n.resolve())
  16278. }
  16279. var n = $.Deferred()
  16280. , r = 0;
  16281. for (var o in this.model.tags) {
  16282. var a = this.model.tags[o];
  16283. a.hide(e, t).done(i.bind(this)),
  16284. a === this.activeTag && this.dismissActiveTag()
  16285. }
  16286. return n.promise()
  16287. }
  16288. ,
  16289. n.prototype.enableHovering = function() {
  16290. this.enabled = !0
  16291. }
  16292. ,
  16293. n.prototype.disableHovering = function() {
  16294. this.enabled = !1
  16295. }
  16296. ,
  16297. n.prototype.activateTag = function(e, t) {
  16298. t = t || y.EXAMINE,
  16299. this.activeTag = e,
  16300. this.activeTag.hoveringDisc = !0,
  16301. this.activeTag.setHoverState(t === y.EXAMINE),
  16302. this.tagState = t,
  16303. this.emit(v.TagActivated, e)
  16304. }
  16305. ,
  16306. n.prototype.dismissActiveTag = function() {
  16307. this.activeTag.hoveringDisc = !1,
  16308. this.activeTag.setFreeState(!0);
  16309. var e = this.activeTag;
  16310. this.activeTag = null,
  16311. this.tagState = y.IDLE,
  16312. this.emit(v.TagDismissed, e)
  16313. }
  16314. ,
  16315. n.prototype.clickedOnTag = function(e) {
  16316. var t = function() {
  16317. this.navigatingViaTag = !0,
  16318. this.activeTag.examine(this.player),
  16319. this.emit(v.TagNavigation, this.activeTag)
  16320. }
  16321. .bind(this);
  16322. return this.tagState !== y.EXAMINE ? (this.activateTag(this.intersectTag, y.EXAMINE),
  16323. this.activeTag = this.intersectTag,
  16324. t(),
  16325. !0) : (this.dismissActiveTag(),
  16326. !1)
  16327. }
  16328. ,
  16329. n.prototype.intersecttag = function() {
  16330. var e = new r.Vector3
  16331. , t = new r.Vector3
  16332. , i = new r.Vector3;
  16333. return function(n, r, o) {
  16334. if (!this.enabled)
  16335. return null;
  16336. var a = null
  16337. , s = this.tagDiscs.filter(function(e) {
  16338. return e.parent.visible
  16339. });
  16340. if (s.length > 0) {
  16341. var l = this.model.floors.reduce(function(e, t) {
  16342. return t.hidden ? e : e.concat(t.collider.children)
  16343. }, s);
  16344. e.set(n.x, n.y, -1).unproject(o),
  16345. t.set(n.x, n.y, 1).unproject(o),
  16346. i.copy(t).sub(e).normalize(),
  16347. this.raycaster.set(e, i);
  16348. var c = this.raycaster.intersectObjects(l);
  16349. c.length > 0 && s.indexOf(c[0].object) !== -1 && (a = c[0].object.tag)
  16350. }
  16351. return this.intersectTag = a,
  16352. r && (this.activeTag && a !== this.activeTag && (this.tagState === y.BROWSE || this.tagState === y.EXAMINE && a) && this.dismissActiveTag(),
  16353. a && a !== this.activeTag && (a.listeners(h.ENTER).length < 1 && (a.billboard.on(h.ENTER, function() {
  16354. this.hoveredTag = a
  16355. }
  16356. .bind(this)),
  16357. a.billboard.on(h.LEAVE, function() {
  16358. this.hoveredTag = null
  16359. }
  16360. .bind(this))),
  16361. this.activateTag(a, y.BROWSE))),
  16362. a
  16363. }
  16364. }(),
  16365. n.prototype.rankedtagInDirection = function() {
  16366. var e = []
  16367. , t = []
  16368. , i = new r.Vector3
  16369. , n = new r.Vector3
  16370. , o = new r.Vector3;
  16371. return function(r, a, s, l) {
  16372. var c = 0;
  16373. t.length = 0;
  16374. for (var h = 0; h < this.closesttags.length; h++) {
  16375. var u = this.closesttags[h];
  16376. n.copy(u.position),
  16377. n.add(u.discPosition),
  16378. i.copy(a),
  16379. i.sub(n).negate(),
  16380. i.normalize();
  16381. var d = i.dot(l);
  16382. if (d >= 0) {
  16383. o.copy(n),
  16384. o.project(s);
  16385. var p = this.intersecttag(o, !1, s);
  16386. if (p) {
  16387. if (c >= e.length)
  16388. for (var f = 0; f < 64; f++)
  16389. e.push({
  16390. tag: u,
  16391. dot: d
  16392. });
  16393. var g = e[c];
  16394. g.tag = u,
  16395. g.dot = d,
  16396. g.position = math.projectPositionToCanvas(n, s),
  16397. t.push(g),
  16398. c++
  16399. }
  16400. }
  16401. }
  16402. return t.sort(function(e, t) {
  16403. return e.dot > t.dot ? -1 : e.dot < t.dot ? 1 : 0
  16404. }),
  16405. r < t.length ? t[r].tag : null
  16406. }
  16407. }(),
  16408. n.prototype.updateClosestTags = function() {
  16409. var e = new r.Vector3
  16410. , t = 30;
  16411. return function(i) {
  16412. this.closesttags || (this.closesttags = []),
  16413. this.closesttags.length = 0;
  16414. var n = this.model.tags;
  16415. if (n)
  16416. for (var r in n)
  16417. if (n.hasOwnProperty(r)) {
  16418. var o = n[r]
  16419. , a = o.position;
  16420. e.copy(i),
  16421. e.sub(a).negate();
  16422. var s = e.lengthSq();
  16423. s < t && this.closesttags.push(o)
  16424. }
  16425. }
  16426. }(),
  16427. t.exports = n
  16428. }
  16429. ).call(this, "/js/tag/tagManager.js")
  16430. }
  16431. , {
  16432. "../controls/serializer": 14,
  16433. "../enum/BlackoutStyle": 18,
  16434. "../enum/tagEvents": 32,
  16435. "../enum/ModelManagerEvents": 33,
  16436. "../enum/PlayerEvents": 40,
  16437. "../enum/TagStates": 44,
  16438. "../enum/Viewmode": 51,
  16439. "../enum/WarpStyle": 52,
  16440. "../objects/Snapshot": 153,
  16441. "../settings": 166,
  16442. "../util/common": 185,
  16443. "../util/lerp": 188,
  16444. "../util/logger": 189,
  16445. "./Billboard/BillboardEvent": 120,
  16446. "./Media/LinkType": 130,
  16447. "./Media/MediaEvent": 131,
  16448. events: 202,
  16449. three: 217
  16450. }],
  16451. 125: [function(e, t, i) {
  16452. (function(i) {
  16453. "use strict";
  16454. function n() {
  16455. this.embedWrapper = null,
  16456. this.embedElement = null
  16457. }
  16458. var r = e("../../util/ajax")
  16459. , o = e("./mediaSettings")
  16460. , a = e("../../settings")
  16461. , s = e("../../util/logger")
  16462. , l = new s(i);
  16463. n.prototype.createDomElement = function() {
  16464. return this.embedWrapper = document.createElement("div"),
  16465. this.embedWrapper.classList.add("tag-embed"),
  16466. this.embedWrapper.classList.add("hidden"),
  16467. this.embedWrapper
  16468. }
  16469. ,
  16470. n.prototype.load = function(e) {
  16471. var t = "https://api.embedly.com/1/oembed?key=" + a.appConfig.embedly_key + "&url=" + encodeURIComponent(e) + "&maxwidth=" + o.maxEmbedWidth;
  16472. return new Promise(function(e, i) {
  16473. r.get(t).then(function(t) {
  16474. if (t = JSON.parse(t),
  16475. t.html && t.html.indexOf("<script") === -1) {
  16476. this.embedWrapper.innerHTML = t.html;
  16477. var n = Math.min(t.width, o.maxEmbedWidth) || o.maxEmbedWidth;
  16478. if (this.embedWrapper.style.width = n + "px",
  16479. t.height) {
  16480. var r = t.height / t.width;
  16481. this.embedWrapper.style.height = n * r + "px"
  16482. }
  16483. this.embedElement = this.embedWrapper.firstChild;
  16484. var a = [];
  16485. try {
  16486. a = [].slice.call(this.embedElement.querySelectorAll("a"))
  16487. } catch (e) {
  16488. l.debug("Error getting `a` elements for embed; was it an iframe?")
  16489. }
  16490. a.forEach(function(e) {
  16491. e.setAttribute("target", "_blank")
  16492. }),
  16493. this.embedElement.classList.add("hidden"),
  16494. this.embedWrapper.classList.remove("hidden"),
  16495. e()
  16496. } else
  16497. i("Not a valid embed")
  16498. }
  16499. .bind(this), function(e) {
  16500. i(e.response)
  16501. })
  16502. }
  16503. .bind(this))
  16504. }
  16505. ,
  16506. n.prototype.show = function() {
  16507. this.embedElement && this.embedElement.classList.remove("hidden")
  16508. }
  16509. ,
  16510. n.prototype.hide = function() {
  16511. this.embedElement && this.embedElement.classList.add("hidden")
  16512. }
  16513. ,
  16514. t.exports = n
  16515. }
  16516. ).call(this, "/js/tag/Media/EmbedlyEmbed.js")
  16517. }
  16518. , {
  16519. "../../settings": 166,
  16520. "../../util/ajax": 181,
  16521. "../../util/logger": 189,
  16522. "./mediaSettings": 132
  16523. }],
  16524. 126: [function(e, t, i) {
  16525. (function(i) {
  16526. "use strict";
  16527. function n(e) {
  16528. o.call(this),
  16529. this.options = e,
  16530. this.playerControls = null,
  16531. this.state = s.NOT_READY
  16532. }
  16533. var r = e("../../util/browser")
  16534. , o = e("./EmbedlyEmbed")
  16535. , a = e("../../util/logger")
  16536. , s = (new a(i),
  16537. Object.freeze({
  16538. NOT_READY: "player.not.ready",
  16539. CUED: "player.cued",
  16540. PLAYING: "player.playing",
  16541. PAUSED: "player.paused"
  16542. }));
  16543. n.prototype = Object.create(o.prototype),
  16544. n.prototype.createDomElement = function() {
  16545. return this.embedWrapper = document.createElement("div"),
  16546. this.embedWrapper.classList.add("tag-video"),
  16547. this.embedWrapper.classList.add("hidden"),
  16548. this.embedWrapper
  16549. }
  16550. ,
  16551. n.prototype.load = function(e) {
  16552. var t = function() {
  16553. function e(e) {
  16554. this.playerState = s.CUED,
  16555. this.options.startMuted && this.playerControls.mute()
  16556. }
  16557. function t(e) {
  16558. this.playerState = e
  16559. }
  16560. function i(e) {
  16561. this.playerControls.setCurrentTime(0),
  16562. this.options.loop ? this.playerControls.play() : this.playerControls.pause()
  16563. }
  16564. this.playerControls = new playerjs.Player(this.embedElement),
  16565. this.playerControls.on("ready", e.bind(this)),
  16566. this.playerControls.on("play", t.bind(this, s.PLAYING)),
  16567. this.playerControls.on("pause", t.bind(this, s.PAUSED)),
  16568. this.playerControls.on("ended", i.bind(this))
  16569. }
  16570. .bind(this);
  16571. return o.prototype.load.call(this, e).then(t.bind(this))
  16572. }
  16573. ,
  16574. n.prototype.play = function() {
  16575. var e = r.isMobile();
  16576. return function() {
  16577. this.playerState !== s.NOT_READY && this.playerControls && !e && (this.state === s.CUED && this.options.autoPlay || this.options.autoResume) && this.playerControls.play()
  16578. }
  16579. }(),
  16580. n.prototype.pause = function() {
  16581. this.playerState !== s.NOT_READY && this.playerControls && this.playerControls.pause()
  16582. }
  16583. ,
  16584. t.exports = n
  16585. }
  16586. ).call(this, "/js/tag/Media/EmbedlyPlayer.js")
  16587. }
  16588. , {
  16589. "../../util/browser": 182,
  16590. "../../util/logger": 189,
  16591. "./EmbedlyEmbed": 125
  16592. }],
  16593. 127: [function(e, t, i) {
  16594. (function(i) {
  16595. "use strict";
  16596. function n(e) {
  16597. function t() {
  16598. return a.debug("requesting file from embedly:", e.href),
  16599. r.get(e.href, {
  16600. responseType: e.responseType
  16601. }).then(function(t) {
  16602. return a.debug("requesting file finished:", e.href),
  16603. t
  16604. })
  16605. }
  16606. function i() {}
  16607. return s = new Promise(function(e, n) {
  16608. s.catch(i).then(function() {
  16609. t().then(e, n)
  16610. })
  16611. }
  16612. )
  16613. }
  16614. var r = e("../../util/ajax")
  16615. , o = (e("./mediaSettings"),
  16616. e("../../util/logger"))
  16617. , a = new o(i)
  16618. , s = Promise.resolve();
  16619. t.exports.enqueue = n
  16620. }
  16621. ).call(this, "/js/tag/Media/EmbedlyQueue.js")
  16622. }
  16623. , {
  16624. "../../util/ajax": 181,
  16625. "../../util/logger": 189,
  16626. "./mediaSettings": 132
  16627. }],
  16628. 128: [function(e, t, i) {
  16629. (function(i) {
  16630. "use strict";
  16631. function n() {
  16632. this.imageWrapper = null,
  16633. this.width = 0,
  16634. this.height = 0,
  16635. this.aspect = 1
  16636. }
  16637. var r = e("./MediaEvent")
  16638. , o = e("./EmbedlyQueue")
  16639. , a = e("events").EventEmitter
  16640. , s = e("../../util/logger")
  16641. , l = e("../../settings");
  16642. new s(i);
  16643. n.prototype = Object.create(a.prototype),
  16644. n.prototype.createDomElement = function() {
  16645. return this.imageWrapper = document.createElement("div"),
  16646. this.imageWrapper.classList.add("tag-image"),
  16647. this.imageWrapper.classList.add("hidden"),
  16648. this.imageWrapper.addEventListener("click", function(e) {
  16649. e.stopPropagation(),
  16650. this.emit(r.IMAGE_OPENING),
  16651. this.imageWrapper.style.pointerEvents = "none"
  16652. }
  16653. .bind(this)),
  16654. this.imageWrapper
  16655. }
  16656. ,
  16657. n.prototype.onClosed = function() {
  16658. this.imageWrapper.style.pointerEvents = "auto"
  16659. }
  16660. ,
  16661. n.prototype.load = function(e) {
  16662. var t = Math.max(window.screen.height, window.screen.width)
  16663. , i = "https://i.embed.ly/1/display/resize?key=" + l.appConfig.embedly_key + "&url=" + encodeURIComponent(e) + "&width=" + t + "&height=" + t;
  16664. return new Promise(function(e, t) {
  16665. function n(t) {
  16666. var i = t.target;
  16667. this.width = i.naturalWidth,
  16668. this.height = i.naturalHeight,
  16669. this.aspect = this.width / this.height;
  16670. var n = t.target.src;
  16671. this.imageWrapper.style.backgroundImage = 'url("' + n + '")',
  16672. this.imageWrapper.style.width = this.width + "px",
  16673. this.imageWrapper.style.height = this.height + "px",
  16674. this.imageWrapper.classList.remove("hidden"),
  16675. e()
  16676. }
  16677. o.enqueue({
  16678. href: i,
  16679. responseType: "arraybuffer"
  16680. }).then(function(e) {
  16681. var t = new Uint8Array(e)
  16682. , i = new Blob([t])
  16683. , r = new window.Image;
  16684. r.addEventListener("load", n.bind(this));
  16685. var o = URL.createObjectURL(i);
  16686. r.src = o
  16687. }
  16688. .bind(this), t)
  16689. }
  16690. .bind(this))
  16691. }
  16692. ,
  16693. t.exports = n
  16694. }
  16695. ).call(this, "/js/tag/Media/Image.js")
  16696. }
  16697. , {
  16698. "../../settings": 166,
  16699. "../../util/logger": 189,
  16700. "./EmbedlyQueue": 127,
  16701. "./MediaEvent": 131,
  16702. events: 202
  16703. }],
  16704. 129: [function(e, t, i) {
  16705. "use strict";
  16706. function n(e) {
  16707. this.label = e.label,
  16708. this.href = e.url,
  16709. this.type = this.updateLinkForType(),
  16710. this.domElement = null,
  16711. this.id = c++
  16712. }
  16713. var r = e("./LinkType")
  16714. , o = e("./MediaEvent")
  16715. , a = e("../../util/browser")
  16716. , s = e("../../analytics")
  16717. , l = e("events").EventEmitter
  16718. , c = 0;
  16719. n.prototype = Object.create(l.prototype),
  16720. n.prototype.updateLinkForType = function() {
  16721. function e(e) {
  16722. var t = new RegExp("[#&?]start=([^#&?]*)")
  16723. , i = t.exec(e);
  16724. return i[1]
  16725. }
  16726. function t(e) {
  16727. return e + "&play=1"
  16728. }
  16729. var i = a.valueFromHash("m") || a.valueFromHash("model");
  16730. 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),
  16731. r.NAVIGATION) : (this.href = t(this.href),
  16732. r.MODEL) : r.EXT_LINK
  16733. }
  16734. ;
  16735. var h = {};
  16736. n.prototype.createDomElement = function() {
  16737. function e(e) {
  16738. switch (e.stopPropagation(),
  16739. h[this.id] = !0,
  16740. s.trackAlways("click_tag_link", {
  16741. link_type: this.type,
  16742. link_count: c,
  16743. links_clicked: Object.keys(h).length
  16744. }),
  16745. this.type) {
  16746. case r.MODEL:
  16747. window.location.replace(this.href);
  16748. break;
  16749. case r.EXT_LINK:
  16750. window.open(this.href, "_blank")
  16751. }
  16752. this.emit(o.LINK_CLICK, {
  16753. type: this.type,
  16754. url: this.href
  16755. })
  16756. }
  16757. if (this.domElement = document.createElement("a"),
  16758. this.domElement.classList.add("tag-link"),
  16759. this.domElement.textContent = this.label,
  16760. this.type === r.EXT_LINK) {
  16761. this.domElement.textContent += " ";
  16762. var t = document.createElement("i");
  16763. t.classList.add("icon-ext-link"),
  16764. t.title = "Link to external web site",
  16765. this.domElement.appendChild(t)
  16766. }
  16767. return this.domElement.addEventListener("click", e.bind(this)),
  16768. this.domElement
  16769. }
  16770. ,
  16771. t.exports = n
  16772. }
  16773. , {
  16774. "../../analytics": 4,
  16775. "../../util/browser": 182,
  16776. "./LinkType": 130,
  16777. "./MediaEvent": 131,
  16778. events: 202
  16779. }],
  16780. 130: [function(e, t, i) {
  16781. "use strict";
  16782. t.exports = {
  16783. NAVIGATION: "navigation",
  16784. MODEL: "model",
  16785. EXT_LINK: "ext-link"
  16786. }
  16787. }
  16788. , {}],
  16789. 131: [function(e, t, i) {
  16790. "use strict";
  16791. t.exports = Object.freeze({
  16792. LINK_CLICK: "mtmedia.link",
  16793. IMAGE_LOADED: "mtmedia.image.loaded",
  16794. IMAGE_OPENING: "mtmedia.image.opening",
  16795. IMAGE_OPENED: "mtmedia.image.opened",
  16796. IMAGE_CLOSING: "mtmedia.image.closing",
  16797. IMAGE_CLOSED: "mtmedia.image.closed",
  16798. VIDEO_START: "mtmedia.video.start",
  16799. VIDEO_PAUSE: "mtmedia.video.pause",
  16800. VIDEO_ENDED: "mtmedia.video.end"
  16801. })
  16802. }
  16803. , {}],
  16804. 132: [function(e, t, i) {
  16805. "use strict";
  16806. t.exports = Object.freeze({
  16807. maxEmbedWidth: 350,
  16808. defaultAspectRatio: .75
  16809. })
  16810. }
  16811. , {}],
  16812. 133: [function(e, t, i) {
  16813. "use strict";
  16814. t.exports = Object.freeze({
  16815. TEXT: "text",
  16816. LINK: "link",
  16817. IMAGE: "photo",
  16818. VIDEO: "video",
  16819. RICH: "rich"
  16820. })
  16821. }
  16822. , {}],
  16823. 134: [function(e, t, i) {
  16824. "use strict";
  16825. function n(e) {
  16826. this.capabilities = {
  16827. links: {
  16828. enable: e.supportLinks,
  16829. keepLabels: e.keepLinkLabels
  16830. }
  16831. }
  16832. }
  16833. var r = e("./DescriptionChunkType");
  16834. n.prototype.parse = function(e, t) {
  16835. var i = []
  16836. , n = e.split("[").map(function(e, t) {
  16837. return 0 === t ? e : "[" + e
  16838. });
  16839. return n.forEach(function(e) {
  16840. var n = this.findMarkdown(e);
  16841. if (n) {
  16842. if (n.url.indexOf("javascript:") !== -1)
  16843. return;
  16844. this.addLinkChunk(i, n, t),
  16845. this.addTextChunk(i, e.slice(n.markdown.length))
  16846. } else
  16847. this.addTextChunk(i, e)
  16848. }
  16849. .bind(this)),
  16850. i
  16851. }
  16852. ,
  16853. n.prototype.findMarkdown = function(e) {
  16854. var t = /\[([^\]]*)\]\((.*)\)/
  16855. , i = e.match(t);
  16856. if (i) {
  16857. for (var n = i[2], r = 1, o = 0; o < n.length && ("(" === n[o] ? r++ : ")" === n[o] && r--,
  16858. 0 !== r); )
  16859. o++;
  16860. var a = n.length - o;
  16861. return {
  16862. markdown: i[0].substring(0, i[0].length - a),
  16863. label: i[1],
  16864. url: i[2].substring(0, o)
  16865. }
  16866. }
  16867. }
  16868. ,
  16869. n.prototype.addTextChunk = function(e, t) {
  16870. 0 !== t.length && e.push({
  16871. type: r.TEXT,
  16872. text: t
  16873. })
  16874. }
  16875. ,
  16876. n.prototype.addLinkChunk = function(e, t) {
  16877. if (!this.capabilities.links.enable)
  16878. return void (this.capabilities.links.keepLabels && this.addTextChunk(e, t.label));
  16879. var i = {
  16880. label: t.label,
  16881. url: t.url
  16882. };
  16883. i.url.indexOf("://") === -1 && (i.url = "http://" + i.url),
  16884. e.push({
  16885. type: r.LINK,
  16886. link: i
  16887. })
  16888. }
  16889. ,
  16890. t.exports = n
  16891. }
  16892. , {
  16893. "./DescriptionChunkType": 133
  16894. }],
  16895. 135: [function(e, t, i) {
  16896. (function(i) {
  16897. "use strict";
  16898. var n = e("../util/logger")
  16899. , r = new n(i)
  16900. , o = {
  16901. parseIdsFromChunkName: function(e, t) {
  16902. t.floorId = o.parseFloor(e),
  16903. t.roomId = o.parseRoom(e)
  16904. },
  16905. parseFloor: function(e) {
  16906. var t = e.match(/_group([0-9]+)/);
  16907. if (!t)
  16908. return 0;
  16909. try {
  16910. return parseInt(t[1], 10)
  16911. } catch (e) {
  16912. return r.warn('Non-int value "' + t[1] + '" for mesh group, defaulting to floor 0'),
  16913. 0
  16914. }
  16915. },
  16916. parseRoom: function(e) {
  16917. var t = e.match(/_sub([0-9]+)/);
  16918. if (!t)
  16919. return -1;
  16920. try {
  16921. return parseInt(t[1], 10)
  16922. } catch (e) {
  16923. return r.warn('Non-int value "' + t[1] + '" for mesh subgroup, defaulting to subgroup 0'),
  16924. 0
  16925. }
  16926. }
  16927. };
  16928. t.exports = o
  16929. }
  16930. ).call(this, "/js/model/Chunks.js")
  16931. }
  16932. , {
  16933. "../util/logger": 189
  16934. }],
  16935. 136: [function(e, t, i) {
  16936. (function(i) {
  16937. "use strict";
  16938. function n(e) {
  16939. s.call(this),
  16940. this.model = e,
  16941. this.exploded = !1
  16942. }
  16943. var r = e("../objects/Floor")
  16944. , o = (e("../settings"),
  16945. e("../util/logger"))
  16946. , a = e("../util/transitions")
  16947. , s = e("../util/IndexedCollection")
  16948. , l = e("../util/common")
  16949. , c = e("../util/easing");
  16950. new o(i);
  16951. l.inherit(n, s),
  16952. n.prototype.add = function(e) {
  16953. s.prototype.add.call(this, e),
  16954. this.model.add(e)
  16955. }
  16956. ,
  16957. n.prototype.getIndex = function(e) {
  16958. return e.floorIndex
  16959. }
  16960. ,
  16961. n.prototype.build = function() {
  16962. this.list.forEach(function(e) {
  16963. e.build()
  16964. })
  16965. }
  16966. ,
  16967. n.prototype.size = function() {
  16968. return this.length
  16969. }
  16970. ,
  16971. n.prototype.sort = function() {
  16972. s.prototype.sort.call(this, function(e, t) {
  16973. return e.floorIndex - t.floorIndex
  16974. })
  16975. }
  16976. ,
  16977. n.prototype.nextFloor = function(e, t) {
  16978. return this.index[e.floorIndex + t] || null
  16979. }
  16980. ,
  16981. n.prototype.getFloorAtPoint = function(e) {
  16982. for (var t = null, i = 1 / 0, n = 0; n < this.list.length; n++) {
  16983. var r = this.list[n]
  16984. , o = r.distanceToPoint(e);
  16985. (!t || i > o) && (i = o,
  16986. t = r)
  16987. }
  16988. return t
  16989. }
  16990. ,
  16991. n.prototype.getOrMakeFloor = function(e) {
  16992. var t = this.index[e];
  16993. return t || (t = new r(this.model,e),
  16994. this.add(t)),
  16995. t
  16996. }
  16997. ,
  16998. n.prototype.hide = function() {
  16999. this.list.forEach(function(e) {
  17000. e.hide()
  17001. })
  17002. }
  17003. ,
  17004. n.prototype.show = function() {
  17005. this.list.forEach(function(e) {
  17006. e.show()
  17007. })
  17008. }
  17009. ,
  17010. n.prototype.names = function() {
  17011. return this.list.reduce(function(e, t) {
  17012. return e.concat(t.name)
  17013. }, [])
  17014. }
  17015. ,
  17016. n.prototype.toggleExplodeHorizontal = function() {
  17017. function e(e, t) {
  17018. r.copy(e.position),
  17019. e.position.x = i[e.floorIndex] * t,
  17020. e.position.y = 1 * e.floorIndex * t,
  17021. r.sub(e.position).multiplyScalar(-1),
  17022. e.panos.forEach(function(e) {
  17023. e.translate(r)
  17024. })
  17025. }
  17026. var t, i = [], n = 0;
  17027. this.list.forEach(function(e, r, o) {
  17028. t = r > 0 ? Math.max(o[r - 1].boundingBox.max.x - e.boundingBox.min.x, e.boundingBox.size().x / 2) : 0,
  17029. n += t,
  17030. i[r] = n
  17031. }),
  17032. i = i.map(function(e) {
  17033. return e - n / 2
  17034. });
  17035. var r = this.list[0].position.clone();
  17036. this.exploded ? this.list.forEach(function(t) {
  17037. a.start(function(i) {
  17038. e(t, 1 - i)
  17039. }, 1500, null, 0, c.easeOutExpo)
  17040. }) : this.list.forEach(function(t) {
  17041. a.start(function(i) {
  17042. e(t, i)
  17043. }, 1500, null, 0, c.easeOutExpo)
  17044. }),
  17045. this.exploded = !this.exploded
  17046. }
  17047. ,
  17048. n.prototype.toggleExplodeVertical = function() {
  17049. function e(e, i) {
  17050. var n = n.copy(e.position);
  17051. e.position.y = (5 * e.floorIndex - t.y / 2) * i,
  17052. n.sub(e.position).multiplyScalar(-1),
  17053. e.panos.forEach(function(e) {
  17054. e.translate(n)
  17055. })
  17056. }
  17057. var t = this.model.size;
  17058. this.list[0].position.clone();
  17059. this.exploded ? this.list.forEach(function(t) {
  17060. a.start(function(i) {
  17061. e(t, 1 - i)
  17062. }, 1500, null, 0, c.easeOutExpo)
  17063. }) : this.list.forEach(function(t) {
  17064. a.start(function(i) {
  17065. e(t, i)
  17066. }, 1500, null, 0, c.easeOutExpo)
  17067. }),
  17068. this.exploded = !this.exploded
  17069. }
  17070. ,
  17071. t.exports = n
  17072. }
  17073. ).call(this, "/js/model/FloorCollection.js")
  17074. }
  17075. , {
  17076. "../objects/Floor": 146,
  17077. "../settings": 166,
  17078. "../util/IndexedCollection": 175,
  17079. "../util/common": 185,
  17080. "../util/easing": 186,
  17081. "../util/logger": 189,
  17082. "../util/transitions": 195
  17083. }],
  17084. 137: [function(e, t, i) {
  17085. (function(i) {
  17086. "use strict";
  17087. function n() {
  17088. c.call(this)
  17089. }
  17090. var r = e("../settings")
  17091. , o = e("../util/logger")
  17092. , a = e("../enum/Viewmode")
  17093. , s = e("../objects/Snapshot")
  17094. , l = (e("../util/math"),
  17095. e("../util/common"))
  17096. , c = e("../util/IndexedCollection")
  17097. , h = new o(i);
  17098. l.inherit(n, c),
  17099. n.prototype.getImage = function(e) {
  17100. return e && this.index.hasOwnProperty(e) ? this.index[e] : null
  17101. }
  17102. ,
  17103. n.prototype.filterByModesAndReel = function(e, t) {
  17104. for (var i = [], n = 0; n < t.length; n += 1) {
  17105. var r = t[n]
  17106. , o = this.index[r.sid];
  17107. o && i.push(o)
  17108. }
  17109. var s = e[a.DOLLHOUSE]
  17110. , l = e[a.FLOORPLAN];
  17111. i = i.filter(function(e) {
  17112. if (!e.metadata || void 0 === e.metadata.camera_mode)
  17113. return !0;
  17114. var t;
  17115. try {
  17116. t = a.convertWorkshopModeInt(e.metadata.camera_mode)
  17117. } catch (e) {
  17118. return h.debug(e.message),
  17119. !1
  17120. }
  17121. return t === a.PANORAMA || t === a.FLOORPLAN && l || t === a.DOLLHOUSE && s
  17122. }),
  17123. i.length !== this.list.length && h.info("Disallowed " + (this.list.length - i.length) + " highlight images"),
  17124. this.list = i,
  17125. this.reIndex()
  17126. }
  17127. ,
  17128. n.prototype.getHeroLocations = function(e) {
  17129. if (0 === this.list.length)
  17130. return [];
  17131. for (var t = [], i = 0; i < this.list.length; ++i) {
  17132. var o = this.list[i]
  17133. , l = o.thumbnail_signed_src
  17134. , c = o.name || '';
  17135. if (o.metadata && void 0 !== o.metadata.camera_quaternion) {
  17136. if (!r.show360Views.enabled && o.metadata.scan_id) {
  17137. var h = e.get(o.metadata.scan_id);
  17138. if (h && !h.isAligned())
  17139. continue
  17140. }
  17141. var u = a.convertWorkshopModeInt(o.metadata.camera_mode);
  17142. if (u === a.MESH)
  17143. continue;
  17144. if(window.isLocal)var src = manage.dealURL(l)
  17145. else var src = g_version === "one" ? g_Prefix + l + "?"+ randomTime().getTime() : (l.substr(0,4)=="http" ? l + "?"+ randomTime().getTime() : '//' + l + "?"+ randomTime().getTime())
  17146. var d = {
  17147. cameraMode: u,
  17148. position: o.metadata.camera_position,
  17149. quaternion: o.metadata.camera_quaternion,
  17150. zoom: o.metadata.zoom,
  17151. panoId: o.metadata.scan_id,
  17152. orthoZoom: o.metadata.ortho_zoom,
  17153. floorVisibility: void 0 !== o.metadata.floor_visibility ? o.metadata.floor_visibility.slice(0) : [],
  17154. thumbUrl: src,
  17155. name: n.filterImageName(c),
  17156. sid: o.sid //xzw add g_tourAudio要用,
  17157. }
  17158. , p = new s(d);
  17159. t.push(p)
  17160. }
  17161. }
  17162. return t
  17163. }
  17164. ,
  17165. n.prototype.getIndex = function(e) {
  17166. return e.sid
  17167. }
  17168. ,
  17169. n.filterImageName = function(e) {
  17170. return "" === e || e.match(/^[0-9.]+_[0-9.]+$/) ? null : e
  17171. }
  17172. ,
  17173. t.exports = n
  17174. }
  17175. ).call(this, "/js/model/ImageCollection.js")
  17176. }
  17177. , {
  17178. "../enum/Viewmode": 51,
  17179. "../objects/Snapshot": 153,
  17180. "../settings": 166,
  17181. "../util/IndexedCollection": 175,
  17182. "../util/common": 185,
  17183. "../util/logger": 189,
  17184. "../util/math": 190
  17185. }],
  17186. 138: [function(e, t, i) {
  17187. (function(i) {
  17188. "use strict";
  17189. function n() {
  17190. u.call(this)
  17191. }
  17192. var r = e("../label/Label")
  17193. , o = e("../settings")
  17194. , a = e("../util/logger")
  17195. , s = e("../util/math")
  17196. , l = e("../util/ajax")
  17197. , c = e("./RoomCollection")
  17198. , h = e("../util/common")
  17199. , u = e("../util/IndexedCollection");
  17200. new a(i);
  17201. h.inherit(n, u),
  17202. n.prototype.getIndex = function(e) {
  17203. return e.labelId
  17204. }
  17205. ,
  17206. n.prototype.associateWithRooms = function(e) {
  17207. this.forEach(function(t) {
  17208. e.forEach(function(e) {
  17209. e.roomId === t.roomId && (t.room = e)
  17210. })
  17211. })
  17212. }
  17213. ,
  17214. n.prototype.createFromLabelData = function(e) {
  17215. e.forEach(function(e) {
  17216. var t = n.parseRoomIndexFromWorkshopRoomId(e.roomId);
  17217. t = c.generateRoomId(e.floorId, t);
  17218. var i = new r(e.sid,e.position || e.positions[0],e.text,e.floorId,t);
  17219. i.position = s.convertWorkshopVector(i.position),
  17220. this.add(i),
  17221. i.build()
  17222. }
  17223. .bind(this))
  17224. }
  17225. ,
  17226. n.prototype.load = function(e, t) {
  17227. return l.get(e, {
  17228. responseType: "json",
  17229. auth: t ? o.authorizationHeader : null
  17230. }).done(function(e) {
  17231. var t = [];
  17232. for (var i in e) {
  17233. var n = e[i];
  17234. t.push(n)
  17235. }
  17236. this.createFromLabelData(t)
  17237. }
  17238. .bind(this))
  17239. }
  17240. ,
  17241. n.parseRoomIndexFromWorkshopRoomId = function(e) {
  17242. var t = -1;
  17243. if (e) {
  17244. var i = e.split("_");
  17245. t = parseInt(i[0])
  17246. }
  17247. return t
  17248. }
  17249. ,
  17250. t.exports = n
  17251. }
  17252. ).call(this, "/js/model/LabelCollection.js")
  17253. }
  17254. , {
  17255. "../label/Label": 90,
  17256. "../settings": 166,
  17257. "../util/IndexedCollection": 175,
  17258. "../util/ajax": 181,
  17259. "../util/common": 185,
  17260. "../util/logger": 189,
  17261. "../util/math": 190,
  17262. "./RoomCollection": 141
  17263. }],
  17264. 139: [function(e, t, i) {
  17265. (function(i) {
  17266. "use strict";
  17267. function n(e, t) {
  17268. o.Object3D.call(this)
  17269. this.sid = window.number;//t.sid,
  17270. this.data = t,
  17271. this.options = e,
  17272. this.urls = new s(e.urlFiles),
  17273. this.isPublic = void 0 !== t.is_public && t.is_public,
  17274. this.images = new _(this),
  17275. this.images.extend(t.images),
  17276. this.heroImage = this.images.getImage(t.icon),
  17277. this.heroLocations = [],
  17278. this.outdoorPanoLocations = [],
  17279. this.floors = new d(this),
  17280. this.floorsEnabled = void 0 === e.floors || e.floors,
  17281. this.changingFloor = !1,
  17282. this.chunks = [],
  17283. this.panos = new A,
  17284. this.colliders = [],
  17285. this.loadPanosPromise = null,
  17286. this.loadMeshTexturesPromise = null,
  17287. this.auxDataPromise = null,
  17288. this.meshTexturesLoaded = !1,
  17289. this.meshTextures = [],
  17290. this.tags = {},
  17291. this.tagsShown = !1,
  17292. this.shouldShowtags = !1,
  17293. this.has360Views = !1,
  17294. this.showingLabels = f.labels.enabled && t.player_options.labels,
  17295. this.supportedModes = {},
  17296. this.supportedModes[c.PANORAMA] = !0,
  17297. this.supportedModes[c.DOLLHOUSE] = !t.player_options || t.player_options.dollhouse && w.valueFromHash("dh", 1),
  17298. this.supportedModes[c.FLOORPLAN] = !t.player_options || t.player_options.floor_plan && w.valueFromHash("dh", 1),
  17299. this.supportedModes[c.TRANSITIONING] = !0,
  17300. this.supportsTiles = this.configureTiling(),
  17301. // this.supportsVR = t.is_vr,
  17302. this.supportsVR = window.MP_PREFETCHED_MODELDATA.supportsVR || false//true; // 方奕卓 VR功能可配置
  17303. this.mode = c.DOLLHOUSE,
  17304. this.size = null,
  17305. this.center = null,
  17306. this.boundingBox = new o.Box3,
  17307. this.currentFloor = null,
  17308. this.allFloorsVisible = !0,
  17309. this.projectedPano0 = null,
  17310. this.projectedPano1 = null,
  17311. this.floorsEnabled && t.floors && t.floors.indexOf(",") !== -1 && t.floors.split(",").forEach(function(e, t) {
  17312. this.addFloor(new u(this,t,e.trim()))
  17313. }
  17314. .bind(this)),
  17315. this.waitQueue = [],
  17316. this.on("load", function(e) {
  17317. 0 !== this.waitQueue.length && (this.waitQueue = this.waitQueue.filter(function(e) {
  17318. return !e.isLoadedCallback()
  17319. }),
  17320. 0 === this.waitQueue.length && this.emit("waiting-done"))
  17321. }
  17322. .bind(this)),
  17323. this.setupCustomProperties()
  17324. this.hots = {};
  17325. }
  17326. function r() {
  17327. try {
  17328. var e = document.createElement("canvas")
  17329. , t = e.getContext("webgl");
  17330. t || (t = e.getContext("experimental-webgl"));
  17331. var i = t.getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE);
  17332. return i
  17333. } catch (e) {
  17334. return 0
  17335. }
  17336. }
  17337. var o = e("three")
  17338. , a = e("../util/ajax")
  17339. , s = e("../util/ModelUrls")
  17340. , l = e("../objects/BoundingTextureSkybox")
  17341. , c = e("../enum/Viewmode")
  17342. , h = e("../enum/RenderOrder")
  17343. , u = (e("../enum/AlignmentType"),
  17344. e("../objects/Floor"))
  17345. , d = e("./FloorCollection")
  17346. , p = e("../objects/Chunk")
  17347. , f = (e("../objects/Room"),
  17348. e("../objects/Snapshot"),
  17349. e("../label/Label"),
  17350. e("../util/math"),
  17351. e("../settings"))
  17352. ,ss = e("../shaders")
  17353. , g = e("../util/logger")
  17354. , m = e("../tag/tag")
  17355. , v = (e("../tag/tagManager"),
  17356. e("../objects/Panorama"))
  17357. , A = e("../util/PanoramaCollection")
  17358. , y = e("../loaders/ModelLoader")
  17359. , C = e("../loaders/ModelTextureLoader")
  17360. , I = e("../loaders/SweepDataLoader")
  17361. , E = e("../util/transitions")
  17362. , b = e("../util/common")
  17363. , es = e("../util/easing")
  17364. ,lerp = e("../util/lerp")
  17365. ,tex = e("../util/texture")
  17366. , w = e("./../util/browser")
  17367. , _ = e("./ImageCollection")
  17368. , T = e("./RoomCollection")
  17369. , x = e("./LabelCollection")
  17370. , S = e("./Chunks")
  17371. , M = e("./../util/showcase")
  17372. , R = e("../exception/BasicException")
  17373. , P = (e("../constants")
  17374. ,e("events").EventEmitter)
  17375. ,Hot = e("hot")
  17376. , O = new g(i);
  17377. n.prototype = Object.create(o.Object3D.prototype),
  17378. b.extend(n, P),
  17379. n.prototype.setupCustomProperties = function() {
  17380. var e = f.modelAlpha;
  17381. Object.defineProperty(this, "alpha", {
  17382. get: function() {
  17383. return e
  17384. },
  17385. set: function(t) {
  17386. e = t,
  17387. this.chunks.forEach(function(t) {
  17388. t.material && t.material.uniforms.modelAlpha && (t.material.uniforms.modelAlpha.value = e)
  17389. })
  17390. }
  17391. })
  17392. }
  17393. ,
  17394. n.prototype.configureTiling = function() {
  17395. var e = r();
  17396. if (e < 2048)
  17397. return !1;
  17398. O.warn("Max cube texture size: " + e);
  17399. for (var t = 0; t < f.tiling.tilingFlagNames.length; t++) {
  17400. var i = f.tiling.tilingFlagNames[t];
  17401. if ("1" === w.valueFromHash(i, null))
  17402. return !0;
  17403. if ("0" === w.valueFromHash(i, null))
  17404. return !1
  17405. }
  17406. //--------------------------------------------许钟文-------------------------------------------
  17407. //return true;
  17408. return !!M.modelDataPromisesTiles(this.data) //免去访问mdoeldata.json的vision_version,不明白这是什么
  17409. //--------------------------------------------e n d -------------------------------------------
  17410. }
  17411. ,
  17412. n.prototype.toggleAlpha = function() {
  17413. this.alpha < 1 ? this.alpha = 1 : this.alpha = 0
  17414. }
  17415. ,
  17416. n.prototype.load = function(e) {
  17417. var t = function() {
  17418. return $.when(this.loadPanos(), this.loadMesh())
  17419. }
  17420. , i = this.urls.init().then(t.bind(this));
  17421. return e ? i = i.then(this.loadMeshTextures.bind(this)) : i.then(this.loadMeshTextures.bind(this)),
  17422. this.auxDataPromise = $.when( /*this.loadHighlightReel(), this.loadtags() */this.loadhots(), this.loadLabels()),
  17423. $.when(i, this.auxDataPromise).done(this.build.bind(this)) //不要另外使用active_reel文件
  17424. }
  17425. ,
  17426. n.prototype.loadMesh = function() {
  17427. function e(e) {
  17428. O.error(e),
  17429. n.reject("loading-failed")
  17430. }
  17431. function t(e, t) {
  17432. n.notify(e, t)
  17433. }
  17434. function i(e, t) {
  17435. if (0 === e.length) {
  17436. O.warn("No geometry found for model, loading faux geometry, disabling outside mode"),
  17437. r.supportedModes[c.DOLLHOUSE] = !1,
  17438. r.supportedModes[c.FLOORPLAN] = !1;
  17439. var i = new p({
  17440. geometry: new o.PlaneBufferGeometry(5,5,1,1)
  17441. });
  17442. i.material.visible = !1,
  17443. i.rotateX(-Math.PI / 2),
  17444. i.geometry.computeBoundingBox(),
  17445. e = [i]
  17446. }
  17447. e.forEach(function(e) {
  17448. var t = r.floorsEnabled ? S.parseFloor(e.name) : 0;
  17449. r.addChunk(t, e)
  17450. }),
  17451. r.floors.sort(),
  17452. n.resolve(r)
  17453. }
  17454. var n = $.Deferred()
  17455. , r = this;
  17456. return y.load(r.data.job.uuid, r.urls, i, t, e),
  17457. n.promise()
  17458. }
  17459. ,
  17460. n.prototype.loadMeshTextures = function() {
  17461. return this.loadTexturesPromise ? this.loadTexturesPromise : (this.loadTexturesPromise = C.load(this, this.meshTextures).then(function() {
  17462. this.meshTexturesLoaded = !0
  17463. }
  17464. .bind(this)),
  17465. this.loadTexturesPromise)
  17466. }
  17467. ,
  17468. /* n.prototype.loadtags = function() {//xzw改
  17469. var e = $.Deferred();
  17470. if (!f.tags.enabled)
  17471. return e.resolve();
  17472. //var t = this.options.urlBase + "/api/v1/jsonstore/model/tags/" + this.sid;
  17473. t = "data/" + this.sid + "/tags.json"
  17474. return a.get(t, {
  17475. responseType: "json",
  17476. auth: this.isPublic ? null : f.authorizationHeader
  17477. }).done(function(t) {
  17478. var i = 0
  17479. , n = 0;
  17480. for (var r in t) {
  17481. var o = t[r];
  17482. o.enabled && (n++,
  17483. (o.label.length || o.description.length) && (this.tags[r] = new m(this,r,o),
  17484. i++))
  17485. }
  17486. i !== n && O.warn("Disallowed " + (n - i) + " tags with no text data"),
  17487. e.resolve()
  17488. }
  17489. .bind(this)).fail(function() {
  17490. O.warn("Getting tags failed, not displaying tags."),
  17491. e.resolve()
  17492. }),
  17493. e
  17494. } */
  17495. n.prototype.shineHots = function(){ //xzw
  17496. E.trigger({
  17497. func: function(e) {
  17498. var opa = e <= .5 ? 2 * e : -2 * e + 2
  17499. for(var i in this.hots){
  17500. this.hots[i].mesh.material.uniforms.opac.value = opa;
  17501. }
  17502. }.bind(this),
  17503. cycling: true,
  17504. duration: 3000,
  17505. //easing: "easeInOutQuad",
  17506. name: "hotShine"
  17507. })
  17508. },
  17509. n.prototype.createHotItem = function(data, hots) {
  17510. var docFragment = document.createDocumentFragment();
  17511. var keyAry = Object.keys(data);
  17512. for(var i = 0; i < keyAry.length; i++){
  17513. var li = document.createElement('li');
  17514. var span = document.createElement('span');
  17515. span.innerHTML = data[keyAry[i]].title || data[keyAry[i]].infoAttribute.title || '热点';
  17516. // console.log(span.innerHTML);
  17517. li.hot = hots[keyAry[i]]; // 列表每一项对应一个热点
  17518. li.appendChild(span);
  17519. docFragment.appendChild(li);
  17520. }
  17521. var ul = document.querySelector('#hotListContent ul');
  17522. ul.appendChild(docFragment);
  17523. console.log(docFragment);
  17524. }
  17525. n.prototype.loadOverlays = function(overlays){
  17526. var overlays = window.data2 && window.data2.overlays
  17527. overlays && overlays.forEach((info)=>{
  17528. new Overlay(info)
  17529. })
  17530. }
  17531. n.prototype.loadhots = function() {//xzw
  17532. var e = $.Deferred();
  17533. var t = g_Prefix+"data/" + this.sid + "/data2.js" +'?'+ randomTime().getTime();
  17534. return a.get(t, {
  17535. responseType: "json",
  17536. auth: this.isPublic ? null : f.authorizationHeader
  17537. }).done(function(t) {
  17538. window.data2 = t;
  17539. if(!t){
  17540. console.error("data2 is null")
  17541. }else{
  17542. g_data2 = hotMatcher(t);
  17543. this.hotsCount = 0;
  17544. /* for(var i in t.hots){
  17545. this.hotsCount ++;
  17546. this.hots[i] = new Hot(i, t.hots[i], this);
  17547. t.hots[i].infoAttribute || (t.hots[i].infoAttribute = {})
  17548. this.hots[i].initStyleImg(t.hots[i].infoAttribute);
  17549. };
  17550. window.hotData = t.hots
  17551. t.hots && this.createHotItem(t.hots, this.hots); */
  17552. //因为热点保存后在hots里的顺序会被修改,所以使用order来记录顺序,这里要重排序:
  17553. window.hotData = {}
  17554. if(t.hots){
  17555. var sids = Object.keys(t.hots).sort((a,b)=>{return t.hots[a].order - t.hots[b].order});
  17556. sids.forEach((sid)=>{
  17557. this.hotsCount++,
  17558. this.hots[sid] = new Hot(sid,t.hots[sid] ,this);
  17559. t.hots[sid].infoAttribute || (t.hots[sid].infoAttribute = {})
  17560. this.hots[sid].initStyleImg(t.hots[sid].infoAttribute);
  17561. window.hotData[sid] = t.hots[sid];
  17562. })
  17563. }
  17564. this.createHotItem(window.hotData, this.hots);
  17565. g_index = w.valueFromHash("m");
  17566. if(t.tourAudio){
  17567. g_tourAudio = new Audio;
  17568. g_tourAudio.loop = false;
  17569. g_tourAudio.addEventListener('ended', function () {
  17570. var ev = document.createEvent("MouseEvent");
  17571. ev.initEvent("tourAudioEnded",true,true);
  17572. window.dispatchEvent(ev);
  17573. });
  17574. };
  17575. }
  17576. /***************************方奕卓 请求data.js数据, 用于初始化热点列表 ****************************/
  17577. /* var dataJsPromise = $.Deferred();
  17578. var dataJsUrl = g_Prefix+"data/" + this.sid + "/hot/js/data.js" +'?'+ randomTime().getTime();
  17579. a.get(dataJsUrl,{
  17580. responseType: "json",
  17581. auth: this.isPublic ? null : f.authorizationHeader
  17582. }).done(function(data) {
  17583. window.hotData = data;
  17584. this.createHotItem(data, this.hots);
  17585. for(let i in this.hots){//add
  17586. data[i] && this.hots[i].initStyleImg(data[i]);
  17587. }
  17588. dataJsPromise.resolve();
  17589. }.bind(this)).fail(function(){
  17590. console.log('Data.js is empty');
  17591. dataJsPromise.resolve();
  17592. }) */
  17593. e.resolve();
  17594. }.bind(this)).fail(function() {
  17595. console.log('没有热点');
  17596. e.resolve()
  17597. }),
  17598. e
  17599. }
  17600. ,
  17601. n.prototype.loadPanos = function() {
  17602. if (this.loadPanosPromise)
  17603. return this.loadPanosPromise;
  17604. var e = new I(this);
  17605. return this.loadPanosPromise = e.load().then(function(e) {
  17606. return this.data.sweeps && Object.keys(this.data.sweeps).length > 0 && (e = e.filter(function(e) {
  17607. if(this.data.sweeps[e.uuid])return this.data.sweeps[e.uuid].enabled
  17608. else console.log(e.uuid)
  17609. }
  17610. .bind(this))),
  17611. this.panos.extend(e.map(function(e) {
  17612. return new v(this,e.uuid,e,this.supportsTiles)
  17613. }
  17614. .bind(this))),
  17615. this.panos.forEach(function(e) {
  17616. e.neighbourUUIDs && (e.neighbourUUIDs.forEach(function(t) {
  17617. var i = this.panos.get(t);
  17618. i && this.panos.setNeighbour(e, i, !0)
  17619. }
  17620. .bind(this)),
  17621. e.neighbourPanos = this.panos.getNeighbours(e) || this.panos.setNeighbour(e, e, !0))
  17622. }
  17623. .bind(this)),
  17624. 0 === this.panos.length && (O.warn("Model has no panos, turning off inside mode"),
  17625. this.supportedModes[c.PANORAMA] = !1),
  17626. $.when(this)
  17627. }
  17628. .bind(this)),
  17629. this.loadPanosPromise
  17630. }
  17631. ,
  17632. n.prototype.loadHighlightReel = function() {//xzw
  17633. var e = $.Deferred()
  17634. // , t = this.options.urlBase + "/api/v1/jsonstore/model/highlights/" + this.sid + "/active_reel";
  17635. ,t = this.options.urlBase + "data/" + this.sid + "/active_reel.json";
  17636. return a.get(t, {
  17637. responseType: "json",
  17638. auth: this.isPublic ? null : f.authorizationHeader
  17639. }).done(function(t) {
  17640. t.reel ? (O.info("Got highlight reel with " + t.reel.length + " items"),
  17641. this.images.filterByModesAndReel(this.supportedModes, t.reel)) : O.info("No highlight reel found"),
  17642. e.resolve()
  17643. }
  17644. .bind(this)).fail(function() {
  17645. O.warn("Getting highlight reel failed, no highlights available"),
  17646. e.resolve()
  17647. }),
  17648. e
  17649. }
  17650. ,
  17651. n.prototype.waitForLoad = function(e, t) {
  17652. t() || (this.waitQueue.push({
  17653. object: e,
  17654. isLoadedCallback: t
  17655. }),
  17656. 1 === this.waitQueue.length && this.emit("waiting"))
  17657. }
  17658. ,
  17659. n.prototype.hide = function() {
  17660. this.floors.hide()
  17661. }
  17662. ,
  17663. n.prototype.show = function() {
  17664. this.floors.show()
  17665. }
  17666. ,
  17667. n.prototype.floorNames = function() {
  17668. return this.floors.names()
  17669. }
  17670. ,
  17671. n.prototype.warpDestFloors = function(e, t) {
  17672. if (!e || this.floors.length !== e.length)
  17673. return void this.toggleAllFloors(!0);
  17674. var i = e.findIndex(function(e) {
  17675. return e
  17676. }
  17677. .bind(this));
  17678. i !== -1 && this.setFloor(this.floors.list[i], null, t)
  17679. }
  17680. ,
  17681. n.prototype.setFloor = function(e, t, i) {
  17682. this.allFloorsVisible && this.emit("allfloors.toggled", !1, this.currentFloor),
  17683. this.allFloorsVisible = !1,
  17684. this._setFloor(e, t, i)
  17685. }
  17686. ,
  17687. n.prototype.toggleAllFloors = function(e) {
  17688. this.allFloorsVisible = void 0 !== e ? e : !this.allFloorsVisible,
  17689. this.emit("allfloors.toggled", this.allFloorsVisible, this.currentFloor),
  17690. this._setFloor(this.currentFloor)
  17691. }
  17692. ,
  17693. n.prototype._setFloor = function(e, t, i) {
  17694. t = t || this.mode,
  17695. this.emit("floor.changed", e, t, this.currentFloor),
  17696. this.currentFloor = e;
  17697. var n;
  17698. if (t === c.PANORAMA) {
  17699. if (this.show(),
  17700. this.shouldShowtags && this.tagsShown)
  17701. for (n in this.tags)
  17702. this.tags[n].show(f.showFloorDuration)
  17703. } else if ((t === c.FLOORPLAN || t === c.DOLLHOUSE) && (this.floors.list.forEach(function(e, t) {
  17704. e.toggle(e === this.currentFloor || this.allFloorsVisible, i || this.allFloorsVisible)
  17705. }
  17706. .bind(this)),
  17707. this.shouldShowtags && this.tagsShown))
  17708. for (n in this.tags) {
  17709. var r = this.tags[n];
  17710. this.allFloorsVisible ? r.show(f.showFloorDuration) : r.floor === this.currentFloor ? r.show(f.showFloorDuration, f.showFloorDelay) : r.hide(f.hideFloorDuration, f.hideFloorDelay)
  17711. }
  17712. var o = this
  17713. , a = e;
  17714. E.start(function() {}, f.showFloorDelay, function() {
  17715. o.floors.forEach(function(e) {
  17716. e.chunks.forEach(function(t) {
  17717. t.renderOrder = e === a ? h.visibleFloor : h.ghostFloor
  17718. })
  17719. })
  17720. }
  17721. .bind(this))
  17722. }
  17723. ,
  17724. n.prototype.toggleExplode = function() {
  17725. this.floors.toggleExplodeHorizontal()
  17726. }
  17727. ,
  17728. n.prototype.toggleExplodeUp = function() {
  17729. this.floors.toggleExplodeVertical()
  17730. }
  17731. ,
  17732. n.prototype.nextFloor = function(e) {
  17733. return this.floors.nextFloor(this.currentFloor, e)
  17734. }
  17735. ,
  17736. n.prototype.addFloor = function(e) {
  17737. this.floors.add(e)
  17738. }
  17739. ,
  17740. n.prototype.getFloorAtPoint = function(e) {
  17741. return this.floors.getFloorAtPoint(e)
  17742. }
  17743. ,
  17744. n.prototype.getTagBySid = function(e) {
  17745. return this.tags[e]
  17746. }
  17747. ,
  17748. n.prototype.addChunk = function(e, t) {
  17749. this.floors.getOrMakeFloor(e).addChunk(t),
  17750. this.chunks.push(t)
  17751. }
  17752. ,
  17753. n.prototype.setMode = function(e) {
  17754. if (!this.supportedModes[e])
  17755. throw new R("Mode not supported for this model: " + e);
  17756. this.mode = e;
  17757. this.skybox.material.transparent = e == "panorama" ? false : true //xzw add // 如果skybox透明,会让其中其他mesh 如热点的透明出问题
  17758. this.chunks.forEach(function(t) {
  17759. t.setMode(e)
  17760. })
  17761. }
  17762. ,
  17763. n.prototype.build = function() {
  17764. this.heroLocations = this.images.getHeroLocations(this.panos);
  17765. var e = function() {
  17766. 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()
  17767. }
  17768. .bind(this)();
  17769. this.has360Views = f.show360Views.enabled && this.heroLocations.some(function(e) {
  17770. return e.cameraMode === c.PANORAMA && this.panos.get(e.panoId) && !this.panos.get(e.panoId).isAligned()
  17771. }
  17772. .bind(this)) || e,
  17773. null === this.heroImage && O.warn("No hero image defined."),
  17774. this.currentFloor = this.floors.last(),
  17775. this.floors.build(),
  17776. this.colliders = this.floors.reduce(function(e, t) {
  17777. return e.concat(t.collider.children)
  17778. }, []),
  17779. this.panos.forEach(function(e) {
  17780. e.build1(),
  17781. e.on("enter", function() {
  17782. e.floor !== this.currentFloor && this.setFloor(e.floor)
  17783. }
  17784. .bind(this))
  17785. }
  17786. .bind(this)),
  17787. this.panos.forEach(function(e) {
  17788. e.build2()
  17789. }),
  17790. this.floors.forEach(function(e) {
  17791. this.boundingBox.union(e.boundingBox)
  17792. }
  17793. .bind(this)),
  17794. this.size = this.boundingBox.size(),
  17795. this.center = this.boundingBox.center(),
  17796. this.floors.forEach(function(e) {
  17797. O.info("Floor " + e + ": " + e.children.length + " chunks, " + e.panos.length + " panos.")
  17798. }
  17799. .bind(this)),
  17800. this.panos.populate_path_graph(),
  17801. this.skybox = new l(this.boundingBox),
  17802. this.skybox.matrixWorldNeedsUpdate = !0,
  17803. this.add(this.skybox);
  17804. setTimeout(function(){
  17805. this.hotsCount && this.shineHots();
  17806. }.bind(this),1300);//xzw 热点开始闪烁
  17807. for (var t in this.tags)
  17808. this.tags[t].build();
  17809. this.createFloorLogo()
  17810. return O.debug("Done building model"),
  17811. v.raycastsDone > 0 && (O.warn("raycasts: " + v.raycastsDone),
  17812. O.warn("raycasts skipped: " + v.raycastsSkipped)),
  17813. this.buildRooms(),
  17814. this.labels.associateWithRooms(this.rooms),
  17815. $.when(this)
  17816. }
  17817. ,
  17818. n.prototype.createFloorLogo = function(){
  17819. console.log('createFloorLogo')
  17820. if(this.floorLogos || !settings.floorlogoURL)return;
  17821. var url = settings.floorlogoURL
  17822. var map = tex.load(url);//可以追加done
  17823. this.floorLogos = [];
  17824. for(var i=0; i<2; i++){ //不可共用uniforms等 [0]在上一个位置,[1]是下一个位置、 是飞入及飞出后的位置
  17825. var material = new o.MeshBasicMaterial({
  17826. opacity:0,
  17827. map:map,
  17828. side: o.DoubleSide,
  17829. transparent: !0,
  17830. depthWrite: !1,
  17831. depthTest:false//改 在chunk\skybox外也可看到
  17832. });
  17833. var logo = new o.Mesh(new o.PlaneGeometry(2,2,1,1),material);
  17834. //var s = (Store.metadata.floorLogoSize || 100)/100;
  17835. //logo.scale.set(s,s,s);
  17836. logo.position.set(0,-1.5,0);
  17837. logo.lookAt(logo.position.clone().add(new o.Vector3(0,1,0)));
  17838. logo.renderOrder = 100;//cover the videoSkybox
  17839. //logo.layers.set(0)
  17840. this.add(logo);
  17841. this.floorLogos.push(logo);
  17842. }
  17843. this.floorLogos[1].visible = false;
  17844. }
  17845. n.prototype.adjustfloorLogoHeight = function(o){
  17846. var h = player.currentPano.floorPosition.y + 0.01;
  17847. this.floorLogos[1].position.setY(h);
  17848. this.floorLogos[0].position.setY(h);
  17849. //publicObjectSet.player.path.currentPanoMarker.mesh.position.y = h
  17850. },
  17851. n.prototype.changefloorLogoOpa = function(o){//改 i, opacity, time, delay
  17852. if(!this.floorLogos) return;
  17853. E.cancelById("flOpa_"+o.index);//先停止之前该logo的透明度变化
  17854. if(o.from!=void 0)this.floorLogos[o.index].material.opacity = o.from;//初始透明度
  17855. if(!o.dur){//立刻
  17856. //this.floorLogos[o.index].material.uniforms.opacity.value = o.opa;
  17857. this.floorLogos[o.index].material.opacity = o.opa;
  17858. }else{
  17859. //E.start(lerp.uniform(this.floorLogos[o.index], "opacity", o.opa), o.dur || 0, null,
  17860. E.start(lerp.property(this.floorLogos[o.index].material, "opacity", o.opa), o.dur || 0, null,
  17861. o.delay||0, es["easeInQuad"], "changefloorLogoOpa", "flOpa_"+o.index)
  17862. }
  17863. },
  17864. n.prototype.updateFloorlogo = function() { //xzw add 更新地标的旋转
  17865. var lastQ, lastP;
  17866. var equals = function(v1, v2, min){
  17867. return Math.abs(v1-v2) < min
  17868. }
  17869. var isSame = function(now, last, k){//如果和上次相同就不改变
  17870. if(!last)return false;
  17871. var R = k.sceneRenderer;
  17872. //var min = R.AFPS < 38 ? 0.005 : R.AFPS < 45 ? 0.0008 : R.AFPS < 50 ? 0.0006 : 0.0003;
  17873. //暂时:
  17874. var min = 0.0008
  17875. var same = equals(now.x , last.x, min) && equals(now.y , last.y, min) && equals(now.z , last.z, min)
  17876. && (now.w!=void 0 ? equals(now.w , last.w, min) : true)
  17877. return same;
  17878. }
  17879. return function(Q, k){
  17880. if(!Q)return;
  17881. /* if(Config.ifFish && window.lowFPS){
  17882. this.fLCompute++;
  17883. if(R.AFPS < 38){
  17884. if(k.flyingToTag && k.flying && k.fLCompute %4 !=1) return; //点击tag过渡
  17885. else if(k.flying && k.fLCompute%2 !=1) return;
  17886. k.fLCompute %= 4;
  17887. }else if(R.AFPS < 45){
  17888. if(k.flyingToTag && k.flying && k.fLCompute %3 !=1) return; //点击tag过渡
  17889. else if(k.flying && k.fLCompute%2 !=1) return;
  17890. k.fLCompute %= 6;
  17891. }else{
  17892. if(k.flyingToTag && k.flying && k.fLCompute %2 !=1) return;
  17893. //else if(k.flying && k.fLCompute%2 !=1) return;
  17894. k.fLCompute %= 2;
  17895. }
  17896. } */
  17897. var sameQ, sameP, quaternion, visible;
  17898. for(var i=0;i<2;i++){
  17899. var logo = this.floorLogos[i];
  17900. if(!logo.visible || logo.material.uniforms.opacity.value==0) continue;
  17901. visible = true;
  17902. }
  17903. if(!visible)return; //如果两个都不可见,就不更改,如果有一个可见,就都改
  17904. var c = k.cameraControls.activeControl;
  17905. var sameQ = c ? ( c.lat < 10 ? equals(c.lon, lastQ, 0.1) : equals(c.lon, lastQ, 1) ): false;
  17906. sameQ || (lastQ = c ? c.lon : null); //相机旋转是否改变了
  17907. for(var i=0;i<2;i++){
  17908. var logo = this.floorLogos[i];
  17909. if(!sameQ){
  17910. if(!quaternion){
  17911. var a = new THREE.Vector3(0,0,-1);
  17912. a.applyQuaternion(Q);
  17913. a.setY(0);
  17914. var _ = (new THREE.Matrix4).lookAt(a,new THREE.Vector3, new THREE.Vector3(0,1,0));
  17915. quaternion = (new THREE.Quaternion).setFromRotationMatrix(_)
  17916. var a = new THREE.Quaternion( 0, 0.7071067811865476, 0.7071067811865476 , 0)//计算得
  17917. quaternion.multiply(a);
  17918. }
  17919. logo.quaternion.copy(quaternion);
  17920. }
  17921. }
  17922. }
  17923. }()
  17924. n.prototype.loadLabels = function() {//xzw
  17925. this.labels = new x(this);
  17926. var e = $.Deferred();
  17927. //加载俯视图的标签 注释这个备注就会加载
  17928. /* window.MP_PREFETCHED_MODELDATA.model.player_options.labels ? this.showingLabels = true : '';
  17929. if (!this.showingLabels) */
  17930. return e.resolve();
  17931. // var t = this.options.urlBase + "/api/v1/jsonstore/model/labels/" + this.sid;
  17932. var t = g_Prefix + "data/" + this.sid + "/labels.json";
  17933. console.log(t);
  17934. return this.labels.load(t, !this.isPublic).done(e.resolve.bind(e)).fail(function() {
  17935. O.warn("Getting labels failed, not displaying labels."),
  17936. e.resolve()
  17937. }),
  17938. e
  17939. }
  17940. ,
  17941. n.prototype.buildRooms = function() {
  17942. this.rooms = new T(this),
  17943. this.rooms.createFromChunks(this.chunks),
  17944. this.rooms.calcRoomBoundaries()
  17945. }
  17946. ,
  17947. n.prototype.updateProjectedPanos = function() {
  17948. this.projectedPano0 && this.projectedPano1 && this.setProjectedPanos(this.projectedPano0, this.projectedPano1, !1)
  17949. }
  17950. ,
  17951. n.prototype.setProjectedPanos = function(e, t, i) {
  17952. void 0 !== i && null !== i || (i = !0),
  17953. i = !!i,
  17954. this.projectedPano0 = e,
  17955. this.projectedPano1 = t,
  17956. this.skybox.material.setProjectedPanos(e, t, i),
  17957. this.chunks.forEach(function(n) {
  17958. n.materialInside.setProjectedPanos(e, t, i)
  17959. })
  17960. }
  17961. ,
  17962. n.prototype.setSide = function(e) {
  17963. this.floors.forEach(function(t) {
  17964. t.collider.material.side = e
  17965. })
  17966. }
  17967. ,
  17968. n.prototype.heroCount = function() {
  17969. return this.heroLocations ? this.heroLocations.length : 0
  17970. }
  17971. ,
  17972. n.prototype.getHeroDescriptorByIndex = function(e) {
  17973. if (e < 0)
  17974. return O.warn("Model.getHeroDescriptorByHeroIndex() -> heroIndex is less than 0."),
  17975. null;
  17976. var t = this.heroCount();
  17977. if (t < 1)
  17978. return O.warn("Model.getHeroDescriptorByIndex() -> No hero locations in this model"),
  17979. null;
  17980. var i = this.heroLocations[e];
  17981. return void 0 === i ? (O.warn("Model.getHeroDescriptorByIndex() -> Index " + e + " is not a validindex"),
  17982. null) : i
  17983. }
  17984. ,
  17985. n.prototype.findPanoramicHero = function() {
  17986. for (var e in this.heroLocations)
  17987. if (this.heroLocations[e].cameraMode === c.PANORAMA)
  17988. return this.heroLocations[e];
  17989. return null
  17990. }
  17991. ,
  17992. n.prototype.listImagePanos = function() {
  17993. var e = []
  17994. , t = this;
  17995. return this.images.forEach(function(i) {
  17996. if (i.metadata && i.metadata.scan_id) {
  17997. var n = t.panos.get(i.metadata.scan_id);
  17998. n && (t.supportsTiles || n.isLoaded("high") || e.push(n))
  17999. }
  18000. }),
  18001. e
  18002. }
  18003. ,
  18004. n.prototype.fadePanoMarkers = function(e, t) {
  18005. this.panos.fadeMarkerOpacity(e, t)
  18006. }
  18007. ,
  18008. n.prototype.setSweepVisibility = function(e) {
  18009. this.panos.forEach(function(t) {
  18010. t.marker && (t.marker.visible = e)
  18011. })
  18012. }
  18013. ,
  18014. n.prototype.outsideAllowed = function() {
  18015. return this.supportedModes[c.DOLLHOUSE] && this.supportedModes[c.FLOORPLAN]
  18016. }
  18017. ,
  18018. t.exports = n
  18019. }
  18020. ).call(this, "/js/model/Model.js")
  18021. }
  18022. , {
  18023. "../constants": 8,
  18024. "../enum/AlignmentType": 17,
  18025. "../enum/RenderOrder": 42,
  18026. "../enum/Viewmode": 51,
  18027. "../exception/BasicException": 55,
  18028. "../label/Label": 90,
  18029. "../loaders/ModelLoader": 105,
  18030. "../loaders/ModelTextureLoader": 106,
  18031. "../loaders/SweepDataLoader": 107,
  18032. "../tag/tag": 123,
  18033. "../tag/tagManager": 124,
  18034. "../objects/BoundingTextureSkybox": 143,
  18035. "../objects/Chunk": 144,
  18036. "../objects/Floor": 146,
  18037. "../objects/Panorama": 148,
  18038. "../objects/Room": 150,
  18039. "../objects/Snapshot": 153,
  18040. "../settings": 166,
  18041. "../shaders": 167,
  18042. "../util/ModelUrls": 177,
  18043. "../util/PanoramaCollection": 178,
  18044. "../util/ajax": 181,
  18045. "../util/common": 185,
  18046. "../util/easing": 186,
  18047. "../util/lerp": 188,
  18048. "../util/logger": 189,
  18049. "../util/math": 190,
  18050. "../util/texture": 194,
  18051. "../util/transitions": 195,
  18052. "./../util/browser": 182,
  18053. "./../util/showcase": 193,
  18054. "./Chunks": 135,
  18055. "./FloorCollection": 136,
  18056. "./ImageCollection": 137,
  18057. "./LabelCollection": 138,
  18058. "./RoomCollection": 141,
  18059. events: 202,
  18060. three: 217,
  18061. "hot": "hot"
  18062. }],
  18063. 140: [function(e, t, i) {
  18064. "use strict";
  18065. function n() {
  18066. this.modelMap = {},
  18067. this.activeModel = null,
  18068. this.modelCount = 0,
  18069. this.tileDownloader = null,
  18070. this.panoRenderer = null
  18071. }
  18072. var r = (e("three"),
  18073. e("../util/common"))
  18074. , o = e("../exception/BasicException")
  18075. , a = e("../enum/ModelManagerEvents")
  18076. , s = e("../enum/PanoRendererEvents")
  18077. , l = e("events").EventEmitter;
  18078. n.prototype.init = function(e, t, i) {
  18079. this.tileDownloader = e,
  18080. this.panoRenderer = t,
  18081. this.qualityManager = i,
  18082. this.bindEvents()
  18083. }
  18084. ,
  18085. n.prototype.bindEvents = function() {
  18086. this.panoRenderer.on(s.TileRenderSuccess, this.onTileRendered.bind(this))
  18087. }
  18088. ,
  18089. n.prototype.onTileRendered = function(e, t, i, n) {}
  18090. ,
  18091. n.prototype.addModel = function(e) {
  18092. this.modelMap[e.sid] = e,
  18093. 0 === this.modelCount && this.activateModel(e.sid),
  18094. this.modelCount++,
  18095. this.emit(a.ModelAdded)
  18096. }
  18097. ,
  18098. n.prototype.getModel = function(e) {
  18099. return this.modelMap[e]
  18100. }
  18101. ,
  18102. n.prototype.activateModel = function(e) {
  18103. var t = this.modelMap[e];
  18104. if (!t)
  18105. throw new o("Tried to activate invalid model!");
  18106. var i = this.activeModel;
  18107. this.activeModel = t,
  18108. this.tileDownloader.setPanoData(t.panos, t.listImagePanos(), t.sid),
  18109. this.tileDownloader.setUrls(t.urls),
  18110. t.panos.forEach(function(e) {
  18111. e.attachToPanoRenderer(this.panoRenderer),
  18112. e.tileDownloader = this.tileDownloader,
  18113. e.qualityManager = this.qualityManager
  18114. }
  18115. .bind(this)),
  18116. this.emit(a.ActiveModelChanged, {
  18117. oldModel: i,
  18118. model: t
  18119. })
  18120. }
  18121. ,
  18122. n.prototype.getActiveModel = function() {
  18123. return this.activeModel
  18124. }
  18125. ,
  18126. r.extend(n, l),
  18127. t.exports = n
  18128. }
  18129. , {
  18130. "../enum/ModelManagerEvents": 33,
  18131. "../enum/PanoRendererEvents": 35,
  18132. "../exception/BasicException": 55,
  18133. "../util/common": 185,
  18134. events: 202,
  18135. three: 217
  18136. }],
  18137. 141: [function(e, t, i) {
  18138. (function(i) {
  18139. "use strict";
  18140. function n() {
  18141. s.call(this)
  18142. }
  18143. var r = e("../objects/Room")
  18144. , o = (e("../settings"),
  18145. e("../util/logger"))
  18146. , a = (e("../util/transitions"),
  18147. e("../util/easing"),
  18148. e("../util/common"))
  18149. , s = e("../util/IndexedCollection")
  18150. , l = e("./Chunks");
  18151. new o(i);
  18152. a.inherit(n, s),
  18153. n.prototype.getIndex = function(e) {
  18154. return e.roomId
  18155. }
  18156. ,
  18157. n.prototype.calcRoomBoundaries = function() {
  18158. this.forEach(function(e) {
  18159. e.calcBoundaries()
  18160. })
  18161. }
  18162. ,
  18163. n.prototype.createFromChunks = function(e) {
  18164. var t = {
  18165. floorId: -1,
  18166. roomId: -1
  18167. }
  18168. , i = {};
  18169. e.forEach(function(e) {
  18170. l.parseIdsFromChunkName(e.name, t);
  18171. var o = i[t.roomId];
  18172. if (!o) {
  18173. var a = n.generateRoomId(t.floorId, t.roomId);
  18174. o = new r(t.floorId,a),
  18175. this.add(o),
  18176. i[t.roomId] = o
  18177. }
  18178. o.addChunk(e)
  18179. }
  18180. .bind(this)),
  18181. this.calcRoomBoundaries()
  18182. }
  18183. ,
  18184. n.generateRoomId = function(e, t) {
  18185. return e + "_" + t
  18186. }
  18187. ,
  18188. t.exports = n
  18189. }
  18190. ).call(this, "/js/model/RoomCollection.js")
  18191. }
  18192. , {
  18193. "../objects/Room": 150,
  18194. "../settings": 166,
  18195. "../util/IndexedCollection": 175,
  18196. "../util/common": 185,
  18197. "../util/easing": 186,
  18198. "../util/logger": 189,
  18199. "../util/transitions": 195,
  18200. "./Chunks": 135
  18201. }],
  18202. 142: [function(e, t, i) {
  18203. "use strict";
  18204. function n(e, t, i) {
  18205. e = e.clone().expandByScalar(0.01);//改
  18206. var n = e.size()
  18207. , o = new r.BoxGeometry(n.x,n.y,n.z);
  18208. o.boundingBox = e,
  18209. r.Mesh.call(this, o, t),
  18210. this.position.copy(e.center()),
  18211. this.frustumCulled = !1,
  18212. i && this.add(new r.WireframeHelper(this))
  18213. }
  18214. var r = e("three");
  18215. n.prototype = Object.create(r.Mesh.prototype),
  18216. n.prototype.constructor = n,
  18217. t.exports = n
  18218. }
  18219. , {
  18220. three: 217
  18221. }],
  18222. 143: [function(e, t, i) {
  18223. (function(i) {
  18224. "use strict";
  18225. function n(e) {
  18226. h.time("Computing a nice bounding cubemap");
  18227. var t = new a({
  18228. side: r.BackSide,
  18229. transparent: !0
  18230. });
  18231. t.uniforms.modelAlpha.value = 0,
  18232. t.uniforms.opacity.value = 1 - s.modelAlpha,
  18233. this.renderOrder = l.boundingSkybox,
  18234. o.call(this, e, t),
  18235. h.timeEnd("Computing a nice bounding cubemap")
  18236. }
  18237. var r = e("three")
  18238. , o = (e("../enum/Viewmode"),
  18239. e("../shaders"),
  18240. e("./BoundingMesh"))
  18241. , a = e("../materials/ModelTextureMaterial")
  18242. , s = e("../settings")
  18243. , l = e("../enum/RenderOrder")
  18244. , c = e("../util/logger")
  18245. , h = new c(i);
  18246. n.prototype = Object.create(o.prototype),
  18247. n.prototype.constructor = n,
  18248. t.exports = n
  18249. }
  18250. ).call(this, "/js/objects/BoundingTextureSkybox.js")
  18251. }
  18252. , {
  18253. "../enum/RenderOrder": 42,
  18254. "../enum/Viewmode": 51,
  18255. "../materials/ModelTextureMaterial": 118,
  18256. "../settings": 166,
  18257. "../shaders": 167,
  18258. "../util/logger": 189,
  18259. "./BoundingMesh": 142,
  18260. three: 217
  18261. }],
  18262. 144: [function(e, t, i) {
  18263. "use strict";
  18264. function n(e) {
  18265. this.materialInside = new s({
  18266. side: r.DoubleSide
  18267. });
  18268. var t = r.UniformsUtils.clone(o.modelOutside.uniforms);
  18269. this.materialOutside = new r.RawShaderMaterial({
  18270. fragmentShader: o.modelOutside.fragmentShader,
  18271. vertexShader: o.modelOutside.vertexShader,
  18272. uniforms: t,
  18273. side: r.FrontSide,
  18274. name: "chunkOut"
  18275. }),
  18276. r.Mesh.call(this, e.geometry, this.materialInside),
  18277. this.name = e.name || "",
  18278. this.textureName = e.textureName,
  18279. this.meshUrl = e.meshUrl
  18280. }
  18281. var r = e("three")
  18282. , o = e("../shaders")
  18283. , a = e("../enum/Viewmode")
  18284. , s = e("../materials/ModelTextureMaterial");
  18285. n.prototype = Object.create(r.Mesh.prototype),
  18286. n.prototype.setTextureMap = function(e) {
  18287. this.materialInside.uniforms.map.value = e,
  18288. this.materialOutside.uniforms.map.value = e
  18289. }
  18290. ,
  18291. n.prototype.setMode = function(e) {
  18292. var t = e === a.DOLLHOUSE || e === a.FLOORPLAN ? this.materialOutside : this.materialInside;
  18293. t.side = e === a.PANORAMA ? r.DoubleSide : r.FrontSide,
  18294. t.transparent = this.material.transparent,
  18295. t.uniforms.opacity.value = this.material.uniforms.opacity.value,
  18296. this.material = t
  18297. }
  18298. ,
  18299. t.exports = n
  18300. }
  18301. , {
  18302. "../enum/Viewmode": 51,
  18303. "../materials/ModelTextureMaterial": 118,
  18304. "../shaders": 167,
  18305. three: 217
  18306. }],
  18307. 145: [function(e, t, i) {
  18308. "use strict";
  18309. function n(e) {
  18310. this.chunksize = e || 10,
  18311. this.chunks = {},
  18312. this.boundingBoxes = {},
  18313. this.children = [],
  18314. this.offset = new r.Vector3(0,.5,0),
  18315. this.material = new r.MeshBasicMaterial({
  18316. color: 16777215 * Math.random(),
  18317. side: r.DoubleSide
  18318. })
  18319. }
  18320. var r = e("three");
  18321. e("../enum/Viewmode");
  18322. n.prototype.add = function(e) {
  18323. var t, i, n, o, a, s, l, c, h, u, d, p, f, g, m = e.attributes;
  18324. m ? (t = m.position.array,
  18325. i = void 0 !== e.index ? e.index.array : void 0) : (t = e.vertices,
  18326. n = e.faces);
  18327. var v = new r.Vector3;
  18328. if (i)
  18329. for (o = 0,
  18330. a = i.length; o < a; o += 3) {
  18331. var A = 3 * i[o]
  18332. , y = 3 * i[o + 1]
  18333. , C = 3 * i[o + 2];
  18334. s = (t[A] + t[y] + t[C]) / 3,
  18335. l = (t[A + 1] + t[y + 1] + t[C + 1]) / 3,
  18336. c = (t[A + 2] + t[y + 2] + t[C + 2]) / 3,
  18337. h = Math.floor(s / this.chunksize),
  18338. u = Math.floor(l / this.chunksize),
  18339. d = Math.floor(c / this.chunksize),
  18340. p = h + "." + u + "." + d,
  18341. p in this.chunks ? (g = this.chunks[p],
  18342. f = this.boundingBoxes[p]) : (g = this.chunks[p] = [],
  18343. f = this.boundingBoxes[p] = new r.Box3),
  18344. 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]),
  18345. f.expandByPoint(v.set(t[A], t[A + 1], t[A + 2])),
  18346. f.expandByPoint(v.set(t[y], t[y + 1], t[y + 2])),
  18347. f.expandByPoint(v.set(t[C], t[C + 1], t[C + 2]))
  18348. }
  18349. else
  18350. for (o = 0,
  18351. a = t.length; o < a; o += 9)
  18352. s = (t[o] + t[o + 3] + t[o + 6]) / 3,
  18353. l = (t[o + 1] + t[o + 4] + t[o + 7]) / 3,
  18354. c = (t[o + 2] + t[o + 5] + t[o + 8]) / 3,
  18355. h = Math.floor(s / this.chunksize),
  18356. u = Math.floor(l / this.chunksize),
  18357. d = Math.floor(c / this.chunksize),
  18358. p = h + "." + u + "." + d,
  18359. p in this.chunks ? (g = this.chunks[p],
  18360. f = this.boundingBoxes[p]) : (g = this.chunks[p] = [],
  18361. f = this.boundingBoxes[p] = new r.Box3),
  18362. 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]),
  18363. f.expandByPoint(v.set(t[o], t[o + 1], t[o + 2])),
  18364. f.expandByPoint(v.set(t[o + 3], t[o + 4], t[o + 5])),
  18365. f.expandByPoint(v.set(t[o + 6], t[o + 7], t[o + 8]))
  18366. }
  18367. ,
  18368. n.prototype.build = function() {
  18369. var e = new r.Object3D;
  18370. e.material = this.material;
  18371. for (var t in this.chunks) {
  18372. var i = this.chunks[t]
  18373. , n = new r.BufferGeometry;
  18374. n.addAttribute("position", new r.BufferAttribute(new Float32Array(i),3)),
  18375. n.boundingBox = this.boundingBoxes[t];
  18376. var o = new r.Mesh(n,this.material);
  18377. o.material.visible = !1,
  18378. e.add(o),
  18379. this.chunks[t] = []
  18380. }
  18381. return e
  18382. }
  18383. ,
  18384. t.exports = n
  18385. }
  18386. , {
  18387. "../enum/Viewmode": 51,
  18388. three: 217
  18389. }],
  18390. 146: [function(e, t, i) {
  18391. "use strict";
  18392. var r = e("three")
  18393. , o = e("../settings")
  18394. , a = e("../util/common")
  18395. , s = e("../util/lerp")
  18396. , l = e("./ChunkedCollider")
  18397. , c = e("../util/transitions")
  18398. , h = e("../util/easing")
  18399. , u = (e("../objects/Panorama"),
  18400. e("../enum/RenderOrder"))
  18401. , d = e("../localization/localize");
  18402. function n(e, t, i) {
  18403. r.Object3D.call(this),
  18404. this.model = e,
  18405. this.floorIndex = t,
  18406. this.lang = o.languageTag,
  18407. this.name = i || o.languageTag === "cn" ? "Floor " + (t + 1) + "" : "第" + (t + 1) + "层",
  18408. this.panos = [],
  18409. this.chunks = [],
  18410. this.colliderBuilder = new l(3),
  18411. this.collider = null,
  18412. this.center = null,
  18413. this.boundingBox = new r.Box3,
  18414. this.size = null,
  18415. this.hidden = !1,
  18416. this.conservativeBoundingBox = new r.Box3,
  18417. this.debugColor = 16777215 * Math.random(),
  18418. this.transition = null
  18419. }
  18420. n.prototype = Object.create(r.Object3D.prototype),
  18421. n.prototype.enter = function(e) {
  18422. this.model.setFloor(this, e)
  18423. }
  18424. ,
  18425. n.prototype.hide = function(e) {
  18426. if (!this.hidden || this.transition) {
  18427. this.chunks.forEach(function(e) {
  18428. e.material.transparent = !0
  18429. }),
  18430. c.cancel(this.transition);
  18431. var t = e ? 0 : o.hideFloorDuration + o.hideFloorDelay
  18432. , i = e ? 0 : o.hideFloorDelay / t;
  18433. this.transition = c.start(s.allUniforms(this.chunks, "opacity", .08), t, function() {
  18434. this.hidden = !0
  18435. }
  18436. .bind(this), i, h.easeInOutQuad)
  18437. }
  18438. }
  18439. ,
  18440. n.prototype.show = function(e) {
  18441. if (this.hidden || this.transition) {
  18442. this.hidden = !1,
  18443. c.cancel(this.transition);
  18444. var t = e ? o.showFloorDuration : o.showFloorDuration + o.showFloorDelay
  18445. , i = e ? 0 : o.showFloorDelay / t;
  18446. this.transition = c.start(s.allUniforms(this.chunks, "opacity", 1), t, function() {
  18447. this.hidden || this.chunks.forEach(function(e) {
  18448. e.material.transparent = !1
  18449. })
  18450. }
  18451. .bind(this), i, h.easeInOutQuad)
  18452. }
  18453. }
  18454. ,
  18455. n.prototype.toggle = function(e, t) {
  18456. e = void 0 === e ? this.hidden : e,
  18457. e ? this.show(t) : this.hide(t)
  18458. }
  18459. ,
  18460. n.prototype.containsPoint = function(e) {
  18461. return this.collider.children.some(function(t) {
  18462. return t.geometry.boundingBox || t.geometry.computeBoundingBox(),
  18463. t.geometry.boundingBox.containsPoint(e)
  18464. })
  18465. }
  18466. ,
  18467. n.prototype.distanceToPoint = function(e) {
  18468. var t = null
  18469. , i = 1 / 0;
  18470. return this.collider.children.forEach(function(n) {
  18471. n.geometry.boundingBox || n.geometry.computeBoundingBox();
  18472. var r = n.geometry.boundingBox.distanceToPoint(e);
  18473. (!t || i > r) && (i = r,
  18474. t = n)
  18475. }),
  18476. i
  18477. }
  18478. ,
  18479. n.prototype.addChunk = function(e) {
  18480. e.renderOrder = u.ghostFloor,
  18481. this.add(e),
  18482. this.chunks.push(e),
  18483. this.boundingBox.union(e.geometry.boundingBox),
  18484. this.size = this.boundingBox.size(),
  18485. this.colliderBuilder.add(e.geometry)
  18486. }
  18487. ,
  18488. n.prototype.addPano = function(e) {
  18489. this.panos.push(e),
  18490. this.add(e.skyboxMesh),
  18491. e.marker && this.add(e.marker);
  18492. var t = new r.Vector3(1,1,1)
  18493. , i = (new r.Box3).setFromCenterAndSize(e.position, t);
  18494. this.boundingBox.union(i)
  18495. }
  18496. ,
  18497. n.prototype.build = function() {
  18498. this.collider = this.colliderBuilder.build(!0),
  18499. this.add(this.collider),
  18500. this.center = this.boundingBox.center(),
  18501. this.conservativeBoundingBox.copy(this.boundingBox),
  18502. this.conservativeBoundingBox.min.y = a.lowerMedian(this.collider.children.map(function(e) {
  18503. return e.geometry.boundingBox.min.y
  18504. }), 5),
  18505. this.conservativeBoundingBox.max.y = a.lowerMedian(this.collider.children.map(function(e) {
  18506. return e.geometry.boundingBox.max.y
  18507. }), 5),
  18508. this.colliderBuilder = null
  18509. }
  18510. ,
  18511. n.prototype.toShortString = function() {
  18512. return a.nth(this.floorIndex + 1)
  18513. }
  18514. ,
  18515. n.prototype.toString = function() {
  18516. return this.name
  18517. }
  18518. ,
  18519. t.exports = n
  18520. }
  18521. , {
  18522. "../enum/RenderOrder": 42,
  18523. "../localization/localize": 108,
  18524. "./strings-cn-CN": 109,
  18525. "../objects/Panorama": 148,
  18526. "../settings": 166,
  18527. "../util/common": 185,
  18528. "../util/easing": 186,
  18529. "../util/lerp": 188,
  18530. "../util/transitions": 195,
  18531. "./ChunkedCollider": 145,
  18532. three: 217
  18533. }],
  18534. 147: [function(e, t, i) {
  18535. "use strict";
  18536. function n(e) {
  18537. this.player = e,
  18538. this.obj3d = null,
  18539. this.UP = new r.Vector3(0,1,0)
  18540. }
  18541. var r = e("three")
  18542. , o = e("../settings");
  18543. n.prototype.prefs = {
  18544. linewidth: 3,
  18545. height: .07,
  18546. opacity: .45,
  18547. endScale: .05
  18548. },
  18549. n.prototype.discard = function() {
  18550. if (this.obj3d) {
  18551. var e = this.obj3d.parent;
  18552. e && e.remove(this.obj3d)
  18553. }
  18554. this.obj3d = null
  18555. }
  18556. ,
  18557. n.prototype.draw = function() {
  18558. if (this.discard(),
  18559. o.showNeighbors) {
  18560. var e = this.player.currentPano.floor;
  18561. this.obj3d = new r.Object3D;
  18562. var t = this.player.model.panos.getNeighbours(this.player.currentPano)
  18563. , i = this.player.currentPano.floorPosition.clone().sub(this.player.model.position);
  18564. i.y += this.prefs.height;
  18565. var n = .1525
  18566. , a = .127
  18567. , s = .0127
  18568. , l = .1
  18569. , c = .19
  18570. , h = .2032
  18571. , u = .2286
  18572. , d = .255
  18573. , p = new r.Matrix4;
  18574. for (var f in t)
  18575. if (t[f]) {
  18576. var g = this.player.model.panos.get(f)
  18577. , m = (g.position.clone().sub(this.player.model.position),
  18578. g.position.clone().sub(g.floorPosition))
  18579. , v = g.floorPosition.clone().sub(this.player.model.position);
  18580. v.y += this.prefs.height;
  18581. var A = new r.Geometry;
  18582. 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)),
  18583. 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)),
  18584. p.identity().setPosition(m),
  18585. A.applyMatrix(p),
  18586. A.vertices.push(new r.Vector3(0,-this.prefs.endScale,0)),
  18587. 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)),
  18588. p.lookAt(v, i, this.UP).setPosition(v),
  18589. A.applyMatrix(p),
  18590. A.vertices.push(v, i);
  18591. var y = new r.Line(A,new r.LineBasicMaterial({
  18592. color: g.debugColor.getHex(),
  18593. transparent: !0,
  18594. opacity: this.prefs.opacity,
  18595. depthWrite: !1,
  18596. name: "sLine" + f,
  18597. linewidth: this.prefs.linewidth
  18598. }));
  18599. this.obj3d.add(y)
  18600. }
  18601. e.add(this.obj3d)
  18602. }
  18603. }
  18604. ,
  18605. n.prototype.update = function() {
  18606. o.showNeighbors && this.obj3d && this.obj3d.updateMatrixWorld()
  18607. }
  18608. ,
  18609. t.exports = n
  18610. }
  18611. , {
  18612. "../settings": 166,
  18613. three: 217
  18614. }],
  18615. 148: [function(e, t, i) {
  18616. (function(i) {
  18617. "use strict";
  18618. function n(e, t, i, n) {
  18619. this.model = e,
  18620. this.id = t,
  18621. this.alignmentType = i.alignmentType || l.ALIGNED,
  18622. this.neighbourUUIDs = i.neighbours || null,
  18623. this.neighbourPanos = null,
  18624. this.floor = null,
  18625. this.floorIndex = i.floor,
  18626. this.failedLoadingAt = 0,
  18627. this.maxLoadRetries = 4,
  18628. this.origin = i.position.clone(),
  18629. this.position = this.alignmentType === l.UNALIGNED ? new r.Vector3(0,-5,0) : i.position.clone(),
  18630. this.quaternion = i.quaternion.clone(),
  18631. this.skyboxMesh = new r.Mesh(E),
  18632. this.skyboxMesh.position.copy(this.position),
  18633. this.skyboxMesh.quaternion.copy(this.quaternion),
  18634. this.skyboxMesh.name = "skybox",
  18635. this.skyboxMesh.visible = !1,
  18636. this.skyboxMesh.updateMatrix(),
  18637. this.skyboxMesh.updateMatrixWorld(),
  18638. this.marker = null,
  18639. this.showFloorMarker = !window.MP_PREFETCHED_MODELDATA.hideFloorMarker;
  18640. this.isAligned() && (this.marker = new r.Mesh(b,new r.MeshBasicMaterial({
  18641. map: w,
  18642. side: r.DoubleSide,
  18643. opacity: 0,
  18644. transparent: !0,
  18645. depthWrite: !1
  18646. })),
  18647. this.marker.visible = this.showFloorMarker,
  18648. this.marker.renderOrder = s.panoMarker,
  18649. this.marker.name = "marker",
  18650. this.marker.pano = this,
  18651. this.marker.layers.set(v.PANOMARKERS),
  18652. this.marker.updateMatrixWorld(),
  18653. a.colorMarkerOnLoad && this.on("load", function() {
  18654. this.marker.material.color.set(65280)
  18655. })),
  18656. this.debugColor = (new r.Color).setHSL(.06 + .53 * Math.random(), .8 + .2 * Math.random(), .5 + .2 * Math.random()),
  18657. this.floorPosition = i.puck ? i.puck.clone() : null,
  18658. this.tiled = n,
  18659. this.tiled ? this.solidSkybox = null : (this.solidSkybox = new r.Texture([null, null, null, null, null, null]),
  18660. this.solidSkybox.flipY = !1,
  18661. a.minimalMemoryMode && (this.solidSkybox.minFilter = r.LinearFilter,
  18662. this.solidSkybox.magFilter = r.LinearFilter,
  18663. this.solidSkybox.generateMipmaps = !1)),
  18664. this.zoomed = !1,
  18665. this.panoRenderer = null,
  18666. this.qualityManager = null,
  18667. this.tileDownloader = null,
  18668. this.tiledPanoRenderTarget = null,
  18669. this.minimumTiledPanoLoaded = !1,
  18670. this.highestPartialTileRenderOpCompleted = 0,
  18671. this.highestFullTileRenderOpCompleted = 0,
  18672. this.shouldRedrawOnBaseLoaded = !1,
  18673. this.lockUntilRenderingComplete = !1,
  18674. a.colorMarkerOnLoad && this.on("load", function() {
  18675. this.marker.material.color.set(65280)
  18676. });
  18677. /********************************************************************fyz改vr from徐世廷*************************************************************/
  18678. var e = new r.TextureLoader;
  18679. e.setCrossOrigin(!0);
  18680. var g = e.load("images/texture.jpg");
  18681. if (this.vrMarker = new r.Mesh(new r.OctahedronGeometry(.1,0),new r.MeshLambertMaterial({
  18682. color: 16777215,
  18683. transparent: !0,
  18684. opacity: .75,
  18685. map: g
  18686. })),
  18687. this.vrMarker.boluoType = "vr",
  18688. this.vrMarker.position.z = 1,
  18689. this.vrMarker.enabled = !0,
  18690. this.vrMarker.visible = !1,
  18691. window.vrMarkers = window.vrMarkers || [],
  18692. window.vrMarkers.push(this.vrMarker),
  18693. this.marker && this.marker.add(this.vrMarker),
  18694. a.showAxis && (this.skyboxMesh.add(new r.ArrowHelper(new r.Vector3(0,1,0),new r.Vector3(0,0,0),1,255)),
  18695. this.skyboxMesh.add(new r.ArrowHelper(new r.Vector3(0,0,1),new r.Vector3(0,0,0),1,16711680)),
  18696. this.skyboxMesh.add(new r.ArrowHelper(new r.Vector3(1,0,0),new r.Vector3(0,0,0),1,65280))),
  18697. this.adjustAngleEnable) {
  18698. var i = new r.Quaternion;
  18699. i.setFromAxisAngle(new r.Vector3(1,0,0), this.adjustAngleX),
  18700. this.skyboxMesh.quaternion.multiply(i);
  18701. var m = new r.Quaternion;
  18702. m.setFromAxisAngle(new r.Vector3(0,1,0), this.adjustAngleY),
  18703. this.skyboxMesh.quaternion.multiply(m);
  18704. var n = new r.Quaternion;
  18705. n.setFromAxisAngle(new r.Vector3(0,0,1), this.adjustAngleZ),
  18706. this.skyboxMesh.quaternion.multiply(n),
  18707. this.skyboxMesh.updateMatrix(),
  18708. this.skyboxMesh.updateMatrixWorld(),
  18709. this.model.updateProjectedPanos()
  18710. }
  18711. /**************************************************************************************************************************************/
  18712. }
  18713. var r = e("three")
  18714. , o = e("../util/logger")
  18715. , a = e("../settings")
  18716. , s = (e("../enum/Viewmode"),
  18717. e("../enum/RenderOrder"))
  18718. , l = e("../enum/AlignmentType")
  18719. , c = (e("../util/common"),
  18720. e("../util/transitions"))
  18721. , h = e("../util/lerp")
  18722. , u = e("../util/ajax")
  18723. , d = e("../util/texture")
  18724. , p = e("../util/panorama")
  18725. , f = (e("../enum/TileDownloaderEvents"),
  18726. e("../enum/PanoramaEvents"))
  18727. , g = e("../enum/PanoRendererEvents")
  18728. , m = e("../enum/PanoSizeClass")
  18729. , v = e("../enum/RenderLayers")
  18730. , A = (e("../scene/SceneRenderer"),
  18731. e("../enum/GLCubeFaces"),
  18732. e("../exception/BasicException"))
  18733. , y = e("../tile/TileUtils")
  18734. , C = e("events").EventEmitter
  18735. , I = new o(i)
  18736. , E = new r.SphereBufferGeometry(.1)
  18737. , b = new r.PlaneBufferGeometry(.4,.4,1,1)
  18738. , w = d.load("images/marker-256x256.png");
  18739. n.prototype = Object.create(C.prototype),
  18740. n.prototype.enter = function() {
  18741. var e = null;
  18742. return function() {
  18743. this.setZoomed(!1),
  18744. this.emit("enter", {
  18745. oldPano: e,
  18746. newPano: this
  18747. }),
  18748. e = this
  18749. }
  18750. }(),
  18751. n.prototype.exit = function() {
  18752. this.tiled ? (this.clearWaitDeferreds(),
  18753. this.minimumTiledPanoLoaded = !1,
  18754. this.tiledPanoRenderTarget = null,
  18755. this.setZoomed(!1),
  18756. this.panoRenderer.deactivateTiledPano(this),
  18757. this.highestPartialTileRenderOpCompleted = 0,
  18758. this.highestFullTileRenderOpCompleted = 0) : (this.solidSkybox.dispose(),
  18759. this.solidSkybox.loaded = !1,
  18760. this.solidSkybox.version = 0),
  18761. this.emit("exit")
  18762. }
  18763. ,
  18764. n.prototype.hoverOn = function(e) {
  18765. this.marker && (c.start(h.property(this.marker.material, "opacity", a[e].markerOpacityOnHover), 250),
  18766. a.navigation.panoScores & a.navigation.mouseDirection && this.addTextSprite("HIT", 12525854))
  18767. }
  18768. ,
  18769. n.prototype.hoverOff = function(e) {
  18770. this.marker && c.start(h.property(this.marker.material, "opacity", a[e].markerOpacity), 250)
  18771. }
  18772. ,
  18773. n.prototype.build1 = function() {
  18774. this.floor = this.floor || this.model.floors.get(this.floorIndex) || this.raycastToFindFloor() || this.model.getFloorAtPoint(this.position),
  18775. this.floor.addPano(this),
  18776. this.floorPosition = this.floorPosition || this.raycastFloorPosition(),
  18777. this.neighbourPanos = this.neighbourPanos || this.findNeighourPanos(),
  18778. a.colorMarkerByFloor && this.marker && this.marker.material.color.set(this.floor.debugColor)
  18779. }
  18780. ,
  18781. n.prototype.build2 = function() {
  18782. this.floorPosition = this.floorPosition || this.interpolateFloorPosition(),
  18783. this.height = this.position.distanceTo(this.floorPosition),
  18784. this.placeMarker()
  18785. }
  18786. ,
  18787. n.prototype.interpolateFloorPosition = function() {
  18788. var e = this.model.panos.filter(n.filters.isNeighbourPanoTo(this)).filter(function(e) {
  18789. return !!e.floorPosition
  18790. }).sort(function(e, t) {
  18791. return e.position.distanceTo(this.position) - t.position.distanceTo(this.position)
  18792. }
  18793. .bind(this))
  18794. , t = this.position.clone();
  18795. return e.length >= 2 ? t.y = (e[0].floorPosition.y + e[1].floorPosition.y) / 2 : t.add(a.noMeshFloorPositionOffset),
  18796. t
  18797. }
  18798. ,
  18799. n.prototype.raycastFloorPosition = function() {
  18800. I.warn("Performance warning: Raycasting to find floor position");
  18801. var e = new r.Raycaster(this.position,new r.Vector3(0,-1,0))
  18802. , t = e.intersectObjects(this.model.colliders);
  18803. return t.length ? t[0].point : null
  18804. }
  18805. ,
  18806. n.prototype.raycastToFindFloor = function() {
  18807. 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)];
  18808. return function() {
  18809. I.warn("Performance warning: Raycasting to find floor index");
  18810. for (var t = 0; t < e.length; t++) {
  18811. var i = new r.Raycaster(this.position.clone(),e[t].clone())
  18812. , n = i.intersectObjects(this.model.colliders);
  18813. if (n.length)
  18814. return n[0].object.parent.parent
  18815. }
  18816. return null
  18817. }
  18818. }(),
  18819. n.prototype.placeMarker = function() {
  18820. this.marker && (this.marker.position.copy(this.floorPosition),
  18821. this.marker.position.y += .05,
  18822. this.marker.lookAt(new r.Vector3(0,1,0).add(this.marker.position)))
  18823. }
  18824. ,
  18825. n.prototype.translate = function(e) {
  18826. this.position.add(e),
  18827. this.floorPosition.add(e)
  18828. }
  18829. ,
  18830. n.prototype.findClosestMidtpointPanoTo = function(e) {
  18831. (new r.Vector3).addVectors(this.position, e.position).divideScalar(2);
  18832. return this.model.panos.find([n.filters.notIn([this, e])], [n.sortFunctions.distanceToPoint(point)])
  18833. }
  18834. ,
  18835. n.prototype.attachToPanoRenderer = function(e) {
  18836. this.panoRenderer = e,
  18837. this.panoRenderer.on(g.TileRenderSuccess, this.onTileRendered.bind(this)),
  18838. this.panoRenderer.on(g.PanoRenderComplete, this.onPanoRendered.bind(this)),
  18839. this.panoRenderer.on(g.TileRenderFailure, this.onTileRenderFail.bind(this)),
  18840. this.panoRenderer.on(g.UploadAttemptedForAllTiles, this.onUploadAttemptedForAllTiles.bind(this))
  18841. }
  18842. ;
  18843. var _ = {};
  18844. n.prototype.getWaitDeferred = function(e) {
  18845. var t = _[this.id];
  18846. t || (t = {},
  18847. _[this.id] = t);
  18848. var i = t[e];
  18849. return i || (i = {
  18850. deferred: $.Deferred(),
  18851. active: !1
  18852. },
  18853. t[e] = i),
  18854. i
  18855. }
  18856. ,
  18857. n.prototype.resetWaitDeferred = function(e) {
  18858. var t = this.getWaitDeferred(e);
  18859. t.active = !1,
  18860. t.deferred = $.Deferred()
  18861. }
  18862. ,
  18863. n.prototype.clearWaitDeferreds = function() {
  18864. var e = _[this.id];
  18865. e || (e = {},
  18866. _[this.id] = e);
  18867. for (var t in e)
  18868. if (e.hasOwnProperty(t)) {
  18869. var i = e[t];
  18870. i.active = !1,
  18871. i.deferred = $.Deferred()
  18872. }
  18873. }
  18874. ,
  18875. n.prototype.loadTiledPano = function() {
  18876. var e = (new r.Vector3,
  18877. [])
  18878. , t = [];
  18879. return function(i, n, r, o, a, s) {
  18880. null !== o && void 0 !== o || (o = !0),
  18881. null !== a && void 0 !== a || (a = !0);
  18882. var l = this.getWaitDeferred(i)
  18883. , c = l.deferred
  18884. , h = null
  18885. , u = null;
  18886. if (r && ("number" == typeof r ? h = r : (h = r.hFov,
  18887. u = r.vFov)),
  18888. !this.isLoaded(i)) {
  18889. if (!l.active) {
  18890. if (l.active = !0,
  18891. r) {
  18892. var d = y.matchingTilesInDirection(this, i, n, h, u);
  18893. e[this.id + ":" + i] = {
  18894. tileCount: 0,
  18895. targetTileCount: d
  18896. },
  18897. I.info("Loading partial pano: " + this.id + " with " + d + " tiles")
  18898. }
  18899. t[this.id] || (t[this.id] = !0,
  18900. this.on(f.LoadComplete, function(e, t) {
  18901. var i = this.getWaitDeferred(e).deferred;
  18902. i && "pending" === i.state() && this.highestPartialTileRenderOpCompleted >= e && (i.resolve(e, t),
  18903. this.resetWaitDeferred(e))
  18904. }
  18905. .bind(this)),
  18906. this.on(f.LoadFailed, function(e) {
  18907. var t = this.getWaitDeferred(e).deferred;
  18908. t && "pending" === t.state() && this.highestPartialTileRenderOpCompleted >= e && (t.reject(e),
  18909. this.resetWaitDeferred(e))
  18910. }
  18911. .bind(this)),
  18912. this.on(f.TileLoaded, function(t, i, n) {
  18913. var r = this.getWaitDeferred(t).deferred;
  18914. if (r && "pending" === r.state()) {
  18915. r.notify(t, i, n);
  18916. var o = e[this.id + ":" + t];
  18917. o && (o.tileCount++,
  18918. o.tileCount === o.targetTileCount && (this.onPanoRendered(this.id, t, n, !0),
  18919. r.resolve(t, n),
  18920. this.resetWaitDeferred(t)))
  18921. }
  18922. }
  18923. .bind(this)))
  18924. }
  18925. this.tileDownloader.clearForceQueue(),
  18926. this.tileDownloader.forceQueueTilesForPano(this, i, n, h, u, s),
  18927. this.tiledPanoRenderTarget = this.panoRenderer.activateTiledPano(this, this.qualityManager.getMaxNavPanoSize(), o),
  18928. this.panoRenderer.renderPanoTiles(this.id, n, a)
  18929. }
  18930. return c.promise()
  18931. }
  18932. }(),
  18933. n.prototype.onUploadAttemptedForAllTiles = function(e, t, i) {
  18934. if (e === this.id) {
  18935. var n = this.qualityManager.getPanoSize(m.BASE);
  18936. t === n && this.shouldRedrawOnBaseLoaded && (this.shouldRedrawOnBaseLoaded = !1,
  18937. this.panoRenderer.resetRenderStatus(this.id, !0, !1),
  18938. this.panoRenderer.renderPanoTiles(this.id, null, !0, !0))
  18939. }
  18940. }
  18941. ,
  18942. n.prototype.onTileRendered = function(e, t, i, n) {
  18943. e === this.id && this.emit(f.TileLoaded, t, i, n)
  18944. }
  18945. ,
  18946. n.prototype.onPanoRendered = function(e, t, i, n) {
  18947. e === this.id && (this.minimumTiledPanoLoaded = !0,
  18948. this.updateSkyboxForZoomLevel(),
  18949. t > this.highestPartialTileRenderOpCompleted && (this.highestPartialTileRenderOpCompleted = t),
  18950. !n && t > this.highestFullTileRenderOpCompleted && (this.highestFullTileRenderOpCompleted = t),
  18951. this.emit("load", t),
  18952. this.model.emit("load", this),
  18953. this.emit(f.LoadComplete, t, i))
  18954. }
  18955. ,
  18956. n.prototype.setZoomed = function(e) {
  18957. this.zoomed = e,
  18958. this.updateSkyboxForZoomLevel()
  18959. }
  18960. ,
  18961. n.prototype.ensureSkyboxReadyForRender = function() {
  18962. this.tiled || (this.solidSkybox.loaded || (this.solidSkybox.needsUpdate = !0),
  18963. this.solidSkybox.loaded = !0)
  18964. }
  18965. ,
  18966. n.prototype.updateSkyboxForZoomLevel = function() {
  18967. this.minimumTiledPanoLoaded && this.model.updateProjectedPanos()
  18968. }
  18969. ,
  18970. n.prototype.getSkyboxTexture = function() {
  18971. return this.tiled ? this.minimumTiledPanoLoaded ? this.zoomed ? this.panoRenderer.zoomRenderTarget.texture : this.tiledPanoRenderTarget.texture : null : this.solidSkybox
  18972. }
  18973. ,
  18974. n.prototype.onTileRenderFail = function(e, t, i) {
  18975. e === this.id && this.emit(f.LoadFailed, t)
  18976. }
  18977. ,
  18978. n.prototype.isLoaded = function(e) {
  18979. if (this.tiled) {
  18980. if (e && "string" == typeof e)
  18981. throw new A("Wrong panoSize given to Panorama.isLoaded(); a tiled pano uses PanoSizeClass");
  18982. return !!this.minimumTiledPanoLoaded && (!e || this.highestPartialTileRenderOpCompleted >= e)
  18983. }
  18984. if (e && "number" == typeof e)
  18985. throw new A("Wrong panoSize given to Panorama.isLoaded(); a non-tiled pano uses high/low.");
  18986. return !!this.solidSkybox.high || e in this.solidSkybox
  18987. }
  18988. ,
  18989. n.prototype.loadCube = function(e) {
  18990. if (this.isLoaded(e))
  18991. return I.info("Skipping load of pano, already loaded"),
  18992. $.when();
  18993. this.emit("loading", e),
  18994. this.model.emit("loading", this);
  18995. var t = p.getCubemapUrls(this.model.urls, this.id, e)
  18996. , i = t.filter(function(e) {
  18997. return !e
  18998. });
  18999. "low" === e && i.length > 0 && (I.info("Pano", this.id, "not available in low res, loading high res right away"),
  19000. e = "high",
  19001. t = p.getCubemapUrls(this.model.urls, this.id, e));
  19002. var n = 0
  19003. , r = [0, 1, 2, 3, 4, 5].map(function(e, i, n) {
  19004. return u.getImage(t[i])
  19005. }
  19006. .bind(this));
  19007. return $.when(r[0], r[1], r[2], r[3], r[4], r[5]).then(function(t, i, n, r, o, a) {
  19008. return this.solidSkybox[e] = [t, i, n, r, o, a],
  19009. "high" !== e && this.solidSkybox.high || (this.solidSkybox.image = this.solidSkybox[e],
  19010. this.solidSkybox.low = null),
  19011. this.solidSkybox.needsUpdate = !0,
  19012. this.emit("load", e),
  19013. this.model.emit("load", this),
  19014. this
  19015. }
  19016. .bind(this), function() {
  19017. I.error("Downloading cubemap for pano", this.id, "failed"),
  19018. this.failedLoadingAt = Date.now()
  19019. }
  19020. .bind(this), function() {
  19021. return $.when(++n, 6)
  19022. })
  19023. }
  19024. ,
  19025. n.raycastsSkipped = 0,
  19026. n.raycastsDone = 0,
  19027. n.prototype.findNeighourPanos = function() {
  19028. return this.model.panos.setNeighbour(this.id, this.id, !1),
  19029. this.model.panos.forEach(function(e) {
  19030. if (e !== this && (!this.model.panos.neighbourMap[this.id] || void 0 === this.model.panos.neighbourMap[this.id][e.id])) {
  19031. var t = this.position.distanceTo(e.position);
  19032. if (t > a.panoramaNeighbourMaxDistance)
  19033. return this.model.panos.setNeighbour(this, e, !1),
  19034. void n.raycastsSkipped++;
  19035. var i = e.position.clone().sub(this.position).normalize()
  19036. , o = new r.Raycaster(this.position,i.clone(),0,t)
  19037. , s = o.intersectObjects(this.model.colliders);
  19038. n.raycastsDone++,
  19039. this.model.panos.setNeighbour(this, e, 0 === s.length),
  19040. 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)))
  19041. }
  19042. }
  19043. .bind(this)),
  19044. this.model.panos.neighbourMap[this.id]
  19045. }
  19046. ,
  19047. n.prototype.worldPosition = function() {
  19048. return this.position
  19049. }
  19050. ,
  19051. n.prototype.addTextSprite = function(e, t) {
  19052. this.removeTextSprite();
  19053. var i = document.createElement("canvas")
  19054. , n = i.getContext("2d");
  19055. i.width = 256,
  19056. i.height = 256;
  19057. var o = "Arial"
  19058. , a = 60;
  19059. n.font = "bold " + a + "px " + o,
  19060. n.fillStyle = "white";
  19061. var s = n.measureText(e).width;
  19062. n.fillText(e, (i.width - s) / 2, (i.height + a) / 2);
  19063. var l = new r.Texture(i);
  19064. l.needsUpdate = !0;
  19065. var c = new r.SpriteMaterial({
  19066. map: l,
  19067. color: t || 16428055
  19068. });
  19069. this.text3d = new r.Sprite(c),
  19070. this.text3d.position.copy(this.skyboxMesh.position),
  19071. this.floor.add(this.text3d)
  19072. }
  19073. ,
  19074. n.prototype.removeTextSprite = function() {
  19075. this.text3d && (this.floor.remove(this.text3d),
  19076. this.text3d = null)
  19077. }
  19078. ,
  19079. n.prototype.isAligned = function() {
  19080. return this.alignmentType === l.ALIGNED
  19081. }
  19082. ,
  19083. n.filters = {
  19084. inDirection: function(e, t, i) {
  19085. return function(n) {
  19086. var r = n.position.clone().sub(e).normalize();
  19087. return r.dot(t) > i
  19088. }
  19089. },
  19090. inFloorDirection: function(e, t, i) {
  19091. return function(n) {
  19092. var r = n.floorPosition.clone().sub(e).normalize();
  19093. return r.dot(t) > i
  19094. }
  19095. },
  19096. inPanoDirection: function(e, t, i) {
  19097. return i = a.navigation.panoScores ? a.navigation.filterStrictness : i,
  19098. function(n) {
  19099. var r = n.floorPosition.clone().sub(e).normalize()
  19100. , o = n.position.clone().sub(e).normalize();
  19101. return r.dot(t) > i || o.dot(t) > i
  19102. }
  19103. },
  19104. atFloor: function(e) {
  19105. return function(t) {
  19106. return !e || t.floor === e
  19107. }
  19108. },
  19109. not: function(e) {
  19110. return function(t) {
  19111. return t !== e
  19112. }
  19113. },
  19114. notIn: function(e) {
  19115. return function(t) {
  19116. return e.indexOf(t) === -1
  19117. }
  19118. },
  19119. isLoaded: function() {
  19120. return function(e) {
  19121. return e.isLoaded()
  19122. }
  19123. },
  19124. isNotLoaded: function() {
  19125. return function(e) {
  19126. return !e.isLoaded()
  19127. }
  19128. },
  19129. isCloseEnoughTo: function(e, t) {
  19130. return function(i) {
  19131. return e.distanceTo(i.floorPosition) < t
  19132. }
  19133. },
  19134. hasMinimumHeightDifferenceTo: function(e, t) {
  19135. return function(i) {
  19136. return Math.abs(i.position.y - e.y) > t
  19137. }
  19138. },
  19139. isNotBehindNormal: function(e, t) {
  19140. var i = new r.Vector3;
  19141. return t = t.clone(),
  19142. function(n) {
  19143. var r = i.copy(n.position).sub(e).normalize();
  19144. return r.dot(t) > 0
  19145. }
  19146. },
  19147. isNeighbourPanoTo: function(e) {
  19148. return function(t) {
  19149. return !e || !e.neighbourPanos || !!e.neighbourPanos[t.id]
  19150. }
  19151. },
  19152. isNeighbourOfNeighbourTo: function(e) {
  19153. return function(t) {
  19154. return !!e.neighbourPanos[t.id] || e.neighbourUUIDs.some(function(i) {
  19155. var n = e.model.panos.get(i);
  19156. return !!n && n.neighbourPanos[t.id]
  19157. })
  19158. }
  19159. },
  19160. isNotRecentlyFailed: function(e) {
  19161. return function(t) {
  19162. return Date.now() - t.failedLoadingAt > e
  19163. }
  19164. },
  19165. isOnVisibleFloor: function() {
  19166. return function(e) {
  19167. return !e.floor.hidden
  19168. }
  19169. },
  19170. isPanoAligned: function() {
  19171. return function(e) {
  19172. return e.isAligned()
  19173. }
  19174. }
  19175. },
  19176. n.sortFunctions = {
  19177. distanceToPoint: function(e) {
  19178. return function(t, i) {
  19179. return t.position.distanceTo(e) - i.position.distanceTo(e)
  19180. }
  19181. },
  19182. floorDistanceToPoint: function(e) {
  19183. return function(t, i) {
  19184. return t.floorPosition.distanceTo(e) - i.floorPosition.distanceTo(e)
  19185. }
  19186. },
  19187. choose: function(e) {
  19188. return function(t, i) {
  19189. return e.id === t.id ? -1 : e.id === i.id ? 1 : 0
  19190. }
  19191. }
  19192. },
  19193. n.scoreFunctions = {
  19194. distance: function(e, t) {
  19195. return t = t || a.navigation.distanceFactor,
  19196. function(i) {
  19197. return e ? e.position.distanceTo(i.position) * t : 0
  19198. }
  19199. },
  19200. distanceSquared: function(e, t) {
  19201. return t = t || a.navigation.distanceFactor,
  19202. function(i) {
  19203. return e ? e.position.distanceToSquared(i.position) * t : 0
  19204. }
  19205. },
  19206. direction: function(e, t) {
  19207. return function(i) {
  19208. var n = i.position.clone().sub(e).normalize();
  19209. return n.dot(t) * a.navigation.directionFactor
  19210. }
  19211. },
  19212. angle: function(e, t) {
  19213. return function(i) {
  19214. var n = i.position.clone().sub(e).normalize();
  19215. return n.angleTo(t) * a.navigation.angleFactor
  19216. }
  19217. },
  19218. inFieldOfView: function(e, t) {
  19219. return function(i) {
  19220. var n = i.position.clone().sub(e).normalize();
  19221. return n.dot(t) > .75 ? 10 : -1
  19222. }
  19223. },
  19224. optionality: function(e) {
  19225. return function(t) {
  19226. var i = t.neighbourUUIDs.filter(function(t) {
  19227. return !(t in e.neighbourUUIDs) && t !== e.id
  19228. });
  19229. return i.length * a.navigation.optionalityFactor
  19230. }
  19231. },
  19232. penalizeHeightDifferenceUnder: function(e, t) {
  19233. return function(i) {
  19234. return e.y - i.position.y < t ? -20 : 0
  19235. }
  19236. }
  19237. },
  19238. t.exports = n
  19239. }
  19240. ).call(this, "/js/objects/Panorama.js")
  19241. }
  19242. , {
  19243. "../enum/AlignmentType": 17,
  19244. "../enum/GLCubeFaces": 25,
  19245. "../enum/PanoRendererEvents": 35,
  19246. "../enum/PanoSizeClass": 36,
  19247. "../enum/PanoramaEvents": 37,
  19248. "../enum/RenderLayers": 41,
  19249. "../enum/RenderOrder": 42,
  19250. "../enum/TileDownloaderEvents": 45,
  19251. "../enum/Viewmode": 51,
  19252. "../exception/BasicException": 55,
  19253. "../scene/SceneRenderer": 158,
  19254. "../settings": 166,
  19255. "../tile/TileUtils": 174,
  19256. "../util/ajax": 181,
  19257. "../util/common": 185,
  19258. "../util/lerp": 188,
  19259. "../util/logger": 189,
  19260. "../util/panorama": 191,
  19261. "../util/texture": 194,
  19262. "../util/transitions": 195,
  19263. events: 202,
  19264. three: 217
  19265. }],
  19266. 149: [function(e, t, i) {
  19267. "use strict";
  19268. function n(e) {
  19269. var t = r.UniformsUtils.clone(c.waypoint.uniforms);
  19270. t.map.value = d,
  19271. t.opacity.value = 0,
  19272. t.color.value.set(o.reticuleColor),
  19273. t.showMouseMarker = !window.MP_PREFETCHED_MODELDATA.hideMouseMarker;
  19274. r.Mesh.call(this, new r.PlaneBufferGeometry(.4,.4,1,1), new r.RawShaderMaterial({
  19275. side: r.DoubleSide,
  19276. depthWrite: !1,
  19277. depthTest: !1,
  19278. transparent: !0,
  19279. vertexShader: c.waypoint.vertexShader,
  19280. fragmentShader: c.waypoint.fragmentShader,
  19281. uniforms: t,
  19282. name: "waypoint",
  19283. opacity: 0,
  19284. visible: t.showMouseMarker // 显示/隐藏鼠标标志
  19285. })),
  19286. this.layers.set(h.RETICULE),
  19287. this.renderOrder = u.reticule,
  19288. this.player = e,
  19289. this.direction = new r.Vector3,
  19290. this.hidden = !0,
  19291. this.mouseLastMoveTime = Date.now()
  19292. }
  19293. var r = e("three")
  19294. , o = e("../settings")
  19295. , a = e("../util/transitions")
  19296. , s = e("../util/texture")
  19297. , l = e("../util/lerp")
  19298. , c = e("../shaders")
  19299. , h = e("../enum/RenderLayers")
  19300. , u = e("../enum/RenderOrder")
  19301. , d = s.load("images/reticule-256x256.png");
  19302. n.prototype = Object.create(r.Mesh.prototype),
  19303. n.prototype.move = function(e, t, i) {
  19304. this.hidden = i,
  19305. this.mouseLastMoveTime = Date.now()
  19306. }
  19307. ,
  19308. n.prototype.hide = function() {
  19309. this.hidden || (this.hidden = !0,
  19310. a.start(l.property(this.material.uniforms.opacity, "value", 0), o.reticuleOpacityTransitionTime))
  19311. }
  19312. ,
  19313. n.prototype.show = function() {
  19314. this.hidden = !1,
  19315. this.material.opacity <= 0 && a.start(l.property(this.material.uniforms.opacity, "value", o[this.player.mode].reticuleOpacity), o.reticuleOpacityTransitionTime)
  19316. }
  19317. ,
  19318. n.prototype.update = function() {
  19319. Date.now() - this.mouseLastMoveTime > o.hideReticuleTimeout && !this.hidden && this.hide()
  19320. }
  19321. ,
  19322. n.prototype.updatePosition = function(e, t) {
  19323. if (!this.hidden) {
  19324. if (!t)
  19325. return this.hide();
  19326. var i = t.point
  19327. , n = e.distanceTo(i)
  19328. , r = 1 + .01 * n;
  19329. n < 1 && (r -= 1 - n),
  19330. this.show(),
  19331. this.scale.set(r, r, r),
  19332. this.direction = this.direction.multiplyScalar(.8),
  19333. this.direction.add(t.face.normal.clone().multiplyScalar(.2)),
  19334. this.position.copy(i).add(t.face.normal.clone().multiplyScalar(.01)),
  19335. this.lookAt(this.position.clone().add(this.direction))
  19336. }
  19337. }
  19338. ,
  19339. n.prototype.writeAstag = function() {
  19340. var e = Math.floor(4294967296 * (1 + Math.random())).toString(16) + Math.floor(16 * (1 + Math.random())).toString(16)
  19341. , t = new Date;
  19342. this.tagCount = "undefined" == typeof this.tagCount ? 1 : this.tagCount + 1;
  19343. var i = {
  19344. enabled: !0,
  19345. version: "0",
  19346. created: t.toISOString(),
  19347. created_by: "APITest",
  19348. position: this.position.clone(),
  19349. stem: {
  19350. enabled: o.tags.pole.enabled,
  19351. direction: this.direction.multiplyScalar(o.tags.pole.height)
  19352. },
  19353. label: "tag " + this.tagCount,
  19354. description: "Description " + e,
  19355. floor: function(e) {
  19356. if (e.currentFloor) {
  19357. var t = e.floors.indexOf(e.currentFloor);
  19358. return t > -1 ? t : void 0
  19359. }
  19360. }(this.player.model),
  19361. type: "info",
  19362. metadata: {
  19363. preferred_camera: {
  19364. mode: this.player.mode
  19365. }
  19366. }
  19367. };
  19368. console.log("--------------------------"),
  19369. console.log(JSON.stringify(i));
  19370. var n = this.player.model.addtag(e, i).build();
  19371. n && (n.disc && this.player.tagDiscs.push(n.disc),
  19372. n.visible || n.show(o.tags.startup.fadeInDuration))
  19373. }
  19374. ,
  19375. t.exports = n
  19376. }
  19377. , {
  19378. "../enum/RenderLayers": 41,
  19379. "../enum/RenderOrder": 42,
  19380. "../settings": 166,
  19381. "../shaders": 167,
  19382. "../util/lerp": 188,
  19383. "../util/texture": 194,
  19384. "../util/transitions": 195,
  19385. three: 217
  19386. }],
  19387. 150: [function(e, t, i) {
  19388. "use strict";
  19389. function n(e, t) {
  19390. this.chunks = [],
  19391. this.floorId = e,
  19392. this.roomId = t,
  19393. this.position = new r.Vector3
  19394. }
  19395. var r = e("three");
  19396. n.prototype.addChunk = function(e) {
  19397. this.chunks.push(e)
  19398. }
  19399. ,
  19400. n.prototype.calcBoundaries = function() {
  19401. 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++) {
  19402. var s = this.chunks[a]
  19403. , l = s.geometry.attributes.position;
  19404. if (l)
  19405. for (var c = 0; c < l.array.length; c += 3)
  19406. e.set(l.array[c], l.array[c + 1], l.array[c + 2]),
  19407. t.add(e),
  19408. 0 === c ? (i.copy(e),
  19409. n.copy(e)) : (i.max(e),
  19410. n.min(e)),
  19411. o++
  19412. }
  19413. o > 0 ? (t.multiplyScalar(1 / o),
  19414. this.average = t) : this.average = null,
  19415. this.boundsMax = i,
  19416. this.boundsMin = n,
  19417. this.center = new r.Vector3,
  19418. this.center.copy(i).sub(n).multiplyScalar(.5).add(n)
  19419. }
  19420. ,
  19421. t.exports = n
  19422. }
  19423. , {
  19424. three: 217
  19425. }],
  19426. 151: [function(e, t, i) {
  19427. (function(i) {
  19428. "use strict";
  19429. function n(e, t, i) {
  19430. this.obj3d = null,
  19431. this.nodes = [],
  19432. this.colorHull = [],
  19433. this.shortPaths = {},
  19434. this.floorHull = null,
  19435. this.cameraHull = null,
  19436. this.floorPathDistance = 0,
  19437. this.floorCurvePoints = null,
  19438. this.floorCurveColors = null,
  19439. this.camCurvePoints = null,
  19440. this.warpDestHeroLoc = null,
  19441. this.warpDestPano = null,
  19442. this.warpPathPoints = null,
  19443. this.warpPathLengths = [0],
  19444. this.warpLength = 0,
  19445. this.closeWarpDistance = 4,
  19446. this.UP = A.UP.clone(),
  19447. this.longestStep = 0,
  19448. this.upcomingTransType = null,
  19449. this.burnsDir = 1, //导览在DOLLHOUSE停留时的旋转方向 1 或 -1
  19450. this.prevNextDist = 0,
  19451. this.nextI = 0,
  19452. this.activeTransType = null,
  19453. this.lastTransType = null,
  19454. this.bunnyObj = null,
  19455. this.director = e,
  19456. this.player = t,
  19457. this.playerControls = i,
  19458. this.modelManager = t.modelManager,
  19459. this.updateModel(),
  19460. this.updateDefaultsFromModelData(),
  19461. this.bindEvents(),
  19462. this.warping = !1,
  19463. this.waitingToWarp = !1,
  19464. this.warpInterrupted = !1,
  19465. this.warpInterruptionBlackoutStyle = null,
  19466. this.warpInterruptionTravelTime = null
  19467. }
  19468. var r = e("three")
  19469. , o = e("../util/logger")
  19470. , a = e("../enum/Viewmode")
  19471. , s = e("../enum/RenderOrder")
  19472. , l = e("../enum/WarpStyle")
  19473. , c = e("../settings")
  19474. , h = e("../util/math")
  19475. , u = e("../util/lerp")
  19476. , d = e("../util/easing")
  19477. , p = e("../util/transitions")
  19478. , f = e("../objects/Snapshot")
  19479. , g = e("../effects")
  19480. , m = e("../shaders")
  19481. , v = (e("../gui/gui"),
  19482. e("../util/texture"))
  19483. , A = e("../enum/Vectors")
  19484. , y = (e("../model/ModelManager"),
  19485. new o(i))
  19486. , C = e("../enum/PlayerEvents")
  19487. , I = e("../enum/BlackoutStyle")
  19488. , E = e("../enum/ModelManagerEvents")
  19489. , b = e("../constants")
  19490. , w = {
  19491. 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"),
  19492. pathEnd: v.load("images/End.png"),
  19493. 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==")
  19494. };
  19495. n.prototype.setScene = function(e) {
  19496. this.createCpm(e),
  19497. this.createBunnyObj(e)
  19498. }
  19499. ,
  19500. n.prototype.updateModel = function() {
  19501. this.model = this.modelManager.getActiveModel()
  19502. }
  19503. ,
  19504. n.prototype.bindEvents = function() {
  19505. this.modelManager.on(E.ActiveModelChanged, this.updateModel.bind(this))
  19506. }
  19507. ,
  19508. n.prototype.updateDefaultsFromModelData = function() {
  19509. this.model.data
  19510. }
  19511. ,
  19512. n.prototype.pointPathDistance = function(e) {
  19513. for (var t = 0, i = 1; i < e.length; i += 1)
  19514. t += e[i - 1].distanceTo(e[i]);
  19515. return t
  19516. }
  19517. ,
  19518. n.prototype.pointPathLengths = function(e) {
  19519. for (var t = [0], i = 1; i < e.length; i += 1)
  19520. t.push(t[i - 1] + e[i - 1].distanceTo(e[i]));
  19521. return t
  19522. }
  19523. ,
  19524. n.prototype.interpAlongPath = function(e, t, i) {
  19525. var n, o = new r.Vector3, a = t[t.length - 1];
  19526. if (i < 1) {
  19527. n = i * a;
  19528. for (var s = 1; s < t.length; s += 1)
  19529. if (t[s] > n) {
  19530. var l = (n - t[s - 1]) / (t[s] - t[s - 1]);
  19531. return o.copy(e[s]),
  19532. o.sub(e[s - 1]),
  19533. o.multiplyScalar(l),
  19534. o.add(e[s - 1]),
  19535. o
  19536. }
  19537. } else
  19538. o.copy(e[e.length - 1]);
  19539. return o
  19540. }
  19541. ,
  19542. n.prototype.pathHeight = function() {
  19543. return this.player.mode !== a.FLOORPLAN ? c.path.height : c.path.outsideHeight
  19544. }
  19545. ,
  19546. n.prototype.createBunnyObj = function(e) {
  19547. this.bunnyObj || (this.bunnyObj = new r.AxisHelper(.1),
  19548. this.bunnyObj.visible = c.warp.showBunny),
  19549. this.bunnyObj.parent && this.bunnyObj.parent.remove(bunnyObj),
  19550. e.add(this.bunnyObj)
  19551. }
  19552. ,
  19553. n.prototype.createCpm = function(e) {
  19554. if (!this.currentPanoMarker) {
  19555. var t = this.makeWaypointObj(w.pathEnd, "Current");
  19556. t.material.uniforms.opacity.value = 0,
  19557. this.currentPanoMarker = {
  19558. mesh: t,
  19559. placed: !1
  19560. }
  19561. }
  19562. this.currentPanoMarker.mesh.parent && this.currentPanoMarker.mesh.parent.remove(this.currentPanoMarker.mesh),
  19563. this.placeCpm(),
  19564. this.currentPanoMarker.mesh.parent || e.add(this.currentPanoMarker.mesh)
  19565. }
  19566. ,
  19567. n.prototype.placeCpm = function() {
  19568. if (c.path.mapGuides && this.player.currentPano && this.player.currentPano.isAligned()) {
  19569. var e = this.player.currentPano.floor;
  19570. this.currentPanoMarker.mesh.parent !== this.player.currentPano.floor && (this.currentPanoMarker.mesh.parent && this.currentPanoMarker.mesh.parent.remove(this.currentPanoMarker.mesh),
  19571. e.add(this.currentPanoMarker.mesh)),
  19572. this.currentPanoMarker.mesh.position.copy(this.player.currentPano.floorPosition).sub(e.position),
  19573. this.currentPanoMarker.mesh.position.y += this.pathHeight(),
  19574. this.currentPanoMarker.placed = !0
  19575. } else
  19576. this.popOutCpm()
  19577. }
  19578. ,
  19579. n.prototype.fadeInCpm = function(e) {
  19580. 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)
  19581. }
  19582. ,
  19583. n.prototype.fadeOutCpm = function(e) {
  19584. p.start(u.property(this.currentPanoMarker.mesh.material.uniforms.opacity, "value", 0), e)
  19585. }
  19586. ,
  19587. n.prototype.popInCpm = function() {
  19588. c.path.mapGuides && this.currentPanoMarker.placed && this.fadeInCpm(2)
  19589. }
  19590. ,
  19591. n.prototype.popOutCpm = function() {
  19592. this.fadeOutCpm(2)
  19593. }
  19594. ,
  19595. n.prototype.brushPrefs = {
  19596. linewidth: 7,
  19597. strokeWidth: 15,
  19598. cvSegments: 48,
  19599. paveStep: .1,
  19600. paveWidth: .2,
  19601. lookBlendDist: 3,
  19602. maxTurn: r.Math.degToRad(2)
  19603. },
  19604. n.prototype.panoPathDistance = function(e) {
  19605. var t = this.model.panos;
  19606. if (!e || e.length < 2)
  19607. return 0;
  19608. for (var i = [], n = 0; n < e.length; n += 1)
  19609. i.push(t.get(e[n]).floorPosition);
  19610. return this.pointPathDistance(i)
  19611. }
  19612. ,
  19613. n.prototype.loadTileTexture = function(e) {
  19614. var t = v.load(e, function(t) {
  19615. t.wrapS = r.RepeatWrapping,
  19616. t.wrapT = r.RepeatWrapping,
  19617. t.needsUpdate = !0,
  19618. y.debug('path texture "' + e + '" is ready')
  19619. }, function() {
  19620. y.error('path texture "' + e + '" failed')
  19621. });
  19622. return t.mapping = r.UVMapping,
  19623. t
  19624. }
  19625. ,
  19626. n.prototype.buildWarpDestinationDescriptor = function(e, t, i, n, r, o) {
  19627. var a = {
  19628. cameraMode: n,
  19629. position: e,
  19630. quaternion: t,
  19631. panoId: i,
  19632. orthoZoom: o,
  19633. floorVisibility: r,
  19634. thumbUrl: null,
  19635. name: null
  19636. };
  19637. return new f(a)
  19638. }
  19639. ,
  19640. n.prototype.buildWarpDestinationDescriptorFromHero = function(e) {
  19641. return this.buildWarpDestinationDescriptor(e.position, e.quaternion, this.getHeroId(e), e.cameraMode, e.floorVisibility, e.orthoZoom)
  19642. }
  19643. ,
  19644. n.prototype.setWarpDestination = function(e) {
  19645. this.warpDestHeroLoc = e
  19646. }
  19647. ,
  19648. n.prototype.setWarpDestinationByHeroIndex = function(e) {
  19649. var t = this.getHeroDescriptorByHeroIndex(e);
  19650. return null !== t && (this.setWarpDestination(t),
  19651. !0)
  19652. }
  19653. ,
  19654. n.prototype.setWarpDestinationByPano = function(e, t) {
  19655. var i = this.model.panos.get(e.id);
  19656. return !!i && this.setWarpDestinationByPanoId(e.id, t)
  19657. }
  19658. ,
  19659. n.prototype.setWarpDestinationByPanoId = function(e, t) {
  19660. var i = this.model.panos.get(e);
  19661. if (i) {
  19662. t = t || new r.Quaternion;
  19663. var n = this.buildWarpDestinationDescriptor(i.position, t, i.id, "panorama", [], -1);
  19664. return this.setWarpDestination(n),
  19665. !0
  19666. }
  19667. return !1
  19668. }
  19669. ,
  19670. n.prototype.getHeroDescriptorByHeroIndex = function(e) {
  19671. var t = this.model.heroCount();
  19672. if (null !== this.warpDestHeroLoc && t < 2)
  19673. return y.info("ShowPath.getHeroDescriptorByHeroIndex() -> Only one hero location is available."),
  19674. this.model.getHeroDescriptorByIndex(0);
  19675. var i = this.model.getHeroDescriptorByIndex(e);
  19676. if (i) {
  19677. var n = i.isPano() ? i.panoId : i.cameraMode;
  19678. y.debug('ShowPath.getHeroDescriptorByHeroIndex() -> New brush/warp destination: "' + n + '" out of ' + t + " choices.")
  19679. }
  19680. return i
  19681. }
  19682. ,
  19683. n.prototype.getHeroDescriptorByPano = function(e) {
  19684. var t = this.model.panos.get(e.id);
  19685. return t ? this.getHeroDescriptorByPanoId(e.id) : null
  19686. }
  19687. ,
  19688. n.prototype.getHeroDescriptorByPanoId = function(e) {
  19689. var t = this.getHeroIndexFromPanoId(e);
  19690. return this.getHeroDescriptorByHeroIndex(t)
  19691. }
  19692. ,
  19693. n.prototype.getHeroIndexFromPanoId = function(e) {
  19694. for (var t = 0; t < this.model.heroLocations.length; t++) {
  19695. var i = this.model.heroLocations[t]
  19696. , n = this.getHeroId(i);
  19697. if (n && n === e)
  19698. return t
  19699. }
  19700. return -1
  19701. }
  19702. ,
  19703. n.prototype.getHeroPano = function(e) {
  19704. if (null === e)
  19705. return y.warn("getHeroPano(): no destination"),
  19706. null;
  19707. var t = this.getHeroId(e)
  19708. , i = this.model.panos.get(t);
  19709. return void 0 === i && (i = null,
  19710. "" !== t && y.debug('unable to find pano "' + t + '"')),
  19711. i
  19712. }
  19713. ,
  19714. n.prototype.getHeroId = function(e) {
  19715. return e.panoId
  19716. }
  19717. ,
  19718. n.prototype.setWarpDestPano = function() {
  19719. return this.warpDestPano = this.getHeroPano(this.warpDestHeroLoc),
  19720. this.warpDestPano
  19721. }
  19722. ,
  19723. n.prototype.brushToWarpPano = function(e, t) {
  19724. if (this.discardPathObject(),
  19725. !this.setWarpDestPano())
  19726. return !1;
  19727. if (this.warpDestHeroLoc.cameraMode !== a.PANORAMA && y.warn("Can only brush from pano to pano"),
  19728. !this.warpDestPano)
  19729. return y.info("No brush"),
  19730. !1;
  19731. if (!this.player.currentPano)
  19732. return y.debug("No current pano, visibility undefined"),
  19733. !1;
  19734. if (!this.warpDestPano)
  19735. return y.info("No wPano, visibility undefined"),
  19736. !1;
  19737. if (!this.warpDestPano.isAligned())
  19738. return y.debug("Cannot brush to unaligned pano"),
  19739. !1;
  19740. var i = (e === l.STD || e === l.WALK) && c.path.mapGuides
  19741. , n = !0;
  19742. if (this.player.currentPano.id === this.warpDestPano.id)
  19743. y.debug("Already at destination pano");
  19744. else {
  19745. this.nodes = this.findShortestPath(this.player.currentPano, this.warpDestPano),
  19746. n = void 0 === this.nodes || null === this.nodes || this.nodes.length < 1,
  19747. this.obj3d = new r.Object3D,
  19748. y.debug('Brushing from "' + this.player.currentPano.id + '" to "' + this.warpDestPano.id + '" (' + (this.nodes ? this.nodes.length : 0) + ")"),
  19749. n ? (y.info('No "walkable" route, using fall-back warp style transition'),
  19750. e = t) : (this.setPathHulls(this.nodes),
  19751. this.setFloorCurves(),
  19752. 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)))),
  19753. this.player.currentPano.floor.add(this.obj3d);
  19754. var o = this.player.mode === a.DOLLHOUSE || this.player.mode === a.FLOORPLAN
  19755. , s = e === l.STD;
  19756. if (!n && (i || s)) {
  19757. if (o) {
  19758. var h = this.makeStartMarker(this.floorHull[0], this.floorCurvePoints);
  19759. this.obj3d.add(h)
  19760. }
  19761. var u = this.makeEndMarker(this.floorHull[this.floorHull.length - 1]);
  19762. this.obj3d.add(u)
  19763. }
  19764. this.appearSlow()
  19765. }
  19766. return this.upcomingTransType = e,
  19767. !n
  19768. }
  19769. ,
  19770. n.prototype.findShortestPath = function(e, t) {
  19771. if (!e || !t)
  19772. return null;
  19773. var i = c.warp.walkExtraPanosDistance
  19774. , n = e.id + ":" + t.id + ":" + i;
  19775. if (this.shortPaths.hasOwnProperty(n))
  19776. return this.shortPaths[n] ? this.shortPaths[n].slice() : null;
  19777. var r = t.id + ":" + e.id + ":" + i;
  19778. if (this.shortPaths.hasOwnProperty(r))
  19779. return this.shortPaths[r] ? this.shortPaths[r].slice().reverse() : null;
  19780. var o = this.model.panos.aStarSearch(e, t);
  19781. return this.model.panos.includeNodesNearPath(o, i),
  19782. this.shortPaths[n] = o ? o.slice() : null,
  19783. o
  19784. }
  19785. ,
  19786. n.prototype.makePathHulls = function(e) {
  19787. var t, i, n, r, o, a = 0, s = [], l = [], h = [], u = this.model.panos;
  19788. t = u.get(e[0]),
  19789. r = t.floor.floorIndex;
  19790. for (var d = 0; d < e.length; d += 1)
  19791. t = u.get(e[d]),
  19792. i = t.floorPosition.clone().sub(this.model.position),
  19793. i.y += this.pathHeight(),
  19794. s.push(i),
  19795. l.push(t.position.clone()),
  19796. n = t.floor.floorIndex,
  19797. h.push(n > r ? c.path.colorUp : n < r ? c.path.colorDown : c.path.color),
  19798. d > 0 && (o = l[d].distanceTo(l[d - 1]),
  19799. o > a && (a = o));
  19800. return a > this.longestStep && (this.longestStep = a,
  19801. y.debug("path contains " + a + " meter segment")),
  19802. {
  19803. floor: s,
  19804. camera: l,
  19805. color: h
  19806. }
  19807. }
  19808. ,
  19809. n.prototype.makeFloorCurves = function(e, t, i) {
  19810. var n = this.player.mode === a.PANORAMA ? c.path.waypointIndoorRadius : c.path.waypointRadius
  19811. , o = this.pointPathDistance(e) - 2 * n
  19812. , s = e.slice(0)
  19813. , l = s[1].clone().sub(s[0]);
  19814. l.y = 0,
  19815. l.normalize().multiplyScalar(n),
  19816. s[0] = (new r.Vector3).copy(s[0]).add(l),
  19817. l = s[s.length - 2].clone().sub(s[s.length - 1]),
  19818. l.y = 0,
  19819. l.normalize().multiplyScalar(n),
  19820. s[s.length - 1] = (new r.Vector3).copy(s[s.length - 1]).add(l);
  19821. var h = new r.CatmullRomCurve3(s)
  19822. , u = Math.floor(o / i);
  19823. u = 4 * Math.floor(u / 4),
  19824. u = Math.max(4, u);
  19825. for (var d, p, f, g = h.getSpacedPoints(u), m = [], v = new r.Vector3, A = 0; A < g.length; A += 1) {
  19826. f = 0,
  19827. d = g[A].distanceTo(e[0]);
  19828. for (var y = 1; y < e.length; y += 1)
  19829. v.copy(g[A]).sub(e[y]),
  19830. v.y *= 4,
  19831. p = v.length(),
  19832. p < d && (f = y);
  19833. m.push(t[f])
  19834. }
  19835. return {
  19836. distance: o,
  19837. points: g,
  19838. colors: m
  19839. }
  19840. }
  19841. ,
  19842. n.prototype.makeCameraCurvePoints = function(e, t) {
  19843. var i = this.pointPathDistance(e)
  19844. , n = new r.CatmullRomCurve3(e);
  19845. return n.getSpacedPoints(Math.max(2, Math.floor(i / t)))
  19846. }
  19847. ,
  19848. n.prototype.makeCameraCurveTangents = function(e, t) {
  19849. var i = this.pointPathDistance(e)
  19850. , n = new r.CatmullRomCurve3(e)
  19851. , o = Math.max(2, Math.floor(i / t));
  19852. o || (o = 5);
  19853. for (var a = [], s = 0; s <= o; s++)
  19854. a.push(n.getTangentAt(s / o));
  19855. return a
  19856. }
  19857. ,
  19858. n.prototype.setPathHulls = function(e) {
  19859. var t = this.makePathHulls(e);
  19860. this.floorHull = t.floor,
  19861. this.cameraHull = t.camera,
  19862. this.colorHull = t.color
  19863. }
  19864. ,
  19865. n.prototype.setFloorCurves = function() {
  19866. var e = this.makeFloorCurves(this.floorHull, this.colorHull, this.brushPrefs.paveStep);
  19867. this.floorPathDistance = e.distance,
  19868. this.floorCurvePoints = e.points,
  19869. this.floorCurveColors = e.colors
  19870. }
  19871. ,
  19872. n.prototype.setCameraCurvePoints = function() {
  19873. this.camCurvePoints = this.makeCameraCurvePoints(this.cameraHull, c.warp.stepFactor * this.brushPrefs.paveStep)
  19874. }
  19875. ,
  19876. n.prototype.chooseWarpPath = function(e) {
  19877. var t, i, n, o = this.playerControls.cameras[a.PANORAMA];
  19878. if (this.player.currentPano === this.warpDestPano || !e)
  19879. return this.warpPathPoints = null,
  19880. this.warpLength = 0,
  19881. !1;
  19882. this.nodes = this.findShortestPath(this.player.currentPano, this.warpDestPano),
  19883. void 0 === this.nodes || null === this.nodes || this.nodes.length < 1 ? (y.debug("warp path to unreachable node"),
  19884. t = this.warpDestPano.position.clone().sub(o.position),
  19885. i = t.clone().negate(),
  19886. t.multiplyScalar(.15).add(o.position),
  19887. i.multiplyScalar(.15).add(this.warpDestPano.position),
  19888. t.y = o.position.y,
  19889. i.y = this.warpDestPano.position.y,
  19890. n = new r.CubicBezierCurve3(o.position.clone(),t,i,this.warpDestPano.position.clone()),
  19891. this.warpPathPoints = n.getSpacedPoints(this.brushPrefs.cvSegments)) : (y.debug("follow warp path (path distance was " + this.nodes.length + " nodes, " + this.floorPathDistance + ")"),
  19892. this.setCameraCurvePoints(),
  19893. this.warpPathPoints = this.camCurvePoints.slice(0)),
  19894. this.warpLength = 0,
  19895. this.warpPathLengths = [0];
  19896. 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) {
  19897. s.copy(this.warpPathPoints[d - 1]).sub(this.warpPathPoints[d]);
  19898. var p = s.length();
  19899. s.y *= c.warp.climbEffort;
  19900. var f = s.length() / p;
  19901. if (d > 1) {
  19902. s.setY(0).normalize(),
  19903. l.copy(this.warpPathPoints[d - 2]).sub(this.warpPathPoints[d - 1]).setY(0).normalize();
  19904. var g = Math.min(1, s.dot(l))
  19905. , m = 1 + (c.warp.brakeStrength - 1) * (1 - r.Math.smoothstep(g, u, h));
  19906. f = Math.max(m, f)
  19907. }
  19908. this.warpLength += p * f,
  19909. this.warpPathLengths[d] = this.warpLength
  19910. }
  19911. return !0
  19912. }
  19913. ,
  19914. n.prototype.drawPathRibbon = function(e, t) {
  19915. this.bunnyObj.visible = c.warp.showBunny;
  19916. 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) {
  19917. h.copy(e[u]),
  19918. 0 === u ? h.sub(e[u + 1]) : h.sub(e[u - 1]).negate(),
  19919. h.normalize(),
  19920. n.crossVectors(h, A.UP),
  19921. n.multiplyScalar(i);
  19922. var d = (new r.Vector3).copy(e[u]).add(o);
  19923. d.sub(n),
  19924. l.vertices.push(d),
  19925. d = (new r.Vector3).copy(e[u]).add(o),
  19926. d.add(n),
  19927. l.vertices.push(d)
  19928. }
  19929. var p, f = 0;
  19930. for (u = 0; u < e.length - 1; u += 1) {
  19931. var g = 2 * u
  19932. , v = f;
  19933. f += e[u + 1].distanceTo(e[u]);
  19934. var y = f
  19935. , C = t[u]
  19936. , I = t[u + 1];
  19937. p = new r.Face3(g,g + 1,g + 2),
  19938. p.vertexColors = [new r.Color(C), new r.Color(C), new r.Color(I)],
  19939. l.faces.push(p),
  19940. l.faceVertexUvs[0].push([new r.Vector2(0,v), new r.Vector2(1,v), new r.Vector2(0,y)]),
  19941. p = new r.Face3(g + 2,g + 1,g + 3),
  19942. p.vertexColors = [new r.Color(I), new r.Color(C), new r.Color(I)],
  19943. l.faces.push(p),
  19944. l.faceVertexUvs[0].push([new r.Vector2(0,y), new r.Vector2(1,v), new r.Vector2(1,y)])
  19945. }
  19946. l.computeFaceNormals(),
  19947. l.computeVertexNormals();
  19948. var E, b;
  19949. this.player.mode === a.PANORAMA ? (b = r.UniformsUtils.clone(m.ribbon.uniforms),
  19950. b.map.value = w.path,
  19951. b.opacity.value = 0,
  19952. b.color.value.set(c.path.color),
  19953. E = new r.RawShaderMaterial({
  19954. side: r.DoubleSide,
  19955. depthWrite: !1,
  19956. transparent: !0,
  19957. vertexShader: m.ribbon.vertexShader,
  19958. fragmentShader: m.ribbon.fragmentShader,
  19959. uniforms: b,
  19960. name: "ribbonT",
  19961. opacity: 0
  19962. })) : E = new r.MeshBasicMaterial({
  19963. color: 16777215,
  19964. side: r.DoubleSide,
  19965. name: "ribbonOut",
  19966. vertexColors: r.VertexColors
  19967. });
  19968. var _ = new r.Mesh(l,E);
  19969. return _.name = "ribbon",
  19970. this.player.mode === a.PANORAMA && (_.renderOrder = s.ribbon),
  19971. _
  19972. }
  19973. ,
  19974. n.prototype.drawPathPavement = function(e) {
  19975. for (var t, i = .25, n = new r.Vector3, o = new r.Geometry, s = new r.Vector3, l = 0; l < e.length; l += 1)
  19976. s.copy(e[l]),
  19977. 0 === l ? s.sub(e[l + 1]).negate() : s.sub(e[l - 1]),
  19978. s.normalize(),
  19979. n.crossVectors(s, A.UP),
  19980. n.multiplyScalar(this.brushPrefs.paveWidth),
  19981. t = (new r.Vector3).copy(e[l]),
  19982. t.sub(n),
  19983. o.vertices.push(t),
  19984. o.vertices.push((new r.Vector3).copy(e[l])),
  19985. t = (new r.Vector3).copy(e[l]),
  19986. t.add(n),
  19987. o.vertices.push(t);
  19988. var h, u, d;
  19989. for (l = 0; l < e.length - 1; l += 1)
  19990. h = 3 * l + 1,
  19991. u = l * i,
  19992. d = u + i,
  19993. o.faces.push(new r.Face3(h - 1,h,h + 3)),
  19994. o.faceVertexUvs[0].push([new r.Vector2(0,u), new r.Vector2(.5,u), new r.Vector2(.5,d)]),
  19995. o.faces.push(new r.Face3(h + 3,h + 2,h - 1)),
  19996. o.faceVertexUvs[0].push([new r.Vector2(.5,d), new r.Vector2(0,d), new r.Vector2(0,u)]),
  19997. o.faces.push(new r.Face3(h + 3,h,h + 1)),
  19998. o.faceVertexUvs[0].push([new r.Vector2(.5,d), new r.Vector2(.5,u), new r.Vector2(1,u)]),
  19999. o.faces.push(new r.Face3(h + 3,h + 1,h + 4)),
  20000. o.faceVertexUvs[0].push([new r.Vector2(.5,d), new r.Vector2(1,u), new r.Vector2(1,d)]);
  20001. var p = this.player.mode === a.PANORAMA ? new r.MeshBasicMaterial({
  20002. color: c.path.color,
  20003. side: r.DoubleSide,
  20004. transparent: !0,
  20005. depthWrite: !1,
  20006. opacity: 0,
  20007. name: "paveT",
  20008. map: w.path
  20009. }) : new r.MeshBasicMaterial({
  20010. color: c.path.color,
  20011. side: r.DoubleSide,
  20012. transparent: !0,
  20013. depthWrite: !1,
  20014. opacity: 1,
  20015. name: "paveO",
  20016. map: w.path
  20017. });
  20018. return new r.Mesh(o,p)
  20019. }
  20020. ,
  20021. n.prototype.hintPrefs = {
  20022. rad: .18,
  20023. width: .0125,
  20024. depth: .0625,
  20025. setBack: -.04,
  20026. markRad: .25,
  20027. markInnerRad: .16
  20028. },
  20029. n.prototype.makeWaypointObj = function(e, t) {
  20030. var i = new r.Geometry
  20031. , n = this.player.mode === a.PANORAMA ? c.path.waypointIndoorRadius : c.path.waypointRadius
  20032. , o = this.pathHeight();
  20033. 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)),
  20034. i.faces.push(new r.Face3(0,1,2), new r.Face3(2,3,0)),
  20035. i.faceVertexUvs[0].push([new r.Vector2(0,0), new r.Vector2(1,0), new r.Vector2(1,1)]),
  20036. i.faceVertexUvs[0].push([new r.Vector2(1,1), new r.Vector2(0,1), new r.Vector2(0,0)]);
  20037. var s = r.UniformsUtils.clone(m.waypoint.uniforms);
  20038. s.map.value = e,
  20039. s.opacity.value = 0,
  20040. s.color.value.set(c.path.color);
  20041. var l = {
  20042. side: r.DoubleSide,
  20043. depthWrite: !1,
  20044. transparent: !0,
  20045. vertexShader: m.waypoint.vertexShader,
  20046. fragmentShader: m.waypoint.fragmentShader,
  20047. uniforms: s,
  20048. name: "waypoint",
  20049. opacity: 0
  20050. };
  20051. this.player.mode !== a.PANORAMA && (l.depthTest = !1,
  20052. l.name = "wayPtOut");
  20053. var h = new r.RawShaderMaterial(l)
  20054. , u = new r.Mesh(i,h);
  20055. return u.name = t,
  20056. u
  20057. }
  20058. ,
  20059. n.prototype.makeStartMarker = function(e, t) {
  20060. var i = (new r.Vector3).copy(t[1]).sub(t[0]);
  20061. i.y = 0,
  20062. i.normalize();
  20063. var n = Math.acos(i.x)
  20064. , o = this.makeWaypointObj(w.pathStart, "Start");
  20065. return o.rotateOnAxis(new r.Vector3(0,1,0), n),
  20066. o.position.copy(e),
  20067. o
  20068. }
  20069. ,
  20070. n.prototype.makeEndMarker = function(e) {
  20071. var t = this.makeWaypointObj(w.pathEnd, "End")
  20072. , i = this.model.panos.get(this.nodes[0]).floor.floorIndex
  20073. , n = this.model.panos.get(this.nodes[this.nodes.length - 1]).floor.floorIndex;
  20074. return i < n ? t.material.uniforms.color.value.set(c.path.colorUp) : i > n && t.material.uniforms.color.value.set(c.path.colorDown),
  20075. t.position.copy(e),
  20076. t
  20077. }
  20078. ,
  20079. n.prototype.pathClean = function(e) {
  20080. if (e) {
  20081. for (var t in e.children)
  20082. this.pathClean(e.children[t]);
  20083. e.geometry && e.geometry.dispose(),
  20084. e.material && e.material.dispose()
  20085. }
  20086. }
  20087. ,
  20088. n.prototype.discardPathObject = function() {
  20089. if (this.obj3d) {
  20090. var e = this.obj3d.parent;
  20091. e && e.remove(this.obj3d),
  20092. this.pathClean(this.obj3d)
  20093. }
  20094. this.obj3d = null,
  20095. this.popInCpm()
  20096. }
  20097. ,
  20098. n.prototype.discardSlow = function() {
  20099. if (this.obj3d) {
  20100. if (this.player.mode !== a.PANORAMA)
  20101. return void this.discardPathObject();
  20102. for (var e, t = this, i = 0, n = function() {
  20103. this.discardPathObject()
  20104. }
  20105. .bind(this), r = 0; r < t.obj3d.children.length; r += 1)
  20106. e = t.obj3d.children[r],
  20107. 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]),
  20108. i += 1,
  20109. n = null);
  20110. 0 === i && this.discardPathObject(),
  20111. this.player.mode !== a.PANORAMA && this.fadeInCpm(c.path.fadeInTime - 3)
  20112. }
  20113. }
  20114. ,
  20115. n.prototype.appearSlow = function() {
  20116. var e, t = this;
  20117. this.fadeOutCpm(c.path.fadeInTime);
  20118. for (var i = this.player.mode === a.PANORAMA ? c.path.opacity : 1, n = 0; n < t.obj3d.children.length; n += 1)
  20119. e = t.obj3d.children[n],
  20120. 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]))
  20121. }
  20122. ,
  20123. n.prototype.update = function() {
  20124. this.obj3d && this.obj3d.updateMatrixWorld()
  20125. }
  20126. ,
  20127. n.prototype.calcBurnsAmount = function(e) {
  20128. var t = r.Math.degToRad(c.warp.burnsAngle);
  20129. if (this.player.mode === a.PANORAMA) {
  20130. var i = this.burnsDir * t;
  20131. if (this.upcomingTransType === l.BLACK)
  20132. return i;
  20133. var n = e;
  20134. if (null === n)
  20135. return y.warn("Transition request for non-highlight"),
  20136. i;
  20137. var o = this.getHeroDescriptorByHeroIndex(n);
  20138. if (null === o)
  20139. return i;
  20140. if (!o.isPano())
  20141. return i;
  20142. var s = this.getHeroPano(o)
  20143. , h = this.playerControls.cameras[a.PANORAMA]
  20144. , u = A.FORWARD.clone().applyQuaternion(h.quaternion).setY(0).normalize()
  20145. , d = Math.min(r.Math.degToRad(c.warp.minBurnsAngle), t)
  20146. , p = function(e) {
  20147. var i = Math.acos(Math.min(1, e.dot(u)))
  20148. , n = (new r.Vector3).crossVectors(u, e);
  20149. return Math.max(d, Math.min(Math.abs(i), t)) * Math.sign(n.y)
  20150. };
  20151. if (s === this.player.currentPano)
  20152. return i = p(A.FORWARD.clone().applyQuaternion(o.quaternion).setY(0).normalize());
  20153. var f = this.findShortestPath(this.player.currentPano, s);
  20154. if (void 0 === f || null === f || f.length < 1)
  20155. return y.debug("Empty path ahead..."),
  20156. i;
  20157. var g = this.makePathHulls(f)
  20158. , m = new r.CatmullRomCurve3(g.camera)
  20159. , v = Math.min(.1, c.warp.lookAheadDist / m.getLength());
  20160. return i = p(m.getPointAt(v).clone().sub(h.position).setY(0).normalize())
  20161. }
  20162. return this.player.mode === a.DOLLHOUSE ? .02 * this.burnsDir : this.burnsDir
  20163. }
  20164. ,
  20165. n.prototype.waitNextStep = function(e, t, time) {//xzw 改时间
  20166. var i = (time==void 0)? c.warp.tourStepDelay : time;
  20167. i || (i = this.lastTransType === l.BLACK ? b.tourStepDelaySlideShow : b.tourStepDelayDefault);
  20168. var n = new r.Euler
  20169. , o = new r.Vector3;
  20170. y.debug("Starting wait: " + (void 0 !== t));
  20171. var s = this.calcBurnsAmount(e)
  20172. , h = function() {
  20173. this.endWarpState(),
  20174. this.player.mode === a.DOLLHOUSE && (this.playerControls.cameras[a.DOLLHOUSE].controls.rotationAcceleration.x = 0),
  20175. t && t()
  20176. }
  20177. .bind(this)
  20178. , u = function(e, t) {
  20179. if (this.warpInterrupted)
  20180. return h(),
  20181. !0;
  20182. var r = t || 1e3 / 60;
  20183. if (c.warp.doBurns)
  20184. if (this.player.mode === a.PANORAMA) {
  20185. var l = this.playerControls.cameras[a.PANORAMA];
  20186. n.setFromQuaternion(l.quaternion, c.warp.eOrder);
  20187. var u = r * s / i;
  20188. n.y += u,
  20189. o.set(0, 0, -1),
  20190. o.applyEuler(n),
  20191. o.add(l.position),
  20192. l.controls.lookAt(o),
  20193. l.controls.lookVector.copy(o)
  20194. ,l.lookAt(o)
  20195. } else
  20196. this.player.mode === a.DOLLHOUSE ? this.playerControls.controls[a.DOLLHOUSE].rotationAcceleration.x = s : this.playerControls.controls[a.FLOORPLAN].absoluteScale *= .9996
  20197. }
  20198. .bind(this);
  20199. this.startWarpState(),
  20200. p.start(u, i, h, 0, d.easeInOutQuad, "wait")
  20201. //zoom动画
  20202. //这是啥?
  20203. var currentGuide = player.model.heroLocations[app.director.currentItem];
  20204. if(currentGuide.zoom){
  20205. this.player.zoomEnabled = true;
  20206. var zoom = function(e, d) {
  20207. this.player.zoomTo(e * currentGuide.zoom.toFixed(2), true)
  20208. }.bind(this)
  20209. p.start(zoom, 2000, null, 0, d.easeOutQuad, "zoom")
  20210. }
  20211. }
  20212. ,
  20213. n.prototype.warpToNonPano = function(e) {
  20214. if (this.discardPathObject(),
  20215. this.warpDestHeroLoc.cameraMode === a.DOLLHOUSE || this.warpDestHeroLoc.cameraMode === a.FLOORPLAN) {
  20216. var t = function() {
  20217. e && e()
  20218. }
  20219. .bind(this);
  20220. this.player.flyToNewMode({
  20221. mode: this.warpDestHeroLoc.cameraMode,
  20222. duration: c.warp.outsideTime,
  20223. warpDest: this.warpDestHeroLoc,
  20224. callback: t,
  20225. force: !0
  20226. })
  20227. } else
  20228. y.warn("no warp destination!!!"),
  20229. e && e()
  20230. }
  20231. ,
  20232. n.prototype._resetWarpShaderParams = function(e) {
  20233. this.player.mode === a.PANORAMA && (void 0 !== e.material.uniforms.blackout && (e.material.uniforms.blackout.value = 0),
  20234. void 0 !== e.material.uniforms.modelAlpha && (e.material.uniforms.modelAlpha.value = 0))
  20235. }
  20236. ,
  20237. n.prototype._clearWarpShading = function() {
  20238. for (var e = this.model.chunks, t = 0; t < e.length; t += 1)
  20239. this._resetWarpShaderParams(e[t]),
  20240. e[t].visible = !0;
  20241. this._resetWarpShaderParams(this.model.skybox)
  20242. }
  20243. ,
  20244. n.prototype._warpStopFlying = function() {
  20245. this.activeTransType = null,
  20246. this.placeCpm()
  20247. }
  20248. ,
  20249. n.prototype._wrapupTravelOnlyBits = function() {
  20250. this._warpStopFlying(),
  20251. this.warpPathPoints && (this.player.currentPano.exit(),
  20252. this.warpDestPano.enter(),
  20253. this.player.currentPano = this.warpDestPano),
  20254. this.player.spider.draw(),
  20255. this.placeCpm()
  20256. }
  20257. ,
  20258. n.prototype._wrapupTravel = function(e) {
  20259. this._wrapupTravelOnlyBits(),
  20260. this.warpCameraAim(e)
  20261. }
  20262. ,
  20263. n.prototype._wrapupWarpShading = function(e) {
  20264. this._clearWarpShading(),
  20265. this._wrapupTravel(e)
  20266. }
  20267. ,
  20268. n.prototype.wrapupWarpShadingOnly = function(e, t) {
  20269. t !== I.END && this._clearWarpShading(),
  20270. this._wrapupTravelOnlyBits(),
  20271. this.upcomingTransType = null,
  20272. e && e()
  20273. }
  20274. ,
  20275. n.prototype._warpCameraAim = function(e, t) {
  20276. var i = this.warpDestHeroLoc.quaternion
  20277. , n = this.playerControls.cameras[a.PANORAMA]
  20278. , o = new r.Vector3(0,0,1).applyQuaternion(i).normalize()
  20279. , s = new r.Vector3(0,0,1).applyQuaternion(n.quaternion).normalize()
  20280. , l = s.dot(o)
  20281. , u = r.Math.radToDeg(Math.acos(l))
  20282. , f = new r.Euler(0,0,0,c.warp.eOrder).setFromQuaternion(i, c.warp.eOrder)
  20283. , g = (new r.Euler).setFromQuaternion(n.quaternion, c.warp.eOrder)
  20284. , m = new r.Euler(f.x - g.x,f.y - g.y,f.z - g.z,c.warp.eOrder);
  20285. m.y = h.constrainedTurn(m.y),
  20286. this.burnsDir = Math.sign(m.y);
  20287. var v = new r.Euler(0,0,0,c.warp.eOrder)
  20288. , A = new r.Vector3
  20289. , C = function(e, t) {
  20290. return !!this.warpInterrupted || (v.x = g.x + e * m.x,
  20291. v.y = g.y + e * m.y,
  20292. v.z = g.z + e * m.z,
  20293. A.set(0, 0, -1),
  20294. A.applyEuler(v),
  20295. A.add(n.position),
  20296. n.controls.lookAt(A),
  20297. n.controls.lookVector.copy(A),
  20298. void n.lookAt(A))
  20299. }
  20300. .bind(this);
  20301. return u > c.warp.minRotation ? p.start(C, e, t, 0, d[c.warp.movementEasing]) : (y.info("Aim angle only is " + u.toPrecision(3) + " degrees, skipping explicit re-aim")
  20302. ,void (t && t())
  20303. )
  20304. }
  20305. ,
  20306. n.prototype._warpBendAim = function(e, t, i, n) {
  20307. var o = n || 0
  20308. , s = this.playerControls.cameras[a.PANORAMA]
  20309. , l = new r.Euler(0,0,0,c.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, c.warp.eOrder)
  20310. , u = (new r.Euler).setFromQuaternion(s.quaternion, c.warp.eOrder)
  20311. , f = new r.Euler(l.x - u.x,l.y - u.y,l.z - u.z,c.warp.eOrder);
  20312. f.y = h.constrainedTurn(f.y);
  20313. var g = Math.min(r.Math.degToRad(c.warp.softBendTilt), Math.abs(f.x));
  20314. f.x = g * Math.sign(f.x),
  20315. g = Math.min(r.Math.degToRad(Math.max(0, c.warp.softBendAngle)), g),
  20316. this.burnsDir = Math.sign(f.y),
  20317. g *= Math.sign(f.y),
  20318. f.y = g;
  20319. var m = new r.Euler(0,0,0,c.warp.eOrder)
  20320. , v = new r.Vector3
  20321. , A = function(e, t) {
  20322. if (e < .5)
  20323. m.x = u.x + e * f.x,
  20324. m.y = u.y + e * f.y,
  20325. m.z = u.z + e * f.z;
  20326. else {
  20327. var i = (1 - e) * c.warp.softBendEnd;
  20328. m.x = l.x - i * f.x,
  20329. m.y = l.y - i * f.y,
  20330. m.z = l.z - i * f.z
  20331. }
  20332. v.set(0, 0, -1),
  20333. v.applyEuler(m),
  20334. v.add(s.position);
  20335. s.controls.lookAt(v),
  20336. s.controls.lookVector.copy(v),
  20337. s.lookAt(v);
  20338. }
  20339. .bind(this);
  20340. return p.start(A, t, i, o, d[c.warp.movementEasing])
  20341. }
  20342. ,
  20343. n.prototype._warpStepCameraAim = function(e, t, i) {
  20344. var n = this.playerControls.cameras[a.PANORAMA]
  20345. , o = new r.Euler(0,0,0,c.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, c.warp.eOrder)
  20346. , s = (new r.Euler).setFromQuaternion(n.quaternion, c.warp.eOrder)
  20347. , l = new r.Euler(o.x - s.x,o.y - s.y,o.z - s.z,c.warp.eOrder);
  20348. l.y = h.constrainedTurn(l.y),
  20349. this.burnsDir = Math.sign(l.y);
  20350. var u = new r.Euler(0,0,0,c.warp.eOrder)
  20351. , f = new r.Vector3
  20352. , g = function(e, t) {
  20353. e < .5 ? u.copy(s) : u.copy(o),
  20354. f.set(0, 0, -1),
  20355. f.applyEuler(u),
  20356. f.add(n.position),
  20357. n.controls.lookAt(f),
  20358. n.controls.lookVector.copy(f),
  20359. n.lookAt(f)
  20360. }
  20361. .bind(this);
  20362. return p.start(g, t, i, 0, d[c.warp.movementEasing])
  20363. }
  20364. ,
  20365. n.prototype.setBurnsDir = function() {
  20366. var e = this.playerControls.cameras[a.PANORAMA]
  20367. , t = new r.Euler(0,0,0,c.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, c.warp.eOrder)
  20368. , i = (new r.Euler).setFromQuaternion(e.quaternion, c.warp.eOrder)
  20369. , n = new r.Euler(t.x - i.x,t.y - i.y,t.z - i.z,c.warp.eOrder);
  20370. n.y = h.constrainedTurn(n.y),
  20371. this.burnsDir = Math.sign(n.y)
  20372. }
  20373. ,
  20374. n.prototype.stepWarpPath = function(e, t) {
  20375. var i = this.playerControls.cameras[a.PANORAMA];
  20376. if (!this.warpPathPoints)
  20377. return i.position.copy(this.warpDestPano.position),
  20378. !0;
  20379. var n = this.warpPathPoints[0]
  20380. , o = this.warpDestPano.position;
  20381. if (null !== this.nodes && this.cameraHull.length > 1) {
  20382. var s = new r.Vector3;
  20383. 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),
  20384. i.position.copy(s)
  20385. } else
  20386. e < .5 ? i.position.copy(n) : i.position.copy(o)
  20387. }
  20388. ,
  20389. n.prototype.interruptAndFastForward = function(e, t) {
  20390. this.warping && (this.warpInterrupted = !0,
  20391. this.warpInterruptionBlackoutStyle = e,
  20392. this.warpInterruptionTravelTime = t,
  20393. null !== this.warpInterruptionBlackoutStyle && void 0 !== this.warpInterruptionBlackoutStyle || (this.warpInterruptionBlackoutStyle = I.MIDDLE),
  20394. null !== this.warpInterruptionTravelTime && void 0 !== this.warpInterruptionTravelTime || (this.warpInterruptionTravelTime = c.minWarpTime))
  20395. }
  20396. ,
  20397. n.prototype.warpCameraAim = function(e) {
  20398. var t = c.warp.minWarpTime;
  20399. if (this.upcomingTransType === l.BLACK)
  20400. t = c.warp.teleportTime;
  20401. else {
  20402. var i = this.playerControls.cameras[a.PANORAMA]
  20403. , n = new r.Euler(0,0,0,c.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, c.warp.eOrder)
  20404. , o = (new r.Euler).setFromQuaternion(i.quaternion, c.warp.eOrder)
  20405. , s = new r.Euler(n.x - o.x,n.y - o.y,n.z - o.z,c.warp.eOrder);
  20406. s.y = h.constrainedTurn(s.y);
  20407. var u = 1e3 * Math.abs(s.y) / r.Math.degToRad(c.warp.maxAimPerSec);
  20408. t = Math.max(t, u)
  20409. }
  20410. var d = function() {
  20411. this._warpStopFlying(),
  20412. this.discardSlow(),
  20413. e && e()
  20414. }
  20415. .bind(this);
  20416. this._warpCameraAim(t, d)
  20417. }
  20418. ,
  20419. n.prototype.warpCommonParameters = function(e, t, i, n) {
  20420. this.model.skybox.material.uniforms.blackout.value = n;
  20421. var r = u.uniform(this.model.skybox, "progress", 1)
  20422. , o = u.allUniforms(this.model.chunks, "progress", 1)
  20423. , a = !1
  20424. , s = function() {
  20425. if (this.warpInterrupted)
  20426. return a = !0,
  20427. !0
  20428. }
  20429. .bind(this)
  20430. , l = function(e, t) {
  20431. return i && a ? (this.model.skybox.material.uniforms.progress.value = 0,
  20432. !0) : void r(e, t)
  20433. }
  20434. .bind(this)
  20435. , h = function(e, t) {
  20436. return i && a ? (o(0),
  20437. !0) : void o(e, t)
  20438. }
  20439. .bind(this);
  20440. p.start(s, e, null, t, null, "safeHaltWatch"),
  20441. p.start(l, e, null, t, d[c.warp.blendEasing], "skyboxProgress"),
  20442. p.start(h, e, null, t, d[c.warp.blendEasing], "chunkProgress")
  20443. }
  20444. ,
  20445. n.prototype.warpTravel_STD = function(e) {
  20446. 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),
  20447. 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;
  20448. w += this.warpLength * c.warp.timePerMeter,
  20449. c.warp.flySpeed > .01 && (w = 1e3 * this.warpLength / c.warp.flySpeed);
  20450. var _ = !1
  20451. , T = this.warpDestHeroLoc.quaternion
  20452. , x = new r.Vector3(0,0,-1).applyQuaternion(T).normalize()
  20453. , S = this.warpPathPoints[this.warpPathPoints.length - 1].clone().sub(this.warpPathPoints[this.warpPathPoints.length - 2]).normalize()
  20454. , M = S.dot(x)
  20455. , R = r.Math.radToDeg(Math.acos(M))
  20456. , P = function(e) {
  20457. var t = o
  20458. , i = r.Math.smoothstep(e, 0, t) * (1 - r.Math.smoothstep(e, 1 - t, 1));
  20459. return i
  20460. }
  20461. , O = function() {
  20462. return E.lookAt(C, t, A.UP),
  20463. s.setFromRotationMatrix(E, c.warp.eOrder),
  20464. m.setFromQuaternion(n.quaternion, c.warp.eOrder),
  20465. b.set(s.x - m.x, s.y - m.y, s.z - m.z, c.warp.eOrder),
  20466. h.constrainedTurn(b.y)
  20467. }
  20468. .bind(this)
  20469. , L = function(e, t) {
  20470. if (this.warpInterrupted)
  20471. return _ = !0,
  20472. !0
  20473. }
  20474. .bind(this)
  20475. , D = function(e, t) {
  20476. return _ || !this.warpPathPoints ? (g.blur(0),
  20477. !0) : void g.blur(e)
  20478. }
  20479. .bind(this)
  20480. , N = u.allUniforms(this.model.chunks, "modelAlpha", 1)
  20481. , B = function(e, t) {
  20482. return _ || !this.warpPathPoints ? (N(0),
  20483. !0) : void N(e, t)
  20484. }
  20485. .bind(this)
  20486. , F = function(e, t) {
  20487. if (!this.warpPathPoints)
  20488. return n.position.copy(this.warpDestPano.position),
  20489. !0;
  20490. if (_)
  20491. return !0;
  20492. var i = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, e);
  20493. n.position.copy(i),
  20494. C = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, .99 * e)
  20495. }
  20496. .bind(this)
  20497. , V = function(e, n) {
  20498. return this.warpPathPoints ? !!_ || void (t = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, Math.min(e + i, 1))) : (y.debug("Lost bunny."),
  20499. !0)
  20500. }
  20501. .bind(this)
  20502. , U = function(e, o) {
  20503. if (_)
  20504. return y.debug(">>>> Walkthrough interupted at t=" + e),
  20505. !0;
  20506. if (!this.warpPathPoints)
  20507. return !0;
  20508. var a = this.warpLength * e
  20509. , l = r.Math.smoothstep(a, 0, this.brushPrefs.lookBlendDist)
  20510. , u = r.Math.smoothstep(a, this.warpLength - this.brushPrefs.lookBlendDist, this.warpLength);
  20511. c.warp.matchCam && (l *= 1 - u),
  20512. E.lookAt(C, t, A.UP),
  20513. s.setFromRotationMatrix(E, c.warp.eOrder),
  20514. m.setFromQuaternion(n.quaternion, c.warp.eOrder),
  20515. b.set(s.x - m.x, s.y - m.y, s.z - m.z, c.warp.eOrder),
  20516. b.y = h.constrainedTurn(b.y),
  20517. s.x = m.x + l * b.x,
  20518. s.y = m.y + l * b.y,
  20519. s.z = m.z + l * b.z,
  20520. b.set(s.x - v.x, s.y - v.y, s.z - v.z, c.warp.eOrder),
  20521. b.y = h.constrainedTurn(b.y);
  20522. var d = r.Math.degToRad(c.warp.maxTurnPerSec) * o / 1e3;
  20523. b.y = Math.sign(b.y) * Math.min(d, Math.abs(b.y)),
  20524. v.x = v.x + b.x * c.warp.turnFriction,
  20525. v.y = v.y + b.y * c.warp.turnFriction,
  20526. v.z = v.z + b.z * c.warp.turnFriction,
  20527. v.x = Math.max(r.Math.degToRad(c.warp.minDownAngle), v.x);
  20528. var p = t.clone().sub(C).normalize();
  20529. if (R < c.warp.maxAimRotation && u > 0) {
  20530. var g = 1 - u;
  20531. p.x = p.x * g + u * S.x,
  20532. p.y = p.y * g + u * S.y,
  20533. p.z = p.z * g + u * S.z,
  20534. p.normalize()
  20535. }
  20536. this.bunnyObj.position.copy(n.position).add(p),
  20537. f.set(0, 0, -1).applyEuler(v).normalize(),
  20538. f.multiplyScalar(8),
  20539. f.add(n.position),
  20540. e > 1 - i && c.warp.matchCam || (n.controls.lookAt(f),
  20541. n.controls.lookVector.copy(f),
  20542. n.lookAt(f))
  20543. }
  20544. .bind(this)
  20545. , k = function() {
  20546. _ ? (this.discardSlow(),
  20547. this.upcomingTransType = l.BLACK,
  20548. this.warpTravel_BLACK(-.5, this.warpInterruptionTravelTime, I.BEGINNING, e)) : this._wrapupWarpShading(e)
  20549. }
  20550. .bind(this);
  20551. V(0);
  20552. var H = c.warp.motionLeadTime + 1e3 * Math.abs(O()) / r.Math.degToRad(c.warp.maxTurnPerSec);
  20553. w += H;
  20554. var G = H / w;
  20555. this.warpCommonParameters(w, G, !0, I.NONE),
  20556. p.start(L, w, null, 0, null, "_haltWatcher"),
  20557. c.warp.blur > 0 && (g.blurStrength = c.warp.blur,
  20558. p.start(D, w, null, G, P, "blurring")),
  20559. p.start(B, w, null, G, P, "modelAlpha"),
  20560. p.start(F, w, null, G, d[c.warp.blendEasing], "followPath"),
  20561. p.start(V, w, null, G, d[c.warp.blendEasing], "goBunny"),
  20562. p.start(U, w, k, 0, d[c.warp.blendEasing], "lookAtBunny")
  20563. }
  20564. ,
  20565. n.prototype.warpTravel_BLACK = function(e, t, i, n) {
  20566. var r = e || 0;
  20567. void 0 !== t && null !== t || (t = c.warp.teleportTime),
  20568. this.warpCommonParameters(t, r, !1, i),
  20569. this.model.chunks.forEach(function(e) {
  20570. e.material.uniforms.blackout.value = i
  20571. }),
  20572. this._warpBendAim(null, t, null, r);
  20573. var o = function() {
  20574. this.wrapupWarpShadingOnly(n, i);
  20575. }
  20576. .bind(this);
  20577. p.start(this.stepWarpPath.bind(this), t, o, r, d[c.warp.blendEasing], "stepMotion")
  20578. }
  20579. ,
  20580. n.prototype.flightStepWalk = function(e, t, i) {
  20581. var n = .001
  20582. , o = 1
  20583. , a = 1.2
  20584. , s = new r.Vector3
  20585. , h = new r.Vector3
  20586. , u = function(e, t) {
  20587. var i = Math.min(this.player.position.distanceTo(e.position), c.transition.flytimeMaxDistanceThreshold)
  20588. , r = i * c.transition.flytimeDistanceMultiplier + c.transition.flyTime;
  20589. h.copy(A.FORWARD),
  20590. this.player.getDirection(h),
  20591. s.copy(t).sub(e.position).normalize();
  20592. var l = s.dot(h)
  20593. , u = Math.acos(l)
  20594. , d = u / r;
  20595. return d > n && (r *= d / n,
  20596. u < o && (r *= a)),
  20597. r
  20598. };
  20599. return function(e, t, i) {
  20600. if (this.warpInterrupted)
  20601. i && i();
  20602. else if (this.activeTransType !== l.WALK)
  20603. this._clearWarpShading(),
  20604. this._warpStopFlying(),
  20605. this.player.spider.draw(),
  20606. this.placeCpm(),
  20607. i && i();
  20608. else if (this.player.currentPano !== e) {
  20609. var n = {
  20610. pano: e,
  20611. lookAtPoint: t,
  20612. duration: null,
  20613. maxDistanceOverride: c.warp.walkMaxDist,
  20614. skipWarpingCheck: !1,
  20615. constantMoveSpeed: !0
  20616. };
  20617. n.duration = u.call(this, e, t),
  20618. this.player.nonInterruptingFlyToPano(n, i)
  20619. } else
  20620. i && i()
  20621. }
  20622. }(),
  20623. n.prototype.makeWalkFlightFunc = function(e, t, i) {
  20624. return this.flightStepWalk.bind(this, e, t, i)
  20625. }
  20626. ,
  20627. n.prototype.warpTravel_WALK = function() {
  20628. var e = [];
  20629. return function(t) {
  20630. var i = this.player.model.panos;
  20631. e.length = 0;
  20632. for (var n = null, o = !1, a = 0; a < this.nodes.length; a++) {
  20633. var s = this.nodes[a]
  20634. , l = i.get(s);
  20635. a === this.nodes.length - 1;
  20636. o = n && l.position.distanceTo(n.position) < c.warp.walkMinDist,
  20637. n && o || (e.push(s),
  20638. n = l)
  20639. }
  20640. o && this.nodes.length > 1 && (e[e.length - 1] = this.nodes[this.nodes.length - 1]);
  20641. var h = e.length
  20642. , u = i.get(e[h - 1])
  20643. , d = new Array(h + 1);
  20644. d[d.length - 1] = function() {
  20645. t && t()
  20646. }
  20647. .bind(this);
  20648. for (var p = h - 1, f = d.length - 1; f > 0; f -= 1) {
  20649. var g = e[p];
  20650. u = i.get(g);
  20651. var m = new r.Vector3;
  20652. this.getLookAtForWalkingTourNode(e, p, m),
  20653. d[f - 1] = this.makeWalkFlightFunc(u, m, d[f]),
  20654. p--
  20655. }
  20656. d[0]()
  20657. }
  20658. }(),
  20659. n.prototype.getLookAtForWalkingTourNode = function() {
  20660. var e = new r.Vector3
  20661. , t = new r.Vector3
  20662. , i = new r.Vector3
  20663. , n = new r.Vector3
  20664. , o = new r.Vector3
  20665. , a = .65
  20666. , s = .75
  20667. , l = .2
  20668. , c = .4
  20669. , h = .2
  20670. , u = 3;
  20671. return function(r, d, p) {
  20672. var f = r.length;
  20673. if (d >= f)
  20674. return !1;
  20675. var g = 1
  20676. , m = 1;
  20677. t.set(0, 0, 0),
  20678. o.set(0, 0, 0);
  20679. for (var v = null, A = d; A < d + u && !(A >= f); A++) {
  20680. if (v = this.player.model.panos.get(r[A]),
  20681. this.getOrientationForWalkingTourNode(r, A, i),
  20682. A === d && e.copy(i),
  20683. n.copy(i),
  20684. A > d) {
  20685. var y = n.dot(e) < a;
  20686. g *= y ? l : s,
  20687. m *= y ? h : c
  20688. }
  20689. i.multiplyScalar(g),
  20690. t.add(i),
  20691. o.lerp(v.position, m)
  20692. }
  20693. return t.normalize(),
  20694. p.copy(o),
  20695. p.add(t),
  20696. !0
  20697. }
  20698. }(),
  20699. n.prototype.getOrientationForWalkingTourNode = function(e, t, i) {
  20700. var n = e.length;
  20701. if (t >= n)
  20702. return !1;
  20703. if (t === n - 1)
  20704. i.copy(A.FORWARD).applyQuaternion(this.warpDestHeroLoc.quaternion);
  20705. else {
  20706. var r = this.player.model.panos.get(e[t])
  20707. , o = this.player.model.panos.get(e[t + 1]);
  20708. i.copy(o.position).sub(r.position)
  20709. }
  20710. return i.normalize(),
  20711. !0
  20712. }
  20713. ,
  20714. n.prototype.warpCameraTravel = function(e, t, i, n) {
  20715. if (this.activeTransType = this.upcomingTransType,
  20716. this.lastTransType = this.activeTransType,
  20717. this.upcomingTransType = null,
  20718. !e) {
  20719. var r = function() {
  20720. this._wrapupTravel(n)
  20721. }
  20722. .bind(this)
  20723. , o = {
  20724. pano: this.warpDestPano,
  20725. lookAtPoint: null,
  20726. duration: null,
  20727. maxDistanceOverride: null,
  20728. skipWarpingCheck: !1
  20729. };
  20730. return void this.player.flyToPano(o, r)
  20731. }
  20732. this.activeTransType === l.BLACK ? this.warpTravel_BLACK(null, i, t, n) : this.activeTransType === l.WALK ? this.warpTravel_WALK(function() {
  20733. this._clearWarpShading(),
  20734. this._warpStopFlying(),
  20735. this.player.spider.draw(),
  20736. this.placeCpm(),
  20737. n && n()
  20738. }
  20739. .bind(this)) : this.warpTravel_STD(n)
  20740. }
  20741. ,
  20742. n.prototype.startWarpState = function() {
  20743. this.warping = !0,
  20744. this.warpInterrupted = !1,
  20745. this.warpInterruptionBlackoutStyle = null,
  20746. this.warpInterruptionTravelTime = null
  20747. }
  20748. ,
  20749. n.prototype.endWarpState = function() {
  20750. this.warping = !1
  20751. }
  20752. ,
  20753. n.prototype.warpToPano = function(e, t, i, n) {
  20754. if (this.warping)
  20755. return void y.warn("Cannot warp when already warping");
  20756. if (this.upcomingTransType = e,
  20757. this.activeTransType = null,
  20758. !this.setWarpDestPano())
  20759. return this.upcomingTransType = null,
  20760. void this.warpToNonPano(n);
  20761. if (this.player.mode !== a.PANORAMA)
  20762. return this.upcomingTransType = null,
  20763. this.discardSlow(),
  20764. void this.player.flyToNewMode({
  20765. mode: a.PANORAMA,
  20766. pano: this.warpDestPano,
  20767. duration: c.warp.outsideTime,
  20768. warpDest: this.warpDestHeroLoc,
  20769. callback: n,
  20770. force: !0
  20771. });
  20772. if (!this.warpDestPano)
  20773. return y.warn("no warp destination, callback dropped"),
  20774. void (this.upcomingTransType = null);
  20775. 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)
  20776. , o = this.chooseWarpPath(r);
  20777. if (o && this.upcomingTransType !== l.WALK) {
  20778. var s = function() {
  20779. this.waitingToWarp = !1,
  20780. this.warpToPano(e, t, i, n)
  20781. }
  20782. .bind(this);
  20783. if (this.player.checkAndWaitForPanoLoad(this.warpDestPano, "high", "low", this.player.basePanoSize, s))
  20784. return void (this.waitingToWarp = !0)
  20785. }
  20786. this.player.currentPano || (y.warn("Arrived at a very strange spot!"),
  20787. this.player.currentPano = this.warpDestPano,
  20788. this.placeCpm(),
  20789. this.fadeOutCpm(c.path.fadeOutTime),
  20790. this.player.spider.draw()),
  20791. y.debug("Warping to pano ", this.warpDestPano.position),
  20792. this.upcomingTransType !== l.WALK && this.player.emit(C.PanoChosen, this.player.currentPano, this.warpDestPano),
  20793. this.startWarpState();
  20794. var h = function() {
  20795. this.endWarpState(),
  20796. n && n()
  20797. }
  20798. .bind(this);
  20799. o ? this.warpCameraTravel(r, t, i, h) : this.warpCameraAim(h)
  20800. //this.player.smoothZoomToDefault(c.zoom.restoreTime);
  20801. }
  20802. ,
  20803. t.exports = n
  20804. }
  20805. ).call(this, "/js/objects/ShowPath.js")
  20806. }
  20807. , {
  20808. "../constants": 8,
  20809. "../effects": 16,
  20810. "../enum/BlackoutStyle": 18,
  20811. "../enum/ModelManagerEvents": 33,
  20812. "../enum/PlayerEvents": 40,
  20813. "../enum/RenderOrder": 42,
  20814. "../enum/Vectors": 50,
  20815. "../enum/Viewmode": 51,
  20816. "../enum/WarpStyle": 52,
  20817. "../gui/gui": 65,
  20818. "../model/ModelManager": 140,
  20819. "../objects/Snapshot": 153,
  20820. "../settings": 166,
  20821. "../shaders": 167,
  20822. "../util/easing": 186,
  20823. "../util/lerp": 188,
  20824. "../util/logger": 189,
  20825. "../util/math": 190,
  20826. "../util/texture": 194,
  20827. "../util/transitions": 195,
  20828. three: 217
  20829. }],
  20830. 152: [function(e, t, i) {
  20831. "use strict";
  20832. function n() {
  20833. var e = new r.SphereBufferGeometry(a.skyboxRadius,20,5)
  20834. , t = new r.RawShaderMaterial({
  20835. fragmentShader: o.skysphere.fragmentShader,
  20836. vertexShader: o.skysphere.vertexShader,
  20837. uniforms: r.UniformsUtils.clone(o.skysphere.uniforms),
  20838. side: r.BackSide,
  20839. name: "skysphere"
  20840. });
  20841. t.uniforms.radius.value = e.parameters.radius,
  20842. r.Mesh.call(this, e, t)
  20843. }
  20844. var r = e("three")
  20845. , o = e("../shaders")
  20846. , a = e("../settings");
  20847. n.prototype = Object.create(r.Mesh.prototype),
  20848. n.prototype.constructor = n,
  20849. t.exports = n
  20850. }
  20851. , {
  20852. "../settings": 166,
  20853. "../shaders": 167,
  20854. three: 217
  20855. }],
  20856. 153: [function(e, t, i) {
  20857. (function(i) {
  20858. "use strict";
  20859. function n(e) {
  20860. o.call(this, e),
  20861. this.sid = e.sid,//xzw add
  20862. this.panoId = e.panoId,
  20863. this.orthoZoom = e.orthoZoom,
  20864. this.floorVisibility = e.floorVisibility,
  20865. this.thumbUrl = e.thumbUrl,
  20866. this.name = e.name,
  20867. this.zoom = e.zoom
  20868. }
  20869. var r = (e("three"),
  20870. e("../util/logger"))
  20871. , o = (e("../settings"),
  20872. e("../enum/Viewmode"),
  20873. e("../util/common"),
  20874. e("../util/transitions"),
  20875. e("../util/lerp"),
  20876. e("../util/ajax"),
  20877. e("../util/texture"),
  20878. e("./View"));
  20879. e("events").EventEmitter,
  20880. new r(i);
  20881. n.prototype = Object.create(o.prototype),
  20882. n.prototype.isPano = function() {
  20883. return this.panoId && "" !== this.panoId && this.panoId != "outside"
  20884. }
  20885. ,
  20886. t.exports = n
  20887. }
  20888. ).call(this, "/js/objects/Snapshot.js")
  20889. }
  20890. , {
  20891. "../enum/Viewmode": 51,
  20892. "../settings": 166,
  20893. "../util/ajax": 181,
  20894. "../util/common": 185,
  20895. "../util/lerp": 188,
  20896. "../util/logger": 189,
  20897. "../util/texture": 194,
  20898. "../util/transitions": 195,
  20899. "./View": 154,
  20900. events: 202,
  20901. three: 217
  20902. }],
  20903. 154: [function(e, t, i) {
  20904. (function(i) {
  20905. "use strict";
  20906. function n(e) {
  20907. e = e || {},
  20908. this.position = new r.Vector3,
  20909. this.quaternion = new r.Quaternion,
  20910. this.update(e)
  20911. }
  20912. var r = e("three")
  20913. , o = e("../util/logger")
  20914. , a = (e("../settings"),
  20915. e("../enum/Viewmode"),
  20916. e("../util/common"),
  20917. e("../util/transitions"),
  20918. e("../util/lerp"),
  20919. e("../util/ajax"),
  20920. e("../util/texture"),
  20921. e("events").EventEmitter);
  20922. new o(i);
  20923. n.prototype = Object.create(a.prototype),
  20924. n.prototype.isValid = function() {
  20925. return !!this.cameraMode
  20926. }
  20927. ,
  20928. n.prototype.update = function(e) {
  20929. return this.cameraMode = e.cameraMode || this.cameraMode,
  20930. this.pano = e.pano || this.pano,
  20931. e.position && this.position.copy(e.position),
  20932. e.quaternion && this.quaternion.copy(e.quaternion),
  20933. this
  20934. }
  20935. ,
  20936. t.exports = n
  20937. }
  20938. ).call(this, "/js/objects/View.js")
  20939. }
  20940. , {
  20941. "../enum/Viewmode": 51,
  20942. "../settings": 166,
  20943. "../util/ajax": 181,
  20944. "../util/common": 185,
  20945. "../util/lerp": 188,
  20946. "../util/logger": 189,
  20947. "../util/texture": 194,
  20948. "../util/transitions": 195,
  20949. events: 202,
  20950. three: 217
  20951. }],
  20952. 155: [function(e, t, i) {//player.js
  20953. (function(i) {
  20954. "use strict";
  20955. function n(e) {
  20956. this.currentPano = null,
  20957. this.nextPano = null,
  20958. this.camera = null,
  20959. this.paused = !1,
  20960. this.flying = !1,
  20961. this.sceneIntersectionPlane = null,
  20962. this.target = new r.Vector3,
  20963. this.mouse = new r.Vector3(1.1,1.1,.5),
  20964. this.mouseAtMouseDown = new r.Vector2,
  20965. this.mouseCouldBeClickToMove = !1,
  20966. this.mouseLastMoveTime = Date.now(),
  20967. this.mouseDown = !1,
  20968. this.mouseDownTimer = null,
  20969. this.couldBeLongTap = !1,
  20970. this.containsMouse = !0,
  20971. this.isTouchEvent = !1,
  20972. this.isPanoHover = !1,
  20973. this.reticule = new a(this),
  20974. this.panoMarkers = [],
  20975. this.spider = new h(this),
  20976. this.quaternion = new r.Quaternion,
  20977. this.position = new r.Vector3(15,10,15),
  20978. this.previousState = null,
  20979. this.lastInsideView = new c,
  20980. this.last360View = new c,
  20981. this.raycaster = new r.Raycaster,
  20982. this.intersect = null,
  20983. this.lastChangeTime = Date.now(),
  20984. this.history = new I,
  20985. this.cameraControls = null,
  20986. this.path = null,
  20987. this.model = null,
  20988. this.domElement = null,
  20989. this.cachedPanoCandidates = null,
  20990. this.basePanoSize = 0,
  20991. this.standardPanoSize = 0,
  20992. this.highPanoSize = 0,
  20993. this.ultraHighPanoSize = 0,
  20994. this.zoomLevel = 1,
  20995. this.zooming = 0,
  20996. this.zoomSpeed = .5,
  20997. this.scrollZoomSpeed = .06,
  20998. this.zoomSpeedAdjust = .05,
  20999. this.defaultZoomIncrement = .2,
  21000. this.baseFov = f.insideFOV,
  21001. this.zoomFov = this.baseFov,
  21002. this.zoomEnabled = !0,
  21003. this.preRenderingEnabled = !1,
  21004. this.setupCustomProperties(e),
  21005. this.zoomStats = new L
  21006. }
  21007. var r = e("three")
  21008. , o = e("./util/logger")
  21009. , a = e("./objects/Reticule")
  21010. , s = e("./objects/Panorama")
  21011. , l = e("./objects/ShowPath")
  21012. , c = e("./objects/View")
  21013. , h = (e("./objects/Snapshot"),
  21014. e("./objects/NSpider"))
  21015. , u = e("./enum/Viewmode")
  21016. , d = (e("./enum/TagStates"),
  21017. e("./enum/Vectors"))
  21018. , p = e("./enum/Keys")
  21019. , f = (e("./enum/AlignmentType"),
  21020. e("./settings"))
  21021. , g = e("./util/common")
  21022. , m = (e("./util/browser"),
  21023. e("./util/math"))
  21024. , v = e("./util/lerp")
  21025. , A = e("./util/easing")
  21026. , y = e("./util/transitions")
  21027. , C = e("events").EventEmitter
  21028. , I = (e("./shaders"),
  21029. e("./util/history"))
  21030. , E = (e("./util/camera"),
  21031. e("./model/ModelManager"),
  21032. e("./enum/PathDiscardMode"))
  21033. , b = e("./enum/PathDisplayMode")
  21034. , w = e("./enum/PlayerEvents")
  21035. , _ = e("./enum/ControlEvents")
  21036. , T = e("./enum/ModelManagerEvents")
  21037. , x = e("./enum/WarpStyle")
  21038. , S = e("./enum/BlackoutStyle")
  21039. , M = e("./exception/BasicException")
  21040. , R = e("./enum/PanoSizeClass")
  21041. , P = (e("./tile/TileDownloader"),
  21042. e("./tile/TilePrioritizer"))
  21043. , O = (e("./enum/PanoramaEvents"),
  21044. e("./enum/ZoomEvents"))
  21045. , L = e("./util/ZoomStats")
  21046. , D = e("./constants")
  21047. , N = e("./util/common")
  21048. , B = e("./util/cameraLight")
  21049. , Hot = e('hot')
  21050. , F = new o(i)
  21051. , V = Object.freeze({
  21052. FlyToPano: y.getUniqueId(),
  21053. FlyToNewMode: y.getUniqueId(),
  21054. FlyToSameMode: y.getUniqueId(),
  21055. FlyToViewFloor: y.getUniqueId(),
  21056. LookTransition: y.getUniqueId(),
  21057. ZoomTransition: y.getUniqueId()
  21058. });
  21059. n.prototype = Object.create(C.prototype),
  21060. n.prototype.init = function(e) {
  21061. window.player = this
  21062. this.modelManager = e.modelManager,
  21063. this.tileDownloader = e.tileDownloader,
  21064. this.panoRenderer = e.panoRenderer,
  21065. this.qualityManager = e.qualityManager,
  21066. this.domElement = e.container,
  21067. this.camera = e.camera,
  21068. this.tagManager = e.tagManager,
  21069. this.cameraControls = e.controls,
  21070. this.path = new l(e.director,this,e.controls),
  21071. this.basePanoSize = this.qualityManager.getPanoSize(R.BASE),
  21072. this.standardPanoSize = this.qualityManager.getPanoSize(R.STANDARD),
  21073. this.highPanoSize = this.qualityManager.getPanoSize(R.HIGH),
  21074. this.ultraHighPanoSize = this.qualityManager.getPanoSize(R.ULTRAHIGH),
  21075. this.tileDownloader.processPriorityQueue = !1,
  21076. this.tileDownloader.tilePrioritizer = new P(this.qualityManager,this.basePanoSize,this.standardPanoSize,this.highPanoSize,this.ultraHighPanoSize),
  21077. this.bindEvents(e.container),
  21078. this.updateModel()
  21079. }
  21080. //xzw add: 截图
  21081. function dataURLtoBlob(dataurl) {
  21082. var arr = dataurl.split(','), mime = arr[0].match(/:(.*?);/)[1],
  21083. bstr = atob(arr[1]), n = bstr.length, u8arr = new Uint8Array(n);
  21084. while(n--){
  21085. u8arr[n] = bstr.charCodeAt(n);
  21086. };
  21087. return new Blob([u8arr], {type:mime});
  21088. }
  21089. n.prototype.screenShot = function(o){
  21090. if(this.flying || this.flyingToTag) return;
  21091. var R = this.sceneRenderer;
  21092. R.updateScreenSize(o);
  21093. for(var i in this.model.panos.index){
  21094. if(!this.model.panos.index[i].marker) continue;
  21095. this.model.panos.index[i].marker.forceHide = this.model.panos.index[i].marker.visible;
  21096. this.model.panos.index[i].marker.visible = false;
  21097. }
  21098. for(var i in this.model.hots){
  21099. this.model.hots[i].mesh.visible = false;
  21100. }
  21101. this.reticule.visible = false;
  21102. this.reticule.forceUnvisible = true;
  21103. this.path.currentPanoMarker.mesh.visible = false;
  21104. setTimeout(function(){//因resize效用没办法立即生效(原因未知),故而延后
  21105. R.renderer.clear(true,true,true);
  21106. R.renderer.render(R.scene, R.camera);
  21107. var imgData = R.renderer.domElement.toDataURL(o.type,0.9);
  21108. o.f && o.f(imgData)
  21109. R.updateScreenSize({resize:true});
  21110. this.reticule.visible = true;
  21111. for(var i in this.model.hots){
  21112. this.model.hots[i].mesh.visible = true;
  21113. }
  21114. for(var i in this.model.panos.index){
  21115. this.model.panos.index[i].marker.visible = this.model.panos.index[i].marker.forceHide;
  21116. }
  21117. this.path.currentPanoMarker.mesh.visible = true;
  21118. R.renderer.render(R.scene, R.camera);
  21119. }.bind(this),30) //这个数字不能太小
  21120. }
  21121. var scaleImg = e("scaleImg");
  21122. var ResizeImg = function(img, option){
  21123. var img2; //不能直接改img 否则可能触发第二次img.onload
  21124. var compress = function(ratio,type){
  21125. var image = img2 || img;
  21126. var c = document.createElement('canvas');
  21127. c.width = image.width; c.height = image.height;
  21128. var ctx = c.getContext('2d');
  21129. ctx.drawImage(image,0,0,image.width,image.height);
  21130. img2 = scaleImg(ratio/* option.maxSize/oldSize */, c, type/* option.type||"png" */);//最大不能超过0.8M
  21131. }
  21132. var reCom = function(){ //如果有了img2 就只需要img2 否则创造新的img2
  21133. var image = img2 || img;
  21134. var blob = dataURLtoBlob(image.src);
  21135. if(option.maxWeight && blob.size > option.maxWeight){
  21136. compress(option.maxWeight/blob.size, "jpeg")
  21137. blob = dataURLtoBlob(image.src);
  21138. }
  21139. if(!img2){
  21140. img2 = new Image();
  21141. }
  21142. img2.base64Src = image.src;
  21143. img2.src = window.URL.createObjectURL(blob);
  21144. }
  21145. var oldSize = Math.max(img.width, img.height);
  21146. if(option.toType != "png"){//不是非要png的话
  21147. if(option.oldType == "jpeg"){//jpeg先判断尺寸,然后是尺寸
  21148. if(oldSize > option.maxSize){
  21149. compress(option.maxSize/oldSize, "jpeg");
  21150. }
  21151. reCom();
  21152. }else if(option.oldType == "png"){//png先判断数据量 如果数据量达标,就无视大小(有可能超出大小)
  21153. if(option.maxWeight && option.weight > option.maxWeight){//如果一开始大小不大就不压缩 还是png
  21154. compress(oldSize>option.maxSize ? option.maxSize/oldSize : 1, "jpeg");
  21155. reCom();
  21156. }
  21157. }
  21158. }else{
  21159. //?貌似png会越压缩越大?
  21160. }
  21161. return img2 || img;
  21162. }
  21163. var _fixType=function(type) {
  21164. type = type.toLowerCase().replace(/jpg/i, 'jpeg');
  21165. var r = type.match(/png|jpeg|bmp|gif/)[0];
  21166. return 'image/' + r;
  21167. };
  21168. var saveFile=function(data, filename){
  21169. var save_link = document.createElementNS('http://www.w3.org/1999/xhtml', 'a');
  21170. save_link.href = data;
  21171. save_link.download = filename;
  21172. var event = document.createEvent('MouseEvents');
  21173. event.initMouseEvent('click', true, false, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
  21174. save_link.dispatchEvent(event);
  21175. };
  21176. n.prototype.getWrapShot = function(){ //获取导览点截图/初始画面和信息
  21177. var info = this.getSnapAngleInfo();
  21178. var str = ',{\r\t' + info;
  21179. var arg = arguments[0];
  21180. this.screenShot({ width:g_snapShotWidth*4, height:g_snapShotHeight*4, type:"image/jpeg", f:function(imgData){
  21181. if (arg && arg.__callback) {
  21182. return arg.__callback(imgData, info)
  21183. }
  21184. var img = new Image();
  21185. img.src = imgData;
  21186. img.onload = function(){
  21187. var img2 = ResizeImg(this,{maxSize: g_snapShotWidth, oldType:"jpeg"}); //暂定缩略图大小
  21188. img2.src.replace(_fixType("image/jpeg"),'image/octet-stream');
  21189. var filename = "snap" + (new Date()).getTime();
  21190. saveFile(img2.src,filename + ".jpg");
  21191. str +=(',\r\t"thumbnail_signed_src":"'+filename+'.jpg",');
  21192. str +=('\r\t"sid":"'+filename+'",');
  21193. str +=('\r\t"name":"'+filename+'"\r}');
  21194. logData(str)
  21195. }
  21196. }});
  21197. }
  21198. ,
  21199. n.prototype.getSnapAngleInfo = function(){
  21200. var info = {};
  21201. var str = '"metadata":{';
  21202. var q = this.camera.quaternion.clone();
  21203. switch (this.mode) {
  21204. case "panorama":
  21205. info.scan_id = this.currentPano.id;
  21206. str += ('"scan_id":"'+this.currentPano.id+'",');
  21207. break;
  21208. case "floorplan":
  21209. info.camera_mode = 1;
  21210. q = (new r.Quaternion).setFromAxisAngle(new r.Vector3(0,1,0), r.Math.degToRad(90))
  21211. q.multiply(this.camera.quaternion);
  21212. str += ('"camera_mode":1,');
  21213. //str += ('"ortho_zoom":'+m.toPrecision(this.cameraControls.activeControl.currentScale * $("#player").height() / $("#player").width() * D.workshopApsect * 16, 4)+",");
  21214. str += ('"ortho_zoom":'+ m.toPrecision(this.cameraControls.activeControl.currentScale, 4 )+",");
  21215. break;
  21216. case "dollhouse":
  21217. info.camera_mode = 2;
  21218. str += ('"camera_mode":2,');
  21219. break;
  21220. }
  21221. info.camera_position = m.toPrecision(this.camera.position.toArray(),4);
  21222. console.log(info.camera_position)
  21223. if(window.screenSta === 'tour'){ // fyz 导览截屏需要做额外的
  21224. /**fyz 对相机截屏的角度进行校对 */
  21225. var out = new r.Quaternion(q.x, q.y, q.z, q.w)
  21226. out.multiply(new r.Quaternion(Math.sqrt(2) / 2, Math.sqrt(2) / 2, 0, 0).conjugate())
  21227. out.x *= -1;
  21228. out.w *= -1;
  21229. info.camera_quaternion = m.toPrecision(out.toArray(),4);
  21230. }else{
  21231. info.camera_quaternion = m.toPrecision(q.toArray(),4);;
  21232. }
  21233. info.zoom = this.zoomLevel;
  21234. console.log(info.camera_quaternion)
  21235. // str += ( '"camera_position":['+ info.camera_position + '],"camera_quaternion":['+info.camera_quaternion+"]}");
  21236. // fyz 扩展编辑页面, 加上导览点缩放值
  21237. str += ( '"camera_position":['+ info.camera_position + '],"camera_quaternion":['+info.camera_quaternion+'], "zoom":' + info.zoom + '}');
  21238. return str;
  21239. }
  21240. //------end
  21241. n.prototype.closePopup = function() {//xzw 关闭热点页面
  21242. if(!g_currentHot) return;
  21243. g_currentHot = null;
  21244. var hotPop = document.getElementById('popup');
  21245. hotPop.style.display = "none";
  21246. document.querySelector(".popup-content").removeChild(document.getElementById("id1"));
  21247. $("#popup iframe:last").remove();
  21248. var _bgaudio = document.getElementById("bgaudio");
  21249. //判断音乐是否暂停或者是否存在
  21250. /* if(g_bgAudio && g_bgAudio.paused && g_bgAudio.readyState != 0 && g_play === 1)
  21251. {
  21252. //g_bgAudio.play();
  21253. manage.switchBgmState(true)
  21254. }; */
  21255. if(g_bgAudio && g_bgAudio.pauseByHot){
  21256. manage.switchBgmState(true)
  21257. }
  21258. //$('#player').off("click",this.closePopup);
  21259. return false
  21260. }
  21261. n.prototype.setupCustomProperties = function(e) {
  21262. var t = e || u.PANORAMA;
  21263. Object.defineProperty(this, "mode", {
  21264. get: function() {
  21265. return t
  21266. },
  21267. set: function(e) {
  21268. var i = t;
  21269. t = e,
  21270. this.onModeUpdated(i, t)
  21271. }
  21272. })
  21273. }
  21274. ,
  21275. n.prototype.isInMode = function() {
  21276. for (var e = 0; e < arguments.length; e++)
  21277. if (this.mode === arguments[e])
  21278. return !0;
  21279. return !1
  21280. }
  21281. ,
  21282. n.prototype.isOutsideMode = function(e) {
  21283. return e = e || this.mode,
  21284. e === u.DOLLHOUSE || e === u.FLOORPLAN
  21285. }
  21286. ,
  21287. n.prototype.is360View = function(e, t) {
  21288. return e === u.PANORAMA && t && !t.isAligned()
  21289. }
  21290. ,
  21291. n.prototype.setScene = function(e) {
  21292. this.sceneIntersectionPlane = e.plane,
  21293. this.path.setScene(e),
  21294. this.moveReticuleToScene(e)
  21295. }
  21296. ,
  21297. n.prototype.moveReticuleToScene = function(e) {
  21298. this.reticule.parent && this.reticule.parent.remove(this.reticule),
  21299. e.add(this.reticule)
  21300. }
  21301. ,
  21302. n.prototype.updateModel = function() {
  21303. function e(e, t, n) {
  21304. this.mode === u.DOLLHOUSE && e !== n && i.call(this, e.center.y)
  21305. }
  21306. function t(e, t) {
  21307. if (this.mode === u.DOLLHOUSE) {
  21308. var n = e ? this.model.center.y : n = t.center.y;
  21309. i.call(this, n)
  21310. }
  21311. }
  21312. function i(e) {
  21313. var t = this.cameraControls.cameras[u.DOLLHOUSE]
  21314. , i = this.cameraControls.controls[u.DOLLHOUSE]
  21315. , n = t.position.y + (e - i.target.y)
  21316. , r = f.showFloorDuration + f.showFloorDelay;
  21317. y.start(v.property(i.target, "y", e), r, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToViewFloor),
  21318. y.start(v.property(t.position, "y", n), r, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToViewFloor)
  21319. }
  21320. this.model = this.modelManager.getActiveModel(),
  21321. this.model.on("floor.changed", e.bind(this)),
  21322. this.model.on("allfloors.toggled", t.bind(this)),
  21323. this.on(w.PanoChosen, this.model.setProjectedPanos.bind(this.model));
  21324. /*******************************************************************VR fyz改 from徐世廷*******************************************************************/
  21325. var e2 = this;
  21326. this.model.panos.list.forEach(function(a) {
  21327. a.vrMarker.addEventListener("click", function() {
  21328. e2.flyToPano({
  21329. pano: a
  21330. })
  21331. })
  21332. })
  21333. /********************************************************************************************************************************************/
  21334. }
  21335. ,
  21336. n.prototype.updateModelDependentData = function() {
  21337. this.cameraControls.setModelForControls(this.model),
  21338. this.getPanoMarkersFromModel(this.model)
  21339. }
  21340. ,
  21341. n.prototype.onModelChanged = function() {
  21342. this.updateModel(),
  21343. this.updateModelDependentData()
  21344. }
  21345. ,
  21346. n.prototype.getPanoMarkersFromModel = function(e) {
  21347. this.panoMarkers = e.panos.list.reduce(function(e, t) {
  21348. return t.marker ? e.concat(t.marker) : e
  21349. }, [])
  21350. }
  21351. ,
  21352. n.prototype.handleControlMove = function(e) {
  21353. this.emit(w.Move, e)
  21354. }
  21355. ,
  21356. n.prototype.handleControlInputStart = function(e) {
  21357. this.emit(w.InputStart, e)
  21358. }
  21359. ,
  21360. n.prototype.onModeUpdated = function(e, t) {
  21361. this.cameraControls.activateControls(t),
  21362. this.emit(w.ModeChanged, e, t)
  21363. }
  21364. ,
  21365. n.prototype.isWarping = function() {
  21366. return this.path.warping
  21367. }
  21368. ,
  21369. n.prototype.isWaitingToWarp = function() {
  21370. return this.path.waitingToWarp
  21371. }
  21372. ,
  21373. n.prototype.getLabelScaleFactor = function() {
  21374. if (this.isOutsideMode()) {
  21375. var e = 10
  21376. , t = Math.sqrt(this.cameraControls.controls[u.FLOORPLAN].currentScale / e);
  21377. return t
  21378. }
  21379. return .5
  21380. }
  21381. ,
  21382. n.prototype.changeMusic = function() {//xzw add
  21383. /* if(!this.director.tourIsPlaying && g_play && g_bgAudio){
  21384. g_playAudio = g_bgAudio;
  21385. //g_bgAudio.play();
  21386. manage.switchBgmState(true)
  21387. }else{
  21388. if(!g_play){
  21389. g_playAudio = g_bgAudio;
  21390. }else{//防止再次播放时重播一遍
  21391. g_playAudio = null;
  21392. }
  21393. } */
  21394. /* if(!this.director.tourIsPlaying && g_bgAudio){
  21395. manage.switchBgmState(true)
  21396. } */
  21397. if(!this.director.tourIsPlaying) this.director.bgmReplay()
  21398. }
  21399. ,
  21400. n.prototype.bindEvents = function(e) {
  21401. e !== document && e.setAttribute("tabindex", -1),
  21402. e.addEventListener("mousedown", this.onMouseDown.bind(this)),
  21403. e.addEventListener("mousemove", this.onMouseMove.bind(this)),
  21404. e.addEventListener("mouseover", this.onMouseOver.bind(this)),
  21405. e.addEventListener("mouseout", this.onMouseOut.bind(this)),
  21406. e.addEventListener("mouseup", this.onMouseUp.bind(this)),
  21407. this.modelManager.on(T.ActiveModelChanged, this.onModelChanged.bind(this)),
  21408. e.addEventListener("touchstart", this.onTouchStart.bind(this)),
  21409. e.addEventListener("touchmove", this.onTouchMove.bind(this)),
  21410. e.addEventListener("touchend", this.onTouchEnd.bind(this)),
  21411. e.addEventListener("pointerdown", this.onPointerDown.bind(this)),
  21412. e.addEventListener("pointermove", this.onPointerMove.bind(this)),
  21413. e.addEventListener("pointerup", this.onPointerUp.bind(this)),
  21414. e.addEventListener("pointerout", this.onPointerOut.bind(this)),
  21415. e.addEventListener("pointercancel", this.onPointerCancel.bind(this)),
  21416. document.addEventListener("keydown", this.onKeyDown.bind(this)),
  21417. this.cameraControls.on(_.Move, this.handleControlMove.bind(this)),
  21418. this.cameraControls.on(_.InputStart, this.handleControlInputStart.bind(this)),
  21419. this.cameraControls.on(_.Pinch, this.handleControlPinch.bind(this)),
  21420. this.cameraControls.on(_.Scroll, this.handleControlScroll.bind(this)),
  21421. window.addEventListener("snapshotBegin", this.getWrapShot.bind(this)),//xzw add
  21422. window.addEventListener("tourAudioEnded", this.changeMusic.bind(this));//xzw add
  21423. // lzb
  21424. window.getSeft && getSeft(this);
  21425. //判断是否是移动端,如果是给关闭按钮添加touchstart事件
  21426. if(/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)){
  21427. $('#closepop').on("touchstart",this.closePopup.bind(this));
  21428. }else{
  21429. $('#closepop').on("click",this.closePopup.bind(this));
  21430. }
  21431. }
  21432. ,
  21433. n.prototype.onMouseDown = function(e) {
  21434. e.currentTarget !== document && e.currentTarget.focus(),
  21435. 0 === e.button && (this.handleInputStart.call(this, e.clientX, e.clientY, !1),
  21436. this.updateIntersect())
  21437. }
  21438. ,
  21439. n.prototype.onMouseMove = function(e) {
  21440. this.isTouchEvent = !1,
  21441. this.handleInputMove.call(this, e.clientX, e.clientY, !1)
  21442. }
  21443. ,
  21444. n.prototype.onMouseOver = function(e) {
  21445. this.containsMouse = !0,
  21446. !this.mouseDown || 0 !== e.which && 0 !== e.buttons || (this.mouseDown = !1)
  21447. }
  21448. ,
  21449. n.prototype.onMouseOut = function(e) {
  21450. this.containsMouse = !1
  21451. }
  21452. ,
  21453. n.prototype.onMouseUp = function(e) {
  21454. this.handleInputEnd.call(this, e.clientX, e.clientY, !1);
  21455. }
  21456. ,
  21457. n.prototype.onTouchStart = function(e) {
  21458. if (e.currentTarget !== document && e.currentTarget.focus(),
  21459. !this.mouseDown) {
  21460. this.couldBeLongTap = !0;
  21461. var t = g.average(e.changedTouches, "clientX")
  21462. , i = g.average(e.changedTouches, "clientY");
  21463. this.handleInputStart.call(this, t, i, !0),
  21464. this.mouseDownTimer = setTimeout(function() {
  21465. this.updateIntersect(),
  21466. this.handleInputEnd.call(this, t, i, !0)
  21467. }
  21468. .bind(this), f.input.longTapThreshold)
  21469. }
  21470. }
  21471. ,
  21472. n.prototype.onTouchMove = function(e) {
  21473. var t = g.average(e.changedTouches, "clientX")
  21474. , i = g.average(e.changedTouches, "clientY");
  21475. this.handleInputMove.call(this, t, i, !0)
  21476. }
  21477. ,
  21478. n.prototype.onTouchEnd = function(e) {
  21479. if (clearTimeout(this.mouseDownTimer),
  21480. this.mouseDown) {
  21481. this.couldBeLongTap = !1,
  21482. this.updateIntersect();
  21483. var t = g.average(e.changedTouches, "clientX")
  21484. , i = g.average(e.changedTouches, "clientY");
  21485. this.handleInputEnd.call(this, t, i, !0)
  21486. }
  21487. }
  21488. ,
  21489. n.prototype.onPointerDown = function(e) {
  21490. return e.currentTarget !== document && e.currentTarget.focus(),
  21491. this.mouseDown || "mouse" === e.pointerType ? this.onMouseDown(e) : (this.couldBeLongTap = !0,
  21492. this.handleInputStart.call(this, e.clientX, e.clientY, !0),
  21493. void (this.mouseDownTimer = setTimeout(function() {
  21494. this.updateIntersect(),
  21495. this.handleInputEnd.call(this, e.clientX, e.clientY, !0)
  21496. }
  21497. .bind(this), f.input.longTapThreshold)))
  21498. }
  21499. ,
  21500. n.prototype.onPointerMove = function(e) {
  21501. "mouse" !== e.pointerType ? this.handleInputMove.call(this, e.clientX, e.clientY, !0) : this.onMouseMove(e)
  21502. }
  21503. ,
  21504. n.prototype.onPointerUp = function(e) {
  21505. return this.mouseDown && "mouse" !== e.pointerType ? (clearTimeout(this.mouseDownTimer),
  21506. this.couldBeLongTap = !1,
  21507. this.updateIntersect(),
  21508. void this.handleInputEnd.call(this, e.clientX, e.clientY, !0)) : this.onMouseUp(e)
  21509. }
  21510. ,
  21511. n.prototype.onPointerOut = function(e) {
  21512. this.mouseDown = !1
  21513. }
  21514. ,
  21515. n.prototype.onPointerCancel = function(e) {
  21516. this.mouseDown = !1
  21517. }
  21518. ,
  21519. n.prototype.onKeyDown = function(e) {
  21520. var t = function() {
  21521. this.cameraControls.activeControl && this.cameraControls.activeControl.emit(_.Move, "key")
  21522. }
  21523. .bind(this)
  21524. , i = e.which;
  21525. switch (i) {
  21526. case p.F:
  21527. t(),
  21528. this.changeFloor(-1);
  21529. break;
  21530. case p.R:
  21531. t(),
  21532. this.changeFloor(1)
  21533. }
  21534. if (this.mode === u.PANORAMA)
  21535. switch (i) {
  21536. case p.UPARROW:
  21537. case p.W:
  21538. this.flyLocalDirection(d.FORWARD.clone());
  21539. break;
  21540. case p.DOWNARROW:
  21541. case p.S:
  21542. this.flyLocalDirection(d.BACK.clone());
  21543. break;
  21544. case p.A:
  21545. this.flyLocalDirection(d.LEFT.clone());
  21546. break;
  21547. case p.D:
  21548. this.flyLocalDirection(d.RIGHT.clone())
  21549. }
  21550. }
  21551. ,
  21552. n.prototype.handleScrollPinchZoom = function() {
  21553. return function(e) {
  21554. var t = e
  21555. , i = this.zoomLevel;
  21556. this.zoomBy(t),
  21557. this.currentPano && this.zoomStats.addZoomAction(i, this.zoomLevel, this.currentPano.id)
  21558. }
  21559. }(),
  21560. n.prototype.handleControlPinch = function(e) {
  21561. f.zoom.enabled ? this.handleScrollPinchZoom(1 - e) : this.flyLocalDirection(new r.Vector3(0,0,e).normalize())
  21562. }
  21563. ,
  21564. n.prototype.handleControlScroll = function(e) {
  21565. f.zoom.enabled ? (e > 0 ? e = 1 + this.scrollZoomSpeed : e < 0 && (e = 1 - this.scrollZoomSpeed),
  21566. 0 !== e && this.handleScrollPinchZoom(e)) : this.flyLocalDirection(new r.Vector3(0,0,-e).normalize())
  21567. }
  21568. ,
  21569. n.prototype.handleInputStart = function(e, t, i) {
  21570. //许钟文加
  21571. var pad = this.handelPadding(e, t);
  21572. e = pad.x;
  21573. t = pad.y;
  21574. this.isTouchEvent = i,
  21575. m.convertScreenPositionToNDC(e, t, this.mouse),
  21576. m.convertScreenPositionToNDC(e, t, this.mouseAtMouseDown),
  21577. this.mouseCouldBeClickToMove = !0,
  21578. this.mouseDown = !0;
  21579. if (this.mouseCouldBeClickToMove) {
  21580. //window.DownInterface && new DownInterface().state(this,Hot);
  21581. window.Hotpoint && new Hotpoint().state(this,Hot);
  21582. }
  21583. if( this.overlayGroup.children.length){
  21584. this.overlayGroup.children.forEach((overlay)=>{
  21585. overlay.overlayType == "video" /* && overlay.inSight */&& overlay.plane.material.map.image.play()
  21586. })
  21587. //this.overlayInitedPlay = true
  21588. }
  21589. }
  21590. ,
  21591. n.prototype.handelPadding = function(x, y) {
  21592. //去除player左边和上面的宽高,因为pc的player左上有其他element 许钟文
  21593. if (!this.pad)
  21594. this.pad = {
  21595. x: dom.getOffset("left", $("#player")[0]),
  21596. y: dom.getOffset("top", $("#player")[0])
  21597. }
  21598. return {
  21599. x: x - this.pad.x,
  21600. y: y - this.pad.y
  21601. }
  21602. }
  21603. n.prototype.handleInputMove = function(e, t, i) {
  21604. //许钟文加
  21605. var pad = this.handelPadding(e, t);
  21606. e = pad.x;
  21607. t = pad.y;
  21608. this.isTouchEvent = i,
  21609. m.convertScreenPositionToNDC(e, t, this.mouse),
  21610. this.mouseAtMouseDown.distanceTo(this.mouse) > f.input.moveToleranceNDC && (this.mouseCouldBeClickToMove = !1,
  21611. this.couldBeLongTap = !1,
  21612. clearTimeout(this.mouseDownTimer)),
  21613. this.mouseLastMoveTime = Date.now(),
  21614. this.reticule.move(e, t, i)
  21615. }
  21616. ,
  21617. n.prototype.handleInputEnd = function(e, t, i) {//xzw
  21618. if (this.isTouchEvent = i,
  21619. this.mouseDown = !1,
  21620. this.cameraControls.controls[u.PANORAMA].emit("interaction.direct"),
  21621. !i && this.couldBeLongTap)
  21622. return !0;
  21623. if (this.handleLongTap())
  21624. return !0;
  21625. if (this.mouseCouldBeClickToMove) {
  21626. if (this.flying)
  21627. return this.path.activeTransType === x.WALK && this.emit(w.WarpInterruptedWithFlyTo, this.path.activeTransType),
  21628. !0;
  21629. //add----
  21630. if(this.checkHotClick())//add
  21631. return !0;
  21632. if(this.hoveringPlane){
  21633. this.clickOverlay(this.hoveringPlane)
  21634. return;
  21635. }
  21636. if (this.cameraControls.activeControl && this.cameraControls.activeControl.emit(_.Move, this.isTouchEvent ? "touch" : "mouse"),
  21637. this.history.invalidate(),
  21638. this.intersect && (this.mode == "panorama" || !window.MP_PREFETCHED_MODELDATA.flyInOnlyBySwitch))// 改
  21639. return this.flyToPanoClosestToMouse();
  21640. if (this.mode === u.PANORAMA) {
  21641. var n = this.closestPanoInDirection(this.getMouseDirection());
  21642. return n ? this.flyToPano({
  21643. pano: n
  21644. }) : this.bump(this.getMouseDirection())
  21645. }
  21646. }
  21647. this.intersect && this.closestPano && this.closestPano.hoverOff(this.mode)
  21648. }
  21649. ,
  21650. n.prototype.handleLongTap = function() {
  21651. if (this.couldBeLongTap && (!this.isPanoHover || this.mode !== u.PANORAMA))
  21652. return this.cameraControls.activeControl && this.cameraControls.activeControl.emit(_.LongTap, "touch"),
  21653. !0
  21654. }
  21655. ,
  21656. n.prototype.checktagClick = function() {
  21657. if (this.tagManager.intersectTag) {
  21658. var e = this.isTouchEvent
  21659. , t = this.tagManager.clickedOnTag(e, this);
  21660. return e || t || y.cancelById(V.LookTransition),
  21661. !0
  21662. }
  21663. if (this.tagManager.activeTag)
  21664. return this.tagManager.dismissActiveTag(),
  21665. !1
  21666. }
  21667. ,
  21668. n.prototype.rankedtagInDirection = function(e, t) {
  21669. return this.tagManager.rankedtagInDirection(e, this.position, this.camera, t)
  21670. }
  21671. ,
  21672. n.prototype.start = function(e) {
  21673. //-------------------
  21674. window.initOverlay(r)
  21675. this.model.loadOverlays()
  21676. //-------------------
  21677. var t = e.mode
  21678. , i = e.pano
  21679. , n = e.position
  21680. , rr = e.quaternion
  21681. , o = e.tag
  21682. , a = e.quickstart
  21683. , s = $.Deferred();
  21684. this.updateModelDependentData(),
  21685. this.updateFromControls(),
  21686. this.findDefaultViews();
  21687. var l = this.is360View(t, i);
  21688. return !this.model.outsideAllowed() || l || a ? this.startInside(i, n, rr, o, s) : this.startOutside(e, s),
  21689. s.done(function(e) {
  21690. this.emit(w.Ready, l, e, o)
  21691. }
  21692. .bind(this)),
  21693. s.promise()
  21694. }
  21695. ,
  21696. n.prototype.startOutside = function(e, t) {
  21697. var i = e.mode
  21698. , n = e.pano
  21699. , r = e.position
  21700. , o = e.quaternion
  21701. , a = e.zoom
  21702. , s = e.floorVisibility
  21703. , l = e.tag;
  21704. this.emit(w.StartOutside, f[i].transitionTime),
  21705. this.isOutsideMode(i) ? (this.model.warpDestFloors(s, !0),
  21706. y.cancelById(V.FlyToViewFloor),
  21707. i === u.FLOORPLAN ? this.floorplanMode(r, o, a) : this.dollhouseMode(r, o),
  21708. t.resolve(!1)) : this.startInsideWithFlyin(n, r, o, l, t)
  21709. }
  21710. ,
  21711. n.prototype.startInside = function(e, t, i, n, r) {
  21712. r = r || $.Deferred(),
  21713. this.currentPano = e;
  21714. var o = e && !e.isAligned();
  21715. if (t = o ? e.position : t || e.position,
  21716. i = i || e.quaternion,
  21717. e) {
  21718. var a = this.startInside.bind(this, e, t, i, n, r);
  21719. if (this.checkAndWaitForPanoLoad(e, "high", "low", this.basePanoSize, a))
  21720. return
  21721. }
  21722. //add
  21723. this.transitionPos({type:"beforeFlytopano", pano:this.currentPano, dur:0})
  21724. return this.mode = u.PANORAMA,
  21725. e.floor.enter(this.mode),
  21726. this.emit(w.PanoChosen, this.currentPano, this.currentPano),
  21727. this.switchCameraMode(this.mode, i),
  21728. this.emit(w.StartInside, o),
  21729. r.resolve(!0),
  21730. r
  21731. }
  21732. ,
  21733. n.prototype.startInsideWithFlyin = function(e, t, i, n, r) {
  21734. if (r = r || $.Deferred(),
  21735. this.dollhouseMode(),
  21736. !e)
  21737. return F.warn("Player.startInsideWithFlyin() -> targetPano is invalid."),
  21738. r.resolve(!1),
  21739. r;
  21740. t = t || e.position;
  21741. var o = i || this.cameraControls.activeControl.camera.quaternion
  21742. , a = e.position;
  21743. return this.fitDollhouse(a, t, o),
  21744. setTimeout(function(t) {
  21745. this.cameraControls.activeControl && (this.cameraControls.activeControl.maxDistance = t);
  21746. var n = {
  21747. mode: u.PANORAMA,
  21748. pano: e,
  21749. quaternion: i,
  21750. callback: function() {
  21751. this.emit(w.FlyinFinished),
  21752. r.resolve(!0)
  21753. }
  21754. .bind(this)
  21755. };
  21756. this.flyToNewMode(n)
  21757. }.bind(this, this.cameraControls.activeControl.maxDistance), f.startupFlyinDelay),
  21758. r
  21759. }
  21760. ,
  21761. n.prototype.checkAndWaitForPanoLoad = function() {
  21762. var e = {}
  21763. , t = {}
  21764. , i = 5e3
  21765. , n = function() {
  21766. for (var n in e)
  21767. if (e.hasOwnProperty(n) && e[n]) {
  21768. var r = performance.now() - t[n];
  21769. if (r < i)
  21770. return !0
  21771. }
  21772. return !1
  21773. };
  21774. return function(r, o, a, s, l, c, h, u, d, p) {
  21775. if (n())
  21776. return !0;
  21777. var f = function(t, i, n) {
  21778. N.delayOneFrame(function() {
  21779. e[t] = !1,
  21780. l && l(i, n)
  21781. }
  21782. .bind(this))
  21783. }
  21784. .bind(this, r.id)
  21785. , g = function(t, i) {
  21786. N.delayOneFrame(function() {
  21787. e[t] = !1,
  21788. c && c(i)
  21789. }
  21790. .bind(this))
  21791. }
  21792. .bind(this, r.id);
  21793. try {
  21794. return null !== u && void 0 !== u || (u = !0),
  21795. 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),
  21796. e[r.id] && (t[r.id] = performance.now()),
  21797. e[r.id]
  21798. } catch (n) {
  21799. throw e[r.id] = !1,
  21800. t[r.id] = performance.now() - i,
  21801. n
  21802. }
  21803. }
  21804. }(),
  21805. n.prototype.checkAndWaitForWholePanoLoad = function(e, t, i, n, r) {
  21806. if (!e)
  21807. throw new M("Player.checkAndWaitForWholePanoLoad() -> Cannot load texture for null pano.");
  21808. return r && this.model.waitForLoad(e, function() {
  21809. return e.isLoaded(i)
  21810. }),
  21811. !e.isLoaded(t) && (e.loadCube(t).done(n),
  21812. !0)
  21813. }
  21814. ,
  21815. n.prototype.checkAndWaitForTiledPanoLoad = function() {
  21816. var e = new r.Vector3;
  21817. return function(t, i, n, r, o, a, s, l) {
  21818. if (!t)
  21819. throw new M("Player.checkAndWaitForTiledPanoLoad() -> Cannot load texture for null pano.");
  21820. return e.copy(d.FORWARD),
  21821. this.getDirection(e),
  21822. !t.isLoaded(i) && (a && this.model.waitForLoad(t, function() {
  21823. return t.isLoaded(i)
  21824. }),
  21825. t.loadTiledPano(i, e, null, s, l).done(function(e, t) {
  21826. n && n(e, t)
  21827. }
  21828. .bind(this)).fail(function(e) {
  21829. r && r(e)
  21830. }
  21831. .bind(this)).progress(function(e, t, i) {
  21832. o && o(e, t, i)
  21833. }
  21834. .bind(this)),
  21835. !0)
  21836. }
  21837. }(),
  21838. n.prototype.switchCameraMode = function(e, t) {
  21839. var i = this.cameraControls.controls[e]
  21840. , n = i.camera;
  21841. switch (e) {
  21842. case u.PANORAMA:
  21843. n.position.copy(this.currentPano.position);
  21844. var o = t ? d.FORWARD.clone().applyQuaternion(t) : this.getDirection().setY(0).normalize();
  21845. i.lookAt(o.add(n.position));
  21846. break;
  21847. case u.DOLLHOUSE:
  21848. /* var a = this.position.clone();
  21849. 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),
  21850. n.position.copy(a),
  21851. i.target.copy(this.target.clone().setY(this.model.center.y));
  21852. break; */
  21853. //for多楼层 且 让模型刚好适应屏幕
  21854. var box = this.model.boundingBox.clone();
  21855. box.applyMatrix4(this.camera.matrixWorld);//将 boundingbox、也就是模型, 转换到当前相机朝向
  21856. var boxSize = box.size() //其中boxSize.x是模型在当前相机视角下的横向宽度,当飞出后,该宽度要刚好占满窗口宽度
  21857. var fov = B.getHFOVFromVFOV(f.insideFOV, n.aspect, 1); //获得在当前窗口的横向的fov
  21858. var distance = Math.abs(boxSize.x) / 2 / Math.tan(THREE.Math.degToRad(fov / 2))//根据上面获得的参数得到target到相机的距离
  21859. console.log(boxSize.x,distance, boxSize.length() / 2)
  21860. distance += boxSize.length() / 2 //由于此时模型从中心向相机的部分由于近大远小仍超出屏幕,所以将target放在靠近模型靠近相机的这一端,故而再加上box的对角线长度的一半, 虽然本该加上Math.sqrt(boxSize.z*boxSize.z +boxSize.y+boxSize.y)/2,但是这样模型显得比较满
  21861. if(this.mode === u.PANORAMA){
  21862. i.target.copy(this.model.center);
  21863. var vec = this.getDirection().negate().setY(1).normalize()//获得朝向
  21864. }else{
  21865. i.target.copy(this.target.clone().setY(this.model.center.y))
  21866. var vec = d.DOWN.clone().applyQuaternion(this.quaternion).setY(1).normalize()
  21867. }
  21868. vec.multiplyScalar(distance )
  21869. n.position.copy(i.target.clone().add(vec))
  21870. break
  21871. case u.FLOORPLAN:
  21872. n.position.copy(this.model.center).setY(f.floorplan.cameraHeight),
  21873. i.target.copy(this.model.center).setY(0),
  21874. i.zoomToContain(this.model.size),
  21875. i.rotateToView(this.model.size, this.getDirection())
  21876. }
  21877. i.update(0)
  21878. }
  21879. ,
  21880. n.prototype.update = function() {
  21881. var e = (new r.Vector3,
  21882. {})
  21883. , t = [];
  21884. return function(i) {
  21885. this.updatePersistentZooming(i),
  21886. this.updateFromControls(i),
  21887. this.getCurrentNodePanos(t)
  21888. if(this.hasChanged(e) ) {
  21889. this.lastChangeTime = Date.now(),
  21890. !this.mouseDown && this.containsMouse && this.updateIntersect(),
  21891. this.emit(w.ViewChanged),
  21892. this.intersectHot && this.intersectHot.showTitle()
  21893. for(var i in this.model.hots){
  21894. this.model.hots[i].update(this.camera)
  21895. }
  21896. }
  21897. /* if(e.cameraChanged){
  21898. this.controlVideosPlay()
  21899. } */
  21900. this.model.supportsTiles && (this.updateTileDownloader(t),
  21901. this.updatePanoRenderer(t)),
  21902. this.updatePreRendering(t),
  21903. this.reticule.update(),
  21904. this.path.update(),
  21905. this.spider.update(),
  21906. this.cachedPanoCandidates && f.navigation.panoScores && this.model.panos.showPanoScores(this.cachedPanoCandidates),
  21907. this.updateControlLocks(),
  21908. this.model.supportsTiles && this.updateZoomPano()
  21909. }
  21910. }(),
  21911. /* n.prototype.controlVideosPlay = function() {//判断box视频是否可见 不可见就暂停
  21912. var lastMode, lastPano;
  21913. return function(){
  21914. var mode = this.mode;
  21915. var pano = mode == "panorama" ? this.currentPano : "";
  21916. if(mode != "panorama" || pano != lastPano){
  21917. overlay.noBlock = null
  21918. }
  21919. this.overlayGroup.children.forEach((overlay)=>{
  21920. if(overlay.overlayType == "video" ){
  21921. var matrix = overlay.plane.matrixWorld;
  21922. var inSight = false;
  21923. var cameraDir = this.getDirection();
  21924. var planeDir = (new r.Vector3).copy(d.FORWARD).applyQuaternion(overlay.plane.quaternion)
  21925. var vertexes = []
  21926. if(cameraDir.angleTo(planeDir)>Math.PI/2){//朝向相机视线
  21927. for(let i=0; i<4; i++){
  21928. var vertex = overlay.plane.geometry.vertices[i].clone().applyMatrix4(matrix)
  21929. vertexes.push(vertex)
  21930. if(overlay.noBlock == null){
  21931. if(!m.ifShelter(vertex)){
  21932. overlay.noBlock = true
  21933. }
  21934. inSight = true; break;
  21935. }else{
  21936. overlay.noBlock = true
  21937. }
  21938. if(m.getPos2d(vertex, this.camera, $("#player")[0]).inSight){
  21939. inSight = true; break;
  21940. }
  21941. }
  21942. }
  21943. overlay.inSight = inSight
  21944. if(!inSight)overlay.plane.material.map.image.pause()
  21945. else overlay.plane.material.map.image.play()//maybe fail
  21946. }
  21947. })
  21948. lastMode = mode, lastPano = pano
  21949. }
  21950. }() */
  21951. n.prototype.updatePersistentZooming = function(e) {
  21952. 1 === this.zooming ? this.zoomBy(1 + this.zoomSpeed * e) : this.zooming === -1 && this.zoomBy(1 - this.zoomSpeed * e)
  21953. }
  21954. ,
  21955. n.prototype.updateControlLocks = function() {
  21956. this.currentPano && this.model.supportsTiles && (this.cameraControls.controls[u.PANORAMA].locked = !this.currentPano.highestFullTileRenderOpCompleted && this.currentPano.lockUntilRenderingComplete)
  21957. }
  21958. ,
  21959. n.prototype.updatePanoRenderer = function() {
  21960. var e = new r.Vector3;
  21961. return function(t) {
  21962. var i = this.nextPano || this.currentPano;
  21963. this.panoRenderer.hasQueuedTiles() && i && (e.copy(d.FORWARD),
  21964. this.getDirection(e),
  21965. this.panoRenderer.updateDirection(e))
  21966. }
  21967. }(),
  21968. n.prototype.cleanupInactivePanos = function() {
  21969. var e = []
  21970. , t = [];
  21971. return function() {
  21972. e.length = 0,
  21973. e.push(this.currentPano),
  21974. this.nextPano && e.push(this.nextPano),
  21975. t.length = 0;
  21976. for (var i = 0; i < this.panoRenderer.activePanos.length; i++)
  21977. t.push(this.panoRenderer.activePanos[i]);
  21978. for (var n = 0; n < t.length; n++) {
  21979. for (var r = t[n], o = !0, a = 0; a < e.length; a++)
  21980. r.id === e[a].id && (o = !1);
  21981. o && r.exit()
  21982. }
  21983. }
  21984. }(),
  21985. n.prototype.updatePreRendering = function() {
  21986. var e = {};
  21987. return function(t) {
  21988. if (1 === f.tiling.preRenderTourPanos && this.preRenderingEnabled) {
  21989. var i = this.nextPano || this.currentPano;
  21990. if (i && t && t.length > 1) {
  21991. var n = t.findIndex(function(e) {
  21992. if (e.id === i.id)
  21993. return !0
  21994. });
  21995. if (n >= 0 && n + 1 < t.length) {
  21996. var r = t[n + 1];
  21997. r.isLoaded(this.basePanoSize) || e[r.id] || (window.setTimeout(function(t) {
  21998. this.checkAndWaitForPanoLoad(t, "high", "low", this.basePanoSize, null, null, null, !1, !1, !1),
  21999. window.setTimeout(function(t) {
  22000. e[t.id] = !1
  22001. }
  22002. .bind(this, t), f.tiling.panoPreRenderRepeatDelay)
  22003. }
  22004. .bind(this, r), f.tiling.panoPreRenderDelay),
  22005. e[r.id] = !0)
  22006. }
  22007. }
  22008. }
  22009. }
  22010. }(),
  22011. n.prototype.enablePreRendering = function() {
  22012. this.preRenderingEnabled = !0
  22013. }
  22014. ,
  22015. n.prototype.disablePreRendering = function() {
  22016. this.preRenderingEnabled = !1,
  22017. this.cleanupInactivePanos()
  22018. }
  22019. ,
  22020. n.prototype.updateTileDownloader = function() {
  22021. var e = new r.Vector3;
  22022. return function(t) {
  22023. var i = this.nextPano || this.currentPano;
  22024. i && (e.copy(d.FORWARD),
  22025. this.getDirection(e),
  22026. this.tileDownloader.tilePrioritizer.updateCriteria(i, this.position, e, t.length > 0 ? t : null),
  22027. this.tileDownloader.processPriorityQueue = !0)
  22028. }
  22029. }(),
  22030. n.prototype.updateFromControls = function(e) {
  22031. null !== e && void 0 !== e || (e = 0),
  22032. this.cameraControls.activeControl && (this.cameraControls.activeControl.update(e),
  22033. this.quaternion.copy(this.cameraControls.activeControl.camera.quaternion),
  22034. this.position.copy(this.cameraControls.activeControl.camera.position),
  22035. this.target.copy(this.cameraControls.activeControl.target),
  22036. this.cameraControls.activeControl.camera.updateProjectionMatrix(),
  22037. this.camera.projectionMatrix.copy(this.cameraControls.activeControl.camera.projectionMatrix)),
  22038. this.camera.position.copy(this.position),
  22039. this.camera.quaternion.copy(this.quaternion),
  22040. this.camera.updateMatrix(),
  22041. this.camera.updateMatrixWorld()
  22042. }
  22043. ,
  22044. n.prototype.hasChanged = function(e) {
  22045. /* if (!this.previousState)
  22046. return this.previousState = {
  22047. allFloorsVisible: this.model.allFloorsVisible,
  22048. position: this.position.clone(),
  22049. quaternion: this.quaternion.clone(),
  22050. mouse: this.mouse.clone(),
  22051. labelScaleFactor: this.getLabelScaleFactor(),
  22052. currentFloor: this.model.currentFloor,
  22053. projectionMatrix: this.camera.projectionMatrix.clone(),
  22054. worldMatrix: this.camera.matrixWorld.clone(),
  22055. mode: this.mode,
  22056. modelPosition: this.model.position.clone(),
  22057. modelCenter: this.model.center.clone(),
  22058. zoomLevel: this.zoomLevel
  22059. },
  22060. !0;
  22061. 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;
  22062. return e.allFloorsVisible = this.model.allFloorsVisible !== this.previousState.allFloorsVisible,
  22063. e.moved = !this.position.equals(this.previousState.position),
  22064. e.rotated = !this.quaternion.equals(this.previousState.quaternion),
  22065. e.mouseMoved = !this.mouse.equals(this.previousState.mouse),
  22066. e.labelScaleFactor = this.getLabelScaleFactor() !== this.previousState.labelScaleFactor,
  22067. e.floorChanged = this.model.currentFloor !== this.previousState.currentFloor,
  22068. e.cameraProjectionChanged = !this.camera.projectionMatrix.equals(this.previousState.projectionMatrix),
  22069. e.cameraWorldMatrixChanged = !this.camera.matrixWorld.equals(this.previousState.worldMatrix),
  22070. e.modeChanged = this.mode !== this.previousState.mode,
  22071. e.modelPositionChanged = !this.model.position.equals(this.previousState.modelPosition),
  22072. e.modelCenterChanged = !this.model.center.equals(this.previousState.modelCenter),
  22073. e.nextPanoActive = null !== this.nextPano,
  22074. e.zoomLevel = this.zoomLevel !== this.previousState.zoomLevel,
  22075. this.previousState.allFloorsVisible = this.model.allFloorsVisible,
  22076. this.previousState.position.copy(this.position),
  22077. this.previousState.quaternion.copy(this.quaternion),
  22078. this.previousState.mouse.copy(this.mouse),
  22079. this.previousState.labelScaleFactor = this.getLabelScaleFactor(),
  22080. this.previousState.currentFloor = this.model.currentFloor,
  22081. this.previousState.projectionMatrix.copy(this.camera.projectionMatrix),
  22082. this.previousState.worldMatrix.copy(this.camera.matrixWorld),
  22083. this.previousState.mode = this.mode,
  22084. this.previousState.modelPosition.copy(this.model.position),
  22085. this.previousState.modelCenter.copy(this.model.center),
  22086. this.previousState.zoomLevel = this.zoomLevel,
  22087. !t */
  22088. if (!this.previousState)
  22089. {
  22090. this.previousState = {
  22091. allFloorsVisible: this.model.allFloorsVisible,
  22092. position: this.position.clone(),
  22093. quaternion: this.quaternion.clone(),
  22094. mouse: this.mouse.clone(),
  22095. //labelScaleFactor: this.getLabelScaleFactor(),
  22096. currentFloor: this.model.currentFloor,
  22097. projectionMatrix: this.camera.projectionMatrix.clone(),
  22098. worldMatrix: this.camera.matrixWorld.clone(),
  22099. mode: this.mode,
  22100. modelPosition: this.model.position.clone(),
  22101. modelCenter: this.model.center.clone(),
  22102. zoomLevel: this.zoomLevel
  22103. };
  22104. return !0;
  22105. }
  22106. //许钟文改 分成相机是否改变cameraChanged 和其他
  22107. var a = this.position.equals(this.previousState.position) && this.quaternion.equals(this.previousState.quaternion)&& this.camera.matrixWorld.equals(this.previousState.worldMatrix) && this.camera.projectionMatrix.equals(this.previousState.projectionMatrix) && this.mode === this.previousState.mode && this.zoomLevel === this.previousState.zoomLevel && this.model.center.equals(this.previousState.modelCenter) && this.model.position.equals(this.previousState.modelPosition)
  22108. var t = a && this.mouse.equals(this.previousState.mouse) && this.model.allFloorsVisible === this.previousState.allFloorsVisible /* && this.getLabelScaleFactor() === this.previousState.labelScaleFactor */ && this.model.currentFloor === this.previousState.currentFloor && null === this.nextPano ;
  22109. e.cameraChanged = !a;
  22110. /* if(!t){//主要判断相机是否旋转
  22111. e.cameraChanged2 = !MathLight.closeTo(this.quaternion, this.previousState.quaternion, 3) || !MathLight.closeTo(this.position, this.previousState.position, 4)
  22112. }else e.cameraChanged2 = false */
  22113. e.allFloorsVisible = this.model.allFloorsVisible !== this.previousState.allFloorsVisible,
  22114. e.moved = !this.position.equals(this.previousState.position),
  22115. e.rotated = !this.quaternion.equals(this.previousState.quaternion),
  22116. e.mouseMoved = !this.mouse.equals(this.previousState.mouse),
  22117. // e.labelScaleFactor = this.getLabelScaleFactor() !== this.previousState.labelScaleFactor,
  22118. e.floorChanged = this.model.currentFloor !== this.previousState.currentFloor,
  22119. e.cameraProjectionChanged = !this.camera.projectionMatrix.equals(this.previousState.projectionMatrix),
  22120. e.cameraWorldMatrixChanged = !this.camera.matrixWorld.equals(this.previousState.worldMatrix),
  22121. e.modeChanged = this.mode !== this.previousState.mode,
  22122. e.modelPositionChanged = !this.model.position.equals(this.previousState.modelPosition),
  22123. e.modelCenterChanged = !this.model.center.equals(this.previousState.modelCenter),
  22124. e.nextPanoActive = null !== this.nextPano,
  22125. e.zoomLevel = this.zoomLevel !== this.previousState.zoomLevel,
  22126. this.previousState.allFloorsVisible = this.model.allFloorsVisible,
  22127. this.previousState.position.copy(this.position),
  22128. this.previousState.quaternion.copy(this.quaternion),
  22129. this.previousState.mouse.copy(this.mouse),
  22130. //this.previousState.labelScaleFactor = this.getLabelScaleFactor(),
  22131. this.previousState.currentFloor = this.model.currentFloor,
  22132. this.previousState.projectionMatrix.copy(this.camera.projectionMatrix),
  22133. this.previousState.worldMatrix.copy(this.camera.matrixWorld),
  22134. this.previousState.mode = this.mode,
  22135. this.previousState.modelPosition.copy(this.model.position),
  22136. this.previousState.modelCenter.copy(this.model.center),
  22137. this.previousState.zoomLevel = this.zoomLevel;
  22138. //console.log("cameraChanged2 "+ e.cameraChanged2 + ", mouseMoved "+e.mouseMoved)
  22139. return !t
  22140. }
  22141. ,
  22142. n.prototype.updateIntersect = function() {
  22143. var e = this.flying || this.isWarping()
  22144. , t = this.isOutsideMode() && this.cameraControls.controls[this.mode].isEngaged()
  22145. , i = y.getById(V.LookTransition)
  22146. , n = !(e || t || this.isTouchEvent || i.length && i[0].running);
  22147. //this.tagManager.intersecttag(this.mouse, n, this.camera) || (this.intersect = this.getMouseIntersect(),//--MP
  22148. this.intersect = this.getMouseIntersect(); //xzw change
  22149. this.intersect && this.updateClosestPano(this.intersect),
  22150. // this.intersect && console.log(this.intersect.point),
  22151. this.closestPano || this.closestPanoInDirection(this.getMouseDirection()) ? (this.reticule.updatePosition(this.position, this.intersect),
  22152. f.navigation.panoScores && !f.navigation.mouseDirection && this.closestPanoInDirection(this.getDirection())) : this.reticule.hide()
  22153. }
  22154. ,
  22155. n.prototype.checkHotClick = function() {
  22156. if(this.intersectHot){
  22157. this.intersectHot.noAction || this.intersectHot.examine(this)
  22158. /* g_touraudio.pause();
  22159. g_bgaudio = false;
  22160. document.getElementById("bgaudio").pause();
  22161. var sWidth = document.body.scrollWidth;
  22162. var sHeight = document.body.scrollHeight;
  22163. var pop1 = document.getElementById('popup');
  22164. pop1.style.display = "block";
  22165. var myElement = document.createElement("iframe");
  22166. myElement.src = g_HotMeshes[i].hotLink;
  22167. myElement.id = "id1";
  22168. myElement.allowTransparency = "true";
  22169. myElement.style.width = "100%";
  22170. myElement.style.height = "100%";
  22171. myElement.scrolling = "no";
  22172. var element=document.getElementById("id1");
  22173. if (typeof(element)== "undefined" || element == null){
  22174. document.getElementById("popup").appendChild(myElement);
  22175. }
  22176. var oClose = document.getElementById("closepop");
  22177. oClose.onclick = function() {
  22178. pop1.style.display = "none";
  22179. document.getElementById("popup").removeChild(document.getElementById("id1"));
  22180. $("#popup iframe:last").remove();
  22181. document.getElementById("bgaudio").play();
  22182. } */
  22183. return true;
  22184. }
  22185. },
  22186. n.prototype.getMouseDirection = function(e) {
  22187. e = e || this.mouse;
  22188. var t = new r.Vector3(e.x,e.y,-1).unproject(this.camera)
  22189. , i = new r.Vector3(e.x,e.y,1).unproject(this.camera);
  22190. return i.sub(t).normalize()
  22191. }
  22192. ,
  22193. n.prototype.hoverOverlay = function(mesh){
  22194. if(!mesh){
  22195. this.hoveringPlane = null;
  22196. $("#player").css("cursor",this.currentCursor || "" );
  22197. }else{
  22198. var overlay = mesh.parent;
  22199. $("#player").css("cursor","pointer");
  22200. this.hoveringPlane = overlay;
  22201. return true;
  22202. }
  22203. },
  22204. n.prototype.clickOverlay = function(overlay){
  22205. if(this.openOverlay && !overlay)return;
  22206. var plane = overlay.plane;
  22207. if(overlay.overlayType == "video"){
  22208. if(plane.material.map.image.paused)plane.material.map.image.play()
  22209. else plane.material.map.image.pause();
  22210. }
  22211. /* if(window.EditOverlay &&EditOverlay.editing){
  22212. if(EditOverlay.editPlane && overlay != EditOverlay.editPlane) EditOverlay.closeOverlayPanel('cancel')
  22213. $('#overlayProp').removeClass('atRight').removeClass('hide')
  22214. EditOverlay.endAddPlane();
  22215. EditOverlay.updateOverlayPanel(overlay)
  22216. EditOverlay.controlSelectOverlay(overlay)
  22217. return;
  22218. } */
  22219. },
  22220. n.prototype.getMouseIntersect = function(e, t) {//xzw change
  22221. e = e || this.mouse.clone(),
  22222. t = t || this.model.floors.reduce(function(e, t) {
  22223. return t.hidden ? e : e.concat(t.collider.children)
  22224. }, this.mode === u.PANORAMA ? this.panoMarkers : []);
  22225. for(var i in this.model.hots){
  22226. t.push(this.model.hots[i].mesh);
  22227. }
  22228. this.overlayGroup && (t = t.concat(this.overlayGroup.children));
  22229. var i = new r.Vector3(e.x,e.y,-1).unproject(this.camera);
  22230. this.raycaster.set(i, this.getMouseDirection(e));
  22231. var n = this.raycaster.intersectObjects(t, true);//add true
  22232. // n[0] && console.log(n[0].point);
  22233. if(g_HotStatus=="add"){
  22234. var points = this.raycaster.intersectObjects(window.player.model.chunks);
  22235. console.log(points[0]);
  22236. points.length >= 1? ($('#player').css('cursor', 'cell'),window.hotPointPos = points[0].point): ($('#player').css('cursor', 'not-allowed'), window.hotPointsPos = false)
  22237. }
  22238. this.intersectHot && this.intersectHot.hideTitle()
  22239. if (0 === n.length){
  22240. this.intersectHot = null; //add
  22241. if(g_HotStatus!="add") $("#player").css("cursor","");
  22242. return null;
  22243. }
  22244. var o = n[0];
  22245. if(o.object.type == "hotSprite"){ //add
  22246. this.intersectHot = o.object.belongHot;
  22247. this.intersectHot.showTitle()
  22248. this.intersectHot.noAction || $("#player").css("cursor","pointer");
  22249. return;
  22250. }
  22251. this.intersectHot = null;
  22252. var intersect = this.hoverOverlay(this.overlayGroup && o && o.object.parent.parent == this.overlayGroup && o.object)
  22253. if(!intersect && g_HotStatus!="add") $("#player").css("cursor","");
  22254. if (o.face) {
  22255. o.normal = o.face.normal.applyQuaternion(o.object.quaternion);
  22256. var a = this.position.clone().sub(o.point);
  22257. a.dot(o.normal) < 0 && o.normal.negate(),
  22258. this.currentPano ? o.onFloor = o.point.y < this.position.y - .5 * this.currentPano.height : o.onFloor = o.point.y < this.position.y - .5,
  22259. o.horizontal = o.normal.y > .8
  22260. }
  22261. // console.log(o.point);
  22262. return o
  22263. }
  22264. ,
  22265. n.prototype.updateClosestPano = function(e) {
  22266. var t = [s.filters.isPanoAligned()];
  22267. if (this.mode === u.PANORAMA) {
  22268. if (!this.currentPano)
  22269. return;
  22270. t.push(s.filters.not(this.currentPano)),
  22271. t.push(s.filters.inFloorDirection(this.currentPano.floorPosition, this.getDirection(), .25)),
  22272. t.push(s.filters.isNeighbourPanoTo(this.currentPano)),
  22273. t.push(s.filters.isCloseEnoughTo(e.point, f.panoFloorClickRadius)),
  22274. t.push(s.filters.isNotBehindNormal(e.point, e.normal))
  22275. } else{
  22276. t.push((pano)=>{ // add
  22277. return this.checkHasNeighbor(pano)
  22278. })
  22279. t.push(s.filters.isOnVisibleFloor()),
  22280. this.mode !== u.FLOORPLAN && t.push(s.filters.inDirection(this.position, this.getDirection(), .25));
  22281. }
  22282. var i = this.model.panos.find(t, [s.sortFunctions.floorDistanceToPoint(e.point)]);
  22283. i !== this.closestPano ? (i && (this.isPanoHover = !0),
  22284. this.emit(w.ClosestPanoChanging, this.closestPano, i, this.mode),
  22285. this.closestPano = i) : this.isPanoHover = !1
  22286. }
  22287. ,
  22288. n.prototype.dollhouseMode = function(e, t) {
  22289. this.emit(w.ModeChanging, this.mode, u.DOLLHOUSE),
  22290. this.mode = u.DOLLHOUSE,
  22291. this.cameraControls.controls[u.DOLLHOUSE].reset();
  22292. var i = new r.Vector3(this.model.center.x,0,this.model.center.z)
  22293. , n = new r.Vector3(15,10,15);
  22294. if (e && t) {
  22295. var o = d.FORWARD.clone().applyQuaternion(t)
  22296. , a = this.model.center.clone().sub(e)
  22297. , s = a.dot(o);
  22298. s > 0 ? (i = o.clone().multiplyScalar(s).add(e),
  22299. n.copy(e)) : F.warn("Tried to initiate dollhouse mode that wasn't looking at the model", e, t)
  22300. }
  22301. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(0, !0),
  22302. this.cameraControls.controls[u.DOLLHOUSE].target.copy(i),
  22303. this.cameraControls.cameras[u.DOLLHOUSE].position.copy(n),
  22304. this.updateFromControls(),
  22305. this.model.alpha = 1,
  22306. this.model.skybox.material.uniforms.opacity.value = 0
  22307. }
  22308. ,
  22309. n.prototype.insideMode = function(e, t) {
  22310. var i = $.Deferred()
  22311. , n = t || null;
  22312. if (this.mode !== u.PANORAMA && this.mode !== u.TRANSITIONING) {
  22313. var r = [s.filters.isPanoAligned()];
  22314. this.model.currentFloor && r.push(s.filters.atFloor(this.model.currentFloor)),
  22315. e = e || this.currentPano || this.model.panos.find(r, [s.sortFunctions.distanceToPoint(this.cameraControls.activeControl.target)]),
  22316. this.flyToNewMode({
  22317. mode: u.PANORAMA,
  22318. pano: e,
  22319. callback: n
  22320. }).done(i.resolve.bind(i)).fail(i.reject.bind(i))
  22321. } else {
  22322. var o = this.mode === u.PANORAMA ? "Already in panorama mode" : "Cannot change mode during mode transition";
  22323. i.reject(o)
  22324. }
  22325. return i.promise()
  22326. }
  22327. ,
  22328. n.prototype.fitDollhouse = function(e, t, i) {//许钟文改 飞入前寻找和初始视角最合适的位置
  22329. //if(urlHasValue('oldEntry')){
  22330. //搬自一代。
  22331. var maxY = this.model.boundingBox.max.y;
  22332. var n = d.FORWARD.clone().applyQuaternion(i)
  22333. , i = n.clone().add(e);
  22334. this.cameraControls.activeControl.target.copy(i),
  22335. this.cameraControls.activeControl.camera.position.set(0, maxY * 2.4, 0).add(e).add(n.multiplyScalar(-10))
  22336. //return;
  22337. /* //this.camera.position.copy(this.model.center);
  22338. //this.camera.updateMatrixWorld()
  22339. this.switchCameraMode("dollhouse", i) */
  22340. //}//下面是二代代码,看不太懂。因为有的场景在靠近一端的某个方向截取的初始视角会甩镜头,也就是不是下去之后的方向
  22341. //直接用一代的这个 效果和二代几乎一样,且不会甩
  22342. /* var n = d.FORWARD.clone().applyQuaternion(i);
  22343. this.cameraControls.activeControl.target.copy(n).add(e);
  22344. var o = d.RIGHT.clone().applyQuaternion(i)
  22345. , a = d.UP.clone()
  22346. , s = o.clone().applyAxisAngle(a, Math.PI / 2)
  22347. , l = this.model.boundingBox.max.clone()
  22348. , c = this.model.boundingBox.min.clone()
  22349. , 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)]
  22350. , u = 0
  22351. , p = 0
  22352. , g = 0;
  22353. h.forEach(function(e, t, i) {
  22354. var n = Math.abs(e.dot(o))
  22355. , r = e.dot(s);
  22356. n > u && (u = n,
  22357. p = r),
  22358. r > g && (g = r)
  22359. });
  22360. 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)))
  22361. , v = s.clone().multiplyScalar(p).add(t)
  22362. , A = s.clone().multiplyScalar(g).add(t);
  22363. p = u / Math.tan(this.cameraControls.activeControl.camera.fov / 2 * this.cameraControls.activeControl.camera.aspect * (Math.PI / 180));
  22364. g = m / Math.tan(this.cameraControls.activeControl.camera.fov / 2 * (Math.PI / 180));
  22365. p = Math.max(p, 10),
  22366. g = Math.max(g, 10);
  22367. var y = n.clone().multiplyScalar(-p).add(v).sub(t).length()
  22368. , C = n.clone().multiplyScalar(-g).add(v).sub(t).length();
  22369. this.cameraControls.activeControl.maxDistance = f.skyboxRadius - 1;
  22370. y >= C ? this.cameraControls.activeControl.camera.position.set(0, 6, 0).add(v).add(n.multiplyScalar(1.1 * -p))
  22371. : this.cameraControls.activeControl.camera.position.set(0, 6, 0).add(A).add(n.multiplyScalar(1.1 * -g))
  22372. */
  22373. }
  22374. ,
  22375. n.prototype.floorplanMode = function(e, t, i) {
  22376. this.mode = u.FLOORPLAN;
  22377. var n = this.cameraControls.controls[u.FLOORPLAN];
  22378. n.reset();
  22379. var r = e ? e : this.model.center;
  22380. if (n.target.copy(r).setY(0),
  22381. n.camera.position.copy(r).setY(f.floorplan.cameraHeight),
  22382. i ? (n.currentScale = i / ($("#player").width() / $("#player").height()),
  22383. n.absoluteScale = n.currentScale) : n.zoomToContain(this.model.size),
  22384. t) {
  22385. var o = d.LEFT.clone().applyQuaternion(t);
  22386. n.rotateLeft(-Math.atan2(o.x, o.z))
  22387. } else
  22388. n.rotateToView(this.model.size, this.getDirection());
  22389. n.update(0)
  22390. }
  22391. ,
  22392. n.prototype.nonInterruptingFlyToPano = function(e, t) {
  22393. return e.skipWarpingCheck = !0,
  22394. this.flyToPano(e, t)
  22395. }
  22396. ,
  22397. n.prototype.updateMarkerVisi = function() {//加
  22398. if(this.mode != "panorama")return;
  22399. this.model.panos.list.forEach((pano)=>{
  22400. if(!pano.marker)return;
  22401. pano.marker.material.visible = !!pano.neighbourPanos[this.currentPano.id];
  22402. })
  22403. }
  22404. ,
  22405. n.prototype.updateHotVisible = function(pano){
  22406. var hots = this.model.hots;
  22407. pano = pano || this.currentPano;
  22408. for (var index in hots){
  22409. var visible;
  22410. if(this.mode != "panorama"){
  22411. visible = true;
  22412. }else{
  22413. //hots[index].mesh.material.depthTest = false;
  22414. visible = !hots[index].visiblePanos || hots[index].visiblePanos.indexOf(pano.id) > -1
  22415. }
  22416. hots[index].mesh.visible = visible;
  22417. }
  22418. },
  22419. n.prototype.flyToPano = function(e, t) {
  22420. var i = e.pano
  22421. , n = e.lookAtPoint
  22422. , o = e.duration
  22423. , a = e.aimDuration
  22424. , s = e.maxDistanceOverride
  22425. , l = e.skipWarpingCheck
  22426. , c = e.constantMoveSpeed
  22427. , h = null
  22428. , p = null;
  22429. window.specialScene && specialScene.special().specifySpot && specialScene.special().specifySpot(i);
  22430. if (this.isWarping() && !l && (this.path.activeTransType === x.BLACK || this.path.activeTransType === x.STD))
  22431. return F.warn("Player.flyToPano() -> Cannot fly when warping"),
  22432. t && t(),
  22433. !1;
  22434. if (this.updateLastView(),
  22435. this.mode !== u.PANORAMA) {
  22436. var m;
  22437. return n && (m = (new r.Quaternion).setFromUnitVectors(d.FORWARD, n.sub(i.position).normalize())),
  22438. void this.flyToNewMode({
  22439. mode: u.PANORAMA,
  22440. pano: i,
  22441. duration: o,
  22442. quaternion: m,
  22443. callback: t
  22444. })
  22445. }
  22446. if (!i || (h = g.deepExtend(e),
  22447. p = function() {
  22448. N.delayOneFrame(function() {
  22449. this.flyToPano(h, t)
  22450. }
  22451. .bind(this))
  22452. }
  22453. .bind(this),
  22454. !this.checkAndWaitForPanoLoad(i, "high", "low", this.basePanoSize, p))) {
  22455. var C = function(e) {
  22456. t && t(e)
  22457. }
  22458. .bind(this);
  22459. this.currentPano || (this.currentPano = i,
  22460. this.path.placeCpm(),
  22461. this.path.fadeOutCpm(f.path.fadeOutTime),
  22462. this.spider.draw());
  22463. var I = o;
  22464. if ("number" != typeof o) {
  22465. var E = s || f.transition.flytimeMaxDistanceThreshold;
  22466. I = Math.min(this.currentPano.position.distanceTo(i.position), E) * f.transition.flytimeDistanceMultiplier + f.transition.flyTime
  22467. }
  22468. if (f.transition.flySpeed > .01 && (I = 1e3 * this.currentPano.position.distanceTo(i.position) / f.transition.flySpeed),
  22469. 1 !== this.zoomLevel)
  22470. switch (f.zoom.transitionStyle) {
  22471. case 1:
  22472. this.smoothZoomToDefault(I / 2);
  22473. break;
  22474. case 2:
  22475. return h = g.deepExtend(e),
  22476. p = this.flyToPano.bind(this, h, t),
  22477. void this.smoothZoomToDefault(f.zoom.restoreTime * (this.zoomLevel - 1), p)
  22478. }
  22479. if (n) {
  22480. y.cancelById(V.LookTransition),
  22481. I *= f.transition.aimSlowFactor;
  22482. var b = this.cameraControls.activeControl.camera.quaternion.clone()
  22483. , _ = (new r.Matrix4).lookAt(i.position, n, d.UP)
  22484. , T = (new r.Quaternion).setFromRotationMatrix(_)
  22485. , S = b.clone()
  22486. , M = new r.Vector3;
  22487. if (i === this.currentPano) {
  22488. var R = d.FORWARD.clone().applyQuaternion(b)
  22489. , P = d.FORWARD.clone().applyQuaternion(T)
  22490. , O = R.angleTo(P);
  22491. return void 0 !== a && null !== a || (a = 1 * Math.sqrt(O) / f.tags.navigate.rotateSpeedFactor * 1e3),
  22492. void y.start(function(e) {
  22493. S.copy(b),
  22494. v.quaternion(S, T)(e),
  22495. M.copy(d.FORWARD).applyQuaternion(S).add(this.cameraControls.activeControl.camera.position),
  22496. this.cameraControls.activeControl.lookAt(M)
  22497. }
  22498. .bind(this), a, C, 0, A[f.transition.movementEasing], null, V.LookTransition)
  22499. }
  22500. }
  22501. if (i === this.currentPano || this.flying)
  22502. return void C();
  22503. this.flying = !0;
  22504. var L = this.position.clone()
  22505. , D = this.currentPano;
  22506. F.debug("Flying to pano ", i.position),
  22507. this.emit(w.PanoChosen, this.currentPano, i),
  22508. this.emit(w.FlyingStarted, i.position, L, i, D)
  22509. //---------before fly--------------- add
  22510. this.updateHotVisible(i); //更新热点显示
  22511. this.transitionPos({type:"beforeFlytopano", pano:i, dur:I})//add
  22512. //地标变化
  22513. if(this.model.floorLogos){
  22514. this.model.changefloorLogoOpa({index:0, opa:0, dur: p, delay:0.7})//this.model.floorLogoFade(0, _duration*0.5, 0.7);
  22515. this.model.floorLogos[1].position.copy(i.floorPosition.clone().sub(this.model.position));
  22516. //this.model.adjustfloorLogoHeight();
  22517. this.model.floorLogos[1].material.opacity = 0;//uniforms.opacity.value = 0;
  22518. this.model.floorLogos[1].visible = true;
  22519. this.model.changefloorLogoOpa({index:1, opa:1, dur: 250})//this.model.floorLogoShow(1,250);
  22520. }
  22521. //=======================================
  22522. n && y.start(function(e) {
  22523. S.copy(b),
  22524. v.quaternion(S, T)(e),
  22525. M.copy(d.FORWARD).applyQuaternion(S).add(this.cameraControls.activeControl.camera.position),
  22526. this.cameraControls.activeControl.lookAt(M)
  22527. }
  22528. .bind(this), I, null, 0, A[f.transition.movementEasing], null, V.LookTransition);
  22529. var B = c ? null : A[f.transition.movementEasing];
  22530. this.nextPano = i,
  22531. y.start(v.uniform(this.model.skybox, "progress", 1), I, null, 0, A[f.transition.blendEasing], "skyFly", V.FlyToPano),
  22532. y.start(v.allUniforms(this.model.chunks, "progress", 1), I, null, 0, A[f.transition.blendEasing], "chunkFly", V.FlyToPano),
  22533. y.start(v.vector(this.cameraControls.cameras[u.PANORAMA].position, i.position), I, function(e) {
  22534. this.flying = !1,
  22535. this.currentPano !== i && this.currentPano.exit(),
  22536. i.enter(),
  22537. this.currentPano = i,
  22538. this.nextPano = null,
  22539. this.path.placeCpm(),
  22540. this.path.fadeOutCpm(f.path.fadeOutTime),
  22541. this.spider.draw(),
  22542. this.emit(w.FlyingEnded, i.position, L, i, D),
  22543. this.updateMarkerVisi(),//add
  22544. C(e)
  22545. //add:
  22546. if(this.mode == "panorama" && this.model.floorLogos){
  22547. this.model.floorLogos[0].position.copy(this.model.floorLogos[1].position)
  22548. //this.model.adjustfloorLogoHeight()
  22549. this.model.changefloorLogoOpa({index:0,opa:1,dur:0});//this.model.floorLogos[0].material.uniforms.opacity.value = 1;
  22550. this.model.floorLogos[1].visible = false;
  22551. }
  22552. }
  22553. .bind(this), 0, B, "camFly", V.FlyToPano)
  22554. }
  22555. }
  22556. ,
  22557. window._tranOutsideFocus = 4399
  22558. n.prototype.focusPoint = function(o={}){//当在外时,聚焦相机到这一点
  22559. console.log("focusPoint")
  22560. if(this.mode == "floorplan"){
  22561. var modelSize = o.modelSize || new THREE.Vector3(8,8,8);//可视范围
  22562. var control = player.cameraControls.controls.floorplan;
  22563. var absoluteScale = control.getDefaultAbsoluteScale(modelSize)
  22564. var currentScale = control.absoluteScale;
  22565. var currentTarget = control.target.clone()
  22566. y.cancelById(window._tranOutsideFocus, true);
  22567. y.start(function(progress){
  22568. control.absoluteScale = absoluteScale*progress + currentScale*(1-progress);
  22569. control.target = o.aim.clone().multiplyScalar(progress).add(currentTarget.clone().multiplyScalar(1-progress))
  22570. control.camera.position.copy(control.target.clone().add(control.offset)) //维持角度
  22571. }.bind(this) , o.dur || 600, null/* cancelFuc */, 0, A[f.transition.movementEasing], "outsideFocus", window._tranOutsideFocus, null/* cancelFuc */);
  22572. }else if(player.mode == "dollhouse"){
  22573. var control = player.cameraControls.controls.dollhouse;
  22574. var radius = o.radius || 8;
  22575. var currentTarget = control.target.clone()
  22576. var dir = control.offset.clone().normalize()
  22577. var currentRadius = control.offset.length();
  22578. y.cancelById(window._tranOutsideFocus, true);
  22579. y.start(function(progress){
  22580. control.target = o.aim.clone().multiplyScalar(progress).add(currentTarget.clone().multiplyScalar(1-progress))
  22581. let radius_ = radius*progress+currentRadius*(1-progress)
  22582. control.camera.position.copy(control.target.clone().add(dir.clone().multiplyScalar(radius_)))
  22583. }.bind(this) , o.dur || 600, null/* cancelFuc */, 0, A[f.transition.movementEasing], "outsideFocus", window._tranOutsideFocus, null/* cancelFuc */);
  22584. }
  22585. }
  22586. window._transitionPosId = 9999
  22587. n.prototype.transitionPos = function(o={}) {//渐变overlay和热点的位置
  22588. y.cancelById(_transitionPosId)
  22589. var begin = function(object, pos, qua, scale){
  22590. if(pos){
  22591. if(!same(object.position, pos, 0.01)){
  22592. y.start(v.vector(object.position, pos), o.dur, (e)=>{
  22593. },0, A[f.transition.movementEasing], "transitionPos", _transitionPosId)
  22594. }
  22595. if(!same(object.quaternion, qua, 1e-6)){
  22596. y.start(v.quaternion(object.quaternion, qua), o.dur, (e)=>{
  22597. },0, A[f.transition.movementEasing], "transitionPos", _transitionPosId)
  22598. }
  22599. if(!same(object.scale, scale, 0.001)){
  22600. y.start(v.vector(object.scale, scale), o.dur, (e)=>{
  22601. },0, A[f.transition.movementEasing], "transitionPos", _transitionPosId)
  22602. }
  22603. }
  22604. }
  22605. var same = function(vec1, vec2, diff){
  22606. var s = Math.abs(vec1.x-vec2.x) < diff && Math.abs(vec1.y-vec2.y) < diff && Math.abs(vec1.z-vec2.z) < diff
  22607. if(s && vec1.w) s = Math.abs(vec1.w-vec2.w) < diff
  22608. return s
  22609. }
  22610. this.overlayGroup.children.forEach(overlay=>{
  22611. var panoData = o.pano != void 0 && overlay.transformAtPanos[o.pano.id]
  22612. var useCustom = o.type == "beforeFlyOut" || !panoData
  22613. var pos = useCustom ? overlay.posCustom : panoData.pos;
  22614. var qua = useCustom ? overlay.quaCustom : panoData.qua;
  22615. var scale = useCustom ? overlay.getScaleBySize(overlay.widthCustom, overlay.heightCustom) :
  22616. overlay.getScaleBySize(panoData.width , panoData.height)
  22617. scale = new THREE.Vector3(scale.x, scale.y, overlay.scale.z)
  22618. begin(overlay, pos, qua, scale )
  22619. })
  22620. }
  22621. n.prototype.fastForwardActivePanoFlight = function(e) {
  22622. e = e || f.transition.fastForwardFactor / 10 * 4 + 1,
  22623. y.adjustSpeed(V.FlyToPano, e),
  22624. y.adjustSpeed(V.LookTransition, e)
  22625. }
  22626. ,
  22627. n.prototype.flyToPanoClosestToMouse = function() {
  22628. if (Date.now() - this.mouseLastMoveTime > 50 && (this.intersect = this.getMouseIntersect(),
  22629. this.intersect && this.updateClosestPano(this.intersect)),
  22630. this.closestPano)
  22631. return this.flyToPano({
  22632. pano: this.closestPano
  22633. });
  22634. var e = this.getMouseDirection();
  22635. this.flyDirection(e) || this.flyToPano({
  22636. pano: this.currentPano
  22637. })
  22638. }
  22639. ,
  22640. n.prototype.flyLocalDirection = function(e) {
  22641. var t = this.getDirection(e)
  22642. , i = 1 === e.z ? .4 : .75
  22643. , n = 1 === Math.abs(e.x);
  22644. return this.flyDirection(t, i, n)
  22645. }
  22646. ,
  22647. n.prototype.flyDirection = function(e, t, i) {
  22648. this.closePopup();//xzw add
  22649. var n = $.Deferred();
  22650. this.history.invalidate();
  22651. var r = this.closestPanoInDirection(e, t, i);
  22652. return r ? this.flyToPano({
  22653. pano: r
  22654. }, n.resolve.bind(n, !0)) : (this.bump(e),
  22655. n.resolve(!1)),
  22656. n.promise()
  22657. }
  22658. ,
  22659. n.prototype.closestPanoInDirection = function(e, t, i) {
  22660. return this.rankedPanoInDirection(0, e, t, i)
  22661. }
  22662. ,
  22663. n.prototype.rankedPanoInDirection = function() {
  22664. var e = {
  22665. pano: null,
  22666. candidates: []
  22667. };
  22668. return function(t, i, n, r) {
  22669. t || (t = 0),
  22670. n = void 0 !== n ? n : .75;
  22671. var o = r ? "angle" : "direction";
  22672. 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),
  22673. this.cachedPanoCandidates = e.candidates,
  22674. e.pano
  22675. }
  22676. }(),
  22677. n.prototype.bump = function(e) {
  22678. if (this.mode === u.PANORAMA && !this.flying && !this.isWarping()) {
  22679. 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;
  22680. if (s)
  22681. t = function() {
  22682. y.start(v.property(this.cameraControls.cameras[u.PANORAMA], "zoom", a > 0 ? 1.04 : .96), o, i, 0, A.easeInOutSine, "bumpZStart")
  22683. }
  22684. .bind(this),
  22685. i = function() {
  22686. y.start(v.property(this.cameraControls.cameras[u.PANORAMA], "zoom", 1), 5 * o, n, 0, A.easeInOutSine, "bumpZRelax")
  22687. }
  22688. .bind(this);
  22689. else {
  22690. var l = this.camera.position.clone()
  22691. , c = e.clone();
  22692. this.raycaster.set(l, c);
  22693. var h = this.model.floors.reduce(function(e, t) {
  22694. return e.concat(t.collider.children)
  22695. }, [])
  22696. , d = this.raycaster.intersectObjects(h)
  22697. , p = d.length > 0 ? d[0].distance / 25 : .04
  22698. , g = l.clone().add(c.multiplyScalar(p));
  22699. t = function() {
  22700. y.start(v.vector(this.cameraControls.cameras[u.PANORAMA].position, g), o, i, 0, A.easeInOutSine, "bumpTStart")
  22701. }
  22702. .bind(this),
  22703. i = function() {
  22704. y.start(v.vector(this.cameraControls.cameras[u.PANORAMA].position, l), 5 * o, n, 0, A.easeInOutSine, "bumpTRelax")
  22705. }
  22706. .bind(this)
  22707. }
  22708. n = function() {
  22709. this.flying = !1
  22710. }
  22711. .bind(this),
  22712. this.flying = !0,
  22713. t()
  22714. }
  22715. }
  22716. ,
  22717. n.prototype.changeFloor = function(e) {
  22718. if (!this.is360View(this.mode, this.currentPano))
  22719. if (this.mode === u.PANORAMA) {
  22720. var t = this.history.reversePano(e);
  22721. t && t.isAligned() ? this.flyToPano({
  22722. pano: t
  22723. }) : this.changeFloorByScore(e)
  22724. } else
  22725. this.model.setFloor(this.model.nextFloor(e) || this.model.currentFloor)
  22726. }
  22727. ,
  22728. n.prototype.changeFloorByScore = function() {
  22729. var e = {
  22730. pano: null,
  22731. candidates: []
  22732. };
  22733. return function(t) {
  22734. var i = this.model.nextFloor(t);
  22735. 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),
  22736. void (e.pano ? (this.cachedPanoCandidates = e.candidates,
  22737. this.history.push(t, this.currentPano),
  22738. this.flyToPano({
  22739. pano: e.pano
  22740. })) : F.warn("No pano found on selected floor, not moving there."))) : void F.debug("player.changeFloor(" + t + "): no such floor")
  22741. }
  22742. }(),
  22743. n.prototype.gotoFloor = function(e) {
  22744. var t = e - this.model.currentFloor.floorIndex;
  22745. this.changeFloor(t)
  22746. }
  22747. ,
  22748. n.prototype.getDirection = function(e) {
  22749. return e = e ? e : (new r.Vector3).copy(d.FORWARD),
  22750. e.applyQuaternion(this.camera.quaternion)
  22751. }
  22752. ,
  22753. n.prototype.flyToSameMode = function(e, t, i, n, o) {
  22754. if (o = o || $.Deferred(),
  22755. this.mode === u.TRANSITIONING)
  22756. return F.warn("should not be transitioning here"),
  22757. n && n(!1),
  22758. o.reject().promise();
  22759. var a = i || !1
  22760. , s = i ? i.position : this.position
  22761. , l = this.position.clone()
  22762. , c = this.currentPano;
  22763. if (F.debug("New pose in mode " + this.mode),
  22764. !e || (retryCallback = function() {
  22765. N.delayOneFrame(function() {
  22766. this.flyToSameMode(e, t, i, n, o)
  22767. }
  22768. .bind(this))
  22769. }
  22770. .bind(this),
  22771. !this.checkAndWaitForPanoLoad(e, "high", "low", this.basePanoSize, retryCallback))) {
  22772. var h = function() {
  22773. this.emit(w.FlyingEnded, s, l, e, c),
  22774. n && n(!0)
  22775. }
  22776. .bind(this)
  22777. , d = f[this.mode]
  22778. , p = void 0 !== t ? t : d.transitionTime
  22779. , g = new r.Vector3
  22780. , C = new r.Vector3;
  22781. if (this.emit(w.FlyingStarted, s, l, e, c),
  22782. this.mode === u.PANORAMA)
  22783. F.warn("we should not be here for panorama views");
  22784. else if (this.mode === u.DOLLHOUSE)
  22785. if (a) {
  22786. var I = new r.Vector3(0,1,0);
  22787. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(1, !0),
  22788. this.model.warpDestFloors(i.floorVisibility),
  22789. C.copy(i.position);
  22790. var E = new r.Vector3(0,0,-1).applyQuaternion(i.quaternion)
  22791. , b = new r.Raycaster(C.clone(),E.clone(),0,1 / 0)
  22792. , _ = b.intersectObjects(this.model.colliders)
  22793. , T = 3;
  22794. _.length ? (g.copy(_[0].point),
  22795. T = .75 * C.distanceTo(g)) : (g.copy(E).multiplyScalar(3).add(C),
  22796. F.debug("Tried to restore dollhouse mode that did not intersect...", i.position, i.quaternion));
  22797. var x = (new r.Matrix4).lookAt(C, g, I)
  22798. , S = (new r.Euler).setFromRotationMatrix(x, f.warp.eOrder)
  22799. , M = g.distanceTo(C)
  22800. , R = (new r.Matrix4).lookAt(this.cameraControls.cameras[u.DOLLHOUSE].position, this.cameraControls.controls[u.DOLLHOUSE].target, I)
  22801. , P = (new r.Euler).setFromRotationMatrix(R, f.warp.eOrder)
  22802. , O = this.cameraControls.cameras[u.DOLLHOUSE].position.distanceTo(this.cameraControls.controls[u.DOLLHOUSE].target);
  22803. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(Math.min(O, T), !0);
  22804. var L = new r.Euler(S.x - P.x,S.y - P.y,S.z - P.z,f.warp.eOrder);
  22805. L.y = L.y > Math.PI ? L.y -= 2 * Math.PI : L.y < -Math.PI ? L.y += 2 * Math.PI : L.y,
  22806. this.path.burnsDir = Math.sign(L.y);
  22807. var D = new r.Euler(0,0,0,f.warp.eOrder)
  22808. , B = new r.Vector3;
  22809. y.start(v.vector(this.cameraControls.controls[u.DOLLHOUSE].target, g), p, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToSameMode),
  22810. y.start(function(e, t) {
  22811. D.x = P.x + e * L.x,
  22812. D.y = P.y + e * L.y,
  22813. D.z = P.z + e * L.z;
  22814. var i = O + e * (M - O);
  22815. B.set(0, 0, i).applyEuler(D).add(this.cameraControls.controls[u.DOLLHOUSE].target),
  22816. this.cameraControls.cameras[u.DOLLHOUSE].position.copy(B).add(this.model.position)
  22817. }
  22818. .bind(this), p, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToSameMode),
  22819. y.start(function(e, t) {
  22820. this.cameraControls.controls[u.DOLLHOUSE].update(),
  22821. this.quaternion.copy(this.cameraControls.cameras[u.DOLLHOUSE].quaternion),
  22822. this.position.copy(this.cameraControls.cameras[u.DOLLHOUSE].position)
  22823. }
  22824. .bind(this), p, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToSameMode)
  22825. } else
  22826. F.warn("invalid warp destination in flyToSameMode()? ignore it then");
  22827. else if (this.path.placeCpm(),
  22828. this.path.fadeInCpm(f.path.fadeInTime),
  22829. i) {
  22830. this.model.warpDestFloors(i.floorVisibility);
  22831. var U = this.cameraControls.cameras[u.FLOORPLAN]
  22832. , k = this.cameraControls.controls[u.FLOORPLAN]
  22833. , H = k.target.clone()
  22834. , G = i.position.clone().sub(H)
  22835. , z = U.position.clone().sub(k.target)
  22836. , W = z.length()
  22837. , j = new r.Vector3(-1,0,0).applyQuaternion(i.quaternion).normalize()
  22838. , Y = Math.atan2(k.offset.x, k.offset.z)
  22839. , X = Math.atan2(j.x, j.z)
  22840. , Z = k.absoluteScale
  22841. , q = m.convertWorkshopOrthoZoom(i.orthoZoom);
  22842. y.start(function(e, t) {
  22843. k.target.copy(G).multiplyScalar(e).add(H);
  22844. var i = Y + (X - Y) * e;
  22845. k.offset.x = W * Math.sin(i),
  22846. k.offset.z = W * Math.cos(i),
  22847. U.position.copy(k.target).add(k.offset),
  22848. k.absoluteScale = Z + e * (q - Z),
  22849. k.update(),
  22850. this.quaternion.copy(U.quaternion),
  22851. this.position.copy(U.position),
  22852. this.target.copy(k.target),
  22853. this.camera.projectionMatrix.copy(U.projectionMatrix)
  22854. }
  22855. .bind(this), p, null, 0, A[f.flydown.movementEasing], null, V.FlyToSameMode)
  22856. } else
  22857. F.info("flyToSameMode() funny floorplan view? skipping");
  22858. return y.setTimeout(function(e) {
  22859. this.mode = e,
  22860. h(),
  22861. o.resolve(!0)
  22862. }
  22863. .bind(this, this.mode), p, V.FlyToSameMode),
  22864. this.mode = u.TRANSITIONING,
  22865. o.promise()
  22866. }
  22867. }
  22868. ,
  22869. n.prototype.flyToNewMode = function(e, t) {
  22870. e = e || {};
  22871. var i = e.mode
  22872. , n = e.pano
  22873. , o = e.duration
  22874. , a = e.warpDest
  22875. , s = e.callback
  22876. , l = e.force
  22877. , c = e.quaternion;
  22878. if (t = t || $.Deferred(),
  22879. this.isWarping())
  22880. return F.warn("Player.flyToNewMode() -> Cannot fly when warping"),
  22881. s && s(!1),
  22882. t.reject("Cannot change mode during tour transition").promise();
  22883. if (this.mode === u.TRANSITIONING)
  22884. return s && s(!1),
  22885. t.reject("Cannot change mode during mode transition").promise();
  22886. if (i === this.mode)
  22887. return l ? (this.flyToSameMode(n, o, a, s).done(t.resolve.bind(t)).fail(t.reject.bind(t)),
  22888. t.promise()) : (s && s(!1),
  22889. t.reject("Already in " + i + " mode").promise());
  22890. var h = a || !1;
  22891. F.debug("Switching mode to " + i);
  22892. var d = function() {
  22893. N.delayOneFrame(function() {
  22894. this.flyToNewMode(e, t)
  22895. }
  22896. .bind(this))
  22897. }
  22898. .bind(this);
  22899. if (n && this.checkAndWaitForPanoLoad(n, "low", "low", this.basePanoSize, d))
  22900. return t.promise();
  22901. if (!this.model.meshTexturesLoaded && this.isOutsideMode(i))
  22902. return F.info("Waiting for model textures to be loaded before going out to dollhouse"),
  22903. this.model.waitForLoad(this.model, function() {
  22904. return this.model.meshTexturesLoaded;
  22905. }
  22906. .bind(this)),
  22907. this.model.loadMeshTextures().done(d),
  22908. t.promise();
  22909. this.history.invalidate(),
  22910. this.updateLastView();
  22911. var p = this.mode
  22912. , C = this.cameraControls.cameras[i];
  22913. e = g.deepExtend({}, f[i], f[p + "-" + i]);
  22914. var I = void 0 !== o ? o : e.transitionTime;
  22915. this.emit(w.ModeChanging, p, i, n),
  22916. n && (this.currentPano = n),
  22917. this.switchCameraMode(i, c),
  22918. y.cancelById(V.LookTransition);
  22919. //before fly---------------------
  22920. if(this.mode == "panorama"){
  22921. if(this.model.floorLogos){
  22922. this.model.floorLogos[0].visible = false;
  22923. this.model.floorLogos[1].visible = false;
  22924. }
  22925. }
  22926. if(i == "panorama"){
  22927. this.transitionPos({type:"beforeFlyIn", pano:n, dur:I})//add
  22928. }else{
  22929. this.transitionPos({type:"beforeFlyOut", dur:I/2})//add
  22930. }
  22931. //------------------------------------
  22932. var _ = (new r.Vector3).copy(this.position);
  22933. if (i === u.PANORAMA){
  22934. this.emit(w.PanoChosen, n, n),
  22935. setTimeout(function() {
  22936. n.floor.enter(i)
  22937. }
  22938. .bind(this), I / 2),
  22939. this.path.fadeOutCpm(f.path.fadeOutTime);
  22940. if(this.model.floorLogos){
  22941. this.model.floorLogos[0].position.copy(n.floorPosition.clone().sub(this.model.position));//改
  22942. this.model.floorLogos[1].position.copy(this.model.floorLogos[0].position);//for floorIcon position
  22943. }
  22944. }else if (i === u.DOLLHOUSE) {
  22945. if (h && (this.model.stayPut = !0),
  22946. a ? (this.cameraControls.controls[u.DOLLHOUSE].resetRanges(1, !0),
  22947. this.model.warpDestFloors(a.floorVisibility)) : this.model.toggleAllFloors(!0),
  22948. this.path.placeCpm(),
  22949. this.path.fadeInCpm(f.path.fadeInTime),
  22950. h) {
  22951. var T = new r.Vector3(this.model.center.x,0,this.model.center.z);
  22952. _.set(15, 10, 15);
  22953. var M = new r.Vector3(0,0,-1).applyQuaternion(a.quaternion)
  22954. , R = new r.Raycaster(a.position.clone(),M.clone(),0,1 / 0)
  22955. , P = R.intersectObjects([this.sceneIntersectionPlane]);
  22956. P.length ? (T.copy(P[0].point),
  22957. _.copy(a.position),
  22958. 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),
  22959. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(3, !0)),
  22960. this.cameraControls.controls[u.DOLLHOUSE].target.copy(T),
  22961. _.add(this.model.position),
  22962. C.position.copy(_),
  22963. this.cameraControls.controls[u.DOLLHOUSE].update()
  22964. }
  22965. } else if (this.path.placeCpm(),
  22966. this.path.fadeInCpm(f.path.fadeInTime),
  22967. a) {
  22968. this.model.warpDestFloors(a.floorVisibility);
  22969. var O = this.cameraControls.cameras[u.FLOORPLAN]
  22970. , L = this.cameraControls.controls[u.FLOORPLAN]
  22971. , D = O.position.clone().sub(L.target)
  22972. , B = new r.Vector3(-1,0,0).applyQuaternion(a.quaternion).normalize()
  22973. , U = Math.atan2(B.x, B.z);
  22974. L.target.copy(a.position);
  22975. var k = D.length();
  22976. L.offset.x = k * Math.sin(U),
  22977. L.offset.y = 0,
  22978. L.offset.z = k * Math.cos(U),
  22979. O.position.copy(L.target).add(L.offset);
  22980. L.target.clone().sub(C.position);
  22981. C.quaternion.copy(a.quaternion),
  22982. L.currentScale = m.convertWorkshopOrthoZoom(a.orthoZoom),
  22983. L.absoluteScale = L.currentScale,
  22984. L.update()
  22985. } else
  22986. this.model.currentFloor.enter(i);
  22987. var H = this.currentPano
  22988. , G = this.position.clone();
  22989. return this.emit(w.FlyingStarted, _, G, n, this.currentPano),
  22990. this.flying = !0,
  22991. this.isOutsideMode(i) && this.is360View(p, H) ? (h || i !== u.DOLLHOUSE || (C.position.set(15, 10, 15),
  22992. C.controls.target.set(this.model.center.x, 0, this.model.center.z),
  22993. C.controls.update()),
  22994. e.blackoutStyle = S.FADEIN,
  22995. I = f.show360Views.transitionTime,
  22996. this.fade360View(I, C, e)) : this.isOutsideMode(p) && this.is360View(i, n) ? (h && this.switchCameraMode(i, h.quaternion),
  22997. this.mode = i,
  22998. this.path && this.path.popOutCpm(),
  22999. e.blackoutStyle = S.END,
  23000. I = f.show360Views.transitionTime,
  23001. this.fade360View(I, C, e)) : (y.start(v.property(this.model, "alpha", e.modelAlpha, null), I * e.modelAlphaLength, null, e.modelAlphaDelay, null, V.FlyToNewMode),
  23002. y.start(v.vector(this.position, C.position), I, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToNewMode),
  23003. y.start(v.quaternion(this.quaternion, C.quaternion), I * e.rotationDuration, null, e.rotationDelay, A[f.flydown.rotationEasing], null, V.FlyToNewMode),
  23004. y.start(v.matrix4(this.camera.projectionMatrix, C.projectionMatrix), I * e.cameraMatrixDuration, null, e.cameraMatrixDelay, e.cameraMatrixEase, null, V.FlyToNewMode),
  23005. y.start(v.uniform(this.model.skybox, "opacity", e.skyboxOpacity), I * e.skyboxOpacityLength, null, e.skyboxOpacityDelay, null, V.FlyToNewMode),
  23006. y.start(v.property(this.reticule.material.uniforms.opacity, "value", 0), I, null, V.FlyToNewMode)),
  23007. y.setTimeout(function() {
  23008. this.flying = !1,
  23009. p === u.PANORAMA && i !== u.PANORAMA ? this.currentPano.exit() : p !== u.PANORAMA && i === u.PANORAMA && (this.currentPano !== H && H.exit(),
  23010. this.currentPano.enter(),
  23011. this.path.placeCpm(),
  23012. this.path.fadeOutCpm(f.path.fadeOutTime),
  23013. this.spider.draw()),
  23014. p === u.DOLLHOUSE && this.cameraControls.controls[u.DOLLHOUSE].resetRanges(),
  23015. this.mode = i,
  23016. this.emit(w.FlyingEnded, _, G, this.currentPano, H)
  23017. //add:
  23018. this.updateMarkerVisi(),
  23019. (p === u.PANORAMA || i == u.PANORAMA) && this.updateHotVisible(),
  23020. this.mode == u.PANORAMA&&this.model.floorLogos&&(
  23021. this.model.changefloorLogoOpa({index:0, from:0, opa:1, dur: 150 }),//this.model.floorLogoShow(0,150);
  23022. this.model.floorLogos[0].visible = true
  23023. )
  23024. h && p !== u.PANORAMA && i === u.PANORAMA ? this.startWarp(b.Retain, E.Retain, x.BLACK, null, null, s) : (s && s(),
  23025. t.resolve())
  23026. }
  23027. .bind(this), I, V.FlyToNewMode),
  23028. this.mode = u.TRANSITIONING,
  23029. t.promise()
  23030. }
  23031. ,
  23032. n.prototype.fade360View = function(e, t, i) {
  23033. this.tagManager.hideShowTagsForBlackoutStyle(i.blackoutStyle, e),
  23034. $(this.domElement).fadeOut(.5 * e, function() {
  23035. this.model.skybox.material.uniforms.opacity.value = i.skyboxOpacity,
  23036. this.model.alpha = i.modelAlpha,
  23037. this.position.copy(t.position),
  23038. this.quaternion.copy(t.quaternion),
  23039. this.camera.projectionMatrix.copy(t.projectionMatrix),
  23040. $(this.domElement).fadeIn(.5 * e)
  23041. }
  23042. .bind(this))
  23043. }
  23044. ,
  23045. n.prototype.findDefaultViews = function() {
  23046. this.findDefaultView(this.lastInsideView, !0),
  23047. this.findDefaultView(this.last360View, !1)
  23048. }
  23049. ,
  23050. n.prototype.findDefaultView = function(e, t) {
  23051. var i, n = this.model.heroLocations, r = this.model.panos, o = n.findIndex(function(e) {
  23052. if (e.cameraMode !== u.PANORAMA)
  23053. return !1;
  23054. var i = r.get(e.panoId);
  23055. return i && i.isAligned() === t
  23056. });
  23057. o >= 0 ? (i = r.get(n[o].panoId),
  23058. e.update({
  23059. cameraMode: u.PANORAMA,
  23060. pano: i,
  23061. position: n[o].position,
  23062. quaternion: n[o].quaternion
  23063. })) : (o = r.list.findIndex(function(e) {
  23064. return e.isAligned() === t
  23065. }),
  23066. o >= 0 ? (i = r.list[o],
  23067. e.update({
  23068. cameraMode: u.PANORAMA,
  23069. pano: i,
  23070. position: i.position
  23071. })) : F.warn("There are no", t ? "inside" : "360º", "views in this model"))
  23072. }
  23073. ,
  23074. n.prototype.updateLastView = function() {
  23075. if (this.mode === u.PANORAMA) {
  23076. var e = this.currentPano.isAligned() ? this.lastInsideView : this.last360View;
  23077. e.update({
  23078. pano: this.currentPano,
  23079. position: this.position,
  23080. quaternion: this.quaternion
  23081. })
  23082. }
  23083. }
  23084. ,
  23085. n.prototype.goToLastView = function(e, t) {
  23086. var i = $.Deferred()
  23087. , n = i.resolve.bind(i)
  23088. , r = i.reject.bind(i)
  23089. , o = e ? this.lastInsideView : this.last360View;
  23090. return this.isInMode(u.PANORAMA) && this.currentPano.isAligned() !== e && this.updateLastView(),
  23091. this.isInMode(u.PANORAMA) ? (this.path && this.path.popOutCpm(),
  23092. this.fadeToView(e, o, f.show360Views.transitionTime, t).done(n).fail(r)) : this.isOutsideMode() && this.flyToNewMode({
  23093. mode: o.cameraMode,
  23094. pano: o.pano,
  23095. quaternion: o.quaternion,
  23096. callback: t
  23097. }).done(n).fail(r),
  23098. i.promise()
  23099. }
  23100. ,
  23101. n.prototype.fadeToView = function(e, t, i, n) {
  23102. var r = $.Deferred()
  23103. , o = r.resolve.bind(r)
  23104. , a = r.reject.bind(r);
  23105. if (!t.isValid() || t.cameraMode === u.PANORAMA && !t.pano)
  23106. return F.warn("Tried to fade to an illegal view", t.cameraMode),
  23107. a("Cannot go to illegal view"),
  23108. r.promise();
  23109. var s = (f[t.cameraMode],
  23110. function() {
  23111. $(this.domElement).fadeIn(.5 * i),
  23112. n && n(),
  23113. o()
  23114. }
  23115. .bind(this))
  23116. , l = e ? S.FADEIN : S.END;
  23117. return this.tagManager.hideShowTagsForBlackoutStyle(l, i),
  23118. $(this.domElement).fadeOut(.5 * i, function() {
  23119. this.model.fadePanoMarkers(e ? f.panorama.markerOpacity : 0),
  23120. t.cameraMode === u.PANORAMA ? this.flyToPano({
  23121. pano: t.pano,
  23122. lookAtPoint: d.FORWARD.clone().applyQuaternion(t.quaternion).add(t.pano.position),
  23123. duration: 0
  23124. }, s) : this.flyToNewMode({
  23125. mode: t.cameraMode,
  23126. quaternion: t.quaternion,
  23127. duration: 0,
  23128. callback: s
  23129. })
  23130. }
  23131. .bind(this)),
  23132. r.promise()
  23133. }
  23134. ,
  23135. n.prototype.startWarp = function(e, t, i, n, r, o) {
  23136. if (this.cameraControls.activeControl && (this.cameraControls.activeControl.enabled = !1),
  23137. this.flying)
  23138. return F.warn("Player.startWarp() -> Cannot warp when flying"),
  23139. o && o(),
  23140. !1;
  23141. null !== e && void 0 !== e || (e = b.Show),
  23142. this.history.invalidate()
  23143. e !== b.Retain ? this.path.brushToWarpPano(i, x.BLACK) || (i = x.BLACK) : i = this.path.upcomingTransType;
  23144. var a = this.path.warpDestPano && !this.path.warpDestPano.isAligned();
  23145. return this.emit(w.WarpStarted, a, i, n, r),
  23146. n = n || S.MIDDLE,
  23147. this.path.warpToPano(i, n, r, function() {
  23148. t === E.Slow ? this.path.discardSlow() : t === E.Standard && this.path.discardPathObject(),
  23149. this.emit(w.WarpEnded, i),
  23150. this.cameraControls.activeControl && (this.cameraControls.activeControl.enabled = !0),
  23151. o && o()
  23152. }
  23153. .bind(this)),
  23154. e === b.Hide && this.path.discardPathObject(),
  23155. !0
  23156. }
  23157. ,
  23158. n.prototype.warpToPanoById = function(e, t, i, n, r, o, a, s) {
  23159. return this.path.setWarpDestinationByPanoId(e, t) ? this.startWarp(i, n, r, o, a, s) : (F.warn("Player.warpToPanoById() -> Could not setWarpDestinationByPanoId()"),
  23160. s && s(),
  23161. !1)
  23162. }
  23163. ,
  23164. n.prototype.warpToPanoByHeroIndex = function(e, t, i, n, r, o, a) {
  23165. return this.path.setWarpDestinationByHeroIndex(e) ? this.startWarp(t, i, n, r, o, a) : (F.warn("Player.warpToPanoByHeroIndex() -> Could not setWarpDestinationByHeroIndex()"),
  23166. a && a(),
  23167. !1)
  23168. }
  23169. ,
  23170. n.prototype.warpToPano = function(e, t, i, n, r, o, a, s) {
  23171. return this.warpToPanoById(e.id, t, i, n, r, o, a, s)
  23172. }
  23173. ,
  23174. n.prototype.warpToNonPanoByHeroIndex = function(e, t) {
  23175. return this.path.setWarpDestinationByHeroIndex(e) ? (this.path.warpToNonPano(t),
  23176. !0) : (F.warn("Player.warpToNonPanoByHeroIndex() -> Could not setWarpDestinationByHeroIndex()"),
  23177. t && t(),
  23178. !1)
  23179. }
  23180. ,
  23181. n.prototype.aimTourCamera = function(e, t, i, n) {
  23182. return F.debug("player.aimTourCamera(" + e + ") calling warpToPanoByHeroIndex(" + e + ")"),
  23183. this.warpToPanoByHeroIndex(e, t, i, null, null, null, n)
  23184. }
  23185. ,
  23186. n.prototype.showPathToHeroLocation = function(e) {
  23187. this.path.setWarpDestinationByHeroIndex(e) && this.path.brushToWarpPano(x.STD, x.BLACK)
  23188. }
  23189. ,
  23190. n.prototype.tourInterlude = function(e, t) {
  23191. this.history.invalidate();
  23192. this.path.discardSlow();
  23193. //xzw:
  23194. var a = g_data2.tourAudio && g_data2.tourAudio[this.model.heroLocations[this.director.currentItem].sid];
  23195. var currTime = g_tourAudio ? g_tourAudio.currentTime * 1000 : 0;
  23196. var rotTime = (a && a.music) ? a.time - currTime : 2000;
  23197. this.path.waitNextStep(e, function() {
  23198. t && t()
  23199. }.bind(this), rotTime)
  23200. }
  23201. ,
  23202. n.prototype.stopInterlude = function() {
  23203. this.interruptAndFastForward(null, 0)
  23204. }
  23205. ,
  23206. n.prototype.interruptAndFastForward = function(e, t) {
  23207. this.isWarping() && this.emit(w.WarpInterrupted, this.path.activeTransType, e, t),
  23208. this.flying && this.emit(w.FlyingInterrupted),
  23209. this.path.interruptAndFastForward(e, t)
  23210. }
  23211. ,
  23212. n.prototype.setSize = function(e, t) {
  23213. var i = e / t;
  23214. this.baseFov = B.clampVFOV(f.insideFOV, f.insideFOVMax, e, t);
  23215. var n = B.getHFOVFromVFOV(f.insideFOV, e, t);
  23216. n > f.insideFOVMax ? this.baseFov = B.getVFOVFromHFOV(f.insideFOVMax, e, t) : this.baseFov = f.insideFOV;
  23217. for (var r in this.cameraControls.cameras) {
  23218. var o = this.cameraControls.cameras[r];
  23219. o.fov = this.baseFov * (1 / this.zoomLevel),
  23220. o.updateAspect(i)
  23221. }
  23222. }
  23223. ,
  23224. n.prototype.toJSON = function() {
  23225. var e = {};
  23226. return this.cameraControls.activeControl ? (e = this.cameraControls.activeControl.toJSON(),
  23227. e.camera_mode = u.toInt(this.mode),
  23228. this.isOutsideMode() ? this.model.allFloorsVisible ? e.floor_visibility = [] : e.floor_visibility = this.model.floors.list.map(function(e) {
  23229. return e.hidden ? 0 : 1
  23230. }) : u.PANORAMA && (e.scan_id = this.currentPano.id),
  23231. e) : e
  23232. }
  23233. ,
  23234. n.prototype.getCurrentNodePanos = function(e) {
  23235. this.model.panos.map;
  23236. if (e.length = 0,
  23237. this.path.nodes)
  23238. for (var t = 0; t < this.path.nodes.length; t++) {
  23239. var i = this.path.nodes[t];
  23240. e.push(this.model.panos.get(i))
  23241. }
  23242. }
  23243. ,
  23244. n.prototype.zoomIncrementally = function(e) {
  23245. var t = this.zoomLevel;
  23246. this.zoomTo(this.zoomLevel + e),
  23247. t !== this.zoomLevel && this.currentPano && this.zoomStats.addZoomAction(t, this.zoomLevel, this.currentPano.id)
  23248. }
  23249. ,
  23250. n.prototype.zoomInIncrementally = function(e) {
  23251. e = e || this.defaultZoomIncrement,
  23252. this.zoomIncrementally(e)
  23253. }
  23254. ,
  23255. n.prototype.zoomOutIncrementally = function(e) {
  23256. e = e || -this.defaultZoomIncrement,
  23257. this.zoomIncrementally(e)
  23258. }
  23259. ,
  23260. n.prototype.zoomBy = function(e) {
  23261. this.zoomTo(this.zoomLevel * e)
  23262. }
  23263. ,
  23264. n.prototype.zoomIn = function() {
  23265. this.zoomBy(1 + this.zoomSpeed)
  23266. }
  23267. ,
  23268. n.prototype.zoomOut = function() {
  23269. this.zoomBy(1 - this.zoomSpeed)
  23270. }
  23271. ,
  23272. n.prototype.zoomTo = function(e, t) {
  23273. if (t || f.zoom.enabled && this.mode === u.PANORAMA && this.zoomEnabled) {
  23274. if (e < f.zoom.min && (e = f.zoom.min),
  23275. e > f.zoom.max && (e = f.zoom.max),
  23276. e > this.zoomLevel ? (this.emit(O.ZoomIn),
  23277. e === f.zoom.max && this.emit(O.ZoomMax)) : e < this.zoomLevel && (this.emit(O.ZoomOut),
  23278. e === f.zoom.min && this.emit(O.ZoomMin)),
  23279. this.cameraControls.activeControl) {
  23280. var i = this.cameraControls.activeControl.camera;
  23281. this.zoomLevel = e,
  23282. i.fov = this.baseFov * (1 / this.zoomLevel),
  23283. i.updateProjectionMatrix(),
  23284. this.zoomFov = i.fov
  23285. }
  23286. }
  23287. }
  23288. ,
  23289. n.prototype.increaseZoomSpeed = function() {
  23290. this.zoomSpeed = this.clampZoomSpeed(this.zoomSpeed + this.zoomSpeedAdjust)
  23291. }
  23292. ,
  23293. n.prototype.decreaseZoomSpeed = function() {
  23294. this.zoomSpeed = this.clampZoomSpeed(this.zoomSpeed - this.zoomSpeedAdjust)
  23295. }
  23296. ,
  23297. n.prototype.clampZoomSpeed = function(e) {
  23298. return e < 0 ? 0 : e
  23299. }
  23300. ,
  23301. n.prototype.activatePersistentZooming = function(e) {
  23302. this.zooming = e ? 1 : -1
  23303. }
  23304. ,
  23305. n.prototype.deactivatePersistentZooming = function() {
  23306. this.zooming = 0
  23307. }
  23308. ,
  23309. n.prototype.zoomDefault = function() {
  23310. this.zoomTo(1, !0)
  23311. }
  23312. ,
  23313. n.prototype.smoothZoomToDefault = function(e, t) {
  23314. var i, n = this.zoomLevel,
  23315. r = function(e) {
  23316. e > 1 && (e = 1),
  23317. i = n * (1 - e) + e,
  23318. this.zoomTo(i, !0)
  23319. }.bind(this),
  23320. o = function() {
  23321. this.zoomDefault(),
  23322. t && window.setTimeout(t, 50)
  23323. }.bind(this);
  23324. y.start(r, e, o, null, 0, A[f.transition.blendEasing])
  23325. }
  23326. ,
  23327. n.prototype.updateZoomPano = function() {
  23328. if (!this.panoRenderer.zoomPanoRenderingDisabled && this.mode === u.PANORAMA) {
  23329. var e = this.currentPano;
  23330. if (e) {
  23331. var t = this.zoomLevel > f.zoom.activationThreshold
  23332. , i = this.flying && this.nextPano && this.nextPano !== this.currentPano
  23333. , n = !i && !this.isWarping()
  23334. , r = t /*&& n*/; // 允许flying状态下加载4K图
  23335. this.tileDownloader.tilePrioritizer.setZoomingActive(r),
  23336. this.panoRenderer.setZoomingActive(r, e, !0);
  23337. var o = function(e, t) {
  23338. this.panoRenderer.resetRenderStatus(e.id, !1, !0, this.qualityManager.getMaxNavPanoSize()),
  23339. this.panoRenderer.clearAllQueuedUploadsForPano(e.id),
  23340. this.panoRenderer.renderPanoTiles(e.id, null, !1, !1),
  23341. e.setZoomed(t)
  23342. }
  23343. .bind(this);
  23344. r && !e.zoomed ? (o(e, !0),
  23345. this.panoRenderer.enableUltraHighQualityMode(function() {
  23346. this.qualityManager.useUltraHighResolutionPanos && !f.zoom.overridemax && (f.zoom.max = D.ultraHighQualityMaxZoom),
  23347. r && o(e, !0)
  23348. }
  23349. .bind(this))) : !t && e.zoomed && o(e, !1)
  23350. }
  23351. }
  23352. },
  23353. n.prototype.checkHasNeighbor = function(pano){//add
  23354. for(var i in pano.neighbourPanos ){
  23355. if(i == pano.id)continue;
  23356. if(pano.neighbourPanos[i]){
  23357. return true;
  23358. }
  23359. }
  23360. }
  23361. ,
  23362. t.exports = n
  23363. }
  23364. ).call(this, "/js/player.js")
  23365. }
  23366. , {
  23367. "./constants": 8,
  23368. "./enum/AlignmentType": 17,
  23369. "./enum/BlackoutStyle": 18,
  23370. "./enum/ControlEvents": 21,
  23371. "./enum/Keys": 30,
  23372. "./enum/ModelManagerEvents": 33,
  23373. "./enum/PanoSizeClass": 36,
  23374. "./enum/PanoramaEvents": 37,
  23375. "./enum/PathDiscardMode": 38,
  23376. "./enum/PathDisplayMode": 39,
  23377. "./enum/PlayerEvents": 40,
  23378. "./enum/TagStates": 44,
  23379. "./enum/Vectors": 50,
  23380. "./enum/Viewmode": 51,
  23381. "./enum/WarpStyle": 52,
  23382. "./enum/ZoomEvents": 53,
  23383. "./exception/BasicException": 55,
  23384. "./model/ModelManager": 140,
  23385. "./objects/NSpider": 147,
  23386. "./objects/Panorama": 148,
  23387. "./objects/Reticule": 149,
  23388. "./objects/ShowPath": 151,
  23389. "./objects/Snapshot": 153,
  23390. "./objects/View": 154,
  23391. "./settings": 166,
  23392. "./shaders": 167,
  23393. "./tile/TileDownloader": 171,
  23394. "./tile/TilePrioritizer": 172,
  23395. "./util/ZoomStats": 179,
  23396. "./util/browser": 182,
  23397. "./util/camera": 183,
  23398. "./util/cameraLight": 184,
  23399. "./util/common": 185,
  23400. "./util/easing": 186,
  23401. "./util/history": 187,
  23402. "./util/lerp": 188,
  23403. "./util/logger": 189,
  23404. "./util/math": 190,
  23405. "./util/transitions": 195,
  23406. "hot":"hot",
  23407. "scaleImg":"scaleImg",
  23408. events: 202,
  23409. three: 217
  23410. }],
  23411. "scaleImg":[function(t, e){// xzw
  23412. var OUTPUT = e;
  23413. (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")}
  23414. function n(t){if(t){var e,a=G.getImageData(0,0,s,f),i=a.data;for(e=0;at>e;e+=4)
  23415. 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}
  23416. return G.getImageData(0,0,s,f)}
  23417. 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}
  23418. a||(a=t.input,i=t.output,r=t.inputRemovable,t.scale&&(t=t.scale));var u,d;if(a.src)
  23419. if(u=document.createElement("canvas"),null!=a.naturalWidth)
  23420. 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}
  23421. else
  23422. 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)
  23423. 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)
  23424. for(h(),J=n(),K=J.data,x=0;f>x;x++)
  23425. 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)
  23426. 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)
  23427. W=new Float32Array(at);else
  23428. for(W=[],et=0;at>et;++et)
  23429. W[et]=0;for(b=0;w>b;b++)
  23430. 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)
  23431. 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;}
  23432. delete p,h(),J=n(W)}
  23433. 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}
  23434. if("png-src"===i||"jpeg-src"===i)
  23435. return B.toDataURL("image/"+i.split("-")[0],0.85)}
  23436. return B}
  23437. var e=this;"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=t),exports.scale=t):c=t}).call(this);
  23438. OUTPUT.exports = c;
  23439. }, {}
  23440. ],
  23441. 156: [function(e, t, i) {
  23442. (function(i) {
  23443. "use strict";
  23444. function n(e, t) {
  23445. this.model = e,
  23446. this.panos = e.panos,
  23447. this.player = t,
  23448. this.imagePanos = this.listImagePanos(),
  23449. this.retryMinimumTime = 1e4
  23450. }
  23451. var r = (e("three"),
  23452. e("./enum/Viewmode"))
  23453. , o = (e("./settings"),
  23454. e("./objects/Panorama"))
  23455. , a = e("./util/logger")
  23456. , s = new a(i);
  23457. n.prototype.start = function() {
  23458. this.loadNextPano(function(e) {
  23459. e ? this.start() : (s.debug("No suitable pano loaded, waiting a little while before looking again"),
  23460. setTimeout(function() {
  23461. this.start()
  23462. }
  23463. .bind(this), 1e3))
  23464. }
  23465. .bind(this))
  23466. }
  23467. ,
  23468. n.prototype.validLoadTarget = function(e) {
  23469. return e && !e.isLoaded("high") && Date.now() - e.failedLoadingAt > this.retryMinimumTime
  23470. }
  23471. ,
  23472. n.prototype.listImagePanos = function() {
  23473. var e = []
  23474. , t = this;
  23475. return this.model.images.forEach(function(i) {
  23476. if (i.metadata && i.metadata.scan_id) {
  23477. var n = t.model.panos.get(i.metadata.scan_id);
  23478. n && !n.isLoaded("high") && e.push(n)
  23479. }
  23480. }),
  23481. e
  23482. }
  23483. ,
  23484. n.prototype.nextNotLoadedImage = function() {
  23485. for (; this.imagePanos.length > 0; ) {
  23486. var e = this.imagePanos[0];
  23487. if (!e.isLoaded("high"))
  23488. return e;
  23489. this.imagePanos.shift()
  23490. }
  23491. return null
  23492. }
  23493. ,
  23494. n.prototype.loadNextPano = function(e) {
  23495. var t, i, n = this.model.waitQueue.filter(function(e) {
  23496. return e.object instanceof o
  23497. });
  23498. n.length > 0 ? (t = n[0].object,
  23499. s.debug("Overrode pano selection: Flying to an unloaded pano " + t.id)) : this.validLoadTarget(this.player.currentPano) ? (t = this.player.currentPano,
  23500. s.debug("Overrode pano selection: Currently at an unloaded pano " + t.id)) : this.validLoadTarget(this.player.closestPano) ? (t = this.player.closestPano,
  23501. s.debug("Overrode pano selection: Hovering over an unloaded pano " + t.id)) : this.validLoadTarget(this.nextNotLoadedImage()) ? (i = "high",
  23502. t = this.imagePanos[0],
  23503. 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())]),
  23504. t && s.debug("Normal pano selection: neighbor " + t.id)),
  23505. t ? (i = i || t.isLoaded("low") ? "high" : "low",
  23506. s.debug("Preloading " + i + "-res pano " + t.id),
  23507. t.loadCube(i).done(e).fail(function() {
  23508. s.warn("Failed preloading pano", t.id, ", marking it as failed and forgetting it for a while"),
  23509. e()
  23510. })) : e && e(null)
  23511. }
  23512. ,
  23513. t.exports = n
  23514. }
  23515. ).call(this, "/js/preloaders.js")
  23516. }
  23517. , {
  23518. "./enum/Viewmode": 51,
  23519. "./objects/Panorama": 148,
  23520. "./settings": 166,
  23521. "./util/logger": 189,
  23522. three: 217
  23523. }],
  23524. 157: [function(e, t, i) {
  23525. (function(i) {
  23526. "use strict";
  23527. function n(e, t, i, n, r) {
  23528. this.qualityManager = e,
  23529. this.scene = t,
  23530. this.camera = i,
  23531. this.container = r,
  23532. this.controls = n,
  23533. this.controls.enabled = !0,
  23534. this.controls.locked = !0,
  23535. this.quickstartCamera = n.camera,
  23536. this.quickstartCamera.fov = h.clampVFOV(a.insideFOV, a.insideFOVMax, $("#player").width(), $("#player").height()),
  23537. this.skybox = null
  23538. }
  23539. var r = e("three")
  23540. , o = e("../util/logger")
  23541. , a = e("../constants")
  23542. , s = (e("../util/transitions"),
  23543. e("../util/lerp"),
  23544. e("../util/easing"),
  23545. e("../enum/Vectors"))
  23546. , l = e("../enum/PanoSizeClass")
  23547. , c = (e("../materials/ModelTextureMaterial"),
  23548. e("../materials/CubemapMaterial"))
  23549. , h = (e("../cameras/PanoramaCamera"),
  23550. e("../controls/PanoramaControls"),
  23551. e("../tile/TileUtils"),
  23552. e("../util/camera"),
  23553. e("../util/cameraLight"))
  23554. , u = (e("../util/browser"),
  23555. e("../settings"),
  23556. e("../gui/helpManager"),
  23557. new o(i));
  23558. n.prototype.load = function(e) {
  23559. e.pano.shouldRedrawOnBaseLoaded = !0;
  23560. var t, i, n = this, r = s.FORWARD.clone().applyQuaternion(e.quaternion), o = r.clone().negate();
  23561. this.controls.lookAt(r.add(this.quickstartCamera.position));
  23562. var a = this.qualityManager.getPanoSize(l.BASE)
  23563. , c = this.qualityManager.getPanoSize(l.STANDARD);
  23564. if (e.pano.tiled) {
  23565. u.warn("Loading startPano, TILED", e.pano.id);
  23566. var d = h.getHFOVForCamera(this.quickstartCamera, $("#player").width(), $("#player").height())
  23567. , p = this.quickstartCamera.fov;
  23568. u.warn("Quickstart loading tiles in frustum: [horizontal FOV: " + d + ", vertical FOV: " + p + "]"),
  23569. t = e.pano.loadTiledPano(c, r, {
  23570. hFov: d,
  23571. vFov: p
  23572. }, !1, !1, !0),
  23573. i = e.pano.loadTiledPano(a, o, null, !1, !1, !0)
  23574. } else
  23575. u.warn("Loading startPano", e.pano.id),
  23576. t = e.pano.loadCube("high");
  23577. return $.when(t).then(function() {
  23578. n.init(e.pano, e.quaternion),
  23579. e.pano.tiled ? i.done(function() {
  23580. e.pano.lockUntilRenderingComplete = !1,
  23581. this.controls.locked = !1
  23582. }
  23583. .bind(this)) : this.controls.locked = !1
  23584. }
  23585. .bind(this))
  23586. }
  23587. ,
  23588. n.prototype.init = function(e, t) {
  23589. u.info("Quickstart done loading, adding scene objects"),
  23590. e.lockUntilRenderingComplete = !0,
  23591. this.skybox = new r.Mesh(new r.CubeGeometry(1,1,1),new c({
  23592. side: r.BackSide
  23593. })),
  23594. this.skybox.material.uniforms.map.value = e.getSkyboxTexture(),
  23595. this.skybox.quaternion.copy(e.quaternion),
  23596. this.scene.add(this.skybox),
  23597. $(this.container).show()
  23598. }
  23599. ,
  23600. n.prototype.update = function(e) {
  23601. this.controls.update(e),
  23602. this.camera.copy(this.quickstartCamera)
  23603. }
  23604. ,
  23605. n.prototype.setSize = function(e, t) {
  23606. this.quickstartCamera.updateAspect(e / t)
  23607. }
  23608. ,
  23609. n.prototype.destroy = function() {
  23610. this.scene.remove(this.skybox)
  23611. }
  23612. ,
  23613. t.exports = n
  23614. }
  23615. ).call(this, "/js/scene/QuickstartManager.js")
  23616. }
  23617. , {
  23618. "../cameras/PanoramaCamera": 7,
  23619. "../constants": 8,
  23620. "../controls/PanoramaControls": 13,
  23621. "../enum/PanoSizeClass": 36,
  23622. "../enum/Vectors": 50,
  23623. "../gui/helpManager": 68,
  23624. "../materials/CubemapMaterial": 117,
  23625. "../materials/ModelTextureMaterial": 118,
  23626. "../settings": 166,
  23627. "../tile/TileUtils": 174,
  23628. "../util/browser": 182,
  23629. "../util/camera": 183,
  23630. "../util/cameraLight": 184,
  23631. "../util/easing": 186,
  23632. "../util/lerp": 188,
  23633. "../util/logger": 189,
  23634. "../util/transitions": 195,
  23635. three: 217
  23636. }],
  23637. 158: [function(e, t, i) {
  23638. "use strict";
  23639. function n(e, t, i) {
  23640. this.scene = e,
  23641. this.camera = t,
  23642. this.renderer = null,
  23643. this.effects = i,
  23644. this.animateCallback = null,
  23645. this.composer = null,
  23646. this.qualityManager = null,
  23647. e.renderWidth = 0,
  23648. e.renderHeight = 0,
  23649. this.updateClock = new r.Clock,
  23650. this.components = [],
  23651. this.updateListeners = [],
  23652. this.resizeListeners = [],
  23653. this.forceUpdateSize = !1,
  23654. this.started = !1,
  23655. this.textures = {},
  23656. this.suspendedObjects = []
  23657. }
  23658. var r = e("three")
  23659. , o = e("../shaders")
  23660. , a = e("../enum/SceneRendererEvents")
  23661. , s = e("../enum/GLTextureType")
  23662. , l = e("../enum/GLCubeFaces")
  23663. , c = e("../exception/BasicException")
  23664. , h = e("../exception/RendererCreationException")
  23665. /**********************************************************************fyz改 from徐世廷**********************************************************************/
  23666. , m = e("../util/browser")
  23667. /**************************************************************************************************************************************************/
  23668. , u = e("../settings")
  23669. , d = e("events").EventEmitter;
  23670. window.requestAnimationFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame,
  23671. n.prototype = Object.create(d.prototype),
  23672. n.prototype.addComponent = function(e) {
  23673. this.components.push(e),
  23674. e.update && this.updateListeners.push(e),
  23675. e.setSize && (this.resizeListeners.push(e),
  23676. this.forceUpdateSize = !0)
  23677. }
  23678. ,
  23679. n.prototype.removeComponent = function(e) {
  23680. var t = function(t) {
  23681. return t !== e
  23682. };
  23683. this.components = this.components.filter(t),
  23684. this.updateListeners = this.updateListeners.filter(t),
  23685. this.resizeListeners = this.resizeListeners.filter(t)
  23686. }
  23687. ,
  23688. n.prototype.start = function(e) {
  23689. if (this.started)
  23690. throw new c("Can't start SceneRenderer, already started");
  23691. this.createContext(e),
  23692. /***************************************************VR fyz改 from徐世廷**********************************************************************/
  23693. m.isMobile() && this.boluoVrInit(),
  23694. /*******************************************************************************************************************************/
  23695. this.initComposer(),
  23696. this.started = !0,
  23697. (p = p.bind(this))()
  23698. }
  23699. ,
  23700. n.prototype.createContext = function(e) {
  23701. try {
  23702. this.renderer = new r.WebGLRenderer({antialias: !m.isMobile()}),
  23703. this.renderer.autoClear = !0,
  23704. this.renderer.setPixelRatio(window.devicePixelRatio ? window.devicePixelRatio : 1),
  23705. this.renderer.setSize($("#player").width(), $("#player").height(), false), //改
  23706. this.emit(a.ContextCreated)
  23707. } catch (e) {
  23708. throw new h("Unable to create a WebGL rendering context")
  23709. }
  23710. u.profiling.enabled && this.overrideTextures(),
  23711. e.appendChild(this.renderer.domElement)
  23712. }
  23713. ,
  23714. n.prototype.overrideTextures = function() {
  23715. var e = this.renderer.context
  23716. , t = 0
  23717. , i = e.createTexture;
  23718. e.createTexture = function() {
  23719. var n = i.call(e);
  23720. return n.id = t++,
  23721. this.textures[n.id] = n,
  23722. n
  23723. }
  23724. .bind(this);
  23725. var n = e.texImage2D;
  23726. e.texImage2D = function(t, i, r, o, a, l, c, h, u) {
  23727. var d, p = this.getTextureTypeFromTarget(e, t);
  23728. d = p === s.TextureCube ? e.getParameter(e.TEXTURE_BINDING_CUBE_MAP) : e.getParameter(e.TEXTURE_BINDING_2D),
  23729. void 0 !== c ? n.call(e, t, i, r, o, a, l, c, h, u) : (c = o,
  23730. h = a,
  23731. u = l,
  23732. o = u.naturalWidth,
  23733. a = u.naturalHeight,
  23734. n.call(e, t, i, r, c, h, u));
  23735. var f = this.textures[d.id];
  23736. f.width = p === s.TextureCube ? 6 * o : o,
  23737. f.height = a
  23738. }
  23739. .bind(this);
  23740. var r = e.deleteTexture;
  23741. e.deleteTexture = function(t) {
  23742. delete this.textures[t.id],
  23743. r.call(e, t)
  23744. }
  23745. .bind(this)
  23746. }
  23747. ,
  23748. n.prototype.updateTextureMemory = function() {
  23749. var e = null;
  23750. return function() {
  23751. var t = 0;
  23752. for (var i in this.textures) {
  23753. var n = this.textures[i];
  23754. n.width && n.height && (t += n.width * n.height * 4)
  23755. }
  23756. t !== e && this.emit(a.MemoryUsageUpdated, t),
  23757. e = t
  23758. }
  23759. }(),
  23760. n.prototype.getTextureTypeFromTarget = function(e, t) {
  23761. switch (t) {
  23762. case e.TEXTURE_CUBE_MAP_POSITIVE_X:
  23763. case e.TEXTURE_CUBE_MAP_NEGATIVE_X:
  23764. case e.TEXTURE_CUBE_MAP_POSITIVE_Y:
  23765. case e.TEXTURE_CUBE_MAP_NEGATIVE_Y:
  23766. case e.TEXTURE_CUBE_MAP_POSITIVE_Z:
  23767. case e.TEXTURE_CUBE_MAP_NEGATIVE_Z:
  23768. return s.TextureCube;
  23769. case e.TEXTURE_2D:
  23770. return s.Texture2D;
  23771. default:
  23772. return null
  23773. }
  23774. }
  23775. ,
  23776. n.prototype.initComposer = function() {
  23777. this.composer = new r.EffectComposer(this.renderer),
  23778. this.composer.addPass(new r.RenderPass(this.scene,this.camera)),
  23779. this.composer.addPass(this.effects.hblurPass),
  23780. this.composer.addPass(this.effects.vblurPass)
  23781. }
  23782. ,
  23783. n.prototype.setSize = function(e, t, devicePixelRatio) {
  23784. this.renderWidth = e,
  23785. this.renderHeight = t,
  23786. this.effects.aspect = e / t,
  23787. /* this.renderer.setSize(e, t), -----MP */
  23788. this.renderer.setSize(e, t, false, devicePixelRatio), //改 为了防止给canvas设置宽高
  23789. this.composer.setSize(e, t);
  23790. for (var i = 0; i < this.resizeListeners.length; i++)
  23791. this.resizeListeners[i].setSize(e, t)
  23792. }
  23793. ,
  23794. n.prototype.render = function() {
  23795. this.effects.currentBlur > 0 ? this.composer.render() : this.renderer.render(this.scene, this.camera)
  23796. }
  23797. /******************************************************************************************************徐世廷**********************************************************************/
  23798. var vrPermission = {};
  23799. var vrPermissionCallBack = function(info1,info2){
  23800. if(info1 == "reset"){
  23801. vrPermission = {};
  23802. }else{
  23803. vrPermission[info1] = info2
  23804. if(Object.keys(vrPermission).length == 2 && (vrPermission.deviceMotion != "granted" || vrPermission.deviceOrientation != "granted")){
  23805. alert("运动和方向访问失败。这会导致画面视角一直固定。您需要完全关闭此应用,然后再次打开,并允许访问运动与方向。" )
  23806. }
  23807. }
  23808. }
  23809. n.prototype.boluoVrInit = function() {
  23810. console.log("boluoVrInit")
  23811. this.isHuawei5X = m.detectHUAWEI5X(),
  23812. this.oldRenderer = this.renderer,
  23813. this.newRenderer = new this.vrRenderer(this.renderer,this,this.camera);
  23814. window.panoCamera = this.camera;
  23815. var a = this;
  23816. window._vrEnabled = !1,
  23817. Object.defineProperty(window, "vrEnabled", {
  23818. get: function() {
  23819. return window._vrEnabled
  23820. },
  23821. set: function(b) {
  23822. b = !!b,
  23823. b ? (a.renderer = a.newRenderer,
  23824. window.vrMarkers.forEach(function(a) {
  23825. a.visible = !0
  23826. })) : (a.renderer = a.oldRenderer,
  23827. window.vrMarkers.forEach(function(a) {
  23828. a.visible = !1
  23829. })),
  23830. a.cursor.visible = b,
  23831. a.setSize(window.innerWidth, window.innerHeight),
  23832. window._vrEnabled = b
  23833. if(b){
  23834. setTimeout(function(){
  23835. console.log("orientEnable"+window.orientEnable)
  23836. if(window.vrEnabled && !window.orientEnable){//很可能没能触发陀螺仪事件
  23837. if(m.detectIOS()/* && m.detectSafari() */){
  23838. var b = m.iosVersion();//{major: 10, minor: 3, patch: 1}
  23839. console.log("开始获取权限 major"+b.major)
  23840. if(b.major == 12 && b.minor>=2){
  23841. if(browser.detectSafari()) alert("浏览器未能检测到转动。为完整体验VR效果,请打开 “设置” > “Safari” > “隐私和安全” 下的 “运动和方向访问” 开关,然后刷新此页面。")
  23842. else{//app??
  23843. alert("浏览器未能检测到转动。请在手机或浏览器设置中开启了运动和方向访问等设置,然后刷新此页面。")
  23844. }
  23845. }else if(b.major >= 13){
  23846. if(!window.location.href.includes("https://")){
  23847. console.log("需要https");
  23848. alert("当前网页下,高于ios12的浏览器版本可能不支持陀螺仪开启。")
  23849. return;
  23850. }
  23851. var hasFailed = window.vrPermission && (window.vrPermission.deviceMotion != "granted" || window.vrPermission.deviceOrientation != "granted")
  23852. setTimeout(()=>{//如果使用了alert会阻断这个事件,报以下错requusting device orientation or motion access requires a user gesture
  23853. if(!window.vrEnabled || window.orientEnable)return;
  23854. vrPermissionCallBack("reset")
  23855. console.log(window.DeviceMotionEvent)
  23856. if ( window.DeviceMotionEvent && window.DeviceMotionEvent.requestPermission && typeof window.DeviceMotionEvent.requestPermission === 'function') {
  23857. console.log("开始获取权限1")
  23858. ///注意:需要https 本地服务器permissionState会得到denied
  23859. window.DeviceMotionEvent.requestPermission().then(permissionState => {
  23860. console.log("permissionState1: "+permissionState)
  23861. vrPermissionCallBack("deviceMotion", permissionState)
  23862. }).catch(function(e){
  23863. vrPermissionCallBack("deviceMotion", false)
  23864. console.log(e)
  23865. })
  23866. }else{
  23867. console.log("window.DeviceMotionEvent undefined")
  23868. vrPermissionCallBack("deviceMotion", false)
  23869. }
  23870. if ( window.DeviceOrientationEvent && window.DeviceOrientationEvent.requestPermission && typeof window.DeviceOrientationEvent.requestPermission === 'function') {
  23871. console.log("开始获取权限2")
  23872. window.DeviceOrientationEvent.requestPermission().then(permissionState => {
  23873. console.log("permissionState2: "+permissionState)
  23874. vrPermissionCallBack("deviceOrientation", permissionState)
  23875. }).catch(function(e){
  23876. vrPermissionCallBack("deviceOrientation", false)
  23877. console.log(e)
  23878. })
  23879. }else{
  23880. console.log("window.DeviceOrientationEvent undefined")
  23881. vrPermissionCallBack("deviceOrientation", false)
  23882. }
  23883. },hasFailed ? 0 : 150)
  23884. /* /* setTimeout(function(){
  23885. if(settings.vrEnabled && !window.orientEnable){
  23886. $alert("若画面视角一直固定,您需要完全关闭Safari浏览器,然后再次打开以开启运动和方向访问。")
  23887. }
  23888. },4000) */
  23889. }else console.log("陀螺仪未能启用 ios "+b.major+"."+b.minor)
  23890. }else{
  23891. //$alert("浏览器未能检测到转动", "请在手机或浏览器设置中开启了运动和方向访问等设置,然后刷新此页面。")
  23892. }
  23893. }else{
  23894. //已经触发了
  23895. }
  23896. },200);
  23897. }
  23898. }
  23899. }),
  23900. this.createCursor(.5, !1, 1, 16777215, 0);
  23901. var b = {
  23902. setSize: function(b, c) {
  23903. a.camera.aspect = b / c
  23904. }
  23905. };
  23906. this.resizeListeners.push(b),
  23907. this.vrLoadingInit()
  23908. }
  23909. ,
  23910. n.prototype.vrLoadingInit = function() {
  23911. var a = function(camera) {
  23912. var a = this
  23913. , b = new r.RingGeometry(1.3,1.5,32,32,0,1.2 * Math.PI)
  23914. , c = new r.MeshBasicMaterial({
  23915. color: 4967932,
  23916. side: r.DoubleSide
  23917. })
  23918. , d = new r.Mesh(b,c);
  23919. this.mesh = d,
  23920. d.position.z = -2,
  23921. d.scale.set(.08, .08, .08),
  23922. d.visible = !1,
  23923. camera.add(d),
  23924. //window.player.camera.add(d),
  23925. a.enabled = !1,
  23926. this.update = function(b) {
  23927. 1 == a.enabled && (d.rotation.z += 15 * b)
  23928. }
  23929. }
  23930. , a = new a(this.camera);
  23931. window.Loading = a,
  23932. this.updateListeners.push(a)
  23933. }
  23934. ,
  23935. n.prototype.createCursor = function(a, b, c, d, e) {
  23936. var g, h = new r.SpriteMaterial({
  23937. opacity: c,
  23938. color: d,
  23939. transparent: b,
  23940. map: this.boluoGetTexture("images/cursor.png"),
  23941. needsUpdate: !0,
  23942. side: r.DoubleSide
  23943. });
  23944. h.map.offset = new r.Vector2(1 / 17 * e,0),
  23945. h.map.repeat = new r.Vector2(1 / 17,1),
  23946. h.depthTest = !1,
  23947. h.blending = r.AdditiveBlending,
  23948. g = new r.Sprite(h),
  23949. // g.scale.set(a, a, a),
  23950. g.scale.set(.3,.3,.3)
  23951. g.position.z = -2,
  23952. g.visible = !1,
  23953. g.name = "cursor",
  23954. this.camera.add(g),
  23955. this.scene.add(this.camera),
  23956. this.cursor = g;
  23957. var i = new this.CursorAnimation(this.scene,g,this.camera);
  23958. this.cursor.triggerTargetEvent = i.triggerTargetEvent,
  23959. this.updateListeners.push(i)
  23960. }
  23961. ,
  23962. window.orientEnable = 0; //是否能触发deviceorientation
  23963. n.prototype.CursorAnimation = function(a, b, c) {
  23964. function d() {
  23965. g.orient = r.Math.degToRad(window.orientation || 0)
  23966. }
  23967. function e(a) {
  23968. if(!window.vrEnabled && window.orientEnable) return;
  23969. window.orientEnable || (window.orientEnable = 1);
  23970. var b = r.Math.degToRad(a.alpha)
  23971. , c = r.Math.degToRad(a.beta)
  23972. , d = r.Math.degToRad(a.gamma);
  23973. if (this.isHuawei5X ? (-1e3 === g.alpha && (g.alpha = b),
  23974. -1e3 === g.beta && (g.beta = c),
  23975. -1e3 === g.gamma && (g.gamma = d),
  23976. Math.abs(b - g.alpha) > .06 && (g.alpha = b),
  23977. Math.abs(c - g.beta) > .006 && (g.beta = c),
  23978. Math.abs(d - g.gamma) > .006 && (g.gamma = d)) : (g.alpha = b,
  23979. g.beta = c,
  23980. g.gamma = d),
  23981. n.vrDebug) {
  23982. $("#info-device-orientation").css("display", "block");
  23983. var e = "";
  23984. e += "alpha=(" + g.alpha + ")<BR/>",
  23985. e += "beta=(" + g.beta + ")<BR/>",
  23986. e += "gamma=" + g.gamma + "<BR/>",
  23987. document.getElementById("info-device-orientation").innerHTML = e
  23988. }
  23989. }
  23990. this.cursor = b,
  23991. this.raycaster = new r.Raycaster,
  23992. this.targetEventObj = {},
  23993. this.type = 1,
  23994. this.tweenFlag = !0;
  23995. var g = this;
  23996. this.target = c,
  23997. console.log(c.uuid),
  23998. this.euler = new r.Euler,
  23999. this.q0 = new r.Quaternion,
  24000. this.q1 = new r.Quaternion(-Math.sqrt(.5),0,0,Math.sqrt(.5)),
  24001. this.zee = new r.Vector3(0,0,1),
  24002. this.alpha = -1e3,
  24003. this.beta = -1e3,
  24004. this.gamma = -1e3,
  24005. this.orient = r.Math.degToRad(window.orientation || 0),
  24006. window.addEventListener("orientationchange", d),
  24007. window.addEventListener("deviceorientation", e),
  24008. this.setObjectQuaternion = function(a, b, d, e, f) {
  24009. g.euler.set(d, b, -e, "YXZ"),
  24010. a.setFromEuler(g.euler),
  24011. a.multiply(g.q1),
  24012. a.multiply(g.q0.setFromAxisAngle(g.zee, -f)),
  24013. c.updateMatrixWorld()
  24014. }
  24015. ,
  24016. parent !== window && window.addEventListener("message", function(a) {
  24017. var b = JSON.parse(a.data)
  24018. , c = -1 !== window.navigator.userAgent.indexOf("KIW-TL00H");
  24019. b && b.alpha && b.beta && b.gamma && function(a) {
  24020. var c = r.Math.degToRad(b.alpha)
  24021. , d = r.Math.degToRad(b.beta)
  24022. , e = r.Math.degToRad(b.gamma);
  24023. a ? (-1e3 === g.alpha && (g.alpha = c),
  24024. -1e3 === g.beta && (g.beta = d),
  24025. -1e3 === g.gamma && (g.gamma = e),
  24026. Math.abs(c - g.alpha) > .06 && (g.alpha = c),
  24027. Math.abs(d - g.beta) > .006 && (g.beta = d),
  24028. Math.abs(e - g.gamma) > .006 && (g.gamma = e)) : (g.alpha = c,
  24029. g.beta = d,
  24030. g.gamma = e)
  24031. }(c)
  24032. }),
  24033. this.update = function(a) {
  24034. TWEEN.update();
  24035. if(window.ifTest && window.vrEnabled) this.triggerTargetEvent() //测试时不根据陀螺仪来转向
  24036. else window.vrEnabled && (this.setObjectQuaternion(this.target.quaternion, this.alpha, this.beta, this.gamma, this.orient ),
  24037. this.triggerTargetEvent())
  24038. }
  24039. ,
  24040. this.triggerTargetEvent = function() {
  24041. var a = this.choseObj()
  24042. , b = a ? a.object : void 0;
  24043. this.targetEventObj.currentObj = b,
  24044. b !== this.targetEventObj.lastObj && (b && this.autoCursorPosition(a),
  24045. 1 === this.type ? (this.cursorAnimate && this.cursorAnimate.stop(),
  24046. b && b.enabled && this.startAnimate(function() {
  24047. this.clickCallback(b)
  24048. }
  24049. .bind(this))) : this.type,
  24050. this.targetEventObj.lastObj = b)
  24051. }
  24052. ,
  24053. this.choseObj = function() {
  24054. this.raycaster.setFromCamera({
  24055. x: 0,
  24056. y: 0
  24057. }, c);
  24058. var a = (this.raycaster.ray,
  24059. window.vrMarkers)
  24060. , b = this.raycaster.intersectObjects(a);
  24061. if (b.length > 0)
  24062. return b[0]
  24063. }
  24064. ,
  24065. this.clickCallback = function(a) {
  24066. this.runTHREEAction(a, "onclick")
  24067. }
  24068. ,
  24069. this.runTHREEAction = function(a, b) {
  24070. switch (b) {
  24071. case "onclick":
  24072. a._listeners && a._listeners.click && a._listeners.click.forEach(function(a) {
  24073. a()
  24074. });
  24075. break;
  24076. case "onhover":
  24077. a._listeners && a._listeners.hover && a._listeners.hover.forEach(function(a) {
  24078. a()
  24079. });
  24080. break;
  24081. case "onout":
  24082. a._listeners && a._listeners.out && a._listeners.out.forEach(function(a) {
  24083. a()
  24084. })
  24085. }
  24086. }
  24087. ,
  24088. this.startAnimate = function(a) {
  24089. this.tweenFlag && this.initAnimation(a)
  24090. }
  24091. ,
  24092. this.initAnimation = function(a) {
  24093. var b = this
  24094. , c = this.cursor.material.map.offset
  24095. , d = function(a) {
  24096. return Math.floor(17 * a) / 17
  24097. };
  24098. b.tweenFlag = !1,
  24099. this.cursorAnimate = new TWEEN.Tween(c).to({
  24100. x: 1
  24101. }, 1e3).onStart(function() {
  24102. b.tweenFlag = !1
  24103. }).onStop(function() {
  24104. b.tweenFlag = !0,
  24105. this.x = 0,
  24106. c.x = 0
  24107. }).onUpdate(function() {}).onComplete(function() {
  24108. a(),
  24109. c.x = 0,
  24110. setTimeout(function() {
  24111. b.tweenFlag = !0
  24112. }, 1500)
  24113. }),
  24114. this.cursorAnimate.easing(d),
  24115. this.cursorAnimate.start()
  24116. }
  24117. ,
  24118. this.autoCursorPosition = function(a) {
  24119. // var b = Math.abs(a.distance - 10);
  24120. // this.cursor.position.z = -b,
  24121. // b /= 10;
  24122. // alert(b);
  24123. // this.cursor.scale.set(b, b, b)
  24124. this.cursor.scale.set(.3,.3,.3)
  24125. }
  24126. }
  24127. ,
  24128. n.prototype.vrRenderer = function(a, b, c) {
  24129. var d = new b.vrCamera(c);
  24130. d.bananaAspect = .8,
  24131. this.width,
  24132. this.height;
  24133. var b = this;
  24134. this.setSize = function(c, d) {
  24135. a.setSize.call(this, c, d),
  24136. b.width = c,
  24137. b.height = d
  24138. }
  24139. ,
  24140. this.render = function(b, c, e, f) {
  24141. window.cameraQua = c.quaternion.clone();
  24142. var g, h;
  24143. if (c.__RESS__SKIP__STEREO__)
  24144. return a.render(b, c, e, f);
  24145. if ("PerspectiveCamera" === c.type)
  24146. g = d.cameraL,
  24147. h = d.cameraR,
  24148. b.updateMatrixWorld(),
  24149. null === c.parent && c.updateMatrixWorld(),
  24150. d.vrCameraUpdate(c);
  24151. else {
  24152. if ("OrthographicCamera" !== c.type)
  24153. return DEBUG && console.error("Unsupported renderer: ", c.type);
  24154. g = h = c
  24155. }
  24156. a.setScissorTest(!0),
  24157. a.setScissor(0, 0, this.width / 2, this.height),
  24158. a.setViewport(0, 0, this.width / 2, this.height),
  24159. a.render.call(this, b, g, e, f),
  24160. a.setScissor(this.width / 2, 0, this.width / 2, this.height),
  24161. a.setViewport(this.width / 2, 0, this.width / 2, this.height),
  24162. a.render.call(this, b, h, e, f),
  24163. a.setScissorTest(!1)
  24164. }
  24165. ,
  24166. this.__proto__ = {
  24167. __proto__: a
  24168. }
  24169. }
  24170. ,
  24171. n.prototype.vrCamera = function(a) {
  24172. this.type = "StereoCamera",
  24173. this._aspect = 1,
  24174. this._overlap = .064,
  24175. this.cameraL = new r.PerspectiveCamera,
  24176. this.cameraL.layers.enable(1),
  24177. this.cameraL.near = 0.01,//xzw add
  24178. this.cameraL.matrixAutoUpdate = !1,
  24179. this.cameraR = new r.PerspectiveCamera,
  24180. this.cameraR.layers.enable(2),
  24181. this.cameraR.near = 0.01,//xzw add
  24182. this.cameraR.matrixAutoUpdate = !1,
  24183. this.eyeRight = new r.Matrix4,
  24184. this.eyeLeft = new r.Matrix4,
  24185. this.vrCameraNeedsUpdate = !0,
  24186. window.vrCameraL = this.cameraL; // fyz 记录vr相机
  24187. Object.defineProperty(this, "bananaAspect", {
  24188. get: function() {
  24189. return this._aspect
  24190. },
  24191. set: function(a) {
  24192. this._aspect !== a && (this.vrCameraNeedsUpdate = !0),
  24193. this._aspect = a
  24194. }
  24195. }),
  24196. Object.defineProperty(this, "overlap", {
  24197. get: function() {
  24198. return this._overlap
  24199. },
  24200. set: function(a) {
  24201. this._overlap !== a && (this.vrCameraNeedsUpdate = !0),
  24202. this._overlap = a
  24203. }
  24204. }),
  24205. this.vrCameraUpdate = function(a) {
  24206. this.vrCameraNeedsUpdate = true;
  24207. if (this.vrCameraNeedsUpdate = this.vrCameraNeedsUpdate || this.bananaFov !== a.fov || this.bananaReal_aspect !== a.aspect * this.bananaAspect || this.bananaNear !== a.near || this.bananaFar !== a.far,
  24208. this.vrCameraNeedsUpdate) {
  24209. this.vrCameraNeedsUpdate = !1,
  24210. //console.debug("vrCameraUpdate"),
  24211. this.bananaFocus = a.focus,
  24212. this.bananaFov = a.fov,
  24213. this.bananaReal_aspect = a.aspect * this.bananaAspect,
  24214. this.bananaNear = a.near,
  24215. this.bananaFar = a.far,
  24216. //console.debug(a.aspect),
  24217. this.bananaFocus = 10;
  24218. var b, c, d = a.projectionMatrix.clone(), e = this.overlap / 2, f = e * this.bananaNear / this.bananaFocus, g = this.bananaNear * Math.tan(Math.PI / 180 * this.bananaFov * .5);
  24219. this.eyeLeft.elements[12] = -e,
  24220. this.eyeRight.elements[12] = e,
  24221. b = -g * this.bananaReal_aspect + f,
  24222. c = g * this.bananaReal_aspect + f,
  24223. d.elements[0] = 2 * this.bananaNear / (c - b),
  24224. d.elements[8] = (c + b) / (c - b),
  24225. this.cameraL.projectionMatrix.copy(d),
  24226. b = -g * this.bananaReal_aspect - f,
  24227. c = g * this.bananaReal_aspect - f,
  24228. d.elements[0] = 2 * this.bananaNear / (c - b),
  24229. d.elements[8] = (c + b) / (c - b),
  24230. this.cameraR.projectionMatrix.copy(d)
  24231. }
  24232. this.cameraL.matrixWorld.copy(a.matrixWorld).multiply(this.eyeLeft),
  24233. this.cameraR.matrixWorld.copy(a.matrixWorld).multiply(this.eyeRight)
  24234. }
  24235. }
  24236. ,
  24237. n.prototype.boluoGetTexture = function(a) {
  24238. var b = new r.TextureLoader;
  24239. return b.crossOrigin = "anonymous",
  24240. b.load(a)
  24241. }
  24242. ,
  24243. /***********************************************************************************************************************************************************************************/
  24244. n.prototype.updateScreenSize = function() {//xzw 改 为了截屏 要改canvas大小 以及缩放时不模糊
  24245. var W,H;//当截屏时有setTimeout 期间不能恢复大小,所以要用W,H记录正常大小
  24246. return function(o){
  24247. var render = false;
  24248. var ratio;
  24249. var w, h; //记录应当render的大小
  24250. if(o && !o.resize && o.width!= void 0 && o.height!= void 0){
  24251. w = o.width, h = o.height, render = true, ratio=1;
  24252. }else{
  24253. w = $('#player').width();
  24254. h = $('#player').height();
  24255. o && o.resize && (W = this.renderWidth, H = this.renderHeight);
  24256. (w !== W || h !== H || this.forceUpdateSize) &&
  24257. (W = w, H = h, render = true, ratio = window.devicePixelRatio);
  24258. }
  24259. if(render){
  24260. this.setSize(w, h, ratio);
  24261. this.forceUpdateSize = !1
  24262. }
  24263. }
  24264. }()
  24265. ,
  24266. n.prototype.updateComponents = function() {
  24267. for (var e = Math.min(1, this.updateClock.getDelta()), t = 0; t < this.updateListeners.length; t++)
  24268. this.updateListeners[t].update(e)
  24269. }
  24270. ,
  24271. n.prototype.suspend = function() {
  24272. this.started = !1,
  24273. this.suspendedObjects = this.scene.children.map(function(e) {
  24274. return this.scene.remove(e),
  24275. e
  24276. }
  24277. .bind(this)),
  24278. this.render()
  24279. }
  24280. ,
  24281. n.prototype.resume = function() {
  24282. this.suspendedObjects.forEach(function(e) {
  24283. this.scene.add(e)
  24284. }
  24285. .bind(this)),
  24286. this.suspendedObjects = [],
  24287. this.started = !0,
  24288. p()
  24289. }
  24290. ;
  24291. var p = function() {
  24292. this.started && (window.requestAnimationFrame(p),
  24293. this.updateScreenSize(), // fyz resize
  24294. this.updateComponents(),
  24295. this.updateTextureMemory(),
  24296. this.render(),
  24297. this.emit(a.AfterRender))
  24298. };
  24299. n.prototype.getImageData = function() {
  24300. var e = document.createElement("canvas")
  24301. , t = e.getContext("2d");
  24302. return function(i, n, r) {
  24303. return e.width === n && e.height === r || (e.width = n,
  24304. e.height = r),
  24305. t.drawImage(i, 0, 0, n, r),
  24306. t.getImageData(0, 0, n, r)
  24307. }
  24308. }(),
  24309. n.prototype.initSizedTexture2D = function(e, t, i) {
  24310. var n = this.renderer
  24311. , o = n.context
  24312. , a = n.state
  24313. , s = new r.Texture(null);
  24314. s.flipY = !1,
  24315. i !== !0 && (i = !1),
  24316. s.generateMipmaps = i;
  24317. var l = n.paramThreeToGL(s.format)
  24318. , c = n.paramThreeToGL(s.type)
  24319. , h = n.properties.get(s)
  24320. , u = o.createTexture();
  24321. a.bindTexture(o.TEXTURE_2D, u),
  24322. o.pixelStorei(o.UNPACK_FLIP_Y_WEBGL, s.flipY),
  24323. o.texImage2D(o.TEXTURE_2D, 0, l, e, e, 0, l, c, null),
  24324. s.wrapS = t,
  24325. s.wrapT = t;
  24326. var d = n.paramThreeToGL(t);
  24327. return o.texParameteri(o.TEXTURE_2D, o.TEXTURE_WRAP_S, d),
  24328. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_WRAP_T, d),
  24329. i ? (s.magFilter = r.LinearFilter,
  24330. s.minFilter = r.LinearMipMapLinearFilter,
  24331. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_MAG_FILTER, o.LINEAR),
  24332. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_MIN_FILTER, o.LINEAR_MIPMAP_NEAREST),
  24333. o.generateMipmap(o.TEXTURE_2D)) : (s.magFilter = r.LinearFilter,
  24334. s.minFilter = r.LinearFilter,
  24335. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_MAG_FILTER, o.LINEAR),
  24336. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_MIN_FILTER, o.LINEAR)),
  24337. a.bindTexture(o.TEXTURE_2D, null),
  24338. h.__webglTexture = u,
  24339. s
  24340. }
  24341. ,
  24342. n.prototype.initSizedCubeMap = function(e, t) {
  24343. var i = this.renderer
  24344. , n = i.context
  24345. , o = i.state
  24346. , a = new r.CubeTexture([null, null, null, null, null, null]);
  24347. a.flipY = !1,
  24348. a.generateMipmaps = t;
  24349. var s = i.paramThreeToGL(a.format)
  24350. , l = i.paramThreeToGL(a.type)
  24351. , c = i.properties.get(a)
  24352. , h = n.createTexture();
  24353. o.bindTexture(n.TEXTURE_CUBE_MAP, h),
  24354. n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL, a.flipY);
  24355. for (var u = 0; u < 6; u++)
  24356. n.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X + u, 0, s, e, e, 0, s, l, null);
  24357. return t ? (a.magFilter = r.LinearFilter,
  24358. a.minFilter = r.LinearMipMapLinearFilter,
  24359. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MAG_FILTER, n.LINEAR),
  24360. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MIN_FILTER, n.LINEAR_MIPMAP_LINEAR),
  24361. n.texParameteri(n.TEXTURE_CUBE_MAP, n.GENERATE_MIPMAP, n.TRUE),
  24362. n.generateMipmap(n.TEXTURE_CUBE_MAP)) : (a.magFilter = r.LinearFilter,
  24363. a.minFilter = r.LinearFilter,
  24364. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MAG_FILTER, n.LINEAR),
  24365. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MIN_FILTER, n.LINEAR)),
  24366. o.bindTexture(n.TEXTURE_CUBE_MAP, null),
  24367. c.__image__webglTextureCube = h,
  24368. a
  24369. }
  24370. ,
  24371. n.prototype.deallocateCubeTexture = function(e) {
  24372. var t = this.renderer
  24373. , i = t.context
  24374. , n = t.properties.get(e);
  24375. i.deleteTexture(n.__image__webglTextureCube)
  24376. }
  24377. ,
  24378. n.prototype.uploadTexture2D = function(e, t, i, n, r, o) {
  24379. var a = this.renderer
  24380. , s = a.context
  24381. , l = a.state
  24382. , c = a.properties.get(t);
  24383. l.bindTexture(s.TEXTURE_2D, c.__webglTexture),
  24384. s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL, t.flipY),
  24385. s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL, t.premultiplyAlpha),
  24386. s.pixelStorei(s.UNPACK_ALIGNMENT, t.unpackAlignment),
  24387. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_WRAP_S, a.paramThreeToGL(t.wrapS)),
  24388. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_WRAP_T, a.paramThreeToGL(t.wrapT)),
  24389. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_MAG_FILTER, a.paramThreeToGL(t.magFilter)),
  24390. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_MIN_FILTER, a.paramThreeToGL(t.minFilter)),
  24391. s.texSubImage2D(s.TEXTURE_2D, 0, i, n, s.RGBA, s.UNSIGNED_BYTE, e),
  24392. t.generateMipmaps && s.generateMipmap(s.TEXTURE_2D),
  24393. l.bindTexture(s.TEXTURE_2D, null)
  24394. }
  24395. ,
  24396. n.prototype.uploadTexture3D = function(e, t, i, n, r, o, a) {
  24397. var s = this.renderer
  24398. , l = s.context
  24399. , c = s.state
  24400. , h = s.properties.get(t);
  24401. c.bindTexture(l.TEXTURE_CUBE_MAP, h.__image__webglTextureCube),
  24402. l.pixelStorei(l.UNPACK_FLIP_Y_WEBGL, t.flipY),
  24403. l.texSubImage2D(r, 0, i, n, l.RGBA, l.UNSIGNED_BYTE, e),
  24404. t.generateMipmaps && l.generateMipmap(l.TEXTURE_CUBE_MAP),
  24405. c.bindTexture(l.TEXTURE_CUBE_MAP, null)
  24406. }
  24407. ,
  24408. n.prototype.rebuildMipMaps2D = function(e) {
  24409. var t = this.renderer
  24410. , i = t.context
  24411. , n = t.state;
  24412. t.properties.get(e);
  24413. i.generateMipmap(i.TEXTURE_2D),
  24414. n.bindTexture(i.TEXTURE_2D, null)
  24415. }
  24416. ,
  24417. n.prototype.rebuildMipMaps3D = function(e) {
  24418. var t = this.renderer
  24419. , i = t.context
  24420. , n = t.state
  24421. , r = t.properties.get(e);
  24422. n.bindTexture(i.TEXTURE_CUBE_MAP, r.__image__webglTextureCube),
  24423. i.generateMipmap(i.TEXTURE_CUBE_MAP),
  24424. n.bindTexture(i.TEXTURE_CUBE_MAP, null)
  24425. }
  24426. ,
  24427. n.prototype.renderToCubeMap = function() {
  24428. var e = !1
  24429. , t = null
  24430. , i = null
  24431. , n = null
  24432. , a = null
  24433. , s = null
  24434. , l = 1;
  24435. return function(c, h, u, d, p, f, g, m, v, A, y, C, I, E, b, w) {
  24436. var _ = this.renderer;
  24437. _.context;
  24438. e || (i = new r.OrthographicCamera(l / -2,l / 2,l / 2,l / -2,-200,200),
  24439. i.position.z = 150,
  24440. t = new r.Scene,
  24441. t.add(i),
  24442. n = new r.ShaderMaterial({
  24443. uniforms: {
  24444. tDiffuse: {
  24445. type: "t",
  24446. value: null
  24447. },
  24448. alpha: {
  24449. type: "f",
  24450. value: 1
  24451. }
  24452. },
  24453. vertexShader: o.basicTextured.vertexShader,
  24454. fragmentShader: o.basicTextured.fragmentShader,
  24455. depthWrite: !1,
  24456. depthTest: !1,
  24457. side: r.DoubleSide
  24458. }),
  24459. a = new r.PlaneBufferGeometry(l,l),
  24460. s = new r.Mesh(a,n),
  24461. s.position.z = 0,
  24462. t.add(s),
  24463. e = !0);
  24464. var T = a.getAttribute("uv");
  24465. T.setDynamic(!0),
  24466. T.needsUpdate = !0;
  24467. var x = T.array
  24468. , S = p / u
  24469. , M = f / d
  24470. , R = g / u
  24471. , P = m / d;
  24472. x[0] = S,
  24473. x[1] = M + P,
  24474. x[2] = S + R,
  24475. x[3] = M + P,
  24476. x[4] = S,
  24477. x[5] = M,
  24478. x[6] = S + R,
  24479. x[7] = M;
  24480. var O = a.getAttribute("position");
  24481. O.setDynamic(!0),
  24482. O.needsUpdate = !0;
  24483. var L = O.array
  24484. , D = v / h.width - l / 2
  24485. , N = A / h.height - l / 2
  24486. , B = y / h.width
  24487. , F = C / h.height;
  24488. L[0] = D,
  24489. L[1] = N + F,
  24490. L[3] = D + B,
  24491. L[4] = N + F,
  24492. L[6] = D,
  24493. L[7] = N,
  24494. L[9] = D + B,
  24495. L[10] = N;
  24496. this.renderer.properties.get(c);
  24497. n.uniforms.tDiffuse.value = c,
  24498. n.blending = E || r.NoBlending,
  24499. n.transparent = !!b,
  24500. void 0 !== w && null !== w || (w = 1),
  24501. n.uniforms.alpha.value = w,
  24502. n.needUpdate = !0,
  24503. h.activeCubeFace = I,
  24504. h.viewport.set(0, 0, h.width, h.height);
  24505. var V = this.renderer.autoClear;
  24506. this.renderer.autoClear = !1,
  24507. this.renderer.render(t, i, h, !1),
  24508. this.renderer.autoClear = V
  24509. }
  24510. }(),
  24511. n.prototype.copyCubeMap = function() {
  24512. var e = !1
  24513. , t = null
  24514. , i = null
  24515. , a = null
  24516. , s = null
  24517. , l = null
  24518. , c = new r.Euler;
  24519. new r.Vector3;
  24520. return function(h, u, d, p, f, g, m, v, A) {
  24521. this.renderer;
  24522. if (!e) {
  24523. var y = 2;
  24524. i = new r.OrthographicCamera(y / -2,y / 2,y / 2,y / -2,0,200),
  24525. i.position.set(0, 0, 0),
  24526. t = new r.Scene,
  24527. t.add(i),
  24528. a = new r.ShaderMaterial({
  24529. uniforms: {
  24530. tDiffuse: {
  24531. type: "t",
  24532. value: null
  24533. },
  24534. alpha: {
  24535. type: "f",
  24536. value: 1
  24537. }
  24538. },
  24539. vertexShader: o.copyCubeMap.vertexShader,
  24540. fragmentShader: o.copyCubeMap.fragmentShader,
  24541. depthWrite: !1,
  24542. depthTest: !1,
  24543. side: r.DoubleSide
  24544. }),
  24545. s = new r.BoxGeometry(y,y,y),
  24546. l = new r.Mesh(s,a),
  24547. t.add(l),
  24548. e = !0
  24549. }
  24550. for (var C = 0; C < 6; C++)
  24551. n.getCubeOrientationForCubeFace(C, c),
  24552. l.rotation.copy(c),
  24553. l.matrixWorldNeedsUpdate = !0,
  24554. l.updateMatrixWorld(),
  24555. a.uniforms.tDiffuse.value = h,
  24556. a.blending = m || r.NoBlending,
  24557. a.transparent = !!v,
  24558. void 0 !== A && null !== A || (A = 1),
  24559. a.uniforms.alpha.value = A,
  24560. a.needUpdate = !0,
  24561. u.activeCubeFace = C,
  24562. u.viewport.set(0, 0, f, g),
  24563. this.renderer.render(t, i, u, !1)
  24564. }
  24565. }(),
  24566. n.getLookAtForCubeFace = function(e, t) {
  24567. switch (e) {
  24568. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  24569. t.set(1, 0, 0);
  24570. break;
  24571. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  24572. t.set(-1, 0, 0);
  24573. break;
  24574. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  24575. t.set(0, 1, 0);
  24576. break;
  24577. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  24578. t.set(0, -1, 0);
  24579. break;
  24580. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  24581. t.set(0, 0, 1);
  24582. break;
  24583. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  24584. t.set(0, 0, -1)
  24585. }
  24586. }
  24587. ,
  24588. n.getCubeOrientationForCubeFace = function(e, t) {
  24589. switch (e) {
  24590. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  24591. t.set(0, -Math.PI / 2, 0);
  24592. break;
  24593. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  24594. t.set(0, Math.PI / 2, 0);
  24595. break;
  24596. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  24597. t.set(Math.PI / 2, Math.PI, 0);
  24598. break;
  24599. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  24600. t.set(-Math.PI / 2, Math.PI, 0);
  24601. break;
  24602. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  24603. t.set(0, -Math.PI, 0);
  24604. break;
  24605. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  24606. t.set(0, 0, 0)
  24607. }
  24608. }
  24609. ,
  24610. t.exports = n
  24611. }
  24612. , {
  24613. "../enum/GLCubeFaces": 25,
  24614. "../enum/GLTextureType": 26,
  24615. "../enum/SceneRendererEvents": 43,
  24616. "../exception/BasicException": 55,
  24617. "../exception/RendererCreationException": 57,
  24618. "../settings": 166,
  24619. "../shaders": 167,
  24620. /********************************************************************fyz改 from徐世廷**********************************************************************/
  24621. "../util/browser": 182,
  24622. /************************************************************************************************************************************************/
  24623. events: 202,
  24624. three: 217
  24625. }],
  24626. 159: [function(e, t, i) {
  24627. "use strict";
  24628. function n(e) {
  24629. this.messenger = new a(e),
  24630. this.clientKey = null
  24631. }
  24632. var r = e("../util/ajax")
  24633. , o = e("./PostMessageType")
  24634. , a = e("./postmessage")
  24635. , s = e("./VersionInfo")
  24636. , l = e("events").EventEmitter
  24637. , c = window.location.origin + "/api/v1/user/";
  24638. n.prototype = Object.create(l.prototype),
  24639. n.prototype.bindEvents = function() {
  24640. this.messenger.on(o.ACTION, this.onMessageReceived.bind(this))
  24641. }
  24642. ,
  24643. n.prototype.waitForConnection = function() {
  24644. var e = new Promise(function(e, t) {
  24645. this.messenger.on(o.CONNECT, function(i) {
  24646. this.onConnectionReceived(i).then(e.bind(this, i.sdkVersion), t.bind())
  24647. }
  24648. .bind(this))
  24649. }
  24650. .bind(this));
  24651. return e
  24652. }
  24653. ,
  24654. n.prototype.onConnectionReceived = function(e) {
  24655. return this.messenger.setTarget(e.source, e.origin),
  24656. this.verifyConnection(e).then(function(t, i) {
  24657. this.messenger.send({
  24658. type: o.ACCEPT,
  24659. toId: e.fromId,
  24660. warning: i
  24661. }),
  24662. this.clientKey = t,
  24663. this.messenger.removeAllListeners(o.CONNECT),
  24664. this.bindEvents()
  24665. }
  24666. .bind(this), function(t) {
  24667. this.messenger.send({
  24668. type: o.REJECT,
  24669. toId: e.fromId,
  24670. reason: t
  24671. }),
  24672. this.messenger.setTarget()
  24673. }
  24674. .bind(this))
  24675. }
  24676. ,
  24677. n.prototype.verifyConnection = function(e) {
  24678. return new Promise(function(t, i) {
  24679. var n;
  24680. if (s.isDeprecated(e.sdkVersion))
  24681. n = "这个版本正在被弃用";
  24682. else if (!s.isSupported(e.sdkVersion))
  24683. return i("不支持此版本的SDK");
  24684. var o = {
  24685. cache: !1,
  24686. headers: {
  24687. "X-port-Application-Key": e.applicationKey,
  24688. "X-port-Referrer": e.origin
  24689. }
  24690. };
  24691. r.get(c, o).done(t.bind(this, e.applicationKey, n)).fail(i.bind(this, "key/referrer mismatch"))
  24692. }
  24693. )
  24694. }
  24695. ,
  24696. n.prototype.onMessageReceived = function(e) {
  24697. if (this.validateClientApplicationKey(e.applicationKey)) {
  24698. var t = this;
  24699. e.onDone = function(i) {
  24700. i.toId = e.fromId,
  24701. i.uid = e.uid,
  24702. i.type = o.RESPONSE,
  24703. t.messenger.send(i)
  24704. }
  24705. ,
  24706. this.emit(o.ACTION, e)
  24707. }
  24708. }
  24709. ,
  24710. n.prototype.validateClientApplicationKey = function(e) {
  24711. return this.clientKey === e
  24712. }
  24713. ,
  24714. n.prototype.sendEvent = function(e, t) {
  24715. this.messenger.send({
  24716. type: o.EVENT,
  24717. eventType: e,
  24718. eventData: t
  24719. })
  24720. }
  24721. ,
  24722. t.exports = n
  24723. }
  24724. , {
  24725. "../util/ajax": 181,
  24726. "./PostMessageType": 160,
  24727. "./VersionInfo": 163,
  24728. "./postmessage": 165,
  24729. events: 202
  24730. }],
  24731. 160: [function(e, t, i) {
  24732. "use strict";
  24733. t.exports = Object.freeze({
  24734. CONNECT: "postmessage.connect",
  24735. ACCEPT: "postmessage.accept",
  24736. REJECT: "postmessage.reject",
  24737. ACTION: "postmessage.action",
  24738. RESPONSE: "postmessage.response",
  24739. EVENT: "postmessage.event"
  24740. })
  24741. }
  24742. , {}],
  24743. 161: [function(e, t, i) {
  24744. "use strict";
  24745. t.exports = Object.freeze({
  24746. MOVE: "sdk.move",
  24747. ENTER_PANO: "sdk.enterpano",
  24748. MODEL_LOADED: "sdk.modelloaded"
  24749. })
  24750. }
  24751. , {}],
  24752. 162: [function(e, t, i) {
  24753. "use strict";
  24754. t.exports = Object.freeze({
  24755. FLY: "transition.fly",
  24756. FADEOUT: "transition.fade",
  24757. INSTANT: "transition.instant"
  24758. })
  24759. }
  24760. , {}],
  24761. 163: [function(e, t, i) {
  24762. "use strict";
  24763. t.exports = {
  24764. current: "1.0",
  24765. supported: ["1.0"],
  24766. deprecated: [],
  24767. isSupported: function(e) {
  24768. return this.supported.indexOf(e) !== -1
  24769. },
  24770. isDeprecated: function(e) {
  24771. return this.deprecated.indexOf(e) !== -1
  24772. },
  24773. isValid: function(e) {
  24774. return this.isSupported(e) || this.isDeprecated(e)
  24775. }
  24776. }
  24777. }
  24778. , {}],
  24779. 164: [function(e, t, i) {
  24780. (function(i) {
  24781. "use strict";
  24782. function n(e, t, i) {
  24783. e && (e = e.toLowerCase().trim());
  24784. var n = new I.UP.clone
  24785. , r = Math.PI / 3
  24786. , o = Math.PI / 2;
  24787. switch (e) {
  24788. case "left":
  24789. i.copy(t),
  24790. i.applyAxisAngle(n, o);
  24791. break;
  24792. case "right":
  24793. i.copy(t),
  24794. i.applyAxisAngle(n, -o);
  24795. break;
  24796. case "forwardleft":
  24797. i.copy(t),
  24798. i.applyAxisAngle(n, r);
  24799. break;
  24800. case "forwardright":
  24801. i.copy(t),
  24802. i.applyAxisAngle(n, -r);
  24803. break;
  24804. case "forward":
  24805. default:
  24806. i.copy(t)
  24807. }
  24808. return i
  24809. }
  24810. function r(e, t) {
  24811. if (e) {
  24812. var i = {
  24813. pano: e,
  24814. lookAtPoint: null,
  24815. duration: null,
  24816. maxDistanceOverride: null,
  24817. skipWarpingCheck: !1
  24818. };
  24819. this.player.flyToPano(i, function() {
  24820. t && t({
  24821. success: !0,
  24822. message: "Transition complete."
  24823. })
  24824. })
  24825. } else
  24826. R.warn("Showcase -> clickPanoObject: Unable to find pano."),
  24827. t && t({
  24828. success: !1,
  24829. error: "Unable to find pano."
  24830. })
  24831. }
  24832. function o(e, t) {
  24833. var i = this.findRankedPano(e, t);
  24834. return i >= 0 ? this.handleToObject[i] : (R.warn("Showcase -> findRankedPanoObject: Unable to find nearby pano."),
  24835. null)
  24836. }
  24837. function a(e, t) {
  24838. var i = this.findRankedtag(e, t);
  24839. return i >= 0 ? this.handleToObject[i] : (R.warn("Showcase -> findRankedtagObject: Unable to find nearby tag."),
  24840. null)
  24841. }
  24842. function s(e, t) {
  24843. t.copy(I.FORWARD),
  24844. e.getDirection(t)
  24845. }
  24846. function l(e) {
  24847. function t(e) {
  24848. var t = (new c.Euler).setFromQuaternion(e.quaternion, "YXZ");
  24849. return {
  24850. x: c.Math.radToDeg(t._x),
  24851. y: c.Math.radToDeg(t._y),
  24852. z: c.Math.radToDeg(t._z)
  24853. }
  24854. }
  24855. var i = function(e) {
  24856. return e.alignmentType !== m.ALIGNED ? null : {
  24857. x: e.position.x,
  24858. y: e.position.y,
  24859. z: e.position.z
  24860. }
  24861. };
  24862. return {
  24863. panos: e.panos.list.map(function(n) {
  24864. var r = y.getCubemapUrls(e.urls, n.id, "high")[C.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z];
  24865. return {
  24866. uuid: n.id,
  24867. aligned: n.alignmentType === m.ALIGNED,
  24868. neighbourUUIDs: n.neighbourUUIDs.slice(),
  24869. position: i(n),
  24870. rotation: t(n),
  24871. thumbnail: r
  24872. }
  24873. })
  24874. }
  24875. }
  24876. var c = e("three")
  24877. , h = e("./ApiHost")
  24878. , u = e("../util/logger")
  24879. , d = e("../util/common")
  24880. , p = e("../util/math")
  24881. , f = e("../enum/ModelManagerEvents")
  24882. , g = e("./PostMessageType")
  24883. , m = e("../enum/AlignmentType")
  24884. , v = e("../enum/Direction")
  24885. , A = e("./TransitionStyles")
  24886. , y = e("../util/panorama")
  24887. , C = e("../enum/GLCubeFaces")
  24888. , I = e("../enum/Vectors")
  24889. , E = e("../enum/Viewmode")
  24890. , b = e("../enum/WarpStyle")
  24891. , w = (e("../enum/Keys"),
  24892. e("../enum/PlayerEvents"))
  24893. , _ = e("../sdk/SdkEvents")
  24894. , I = e("../enum/Vectors")
  24895. , T = e("../enum/ControlEvents")
  24896. , x = e("../enum/RenderLayers")
  24897. , S = (e("../constants"),
  24898. e("../settings"))
  24899. , M = e("../lib/jpeg_encoder")
  24900. , R = new u(i)
  24901. , P = function() {
  24902. var e = function e() {
  24903. e.playerDirection.copy(e.player.mode === E.FLOORPLAN ? I.UP : I.FORWARD),
  24904. e.player.getDirection(e.playerDirection),
  24905. e.projectVectors();
  24906. var t = e.playerDirection.angleTo(e.lastFacingDirection);
  24907. if (e.angleTravelled += Math.abs(t),
  24908. e.angleTravelled >= Math.abs(e.angle)) {
  24909. if (e.active = !1,
  24910. e.onDone) {
  24911. var i = e.onDone;
  24912. i()
  24913. }
  24914. } else
  24915. e.lastFacingDirection.copy(e.playerDirection),
  24916. window.setTimeout(e, 4)
  24917. };
  24918. return e.active = !1,
  24919. e.angle = 0,
  24920. e.angleTravelled = 0,
  24921. e.playerDirection = new c.Vector3,
  24922. e.lastFacingDirection = new c.Vector3,
  24923. e.onDone = null,
  24924. e.player = null,
  24925. e.start = function(t, i, n, r) {
  24926. e.active = !0,
  24927. t && i && (i = 0),
  24928. e.angle = t || i,
  24929. e.xAngle = t,
  24930. e.yAngle = i,
  24931. e.angleTravelled = 0,
  24932. e.playerDirection.copy(n.mode === E.FLOORPLAN ? I.UP : I.FORWARD),
  24933. n.getDirection(e.playerDirection),
  24934. e.lastFacingDirection.copy(e.playerDirection),
  24935. e.projectVectors(),
  24936. e.onDone = r,
  24937. e.player = n,
  24938. e()
  24939. }
  24940. ,
  24941. e.projectVectors = function() {
  24942. e.xAngle && (e.playerDirection.projectOnPlane(I.UP),
  24943. e.lastFacingDirection.projectOnPlane(I.UP))
  24944. }
  24945. ,
  24946. e
  24947. }()
  24948. , O = function() {
  24949. var e = new c.Vector3;
  24950. return function(t) {
  24951. t ? (e.copy(t.position),
  24952. e.add(t.discPosition),
  24953. p.projectPositionToCanvas(e, this.player.camera, e),
  24954. this.click(e.x, e.y)) : R.warn("Showcase -> clicktagObject: Unable to find tag.")
  24955. }
  24956. }()
  24957. , L = function() {
  24958. return this.player.mode === E.PANORAMA ? S.insideLookLimitUp : this.player.mode === E.DOLLHOUSE ? 90 - c.Math.radToDeg(S.dollhouseDefault.minPolarAngle) : null
  24959. }
  24960. , D = function() {
  24961. return this.player.mode === E.PANORAMA ? S.insideLookLimitDown : this.player.mode === E.DOLLHOUSE ? 90 - c.Math.radToDeg(S.dollhouseDefault.maxPolarAngle) : null
  24962. }
  24963. , N = function(e) {
  24964. var t = new c.Vector3;
  24965. return function(e) {
  24966. var i = this.player.getDirection();
  24967. t.copy(i);
  24968. var n = t.y;
  24969. t.y = 0,
  24970. t.normalize();
  24971. var r = c.Math.radToDeg(t.angleTo(i)) * (n < 0 ? -1 : 1);
  24972. if (this.player.mode !== E.DOLLHOUSE && this.player.mode !== E.PANORAMA)
  24973. return 0 !== e && R.warn("Cannot rotate in y direction when in " + this.player.mode + " mode"),
  24974. 0;
  24975. this.player.mode === E.DOLLHOUSE && (r = -r);
  24976. var o = L.call(this) - .1
  24977. , a = D.call(this) + .1
  24978. , s = r + e;
  24979. s > o ? s = o : s < a && (s = a);
  24980. var l = s - r;
  24981. return e > 0 && l < .01 && (l = 0),
  24982. e < 0 && l > -.01 && (l = 0),
  24983. l
  24984. }
  24985. }()
  24986. , B = function() {
  24987. var e = new c.Euler;
  24988. return function(t) {
  24989. return e.setFromQuaternion(t.quaternion, "YXZ"),
  24990. {
  24991. position: {
  24992. x: t.position.x,
  24993. y: t.position.y,
  24994. z: t.position.z
  24995. },
  24996. rotation: {
  24997. x: c.Math.radToDeg(e.x),
  24998. y: c.Math.radToDeg(e.y),
  24999. z: 0
  25000. },
  25001. pano: t.currentPano ? t.currentPano.id : null,
  25002. mode: t.mode
  25003. }
  25004. }
  25005. }()
  25006. , F = null;
  25007. t.exports = {
  25008. init: function(e, t, i, n, r) {
  25009. V.init(e, t, i, r),
  25010. F = new Promise(function(e, t) {
  25011. i.on(w.Ready, function() {
  25012. e()
  25013. })
  25014. }
  25015. .bind(this));
  25016. var o = new h(window)
  25017. , a = o.waitForConnection();
  25018. a.then(function(e) {
  25019. o.on(g.ACTION, V.onMessageReceive.bind(V))
  25020. });
  25021. var s = function() {
  25022. var e = Date.now();
  25023. return function() {
  25024. if (!(Date.now() - e < 100)) {
  25025. var t = B(i);
  25026. o.sendEvent(_.MOVE, {
  25027. state: t
  25028. }),
  25029. e = Date.now()
  25030. }
  25031. }
  25032. }();
  25033. i.on(w.Move, s),
  25034. i.on(w.ViewChanged, s),
  25035. n.on(f.ActiveModelChanged, function(e) {
  25036. function t(e) {
  25037. var t, i = e.newPano.id;
  25038. e.oldPano && (t = e.oldPano.id),
  25039. i !== t && o.sendEvent(_.ENTER_PANO, {
  25040. oldPano: t,
  25041. newPano: i
  25042. })
  25043. }
  25044. var i = e.model
  25045. , n = e.oldModel;
  25046. V.model = i,
  25047. a.then(function() {
  25048. o.sendEvent(_.MODEL_LOADED, {
  25049. metadata: l(i)
  25050. })
  25051. }),
  25052. n && n.panos.forEach(function(e) {
  25053. e.removeEventListener("enter", t)
  25054. }),
  25055. i.panos.forEach(function(e) {
  25056. e.on("enter", t)
  25057. })
  25058. })
  25059. }
  25060. };
  25061. var V = {
  25062. director: null,
  25063. player: null,
  25064. controls: null,
  25065. sceneRenderer: null,
  25066. model: null,
  25067. init: function(e, t, i, n) {
  25068. this.director = e,
  25069. this.player = i,
  25070. this.controls = t,
  25071. this.sceneRenderer = n
  25072. },
  25073. handleToObject: {},
  25074. objectToHandle: {},
  25075. handleCount: 0,
  25076. onMessageReceive: function(e) {
  25077. if (e) {
  25078. var t = e.targetFunction
  25079. , i = e.params
  25080. , n = e.onDone;
  25081. t && this[t] && this[t](i, n)
  25082. }
  25083. },
  25084. waitForInit: function(e, t) {
  25085. F.then(t.bind({
  25086. success: !0,
  25087. message: "Init complete."
  25088. }))
  25089. },
  25090. moveToPano: function(e, t) {
  25091. var i = new c.Euler(0,0,0,"YXZ")
  25092. , n = new c.Quaternion;
  25093. return function(e, t) {
  25094. var r = e.pano
  25095. , o = e.rotation
  25096. , a = e.transition;
  25097. if (!this.model)
  25098. return t({
  25099. success: !1,
  25100. error: "The model has not been loaded yet"
  25101. });
  25102. var s = this.model.panos.get(r);
  25103. if (!s)
  25104. return t({
  25105. success: !1,
  25106. error: r + " does not exist in this model"
  25107. });
  25108. if (!o)
  25109. return t({
  25110. sucess: !1,
  25111. erorr: o + " is not a valid rotation"
  25112. });
  25113. i.set(c.Math.degToRad(o.x || 0), c.Math.degToRad(o.y || 0), c.Math.degToRad(o.z || 0), "YXZ"),
  25114. console.log(o.z);
  25115. var l = {
  25116. success: !0,
  25117. message: r
  25118. };
  25119. if (a === A.FADEOUT)
  25120. n.setFromEuler(i),
  25121. this.player.warpToPano(s, n, null, null, b.BLACK, null, null, t.bind(this, l));
  25122. else {
  25123. var h, u;
  25124. a === A.INSTANT && (h = 0,
  25125. u = 0);
  25126. var d = I.FORWARD.clone().applyEuler(i).add(s.position);
  25127. this.player.flyToPano({
  25128. pano: s,
  25129. lookAtPoint: d,
  25130. duration: h,
  25131. aimDuration: u
  25132. }, t.bind(this, l))
  25133. }
  25134. }
  25135. }(),
  25136. moveInDirection: function(e, t) {
  25137. var i = e.direction;
  25138. return "undefined" == typeof v[i] ? (R.warn("Showcase -> moveInDirection: Cannot move in invalid direction."),
  25139. void (t && t({
  25140. success: !1,
  25141. error: "Invalid direction."
  25142. }))) : void this.player.flyLocalDirection(I[i].clone()).then(function(e) {
  25143. t(e ? {
  25144. success: !0,
  25145. message: "moved " + i
  25146. } : {
  25147. success: !1,
  25148. error: "Cannot move in direction: " + i
  25149. })
  25150. })
  25151. },
  25152. getPose: function(e, t) {
  25153. this.player.camera.position,
  25154. (new c.Euler).setFromQuaternion(this.player.camera.quaternion, "YXZ");
  25155. return t({
  25156. success: !0,
  25157. message: B(this.player)
  25158. })
  25159. },
  25160. takeScreenShot: function() {
  25161. var e = new c.PerspectiveCamera
  25162. , t = new c.WebGLRenderTarget;
  25163. return function(i, n) {
  25164. if (!i.resolution)
  25165. return n({
  25166. success: !1,
  25167. error: "An invalid resolution was specified"
  25168. });
  25169. if (i.resolution.width === -1 || i.resolution.height === -1) {
  25170. var r = this.sceneRenderer.renderer.getSize();
  25171. i.resolution.width = r.width,
  25172. i.resolution.height = r.height
  25173. }
  25174. e.layers.set(x.DEFAULT),
  25175. i.visibleObjects && (i.visibleObjects.showtags && e.layers.enable(x.TAG),
  25176. i.visibleObjects.showPucks && e.layers.enable(x.PANOMARKERS),
  25177. i.visibleObjects.showReticule && e.layers.enable(x.RETICULE));
  25178. var o = i.resolution.width
  25179. , a = i.resolution.height
  25180. , s = o / a;
  25181. e.position.copy(this.sceneRenderer.camera.position),
  25182. e.quaternion.copy(this.sceneRenderer.camera.quaternion),
  25183. e.projectionMatrix.copy(this.player.camera.projectionMatrix),
  25184. e.projectionMatrix.elements[0] = this.player.camera.projectionMatrix.elements[5] / s,
  25185. t.setSize(o, a),
  25186. this.sceneRenderer.renderer.render(this.sceneRenderer.scene, e, t);
  25187. var l = new Uint8Array(o * a * 4);
  25188. this.sceneRenderer.renderer.readRenderTargetPixels(t, 0, 0, o, a, l);
  25189. var c = M.encode({
  25190. data: l,
  25191. width: o,
  25192. height: a,
  25193. heading: 180,
  25194. pitch: 0
  25195. }, {
  25196. quality: 75,
  25197. flipY: !0
  25198. })
  25199. , h = "data:image/jpg;base64," + d.uint8ToBase64(c.data);
  25200. n({
  25201. success: !0,
  25202. message: h
  25203. })
  25204. }
  25205. }(),
  25206. findRankedPano: function(e, t) {
  25207. var i = new c.Vector3
  25208. , r = new c.Vector3;
  25209. return function(e, t) {
  25210. s(this.player, r),
  25211. n(t, r, i);
  25212. var o = this.player.rankedPanoInDirection(e, i);
  25213. if (o) {
  25214. var a = this.objectToHandle[o.id];
  25215. return a || (this.objectToHandle[o.id] = a = this.handleCount++,
  25216. this.handleToObject[a] = o),
  25217. a
  25218. }
  25219. return R.warn("Showcase -> findRankedPano: Unable to find nearby pano."),
  25220. -1
  25221. }
  25222. }(),
  25223. findRankedtag: function(e, t) {
  25224. var i = new c.Vector3
  25225. , r = new c.Vector3;
  25226. return function(e, t) {
  25227. s(this.player, r),
  25228. n(t, r, i);
  25229. var o = this.player.rankedtagInDirection(e, i);
  25230. if (o) {
  25231. var a = this.objectToHandle[o.sid];
  25232. return a || (this.objectToHandle[o.sid] = a = this.handleCount++,
  25233. this.handleToObject[a] = o),
  25234. a
  25235. }
  25236. return R.warn("Showcase -> findRankedtag: Unable to find nearby tag."),
  25237. -1
  25238. }
  25239. }(),
  25240. clickNearesttag: function(e) {
  25241. this.clickRankedtag(0, e)
  25242. },
  25243. clickRankedtag: function(e, t) {
  25244. var i = a.call(this, e, t);
  25245. i && O.call(this, i)
  25246. },
  25247. clickNearestPano: function(e, t) {
  25248. this.clickRankedPano(0, e, t)
  25249. },
  25250. clickRankedPano: function(e, t, i) {
  25251. var n = o.call(this, e, t);
  25252. n ? r.call(this, n, i) : i(null)
  25253. },
  25254. clickPano: function(e, t) {
  25255. var i = this.handleTable[e];
  25256. i ? r.call(this, i, t) : t(null)
  25257. },
  25258. rotateDirection: function() {
  25259. return function(e, t) {
  25260. var i = e.direction
  25261. , n = e.angle;
  25262. if (!P.active) {
  25263. var r = 0
  25264. , o = 0
  25265. , a = 0
  25266. , s = 0;
  25267. if (!n || isNaN(n))
  25268. return R.warn("Showcase -> rotateDirection: Invalid rotation angle."),
  25269. void (t && t({
  25270. success: !1,
  25271. error: "Invalid rotation angle."
  25272. }));
  25273. if (this.player.mode === E.TRANSITIONING)
  25274. return R.warn("Automation -> rotateDirection: Cannot rotate while transitioning"),
  25275. void (t && t({
  25276. success: !1,
  25277. error: "Cannot rotate while transitioning"
  25278. }));
  25279. if (i === v.RIGHT || i === v.LEFT)
  25280. i === v.RIGHT && (n = -n),
  25281. r = n > 0 ? -1 : 1,
  25282. a = n;
  25283. else {
  25284. if (i !== v.UP && i !== v.DOWN)
  25285. return R.warn("Showcase -> rotateDirection: Invalid direction for rotation: " + i),
  25286. void (t && t({
  25287. success: !1,
  25288. error: "Invalid direction for rotation."
  25289. }));
  25290. if (this.player.mode === E.FLOORPLAN)
  25291. return R.warn("Showcase -> rotateDirection: Cannot rotate " + i + " in floorplan mode"),
  25292. void (t && t({
  25293. success: !1,
  25294. error: "Cannot rotate " + i + " in floorplan mode"
  25295. }));
  25296. if (i === v.DOWN && (n = -n),
  25297. n = N.call(this, n),
  25298. 0 === n)
  25299. return R.warn("Showcase -> rotateDirection: Already at maximum rotation in direction: " + i),
  25300. void (t && t({
  25301. success: !1,
  25302. error: "Already at maximum rotation in direction: " + i
  25303. }));
  25304. o = n > 0 ? 1 : -1,
  25305. s = n
  25306. }
  25307. var l = n;
  25308. n = c.Math.degToRad(n),
  25309. a = c.Math.degToRad(a),
  25310. s = c.Math.degToRad(s);
  25311. var h = this.controls.activeControl
  25312. , u = function() {
  25313. h.stopRotating(!0),
  25314. t && t({
  25315. success: !0,
  25316. message: "Rotated " + l.toFixed(2) + "° in direction: " + e.direction
  25317. })
  25318. };
  25319. h.startRotating(r, o),
  25320. P.start(a, s, this.player, u)
  25321. }
  25322. }
  25323. }(),
  25324. rotate: function() {
  25325. var e = new c.Vector3
  25326. , t = new c.Vector3;
  25327. return function(i, n) {
  25328. var r = i.xAngle
  25329. , o = i.yAngle;
  25330. if (!P.active) {
  25331. if (r = r || 0,
  25332. o = o || 0,
  25333. isNaN(r) || isNaN(o))
  25334. return R.warn("Showcase -> rotate: Invalid rotation angle."),
  25335. void (n && n({
  25336. success: !1,
  25337. error: "Invalid rotation angle."
  25338. }));
  25339. if (this.player.mode === E.TRANSITIONING)
  25340. return R.warn("Automation -> rotate: Cannot rotate while transitioning"),
  25341. void (n && n({
  25342. success: !1,
  25343. error: "Cannot rotate while transitioning"
  25344. }));
  25345. Math.abs(r) < .01 && (r = 0),
  25346. Math.abs(o) < .01 && (o = 0);
  25347. var a = o;
  25348. o = N.call(this, o),
  25349. r = -r;
  25350. var s = a > 0 ? "UP" : "DOWN";
  25351. if (!r && a && !o)
  25352. return R.warn("Showcase -> rotate: Already at maximum rotation in direction: " + s),
  25353. void (n && n({
  25354. success: !1,
  25355. error: "Already at maximum rotation in direction: " + s
  25356. }));
  25357. a > o && R.warn("Showcase -> rotate: Reached maximum rotation in direction: " + s);
  25358. var l = o;
  25359. o = c.Math.degToRad(o),
  25360. r = c.Math.degToRad(r),
  25361. e.copy(this.player.mode === E.FLOORPLAN ? I.UP : I.FORWARD),
  25362. this.player.getDirection(e),
  25363. t.copy(e).applyAxisAngle(I.UP, r),
  25364. t.applyAxisAngle(I.RIGHT, o);
  25365. var h = (e.angleTo(t),
  25366. r > 0 ? -1 : r < 0 ? 1 : 0)
  25367. , u = o > 0 ? 1 : o < 0 ? -1 : 0;
  25368. Math.abs(r) > Math.abs(o) ? u *= Math.abs(o / r) : Math.abs(o) > Math.abs(r) && (h *= Math.abs(r / o));
  25369. var d = this.controls.activeControl
  25370. , p = function() {
  25371. d.stopRotating(!0),
  25372. n && n({
  25373. success: !0,
  25374. message: "Rotated " + i.xAngle.toFixed(2) + "° horizontally, " + l.toFixed(2) + "° vertically"
  25375. })
  25376. };
  25377. d.startRotating(h, u),
  25378. P.start(r, o, this.player, p)
  25379. }
  25380. }
  25381. }(),
  25382. panCamera: function(e, t) {
  25383. function i(e) {
  25384. switch (r.removeAllListeners(T.AutoPanComplete),
  25385. r.removeAllListeners(T.AutoPanInterrupt),
  25386. r.removeAllListeners(T.AutoPanClamped),
  25387. e) {
  25388. case T.AutoPanInterrupt:
  25389. t({
  25390. success: !0,
  25391. message: "Camera panning interrupted."
  25392. });
  25393. break;
  25394. case T.AutoPanClamped:
  25395. if (r.autoPanPosition.x !== n.x || r.autoPanPosition.z !== n.z) {
  25396. if (Math.abs(this.player.position.x - r.autoPanPosition.x) < .01 && Math.abs(this.player.position.z - r.autoPanPosition.z) < .01)
  25397. return void t({
  25398. success: !1,
  25399. error: "Already at edge of current model bounds."
  25400. });
  25401. var i = "The view point is outside the bounds for the current model. ";
  25402. i += "The view point was clamped to " + o(r.target.x, r.target.z),
  25403. console.warn(i)
  25404. }
  25405. case T.AutoPanComplete:
  25406. t({
  25407. success: !0,
  25408. message: "Panned camera to position " + o(r.autoPanPosition.x, r.autoPanPosition.z)
  25409. })
  25410. }
  25411. }
  25412. if (this.player.mode !== E.DOLLHOUSE && this.player.mode !== E.FLOORPLAN)
  25413. return t({
  25414. success: !1,
  25415. error: "Camera panning is not available in the current mode: " + this.player.mode
  25416. });
  25417. var n = e.position
  25418. , r = this.player.control;
  25419. r.setAutoPanPosition(n.x, n.z),
  25420. r.autoPan = !0;
  25421. var o = function(e, t) {
  25422. return "(" + e.toFixed(2) + ", " + t.toFixed(2) + ")"
  25423. };
  25424. r.on(T.AutoPanComplete, i.bind(this, T.AutoPanComplete)),
  25425. r.on(T.AutoPanInterrupt, i.bind(this, T.AutoPanInterrupt)),
  25426. r.on(T.AutoPanClamped, i.bind(this, T.AutoPanClamped))
  25427. },
  25428. click: function(e, t) {
  25429. var i = e.x
  25430. , n = e.y
  25431. , r = e.percentage;
  25432. r === !0 && (i = i / 100 * $("#player").width(),
  25433. n = n / 100 * $("#player").height()),
  25434. this.player.handleInputStart(i, n),
  25435. this.player.updateIntersect(),
  25436. this.player.handleInputEnd(i, n)
  25437. },
  25438. mouseOver: function(e, t) {
  25439. var i = e.x
  25440. , n = e.y
  25441. , r = e.percentage;
  25442. r === !0 && (i = i / 100 * $("#player").width(),
  25443. n = n / 100 * $("#player").height()),
  25444. this.player.handleInputMove(i, n),
  25445. this.player.updateIntersect()
  25446. },
  25447. moveToMode: function(e, t) {
  25448. function i(e) {
  25449. t(e ? {
  25450. success: !1,
  25451. error: "Failed to load new mode: " + e
  25452. } : {
  25453. success: !0,
  25454. message: "Moved to new mode: " + n
  25455. })
  25456. }
  25457. var n = e.mode;
  25458. n === E.PANORAMA || n === E.DOLLHOUSE || n === E.FLOORPLAN ? this.director.changeMode(n).then(function() {
  25459. i()
  25460. }, function(e) {
  25461. i(e)
  25462. }) : t({
  25463. success: !1,
  25464. error: "Invalid mode selection"
  25465. })
  25466. }
  25467. }
  25468. }
  25469. ).call(this, "/js/sdk/automation.js")
  25470. }
  25471. , {
  25472. "../constants": 8,
  25473. "../enum/AlignmentType": 17,
  25474. "../enum/ControlEvents": 21,
  25475. "../enum/Direction": 22,
  25476. "../enum/GLCubeFaces": 25,
  25477. "../enum/Keys": 30,
  25478. "../enum/ModelManagerEvents": 33,
  25479. "../enum/PlayerEvents": 40,
  25480. "../enum/RenderLayers": 41,
  25481. "../enum/Vectors": 50,
  25482. "../enum/Viewmode": 51,
  25483. "../enum/WarpStyle": 52,
  25484. "../lib/jpeg_encoder": 94,
  25485. "../sdk/SdkEvents": 161,
  25486. "../settings": 166,
  25487. "../util/common": 185,
  25488. "../util/logger": 189,
  25489. "../util/math": 190,
  25490. "../util/panorama": 191,
  25491. "./ApiHost": 159,
  25492. "./PostMessageType": 160,
  25493. "./TransitionStyles": 162,
  25494. three: 217
  25495. }],
  25496. 165: [function(e, t, i) {
  25497. "use strict";
  25498. function n(e) {
  25499. this.sourceWindow = e,
  25500. this.targetWindow = null,
  25501. this.targetOrigin = null,
  25502. this.id = Math.floor(1e5 * Math.random()),
  25503. this.bindEvents()
  25504. }
  25505. var r = e("./PostMessageType")
  25506. , o = e("events").EventEmitter;
  25507. n.prototype = Object.create(o.prototype),
  25508. n.prototype.bindEvents = function() {
  25509. this.sourceWindow.addEventListener("message", this.onPostmessageReceived.bind(this))
  25510. }
  25511. ,
  25512. n.prototype.setTarget = function(e, t) {
  25513. this.targetWindow = e,
  25514. this.targetOrigin = t
  25515. }
  25516. ,
  25517. n.prototype.onPostmessageReceived = function(e) {
  25518. var t = e.origin || e.originalEvent.origin
  25519. , i = e.source;
  25520. switch (e.data.type) {
  25521. case r.CONNECT:
  25522. break;
  25523. case r.RESPONSE:
  25524. if (this.id !== e.data.toId)
  25525. return;
  25526. default:
  25527. if (!this.validateMessageOrigin(t))
  25528. return
  25529. }
  25530. var n = e.data;
  25531. n.source = i,
  25532. n.origin = t,
  25533. n.timestamp = Date.now(),
  25534. this.emit(e.data.type, n)
  25535. }
  25536. ,
  25537. n.prototype.validateMessageOrigin = function(e) {
  25538. return "*" === this.targetOrigin || e === this.targetOrigin
  25539. }
  25540. ,
  25541. n.prototype.send = function(e) {
  25542. this.targetWindow && this.targetOrigin && (e.fromId = this.id,
  25543. this.targetWindow.postMessage(e, this.targetOrigin))
  25544. }
  25545. ,
  25546. t.exports = n
  25547. }
  25548. , {
  25549. "./PostMessageType": 160,
  25550. events: 202
  25551. }],
  25552. 166: [function(e, t, i) {
  25553. "use strict";
  25554. var n = e("three")
  25555. , r = e("./util/browser")
  25556. , o = e("./enum/Viewmode")
  25557. , a = e("./enum/VROption")
  25558. , s = e("./enum/Colors")
  25559. , l = e("./enum/WarpStyle")
  25560. , c = e("./util/easing")
  25561. , h = e("./util/common")
  25562. , u = e("./util/showcase")
  25563. , d = e("./constants")
  25564. , p = {
  25565. debug: !1,
  25566. version: "2.25.6-0-gd87e5b1",
  25567. languageTag: r.valueFromHash("lang", null),
  25568. pageTitle: "四维虚拟漫游",
  25569. authorizationHeader: u.getAuthorizationHeader(),
  25570. autoplay: r.valueFromHash("play", !1) || !r.inIframe(),
  25571. logLevel: r.valueFromHash("log", 2),
  25572. skyboxRadius: 2500,
  25573. modelBoundsPadding: 5,
  25574. showNeighbors: !1,
  25575. brand: r.valueFromHash("brand", !0),
  25576. showHighlights: r.valueFromHash("hhl", !0) && r.valueFromHash("hr", 1),
  25577. startHighlights: r.valueFromHash("hl", -1),
  25578. specialEdition: r.valueFromHash("bn", 0),
  25579. useWheel: r.valueFromHash("wh", !0),
  25580. crossOrigin: "anonymous",
  25581. fancierTransition: !1,
  25582. wireframe: !1,
  25583. skyboxWireframe: !1,
  25584. modelAlpha: 1,
  25585. highlightPanoSelection: !1,
  25586. showSweeps: !0,
  25587. showSkyboxes: !1,
  25588. showMesh: !0,
  25589. showFloors: !1,
  25590. showFloorDuration: 300,
  25591. showFloorDelay: 300,
  25592. hideFloorDuration: 300,
  25593. hideFloorDelay: 0,
  25594. reticuleOpacityTransitionTime: 250,
  25595. reticuleColor: window.MP_PREFETCHED_MODELDATA.mouseMarkerColor || s.newBlue, // 方奕卓 配置鼠标标志颜色
  25596. markerOpacityTransitionTime: 500,
  25597. guiAnimationSpeed: 250,
  25598. highlightAnimationDuration: 500,
  25599. modelComponentLoadSpinnerDelay: 150,
  25600. captureErrors: !1,
  25601. maxMobileTextures: 6,
  25602. minimalMemoryMode: r.valueFromHash("m3", r.isMobile()),
  25603. startupFlyinDelay: 3e3,
  25604. dollhouseDefault: {
  25605. minDistance: 15,
  25606. maxDistance: 50,
  25607. minPolarAngle: n.Math.degToRad(10),
  25608. maxPolarAngle: n.Math.degToRad(90)
  25609. },
  25610. hideReticuleTimeout: 1e3,
  25611. analytics: {
  25612. inactivityThreshold: 30,
  25613. sessionTrackingRate: .15,
  25614. maxTrackedErrors: 20,
  25615. sessionDurationPingFrequency: 10,
  25616. sessionDurationTimeout: 15
  25617. },
  25618. flydown: {
  25619. movementEasing: "easeInOutQuad",
  25620. movementDelay: .001,
  25621. rotationEasing: "easeInOutQuad",
  25622. rotationDelay: .5,
  25623. modelTextureDelay: .75,
  25624. skyboxDelay: .75
  25625. },
  25626. transition: {
  25627. flySpeed: .001,
  25628. flyTime: 750,
  25629. flytimeMaxDistanceThreshold: 5,
  25630. flytimeDistanceMultiplier: 150,
  25631. aimTime: 1500,
  25632. aimSlowFactor: 1.5,
  25633. blur: 0.8,
  25634. movementEasing: "easeInOutQuad",
  25635. blendEasing: "easeInOutQuad",
  25636. fastForwardFactor: 3//r.valueFromHash("mfis", 3)
  25637. },
  25638. show360Views: {
  25639. enabled: !0,
  25640. transitionTime: 1e3
  25641. },
  25642. quickstart: {
  25643. enabled: 1 === r.valueFromHash("qust", 0) || 1 === r.valueFromHash("qs", 0),
  25644. animation: 1400,
  25645. showTextDelay: 500,
  25646. fadeOutDelay: 3e3,
  25647. fovChange: 10
  25648. },
  25649. appConfig: {
  25650. webvr_version: null,
  25651. segment_key: null,
  25652. embedly_key: null,
  25653. branch_key: null,
  25654. keen_write_key: null,
  25655. keen_project_id: null
  25656. },
  25657. vr: {
  25658. enabled: !0,
  25659. allowWebVR: !1,
  25660. option: r.valueFromHash("vr", a.CONTEXTUAL)
  25661. },
  25662. share: {
  25663. enabled: !r.valueFromHash("mls", 0) && r.valueFromHash("brand", !0)
  25664. },
  25665. input: {
  25666. longTapThreshold: 200,
  25667. moveToleranceNDC: .08,
  25668. touchMoveThreshold: 25
  25669. },
  25670. help: {
  25671. modalStayDuration: 600
  25672. },
  25673. immersive: {
  25674. timeToShowAgain: 1250,
  25675. uiStayDuration: 600
  25676. },
  25677. tourInteraction: {
  25678. disabled: "0" === r.valueFromHash("tourcta", null),
  25679. showPauseButton: 1e3,
  25680. showModal: 1500,
  25681. allowNextClick: 200,
  25682. largeModal: "1" === r.valueFromHash("tourcta", null),
  25683. smallModal: "2" === r.valueFromHash("tourcta", null)
  25684. },
  25685. labels: {
  25686. enabled: !1,
  25687. hideUntilStart: !0,
  25688. fadeInDuration: 250,
  25689. fadeInDelay: 250,
  25690. fadeOutDuration: 250,
  25691. fadeOutDelay: 0,
  25692. zoomHideThreshhold: {
  25693. mobile: r.isSmallScreen() ? .45 : .6,
  25694. desktop: 2
  25695. },
  25696. zoomTruncateThreshhold: {
  25697. mobile: r.isSmallScreen() ? .35 : .45,
  25698. desktop: .85
  25699. },
  25700. minLengthForTruncate: 16,
  25701. truncateLength: 12,
  25702. truncateSuffix: "..."
  25703. },
  25704. tags: {
  25705. enabled: r.valueFromHash("mt", 1),
  25706. startup: {
  25707. hideUntilStart: !0,
  25708. fadeInDuration: 500,
  25709. fadeInDelay: 100
  25710. },
  25711. visibility: {
  25712. anyDistance: !0,
  25713. visibleDistance: 8,
  25714. cameraClearance: .1,
  25715. alphaTestLevel: .05,
  25716. hideViaFloor: !0,
  25717. hideOffScreenDisc: !1,
  25718. hideOffScreenObject: !1
  25719. },
  25720. disc: {
  25721. opacity: 1,
  25722. disabledOpacity: .5,
  25723. scale: {
  25724. nearBound: 1.5,
  25725. farBound: 4.8,
  25726. linkFarBound: !1,
  25727. linkPercent: 40,
  25728. maxSize: 80,
  25729. minSize: 40,
  25730. baseViewportSize: 800,
  25731. responsiveness: 100
  25732. }
  25733. },
  25734. pole: {
  25735. enabled: !0,
  25736. height: .5,
  25737. width: 2,
  25738. opacity: .5,
  25739. color: "white"
  25740. },
  25741. navigate: {
  25742. nearestPano: !0,
  25743. lineOfSight: !0,
  25744. reactivate: !0,
  25745. aimAt: "disc",
  25746. tiltTolerance: 25,
  25747. rotateSpeedFactor: .6
  25748. }
  25749. },
  25750. path: {
  25751. color: window.MP_PREFETCHED_MODELDATA.floorMarkerColor || s.newBlue, // 方奕卓 配置导览标志颜色
  25752. colorUp: s._desat(s.newBlue, .5),
  25753. colorDown: s._darken(s.newBlue, .35),
  25754. opacity: .5,
  25755. style: "ribbon",
  25756. height: .025,
  25757. ribbonWidth: .24,
  25758. outsideHeight: .5,
  25759. waypointRadius: .5,
  25760. waypointIndoorRadius: .24,
  25761. waypointPulse: 1e3,
  25762. typ: l.BLACK,
  25763. meshFree: r.valueFromHash("mf", 1),
  25764. mapGuides: r.valueFromHash("guides", !0),
  25765. fadeInTime: 400,
  25766. fadeOutTime: 300
  25767. },
  25768. warp: {
  25769. nearPanoDist: .1,
  25770. matchCam: !1,
  25771. blur: .33,
  25772. fastTime: 1500,
  25773. teleportTime: 1500,
  25774. outsideTime: 2e3,
  25775. lookAheadMax: .3,
  25776. lookAheadDist: 2.5,
  25777. softPushDist: .37,
  25778. softPushEnd: .3,
  25779. softBendAngle: 8,
  25780. softBendTilt: 4,
  25781. softBendEnd: .3,
  25782. doBurns: true, //r.valueFromHash("kb", !0),
  25783. burnsAngle: 8, //导览在每个点停留时的旋转角度
  25784. minBurnsAngle: 35,
  25785. minDownAngle: -35,
  25786. maxTurnPerSec: 280,
  25787. maxAimPerSec: 35,
  25788. minRotation: 12,
  25789. maxAimRotation: 33.2,
  25790. turnFriction: .2,
  25791. flySpeed: .01,
  25792. minWarpTime: 1200,
  25793. warpInterruptionRedirectTime: 500,
  25794. tourStepDelay: r.valueFromHash("st", 0),
  25795. walkDelay: 0,
  25796. walkMaxDist: 50,
  25797. walkMinDist: .8,
  25798. walkSlideShowThreshhold: 3000,
  25799. walkExtraPanosDistance: .4,
  25800. timePerMeter: 1200,
  25801. motionLeadTime: 5000,
  25802. movementEasing: "easeInOutQuad",
  25803. blendEasing: "easeInOutQuad",
  25804. showBunny: !1,
  25805. loop: r.valueFromHash("lp", !1),
  25806. auto: r.valueFromHash("ts", -1),
  25807. eOrder: 'YXZ', //"YXZ",
  25808. stepFactor: .25,
  25809. brakeStrength: 2,
  25810. minBrakeAngle: .1,
  25811. maxBrakeAngle: 1.8,
  25812. climbEffort: 4
  25813. },
  25814. rotationFriction: .05,
  25815. rotationAccelerationInside: 4.5,
  25816. rotationAccelerationOutside: .15,
  25817. rotationAfterMoveMultiplier: 40,
  25818. rotationAfterMoveHistoryCount: 5,
  25819. panFriction: .09,
  25820. panAccelerationOutside: 60,
  25821. onload: r.valueFromHash("onload", o.PANORAMA),
  25822. zoomNearLimit: .1,
  25823. zoomFarLimit: 10,
  25824. navigation: {
  25825. panoScores: !1,
  25826. mouseDirection: !0,
  25827. filterStrictness: .75,
  25828. angleFactor: -30,
  25829. directionFactor: 10,
  25830. distanceFactor: -1,
  25831. optionalityFactor: 3
  25832. },
  25833. sdkInit: !1,
  25834. secretPanelWord: [38, 38, 40, 40, 37, 39, 37, 39, 66, 65],
  25835. console: r.valueFromHash("console", !1),
  25836. noMeshFloorPositionOffset: new n.Vector3(0,-1.2,0),
  25837. panoramaNeighbourMaxDistance: 5,
  25838. panoFloorClickRadius: .35,
  25839. showScreenshotLocations: !1,
  25840. showAxis: !1,
  25841. showNeighbourRaycasts: !1,
  25842. colorMarkerOnLoad: !1,
  25843. colorMarkerByFloor: !1,
  25844. tiling: {
  25845. panoPreRenderRepeatDelay: 2500,
  25846. panoPreRenderDelay: 500,
  25847. preRenderTourPanos: r.valueFromHash("tileprerender", 0),
  25848. tilingFlagNames: ["usetiles", "tiles"],
  25849. maxNavPanoQuality: r.valueFromHash("maxtileq", null),
  25850. maxZoomPanoQuality: r.valueFromHash("maxztileq", null),
  25851. overlayStyle: r.valueFromHash("tileoverlay", 0),
  25852. uploadIntervalDelay: r.valueFromHash("tileupdelay", 10),
  25853. initialIntervalDelay: r.valueFromHash("itiledelay", 0),
  25854. maxNonBaseUploadsPerFrame: r.valueFromHash("maxnbtpf", 2),
  25855. maxBaseUploadsPerFrame: r.valueFromHash("maxbtpf", 6),
  25856. customCompression: r.valueFromHash("tilecustcomp", 0),
  25857. // mobileHighQualityOverride: !1,
  25858. mobileHighQualityOverride: 1,
  25859. allowUltraHighResolution: true
  25860. },
  25861. zoom: {
  25862. enabled: true,
  25863. forceOff: r.valueFromHash("nozoom", 0),
  25864. overridemax: r.valueFromHash("maxzoom", null),
  25865. overridemin: r.valueFromHash("minzoom", null),
  25866. max: d.highQualityMaxZoom,
  25867. min: 1,
  25868. transitionStyle: r.valueFromHash("zoomtrans", 1),
  25869. activationThreshold: 1.1,
  25870. restoreTime: 500
  25871. },
  25872. profiling: {
  25873. enabled: r.valueFromHash("mem", !1)
  25874. }
  25875. };
  25876. p = h.deepExtend(p, d, {
  25877. insideFOV: r.valueFromHash("fov", d.insideFOV),
  25878. insideFOVMax: r.valueFromHash("fovmax", d.insideFOVMax),
  25879. panorama: {
  25880. transitionTime: 1e3,
  25881. modelAlpha: 0,
  25882. modelAlphaDelay: p.flydown.modelTextureDelay,
  25883. modelAlphaLength: 1,
  25884. skyboxOpacity: 1,
  25885. skyboxOpacityDelay: p.flydown.skyboxDelay,
  25886. skyboxOpacityLength: .9,
  25887. fovLength: 1,
  25888. fovDelay: 0,
  25889. cameraMatrixDuration: .8,
  25890. cameraMatrixDelay: 0,
  25891. cameraMatrixEase: c.easeInCubic,
  25892. reticuleOpacity: 1,
  25893. markerOpacity: .3,
  25894. markerOpacityOnHover: 1
  25895. },
  25896. dollhouse: {
  25897. transitionTime: 1e3,
  25898. modelAlpha: 1,
  25899. modelAlphaDelay: 0,
  25900. modelAlphaLength: 1 - p.flydown.modelTextureDelay,
  25901. skyboxOpacity: 0,
  25902. skyboxOpacityDelay: 0,
  25903. skyboxOpacityLength: 1 - p.flydown.skyboxDelay,
  25904. fovLength: 1,
  25905. fovDelay: 0,
  25906. cameraMatrixDuration: .8,
  25907. cameraMatrixDelay: .3,
  25908. cameraMatrixEase: c.easeInCubic,
  25909. reticuleOpacity: 1,
  25910. markerOpacity: 0,
  25911. markerOpacityOnHover: 0
  25912. },
  25913. floorplan: {
  25914. transitionTime: 1e3,
  25915. modelAlpha: 1,
  25916. modelAlphaDelay: 0,
  25917. modelAlphaLength: 1 - p.flydown.modelTextureDelay,
  25918. skyboxOpacity: 0,
  25919. skyboxOpacityDelay: 0,
  25920. skyboxOpacityLength: 1 - p.flydown.skyboxDelay,
  25921. fovLength: 1,
  25922. fovDelay: 0,
  25923. cameraMatrixDuration: .5,
  25924. cameraMatrixDelay: 0,
  25925. cameraMatrixEase: c.easeOutCubic,
  25926. reticuleOpacity: 1,
  25927. markerOpacity: 0,
  25928. markerOpacityOnHover: 0,
  25929. cameraHeight: 50
  25930. },
  25931. transitioning: {
  25932. reticuleOpacity: 0,
  25933. markerOpacity: .3,
  25934. markerOpacityOnHover: 1
  25935. },
  25936. "floorplan-dollhouse": {
  25937. rotationDelay: 0,
  25938. rotationDuration: 1
  25939. },
  25940. "floorplan-panorama": {
  25941. rotationDelay: .5,
  25942. rotationDuration: 1
  25943. },
  25944. "dollhouse-panorama": {
  25945. rotationDelay: .5,
  25946. rotationDuration: 1
  25947. },
  25948. "dollhouse-floorplan": {
  25949. rotationDelay: 0,
  25950. rotationDuration: 1,
  25951. cameraMatrixDuration: 1.05,
  25952. cameraMatrixDelay: .5
  25953. },
  25954. "panorama-dollhouse": {
  25955. rotationDelay: 0,
  25956. rotationDuration: .5
  25957. },
  25958. "panorama-floorplan": {
  25959. transitionTime: 1500,
  25960. rotationDelay: 0,
  25961. rotationDuration: .5
  25962. }
  25963. }),
  25964. p.path.meshFree && (p.path.typ = l.WALK),
  25965. p.zoom.max = p.zoom.overridemax || p.zoom.max,
  25966. p.zoom.min = p.zoom.overridemin || p.zoom.min,
  25967. t.exports = p
  25968. }
  25969. , {
  25970. "./constants": 8,
  25971. "./enum/Colors": 19,
  25972. "./enum/VROption": 47,
  25973. "./enum/Viewmode": 51,
  25974. "./enum/WarpStyle": 52,
  25975. "./util/browser": 182,
  25976. "./util/common": 185,
  25977. "./util/easing": 186,
  25978. "./util/showcase": 193,
  25979. three: 217
  25980. }],
  25981. 167: [function(e, t, i) {
  25982. "use strict";
  25983. var n = e("three")
  25984. , r = e("./settings")
  25985. , 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"
  25986. , a = "precision highp float;\nprecision highp int;\n\nuniform mat4 viewMatrix;\nuniform vec3 cameraPosition;\n";
  25987. t.exports = {
  25988. basicTextured: {
  25989. uniforms: {
  25990. tDiffuse: {
  25991. type: "t",
  25992. value: null
  25993. },
  25994. alpha: {
  25995. type: "f",
  25996. value: 1
  25997. }
  25998. },
  25999. vertexShader: "varying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}",
  26000. 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}"
  26001. },
  26002. copyCubeMap: {
  26003. uniforms: {
  26004. tDiffuse: {
  26005. type: "t",
  26006. value: null
  26007. },
  26008. alpha: {
  26009. type: "f",
  26010. value: 1
  26011. }
  26012. },
  26013. 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}",
  26014. 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}"
  26015. },
  26016. cube: {
  26017. uniforms: {
  26018. map: {
  26019. type: "t",
  26020. value: null
  26021. },
  26022. opacity: {
  26023. type: "f",
  26024. value: 1
  26025. }
  26026. },
  26027. vertexShader: o + "varying vec3 vWorldPosition;\n\nvoid main() {\n vWorldPosition = position;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}\n",
  26028. 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"
  26029. },
  26030. model: {
  26031. uniforms: {
  26032. map: {
  26033. type: "t",
  26034. value: null
  26035. },
  26036. modelAlpha: {
  26037. type: "f",
  26038. value: r.modelAlpha
  26039. },
  26040. opacity: {
  26041. type: "f",
  26042. value: 1
  26043. },
  26044. progress: {
  26045. type: "f",
  26046. value: 0
  26047. },
  26048. blackout: {
  26049. type: "i",
  26050. value: 0
  26051. },
  26052. pano0Map: {
  26053. type: "t",
  26054. value: null
  26055. },
  26056. pano0Position: {
  26057. type: "v3",
  26058. value: new n.Vector3
  26059. },
  26060. pano0Matrix: {
  26061. type: "m4",
  26062. value: new n.Matrix4
  26063. },
  26064. pano1Map: {
  26065. type: "t",
  26066. value: null
  26067. },
  26068. pano1Position: {
  26069. type: "v3",
  26070. value: new n.Vector3
  26071. },
  26072. pano1Matrix: {
  26073. type: "m4",
  26074. value: new n.Matrix4
  26075. }
  26076. },
  26077. 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",
  26078. 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"
  26079. },
  26080. hot:{
  26081. uniforms:{
  26082. color:{
  26083. type: "c",
  26084. value: new n.Color( 0xff2200 )
  26085. },
  26086. opac:{
  26087. type: "f",
  26088. value: 0
  26089. },
  26090. texture1:{
  26091. type: "t",
  26092. value: null
  26093. },
  26094. texture2:{
  26095. type: "t",
  26096. value: null
  26097. }
  26098. },
  26099. vertexShader:"varying vec2 vUv;\n\nvoid main() {\n\n vUv = uv ;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n",
  26100. 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"
  26101. },
  26102. modelOutside: {
  26103. uniforms: {
  26104. map: {
  26105. type: "t",
  26106. value: null
  26107. },
  26108. opacity: {
  26109. type: "f",
  26110. value: 1
  26111. }
  26112. },
  26113. vertexShader: o + "varying vec2 vUv;\n\nvoid main() {\n\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n",
  26114. 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"
  26115. },
  26116. ribbon: {
  26117. uniforms: {
  26118. map: {
  26119. type: "t",
  26120. value: null
  26121. },
  26122. opacity: {
  26123. type: "f",
  26124. value: 1
  26125. },
  26126. color: {
  26127. type: "c",
  26128. value: new n.Color(r.path.color)
  26129. }
  26130. },
  26131. 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",
  26132. 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"
  26133. },
  26134. waypoint: {
  26135. uniforms: {
  26136. map: {
  26137. type: "t",
  26138. value: null
  26139. },
  26140. opacity: {
  26141. type: "f",
  26142. value: 1
  26143. },
  26144. pulse: {
  26145. type: "f",
  26146. value: 1
  26147. },
  26148. nearFade: {
  26149. type: "v2",
  26150. value: new n.Vector2(2 * r.insideNear,2 * r.path.waypointIndoorRadius)
  26151. },
  26152. color: {
  26153. type: "c",
  26154. value: new n.Color(r.reticuleColor)
  26155. }
  26156. },
  26157. 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",
  26158. 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"
  26159. },
  26160. modelDebug: {
  26161. uniforms: {
  26162. map: {
  26163. type: "t",
  26164. value: null
  26165. },
  26166. modelAlpha: {
  26167. type: "f",
  26168. value: r.modelAlpha
  26169. },
  26170. depthmapRatio: {
  26171. type: "f",
  26172. value: 0
  26173. },
  26174. opacity: {
  26175. type: "f",
  26176. value: 1
  26177. },
  26178. progress: {
  26179. type: "f",
  26180. value: 0
  26181. },
  26182. considerOcclusion: {
  26183. type: "i",
  26184. value: r.fancierTransition
  26185. },
  26186. highlightPanoSelection: {
  26187. type: "i",
  26188. value: 0
  26189. },
  26190. useThirdPano: {
  26191. type: "i",
  26192. value: r.useThirdPano
  26193. },
  26194. pano0Map: {
  26195. type: "t",
  26196. value: null
  26197. },
  26198. pano0Depth: {
  26199. type: "t",
  26200. value: null
  26201. },
  26202. pano0Position: {
  26203. type: "v3",
  26204. value: new n.Vector3
  26205. },
  26206. pano0Matrix: {
  26207. type: "m4",
  26208. value: new n.Matrix4
  26209. },
  26210. pano0Weight: {
  26211. type: "f",
  26212. value: r.transition.pano0Weight
  26213. },
  26214. pano1Map: {
  26215. type: "t",
  26216. value: null
  26217. },
  26218. pano1Depth: {
  26219. type: "t",
  26220. value: null
  26221. },
  26222. pano1Position: {
  26223. type: "v3",
  26224. value: new n.Vector3
  26225. },
  26226. pano1Matrix: {
  26227. type: "m4",
  26228. value: new n.Matrix4
  26229. },
  26230. pano1Weight: {
  26231. type: "f",
  26232. value: r.transition.pano1Weight
  26233. },
  26234. pano2Map: {
  26235. type: "t",
  26236. value: null
  26237. },
  26238. pano2Depth: {
  26239. type: "t",
  26240. value: null
  26241. },
  26242. pano2Position: {
  26243. type: "v3",
  26244. value: new n.Vector3
  26245. },
  26246. pano2Matrix: {
  26247. type: "m4",
  26248. value: new n.Matrix4
  26249. },
  26250. pano2Weight: {
  26251. type: "f",
  26252. value: r.transition.pano2Weight
  26253. }
  26254. },
  26255. 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",
  26256. 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"
  26257. },
  26258. customDepth: {
  26259. uniforms: {
  26260. panoPosition: {
  26261. type: "v3",
  26262. value: new n.Vector3
  26263. }
  26264. },
  26265. 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",
  26266. 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"
  26267. },
  26268. skysphere: {
  26269. uniforms: {
  26270. radius: {
  26271. type: "f",
  26272. value: 0
  26273. }
  26274. },
  26275. 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",
  26276. 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"
  26277. },
  26278. tagDisc: {
  26279. uniforms: {
  26280. opacity: {
  26281. type: "f",
  26282. value: 0
  26283. },
  26284. color: {
  26285. type: "c",
  26286. value: new n.Color
  26287. },
  26288. bg: {
  26289. type: "t",
  26290. value: null
  26291. },
  26292. mask: {
  26293. type: "t",
  26294. value: null
  26295. }
  26296. },
  26297. vertexShader: o + "varying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}",
  26298. 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"
  26299. }
  26300. }
  26301. }
  26302. , {
  26303. "./settings": 166,
  26304. three: 217
  26305. }],
  26306. 168: [function(e, t, i) {
  26307. (function(i) {
  26308. "use strict";
  26309. var n = e("three")
  26310. , r = (e("url"),
  26311. e("./util/ajax"))
  26312. , o = e("./settings")
  26313. , a = e("./util/logger")
  26314. , s = e("./util/math")
  26315. , l = e("./util/showcase")
  26316. , c = e("./objects/Panorama")
  26317. , h = new a(i)
  26318. , u = e("./model/Model")
  26319. , d = e("./shaders")
  26320. , p = e("./util/transitions")
  26321. , f = e("./objects/Chunk")
  26322. , g = e("./objects/Reticule")
  26323. , m = e("./objects/Skybox")
  26324. , v = e("./objects/Floor")
  26325. , A = e("./cameras/DollhouseCamera")
  26326. , y = e("./cameras/FloorplanCamera")
  26327. , C = e("./cameras/PanoramaCamera")
  26328. , I = e("./controls/DollhouseControls")
  26329. , E = e("./controls/FloorplanControls")
  26330. , b = e("./controls/PanoramaControls");
  26331. n.ImageUtils.crossOrigin = o.crossOrigin,
  26332. t.exports = {
  26333. shaders: d,
  26334. transitions: p,
  26335. Model: u,
  26336. Chunk: f,
  26337. Floor: v,
  26338. Skybox: m,
  26339. Reticule: g,
  26340. Panorama: c,
  26341. DollhouseCamera: A,
  26342. FloorplanCamera: y,
  26343. PanoramaCamera: C,
  26344. DollhouseControls: I,
  26345. FloorplanControls: E,
  26346. PanoramaControls: b,
  26347. getModel: function(e) {
  26348. if (!e.url)
  26349. throw 'getModel(): missing parameter "url"';
  26350. e.autoload = void 0 === e.autoload || e.autoload;
  26351. var t = l.parseSidUrl(e.url);
  26352. e.urlBase = t.urlBase,
  26353. e.urlModel = t.urlModel,
  26354. e.urlFiles = t.urlFiles;
  26355. var i = this._getPlatformError();
  26356. return i ? $.Deferred().reject(i).promise() : (this.options = e,
  26357. this._loadModel().then(this._buildModel.bind(this)))
  26358. },
  26359. _getPlatformError: function() {
  26360. 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"
  26361. },
  26362. _loadModel: function() {
  26363. return r.get(this.options.urlModel, {
  26364. responseType: "json",
  26365. prefetchFrom: "model",
  26366. auth: l.getAuthorizationHeader()
  26367. }).then(null, function() {
  26368. return h.warn("Model loading failed at initial metadata load"),
  26369. "loading-failed"
  26370. })
  26371. },
  26372. _buildModel: function(e) {
  26373. e = l.normalizeModeldata(e, s);
  26374. var t = new u(this.options,e);
  26375. return this.options.autoload ? t.load(!0) : $.when(t)
  26376. }
  26377. }
  26378. }
  26379. ).call(this, "/js/showcase.js")
  26380. }
  26381. , {
  26382. "./cameras/DollhouseCamera": 5,
  26383. "./cameras/FloorplanCamera": 6,
  26384. "./cameras/PanoramaCamera": 7,
  26385. "./controls/DollhouseControls": 10,
  26386. "./controls/FloorplanControls": 11,
  26387. "./controls/PanoramaControls": 13,
  26388. "./model/Model": 139,
  26389. "./objects/Chunk": 144,
  26390. "./objects/Floor": 146,
  26391. "./objects/Panorama": 148,
  26392. "./objects/Reticule": 149,
  26393. "./objects/Skybox": 152,
  26394. "./settings": 166,
  26395. "./shaders": 167,
  26396. "./util/ajax": 181,
  26397. "./util/logger": 189,
  26398. "./util/math": 190,
  26399. "./util/showcase": 193,
  26400. "./util/transitions": 195,
  26401. three: 217,
  26402. url: 208
  26403. }],
  26404. 169: [function(e, t, i) {
  26405. "use strict";
  26406. function n() {
  26407. var e = {
  26408. renderTarget: null,
  26409. inUse: !1,
  26410. size: -1,
  26411. pano: null
  26412. };
  26413. return e
  26414. }
  26415. function r(e) {
  26416. M.push(e)
  26417. }
  26418. function o(e) {
  26419. var t = n();
  26420. return t.inUse = !0,
  26421. t.size = e,
  26422. r(t),
  26423. t
  26424. }
  26425. function a(e) {
  26426. for (var t = 0; t < M.length; t++) {
  26427. var i = M[t];
  26428. if (!i.inUse && i.size === e)
  26429. return i.inUse = !0,
  26430. i
  26431. }
  26432. return null
  26433. }
  26434. function s(e) {
  26435. for (var t = 0; t < M.length; t++) {
  26436. var i = M[t];
  26437. if (i.renderTarget === e)
  26438. return i.inUse = !1,
  26439. !0
  26440. }
  26441. return !1
  26442. }
  26443. function l() {
  26444. this.tileDirectory = {},
  26445. this.activeRenderTargetDescriptors = {},
  26446. this.activePanos = [],
  26447. this.panoLODDescriptors = {},
  26448. this.panoDescriptors = {},
  26449. this.tileTrees = {},
  26450. this.sceneRenderer = null,
  26451. this.tileDownloader = null,
  26452. this.forceQueue = [],
  26453. this.uploadQueues = {},
  26454. this.uploadInterval = null,
  26455. this.uploadIntervalCancelled = !1,
  26456. this.usingTileOverlay = !1,
  26457. this.overlayTilesLoaded = !1,
  26458. this.overlayTileBase = null,
  26459. this.overlayTilesBasic = {},
  26460. this.overlayTilesEnhanced = {},
  26461. this.zoomRenderTarget = null,
  26462. this.zoomPano = null,
  26463. this.zoomingActive = !1,
  26464. this.zoomPanoId = null,
  26465. this.zoomPanoRenderingDisabled = !1,
  26466. this.direction = new h.Vector3,
  26467. this.initTime = -1,
  26468. this.maxBaseUploadsPerFrame = x,
  26469. this.maxNonBaseUploadsPerFrame = T
  26470. }
  26471. function c() {
  26472. this.uploadIntervalCancelled || (this.overlayTilesLoaded || !this.usingTileOverlay ? (b = !0,
  26473. this.updateUploadQueue(this.maxNonBaseUploadsPerFrame, this.maxBaseUploadsPerFrame),
  26474. this.peekNextFromUploadQueue() ? this.refreshUploadInterval(w) : this.uploadInterval = null) : this.refreshUploadInterval(this.uploadIntervalDelay))
  26475. }
  26476. var h = e("three")
  26477. , u = e("../exception/BasicException")
  26478. , d = e("../settings")
  26479. , p = e("../enum/PanoSizeClass")
  26480. , f = (e("../objects/Panorama"),
  26481. e("../enum/PanoRendererEvents"))
  26482. , g = e("../enum/SceneRendererEvents")
  26483. , m = e("../enum/TileDownloaderEvents")
  26484. , v = e("../enum/Vectors")
  26485. , A = (e("../enum/GLCubeFaces"),
  26486. e("../objects/Panorama"),
  26487. e("./TileTree"))
  26488. , y = (e("./TileDownloader"),
  26489. e("./TilePrioritizer"))
  26490. , C = e("./TileUtils")
  26491. , p = e("../enum/PanoSizeClass")
  26492. , I = (e("../util/browser"),
  26493. e("../util/panorama"))
  26494. , E = e("events").EventEmitter
  26495. , b = !1
  26496. , w = d.tiling.uploadIntervalDelay
  26497. , _ = d.tiling.initialIntervalDelay
  26498. , T = d.tiling.maxNonBaseUploadsPerFrame
  26499. , x = d.tiling.maxBaseUploadsPerFrame
  26500. , S = {
  26501. Base: 0,
  26502. Remaining: 1
  26503. }
  26504. , M = [];
  26505. l.prototype = Object.create(E.prototype),
  26506. l.prototype.init = function(e, t, i) {
  26507. this.sceneRenderer = e,
  26508. this.tileDownloader = t,
  26509. this.qualityManager = i,
  26510. this.bindEvents(),
  26511. this.sceneRenderer.on(g.ContextCreated, this.loadOverlayTiles.bind(this)),
  26512. this.initTime = performance.now()
  26513. }
  26514. ,
  26515. l.prototype.getActivePanoTextures = function(e) {
  26516. e = e || [];
  26517. for (var t = 0; t < M.length; t++) {
  26518. var i = M[t];
  26519. i.renderTarget && i.renderTarget.texture && e.push(i.renderTarget.texture)
  26520. }
  26521. }
  26522. ,
  26523. l.prototype.hasQueuedTiles = function() {
  26524. var e = this.peekNextFromUploadQueue();
  26525. return null !== e && void 0 !== e
  26526. }
  26527. ,
  26528. l.prototype.getActiveRenderTargetDescriptor = function(e) {
  26529. return this.activeRenderTargetDescriptors[e]
  26530. }
  26531. ,
  26532. l.prototype.setActiveRenderTargetDescriptor = function(e, t) {
  26533. this.activeRenderTargetDescriptors[e] = t
  26534. }
  26535. ,
  26536. l.prototype.loadOverlayTiles = function() {
  26537. if (0 !== d.tiling.overlayStyle) {
  26538. var e = 0
  26539. , t = function(t, n, r) {
  26540. t = n ? t[n] = this.sceneRenderer.initSizedTexture2D(C.TILE_SIZE, h.ClampToEdgeWrapping) : this.overlayTileBase = this.sceneRenderer.initSizedTexture2D(C.TILE_SIZE, h.ClampToEdgeWrapping),
  26541. this.sceneRenderer.uploadTexture2D(r, t, 0, 0, C.TILE_SIZE, C.TILE_SIZE),
  26542. e++,
  26543. e === i.length && (this.overlayTilesLoaded = !0)
  26544. }
  26545. .bind(this)
  26546. , 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)]];
  26547. i.forEach(function(e) {
  26548. this.tileDownloader.loadImage(e[0], 0, e[1])
  26549. }
  26550. .bind(this)),
  26551. this.usingTileOverlay = !0
  26552. } else
  26553. this.usingTileOverlay = !1
  26554. }
  26555. ,
  26556. l.prototype.bindEvents = function() {
  26557. this.tileDownloader.on(m.TileDownloadSuccess, this.onTileDownloaded.bind(this))
  26558. }
  26559. ,
  26560. l.prototype.setupZoomRenderTarget = function() {
  26561. if (this.qualityManager.getMaxZoomPanoSize() >= this.qualityManager.getMaxNavPanoSize()) {
  26562. if (this.zoomRenderTarget && this.zoomRenderTarget.width === this.qualityManager.getMaxZoomPanoSize())
  26563. return;
  26564. var e = this.zoomRenderTarget;
  26565. if (this.zoomRenderTarget = this.initTiledPano(this.qualityManager.getMaxZoomPanoSize(), !1),
  26566. e) {
  26567. var t = e.width
  26568. , i = this.zoomRenderTarget.width;
  26569. this.sceneRenderer.copyCubeMap(e.texture, this.zoomRenderTarget, t, t, i, i),
  26570. e.texture.dispose(),
  26571. e.texture.loaded = !1,
  26572. e.texture.version = 0,
  26573. this.sceneRenderer.deallocateCubeTexture(e.texture),
  26574. e.texture = null
  26575. }
  26576. this.zoomPanoRenderingDisabled = !1
  26577. } else
  26578. this.zoomPanoRenderingDisabled = !0
  26579. }
  26580. ,
  26581. l.prototype.enableUltraHighQualityMode = function(e) {
  26582. if (!this.qualityManager.ultraHighQualityModeEnabled()) {
  26583. var t = this.qualityManager.getPanoSize(p.ULTRAHIGH);
  26584. this.tileDownloader.testDownload(t, C.TILE_SIZE, function(t) {
  26585. t && (this.qualityManager.enableUltraHighQualityMode(),
  26586. this.setupZoomRenderTarget(),
  26587. e())
  26588. }
  26589. .bind(this))
  26590. }
  26591. }
  26592. ,
  26593. l.prototype.activateTiledPano = function(e, t, i) {
  26594. i && this.clearAllQueuedUploads();
  26595. for (var n = 0; n < C.FACES_PER_PANO; n++)
  26596. this.initTileTree(e.id, n, this.qualityManager.getMaxPossiblePanoSize());
  26597. this.linkAllTilesAndNodes(e);
  26598. var r = this.getActiveRenderTargetDescriptor(e.id)
  26599. , l = t;
  26600. if (l > this.qualityManager.getMaxNavPanoSize() && (l = this.qualityManager.getMaxNavPanoSize()),
  26601. !r || l !== r.size) {
  26602. if (r && s(r.renderTarget),
  26603. r = a(l),
  26604. !r) {
  26605. var c = this.initTiledPano(l, !1);
  26606. r = o(c.width),
  26607. r.renderTarget = c
  26608. }
  26609. r.pano = e,
  26610. this.resetPanoDescriptor(e.id),
  26611. this.resetPanoLODDescriptors(e.id),
  26612. this.resetRenderStatus(e.id, !0, !0)
  26613. }
  26614. this.setActiveRenderTargetDescriptor(e.id, r);
  26615. var h = i ? 0 : 1;
  26616. return this.updateActivePanos(e, h),
  26617. r.renderTarget
  26618. }
  26619. ,
  26620. l.prototype.deactivateTiledPano = function(e) {
  26621. var t = this.getActiveRenderTargetDescriptor(e.id);
  26622. this.isRenderTargetDescriptorValid(t) && s(t.renderTarget),
  26623. this.setActiveRenderTargetDescriptor(e.id, null);
  26624. var i = this.getUploadQueueForPano(e.id);
  26625. this.clearUploadQueue(i),
  26626. this.updateActivePanos()
  26627. }
  26628. ,
  26629. l.prototype.updateActivePanos = function() {
  26630. var e = [];
  26631. return function(t, i) {
  26632. e.length = 0;
  26633. for (var n = 0; n < this.activePanos.length; n++) {
  26634. t && e.length === i && e.push(t);
  26635. var r = this.activePanos[n]
  26636. , o = this.getActiveRenderTargetDescriptor(r.id);
  26637. t && r.id === t.id || !this.isRenderTargetDescriptorValid(o) || e.push(r)
  26638. }
  26639. t && i >= e.length && e.push(t),
  26640. this.activePanos.length = 0,
  26641. this.activePanos.push.apply(this.activePanos, e)
  26642. }
  26643. }(),
  26644. l.prototype.getActivePanoCount = function() {
  26645. return this.activePanos.length
  26646. }
  26647. ,
  26648. l.prototype.resetRenderStatus = function(e, t, i, n) {
  26649. var r = null;
  26650. n && (r = A.getLevelCountForSize(C.TILE_SIZE, n) + 1);
  26651. for (var o = function(e, n, r, o) {
  26652. i && (n.tile.zoomUploaded = !1),
  26653. t && (n.tile.uploaded = !1)
  26654. }, a = 0; a < C.FACES_PER_PANO; a++) {
  26655. var s = this.getTileTree(e, a);
  26656. s.breadthFirst({
  26657. callback: o.bind(this, a),
  26658. minLevel: r
  26659. })
  26660. }
  26661. }
  26662. ,
  26663. l.prototype.copyBaseRenderStatusToZoomed = function(e) {
  26664. for (var t = A.getLevelCountForSize(C.TILE_SIZE, this.qualityManager.getMaxNavPanoSize()), i = function(e, t, i, n) {
  26665. t.tile.zoomUploaded = t.tile.uploaded,
  26666. t.zoomCovered = t.covered
  26667. }, n = 0; n < C.FACES_PER_PANO; n++) {
  26668. var r = this.getTileTree(e, n);
  26669. r.breadthFirst({
  26670. callback: i.bind(this, n),
  26671. maxLevel: t
  26672. })
  26673. }
  26674. }
  26675. ,
  26676. l.prototype.renderPanoTiles = function() {
  26677. var e = [];
  26678. return function(t, i, n, r) {
  26679. this.zoomRenderTarget && this.zoomRenderTarget.width === this.qualityManager.getMaxZoomPanoSize() || this.zoomPanoRenderingDisabled || this.setupZoomRenderTarget(),
  26680. i = i || this.direction || v.FORWARD;
  26681. var o = this.getActiveRenderTargetDescriptor(t);
  26682. if (!this.isRenderTargetDescriptorValid(o))
  26683. throw new u("PanoRenderer.renderPanoTiles() -> Cannot render to a pano that is not activated.");
  26684. for (var a = 0; a < C.FACES_PER_PANO; a++) {
  26685. var s = this.getTileTree(t, a);
  26686. e.length = 0,
  26687. s.breadthFirst({
  26688. saveVisited: e
  26689. });
  26690. for (var l = 0; l < e.length; l++) {
  26691. var c = e[l];
  26692. this.queueTileUpload(c.tile, !1, r || 0 === l && n)
  26693. }
  26694. }
  26695. this.updateDirection(i)
  26696. }
  26697. }(),
  26698. l.prototype.isRenderTargetDescriptorValid = function(e) {
  26699. return e && e.renderTarget
  26700. }
  26701. ,
  26702. l.prototype.isPanoActive = function(e) {
  26703. var t = this.getActiveRenderTargetDescriptor(e);
  26704. return this.isRenderTargetDescriptorValid(t)
  26705. }
  26706. ,
  26707. l.prototype.isPanoZoomed = function(e) {
  26708. return this.zoomingActive && this.zoomPanoId === e
  26709. }
  26710. ,
  26711. l.prototype.initTileTree = function(e, t, i) {
  26712. var n = this.tileTrees[e];
  26713. n || (n = [],
  26714. this.tileTrees[e] = n);
  26715. var r = n[t];
  26716. if (!r) {
  26717. var o = A.getLevelCountForSize(C.TILE_SIZE, i);
  26718. r = new A(C.TILE_SIZE,o),
  26719. n[t] = r
  26720. }
  26721. }
  26722. ,
  26723. l.prototype.getTileTree = function(e, t) {
  26724. var i = this.tileTrees[e];
  26725. if (!i)
  26726. throw new u("PanoRenderer.getTileTree() -> Tree array not yet initialized!");
  26727. var n = i[t];
  26728. if (!n)
  26729. throw new u("PanoRenderer.getTileTree() -> Tree not yet initialized!");
  26730. return n
  26731. }
  26732. ,
  26733. l.prototype.initTiledPano = function(e, t) {
  26734. var i = this.sceneRenderer.renderer
  26735. , n = (i.context,
  26736. new h.WebGLRenderTargetCube(e,e,{
  26737. stencilBuffer: !1
  26738. }))
  26739. , r = new h.CubeTexture([]);
  26740. n.texture = r,
  26741. r.image = [null, null, null, null, null, null],
  26742. r.flipY = !0,
  26743. t ? (r.generateMipmaps = !0,
  26744. r.magFilter = h.LinearFilter,
  26745. r.minFilter = h.LinearMipMapLinearFilter) : (r.generateMipmaps = !1,
  26746. r.magFilter = h.LinearFilter,
  26747. r.minFilter = h.LinearFilter),
  26748. r.format = h.RGBAFormat,
  26749. i.setRenderTarget(n),
  26750. i.setRenderTarget(null);
  26751. var o = i.properties.get(r);
  26752. return o.__image__webglTextureCube = o.__webglTexture,
  26753. n
  26754. }
  26755. ,
  26756. l.prototype.getUploadQueueForPano = function(e) {
  26757. var t = this.uploadQueues[e];
  26758. return t || (t = [],
  26759. this.uploadQueues[e] = t),
  26760. t
  26761. }
  26762. ,
  26763. l.prototype.isTileUploaded = function(e) {
  26764. return this.isPanoZoomed(e.panoId) ? e.zoomUploaded : e.uploaded
  26765. }
  26766. ,
  26767. l.prototype.setUploaded = function(e, t) {
  26768. this.isPanoZoomed(e.panoId) ? e.zoomUploaded = t : e.uploaded = t
  26769. }
  26770. ,
  26771. l.prototype.queueTileUpload = function(e, t, i) {
  26772. var n = this.getActiveRenderTargetDescriptor(e.panoId);
  26773. if (this.isRenderTargetDescriptorValid(n) && e.downloaded && !this.isTileUploaded(e) && (!e.uploadQueued || i) && (!(e.panoSize > this.qualityManager.getMaxNavPanoSize()) || this.zoomingActive)) {
  26774. var r = this.getUploadQueueForPano(e.panoId);
  26775. 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),
  26776. e.uploadQueued = !0,
  26777. this.uploadInterval || this.uploadIntervalCancelled || this.refreshUploadInterval(0))
  26778. }
  26779. }
  26780. ,
  26781. l.prototype.shoulPushToFrontOfQueue = function(e) {
  26782. return 0 === A.getLevelCountForSize(C.TILE_SIZE, e.panoSize)
  26783. }
  26784. ,
  26785. l.prototype.getTopUploadQueue = function() {
  26786. for (var e = null, t = null, i = S.Base; i <= S.Remaining; i++)
  26787. for (var n = 0; n < this.activePanos.length; n++)
  26788. if (e = this.activePanos[n],
  26789. t = this.getUploadQueueForPano(e.id),
  26790. t.length > 0)
  26791. switch (i) {
  26792. case S.Base:
  26793. if (0 === t[0].level)
  26794. return t;
  26795. break;
  26796. case S.Remaining:
  26797. return t
  26798. }
  26799. return null
  26800. }
  26801. ,
  26802. l.prototype.getNextFromUploadQueue = function() {
  26803. var e = function(e) {
  26804. var t = e.shift();
  26805. return t.uploadQueued = !1,
  26806. t
  26807. };
  26808. return function() {
  26809. if (this.forceQueue.length > 0)
  26810. return e(this.forceQueue);
  26811. var t = this.getTopUploadQueue();
  26812. return t && t.length > 0 ? e(t) : null
  26813. }
  26814. }(),
  26815. l.prototype.peekNextFromUploadQueue = function() {
  26816. if (this.forceQueue.length > 0)
  26817. return this.forceQueue[0];
  26818. var e = this.getTopUploadQueue();
  26819. return e && e.length > 0 ? e[0] : null
  26820. }
  26821. ,
  26822. l.prototype.clearAllQueuedUploads = function() {
  26823. this.clearAllUploadQueues(null, 0)
  26824. }
  26825. ,
  26826. l.prototype.clearAllQueuedUploadsForPano = function(e) {
  26827. this.clearAllUploadQueues(e, 0)
  26828. }
  26829. ,
  26830. l.prototype.clearAllUploadQueues = function(e, t) {
  26831. if (e)
  26832. this.clearUploadQueue(this.getUploadQueueForPano(e), t),
  26833. this.clearUploadQueue(this.forceQueue, t, e);
  26834. else {
  26835. for (var i = 0; i < this.activePanos.length; i++) {
  26836. var n = this.activePanos[i];
  26837. this.clearUploadQueue(this.getUploadQueueForPano(n.id), t)
  26838. }
  26839. this.clearUploadQueue(this.forceQueue, t)
  26840. }
  26841. }
  26842. ,
  26843. l.prototype.clearUploadQueue = function(e, t, i) {
  26844. void 0 !== t && null !== t || (t = 0);
  26845. for (var n = 0; n < e.length; ) {
  26846. var r = e[n];
  26847. (!i || i && i === r.tile.panoId) && r.level >= t ? (r.uploadQueued = !1,
  26848. e.splice(n, 1)) : n++
  26849. }
  26850. }
  26851. ,
  26852. l.prototype.refreshUploadInterval = function() {
  26853. var e = null;
  26854. return function(t) {
  26855. this.uploadIntervalCancelled || (e || (e = c.bind(this)),
  26856. null !== t && void 0 !== t || (t = w),
  26857. b || (t = _),
  26858. this.uploadInterval = window.setTimeout(e, t),
  26859. this.uploadIntervalDelay = t)
  26860. }
  26861. }(),
  26862. l.prototype.update = function() {
  26863. var e = performance.now()
  26864. , t = 0;
  26865. return function() {
  26866. this.uploadIntervalCancelled = !0,
  26867. window.clearTimeout(this.uploadInterval),
  26868. this.uploadInterval = null;
  26869. var i = performance.now() - e;
  26870. !(i > w || 0 === t) || !this.overlayTilesLoaded && this.usingTileOverlay || (this.updateUploadQueue(this.maxNonBaseUploadsPerFrame, this.maxBaseUploadsPerFrame),
  26871. e = performance.now()),
  26872. t++
  26873. }
  26874. }(),
  26875. l.prototype.updateUploadQueue = function(e, t) {
  26876. e || (e = 1);
  26877. for (var i = 0, n = 0; ; ) {
  26878. if (n >= t || i >= e)
  26879. break;
  26880. var r = this.getNextFromUploadQueue();
  26881. if (!r)
  26882. break;
  26883. if (0 !== r.level ? i++ : n++,
  26884. !(r.panoSize > this.qualityManager.getMaxNavPanoSize()) || this.zoomingActive) {
  26885. var o = this.getActiveRenderTargetDescriptor(r.panoId);
  26886. this.isRenderTargetDescriptorValid(o) && this.uploadTile(r, r.forceUpload)
  26887. }
  26888. }
  26889. }
  26890. ,
  26891. l.prototype.updateDirection = function(e) {
  26892. if (e = e || this.direction) {
  26893. this.direction = e;
  26894. for (var t = 0; t < this.activePanos.length; t++) {
  26895. var i = this.activePanos[t]
  26896. , n = this.getUploadQueueForPano(i.id);
  26897. y.sortPanoTiles(n, i, this.direction)
  26898. }
  26899. }
  26900. }
  26901. ,
  26902. l.prototype.uploadTile = function() {
  26903. var e = {}
  26904. , t = (new h.Vector4,
  26905. d.tiling.overlayStyle);
  26906. return function(i, n) {
  26907. var r = i.panoId
  26908. , o = i.image
  26909. , a = i.tileSize
  26910. , s = i.panoSize
  26911. , l = i.tileIndex
  26912. , c = (i.faceTileIndex,
  26913. i.totalTiles)
  26914. , u = (i.face,
  26915. i.tileX)
  26916. , d = i.tileY
  26917. , p = !0
  26918. , g = !1
  26919. , m = (this.getPanoDescriptor(r),
  26920. this.getPanoLODDescriptor(r, s))
  26921. , v = this.getActiveRenderTargetDescriptor(r)
  26922. , A = v.renderTarget
  26923. , y = v.size;
  26924. if (this.isPanoZoomed(r) && (A = this.zoomRenderTarget,
  26925. y = this.qualityManager.getMaxZoomPanoSize()),
  26926. this.isRenderTargetDescriptorValid(v) || (p = !1,
  26927. g = !1),
  26928. n || (this.anyUploaded(i.node) && (p = !1,
  26929. g = !0),
  26930. this.isTileUploaded(i) && (p = !1,
  26931. g = !1)),
  26932. p) {
  26933. var C = u * a
  26934. , I = d * a
  26935. , E = a / s * y
  26936. , b = C / s * y
  26937. , w = I / s * y;
  26938. e[a] || (e[a] = this.sceneRenderer.initSizedTexture2D(a, h.ClampToEdgeWrapping));
  26939. var _ = e[a];
  26940. if (this.sceneRenderer.uploadTexture2D(o, _, 0, 0, a, a),
  26941. 1 === t || 2 === t) {
  26942. var T = 1 === t ? this.overlayTilesBasic : this.overlayTilesEnhanced;
  26943. this.sceneRenderer.renderToCubeMap(_, A, a, a, 0, 0, a, a, b, w, E, E, i.cubeFace),
  26944. this.sceneRenderer.renderToCubeMap(T[s], A, a, a, 0, 0, a, a, b, w, E, E, i.cubeFace, h.NormalBlending, !0, .5)
  26945. } else
  26946. this.sceneRenderer.renderToCubeMap(_, A, a, a, 0, 0, a, a, b, w, E, E, i.cubeFace);
  26947. m.uploadCount++,
  26948. this.emit(f.TileRenderSuccess, r, s, l, c),
  26949. m.uploadCount === c && this.emit(f.PanoRenderComplete, r, s, c),
  26950. this.setUploaded(i, !0),
  26951. this.addCoverageForNode(i.node)
  26952. } else
  26953. this.setUploaded(i, !1);
  26954. return i.uploadAttempted || (m.uploadAttempts++,
  26955. this.emit(f.TileUploadAttempted, r, s, l, c)),
  26956. i.uploadAttempted = !0,
  26957. m.uploadAttempts === c && this.emit(f.UploadAttemptedForAllTiles, r, s, c),
  26958. g
  26959. }
  26960. }(),
  26961. l.prototype.linkTileAndNode = function(e, t) {
  26962. t.tile = e,
  26963. e.node = t
  26964. }
  26965. ,
  26966. l.prototype.linkAllTilesAndNodes = function(e) {
  26967. for (var t = function(t, i, n, r, o) {
  26968. var a = this.getTileDirectoryEntry(e.id, i, r, o);
  26969. this.linkTileAndNode(a, n)
  26970. }, i = 0; i < C.FACES_PER_PANO; i++) {
  26971. var n = this.getTileTree(e.id, i);
  26972. n.breadthFirst({
  26973. callback: t.bind(this, n, i)
  26974. })
  26975. }
  26976. }
  26977. ,
  26978. l.prototype.anyUploaded = function(e) {
  26979. if (!e)
  26980. return !1;
  26981. if (e.tile && this.isTileUploaded(e.tile))
  26982. return !0;
  26983. if (e.children)
  26984. for (var t = 0; t < e.children.length; t++) {
  26985. var i = e.children[t];
  26986. if (this.anyUploaded(i))
  26987. return !0
  26988. }
  26989. return !1
  26990. }
  26991. ,
  26992. l.prototype.setNodeCovered = function(e, t) {
  26993. this.isPanoZoomed(e.tile.panoId) ? e.zoomCovered = t : e.covered = t
  26994. }
  26995. ,
  26996. l.prototype.isNodeCovered = function(e) {
  26997. return !!e && (this.isPanoZoomed(e.tile.panoId) ? e.zoomCovered : e.covered)
  26998. }
  26999. ,
  27000. l.prototype.addCoverageForNode = function(e) {
  27001. if (this.setNodeCovered(e, !0),
  27002. e.parent && e.covered) {
  27003. var t = e.parent;
  27004. this.nodeSubcovered(t) && this.addCoverageForNode(t, !0)
  27005. }
  27006. }
  27007. ,
  27008. l.prototype.calcFullCoverage = function(e) {
  27009. var t = !1;
  27010. if (e.children)
  27011. for (var i = 0; i < e.children.length; i++) {
  27012. var n = e.children[i];
  27013. t = t || this.calcFullCoverage(n)
  27014. }
  27015. e.covered = e.tile.uploaded || t
  27016. }
  27017. ,
  27018. l.prototype.nodeSubcovered = function(e) {
  27019. if (!e.children)
  27020. return !1;
  27021. for (var t = 0; t < e.children.length; t++)
  27022. if (!e.children[t] || !this.isNodeCovered(e.children[t]))
  27023. return !1;
  27024. return !0
  27025. }
  27026. ,
  27027. l.prototype.resetPanoDescriptor = function(e) {
  27028. this.getPanoDescriptor(e)
  27029. }
  27030. ,
  27031. l.prototype.getPanoDescriptor = function(e) {
  27032. var t = this.panoDescriptors[e];
  27033. return t || (t = {},
  27034. this.panoDescriptors[e] = t),
  27035. t
  27036. }
  27037. ,
  27038. l.prototype.resetPanoLODDescriptors = function(e) {
  27039. var t = this.getPanoLODDescriptors(e);
  27040. for (var i in t)
  27041. if (t.hasOwnProperty(i)) {
  27042. var n = t[i];
  27043. n.uploadCount = 0,
  27044. n.uploadAttempts = 0
  27045. }
  27046. }
  27047. ,
  27048. l.prototype.getPanoLODDescriptor = function(e, t) {
  27049. var i = this.getPanoLODDescriptors(e)
  27050. , n = i[t];
  27051. return n || (n = {
  27052. uploadCount: 0,
  27053. uploadAttempts: 0
  27054. },
  27055. i[t] = n),
  27056. n
  27057. }
  27058. ,
  27059. l.prototype.getPanoLODDescriptors = function(e) {
  27060. var t = this.panoLODDescriptors[e];
  27061. return t || (t = {},
  27062. this.panoLODDescriptors[e] = t),
  27063. t
  27064. }
  27065. ,
  27066. l.prototype.onTileDownloaded = function(e) {
  27067. var t = A.getLevelCountForSize(C.TILE_SIZE, e.panoSize)
  27068. , i = this.getTileDirectoryEntry(e.panoId, e.face, t, e.faceTileIndex);
  27069. if (i.downloaded = !0,
  27070. i.image = e.image,
  27071. i.panoSize = e.panoSize,
  27072. i.tileX = e.tileX,
  27073. i.tileY = e.tileY,
  27074. i.totalTiles = e.totalTiles,
  27075. i.tileIndex = e.tileIndex,
  27076. i.faceTileIndex = e.faceTileIndex,
  27077. i.face = e.face,
  27078. i.cubeFace = I.mapFaceToCubemapFace(e.face),
  27079. i.panoId = e.panoId,
  27080. i.tileSize = e.tileSize,
  27081. i.direction = (new h.Vector3).copy(e.direction),
  27082. i.node = null,
  27083. i.level = A.getLevelCountForSize(C.TILE_SIZE, i.panoSize),
  27084. this.isPanoActive(i.panoId)) {
  27085. var n = this.getTileTree(i.panoId, i.face)
  27086. , r = n.getSubNode(i.panoSize, i.tileX, i.tileY);
  27087. this.linkTileAndNode(i, r),
  27088. this.queueTileUpload(i, !0)
  27089. }
  27090. }
  27091. ,
  27092. l.prototype.getTileDirectoryEntry = function(e, t, i, n) {
  27093. var r = this.tileDirectory[e];
  27094. r || (r = {},
  27095. this.tileDirectory[e] = r);
  27096. var o = 16384 * t + 1024 * i + n
  27097. , a = r[o];
  27098. return a || (a = {
  27099. downloaded: !1,
  27100. uploaded: !1,
  27101. zoomUploaded: !1
  27102. },
  27103. r[o] = a),
  27104. a._key = e + ":" + t + ":" + i + ":" + n,
  27105. a._tileKey = o,
  27106. a
  27107. }
  27108. ,
  27109. l.prototype.setZoomingActive = function(e, t, i) {
  27110. this.zoomPanoRenderingDisabled || e === this.zoomingActive && this.zoomPanoId === t.id || (this.zoomingActive = e,
  27111. this.zoomPanoId = t.id,
  27112. this.zoomingActive && (this.zoomPanoId !== t.id || i) && this.updateZoomedPanoFromBase(t))
  27113. }
  27114. ,
  27115. l.prototype.updateZoomedPanoFromBase = function(e) {
  27116. if (!this.zoomPanoRenderingDisabled) {
  27117. var t = this.getActiveRenderTargetDescriptor(e.id);
  27118. if (t && t.renderTarget) {
  27119. var i = this.qualityManager.getMaxZoomPanoSize()
  27120. , n = t.renderTarget
  27121. , r = t.size;
  27122. this.sceneRenderer.copyCubeMap(n.texture, this.zoomRenderTarget, r, r, i, i),
  27123. this.copyBaseRenderStatusToZoomed(e.id)
  27124. }
  27125. }
  27126. }
  27127. ,
  27128. t.exports = l
  27129. }
  27130. , {
  27131. "../enum/GLCubeFaces": 25,
  27132. "../enum/PanoRendererEvents": 35,
  27133. "../enum/PanoSizeClass": 36,
  27134. "../enum/SceneRendererEvents": 43,
  27135. "../enum/TileDownloaderEvents": 45,
  27136. "../enum/Vectors": 50,
  27137. "../exception/BasicException": 55,
  27138. "../objects/Panorama": 148,
  27139. "../settings": 166,
  27140. "../util/browser": 182,
  27141. "../util/panorama": 191,
  27142. "./TileDownloader": 171,
  27143. "./TilePrioritizer": 172,
  27144. "./TileTree": 173,
  27145. "./TileUtils": 174,
  27146. events: 202,
  27147. three: 217
  27148. }],
  27149. 170: [function(e, t, i) {
  27150. "use strict";
  27151. function n(e, t, i) {
  27152. this.maxNavPanoSize = -1,
  27153. this.maxZoomPanoSize = -1,
  27154. this.devicePixelDensity = e,
  27155. this.deviceScreenSize = t,
  27156. this.clientBandwidth = i,
  27157. this.panoSizeClassMap = {},
  27158. this.useHighResolutionPanos = !0,
  27159. this.useUltraHighResolutionPanos = !1,
  27160. this.modelHasUltraHighPanos = !1
  27161. }
  27162. var r = e("../enum/PanoSizeClass")
  27163. , o = e("../settings")
  27164. , a = e("../util/browser")
  27165. , s = e("../constants")
  27166. , l = e("../util/showcase")
  27167. , c = e("../enum/ModelManagerEvents");
  27168. n.prototype.init = function(e) {
  27169. this.buildPanoSizeClassMap(this.devicePixelDensity, this.deviceScreenSize, this.clientBandwidth),
  27170. this.ultraHighSize = this.getPanoSize(r.ULTRAHIGH),
  27171. this.highSize = this.getPanoSize(r.HIGH),
  27172. this.standardSize = this.getPanoSize(r.STANDARD),
  27173. this.baseSize = this.getPanoSize(r.BASE),
  27174. o.tiling.maxZoomPanoQuality && this.ultraHighSize <= o.tiling.maxZoomPanoQuality && (o.tiling.allowUltraHighResolution = !0),
  27175. this.highQualityThreshold = a.valueFromHash("threshold2k", s.windowHeightHighQualityThreshold),
  27176. this.updateMaximums(),
  27177. e.on(c.ActiveModelChanged, this.onModelChanged.bind(this))
  27178. }
  27179. ,
  27180. n.prototype.updateFromModel = function(e) {
  27181. this.updateHighResolutionSettings(e),
  27182. this.updateUltraHighResolutionSettings(e)
  27183. }
  27184. ,
  27185. n.prototype.updateHighResolutionSettings = function(e) {
  27186. //---------------------许钟文---------原始的会判断modeldata里version,以致useHighResolutionPanos为false,所以我直接变为true啦----------------------------------
  27187. l.modelDataPromisesTiles(e.data) ? this.useHighResolutionPanos = !0 : this.useHighResolutionPanos = !1,
  27188. //this.useHighResolutionPanos = !0;
  27189. //----------------------e n d -----------------------------------------------------------------
  27190. this.updateMaximums()
  27191. }
  27192. ,
  27193. n.prototype.updateUltraHighResolutionSettings = function(e) {
  27194. o.tiling.allowUltraHighResolution && this.modelHasUltraHighPanos ? this.useUltraHighResolutionPanos = !0 : this.useUltraHighResolutionPanos = !1,
  27195. this.updateMaximums()
  27196. }
  27197. ,
  27198. n.prototype.enableUltraHighQualityMode = function() {
  27199. this.modelHasUltraHighPanos = !0,
  27200. this.updateUltraHighResolutionSettings(null)
  27201. }
  27202. ,
  27203. n.prototype.ultraHighQualityModeEnabled = function() {
  27204. return this.modelHasUltraHighPanos
  27205. }
  27206. ,
  27207. n.prototype.onModelChanged = function(e) {
  27208. this.updateFromModel(e.model),
  27209. this.updateMaximums()
  27210. }
  27211. ,
  27212. n.prototype.updateMaximums = function() {
  27213. this.maxNavPanoSize = o.tiling.maxNavPanoQuality || this.detectMaxNavPanoSize(),
  27214. this.maxZoomPanoSize = o.tiling.maxZoomPanoQuality || this.detectMaxZoomPanoSize(),
  27215. this.maxZoomPanoSize < this.maxNavPanoSize && (this.maxNavPanoSize = this.maxZoomPanoSize)
  27216. }
  27217. ,
  27218. n.prototype.buildPanoSizeClassMap = function() {
  27219. this.panoSizeClassMap[r.BASE] = 512,
  27220. this.panoSizeClassMap[r.STANDARD] = 1024,
  27221. this.panoSizeClassMap[r.HIGH] = 2048,
  27222. this.panoSizeClassMap[r.ULTRAHIGH] = 4096
  27223. }
  27224. ,
  27225. n.prototype.getPanoSize = function(e) {
  27226. return this.panoSizeClassMap[e]
  27227. }
  27228. ,
  27229. n.prototype.getMaxPossiblePanoSize = function() {
  27230. return this.getPanoSize(r.ULTRAHIGH)
  27231. }
  27232. ,
  27233. n.prototype.getMaxPanoSize = function() {
  27234. return this.maxZoomPanoSize
  27235. }
  27236. ,
  27237. n.prototype.getMaxNavPanoSize = function() {
  27238. return this.maxNavPanoSize
  27239. }
  27240. ,
  27241. n.prototype.getMaxZoomPanoSize = function() {
  27242. return this.maxZoomPanoSize
  27243. }
  27244. ,
  27245. n.prototype.detectMaxNavPanoSizeClass = function() {
  27246. if(settings.mobileNavHigh)return r.HIGH //改
  27247. else return this.useHighResolutionPanos ? a.isMobile() ? r.STANDARD : $("#player").height() < this.highQualityThreshold ? r.STANDARD : r.HIGH : r.STANDARD
  27248. }
  27249. ,
  27250. n.prototype.detectMaxNavPanoSize = function() {
  27251. var e = this.detectMaxNavPanoSizeClass();
  27252. return this.getPanoSize(e)
  27253. }
  27254. ,
  27255. n.prototype.detectMaxZoomPanoSize = function() {
  27256. 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)
  27257. }
  27258. ,
  27259. t.exports = n
  27260. }
  27261. , {
  27262. "../constants": 8,
  27263. "../enum/ModelManagerEvents": 33,
  27264. "../enum/PanoSizeClass": 36,
  27265. "../settings": 166,
  27266. "../util/browser": 182,
  27267. "../util/showcase": 193
  27268. }],
  27269. 171: [function(e, t, i) {
  27270. (function(i) {
  27271. "use strict";
  27272. function n(e) {
  27273. this.panos = null,
  27274. this.retryMinimumTime = 1e4,
  27275. this.urls = null,
  27276. this.panoLoadCallbacks = {},
  27277. this.downloadDescriptors = {},
  27278. this.priorityQueue = [],
  27279. this.forceQueue = [],
  27280. this.activeDownloads = [],
  27281. this.qualityManager = null,
  27282. this.tilePrioritizer = null,
  27283. this.refreshInterval = null,
  27284. this.processPriorityQueue = !1,
  27285. this.concurrentDownloads = e.concurrentDownloads || 1,
  27286. this.downloadTestResults = {}
  27287. }
  27288. var r = e("three")
  27289. , o = (e("../enum/Viewmode"),
  27290. e("../settings"))
  27291. , a = (e("../objects/Panorama"),
  27292. e("../util/logger"))
  27293. , s = (e("../enum/Vectors"),
  27294. e("../enum/PanoSizeClass"),
  27295. e("../enum/TileDownloaderEvents"))
  27296. , l = e("./TilePrioritizer")
  27297. , c = e("./TileUtils")
  27298. , h = (e("../enum/GLCubeFaces"),
  27299. e("../enum/DownloadStatus"))
  27300. , u = e("../util/panorama")
  27301. , d = e("../util/ajax")
  27302. , p = e("../ab")
  27303. , f = e("events").EventEmitter
  27304. , g = (new a(i),
  27305. Object.freeze({
  27306. Testing: 1,
  27307. Success: 2,
  27308. Fail: 3
  27309. }));
  27310. n.prototype = Object.create(f.prototype),
  27311. n.IDLE_REFRESH_DELAY = 500,
  27312. n.ACTIVE_REFRESH_DELAY = 16,
  27313. n.DOWNLOAD_RETRIES = 4,
  27314. n.prototype.init = function(e) {
  27315. this.qualityManager = e
  27316. }
  27317. ,
  27318. n.prototype.setUrls = function(e) {
  27319. this.urls = e
  27320. }
  27321. ,
  27322. n.prototype.setPanoData = function(e, t, i) {
  27323. this.panos = e,
  27324. this.imagePanos = t,
  27325. this.panoGroupId = i
  27326. }
  27327. ,
  27328. n.prototype.start = function() {
  27329. this.refreshUpdateInterval(0)
  27330. }
  27331. ,
  27332. n.prototype.stop = function() {
  27333. window.cancel(this.refreshInterval)
  27334. }
  27335. ,
  27336. n.prototype.refreshUpdateInterval = function(e) {
  27337. e || (e = 0),
  27338. this.refreshInterval = window.setTimeout(function() {
  27339. var e = this.update();
  27340. e ? this.refreshUpdateInterval(n.ACTIVE_REFRESH_DELAY) : this.refreshUpdateInterval(n.IDLE_REFRESH_DELAY)
  27341. }
  27342. .bind(this), e)
  27343. }
  27344. ,
  27345. n.prototype.update = function() {
  27346. var e = this.forceQueue.length > 0;
  27347. return this.processQueueForDownloading(this.forceQueue),
  27348. this.processPriorityQueue && (this.queuePrioritizedTilesForPanos(this.panos),
  27349. this.priorityQueue.length > 0 && (e = !0),
  27350. this.processQueueForDownloading(this.priorityQueue)),
  27351. e
  27352. }
  27353. ,
  27354. n.prototype.forceQueueTilesForPano = function() {
  27355. var e = []
  27356. , t = [];
  27357. return function(i, n, r, o, a, s) {
  27358. e.length = 0;
  27359. for (var u = this.getTileDownloadDescriptors(i, n), d = 0; d < u.length; d++) {
  27360. var p = u[d];
  27361. p.status !== h.None && p.status !== h.Queued || e.push(p)
  27362. }
  27363. if (r && e.length > 0) {
  27364. l.sortPanoTiles(e, i, r),
  27365. t.length = 0,
  27366. c.matchingTilesInDirection(i, n, r, o, a, t);
  27367. for (var f = 0, g = function(e) {
  27368. return e.face === m.face && e.faceTileIndex === m.faceTileIndex
  27369. }; f < e.length; ) {
  27370. var m = e[f]
  27371. , v = t.findIndex(g);
  27372. v < 0 ? e.splice(f, 1) : f++
  27373. }
  27374. }
  27375. for (var A = 0; A < e.length; A++)
  27376. this.forceQueue.push(e[A]);
  27377. this.setStatusForAllDescriptors(this.forceQueue, h.ForceQueued),
  27378. this.clearFromQueue(this.priorityQueue, h.ForceQueued, !1),
  27379. s && this.processQueueForDownloading(this.forceQueue, !0)
  27380. }
  27381. }(),
  27382. n.prototype.clearForceQueue = function() {
  27383. this.clearQueue(this.forceQueue)
  27384. }
  27385. ,
  27386. n.prototype.queuePrioritizedTilesForPanos = function(e) {
  27387. this.tilePrioritizer && (this.clearQueue(this.priorityQueue),
  27388. this.tilePrioritizer.filterAndPrioritize(this.priorityQueue, e, this),
  27389. this.clearFromQueue(this.priorityQueue, h.None, !0),
  27390. this.setStatusOrRemoveForAllDescriptors(this.priorityQueue, h.Queued))
  27391. }
  27392. ,
  27393. n.prototype.clearQueue = function(e) {
  27394. this.setStatusForAllDescriptors(e, h.None),
  27395. e.length = 0
  27396. }
  27397. ,
  27398. n.prototype.clearFromQueue = function(e, t, i) {
  27399. for (var n = 0; n < e.length; n++) {
  27400. var r = e[n];
  27401. r && (t === r.status && !i || t !== r.status && i) && (e[n] = null)
  27402. }
  27403. }
  27404. ,
  27405. n.prototype.setStatusForAllDescriptors = function(e, t) {
  27406. for (var i = 0; i < e.length; i++) {
  27407. var n = e[i];
  27408. n && (n.status = t)
  27409. }
  27410. }
  27411. ,
  27412. n.prototype.setStatusOrRemoveForAllDescriptors = function(e, t) {
  27413. for (var i = 0; i < e.length; i++) {
  27414. var n = e[i];
  27415. n && (n.status !== t ? n.status = t : e[i] = null)
  27416. }
  27417. }
  27418. ,
  27419. n.prototype.getTileDownloadDescriptors = function(e, t) {
  27420. var i = this.getAllTileDownloadDescriptorsForPano(e)
  27421. , n = i[t];
  27422. return n || (n = this.buildDownloadDescriptorArray(t),
  27423. i[t] = n,
  27424. this.initTileDownloadDescriptors(n, e, t)),
  27425. n
  27426. }
  27427. ,
  27428. n.prototype.getAllTileDownloadDescriptorsForPano = function(e) {
  27429. var t = this.downloadDescriptors[e.id];
  27430. return t || (t = {},
  27431. this.downloadDescriptors[e.id] = t),
  27432. t
  27433. }
  27434. ,
  27435. n.prototype.processQueueForDownloading = function(e, t) {
  27436. if (this.cleanupActiveDownloads(),
  27437. this.activeDownloads.length < this.concurrentDownloads || t)
  27438. for (var i = t ? e.length : this.concurrentDownloads - this.activeDownloads.length, n = 0, r = 0; n < i && e.length > 0; r++) {
  27439. var o = e.shift();
  27440. o && (this.startDownload(o),
  27441. n++)
  27442. }
  27443. }
  27444. ,
  27445. n.prototype.testDownload = function(e, t, i) {
  27446. var n = this.downloadTestResults[e];
  27447. if (n)
  27448. return void (n === g.Success ? i(!0) : n === g.Fail && i(!1));
  27449. this.downloadTestResults[e] = g.Testing;
  27450. var r = this.panos.list[0]
  27451. , o = this.getTileUrl(r.id, e, t, 0)
  27452. , a = function(t) {
  27453. this.downloadTestResults[e] = g.Success,
  27454. i(!0)
  27455. }
  27456. .bind(this)
  27457. , s = function() {
  27458. this.downloadTestResults[e] = g.Fail,
  27459. i(!1)
  27460. }
  27461. .bind(this);
  27462. this.loadImage(o, 0, a, s)
  27463. }
  27464. ,
  27465. n.prototype.startDownload = function(e) {
  27466. e.status = h.Downloading;
  27467. var t = this.getTileUrl(e.pano.id, e.panoSize, e.tileSize, e.tileIndex);
  27468. this.activeDownloads.push(e),
  27469. this.loadImage(t, n.DOWNLOAD_RETRIES, this.downloadComplete.bind(this, e), this.downloadFailed.bind(this, e))
  27470. }
  27471. ,
  27472. n.prototype.downloadFailed = function(e, t) {}
  27473. ,
  27474. n.prototype.downloadComplete = function(e, t) {
  27475. if (e.panoGroupId === this.panoGroupId) {
  27476. var i = this.getPanoLoadCallbacks(e.pano, e.panoSize);
  27477. e.status = h.Downloaded,
  27478. i && i.onProgress && i.onProgress(e.pano, e.panoSize);
  27479. var n = {
  27480. panoId: e.pano.id,
  27481. image: t,
  27482. tileSize: e.tileSize,
  27483. panoSize: e.panoSize,
  27484. tileIndex: e.tileIndex,
  27485. faceTileIndex: e.faceTileIndex,
  27486. totalTiles: e.totalTiles,
  27487. face: e.face,
  27488. tileX: e.tileX,
  27489. tileY: e.tileY,
  27490. direction: e.direction
  27491. };
  27492. e.image = t,
  27493. this.emit(s.TileDownloadSuccess, n),
  27494. this.isPanoDownloaded(e.pano, e.panoSize) && (n = {
  27495. panoId: e.pano.id,
  27496. tileSize: e.tileSize,
  27497. panoSize: e.panoSize
  27498. },
  27499. this.emit(s.PanoDownloadComplete, n),
  27500. i && i.onLoad && i.onLoad(e.pano, e.panoSize))
  27501. }
  27502. }
  27503. ,
  27504. n.prototype.cleanupActiveDownloads = function() {
  27505. var e = [];
  27506. return function() {
  27507. e.length = 0;
  27508. for (var t = 0; t < this.activeDownloads.length; t++) {
  27509. var i = this.activeDownloads[t];
  27510. i.status !== h.Downloaded && i.status !== h.Failed && e.push(i)
  27511. }
  27512. this.activeDownloads.length = 0,
  27513. this.activeDownloads.push.apply(this.activeDownloads, e)
  27514. }
  27515. }(),
  27516. n.prototype.isPanoDownloaded = function(e, t) {
  27517. var i = this.getTileDownloadDescriptors(e, t);
  27518. if (i.length <= 0)
  27519. return !1;
  27520. for (var n = 0; n < i.length; n++) {
  27521. var r = i[n];
  27522. if (r.status !== h.Downloaded)
  27523. return !1
  27524. }
  27525. return !0
  27526. }
  27527. ,
  27528. n.prototype.setPanoLoadCallbacks = function(e, t, i, n, r) {
  27529. var o = e.id + ":" + this.qualityManager.getPanoSize(t);
  27530. this.panoLoadCallbacks[o] = {
  27531. onLoad: i,
  27532. onFail: n,
  27533. onProgress: r
  27534. }
  27535. }
  27536. ,
  27537. n.prototype.getPanoLoadCallbacks = function(e, t) {
  27538. var i = e.id + ":" + t;
  27539. return this.panoLoadCallbacks[i]
  27540. }
  27541. ,
  27542. n.prototype.buildDownloadDescriptorArray = function(e) {
  27543. for (var t = c.getTileCountForSize(e), i = [], n = 0; n < t; n++) {
  27544. var r = this.buildDownloadDescriptor();
  27545. i.push(r)
  27546. }
  27547. return i
  27548. }
  27549. ,
  27550. n.prototype.buildDownloadDescriptor = function() {
  27551. var e = {
  27552. panoGroupId: null,
  27553. pano: null,
  27554. panoSize: -1,
  27555. tileSize: -1,
  27556. tileIndex: -1,
  27557. totalTiles: -1,
  27558. faceTileIndex: -1,
  27559. status: h.None,
  27560. url: null,
  27561. image: null,
  27562. direction: new r.Vector3,
  27563. face: -1,
  27564. cubeFace: -1,
  27565. tileX: -1,
  27566. tileY: -1
  27567. };
  27568. return e
  27569. }
  27570. ,
  27571. n.prototype.initTileDownloadDescriptors = function(e, t, i) {
  27572. for (var n = 0; n < e.length; n++) {
  27573. var r = e[n];
  27574. this.initTileDownloadDescriptor(r, t, i, n)
  27575. }
  27576. }
  27577. ,
  27578. n.prototype.initTileDownloadDescriptor = function(e, t, i, n) {
  27579. var r = i >= c.TILE_SIZE ? c.TILE_SIZE : i;
  27580. e.face = c.getFaceForTile(i, n),
  27581. e.cubeFace = u.mapFaceToCubemapFace(e.face),
  27582. e.panoGroupId = this.panoGroupId,
  27583. e.pano = t,
  27584. e.panoSize = i,
  27585. e.tileSize = r,
  27586. e.tileIndex = n,
  27587. e.totalTiles = c.getTileCountForSize(i),
  27588. e.status = h.None,
  27589. e.image = null,
  27590. c.getTileLocation(e.panoSize, e.tileIndex, e),
  27591. c.getTileVector(e.panoSize, e.tileSize, e.cubeFace, e.tileX, e.tileY, c.LocationOnTile.Center, 0, e.direction)
  27592. }
  27593. ,
  27594. n.prototype.getTileUrl = function() {
  27595. var e = {
  27596. 256: "256",
  27597. 512: "512",
  27598. 1024: "1k",
  27599. 2048: "2k",
  27600. 4096: "4k"
  27601. }
  27602. , t = {
  27603. face: -1,
  27604. faceTileIndex: -1,
  27605. tileX: -1,
  27606. tileY: -1
  27607. };
  27608. return function(i, n, r, a) {
  27609. c.getTileLocation(n, a, t);
  27610. var s = Math.floor(n / r)
  27611. , l = s * s
  27612. , h = Math.floor(a / l)
  27613. , u = "";
  27614. 1 === o.tiling.customCompression && (u = "_" + o.tiling["q" + e[n]]);
  27615. var d = this.urls.get("tiles/" + i + "/" + e[n] + u + "_face" + h + "_" + t.tileX + "_" + t.tileY + ".jpg");
  27616. return d = p.changeIfTileGenerating(d)
  27617. }
  27618. }(),
  27619. n.prototype.loadImage = function(e, t, i, n) {
  27620. d.getImage(e, t).then(function(e) {
  27621. i(e)
  27622. }).fail(n)
  27623. }
  27624. ,
  27625. t.exports = n
  27626. }
  27627. ).call(this, "/js/tile/TileDownloader.js")
  27628. }
  27629. , {
  27630. "../ab": 3,
  27631. "../enum/DownloadStatus": 24,
  27632. "../enum/GLCubeFaces": 25,
  27633. "../enum/PanoSizeClass": 36,
  27634. "../enum/TileDownloaderEvents": 45,
  27635. "../enum/Vectors": 50,
  27636. "../enum/Viewmode": 51,
  27637. "../objects/Panorama": 148,
  27638. "../settings": 166,
  27639. "../util/ajax": 181,
  27640. "../util/logger": 189,
  27641. "../util/panorama": 191,
  27642. "./TilePrioritizer": 172,
  27643. "./TileUtils": 174,
  27644. events: 202,
  27645. three: 217
  27646. }],
  27647. 172: [function(e, t, i) {
  27648. (function(i) {
  27649. "use strict";
  27650. function n(e, t, i, o, a) {
  27651. this.qualityManager = e,
  27652. this.maxNavQuality = this.qualityManager.getMaxNavPanoSize(),
  27653. this.maxZoomQuality = this.qualityManager.getMaxZoomPanoSize(),
  27654. this.baseSize = t,
  27655. this.standardSize = i,
  27656. this.highSize = o,
  27657. this.ultraHighSize = a,
  27658. this.priorityCriteria = new n.PriorityCriteria(null,new r.Vector3(0,0,0),new r.Vector3(0,0,-1),new r.Vector3(0,0,-1))
  27659. }
  27660. var r = e("three")
  27661. , o = (e("../enum/Viewmode"),
  27662. e("../settings"),
  27663. e("../settings"),
  27664. e("../objects/Panorama"))
  27665. , a = e("../util/logger")
  27666. , s = (e("../enum/Vectors"),
  27667. e("../enum/PanoSizeClass"),
  27668. e("../enum/ModelManagerEvents"),
  27669. e("../enum/GLCubeFaces"),
  27670. e("../enum/DownloadStatus"))
  27671. , l = (e("../util/browser"),
  27672. e("./TileUtils"))
  27673. , c = e("../util/math")
  27674. , h = (e("events").EventEmitter,
  27675. new a(i),
  27676. Object.freeze({
  27677. None: 0,
  27678. DirectionalFOV: 1
  27679. }));
  27680. n.PriorityCriteria = function(e, t, i, n, o) {
  27681. this.pano = e,
  27682. this.cameraPosition = (new r.Vector3).copy(t),
  27683. this.cameraDir = (new r.Vector3).copy(i),
  27684. this.panoSpaceDir = (new r.Vector3).copy(n),
  27685. this.upcomingPanos = o,
  27686. this.copy = function(e) {
  27687. this.pano = e.pano,
  27688. this.cameraPosition.copy(e.cameraPosition),
  27689. this.cameraDir.copy(e.cameraDir),
  27690. this.panoSpaceDir.copy(e.panoSpaceDir),
  27691. this.upcomingPanos = o
  27692. }
  27693. ,
  27694. this.zoomingActive = !1
  27695. }
  27696. ,
  27697. n.DIRECTIONAL_FOV = 180,
  27698. n.DIRECTIONAL_FOV_NARROW = 120,
  27699. n.MAX_SCORED_PANOS_TOCONSIDER = 6,
  27700. n.MAX_SCORED_PANOS_TOADD = 2,
  27701. n.MAX_UPCOMING_PANOS_TOADD = 3,
  27702. n.DIRECTION_SCORE_STRICTNESS = .75,
  27703. n.appendQueue = function(e, t) {
  27704. if (e && t)
  27705. for (var i = 0; i < t.length; i++)
  27706. e.push(t[i])
  27707. }
  27708. ,
  27709. n.prototype.updateCriteria = function(e, t, i, n) {
  27710. this.priorityCriteria.pano = e,
  27711. this.priorityCriteria.cameraPosition.copy(t),
  27712. this.priorityCriteria.cameraDir.copy(i),
  27713. this.priorityCriteria.upcomingPanos = n,
  27714. this.maxNavQuality = this.qualityManager.getMaxNavPanoSize(),
  27715. this.maxZoomQuality = this.qualityManager.getMaxZoomPanoSize()
  27716. }
  27717. ,
  27718. n.prototype.filterAndPrioritize = function() {
  27719. var e = []
  27720. , t = []
  27721. , i = [];
  27722. return function(r, o, a) {
  27723. this.populateNeighborPanos(this.priorityCriteria.pano, o, e),
  27724. this.populateScoredPanos(this.priorityCriteria.pano, o, t, this.priorityCriteria.cameraDir, n.MAX_SCORED_PANOS_TOCONSIDER);
  27725. var s = this.baseSize
  27726. , l = this.standardSize
  27727. , c = this.highSize
  27728. , h = this.ultraHighSize;
  27729. this.queueTilesForPano(r, a, this.priorityCriteria.pano, s),
  27730. this.priorityCriteria.upcomingPanos && this.queueTilesForPanos(r, this.priorityCriteria.upcomingPanos, a, s, n.MAX_UPCOMING_PANOS_TOADD),
  27731. i.length = 0,
  27732. this.canDownloadSize(l) && this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, l, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV_NARROW),
  27733. n.sortPanoTiles(i, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  27734. n.appendQueue(r, i),
  27735. this.queueTilesForPanos(r, t, a, s, n.MAX_SCORED_PANOS_TOADD),
  27736. i.length = 0,
  27737. this.canDownloadSize(c) && this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, c, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV_NARROW),
  27738. this.canDownloadSize(h) && this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, h, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV_NARROW),
  27739. n.sortPanoTiles(i, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  27740. n.appendQueue(r, i),
  27741. i.length = 0,
  27742. this.canDownloadSize(l) && this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, l, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV),
  27743. this.canDownloadSize(c) && this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, c, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV),
  27744. this.canDownloadSize(h) && this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, h, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV),
  27745. n.sortPanoTiles(i, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  27746. n.appendQueue(r, i),
  27747. this.queueTilesForPanos(r, e, a, s)
  27748. }
  27749. }(),
  27750. n.prototype.canDownloadSize = function(e) {
  27751. return this.maxNavQuality >= e || this.maxZoomQuality >= e && this.zoomingActive
  27752. }
  27753. ,
  27754. n.prototype.populateNeighborPanos = function(e, t, i) {
  27755. i = i || [],
  27756. i.length = 0;
  27757. var n = t.getNeighbours(e);
  27758. for (var r in n)
  27759. if (n.hasOwnProperty(r)) {
  27760. var o = t.get(r);
  27761. i.push(o)
  27762. }
  27763. return i
  27764. }
  27765. ,
  27766. n.prototype.populateScoredPanos = function(e, t, i, r, a) {
  27767. i = i || [],
  27768. i.length = 0;
  27769. var s = [o.filters.inPanoDirection(e.position, r, n.DIRECTION_SCORE_STRICTNESS), o.filters.not(e)]
  27770. , l = [o.scoreFunctions.distanceSquared(e), o.scoreFunctions.direction(e.position, r)]
  27771. , c = t.sortByScore(s, l);
  27772. if (c)
  27773. for (var h = 0; h < c.length && h < a; h++) {
  27774. var u = c[h].pano;
  27775. i.push(u)
  27776. }
  27777. return i
  27778. }
  27779. ,
  27780. n.prototype.queueTilesForPanos = function(e, t, i, n, r) {
  27781. for (var o = 0, a = 0; a < t.length; a++) {
  27782. var s = t[a]
  27783. , l = this.queueTilesForPano(e, i, s, n);
  27784. if (o += l > 0 ? 1 : 0,
  27785. r && o >= r)
  27786. break
  27787. }
  27788. return o
  27789. }
  27790. ,
  27791. n.prototype.queueTilesForPano = function() {
  27792. var e = {
  27793. filter: h.None
  27794. };
  27795. return function(t, i, n, r) {
  27796. return this.filterAndQueueTileDownloadDescriptors(t, i, n, r, e)
  27797. }
  27798. }(),
  27799. n.prototype.queueTilesForPanosInDirection = function() {
  27800. var e = new r.Vector3;
  27801. return function(t, i, n, r, o, a, s, l) {
  27802. for (var h = 0, u = 0; u < n.length; u++) {
  27803. var d = n[u];
  27804. e.copy(d.position),
  27805. e.sub(o),
  27806. e.normalize();
  27807. var p = Math.max(Math.min(a.dot(e), 1), -1)
  27808. , f = c.getFOVDotThreshold(s);
  27809. if (p >= f) {
  27810. var g = this.queueTilesInDirectionForPano(t, i, d, r, o, a, s);
  27811. if (h += g > 0 ? 1 : 0,
  27812. l && h >= l)
  27813. break
  27814. }
  27815. }
  27816. return h
  27817. }
  27818. }(),
  27819. n.prototype.queueTilesInDirectionForPanos = function(e, t, i, n, r, o, a, s) {
  27820. for (var l = 0, c = 0; c < i.length; c++) {
  27821. var h = i[c]
  27822. , u = this.queueTilesInDirectionForPano(e, t, h, n, o, a);
  27823. if (l += u > 0 ? 1 : 0,
  27824. s && l >= s)
  27825. break
  27826. }
  27827. return l
  27828. }
  27829. ,
  27830. n.prototype.queueTilesInDirectionForPano = function() {
  27831. var e = {
  27832. filter: h.DirectionalFOV,
  27833. direction: new r.Vector3,
  27834. fov: 60
  27835. }
  27836. , t = new r.Vector3;
  27837. return function(i, n, r, o, a, s, c) {
  27838. return t.copy(s),
  27839. l.getRelativeDirection(r.quaternion, t),
  27840. e.direction.copy(t),
  27841. e.fov = c,
  27842. this.filterAndQueueTileDownloadDescriptors(i, n, r, o, e)
  27843. }
  27844. }(),
  27845. n.prototype.filterAndQueueTileDownloadDescriptors = function() {
  27846. var e = [];
  27847. return function(t, i, n, r, o) {
  27848. var a = i.getTileDownloadDescriptors(n, r);
  27849. e.length = 0,
  27850. this.filterTileDownloadDescriptors(n, a, e, o);
  27851. for (var s = 0, l = 0; l < e.length; l++) {
  27852. var c = e[l];
  27853. c && (t.push(c),
  27854. s++)
  27855. }
  27856. return s
  27857. }
  27858. }(),
  27859. n.prototype.filterTileDownloadDescriptors = function() {
  27860. new r.Vector3;
  27861. return function(e, t, i, n) {
  27862. var r, o;
  27863. switch (n.filter) {
  27864. case h.DirectionalFOV:
  27865. for (r = 0; r < t.length; r++)
  27866. o = t[r],
  27867. l.isTileWithinFOV(o.panoSize, o.tileSize, o.face, o.tileX, o.tileY, n.direction, n.fov) && i.push(o);
  27868. break;
  27869. default:
  27870. for (r = 0; r < t.length; r++)
  27871. o = t[r],
  27872. i.push(o)
  27873. }
  27874. for (r = 0; r < i.length; r++)
  27875. o = i[r],
  27876. this.canIncludeDescriptor(o) || (i[r] = null)
  27877. }
  27878. }(),
  27879. n.prototype.canIncludeDescriptor = function(e) {
  27880. return e.status !== s.Downloading && e.status !== s.Downloaded
  27881. }
  27882. ,
  27883. n.prototype.canIncludePano = function(e, t) {
  27884. return !e.isLoaded(t)
  27885. }
  27886. ,
  27887. n.getFOVDotThreshold = function(e) {
  27888. return Math.cos(r.Math.degToRad(e / 2))
  27889. }
  27890. ;
  27891. var u = function() {
  27892. var e = function e(t, i) {
  27893. var n = e._panoSpaceDir
  27894. , r = e._fovThreshold
  27895. , o = e._fovThresholdNarrow
  27896. , a = Math.max(Math.min(n.dot(t.direction), 1), -1)
  27897. , s = Math.max(Math.min(n.dot(i.direction), 1), -1);
  27898. return t._dot = a,
  27899. i._dot = s,
  27900. 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)
  27901. };
  27902. return e._panoSpaceDir = new r.Vector3,
  27903. e._fovThreshold = -1,
  27904. e._fovThresholdNarrow = -1,
  27905. e
  27906. }();
  27907. n.sortPanoTiles = function(e, t, i) {
  27908. u._panoSpaceDir.copy(i),
  27909. l.getRelativeDirection(t.quaternion, u._panoSpaceDir),
  27910. u._fovThresholdNarrow = c.getFOVDotThreshold(n.DIRECTIONAL_FOV_NARROW),
  27911. u._fovThreshold = c.getFOVDotThreshold(n.DIRECTIONAL_FOV),
  27912. e.sort(u)
  27913. }
  27914. ,
  27915. n.insertSortedPanoTile = function(e, t, i, r) {
  27916. u._panoSpaceDir.copy(r),
  27917. l.getRelativeDirection(i.quaternion, u._panoSpaceDir),
  27918. u._fovThresholdNarrow = c.getFOVDotThreshold(n.DIRECTIONAL_FOV_NARROW),
  27919. u._fovThreshold = c.getFOVDotThreshold(n.DIRECTIONAL_FOV);
  27920. for (var o = -1, a = 0; a < e.length; a++) {
  27921. var s = u(t, e[a]);
  27922. if (s <= 0) {
  27923. o = a;
  27924. break
  27925. }
  27926. }
  27927. if (o === -1)
  27928. e[e.length] = t;
  27929. else {
  27930. for (var h = e.length; h > o; h--)
  27931. e[h] = e[h - 1];
  27932. e[o] = t
  27933. }
  27934. }
  27935. ,
  27936. n.prototype.setZoomingActive = function(e) {
  27937. e !== this.zoomingActive && (this.zoomingActive = e)
  27938. }
  27939. ,
  27940. t.exports = n
  27941. }
  27942. ).call(this, "/js/tile/TilePrioritizer.js")
  27943. }
  27944. , {
  27945. "../enum/DownloadStatus": 24,
  27946. "../enum/GLCubeFaces": 25,
  27947. "../enum/ModelManagerEvents": 33,
  27948. "../enum/PanoSizeClass": 36,
  27949. "../enum/Vectors": 50,
  27950. "../enum/Viewmode": 51,
  27951. "../objects/Panorama": 148,
  27952. "../settings": 166,
  27953. "../util/browser": 182,
  27954. "../util/logger": 189,
  27955. "../util/math": 190,
  27956. "./TileUtils": 174,
  27957. events: 202,
  27958. three: 217
  27959. }],
  27960. 173: [function(e, t, i) {
  27961. "use strict";
  27962. function n(e, t) {
  27963. this.levels = t,
  27964. this.tileSize = e,
  27965. this.root = null,
  27966. this.allNodes = [],
  27967. a(this)
  27968. }
  27969. function r(e, t) {
  27970. this.tree = e,
  27971. this.parent = t,
  27972. this.children = [],
  27973. this.id = ++u
  27974. }
  27975. function o(e, t, i, r, a, s, l, h) {
  27976. if (e) {
  27977. l = l || n.TraversalType.PreOrder;
  27978. var u = r * c + i;
  27979. if (l === n.TraversalType.PreOrder && (a && a(e, t, u, i, r),
  27980. s && s.push(e)),
  27981. e.children && 0 !== e.children.length) {
  27982. for (var d = r * c, p = i * c, f = 0; f < c; f++)
  27983. for (var g = 0; g < c; g++)
  27984. o(e.children[g * c + f], t + 1, p + f, d + g, a, s, l, h);
  27985. l === n.TraversalType.PostOrder && (a && a(e, t, u, i, r),
  27986. s && s.push(e))
  27987. }
  27988. }
  27989. }
  27990. function a(e) {
  27991. e.root = s(e, null, 0)
  27992. }
  27993. function s(e, t, i) {
  27994. if (i > e.levels)
  27995. return null;
  27996. var n = new r(e,t);
  27997. e.allNodes.push(n);
  27998. for (var o = 0; o < h; o++)
  27999. n.children[o] = s(e, n, i + 1);
  28000. return n
  28001. }
  28002. function l(e, t, i, n, r) {
  28003. if (!e)
  28004. return null;
  28005. if (0 === i)
  28006. return e;
  28007. if (!e.children || 0 === e.children.length)
  28008. return null;
  28009. var o = Math.pow(c, i)
  28010. , a = o / c
  28011. , s = n % a
  28012. , h = r % a
  28013. , u = Math.floor(r / a)
  28014. , d = Math.floor(n / a)
  28015. , p = u * c + d
  28016. , f = e.children[p];
  28017. return l(f, t + 1, i - 1, s, h)
  28018. }
  28019. var c = (e("three"),
  28020. e("./TileUtils"),
  28021. e("../objects/Panorama"),
  28022. e("../util/panorama"),
  28023. e("events").EventEmitter,
  28024. 2)
  28025. , h = c * c;
  28026. n.TraversalType = Object.freeze({
  28027. PreOrder: 0,
  28028. PostOrder: 1
  28029. });
  28030. var u = 0;
  28031. n.getLevelCountForSize = function(e, t) {
  28032. var i = 0;
  28033. for (t < e && (t = e); ; ) {
  28034. if (t /= c,
  28035. t < e)
  28036. break;
  28037. i++
  28038. }
  28039. return i
  28040. }
  28041. ,
  28042. n.getSizeForLevel = function(e, t) {
  28043. return Math.pow(c, t) * e
  28044. }
  28045. ,
  28046. n.prototype.getSubNode = function(e, t, i) {
  28047. (!t || e < this.tileSize) && (t = 0),
  28048. (!i || e < this.tileSize) && (i = 0),
  28049. e < this.tileSize && (e = this.tileSize);
  28050. var r = n.getLevelCountForSize(this.tileSize, e)
  28051. , o = l(this.root, 0, r, t, i);
  28052. return o
  28053. }
  28054. ,
  28055. n.prototype.breadthFirst = function(e) {
  28056. e = e || {};
  28057. var t = !!e.nullLevelEnd
  28058. , i = e.maxLevel
  28059. , n = e.minLevel
  28060. , r = e.callback
  28061. , o = e.saveVisited
  28062. , a = []
  28063. , s = {}
  28064. , l = 0
  28065. , c = 0;
  28066. for (a.push(this.root),
  28067. a.push(s); a.length > 0 && !(i && l > i); ) {
  28068. var h = a.shift();
  28069. if (h === s)
  28070. (!n || l >= n) && (r && t && r(null),
  28071. o && t && o.push(null)),
  28072. a.length > 0 && a.push(s),
  28073. l++,
  28074. c = 0;
  28075. else {
  28076. if (h.children)
  28077. for (var u = 0; u < h.children.length; u++) {
  28078. var d = h.children[u];
  28079. d && a.push(h.children[u])
  28080. }
  28081. var p = this.getFaceIndexFromNode(h);
  28082. (!n || l >= n) && (r && r(h, l, p),
  28083. o && o.push(h)),
  28084. c++
  28085. }
  28086. }
  28087. }
  28088. ,
  28089. n.prototype.getFaceIndexFromNode = function(e) {
  28090. if (!e)
  28091. return -1;
  28092. for (var t = 1, i = e, n = 0, r = 0; ; ) {
  28093. var o = i.parent;
  28094. if (!o)
  28095. break;
  28096. for (var a = -1, s = 0; s < o.children.length; s++)
  28097. o.children[s] === i && (a = s);
  28098. var l = a % c
  28099. , h = Math.floor(a / c);
  28100. n = l * t + n,
  28101. r = h * t + r,
  28102. t *= c,
  28103. i = o
  28104. }
  28105. return r * t + n
  28106. }
  28107. ,
  28108. n.prototype.depthFirst = function(e, t, i) {
  28109. o(this.root, 0, 0, 0, e, t, i, this.tileSize)
  28110. }
  28111. ,
  28112. t.exports = n
  28113. }
  28114. , {
  28115. "../objects/Panorama": 148,
  28116. "../util/panorama": 191,
  28117. "./TileUtils": 174,
  28118. events: 202,
  28119. three: 217
  28120. }],
  28121. 174: [function(e, t, i) {
  28122. "use strict";
  28123. var n = e("../enum/GLCubeFaces")
  28124. , r = e("../util/MathLight")
  28125. , o = {};
  28126. o.TILE_SIZE = 512,
  28127. o.FACES_PER_PANO = 6,
  28128. o.LocationOnTile = {
  28129. Center: 0,
  28130. UpperLeft: 1,
  28131. UpperRight: 2,
  28132. LowerRight: 3,
  28133. LowerLeft: 4
  28134. },
  28135. o.getTileVector = function() {
  28136. return function(e, t, i, a, s, l, c, h) {
  28137. l = l || o.LocationOnTile.Center;
  28138. var u = e / t
  28139. , d = a / u;
  28140. s = -s + (u - 1);
  28141. var p = s / u
  28142. , f = t / e
  28143. , g = 2 * f
  28144. , m = g / 2
  28145. , v = 2 * d - 1 + m
  28146. , A = 2 * p - 1 + m;
  28147. switch (l) {
  28148. case o.LocationOnTile.UpperLeft:
  28149. v -= m,
  28150. A += m,
  28151. v += c * g;
  28152. break;
  28153. case o.LocationOnTile.UpperRight:
  28154. v += m,
  28155. A += m,
  28156. A -= c * g;
  28157. break;
  28158. case o.LocationOnTile.LowerRight:
  28159. v += m,
  28160. A -= m,
  28161. v -= c * g;
  28162. break;
  28163. case o.LocationOnTile.LowerLeft:
  28164. v -= m,
  28165. A -= m,
  28166. A += c * g;
  28167. break;
  28168. case o.LocationOnTile.Center:
  28169. }
  28170. switch (i) {
  28171. case n.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  28172. r.setVector(h, -1, A, -v);
  28173. break;
  28174. case n.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  28175. r.setVector(h, 1, A, v);
  28176. break;
  28177. case n.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  28178. r.setVector(h, -v, 1, -A);
  28179. break;
  28180. case n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  28181. r.setVector(h, -v, -1, A);
  28182. break;
  28183. case n.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  28184. r.setVector(h, -v, A, 1);
  28185. break;
  28186. case n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  28187. r.setVector(h, v, A, -1)
  28188. }
  28189. r.normalize(h)
  28190. }
  28191. }(),
  28192. o.getFaceForTile = function(e, t) {
  28193. var i = o.TILE_SIZE;
  28194. e < o.TILE_SIZE && (i = e);
  28195. var n = Math.floor(e / i)
  28196. , r = n * n;
  28197. return Math.floor(t / r)
  28198. }
  28199. ,
  28200. o.getTileLocation = function(e, t, i) {
  28201. var n = o.TILE_SIZE;
  28202. e < o.TILE_SIZE && (n = e);
  28203. var r = o.getFaceForTile(e, t)
  28204. , a = Math.floor(e / n)
  28205. , s = a * a
  28206. , l = t - r * s;
  28207. i.tileX = l % a,
  28208. i.tileY = Math.floor(l / a),
  28209. i.face = r,
  28210. i.faceTileIndex = l
  28211. }
  28212. ,
  28213. o.getTileCountForSize = function(e) {
  28214. if (e <= o.TILE_SIZE)
  28215. return o.FACES_PER_PANO;
  28216. var t = Math.floor(e / o.TILE_SIZE)
  28217. , i = t * t
  28218. , n = i * o.FACES_PER_PANO;
  28219. return n
  28220. }
  28221. ,
  28222. o.getRelativeDirection = function() {
  28223. var e = new r.Matrix4
  28224. , t = new r.Quaternion;
  28225. return function(i, n) {
  28226. t.copy(i),
  28227. t.inverse(),
  28228. e.makeRotationFromQuaternion(t),
  28229. e.applyToVector3(n),
  28230. r.normalize(n)
  28231. }
  28232. }(),
  28233. o.matchingTilesInDirection = function() {
  28234. var e = new r.Vector3
  28235. , t = new r.Vector3(0,0,-1)
  28236. , i = new r.Quaternion
  28237. , n = function(e, t) {
  28238. e.push({
  28239. face: t.face,
  28240. faceTileIndex: t.faceTileIndex,
  28241. tileX: t.tileX,
  28242. tileY: t.tileY
  28243. })
  28244. }
  28245. , a = function() {
  28246. var e = {
  28247. face: -1,
  28248. faceTileIndex: -1,
  28249. tileX: -1,
  28250. tileY: -1
  28251. };
  28252. return function(t, i, r) {
  28253. for (var a = o.getTileCountForSize(t), s = 0, l = 0; l < a; l++)
  28254. o.getTileLocation(t, l, e),
  28255. i && !i(e) || (s++,
  28256. r && n(r, e));
  28257. return s
  28258. }
  28259. }();
  28260. return function(n, s, l, c, h, u) {
  28261. var d = s < o.TILE_SIZE ? s : o.TILE_SIZE;
  28262. o.getTileCountForSize(s);
  28263. if (!c && !h)
  28264. return a(s, null, u);
  28265. var p = !!h;
  28266. if (h = h || c,
  28267. h = Math.max(0, Math.min(h, 360)),
  28268. c = Math.max(0, Math.min(c, 360)),
  28269. r.copyVector(l, e),
  28270. o.getRelativeDirection(n.quaternion, e),
  28271. p) {
  28272. i.setFromUnitVectors(e, t);
  28273. var f = function(e) {
  28274. return o.isTileWithinFrustum(s, d, e.face, e.tileX, e.tileY, i, c, h)
  28275. };
  28276. return a(s, f, u)
  28277. }
  28278. var g = function(t) {
  28279. return o.isTileWithinFOV(s, d, t.face, t.tileX, t.tileY, e, c)
  28280. };
  28281. return a(s, g, u)
  28282. }
  28283. }(),
  28284. o.isTileWithinFrustum = function() {
  28285. var e = new r.Vector3
  28286. , t = 1e-5;
  28287. return function(i, n, a, s, l, c, h, u) {
  28288. 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++)
  28289. if (o.getTileVector(i, n, m, s, l, b, 0, e),
  28290. r.applyQuaternionToVector(c, e),
  28291. e.z >= -t)
  28292. I++;
  28293. else {
  28294. var w = -1 / e.z
  28295. , _ = e.x * w
  28296. , T = e.y * w;
  28297. T > d ? v++ : T < p && A++,
  28298. _ > f ? y++ : _ < g && C++,
  28299. E++
  28300. }
  28301. return A !== E && v !== E && y !== E && C !== E
  28302. }
  28303. }(),
  28304. o.isTileWithinFOV = function() {
  28305. var e = new r.Vector3
  28306. , t = new r.Vector3(0,1,0)
  28307. , i = new r.Vector3(1,0,0);
  28308. return function(n, a, s, l, c, h, u) {
  28309. var d = o.mapFaceToCubemapFace(s);
  28310. if (r.cross(h, t, i),
  28311. o.getTileVector(n, a, d, l, c, o.LocationOnTile.Center, 0, e),
  28312. o.isWithinFOV(e, h, u, null))
  28313. return !0;
  28314. for (var p = u / 360, f = Math.floor(1 / p), g = 0, m = 0; m < f; m++) {
  28315. for (var v = o.LocationOnTile.UpperLeft; v <= o.LocationOnTile.LowerLeft; v++)
  28316. if (o.getTileVector(n, a, d, l, c, v, g, e),
  28317. o.isWithinFOV(e, h, u, null))
  28318. return !0;
  28319. g += p
  28320. }
  28321. return !1
  28322. }
  28323. }(),
  28324. o.isWithinFOV = function() {
  28325. var e = new r.Vector3
  28326. , t = new r.Vector3;
  28327. return function(i, n, o, a) {
  28328. if (r.copyVector(i, t),
  28329. a) {
  28330. r.copyVector(a, e),
  28331. r.normalize(e);
  28332. var s = r.dot(e, i);
  28333. e.x *= s,
  28334. e.y *= s,
  28335. e.z *= s,
  28336. r.subVector(t, e)
  28337. }
  28338. var l = o / 2 * r.RADIANS_PER_DEGREE
  28339. , c = Math.cos(l)
  28340. , h = r.dot(t, n);
  28341. return h >= c
  28342. }
  28343. }(),
  28344. o.mapFaceToCubemapFace = function() {
  28345. var e = {
  28346. 0: n.GL_TEXTURE_CUBE_MAP_POSITIVE_Y,
  28347. 1: n.GL_TEXTURE_CUBE_MAP_POSITIVE_Z,
  28348. 2: n.GL_TEXTURE_CUBE_MAP_POSITIVE_X,
  28349. 3: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,
  28350. 4: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
  28351. 5: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
  28352. };
  28353. return function(t) {
  28354. return e[t]
  28355. }
  28356. }(),
  28357. t.exports = o
  28358. }
  28359. , {
  28360. "../enum/GLCubeFaces": 25,
  28361. "../util/MathLight": 176
  28362. }],
  28363. 175: [function(e, t, i) {
  28364. (function(i) {
  28365. "use strict";
  28366. function n() {
  28367. this.list = [],
  28368. this.index = {},
  28369. Object.defineProperty(this, "length", {
  28370. get: function() {
  28371. return this.list.length
  28372. }
  28373. })
  28374. }
  28375. var r = (e("./common"),
  28376. e("./logger"));
  28377. new r(i);
  28378. n.prototype.forEach = function(e) {
  28379. this.list.forEach(e)
  28380. }
  28381. ,
  28382. n.prototype.add = function(e) {
  28383. this.list.push(e),
  28384. this.index[this.getIndex(e)] = e
  28385. }
  28386. ,
  28387. n.prototype.getIndex = function(e) {
  28388. throw new Error("IndexedCollection.getIndex not implemented in subclass.")
  28389. }
  28390. ,
  28391. n.prototype.extend = function(e) {
  28392. for (var t = 0; t < e.length; t++)
  28393. this.add(e[t])
  28394. }
  28395. ,
  28396. n.prototype.get = function(e) {
  28397. return this.index[e]
  28398. }
  28399. ,
  28400. n.prototype.first = function() {
  28401. return this.list[0]
  28402. }
  28403. ,
  28404. n.prototype.last = function() {
  28405. return this.list[this.list.length - 1]
  28406. }
  28407. ,
  28408. n.prototype.reIndex = function() {
  28409. this.index = {};
  28410. var e = this;
  28411. this.forEach(function(t) {
  28412. e.index[e.getIndex(t)] = t
  28413. })
  28414. }
  28415. ,
  28416. n.prototype.filter = function(e) {
  28417. var t = this.list.filter(e);
  28418. return this.reIndex(),
  28419. t
  28420. }
  28421. ,
  28422. n.prototype.reduce = function(e, t) {
  28423. return this.list.reduce(e, t)
  28424. }
  28425. ,
  28426. n.prototype.sort = function(e) {
  28427. return this.list.sort(e)
  28428. }
  28429. ,
  28430. n.prototype.indexOf = function(e) {
  28431. for (var t = 0; t < this.list.length; ++t)
  28432. if (this.list[t] === e)
  28433. return t;
  28434. return -1
  28435. }
  28436. ,
  28437. t.exports = n
  28438. }
  28439. ).call(this, "/js/util/IndexedCollection.js")
  28440. }
  28441. , {
  28442. "./common": 185,
  28443. "./logger": 189
  28444. }],
  28445. 176: [function(e, t, i) {
  28446. "use strict";
  28447. var n = e("../constants")
  28448. , r = {};
  28449. r.RADIANS_PER_DEGREE = Math.PI / 180,
  28450. r.DEGREES_PER_RADIAN = 180 / Math.PI,
  28451. r.Vector3 = function(e, t, i) {
  28452. this.x = e || 0,
  28453. this.y = t || 0,
  28454. this.z = i || 0
  28455. }
  28456. ,
  28457. r.Matrix4 = function() {
  28458. this.elements = new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]),
  28459. arguments.length > 0 && console.error("MathLight.Matrix4: the constructor no longer reads arguments. use .set() instead.")
  28460. }
  28461. ,
  28462. r.Matrix4.prototype = {
  28463. identity: function() {
  28464. return this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
  28465. this
  28466. },
  28467. copy: function(e) {
  28468. return this.elements.set(e.elements),
  28469. this
  28470. },
  28471. applyToVector3: function(e) {
  28472. var t = e.x
  28473. , i = e.y
  28474. , n = e.z
  28475. , r = this.elements;
  28476. return e.x = r[0] * t + r[4] * i + r[8] * n + r[12],
  28477. e.y = r[1] * t + r[5] * i + r[9] * n + r[13],
  28478. e.z = r[2] * t + r[6] * i + r[10] * n + r[14],
  28479. this
  28480. },
  28481. getInverse: function(e, t) {
  28482. var i = this.elements
  28483. , n = e.elements
  28484. , r = n[0]
  28485. , o = n[1]
  28486. , a = n[2]
  28487. , s = n[3]
  28488. , l = n[4]
  28489. , c = n[5]
  28490. , h = n[6]
  28491. , u = n[7]
  28492. , d = n[8]
  28493. , p = n[9]
  28494. , f = n[10]
  28495. , g = n[11]
  28496. , m = n[12]
  28497. , v = n[13]
  28498. , A = n[14]
  28499. , y = n[15]
  28500. , C = p * A * u - v * f * u + v * h * g - c * A * g - p * h * y + c * f * y
  28501. , I = m * f * u - d * A * u - m * h * g + l * A * g + d * h * y - l * f * y
  28502. , E = d * v * u - m * p * u + m * c * g - l * v * g - d * c * y + l * p * y
  28503. , b = m * p * h - d * v * h - m * c * f + l * v * f + d * c * A - l * p * A
  28504. , w = r * C + o * I + a * E + s * b;
  28505. if (0 === w) {
  28506. var _ = "MathLight.Matrix4.getInverse(): can't invert matrix, determinant is 0";
  28507. if (t)
  28508. throw new Error(_);
  28509. return console.warn(_),
  28510. this.identity()
  28511. }
  28512. var T = 1 / w;
  28513. return i[0] = C * T,
  28514. i[1] = (v * f * s - p * A * s - v * a * g + o * A * g + p * a * y - o * f * y) * T,
  28515. i[2] = (c * A * s - v * h * s + v * a * u - o * A * u - c * a * y + o * h * y) * T,
  28516. i[3] = (p * h * s - c * f * s - p * a * u + o * f * u + c * a * g - o * h * g) * T,
  28517. i[4] = I * T,
  28518. i[5] = (d * A * s - m * f * s + m * a * g - r * A * g - d * a * y + r * f * y) * T,
  28519. i[6] = (m * h * s - l * A * s - m * a * u + r * A * u + l * a * y - r * h * y) * T,
  28520. i[7] = (l * f * s - d * h * s + d * a * u - r * f * u - l * a * g + r * h * g) * T,
  28521. i[8] = E * T,
  28522. i[9] = (m * p * s - d * v * s - m * o * g + r * v * g + d * o * y - r * p * y) * T,
  28523. i[10] = (l * v * s - m * c * s + m * o * u - r * v * u - l * o * y + r * c * y) * T,
  28524. i[11] = (d * c * s - l * p * s - d * o * u + r * p * u + l * o * g - r * c * g) * T,
  28525. i[12] = b * T,
  28526. i[13] = (d * v * a - m * p * a + m * o * f - r * v * f - d * o * A + r * p * A) * T,
  28527. i[14] = (m * c * a - l * v * a - m * o * h + r * v * h + l * o * A - r * c * A) * T,
  28528. i[15] = (l * p * a - d * c * a + d * o * h - r * p * h - l * o * f + r * c * f) * T,
  28529. this
  28530. },
  28531. makeRotationFromQuaternion: function(e) {
  28532. var t = this.elements
  28533. , i = e.x
  28534. , n = e.y
  28535. , r = e.z
  28536. , o = e.w
  28537. , a = i + i
  28538. , s = n + n
  28539. , l = r + r
  28540. , c = i * a
  28541. , h = i * s
  28542. , u = i * l
  28543. , d = n * s
  28544. , p = n * l
  28545. , f = r * l
  28546. , g = o * a
  28547. , m = o * s
  28548. , v = o * l;
  28549. return t[0] = 1 - (d + f),
  28550. t[4] = h - v,
  28551. t[8] = u + m,
  28552. t[1] = h + v,
  28553. t[5] = 1 - (c + f),
  28554. t[9] = p - g,
  28555. t[2] = u - m,
  28556. t[6] = p + g,
  28557. t[10] = 1 - (c + d),
  28558. t[3] = 0,
  28559. t[7] = 0,
  28560. t[11] = 0,
  28561. t[12] = 0,
  28562. t[13] = 0,
  28563. t[14] = 0,
  28564. t[15] = 1,
  28565. this
  28566. }
  28567. },
  28568. r.Quaternion = function(e, t, i, n) {
  28569. this._x = e || 0,
  28570. this._y = t || 0,
  28571. this._z = i || 0,
  28572. this._w = void 0 !== n ? n : 1
  28573. }
  28574. ,
  28575. r.Quaternion.prototype = {
  28576. get x() {
  28577. return this._x
  28578. },
  28579. set x(e) {
  28580. this._x = e
  28581. },
  28582. get y() {
  28583. return this._y
  28584. },
  28585. set y(e) {
  28586. this._y = e
  28587. },
  28588. get z() {
  28589. return this._z
  28590. },
  28591. set z(e) {
  28592. this._z = e
  28593. },
  28594. get w() {
  28595. return this._w
  28596. },
  28597. set w(e) {
  28598. this._w = e
  28599. },
  28600. copy: function(e) {
  28601. this._x = e.x,
  28602. this._y = e.y,
  28603. this._z = e.z,
  28604. this._w = e.w
  28605. },
  28606. inverse: function() {
  28607. return this.conjugate().normalize()
  28608. },
  28609. conjugate: function() {
  28610. return this._x *= -1,
  28611. this._y *= -1,
  28612. this._z *= -1,
  28613. this
  28614. },
  28615. length: function() {
  28616. return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w)
  28617. },
  28618. normalize: function() {
  28619. var e = this.length();
  28620. return 0 === e ? (this._x = 0,
  28621. this._y = 0,
  28622. this._z = 0,
  28623. this._w = 1) : (e = 1 / e,
  28624. this._x = this._x * e,
  28625. this._y = this._y * e,
  28626. this._z = this._z * e,
  28627. this._w = this._w * e),
  28628. this
  28629. },
  28630. setFromAxisAngle: function(e, t) {
  28631. var i = t / 2
  28632. , n = Math.sin(i);
  28633. return this._x = e.x * n,
  28634. this._y = e.y * n,
  28635. this._z = e.z * n,
  28636. this._w = Math.cos(i),
  28637. this
  28638. },
  28639. setFromUnitVectors: function() {
  28640. var e, t, i = 1e-6;
  28641. return function(n, o) {
  28642. return void 0 === e && (e = new r.Vector3),
  28643. t = r.dot(n, o) + 1,
  28644. t < i ? (t = 0,
  28645. 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),
  28646. this._x = e.x,
  28647. this._y = e.y,
  28648. this._z = e.z,
  28649. this._w = t,
  28650. this.normalize()
  28651. }
  28652. }(),
  28653. multiply: function(e) {
  28654. return this.multiplyQuaternions(this, e)
  28655. },
  28656. premultiply: function(e) {
  28657. return this.multiplyQuaternions(e, this)
  28658. },
  28659. multiplyQuaternions: function(e, t) {
  28660. var i = e._x
  28661. , n = e._y
  28662. , r = e._z
  28663. , o = e._w
  28664. , a = t._x
  28665. , s = t._y
  28666. , l = t._z
  28667. , c = t._w;
  28668. return this._x = i * c + o * a + n * l - r * s,
  28669. this._y = n * c + o * s + r * a - i * l,
  28670. this._z = r * c + o * l + i * s - n * a,
  28671. this._w = o * c - i * a - n * s - r * l,
  28672. this
  28673. }
  28674. },
  28675. r.convertWorkshopVector = function(e) {
  28676. return new r.Vector3(-e.x,e.y,e.z)
  28677. }
  28678. ,
  28679. r.convertWorkshopQuaternion = function(e) {
  28680. 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))
  28681. }
  28682. ;
  28683. r.convertWorkshopOrthoZoom = function(e) {//xzw
  28684. //return e === -1 ? -1 : e / 16 * ($("#player").width() / $("#player").height()) / n.workshopApsect
  28685. return e === -1 ? -1 : e * ($("#player").width() / $("#player").height()) / g_snapShotWidth * g_snapShotHeight;
  28686. }
  28687. ,
  28688. r.convertWorkshopPanoramaQuaternion = function(e) {
  28689. 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))
  28690. }
  28691. ,
  28692. r.normalize = function(e) {
  28693. var t = e.x * e.x + e.y * e.y + e.z * e.z
  28694. , i = Math.sqrt(t);
  28695. e.x /= i,
  28696. e.y /= i,
  28697. e.z /= i
  28698. }
  28699. ,
  28700. r.dot = function(e, t) {
  28701. return e.x * t.x + e.y * t.y + e.z * t.z
  28702. }
  28703. ,
  28704. r.cross = function(e, t, i) {
  28705. var n = e.x
  28706. , r = e.y
  28707. , o = e.z;
  28708. i.x = r * t.z - o * t.y,
  28709. i.y = o * t.x - n * t.z,
  28710. i.z = n * t.y - r * t.x
  28711. }
  28712. ,
  28713. r.setVector = function(e, t, i, n) {
  28714. e.x = t,
  28715. e.y = i,
  28716. e.z = n
  28717. }
  28718. ,
  28719. r.copyVector = function(e, t) {
  28720. t.x = e.x,
  28721. t.y = e.y,
  28722. t.z = e.z
  28723. }
  28724. ,
  28725. r.addVector = function(e, t) {
  28726. e.x += t.x,
  28727. e.y += t.y,
  28728. e.z += t.z
  28729. }
  28730. ,
  28731. r.subVector = function(e, t) {
  28732. e.x -= t.x,
  28733. e.y -= t.y,
  28734. e.z -= t.z
  28735. }
  28736. ,
  28737. r.applyQuaternionToVector = function(e, t) {
  28738. var i = t.x
  28739. , n = t.y
  28740. , r = t.z
  28741. , o = e.x
  28742. , a = e.y
  28743. , s = e.z
  28744. , l = e.w
  28745. , c = l * i + a * r - s * n
  28746. , h = l * n + s * i - o * r
  28747. , u = l * r + o * n - a * i
  28748. , d = -o * i - a * n - s * r;
  28749. t.x = c * l + d * -o + h * -s - u * -a,
  28750. t.y = h * l + d * -a + u * -o - c * -s,
  28751. t.z = u * l + d * -s + c * -a - h * -o
  28752. }
  28753. ,
  28754. r.angleBetweenVectors = function(e, t) {
  28755. return Math.acos(r.dot(e, t))
  28756. }
  28757. ,
  28758. t.exports = r
  28759. }
  28760. , {
  28761. "../constants": 8
  28762. }],
  28763. 177: [function(e, t, i) {
  28764. (function(i) {
  28765. "use strict";
  28766. function n(e) {
  28767. this.cache = null,
  28768. this.expires = 0
  28769. }
  28770. function r() {
  28771. this.baseUrl = null,
  28772. this.cache = null,
  28773. this.expires = 0
  28774. }
  28775. function o() {
  28776. this.baseUrl = null,
  28777. this.expires = 0
  28778. }
  28779. function a(e) {
  28780. this.initialLoadingPromise = null,
  28781. this.endpoint = e + "?type=3",
  28782. this.urlContainer = null,
  28783. this.authorizationHeader = h.getAuthorizationHeader(),
  28784. this.containerClasses = [o, r, n]
  28785. }
  28786. var s = e("./ajax")
  28787. , l = e("./logger")
  28788. , c = e("../constants")
  28789. , h = e("./showcase")
  28790. , u = (e("../ab"),
  28791. new l(i));
  28792. n.prototype = {
  28793. version: 1,
  28794. validate: function(e) {
  28795. return "catalog.json"in e && Object.keys(e).length > 0
  28796. },
  28797. update: function(e) {
  28798. return this.cache = e,
  28799. this.expires = Date.now() + c.signedUrlDefaultExpireTime,
  28800. $.when()
  28801. },
  28802. get: function(e) {
  28803. return this.cache[e]
  28804. }
  28805. },
  28806. r.prototype = {
  28807. version: 2,
  28808. validate: function(e) {
  28809. return "catalog.json"in e && "base.url"in e && Object.keys(e).length > 1
  28810. },
  28811. update: function(e) {
  28812. return this.baseUrl = e["base.url"],
  28813. this.cache = e,
  28814. this.expires = Date.now() + c.signedUrlDefaultExpireTime,
  28815. $.when()
  28816. },
  28817. get: function(e) {
  28818. var t = this.cache[e];
  28819. return t ? this.baseUrl.replace("{{filename}}", e) + t : null
  28820. }
  28821. },
  28822. o.prototype = {
  28823. version: 3,
  28824. validate: function(e) {
  28825. return e.templates && e.catalog_file && (!e.expires || 1e3 * e.expires > Date.now())
  28826. },
  28827. update: function(e) {
  28828. return this.baseUrl = e.templates[0],
  28829. e.expires ? this.expires = 1e3 * e.expires : this.expires = Date.now() + c.signedUrlDefaultExpireTime,
  28830. $.when()
  28831. },
  28832. get: function(e) {
  28833. return this.baseUrl.replace("{{filename}}", e)
  28834. }
  28835. },
  28836. a.prototype = {
  28837. init: function() {
  28838. return this.initialLoadingPromise ? this.initialLoadingPromise : (setInterval(function() {
  28839. var e = this.urlContainer ? this.urlContainer.expires : Date.now();
  28840. Date.now() + c.signedUrlRefreshBuffer > e && (u.debug("Refreshing urls..."),
  28841. this.refresh().done(function() {
  28842. u.debug("Refreshed")
  28843. }).fail(function() {
  28844. u.error("Failed url refresh, urls might go stale soon")
  28845. }))
  28846. }
  28847. .bind(this), c.signedUrlCheckInterval),
  28848. this.initialLoadingPromise = this.refresh(),
  28849. this.initialLoadingPromise)
  28850. },
  28851. refresh: function(e) { //已经在someData.js里加载过了 不用再加载file了吧
  28852. e = e || {};
  28853. /*var t = void 0 === e.cache || e.cache;
  28854. return s.get( this.endpoint , { //file
  28855. responseType: "json",
  28856. prefetchFrom: t ? "files" : null,
  28857. cache: t,
  28858. auth: this.authorizationHeader
  28859. }).then(function(e) {
  28860. if (this.urlContainer && this.urlContainer.validate(e))
  28861. return this.urlContainer.update(e);
  28862. for (var i = 0; i < this.containerClasses.length; i++) {
  28863. var n = this.containerClasses[i]
  28864. , r = new n;
  28865. if (r.validate(e))
  28866. return u.info("Using urls version " + r.version),
  28867. this.urlContainer = r,
  28868. this.urlContainer.update(e)
  28869. }
  28870. return t ? this.refresh({
  28871. cache: !1
  28872. }) : $.Deferred().reject("missing-urls")
  28873. }
  28874. .bind(this), function(e) {
  28875. return "loading-failed"
  28876. }) */
  28877. return $.Deferred().resolve();
  28878. },
  28879. get: function(e) {
  28880. //return this.urlContainer.get(e)
  28881. return window.MP_PREFETCHED_MODELDATA.files.templates[0].replace("{{filename}}", e)
  28882. }
  28883. },
  28884. t.exports = a
  28885. }
  28886. ).call(this, "/js/util/ModelUrls.js")
  28887. }
  28888. , {
  28889. "../ab": 3,
  28890. "../constants": 8,
  28891. "./ajax": 181,
  28892. "./logger": 189,
  28893. "./showcase": 193
  28894. }],
  28895. 178: [function(e, t, i) {
  28896. (function(i) {
  28897. "use strict";
  28898. function n() {
  28899. u.call(this),
  28900. this.neighbourMap = {},
  28901. this.map = null
  28902. }
  28903. var r = e("three")
  28904. , o = e("./common")
  28905. , a = e("../settings")
  28906. , s = e("../objects/Panorama")
  28907. , a = e("../settings")
  28908. , l = e("./aStar")
  28909. , c = e("./logger")
  28910. , h = new c(i)
  28911. , u = e("./IndexedCollection")
  28912. , d = e("./transitions");
  28913. o.inherit(n, u),
  28914. n.prototype.getIndex = function(e) {
  28915. return e.id
  28916. }
  28917. ,
  28918. n.prototype.find = function(e, t) {
  28919. var i = o.filterAll(this.list, e);
  28920. return 0 === i.length ? null : (t && t.forEach(function(e) {
  28921. i = o.stableSort(i, e)
  28922. }),
  28923. i[0])
  28924. }
  28925. ,
  28926. n.prototype.sortByScore = function(e, t) {
  28927. var i = o.filterAll(this.list, e);
  28928. return 0 === i.length ? null : i = i.map(function(e) {
  28929. return {
  28930. pano: e,
  28931. score: t.reduce(function(t, i) {
  28932. return t + i(e)
  28933. }, 0)
  28934. }
  28935. }).sort(function(e, t) {
  28936. return t.score - e.score;
  28937. })
  28938. }
  28939. ,
  28940. n.prototype.lowestByScore = function(e, t, i) {
  28941. return this.findRankedByScore(0, e, t, i)
  28942. }
  28943. ,
  28944. n.prototype.findRankedByScore = function(e, t, i, n) {
  28945. n && (n.candidates = null,
  28946. n.pano = null),
  28947. e || (e = 0);
  28948. var r = this.sortByScore(t, i);
  28949. return !r || 0 === r.length || e >= r.length ? null : (n && (n.candidates = r,
  28950. n.pano = r[e].pano),
  28951. r[e].pano)
  28952. }
  28953. ,
  28954. n.prototype.showPanoScores = function(e) {
  28955. this.list.forEach(function(e) {
  28956. e.removeTextSprite()
  28957. });
  28958. var t = 6344768;
  28959. e.forEach(function(e) {
  28960. e.pano.addTextSprite(e.score.toFixed(2), t),
  28961. t = 16428055
  28962. })
  28963. }
  28964. ,
  28965. n.prototype.isNeighbour = function(e, t) {
  28966. return this.neighbourMap[e.id][t.id]
  28967. }
  28968. ,
  28969. n.prototype.getNeighbours = function(e) {
  28970. return this.neighbourMap[e.id]
  28971. }
  28972. ,
  28973. n.prototype.setNeighbour = function(e, t, i) {
  28974. return this.neighbourMap[e.id] || (this.neighbourMap[e.id] = {}),
  28975. this.neighbourMap[t.id] || (this.neighbourMap[t.id] = {}),
  28976. this.neighbourMap[e.id][e.id] = !0,
  28977. this.neighbourMap[t.id][t.id] = !0,
  28978. this.neighbourMap[e.id][t.id] = i,
  28979. this.neighbourMap[t.id][e.id] = i,
  28980. this.neighbourMap[e.id]
  28981. }
  28982. ,
  28983. n.prototype.findClosest = function(e, t) {
  28984. var i = [s.filters.isPanoAligned()];
  28985. return t && i.push(s.filters.inDirection(e, t, .75)),
  28986. this.find(i, [s.sortFunctions.distanceToPoint(e)])
  28987. }
  28988. ,
  28989. n.prototype.dualNeighbors = function(e, t) {
  28990. var i, n = [];
  28991. for (i in this.neighbourMap[e.id])
  28992. this.neighbourMap[t.id][i] && n.push(i);
  28993. return n
  28994. }
  28995. ,
  28996. n.prototype.populate_path_graph = function() {
  28997. 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;
  28998. for (e = 0; e < this.list.length; e += 1) {
  28999. o = this.list[e],
  29000. s = {},
  29001. l = !1,
  29002. i = o.neighbourPanos || o.findNeighourPanos();
  29003. for (t in i)
  29004. if (i[t]) {
  29005. a = this.index[t],
  29006. p.copy(o.floorPosition),
  29007. p.sub(a.floorPosition);
  29008. var m = Math.sqrt(p.x * p.x + p.z * p.z)
  29009. , v = (Math.abs(p.y) / Math.max(m, .01),
  29010. Math.max(0, Math.abs(p.y) - .2));
  29011. v > 0 ? (f += 1,
  29012. v = Math.pow(4 * v, 2),
  29013. m = Math.pow(m, 2),
  29014. n = Math.sqrt(v * v + m * m)) : (g += 1,
  29015. n = p.length()),
  29016. s[a.id] = n,
  29017. l = !0
  29018. }
  29019. l ? u[o.id] = s : d += 1
  29020. }
  29021. this.map = u,
  29022. h.info("graph ready in " + (Date.now() - c) + "ms, " + d + " had no neighbors")
  29023. }
  29024. ,
  29025. n.prototype.aStarSearch = function(e, t) {
  29026. var i = Date.now()
  29027. , n = new l({
  29028. start: e,
  29029. isEnd: function(e) {
  29030. return e === t
  29031. },
  29032. neighbor: function(e) {
  29033. var t = e.neighbourPanos || e.findNeighourPanos()
  29034. , i = [];
  29035. for (var n in t)
  29036. i.push(this.index[n]);
  29037. return i
  29038. }
  29039. .bind(this),
  29040. distance: function(e, t) {
  29041. var i = this.map[e.id]
  29042. , n = i[t.id];
  29043. return n
  29044. }
  29045. .bind(this),
  29046. heuristic: function(e, t) {
  29047. return 1
  29048. }
  29049. .bind(this),
  29050. hash: function(e) {
  29051. return e.id
  29052. },
  29053. timeout: 5e3
  29054. });
  29055. if (h.debug("A* search in " + (Date.now() - i) + "ms"),
  29056. "success" !== n.status)
  29057. return h.debug("Did not find A* path from " + e + " to " + t),
  29058. null;
  29059. h.debug("Total cost " + n.cost.toPrecision(3) + ", " + n.path.length + " steps");
  29060. var r = [];
  29061. return n.path.forEach(function(e) {
  29062. r.push(e.id)
  29063. }),
  29064. r
  29065. }
  29066. ,
  29067. n.prototype.includeNodesNearPath = function() {
  29068. var e = new r.Vector3
  29069. , t = new r.Vector3
  29070. , i = new r.Vector3
  29071. , n = new r.Vector3
  29072. , o = new r.Vector3
  29073. , a = new r.Vector3
  29074. , s = new r.Vector3
  29075. , l = new r.Vector3
  29076. , c = []
  29077. , h = new r.Vector3
  29078. , u = new r.Vector3;
  29079. return function(r, d) {
  29080. if (r)
  29081. for (var p = function(e, t, i) {
  29082. return o.copy(t).sub(e),
  29083. o.dot(i)
  29084. }, f = function(e, t) {
  29085. return p(h, e.position, i) - p(h, t.position, i)
  29086. }, g = 0; g < r.length - 1; ) {
  29087. var m = r[g]
  29088. , v = r[g + 1]
  29089. , A = this.index[m]
  29090. , y = this.index[v];
  29091. h.copy(A.position),
  29092. u.copy(y.position),
  29093. c.length = 0,
  29094. e.copy(u).sub(h),
  29095. i.copy(e).normalize();
  29096. for (var C = 0; C < this.list.length; C++) {
  29097. var I = this.list[C];
  29098. o.copy(I.position).sub(h);
  29099. var E = o.dot(i);
  29100. if (E > 0) {
  29101. s.copy(i),
  29102. s.multiplyScalar(E),
  29103. a.copy(o),
  29104. a.sub(s);
  29105. var b = a.length();
  29106. if (b < d) {
  29107. t.copy(e).negate(),
  29108. n.copy(t).normalize(),
  29109. l.copy(I.position).sub(u);
  29110. var w = l.dot(n);
  29111. w > 0 && c.push(I)
  29112. }
  29113. }
  29114. }
  29115. if (c.length > 0) {
  29116. c.sort(f);
  29117. for (var _ = r.length + c.length - 1; _ >= g + c.length; _--)
  29118. r[_] = r[_ - c.length];
  29119. for (var T = 0; T < c.length; T++)
  29120. r[T + g + 1] = c[T].id
  29121. }
  29122. g += c.length + 1
  29123. }
  29124. }
  29125. }(),
  29126. n.prototype.fadeMarkerOpacity = function(e, t) {
  29127. var i = void 0 === e ? a.panorama.markerOpacity : e
  29128. , n = this.list.findIndex(function(e) {
  29129. return e.marker
  29130. });
  29131. if (!(n < 0)) {
  29132. var r = this.list[n].marker.material.opacity;
  29133. if (r !== e) {
  29134. var o = i - r;
  29135. d.trigger({
  29136. func: function(e, t) {
  29137. var i = r + e * o;
  29138. this.forEach(function(e) {
  29139. e.marker && (e.marker.material.opacity = i)
  29140. })
  29141. }
  29142. .bind(this),
  29143. duration: void 0 === t ? a.markerOpacityTransitionTime : t,
  29144. name: "_fpm"
  29145. })
  29146. }
  29147. }
  29148. }
  29149. ,
  29150. t.exports = n
  29151. }
  29152. ).call(this, "/js/util/PanoramaCollection.js")
  29153. }
  29154. , {
  29155. "../objects/Panorama": 148,
  29156. "../settings": 166,
  29157. "./IndexedCollection": 175,
  29158. "./aStar": 180,
  29159. "./common": 185,
  29160. "./logger": 189,
  29161. "./transitions": 195,
  29162. three: 217
  29163. }],
  29164. 179: [function(e, t, i) {
  29165. "use strict";
  29166. function n() {
  29167. this.actionSequence = [],
  29168. this.actionSequenceInProgress = !1
  29169. }
  29170. function r(e, t, i, n) {
  29171. s.trackAlways("zoom_" + e, {
  29172. from: t,
  29173. to: i,
  29174. pano: n
  29175. })
  29176. }
  29177. function o(e, t) {
  29178. r("initial", 1, e, t)
  29179. }
  29180. function a(e, t, i) {
  29181. r("followup", e, t, i)
  29182. }
  29183. var s = e("../analytics");
  29184. n.prototype.reset = function(e) {
  29185. this.actionSequenceInProgress = !1,
  29186. this.actionSequence.length = 0
  29187. }
  29188. ,
  29189. n.prototype.addZoomAction = function() {
  29190. var e = null
  29191. , t = null
  29192. , i = !1
  29193. , n = function() {
  29194. if (e = null,
  29195. this.actionSequence.length > 0) {
  29196. var i = this.actionSequence[0].start
  29197. , n = this.actionSequence[this.actionSequence.length - 1].end;
  29198. 1 === i ? o(n, t) : a(i, n, t)
  29199. }
  29200. this.reset()
  29201. };
  29202. return function(r, o, a) {
  29203. if (r !== o) {
  29204. i || (n = n.bind(this),
  29205. i = !0),
  29206. e && (window.clearTimeout(e),
  29207. e = null),
  29208. a === t && this.actionSequenceInProgress || (this.reset(),
  29209. t = a),
  29210. this.actionSequenceInProgress = !0;
  29211. var s = {
  29212. start: r,
  29213. end: o
  29214. };
  29215. this.actionSequence.push(s),
  29216. e = window.setTimeout(n, 150)
  29217. }
  29218. }
  29219. }(),
  29220. t.exports = n
  29221. }
  29222. , {
  29223. "../analytics": 4
  29224. }],
  29225. 180: [function(e, t, i) {
  29226. "use strict";
  29227. function n(e) {
  29228. void 0 === e.timeout && (e.timeout = 1 / 0);
  29229. var t = e.hash || o
  29230. , i = {
  29231. data: e.start,
  29232. g: 0,
  29233. h: e.heuristic(e.start)
  29234. }
  29235. , n = i;
  29236. i.f = i.h;
  29237. var h = new s
  29238. , u = new l(a)
  29239. , d = c();
  29240. u.push(i),
  29241. d.set(t(i.data), i);
  29242. for (var p = new Date; u.size(); ) {
  29243. if (new Date - p > e.timeout)
  29244. return {
  29245. status: "timeout",
  29246. cost: n.g,
  29247. path: r(n)
  29248. };
  29249. var f = u.pop();
  29250. if (d.delete(t(f.data)),
  29251. e.isEnd(f.data))
  29252. return {
  29253. status: "success",
  29254. cost: f.g,
  29255. path: r(f)
  29256. };
  29257. h.add(t(f.data));
  29258. for (var g = e.neighbor(f.data), m = 0; m < g.length; m++) {
  29259. var v = g[m];
  29260. if (!h.contains(t(v))) {
  29261. var A = f.g + e.distance(f.data, v)
  29262. , y = d.get(t(v))
  29263. , C = !1;
  29264. if (void 0 === y)
  29265. y = {
  29266. data: v
  29267. },
  29268. d.set(t(v), y);
  29269. else {
  29270. if (y.g < A)
  29271. continue;
  29272. C = !0
  29273. }
  29274. y.parent = f,
  29275. y.g = A,
  29276. y.h = e.heuristic(v),
  29277. y.f = A + y.h,
  29278. y.h < n.h && (n = y),
  29279. C ? u.heapify() : u.push(y)
  29280. }
  29281. }
  29282. }
  29283. return {
  29284. status: "noPath",
  29285. cost: n.g,
  29286. path: r(n)
  29287. }
  29288. }
  29289. function r(e) {
  29290. if (void 0 !== e.parent) {
  29291. var t = r(e.parent);
  29292. return t.push(e.data),
  29293. t
  29294. }
  29295. return [e.data]
  29296. }
  29297. function o(e) {
  29298. return e.toString()
  29299. }
  29300. function a(e, t) {
  29301. return e.f - t.f
  29302. }
  29303. var s = e("Set")
  29304. , l = e("heap")
  29305. , c = e("dict");
  29306. t.exports = n
  29307. }
  29308. , {
  29309. Set: 196,
  29310. dict: 210,
  29311. heap: 211
  29312. }],
  29313. 181: [function(e, t, i) {
  29314. (function(i) {
  29315. "use strict";
  29316. function n(e, t, i) {
  29317. var n = new XMLHttpRequest;
  29318. if (i && "withCredentials"in n)
  29319. n.open(e, t, i);
  29320. else if ("undefined" != typeof XDomainRequest)
  29321. n = new XDomainRequest,
  29322. n.open(e, t);
  29323. else {
  29324. if (i)
  29325. throw "Browser does not support CORS!";
  29326. n.open(e, t)
  29327. }
  29328. return n
  29329. }
  29330. function r(e, t, i) {
  29331. function o() {
  29332. u.warn("Retrying ", t),
  29333. r(e, t, i).done(c.resolve.bind(c)).progress(c.notify.bind(c)).fail(c.reject.bind(c))
  29334. }
  29335. function a(e, t) {
  29336. var i = e.response;
  29337. if ("json" === t && "object" != typeof i)
  29338. try {
  29339. i = JSON.parse(e.responseText)
  29340. } catch (e) {
  29341. return void c.reject({
  29342. error: "Failed parsing JSON"
  29343. })
  29344. }
  29345. else if ("image/jpeg" === t) {
  29346. var n = new Uint8Array(e.response)
  29347. , r = new Blob([n],{
  29348. type: "image/jpeg"
  29349. })
  29350. , o = URL.createObjectURL(r);
  29351. i = new Image,
  29352. i.src = o,
  29353. i.crossOrigin = "Anonymous",
  29354. i.onload = function() {
  29355. URL.revokeObjectURL(o)
  29356. }
  29357. }
  29358. return i
  29359. }
  29360. var s = n(e, t, !1);
  29361. if (i = i || {},
  29362. i.retries = void 0 !== i.retries ? i.retries : 0,
  29363. i.retry = void 0 !== i.retry ? i.retry : "get" === e.toLowerCase(),
  29364. i.responseType)
  29365. if (["arraybuffer", "text", "json"].indexOf(i.responseType) > -1)
  29366. s.responseType = i.responseType;
  29367. else {
  29368. if ("image/jpeg" !== i.responseType)
  29369. throw new Error('reponseType can only be one of "arraybuffer", "text" or "json", "image/jpeg"');
  29370. s.responseType = "arraybuffer"
  29371. }
  29372. if ("json" === i.responseType && s.setRequestHeader("Accept", "application/json"),
  29373. i.auth && s.setRequestHeader("Authorization", i.auth),
  29374. "object" == typeof i.data && (i.data = JSON.stringify(i.data),
  29375. s.setRequestHeader("Content-Type", "application/json")),
  29376. "object" == typeof i.headers)
  29377. for (var l in i.headers)
  29378. s.setRequestHeader(l, i.headers[l]);
  29379. var c = $.Deferred();
  29380. return s.onreadystatechange = function(e) {
  29381. if (4 === this.readyState)
  29382. if (this.status >= 500 && this.status <= 600 && i.retry && i.retries < 3)
  29383. i.retries++,
  29384. setTimeout(o, 1e3);
  29385. else if (200 === this.status) {
  29386. var t = a(this, i.responseType);
  29387. c.resolve(t)
  29388. } else
  29389. c.reject(this)
  29390. }
  29391. ,
  29392. s.onprogress = function(e) {
  29393. c.notify(e)
  29394. }
  29395. ,
  29396. s.send(i.data),
  29397. c.promise()
  29398. }
  29399. function o(e) {
  29400. return Object.keys(e).sort().map(function(t) {
  29401. return {
  29402. key: t,
  29403. value: e[t]
  29404. }
  29405. })
  29406. }
  29407. function a(e, t) {
  29408. var i = t.responseType || null
  29409. , n = t.auth || null
  29410. , r = t.prefetchFrom || null
  29411. , a = e + "__" + i + "__" + n + "__" + r;
  29412. return t.headers && o(t.headers).forEach(function(e) {
  29413. a += "__" + e.key + ":" + e.value
  29414. }),
  29415. a
  29416. }
  29417. function s(e, t) {
  29418. return window.MP_REQUEST_CACHE ? window.MP_REQUEST_CACHE[a(e, t)] : null
  29419. }
  29420. function l(e, t, i) {
  29421. window.MP_REQUEST_CACHE && (window.MP_REQUEST_CACHE[a(e, t)] = i)
  29422. }
  29423. var c = e("./logger")
  29424. , h = e("../ab")
  29425. , u = new c(i);
  29426. window.URL = window.URL || window.webkitURL,
  29427. window.MP_REQUEST_CACHE = window.MP_REQUEST_CACHE || {},
  29428. window.MP_PREFETCHED_MODELDATA = window.MP_PREFETCHED_MODELDATA || {}
  29429. /* setTimeout(function() {//MP-- xzw delete
  29430. window.MP_REQUEST_CACHE = null,
  29431. window.MP_PREFETCHED_MODELDATA = {}
  29432. }, 6e4),
  29433. window.onpageshow = function(e) {
  29434. e.persisted && (window.MP_REQUEST_CACHE = null,
  29435. window.MP_PREFETCHED_MODELDATA = {})
  29436. } */
  29437. ,
  29438. t.exports = {
  29439. get: function(e, t) {
  29440. t = t || {};
  29441. var i = void 0 === t.cache || t.cache;
  29442. if (i) {
  29443. var n = s(e, t);
  29444. if (n)
  29445. return n
  29446. }
  29447. var o;
  29448. return o = t.prefetchFrom && window.MP_PREFETCHED_MODELDATA[t.prefetchFrom] ? $.when(window.MP_PREFETCHED_MODELDATA[t.prefetchFrom]) : r("GET", e, t),
  29449. i && l(e, t, o),
  29450. o
  29451. },
  29452. post: function(e, t) {
  29453. return r("POST", e, t)
  29454. },
  29455. patch: function(e, t) {
  29456. return r("PATCH", e, t)
  29457. },
  29458. getImage: function(e, t) {
  29459. function i() {
  29460. u.warn("Retrying ", e),
  29461. o.getImage(e, t - 1).done(n.resolve.bind(n)).progress(n.notify.bind(n)).fail(n.reject.bind(n))
  29462. }
  29463. var n = $.Deferred()
  29464. , r = new Image
  29465. , o = this;
  29466. return e = h.changeIfImageOptimzing(e),
  29467. null !== t && void 0 !== t || (t = 3),
  29468. r.onerror = function() {
  29469. t > 0 ? setTimeout(i, 1e3) : n.reject()
  29470. }
  29471. ,
  29472. r.onload = function() {
  29473. n.resolve(r)
  29474. }
  29475. ,
  29476. r.crossOrigin = "anonymous",
  29477. r.src = e,
  29478. n
  29479. }
  29480. }
  29481. }
  29482. ).call(this, "/js/util/ajax.js")
  29483. }
  29484. , {
  29485. "../ab": 3,
  29486. "./logger": 189
  29487. }],
  29488. 182: [function(e, t, i) {
  29489. "use strict";
  29490. function n(e, t) {
  29491. var i = window.navigator.userAgent
  29492. , n = i.match(e);
  29493. return n = n ? n[1].split(t) : [],
  29494. {
  29495. major: parseInt(n[0]) || 0,
  29496. minor: parseInt(n[1]) || 0,
  29497. patch: parseInt(n[2]) || 0
  29498. }
  29499. }
  29500. var r = e("../exception/DeviceMismatchException");
  29501. t.exports = {
  29502. isFullscreen: function() {
  29503. return document.fullscreenElement || document.mozFullscreenElement || document.mozFullScreenElement || document.webkitFullscreenElement || document.msFullscreenElement
  29504. },
  29505. supportsFullscreen: function() {
  29506. return document.fullscreenEnabled || document.mozFullscreenEnabled || document.mozFullScreenEnabled || document.webkitFullscreenEnabled || document.msFullscreenEnabled
  29507. },
  29508. isPointerLocked: function() {
  29509. return document.pointerLockElement || document.mozPointerLockElement || document.webkitPointerLockElement
  29510. },
  29511. requestFullscreen: function(e, t) {
  29512. e.requestFullscreen ? e.requestFullscreen() : e.mozRequestFullScreen ? e.mozRequestFullScreen() : e.webkitRequestFullscreen ? e.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT) : e.msRequestFullscreen && e.msRequestFullscreen(),
  29513. t && $(document).on("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", browser.requestPointerLock)
  29514. },
  29515. requestPointerLock: function() {
  29516. var e;
  29517. if (document.fullscreenElement)
  29518. e = document.fullscreenElement();
  29519. else if (document.mozFullscreenElement)
  29520. e = document.mozFullscreenElement();
  29521. else if (document.mozFullScreenElement)
  29522. e = document.mozFullScreenElement();
  29523. else {
  29524. if (!document.webkitFullscreenElement)
  29525. return;
  29526. e = document.webkitFullscreenElement()
  29527. }
  29528. e.requestPointerLock = e.requestPointerLock || e.mozRequestPointerLock || e.webkitRequestPointerLock,
  29529. e.requestPointerLock(),
  29530. $(document).off("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", this)
  29531. },
  29532. exitPointerLock: function() {
  29533. document.exitPointerLock = document.exitPointerLock || document.mozExitPointerLock || document.webkitExitPointerLock,
  29534. document.exitPointerLock()
  29535. },
  29536. exitFullscreen: function() {
  29537. document.exitFullscreen ? document.exitFullscreen() : document.msExitFullscreen ? document.msExitFullscreen() : document.mozCancelFullScreen ? document.mozCancelFullScreen() : document.webkitExitFullscreen && document.webkitExitFullscreen()
  29538. },
  29539. details: function() {
  29540. var e = navigator.userAgent.match("(Firefox|Chrome|Safari)/([\\d]+)");
  29541. return e ? {
  29542. name: e[1],
  29543. version: parseInt(e[2]),
  29544. platform: navigator.platform
  29545. } : {}
  29546. },
  29547. is: function(e) {
  29548. return this.details() && this.details().name === e
  29549. },
  29550. inIframe: function() {
  29551. return window.parent !== window
  29552. },
  29553. aspectRatio: function() {
  29554. var e = $("#player").width() / $("#player").height();
  29555. return isFinite(e) ? e : 0
  29556. },
  29557. userAgent: function() {
  29558. return window.navigator.userAgent
  29559. },
  29560. isMobile: function() {
  29561. var e = navigator.userAgent || navigator.vendor || window.opera;
  29562. 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))
  29563. },
  29564. isLandscape: function() {
  29565. return this.isMobile && this.aspectRatio() > 1
  29566. },
  29567. isSmallScreen: function() {
  29568. var e = screen.width / window.devicePixelRatio;
  29569. return e < 240
  29570. },
  29571. detectIE: function() {
  29572. var e = window.navigator.userAgent
  29573. , t = e.indexOf("MSIE ");
  29574. return t !== -1 || !!navigator.userAgent.match(/Trident.*rv\:11\./)
  29575. },
  29576. detectSafari: function() {
  29577. var e = window.navigator.userAgent
  29578. , t = e.indexOf("Safari");
  29579. return t !== -1 && !this.detectChrome()
  29580. },
  29581. detectFirefox: function() {
  29582. var e = window.navigator.userAgent;
  29583. return e.indexOf("Firefox") !== -1
  29584. },
  29585. detectChrome: function() {
  29586. var e = window.navigator.userAgent;
  29587. return e.indexOf("Chrome") !== -1 && !this.detectOpera()
  29588. },
  29589. detectOpera: function() {
  29590. var e = window.navigator.userAgent;
  29591. return e.indexOf("OPR") !== -1
  29592. },
  29593. detectIOS: function() {
  29594. return this.detectIPhone() || this.detectIPad() || this.detectIPod()
  29595. },
  29596. detectIPad: function() {
  29597. var e = window.navigator.userAgent
  29598. , t = /iPad/;
  29599. return t.test(e)
  29600. },
  29601. detectIPod: function() {
  29602. var e = window.navigator.userAgent
  29603. , t = /iPod/;
  29604. return t.test(e)
  29605. },
  29606. detectIPhone: function() {
  29607. var e = window.navigator.userAgent
  29608. , t = /iPhone/;
  29609. return t.test(e)
  29610. },
  29611. detectAndroid: function() {
  29612. var e = window.navigator.userAgent;
  29613. return e.indexOf("Android") !== -1
  29614. },
  29615. detectAndroidMobile: function() {
  29616. var e = window.navigator.userAgent;
  29617. return this.detectAndroid() && e.indexOf("Mobile") !== -1
  29618. },
  29619. detectSamsungNative: function() {
  29620. var e = window.navigator.userAgent;
  29621. return e.indexOf("SM-G900H") !== -1 || e.indexOf("GT-I9500") !== -1 || e.indexOf("SM-N900") !== -1
  29622. },
  29623. detectSamsungS6: function() {
  29624. var e = window.navigator.userAgent;
  29625. return e.indexOf("SM-G92") !== -1
  29626. },
  29627. /************************************************************fyz改from徐世廷*************************************************************/
  29628. detectHUAWEI5X: function() {
  29629. return -1 !== window.navigator.userAgent.indexOf("KIW-TL00H")
  29630. },
  29631. /*******************************************************************************************************************************/
  29632. detectWebVR: function() {
  29633. return !(!window.navigator.getVRDisplays || !window.VRDisplay)
  29634. },
  29635. getVRDisplay: function() {
  29636. var e = $.Deferred();
  29637. return this.detectWebVR() ? (navigator.getVRDisplays().then(function(t) {
  29638. t.length >= 1 && e.resolve(t[0]),
  29639. e.reject(null)
  29640. }),
  29641. e) : e.reject(null)
  29642. },
  29643. iosVersion: function() {
  29644. if (!this.detectIOS())
  29645. throw new r("Did not detect an iDevice");
  29646. var e = /((?:\d+\_?){1,3}) like Mac OS/
  29647. , t = "_";
  29648. return n(e, t)
  29649. },
  29650. androidVersion: function() {
  29651. if (!this.detectAndroid())
  29652. throw new r("Did not detect an Android based device");
  29653. var e = /Android ((?:\d+\.?){1,3})/
  29654. , t = ".";
  29655. return n(e, t)
  29656. },
  29657. valueFromCookie: function(e, t) {
  29658. var i = new RegExp(e + "=([0-9a-f]+)(; ?|$)").exec(document.cookie);
  29659. if (!i)
  29660. return t;
  29661. var n = i[1];
  29662. return "boolean" == typeof t ? "true" === n || "1" === n : "number" == typeof t ? parseFloat(n) : n
  29663. },
  29664. valueFromHash: function(e, t) {
  29665. var i = new RegExp("[#&?]" + e + "=([^#&?]*)")
  29666. , n = i.exec(window.location.href);
  29667. if (!n)
  29668. return t;
  29669. var r = n[1];
  29670. return "boolean" == typeof t ? "true" === r || "1" === r : "number" == typeof t ? parseFloat(r) : window.decodeURIComponent(r)
  29671. }
  29672. }
  29673. }
  29674. , {
  29675. "../exception/DeviceMismatchException": 56
  29676. }],
  29677. 183: [function(e, t, i) {
  29678. (function(i) {
  29679. "use strict";
  29680. function n(e, t) {
  29681. var i = r(t);
  29682. var replaceAll = function (str, f, e) {
  29683. //f全部替换成e
  29684. var reg = new RegExp(f, "g"); //创建正则RegExp对象
  29685. return str.replace(reg, e);
  29686. };
  29687. var urlFirstView = c.valueFromHash('firstView');
  29688. if(urlFirstView){
  29689. try{
  29690. urlFirstView = replaceAll(urlFirstView, "pano", '"pano"')
  29691. urlFirstView = replaceAll(urlFirstView, "qua:", '"qua":[')
  29692. urlFirstView = "{"+urlFirstView+"]}"
  29693. let info = JSON.parse(urlFirstView);
  29694. i.pano = t.list[info.pano] //panos.get(info.pano)
  29695. if(!i.pano){
  29696. urlFirstView = false
  29697. console.error('检测到firstView但是 找不到该pano')
  29698. }else{
  29699. i.quaternion = new THREE.Quaternion().fromArray(info.qua)
  29700. i.zoom = -1;
  29701. i.mode = "panorama"
  29702. i.setByUrl = true
  29703. }
  29704. }catch(e){
  29705. urlFirstView = false
  29706. console.error('检测到firstView但是解析出错'+e)
  29707. }
  29708. }
  29709. if (Object.keys(i).length > 0)
  29710. return i;
  29711. if (e.heroImage)
  29712. i = o(e, t);
  29713. else if(window.MP_PREFETCHED_MODELDATA.flyInOnlyBySwitch){
  29714. i.mode = "dollhouse"
  29715. }else if (window.MP_PREFETCHED_MODELDATA.camera_start) {
  29716. var n = window.MP_PREFETCHED_MODELDATA.camera_start;
  29717. try {
  29718. Object.keys(n).length > 0 && !l.isEmptyQuaternion(n.camera.quaternion) && (i.mode = h.convertWorkshopModeInt(n.mode),
  29719. i.position = n.camera.position,
  29720. //i.quaternion = n.camera.quaternion,
  29721. i.quaternion = new th.Quaternion().fromArray(n.camera.quaternion),//xzw
  29722. i.zoom = l.convertWorkshopOrthoZoom(n.camera.zoom),
  29723. n.pano && (i.pano = t.get(n.pano.uuid) || t.findClosest(i.position),
  29724. d.debug("Using camera_start"),
  29725. d.debug("Modeldata pano: ", i.pano.quaternion),
  29726. d.debug("Camera start pano: ", n.pano.quaternion)),
  29727. i.mode !== h.PANORAMA && (i.floorVisibility = e.heroImage.metadata.floor_visibility))
  29728. } catch (e) {
  29729. d.warn(e.message)
  29730. if(i.mode == "panorama" && !i.pano)i.pano = t.list[0]
  29731. }
  29732. }
  29733. if (e.outsideAllowed() || i.mode === h.PANORAMA || (i = {}),
  29734. i.mode === h.MESH && i.position && (i.mode = h.PANORAMA,
  29735. i.pano = t.findClosest(i.position),
  29736. i.quaternion = i.pano.quaternion),
  29737. 0 === Object.keys(i).length) {
  29738. var a = t.list[0];
  29739. a && (i.mode = h.PANORAMA,
  29740. i.pano = a,
  29741. i.position = a.position,
  29742. i.quaternion = a.quaternion,
  29743. d.info("Starting at 1st pano " + a.id))
  29744. }
  29745. return i.mode = i.mode || h.DOLLHOUSE,
  29746. i
  29747. }
  29748. function r(e) {
  29749. var t = c.valueFromHash("start", "")
  29750. , i = {};
  29751. if ("" !== t) {
  29752. d.debug("Start override found in parameters, trying to parse..."),
  29753. i = a(t) || {};
  29754. var n = c.valueFromHash("tag", null);
  29755. n && (i.tag = n),
  29756. i.panoId && (i.pano = e.get(i.panoId))
  29757. }
  29758. return i
  29759. }
  29760. function o(e, t) {
  29761. if (!e.heroImage || !e.heroImage.metadata.camera_position)
  29762. return {};
  29763. var i = {}
  29764. , n = e.heroImage.metadata;
  29765. d.debug("Using start position from thumbnail image"),
  29766. i.position = n.camera_position,
  29767. i.quaternion = n.camera_quaternion;
  29768. try {
  29769. i.mode = h.convertWorkshopModeInt(n.camera_mode),
  29770. i.mode === h.PANORAMA ? i.pano = t.get(n.scan_id) : i.floorVisibility = n.floor_visibility
  29771. } catch (e) {
  29772. d.debug(e.message)
  29773. }
  29774. return i
  29775. }
  29776. function a(e) {
  29777. return s.deserialize(e)
  29778. }
  29779. var s = e("../controls/serializer")
  29780. , l = e("../util/math")
  29781. , c = e("./browser")
  29782. , h = e("../enum/Viewmode")
  29783. , u = e("../util/logger")
  29784. , th = e("three")//xzw
  29785. , d = new u(i);
  29786. t.exports = {
  29787. getStartCameraOptions: n
  29788. }
  29789. }
  29790. ).call(this, "/js/util/camera.js")
  29791. }
  29792. , {
  29793. "../controls/serializer": 14,
  29794. "../enum/Viewmode": 51,
  29795. "../util/logger": 189,
  29796. "../util/math": 190,
  29797. "./browser": 182,
  29798. "three": 217
  29799. }],
  29800. 184: [function(e, t, i) {
  29801. "use strict";
  29802. function n(e, t, i) {
  29803. return o(e.fov, t, i)
  29804. }
  29805. var r = e("./MathLight")
  29806. , o = function(e, t, i) {
  29807. var n = t
  29808. , o = i
  29809. , a = 2 * Math.atan(Math.tan(e * r.RADIANS_PER_DEGREE / 2) * (n / o)) * r.DEGREES_PER_RADIAN;
  29810. return a
  29811. }
  29812. , a = function(e, t, i) {
  29813. var n = t
  29814. , o = i
  29815. , a = 2 * Math.atan(Math.tan(e * r.RADIANS_PER_DEGREE / 2) * (o / n)) * r.DEGREES_PER_RADIAN;
  29816. return a
  29817. }
  29818. , s = function(e, t, i, n) {
  29819. var r = o(e, i, n);
  29820. return r > t ? a(t, i, n) : e
  29821. };
  29822. t.exports = {
  29823. clampVFOV: s,
  29824. getHFOVForCamera: n,
  29825. getHFOVFromVFOV: o,
  29826. getVFOVFromHFOV: a
  29827. }
  29828. }
  29829. , {
  29830. "./MathLight": 176
  29831. }],
  29832. 185: [function(e, t, i) {
  29833. "use strict";
  29834. var n = e("three");
  29835. t.exports = {
  29836. delayOneFrame: function(e) {
  29837. window.setTimeout(e, 1)
  29838. },
  29839. normalizeUrl: function(e) {
  29840. return e.replace("https://", "http://")
  29841. },
  29842. domainFromUrl: function(e) {
  29843. var t = /^([^:]*:\/\/)?(www\.)?([^\/]+)/.exec(e);
  29844. return t ? t[3] : e
  29845. },
  29846. average: function(e, t) {
  29847. if (0 === e.length)
  29848. return null;
  29849. for (var i = 0, n = 0, r = 0; r < e.length; r++) {
  29850. var o = t ? e[r][t] : e[r];
  29851. i += o,
  29852. n++
  29853. }
  29854. return i / n
  29855. },
  29856. countUnique: function(e) {
  29857. for (var t = {}, i = 0; i < e.length; i++)
  29858. t[e[i]] = 1 + (t[e[i]] || 0);
  29859. return Object.keys(t).length
  29860. },
  29861. averageVectors: function(e, t) {
  29862. var i = new n.Vector3;
  29863. if (0 === e.length)
  29864. return i;
  29865. for (var r = 0, o = 0; o < e.length; o++) {
  29866. var a = t ? e[o][t] : e[o];
  29867. i.add(a),
  29868. r++
  29869. }
  29870. return i.divideScalar(r)
  29871. },
  29872. equalLists: function(e, t) {
  29873. if (e.length !== t.length)
  29874. return !1;
  29875. for (var i = 0; i < e.length; i++)
  29876. if (e[i] !== t[i])
  29877. return !1;
  29878. return !0
  29879. },
  29880. lowerMedian: function(e, t) {
  29881. if (0 === e.length)
  29882. return null;
  29883. t = t || 2,
  29884. e.sort(function(e, t) {
  29885. return e - t
  29886. });
  29887. var i = Math.floor(e.length / t);
  29888. return e[i]
  29889. },
  29890. stableSort: function(e, t) {
  29891. return e.map(function(e, t) {
  29892. return {
  29893. value: e,
  29894. index: t
  29895. }
  29896. }).sort(function(e, i) {
  29897. var n = t(e.value, i.value);
  29898. return 0 !== n ? n : e.index - i.index
  29899. }).map(function(e) {
  29900. return e.value
  29901. })
  29902. },
  29903. filterAll: function(e, t) {
  29904. return e.filter(function(e) {
  29905. return t.every(function(t) {
  29906. return t(e)
  29907. })
  29908. })
  29909. },
  29910. formatDate: function(e) {
  29911. return [e.getFullYear(), e.getMonth() + 1, e.getDate()].join("-")
  29912. },
  29913. formatDatetime: function(e) {
  29914. return [e.getFullYear(), e.getMonth() + 1, e.getDate(), e.getHours(), e.getMinutes()].join("-")
  29915. },
  29916. randomString: function(e) {
  29917. for (var t = "", i = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", n = 0; n < e; n++)
  29918. t += i.charAt(Math.floor(Math.random() * i.length));
  29919. return t
  29920. },
  29921. uint8ToBase64: function(e, t) {
  29922. t && "number" == typeof t || (t = 8192);
  29923. for (var i = [], n = 0; n < e.length; n += t)
  29924. i.push(String.fromCharCode.apply(null, e.subarray(n, n + t)));
  29925. return btoa(i.join(""))
  29926. },
  29927. uuid4: function e(t) {
  29928. return t ? (t ^ 16 * Math.random() >> t / 4).toString(16) : ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, e)
  29929. },
  29930. nth: function(e) {
  29931. return e %= 10,
  29932. 1 === e ? e + "st" : 2 === e ? e + "nd" : 3 === e ? e + "rd" : e + "th"
  29933. },
  29934. extendObject: function(e, t) {
  29935. return Object.keys(t).forEach(function(i) {
  29936. e[i] = t[i]
  29937. }),
  29938. e
  29939. },
  29940. deepExtend: function e(t) {
  29941. t = t || {};
  29942. for (var i = 1; i < arguments.length; i++) {
  29943. var n = arguments[i];
  29944. if (n)
  29945. for (var r in n)
  29946. n.hasOwnProperty(r) && ("object" == typeof n[r] ? t[r] = e(t[r], n[r]) : t[r] = n[r])
  29947. }
  29948. return t
  29949. },
  29950. inherit: function(e, t) {
  29951. e.prototype = Object.create(t.prototype),
  29952. e.prototype.constructor = e
  29953. },
  29954. extend: function(e, t) {
  29955. for (var i in t.prototype)
  29956. e.prototype[i] = t.prototype[i]
  29957. }
  29958. },
  29959. Math.sign = function(e) {
  29960. return e < 0 ? -1 : 1
  29961. }
  29962. }
  29963. , {
  29964. three: 217
  29965. }],
  29966. 186: [function(e, t, i) {
  29967. "use strict";
  29968. var n = {};
  29969. n.linearTween = function(e, t, i, n) {
  29970. return i * e / n + t
  29971. }
  29972. ,
  29973. n.easeInQuad = function(e, t, i, n) {
  29974. return e /= n,
  29975. i * e * e + t
  29976. }
  29977. ,
  29978. n.easeOutQuad = function(e, t, i, n) {
  29979. return e /= n,
  29980. -i * e * (e - 2) + t
  29981. }
  29982. ,
  29983. n.easeInOutQuad = function(e, t, i, n) {
  29984. return e /= n / 2,
  29985. e < 1 ? i / 2 * e * e + t : (e--,
  29986. -i / 2 * (e * (e - 2) - 1) + t)
  29987. }
  29988. ,
  29989. n.easeInCubic = function(e, t, i, n) {
  29990. return e /= n,
  29991. i * e * e * e + t
  29992. }
  29993. ,
  29994. n.easeOutCubic = function(e, t, i, n) {
  29995. return e /= n,
  29996. e--,
  29997. i * (e * e * e + 1) + t
  29998. }
  29999. ,
  30000. n.easeInOutCubic = function(e, t, i, n) {
  30001. return e /= n / 2,
  30002. e < 1 ? i / 2 * e * e * e + t : (e -= 2,
  30003. i / 2 * (e * e * e + 2) + t)
  30004. }
  30005. ,
  30006. n.easeInQuart = function(e, t, i, n) {
  30007. return e /= n,
  30008. i * e * e * e * e + t
  30009. }
  30010. ,
  30011. n.easeOutQuart = function(e, t, i, n) {
  30012. return e /= n,
  30013. e--,
  30014. -i * (e * e * e * e - 1) + t
  30015. }
  30016. ,
  30017. n.easeInOutQuart = function(e, t, i, n) {
  30018. return e /= n / 2,
  30019. e < 1 ? i / 2 * e * e * e * e + t : (e -= 2,
  30020. -i / 2 * (e * e * e * e - 2) + t)
  30021. }
  30022. ,
  30023. n.easeInQuint = function(e, t, i, n) {
  30024. return e /= n,
  30025. i * e * e * e * e * e + t
  30026. }
  30027. ,
  30028. n.easeOutQuint = function(e, t, i, n) {
  30029. return e /= n,
  30030. e--,
  30031. i * (e * e * e * e * e + 1) + t
  30032. }
  30033. ,
  30034. n.easeInOutQuint = function(e, t, i, n) {
  30035. return e /= n / 2,
  30036. e < 1 ? i / 2 * e * e * e * e * e + t : (e -= 2,
  30037. i / 2 * (e * e * e * e * e + 2) + t)
  30038. }
  30039. ,
  30040. n.easeInSine = function(e, t, i, n) {
  30041. return -i * Math.cos(e / n * (Math.PI / 2)) + i + t
  30042. }
  30043. ,
  30044. n.easeOutSine = function(e, t, i, n) {
  30045. return i * Math.sin(e / n * (Math.PI / 2)) + t
  30046. }
  30047. ,
  30048. n.easeInOutSine = function(e, t, i, n) {
  30049. return -i / 2 * (Math.cos(Math.PI * e / n) - 1) + t
  30050. }
  30051. ,
  30052. n.easeInExpo = function(e, t, i, n) {
  30053. return i * Math.pow(2, 10 * (e / n - 1)) + t
  30054. }
  30055. ,
  30056. n.easeOutExpo = function(e, t, i, n) {
  30057. return i * (-Math.pow(2, -10 * e / n) + 1) + t
  30058. }
  30059. ,
  30060. n.easeInOutExpo = function(e, t, i, n) {
  30061. return e /= n / 2,
  30062. e < 1 ? i / 2 * Math.pow(2, 10 * (e - 1)) + t : (e--,
  30063. i / 2 * (-Math.pow(2, -10 * e) + 2) + t)
  30064. }
  30065. ,
  30066. n.easeInCirc = function(e, t, i, n) {
  30067. return e /= n,
  30068. -i * (Math.sqrt(1 - e * e) - 1) + t
  30069. }
  30070. ,
  30071. n.easeOutCirc = function(e, t, i, n) {
  30072. return e /= n,
  30073. e--,
  30074. i * Math.sqrt(1 - e * e) + t
  30075. }
  30076. ,
  30077. n.easeInOutCirc = function(e, t, i, n) {
  30078. return e /= n / 2,
  30079. e < 1 ? -i / 2 * (Math.sqrt(1 - e * e) - 1) + t : (e -= 2,
  30080. i / 2 * (Math.sqrt(1 - e * e) + 1) + t)
  30081. }
  30082. ,
  30083. n.easeInElastic = function(e, t, i, n) {
  30084. var r = 1.70158
  30085. , o = 0
  30086. , a = i;
  30087. return 0 === e ? t : 1 === (e /= n) ? t + i : (o || (o = .3 * n),
  30088. a < Math.abs(i) ? (a = i,
  30089. r = o / 4) : r = o / (2 * Math.PI) * Math.asin(i / a),
  30090. -(a * Math.pow(2, 10 * (e -= 1)) * Math.sin((e * n - r) * (2 * Math.PI) / o)) + t)
  30091. }
  30092. ,
  30093. n.easeOutElastic = function(e, t, i, n) {
  30094. var r = 1.70158
  30095. , o = 0
  30096. , a = i;
  30097. return 0 === e ? t : 1 === (e /= n) ? t + i : (o || (o = .3 * n),
  30098. a < Math.abs(i) ? (a = i,
  30099. r = o / 4) : r = o / (2 * Math.PI) * Math.asin(i / a),
  30100. a * Math.pow(2, -10 * e) * Math.sin((e * n - r) * (2 * Math.PI) / o) + i + t)
  30101. }
  30102. ,
  30103. n.easeInOutElastic = function(e, t, i, n) {
  30104. var r = 1.70158
  30105. , o = 0
  30106. , a = i;
  30107. return 0 === e ? t : 2 === (e /= n / 2) ? t + i : (o || (o = n * (.3 * 1.5)),
  30108. a < Math.abs(i) ? (a = i,
  30109. r = o / 4) : r = o / (2 * Math.PI) * Math.asin(i / a),
  30110. 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)
  30111. }
  30112. ,
  30113. n.easeInBack = function(e, t, i, n, r) {
  30114. return void 0 === r && (r = 1.70158),
  30115. i * (e /= n) * e * ((r + 1) * e - r) + t
  30116. }
  30117. ,
  30118. n.easeOutBack = function(e, t, i, n, r) {
  30119. return void 0 === r && (r = 1.70158),
  30120. i * ((e = e / n - 1) * e * ((r + 1) * e + r) + 1) + t
  30121. }
  30122. ,
  30123. n.easeInOutBack = function(e, t, i, n, r) {
  30124. return void 0 === r && (r = 1.70158),
  30125. (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
  30126. }
  30127. ,
  30128. n.easeOutBounce = function(e, t, i, n) {
  30129. 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
  30130. }
  30131. ,
  30132. n.easeInBounce = function(e, t, i, r) {
  30133. return i - n.easeOutBounce(r - e, 0, i, r) + t
  30134. }
  30135. ,
  30136. n.easeInOutBounce = function(e, t, i, r) {
  30137. 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
  30138. }
  30139. ,
  30140. t.exports = n
  30141. }
  30142. , {}],
  30143. 187: [function(e, t, i) {
  30144. "use strict";
  30145. function n() {
  30146. this.events = [],
  30147. this.valid = !1
  30148. }
  30149. var r = e("../enum/Joystick");
  30150. n.prototype.push = function(e, t) {
  30151. this.events.push({
  30152. direction: e,
  30153. pano: t
  30154. }),
  30155. this.valid = !0
  30156. }
  30157. ,
  30158. n.prototype.pop = function(e) {
  30159. var t = this.events.pop();
  30160. return this.events.length < 1 && (this.valid = !1),
  30161. t
  30162. }
  30163. ,
  30164. n.prototype.peek = function() {
  30165. return this.events.length ? this.events[this.events.length - 1] : {
  30166. direction: null,
  30167. pano: null
  30168. }
  30169. }
  30170. ,
  30171. n.prototype.invalidate = function() {
  30172. this.events = [],
  30173. this.valid = !1
  30174. }
  30175. ,
  30176. n.prototype.reversePano = function(e) {
  30177. if (!this.valid)
  30178. return null;
  30179. var t = this.peek();
  30180. return r.opposite(e) === t.direction ? (this.pop(),
  30181. t.pano) : null
  30182. }
  30183. ,
  30184. t.exports = n
  30185. }
  30186. , {
  30187. "../enum/Joystick": 29
  30188. }],
  30189. 188: [function(e, t, i) {
  30190. "use strict";
  30191. t.exports = {
  30192. vector: function(e, t) {
  30193. var i = e.clone();
  30194. return t = t.clone(),
  30195. function(n) {
  30196. e.set(i.x * (1 - n) + t.x * n, i.y * (1 - n) + t.y * n, i.z * (1 - n) + t.z * n)
  30197. }
  30198. },
  30199. quaternion: function(e, t) {
  30200. var i = e.clone();
  30201. return function(n) {
  30202. e.copy(i).slerp(t, n)
  30203. }
  30204. },
  30205. property: function(e, t, i, n) {
  30206. var r = e[t];
  30207. return function(o) {
  30208. e[t] = r * (1 - o) + i * o,
  30209. n && n(e[t])
  30210. }
  30211. },
  30212. uniform: function(e, t, i) {
  30213. var n = e.material.uniforms[t].value;
  30214. return function(r) {
  30215. e.material.uniforms[t] && (e.material.uniforms[t].value = n * (1 - r) + i * r)
  30216. }
  30217. },
  30218. matrix4: function(e, t) {
  30219. var i = e.clone();
  30220. return function(n) {
  30221. for (var r = e.elements, o = i.elements, a = t.elements, s = 0; s < 16; s++)
  30222. r[s] = o[s] * (1 - n) + a[s] * n
  30223. }
  30224. },
  30225. allUniforms: function(e, t, i) {
  30226. var n = e.map(function(e) {
  30227. return this.uniform(e, t, i)
  30228. }
  30229. .bind(this));
  30230. return function(e) {
  30231. n.forEach(function(t) {
  30232. t(e)
  30233. })
  30234. }
  30235. }
  30236. }
  30237. }
  30238. , {}],
  30239. 189: [function(e, t, i) {
  30240. "use strict";
  30241. function n(e) {
  30242. var t, i, o, a, s = e.split("/"), l = "[" + s[s.length - 1].replace(".js", "") + "]", c = {};
  30243. if (n.consoleEnabled) {
  30244. var h = function(e) {
  30245. $("#debug-console").append("<p>" + e + "</p>"),
  30246. $("#debug-console")[0].scrollTop = $("#debug-console")[0].scrollHeight
  30247. };
  30248. t = function(e) {
  30249. h(Array.prototype.slice.call(arguments).join(" "))
  30250. }
  30251. ,
  30252. i = function(e) {
  30253. h(Array.prototype.slice.call(arguments).join(" "))
  30254. }
  30255. ,
  30256. o = function(e) {
  30257. h("WARN: " + Array.prototype.slice.call(arguments).join(" "))
  30258. }
  30259. ,
  30260. a = function(e) {
  30261. h("ERROR: " + Array.prototype.slice.call(arguments).join(" "))
  30262. }
  30263. } else
  30264. console.log ? (t = console.log,
  30265. i = console.info ? console.info : console.log,
  30266. o = console.warn ? console.warn : console.log,
  30267. a = console.error ? console.error : console.log) : t = i = o = a = function() {}
  30268. ;
  30269. var u = function(e) {
  30270. return [l, n.timestamp()].concat(Array.prototype.slice.call(e))
  30271. }
  30272. , d = function(t, i) {
  30273. if (r) {
  30274. var o = Array.prototype.slice.call(t).join(" ");
  30275. r.captureMessage(o, {
  30276. level: i,
  30277. path: e,
  30278. timestamp: n.timestamp()
  30279. })
  30280. }
  30281. }
  30282. , p = function(t, i) {
  30283. if (r) {
  30284. var o = Array.prototype.slice.call(t).join(" ");
  30285. r.captureException(new Error(o), {
  30286. level: i,
  30287. path: e,
  30288. timestamp: n.timestamp()
  30289. })
  30290. }
  30291. };
  30292. return {
  30293. debug: function() {
  30294. n.level >= n.levels.debug && t.apply(console, u(arguments))
  30295. },
  30296. info: function() {
  30297. n.level >= n.levels.info && i.apply(console, u(arguments))
  30298. },
  30299. warn: function() {
  30300. d(arguments, "warn"),
  30301. n.level >= n.levels.warn && o.apply(console, u(arguments))
  30302. },
  30303. error: function() {
  30304. p(arguments, "error"),
  30305. n.level >= n.levels.error && a.apply(console, u(arguments))
  30306. },
  30307. v3str: function(e, t) {
  30308. var i = void 0 === t ? 2 : t;
  30309. return "(" + e.x.toPrecision(i) + ", " + e.y.toPrecision(i) + ", " + e.z.toPrecision(i) + ")"
  30310. },
  30311. eulstr: function(e, t) {
  30312. var i = void 0 === t ? 2 : t;
  30313. return "(" + THREE.Math.radToDeg(e.x).toPrecision(i) + ", " + THREE.Math.radToDeg(e.y).toPrecision(i) + ", " + THREE.Math.radToDeg(e.z).toPrecision(i) + ' "' + e.order + '")'
  30314. },
  30315. time: function(e) {
  30316. n.level >= n.levels.debug && (c[e] = Date.now())
  30317. },
  30318. timeEnd: function(e) {
  30319. if (n.level >= n.levels.debug) {
  30320. var t = c[e];
  30321. if (!t)
  30322. return;
  30323. var i = (Date.now() - t) / 1e3;
  30324. this.debug(e, i + "s")
  30325. }
  30326. }
  30327. }
  30328. }
  30329. var r = window.Raven;
  30330. n.timestamp = function() {
  30331. return (Date.now() - window.navigationStart) / 1e3 + "s"
  30332. }
  30333. ,
  30334. n.levels = {
  30335. debug: 3,
  30336. info: 2,
  30337. warn: 1,
  30338. error: 0
  30339. },
  30340. n.level = n.levels.info,
  30341. t.exports = n
  30342. }
  30343. , {}],
  30344. 190: [function(e, t, i) {
  30345. "use strict";
  30346. var n = e("three")
  30347. , r = e("../enum/GLCubeFaces")
  30348. , o = e("../constants");
  30349. t.exports = {
  30350. convertVisionVector: function(e) {
  30351. return new n.Vector3(e.x,e.z,-e.y)
  30352. },
  30353. convertVisionQuaternion: function(e) {
  30354. 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)))
  30355. },
  30356. convertWorkshopVector: function(e) {
  30357. return new n.Vector3(-e.x,e.y,e.z)
  30358. },
  30359. convertWorkshopQuaternion: function(e) {
  30360. 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))
  30361. },
  30362. convertWorkshopPanoramaQuaternion: function(e) {
  30363. 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)))
  30364. },
  30365. convertWorkshopOrthoZoom: function(e) {// xzw
  30366. //return e === -1 ? -1 : e / 16 * ($("#player").width() / $("#player").height()) / o.workshopApsect
  30367. //return e;
  30368. return e === -1 ? -1 : e * ($("#player").width() / $("#player").height()) / g_snapShotWidth * g_snapShotHeight;
  30369. },
  30370. toPrecision: function(e, t) {//xzw change
  30371. var f = function(e, t){
  30372. var i = Math.pow(10, t);
  30373. return Math.round(e * i) / i
  30374. }
  30375. if(e instanceof Array){
  30376. for(var s=0; s<e.length; s++){
  30377. e[s] = f(e[s],t);
  30378. }
  30379. return e;
  30380. }
  30381. else return f(e,t)
  30382. },
  30383. isEmptyQuaternion: function(e) {
  30384. return 0 === Math.abs(e.x) && 0 === Math.abs(e.y) && 0 === Math.abs(e.z) && 0 === Math.abs(e.w)
  30385. },
  30386. projectPositionToCanvas: function(e, t, i) {
  30387. i = i || new n.Vector3,
  30388. i.copy(e);
  30389. var r = .5 * $("#player").width()
  30390. , o = .5 * $("#player").height();
  30391. return i.project(t),
  30392. i.x = i.x * r + r,
  30393. i.y = -(i.y * o) + o,
  30394. i
  30395. },
  30396. convertScreenPositionToNDC: function(e, t, i) {
  30397. return i = i || new n.Vector2,
  30398. i.x = e / $("#player").width() * 2 - 1,
  30399. i.y = 2 * -(t / $("#player").height()) + 1,
  30400. i
  30401. },
  30402. constrainedTurn: function(e) {
  30403. var t = e % (2 * Math.PI);
  30404. return t = t > Math.PI ? t -= 2 * Math.PI : t < -Math.PI ? t += 2 * Math.PI : t
  30405. },
  30406. getFOVDotThreshold: function(e) {
  30407. return Math.cos(n.Math.degToRad(e / 2))
  30408. },
  30409. transform2DForwardVectorByCubeFace: function(e, t, i, n) {
  30410. switch (e) {
  30411. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  30412. i.set(1, t.y, t.x);
  30413. break;
  30414. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  30415. i.set(-1, t.y, -t.x);
  30416. break;
  30417. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  30418. i.set(-t.x, 1, -t.y);
  30419. break;
  30420. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  30421. i.set(-t.x, -1, t.y);
  30422. break;
  30423. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  30424. i.set(-t.x, t.y, 1);
  30425. break;
  30426. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  30427. i.set(t.x, t.y, -1)
  30428. }
  30429. n && i.normalize()
  30430. },
  30431. //add:
  30432. getPos2d : function(point, camera, dom){
  30433. var camera = camera ;
  30434. var dom = dom;
  30435. var pos = point.clone().project(camera) //比之前hotspot的计算方式写得简单 project用于3转2(求法同shader); unproject用于2转3 :new r.Vector3(e.x, e.y, -1).unproject(this.camera);
  30436. var x,y;
  30437. x = (pos.x + 1) / 2 * dom.clientWidth;
  30438. y = (1 - (pos.y + 1) / 2) * dom.clientHeight;
  30439. var inSight = x <= dom.clientWidth && x >= 0
  30440. && y <= dom.clientHeight && y >= 0
  30441. return {
  30442. pos: new THREE.Vector2(x,y),
  30443. vector: pos,
  30444. trueSide : pos.z<1, //trueSide为false时,即使在屏幕范围内可见,也是反方向的另一个不可以被渲染的点 参见Tag.update
  30445. inSight : inSight //在屏幕范围内可见
  30446. };
  30447. }
  30448. }
  30449. }
  30450. , {
  30451. "../constants": 8,
  30452. "../enum/GLCubeFaces": 25,
  30453. three: 217
  30454. }],
  30455. 191: [function(e, t, i) {
  30456. "use strict";
  30457. function n(e, t, i) {
  30458. return a.map(function(n, o) {
  30459. return e.get("pan/" + i + "/" + t + "_skybox" + r(n) + ".jpg")
  30460. }
  30461. .bind(this))
  30462. }
  30463. function r(e) {
  30464. return s[e]
  30465. }
  30466. var o = e("../enum/GLCubeFaces")
  30467. , a = [0, 1, 2, 3, 4, 5]
  30468. , s = {
  30469. 0: o.GL_TEXTURE_CUBE_MAP_POSITIVE_Y,
  30470. 1: o.GL_TEXTURE_CUBE_MAP_POSITIVE_Z,
  30471. 2: o.GL_TEXTURE_CUBE_MAP_POSITIVE_X,
  30472. 3: o.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,
  30473. 4: o.GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
  30474. 5: o.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
  30475. };
  30476. t.exports = {
  30477. mapFaceToCubemapFace: r,
  30478. getCubemapUrls: n
  30479. }
  30480. }
  30481. , {
  30482. "../enum/GLCubeFaces": 25
  30483. }],
  30484. 192: [function(e, t, i) {
  30485. "use strict";
  30486. t.exports = {
  30487. captureErrors: function(e, t, i) {
  30488. if ("Raven"in window) {
  30489. Raven.config(e, t).install(),
  30490. i && Raven.setTagsContext(i);
  30491. var n = console.warn
  30492. , r = console.error;
  30493. console.warn = function() {
  30494. var e = Array.prototype.slice.call(arguments);
  30495. Raven.captureMessage(e.join(" "), {
  30496. level: "warning"
  30497. }),
  30498. n.apply(console, e)
  30499. }
  30500. ,
  30501. console.error = function() {
  30502. var e = Array.prototype.slice.call(arguments);
  30503. Raven.captureException(new Error(e.join(" ")), {
  30504. level: "error"
  30505. }),
  30506. r.apply(console, e)
  30507. }
  30508. } else
  30509. console.error("Raven not found, not capturing errors.")
  30510. }
  30511. }
  30512. }
  30513. , {}],
  30514. 193: [function(e, t, i) {
  30515. (function(i) {
  30516. "use strict";
  30517. var n = e("./browser")
  30518. , r = e("../constants")
  30519. , o = e("url")
  30520. , a = e("./logger")
  30521. , ss = e('three')
  30522. , s = new a(i)
  30523. , l = {
  30524. getAuthorizationHeader: function() {
  30525. var e = n.valueFromHash("auth");
  30526. if (e)
  30527. return e.replace(",", " ");
  30528. var t = n.valueFromCookie("token");
  30529. return t ? "Token " + t : null
  30530. },
  30531. parseSidUrl: function(e) {
  30532. var t, i;
  30533. t=g_Prefix;
  30534. if (e = e || "",
  30535. e.match(/^https?/)) {
  30536. var n = o.parse(e);
  30537. t = g_Prefix,
  30538. i = e
  30539. } else{
  30540. //xzw 原先的不能用
  30541. //t = window.location.protocol + "//" + window.location.host, //MP
  30542. t = g_Prefix
  30543. //i = t + "/api/player/models/" + e; //MP
  30544. i = t + "data/" + e;
  30545. }
  30546. return {
  30547. urlBase: t,
  30548. urlModel: i,
  30549. urlFiles: i + (i.match(/\/$/) ? "files" : "/files"),
  30550. urlThumb: i + (i.match(/\/$/) ? "thumb" : "/thumb")
  30551. }
  30552. },
  30553. getModelIDFromQueryString: function() {
  30554. return n.valueFromHash("model") || n.valueFromHash("m")
  30555. },
  30556. /* normalizeModeldata: function(e, t) {//xzw 修改导览images数据
  30557. e = JSON.parse(JSON.stringify(e));
  30558. var i = null;
  30559. if (e.images.forEach(function(n) {
  30560. if(!n.metadata) return;
  30561. if ("string" == typeof n.metadata)
  30562. try {
  30563. n.metadata = JSON.parse(n.metadata)
  30564. } catch (e) {
  30565. s.warn("Unable to parse image metadata"),
  30566. n.metadata = null
  30567. }
  30568. else{
  30569. "object" == typeof n.metadata && s.debug("image.metadata already a JSON object");
  30570. }
  30571. if(n.metadata.camera_position instanceof Array){//xzw 改的格式
  30572. n.metadata.camera_position = new ss.Vector3().fromArray(n.metadata.camera_position);
  30573. n.metadata.camera_quaternion = new ss.Quaternion().fromArray(n.metadata.camera_quaternion);
  30574. }else{
  30575. n.metadata.camera_quaternion && (n.metadata.camera_quaternion = t.convertWorkshopQuaternion(n.metadata.camera_quaternion)),
  30576. n.metadata.camera_position && (n.metadata.camera_position = t.convertWorkshopVector(n.metadata.camera_position))
  30577. n.metadata.zoom = n.metadata.zoom || 1;
  30578. }
  30579. !i && e.icon && e.icon === n.sid && (i = n.metadata)
  30580. }),
  30581. //icon初始视角的:
  30582. i && i.camera_quaternion && i.camera_position && i.scan_position && i.scan_quaternion) {
  30583. var n = {};
  30584. n.pano = {
  30585. quaternion: t.convertWorkshopPanoramaQuaternion(i.scan_quaternion),
  30586. position: t.convertWorkshopVector(i.scan_position),
  30587. uuid: i.scan_id
  30588. },
  30589. n.camera = {
  30590. quaternion: i.camera_quaternion,
  30591. position: i.camera_position
  30592. },
  30593. e.startPano = n
  30594. }
  30595. return e
  30596. },
  30597. */
  30598. normalizeModeldata: function(e, t) {//xzw 修改导览images数据
  30599. e = JSON.parse(JSON.stringify(e));
  30600. var i = null;
  30601. if (e.images.forEach(function(n) {
  30602. if(!n.metadata) return;
  30603. if ("string" == typeof n.metadata)
  30604. try {
  30605. n.metadata = JSON.parse(n.metadata)
  30606. } catch (e) {
  30607. s.warn("Unable to parse image metadata"),
  30608. n.metadata = null
  30609. }
  30610. else{
  30611. "object" == typeof n.metadata && s.debug("image.metadata already a JSON object");
  30612. }
  30613. if(n.metadata.camera_position instanceof Array){//xzw 改的格式
  30614. n.metadata.camera_position = new ss.Vector3().fromArray(n.metadata.camera_position);
  30615. n.metadata.camera_quaternion = new ss.Quaternion().fromArray(n.metadata.camera_quaternion);
  30616. }else{
  30617. n.metadata.camera_position = new ss.Vector3().copy(n.metadata.camera_position)
  30618. n.metadata.camera_quaternion = new ss.Quaternion().copy(n.metadata.camera_quaternion)
  30619. /* n.metadata.camera_quaternion && (n.metadata.camera_quaternion = t.convertWorkshopQuaternion(n.metadata.camera_quaternion)),
  30620. n.metadata.camera_position && (n.metadata.camera_position = t.convertWorkshopVector(n.metadata.camera_position)) */
  30621. }
  30622. !i && e.icon && e.icon === n.sid && (i = n.metadata)
  30623. }),
  30624. //icon初始视角的:
  30625. i && i.camera_quaternion && i.camera_position && i.scan_position && i.scan_quaternion) {
  30626. var n = {};
  30627. n.pano = {
  30628. quaternion: t.convertWorkshopPanoramaQuaternion(i.scan_quaternion),
  30629. position: t.convertWorkshopVector(i.scan_position),
  30630. uuid: i.scan_id
  30631. },
  30632. n.camera = {
  30633. quaternion: i.camera_quaternion,
  30634. position: i.camera_position
  30635. },
  30636. e.startPano = n
  30637. }
  30638. return e
  30639. },
  30640. visionVersionToInt: function() {
  30641. var e = new RegExp(["(?:[0-9.]+\\.){1,4}", "([0-9]+)", "[^\\.]*$"].join(""));
  30642. return function(t) {
  30643. if (!t)
  30644. throw new Error("Vision version is required");
  30645. var i = e.exec(t);
  30646. if (null === i)
  30647. throw new Error("String is not a vision version: " + t);
  30648. return parseInt(i[1])
  30649. }
  30650. }(),
  30651. modelDataPromisesTiles: function(e) {
  30652. var vision_version = e.vision_version || window.MP_PREFETCHED_MODELDATA.vision_version
  30653. if (vision_version)
  30654. try {
  30655. return l.visionVersionToInt(vision_version) >= l.visionVersionToInt(r.visionTilingStartVersion)
  30656. } catch (t) {
  30657. s.warn("Invalid vision version: " + vision_version)
  30658. }
  30659. // var t = e.created ? new Date(e.created) : null;
  30660. // return t && t >= r.visionTilingStartDate
  30661. return false
  30662. }
  30663. };
  30664. t.exports = l
  30665. }
  30666. ).call(this, "/js/util/showcase.js")
  30667. }
  30668. , {
  30669. "../constants": 8,
  30670. "./browser": 182,
  30671. "./logger": 189,
  30672. three:217,
  30673. url: 208
  30674. }],
  30675. 194: [function(e, t, i) {
  30676. "use strict";
  30677. var n = e("../util/ajax")
  30678. , r = e("three")
  30679. , o = e("../settings")
  30680. , a = {};
  30681. t.exports = {
  30682. load: function(e, t, i) {
  30683. var s = a[e];
  30684. return s ? (t && setTimeout(function() {
  30685. t(s)
  30686. }, 1),
  30687. s) : (s = new r.Texture,
  30688. o.minimalMemoryMode && (s.minFilter = r.LinearFilter,
  30689. s.magFilter = r.LinearFilter,
  30690. s.generateMipmaps = !1),
  30691. s.sourceFile = e,
  30692. a[e] = s,
  30693. n.getImage(e).then(function(e) {
  30694. s.image = e,
  30695. s.needsUpdate = !0,
  30696. t && t(s)
  30697. }).fail(i),
  30698. s)
  30699. },
  30700. loadBase64: function(e, t) {
  30701. t = t || "png";
  30702. var i = new r.Texture;
  30703. return i.image = document.createElement("img"),
  30704. i.image.setAttribute("src", "data:image/" + t + ";base64," + e),
  30705. o.minimalMemoryMode && (i.minFilter = r.LinearFilter,
  30706. i.magFilter = r.LinearFilter,
  30707. i.generateMipmaps = !1),
  30708. i.needsUpdate = !0,
  30709. i
  30710. },
  30711. isLoaded: function(e) {
  30712. return !!a[e]
  30713. }
  30714. }
  30715. window.Texture = t.exports
  30716. }
  30717. , {
  30718. "../settings": 166,
  30719. "../util/ajax": 181,
  30720. three: 217
  30721. }],
  30722. 195: [function(e, t, i) {
  30723. "use strict";
  30724. var n = e("./easing");
  30725. t.exports = {
  30726. globalDone: null,
  30727. funcs: [],
  30728. counter: 0,
  30729. uniqueID: 0,
  30730. start: function(e, t, i, r, o, a, s) {
  30731. return r = r || 0,
  30732. this.funcs.push({
  30733. func: e,
  30734. current: -r * Math.abs(t),
  30735. duration: (1 - Math.max(r, 0)) * Math.abs(t),
  30736. done: i,
  30737. easing: o || n.linearTween,
  30738. cycling: t < 0,
  30739. running: !0,
  30740. debug: r < 0,
  30741. name: a || "T" + this.counter,
  30742. id: void 0 === s ? this.counter : s,
  30743. paused: !1
  30744. }),
  30745. e(0, 16),
  30746. this.counter += 1,
  30747. e
  30748. },
  30749. trigger: function(e) {
  30750. var t = void 0 === e.delayRatio ? 0 : e.delayRatio
  30751. , i = e.func || function() {}
  30752. , r = void 0 === e.duration ? 0 : e.duration;
  30753. void 0 !== e.cycling && e.cycling && (r = -Math.abs(r));
  30754. var o = e.done || null
  30755. , a = e.easing || n.linearTween
  30756. , s = e.name || "R" + this.counter
  30757. , l = void 0 === e.id ? this.counter : e.id;
  30758. return this.start(i, r, o, t, a, s, l)
  30759. },
  30760. setTimeout: function(e, t, i) {
  30761. var n = void 0 === i ? this.counter : i;
  30762. return this.trigger({
  30763. done: e,
  30764. duration: void 0 === t ? 0 : t,
  30765. name: "O" + this.counter,
  30766. id: n
  30767. })
  30768. },
  30769. pause: function() {
  30770. this.paused = !0
  30771. },
  30772. resume: function() {
  30773. this.paused = !1
  30774. },
  30775. update: function(e) {
  30776. this.funcs.forEach(function(t) {
  30777. if (!(t.paused || (t.current += 1e3 * e,
  30778. t.current < 0)))
  30779. if (t.current >= t.duration && !t.cycling) {
  30780. var i = t.easing(1, 0, 1, 1);
  30781. t.func(i, 1e3 * e),
  30782. t.done && t.done(),
  30783. t.running = !1
  30784. } else {
  30785. var n = t.easing(t.current % t.duration / t.duration, 0, 1, 1)
  30786. , r = t.func(n, 1e3 * e) || !1;
  30787. r && (t.done && t.done(),
  30788. t.running = !1)
  30789. }
  30790. });
  30791. var t = this.funcs.length;
  30792. this.funcs = this.funcs.filter(function(e) {
  30793. return e.running
  30794. });
  30795. var i = this.funcs.length;
  30796. if (t > 0 && 0 === i && this.globalDone) {
  30797. var n = this.globalDone;
  30798. this.globalDone = null,
  30799. n()
  30800. }
  30801. },
  30802. adjustSpeed: function(e, t) {
  30803. for (var i = this.getById(e), n = 0; n < i.length; n++) {
  30804. var r = i[n];
  30805. r.duration /= t,
  30806. r.current /= t
  30807. }
  30808. },
  30809. getById: function(e) {
  30810. return this.funcs.filter(function(t) {
  30811. return e === t.id
  30812. })
  30813. },
  30814. get: function(e) {
  30815. for (var t = 0; t < this.funcs.length; t += 1)
  30816. if (this.funcs[t].func === e)
  30817. return this.funcs[t];
  30818. return null
  30819. },
  30820. isRunning: function(e) {
  30821. var t = this.get(e);
  30822. return null !== t && t.running
  30823. },
  30824. countActive: function() {
  30825. for (var e = 0, t = 0; t < this.funcs.length; t += 1)
  30826. e += this.funcs[t].running;
  30827. return e
  30828. },
  30829. listActive: function() {
  30830. for (var e = [], t = 0; t < this.funcs.length; t += 1)
  30831. this.funcs[t].running && e.push(this.funcs[t].name);
  30832. return e
  30833. },
  30834. done: function(e) {
  30835. this.globalDone = e
  30836. },
  30837. cancelById: function(e) {
  30838. var t = void 0 === e ? 0 : e;
  30839. this.funcs = this.funcs.filter(function(e) {
  30840. return e.id !== t
  30841. })
  30842. },
  30843. cancel: function(e) {
  30844. this.funcs = this.funcs.filter(function(t) {
  30845. return t.func !== e
  30846. })
  30847. },
  30848. getUniqueId: function() {
  30849. return this.uniqueID -= 1,
  30850. this.uniqueID
  30851. }
  30852. }
  30853. }
  30854. , {
  30855. "./easing": 186
  30856. }],
  30857. 196: [function(e, t, i) {
  30858. function n(e) {
  30859. if (this.set = {},
  30860. this.infContains = function() {
  30861. return !0
  30862. }
  30863. ,
  30864. "object" == typeof e)
  30865. if (e instanceof Array)
  30866. for (var t = 0; t < e.length; t++)
  30867. this.set[e[t]] = !0;
  30868. else
  30869. this.set = e;
  30870. else if ("function" == typeof e)
  30871. this.infContains = e;
  30872. else if ("undefined" != typeof e)
  30873. throw new Error("set must be either an array or an object.")
  30874. }
  30875. t.exports = n,
  30876. n.prototype.contains = function(e) {
  30877. return !!this.set[e]
  30878. }
  30879. ,
  30880. n.prototype.has = n.prototype.contains,
  30881. n.prototype.add = function(e) {
  30882. if (1 == arguments.length)
  30883. this.set[e] = !0;
  30884. else
  30885. for (var t = 0; t < arguments.length; t++)
  30886. this.set[arguments[t]] = !0
  30887. }
  30888. ,
  30889. n.prototype.addAll = function(e) {
  30890. if ("object" != typeof e && !(e instanceof Array))
  30891. throw new Error("arr must be an array.");
  30892. for (var t = 0; t < e.length; t++)
  30893. this.add(e[t])
  30894. }
  30895. ,
  30896. n.prototype.remove = function(e) {
  30897. if (1 == arguments.length)
  30898. delete this.set[e];
  30899. else
  30900. for (var t = 0; t < arguments.length; t++)
  30901. delete this.set[arguments[t]]
  30902. }
  30903. ,
  30904. n.prototype.delete = n.prototype.remove,
  30905. n.prototype.clear = function() {
  30906. this.set = {}
  30907. }
  30908. ,
  30909. n.prototype.size = function() {
  30910. return Object.keys(this.set).length
  30911. }
  30912. ,
  30913. n.prototype.toString = function() {
  30914. return "{" + Object.keys(this.set).toString() + "}"
  30915. }
  30916. ,
  30917. n.prototype.toArray = function() {
  30918. return "undefined" == typeof this.set ? [] : Object.keys(this.set)
  30919. }
  30920. ,
  30921. n.prototype["*values"] = n.prototype.toArray
  30922. }
  30923. , {}],
  30924. 197: [function(e, t, i) {}
  30925. , {}],
  30926. 198: [function(e, t, i) {
  30927. (function(t) {
  30928. "use strict";
  30929. function n() {
  30930. try {
  30931. var e = new Uint8Array(1);
  30932. return e.__proto__ = {
  30933. __proto__: Uint8Array.prototype,
  30934. foo: function() {
  30935. return 42
  30936. }
  30937. },
  30938. 42 === e.foo() && "function" == typeof e.subarray && 0 === e.subarray(1, 1).byteLength
  30939. } catch (e) {
  30940. return !1
  30941. }
  30942. }
  30943. function r() {
  30944. return a.TYPED_ARRAY_SUPPORT ? 2147483647 : 1073741823
  30945. }
  30946. function o(e, t) {
  30947. if (r() < t)
  30948. throw new RangeError("Invalid typed array length");
  30949. return a.TYPED_ARRAY_SUPPORT ? (e = new Uint8Array(t),
  30950. e.__proto__ = a.prototype) : (null === e && (e = new a(t)),
  30951. e.length = t),
  30952. e
  30953. }
  30954. function a(e, t, i) {
  30955. if (!(a.TYPED_ARRAY_SUPPORT || this instanceof a))
  30956. return new a(e,t,i);
  30957. if ("number" == typeof e) {
  30958. if ("string" == typeof t)
  30959. throw new Error("If encoding is specified then the first argument must be a string");
  30960. return h(this, e)
  30961. }
  30962. return s(this, e, t, i)
  30963. }
  30964. function s(e, t, i, n) {
  30965. if ("number" == typeof t)
  30966. throw new TypeError('"value" argument must not be a number');
  30967. return "undefined" != typeof ArrayBuffer && t instanceof ArrayBuffer ? p(e, t, i, n) : "string" == typeof t ? u(e, t, i) : f(e, t)
  30968. }
  30969. function l(e) {
  30970. if ("number" != typeof e)
  30971. throw new TypeError('"size" argument must be a number');
  30972. if (e < 0)
  30973. throw new RangeError('"size" argument must not be negative')
  30974. }
  30975. function c(e, t, i, n) {
  30976. return l(t),
  30977. 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)
  30978. }
  30979. function h(e, t) {
  30980. if (l(t),
  30981. e = o(e, t < 0 ? 0 : 0 | g(t)),
  30982. !a.TYPED_ARRAY_SUPPORT)
  30983. for (var i = 0; i < t; ++i)
  30984. e[i] = 0;
  30985. return e
  30986. }
  30987. function u(e, t, i) {
  30988. if ("string" == typeof i && "" !== i || (i = "utf8"),
  30989. !a.isEncoding(i))
  30990. throw new TypeError('"encoding" must be a valid string encoding');
  30991. var n = 0 | v(t, i);
  30992. e = o(e, n);
  30993. var r = e.write(t, i);
  30994. return r !== n && (e = e.slice(0, r)),
  30995. e
  30996. }
  30997. function d(e, t) {
  30998. var i = t.length < 0 ? 0 : 0 | g(t.length);
  30999. e = o(e, i);
  31000. for (var n = 0; n < i; n += 1)
  31001. e[n] = 255 & t[n];
  31002. return e
  31003. }
  31004. function p(e, t, i, n) {
  31005. if (t.byteLength,
  31006. i < 0 || t.byteLength < i)
  31007. throw new RangeError("'offset' is out of bounds");
  31008. if (t.byteLength < i + (n || 0))
  31009. throw new RangeError("'length' is out of bounds");
  31010. return t = void 0 === i && void 0 === n ? new Uint8Array(t) : void 0 === n ? new Uint8Array(t,i) : new Uint8Array(t,i,n),
  31011. a.TYPED_ARRAY_SUPPORT ? (e = t,
  31012. e.__proto__ = a.prototype) : e = d(e, t),
  31013. e
  31014. }
  31015. function f(e, t) {
  31016. if (a.isBuffer(t)) {
  31017. var i = 0 | g(t.length);
  31018. return e = o(e, i),
  31019. 0 === e.length ? e : (t.copy(e, 0, 0, i),
  31020. e)
  31021. }
  31022. if (t) {
  31023. if ("undefined" != typeof ArrayBuffer && t.buffer instanceof ArrayBuffer || "length"in t)
  31024. return "number" != typeof t.length || K(t.length) ? o(e, 0) : d(e, t);
  31025. if ("Buffer" === t.type && $(t.data))
  31026. return d(e, t.data)
  31027. }
  31028. throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")
  31029. }
  31030. function g(e) {
  31031. if (e >= r())
  31032. throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + r().toString(16) + " bytes");
  31033. return 0 | e
  31034. }
  31035. function m(e) {
  31036. return +e != e && (e = 0),
  31037. a.alloc(+e)
  31038. }
  31039. function v(e, t) {
  31040. if (a.isBuffer(e))
  31041. return e.length;
  31042. if ("undefined" != typeof ArrayBuffer && "function" == typeof ArrayBuffer.isView && (ArrayBuffer.isView(e) || e instanceof ArrayBuffer))
  31043. return e.byteLength;
  31044. "string" != typeof e && (e = "" + e);
  31045. var i = e.length;
  31046. if (0 === i)
  31047. return 0;
  31048. for (var n = !1; ; )
  31049. switch (t) {
  31050. case "ascii":
  31051. case "latin1":
  31052. case "binary":
  31053. return i;
  31054. case "utf8":
  31055. case "utf-8":
  31056. case void 0:
  31057. return j(e).length;
  31058. case "ucs2":
  31059. case "ucs-2":
  31060. case "utf16le":
  31061. case "utf-16le":
  31062. return 2 * i;
  31063. case "hex":
  31064. return i >>> 1;
  31065. case "base64":
  31066. return Z(e).length;
  31067. default:
  31068. if (n)
  31069. return j(e).length;
  31070. t = ("" + t).toLowerCase(),
  31071. n = !0
  31072. }
  31073. }
  31074. function A(e, t, i) {
  31075. var n = !1;
  31076. if ((void 0 === t || t < 0) && (t = 0),
  31077. t > this.length)
  31078. return "";
  31079. if ((void 0 === i || i > this.length) && (i = this.length),
  31080. i <= 0)
  31081. return "";
  31082. if (i >>>= 0,
  31083. t >>>= 0,
  31084. i <= t)
  31085. return "";
  31086. for (e || (e = "utf8"); ; )
  31087. switch (e) {
  31088. case "hex":
  31089. return L(this, t, i);
  31090. case "utf8":
  31091. case "utf-8":
  31092. return M(this, t, i);
  31093. case "ascii":
  31094. return P(this, t, i);
  31095. case "latin1":
  31096. case "binary":
  31097. return O(this, t, i);
  31098. case "base64":
  31099. return S(this, t, i);
  31100. case "ucs2":
  31101. case "ucs-2":
  31102. case "utf16le":
  31103. case "utf-16le":
  31104. return D(this, t, i);
  31105. default:
  31106. if (n)
  31107. throw new TypeError("Unknown encoding: " + e);
  31108. e = (e + "").toLowerCase(),
  31109. n = !0
  31110. }
  31111. }
  31112. function y(e, t, i) {
  31113. var n = e[t];
  31114. e[t] = e[i],
  31115. e[i] = n
  31116. }
  31117. function C(e, t, i, n, r) {
  31118. if (0 === e.length)
  31119. return -1;
  31120. if ("string" == typeof i ? (n = i,
  31121. i = 0) : i > 2147483647 ? i = 2147483647 : i < -2147483648 && (i = -2147483648),
  31122. i = +i,
  31123. isNaN(i) && (i = r ? 0 : e.length - 1),
  31124. i < 0 && (i = e.length + i),
  31125. i >= e.length) {
  31126. if (r)
  31127. return -1;
  31128. i = e.length - 1
  31129. } else if (i < 0) {
  31130. if (!r)
  31131. return -1;
  31132. i = 0
  31133. }
  31134. if ("string" == typeof t && (t = a.from(t, n)),
  31135. a.isBuffer(t))
  31136. return 0 === t.length ? -1 : I(e, t, i, n, r);
  31137. if ("number" == typeof t)
  31138. return t &= 255,
  31139. 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);
  31140. throw new TypeError("val must be string, number or Buffer")
  31141. }
  31142. function I(e, t, i, n, r) {
  31143. function o(e, t) {
  31144. return 1 === a ? e[t] : e.readUInt16BE(t * a)
  31145. }
  31146. var a = 1
  31147. , s = e.length
  31148. , l = t.length;
  31149. if (void 0 !== n && (n = String(n).toLowerCase(),
  31150. "ucs2" === n || "ucs-2" === n || "utf16le" === n || "utf-16le" === n)) {
  31151. if (e.length < 2 || t.length < 2)
  31152. return -1;
  31153. a = 2,
  31154. s /= 2,
  31155. l /= 2,
  31156. i /= 2
  31157. }
  31158. var c;
  31159. if (r) {
  31160. var h = -1;
  31161. for (c = i; c < s; c++)
  31162. if (o(e, c) === o(t, h === -1 ? 0 : c - h)) {
  31163. if (h === -1 && (h = c),
  31164. c - h + 1 === l)
  31165. return h * a
  31166. } else
  31167. h !== -1 && (c -= c - h),
  31168. h = -1
  31169. } else
  31170. for (i + l > s && (i = s - l),
  31171. c = i; c >= 0; c--) {
  31172. for (var u = !0, d = 0; d < l; d++)
  31173. if (o(e, c + d) !== o(t, d)) {
  31174. u = !1;
  31175. break
  31176. }
  31177. if (u)
  31178. return c
  31179. }
  31180. return -1
  31181. }
  31182. function E(e, t, i, n) {
  31183. i = Number(i) || 0;
  31184. var r = e.length - i;
  31185. n ? (n = Number(n),
  31186. n > r && (n = r)) : n = r;
  31187. var o = t.length;
  31188. if (o % 2 !== 0)
  31189. throw new TypeError("Invalid hex string");
  31190. n > o / 2 && (n = o / 2);
  31191. for (var a = 0; a < n; ++a) {
  31192. var s = parseInt(t.substr(2 * a, 2), 16);
  31193. if (isNaN(s))
  31194. return a;
  31195. e[i + a] = s
  31196. }
  31197. return a
  31198. }
  31199. function b(e, t, i, n) {
  31200. return q(j(t, e.length - i), e, i, n)
  31201. }
  31202. function w(e, t, i, n) {
  31203. return q(Y(t), e, i, n)
  31204. }
  31205. function _(e, t, i, n) {
  31206. return w(e, t, i, n)
  31207. }
  31208. function T(e, t, i, n) {
  31209. return q(Z(t), e, i, n)
  31210. }
  31211. function x(e, t, i, n) {
  31212. return q(X(t, e.length - i), e, i, n)
  31213. }
  31214. function S(e, t, i) {
  31215. return 0 === t && i === e.length ? Q.fromByteArray(e) : Q.fromByteArray(e.slice(t, i))
  31216. }
  31217. function M(e, t, i) {
  31218. i = Math.min(e.length, i);
  31219. for (var n = [], r = t; r < i; ) {
  31220. var o = e[r]
  31221. , a = null
  31222. , s = o > 239 ? 4 : o > 223 ? 3 : o > 191 ? 2 : 1;
  31223. if (r + s <= i) {
  31224. var l, c, h, u;
  31225. switch (s) {
  31226. case 1:
  31227. o < 128 && (a = o);
  31228. break;
  31229. case 2:
  31230. l = e[r + 1],
  31231. 128 === (192 & l) && (u = (31 & o) << 6 | 63 & l,
  31232. u > 127 && (a = u));
  31233. break;
  31234. case 3:
  31235. l = e[r + 1],
  31236. c = e[r + 2],
  31237. 128 === (192 & l) && 128 === (192 & c) && (u = (15 & o) << 12 | (63 & l) << 6 | 63 & c,
  31238. u > 2047 && (u < 55296 || u > 57343) && (a = u));
  31239. break;
  31240. case 4:
  31241. l = e[r + 1],
  31242. c = e[r + 2],
  31243. h = e[r + 3],
  31244. 128 === (192 & l) && 128 === (192 & c) && 128 === (192 & h) && (u = (15 & o) << 18 | (63 & l) << 12 | (63 & c) << 6 | 63 & h,
  31245. u > 65535 && u < 1114112 && (a = u))
  31246. }
  31247. }
  31248. null === a ? (a = 65533,
  31249. s = 1) : a > 65535 && (a -= 65536,
  31250. n.push(a >>> 10 & 1023 | 55296),
  31251. a = 56320 | 1023 & a),
  31252. n.push(a),
  31253. r += s
  31254. }
  31255. return R(n)
  31256. }
  31257. function R(e) {
  31258. var t = e.length;
  31259. if (t <= ee)
  31260. return String.fromCharCode.apply(String, e);
  31261. for (var i = "", n = 0; n < t; )
  31262. i += String.fromCharCode.apply(String, e.slice(n, n += ee));
  31263. return i
  31264. }
  31265. function P(e, t, i) {
  31266. var n = "";
  31267. i = Math.min(e.length, i);
  31268. for (var r = t; r < i; ++r)
  31269. n += String.fromCharCode(127 & e[r]);
  31270. return n
  31271. }
  31272. function O(e, t, i) {
  31273. var n = "";
  31274. i = Math.min(e.length, i);
  31275. for (var r = t; r < i; ++r)
  31276. n += String.fromCharCode(e[r]);
  31277. return n
  31278. }
  31279. function L(e, t, i) {
  31280. var n = e.length;
  31281. (!t || t < 0) && (t = 0),
  31282. (!i || i < 0 || i > n) && (i = n);
  31283. for (var r = "", o = t; o < i; ++o)
  31284. r += W(e[o]);
  31285. return r
  31286. }
  31287. function D(e, t, i) {
  31288. for (var n = e.slice(t, i), r = "", o = 0; o < n.length; o += 2)
  31289. r += String.fromCharCode(n[o] + 256 * n[o + 1]);
  31290. return r
  31291. }
  31292. function N(e, t, i) {
  31293. if (e % 1 !== 0 || e < 0)
  31294. throw new RangeError("offset is not uint");
  31295. if (e + t > i)
  31296. throw new RangeError("Trying to access beyond buffer length")
  31297. }
  31298. function B(e, t, i, n, r, o) {
  31299. if (!a.isBuffer(e))
  31300. throw new TypeError('"buffer" argument must be a Buffer instance');
  31301. if (t > r || t < o)
  31302. throw new RangeError('"value" argument is out of bounds');
  31303. if (i + n > e.length)
  31304. throw new RangeError("Index out of range")
  31305. }
  31306. function F(e, t, i, n) {
  31307. t < 0 && (t = 65535 + t + 1);
  31308. for (var r = 0, o = Math.min(e.length - i, 2); r < o; ++r)
  31309. e[i + r] = (t & 255 << 8 * (n ? r : 1 - r)) >>> 8 * (n ? r : 1 - r)
  31310. }
  31311. function V(e, t, i, n) {
  31312. t < 0 && (t = 4294967295 + t + 1);
  31313. for (var r = 0, o = Math.min(e.length - i, 4); r < o; ++r)
  31314. e[i + r] = t >>> 8 * (n ? r : 3 - r) & 255
  31315. }
  31316. function U(e, t, i, n, r, o) {
  31317. if (i + n > e.length)
  31318. throw new RangeError("Index out of range");
  31319. if (i < 0)
  31320. throw new RangeError("Index out of range")
  31321. }
  31322. function k(e, t, i, n, r) {
  31323. return r || U(e, t, i, 4, 3.4028234663852886e38, -3.4028234663852886e38),
  31324. J.write(e, t, i, n, 23, 4),
  31325. i + 4
  31326. }
  31327. function H(e, t, i, n, r) {
  31328. return r || U(e, t, i, 8, 1.7976931348623157e308, -1.7976931348623157e308),
  31329. J.write(e, t, i, n, 52, 8),
  31330. i + 8
  31331. }
  31332. function G(e) {
  31333. if (e = z(e).replace(te, ""),
  31334. e.length < 2)
  31335. return "";
  31336. for (; e.length % 4 !== 0; )
  31337. e += "=";
  31338. return e
  31339. }
  31340. function z(e) {
  31341. return e.trim ? e.trim() : e.replace(/^\s+|\s+$/g, "")
  31342. }
  31343. function W(e) {
  31344. return e < 16 ? "0" + e.toString(16) : e.toString(16)
  31345. }
  31346. function j(e, t) {
  31347. t = t || 1 / 0;
  31348. for (var i, n = e.length, r = null, o = [], a = 0; a < n; ++a) {
  31349. if (i = e.charCodeAt(a),
  31350. i > 55295 && i < 57344) {
  31351. if (!r) {
  31352. if (i > 56319) {
  31353. (t -= 3) > -1 && o.push(239, 191, 189);
  31354. continue
  31355. }
  31356. if (a + 1 === n) {
  31357. (t -= 3) > -1 && o.push(239, 191, 189);
  31358. continue
  31359. }
  31360. r = i;
  31361. continue
  31362. }
  31363. if (i < 56320) {
  31364. (t -= 3) > -1 && o.push(239, 191, 189),
  31365. r = i;
  31366. continue
  31367. }
  31368. i = (r - 55296 << 10 | i - 56320) + 65536
  31369. } else
  31370. r && (t -= 3) > -1 && o.push(239, 191, 189);
  31371. if (r = null,
  31372. i < 128) {
  31373. if ((t -= 1) < 0)
  31374. break;
  31375. o.push(i)
  31376. } else if (i < 2048) {
  31377. if ((t -= 2) < 0)
  31378. break;
  31379. o.push(i >> 6 | 192, 63 & i | 128)
  31380. } else if (i < 65536) {
  31381. if ((t -= 3) < 0)
  31382. break;
  31383. o.push(i >> 12 | 224, i >> 6 & 63 | 128, 63 & i | 128)
  31384. } else {
  31385. if (!(i < 1114112))
  31386. throw new Error("Invalid code point");
  31387. if ((t -= 4) < 0)
  31388. break;
  31389. o.push(i >> 18 | 240, i >> 12 & 63 | 128, i >> 6 & 63 | 128, 63 & i | 128)
  31390. }
  31391. }
  31392. return o
  31393. }
  31394. function Y(e) {
  31395. for (var t = [], i = 0; i < e.length; ++i)
  31396. t.push(255 & e.charCodeAt(i));
  31397. return t
  31398. }
  31399. function X(e, t) {
  31400. for (var i, n, r, o = [], a = 0; a < e.length && !((t -= 2) < 0); ++a)
  31401. i = e.charCodeAt(a),
  31402. n = i >> 8,
  31403. r = i % 256,
  31404. o.push(r),
  31405. o.push(n);
  31406. return o
  31407. }
  31408. function Z(e) {
  31409. return Q.toByteArray(G(e))
  31410. }
  31411. function q(e, t, i, n) {
  31412. for (var r = 0; r < n && !(r + i >= t.length || r >= e.length); ++r)
  31413. t[r + i] = e[r];
  31414. return r
  31415. }
  31416. function K(e) {
  31417. return e !== e
  31418. }
  31419. var Q = e("base64-js")
  31420. , J = e("ieee754")
  31421. , $ = e("isarray");
  31422. i.Buffer = a,
  31423. i.SlowBuffer = m,
  31424. i.INSPECT_MAX_BYTES = 50,
  31425. a.TYPED_ARRAY_SUPPORT = void 0 !== t.TYPED_ARRAY_SUPPORT ? t.TYPED_ARRAY_SUPPORT : n(),
  31426. i.kMaxLength = r(),
  31427. a.poolSize = 8192,
  31428. a._augment = function(e) {
  31429. return e.__proto__ = a.prototype,
  31430. e
  31431. }
  31432. ,
  31433. a.from = function(e, t, i) {
  31434. return s(null, e, t, i)
  31435. }
  31436. ,
  31437. a.TYPED_ARRAY_SUPPORT && (a.prototype.__proto__ = Uint8Array.prototype,
  31438. a.__proto__ = Uint8Array,
  31439. "undefined" != typeof Symbol && Symbol.species && a[Symbol.species] === a && Object.defineProperty(a, Symbol.species, {
  31440. value: null,
  31441. configurable: !0
  31442. })),
  31443. a.alloc = function(e, t, i) {
  31444. return c(null, e, t, i)
  31445. }
  31446. ,
  31447. a.allocUnsafe = function(e) {
  31448. return h(null, e)
  31449. }
  31450. ,
  31451. a.allocUnsafeSlow = function(e) {
  31452. return h(null, e)
  31453. }
  31454. ,
  31455. a.isBuffer = function(e) {
  31456. return !(null == e || !e._isBuffer)
  31457. }
  31458. ,
  31459. a.compare = function(e, t) {
  31460. if (!a.isBuffer(e) || !a.isBuffer(t))
  31461. throw new TypeError("Arguments must be Buffers");
  31462. if (e === t)
  31463. return 0;
  31464. for (var i = e.length, n = t.length, r = 0, o = Math.min(i, n); r < o; ++r)
  31465. if (e[r] !== t[r]) {
  31466. i = e[r],
  31467. n = t[r];
  31468. break
  31469. }
  31470. return i < n ? -1 : n < i ? 1 : 0
  31471. }
  31472. ,
  31473. a.isEncoding = function(e) {
  31474. switch (String(e).toLowerCase()) {
  31475. case "hex":
  31476. case "utf8":
  31477. case "utf-8":
  31478. case "ascii":
  31479. case "latin1":
  31480. case "binary":
  31481. case "base64":
  31482. case "ucs2":
  31483. case "ucs-2":
  31484. case "utf16le":
  31485. case "utf-16le":
  31486. return !0;
  31487. default:
  31488. return !1
  31489. }
  31490. }
  31491. ,
  31492. a.concat = function(e, t) {
  31493. if (!$(e))
  31494. throw new TypeError('"list" argument must be an Array of Buffers');
  31495. if (0 === e.length)
  31496. return a.alloc(0);
  31497. var i;
  31498. if (void 0 === t)
  31499. for (t = 0,
  31500. i = 0; i < e.length; ++i)
  31501. t += e[i].length;
  31502. var n = a.allocUnsafe(t)
  31503. , r = 0;
  31504. for (i = 0; i < e.length; ++i) {
  31505. var o = e[i];
  31506. if (!a.isBuffer(o))
  31507. throw new TypeError('"list" argument must be an Array of Buffers');
  31508. o.copy(n, r),
  31509. r += o.length
  31510. }
  31511. return n
  31512. }
  31513. ,
  31514. a.byteLength = v,
  31515. a.prototype._isBuffer = !0,
  31516. a.prototype.swap16 = function() {
  31517. var e = this.length;
  31518. if (e % 2 !== 0)
  31519. throw new RangeError("Buffer size must be a multiple of 16-bits");
  31520. for (var t = 0; t < e; t += 2)
  31521. y(this, t, t + 1);
  31522. return this
  31523. }
  31524. ,
  31525. a.prototype.swap32 = function() {
  31526. var e = this.length;
  31527. if (e % 4 !== 0)
  31528. throw new RangeError("Buffer size must be a multiple of 32-bits");
  31529. for (var t = 0; t < e; t += 4)
  31530. y(this, t, t + 3),
  31531. y(this, t + 1, t + 2);
  31532. return this
  31533. }
  31534. ,
  31535. a.prototype.swap64 = function() {
  31536. var e = this.length;
  31537. if (e % 8 !== 0)
  31538. throw new RangeError("Buffer size must be a multiple of 64-bits");
  31539. for (var t = 0; t < e; t += 8)
  31540. y(this, t, t + 7),
  31541. y(this, t + 1, t + 6),
  31542. y(this, t + 2, t + 5),
  31543. y(this, t + 3, t + 4);
  31544. return this
  31545. }
  31546. ,
  31547. a.prototype.toString = function() {
  31548. var e = 0 | this.length;
  31549. return 0 === e ? "" : 0 === arguments.length ? M(this, 0, e) : A.apply(this, arguments)
  31550. }
  31551. ,
  31552. a.prototype.equals = function(e) {
  31553. if (!a.isBuffer(e))
  31554. throw new TypeError("Argument must be a Buffer");
  31555. return this === e || 0 === a.compare(this, e)
  31556. }
  31557. ,
  31558. a.prototype.inspect = function() {
  31559. var e = ""
  31560. , t = i.INSPECT_MAX_BYTES;
  31561. return this.length > 0 && (e = this.toString("hex", 0, t).match(/.{2}/g).join(" "),
  31562. this.length > t && (e += " ... ")),
  31563. "<Buffer " + e + ">"
  31564. }
  31565. ,
  31566. a.prototype.compare = function(e, t, i, n, r) {
  31567. if (!a.isBuffer(e))
  31568. throw new TypeError("Argument must be a Buffer");
  31569. if (void 0 === t && (t = 0),
  31570. void 0 === i && (i = e ? e.length : 0),
  31571. void 0 === n && (n = 0),
  31572. void 0 === r && (r = this.length),
  31573. t < 0 || i > e.length || n < 0 || r > this.length)
  31574. throw new RangeError("out of range index");
  31575. if (n >= r && t >= i)
  31576. return 0;
  31577. if (n >= r)
  31578. return -1;
  31579. if (t >= i)
  31580. return 1;
  31581. if (t >>>= 0,
  31582. i >>>= 0,
  31583. n >>>= 0,
  31584. r >>>= 0,
  31585. this === e)
  31586. return 0;
  31587. 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)
  31588. if (c[u] !== h[u]) {
  31589. o = c[u],
  31590. s = h[u];
  31591. break
  31592. }
  31593. return o < s ? -1 : s < o ? 1 : 0
  31594. }
  31595. ,
  31596. a.prototype.includes = function(e, t, i) {
  31597. return this.indexOf(e, t, i) !== -1
  31598. }
  31599. ,
  31600. a.prototype.indexOf = function(e, t, i) {
  31601. return C(this, e, t, i, !0)
  31602. }
  31603. ,
  31604. a.prototype.lastIndexOf = function(e, t, i) {
  31605. return C(this, e, t, i, !1)
  31606. }
  31607. ,
  31608. a.prototype.write = function(e, t, i, n) {
  31609. if (void 0 === t)
  31610. n = "utf8",
  31611. i = this.length,
  31612. t = 0;
  31613. else if (void 0 === i && "string" == typeof t)
  31614. n = t,
  31615. i = this.length,
  31616. t = 0;
  31617. else {
  31618. if (!isFinite(t))
  31619. throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");
  31620. t |= 0,
  31621. isFinite(i) ? (i |= 0,
  31622. void 0 === n && (n = "utf8")) : (n = i,
  31623. i = void 0)
  31624. }
  31625. var r = this.length - t;
  31626. if ((void 0 === i || i > r) && (i = r),
  31627. e.length > 0 && (i < 0 || t < 0) || t > this.length)
  31628. throw new RangeError("Attempt to write outside buffer bounds");
  31629. n || (n = "utf8");
  31630. for (var o = !1; ; )
  31631. switch (n) {
  31632. case "hex":
  31633. return E(this, e, t, i);
  31634. case "utf8":
  31635. case "utf-8":
  31636. return b(this, e, t, i);
  31637. case "ascii":
  31638. return w(this, e, t, i);
  31639. case "latin1":
  31640. case "binary":
  31641. return _(this, e, t, i);
  31642. case "base64":
  31643. return T(this, e, t, i);
  31644. case "ucs2":
  31645. case "ucs-2":
  31646. case "utf16le":
  31647. case "utf-16le":
  31648. return x(this, e, t, i);
  31649. default:
  31650. if (o)
  31651. throw new TypeError("Unknown encoding: " + n);
  31652. n = ("" + n).toLowerCase(),
  31653. o = !0
  31654. }
  31655. }
  31656. ,
  31657. a.prototype.toJSON = function() {
  31658. return {
  31659. type: "Buffer",
  31660. data: Array.prototype.slice.call(this._arr || this, 0)
  31661. }
  31662. }
  31663. ;
  31664. var ee = 4096;
  31665. a.prototype.slice = function(e, t) {
  31666. var i = this.length;
  31667. e = ~~e,
  31668. t = void 0 === t ? i : ~~t,
  31669. e < 0 ? (e += i,
  31670. e < 0 && (e = 0)) : e > i && (e = i),
  31671. t < 0 ? (t += i,
  31672. t < 0 && (t = 0)) : t > i && (t = i),
  31673. t < e && (t = e);
  31674. var n;
  31675. if (a.TYPED_ARRAY_SUPPORT)
  31676. n = this.subarray(e, t),
  31677. n.__proto__ = a.prototype;
  31678. else {
  31679. var r = t - e;
  31680. n = new a(r,void 0);
  31681. for (var o = 0; o < r; ++o)
  31682. n[o] = this[o + e]
  31683. }
  31684. return n
  31685. }
  31686. ,
  31687. a.prototype.readUIntLE = function(e, t, i) {
  31688. e |= 0,
  31689. t |= 0,
  31690. i || N(e, t, this.length);
  31691. for (var n = this[e], r = 1, o = 0; ++o < t && (r *= 256); )
  31692. n += this[e + o] * r;
  31693. return n
  31694. }
  31695. ,
  31696. a.prototype.readUIntBE = function(e, t, i) {
  31697. e |= 0,
  31698. t |= 0,
  31699. i || N(e, t, this.length);
  31700. for (var n = this[e + --t], r = 1; t > 0 && (r *= 256); )
  31701. n += this[e + --t] * r;
  31702. return n
  31703. }
  31704. ,
  31705. a.prototype.readUInt8 = function(e, t) {
  31706. return t || N(e, 1, this.length),
  31707. this[e]
  31708. }
  31709. ,
  31710. a.prototype.readUInt16LE = function(e, t) {
  31711. return t || N(e, 2, this.length),
  31712. this[e] | this[e + 1] << 8
  31713. }
  31714. ,
  31715. a.prototype.readUInt16BE = function(e, t) {
  31716. return t || N(e, 2, this.length),
  31717. this[e] << 8 | this[e + 1]
  31718. }
  31719. ,
  31720. a.prototype.readUInt32LE = function(e, t) {
  31721. return t || N(e, 4, this.length),
  31722. (this[e] | this[e + 1] << 8 | this[e + 2] << 16) + 16777216 * this[e + 3]
  31723. }
  31724. ,
  31725. a.prototype.readUInt32BE = function(e, t) {
  31726. return t || N(e, 4, this.length),
  31727. 16777216 * this[e] + (this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3])
  31728. }
  31729. ,
  31730. a.prototype.readIntLE = function(e, t, i) {
  31731. e |= 0,
  31732. t |= 0,
  31733. i || N(e, t, this.length);
  31734. for (var n = this[e], r = 1, o = 0; ++o < t && (r *= 256); )
  31735. n += this[e + o] * r;
  31736. return r *= 128,
  31737. n >= r && (n -= Math.pow(2, 8 * t)),
  31738. n
  31739. }
  31740. ,
  31741. a.prototype.readIntBE = function(e, t, i) {
  31742. e |= 0,
  31743. t |= 0,
  31744. i || N(e, t, this.length);
  31745. for (var n = t, r = 1, o = this[e + --n]; n > 0 && (r *= 256); )
  31746. o += this[e + --n] * r;
  31747. return r *= 128,
  31748. o >= r && (o -= Math.pow(2, 8 * t)),
  31749. o
  31750. }
  31751. ,
  31752. a.prototype.readInt8 = function(e, t) {
  31753. return t || N(e, 1, this.length),
  31754. 128 & this[e] ? (255 - this[e] + 1) * -1 : this[e]
  31755. }
  31756. ,
  31757. a.prototype.readInt16LE = function(e, t) {
  31758. t || N(e, 2, this.length);
  31759. var i = this[e] | this[e + 1] << 8;
  31760. return 32768 & i ? 4294901760 | i : i
  31761. }
  31762. ,
  31763. a.prototype.readInt16BE = function(e, t) {
  31764. t || N(e, 2, this.length);
  31765. var i = this[e + 1] | this[e] << 8;
  31766. return 32768 & i ? 4294901760 | i : i
  31767. }
  31768. ,
  31769. a.prototype.readInt32LE = function(e, t) {
  31770. return t || N(e, 4, this.length),
  31771. this[e] | this[e + 1] << 8 | this[e + 2] << 16 | this[e + 3] << 24
  31772. }
  31773. ,
  31774. a.prototype.readInt32BE = function(e, t) {
  31775. return t || N(e, 4, this.length),
  31776. this[e] << 24 | this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3]
  31777. }
  31778. ,
  31779. a.prototype.readFloatLE = function(e, t) {
  31780. return t || N(e, 4, this.length),
  31781. J.read(this, e, !0, 23, 4)
  31782. }
  31783. ,
  31784. a.prototype.readFloatBE = function(e, t) {
  31785. return t || N(e, 4, this.length),
  31786. J.read(this, e, !1, 23, 4)
  31787. }
  31788. ,
  31789. a.prototype.readDoubleLE = function(e, t) {
  31790. return t || N(e, 8, this.length),
  31791. J.read(this, e, !0, 52, 8)
  31792. }
  31793. ,
  31794. a.prototype.readDoubleBE = function(e, t) {
  31795. return t || N(e, 8, this.length),
  31796. J.read(this, e, !1, 52, 8)
  31797. }
  31798. ,
  31799. a.prototype.writeUIntLE = function(e, t, i, n) {
  31800. if (e = +e,
  31801. t |= 0,
  31802. i |= 0,
  31803. !n) {
  31804. var r = Math.pow(2, 8 * i) - 1;
  31805. B(this, e, t, i, r, 0)
  31806. }
  31807. var o = 1
  31808. , a = 0;
  31809. for (this[t] = 255 & e; ++a < i && (o *= 256); )
  31810. this[t + a] = e / o & 255;
  31811. return t + i
  31812. }
  31813. ,
  31814. a.prototype.writeUIntBE = function(e, t, i, n) {
  31815. if (e = +e,
  31816. t |= 0,
  31817. i |= 0,
  31818. !n) {
  31819. var r = Math.pow(2, 8 * i) - 1;
  31820. B(this, e, t, i, r, 0)
  31821. }
  31822. var o = i - 1
  31823. , a = 1;
  31824. for (this[t + o] = 255 & e; --o >= 0 && (a *= 256); )
  31825. this[t + o] = e / a & 255;
  31826. return t + i
  31827. }
  31828. ,
  31829. a.prototype.writeUInt8 = function(e, t, i) {
  31830. return e = +e,
  31831. t |= 0,
  31832. i || B(this, e, t, 1, 255, 0),
  31833. a.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)),
  31834. this[t] = 255 & e,
  31835. t + 1
  31836. }
  31837. ,
  31838. a.prototype.writeUInt16LE = function(e, t, i) {
  31839. return e = +e,
  31840. t |= 0,
  31841. i || B(this, e, t, 2, 65535, 0),
  31842. a.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e,
  31843. this[t + 1] = e >>> 8) : F(this, e, t, !0),
  31844. t + 2
  31845. }
  31846. ,
  31847. a.prototype.writeUInt16BE = function(e, t, i) {
  31848. return e = +e,
  31849. t |= 0,
  31850. i || B(this, e, t, 2, 65535, 0),
  31851. a.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 8,
  31852. this[t + 1] = 255 & e) : F(this, e, t, !1),
  31853. t + 2
  31854. }
  31855. ,
  31856. a.prototype.writeUInt32LE = function(e, t, i) {
  31857. return e = +e,
  31858. t |= 0,
  31859. i || B(this, e, t, 4, 4294967295, 0),
  31860. a.TYPED_ARRAY_SUPPORT ? (this[t + 3] = e >>> 24,
  31861. this[t + 2] = e >>> 16,
  31862. this[t + 1] = e >>> 8,
  31863. this[t] = 255 & e) : V(this, e, t, !0),
  31864. t + 4
  31865. }
  31866. ,
  31867. a.prototype.writeUInt32BE = function(e, t, i) {
  31868. return e = +e,
  31869. t |= 0,
  31870. i || B(this, e, t, 4, 4294967295, 0),
  31871. a.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 24,
  31872. this[t + 1] = e >>> 16,
  31873. this[t + 2] = e >>> 8,
  31874. this[t + 3] = 255 & e) : V(this, e, t, !1),
  31875. t + 4
  31876. }
  31877. ,
  31878. a.prototype.writeIntLE = function(e, t, i, n) {
  31879. if (e = +e,
  31880. t |= 0,
  31881. !n) {
  31882. var r = Math.pow(2, 8 * i - 1);
  31883. B(this, e, t, i, r - 1, -r)
  31884. }
  31885. var o = 0
  31886. , a = 1
  31887. , s = 0;
  31888. for (this[t] = 255 & e; ++o < i && (a *= 256); )
  31889. e < 0 && 0 === s && 0 !== this[t + o - 1] && (s = 1),
  31890. this[t + o] = (e / a >> 0) - s & 255;
  31891. return t + i
  31892. }
  31893. ,
  31894. a.prototype.writeIntBE = function(e, t, i, n) {
  31895. if (e = +e,
  31896. t |= 0,
  31897. !n) {
  31898. var r = Math.pow(2, 8 * i - 1);
  31899. B(this, e, t, i, r - 1, -r)
  31900. }
  31901. var o = i - 1
  31902. , a = 1
  31903. , s = 0;
  31904. for (this[t + o] = 255 & e; --o >= 0 && (a *= 256); )
  31905. e < 0 && 0 === s && 0 !== this[t + o + 1] && (s = 1),
  31906. this[t + o] = (e / a >> 0) - s & 255;
  31907. return t + i
  31908. }
  31909. ,
  31910. a.prototype.writeInt8 = function(e, t, i) {
  31911. return e = +e,
  31912. t |= 0,
  31913. i || B(this, e, t, 1, 127, -128),
  31914. a.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)),
  31915. e < 0 && (e = 255 + e + 1),
  31916. this[t] = 255 & e,
  31917. t + 1
  31918. }
  31919. ,
  31920. a.prototype.writeInt16LE = function(e, t, i) {
  31921. return e = +e,
  31922. t |= 0,
  31923. i || B(this, e, t, 2, 32767, -32768),
  31924. a.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e,
  31925. this[t + 1] = e >>> 8) : F(this, e, t, !0),
  31926. t + 2
  31927. }
  31928. ,
  31929. a.prototype.writeInt16BE = function(e, t, i) {
  31930. return e = +e,
  31931. t |= 0,
  31932. i || B(this, e, t, 2, 32767, -32768),
  31933. a.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 8,
  31934. this[t + 1] = 255 & e) : F(this, e, t, !1),
  31935. t + 2
  31936. }
  31937. ,
  31938. a.prototype.writeInt32LE = function(e, t, i) {
  31939. return e = +e,
  31940. t |= 0,
  31941. i || B(this, e, t, 4, 2147483647, -2147483648),
  31942. a.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e,
  31943. this[t + 1] = e >>> 8,
  31944. this[t + 2] = e >>> 16,
  31945. this[t + 3] = e >>> 24) : V(this, e, t, !0),
  31946. t + 4
  31947. }
  31948. ,
  31949. a.prototype.writeInt32BE = function(e, t, i) {
  31950. return e = +e,
  31951. t |= 0,
  31952. i || B(this, e, t, 4, 2147483647, -2147483648),
  31953. e < 0 && (e = 4294967295 + e + 1),
  31954. a.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 24,
  31955. this[t + 1] = e >>> 16,
  31956. this[t + 2] = e >>> 8,
  31957. this[t + 3] = 255 & e) : V(this, e, t, !1),
  31958. t + 4
  31959. }
  31960. ,
  31961. a.prototype.writeFloatLE = function(e, t, i) {
  31962. return k(this, e, t, !0, i)
  31963. }
  31964. ,
  31965. a.prototype.writeFloatBE = function(e, t, i) {
  31966. return k(this, e, t, !1, i)
  31967. }
  31968. ,
  31969. a.prototype.writeDoubleLE = function(e, t, i) {
  31970. return H(this, e, t, !0, i)
  31971. }
  31972. ,
  31973. a.prototype.writeDoubleBE = function(e, t, i) {
  31974. return H(this, e, t, !1, i)
  31975. }
  31976. ,
  31977. a.prototype.copy = function(e, t, i, n) {
  31978. if (i || (i = 0),
  31979. n || 0 === n || (n = this.length),
  31980. t >= e.length && (t = e.length),
  31981. t || (t = 0),
  31982. n > 0 && n < i && (n = i),
  31983. n === i)
  31984. return 0;
  31985. if (0 === e.length || 0 === this.length)
  31986. return 0;
  31987. if (t < 0)
  31988. throw new RangeError("targetStart out of bounds");
  31989. if (i < 0 || i >= this.length)
  31990. throw new RangeError("sourceStart out of bounds");
  31991. if (n < 0)
  31992. throw new RangeError("sourceEnd out of bounds");
  31993. n > this.length && (n = this.length),
  31994. e.length - t < n - i && (n = e.length - t + i);
  31995. var r, o = n - i;
  31996. if (this === e && i < t && t < n)
  31997. for (r = o - 1; r >= 0; --r)
  31998. e[r + t] = this[r + i];
  31999. else if (o < 1e3 || !a.TYPED_ARRAY_SUPPORT)
  32000. for (r = 0; r < o; ++r)
  32001. e[r + t] = this[r + i];
  32002. else
  32003. Uint8Array.prototype.set.call(e, this.subarray(i, i + o), t);
  32004. return o
  32005. }
  32006. ,
  32007. a.prototype.fill = function(e, t, i, n) {
  32008. if ("string" == typeof e) {
  32009. if ("string" == typeof t ? (n = t,
  32010. t = 0,
  32011. i = this.length) : "string" == typeof i && (n = i,
  32012. i = this.length),
  32013. 1 === e.length) {
  32014. var r = e.charCodeAt(0);
  32015. r < 256 && (e = r)
  32016. }
  32017. if (void 0 !== n && "string" != typeof n)
  32018. throw new TypeError("encoding must be a string");
  32019. if ("string" == typeof n && !a.isEncoding(n))
  32020. throw new TypeError("Unknown encoding: " + n)
  32021. } else
  32022. "number" == typeof e && (e &= 255);
  32023. if (t < 0 || this.length < t || this.length < i)
  32024. throw new RangeError("Out of range index");
  32025. if (i <= t)
  32026. return this;
  32027. t >>>= 0,
  32028. i = void 0 === i ? this.length : i >>> 0,
  32029. e || (e = 0);
  32030. var o;
  32031. if ("number" == typeof e)
  32032. for (o = t; o < i; ++o)
  32033. this[o] = e;
  32034. else {
  32035. var s = a.isBuffer(e) ? e : j(new a(e,n).toString())
  32036. , l = s.length;
  32037. for (o = 0; o < i - t; ++o)
  32038. this[o + t] = s[o % l]
  32039. }
  32040. return this
  32041. }
  32042. ;
  32043. var te = /[^+\/0-9A-Za-z-_]/g
  32044. }
  32045. ).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
  32046. }
  32047. , {
  32048. "base64-js": 199,
  32049. ieee754: 200,
  32050. isarray: 201
  32051. }],
  32052. 199: [function(e, t, i) {
  32053. "use strict";
  32054. function n(e) {
  32055. var t = e.length;
  32056. if (t % 4 > 0)
  32057. throw new Error("Invalid string. Length must be a multiple of 4");
  32058. return "=" === e[t - 2] ? 2 : "=" === e[t - 1] ? 1 : 0
  32059. }
  32060. function r(e) {
  32061. return 3 * e.length / 4 - n(e)
  32062. }
  32063. function o(e) {
  32064. var t, i, r, o, a, s, l = e.length;
  32065. a = n(e),
  32066. s = new u(3 * l / 4 - a),
  32067. r = a > 0 ? l - 4 : l;
  32068. var c = 0;
  32069. for (t = 0,
  32070. i = 0; t < r; t += 4,
  32071. i += 3)
  32072. o = h[e.charCodeAt(t)] << 18 | h[e.charCodeAt(t + 1)] << 12 | h[e.charCodeAt(t + 2)] << 6 | h[e.charCodeAt(t + 3)],
  32073. s[c++] = o >> 16 & 255,
  32074. s[c++] = o >> 8 & 255,
  32075. s[c++] = 255 & o;
  32076. return 2 === a ? (o = h[e.charCodeAt(t)] << 2 | h[e.charCodeAt(t + 1)] >> 4,
  32077. s[c++] = 255 & o) : 1 === a && (o = h[e.charCodeAt(t)] << 10 | h[e.charCodeAt(t + 1)] << 4 | h[e.charCodeAt(t + 2)] >> 2,
  32078. s[c++] = o >> 8 & 255,
  32079. s[c++] = 255 & o),
  32080. s
  32081. }
  32082. function a(e) {
  32083. return c[e >> 18 & 63] + c[e >> 12 & 63] + c[e >> 6 & 63] + c[63 & e]
  32084. }
  32085. function s(e, t, i) {
  32086. for (var n, r = [], o = t; o < i; o += 3)
  32087. n = (e[o] << 16) + (e[o + 1] << 8) + e[o + 2],
  32088. r.push(a(n));
  32089. return r.join("")
  32090. }
  32091. function l(e) {
  32092. for (var t, i = e.length, n = i % 3, r = "", o = [], a = 16383, l = 0, h = i - n; l < h; l += a)
  32093. o.push(s(e, l, l + a > h ? h : l + a));
  32094. return 1 === n ? (t = e[i - 1],
  32095. r += c[t >> 2],
  32096. r += c[t << 4 & 63],
  32097. r += "==") : 2 === n && (t = (e[i - 2] << 8) + e[i - 1],
  32098. r += c[t >> 10],
  32099. r += c[t >> 4 & 63],
  32100. r += c[t << 2 & 63],
  32101. r += "="),
  32102. o.push(r),
  32103. o.join("")
  32104. }
  32105. i.byteLength = r,
  32106. i.toByteArray = o,
  32107. i.fromByteArray = l;
  32108. for (var c = [], h = [], u = "undefined" != typeof Uint8Array ? Uint8Array : Array, d = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", p = 0, f = d.length; p < f; ++p)
  32109. c[p] = d[p],
  32110. h[d.charCodeAt(p)] = p;
  32111. h["-".charCodeAt(0)] = 62,
  32112. h["_".charCodeAt(0)] = 63
  32113. }
  32114. , {}],
  32115. 200: [function(e, t, i) {
  32116. i.read = function(e, t, i, n, r) {
  32117. 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];
  32118. for (u += d,
  32119. o = p & (1 << -h) - 1,
  32120. p >>= -h,
  32121. h += s; h > 0; o = 256 * o + e[t + u],
  32122. u += d,
  32123. h -= 8)
  32124. ;
  32125. for (a = o & (1 << -h) - 1,
  32126. o >>= -h,
  32127. h += n; h > 0; a = 256 * a + e[t + u],
  32128. u += d,
  32129. h -= 8)
  32130. ;
  32131. if (0 === o)
  32132. o = 1 - c;
  32133. else {
  32134. if (o === l)
  32135. return a ? NaN : (p ? -1 : 1) * (1 / 0);
  32136. a += Math.pow(2, n),
  32137. o -= c
  32138. }
  32139. return (p ? -1 : 1) * a * Math.pow(2, o - n)
  32140. }
  32141. ,
  32142. i.write = function(e, t, i, n, r, o) {
  32143. 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;
  32144. for (t = Math.abs(t),
  32145. isNaN(t) || t === 1 / 0 ? (s = isNaN(t) ? 1 : 0,
  32146. a = h) : (a = Math.floor(Math.log(t) / Math.LN2),
  32147. t * (l = Math.pow(2, -a)) < 1 && (a--,
  32148. l *= 2),
  32149. t += a + u >= 1 ? d / l : d * Math.pow(2, 1 - u),
  32150. t * l >= 2 && (a++,
  32151. l /= 2),
  32152. a + u >= h ? (s = 0,
  32153. a = h) : a + u >= 1 ? (s = (t * l - 1) * Math.pow(2, r),
  32154. a += u) : (s = t * Math.pow(2, u - 1) * Math.pow(2, r),
  32155. a = 0)); r >= 8; e[i + p] = 255 & s,
  32156. p += f,
  32157. s /= 256,
  32158. r -= 8)
  32159. ;
  32160. for (a = a << r | s,
  32161. c += r; c > 0; e[i + p] = 255 & a,
  32162. p += f,
  32163. a /= 256,
  32164. c -= 8)
  32165. ;
  32166. e[i + p - f] |= 128 * g
  32167. }
  32168. }
  32169. , {}],
  32170. 201: [function(e, t, i) {
  32171. var n = {}.toString;
  32172. t.exports = Array.isArray || function(e) {
  32173. return "[object Array]" == n.call(e)
  32174. }
  32175. }
  32176. , {}],
  32177. 202: [function(e, t, i) {
  32178. function n() {
  32179. this._events = this._events || {},
  32180. this._maxListeners = this._maxListeners || void 0
  32181. }
  32182. function r(e) {
  32183. return "function" == typeof e
  32184. }
  32185. function o(e) {
  32186. return "number" == typeof e
  32187. }
  32188. function a(e) {
  32189. return "object" == typeof e && null !== e
  32190. }
  32191. function s(e) {
  32192. return void 0 === e
  32193. }
  32194. t.exports = n,
  32195. n.EventEmitter = n,
  32196. n.prototype._events = void 0,
  32197. n.prototype._maxListeners = void 0,
  32198. n.defaultMaxListeners = 10,
  32199. n.prototype.setMaxListeners = function(e) {
  32200. if (!o(e) || e < 0 || isNaN(e))
  32201. throw TypeError("n must be a positive number");
  32202. return this._maxListeners = e,
  32203. this
  32204. }
  32205. ,
  32206. n.prototype.emit = function(e) {
  32207. var t, i, n, o, l, c;
  32208. if (this._events || (this._events = {}),
  32209. "error" === e && (!this._events.error || a(this._events.error) && !this._events.error.length)) {
  32210. if (t = arguments[1],
  32211. t instanceof Error)
  32212. throw t;
  32213. var h = new Error('Uncaught, unspecified "error" event. (' + t + ")");
  32214. throw h.context = t,
  32215. h
  32216. }
  32217. if (i = this._events[e],
  32218. s(i))
  32219. return !1;
  32220. if (r(i))
  32221. switch (arguments.length) {
  32222. case 1:
  32223. i.call(this);
  32224. break;
  32225. case 2:
  32226. i.call(this, arguments[1]);
  32227. break;
  32228. case 3:
  32229. i.call(this, arguments[1], arguments[2]);
  32230. break;
  32231. default:
  32232. o = Array.prototype.slice.call(arguments, 1),
  32233. i.apply(this, o)
  32234. }
  32235. else if (a(i))
  32236. for (o = Array.prototype.slice.call(arguments, 1),
  32237. c = i.slice(),
  32238. n = c.length,
  32239. l = 0; l < n; l++)
  32240. c[l].apply(this, o);
  32241. return !0
  32242. }
  32243. ,
  32244. n.prototype.addListener = function(e, t) {
  32245. var i;
  32246. if (!r(t))
  32247. throw TypeError("listener must be a function");
  32248. return this._events || (this._events = {}),
  32249. this._events.newListener && this.emit("newListener", e, r(t.listener) ? t.listener : t),
  32250. this._events[e] ? a(this._events[e]) ? this._events[e].push(t) : this._events[e] = [this._events[e], t] : this._events[e] = t,
  32251. a(this._events[e]) && !this._events[e].warned && (i = s(this._maxListeners) ? n.defaultMaxListeners : this._maxListeners,
  32252. i && i > 0 && this._events[e].length > i && (this._events[e].warned = !0,
  32253. console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.", this._events[e].length),
  32254. "function" == typeof console.trace && console.trace())),
  32255. this
  32256. }
  32257. ,
  32258. n.prototype.on = n.prototype.addListener,
  32259. n.prototype.once = function(e, t) {
  32260. function i() {
  32261. this.removeListener(e, i),
  32262. n || (n = !0,
  32263. t.apply(this, arguments))
  32264. }
  32265. if (!r(t))
  32266. throw TypeError("listener must be a function");
  32267. var n = !1;
  32268. return i.listener = t,
  32269. this.on(e, i),
  32270. this
  32271. }
  32272. ,
  32273. n.prototype.removeListener = function(e, t) {
  32274. var i, n, o, s;
  32275. if (!r(t))
  32276. throw TypeError("listener must be a function");
  32277. if (!this._events || !this._events[e])
  32278. return this;
  32279. if (i = this._events[e],
  32280. o = i.length,
  32281. n = -1,
  32282. i === t || r(i.listener) && i.listener === t)
  32283. delete this._events[e],
  32284. this._events.removeListener && this.emit("removeListener", e, t);
  32285. else if (a(i)) {
  32286. for (s = o; s-- > 0; )
  32287. if (i[s] === t || i[s].listener && i[s].listener === t) {
  32288. n = s;
  32289. break
  32290. }
  32291. if (n < 0)
  32292. return this;
  32293. 1 === i.length ? (i.length = 0,
  32294. delete this._events[e]) : i.splice(n, 1),
  32295. this._events.removeListener && this.emit("removeListener", e, t)
  32296. }
  32297. return this
  32298. }
  32299. ,
  32300. n.prototype.removeAllListeners = function(e) {
  32301. var t, i;
  32302. if (!this._events)
  32303. return this;
  32304. if (!this._events.removeListener)
  32305. return 0 === arguments.length ? this._events = {} : this._events[e] && delete this._events[e],
  32306. this;
  32307. if (0 === arguments.length) {
  32308. for (t in this._events)
  32309. "removeListener" !== t && this.removeAllListeners(t);
  32310. return this.removeAllListeners("removeListener"),
  32311. this._events = {},
  32312. this
  32313. }
  32314. if (i = this._events[e],
  32315. r(i))
  32316. this.removeListener(e, i);
  32317. else if (i)
  32318. for (; i.length; )
  32319. this.removeListener(e, i[i.length - 1]);
  32320. return delete this._events[e],
  32321. this
  32322. }
  32323. ,
  32324. n.prototype.listeners = function(e) {
  32325. var t;
  32326. return t = this._events && this._events[e] ? r(this._events[e]) ? [this._events[e]] : this._events[e].slice() : []
  32327. }
  32328. ,
  32329. n.prototype.listenerCount = function(e) {
  32330. if (this._events) {
  32331. var t = this._events[e];
  32332. if (r(t))
  32333. return 1;
  32334. if (t)
  32335. return t.length
  32336. }
  32337. return 0
  32338. }
  32339. ,
  32340. n.listenerCount = function(e, t) {
  32341. return e.listenerCount(t)
  32342. }
  32343. }
  32344. , {}],
  32345. 203: [function(e, t, i) {
  32346. function n() {
  32347. throw new Error("setTimeout has not been defined")
  32348. }
  32349. function r() {
  32350. throw new Error("clearTimeout has not been defined")
  32351. }
  32352. function o(e) {
  32353. if (u === setTimeout)
  32354. return setTimeout(e, 0);
  32355. if ((u === n || !u) && setTimeout)
  32356. return u = setTimeout,
  32357. setTimeout(e, 0);
  32358. try {
  32359. return u(e, 0)
  32360. } catch (t) {
  32361. try {
  32362. return u.call(null, e, 0)
  32363. } catch (t) {
  32364. return u.call(this, e, 0)
  32365. }
  32366. }
  32367. }
  32368. function a(e) {
  32369. if (d === clearTimeout)
  32370. return clearTimeout(e);
  32371. if ((d === r || !d) && clearTimeout)
  32372. return d = clearTimeout,
  32373. clearTimeout(e);
  32374. try {
  32375. return d(e)
  32376. } catch (t) {
  32377. try {
  32378. return d.call(null, e)
  32379. } catch (t) {
  32380. return d.call(this, e)
  32381. }
  32382. }
  32383. }
  32384. function s() {
  32385. m && f && (m = !1,
  32386. f.length ? g = f.concat(g) : v = -1,
  32387. g.length && l())
  32388. }
  32389. function l() {
  32390. if (!m) {
  32391. var e = o(s);
  32392. m = !0;
  32393. for (var t = g.length; t; ) {
  32394. for (f = g,
  32395. g = []; ++v < t; )
  32396. f && f[v].run();
  32397. v = -1,
  32398. t = g.length
  32399. }
  32400. f = null,
  32401. m = !1,
  32402. a(e)
  32403. }
  32404. }
  32405. function c(e, t) {
  32406. this.fun = e,
  32407. this.array = t
  32408. }
  32409. function h() {}
  32410. var u, d, p = t.exports = {};
  32411. !function() {
  32412. try {
  32413. u = "function" == typeof setTimeout ? setTimeout : n
  32414. } catch (e) {
  32415. u = n
  32416. }
  32417. try {
  32418. d = "function" == typeof clearTimeout ? clearTimeout : r
  32419. } catch (e) {
  32420. d = r
  32421. }
  32422. }();
  32423. var f, g = [], m = !1, v = -1;
  32424. p.nextTick = function(e) {
  32425. var t = new Array(arguments.length - 1);
  32426. if (arguments.length > 1)
  32427. for (var i = 1; i < arguments.length; i++)
  32428. t[i - 1] = arguments[i];
  32429. g.push(new c(e,t)),
  32430. 1 !== g.length || m || o(l)
  32431. }
  32432. ,
  32433. c.prototype.run = function() {
  32434. this.fun.apply(null, this.array)
  32435. }
  32436. ,
  32437. p.title = "browser",
  32438. p.browser = !0,
  32439. p.env = {},
  32440. p.argv = [],
  32441. p.version = "",
  32442. p.versions = {},
  32443. p.on = h,
  32444. p.addListener = h,
  32445. p.once = h,
  32446. p.off = h,
  32447. p.removeListener = h,
  32448. p.removeAllListeners = h,
  32449. p.emit = h,
  32450. p.binding = function(e) {
  32451. throw new Error("process.binding is not supported")
  32452. }
  32453. ,
  32454. p.cwd = function() {
  32455. return "/"
  32456. }
  32457. ,
  32458. p.chdir = function(e) {
  32459. throw new Error("process.chdir is not supported")
  32460. }
  32461. ,
  32462. p.umask = function() {
  32463. return 0
  32464. }
  32465. }
  32466. , {}],
  32467. 204: [function(e, t, i) {
  32468. (function(e) {
  32469. !function(n) {
  32470. function r(e) {
  32471. throw new RangeError(L[e])
  32472. }
  32473. function o(e, t) {
  32474. for (var i = e.length, n = []; i--; )
  32475. n[i] = t(e[i]);
  32476. return n
  32477. }
  32478. function a(e, t) {
  32479. var i = e.split("@")
  32480. , n = "";
  32481. i.length > 1 && (n = i[0] + "@",
  32482. e = i[1]),
  32483. e = e.replace(O, ".");
  32484. var r = e.split(".")
  32485. , a = o(r, t).join(".");
  32486. return n + a
  32487. }
  32488. function s(e) {
  32489. for (var t, i, n = [], r = 0, o = e.length; r < o; )
  32490. t = e.charCodeAt(r++),
  32491. t >= 55296 && t <= 56319 && r < o ? (i = e.charCodeAt(r++),
  32492. 56320 == (64512 & i) ? n.push(((1023 & t) << 10) + (1023 & i) + 65536) : (n.push(t),
  32493. r--)) : n.push(t);
  32494. return n
  32495. }
  32496. function l(e) {
  32497. return o(e, function(e) {
  32498. var t = "";
  32499. return e > 65535 && (e -= 65536,
  32500. t += B(e >>> 10 & 1023 | 55296),
  32501. e = 56320 | 1023 & e),
  32502. t += B(e)
  32503. }).join("")
  32504. }
  32505. function c(e) {
  32506. return e - 48 < 10 ? e - 22 : e - 65 < 26 ? e - 65 : e - 97 < 26 ? e - 97 : E
  32507. }
  32508. function h(e, t) {
  32509. return e + 22 + 75 * (e < 26) - ((0 != t) << 5)
  32510. }
  32511. function u(e, t, i) {
  32512. var n = 0;
  32513. for (e = i ? N(e / T) : e >> 1,
  32514. e += N(e / t); e > D * w >> 1; n += E)
  32515. e = N(e / D);
  32516. return N(n + (D + 1) * e / (e + _))
  32517. }
  32518. function d(e) {
  32519. var t, i, n, o, a, s, h, d, p, f, g = [], m = e.length, v = 0, A = S, y = x;
  32520. for (i = e.lastIndexOf(M),
  32521. i < 0 && (i = 0),
  32522. n = 0; n < i; ++n)
  32523. e.charCodeAt(n) >= 128 && r("not-basic"),
  32524. g.push(e.charCodeAt(n));
  32525. for (o = i > 0 ? i + 1 : 0; o < m; ) {
  32526. for (a = v,
  32527. s = 1,
  32528. h = E; o >= m && r("invalid-input"),
  32529. d = c(e.charCodeAt(o++)),
  32530. (d >= E || d > N((I - v) / s)) && r("overflow"),
  32531. v += d * s,
  32532. p = h <= y ? b : h >= y + w ? w : h - y,
  32533. !(d < p); h += E)
  32534. f = E - p,
  32535. s > N(I / f) && r("overflow"),
  32536. s *= f;
  32537. t = g.length + 1,
  32538. y = u(v - a, t, 0 == a),
  32539. N(v / t) > I - A && r("overflow"),
  32540. A += N(v / t),
  32541. v %= t,
  32542. g.splice(v++, 0, A)
  32543. }
  32544. return l(g)
  32545. }
  32546. function p(e) {
  32547. var t, i, n, o, a, l, c, d, p, f, g, m, v, A, y, C = [];
  32548. for (e = s(e),
  32549. m = e.length,
  32550. t = S,
  32551. i = 0,
  32552. a = x,
  32553. l = 0; l < m; ++l)
  32554. g = e[l],
  32555. g < 128 && C.push(B(g));
  32556. for (n = o = C.length,
  32557. o && C.push(M); n < m; ) {
  32558. for (c = I,
  32559. l = 0; l < m; ++l)
  32560. g = e[l],
  32561. g >= t && g < c && (c = g);
  32562. for (v = n + 1,
  32563. c - t > N((I - i) / v) && r("overflow"),
  32564. i += (c - t) * v,
  32565. t = c,
  32566. l = 0; l < m; ++l)
  32567. if (g = e[l],
  32568. g < t && ++i > I && r("overflow"),
  32569. g == t) {
  32570. for (d = i,
  32571. p = E; f = p <= a ? b : p >= a + w ? w : p - a,
  32572. !(d < f); p += E)
  32573. y = d - f,
  32574. A = E - f,
  32575. C.push(B(h(f + y % A, 0))),
  32576. d = N(y / A);
  32577. C.push(B(h(d, 0))),
  32578. a = u(i, v, n == o),
  32579. i = 0,
  32580. ++n
  32581. }
  32582. ++i,
  32583. ++t
  32584. }
  32585. return C.join("")
  32586. }
  32587. function f(e) {
  32588. return a(e, function(e) {
  32589. return R.test(e) ? d(e.slice(4).toLowerCase()) : e
  32590. })
  32591. }
  32592. function g(e) {
  32593. return a(e, function(e) {
  32594. return P.test(e) ? "xn--" + p(e) : e
  32595. })
  32596. }
  32597. var m = "object" == typeof i && i && !i.nodeType && i
  32598. , v = "object" == typeof t && t && !t.nodeType && t
  32599. , A = "object" == typeof e && e;
  32600. A.global !== A && A.window !== A && A.self !== A || (n = A);
  32601. 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 = {
  32602. overflow: "Overflow: input needs wider integers to process",
  32603. "not-basic": "Illegal input >= 0x80 (not a basic code point)",
  32604. "invalid-input": "Invalid input"
  32605. }, D = E - b, N = Math.floor, B = String.fromCharCode;
  32606. if (y = {
  32607. version: "1.4.1",
  32608. ucs2: {
  32609. decode: s,
  32610. encode: l
  32611. },
  32612. decode: d,
  32613. encode: p,
  32614. toASCII: g,
  32615. toUnicode: f
  32616. },
  32617. "function" == typeof define && "object" == typeof define.amd && define.amd)
  32618. define("punycode", function() {
  32619. return y
  32620. });
  32621. else if (m && v)
  32622. if (t.exports == m)
  32623. v.exports = y;
  32624. else
  32625. for (C in y)
  32626. y.hasOwnProperty(C) && (m[C] = y[C]);
  32627. else
  32628. n.punycode = y
  32629. }(this)
  32630. }
  32631. ).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
  32632. }
  32633. , {}],
  32634. 205: [function(e, t, i) {
  32635. "use strict";
  32636. function n(e, t) {
  32637. return Object.prototype.hasOwnProperty.call(e, t)
  32638. }
  32639. t.exports = function(e, t, i, o) {
  32640. t = t || "&",
  32641. i = i || "=";
  32642. var a = {};
  32643. if ("string" != typeof e || 0 === e.length)
  32644. return a;
  32645. var s = /\+/g;
  32646. e = e.split(t);
  32647. var l = 1e3;
  32648. o && "number" == typeof o.maxKeys && (l = o.maxKeys);
  32649. var c = e.length;
  32650. l > 0 && c > l && (c = l);
  32651. for (var h = 0; h < c; ++h) {
  32652. var u, d, p, f, g = e[h].replace(s, "%20"), m = g.indexOf(i);
  32653. m >= 0 ? (u = g.substr(0, m),
  32654. d = g.substr(m + 1)) : (u = g,
  32655. d = ""),
  32656. p = decodeURIComponent(u),
  32657. f = decodeURIComponent(d),
  32658. n(a, p) ? r(a[p]) ? a[p].push(f) : a[p] = [a[p], f] : a[p] = f
  32659. }
  32660. return a
  32661. }
  32662. ;
  32663. var r = Array.isArray || function(e) {
  32664. return "[object Array]" === Object.prototype.toString.call(e)
  32665. }
  32666. }
  32667. , {}],
  32668. 206: [function(e, t, i) {
  32669. "use strict";
  32670. function n(e, t) {
  32671. if (e.map)
  32672. return e.map(t);
  32673. for (var i = [], n = 0; n < e.length; n++)
  32674. i.push(t(e[n], n));
  32675. return i
  32676. }
  32677. var r = function(e) {
  32678. switch (typeof e) {
  32679. case "string":
  32680. return e;
  32681. case "boolean":
  32682. return e ? "true" : "false";
  32683. case "number":
  32684. return isFinite(e) ? e : "";
  32685. default:
  32686. return ""
  32687. }
  32688. };
  32689. t.exports = function(e, t, i, s) {
  32690. return t = t || "&",
  32691. i = i || "=",
  32692. null === e && (e = void 0),
  32693. "object" == typeof e ? n(a(e), function(a) {
  32694. var s = encodeURIComponent(r(a)) + i;
  32695. return o(e[a]) ? n(e[a], function(e) {
  32696. return s + encodeURIComponent(r(e))
  32697. }).join(t) : s + encodeURIComponent(r(e[a]))
  32698. }).join(t) : s ? encodeURIComponent(r(s)) + i + encodeURIComponent(r(e)) : ""
  32699. }
  32700. ;
  32701. var o = Array.isArray || function(e) {
  32702. return "[object Array]" === Object.prototype.toString.call(e)
  32703. }
  32704. , a = Object.keys || function(e) {
  32705. var t = [];
  32706. for (var i in e)
  32707. Object.prototype.hasOwnProperty.call(e, i) && t.push(i);
  32708. return t
  32709. }
  32710. }
  32711. , {}],
  32712. 207: [function(e, t, i) {
  32713. "use strict";
  32714. i.decode = i.parse = e("./decode"),
  32715. i.encode = i.stringify = e("./encode")
  32716. }
  32717. , {
  32718. "./decode": 205,
  32719. "./encode": 206
  32720. }],
  32721. 208: [function(e, t, i) {
  32722. "use strict";
  32723. function n() {
  32724. this.protocol = null,
  32725. this.slashes = null,
  32726. this.auth = null,
  32727. this.host = null,
  32728. this.port = null,
  32729. this.hostname = null,
  32730. this.hash = null,
  32731. this.search = null,
  32732. this.query = null,
  32733. this.pathname = null,
  32734. this.path = null,
  32735. this.href = null
  32736. }
  32737. function r(e, t, i) {
  32738. if (e && c.isObject(e) && e instanceof n)
  32739. return e;
  32740. var r = new n;
  32741. return r.parse(e, t, i),
  32742. r
  32743. }
  32744. function o(e) {
  32745. return c.isString(e) && (e = r(e)),
  32746. e instanceof n ? e.format() : n.prototype.format.call(e)
  32747. }
  32748. function a(e, t) {
  32749. return r(e, !1, !0).resolve(t)
  32750. }
  32751. function s(e, t) {
  32752. return e ? r(e, !1, !0).resolveObject(t) : t
  32753. }
  32754. var l = e("punycode")
  32755. , c = e("./util");
  32756. i.parse = r,
  32757. i.resolve = a,
  32758. i.resolveObject = s,
  32759. i.format = o,
  32760. i.Url = n;
  32761. var h = /^([a-z0-9.+-]+:)/i
  32762. , u = /:[0-9]*$/
  32763. , d = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/
  32764. , p = ["<", ">", '"', "`", " ", "\r", "\n", "\t"]
  32765. , f = ["{", "}", "|", "\\", "^", "`"].concat(p)
  32766. , g = ["'"].concat(f)
  32767. , m = ["%", "/", "?", ";", "#"].concat(g)
  32768. , v = ["/", "?", "#"]
  32769. , A = 255
  32770. , y = /^[+a-z0-9A-Z_-]{0,63}$/
  32771. , C = /^([+a-z0-9A-Z_-]{0,63})(.*)$/
  32772. , I = {
  32773. javascript: !0,
  32774. "javascript:": !0
  32775. }
  32776. , E = {
  32777. javascript: !0,
  32778. "javascript:": !0
  32779. }
  32780. , b = {
  32781. http: !0,
  32782. https: !0,
  32783. ftp: !0,
  32784. gopher: !0,
  32785. file: !0,
  32786. "http:": !0,
  32787. "https:": !0,
  32788. "ftp:": !0,
  32789. "gopher:": !0,
  32790. "file:": !0
  32791. }
  32792. , w = e("querystring");
  32793. n.prototype.parse = function(e, t, i) {
  32794. if (!c.isString(e))
  32795. throw new TypeError("Parameter 'url' must be a string, not " + typeof e);
  32796. var n = e.indexOf("?")
  32797. , r = n !== -1 && n < e.indexOf("#") ? "?" : "#"
  32798. , o = e.split(r)
  32799. , a = /\\/g;
  32800. o[0] = o[0].replace(a, "/"),
  32801. e = o.join(r);
  32802. var s = e;
  32803. if (s = s.trim(),
  32804. !i && 1 === e.split("#").length) {
  32805. var u = d.exec(s);
  32806. if (u)
  32807. return this.path = s,
  32808. this.href = s,
  32809. this.pathname = u[1],
  32810. u[2] ? (this.search = u[2],
  32811. t ? this.query = w.parse(this.search.substr(1)) : this.query = this.search.substr(1)) : t && (this.search = "",
  32812. this.query = {}),
  32813. this
  32814. }
  32815. var p = h.exec(s);
  32816. if (p) {
  32817. p = p[0];
  32818. var f = p.toLowerCase();
  32819. this.protocol = f,
  32820. s = s.substr(p.length)
  32821. }
  32822. if (i || p || s.match(/^\/\/[^@\/]+@[^@\/]+/)) {
  32823. var _ = "//" === s.substr(0, 2);
  32824. !_ || p && E[p] || (s = s.substr(2),
  32825. this.slashes = !0)
  32826. }
  32827. if (!E[p] && (_ || p && !b[p])) {
  32828. for (var T = -1, x = 0; x < v.length; x++) {
  32829. var S = s.indexOf(v[x]);
  32830. S !== -1 && (T === -1 || S < T) && (T = S)
  32831. }
  32832. var M, R;
  32833. R = T === -1 ? s.lastIndexOf("@") : s.lastIndexOf("@", T),
  32834. R !== -1 && (M = s.slice(0, R),
  32835. s = s.slice(R + 1),
  32836. this.auth = decodeURIComponent(M)),
  32837. T = -1;
  32838. for (var x = 0; x < m.length; x++) {
  32839. var S = s.indexOf(m[x]);
  32840. S !== -1 && (T === -1 || S < T) && (T = S)
  32841. }
  32842. T === -1 && (T = s.length),
  32843. this.host = s.slice(0, T),
  32844. s = s.slice(T),
  32845. this.parseHost(),
  32846. this.hostname = this.hostname || "";
  32847. var P = "[" === this.hostname[0] && "]" === this.hostname[this.hostname.length - 1];
  32848. if (!P)
  32849. for (var O = this.hostname.split(/\./), x = 0, L = O.length; x < L; x++) {
  32850. var D = O[x];
  32851. if (D && !D.match(y)) {
  32852. for (var N = "", B = 0, F = D.length; B < F; B++)
  32853. N += D.charCodeAt(B) > 127 ? "x" : D[B];
  32854. if (!N.match(y)) {
  32855. var V = O.slice(0, x)
  32856. , U = O.slice(x + 1)
  32857. , k = D.match(C);
  32858. k && (V.push(k[1]),
  32859. U.unshift(k[2])),
  32860. U.length && (s = "/" + U.join(".") + s),
  32861. this.hostname = V.join(".");
  32862. break
  32863. }
  32864. }
  32865. }
  32866. this.hostname.length > A ? this.hostname = "" : this.hostname = this.hostname.toLowerCase(),
  32867. P || (this.hostname = l.toASCII(this.hostname));
  32868. var H = this.port ? ":" + this.port : ""
  32869. , G = this.hostname || "";
  32870. this.host = G + H,
  32871. this.href += this.host,
  32872. P && (this.hostname = this.hostname.substr(1, this.hostname.length - 2),
  32873. "/" !== s[0] && (s = "/" + s))
  32874. }
  32875. if (!I[f])
  32876. for (var x = 0, L = g.length; x < L; x++) {
  32877. var z = g[x];
  32878. if (s.indexOf(z) !== -1) {
  32879. var W = encodeURIComponent(z);
  32880. W === z && (W = escape(z)),
  32881. s = s.split(z).join(W)
  32882. }
  32883. }
  32884. var j = s.indexOf("#");
  32885. j !== -1 && (this.hash = s.substr(j),
  32886. s = s.slice(0, j));
  32887. var Y = s.indexOf("?");
  32888. if (Y !== -1 ? (this.search = s.substr(Y),
  32889. this.query = s.substr(Y + 1),
  32890. t && (this.query = w.parse(this.query)),
  32891. s = s.slice(0, Y)) : t && (this.search = "",
  32892. this.query = {}),
  32893. s && (this.pathname = s),
  32894. b[f] && this.hostname && !this.pathname && (this.pathname = "/"),
  32895. this.pathname || this.search) {
  32896. var H = this.pathname || ""
  32897. , X = this.search || "";
  32898. this.path = H + X
  32899. }
  32900. return this.href = this.format(),
  32901. this
  32902. }
  32903. ,
  32904. n.prototype.format = function() {
  32905. var e = this.auth || "";
  32906. e && (e = encodeURIComponent(e),
  32907. e = e.replace(/%3A/i, ":"),
  32908. e += "@");
  32909. var t = this.protocol || ""
  32910. , i = this.pathname || ""
  32911. , n = this.hash || ""
  32912. , r = !1
  32913. , o = "";
  32914. this.host ? r = e + this.host : this.hostname && (r = e + (this.hostname.indexOf(":") === -1 ? this.hostname : "[" + this.hostname + "]"),
  32915. this.port && (r += ":" + this.port)),
  32916. this.query && c.isObject(this.query) && Object.keys(this.query).length && (o = w.stringify(this.query));
  32917. var a = this.search || o && "?" + o || "";
  32918. return t && ":" !== t.substr(-1) && (t += ":"),
  32919. this.slashes || (!t || b[t]) && r !== !1 ? (r = "//" + (r || ""),
  32920. i && "/" !== i.charAt(0) && (i = "/" + i)) : r || (r = ""),
  32921. n && "#" !== n.charAt(0) && (n = "#" + n),
  32922. a && "?" !== a.charAt(0) && (a = "?" + a),
  32923. i = i.replace(/[?#]/g, function(e) {
  32924. return encodeURIComponent(e)
  32925. }),
  32926. a = a.replace("#", "%23"),
  32927. t + r + i + a + n
  32928. }
  32929. ,
  32930. n.prototype.resolve = function(e) {
  32931. return this.resolveObject(r(e, !1, !0)).format()
  32932. }
  32933. ,
  32934. n.prototype.resolveObject = function(e) {
  32935. if (c.isString(e)) {
  32936. var t = new n;
  32937. t.parse(e, !1, !0),
  32938. e = t
  32939. }
  32940. for (var i = new n, r = Object.keys(this), o = 0; o < r.length; o++) {
  32941. var a = r[o];
  32942. i[a] = this[a]
  32943. }
  32944. if (i.hash = e.hash,
  32945. "" === e.href)
  32946. return i.href = i.format(),
  32947. i;
  32948. if (e.slashes && !e.protocol) {
  32949. for (var s = Object.keys(e), l = 0; l < s.length; l++) {
  32950. var h = s[l];
  32951. "protocol" !== h && (i[h] = e[h])
  32952. }
  32953. return b[i.protocol] && i.hostname && !i.pathname && (i.path = i.pathname = "/"),
  32954. i.href = i.format(),
  32955. i
  32956. }
  32957. if (e.protocol && e.protocol !== i.protocol) {
  32958. if (!b[e.protocol]) {
  32959. for (var u = Object.keys(e), d = 0; d < u.length; d++) {
  32960. var p = u[d];
  32961. i[p] = e[p]
  32962. }
  32963. return i.href = i.format(),
  32964. i
  32965. }
  32966. if (i.protocol = e.protocol,
  32967. e.host || E[e.protocol])
  32968. i.pathname = e.pathname;
  32969. else {
  32970. for (var f = (e.pathname || "").split("/"); f.length && !(e.host = f.shift()); )
  32971. ;
  32972. e.host || (e.host = ""),
  32973. e.hostname || (e.hostname = ""),
  32974. "" !== f[0] && f.unshift(""),
  32975. f.length < 2 && f.unshift(""),
  32976. i.pathname = f.join("/")
  32977. }
  32978. if (i.search = e.search,
  32979. i.query = e.query,
  32980. i.host = e.host || "",
  32981. i.auth = e.auth,
  32982. i.hostname = e.hostname || e.host,
  32983. i.port = e.port,
  32984. i.pathname || i.search) {
  32985. var g = i.pathname || ""
  32986. , m = i.search || "";
  32987. i.path = g + m
  32988. }
  32989. return i.slashes = i.slashes || e.slashes,
  32990. i.href = i.format(),
  32991. i
  32992. }
  32993. var v = i.pathname && "/" === i.pathname.charAt(0)
  32994. , A = e.host || e.pathname && "/" === e.pathname.charAt(0)
  32995. , y = A || v || i.host && e.pathname
  32996. , C = y
  32997. , I = i.pathname && i.pathname.split("/") || []
  32998. , f = e.pathname && e.pathname.split("/") || []
  32999. , w = i.protocol && !b[i.protocol];
  33000. if (w && (i.hostname = "",
  33001. i.port = null,
  33002. i.host && ("" === I[0] ? I[0] = i.host : I.unshift(i.host)),
  33003. i.host = "",
  33004. e.protocol && (e.hostname = null,
  33005. e.port = null,
  33006. e.host && ("" === f[0] ? f[0] = e.host : f.unshift(e.host)),
  33007. e.host = null),
  33008. y = y && ("" === f[0] || "" === I[0])),
  33009. A)
  33010. i.host = e.host || "" === e.host ? e.host : i.host,
  33011. i.hostname = e.hostname || "" === e.hostname ? e.hostname : i.hostname,
  33012. i.search = e.search,
  33013. i.query = e.query,
  33014. I = f;
  33015. else if (f.length)
  33016. I || (I = []),
  33017. I.pop(),
  33018. I = I.concat(f),
  33019. i.search = e.search,
  33020. i.query = e.query;
  33021. else if (!c.isNullOrUndefined(e.search)) {
  33022. if (w) {
  33023. i.hostname = i.host = I.shift();
  33024. var _ = !!(i.host && i.host.indexOf("@") > 0) && i.host.split("@");
  33025. _ && (i.auth = _.shift(),
  33026. i.host = i.hostname = _.shift())
  33027. }
  33028. return i.search = e.search,
  33029. i.query = e.query,
  33030. c.isNull(i.pathname) && c.isNull(i.search) || (i.path = (i.pathname ? i.pathname : "") + (i.search ? i.search : "")),
  33031. i.href = i.format(),
  33032. i
  33033. }
  33034. if (!I.length)
  33035. return i.pathname = null,
  33036. i.search ? i.path = "/" + i.search : i.path = null,
  33037. i.href = i.format(),
  33038. i;
  33039. 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--)
  33040. T = I[M],
  33041. "." === T ? I.splice(M, 1) : ".." === T ? (I.splice(M, 1),
  33042. S++) : S && (I.splice(M, 1),
  33043. S--);
  33044. if (!y && !C)
  33045. for (; S--; S)
  33046. I.unshift("..");
  33047. !y || "" === I[0] || I[0] && "/" === I[0].charAt(0) || I.unshift(""),
  33048. x && "/" !== I.join("/").substr(-1) && I.push("");
  33049. var R = "" === I[0] || I[0] && "/" === I[0].charAt(0);
  33050. if (w) {
  33051. i.hostname = i.host = R ? "" : I.length ? I.shift() : "";
  33052. var _ = !!(i.host && i.host.indexOf("@") > 0) && i.host.split("@");
  33053. _ && (i.auth = _.shift(),
  33054. i.host = i.hostname = _.shift())
  33055. }
  33056. return y = y || i.host && I.length,
  33057. y && !R && I.unshift(""),
  33058. I.length ? i.pathname = I.join("/") : (i.pathname = null,
  33059. i.path = null),
  33060. c.isNull(i.pathname) && c.isNull(i.search) || (i.path = (i.pathname ? i.pathname : "") + (i.search ? i.search : "")),
  33061. i.auth = e.auth || i.auth,
  33062. i.slashes = i.slashes || e.slashes,
  33063. i.href = i.format(),
  33064. i
  33065. }
  33066. ,
  33067. n.prototype.parseHost = function() {
  33068. var e = this.host
  33069. , t = u.exec(e);
  33070. t && (t = t[0],
  33071. ":" !== t && (this.port = t.substr(1)),
  33072. e = e.substr(0, e.length - t.length)),
  33073. e && (this.hostname = e)
  33074. }
  33075. }
  33076. , {
  33077. "./util": 209,
  33078. punycode: 204,
  33079. querystring: 207
  33080. }],
  33081. 209: [function(e, t, i) {
  33082. "use strict";
  33083. t.exports = {
  33084. isString: function(e) {
  33085. return "string" == typeof e
  33086. },
  33087. isObject: function(e) {
  33088. return "object" == typeof e && null !== e
  33089. },
  33090. isNull: function(e) {
  33091. return null === e
  33092. },
  33093. isNullOrUndefined: function(e) {
  33094. return null == e
  33095. }
  33096. }
  33097. }
  33098. , {}],
  33099. 210: [function(e, t, i) {
  33100. "use strict";
  33101. function n(e) {
  33102. return l + e
  33103. }
  33104. function r(e) {
  33105. return e.substring(l.length)
  33106. }
  33107. function o(e, t) {
  33108. for (var i in t)
  33109. Object.defineProperty(e, i, {
  33110. value: t[i],
  33111. configurable: !0,
  33112. writable: !0
  33113. })
  33114. }
  33115. function a(e) {
  33116. if ("string" != typeof e)
  33117. throw new TypeError("key must be a string.")
  33118. }
  33119. var s = Object.prototype.hasOwnProperty
  33120. , l = "~";
  33121. t.exports = function(e) {
  33122. var t = Object.create(null)
  33123. , i = 0
  33124. , l = {};
  33125. return o(l, {
  33126. get: function(e, i) {
  33127. a(e);
  33128. var r = n(e);
  33129. return r in t ? t[r] : i
  33130. },
  33131. set: function(e, r) {
  33132. a(e);
  33133. var o = n(e);
  33134. return o in t || ++i,
  33135. t[o] = r
  33136. },
  33137. has: function(e) {
  33138. return a(e),
  33139. n(e)in t
  33140. },
  33141. delete: function(e) {
  33142. a(e);
  33143. var r = n(e);
  33144. return r in t && (--i,
  33145. delete t[r],
  33146. !0)
  33147. },
  33148. clear: function() {
  33149. t = Object.create(null),
  33150. i = 0
  33151. },
  33152. forEach: function(e, i) {
  33153. if ("function" != typeof e)
  33154. throw new TypeError("`callback` must be a function");
  33155. for (var n in t)
  33156. if (s.call(t, n)) {
  33157. var o = r(n)
  33158. , a = t[n];
  33159. e.call(i, a, o, l)
  33160. }
  33161. }
  33162. }),
  33163. Object.defineProperty(l, "size", {
  33164. get: function() {
  33165. return i
  33166. },
  33167. configurable: !0
  33168. }),
  33169. "object" == typeof e && null !== e && Object.keys(e).forEach(function(t) {
  33170. l.set(t, e[t])
  33171. }),
  33172. l
  33173. }
  33174. }
  33175. , {}],
  33176. 211: [function(e, t, i) {
  33177. t.exports = e("./lib/heap")
  33178. }
  33179. , {
  33180. "./lib/heap": 212
  33181. }],
  33182. 212: [function(e, t, i) {
  33183. (function() {
  33184. var e, n, r, o, a, s, l, c, h, u, d, p, f, g, m;
  33185. r = Math.floor,
  33186. u = Math.min,
  33187. n = function(e, t) {
  33188. return e < t ? -1 : e > t ? 1 : 0
  33189. }
  33190. ,
  33191. h = function(e, t, i, o, a) {
  33192. var s;
  33193. if (null == i && (i = 0),
  33194. null == a && (a = n),
  33195. i < 0)
  33196. throw new Error("lo must be non-negative");
  33197. for (null == o && (o = e.length); i < o; )
  33198. s = r((i + o) / 2),
  33199. a(t, e[s]) < 0 ? o = s : i = s + 1;
  33200. return [].splice.apply(e, [i, i - i].concat(t)),
  33201. t
  33202. }
  33203. ,
  33204. s = function(e, t, i) {
  33205. return null == i && (i = n),
  33206. e.push(t),
  33207. g(e, 0, e.length - 1, i)
  33208. }
  33209. ,
  33210. a = function(e, t) {
  33211. var i, r;
  33212. return null == t && (t = n),
  33213. i = e.pop(),
  33214. e.length ? (r = e[0],
  33215. e[0] = i,
  33216. m(e, 0, t)) : r = i,
  33217. r
  33218. }
  33219. ,
  33220. c = function(e, t, i) {
  33221. var r;
  33222. return null == i && (i = n),
  33223. r = e[0],
  33224. e[0] = t,
  33225. m(e, 0, i),
  33226. r
  33227. }
  33228. ,
  33229. l = function(e, t, i) {
  33230. var r;
  33231. return null == i && (i = n),
  33232. e.length && i(e[0], t) < 0 && (r = [e[0], t],
  33233. t = r[0],
  33234. e[0] = r[1],
  33235. m(e, 0, i)),
  33236. t
  33237. }
  33238. ,
  33239. o = function(e, t) {
  33240. var i, o, a, s, l, c;
  33241. for (null == t && (t = n),
  33242. s = function() {
  33243. c = [];
  33244. for (var t = 0, i = r(e.length / 2); 0 <= i ? t < i : t > i; 0 <= i ? t++ : t--)
  33245. c.push(t);
  33246. return c
  33247. }
  33248. .apply(this).reverse(),
  33249. l = [],
  33250. o = 0,
  33251. a = s.length; o < a; o++)
  33252. i = s[o],
  33253. l.push(m(e, i, t));
  33254. return l
  33255. }
  33256. ,
  33257. f = function(e, t, i) {
  33258. var r;
  33259. if (null == i && (i = n),
  33260. r = e.indexOf(t),
  33261. r !== -1)
  33262. return g(e, 0, r, i),
  33263. m(e, r, i)
  33264. }
  33265. ,
  33266. d = function(e, t, i) {
  33267. var r, a, s, c, h;
  33268. if (null == i && (i = n),
  33269. a = e.slice(0, t),
  33270. !a.length)
  33271. return a;
  33272. for (o(a, i),
  33273. h = e.slice(t),
  33274. s = 0,
  33275. c = h.length; s < c; s++)
  33276. r = h[s],
  33277. l(a, r, i);
  33278. return a.sort(i).reverse()
  33279. }
  33280. ,
  33281. p = function(e, t, i) {
  33282. var r, s, l, c, d, p, f, g, m, v;
  33283. if (null == i && (i = n),
  33284. 10 * t <= e.length) {
  33285. if (c = e.slice(0, t).sort(i),
  33286. !c.length)
  33287. return c;
  33288. for (l = c[c.length - 1],
  33289. g = e.slice(t),
  33290. d = 0,
  33291. f = g.length; d < f; d++)
  33292. r = g[d],
  33293. i(r, l) < 0 && (h(c, r, 0, null, i),
  33294. c.pop(),
  33295. l = c[c.length - 1]);
  33296. return c
  33297. }
  33298. for (o(e, i),
  33299. v = [],
  33300. s = p = 0,
  33301. m = u(t, e.length); 0 <= m ? p < m : p > m; s = 0 <= m ? ++p : --p)
  33302. v.push(a(e, i));
  33303. return v
  33304. }
  33305. ,
  33306. g = function(e, t, i, r) {
  33307. var o, a, s;
  33308. for (null == r && (r = n),
  33309. o = e[i]; i > t && (s = i - 1 >> 1,
  33310. a = e[s],
  33311. r(o, a) < 0); )
  33312. e[i] = a,
  33313. i = s;
  33314. return e[i] = o
  33315. }
  33316. ,
  33317. m = function(e, t, i) {
  33318. var r, o, a, s, l;
  33319. for (null == i && (i = n),
  33320. o = e.length,
  33321. l = t,
  33322. a = e[t],
  33323. r = 2 * t + 1; r < o; )
  33324. s = r + 1,
  33325. s < o && !(i(e[r], e[s]) < 0) && (r = s),
  33326. e[t] = e[r],
  33327. t = r,
  33328. r = 2 * t + 1;
  33329. return e[t] = a,
  33330. g(e, l, t, i)
  33331. }
  33332. ,
  33333. e = function() {
  33334. function e(e) {
  33335. this.cmp = null != e ? e : n,
  33336. this.nodes = []
  33337. }
  33338. return e.push = s,
  33339. e.pop = a,
  33340. e.replace = c,
  33341. e.pushpop = l,
  33342. e.heapify = o,
  33343. e.updateItem = f,
  33344. e.nlargest = d,
  33345. e.nsmallest = p,
  33346. e.prototype.push = function(e) {
  33347. return s(this.nodes, e, this.cmp)
  33348. }
  33349. ,
  33350. e.prototype.pop = function() {
  33351. return a(this.nodes, this.cmp)
  33352. }
  33353. ,
  33354. e.prototype.peek = function() {
  33355. return this.nodes[0]
  33356. }
  33357. ,
  33358. e.prototype.contains = function(e) {
  33359. return this.nodes.indexOf(e) !== -1
  33360. }
  33361. ,
  33362. e.prototype.replace = function(e) {
  33363. return c(this.nodes, e, this.cmp)
  33364. }
  33365. ,
  33366. e.prototype.pushpop = function(e) {
  33367. return l(this.nodes, e, this.cmp)
  33368. }
  33369. ,
  33370. e.prototype.heapify = function() {
  33371. return o(this.nodes, this.cmp)
  33372. }
  33373. ,
  33374. e.prototype.updateItem = function(e) {
  33375. return f(this.nodes, e, this.cmp)
  33376. }
  33377. ,
  33378. e.prototype.clear = function() {
  33379. return this.nodes = []
  33380. }
  33381. ,
  33382. e.prototype.empty = function() {
  33383. return 0 === this.nodes.length
  33384. }
  33385. ,
  33386. e.prototype.size = function() {
  33387. return this.nodes.length
  33388. }
  33389. ,
  33390. e.prototype.clone = function() {
  33391. var t;
  33392. return t = new e,
  33393. t.nodes = this.nodes.slice(0),
  33394. t
  33395. }
  33396. ,
  33397. e.prototype.toArray = function() {
  33398. return this.nodes.slice(0)
  33399. }
  33400. ,
  33401. e.prototype.insert = e.prototype.push,
  33402. e.prototype.top = e.prototype.peek,
  33403. e.prototype.front = e.prototype.peek,
  33404. e.prototype.has = e.prototype.contains,
  33405. e.prototype.copy = e.prototype.clone,
  33406. e
  33407. }(),
  33408. function(e, n) {
  33409. return "function" == typeof define && define.amd ? define([], n) : "object" == typeof i ? t.exports = n() : e.Heap = n()
  33410. }(this, function() {
  33411. return e
  33412. })
  33413. }
  33414. ).call(this)
  33415. }
  33416. , {}],
  33417. 213: [function(e, t, i) {
  33418. !function(e) {
  33419. function i() {}
  33420. function n(e, t) {
  33421. return function() {
  33422. e.apply(t, arguments)
  33423. }
  33424. }
  33425. function r(e) {
  33426. if ("object" != typeof this)
  33427. throw new TypeError("Promises must be constructed via new");
  33428. if ("function" != typeof e)
  33429. throw new TypeError("not a function");
  33430. this._state = 0,
  33431. this._handled = !1,
  33432. this._value = void 0,
  33433. this._deferreds = [],
  33434. h(e, this)
  33435. }
  33436. function o(e, t) {
  33437. for (; 3 === e._state; )
  33438. e = e._value;
  33439. return 0 === e._state ? void e._deferreds.push(t) : (e._handled = !0,
  33440. void r._immediateFn(function() {
  33441. var i = 1 === e._state ? t.onFulfilled : t.onRejected;
  33442. if (null === i)
  33443. return void (1 === e._state ? a : s)(t.promise, e._value);
  33444. var n;
  33445. try {
  33446. n = i(e._value)
  33447. } catch (e) {
  33448. return void s(t.promise, e)
  33449. }
  33450. a(t.promise, n)
  33451. }))
  33452. }
  33453. function a(e, t) {
  33454. try {
  33455. if (t === e)
  33456. throw new TypeError("A promise cannot be resolved with itself.");
  33457. if (t && ("object" == typeof t || "function" == typeof t)) {
  33458. var i = t.then;
  33459. if (t instanceof r)
  33460. return e._state = 3,
  33461. e._value = t,
  33462. void l(e);
  33463. if ("function" == typeof i)
  33464. return void h(n(i, t), e)
  33465. }
  33466. e._state = 1,
  33467. e._value = t,
  33468. l(e)
  33469. } catch (t) {
  33470. s(e, t)
  33471. }
  33472. }
  33473. function s(e, t) {
  33474. e._state = 2,
  33475. e._value = t,
  33476. l(e)
  33477. }
  33478. function l(e) {
  33479. 2 === e._state && 0 === e._deferreds.length && r._immediateFn(function() {
  33480. e._handled || r._unhandledRejectionFn(e._value)
  33481. });
  33482. for (var t = 0, i = e._deferreds.length; t < i; t++)
  33483. o(e, e._deferreds[t]);
  33484. e._deferreds = null
  33485. }
  33486. function c(e, t, i) {
  33487. this.onFulfilled = "function" == typeof e ? e : null,
  33488. this.onRejected = "function" == typeof t ? t : null,
  33489. this.promise = i
  33490. }
  33491. function h(e, t) {
  33492. var i = !1;
  33493. try {
  33494. e(function(e) {
  33495. i || (i = !0,
  33496. a(t, e))
  33497. }, function(e) {
  33498. i || (i = !0,
  33499. s(t, e))
  33500. })
  33501. } catch (e) {
  33502. if (i)
  33503. return;
  33504. i = !0,
  33505. s(t, e)
  33506. }
  33507. }
  33508. var u = setTimeout;
  33509. r.prototype.catch = function(e) {
  33510. return this.then(null, e)
  33511. }
  33512. ,
  33513. r.prototype.then = function(e, t) {
  33514. var n = new this.constructor(i);
  33515. return o(this, new c(e,t,n)),
  33516. n
  33517. }
  33518. ,
  33519. r.all = function(e) {
  33520. var t = Array.prototype.slice.call(e);
  33521. return new r(function(e, i) {
  33522. function n(o, a) {
  33523. try {
  33524. if (a && ("object" == typeof a || "function" == typeof a)) {
  33525. var s = a.then;
  33526. if ("function" == typeof s)
  33527. return void s.call(a, function(e) {
  33528. n(o, e)
  33529. }, i)
  33530. }
  33531. t[o] = a,
  33532. 0 === --r && e(t)
  33533. } catch (e) {
  33534. i(e)
  33535. }
  33536. }
  33537. if (0 === t.length)
  33538. return e([]);
  33539. for (var r = t.length, o = 0; o < t.length; o++)
  33540. n(o, t[o])
  33541. }
  33542. )
  33543. }
  33544. ,
  33545. r.resolve = function(e) {
  33546. return e && "object" == typeof e && e.constructor === r ? e : new r(function(t) {
  33547. t(e)
  33548. }
  33549. )
  33550. }
  33551. ,
  33552. r.reject = function(e) {
  33553. return new r(function(t, i) {
  33554. i(e)
  33555. }
  33556. )
  33557. }
  33558. ,
  33559. r.race = function(e) {
  33560. return new r(function(t, i) {
  33561. for (var n = 0, r = e.length; n < r; n++)
  33562. e[n].then(t, i)
  33563. }
  33564. )
  33565. }
  33566. ,
  33567. r._immediateFn = "function" == typeof setImmediate && function(e) {
  33568. setImmediate(e)
  33569. }
  33570. || function(e) {
  33571. u(e, 0)
  33572. }
  33573. ,
  33574. r._unhandledRejectionFn = function(e) {
  33575. "undefined" != typeof console && console && console.warn("Possible Unhandled Promise Rejection:", e)
  33576. }
  33577. ,
  33578. r._setImmediateFn = function(e) {
  33579. r._immediateFn = e
  33580. }
  33581. ,
  33582. r._setUnhandledRejectionFn = function(e) {
  33583. r._unhandledRejectionFn = e
  33584. }
  33585. ,
  33586. "undefined" != typeof t && t.exports ? t.exports = r : e.Promise || (e.Promise = r)
  33587. }(this)
  33588. }
  33589. , {}],
  33590. 214: [function(e, t, i) {
  33591. (function(i) {
  33592. !function(i, n) {
  33593. "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)
  33594. }(this, function(t, n) {
  33595. "use strict";
  33596. var r = {};
  33597. return r.ByteBuffer = t,
  33598. r.Long = t.Long || null,
  33599. r.VERSION = "5.0.1",
  33600. r.WIRE_TYPES = {},
  33601. r.WIRE_TYPES.VARINT = 0,
  33602. r.WIRE_TYPES.BITS64 = 1,
  33603. r.WIRE_TYPES.LDELIM = 2,
  33604. r.WIRE_TYPES.STARTGROUP = 3,
  33605. r.WIRE_TYPES.ENDGROUP = 4,
  33606. r.WIRE_TYPES.BITS32 = 5,
  33607. r.PACKABLE_WIRE_TYPES = [r.WIRE_TYPES.VARINT, r.WIRE_TYPES.BITS64, r.WIRE_TYPES.BITS32],
  33608. r.TYPES = {
  33609. int32: {
  33610. name: "int32",
  33611. wireType: r.WIRE_TYPES.VARINT,
  33612. defaultValue: 0
  33613. },
  33614. uint32: {
  33615. name: "uint32",
  33616. wireType: r.WIRE_TYPES.VARINT,
  33617. defaultValue: 0
  33618. },
  33619. sint32: {
  33620. name: "sint32",
  33621. wireType: r.WIRE_TYPES.VARINT,
  33622. defaultValue: 0
  33623. },
  33624. int64: {
  33625. name: "int64",
  33626. wireType: r.WIRE_TYPES.VARINT,
  33627. defaultValue: r.Long ? r.Long.ZERO : void 0
  33628. },
  33629. uint64: {
  33630. name: "uint64",
  33631. wireType: r.WIRE_TYPES.VARINT,
  33632. defaultValue: r.Long ? r.Long.UZERO : void 0
  33633. },
  33634. sint64: {
  33635. name: "sint64",
  33636. wireType: r.WIRE_TYPES.VARINT,
  33637. defaultValue: r.Long ? r.Long.ZERO : void 0
  33638. },
  33639. bool: {
  33640. name: "bool",
  33641. wireType: r.WIRE_TYPES.VARINT,
  33642. defaultValue: !1
  33643. },
  33644. double: {
  33645. name: "double",
  33646. wireType: r.WIRE_TYPES.BITS64,
  33647. defaultValue: 0
  33648. },
  33649. string: {
  33650. name: "string",
  33651. wireType: r.WIRE_TYPES.LDELIM,
  33652. defaultValue: ""
  33653. },
  33654. bytes: {
  33655. name: "bytes",
  33656. wireType: r.WIRE_TYPES.LDELIM,
  33657. defaultValue: null
  33658. },
  33659. fixed32: {
  33660. name: "fixed32",
  33661. wireType: r.WIRE_TYPES.BITS32,
  33662. defaultValue: 0
  33663. },
  33664. sfixed32: {
  33665. name: "sfixed32",
  33666. wireType: r.WIRE_TYPES.BITS32,
  33667. defaultValue: 0
  33668. },
  33669. fixed64: {
  33670. name: "fixed64",
  33671. wireType: r.WIRE_TYPES.BITS64,
  33672. defaultValue: r.Long ? r.Long.UZERO : void 0
  33673. },
  33674. sfixed64: {
  33675. name: "sfixed64",
  33676. wireType: r.WIRE_TYPES.BITS64,
  33677. defaultValue: r.Long ? r.Long.ZERO : void 0
  33678. },
  33679. float: {
  33680. name: "float",
  33681. wireType: r.WIRE_TYPES.BITS32,
  33682. defaultValue: 0
  33683. },
  33684. enum: {
  33685. name: "enum",
  33686. wireType: r.WIRE_TYPES.VARINT,
  33687. defaultValue: 0
  33688. },
  33689. message: {
  33690. name: "message",
  33691. wireType: r.WIRE_TYPES.LDELIM,
  33692. defaultValue: null
  33693. },
  33694. group: {
  33695. name: "group",
  33696. wireType: r.WIRE_TYPES.STARTGROUP,
  33697. defaultValue: null
  33698. }
  33699. },
  33700. 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],
  33701. r.ID_MIN = 1,
  33702. r.ID_MAX = 536870911,
  33703. r.convertFieldsToCamelCase = !1,
  33704. r.populateAccessors = !0,
  33705. r.populateDefaults = !0,
  33706. r.Util = function() {
  33707. var t = {};
  33708. return t.IS_NODE = !("object" != typeof i || i + "" != "[object process]" || i.browser),
  33709. t.XHR = function() {
  33710. for (var e = [function() {
  33711. return new XMLHttpRequest
  33712. }
  33713. , function() {
  33714. return new ActiveXObject("Msxml2.XMLHTTP")
  33715. }
  33716. , function() {
  33717. return new ActiveXObject("Msxml3.XMLHTTP")
  33718. }
  33719. , function() {
  33720. return new ActiveXObject("Microsoft.XMLHTTP")
  33721. }
  33722. ], t = null, i = 0; i < e.length; i++) {
  33723. try {
  33724. t = e[i]()
  33725. } catch (e) {
  33726. continue
  33727. }
  33728. break
  33729. }
  33730. if (!t)
  33731. throw Error("XMLHttpRequest is not supported");
  33732. return t
  33733. }
  33734. ,
  33735. t.fetch = function(i, n) {
  33736. if (n && "function" != typeof n && (n = null),
  33737. t.IS_NODE) {
  33738. var r = e("fs");
  33739. if (n)
  33740. r.readFile(i, function(e, t) {
  33741. n(e ? null : "" + t)
  33742. });
  33743. else
  33744. try {
  33745. return r.readFileSync(i)
  33746. } catch (e) {
  33747. return null
  33748. }
  33749. } else {
  33750. var o = t.XHR();
  33751. if (o.open("GET", i, !!n),
  33752. o.setRequestHeader("Accept", "text/plain"),
  33753. "function" == typeof o.overrideMimeType && o.overrideMimeType("text/plain"),
  33754. !n)
  33755. return o.send(null),
  33756. 200 == o.status || 0 == o.status && "string" == typeof o.responseText ? o.responseText : null;
  33757. if (o.onreadystatechange = function() {
  33758. 4 == o.readyState && n(200 == o.status || 0 == o.status && "string" == typeof o.responseText ? o.responseText : null)
  33759. }
  33760. ,
  33761. 4 == o.readyState)
  33762. return;
  33763. o.send(null)
  33764. }
  33765. }
  33766. ,
  33767. t.toCamelCase = function(e) {
  33768. return e.replace(/_([a-zA-Z])/g, function(e, t) {
  33769. return t.toUpperCase()
  33770. })
  33771. }
  33772. ,
  33773. t
  33774. }(),
  33775. r.Lang = {
  33776. DELIM: /[\s\{\}=;:\[\],'"\(\)<>]/g,
  33777. RULE: /^(?:required|optional|repeated|map)$/,
  33778. TYPE: /^(?:double|float|int32|uint32|sint32|int64|uint64|sint64|fixed32|sfixed32|fixed64|sfixed64|bool|string|bytes)$/,
  33779. NAME: /^[a-zA-Z_][a-zA-Z_0-9]*$/,
  33780. TYPEDEF: /^[a-zA-Z][a-zA-Z_0-9]*$/,
  33781. TYPEREF: /^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)+$/,
  33782. FQTYPEREF: /^(?:\.[a-zA-Z][a-zA-Z_0-9]*)+$/,
  33783. NUMBER: /^-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+|([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?)|inf|nan)$/,
  33784. NUMBER_DEC: /^(?:[1-9][0-9]*|0)$/,
  33785. NUMBER_HEX: /^0[xX][0-9a-fA-F]+$/,
  33786. NUMBER_OCT: /^0[0-7]+$/,
  33787. NUMBER_FLT: /^([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?|inf|nan)$/,
  33788. BOOL: /^(?:true|false)$/i,
  33789. ID: /^(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,
  33790. NEGID: /^\-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,
  33791. WHITESPACE: /\s/,
  33792. STRING: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")|(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,
  33793. STRING_DQ: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,
  33794. STRING_SQ: /(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g
  33795. },
  33796. r.DotProto = function(e, t) {
  33797. function i(e, i) {
  33798. var n = -1
  33799. , r = 1;
  33800. if ("-" == e.charAt(0) && (r = -1,
  33801. e = e.substring(1)),
  33802. t.NUMBER_DEC.test(e))
  33803. n = parseInt(e);
  33804. else if (t.NUMBER_HEX.test(e))
  33805. n = parseInt(e.substring(2), 16);
  33806. else {
  33807. if (!t.NUMBER_OCT.test(e))
  33808. throw Error("illegal id value: " + (r < 0 ? "-" : "") + e);
  33809. n = parseInt(e.substring(1), 8)
  33810. }
  33811. if (n = r * n | 0,
  33812. !i && n < 0)
  33813. throw Error("illegal id value: " + (r < 0 ? "-" : "") + e);
  33814. return n
  33815. }
  33816. function n(e) {
  33817. var i = 1;
  33818. if ("-" == e.charAt(0) && (i = -1,
  33819. e = e.substring(1)),
  33820. t.NUMBER_DEC.test(e))
  33821. return i * parseInt(e, 10);
  33822. if (t.NUMBER_HEX.test(e))
  33823. return i * parseInt(e.substring(2), 16);
  33824. if (t.NUMBER_OCT.test(e))
  33825. return i * parseInt(e.substring(1), 8);
  33826. if ("inf" === e)
  33827. return i * (1 / 0);
  33828. if ("nan" === e)
  33829. return NaN;
  33830. if (t.NUMBER_FLT.test(e))
  33831. return i * parseFloat(e);
  33832. throw Error("illegal number value: " + (i < 0 ? "-" : "") + e)
  33833. }
  33834. function r(e, t, i) {
  33835. "undefined" == typeof e[t] ? e[t] = i : (Array.isArray(e[t]) || (e[t] = [e[t]]),
  33836. e[t].push(i))
  33837. }
  33838. var o = {}
  33839. , a = function(e) {
  33840. this.source = e + "",
  33841. this.index = 0,
  33842. this.line = 1,
  33843. this.stack = [],
  33844. this._stringOpen = null
  33845. }
  33846. , s = a.prototype;
  33847. s._readString = function() {
  33848. var e = '"' === this._stringOpen ? t.STRING_DQ : t.STRING_SQ;
  33849. e.lastIndex = this.index - 1;
  33850. var i = e.exec(this.source);
  33851. if (!i)
  33852. throw Error("unterminated string");
  33853. return this.index = e.lastIndex,
  33854. this.stack.push(this._stringOpen),
  33855. this._stringOpen = null,
  33856. i[1]
  33857. }
  33858. ,
  33859. s.next = function() {
  33860. if (this.stack.length > 0)
  33861. return this.stack.shift();
  33862. if (this.index >= this.source.length)
  33863. return null;
  33864. if (null !== this._stringOpen)
  33865. return this._readString();
  33866. var e, i, n;
  33867. do {
  33868. for (e = !1; t.WHITESPACE.test(n = this.source.charAt(this.index)); )
  33869. if ("\n" === n && ++this.line,
  33870. ++this.index === this.source.length)
  33871. return null;
  33872. if ("/" === this.source.charAt(this.index))
  33873. if (++this.index,
  33874. "/" === this.source.charAt(this.index)) {
  33875. for (; "\n" !== this.source.charAt(++this.index); )
  33876. if (this.index == this.source.length)
  33877. return null;
  33878. ++this.index,
  33879. ++this.line,
  33880. e = !0
  33881. } else {
  33882. if ("*" !== (n = this.source.charAt(this.index)))
  33883. return "/";
  33884. do {
  33885. if ("\n" === n && ++this.line,
  33886. ++this.index === this.source.length)
  33887. return null;
  33888. i = n,
  33889. n = this.source.charAt(this.index)
  33890. } while ("*" !== i || "/" !== n);++this.index,
  33891. e = !0
  33892. }
  33893. } while (e);if (this.index === this.source.length)
  33894. return null;
  33895. var r = this.index;
  33896. t.DELIM.lastIndex = 0;
  33897. var o = t.DELIM.test(this.source.charAt(r++));
  33898. if (!o)
  33899. for (; r < this.source.length && !t.DELIM.test(this.source.charAt(r)); )
  33900. ++r;
  33901. var a = this.source.substring(this.index, this.index = r);
  33902. return '"' !== a && "'" !== a || (this._stringOpen = a),
  33903. a
  33904. }
  33905. ,
  33906. s.peek = function() {
  33907. if (0 === this.stack.length) {
  33908. var e = this.next();
  33909. if (null === e)
  33910. return null;
  33911. this.stack.push(e)
  33912. }
  33913. return this.stack[0]
  33914. }
  33915. ,
  33916. s.skip = function(e) {
  33917. var t = this.next();
  33918. if (t !== e)
  33919. throw Error("illegal '" + t + "', '" + e + "' expected")
  33920. }
  33921. ,
  33922. s.omit = function(e) {
  33923. return this.peek() === e && (this.next(),
  33924. !0)
  33925. }
  33926. ,
  33927. s.toString = function() {
  33928. return "Tokenizer (" + this.index + "/" + this.source.length + " at line " + this.line + ")"
  33929. }
  33930. ,
  33931. o.Tokenizer = a;
  33932. var l = function(e) {
  33933. this.tn = new a(e),
  33934. this.proto3 = !1
  33935. }
  33936. , c = l.prototype;
  33937. return c.parse = function() {
  33938. var e, i, n = {
  33939. name: "[ROOT]",
  33940. package: null,
  33941. messages: [],
  33942. enums: [],
  33943. imports: [],
  33944. options: {},
  33945. services: []
  33946. }, r = !0;
  33947. try {
  33948. for (; e = this.tn.next(); )
  33949. switch (e) {
  33950. case "package":
  33951. if (!r || null !== n.package)
  33952. throw Error("unexpected 'package'");
  33953. if (e = this.tn.next(),
  33954. !t.TYPEREF.test(e))
  33955. throw Error("illegal package name: " + e);
  33956. this.tn.skip(";"),
  33957. n.package = e;
  33958. break;
  33959. case "import":
  33960. if (!r)
  33961. throw Error("unexpected 'import'");
  33962. e = this.tn.peek(),
  33963. ("public" === e || (i = "weak" === e)) && this.tn.next(),
  33964. e = this._readString(),
  33965. this.tn.skip(";"),
  33966. i || n.imports.push(e);
  33967. break;
  33968. case "syntax":
  33969. if (!r)
  33970. throw Error("unexpected 'syntax'");
  33971. this.tn.skip("="),
  33972. "proto3" === (n.syntax = this._readString()) && (this.proto3 = !0),
  33973. this.tn.skip(";");
  33974. break;
  33975. case "message":
  33976. this._parseMessage(n, null),
  33977. r = !1;
  33978. break;
  33979. case "enum":
  33980. this._parseEnum(n),
  33981. r = !1;
  33982. break;
  33983. case "option":
  33984. this._parseOption(n);
  33985. break;
  33986. case "service":
  33987. this._parseService(n);
  33988. break;
  33989. case "extend":
  33990. this._parseExtend(n);
  33991. break;
  33992. default:
  33993. throw Error("unexpected '" + e + "'")
  33994. }
  33995. } catch (e) {
  33996. throw e.message = "Parse error at line " + this.tn.line + ": " + e.message,
  33997. e
  33998. }
  33999. return delete n.name,
  34000. n
  34001. }
  34002. ,
  34003. l.parse = function(e) {
  34004. return new l(e).parse()
  34005. }
  34006. ,
  34007. c._readString = function() {
  34008. var e, t, i = "";
  34009. do {
  34010. if (t = this.tn.next(),
  34011. "'" !== t && '"' !== t)
  34012. throw Error("illegal string delimiter: " + t);
  34013. i += this.tn.next(),
  34014. this.tn.skip(t),
  34015. e = this.tn.peek()
  34016. } while ('"' === e || '"' === e);return i
  34017. }
  34018. ,
  34019. c._readValue = function(e) {
  34020. var i = this.tn.peek();
  34021. if ('"' === i || "'" === i)
  34022. return this._readString();
  34023. if (this.tn.next(),
  34024. t.NUMBER.test(i))
  34025. return n(i);
  34026. if (t.BOOL.test(i))
  34027. return "true" === i.toLowerCase();
  34028. if (e && t.TYPEREF.test(i))
  34029. return i;
  34030. throw Error("illegal value: " + i)
  34031. }
  34032. ,
  34033. c._parseOption = function(e, i) {
  34034. var n = this.tn.next()
  34035. , r = !1;
  34036. if ("(" === n && (r = !0,
  34037. n = this.tn.next()),
  34038. !t.TYPEREF.test(n))
  34039. throw Error("illegal option name: " + n);
  34040. var o = n;
  34041. r && (this.tn.skip(")"),
  34042. o = "(" + o + ")",
  34043. n = this.tn.peek(),
  34044. t.FQTYPEREF.test(n) && (o += n,
  34045. this.tn.next())),
  34046. this.tn.skip("="),
  34047. this._parseOptionValue(e, o),
  34048. i || this.tn.skip(";")
  34049. }
  34050. ,
  34051. c._parseOptionValue = function(e, i) {
  34052. var n = this.tn.peek();
  34053. if ("{" !== n)
  34054. r(e.options, i, this._readValue(!0));
  34055. else
  34056. for (this.tn.skip("{"); "}" !== (n = this.tn.next()); ) {
  34057. if (!t.NAME.test(n))
  34058. throw Error("illegal option name: " + i + "." + n);
  34059. this.tn.omit(":") ? r(e.options, i + "." + n, this._readValue(!0)) : this._parseOptionValue(e, i + "." + n)
  34060. }
  34061. }
  34062. ,
  34063. c._parseService = function(e) {
  34064. var i = this.tn.next();
  34065. if (!t.NAME.test(i))
  34066. throw Error("illegal service name at line " + this.tn.line + ": " + i);
  34067. var n = i
  34068. , r = {
  34069. name: n,
  34070. rpc: {},
  34071. options: {}
  34072. };
  34073. for (this.tn.skip("{"); "}" !== (i = this.tn.next()); )
  34074. if ("option" === i)
  34075. this._parseOption(r);
  34076. else {
  34077. if ("rpc" !== i)
  34078. throw Error("illegal service token: " + i);
  34079. this._parseServiceRPC(r)
  34080. }
  34081. this.tn.omit(";"),
  34082. e.services.push(r)
  34083. }
  34084. ,
  34085. c._parseServiceRPC = function(e) {
  34086. var i = "rpc"
  34087. , n = this.tn.next();
  34088. if (!t.NAME.test(n))
  34089. throw Error("illegal rpc service method name: " + n);
  34090. var r = n
  34091. , o = {
  34092. request: null,
  34093. response: null,
  34094. request_stream: !1,
  34095. response_stream: !1,
  34096. options: {}
  34097. };
  34098. if (this.tn.skip("("),
  34099. n = this.tn.next(),
  34100. "stream" === n.toLowerCase() && (o.request_stream = !0,
  34101. n = this.tn.next()),
  34102. !t.TYPEREF.test(n))
  34103. throw Error("illegal rpc service request type: " + n);
  34104. if (o.request = n,
  34105. this.tn.skip(")"),
  34106. n = this.tn.next(),
  34107. "returns" !== n.toLowerCase())
  34108. throw Error("illegal rpc service request type delimiter: " + n);
  34109. if (this.tn.skip("("),
  34110. n = this.tn.next(),
  34111. "stream" === n.toLowerCase() && (o.response_stream = !0,
  34112. n = this.tn.next()),
  34113. o.response = n,
  34114. this.tn.skip(")"),
  34115. n = this.tn.peek(),
  34116. "{" === n) {
  34117. for (this.tn.next(); "}" !== (n = this.tn.next()); ) {
  34118. if ("option" !== n)
  34119. throw Error("illegal rpc service token: " + n);
  34120. this._parseOption(o)
  34121. }
  34122. this.tn.omit(";")
  34123. } else
  34124. this.tn.skip(";");
  34125. "undefined" == typeof e[i] && (e[i] = {}),
  34126. e[i][r] = o
  34127. }
  34128. ,
  34129. c._parseMessage = function(e, n) {
  34130. var r = !!n
  34131. , o = this.tn.next()
  34132. , a = {
  34133. name: "",
  34134. fields: [],
  34135. enums: [],
  34136. messages: [],
  34137. options: {},
  34138. services: [],
  34139. oneofs: {}
  34140. };
  34141. if (!t.NAME.test(o))
  34142. throw Error("illegal " + (r ? "group" : "message") + " name: " + o);
  34143. for (a.name = o,
  34144. r && (this.tn.skip("="),
  34145. n.id = i(this.tn.next()),
  34146. a.isGroup = !0),
  34147. o = this.tn.peek(),
  34148. "[" === o && n && this._parseFieldOptions(n),
  34149. this.tn.skip("{"); "}" !== (o = this.tn.next()); )
  34150. if (t.RULE.test(o))
  34151. this._parseMessageField(a, o);
  34152. else if ("oneof" === o)
  34153. this._parseMessageOneOf(a);
  34154. else if ("enum" === o)
  34155. this._parseEnum(a);
  34156. else if ("message" === o)
  34157. this._parseMessage(a);
  34158. else if ("option" === o)
  34159. this._parseOption(a);
  34160. else if ("service" === o)
  34161. this._parseService(a);
  34162. else if ("extensions" === o)
  34163. a.extensions = this._parseExtensionRanges();
  34164. else if ("reserved" === o)
  34165. this._parseIgnored();
  34166. else if ("extend" === o)
  34167. this._parseExtend(a);
  34168. else {
  34169. if (!t.TYPEREF.test(o))
  34170. throw Error("illegal message token: " + o);
  34171. if (!this.proto3)
  34172. throw Error("illegal field rule: " + o);
  34173. this._parseMessageField(a, "optional", o)
  34174. }
  34175. return this.tn.omit(";"),
  34176. e.messages.push(a),
  34177. a
  34178. }
  34179. ,
  34180. c._parseIgnored = function() {
  34181. for (; ";" !== this.tn.peek(); )
  34182. this.tn.next();
  34183. this.tn.skip(";")
  34184. }
  34185. ,
  34186. c._parseMessageField = function(e, n, r) {
  34187. if (!t.RULE.test(n))
  34188. throw Error("illegal message field rule: " + n);
  34189. var o, a = {
  34190. rule: n,
  34191. type: "",
  34192. name: "",
  34193. options: {},
  34194. id: 0
  34195. };
  34196. if ("map" === n) {
  34197. if (r)
  34198. throw Error("illegal type: " + r);
  34199. if (this.tn.skip("<"),
  34200. o = this.tn.next(),
  34201. !t.TYPE.test(o) && !t.TYPEREF.test(o))
  34202. throw Error("illegal message field type: " + o);
  34203. if (a.keytype = o,
  34204. this.tn.skip(","),
  34205. o = this.tn.next(),
  34206. !t.TYPE.test(o) && !t.TYPEREF.test(o))
  34207. throw Error("illegal message field: " + o);
  34208. if (a.type = o,
  34209. this.tn.skip(">"),
  34210. o = this.tn.next(),
  34211. !t.NAME.test(o))
  34212. throw Error("illegal message field name: " + o);
  34213. a.name = o,
  34214. this.tn.skip("="),
  34215. a.id = i(this.tn.next()),
  34216. o = this.tn.peek(),
  34217. "[" === o && this._parseFieldOptions(a),
  34218. this.tn.skip(";")
  34219. } else if (r = "undefined" != typeof r ? r : this.tn.next(),
  34220. "group" === r) {
  34221. var s = this._parseMessage(e, a);
  34222. if (!/^[A-Z]/.test(s.name))
  34223. throw Error("illegal group name: " + s.name);
  34224. a.type = s.name,
  34225. a.name = s.name.toLowerCase(),
  34226. this.tn.omit(";")
  34227. } else {
  34228. if (!t.TYPE.test(r) && !t.TYPEREF.test(r))
  34229. throw Error("illegal message field type: " + r);
  34230. if (a.type = r,
  34231. o = this.tn.next(),
  34232. !t.NAME.test(o))
  34233. throw Error("illegal message field name: " + o);
  34234. a.name = o,
  34235. this.tn.skip("="),
  34236. a.id = i(this.tn.next()),
  34237. o = this.tn.peek(),
  34238. "[" === o && this._parseFieldOptions(a),
  34239. this.tn.skip(";")
  34240. }
  34241. return e.fields.push(a),
  34242. a
  34243. }
  34244. ,
  34245. c._parseMessageOneOf = function(e) {
  34246. var i = this.tn.next();
  34247. if (!t.NAME.test(i))
  34248. throw Error("illegal oneof name: " + i);
  34249. var n, r = i, o = [];
  34250. for (this.tn.skip("{"); "}" !== (i = this.tn.next()); )
  34251. n = this._parseMessageField(e, "optional", i),
  34252. n.oneof = r,
  34253. o.push(n.id);
  34254. this.tn.omit(";"),
  34255. e.oneofs[r] = o
  34256. }
  34257. ,
  34258. c._parseFieldOptions = function(e) {
  34259. this.tn.skip("[");
  34260. for (var t, i = !0; "]" !== (t = this.tn.peek()); )
  34261. i || this.tn.skip(","),
  34262. this._parseOption(e, !0),
  34263. i = !1;
  34264. this.tn.next()
  34265. }
  34266. ,
  34267. c._parseEnum = function(e) {
  34268. var n = {
  34269. name: "",
  34270. values: [],
  34271. options: {}
  34272. }
  34273. , r = this.tn.next();
  34274. if (!t.NAME.test(r))
  34275. throw Error("illegal name: " + r);
  34276. for (n.name = r,
  34277. this.tn.skip("{"); "}" !== (r = this.tn.next()); )
  34278. if ("option" === r)
  34279. this._parseOption(n);
  34280. else {
  34281. if (!t.NAME.test(r))
  34282. throw Error("illegal name: " + r);
  34283. this.tn.skip("=");
  34284. var o = {
  34285. name: r,
  34286. id: i(this.tn.next(), !0)
  34287. };
  34288. r = this.tn.peek(),
  34289. "[" === r && this._parseFieldOptions({
  34290. options: {}
  34291. }),
  34292. this.tn.skip(";"),
  34293. n.values.push(o)
  34294. }
  34295. this.tn.omit(";"),
  34296. e.enums.push(n)
  34297. }
  34298. ,
  34299. c._parseExtensionRanges = function() {
  34300. var t, i, r, o = [];
  34301. do {
  34302. for (i = []; ; ) {
  34303. switch (t = this.tn.next()) {
  34304. case "min":
  34305. r = e.ID_MIN;
  34306. break;
  34307. case "max":
  34308. r = e.ID_MAX;
  34309. break;
  34310. default:
  34311. r = n(t)
  34312. }
  34313. if (i.push(r),
  34314. 2 === i.length)
  34315. break;
  34316. if ("to" !== this.tn.peek()) {
  34317. i.push(r);
  34318. break
  34319. }
  34320. this.tn.next()
  34321. }
  34322. o.push(i)
  34323. } while (this.tn.omit(","));return this.tn.skip(";"),
  34324. o
  34325. }
  34326. ,
  34327. c._parseExtend = function(e) {
  34328. var i = this.tn.next();
  34329. if (!t.TYPEREF.test(i))
  34330. throw Error("illegal extend reference: " + i);
  34331. var n = {
  34332. ref: i,
  34333. fields: []
  34334. };
  34335. for (this.tn.skip("{"); "}" !== (i = this.tn.next()); )
  34336. if (t.RULE.test(i))
  34337. this._parseMessageField(n, i);
  34338. else {
  34339. if (!t.TYPEREF.test(i))
  34340. throw Error("illegal extend token: " + i);
  34341. if (!this.proto3)
  34342. throw Error("illegal field rule: " + i);
  34343. this._parseMessageField(n, "optional", i)
  34344. }
  34345. return this.tn.omit(";"),
  34346. e.messages.push(n),
  34347. n
  34348. }
  34349. ,
  34350. c.toString = function() {
  34351. return "Parser at line " + this.tn.line
  34352. }
  34353. ,
  34354. o.Parser = l,
  34355. o
  34356. }(r, r.Lang),
  34357. r.Reflect = function(e) {
  34358. function i(i) {
  34359. if ("string" == typeof i && (i = e.TYPES[i]),
  34360. "undefined" == typeof i.defaultValue)
  34361. throw Error("default value for type " + i.name + " is not supported");
  34362. return i == e.TYPES.bytes ? new t(0) : i.defaultValue
  34363. }
  34364. function n(t, i) {
  34365. if (t && "number" == typeof t.low && "number" == typeof t.high && "boolean" == typeof t.unsigned && t.low === t.low && t.high === t.high)
  34366. return new e.Long(t.low,t.high,"undefined" == typeof i ? t.unsigned : i);
  34367. if ("string" == typeof t)
  34368. return e.Long.fromString(t, i || !1, 10);
  34369. if ("number" == typeof t)
  34370. return e.Long.fromNumber(t, i || !1);
  34371. throw Error("not convertible to Long")
  34372. }
  34373. function r(t, i) {
  34374. var n = i.readVarint32()
  34375. , o = 7 & n
  34376. , a = n >>> 3;
  34377. switch (o) {
  34378. case e.WIRE_TYPES.VARINT:
  34379. do
  34380. n = i.readUint8();
  34381. while (128 === (128 & n));break;
  34382. case e.WIRE_TYPES.BITS64:
  34383. i.offset += 8;
  34384. break;
  34385. case e.WIRE_TYPES.LDELIM:
  34386. n = i.readVarint32(),
  34387. i.offset += n;
  34388. break;
  34389. case e.WIRE_TYPES.STARTGROUP:
  34390. r(a, i);
  34391. break;
  34392. case e.WIRE_TYPES.ENDGROUP:
  34393. if (a === t)
  34394. return !1;
  34395. throw Error("Illegal GROUPEND after unknown group: " + a + " (" + t + " expected)");
  34396. case e.WIRE_TYPES.BITS32:
  34397. i.offset += 4;
  34398. break;
  34399. default:
  34400. throw Error("Illegal wire type in unknown group " + t + ": " + o)
  34401. }
  34402. return !0
  34403. }
  34404. var o = {}
  34405. , a = function(e, t, i) {
  34406. this.builder = e,
  34407. this.parent = t,
  34408. this.name = i,
  34409. this.className
  34410. }
  34411. , s = a.prototype;
  34412. s.fqn = function() {
  34413. for (var e = this.name, t = this; ; ) {
  34414. if (t = t.parent,
  34415. null == t)
  34416. break;
  34417. e = t.name + "." + e
  34418. }
  34419. return e
  34420. }
  34421. ,
  34422. s.toString = function(e) {
  34423. return (e ? this.className + " " : "") + this.fqn()
  34424. }
  34425. ,
  34426. s.build = function() {
  34427. throw Error(this.toString(!0) + " cannot be built directly")
  34428. }
  34429. ,
  34430. o.T = a;
  34431. var l = function(e, t, i, n, r) {
  34432. a.call(this, e, t, i),
  34433. this.className = "Namespace",
  34434. this.children = [],
  34435. this.options = n || {},
  34436. this.syntax = r || "proto2"
  34437. }
  34438. , c = l.prototype = Object.create(a.prototype);
  34439. c.getChildren = function(e) {
  34440. if (e = e || null,
  34441. null == e)
  34442. return this.children.slice();
  34443. for (var t = [], i = 0, n = this.children.length; i < n; ++i)
  34444. this.children[i]instanceof e && t.push(this.children[i]);
  34445. return t
  34446. }
  34447. ,
  34448. c.addChild = function(e) {
  34449. var t;
  34450. if (t = this.getChild(e.name))
  34451. if (t instanceof d.Field && t.name !== t.originalName && null === this.getChild(t.originalName))
  34452. t.name = t.originalName;
  34453. else {
  34454. if (!(e instanceof d.Field && e.name !== e.originalName && null === this.getChild(e.originalName)))
  34455. throw Error("Duplicate name in namespace " + this.toString(!0) + ": " + e.name);
  34456. e.name = e.originalName
  34457. }
  34458. this.children.push(e)
  34459. }
  34460. ,
  34461. c.getChild = function(e) {
  34462. for (var t = "number" == typeof e ? "id" : "name", i = 0, n = this.children.length; i < n; ++i)
  34463. if (this.children[i][t] === e)
  34464. return this.children[i];
  34465. return null
  34466. }
  34467. ,
  34468. c.resolve = function(e, t) {
  34469. var i = "string" == typeof e ? e.split(".") : e
  34470. , n = this
  34471. , r = 0;
  34472. if ("" === i[r]) {
  34473. for (; null !== n.parent; )
  34474. n = n.parent;
  34475. r++
  34476. }
  34477. var a;
  34478. do {
  34479. do {
  34480. if (!(n instanceof o.Namespace)) {
  34481. n = null;
  34482. break
  34483. }
  34484. if (a = n.getChild(i[r]),
  34485. !a || !(a instanceof o.T) || t && !(a instanceof o.Namespace)) {
  34486. n = null;
  34487. break
  34488. }
  34489. n = a,
  34490. r++
  34491. } while (r < i.length);if (null != n)
  34492. break;
  34493. if (null !== this.parent)
  34494. return this.parent.resolve(e, t)
  34495. } while (null != n);return n
  34496. }
  34497. ,
  34498. c.qn = function(e) {
  34499. var t = []
  34500. , i = e;
  34501. do
  34502. t.unshift(i.name),
  34503. i = i.parent;
  34504. while (null !== i);for (var n = 1; n <= t.length; n++) {
  34505. var r = t.slice(t.length - n);
  34506. if (e === this.resolve(r, e instanceof o.Namespace))
  34507. return r.join(".")
  34508. }
  34509. return e.fqn()
  34510. }
  34511. ,
  34512. c.build = function() {
  34513. for (var e, t = {}, i = this.children, n = 0, r = i.length; n < r; ++n)
  34514. e = i[n],
  34515. e instanceof l && (t[e.name] = e.build());
  34516. return Object.defineProperty && Object.defineProperty(t, "$options", {
  34517. value: this.buildOpt()
  34518. }),
  34519. t
  34520. }
  34521. ,
  34522. c.buildOpt = function() {
  34523. for (var e = {}, t = Object.keys(this.options), i = 0, n = t.length; i < n; ++i) {
  34524. var r = t[i]
  34525. , o = this.options[t[i]];
  34526. e[r] = o
  34527. }
  34528. return e
  34529. }
  34530. ,
  34531. c.getOption = function(e) {
  34532. return "undefined" == typeof e ? this.options : "undefined" != typeof this.options[e] ? this.options[e] : null
  34533. }
  34534. ,
  34535. o.Namespace = l;
  34536. var h = function(t, i, n, r) {
  34537. if (this.type = t,
  34538. this.resolvedType = i,
  34539. this.isMapKey = n,
  34540. this.syntax = r,
  34541. n && e.MAP_KEY_TYPES.indexOf(t) < 0)
  34542. throw Error("Invalid map key type: " + t.name)
  34543. }
  34544. , u = h.prototype;
  34545. h.defaultFieldValue = i,
  34546. u.verifyValue = function(i) {
  34547. function r(e, t) {
  34548. throw Error("Illegal value for " + o.toString(!0) + " of type " + o.type.name + ": " + e + " (" + t + ")")
  34549. }
  34550. var o = this;
  34551. switch (this.type) {
  34552. case e.TYPES.int32:
  34553. case e.TYPES.sint32:
  34554. case e.TYPES.sfixed32:
  34555. return ("number" != typeof i || i === i && i % 1 !== 0) && r(typeof i, "not an integer"),
  34556. i > 4294967295 ? 0 | i : i;
  34557. case e.TYPES.uint32:
  34558. case e.TYPES.fixed32:
  34559. return ("number" != typeof i || i === i && i % 1 !== 0) && r(typeof i, "not an integer"),
  34560. i < 0 ? i >>> 0 : i;
  34561. case e.TYPES.int64:
  34562. case e.TYPES.sint64:
  34563. case e.TYPES.sfixed64:
  34564. if (e.Long)
  34565. try {
  34566. return n(i, !1)
  34567. } catch (e) {
  34568. r(typeof i, e.message)
  34569. }
  34570. else
  34571. r(typeof i, "requires Long.js");
  34572. case e.TYPES.uint64:
  34573. case e.TYPES.fixed64:
  34574. if (e.Long)
  34575. try {
  34576. return n(i, !0)
  34577. } catch (e) {
  34578. r(typeof i, e.message)
  34579. }
  34580. else
  34581. r(typeof i, "requires Long.js");
  34582. case e.TYPES.bool:
  34583. return "boolean" != typeof i && r(typeof i, "not a boolean"),
  34584. i;
  34585. case e.TYPES.float:
  34586. case e.TYPES.double:
  34587. return "number" != typeof i && r(typeof i, "not a number"),
  34588. i;
  34589. case e.TYPES.string:
  34590. return "string" == typeof i || i && i instanceof String || r(typeof i, "not a string"),
  34591. "" + i;
  34592. case e.TYPES.bytes:
  34593. return t.isByteBuffer(i) ? i : t.wrap(i, "base64");
  34594. case e.TYPES.enum:
  34595. var a = this.resolvedType.getChildren(e.Reflect.Enum.Value);
  34596. for (l = 0; l < a.length; l++) {
  34597. if (a[l].name == i)
  34598. return a[l].id;
  34599. if (a[l].id == i)
  34600. return a[l].id
  34601. }
  34602. if ("proto3" === this.syntax)
  34603. return ("number" != typeof i || i === i && i % 1 !== 0) && r(typeof i, "not an integer"),
  34604. (i > 4294967295 || i < 0) && r(typeof i, "not in range for uint32"),
  34605. i;
  34606. r(i, "not a valid enum value");
  34607. case e.TYPES.group:
  34608. case e.TYPES.message:
  34609. if (i && "object" == typeof i || r(typeof i, "object expected"),
  34610. i instanceof this.resolvedType.clazz)
  34611. return i;
  34612. if (i instanceof e.Builder.Message) {
  34613. var s = {};
  34614. for (var l in i)
  34615. i.hasOwnProperty(l) && (s[l] = i[l]);
  34616. i = s
  34617. }
  34618. return new this.resolvedType.clazz(i)
  34619. }
  34620. throw Error("[INTERNAL] Illegal value for " + this.toString(!0) + ": " + i + " (undefined type " + this.type + ")")
  34621. }
  34622. ,
  34623. u.calculateLength = function(i, n) {
  34624. if (null === n)
  34625. return 0;
  34626. var r;
  34627. switch (this.type) {
  34628. case e.TYPES.int32:
  34629. return n < 0 ? t.calculateVarint64(n) : t.calculateVarint32(n);
  34630. case e.TYPES.uint32:
  34631. return t.calculateVarint32(n);
  34632. case e.TYPES.sint32:
  34633. return t.calculateVarint32(t.zigZagEncode32(n));
  34634. case e.TYPES.fixed32:
  34635. case e.TYPES.sfixed32:
  34636. case e.TYPES.float:
  34637. return 4;
  34638. case e.TYPES.int64:
  34639. case e.TYPES.uint64:
  34640. return t.calculateVarint64(n);
  34641. case e.TYPES.sint64:
  34642. return t.calculateVarint64(t.zigZagEncode64(n));
  34643. case e.TYPES.fixed64:
  34644. case e.TYPES.sfixed64:
  34645. return 8;
  34646. case e.TYPES.bool:
  34647. return 1;
  34648. case e.TYPES.enum:
  34649. return t.calculateVarint32(n);
  34650. case e.TYPES.double:
  34651. return 8;
  34652. case e.TYPES.string:
  34653. return r = t.calculateUTF8Bytes(n),
  34654. t.calculateVarint32(r) + r;
  34655. case e.TYPES.bytes:
  34656. if (n.remaining() < 0)
  34657. throw Error("Illegal value for " + this.toString(!0) + ": " + n.remaining() + " bytes remaining");
  34658. return t.calculateVarint32(n.remaining()) + n.remaining();
  34659. case e.TYPES.message:
  34660. return r = this.resolvedType.calculate(n),
  34661. t.calculateVarint32(r) + r;
  34662. case e.TYPES.group:
  34663. return r = this.resolvedType.calculate(n),
  34664. r + t.calculateVarint32(i << 3 | e.WIRE_TYPES.ENDGROUP)
  34665. }
  34666. throw Error("[INTERNAL] Illegal value to encode in " + this.toString(!0) + ": " + n + " (unknown type)")
  34667. }
  34668. ,
  34669. u.encodeValue = function(i, n, r) {
  34670. if (null === n)
  34671. return r;
  34672. switch (this.type) {
  34673. case e.TYPES.int32:
  34674. n < 0 ? r.writeVarint64(n) : r.writeVarint32(n);
  34675. break;
  34676. case e.TYPES.uint32:
  34677. r.writeVarint32(n);
  34678. break;
  34679. case e.TYPES.sint32:
  34680. r.writeVarint32ZigZag(n);
  34681. break;
  34682. case e.TYPES.fixed32:
  34683. r.writeUint32(n);
  34684. break;
  34685. case e.TYPES.sfixed32:
  34686. r.writeInt32(n);
  34687. break;
  34688. case e.TYPES.int64:
  34689. case e.TYPES.uint64:
  34690. r.writeVarint64(n);
  34691. break;
  34692. case e.TYPES.sint64:
  34693. r.writeVarint64ZigZag(n);
  34694. break;
  34695. case e.TYPES.fixed64:
  34696. r.writeUint64(n);
  34697. break;
  34698. case e.TYPES.sfixed64:
  34699. r.writeInt64(n);
  34700. break;
  34701. case e.TYPES.bool:
  34702. "string" == typeof n ? r.writeVarint32("false" === n.toLowerCase() ? 0 : !!n) : r.writeVarint32(n ? 1 : 0);
  34703. break;
  34704. case e.TYPES.enum:
  34705. r.writeVarint32(n);
  34706. break;
  34707. case e.TYPES.float:
  34708. r.writeFloat32(n);
  34709. break;
  34710. case e.TYPES.double:
  34711. r.writeFloat64(n);
  34712. break;
  34713. case e.TYPES.string:
  34714. r.writeVString(n);
  34715. break;
  34716. case e.TYPES.bytes:
  34717. if (n.remaining() < 0)
  34718. throw Error("Illegal value for " + this.toString(!0) + ": " + n.remaining() + " bytes remaining");
  34719. var o = n.offset;
  34720. r.writeVarint32(n.remaining()),
  34721. r.append(n),
  34722. n.offset = o;
  34723. break;
  34724. case e.TYPES.message:
  34725. var a = (new t).LE();
  34726. this.resolvedType.encode(n, a),
  34727. r.writeVarint32(a.offset),
  34728. r.append(a.flip());
  34729. break;
  34730. case e.TYPES.group:
  34731. this.resolvedType.encode(n, r),
  34732. r.writeVarint32(i << 3 | e.WIRE_TYPES.ENDGROUP);
  34733. break;
  34734. default:
  34735. throw Error("[INTERNAL] Illegal value to encode in " + this.toString(!0) + ": " + n + " (unknown type)")
  34736. }
  34737. return r
  34738. }
  34739. ,
  34740. u.decode = function(t, i, n) {
  34741. if (i != this.type.wireType)
  34742. throw Error("Unexpected wire type for element");
  34743. var r, o;
  34744. switch (this.type) {
  34745. case e.TYPES.int32:
  34746. return 0 | t.readVarint32();
  34747. case e.TYPES.uint32:
  34748. return t.readVarint32() >>> 0;
  34749. case e.TYPES.sint32:
  34750. return 0 | t.readVarint32ZigZag();
  34751. case e.TYPES.fixed32:
  34752. return t.readUint32() >>> 0;
  34753. case e.TYPES.sfixed32:
  34754. return 0 | t.readInt32();
  34755. case e.TYPES.int64:
  34756. return t.readVarint64();
  34757. case e.TYPES.uint64:
  34758. return t.readVarint64().toUnsigned();
  34759. case e.TYPES.sint64:
  34760. return t.readVarint64ZigZag();
  34761. case e.TYPES.fixed64:
  34762. return t.readUint64();
  34763. case e.TYPES.sfixed64:
  34764. return t.readInt64();
  34765. case e.TYPES.bool:
  34766. return !!t.readVarint32();
  34767. case e.TYPES.enum:
  34768. return t.readVarint32();
  34769. case e.TYPES.float:
  34770. return t.readFloat();
  34771. case e.TYPES.double:
  34772. return t.readDouble();
  34773. case e.TYPES.string:
  34774. return t.readVString();
  34775. case e.TYPES.bytes:
  34776. if (o = t.readVarint32(),
  34777. t.remaining() < o)
  34778. throw Error("Illegal number of bytes for " + this.toString(!0) + ": " + o + " required but got only " + t.remaining());
  34779. return r = t.clone(),
  34780. r.limit = r.offset + o,
  34781. t.offset += o,
  34782. r;
  34783. case e.TYPES.message:
  34784. return o = t.readVarint32(),
  34785. this.resolvedType.decode(t, o);
  34786. case e.TYPES.group:
  34787. return this.resolvedType.decode(t, -1, n)
  34788. }
  34789. throw Error("[INTERNAL] Illegal decode type")
  34790. }
  34791. ,
  34792. u.valueFromString = function(i) {
  34793. if (!this.isMapKey)
  34794. throw Error("valueFromString() called on non-map-key element");
  34795. switch (this.type) {
  34796. case e.TYPES.int32:
  34797. case e.TYPES.sint32:
  34798. case e.TYPES.sfixed32:
  34799. case e.TYPES.uint32:
  34800. case e.TYPES.fixed32:
  34801. return this.verifyValue(parseInt(i));
  34802. case e.TYPES.int64:
  34803. case e.TYPES.sint64:
  34804. case e.TYPES.sfixed64:
  34805. case e.TYPES.uint64:
  34806. case e.TYPES.fixed64:
  34807. return this.verifyValue(i);
  34808. case e.TYPES.bool:
  34809. return "true" === i;
  34810. case e.TYPES.string:
  34811. return this.verifyValue(i);
  34812. case e.TYPES.bytes:
  34813. return t.fromBinary(i)
  34814. }
  34815. }
  34816. ,
  34817. u.valueToString = function(t) {
  34818. if (!this.isMapKey)
  34819. throw Error("valueToString() called on non-map-key element");
  34820. return this.type === e.TYPES.bytes ? t.toString("binary") : t.toString()
  34821. }
  34822. ,
  34823. o.Element = h;
  34824. var d = function(e, t, i, n, r, o) {
  34825. l.call(this, e, t, i, n, o),
  34826. this.className = "Message",
  34827. this.extensions = void 0,
  34828. this.clazz = null,
  34829. this.isGroup = !!r,
  34830. this._fields = null,
  34831. this._fieldsById = null,
  34832. this._fieldsByName = null
  34833. }
  34834. , p = d.prototype = Object.create(l.prototype);
  34835. p.build = function(i) {
  34836. if (this.clazz && !i)
  34837. return this.clazz;
  34838. var n = function(e, i) {
  34839. function n(i, r, o, a) {
  34840. if (null === i || "object" != typeof i) {
  34841. if (a && a instanceof e.Reflect.Enum) {
  34842. var s = e.Reflect.Enum.getName(a.object, i);
  34843. if (null !== s)
  34844. return s
  34845. }
  34846. return i
  34847. }
  34848. if (t.isByteBuffer(i))
  34849. return r ? i.toBase64() : i.toBuffer();
  34850. if (e.Long.isLong(i))
  34851. return o ? i.toString() : e.Long.fromValue(i);
  34852. var l;
  34853. if (Array.isArray(i))
  34854. return l = [],
  34855. i.forEach(function(e, t) {
  34856. l[t] = n(e, r, o, a)
  34857. }),
  34858. l;
  34859. if (l = {},
  34860. i instanceof e.Map) {
  34861. for (var c = i.entries(), h = c.next(); !h.done; h = c.next())
  34862. l[i.keyElem.valueToString(h.value[0])] = n(h.value[1], r, o, i.valueElem.resolvedType);
  34863. return l
  34864. }
  34865. var u = i.$type
  34866. , d = void 0;
  34867. for (var p in i)
  34868. i.hasOwnProperty(p) && (u && (d = u.getChild(p)) ? l[p] = n(i[p], r, o, d.resolvedType) : l[p] = n(i[p], r, o));
  34869. return l
  34870. }
  34871. var r = i.getChildren(e.Reflect.Message.Field)
  34872. , o = i.getChildren(e.Reflect.Message.OneOf)
  34873. , a = function(n, s) {
  34874. e.Builder.Message.call(this);
  34875. for (var l = 0, c = o.length; l < c; ++l)
  34876. this[o[l].name] = null;
  34877. for (l = 0,
  34878. c = r.length; l < c; ++l) {
  34879. var h = r[l];
  34880. this[h.name] = h.repeated ? [] : h.map ? new e.Map(h) : null,
  34881. !h.required && "proto3" !== i.syntax || null === h.defaultValue || (this[h.name] = h.defaultValue)
  34882. }
  34883. if (arguments.length > 0) {
  34884. var u;
  34885. 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)
  34886. for (l = 0,
  34887. c = arguments.length; l < c; ++l)
  34888. "undefined" != typeof (u = arguments[l]) && this.$set(r[l].name, u);
  34889. else
  34890. this.$set(n)
  34891. }
  34892. }
  34893. , s = a.prototype = Object.create(e.Builder.Message.prototype);
  34894. s.add = function(t, n, r) {
  34895. var o = i._fieldsByName[t];
  34896. if (!r) {
  34897. if (!o)
  34898. throw Error(this + "#" + t + " is undefined");
  34899. if (!(o instanceof e.Reflect.Message.Field))
  34900. throw Error(this + "#" + t + " is not a field: " + o.toString(!0));
  34901. if (!o.repeated)
  34902. throw Error(this + "#" + t + " is not a repeated field");
  34903. n = o.verifyValue(n, !0)
  34904. }
  34905. return null === this[t] && (this[t] = []),
  34906. this[t].push(n),
  34907. this
  34908. }
  34909. ,
  34910. s.$add = s.add,
  34911. s.set = function(t, n, r) {
  34912. if (t && "object" == typeof t) {
  34913. r = n;
  34914. for (var o in t)
  34915. t.hasOwnProperty(o) && "undefined" != typeof (n = t[o]) && this.$set(o, n, r);
  34916. return this
  34917. }
  34918. var a = i._fieldsByName[t];
  34919. if (r)
  34920. this[t] = n;
  34921. else {
  34922. if (!a)
  34923. throw Error(this + "#" + t + " is not a field: undefined");
  34924. if (!(a instanceof e.Reflect.Message.Field))
  34925. throw Error(this + "#" + t + " is not a field: " + a.toString(!0));
  34926. this[a.name] = n = a.verifyValue(n)
  34927. }
  34928. if (a && a.oneof) {
  34929. var s = this[a.oneof.name];
  34930. null !== n ? (null !== s && s !== a.name && (this[s] = null),
  34931. this[a.oneof.name] = a.name) : s === t && (this[a.oneof.name] = null)
  34932. }
  34933. return this
  34934. }
  34935. ,
  34936. s.$set = s.set,
  34937. s.get = function(t, n) {
  34938. if (n)
  34939. return this[t];
  34940. var r = i._fieldsByName[t];
  34941. if (!(r && r instanceof e.Reflect.Message.Field))
  34942. throw Error(this + "#" + t + " is not a field: undefined");
  34943. if (!(r instanceof e.Reflect.Message.Field))
  34944. throw Error(this + "#" + t + " is not a field: " + r.toString(!0));
  34945. return this[r.name]
  34946. }
  34947. ,
  34948. s.$get = s.get;
  34949. for (var l = 0; l < r.length; l++) {
  34950. var c = r[l];
  34951. c instanceof e.Reflect.Message.ExtensionField || i.builder.options.populateAccessors && function(e) {
  34952. var t = e.originalName.replace(/(_[a-zA-Z])/g, function(e) {
  34953. return e.toUpperCase().replace("_", "")
  34954. });
  34955. t = t.substring(0, 1).toUpperCase() + t.substring(1);
  34956. var n = e.originalName.replace(/([A-Z])/g, function(e) {
  34957. return "_" + e
  34958. })
  34959. , r = function(t, i) {
  34960. return this[e.name] = i ? t : e.verifyValue(t),
  34961. this
  34962. }
  34963. , o = function() {
  34964. return this[e.name]
  34965. };
  34966. null === i.getChild("set" + t) && (s["set" + t] = r),
  34967. null === i.getChild("set_" + n) && (s["set_" + n] = r),
  34968. null === i.getChild("get" + t) && (s["get" + t] = o),
  34969. null === i.getChild("get_" + n) && (s["get_" + n] = o)
  34970. }(c)
  34971. }
  34972. s.encode = function(e, n) {
  34973. "boolean" == typeof e && (n = e,
  34974. e = void 0);
  34975. var r = !1;
  34976. e || (e = new t,
  34977. r = !0);
  34978. var o = e.littleEndian;
  34979. try {
  34980. return i.encode(this, e.LE(), n),
  34981. (r ? e.flip() : e).LE(o)
  34982. } catch (t) {
  34983. throw e.LE(o),
  34984. t
  34985. }
  34986. }
  34987. ,
  34988. a.encode = function(e, t, i) {
  34989. return new a(e).encode(t, i)
  34990. }
  34991. ,
  34992. s.calculate = function() {
  34993. return i.calculate(this)
  34994. }
  34995. ,
  34996. s.encodeDelimited = function(e, n) {
  34997. var r = !1;
  34998. e || (e = new t,
  34999. r = !0);
  35000. var o = (new t).LE();
  35001. return i.encode(this, o, n).flip(),
  35002. e.writeVarint32(o.remaining()),
  35003. e.append(o),
  35004. r ? e.flip() : e
  35005. }
  35006. ,
  35007. s.encodeAB = function() {
  35008. try {
  35009. return this.encode().toArrayBuffer()
  35010. } catch (e) {
  35011. throw e.encoded && (e.encoded = e.encoded.toArrayBuffer()),
  35012. e
  35013. }
  35014. }
  35015. ,
  35016. s.toArrayBuffer = s.encodeAB,
  35017. s.encodeNB = function() {
  35018. try {
  35019. return this.encode().toBuffer()
  35020. } catch (e) {
  35021. throw e.encoded && (e.encoded = e.encoded.toBuffer()),
  35022. e
  35023. }
  35024. }
  35025. ,
  35026. s.toBuffer = s.encodeNB,
  35027. s.encode64 = function() {
  35028. try {
  35029. return this.encode().toBase64()
  35030. } catch (e) {
  35031. throw e.encoded && (e.encoded = e.encoded.toBase64()),
  35032. e
  35033. }
  35034. }
  35035. ,
  35036. s.toBase64 = s.encode64,
  35037. s.encodeHex = function() {
  35038. try {
  35039. return this.encode().toHex()
  35040. } catch (e) {
  35041. throw e.encoded && (e.encoded = e.encoded.toHex()),
  35042. e
  35043. }
  35044. }
  35045. ,
  35046. s.toHex = s.encodeHex,
  35047. s.toRaw = function(e, t) {
  35048. return n(this, !!e, !!t, this.$type)
  35049. }
  35050. ,
  35051. s.encodeJSON = function() {
  35052. return JSON.stringify(n(this, !0, !0, this.$type))
  35053. }
  35054. ,
  35055. a.decode = function(e, n, r) {
  35056. "string" == typeof n && (r = n,
  35057. n = -1),
  35058. "string" == typeof e && (e = t.wrap(e, r ? r : "base64")),
  35059. e = t.isByteBuffer(e) ? e : t.wrap(e);
  35060. var o = e.littleEndian;
  35061. try {
  35062. var a = i.decode(e.LE());
  35063. return e.LE(o),
  35064. a
  35065. } catch (t) {
  35066. throw e.LE(o),
  35067. t
  35068. }
  35069. }
  35070. ,
  35071. a.decodeDelimited = function(e, n) {
  35072. if ("string" == typeof e && (e = t.wrap(e, n ? n : "base64")),
  35073. e = t.isByteBuffer(e) ? e : t.wrap(e),
  35074. e.remaining() < 1)
  35075. return null;
  35076. var r = e.offset
  35077. , o = e.readVarint32();
  35078. if (e.remaining() < o)
  35079. return e.offset = r,
  35080. null;
  35081. try {
  35082. var a = i.decode(e.slice(e.offset, e.offset + o).LE());
  35083. return e.offset += o,
  35084. a
  35085. } catch (t) {
  35086. throw e.offset += o,
  35087. t
  35088. }
  35089. }
  35090. ,
  35091. a.decode64 = function(e) {
  35092. return a.decode(e, "base64")
  35093. }
  35094. ,
  35095. a.decodeHex = function(e) {
  35096. return a.decode(e, "hex")
  35097. }
  35098. ,
  35099. a.decodeJSON = function(e) {
  35100. return new a(JSON.parse(e))
  35101. }
  35102. ,
  35103. s.toString = function() {
  35104. return i.toString()
  35105. }
  35106. ;
  35107. return Object.defineProperty && (Object.defineProperty(a, "$options", {
  35108. value: i.buildOpt()
  35109. }),
  35110. Object.defineProperty(s, "$options", {
  35111. value: a.$options
  35112. }),
  35113. Object.defineProperty(a, "$type", {
  35114. value: i
  35115. }),
  35116. Object.defineProperty(s, "$type", {
  35117. value: i
  35118. })),
  35119. a
  35120. }(e, this);
  35121. this._fields = [],
  35122. this._fieldsById = {},
  35123. this._fieldsByName = {};
  35124. for (var r, o = 0, a = this.children.length; o < a; o++)
  35125. if (r = this.children[o],
  35126. r instanceof A || r instanceof d || r instanceof E) {
  35127. if (n.hasOwnProperty(r.name))
  35128. throw Error("Illegal reflect child of " + this.toString(!0) + ": " + r.toString(!0) + " cannot override static property '" + r.name + "'");
  35129. n[r.name] = r.build()
  35130. } else if (r instanceof d.Field)
  35131. r.build(),
  35132. this._fields.push(r),
  35133. this._fieldsById[r.id] = r,
  35134. this._fieldsByName[r.name] = r;
  35135. else if (!(r instanceof d.OneOf || r instanceof I))
  35136. throw Error("Illegal reflect child of " + this.toString(!0) + ": " + this.children[o].toString(!0));
  35137. return this.clazz = n
  35138. }
  35139. ,
  35140. p.encode = function(e, t, i) {
  35141. for (var n, r, o = null, a = 0, s = this._fields.length; a < s; ++a)
  35142. n = this._fields[a],
  35143. r = e[n.name],
  35144. n.required && null === r ? null === o && (o = n) : n.encode(i ? r : n.verifyValue(r), t, e);
  35145. if (null !== o) {
  35146. var l = Error("Missing at least one required field for " + this.toString(!0) + ": " + o);
  35147. throw l.encoded = t,
  35148. l
  35149. }
  35150. return t
  35151. }
  35152. ,
  35153. p.calculate = function(e) {
  35154. for (var t, i, n = 0, r = 0, o = this._fields.length; r < o; ++r) {
  35155. if (t = this._fields[r],
  35156. i = e[t.name],
  35157. t.required && null === i)
  35158. throw Error("Missing at least one required field for " + this.toString(!0) + ": " + t);
  35159. n += t.calculate(i, e)
  35160. }
  35161. return n
  35162. }
  35163. ,
  35164. p.decode = function(t, i, n) {
  35165. i = "number" == typeof i ? i : -1;
  35166. for (var o, a, s, l, c = t.offset, h = new this.clazz; t.offset < c + i || i === -1 && t.remaining() > 0; ) {
  35167. if (o = t.readVarint32(),
  35168. a = 7 & o,
  35169. s = o >>> 3,
  35170. a === e.WIRE_TYPES.ENDGROUP) {
  35171. if (s !== n)
  35172. throw Error("Illegal group end indicator for " + this.toString(!0) + ": " + s + " (" + (n ? n + " expected" : "not a group") + ")");
  35173. break
  35174. }
  35175. if (l = this._fieldsById[s]) {
  35176. if (l.repeated && !l.options.packed)
  35177. h[l.name].push(l.decode(a, t));
  35178. else if (l.map) {
  35179. var u = l.decode(a, t);
  35180. h[l.name].set(u[0], u[1])
  35181. } else if (h[l.name] = l.decode(a, t),
  35182. l.oneof) {
  35183. var d = h[l.oneof.name];
  35184. null !== d && d !== l.name && (h[d] = null),
  35185. h[l.oneof.name] = l.name
  35186. }
  35187. } else
  35188. switch (a) {
  35189. case e.WIRE_TYPES.VARINT:
  35190. t.readVarint32();
  35191. break;
  35192. case e.WIRE_TYPES.BITS32:
  35193. t.offset += 4;
  35194. break;
  35195. case e.WIRE_TYPES.BITS64:
  35196. t.offset += 8;
  35197. break;
  35198. case e.WIRE_TYPES.LDELIM:
  35199. var p = t.readVarint32();
  35200. t.offset += p;
  35201. break;
  35202. case e.WIRE_TYPES.STARTGROUP:
  35203. for (; r(s, t); )
  35204. ;
  35205. break;
  35206. default:
  35207. throw Error("Illegal wire type for unknown field " + s + " in " + this.toString(!0) + "#decode: " + a)
  35208. }
  35209. }
  35210. for (var f = 0, g = this._fields.length; f < g; ++f)
  35211. if (l = this._fields[f],
  35212. null === h[l.name])
  35213. if ("proto3" === this.syntax)
  35214. h[l.name] = l.defaultValue;
  35215. else {
  35216. if (l.required) {
  35217. var m = Error("Missing at least one required field for " + this.toString(!0) + ": " + l.name);
  35218. throw m.decoded = h,
  35219. m
  35220. }
  35221. e.populateDefaults && null !== l.defaultValue && (h[l.name] = l.defaultValue)
  35222. }
  35223. return h
  35224. }
  35225. ,
  35226. o.Message = d;
  35227. var f = function(t, i, n, r, o, s, l, c, h, u) {
  35228. a.call(this, t, i, s),
  35229. this.className = "Message.Field",
  35230. this.required = "required" === n,
  35231. this.repeated = "repeated" === n,
  35232. this.map = "map" === n,
  35233. this.keyType = r || null,
  35234. this.type = o,
  35235. this.resolvedType = null,
  35236. this.id = l,
  35237. this.options = c || {},
  35238. this.defaultValue = null,
  35239. this.oneof = h || null,
  35240. this.syntax = u || "proto2",
  35241. this.originalName = this.name,
  35242. this.element = null,
  35243. this.keyElement = null,
  35244. !this.builder.options.convertFieldsToCamelCase || this instanceof d.ExtensionField || (this.name = e.Util.toCamelCase(this.name))
  35245. }
  35246. , g = f.prototype = Object.create(a.prototype);
  35247. g.build = function() {
  35248. this.element = new h(this.type,this.resolvedType,!1,this.syntax),
  35249. this.map && (this.keyElement = new h(this.keyType,void 0,!0,this.syntax)),
  35250. "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)
  35251. }
  35252. ,
  35253. g.verifyValue = function(t, i) {
  35254. function n(e, t) {
  35255. throw Error("Illegal value for " + r.toString(!0) + " of type " + r.type.name + ": " + e + " (" + t + ")")
  35256. }
  35257. i = i || !1;
  35258. var r = this;
  35259. if (null === t)
  35260. return this.required && n(typeof t, "required"),
  35261. "proto3" === this.syntax && this.type !== e.TYPES.message && n(typeof t, "proto3 field without field presence cannot be null"),
  35262. null;
  35263. var o;
  35264. if (this.repeated && !i) {
  35265. Array.isArray(t) || (t = [t]);
  35266. var a = [];
  35267. for (o = 0; o < t.length; o++)
  35268. a.push(this.element.verifyValue(t[o]));
  35269. return a
  35270. }
  35271. return this.map && !i ? t instanceof e.Map ? t : (t instanceof Object || n(typeof t, "expected ProtoBuf.Map or raw object for map field"),
  35272. new e.Map(this,t)) : (!this.repeated && Array.isArray(t) && n(typeof t, "no array expected"),
  35273. this.element.verifyValue(t))
  35274. }
  35275. ,
  35276. g.hasWirePresence = function(t, i) {
  35277. if ("proto3" !== this.syntax)
  35278. return null !== t;
  35279. if (this.oneof && i[this.oneof.name] === this.name)
  35280. return !0;
  35281. switch (this.type) {
  35282. case e.TYPES.int32:
  35283. case e.TYPES.sint32:
  35284. case e.TYPES.sfixed32:
  35285. case e.TYPES.uint32:
  35286. case e.TYPES.fixed32:
  35287. return 0 !== t;
  35288. case e.TYPES.int64:
  35289. case e.TYPES.sint64:
  35290. case e.TYPES.sfixed64:
  35291. case e.TYPES.uint64:
  35292. case e.TYPES.fixed64:
  35293. return 0 !== t.low || 0 !== t.high;
  35294. case e.TYPES.bool:
  35295. return t;
  35296. case e.TYPES.float:
  35297. case e.TYPES.double:
  35298. return 0 !== t;
  35299. case e.TYPES.string:
  35300. return t.length > 0;
  35301. case e.TYPES.bytes:
  35302. return t.remaining() > 0;
  35303. case e.TYPES.enum:
  35304. return 0 !== t;
  35305. case e.TYPES.message:
  35306. return null !== t;
  35307. default:
  35308. return !0
  35309. }
  35310. }
  35311. ,
  35312. g.encode = function(i, n, r) {
  35313. if (null === this.type || "object" != typeof this.type)
  35314. throw Error("[INTERNAL] Unresolved type in " + this.toString(!0) + ": " + this.type);
  35315. if (null === i || this.repeated && 0 == i.length)
  35316. return n;
  35317. try {
  35318. if (this.repeated) {
  35319. var o;
  35320. if (this.options.packed && e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0) {
  35321. n.writeVarint32(this.id << 3 | e.WIRE_TYPES.LDELIM),
  35322. n.ensureCapacity(n.offset += 1);
  35323. var a = n.offset;
  35324. for (o = 0; o < i.length; o++)
  35325. this.element.encodeValue(this.id, i[o], n);
  35326. var s = n.offset - a
  35327. , l = t.calculateVarint32(s);
  35328. if (l > 1) {
  35329. var c = n.slice(a, n.offset);
  35330. a += l - 1,
  35331. n.offset = a,
  35332. n.append(c)
  35333. }
  35334. n.writeVarint32(s, a - l)
  35335. } else
  35336. for (o = 0; o < i.length; o++)
  35337. n.writeVarint32(this.id << 3 | this.type.wireType),
  35338. this.element.encodeValue(this.id, i[o], n)
  35339. } else
  35340. this.map ? i.forEach(function(i, r, o) {
  35341. var a = t.calculateVarint32(8 | this.keyType.wireType) + this.keyElement.calculateLength(1, r) + t.calculateVarint32(16 | this.type.wireType) + this.element.calculateLength(2, i);
  35342. n.writeVarint32(this.id << 3 | e.WIRE_TYPES.LDELIM),
  35343. n.writeVarint32(a),
  35344. n.writeVarint32(8 | this.keyType.wireType),
  35345. this.keyElement.encodeValue(1, r, n),
  35346. n.writeVarint32(16 | this.type.wireType),
  35347. this.element.encodeValue(2, i, n)
  35348. }, this) : this.hasWirePresence(i, r) && (n.writeVarint32(this.id << 3 | this.type.wireType),
  35349. this.element.encodeValue(this.id, i, n))
  35350. } catch (e) {
  35351. throw Error("Illegal value for " + this.toString(!0) + ": " + i + " (" + e + ")")
  35352. }
  35353. return n
  35354. }
  35355. ,
  35356. g.calculate = function(i, n) {
  35357. if (i = this.verifyValue(i),
  35358. null === this.type || "object" != typeof this.type)
  35359. throw Error("[INTERNAL] Unresolved type in " + this.toString(!0) + ": " + this.type);
  35360. if (null === i || this.repeated && 0 == i.length)
  35361. return 0;
  35362. var r = 0;
  35363. try {
  35364. if (this.repeated) {
  35365. var o, a;
  35366. if (this.options.packed && e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0) {
  35367. for (r += t.calculateVarint32(this.id << 3 | e.WIRE_TYPES.LDELIM),
  35368. a = 0,
  35369. o = 0; o < i.length; o++)
  35370. a += this.element.calculateLength(this.id, i[o]);
  35371. r += t.calculateVarint32(a),
  35372. r += a
  35373. } else
  35374. for (o = 0; o < i.length; o++)
  35375. r += t.calculateVarint32(this.id << 3 | this.type.wireType),
  35376. r += this.element.calculateLength(this.id, i[o])
  35377. } else
  35378. this.map ? i.forEach(function(i, n, o) {
  35379. var a = t.calculateVarint32(8 | this.keyType.wireType) + this.keyElement.calculateLength(1, n) + t.calculateVarint32(16 | this.type.wireType) + this.element.calculateLength(2, i);
  35380. r += t.calculateVarint32(this.id << 3 | e.WIRE_TYPES.LDELIM),
  35381. r += t.calculateVarint32(a),
  35382. r += a
  35383. }, this) : this.hasWirePresence(i, n) && (r += t.calculateVarint32(this.id << 3 | this.type.wireType),
  35384. r += this.element.calculateLength(this.id, i))
  35385. } catch (e) {
  35386. throw Error("Illegal value for " + this.toString(!0) + ": " + i + " (" + e + ")")
  35387. }
  35388. return r
  35389. }
  35390. ,
  35391. g.decode = function(t, i, n) {
  35392. 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;
  35393. if (!a)
  35394. throw Error("Illegal wire type for field " + this.toString(!0) + ": " + t + " (" + this.type.wireType + " expected)");
  35395. if (t == e.WIRE_TYPES.LDELIM && this.repeated && this.options.packed && e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0 && !n) {
  35396. o = i.readVarint32(),
  35397. o = i.offset + o;
  35398. for (var s = []; i.offset < o; )
  35399. s.push(this.decode(this.type.wireType, i, !0));
  35400. return s
  35401. }
  35402. if (this.map) {
  35403. var l = h.defaultFieldValue(this.keyType);
  35404. if (r = h.defaultFieldValue(this.type),
  35405. o = i.readVarint32(),
  35406. i.remaining() < o)
  35407. throw Error("Illegal number of bytes for " + this.toString(!0) + ": " + o + " required but got only " + i.remaining());
  35408. var c = i.clone();
  35409. for (c.limit = c.offset + o,
  35410. i.offset += o; c.remaining() > 0; ) {
  35411. var u = c.readVarint32();
  35412. t = 7 & u;
  35413. var d = u >>> 3;
  35414. if (1 === d)
  35415. l = this.keyElement.decode(c, t, d);
  35416. else {
  35417. if (2 !== d)
  35418. throw Error("Unexpected tag in map field key/value submessage");
  35419. r = this.element.decode(c, t, d)
  35420. }
  35421. }
  35422. return [l, r]
  35423. }
  35424. return this.element.decode(i, t, this.id)
  35425. }
  35426. ,
  35427. o.Message.Field = f;
  35428. var m = function(e, t, i, n, r, o, a) {
  35429. f.call(this, e, t, i, null, n, r, o, a),
  35430. this.extension
  35431. };
  35432. m.prototype = Object.create(f.prototype),
  35433. o.Message.ExtensionField = m;
  35434. var v = function(e, t, i) {
  35435. a.call(this, e, t, i),
  35436. this.fields = []
  35437. };
  35438. o.Message.OneOf = v;
  35439. var A = function(e, t, i, n, r) {
  35440. l.call(this, e, t, i, n, r),
  35441. this.className = "Enum",
  35442. this.object = null
  35443. };
  35444. A.getName = function(e, t) {
  35445. for (var i, n = Object.keys(e), r = 0; r < n.length; ++r)
  35446. if (e[i = n[r]] === t)
  35447. return i;
  35448. return null
  35449. }
  35450. ;
  35451. var y = A.prototype = Object.create(l.prototype);
  35452. y.build = function(t) {
  35453. if (this.object && !t)
  35454. return this.object;
  35455. for (var i = new e.Builder.Enum, n = this.getChildren(A.Value), r = 0, o = n.length; r < o; ++r)
  35456. i[n[r].name] = n[r].id;
  35457. return Object.defineProperty && Object.defineProperty(i, "$options", {
  35458. value: this.buildOpt(),
  35459. enumerable: !1
  35460. }),
  35461. this.object = i
  35462. }
  35463. ,
  35464. o.Enum = A;
  35465. var C = function(e, t, i, n) {
  35466. a.call(this, e, t, i),
  35467. this.className = "Enum.Value",
  35468. this.id = n
  35469. };
  35470. C.prototype = Object.create(a.prototype),
  35471. o.Enum.Value = C;
  35472. var I = function(e, t, i, n) {
  35473. a.call(this, e, t, i),
  35474. this.field = n
  35475. };
  35476. I.prototype = Object.create(a.prototype),
  35477. o.Extension = I;
  35478. var E = function(e, t, i, n) {
  35479. l.call(this, e, t, i, n),
  35480. this.className = "Service",
  35481. this.clazz = null
  35482. }
  35483. , b = E.prototype = Object.create(l.prototype);
  35484. b.build = function(i) {
  35485. return this.clazz && !i ? this.clazz : this.clazz = function(e, i) {
  35486. for (var n = function(t) {
  35487. e.Builder.Service.call(this),
  35488. this.rpcImpl = t || function(e, t, i) {
  35489. setTimeout(i.bind(this, Error("Not implemented, see: https://github.com/dcodeIO/ProtoBuf.js/wiki/Services")), 0)
  35490. }
  35491. }, r = n.prototype = Object.create(e.Builder.Service.prototype), o = i.getChildren(e.Reflect.Service.RPCMethod), a = 0; a < o.length; a++)
  35492. !function(e) {
  35493. r[e.name] = function(n, r) {
  35494. try {
  35495. try {
  35496. n = e.resolvedRequestType.clazz.decode(t.wrap(n))
  35497. } catch (e) {
  35498. if (!(e instanceof TypeError))
  35499. throw e
  35500. }
  35501. if (null === n || "object" != typeof n)
  35502. throw Error("Illegal arguments");
  35503. n instanceof e.resolvedRequestType.clazz || (n = new e.resolvedRequestType.clazz(n)),
  35504. this.rpcImpl(e.fqn(), n, function(t, n) {
  35505. if (t)
  35506. return void r(t);
  35507. null === n && (n = "");
  35508. try {
  35509. n = e.resolvedResponseType.clazz.decode(n)
  35510. } catch (e) {}
  35511. 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))
  35512. })
  35513. } catch (e) {
  35514. setTimeout(r.bind(this, e), 0)
  35515. }
  35516. }
  35517. ,
  35518. n[e.name] = function(t, i, r) {
  35519. new n(t)[e.name](i, r)
  35520. }
  35521. ,
  35522. Object.defineProperty && (Object.defineProperty(n[e.name], "$options", {
  35523. value: e.buildOpt()
  35524. }),
  35525. Object.defineProperty(r[e.name], "$options", {
  35526. value: n[e.name].$options
  35527. }))
  35528. }(o[a]);
  35529. return Object.defineProperty && (Object.defineProperty(n, "$options", {
  35530. value: i.buildOpt()
  35531. }),
  35532. Object.defineProperty(r, "$options", {
  35533. value: n.$options
  35534. }),
  35535. Object.defineProperty(n, "$type", {
  35536. value: i
  35537. }),
  35538. Object.defineProperty(r, "$type", {
  35539. value: i
  35540. })),
  35541. n
  35542. }(e, this)
  35543. }
  35544. ,
  35545. o.Service = E;
  35546. var w = function(e, t, i, n) {
  35547. a.call(this, e, t, i),
  35548. this.className = "Service.Method",
  35549. this.options = n || {}
  35550. }
  35551. , _ = w.prototype = Object.create(a.prototype);
  35552. _.buildOpt = c.buildOpt,
  35553. o.Service.Method = w;
  35554. var T = function(e, t, i, n, r, o, a, s) {
  35555. w.call(this, e, t, i, s),
  35556. this.className = "Service.RPCMethod",
  35557. this.requestName = n,
  35558. this.responseName = r,
  35559. this.requestStream = o,
  35560. this.responseStream = a,
  35561. this.resolvedRequestType = null,
  35562. this.resolvedResponseType = null
  35563. };
  35564. return T.prototype = Object.create(w.prototype),
  35565. o.Service.RPCMethod = T,
  35566. o
  35567. }(r),
  35568. r.Builder = function(t, i, n) {
  35569. function r(e) {
  35570. e.messages && e.messages.forEach(function(t) {
  35571. t.syntax = e.syntax,
  35572. r(t)
  35573. }),
  35574. e.enums && e.enums.forEach(function(t) {
  35575. t.syntax = e.syntax
  35576. })
  35577. }
  35578. var o = function(e) {
  35579. this.ns = new n.Namespace(this,null,""),
  35580. this.ptr = this.ns,
  35581. this.resolved = !1,
  35582. this.result = null,
  35583. this.files = {},
  35584. this.importRoot = null,
  35585. this.options = e || {}
  35586. }
  35587. , a = o.prototype;
  35588. return o.isMessage = function(e) {
  35589. return "string" == typeof e.name && ("undefined" == typeof e.values && "undefined" == typeof e.rpc)
  35590. }
  35591. ,
  35592. o.isMessageField = function(e) {
  35593. return "string" == typeof e.rule && "string" == typeof e.name && "string" == typeof e.type && "undefined" != typeof e.id
  35594. }
  35595. ,
  35596. o.isEnum = function(e) {
  35597. return "string" == typeof e.name && !("undefined" == typeof e.values || !Array.isArray(e.values) || 0 === e.values.length)
  35598. }
  35599. ,
  35600. o.isService = function(e) {
  35601. return !("string" != typeof e.name || "object" != typeof e.rpc || !e.rpc)
  35602. }
  35603. ,
  35604. o.isExtend = function(e) {
  35605. return "string" == typeof e.ref
  35606. }
  35607. ,
  35608. a.reset = function() {
  35609. return this.ptr = this.ns,
  35610. this
  35611. }
  35612. ,
  35613. a.define = function(e) {
  35614. if ("string" != typeof e || !i.TYPEREF.test(e))
  35615. throw Error("illegal namespace: " + e);
  35616. return e.split(".").forEach(function(e) {
  35617. var t = this.ptr.getChild(e);
  35618. null === t && this.ptr.addChild(t = new n.Namespace(this,this.ptr,e)),
  35619. this.ptr = t
  35620. }, this),
  35621. this
  35622. }
  35623. ,
  35624. a.create = function(e) {
  35625. if (!e)
  35626. return this;
  35627. if (Array.isArray(e)) {
  35628. if (0 === e.length)
  35629. return this;
  35630. e = e.slice()
  35631. } else
  35632. e = [e];
  35633. for (var i = [e]; i.length > 0; ) {
  35634. if (e = i.pop(),
  35635. !Array.isArray(e))
  35636. throw Error("not a valid namespace: " + JSON.stringify(e));
  35637. for (; e.length > 0; ) {
  35638. var r = e.shift();
  35639. if (o.isMessage(r)) {
  35640. var a = new n.Message(this,this.ptr,r.name,r.options,r.isGroup,r.syntax)
  35641. , s = {};
  35642. r.oneofs && Object.keys(r.oneofs).forEach(function(e) {
  35643. a.addChild(s[e] = new n.Message.OneOf(this,a,e))
  35644. }, this),
  35645. r.fields && r.fields.forEach(function(e) {
  35646. if (null !== a.getChild(0 | e.id))
  35647. throw Error("duplicate or invalid field id in " + a.name + ": " + e.id);
  35648. if (e.options && "object" != typeof e.options)
  35649. throw Error("illegal field options in " + a.name + "#" + e.name);
  35650. var t = null;
  35651. if ("string" == typeof e.oneof && !(t = s[e.oneof]))
  35652. throw Error("illegal oneof in " + a.name + "#" + e.name + ": " + e.oneof);
  35653. e = new n.Message.Field(this,a,e.rule,e.keytype,e.type,e.name,e.id,e.options,t,r.syntax),
  35654. t && t.fields.push(e),
  35655. a.addChild(e)
  35656. }, this);
  35657. var l = [];
  35658. if (r.enums && r.enums.forEach(function(e) {
  35659. l.push(e)
  35660. }),
  35661. r.messages && r.messages.forEach(function(e) {
  35662. l.push(e)
  35663. }),
  35664. r.services && r.services.forEach(function(e) {
  35665. l.push(e)
  35666. }),
  35667. r.extensions && ("number" == typeof r.extensions[0] ? a.extensions = [r.extensions] : a.extensions = r.extensions),
  35668. this.ptr.addChild(a),
  35669. l.length > 0) {
  35670. i.push(e),
  35671. e = l,
  35672. l = null,
  35673. this.ptr = a,
  35674. a = null;
  35675. continue
  35676. }
  35677. l = null
  35678. } else if (o.isEnum(r))
  35679. a = new n.Enum(this,this.ptr,r.name,r.options,r.syntax),
  35680. r.values.forEach(function(e) {
  35681. a.addChild(new n.Enum.Value(this,a,e.name,e.id))
  35682. }, this),
  35683. this.ptr.addChild(a);
  35684. else if (o.isService(r))
  35685. a = new n.Service(this,this.ptr,r.name,r.options),
  35686. Object.keys(r.rpc).forEach(function(e) {
  35687. var t = r.rpc[e];
  35688. a.addChild(new n.Service.RPCMethod(this,a,e,t.request,t.response,!!t.request_stream,!!t.response_stream,t.options))
  35689. }, this),
  35690. this.ptr.addChild(a);
  35691. else {
  35692. if (!o.isExtend(r))
  35693. throw Error("not a valid definition: " + JSON.stringify(r));
  35694. if (a = this.ptr.resolve(r.ref, !0))
  35695. r.fields.forEach(function(e) {
  35696. if (null !== a.getChild(0 | e.id))
  35697. throw Error("duplicate extended field id in " + a.name + ": " + e.id);
  35698. if (a.extensions) {
  35699. var i = !1;
  35700. if (a.extensions.forEach(function(t) {
  35701. e.id >= t[0] && e.id <= t[1] && (i = !0)
  35702. }),
  35703. !i)
  35704. throw Error("illegal extended field id in " + a.name + ": " + e.id + " (not within valid ranges)")
  35705. }
  35706. var r = e.name;
  35707. this.options.convertFieldsToCamelCase && (r = t.Util.toCamelCase(r));
  35708. var o = new n.Message.ExtensionField(this,a,e.rule,e.type,this.ptr.fqn() + "." + r,e.id,e.options)
  35709. , s = new n.Extension(this,this.ptr,e.name,o);
  35710. o.extension = s,
  35711. this.ptr.addChild(s),
  35712. a.addChild(o)
  35713. }, this);
  35714. else if (!/\.?google\.protobuf\./.test(r.ref))
  35715. throw Error("extended message " + r.ref + " is not defined")
  35716. }
  35717. r = null,
  35718. a = null
  35719. }
  35720. e = null,
  35721. this.ptr = this.ptr.parent
  35722. }
  35723. return this.resolved = !1,
  35724. this.result = null,
  35725. this
  35726. }
  35727. ,
  35728. a.import = function(i, n) {
  35729. var o = "/";
  35730. if ("string" == typeof n) {
  35731. if (t.Util.IS_NODE && (n = e("path").resolve(n)),
  35732. this.files[n] === !0)
  35733. return this.reset();
  35734. this.files[n] = !0
  35735. } else if ("object" == typeof n) {
  35736. var a = n.root;
  35737. t.Util.IS_NODE && (a = e("path").resolve(a)),
  35738. (a.indexOf("\\") >= 0 || n.file.indexOf("\\") >= 0) && (o = "\\");
  35739. var s = a + o + n.file;
  35740. if (this.files[s] === !0)
  35741. return this.reset();
  35742. this.files[s] = !0
  35743. }
  35744. if (i.imports && i.imports.length > 0) {
  35745. var l, c = !1;
  35746. "object" == typeof n ? (this.importRoot = n.root,
  35747. c = !0,
  35748. l = this.importRoot,
  35749. n = n.file,
  35750. (l.indexOf("\\") >= 0 || n.indexOf("\\") >= 0) && (o = "\\")) : "string" == typeof n ? this.importRoot ? l = this.importRoot : n.indexOf("/") >= 0 ? (l = n.replace(/\/[^\/]*$/, ""),
  35751. "" === l && (l = "/")) : n.indexOf("\\") >= 0 ? (l = n.replace(/\\[^\\]*$/, ""),
  35752. o = "\\") : l = "." : l = null;
  35753. for (var h = 0; h < i.imports.length; h++)
  35754. if ("string" == typeof i.imports[h]) {
  35755. if (!l)
  35756. throw Error("cannot determine import root");
  35757. var u = i.imports[h];
  35758. if ("google/protobuf/descriptor.proto" === u)
  35759. continue;
  35760. if (u = l + o + u,
  35761. this.files[u] === !0)
  35762. continue;
  35763. /\.proto$/i.test(u) && !t.DotProto && (u = u.replace(/\.proto$/, ".json"));
  35764. var d = t.Util.fetch(u);
  35765. if (null === d)
  35766. throw Error("failed to import '" + u + "' in '" + n + "': file not found");
  35767. /\.json$/i.test(u) ? this.import(JSON.parse(d + ""), u) : this.import(t.DotProto.Parser.parse(d), u)
  35768. } else
  35769. n ? /\.(\w+)$/.test(n) ? this.import(i.imports[h], n.replace(/^(.+)\.(\w+)$/, function(e, t, i) {
  35770. return t + "_import" + h + "." + i
  35771. })) : this.import(i.imports[h], n + "_import" + h) : this.import(i.imports[h]);
  35772. c && (this.importRoot = null)
  35773. }
  35774. i.package && this.define(i.package),
  35775. i.syntax && r(i);
  35776. var p = this.ptr;
  35777. return i.options && Object.keys(i.options).forEach(function(e) {
  35778. p.options[e] = i.options[e]
  35779. }),
  35780. i.messages && (this.create(i.messages),
  35781. this.ptr = p),
  35782. i.enums && (this.create(i.enums),
  35783. this.ptr = p),
  35784. i.services && (this.create(i.services),
  35785. this.ptr = p),
  35786. i.extends && this.create(i.extends),
  35787. this.reset()
  35788. }
  35789. ,
  35790. a.resolveAll = function() {
  35791. var e;
  35792. if (null == this.ptr || "object" == typeof this.ptr.type)
  35793. return this;
  35794. if (this.ptr instanceof n.Namespace)
  35795. this.ptr.children.forEach(function(e) {
  35796. this.ptr = e,
  35797. this.resolveAll()
  35798. }, this);
  35799. else if (this.ptr instanceof n.Message.Field) {
  35800. if (i.TYPE.test(this.ptr.type))
  35801. this.ptr.type = t.TYPES[this.ptr.type];
  35802. else {
  35803. if (!i.TYPEREF.test(this.ptr.type))
  35804. throw Error("illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  35805. if (e = (this.ptr instanceof n.Message.ExtensionField ? this.ptr.extension.parent : this.ptr.parent).resolve(this.ptr.type, !0),
  35806. !e)
  35807. throw Error("unresolvable type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  35808. if (this.ptr.resolvedType = e,
  35809. e instanceof n.Enum) {
  35810. if (this.ptr.type = t.TYPES.enum,
  35811. "proto3" === this.ptr.syntax && "proto3" !== e.syntax)
  35812. throw Error("proto3 message cannot reference proto2 enum")
  35813. } else {
  35814. if (!(e instanceof n.Message))
  35815. throw Error("illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  35816. this.ptr.type = e.isGroup ? t.TYPES.group : t.TYPES.message
  35817. }
  35818. }
  35819. if (this.ptr.map) {
  35820. if (!i.TYPE.test(this.ptr.keyType))
  35821. throw Error("illegal key type for map field in " + this.ptr.toString(!0) + ": " + this.ptr.keyType);
  35822. this.ptr.keyType = t.TYPES[this.ptr.keyType]
  35823. }
  35824. } else if (this.ptr instanceof t.Reflect.Service.Method) {
  35825. if (!(this.ptr instanceof t.Reflect.Service.RPCMethod))
  35826. throw Error("illegal service type in " + this.ptr.toString(!0));
  35827. if (e = this.ptr.parent.resolve(this.ptr.requestName, !0),
  35828. !(e && e instanceof t.Reflect.Message))
  35829. throw Error("Illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.requestName);
  35830. if (this.ptr.resolvedRequestType = e,
  35831. e = this.ptr.parent.resolve(this.ptr.responseName, !0),
  35832. !(e && e instanceof t.Reflect.Message))
  35833. throw Error("Illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.responseName);
  35834. this.ptr.resolvedResponseType = e
  35835. } else if (!(this.ptr instanceof t.Reflect.Message.OneOf || this.ptr instanceof t.Reflect.Extension || this.ptr instanceof t.Reflect.Enum.Value))
  35836. throw Error("illegal object in namespace: " + typeof this.ptr + ": " + this.ptr);
  35837. return this.reset()
  35838. }
  35839. ,
  35840. a.build = function(e) {
  35841. if (this.reset(),
  35842. this.resolved || (this.resolveAll(),
  35843. this.resolved = !0,
  35844. this.result = null),
  35845. null === this.result && (this.result = this.ns.build()),
  35846. !e)
  35847. return this.result;
  35848. for (var t = "string" == typeof e ? e.split(".") : e, i = this.result, n = 0; n < t.length; n++) {
  35849. if (!i[t[n]]) {
  35850. i = null;
  35851. break
  35852. }
  35853. i = i[t[n]]
  35854. }
  35855. return i
  35856. }
  35857. ,
  35858. a.lookup = function(e, t) {
  35859. return e ? this.ns.resolve(e, t) : this.ns
  35860. }
  35861. ,
  35862. a.toString = function() {
  35863. return "Builder"
  35864. }
  35865. ,
  35866. o.Message = function() {}
  35867. ,
  35868. o.Enum = function() {}
  35869. ,
  35870. o.Service = function() {}
  35871. ,
  35872. o
  35873. }(r, r.Lang, r.Reflect),
  35874. r.Map = function(e, t) {
  35875. function i(e) {
  35876. var t = 0;
  35877. return {
  35878. next: function() {
  35879. return t < e.length ? {
  35880. done: !1,
  35881. value: e[t++]
  35882. } : {
  35883. done: !0
  35884. }
  35885. }
  35886. }
  35887. }
  35888. var n = function(e, i) {
  35889. if (!e.map)
  35890. throw Error("field is not a map");
  35891. if (this.field = e,
  35892. this.keyElem = new t.Element(e.keyType,null,!0,e.syntax),
  35893. this.valueElem = new t.Element(e.type,e.resolvedType,!1,e.syntax),
  35894. this.map = {},
  35895. Object.defineProperty(this, "size", {
  35896. get: function() {
  35897. return Object.keys(this.map).length
  35898. }
  35899. }),
  35900. i)
  35901. for (var n = Object.keys(i), r = 0; r < n.length; r++) {
  35902. var o = this.keyElem.valueFromString(n[r])
  35903. , a = this.valueElem.verifyValue(i[n[r]]);
  35904. this.map[this.keyElem.valueToString(o)] = {
  35905. key: o,
  35906. value: a
  35907. }
  35908. }
  35909. }
  35910. , r = n.prototype;
  35911. return r.clear = function() {
  35912. this.map = {}
  35913. }
  35914. ,
  35915. r.delete = function(e) {
  35916. var t = this.keyElem.valueToString(this.keyElem.verifyValue(e))
  35917. , i = t in this.map;
  35918. return delete this.map[t],
  35919. i
  35920. }
  35921. ,
  35922. r.entries = function() {
  35923. for (var e, t = [], n = Object.keys(this.map), r = 0; r < n.length; r++)
  35924. t.push([(e = this.map[n[r]]).key, e.value]);
  35925. return i(t)
  35926. }
  35927. ,
  35928. r.keys = function() {
  35929. for (var e = [], t = Object.keys(this.map), n = 0; n < t.length; n++)
  35930. e.push(this.map[t[n]].key);
  35931. return i(e)
  35932. }
  35933. ,
  35934. r.values = function() {
  35935. for (var e = [], t = Object.keys(this.map), n = 0; n < t.length; n++)
  35936. e.push(this.map[t[n]].value);
  35937. return i(e)
  35938. }
  35939. ,
  35940. r.forEach = function(e, t) {
  35941. for (var i, n = Object.keys(this.map), r = 0; r < n.length; r++)
  35942. e.call(t, (i = this.map[n[r]]).value, i.key, this)
  35943. }
  35944. ,
  35945. r.set = function(e, t) {
  35946. var i = this.keyElem.verifyValue(e)
  35947. , n = this.valueElem.verifyValue(t);
  35948. return this.map[this.keyElem.valueToString(i)] = {
  35949. key: i,
  35950. value: n
  35951. },
  35952. this
  35953. }
  35954. ,
  35955. r.get = function(e) {
  35956. var t = this.keyElem.valueToString(this.keyElem.verifyValue(e));
  35957. if (t in this.map)
  35958. return this.map[t].value
  35959. }
  35960. ,
  35961. r.has = function(e) {
  35962. var t = this.keyElem.valueToString(this.keyElem.verifyValue(e));
  35963. return t in this.map
  35964. }
  35965. ,
  35966. n
  35967. }(r, r.Reflect),
  35968. r.loadProto = function(e, t, i) {
  35969. return ("string" == typeof t || t && "string" == typeof t.file && "string" == typeof t.root) && (i = t,
  35970. t = void 0),
  35971. r.loadJson(r.DotProto.Parser.parse(e), t, i)
  35972. }
  35973. ,
  35974. r.protoFromString = r.loadProto,
  35975. r.loadProtoFile = function(e, t, i) {
  35976. if (t && "object" == typeof t ? (i = t,
  35977. t = null) : t && "function" == typeof t || (t = null),
  35978. t)
  35979. return r.Util.fetch("string" == typeof e ? e : e.root + "/" + e.file, function(n) {
  35980. if (null === n)
  35981. return void t(Error("Failed to fetch file"));
  35982. try {
  35983. t(null, r.loadProto(n, i, e))
  35984. } catch (e) {
  35985. t(e)
  35986. }
  35987. });
  35988. var n = r.Util.fetch("object" == typeof e ? e.root + "/" + e.file : e);
  35989. return null === n ? null : r.loadProto(n, i, e)
  35990. }
  35991. ,
  35992. r.protoFromFile = r.loadProtoFile,
  35993. r.newBuilder = function(e) {
  35994. return e = e || {},
  35995. "undefined" == typeof e.convertFieldsToCamelCase && (e.convertFieldsToCamelCase = r.convertFieldsToCamelCase),
  35996. "undefined" == typeof e.populateAccessors && (e.populateAccessors = r.populateAccessors),
  35997. new r.Builder(e)
  35998. }
  35999. ,
  36000. r.loadJson = function(e, t, i) {
  36001. return ("string" == typeof t || t && "string" == typeof t.file && "string" == typeof t.root) && (i = t,
  36002. t = null),
  36003. t && "object" == typeof t || (t = r.newBuilder()),
  36004. "string" == typeof e && (e = JSON.parse(e)),
  36005. t.import(e, i),
  36006. t.resolveAll(),
  36007. t
  36008. }
  36009. ,
  36010. r.loadJsonFile = function(e, t, i) {
  36011. if (t && "object" == typeof t ? (i = t,
  36012. t = null) : t && "function" == typeof t || (t = null),
  36013. t)
  36014. return r.Util.fetch("string" == typeof e ? e : e.root + "/" + e.file, function(n) {
  36015. if (null === n)
  36016. return void t(Error("Failed to fetch file"));
  36017. try {
  36018. t(null, r.loadJson(JSON.parse(n), i, e))
  36019. } catch (e) {
  36020. t(e)
  36021. }
  36022. });
  36023. var n = r.Util.fetch("object" == typeof e ? e.root + "/" + e.file : e);
  36024. return null === n ? null : r.loadJson(JSON.parse(n), i, e)
  36025. }
  36026. ,
  36027. r
  36028. })
  36029. }
  36030. ).call(this, e("_process"))
  36031. }
  36032. , {
  36033. _process: 203,
  36034. bytebuffer: 215,
  36035. fs: 197,
  36036. path: 197
  36037. }],
  36038. 215: [function(e, t, i) {
  36039. !function(i, n) {
  36040. "function" == typeof define && define.amd ? define(["long"], n) : "function" == typeof e && "object" == typeof t && t && t.exports ? t.exports = function() {
  36041. var t;
  36042. try {
  36043. t = e("long")
  36044. } catch (e) {}
  36045. return n(t)
  36046. }() : (i.dcodeIO = i.dcodeIO || {}).ByteBuffer = n(i.dcodeIO.Long)
  36047. }(this, function(e) {
  36048. "use strict";
  36049. function t(e) {
  36050. var t = 0;
  36051. return function() {
  36052. return t < e.length ? e.charCodeAt(t++) : null
  36053. }
  36054. }
  36055. function i() {
  36056. var e = []
  36057. , t = [];
  36058. return function() {
  36059. return 0 === arguments.length ? t.join("") + l.apply(String, e) : (e.length + arguments.length > 1024 && (t.push(l.apply(String, e)),
  36060. e.length = 0),
  36061. void Array.prototype.push.apply(e, arguments))
  36062. }
  36063. }
  36064. function n(e, t, i, n, r) {
  36065. 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];
  36066. for (u += d,
  36067. o = p & (1 << -h) - 1,
  36068. p >>= -h,
  36069. h += s; h > 0; o = 256 * o + e[t + u],
  36070. u += d,
  36071. h -= 8)
  36072. ;
  36073. for (a = o & (1 << -h) - 1,
  36074. o >>= -h,
  36075. h += n; h > 0; a = 256 * a + e[t + u],
  36076. u += d,
  36077. h -= 8)
  36078. ;
  36079. if (0 === o)
  36080. o = 1 - c;
  36081. else {
  36082. if (o === l)
  36083. return a ? NaN : (p ? -1 : 1) * (1 / 0);
  36084. a += Math.pow(2, n),
  36085. o -= c
  36086. }
  36087. return (p ? -1 : 1) * a * Math.pow(2, o - n)
  36088. }
  36089. function r(e, t, i, n, r, o) {
  36090. 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;
  36091. for (t = Math.abs(t),
  36092. isNaN(t) || t === 1 / 0 ? (s = isNaN(t) ? 1 : 0,
  36093. a = h) : (a = Math.floor(Math.log(t) / Math.LN2),
  36094. t * (l = Math.pow(2, -a)) < 1 && (a--,
  36095. l *= 2),
  36096. t += a + u >= 1 ? d / l : d * Math.pow(2, 1 - u),
  36097. t * l >= 2 && (a++,
  36098. l /= 2),
  36099. a + u >= h ? (s = 0,
  36100. a = h) : a + u >= 1 ? (s = (t * l - 1) * Math.pow(2, r),
  36101. a += u) : (s = t * Math.pow(2, u - 1) * Math.pow(2, r),
  36102. a = 0)); r >= 8; e[i + p] = 255 & s,
  36103. p += f,
  36104. s /= 256,
  36105. r -= 8)
  36106. ;
  36107. for (a = a << r | s,
  36108. c += r; c > 0; e[i + p] = 255 & a,
  36109. p += f,
  36110. a /= 256,
  36111. c -= 8)
  36112. ;
  36113. e[i + p - f] |= 128 * g
  36114. }
  36115. var o = function(e, t, i) {
  36116. if ("undefined" == typeof e && (e = o.DEFAULT_CAPACITY),
  36117. "undefined" == typeof t && (t = o.DEFAULT_ENDIAN),
  36118. "undefined" == typeof i && (i = o.DEFAULT_NOASSERT),
  36119. !i) {
  36120. if (e |= 0,
  36121. e < 0)
  36122. throw RangeError("Illegal capacity");
  36123. t = !!t,
  36124. i = !!i
  36125. }
  36126. this.buffer = 0 === e ? s : new ArrayBuffer(e),
  36127. this.view = 0 === e ? null : new Uint8Array(this.buffer),
  36128. this.offset = 0,
  36129. this.markedOffset = -1,
  36130. this.limit = e,
  36131. this.littleEndian = t,
  36132. this.noAssert = i
  36133. };
  36134. o.VERSION = "5.0.1",
  36135. o.LITTLE_ENDIAN = !0,
  36136. o.BIG_ENDIAN = !1,
  36137. o.DEFAULT_CAPACITY = 16,
  36138. o.DEFAULT_ENDIAN = o.BIG_ENDIAN,
  36139. o.DEFAULT_NOASSERT = !1,
  36140. o.Long = e || null;
  36141. var a = o.prototype;
  36142. a.__isByteBuffer__,
  36143. Object.defineProperty(a, "__isByteBuffer__", {
  36144. value: !0,
  36145. enumerable: !1,
  36146. configurable: !1
  36147. });
  36148. var s = new ArrayBuffer(0)
  36149. , l = String.fromCharCode;
  36150. o.accessor = function() {
  36151. return Uint8Array
  36152. }
  36153. ,
  36154. o.allocate = function(e, t, i) {
  36155. return new o(e,t,i)
  36156. }
  36157. ,
  36158. o.concat = function(e, t, i, n) {
  36159. "boolean" != typeof t && "string" == typeof t || (n = i,
  36160. i = t,
  36161. t = void 0);
  36162. for (var r, a = 0, s = 0, l = e.length; s < l; ++s)
  36163. o.isByteBuffer(e[s]) || (e[s] = o.wrap(e[s], t)),
  36164. r = e[s].limit - e[s].offset,
  36165. r > 0 && (a += r);
  36166. if (0 === a)
  36167. return new o(0,i,n);
  36168. var c, h = new o(a,i,n);
  36169. for (s = 0; s < l; )
  36170. c = e[s++],
  36171. r = c.limit - c.offset,
  36172. r <= 0 || (h.view.set(c.view.subarray(c.offset, c.limit), h.offset),
  36173. h.offset += r);
  36174. return h.limit = h.offset,
  36175. h.offset = 0,
  36176. h
  36177. }
  36178. ,
  36179. o.isByteBuffer = function(e) {
  36180. return (e && e.__isByteBuffer__) === !0
  36181. }
  36182. ,
  36183. o.type = function() {
  36184. return ArrayBuffer
  36185. }
  36186. ,
  36187. o.wrap = function(e, t, i, n) {
  36188. if ("string" != typeof t && (n = i,
  36189. i = t,
  36190. t = void 0),
  36191. "string" == typeof e)
  36192. switch ("undefined" == typeof t && (t = "utf8"),
  36193. t) {
  36194. case "base64":
  36195. return o.fromBase64(e, i);
  36196. case "hex":
  36197. return o.fromHex(e, i);
  36198. case "binary":
  36199. return o.fromBinary(e, i);
  36200. case "utf8":
  36201. return o.fromUTF8(e, i);
  36202. case "debug":
  36203. return o.fromDebug(e, i);
  36204. default:
  36205. throw Error("Unsupported encoding: " + t)
  36206. }
  36207. if (null === e || "object" != typeof e)
  36208. throw TypeError("Illegal buffer");
  36209. var r;
  36210. if (o.isByteBuffer(e))
  36211. return r = a.clone.call(e),
  36212. r.markedOffset = -1,
  36213. r;
  36214. if (e instanceof Uint8Array)
  36215. r = new o(0,i,n),
  36216. e.length > 0 && (r.buffer = e.buffer,
  36217. r.offset = e.byteOffset,
  36218. r.limit = e.byteOffset + e.byteLength,
  36219. r.view = new Uint8Array(e.buffer));
  36220. else if (e instanceof ArrayBuffer)
  36221. r = new o(0,i,n),
  36222. e.byteLength > 0 && (r.buffer = e,
  36223. r.offset = 0,
  36224. r.limit = e.byteLength,
  36225. r.view = e.byteLength > 0 ? new Uint8Array(e) : null);
  36226. else {
  36227. if ("[object Array]" !== Object.prototype.toString.call(e))
  36228. throw TypeError("Illegal buffer");
  36229. r = new o(e.length,i,n),
  36230. r.limit = e.length;
  36231. for (var s = 0; s < e.length; ++s)
  36232. r.view[s] = e[s]
  36233. }
  36234. return r
  36235. }
  36236. ,
  36237. a.writeBitSet = function(e, t) {
  36238. var i = "undefined" == typeof t;
  36239. if (i && (t = this.offset),
  36240. !this.noAssert) {
  36241. if (!(e instanceof Array))
  36242. throw TypeError("Illegal BitSet: Not an array");
  36243. if ("number" != typeof t || t % 1 !== 0)
  36244. throw TypeError("Illegal offset: " + t + " (not an integer)");
  36245. if (t >>>= 0,
  36246. t < 0 || t + 0 > this.buffer.byteLength)
  36247. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  36248. }
  36249. var n, r = t, o = e.length, a = o >> 3, s = 0;
  36250. for (t += this.writeVarint32(o, t); a--; )
  36251. 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,
  36252. this.writeByte(n, t++);
  36253. if (s < o) {
  36254. var l = 0;
  36255. for (n = 0; s < o; )
  36256. n |= (1 & !!e[s++]) << l++;
  36257. this.writeByte(n, t++)
  36258. }
  36259. return i ? (this.offset = t,
  36260. this) : t - r
  36261. }
  36262. ,
  36263. a.readBitSet = function(e) {
  36264. var t = "undefined" == typeof e;
  36265. t && (e = this.offset);
  36266. var i, n = this.readVarint32(e), r = n.value, o = r >> 3, a = 0, s = [];
  36267. for (e += n.length; o--; )
  36268. i = this.readByte(e++),
  36269. s[a++] = !!(1 & i),
  36270. s[a++] = !!(2 & i),
  36271. s[a++] = !!(4 & i),
  36272. s[a++] = !!(8 & i),
  36273. s[a++] = !!(16 & i),
  36274. s[a++] = !!(32 & i),
  36275. s[a++] = !!(64 & i),
  36276. s[a++] = !!(128 & i);
  36277. if (a < r) {
  36278. var l = 0;
  36279. for (i = this.readByte(e++); a < r; )
  36280. s[a++] = !!(i >> l++ & 1)
  36281. }
  36282. return t && (this.offset = e),
  36283. s
  36284. }
  36285. ,
  36286. a.readBytes = function(e, t) {
  36287. var i = "undefined" == typeof t;
  36288. if (i && (t = this.offset),
  36289. !this.noAssert) {
  36290. if ("number" != typeof t || t % 1 !== 0)
  36291. throw TypeError("Illegal offset: " + t + " (not an integer)");
  36292. if (t >>>= 0,
  36293. t < 0 || t + e > this.buffer.byteLength)
  36294. throw RangeError("Illegal offset: 0 <= " + t + " (+" + e + ") <= " + this.buffer.byteLength)
  36295. }
  36296. var n = this.slice(t, t + e);
  36297. return i && (this.offset += e),
  36298. n
  36299. }
  36300. ,
  36301. a.writeBytes = a.append,
  36302. a.writeInt8 = function(e, t) {
  36303. var i = "undefined" == typeof t;
  36304. if (i && (t = this.offset),
  36305. !this.noAssert) {
  36306. if ("number" != typeof e || e % 1 !== 0)
  36307. throw TypeError("Illegal value: " + e + " (not an integer)");
  36308. if (e |= 0,
  36309. "number" != typeof t || t % 1 !== 0)
  36310. throw TypeError("Illegal offset: " + t + " (not an integer)");
  36311. if (t >>>= 0,
  36312. t < 0 || t + 0 > this.buffer.byteLength)
  36313. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  36314. }
  36315. t += 1;
  36316. var n = this.buffer.byteLength;
  36317. return t > n && this.resize((n *= 2) > t ? n : t),
  36318. t -= 1,
  36319. this.view[t] = e,
  36320. i && (this.offset += 1),
  36321. this
  36322. }
  36323. ,
  36324. a.writeByte = a.writeInt8,
  36325. a.readInt8 = function(e) {
  36326. var t = "undefined" == typeof e;
  36327. if (t && (e = this.offset),
  36328. !this.noAssert) {
  36329. if ("number" != typeof e || e % 1 !== 0)
  36330. throw TypeError("Illegal offset: " + e + " (not an integer)");
  36331. if (e >>>= 0,
  36332. e < 0 || e + 1 > this.buffer.byteLength)
  36333. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  36334. }
  36335. var i = this.view[e];
  36336. return 128 === (128 & i) && (i = -(255 - i + 1)),
  36337. t && (this.offset += 1),
  36338. i
  36339. }
  36340. ,
  36341. a.readByte = a.readInt8,
  36342. a.writeUint8 = function(e, t) {
  36343. var i = "undefined" == typeof t;
  36344. if (i && (t = this.offset),
  36345. !this.noAssert) {
  36346. if ("number" != typeof e || e % 1 !== 0)
  36347. throw TypeError("Illegal value: " + e + " (not an integer)");
  36348. if (e >>>= 0,
  36349. "number" != typeof t || t % 1 !== 0)
  36350. throw TypeError("Illegal offset: " + t + " (not an integer)");
  36351. if (t >>>= 0,
  36352. t < 0 || t + 0 > this.buffer.byteLength)
  36353. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  36354. }
  36355. t += 1;
  36356. var n = this.buffer.byteLength;
  36357. return t > n && this.resize((n *= 2) > t ? n : t),
  36358. t -= 1,
  36359. this.view[t] = e,
  36360. i && (this.offset += 1),
  36361. this
  36362. }
  36363. ,
  36364. a.writeUInt8 = a.writeUint8,
  36365. a.readUint8 = function(e) {
  36366. var t = "undefined" == typeof e;
  36367. if (t && (e = this.offset),
  36368. !this.noAssert) {
  36369. if ("number" != typeof e || e % 1 !== 0)
  36370. throw TypeError("Illegal offset: " + e + " (not an integer)");
  36371. if (e >>>= 0,
  36372. e < 0 || e + 1 > this.buffer.byteLength)
  36373. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  36374. }
  36375. var i = this.view[e];
  36376. return t && (this.offset += 1),
  36377. i
  36378. }
  36379. ,
  36380. a.readUInt8 = a.readUint8,
  36381. a.writeInt16 = function(e, t) {
  36382. var i = "undefined" == typeof t;
  36383. if (i && (t = this.offset),
  36384. !this.noAssert) {
  36385. if ("number" != typeof e || e % 1 !== 0)
  36386. throw TypeError("Illegal value: " + e + " (not an integer)");
  36387. if (e |= 0,
  36388. "number" != typeof t || t % 1 !== 0)
  36389. throw TypeError("Illegal offset: " + t + " (not an integer)");
  36390. if (t >>>= 0,
  36391. t < 0 || t + 0 > this.buffer.byteLength)
  36392. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  36393. }
  36394. t += 2;
  36395. var n = this.buffer.byteLength;
  36396. return t > n && this.resize((n *= 2) > t ? n : t),
  36397. t -= 2,
  36398. this.littleEndian ? (this.view[t + 1] = (65280 & e) >>> 8,
  36399. this.view[t] = 255 & e) : (this.view[t] = (65280 & e) >>> 8,
  36400. this.view[t + 1] = 255 & e),
  36401. i && (this.offset += 2),
  36402. this
  36403. }
  36404. ,
  36405. a.writeShort = a.writeInt16,
  36406. a.readInt16 = function(e) {
  36407. var t = "undefined" == typeof e;
  36408. if (t && (e = this.offset),
  36409. !this.noAssert) {
  36410. if ("number" != typeof e || e % 1 !== 0)
  36411. throw TypeError("Illegal offset: " + e + " (not an integer)");
  36412. if (e >>>= 0,
  36413. e < 0 || e + 2 > this.buffer.byteLength)
  36414. throw RangeError("Illegal offset: 0 <= " + e + " (+2) <= " + this.buffer.byteLength)
  36415. }
  36416. var i = 0;
  36417. return this.littleEndian ? (i = this.view[e],
  36418. i |= this.view[e + 1] << 8) : (i = this.view[e] << 8,
  36419. i |= this.view[e + 1]),
  36420. 32768 === (32768 & i) && (i = -(65535 - i + 1)),
  36421. t && (this.offset += 2),
  36422. i
  36423. }
  36424. ,
  36425. a.readShort = a.readInt16,
  36426. a.writeUint16 = function(e, t) {
  36427. var i = "undefined" == typeof t;
  36428. if (i && (t = this.offset),
  36429. !this.noAssert) {
  36430. if ("number" != typeof e || e % 1 !== 0)
  36431. throw TypeError("Illegal value: " + e + " (not an integer)");
  36432. if (e >>>= 0,
  36433. "number" != typeof t || t % 1 !== 0)
  36434. throw TypeError("Illegal offset: " + t + " (not an integer)");
  36435. if (t >>>= 0,
  36436. t < 0 || t + 0 > this.buffer.byteLength)
  36437. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  36438. }
  36439. t += 2;
  36440. var n = this.buffer.byteLength;
  36441. return t > n && this.resize((n *= 2) > t ? n : t),
  36442. t -= 2,
  36443. this.littleEndian ? (this.view[t + 1] = (65280 & e) >>> 8,
  36444. this.view[t] = 255 & e) : (this.view[t] = (65280 & e) >>> 8,
  36445. this.view[t + 1] = 255 & e),
  36446. i && (this.offset += 2),
  36447. this
  36448. }
  36449. ,
  36450. a.writeUInt16 = a.writeUint16,
  36451. a.readUint16 = function(e) {
  36452. var t = "undefined" == typeof e;
  36453. if (t && (e = this.offset),
  36454. !this.noAssert) {
  36455. if ("number" != typeof e || e % 1 !== 0)
  36456. throw TypeError("Illegal offset: " + e + " (not an integer)");
  36457. if (e >>>= 0,
  36458. e < 0 || e + 2 > this.buffer.byteLength)
  36459. throw RangeError("Illegal offset: 0 <= " + e + " (+2) <= " + this.buffer.byteLength)
  36460. }
  36461. var i = 0;
  36462. return this.littleEndian ? (i = this.view[e],
  36463. i |= this.view[e + 1] << 8) : (i = this.view[e] << 8,
  36464. i |= this.view[e + 1]),
  36465. t && (this.offset += 2),
  36466. i
  36467. }
  36468. ,
  36469. a.readUInt16 = a.readUint16,
  36470. a.writeInt32 = function(e, t) {
  36471. var i = "undefined" == typeof t;
  36472. if (i && (t = this.offset),
  36473. !this.noAssert) {
  36474. if ("number" != typeof e || e % 1 !== 0)
  36475. throw TypeError("Illegal value: " + e + " (not an integer)");
  36476. if (e |= 0,
  36477. "number" != typeof t || t % 1 !== 0)
  36478. throw TypeError("Illegal offset: " + t + " (not an integer)");
  36479. if (t >>>= 0,
  36480. t < 0 || t + 0 > this.buffer.byteLength)
  36481. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  36482. }
  36483. t += 4;
  36484. var n = this.buffer.byteLength;
  36485. return t > n && this.resize((n *= 2) > t ? n : t),
  36486. t -= 4,
  36487. this.littleEndian ? (this.view[t + 3] = e >>> 24 & 255,
  36488. this.view[t + 2] = e >>> 16 & 255,
  36489. this.view[t + 1] = e >>> 8 & 255,
  36490. this.view[t] = 255 & e) : (this.view[t] = e >>> 24 & 255,
  36491. this.view[t + 1] = e >>> 16 & 255,
  36492. this.view[t + 2] = e >>> 8 & 255,
  36493. this.view[t + 3] = 255 & e),
  36494. i && (this.offset += 4),
  36495. this
  36496. }
  36497. ,
  36498. a.writeInt = a.writeInt32,
  36499. a.readInt32 = function(e) {
  36500. var t = "undefined" == typeof e;
  36501. if (t && (e = this.offset),
  36502. !this.noAssert) {
  36503. if ("number" != typeof e || e % 1 !== 0)
  36504. throw TypeError("Illegal offset: " + e + " (not an integer)");
  36505. if (e >>>= 0,
  36506. e < 0 || e + 4 > this.buffer.byteLength)
  36507. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  36508. }
  36509. var i = 0;
  36510. return this.littleEndian ? (i = this.view[e + 2] << 16,
  36511. i |= this.view[e + 1] << 8,
  36512. i |= this.view[e],
  36513. i += this.view[e + 3] << 24 >>> 0) : (i = this.view[e + 1] << 16,
  36514. i |= this.view[e + 2] << 8,
  36515. i |= this.view[e + 3],
  36516. i += this.view[e] << 24 >>> 0),
  36517. i |= 0,
  36518. t && (this.offset += 4),
  36519. i
  36520. }
  36521. ,
  36522. a.readInt = a.readInt32,
  36523. a.writeUint32 = function(e, t) {
  36524. var i = "undefined" == typeof t;
  36525. if (i && (t = this.offset),
  36526. !this.noAssert) {
  36527. if ("number" != typeof e || e % 1 !== 0)
  36528. throw TypeError("Illegal value: " + e + " (not an integer)");
  36529. if (e >>>= 0,
  36530. "number" != typeof t || t % 1 !== 0)
  36531. throw TypeError("Illegal offset: " + t + " (not an integer)");
  36532. if (t >>>= 0,
  36533. t < 0 || t + 0 > this.buffer.byteLength)
  36534. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  36535. }
  36536. t += 4;
  36537. var n = this.buffer.byteLength;
  36538. return t > n && this.resize((n *= 2) > t ? n : t),
  36539. t -= 4,
  36540. this.littleEndian ? (this.view[t + 3] = e >>> 24 & 255,
  36541. this.view[t + 2] = e >>> 16 & 255,
  36542. this.view[t + 1] = e >>> 8 & 255,
  36543. this.view[t] = 255 & e) : (this.view[t] = e >>> 24 & 255,
  36544. this.view[t + 1] = e >>> 16 & 255,
  36545. this.view[t + 2] = e >>> 8 & 255,
  36546. this.view[t + 3] = 255 & e),
  36547. i && (this.offset += 4),
  36548. this
  36549. }
  36550. ,
  36551. a.writeUInt32 = a.writeUint32,
  36552. a.readUint32 = function(e) {
  36553. var t = "undefined" == typeof e;
  36554. if (t && (e = this.offset),
  36555. !this.noAssert) {
  36556. if ("number" != typeof e || e % 1 !== 0)
  36557. throw TypeError("Illegal offset: " + e + " (not an integer)");
  36558. if (e >>>= 0,
  36559. e < 0 || e + 4 > this.buffer.byteLength)
  36560. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  36561. }
  36562. var i = 0;
  36563. return this.littleEndian ? (i = this.view[e + 2] << 16,
  36564. i |= this.view[e + 1] << 8,
  36565. i |= this.view[e],
  36566. i += this.view[e + 3] << 24 >>> 0) : (i = this.view[e + 1] << 16,
  36567. i |= this.view[e + 2] << 8,
  36568. i |= this.view[e + 3],
  36569. i += this.view[e] << 24 >>> 0),
  36570. t && (this.offset += 4),
  36571. i
  36572. }
  36573. ,
  36574. a.readUInt32 = a.readUint32,
  36575. e && (a.writeInt64 = function(t, i) {
  36576. var n = "undefined" == typeof i;
  36577. if (n && (i = this.offset),
  36578. !this.noAssert) {
  36579. if ("number" == typeof t)
  36580. t = e.fromNumber(t);
  36581. else if ("string" == typeof t)
  36582. t = e.fromString(t);
  36583. else if (!(t && t instanceof e))
  36584. throw TypeError("Illegal value: " + t + " (not an integer or Long)");
  36585. if ("number" != typeof i || i % 1 !== 0)
  36586. throw TypeError("Illegal offset: " + i + " (not an integer)");
  36587. if (i >>>= 0,
  36588. i < 0 || i + 0 > this.buffer.byteLength)
  36589. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  36590. }
  36591. "number" == typeof t ? t = e.fromNumber(t) : "string" == typeof t && (t = e.fromString(t)),
  36592. i += 8;
  36593. var r = this.buffer.byteLength;
  36594. i > r && this.resize((r *= 2) > i ? r : i),
  36595. i -= 8;
  36596. var o = t.low
  36597. , a = t.high;
  36598. return this.littleEndian ? (this.view[i + 3] = o >>> 24 & 255,
  36599. this.view[i + 2] = o >>> 16 & 255,
  36600. this.view[i + 1] = o >>> 8 & 255,
  36601. this.view[i] = 255 & o,
  36602. i += 4,
  36603. this.view[i + 3] = a >>> 24 & 255,
  36604. this.view[i + 2] = a >>> 16 & 255,
  36605. this.view[i + 1] = a >>> 8 & 255,
  36606. this.view[i] = 255 & a) : (this.view[i] = a >>> 24 & 255,
  36607. this.view[i + 1] = a >>> 16 & 255,
  36608. this.view[i + 2] = a >>> 8 & 255,
  36609. this.view[i + 3] = 255 & a,
  36610. i += 4,
  36611. this.view[i] = o >>> 24 & 255,
  36612. this.view[i + 1] = o >>> 16 & 255,
  36613. this.view[i + 2] = o >>> 8 & 255,
  36614. this.view[i + 3] = 255 & o),
  36615. n && (this.offset += 8),
  36616. this
  36617. }
  36618. ,
  36619. a.writeLong = a.writeInt64,
  36620. a.readInt64 = function(t) {
  36621. var i = "undefined" == typeof t;
  36622. if (i && (t = this.offset),
  36623. !this.noAssert) {
  36624. if ("number" != typeof t || t % 1 !== 0)
  36625. throw TypeError("Illegal offset: " + t + " (not an integer)");
  36626. if (t >>>= 0,
  36627. t < 0 || t + 8 > this.buffer.byteLength)
  36628. throw RangeError("Illegal offset: 0 <= " + t + " (+8) <= " + this.buffer.byteLength)
  36629. }
  36630. var n = 0
  36631. , r = 0;
  36632. this.littleEndian ? (n = this.view[t + 2] << 16,
  36633. n |= this.view[t + 1] << 8,
  36634. n |= this.view[t],
  36635. n += this.view[t + 3] << 24 >>> 0,
  36636. t += 4,
  36637. r = this.view[t + 2] << 16,
  36638. r |= this.view[t + 1] << 8,
  36639. r |= this.view[t],
  36640. r += this.view[t + 3] << 24 >>> 0) : (r = this.view[t + 1] << 16,
  36641. r |= this.view[t + 2] << 8,
  36642. r |= this.view[t + 3],
  36643. r += this.view[t] << 24 >>> 0,
  36644. t += 4,
  36645. n = this.view[t + 1] << 16,
  36646. n |= this.view[t + 2] << 8,
  36647. n |= this.view[t + 3],
  36648. n += this.view[t] << 24 >>> 0);
  36649. var o = new e(n,r,!1);
  36650. return i && (this.offset += 8),
  36651. o
  36652. }
  36653. ,
  36654. a.readLong = a.readInt64,
  36655. a.writeUint64 = function(t, i) {
  36656. var n = "undefined" == typeof i;
  36657. if (n && (i = this.offset),
  36658. !this.noAssert) {
  36659. if ("number" == typeof t)
  36660. t = e.fromNumber(t);
  36661. else if ("string" == typeof t)
  36662. t = e.fromString(t);
  36663. else if (!(t && t instanceof e))
  36664. throw TypeError("Illegal value: " + t + " (not an integer or Long)");
  36665. if ("number" != typeof i || i % 1 !== 0)
  36666. throw TypeError("Illegal offset: " + i + " (not an integer)");
  36667. if (i >>>= 0,
  36668. i < 0 || i + 0 > this.buffer.byteLength)
  36669. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  36670. }
  36671. "number" == typeof t ? t = e.fromNumber(t) : "string" == typeof t && (t = e.fromString(t)),
  36672. i += 8;
  36673. var r = this.buffer.byteLength;
  36674. i > r && this.resize((r *= 2) > i ? r : i),
  36675. i -= 8;
  36676. var o = t.low
  36677. , a = t.high;
  36678. return this.littleEndian ? (this.view[i + 3] = o >>> 24 & 255,
  36679. this.view[i + 2] = o >>> 16 & 255,
  36680. this.view[i + 1] = o >>> 8 & 255,
  36681. this.view[i] = 255 & o,
  36682. i += 4,
  36683. this.view[i + 3] = a >>> 24 & 255,
  36684. this.view[i + 2] = a >>> 16 & 255,
  36685. this.view[i + 1] = a >>> 8 & 255,
  36686. this.view[i] = 255 & a) : (this.view[i] = a >>> 24 & 255,
  36687. this.view[i + 1] = a >>> 16 & 255,
  36688. this.view[i + 2] = a >>> 8 & 255,
  36689. this.view[i + 3] = 255 & a,
  36690. i += 4,
  36691. this.view[i] = o >>> 24 & 255,
  36692. this.view[i + 1] = o >>> 16 & 255,
  36693. this.view[i + 2] = o >>> 8 & 255,
  36694. this.view[i + 3] = 255 & o),
  36695. n && (this.offset += 8),
  36696. this
  36697. }
  36698. ,
  36699. a.writeUInt64 = a.writeUint64,
  36700. a.readUint64 = function(t) {
  36701. var i = "undefined" == typeof t;
  36702. if (i && (t = this.offset),
  36703. !this.noAssert) {
  36704. if ("number" != typeof t || t % 1 !== 0)
  36705. throw TypeError("Illegal offset: " + t + " (not an integer)");
  36706. if (t >>>= 0,
  36707. t < 0 || t + 8 > this.buffer.byteLength)
  36708. throw RangeError("Illegal offset: 0 <= " + t + " (+8) <= " + this.buffer.byteLength)
  36709. }
  36710. var n = 0
  36711. , r = 0;
  36712. this.littleEndian ? (n = this.view[t + 2] << 16,
  36713. n |= this.view[t + 1] << 8,
  36714. n |= this.view[t],
  36715. n += this.view[t + 3] << 24 >>> 0,
  36716. t += 4,
  36717. r = this.view[t + 2] << 16,
  36718. r |= this.view[t + 1] << 8,
  36719. r |= this.view[t],
  36720. r += this.view[t + 3] << 24 >>> 0) : (r = this.view[t + 1] << 16,
  36721. r |= this.view[t + 2] << 8,
  36722. r |= this.view[t + 3],
  36723. r += this.view[t] << 24 >>> 0,
  36724. t += 4,
  36725. n = this.view[t + 1] << 16,
  36726. n |= this.view[t + 2] << 8,
  36727. n |= this.view[t + 3],
  36728. n += this.view[t] << 24 >>> 0);
  36729. var o = new e(n,r,!0);
  36730. return i && (this.offset += 8),
  36731. o
  36732. }
  36733. ,
  36734. a.readUInt64 = a.readUint64),
  36735. a.writeFloat32 = function(e, t) {
  36736. var i = "undefined" == typeof t;
  36737. if (i && (t = this.offset),
  36738. !this.noAssert) {
  36739. if ("number" != typeof e)
  36740. throw TypeError("Illegal value: " + e + " (not a number)");
  36741. if ("number" != typeof t || t % 1 !== 0)
  36742. throw TypeError("Illegal offset: " + t + " (not an integer)");
  36743. if (t >>>= 0,
  36744. t < 0 || t + 0 > this.buffer.byteLength)
  36745. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  36746. }
  36747. t += 4;
  36748. var n = this.buffer.byteLength;
  36749. return t > n && this.resize((n *= 2) > t ? n : t),
  36750. t -= 4,
  36751. r(this.view, e, t, this.littleEndian, 23, 4),
  36752. i && (this.offset += 4),
  36753. this
  36754. }
  36755. ,
  36756. a.writeFloat = a.writeFloat32,
  36757. a.readFloat32 = function(e) {
  36758. var t = "undefined" == typeof e;
  36759. if (t && (e = this.offset),
  36760. !this.noAssert) {
  36761. if ("number" != typeof e || e % 1 !== 0)
  36762. throw TypeError("Illegal offset: " + e + " (not an integer)");
  36763. if (e >>>= 0,
  36764. e < 0 || e + 4 > this.buffer.byteLength)
  36765. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  36766. }
  36767. var i = n(this.view, e, this.littleEndian, 23, 4);
  36768. return t && (this.offset += 4),
  36769. i
  36770. }
  36771. ,
  36772. a.readFloat = a.readFloat32,
  36773. a.writeFloat64 = function(e, t) {
  36774. var i = "undefined" == typeof t;
  36775. if (i && (t = this.offset),
  36776. !this.noAssert) {
  36777. if ("number" != typeof e)
  36778. throw TypeError("Illegal value: " + e + " (not a number)");
  36779. if ("number" != typeof t || t % 1 !== 0)
  36780. throw TypeError("Illegal offset: " + t + " (not an integer)");
  36781. if (t >>>= 0,
  36782. t < 0 || t + 0 > this.buffer.byteLength)
  36783. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  36784. }
  36785. t += 8;
  36786. var n = this.buffer.byteLength;
  36787. return t > n && this.resize((n *= 2) > t ? n : t),
  36788. t -= 8,
  36789. r(this.view, e, t, this.littleEndian, 52, 8),
  36790. i && (this.offset += 8),
  36791. this
  36792. }
  36793. ,
  36794. a.writeDouble = a.writeFloat64,
  36795. a.readFloat64 = function(e) {
  36796. var t = "undefined" == typeof e;
  36797. if (t && (e = this.offset),
  36798. !this.noAssert) {
  36799. if ("number" != typeof e || e % 1 !== 0)
  36800. throw TypeError("Illegal offset: " + e + " (not an integer)");
  36801. if (e >>>= 0,
  36802. e < 0 || e + 8 > this.buffer.byteLength)
  36803. throw RangeError("Illegal offset: 0 <= " + e + " (+8) <= " + this.buffer.byteLength)
  36804. }
  36805. var i = n(this.view, e, this.littleEndian, 52, 8);
  36806. return t && (this.offset += 8),
  36807. i
  36808. }
  36809. ,
  36810. a.readDouble = a.readFloat64,
  36811. o.MAX_VARINT32_BYTES = 5,
  36812. o.calculateVarint32 = function(e) {
  36813. return e >>>= 0,
  36814. e < 128 ? 1 : e < 16384 ? 2 : e < 1 << 21 ? 3 : e < 1 << 28 ? 4 : 5
  36815. }
  36816. ,
  36817. o.zigZagEncode32 = function(e) {
  36818. return ((e |= 0) << 1 ^ e >> 31) >>> 0
  36819. }
  36820. ,
  36821. o.zigZagDecode32 = function(e) {
  36822. return e >>> 1 ^ -(1 & e) | 0
  36823. }
  36824. ,
  36825. a.writeVarint32 = function(e, t) {
  36826. var i = "undefined" == typeof t;
  36827. if (i && (t = this.offset),
  36828. !this.noAssert) {
  36829. if ("number" != typeof e || e % 1 !== 0)
  36830. throw TypeError("Illegal value: " + e + " (not an integer)");
  36831. if (e |= 0,
  36832. "number" != typeof t || t % 1 !== 0)
  36833. throw TypeError("Illegal offset: " + t + " (not an integer)");
  36834. if (t >>>= 0,
  36835. t < 0 || t + 0 > this.buffer.byteLength)
  36836. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  36837. }
  36838. var n, r = o.calculateVarint32(e);
  36839. t += r;
  36840. var a = this.buffer.byteLength;
  36841. for (t > a && this.resize((a *= 2) > t ? a : t),
  36842. t -= r,
  36843. e >>>= 0; e >= 128; )
  36844. n = 127 & e | 128,
  36845. this.view[t++] = n,
  36846. e >>>= 7;
  36847. return this.view[t++] = e,
  36848. i ? (this.offset = t,
  36849. this) : r
  36850. }
  36851. ,
  36852. a.writeVarint32ZigZag = function(e, t) {
  36853. return this.writeVarint32(o.zigZagEncode32(e), t)
  36854. }
  36855. ,
  36856. a.readVarint32 = function(e) {
  36857. var t = "undefined" == typeof e;
  36858. if (t && (e = this.offset),
  36859. !this.noAssert) {
  36860. if ("number" != typeof e || e % 1 !== 0)
  36861. throw TypeError("Illegal offset: " + e + " (not an integer)");
  36862. if (e >>>= 0,
  36863. e < 0 || e + 1 > this.buffer.byteLength)
  36864. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  36865. }
  36866. var i, n = 0, r = 0;
  36867. do {
  36868. if (!this.noAssert && e > this.limit) {
  36869. var o = Error("Truncated");
  36870. throw o.truncated = !0,
  36871. o
  36872. }
  36873. i = this.view[e++],
  36874. n < 5 && (r |= (127 & i) << 7 * n),
  36875. ++n
  36876. } while (0 !== (128 & i));return r |= 0,
  36877. t ? (this.offset = e,
  36878. r) : {
  36879. value: r,
  36880. length: n
  36881. }
  36882. }
  36883. ,
  36884. a.readVarint32ZigZag = function(e) {
  36885. var t = this.readVarint32(e);
  36886. return "object" == typeof t ? t.value = o.zigZagDecode32(t.value) : t = o.zigZagDecode32(t),
  36887. t
  36888. }
  36889. ,
  36890. e && (o.MAX_VARINT64_BYTES = 10,
  36891. o.calculateVarint64 = function(t) {
  36892. "number" == typeof t ? t = e.fromNumber(t) : "string" == typeof t && (t = e.fromString(t));
  36893. var i = t.toInt() >>> 0
  36894. , n = t.shiftRightUnsigned(28).toInt() >>> 0
  36895. , r = t.shiftRightUnsigned(56).toInt() >>> 0;
  36896. 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
  36897. }
  36898. ,
  36899. o.zigZagEncode64 = function(t) {
  36900. return "number" == typeof t ? t = e.fromNumber(t, !1) : "string" == typeof t ? t = e.fromString(t, !1) : t.unsigned !== !1 && (t = t.toSigned()),
  36901. t.shiftLeft(1).xor(t.shiftRight(63)).toUnsigned()
  36902. }
  36903. ,
  36904. o.zigZagDecode64 = function(t) {
  36905. return "number" == typeof t ? t = e.fromNumber(t, !1) : "string" == typeof t ? t = e.fromString(t, !1) : t.unsigned !== !1 && (t = t.toSigned()),
  36906. t.shiftRightUnsigned(1).xor(t.and(e.ONE).toSigned().negate()).toSigned()
  36907. }
  36908. ,
  36909. a.writeVarint64 = function(t, i) {
  36910. var n = "undefined" == typeof i;
  36911. if (n && (i = this.offset),
  36912. !this.noAssert) {
  36913. if ("number" == typeof t)
  36914. t = e.fromNumber(t);
  36915. else if ("string" == typeof t)
  36916. t = e.fromString(t);
  36917. else if (!(t && t instanceof e))
  36918. throw TypeError("Illegal value: " + t + " (not an integer or Long)");
  36919. if ("number" != typeof i || i % 1 !== 0)
  36920. throw TypeError("Illegal offset: " + i + " (not an integer)");
  36921. if (i >>>= 0,
  36922. i < 0 || i + 0 > this.buffer.byteLength)
  36923. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  36924. }
  36925. "number" == typeof t ? t = e.fromNumber(t, !1) : "string" == typeof t ? t = e.fromString(t, !1) : t.unsigned !== !1 && (t = t.toSigned());
  36926. var r = o.calculateVarint64(t)
  36927. , a = t.toInt() >>> 0
  36928. , s = t.shiftRightUnsigned(28).toInt() >>> 0
  36929. , l = t.shiftRightUnsigned(56).toInt() >>> 0;
  36930. i += r;
  36931. var c = this.buffer.byteLength;
  36932. switch (i > c && this.resize((c *= 2) > i ? c : i),
  36933. i -= r,
  36934. r) {
  36935. case 10:
  36936. this.view[i + 9] = l >>> 7 & 1;
  36937. case 9:
  36938. this.view[i + 8] = 9 !== r ? 128 | l : 127 & l;
  36939. case 8:
  36940. this.view[i + 7] = 8 !== r ? s >>> 21 | 128 : s >>> 21 & 127;
  36941. case 7:
  36942. this.view[i + 6] = 7 !== r ? s >>> 14 | 128 : s >>> 14 & 127;
  36943. case 6:
  36944. this.view[i + 5] = 6 !== r ? s >>> 7 | 128 : s >>> 7 & 127;
  36945. case 5:
  36946. this.view[i + 4] = 5 !== r ? 128 | s : 127 & s;
  36947. case 4:
  36948. this.view[i + 3] = 4 !== r ? a >>> 21 | 128 : a >>> 21 & 127;
  36949. case 3:
  36950. this.view[i + 2] = 3 !== r ? a >>> 14 | 128 : a >>> 14 & 127;
  36951. case 2:
  36952. this.view[i + 1] = 2 !== r ? a >>> 7 | 128 : a >>> 7 & 127;
  36953. case 1:
  36954. this.view[i] = 1 !== r ? 128 | a : 127 & a
  36955. }
  36956. return n ? (this.offset += r,
  36957. this) : r
  36958. }
  36959. ,
  36960. a.writeVarint64ZigZag = function(e, t) {
  36961. return this.writeVarint64(o.zigZagEncode64(e), t)
  36962. }
  36963. ,
  36964. a.readVarint64 = function(t) {
  36965. var i = "undefined" == typeof t;
  36966. if (i && (t = this.offset),
  36967. !this.noAssert) {
  36968. if ("number" != typeof t || t % 1 !== 0)
  36969. throw TypeError("Illegal offset: " + t + " (not an integer)");
  36970. if (t >>>= 0,
  36971. t < 0 || t + 1 > this.buffer.byteLength)
  36972. throw RangeError("Illegal offset: 0 <= " + t + " (+1) <= " + this.buffer.byteLength)
  36973. }
  36974. var n = t
  36975. , r = 0
  36976. , o = 0
  36977. , a = 0
  36978. , s = 0;
  36979. if (s = this.view[t++],
  36980. r = 127 & s,
  36981. 128 & s && (s = this.view[t++],
  36982. r |= (127 & s) << 7,
  36983. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  36984. r |= (127 & s) << 14,
  36985. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  36986. r |= (127 & s) << 21,
  36987. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  36988. o = 127 & s,
  36989. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  36990. o |= (127 & s) << 7,
  36991. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  36992. o |= (127 & s) << 14,
  36993. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  36994. o |= (127 & s) << 21,
  36995. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  36996. a = 127 & s,
  36997. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  36998. a |= (127 & s) << 7,
  36999. 128 & s || this.noAssert && "undefined" == typeof s))))))))))
  37000. throw Error("Buffer overrun");
  37001. var l = e.fromBits(r | o << 28, o >>> 4 | a << 24, !1);
  37002. return i ? (this.offset = t,
  37003. l) : {
  37004. value: l,
  37005. length: t - n
  37006. }
  37007. }
  37008. ,
  37009. a.readVarint64ZigZag = function(t) {
  37010. var i = this.readVarint64(t);
  37011. return i && i.value instanceof e ? i.value = o.zigZagDecode64(i.value) : i = o.zigZagDecode64(i),
  37012. i
  37013. }
  37014. ),
  37015. a.writeCString = function(e, i) {
  37016. var n = "undefined" == typeof i;
  37017. n && (i = this.offset);
  37018. var r, o = e.length;
  37019. if (!this.noAssert) {
  37020. if ("string" != typeof e)
  37021. throw TypeError("Illegal str: Not a string");
  37022. for (r = 0; r < o; ++r)
  37023. if (0 === e.charCodeAt(r))
  37024. throw RangeError("Illegal str: Contains NULL-characters");
  37025. if ("number" != typeof i || i % 1 !== 0)
  37026. throw TypeError("Illegal offset: " + i + " (not an integer)");
  37027. if (i >>>= 0,
  37028. i < 0 || i + 0 > this.buffer.byteLength)
  37029. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  37030. }
  37031. o = h.calculateUTF16asUTF8(t(e))[1],
  37032. i += o + 1;
  37033. var a = this.buffer.byteLength;
  37034. return i > a && this.resize((a *= 2) > i ? a : i),
  37035. i -= o + 1,
  37036. h.encodeUTF16toUTF8(t(e), function(e) {
  37037. this.view[i++] = e
  37038. }
  37039. .bind(this)),
  37040. this.view[i++] = 0,
  37041. n ? (this.offset = i,
  37042. this) : o
  37043. }
  37044. ,
  37045. a.readCString = function(e) {
  37046. var t = "undefined" == typeof e;
  37047. if (t && (e = this.offset),
  37048. !this.noAssert) {
  37049. if ("number" != typeof e || e % 1 !== 0)
  37050. throw TypeError("Illegal offset: " + e + " (not an integer)");
  37051. if (e >>>= 0,
  37052. e < 0 || e + 1 > this.buffer.byteLength)
  37053. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  37054. }
  37055. var n, r = e, o = -1;
  37056. return h.decodeUTF8toUTF16(function() {
  37057. if (0 === o)
  37058. return null;
  37059. if (e >= this.limit)
  37060. throw RangeError("Illegal range: Truncated data, " + e + " < " + this.limit);
  37061. return o = this.view[e++],
  37062. 0 === o ? null : o
  37063. }
  37064. .bind(this), n = i(), !0),
  37065. t ? (this.offset = e,
  37066. n()) : {
  37067. string: n(),
  37068. length: e - r
  37069. }
  37070. }
  37071. ,
  37072. a.writeIString = function(e, i) {
  37073. var n = "undefined" == typeof i;
  37074. if (n && (i = this.offset),
  37075. !this.noAssert) {
  37076. if ("string" != typeof e)
  37077. throw TypeError("Illegal str: Not a string");
  37078. if ("number" != typeof i || i % 1 !== 0)
  37079. throw TypeError("Illegal offset: " + i + " (not an integer)");
  37080. if (i >>>= 0,
  37081. i < 0 || i + 0 > this.buffer.byteLength)
  37082. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  37083. }
  37084. var r, o = i;
  37085. r = h.calculateUTF16asUTF8(t(e), this.noAssert)[1],
  37086. i += 4 + r;
  37087. var a = this.buffer.byteLength;
  37088. if (i > a && this.resize((a *= 2) > i ? a : i),
  37089. i -= 4 + r,
  37090. this.littleEndian ? (this.view[i + 3] = r >>> 24 & 255,
  37091. this.view[i + 2] = r >>> 16 & 255,
  37092. this.view[i + 1] = r >>> 8 & 255,
  37093. this.view[i] = 255 & r) : (this.view[i] = r >>> 24 & 255,
  37094. this.view[i + 1] = r >>> 16 & 255,
  37095. this.view[i + 2] = r >>> 8 & 255,
  37096. this.view[i + 3] = 255 & r),
  37097. i += 4,
  37098. h.encodeUTF16toUTF8(t(e), function(e) {
  37099. this.view[i++] = e
  37100. }
  37101. .bind(this)),
  37102. i !== o + 4 + r)
  37103. throw RangeError("Illegal range: Truncated data, " + i + " == " + (i + 4 + r));
  37104. return n ? (this.offset = i,
  37105. this) : i - o
  37106. }
  37107. ,
  37108. a.readIString = function(e) {
  37109. var t = "undefined" == typeof e;
  37110. if (t && (e = this.offset),
  37111. !this.noAssert) {
  37112. if ("number" != typeof e || e % 1 !== 0)
  37113. throw TypeError("Illegal offset: " + e + " (not an integer)");
  37114. if (e >>>= 0,
  37115. e < 0 || e + 4 > this.buffer.byteLength)
  37116. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  37117. }
  37118. var i = e
  37119. , n = this.readUint32(e)
  37120. , r = this.readUTF8String(n, o.METRICS_BYTES, e += 4);
  37121. return e += r.length,
  37122. t ? (this.offset = e,
  37123. r.string) : {
  37124. string: r.string,
  37125. length: e - i
  37126. }
  37127. }
  37128. ,
  37129. o.METRICS_CHARS = "c",
  37130. o.METRICS_BYTES = "b",
  37131. a.writeUTF8String = function(e, i) {
  37132. var n = "undefined" == typeof i;
  37133. if (n && (i = this.offset),
  37134. !this.noAssert) {
  37135. if ("number" != typeof i || i % 1 !== 0)
  37136. throw TypeError("Illegal offset: " + i + " (not an integer)");
  37137. if (i >>>= 0,
  37138. i < 0 || i + 0 > this.buffer.byteLength)
  37139. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  37140. }
  37141. var r, o = i;
  37142. r = h.calculateUTF16asUTF8(t(e))[1],
  37143. i += r;
  37144. var a = this.buffer.byteLength;
  37145. return i > a && this.resize((a *= 2) > i ? a : i),
  37146. i -= r,
  37147. h.encodeUTF16toUTF8(t(e), function(e) {
  37148. this.view[i++] = e
  37149. }
  37150. .bind(this)),
  37151. n ? (this.offset = i,
  37152. this) : i - o
  37153. }
  37154. ,
  37155. a.writeString = a.writeUTF8String,
  37156. o.calculateUTF8Chars = function(e) {
  37157. return h.calculateUTF16asUTF8(t(e))[0]
  37158. }
  37159. ,
  37160. o.calculateUTF8Bytes = function(e) {
  37161. return h.calculateUTF16asUTF8(t(e))[1]
  37162. }
  37163. ,
  37164. o.calculateString = o.calculateUTF8Bytes,
  37165. a.readUTF8String = function(e, t, n) {
  37166. "number" == typeof t && (n = t,
  37167. t = void 0);
  37168. var r = "undefined" == typeof n;
  37169. if (r && (n = this.offset),
  37170. "undefined" == typeof t && (t = o.METRICS_CHARS),
  37171. !this.noAssert) {
  37172. if ("number" != typeof e || e % 1 !== 0)
  37173. throw TypeError("Illegal length: " + e + " (not an integer)");
  37174. if (e |= 0,
  37175. "number" != typeof n || n % 1 !== 0)
  37176. throw TypeError("Illegal offset: " + n + " (not an integer)");
  37177. if (n >>>= 0,
  37178. n < 0 || n + 0 > this.buffer.byteLength)
  37179. throw RangeError("Illegal offset: 0 <= " + n + " (+0) <= " + this.buffer.byteLength)
  37180. }
  37181. var a, s = 0, l = n;
  37182. if (t === o.METRICS_CHARS) {
  37183. if (a = i(),
  37184. h.decodeUTF8(function() {
  37185. return s < e && n < this.limit ? this.view[n++] : null
  37186. }
  37187. .bind(this), function(e) {
  37188. ++s,
  37189. h.UTF8toUTF16(e, a)
  37190. }),
  37191. s !== e)
  37192. throw RangeError("Illegal range: Truncated data, " + s + " == " + e);
  37193. return r ? (this.offset = n,
  37194. a()) : {
  37195. string: a(),
  37196. length: n - l
  37197. }
  37198. }
  37199. if (t === o.METRICS_BYTES) {
  37200. if (!this.noAssert) {
  37201. if ("number" != typeof n || n % 1 !== 0)
  37202. throw TypeError("Illegal offset: " + n + " (not an integer)");
  37203. if (n >>>= 0,
  37204. n < 0 || n + e > this.buffer.byteLength)
  37205. throw RangeError("Illegal offset: 0 <= " + n + " (+" + e + ") <= " + this.buffer.byteLength)
  37206. }
  37207. var c = n + e;
  37208. if (h.decodeUTF8toUTF16(function() {
  37209. return n < c ? this.view[n++] : null
  37210. }
  37211. .bind(this), a = i(), this.noAssert),
  37212. n !== c)
  37213. throw RangeError("Illegal range: Truncated data, " + n + " == " + c);
  37214. return r ? (this.offset = n,
  37215. a()) : {
  37216. string: a(),
  37217. length: n - l
  37218. }
  37219. }
  37220. throw TypeError("Unsupported metrics: " + t)
  37221. }
  37222. ,
  37223. a.readString = a.readUTF8String,
  37224. a.writeVString = function(e, i) {
  37225. var n = "undefined" == typeof i;
  37226. if (n && (i = this.offset),
  37227. !this.noAssert) {
  37228. if ("string" != typeof e)
  37229. throw TypeError("Illegal str: Not a string");
  37230. if ("number" != typeof i || i % 1 !== 0)
  37231. throw TypeError("Illegal offset: " + i + " (not an integer)");
  37232. if (i >>>= 0,
  37233. i < 0 || i + 0 > this.buffer.byteLength)
  37234. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  37235. }
  37236. var r, a, s = i;
  37237. r = h.calculateUTF16asUTF8(t(e), this.noAssert)[1],
  37238. a = o.calculateVarint32(r),
  37239. i += a + r;
  37240. var l = this.buffer.byteLength;
  37241. if (i > l && this.resize((l *= 2) > i ? l : i),
  37242. i -= a + r,
  37243. i += this.writeVarint32(r, i),
  37244. h.encodeUTF16toUTF8(t(e), function(e) {
  37245. this.view[i++] = e
  37246. }
  37247. .bind(this)),
  37248. i !== s + r + a)
  37249. throw RangeError("Illegal range: Truncated data, " + i + " == " + (i + r + a));
  37250. return n ? (this.offset = i,
  37251. this) : i - s
  37252. }
  37253. ,
  37254. a.readVString = function(e) {
  37255. var t = "undefined" == typeof e;
  37256. if (t && (e = this.offset),
  37257. !this.noAssert) {
  37258. if ("number" != typeof e || e % 1 !== 0)
  37259. throw TypeError("Illegal offset: " + e + " (not an integer)");
  37260. if (e >>>= 0,
  37261. e < 0 || e + 1 > this.buffer.byteLength)
  37262. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  37263. }
  37264. var i = e
  37265. , n = this.readVarint32(e)
  37266. , r = this.readUTF8String(n.value, o.METRICS_BYTES, e += n.length);
  37267. return e += r.length,
  37268. t ? (this.offset = e,
  37269. r.string) : {
  37270. string: r.string,
  37271. length: e - i
  37272. }
  37273. }
  37274. ,
  37275. a.append = function(e, t, i) {
  37276. "number" != typeof t && "string" == typeof t || (i = t,
  37277. t = void 0);
  37278. var n = "undefined" == typeof i;
  37279. if (n && (i = this.offset),
  37280. !this.noAssert) {
  37281. if ("number" != typeof i || i % 1 !== 0)
  37282. throw TypeError("Illegal offset: " + i + " (not an integer)");
  37283. if (i >>>= 0,
  37284. i < 0 || i + 0 > this.buffer.byteLength)
  37285. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  37286. }
  37287. e instanceof o || (e = o.wrap(e, t));
  37288. var r = e.limit - e.offset;
  37289. if (r <= 0)
  37290. return this;
  37291. i += r;
  37292. var a = this.buffer.byteLength;
  37293. return i > a && this.resize((a *= 2) > i ? a : i),
  37294. i -= r,
  37295. this.view.set(e.view.subarray(e.offset, e.limit), i),
  37296. e.offset += r,
  37297. n && (this.offset += r),
  37298. this
  37299. }
  37300. ,
  37301. a.appendTo = function(e, t) {
  37302. return e.append(this, t),
  37303. this
  37304. }
  37305. ,
  37306. a.assert = function(e) {
  37307. return this.noAssert = !e,
  37308. this
  37309. }
  37310. ,
  37311. a.capacity = function() {
  37312. return this.buffer.byteLength
  37313. }
  37314. ,
  37315. a.clear = function() {
  37316. return this.offset = 0,
  37317. this.limit = this.buffer.byteLength,
  37318. this.markedOffset = -1,
  37319. this
  37320. }
  37321. ,
  37322. a.clone = function(e) {
  37323. var t = new o(0,this.littleEndian,this.noAssert);
  37324. return e ? (t.buffer = new ArrayBuffer(this.buffer.byteLength),
  37325. t.view = new Uint8Array(t.buffer)) : (t.buffer = this.buffer,
  37326. t.view = this.view),
  37327. t.offset = this.offset,
  37328. t.markedOffset = this.markedOffset,
  37329. t.limit = this.limit,
  37330. t
  37331. }
  37332. ,
  37333. a.compact = function(e, t) {
  37334. if ("undefined" == typeof e && (e = this.offset),
  37335. "undefined" == typeof t && (t = this.limit),
  37336. !this.noAssert) {
  37337. if ("number" != typeof e || e % 1 !== 0)
  37338. throw TypeError("Illegal begin: Not an integer");
  37339. if (e >>>= 0,
  37340. "number" != typeof t || t % 1 !== 0)
  37341. throw TypeError("Illegal end: Not an integer");
  37342. if (t >>>= 0,
  37343. e < 0 || e > t || t > this.buffer.byteLength)
  37344. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  37345. }
  37346. if (0 === e && t === this.buffer.byteLength)
  37347. return this;
  37348. var i = t - e;
  37349. if (0 === i)
  37350. return this.buffer = s,
  37351. this.view = null,
  37352. this.markedOffset >= 0 && (this.markedOffset -= e),
  37353. this.offset = 0,
  37354. this.limit = 0,
  37355. this;
  37356. var n = new ArrayBuffer(i)
  37357. , r = new Uint8Array(n);
  37358. return r.set(this.view.subarray(e, t)),
  37359. this.buffer = n,
  37360. this.view = r,
  37361. this.markedOffset >= 0 && (this.markedOffset -= e),
  37362. this.offset = 0,
  37363. this.limit = i,
  37364. this
  37365. }
  37366. ,
  37367. a.copy = function(e, t) {
  37368. if ("undefined" == typeof e && (e = this.offset),
  37369. "undefined" == typeof t && (t = this.limit),
  37370. !this.noAssert) {
  37371. if ("number" != typeof e || e % 1 !== 0)
  37372. throw TypeError("Illegal begin: Not an integer");
  37373. if (e >>>= 0,
  37374. "number" != typeof t || t % 1 !== 0)
  37375. throw TypeError("Illegal end: Not an integer");
  37376. if (t >>>= 0,
  37377. e < 0 || e > t || t > this.buffer.byteLength)
  37378. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  37379. }
  37380. if (e === t)
  37381. return new o(0,this.littleEndian,this.noAssert);
  37382. var i = t - e
  37383. , n = new o(i,this.littleEndian,this.noAssert);
  37384. return n.offset = 0,
  37385. n.limit = i,
  37386. n.markedOffset >= 0 && (n.markedOffset -= e),
  37387. this.copyTo(n, 0, e, t),
  37388. n
  37389. }
  37390. ,
  37391. a.copyTo = function(e, t, i, n) {
  37392. var r, a;
  37393. if (!this.noAssert && !o.isByteBuffer(e))
  37394. throw TypeError("Illegal target: Not a ByteBuffer");
  37395. if (t = (a = "undefined" == typeof t) ? e.offset : 0 | t,
  37396. i = (r = "undefined" == typeof i) ? this.offset : 0 | i,
  37397. n = "undefined" == typeof n ? this.limit : 0 | n,
  37398. t < 0 || t > e.buffer.byteLength)
  37399. throw RangeError("Illegal target range: 0 <= " + t + " <= " + e.buffer.byteLength);
  37400. if (i < 0 || n > this.buffer.byteLength)
  37401. throw RangeError("Illegal source range: 0 <= " + i + " <= " + this.buffer.byteLength);
  37402. var s = n - i;
  37403. return 0 === s ? e : (e.ensureCapacity(t + s),
  37404. e.view.set(this.view.subarray(i, n), t),
  37405. r && (this.offset += s),
  37406. a && (e.offset += s),
  37407. this)
  37408. }
  37409. ,
  37410. a.ensureCapacity = function(e) {
  37411. var t = this.buffer.byteLength;
  37412. return t < e ? this.resize((t *= 2) > e ? t : e) : this
  37413. }
  37414. ,
  37415. a.fill = function(e, t, i) {
  37416. var n = "undefined" == typeof t;
  37417. if (n && (t = this.offset),
  37418. "string" == typeof e && e.length > 0 && (e = e.charCodeAt(0)),
  37419. "undefined" == typeof t && (t = this.offset),
  37420. "undefined" == typeof i && (i = this.limit),
  37421. !this.noAssert) {
  37422. if ("number" != typeof e || e % 1 !== 0)
  37423. throw TypeError("Illegal value: " + e + " (not an integer)");
  37424. if (e |= 0,
  37425. "number" != typeof t || t % 1 !== 0)
  37426. throw TypeError("Illegal begin: Not an integer");
  37427. if (t >>>= 0,
  37428. "number" != typeof i || i % 1 !== 0)
  37429. throw TypeError("Illegal end: Not an integer");
  37430. if (i >>>= 0,
  37431. t < 0 || t > i || i > this.buffer.byteLength)
  37432. throw RangeError("Illegal range: 0 <= " + t + " <= " + i + " <= " + this.buffer.byteLength)
  37433. }
  37434. if (t >= i)
  37435. return this;
  37436. for (; t < i; )
  37437. this.view[t++] = e;
  37438. return n && (this.offset = t),
  37439. this
  37440. }
  37441. ,
  37442. a.flip = function() {
  37443. return this.limit = this.offset,
  37444. this.offset = 0,
  37445. this
  37446. }
  37447. ,
  37448. a.mark = function(e) {
  37449. if (e = "undefined" == typeof e ? this.offset : e,
  37450. !this.noAssert) {
  37451. if ("number" != typeof e || e % 1 !== 0)
  37452. throw TypeError("Illegal offset: " + e + " (not an integer)");
  37453. if (e >>>= 0,
  37454. e < 0 || e + 0 > this.buffer.byteLength)
  37455. throw RangeError("Illegal offset: 0 <= " + e + " (+0) <= " + this.buffer.byteLength)
  37456. }
  37457. return this.markedOffset = e,
  37458. this
  37459. }
  37460. ,
  37461. a.order = function(e) {
  37462. if (!this.noAssert && "boolean" != typeof e)
  37463. throw TypeError("Illegal littleEndian: Not a boolean");
  37464. return this.littleEndian = !!e,
  37465. this
  37466. }
  37467. ,
  37468. a.LE = function(e) {
  37469. return this.littleEndian = "undefined" == typeof e || !!e,
  37470. this
  37471. }
  37472. ,
  37473. a.BE = function(e) {
  37474. return this.littleEndian = "undefined" != typeof e && !e,
  37475. this
  37476. }
  37477. ,
  37478. a.prepend = function(e, t, i) {
  37479. "number" != typeof t && "string" == typeof t || (i = t,
  37480. t = void 0);
  37481. var n = "undefined" == typeof i;
  37482. if (n && (i = this.offset),
  37483. !this.noAssert) {
  37484. if ("number" != typeof i || i % 1 !== 0)
  37485. throw TypeError("Illegal offset: " + i + " (not an integer)");
  37486. if (i >>>= 0,
  37487. i < 0 || i + 0 > this.buffer.byteLength)
  37488. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  37489. }
  37490. e instanceof o || (e = o.wrap(e, t));
  37491. var r = e.limit - e.offset;
  37492. if (r <= 0)
  37493. return this;
  37494. var a = r - i;
  37495. if (a > 0) {
  37496. var s = new ArrayBuffer(this.buffer.byteLength + a)
  37497. , l = new Uint8Array(s);
  37498. l.set(this.view.subarray(i, this.buffer.byteLength), r),
  37499. this.buffer = s,
  37500. this.view = l,
  37501. this.offset += a,
  37502. this.markedOffset >= 0 && (this.markedOffset += a),
  37503. this.limit += a,
  37504. i += a
  37505. } else {
  37506. new Uint8Array(this.buffer)
  37507. }
  37508. return this.view.set(e.view.subarray(e.offset, e.limit), i - r),
  37509. e.offset = e.limit,
  37510. n && (this.offset -= r),
  37511. this
  37512. }
  37513. ,
  37514. a.prependTo = function(e, t) {
  37515. return e.prepend(this, t),
  37516. this
  37517. }
  37518. ,
  37519. a.printDebug = function(e) {
  37520. "function" != typeof e && (e = console.log.bind(console)),
  37521. e(this.toString() + "\n-------------------------------------------------------------------\n" + this.toDebug(!0))
  37522. }
  37523. ,
  37524. a.remaining = function() {
  37525. return this.limit - this.offset
  37526. }
  37527. ,
  37528. a.reset = function() {
  37529. return this.markedOffset >= 0 ? (this.offset = this.markedOffset,
  37530. this.markedOffset = -1) : this.offset = 0,
  37531. this
  37532. }
  37533. ,
  37534. a.resize = function(e) {
  37535. if (!this.noAssert) {
  37536. if ("number" != typeof e || e % 1 !== 0)
  37537. throw TypeError("Illegal capacity: " + e + " (not an integer)");
  37538. if (e |= 0,
  37539. e < 0)
  37540. throw RangeError("Illegal capacity: 0 <= " + e)
  37541. }
  37542. if (this.buffer.byteLength < e) {
  37543. var t = new ArrayBuffer(e)
  37544. , i = new Uint8Array(t);
  37545. i.set(this.view),
  37546. this.buffer = t,
  37547. this.view = i
  37548. }
  37549. return this
  37550. }
  37551. ,
  37552. a.reverse = function(e, t) {
  37553. if ("undefined" == typeof e && (e = this.offset),
  37554. "undefined" == typeof t && (t = this.limit),
  37555. !this.noAssert) {
  37556. if ("number" != typeof e || e % 1 !== 0)
  37557. throw TypeError("Illegal begin: Not an integer");
  37558. if (e >>>= 0,
  37559. "number" != typeof t || t % 1 !== 0)
  37560. throw TypeError("Illegal end: Not an integer");
  37561. if (t >>>= 0,
  37562. e < 0 || e > t || t > this.buffer.byteLength)
  37563. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  37564. }
  37565. return e === t ? this : (Array.prototype.reverse.call(this.view.subarray(e, t)),
  37566. this)
  37567. }
  37568. ,
  37569. a.skip = function(e) {
  37570. if (!this.noAssert) {
  37571. if ("number" != typeof e || e % 1 !== 0)
  37572. throw TypeError("Illegal length: " + e + " (not an integer)");
  37573. e |= 0
  37574. }
  37575. var t = this.offset + e;
  37576. if (!this.noAssert && (t < 0 || t > this.buffer.byteLength))
  37577. throw RangeError("Illegal length: 0 <= " + this.offset + " + " + e + " <= " + this.buffer.byteLength);
  37578. return this.offset = t,
  37579. this
  37580. }
  37581. ,
  37582. a.slice = function(e, t) {
  37583. if ("undefined" == typeof e && (e = this.offset),
  37584. "undefined" == typeof t && (t = this.limit),
  37585. !this.noAssert) {
  37586. if ("number" != typeof e || e % 1 !== 0)
  37587. throw TypeError("Illegal begin: Not an integer");
  37588. if (e >>>= 0,
  37589. "number" != typeof t || t % 1 !== 0)
  37590. throw TypeError("Illegal end: Not an integer");
  37591. if (t >>>= 0,
  37592. e < 0 || e > t || t > this.buffer.byteLength)
  37593. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  37594. }
  37595. var i = this.clone();
  37596. return i.offset = e,
  37597. i.limit = t,
  37598. i
  37599. }
  37600. ,
  37601. a.toBuffer = function(e) {
  37602. var t = this.offset
  37603. , i = this.limit;
  37604. if (!this.noAssert) {
  37605. if ("number" != typeof t || t % 1 !== 0)
  37606. throw TypeError("Illegal offset: Not an integer");
  37607. if (t >>>= 0,
  37608. "number" != typeof i || i % 1 !== 0)
  37609. throw TypeError("Illegal limit: Not an integer");
  37610. if (i >>>= 0,
  37611. t < 0 || t > i || i > this.buffer.byteLength)
  37612. throw RangeError("Illegal range: 0 <= " + t + " <= " + i + " <= " + this.buffer.byteLength)
  37613. }
  37614. if (!e && 0 === t && i === this.buffer.byteLength)
  37615. return this.buffer;
  37616. if (t === i)
  37617. return s;
  37618. var n = new ArrayBuffer(i - t);
  37619. return new Uint8Array(n).set(new Uint8Array(this.buffer).subarray(t, i), 0),
  37620. n
  37621. }
  37622. ,
  37623. a.toArrayBuffer = a.toBuffer,
  37624. a.toString = function(e, t, i) {
  37625. if ("undefined" == typeof e)
  37626. return "ByteBufferAB(offset=" + this.offset + ",markedOffset=" + this.markedOffset + ",limit=" + this.limit + ",capacity=" + this.capacity() + ")";
  37627. switch ("number" == typeof e && (e = "utf8",
  37628. t = e,
  37629. i = t),
  37630. e) {
  37631. case "utf8":
  37632. return this.toUTF8(t, i);
  37633. case "base64":
  37634. return this.toBase64(t, i);
  37635. case "hex":
  37636. return this.toHex(t, i);
  37637. case "binary":
  37638. return this.toBinary(t, i);
  37639. case "debug":
  37640. return this.toDebug();
  37641. case "columns":
  37642. return this.toColumns();
  37643. default:
  37644. throw Error("Unsupported encoding: " + e)
  37645. }
  37646. }
  37647. ;
  37648. var c = function() {
  37649. 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)
  37650. i[t[n]] = n;
  37651. return e.encode = function(e, i) {
  37652. for (var n, r; null !== (n = e()); )
  37653. i(t[n >> 2 & 63]),
  37654. r = (3 & n) << 4,
  37655. null !== (n = e()) ? (r |= n >> 4 & 15,
  37656. i(t[63 & (r | n >> 4 & 15)]),
  37657. r = (15 & n) << 2,
  37658. null !== (n = e()) ? (i(t[63 & (r | n >> 6 & 3)]),
  37659. i(t[63 & n])) : (i(t[63 & r]),
  37660. i(61))) : (i(t[63 & r]),
  37661. i(61),
  37662. i(61))
  37663. }
  37664. ,
  37665. e.decode = function(e, t) {
  37666. function n(e) {
  37667. throw Error("Illegal character code: " + e)
  37668. }
  37669. for (var r, o, a; null !== (r = e()); )
  37670. if (o = i[r],
  37671. "undefined" == typeof o && n(r),
  37672. null !== (r = e()) && (a = i[r],
  37673. "undefined" == typeof a && n(r),
  37674. t(o << 2 >>> 0 | (48 & a) >> 4),
  37675. null !== (r = e()))) {
  37676. if (o = i[r],
  37677. "undefined" == typeof o) {
  37678. if (61 === r)
  37679. break;
  37680. n(r)
  37681. }
  37682. if (t((15 & a) << 4 >>> 0 | (60 & o) >> 2),
  37683. null !== (r = e())) {
  37684. if (a = i[r],
  37685. "undefined" == typeof a) {
  37686. if (61 === r)
  37687. break;
  37688. n(r)
  37689. }
  37690. t((3 & o) << 6 >>> 0 | a)
  37691. }
  37692. }
  37693. }
  37694. ,
  37695. e.test = function(e) {
  37696. return /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.test(e)
  37697. }
  37698. ,
  37699. e
  37700. }();
  37701. a.toBase64 = function(e, t) {
  37702. if ("undefined" == typeof e && (e = this.offset),
  37703. "undefined" == typeof t && (t = this.limit),
  37704. e |= 0,
  37705. t |= 0,
  37706. e < 0 || t > this.capacity || e > t)
  37707. throw RangeError("begin, end");
  37708. var n;
  37709. return c.encode(function() {
  37710. return e < t ? this.view[e++] : null
  37711. }
  37712. .bind(this), n = i()),
  37713. n()
  37714. }
  37715. ,
  37716. o.fromBase64 = function(e, i) {
  37717. if ("string" != typeof e)
  37718. throw TypeError("str");
  37719. var n = new o(e.length / 4 * 3,i)
  37720. , r = 0;
  37721. return c.decode(t(e), function(e) {
  37722. n.view[r++] = e
  37723. }),
  37724. n.limit = r,
  37725. n
  37726. }
  37727. ,
  37728. o.btoa = function(e) {
  37729. return o.fromBinary(e).toBase64()
  37730. }
  37731. ,
  37732. o.atob = function(e) {
  37733. return o.fromBase64(e).toBinary()
  37734. }
  37735. ,
  37736. a.toBinary = function(e, t) {
  37737. if ("undefined" == typeof e && (e = this.offset),
  37738. "undefined" == typeof t && (t = this.limit),
  37739. e |= 0,
  37740. t |= 0,
  37741. e < 0 || t > this.capacity() || e > t)
  37742. throw RangeError("begin, end");
  37743. if (e === t)
  37744. return "";
  37745. for (var i = [], n = []; e < t; )
  37746. i.push(this.view[e++]),
  37747. i.length >= 1024 && (n.push(String.fromCharCode.apply(String, i)),
  37748. i = []);
  37749. return n.join("") + String.fromCharCode.apply(String, i)
  37750. }
  37751. ,
  37752. o.fromBinary = function(e, t) {
  37753. if ("string" != typeof e)
  37754. throw TypeError("str");
  37755. for (var i, n = 0, r = e.length, a = new o(r,t); n < r; ) {
  37756. if (i = e.charCodeAt(n),
  37757. i > 255)
  37758. throw RangeError("illegal char code: " + i);
  37759. a.view[n++] = i
  37760. }
  37761. return a.limit = r,
  37762. a
  37763. }
  37764. ,
  37765. a.toDebug = function(e) {
  37766. for (var t, i = -1, n = this.buffer.byteLength, r = "", o = "", a = ""; i < n; ) {
  37767. if (i !== -1 && (t = this.view[i],
  37768. r += t < 16 ? "0" + t.toString(16).toUpperCase() : t.toString(16).toUpperCase(),
  37769. e && (o += t > 32 && t < 127 ? String.fromCharCode(t) : ".")),
  37770. ++i,
  37771. e && i > 0 && i % 16 === 0 && i !== n) {
  37772. for (; r.length < 51; )
  37773. r += " ";
  37774. a += r + o + "\n",
  37775. r = o = ""
  37776. }
  37777. 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 ? " " : ""
  37778. }
  37779. if (e && " " !== r) {
  37780. for (; r.length < 51; )
  37781. r += " ";
  37782. a += r + o + "\n"
  37783. }
  37784. return e ? a : r
  37785. }
  37786. ,
  37787. o.fromDebug = function(e, t, i) {
  37788. 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; ) {
  37789. switch (n = e.charAt(l++)) {
  37790. case "!":
  37791. if (!i) {
  37792. if (u || d || p) {
  37793. f = !0;
  37794. break
  37795. }
  37796. u = d = p = !0
  37797. }
  37798. s.offset = s.markedOffset = s.limit = c,
  37799. h = !1;
  37800. break;
  37801. case "|":
  37802. if (!i) {
  37803. if (u || p) {
  37804. f = !0;
  37805. break
  37806. }
  37807. u = p = !0
  37808. }
  37809. s.offset = s.limit = c,
  37810. h = !1;
  37811. break;
  37812. case "[":
  37813. if (!i) {
  37814. if (u || d) {
  37815. f = !0;
  37816. break
  37817. }
  37818. u = d = !0
  37819. }
  37820. s.offset = s.markedOffset = c,
  37821. h = !1;
  37822. break;
  37823. case "<":
  37824. if (!i) {
  37825. if (u) {
  37826. f = !0;
  37827. break
  37828. }
  37829. u = !0
  37830. }
  37831. s.offset = c,
  37832. h = !1;
  37833. break;
  37834. case "]":
  37835. if (!i) {
  37836. if (p || d) {
  37837. f = !0;
  37838. break
  37839. }
  37840. p = d = !0
  37841. }
  37842. s.limit = s.markedOffset = c,
  37843. h = !1;
  37844. break;
  37845. case ">":
  37846. if (!i) {
  37847. if (p) {
  37848. f = !0;
  37849. break
  37850. }
  37851. p = !0
  37852. }
  37853. s.limit = c,
  37854. h = !1;
  37855. break;
  37856. case "'":
  37857. if (!i) {
  37858. if (d) {
  37859. f = !0;
  37860. break
  37861. }
  37862. d = !0
  37863. }
  37864. s.markedOffset = c,
  37865. h = !1;
  37866. break;
  37867. case " ":
  37868. h = !1;
  37869. break;
  37870. default:
  37871. if (!i && h) {
  37872. f = !0;
  37873. break
  37874. }
  37875. if (r = parseInt(n + e.charAt(l++), 16),
  37876. !i && (isNaN(r) || r < 0 || r > 255))
  37877. throw TypeError("Illegal str: Not a debug encoded string");
  37878. s.view[c++] = r,
  37879. h = !0
  37880. }
  37881. if (f)
  37882. throw TypeError("Illegal str: Invalid symbol at " + l)
  37883. }
  37884. if (!i) {
  37885. if (!u || !p)
  37886. throw TypeError("Illegal str: Missing offset or limit");
  37887. if (c < s.buffer.byteLength)
  37888. throw TypeError("Illegal str: Not a debug encoded string (is it hex?) " + c + " < " + a)
  37889. }
  37890. return s
  37891. }
  37892. ,
  37893. a.toHex = function(e, t) {
  37894. if (e = "undefined" == typeof e ? this.offset : e,
  37895. t = "undefined" == typeof t ? this.limit : t,
  37896. !this.noAssert) {
  37897. if ("number" != typeof e || e % 1 !== 0)
  37898. throw TypeError("Illegal begin: Not an integer");
  37899. if (e >>>= 0,
  37900. "number" != typeof t || t % 1 !== 0)
  37901. throw TypeError("Illegal end: Not an integer");
  37902. if (t >>>= 0,
  37903. e < 0 || e > t || t > this.buffer.byteLength)
  37904. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  37905. }
  37906. for (var i, n = new Array(t - e); e < t; )
  37907. i = this.view[e++],
  37908. i < 16 ? n.push("0", i.toString(16)) : n.push(i.toString(16));
  37909. return n.join("")
  37910. }
  37911. ,
  37912. o.fromHex = function(e, t, i) {
  37913. if (!i) {
  37914. if ("string" != typeof e)
  37915. throw TypeError("Illegal str: Not a string");
  37916. if (e.length % 2 !== 0)
  37917. throw TypeError("Illegal str: Length not a multiple of 2")
  37918. }
  37919. for (var n, r = e.length, a = new o(r / 2 | 0,t), s = 0, l = 0; s < r; s += 2) {
  37920. if (n = parseInt(e.substring(s, s + 2), 16),
  37921. !i && (!isFinite(n) || n < 0 || n > 255))
  37922. throw TypeError("Illegal str: Contains non-hex characters");
  37923. a.view[l++] = n
  37924. }
  37925. return a.limit = l,
  37926. a
  37927. }
  37928. ;
  37929. var h = function() {
  37930. var e = {};
  37931. return e.MAX_CODEPOINT = 1114111,
  37932. e.encodeUTF8 = function(e, t) {
  37933. var i = null;
  37934. for ("number" == typeof e && (i = e,
  37935. e = function() {
  37936. return null
  37937. }
  37938. ); null !== i || null !== (i = e()); )
  37939. i < 128 ? t(127 & i) : i < 2048 ? (t(i >> 6 & 31 | 192),
  37940. t(63 & i | 128)) : i < 65536 ? (t(i >> 12 & 15 | 224),
  37941. t(i >> 6 & 63 | 128),
  37942. t(63 & i | 128)) : (t(i >> 18 & 7 | 240),
  37943. t(i >> 12 & 63 | 128),
  37944. t(i >> 6 & 63 | 128),
  37945. t(63 & i | 128)),
  37946. i = null
  37947. }
  37948. ,
  37949. e.decodeUTF8 = function(e, t) {
  37950. for (var i, n, r, o, a = function(e) {
  37951. e = e.slice(0, e.indexOf(null));
  37952. var t = Error(e.toString());
  37953. throw t.name = "TruncatedError",
  37954. t.bytes = e,
  37955. t
  37956. }; null !== (i = e()); )
  37957. if (0 === (128 & i))
  37958. t(i);
  37959. else if (192 === (224 & i))
  37960. null === (n = e()) && a([i, n]),
  37961. t((31 & i) << 6 | 63 & n);
  37962. else if (224 === (240 & i))
  37963. (null === (n = e()) || null === (r = e())) && a([i, n, r]),
  37964. t((15 & i) << 12 | (63 & n) << 6 | 63 & r);
  37965. else {
  37966. if (240 !== (248 & i))
  37967. throw RangeError("Illegal starting byte: " + i);
  37968. (null === (n = e()) || null === (r = e()) || null === (o = e())) && a([i, n, r, o]),
  37969. t((7 & i) << 18 | (63 & n) << 12 | (63 & r) << 6 | 63 & o)
  37970. }
  37971. }
  37972. ,
  37973. e.UTF16toUTF8 = function(e, t) {
  37974. for (var i, n = null; ; ) {
  37975. if (null === (i = null !== n ? n : e()))
  37976. break;
  37977. i >= 55296 && i <= 57343 && null !== (n = e()) && n >= 56320 && n <= 57343 ? (t(1024 * (i - 55296) + n - 56320 + 65536),
  37978. n = null) : t(i)
  37979. }
  37980. null !== n && t(n)
  37981. }
  37982. ,
  37983. e.UTF8toUTF16 = function(e, t) {
  37984. var i = null;
  37985. for ("number" == typeof e && (i = e,
  37986. e = function() {
  37987. return null
  37988. }
  37989. ); null !== i || null !== (i = e()); )
  37990. i <= 65535 ? t(i) : (i -= 65536,
  37991. t((i >> 10) + 55296),
  37992. t(i % 1024 + 56320)),
  37993. i = null
  37994. }
  37995. ,
  37996. e.encodeUTF16toUTF8 = function(t, i) {
  37997. e.UTF16toUTF8(t, function(t) {
  37998. e.encodeUTF8(t, i)
  37999. })
  38000. }
  38001. ,
  38002. e.decodeUTF8toUTF16 = function(t, i) {
  38003. e.decodeUTF8(t, function(t) {
  38004. e.UTF8toUTF16(t, i)
  38005. })
  38006. }
  38007. ,
  38008. e.calculateCodePoint = function(e) {
  38009. return e < 128 ? 1 : e < 2048 ? 2 : e < 65536 ? 3 : 4
  38010. }
  38011. ,
  38012. e.calculateUTF8 = function(e) {
  38013. for (var t, i = 0; null !== (t = e()); )
  38014. i += t < 128 ? 1 : t < 2048 ? 2 : t < 65536 ? 3 : 4;
  38015. return i
  38016. }
  38017. ,
  38018. e.calculateUTF16asUTF8 = function(t) {
  38019. var i = 0
  38020. , n = 0;
  38021. return e.UTF16toUTF8(t, function(e) {
  38022. ++i,
  38023. n += e < 128 ? 1 : e < 2048 ? 2 : e < 65536 ? 3 : 4
  38024. }),
  38025. [i, n]
  38026. }
  38027. ,
  38028. e
  38029. }();
  38030. return a.toUTF8 = function(e, t) {
  38031. if ("undefined" == typeof e && (e = this.offset),
  38032. "undefined" == typeof t && (t = this.limit),
  38033. !this.noAssert) {
  38034. if ("number" != typeof e || e % 1 !== 0)
  38035. throw TypeError("Illegal begin: Not an integer");
  38036. if (e >>>= 0,
  38037. "number" != typeof t || t % 1 !== 0)
  38038. throw TypeError("Illegal end: Not an integer");
  38039. if (t >>>= 0,
  38040. e < 0 || e > t || t > this.buffer.byteLength)
  38041. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  38042. }
  38043. var n;
  38044. try {
  38045. h.decodeUTF8toUTF16(function() {
  38046. return e < t ? this.view[e++] : null
  38047. }
  38048. .bind(this), n = i())
  38049. } catch (i) {
  38050. if (e !== t)
  38051. throw RangeError("Illegal range: Truncated data, " + e + " != " + t)
  38052. }
  38053. return n()
  38054. }
  38055. ,
  38056. o.fromUTF8 = function(e, i, n) {
  38057. if (!n && "string" != typeof e)
  38058. throw TypeError("Illegal str: Not a string");
  38059. var r = new o(h.calculateUTF16asUTF8(t(e), !0)[1],i,n)
  38060. , a = 0;
  38061. return h.encodeUTF16toUTF8(t(e), function(e) {
  38062. r.view[a++] = e
  38063. }),
  38064. r.limit = a,
  38065. r
  38066. }
  38067. ,
  38068. o
  38069. })
  38070. }
  38071. , {
  38072. long: 216
  38073. }],
  38074. 216: [function(e, t, i) {
  38075. !function(i, n) {
  38076. "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()
  38077. }(this, function() {
  38078. "use strict";
  38079. function e(e, t, i) {
  38080. this.low = 0 | e,
  38081. this.high = 0 | t,
  38082. this.unsigned = !!i
  38083. }
  38084. function t(e) {
  38085. return (e && e.__isLong__) === !0
  38086. }
  38087. function i(e, t) {
  38088. var i, n, o;
  38089. return t ? (e >>>= 0,
  38090. (o = 0 <= e && e < 256) && (n = l[e]) ? n : (i = r(e, (0 | e) < 0 ? -1 : 0, !0),
  38091. o && (l[e] = i),
  38092. i)) : (e |= 0,
  38093. (o = -128 <= e && e < 128) && (n = s[e]) ? n : (i = r(e, e < 0 ? -1 : 0, !1),
  38094. o && (s[e] = i),
  38095. i))
  38096. }
  38097. function n(e, t) {
  38098. if (isNaN(e) || !isFinite(e))
  38099. return t ? m : g;
  38100. if (t) {
  38101. if (e < 0)
  38102. return m;
  38103. if (e >= d)
  38104. return I
  38105. } else {
  38106. if (e <= -p)
  38107. return E;
  38108. if (e + 1 >= p)
  38109. return C
  38110. }
  38111. return e < 0 ? n(-e, t).neg() : r(e % u | 0, e / u | 0, t)
  38112. }
  38113. function r(t, i, n) {
  38114. return new e(t,i,n)
  38115. }
  38116. function o(e, t, i) {
  38117. if (0 === e.length)
  38118. throw Error("empty string");
  38119. if ("NaN" === e || "Infinity" === e || "+Infinity" === e || "-Infinity" === e)
  38120. return g;
  38121. if ("number" == typeof t ? (i = t,
  38122. t = !1) : t = !!t,
  38123. i = i || 10,
  38124. i < 2 || 36 < i)
  38125. throw RangeError("radix");
  38126. var r;
  38127. if ((r = e.indexOf("-")) > 0)
  38128. throw Error("interior hyphen");
  38129. if (0 === r)
  38130. return o(e.substring(1), t, i).neg();
  38131. for (var a = n(c(i, 8)), s = g, l = 0; l < e.length; l += 8) {
  38132. var h = Math.min(8, e.length - l)
  38133. , u = parseInt(e.substring(l, l + h), i);
  38134. if (h < 8) {
  38135. var d = n(c(i, h));
  38136. s = s.mul(d).add(n(u))
  38137. } else
  38138. s = s.mul(a),
  38139. s = s.add(n(u))
  38140. }
  38141. return s.unsigned = t,
  38142. s
  38143. }
  38144. function a(t) {
  38145. return t instanceof e ? t : "number" == typeof t ? n(t) : "string" == typeof t ? o(t) : r(t.low, t.high, t.unsigned)
  38146. }
  38147. e.prototype.__isLong__,
  38148. Object.defineProperty(e.prototype, "__isLong__", {
  38149. value: !0,
  38150. enumerable: !1,
  38151. configurable: !1
  38152. }),
  38153. e.isLong = t;
  38154. var s = {}
  38155. , l = {};
  38156. e.fromInt = i,
  38157. e.fromNumber = n,
  38158. e.fromBits = r;
  38159. var c = Math.pow;
  38160. e.fromString = o,
  38161. e.fromValue = a;
  38162. var h = 1 << 24
  38163. , u = 4294967296
  38164. , d = 0x10000000000000000
  38165. , p = d / 2
  38166. , f = i(h)
  38167. , g = i(0);
  38168. e.ZERO = g;
  38169. var m = i(0, !0);
  38170. e.UZERO = m;
  38171. var v = i(1);
  38172. e.ONE = v;
  38173. var A = i(1, !0);
  38174. e.UONE = A;
  38175. var y = i(-1);
  38176. e.NEG_ONE = y;
  38177. var C = r(-1, 2147483647, !1);
  38178. e.MAX_VALUE = C;
  38179. var I = r(-1, -1, !0);
  38180. e.MAX_UNSIGNED_VALUE = I;
  38181. var E = r(0, -2147483648, !1);
  38182. e.MIN_VALUE = E;
  38183. var b = e.prototype;
  38184. return b.toInt = function() {
  38185. return this.unsigned ? this.low >>> 0 : this.low
  38186. }
  38187. ,
  38188. b.toNumber = function() {
  38189. return this.unsigned ? (this.high >>> 0) * u + (this.low >>> 0) : this.high * u + (this.low >>> 0)
  38190. }
  38191. ,
  38192. b.toString = function(e) {
  38193. if (e = e || 10,
  38194. e < 2 || 36 < e)
  38195. throw RangeError("radix");
  38196. if (this.isZero())
  38197. return "0";
  38198. if (this.isNegative()) {
  38199. if (this.eq(E)) {
  38200. var t = n(e)
  38201. , i = this.div(t)
  38202. , r = i.mul(t).sub(this);
  38203. return i.toString(e) + r.toInt().toString(e)
  38204. }
  38205. return "-" + this.neg().toString(e)
  38206. }
  38207. for (var o = n(c(e, 6), this.unsigned), a = this, s = ""; ; ) {
  38208. var l = a.div(o)
  38209. , h = a.sub(l.mul(o)).toInt() >>> 0
  38210. , u = h.toString(e);
  38211. if (a = l,
  38212. a.isZero())
  38213. return u + s;
  38214. for (; u.length < 6; )
  38215. u = "0" + u;
  38216. s = "" + u + s
  38217. }
  38218. }
  38219. ,
  38220. b.getHighBits = function() {
  38221. return this.high
  38222. }
  38223. ,
  38224. b.getHighBitsUnsigned = function() {
  38225. return this.high >>> 0
  38226. }
  38227. ,
  38228. b.getLowBits = function() {
  38229. return this.low
  38230. }
  38231. ,
  38232. b.getLowBitsUnsigned = function() {
  38233. return this.low >>> 0
  38234. }
  38235. ,
  38236. b.getNumBitsAbs = function() {
  38237. if (this.isNegative())
  38238. return this.eq(E) ? 64 : this.neg().getNumBitsAbs();
  38239. for (var e = 0 != this.high ? this.high : this.low, t = 31; t > 0 && 0 == (e & 1 << t); t--)
  38240. ;
  38241. return 0 != this.high ? t + 33 : t + 1
  38242. }
  38243. ,
  38244. b.isZero = function() {
  38245. return 0 === this.high && 0 === this.low
  38246. }
  38247. ,
  38248. b.isNegative = function() {
  38249. return !this.unsigned && this.high < 0
  38250. }
  38251. ,
  38252. b.isPositive = function() {
  38253. return this.unsigned || this.high >= 0
  38254. }
  38255. ,
  38256. b.isOdd = function() {
  38257. return 1 === (1 & this.low)
  38258. }
  38259. ,
  38260. b.isEven = function() {
  38261. return 0 === (1 & this.low)
  38262. }
  38263. ,
  38264. b.equals = function(e) {
  38265. return t(e) || (e = a(e)),
  38266. (this.unsigned === e.unsigned || this.high >>> 31 !== 1 || e.high >>> 31 !== 1) && (this.high === e.high && this.low === e.low)
  38267. }
  38268. ,
  38269. b.eq = b.equals,
  38270. b.notEquals = function(e) {
  38271. return !this.eq(e)
  38272. }
  38273. ,
  38274. b.neq = b.notEquals,
  38275. b.lessThan = function(e) {
  38276. return this.comp(e) < 0
  38277. }
  38278. ,
  38279. b.lt = b.lessThan,
  38280. b.lessThanOrEqual = function(e) {
  38281. return this.comp(e) <= 0
  38282. }
  38283. ,
  38284. b.lte = b.lessThanOrEqual,
  38285. b.greaterThan = function(e) {
  38286. return this.comp(e) > 0
  38287. }
  38288. ,
  38289. b.gt = b.greaterThan,
  38290. b.greaterThanOrEqual = function(e) {
  38291. return this.comp(e) >= 0
  38292. }
  38293. ,
  38294. b.gte = b.greaterThanOrEqual,
  38295. b.compare = function(e) {
  38296. if (t(e) || (e = a(e)),
  38297. this.eq(e))
  38298. return 0;
  38299. var i = this.isNegative()
  38300. , n = e.isNegative();
  38301. 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
  38302. }
  38303. ,
  38304. b.comp = b.compare,
  38305. b.negate = function() {
  38306. return !this.unsigned && this.eq(E) ? E : this.not().add(v)
  38307. }
  38308. ,
  38309. b.neg = b.negate,
  38310. b.add = function(e) {
  38311. t(e) || (e = a(e));
  38312. var i = this.high >>> 16
  38313. , n = 65535 & this.high
  38314. , o = this.low >>> 16
  38315. , s = 65535 & this.low
  38316. , l = e.high >>> 16
  38317. , c = 65535 & e.high
  38318. , h = e.low >>> 16
  38319. , u = 65535 & e.low
  38320. , d = 0
  38321. , p = 0
  38322. , f = 0
  38323. , g = 0;
  38324. return g += s + u,
  38325. f += g >>> 16,
  38326. g &= 65535,
  38327. f += o + h,
  38328. p += f >>> 16,
  38329. f &= 65535,
  38330. p += n + c,
  38331. d += p >>> 16,
  38332. p &= 65535,
  38333. d += i + l,
  38334. d &= 65535,
  38335. r(f << 16 | g, d << 16 | p, this.unsigned)
  38336. }
  38337. ,
  38338. b.subtract = function(e) {
  38339. return t(e) || (e = a(e)),
  38340. this.add(e.neg())
  38341. }
  38342. ,
  38343. b.sub = b.subtract,
  38344. b.multiply = function(e) {
  38345. if (this.isZero())
  38346. return g;
  38347. if (t(e) || (e = a(e)),
  38348. e.isZero())
  38349. return g;
  38350. if (this.eq(E))
  38351. return e.isOdd() ? E : g;
  38352. if (e.eq(E))
  38353. return this.isOdd() ? E : g;
  38354. if (this.isNegative())
  38355. return e.isNegative() ? this.neg().mul(e.neg()) : this.neg().mul(e).neg();
  38356. if (e.isNegative())
  38357. return this.mul(e.neg()).neg();
  38358. if (this.lt(f) && e.lt(f))
  38359. return n(this.toNumber() * e.toNumber(), this.unsigned);
  38360. var i = this.high >>> 16
  38361. , o = 65535 & this.high
  38362. , s = this.low >>> 16
  38363. , l = 65535 & this.low
  38364. , c = e.high >>> 16
  38365. , h = 65535 & e.high
  38366. , u = e.low >>> 16
  38367. , d = 65535 & e.low
  38368. , p = 0
  38369. , m = 0
  38370. , v = 0
  38371. , A = 0;
  38372. return A += l * d,
  38373. v += A >>> 16,
  38374. A &= 65535,
  38375. v += s * d,
  38376. m += v >>> 16,
  38377. v &= 65535,
  38378. v += l * u,
  38379. m += v >>> 16,
  38380. v &= 65535,
  38381. m += o * d,
  38382. p += m >>> 16,
  38383. m &= 65535,
  38384. m += s * u,
  38385. p += m >>> 16,
  38386. m &= 65535,
  38387. m += l * h,
  38388. p += m >>> 16,
  38389. m &= 65535,
  38390. p += i * d + o * u + s * h + l * c,
  38391. p &= 65535,
  38392. r(v << 16 | A, p << 16 | m, this.unsigned)
  38393. }
  38394. ,
  38395. b.mul = b.multiply,
  38396. b.divide = function(e) {
  38397. if (t(e) || (e = a(e)),
  38398. e.isZero())
  38399. throw Error("division by zero");
  38400. if (this.isZero())
  38401. return this.unsigned ? m : g;
  38402. var i, r, o;
  38403. if (this.unsigned) {
  38404. if (e.unsigned || (e = e.toUnsigned()),
  38405. e.gt(this))
  38406. return m;
  38407. if (e.gt(this.shru(1)))
  38408. return A;
  38409. o = m
  38410. } else {
  38411. if (this.eq(E)) {
  38412. if (e.eq(v) || e.eq(y))
  38413. return E;
  38414. if (e.eq(E))
  38415. return v;
  38416. var s = this.shr(1);
  38417. return i = s.div(e).shl(1),
  38418. i.eq(g) ? e.isNegative() ? v : y : (r = this.sub(e.mul(i)),
  38419. o = i.add(r.div(e)))
  38420. }
  38421. if (e.eq(E))
  38422. return this.unsigned ? m : g;
  38423. if (this.isNegative())
  38424. return e.isNegative() ? this.neg().div(e.neg()) : this.neg().div(e).neg();
  38425. if (e.isNegative())
  38426. return this.div(e.neg()).neg();
  38427. o = g
  38428. }
  38429. for (r = this; r.gte(e); ) {
  38430. i = Math.max(1, Math.floor(r.toNumber() / e.toNumber()));
  38431. 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); )
  38432. i -= h,
  38433. u = n(i, this.unsigned),
  38434. d = u.mul(e);
  38435. u.isZero() && (u = v),
  38436. o = o.add(u),
  38437. r = r.sub(d)
  38438. }
  38439. return o
  38440. }
  38441. ,
  38442. b.div = b.divide,
  38443. b.modulo = function(e) {
  38444. return t(e) || (e = a(e)),
  38445. this.sub(this.div(e).mul(e))
  38446. }
  38447. ,
  38448. b.mod = b.modulo,
  38449. b.not = function() {
  38450. return r(~this.low, ~this.high, this.unsigned)
  38451. }
  38452. ,
  38453. b.and = function(e) {
  38454. return t(e) || (e = a(e)),
  38455. r(this.low & e.low, this.high & e.high, this.unsigned)
  38456. }
  38457. ,
  38458. b.or = function(e) {
  38459. return t(e) || (e = a(e)),
  38460. r(this.low | e.low, this.high | e.high, this.unsigned)
  38461. }
  38462. ,
  38463. b.xor = function(e) {
  38464. return t(e) || (e = a(e)),
  38465. r(this.low ^ e.low, this.high ^ e.high, this.unsigned)
  38466. }
  38467. ,
  38468. b.shiftLeft = function(e) {
  38469. return t(e) && (e = e.toInt()),
  38470. 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)
  38471. }
  38472. ,
  38473. b.shl = b.shiftLeft,
  38474. b.shiftRight = function(e) {
  38475. return t(e) && (e = e.toInt()),
  38476. 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)
  38477. }
  38478. ,
  38479. b.shr = b.shiftRight,
  38480. b.shiftRightUnsigned = function(e) {
  38481. if (t(e) && (e = e.toInt()),
  38482. e &= 63,
  38483. 0 === e)
  38484. return this;
  38485. var i = this.high;
  38486. if (e < 32) {
  38487. var n = this.low;
  38488. return r(n >>> e | i << 32 - e, i >>> e, this.unsigned)
  38489. }
  38490. return 32 === e ? r(i, 0, this.unsigned) : r(i >>> e - 32, 0, this.unsigned)
  38491. }
  38492. ,
  38493. b.shru = b.shiftRightUnsigned,
  38494. b.toSigned = function() {
  38495. return this.unsigned ? r(this.low, this.high, !1) : this
  38496. }
  38497. ,
  38498. b.toUnsigned = function() {
  38499. return this.unsigned ? this : r(this.low, this.high, !0)
  38500. }
  38501. ,
  38502. b.toBytes = function(e) {
  38503. return e ? this.toBytesLE() : this.toBytesBE()
  38504. }
  38505. ,
  38506. b.toBytesLE = function() {
  38507. var e = this.high
  38508. , t = this.low;
  38509. return [255 & t, t >>> 8 & 255, t >>> 16 & 255, t >>> 24 & 255, 255 & e, e >>> 8 & 255, e >>> 16 & 255, e >>> 24 & 255]
  38510. }
  38511. ,
  38512. b.toBytesBE = function() {
  38513. var e = this.high
  38514. , t = this.low;
  38515. return [e >>> 24 & 255, e >>> 16 & 255, e >>> 8 & 255, 255 & e, t >>> 24 & 255, t >>> 16 & 255, t >>> 8 & 255, 255 & t]
  38516. }
  38517. ,
  38518. e
  38519. })
  38520. }
  38521. , {}],
  38522. 217: [function(e, t, i) {
  38523. var n = {
  38524. REVISION: "75"
  38525. };
  38526. "function" == typeof define && define.amd ? define("three", n) : "undefined" != typeof i && "undefined" != typeof t && (t.exports = n),
  38527. void 0 === Number.EPSILON && (Number.EPSILON = Math.pow(2, -52)),
  38528. void 0 === Math.sign && (Math.sign = function(e) {
  38529. return e < 0 ? -1 : e > 0 ? 1 : +e
  38530. }
  38531. ),
  38532. void 0 === Function.prototype.name && void 0 !== Object.defineProperty && Object.defineProperty(Function.prototype, "name", {
  38533. get: function() {
  38534. return this.toString().match(/^\s*function\s*(\S*)\s*\(/)[1]
  38535. }
  38536. }),
  38537. void 0 === Object.assign && Object.defineProperty(Object, "assign", {
  38538. writable: !0,
  38539. configurable: !0,
  38540. value: function(e) {
  38541. "use strict";
  38542. if (void 0 === e || null === e)
  38543. throw new TypeError("Cannot convert first argument to object");
  38544. for (var t = Object(e), i = 1, n = arguments.length; i !== n; ++i) {
  38545. var r = arguments[i];
  38546. if (void 0 !== r && null !== r) {
  38547. r = Object(r);
  38548. for (var o = Object.keys(r), a = 0, s = o.length; a !== s; ++a) {
  38549. var l = o[a]
  38550. , c = Object.getOwnPropertyDescriptor(r, l);
  38551. void 0 !== c && c.enumerable && (t[l] = r[l])
  38552. }
  38553. }
  38554. }
  38555. return t
  38556. }
  38557. }),
  38558. n.MOUSE = {
  38559. LEFT: 0,
  38560. MIDDLE: 1,
  38561. RIGHT: 2
  38562. },
  38563. n.CullFaceNone = 0,
  38564. n.CullFaceBack = 1,
  38565. n.CullFaceFront = 2,
  38566. n.CullFaceFrontBack = 3,
  38567. n.FrontFaceDirectionCW = 0,
  38568. n.FrontFaceDirectionCCW = 1,
  38569. n.BasicShadowMap = 0,
  38570. n.PCFShadowMap = 1,
  38571. n.PCFSoftShadowMap = 2,
  38572. n.FrontSide = 0,
  38573. n.BackSide = 1,
  38574. n.DoubleSide = 2,
  38575. n.FlatShading = 1,
  38576. n.SmoothShading = 2,
  38577. n.NoColors = 0,
  38578. n.FaceColors = 1,
  38579. n.VertexColors = 2,
  38580. n.NoBlending = 0,
  38581. n.NormalBlending = 1,
  38582. n.AdditiveBlending = 2,
  38583. n.SubtractiveBlending = 3,
  38584. n.MultiplyBlending = 4,
  38585. n.CustomBlending = 5,
  38586. n.AddEquation = 100,
  38587. n.SubtractEquation = 101,
  38588. n.ReverseSubtractEquation = 102,
  38589. n.MinEquation = 103,
  38590. n.MaxEquation = 104,
  38591. n.ZeroFactor = 200,
  38592. n.OneFactor = 201,
  38593. n.SrcColorFactor = 202,
  38594. n.OneMinusSrcColorFactor = 203,
  38595. n.SrcAlphaFactor = 204,
  38596. n.OneMinusSrcAlphaFactor = 205,
  38597. n.DstAlphaFactor = 206,
  38598. n.OneMinusDstAlphaFactor = 207,
  38599. n.DstColorFactor = 208,
  38600. n.OneMinusDstColorFactor = 209,
  38601. n.SrcAlphaSaturateFactor = 210,
  38602. n.NeverDepth = 0,
  38603. n.AlwaysDepth = 1,
  38604. n.LessDepth = 2,
  38605. n.LessEqualDepth = 3,
  38606. n.EqualDepth = 4,
  38607. n.GreaterEqualDepth = 5,
  38608. n.GreaterDepth = 6,
  38609. n.NotEqualDepth = 7,
  38610. n.MultiplyOperation = 0,
  38611. n.MixOperation = 1,
  38612. n.AddOperation = 2,
  38613. n.NoToneMapping = 0,
  38614. n.LinearToneMapping = 1,
  38615. n.ReinhardToneMapping = 2,
  38616. n.Uncharted2ToneMapping = 3,
  38617. n.CineonToneMapping = 4,
  38618. n.UVMapping = 300,
  38619. n.CubeReflectionMapping = 301,
  38620. n.CubeRefractionMapping = 302,
  38621. n.EquirectangularReflectionMapping = 303,
  38622. n.EquirectangularRefractionMapping = 304,
  38623. n.SphericalReflectionMapping = 305,
  38624. n.CubeUVReflectionMapping = 306,
  38625. n.CubeUVRefractionMapping = 307,
  38626. n.RepeatWrapping = 1e3,
  38627. n.ClampToEdgeWrapping = 1001,
  38628. n.MirroredRepeatWrapping = 1002,
  38629. n.NearestFilter = 1003,
  38630. n.NearestMipMapNearestFilter = 1004,
  38631. n.NearestMipMapLinearFilter = 1005,
  38632. n.LinearFilter = 1006,
  38633. n.LinearMipMapNearestFilter = 1007,
  38634. n.LinearMipMapLinearFilter = 1008,
  38635. n.UnsignedByteType = 1009,
  38636. n.ByteType = 1010,
  38637. n.ShortType = 1011,
  38638. n.UnsignedShortType = 1012,
  38639. n.IntType = 1013,
  38640. n.UnsignedIntType = 1014,
  38641. n.FloatType = 1015,
  38642. n.HalfFloatType = 1025,
  38643. n.UnsignedShort4444Type = 1016,
  38644. n.UnsignedShort5551Type = 1017,
  38645. n.UnsignedShort565Type = 1018,
  38646. n.AlphaFormat = 1019,
  38647. n.RGBFormat = 1020,
  38648. n.RGBAFormat = 1021,
  38649. n.LuminanceFormat = 1022,
  38650. n.LuminanceAlphaFormat = 1023,
  38651. n.RGBEFormat = n.RGBAFormat,
  38652. n.RGB_S3TC_DXT1_Format = 2001,
  38653. n.RGBA_S3TC_DXT1_Format = 2002,
  38654. n.RGBA_S3TC_DXT3_Format = 2003,
  38655. n.RGBA_S3TC_DXT5_Format = 2004,
  38656. n.RGB_PVRTC_4BPPV1_Format = 2100,
  38657. n.RGB_PVRTC_2BPPV1_Format = 2101,
  38658. n.RGBA_PVRTC_4BPPV1_Format = 2102,
  38659. n.RGBA_PVRTC_2BPPV1_Format = 2103,
  38660. n.RGB_ETC1_Format = 2151,
  38661. n.LoopOnce = 2200,
  38662. n.LoopRepeat = 2201,
  38663. n.LoopPingPong = 2202,
  38664. n.InterpolateDiscrete = 2300,
  38665. n.InterpolateLinear = 2301,
  38666. n.InterpolateSmooth = 2302,
  38667. n.ZeroCurvatureEnding = 2400,
  38668. n.ZeroSlopeEnding = 2401,
  38669. n.WrapAroundEnding = 2402,
  38670. n.TrianglesDrawMode = 0,
  38671. n.TriangleStripDrawMode = 1,
  38672. n.TriangleFanDrawMode = 2,
  38673. n.LinearEncoding = 3e3,
  38674. n.sRGBEncoding = 3001,
  38675. n.GammaEncoding = 3007,
  38676. n.RGBEEncoding = 3002,
  38677. n.LogLuvEncoding = 3003,
  38678. n.RGBM7Encoding = 3004,
  38679. n.RGBM16Encoding = 3005,
  38680. n.RGBDEncoding = 3006,
  38681. n.Color = function(e) {
  38682. return 3 === arguments.length ? this.fromArray(arguments) : this.set(e)
  38683. }
  38684. ,
  38685. n.Color.prototype = {
  38686. constructor: n.Color,
  38687. r: 1,
  38688. g: 1,
  38689. b: 1,
  38690. set: function(e) {
  38691. return e instanceof n.Color ? this.copy(e) : "number" == typeof e ? this.setHex(e) : "string" == typeof e && this.setStyle(e),
  38692. this
  38693. },
  38694. setScalar: function(e) {
  38695. this.r = e,
  38696. this.g = e,
  38697. this.b = e
  38698. },
  38699. setHex: function(e) {
  38700. return e = Math.floor(e),
  38701. this.r = (e >> 16 & 255) / 255,
  38702. this.g = (e >> 8 & 255) / 255,
  38703. this.b = (255 & e) / 255,
  38704. this
  38705. },
  38706. setRGB: function(e, t, i) {
  38707. return this.r = e,
  38708. this.g = t,
  38709. this.b = i,
  38710. this
  38711. },
  38712. setHSL: function() {
  38713. function e(e, t, i) {
  38714. return i < 0 && (i += 1),
  38715. i > 1 && (i -= 1),
  38716. i < 1 / 6 ? e + 6 * (t - e) * i : i < .5 ? t : i < 2 / 3 ? e + 6 * (t - e) * (2 / 3 - i) : e
  38717. }
  38718. return function(t, i, r) {
  38719. if (t = n.Math.euclideanModulo(t, 1),
  38720. i = n.Math.clamp(i, 0, 1),
  38721. r = n.Math.clamp(r, 0, 1),
  38722. 0 === i)
  38723. this.r = this.g = this.b = r;
  38724. else {
  38725. var o = r <= .5 ? r * (1 + i) : r + i - r * i
  38726. , a = 2 * r - o;
  38727. this.r = e(a, o, t + 1 / 3),
  38728. this.g = e(a, o, t),
  38729. this.b = e(a, o, t - 1 / 3)
  38730. }
  38731. return this
  38732. }
  38733. }(),
  38734. setStyle: function(e) {
  38735. function t(t) {
  38736. void 0 !== t && parseFloat(t) < 1 && console.warn("THREE.Color: Alpha component of " + e + " will be ignored.")
  38737. }
  38738. var i;
  38739. if (i = /^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(e)) {
  38740. var r, o = i[1], a = i[2];
  38741. switch (o) {
  38742. case "rgb":
  38743. case "rgba":
  38744. if (r = /^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a))
  38745. return this.r = Math.min(255, parseInt(r[1], 10)) / 255,
  38746. this.g = Math.min(255, parseInt(r[2], 10)) / 255,
  38747. this.b = Math.min(255, parseInt(r[3], 10)) / 255,
  38748. t(r[5]),
  38749. this;
  38750. if (r = /^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a))
  38751. return this.r = Math.min(100, parseInt(r[1], 10)) / 100,
  38752. this.g = Math.min(100, parseInt(r[2], 10)) / 100,
  38753. this.b = Math.min(100, parseInt(r[3], 10)) / 100,
  38754. t(r[5]),
  38755. this;
  38756. break;
  38757. case "hsl":
  38758. case "hsla":
  38759. if (r = /^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a)) {
  38760. var s = parseFloat(r[1]) / 360
  38761. , l = parseInt(r[2], 10) / 100
  38762. , c = parseInt(r[3], 10) / 100;
  38763. return t(r[5]),
  38764. this.setHSL(s, l, c)
  38765. }
  38766. }
  38767. } else if (i = /^\#([A-Fa-f0-9]+)$/.exec(e)) {
  38768. var h = i[1]
  38769. , u = h.length;
  38770. if (3 === u)
  38771. return this.r = parseInt(h.charAt(0) + h.charAt(0), 16) / 255,
  38772. this.g = parseInt(h.charAt(1) + h.charAt(1), 16) / 255,
  38773. this.b = parseInt(h.charAt(2) + h.charAt(2), 16) / 255,
  38774. this;
  38775. if (6 === u)
  38776. return this.r = parseInt(h.charAt(0) + h.charAt(1), 16) / 255,
  38777. this.g = parseInt(h.charAt(2) + h.charAt(3), 16) / 255,
  38778. this.b = parseInt(h.charAt(4) + h.charAt(5), 16) / 255,
  38779. this
  38780. }
  38781. if (e && e.length > 0) {
  38782. var h = n.ColorKeywords[e];
  38783. void 0 !== h ? this.setHex(h) : console.warn("THREE.Color: Unknown color " + e)
  38784. }
  38785. return this
  38786. },
  38787. clone: function() {
  38788. return new this.constructor(this.r,this.g,this.b)
  38789. },
  38790. copy: function(e) {
  38791. return this.r = e.r,
  38792. this.g = e.g,
  38793. this.b = e.b,
  38794. this
  38795. },
  38796. copyGammaToLinear: function(e, t) {
  38797. return void 0 === t && (t = 2),
  38798. this.r = Math.pow(e.r, t),
  38799. this.g = Math.pow(e.g, t),
  38800. this.b = Math.pow(e.b, t),
  38801. this
  38802. },
  38803. copyLinearToGamma: function(e, t) {
  38804. void 0 === t && (t = 2);
  38805. var i = t > 0 ? 1 / t : 1;
  38806. return this.r = Math.pow(e.r, i),
  38807. this.g = Math.pow(e.g, i),
  38808. this.b = Math.pow(e.b, i),
  38809. this
  38810. },
  38811. convertGammaToLinear: function() {
  38812. var e = this.r
  38813. , t = this.g
  38814. , i = this.b;
  38815. return this.r = e * e,
  38816. this.g = t * t,
  38817. this.b = i * i,
  38818. this
  38819. },
  38820. convertLinearToGamma: function() {
  38821. return this.r = Math.sqrt(this.r),
  38822. this.g = Math.sqrt(this.g),
  38823. this.b = Math.sqrt(this.b),
  38824. this
  38825. },
  38826. getHex: function() {
  38827. return 255 * this.r << 16 ^ 255 * this.g << 8 ^ 255 * this.b << 0
  38828. },
  38829. getHexString: function() {
  38830. return ("000000" + this.getHex().toString(16)).slice(-6)
  38831. },
  38832. getHSL: function(e) {
  38833. var t, i, n = e || {
  38834. h: 0,
  38835. s: 0,
  38836. l: 0
  38837. }, 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;
  38838. if (l === s)
  38839. t = 0,
  38840. i = 0;
  38841. else {
  38842. var h = s - l;
  38843. switch (i = c <= .5 ? h / (s + l) : h / (2 - s - l),
  38844. s) {
  38845. case r:
  38846. t = (o - a) / h + (o < a ? 6 : 0);
  38847. break;
  38848. case o:
  38849. t = (a - r) / h + 2;
  38850. break;
  38851. case a:
  38852. t = (r - o) / h + 4
  38853. }
  38854. t /= 6
  38855. }
  38856. return n.h = t,
  38857. n.s = i,
  38858. n.l = c,
  38859. n
  38860. },
  38861. getStyle: function() {
  38862. return "rgb(" + (255 * this.r | 0) + "," + (255 * this.g | 0) + "," + (255 * this.b | 0) + ")"
  38863. },
  38864. offsetHSL: function(e, t, i) {
  38865. var n = this.getHSL();
  38866. return n.h += e,
  38867. n.s += t,
  38868. n.l += i,
  38869. this.setHSL(n.h, n.s, n.l),
  38870. this
  38871. },
  38872. add: function(e) {
  38873. return this.r += e.r,
  38874. this.g += e.g,
  38875. this.b += e.b,
  38876. this
  38877. },
  38878. addColors: function(e, t) {
  38879. return this.r = e.r + t.r,
  38880. this.g = e.g + t.g,
  38881. this.b = e.b + t.b,
  38882. this
  38883. },
  38884. addScalar: function(e) {
  38885. return this.r += e,
  38886. this.g += e,
  38887. this.b += e,
  38888. this
  38889. },
  38890. multiply: function(e) {
  38891. return this.r *= e.r,
  38892. this.g *= e.g,
  38893. this.b *= e.b,
  38894. this
  38895. },
  38896. multiplyScalar: function(e) {
  38897. return this.r *= e,
  38898. this.g *= e,
  38899. this.b *= e,
  38900. this
  38901. },
  38902. lerp: function(e, t) {
  38903. return this.r += (e.r - this.r) * t,
  38904. this.g += (e.g - this.g) * t,
  38905. this.b += (e.b - this.b) * t,
  38906. this
  38907. },
  38908. equals: function(e) {
  38909. return e.r === this.r && e.g === this.g && e.b === this.b
  38910. },
  38911. fromArray: function(e, t) {
  38912. return void 0 === t && (t = 0),
  38913. this.r = e[t],
  38914. this.g = e[t + 1],
  38915. this.b = e[t + 2],
  38916. this
  38917. },
  38918. toArray: function(e, t) {
  38919. return void 0 === e && (e = []),
  38920. void 0 === t && (t = 0),
  38921. e[t] = this.r,
  38922. e[t + 1] = this.g,
  38923. e[t + 2] = this.b,
  38924. e
  38925. }
  38926. },
  38927. n.ColorKeywords = {
  38928. aliceblue: 15792383,
  38929. antiquewhite: 16444375,
  38930. aqua: 65535,
  38931. aquamarine: 8388564,
  38932. azure: 15794175,
  38933. beige: 16119260,
  38934. bisque: 16770244,
  38935. black: 0,
  38936. blanchedalmond: 16772045,
  38937. blue: 255,
  38938. blueviolet: 9055202,
  38939. brown: 10824234,
  38940. burlywood: 14596231,
  38941. cadetblue: 6266528,
  38942. chartreuse: 8388352,
  38943. chocolate: 13789470,
  38944. coral: 16744272,
  38945. cornflowerblue: 6591981,
  38946. cornsilk: 16775388,
  38947. crimson: 14423100,
  38948. cyan: 65535,
  38949. darkblue: 139,
  38950. darkcyan: 35723,
  38951. darkgoldenrod: 12092939,
  38952. darkgray: 11119017,
  38953. darkgreen: 25600,
  38954. darkgrey: 11119017,
  38955. darkkhaki: 12433259,
  38956. darkmagenta: 9109643,
  38957. darkolivegreen: 5597999,
  38958. darkorange: 16747520,
  38959. darkorchid: 10040012,
  38960. darkred: 9109504,
  38961. darksalmon: 15308410,
  38962. darkseagreen: 9419919,
  38963. darkslateblue: 4734347,
  38964. darkslategray: 3100495,
  38965. darkslategrey: 3100495,
  38966. darkturquoise: 52945,
  38967. darkviolet: 9699539,
  38968. deeppink: 16716947,
  38969. deepskyblue: 49151,
  38970. dimgray: 6908265,
  38971. dimgrey: 6908265,
  38972. dodgerblue: 2003199,
  38973. firebrick: 11674146,
  38974. floralwhite: 16775920,
  38975. forestgreen: 2263842,
  38976. fuchsia: 16711935,
  38977. gainsboro: 14474460,
  38978. ghostwhite: 16316671,
  38979. gold: 16766720,
  38980. goldenrod: 14329120,
  38981. gray: 8421504,
  38982. green: 32768,
  38983. greenyellow: 11403055,
  38984. grey: 8421504,
  38985. honeydew: 15794160,
  38986. hotpink: 16738740,
  38987. indianred: 13458524,
  38988. indigo: 4915330,
  38989. ivory: 16777200,
  38990. khaki: 15787660,
  38991. lavender: 15132410,
  38992. lavenderblush: 16773365,
  38993. lawngreen: 8190976,
  38994. lemonchiffon: 16775885,
  38995. lightblue: 11393254,
  38996. lightcoral: 15761536,
  38997. lightcyan: 14745599,
  38998. lightgoldenrodyellow: 16448210,
  38999. lightgray: 13882323,
  39000. lightgreen: 9498256,
  39001. lightgrey: 13882323,
  39002. lightpink: 16758465,
  39003. lightsalmon: 16752762,
  39004. lightseagreen: 2142890,
  39005. lightskyblue: 8900346,
  39006. lightslategray: 7833753,
  39007. lightslategrey: 7833753,
  39008. lightsteelblue: 11584734,
  39009. lightyellow: 16777184,
  39010. lime: 65280,
  39011. limegreen: 3329330,
  39012. linen: 16445670,
  39013. magenta: 16711935,
  39014. maroon: 8388608,
  39015. mediumaquamarine: 6737322,
  39016. mediumblue: 205,
  39017. mediumorchid: 12211667,
  39018. mediumpurple: 9662683,
  39019. mediumseagreen: 3978097,
  39020. mediumslateblue: 8087790,
  39021. mediumspringgreen: 64154,
  39022. mediumturquoise: 4772300,
  39023. mediumvioletred: 13047173,
  39024. midnightblue: 1644912,
  39025. mintcream: 16121850,
  39026. mistyrose: 16770273,
  39027. moccasin: 16770229,
  39028. navajowhite: 16768685,
  39029. navy: 128,
  39030. oldlace: 16643558,
  39031. olive: 8421376,
  39032. olivedrab: 7048739,
  39033. orange: 16753920,
  39034. orangered: 16729344,
  39035. orchid: 14315734,
  39036. palegoldenrod: 15657130,
  39037. palegreen: 10025880,
  39038. paleturquoise: 11529966,
  39039. palevioletred: 14381203,
  39040. papayawhip: 16773077,
  39041. peachpuff: 16767673,
  39042. peru: 13468991,
  39043. pink: 16761035,
  39044. plum: 14524637,
  39045. powderblue: 11591910,
  39046. purple: 8388736,
  39047. red: 16711680,
  39048. rosybrown: 12357519,
  39049. royalblue: 4286945,
  39050. saddlebrown: 9127187,
  39051. salmon: 16416882,
  39052. sandybrown: 16032864,
  39053. seagreen: 3050327,
  39054. seashell: 16774638,
  39055. sienna: 10506797,
  39056. silver: 12632256,
  39057. skyblue: 8900331,
  39058. slateblue: 6970061,
  39059. slategray: 7372944,
  39060. slategrey: 7372944,
  39061. snow: 16775930,
  39062. springgreen: 65407,
  39063. steelblue: 4620980,
  39064. tan: 13808780,
  39065. teal: 32896,
  39066. thistle: 14204888,
  39067. tomato: 16737095,
  39068. turquoise: 4251856,
  39069. violet: 15631086,
  39070. wheat: 16113331,
  39071. white: 16777215,
  39072. whitesmoke: 16119285,
  39073. yellow: 16776960,
  39074. yellowgreen: 10145074
  39075. },
  39076. n.Quaternion = function(e, t, i, n) {
  39077. this._x = e || 0,
  39078. this._y = t || 0,
  39079. this._z = i || 0,
  39080. this._w = void 0 !== n ? n : 1
  39081. }
  39082. ,
  39083. n.Quaternion.prototype = {
  39084. constructor: n.Quaternion,
  39085. get x() {
  39086. return this._x
  39087. },
  39088. set x(e) {
  39089. this._x = e,
  39090. this.onChangeCallback()
  39091. },
  39092. get y() {
  39093. return this._y
  39094. },
  39095. set y(e) {
  39096. this._y = e,
  39097. this.onChangeCallback()
  39098. },
  39099. get z() {
  39100. return this._z
  39101. },
  39102. set z(e) {
  39103. this._z = e,
  39104. this.onChangeCallback()
  39105. },
  39106. get w() {
  39107. return this._w
  39108. },
  39109. set w(e) {
  39110. this._w = e,
  39111. this.onChangeCallback()
  39112. },
  39113. set: function(e, t, i, n) {
  39114. return this._x = e,
  39115. this._y = t,
  39116. this._z = i,
  39117. this._w = n,
  39118. this.onChangeCallback(),
  39119. this
  39120. },
  39121. clone: function() {
  39122. return new this.constructor(this._x,this._y,this._z,this._w)
  39123. },
  39124. copy: function(e) {
  39125. return this._x = e.x,
  39126. this._y = e.y,
  39127. this._z = e.z,
  39128. this._w = e.w,
  39129. this.onChangeCallback(),
  39130. this
  39131. },
  39132. setFromEuler: function(e, t) {
  39133. if (e instanceof n.Euler == !1)
  39134. throw new Error("THREE.Quaternion: .setFromEuler() now expects a Euler rotation rather than a Vector3 and order.");
  39135. var i = Math.cos(e._x / 2)
  39136. , r = Math.cos(e._y / 2)
  39137. , o = Math.cos(e._z / 2)
  39138. , a = Math.sin(e._x / 2)
  39139. , s = Math.sin(e._y / 2)
  39140. , l = Math.sin(e._z / 2)
  39141. , c = e.order;
  39142. return "XYZ" === c ? (this._x = a * r * o + i * s * l,
  39143. this._y = i * s * o - a * r * l,
  39144. this._z = i * r * l + a * s * o,
  39145. this._w = i * r * o - a * s * l) : "YXZ" === c ? (this._x = a * r * o + i * s * l,
  39146. this._y = i * s * o - a * r * l,
  39147. this._z = i * r * l - a * s * o,
  39148. this._w = i * r * o + a * s * l) : "ZXY" === c ? (this._x = a * r * o - i * s * l,
  39149. this._y = i * s * o + a * r * l,
  39150. this._z = i * r * l + a * s * o,
  39151. this._w = i * r * o - a * s * l) : "ZYX" === c ? (this._x = a * r * o - i * s * l,
  39152. this._y = i * s * o + a * r * l,
  39153. this._z = i * r * l - a * s * o,
  39154. this._w = i * r * o + a * s * l) : "YZX" === c ? (this._x = a * r * o + i * s * l,
  39155. this._y = i * s * o + a * r * l,
  39156. this._z = i * r * l - a * s * o,
  39157. this._w = i * r * o - a * s * l) : "XZY" === c && (this._x = a * r * o - i * s * l,
  39158. this._y = i * s * o - a * r * l,
  39159. this._z = i * r * l + a * s * o,
  39160. this._w = i * r * o + a * s * l),
  39161. t !== !1 && this.onChangeCallback(),
  39162. this
  39163. },
  39164. setFromAxisAngle: function(e, t) {
  39165. var i = t / 2
  39166. , n = Math.sin(i);
  39167. return this._x = e.x * n,
  39168. this._y = e.y * n,
  39169. this._z = e.z * n,
  39170. this._w = Math.cos(i),
  39171. this.onChangeCallback(),
  39172. this
  39173. },
  39174. setFromRotationMatrix: function(e) {
  39175. 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;
  39176. return d > 0 ? (t = .5 / Math.sqrt(d + 1),
  39177. this._w = .25 / t,
  39178. this._x = (h - l) * t,
  39179. this._y = (o - c) * t,
  39180. this._z = (a - r) * t) : n > s && n > u ? (t = 2 * Math.sqrt(1 + n - s - u),
  39181. this._w = (h - l) / t,
  39182. this._x = .25 * t,
  39183. this._y = (r + a) / t,
  39184. this._z = (o + c) / t) : s > u ? (t = 2 * Math.sqrt(1 + s - n - u),
  39185. this._w = (o - c) / t,
  39186. this._x = (r + a) / t,
  39187. this._y = .25 * t,
  39188. this._z = (l + h) / t) : (t = 2 * Math.sqrt(1 + u - n - s),
  39189. this._w = (a - r) / t,
  39190. this._x = (o + c) / t,
  39191. this._y = (l + h) / t,
  39192. this._z = .25 * t),
  39193. this.onChangeCallback(),
  39194. this
  39195. },
  39196. setFromUnitVectors: function() {
  39197. var e, t, i = 1e-6;
  39198. return function(r, o) {
  39199. return void 0 === e && (e = new n.Vector3),
  39200. t = r.dot(o) + 1,
  39201. t < i ? (t = 0,
  39202. 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),
  39203. this._x = e.x,
  39204. this._y = e.y,
  39205. this._z = e.z,
  39206. this._w = t,
  39207. this.normalize(),
  39208. this
  39209. }
  39210. }(),
  39211. inverse: function() {
  39212. return this.conjugate().normalize(),
  39213. this
  39214. },
  39215. conjugate: function() {
  39216. return this._x *= -1,
  39217. this._y *= -1,
  39218. this._z *= -1,
  39219. this.onChangeCallback(),
  39220. this
  39221. },
  39222. dot: function(e) {
  39223. return this._x * e._x + this._y * e._y + this._z * e._z + this._w * e._w
  39224. },
  39225. lengthSq: function() {
  39226. return this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w
  39227. },
  39228. length: function() {
  39229. return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w)
  39230. },
  39231. normalize: function() {
  39232. var e = this.length();
  39233. return 0 === e ? (this._x = 0,
  39234. this._y = 0,
  39235. this._z = 0,
  39236. this._w = 1) : (e = 1 / e,
  39237. this._x = this._x * e,
  39238. this._y = this._y * e,
  39239. this._z = this._z * e,
  39240. this._w = this._w * e),
  39241. this.onChangeCallback(),
  39242. this
  39243. },
  39244. multiply: function(e, t) {
  39245. return void 0 !== t ? (console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),
  39246. this.multiplyQuaternions(e, t)) : this.multiplyQuaternions(this, e)
  39247. },
  39248. multiplyQuaternions: function(e, t) {
  39249. var i = e._x
  39250. , n = e._y
  39251. , r = e._z
  39252. , o = e._w
  39253. , a = t._x
  39254. , s = t._y
  39255. , l = t._z
  39256. , c = t._w;
  39257. return this._x = i * c + o * a + n * l - r * s,
  39258. this._y = n * c + o * s + r * a - i * l,
  39259. this._z = r * c + o * l + i * s - n * a,
  39260. this._w = o * c - i * a - n * s - r * l,
  39261. this.onChangeCallback(),
  39262. this
  39263. },
  39264. slerp: function(e, t) {
  39265. if (0 === t)
  39266. return this;
  39267. if (1 === t)
  39268. return this.copy(e);
  39269. var i = this._x
  39270. , n = this._y
  39271. , r = this._z
  39272. , o = this._w
  39273. , a = o * e._w + i * e._x + n * e._y + r * e._z;
  39274. if (a < 0 ? (this._w = -e._w,
  39275. this._x = -e._x,
  39276. this._y = -e._y,
  39277. this._z = -e._z,
  39278. a = -a) : this.copy(e),
  39279. a >= 1)
  39280. return this._w = o,
  39281. this._x = i,
  39282. this._y = n,
  39283. this._z = r,
  39284. this;
  39285. var s = Math.sqrt(1 - a * a);
  39286. if (Math.abs(s) < .001)
  39287. return this._w = .5 * (o + this._w),
  39288. this._x = .5 * (i + this._x),
  39289. this._y = .5 * (n + this._y),
  39290. this._z = .5 * (r + this._z),
  39291. this;
  39292. var l = Math.atan2(s, a)
  39293. , c = Math.sin((1 - t) * l) / s
  39294. , h = Math.sin(t * l) / s;
  39295. return this._w = o * c + this._w * h,
  39296. this._x = i * c + this._x * h,
  39297. this._y = n * c + this._y * h,
  39298. this._z = r * c + this._z * h,
  39299. this.onChangeCallback(),
  39300. this
  39301. },
  39302. equals: function(e) {
  39303. return e._x === this._x && e._y === this._y && e._z === this._z && e._w === this._w
  39304. },
  39305. fromArray: function(e, t) {
  39306. return void 0 === t && (t = 0),
  39307. this._x = e[t],
  39308. this._y = e[t + 1],
  39309. this._z = e[t + 2],
  39310. this._w = e[t + 3],
  39311. this.onChangeCallback(),
  39312. this
  39313. },
  39314. toArray: function(e, t) {
  39315. return void 0 === e && (e = []),
  39316. void 0 === t && (t = 0),
  39317. e[t] = this._x,
  39318. e[t + 1] = this._y,
  39319. e[t + 2] = this._z,
  39320. e[t + 3] = this._w,
  39321. e
  39322. },
  39323. onChange: function(e) {
  39324. return this.onChangeCallback = e,
  39325. this
  39326. },
  39327. onChangeCallback: function() {}
  39328. },
  39329. Object.assign(n.Quaternion, {
  39330. slerp: function(e, t, i, n) {
  39331. return i.copy(e).slerp(t, n)
  39332. },
  39333. slerpFlat: function(e, t, i, n, r, o, a) {
  39334. var s = i[n + 0]
  39335. , l = i[n + 1]
  39336. , c = i[n + 2]
  39337. , h = i[n + 3]
  39338. , u = r[o + 0]
  39339. , d = r[o + 1]
  39340. , p = r[o + 2]
  39341. , f = r[o + 3];
  39342. if (h !== f || s !== u || l !== d || c !== p) {
  39343. var g = 1 - a
  39344. , m = s * u + l * d + c * p + h * f
  39345. , v = m >= 0 ? 1 : -1
  39346. , A = 1 - m * m;
  39347. if (A > Number.EPSILON) {
  39348. var y = Math.sqrt(A)
  39349. , C = Math.atan2(y, m * v);
  39350. g = Math.sin(g * C) / y,
  39351. a = Math.sin(a * C) / y
  39352. }
  39353. var I = a * v;
  39354. if (s = s * g + u * I,
  39355. l = l * g + d * I,
  39356. c = c * g + p * I,
  39357. h = h * g + f * I,
  39358. g === 1 - a) {
  39359. var E = 1 / Math.sqrt(s * s + l * l + c * c + h * h);
  39360. s *= E,
  39361. l *= E,
  39362. c *= E,
  39363. h *= E
  39364. }
  39365. }
  39366. e[t] = s,
  39367. e[t + 1] = l,
  39368. e[t + 2] = c,
  39369. e[t + 3] = h
  39370. }
  39371. }),
  39372. n.Vector2 = function(e, t) {
  39373. this.x = e || 0,
  39374. this.y = t || 0
  39375. }
  39376. ,
  39377. n.Vector2.prototype = {
  39378. constructor: n.Vector2,
  39379. get width() {
  39380. return this.x
  39381. },
  39382. set width(e) {
  39383. this.x = e
  39384. },
  39385. get height() {
  39386. return this.y
  39387. },
  39388. set height(e) {
  39389. this.y = e
  39390. },
  39391. set: function(e, t) {
  39392. return this.x = e,
  39393. this.y = t,
  39394. this
  39395. },
  39396. setScalar: function(e) {
  39397. return this.x = e,
  39398. this.y = e,
  39399. this
  39400. },
  39401. setX: function(e) {
  39402. return this.x = e,
  39403. this
  39404. },
  39405. setY: function(e) {
  39406. return this.y = e,
  39407. this
  39408. },
  39409. setComponent: function(e, t) {
  39410. switch (e) {
  39411. case 0:
  39412. this.x = t;
  39413. break;
  39414. case 1:
  39415. this.y = t;
  39416. break;
  39417. default:
  39418. throw new Error("index is out of range: " + e)
  39419. }
  39420. },
  39421. getComponent: function(e) {
  39422. switch (e) {
  39423. case 0:
  39424. return this.x;
  39425. case 1:
  39426. return this.y;
  39427. default:
  39428. throw new Error("index is out of range: " + e)
  39429. }
  39430. },
  39431. clone: function() {
  39432. return new this.constructor(this.x,this.y)
  39433. },
  39434. copy: function(e) {
  39435. return this.x = e.x,
  39436. this.y = e.y,
  39437. this
  39438. },
  39439. add: function(e, t) {
  39440. return void 0 !== t ? (console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),
  39441. this.addVectors(e, t)) : (this.x += e.x,
  39442. this.y += e.y,
  39443. this)
  39444. },
  39445. addScalar: function(e) {
  39446. return this.x += e,
  39447. this.y += e,
  39448. this
  39449. },
  39450. addVectors: function(e, t) {
  39451. return this.x = e.x + t.x,
  39452. this.y = e.y + t.y,
  39453. this
  39454. },
  39455. addScaledVector: function(e, t) {
  39456. return this.x += e.x * t,
  39457. this.y += e.y * t,
  39458. this
  39459. },
  39460. sub: function(e, t) {
  39461. return void 0 !== t ? (console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
  39462. this.subVectors(e, t)) : (this.x -= e.x,
  39463. this.y -= e.y,
  39464. this)
  39465. },
  39466. subScalar: function(e) {
  39467. return this.x -= e,
  39468. this.y -= e,
  39469. this
  39470. },
  39471. subVectors: function(e, t) {
  39472. return this.x = e.x - t.x,
  39473. this.y = e.y - t.y,
  39474. this
  39475. },
  39476. multiply: function(e) {
  39477. return this.x *= e.x,
  39478. this.y *= e.y,
  39479. this
  39480. },
  39481. multiplyScalar: function(e) {
  39482. return isFinite(e) ? (this.x *= e,
  39483. this.y *= e) : (this.x = 0,
  39484. this.y = 0),
  39485. this
  39486. },
  39487. divide: function(e) {
  39488. return this.x /= e.x,
  39489. this.y /= e.y,
  39490. this
  39491. },
  39492. divideScalar: function(e) {
  39493. return this.multiplyScalar(1 / e)
  39494. },
  39495. min: function(e) {
  39496. return this.x = Math.min(this.x, e.x),
  39497. this.y = Math.min(this.y, e.y),
  39498. this
  39499. },
  39500. max: function(e) {
  39501. return this.x = Math.max(this.x, e.x),
  39502. this.y = Math.max(this.y, e.y),
  39503. this
  39504. },
  39505. clamp: function(e, t) {
  39506. return this.x = Math.max(e.x, Math.min(t.x, this.x)),
  39507. this.y = Math.max(e.y, Math.min(t.y, this.y)),
  39508. this
  39509. },
  39510. clampScalar: function() {
  39511. var e, t;
  39512. return function(i, r) {
  39513. return void 0 === e && (e = new n.Vector2,
  39514. t = new n.Vector2),
  39515. e.set(i, i),
  39516. t.set(r, r),
  39517. this.clamp(e, t)
  39518. }
  39519. }(),
  39520. clampLength: function(e, t) {
  39521. var i = this.length();
  39522. return this.multiplyScalar(Math.max(e, Math.min(t, i)) / i),
  39523. this
  39524. },
  39525. floor: function() {
  39526. return this.x = Math.floor(this.x),
  39527. this.y = Math.floor(this.y),
  39528. this
  39529. },
  39530. ceil: function() {
  39531. return this.x = Math.ceil(this.x),
  39532. this.y = Math.ceil(this.y),
  39533. this
  39534. },
  39535. round: function() {
  39536. return this.x = Math.round(this.x),
  39537. this.y = Math.round(this.y),
  39538. this
  39539. },
  39540. roundToZero: function() {
  39541. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x),
  39542. this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y),
  39543. this
  39544. },
  39545. negate: function() {
  39546. return this.x = -this.x,
  39547. this.y = -this.y,
  39548. this
  39549. },
  39550. dot: function(e) {
  39551. return this.x * e.x + this.y * e.y
  39552. },
  39553. lengthSq: function() {
  39554. return this.x * this.x + this.y * this.y
  39555. },
  39556. length: function() {
  39557. return Math.sqrt(this.x * this.x + this.y * this.y)
  39558. },
  39559. lengthManhattan: function() {
  39560. return Math.abs(this.x) + Math.abs(this.y)
  39561. },
  39562. normalize: function() {
  39563. return this.divideScalar(this.length())
  39564. },
  39565. angle: function() {
  39566. var e = Math.atan2(this.y, this.x);
  39567. return e < 0 && (e += 2 * Math.PI),
  39568. e
  39569. },
  39570. distanceTo: function(e) {
  39571. return Math.sqrt(this.distanceToSquared(e))
  39572. },
  39573. distanceToSquared: function(e) {
  39574. var t = this.x - e.x
  39575. , i = this.y - e.y;
  39576. return t * t + i * i
  39577. },
  39578. setLength: function(e) {
  39579. return this.multiplyScalar(e / this.length())
  39580. },
  39581. lerp: function(e, t) {
  39582. return this.x += (e.x - this.x) * t,
  39583. this.y += (e.y - this.y) * t,
  39584. this
  39585. },
  39586. lerpVectors: function(e, t, i) {
  39587. return this.subVectors(t, e).multiplyScalar(i).add(e),
  39588. this
  39589. },
  39590. equals: function(e) {
  39591. return e.x === this.x && e.y === this.y
  39592. },
  39593. fromArray: function(e, t) {
  39594. return void 0 === t && (t = 0),
  39595. this.x = e[t],
  39596. this.y = e[t + 1],
  39597. this
  39598. },
  39599. toArray: function(e, t) {
  39600. return void 0 === e && (e = []),
  39601. void 0 === t && (t = 0),
  39602. e[t] = this.x,
  39603. e[t + 1] = this.y,
  39604. e
  39605. },
  39606. fromAttribute: function(e, t, i) {
  39607. return void 0 === i && (i = 0),
  39608. t = t * e.itemSize + i,
  39609. this.x = e.array[t],
  39610. this.y = e.array[t + 1],
  39611. this
  39612. },
  39613. rotateAround: function(e, t) {
  39614. var i = Math.cos(t)
  39615. , n = Math.sin(t)
  39616. , r = this.x - e.x
  39617. , o = this.y - e.y;
  39618. return this.x = r * i - o * n + e.x,
  39619. this.y = r * n + o * i + e.y,
  39620. this
  39621. }
  39622. },
  39623. n.Vector3 = function(e, t, i) {
  39624. this.x = e || 0,
  39625. this.y = t || 0,
  39626. this.z = i || 0
  39627. }
  39628. ,
  39629. n.Vector3.prototype = {
  39630. constructor: n.Vector3,
  39631. set: function(e, t, i) {
  39632. return this.x = e,
  39633. this.y = t,
  39634. this.z = i,
  39635. this
  39636. },
  39637. setScalar: function(e) {
  39638. return this.x = e,
  39639. this.y = e,
  39640. this.z = e,
  39641. this
  39642. },
  39643. setX: function(e) {
  39644. return this.x = e,
  39645. this
  39646. },
  39647. setY: function(e) {
  39648. return this.y = e,
  39649. this
  39650. },
  39651. setZ: function(e) {
  39652. return this.z = e,
  39653. this
  39654. },
  39655. setComponent: function(e, t) {
  39656. switch (e) {
  39657. case 0:
  39658. this.x = t;
  39659. break;
  39660. case 1:
  39661. this.y = t;
  39662. break;
  39663. case 2:
  39664. this.z = t;
  39665. break;
  39666. default:
  39667. throw new Error("index is out of range: " + e)
  39668. }
  39669. },
  39670. getComponent: function(e) {
  39671. switch (e) {
  39672. case 0:
  39673. return this.x;
  39674. case 1:
  39675. return this.y;
  39676. case 2:
  39677. return this.z;
  39678. default:
  39679. throw new Error("index is out of range: " + e)
  39680. }
  39681. },
  39682. clone: function() {
  39683. return new this.constructor(this.x,this.y,this.z)
  39684. },
  39685. copy: function(e) {
  39686. return this.x = e.x,
  39687. this.y = e.y,
  39688. this.z = e.z,
  39689. this
  39690. },
  39691. add: function(e, t) {
  39692. return void 0 !== t ? (console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),
  39693. this.addVectors(e, t)) : (this.x += e.x,
  39694. this.y += e.y,
  39695. this.z += e.z,
  39696. this)
  39697. },
  39698. addScalar: function(e) {
  39699. return this.x += e,
  39700. this.y += e,
  39701. this.z += e,
  39702. this
  39703. },
  39704. addVectors: function(e, t) {
  39705. return this.x = e.x + t.x,
  39706. this.y = e.y + t.y,
  39707. this.z = e.z + t.z,
  39708. this
  39709. },
  39710. addScaledVector: function(e, t) {
  39711. return this.x += e.x * t,
  39712. this.y += e.y * t,
  39713. this.z += e.z * t,
  39714. this
  39715. },
  39716. sub: function(e, t) {
  39717. return void 0 !== t ? (console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
  39718. this.subVectors(e, t)) : (this.x -= e.x,
  39719. this.y -= e.y,
  39720. this.z -= e.z,
  39721. this)
  39722. },
  39723. subScalar: function(e) {
  39724. return this.x -= e,
  39725. this.y -= e,
  39726. this.z -= e,
  39727. this
  39728. },
  39729. subVectors: function(e, t) {
  39730. return this.x = e.x - t.x,
  39731. this.y = e.y - t.y,
  39732. this.z = e.z - t.z,
  39733. this
  39734. },
  39735. multiply: function(e, t) {
  39736. return void 0 !== t ? (console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),
  39737. this.multiplyVectors(e, t)) : (this.x *= e.x,
  39738. this.y *= e.y,
  39739. this.z *= e.z,
  39740. this)
  39741. },
  39742. multiplyScalar: function(e) {
  39743. return isFinite(e) ? (this.x *= e,
  39744. this.y *= e,
  39745. this.z *= e) : (this.x = 0,
  39746. this.y = 0,
  39747. this.z = 0),
  39748. this
  39749. },
  39750. multiplyVectors: function(e, t) {
  39751. return this.x = e.x * t.x,
  39752. this.y = e.y * t.y,
  39753. this.z = e.z * t.z,
  39754. this
  39755. },
  39756. applyEuler: function() {
  39757. var e;
  39758. return function(t) {
  39759. return t instanceof n.Euler == !1 && console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),
  39760. void 0 === e && (e = new n.Quaternion),
  39761. this.applyQuaternion(e.setFromEuler(t)),
  39762. this
  39763. }
  39764. }(),
  39765. applyAxisAngle: function() {
  39766. var e;
  39767. return function(t, i) {
  39768. return void 0 === e && (e = new n.Quaternion),
  39769. this.applyQuaternion(e.setFromAxisAngle(t, i)),
  39770. this
  39771. }
  39772. }(),
  39773. applyMatrix3: function(e) {
  39774. var t = this.x
  39775. , i = this.y
  39776. , n = this.z
  39777. , r = e.elements;
  39778. return this.x = r[0] * t + r[3] * i + r[6] * n,
  39779. this.y = r[1] * t + r[4] * i + r[7] * n,
  39780. this.z = r[2] * t + r[5] * i + r[8] * n,
  39781. this
  39782. },
  39783. applyMatrix4: function(e) {
  39784. var t = this.x
  39785. , i = this.y
  39786. , n = this.z
  39787. , r = e.elements;
  39788. return this.x = r[0] * t + r[4] * i + r[8] * n + r[12],
  39789. this.y = r[1] * t + r[5] * i + r[9] * n + r[13],
  39790. this.z = r[2] * t + r[6] * i + r[10] * n + r[14],
  39791. this
  39792. },
  39793. applyProjection: function(e) {
  39794. var t = this.x
  39795. , i = this.y
  39796. , n = this.z
  39797. , r = e.elements
  39798. , o = 1 / (r[3] * t + r[7] * i + r[11] * n + r[15]);
  39799. return this.x = (r[0] * t + r[4] * i + r[8] * n + r[12]) * o,
  39800. this.y = (r[1] * t + r[5] * i + r[9] * n + r[13]) * o,
  39801. this.z = (r[2] * t + r[6] * i + r[10] * n + r[14]) * o,
  39802. this
  39803. },
  39804. applyQuaternion: function(e) {
  39805. var t = this.x
  39806. , i = this.y
  39807. , n = this.z
  39808. , r = e.x
  39809. , o = e.y
  39810. , a = e.z
  39811. , s = e.w
  39812. , l = s * t + o * n - a * i
  39813. , c = s * i + a * t - r * n
  39814. , h = s * n + r * i - o * t
  39815. , u = -r * t - o * i - a * n;
  39816. return this.x = l * s + u * -r + c * -a - h * -o,
  39817. this.y = c * s + u * -o + h * -r - l * -a,
  39818. this.z = h * s + u * -a + l * -o - c * -r,
  39819. this
  39820. },
  39821. project: function() {
  39822. var e;
  39823. return function(t) {
  39824. return void 0 === e && (e = new n.Matrix4),
  39825. e.multiplyMatrices(t.projectionMatrix, e.getInverse(t.matrixWorld)),
  39826. this.applyProjection(e)
  39827. }
  39828. }(),
  39829. unproject: function() {
  39830. var e;
  39831. return function(t) {
  39832. return void 0 === e && (e = new n.Matrix4),
  39833. e.multiplyMatrices(t.matrixWorld, e.getInverse(t.projectionMatrix)),
  39834. this.applyProjection(e)
  39835. }
  39836. }(),
  39837. transformDirection: function(e) {
  39838. var t = this.x
  39839. , i = this.y
  39840. , n = this.z
  39841. , r = e.elements;
  39842. return this.x = r[0] * t + r[4] * i + r[8] * n,
  39843. this.y = r[1] * t + r[5] * i + r[9] * n,
  39844. this.z = r[2] * t + r[6] * i + r[10] * n,
  39845. this.normalize(),
  39846. this
  39847. },
  39848. divide: function(e) {
  39849. return this.x /= e.x,
  39850. this.y /= e.y,
  39851. this.z /= e.z,
  39852. this
  39853. },
  39854. divideScalar: function(e) {
  39855. return this.multiplyScalar(1 / e)
  39856. },
  39857. min: function(e) {
  39858. return this.x = Math.min(this.x, e.x),
  39859. this.y = Math.min(this.y, e.y),
  39860. this.z = Math.min(this.z, e.z),
  39861. this
  39862. },
  39863. max: function(e) {
  39864. return this.x = Math.max(this.x, e.x),
  39865. this.y = Math.max(this.y, e.y),
  39866. this.z = Math.max(this.z, e.z),
  39867. this
  39868. },
  39869. clamp: function(e, t) {
  39870. return this.x = Math.max(e.x, Math.min(t.x, this.x)),
  39871. this.y = Math.max(e.y, Math.min(t.y, this.y)),
  39872. this.z = Math.max(e.z, Math.min(t.z, this.z)),
  39873. this
  39874. },
  39875. clampScalar: function() {
  39876. var e, t;
  39877. return function(i, r) {
  39878. return void 0 === e && (e = new n.Vector3,
  39879. t = new n.Vector3),
  39880. e.set(i, i, i),
  39881. t.set(r, r, r),
  39882. this.clamp(e, t)
  39883. }
  39884. }(),
  39885. clampLength: function(e, t) {
  39886. var i = this.length();
  39887. return this.multiplyScalar(Math.max(e, Math.min(t, i)) / i),
  39888. this
  39889. },
  39890. floor: function() {
  39891. return this.x = Math.floor(this.x),
  39892. this.y = Math.floor(this.y),
  39893. this.z = Math.floor(this.z),
  39894. this
  39895. },
  39896. ceil: function() {
  39897. return this.x = Math.ceil(this.x),
  39898. this.y = Math.ceil(this.y),
  39899. this.z = Math.ceil(this.z),
  39900. this
  39901. },
  39902. round: function() {
  39903. return this.x = Math.round(this.x),
  39904. this.y = Math.round(this.y),
  39905. this.z = Math.round(this.z),
  39906. this
  39907. },
  39908. roundToZero: function() {
  39909. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x),
  39910. this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y),
  39911. this.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z),
  39912. this
  39913. },
  39914. negate: function() {
  39915. return this.x = -this.x,
  39916. this.y = -this.y,
  39917. this.z = -this.z,
  39918. this
  39919. },
  39920. dot: function(e) {
  39921. return this.x * e.x + this.y * e.y + this.z * e.z
  39922. },
  39923. lengthSq: function() {
  39924. return this.x * this.x + this.y * this.y + this.z * this.z
  39925. },
  39926. length: function() {
  39927. return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z)
  39928. },
  39929. lengthManhattan: function() {
  39930. return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z)
  39931. },
  39932. normalize: function() {
  39933. return this.divideScalar(this.length())
  39934. },
  39935. setLength: function(e) {
  39936. return this.multiplyScalar(e / this.length())
  39937. },
  39938. lerp: function(e, t) {
  39939. return this.x += (e.x - this.x) * t,
  39940. this.y += (e.y - this.y) * t,
  39941. this.z += (e.z - this.z) * t,
  39942. this
  39943. },
  39944. lerpVectors: function(e, t, i) {
  39945. return this.subVectors(t, e).multiplyScalar(i).add(e),
  39946. this
  39947. },
  39948. cross: function(e, t) {
  39949. if (void 0 !== t)
  39950. return console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),
  39951. this.crossVectors(e, t);
  39952. var i = this.x
  39953. , n = this.y
  39954. , r = this.z;
  39955. return this.x = n * e.z - r * e.y,
  39956. this.y = r * e.x - i * e.z,
  39957. this.z = i * e.y - n * e.x,
  39958. this
  39959. },
  39960. crossVectors: function(e, t) {
  39961. var i = e.x
  39962. , n = e.y
  39963. , r = e.z
  39964. , o = t.x
  39965. , a = t.y
  39966. , s = t.z;
  39967. return this.x = n * s - r * a,
  39968. this.y = r * o - i * s,
  39969. this.z = i * a - n * o,
  39970. this
  39971. },
  39972. projectOnVector: function() {
  39973. var e, t;
  39974. return function(i) {
  39975. return void 0 === e && (e = new n.Vector3),
  39976. e.copy(i).normalize(),
  39977. t = this.dot(e),
  39978. this.copy(e).multiplyScalar(t)
  39979. }
  39980. }(),
  39981. projectOnPlane: function() {
  39982. var e;
  39983. return function(t) {
  39984. return void 0 === e && (e = new n.Vector3),
  39985. e.copy(this).projectOnVector(t),
  39986. this.sub(e)
  39987. }
  39988. }(),
  39989. reflect: function() {
  39990. var e;
  39991. return function(t) {
  39992. return void 0 === e && (e = new n.Vector3),
  39993. this.sub(e.copy(t).multiplyScalar(2 * this.dot(t)))
  39994. }
  39995. }(),
  39996. angleTo: function(e) {
  39997. var t = this.dot(e) / Math.sqrt(this.lengthSq() * e.lengthSq());
  39998. return Math.acos(n.Math.clamp(t, -1, 1))
  39999. },
  40000. distanceTo: function(e) {
  40001. return Math.sqrt(this.distanceToSquared(e))
  40002. },
  40003. distanceToSquared: function(e) {
  40004. var t = this.x - e.x
  40005. , i = this.y - e.y
  40006. , n = this.z - e.z;
  40007. return t * t + i * i + n * n
  40008. },
  40009. setFromSpherical: function(e) {
  40010. var t = Math.sin(e.phi) * e.radius;
  40011. return this.x = t * Math.sin(e.theta),
  40012. this.y = Math.cos(e.phi) * e.radius,
  40013. this.z = t * Math.cos(e.theta),
  40014. this
  40015. },
  40016. setFromMatrixPosition: function(e) {
  40017. return this.setFromMatrixColumn(e, 3)
  40018. },
  40019. setFromMatrixScale: function(e) {
  40020. var t = this.setFromMatrixColumn(e, 0).length()
  40021. , i = this.setFromMatrixColumn(e, 1).length()
  40022. , n = this.setFromMatrixColumn(e, 2).length();
  40023. return this.x = t,
  40024. this.y = i,
  40025. this.z = n,
  40026. this
  40027. },
  40028. setFromMatrixColumn: function(e, t) {
  40029. return "number" == typeof e && (console.warn("THREE.Vector3: setFromMatrixColumn now expects ( matrix, index )."),
  40030. e = arguments[1],
  40031. t = arguments[0]),
  40032. this.fromArray(e.elements, 4 * t)
  40033. },
  40034. equals: function(e) {
  40035. return e.x === this.x && e.y === this.y && e.z === this.z
  40036. },
  40037. fromArray: function(e, t) {
  40038. return void 0 === t && (t = 0),
  40039. this.x = e[t],
  40040. this.y = e[t + 1],
  40041. this.z = e[t + 2],
  40042. this
  40043. },
  40044. toArray: function(e, t) {
  40045. return void 0 === e && (e = []),
  40046. void 0 === t && (t = 0),
  40047. e[t] = this.x,
  40048. e[t + 1] = this.y,
  40049. e[t + 2] = this.z,
  40050. e
  40051. },
  40052. fromAttribute: function(e, t, i) {
  40053. return void 0 === i && (i = 0),
  40054. t = t * e.itemSize + i,
  40055. this.x = e.array[t],
  40056. this.y = e.array[t + 1],
  40057. this.z = e.array[t + 2],
  40058. this
  40059. }
  40060. },
  40061. n.Vector4 = function(e, t, i, n) {
  40062. this.x = e || 0,
  40063. this.y = t || 0,
  40064. this.z = i || 0,
  40065. this.w = void 0 !== n ? n : 1
  40066. }
  40067. ,
  40068. n.Vector4.prototype = {
  40069. constructor: n.Vector4,
  40070. set: function(e, t, i, n) {
  40071. return this.x = e,
  40072. this.y = t,
  40073. this.z = i,
  40074. this.w = n,
  40075. this
  40076. },
  40077. setScalar: function(e) {
  40078. return this.x = e,
  40079. this.y = e,
  40080. this.z = e,
  40081. this.w = e,
  40082. this
  40083. },
  40084. setX: function(e) {
  40085. return this.x = e,
  40086. this
  40087. },
  40088. setY: function(e) {
  40089. return this.y = e,
  40090. this
  40091. },
  40092. setZ: function(e) {
  40093. return this.z = e,
  40094. this
  40095. },
  40096. setW: function(e) {
  40097. return this.w = e,
  40098. this
  40099. },
  40100. setComponent: function(e, t) {
  40101. switch (e) {
  40102. case 0:
  40103. this.x = t;
  40104. break;
  40105. case 1:
  40106. this.y = t;
  40107. break;
  40108. case 2:
  40109. this.z = t;
  40110. break;
  40111. case 3:
  40112. this.w = t;
  40113. break;
  40114. default:
  40115. throw new Error("index is out of range: " + e)
  40116. }
  40117. },
  40118. getComponent: function(e) {
  40119. switch (e) {
  40120. case 0:
  40121. return this.x;
  40122. case 1:
  40123. return this.y;
  40124. case 2:
  40125. return this.z;
  40126. case 3:
  40127. return this.w;
  40128. default:
  40129. throw new Error("index is out of range: " + e)
  40130. }
  40131. },
  40132. clone: function() {
  40133. return new this.constructor(this.x,this.y,this.z,this.w)
  40134. },
  40135. copy: function(e) {
  40136. return this.x = e.x,
  40137. this.y = e.y,
  40138. this.z = e.z,
  40139. this.w = void 0 !== e.w ? e.w : 1,
  40140. this
  40141. },
  40142. add: function(e, t) {
  40143. return void 0 !== t ? (console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),
  40144. this.addVectors(e, t)) : (this.x += e.x,
  40145. this.y += e.y,
  40146. this.z += e.z,
  40147. this.w += e.w,
  40148. this)
  40149. },
  40150. addScalar: function(e) {
  40151. return this.x += e,
  40152. this.y += e,
  40153. this.z += e,
  40154. this.w += e,
  40155. this
  40156. },
  40157. addVectors: function(e, t) {
  40158. return this.x = e.x + t.x,
  40159. this.y = e.y + t.y,
  40160. this.z = e.z + t.z,
  40161. this.w = e.w + t.w,
  40162. this
  40163. },
  40164. addScaledVector: function(e, t) {
  40165. return this.x += e.x * t,
  40166. this.y += e.y * t,
  40167. this.z += e.z * t,
  40168. this.w += e.w * t,
  40169. this
  40170. },
  40171. sub: function(e, t) {
  40172. return void 0 !== t ? (console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
  40173. this.subVectors(e, t)) : (this.x -= e.x,
  40174. this.y -= e.y,
  40175. this.z -= e.z,
  40176. this.w -= e.w,
  40177. this)
  40178. },
  40179. subScalar: function(e) {
  40180. return this.x -= e,
  40181. this.y -= e,
  40182. this.z -= e,
  40183. this.w -= e,
  40184. this
  40185. },
  40186. subVectors: function(e, t) {
  40187. return this.x = e.x - t.x,
  40188. this.y = e.y - t.y,
  40189. this.z = e.z - t.z,
  40190. this.w = e.w - t.w,
  40191. this
  40192. },
  40193. multiplyScalar: function(e) {
  40194. return isFinite(e) ? (this.x *= e,
  40195. this.y *= e,
  40196. this.z *= e,
  40197. this.w *= e) : (this.x = 0,
  40198. this.y = 0,
  40199. this.z = 0,
  40200. this.w = 0),
  40201. this
  40202. },
  40203. applyMatrix4: function(e) {
  40204. var t = this.x
  40205. , i = this.y
  40206. , n = this.z
  40207. , r = this.w
  40208. , o = e.elements;
  40209. return this.x = o[0] * t + o[4] * i + o[8] * n + o[12] * r,
  40210. this.y = o[1] * t + o[5] * i + o[9] * n + o[13] * r,
  40211. this.z = o[2] * t + o[6] * i + o[10] * n + o[14] * r,
  40212. this.w = o[3] * t + o[7] * i + o[11] * n + o[15] * r,
  40213. this
  40214. },
  40215. divideScalar: function(e) {
  40216. return this.multiplyScalar(1 / e)
  40217. },
  40218. setAxisAngleFromQuaternion: function(e) {
  40219. this.w = 2 * Math.acos(e.w);
  40220. var t = Math.sqrt(1 - e.w * e.w);
  40221. return t < 1e-4 ? (this.x = 1,
  40222. this.y = 0,
  40223. this.z = 0) : (this.x = e.x / t,
  40224. this.y = e.y / t,
  40225. this.z = e.z / t),
  40226. this
  40227. },
  40228. setAxisAngleFromRotationMatrix: function(e) {
  40229. 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];
  40230. if (Math.abs(c - u) < o && Math.abs(h - f) < o && Math.abs(p - g) < o) {
  40231. if (Math.abs(c + u) < a && Math.abs(h + f) < a && Math.abs(p + g) < a && Math.abs(l + d + m - 3) < a)
  40232. return this.set(1, 0, 0, 0),
  40233. this;
  40234. t = Math.PI;
  40235. var v = (l + 1) / 2
  40236. , A = (d + 1) / 2
  40237. , y = (m + 1) / 2
  40238. , C = (c + u) / 4
  40239. , I = (h + f) / 4
  40240. , E = (p + g) / 4;
  40241. return v > A && v > y ? v < o ? (i = 0,
  40242. n = .707106781,
  40243. r = .707106781) : (i = Math.sqrt(v),
  40244. n = C / i,
  40245. r = I / i) : A > y ? A < o ? (i = .707106781,
  40246. n = 0,
  40247. r = .707106781) : (n = Math.sqrt(A),
  40248. i = C / n,
  40249. r = E / n) : y < o ? (i = .707106781,
  40250. n = .707106781,
  40251. r = 0) : (r = Math.sqrt(y),
  40252. i = I / r,
  40253. n = E / r),
  40254. this.set(i, n, r, t),
  40255. this
  40256. }
  40257. var b = Math.sqrt((g - p) * (g - p) + (h - f) * (h - f) + (u - c) * (u - c));
  40258. return Math.abs(b) < .001 && (b = 1),
  40259. this.x = (g - p) / b,
  40260. this.y = (h - f) / b,
  40261. this.z = (u - c) / b,
  40262. this.w = Math.acos((l + d + m - 1) / 2),
  40263. this
  40264. },
  40265. min: function(e) {
  40266. return this.x = Math.min(this.x, e.x),
  40267. this.y = Math.min(this.y, e.y),
  40268. this.z = Math.min(this.z, e.z),
  40269. this.w = Math.min(this.w, e.w),
  40270. this
  40271. },
  40272. max: function(e) {
  40273. return this.x = Math.max(this.x, e.x),
  40274. this.y = Math.max(this.y, e.y),
  40275. this.z = Math.max(this.z, e.z),
  40276. this.w = Math.max(this.w, e.w),
  40277. this
  40278. },
  40279. clamp: function(e, t) {
  40280. return this.x = Math.max(e.x, Math.min(t.x, this.x)),
  40281. this.y = Math.max(e.y, Math.min(t.y, this.y)),
  40282. this.z = Math.max(e.z, Math.min(t.z, this.z)),
  40283. this.w = Math.max(e.w, Math.min(t.w, this.w)),
  40284. this
  40285. },
  40286. clampScalar: function() {
  40287. var e, t;
  40288. return function(i, r) {
  40289. return void 0 === e && (e = new n.Vector4,
  40290. t = new n.Vector4),
  40291. e.set(i, i, i, i),
  40292. t.set(r, r, r, r),
  40293. this.clamp(e, t)
  40294. }
  40295. }(),
  40296. floor: function() {
  40297. return this.x = Math.floor(this.x),
  40298. this.y = Math.floor(this.y),
  40299. this.z = Math.floor(this.z),
  40300. this.w = Math.floor(this.w),
  40301. this
  40302. },
  40303. ceil: function() {
  40304. return this.x = Math.ceil(this.x),
  40305. this.y = Math.ceil(this.y),
  40306. this.z = Math.ceil(this.z),
  40307. this.w = Math.ceil(this.w),
  40308. this
  40309. },
  40310. round: function() {
  40311. return this.x = Math.round(this.x),
  40312. this.y = Math.round(this.y),
  40313. this.z = Math.round(this.z),
  40314. this.w = Math.round(this.w),
  40315. this
  40316. },
  40317. roundToZero: function() {
  40318. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x),
  40319. this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y),
  40320. this.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z),
  40321. this.w = this.w < 0 ? Math.ceil(this.w) : Math.floor(this.w),
  40322. this
  40323. },
  40324. negate: function() {
  40325. return this.x = -this.x,
  40326. this.y = -this.y,
  40327. this.z = -this.z,
  40328. this.w = -this.w,
  40329. this
  40330. },
  40331. dot: function(e) {
  40332. return this.x * e.x + this.y * e.y + this.z * e.z + this.w * e.w
  40333. },
  40334. lengthSq: function() {
  40335. return this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w
  40336. },
  40337. length: function() {
  40338. return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w)
  40339. },
  40340. lengthManhattan: function() {
  40341. return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z) + Math.abs(this.w)
  40342. },
  40343. normalize: function() {
  40344. return this.divideScalar(this.length())
  40345. },
  40346. setLength: function(e) {
  40347. return this.multiplyScalar(e / this.length())
  40348. },
  40349. lerp: function(e, t) {
  40350. return this.x += (e.x - this.x) * t,
  40351. this.y += (e.y - this.y) * t,
  40352. this.z += (e.z - this.z) * t,
  40353. this.w += (e.w - this.w) * t,
  40354. this
  40355. },
  40356. lerpVectors: function(e, t, i) {
  40357. return this.subVectors(t, e).multiplyScalar(i).add(e),
  40358. this
  40359. },
  40360. equals: function(e) {
  40361. return e.x === this.x && e.y === this.y && e.z === this.z && e.w === this.w
  40362. },
  40363. fromArray: function(e, t) {
  40364. return void 0 === t && (t = 0),
  40365. this.x = e[t],
  40366. this.y = e[t + 1],
  40367. this.z = e[t + 2],
  40368. this.w = e[t + 3],
  40369. this
  40370. },
  40371. toArray: function(e, t) {
  40372. return void 0 === e && (e = []),
  40373. void 0 === t && (t = 0),
  40374. e[t] = this.x,
  40375. e[t + 1] = this.y,
  40376. e[t + 2] = this.z,
  40377. e[t + 3] = this.w,
  40378. e
  40379. },
  40380. fromAttribute: function(e, t, i) {
  40381. return void 0 === i && (i = 0),
  40382. t = t * e.itemSize + i,
  40383. this.x = e.array[t],
  40384. this.y = e.array[t + 1],
  40385. this.z = e.array[t + 2],
  40386. this.w = e.array[t + 3],
  40387. this
  40388. }
  40389. },
  40390. n.Euler = function(e, t, i, r) {
  40391. this._x = e || 0,
  40392. this._y = t || 0,
  40393. this._z = i || 0,
  40394. this._order = r || n.Euler.DefaultOrder
  40395. }
  40396. ,
  40397. n.Euler.RotationOrders = ["XYZ", "YZX", "ZXY", "XZY", "YXZ", "ZYX"],
  40398. n.Euler.DefaultOrder = "XYZ",
  40399. n.Euler.prototype = {
  40400. constructor: n.Euler,
  40401. get x() {
  40402. return this._x
  40403. },
  40404. set x(e) {
  40405. this._x = e,
  40406. this.onChangeCallback()
  40407. },
  40408. get y() {
  40409. return this._y
  40410. },
  40411. set y(e) {
  40412. this._y = e,
  40413. this.onChangeCallback()
  40414. },
  40415. get z() {
  40416. return this._z
  40417. },
  40418. set z(e) {
  40419. this._z = e,
  40420. this.onChangeCallback()
  40421. },
  40422. get order() {
  40423. return this._order
  40424. },
  40425. set order(e) {
  40426. this._order = e,
  40427. this.onChangeCallback()
  40428. },
  40429. set: function(e, t, i, n) {
  40430. return this._x = e,
  40431. this._y = t,
  40432. this._z = i,
  40433. this._order = n || this._order,
  40434. this.onChangeCallback(),
  40435. this
  40436. },
  40437. clone: function() {
  40438. return new this.constructor(this._x,this._y,this._z,this._order)
  40439. },
  40440. copy: function(e) {
  40441. return this._x = e._x,
  40442. this._y = e._y,
  40443. this._z = e._z,
  40444. this._order = e._order,
  40445. this.onChangeCallback(),
  40446. this
  40447. },
  40448. setFromRotationMatrix: function(e, t, i) {
  40449. var r = n.Math.clamp
  40450. , o = e.elements
  40451. , a = o[0]
  40452. , s = o[4]
  40453. , l = o[8]
  40454. , c = o[1]
  40455. , h = o[5]
  40456. , u = o[9]
  40457. , d = o[2]
  40458. , p = o[6]
  40459. , f = o[10];
  40460. return t = t || this._order,
  40461. "XYZ" === t ? (this._y = Math.asin(r(l, -1, 1)),
  40462. Math.abs(l) < .99999 ? (this._x = Math.atan2(-u, f),
  40463. this._z = Math.atan2(-s, a)) : (this._x = Math.atan2(p, h),
  40464. this._z = 0)) : "YXZ" === t ? (this._x = Math.asin(-r(u, -1, 1)),
  40465. Math.abs(u) < .99999 ? (this._y = Math.atan2(l, f),
  40466. this._z = Math.atan2(c, h)) : (this._y = Math.atan2(-d, a),
  40467. this._z = 0)) : "ZXY" === t ? (this._x = Math.asin(r(p, -1, 1)),
  40468. Math.abs(p) < .99999 ? (this._y = Math.atan2(-d, f),
  40469. this._z = Math.atan2(-s, h)) : (this._y = 0,
  40470. this._z = Math.atan2(c, a))) : "ZYX" === t ? (this._y = Math.asin(-r(d, -1, 1)),
  40471. Math.abs(d) < .99999 ? (this._x = Math.atan2(p, f),
  40472. this._z = Math.atan2(c, a)) : (this._x = 0,
  40473. this._z = Math.atan2(-s, h))) : "YZX" === t ? (this._z = Math.asin(r(c, -1, 1)),
  40474. Math.abs(c) < .99999 ? (this._x = Math.atan2(-u, h),
  40475. this._y = Math.atan2(-d, a)) : (this._x = 0,
  40476. this._y = Math.atan2(l, f))) : "XZY" === t ? (this._z = Math.asin(-r(s, -1, 1)),
  40477. Math.abs(s) < .99999 ? (this._x = Math.atan2(p, h),
  40478. this._y = Math.atan2(l, a)) : (this._x = Math.atan2(-u, f),
  40479. this._y = 0)) : console.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: " + t),
  40480. this._order = t,
  40481. i !== !1 && this.onChangeCallback(),
  40482. this
  40483. },
  40484. setFromQuaternion: function() {
  40485. var e;
  40486. return function(t, i, r) {
  40487. return void 0 === e && (e = new n.Matrix4),
  40488. e.makeRotationFromQuaternion(t),
  40489. this.setFromRotationMatrix(e, i, r),
  40490. this
  40491. }
  40492. }(),
  40493. setFromVector3: function(e, t) {
  40494. return this.set(e.x, e.y, e.z, t || this._order)
  40495. },
  40496. reorder: function() {
  40497. var e = new n.Quaternion;
  40498. return function(t) {
  40499. e.setFromEuler(this),
  40500. this.setFromQuaternion(e, t)
  40501. }
  40502. }(),
  40503. equals: function(e) {
  40504. return e._x === this._x && e._y === this._y && e._z === this._z && e._order === this._order
  40505. },
  40506. fromArray: function(e) {
  40507. return this._x = e[0],
  40508. this._y = e[1],
  40509. this._z = e[2],
  40510. void 0 !== e[3] && (this._order = e[3]),
  40511. this.onChangeCallback(),
  40512. this
  40513. },
  40514. toArray: function(e, t) {
  40515. return void 0 === e && (e = []),
  40516. void 0 === t && (t = 0),
  40517. e[t] = this._x,
  40518. e[t + 1] = this._y,
  40519. e[t + 2] = this._z,
  40520. e[t + 3] = this._order,
  40521. e
  40522. },
  40523. toVector3: function(e) {
  40524. return e ? e.set(this._x, this._y, this._z) : new n.Vector3(this._x,this._y,this._z)
  40525. },
  40526. onChange: function(e) {
  40527. return this.onChangeCallback = e,
  40528. this
  40529. },
  40530. onChangeCallback: function() {}
  40531. },
  40532. n.Line3 = function(e, t) {
  40533. this.start = void 0 !== e ? e : new n.Vector3,
  40534. this.end = void 0 !== t ? t : new n.Vector3
  40535. }
  40536. ,
  40537. n.Line3.prototype = {
  40538. constructor: n.Line3,
  40539. set: function(e, t) {
  40540. return this.start.copy(e),
  40541. this.end.copy(t),
  40542. this
  40543. },
  40544. clone: function() {
  40545. return (new this.constructor).copy(this)
  40546. },
  40547. copy: function(e) {
  40548. return this.start.copy(e.start),
  40549. this.end.copy(e.end),
  40550. this
  40551. },
  40552. center: function(e) {
  40553. var t = e || new n.Vector3;
  40554. return t.addVectors(this.start, this.end).multiplyScalar(.5)
  40555. },
  40556. delta: function(e) {
  40557. var t = e || new n.Vector3;
  40558. return t.subVectors(this.end, this.start)
  40559. },
  40560. distanceSq: function() {
  40561. return this.start.distanceToSquared(this.end)
  40562. },
  40563. distance: function() {
  40564. return this.start.distanceTo(this.end)
  40565. },
  40566. at: function(e, t) {
  40567. var i = t || new n.Vector3;
  40568. return this.delta(i).multiplyScalar(e).add(this.start)
  40569. },
  40570. closestPointToPointParameter: function() {
  40571. var e = new n.Vector3
  40572. , t = new n.Vector3;
  40573. return function(i, r) {
  40574. e.subVectors(i, this.start),
  40575. t.subVectors(this.end, this.start);
  40576. var o = t.dot(t)
  40577. , a = t.dot(e)
  40578. , s = a / o;
  40579. return r && (s = n.Math.clamp(s, 0, 1)),
  40580. s
  40581. }
  40582. }(),
  40583. closestPointToPoint: function(e, t, i) {
  40584. var r = this.closestPointToPointParameter(e, t)
  40585. , o = i || new n.Vector3;
  40586. return this.delta(o).multiplyScalar(r).add(this.start)
  40587. },
  40588. applyMatrix4: function(e) {
  40589. return this.start.applyMatrix4(e),
  40590. this.end.applyMatrix4(e),
  40591. this
  40592. },
  40593. equals: function(e) {
  40594. return e.start.equals(this.start) && e.end.equals(this.end)
  40595. }
  40596. },
  40597. n.Box2 = function(e, t) {
  40598. this.min = void 0 !== e ? e : new n.Vector2(+(1 / 0),+(1 / 0)),
  40599. this.max = void 0 !== t ? t : new n.Vector2(-(1 / 0),-(1 / 0))
  40600. }
  40601. ,
  40602. n.Box2.prototype = {
  40603. constructor: n.Box2,
  40604. set: function(e, t) {
  40605. return this.min.copy(e),
  40606. this.max.copy(t),
  40607. this
  40608. },
  40609. setFromPoints: function(e) {
  40610. this.makeEmpty();
  40611. for (var t = 0, i = e.length; t < i; t++)
  40612. this.expandByPoint(e[t]);
  40613. return this
  40614. },
  40615. setFromCenterAndSize: function() {
  40616. var e = new n.Vector2;
  40617. return function(t, i) {
  40618. var n = e.copy(i).multiplyScalar(.5);
  40619. return this.min.copy(t).sub(n),
  40620. this.max.copy(t).add(n),
  40621. this
  40622. }
  40623. }(),
  40624. clone: function() {
  40625. return (new this.constructor).copy(this)
  40626. },
  40627. copy: function(e) {
  40628. return this.min.copy(e.min),
  40629. this.max.copy(e.max),
  40630. this
  40631. },
  40632. makeEmpty: function() {
  40633. return this.min.x = this.min.y = +(1 / 0),
  40634. this.max.x = this.max.y = -(1 / 0),
  40635. this
  40636. },
  40637. isEmpty: function() {
  40638. return this.max.x < this.min.x || this.max.y < this.min.y
  40639. },
  40640. center: function(e) {
  40641. var t = e || new n.Vector2;
  40642. return t.addVectors(this.min, this.max).multiplyScalar(.5)
  40643. },
  40644. size: function(e) {
  40645. var t = e || new n.Vector2;
  40646. return t.subVectors(this.max, this.min)
  40647. },
  40648. expandByPoint: function(e) {
  40649. return this.min.min(e),
  40650. this.max.max(e),
  40651. this
  40652. },
  40653. expandByVector: function(e) {
  40654. return this.min.sub(e),
  40655. this.max.add(e),
  40656. this
  40657. },
  40658. expandByScalar: function(e) {
  40659. return this.min.addScalar(-e),
  40660. this.max.addScalar(e),
  40661. this
  40662. },
  40663. containsPoint: function(e) {
  40664. return !(e.x < this.min.x || e.x > this.max.x || e.y < this.min.y || e.y > this.max.y)
  40665. },
  40666. containsBox: function(e) {
  40667. 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
  40668. },
  40669. getParameter: function(e, t) {
  40670. var i = t || new n.Vector2;
  40671. 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))
  40672. },
  40673. intersectsBox: function(e) {
  40674. 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)
  40675. },
  40676. clampPoint: function(e, t) {
  40677. var i = t || new n.Vector2;
  40678. return i.copy(e).clamp(this.min, this.max)
  40679. },
  40680. distanceToPoint: function() {
  40681. var e = new n.Vector2;
  40682. return function(t) {
  40683. var i = e.copy(t).clamp(this.min, this.max);
  40684. return i.sub(t).length()
  40685. }
  40686. }(),
  40687. intersect: function(e) {
  40688. return this.min.max(e.min),
  40689. this.max.min(e.max),
  40690. this
  40691. },
  40692. union: function(e) {
  40693. return this.min.min(e.min),
  40694. this.max.max(e.max),
  40695. this
  40696. },
  40697. translate: function(e) {
  40698. return this.min.add(e),
  40699. this.max.add(e),
  40700. this
  40701. },
  40702. equals: function(e) {
  40703. return e.min.equals(this.min) && e.max.equals(this.max)
  40704. }
  40705. },
  40706. n.Box3 = function(e, t) {
  40707. this.min = void 0 !== e ? e : new n.Vector3(+(1 / 0),+(1 / 0),+(1 / 0)),
  40708. this.max = void 0 !== t ? t : new n.Vector3(-(1 / 0),-(1 / 0),-(1 / 0))
  40709. }
  40710. ,
  40711. n.Box3.prototype = {
  40712. constructor: n.Box3,
  40713. set: function(e, t) {
  40714. return this.min.copy(e),
  40715. this.max.copy(t),
  40716. this
  40717. },
  40718. setFromArray: function(e) {
  40719. this.makeEmpty();
  40720. 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) {
  40721. var c = e[s]
  40722. , h = e[s + 1]
  40723. , u = e[s + 2];
  40724. c < t && (t = c),
  40725. h < i && (i = h),
  40726. u < n && (n = u),
  40727. c > r && (r = c),
  40728. h > o && (o = h),
  40729. u > a && (a = u)
  40730. }
  40731. this.min.set(t, i, n),
  40732. this.max.set(r, o, a)
  40733. },
  40734. setFromPoints: function(e) {
  40735. this.makeEmpty();
  40736. for (var t = 0, i = e.length; t < i; t++)
  40737. this.expandByPoint(e[t]);
  40738. return this
  40739. },
  40740. setFromCenterAndSize: function() {
  40741. var e = new n.Vector3;
  40742. return function(t, i) {
  40743. var n = e.copy(i).multiplyScalar(.5);
  40744. return this.min.copy(t).sub(n),
  40745. this.max.copy(t).add(n),
  40746. this
  40747. }
  40748. }(),
  40749. setFromObject: function() {
  40750. var e;
  40751. return function(t) {
  40752. void 0 === e && (e = new n.Box3);
  40753. var i = this;
  40754. return this.makeEmpty(),
  40755. t.updateMatrixWorld(!0),
  40756. t.traverse(function(t) {
  40757. var n = t.geometry;
  40758. void 0 !== n && (null === n.boundingBox && n.computeBoundingBox(),
  40759. n.boundingBox.isEmpty() === !1 && (e.copy(n.boundingBox),
  40760. e.applyMatrix4(t.matrixWorld),
  40761. i.union(e)))
  40762. }),
  40763. this
  40764. }
  40765. }(),
  40766. clone: function() {
  40767. return (new this.constructor).copy(this)
  40768. },
  40769. copy: function(e) {
  40770. return this.min.copy(e.min),
  40771. this.max.copy(e.max),
  40772. this
  40773. },
  40774. makeEmpty: function() {
  40775. return this.min.x = this.min.y = this.min.z = +(1 / 0),
  40776. this.max.x = this.max.y = this.max.z = -(1 / 0),
  40777. this
  40778. },
  40779. isEmpty: function() {
  40780. return this.max.x < this.min.x || this.max.y < this.min.y || this.max.z < this.min.z
  40781. },
  40782. center: function(e) {
  40783. var t = e || new n.Vector3;
  40784. return t.addVectors(this.min, this.max).multiplyScalar(.5)
  40785. },
  40786. size: function(e) {
  40787. var t = e || new n.Vector3;
  40788. return t.subVectors(this.max, this.min)
  40789. },
  40790. expandByPoint: function(e) {
  40791. return this.min.min(e),
  40792. this.max.max(e),
  40793. this
  40794. },
  40795. expandByVector: function(e) {
  40796. return this.min.sub(e),
  40797. this.max.add(e),
  40798. this
  40799. },
  40800. expandByScalar: function(e) {
  40801. return this.min.addScalar(-e),
  40802. this.max.addScalar(e),
  40803. this
  40804. },
  40805. containsPoint: function(e) {
  40806. 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)
  40807. },
  40808. containsBox: function(e) {
  40809. 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
  40810. },
  40811. getParameter: function(e, t) {
  40812. var i = t || new n.Vector3;
  40813. 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))
  40814. },
  40815. intersectsBox: function(e) {
  40816. 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)
  40817. },
  40818. intersectsSphere: function() {
  40819. var e;
  40820. return function(t) {
  40821. return void 0 === e && (e = new n.Vector3),
  40822. this.clampPoint(t.center, e),
  40823. e.distanceToSquared(t.center) <= t.radius * t.radius
  40824. }
  40825. }(),
  40826. intersectsPlane: function(e) {
  40827. var t, i;
  40828. return e.normal.x > 0 ? (t = e.normal.x * this.min.x,
  40829. i = e.normal.x * this.max.x) : (t = e.normal.x * this.max.x,
  40830. i = e.normal.x * this.min.x),
  40831. e.normal.y > 0 ? (t += e.normal.y * this.min.y,
  40832. i += e.normal.y * this.max.y) : (t += e.normal.y * this.max.y,
  40833. i += e.normal.y * this.min.y),
  40834. e.normal.z > 0 ? (t += e.normal.z * this.min.z,
  40835. i += e.normal.z * this.max.z) : (t += e.normal.z * this.max.z,
  40836. i += e.normal.z * this.min.z),
  40837. t <= e.constant && i >= e.constant
  40838. },
  40839. clampPoint: function(e, t) {
  40840. var i = t || new n.Vector3;
  40841. return i.copy(e).clamp(this.min, this.max)
  40842. },
  40843. distanceToPoint: function() {
  40844. var e = new n.Vector3;
  40845. return function(t) {
  40846. var i = e.copy(t).clamp(this.min, this.max);
  40847. return i.sub(t).length()
  40848. }
  40849. }(),
  40850. getBoundingSphere: function() {
  40851. var e = new n.Vector3;
  40852. return function(t) {
  40853. var i = t || new n.Sphere;
  40854. return i.center = this.center(),
  40855. i.radius = .5 * this.size(e).length(),
  40856. i
  40857. }
  40858. }(),
  40859. intersect: function(e) {
  40860. return this.min.max(e.min),
  40861. this.max.min(e.max),
  40862. this
  40863. },
  40864. union: function(e) {
  40865. return this.min.min(e.min),
  40866. this.max.max(e.max),
  40867. this
  40868. },
  40869. applyMatrix4: function() {
  40870. 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];
  40871. return function(t) {
  40872. return e[0].set(this.min.x, this.min.y, this.min.z).applyMatrix4(t),
  40873. e[1].set(this.min.x, this.min.y, this.max.z).applyMatrix4(t),
  40874. e[2].set(this.min.x, this.max.y, this.min.z).applyMatrix4(t),
  40875. e[3].set(this.min.x, this.max.y, this.max.z).applyMatrix4(t),
  40876. e[4].set(this.max.x, this.min.y, this.min.z).applyMatrix4(t),
  40877. e[5].set(this.max.x, this.min.y, this.max.z).applyMatrix4(t),
  40878. e[6].set(this.max.x, this.max.y, this.min.z).applyMatrix4(t),
  40879. e[7].set(this.max.x, this.max.y, this.max.z).applyMatrix4(t),
  40880. this.makeEmpty(),
  40881. this.setFromPoints(e),
  40882. this
  40883. }
  40884. }(),
  40885. translate: function(e) {
  40886. return this.min.add(e),
  40887. this.max.add(e),
  40888. this
  40889. },
  40890. equals: function(e) {
  40891. return e.min.equals(this.min) && e.max.equals(this.max)
  40892. }
  40893. },
  40894. n.Matrix3 = function() {
  40895. this.elements = new Float32Array([1, 0, 0, 0, 1, 0, 0, 0, 1]),
  40896. arguments.length > 0 && console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")
  40897. }
  40898. ,
  40899. n.Matrix3.prototype = {
  40900. constructor: n.Matrix3,
  40901. set: function(e, t, i, n, r, o, a, s, l) {
  40902. var c = this.elements;
  40903. return c[0] = e,
  40904. c[1] = n,
  40905. c[2] = a,
  40906. c[3] = t,
  40907. c[4] = r,
  40908. c[5] = s,
  40909. c[6] = i,
  40910. c[7] = o,
  40911. c[8] = l,
  40912. this
  40913. },
  40914. identity: function() {
  40915. return this.set(1, 0, 0, 0, 1, 0, 0, 0, 1),
  40916. this
  40917. },
  40918. clone: function() {
  40919. return (new this.constructor).fromArray(this.elements)
  40920. },
  40921. copy: function(e) {
  40922. var t = e.elements;
  40923. return this.set(t[0], t[3], t[6], t[1], t[4], t[7], t[2], t[5], t[8]),
  40924. this
  40925. },
  40926. setFromMatrix4: function(e) {
  40927. var t = e.elements;
  40928. return this.set(t[0], t[4], t[8], t[1], t[5], t[9], t[2], t[6], t[10]),
  40929. this
  40930. },
  40931. applyToVector3Array: function() {
  40932. var e;
  40933. return function(t, i, r) {
  40934. void 0 === e && (e = new n.Vector3),
  40935. void 0 === i && (i = 0),
  40936. void 0 === r && (r = t.length);
  40937. for (var o = 0, a = i; o < r; o += 3,
  40938. a += 3)
  40939. e.fromArray(t, a),
  40940. e.applyMatrix3(this),
  40941. e.toArray(t, a);
  40942. return t
  40943. }
  40944. }(),
  40945. applyToBuffer: function() {
  40946. var e;
  40947. return function(t, i, r) {
  40948. void 0 === e && (e = new n.Vector3),
  40949. void 0 === i && (i = 0),
  40950. void 0 === r && (r = t.length / t.itemSize);
  40951. for (var o = 0, a = i; o < r; o++,
  40952. a++)
  40953. e.x = t.getX(a),
  40954. e.y = t.getY(a),
  40955. e.z = t.getZ(a),
  40956. e.applyMatrix3(this),
  40957. t.setXYZ(e.x, e.y, e.z);
  40958. return t
  40959. }
  40960. }(),
  40961. multiplyScalar: function(e) {
  40962. var t = this.elements;
  40963. return t[0] *= e,
  40964. t[3] *= e,
  40965. t[6] *= e,
  40966. t[1] *= e,
  40967. t[4] *= e,
  40968. t[7] *= e,
  40969. t[2] *= e,
  40970. t[5] *= e,
  40971. t[8] *= e,
  40972. this
  40973. },
  40974. determinant: function() {
  40975. var e = this.elements
  40976. , t = e[0]
  40977. , i = e[1]
  40978. , n = e[2]
  40979. , r = e[3]
  40980. , o = e[4]
  40981. , a = e[5]
  40982. , s = e[6]
  40983. , l = e[7]
  40984. , c = e[8];
  40985. return t * o * c - t * a * l - i * r * c + i * a * s + n * r * l - n * o * s
  40986. },
  40987. getInverse: function(e, t) {
  40988. e instanceof n.Matrix4 && console.warn("THREE.Matrix3.getInverse no longer takes a Matrix4 argument.");
  40989. var i = e.elements
  40990. , r = this.elements
  40991. , o = i[0]
  40992. , a = i[1]
  40993. , s = i[2]
  40994. , l = i[3]
  40995. , c = i[4]
  40996. , h = i[5]
  40997. , u = i[6]
  40998. , d = i[7]
  40999. , p = i[8]
  41000. , f = p * c - h * d
  41001. , g = h * u - p * l
  41002. , m = d * l - c * u
  41003. , v = o * f + a * g + s * m;
  41004. if (0 === v) {
  41005. var A = "THREE.Matrix3.getInverse(): can't invert matrix, determinant is 0";
  41006. if (t)
  41007. throw new Error(A);
  41008. return console.warn(A),
  41009. this.identity()
  41010. }
  41011. return r[0] = f,
  41012. r[1] = s * d - p * a,
  41013. r[2] = h * a - s * c,
  41014. r[3] = g,
  41015. r[4] = p * o - s * u,
  41016. r[5] = s * l - h * o,
  41017. r[6] = m,
  41018. r[7] = a * u - d * o,
  41019. r[8] = c * o - a * l,
  41020. this.multiplyScalar(1 / v)
  41021. },
  41022. transpose: function() {
  41023. var e, t = this.elements;
  41024. return e = t[1],
  41025. t[1] = t[3],
  41026. t[3] = e,
  41027. e = t[2],
  41028. t[2] = t[6],
  41029. t[6] = e,
  41030. e = t[5],
  41031. t[5] = t[7],
  41032. t[7] = e,
  41033. this
  41034. },
  41035. flattenToArrayOffset: function(e, t) {
  41036. var i = this.elements;
  41037. return e[t] = i[0],
  41038. e[t + 1] = i[1],
  41039. e[t + 2] = i[2],
  41040. e[t + 3] = i[3],
  41041. e[t + 4] = i[4],
  41042. e[t + 5] = i[5],
  41043. e[t + 6] = i[6],
  41044. e[t + 7] = i[7],
  41045. e[t + 8] = i[8],
  41046. e
  41047. },
  41048. getNormalMatrix: function(e) {
  41049. return this.setFromMatrix4(e).getInverse(this).transpose()
  41050. },
  41051. transposeIntoArray: function(e) {
  41052. var t = this.elements;
  41053. return e[0] = t[0],
  41054. e[1] = t[3],
  41055. e[2] = t[6],
  41056. e[3] = t[1],
  41057. e[4] = t[4],
  41058. e[5] = t[7],
  41059. e[6] = t[2],
  41060. e[7] = t[5],
  41061. e[8] = t[8],
  41062. this
  41063. },
  41064. fromArray: function(e) {
  41065. return this.elements.set(e),
  41066. this
  41067. },
  41068. toArray: function() {
  41069. var e = this.elements;
  41070. return [e[0], e[1], e[2], e[3], e[4], e[5], e[6], e[7], e[8]]
  41071. }
  41072. },
  41073. n.Matrix4 = function() {
  41074. this.elements = new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]),
  41075. arguments.length > 0 && console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")
  41076. }
  41077. ,
  41078. n.Matrix4.prototype = {
  41079. constructor: n.Matrix4,
  41080. set: function(e, t, i, n, r, o, a, s, l, c, h, u, d, p, f, g) {
  41081. var m = this.elements;
  41082. return m[0] = e,
  41083. m[4] = t,
  41084. m[8] = i,
  41085. m[12] = n,
  41086. m[1] = r,
  41087. m[5] = o,
  41088. m[9] = a,
  41089. m[13] = s,
  41090. m[2] = l,
  41091. m[6] = c,
  41092. m[10] = h,
  41093. m[14] = u,
  41094. m[3] = d,
  41095. m[7] = p,
  41096. m[11] = f,
  41097. m[15] = g,
  41098. this
  41099. },
  41100. identity: function() {
  41101. return this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
  41102. this
  41103. },
  41104. clone: function() {
  41105. return (new n.Matrix4).fromArray(this.elements)
  41106. },
  41107. copy: function(e) {
  41108. return this.elements.set(e.elements),
  41109. this
  41110. },
  41111. copyPosition: function(e) {
  41112. var t = this.elements
  41113. , i = e.elements;
  41114. return t[12] = i[12],
  41115. t[13] = i[13],
  41116. t[14] = i[14],
  41117. this
  41118. },
  41119. extractBasis: function(e, t, i) {
  41120. return e.setFromMatrixColumn(this, 0),
  41121. t.setFromMatrixColumn(this, 1),
  41122. i.setFromMatrixColumn(this, 2),
  41123. this
  41124. },
  41125. makeBasis: function(e, t, i) {
  41126. 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),
  41127. this
  41128. },
  41129. extractRotation: function() {
  41130. var e;
  41131. return function(t) {
  41132. void 0 === e && (e = new n.Vector3);
  41133. var i = this.elements
  41134. , r = t.elements
  41135. , o = 1 / e.setFromMatrixColumn(t, 0).length()
  41136. , a = 1 / e.setFromMatrixColumn(t, 1).length()
  41137. , s = 1 / e.setFromMatrixColumn(t, 2).length();
  41138. return i[0] = r[0] * o,
  41139. i[1] = r[1] * o,
  41140. i[2] = r[2] * o,
  41141. i[4] = r[4] * a,
  41142. i[5] = r[5] * a,
  41143. i[6] = r[6] * a,
  41144. i[8] = r[8] * s,
  41145. i[9] = r[9] * s,
  41146. i[10] = r[10] * s,
  41147. this
  41148. }
  41149. }(),
  41150. makeRotationFromEuler: function(e) {
  41151. e instanceof n.Euler == !1 && console.error("THREE.Matrix: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");
  41152. var t = this.elements
  41153. , i = e.x
  41154. , r = e.y
  41155. , o = e.z
  41156. , a = Math.cos(i)
  41157. , s = Math.sin(i)
  41158. , l = Math.cos(r)
  41159. , c = Math.sin(r)
  41160. , h = Math.cos(o)
  41161. , u = Math.sin(o);
  41162. if ("XYZ" === e.order) {
  41163. var d = a * h
  41164. , p = a * u
  41165. , f = s * h
  41166. , g = s * u;
  41167. t[0] = l * h,
  41168. t[4] = -l * u,
  41169. t[8] = c,
  41170. t[1] = p + f * c,
  41171. t[5] = d - g * c,
  41172. t[9] = -s * l,
  41173. t[2] = g - d * c,
  41174. t[6] = f + p * c,
  41175. t[10] = a * l
  41176. } else if ("YXZ" === e.order) {
  41177. var m = l * h
  41178. , v = l * u
  41179. , A = c * h
  41180. , y = c * u;
  41181. t[0] = m + y * s,
  41182. t[4] = A * s - v,
  41183. t[8] = a * c,
  41184. t[1] = a * u,
  41185. t[5] = a * h,
  41186. t[9] = -s,
  41187. t[2] = v * s - A,
  41188. t[6] = y + m * s,
  41189. t[10] = a * l
  41190. } else if ("ZXY" === e.order) {
  41191. var m = l * h
  41192. , v = l * u
  41193. , A = c * h
  41194. , y = c * u;
  41195. t[0] = m - y * s,
  41196. t[4] = -a * u,
  41197. t[8] = A + v * s,
  41198. t[1] = v + A * s,
  41199. t[5] = a * h,
  41200. t[9] = y - m * s,
  41201. t[2] = -a * c,
  41202. t[6] = s,
  41203. t[10] = a * l
  41204. } else if ("ZYX" === e.order) {
  41205. var d = a * h
  41206. , p = a * u
  41207. , f = s * h
  41208. , g = s * u;
  41209. t[0] = l * h,
  41210. t[4] = f * c - p,
  41211. t[8] = d * c + g,
  41212. t[1] = l * u,
  41213. t[5] = g * c + d,
  41214. t[9] = p * c - f,
  41215. t[2] = -c,
  41216. t[6] = s * l,
  41217. t[10] = a * l
  41218. } else if ("YZX" === e.order) {
  41219. var C = a * l
  41220. , I = a * c
  41221. , E = s * l
  41222. , b = s * c;
  41223. t[0] = l * h,
  41224. t[4] = b - C * u,
  41225. t[8] = E * u + I,
  41226. t[1] = u,
  41227. t[5] = a * h,
  41228. t[9] = -s * h,
  41229. t[2] = -c * h,
  41230. t[6] = I * u + E,
  41231. t[10] = C - b * u
  41232. } else if ("XZY" === e.order) {
  41233. var C = a * l
  41234. , I = a * c
  41235. , E = s * l
  41236. , b = s * c;
  41237. t[0] = l * h,
  41238. t[4] = -u,
  41239. t[8] = c * h,
  41240. t[1] = C * u + b,
  41241. t[5] = a * h,
  41242. t[9] = I * u - E,
  41243. t[2] = E * u - I,
  41244. t[6] = s * h,
  41245. t[10] = b * u + C
  41246. }
  41247. return t[3] = 0,
  41248. t[7] = 0,
  41249. t[11] = 0,
  41250. t[12] = 0,
  41251. t[13] = 0,
  41252. t[14] = 0,
  41253. t[15] = 1,
  41254. this
  41255. },
  41256. makeRotationFromQuaternion: function(e) {
  41257. var t = this.elements
  41258. , i = e.x
  41259. , n = e.y
  41260. , r = e.z
  41261. , o = e.w
  41262. , a = i + i
  41263. , s = n + n
  41264. , l = r + r
  41265. , c = i * a
  41266. , h = i * s
  41267. , u = i * l
  41268. , d = n * s
  41269. , p = n * l
  41270. , f = r * l
  41271. , g = o * a
  41272. , m = o * s
  41273. , v = o * l;
  41274. return t[0] = 1 - (d + f),
  41275. t[4] = h - v,
  41276. t[8] = u + m,
  41277. t[1] = h + v,
  41278. t[5] = 1 - (c + f),
  41279. t[9] = p - g,
  41280. t[2] = u - m,
  41281. t[6] = p + g,
  41282. t[10] = 1 - (c + d),
  41283. t[3] = 0,
  41284. t[7] = 0,
  41285. t[11] = 0,
  41286. t[12] = 0,
  41287. t[13] = 0,
  41288. t[14] = 0,
  41289. t[15] = 1,
  41290. this
  41291. },
  41292. lookAt: function() {
  41293. var e, t, i;
  41294. return function(r, o, a) {
  41295. void 0 === e && (e = new n.Vector3),
  41296. void 0 === t && (t = new n.Vector3),
  41297. void 0 === i && (i = new n.Vector3);
  41298. var s = this.elements;
  41299. return i.subVectors(r, o).normalize(),
  41300. 0 === i.lengthSq() && (i.z = 1),
  41301. e.crossVectors(a, i).normalize(),
  41302. 0 === e.lengthSq() && (i.x += 1e-4,
  41303. e.crossVectors(a, i).normalize()),
  41304. t.crossVectors(i, e),
  41305. s[0] = e.x,
  41306. s[4] = t.x,
  41307. s[8] = i.x,
  41308. s[1] = e.y,
  41309. s[5] = t.y,
  41310. s[9] = i.y,
  41311. s[2] = e.z,
  41312. s[6] = t.z,
  41313. s[10] = i.z,
  41314. this
  41315. }
  41316. }(),
  41317. multiply: function(e, t) {
  41318. return void 0 !== t ? (console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),
  41319. this.multiplyMatrices(e, t)) : this.multiplyMatrices(this, e)
  41320. },
  41321. multiplyMatrices: function(e, t) {
  41322. var i = e.elements
  41323. , n = t.elements
  41324. , r = this.elements
  41325. , o = i[0]
  41326. , a = i[4]
  41327. , s = i[8]
  41328. , l = i[12]
  41329. , c = i[1]
  41330. , h = i[5]
  41331. , u = i[9]
  41332. , d = i[13]
  41333. , p = i[2]
  41334. , f = i[6]
  41335. , g = i[10]
  41336. , m = i[14]
  41337. , v = i[3]
  41338. , A = i[7]
  41339. , y = i[11]
  41340. , C = i[15]
  41341. , I = n[0]
  41342. , E = n[4]
  41343. , b = n[8]
  41344. , w = n[12]
  41345. , _ = n[1]
  41346. , T = n[5]
  41347. , x = n[9]
  41348. , S = n[13]
  41349. , M = n[2]
  41350. , R = n[6]
  41351. , P = n[10]
  41352. , O = n[14]
  41353. , L = n[3]
  41354. , D = n[7]
  41355. , N = n[11]
  41356. , B = n[15];
  41357. return r[0] = o * I + a * _ + s * M + l * L,
  41358. r[4] = o * E + a * T + s * R + l * D,
  41359. r[8] = o * b + a * x + s * P + l * N,
  41360. r[12] = o * w + a * S + s * O + l * B,
  41361. r[1] = c * I + h * _ + u * M + d * L,
  41362. r[5] = c * E + h * T + u * R + d * D,
  41363. r[9] = c * b + h * x + u * P + d * N,
  41364. r[13] = c * w + h * S + u * O + d * B,
  41365. r[2] = p * I + f * _ + g * M + m * L,
  41366. r[6] = p * E + f * T + g * R + m * D,
  41367. r[10] = p * b + f * x + g * P + m * N,
  41368. r[14] = p * w + f * S + g * O + m * B,
  41369. r[3] = v * I + A * _ + y * M + C * L,
  41370. r[7] = v * E + A * T + y * R + C * D,
  41371. r[11] = v * b + A * x + y * P + C * N,
  41372. r[15] = v * w + A * S + y * O + C * B,
  41373. this
  41374. },
  41375. multiplyToArray: function(e, t, i) {
  41376. var n = this.elements;
  41377. return this.multiplyMatrices(e, t),
  41378. i[0] = n[0],
  41379. i[1] = n[1],
  41380. i[2] = n[2],
  41381. i[3] = n[3],
  41382. i[4] = n[4],
  41383. i[5] = n[5],
  41384. i[6] = n[6],
  41385. i[7] = n[7],
  41386. i[8] = n[8],
  41387. i[9] = n[9],
  41388. i[10] = n[10],
  41389. i[11] = n[11],
  41390. i[12] = n[12],
  41391. i[13] = n[13],
  41392. i[14] = n[14],
  41393. i[15] = n[15],
  41394. this
  41395. },
  41396. multiplyScalar: function(e) {
  41397. var t = this.elements;
  41398. return t[0] *= e,
  41399. t[4] *= e,
  41400. t[8] *= e,
  41401. t[12] *= e,
  41402. t[1] *= e,
  41403. t[5] *= e,
  41404. t[9] *= e,
  41405. t[13] *= e,
  41406. t[2] *= e,
  41407. t[6] *= e,
  41408. t[10] *= e,
  41409. t[14] *= e,
  41410. t[3] *= e,
  41411. t[7] *= e,
  41412. t[11] *= e,
  41413. t[15] *= e,
  41414. this
  41415. },
  41416. applyToVector3Array: function() {
  41417. var e;
  41418. return function(t, i, r) {
  41419. void 0 === e && (e = new n.Vector3),
  41420. void 0 === i && (i = 0),
  41421. void 0 === r && (r = t.length);
  41422. for (var o = 0, a = i; o < r; o += 3,
  41423. a += 3)
  41424. e.fromArray(t, a),
  41425. e.applyMatrix4(this),
  41426. e.toArray(t, a);
  41427. return t
  41428. }
  41429. }(),
  41430. applyToBuffer: function() {
  41431. var e;
  41432. return function(t, i, r) {
  41433. void 0 === e && (e = new n.Vector3),
  41434. void 0 === i && (i = 0),
  41435. void 0 === r && (r = t.length / t.itemSize);
  41436. for (var o = 0, a = i; o < r; o++,
  41437. a++)
  41438. e.x = t.getX(a),
  41439. e.y = t.getY(a),
  41440. e.z = t.getZ(a),
  41441. e.applyMatrix4(this),
  41442. t.setXYZ(e.x, e.y, e.z);
  41443. return t
  41444. }
  41445. }(),
  41446. determinant: function() {
  41447. var e = this.elements
  41448. , t = e[0]
  41449. , i = e[4]
  41450. , n = e[8]
  41451. , r = e[12]
  41452. , o = e[1]
  41453. , a = e[5]
  41454. , s = e[9]
  41455. , l = e[13]
  41456. , c = e[2]
  41457. , h = e[6]
  41458. , u = e[10]
  41459. , d = e[14]
  41460. , p = e[3]
  41461. , f = e[7]
  41462. , g = e[11]
  41463. , m = e[15];
  41464. 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)
  41465. },
  41466. transpose: function() {
  41467. var e, t = this.elements;
  41468. return e = t[1],
  41469. t[1] = t[4],
  41470. t[4] = e,
  41471. e = t[2],
  41472. t[2] = t[8],
  41473. t[8] = e,
  41474. e = t[6],
  41475. t[6] = t[9],
  41476. t[9] = e,
  41477. e = t[3],
  41478. t[3] = t[12],
  41479. t[12] = e,
  41480. e = t[7],
  41481. t[7] = t[13],
  41482. t[13] = e,
  41483. e = t[11],
  41484. t[11] = t[14],
  41485. t[14] = e,
  41486. this
  41487. },
  41488. flattenToArrayOffset: function(e, t) {
  41489. var i = this.elements;
  41490. return e[t] = i[0],
  41491. e[t + 1] = i[1],
  41492. e[t + 2] = i[2],
  41493. e[t + 3] = i[3],
  41494. e[t + 4] = i[4],
  41495. e[t + 5] = i[5],
  41496. e[t + 6] = i[6],
  41497. e[t + 7] = i[7],
  41498. e[t + 8] = i[8],
  41499. e[t + 9] = i[9],
  41500. e[t + 10] = i[10],
  41501. e[t + 11] = i[11],
  41502. e[t + 12] = i[12],
  41503. e[t + 13] = i[13],
  41504. e[t + 14] = i[14],
  41505. e[t + 15] = i[15],
  41506. e
  41507. },
  41508. getPosition: function() {
  41509. var e;
  41510. return function() {
  41511. return void 0 === e && (e = new n.Vector3),
  41512. console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),
  41513. e.setFromMatrixColumn(this, 3)
  41514. }
  41515. }(),
  41516. setPosition: function(e) {
  41517. var t = this.elements;
  41518. return t[12] = e.x,
  41519. t[13] = e.y,
  41520. t[14] = e.z,
  41521. this
  41522. },
  41523. getInverse: function(e, t) {
  41524. var i = this.elements
  41525. , n = e.elements
  41526. , r = n[0]
  41527. , o = n[1]
  41528. , a = n[2]
  41529. , s = n[3]
  41530. , l = n[4]
  41531. , c = n[5]
  41532. , h = n[6]
  41533. , u = n[7]
  41534. , d = n[8]
  41535. , p = n[9]
  41536. , f = n[10]
  41537. , g = n[11]
  41538. , m = n[12]
  41539. , v = n[13]
  41540. , A = n[14]
  41541. , y = n[15]
  41542. , C = p * A * u - v * f * u + v * h * g - c * A * g - p * h * y + c * f * y
  41543. , I = m * f * u - d * A * u - m * h * g + l * A * g + d * h * y - l * f * y
  41544. , E = d * v * u - m * p * u + m * c * g - l * v * g - d * c * y + l * p * y
  41545. , b = m * p * h - d * v * h - m * c * f + l * v * f + d * c * A - l * p * A
  41546. , w = r * C + o * I + a * E + s * b;
  41547. if (0 === w) {
  41548. var _ = "THREE.Matrix4.getInverse(): can't invert matrix, determinant is 0";
  41549. if (t)
  41550. throw new Error(_);
  41551. return console.warn(_),
  41552. this.identity()
  41553. }
  41554. return i[0] = C,
  41555. i[1] = v * f * s - p * A * s - v * a * g + o * A * g + p * a * y - o * f * y,
  41556. i[2] = c * A * s - v * h * s + v * a * u - o * A * u - c * a * y + o * h * y,
  41557. i[3] = p * h * s - c * f * s - p * a * u + o * f * u + c * a * g - o * h * g,
  41558. i[4] = I,
  41559. i[5] = d * A * s - m * f * s + m * a * g - r * A * g - d * a * y + r * f * y,
  41560. i[6] = m * h * s - l * A * s - m * a * u + r * A * u + l * a * y - r * h * y,
  41561. i[7] = l * f * s - d * h * s + d * a * u - r * f * u - l * a * g + r * h * g,
  41562. i[8] = E,
  41563. i[9] = m * p * s - d * v * s - m * o * g + r * v * g + d * o * y - r * p * y,
  41564. i[10] = l * v * s - m * c * s + m * o * u - r * v * u - l * o * y + r * c * y,
  41565. i[11] = d * c * s - l * p * s - d * o * u + r * p * u + l * o * g - r * c * g,
  41566. i[12] = b,
  41567. i[13] = d * v * a - m * p * a + m * o * f - r * v * f - d * o * A + r * p * A,
  41568. i[14] = m * c * a - l * v * a - m * o * h + r * v * h + l * o * A - r * c * A,
  41569. i[15] = l * p * a - d * c * a + d * o * h - r * p * h - l * o * f + r * c * f,
  41570. this.multiplyScalar(1 / w)
  41571. },
  41572. scale: function(e) {
  41573. var t = this.elements
  41574. , i = e.x
  41575. , n = e.y
  41576. , r = e.z;
  41577. return t[0] *= i,
  41578. t[4] *= n,
  41579. t[8] *= r,
  41580. t[1] *= i,
  41581. t[5] *= n,
  41582. t[9] *= r,
  41583. t[2] *= i,
  41584. t[6] *= n,
  41585. t[10] *= r,
  41586. t[3] *= i,
  41587. t[7] *= n,
  41588. t[11] *= r,
  41589. this
  41590. },
  41591. getMaxScaleOnAxis: function() {
  41592. var e = this.elements
  41593. , t = e[0] * e[0] + e[1] * e[1] + e[2] * e[2]
  41594. , i = e[4] * e[4] + e[5] * e[5] + e[6] * e[6]
  41595. , n = e[8] * e[8] + e[9] * e[9] + e[10] * e[10];
  41596. return Math.sqrt(Math.max(t, i, n))
  41597. },
  41598. makeTranslation: function(e, t, i) {
  41599. return this.set(1, 0, 0, e, 0, 1, 0, t, 0, 0, 1, i, 0, 0, 0, 1),
  41600. this
  41601. },
  41602. makeRotationX: function(e) {
  41603. var t = Math.cos(e)
  41604. , i = Math.sin(e);
  41605. return this.set(1, 0, 0, 0, 0, t, -i, 0, 0, i, t, 0, 0, 0, 0, 1),
  41606. this
  41607. },
  41608. makeRotationY: function(e) {
  41609. var t = Math.cos(e)
  41610. , i = Math.sin(e);
  41611. return this.set(t, 0, i, 0, 0, 1, 0, 0, -i, 0, t, 0, 0, 0, 0, 1),
  41612. this
  41613. },
  41614. makeRotationZ: function(e) {
  41615. var t = Math.cos(e)
  41616. , i = Math.sin(e);
  41617. return this.set(t, -i, 0, 0, i, t, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
  41618. this
  41619. },
  41620. makeRotationAxis: function(e, t) {
  41621. var i = Math.cos(t)
  41622. , n = Math.sin(t)
  41623. , r = 1 - i
  41624. , o = e.x
  41625. , a = e.y
  41626. , s = e.z
  41627. , l = r * o
  41628. , c = r * a;
  41629. 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),
  41630. this
  41631. },
  41632. makeScale: function(e, t, i) {
  41633. return this.set(e, 0, 0, 0, 0, t, 0, 0, 0, 0, i, 0, 0, 0, 0, 1),
  41634. this
  41635. },
  41636. compose: function(e, t, i) {
  41637. return this.makeRotationFromQuaternion(t),
  41638. this.scale(i),
  41639. this.setPosition(e),
  41640. this
  41641. },
  41642. decompose: function() {
  41643. var e, t;
  41644. return function(i, r, o) {
  41645. void 0 === e && (e = new n.Vector3),
  41646. void 0 === t && (t = new n.Matrix4);
  41647. var a = this.elements
  41648. , s = e.set(a[0], a[1], a[2]).length()
  41649. , l = e.set(a[4], a[5], a[6]).length()
  41650. , c = e.set(a[8], a[9], a[10]).length()
  41651. , h = this.determinant();
  41652. h < 0 && (s = -s),
  41653. i.x = a[12],
  41654. i.y = a[13],
  41655. i.z = a[14],
  41656. t.elements.set(this.elements);
  41657. var u = 1 / s
  41658. , d = 1 / l
  41659. , p = 1 / c;
  41660. return t.elements[0] *= u,
  41661. t.elements[1] *= u,
  41662. t.elements[2] *= u,
  41663. t.elements[4] *= d,
  41664. t.elements[5] *= d,
  41665. t.elements[6] *= d,
  41666. t.elements[8] *= p,
  41667. t.elements[9] *= p,
  41668. t.elements[10] *= p,
  41669. r.setFromRotationMatrix(t),
  41670. o.x = s,
  41671. o.y = l,
  41672. o.z = c,
  41673. this
  41674. }
  41675. }(),
  41676. makeFrustum: function(e, t, i, n, r, o) {
  41677. var a = this.elements
  41678. , s = 2 * r / (t - e)
  41679. , l = 2 * r / (n - i)
  41680. , c = (t + e) / (t - e)
  41681. , h = (n + i) / (n - i)
  41682. , u = -(o + r) / (o - r)
  41683. , d = -2 * o * r / (o - r);
  41684. return a[0] = s,
  41685. a[4] = 0,
  41686. a[8] = c,
  41687. a[12] = 0,
  41688. a[1] = 0,
  41689. a[5] = l,
  41690. a[9] = h,
  41691. a[13] = 0,
  41692. a[2] = 0,
  41693. a[6] = 0,
  41694. a[10] = u,
  41695. a[14] = d,
  41696. a[3] = 0,
  41697. a[7] = 0,
  41698. a[11] = -1,
  41699. a[15] = 0,
  41700. this
  41701. },
  41702. makePerspective: function(e, t, i, r) {
  41703. var o = i * Math.tan(n.Math.degToRad(.5 * e))
  41704. , a = -o
  41705. , s = a * t
  41706. , l = o * t;
  41707. return this.makeFrustum(s, l, a, o, i, r)
  41708. },
  41709. makeOrthographic: function(e, t, i, n, r, o) {
  41710. var a = this.elements
  41711. , s = 1 / (t - e)
  41712. , l = 1 / (i - n)
  41713. , c = 1 / (o - r)
  41714. , h = (t + e) * s
  41715. , u = (i + n) * l
  41716. , d = (o + r) * c;
  41717. return a[0] = 2 * s,
  41718. a[4] = 0,
  41719. a[8] = 0,
  41720. a[12] = -h,
  41721. a[1] = 0,
  41722. a[5] = 2 * l,
  41723. a[9] = 0,
  41724. a[13] = -u,
  41725. a[2] = 0,
  41726. a[6] = 0,
  41727. a[10] = -2 * c,
  41728. a[14] = -d,
  41729. a[3] = 0,
  41730. a[7] = 0,
  41731. a[11] = 0,
  41732. a[15] = 1,
  41733. this
  41734. },
  41735. equals: function(e) {
  41736. for (var t = this.elements, i = e.elements, n = 0; n < 16; n++)
  41737. if (t[n] !== i[n])
  41738. return !1;
  41739. return !0
  41740. },
  41741. fromArray: function(e) {
  41742. return this.elements.set(e),
  41743. this
  41744. },
  41745. toArray: function() {
  41746. var e = this.elements;
  41747. 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]]
  41748. }
  41749. },
  41750. n.Ray = function(e, t) {
  41751. this.origin = void 0 !== e ? e : new n.Vector3,
  41752. this.direction = void 0 !== t ? t : new n.Vector3
  41753. }
  41754. ,
  41755. n.Ray.prototype = {
  41756. constructor: n.Ray,
  41757. set: function(e, t) {
  41758. return this.origin.copy(e),
  41759. this.direction.copy(t),
  41760. this
  41761. },
  41762. clone: function() {
  41763. return (new this.constructor).copy(this)
  41764. },
  41765. copy: function(e) {
  41766. return this.origin.copy(e.origin),
  41767. this.direction.copy(e.direction),
  41768. this
  41769. },
  41770. at: function(e, t) {
  41771. var i = t || new n.Vector3;
  41772. return i.copy(this.direction).multiplyScalar(e).add(this.origin)
  41773. },
  41774. lookAt: function(e) {
  41775. this.direction.copy(e).sub(this.origin).normalize()
  41776. },
  41777. recast: function() {
  41778. var e = new n.Vector3;
  41779. return function(t) {
  41780. return this.origin.copy(this.at(t, e)),
  41781. this
  41782. }
  41783. }(),
  41784. closestPointToPoint: function(e, t) {
  41785. var i = t || new n.Vector3;
  41786. i.subVectors(e, this.origin);
  41787. var r = i.dot(this.direction);
  41788. return r < 0 ? i.copy(this.origin) : i.copy(this.direction).multiplyScalar(r).add(this.origin)
  41789. },
  41790. distanceToPoint: function(e) {
  41791. return Math.sqrt(this.distanceSqToPoint(e))
  41792. },
  41793. distanceSqToPoint: function() {
  41794. var e = new n.Vector3;
  41795. return function(t) {
  41796. var i = e.subVectors(t, this.origin).dot(this.direction);
  41797. return i < 0 ? this.origin.distanceToSquared(t) : (e.copy(this.direction).multiplyScalar(i).add(this.origin),
  41798. e.distanceToSquared(t))
  41799. }
  41800. }(),
  41801. distanceSqToSegment: function() {
  41802. var e = new n.Vector3
  41803. , t = new n.Vector3
  41804. , i = new n.Vector3;
  41805. return function(n, r, o, a) {
  41806. e.copy(n).add(r).multiplyScalar(.5),
  41807. t.copy(r).sub(n).normalize(),
  41808. i.copy(this.origin).sub(e);
  41809. 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);
  41810. if (m > 0)
  41811. if (s = d * f - p,
  41812. l = d * p - f,
  41813. h = u * m,
  41814. s >= 0)
  41815. if (l >= -h)
  41816. if (l <= h) {
  41817. var v = 1 / m;
  41818. s *= v,
  41819. l *= v,
  41820. c = s * (s + d * l + 2 * p) + l * (d * s + l + 2 * f) + g
  41821. } else
  41822. l = u,
  41823. s = Math.max(0, -(d * l + p)),
  41824. c = -s * s + l * (l + 2 * f) + g;
  41825. else
  41826. l = -u,
  41827. s = Math.max(0, -(d * l + p)),
  41828. c = -s * s + l * (l + 2 * f) + g;
  41829. else
  41830. l <= -h ? (s = Math.max(0, -(-d * u + p)),
  41831. l = s > 0 ? -u : Math.min(Math.max(-u, -f), u),
  41832. c = -s * s + l * (l + 2 * f) + g) : l <= h ? (s = 0,
  41833. l = Math.min(Math.max(-u, -f), u),
  41834. c = l * (l + 2 * f) + g) : (s = Math.max(0, -(d * u + p)),
  41835. l = s > 0 ? u : Math.min(Math.max(-u, -f), u),
  41836. c = -s * s + l * (l + 2 * f) + g);
  41837. else
  41838. l = d > 0 ? -u : u,
  41839. s = Math.max(0, -(d * l + p)),
  41840. c = -s * s + l * (l + 2 * f) + g;
  41841. return o && o.copy(this.direction).multiplyScalar(s).add(this.origin),
  41842. a && a.copy(t).multiplyScalar(l).add(e),
  41843. c
  41844. }
  41845. }(),
  41846. intersectSphere: function() {
  41847. var e = new n.Vector3;
  41848. return function(t, i) {
  41849. e.subVectors(t.center, this.origin);
  41850. var n = e.dot(this.direction)
  41851. , r = e.dot(e) - n * n
  41852. , o = t.radius * t.radius;
  41853. if (r > o)
  41854. return null;
  41855. var a = Math.sqrt(o - r)
  41856. , s = n - a
  41857. , l = n + a;
  41858. return s < 0 && l < 0 ? null : s < 0 ? this.at(l, i) : this.at(s, i)
  41859. }
  41860. }(),
  41861. intersectsSphere: function(e) {
  41862. return this.distanceToPoint(e.center) <= e.radius
  41863. },
  41864. distanceToPlane: function(e) {
  41865. var t = e.normal.dot(this.direction);
  41866. if (0 === t)
  41867. return 0 === e.distanceToPoint(this.origin) ? 0 : null;
  41868. var i = -(this.origin.dot(e.normal) + e.constant) / t;
  41869. return i >= 0 ? i : null
  41870. },
  41871. intersectPlane: function(e, t) {
  41872. var i = this.distanceToPlane(e);
  41873. return null === i ? null : this.at(i, t)
  41874. },
  41875. intersectsPlane: function(e) {
  41876. var t = e.distanceToPoint(this.origin);
  41877. if (0 === t)
  41878. return !0;
  41879. var i = e.normal.dot(this.direction);
  41880. return i * t < 0
  41881. },
  41882. intersectBox: function(e, t) {
  41883. 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;
  41884. return l >= 0 ? (i = (e.min.x - u.x) * l,
  41885. n = (e.max.x - u.x) * l) : (i = (e.max.x - u.x) * l,
  41886. n = (e.min.x - u.x) * l),
  41887. c >= 0 ? (r = (e.min.y - u.y) * c,
  41888. o = (e.max.y - u.y) * c) : (r = (e.max.y - u.y) * c,
  41889. o = (e.min.y - u.y) * c),
  41890. i > o || r > n ? null : ((r > i || i !== i) && (i = r),
  41891. (o < n || n !== n) && (n = o),
  41892. h >= 0 ? (a = (e.min.z - u.z) * h,
  41893. s = (e.max.z - u.z) * h) : (a = (e.max.z - u.z) * h,
  41894. s = (e.min.z - u.z) * h),
  41895. i > s || a > n ? null : ((a > i || i !== i) && (i = a),
  41896. (s < n || n !== n) && (n = s),
  41897. n < 0 ? null : this.at(i >= 0 ? i : n, t)))
  41898. },
  41899. intersectsBox: function() {
  41900. var e = new n.Vector3;
  41901. return function(t) {
  41902. return null !== this.intersectBox(t, e)
  41903. }
  41904. }(),
  41905. intersectTriangle: function() {
  41906. var e = new n.Vector3
  41907. , t = new n.Vector3
  41908. , i = new n.Vector3
  41909. , r = new n.Vector3;
  41910. return function(n, o, a, s, l) {
  41911. t.subVectors(o, n),
  41912. i.subVectors(a, n),
  41913. r.crossVectors(t, i);
  41914. var c, h = this.direction.dot(r);
  41915. if (h > 0) {
  41916. if (s)
  41917. return null;
  41918. c = 1
  41919. } else {
  41920. if (!(h < 0))
  41921. return null;
  41922. c = -1,
  41923. h = -h
  41924. }
  41925. e.subVectors(this.origin, n);
  41926. var u = c * this.direction.dot(i.crossVectors(e, i));
  41927. if (u < 0)
  41928. return null;
  41929. var d = c * this.direction.dot(t.cross(e));
  41930. if (d < 0)
  41931. return null;
  41932. if (u + d > h)
  41933. return null;
  41934. var p = -c * e.dot(r);
  41935. return p < 0 ? null : this.at(p / h, l)
  41936. }
  41937. }(),
  41938. applyMatrix4: function(e) {
  41939. return this.direction.add(this.origin).applyMatrix4(e),
  41940. this.origin.applyMatrix4(e),
  41941. this.direction.sub(this.origin),
  41942. this.direction.normalize(),
  41943. this
  41944. },
  41945. equals: function(e) {
  41946. return e.origin.equals(this.origin) && e.direction.equals(this.direction)
  41947. }
  41948. },
  41949. n.Sphere = function(e, t) {
  41950. this.center = void 0 !== e ? e : new n.Vector3,
  41951. this.radius = void 0 !== t ? t : 0
  41952. }
  41953. ,
  41954. n.Sphere.prototype = {
  41955. constructor: n.Sphere,
  41956. set: function(e, t) {
  41957. return this.center.copy(e),
  41958. this.radius = t,
  41959. this
  41960. },
  41961. setFromPoints: function() {
  41962. var e = new n.Box3;
  41963. return function(t, i) {
  41964. var n = this.center;
  41965. void 0 !== i ? n.copy(i) : e.setFromPoints(t).center(n);
  41966. for (var r = 0, o = 0, a = t.length; o < a; o++)
  41967. r = Math.max(r, n.distanceToSquared(t[o]));
  41968. return this.radius = Math.sqrt(r),
  41969. this
  41970. }
  41971. }(),
  41972. clone: function() {
  41973. return (new this.constructor).copy(this)
  41974. },
  41975. copy: function(e) {
  41976. return this.center.copy(e.center),
  41977. this.radius = e.radius,
  41978. this
  41979. },
  41980. empty: function() {
  41981. return this.radius <= 0
  41982. },
  41983. containsPoint: function(e) {
  41984. return e.distanceToSquared(this.center) <= this.radius * this.radius
  41985. },
  41986. distanceToPoint: function(e) {
  41987. return e.distanceTo(this.center) - this.radius
  41988. },
  41989. intersectsSphere: function(e) {
  41990. var t = this.radius + e.radius;
  41991. return e.center.distanceToSquared(this.center) <= t * t
  41992. },
  41993. intersectsBox: function(e) {
  41994. return e.intersectsSphere(this)
  41995. },
  41996. intersectsPlane: function(e) {
  41997. return Math.abs(this.center.dot(e.normal) - e.constant) <= this.radius
  41998. },
  41999. clampPoint: function(e, t) {
  42000. var i = this.center.distanceToSquared(e)
  42001. , r = t || new n.Vector3;
  42002. return r.copy(e),
  42003. i > this.radius * this.radius && (r.sub(this.center).normalize(),
  42004. r.multiplyScalar(this.radius).add(this.center)),
  42005. r
  42006. },
  42007. getBoundingBox: function(e) {
  42008. var t = e || new n.Box3;
  42009. return t.set(this.center, this.center),
  42010. t.expandByScalar(this.radius),
  42011. t
  42012. },
  42013. applyMatrix4: function(e) {
  42014. return this.center.applyMatrix4(e),
  42015. this.radius = this.radius * e.getMaxScaleOnAxis(),
  42016. this
  42017. },
  42018. translate: function(e) {
  42019. return this.center.add(e),
  42020. this
  42021. },
  42022. equals: function(e) {
  42023. return e.center.equals(this.center) && e.radius === this.radius
  42024. }
  42025. },
  42026. n.Frustum = function(e, t, i, r, o, a) {
  42027. 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]
  42028. }
  42029. ,
  42030. n.Frustum.prototype = {
  42031. constructor: n.Frustum,
  42032. set: function(e, t, i, n, r, o) {
  42033. var a = this.planes;
  42034. return a[0].copy(e),
  42035. a[1].copy(t),
  42036. a[2].copy(i),
  42037. a[3].copy(n),
  42038. a[4].copy(r),
  42039. a[5].copy(o),
  42040. this
  42041. },
  42042. clone: function() {
  42043. return (new this.constructor).copy(this)
  42044. },
  42045. copy: function(e) {
  42046. for (var t = this.planes, i = 0; i < 6; i++)
  42047. t[i].copy(e.planes[i]);
  42048. return this
  42049. },
  42050. setFromMatrix: function(e) {
  42051. var t = this.planes
  42052. , i = e.elements
  42053. , n = i[0]
  42054. , r = i[1]
  42055. , o = i[2]
  42056. , a = i[3]
  42057. , s = i[4]
  42058. , l = i[5]
  42059. , c = i[6]
  42060. , h = i[7]
  42061. , u = i[8]
  42062. , d = i[9]
  42063. , p = i[10]
  42064. , f = i[11]
  42065. , g = i[12]
  42066. , m = i[13]
  42067. , v = i[14]
  42068. , A = i[15];
  42069. return t[0].setComponents(a - n, h - s, f - u, A - g).normalize(),
  42070. t[1].setComponents(a + n, h + s, f + u, A + g).normalize(),
  42071. t[2].setComponents(a + r, h + l, f + d, A + m).normalize(),
  42072. t[3].setComponents(a - r, h - l, f - d, A - m).normalize(),
  42073. t[4].setComponents(a - o, h - c, f - p, A - v).normalize(),
  42074. t[5].setComponents(a + o, h + c, f + p, A + v).normalize(),
  42075. this
  42076. },
  42077. intersectsObject: function() {
  42078. var e = new n.Sphere;
  42079. return function(t) {
  42080. var i = t.geometry;
  42081. return null === i.boundingSphere && i.computeBoundingSphere(),
  42082. e.copy(i.boundingSphere),
  42083. e.applyMatrix4(t.matrixWorld),
  42084. this.intersectsSphere(e)
  42085. }
  42086. }(),
  42087. intersectsSphere: function(e) {
  42088. for (var t = this.planes, i = e.center, n = -e.radius, r = 0; r < 6; r++) {
  42089. var o = t[r].distanceToPoint(i);
  42090. if (o < n)
  42091. return !1
  42092. }
  42093. return !0
  42094. },
  42095. intersectsBox: function() {
  42096. var e = new n.Vector3
  42097. , t = new n.Vector3;
  42098. return function(i) {
  42099. for (var n = this.planes, r = 0; r < 6; r++) {
  42100. var o = n[r];
  42101. e.x = o.normal.x > 0 ? i.min.x : i.max.x,
  42102. t.x = o.normal.x > 0 ? i.max.x : i.min.x,
  42103. e.y = o.normal.y > 0 ? i.min.y : i.max.y,
  42104. t.y = o.normal.y > 0 ? i.max.y : i.min.y,
  42105. e.z = o.normal.z > 0 ? i.min.z : i.max.z,
  42106. t.z = o.normal.z > 0 ? i.max.z : i.min.z;
  42107. var a = o.distanceToPoint(e)
  42108. , s = o.distanceToPoint(t);
  42109. if (a < 0 && s < 0)
  42110. return !1
  42111. }
  42112. return !0
  42113. }
  42114. }(),
  42115. containsPoint: function(e) {
  42116. for (var t = this.planes, i = 0; i < 6; i++)
  42117. if (t[i].distanceToPoint(e) < 0)
  42118. return !1;
  42119. return !0
  42120. }
  42121. },
  42122. n.Plane = function(e, t) {
  42123. this.normal = void 0 !== e ? e : new n.Vector3(1,0,0),
  42124. this.constant = void 0 !== t ? t : 0
  42125. }
  42126. ,
  42127. n.Plane.prototype = {
  42128. constructor: n.Plane,
  42129. set: function(e, t) {
  42130. return this.normal.copy(e),
  42131. this.constant = t,
  42132. this
  42133. },
  42134. setComponents: function(e, t, i, n) {
  42135. return this.normal.set(e, t, i),
  42136. this.constant = n,
  42137. this
  42138. },
  42139. setFromNormalAndCoplanarPoint: function(e, t) {
  42140. return this.normal.copy(e),
  42141. this.constant = -t.dot(this.normal),
  42142. this
  42143. },
  42144. setFromCoplanarPoints: function() {
  42145. var e = new n.Vector3
  42146. , t = new n.Vector3;
  42147. return function(i, n, r) {
  42148. var o = e.subVectors(r, n).cross(t.subVectors(i, n)).normalize();
  42149. return this.setFromNormalAndCoplanarPoint(o, i),
  42150. this
  42151. }
  42152. }(),
  42153. clone: function() {
  42154. return (new this.constructor).copy(this)
  42155. },
  42156. copy: function(e) {
  42157. return this.normal.copy(e.normal),
  42158. this.constant = e.constant,
  42159. this
  42160. },
  42161. normalize: function() {
  42162. var e = 1 / this.normal.length();
  42163. return this.normal.multiplyScalar(e),
  42164. this.constant *= e,
  42165. this
  42166. },
  42167. negate: function() {
  42168. return this.constant *= -1,
  42169. this.normal.negate(),
  42170. this
  42171. },
  42172. distanceToPoint: function(e) {
  42173. return this.normal.dot(e) + this.constant
  42174. },
  42175. distanceToSphere: function(e) {
  42176. return this.distanceToPoint(e.center) - e.radius
  42177. },
  42178. projectPoint: function(e, t) {
  42179. return this.orthoPoint(e, t).sub(e).negate()
  42180. },
  42181. orthoPoint: function(e, t) {
  42182. var i = this.distanceToPoint(e)
  42183. , r = t || new n.Vector3;
  42184. return r.copy(this.normal).multiplyScalar(i)
  42185. },
  42186. intersectLine: function() {
  42187. var e = new n.Vector3;
  42188. return function(t, i) {
  42189. var r = i || new n.Vector3
  42190. , o = t.delta(e)
  42191. , a = this.normal.dot(o);
  42192. if (0 !== a) {
  42193. var s = -(t.start.dot(this.normal) + this.constant) / a;
  42194. if (!(s < 0 || s > 1))
  42195. return r.copy(o).multiplyScalar(s).add(t.start)
  42196. } else if (0 === this.distanceToPoint(t.start))
  42197. return r.copy(t.start)
  42198. }
  42199. }(),
  42200. intersectsLine: function(e) {
  42201. var t = this.distanceToPoint(e.start)
  42202. , i = this.distanceToPoint(e.end);
  42203. return t < 0 && i > 0 || i < 0 && t > 0
  42204. },
  42205. intersectsBox: function(e) {
  42206. return e.intersectsPlane(this)
  42207. },
  42208. intersectsSphere: function(e) {
  42209. return e.intersectsPlane(this)
  42210. },
  42211. coplanarPoint: function(e) {
  42212. var t = e || new n.Vector3;
  42213. return t.copy(this.normal).multiplyScalar(-this.constant)
  42214. },
  42215. applyMatrix4: function() {
  42216. var e = new n.Vector3
  42217. , t = new n.Vector3
  42218. , i = new n.Matrix3;
  42219. return function(n, r) {
  42220. var o = r || i.getNormalMatrix(n)
  42221. , a = e.copy(this.normal).applyMatrix3(o)
  42222. , s = this.coplanarPoint(t);
  42223. return s.applyMatrix4(n),
  42224. this.setFromNormalAndCoplanarPoint(a, s),
  42225. this
  42226. }
  42227. }(),
  42228. translate: function(e) {
  42229. return this.constant = this.constant - e.dot(this.normal),
  42230. this
  42231. },
  42232. equals: function(e) {
  42233. return e.normal.equals(this.normal) && e.constant === this.constant
  42234. }
  42235. },
  42236. n.Spherical = function(e, t, i) {
  42237. return this.radius = void 0 !== e ? e : 1,
  42238. this.phi = void 0 !== t ? t : 0,
  42239. this.theta = void 0 !== i ? i : 0,
  42240. this
  42241. }
  42242. ,
  42243. n.Spherical.prototype = {
  42244. constructor: n.Spherical,
  42245. set: function(e, t, i) {
  42246. this.radius = e,
  42247. this.phi = t,
  42248. this.theta = i
  42249. },
  42250. clone: function() {
  42251. return (new this.constructor).copy(this)
  42252. },
  42253. copy: function(e) {
  42254. return this.radius.copy(e.radius),
  42255. this.phi.copy(e.phi),
  42256. this.theta.copy(e.theta),
  42257. this
  42258. },
  42259. makeSafe: function() {
  42260. var e = 1e-6;
  42261. this.phi = Math.max(e, Math.min(Math.PI - e, this.phi))
  42262. },
  42263. setFromVector3: function(e) {
  42264. return this.radius = e.length(),
  42265. 0 === this.radius ? (this.theta = 0,
  42266. this.phi = 0) : (this.theta = Math.atan2(e.x, e.z),
  42267. this.phi = Math.acos(n.Math.clamp(e.y / this.radius, -1, 1))),
  42268. this
  42269. }
  42270. },
  42271. n.Math = {
  42272. generateUUID: function() {
  42273. var e, t = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""), i = new Array(36), n = 0;
  42274. return function() {
  42275. for (var r = 0; r < 36; r++)
  42276. 8 === r || 13 === r || 18 === r || 23 === r ? i[r] = "-" : 14 === r ? i[r] = "4" : (n <= 2 && (n = 33554432 + 16777216 * Math.random() | 0),
  42277. e = 15 & n,
  42278. n >>= 4,
  42279. i[r] = t[19 === r ? 3 & e | 8 : e]);
  42280. return i.join("")
  42281. }
  42282. }(),
  42283. clamp: function(e, t, i) {
  42284. return Math.max(t, Math.min(i, e))
  42285. },
  42286. euclideanModulo: function(e, t) {
  42287. return (e % t + t) % t
  42288. },
  42289. mapLinear: function(e, t, i, n, r) {
  42290. return n + (e - t) * (r - n) / (i - t)
  42291. },
  42292. smoothstep: function(e, t, i) {
  42293. return e <= t ? 0 : e >= i ? 1 : (e = (e - t) / (i - t),
  42294. e * e * (3 - 2 * e))
  42295. },
  42296. smootherstep: function(e, t, i) {
  42297. return e <= t ? 0 : e >= i ? 1 : (e = (e - t) / (i - t),
  42298. e * e * e * (e * (6 * e - 15) + 10))
  42299. },
  42300. random16: function() {
  42301. return console.warn("THREE.Math.random16() has been deprecated. Use Math.random() instead."),
  42302. Math.random()
  42303. },
  42304. randInt: function(e, t) {
  42305. return e + Math.floor(Math.random() * (t - e + 1))
  42306. },
  42307. randFloat: function(e, t) {
  42308. return e + Math.random() * (t - e)
  42309. },
  42310. randFloatSpread: function(e) {
  42311. return e * (.5 - Math.random())
  42312. },
  42313. degToRad: function() {
  42314. var e = Math.PI / 180;
  42315. return function(t) {
  42316. return t * e
  42317. }
  42318. }(),
  42319. radToDeg: function() {
  42320. var e = 180 / Math.PI;
  42321. return function(t) {
  42322. return t * e
  42323. }
  42324. }(),
  42325. isPowerOfTwo: function(e) {
  42326. return 0 === (e & e - 1) && 0 !== e
  42327. },
  42328. nearestPowerOfTwo: function(e) {
  42329. return Math.pow(2, Math.round(Math.log(e) / Math.LN2))
  42330. },
  42331. nextPowerOfTwo: function(e) {
  42332. return e--,
  42333. e |= e >> 1,
  42334. e |= e >> 2,
  42335. e |= e >> 4,
  42336. e |= e >> 8,
  42337. e |= e >> 16,
  42338. e++,
  42339. e
  42340. }
  42341. },
  42342. n.Spline = function(e) {
  42343. function t(e, t, i, n, r, o, a) {
  42344. var s = .5 * (i - e)
  42345. , l = .5 * (n - t);
  42346. return (2 * (t - i) + s + l) * a + (-3 * (t - i) - 2 * s - l) * o + s * r + t
  42347. }
  42348. this.points = e;
  42349. var i, r, o, a, s, l, c, h, u, d = [], p = {
  42350. x: 0,
  42351. y: 0,
  42352. z: 0
  42353. };
  42354. this.initFromArray = function(e) {
  42355. this.points = [];
  42356. for (var t = 0; t < e.length; t++)
  42357. this.points[t] = {
  42358. x: e[t][0],
  42359. y: e[t][1],
  42360. z: e[t][2]
  42361. }
  42362. }
  42363. ,
  42364. this.getPoint = function(e) {
  42365. return i = (this.points.length - 1) * e,
  42366. r = Math.floor(i),
  42367. o = i - r,
  42368. d[0] = 0 === r ? r : r - 1,
  42369. d[1] = r,
  42370. d[2] = r > this.points.length - 2 ? this.points.length - 1 : r + 1,
  42371. d[3] = r > this.points.length - 3 ? this.points.length - 1 : r + 2,
  42372. l = this.points[d[0]],
  42373. c = this.points[d[1]],
  42374. h = this.points[d[2]],
  42375. u = this.points[d[3]],
  42376. a = o * o,
  42377. s = o * a,
  42378. p.x = t(l.x, c.x, h.x, u.x, o, a, s),
  42379. p.y = t(l.y, c.y, h.y, u.y, o, a, s),
  42380. p.z = t(l.z, c.z, h.z, u.z, o, a, s),
  42381. p
  42382. }
  42383. ,
  42384. this.getControlPointsArray = function() {
  42385. var e, t, i = this.points.length, n = [];
  42386. for (e = 0; e < i; e++)
  42387. t = this.points[e],
  42388. n[e] = [t.x, t.y, t.z];
  42389. return n
  42390. }
  42391. ,
  42392. this.getLength = function(e) {
  42393. var t, i, r, o, a = 0, s = 0, l = 0, c = new n.Vector3, h = new n.Vector3, u = [], d = 0;
  42394. for (u[0] = 0,
  42395. e || (e = 100),
  42396. r = this.points.length * e,
  42397. c.copy(this.points[0]),
  42398. t = 1; t < r; t++)
  42399. i = t / r,
  42400. o = this.getPoint(i),
  42401. h.copy(o),
  42402. d += h.distanceTo(c),
  42403. c.copy(o),
  42404. a = (this.points.length - 1) * i,
  42405. s = Math.floor(a),
  42406. s !== l && (u[s] = d,
  42407. l = s);
  42408. return u[u.length] = d,
  42409. {
  42410. chunks: u,
  42411. total: d
  42412. }
  42413. }
  42414. ,
  42415. this.reparametrizeByArcLength = function(e) {
  42416. var t, i, r, o, a, s, l, c, h = [], u = new n.Vector3, d = this.getLength();
  42417. for (h.push(u.copy(this.points[0]).clone()),
  42418. t = 1; t < this.points.length; t++) {
  42419. for (s = d.chunks[t] - d.chunks[t - 1],
  42420. l = Math.ceil(e * s / d.total),
  42421. o = (t - 1) / (this.points.length - 1),
  42422. a = t / (this.points.length - 1),
  42423. i = 1; i < l - 1; i++)
  42424. r = o + i * (1 / l) * (a - o),
  42425. c = this.getPoint(r),
  42426. h.push(u.copy(c).clone());
  42427. h.push(u.copy(this.points[t]).clone())
  42428. }
  42429. this.points = h
  42430. }
  42431. }
  42432. ,
  42433. n.Triangle = function(e, t, i) {
  42434. this.a = void 0 !== e ? e : new n.Vector3,
  42435. this.b = void 0 !== t ? t : new n.Vector3,
  42436. this.c = void 0 !== i ? i : new n.Vector3
  42437. }
  42438. ,
  42439. n.Triangle.normal = function() {
  42440. var e = new n.Vector3;
  42441. return function(t, i, r, o) {
  42442. var a = o || new n.Vector3;
  42443. a.subVectors(r, i),
  42444. e.subVectors(t, i),
  42445. a.cross(e);
  42446. var s = a.lengthSq();
  42447. return s > 0 ? a.multiplyScalar(1 / Math.sqrt(s)) : a.set(0, 0, 0)
  42448. }
  42449. }(),
  42450. n.Triangle.barycoordFromPoint = function() {
  42451. var e = new n.Vector3
  42452. , t = new n.Vector3
  42453. , i = new n.Vector3;
  42454. return function(r, o, a, s, l) {
  42455. e.subVectors(s, o),
  42456. t.subVectors(a, o),
  42457. i.subVectors(r, o);
  42458. var c = e.dot(e)
  42459. , h = e.dot(t)
  42460. , u = e.dot(i)
  42461. , d = t.dot(t)
  42462. , p = t.dot(i)
  42463. , f = c * d - h * h
  42464. , g = l || new n.Vector3;
  42465. if (0 === f)
  42466. return g.set(-2, -1, -1);
  42467. var m = 1 / f
  42468. , v = (d * u - h * p) * m
  42469. , A = (c * p - h * u) * m;
  42470. return g.set(1 - v - A, A, v)
  42471. }
  42472. }(),
  42473. n.Triangle.containsPoint = function() {
  42474. var e = new n.Vector3;
  42475. return function(t, i, r, o) {
  42476. var a = n.Triangle.barycoordFromPoint(t, i, r, o, e);
  42477. return a.x >= 0 && a.y >= 0 && a.x + a.y <= 1
  42478. }
  42479. }(),
  42480. n.Triangle.prototype = {
  42481. constructor: n.Triangle,
  42482. set: function(e, t, i) {
  42483. return this.a.copy(e),
  42484. this.b.copy(t),
  42485. this.c.copy(i),
  42486. this
  42487. },
  42488. setFromPointsAndIndices: function(e, t, i, n) {
  42489. return this.a.copy(e[t]),
  42490. this.b.copy(e[i]),
  42491. this.c.copy(e[n]),
  42492. this
  42493. },
  42494. clone: function() {
  42495. return (new this.constructor).copy(this)
  42496. },
  42497. copy: function(e) {
  42498. return this.a.copy(e.a),
  42499. this.b.copy(e.b),
  42500. this.c.copy(e.c),
  42501. this
  42502. },
  42503. area: function() {
  42504. var e = new n.Vector3
  42505. , t = new n.Vector3;
  42506. return function() {
  42507. return e.subVectors(this.c, this.b),
  42508. t.subVectors(this.a, this.b),
  42509. .5 * e.cross(t).length()
  42510. }
  42511. }(),
  42512. midpoint: function(e) {
  42513. var t = e || new n.Vector3;
  42514. return t.addVectors(this.a, this.b).add(this.c).multiplyScalar(1 / 3)
  42515. },
  42516. normal: function(e) {
  42517. return n.Triangle.normal(this.a, this.b, this.c, e)
  42518. },
  42519. plane: function(e) {
  42520. var t = e || new n.Plane;
  42521. return t.setFromCoplanarPoints(this.a, this.b, this.c)
  42522. },
  42523. barycoordFromPoint: function(e, t) {
  42524. return n.Triangle.barycoordFromPoint(e, this.a, this.b, this.c, t)
  42525. },
  42526. containsPoint: function(e) {
  42527. return n.Triangle.containsPoint(e, this.a, this.b, this.c)
  42528. },
  42529. equals: function(e) {
  42530. return e.a.equals(this.a) && e.b.equals(this.b) && e.c.equals(this.c)
  42531. }
  42532. },
  42533. n.Interpolant = function(e, t, i, n) {
  42534. this.parameterPositions = e,
  42535. this._cachedIndex = 0,
  42536. this.resultBuffer = void 0 !== n ? n : new t.constructor(i),
  42537. this.sampleValues = t,
  42538. this.valueSize = i
  42539. }
  42540. ,
  42541. n.Interpolant.prototype = {
  42542. constructor: n.Interpolant,
  42543. evaluate: function(e) {
  42544. var t = this.parameterPositions
  42545. , i = this._cachedIndex
  42546. , n = t[i]
  42547. , r = t[i - 1];
  42548. e: {
  42549. t: {
  42550. var o;
  42551. i: {
  42552. n: if (!(e < n)) {
  42553. for (var a = i + 2; ; ) {
  42554. if (void 0 === n) {
  42555. if (e < r)
  42556. break n;
  42557. return i = t.length,
  42558. this._cachedIndex = i,
  42559. this.afterEnd_(i - 1, e, r)
  42560. }
  42561. if (i === a)
  42562. break;
  42563. if (r = n,
  42564. n = t[++i],
  42565. e < n)
  42566. break t
  42567. }
  42568. o = t.length;
  42569. break i
  42570. }
  42571. {
  42572. if (e >= r)
  42573. break e;
  42574. var s = t[1];
  42575. e < s && (i = 2,
  42576. r = s);
  42577. for (var a = i - 2; ; ) {
  42578. if (void 0 === r)
  42579. return this._cachedIndex = 0,
  42580. this.beforeStart_(0, e, n);
  42581. if (i === a)
  42582. break;
  42583. if (n = r,
  42584. r = t[--i - 1],
  42585. e >= r)
  42586. break t
  42587. }
  42588. o = i,
  42589. i = 0
  42590. }
  42591. }
  42592. for (; i < o; ) {
  42593. var l = i + o >>> 1;
  42594. e < t[l] ? o = l : i = l + 1
  42595. }
  42596. if (n = t[i],
  42597. r = t[i - 1],
  42598. void 0 === r)
  42599. return this._cachedIndex = 0,
  42600. this.beforeStart_(0, e, n);
  42601. if (void 0 === n)
  42602. return i = t.length,
  42603. this._cachedIndex = i,
  42604. this.afterEnd_(i - 1, r, e)
  42605. }
  42606. this._cachedIndex = i,
  42607. this.intervalChanged_(i, r, n)
  42608. }
  42609. return this.interpolate_(i, r, e, n)
  42610. },
  42611. settings: null,
  42612. DefaultSettings_: {},
  42613. getSettings_: function() {
  42614. return this.settings || this.DefaultSettings_
  42615. },
  42616. copySampleValue_: function(e) {
  42617. for (var t = this.resultBuffer, i = this.sampleValues, n = this.valueSize, r = e * n, o = 0; o !== n; ++o)
  42618. t[o] = i[r + o];
  42619. return t
  42620. },
  42621. interpolate_: function(e, t, i, n) {
  42622. throw new Error("call to abstract method")
  42623. },
  42624. intervalChanged_: function(e, t, i) {}
  42625. },
  42626. Object.assign(n.Interpolant.prototype, {
  42627. beforeStart_: n.Interpolant.prototype.copySampleValue_,
  42628. afterEnd_: n.Interpolant.prototype.copySampleValue_
  42629. }),
  42630. n.CubicInterpolant = function(e, t, i, r) {
  42631. n.Interpolant.call(this, e, t, i, r),
  42632. this._weightPrev = -0,
  42633. this._offsetPrev = -0,
  42634. this._weightNext = -0,
  42635. this._offsetNext = -0
  42636. }
  42637. ,
  42638. n.CubicInterpolant.prototype = Object.assign(Object.create(n.Interpolant.prototype), {
  42639. constructor: n.CubicInterpolant,
  42640. DefaultSettings_: {
  42641. endingStart: n.ZeroCurvatureEnding,
  42642. endingEnd: n.ZeroCurvatureEnding
  42643. },
  42644. intervalChanged_: function(e, t, i) {
  42645. var r = this.parameterPositions
  42646. , o = e - 2
  42647. , a = e + 1
  42648. , s = r[o]
  42649. , l = r[a];
  42650. if (void 0 === s)
  42651. switch (this.getSettings_().endingStart) {
  42652. case n.ZeroSlopeEnding:
  42653. o = e,
  42654. s = 2 * t - i;
  42655. break;
  42656. case n.WrapAroundEnding:
  42657. o = r.length - 2,
  42658. s = t + r[o] - r[o + 1];
  42659. break;
  42660. default:
  42661. o = e,
  42662. s = i
  42663. }
  42664. if (void 0 === l)
  42665. switch (this.getSettings_().endingEnd) {
  42666. case n.ZeroSlopeEnding:
  42667. a = e,
  42668. l = 2 * i - t;
  42669. break;
  42670. case n.WrapAroundEnding:
  42671. a = 1,
  42672. l = i + r[1] - r[0];
  42673. break;
  42674. default:
  42675. a = e - 1,
  42676. l = t
  42677. }
  42678. var c = .5 * (i - t)
  42679. , h = this.valueSize;
  42680. this._weightPrev = c / (t - s),
  42681. this._weightNext = c / (l - i),
  42682. this._offsetPrev = o * h,
  42683. this._offsetNext = a * h
  42684. },
  42685. interpolate_: function(e, t, i, n) {
  42686. 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)
  42687. r[C] = m * o[c + C] + v * o[l + C] + A * o[s + C] + y * o[h + C];
  42688. return r
  42689. }
  42690. }),
  42691. n.DiscreteInterpolant = function(e, t, i, r) {
  42692. n.Interpolant.call(this, e, t, i, r)
  42693. }
  42694. ,
  42695. n.DiscreteInterpolant.prototype = Object.assign(Object.create(n.Interpolant.prototype), {
  42696. constructor: n.DiscreteInterpolant,
  42697. interpolate_: function(e, t, i, n) {
  42698. return this.copySampleValue_(e - 1)
  42699. }
  42700. }),
  42701. n.LinearInterpolant = function(e, t, i, r) {
  42702. n.Interpolant.call(this, e, t, i, r)
  42703. }
  42704. ,
  42705. n.LinearInterpolant.prototype = Object.assign(Object.create(n.Interpolant.prototype), {
  42706. constructor: n.LinearInterpolant,
  42707. interpolate_: function(e, t, i, n) {
  42708. 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)
  42709. r[u] = o[l + u] * h + o[s + u] * c;
  42710. return r
  42711. }
  42712. }),
  42713. n.QuaternionLinearInterpolant = function(e, t, i, r) {
  42714. n.Interpolant.call(this, e, t, i, r)
  42715. }
  42716. ,
  42717. n.QuaternionLinearInterpolant.prototype = Object.assign(Object.create(n.Interpolant.prototype), {
  42718. constructor: n.QuaternionLinearInterpolant,
  42719. interpolate_: function(e, t, i, r) {
  42720. 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)
  42721. n.Quaternion.slerpFlat(o, 0, a, l - s, a, l, c);
  42722. return o
  42723. }
  42724. }),
  42725. n.Clock = function(e) {
  42726. this.autoStart = void 0 === e || e,
  42727. this.startTime = 0,
  42728. this.oldTime = 0,
  42729. this.elapsedTime = 0,
  42730. this.running = !1
  42731. }
  42732. ,
  42733. n.Clock.prototype = {
  42734. constructor: n.Clock,
  42735. start: function() {
  42736. this.startTime = performance.now(),
  42737. this.oldTime = this.startTime,
  42738. this.running = !0
  42739. },
  42740. stop: function() {
  42741. this.getElapsedTime(),
  42742. this.running = !1
  42743. },
  42744. getElapsedTime: function() {
  42745. return this.getDelta(),
  42746. this.elapsedTime
  42747. },
  42748. getDelta: function() {
  42749. var e = 0;
  42750. if (this.autoStart && !this.running && this.start(),
  42751. this.running) {
  42752. var t = performance.now();
  42753. e = .001 * (t - this.oldTime),
  42754. this.oldTime = t,
  42755. this.elapsedTime += e
  42756. }
  42757. return e
  42758. }
  42759. },
  42760. n.EventDispatcher = function() {}
  42761. ,
  42762. n.EventDispatcher.prototype = {
  42763. constructor: n.EventDispatcher,
  42764. apply: function(e) {
  42765. e.addEventListener = n.EventDispatcher.prototype.addEventListener,
  42766. e.hasEventListener = n.EventDispatcher.prototype.hasEventListener,
  42767. e.removeEventListener = n.EventDispatcher.prototype.removeEventListener,
  42768. e.dispatchEvent = n.EventDispatcher.prototype.dispatchEvent
  42769. },
  42770. addEventListener: function(e, t) {
  42771. void 0 === this._listeners && (this._listeners = {});
  42772. var i = this._listeners;
  42773. void 0 === i[e] && (i[e] = []),
  42774. i[e].indexOf(t) === -1 && i[e].push(t)
  42775. },
  42776. hasEventListener: function(e, t) {
  42777. if (void 0 === this._listeners)
  42778. return !1;
  42779. var i = this._listeners;
  42780. return void 0 !== i[e] && i[e].indexOf(t) !== -1
  42781. },
  42782. removeEventListener: function(e, t) {
  42783. if (void 0 !== this._listeners) {
  42784. var i = this._listeners
  42785. , n = i[e];
  42786. if (void 0 !== n) {
  42787. var r = n.indexOf(t);
  42788. r !== -1 && n.splice(r, 1)
  42789. }
  42790. }
  42791. },
  42792. dispatchEvent: function(e) {
  42793. if (void 0 !== this._listeners) {
  42794. var t = this._listeners
  42795. , i = t[e.type];
  42796. if (void 0 !== i) {
  42797. e.target = this;
  42798. for (var n = [], r = i.length, o = 0; o < r; o++)
  42799. n[o] = i[o];
  42800. for (var o = 0; o < r; o++)
  42801. n[o].call(this, e)
  42802. }
  42803. }
  42804. }
  42805. },
  42806. n.Layers = function() {
  42807. this.mask = 1
  42808. }
  42809. ,
  42810. n.Layers.prototype = {
  42811. constructor: n.Layers,
  42812. set: function(e) {
  42813. this.mask = 1 << e
  42814. },
  42815. enable: function(e) {
  42816. this.mask |= 1 << e
  42817. },
  42818. toggle: function(e) {
  42819. this.mask ^= 1 << e
  42820. },
  42821. disable: function(e) {
  42822. this.mask &= ~(1 << e)
  42823. },
  42824. test: function(e) {
  42825. return 0 !== (this.mask & e.mask)
  42826. }
  42827. },
  42828. function(e) {
  42829. function t(e, t) {
  42830. return e.distance - t.distance
  42831. }
  42832. function i(e, t, n, r) {
  42833. if (e.visible !== !1 && (e.raycast(t, n),
  42834. r === !0))
  42835. for (var o = e.children, a = 0, s = o.length; a < s; a++)
  42836. i(o[a], t, n, !0)
  42837. }
  42838. e.Raycaster = function(t, i, n, r) {
  42839. this.ray = new e.Ray(t,i),
  42840. this.near = n || 0,
  42841. this.far = r || 1 / 0,
  42842. this.params = {
  42843. Mesh: {},
  42844. Line: {},
  42845. LOD: {},
  42846. Points: {
  42847. threshold: 1
  42848. },
  42849. Sprite: {}
  42850. },
  42851. Object.defineProperties(this.params, {
  42852. PointCloud: {
  42853. get: function() {
  42854. return console.warn("THREE.Raycaster: params.PointCloud has been renamed to params.Points."),
  42855. this.Points
  42856. }
  42857. }
  42858. })
  42859. }
  42860. ,
  42861. e.Raycaster.prototype = {
  42862. constructor: e.Raycaster,
  42863. linePrecision: 1,
  42864. set: function(e, t) {
  42865. this.ray.set(e, t)
  42866. },
  42867. setFromCamera: function(t, i) {
  42868. i instanceof e.PerspectiveCamera ? (this.ray.origin.setFromMatrixPosition(i.matrixWorld),
  42869. 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),
  42870. this.ray.direction.set(0, 0, -1).transformDirection(i.matrixWorld)) : console.error("THREE.Raycaster: Unsupported camera type.")
  42871. },
  42872. intersectObject: function(e, n) {
  42873. var r = [];
  42874. return i(e, this, r, n),
  42875. r.sort(t),
  42876. r
  42877. },
  42878. intersectObjects: function(e, n) {
  42879. var r = [];
  42880. if (Array.isArray(e) === !1)
  42881. return console.warn("THREE.Raycaster.intersectObjects: objects is not an Array."),
  42882. r;
  42883. for (var o = 0, a = e.length; o < a; o++)
  42884. i(e[o], this, r, n);
  42885. return r.sort(t),
  42886. r
  42887. }
  42888. }
  42889. }(n),
  42890. n.Object3D = function() {
  42891. function e() {
  42892. o.setFromEuler(r, !1)
  42893. }
  42894. function t() {
  42895. r.setFromQuaternion(o, void 0, !1)
  42896. }
  42897. Object.defineProperty(this, "id", {
  42898. value: n.Object3DIdCount++
  42899. }),
  42900. this.uuid = n.Math.generateUUID(),
  42901. this.name = "",
  42902. this.type = "Object3D",
  42903. this.parent = null,
  42904. this.children = [],
  42905. this.up = n.Object3D.DefaultUp.clone();
  42906. var i = new n.Vector3
  42907. , r = new n.Euler
  42908. , o = new n.Quaternion
  42909. , a = new n.Vector3(1,1,1);
  42910. r.onChange(e),
  42911. o.onChange(t),
  42912. Object.defineProperties(this, {
  42913. position: {
  42914. enumerable: !0,
  42915. value: i
  42916. },
  42917. rotation: {
  42918. enumerable: !0,
  42919. value: r
  42920. },
  42921. quaternion: {
  42922. enumerable: !0,
  42923. value: o
  42924. },
  42925. scale: {
  42926. enumerable: !0,
  42927. value: a
  42928. },
  42929. modelViewMatrix: {
  42930. value: new n.Matrix4
  42931. },
  42932. normalMatrix: {
  42933. value: new n.Matrix3
  42934. }
  42935. }),
  42936. this.rotationAutoUpdate = !0,
  42937. this.matrix = new n.Matrix4,
  42938. this.matrixWorld = new n.Matrix4,
  42939. this.matrixAutoUpdate = n.Object3D.DefaultMatrixAutoUpdate,
  42940. this.matrixWorldNeedsUpdate = !1,
  42941. this.layers = new n.Layers,
  42942. this.visible = !0,
  42943. this.castShadow = !1,
  42944. this.receiveShadow = !1,
  42945. this.frustumCulled = !0,
  42946. this.renderOrder = 0,
  42947. this.userData = {}
  42948. }
  42949. ,
  42950. n.Object3D.DefaultUp = new n.Vector3(0,1,0),
  42951. n.Object3D.DefaultMatrixAutoUpdate = !0,
  42952. n.Object3D.prototype = {
  42953. constructor: n.Object3D,
  42954. applyMatrix: function(e) {
  42955. this.matrix.multiplyMatrices(e, this.matrix),
  42956. this.matrix.decompose(this.position, this.quaternion, this.scale)
  42957. },
  42958. setRotationFromAxisAngle: function(e, t) {
  42959. this.quaternion.setFromAxisAngle(e, t)
  42960. },
  42961. setRotationFromEuler: function(e) {
  42962. this.quaternion.setFromEuler(e, !0)
  42963. },
  42964. setRotationFromMatrix: function(e) {
  42965. this.quaternion.setFromRotationMatrix(e)
  42966. },
  42967. setRotationFromQuaternion: function(e) {
  42968. this.quaternion.copy(e)
  42969. },
  42970. rotateOnAxis: function() {
  42971. var e = new n.Quaternion;
  42972. return function(t, i) {
  42973. return e.setFromAxisAngle(t, i),
  42974. this.quaternion.multiply(e),
  42975. this
  42976. }
  42977. }(),
  42978. rotateX: function() {
  42979. var e = new n.Vector3(1,0,0);
  42980. return function(t) {
  42981. return this.rotateOnAxis(e, t)
  42982. }
  42983. }(),
  42984. rotateY: function() {
  42985. var e = new n.Vector3(0,1,0);
  42986. return function(t) {
  42987. return this.rotateOnAxis(e, t)
  42988. }
  42989. }(),
  42990. rotateZ: function() {
  42991. var e = new n.Vector3(0,0,1);
  42992. return function(t) {
  42993. return this.rotateOnAxis(e, t)
  42994. }
  42995. }(),
  42996. translateOnAxis: function() {
  42997. var e = new n.Vector3;
  42998. return function(t, i) {
  42999. return e.copy(t).applyQuaternion(this.quaternion),
  43000. this.position.add(e.multiplyScalar(i)),
  43001. this
  43002. }
  43003. }(),
  43004. translateX: function() {
  43005. var e = new n.Vector3(1,0,0);
  43006. return function(t) {
  43007. return this.translateOnAxis(e, t)
  43008. }
  43009. }(),
  43010. translateY: function() {
  43011. var e = new n.Vector3(0,1,0);
  43012. return function(t) {
  43013. return this.translateOnAxis(e, t)
  43014. }
  43015. }(),
  43016. translateZ: function() {
  43017. var e = new n.Vector3(0,0,1);
  43018. return function(t) {
  43019. return this.translateOnAxis(e, t)
  43020. }
  43021. }(),
  43022. localToWorld: function(e) {
  43023. return e.applyMatrix4(this.matrixWorld)
  43024. },
  43025. worldToLocal: function() {
  43026. var e = new n.Matrix4;
  43027. return function(t) {
  43028. return t.applyMatrix4(e.getInverse(this.matrixWorld))
  43029. }
  43030. }(),
  43031. lookAt: function() {
  43032. var e = new n.Matrix4;
  43033. return function(t) {
  43034. e.lookAt(t, this.position, this.up),
  43035. this.quaternion.setFromRotationMatrix(e)
  43036. }
  43037. }(),
  43038. add: function(e) {
  43039. if (arguments.length > 1) {
  43040. for (var t = 0; t < arguments.length; t++)
  43041. this.add(arguments[t]);
  43042. return this
  43043. }
  43044. return e === this ? (console.error("THREE.Object3D.add: object can't be added as a child of itself.", e),
  43045. this) : (e instanceof n.Object3D ? (null !== e.parent && e.parent.remove(e),
  43046. e.parent = this,
  43047. e.dispatchEvent({
  43048. type: "added"
  43049. }),
  43050. this.children.push(e)) : console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.", e),
  43051. this)
  43052. },
  43053. remove: function(e) {
  43054. if (arguments.length > 1)
  43055. for (var t = 0; t < arguments.length; t++)
  43056. this.remove(arguments[t]);
  43057. var i = this.children.indexOf(e);
  43058. i !== -1 && (e.parent = null,
  43059. e.dispatchEvent({
  43060. type: "removed"
  43061. }),
  43062. this.children.splice(i, 1))
  43063. },
  43064. getObjectById: function(e) {
  43065. return this.getObjectByProperty("id", e)
  43066. },
  43067. getObjectByName: function(e) {
  43068. return this.getObjectByProperty("name", e)
  43069. },
  43070. getObjectByProperty: function(e, t) {
  43071. if (this[e] === t)
  43072. return this;
  43073. for (var i = 0, n = this.children.length; i < n; i++) {
  43074. var r = this.children[i]
  43075. , o = r.getObjectByProperty(e, t);
  43076. if (void 0 !== o)
  43077. return o
  43078. }
  43079. },
  43080. getWorldPosition: function(e) {
  43081. var t = e || new n.Vector3;
  43082. return this.updateMatrixWorld(!0),
  43083. t.setFromMatrixPosition(this.matrixWorld)
  43084. },
  43085. getWorldQuaternion: function() {
  43086. var e = new n.Vector3
  43087. , t = new n.Vector3;
  43088. return function(i) {
  43089. var r = i || new n.Quaternion;
  43090. return this.updateMatrixWorld(!0),
  43091. this.matrixWorld.decompose(e, r, t),
  43092. r
  43093. }
  43094. }(),
  43095. getWorldRotation: function() {
  43096. var e = new n.Quaternion;
  43097. return function(t) {
  43098. var i = t || new n.Euler;
  43099. return this.getWorldQuaternion(e),
  43100. i.setFromQuaternion(e, this.rotation.order, !1)
  43101. }
  43102. }(),
  43103. getWorldScale: function() {
  43104. var e = new n.Vector3
  43105. , t = new n.Quaternion;
  43106. return function(i) {
  43107. var r = i || new n.Vector3;
  43108. return this.updateMatrixWorld(!0),
  43109. this.matrixWorld.decompose(e, t, r),
  43110. r
  43111. }
  43112. }(),
  43113. getWorldDirection: function() {
  43114. var e = new n.Quaternion;
  43115. return function(t) {
  43116. var i = t || new n.Vector3;
  43117. return this.getWorldQuaternion(e),
  43118. i.set(0, 0, 1).applyQuaternion(e)
  43119. }
  43120. }(),
  43121. raycast: function() {},
  43122. traverse: function(e) {
  43123. e(this);
  43124. for (var t = this.children, i = 0, n = t.length; i < n; i++)
  43125. t[i].traverse(e)
  43126. },
  43127. traverseVisible: function(e) {
  43128. if (this.visible !== !1) {
  43129. e(this);
  43130. for (var t = this.children, i = 0, n = t.length; i < n; i++)
  43131. t[i].traverseVisible(e)
  43132. }
  43133. },
  43134. traverseAncestors: function(e) {
  43135. var t = this.parent;
  43136. null !== t && (e(t),
  43137. t.traverseAncestors(e))
  43138. },
  43139. updateMatrix: function() {
  43140. this.matrix.compose(this.position, this.quaternion, this.scale),
  43141. this.matrixWorldNeedsUpdate = !0
  43142. },
  43143. updateMatrixWorld: function(e) {
  43144. this.matrixAutoUpdate === !0 && this.updateMatrix(),
  43145. this.matrixWorldNeedsUpdate !== !0 && e !== !0 || (null === this.parent ? this.matrixWorld.copy(this.matrix) : this.matrixWorld.multiplyMatrices(this.parent.matrixWorld, this.matrix),
  43146. this.matrixWorldNeedsUpdate = !1,
  43147. e = !0);
  43148. for (var t = 0, i = this.children.length; t < i; t++)
  43149. this.children[t].updateMatrixWorld(e)
  43150. },
  43151. toJSON: function(e) {
  43152. function t(e) {
  43153. var t = [];
  43154. for (var i in e) {
  43155. var n = e[i];
  43156. delete n.metadata,
  43157. t.push(n)
  43158. }
  43159. return t
  43160. }
  43161. var i = void 0 === e
  43162. , n = {};
  43163. i && (e = {
  43164. geometries: {},
  43165. materials: {},
  43166. textures: {},
  43167. images: {}
  43168. },
  43169. n.metadata = {
  43170. version: 4.4,
  43171. type: "Object",
  43172. generator: "Object3D.toJSON"
  43173. });
  43174. var r = {};
  43175. if (r.uuid = this.uuid,
  43176. r.type = this.type,
  43177. "" !== this.name && (r.name = this.name),
  43178. "{}" !== JSON.stringify(this.userData) && (r.userData = this.userData),
  43179. this.castShadow === !0 && (r.castShadow = !0),
  43180. this.receiveShadow === !0 && (r.receiveShadow = !0),
  43181. this.visible === !1 && (r.visible = !1),
  43182. r.matrix = this.matrix.toArray(),
  43183. void 0 !== this.geometry && (void 0 === e.geometries[this.geometry.uuid] && (e.geometries[this.geometry.uuid] = this.geometry.toJSON(e)),
  43184. r.geometry = this.geometry.uuid),
  43185. void 0 !== this.material && (void 0 === e.materials[this.material.uuid] && (e.materials[this.material.uuid] = this.material.toJSON(e)),
  43186. r.material = this.material.uuid),
  43187. this.children.length > 0) {
  43188. r.children = [];
  43189. for (var o = 0; o < this.children.length; o++)
  43190. r.children.push(this.children[o].toJSON(e).object)
  43191. }
  43192. if (i) {
  43193. var a = t(e.geometries)
  43194. , s = t(e.materials)
  43195. , l = t(e.textures)
  43196. , c = t(e.images);
  43197. a.length > 0 && (n.geometries = a),
  43198. s.length > 0 && (n.materials = s),
  43199. l.length > 0 && (n.textures = l),
  43200. c.length > 0 && (n.images = c)
  43201. }
  43202. return n.object = r,
  43203. n
  43204. },
  43205. clone: function(e) {
  43206. return (new this.constructor).copy(this, e)
  43207. },
  43208. copy: function(e, t) {
  43209. if (void 0 === t && (t = !0),
  43210. this.name = e.name,
  43211. this.up.copy(e.up),
  43212. this.position.copy(e.position),
  43213. this.quaternion.copy(e.quaternion),
  43214. this.scale.copy(e.scale),
  43215. this.rotationAutoUpdate = e.rotationAutoUpdate,
  43216. this.matrix.copy(e.matrix),
  43217. this.matrixWorld.copy(e.matrixWorld),
  43218. this.matrixAutoUpdate = e.matrixAutoUpdate,
  43219. this.matrixWorldNeedsUpdate = e.matrixWorldNeedsUpdate,
  43220. this.visible = e.visible,
  43221. this.castShadow = e.castShadow,
  43222. this.receiveShadow = e.receiveShadow,
  43223. this.frustumCulled = e.frustumCulled,
  43224. this.renderOrder = e.renderOrder,
  43225. this.userData = JSON.parse(JSON.stringify(e.userData)),
  43226. t === !0)
  43227. for (var i = 0; i < e.children.length; i++) {
  43228. var n = e.children[i];
  43229. this.add(n.clone())
  43230. }
  43231. return this
  43232. }
  43233. },
  43234. n.EventDispatcher.prototype.apply(n.Object3D.prototype),
  43235. n.Object3DIdCount = 0,
  43236. n.Face3 = function(e, t, i, r, o, a) {
  43237. this.a = e,
  43238. this.b = t,
  43239. this.c = i,
  43240. this.normal = r instanceof n.Vector3 ? r : new n.Vector3,
  43241. this.vertexNormals = Array.isArray(r) ? r : [],
  43242. this.color = o instanceof n.Color ? o : new n.Color,
  43243. this.vertexColors = Array.isArray(o) ? o : [],
  43244. this.materialIndex = void 0 !== a ? a : 0
  43245. }
  43246. ,
  43247. n.Face3.prototype = {
  43248. constructor: n.Face3,
  43249. clone: function() {
  43250. return (new this.constructor).copy(this)
  43251. },
  43252. copy: function(e) {
  43253. this.a = e.a,
  43254. this.b = e.b,
  43255. this.c = e.c,
  43256. this.normal.copy(e.normal),
  43257. this.color.copy(e.color),
  43258. this.materialIndex = e.materialIndex;
  43259. for (var t = 0, i = e.vertexNormals.length; t < i; t++)
  43260. this.vertexNormals[t] = e.vertexNormals[t].clone();
  43261. for (var t = 0, i = e.vertexColors.length; t < i; t++)
  43262. this.vertexColors[t] = e.vertexColors[t].clone();
  43263. return this
  43264. }
  43265. },
  43266. n.BufferAttribute = function(e, t) {
  43267. this.uuid = n.Math.generateUUID(),
  43268. this.array = e,
  43269. this.itemSize = t,
  43270. this.dynamic = !1,
  43271. this.updateRange = {
  43272. offset: 0,
  43273. count: -1
  43274. },
  43275. this.version = 0
  43276. }
  43277. ,
  43278. n.BufferAttribute.prototype = {
  43279. constructor: n.BufferAttribute,
  43280. get count() {
  43281. return this.array.length / this.itemSize
  43282. },
  43283. set needsUpdate(e) {
  43284. e === !0 && this.version++
  43285. },
  43286. setDynamic: function(e) {
  43287. return this.dynamic = e,
  43288. this
  43289. },
  43290. copy: function(e) {
  43291. return this.array = new e.array.constructor(e.array),
  43292. this.itemSize = e.itemSize,
  43293. this.dynamic = e.dynamic,
  43294. this
  43295. },
  43296. copyAt: function(e, t, i) {
  43297. e *= this.itemSize,
  43298. i *= t.itemSize;
  43299. for (var n = 0, r = this.itemSize; n < r; n++)
  43300. this.array[e + n] = t.array[i + n];
  43301. return this
  43302. },
  43303. copyArray: function(e) {
  43304. return this.array.set(e),
  43305. this
  43306. },
  43307. copyColorsArray: function(e) {
  43308. for (var t = this.array, i = 0, r = 0, o = e.length; r < o; r++) {
  43309. var a = e[r];
  43310. void 0 === a && (console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined", r),
  43311. a = new n.Color),
  43312. t[i++] = a.r,
  43313. t[i++] = a.g,
  43314. t[i++] = a.b
  43315. }
  43316. return this
  43317. },
  43318. copyIndicesArray: function(e) {
  43319. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  43320. var o = e[n];
  43321. t[i++] = o.a,
  43322. t[i++] = o.b,
  43323. t[i++] = o.c
  43324. }
  43325. return this
  43326. },
  43327. copyVector2sArray: function(e) {
  43328. for (var t = this.array, i = 0, r = 0, o = e.length; r < o; r++) {
  43329. var a = e[r];
  43330. void 0 === a && (console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined", r),
  43331. a = new n.Vector2),
  43332. t[i++] = a.x,
  43333. t[i++] = a.y
  43334. }
  43335. return this
  43336. },
  43337. copyVector3sArray: function(e) {
  43338. for (var t = this.array, i = 0, r = 0, o = e.length; r < o; r++) {
  43339. var a = e[r];
  43340. void 0 === a && (console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined", r),
  43341. a = new n.Vector3),
  43342. t[i++] = a.x,
  43343. t[i++] = a.y,
  43344. t[i++] = a.z
  43345. }
  43346. return this
  43347. },
  43348. copyVector4sArray: function(e) {
  43349. for (var t = this.array, i = 0, r = 0, o = e.length; r < o; r++) {
  43350. var a = e[r];
  43351. void 0 === a && (console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined", r),
  43352. a = new n.Vector4),
  43353. t[i++] = a.x,
  43354. t[i++] = a.y,
  43355. t[i++] = a.z,
  43356. t[i++] = a.w
  43357. }
  43358. return this
  43359. },
  43360. set: function(e, t) {
  43361. return void 0 === t && (t = 0),
  43362. this.array.set(e, t),
  43363. this
  43364. },
  43365. getX: function(e) {
  43366. return this.array[e * this.itemSize]
  43367. },
  43368. setX: function(e, t) {
  43369. return this.array[e * this.itemSize] = t,
  43370. this
  43371. },
  43372. getY: function(e) {
  43373. return this.array[e * this.itemSize + 1]
  43374. },
  43375. setY: function(e, t) {
  43376. return this.array[e * this.itemSize + 1] = t,
  43377. this
  43378. },
  43379. getZ: function(e) {
  43380. return this.array[e * this.itemSize + 2]
  43381. },
  43382. setZ: function(e, t) {
  43383. return this.array[e * this.itemSize + 2] = t,
  43384. this
  43385. },
  43386. getW: function(e) {
  43387. return this.array[e * this.itemSize + 3]
  43388. },
  43389. setW: function(e, t) {
  43390. return this.array[e * this.itemSize + 3] = t,
  43391. this
  43392. },
  43393. setXY: function(e, t, i) {
  43394. return e *= this.itemSize,
  43395. this.array[e + 0] = t,
  43396. this.array[e + 1] = i,
  43397. this
  43398. },
  43399. setXYZ: function(e, t, i, n) {
  43400. return e *= this.itemSize,
  43401. this.array[e + 0] = t,
  43402. this.array[e + 1] = i,
  43403. this.array[e + 2] = n,
  43404. this
  43405. },
  43406. setXYZW: function(e, t, i, n, r) {
  43407. return e *= this.itemSize,
  43408. this.array[e + 0] = t,
  43409. this.array[e + 1] = i,
  43410. this.array[e + 2] = n,
  43411. this.array[e + 3] = r,
  43412. this
  43413. },
  43414. clone: function() {
  43415. return (new this.constructor).copy(this)
  43416. }
  43417. },
  43418. n.Int8Attribute = function(e, t) {
  43419. return new n.BufferAttribute(new Int8Array(e),t)
  43420. }
  43421. ,
  43422. n.Uint8Attribute = function(e, t) {
  43423. return new n.BufferAttribute(new Uint8Array(e),t)
  43424. }
  43425. ,
  43426. n.Uint8ClampedAttribute = function(e, t) {
  43427. return new n.BufferAttribute(new Uint8ClampedArray(e),t)
  43428. }
  43429. ,
  43430. n.Int16Attribute = function(e, t) {
  43431. return new n.BufferAttribute(new Int16Array(e),t)
  43432. }
  43433. ,
  43434. n.Uint16Attribute = function(e, t) {
  43435. return new n.BufferAttribute(new Uint16Array(e),t)
  43436. }
  43437. ;
  43438. n.Int32Attribute = function(e, t) {
  43439. return new n.BufferAttribute(new Int32Array(e),t)
  43440. }
  43441. ;
  43442. n.Uint32Attribute = function(e, t) {
  43443. return new n.BufferAttribute(new Uint32Array(e),t)
  43444. }
  43445. ,
  43446. n.Float32Attribute = function(e, t) {
  43447. return new n.BufferAttribute(new Float32Array(e),t)
  43448. }
  43449. ,
  43450. n.Float64Attribute = function(e, t) {
  43451. return new n.BufferAttribute(new Float64Array(e),t)
  43452. }
  43453. ,
  43454. n.DynamicBufferAttribute = function(e, t) {
  43455. return console.warn("THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setDynamic( true ) instead."),
  43456. new n.BufferAttribute(e,t).setDynamic(!0)
  43457. }
  43458. ,
  43459. n.InstancedBufferAttribute = function(e, t, i) {
  43460. n.BufferAttribute.call(this, e, t),
  43461. this.meshPerAttribute = i || 1
  43462. }
  43463. ,
  43464. n.InstancedBufferAttribute.prototype = Object.create(n.BufferAttribute.prototype),
  43465. n.InstancedBufferAttribute.prototype.constructor = n.InstancedBufferAttribute,
  43466. n.InstancedBufferAttribute.prototype.copy = function(e) {
  43467. return n.BufferAttribute.prototype.copy.call(this, e),
  43468. this.meshPerAttribute = e.meshPerAttribute,
  43469. this
  43470. }
  43471. ,
  43472. n.InterleavedBuffer = function(e, t) {
  43473. this.uuid = n.Math.generateUUID(),
  43474. this.array = e,
  43475. this.stride = t,
  43476. this.dynamic = !1,
  43477. this.updateRange = {
  43478. offset: 0,
  43479. count: -1
  43480. },
  43481. this.version = 0
  43482. }
  43483. ,
  43484. n.InterleavedBuffer.prototype = {
  43485. constructor: n.InterleavedBuffer,
  43486. get length() {
  43487. return this.array.length
  43488. },
  43489. get count() {
  43490. return this.array.length / this.stride
  43491. },
  43492. set needsUpdate(e) {
  43493. e === !0 && this.version++
  43494. },
  43495. setDynamic: function(e) {
  43496. return this.dynamic = e,
  43497. this
  43498. },
  43499. copy: function(e) {
  43500. return this.array = new e.array.constructor(e.array),
  43501. this.stride = e.stride,
  43502. this.dynamic = e.dynamic,
  43503. this
  43504. },
  43505. copyAt: function(e, t, i) {
  43506. e *= this.stride,
  43507. i *= t.stride;
  43508. for (var n = 0, r = this.stride; n < r; n++)
  43509. this.array[e + n] = t.array[i + n];
  43510. return this
  43511. },
  43512. set: function(e, t) {
  43513. return void 0 === t && (t = 0),
  43514. this.array.set(e, t),
  43515. this
  43516. },
  43517. clone: function() {
  43518. return (new this.constructor).copy(this)
  43519. }
  43520. },
  43521. n.InstancedInterleavedBuffer = function(e, t, i) {
  43522. n.InterleavedBuffer.call(this, e, t),
  43523. this.meshPerAttribute = i || 1
  43524. }
  43525. ,
  43526. n.InstancedInterleavedBuffer.prototype = Object.create(n.InterleavedBuffer.prototype),
  43527. n.InstancedInterleavedBuffer.prototype.constructor = n.InstancedInterleavedBuffer,
  43528. n.InstancedInterleavedBuffer.prototype.copy = function(e) {
  43529. return n.InterleavedBuffer.prototype.copy.call(this, e),
  43530. this.meshPerAttribute = e.meshPerAttribute,
  43531. this
  43532. }
  43533. ,
  43534. n.InterleavedBufferAttribute = function(e, t, i) {
  43535. this.uuid = n.Math.generateUUID(),
  43536. this.data = e,
  43537. this.itemSize = t,
  43538. this.offset = i
  43539. }
  43540. ,
  43541. n.InterleavedBufferAttribute.prototype = {
  43542. constructor: n.InterleavedBufferAttribute,
  43543. get length() {
  43544. return console.warn("THREE.BufferAttribute: .length has been deprecated. Please use .count."),
  43545. this.array.length
  43546. },
  43547. get count() {
  43548. return this.data.count
  43549. },
  43550. setX: function(e, t) {
  43551. return this.data.array[e * this.data.stride + this.offset] = t,
  43552. this
  43553. },
  43554. setY: function(e, t) {
  43555. return this.data.array[e * this.data.stride + this.offset + 1] = t,
  43556. this
  43557. },
  43558. setZ: function(e, t) {
  43559. return this.data.array[e * this.data.stride + this.offset + 2] = t,
  43560. this
  43561. },
  43562. setW: function(e, t) {
  43563. return this.data.array[e * this.data.stride + this.offset + 3] = t,
  43564. this
  43565. },
  43566. getX: function(e) {
  43567. return this.data.array[e * this.data.stride + this.offset]
  43568. },
  43569. getY: function(e) {
  43570. return this.data.array[e * this.data.stride + this.offset + 1]
  43571. },
  43572. getZ: function(e) {
  43573. return this.data.array[e * this.data.stride + this.offset + 2]
  43574. },
  43575. getW: function(e) {
  43576. return this.data.array[e * this.data.stride + this.offset + 3]
  43577. },
  43578. setXY: function(e, t, i) {
  43579. return e = e * this.data.stride + this.offset,
  43580. this.data.array[e + 0] = t,
  43581. this.data.array[e + 1] = i,
  43582. this
  43583. },
  43584. setXYZ: function(e, t, i, n) {
  43585. return e = e * this.data.stride + this.offset,
  43586. this.data.array[e + 0] = t,
  43587. this.data.array[e + 1] = i,
  43588. this.data.array[e + 2] = n,
  43589. this
  43590. },
  43591. setXYZW: function(e, t, i, n, r) {
  43592. return e = e * this.data.stride + this.offset,
  43593. this.data.array[e + 0] = t,
  43594. this.data.array[e + 1] = i,
  43595. this.data.array[e + 2] = n,
  43596. this.data.array[e + 3] = r,
  43597. this
  43598. }
  43599. },
  43600. n.Geometry = function() {
  43601. Object.defineProperty(this, "id", {
  43602. value: n.GeometryIdCount++
  43603. }),
  43604. this.uuid = n.Math.generateUUID(),
  43605. this.name = "",
  43606. this.type = "Geometry",
  43607. this.vertices = [],
  43608. this.colors = [],
  43609. this.faces = [],
  43610. this.faceVertexUvs = [[]],
  43611. this.morphTargets = [],
  43612. this.morphNormals = [],
  43613. this.skinWeights = [],
  43614. this.skinIndices = [],
  43615. this.lineDistances = [],
  43616. this.boundingBox = null,
  43617. this.boundingSphere = null,
  43618. this.verticesNeedUpdate = !1,
  43619. this.elementsNeedUpdate = !1,
  43620. this.uvsNeedUpdate = !1,
  43621. this.normalsNeedUpdate = !1,
  43622. this.colorsNeedUpdate = !1,
  43623. this.lineDistancesNeedUpdate = !1,
  43624. this.groupsNeedUpdate = !1
  43625. }
  43626. ,
  43627. n.Geometry.prototype = {
  43628. constructor: n.Geometry,
  43629. applyMatrix: function(e) {
  43630. for (var t = (new n.Matrix3).getNormalMatrix(e), i = 0, r = this.vertices.length; i < r; i++) {
  43631. var o = this.vertices[i];
  43632. o.applyMatrix4(e)
  43633. }
  43634. for (var i = 0, r = this.faces.length; i < r; i++) {
  43635. var a = this.faces[i];
  43636. a.normal.applyMatrix3(t).normalize();
  43637. for (var s = 0, l = a.vertexNormals.length; s < l; s++)
  43638. a.vertexNormals[s].applyMatrix3(t).normalize()
  43639. }
  43640. return null !== this.boundingBox && this.computeBoundingBox(),
  43641. null !== this.boundingSphere && this.computeBoundingSphere(),
  43642. this.verticesNeedUpdate = !0,
  43643. this.normalsNeedUpdate = !0,
  43644. this
  43645. },
  43646. rotateX: function() {
  43647. var e;
  43648. return function(t) {
  43649. return void 0 === e && (e = new n.Matrix4),
  43650. e.makeRotationX(t),
  43651. this.applyMatrix(e),
  43652. this
  43653. }
  43654. }(),
  43655. rotateY: function() {
  43656. var e;
  43657. return function(t) {
  43658. return void 0 === e && (e = new n.Matrix4),
  43659. e.makeRotationY(t),
  43660. this.applyMatrix(e),
  43661. this
  43662. }
  43663. }(),
  43664. rotateZ: function() {
  43665. var e;
  43666. return function(t) {
  43667. return void 0 === e && (e = new n.Matrix4),
  43668. e.makeRotationZ(t),
  43669. this.applyMatrix(e),
  43670. this
  43671. }
  43672. }(),
  43673. translate: function() {
  43674. var e;
  43675. return function(t, i, r) {
  43676. return void 0 === e && (e = new n.Matrix4),
  43677. e.makeTranslation(t, i, r),
  43678. this.applyMatrix(e),
  43679. this
  43680. }
  43681. }(),
  43682. scale: function() {
  43683. var e;
  43684. return function(t, i, r) {
  43685. return void 0 === e && (e = new n.Matrix4),
  43686. e.makeScale(t, i, r),
  43687. this.applyMatrix(e),
  43688. this
  43689. }
  43690. }(),
  43691. lookAt: function() {
  43692. var e;
  43693. return function(t) {
  43694. void 0 === e && (e = new n.Object3D),
  43695. e.lookAt(t),
  43696. e.updateMatrix(),
  43697. this.applyMatrix(e.matrix)
  43698. }
  43699. }(),
  43700. fromBufferGeometry: function(e) {
  43701. function t(e, t, r, o) {
  43702. var a = void 0 !== s ? [u[e].clone(), u[t].clone(), u[r].clone()] : []
  43703. , f = void 0 !== l ? [i.colors[e].clone(), i.colors[t].clone(), i.colors[r].clone()] : []
  43704. , g = new n.Face3(e,t,r,a,f,o);
  43705. i.faces.push(g),
  43706. void 0 !== c && i.faceVertexUvs[0].push([d[e].clone(), d[t].clone(), d[r].clone()]),
  43707. void 0 !== h && i.faceVertexUvs[1].push([p[e].clone(), p[t].clone(), p[r].clone()])
  43708. }
  43709. var i = this
  43710. , r = null !== e.index ? e.index.array : void 0
  43711. , o = e.attributes
  43712. , a = o.position.array
  43713. , s = void 0 !== o.normal ? o.normal.array : void 0
  43714. , l = void 0 !== o.color ? o.color.array : void 0
  43715. , c = void 0 !== o.uv ? o.uv.array : void 0
  43716. , h = void 0 !== o.uv2 ? o.uv2.array : void 0;
  43717. void 0 !== h && (this.faceVertexUvs[1] = []);
  43718. for (var u = [], d = [], p = [], f = 0, g = 0; f < a.length; f += 3,
  43719. g += 2)
  43720. i.vertices.push(new n.Vector3(a[f],a[f + 1],a[f + 2])),
  43721. void 0 !== s && u.push(new n.Vector3(s[f],s[f + 1],s[f + 2])),
  43722. void 0 !== l && i.colors.push(new n.Color(l[f],l[f + 1],l[f + 2])),
  43723. void 0 !== c && d.push(new n.Vector2(c[g],c[g + 1])),
  43724. void 0 !== h && p.push(new n.Vector2(h[g],h[g + 1]));
  43725. if (void 0 !== r) {
  43726. var m = e.groups;
  43727. if (m.length > 0)
  43728. for (var f = 0; f < m.length; f++)
  43729. for (var v = m[f], A = v.start, y = v.count, g = A, C = A + y; g < C; g += 3)
  43730. t(r[g], r[g + 1], r[g + 2], v.materialIndex);
  43731. else
  43732. for (var f = 0; f < r.length; f += 3)
  43733. t(r[f], r[f + 1], r[f + 2])
  43734. } else
  43735. for (var f = 0; f < a.length / 3; f += 3)
  43736. t(f, f + 1, f + 2);
  43737. return this.computeFaceNormals(),
  43738. null !== e.boundingBox && (this.boundingBox = e.boundingBox.clone()),
  43739. null !== e.boundingSphere && (this.boundingSphere = e.boundingSphere.clone()),
  43740. this
  43741. },
  43742. center: function() {
  43743. this.computeBoundingBox();
  43744. var e = this.boundingBox.center().negate();
  43745. return this.translate(e.x, e.y, e.z),
  43746. e
  43747. },
  43748. normalize: function() {
  43749. this.computeBoundingSphere();
  43750. var e = this.boundingSphere.center
  43751. , t = this.boundingSphere.radius
  43752. , i = 0 === t ? 1 : 1 / t
  43753. , r = new n.Matrix4;
  43754. 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),
  43755. this.applyMatrix(r),
  43756. this
  43757. },
  43758. computeFaceNormals: function() {
  43759. for (var e = new n.Vector3, t = new n.Vector3, i = 0, r = this.faces.length; i < r; i++) {
  43760. var o = this.faces[i]
  43761. , a = this.vertices[o.a]
  43762. , s = this.vertices[o.b]
  43763. , l = this.vertices[o.c];
  43764. e.subVectors(l, s),
  43765. t.subVectors(a, s),
  43766. e.cross(t),
  43767. e.normalize(),
  43768. o.normal.copy(e)
  43769. }
  43770. },
  43771. computeVertexNormals: function(e) {
  43772. void 0 === e && (e = !0);
  43773. var t, i, r, o, a, s;
  43774. for (s = new Array(this.vertices.length),
  43775. t = 0,
  43776. i = this.vertices.length; t < i; t++)
  43777. s[t] = new n.Vector3;
  43778. if (e) {
  43779. var l, c, h, u = new n.Vector3, d = new n.Vector3;
  43780. for (r = 0,
  43781. o = this.faces.length; r < o; r++)
  43782. a = this.faces[r],
  43783. l = this.vertices[a.a],
  43784. c = this.vertices[a.b],
  43785. h = this.vertices[a.c],
  43786. u.subVectors(h, c),
  43787. d.subVectors(l, c),
  43788. u.cross(d),
  43789. s[a.a].add(u),
  43790. s[a.b].add(u),
  43791. s[a.c].add(u)
  43792. } else
  43793. for (r = 0,
  43794. o = this.faces.length; r < o; r++)
  43795. a = this.faces[r],
  43796. s[a.a].add(a.normal),
  43797. s[a.b].add(a.normal),
  43798. s[a.c].add(a.normal);
  43799. for (t = 0,
  43800. i = this.vertices.length; t < i; t++)
  43801. s[t].normalize();
  43802. for (r = 0,
  43803. o = this.faces.length; r < o; r++) {
  43804. a = this.faces[r];
  43805. var p = a.vertexNormals;
  43806. 3 === p.length ? (p[0].copy(s[a.a]),
  43807. p[1].copy(s[a.b]),
  43808. p[2].copy(s[a.c])) : (p[0] = s[a.a].clone(),
  43809. p[1] = s[a.b].clone(),
  43810. p[2] = s[a.c].clone())
  43811. }
  43812. this.faces.length > 0 && (this.normalsNeedUpdate = !0)
  43813. },
  43814. computeMorphNormals: function() {
  43815. var e, t, i, r, o;
  43816. for (i = 0,
  43817. r = this.faces.length; i < r; i++)
  43818. for (o = this.faces[i],
  43819. o.__originalFaceNormal ? o.__originalFaceNormal.copy(o.normal) : o.__originalFaceNormal = o.normal.clone(),
  43820. o.__originalVertexNormals || (o.__originalVertexNormals = []),
  43821. e = 0,
  43822. t = o.vertexNormals.length; e < t; e++)
  43823. o.__originalVertexNormals[e] ? o.__originalVertexNormals[e].copy(o.vertexNormals[e]) : o.__originalVertexNormals[e] = o.vertexNormals[e].clone();
  43824. var a = new n.Geometry;
  43825. for (a.faces = this.faces,
  43826. e = 0,
  43827. t = this.morphTargets.length; e < t; e++) {
  43828. if (!this.morphNormals[e]) {
  43829. this.morphNormals[e] = {},
  43830. this.morphNormals[e].faceNormals = [],
  43831. this.morphNormals[e].vertexNormals = [];
  43832. var s, l, c = this.morphNormals[e].faceNormals, h = this.morphNormals[e].vertexNormals;
  43833. for (i = 0,
  43834. r = this.faces.length; i < r; i++)
  43835. s = new n.Vector3,
  43836. l = {
  43837. a: new n.Vector3,
  43838. b: new n.Vector3,
  43839. c: new n.Vector3
  43840. },
  43841. c.push(s),
  43842. h.push(l)
  43843. }
  43844. var u = this.morphNormals[e];
  43845. a.vertices = this.morphTargets[e].vertices,
  43846. a.computeFaceNormals(),
  43847. a.computeVertexNormals();
  43848. var s, l;
  43849. for (i = 0,
  43850. r = this.faces.length; i < r; i++)
  43851. o = this.faces[i],
  43852. s = u.faceNormals[i],
  43853. l = u.vertexNormals[i],
  43854. s.copy(o.normal),
  43855. l.a.copy(o.vertexNormals[0]),
  43856. l.b.copy(o.vertexNormals[1]),
  43857. l.c.copy(o.vertexNormals[2])
  43858. }
  43859. for (i = 0,
  43860. r = this.faces.length; i < r; i++)
  43861. o = this.faces[i],
  43862. o.normal = o.__originalFaceNormal,
  43863. o.vertexNormals = o.__originalVertexNormals
  43864. },
  43865. computeTangents: function() {
  43866. console.warn("THREE.Geometry: .computeTangents() has been removed.")
  43867. },
  43868. computeLineDistances: function() {
  43869. for (var e = 0, t = this.vertices, i = 0, n = t.length; i < n; i++)
  43870. i > 0 && (e += t[i].distanceTo(t[i - 1])),
  43871. this.lineDistances[i] = e
  43872. },
  43873. computeBoundingBox: function() {
  43874. null === this.boundingBox && (this.boundingBox = new n.Box3),
  43875. this.boundingBox.setFromPoints(this.vertices)
  43876. },
  43877. computeBoundingSphere: function() {
  43878. null === this.boundingSphere && (this.boundingSphere = new n.Sphere),
  43879. this.boundingSphere.setFromPoints(this.vertices)
  43880. },
  43881. merge: function(e, t, i) {
  43882. if (e instanceof n.Geometry == !1)
  43883. return void console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.", e);
  43884. 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];
  43885. void 0 === i && (i = 0),
  43886. void 0 !== t && (r = (new n.Matrix3).getNormalMatrix(t));
  43887. for (var d = 0, p = s.length; d < p; d++) {
  43888. var f = s[d]
  43889. , g = f.clone();
  43890. void 0 !== t && g.applyMatrix4(t),
  43891. a.push(g)
  43892. }
  43893. for (d = 0,
  43894. p = c.length; d < p; d++) {
  43895. var m, v, A, y = c[d], C = y.vertexNormals, I = y.vertexColors;
  43896. m = new n.Face3(y.a + o,y.b + o,y.c + o),
  43897. m.normal.copy(y.normal),
  43898. void 0 !== r && m.normal.applyMatrix3(r).normalize();
  43899. for (var E = 0, b = C.length; E < b; E++)
  43900. v = C[E].clone(),
  43901. void 0 !== r && v.applyMatrix3(r).normalize(),
  43902. m.vertexNormals.push(v);
  43903. m.color.copy(y.color);
  43904. for (var E = 0, b = I.length; E < b; E++)
  43905. A = I[E],
  43906. m.vertexColors.push(A.clone());
  43907. m.materialIndex = y.materialIndex + i,
  43908. l.push(m)
  43909. }
  43910. for (d = 0,
  43911. p = u.length; d < p; d++) {
  43912. var w = u[d]
  43913. , _ = [];
  43914. if (void 0 !== w) {
  43915. for (var E = 0, b = w.length; E < b; E++)
  43916. _.push(w[E].clone());
  43917. h.push(_)
  43918. }
  43919. }
  43920. },
  43921. mergeMesh: function(e) {
  43922. return e instanceof n.Mesh == !1 ? void console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.", e) : (e.matrixAutoUpdate && e.updateMatrix(),
  43923. void this.merge(e.geometry, e.matrix))
  43924. },
  43925. mergeVertices: function() {
  43926. var e, t, i, n, r, o, a, s, l = {}, c = [], h = [], u = 4, d = Math.pow(10, u);
  43927. for (i = 0,
  43928. n = this.vertices.length; i < n; i++)
  43929. e = this.vertices[i],
  43930. t = Math.round(e.x * d) + "_" + Math.round(e.y * d) + "_" + Math.round(e.z * d),
  43931. void 0 === l[t] ? (l[t] = i,
  43932. c.push(this.vertices[i]),
  43933. h[i] = c.length - 1) : h[i] = h[l[t]];
  43934. var p = [];
  43935. for (i = 0,
  43936. n = this.faces.length; i < n; i++) {
  43937. r = this.faces[i],
  43938. r.a = h[r.a],
  43939. r.b = h[r.b],
  43940. r.c = h[r.c],
  43941. o = [r.a, r.b, r.c];
  43942. for (var f = -1, g = 0; g < 3; g++)
  43943. if (o[g] === o[(g + 1) % 3]) {
  43944. f = g,
  43945. p.push(i);
  43946. break
  43947. }
  43948. }
  43949. for (i = p.length - 1; i >= 0; i--) {
  43950. var m = p[i];
  43951. for (this.faces.splice(m, 1),
  43952. a = 0,
  43953. s = this.faceVertexUvs.length; a < s; a++)
  43954. this.faceVertexUvs[a].splice(m, 1)
  43955. }
  43956. var v = this.vertices.length - c.length;
  43957. return this.vertices = c,
  43958. v
  43959. },
  43960. sortFacesByMaterialIndex: function() {
  43961. function e(e, t) {
  43962. return e.materialIndex - t.materialIndex
  43963. }
  43964. for (var t = this.faces, i = t.length, n = 0; n < i; n++)
  43965. t[n]._id = n;
  43966. t.sort(e);
  43967. var r, o, a = this.faceVertexUvs[0], s = this.faceVertexUvs[1];
  43968. a && a.length === i && (r = []),
  43969. s && s.length === i && (o = []);
  43970. for (var n = 0; n < i; n++) {
  43971. var l = t[n]._id;
  43972. r && r.push(a[l]),
  43973. o && o.push(s[l])
  43974. }
  43975. r && (this.faceVertexUvs[0] = r),
  43976. o && (this.faceVertexUvs[1] = o)
  43977. },
  43978. toJSON: function() {
  43979. function e(e, t, i) {
  43980. return i ? e | 1 << t : e & ~(1 << t)
  43981. }
  43982. function t(e) {
  43983. var t = e.x.toString() + e.y.toString() + e.z.toString();
  43984. return void 0 !== d[t] ? d[t] : (d[t] = u.length / 3,
  43985. u.push(e.x, e.y, e.z),
  43986. d[t])
  43987. }
  43988. function i(e) {
  43989. var t = e.r.toString() + e.g.toString() + e.b.toString();
  43990. return void 0 !== f[t] ? f[t] : (f[t] = p.length,
  43991. p.push(e.getHex()),
  43992. f[t])
  43993. }
  43994. function n(e) {
  43995. var t = e.x.toString() + e.y.toString();
  43996. return void 0 !== m[t] ? m[t] : (m[t] = g.length / 2,
  43997. g.push(e.x, e.y),
  43998. m[t])
  43999. }
  44000. var r = {
  44001. metadata: {
  44002. version: 4.4,
  44003. type: "Geometry",
  44004. generator: "Geometry.toJSON"
  44005. }
  44006. };
  44007. if (r.uuid = this.uuid,
  44008. r.type = this.type,
  44009. "" !== this.name && (r.name = this.name),
  44010. void 0 !== this.parameters) {
  44011. var o = this.parameters;
  44012. for (var a in o)
  44013. void 0 !== o[a] && (r[a] = o[a]);
  44014. return r
  44015. }
  44016. for (var s = [], l = 0; l < this.vertices.length; l++) {
  44017. var c = this.vertices[l];
  44018. s.push(c.x, c.y, c.z)
  44019. }
  44020. for (var h = [], u = [], d = {}, p = [], f = {}, g = [], m = {}, l = 0; l < this.faces.length; l++) {
  44021. var v = this.faces[l]
  44022. , A = !0
  44023. , y = !1
  44024. , C = void 0 !== this.faceVertexUvs[0][l]
  44025. , I = v.normal.length() > 0
  44026. , E = v.vertexNormals.length > 0
  44027. , b = 1 !== v.color.r || 1 !== v.color.g || 1 !== v.color.b
  44028. , w = v.vertexColors.length > 0
  44029. , _ = 0;
  44030. if (_ = e(_, 0, 0),
  44031. _ = e(_, 1, A),
  44032. _ = e(_, 2, y),
  44033. _ = e(_, 3, C),
  44034. _ = e(_, 4, I),
  44035. _ = e(_, 5, E),
  44036. _ = e(_, 6, b),
  44037. _ = e(_, 7, w),
  44038. h.push(_),
  44039. h.push(v.a, v.b, v.c),
  44040. h.push(v.materialIndex),
  44041. C) {
  44042. var T = this.faceVertexUvs[0][l];
  44043. h.push(n(T[0]), n(T[1]), n(T[2]))
  44044. }
  44045. if (I && h.push(t(v.normal)),
  44046. E) {
  44047. var x = v.vertexNormals;
  44048. h.push(t(x[0]), t(x[1]), t(x[2]))
  44049. }
  44050. if (b && h.push(i(v.color)),
  44051. w) {
  44052. var S = v.vertexColors;
  44053. h.push(i(S[0]), i(S[1]), i(S[2]))
  44054. }
  44055. }
  44056. return r.data = {},
  44057. r.data.vertices = s,
  44058. r.data.normals = u,
  44059. p.length > 0 && (r.data.colors = p),
  44060. g.length > 0 && (r.data.uvs = [g]),
  44061. r.data.faces = h,
  44062. r
  44063. },
  44064. clone: function() {
  44065. return (new n.Geometry).copy(this)
  44066. },
  44067. copy: function(e) {
  44068. this.vertices = [],
  44069. this.faces = [],
  44070. this.faceVertexUvs = [[]];
  44071. for (var t = e.vertices, i = 0, n = t.length; i < n; i++)
  44072. this.vertices.push(t[i].clone());
  44073. for (var r = e.faces, i = 0, n = r.length; i < n; i++)
  44074. this.faces.push(r[i].clone());
  44075. for (var i = 0, n = e.faceVertexUvs.length; i < n; i++) {
  44076. var o = e.faceVertexUvs[i];
  44077. void 0 === this.faceVertexUvs[i] && (this.faceVertexUvs[i] = []);
  44078. for (var a = 0, s = o.length; a < s; a++) {
  44079. for (var l = o[a], c = [], h = 0, u = l.length; h < u; h++) {
  44080. var d = l[h];
  44081. c.push(d.clone())
  44082. }
  44083. this.faceVertexUvs[i].push(c)
  44084. }
  44085. }
  44086. return this
  44087. },
  44088. dispose: function() {
  44089. this.dispatchEvent({
  44090. type: "dispose"
  44091. })
  44092. }
  44093. },
  44094. n.EventDispatcher.prototype.apply(n.Geometry.prototype),
  44095. n.GeometryIdCount = 0,
  44096. n.DirectGeometry = function() {
  44097. Object.defineProperty(this, "id", {
  44098. value: n.GeometryIdCount++
  44099. }),
  44100. this.uuid = n.Math.generateUUID(),
  44101. this.name = "",
  44102. this.type = "DirectGeometry",
  44103. this.indices = [],
  44104. this.vertices = [],
  44105. this.normals = [],
  44106. this.colors = [],
  44107. this.uvs = [],
  44108. this.uvs2 = [],
  44109. this.groups = [],
  44110. this.morphTargets = {},
  44111. this.skinWeights = [],
  44112. this.skinIndices = [],
  44113. this.boundingBox = null,
  44114. this.boundingSphere = null,
  44115. this.verticesNeedUpdate = !1,
  44116. this.normalsNeedUpdate = !1,
  44117. this.colorsNeedUpdate = !1,
  44118. this.uvsNeedUpdate = !1,
  44119. this.groupsNeedUpdate = !1
  44120. }
  44121. ,
  44122. n.DirectGeometry.prototype = {
  44123. constructor: n.DirectGeometry,
  44124. computeBoundingBox: n.Geometry.prototype.computeBoundingBox,
  44125. computeBoundingSphere: n.Geometry.prototype.computeBoundingSphere,
  44126. computeFaceNormals: function() {
  44127. console.warn("THREE.DirectGeometry: computeFaceNormals() is not a method of this type of geometry.")
  44128. },
  44129. computeVertexNormals: function() {
  44130. console.warn("THREE.DirectGeometry: computeVertexNormals() is not a method of this type of geometry.")
  44131. },
  44132. computeGroups: function(e) {
  44133. for (var t, i, n = [], r = e.faces, o = 0; o < r.length; o++) {
  44134. var a = r[o];
  44135. a.materialIndex !== i && (i = a.materialIndex,
  44136. void 0 !== t && (t.count = 3 * o - t.start,
  44137. n.push(t)),
  44138. t = {
  44139. start: 3 * o,
  44140. materialIndex: i
  44141. })
  44142. }
  44143. void 0 !== t && (t.count = 3 * o - t.start,
  44144. n.push(t)),
  44145. this.groups = n
  44146. },
  44147. fromGeometry: function(e) {
  44148. 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;
  44149. if (c > 0) {
  44150. t = [];
  44151. for (var h = 0; h < c; h++)
  44152. t[h] = [];
  44153. this.morphTargets.position = t
  44154. }
  44155. var u, d = e.morphNormals, p = d.length;
  44156. if (p > 0) {
  44157. u = [];
  44158. for (var h = 0; h < p; h++)
  44159. u[h] = [];
  44160. this.morphTargets.normal = u
  44161. }
  44162. for (var f = e.skinIndices, g = e.skinWeights, m = f.length === r.length, v = g.length === r.length, h = 0; h < i.length; h++) {
  44163. var A = i[h];
  44164. this.vertices.push(r[A.a], r[A.b], r[A.c]);
  44165. var y = A.vertexNormals;
  44166. if (3 === y.length)
  44167. this.normals.push(y[0], y[1], y[2]);
  44168. else {
  44169. var C = A.normal;
  44170. this.normals.push(C, C, C)
  44171. }
  44172. var I = A.vertexColors;
  44173. if (3 === I.length)
  44174. this.colors.push(I[0], I[1], I[2]);
  44175. else {
  44176. var E = A.color;
  44177. this.colors.push(E, E, E)
  44178. }
  44179. if (a === !0) {
  44180. var b = o[0][h];
  44181. void 0 !== b ? this.uvs.push(b[0], b[1], b[2]) : (console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ", h),
  44182. this.uvs.push(new n.Vector2, new n.Vector2, new n.Vector2))
  44183. }
  44184. if (s === !0) {
  44185. var b = o[1][h];
  44186. void 0 !== b ? this.uvs2.push(b[0], b[1], b[2]) : (console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ", h),
  44187. this.uvs2.push(new n.Vector2, new n.Vector2, new n.Vector2))
  44188. }
  44189. for (var w = 0; w < c; w++) {
  44190. var _ = l[w].vertices;
  44191. t[w].push(_[A.a], _[A.b], _[A.c])
  44192. }
  44193. for (var w = 0; w < p; w++) {
  44194. var T = d[w].vertexNormals[h];
  44195. u[w].push(T.a, T.b, T.c)
  44196. }
  44197. m && this.skinIndices.push(f[A.a], f[A.b], f[A.c]),
  44198. v && this.skinWeights.push(g[A.a], g[A.b], g[A.c])
  44199. }
  44200. return this.computeGroups(e),
  44201. this.verticesNeedUpdate = e.verticesNeedUpdate,
  44202. this.normalsNeedUpdate = e.normalsNeedUpdate,
  44203. this.colorsNeedUpdate = e.colorsNeedUpdate,
  44204. this.uvsNeedUpdate = e.uvsNeedUpdate,
  44205. this.groupsNeedUpdate = e.groupsNeedUpdate,
  44206. this
  44207. },
  44208. dispose: function() {
  44209. this.dispatchEvent({
  44210. type: "dispose"
  44211. })
  44212. }
  44213. },
  44214. n.EventDispatcher.prototype.apply(n.DirectGeometry.prototype),
  44215. n.BufferGeometry = function() {
  44216. Object.defineProperty(this, "id", {
  44217. value: n.GeometryIdCount++
  44218. }),
  44219. this.uuid = n.Math.generateUUID(),
  44220. this.name = "",
  44221. this.type = "BufferGeometry",
  44222. this.index = null,
  44223. this.attributes = {},
  44224. this.morphAttributes = {},
  44225. this.groups = [],
  44226. this.boundingBox = null,
  44227. this.boundingSphere = null,
  44228. this.drawRange = {
  44229. start: 0,
  44230. count: 1 / 0
  44231. }
  44232. }
  44233. ,
  44234. n.BufferGeometry.prototype = {
  44235. constructor: n.BufferGeometry,
  44236. getIndex: function() {
  44237. return this.index
  44238. },
  44239. setIndex: function(e) {
  44240. this.index = e
  44241. },
  44242. addAttribute: function(e, t) {
  44243. return t instanceof n.BufferAttribute == !1 && t instanceof n.InterleavedBufferAttribute == !1 ? (console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),
  44244. void this.addAttribute(e, new n.BufferAttribute(arguments[1],arguments[2]))) : "index" === e ? (console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),
  44245. void this.setIndex(t)) : (this.attributes[e] = t,
  44246. this)
  44247. },
  44248. getAttribute: function(e) {
  44249. return this.attributes[e]
  44250. },
  44251. removeAttribute: function(e) {
  44252. return delete this.attributes[e],
  44253. this
  44254. },
  44255. addGroup: function(e, t, i) {
  44256. this.groups.push({
  44257. start: e,
  44258. count: t,
  44259. materialIndex: void 0 !== i ? i : 0
  44260. })
  44261. },
  44262. clearGroups: function() {
  44263. this.groups = []
  44264. },
  44265. setDrawRange: function(e, t) {
  44266. this.drawRange.start = e,
  44267. this.drawRange.count = t
  44268. },
  44269. applyMatrix: function(e) {
  44270. var t = this.attributes.position;
  44271. void 0 !== t && (e.applyToVector3Array(t.array),
  44272. t.needsUpdate = !0);
  44273. var i = this.attributes.normal;
  44274. if (void 0 !== i) {
  44275. var r = (new n.Matrix3).getNormalMatrix(e);
  44276. r.applyToVector3Array(i.array),
  44277. i.needsUpdate = !0
  44278. }
  44279. return null !== this.boundingBox && this.computeBoundingBox(),
  44280. null !== this.boundingSphere && this.computeBoundingSphere(),
  44281. this
  44282. },
  44283. rotateX: function() {
  44284. var e;
  44285. return function(t) {
  44286. return void 0 === e && (e = new n.Matrix4),
  44287. e.makeRotationX(t),
  44288. this.applyMatrix(e),
  44289. this
  44290. }
  44291. }(),
  44292. rotateY: function() {
  44293. var e;
  44294. return function(t) {
  44295. return void 0 === e && (e = new n.Matrix4),
  44296. e.makeRotationY(t),
  44297. this.applyMatrix(e),
  44298. this
  44299. }
  44300. }(),
  44301. rotateZ: function() {
  44302. var e;
  44303. return function(t) {
  44304. return void 0 === e && (e = new n.Matrix4),
  44305. e.makeRotationZ(t),
  44306. this.applyMatrix(e),
  44307. this
  44308. }
  44309. }(),
  44310. translate: function() {
  44311. var e;
  44312. return function(t, i, r) {
  44313. return void 0 === e && (e = new n.Matrix4),
  44314. e.makeTranslation(t, i, r),
  44315. this.applyMatrix(e),
  44316. this
  44317. }
  44318. }(),
  44319. scale: function() {
  44320. var e;
  44321. return function(t, i, r) {
  44322. return void 0 === e && (e = new n.Matrix4),
  44323. e.makeScale(t, i, r),
  44324. this.applyMatrix(e),
  44325. this
  44326. }
  44327. }(),
  44328. lookAt: function() {
  44329. var e;
  44330. return function(t) {
  44331. void 0 === e && (e = new n.Object3D),
  44332. e.lookAt(t),
  44333. e.updateMatrix(),
  44334. this.applyMatrix(e.matrix)
  44335. }
  44336. }(),
  44337. center: function() {
  44338. this.computeBoundingBox();
  44339. var e = this.boundingBox.center().negate();
  44340. return this.translate(e.x, e.y, e.z),
  44341. e
  44342. },
  44343. setFromObject: function(e) {
  44344. var t = e.geometry;
  44345. if (e instanceof n.Points || e instanceof n.Line) {
  44346. var i = new n.Float32Attribute(3 * t.vertices.length,3)
  44347. , r = new n.Float32Attribute(3 * t.colors.length,3);
  44348. if (this.addAttribute("position", i.copyVector3sArray(t.vertices)),
  44349. this.addAttribute("color", r.copyColorsArray(t.colors)),
  44350. t.lineDistances && t.lineDistances.length === t.vertices.length) {
  44351. var o = new n.Float32Attribute(t.lineDistances.length,1);
  44352. this.addAttribute("lineDistance", o.copyArray(t.lineDistances))
  44353. }
  44354. null !== t.boundingSphere && (this.boundingSphere = t.boundingSphere.clone()),
  44355. null !== t.boundingBox && (this.boundingBox = t.boundingBox.clone())
  44356. } else
  44357. e instanceof n.Mesh && t instanceof n.Geometry && this.fromGeometry(t);
  44358. return this
  44359. },
  44360. updateFromObject: function(e) {
  44361. var t = e.geometry;
  44362. if (e instanceof n.Mesh) {
  44363. var i = t.__directGeometry;
  44364. if (void 0 === i)
  44365. return this.fromGeometry(t);
  44366. i.verticesNeedUpdate = t.verticesNeedUpdate,
  44367. i.normalsNeedUpdate = t.normalsNeedUpdate,
  44368. i.colorsNeedUpdate = t.colorsNeedUpdate,
  44369. i.uvsNeedUpdate = t.uvsNeedUpdate,
  44370. i.groupsNeedUpdate = t.groupsNeedUpdate,
  44371. t.verticesNeedUpdate = !1,
  44372. t.normalsNeedUpdate = !1,
  44373. t.colorsNeedUpdate = !1,
  44374. t.uvsNeedUpdate = !1,
  44375. t.groupsNeedUpdate = !1,
  44376. t = i
  44377. }
  44378. if (t.verticesNeedUpdate === !0) {
  44379. var r = this.attributes.position;
  44380. void 0 !== r && (r.copyVector3sArray(t.vertices),
  44381. r.needsUpdate = !0),
  44382. t.verticesNeedUpdate = !1
  44383. }
  44384. if (t.normalsNeedUpdate === !0) {
  44385. var r = this.attributes.normal;
  44386. void 0 !== r && (r.copyVector3sArray(t.normals),
  44387. r.needsUpdate = !0),
  44388. t.normalsNeedUpdate = !1
  44389. }
  44390. if (t.colorsNeedUpdate === !0) {
  44391. var r = this.attributes.color;
  44392. void 0 !== r && (r.copyColorsArray(t.colors),
  44393. r.needsUpdate = !0),
  44394. t.colorsNeedUpdate = !1
  44395. }
  44396. if (t.uvsNeedUpdate) {
  44397. var r = this.attributes.uv;
  44398. void 0 !== r && (r.copyVector2sArray(t.uvs),
  44399. r.needsUpdate = !0),
  44400. t.uvsNeedUpdate = !1
  44401. }
  44402. if (t.lineDistancesNeedUpdate) {
  44403. var r = this.attributes.lineDistance;
  44404. void 0 !== r && (r.copyArray(t.lineDistances),
  44405. r.needsUpdate = !0),
  44406. t.lineDistancesNeedUpdate = !1
  44407. }
  44408. return t.groupsNeedUpdate && (t.computeGroups(e.geometry),
  44409. this.groups = t.groups,
  44410. t.groupsNeedUpdate = !1),
  44411. this
  44412. },
  44413. fromGeometry: function(e) {
  44414. return e.__directGeometry = (new n.DirectGeometry).fromGeometry(e),
  44415. this.fromDirectGeometry(e.__directGeometry)
  44416. },
  44417. fromDirectGeometry: function(e) {
  44418. var t = new Float32Array(3 * e.vertices.length);
  44419. if (this.addAttribute("position", new n.BufferAttribute(t,3).copyVector3sArray(e.vertices)),
  44420. e.normals.length > 0) {
  44421. var i = new Float32Array(3 * e.normals.length);
  44422. this.addAttribute("normal", new n.BufferAttribute(i,3).copyVector3sArray(e.normals))
  44423. }
  44424. if (e.colors.length > 0) {
  44425. var r = new Float32Array(3 * e.colors.length);
  44426. this.addAttribute("color", new n.BufferAttribute(r,3).copyColorsArray(e.colors))
  44427. }
  44428. if (e.uvs.length > 0) {
  44429. var o = new Float32Array(2 * e.uvs.length);
  44430. this.addAttribute("uv", new n.BufferAttribute(o,2).copyVector2sArray(e.uvs))
  44431. }
  44432. if (e.uvs2.length > 0) {
  44433. var a = new Float32Array(2 * e.uvs2.length);
  44434. this.addAttribute("uv2", new n.BufferAttribute(a,2).copyVector2sArray(e.uvs2))
  44435. }
  44436. if (e.indices.length > 0) {
  44437. var s = e.vertices.length > 65535 ? Uint32Array : Uint16Array
  44438. , l = new s(3 * e.indices.length);
  44439. this.setIndex(new n.BufferAttribute(l,1).copyIndicesArray(e.indices))
  44440. }
  44441. this.groups = e.groups;
  44442. for (var c in e.morphTargets) {
  44443. for (var h = [], u = e.morphTargets[c], d = 0, p = u.length; d < p; d++) {
  44444. var f = u[d]
  44445. , g = new n.Float32Attribute(3 * f.length,3);
  44446. h.push(g.copyVector3sArray(f))
  44447. }
  44448. this.morphAttributes[c] = h
  44449. }
  44450. if (e.skinIndices.length > 0) {
  44451. var m = new n.Float32Attribute(4 * e.skinIndices.length,4);
  44452. this.addAttribute("skinIndex", m.copyVector4sArray(e.skinIndices))
  44453. }
  44454. if (e.skinWeights.length > 0) {
  44455. var v = new n.Float32Attribute(4 * e.skinWeights.length,4);
  44456. this.addAttribute("skinWeight", v.copyVector4sArray(e.skinWeights))
  44457. }
  44458. return null !== e.boundingSphere && (this.boundingSphere = e.boundingSphere.clone()),
  44459. null !== e.boundingBox && (this.boundingBox = e.boundingBox.clone()),
  44460. this
  44461. },
  44462. computeBoundingBox: function() {
  44463. new n.Vector3;
  44464. return function() {
  44465. null === this.boundingBox && (this.boundingBox = new n.Box3);
  44466. var e = this.attributes.position.array;
  44467. e && this.boundingBox.setFromArray(e),
  44468. void 0 !== e && 0 !== e.length || (this.boundingBox.min.set(0, 0, 0),
  44469. this.boundingBox.max.set(0, 0, 0)),
  44470. (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)
  44471. }
  44472. }(),
  44473. computeBoundingSphere: function() {
  44474. var e = new n.Box3
  44475. , t = new n.Vector3;
  44476. return function() {
  44477. null === this.boundingSphere && (this.boundingSphere = new n.Sphere);
  44478. var i = this.attributes.position.array;
  44479. if (i) {
  44480. var r = this.boundingSphere.center;
  44481. e.setFromArray(i),
  44482. e.center(r);
  44483. for (var o = 0, a = 0, s = i.length; a < s; a += 3)
  44484. t.fromArray(i, a),
  44485. o = Math.max(o, r.distanceToSquared(t));
  44486. this.boundingSphere.radius = Math.sqrt(o),
  44487. isNaN(this.boundingSphere.radius) && console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.', this)
  44488. }
  44489. }
  44490. }(),
  44491. computeFaceNormals: function() {},
  44492. computeVertexNormals: function() {
  44493. var e = this.index
  44494. , t = this.attributes
  44495. , i = this.groups;
  44496. if (t.position) {
  44497. var r = t.position.array;
  44498. if (void 0 === t.normal)
  44499. this.addAttribute("normal", new n.BufferAttribute(new Float32Array(r.length),3));
  44500. else
  44501. for (var o = t.normal.array, a = 0, s = o.length; a < s; a++)
  44502. o[a] = 0;
  44503. 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;
  44504. if (e) {
  44505. var v = e.array;
  44506. 0 === i.length && this.addGroup(0, v.length);
  44507. for (var A = 0, y = i.length; A < y; ++A)
  44508. for (var C = i[A], I = C.start, E = C.count, a = I, s = I + E; a < s; a += 3)
  44509. l = 3 * v[a + 0],
  44510. c = 3 * v[a + 1],
  44511. h = 3 * v[a + 2],
  44512. d.fromArray(r, l),
  44513. p.fromArray(r, c),
  44514. f.fromArray(r, h),
  44515. g.subVectors(f, p),
  44516. m.subVectors(d, p),
  44517. g.cross(m),
  44518. u[l] += g.x,
  44519. u[l + 1] += g.y,
  44520. u[l + 2] += g.z,
  44521. u[c] += g.x,
  44522. u[c + 1] += g.y,
  44523. u[c + 2] += g.z,
  44524. u[h] += g.x,
  44525. u[h + 1] += g.y,
  44526. u[h + 2] += g.z
  44527. } else
  44528. for (var a = 0, s = r.length; a < s; a += 9)
  44529. d.fromArray(r, a),
  44530. p.fromArray(r, a + 3),
  44531. f.fromArray(r, a + 6),
  44532. g.subVectors(f, p),
  44533. m.subVectors(d, p),
  44534. g.cross(m),
  44535. u[a] = g.x,
  44536. u[a + 1] = g.y,
  44537. u[a + 2] = g.z,
  44538. u[a + 3] = g.x,
  44539. u[a + 4] = g.y,
  44540. u[a + 5] = g.z,
  44541. u[a + 6] = g.x,
  44542. u[a + 7] = g.y,
  44543. u[a + 8] = g.z;
  44544. this.normalizeNormals(),
  44545. t.normal.needsUpdate = !0
  44546. }
  44547. },
  44548. merge: function(e, t) {
  44549. if (e instanceof n.BufferGeometry == !1)
  44550. return void console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.", e);
  44551. void 0 === t && (t = 0);
  44552. var i = this.attributes;
  44553. for (var r in i)
  44554. if (void 0 !== e.attributes[r])
  44555. 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++,
  44556. u++)
  44557. a[u] = l[h];
  44558. return this
  44559. },
  44560. normalizeNormals: function() {
  44561. for (var e, t, i, n, r = this.attributes.normal.array, o = 0, a = r.length; o < a; o += 3)
  44562. e = r[o],
  44563. t = r[o + 1],
  44564. i = r[o + 2],
  44565. n = 1 / Math.sqrt(e * e + t * t + i * i),
  44566. r[o] *= n,
  44567. r[o + 1] *= n,
  44568. r[o + 2] *= n
  44569. },
  44570. toNonIndexed: function() {
  44571. if (null === this.index)
  44572. return console.warn("THREE.BufferGeometry.toNonIndexed(): Geometry is already non-indexed."),
  44573. this;
  44574. var e = new n.BufferGeometry
  44575. , t = this.index.array
  44576. , i = this.attributes;
  44577. for (var r in i) {
  44578. 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++) {
  44579. c = t[u] * s;
  44580. for (var p = 0; p < s; p++)
  44581. l[h++] = a[c++]
  44582. }
  44583. e.addAttribute(r, new n.BufferAttribute(l,s))
  44584. }
  44585. return e
  44586. },
  44587. toJSON: function() {
  44588. var e = {
  44589. metadata: {
  44590. version: 4.4,
  44591. type: "BufferGeometry",
  44592. generator: "BufferGeometry.toJSON"
  44593. }
  44594. };
  44595. if (e.uuid = this.uuid,
  44596. e.type = this.type,
  44597. "" !== this.name && (e.name = this.name),
  44598. void 0 !== this.parameters) {
  44599. var t = this.parameters;
  44600. for (var i in t)
  44601. void 0 !== t[i] && (e[i] = t[i]);
  44602. return e
  44603. }
  44604. e.data = {
  44605. attributes: {}
  44606. };
  44607. var n = this.index;
  44608. if (null !== n) {
  44609. var r = Array.prototype.slice.call(n.array);
  44610. e.data.index = {
  44611. type: n.array.constructor.name,
  44612. array: r
  44613. }
  44614. }
  44615. var o = this.attributes;
  44616. for (var i in o) {
  44617. var a = o[i]
  44618. , r = Array.prototype.slice.call(a.array);
  44619. e.data.attributes[i] = {
  44620. itemSize: a.itemSize,
  44621. type: a.array.constructor.name,
  44622. array: r
  44623. }
  44624. }
  44625. var s = this.groups;
  44626. s.length > 0 && (e.data.groups = JSON.parse(JSON.stringify(s)));
  44627. var l = this.boundingSphere;
  44628. return null !== l && (e.data.boundingSphere = {
  44629. center: l.center.toArray(),
  44630. radius: l.radius
  44631. }),
  44632. e
  44633. },
  44634. clone: function() {
  44635. return (new n.BufferGeometry).copy(this)
  44636. },
  44637. copy: function(e) {
  44638. var t = e.index;
  44639. null !== t && this.setIndex(t.clone());
  44640. var i = e.attributes;
  44641. for (var n in i) {
  44642. var r = i[n];
  44643. this.addAttribute(n, r.clone())
  44644. }
  44645. for (var o = e.groups, a = 0, s = o.length; a < s; a++) {
  44646. var l = o[a];
  44647. this.addGroup(l.start, l.count)
  44648. }
  44649. return this
  44650. },
  44651. dispose: function() {
  44652. this.dispatchEvent({
  44653. type: "dispose"
  44654. })
  44655. }
  44656. },
  44657. n.EventDispatcher.prototype.apply(n.BufferGeometry.prototype),
  44658. n.BufferGeometry.MaxIndex = 65535,
  44659. n.InstancedBufferGeometry = function() {
  44660. n.BufferGeometry.call(this),
  44661. this.type = "InstancedBufferGeometry",
  44662. this.maxInstancedCount = void 0
  44663. }
  44664. ,
  44665. n.InstancedBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  44666. n.InstancedBufferGeometry.prototype.constructor = n.InstancedBufferGeometry,
  44667. n.InstancedBufferGeometry.prototype.addGroup = function(e, t, i) {
  44668. this.groups.push({
  44669. start: e,
  44670. count: t,
  44671. instances: i
  44672. })
  44673. }
  44674. ,
  44675. n.InstancedBufferGeometry.prototype.copy = function(e) {
  44676. var t = e.index;
  44677. null !== t && this.setIndex(t.clone());
  44678. var i = e.attributes;
  44679. for (var n in i) {
  44680. var r = i[n];
  44681. this.addAttribute(n, r.clone())
  44682. }
  44683. for (var o = e.groups, a = 0, s = o.length; a < s; a++) {
  44684. var l = o[a];
  44685. this.addGroup(l.start, l.count, l.instances)
  44686. }
  44687. return this
  44688. }
  44689. ,
  44690. n.EventDispatcher.prototype.apply(n.InstancedBufferGeometry.prototype),
  44691. n.Uniform = function(e, t) {
  44692. this.type = e,
  44693. this.value = t,
  44694. this.dynamic = !1
  44695. }
  44696. ,
  44697. n.Uniform.prototype = {
  44698. constructor: n.Uniform,
  44699. onUpdate: function(e) {
  44700. return this.dynamic = !0,
  44701. this.onUpdateCallback = e,
  44702. this
  44703. }
  44704. },
  44705. n.AnimationClip = function(e, t, i) {
  44706. this.name = e || n.Math.generateUUID(),
  44707. this.tracks = i,
  44708. this.duration = void 0 !== t ? t : -1,
  44709. this.duration < 0 && this.resetDuration(),
  44710. this.trim(),
  44711. this.optimize()
  44712. }
  44713. ,
  44714. n.AnimationClip.prototype = {
  44715. constructor: n.AnimationClip,
  44716. resetDuration: function() {
  44717. for (var e = this.tracks, t = 0, i = 0, n = e.length; i !== n; ++i) {
  44718. var r = this.tracks[i];
  44719. t = Math.max(t, r.times[r.times.length - 1])
  44720. }
  44721. this.duration = t
  44722. },
  44723. trim: function() {
  44724. for (var e = 0; e < this.tracks.length; e++)
  44725. this.tracks[e].trim(0, this.duration);
  44726. return this
  44727. },
  44728. optimize: function() {
  44729. for (var e = 0; e < this.tracks.length; e++)
  44730. this.tracks[e].optimize();
  44731. return this
  44732. }
  44733. },
  44734. Object.assign(n.AnimationClip, {
  44735. parse: function(e) {
  44736. for (var t = [], i = e.tracks, r = 1 / (e.fps || 1), o = 0, a = i.length; o !== a; ++o)
  44737. t.push(n.KeyframeTrack.parse(i[o]).scale(r));
  44738. return new n.AnimationClip(e.name,e.duration,t)
  44739. },
  44740. toJSON: function(e) {
  44741. for (var t = [], i = e.tracks, r = {
  44742. name: e.name,
  44743. duration: e.duration,
  44744. tracks: t
  44745. }, o = 0, a = i.length; o !== a; ++o)
  44746. t.push(n.KeyframeTrack.toJSON(i[o]));
  44747. return r
  44748. },
  44749. CreateFromMorphTargetSequence: function(e, t, i) {
  44750. for (var r = t.length, o = [], a = 0; a < r; a++) {
  44751. var s = []
  44752. , l = [];
  44753. s.push((a + r - 1) % r, a, (a + 1) % r),
  44754. l.push(0, 1, 0);
  44755. var c = n.AnimationUtils.getKeyframeOrder(s);
  44756. s = n.AnimationUtils.sortedArray(s, 1, c),
  44757. l = n.AnimationUtils.sortedArray(l, 1, c),
  44758. 0 === s[0] && (s.push(r),
  44759. l.push(l[0])),
  44760. o.push(new n.NumberKeyframeTrack(".morphTargetInfluences[" + t[a].name + "]",s,l).scale(1 / i))
  44761. }
  44762. return new n.AnimationClip(e,-1,o)
  44763. },
  44764. findByName: function(e, t) {
  44765. for (var i = 0; i < e.length; i++)
  44766. if (e[i].name === t)
  44767. return e[i];
  44768. return null
  44769. },
  44770. CreateClipsFromMorphTargetSequences: function(e, t) {
  44771. for (var i = {}, r = /^([\w-]*?)([\d]+)$/, o = 0, a = e.length; o < a; o++) {
  44772. var s = e[o]
  44773. , l = s.name.match(r);
  44774. if (l && l.length > 1) {
  44775. var c = l[1]
  44776. , h = i[c];
  44777. h || (i[c] = h = []),
  44778. h.push(s)
  44779. }
  44780. }
  44781. var u = [];
  44782. for (var c in i)
  44783. u.push(n.AnimationClip.CreateFromMorphTargetSequence(c, i[c], t));
  44784. return u
  44785. },
  44786. parseAnimation: function(e, t, i) {
  44787. if (!e)
  44788. return console.error(" no animation in JSONLoader data"),
  44789. null;
  44790. for (var r = function(e, t, i, r, o) {
  44791. if (0 !== i.length) {
  44792. var a = []
  44793. , s = [];
  44794. n.AnimationUtils.flattenJSON(i, a, s, r),
  44795. 0 !== a.length && o.push(new e(t,a,s))
  44796. }
  44797. }, o = [], a = e.name || "default", s = e.length || -1, l = e.fps || 30, c = e.hierarchy || [], h = 0; h < c.length; h++) {
  44798. var u = c[h].keys;
  44799. if (u && 0 != u.length)
  44800. if (u[0].morphTargets) {
  44801. for (var d = {}, p = 0; p < u.length; p++)
  44802. if (u[p].morphTargets)
  44803. for (var f = 0; f < u[p].morphTargets.length; f++)
  44804. d[u[p].morphTargets[f]] = -1;
  44805. for (var g in d) {
  44806. for (var m = [], v = [], f = 0; f !== u[p].morphTargets.length; ++f) {
  44807. var A = u[p];
  44808. m.push(A.time),
  44809. v.push(A.morphTarget === g ? 1 : 0)
  44810. }
  44811. o.push(new n.NumberKeyframeTrack(".morphTargetInfluence[" + g + "]",m,v))
  44812. }
  44813. s = d.length * (l || 1)
  44814. } else {
  44815. var y = ".bones[" + t[h].name + "]";
  44816. r(n.VectorKeyframeTrack, y + ".position", u, "pos", o),
  44817. r(n.QuaternionKeyframeTrack, y + ".quaternion", u, "rot", o),
  44818. r(n.VectorKeyframeTrack, y + ".scale", u, "scl", o)
  44819. }
  44820. }
  44821. if (0 === o.length)
  44822. return null;
  44823. var C = new n.AnimationClip(a,s,o);
  44824. return C
  44825. }
  44826. }),
  44827. n.AnimationMixer = function(e) {
  44828. this._root = e,
  44829. this._initMemoryManager(),
  44830. this._accuIndex = 0,
  44831. this.time = 0,
  44832. this.timeScale = 1
  44833. }
  44834. ,
  44835. n.AnimationMixer.prototype = {
  44836. constructor: n.AnimationMixer,
  44837. clipAction: function(e, t) {
  44838. 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];
  44839. if (void 0 !== l) {
  44840. var c = l.actionByRoot[o];
  44841. if (void 0 !== c)
  44842. return c;
  44843. if (i = l.knownActions[0],
  44844. s = i._clip,
  44845. e !== a && e !== s)
  44846. throw new Error("Different clips with the same name detected!")
  44847. }
  44848. if (null === s)
  44849. return null;
  44850. var h = new n.AnimationMixer._Action(this,s,t);
  44851. return this._bindAction(h, i),
  44852. this._addInactiveAction(h, a, o),
  44853. h
  44854. },
  44855. existingAction: function(e, t) {
  44856. var i = t || this._root
  44857. , n = i.uuid
  44858. , r = "string" == typeof e ? e : e.name
  44859. , o = this._actionsByClip[r];
  44860. return void 0 !== o ? o.actionByRoot[n] || null : null
  44861. },
  44862. stopAllAction: function() {
  44863. var e = this._actions
  44864. , t = this._nActiveActions
  44865. , i = this._bindings
  44866. , n = this._nActiveBindings;
  44867. this._nActiveActions = 0,
  44868. this._nActiveBindings = 0;
  44869. for (var r = 0; r !== t; ++r)
  44870. e[r].reset();
  44871. for (var r = 0; r !== n; ++r)
  44872. i[r].useCount = 0;
  44873. return this
  44874. },
  44875. update: function(e) {
  44876. e *= this.timeScale;
  44877. 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) {
  44878. var s = t[a];
  44879. s.enabled && s._update(n, e, r, o)
  44880. }
  44881. for (var l = this._bindings, c = this._nActiveBindings, a = 0; a !== c; ++a)
  44882. l[a].apply(o);
  44883. return this
  44884. },
  44885. getRoot: function() {
  44886. return this._root
  44887. },
  44888. uncacheClip: function(e) {
  44889. var t = this._actions
  44890. , i = e.name
  44891. , n = this._actionsByClip
  44892. , r = n[i];
  44893. if (void 0 !== r) {
  44894. for (var o = r.knownActions, a = 0, s = o.length; a !== s; ++a) {
  44895. var l = o[a];
  44896. this._deactivateAction(l);
  44897. var c = l._cacheIndex
  44898. , h = t[t.length - 1];
  44899. l._cacheIndex = null,
  44900. l._byClipCacheIndex = null,
  44901. h._cacheIndex = c,
  44902. t[c] = h,
  44903. t.pop(),
  44904. this._removeInactiveBindingsForAction(l)
  44905. }
  44906. delete n[i]
  44907. }
  44908. },
  44909. uncacheRoot: function(e) {
  44910. var t = e.uuid
  44911. , i = this._actionsByClip;
  44912. for (var n in i) {
  44913. var r = i[n].actionByRoot
  44914. , o = r[t];
  44915. void 0 !== o && (this._deactivateAction(o),
  44916. this._removeInactiveAction(o))
  44917. }
  44918. var a = this._bindingsByRootAndName
  44919. , s = a[t];
  44920. if (void 0 !== s)
  44921. for (var l in s) {
  44922. var c = s[l];
  44923. c.restoreOriginalState(),
  44924. this._removeInactiveBinding(c)
  44925. }
  44926. },
  44927. uncacheAction: function(e, t) {
  44928. var i = this.existingAction(e, t);
  44929. null !== i && (this._deactivateAction(i),
  44930. this._removeInactiveAction(i))
  44931. }
  44932. },
  44933. n.EventDispatcher.prototype.apply(n.AnimationMixer.prototype),
  44934. n.AnimationMixer._Action = function(e, t, i) {
  44935. this._mixer = e,
  44936. this._clip = t,
  44937. this._localRoot = i || null;
  44938. for (var r = t.tracks, o = r.length, a = new Array(o), s = {
  44939. endingStart: n.ZeroCurvatureEnding,
  44940. endingEnd: n.ZeroCurvatureEnding
  44941. }, l = 0; l !== o; ++l) {
  44942. var c = r[l].createInterpolant(null);
  44943. a[l] = c,
  44944. c.settings = s
  44945. }
  44946. this._interpolantSettings = s,
  44947. this._interpolants = a,
  44948. this._propertyBindings = new Array(o),
  44949. this._cacheIndex = null,
  44950. this._byClipCacheIndex = null,
  44951. this._timeScaleInterpolant = null,
  44952. this._weightInterpolant = null,
  44953. this.loop = n.LoopRepeat,
  44954. this._loopCount = -1,
  44955. this._startTime = null,
  44956. this.time = 0,
  44957. this.timeScale = 1,
  44958. this._effectiveTimeScale = 1,
  44959. this.weight = 1,
  44960. this._effectiveWeight = 1,
  44961. this.repetitions = 1 / 0,
  44962. this.paused = !1,
  44963. this.enabled = !0,
  44964. this.clampWhenFinished = !1,
  44965. this.zeroSlopeAtStart = !0,
  44966. this.zeroSlopeAtEnd = !0
  44967. }
  44968. ,
  44969. n.AnimationMixer._Action.prototype = {
  44970. constructor: n.AnimationMixer._Action,
  44971. play: function() {
  44972. return this._mixer._activateAction(this),
  44973. this
  44974. },
  44975. stop: function() {
  44976. return this._mixer._deactivateAction(this),
  44977. this.reset()
  44978. },
  44979. reset: function() {
  44980. return this.paused = !1,
  44981. this.enabled = !0,
  44982. this.time = 0,
  44983. this._loopCount = -1,
  44984. this._startTime = null,
  44985. this.stopFading().stopWarping()
  44986. },
  44987. isRunning: function() {
  44988. this._startTime;
  44989. return this.enabled && !this.paused && 0 !== this.timeScale && null === this._startTime && this._mixer._isActiveAction(this)
  44990. },
  44991. isScheduled: function() {
  44992. return this._mixer._isActiveAction(this)
  44993. },
  44994. startAt: function(e) {
  44995. return this._startTime = e,
  44996. this
  44997. },
  44998. setLoop: function(e, t) {
  44999. return this.loop = e,
  45000. this.repetitions = t,
  45001. this
  45002. },
  45003. setEffectiveWeight: function(e) {
  45004. return this.weight = e,
  45005. this._effectiveWeight = this.enabled ? e : 0,
  45006. this.stopFading()
  45007. },
  45008. getEffectiveWeight: function() {
  45009. return this._effectiveWeight
  45010. },
  45011. fadeIn: function(e) {
  45012. return this._scheduleFading(e, 0, 1)
  45013. },
  45014. fadeOut: function(e) {
  45015. return this._scheduleFading(e, 1, 0)
  45016. },
  45017. crossFadeFrom: function(e, t, i) {
  45018. this._mixer;
  45019. if (e.fadeOut(t),
  45020. this.fadeIn(t),
  45021. i) {
  45022. var n = this._clip.duration
  45023. , r = e._clip.duration
  45024. , o = r / n
  45025. , a = n / r;
  45026. e.warp(1, o, t),
  45027. this.warp(a, 1, t)
  45028. }
  45029. return this
  45030. },
  45031. crossFadeTo: function(e, t, i) {
  45032. return e.crossFadeFrom(this, t, i)
  45033. },
  45034. stopFading: function() {
  45035. var e = this._weightInterpolant;
  45036. return null !== e && (this._weightInterpolant = null,
  45037. this._mixer._takeBackControlInterpolant(e)),
  45038. this
  45039. },
  45040. setEffectiveTimeScale: function(e) {
  45041. return this.timeScale = e,
  45042. this._effectiveTimeScale = this.paused ? 0 : e,
  45043. this.stopWarping()
  45044. },
  45045. getEffectiveTimeScale: function() {
  45046. return this._effectiveTimeScale
  45047. },
  45048. setDuration: function(e) {
  45049. return this.timeScale = this._clip.duration / e,
  45050. this.stopWarping()
  45051. },
  45052. syncWith: function(e) {
  45053. return this.time = e.time,
  45054. this.timeScale = e.timeScale,
  45055. this.stopWarping()
  45056. },
  45057. halt: function(e) {
  45058. return this.warp(this._currentTimeScale, 0, e)
  45059. },
  45060. warp: function(e, t, i) {
  45061. var n = this._mixer
  45062. , r = n.time
  45063. , o = this._timeScaleInterpolant
  45064. , a = this.timeScale;
  45065. null === o && (o = n._lendControlInterpolant(),
  45066. this._timeScaleInterpolant = o);
  45067. var s = o.parameterPositions
  45068. , l = o.sampleValues;
  45069. return s[0] = r,
  45070. s[1] = r + i,
  45071. l[0] = e / a,
  45072. l[1] = t / a,
  45073. this
  45074. },
  45075. stopWarping: function() {
  45076. var e = this._timeScaleInterpolant;
  45077. return null !== e && (this._timeScaleInterpolant = null,
  45078. this._mixer._takeBackControlInterpolant(e)),
  45079. this
  45080. },
  45081. getMixer: function() {
  45082. return this._mixer
  45083. },
  45084. getClip: function() {
  45085. return this._clip
  45086. },
  45087. getRoot: function() {
  45088. return this._localRoot || this._mixer._root
  45089. },
  45090. _update: function(e, t, i, n) {
  45091. var r = this._startTime;
  45092. if (null !== r) {
  45093. var o = (e - r) * i;
  45094. if (o < 0 || 0 === i)
  45095. return;
  45096. this._startTime = null,
  45097. t = i * o
  45098. }
  45099. t *= this._updateTimeScale(e);
  45100. var a = this._updateTime(t)
  45101. , s = this._updateWeight(e);
  45102. if (s > 0)
  45103. for (var l = this._interpolants, c = this._propertyBindings, h = 0, u = l.length; h !== u; ++h)
  45104. l[h].evaluate(a),
  45105. c[h].accumulate(n, s)
  45106. },
  45107. _updateWeight: function(e) {
  45108. var t = 0;
  45109. if (this.enabled) {
  45110. t = this.weight;
  45111. var i = this._weightInterpolant;
  45112. if (null !== i) {
  45113. var n = i.evaluate(e)[0];
  45114. t *= n,
  45115. e > i.parameterPositions[1] && (this.stopFading(),
  45116. 0 === n && (this.enabled = !1))
  45117. }
  45118. }
  45119. return this._effectiveWeight = t,
  45120. t
  45121. },
  45122. _updateTimeScale: function(e) {
  45123. var t = 0;
  45124. if (!this.paused) {
  45125. t = this.timeScale;
  45126. var i = this._timeScaleInterpolant;
  45127. if (null !== i) {
  45128. var n = i.evaluate(e)[0];
  45129. t *= n,
  45130. e > i.parameterPositions[1] && (this.stopWarping(),
  45131. 0 === t ? this.pause = !0 : this.timeScale = t)
  45132. }
  45133. }
  45134. return this._effectiveTimeScale = t,
  45135. t
  45136. },
  45137. _updateTime: function(e) {
  45138. var t = this.time + e;
  45139. if (0 === e)
  45140. return t;
  45141. var i = this._clip.duration
  45142. , r = this.loop
  45143. , o = this._loopCount
  45144. , a = !1;
  45145. switch (r) {
  45146. case n.LoopOnce:
  45147. if (o === -1 && (this.loopCount = 0,
  45148. this._setEndings(!0, !0, !1)),
  45149. t >= i)
  45150. t = i;
  45151. else {
  45152. if (!(t < 0))
  45153. break;
  45154. t = 0
  45155. }
  45156. this.clampWhenFinished ? this.pause = !0 : this.enabled = !1,
  45157. this._mixer.dispatchEvent({
  45158. type: "finished",
  45159. action: this,
  45160. direction: e < 0 ? -1 : 1
  45161. });
  45162. break;
  45163. case n.LoopPingPong:
  45164. a = !0;
  45165. case n.LoopRepeat:
  45166. if (o === -1 && (e > 0 ? (o = 0,
  45167. this._setEndings(!0, 0 === this.repetitions, a)) : this._setEndings(0 === this.repetitions, !0, a)),
  45168. t >= i || t < 0) {
  45169. var s = Math.floor(t / i);
  45170. t -= i * s,
  45171. o += Math.abs(s);
  45172. var l = this.repetitions - o;
  45173. if (l < 0) {
  45174. this.clampWhenFinished ? this.paused = !0 : this.enabled = !1,
  45175. t = e > 0 ? i : 0,
  45176. this._mixer.dispatchEvent({
  45177. type: "finished",
  45178. action: this,
  45179. direction: e > 0 ? 1 : -1
  45180. });
  45181. break
  45182. }
  45183. if (0 === l) {
  45184. var c = e < 0;
  45185. this._setEndings(c, !c, a)
  45186. } else
  45187. this._setEndings(!1, !1, a);
  45188. this._loopCount = o,
  45189. this._mixer.dispatchEvent({
  45190. type: "loop",
  45191. action: this,
  45192. loopDelta: s
  45193. })
  45194. }
  45195. if (r === n.LoopPingPong && 1 === (1 & o))
  45196. return this.time = t,
  45197. i - t
  45198. }
  45199. return this.time = t,
  45200. t
  45201. },
  45202. _setEndings: function(e, t, i) {
  45203. var r = this._interpolantSettings;
  45204. i ? (r.endingStart = n.ZeroSlopeEnding,
  45205. r.endingEnd = n.ZeroSlopeEnding) : (e ? r.endingStart = this.zeroSlopeAtStart ? n.ZeroSlopeEnding : n.ZeroCurvatureEnding : r.endingStart = n.WrapAroundEnding,
  45206. t ? r.endingEnd = this.zeroSlopeAtEnd ? n.ZeroSlopeEnding : n.ZeroCurvatureEnding : r.endingEnd = n.WrapAroundEnding)
  45207. },
  45208. _scheduleFading: function(e, t, i) {
  45209. var n = this._mixer
  45210. , r = n.time
  45211. , o = this._weightInterpolant;
  45212. null === o && (o = n._lendControlInterpolant(),
  45213. this._weightInterpolant = o);
  45214. var a = o.parameterPositions
  45215. , s = o.sampleValues;
  45216. return a[0] = r,
  45217. s[0] = t,
  45218. a[1] = r + e,
  45219. s[1] = i,
  45220. this
  45221. }
  45222. },
  45223. Object.assign(n.AnimationMixer.prototype, {
  45224. _bindAction: function(e, t) {
  45225. var i = e._localRoot || this._root
  45226. , r = e._clip.tracks
  45227. , o = r.length
  45228. , a = e._propertyBindings
  45229. , s = e._interpolants
  45230. , l = i.uuid
  45231. , c = this._bindingsByRootAndName
  45232. , h = c[l];
  45233. void 0 === h && (h = {},
  45234. c[l] = h);
  45235. for (var u = 0; u !== o; ++u) {
  45236. var d = r[u]
  45237. , p = d.name
  45238. , f = h[p];
  45239. if (void 0 !== f)
  45240. a[u] = f;
  45241. else {
  45242. if (f = a[u],
  45243. void 0 !== f) {
  45244. null === f._cacheIndex && (++f.referenceCount,
  45245. this._addInactiveBinding(f, l, p));
  45246. continue
  45247. }
  45248. var g = t && t._propertyBindings[u].binding.parsedPath;
  45249. f = new n.PropertyMixer(n.PropertyBinding.create(i, p, g),d.ValueTypeName,d.getValueSize()),
  45250. ++f.referenceCount,
  45251. this._addInactiveBinding(f, l, p),
  45252. a[u] = f
  45253. }
  45254. s[u].resultBuffer = f.buffer
  45255. }
  45256. },
  45257. _activateAction: function(e) {
  45258. if (!this._isActiveAction(e)) {
  45259. if (null === e._cacheIndex) {
  45260. var t = (e._localRoot || this._root).uuid
  45261. , i = e._clip.name
  45262. , n = this._actionsByClip[i];
  45263. this._bindAction(e, n && n.knownActions[0]),
  45264. this._addInactiveAction(e, i, t)
  45265. }
  45266. for (var r = e._propertyBindings, o = 0, a = r.length; o !== a; ++o) {
  45267. var s = r[o];
  45268. 0 === s.useCount++ && (this._lendBinding(s),
  45269. s.saveOriginalState())
  45270. }
  45271. this._lendAction(e)
  45272. }
  45273. },
  45274. _deactivateAction: function(e) {
  45275. if (this._isActiveAction(e)) {
  45276. for (var t = e._propertyBindings, i = 0, n = t.length; i !== n; ++i) {
  45277. var r = t[i];
  45278. 0 === --r.useCount && (r.restoreOriginalState(),
  45279. this._takeBackBinding(r))
  45280. }
  45281. this._takeBackAction(e)
  45282. }
  45283. },
  45284. _initMemoryManager: function() {
  45285. this._actions = [],
  45286. this._nActiveActions = 0,
  45287. this._actionsByClip = {},
  45288. this._bindings = [],
  45289. this._nActiveBindings = 0,
  45290. this._bindingsByRootAndName = {},
  45291. this._controlInterpolants = [],
  45292. this._nActiveControlInterpolants = 0;
  45293. var e = this;
  45294. this.stats = {
  45295. actions: {
  45296. get total() {
  45297. return e._actions.length
  45298. },
  45299. get inUse() {
  45300. return e._nActiveActions
  45301. }
  45302. },
  45303. bindings: {
  45304. get total() {
  45305. return e._bindings.length
  45306. },
  45307. get inUse() {
  45308. return e._nActiveBindings
  45309. }
  45310. },
  45311. controlInterpolants: {
  45312. get total() {
  45313. return e._controlInterpolants.length
  45314. },
  45315. get inUse() {
  45316. return e._nActiveControlInterpolants
  45317. }
  45318. }
  45319. }
  45320. },
  45321. _isActiveAction: function(e) {
  45322. var t = e._cacheIndex;
  45323. return null !== t && t < this._nActiveActions
  45324. },
  45325. _addInactiveAction: function(e, t, i) {
  45326. var n = this._actions
  45327. , r = this._actionsByClip
  45328. , o = r[t];
  45329. if (void 0 === o)
  45330. o = {
  45331. knownActions: [e],
  45332. actionByRoot: {}
  45333. },
  45334. e._byClipCacheIndex = 0,
  45335. r[t] = o;
  45336. else {
  45337. var a = o.knownActions;
  45338. e._byClipCacheIndex = a.length,
  45339. a.push(e)
  45340. }
  45341. e._cacheIndex = n.length,
  45342. n.push(e),
  45343. o.actionByRoot[i] = e
  45344. },
  45345. _removeInactiveAction: function(e) {
  45346. var t = this._actions
  45347. , i = t[t.length - 1]
  45348. , n = e._cacheIndex;
  45349. i._cacheIndex = n,
  45350. t[n] = i,
  45351. t.pop(),
  45352. e._cacheIndex = null;
  45353. var r = e._clip.name
  45354. , o = this._actionsByClip
  45355. , a = o[r]
  45356. , s = a.knownActions
  45357. , l = s[s.length - 1]
  45358. , c = e._byClipCacheIndex;
  45359. l._byClipCacheIndex = c,
  45360. s[c] = l,
  45361. s.pop(),
  45362. e._byClipCacheIndex = null;
  45363. var h = a.actionByRoot
  45364. , u = (t._localRoot || this._root).uuid;
  45365. delete h[u],
  45366. 0 === s.length && delete o[r],
  45367. this._removeInactiveBindingsForAction(e)
  45368. },
  45369. _removeInactiveBindingsForAction: function(e) {
  45370. for (var t = e._propertyBindings, i = 0, n = t.length; i !== n; ++i) {
  45371. var r = t[i];
  45372. 0 === --r.referenceCount && this._removeInactiveBinding(r)
  45373. }
  45374. },
  45375. _lendAction: function(e) {
  45376. var t = this._actions
  45377. , i = e._cacheIndex
  45378. , n = this._nActiveActions++
  45379. , r = t[n];
  45380. e._cacheIndex = n,
  45381. t[n] = e,
  45382. r._cacheIndex = i,
  45383. t[i] = r
  45384. },
  45385. _takeBackAction: function(e) {
  45386. var t = this._actions
  45387. , i = e._cacheIndex
  45388. , n = --this._nActiveActions
  45389. , r = t[n];
  45390. e._cacheIndex = n,
  45391. t[n] = e,
  45392. r._cacheIndex = i,
  45393. t[i] = r
  45394. },
  45395. _addInactiveBinding: function(e, t, i) {
  45396. var n = this._bindingsByRootAndName
  45397. , r = n[t]
  45398. , o = this._bindings;
  45399. void 0 === r && (r = {},
  45400. n[t] = r),
  45401. r[i] = e,
  45402. e._cacheIndex = o.length,
  45403. o.push(e)
  45404. },
  45405. _removeInactiveBinding: function(e) {
  45406. var t = this._bindings
  45407. , i = e.binding
  45408. , n = i.rootNode.uuid
  45409. , r = i.path
  45410. , o = this._bindingsByRootAndName
  45411. , a = o[n]
  45412. , s = t[t.length - 1]
  45413. , l = e._cacheIndex;
  45414. s._cacheIndex = l,
  45415. t[l] = s,
  45416. t.pop(),
  45417. delete a[r];
  45418. e: {
  45419. for (var c in a)
  45420. break e;
  45421. delete o[n]
  45422. }
  45423. },
  45424. _lendBinding: function(e) {
  45425. var t = this._bindings
  45426. , i = e._cacheIndex
  45427. , n = this._nActiveBindings++
  45428. , r = t[n];
  45429. e._cacheIndex = n,
  45430. t[n] = e,
  45431. r._cacheIndex = i,
  45432. t[i] = r
  45433. },
  45434. _takeBackBinding: function(e) {
  45435. var t = this._bindings
  45436. , i = e._cacheIndex
  45437. , n = --this._nActiveBindings
  45438. , r = t[n];
  45439. e._cacheIndex = n,
  45440. t[n] = e,
  45441. r._cacheIndex = i,
  45442. t[i] = r
  45443. },
  45444. _lendControlInterpolant: function() {
  45445. var e = this._controlInterpolants
  45446. , t = this._nActiveControlInterpolants++
  45447. , i = e[t];
  45448. return void 0 === i && (i = new n.LinearInterpolant(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer),
  45449. i.__cacheIndex = t,
  45450. e[t] = i),
  45451. i
  45452. },
  45453. _takeBackControlInterpolant: function(e) {
  45454. var t = this._controlInterpolants
  45455. , i = e.__cacheIndex
  45456. , n = --this._nActiveControlInterpolants
  45457. , r = t[n];
  45458. e.__cacheIndex = n,
  45459. t[n] = e,
  45460. r.__cacheIndex = i,
  45461. t[i] = r
  45462. },
  45463. _controlInterpolantsResultBuffer: new Float32Array(1)
  45464. }),
  45465. n.AnimationObjectGroup = function(e) {
  45466. this.uuid = n.Math.generateUUID(),
  45467. this._objects = Array.prototype.slice.call(arguments),
  45468. this.nCachedObjects_ = 0;
  45469. var t = {};
  45470. this._indicesByUUID = t;
  45471. for (var i = 0, r = arguments.length; i !== r; ++i)
  45472. t[arguments[i].uuid] = i;
  45473. this._paths = [],
  45474. this._parsedPaths = [],
  45475. this._bindings = [],
  45476. this._bindingsIndicesByPath = {};
  45477. var o = this;
  45478. this.stats = {
  45479. objects: {
  45480. get total() {
  45481. return o._objects.length
  45482. },
  45483. get inUse() {
  45484. return this.total - o.nCachedObjects_
  45485. }
  45486. },
  45487. get bindingsPerObject() {
  45488. return o._bindings.length
  45489. }
  45490. }
  45491. }
  45492. ,
  45493. n.AnimationObjectGroup.prototype = {
  45494. constructor: n.AnimationObjectGroup,
  45495. add: function(e) {
  45496. 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) {
  45497. var d = arguments[h]
  45498. , p = d.uuid
  45499. , f = o[p];
  45500. if (void 0 === f) {
  45501. f = i++,
  45502. o[p] = f,
  45503. t.push(d);
  45504. for (var g = 0, m = c; g !== m; ++g)
  45505. l[g].push(new n.PropertyBinding(d,a[g],s[g]))
  45506. } else if (f < r) {
  45507. var v = t[f]
  45508. , A = --r
  45509. , y = t[A];
  45510. o[y.uuid] = f,
  45511. t[f] = y,
  45512. o[p] = A,
  45513. t[A] = d;
  45514. for (var g = 0, m = c; g !== m; ++g) {
  45515. var C = l[g]
  45516. , I = C[A]
  45517. , E = C[f];
  45518. C[f] = I,
  45519. void 0 === E && (E = new n.PropertyBinding(d,a[g],s[g])),
  45520. C[A] = E
  45521. }
  45522. } else
  45523. t[f] !== v && console.error("Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes...")
  45524. }
  45525. this.nCachedObjects_ = r
  45526. },
  45527. remove: function(e) {
  45528. for (var t = this._objects, i = (t.length,
  45529. this.nCachedObjects_), n = this._indicesByUUID, r = this._bindings, o = r.length, a = 0, s = arguments.length; a !== s; ++a) {
  45530. var l = arguments[a]
  45531. , c = l.uuid
  45532. , h = n[c];
  45533. if (void 0 !== h && h >= i) {
  45534. var u = i++
  45535. , d = t[u];
  45536. n[d.uuid] = h,
  45537. t[h] = d,
  45538. n[c] = u,
  45539. t[u] = l;
  45540. for (var p = 0, f = o; p !== f; ++p) {
  45541. var g = r[p]
  45542. , m = g[u]
  45543. , v = g[h];
  45544. g[h] = m,
  45545. g[u] = v
  45546. }
  45547. }
  45548. }
  45549. this.nCachedObjects_ = i
  45550. },
  45551. uncache: function(e) {
  45552. 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) {
  45553. var c = arguments[s]
  45554. , h = c.uuid
  45555. , u = r[h];
  45556. if (void 0 !== u)
  45557. if (delete r[h],
  45558. u < n) {
  45559. var d = --n
  45560. , p = t[d]
  45561. , f = --i
  45562. , g = t[f];
  45563. r[p.uuid] = u,
  45564. t[u] = p,
  45565. r[g.uuid] = d,
  45566. t[d] = g,
  45567. t.pop();
  45568. for (var m = 0, v = a; m !== v; ++m) {
  45569. var A = o[m]
  45570. , y = A[d]
  45571. , C = A[f];
  45572. A[u] = y,
  45573. A[d] = C,
  45574. A.pop()
  45575. }
  45576. } else {
  45577. var f = --i
  45578. , g = t[f];
  45579. r[g.uuid] = u,
  45580. t[u] = g,
  45581. t.pop();
  45582. for (var m = 0, v = a; m !== v; ++m) {
  45583. var A = o[m];
  45584. A[u] = A[f],
  45585. A.pop()
  45586. }
  45587. }
  45588. }
  45589. this.nCachedObjects_ = n
  45590. },
  45591. subscribe_: function(e, t) {
  45592. var i = this._bindingsIndicesByPath
  45593. , r = i[e]
  45594. , o = this._bindings;
  45595. if (void 0 !== r)
  45596. return o[r];
  45597. var a = this._paths
  45598. , s = this._parsedPaths
  45599. , l = this._objects
  45600. , c = l.length
  45601. , h = this.nCachedObjects_
  45602. , u = new Array(c);
  45603. r = o.length,
  45604. i[e] = r,
  45605. a.push(e),
  45606. s.push(t),
  45607. o.push(u);
  45608. for (var d = h, p = l.length; d !== p; ++d) {
  45609. var f = l[d];
  45610. u[d] = new n.PropertyBinding(f,e,t)
  45611. }
  45612. return u
  45613. },
  45614. unsubscribe_: function(e) {
  45615. var t = this._bindingsIndicesByPath
  45616. , i = t[e];
  45617. if (void 0 !== i) {
  45618. var n = this._paths
  45619. , r = this._parsedPaths
  45620. , o = this._bindings
  45621. , a = o.length - 1
  45622. , s = o[a]
  45623. , l = e[a];
  45624. t[l] = i,
  45625. o[i] = s,
  45626. o.pop(),
  45627. r[i] = r[a],
  45628. r.pop(),
  45629. n[i] = n[a],
  45630. n.pop()
  45631. }
  45632. }
  45633. },
  45634. n.AnimationUtils = {
  45635. arraySlice: function(e, t, i) {
  45636. return n.AnimationUtils.isTypedArray(e) ? new e.constructor(e.subarray(t, i)) : e.slice(t, i)
  45637. },
  45638. convertArray: function(e, t, i) {
  45639. return !e || !i && e.constructor === t ? e : "number" == typeof t.BYTES_PER_ELEMENT ? new t(e) : Array.prototype.slice.call(e)
  45640. },
  45641. isTypedArray: function(e) {
  45642. return ArrayBuffer.isView(e) && !(e instanceof DataView)
  45643. },
  45644. getKeyframeOrder: function(e) {
  45645. function t(t, i) {
  45646. return e[t] - e[i]
  45647. }
  45648. for (var i = e.length, n = new Array(i), r = 0; r !== i; ++r)
  45649. n[r] = r;
  45650. return n.sort(t),
  45651. n
  45652. },
  45653. sortedArray: function(e, t, i) {
  45654. for (var n = e.length, r = new e.constructor(n), o = 0, a = 0; a !== n; ++o)
  45655. for (var s = i[o] * t, l = 0; l !== t; ++l)
  45656. r[a++] = e[s + l];
  45657. return r
  45658. },
  45659. flattenJSON: function(e, t, i, n) {
  45660. for (var r = 1, o = e[0]; void 0 !== o && void 0 === o[n]; )
  45661. o = e[r++];
  45662. if (void 0 !== o) {
  45663. var a = o[n];
  45664. if (void 0 !== a)
  45665. if (Array.isArray(a)) {
  45666. do
  45667. a = o[n],
  45668. void 0 !== a && (t.push(o.time),
  45669. i.push.apply(i, a)),
  45670. o = e[r++];
  45671. while (void 0 !== o)
  45672. } else if (void 0 !== a.toArray) {
  45673. do
  45674. a = o[n],
  45675. void 0 !== a && (t.push(o.time),
  45676. a.toArray(i, i.length)),
  45677. o = e[r++];
  45678. while (void 0 !== o)
  45679. } else
  45680. do
  45681. a = o[n],
  45682. void 0 !== a && (t.push(o.time),
  45683. i.push(a)),
  45684. o = e[r++];
  45685. while (void 0 !== o)
  45686. }
  45687. }
  45688. },
  45689. n.KeyframeTrack = function(e, t, i, r) {
  45690. if (void 0 === e)
  45691. throw new Error("track name is undefined");
  45692. if (void 0 === t || 0 === t.length)
  45693. throw new Error("no keyframes in track named " + e);
  45694. this.name = e,
  45695. this.times = n.AnimationUtils.convertArray(t, this.TimeBufferType),
  45696. this.values = n.AnimationUtils.convertArray(i, this.ValueBufferType),
  45697. this.setInterpolation(r || this.DefaultInterpolation),
  45698. this.validate(),
  45699. this.optimize()
  45700. }
  45701. ,
  45702. n.KeyframeTrack.prototype = {
  45703. constructor: n.KeyframeTrack,
  45704. TimeBufferType: Float32Array,
  45705. ValueBufferType: Float32Array,
  45706. DefaultInterpolation: n.InterpolateLinear,
  45707. InterpolantFactoryMethodDiscrete: function(e) {
  45708. return new n.DiscreteInterpolant(this.times,this.values,this.getValueSize(),e)
  45709. },
  45710. InterpolantFactoryMethodLinear: function(e) {
  45711. return new n.LinearInterpolant(this.times,this.values,this.getValueSize(),e)
  45712. },
  45713. InterpolantFactoryMethodSmooth: function(e) {
  45714. return new n.CubicInterpolant(this.times,this.values,this.getValueSize(),e)
  45715. },
  45716. setInterpolation: function(e) {
  45717. var t = void 0;
  45718. switch (e) {
  45719. case n.InterpolateDiscrete:
  45720. t = this.InterpolantFactoryMethodDiscrete;
  45721. break;
  45722. case n.InterpolateLinear:
  45723. t = this.InterpolantFactoryMethodLinear;
  45724. break;
  45725. case n.InterpolateSmooth:
  45726. t = this.InterpolantFactoryMethodSmooth
  45727. }
  45728. if (void 0 === t) {
  45729. var i = "unsupported interpolation for " + this.ValueTypeName + " keyframe track named " + this.name;
  45730. if (void 0 === this.createInterpolant) {
  45731. if (e === this.DefaultInterpolation)
  45732. throw new Error(i);
  45733. this.setInterpolation(this.DefaultInterpolation)
  45734. }
  45735. return void console.warn(i)
  45736. }
  45737. this.createInterpolant = t
  45738. },
  45739. getInterpolation: function() {
  45740. switch (this.createInterpolant) {
  45741. case this.InterpolantFactoryMethodDiscrete:
  45742. return n.InterpolateDiscrete;
  45743. case this.InterpolantFactoryMethodLinear:
  45744. return n.InterpolateLinear;
  45745. case this.InterpolantFactoryMethodSmooth:
  45746. return n.InterpolateSmooth
  45747. }
  45748. },
  45749. getValueSize: function() {
  45750. return this.values.length / this.times.length
  45751. },
  45752. shift: function(e) {
  45753. if (0 !== e)
  45754. for (var t = this.times, i = 0, n = t.length; i !== n; ++i)
  45755. t[i] += e;
  45756. return this
  45757. },
  45758. scale: function(e) {
  45759. if (1 !== e)
  45760. for (var t = this.times, i = 0, n = t.length; i !== n; ++i)
  45761. t[i] *= e;
  45762. return this
  45763. },
  45764. trim: function(e, t) {
  45765. for (var i = this.times, r = i.length, o = 0, a = r - 1; o !== r && i[o] < e; )
  45766. ++o;
  45767. for (; a !== -1 && i[a] > t; )
  45768. --a;
  45769. if (++a,
  45770. 0 !== o || a !== r) {
  45771. o >= a && (a = Math.max(a, 1),
  45772. o = a - 1);
  45773. var s = this.getValueSize();
  45774. this.times = n.AnimationUtils.arraySlice(i, o, a),
  45775. this.values = n.AnimationUtils.arraySlice(this.values, o * s, a * s)
  45776. }
  45777. return this
  45778. },
  45779. validate: function() {
  45780. var e = !0
  45781. , t = this.getValueSize();
  45782. t - Math.floor(t) !== 0 && (console.error("invalid value size in track", this),
  45783. e = !1);
  45784. var i = this.times
  45785. , r = this.values
  45786. , o = i.length;
  45787. 0 === o && (console.error("track is empty", this),
  45788. e = !1);
  45789. for (var a = null, s = 0; s !== o; s++) {
  45790. var l = i[s];
  45791. if ("number" == typeof l && isNaN(l)) {
  45792. console.error("time is not a valid number", this, s, l),
  45793. e = !1;
  45794. break
  45795. }
  45796. if (null !== a && a > l) {
  45797. console.error("out of order keys", this, s, l, a),
  45798. e = !1;
  45799. break
  45800. }
  45801. a = l
  45802. }
  45803. if (void 0 !== r && n.AnimationUtils.isTypedArray(r))
  45804. for (var s = 0, c = r.length; s !== c; ++s) {
  45805. var h = r[s];
  45806. if (isNaN(h)) {
  45807. console.error("value is not a valid number", this, s, h),
  45808. e = !1;
  45809. break
  45810. }
  45811. }
  45812. return e
  45813. },
  45814. optimize: function() {
  45815. for (var e = this.times, t = this.values, i = this.getValueSize(), r = 1, o = 1, a = e.length - 1; o <= a; ++o) {
  45816. var s = !1
  45817. , l = e[o]
  45818. , c = e[o + 1];
  45819. if (l !== c && (1 !== o || l !== l[0]))
  45820. for (var h = o * i, u = h - i, d = h + i, p = 0; p !== i; ++p) {
  45821. var f = t[h + p];
  45822. if (f !== t[u + p] || f !== t[d + p]) {
  45823. s = !0;
  45824. break
  45825. }
  45826. }
  45827. if (s) {
  45828. if (o !== r) {
  45829. e[r] = e[o];
  45830. for (var g = o * i, m = r * i, p = 0; p !== i; ++p)
  45831. t[m + p] = t[g + p]
  45832. }
  45833. ++r
  45834. }
  45835. }
  45836. return r !== e.length && (this.times = n.AnimationUtils.arraySlice(e, 0, r),
  45837. this.values = n.AnimationUtils.arraySlice(t, 0, r * i)),
  45838. this
  45839. }
  45840. },
  45841. Object.assign(n.KeyframeTrack, {
  45842. parse: function(e) {
  45843. if (void 0 === e.type)
  45844. throw new Error("track type undefined, can not parse");
  45845. var t = n.KeyframeTrack._getTrackTypeForValueTypeName(e.type);
  45846. if (void 0 === e.times) {
  45847. console.warn("legacy JSON format detected, converting");
  45848. var i = []
  45849. , r = [];
  45850. n.AnimationUtils.flattenJSON(e.keys, i, r, "value"),
  45851. e.times = i,
  45852. e.values = r
  45853. }
  45854. return void 0 !== t.parse ? t.parse(e) : new t(e.name,e.times,e.values,e.interpolation)
  45855. },
  45856. toJSON: function(e) {
  45857. var t, i = e.constructor;
  45858. if (void 0 !== i.toJSON)
  45859. t = i.toJSON(e);
  45860. else {
  45861. t = {
  45862. name: e.name,
  45863. times: n.AnimationUtils.convertArray(e.times, Array),
  45864. values: n.AnimationUtils.convertArray(e.values, Array)
  45865. };
  45866. var r = e.getInterpolation();
  45867. r !== e.DefaultInterpolation && (t.interpolation = r)
  45868. }
  45869. return t.type = e.ValueTypeName,
  45870. t
  45871. },
  45872. _getTrackTypeForValueTypeName: function(e) {
  45873. switch (e.toLowerCase()) {
  45874. case "scalar":
  45875. case "double":
  45876. case "float":
  45877. case "number":
  45878. case "integer":
  45879. return n.NumberKeyframeTrack;
  45880. case "vector":
  45881. case "vector2":
  45882. case "vector3":
  45883. case "vector4":
  45884. return n.VectorKeyframeTrack;
  45885. case "color":
  45886. return n.ColorKeyframeTrack;
  45887. case "quaternion":
  45888. return n.QuaternionKeyframeTrack;
  45889. case "bool":
  45890. case "boolean":
  45891. return n.BooleanKeyframeTrack;
  45892. case "string":
  45893. return n.StringKeyframeTrack
  45894. }
  45895. throw new Error("Unsupported typeName: " + e)
  45896. }
  45897. }),
  45898. n.PropertyBinding = function(e, t, i) {
  45899. this.path = t,
  45900. this.parsedPath = i || n.PropertyBinding.parseTrackName(t),
  45901. this.node = n.PropertyBinding.findNode(e, this.parsedPath.nodeName) || e,
  45902. this.rootNode = e
  45903. }
  45904. ,
  45905. n.PropertyBinding.prototype = {
  45906. constructor: n.PropertyBinding,
  45907. getValue: function(e, t) {
  45908. this.bind(),
  45909. this.getValue(e, t)
  45910. },
  45911. setValue: function(e, t) {
  45912. this.bind(),
  45913. this.setValue(e, t)
  45914. },
  45915. bind: function() {
  45916. var e = this.node
  45917. , t = this.parsedPath
  45918. , i = t.objectName
  45919. , r = t.propertyName
  45920. , o = t.propertyIndex;
  45921. if (e || (e = n.PropertyBinding.findNode(this.rootNode, t.nodeName) || this.rootNode,
  45922. this.node = e),
  45923. this.getValue = this._getValue_unavailable,
  45924. this.setValue = this._setValue_unavailable,
  45925. !e)
  45926. return void console.error(" trying to update node for track: " + this.path + " but it wasn't found.");
  45927. if (i) {
  45928. var a = t.objectIndex;
  45929. switch (i) {
  45930. case "materials":
  45931. if (!e.material)
  45932. return void console.error(" can not bind to material as node does not have a material", this);
  45933. if (!e.material.materials)
  45934. return void console.error(" can not bind to material.materials as node.material does not have a materials array", this);
  45935. e = e.material.materials;
  45936. break;
  45937. case "bones":
  45938. if (!e.skeleton)
  45939. return void console.error(" can not bind to bones as node does not have a skeleton", this);
  45940. e = e.skeleton.bones;
  45941. for (var s = 0; s < e.length; s++)
  45942. if (e[s].name === a) {
  45943. a = s;
  45944. break
  45945. }
  45946. break;
  45947. default:
  45948. if (void 0 === e[i])
  45949. return void console.error(" can not bind to objectName of node, undefined", this);
  45950. e = e[i]
  45951. }
  45952. if (void 0 !== a) {
  45953. if (void 0 === e[a])
  45954. return void console.error(" trying to bind to objectIndex of objectName, but is undefined:", this, e);
  45955. e = e[a]
  45956. }
  45957. }
  45958. var l = e[r];
  45959. if (!l) {
  45960. var c = t.nodeName;
  45961. return void console.error(" trying to update property for track: " + c + "." + r + " but it wasn't found.", e)
  45962. }
  45963. var h = this.Versioning.None;
  45964. void 0 !== e.needsUpdate ? (h = this.Versioning.NeedsUpdate,
  45965. this.targetObject = e) : void 0 !== e.matrixWorldNeedsUpdate && (h = this.Versioning.MatrixWorldNeedsUpdate,
  45966. this.targetObject = e);
  45967. var u = this.BindingType.Direct;
  45968. if (void 0 !== o) {
  45969. if ("morphTargetInfluences" === r) {
  45970. if (!e.geometry)
  45971. return void console.error(" can not bind to morphTargetInfluences becasuse node does not have a geometry", this);
  45972. if (!e.geometry.morphTargets)
  45973. return void console.error(" can not bind to morphTargetInfluences becasuse node does not have a geometry.morphTargets", this);
  45974. for (var s = 0; s < this.node.geometry.morphTargets.length; s++)
  45975. if (e.geometry.morphTargets[s].name === o) {
  45976. o = s;
  45977. break
  45978. }
  45979. }
  45980. u = this.BindingType.ArrayElement,
  45981. this.resolvedProperty = l,
  45982. this.propertyIndex = o
  45983. } else
  45984. void 0 !== l.fromArray && void 0 !== l.toArray ? (u = this.BindingType.HasFromToArray,
  45985. this.resolvedProperty = l) : void 0 !== l.length ? (u = this.BindingType.EntireArray,
  45986. this.resolvedProperty = l) : this.propertyName = r;
  45987. this.getValue = this.GetterByBindingType[u],
  45988. this.setValue = this.SetterByBindingTypeAndVersioning[u][h]
  45989. },
  45990. unbind: function() {
  45991. this.node = null,
  45992. this.getValue = this._getValue_unbound,
  45993. this.setValue = this._setValue_unbound
  45994. }
  45995. },
  45996. Object.assign(n.PropertyBinding.prototype, {
  45997. _getValue_unavailable: function() {},
  45998. _setValue_unavailable: function() {},
  45999. _getValue_unbound: n.PropertyBinding.prototype.getValue,
  46000. _setValue_unbound: n.PropertyBinding.prototype.setValue,
  46001. BindingType: {
  46002. Direct: 0,
  46003. EntireArray: 1,
  46004. ArrayElement: 2,
  46005. HasFromToArray: 3
  46006. },
  46007. Versioning: {
  46008. None: 0,
  46009. NeedsUpdate: 1,
  46010. MatrixWorldNeedsUpdate: 2
  46011. },
  46012. GetterByBindingType: [function(e, t) {
  46013. e[t] = this.node[this.propertyName]
  46014. }
  46015. , function(e, t) {
  46016. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  46017. e[t++] = i[n]
  46018. }
  46019. , function(e, t) {
  46020. e[t] = this.resolvedProperty[this.propertyIndex]
  46021. }
  46022. , function(e, t) {
  46023. this.resolvedProperty.toArray(e, t)
  46024. }
  46025. ],
  46026. SetterByBindingTypeAndVersioning: [[function(e, t) {
  46027. this.node[this.propertyName] = e[t]
  46028. }
  46029. , function(e, t) {
  46030. this.node[this.propertyName] = e[t],
  46031. this.targetObject.needsUpdate = !0
  46032. }
  46033. , function(e, t) {
  46034. this.node[this.propertyName] = e[t],
  46035. this.targetObject.matrixWorldNeedsUpdate = !0
  46036. }
  46037. ], [function(e, t) {
  46038. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  46039. i[n] = e[t++]
  46040. }
  46041. , function(e, t) {
  46042. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  46043. i[n] = e[t++];
  46044. this.targetObject.needsUpdate = !0
  46045. }
  46046. , function(e, t) {
  46047. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  46048. i[n] = e[t++];
  46049. this.targetObject.matrixWorldNeedsUpdate = !0
  46050. }
  46051. ], [function(e, t) {
  46052. this.resolvedProperty[this.propertyIndex] = e[t]
  46053. }
  46054. , function(e, t) {
  46055. this.resolvedProperty[this.propertyIndex] = e[t],
  46056. this.targetObject.needsUpdate = !0
  46057. }
  46058. , function(e, t) {
  46059. this.resolvedProperty[this.propertyIndex] = e[t],
  46060. this.targetObject.matrixWorldNeedsUpdate = !0
  46061. }
  46062. ], [function(e, t) {
  46063. this.resolvedProperty.fromArray(e, t)
  46064. }
  46065. , function(e, t) {
  46066. this.resolvedProperty.fromArray(e, t),
  46067. this.targetObject.needsUpdate = !0
  46068. }
  46069. , function(e, t) {
  46070. this.resolvedProperty.fromArray(e, t),
  46071. this.targetObject.matrixWorldNeedsUpdate = !0
  46072. }
  46073. ]]
  46074. }),
  46075. n.PropertyBinding.Composite = function(e, t, i) {
  46076. var r = i || n.PropertyBinding.parseTrackName(t);
  46077. this._targetGroup = e,
  46078. this._bindings = e.subscribe_(t, r)
  46079. }
  46080. ,
  46081. n.PropertyBinding.Composite.prototype = {
  46082. constructor: n.PropertyBinding.Composite,
  46083. getValue: function(e, t) {
  46084. this.bind();
  46085. var i = this._targetGroup.nCachedObjects_
  46086. , n = this._bindings[i];
  46087. void 0 !== n && n.getValue(e, t)
  46088. },
  46089. setValue: function(e, t) {
  46090. for (var i = this._bindings, n = this._targetGroup.nCachedObjects_, r = i.length; n !== r; ++n)
  46091. i[n].setValue(e, t)
  46092. },
  46093. bind: function() {
  46094. for (var e = this._bindings, t = this._targetGroup.nCachedObjects_, i = e.length; t !== i; ++t)
  46095. e[t].bind()
  46096. },
  46097. unbind: function() {
  46098. for (var e = this._bindings, t = this._targetGroup.nCachedObjects_, i = e.length; t !== i; ++t)
  46099. e[t].unbind()
  46100. }
  46101. },
  46102. n.PropertyBinding.create = function(e, t, i) {
  46103. return e instanceof n.AnimationObjectGroup ? new n.PropertyBinding.Composite(e,t,i) : new n.PropertyBinding(e,t,i)
  46104. }
  46105. ,
  46106. n.PropertyBinding.parseTrackName = function(e) {
  46107. var t = /^(([\w]+\/)*)([\w-\d]+)?(\.([\w]+)(\[([\w\d\[\]\_.:\- ]+)\])?)?(\.([\w.]+)(\[([\w\d\[\]\_. ]+)\])?)$/
  46108. , i = t.exec(e);
  46109. if (!i)
  46110. throw new Error("cannot parse trackName at all: " + e);
  46111. i.index === t.lastIndex && t.lastIndex++;
  46112. var n = {
  46113. nodeName: i[3],
  46114. objectName: i[5],
  46115. objectIndex: i[7],
  46116. propertyName: i[9],
  46117. propertyIndex: i[11]
  46118. };
  46119. if (null === n.propertyName || 0 === n.propertyName.length)
  46120. throw new Error("can not parse propertyName from trackName: " + e);
  46121. return n
  46122. }
  46123. ,
  46124. n.PropertyBinding.findNode = function(e, t) {
  46125. if (!t || "" === t || "root" === t || "." === t || t === -1 || t === e.name || t === e.uuid)
  46126. return e;
  46127. if (e.skeleton) {
  46128. var i = function(e) {
  46129. for (var i = 0; i < e.bones.length; i++) {
  46130. var n = e.bones[i];
  46131. if (n.name === t)
  46132. return n
  46133. }
  46134. return null
  46135. }
  46136. , n = i(e.skeleton);
  46137. if (n)
  46138. return n
  46139. }
  46140. if (e.children) {
  46141. var r = function(e) {
  46142. for (var i = 0; i < e.length; i++) {
  46143. var n = e[i];
  46144. if (n.name === t || n.uuid === t)
  46145. return n;
  46146. var o = r(n.children);
  46147. if (o)
  46148. return o
  46149. }
  46150. return null
  46151. }
  46152. , o = r(e.children);
  46153. if (o)
  46154. return o
  46155. }
  46156. return null
  46157. }
  46158. ,
  46159. n.PropertyMixer = function(e, t, i) {
  46160. this.binding = e,
  46161. this.valueSize = i;
  46162. var n, r = Float64Array;
  46163. switch (t) {
  46164. case "quaternion":
  46165. n = this._slerp;
  46166. break;
  46167. case "string":
  46168. case "bool":
  46169. r = Array,
  46170. n = this._select;
  46171. break;
  46172. default:
  46173. n = this._lerp
  46174. }
  46175. this.buffer = new r(4 * i),
  46176. this._mixBufferRegion = n,
  46177. this.cumulativeWeight = 0,
  46178. this.useCount = 0,
  46179. this.referenceCount = 0
  46180. }
  46181. ,
  46182. n.PropertyMixer.prototype = {
  46183. constructor: n.PropertyMixer,
  46184. accumulate: function(e, t) {
  46185. var i = this.buffer
  46186. , n = this.valueSize
  46187. , r = e * n + n
  46188. , o = this.cumulativeWeight;
  46189. if (0 === o) {
  46190. for (var a = 0; a !== n; ++a)
  46191. i[r + a] = i[a];
  46192. o = t
  46193. } else {
  46194. o += t;
  46195. var s = t / o;
  46196. this._mixBufferRegion(i, r, 0, s, n)
  46197. }
  46198. this.cumulativeWeight = o
  46199. },
  46200. apply: function(e) {
  46201. var t = this.valueSize
  46202. , i = this.buffer
  46203. , n = e * t + t
  46204. , r = this.cumulativeWeight
  46205. , o = this.binding;
  46206. if (this.cumulativeWeight = 0,
  46207. r < 1) {
  46208. var a = 3 * t;
  46209. this._mixBufferRegion(i, n, a, 1 - r, t)
  46210. }
  46211. for (var s = t, l = t + t; s !== l; ++s)
  46212. if (i[s] !== i[s + t]) {
  46213. o.setValue(i, n);
  46214. break
  46215. }
  46216. },
  46217. saveOriginalState: function() {
  46218. var e = this.binding
  46219. , t = this.buffer
  46220. , i = this.valueSize
  46221. , n = 3 * i;
  46222. e.getValue(t, n);
  46223. for (var r = i, o = n; r !== o; ++r)
  46224. t[r] = t[n + r % i];
  46225. this.cumulativeWeight = 0
  46226. },
  46227. restoreOriginalState: function() {
  46228. var e = 3 * this.valueSize;
  46229. this.binding.setValue(this.buffer, e)
  46230. },
  46231. _select: function(e, t, i, n, r) {
  46232. if (n >= .5)
  46233. for (var o = 0; o !== r; ++o)
  46234. e[t + o] = e[i + o]
  46235. },
  46236. _slerp: function(e, t, i, r, o) {
  46237. n.Quaternion.slerpFlat(e, t, e, t, e, i, r)
  46238. },
  46239. _lerp: function(e, t, i, n, r) {
  46240. for (var o = 1 - n, a = 0; a !== r; ++a) {
  46241. var s = t + a;
  46242. e[s] = e[s] * o + e[i + a] * n
  46243. }
  46244. }
  46245. },
  46246. n.BooleanKeyframeTrack = function(e, t, i) {
  46247. n.KeyframeTrack.call(this, e, t, i)
  46248. }
  46249. ,
  46250. n.BooleanKeyframeTrack.prototype = Object.assign(Object.create(n.KeyframeTrack.prototype), {
  46251. constructor: n.BooleanKeyframeTrack,
  46252. ValueTypeName: "bool",
  46253. ValueBufferType: Array,
  46254. DefaultInterpolation: n.IntepolateDiscrete,
  46255. InterpolantFactoryMethodLinear: void 0,
  46256. InterpolantFactoryMethodSmooth: void 0
  46257. }),
  46258. n.NumberKeyframeTrack = function(e, t, i, r) {
  46259. n.KeyframeTrack.call(this, e, t, i, r)
  46260. }
  46261. ,
  46262. n.NumberKeyframeTrack.prototype = Object.assign(Object.create(n.KeyframeTrack.prototype), {
  46263. constructor: n.NumberKeyframeTrack,
  46264. ValueTypeName: "number"
  46265. }),
  46266. n.QuaternionKeyframeTrack = function(e, t, i, r) {
  46267. n.KeyframeTrack.call(this, e, t, i, r)
  46268. }
  46269. ,
  46270. n.QuaternionKeyframeTrack.prototype = Object.assign(Object.create(n.KeyframeTrack.prototype), {
  46271. constructor: n.QuaternionKeyframeTrack,
  46272. ValueTypeName: "quaternion",
  46273. DefaultInterpolation: n.InterpolateLinear,
  46274. InterpolantFactoryMethodLinear: function(e) {
  46275. return new n.QuaternionLinearInterpolant(this.times,this.values,this.getValueSize(),e)
  46276. },
  46277. InterpolantFactoryMethodSmooth: void 0
  46278. }),
  46279. n.StringKeyframeTrack = function(e, t, i, r) {
  46280. n.KeyframeTrack.call(this, e, t, i, r)
  46281. }
  46282. ,
  46283. n.StringKeyframeTrack.prototype = Object.assign(Object.create(n.KeyframeTrack.prototype), {
  46284. constructor: n.StringKeyframeTrack,
  46285. ValueTypeName: "string",
  46286. ValueBufferType: Array,
  46287. DefaultInterpolation: n.IntepolateDiscrete,
  46288. InterpolantFactoryMethodLinear: void 0,
  46289. InterpolantFactoryMethodSmooth: void 0
  46290. }),
  46291. n.VectorKeyframeTrack = function(e, t, i, r) {
  46292. n.KeyframeTrack.call(this, e, t, i, r)
  46293. }
  46294. ,
  46295. n.VectorKeyframeTrack.prototype = Object.assign(Object.create(n.KeyframeTrack.prototype), {
  46296. constructor: n.VectorKeyframeTrack,
  46297. ValueTypeName: "vector"
  46298. }),
  46299. n.Audio = function(e) {
  46300. n.Object3D.call(this),
  46301. this.type = "Audio",
  46302. this.context = e.context,
  46303. this.source = this.context.createBufferSource(),
  46304. this.source.onended = this.onEnded.bind(this),
  46305. this.gain = this.context.createGain(),
  46306. this.gain.connect(e.getInput()),
  46307. this.autoplay = !1,
  46308. this.startTime = 0,
  46309. this.playbackRate = 1,
  46310. this.isPlaying = !1,
  46311. this.hasPlaybackControl = !0,
  46312. this.sourceType = "empty",
  46313. this.filter = null
  46314. }
  46315. ,
  46316. n.Audio.prototype = Object.create(n.Object3D.prototype),
  46317. n.Audio.prototype.constructor = n.Audio,
  46318. n.Audio.prototype.getOutput = function() {
  46319. return this.gain
  46320. }
  46321. ,
  46322. n.Audio.prototype.load = function(e) {
  46323. var t = new n.AudioBuffer(this.context);
  46324. return t.load(e),
  46325. this.setBuffer(t),
  46326. this
  46327. }
  46328. ,
  46329. n.Audio.prototype.setNodeSource = function(e) {
  46330. return this.hasPlaybackControl = !1,
  46331. this.sourceType = "audioNode",
  46332. this.source = e,
  46333. this.connect(),
  46334. this
  46335. }
  46336. ,
  46337. n.Audio.prototype.setBuffer = function(e) {
  46338. var t = this;
  46339. return e.onReady(function(e) {
  46340. t.source.buffer = e,
  46341. t.sourceType = "buffer",
  46342. t.autoplay && t.play()
  46343. }),
  46344. this
  46345. }
  46346. ,
  46347. n.Audio.prototype.play = function() {
  46348. if (this.isPlaying === !0)
  46349. return void console.warn("THREE.Audio: Audio is already playing.");
  46350. if (this.hasPlaybackControl === !1)
  46351. return void console.warn("THREE.Audio: this Audio has no playback control.");
  46352. var e = this.context.createBufferSource();
  46353. e.buffer = this.source.buffer,
  46354. e.loop = this.source.loop,
  46355. e.onended = this.source.onended,
  46356. e.start(0, this.startTime),
  46357. e.playbackRate.value = this.playbackRate,
  46358. this.isPlaying = !0,
  46359. this.source = e,
  46360. this.connect()
  46361. }
  46362. ,
  46363. n.Audio.prototype.pause = function() {
  46364. return this.hasPlaybackControl === !1 ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.source.stop(),
  46365. void (this.startTime = this.context.currentTime))
  46366. }
  46367. ,
  46368. n.Audio.prototype.stop = function() {
  46369. return this.hasPlaybackControl === !1 ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.source.stop(),
  46370. void (this.startTime = 0))
  46371. }
  46372. ,
  46373. n.Audio.prototype.connect = function() {
  46374. null !== this.filter ? (this.source.connect(this.filter),
  46375. this.filter.connect(this.getOutput())) : this.source.connect(this.getOutput())
  46376. }
  46377. ,
  46378. n.Audio.prototype.disconnect = function() {
  46379. null !== this.filter ? (this.source.disconnect(this.filter),
  46380. this.filter.disconnect(this.getOutput())) : this.source.disconnect(this.getOutput())
  46381. }
  46382. ,
  46383. n.Audio.prototype.getFilter = function() {
  46384. return this.filter
  46385. }
  46386. ,
  46387. n.Audio.prototype.setFilter = function(e) {
  46388. void 0 === e && (e = null),
  46389. this.isPlaying === !0 ? (this.disconnect(),
  46390. this.filter = e,
  46391. this.connect()) : this.filter = e
  46392. }
  46393. ,
  46394. n.Audio.prototype.setPlaybackRate = function(e) {
  46395. return this.hasPlaybackControl === !1 ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.playbackRate = e,
  46396. void (this.isPlaying === !0 && (this.source.playbackRate.value = this.playbackRate)))
  46397. }
  46398. ,
  46399. n.Audio.prototype.getPlaybackRate = function() {
  46400. return this.playbackRate
  46401. }
  46402. ,
  46403. n.Audio.prototype.onEnded = function() {
  46404. this.isPlaying = !1
  46405. }
  46406. ,
  46407. n.Audio.prototype.setLoop = function(e) {
  46408. return this.hasPlaybackControl === !1 ? void console.warn("THREE.Audio: this Audio has no playback control.") : void (this.source.loop = e)
  46409. }
  46410. ,
  46411. n.Audio.prototype.getLoop = function() {
  46412. return this.hasPlaybackControl === !1 ? (console.warn("THREE.Audio: this Audio has no playback control."),
  46413. !1) : this.source.loop
  46414. }
  46415. ,
  46416. n.Audio.prototype.setVolume = function(e) {
  46417. this.gain.gain.value = e
  46418. }
  46419. ,
  46420. n.Audio.prototype.getVolume = function() {
  46421. return this.gain.gain.value
  46422. }
  46423. ,
  46424. n.AudioAnalyser = function(e, t) {
  46425. this.analyser = e.context.createAnalyser(),
  46426. this.analyser.fftSize = void 0 !== t ? t : 2048,
  46427. this.data = new Uint8Array(this.analyser.frequencyBinCount),
  46428. e.getOutput().connect(this.analyser)
  46429. }
  46430. ,
  46431. n.AudioAnalyser.prototype = {
  46432. constructor: n.AudioAnalyser,
  46433. getData: function() {
  46434. return this.analyser.getByteFrequencyData(this.data),
  46435. this.data
  46436. }
  46437. },
  46438. n.AudioBuffer = function(e) {
  46439. this.context = e,
  46440. this.ready = !1,
  46441. this.readyCallbacks = []
  46442. }
  46443. ,
  46444. n.AudioBuffer.prototype.load = function(e) {
  46445. var t = this
  46446. , i = new XMLHttpRequest;
  46447. return i.open("GET", e, !0),
  46448. i.responseType = "arraybuffer",
  46449. i.onload = function(e) {
  46450. t.context.decodeAudioData(this.response, function(e) {
  46451. t.buffer = e,
  46452. t.ready = !0;
  46453. for (var i = 0; i < t.readyCallbacks.length; i++)
  46454. t.readyCallbacks[i](t.buffer);
  46455. t.readyCallbacks = []
  46456. })
  46457. }
  46458. ,
  46459. i.send(),
  46460. this
  46461. }
  46462. ,
  46463. n.AudioBuffer.prototype.onReady = function(e) {
  46464. this.ready ? e(this.buffer) : this.readyCallbacks.push(e)
  46465. }
  46466. ,
  46467. n.PositionalAudio = function(e) {
  46468. n.Audio.call(this, e),
  46469. this.panner = this.context.createPanner(),
  46470. this.panner.connect(this.gain)
  46471. }
  46472. ,
  46473. n.PositionalAudio.prototype = Object.create(n.Audio.prototype),
  46474. n.PositionalAudio.prototype.constructor = n.PositionalAudio,
  46475. n.PositionalAudio.prototype.getOutput = function() {
  46476. return this.panner
  46477. }
  46478. ,
  46479. n.PositionalAudio.prototype.setRefDistance = function(e) {
  46480. this.panner.refDistance = e
  46481. }
  46482. ,
  46483. n.PositionalAudio.prototype.getRefDistance = function() {
  46484. return this.panner.refDistance
  46485. }
  46486. ,
  46487. n.PositionalAudio.prototype.setRolloffFactor = function(e) {
  46488. this.panner.rolloffFactor = e
  46489. }
  46490. ,
  46491. n.PositionalAudio.prototype.getRolloffFactor = function() {
  46492. return this.panner.rolloffFactor
  46493. }
  46494. ,
  46495. n.PositionalAudio.prototype.setDistanceModel = function(e) {
  46496. this.panner.distanceModel = e
  46497. }
  46498. ,
  46499. n.PositionalAudio.prototype.getDistanceModel = function() {
  46500. return this.panner.distanceModel
  46501. }
  46502. ,
  46503. n.PositionalAudio.prototype.setMaxDistance = function(e) {
  46504. this.panner.maxDistance = e
  46505. }
  46506. ,
  46507. n.PositionalAudio.prototype.getMaxDistance = function() {
  46508. return this.panner.maxDistance
  46509. }
  46510. ,
  46511. n.PositionalAudio.prototype.updateMatrixWorld = function() {
  46512. var e = new n.Vector3;
  46513. return function(t) {
  46514. n.Object3D.prototype.updateMatrixWorld.call(this, t),
  46515. e.setFromMatrixPosition(this.matrixWorld),
  46516. this.panner.setPosition(e.x, e.y, e.z)
  46517. }
  46518. }(),
  46519. n.AudioListener = function() {
  46520. n.Object3D.call(this),
  46521. this.type = "AudioListener",
  46522. this.context = new (window.AudioContext || window.webkitAudioContext),
  46523. this.gain = this.context.createGain(),
  46524. this.gain.connect(this.context.destination),
  46525. this.filter = null
  46526. }
  46527. ,
  46528. n.AudioListener.prototype = Object.create(n.Object3D.prototype),
  46529. n.AudioListener.prototype.constructor = n.AudioListener,
  46530. n.AudioListener.prototype.getInput = function() {
  46531. return this.gain
  46532. }
  46533. ,
  46534. n.AudioListener.prototype.removeFilter = function() {
  46535. null !== this.filter && (this.gain.disconnect(this.filter),
  46536. this.filter.disconnect(this.context.destination),
  46537. this.gain.connect(this.context.destination),
  46538. this.filter = null)
  46539. }
  46540. ,
  46541. n.AudioListener.prototype.setFilter = function(e) {
  46542. null !== this.filter ? (this.gain.disconnect(this.filter),
  46543. this.filter.disconnect(this.context.destination)) : this.gain.disconnect(this.context.destination),
  46544. this.filter = e,
  46545. this.gain.connect(this.filter),
  46546. this.filter.connect(this.context.destination)
  46547. }
  46548. ,
  46549. n.AudioListener.prototype.getFilter = function() {
  46550. return this.filter
  46551. }
  46552. ,
  46553. n.AudioListener.prototype.setMasterVolume = function(e) {
  46554. this.gain.gain.value = e
  46555. }
  46556. ,
  46557. n.AudioListener.prototype.getMasterVolume = function() {
  46558. return this.gain.gain.value
  46559. }
  46560. ,
  46561. n.AudioListener.prototype.updateMatrixWorld = function() {
  46562. var e = new n.Vector3
  46563. , t = new n.Quaternion
  46564. , i = new n.Vector3
  46565. , r = new n.Vector3;
  46566. return function(o) {
  46567. n.Object3D.prototype.updateMatrixWorld.call(this, o);
  46568. var a = this.context.listener
  46569. , s = this.up;
  46570. this.matrixWorld.decompose(e, t, i),
  46571. r.set(0, 0, -1).applyQuaternion(t),
  46572. a.setPosition(e.x, e.y, e.z),
  46573. a.setOrientation(r.x, r.y, r.z, s.x, s.y, s.z)
  46574. }
  46575. }(),
  46576. n.Camera = function() {
  46577. n.Object3D.call(this),
  46578. this.type = "Camera",
  46579. this.matrixWorldInverse = new n.Matrix4,
  46580. this.projectionMatrix = new n.Matrix4
  46581. }
  46582. ,
  46583. n.Camera.prototype = Object.create(n.Object3D.prototype),
  46584. n.Camera.prototype.constructor = n.Camera,
  46585. n.Camera.prototype.getWorldDirection = function() {
  46586. var e = new n.Quaternion;
  46587. return function(t) {
  46588. var i = t || new n.Vector3;
  46589. return this.getWorldQuaternion(e),
  46590. i.set(0, 0, -1).applyQuaternion(e)
  46591. }
  46592. }(),
  46593. n.Camera.prototype.lookAt = function() {
  46594. var e = new n.Matrix4;
  46595. return function(t) {
  46596. e.lookAt(this.position, t, this.up),
  46597. this.quaternion.setFromRotationMatrix(e)
  46598. }
  46599. }(),
  46600. n.Camera.prototype.clone = function() {
  46601. return (new this.constructor).copy(this)
  46602. }
  46603. ,
  46604. n.Camera.prototype.copy = function(e) {
  46605. return n.Object3D.prototype.copy.call(this, e),
  46606. this.matrixWorldInverse.copy(e.matrixWorldInverse),
  46607. this.projectionMatrix.copy(e.projectionMatrix),
  46608. this
  46609. }
  46610. ,
  46611. n.CubeCamera = function(e, t, i) {
  46612. n.Object3D.call(this),
  46613. this.type = "CubeCamera";
  46614. var r = 90
  46615. , o = 1
  46616. , a = new n.PerspectiveCamera(r,o,e,t);
  46617. a.up.set(0, -1, 0),
  46618. a.lookAt(new n.Vector3(1,0,0)),
  46619. this.add(a);
  46620. var s = new n.PerspectiveCamera(r,o,e,t);
  46621. s.up.set(0, -1, 0),
  46622. s.lookAt(new n.Vector3(-1,0,0)),
  46623. this.add(s);
  46624. var l = new n.PerspectiveCamera(r,o,e,t);
  46625. l.up.set(0, 0, 1),
  46626. l.lookAt(new n.Vector3(0,1,0)),
  46627. this.add(l);
  46628. var c = new n.PerspectiveCamera(r,o,e,t);
  46629. c.up.set(0, 0, -1),
  46630. c.lookAt(new n.Vector3(0,-1,0)),
  46631. this.add(c);
  46632. var h = new n.PerspectiveCamera(r,o,e,t);
  46633. h.up.set(0, -1, 0),
  46634. h.lookAt(new n.Vector3(0,0,1)),
  46635. this.add(h);
  46636. var u = new n.PerspectiveCamera(r,o,e,t);
  46637. u.up.set(0, -1, 0),
  46638. u.lookAt(new n.Vector3(0,0,-1)),
  46639. this.add(u);
  46640. var d = {
  46641. format: n.RGBFormat,
  46642. magFilter: n.LinearFilter,
  46643. minFilter: n.LinearFilter
  46644. };
  46645. this.renderTarget = new n.WebGLRenderTargetCube(i,i,d),
  46646. this.updateCubeMap = function(e, t) {
  46647. null === this.parent && this.updateMatrixWorld();
  46648. var i = this.renderTarget
  46649. , n = i.texture.generateMipmaps;
  46650. i.texture.generateMipmaps = !1,
  46651. i.activeCubeFace = 0,
  46652. e.render(t, a, i),
  46653. i.activeCubeFace = 1,
  46654. e.render(t, s, i),
  46655. i.activeCubeFace = 2,
  46656. e.render(t, l, i),
  46657. i.activeCubeFace = 3,
  46658. e.render(t, c, i),
  46659. i.activeCubeFace = 4,
  46660. e.render(t, h, i),
  46661. i.texture.generateMipmaps = n,
  46662. i.activeCubeFace = 5,
  46663. e.render(t, u, i),
  46664. e.setRenderTarget(null)
  46665. }
  46666. }
  46667. ,
  46668. n.CubeCamera.prototype = Object.create(n.Object3D.prototype),
  46669. n.CubeCamera.prototype.constructor = n.CubeCamera,
  46670. n.OrthographicCamera = function(e, t, i, r, o, a) {
  46671. n.Camera.call(this),
  46672. this.type = "OrthographicCamera",
  46673. this.zoom = 1,
  46674. this.left = e,
  46675. this.right = t,
  46676. this.top = i,
  46677. this.bottom = r,
  46678. this.near = void 0 !== o ? o : .1,
  46679. this.far = void 0 !== a ? a : 2e3,
  46680. this.updateProjectionMatrix()
  46681. }
  46682. ,
  46683. n.OrthographicCamera.prototype = Object.create(n.Camera.prototype),
  46684. n.OrthographicCamera.prototype.constructor = n.OrthographicCamera,
  46685. n.OrthographicCamera.prototype.updateProjectionMatrix = function() {
  46686. var e = (this.right - this.left) / (2 * this.zoom)
  46687. , t = (this.top - this.bottom) / (2 * this.zoom)
  46688. , i = (this.right + this.left) / 2
  46689. , n = (this.top + this.bottom) / 2;
  46690. this.projectionMatrix.makeOrthographic(i - e, i + e, n + t, n - t, this.near, this.far)
  46691. }
  46692. ,
  46693. n.OrthographicCamera.prototype.copy = function(e) {
  46694. return n.Camera.prototype.copy.call(this, e),
  46695. this.left = e.left,
  46696. this.right = e.right,
  46697. this.top = e.top,
  46698. this.bottom = e.bottom,
  46699. this.near = e.near,
  46700. this.far = e.far,
  46701. this.zoom = e.zoom,
  46702. this
  46703. }
  46704. ,
  46705. n.OrthographicCamera.prototype.toJSON = function(e) {
  46706. var t = n.Object3D.prototype.toJSON.call(this, e);
  46707. return t.object.zoom = this.zoom,
  46708. t.object.left = this.left,
  46709. t.object.right = this.right,
  46710. t.object.top = this.top,
  46711. t.object.bottom = this.bottom,
  46712. t.object.near = this.near,
  46713. t.object.far = this.far,
  46714. t
  46715. }
  46716. ,
  46717. n.PerspectiveCamera = function(e, t, i, r) {
  46718. n.Camera.call(this),
  46719. this.type = "PerspectiveCamera",
  46720. this.focalLength = 10,
  46721. this.zoom = 1,
  46722. this.fov = void 0 !== e ? e : 50,
  46723. this.aspect = void 0 !== t ? t : 1,
  46724. this.near = void 0 !== i ? i : .1,
  46725. this.far = void 0 !== r ? r : 2e3,
  46726. this.updateProjectionMatrix()
  46727. }
  46728. ,
  46729. n.PerspectiveCamera.prototype = Object.create(n.Camera.prototype),
  46730. n.PerspectiveCamera.prototype.constructor = n.PerspectiveCamera,
  46731. n.PerspectiveCamera.prototype.setLens = function(e, t) {
  46732. void 0 === t && (t = 24),
  46733. this.fov = 2 * n.Math.radToDeg(Math.atan(t / (2 * e))),
  46734. this.updateProjectionMatrix()
  46735. }
  46736. ,
  46737. n.PerspectiveCamera.prototype.setViewOffset = function(e, t, i, n, r, o) {
  46738. this.fullWidth = e,
  46739. this.fullHeight = t,
  46740. this.x = i,
  46741. this.y = n,
  46742. this.width = r,
  46743. this.height = o,
  46744. this.updateProjectionMatrix()
  46745. }
  46746. ,
  46747. n.PerspectiveCamera.prototype.updateProjectionMatrix = function() {
  46748. var e = n.Math.radToDeg(2 * Math.atan(Math.tan(.5 * n.Math.degToRad(this.fov)) / this.zoom));
  46749. if (this.fullWidth) {
  46750. var t = this.fullWidth / this.fullHeight
  46751. , i = Math.tan(n.Math.degToRad(.5 * e)) * this.near
  46752. , r = -i
  46753. , o = t * r
  46754. , a = t * i
  46755. , s = Math.abs(a - o)
  46756. , l = Math.abs(i - r);
  46757. 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)
  46758. } else
  46759. this.projectionMatrix.makePerspective(e, this.aspect, this.near, this.far)
  46760. }
  46761. ,
  46762. n.PerspectiveCamera.prototype.copy = function(e) {
  46763. return n.Camera.prototype.copy.call(this, e),
  46764. this.focalLength = e.focalLength,
  46765. this.zoom = e.zoom,
  46766. this.fov = e.fov,
  46767. this.aspect = e.aspect,
  46768. this.near = e.near,
  46769. this.far = e.far,
  46770. this
  46771. }
  46772. ,
  46773. n.PerspectiveCamera.prototype.toJSON = function(e) {
  46774. var t = n.Object3D.prototype.toJSON.call(this, e);
  46775. return t.object.focalLength = this.focalLength,
  46776. t.object.zoom = this.zoom,
  46777. t.object.fov = this.fov,
  46778. t.object.aspect = this.aspect,
  46779. t.object.near = this.near,
  46780. t.object.far = this.far,
  46781. t
  46782. }
  46783. ,
  46784. n.StereoCamera = function() {
  46785. this.type = "StereoCamera",
  46786. this.aspect = 1,
  46787. this.cameraL = new n.PerspectiveCamera,
  46788. this.cameraL.layers.enable(1),
  46789. this.cameraL.matrixAutoUpdate = !1,
  46790. this.cameraR = new n.PerspectiveCamera,
  46791. this.cameraR.layers.enable(2),
  46792. this.cameraR.matrixAutoUpdate = !1
  46793. }
  46794. ,
  46795. n.StereoCamera.prototype = {
  46796. constructor: n.StereoCamera,
  46797. update: function() {
  46798. var e, t, i, r, o, a = new n.Matrix4, s = new n.Matrix4;
  46799. return function(l) {
  46800. var c = e !== l.focalLength || t !== l.fov || i !== l.aspect * this.aspect || r !== l.near || o !== l.far;
  46801. if (c) {
  46802. e = l.focalLength,
  46803. t = l.fov,
  46804. i = l.aspect * this.aspect,
  46805. r = l.near,
  46806. o = l.far;
  46807. var h, u, d = l.projectionMatrix.clone(), p = .032, f = p * r / e, g = r * Math.tan(n.Math.degToRad(.5 * t));
  46808. s.elements[12] = -p,
  46809. a.elements[12] = p,
  46810. h = -g * i + f,
  46811. u = g * i + f,
  46812. d.elements[0] = 2 * r / (u - h),
  46813. d.elements[8] = (u + h) / (u - h),
  46814. this.cameraL.projectionMatrix.copy(d),
  46815. h = -g * i - f,
  46816. u = g * i - f,
  46817. d.elements[0] = 2 * r / (u - h),
  46818. d.elements[8] = (u + h) / (u - h),
  46819. this.cameraR.projectionMatrix.copy(d)
  46820. }
  46821. this.cameraL.matrixWorld.copy(l.matrixWorld).multiply(s),
  46822. this.cameraR.matrixWorld.copy(l.matrixWorld).multiply(a)
  46823. }
  46824. }()
  46825. },
  46826. n.Light = function(e, t) {
  46827. n.Object3D.call(this),
  46828. this.type = "Light",
  46829. this.color = new n.Color(e),
  46830. this.intensity = void 0 !== t ? t : 1,
  46831. this.receiveShadow = void 0
  46832. }
  46833. ,
  46834. n.Light.prototype = Object.create(n.Object3D.prototype),
  46835. n.Light.prototype.constructor = n.Light,
  46836. n.Light.prototype.copy = function(e) {
  46837. return n.Object3D.prototype.copy.call(this, e),
  46838. this.color.copy(e.color),
  46839. this.intensity = e.intensity,
  46840. this
  46841. }
  46842. ,
  46843. n.Light.prototype.toJSON = function(e) {
  46844. var t = n.Object3D.prototype.toJSON.call(this, e);
  46845. return t.object.color = this.color.getHex(),
  46846. t.object.intensity = this.intensity,
  46847. void 0 !== this.groundColor && (t.object.groundColor = this.groundColor.getHex()),
  46848. void 0 !== this.distance && (t.object.distance = this.distance),
  46849. void 0 !== this.angle && (t.object.angle = this.angle),
  46850. void 0 !== this.decay && (t.object.decay = this.decay),
  46851. void 0 !== this.penumbra && (t.object.penumbra = this.penumbra),
  46852. t
  46853. }
  46854. ,
  46855. n.LightShadow = function(e) {
  46856. this.camera = e,
  46857. this.bias = 0,
  46858. this.radius = 1,
  46859. this.mapSize = new n.Vector2(512,512),
  46860. this.map = null,
  46861. this.matrix = new n.Matrix4
  46862. }
  46863. ,
  46864. n.LightShadow.prototype = {
  46865. constructor: n.LightShadow,
  46866. copy: function(e) {
  46867. return this.camera = e.camera.clone(),
  46868. this.bias = e.bias,
  46869. this.radius = e.radius,
  46870. this.mapSize.copy(e.mapSize),
  46871. this
  46872. },
  46873. clone: function() {
  46874. return (new this.constructor).copy(this)
  46875. }
  46876. },
  46877. n.AmbientLight = function(e, t) {
  46878. n.Light.call(this, e, t),
  46879. this.type = "AmbientLight",
  46880. this.castShadow = void 0
  46881. }
  46882. ,
  46883. n.AmbientLight.prototype = Object.create(n.Light.prototype),
  46884. n.AmbientLight.prototype.constructor = n.AmbientLight,
  46885. n.DirectionalLight = function(e, t) {
  46886. n.Light.call(this, e, t),
  46887. this.type = "DirectionalLight",
  46888. this.position.set(0, 1, 0),
  46889. this.updateMatrix(),
  46890. this.target = new n.Object3D,
  46891. this.shadow = new n.LightShadow(new n.OrthographicCamera(-5,5,5,-5,.5,500))
  46892. }
  46893. ,
  46894. n.DirectionalLight.prototype = Object.create(n.Light.prototype),
  46895. n.DirectionalLight.prototype.constructor = n.DirectionalLight,
  46896. n.DirectionalLight.prototype.copy = function(e) {
  46897. return n.Light.prototype.copy.call(this, e),
  46898. this.target = e.target.clone(),
  46899. this.shadow = e.shadow.clone(),
  46900. this
  46901. }
  46902. ,
  46903. n.HemisphereLight = function(e, t, i) {
  46904. n.Light.call(this, e, i),
  46905. this.type = "HemisphereLight",
  46906. this.castShadow = void 0,
  46907. this.position.set(0, 1, 0),
  46908. this.updateMatrix(),
  46909. this.groundColor = new n.Color(t)
  46910. }
  46911. ,
  46912. n.HemisphereLight.prototype = Object.create(n.Light.prototype),
  46913. n.HemisphereLight.prototype.constructor = n.HemisphereLight,
  46914. n.HemisphereLight.prototype.copy = function(e) {
  46915. return n.Light.prototype.copy.call(this, e),
  46916. this.groundColor.copy(e.groundColor),
  46917. this
  46918. }
  46919. ,
  46920. n.PointLight = function(e, t, i, r) {
  46921. n.Light.call(this, e, t),
  46922. this.type = "PointLight",
  46923. this.distance = void 0 !== i ? i : 0,
  46924. this.decay = void 0 !== r ? r : 1,
  46925. this.shadow = new n.LightShadow(new n.PerspectiveCamera(90,1,.5,500))
  46926. }
  46927. ,
  46928. n.PointLight.prototype = Object.create(n.Light.prototype),
  46929. n.PointLight.prototype.constructor = n.PointLight,
  46930. Object.defineProperty(n.PointLight.prototype, "power", {
  46931. get: function() {
  46932. return 4 * this.intensity * Math.PI
  46933. },
  46934. set: function(e) {
  46935. this.intensity = e / (4 * Math.PI)
  46936. }
  46937. }),
  46938. n.PointLight.prototype.copy = function(e) {
  46939. return n.Light.prototype.copy.call(this, e),
  46940. this.distance = e.distance,
  46941. this.decay = e.decay,
  46942. this.shadow = e.shadow.clone(),
  46943. this
  46944. }
  46945. ,
  46946. n.SpotLight = function(e, t, i, r, o, a) {
  46947. n.Light.call(this, e, t),
  46948. this.type = "SpotLight",
  46949. this.position.set(0, 1, 0),
  46950. this.updateMatrix(),
  46951. this.target = new n.Object3D,
  46952. this.distance = void 0 !== i ? i : 0,
  46953. this.angle = void 0 !== r ? r : Math.PI / 3,
  46954. this.penumbra = void 0 !== o ? o : 0,
  46955. this.decay = void 0 !== a ? a : 1,
  46956. this.shadow = new n.LightShadow(new n.PerspectiveCamera(50,1,.5,500))
  46957. }
  46958. ,
  46959. n.SpotLight.prototype = Object.create(n.Light.prototype),
  46960. n.SpotLight.prototype.constructor = n.SpotLight,
  46961. Object.defineProperty(n.SpotLight.prototype, "power", {
  46962. get: function() {
  46963. return this.intensity * Math.PI
  46964. },
  46965. set: function(e) {
  46966. this.intensity = e / Math.PI
  46967. }
  46968. }),
  46969. n.SpotLight.prototype.copy = function(e) {
  46970. return n.Light.prototype.copy.call(this, e),
  46971. this.distance = e.distance,
  46972. this.angle = e.angle,
  46973. this.penumbra = e.penumbra,
  46974. this.decay = e.decay,
  46975. this.target = e.target.clone(),
  46976. this.shadow = e.shadow.clone(),
  46977. this
  46978. }
  46979. ,
  46980. n.Cache = {
  46981. enabled: !1,
  46982. files: {},
  46983. add: function(e, t) {
  46984. this.enabled !== !1 && (this.files[e] = t)
  46985. },
  46986. get: function(e) {
  46987. if (this.enabled !== !1)
  46988. return this.files[e]
  46989. },
  46990. remove: function(e) {
  46991. delete this.files[e]
  46992. },
  46993. clear: function() {
  46994. this.files = {}
  46995. }
  46996. },
  46997. n.Loader = function() {
  46998. this.onLoadStart = function() {}
  46999. ,
  47000. this.onLoadProgress = function() {}
  47001. ,
  47002. this.onLoadComplete = function() {}
  47003. }
  47004. ,
  47005. n.Loader.prototype = {
  47006. constructor: n.Loader,
  47007. crossOrigin: void 0,
  47008. extractUrlBase: function(e) {
  47009. var t = e.split("/");
  47010. return 1 === t.length ? "./" : (t.pop(),
  47011. t.join("/") + "/")
  47012. },
  47013. initMaterials: function(e, t, i) {
  47014. for (var n = [], r = 0; r < e.length; ++r)
  47015. n[r] = this.createMaterial(e[r], t, i);
  47016. return n
  47017. },
  47018. createMaterial: function() {
  47019. var e, t, i;
  47020. return function(r, o, a) {
  47021. function s(e, i, r, s, c) {
  47022. var h, u = o + e, d = n.Loader.Handlers.get(u);
  47023. null !== d ? h = d.load(u) : (t.setCrossOrigin(a),
  47024. h = t.load(u)),
  47025. void 0 !== i && (h.repeat.fromArray(i),
  47026. 1 !== i[0] && (h.wrapS = n.RepeatWrapping),
  47027. 1 !== i[1] && (h.wrapT = n.RepeatWrapping)),
  47028. void 0 !== r && h.offset.fromArray(r),
  47029. void 0 !== s && ("repeat" === s[0] && (h.wrapS = n.RepeatWrapping),
  47030. "mirror" === s[0] && (h.wrapS = n.MirroredRepeatWrapping),
  47031. "repeat" === s[1] && (h.wrapT = n.RepeatWrapping),
  47032. "mirror" === s[1] && (h.wrapT = n.MirroredRepeatWrapping)),
  47033. void 0 !== c && (h.anisotropy = c);
  47034. var p = n.Math.generateUUID();
  47035. return l[p] = h,
  47036. p
  47037. }
  47038. void 0 === e && (e = new n.Color),
  47039. void 0 === t && (t = new n.TextureLoader),
  47040. void 0 === i && (i = new n.MaterialLoader);
  47041. var l = {}
  47042. , c = {
  47043. uuid: n.Math.generateUUID(),
  47044. type: "MeshLambertMaterial"
  47045. };
  47046. for (var h in r) {
  47047. var u = r[h];
  47048. switch (h) {
  47049. case "DbgColor":
  47050. case "DbgIndex":
  47051. case "opticalDensity":
  47052. case "illumination":
  47053. break;
  47054. case "DbgName":
  47055. c.name = u;
  47056. break;
  47057. case "blending":
  47058. c.blending = n[u];
  47059. break;
  47060. case "colorAmbient":
  47061. case "mapAmbient":
  47062. console.warn("THREE.Loader.createMaterial:", h, "is no longer supported.");
  47063. break;
  47064. case "colorDiffuse":
  47065. c.color = e.fromArray(u).getHex();
  47066. break;
  47067. case "colorSpecular":
  47068. c.specular = e.fromArray(u).getHex();
  47069. break;
  47070. case "colorEmissive":
  47071. c.emissive = e.fromArray(u).getHex();
  47072. break;
  47073. case "specularCoef":
  47074. c.shininess = u;
  47075. break;
  47076. case "shading":
  47077. "basic" === u.toLowerCase() && (c.type = "MeshBasicMaterial"),
  47078. "phong" === u.toLowerCase() && (c.type = "MeshPhongMaterial");
  47079. break;
  47080. case "mapDiffuse":
  47081. c.map = s(u, r.mapDiffuseRepeat, r.mapDiffuseOffset, r.mapDiffuseWrap, r.mapDiffuseAnisotropy);
  47082. break;
  47083. case "mapDiffuseRepeat":
  47084. case "mapDiffuseOffset":
  47085. case "mapDiffuseWrap":
  47086. case "mapDiffuseAnisotropy":
  47087. break;
  47088. case "mapLight":
  47089. c.lightMap = s(u, r.mapLightRepeat, r.mapLightOffset, r.mapLightWrap, r.mapLightAnisotropy);
  47090. break;
  47091. case "mapLightRepeat":
  47092. case "mapLightOffset":
  47093. case "mapLightWrap":
  47094. case "mapLightAnisotropy":
  47095. break;
  47096. case "mapAO":
  47097. c.aoMap = s(u, r.mapAORepeat, r.mapAOOffset, r.mapAOWrap, r.mapAOAnisotropy);
  47098. break;
  47099. case "mapAORepeat":
  47100. case "mapAOOffset":
  47101. case "mapAOWrap":
  47102. case "mapAOAnisotropy":
  47103. break;
  47104. case "mapBump":
  47105. c.bumpMap = s(u, r.mapBumpRepeat, r.mapBumpOffset, r.mapBumpWrap, r.mapBumpAnisotropy);
  47106. break;
  47107. case "mapBumpScale":
  47108. c.bumpScale = u;
  47109. break;
  47110. case "mapBumpRepeat":
  47111. case "mapBumpOffset":
  47112. case "mapBumpWrap":
  47113. case "mapBumpAnisotropy":
  47114. break;
  47115. case "mapNormal":
  47116. c.normalMap = s(u, r.mapNormalRepeat, r.mapNormalOffset, r.mapNormalWrap, r.mapNormalAnisotropy);
  47117. break;
  47118. case "mapNormalFactor":
  47119. c.normalScale = [u, u];
  47120. break;
  47121. case "mapNormalRepeat":
  47122. case "mapNormalOffset":
  47123. case "mapNormalWrap":
  47124. case "mapNormalAnisotropy":
  47125. break;
  47126. case "mapSpecular":
  47127. c.specularMap = s(u, r.mapSpecularRepeat, r.mapSpecularOffset, r.mapSpecularWrap, r.mapSpecularAnisotropy);
  47128. break;
  47129. case "mapSpecularRepeat":
  47130. case "mapSpecularOffset":
  47131. case "mapSpecularWrap":
  47132. case "mapSpecularAnisotropy":
  47133. break;
  47134. case "mapAlpha":
  47135. c.alphaMap = s(u, r.mapAlphaRepeat, r.mapAlphaOffset, r.mapAlphaWrap, r.mapAlphaAnisotropy);
  47136. break;
  47137. case "mapAlphaRepeat":
  47138. case "mapAlphaOffset":
  47139. case "mapAlphaWrap":
  47140. case "mapAlphaAnisotropy":
  47141. break;
  47142. case "flipSided":
  47143. c.side = n.BackSide;
  47144. break;
  47145. case "doubleSided":
  47146. c.side = n.DoubleSide;
  47147. break;
  47148. case "transparency":
  47149. console.warn("THREE.Loader.createMaterial: transparency has been renamed to opacity"),
  47150. c.opacity = u;
  47151. break;
  47152. case "depthTest":
  47153. case "depthWrite":
  47154. case "colorWrite":
  47155. case "opacity":
  47156. case "reflectivity":
  47157. case "transparent":
  47158. case "visible":
  47159. case "wireframe":
  47160. c[h] = u;
  47161. break;
  47162. case "vertexColors":
  47163. u === !0 && (c.vertexColors = n.VertexColors),
  47164. "face" === u && (c.vertexColors = n.FaceColors);
  47165. break;
  47166. default:
  47167. console.error("THREE.Loader.createMaterial: Unsupported", h, u)
  47168. }
  47169. }
  47170. return "MeshBasicMaterial" === c.type && delete c.emissive,
  47171. "MeshPhongMaterial" !== c.type && delete c.specular,
  47172. c.opacity < 1 && (c.transparent = !0),
  47173. i.setTextures(l),
  47174. i.parse(c)
  47175. }
  47176. }()
  47177. },
  47178. n.Loader.Handlers = {
  47179. handlers: [],
  47180. add: function(e, t) {
  47181. this.handlers.push(e, t)
  47182. },
  47183. get: function(e) {
  47184. for (var t = this.handlers, i = 0, n = t.length; i < n; i += 2) {
  47185. var r = t[i]
  47186. , o = t[i + 1];
  47187. if (r.test(e))
  47188. return o
  47189. }
  47190. return null
  47191. }
  47192. },
  47193. n.XHRLoader = function(e) {
  47194. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  47195. }
  47196. ,
  47197. n.XHRLoader.prototype = {
  47198. constructor: n.XHRLoader,
  47199. load: function(e, t, i, r) {
  47200. void 0 !== this.path && (e = this.path + e);
  47201. var o = this
  47202. , a = n.Cache.get(e);
  47203. if (void 0 !== a)
  47204. return t && setTimeout(function() {
  47205. t(a)
  47206. }, 0),
  47207. a;
  47208. var s = new XMLHttpRequest;
  47209. return s.overrideMimeType("text/plain"),
  47210. s.open("GET", e, !0),
  47211. s.addEventListener("load", function(i) {
  47212. var a = i.target.response;
  47213. n.Cache.add(e, a),
  47214. 200 === this.status ? (t && t(a),
  47215. o.manager.itemEnd(e)) : 0 === this.status ? (console.warn("THREE.XHRLoader: HTTP Status 0 received."),
  47216. t && t(a),
  47217. o.manager.itemEnd(e)) : (r && r(i),
  47218. o.manager.itemError(e))
  47219. }, !1),
  47220. void 0 !== i && s.addEventListener("progress", function(e) {
  47221. i(e)
  47222. }, !1),
  47223. s.addEventListener("error", function(t) {
  47224. r && r(t),
  47225. o.manager.itemError(e)
  47226. }, !1),
  47227. void 0 !== this.responseType && (s.responseType = this.responseType),
  47228. void 0 !== this.withCredentials && (s.withCredentials = this.withCredentials),
  47229. s.send(null),
  47230. o.manager.itemStart(e),
  47231. s
  47232. },
  47233. setPath: function(e) {
  47234. this.path = e
  47235. },
  47236. setResponseType: function(e) {
  47237. this.responseType = e
  47238. },
  47239. setWithCredentials: function(e) {
  47240. this.withCredentials = e
  47241. }
  47242. },
  47243. n.FontLoader = function(e) {
  47244. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  47245. }
  47246. ,
  47247. n.FontLoader.prototype = {
  47248. constructor: n.FontLoader,
  47249. load: function(e, t, i, r) {
  47250. var o = new n.XHRLoader(this.manager);
  47251. o.load(e, function(e) {
  47252. t(new n.Font(JSON.parse(e.substring(65, e.length - 2))))
  47253. }, i, r)
  47254. }
  47255. },
  47256. n.ImageLoader = function(e) {
  47257. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  47258. }
  47259. ,
  47260. n.ImageLoader.prototype = {
  47261. constructor: n.ImageLoader,
  47262. load: function(e, t, i, r) {
  47263. void 0 !== this.path && (e = this.path + e);
  47264. var o = this
  47265. , a = n.Cache.get(e);
  47266. if (void 0 !== a)
  47267. return o.manager.itemStart(e),
  47268. t ? setTimeout(function() {
  47269. t(a),
  47270. o.manager.itemEnd(e)
  47271. }, 0) : o.manager.itemEnd(e),
  47272. a;
  47273. var s = document.createElement("img");
  47274. return s.addEventListener("load", function(i) {
  47275. n.Cache.add(e, this),
  47276. t && t(this),
  47277. o.manager.itemEnd(e)
  47278. }, !1),
  47279. void 0 !== i && s.addEventListener("progress", function(e) {
  47280. i(e)
  47281. }, !1),
  47282. s.addEventListener("error", function(t) {
  47283. r && r(t),
  47284. o.manager.itemError(e)
  47285. }, !1),
  47286. void 0 !== this.crossOrigin && (s.crossOrigin = this.crossOrigin),
  47287. o.manager.itemStart(e),
  47288. s.src = e,
  47289. s
  47290. },
  47291. setCrossOrigin: function(e) {
  47292. this.crossOrigin = e
  47293. },
  47294. setPath: function(e) {
  47295. this.path = e
  47296. }
  47297. },
  47298. n.JSONLoader = function(e) {
  47299. "boolean" == typeof e && (console.warn("THREE.JSONLoader: showStatus parameter has been removed from constructor."),
  47300. e = void 0),
  47301. this.manager = void 0 !== e ? e : n.DefaultLoadingManager,
  47302. this.withCredentials = !1
  47303. }
  47304. ,
  47305. n.JSONLoader.prototype = {
  47306. constructor: n.JSONLoader,
  47307. get statusDomElement() {
  47308. return void 0 === this._statusDomElement && (this._statusDomElement = document.createElement("div")),
  47309. console.warn("THREE.JSONLoader: .statusDomElement has been removed."),
  47310. this._statusDomElement
  47311. },
  47312. load: function(e, t, i, r) {
  47313. var o = this
  47314. , a = this.texturePath && "string" == typeof this.texturePath ? this.texturePath : n.Loader.prototype.extractUrlBase(e)
  47315. , s = new n.XHRLoader(this.manager);
  47316. s.setWithCredentials(this.withCredentials),
  47317. s.load(e, function(i) {
  47318. var n = JSON.parse(i)
  47319. , r = n.metadata;
  47320. if (void 0 !== r) {
  47321. var s = r.type;
  47322. if (void 0 !== s) {
  47323. if ("object" === s.toLowerCase())
  47324. return void console.error("THREE.JSONLoader: " + e + " should be loaded with THREE.ObjectLoader instead.");
  47325. if ("scene" === s.toLowerCase())
  47326. return void console.error("THREE.JSONLoader: " + e + " should be loaded with THREE.SceneLoader instead.")
  47327. }
  47328. }
  47329. var l = o.parse(n, a);
  47330. t(l.geometry, l.materials)
  47331. }, i, r)
  47332. },
  47333. setTexturePath: function(e) {
  47334. this.texturePath = e
  47335. },
  47336. parse: function(e, t) {
  47337. function i(t) {
  47338. function i(e, t) {
  47339. return e & 1 << t
  47340. }
  47341. 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;
  47342. if (void 0 !== e.uvs) {
  47343. for (r = 0; r < e.uvs.length; r++)
  47344. e.uvs[r].length && B++;
  47345. for (r = 0; r < B; r++)
  47346. s.faceVertexUvs[r] = []
  47347. }
  47348. for (l = 0,
  47349. c = L.length; l < c; )
  47350. E = new n.Vector3,
  47351. E.x = L[l++] * t,
  47352. E.y = L[l++] * t,
  47353. E.z = L[l++] * t,
  47354. s.vertices.push(E);
  47355. for (l = 0,
  47356. c = O.length; l < c; )
  47357. if (f = O[l++],
  47358. g = i(f, 0),
  47359. m = i(f, 1),
  47360. v = i(f, 3),
  47361. A = i(f, 4),
  47362. y = i(f, 5),
  47363. C = i(f, 6),
  47364. I = i(f, 7),
  47365. g) {
  47366. if (w = new n.Face3,
  47367. w.a = O[l],
  47368. w.b = O[l + 1],
  47369. w.c = O[l + 3],
  47370. _ = new n.Face3,
  47371. _.a = O[l + 1],
  47372. _.b = O[l + 2],
  47373. _.c = O[l + 3],
  47374. l += 4,
  47375. m && (p = O[l++],
  47376. w.materialIndex = p,
  47377. _.materialIndex = p),
  47378. a = s.faces.length,
  47379. v)
  47380. for (r = 0; r < B; r++)
  47381. for (S = e.uvs[r],
  47382. s.faceVertexUvs[r][a] = [],
  47383. s.faceVertexUvs[r][a + 1] = [],
  47384. o = 0; o < 4; o++)
  47385. d = O[l++],
  47386. R = S[2 * d],
  47387. P = S[2 * d + 1],
  47388. M = new n.Vector2(R,P),
  47389. 2 !== o && s.faceVertexUvs[r][a].push(M),
  47390. 0 !== o && s.faceVertexUvs[r][a + 1].push(M);
  47391. if (A && (u = 3 * O[l++],
  47392. w.normal.set(D[u++], D[u++], D[u]),
  47393. _.normal.copy(w.normal)),
  47394. y)
  47395. for (r = 0; r < 4; r++)
  47396. u = 3 * O[l++],
  47397. x = new n.Vector3(D[u++],D[u++],D[u]),
  47398. 2 !== r && w.vertexNormals.push(x),
  47399. 0 !== r && _.vertexNormals.push(x);
  47400. if (C && (h = O[l++],
  47401. T = N[h],
  47402. w.color.setHex(T),
  47403. _.color.setHex(T)),
  47404. I)
  47405. for (r = 0; r < 4; r++)
  47406. h = O[l++],
  47407. T = N[h],
  47408. 2 !== r && w.vertexColors.push(new n.Color(T)),
  47409. 0 !== r && _.vertexColors.push(new n.Color(T));
  47410. s.faces.push(w),
  47411. s.faces.push(_)
  47412. } else {
  47413. if (b = new n.Face3,
  47414. b.a = O[l++],
  47415. b.b = O[l++],
  47416. b.c = O[l++],
  47417. m && (p = O[l++],
  47418. b.materialIndex = p),
  47419. a = s.faces.length,
  47420. v)
  47421. for (r = 0; r < B; r++)
  47422. for (S = e.uvs[r],
  47423. s.faceVertexUvs[r][a] = [],
  47424. o = 0; o < 3; o++)
  47425. d = O[l++],
  47426. R = S[2 * d],
  47427. P = S[2 * d + 1],
  47428. M = new n.Vector2(R,P),
  47429. s.faceVertexUvs[r][a].push(M);
  47430. if (A && (u = 3 * O[l++],
  47431. b.normal.set(D[u++], D[u++], D[u])),
  47432. y)
  47433. for (r = 0; r < 3; r++)
  47434. u = 3 * O[l++],
  47435. x = new n.Vector3(D[u++],D[u++],D[u]),
  47436. b.vertexNormals.push(x);
  47437. if (C && (h = O[l++],
  47438. b.color.setHex(N[h])),
  47439. I)
  47440. for (r = 0; r < 3; r++)
  47441. h = O[l++],
  47442. b.vertexColors.push(new n.Color(N[h]));
  47443. s.faces.push(b)
  47444. }
  47445. }
  47446. function r() {
  47447. var t = void 0 !== e.influencesPerVertex ? e.influencesPerVertex : 2;
  47448. if (e.skinWeights)
  47449. for (var i = 0, r = e.skinWeights.length; i < r; i += t) {
  47450. var o = e.skinWeights[i]
  47451. , a = t > 1 ? e.skinWeights[i + 1] : 0
  47452. , l = t > 2 ? e.skinWeights[i + 2] : 0
  47453. , c = t > 3 ? e.skinWeights[i + 3] : 0;
  47454. s.skinWeights.push(new n.Vector4(o,a,l,c))
  47455. }
  47456. if (e.skinIndices)
  47457. for (var i = 0, r = e.skinIndices.length; i < r; i += t) {
  47458. var h = e.skinIndices[i]
  47459. , u = t > 1 ? e.skinIndices[i + 1] : 0
  47460. , d = t > 2 ? e.skinIndices[i + 2] : 0
  47461. , p = t > 3 ? e.skinIndices[i + 3] : 0;
  47462. s.skinIndices.push(new n.Vector4(h,u,d,p))
  47463. }
  47464. s.bones = e.bones,
  47465. 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.")
  47466. }
  47467. function o(t) {
  47468. if (void 0 !== e.morphTargets)
  47469. for (var i = 0, r = e.morphTargets.length; i < r; i++) {
  47470. s.morphTargets[i] = {},
  47471. s.morphTargets[i].name = e.morphTargets[i].name,
  47472. s.morphTargets[i].vertices = [];
  47473. for (var o = s.morphTargets[i].vertices, a = e.morphTargets[i].vertices, l = 0, c = a.length; l < c; l += 3) {
  47474. var h = new n.Vector3;
  47475. h.x = a[l] * t,
  47476. h.y = a[l + 1] * t,
  47477. h.z = a[l + 2] * t,
  47478. o.push(h)
  47479. }
  47480. }
  47481. if (void 0 !== e.morphColors && e.morphColors.length > 0) {
  47482. console.warn('THREE.JSONLoader: "morphColors" no longer supported. Using them as face colors.');
  47483. for (var u = s.faces, d = e.morphColors[0].colors, i = 0, r = u.length; i < r; i++)
  47484. u[i].color.fromArray(d, 3 * i)
  47485. }
  47486. }
  47487. function a() {
  47488. var t = []
  47489. , i = [];
  47490. void 0 !== e.animation && i.push(e.animation),
  47491. void 0 !== e.animations && (e.animations.length ? i = i.concat(e.animations) : i.push(e.animations));
  47492. for (var r = 0; r < i.length; r++) {
  47493. var o = n.AnimationClip.parseAnimation(i[r], s.bones);
  47494. o && t.push(o)
  47495. }
  47496. if (s.morphTargets) {
  47497. var a = n.AnimationClip.CreateClipsFromMorphTargetSequences(s.morphTargets, 10);
  47498. t = t.concat(a)
  47499. }
  47500. t.length > 0 && (s.animations = t)
  47501. }
  47502. var s = new n.Geometry
  47503. , l = void 0 !== e.scale ? 1 / e.scale : 1;
  47504. if (i(l),
  47505. r(),
  47506. o(l),
  47507. a(),
  47508. s.computeFaceNormals(),
  47509. s.computeBoundingSphere(),
  47510. void 0 === e.materials || 0 === e.materials.length)
  47511. return {
  47512. geometry: s
  47513. };
  47514. var c = n.Loader.prototype.initMaterials(e.materials, t, this.crossOrigin);
  47515. return {
  47516. geometry: s,
  47517. materials: c
  47518. }
  47519. }
  47520. },
  47521. n.LoadingManager = function(e, t, i) {
  47522. var n = this
  47523. , r = !1
  47524. , o = 0
  47525. , a = 0;
  47526. this.onStart = void 0,
  47527. this.onLoad = e,
  47528. this.onProgress = t,
  47529. this.onError = i,
  47530. this.itemStart = function(e) {
  47531. a++,
  47532. r === !1 && void 0 !== n.onStart && n.onStart(e, o, a),
  47533. r = !0
  47534. }
  47535. ,
  47536. this.itemEnd = function(e) {
  47537. o++,
  47538. void 0 !== n.onProgress && n.onProgress(e, o, a),
  47539. o === a && (r = !1,
  47540. void 0 !== n.onLoad && n.onLoad())
  47541. }
  47542. ,
  47543. this.itemError = function(e) {
  47544. void 0 !== n.onError && n.onError(e)
  47545. }
  47546. }
  47547. ,
  47548. n.DefaultLoadingManager = new n.LoadingManager,
  47549. n.BufferGeometryLoader = function(e) {
  47550. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  47551. }
  47552. ,
  47553. n.BufferGeometryLoader.prototype = {
  47554. constructor: n.BufferGeometryLoader,
  47555. load: function(e, t, i, r) {
  47556. var o = this
  47557. , a = new n.XHRLoader(o.manager);
  47558. a.load(e, function(e) {
  47559. t(o.parse(JSON.parse(e)))
  47560. }, i, r)
  47561. },
  47562. parse: function(e) {
  47563. var t = new n.BufferGeometry
  47564. , i = e.data.index
  47565. , r = {
  47566. Int8Array: Int8Array,
  47567. Uint8Array: Uint8Array,
  47568. Uint8ClampedArray: Uint8ClampedArray,
  47569. Int16Array: Int16Array,
  47570. Uint16Array: Uint16Array,
  47571. Int32Array: Int32Array,
  47572. Uint32Array: Uint32Array,
  47573. Float32Array: Float32Array,
  47574. Float64Array: Float64Array
  47575. };
  47576. if (void 0 !== i) {
  47577. var o = new r[i.type](i.array);
  47578. t.setIndex(new n.BufferAttribute(o,1))
  47579. }
  47580. var a = e.data.attributes;
  47581. for (var s in a) {
  47582. var l = a[s]
  47583. , o = new r[l.type](l.array);
  47584. t.addAttribute(s, new n.BufferAttribute(o,l.itemSize))
  47585. }
  47586. var c = e.data.groups || e.data.drawcalls || e.data.offsets;
  47587. if (void 0 !== c)
  47588. for (var h = 0, u = c.length; h !== u; ++h) {
  47589. var d = c[h];
  47590. t.addGroup(d.start, d.count, d.materialIndex)
  47591. }
  47592. var p = e.data.boundingSphere;
  47593. if (void 0 !== p) {
  47594. var f = new n.Vector3;
  47595. void 0 !== p.center && f.fromArray(p.center),
  47596. t.boundingSphere = new n.Sphere(f,p.radius)
  47597. }
  47598. return t
  47599. }
  47600. },
  47601. n.MaterialLoader = function(e) {
  47602. this.manager = void 0 !== e ? e : n.DefaultLoadingManager,
  47603. this.textures = {}
  47604. }
  47605. ,
  47606. n.MaterialLoader.prototype = {
  47607. constructor: n.MaterialLoader,
  47608. load: function(e, t, i, r) {
  47609. var o = this
  47610. , a = new n.XHRLoader(o.manager);
  47611. a.load(e, function(e) {
  47612. t(o.parse(JSON.parse(e)))
  47613. }, i, r)
  47614. },
  47615. setTextures: function(e) {
  47616. this.textures = e
  47617. },
  47618. getTexture: function(e) {
  47619. var t = this.textures;
  47620. return void 0 === t[e] && console.warn("THREE.MaterialLoader: Undefined texture", e),
  47621. t[e]
  47622. },
  47623. parse: function(e) {
  47624. var t = new n[e.type];
  47625. if (void 0 !== e.uuid && (t.uuid = e.uuid),
  47626. void 0 !== e.name && (t.name = e.name),
  47627. void 0 !== e.color && t.color.setHex(e.color),
  47628. void 0 !== e.roughness && (t.roughness = e.roughness),
  47629. void 0 !== e.metalness && (t.metalness = e.metalness),
  47630. void 0 !== e.emissive && t.emissive.setHex(e.emissive),
  47631. void 0 !== e.specular && t.specular.setHex(e.specular),
  47632. void 0 !== e.shininess && (t.shininess = e.shininess),
  47633. void 0 !== e.uniforms && (t.uniforms = e.uniforms),
  47634. void 0 !== e.vertexShader && (t.vertexShader = e.vertexShader),
  47635. void 0 !== e.fragmentShader && (t.fragmentShader = e.fragmentShader),
  47636. void 0 !== e.vertexColors && (t.vertexColors = e.vertexColors),
  47637. void 0 !== e.shading && (t.shading = e.shading),
  47638. void 0 !== e.blending && (t.blending = e.blending),
  47639. void 0 !== e.side && (t.side = e.side),
  47640. void 0 !== e.opacity && (t.opacity = e.opacity),
  47641. void 0 !== e.transparent && (t.transparent = e.transparent),
  47642. void 0 !== e.alphaTest && (t.alphaTest = e.alphaTest),
  47643. void 0 !== e.depthTest && (t.depthTest = e.depthTest),
  47644. void 0 !== e.depthWrite && (t.depthWrite = e.depthWrite),
  47645. void 0 !== e.colorWrite && (t.colorWrite = e.colorWrite),
  47646. void 0 !== e.wireframe && (t.wireframe = e.wireframe),
  47647. void 0 !== e.wireframeLinewidth && (t.wireframeLinewidth = e.wireframeLinewidth),
  47648. void 0 !== e.size && (t.size = e.size),
  47649. void 0 !== e.sizeAttenuation && (t.sizeAttenuation = e.sizeAttenuation),
  47650. void 0 !== e.map && (t.map = this.getTexture(e.map)),
  47651. void 0 !== e.alphaMap && (t.alphaMap = this.getTexture(e.alphaMap),
  47652. t.transparent = !0),
  47653. void 0 !== e.bumpMap && (t.bumpMap = this.getTexture(e.bumpMap)),
  47654. void 0 !== e.bumpScale && (t.bumpScale = e.bumpScale),
  47655. void 0 !== e.normalMap && (t.normalMap = this.getTexture(e.normalMap)),
  47656. void 0 !== e.normalScale) {
  47657. var i = e.normalScale;
  47658. Array.isArray(i) === !1 && (i = [i, i]),
  47659. t.normalScale = (new n.Vector2).fromArray(i)
  47660. }
  47661. if (void 0 !== e.displacementMap && (t.displacementMap = this.getTexture(e.displacementMap)),
  47662. void 0 !== e.displacementScale && (t.displacementScale = e.displacementScale),
  47663. void 0 !== e.displacementBias && (t.displacementBias = e.displacementBias),
  47664. void 0 !== e.roughnessMap && (t.roughnessMap = this.getTexture(e.roughnessMap)),
  47665. void 0 !== e.metalnessMap && (t.metalnessMap = this.getTexture(e.metalnessMap)),
  47666. void 0 !== e.emissiveMap && (t.emissiveMap = this.getTexture(e.emissiveMap)),
  47667. void 0 !== e.emissiveIntensity && (t.emissiveIntensity = e.emissiveIntensity),
  47668. void 0 !== e.specularMap && (t.specularMap = this.getTexture(e.specularMap)),
  47669. void 0 !== e.envMap && (t.envMap = this.getTexture(e.envMap),
  47670. t.combine = n.MultiplyOperation),
  47671. e.reflectivity && (t.reflectivity = e.reflectivity),
  47672. void 0 !== e.lightMap && (t.lightMap = this.getTexture(e.lightMap)),
  47673. void 0 !== e.lightMapIntensity && (t.lightMapIntensity = e.lightMapIntensity),
  47674. void 0 !== e.aoMap && (t.aoMap = this.getTexture(e.aoMap)),
  47675. void 0 !== e.aoMapIntensity && (t.aoMapIntensity = e.aoMapIntensity),
  47676. void 0 !== e.materials)
  47677. for (var r = 0, o = e.materials.length; r < o; r++)
  47678. t.materials.push(this.parse(e.materials[r]));
  47679. return t
  47680. }
  47681. },
  47682. n.ObjectLoader = function(e) {
  47683. this.manager = void 0 !== e ? e : n.DefaultLoadingManager,
  47684. this.texturePath = ""
  47685. }
  47686. ,
  47687. n.ObjectLoader.prototype = {
  47688. constructor: n.ObjectLoader,
  47689. load: function(e, t, i, r) {
  47690. "" === this.texturePath && (this.texturePath = e.substring(0, e.lastIndexOf("/") + 1));
  47691. var o = this
  47692. , a = new n.XHRLoader(o.manager);
  47693. a.load(e, function(e) {
  47694. o.parse(JSON.parse(e), t)
  47695. }, i, r)
  47696. },
  47697. setTexturePath: function(e) {
  47698. this.texturePath = e
  47699. },
  47700. setCrossOrigin: function(e) {
  47701. this.crossOrigin = e
  47702. },
  47703. parse: function(e, t) {
  47704. var i = this.parseGeometries(e.geometries)
  47705. , n = this.parseImages(e.images, function() {
  47706. void 0 !== t && t(a)
  47707. })
  47708. , r = this.parseTextures(e.textures, n)
  47709. , o = this.parseMaterials(e.materials, r)
  47710. , a = this.parseObject(e.object, i, o);
  47711. return e.animations && (a.animations = this.parseAnimations(e.animations)),
  47712. void 0 !== e.images && 0 !== e.images.length || void 0 !== t && t(a),
  47713. a
  47714. },
  47715. parseGeometries: function(e) {
  47716. var t = {};
  47717. if (void 0 !== e)
  47718. for (var i = new n.JSONLoader, r = new n.BufferGeometryLoader, o = 0, a = e.length; o < a; o++) {
  47719. var s, l = e[o];
  47720. switch (l.type) {
  47721. case "PlaneGeometry":
  47722. case "PlaneBufferGeometry":
  47723. s = new n[l.type](l.width,l.height,l.widthSegments,l.heightSegments);
  47724. break;
  47725. case "BoxGeometry":
  47726. case "BoxBufferGeometry":
  47727. case "CubeGeometry":
  47728. s = new n[l.type](l.width,l.height,l.depth,l.widthSegments,l.heightSegments,l.depthSegments);
  47729. break;
  47730. case "CircleGeometry":
  47731. case "CircleBufferGeometry":
  47732. s = new n[l.type](l.radius,l.segments,l.thetaStart,l.thetaLength);
  47733. break;
  47734. case "CylinderGeometry":
  47735. case "CylinderBufferGeometry":
  47736. s = new n[l.type](l.radiusTop,l.radiusBottom,l.height,l.radialSegments,l.heightSegments,l.openEnded,l.thetaStart,l.thetaLength);
  47737. break;
  47738. case "SphereGeometry":
  47739. case "SphereBufferGeometry":
  47740. s = new n[l.type](l.radius,l.widthSegments,l.heightSegments,l.phiStart,l.phiLength,l.thetaStart,l.thetaLength);
  47741. break;
  47742. case "DodecahedronGeometry":
  47743. s = new n.DodecahedronGeometry(l.radius,l.detail);
  47744. break;
  47745. case "IcosahedronGeometry":
  47746. s = new n.IcosahedronGeometry(l.radius,l.detail);
  47747. break;
  47748. case "OctahedronGeometry":
  47749. s = new n.OctahedronGeometry(l.radius,l.detail);
  47750. break;
  47751. case "TetrahedronGeometry":
  47752. s = new n.TetrahedronGeometry(l.radius,l.detail);
  47753. break;
  47754. case "RingGeometry":
  47755. case "RingBufferGeometry":
  47756. s = new n[l.type](l.innerRadius,l.outerRadius,l.thetaSegments,l.phiSegments,l.thetaStart,l.thetaLength);
  47757. break;
  47758. case "TorusGeometry":
  47759. case "TorusBufferGeometry":
  47760. s = new n[l.type](l.radius,l.tube,l.radialSegments,l.tubularSegments,l.arc);
  47761. break;
  47762. case "TorusKnotGeometry":
  47763. case "TorusKnotBufferGeometry":
  47764. s = new n[l.type](l.radius,l.tube,l.tubularSegments,l.radialSegments,l.p,l.q);
  47765. break;
  47766. case "LatheGeometry":
  47767. s = new n.LatheGeometry(l.points,l.segments,l.phiStart,l.phiLength);
  47768. break;
  47769. case "BufferGeometry":
  47770. s = r.parse(l);
  47771. break;
  47772. case "Geometry":
  47773. s = i.parse(l.data, this.texturePath).geometry;
  47774. break;
  47775. default:
  47776. console.warn('THREE.ObjectLoader: Unsupported geometry type "' + l.type + '"');
  47777. continue
  47778. }
  47779. s.uuid = l.uuid,
  47780. void 0 !== l.name && (s.name = l.name),
  47781. t[l.uuid] = s
  47782. }
  47783. return t
  47784. },
  47785. parseMaterials: function(e, t) {
  47786. var i = {};
  47787. if (void 0 !== e) {
  47788. var r = new n.MaterialLoader;
  47789. r.setTextures(t);
  47790. for (var o = 0, a = e.length; o < a; o++) {
  47791. var s = r.parse(e[o]);
  47792. i[s.uuid] = s
  47793. }
  47794. }
  47795. return i
  47796. },
  47797. parseAnimations: function(e) {
  47798. for (var t = [], i = 0; i < e.length; i++) {
  47799. var r = n.AnimationClip.parse(e[i]);
  47800. t.push(r)
  47801. }
  47802. return t
  47803. },
  47804. parseImages: function(e, t) {
  47805. function i(e) {
  47806. return r.manager.itemStart(e),
  47807. s.load(e, function() {
  47808. r.manager.itemEnd(e)
  47809. })
  47810. }
  47811. var r = this
  47812. , o = {};
  47813. if (void 0 !== e && e.length > 0) {
  47814. var a = new n.LoadingManager(t)
  47815. , s = new n.ImageLoader(a);
  47816. s.setCrossOrigin(this.crossOrigin);
  47817. for (var l = 0, c = e.length; l < c; l++) {
  47818. var h = e[l]
  47819. , u = /^(\/\/)|([a-z]+:(\/\/)?)/i.test(h.url) ? h.url : r.texturePath + h.url;
  47820. o[h.uuid] = i(u)
  47821. }
  47822. }
  47823. return o
  47824. },
  47825. parseTextures: function(e, t) {
  47826. function i(e) {
  47827. return "number" == typeof e ? e : (console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.", e),
  47828. n[e])
  47829. }
  47830. var r = {};
  47831. if (void 0 !== e)
  47832. for (var o = 0, a = e.length; o < a; o++) {
  47833. var s = e[o];
  47834. void 0 === s.image && console.warn('THREE.ObjectLoader: No "image" specified for', s.uuid),
  47835. void 0 === t[s.image] && console.warn("THREE.ObjectLoader: Undefined image", s.image);
  47836. var l = new n.Texture(t[s.image]);
  47837. l.needsUpdate = !0,
  47838. l.uuid = s.uuid,
  47839. void 0 !== s.name && (l.name = s.name),
  47840. void 0 !== s.mapping && (l.mapping = i(s.mapping)),
  47841. void 0 !== s.offset && (l.offset = new n.Vector2(s.offset[0],s.offset[1])),
  47842. void 0 !== s.repeat && (l.repeat = new n.Vector2(s.repeat[0],s.repeat[1])),
  47843. void 0 !== s.minFilter && (l.minFilter = i(s.minFilter)),
  47844. void 0 !== s.magFilter && (l.magFilter = i(s.magFilter)),
  47845. void 0 !== s.anisotropy && (l.anisotropy = s.anisotropy),
  47846. Array.isArray(s.wrap) && (l.wrapS = i(s.wrap[0]),
  47847. l.wrapT = i(s.wrap[1])),
  47848. r[s.uuid] = l
  47849. }
  47850. return r
  47851. },
  47852. parseObject: function() {
  47853. var e = new n.Matrix4;
  47854. return function(t, i, r) {
  47855. function o(e) {
  47856. return void 0 === i[e] && console.warn("THREE.ObjectLoader: Undefined geometry", e),
  47857. i[e]
  47858. }
  47859. function a(e) {
  47860. if (void 0 !== e)
  47861. return void 0 === r[e] && console.warn("THREE.ObjectLoader: Undefined material", e),
  47862. r[e]
  47863. }
  47864. var s;
  47865. switch (t.type) {
  47866. case "Scene":
  47867. s = new n.Scene;
  47868. break;
  47869. case "PerspectiveCamera":
  47870. s = new n.PerspectiveCamera(t.fov,t.aspect,t.near,t.far);
  47871. break;
  47872. case "OrthographicCamera":
  47873. s = new n.OrthographicCamera(t.left,t.right,t.top,t.bottom,t.near,t.far);
  47874. break;
  47875. case "AmbientLight":
  47876. s = new n.AmbientLight(t.color,t.intensity);
  47877. break;
  47878. case "DirectionalLight":
  47879. s = new n.DirectionalLight(t.color,t.intensity);
  47880. break;
  47881. case "PointLight":
  47882. s = new n.PointLight(t.color,t.intensity,t.distance,t.decay);
  47883. break;
  47884. case "SpotLight":
  47885. s = new n.SpotLight(t.color,t.intensity,t.distance,t.angle,t.penumbra,t.decay);
  47886. break;
  47887. case "HemisphereLight":
  47888. s = new n.HemisphereLight(t.color,t.groundColor,t.intensity);
  47889. break;
  47890. case "Mesh":
  47891. var l = o(t.geometry)
  47892. , c = a(t.material);
  47893. s = l.bones && l.bones.length > 0 ? new n.SkinnedMesh(l,c) : new n.Mesh(l,c);
  47894. break;
  47895. case "LOD":
  47896. s = new n.LOD;
  47897. break;
  47898. case "Line":
  47899. s = new n.Line(o(t.geometry),a(t.material),t.mode);
  47900. break;
  47901. case "PointCloud":
  47902. case "Points":
  47903. s = new n.Points(o(t.geometry),a(t.material));
  47904. break;
  47905. case "Sprite":
  47906. s = new n.Sprite(a(t.material));
  47907. break;
  47908. case "Group":
  47909. s = new n.Group;
  47910. break;
  47911. default:
  47912. s = new n.Object3D
  47913. }
  47914. if (s.uuid = t.uuid,
  47915. void 0 !== t.name && (s.name = t.name),
  47916. void 0 !== t.matrix ? (e.fromArray(t.matrix),
  47917. e.decompose(s.position, s.quaternion, s.scale)) : (void 0 !== t.position && s.position.fromArray(t.position),
  47918. void 0 !== t.rotation && s.rotation.fromArray(t.rotation),
  47919. void 0 !== t.scale && s.scale.fromArray(t.scale)),
  47920. void 0 !== t.castShadow && (s.castShadow = t.castShadow),
  47921. void 0 !== t.receiveShadow && (s.receiveShadow = t.receiveShadow),
  47922. void 0 !== t.visible && (s.visible = t.visible),
  47923. void 0 !== t.userData && (s.userData = t.userData),
  47924. void 0 !== t.children)
  47925. for (var h in t.children)
  47926. s.add(this.parseObject(t.children[h], i, r));
  47927. if ("LOD" === t.type)
  47928. for (var u = t.levels, d = 0; d < u.length; d++) {
  47929. var p = u[d]
  47930. , h = s.getObjectByProperty("uuid", p.object);
  47931. void 0 !== h && s.addLevel(h, p.distance)
  47932. }
  47933. return s
  47934. }
  47935. }()
  47936. },
  47937. n.TextureLoader = function(e) {
  47938. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  47939. }
  47940. ,
  47941. n.TextureLoader.prototype = {
  47942. constructor: n.TextureLoader,
  47943. load: function(e, t, i, r) {
  47944. var o = new n.Texture
  47945. , a = new n.ImageLoader(this.manager);
  47946. return a.setCrossOrigin(this.crossOrigin),
  47947. a.setPath(this.path),
  47948. a.load(e, function(e) {
  47949. o.image = e,
  47950. o.needsUpdate = !0,
  47951. void 0 !== t && t(o)
  47952. }, i, r),
  47953. o
  47954. },
  47955. setCrossOrigin: function(e) {
  47956. this.crossOrigin = e
  47957. },
  47958. setPath: function(e) {
  47959. this.path = e
  47960. }
  47961. },
  47962. n.CubeTextureLoader = function(e) {
  47963. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  47964. }
  47965. ,
  47966. n.CubeTextureLoader.prototype = {
  47967. constructor: n.CubeTextureLoader,
  47968. load: function(e, t, i, r) {
  47969. function o(i) {
  47970. s.load(e[i], function(e) {
  47971. a.images[i] = e,
  47972. l++,
  47973. 6 === l && (a.needsUpdate = !0,
  47974. t && t(a))
  47975. }, void 0, r)
  47976. }
  47977. var a = new n.CubeTexture
  47978. , s = new n.ImageLoader(this.manager);
  47979. s.setCrossOrigin(this.crossOrigin),
  47980. s.setPath(this.path);
  47981. for (var l = 0, c = 0; c < e.length; ++c)
  47982. o(c);
  47983. return a
  47984. },
  47985. setCrossOrigin: function(e) {
  47986. this.crossOrigin = e
  47987. },
  47988. setPath: function(e) {
  47989. this.path = e
  47990. }
  47991. },
  47992. n.DataTextureLoader = n.BinaryTextureLoader = function(e) {
  47993. this.manager = void 0 !== e ? e : n.DefaultLoadingManager,
  47994. this._parser = null
  47995. }
  47996. ,
  47997. n.BinaryTextureLoader.prototype = {
  47998. constructor: n.BinaryTextureLoader,
  47999. load: function(e, t, i, r) {
  48000. var o = this
  48001. , a = new n.DataTexture
  48002. , s = new n.XHRLoader(this.manager);
  48003. return s.setResponseType("arraybuffer"),
  48004. s.load(e, function(e) {
  48005. var i = o._parser(e);
  48006. i && (void 0 !== i.image ? a.image = i.image : void 0 !== i.data && (a.image.width = i.width,
  48007. a.image.height = i.height,
  48008. a.image.data = i.data),
  48009. a.wrapS = void 0 !== i.wrapS ? i.wrapS : n.ClampToEdgeWrapping,
  48010. a.wrapT = void 0 !== i.wrapT ? i.wrapT : n.ClampToEdgeWrapping,
  48011. a.magFilter = void 0 !== i.magFilter ? i.magFilter : n.LinearFilter,
  48012. a.minFilter = void 0 !== i.minFilter ? i.minFilter : n.LinearMipMapLinearFilter,
  48013. a.anisotropy = void 0 !== i.anisotropy ? i.anisotropy : 1,
  48014. void 0 !== i.format && (a.format = i.format),
  48015. void 0 !== i.type && (a.type = i.type),
  48016. void 0 !== i.mipmaps && (a.mipmaps = i.mipmaps),
  48017. 1 === i.mipmapCount && (a.minFilter = n.LinearFilter),
  48018. a.needsUpdate = !0,
  48019. t && t(a, i))
  48020. }, i, r),
  48021. a
  48022. }
  48023. },
  48024. n.CompressedTextureLoader = function(e) {
  48025. this.manager = void 0 !== e ? e : n.DefaultLoadingManager,
  48026. this._parser = null
  48027. }
  48028. ;
  48029. n.CompressedTextureLoader.prototype = {
  48030. constructor: n.CompressedTextureLoader,
  48031. load: function(e, t, i, r) {
  48032. function o(o) {
  48033. c.load(e[o], function(e) {
  48034. var i = a._parser(e, !0);
  48035. s[o] = {
  48036. width: i.width,
  48037. height: i.height,
  48038. format: i.format,
  48039. mipmaps: i.mipmaps
  48040. },
  48041. h += 1,
  48042. 6 === h && (1 === i.mipmapCount && (l.minFilter = n.LinearFilter),
  48043. l.format = i.format,
  48044. l.needsUpdate = !0,
  48045. t && t(l))
  48046. }, i, r)
  48047. }
  48048. var a = this
  48049. , s = []
  48050. , l = new n.CompressedTexture;
  48051. l.image = s;
  48052. var c = new n.XHRLoader(this.manager);
  48053. if (c.setPath(this.path),
  48054. c.setResponseType("arraybuffer"),
  48055. Array.isArray(e))
  48056. for (var h = 0, u = 0, d = e.length; u < d; ++u)
  48057. o(u);
  48058. else
  48059. c.load(e, function(e) {
  48060. var i = a._parser(e, !0);
  48061. if (i.isCubemap)
  48062. for (var r = i.mipmaps.length / i.mipmapCount, o = 0; o < r; o++) {
  48063. s[o] = {
  48064. mipmaps: []
  48065. };
  48066. for (var c = 0; c < i.mipmapCount; c++)
  48067. s[o].mipmaps.push(i.mipmaps[o * i.mipmapCount + c]),
  48068. s[o].format = i.format,
  48069. s[o].width = i.width,
  48070. s[o].height = i.height
  48071. }
  48072. else
  48073. l.image.width = i.width,
  48074. l.image.height = i.height,
  48075. l.mipmaps = i.mipmaps;
  48076. 1 === i.mipmapCount && (l.minFilter = n.LinearFilter),
  48077. l.format = i.format,
  48078. l.needsUpdate = !0,
  48079. t && t(l)
  48080. }, i, r);
  48081. return l
  48082. },
  48083. setPath: function(e) {
  48084. this.path = e
  48085. }
  48086. };
  48087. n.Material = function() {
  48088. Object.defineProperty(this, "id", {
  48089. value: n.MaterialIdCount++
  48090. }),
  48091. this.uuid = n.Math.generateUUID(),
  48092. this.name = "",
  48093. this.type = "Material",
  48094. this.side = n.FrontSide,
  48095. this.opacity = 1,
  48096. this.transparent = !1,
  48097. this.blending = n.NormalBlending,
  48098. this.blendSrc = n.SrcAlphaFactor,
  48099. this.blendDst = n.OneMinusSrcAlphaFactor,
  48100. this.blendEquation = n.AddEquation,
  48101. this.blendSrcAlpha = null,
  48102. this.blendDstAlpha = null,
  48103. this.blendEquationAlpha = null,
  48104. this.depthFunc = n.LessEqualDepth,
  48105. this.depthTest = !0,
  48106. this.depthWrite = !0,
  48107. this.colorWrite = !0,
  48108. this.precision = null,
  48109. this.polygonOffset = !1,
  48110. this.polygonOffsetFactor = 0,
  48111. this.polygonOffsetUnits = 0,
  48112. this.alphaTest = 0,
  48113. this.premultipliedAlpha = !1,
  48114. this.overdraw = 0,
  48115. this.visible = !0,
  48116. this._needsUpdate = !0
  48117. }
  48118. ,
  48119. n.Material.prototype = {
  48120. constructor: n.Material,
  48121. get needsUpdate() {
  48122. return this._needsUpdate
  48123. },
  48124. set needsUpdate(e) {
  48125. e === !0 && this.update(),
  48126. this._needsUpdate = e
  48127. },
  48128. setValues: function(e) {
  48129. if (void 0 !== e)
  48130. for (var t in e) {
  48131. var i = e[t];
  48132. if (void 0 !== i) {
  48133. var r = this[t];
  48134. 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.")
  48135. } else
  48136. console.warn("THREE.Material: '" + t + "' parameter is undefined.")
  48137. }
  48138. },
  48139. toJSON: function(e) {
  48140. function t(e) {
  48141. var t = [];
  48142. for (var i in e) {
  48143. var n = e[i];
  48144. delete n.metadata,
  48145. t.push(n)
  48146. }
  48147. return t
  48148. }
  48149. var i = void 0 === e;
  48150. i && (e = {
  48151. textures: {},
  48152. images: {}
  48153. });
  48154. var r = {
  48155. metadata: {
  48156. version: 4.4,
  48157. type: "Material",
  48158. generator: "Material.toJSON"
  48159. }
  48160. };
  48161. if (r.uuid = this.uuid,
  48162. r.type = this.type,
  48163. "" !== this.name && (r.name = this.name),
  48164. this.color instanceof n.Color && (r.color = this.color.getHex()),
  48165. .5 !== this.roughness && (r.roughness = this.roughness),
  48166. .5 !== this.metalness && (r.metalness = this.metalness),
  48167. this.emissive instanceof n.Color && (r.emissive = this.emissive.getHex()),
  48168. this.specular instanceof n.Color && (r.specular = this.specular.getHex()),
  48169. void 0 !== this.shininess && (r.shininess = this.shininess),
  48170. this.map instanceof n.Texture && (r.map = this.map.toJSON(e).uuid),
  48171. this.alphaMap instanceof n.Texture && (r.alphaMap = this.alphaMap.toJSON(e).uuid),
  48172. this.lightMap instanceof n.Texture && (r.lightMap = this.lightMap.toJSON(e).uuid),
  48173. this.bumpMap instanceof n.Texture && (r.bumpMap = this.bumpMap.toJSON(e).uuid,
  48174. r.bumpScale = this.bumpScale),
  48175. this.normalMap instanceof n.Texture && (r.normalMap = this.normalMap.toJSON(e).uuid,
  48176. r.normalScale = this.normalScale.toArray()),
  48177. this.displacementMap instanceof n.Texture && (r.displacementMap = this.displacementMap.toJSON(e).uuid,
  48178. r.displacementScale = this.displacementScale,
  48179. r.displacementBias = this.displacementBias),
  48180. this.roughnessMap instanceof n.Texture && (r.roughnessMap = this.roughnessMap.toJSON(e).uuid),
  48181. this.metalnessMap instanceof n.Texture && (r.metalnessMap = this.metalnessMap.toJSON(e).uuid),
  48182. this.emissiveMap instanceof n.Texture && (r.emissiveMap = this.emissiveMap.toJSON(e).uuid),
  48183. this.specularMap instanceof n.Texture && (r.specularMap = this.specularMap.toJSON(e).uuid),
  48184. this.envMap instanceof n.Texture && (r.envMap = this.envMap.toJSON(e).uuid,
  48185. r.reflectivity = this.reflectivity),
  48186. void 0 !== this.size && (r.size = this.size),
  48187. void 0 !== this.sizeAttenuation && (r.sizeAttenuation = this.sizeAttenuation),
  48188. void 0 !== this.vertexColors && this.vertexColors !== n.NoColors && (r.vertexColors = this.vertexColors),
  48189. void 0 !== this.shading && this.shading !== n.SmoothShading && (r.shading = this.shading),
  48190. void 0 !== this.blending && this.blending !== n.NormalBlending && (r.blending = this.blending),
  48191. void 0 !== this.side && this.side !== n.FrontSide && (r.side = this.side),
  48192. this.opacity < 1 && (r.opacity = this.opacity),
  48193. this.transparent === !0 && (r.transparent = this.transparent),
  48194. this.alphaTest > 0 && (r.alphaTest = this.alphaTest),
  48195. this.premultipliedAlpha === !0 && (r.premultipliedAlpha = this.premultipliedAlpha),
  48196. this.wireframe === !0 && (r.wireframe = this.wireframe),
  48197. this.wireframeLinewidth > 1 && (r.wireframeLinewidth = this.wireframeLinewidth),
  48198. i) {
  48199. var o = t(e.textures)
  48200. , a = t(e.images);
  48201. o.length > 0 && (r.textures = o),
  48202. a.length > 0 && (r.images = a)
  48203. }
  48204. return r
  48205. },
  48206. clone: function() {
  48207. return (new this.constructor).copy(this)
  48208. },
  48209. copy: function(e) {
  48210. return this.name = e.name,
  48211. this.side = e.side,
  48212. this.opacity = e.opacity,
  48213. this.transparent = e.transparent,
  48214. this.blending = e.blending,
  48215. this.blendSrc = e.blendSrc,
  48216. this.blendDst = e.blendDst,
  48217. this.blendEquation = e.blendEquation,
  48218. this.blendSrcAlpha = e.blendSrcAlpha,
  48219. this.blendDstAlpha = e.blendDstAlpha,
  48220. this.blendEquationAlpha = e.blendEquationAlpha,
  48221. this.depthFunc = e.depthFunc,
  48222. this.depthTest = e.depthTest,
  48223. this.depthWrite = e.depthWrite,
  48224. this.colorWrite = e.colorWrite,
  48225. this.precision = e.precision,
  48226. this.polygonOffset = e.polygonOffset,
  48227. this.polygonOffsetFactor = e.polygonOffsetFactor,
  48228. this.polygonOffsetUnits = e.polygonOffsetUnits,
  48229. this.alphaTest = e.alphaTest,
  48230. this.premultipliedAlpha = e.premultipliedAlpha,
  48231. this.overdraw = e.overdraw,
  48232. this.visible = e.visible,
  48233. this
  48234. },
  48235. update: function() {
  48236. this.dispatchEvent({
  48237. type: "update"
  48238. })
  48239. },
  48240. dispose: function() {
  48241. this.dispatchEvent({
  48242. type: "dispose"
  48243. })
  48244. }
  48245. },
  48246. n.EventDispatcher.prototype.apply(n.Material.prototype),
  48247. n.MaterialIdCount = 0,
  48248. n.LineBasicMaterial = function(e) {
  48249. n.Material.call(this),
  48250. this.type = "LineBasicMaterial",
  48251. this.color = new n.Color(16777215),
  48252. this.linewidth = 1,
  48253. this.linecap = "round",
  48254. this.linejoin = "round",
  48255. this.blending = n.NormalBlending,
  48256. this.vertexColors = n.NoColors,
  48257. this.fog = !0,
  48258. this.setValues(e)
  48259. }
  48260. ,
  48261. n.LineBasicMaterial.prototype = Object.create(n.Material.prototype),
  48262. n.LineBasicMaterial.prototype.constructor = n.LineBasicMaterial,
  48263. n.LineBasicMaterial.prototype.copy = function(e) {
  48264. return n.Material.prototype.copy.call(this, e),
  48265. this.color.copy(e.color),
  48266. this.linewidth = e.linewidth,
  48267. this.linecap = e.linecap,
  48268. this.linejoin = e.linejoin,
  48269. this.vertexColors = e.vertexColors,
  48270. this.fog = e.fog,
  48271. this
  48272. }
  48273. ,
  48274. n.LineDashedMaterial = function(e) {
  48275. n.Material.call(this),
  48276. this.type = "LineDashedMaterial",
  48277. this.color = new n.Color(16777215),
  48278. this.linewidth = 1,
  48279. this.scale = 1,
  48280. this.dashSize = 3,
  48281. this.gapSize = 1,
  48282. this.blending = n.NormalBlending,
  48283. this.vertexColors = n.NoColors,
  48284. this.fog = !0,
  48285. this.setValues(e)
  48286. }
  48287. ,
  48288. n.LineDashedMaterial.prototype = Object.create(n.Material.prototype),
  48289. n.LineDashedMaterial.prototype.constructor = n.LineDashedMaterial,
  48290. n.LineDashedMaterial.prototype.copy = function(e) {
  48291. return n.Material.prototype.copy.call(this, e),
  48292. this.color.copy(e.color),
  48293. this.linewidth = e.linewidth,
  48294. this.scale = e.scale,
  48295. this.dashSize = e.dashSize,
  48296. this.gapSize = e.gapSize,
  48297. this.vertexColors = e.vertexColors,
  48298. this.fog = e.fog,
  48299. this
  48300. }
  48301. ,
  48302. n.MeshBasicMaterial = function(e) {
  48303. n.Material.call(this),
  48304. this.type = "MeshBasicMaterial",
  48305. this.color = new n.Color(16777215),
  48306. this.map = null,
  48307. this.aoMap = null,
  48308. this.aoMapIntensity = 1,
  48309. this.specularMap = null,
  48310. this.alphaMap = null,
  48311. this.envMap = null,
  48312. this.combine = n.MultiplyOperation,
  48313. this.reflectivity = 1,
  48314. this.refractionRatio = .98,
  48315. this.fog = !0,
  48316. this.shading = n.SmoothShading,
  48317. this.blending = n.NormalBlending,
  48318. this.wireframe = !1,
  48319. this.wireframeLinewidth = 1,
  48320. this.wireframeLinecap = "round",
  48321. this.wireframeLinejoin = "round",
  48322. this.vertexColors = n.NoColors,
  48323. this.skinning = !1,
  48324. this.morphTargets = !1,
  48325. this.setValues(e)
  48326. }
  48327. ,
  48328. n.MeshBasicMaterial.prototype = Object.create(n.Material.prototype),
  48329. n.MeshBasicMaterial.prototype.constructor = n.MeshBasicMaterial,
  48330. n.MeshBasicMaterial.prototype.copy = function(e) {
  48331. return n.Material.prototype.copy.call(this, e),
  48332. this.color.copy(e.color),
  48333. this.map = e.map,
  48334. this.aoMap = e.aoMap,
  48335. this.aoMapIntensity = e.aoMapIntensity,
  48336. this.specularMap = e.specularMap,
  48337. this.alphaMap = e.alphaMap,
  48338. this.envMap = e.envMap,
  48339. this.combine = e.combine,
  48340. this.reflectivity = e.reflectivity,
  48341. this.refractionRatio = e.refractionRatio,
  48342. this.fog = e.fog,
  48343. this.shading = e.shading,
  48344. this.wireframe = e.wireframe,
  48345. this.wireframeLinewidth = e.wireframeLinewidth,
  48346. this.wireframeLinecap = e.wireframeLinecap,
  48347. this.wireframeLinejoin = e.wireframeLinejoin,
  48348. this.vertexColors = e.vertexColors,
  48349. this.skinning = e.skinning,
  48350. this.morphTargets = e.morphTargets,
  48351. this
  48352. }
  48353. ,
  48354. n.MeshLambertMaterial = function(e) {
  48355. n.Material.call(this),
  48356. this.type = "MeshLambertMaterial",
  48357. this.color = new n.Color(16777215),
  48358. this.map = null,
  48359. this.lightMap = null,
  48360. this.lightMapIntensity = 1,
  48361. this.aoMap = null,
  48362. this.aoMapIntensity = 1,
  48363. this.emissive = new n.Color(0),
  48364. this.emissiveIntensity = 1,
  48365. this.emissiveMap = null,
  48366. this.specularMap = null,
  48367. this.alphaMap = null,
  48368. this.envMap = null,
  48369. this.combine = n.MultiplyOperation,
  48370. this.reflectivity = 1,
  48371. this.refractionRatio = .98,
  48372. this.fog = !0,
  48373. this.blending = n.NormalBlending,
  48374. this.wireframe = !1,
  48375. this.wireframeLinewidth = 1,
  48376. this.wireframeLinecap = "round",
  48377. this.wireframeLinejoin = "round",
  48378. this.vertexColors = n.NoColors,
  48379. this.skinning = !1,
  48380. this.morphTargets = !1,
  48381. this.morphNormals = !1,
  48382. this.setValues(e)
  48383. }
  48384. ,
  48385. n.MeshLambertMaterial.prototype = Object.create(n.Material.prototype),
  48386. n.MeshLambertMaterial.prototype.constructor = n.MeshLambertMaterial,
  48387. n.MeshLambertMaterial.prototype.copy = function(e) {
  48388. return n.Material.prototype.copy.call(this, e),
  48389. this.color.copy(e.color),
  48390. this.map = e.map,
  48391. this.lightMap = e.lightMap,
  48392. this.lightMapIntensity = e.lightMapIntensity,
  48393. this.aoMap = e.aoMap,
  48394. this.aoMapIntensity = e.aoMapIntensity,
  48395. this.emissive.copy(e.emissive),
  48396. this.emissiveMap = e.emissiveMap,
  48397. this.emissiveIntensity = e.emissiveIntensity,
  48398. this.specularMap = e.specularMap,
  48399. this.alphaMap = e.alphaMap,
  48400. this.envMap = e.envMap,
  48401. this.combine = e.combine,
  48402. this.reflectivity = e.reflectivity,
  48403. this.refractionRatio = e.refractionRatio,
  48404. this.fog = e.fog,
  48405. this.wireframe = e.wireframe,
  48406. this.wireframeLinewidth = e.wireframeLinewidth,
  48407. this.wireframeLinecap = e.wireframeLinecap,
  48408. this.wireframeLinejoin = e.wireframeLinejoin,
  48409. this.vertexColors = e.vertexColors,
  48410. this.skinning = e.skinning,
  48411. this.morphTargets = e.morphTargets,
  48412. this.morphNormals = e.morphNormals,
  48413. this
  48414. }
  48415. ,
  48416. n.MeshPhongMaterial = function(e) {
  48417. n.Material.call(this),
  48418. this.type = "MeshPhongMaterial",
  48419. this.color = new n.Color(16777215),
  48420. this.specular = new n.Color(1118481),
  48421. this.shininess = 30,
  48422. this.map = null,
  48423. this.lightMap = null,
  48424. this.lightMapIntensity = 1,
  48425. this.aoMap = null,
  48426. this.aoMapIntensity = 1,
  48427. this.emissive = new n.Color(0),
  48428. this.emissiveIntensity = 1,
  48429. this.emissiveMap = null,
  48430. this.bumpMap = null,
  48431. this.bumpScale = 1,
  48432. this.normalMap = null,
  48433. this.normalScale = new n.Vector2(1,1),
  48434. this.displacementMap = null,
  48435. this.displacementScale = 1,
  48436. this.displacementBias = 0,
  48437. this.specularMap = null,
  48438. this.alphaMap = null,
  48439. this.envMap = null,
  48440. this.combine = n.MultiplyOperation,
  48441. this.reflectivity = 1,
  48442. this.refractionRatio = .98,
  48443. this.fog = !0,
  48444. this.shading = n.SmoothShading,
  48445. this.blending = n.NormalBlending,
  48446. this.wireframe = !1,
  48447. this.wireframeLinewidth = 1,
  48448. this.wireframeLinecap = "round",
  48449. this.wireframeLinejoin = "round",
  48450. this.vertexColors = n.NoColors,
  48451. this.skinning = !1,
  48452. this.morphTargets = !1,
  48453. this.morphNormals = !1,
  48454. this.setValues(e)
  48455. }
  48456. ,
  48457. n.MeshPhongMaterial.prototype = Object.create(n.Material.prototype),
  48458. n.MeshPhongMaterial.prototype.constructor = n.MeshPhongMaterial,
  48459. n.MeshPhongMaterial.prototype.copy = function(e) {
  48460. return n.Material.prototype.copy.call(this, e),
  48461. this.color.copy(e.color),
  48462. this.specular.copy(e.specular),
  48463. this.shininess = e.shininess,
  48464. this.map = e.map,
  48465. this.lightMap = e.lightMap,
  48466. this.lightMapIntensity = e.lightMapIntensity,
  48467. this.aoMap = e.aoMap,
  48468. this.aoMapIntensity = e.aoMapIntensity,
  48469. this.emissive.copy(e.emissive),
  48470. this.emissiveMap = e.emissiveMap,
  48471. this.emissiveIntensity = e.emissiveIntensity,
  48472. this.bumpMap = e.bumpMap,
  48473. this.bumpScale = e.bumpScale,
  48474. this.normalMap = e.normalMap,
  48475. this.normalScale.copy(e.normalScale),
  48476. this.displacementMap = e.displacementMap,
  48477. this.displacementScale = e.displacementScale,
  48478. this.displacementBias = e.displacementBias,
  48479. this.specularMap = e.specularMap,
  48480. this.alphaMap = e.alphaMap,
  48481. this.envMap = e.envMap,
  48482. this.combine = e.combine,
  48483. this.reflectivity = e.reflectivity,
  48484. this.refractionRatio = e.refractionRatio,
  48485. this.fog = e.fog,
  48486. this.shading = e.shading,
  48487. this.wireframe = e.wireframe,
  48488. this.wireframeLinewidth = e.wireframeLinewidth,
  48489. this.wireframeLinecap = e.wireframeLinecap,
  48490. this.wireframeLinejoin = e.wireframeLinejoin,
  48491. this.vertexColors = e.vertexColors,
  48492. this.skinning = e.skinning,
  48493. this.morphTargets = e.morphTargets,
  48494. this.morphNormals = e.morphNormals,
  48495. this
  48496. }
  48497. ,
  48498. n.MeshStandardMaterial = function(e) {
  48499. n.Material.call(this),
  48500. this.type = "MeshStandardMaterial",
  48501. this.color = new n.Color(16777215),
  48502. this.roughness = .5,
  48503. this.metalness = .5,
  48504. this.map = null,
  48505. this.lightMap = null,
  48506. this.lightMapIntensity = 1,
  48507. this.aoMap = null,
  48508. this.aoMapIntensity = 1,
  48509. this.emissive = new n.Color(0),
  48510. this.emissiveIntensity = 1,
  48511. this.emissiveMap = null,
  48512. this.bumpMap = null,
  48513. this.bumpScale = 1,
  48514. this.normalMap = null,
  48515. this.normalScale = new n.Vector2(1,1),
  48516. this.displacementMap = null,
  48517. this.displacementScale = 1,
  48518. this.displacementBias = 0,
  48519. this.roughnessMap = null,
  48520. this.metalnessMap = null,
  48521. this.alphaMap = null,
  48522. this.envMap = null,
  48523. this.envMapIntensity = 1,
  48524. this.refractionRatio = .98,
  48525. this.fog = !0,
  48526. this.shading = n.SmoothShading,
  48527. this.blending = n.NormalBlending,
  48528. this.wireframe = !1,
  48529. this.wireframeLinewidth = 1,
  48530. this.wireframeLinecap = "round",
  48531. this.wireframeLinejoin = "round",
  48532. this.vertexColors = n.NoColors,
  48533. this.skinning = !1,
  48534. this.morphTargets = !1,
  48535. this.morphNormals = !1,
  48536. this.setValues(e)
  48537. }
  48538. ,
  48539. n.MeshStandardMaterial.prototype = Object.create(n.Material.prototype),
  48540. n.MeshStandardMaterial.prototype.constructor = n.MeshStandardMaterial,
  48541. n.MeshStandardMaterial.prototype.copy = function(e) {
  48542. return n.Material.prototype.copy.call(this, e),
  48543. this.color.copy(e.color),
  48544. this.roughness = e.roughness,
  48545. this.metalness = e.metalness,
  48546. this.map = e.map,
  48547. this.lightMap = e.lightMap,
  48548. this.lightMapIntensity = e.lightMapIntensity,
  48549. this.aoMap = e.aoMap,
  48550. this.aoMapIntensity = e.aoMapIntensity,
  48551. this.emissive.copy(e.emissive),
  48552. this.emissiveMap = e.emissiveMap,
  48553. this.emissiveIntensity = e.emissiveIntensity,
  48554. this.bumpMap = e.bumpMap,
  48555. this.bumpScale = e.bumpScale,
  48556. this.normalMap = e.normalMap,
  48557. this.normalScale.copy(e.normalScale),
  48558. this.displacementMap = e.displacementMap,
  48559. this.displacementScale = e.displacementScale,
  48560. this.displacementBias = e.displacementBias,
  48561. this.roughnessMap = e.roughnessMap,
  48562. this.metalnessMap = e.metalnessMap,
  48563. this.alphaMap = e.alphaMap,
  48564. this.envMap = e.envMap,
  48565. this.envMapIntensity = e.envMapIntensity,
  48566. this.refractionRatio = e.refractionRatio,
  48567. this.fog = e.fog,
  48568. this.shading = e.shading,
  48569. this.wireframe = e.wireframe,
  48570. this.wireframeLinewidth = e.wireframeLinewidth,
  48571. this.wireframeLinecap = e.wireframeLinecap,
  48572. this.wireframeLinejoin = e.wireframeLinejoin,
  48573. this.vertexColors = e.vertexColors,
  48574. this.skinning = e.skinning,
  48575. this.morphTargets = e.morphTargets,
  48576. this.morphNormals = e.morphNormals,
  48577. this
  48578. }
  48579. ,
  48580. n.MeshDepthMaterial = function(e) {
  48581. n.Material.call(this),
  48582. this.type = "MeshDepthMaterial",
  48583. this.morphTargets = !1,
  48584. this.wireframe = !1,
  48585. this.wireframeLinewidth = 1,
  48586. this.setValues(e)
  48587. }
  48588. ,
  48589. n.MeshDepthMaterial.prototype = Object.create(n.Material.prototype),
  48590. n.MeshDepthMaterial.prototype.constructor = n.MeshDepthMaterial,
  48591. n.MeshDepthMaterial.prototype.copy = function(e) {
  48592. return n.Material.prototype.copy.call(this, e),
  48593. this.wireframe = e.wireframe,
  48594. this.wireframeLinewidth = e.wireframeLinewidth,
  48595. this
  48596. }
  48597. ,
  48598. n.MeshNormalMaterial = function(e) {
  48599. n.Material.call(this, e),
  48600. this.type = "MeshNormalMaterial",
  48601. this.wireframe = !1,
  48602. this.wireframeLinewidth = 1,
  48603. this.morphTargets = !1,
  48604. this.setValues(e)
  48605. }
  48606. ,
  48607. n.MeshNormalMaterial.prototype = Object.create(n.Material.prototype),
  48608. n.MeshNormalMaterial.prototype.constructor = n.MeshNormalMaterial,
  48609. n.MeshNormalMaterial.prototype.copy = function(e) {
  48610. return n.Material.prototype.copy.call(this, e),
  48611. this.wireframe = e.wireframe,
  48612. this.wireframeLinewidth = e.wireframeLinewidth,
  48613. this
  48614. }
  48615. ,
  48616. n.MultiMaterial = function(e) {
  48617. this.uuid = n.Math.generateUUID(),
  48618. this.type = "MultiMaterial",
  48619. this.materials = e instanceof Array ? e : [],
  48620. this.visible = !0
  48621. }
  48622. ,
  48623. n.MultiMaterial.prototype = {
  48624. constructor: n.MultiMaterial,
  48625. toJSON: function(e) {
  48626. for (var t = {
  48627. metadata: {
  48628. version: 4.2,
  48629. type: "material",
  48630. generator: "MaterialExporter"
  48631. },
  48632. uuid: this.uuid,
  48633. type: this.type,
  48634. materials: []
  48635. }, i = this.materials, n = 0, r = i.length; n < r; n++) {
  48636. var o = i[n].toJSON(e);
  48637. delete o.metadata,
  48638. t.materials.push(o)
  48639. }
  48640. return t.visible = this.visible,
  48641. t
  48642. },
  48643. clone: function() {
  48644. for (var e = new this.constructor, t = 0; t < this.materials.length; t++)
  48645. e.materials.push(this.materials[t].clone());
  48646. return e.visible = this.visible,
  48647. e
  48648. }
  48649. },
  48650. n.PointsMaterial = function(e) {
  48651. n.Material.call(this),
  48652. this.type = "PointsMaterial",
  48653. this.color = new n.Color(16777215),
  48654. this.map = null,
  48655. this.size = 1,
  48656. this.sizeAttenuation = !0,
  48657. this.blending = n.NormalBlending,
  48658. this.vertexColors = n.NoColors,
  48659. this.fog = !0,
  48660. this.setValues(e)
  48661. }
  48662. ,
  48663. n.PointsMaterial.prototype = Object.create(n.Material.prototype),
  48664. n.PointsMaterial.prototype.constructor = n.PointsMaterial,
  48665. n.PointsMaterial.prototype.copy = function(e) {
  48666. return n.Material.prototype.copy.call(this, e),
  48667. this.color.copy(e.color),
  48668. this.map = e.map,
  48669. this.size = e.size,
  48670. this.sizeAttenuation = e.sizeAttenuation,
  48671. this.vertexColors = e.vertexColors,
  48672. this.fog = e.fog,
  48673. this
  48674. }
  48675. ,
  48676. n.ShaderMaterial = function(e) {
  48677. n.Material.call(this),
  48678. this.type = "ShaderMaterial",
  48679. this.defines = {},
  48680. this.uniforms = {},
  48681. this.vertexShader = "void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",
  48682. this.fragmentShader = "void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}",
  48683. this.shading = n.SmoothShading,
  48684. this.linewidth = 1,
  48685. this.wireframe = !1,
  48686. this.wireframeLinewidth = 1,
  48687. this.fog = !1,
  48688. this.lights = !1,
  48689. this.vertexColors = n.NoColors,
  48690. this.skinning = !1,
  48691. this.morphTargets = !1,
  48692. this.morphNormals = !1,
  48693. this.extensions = {
  48694. derivatives: !1,
  48695. fragDepth: !1,
  48696. drawBuffers: !1,
  48697. shaderTextureLOD: !1
  48698. },
  48699. this.defaultAttributeValues = {
  48700. color: [1, 1, 1],
  48701. uv: [0, 0],
  48702. uv2: [0, 0]
  48703. },
  48704. this.index0AttributeName = void 0,
  48705. void 0 !== e && (void 0 !== e.attributes && console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."),
  48706. this.setValues(e))
  48707. }
  48708. ,
  48709. n.ShaderMaterial.prototype = Object.create(n.Material.prototype),
  48710. n.ShaderMaterial.prototype.constructor = n.ShaderMaterial,
  48711. n.ShaderMaterial.prototype.copy = function(e) {
  48712. return n.Material.prototype.copy.call(this, e),
  48713. this.fragmentShader = e.fragmentShader,
  48714. this.vertexShader = e.vertexShader,
  48715. this.uniforms = n.UniformsUtils.clone(e.uniforms),
  48716. this.defines = e.defines,
  48717. this.shading = e.shading,
  48718. this.wireframe = e.wireframe,
  48719. this.wireframeLinewidth = e.wireframeLinewidth,
  48720. this.fog = e.fog,
  48721. this.lights = e.lights,
  48722. this.vertexColors = e.vertexColors,
  48723. this.skinning = e.skinning,
  48724. this.morphTargets = e.morphTargets,
  48725. this.morphNormals = e.morphNormals,
  48726. this.extensions = e.extensions,
  48727. this
  48728. }
  48729. ,
  48730. n.ShaderMaterial.prototype.toJSON = function(e) {
  48731. var t = n.Material.prototype.toJSON.call(this, e);
  48732. return t.uniforms = this.uniforms,
  48733. t.vertexShader = this.vertexShader,
  48734. t.fragmentShader = this.fragmentShader,
  48735. t
  48736. }
  48737. ,
  48738. n.RawShaderMaterial = function(e) {
  48739. n.ShaderMaterial.call(this, e),
  48740. this.type = "RawShaderMaterial"
  48741. }
  48742. ,
  48743. n.RawShaderMaterial.prototype = Object.create(n.ShaderMaterial.prototype),
  48744. n.RawShaderMaterial.prototype.constructor = n.RawShaderMaterial,
  48745. n.SpriteMaterial = function(e) {
  48746. n.Material.call(this),
  48747. this.type = "SpriteMaterial",
  48748. this.color = new n.Color(16777215),
  48749. this.map = null,
  48750. this.rotation = 0,
  48751. this.fog = !1,
  48752. this.setValues(e)
  48753. }
  48754. ,
  48755. n.SpriteMaterial.prototype = Object.create(n.Material.prototype),
  48756. n.SpriteMaterial.prototype.constructor = n.SpriteMaterial,
  48757. n.SpriteMaterial.prototype.copy = function(e) {
  48758. return n.Material.prototype.copy.call(this, e),
  48759. this.color.copy(e.color),
  48760. this.map = e.map,
  48761. this.rotation = e.rotation,
  48762. this.fog = e.fog,
  48763. this
  48764. }
  48765. ,
  48766. n.Texture = function(e, t, i, r, o, a, s, l, c) {
  48767. Object.defineProperty(this, "id", {
  48768. value: n.TextureIdCount++
  48769. }),
  48770. this.uuid = n.Math.generateUUID(),
  48771. this.name = "",
  48772. this.sourceFile = "",
  48773. this.image = void 0 !== e ? e : n.Texture.DEFAULT_IMAGE,
  48774. this.mipmaps = [],
  48775. this.mapping = void 0 !== t ? t : n.Texture.DEFAULT_MAPPING,
  48776. this.wrapS = void 0 !== i ? i : n.ClampToEdgeWrapping,
  48777. this.wrapT = void 0 !== r ? r : n.ClampToEdgeWrapping,
  48778. this.magFilter = void 0 !== o ? o : n.LinearFilter,
  48779. this.minFilter = void 0 !== a ? a : n.LinearMipMapLinearFilter,
  48780. this.anisotropy = void 0 !== c ? c : 1,
  48781. this.format = void 0 !== s ? s : n.RGBAFormat,
  48782. this.type = void 0 !== l ? l : n.UnsignedByteType,
  48783. this.offset = new n.Vector2(0,0),
  48784. this.repeat = new n.Vector2(1,1),
  48785. this.generateMipmaps = !0,
  48786. this.premultiplyAlpha = !1,
  48787. this.flipY = !0,
  48788. this.unpackAlignment = 4,
  48789. this.encoding = n.LinearEncoding,
  48790. this.version = 0,
  48791. this.onUpdate = null
  48792. }
  48793. ,
  48794. n.Texture.DEFAULT_IMAGE = void 0,
  48795. n.Texture.DEFAULT_MAPPING = n.UVMapping,
  48796. n.Texture.prototype = {
  48797. constructor: n.Texture,
  48798. set needsUpdate(e) {
  48799. e === !0 && this.version++
  48800. },
  48801. clone: function() {
  48802. return (new this.constructor).copy(this)
  48803. },
  48804. copy: function(e) {
  48805. return this.image = e.image,
  48806. this.mipmaps = e.mipmaps.slice(0),
  48807. this.mapping = e.mapping,
  48808. this.wrapS = e.wrapS,
  48809. this.wrapT = e.wrapT,
  48810. this.magFilter = e.magFilter,
  48811. this.minFilter = e.minFilter,
  48812. this.anisotropy = e.anisotropy,
  48813. this.format = e.format,
  48814. this.type = e.type,
  48815. this.offset.copy(e.offset),
  48816. this.repeat.copy(e.repeat),
  48817. this.generateMipmaps = e.generateMipmaps,
  48818. this.premultiplyAlpha = e.premultiplyAlpha,
  48819. this.flipY = e.flipY,
  48820. this.unpackAlignment = e.unpackAlignment,
  48821. this.encoding = e.encoding,
  48822. this
  48823. },
  48824. toJSON: function(e) {
  48825. function t(e) {
  48826. var t;
  48827. return void 0 !== e.toDataURL ? t = e : (t = document.createElement("canvas"),
  48828. t.width = e.width,
  48829. t.height = e.height,
  48830. t.getContext("2d").drawImage(e, 0, 0, e.width, e.height)),
  48831. t.width > 2048 || t.height > 2048 ? t.toDataURL("image/jpeg", .6) : t.toDataURL("image/png")
  48832. }
  48833. if (void 0 !== e.textures[this.uuid])
  48834. return e.textures[this.uuid];
  48835. var i = {
  48836. metadata: {
  48837. version: 4.4,
  48838. type: "Texture",
  48839. generator: "Texture.toJSON"
  48840. },
  48841. uuid: this.uuid,
  48842. name: this.name,
  48843. mapping: this.mapping,
  48844. repeat: [this.repeat.x, this.repeat.y],
  48845. offset: [this.offset.x, this.offset.y],
  48846. wrap: [this.wrapS, this.wrapT],
  48847. minFilter: this.minFilter,
  48848. magFilter: this.magFilter,
  48849. anisotropy: this.anisotropy
  48850. };
  48851. if (void 0 !== this.image) {
  48852. var r = this.image;
  48853. void 0 === r.uuid && (r.uuid = n.Math.generateUUID()),
  48854. void 0 === e.images[r.uuid] && (e.images[r.uuid] = {
  48855. uuid: r.uuid,
  48856. url: t(r)
  48857. }),
  48858. i.image = r.uuid
  48859. }
  48860. return e.textures[this.uuid] = i,
  48861. i
  48862. },
  48863. dispose: function() {
  48864. this.dispatchEvent({
  48865. type: "dispose"
  48866. })
  48867. },
  48868. transformUv: function(e) {
  48869. if (this.mapping === n.UVMapping) {
  48870. if (e.multiply(this.repeat),
  48871. e.add(this.offset),
  48872. e.x < 0 || e.x > 1)
  48873. switch (this.wrapS) {
  48874. case n.RepeatWrapping:
  48875. e.x = e.x - Math.floor(e.x);
  48876. break;
  48877. case n.ClampToEdgeWrapping:
  48878. e.x = e.x < 0 ? 0 : 1;
  48879. break;
  48880. case n.MirroredRepeatWrapping:
  48881. 1 === Math.abs(Math.floor(e.x) % 2) ? e.x = Math.ceil(e.x) - e.x : e.x = e.x - Math.floor(e.x)
  48882. }
  48883. if (e.y < 0 || e.y > 1)
  48884. switch (this.wrapT) {
  48885. case n.RepeatWrapping:
  48886. e.y = e.y - Math.floor(e.y);
  48887. break;
  48888. case n.ClampToEdgeWrapping:
  48889. e.y = e.y < 0 ? 0 : 1;
  48890. break;
  48891. case n.MirroredRepeatWrapping:
  48892. 1 === Math.abs(Math.floor(e.y) % 2) ? e.y = Math.ceil(e.y) - e.y : e.y = e.y - Math.floor(e.y)
  48893. }
  48894. this.flipY && (e.y = 1 - e.y)
  48895. }
  48896. }
  48897. },
  48898. n.EventDispatcher.prototype.apply(n.Texture.prototype),
  48899. n.TextureIdCount = 0,
  48900. n.CanvasTexture = function(e, t, i, r, o, a, s, l, c) {
  48901. n.Texture.call(this, e, t, i, r, o, a, s, l, c),
  48902. this.needsUpdate = !0
  48903. }
  48904. ,
  48905. n.CanvasTexture.prototype = Object.create(n.Texture.prototype),
  48906. n.CanvasTexture.prototype.constructor = n.CanvasTexture,
  48907. n.CubeTexture = function(e, t, i, r, o, a, s, l, c) {
  48908. e = void 0 !== e ? e : [],
  48909. t = void 0 !== t ? t : n.CubeReflectionMapping,
  48910. n.Texture.call(this, e, t, i, r, o, a, s, l, c),
  48911. this.flipY = !1
  48912. }
  48913. ,
  48914. n.CubeTexture.prototype = Object.create(n.Texture.prototype),
  48915. n.CubeTexture.prototype.constructor = n.CubeTexture,
  48916. Object.defineProperty(n.CubeTexture.prototype, "images", {
  48917. get: function() {
  48918. return this.image
  48919. },
  48920. set: function(e) {
  48921. this.image = e
  48922. }
  48923. }),
  48924. n.CompressedTexture = function(e, t, i, r, o, a, s, l, c, h, u) {
  48925. n.Texture.call(this, null, a, s, l, c, h, r, o, u),
  48926. this.image = {
  48927. width: t,
  48928. height: i
  48929. },
  48930. this.mipmaps = e,
  48931. this.flipY = !1,
  48932. this.generateMipmaps = !1
  48933. }
  48934. ,
  48935. n.CompressedTexture.prototype = Object.create(n.Texture.prototype),
  48936. n.CompressedTexture.prototype.constructor = n.CompressedTexture,
  48937. n.DataTexture = function(e, t, i, r, o, a, s, l, c, h, u) {
  48938. n.Texture.call(this, null, a, s, l, c, h, r, o, u),
  48939. this.image = {
  48940. data: e,
  48941. width: t,
  48942. height: i
  48943. },
  48944. this.magFilter = void 0 !== c ? c : n.NearestFilter,
  48945. this.minFilter = void 0 !== h ? h : n.NearestFilter,
  48946. this.flipY = !1,
  48947. this.generateMipmaps = !1
  48948. }
  48949. ,
  48950. n.DataTexture.prototype = Object.create(n.Texture.prototype),
  48951. n.DataTexture.prototype.constructor = n.DataTexture,
  48952. n.VideoTexture = function(e, t, i, r, o, a, s, l, c) {
  48953. function h() {
  48954. requestAnimationFrame(h),
  48955. e.readyState === e.HAVE_ENOUGH_DATA && (u.needsUpdate = !0)
  48956. }
  48957. n.Texture.call(this, e, t, i, r, o, a, s, l, c),
  48958. this.generateMipmaps = !1;
  48959. var u = this;
  48960. h()
  48961. }
  48962. ,
  48963. n.VideoTexture.prototype = Object.create(n.Texture.prototype),
  48964. n.VideoTexture.prototype.constructor = n.VideoTexture,
  48965. n.Group = function() {
  48966. n.Object3D.call(this),
  48967. this.type = "Group"
  48968. }
  48969. ,
  48970. n.Group.prototype = Object.create(n.Object3D.prototype),
  48971. n.Group.prototype.constructor = n.Group,
  48972. n.Points = function(e, t) {
  48973. n.Object3D.call(this),
  48974. this.type = "Points",
  48975. this.geometry = void 0 !== e ? e : new n.Geometry,
  48976. this.material = void 0 !== t ? t : new n.PointsMaterial({
  48977. color: 16777215 * Math.random()
  48978. })
  48979. }
  48980. ,
  48981. n.Points.prototype = Object.create(n.Object3D.prototype),
  48982. n.Points.prototype.constructor = n.Points,
  48983. n.Points.prototype.raycast = function() {
  48984. var e = new n.Matrix4
  48985. , t = new n.Ray
  48986. , i = new n.Sphere;
  48987. return function(r, o) {
  48988. function a(e, i) {
  48989. var n = t.distanceSqToPoint(e);
  48990. if (n < d) {
  48991. var a = t.closestPointToPoint(e);
  48992. a.applyMatrix4(c);
  48993. var l = r.ray.origin.distanceTo(a);
  48994. if (l < r.near || l > r.far)
  48995. return;
  48996. o.push({
  48997. distance: l,
  48998. distanceToRay: Math.sqrt(n),
  48999. point: a.clone(),
  49000. index: i,
  49001. face: null,
  49002. object: s
  49003. })
  49004. }
  49005. }
  49006. var s = this
  49007. , l = this.geometry
  49008. , c = this.matrixWorld
  49009. , h = r.params.Points.threshold;
  49010. if (null === l.boundingSphere && l.computeBoundingSphere(),
  49011. i.copy(l.boundingSphere),
  49012. i.applyMatrix4(c),
  49013. r.ray.intersectsSphere(i) !== !1) {
  49014. e.getInverse(c),
  49015. t.copy(r.ray).applyMatrix4(e);
  49016. var u = h / ((this.scale.x + this.scale.y + this.scale.z) / 3)
  49017. , d = u * u
  49018. , p = new n.Vector3;
  49019. if (l instanceof n.BufferGeometry) {
  49020. var f = l.index
  49021. , g = l.attributes
  49022. , m = g.position.array;
  49023. if (null !== f)
  49024. for (var v = f.array, A = 0, y = v.length; A < y; A++) {
  49025. var C = v[A];
  49026. p.fromArray(m, 3 * C),
  49027. a(p, C)
  49028. }
  49029. else
  49030. for (var A = 0, I = m.length / 3; A < I; A++)
  49031. p.fromArray(m, 3 * A),
  49032. a(p, A)
  49033. } else
  49034. for (var E = l.vertices, A = 0, I = E.length; A < I; A++)
  49035. a(E[A], A)
  49036. }
  49037. }
  49038. }(),
  49039. n.Points.prototype.clone = function() {
  49040. return new this.constructor(this.geometry,this.material).copy(this)
  49041. }
  49042. ,
  49043. n.Line = function(e, t, i) {
  49044. return 1 === i ? (console.warn("THREE.Line: parameter THREE.LinePieces no longer supported. Created THREE.LineSegments instead."),
  49045. new n.LineSegments(e,t)) : (n.Object3D.call(this),
  49046. this.type = "Line",
  49047. this.geometry = void 0 !== e ? e : new n.Geometry,
  49048. void (this.material = void 0 !== t ? t : new n.LineBasicMaterial({
  49049. color: 16777215 * Math.random()
  49050. })))
  49051. }
  49052. ,
  49053. n.Line.prototype = Object.create(n.Object3D.prototype),
  49054. n.Line.prototype.constructor = n.Line,
  49055. n.Line.prototype.raycast = function() {
  49056. var e = new n.Matrix4
  49057. , t = new n.Ray
  49058. , i = new n.Sphere;
  49059. return function(r, o) {
  49060. var a = r.linePrecision
  49061. , s = a * a
  49062. , l = this.geometry
  49063. , c = this.matrixWorld;
  49064. if (null === l.boundingSphere && l.computeBoundingSphere(),
  49065. i.copy(l.boundingSphere),
  49066. i.applyMatrix4(c),
  49067. r.ray.intersectsSphere(i) !== !1) {
  49068. e.getInverse(c),
  49069. t.copy(r.ray).applyMatrix4(e);
  49070. var h = new n.Vector3
  49071. , u = new n.Vector3
  49072. , d = new n.Vector3
  49073. , p = new n.Vector3
  49074. , f = this instanceof n.LineSegments ? 2 : 1;
  49075. if (l instanceof n.BufferGeometry) {
  49076. var g = l.index
  49077. , m = l.attributes
  49078. , v = m.position.array;
  49079. if (null !== g)
  49080. for (var A = g.array, y = 0, C = A.length - 1; y < C; y += f) {
  49081. var I = A[y]
  49082. , E = A[y + 1];
  49083. h.fromArray(v, 3 * I),
  49084. u.fromArray(v, 3 * E);
  49085. var b = t.distanceSqToSegment(h, u, p, d);
  49086. if (!(b > s)) {
  49087. p.applyMatrix4(this.matrixWorld);
  49088. var w = r.ray.origin.distanceTo(p);
  49089. w < r.near || w > r.far || o.push({
  49090. distance: w,
  49091. point: d.clone().applyMatrix4(this.matrixWorld),
  49092. index: y,
  49093. face: null,
  49094. faceIndex: null,
  49095. object: this
  49096. })
  49097. }
  49098. }
  49099. else
  49100. for (var y = 0, C = v.length / 3 - 1; y < C; y += f) {
  49101. h.fromArray(v, 3 * y),
  49102. u.fromArray(v, 3 * y + 3);
  49103. var b = t.distanceSqToSegment(h, u, p, d);
  49104. if (!(b > s)) {
  49105. p.applyMatrix4(this.matrixWorld);
  49106. var w = r.ray.origin.distanceTo(p);
  49107. w < r.near || w > r.far || o.push({
  49108. distance: w,
  49109. point: d.clone().applyMatrix4(this.matrixWorld),
  49110. index: y,
  49111. face: null,
  49112. faceIndex: null,
  49113. object: this
  49114. })
  49115. }
  49116. }
  49117. } else if (l instanceof n.Geometry)
  49118. for (var _ = l.vertices, T = _.length, y = 0; y < T - 1; y += f) {
  49119. var b = t.distanceSqToSegment(_[y], _[y + 1], p, d);
  49120. if (!(b > s)) {
  49121. p.applyMatrix4(this.matrixWorld);
  49122. var w = r.ray.origin.distanceTo(p);
  49123. w < r.near || w > r.far || o.push({
  49124. distance: w,
  49125. point: d.clone().applyMatrix4(this.matrixWorld),
  49126. index: y,
  49127. face: null,
  49128. faceIndex: null,
  49129. object: this
  49130. })
  49131. }
  49132. }
  49133. }
  49134. }
  49135. }(),
  49136. n.Line.prototype.clone = function() {
  49137. return new this.constructor(this.geometry,this.material).copy(this)
  49138. }
  49139. ,
  49140. n.LineStrip = 0,
  49141. n.LinePieces = 1,
  49142. n.LineSegments = function(e, t) {
  49143. n.Line.call(this, e, t),
  49144. this.type = "LineSegments"
  49145. }
  49146. ,
  49147. n.LineSegments.prototype = Object.create(n.Line.prototype),
  49148. n.LineSegments.prototype.constructor = n.LineSegments,
  49149. n.Mesh = function(e, t) {
  49150. n.Object3D.call(this),
  49151. this.type = "Mesh",
  49152. this.geometry = void 0 !== e ? e : new n.Geometry,
  49153. this.material = void 0 !== t ? t : new n.MeshBasicMaterial({
  49154. color: 16777215 * Math.random()
  49155. }),
  49156. this.drawMode = n.TrianglesDrawMode,
  49157. this.updateMorphTargets()
  49158. }
  49159. ,
  49160. n.Mesh.prototype = Object.create(n.Object3D.prototype),
  49161. n.Mesh.prototype.constructor = n.Mesh,
  49162. n.Mesh.prototype.setDrawMode = function(e) {
  49163. this.drawMode = e
  49164. }
  49165. ,
  49166. n.Mesh.prototype.updateMorphTargets = function() {
  49167. if (void 0 !== this.geometry.morphTargets && this.geometry.morphTargets.length > 0) {
  49168. this.morphTargetBase = -1,
  49169. this.morphTargetInfluences = [],
  49170. this.morphTargetDictionary = {};
  49171. for (var e = 0, t = this.geometry.morphTargets.length; e < t; e++)
  49172. this.morphTargetInfluences.push(0),
  49173. this.morphTargetDictionary[this.geometry.morphTargets[e].name] = e
  49174. }
  49175. }
  49176. ,
  49177. n.Mesh.prototype.getMorphTargetIndexByName = function(e) {
  49178. return void 0 !== this.morphTargetDictionary[e] ? this.morphTargetDictionary[e] : (console.warn("THREE.Mesh.getMorphTargetIndexByName: morph target " + e + " does not exist. Returning 0."),
  49179. 0)
  49180. }
  49181. ,
  49182. n.Mesh.prototype.raycast = function() {
  49183. function e(e, t, i, r, o, a, s) {
  49184. return n.Triangle.barycoordFromPoint(e, t, i, r, m),
  49185. o.multiplyScalar(m.x),
  49186. a.multiplyScalar(m.y),
  49187. s.multiplyScalar(m.z),
  49188. o.add(a).add(s),
  49189. o.clone()
  49190. }
  49191. function t(e, t, i, r, o, a, s) {
  49192. var l, c = e.material;
  49193. if (l = c.side === n.BackSide ? i.intersectTriangle(a, o, r, !0, s) : i.intersectTriangle(r, o, a, c.side !== n.DoubleSide, s),
  49194. null === l)
  49195. return null;
  49196. A.copy(s),
  49197. A.applyMatrix4(e.matrixWorld);
  49198. var h = t.ray.origin.distanceTo(A);
  49199. return h < t.near || h > t.far ? null : {
  49200. distance: h,
  49201. point: A.clone(),
  49202. object: e
  49203. }
  49204. }
  49205. function i(i, r, o, a, h, u, d, m) {
  49206. s.fromArray(a, 3 * u),
  49207. l.fromArray(a, 3 * d),
  49208. c.fromArray(a, 3 * m);
  49209. var A = t(i, r, o, s, l, c, v);
  49210. return A && (h && (p.fromArray(h, 2 * u),
  49211. f.fromArray(h, 2 * d),
  49212. g.fromArray(h, 2 * m),
  49213. A.uv = e(v, s, l, c, p, f, g)),
  49214. A.face = new n.Face3(u,d,m,n.Triangle.normal(s, l, c)),
  49215. A.faceIndex = u),
  49216. A
  49217. }
  49218. var r = new n.Matrix4
  49219. , o = new n.Ray
  49220. , a = new n.Sphere
  49221. , s = new n.Vector3
  49222. , l = new n.Vector3
  49223. , c = new n.Vector3
  49224. , h = new n.Vector3
  49225. , u = new n.Vector3
  49226. , d = new n.Vector3
  49227. , p = new n.Vector2
  49228. , f = new n.Vector2
  49229. , g = new n.Vector2
  49230. , m = new n.Vector3
  49231. , v = new n.Vector3
  49232. , A = new n.Vector3;
  49233. return function(m, A) {
  49234. var y = this.geometry
  49235. , C = this.material
  49236. , I = this.matrixWorld;
  49237. if (void 0 !== C && (null === y.boundingSphere && y.computeBoundingSphere(),
  49238. a.copy(y.boundingSphere),
  49239. a.applyMatrix4(I),
  49240. m.ray.intersectsSphere(a) !== !1 && (r.getInverse(I),
  49241. o.copy(m.ray).applyMatrix4(r),
  49242. null === y.boundingBox || o.intersectsBox(y.boundingBox) !== !1))) {
  49243. var E, b;
  49244. if (y instanceof n.BufferGeometry) {
  49245. var w, _, T, x = y.index, S = y.attributes, M = S.position.array;
  49246. if (void 0 !== S.uv && (E = S.uv.array),
  49247. null !== x)
  49248. for (var R = x.array, P = 0, O = R.length; P < O; P += 3)
  49249. w = R[P],
  49250. _ = R[P + 1],
  49251. T = R[P + 2],
  49252. b = i(this, m, o, M, E, w, _, T),
  49253. b && (b.faceIndex = Math.floor(P / 3),
  49254. A.push(b));
  49255. else
  49256. for (var P = 0, O = M.length; P < O; P += 9)
  49257. w = P / 3,
  49258. _ = w + 1,
  49259. T = w + 2,
  49260. b = i(this, m, o, M, E, w, _, T),
  49261. b && (b.index = w,
  49262. A.push(b))
  49263. } else if (y instanceof n.Geometry) {
  49264. 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];
  49265. k.length > 0 && (E = k);
  49266. for (var H = 0, G = U.length; H < G; H++) {
  49267. var z = U[H]
  49268. , W = B === !0 ? F[z.materialIndex] : C;
  49269. if (void 0 !== W) {
  49270. if (L = V[z.a],
  49271. D = V[z.b],
  49272. N = V[z.c],
  49273. W.morphTargets === !0) {
  49274. var j = y.morphTargets
  49275. , Y = this.morphTargetInfluences;
  49276. s.set(0, 0, 0),
  49277. l.set(0, 0, 0),
  49278. c.set(0, 0, 0);
  49279. for (var X = 0, Z = j.length; X < Z; X++) {
  49280. var q = Y[X];
  49281. if (0 !== q) {
  49282. var K = j[X].vertices;
  49283. s.addScaledVector(h.subVectors(K[z.a], L), q),
  49284. l.addScaledVector(u.subVectors(K[z.b], D), q),
  49285. c.addScaledVector(d.subVectors(K[z.c], N), q)
  49286. }
  49287. }
  49288. s.add(L),
  49289. l.add(D),
  49290. c.add(N),
  49291. L = s,
  49292. D = l,
  49293. N = c
  49294. }
  49295. if (b = t(this, m, o, L, D, N, v)) {
  49296. if (E) {
  49297. var Q = E[H];
  49298. p.copy(Q[0]),
  49299. f.copy(Q[1]),
  49300. g.copy(Q[2]),
  49301. b.uv = e(v, L, D, N, p, f, g)
  49302. }
  49303. b.face = z,
  49304. b.faceIndex = H,
  49305. A.push(b)
  49306. }
  49307. }
  49308. }
  49309. }
  49310. }
  49311. }
  49312. }(),
  49313. n.Mesh.prototype.clone = function() {
  49314. return new this.constructor(this.geometry,this.material).copy(this)
  49315. }
  49316. ,
  49317. n.Bone = function(e) {
  49318. n.Object3D.call(this),
  49319. this.type = "Bone",
  49320. this.skin = e
  49321. }
  49322. ,
  49323. n.Bone.prototype = Object.create(n.Object3D.prototype),
  49324. n.Bone.prototype.constructor = n.Bone,
  49325. n.Bone.prototype.copy = function(e) {
  49326. return n.Object3D.prototype.copy.call(this, e),
  49327. this.skin = e.skin,
  49328. this
  49329. }
  49330. ,
  49331. n.Skeleton = function(e, t, i) {
  49332. if (this.useVertexTexture = void 0 === i || i,
  49333. this.identityMatrix = new n.Matrix4,
  49334. e = e || [],
  49335. this.bones = e.slice(0),
  49336. this.useVertexTexture) {
  49337. var r = Math.sqrt(4 * this.bones.length);
  49338. r = n.Math.nextPowerOfTwo(Math.ceil(r)),
  49339. r = Math.max(r, 4),
  49340. this.boneTextureWidth = r,
  49341. this.boneTextureHeight = r,
  49342. this.boneMatrices = new Float32Array(this.boneTextureWidth * this.boneTextureHeight * 4),
  49343. this.boneTexture = new n.DataTexture(this.boneMatrices,this.boneTextureWidth,this.boneTextureHeight,n.RGBAFormat,n.FloatType)
  49344. } else
  49345. this.boneMatrices = new Float32Array(16 * this.bones.length);
  49346. if (void 0 === t)
  49347. this.calculateInverses();
  49348. else if (this.bones.length === t.length)
  49349. this.boneInverses = t.slice(0);
  49350. else {
  49351. console.warn("THREE.Skeleton bonInverses is the wrong length."),
  49352. this.boneInverses = [];
  49353. for (var o = 0, a = this.bones.length; o < a; o++)
  49354. this.boneInverses.push(new n.Matrix4)
  49355. }
  49356. }
  49357. ,
  49358. n.Skeleton.prototype.calculateInverses = function() {
  49359. this.boneInverses = [];
  49360. for (var e = 0, t = this.bones.length; e < t; e++) {
  49361. var i = new n.Matrix4;
  49362. this.bones[e] && i.getInverse(this.bones[e].matrixWorld),
  49363. this.boneInverses.push(i)
  49364. }
  49365. }
  49366. ,
  49367. n.Skeleton.prototype.pose = function() {
  49368. for (var e, t = 0, i = this.bones.length; t < i; t++)
  49369. e = this.bones[t],
  49370. e && e.matrixWorld.getInverse(this.boneInverses[t]);
  49371. for (var t = 0, i = this.bones.length; t < i; t++)
  49372. e = this.bones[t],
  49373. e && (e.parent ? (e.matrix.getInverse(e.parent.matrixWorld),
  49374. e.matrix.multiply(e.matrixWorld)) : e.matrix.copy(e.matrixWorld),
  49375. e.matrix.decompose(e.position, e.quaternion, e.scale));
  49376. }
  49377. ,
  49378. n.Skeleton.prototype.update = function() {
  49379. var e = new n.Matrix4;
  49380. return function() {
  49381. for (var t = 0, i = this.bones.length; t < i; t++) {
  49382. var n = this.bones[t] ? this.bones[t].matrixWorld : this.identityMatrix;
  49383. e.multiplyMatrices(n, this.boneInverses[t]),
  49384. e.flattenToArrayOffset(this.boneMatrices, 16 * t)
  49385. }
  49386. this.useVertexTexture && (this.boneTexture.needsUpdate = !0)
  49387. }
  49388. }(),
  49389. n.Skeleton.prototype.clone = function() {
  49390. return new n.Skeleton(this.bones,this.boneInverses,this.useVertexTexture)
  49391. }
  49392. ,
  49393. n.SkinnedMesh = function(e, t, i) {
  49394. n.Mesh.call(this, e, t),
  49395. this.type = "SkinnedMesh",
  49396. this.bindMode = "attached",
  49397. this.bindMatrix = new n.Matrix4,
  49398. this.bindMatrixInverse = new n.Matrix4;
  49399. var r = [];
  49400. if (this.geometry && void 0 !== this.geometry.bones) {
  49401. for (var o, a, s = 0, l = this.geometry.bones.length; s < l; ++s)
  49402. a = this.geometry.bones[s],
  49403. o = new n.Bone(this),
  49404. r.push(o),
  49405. o.name = a.name,
  49406. o.position.fromArray(a.pos),
  49407. o.quaternion.fromArray(a.rotq),
  49408. void 0 !== a.scl && o.scale.fromArray(a.scl);
  49409. for (var s = 0, l = this.geometry.bones.length; s < l; ++s)
  49410. a = this.geometry.bones[s],
  49411. a.parent !== -1 && null !== a.parent ? r[a.parent].add(r[s]) : this.add(r[s])
  49412. }
  49413. this.normalizeSkinWeights(),
  49414. this.updateMatrixWorld(!0),
  49415. this.bind(new n.Skeleton(r,void 0,i), this.matrixWorld)
  49416. }
  49417. ,
  49418. n.SkinnedMesh.prototype = Object.create(n.Mesh.prototype),
  49419. n.SkinnedMesh.prototype.constructor = n.SkinnedMesh,
  49420. n.SkinnedMesh.prototype.bind = function(e, t) {
  49421. this.skeleton = e,
  49422. void 0 === t && (this.updateMatrixWorld(!0),
  49423. this.skeleton.calculateInverses(),
  49424. t = this.matrixWorld),
  49425. this.bindMatrix.copy(t),
  49426. this.bindMatrixInverse.getInverse(t)
  49427. }
  49428. ,
  49429. n.SkinnedMesh.prototype.pose = function() {
  49430. this.skeleton.pose()
  49431. }
  49432. ,
  49433. n.SkinnedMesh.prototype.normalizeSkinWeights = function() {
  49434. if (this.geometry instanceof n.Geometry)
  49435. for (var e = 0; e < this.geometry.skinWeights.length; e++) {
  49436. var t = this.geometry.skinWeights[e]
  49437. , i = 1 / t.lengthManhattan();
  49438. i !== 1 / 0 ? t.multiplyScalar(i) : t.set(1, 0, 0, 0)
  49439. }
  49440. else if (this.geometry instanceof n.BufferGeometry)
  49441. for (var r = new n.Vector4, o = this.geometry.attributes.skinWeight, e = 0; e < o.count; e++) {
  49442. r.x = o.getX(e),
  49443. r.y = o.getY(e),
  49444. r.z = o.getZ(e),
  49445. r.w = o.getW(e);
  49446. var i = 1 / r.lengthManhattan();
  49447. i !== 1 / 0 ? r.multiplyScalar(i) : r.set(1, 0, 0, 0),
  49448. o.setXYZW(e, r.x, r.y, r.z, r.w)
  49449. }
  49450. }
  49451. ,
  49452. n.SkinnedMesh.prototype.updateMatrixWorld = function(e) {
  49453. n.Mesh.prototype.updateMatrixWorld.call(this, !0),
  49454. "attached" === this.bindMode ? this.bindMatrixInverse.getInverse(this.matrixWorld) : "detached" === this.bindMode ? this.bindMatrixInverse.getInverse(this.bindMatrix) : console.warn("THREE.SkinnedMesh unrecognized bindMode: " + this.bindMode)
  49455. }
  49456. ,
  49457. n.SkinnedMesh.prototype.clone = function() {
  49458. return new this.constructor(this.geometry,this.material,this.useVertexTexture).copy(this)
  49459. }
  49460. ,
  49461. n.LOD = function() {
  49462. n.Object3D.call(this),
  49463. this.type = "LOD",
  49464. Object.defineProperties(this, {
  49465. levels: {
  49466. enumerable: !0,
  49467. value: []
  49468. },
  49469. objects: {
  49470. get: function() {
  49471. return console.warn("THREE.LOD: .objects has been renamed to .levels."),
  49472. this.levels
  49473. }
  49474. }
  49475. })
  49476. }
  49477. ,
  49478. n.LOD.prototype = Object.create(n.Object3D.prototype),
  49479. n.LOD.prototype.constructor = n.LOD,
  49480. n.LOD.prototype.addLevel = function(e, t) {
  49481. void 0 === t && (t = 0),
  49482. t = Math.abs(t);
  49483. for (var i = this.levels, n = 0; n < i.length && !(t < i[n].distance); n++)
  49484. ;
  49485. i.splice(n, 0, {
  49486. distance: t,
  49487. object: e
  49488. }),
  49489. this.add(e)
  49490. }
  49491. ,
  49492. n.LOD.prototype.getObjectForDistance = function(e) {
  49493. for (var t = this.levels, i = 1, n = t.length; i < n && !(e < t[i].distance); i++)
  49494. ;
  49495. return t[i - 1].object
  49496. }
  49497. ,
  49498. n.LOD.prototype.raycast = function() {
  49499. var e = new n.Vector3;
  49500. return function(t, i) {
  49501. e.setFromMatrixPosition(this.matrixWorld);
  49502. var n = t.ray.origin.distanceTo(e);
  49503. this.getObjectForDistance(n).raycast(t, i)
  49504. }
  49505. }(),
  49506. n.LOD.prototype.update = function() {
  49507. var e = new n.Vector3
  49508. , t = new n.Vector3;
  49509. return function(i) {
  49510. var n = this.levels;
  49511. if (n.length > 1) {
  49512. e.setFromMatrixPosition(i.matrixWorld),
  49513. t.setFromMatrixPosition(this.matrixWorld);
  49514. var r = e.distanceTo(t);
  49515. n[0].object.visible = !0;
  49516. for (var o = 1, a = n.length; o < a && r >= n[o].distance; o++)
  49517. n[o - 1].object.visible = !1,
  49518. n[o].object.visible = !0;
  49519. for (; o < a; o++)
  49520. n[o].object.visible = !1
  49521. }
  49522. }
  49523. }(),
  49524. n.LOD.prototype.copy = function(e) {
  49525. n.Object3D.prototype.copy.call(this, e, !1);
  49526. for (var t = e.levels, i = 0, r = t.length; i < r; i++) {
  49527. var o = t[i];
  49528. this.addLevel(o.object.clone(), o.distance)
  49529. }
  49530. return this
  49531. }
  49532. ,
  49533. n.LOD.prototype.toJSON = function(e) {
  49534. var t = n.Object3D.prototype.toJSON.call(this, e);
  49535. t.object.levels = [];
  49536. for (var i = this.levels, r = 0, o = i.length; r < o; r++) {
  49537. var a = i[r];
  49538. t.object.levels.push({
  49539. object: a.object.uuid,
  49540. distance: a.distance
  49541. })
  49542. }
  49543. return t
  49544. }
  49545. ,
  49546. n.Sprite = function() {
  49547. var e = new Uint16Array([0, 1, 2, 0, 2, 3])
  49548. , t = new Float32Array([-.5, -.5, 0, .5, -.5, 0, .5, .5, 0, -.5, .5, 0])
  49549. , i = new Float32Array([0, 0, 1, 0, 1, 1, 0, 1])
  49550. , r = new n.BufferGeometry;
  49551. return r.setIndex(new n.BufferAttribute(e,1)),
  49552. r.addAttribute("position", new n.BufferAttribute(t,3)),
  49553. r.addAttribute("uv", new n.BufferAttribute(i,2)),
  49554. function(e) {
  49555. n.Object3D.call(this),
  49556. this.type = "Sprite",
  49557. this.geometry = r,
  49558. this.material = void 0 !== e ? e : new n.SpriteMaterial
  49559. }
  49560. }(),
  49561. n.Sprite.prototype = Object.create(n.Object3D.prototype),
  49562. n.Sprite.prototype.constructor = n.Sprite,
  49563. n.Sprite.prototype.raycast = function() {
  49564. var e = new n.Vector3;
  49565. return function(t, i) {
  49566. e.setFromMatrixPosition(this.matrixWorld);
  49567. var n = t.ray.distanceSqToPoint(e)
  49568. , r = this.scale.x * this.scale.y;
  49569. n > r || i.push({
  49570. distance: Math.sqrt(n),
  49571. point: this.position,
  49572. face: null,
  49573. object: this
  49574. })
  49575. }
  49576. }(),
  49577. n.Sprite.prototype.clone = function() {
  49578. return new this.constructor(this.material).copy(this)
  49579. }
  49580. ,
  49581. n.Particle = n.Sprite,
  49582. n.LensFlare = function(e, t, i, r, o) {
  49583. n.Object3D.call(this),
  49584. this.lensFlares = [],
  49585. this.positionScreen = new n.Vector3,
  49586. this.customUpdateCallback = void 0,
  49587. void 0 !== e && this.add(e, t, i, r, o)
  49588. }
  49589. ,
  49590. n.LensFlare.prototype = Object.create(n.Object3D.prototype),
  49591. n.LensFlare.prototype.constructor = n.LensFlare,
  49592. n.LensFlare.prototype.add = function(e, t, i, r, o, a) {
  49593. void 0 === t && (t = -1),
  49594. void 0 === i && (i = 0),
  49595. void 0 === a && (a = 1),
  49596. void 0 === o && (o = new n.Color(16777215)),
  49597. void 0 === r && (r = n.NormalBlending),
  49598. i = Math.min(i, Math.max(0, i)),
  49599. this.lensFlares.push({
  49600. texture: e,
  49601. size: t,
  49602. distance: i,
  49603. x: 0,
  49604. y: 0,
  49605. z: 0,
  49606. scale: 1,
  49607. rotation: 0,
  49608. opacity: a,
  49609. color: o,
  49610. blending: r
  49611. })
  49612. }
  49613. ,
  49614. n.LensFlare.prototype.updateLensFlares = function() {
  49615. var e, t, i = this.lensFlares.length, n = 2 * -this.positionScreen.x, r = 2 * -this.positionScreen.y;
  49616. for (e = 0; e < i; e++)
  49617. t = this.lensFlares[e],
  49618. t.x = this.positionScreen.x + n * t.distance,
  49619. t.y = this.positionScreen.y + r * t.distance,
  49620. t.wantedRotation = t.x * Math.PI * .25,
  49621. t.rotation += .25 * (t.wantedRotation - t.rotation)
  49622. }
  49623. ,
  49624. n.LensFlare.prototype.copy = function(e) {
  49625. n.Object3D.prototype.copy.call(this, e),
  49626. this.positionScreen.copy(e.positionScreen),
  49627. this.customUpdateCallback = e.customUpdateCallback;
  49628. for (var t = 0, i = e.lensFlares.length; t < i; t++)
  49629. this.lensFlares.push(e.lensFlares[t]);
  49630. return this
  49631. }
  49632. ,
  49633. n.Scene = function() {
  49634. n.Object3D.call(this),
  49635. this.type = "Scene",
  49636. this.fog = null,
  49637. this.overrideMaterial = null,
  49638. this.autoUpdate = !0
  49639. }
  49640. ,
  49641. n.Scene.prototype = Object.create(n.Object3D.prototype),
  49642. n.Scene.prototype.constructor = n.Scene,
  49643. n.Scene.prototype.copy = function(e, t) {
  49644. return n.Object3D.prototype.copy.call(this, e, t),
  49645. null !== e.fog && (this.fog = e.fog.clone()),
  49646. null !== e.overrideMaterial && (this.overrideMaterial = e.overrideMaterial.clone()),
  49647. this.autoUpdate = e.autoUpdate,
  49648. this.matrixAutoUpdate = e.matrixAutoUpdate,
  49649. this
  49650. }
  49651. ,
  49652. n.Fog = function(e, t, i) {
  49653. this.name = "",
  49654. this.color = new n.Color(e),
  49655. this.near = void 0 !== t ? t : 1,
  49656. this.far = void 0 !== i ? i : 1e3
  49657. }
  49658. ,
  49659. n.Fog.prototype.clone = function() {
  49660. return new n.Fog(this.color.getHex(),this.near,this.far)
  49661. }
  49662. ,
  49663. n.FogExp2 = function(e, t) {
  49664. this.name = "",
  49665. this.color = new n.Color(e),
  49666. this.density = void 0 !== t ? t : 25e-5
  49667. }
  49668. ,
  49669. n.FogExp2.prototype.clone = function() {
  49670. return new n.FogExp2(this.color.getHex(),this.density)
  49671. }
  49672. ,
  49673. n.ShaderChunk = {},
  49674. n.ShaderChunk.alphamap_fragment = "#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif\n",
  49675. n.ShaderChunk.alphamap_pars_fragment = "#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif\n",
  49676. n.ShaderChunk.alphatest_fragment = "#ifdef ALPHATEST\n\tif ( diffuseColor.a < ALPHATEST ) discard;\n#endif\n",
  49677. 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",
  49678. n.ShaderChunk.aomap_pars_fragment = "#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",
  49679. n.ShaderChunk.begin_vertex = "\nvec3 transformed = vec3( position );\n",
  49680. n.ShaderChunk.beginnormal_vertex = "\nvec3 objectNormal = vec3( normal );\n",
  49681. 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",
  49682. 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",
  49683. n.ShaderChunk.color_fragment = "#ifdef USE_COLOR\n\tdiffuseColor.rgb *= vColor;\n#endif",
  49684. n.ShaderChunk.color_pars_fragment = "#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif\n",
  49685. n.ShaderChunk.color_pars_vertex = "#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",
  49686. n.ShaderChunk.color_vertex = "#ifdef USE_COLOR\n\tvColor.xyz = color.xyz;\n#endif",
  49687. 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",
  49688. 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",
  49689. n.ShaderChunk.defaultnormal_vertex = "#ifdef FLIP_SIDED\n\tobjectNormal = -objectNormal;\n#endif\nvec3 transformedNormal = normalMatrix * objectNormal;\n",
  49690. n.ShaderChunk.displacementmap_vertex = "#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normal * ( texture2D( displacementMap, uv ).x * displacementScale + displacementBias );\n#endif\n",
  49691. n.ShaderChunk.displacementmap_pars_vertex = "#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif\n",
  49692. 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",
  49693. n.ShaderChunk.emissivemap_pars_fragment = "#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif\n",
  49694. 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",
  49695. n.ShaderChunk.encodings_fragment = " gl_FragColor = linearToOutputTexel( gl_FragColor );\n",
  49696. 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",
  49697. 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",
  49698. 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",
  49699. 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",
  49700. 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",
  49701. 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",
  49702. n.ShaderChunk.lightmap_fragment = "#ifdef USE_LIGHTMAP\n\treflectedLight.indirectDiffuse += PI * texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n#endif\n",
  49703. n.ShaderChunk.lightmap_pars_fragment = "#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",
  49704. 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",
  49705. 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",
  49706. n.ShaderChunk.lights_phong_fragment = "BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;\n",
  49707. 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",
  49708. n.ShaderChunk.lights_phong_pars_vertex = "#ifdef USE_ENVMAP\n\tvarying vec3 vWorldPosition;\n#endif\n",
  49709. n.ShaderChunk.lights_phong_vertex = "#ifdef USE_ENVMAP\n\tvWorldPosition = worldPosition.xyz;\n#endif\n",
  49710. 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",
  49711. 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",
  49712. 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",
  49713. n.ShaderChunk.logdepthbuf_fragment = "#if defined(USE_LOGDEPTHBUF) && defined(USE_LOGDEPTHBUF_EXT)\n\tgl_FragDepthEXT = log2(vFragDepth) * logDepthBufFC * 0.5;\n#endif",
  49714. 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",
  49715. 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",
  49716. 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",
  49717. n.ShaderChunk.map_fragment = "#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif\n",
  49718. n.ShaderChunk.map_pars_fragment = "#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n",
  49719. 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",
  49720. n.ShaderChunk.map_particle_pars_fragment = "#ifdef USE_MAP\n\tuniform vec4 offsetRepeat;\n\tuniform sampler2D map;\n#endif\n",
  49721. n.ShaderChunk.metalnessmap_fragment = "float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.r;\n#endif\n",
  49722. n.ShaderChunk.metalnessmap_pars_fragment = "#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",
  49723. 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",
  49724. 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";
  49725. 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";
  49726. 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",
  49727. 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",
  49728. n.ShaderChunk.premultiplied_alpha_fragment = "#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif\n",
  49729. 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",
  49730. n.ShaderChunk.roughnessmap_fragment = "float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.r;\n#endif\n",
  49731. n.ShaderChunk.roughnessmap_pars_fragment = "#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",
  49732. 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",
  49733. 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",
  49734. 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",
  49735. 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",
  49736. 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",
  49737. 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",
  49738. 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",
  49739. 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",
  49740. 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",
  49741. n.ShaderChunk.specularmap_pars_fragment = "#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",
  49742. n.ShaderChunk.tonemapping_fragment = "#if defined( TONE_MAPPING )\n gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif\n",
  49743. 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",
  49744. n.ShaderChunk.uv2_pars_fragment = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif",
  49745. n.ShaderChunk.uv2_pars_vertex = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n#endif",
  49746. n.ShaderChunk.uv2_vertex = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = uv2;\n#endif",
  49747. 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",
  49748. 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",
  49749. 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",
  49750. 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",
  49751. n.UniformsUtils = {
  49752. merge: function(e) {
  49753. for (var t = {}, i = 0; i < e.length; i++) {
  49754. var n = this.clone(e[i]);
  49755. for (var r in n)
  49756. t[r] = n[r]
  49757. }
  49758. return t
  49759. },
  49760. clone: function(e) {
  49761. var t = {};
  49762. for (var i in e) {
  49763. t[i] = {};
  49764. for (var r in e[i]) {
  49765. var o = e[i][r];
  49766. 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
  49767. }
  49768. }
  49769. return t
  49770. }
  49771. },
  49772. n.UniformsLib = {
  49773. common: {
  49774. diffuse: {
  49775. type: "c",
  49776. value: new n.Color(15658734)
  49777. },
  49778. opacity: {
  49779. type: "f",
  49780. value: 1
  49781. },
  49782. map: {
  49783. type: "t",
  49784. value: null
  49785. },
  49786. offsetRepeat: {
  49787. type: "v4",
  49788. value: new n.Vector4(0,0,1,1)
  49789. },
  49790. specularMap: {
  49791. type: "t",
  49792. value: null
  49793. },
  49794. alphaMap: {
  49795. type: "t",
  49796. value: null
  49797. },
  49798. envMap: {
  49799. type: "t",
  49800. value: null
  49801. },
  49802. flipEnvMap: {
  49803. type: "f",
  49804. value: -1
  49805. },
  49806. reflectivity: {
  49807. type: "f",
  49808. value: 1
  49809. },
  49810. refractionRatio: {
  49811. type: "f",
  49812. value: .98
  49813. }
  49814. },
  49815. aomap: {
  49816. aoMap: {
  49817. type: "t",
  49818. value: null
  49819. },
  49820. aoMapIntensity: {
  49821. type: "f",
  49822. value: 1
  49823. }
  49824. },
  49825. lightmap: {
  49826. lightMap: {
  49827. type: "t",
  49828. value: null
  49829. },
  49830. lightMapIntensity: {
  49831. type: "f",
  49832. value: 1
  49833. }
  49834. },
  49835. emissivemap: {
  49836. emissiveMap: {
  49837. type: "t",
  49838. value: null
  49839. }
  49840. },
  49841. bumpmap: {
  49842. bumpMap: {
  49843. type: "t",
  49844. value: null
  49845. },
  49846. bumpScale: {
  49847. type: "f",
  49848. value: 1
  49849. }
  49850. },
  49851. normalmap: {
  49852. normalMap: {
  49853. type: "t",
  49854. value: null
  49855. },
  49856. normalScale: {
  49857. type: "v2",
  49858. value: new n.Vector2(1,1)
  49859. }
  49860. },
  49861. displacementmap: {
  49862. displacementMap: {
  49863. type: "t",
  49864. value: null
  49865. },
  49866. displacementScale: {
  49867. type: "f",
  49868. value: 1
  49869. },
  49870. displacementBias: {
  49871. type: "f",
  49872. value: 0
  49873. }
  49874. },
  49875. roughnessmap: {
  49876. roughnessMap: {
  49877. type: "t",
  49878. value: null
  49879. }
  49880. },
  49881. metalnessmap: {
  49882. metalnessMap: {
  49883. type: "t",
  49884. value: null
  49885. }
  49886. },
  49887. fog: {
  49888. fogDensity: {
  49889. type: "f",
  49890. value: 25e-5
  49891. },
  49892. fogNear: {
  49893. type: "f",
  49894. value: 1
  49895. },
  49896. fogFar: {
  49897. type: "f",
  49898. value: 2e3
  49899. },
  49900. fogColor: {
  49901. type: "c",
  49902. value: new n.Color(16777215)
  49903. }
  49904. },
  49905. lights: {
  49906. ambientLightColor: {
  49907. type: "fv",
  49908. value: []
  49909. },
  49910. directionalLights: {
  49911. type: "sa",
  49912. value: [],
  49913. properties: {
  49914. direction: {
  49915. type: "v3"
  49916. },
  49917. color: {
  49918. type: "c"
  49919. },
  49920. shadow: {
  49921. type: "i"
  49922. },
  49923. shadowBias: {
  49924. type: "f"
  49925. },
  49926. shadowRadius: {
  49927. type: "f"
  49928. },
  49929. shadowMapSize: {
  49930. type: "v2"
  49931. }
  49932. }
  49933. },
  49934. directionalShadowMap: {
  49935. type: "tv",
  49936. value: []
  49937. },
  49938. directionalShadowMatrix: {
  49939. type: "m4v",
  49940. value: []
  49941. },
  49942. spotLights: {
  49943. type: "sa",
  49944. value: [],
  49945. properties: {
  49946. color: {
  49947. type: "c"
  49948. },
  49949. position: {
  49950. type: "v3"
  49951. },
  49952. direction: {
  49953. type: "v3"
  49954. },
  49955. distance: {
  49956. type: "f"
  49957. },
  49958. coneCos: {
  49959. type: "f"
  49960. },
  49961. penumbraCos: {
  49962. type: "f"
  49963. },
  49964. decay: {
  49965. type: "f"
  49966. },
  49967. shadow: {
  49968. type: "i"
  49969. },
  49970. shadowBias: {
  49971. type: "f"
  49972. },
  49973. shadowRadius: {
  49974. type: "f"
  49975. },
  49976. shadowMapSize: {
  49977. type: "v2"
  49978. }
  49979. }
  49980. },
  49981. spotShadowMap: {
  49982. type: "tv",
  49983. value: []
  49984. },
  49985. spotShadowMatrix: {
  49986. type: "m4v",
  49987. value: []
  49988. },
  49989. pointLights: {
  49990. type: "sa",
  49991. value: [],
  49992. properties: {
  49993. color: {
  49994. type: "c"
  49995. },
  49996. position: {
  49997. type: "v3"
  49998. },
  49999. decay: {
  50000. type: "f"
  50001. },
  50002. distance: {
  50003. type: "f"
  50004. },
  50005. shadow: {
  50006. type: "i"
  50007. },
  50008. shadowBias: {
  50009. type: "f"
  50010. },
  50011. shadowRadius: {
  50012. type: "f"
  50013. },
  50014. shadowMapSize: {
  50015. type: "v2"
  50016. }
  50017. }
  50018. },
  50019. pointShadowMap: {
  50020. type: "tv",
  50021. value: []
  50022. },
  50023. pointShadowMatrix: {
  50024. type: "m4v",
  50025. value: []
  50026. },
  50027. hemisphereLights: {
  50028. type: "sa",
  50029. value: [],
  50030. properties: {
  50031. direction: {
  50032. type: "v3"
  50033. },
  50034. skyColor: {
  50035. type: "c"
  50036. },
  50037. groundColor: {
  50038. type: "c"
  50039. }
  50040. }
  50041. }
  50042. },
  50043. points: {
  50044. diffuse: {
  50045. type: "c",
  50046. value: new n.Color(15658734)
  50047. },
  50048. opacity: {
  50049. type: "f",
  50050. value: 1
  50051. },
  50052. size: {
  50053. type: "f",
  50054. value: 1
  50055. },
  50056. scale: {
  50057. type: "f",
  50058. value: 1
  50059. },
  50060. map: {
  50061. type: "t",
  50062. value: null
  50063. },
  50064. offsetRepeat: {
  50065. type: "v4",
  50066. value: new n.Vector4(0,0,1,1)
  50067. }
  50068. }
  50069. },
  50070. 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",
  50071. 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",
  50072. 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",
  50073. 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",
  50074. 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",
  50075. 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",
  50076. 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",
  50077. 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",
  50078. 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",
  50079. 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",
  50080. 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",
  50081. 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",
  50082. 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",
  50083. 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",
  50084. 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",
  50085. 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",
  50086. 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",
  50087. 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",
  50088. 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",
  50089. 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",
  50090. 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",
  50091. 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",
  50092. 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",
  50093. 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",
  50094. n.ShaderLib = {
  50095. basic: {
  50096. uniforms: n.UniformsUtils.merge([n.UniformsLib.common, n.UniformsLib.aomap, n.UniformsLib.fog]),
  50097. vertexShader: n.ShaderChunk.meshbasic_vert,
  50098. fragmentShader: n.ShaderChunk.meshbasic_frag
  50099. },
  50100. lambert: {
  50101. uniforms: n.UniformsUtils.merge([n.UniformsLib.common, n.UniformsLib.aomap, n.UniformsLib.lightmap, n.UniformsLib.emissivemap, n.UniformsLib.fog, n.UniformsLib.lights, {
  50102. emissive: {
  50103. type: "c",
  50104. value: new n.Color(0)
  50105. }
  50106. }]),
  50107. vertexShader: n.ShaderChunk.meshlambert_vert,
  50108. fragmentShader: n.ShaderChunk.meshlambert_frag
  50109. },
  50110. phong: {
  50111. 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, {
  50112. emissive: {
  50113. type: "c",
  50114. value: new n.Color(0)
  50115. },
  50116. specular: {
  50117. type: "c",
  50118. value: new n.Color(1118481)
  50119. },
  50120. shininess: {
  50121. type: "f",
  50122. value: 30
  50123. }
  50124. }]),
  50125. vertexShader: n.ShaderChunk.meshphong_vert,
  50126. fragmentShader: n.ShaderChunk.meshphong_frag
  50127. },
  50128. standard: {
  50129. 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, {
  50130. emissive: {
  50131. type: "c",
  50132. value: new n.Color(0)
  50133. },
  50134. roughness: {
  50135. type: "f",
  50136. value: .5
  50137. },
  50138. metalness: {
  50139. type: "f",
  50140. value: 0
  50141. },
  50142. envMapIntensity: {
  50143. type: "f",
  50144. value: 1
  50145. }
  50146. }]),
  50147. vertexShader: n.ShaderChunk.meshstandard_vert,
  50148. fragmentShader: n.ShaderChunk.meshstandard_frag
  50149. },
  50150. points: {
  50151. uniforms: n.UniformsUtils.merge([n.UniformsLib.points, n.UniformsLib.fog]),
  50152. vertexShader: n.ShaderChunk.points_vert,
  50153. fragmentShader: n.ShaderChunk.points_frag
  50154. },
  50155. dashed: {
  50156. uniforms: n.UniformsUtils.merge([n.UniformsLib.common, n.UniformsLib.fog, {
  50157. scale: {
  50158. type: "f",
  50159. value: 1
  50160. },
  50161. dashSize: {
  50162. type: "f",
  50163. value: 1
  50164. },
  50165. totalSize: {
  50166. type: "f",
  50167. value: 2
  50168. }
  50169. }]),
  50170. vertexShader: n.ShaderChunk.linedashed_vert,
  50171. fragmentShader: n.ShaderChunk.linedashed_frag
  50172. },
  50173. depth: {
  50174. uniforms: {
  50175. mNear: {
  50176. type: "f",
  50177. value: 1
  50178. },
  50179. mFar: {
  50180. type: "f",
  50181. value: 2e3
  50182. },
  50183. opacity: {
  50184. type: "f",
  50185. value: 1
  50186. }
  50187. },
  50188. vertexShader: n.ShaderChunk.depth_vert,
  50189. fragmentShader: n.ShaderChunk.depth_frag
  50190. },
  50191. normal: {
  50192. uniforms: {
  50193. opacity: {
  50194. type: "f",
  50195. value: 1
  50196. }
  50197. },
  50198. vertexShader: n.ShaderChunk.normal_vert,
  50199. fragmentShader: n.ShaderChunk.normal_frag
  50200. },
  50201. cube: {
  50202. uniforms: {
  50203. tCube: {
  50204. type: "t",
  50205. value: null
  50206. },
  50207. tFlip: {
  50208. type: "f",
  50209. value: -1
  50210. }
  50211. },
  50212. vertexShader: n.ShaderChunk.cube_vert,
  50213. fragmentShader: n.ShaderChunk.cube_frag
  50214. },
  50215. equirect: {
  50216. uniforms: {
  50217. tEquirect: {
  50218. type: "t",
  50219. value: null
  50220. },
  50221. tFlip: {
  50222. type: "f",
  50223. value: -1
  50224. }
  50225. },
  50226. vertexShader: n.ShaderChunk.equirect_vert,
  50227. fragmentShader: n.ShaderChunk.equirect_frag
  50228. },
  50229. depthRGBA: {
  50230. uniforms: {},
  50231. vertexShader: n.ShaderChunk.depthRGBA_vert,
  50232. fragmentShader: n.ShaderChunk.depthRGBA_frag
  50233. },
  50234. distanceRGBA: {
  50235. uniforms: {
  50236. lightPos: {
  50237. type: "v3",
  50238. value: new n.Vector3(0,0,0)
  50239. }
  50240. },
  50241. vertexShader: n.ShaderChunk.distanceRGBA_vert,
  50242. fragmentShader: n.ShaderChunk.distanceRGBA_frag
  50243. }
  50244. },
  50245. n.WebGLRenderer = function(e) {
  50246. function t() {
  50247. return null === ye ? Oe : 1
  50248. }
  50249. function i(e, t, i, n) {
  50250. se === !0 && (e *= n,
  50251. t *= n,
  50252. i *= n),
  50253. Ye.clearColor(e, t, i, n)
  50254. }
  50255. function r() {
  50256. Ye.init(),
  50257. Ye.scissor(we.copy(Le).multiplyScalar(Oe)),
  50258. Ye.viewport(Te.copy(Ne).multiplyScalar(Oe)),
  50259. i(Se.r, Se.g, Se.b, Me)
  50260. }
  50261. function o() {
  50262. Ae = null,
  50263. be = null,
  50264. Ee = "",
  50265. Ie = -1,
  50266. Ye.reset()
  50267. }
  50268. function a(e) {
  50269. e.preventDefault(),
  50270. o(),
  50271. r(),
  50272. Xe.clear()
  50273. }
  50274. function s(e) {
  50275. var t = e.target;
  50276. t.removeEventListener("dispose", s),
  50277. h(t),
  50278. ke.textures--
  50279. }
  50280. function l(e) {
  50281. var t = e.target;
  50282. t.removeEventListener("dispose", l),
  50283. u(t),
  50284. ke.textures--
  50285. }
  50286. function c(e) {
  50287. var t = e.target;
  50288. t.removeEventListener("dispose", c),
  50289. d(t)
  50290. }
  50291. function h(e) {
  50292. var t = Xe.get(e);
  50293. if (e.image && t.__image__webglTextureCube)
  50294. Ge.deleteTexture(t.__image__webglTextureCube);
  50295. else {
  50296. if (void 0 === t.__webglInit)
  50297. return;
  50298. Ge.deleteTexture(t.__webglTexture)
  50299. }
  50300. Xe.delete(e)
  50301. }
  50302. function u(e) {
  50303. var t = Xe.get(e)
  50304. , i = Xe.get(e.texture);
  50305. if (e && void 0 !== i.__webglTexture) {
  50306. if (Ge.deleteTexture(i.__webglTexture),
  50307. e instanceof n.WebGLRenderTargetCube)
  50308. for (var r = 0; r < 6; r++)
  50309. Ge.deleteFramebuffer(t.__webglFramebuffer[r]),
  50310. Ge.deleteRenderbuffer(t.__webglDepthbuffer[r]);
  50311. else
  50312. Ge.deleteFramebuffer(t.__webglFramebuffer),
  50313. Ge.deleteRenderbuffer(t.__webglDepthbuffer);
  50314. Xe.delete(e.texture),
  50315. Xe.delete(e)
  50316. }
  50317. }
  50318. function d(e) {
  50319. p(e),
  50320. Xe.delete(e)
  50321. }
  50322. function p(e) {
  50323. var t = Xe.get(e).program;
  50324. e.program = void 0,
  50325. void 0 !== t && qe.releaseProgram(t)
  50326. }
  50327. function f(e, t, i, r) {
  50328. var o;
  50329. if (i instanceof n.InstancedBufferGeometry && (o = We.get("ANGLE_instanced_arrays"),
  50330. null === o))
  50331. return void console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");
  50332. void 0 === r && (r = 0),
  50333. Ye.initAttributes();
  50334. var a = i.attributes
  50335. , s = t.getAttributes()
  50336. , l = e.defaultAttributeValues;
  50337. for (var c in s) {
  50338. var h = s[c];
  50339. if (h >= 0) {
  50340. var u = a[c];
  50341. if (void 0 !== u) {
  50342. var d = u.itemSize
  50343. , p = Ze.getAttributeBuffer(u);
  50344. if (u instanceof n.InterleavedBufferAttribute) {
  50345. var f = u.data
  50346. , g = f.stride
  50347. , m = u.offset;
  50348. f instanceof n.InstancedInterleavedBuffer ? (Ye.enableAttributeAndDivisor(h, f.meshPerAttribute, o),
  50349. void 0 === i.maxInstancedCount && (i.maxInstancedCount = f.meshPerAttribute * f.count)) : Ye.enableAttribute(h),
  50350. Ge.bindBuffer(Ge.ARRAY_BUFFER, p),
  50351. Ge.vertexAttribPointer(h, d, Ge.FLOAT, !1, g * f.array.BYTES_PER_ELEMENT, (r * g + m) * f.array.BYTES_PER_ELEMENT)
  50352. } else
  50353. u instanceof n.InstancedBufferAttribute ? (Ye.enableAttributeAndDivisor(h, u.meshPerAttribute, o),
  50354. void 0 === i.maxInstancedCount && (i.maxInstancedCount = u.meshPerAttribute * u.count)) : Ye.enableAttribute(h),
  50355. Ge.bindBuffer(Ge.ARRAY_BUFFER, p),
  50356. Ge.vertexAttribPointer(h, d, Ge.FLOAT, !1, 0, r * d * 4)
  50357. } else if (void 0 !== l) {
  50358. var v = l[c];
  50359. if (void 0 !== v)
  50360. switch (v.length) {
  50361. case 2:
  50362. Ge.vertexAttrib2fv(h, v);
  50363. break;
  50364. case 3:
  50365. Ge.vertexAttrib3fv(h, v);
  50366. break;
  50367. case 4:
  50368. Ge.vertexAttrib4fv(h, v);
  50369. break;
  50370. default:
  50371. Ge.vertexAttrib1fv(h, v)
  50372. }
  50373. }
  50374. }
  50375. }
  50376. Ye.disableUnusedAttributes()
  50377. }
  50378. function g(e, t) {
  50379. return Math.abs(t[0]) - Math.abs(e[0])
  50380. }
  50381. function m(e, t) {
  50382. 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
  50383. }
  50384. function v(e, t) {
  50385. 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
  50386. }
  50387. function A(e, t, i, n, r) {
  50388. var o, a;
  50389. i.transparent ? (o = de,
  50390. a = ++pe) : (o = he,
  50391. a = ++ue);
  50392. var s = o[a];
  50393. void 0 !== s ? (s.id = e.id,
  50394. s.object = e,
  50395. s.geometry = t,
  50396. s.material = i,
  50397. s.z = Ve.z,
  50398. s.group = r) : (s = {
  50399. id: e.id,
  50400. object: e,
  50401. geometry: t,
  50402. material: i,
  50403. z: Ve.z,
  50404. group: r
  50405. },
  50406. o.push(s))
  50407. }
  50408. function y(e, t) {
  50409. if (e.visible !== !1) {
  50410. if (e.layers.test(t.layers))
  50411. if (e instanceof n.Light)
  50412. ce.push(e);
  50413. else if (e instanceof n.Sprite)
  50414. e.frustumCulled !== !1 && Be.intersectsObject(e) !== !0 || ge.push(e);
  50415. else if (e instanceof n.LensFlare)
  50416. me.push(e);
  50417. else if (e instanceof n.ImmediateRenderObject)
  50418. ve.sortObjects === !0 && (Ve.setFromMatrixPosition(e.matrixWorld),
  50419. Ve.applyProjection(Fe)),
  50420. A(e, null, e.material, Ve.z, null);
  50421. else if ((e instanceof n.Mesh || e instanceof n.Line || e instanceof n.Points) && (e instanceof n.SkinnedMesh && e.skeleton.update(),
  50422. e.frustumCulled === !1 || Be.intersectsObject(e) === !0)) {
  50423. var i = e.material;
  50424. if (i.visible === !0) {
  50425. ve.sortObjects === !0 && (Ve.setFromMatrixPosition(e.matrixWorld),
  50426. Ve.applyProjection(Fe));
  50427. var r = Ze.update(e);
  50428. if (i instanceof n.MultiMaterial)
  50429. for (var o = r.groups, a = i.materials, s = 0, l = o.length; s < l; s++) {
  50430. var c = o[s]
  50431. , h = a[c.materialIndex];
  50432. h.visible === !0 && A(e, r, h, Ve.z, c)
  50433. }
  50434. else
  50435. A(e, r, i, Ve.z, null)
  50436. }
  50437. }
  50438. for (var u = e.children, s = 0, l = u.length; s < l; s++)
  50439. y(u[s], t)
  50440. }
  50441. }
  50442. function C(e, t, i, r) {
  50443. for (var o = 0, a = e.length; o < a; o++) {
  50444. var s = e[o]
  50445. , l = s.object
  50446. , c = s.geometry
  50447. , h = void 0 === r ? s.material : r
  50448. , u = s.group;
  50449. if (l.modelViewMatrix.multiplyMatrices(t.matrixWorldInverse, l.matrixWorld),
  50450. l.normalMatrix.getNormalMatrix(l.modelViewMatrix),
  50451. l instanceof n.ImmediateRenderObject) {
  50452. E(h);
  50453. var d = w(t, i, h, l);
  50454. Ee = "",
  50455. l.render(function(e) {
  50456. ve.renderBufferImmediate(e, d, h)
  50457. })
  50458. } else
  50459. ve.renderBufferDirect(t, i, c, h, l, u)
  50460. }
  50461. }
  50462. function I(e, t, i) {
  50463. var r = Xe.get(e)
  50464. , o = qe.getParameters(e, Ue, t, i)
  50465. , a = qe.getProgramCode(e, o)
  50466. , s = r.program
  50467. , l = !0;
  50468. if (void 0 === s)
  50469. e.addEventListener("dispose", c);
  50470. else if (s.code !== a)
  50471. p(e);
  50472. else {
  50473. if (void 0 !== o.shaderID)
  50474. return;
  50475. l = !1
  50476. }
  50477. if (l) {
  50478. if (o.shaderID) {
  50479. var h = n.ShaderLib[o.shaderID];
  50480. r.__webglShader = {
  50481. name: e.type,
  50482. uniforms: n.UniformsUtils.clone(h.uniforms),
  50483. vertexShader: h.vertexShader,
  50484. fragmentShader: h.fragmentShader
  50485. }
  50486. } else
  50487. r.__webglShader = {
  50488. name: e.type,
  50489. uniforms: e.uniforms,
  50490. vertexShader: e.vertexShader,
  50491. fragmentShader: e.fragmentShader
  50492. };
  50493. e.__webglShader = r.__webglShader,
  50494. s = qe.acquireProgram(e, o, a),
  50495. r.program = s,
  50496. e.program = s
  50497. }
  50498. var u = s.getAttributes();
  50499. if (e.morphTargets) {
  50500. e.numSupportedMorphTargets = 0;
  50501. for (var d = 0; d < ve.maxMorphTargets; d++)
  50502. u["morphTarget" + d] >= 0 && e.numSupportedMorphTargets++
  50503. }
  50504. if (e.morphNormals) {
  50505. e.numSupportedMorphNormals = 0;
  50506. for (var d = 0; d < ve.maxMorphNormals; d++)
  50507. u["morphNormal" + d] >= 0 && e.numSupportedMorphNormals++
  50508. }
  50509. r.uniformsList = [];
  50510. var f = r.__webglShader.uniforms
  50511. , g = r.program.getUniforms();
  50512. for (var m in f) {
  50513. var v = g[m];
  50514. v && r.uniformsList.push([r.__webglShader.uniforms[m], v])
  50515. }
  50516. (e instanceof n.MeshPhongMaterial || e instanceof n.MeshLambertMaterial || e instanceof n.MeshStandardMaterial || e.lights) && (r.lightsHash = Ue.hash,
  50517. f.ambientLightColor.value = Ue.ambient,
  50518. f.directionalLights.value = Ue.directional,
  50519. f.spotLights.value = Ue.spot,
  50520. f.pointLights.value = Ue.point,
  50521. f.hemisphereLights.value = Ue.hemi,
  50522. f.directionalShadowMap.value = Ue.directionalShadowMap,
  50523. f.directionalShadowMatrix.value = Ue.directionalShadowMatrix,
  50524. f.spotShadowMap.value = Ue.spotShadowMap,
  50525. f.spotShadowMatrix.value = Ue.spotShadowMatrix,
  50526. f.pointShadowMap.value = Ue.pointShadowMap,
  50527. f.pointShadowMatrix.value = Ue.pointShadowMatrix),
  50528. r.hasDynamicUniforms = !1;
  50529. for (var A = 0, y = r.uniformsList.length; A < y; A++) {
  50530. var C = r.uniformsList[A][0];
  50531. if (C.dynamic === !0) {
  50532. r.hasDynamicUniforms = !0;
  50533. break
  50534. }
  50535. }
  50536. }
  50537. function E(e) {
  50538. b(e),
  50539. 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),
  50540. Ye.setDepthFunc(e.depthFunc),
  50541. Ye.setDepthTest(e.depthTest),
  50542. Ye.setDepthWrite(e.depthWrite),
  50543. Ye.setColorWrite(e.colorWrite),
  50544. Ye.setPolygonOffset(e.polygonOffset, e.polygonOffsetFactor, e.polygonOffsetUnits)
  50545. }
  50546. function b(e) {
  50547. e.side !== n.DoubleSide ? Ye.enable(Ge.CULL_FACE) : Ye.disable(Ge.CULL_FACE),
  50548. Ye.setFlipSided(e.side === n.BackSide)
  50549. }
  50550. function w(e, t, i, r) {
  50551. xe = 0;
  50552. var o = Xe.get(i);
  50553. void 0 === o.program && (i.needsUpdate = !0),
  50554. void 0 !== o.lightsHash && o.lightsHash !== Ue.hash && (i.needsUpdate = !0),
  50555. i.needsUpdate && (I(i, t, r),
  50556. i.needsUpdate = !1);
  50557. var a = !1
  50558. , s = !1
  50559. , l = !1
  50560. , c = o.program
  50561. , h = c.getUniforms()
  50562. , u = o.__webglShader.uniforms;
  50563. if (c.id !== Ae && (Ge.useProgram(c.program),
  50564. Ae = c.id,
  50565. a = !0,
  50566. s = !0,
  50567. l = !0),
  50568. i.id !== Ie && (Ie = i.id,
  50569. s = !0),
  50570. (a || e !== be) && (Ge.uniformMatrix4fv(h.projectionMatrix, !1, e.projectionMatrix.elements),
  50571. je.logarithmicDepthBuffer && Ge.uniform1f(h.logDepthBufFC, 2 / (Math.log(e.far + 1) / Math.LN2)),
  50572. e !== be && (be = e,
  50573. s = !0,
  50574. l = !0),
  50575. (i instanceof n.ShaderMaterial || i instanceof n.MeshPhongMaterial || i instanceof n.MeshStandardMaterial || i.envMap) && void 0 !== h.cameraPosition && (Ve.setFromMatrixPosition(e.matrixWorld),
  50576. Ge.uniform3f(h.cameraPosition, Ve.x, Ve.y, Ve.z)),
  50577. (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),
  50578. void 0 !== h.toneMappingExposure && Ge.uniform1f(h.toneMappingExposure, ve.toneMappingExposure),
  50579. void 0 !== h.toneMappingWhitePoint && Ge.uniform1f(h.toneMappingWhitePoint, ve.toneMappingWhitePoint)),
  50580. i.skinning)
  50581. if (r.bindMatrix && void 0 !== h.bindMatrix && Ge.uniformMatrix4fv(h.bindMatrix, !1, r.bindMatrix.elements),
  50582. r.bindMatrixInverse && void 0 !== h.bindMatrixInverse && Ge.uniformMatrix4fv(h.bindMatrixInverse, !1, r.bindMatrixInverse.elements),
  50583. je.floatVertexTextures && r.skeleton && r.skeleton.useVertexTexture) {
  50584. if (void 0 !== h.boneTexture) {
  50585. var d = B();
  50586. Ge.uniform1i(h.boneTexture, d),
  50587. ve.setTexture(r.skeleton.boneTexture, d)
  50588. }
  50589. void 0 !== h.boneTextureWidth && Ge.uniform1i(h.boneTextureWidth, r.skeleton.boneTextureWidth),
  50590. void 0 !== h.boneTextureHeight && Ge.uniform1i(h.boneTextureHeight, r.skeleton.boneTextureHeight)
  50591. } else
  50592. r.skeleton && r.skeleton.boneMatrices && void 0 !== h.boneGlobalMatrices && Ge.uniformMatrix4fv(h.boneGlobalMatrices, !1, r.skeleton.boneMatrices);
  50593. return s && ((i instanceof n.MeshPhongMaterial || i instanceof n.MeshLambertMaterial || i instanceof n.MeshStandardMaterial || i.lights) && D(u, l),
  50594. t && i.fog && R(u, t),
  50595. (i instanceof n.MeshBasicMaterial || i instanceof n.MeshLambertMaterial || i instanceof n.MeshPhongMaterial || i instanceof n.MeshStandardMaterial) && T(u, i),
  50596. i instanceof n.LineBasicMaterial ? x(u, i) : i instanceof n.LineDashedMaterial ? (x(u, i),
  50597. 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,
  50598. u.mFar.value = e.far,
  50599. u.opacity.value = i.opacity) : i instanceof n.MeshNormalMaterial && (u.opacity.value = i.opacity),
  50600. V(o.uniformsList)),
  50601. N(h, r),
  50602. void 0 !== h.modelMatrix && Ge.uniformMatrix4fv(h.modelMatrix, !1, r.matrixWorld.elements),
  50603. o.hasDynamicUniforms === !0 && _(o.uniformsList, r, e),
  50604. c
  50605. }
  50606. function _(e, t, i) {
  50607. for (var n = [], r = 0, o = e.length; r < o; r++) {
  50608. var a = e[r][0]
  50609. , s = a.onUpdateCallback;
  50610. void 0 !== s && (s.bind(a)(t, i),
  50611. n.push(e[r]))
  50612. }
  50613. V(n)
  50614. }
  50615. function T(e, t) {
  50616. e.opacity.value = t.opacity,
  50617. e.diffuse.value = t.color,
  50618. t.emissive && e.emissive.value.copy(t.emissive).multiplyScalar(t.emissiveIntensity),
  50619. e.map.value = t.map,
  50620. e.specularMap.value = t.specularMap,
  50621. e.alphaMap.value = t.alphaMap,
  50622. t.aoMap && (e.aoMap.value = t.aoMap,
  50623. e.aoMapIntensity.value = t.aoMapIntensity);
  50624. var i;
  50625. 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),
  50626. void 0 !== i) {
  50627. i instanceof n.WebGLRenderTarget && (i = i.texture);
  50628. var r = i.offset
  50629. , o = i.repeat;
  50630. e.offsetRepeat.value.set(r.x, r.y, o.x, o.y)
  50631. }
  50632. e.envMap.value = t.envMap,
  50633. e.flipEnvMap.value = t.envMap instanceof n.WebGLRenderTargetCube ? 1 : -1,
  50634. e.reflectivity.value = t.reflectivity,
  50635. e.refractionRatio.value = t.refractionRatio
  50636. }
  50637. function x(e, t) {
  50638. e.diffuse.value = t.color,
  50639. e.opacity.value = t.opacity
  50640. }
  50641. function S(e, t) {
  50642. e.dashSize.value = t.dashSize,
  50643. e.totalSize.value = t.dashSize + t.gapSize,
  50644. e.scale.value = t.scale
  50645. }
  50646. function M(e, t) {
  50647. if (e.diffuse.value = t.color,
  50648. e.opacity.value = t.opacity,
  50649. e.size.value = t.size * Oe,
  50650. e.scale.value = te.clientHeight / 2,
  50651. e.map.value = t.map,
  50652. null !== t.map) {
  50653. var i = t.map.offset
  50654. , n = t.map.repeat;
  50655. e.offsetRepeat.value.set(i.x, i.y, n.x, n.y)
  50656. }
  50657. }
  50658. function R(e, t) {
  50659. e.fogColor.value = t.color,
  50660. t instanceof n.Fog ? (e.fogNear.value = t.near,
  50661. e.fogFar.value = t.far) : t instanceof n.FogExp2 && (e.fogDensity.value = t.density)
  50662. }
  50663. function P(e, t) {
  50664. t.lightMap && (e.lightMap.value = t.lightMap,
  50665. e.lightMapIntensity.value = t.lightMapIntensity),
  50666. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap)
  50667. }
  50668. function O(e, t) {
  50669. e.specular.value = t.specular,
  50670. e.shininess.value = Math.max(t.shininess, 1e-4),
  50671. t.lightMap && (e.lightMap.value = t.lightMap,
  50672. e.lightMapIntensity.value = t.lightMapIntensity),
  50673. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap),
  50674. t.bumpMap && (e.bumpMap.value = t.bumpMap,
  50675. e.bumpScale.value = t.bumpScale),
  50676. t.normalMap && (e.normalMap.value = t.normalMap,
  50677. e.normalScale.value.copy(t.normalScale)),
  50678. t.displacementMap && (e.displacementMap.value = t.displacementMap,
  50679. e.displacementScale.value = t.displacementScale,
  50680. e.displacementBias.value = t.displacementBias)
  50681. }
  50682. function L(e, t) {
  50683. e.roughness.value = t.roughness,
  50684. e.metalness.value = t.metalness,
  50685. t.roughnessMap && (e.roughnessMap.value = t.roughnessMap),
  50686. t.metalnessMap && (e.metalnessMap.value = t.metalnessMap),
  50687. t.lightMap && (e.lightMap.value = t.lightMap,
  50688. e.lightMapIntensity.value = t.lightMapIntensity),
  50689. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap),
  50690. t.bumpMap && (e.bumpMap.value = t.bumpMap,
  50691. e.bumpScale.value = t.bumpScale),
  50692. t.normalMap && (e.normalMap.value = t.normalMap,
  50693. e.normalScale.value.copy(t.normalScale)),
  50694. t.displacementMap && (e.displacementMap.value = t.displacementMap,
  50695. e.displacementScale.value = t.displacementScale,
  50696. e.displacementBias.value = t.displacementBias),
  50697. t.envMap && (e.envMapIntensity.value = t.envMapIntensity)
  50698. }
  50699. function D(e, t) {
  50700. e.ambientLightColor.needsUpdate = t,
  50701. e.directionalLights.needsUpdate = t,
  50702. e.pointLights.needsUpdate = t,
  50703. e.spotLights.needsUpdate = t,
  50704. e.hemisphereLights.needsUpdate = t
  50705. }
  50706. function N(e, t) {
  50707. Ge.uniformMatrix4fv(e.modelViewMatrix, !1, t.modelViewMatrix.elements),
  50708. e.normalMatrix && Ge.uniformMatrix3fv(e.normalMatrix, !1, t.normalMatrix.elements)
  50709. }
  50710. function B() {
  50711. var e = xe;
  50712. return e >= je.maxTextures && console.warn("WebGLRenderer: trying to use " + e + " texture units while this GPU supports only " + je.maxTextures),
  50713. xe += 1,
  50714. e
  50715. }
  50716. function F(e, t, i, r) {
  50717. var o, a;
  50718. if ("1i" === t)
  50719. Ge.uniform1i(i, r);
  50720. else if ("1f" === t)
  50721. Ge.uniform1f(i, r);
  50722. else if ("2f" === t)
  50723. Ge.uniform2f(i, r[0], r[1]);
  50724. else if ("3f" === t)
  50725. Ge.uniform3f(i, r[0], r[1], r[2]);
  50726. else if ("4f" === t)
  50727. Ge.uniform4f(i, r[0], r[1], r[2], r[3]);
  50728. else if ("1iv" === t)
  50729. Ge.uniform1iv(i, r);
  50730. else if ("3iv" === t)
  50731. Ge.uniform3iv(i, r);
  50732. else if ("1fv" === t)
  50733. Ge.uniform1fv(i, r);
  50734. else if ("2fv" === t)
  50735. Ge.uniform2fv(i, r);
  50736. else if ("3fv" === t)
  50737. Ge.uniform3fv(i, r);
  50738. else if ("4fv" === t)
  50739. Ge.uniform4fv(i, r);
  50740. else if ("Matrix2fv" === t)
  50741. Ge.uniformMatrix2fv(i, !1, r);
  50742. else if ("Matrix3fv" === t)
  50743. Ge.uniformMatrix3fv(i, !1, r);
  50744. else if ("Matrix4fv" === t)
  50745. Ge.uniformMatrix4fv(i, !1, r);
  50746. else if ("i" === t)
  50747. Ge.uniform1i(i, r);
  50748. else if ("f" === t)
  50749. Ge.uniform1f(i, r);
  50750. else if ("v2" === t)
  50751. Ge.uniform2f(i, r.x, r.y);
  50752. else if ("v3" === t)
  50753. Ge.uniform3f(i, r.x, r.y, r.z);
  50754. else if ("v4" === t)
  50755. Ge.uniform4f(i, r.x, r.y, r.z, r.w);
  50756. else if ("c" === t)
  50757. Ge.uniform3f(i, r.r, r.g, r.b);
  50758. else if ("s" === t) {
  50759. var s = e.properties;
  50760. for (var l in s) {
  50761. var c = s[l]
  50762. , h = i[l]
  50763. , u = r[l];
  50764. F(c, c.type, h, u)
  50765. }
  50766. } else if ("sa" === t)
  50767. for (var s = e.properties, d = 0, p = r.length; d < p; d++)
  50768. for (var l in s) {
  50769. var c = s[l]
  50770. , h = i[d][l]
  50771. , u = r[d][l];
  50772. F(c, c.type, h, u)
  50773. }
  50774. else if ("iv1" === t)
  50775. Ge.uniform1iv(i, r);
  50776. else if ("iv" === t)
  50777. Ge.uniform3iv(i, r);
  50778. else if ("fv1" === t)
  50779. Ge.uniform1fv(i, r);
  50780. else if ("fv" === t)
  50781. Ge.uniform3fv(i, r);
  50782. else if ("v2v" === t) {
  50783. void 0 === e._array && (e._array = new Float32Array(2 * r.length));
  50784. for (var d = 0, f = 0, g = r.length; d < g; d++,
  50785. f += 2)
  50786. e._array[f + 0] = r[d].x,
  50787. e._array[f + 1] = r[d].y;
  50788. Ge.uniform2fv(i, e._array)
  50789. } else if ("v3v" === t) {
  50790. void 0 === e._array && (e._array = new Float32Array(3 * r.length));
  50791. for (var d = 0, m = 0, g = r.length; d < g; d++,
  50792. m += 3)
  50793. e._array[m + 0] = r[d].x,
  50794. e._array[m + 1] = r[d].y,
  50795. e._array[m + 2] = r[d].z;
  50796. Ge.uniform3fv(i, e._array)
  50797. } else if ("v4v" === t) {
  50798. void 0 === e._array && (e._array = new Float32Array(4 * r.length));
  50799. for (var d = 0, v = 0, g = r.length; d < g; d++,
  50800. v += 4)
  50801. e._array[v + 0] = r[d].x,
  50802. e._array[v + 1] = r[d].y,
  50803. e._array[v + 2] = r[d].z,
  50804. e._array[v + 3] = r[d].w;
  50805. Ge.uniform4fv(i, e._array)
  50806. } else if ("m2" === t)
  50807. Ge.uniformMatrix2fv(i, !1, r.elements);
  50808. else if ("m3" === t)
  50809. Ge.uniformMatrix3fv(i, !1, r.elements);
  50810. else if ("m3v" === t) {
  50811. void 0 === e._array && (e._array = new Float32Array(9 * r.length));
  50812. for (var d = 0, g = r.length; d < g; d++)
  50813. r[d].flattenToArrayOffset(e._array, 9 * d);
  50814. Ge.uniformMatrix3fv(i, !1, e._array)
  50815. } else if ("m4" === t)
  50816. Ge.uniformMatrix4fv(i, !1, r.elements);
  50817. else if ("m4v" === t) {
  50818. void 0 === e._array && (e._array = new Float32Array(16 * r.length));
  50819. for (var d = 0, g = r.length; d < g; d++)
  50820. r[d].flattenToArrayOffset(e._array, 16 * d);
  50821. Ge.uniformMatrix4fv(i, !1, e._array)
  50822. } else if ("t" === t) {
  50823. if (o = r,
  50824. a = B(),
  50825. Ge.uniform1i(i, a),
  50826. !o)
  50827. return;
  50828. 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)
  50829. } else if ("tv" === t) {
  50830. void 0 === e._array && (e._array = []);
  50831. for (var d = 0, g = e.value.length; d < g; d++)
  50832. e._array[d] = B();
  50833. Ge.uniform1iv(i, e._array);
  50834. for (var d = 0, g = e.value.length; d < g; d++)
  50835. o = e.value[d],
  50836. a = e._array[d],
  50837. 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))
  50838. } else
  50839. console.warn("THREE.WebGLRenderer: Unknown uniform type: " + t)
  50840. }
  50841. function V(e) {
  50842. for (var t = 0, i = e.length; t < i; t++) {
  50843. var n = e[t][0];
  50844. if (n.needsUpdate !== !1) {
  50845. var r = n.type
  50846. , o = e[t][1]
  50847. , a = n.value;
  50848. F(n, r, o, a)
  50849. }
  50850. }
  50851. }
  50852. function U(e, t) {
  50853. 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;
  50854. for (Ue.shadowsPointLight = 0,
  50855. i = 0,
  50856. r = e.length; i < r; i++)
  50857. if (o = e[i],
  50858. a = o.color,
  50859. s = o.intensity,
  50860. l = o.distance,
  50861. o instanceof n.AmbientLight)
  50862. c += a.r * s,
  50863. h += a.g * s,
  50864. u += a.b * s;
  50865. else if (o instanceof n.DirectionalLight) {
  50866. var A = Ke.get(o);
  50867. A.color.copy(o.color).multiplyScalar(o.intensity),
  50868. A.direction.setFromMatrixPosition(o.matrixWorld),
  50869. Ve.setFromMatrixPosition(o.target.matrixWorld),
  50870. A.direction.sub(Ve),
  50871. A.direction.transformDirection(d),
  50872. A.shadow = o.castShadow,
  50873. o.castShadow && (A.shadowBias = o.shadow.bias,
  50874. A.shadowRadius = o.shadow.radius,
  50875. A.shadowMapSize = o.shadow.mapSize,
  50876. Ue.shadows[v++] = o),
  50877. Ue.directionalShadowMap[p] = o.shadow.map,
  50878. Ue.directionalShadowMatrix[p] = o.shadow.matrix,
  50879. Ue.directional[p++] = A
  50880. } else if (o instanceof n.SpotLight) {
  50881. var A = Ke.get(o);
  50882. A.position.setFromMatrixPosition(o.matrixWorld),
  50883. A.position.applyMatrix4(d),
  50884. A.color.copy(a).multiplyScalar(s),
  50885. A.distance = l,
  50886. A.direction.setFromMatrixPosition(o.matrixWorld),
  50887. Ve.setFromMatrixPosition(o.target.matrixWorld),
  50888. A.direction.sub(Ve),
  50889. A.direction.transformDirection(d),
  50890. A.coneCos = Math.cos(o.angle),
  50891. A.penumbraCos = Math.cos(o.angle * (1 - o.penumbra)),
  50892. A.decay = 0 === o.distance ? 0 : o.decay,
  50893. A.shadow = o.castShadow,
  50894. o.castShadow && (A.shadowBias = o.shadow.bias,
  50895. A.shadowRadius = o.shadow.radius,
  50896. A.shadowMapSize = o.shadow.mapSize,
  50897. Ue.shadows[v++] = o),
  50898. Ue.spotShadowMap[g] = o.shadow.map,
  50899. Ue.spotShadowMatrix[g] = o.shadow.matrix,
  50900. Ue.spot[g++] = A
  50901. } else if (o instanceof n.PointLight) {
  50902. var A = Ke.get(o);
  50903. A.position.setFromMatrixPosition(o.matrixWorld),
  50904. A.position.applyMatrix4(d),
  50905. A.color.copy(o.color).multiplyScalar(o.intensity),
  50906. A.distance = o.distance,
  50907. A.decay = 0 === o.distance ? 0 : o.decay,
  50908. A.shadow = o.castShadow,
  50909. o.castShadow && (A.shadowBias = o.shadow.bias,
  50910. A.shadowRadius = o.shadow.radius,
  50911. A.shadowMapSize = o.shadow.mapSize,
  50912. Ue.shadows[v++] = o),
  50913. Ue.pointShadowMap[f] = o.shadow.map,
  50914. void 0 === Ue.pointShadowMatrix[f] && (Ue.pointShadowMatrix[f] = new n.Matrix4),
  50915. Ve.setFromMatrixPosition(o.matrixWorld).negate(),
  50916. Ue.pointShadowMatrix[f].identity().setPosition(Ve),
  50917. Ue.point[f++] = A
  50918. } else if (o instanceof n.HemisphereLight) {
  50919. var A = Ke.get(o);
  50920. A.direction.setFromMatrixPosition(o.matrixWorld),
  50921. A.direction.transformDirection(d),
  50922. A.direction.normalize(),
  50923. A.skyColor.copy(o.color).multiplyScalar(s),
  50924. A.groundColor.copy(o.groundColor).multiplyScalar(s),
  50925. Ue.hemi[m++] = A
  50926. }
  50927. Ue.ambient[0] = c,
  50928. Ue.ambient[1] = h,
  50929. Ue.ambient[2] = u,
  50930. Ue.directional.length = p,
  50931. Ue.spot.length = g,
  50932. Ue.point.length = f,
  50933. Ue.hemi.length = m,
  50934. Ue.shadows.length = v,
  50935. Ue.hash = p + "," + f + "," + g + "," + m + "," + v
  50936. }
  50937. function k(e, t, i) {
  50938. var r;
  50939. if (i ? (Ge.texParameteri(e, Ge.TEXTURE_WRAP_S, ee(t.wrapS)),
  50940. Ge.texParameteri(e, Ge.TEXTURE_WRAP_T, ee(t.wrapT)),
  50941. Ge.texParameteri(e, Ge.TEXTURE_MAG_FILTER, ee(t.magFilter)),
  50942. Ge.texParameteri(e, Ge.TEXTURE_MIN_FILTER, ee(t.minFilter))) : (Ge.texParameteri(e, Ge.TEXTURE_WRAP_S, Ge.CLAMP_TO_EDGE),
  50943. Ge.texParameteri(e, Ge.TEXTURE_WRAP_T, Ge.CLAMP_TO_EDGE),
  50944. t.wrapS === n.ClampToEdgeWrapping && t.wrapT === n.ClampToEdgeWrapping,
  50945. Ge.texParameteri(e, Ge.TEXTURE_MAG_FILTER, $(t.magFilter)),
  50946. Ge.texParameteri(e, Ge.TEXTURE_MIN_FILTER, $(t.minFilter)),
  50947. t.minFilter !== n.NearestFilter && t.minFilter !== n.LinearFilter),
  50948. r = We.get("EXT_texture_filter_anisotropic")) {
  50949. if (t.type === n.FloatType && null === We.get("OES_texture_float_linear"))
  50950. return;
  50951. if (t.type === n.HalfFloatType && null === We.get("OES_texture_half_float_linear"))
  50952. return;
  50953. (t.anisotropy > 1 || Xe.get(t).__currentAnisotropy) && (Ge.texParameterf(e, r.TEXTURE_MAX_ANISOTROPY_EXT, Math.min(t.anisotropy, ve.getMaxAnisotropy())),
  50954. Xe.get(t).__currentAnisotropy = t.anisotropy)
  50955. }
  50956. }
  50957. function H(e, t, i) {
  50958. void 0 === e.__webglInit && (e.__webglInit = !0,
  50959. t.addEventListener("dispose", s),
  50960. e.__webglTexture = Ge.createTexture(),
  50961. ke.textures++),
  50962. Ye.activeTexture(Ge.TEXTURE0 + i),
  50963. Ye.bindTexture(Ge.TEXTURE_2D, e.__webglTexture),
  50964. Ge.pixelStorei(Ge.UNPACK_FLIP_Y_WEBGL, t.flipY),
  50965. Ge.pixelStorei(Ge.UNPACK_PREMULTIPLY_ALPHA_WEBGL, t.premultiplyAlpha),
  50966. Ge.pixelStorei(Ge.UNPACK_ALIGNMENT, t.unpackAlignment);
  50967. var r = G(t.image, je.maxTextureSize);
  50968. W(t) && z(r) === !1 && (r = j(r));
  50969. var o = z(r)
  50970. , a = ee(t.format)
  50971. , l = ee(t.type);
  50972. k(Ge.TEXTURE_2D, t, o);
  50973. var c, h = t.mipmaps;
  50974. if (t instanceof n.DataTexture)
  50975. if (h.length > 0 && o) {
  50976. for (var u = 0, d = h.length; u < d; u++)
  50977. c = h[u],
  50978. Ye.texImage2D(Ge.TEXTURE_2D, u, a, c.width, c.height, 0, a, l, c.data);
  50979. t.generateMipmaps = !1
  50980. } else
  50981. Ye.texImage2D(Ge.TEXTURE_2D, 0, a, r.width, r.height, 0, a, l, r.data);
  50982. else if (t instanceof n.CompressedTexture)
  50983. for (var u = 0, d = h.length; u < d; u++)
  50984. c = h[u],
  50985. 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);
  50986. else if (h.length > 0 && o) {
  50987. for (var u = 0, d = h.length; u < d; u++)
  50988. c = h[u],
  50989. Ye.texImage2D(Ge.TEXTURE_2D, u, a, a, l, c);
  50990. t.generateMipmaps = !1
  50991. } else
  50992. Ye.texImage2D(Ge.TEXTURE_2D, 0, a, a, l, r);
  50993. t.generateMipmaps && o && Ge.generateMipmap(Ge.TEXTURE_2D),
  50994. e.__version = t.version,
  50995. t.onUpdate && t.onUpdate(t)
  50996. }
  50997. function G(e, t) {
  50998. if (e.width > t || e.height > t) {
  50999. var i = t / Math.max(e.width, e.height)
  51000. , n = document.createElement("canvas");
  51001. n.width = Math.floor(e.width * i),
  51002. n.height = Math.floor(e.height * i);
  51003. var r = n.getContext("2d");
  51004. return r.drawImage(e, 0, 0, e.width, e.height, 0, 0, n.width, n.height),
  51005. console.warn("THREE.WebGLRenderer: image is too big (" + e.width + "x" + e.height + "). Resized to " + n.width + "x" + n.height, e),
  51006. n
  51007. }
  51008. return e
  51009. }
  51010. function z(e) {
  51011. return n.Math.isPowerOfTwo(e.width) && n.Math.isPowerOfTwo(e.height)
  51012. }
  51013. function W(e) {
  51014. return e.wrapS !== n.ClampToEdgeWrapping || e.wrapT !== n.ClampToEdgeWrapping || e.minFilter !== n.NearestFilter && e.minFilter !== n.LinearFilter
  51015. }
  51016. function j(e) {
  51017. if (e instanceof HTMLImageElement || e instanceof HTMLCanvasElement) {
  51018. var t = document.createElement("canvas");
  51019. t.width = n.Math.nearestPowerOfTwo(e.width),
  51020. t.height = n.Math.nearestPowerOfTwo(e.height);
  51021. var i = t.getContext("2d");
  51022. return i.drawImage(e, 0, 0, t.width, t.height),
  51023. console.warn("THREE.WebGLRenderer: image is not power of two (" + e.width + "x" + e.height + "). Resized to " + t.width + "x" + t.height, e),
  51024. t
  51025. }
  51026. return e
  51027. }
  51028. function Y(e, t) {
  51029. var i = Xe.get(e);
  51030. if (6 === e.image.length)
  51031. if (e.version > 0 && i.__version !== e.version) {
  51032. i.__image__webglTextureCube || (e.addEventListener("dispose", s),
  51033. i.__image__webglTextureCube = Ge.createTexture(),
  51034. ke.textures++),
  51035. Ye.activeTexture(Ge.TEXTURE0 + t),
  51036. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, i.__image__webglTextureCube),
  51037. Ge.pixelStorei(Ge.UNPACK_FLIP_Y_WEBGL, e.flipY);
  51038. for (var r = e instanceof n.CompressedTexture, o = e.image[0]instanceof n.DataTexture, a = [], l = 0; l < 6; l++)
  51039. !ve.autoScaleCubemaps || r || o ? a[l] = o ? e.image[l].image : e.image[l] : a[l] = G(e.image[l], je.maxCubemapSize);
  51040. var c = a[0]
  51041. , h = z(c)
  51042. , u = ee(e.format)
  51043. , d = ee(e.type);
  51044. k(Ge.TEXTURE_CUBE_MAP, e, h);
  51045. for (var l = 0; l < 6; l++)
  51046. if (r)
  51047. for (var p, f = a[l].mipmaps, g = 0, m = f.length; g < m; g++)
  51048. p = f[g],
  51049. 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);
  51050. else
  51051. 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]);
  51052. e.generateMipmaps && h && Ge.generateMipmap(Ge.TEXTURE_CUBE_MAP),
  51053. i.__version = e.version,
  51054. e.onUpdate && e.onUpdate(e)
  51055. } else
  51056. Ye.activeTexture(Ge.TEXTURE0 + t),
  51057. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, i.__image__webglTextureCube)
  51058. }
  51059. function X(e, t) {
  51060. Ye.activeTexture(Ge.TEXTURE0 + t),
  51061. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, Xe.get(e).__webglTexture)
  51062. }
  51063. function Z(e, t, i, n) {
  51064. var r = ee(t.texture.format)
  51065. , o = ee(t.texture.type);
  51066. Ye.texImage2D(n, 0, r, t.width, t.height, 0, r, o, null),
  51067. Ge.bindFramebuffer(Ge.FRAMEBUFFER, e),
  51068. Ge.framebufferTexture2D(Ge.FRAMEBUFFER, i, n, Xe.get(t.texture).__webglTexture, 0),
  51069. Ge.bindFramebuffer(Ge.FRAMEBUFFER, null)
  51070. }
  51071. function q(e, t) {
  51072. Ge.bindRenderbuffer(Ge.RENDERBUFFER, e),
  51073. t.depthBuffer && !t.stencilBuffer ? (Ge.renderbufferStorage(Ge.RENDERBUFFER, Ge.DEPTH_COMPONENT16, t.width, t.height),
  51074. 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),
  51075. Ge.framebufferRenderbuffer(Ge.FRAMEBUFFER, Ge.DEPTH_STENCIL_ATTACHMENT, Ge.RENDERBUFFER, e)) : Ge.renderbufferStorage(Ge.RENDERBUFFER, Ge.RGBA4, t.width, t.height),
  51076. Ge.bindRenderbuffer(Ge.RENDERBUFFER, null)
  51077. }
  51078. function K(e) {
  51079. var t = Xe.get(e)
  51080. , i = e instanceof n.WebGLRenderTargetCube;
  51081. if (i) {
  51082. t.__webglDepthbuffer = [];
  51083. for (var r = 0; r < 6; r++)
  51084. Ge.bindFramebuffer(Ge.FRAMEBUFFER, t.__webglFramebuffer[r]),
  51085. t.__webglDepthbuffer[r] = Ge.createRenderbuffer(),
  51086. q(t.__webglDepthbuffer[r], e)
  51087. } else
  51088. Ge.bindFramebuffer(Ge.FRAMEBUFFER, t.__webglFramebuffer),
  51089. t.__webglDepthbuffer = Ge.createRenderbuffer(),
  51090. q(t.__webglDepthbuffer, e);
  51091. Ge.bindFramebuffer(Ge.FRAMEBUFFER, null)
  51092. }
  51093. function Q(e) {
  51094. var t = Xe.get(e)
  51095. , i = Xe.get(e.texture);
  51096. e.addEventListener("dispose", l),
  51097. i.__webglTexture = Ge.createTexture(),
  51098. ke.textures++;
  51099. var r = e instanceof n.WebGLRenderTargetCube
  51100. , o = n.Math.isPowerOfTwo(e.width) && n.Math.isPowerOfTwo(e.height);
  51101. if (r) {
  51102. t.__webglFramebuffer = [];
  51103. for (var a = 0; a < 6; a++)
  51104. t.__webglFramebuffer[a] = Ge.createFramebuffer()
  51105. } else
  51106. t.__webglFramebuffer = Ge.createFramebuffer();
  51107. if (r) {
  51108. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, i.__webglTexture),
  51109. k(Ge.TEXTURE_CUBE_MAP, e.texture, o);
  51110. for (var a = 0; a < 6; a++)
  51111. Z(t.__webglFramebuffer[a], e, Ge.COLOR_ATTACHMENT0, Ge.TEXTURE_CUBE_MAP_POSITIVE_X + a);
  51112. e.texture.generateMipmaps && o && Ge.generateMipmap(Ge.TEXTURE_CUBE_MAP),
  51113. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, null)
  51114. } else
  51115. Ye.bindTexture(Ge.TEXTURE_2D, i.__webglTexture),
  51116. k(Ge.TEXTURE_2D, e.texture, o),
  51117. Z(t.__webglFramebuffer, e, Ge.COLOR_ATTACHMENT0, Ge.TEXTURE_2D),
  51118. e.texture.generateMipmaps && o && Ge.generateMipmap(Ge.TEXTURE_2D),
  51119. Ye.bindTexture(Ge.TEXTURE_2D, null);
  51120. e.depthBuffer && K(e)
  51121. }
  51122. function J(e) {
  51123. var t = e instanceof n.WebGLRenderTargetCube ? Ge.TEXTURE_CUBE_MAP : Ge.TEXTURE_2D
  51124. , i = Xe.get(e.texture).__webglTexture;
  51125. Ye.bindTexture(t, i),
  51126. Ge.generateMipmap(t),
  51127. Ye.bindTexture(t, null)
  51128. }
  51129. function $(e) {
  51130. return e === n.NearestFilter || e === n.NearestMipMapNearestFilter || e === n.NearestMipMapLinearFilter ? Ge.NEAREST : Ge.LINEAR
  51131. }
  51132. function ee(e) {
  51133. var t;
  51134. if (e === n.RepeatWrapping)
  51135. return Ge.REPEAT;
  51136. if (e === n.ClampToEdgeWrapping)
  51137. return Ge.CLAMP_TO_EDGE;
  51138. if (e === n.MirroredRepeatWrapping)
  51139. return Ge.MIRRORED_REPEAT;
  51140. if (e === n.NearestFilter)
  51141. return Ge.NEAREST;
  51142. if (e === n.NearestMipMapNearestFilter)
  51143. return Ge.NEAREST_MIPMAP_NEAREST;
  51144. if (e === n.NearestMipMapLinearFilter)
  51145. return Ge.NEAREST_MIPMAP_LINEAR;
  51146. if (e === n.LinearFilter)
  51147. return Ge.LINEAR;
  51148. if (e === n.LinearMipMapNearestFilter)
  51149. return Ge.LINEAR_MIPMAP_NEAREST;
  51150. if (e === n.LinearMipMapLinearFilter)
  51151. return Ge.LINEAR_MIPMAP_LINEAR;
  51152. if (e === n.UnsignedByteType)
  51153. return Ge.UNSIGNED_BYTE;
  51154. if (e === n.UnsignedShort4444Type)
  51155. return Ge.UNSIGNED_SHORT_4_4_4_4;
  51156. if (e === n.UnsignedShort5551Type)
  51157. return Ge.UNSIGNED_SHORT_5_5_5_1;
  51158. if (e === n.UnsignedShort565Type)
  51159. return Ge.UNSIGNED_SHORT_5_6_5;
  51160. if (e === n.ByteType)
  51161. return Ge.BYTE;
  51162. if (e === n.ShortType)
  51163. return Ge.SHORT;
  51164. if (e === n.UnsignedShortType)
  51165. return Ge.UNSIGNED_SHORT;
  51166. if (e === n.IntType)
  51167. return Ge.INT;
  51168. if (e === n.UnsignedIntType)
  51169. return Ge.UNSIGNED_INT;
  51170. if (e === n.FloatType)
  51171. return Ge.FLOAT;
  51172. if (t = We.get("OES_texture_half_float"),
  51173. null !== t && e === n.HalfFloatType)
  51174. return t.HALF_FLOAT_OES;
  51175. if (e === n.AlphaFormat)
  51176. return Ge.ALPHA;
  51177. if (e === n.RGBFormat)
  51178. return Ge.RGB;
  51179. if (e === n.RGBAFormat)
  51180. return Ge.RGBA;
  51181. if (e === n.LuminanceFormat)
  51182. return Ge.LUMINANCE;
  51183. if (e === n.LuminanceAlphaFormat)
  51184. return Ge.LUMINANCE_ALPHA;
  51185. if (e === n.AddEquation)
  51186. return Ge.FUNC_ADD;
  51187. if (e === n.SubtractEquation)
  51188. return Ge.FUNC_SUBTRACT;
  51189. if (e === n.ReverseSubtractEquation)
  51190. return Ge.FUNC_REVERSE_SUBTRACT;
  51191. if (e === n.ZeroFactor)
  51192. return Ge.ZERO;
  51193. if (e === n.OneFactor)
  51194. return Ge.ONE;
  51195. if (e === n.SrcColorFactor)
  51196. return Ge.SRC_COLOR;
  51197. if (e === n.OneMinusSrcColorFactor)
  51198. return Ge.ONE_MINUS_SRC_COLOR;
  51199. if (e === n.SrcAlphaFactor)
  51200. return Ge.SRC_ALPHA;
  51201. if (e === n.OneMinusSrcAlphaFactor)
  51202. return Ge.ONE_MINUS_SRC_ALPHA;
  51203. if (e === n.DstAlphaFactor)
  51204. return Ge.DST_ALPHA;
  51205. if (e === n.OneMinusDstAlphaFactor)
  51206. return Ge.ONE_MINUS_DST_ALPHA;
  51207. if (e === n.DstColorFactor)
  51208. return Ge.DST_COLOR;
  51209. if (e === n.OneMinusDstColorFactor)
  51210. return Ge.ONE_MINUS_DST_COLOR;
  51211. if (e === n.SrcAlphaSaturateFactor)
  51212. return Ge.SRC_ALPHA_SATURATE;
  51213. if (t = We.get("WEBGL_compressed_texture_s3tc"),
  51214. null !== t) {
  51215. if (e === n.RGB_S3TC_DXT1_Format)
  51216. return t.COMPRESSED_RGB_S3TC_DXT1_EXT;
  51217. if (e === n.RGBA_S3TC_DXT1_Format)
  51218. return t.COMPRESSED_RGBA_S3TC_DXT1_EXT;
  51219. if (e === n.RGBA_S3TC_DXT3_Format)
  51220. return t.COMPRESSED_RGBA_S3TC_DXT3_EXT;
  51221. if (e === n.RGBA_S3TC_DXT5_Format)
  51222. return t.COMPRESSED_RGBA_S3TC_DXT5_EXT
  51223. }
  51224. if (t = We.get("WEBGL_compressed_texture_pvrtc"),
  51225. null !== t) {
  51226. if (e === n.RGB_PVRTC_4BPPV1_Format)
  51227. return t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;
  51228. if (e === n.RGB_PVRTC_2BPPV1_Format)
  51229. return t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;
  51230. if (e === n.RGBA_PVRTC_4BPPV1_Format)
  51231. return t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;
  51232. if (e === n.RGBA_PVRTC_2BPPV1_Format)
  51233. return t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG
  51234. }
  51235. if (t = We.get("WEBGL_compressed_texture_etc1"),
  51236. null !== t && e === n.RGB_ETC1_Format)
  51237. return t.COMPRESSED_RGB_ETC1_WEBGL;
  51238. if (t = We.get("EXT_blend_minmax"),
  51239. null !== t) {
  51240. if (e === n.MinEquation)
  51241. return t.MIN_EXT;
  51242. if (e === n.MaxEquation)
  51243. return t.MAX_EXT
  51244. }
  51245. return 0
  51246. }
  51247. console.log("THREE.WebGLRenderer", n.REVISION),
  51248. e = e || {};
  51249. var te = void 0 !== e.canvas ? e.canvas : document.createElement("canvas")
  51250. , ie = void 0 !== e.context ? e.context : null
  51251. , ne = void 0 !== e.alpha && e.alpha
  51252. , re = void 0 === e.depth || e.depth
  51253. , oe = void 0 === e.stencil || e.stencil
  51254. , ae = void 0 !== e.antialias && e.antialias
  51255. , se = void 0 === e.premultipliedAlpha || e.premultipliedAlpha
  51256. , le = void 0 !== e.preserveDrawingBuffer && e.preserveDrawingBuffer
  51257. , ce = []
  51258. , he = []
  51259. , ue = -1
  51260. , de = []
  51261. , pe = -1
  51262. , fe = new Float32Array(8)
  51263. , ge = []
  51264. , me = [];
  51265. this.domElement = te,
  51266. this.context = null,
  51267. this.autoClear = !0,
  51268. this.autoClearColor = !0,
  51269. this.autoClearDepth = !0,
  51270. this.autoClearStencil = !0,
  51271. this.sortObjects = !0,
  51272. this.gammaFactor = 2,
  51273. this.gammaInput = !1,
  51274. this.gammaOutput = !1,
  51275. this.physicallyCorrectLights = !1,
  51276. this.toneMapping = n.LinearToneMapping,
  51277. this.toneMappingExposure = 1,
  51278. this.toneMappingWhitePoint = 1,
  51279. this.maxMorphTargets = 8,
  51280. this.maxMorphNormals = 4,
  51281. this.autoScaleCubemaps = !0;
  51282. var ve = this
  51283. , Ae = null
  51284. , ye = null
  51285. , Ce = null
  51286. , Ie = -1
  51287. , Ee = ""
  51288. , be = null
  51289. , we = new n.Vector4
  51290. , _e = null
  51291. , Te = new n.Vector4
  51292. , xe = 0
  51293. , Se = new n.Color(0)
  51294. , Me = 0
  51295. , Re = te.width
  51296. , Pe = te.height
  51297. , Oe = 1
  51298. , Le = new n.Vector4(0,0,Re,Pe)
  51299. , De = !1
  51300. , Ne = new n.Vector4(0,0,Re,Pe)
  51301. , Be = new n.Frustum
  51302. , Fe = new n.Matrix4
  51303. , Ve = new n.Vector3
  51304. , Ue = {
  51305. hash: "",
  51306. ambient: [0, 0, 0],
  51307. directional: [],
  51308. directionalShadowMap: [],
  51309. directionalShadowMatrix: [],
  51310. spot: [],
  51311. spotShadowMap: [],
  51312. spotShadowMatrix: [],
  51313. point: [],
  51314. pointShadowMap: [],
  51315. pointShadowMatrix: [],
  51316. hemi: [],
  51317. shadows: [],
  51318. shadowsPointLight: 0
  51319. }
  51320. , ke = {
  51321. geometries: 0,
  51322. textures: 0
  51323. }
  51324. , He = {
  51325. calls: 0,
  51326. vertices: 0,
  51327. faces: 0,
  51328. points: 0
  51329. };
  51330. this.info = {
  51331. render: He,
  51332. memory: ke,
  51333. programs: null
  51334. };
  51335. var Ge;
  51336. try {
  51337. var ze = {
  51338. alpha: ne,
  51339. depth: re,
  51340. stencil: oe,
  51341. antialias: ae,
  51342. premultipliedAlpha: se,
  51343. preserveDrawingBuffer: le
  51344. };
  51345. if (Ge = ie || te.getContext("webgl", ze) || te.getContext("experimental-webgl", ze),
  51346. null === Ge)
  51347. throw null !== te.getContext("webgl") ? "Error creating WebGL context with your selected attributes." : "Error creating WebGL context.";
  51348. void 0 === Ge.getShaderPrecisionFormat && (Ge.getShaderPrecisionFormat = function() {
  51349. return {
  51350. rangeMin: 1,
  51351. rangeMax: 1,
  51352. precision: 1
  51353. }
  51354. }
  51355. ),
  51356. te.addEventListener("webglcontextlost", a, !1)
  51357. } catch (e) {
  51358. console.error("THREE.WebGLRenderer: " + e)
  51359. }
  51360. var We = new n.WebGLExtensions(Ge);
  51361. We.get("OES_texture_float"),
  51362. We.get("OES_texture_float_linear"),
  51363. We.get("OES_texture_half_float"),
  51364. We.get("OES_texture_half_float_linear"),
  51365. We.get("OES_standard_derivatives"),
  51366. We.get("ANGLE_instanced_arrays"),
  51367. We.get("OES_element_index_uint") && (n.BufferGeometry.MaxIndex = 4294967296);
  51368. var je = new n.WebGLCapabilities(Ge,We,e)
  51369. , Ye = new n.WebGLState(Ge,We,ee)
  51370. , Xe = new n.WebGLProperties
  51371. , Ze = new n.WebGLObjects(Ge,Xe,this.info)
  51372. , qe = new n.WebGLPrograms(this,je)
  51373. , Ke = new n.WebGLLights;
  51374. this.info.programs = qe.programs;
  51375. var Qe = new n.WebGLBufferRenderer(Ge,We,He)
  51376. , Je = new n.WebGLIndexedBufferRenderer(Ge,We,He);
  51377. r(),
  51378. this.context = Ge,
  51379. this.capabilities = je,
  51380. this.extensions = We,
  51381. this.properties = Xe,
  51382. this.state = Ye;
  51383. var $e = new n.WebGLShadowMap(this,Ue,Ze);
  51384. this.shadowMap = $e;
  51385. var et = new n.SpritePlugin(this,ge)
  51386. , tt = new n.LensFlarePlugin(this,me);
  51387. this.getContext = function() {
  51388. return Ge
  51389. }
  51390. ,
  51391. this.getContextAttributes = function() {
  51392. return Ge.getContextAttributes()
  51393. }
  51394. ,
  51395. this.forceContextLoss = function() {
  51396. We.get("WEBGL_lose_context").loseContext()
  51397. }
  51398. ,
  51399. this.getMaxAnisotropy = function() {
  51400. var e;
  51401. return function() {
  51402. if (void 0 !== e)
  51403. return e;
  51404. var t = We.get("EXT_texture_filter_anisotropic");
  51405. return e = null !== t ? Ge.getParameter(t.MAX_TEXTURE_MAX_ANISOTROPY_EXT) : 0
  51406. }
  51407. }(),
  51408. this.getPrecision = function() {
  51409. return je.precision
  51410. }
  51411. ,
  51412. this.getPixelRatio = function() {
  51413. return Oe
  51414. }
  51415. ,
  51416. this.setPixelRatio = function(e) {
  51417. void 0 !== e && (Oe = e,
  51418. this.setSize(Ne.z, Ne.w, !1))
  51419. }
  51420. ,
  51421. this.getSize = function() {
  51422. return {
  51423. width: Re,
  51424. height: Pe
  51425. }
  51426. }
  51427. ,
  51428. this.setSize = function(e, t, i, devicePixelRatio) {
  51429. if(devicePixelRatio != void 0) Oe = devicePixelRatio; //xzw add 改分辨率 始终保持清晰
  51430. Re = e,
  51431. Pe = t,
  51432. te.width = e * Oe,
  51433. te.height = t * Oe,
  51434. i !== !1 && (te.style.width = e + "px",
  51435. te.style.height = t + "px"),
  51436. this.setViewport(0, 0, e, t)
  51437. }
  51438. ,
  51439. this.setViewport = function(e, t, i, n) {
  51440. Ye.viewport(Ne.set(e, t, i, n))
  51441. }
  51442. ,
  51443. this.setScissor = function(e, t, i, n) {
  51444. Ye.scissor(Le.set(e, t, i, n))
  51445. }
  51446. ,
  51447. this.setScissorTest = function(e) {
  51448. Ye.setScissorTest(De = e)
  51449. }
  51450. ,
  51451. this.getClearColor = function() {
  51452. return Se
  51453. }
  51454. ,
  51455. this.setClearColor = function(e, t) {
  51456. Se.set(e),
  51457. Me = void 0 !== t ? t : 1,
  51458. i(Se.r, Se.g, Se.b, Me)
  51459. }
  51460. ,
  51461. this.getClearAlpha = function() {
  51462. return Me
  51463. }
  51464. ,
  51465. this.setClearAlpha = function(e) {
  51466. Me = e,
  51467. i(Se.r, Se.g, Se.b, Me)
  51468. }
  51469. ,
  51470. this.clear = function(e, t, i) {
  51471. var n = 0;
  51472. (void 0 === e || e) && (n |= Ge.COLOR_BUFFER_BIT),
  51473. (void 0 === t || t) && (n |= Ge.DEPTH_BUFFER_BIT),
  51474. (void 0 === i || i) && (n |= Ge.STENCIL_BUFFER_BIT),
  51475. Ge.clear(n)
  51476. }
  51477. ,
  51478. this.clearColor = function() {
  51479. this.clear(!0, !1, !1)
  51480. }
  51481. ,
  51482. this.clearDepth = function() {
  51483. this.clear(!1, !0, !1)
  51484. }
  51485. ,
  51486. this.clearStencil = function() {
  51487. this.clear(!1, !1, !0)
  51488. }
  51489. ,
  51490. this.clearTarget = function(e, t, i, n) {
  51491. this.setRenderTarget(e),
  51492. this.clear(t, i, n)
  51493. }
  51494. ,
  51495. this.resetGLState = o,
  51496. this.dispose = function() {
  51497. te.removeEventListener("webglcontextlost", a, !1)
  51498. }
  51499. ,
  51500. this.renderBufferImmediate = function(e, t, i) {
  51501. Ye.initAttributes();
  51502. var r = Xe.get(e);
  51503. e.hasPositions && !r.position && (r.position = Ge.createBuffer()),
  51504. e.hasNormals && !r.normal && (r.normal = Ge.createBuffer()),
  51505. e.hasUvs && !r.uv && (r.uv = Ge.createBuffer()),
  51506. e.hasColors && !r.color && (r.color = Ge.createBuffer());
  51507. var o = t.getAttributes();
  51508. if (e.hasPositions && (Ge.bindBuffer(Ge.ARRAY_BUFFER, r.position),
  51509. Ge.bufferData(Ge.ARRAY_BUFFER, e.positionArray, Ge.DYNAMIC_DRAW),
  51510. Ye.enableAttribute(o.position),
  51511. Ge.vertexAttribPointer(o.position, 3, Ge.FLOAT, !1, 0, 0)),
  51512. e.hasNormals) {
  51513. if (Ge.bindBuffer(Ge.ARRAY_BUFFER, r.normal),
  51514. "MeshPhongMaterial" !== i.type && "MeshStandardMaterial" !== i.type && i.shading === n.FlatShading)
  51515. for (var a = 0, s = 3 * e.count; a < s; a += 9) {
  51516. var l = e.normalArray
  51517. , c = (l[a + 0] + l[a + 3] + l[a + 6]) / 3
  51518. , h = (l[a + 1] + l[a + 4] + l[a + 7]) / 3
  51519. , u = (l[a + 2] + l[a + 5] + l[a + 8]) / 3;
  51520. l[a + 0] = c,
  51521. l[a + 1] = h,
  51522. l[a + 2] = u,
  51523. l[a + 3] = c,
  51524. l[a + 4] = h,
  51525. l[a + 5] = u,
  51526. l[a + 6] = c,
  51527. l[a + 7] = h,
  51528. l[a + 8] = u
  51529. }
  51530. Ge.bufferData(Ge.ARRAY_BUFFER, e.normalArray, Ge.DYNAMIC_DRAW),
  51531. Ye.enableAttribute(o.normal),
  51532. Ge.vertexAttribPointer(o.normal, 3, Ge.FLOAT, !1, 0, 0)
  51533. }
  51534. e.hasUvs && i.map && (Ge.bindBuffer(Ge.ARRAY_BUFFER, r.uv),
  51535. Ge.bufferData(Ge.ARRAY_BUFFER, e.uvArray, Ge.DYNAMIC_DRAW),
  51536. Ye.enableAttribute(o.uv),
  51537. Ge.vertexAttribPointer(o.uv, 2, Ge.FLOAT, !1, 0, 0)),
  51538. e.hasColors && i.vertexColors !== n.NoColors && (Ge.bindBuffer(Ge.ARRAY_BUFFER, r.color),
  51539. Ge.bufferData(Ge.ARRAY_BUFFER, e.colorArray, Ge.DYNAMIC_DRAW),
  51540. Ye.enableAttribute(o.color),
  51541. Ge.vertexAttribPointer(o.color, 3, Ge.FLOAT, !1, 0, 0)),
  51542. Ye.disableUnusedAttributes(),
  51543. Ge.drawArrays(Ge.TRIANGLES, 0, e.count),
  51544. e.count = 0
  51545. }
  51546. ,
  51547. this.renderBufferDirect = function(e, i, r, o, a, s) {
  51548. E(o);
  51549. var l = w(e, i, o, a)
  51550. , c = !1
  51551. , h = r.id + "_" + l.id + "_" + o.wireframe;
  51552. h !== Ee && (Ee = h,
  51553. c = !0);
  51554. var u = a.morphTargetInfluences;
  51555. if (void 0 !== u) {
  51556. for (var d = [], p = 0, m = u.length; p < m; p++) {
  51557. var v = u[p];
  51558. d.push([v, p])
  51559. }
  51560. d.sort(g),
  51561. d.length > 8 && (d.length = 8);
  51562. for (var A = r.morphAttributes, p = 0, m = d.length; p < m; p++) {
  51563. var v = d[p];
  51564. if (fe[p] = v[0],
  51565. 0 !== v[0]) {
  51566. var y = v[1];
  51567. o.morphTargets === !0 && A.position && r.addAttribute("morphTarget" + p, A.position[y]),
  51568. o.morphNormals === !0 && A.normal && r.addAttribute("morphNormal" + p, A.normal[y])
  51569. } else
  51570. o.morphTargets === !0 && r.removeAttribute("morphTarget" + p),
  51571. o.morphNormals === !0 && r.removeAttribute("morphNormal" + p)
  51572. }
  51573. var C = l.getUniforms();
  51574. null !== C.morphTargetInfluences && Ge.uniform1fv(C.morphTargetInfluences, fe),
  51575. c = !0
  51576. }
  51577. var y = r.index
  51578. , I = r.attributes.position;
  51579. o.wireframe === !0 && (y = Ze.getWireframeAttribute(r));
  51580. var b;
  51581. null !== y ? (b = Je,
  51582. b.setIndex(y)) : b = Qe,
  51583. c && (f(o, l, r),
  51584. null !== y && Ge.bindBuffer(Ge.ELEMENT_ARRAY_BUFFER, Ze.getAttributeBuffer(y)));
  51585. var _ = 0
  51586. , T = 1 / 0;
  51587. null !== y ? T = y.count : void 0 !== I && (T = I.count);
  51588. var x = r.drawRange.start
  51589. , S = r.drawRange.count
  51590. , M = null !== s ? s.start : 0
  51591. , R = null !== s ? s.count : 1 / 0
  51592. , P = Math.max(_, x, M)
  51593. , O = Math.min(_ + T, x + S, M + R) - 1
  51594. , L = Math.max(0, O - P + 1);
  51595. if (a instanceof n.Mesh)
  51596. if (o.wireframe === !0)
  51597. Ye.setLineWidth(o.wireframeLinewidth * t()),
  51598. b.setMode(Ge.LINES);
  51599. else
  51600. switch (a.drawMode) {
  51601. case n.TrianglesDrawMode:
  51602. b.setMode(Ge.TRIANGLES);
  51603. break;
  51604. case n.TriangleStripDrawMode:
  51605. b.setMode(Ge.TRIANGLE_STRIP);
  51606. break;
  51607. case n.TriangleFanDrawMode:
  51608. b.setMode(Ge.TRIANGLE_FAN)
  51609. }
  51610. else if (a instanceof n.Line) {
  51611. var D = o.linewidth;
  51612. void 0 === D && (D = 1),
  51613. Ye.setLineWidth(D * t()),
  51614. a instanceof n.LineSegments ? b.setMode(Ge.LINES) : b.setMode(Ge.LINE_STRIP)
  51615. } else
  51616. a instanceof n.Points && b.setMode(Ge.POINTS);
  51617. r instanceof n.InstancedBufferGeometry ? r.maxInstancedCount > 0 && b.renderInstances(r, P, L) : b.render(P, L)
  51618. }
  51619. ,
  51620. this.render = function(e, t, i, r) {
  51621. if (t instanceof n.Camera == !1)
  51622. return void console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");
  51623. var o = e.fog;
  51624. if (Ee = "",
  51625. Ie = -1,
  51626. be = null,
  51627. e.autoUpdate === !0 && e.updateMatrixWorld(),
  51628. null === t.parent && t.updateMatrixWorld(),
  51629. t.matrixWorldInverse.getInverse(t.matrixWorld),
  51630. Fe.multiplyMatrices(t.projectionMatrix, t.matrixWorldInverse),
  51631. Be.setFromMatrix(Fe),
  51632. ce.length = 0,
  51633. ue = -1,
  51634. pe = -1,
  51635. ge.length = 0,
  51636. me.length = 0,
  51637. y(e, t),
  51638. he.length = ue + 1,
  51639. de.length = pe + 1,
  51640. ve.sortObjects === !0 && (he.sort(m),
  51641. de.sort(v)),
  51642. U(ce, t),
  51643. $e.render(e, t),
  51644. He.calls = 0,
  51645. He.vertices = 0,
  51646. He.faces = 0,
  51647. He.points = 0,
  51648. void 0 === i && (i = null),
  51649. this.setRenderTarget(i),
  51650. (this.autoClear || r) && this.clear(this.autoClearColor, this.autoClearDepth, this.autoClearStencil),
  51651. e.overrideMaterial) {
  51652. var a = e.overrideMaterial;
  51653. C(he, t, o, a),
  51654. C(de, t, o, a)
  51655. } else
  51656. Ye.setBlending(n.NoBlending),
  51657. C(he, t, o),
  51658. C(de, t, o);
  51659. if (et.render(e, t),
  51660. tt.render(e, t, Te),
  51661. i) {
  51662. var s = i.texture;
  51663. s.generateMipmaps && z(i) && s.minFilter !== n.NearestFilter && s.minFilter !== n.LinearFilter && J(i)
  51664. }
  51665. Ye.setDepthTest(!0),
  51666. Ye.setDepthWrite(!0),
  51667. Ye.setColorWrite(!0)
  51668. }
  51669. ,
  51670. this.setFaceCulling = function(e, t) {
  51671. e === n.CullFaceNone ? Ye.disable(Ge.CULL_FACE) : (t === n.FrontFaceDirectionCW ? Ge.frontFace(Ge.CW) : Ge.frontFace(Ge.CCW),
  51672. e === n.CullFaceBack ? Ge.cullFace(Ge.BACK) : e === n.CullFaceFront ? Ge.cullFace(Ge.FRONT) : Ge.cullFace(Ge.FRONT_AND_BACK),
  51673. Ye.enable(Ge.CULL_FACE))
  51674. }
  51675. ,
  51676. this.setTexture = function(e, t) {
  51677. var i = Xe.get(e);
  51678. if (e.version > 0 && i.__version !== e.version) {
  51679. var n = e.image;
  51680. 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)
  51681. }
  51682. Ye.activeTexture(Ge.TEXTURE0 + t),
  51683. Ye.bindTexture(Ge.TEXTURE_2D, i.__webglTexture)
  51684. }
  51685. ,
  51686. this.getCurrentRenderTarget = function() {
  51687. return ye
  51688. }
  51689. ,
  51690. this.setRenderTarget = function(e) {
  51691. ye = e,
  51692. e && void 0 === Xe.get(e).__webglFramebuffer && Q(e);
  51693. var t, i = e instanceof n.WebGLRenderTargetCube;
  51694. if (e) {
  51695. var r = Xe.get(e);
  51696. t = i ? r.__webglFramebuffer[e.activeCubeFace] : r.__webglFramebuffer,
  51697. we.copy(e.scissor),
  51698. _e = e.scissorTest,
  51699. Te.copy(e.viewport)
  51700. } else
  51701. t = null,
  51702. we.copy(Le).multiplyScalar(Oe),
  51703. _e = De,
  51704. Te.copy(Ne).multiplyScalar(Oe);
  51705. if (Ce !== t && (Ge.bindFramebuffer(Ge.FRAMEBUFFER, t),
  51706. Ce = t),
  51707. Ye.scissor(we),
  51708. Ye.setScissorTest(_e),
  51709. Ye.viewport(Te),
  51710. i) {
  51711. var o = Xe.get(e.texture);
  51712. Ge.framebufferTexture2D(Ge.FRAMEBUFFER, Ge.COLOR_ATTACHMENT0, Ge.TEXTURE_CUBE_MAP_POSITIVE_X + e.activeCubeFace, o.__webglTexture, e.activeMipMapLevel)
  51713. }
  51714. }
  51715. ,
  51716. this.readRenderTargetPixels = function(e, t, i, r, o, a) {
  51717. if (e instanceof n.WebGLRenderTarget == !1)
  51718. return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");
  51719. var s = Xe.get(e).__webglFramebuffer;
  51720. if (s) {
  51721. var l = !1;
  51722. s !== Ce && (Ge.bindFramebuffer(Ge.FRAMEBUFFER, s),
  51723. l = !0);
  51724. try {
  51725. var c = e.texture;
  51726. if (c.format !== n.RGBAFormat && ee(c.format) !== Ge.getParameter(Ge.IMPLEMENTATION_COLOR_READ_FORMAT))
  51727. return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");
  51728. 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")))
  51729. return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");
  51730. 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.")
  51731. } finally {
  51732. l && Ge.bindFramebuffer(Ge.FRAMEBUFFER, Ce)
  51733. }
  51734. }
  51735. }
  51736. }
  51737. ,
  51738. n.WebGLRenderTarget = function(e, t, i) {
  51739. this.uuid = n.Math.generateUUID(),
  51740. this.width = e,
  51741. this.height = t,
  51742. this.scissor = new n.Vector4(0,0,e,t),
  51743. this.scissorTest = !1,
  51744. this.viewport = new n.Vector4(0,0,e,t),
  51745. i = i || {},
  51746. void 0 === i.minFilter && (i.minFilter = n.LinearFilter),
  51747. this.texture = new n.Texture(void 0,void 0,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy),
  51748. this.depthBuffer = void 0 === i.depthBuffer || i.depthBuffer,
  51749. this.stencilBuffer = void 0 === i.stencilBuffer || i.stencilBuffer
  51750. }
  51751. ,
  51752. n.WebGLRenderTarget.prototype = {
  51753. constructor: n.WebGLRenderTarget,
  51754. setSize: function(e, t) {
  51755. this.width === e && this.height === t || (this.width = e,
  51756. this.height = t,
  51757. this.dispose()),
  51758. this.viewport.set(0, 0, e, t),
  51759. this.scissor.set(0, 0, e, t)
  51760. },
  51761. clone: function() {
  51762. return (new this.constructor).copy(this)
  51763. },
  51764. copy: function(e) {
  51765. return this.width = e.width,
  51766. this.height = e.height,
  51767. this.viewport.copy(e.viewport),
  51768. this.texture = e.texture.clone(),
  51769. this.depthBuffer = e.depthBuffer,
  51770. this.stencilBuffer = e.stencilBuffer,
  51771. this
  51772. },
  51773. dispose: function() {
  51774. this.dispatchEvent({
  51775. type: "dispose"
  51776. })
  51777. }
  51778. },
  51779. n.EventDispatcher.prototype.apply(n.WebGLRenderTarget.prototype),
  51780. n.WebGLRenderTargetCube = function(e, t, i) {
  51781. n.WebGLRenderTarget.call(this, e, t, i),
  51782. this.activeCubeFace = 0,
  51783. this.activeMipMapLevel = 0
  51784. }
  51785. ,
  51786. n.WebGLRenderTargetCube.prototype = Object.create(n.WebGLRenderTarget.prototype),
  51787. n.WebGLRenderTargetCube.prototype.constructor = n.WebGLRenderTargetCube,
  51788. n.WebGLBufferRenderer = function(e, t, i) {
  51789. function r(e) {
  51790. s = e
  51791. }
  51792. function o(t, n) {
  51793. e.drawArrays(s, t, n),
  51794. i.calls++,
  51795. i.vertices += n,
  51796. s === e.TRIANGLES && (i.faces += n / 3)
  51797. }
  51798. function a(r) {
  51799. var o = t.get("ANGLE_instanced_arrays");
  51800. if (null === o)
  51801. return void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");
  51802. var a = r.attributes.position
  51803. , l = 0;
  51804. a instanceof n.InterleavedBufferAttribute ? (l = a.data.count,
  51805. o.drawArraysInstancedANGLE(s, 0, l, r.maxInstancedCount)) : (l = a.count,
  51806. o.drawArraysInstancedANGLE(s, 0, l, r.maxInstancedCount)),
  51807. i.calls++,
  51808. i.vertices += l * r.maxInstancedCount,
  51809. s === e.TRIANGLES && (i.faces += r.maxInstancedCount * l / 3)
  51810. }
  51811. var s;
  51812. this.setMode = r,
  51813. this.render = o,
  51814. this.renderInstances = a
  51815. }
  51816. ,
  51817. n.WebGLIndexedBufferRenderer = function(e, t, i) {
  51818. function n(e) {
  51819. s = e
  51820. }
  51821. function r(i) {
  51822. i.array instanceof Uint32Array && t.get("OES_element_index_uint") ? (l = e.UNSIGNED_INT,
  51823. c = 4) : (l = e.UNSIGNED_SHORT,
  51824. c = 2)
  51825. }
  51826. function o(t, n) {
  51827. e.drawElements(s, n, l, t * c),
  51828. i.calls++,
  51829. i.vertices += n,
  51830. s === e.TRIANGLES && (i.faces += n / 3)
  51831. }
  51832. function a(n, r, o) {
  51833. var a = t.get("ANGLE_instanced_arrays");
  51834. 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),
  51835. i.calls++,
  51836. i.vertices += o * n.maxInstancedCount,
  51837. void (s === e.TRIANGLES && (i.faces += n.maxInstancedCount * o / 3)))
  51838. }
  51839. var s, l, c;
  51840. this.setMode = n,
  51841. this.setIndex = r,
  51842. this.render = o,
  51843. this.renderInstances = a
  51844. }
  51845. ,
  51846. n.WebGLExtensions = function(e) {
  51847. var t = {};
  51848. this.get = function(i) {
  51849. if (void 0 !== t[i])
  51850. return t[i];
  51851. var n;
  51852. switch (i) {
  51853. case "EXT_texture_filter_anisotropic":
  51854. n = e.getExtension("EXT_texture_filter_anisotropic") || e.getExtension("MOZ_EXT_texture_filter_anisotropic") || e.getExtension("WEBKIT_EXT_texture_filter_anisotropic");
  51855. break;
  51856. case "WEBGL_compressed_texture_s3tc":
  51857. n = e.getExtension("WEBGL_compressed_texture_s3tc") || e.getExtension("MOZ_WEBGL_compressed_texture_s3tc") || e.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");
  51858. break;
  51859. case "WEBGL_compressed_texture_pvrtc":
  51860. n = e.getExtension("WEBGL_compressed_texture_pvrtc") || e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");
  51861. break;
  51862. case "WEBGL_compressed_texture_etc1":
  51863. n = e.getExtension("WEBGL_compressed_texture_etc1");
  51864. break;
  51865. default:
  51866. n = e.getExtension(i)
  51867. }
  51868. return null === n && console.warn("THREE.WebGLRenderer: " + i + " extension not supported."),
  51869. t[i] = n,
  51870. n
  51871. }
  51872. }
  51873. ,
  51874. n.WebGLCapabilities = function(e, t, i) {
  51875. function n(t) {
  51876. if ("highp" === t) {
  51877. if (e.getShaderPrecisionFormat(e.VERTEX_SHADER, e.HIGH_FLOAT).precision > 0 && e.getShaderPrecisionFormat(e.FRAGMENT_SHADER, e.HIGH_FLOAT).precision > 0)
  51878. return "highp";
  51879. t = "mediump"
  51880. }
  51881. 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"
  51882. }
  51883. this.getMaxPrecision = n,
  51884. this.precision = void 0 !== i.precision ? i.precision : "highp",
  51885. this.logarithmicDepthBuffer = void 0 !== i.logarithmicDepthBuffer && i.logarithmicDepthBuffer,
  51886. this.maxTextures = e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),
  51887. this.maxVertexTextures = e.getParameter(e.MAX_VERTEX_TEXTURE_IMAGE_UNITS),
  51888. this.maxTextureSize = e.getParameter(e.MAX_TEXTURE_SIZE),
  51889. this.maxCubemapSize = e.getParameter(e.MAX_CUBE_MAP_TEXTURE_SIZE),
  51890. this.maxAttributes = e.getParameter(e.MAX_VERTEX_ATTRIBS),
  51891. this.maxVertexUniforms = e.getParameter(e.MAX_VERTEX_UNIFORM_VECTORS),
  51892. this.maxVaryings = e.getParameter(e.MAX_VARYING_VECTORS),
  51893. this.maxFragmentUniforms = e.getParameter(e.MAX_FRAGMENT_UNIFORM_VECTORS),
  51894. this.vertexTextures = this.maxVertexTextures > 0,
  51895. this.floatFragmentTextures = !!t.get("OES_texture_float"),
  51896. this.floatVertexTextures = this.vertexTextures && this.floatFragmentTextures;
  51897. var r = n(this.precision);
  51898. r !== this.precision && (console.warn("THREE.WebGLRenderer:", this.precision, "not supported, using", r, "instead."),
  51899. this.precision = r),
  51900. this.logarithmicDepthBuffer && (this.logarithmicDepthBuffer = !!t.get("EXT_frag_depth"))
  51901. }
  51902. ,
  51903. n.WebGLGeometries = function(e, t, i) {
  51904. function r(e) {
  51905. var t = e.geometry;
  51906. if (void 0 !== h[t.id])
  51907. return h[t.id];
  51908. t.addEventListener("dispose", o);
  51909. var r;
  51910. return t instanceof n.BufferGeometry ? r = t : t instanceof n.Geometry && (void 0 === t._bufferGeometry && (t._bufferGeometry = (new n.BufferGeometry).setFromObject(e)),
  51911. r = t._bufferGeometry),
  51912. h[t.id] = r,
  51913. i.memory.geometries++,
  51914. r
  51915. }
  51916. function o(e) {
  51917. var n = e.target
  51918. , r = h[n.id];
  51919. null !== r.index && s(r.index),
  51920. l(r.attributes),
  51921. n.removeEventListener("dispose", o),
  51922. delete h[n.id];
  51923. var a = t.get(n);
  51924. a.wireframe && s(a.wireframe),
  51925. t.delete(n);
  51926. var c = t.get(r);
  51927. c.wireframe && s(c.wireframe),
  51928. t.delete(r),
  51929. i.memory.geometries--
  51930. }
  51931. function a(e) {
  51932. return e instanceof n.InterleavedBufferAttribute ? t.get(e.data).__webglBuffer : t.get(e).__webglBuffer
  51933. }
  51934. function s(t) {
  51935. var i = a(t);
  51936. void 0 !== i && (e.deleteBuffer(i),
  51937. c(t))
  51938. }
  51939. function l(e) {
  51940. for (var t in e)
  51941. s(e[t])
  51942. }
  51943. function c(e) {
  51944. e instanceof n.InterleavedBufferAttribute ? t.delete(e.data) : t.delete(e)
  51945. }
  51946. var h = {};
  51947. this.get = r
  51948. }
  51949. ,
  51950. n.WebGLLights = function() {
  51951. var e = {};
  51952. this.get = function(t) {
  51953. if (void 0 !== e[t.id])
  51954. return e[t.id];
  51955. var i;
  51956. switch (t.type) {
  51957. case "DirectionalLight":
  51958. i = {
  51959. direction: new n.Vector3,
  51960. color: new n.Color,
  51961. shadow: !1,
  51962. shadowBias: 0,
  51963. shadowRadius: 1,
  51964. shadowMapSize: new n.Vector2
  51965. };
  51966. break;
  51967. case "SpotLight":
  51968. i = {
  51969. position: new n.Vector3,
  51970. direction: new n.Vector3,
  51971. color: new n.Color,
  51972. distance: 0,
  51973. coneCos: 0,
  51974. penumbraCos: 0,
  51975. decay: 0,
  51976. shadow: !1,
  51977. shadowBias: 0,
  51978. shadowRadius: 1,
  51979. shadowMapSize: new n.Vector2
  51980. };
  51981. break;
  51982. case "PointLight":
  51983. i = {
  51984. position: new n.Vector3,
  51985. color: new n.Color,
  51986. distance: 0,
  51987. decay: 0,
  51988. shadow: !1,
  51989. shadowBias: 0,
  51990. shadowRadius: 1,
  51991. shadowMapSize: new n.Vector2
  51992. };
  51993. break;
  51994. case "HemisphereLight":
  51995. i = {
  51996. direction: new n.Vector3,
  51997. skyColor: new n.Color,
  51998. groundColor: new n.Color
  51999. }
  52000. }
  52001. return e[t.id] = i,
  52002. i
  52003. }
  52004. }
  52005. ,
  52006. n.WebGLObjects = function(e, t, i) {
  52007. function r(t) {
  52008. var i = u.get(t);
  52009. t.geometry instanceof n.Geometry && i.updateFromObject(t);
  52010. var r = i.index
  52011. , a = i.attributes;
  52012. null !== r && o(r, e.ELEMENT_ARRAY_BUFFER);
  52013. for (var s in a)
  52014. o(a[s], e.ARRAY_BUFFER);
  52015. var l = i.morphAttributes;
  52016. for (var s in l)
  52017. for (var c = l[s], h = 0, d = c.length; h < d; h++)
  52018. o(c[h], e.ARRAY_BUFFER);
  52019. return i
  52020. }
  52021. function o(e, i) {
  52022. var r = e instanceof n.InterleavedBufferAttribute ? e.data : e
  52023. , o = t.get(r);
  52024. void 0 === o.__webglBuffer ? a(o, r, i) : o.version !== r.version && s(o, r, i)
  52025. }
  52026. function a(t, i, n) {
  52027. t.__webglBuffer = e.createBuffer(),
  52028. e.bindBuffer(n, t.__webglBuffer);
  52029. var r = i.dynamic ? e.DYNAMIC_DRAW : e.STATIC_DRAW;
  52030. e.bufferData(n, i.array, r),
  52031. t.version = i.version
  52032. }
  52033. function s(t, i, n) {
  52034. e.bindBuffer(n, t.__webglBuffer),
  52035. 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)),
  52036. i.updateRange.count = 0),
  52037. t.version = i.version
  52038. }
  52039. function l(e) {
  52040. return e instanceof n.InterleavedBufferAttribute ? t.get(e.data).__webglBuffer : t.get(e).__webglBuffer
  52041. }
  52042. function c(i) {
  52043. var r = t.get(i);
  52044. if (void 0 !== r.wireframe)
  52045. return r.wireframe;
  52046. var a = []
  52047. , s = i.index
  52048. , l = i.attributes
  52049. , c = l.position;
  52050. if (null !== s)
  52051. for (var u = {}, d = s.array, p = 0, f = d.length; p < f; p += 3) {
  52052. var g = d[p + 0]
  52053. , m = d[p + 1]
  52054. , v = d[p + 2];
  52055. h(u, g, m) && a.push(g, m),
  52056. h(u, m, v) && a.push(m, v),
  52057. h(u, v, g) && a.push(v, g)
  52058. }
  52059. else
  52060. for (var d = l.position.array, p = 0, f = d.length / 3 - 1; p < f; p += 3) {
  52061. var g = p + 0
  52062. , m = p + 1
  52063. , v = p + 2;
  52064. a.push(g, m, m, v, v, g)
  52065. }
  52066. var A = c.count > 65535 ? Uint32Array : Uint16Array
  52067. , y = new n.BufferAttribute(new A(a),1);
  52068. return o(y, e.ELEMENT_ARRAY_BUFFER),
  52069. r.wireframe = y,
  52070. y
  52071. }
  52072. function h(e, t, i) {
  52073. if (t > i) {
  52074. var n = t;
  52075. t = i,
  52076. i = n
  52077. }
  52078. var r = e[t];
  52079. return void 0 === r ? (e[t] = [i],
  52080. !0) : r.indexOf(i) === -1 && (r.push(i),
  52081. !0)
  52082. }
  52083. var u = new n.WebGLGeometries(e,t,i);
  52084. this.getAttributeBuffer = l,
  52085. this.getWireframeAttribute = c,
  52086. this.update = r
  52087. }
  52088. ,
  52089. n.WebGLProgram = function() {
  52090. function e(e) {
  52091. switch (e) {
  52092. case n.LinearEncoding:
  52093. return ["Linear", "( value )"];
  52094. case n.sRGBEncoding:
  52095. return ["sRGB", "( value )"];
  52096. case n.RGBEEncoding:
  52097. return ["RGBE", "( value )"];
  52098. case n.RGBM7Encoding:
  52099. return ["RGBM", "( value, 7.0 )"];
  52100. case n.RGBM16Encoding:
  52101. return ["RGBM", "( value, 16.0 )"];
  52102. case n.RGBDEncoding:
  52103. return ["RGBD", "( value, 256.0 )"];
  52104. case n.GammaEncoding:
  52105. return ["Gamma", "( value, float( GAMMA_FACTOR ) )"];
  52106. default:
  52107. throw new Error("unsupported encoding: " + e)
  52108. }
  52109. }
  52110. function t(t, i) {
  52111. var n = e(i);
  52112. return "vec4 " + t + "( vec4 value ) { return " + n[0] + "ToLinear" + n[1] + "; }"
  52113. }
  52114. function i(t, i) {
  52115. var n = e(i);
  52116. return "vec4 " + t + "( vec4 value ) { return LinearTo" + n[0] + n[1] + "; }"
  52117. }
  52118. function r(e, t) {
  52119. var i;
  52120. switch (t) {
  52121. case n.LinearToneMapping:
  52122. i = "Linear";
  52123. break;
  52124. case n.ReinhardToneMapping:
  52125. i = "Reinhard";
  52126. break;
  52127. case n.Uncharted2ToneMapping:
  52128. i = "Uncharted2";
  52129. break;
  52130. case n.CineonToneMapping:
  52131. i = "OptimizedCineon";
  52132. break;
  52133. default:
  52134. throw new Error("unsupported toneMapping: " + t)
  52135. }
  52136. return "vec3 " + e + "( vec3 color ) { return " + i + "ToneMapping( color ); }"
  52137. }
  52138. function o(e, t, i) {
  52139. e = e || {};
  52140. 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" : ""];
  52141. return n.filter(c).join("\n")
  52142. }
  52143. function a(e) {
  52144. var t = [];
  52145. for (var i in e) {
  52146. var n = e[i];
  52147. n !== !1 && t.push("#define " + i + " " + n)
  52148. }
  52149. return t.join("\n")
  52150. }
  52151. function s(e, t, i) {
  52152. for (var n = {}, r = e.getProgramParameter(t, e.ACTIVE_UNIFORMS), o = 0; o < r; o++) {
  52153. var a = e.getActiveUniform(t, o)
  52154. , s = a.name
  52155. , l = e.getUniformLocation(t, s)
  52156. , c = f.exec(s);
  52157. if (c) {
  52158. var h = c[1]
  52159. , u = c[2]
  52160. , d = n[h];
  52161. d || (d = n[h] = {}),
  52162. d[u] = l
  52163. } else if (c = g.exec(s)) {
  52164. var p = c[1]
  52165. , v = c[2]
  52166. , A = c[3]
  52167. , y = n[p];
  52168. y || (y = n[p] = []);
  52169. var C = y[v];
  52170. C || (C = y[v] = {}),
  52171. C[A] = l
  52172. } else if (c = m.exec(s)) {
  52173. var p = c[1];
  52174. n[p] = l
  52175. } else
  52176. n[s] = l
  52177. }
  52178. return n
  52179. }
  52180. function l(e, t, i) {
  52181. for (var n = {}, r = e.getProgramParameter(t, e.ACTIVE_ATTRIBUTES), o = 0; o < r; o++) {
  52182. var a = e.getActiveAttrib(t, o)
  52183. , s = a.name;
  52184. n[s] = e.getAttribLocation(t, s)
  52185. }
  52186. return n
  52187. }
  52188. function c(e) {
  52189. return "" !== e
  52190. }
  52191. function h(e, t) {
  52192. 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)
  52193. }
  52194. function u(e) {
  52195. function t(e, t) {
  52196. var i = n.ShaderChunk[t];
  52197. if (void 0 === i)
  52198. throw new Error("Can not resolve #include <" + t + ">");
  52199. return u(i)
  52200. }
  52201. var i = /#include +<([\w\d.]+)>/g;
  52202. return e.replace(i, t)
  52203. }
  52204. function d(e) {
  52205. function t(e, t, i, n) {
  52206. for (var r = "", o = parseInt(t); o < parseInt(i); o++)
  52207. r += n.replace(/\[ i \]/g, "[ " + o + " ]");
  52208. return r
  52209. }
  52210. var i = /for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g;
  52211. return e.replace(i, t)
  52212. }
  52213. var p = 0
  52214. , f = /^([\w\d_]+)\.([\w\d_]+)$/
  52215. , g = /^([\w\d_]+)\[(\d+)\]\.([\w\d_]+)$/
  52216. , m = /^([\w\d_]+)\[0\]$/;
  52217. return function(e, f, g, m) {
  52218. var v = e.context
  52219. , A = g.extensions
  52220. , y = g.defines
  52221. , C = g.__webglShader.vertexShader
  52222. , I = g.__webglShader.fragmentShader
  52223. , E = "SHADOWMAP_TYPE_BASIC";
  52224. m.shadowMapType === n.PCFShadowMap ? E = "SHADOWMAP_TYPE_PCF" : m.shadowMapType === n.PCFSoftShadowMap && (E = "SHADOWMAP_TYPE_PCF_SOFT");
  52225. var b = "ENVMAP_TYPE_CUBE"
  52226. , w = "ENVMAP_MODE_REFLECTION"
  52227. , _ = "ENVMAP_BLENDING_MULTIPLY";
  52228. if (m.envMap) {
  52229. switch (g.envMap.mapping) {
  52230. case n.CubeReflectionMapping:
  52231. case n.CubeRefractionMapping:
  52232. b = "ENVMAP_TYPE_CUBE";
  52233. break;
  52234. case n.CubeUVReflectionMapping:
  52235. case n.CubeUVRefractionMapping:
  52236. b = "ENVMAP_TYPE_CUBE_UV";
  52237. break;
  52238. case n.EquirectangularReflectionMapping:
  52239. case n.EquirectangularRefractionMapping:
  52240. b = "ENVMAP_TYPE_EQUIREC";
  52241. break;
  52242. case n.SphericalReflectionMapping:
  52243. b = "ENVMAP_TYPE_SPHERE"
  52244. }
  52245. switch (g.envMap.mapping) {
  52246. case n.CubeRefractionMapping:
  52247. case n.EquirectangularRefractionMapping:
  52248. w = "ENVMAP_MODE_REFRACTION"
  52249. }
  52250. switch (g.combine) {
  52251. case n.MultiplyOperation:
  52252. _ = "ENVMAP_BLENDING_MULTIPLY";
  52253. break;
  52254. case n.MixOperation:
  52255. _ = "ENVMAP_BLENDING_MIX";
  52256. break;
  52257. case n.AddOperation:
  52258. _ = "ENVMAP_BLENDING_ADD"
  52259. }
  52260. }
  52261. var T, x, S = e.gammaFactor > 0 ? e.gammaFactor : 1, M = o(A, m, e.extensions), R = a(y), P = v.createProgram();
  52262. g instanceof n.RawShaderMaterial ? (T = "",
  52263. 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"),
  52264. 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")),
  52265. C = u(C, m),
  52266. C = h(C, m),
  52267. I = u(I, m),
  52268. I = h(I, m),
  52269. g instanceof n.ShaderMaterial == !1 && (C = d(C),
  52270. I = d(I));
  52271. var O = T + C
  52272. , L = x + I
  52273. , D = n.WebGLShader(v, v.VERTEX_SHADER, O)
  52274. , N = n.WebGLShader(v, v.FRAGMENT_SHADER, L);
  52275. v.attachShader(P, D),
  52276. v.attachShader(P, N),
  52277. void 0 !== g.index0AttributeName ? v.bindAttribLocation(P, 0, g.index0AttributeName) : m.morphTargets === !0 && v.bindAttribLocation(P, 0, "position"),
  52278. v.linkProgram(P);
  52279. var B = v.getProgramInfoLog(P)
  52280. , F = v.getShaderInfoLog(D)
  52281. , V = v.getShaderInfoLog(N)
  52282. , U = !0
  52283. , k = !0;
  52284. v.getProgramParameter(P, v.LINK_STATUS) === !1 ? (U = !1,
  52285. 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),
  52286. k && (this.diagnostics = {
  52287. runnable: U,
  52288. material: g,
  52289. programLog: B,
  52290. vertexShader: {
  52291. log: F,
  52292. prefix: T
  52293. },
  52294. fragmentShader: {
  52295. log: V,
  52296. prefix: x
  52297. }
  52298. }),
  52299. v.deleteShader(D),
  52300. v.deleteShader(N);
  52301. var H;
  52302. this.getUniforms = function() {
  52303. return void 0 === H && (H = s(v, P)),
  52304. H
  52305. }
  52306. ;
  52307. var G;
  52308. return this.getAttributes = function() {
  52309. return void 0 === G && (G = l(v, P)),
  52310. G
  52311. }
  52312. ,
  52313. this.destroy = function() {
  52314. v.deleteProgram(P),
  52315. this.program = void 0
  52316. }
  52317. ,
  52318. Object.defineProperties(this, {
  52319. uniforms: {
  52320. get: function() {
  52321. return console.warn("THREE.WebGLProgram: .uniforms is now .getUniforms()."),
  52322. this.getUniforms()
  52323. }
  52324. },
  52325. attributes: {
  52326. get: function() {
  52327. return console.warn("THREE.WebGLProgram: .attributes is now .getAttributes()."),
  52328. this.getAttributes()
  52329. }
  52330. }
  52331. }),
  52332. this.id = p++,
  52333. this.code = f,
  52334. this.usedTimes = 1,
  52335. this.program = P,
  52336. this.vertexShader = D,
  52337. this.fragmentShader = N,
  52338. this
  52339. }
  52340. }(),
  52341. n.WebGLPrograms = function(e, t) {
  52342. function i(e) {
  52343. if (t.floatVertexTextures && e && e.skeleton && e.skeleton.useVertexTexture)
  52344. return 1024;
  52345. var i = t.maxVertexUniforms
  52346. , r = Math.floor((i - 20) / 4)
  52347. , o = r;
  52348. return void 0 !== e && e instanceof n.SkinnedMesh && (o = Math.min(e.skeleton.bones.length, o),
  52349. 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)")),
  52350. o
  52351. }
  52352. function r(e, t) {
  52353. var i;
  52354. return e ? e instanceof n.Texture ? i = e.encoding : e instanceof n.WebGLRenderTarget && (i = e.texture.encoding) : i = n.LinearEncoding,
  52355. i === n.LinearEncoding && t && (i = n.GammaEncoding),
  52356. i
  52357. }
  52358. var o = []
  52359. , a = {
  52360. MeshDepthMaterial: "depth",
  52361. MeshNormalMaterial: "normal",
  52362. MeshBasicMaterial: "basic",
  52363. MeshLambertMaterial: "lambert",
  52364. MeshPhongMaterial: "phong",
  52365. MeshStandardMaterial: "standard",
  52366. LineBasicMaterial: "basic",
  52367. LineDashedMaterial: "dashed",
  52368. PointsMaterial: "points"
  52369. }
  52370. , 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"];
  52371. this.getParameters = function(o, s, l, c) {
  52372. var h = a[o.type]
  52373. , u = i(c)
  52374. , d = e.getPrecision();
  52375. null !== o.precision && (d = t.getMaxPrecision(o.precision),
  52376. d !== o.precision && console.warn("THREE.WebGLProgram.getParameters:", o.precision, "not supported, using", d, "instead."));
  52377. var p = {
  52378. shaderID: h,
  52379. precision: d,
  52380. supportsVertexTextures: t.vertexTextures,
  52381. outputEncoding: r(e.getCurrentRenderTarget(), e.gammaOutput),
  52382. map: !!o.map,
  52383. mapEncoding: r(o.map, e.gammaInput),
  52384. envMap: !!o.envMap,
  52385. envMapMode: o.envMap && o.envMap.mapping,
  52386. envMapEncoding: r(o.envMap, e.gammaInput),
  52387. envMapCubeUV: !!o.envMap && (o.envMap.mapping === n.CubeUVReflectionMapping || o.envMap.mapping === n.CubeUVRefractionMapping),
  52388. lightMap: !!o.lightMap,
  52389. aoMap: !!o.aoMap,
  52390. emissiveMap: !!o.emissiveMap,
  52391. emissiveMapEncoding: r(o.emissiveMap, e.gammaInput),
  52392. bumpMap: !!o.bumpMap,
  52393. normalMap: !!o.normalMap,
  52394. displacementMap: !!o.displacementMap,
  52395. roughnessMap: !!o.roughnessMap,
  52396. metalnessMap: !!o.metalnessMap,
  52397. specularMap: !!o.specularMap,
  52398. alphaMap: !!o.alphaMap,
  52399. combine: o.combine,
  52400. vertexColors: o.vertexColors,
  52401. fog: l,
  52402. useFog: o.fog,
  52403. fogExp: l instanceof n.FogExp2,
  52404. flatShading: o.shading === n.FlatShading,
  52405. sizeAttenuation: o.sizeAttenuation,
  52406. logarithmicDepthBuffer: t.logarithmicDepthBuffer,
  52407. skinning: o.skinning,
  52408. maxBones: u,
  52409. useVertexTexture: t.floatVertexTextures && c && c.skeleton && c.skeleton.useVertexTexture,
  52410. morphTargets: o.morphTargets,
  52411. morphNormals: o.morphNormals,
  52412. maxMorphTargets: e.maxMorphTargets,
  52413. maxMorphNormals: e.maxMorphNormals,
  52414. numDirLights: s.directional.length,
  52415. numPointLights: s.point.length,
  52416. numSpotLights: s.spot.length,
  52417. numHemiLights: s.hemi.length,
  52418. pointLightShadows: s.shadowsPointLight,
  52419. shadowMapEnabled: e.shadowMap.enabled && c.receiveShadow && s.shadows.length > 0,
  52420. shadowMapType: e.shadowMap.type,
  52421. toneMapping: e.toneMapping,
  52422. physicallyCorrectLights: e.physicallyCorrectLights,
  52423. premultipliedAlpha: o.premultipliedAlpha,
  52424. alphaTest: o.alphaTest,
  52425. doubleSided: o.side === n.DoubleSide,
  52426. flipSided: o.side === n.BackSide
  52427. };
  52428. return p
  52429. }
  52430. ,
  52431. this.getProgramCode = function(e, t) {
  52432. var i = [];
  52433. if (t.shaderID ? i.push(t.shaderID) : (i.push(e.fragmentShader),
  52434. i.push(e.vertexShader)),
  52435. void 0 !== e.defines)
  52436. for (var n in e.defines)
  52437. i.push(n),
  52438. i.push(e.defines[n]);
  52439. for (var r = 0; r < s.length; r++) {
  52440. var o = s[r];
  52441. i.push(o),
  52442. i.push(t[o])
  52443. }
  52444. return i.join()
  52445. }
  52446. ,
  52447. this.acquireProgram = function(t, i, r) {
  52448. for (var a, s = 0, l = o.length; s < l; s++) {
  52449. var c = o[s];
  52450. if (c.code === r) {
  52451. a = c,
  52452. ++a.usedTimes;
  52453. break
  52454. }
  52455. }
  52456. return void 0 === a && (a = new n.WebGLProgram(e,r,t,i),
  52457. o.push(a)),
  52458. a
  52459. }
  52460. ,
  52461. this.releaseProgram = function(e) {
  52462. if (0 === --e.usedTimes) {
  52463. var t = o.indexOf(e);
  52464. o[t] = o[o.length - 1],
  52465. o.pop(),
  52466. e.destroy()
  52467. }
  52468. }
  52469. ,
  52470. this.programs = o
  52471. }
  52472. ,
  52473. n.WebGLProperties = function() {
  52474. var e = {};
  52475. this.get = function(t) {
  52476. var i = t.uuid
  52477. , n = e[i];
  52478. return void 0 === n && (n = {},
  52479. e[i] = n),
  52480. n
  52481. }
  52482. ,
  52483. this.delete = function(t) {
  52484. delete e[t.uuid]
  52485. }
  52486. ,
  52487. this.clear = function() {
  52488. e = {}
  52489. }
  52490. }
  52491. ,
  52492. n.WebGLShader = function() {
  52493. function e(e) {
  52494. for (var t = e.split("\n"), i = 0; i < t.length; i++)
  52495. t[i] = i + 1 + ": " + t[i];
  52496. return t.join("\n")
  52497. }
  52498. return function(t, i, n) {
  52499. var r = t.createShader(i);
  52500. return t.shaderSource(r, n),
  52501. t.compileShader(r),
  52502. t.getShaderParameter(r, t.COMPILE_STATUS) === !1 && console.error("THREE.WebGLShader: Shader couldn't compile."),
  52503. "" !== t.getShaderInfoLog(r) && console.warn("THREE.WebGLShader: gl.getShaderInfoLog()", i === t.VERTEX_SHADER ? "vertex" : "fragment", t.getShaderInfoLog(r), e(n)),
  52504. r
  52505. }
  52506. }(),
  52507. n.WebGLShadowMap = function(e, t, i) {
  52508. function r(e, t, i, r) {
  52509. var o = e.geometry
  52510. , a = null
  52511. , s = v
  52512. , l = e.customDepthMaterial;
  52513. if (i && (s = A,
  52514. l = e.customDistanceMaterial),
  52515. l)
  52516. a = l;
  52517. else {
  52518. var c = void 0 !== o.morphTargets && o.morphTargets.length > 0 && t.morphTargets
  52519. , h = e instanceof n.SkinnedMesh && t.skinning
  52520. , u = 0;
  52521. c && (u |= f),
  52522. h && (u |= g),
  52523. a = s[u]
  52524. }
  52525. return a.visible = t.visible,
  52526. a.wireframe = t.wireframe,
  52527. a.wireframeLinewidth = t.wireframeLinewidth,
  52528. i && void 0 !== a.uniforms.lightPos && a.uniforms.lightPos.value.copy(r),
  52529. a
  52530. }
  52531. function o(e, t, i) {
  52532. if (e.visible !== !1) {
  52533. 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)) {
  52534. var r = e.material;
  52535. r.visible === !0 && (e.modelViewMatrix.multiplyMatrices(i.matrixWorldInverse, e.matrixWorld),
  52536. p.push(e))
  52537. }
  52538. for (var a = e.children, s = 0, c = a.length; s < c; s++)
  52539. o(a[s], t, i)
  52540. }
  52541. }
  52542. 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) {
  52543. var x = 0 !== (T & f)
  52544. , S = 0 !== (T & g)
  52545. , M = new n.ShaderMaterial({
  52546. uniforms: b,
  52547. vertexShader: E.vertexShader,
  52548. fragmentShader: E.fragmentShader,
  52549. morphTargets: x,
  52550. skinning: S
  52551. });
  52552. v[T] = M;
  52553. var R = new n.ShaderMaterial({
  52554. defines: {
  52555. USE_SHADOWMAP: ""
  52556. },
  52557. uniforms: _,
  52558. vertexShader: w.vertexShader,
  52559. fragmentShader: w.fragmentShader,
  52560. morphTargets: x,
  52561. skinning: S
  52562. });
  52563. A[T] = R
  52564. }
  52565. var P = this;
  52566. this.enabled = !1,
  52567. this.autoUpdate = !0,
  52568. this.needsUpdate = !1,
  52569. this.type = n.PCFShadowMap,
  52570. this.cullFace = n.CullFaceFront,
  52571. this.render = function(f, g) {
  52572. var m, v, A = t.shadows;
  52573. if (0 !== A.length && P.enabled !== !1 && (P.autoUpdate !== !1 || P.needsUpdate !== !1)) {
  52574. s.clearColor(1, 1, 1, 1),
  52575. s.disable(a.BLEND),
  52576. s.enable(a.CULL_FACE),
  52577. a.frontFace(a.CCW),
  52578. a.cullFace(P.cullFace === n.CullFaceFront ? a.FRONT : a.BACK),
  52579. s.setDepthTest(!0),
  52580. s.setScissorTest(!1);
  52581. for (var E = 0, b = A.length; E < b; E++) {
  52582. var w = A[E]
  52583. , _ = w.shadow
  52584. , T = _.camera;
  52585. if (h.copy(_.mapSize),
  52586. w instanceof n.PointLight) {
  52587. m = 6,
  52588. v = !0;
  52589. var x = h.x
  52590. , S = h.y;
  52591. I[0].set(2 * x, S, x, S),
  52592. I[1].set(0, S, x, S),
  52593. I[2].set(3 * x, S, x, S),
  52594. I[3].set(x, S, x, S),
  52595. I[4].set(3 * x, 0, x, S),
  52596. I[5].set(x, 0, x, S),
  52597. h.x *= 4,
  52598. h.y *= 2
  52599. } else
  52600. m = 1,
  52601. v = !1;
  52602. if (null === _.map) {
  52603. var M = {
  52604. minFilter: n.NearestFilter,
  52605. magFilter: n.NearestFilter,
  52606. format: n.RGBAFormat
  52607. };
  52608. _.map = new n.WebGLRenderTarget(h.x,h.y,M),
  52609. w instanceof n.SpotLight && (T.aspect = h.x / h.y),
  52610. T.updateProjectionMatrix()
  52611. }
  52612. var R = _.map
  52613. , O = _.matrix;
  52614. d.setFromMatrixPosition(w.matrixWorld),
  52615. T.position.copy(d),
  52616. e.setRenderTarget(R),
  52617. e.clear();
  52618. for (var L = 0; L < m; L++) {
  52619. if (v) {
  52620. u.copy(T.position),
  52621. u.add(y[L]),
  52622. T.up.copy(C[L]),
  52623. T.lookAt(u);
  52624. var D = I[L];
  52625. s.viewport(D)
  52626. } else
  52627. u.setFromMatrixPosition(w.target.matrixWorld),
  52628. T.lookAt(u);
  52629. T.updateMatrixWorld(),
  52630. T.matrixWorldInverse.getInverse(T.matrixWorld),
  52631. O.set(.5, 0, 0, .5, 0, .5, 0, .5, 0, 0, .5, .5, 0, 0, 0, 1),
  52632. O.multiply(T.projectionMatrix),
  52633. O.multiply(T.matrixWorldInverse),
  52634. c.multiplyMatrices(T.projectionMatrix, T.matrixWorldInverse),
  52635. l.setFromMatrix(c),
  52636. p.length = 0,
  52637. o(f, g, T);
  52638. for (var N = 0, B = p.length; N < B; N++) {
  52639. var F = p[N]
  52640. , V = i.update(F)
  52641. , U = F.material;
  52642. if (U instanceof n.MultiMaterial)
  52643. for (var k = V.groups, H = U.materials, G = 0, z = k.length; G < z; G++) {
  52644. var W = k[G]
  52645. , j = H[W.materialIndex];
  52646. if (j.visible === !0) {
  52647. var Y = r(F, j, v, d);
  52648. e.renderBufferDirect(T, null, V, Y, F, W)
  52649. }
  52650. }
  52651. else {
  52652. var Y = r(F, U, v, d);
  52653. e.renderBufferDirect(T, null, V, Y, F, null)
  52654. }
  52655. }
  52656. }
  52657. }
  52658. var X = e.getClearColor()
  52659. , Z = e.getClearAlpha();
  52660. e.setClearColor(X, Z),
  52661. s.enable(a.BLEND),
  52662. P.cullFace === n.CullFaceFront && a.cullFace(a.BACK),
  52663. P.needsUpdate = !1
  52664. }
  52665. }
  52666. }
  52667. ,
  52668. n.WebGLState = function(e, t, i) {
  52669. var r = this
  52670. , o = new n.Vector4
  52671. , a = new Uint8Array(16)
  52672. , s = new Uint8Array(16)
  52673. , l = new Uint8Array(16)
  52674. , c = {}
  52675. , h = null
  52676. , u = null
  52677. , d = null
  52678. , p = null
  52679. , f = null
  52680. , g = null
  52681. , m = null
  52682. , v = null
  52683. , A = !1
  52684. , y = null
  52685. , C = null
  52686. , I = null
  52687. , E = null
  52688. , b = null
  52689. , w = null
  52690. , _ = null
  52691. , T = null
  52692. , x = null
  52693. , S = null
  52694. , M = null
  52695. , R = null
  52696. , P = null
  52697. , O = null
  52698. , L = null
  52699. , D = e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS)
  52700. , N = void 0
  52701. , B = {}
  52702. , F = new n.Vector4
  52703. , V = null
  52704. , U = null
  52705. , k = new n.Vector4
  52706. , H = new n.Vector4
  52707. , G = e.createTexture();
  52708. e.bindTexture(e.TEXTURE_2D, G),
  52709. e.texParameteri(e.TEXTURE_2D, e.TEXTURE_MIN_FILTER, e.LINEAR),
  52710. e.texImage2D(e.TEXTURE_2D, 0, e.RGB, 1, 1, 0, e.RGB, e.UNSIGNED_BYTE, new Uint8Array(3)),
  52711. this.init = function() {
  52712. this.clearColor(0, 0, 0, 1),
  52713. this.clearDepth(1),
  52714. this.clearStencil(0),
  52715. this.enable(e.DEPTH_TEST),
  52716. e.depthFunc(e.LEQUAL),
  52717. e.frontFace(e.CCW),
  52718. e.cullFace(e.BACK),
  52719. this.enable(e.CULL_FACE),
  52720. this.enable(e.BLEND),
  52721. e.blendEquation(e.FUNC_ADD),
  52722. e.blendFunc(e.SRC_ALPHA, e.ONE_MINUS_SRC_ALPHA)
  52723. }
  52724. ,
  52725. this.initAttributes = function() {
  52726. for (var e = 0, t = a.length; e < t; e++)
  52727. a[e] = 0
  52728. }
  52729. ,
  52730. this.enableAttribute = function(i) {
  52731. if (a[i] = 1,
  52732. 0 === s[i] && (e.enableVertexAttribArray(i),
  52733. s[i] = 1),
  52734. 0 !== l[i]) {
  52735. var n = t.get("ANGLE_instanced_arrays");
  52736. n.vertexAttribDivisorANGLE(i, 0),
  52737. l[i] = 0
  52738. }
  52739. }
  52740. ,
  52741. this.enableAttributeAndDivisor = function(t, i, n) {
  52742. a[t] = 1,
  52743. 0 === s[t] && (e.enableVertexAttribArray(t),
  52744. s[t] = 1),
  52745. l[t] !== i && (n.vertexAttribDivisorANGLE(t, i),
  52746. l[t] = i)
  52747. }
  52748. ,
  52749. this.disableUnusedAttributes = function() {
  52750. for (var t = 0, i = s.length; t < i; t++)
  52751. s[t] !== a[t] && (e.disableVertexAttribArray(t),
  52752. s[t] = 0)
  52753. }
  52754. ,
  52755. this.enable = function(t) {
  52756. c[t] !== !0 && (e.enable(t),
  52757. c[t] = !0)
  52758. }
  52759. ,
  52760. this.disable = function(t) {
  52761. c[t] !== !1 && (e.disable(t),
  52762. c[t] = !1)
  52763. }
  52764. ,
  52765. this.getCompressedTextureFormats = function() {
  52766. if (null === h && (h = [],
  52767. t.get("WEBGL_compressed_texture_pvrtc") || t.get("WEBGL_compressed_texture_s3tc") || t.get("WEBGL_compressed_texture_etc1")))
  52768. for (var i = e.getParameter(e.COMPRESSED_TEXTURE_FORMATS), n = 0; n < i.length; n++)
  52769. h.push(i[n]);
  52770. return h
  52771. }
  52772. ,
  52773. this.setBlending = function(t, r, o, a, s, l, c, h) {
  52774. t === n.NoBlending ? this.disable(e.BLEND) : this.enable(e.BLEND),
  52775. t === u && h === A || (t === n.AdditiveBlending ? h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  52776. e.blendFuncSeparate(e.ONE, e.ONE, e.ONE, e.ONE)) : (e.blendEquation(e.FUNC_ADD),
  52777. e.blendFunc(e.SRC_ALPHA, e.ONE)) : t === n.SubtractiveBlending ? h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  52778. e.blendFuncSeparate(e.ZERO, e.ZERO, e.ONE_MINUS_SRC_COLOR, e.ONE_MINUS_SRC_ALPHA)) : (e.blendEquation(e.FUNC_ADD),
  52779. e.blendFunc(e.ZERO, e.ONE_MINUS_SRC_COLOR)) : t === n.MultiplyBlending ? h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  52780. e.blendFuncSeparate(e.ZERO, e.ZERO, e.SRC_COLOR, e.SRC_ALPHA)) : (e.blendEquation(e.FUNC_ADD),
  52781. e.blendFunc(e.ZERO, e.SRC_COLOR)) : h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  52782. e.blendFuncSeparate(e.ONE, e.ONE_MINUS_SRC_ALPHA, e.ONE, e.ONE_MINUS_SRC_ALPHA)) : (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  52783. e.blendFuncSeparate(e.SRC_ALPHA, e.ONE_MINUS_SRC_ALPHA, e.ONE, e.ONE_MINUS_SRC_ALPHA)),
  52784. u = t,
  52785. A = h),
  52786. t === n.CustomBlending ? (s = s || r,
  52787. l = l || o,
  52788. c = c || a,
  52789. r === d && s === g || (e.blendEquationSeparate(i(r), i(s)),
  52790. d = r,
  52791. g = s),
  52792. o === p && a === f && l === m && c === v || (e.blendFuncSeparate(i(o), i(a), i(l), i(c)),
  52793. p = o,
  52794. f = a,
  52795. m = l,
  52796. v = c)) : (d = null,
  52797. p = null,
  52798. f = null,
  52799. g = null,
  52800. m = null,
  52801. v = null)
  52802. }
  52803. ,
  52804. this.setDepthFunc = function(t) {
  52805. if (y !== t) {
  52806. if (t)
  52807. switch (t) {
  52808. case n.NeverDepth:
  52809. e.depthFunc(e.NEVER);
  52810. break;
  52811. case n.AlwaysDepth:
  52812. e.depthFunc(e.ALWAYS);
  52813. break;
  52814. case n.LessDepth:
  52815. e.depthFunc(e.LESS);
  52816. break;
  52817. case n.LessEqualDepth:
  52818. e.depthFunc(e.LEQUAL);
  52819. break;
  52820. case n.EqualDepth:
  52821. e.depthFunc(e.EQUAL);
  52822. break;
  52823. case n.GreaterEqualDepth:
  52824. e.depthFunc(e.GEQUAL);
  52825. break;
  52826. case n.GreaterDepth:
  52827. e.depthFunc(e.GREATER);
  52828. break;
  52829. case n.NotEqualDepth:
  52830. e.depthFunc(e.NOTEQUAL);
  52831. break;
  52832. default:
  52833. e.depthFunc(e.LEQUAL)
  52834. }
  52835. else
  52836. e.depthFunc(e.LEQUAL);
  52837. y = t
  52838. }
  52839. }
  52840. ,
  52841. this.setDepthTest = function(t) {
  52842. t ? this.enable(e.DEPTH_TEST) : this.disable(e.DEPTH_TEST)
  52843. }
  52844. ,
  52845. this.setDepthWrite = function(t) {
  52846. C !== t && (e.depthMask(t),
  52847. C = t)
  52848. }
  52849. ,
  52850. this.setColorWrite = function(t) {
  52851. I !== t && (e.colorMask(t, t, t, t),
  52852. I = t)
  52853. }
  52854. ,
  52855. this.setStencilFunc = function(t, i, n) {
  52856. b === t && w === i && _ === n || (e.stencilFunc(t, i, n),
  52857. b = t,
  52858. w = i,
  52859. _ = n)
  52860. }
  52861. ,
  52862. this.setStencilOp = function(t, i, n) {
  52863. T === t && x === i && S === n || (e.stencilOp(t, i, n),
  52864. T = t,
  52865. x = i,
  52866. S = n)
  52867. }
  52868. ,
  52869. this.setStencilTest = function(t) {
  52870. t ? this.enable(e.STENCIL_TEST) : this.disable(e.STENCIL_TEST)
  52871. }
  52872. ,
  52873. this.setStencilWrite = function(t) {
  52874. E !== t && (e.stencilMask(t),
  52875. E = t)
  52876. }
  52877. ,
  52878. this.setFlipSided = function(t) {
  52879. M !== t && (t ? e.frontFace(e.CW) : e.frontFace(e.CCW),
  52880. M = t)
  52881. }
  52882. ,
  52883. this.setLineWidth = function(t) {
  52884. t !== R && (e.lineWidth(t),
  52885. R = t)
  52886. }
  52887. ,
  52888. this.setPolygonOffset = function(t, i, n) {
  52889. t ? this.enable(e.POLYGON_OFFSET_FILL) : this.disable(e.POLYGON_OFFSET_FILL),
  52890. !t || P === i && O === n || (e.polygonOffset(i, n),
  52891. P = i,
  52892. O = n)
  52893. }
  52894. ,
  52895. this.getScissorTest = function() {
  52896. return L
  52897. }
  52898. ,
  52899. this.setScissorTest = function(t) {
  52900. L = t,
  52901. t ? this.enable(e.SCISSOR_TEST) : this.disable(e.SCISSOR_TEST)
  52902. }
  52903. ,
  52904. this.activeTexture = function(t) {
  52905. void 0 === t && (t = e.TEXTURE0 + D - 1),
  52906. N !== t && (e.activeTexture(t),
  52907. N = t)
  52908. }
  52909. ,
  52910. this.bindTexture = function(t, i) {
  52911. void 0 === N && r.activeTexture();
  52912. var n = B[N];
  52913. void 0 === n && (n = {
  52914. type: void 0,
  52915. texture: void 0
  52916. },
  52917. B[N] = n),
  52918. n.type === t && n.texture === i || (e.bindTexture(t, i || G),
  52919. n.type = t,
  52920. n.texture = i)
  52921. }
  52922. ,
  52923. this.compressedTexImage2D = function() {
  52924. try {
  52925. e.compressedTexImage2D.apply(e, arguments)
  52926. } catch (e) {
  52927. console.error(e)
  52928. }
  52929. }
  52930. ,
  52931. this.texImage2D = function() {
  52932. try {
  52933. e.texImage2D.apply(e, arguments)
  52934. } catch (e) {
  52935. console.error(e)
  52936. }
  52937. }
  52938. ,
  52939. this.clearColor = function(t, i, n, r) {
  52940. o.set(t, i, n, r),
  52941. F.equals(o) === !1 && (e.clearColor(t, i, n, r),
  52942. F.copy(o))
  52943. }
  52944. ,
  52945. this.clearDepth = function(t) {
  52946. V !== t && (e.clearDepth(t),
  52947. V = t)
  52948. }
  52949. ,
  52950. this.clearStencil = function(t) {
  52951. U !== t && (e.clearStencil(t),
  52952. U = t)
  52953. }
  52954. ,
  52955. this.scissor = function(t) {
  52956. k.equals(t) === !1 && (e.scissor(t.x, t.y, t.z, t.w),
  52957. k.copy(t))
  52958. }
  52959. ,
  52960. this.viewport = function(t) {
  52961. H.equals(t) === !1 && (e.viewport(t.x, t.y, t.z, t.w),
  52962. H.copy(t))
  52963. }
  52964. ,
  52965. this.reset = function() {
  52966. for (var t = 0; t < s.length; t++)
  52967. 1 === s[t] && (e.disableVertexAttribArray(t),
  52968. s[t] = 0);
  52969. c = {},
  52970. h = null,
  52971. N = void 0,
  52972. B = {},
  52973. u = null,
  52974. I = null,
  52975. C = null,
  52976. E = null,
  52977. M = null
  52978. }
  52979. }
  52980. ,
  52981. n.LensFlarePlugin = function(e, t) {
  52982. function i() {
  52983. var e = new Float32Array([-1, -1, 0, 0, 1, -1, 1, 0, 1, 1, 1, 1, -1, 1, 0, 1])
  52984. , t = new Uint16Array([0, 1, 2, 0, 2, 3]);
  52985. o = p.createBuffer(),
  52986. a = p.createBuffer(),
  52987. p.bindBuffer(p.ARRAY_BUFFER, o),
  52988. p.bufferData(p.ARRAY_BUFFER, e, p.STATIC_DRAW),
  52989. p.bindBuffer(p.ELEMENT_ARRAY_BUFFER, a),
  52990. p.bufferData(p.ELEMENT_ARRAY_BUFFER, t, p.STATIC_DRAW),
  52991. u = p.createTexture(),
  52992. d = p.createTexture(),
  52993. f.bindTexture(p.TEXTURE_2D, u),
  52994. p.texImage2D(p.TEXTURE_2D, 0, p.RGB, 16, 16, 0, p.RGB, p.UNSIGNED_BYTE, null),
  52995. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_WRAP_S, p.CLAMP_TO_EDGE),
  52996. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_WRAP_T, p.CLAMP_TO_EDGE),
  52997. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_MAG_FILTER, p.NEAREST),
  52998. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_MIN_FILTER, p.NEAREST),
  52999. f.bindTexture(p.TEXTURE_2D, d),
  53000. p.texImage2D(p.TEXTURE_2D, 0, p.RGBA, 16, 16, 0, p.RGBA, p.UNSIGNED_BYTE, null),
  53001. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_WRAP_S, p.CLAMP_TO_EDGE),
  53002. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_WRAP_T, p.CLAMP_TO_EDGE),
  53003. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_MAG_FILTER, p.NEAREST),
  53004. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_MIN_FILTER, p.NEAREST),
  53005. h = p.getParameter(p.MAX_VERTEX_TEXTURE_IMAGE_UNITS) > 0;
  53006. var i;
  53007. i = h ? {
  53008. 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"),
  53009. 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")
  53010. } : {
  53011. 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"),
  53012. 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")
  53013. },
  53014. s = r(i),
  53015. l = {
  53016. vertex: p.getAttribLocation(s, "position"),
  53017. uv: p.getAttribLocation(s, "uv")
  53018. },
  53019. c = {
  53020. renderType: p.getUniformLocation(s, "renderType"),
  53021. map: p.getUniformLocation(s, "map"),
  53022. occlusionMap: p.getUniformLocation(s, "occlusionMap"),
  53023. opacity: p.getUniformLocation(s, "opacity"),
  53024. color: p.getUniformLocation(s, "color"),
  53025. scale: p.getUniformLocation(s, "scale"),
  53026. rotation: p.getUniformLocation(s, "rotation"),
  53027. screenPosition: p.getUniformLocation(s, "screenPosition")
  53028. }
  53029. }
  53030. function r(t) {
  53031. var i = p.createProgram()
  53032. , n = p.createShader(p.FRAGMENT_SHADER)
  53033. , r = p.createShader(p.VERTEX_SHADER)
  53034. , o = "precision " + e.getPrecision() + " float;\n";
  53035. return p.shaderSource(n, o + t.fragmentShader),
  53036. p.shaderSource(r, o + t.vertexShader),
  53037. p.compileShader(n),
  53038. p.compileShader(r),
  53039. p.attachShader(i, n),
  53040. p.attachShader(i, r),
  53041. p.linkProgram(i),
  53042. i
  53043. }
  53044. var o, a, s, l, c, h, u, d, p = e.context, f = e.state;
  53045. this.render = function(r, g, m) {
  53046. if (0 !== t.length) {
  53047. var v = new n.Vector3
  53048. , A = m.w / m.z
  53049. , y = .5 * m.z
  53050. , C = .5 * m.w
  53051. , I = 16 / m.w
  53052. , E = new n.Vector2(I * A,I)
  53053. , b = new n.Vector3(1,1,0)
  53054. , w = new n.Vector2(1,1);
  53055. void 0 === s && i(),
  53056. p.useProgram(s),
  53057. f.initAttributes(),
  53058. f.enableAttribute(l.vertex),
  53059. f.enableAttribute(l.uv),
  53060. f.disableUnusedAttributes(),
  53061. p.uniform1i(c.occlusionMap, 0),
  53062. p.uniform1i(c.map, 1),
  53063. p.bindBuffer(p.ARRAY_BUFFER, o),
  53064. p.vertexAttribPointer(l.vertex, 2, p.FLOAT, !1, 16, 0),
  53065. p.vertexAttribPointer(l.uv, 2, p.FLOAT, !1, 16, 8),
  53066. p.bindBuffer(p.ELEMENT_ARRAY_BUFFER, a),
  53067. f.disable(p.CULL_FACE),
  53068. f.setDepthWrite(!1);
  53069. for (var _ = 0, T = t.length; _ < T; _++) {
  53070. I = 16 / m.w,
  53071. E.set(I * A, I);
  53072. var x = t[_];
  53073. if (v.set(x.matrixWorld.elements[12], x.matrixWorld.elements[13], x.matrixWorld.elements[14]),
  53074. v.applyMatrix4(g.matrixWorldInverse),
  53075. v.applyProjection(g.projectionMatrix),
  53076. b.copy(v),
  53077. w.x = b.x * y + y,
  53078. w.y = b.y * C + C,
  53079. h || w.x > 0 && w.x < m.z && w.y > 0 && w.y < m.w) {
  53080. f.activeTexture(p.TEXTURE0),
  53081. f.bindTexture(p.TEXTURE_2D, null),
  53082. f.activeTexture(p.TEXTURE1),
  53083. f.bindTexture(p.TEXTURE_2D, u),
  53084. p.copyTexImage2D(p.TEXTURE_2D, 0, p.RGB, m.x + w.x - 8, m.y + w.y - 8, 16, 16, 0),
  53085. p.uniform1i(c.renderType, 0),
  53086. p.uniform2f(c.scale, E.x, E.y),
  53087. p.uniform3f(c.screenPosition, b.x, b.y, b.z),
  53088. f.disable(p.BLEND),
  53089. f.enable(p.DEPTH_TEST),
  53090. p.drawElements(p.TRIANGLES, 6, p.UNSIGNED_SHORT, 0),
  53091. f.activeTexture(p.TEXTURE0),
  53092. f.bindTexture(p.TEXTURE_2D, d),
  53093. p.copyTexImage2D(p.TEXTURE_2D, 0, p.RGBA, m.x + w.x - 8, m.y + w.y - 8, 16, 16, 0),
  53094. p.uniform1i(c.renderType, 1),
  53095. f.disable(p.DEPTH_TEST),
  53096. f.activeTexture(p.TEXTURE1),
  53097. f.bindTexture(p.TEXTURE_2D, u),
  53098. p.drawElements(p.TRIANGLES, 6, p.UNSIGNED_SHORT, 0),
  53099. x.positionScreen.copy(b),
  53100. x.customUpdateCallback ? x.customUpdateCallback(x) : x.updateLensFlares(),
  53101. p.uniform1i(c.renderType, 2),
  53102. f.enable(p.BLEND);
  53103. for (var S = 0, M = x.lensFlares.length; S < M; S++) {
  53104. var R = x.lensFlares[S];
  53105. R.opacity > .001 && R.scale > .001 && (b.x = R.x,
  53106. b.y = R.y,
  53107. b.z = R.z,
  53108. I = R.size * R.scale / m.w,
  53109. E.x = I * A,
  53110. E.y = I,
  53111. p.uniform3f(c.screenPosition, b.x, b.y, b.z),
  53112. p.uniform2f(c.scale, E.x, E.y),
  53113. p.uniform1f(c.rotation, R.rotation),
  53114. p.uniform1f(c.opacity, R.opacity),
  53115. p.uniform3f(c.color, R.color.r, R.color.g, R.color.b),
  53116. f.setBlending(R.blending, R.blendEquation, R.blendSrc, R.blendDst),
  53117. e.setTexture(R.texture, 1),
  53118. p.drawElements(p.TRIANGLES, 6, p.UNSIGNED_SHORT, 0))
  53119. }
  53120. }
  53121. }
  53122. f.enable(p.CULL_FACE),
  53123. f.enable(p.DEPTH_TEST),
  53124. f.setDepthWrite(!0),
  53125. e.resetGLState()
  53126. }
  53127. }
  53128. }
  53129. ,
  53130. n.SpritePlugin = function(e, t) {
  53131. function i() {
  53132. var e = new Float32Array([-.5, -.5, 0, 0, .5, -.5, 1, 0, .5, .5, 1, 1, -.5, .5, 0, 1])
  53133. , t = new Uint16Array([0, 1, 2, 0, 2, 3]);
  53134. a = d.createBuffer(),
  53135. s = d.createBuffer(),
  53136. d.bindBuffer(d.ARRAY_BUFFER, a),
  53137. d.bufferData(d.ARRAY_BUFFER, e, d.STATIC_DRAW),
  53138. d.bindBuffer(d.ELEMENT_ARRAY_BUFFER, s),
  53139. d.bufferData(d.ELEMENT_ARRAY_BUFFER, t, d.STATIC_DRAW),
  53140. l = r(),
  53141. c = {
  53142. position: d.getAttribLocation(l, "position"),
  53143. uv: d.getAttribLocation(l, "uv")
  53144. },
  53145. h = {
  53146. uvOffset: d.getUniformLocation(l, "uvOffset"),
  53147. uvScale: d.getUniformLocation(l, "uvScale"),
  53148. rotation: d.getUniformLocation(l, "rotation"),
  53149. scale: d.getUniformLocation(l, "scale"),
  53150. color: d.getUniformLocation(l, "color"),
  53151. map: d.getUniformLocation(l, "map"),
  53152. opacity: d.getUniformLocation(l, "opacity"),
  53153. modelViewMatrix: d.getUniformLocation(l, "modelViewMatrix"),
  53154. projectionMatrix: d.getUniformLocation(l, "projectionMatrix"),
  53155. fogType: d.getUniformLocation(l, "fogType"),
  53156. fogDensity: d.getUniformLocation(l, "fogDensity"),
  53157. fogNear: d.getUniformLocation(l, "fogNear"),
  53158. fogFar: d.getUniformLocation(l, "fogFar"),
  53159. fogColor: d.getUniformLocation(l, "fogColor"),
  53160. alphaTest: d.getUniformLocation(l, "alphaTest")
  53161. };
  53162. var i = document.createElement("canvas");
  53163. i.width = 8,
  53164. i.height = 8;
  53165. var o = i.getContext("2d");
  53166. o.fillStyle = "white",
  53167. o.fillRect(0, 0, 8, 8),
  53168. u = new n.Texture(i),
  53169. u.needsUpdate = !0
  53170. }
  53171. function r() {
  53172. var t = d.createProgram()
  53173. , i = d.createShader(d.VERTEX_SHADER)
  53174. , n = d.createShader(d.FRAGMENT_SHADER);
  53175. 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")),
  53176. 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")),
  53177. d.compileShader(i),
  53178. d.compileShader(n),
  53179. d.attachShader(t, i),
  53180. d.attachShader(t, n),
  53181. d.linkProgram(t),
  53182. t
  53183. }
  53184. function o(e, t) {
  53185. return e.renderOrder !== t.renderOrder ? e.renderOrder - t.renderOrder : e.z !== t.z ? t.z - e.z : t.id - e.id
  53186. }
  53187. 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;
  53188. this.render = function(r, v) {
  53189. if (0 !== t.length) {
  53190. void 0 === l && i(),
  53191. d.useProgram(l),
  53192. p.initAttributes(),
  53193. p.enableAttribute(c.position),
  53194. p.enableAttribute(c.uv),
  53195. p.disableUnusedAttributes(),
  53196. p.disable(d.CULL_FACE),
  53197. p.enable(d.BLEND),
  53198. d.bindBuffer(d.ARRAY_BUFFER, a),
  53199. d.vertexAttribPointer(c.position, 2, d.FLOAT, !1, 16, 0),
  53200. d.vertexAttribPointer(c.uv, 2, d.FLOAT, !1, 16, 8),
  53201. d.bindBuffer(d.ELEMENT_ARRAY_BUFFER, s),
  53202. d.uniformMatrix4fv(h.projectionMatrix, !1, v.projectionMatrix.elements),
  53203. p.activeTexture(d.TEXTURE0),
  53204. d.uniform1i(h.map, 0);
  53205. var A = 0
  53206. , y = 0
  53207. , C = r.fog;
  53208. C ? (d.uniform3f(h.fogColor, C.color.r, C.color.g, C.color.b),
  53209. C instanceof n.Fog ? (d.uniform1f(h.fogNear, C.near),
  53210. d.uniform1f(h.fogFar, C.far),
  53211. d.uniform1i(h.fogType, 1),
  53212. A = 1,
  53213. y = 1) : C instanceof n.FogExp2 && (d.uniform1f(h.fogDensity, C.density),
  53214. d.uniform1i(h.fogType, 2),
  53215. A = 2,
  53216. y = 2)) : (d.uniform1i(h.fogType, 0),
  53217. A = 0,
  53218. y = 0);
  53219. for (var I = 0, E = t.length; I < E; I++) {
  53220. var b = t[I];
  53221. b.modelViewMatrix.multiplyMatrices(v.matrixWorldInverse, b.matrixWorld),
  53222. b.z = -b.modelViewMatrix.elements[14]
  53223. }
  53224. t.sort(o);
  53225. for (var w = [], I = 0, E = t.length; I < E; I++) {
  53226. var b = t[I]
  53227. , _ = b.material;
  53228. d.uniform1f(h.alphaTest, _.alphaTest),
  53229. d.uniformMatrix4fv(h.modelViewMatrix, !1, b.modelViewMatrix.elements),
  53230. b.matrixWorld.decompose(f, g, m),
  53231. w[0] = m.x,
  53232. w[1] = m.y;
  53233. var T = 0;
  53234. r.fog && _.fog && (T = y),
  53235. A !== T && (d.uniform1i(h.fogType, T),
  53236. A = T),
  53237. null !== _.map ? (d.uniform2f(h.uvOffset, _.map.offset.x, _.map.offset.y),
  53238. d.uniform2f(h.uvScale, _.map.repeat.x, _.map.repeat.y)) : (d.uniform2f(h.uvOffset, 0, 0),
  53239. d.uniform2f(h.uvScale, 1, 1)),
  53240. d.uniform1f(h.opacity, _.opacity),
  53241. d.uniform3f(h.color, _.color.r, _.color.g, _.color.b),
  53242. d.uniform1f(h.rotation, _.rotation),
  53243. d.uniform2fv(h.scale, w),
  53244. p.setBlending(_.blending, _.blendEquation, _.blendSrc, _.blendDst),
  53245. p.setDepthTest(_.depthTest),
  53246. p.setDepthWrite(_.depthWrite),
  53247. _.map && _.map.image && _.map.image.width ? e.setTexture(_.map, 0) : e.setTexture(u, 0),
  53248. d.drawElements(d.TRIANGLES, 6, d.UNSIGNED_SHORT, 0)
  53249. }
  53250. p.enable(d.CULL_FACE),
  53251. e.resetGLState()
  53252. }
  53253. }
  53254. }
  53255. ,
  53256. Object.defineProperties(n.Box2.prototype, {
  53257. empty: {
  53258. value: function() {
  53259. return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."),
  53260. this.isEmpty()
  53261. }
  53262. },
  53263. isIntersectionBox: {
  53264. value: function(e) {
  53265. return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."),
  53266. this.intersectsBox(e)
  53267. }
  53268. }
  53269. }),
  53270. Object.defineProperties(n.Box3.prototype, {
  53271. empty: {
  53272. value: function() {
  53273. return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),
  53274. this.isEmpty()
  53275. }
  53276. },
  53277. isIntersectionBox: {
  53278. value: function(e) {
  53279. return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),
  53280. this.intersectsBox(e)
  53281. }
  53282. },
  53283. isIntersectionSphere: {
  53284. value: function(e) {
  53285. return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),
  53286. this.intersectsSphere(e)
  53287. }
  53288. }
  53289. }),
  53290. Object.defineProperties(n.Matrix3.prototype, {
  53291. multiplyVector3: {
  53292. value: function(e) {
  53293. return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),
  53294. e.applyMatrix3(this)
  53295. }
  53296. },
  53297. multiplyVector3Array: {
  53298. value: function(e) {
  53299. return console.warn("THREE.Matrix3: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead."),
  53300. this.applyToVector3Array(e)
  53301. }
  53302. }
  53303. }),
  53304. Object.defineProperties(n.Matrix4.prototype, {
  53305. extractPosition: {
  53306. value: function(e) {
  53307. return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),
  53308. this.copyPosition(e)
  53309. }
  53310. },
  53311. setRotationFromQuaternion: {
  53312. value: function(e) {
  53313. return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),
  53314. this.makeRotationFromQuaternion(e)
  53315. }
  53316. },
  53317. multiplyVector3: {
  53318. value: function(e) {
  53319. return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) or vector.applyProjection( matrix ) instead."),
  53320. e.applyProjection(this)
  53321. }
  53322. },
  53323. multiplyVector4: {
  53324. value: function(e) {
  53325. return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),
  53326. e.applyMatrix4(this)
  53327. }
  53328. },
  53329. multiplyVector3Array: {
  53330. value: function(e) {
  53331. return console.warn("THREE.Matrix4: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead."),
  53332. this.applyToVector3Array(e)
  53333. }
  53334. },
  53335. rotateAxis: {
  53336. value: function(e) {
  53337. console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),
  53338. e.transformDirection(this)
  53339. }
  53340. },
  53341. crossVector: {
  53342. value: function(e) {
  53343. return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),
  53344. e.applyMatrix4(this)
  53345. }
  53346. },
  53347. translate: {
  53348. value: function(e) {
  53349. console.error("THREE.Matrix4: .translate() has been removed.")
  53350. }
  53351. },
  53352. rotateX: {
  53353. value: function(e) {
  53354. console.error("THREE.Matrix4: .rotateX() has been removed.")
  53355. }
  53356. },
  53357. rotateY: {
  53358. value: function(e) {
  53359. console.error("THREE.Matrix4: .rotateY() has been removed.")
  53360. }
  53361. },
  53362. rotateZ: {
  53363. value: function(e) {
  53364. console.error("THREE.Matrix4: .rotateZ() has been removed.")
  53365. }
  53366. },
  53367. rotateByAxis: {
  53368. value: function(e, t) {
  53369. console.error("THREE.Matrix4: .rotateByAxis() has been removed.")
  53370. }
  53371. }
  53372. }),
  53373. Object.defineProperties(n.Plane.prototype, {
  53374. isIntersectionLine: {
  53375. value: function(e) {
  53376. return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),
  53377. this.intersectsLine(e)
  53378. }
  53379. }
  53380. }),
  53381. Object.defineProperties(n.Quaternion.prototype, {
  53382. multiplyVector3: {
  53383. value: function(e) {
  53384. return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),
  53385. e.applyQuaternion(this)
  53386. }
  53387. }
  53388. }),
  53389. Object.defineProperties(n.Ray.prototype, {
  53390. isIntersectionBox: {
  53391. value: function(e) {
  53392. return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),
  53393. this.intersectsBox(e)
  53394. }
  53395. },
  53396. isIntersectionPlane: {
  53397. value: function(e) {
  53398. return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),
  53399. this.intersectsPlane(e)
  53400. }
  53401. },
  53402. isIntersectionSphere: {
  53403. value: function(e) {
  53404. return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),
  53405. this.intersectsSphere(e)
  53406. }
  53407. }
  53408. }),
  53409. Object.defineProperties(n.Vector3.prototype, {
  53410. setEulerFromRotationMatrix: {
  53411. value: function() {
  53412. console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")
  53413. }
  53414. },
  53415. setEulerFromQuaternion: {
  53416. value: function() {
  53417. console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")
  53418. }
  53419. },
  53420. getPositionFromMatrix: {
  53421. value: function(e) {
  53422. return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),
  53423. this.setFromMatrixPosition(e)
  53424. }
  53425. },
  53426. getScaleFromMatrix: {
  53427. value: function(e) {
  53428. return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),
  53429. this.setFromMatrixScale(e)
  53430. }
  53431. },
  53432. getColumnFromMatrix: {
  53433. value: function(e, t) {
  53434. return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),
  53435. this.setFromMatrixColumn(e, t)
  53436. }
  53437. }
  53438. }),
  53439. n.Face4 = function(e, t, i, r, o, a, s) {
  53440. return console.warn("THREE.Face4 has been removed. A THREE.Face3 will be created instead."),
  53441. new n.Face3(e,t,i,o,a,s)
  53442. }
  53443. ,
  53444. n.Vertex = function(e, t, i) {
  53445. return console.warn("THREE.Vertex has been removed. Use THREE.Vector3 instead."),
  53446. new n.Vector3(e,t,i)
  53447. }
  53448. ,
  53449. Object.defineProperties(n.Object3D.prototype, {
  53450. eulerOrder: {
  53451. get: function() {
  53452. return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),
  53453. this.rotation.order
  53454. },
  53455. set: function(e) {
  53456. console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),
  53457. this.rotation.order = e
  53458. }
  53459. },
  53460. getChildByName: {
  53461. value: function(e) {
  53462. return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),
  53463. this.getObjectByName(e)
  53464. }
  53465. },
  53466. renderDepth: {
  53467. set: function(e) {
  53468. console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")
  53469. }
  53470. },
  53471. translate: {
  53472. value: function(e, t) {
  53473. return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),
  53474. this.translateOnAxis(t, e)
  53475. }
  53476. },
  53477. useQuaternion: {
  53478. get: function() {
  53479. console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")
  53480. },
  53481. set: function(e) {
  53482. console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")
  53483. }
  53484. }
  53485. }),
  53486. Object.defineProperties(n, {
  53487. PointCloud: {
  53488. value: function(e, t) {
  53489. return console.warn("THREE.PointCloud has been renamed to THREE.Points."),
  53490. new n.Points(e,t)
  53491. }
  53492. },
  53493. ParticleSystem: {
  53494. value: function(e, t) {
  53495. return console.warn("THREE.ParticleSystem has been renamed to THREE.Points."),
  53496. new n.Points(e,t)
  53497. }
  53498. }
  53499. }),
  53500. Object.defineProperties(n.Light.prototype, {
  53501. onlyShadow: {
  53502. set: function(e) {
  53503. console.warn("THREE.Light: .onlyShadow has been removed.")
  53504. }
  53505. },
  53506. shadowCameraFov: {
  53507. set: function(e) {
  53508. console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."),
  53509. this.shadow.camera.fov = e
  53510. }
  53511. },
  53512. shadowCameraLeft: {
  53513. set: function(e) {
  53514. console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."),
  53515. this.shadow.camera.left = e
  53516. }
  53517. },
  53518. shadowCameraRight: {
  53519. set: function(e) {
  53520. console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),
  53521. this.shadow.camera.right = e
  53522. }
  53523. },
  53524. shadowCameraTop: {
  53525. set: function(e) {
  53526. console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),
  53527. this.shadow.camera.top = e
  53528. }
  53529. },
  53530. shadowCameraBottom: {
  53531. set: function(e) {
  53532. console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),
  53533. this.shadow.camera.bottom = e
  53534. }
  53535. },
  53536. shadowCameraNear: {
  53537. set: function(e) {
  53538. console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),
  53539. this.shadow.camera.near = e
  53540. }
  53541. },
  53542. shadowCameraFar: {
  53543. set: function(e) {
  53544. console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),
  53545. this.shadow.camera.far = e
  53546. }
  53547. },
  53548. shadowCameraVisible: {
  53549. set: function(e) {
  53550. console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")
  53551. }
  53552. },
  53553. shadowBias: {
  53554. set: function(e) {
  53555. console.warn("THREE.Light: .shadowBias is now .shadow.bias."),
  53556. this.shadow.bias = e
  53557. }
  53558. },
  53559. shadowDarkness: {
  53560. set: function(e) {
  53561. console.warn("THREE.Light: .shadowDarkness has been removed.")
  53562. }
  53563. },
  53564. shadowMapWidth: {
  53565. set: function(e) {
  53566. console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),
  53567. this.shadow.mapSize.width = e
  53568. }
  53569. },
  53570. shadowMapHeight: {
  53571. set: function(e) {
  53572. console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),
  53573. this.shadow.mapSize.height = e
  53574. }
  53575. }
  53576. }),
  53577. Object.defineProperties(n.BufferAttribute.prototype, {
  53578. length: {
  53579. get: function() {
  53580. return console.warn("THREE.BufferAttribute: .length has been deprecated. Please use .count."),
  53581. this.array.length
  53582. }
  53583. }
  53584. }),
  53585. Object.defineProperties(n.BufferGeometry.prototype, {
  53586. drawcalls: {
  53587. get: function() {
  53588. return console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups."),
  53589. this.groups
  53590. }
  53591. },
  53592. offsets: {
  53593. get: function() {
  53594. return console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups."),
  53595. this.groups
  53596. }
  53597. },
  53598. addIndex: {
  53599. value: function(e) {
  53600. console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),
  53601. this.setIndex(e)
  53602. }
  53603. },
  53604. addDrawCall: {
  53605. value: function(e, t, i) {
  53606. void 0 !== i && console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),
  53607. console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),
  53608. this.addGroup(e, t)
  53609. }
  53610. },
  53611. clearDrawCalls: {
  53612. value: function() {
  53613. console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."),
  53614. this.clearGroups()
  53615. }
  53616. },
  53617. computeTangents: {
  53618. value: function() {
  53619. console.warn("THREE.BufferGeometry: .computeTangents() has been removed.")
  53620. }
  53621. },
  53622. computeOffsets: {
  53623. value: function() {
  53624. console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")
  53625. }
  53626. }
  53627. }),
  53628. Object.defineProperties(n.Material.prototype, {
  53629. wrapAround: {
  53630. get: function() {
  53631. console.warn("THREE." + this.type + ": .wrapAround has been removed.")
  53632. },
  53633. set: function(e) {
  53634. console.warn("THREE." + this.type + ": .wrapAround has been removed.")
  53635. }
  53636. },
  53637. wrapRGB: {
  53638. get: function() {
  53639. return console.warn("THREE." + this.type + ": .wrapRGB has been removed."),
  53640. new n.Color
  53641. }
  53642. }
  53643. }),
  53644. Object.defineProperties(n, {
  53645. PointCloudMaterial: {
  53646. value: function(e) {
  53647. return console.warn("THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial."),
  53648. new n.PointsMaterial(e)
  53649. }
  53650. },
  53651. ParticleBasicMaterial: {
  53652. value: function(e) {
  53653. return console.warn("THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial."),
  53654. new n.PointsMaterial(e)
  53655. }
  53656. },
  53657. ParticleSystemMaterial: {
  53658. value: function(e) {
  53659. return console.warn("THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial."),
  53660. new n.PointsMaterial(e)
  53661. }
  53662. }
  53663. }),
  53664. Object.defineProperties(n.MeshPhongMaterial.prototype, {
  53665. metal: {
  53666. get: function() {
  53667. return console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead."),
  53668. !1
  53669. },
  53670. set: function(e) {
  53671. console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead")
  53672. }
  53673. }
  53674. }),
  53675. Object.defineProperties(n.ShaderMaterial.prototype, {
  53676. derivatives: {
  53677. get: function() {
  53678. return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),
  53679. this.extensions.derivatives
  53680. },
  53681. set: function(e) {
  53682. console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),
  53683. this.extensions.derivatives = e
  53684. }
  53685. }
  53686. }),
  53687. Object.defineProperties(n.WebGLRenderer.prototype, {
  53688. supportsFloatTextures: {
  53689. value: function() {
  53690. return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."),
  53691. this.extensions.get("OES_texture_float")
  53692. }
  53693. },
  53694. supportsHalfFloatTextures: {
  53695. value: function() {
  53696. return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."),
  53697. this.extensions.get("OES_texture_half_float")
  53698. }
  53699. },
  53700. supportsStandardDerivatives: {
  53701. value: function() {
  53702. return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."),
  53703. this.extensions.get("OES_standard_derivatives")
  53704. }
  53705. },
  53706. supportsCompressedTextureS3TC: {
  53707. value: function() {
  53708. return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),
  53709. this.extensions.get("WEBGL_compressed_texture_s3tc")
  53710. }
  53711. },
  53712. supportsCompressedTexturePVRTC: {
  53713. value: function() {
  53714. return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),
  53715. this.extensions.get("WEBGL_compressed_texture_pvrtc")
  53716. }
  53717. },
  53718. supportsBlendMinMax: {
  53719. value: function() {
  53720. return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."),
  53721. this.extensions.get("EXT_blend_minmax")
  53722. }
  53723. },
  53724. supportsVertexTextures: {
  53725. value: function() {
  53726. return this.capabilities.vertexTextures
  53727. }
  53728. },
  53729. supportsInstancedArrays: {
  53730. value: function() {
  53731. return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."),
  53732. this.extensions.get("ANGLE_instanced_arrays")
  53733. }
  53734. },
  53735. enableScissorTest: {
  53736. value: function(e) {
  53737. console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),
  53738. this.setScissorTest(e)
  53739. }
  53740. },
  53741. initMaterial: {
  53742. value: function() {
  53743. console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")
  53744. }
  53745. },
  53746. addPrePlugin: {
  53747. value: function() {
  53748. console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")
  53749. }
  53750. },
  53751. addPostPlugin: {
  53752. value: function() {
  53753. console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")
  53754. }
  53755. },
  53756. updateShadowMap: {
  53757. value: function() {
  53758. console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")
  53759. }
  53760. },
  53761. shadowMapEnabled: {
  53762. get: function() {
  53763. return this.shadowMap.enabled
  53764. },
  53765. set: function(e) {
  53766. console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),
  53767. this.shadowMap.enabled = e
  53768. }
  53769. },
  53770. shadowMapType: {
  53771. get: function() {
  53772. return this.shadowMap.type
  53773. },
  53774. set: function(e) {
  53775. console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),
  53776. this.shadowMap.type = e
  53777. }
  53778. },
  53779. shadowMapCullFace: {
  53780. get: function() {
  53781. return this.shadowMap.cullFace
  53782. },
  53783. set: function(e) {
  53784. console.warn("THREE.WebGLRenderer: .shadowMapCullFace is now .shadowMap.cullFace."),
  53785. this.shadowMap.cullFace = e
  53786. }
  53787. }
  53788. }),
  53789. Object.defineProperties(n.WebGLRenderTarget.prototype, {
  53790. wrapS: {
  53791. get: function() {
  53792. return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),
  53793. this.texture.wrapS
  53794. },
  53795. set: function(e) {
  53796. console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),
  53797. this.texture.wrapS = e
  53798. }
  53799. },
  53800. wrapT: {
  53801. get: function() {
  53802. return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),
  53803. this.texture.wrapT
  53804. },
  53805. set: function(e) {
  53806. console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),
  53807. this.texture.wrapT = e
  53808. }
  53809. },
  53810. magFilter: {
  53811. get: function() {
  53812. return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),
  53813. this.texture.magFilter
  53814. },
  53815. set: function(e) {
  53816. console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),
  53817. this.texture.magFilter = e
  53818. }
  53819. },
  53820. minFilter: {
  53821. get: function() {
  53822. return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),
  53823. this.texture.minFilter
  53824. },
  53825. set: function(e) {
  53826. console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),
  53827. this.texture.minFilter = e
  53828. }
  53829. },
  53830. anisotropy: {
  53831. get: function() {
  53832. return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),
  53833. this.texture.anisotropy
  53834. },
  53835. set: function(e) {
  53836. console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),
  53837. this.texture.anisotropy = e
  53838. }
  53839. },
  53840. offset: {
  53841. get: function() {
  53842. return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),
  53843. this.texture.offset
  53844. },
  53845. set: function(e) {
  53846. console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),
  53847. this.texture.offset = e
  53848. }
  53849. },
  53850. repeat: {
  53851. get: function() {
  53852. return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),
  53853. this.texture.repeat
  53854. },
  53855. set: function(e) {
  53856. console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),
  53857. this.texture.repeat = e
  53858. }
  53859. },
  53860. format: {
  53861. get: function() {
  53862. return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),
  53863. this.texture.format
  53864. },
  53865. set: function(e) {
  53866. console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),
  53867. this.texture.format = e
  53868. }
  53869. },
  53870. type: {
  53871. get: function() {
  53872. return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),
  53873. this.texture.type
  53874. },
  53875. set: function(e) {
  53876. console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),
  53877. this.texture.type = e
  53878. }
  53879. },
  53880. generateMipmaps: {
  53881. get: function() {
  53882. return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),
  53883. this.texture.generateMipmaps
  53884. },
  53885. set: function(e) {
  53886. console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),
  53887. this.texture.generateMipmaps = e
  53888. }
  53889. }
  53890. }),
  53891. n.GeometryUtils = {
  53892. merge: function(e, t, i) {
  53893. console.warn("THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead.");
  53894. var r;
  53895. t instanceof n.Mesh && (t.matrixAutoUpdate && t.updateMatrix(),
  53896. r = t.matrix,
  53897. t = t.geometry),
  53898. e.merge(t, r, i)
  53899. },
  53900. center: function(e) {
  53901. return console.warn("THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead."),
  53902. e.center()
  53903. }
  53904. },
  53905. n.ImageUtils = {
  53906. crossOrigin: void 0,
  53907. loadTexture: function(e, t, i, r) {
  53908. console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");
  53909. var o = new n.TextureLoader;
  53910. o.setCrossOrigin(this.crossOrigin);
  53911. var a = o.load(e, i, void 0, r);
  53912. return t && (a.mapping = t),
  53913. a
  53914. },
  53915. loadTextureCube: function(e, t, i, r) {
  53916. console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");
  53917. var o = new n.CubeTextureLoader;
  53918. o.setCrossOrigin(this.crossOrigin);
  53919. var a = o.load(e, i, void 0, r);
  53920. return t && (a.mapping = t),
  53921. a
  53922. },
  53923. loadCompressedTexture: function() {
  53924. console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")
  53925. },
  53926. loadCompressedTextureCube: function() {
  53927. console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")
  53928. }
  53929. },
  53930. n.Projector = function() {
  53931. console.error("THREE.Projector has been moved to /examples/js/renderers/Projector.js."),
  53932. this.projectVector = function(e, t) {
  53933. console.warn("THREE.Projector: .projectVector() is now vector.project()."),
  53934. e.project(t)
  53935. }
  53936. ,
  53937. this.unprojectVector = function(e, t) {
  53938. console.warn("THREE.Projector: .unprojectVector() is now vector.unproject()."),
  53939. e.unproject(t)
  53940. }
  53941. ,
  53942. this.pickingRay = function(e, t) {
  53943. console.error("THREE.Projector: .pickingRay() is now raycaster.setFromCamera().")
  53944. }
  53945. }
  53946. ,
  53947. n.CanvasRenderer = function() {
  53948. console.error("THREE.CanvasRenderer has been moved to /examples/js/renderers/CanvasRenderer.js"),
  53949. this.domElement = document.createElement("canvas"),
  53950. this.clear = function() {}
  53951. ,
  53952. this.render = function() {}
  53953. ,
  53954. this.setClearColor = function() {}
  53955. ,
  53956. this.setSize = function() {}
  53957. }
  53958. ,
  53959. n.MeshFaceMaterial = n.MultiMaterial,
  53960. n.CurveUtils = {
  53961. tangentQuadraticBezier: function(e, t, i, n) {
  53962. return 2 * (1 - e) * (i - t) + 2 * e * (n - i)
  53963. },
  53964. tangentCubicBezier: function(e, t, i, n, r) {
  53965. 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
  53966. },
  53967. tangentSpline: function(e, t, i, n, r) {
  53968. var o = 6 * e * e - 6 * e
  53969. , a = 3 * e * e - 4 * e + 1
  53970. , s = -6 * e * e + 6 * e
  53971. , l = 3 * e * e - 2 * e;
  53972. return o + a + s + l
  53973. },
  53974. interpolate: function(e, t, i, n, r) {
  53975. var o = .5 * (i - e)
  53976. , a = .5 * (n - t)
  53977. , s = r * r
  53978. , l = r * s;
  53979. return (2 * t - 2 * i + o + a) * l + (-3 * t + 3 * i - 2 * o - a) * s + o * r + t
  53980. }
  53981. },
  53982. n.SceneUtils = {
  53983. createMultiMaterialObject: function(e, t) {
  53984. for (var i = new n.Group, r = 0, o = t.length; r < o; r++)
  53985. i.add(new n.Mesh(e,t[r]));
  53986. return i
  53987. },
  53988. detach: function(e, t, i) {
  53989. e.applyMatrix(t.matrixWorld),
  53990. t.remove(e),
  53991. i.add(e)
  53992. },
  53993. attach: function(e, t, i) {
  53994. var r = new n.Matrix4;
  53995. r.getInverse(i.matrixWorld),
  53996. e.applyMatrix(r),
  53997. t.remove(e),
  53998. i.add(e)
  53999. }
  54000. },
  54001. n.ShapeUtils = {
  54002. area: function(e) {
  54003. for (var t = e.length, i = 0, n = t - 1, r = 0; r < t; n = r++)
  54004. i += e[n].x * e[r].y - e[r].x * e[n].y;
  54005. return .5 * i
  54006. },
  54007. triangulate: function() {
  54008. function e(e, t, i, n, r, o) {
  54009. var a, s, l, c, h, u, d, p, f;
  54010. if (s = e[o[t]].x,
  54011. l = e[o[t]].y,
  54012. c = e[o[i]].x,
  54013. h = e[o[i]].y,
  54014. u = e[o[n]].x,
  54015. d = e[o[n]].y,
  54016. Number.EPSILON > (c - s) * (d - l) - (h - l) * (u - s))
  54017. return !1;
  54018. var g, m, v, A, y, C, I, E, b, w, _, T, x, S, M;
  54019. for (g = u - c,
  54020. m = d - h,
  54021. v = s - u,
  54022. A = l - d,
  54023. y = c - s,
  54024. C = h - l,
  54025. a = 0; a < r; a++)
  54026. if (p = e[o[a]].x,
  54027. f = e[o[a]].y,
  54028. !(p === s && f === l || p === c && f === h || p === u && f === d) && (I = p - s,
  54029. E = f - l,
  54030. b = p - c,
  54031. w = f - h,
  54032. _ = p - u,
  54033. T = f - d,
  54034. M = g * w - m * b,
  54035. x = y * E - C * I,
  54036. S = v * T - A * _,
  54037. M >= -Number.EPSILON && S >= -Number.EPSILON && x >= -Number.EPSILON))
  54038. return !1;
  54039. return !0
  54040. }
  54041. return function(t, i) {
  54042. var r = t.length;
  54043. if (r < 3)
  54044. return null;
  54045. var o, a, s, l = [], c = [], h = [];
  54046. if (n.ShapeUtils.area(t) > 0)
  54047. for (a = 0; a < r; a++)
  54048. c[a] = a;
  54049. else
  54050. for (a = 0; a < r; a++)
  54051. c[a] = r - 1 - a;
  54052. var u = r
  54053. , d = 2 * u;
  54054. for (a = u - 1; u > 2; ) {
  54055. if (d-- <= 0)
  54056. return console.warn("THREE.ShapeUtils: Unable to triangulate polygon! in triangulate()"),
  54057. i ? h : l;
  54058. if (o = a,
  54059. u <= o && (o = 0),
  54060. a = o + 1,
  54061. u <= a && (a = 0),
  54062. s = a + 1,
  54063. u <= s && (s = 0),
  54064. e(t, o, a, s, u, c)) {
  54065. var p, f, g, m, v;
  54066. for (p = c[o],
  54067. f = c[a],
  54068. g = c[s],
  54069. l.push([t[p], t[f], t[g]]),
  54070. h.push([c[o], c[a], c[s]]),
  54071. m = a,
  54072. v = a + 1; v < u; m++,
  54073. v++)
  54074. c[m] = c[v];
  54075. u--,
  54076. d = 2 * u
  54077. }
  54078. }
  54079. return i ? h : l
  54080. }
  54081. }(),
  54082. triangulateShape: function(e, t) {
  54083. function i(e, t, i) {
  54084. 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
  54085. }
  54086. function r(e, t, n, r, o) {
  54087. var a = t.x - e.x
  54088. , s = t.y - e.y
  54089. , l = r.x - n.x
  54090. , c = r.y - n.y
  54091. , h = e.x - n.x
  54092. , u = e.y - n.y
  54093. , d = s * l - a * c
  54094. , p = s * h - a * u;
  54095. if (Math.abs(d) > Number.EPSILON) {
  54096. var f;
  54097. if (d > 0) {
  54098. if (p < 0 || p > d)
  54099. return [];
  54100. if (f = c * h - l * u,
  54101. f < 0 || f > d)
  54102. return []
  54103. } else {
  54104. if (p > 0 || p < d)
  54105. return [];
  54106. if (f = c * h - l * u,
  54107. f > 0 || f < d)
  54108. return []
  54109. }
  54110. if (0 === f)
  54111. return !o || 0 !== p && p !== d ? [e] : [];
  54112. if (f === d)
  54113. return !o || 0 !== p && p !== d ? [t] : [];
  54114. if (0 === p)
  54115. return [n];
  54116. if (p === d)
  54117. return [r];
  54118. var g = f / d;
  54119. return [{
  54120. x: e.x + g * a,
  54121. y: e.y + g * s
  54122. }]
  54123. }
  54124. if (0 !== p || c * h !== l * u)
  54125. return [];
  54126. var m = 0 === a && 0 === s
  54127. , v = 0 === l && 0 === c;
  54128. if (m && v)
  54129. return e.x !== n.x || e.y !== n.y ? [] : [e];
  54130. if (m)
  54131. return i(n, r, e) ? [e] : [];
  54132. if (v)
  54133. return i(e, t, n) ? [n] : [];
  54134. var A, y, C, I, E, b, w, _;
  54135. return 0 !== a ? (e.x < t.x ? (A = e,
  54136. C = e.x,
  54137. y = t,
  54138. I = t.x) : (A = t,
  54139. C = t.x,
  54140. y = e,
  54141. I = e.x),
  54142. n.x < r.x ? (E = n,
  54143. w = n.x,
  54144. b = r,
  54145. _ = r.x) : (E = r,
  54146. w = r.x,
  54147. b = n,
  54148. _ = n.x)) : (e.y < t.y ? (A = e,
  54149. C = e.y,
  54150. y = t,
  54151. I = t.y) : (A = t,
  54152. C = t.y,
  54153. y = e,
  54154. I = e.y),
  54155. n.y < r.y ? (E = n,
  54156. w = n.y,
  54157. b = r,
  54158. _ = r.y) : (E = r,
  54159. w = r.y,
  54160. b = n,
  54161. _ = n.y)),
  54162. C <= w ? I < w ? [] : I === w ? o ? [] : [E] : I <= _ ? [E, y] : [E, b] : C > _ ? [] : C === _ ? o ? [] : [A] : I <= _ ? [A, y] : [A, b]
  54163. }
  54164. function o(e, t, i, n) {
  54165. var r = t.x - e.x
  54166. , o = t.y - e.y
  54167. , a = i.x - e.x
  54168. , s = i.y - e.y
  54169. , l = n.x - e.x
  54170. , c = n.y - e.y
  54171. , h = r * s - o * a
  54172. , u = r * c - o * l;
  54173. if (Math.abs(h) > Number.EPSILON) {
  54174. var d = l * s - c * a;
  54175. return h > 0 ? u >= 0 && d >= 0 : u >= 0 || d >= 0
  54176. }
  54177. return u > 0
  54178. }
  54179. function a(e, t) {
  54180. function i(e, t) {
  54181. var i = A.length - 1
  54182. , n = e - 1;
  54183. n < 0 && (n = i);
  54184. var r = e + 1;
  54185. r > i && (r = 0);
  54186. var a = o(A[e], A[n], A[r], s[t]);
  54187. if (!a)
  54188. return !1;
  54189. var l = s.length - 1
  54190. , c = t - 1;
  54191. c < 0 && (c = l);
  54192. var h = t + 1;
  54193. return h > l && (h = 0),
  54194. a = o(s[t], s[c], s[h], A[e]),
  54195. !!a
  54196. }
  54197. function n(e, t) {
  54198. var i, n, o;
  54199. for (i = 0; i < A.length; i++)
  54200. if (n = i + 1,
  54201. n %= A.length,
  54202. o = r(e, t, A[i], A[n], !0),
  54203. o.length > 0)
  54204. return !0;
  54205. return !1
  54206. }
  54207. function a(e, i) {
  54208. var n, o, a, s, l;
  54209. for (n = 0; n < y.length; n++)
  54210. for (o = t[y[n]],
  54211. a = 0; a < o.length; a++)
  54212. if (s = a + 1,
  54213. s %= o.length,
  54214. l = r(e, i, o[a], o[s], !0),
  54215. l.length > 0)
  54216. return !0;
  54217. return !1
  54218. }
  54219. 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++)
  54220. y.push(I);
  54221. for (var b = 0, w = 2 * y.length; y.length > 0; ) {
  54222. if (w--,
  54223. w < 0) {
  54224. console.log("Infinite Loop! Holes left:" + y.length + ", Probably Hole outside Shape!");
  54225. break
  54226. }
  54227. for (c = b; c < A.length; c++) {
  54228. h = A[c],
  54229. l = -1;
  54230. for (var I = 0; I < y.length; I++)
  54231. if (d = y[I],
  54232. p = h.x + ":" + h.y + ":" + d,
  54233. void 0 === C[p]) {
  54234. s = t[d];
  54235. for (var _ = 0; _ < s.length; _++)
  54236. if (u = s[_],
  54237. i(c, _) && !n(h, u) && !a(h, u)) {
  54238. l = _,
  54239. y.splice(I, 1),
  54240. f = A.slice(0, c + 1),
  54241. g = A.slice(c),
  54242. m = s.slice(l),
  54243. v = s.slice(0, l + 1),
  54244. A = f.concat(m).concat(v).concat(g),
  54245. b = c;
  54246. break
  54247. }
  54248. if (l >= 0)
  54249. break;
  54250. C[p] = !0
  54251. }
  54252. if (l >= 0)
  54253. break
  54254. }
  54255. }
  54256. return A
  54257. }
  54258. for (var s, l, c, h, u, d, p = {}, f = e.concat(), g = 0, m = t.length; g < m; g++)
  54259. Array.prototype.push.apply(f, t[g]);
  54260. for (s = 0,
  54261. l = f.length; s < l; s++)
  54262. u = f[s].x + ":" + f[s].y,
  54263. void 0 !== p[u] && console.warn("THREE.Shape: Duplicate point", u),
  54264. p[u] = s;
  54265. var v = a(e, t)
  54266. , A = n.ShapeUtils.triangulate(v, !1);
  54267. for (s = 0,
  54268. l = A.length; s < l; s++)
  54269. for (h = A[s],
  54270. c = 0; c < 3; c++)
  54271. u = h[c].x + ":" + h[c].y,
  54272. d = p[u],
  54273. void 0 !== d && (h[c] = d);
  54274. return A.concat()
  54275. },
  54276. isClockWise: function(e) {
  54277. return n.ShapeUtils.area(e) < 0
  54278. },
  54279. b2: function() {
  54280. function e(e, t) {
  54281. var i = 1 - e;
  54282. return i * i * t
  54283. }
  54284. function t(e, t) {
  54285. return 2 * (1 - e) * e * t
  54286. }
  54287. function i(e, t) {
  54288. return e * e * t
  54289. }
  54290. return function(n, r, o, a) {
  54291. return e(n, r) + t(n, o) + i(n, a)
  54292. }
  54293. }(),
  54294. b3: function() {
  54295. function e(e, t) {
  54296. var i = 1 - e;
  54297. return i * i * i * t
  54298. }
  54299. function t(e, t) {
  54300. var i = 1 - e;
  54301. return 3 * i * i * e * t
  54302. }
  54303. function i(e, t) {
  54304. var i = 1 - e;
  54305. return 3 * i * e * e * t
  54306. }
  54307. function n(e, t) {
  54308. return e * e * e * t
  54309. }
  54310. return function(r, o, a, s, l) {
  54311. return e(r, o) + t(r, a) + i(r, s) + n(r, l)
  54312. }
  54313. }()
  54314. },
  54315. n.Curve = function() {}
  54316. ,
  54317. n.Curve.prototype = {
  54318. constructor: n.Curve,
  54319. getPoint: function(e) {
  54320. return console.warn("THREE.Curve: Warning, getPoint() not implemented!"),
  54321. null
  54322. },
  54323. getPointAt: function(e) {
  54324. var t = this.getUtoTmapping(e);
  54325. return this.getPoint(t)
  54326. },
  54327. getPoints: function(e) {
  54328. e || (e = 5);
  54329. var t, i = [];
  54330. for (t = 0; t <= e; t++)
  54331. i.push(this.getPoint(t / e));
  54332. return i
  54333. },
  54334. getSpacedPoints: function(e) {
  54335. e || (e = 5);
  54336. var t, i = [];
  54337. for (t = 0; t <= e; t++)
  54338. i.push(this.getPointAt(t / e));
  54339. return i
  54340. },
  54341. getLength: function() {
  54342. var e = this.getLengths();
  54343. return e[e.length - 1]
  54344. },
  54345. getLengths: function(e) {
  54346. if (e || (e = this.__arcLengthDivisions ? this.__arcLengthDivisions : 200),
  54347. this.cacheArcLengths && this.cacheArcLengths.length === e + 1 && !this.needsUpdate)
  54348. return this.cacheArcLengths;
  54349. this.needsUpdate = !1;
  54350. var t, i, n = [], r = this.getPoint(0), o = 0;
  54351. for (n.push(0),
  54352. i = 1; i <= e; i++)
  54353. t = this.getPoint(i / e),
  54354. o += t.distanceTo(r),
  54355. n.push(o),
  54356. r = t;
  54357. return this.cacheArcLengths = n,
  54358. n
  54359. },
  54360. updateArcLengths: function() {
  54361. this.needsUpdate = !0,
  54362. this.getLengths()
  54363. },
  54364. getUtoTmapping: function(e, t) {
  54365. var i, n = this.getLengths(), r = 0, o = n.length;
  54366. i = t ? t : e * n[o - 1];
  54367. for (var a, s = 0, l = o - 1; s <= l; )
  54368. if (r = Math.floor(s + (l - s) / 2),
  54369. a = n[r] - i,
  54370. a < 0)
  54371. s = r + 1;
  54372. else {
  54373. if (!(a > 0)) {
  54374. l = r;
  54375. break
  54376. }
  54377. l = r - 1
  54378. }
  54379. if (r = l,
  54380. n[r] === i) {
  54381. var c = r / (o - 1);
  54382. return c
  54383. }
  54384. var h = n[r]
  54385. , u = n[r + 1]
  54386. , d = u - h
  54387. , p = (i - h) / d
  54388. , c = (r + p) / (o - 1);
  54389. return c
  54390. },
  54391. getTangent: function(e) {
  54392. var t = 1e-4
  54393. , i = e - t
  54394. , n = e + t;
  54395. i < 0 && (i = 0),
  54396. n > 1 && (n = 1);
  54397. var r = this.getPoint(i)
  54398. , o = this.getPoint(n)
  54399. , a = o.clone().sub(r);
  54400. return a.normalize()
  54401. },
  54402. getTangentAt: function(e) {
  54403. var t = this.getUtoTmapping(e);
  54404. return this.getTangent(t)
  54405. }
  54406. },
  54407. n.Curve.create = function(e, t) {
  54408. return e.prototype = Object.create(n.Curve.prototype),
  54409. e.prototype.constructor = e,
  54410. e.prototype.getPoint = t,
  54411. e
  54412. }
  54413. ,
  54414. n.CurvePath = function() {
  54415. this.curves = [],
  54416. this.autoClose = !1
  54417. }
  54418. ,
  54419. n.CurvePath.prototype = Object.create(n.Curve.prototype),
  54420. n.CurvePath.prototype.constructor = n.CurvePath,
  54421. n.CurvePath.prototype.add = function(e) {
  54422. this.curves.push(e)
  54423. }
  54424. ,
  54425. n.CurvePath.prototype.closePath = function() {
  54426. var e = this.curves[0].getPoint(0)
  54427. , t = this.curves[this.curves.length - 1].getPoint(1);
  54428. e.equals(t) || this.curves.push(new n.LineCurve(t,e))
  54429. }
  54430. ,
  54431. n.CurvePath.prototype.getPoint = function(e) {
  54432. for (var t = e * this.getLength(), i = this.getCurveLengths(), n = 0; n < i.length; ) {
  54433. if (i[n] >= t) {
  54434. var r = i[n] - t
  54435. , o = this.curves[n]
  54436. , a = 1 - r / o.getLength();
  54437. return o.getPointAt(a)
  54438. }
  54439. n++
  54440. }
  54441. return null
  54442. }
  54443. ,
  54444. n.CurvePath.prototype.getLength = function() {
  54445. var e = this.getCurveLengths();
  54446. return e[e.length - 1]
  54447. }
  54448. ,
  54449. n.CurvePath.prototype.getCurveLengths = function() {
  54450. if (this.cacheLengths && this.cacheLengths.length === this.curves.length)
  54451. return this.cacheLengths;
  54452. for (var e = [], t = 0, i = 0, n = this.curves.length; i < n; i++)
  54453. t += this.curves[i].getLength(),
  54454. e.push(t);
  54455. return this.cacheLengths = e,
  54456. e
  54457. }
  54458. ,
  54459. n.CurvePath.prototype.createPointsGeometry = function(e) {
  54460. var t = this.getPoints(e);
  54461. return this.createGeometry(t)
  54462. }
  54463. ,
  54464. n.CurvePath.prototype.createSpacedPointsGeometry = function(e) {
  54465. var t = this.getSpacedPoints(e);
  54466. return this.createGeometry(t)
  54467. }
  54468. ,
  54469. n.CurvePath.prototype.createGeometry = function(e) {
  54470. for (var t = new n.Geometry, i = 0, r = e.length; i < r; i++) {
  54471. var o = e[i];
  54472. t.vertices.push(new n.Vector3(o.x,o.y,o.z || 0))
  54473. }
  54474. return t
  54475. }
  54476. ,
  54477. n.Font = function(e) {
  54478. this.data = e
  54479. }
  54480. ,
  54481. n.Font.prototype = {
  54482. constructor: n.Font,
  54483. generateShapes: function(e, t, i) {
  54484. function r(e) {
  54485. for (var i = String(e).split(""), n = t / a.resolution, r = 0, s = [], l = 0; l < i.length; l++) {
  54486. var c = o(i[l], n, r);
  54487. r += c.offset,
  54488. s.push(c.path)
  54489. }
  54490. return s
  54491. }
  54492. function o(e, t, r) {
  54493. var o = a.glyphs[e] || a.glyphs["?"];
  54494. if (o) {
  54495. 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;
  54496. if (o.o)
  54497. for (var E = o._cachedOutline || (o._cachedOutline = o.o.split(" ")), b = 0, w = E.length; b < w; ) {
  54498. var _ = E[b++];
  54499. switch (_) {
  54500. case "m":
  54501. s = E[b++] * t + r,
  54502. l = E[b++] * t,
  54503. A.moveTo(s, l);
  54504. break;
  54505. case "l":
  54506. s = E[b++] * t + r,
  54507. l = E[b++] * t,
  54508. A.lineTo(s, l);
  54509. break;
  54510. case "q":
  54511. if (c = E[b++] * t + r,
  54512. h = E[b++] * t,
  54513. p = E[b++] * t + r,
  54514. f = E[b++] * t,
  54515. A.quadraticCurveTo(p, f, c, h),
  54516. v = y[y.length - 1]) {
  54517. u = v.x,
  54518. d = v.y;
  54519. for (var T = 1; T <= i; T++) {
  54520. var x = T / i;
  54521. C(x, u, p, c),
  54522. C(x, d, f, h)
  54523. }
  54524. }
  54525. break;
  54526. case "b":
  54527. if (c = E[b++] * t + r,
  54528. h = E[b++] * t,
  54529. p = E[b++] * t + r,
  54530. f = E[b++] * t,
  54531. g = E[b++] * t + r,
  54532. m = E[b++] * t,
  54533. A.bezierCurveTo(p, f, g, m, c, h),
  54534. v = y[y.length - 1]) {
  54535. u = v.x,
  54536. d = v.y;
  54537. for (var T = 1; T <= i; T++) {
  54538. var x = T / i;
  54539. I(x, u, p, g, c),
  54540. I(x, d, f, m, h)
  54541. }
  54542. }
  54543. }
  54544. }
  54545. return {
  54546. offset: o.ha * t,
  54547. path: A
  54548. }
  54549. }
  54550. }
  54551. void 0 === t && (t = 100),
  54552. void 0 === i && (i = 4);
  54553. for (var a = this.data, s = r(e), l = [], c = 0, h = s.length; c < h; c++)
  54554. Array.prototype.push.apply(l, s[c].toShapes());
  54555. return l
  54556. }
  54557. },
  54558. n.Path = function(e) {
  54559. n.CurvePath.call(this),
  54560. this.actions = [],
  54561. e && this.fromPoints(e)
  54562. }
  54563. ,
  54564. n.Path.prototype = Object.create(n.CurvePath.prototype),
  54565. n.Path.prototype.constructor = n.Path,
  54566. n.Path.prototype.fromPoints = function(e) {
  54567. this.moveTo(e[0].x, e[0].y);
  54568. for (var t = 1, i = e.length; t < i; t++)
  54569. this.lineTo(e[t].x, e[t].y)
  54570. }
  54571. ,
  54572. n.Path.prototype.moveTo = function(e, t) {
  54573. this.actions.push({
  54574. action: "moveTo",
  54575. args: [e, t]
  54576. })
  54577. }
  54578. ,
  54579. n.Path.prototype.lineTo = function(e, t) {
  54580. var i = this.actions[this.actions.length - 1].args
  54581. , r = i[i.length - 2]
  54582. , o = i[i.length - 1]
  54583. , a = new n.LineCurve(new n.Vector2(r,o),new n.Vector2(e,t));
  54584. this.curves.push(a),
  54585. this.actions.push({
  54586. action: "lineTo",
  54587. args: [e, t]
  54588. })
  54589. }
  54590. ,
  54591. n.Path.prototype.quadraticCurveTo = function(e, t, i, r) {
  54592. var o = this.actions[this.actions.length - 1].args
  54593. , a = o[o.length - 2]
  54594. , s = o[o.length - 1]
  54595. , l = new n.QuadraticBezierCurve(new n.Vector2(a,s),new n.Vector2(e,t),new n.Vector2(i,r));
  54596. this.curves.push(l),
  54597. this.actions.push({
  54598. action: "quadraticCurveTo",
  54599. args: [e, t, i, r]
  54600. })
  54601. }
  54602. ,
  54603. n.Path.prototype.bezierCurveTo = function(e, t, i, r, o, a) {
  54604. var s = this.actions[this.actions.length - 1].args
  54605. , l = s[s.length - 2]
  54606. , c = s[s.length - 1]
  54607. , h = new n.CubicBezierCurve(new n.Vector2(l,c),new n.Vector2(e,t),new n.Vector2(i,r),new n.Vector2(o,a));
  54608. this.curves.push(h),
  54609. this.actions.push({
  54610. action: "bezierCurveTo",
  54611. args: [e, t, i, r, o, a]
  54612. })
  54613. }
  54614. ,
  54615. n.Path.prototype.splineThru = function(e) {
  54616. var t = Array.prototype.slice.call(arguments)
  54617. , i = this.actions[this.actions.length - 1].args
  54618. , r = i[i.length - 2]
  54619. , o = i[i.length - 1]
  54620. , a = [new n.Vector2(r,o)];
  54621. Array.prototype.push.apply(a, e);
  54622. var s = new n.SplineCurve(a);
  54623. this.curves.push(s),
  54624. this.actions.push({
  54625. action: "splineThru",
  54626. args: t
  54627. })
  54628. }
  54629. ,
  54630. n.Path.prototype.arc = function(e, t, i, n, r, o) {
  54631. var a = this.actions[this.actions.length - 1].args
  54632. , s = a[a.length - 2]
  54633. , l = a[a.length - 1];
  54634. this.absarc(e + s, t + l, i, n, r, o)
  54635. }
  54636. ,
  54637. n.Path.prototype.absarc = function(e, t, i, n, r, o) {
  54638. this.absellipse(e, t, i, i, n, r, o)
  54639. }
  54640. ,
  54641. n.Path.prototype.ellipse = function(e, t, i, n, r, o, a, s) {
  54642. var l = this.actions[this.actions.length - 1].args
  54643. , c = l[l.length - 2]
  54644. , h = l[l.length - 1];
  54645. this.absellipse(e + c, t + h, i, n, r, o, a, s)
  54646. }
  54647. ,
  54648. n.Path.prototype.absellipse = function(e, t, i, r, o, a, s, l) {
  54649. var c = [e, t, i, r, o, a, s, l || 0]
  54650. , h = new n.EllipseCurve(e,t,i,r,o,a,s,l);
  54651. this.curves.push(h);
  54652. var u = h.getPoint(1);
  54653. c.push(u.x),
  54654. c.push(u.y),
  54655. this.actions.push({
  54656. action: "ellipse",
  54657. args: c
  54658. })
  54659. }
  54660. ,
  54661. n.Path.prototype.getSpacedPoints = function(e) {
  54662. e || (e = 40);
  54663. for (var t = [], i = 0; i < e; i++)
  54664. t.push(this.getPoint(i / e));
  54665. return this.autoClose && t.push(t[0]),
  54666. t
  54667. }
  54668. ,
  54669. n.Path.prototype.getPoints = function(e) {
  54670. e = e || 12;
  54671. 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++) {
  54672. var A = this.actions[m]
  54673. , y = A.action
  54674. , C = A.args;
  54675. switch (y) {
  54676. case "moveTo":
  54677. g.push(new n.Vector2(C[0],C[1]));
  54678. break;
  54679. case "lineTo":
  54680. g.push(new n.Vector2(C[0],C[1]));
  54681. break;
  54682. case "quadraticCurveTo":
  54683. t = C[2],
  54684. i = C[3],
  54685. a = C[0],
  54686. s = C[1],
  54687. g.length > 0 ? (h = g[g.length - 1],
  54688. l = h.x,
  54689. c = h.y) : (h = this.actions[m - 1].args,
  54690. l = h[h.length - 2],
  54691. c = h[h.length - 1]);
  54692. for (var I = 1; I <= e; I++) {
  54693. var E = I / e;
  54694. u = p(E, l, a, t),
  54695. d = p(E, c, s, i),
  54696. g.push(new n.Vector2(u,d))
  54697. }
  54698. break;
  54699. case "bezierCurveTo":
  54700. t = C[4],
  54701. i = C[5],
  54702. a = C[0],
  54703. s = C[1],
  54704. r = C[2],
  54705. o = C[3],
  54706. g.length > 0 ? (h = g[g.length - 1],
  54707. l = h.x,
  54708. c = h.y) : (h = this.actions[m - 1].args,
  54709. l = h[h.length - 2],
  54710. c = h[h.length - 1]);
  54711. for (var I = 1; I <= e; I++) {
  54712. var E = I / e;
  54713. u = f(E, l, a, r, t),
  54714. d = f(E, c, s, o, i),
  54715. g.push(new n.Vector2(u,d))
  54716. }
  54717. break;
  54718. case "splineThru":
  54719. h = this.actions[m - 1].args;
  54720. var b = new n.Vector2(h[h.length - 2],h[h.length - 1])
  54721. , w = [b]
  54722. , _ = e * C[0].length;
  54723. w = w.concat(C[0]);
  54724. for (var T = new n.SplineCurve(w), I = 1; I <= _; I++)
  54725. g.push(T.getPointAt(I / _));
  54726. break;
  54727. case "arc":
  54728. 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++) {
  54729. var E = I / N;
  54730. L || (E = 1 - E),
  54731. x = P + E * D,
  54732. u = S + R * Math.cos(x),
  54733. d = M + R * Math.sin(x),
  54734. g.push(new n.Vector2(u,d))
  54735. }
  54736. break;
  54737. case "ellipse":
  54738. 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;
  54739. 0 !== k && (B = Math.cos(k),
  54740. F = Math.sin(k));
  54741. for (var I = 1; I <= N; I++) {
  54742. var E = I / N;
  54743. if (L || (E = 1 - E),
  54744. x = P + E * D,
  54745. u = S + V * Math.cos(x),
  54746. d = M + U * Math.sin(x),
  54747. 0 !== k) {
  54748. var H = u
  54749. , G = d;
  54750. u = (H - S) * B - (G - M) * F + S,
  54751. d = (H - S) * F + (G - M) * B + M
  54752. }
  54753. g.push(new n.Vector2(u,d))
  54754. }
  54755. }
  54756. }
  54757. var z = g[g.length - 1];
  54758. 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),
  54759. this.autoClose && g.push(g[0]),
  54760. g
  54761. }
  54762. ,
  54763. n.Path.prototype.toShapes = function(e, t) {
  54764. function i(e) {
  54765. for (var t = [], i = new n.Path, r = 0, o = e.length; r < o; r++) {
  54766. var a = e[r]
  54767. , s = a.args
  54768. , l = a.action;
  54769. "moveTo" === l && 0 !== i.actions.length && (t.push(i),
  54770. i = new n.Path),
  54771. i[l].apply(i, s)
  54772. }
  54773. return 0 !== i.actions.length && t.push(i),
  54774. t
  54775. }
  54776. function r(e) {
  54777. for (var t = [], i = 0, r = e.length; i < r; i++) {
  54778. var o = e[i]
  54779. , a = new n.Shape;
  54780. a.actions = o.actions,
  54781. a.curves = o.curves,
  54782. t.push(a)
  54783. }
  54784. return t
  54785. }
  54786. function o(e, t) {
  54787. for (var i = t.length, n = !1, r = i - 1, o = 0; o < i; r = o++) {
  54788. var a = t[r]
  54789. , s = t[o]
  54790. , l = s.x - a.x
  54791. , c = s.y - a.y;
  54792. if (Math.abs(c) > Number.EPSILON) {
  54793. if (c < 0 && (a = t[o],
  54794. l = -l,
  54795. s = t[r],
  54796. c = -c),
  54797. e.y < a.y || e.y > s.y)
  54798. continue;
  54799. if (e.y === a.y) {
  54800. if (e.x === a.x)
  54801. return !0
  54802. } else {
  54803. var h = c * (e.x - a.x) - l * (e.y - a.y);
  54804. if (0 === h)
  54805. return !0;
  54806. if (h < 0)
  54807. continue;
  54808. n = !n
  54809. }
  54810. } else {
  54811. if (e.y !== a.y)
  54812. continue;
  54813. if (s.x <= e.x && e.x <= a.x || a.x <= e.x && e.x <= s.x)
  54814. return !0
  54815. }
  54816. }
  54817. return n
  54818. }
  54819. var a = n.ShapeUtils.isClockWise
  54820. , s = i(this.actions);
  54821. if (0 === s.length)
  54822. return [];
  54823. if (t === !0)
  54824. return r(s);
  54825. var l, c, h, u = [];
  54826. if (1 === s.length)
  54827. return c = s[0],
  54828. h = new n.Shape,
  54829. h.actions = c.actions,
  54830. h.curves = c.curves,
  54831. u.push(h),
  54832. u;
  54833. var d = !a(s[0].getPoints());
  54834. d = e ? !d : d;
  54835. var p, f = [], g = [], m = [], v = 0;
  54836. g[v] = void 0,
  54837. m[v] = [];
  54838. for (var A = 0, y = s.length; A < y; A++)
  54839. c = s[A],
  54840. p = c.getPoints(),
  54841. l = a(p),
  54842. l = e ? !l : l,
  54843. l ? (!d && g[v] && v++,
  54844. g[v] = {
  54845. s: new n.Shape,
  54846. p: p
  54847. },
  54848. g[v].s.actions = c.actions,
  54849. g[v].s.curves = c.curves,
  54850. d && v++,
  54851. m[v] = []) : m[v].push({
  54852. h: c,
  54853. p: p[0]
  54854. });
  54855. if (!g[0])
  54856. return r(s);
  54857. if (g.length > 1) {
  54858. for (var C = !1, I = [], E = 0, b = g.length; E < b; E++)
  54859. f[E] = [];
  54860. for (var E = 0, b = g.length; E < b; E++)
  54861. for (var w = m[E], _ = 0; _ < w.length; _++) {
  54862. for (var T = w[_], x = !0, S = 0; S < g.length; S++)
  54863. o(T.p, g[S].p) && (E !== S && I.push({
  54864. froms: E,
  54865. tos: S,
  54866. hole: _
  54867. }),
  54868. x ? (x = !1,
  54869. f[S].push(T)) : C = !0);
  54870. x && f[E].push(T)
  54871. }
  54872. I.length > 0 && (C || (m = f))
  54873. }
  54874. for (var M, A = 0, R = g.length; A < R; A++) {
  54875. h = g[A].s,
  54876. u.push(h),
  54877. M = m[A];
  54878. for (var P = 0, O = M.length; P < O; P++)
  54879. h.holes.push(M[P].h)
  54880. }
  54881. return u
  54882. }
  54883. ,
  54884. n.Shape = function() {
  54885. n.Path.apply(this, arguments),
  54886. this.holes = []
  54887. }
  54888. ,
  54889. n.Shape.prototype = Object.create(n.Path.prototype),
  54890. n.Shape.prototype.constructor = n.Shape,
  54891. n.Shape.prototype.extrude = function(e) {
  54892. return new n.ExtrudeGeometry(this,e)
  54893. }
  54894. ,
  54895. n.Shape.prototype.makeGeometry = function(e) {
  54896. return new n.ShapeGeometry(this,e)
  54897. }
  54898. ,
  54899. n.Shape.prototype.getPointsHoles = function(e) {
  54900. for (var t = [], i = 0, n = this.holes.length; i < n; i++)
  54901. t[i] = this.holes[i].getPoints(e);
  54902. return t
  54903. }
  54904. ,
  54905. n.Shape.prototype.extractAllPoints = function(e) {
  54906. return {
  54907. shape: this.getPoints(e),
  54908. holes: this.getPointsHoles(e)
  54909. }
  54910. }
  54911. ,
  54912. n.Shape.prototype.extractPoints = function(e) {
  54913. return this.extractAllPoints(e)
  54914. }
  54915. ,
  54916. n.LineCurve = function(e, t) {
  54917. this.v1 = e,
  54918. this.v2 = t
  54919. }
  54920. ,
  54921. n.LineCurve.prototype = Object.create(n.Curve.prototype),
  54922. n.LineCurve.prototype.constructor = n.LineCurve,
  54923. n.LineCurve.prototype.getPoint = function(e) {
  54924. var t = this.v2.clone().sub(this.v1);
  54925. return t.multiplyScalar(e).add(this.v1),
  54926. t
  54927. }
  54928. ,
  54929. n.LineCurve.prototype.getPointAt = function(e) {
  54930. return this.getPoint(e)
  54931. }
  54932. ,
  54933. n.LineCurve.prototype.getTangent = function(e) {
  54934. var t = this.v2.clone().sub(this.v1);
  54935. return t.normalize()
  54936. }
  54937. ,
  54938. n.QuadraticBezierCurve = function(e, t, i) {
  54939. this.v0 = e,
  54940. this.v1 = t,
  54941. this.v2 = i
  54942. }
  54943. ,
  54944. n.QuadraticBezierCurve.prototype = Object.create(n.Curve.prototype),
  54945. n.QuadraticBezierCurve.prototype.constructor = n.QuadraticBezierCurve,
  54946. n.QuadraticBezierCurve.prototype.getPoint = function(e) {
  54947. var t = n.ShapeUtils.b2;
  54948. 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))
  54949. }
  54950. ,
  54951. n.QuadraticBezierCurve.prototype.getTangent = function(e) {
  54952. var t = n.CurveUtils.tangentQuadraticBezier;
  54953. 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()
  54954. }
  54955. ,
  54956. n.CubicBezierCurve = function(e, t, i, n) {
  54957. this.v0 = e,
  54958. this.v1 = t,
  54959. this.v2 = i,
  54960. this.v3 = n
  54961. }
  54962. ,
  54963. n.CubicBezierCurve.prototype = Object.create(n.Curve.prototype),
  54964. n.CubicBezierCurve.prototype.constructor = n.CubicBezierCurve,
  54965. n.CubicBezierCurve.prototype.getPoint = function(e) {
  54966. var t = n.ShapeUtils.b3;
  54967. 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))
  54968. }
  54969. ,
  54970. n.CubicBezierCurve.prototype.getTangent = function(e) {
  54971. var t = n.CurveUtils.tangentCubicBezier;
  54972. 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()
  54973. }
  54974. ,
  54975. n.SplineCurve = function(e) {
  54976. this.points = void 0 == e ? [] : e
  54977. }
  54978. ,
  54979. n.SplineCurve.prototype = Object.create(n.Curve.prototype),
  54980. n.SplineCurve.prototype.constructor = n.SplineCurve,
  54981. n.SplineCurve.prototype.getPoint = function(e) {
  54982. var t = this.points
  54983. , i = (t.length - 1) * e
  54984. , r = Math.floor(i)
  54985. , o = i - r
  54986. , a = t[0 === r ? r : r - 1]
  54987. , s = t[r]
  54988. , l = t[r > t.length - 2 ? t.length - 1 : r + 1]
  54989. , c = t[r > t.length - 3 ? t.length - 1 : r + 2]
  54990. , h = n.CurveUtils.interpolate;
  54991. return new n.Vector2(h(a.x, s.x, l.x, c.x, o),h(a.y, s.y, l.y, c.y, o))
  54992. }
  54993. ,
  54994. n.EllipseCurve = function(e, t, i, n, r, o, a, s) {
  54995. this.aX = e,
  54996. this.aY = t,
  54997. this.xRadius = i,
  54998. this.yRadius = n,
  54999. this.aStartAngle = r,
  55000. this.aEndAngle = o,
  55001. this.aClockwise = a,
  55002. this.aRotation = s || 0
  55003. }
  55004. ,
  55005. n.EllipseCurve.prototype = Object.create(n.Curve.prototype),
  55006. n.EllipseCurve.prototype.constructor = n.EllipseCurve,
  55007. n.EllipseCurve.prototype.getPoint = function(e) {
  55008. var t = this.aEndAngle - this.aStartAngle;
  55009. t < 0 && (t += 2 * Math.PI),
  55010. t > 2 * Math.PI && (t -= 2 * Math.PI);
  55011. var i;
  55012. i = this.aClockwise === !0 ? this.aEndAngle + (1 - e) * (2 * Math.PI - t) : this.aStartAngle + e * t;
  55013. var r = this.aX + this.xRadius * Math.cos(i)
  55014. , o = this.aY + this.yRadius * Math.sin(i);
  55015. if (0 !== this.aRotation) {
  55016. var a = Math.cos(this.aRotation)
  55017. , s = Math.sin(this.aRotation)
  55018. , l = r
  55019. , c = o;
  55020. r = (l - this.aX) * a - (c - this.aY) * s + this.aX,
  55021. o = (l - this.aX) * s + (c - this.aY) * a + this.aY
  55022. }
  55023. return new n.Vector2(r,o)
  55024. }
  55025. ,
  55026. n.ArcCurve = function(e, t, i, r, o, a) {
  55027. n.EllipseCurve.call(this, e, t, i, i, r, o, a)
  55028. }
  55029. ,
  55030. n.ArcCurve.prototype = Object.create(n.EllipseCurve.prototype),
  55031. n.ArcCurve.prototype.constructor = n.ArcCurve,
  55032. n.LineCurve3 = n.Curve.create(function(e, t) {
  55033. this.v1 = e,
  55034. this.v2 = t
  55035. }, function(e) {
  55036. var t = new n.Vector3;
  55037. return t.subVectors(this.v2, this.v1),
  55038. t.multiplyScalar(e),
  55039. t.add(this.v1),
  55040. t
  55041. }),
  55042. n.QuadraticBezierCurve3 = n.Curve.create(function(e, t, i) {
  55043. this.v0 = e,
  55044. this.v1 = t,
  55045. this.v2 = i
  55046. }, function(e) {
  55047. var t = n.ShapeUtils.b2;
  55048. 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))
  55049. }),
  55050. n.CubicBezierCurve3 = n.Curve.create(function(e, t, i, n) {
  55051. this.v0 = e,
  55052. this.v1 = t,
  55053. this.v2 = i,
  55054. this.v3 = n
  55055. }, function(e) {
  55056. var t = n.ShapeUtils.b3;
  55057. 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))
  55058. }),
  55059. n.SplineCurve3 = n.Curve.create(function(e) {
  55060. console.warn("THREE.SplineCurve3 will be deprecated. Please use THREE.CatmullRomCurve3"),
  55061. this.points = void 0 == e ? [] : e
  55062. }, function(e) {
  55063. var t = this.points
  55064. , i = (t.length - 1) * e
  55065. , r = Math.floor(i)
  55066. , o = i - r
  55067. , a = t[0 == r ? r : r - 1]
  55068. , s = t[r]
  55069. , l = t[r > t.length - 2 ? t.length - 1 : r + 1]
  55070. , c = t[r > t.length - 3 ? t.length - 1 : r + 2]
  55071. , h = n.CurveUtils.interpolate;
  55072. 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))
  55073. }),
  55074. n.CatmullRomCurve3 = function() {
  55075. function e() {}
  55076. var t = new n.Vector3
  55077. , i = new e
  55078. , r = new e
  55079. , o = new e;
  55080. return e.prototype.init = function(e, t, i, n) {
  55081. this.c0 = e,
  55082. this.c1 = i,
  55083. this.c2 = -3 * e + 3 * t - 2 * i - n,
  55084. this.c3 = 2 * e - 2 * t + i + n
  55085. }
  55086. ,
  55087. e.prototype.initNonuniformCatmullRom = function(e, t, i, n, r, o, a) {
  55088. var s = (t - e) / r - (i - e) / (r + o) + (i - t) / o
  55089. , l = (i - t) / o - (n - t) / (o + a) + (n - i) / a;
  55090. s *= o,
  55091. l *= o,
  55092. this.init(t, i, s, l)
  55093. }
  55094. ,
  55095. e.prototype.initCatmullRom = function(e, t, i, n, r) {
  55096. this.init(t, i, r * (i - e), r * (n - t))
  55097. }
  55098. ,
  55099. e.prototype.calc = function(e) {
  55100. var t = e * e
  55101. , i = t * e;
  55102. return this.c0 + this.c1 * e + this.c2 * t + this.c3 * i
  55103. }
  55104. ,
  55105. n.Curve.create(function(e) {
  55106. this.points = e || [],
  55107. this.closed = !1
  55108. }, function(e) {
  55109. var a, s, l, c, h = this.points;
  55110. c = h.length,
  55111. c < 2 && console.log("duh, you need at least 2 points"),
  55112. a = (c - (this.closed ? 0 : 1)) * e,
  55113. s = Math.floor(a),
  55114. l = a - s,
  55115. this.closed ? s += s > 0 ? 0 : (Math.floor(Math.abs(s) / h.length) + 1) * h.length : 0 === l && s === c - 1 && (s = c - 2,
  55116. l = 1);
  55117. var u, d, p, f;
  55118. if (this.closed || s > 0 ? u = h[(s - 1) % c] : (t.subVectors(h[0], h[1]).add(h[0]),
  55119. u = t),
  55120. d = h[s % c],
  55121. p = h[(s + 1) % c],
  55122. this.closed || s + 2 < c ? f = h[(s + 2) % c] : (t.subVectors(h[c - 1], h[c - 2]).add(h[c - 1]),
  55123. f = t),
  55124. void 0 === this.type || "centripetal" === this.type || "chordal" === this.type) {
  55125. var g = "chordal" === this.type ? .5 : .25
  55126. , m = Math.pow(u.distanceToSquared(d), g)
  55127. , v = Math.pow(d.distanceToSquared(p), g)
  55128. , A = Math.pow(p.distanceToSquared(f), g);
  55129. v < 1e-4 && (v = 1),
  55130. m < 1e-4 && (m = v),
  55131. A < 1e-4 && (A = v),
  55132. i.initNonuniformCatmullRom(u.x, d.x, p.x, f.x, m, v, A),
  55133. r.initNonuniformCatmullRom(u.y, d.y, p.y, f.y, m, v, A),
  55134. o.initNonuniformCatmullRom(u.z, d.z, p.z, f.z, m, v, A)
  55135. } else if ("catmullrom" === this.type) {
  55136. var y = void 0 !== this.tension ? this.tension : .5;
  55137. i.initCatmullRom(u.x, d.x, p.x, f.x, y),
  55138. r.initCatmullRom(u.y, d.y, p.y, f.y, y),
  55139. o.initCatmullRom(u.z, d.z, p.z, f.z, y)
  55140. }
  55141. var C = new n.Vector3(i.calc(l),r.calc(l),o.calc(l));
  55142. return C
  55143. })
  55144. }(),
  55145. n.ClosedSplineCurve3 = function(e) {
  55146. console.warn("THREE.ClosedSplineCurve3 has been deprecated. Please use THREE.CatmullRomCurve3."),
  55147. n.CatmullRomCurve3.call(this, e),
  55148. this.type = "catmullrom",
  55149. this.closed = !0
  55150. }
  55151. ,
  55152. n.ClosedSplineCurve3.prototype = Object.create(n.CatmullRomCurve3.prototype),
  55153. n.BoxGeometry = function(e, t, i, r, o, a) {
  55154. n.Geometry.call(this),
  55155. this.type = "BoxGeometry",
  55156. this.parameters = {
  55157. width: e,
  55158. height: t,
  55159. depth: i,
  55160. widthSegments: r,
  55161. heightSegments: o,
  55162. depthSegments: a
  55163. },
  55164. this.fromBufferGeometry(new n.BoxBufferGeometry(e,t,i,r,o,a)),
  55165. this.mergeVertices()
  55166. }
  55167. ,
  55168. n.BoxGeometry.prototype = Object.create(n.Geometry.prototype),
  55169. n.BoxGeometry.prototype.constructor = n.BoxGeometry,
  55170. n.CubeGeometry = n.BoxGeometry,
  55171. n.BoxBufferGeometry = function(e, t, i, r, o, a) {
  55172. function s(e, t, i) {
  55173. var n = 0;
  55174. return n += e * t * 2,
  55175. n += e * i * 2,
  55176. n += i * t * 2,
  55177. 4 * n
  55178. }
  55179. function l(e, t, i, r, o, a, s, l, h, u, I) {
  55180. 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++)
  55181. for (var L = O * b - _, D = 0; D < x; D++) {
  55182. var N = D * E - w;
  55183. P[e] = N * r,
  55184. P[t] = L * o,
  55185. P[i] = T,
  55186. p[m] = P.x,
  55187. p[m + 1] = P.y,
  55188. p[m + 2] = P.z,
  55189. P[e] = 0,
  55190. P[t] = 0,
  55191. P[i] = l > 0 ? 1 : -1,
  55192. f[m] = P.x,
  55193. f[m + 1] = P.y,
  55194. f[m + 2] = P.z,
  55195. g[v] = D / h,
  55196. g[v + 1] = 1 - O / u,
  55197. m += 3,
  55198. v += 2,
  55199. M += 1
  55200. }
  55201. for (O = 0; O < u; O++)
  55202. for (D = 0; D < h; D++) {
  55203. var B = y + D + x * O
  55204. , F = y + D + x * (O + 1)
  55205. , V = y + (D + 1) + x * (O + 1)
  55206. , U = y + (D + 1) + x * O;
  55207. d[A] = B,
  55208. d[A + 1] = F,
  55209. d[A + 2] = U,
  55210. d[A + 3] = F,
  55211. d[A + 4] = V,
  55212. d[A + 5] = U,
  55213. A += 6,
  55214. R += 6
  55215. }
  55216. c.addGroup(C, R, I),
  55217. C += R,
  55218. y += M
  55219. }
  55220. n.BufferGeometry.call(this),
  55221. this.type = "BoxBufferGeometry",
  55222. this.parameters = {
  55223. width: e,
  55224. height: t,
  55225. depth: i,
  55226. widthSegments: r,
  55227. heightSegments: o,
  55228. depthSegments: a
  55229. };
  55230. var c = this;
  55231. r = Math.floor(r) || 1,
  55232. o = Math.floor(o) || 1,
  55233. a = Math.floor(a) || 1;
  55234. var h = s(r, o, a)
  55235. , u = h / 4 * 6
  55236. , d = new (u > 65535 ? Uint32Array : Uint16Array)(u)
  55237. , p = new Float32Array(3 * h)
  55238. , f = new Float32Array(3 * h)
  55239. , g = new Float32Array(2 * h)
  55240. , m = 0
  55241. , v = 0
  55242. , A = 0
  55243. , y = 0
  55244. , C = 0;
  55245. l("z", "y", "x", -1, -1, i, t, e, a, o, 0),
  55246. l("z", "y", "x", 1, -1, i, t, -e, a, o, 1),
  55247. l("x", "z", "y", 1, 1, e, i, t, r, a, 2),
  55248. l("x", "z", "y", 1, -1, e, i, -t, r, a, 3),
  55249. l("x", "y", "z", 1, -1, e, t, i, r, o, 4),
  55250. l("x", "y", "z", -1, -1, e, t, -i, r, o, 5),
  55251. this.setIndex(new n.BufferAttribute(d,1)),
  55252. this.addAttribute("position", new n.BufferAttribute(p,3)),
  55253. this.addAttribute("normal", new n.BufferAttribute(f,3)),
  55254. this.addAttribute("uv", new n.BufferAttribute(g,2))
  55255. }
  55256. ,
  55257. n.BoxBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  55258. n.BoxBufferGeometry.prototype.constructor = n.BoxBufferGeometry,
  55259. n.CircleGeometry = function(e, t, i, r) {
  55260. n.Geometry.call(this),
  55261. this.type = "CircleGeometry",
  55262. this.parameters = {
  55263. radius: e,
  55264. segments: t,
  55265. thetaStart: i,
  55266. thetaLength: r
  55267. },
  55268. this.fromBufferGeometry(new n.CircleBufferGeometry(e,t,i,r))
  55269. }
  55270. ,
  55271. n.CircleGeometry.prototype = Object.create(n.Geometry.prototype),
  55272. n.CircleGeometry.prototype.constructor = n.CircleGeometry,
  55273. n.CircleBufferGeometry = function(e, t, i, r) {
  55274. n.BufferGeometry.call(this),
  55275. this.type = "CircleBufferGeometry",
  55276. this.parameters = {
  55277. radius: e,
  55278. segments: t,
  55279. thetaStart: i,
  55280. thetaLength: r
  55281. },
  55282. e = e || 50,
  55283. t = void 0 !== t ? Math.max(3, t) : 8,
  55284. i = void 0 !== i ? i : 0,
  55285. r = void 0 !== r ? r : 2 * Math.PI;
  55286. var o = t + 2
  55287. , a = new Float32Array(3 * o)
  55288. , s = new Float32Array(3 * o)
  55289. , l = new Float32Array(2 * o);
  55290. s[2] = 1,
  55291. l[0] = .5,
  55292. l[1] = .5;
  55293. for (var c = 0, h = 3, u = 2; c <= t; c++,
  55294. h += 3,
  55295. u += 2) {
  55296. var d = i + c / t * r;
  55297. a[h] = e * Math.cos(d),
  55298. a[h + 1] = e * Math.sin(d),
  55299. s[h + 2] = 1,
  55300. l[u] = (a[h] / e + 1) / 2,
  55301. l[u + 1] = (a[h + 1] / e + 1) / 2
  55302. }
  55303. for (var p = [], h = 1; h <= t; h++)
  55304. p.push(h, h + 1, 0);
  55305. this.setIndex(new n.BufferAttribute(new Uint16Array(p),1)),
  55306. this.addAttribute("position", new n.BufferAttribute(a,3)),
  55307. this.addAttribute("normal", new n.BufferAttribute(s,3)),
  55308. this.addAttribute("uv", new n.BufferAttribute(l,2)),
  55309. this.boundingSphere = new n.Sphere(new n.Vector3,e)
  55310. }
  55311. ,
  55312. n.CircleBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  55313. n.CircleBufferGeometry.prototype.constructor = n.CircleBufferGeometry,
  55314. n.CylinderBufferGeometry = function(e, t, i, r, o, a, s, l) {
  55315. function c() {
  55316. var e = (r + 1) * (o + 1);
  55317. return a === !1 && (e += 2 * (r + 1) + 2 * r),
  55318. e
  55319. }
  55320. function h() {
  55321. var e = r * o * 2 * 3;
  55322. return a === !1 && (e += 2 * r * 3),
  55323. e
  55324. }
  55325. function u() {
  55326. var a, c, h = new n.Vector3, u = new n.Vector3, d = (t - e) / i;
  55327. for (c = 0; c <= o; c++) {
  55328. var p = []
  55329. , f = c / o
  55330. , b = f * (t - e) + e;
  55331. for (a = 0; a <= r; a++) {
  55332. var w = a / r;
  55333. u.x = b * Math.sin(w * l + s),
  55334. u.y = -f * i + E,
  55335. u.z = b * Math.cos(w * l + s),
  55336. m.setXYZ(y, u.x, u.y, u.z),
  55337. h.copy(u),
  55338. (0 === e && 0 === c || 0 === t && c === o) && (h.x = Math.sin(w * l + s),
  55339. h.z = Math.cos(w * l + s)),
  55340. h.setY(Math.sqrt(h.x * h.x + h.z * h.z) * d).normalize(),
  55341. v.setXYZ(y, h.x, h.y, h.z),
  55342. A.setXY(y, w, 1 - f),
  55343. p.push(y),
  55344. y++
  55345. }
  55346. I.push(p)
  55347. }
  55348. for (a = 0; a < r; a++)
  55349. for (c = 0; c < o; c++) {
  55350. var _ = I[c][a]
  55351. , T = I[c + 1][a]
  55352. , x = I[c + 1][a + 1]
  55353. , S = I[c][a + 1];
  55354. g.setX(C, _),
  55355. C++,
  55356. g.setX(C, T),
  55357. C++,
  55358. g.setX(C, S),
  55359. C++,
  55360. g.setX(C, T),
  55361. C++,
  55362. g.setX(C, x),
  55363. C++,
  55364. g.setX(C, S),
  55365. C++
  55366. }
  55367. }
  55368. function d(i) {
  55369. var o, a, c, h = new n.Vector2, u = new n.Vector3, d = i === !0 ? e : t, p = i === !0 ? 1 : -1;
  55370. for (a = y,
  55371. o = 1; o <= r; o++)
  55372. m.setXYZ(y, 0, E * p, 0),
  55373. v.setXYZ(y, 0, p, 0),
  55374. i === !0 ? (h.x = o / r,
  55375. h.y = 0) : (h.x = (o - 1) / r,
  55376. h.y = 1),
  55377. A.setXY(y, h.x, h.y),
  55378. y++;
  55379. for (c = y,
  55380. o = 0; o <= r; o++) {
  55381. var f = o / r;
  55382. u.x = d * Math.sin(f * l + s),
  55383. u.y = E * p,
  55384. u.z = d * Math.cos(f * l + s),
  55385. m.setXYZ(y, u.x, u.y, u.z),
  55386. v.setXYZ(y, 0, p, 0),
  55387. A.setXY(y, f, i === !0 ? 1 : 0),
  55388. y++
  55389. }
  55390. for (o = 0; o < r; o++) {
  55391. var I = a + o
  55392. , b = c + o;
  55393. i === !0 ? (g.setX(C, b),
  55394. C++,
  55395. g.setX(C, b + 1),
  55396. C++,
  55397. g.setX(C, I),
  55398. C++) : (g.setX(C, b + 1),
  55399. C++,
  55400. g.setX(C, b),
  55401. C++,
  55402. g.setX(C, I),
  55403. C++)
  55404. }
  55405. }
  55406. n.BufferGeometry.call(this),
  55407. this.type = "CylinderBufferGeometry",
  55408. this.parameters = {
  55409. radiusTop: e,
  55410. radiusBottom: t,
  55411. height: i,
  55412. radialSegments: r,
  55413. heightSegments: o,
  55414. openEnded: a,
  55415. thetaStart: s,
  55416. thetaLength: l
  55417. },
  55418. e = void 0 !== e ? e : 20,
  55419. t = void 0 !== t ? t : 20,
  55420. i = void 0 !== i ? i : 100,
  55421. r = Math.floor(r) || 8,
  55422. o = Math.floor(o) || 1,
  55423. a = void 0 !== a && a,
  55424. s = void 0 !== s ? s : 0,
  55425. l = void 0 !== l ? l : 2 * Math.PI;
  55426. var p = c()
  55427. , f = h()
  55428. , g = new n.BufferAttribute(new (f > 65535 ? Uint32Array : Uint16Array)(f),1)
  55429. , m = new n.BufferAttribute(new Float32Array(3 * p),3)
  55430. , v = new n.BufferAttribute(new Float32Array(3 * p),3)
  55431. , A = new n.BufferAttribute(new Float32Array(2 * p),2)
  55432. , y = 0
  55433. , C = 0
  55434. , I = []
  55435. , E = i / 2;
  55436. u(),
  55437. a === !1 && (e > 0 && d(!0),
  55438. t > 0 && d(!1)),
  55439. this.setIndex(g),
  55440. this.addAttribute("position", m),
  55441. this.addAttribute("normal", v),
  55442. this.addAttribute("uv", A)
  55443. }
  55444. ,
  55445. n.CylinderBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  55446. n.CylinderBufferGeometry.prototype.constructor = n.CylinderBufferGeometry,
  55447. n.CylinderGeometry = function(e, t, i, r, o, a, s, l) {
  55448. n.Geometry.call(this),
  55449. this.type = "CylinderGeometry",
  55450. this.parameters = {
  55451. radiusTop: e,
  55452. radiusBottom: t,
  55453. height: i,
  55454. radialSegments: r,
  55455. heightSegments: o,
  55456. openEnded: a,
  55457. thetaStart: s,
  55458. thetaLength: l
  55459. },
  55460. this.fromBufferGeometry(new n.CylinderBufferGeometry(e,t,i,r,o,a,s,l)),
  55461. this.mergeVertices()
  55462. }
  55463. ,
  55464. n.CylinderGeometry.prototype = Object.create(n.Geometry.prototype),
  55465. n.CylinderGeometry.prototype.constructor = n.CylinderGeometry,
  55466. n.EdgesGeometry = function(e, t) {
  55467. function i(e, t) {
  55468. return e - t
  55469. }
  55470. n.BufferGeometry.call(this),
  55471. t = void 0 !== t ? t : 1;
  55472. var r, o = Math.cos(n.Math.degToRad(t)), a = [0, 0], s = {}, l = ["a", "b", "c"];
  55473. e instanceof n.BufferGeometry ? (r = new n.Geometry,
  55474. r.fromBufferGeometry(e)) : r = e.clone(),
  55475. r.mergeVertices(),
  55476. r.computeFaceNormals();
  55477. for (var c = r.vertices, h = r.faces, u = 0, d = h.length; u < d; u++)
  55478. for (var p = h[u], f = 0; f < 3; f++) {
  55479. a[0] = p[l[f]],
  55480. a[1] = p[l[(f + 1) % 3]],
  55481. a.sort(i);
  55482. var g = a.toString();
  55483. void 0 === s[g] ? s[g] = {
  55484. vert1: a[0],
  55485. vert2: a[1],
  55486. face1: u,
  55487. face2: void 0
  55488. } : s[g].face2 = u
  55489. }
  55490. var m = [];
  55491. for (var g in s) {
  55492. var v = s[g];
  55493. if (void 0 === v.face2 || h[v.face1].normal.dot(h[v.face2].normal) <= o) {
  55494. var A = c[v.vert1];
  55495. m.push(A.x),
  55496. m.push(A.y),
  55497. m.push(A.z),
  55498. A = c[v.vert2],
  55499. m.push(A.x),
  55500. m.push(A.y),
  55501. m.push(A.z)
  55502. }
  55503. }
  55504. this.addAttribute("position", new n.BufferAttribute(new Float32Array(m),3))
  55505. }
  55506. ,
  55507. n.EdgesGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  55508. n.EdgesGeometry.prototype.constructor = n.EdgesGeometry,
  55509. n.ExtrudeGeometry = function(e, t) {
  55510. return "undefined" == typeof e ? void (e = []) : (n.Geometry.call(this),
  55511. this.type = "ExtrudeGeometry",
  55512. e = Array.isArray(e) ? e : [e],
  55513. this.addShapeList(e, t),
  55514. void this.computeFaceNormals())
  55515. }
  55516. ;
  55517. n.ExtrudeGeometry.prototype = Object.create(n.Geometry.prototype);
  55518. n.ExtrudeGeometry.prototype.constructor = n.ExtrudeGeometry,
  55519. n.ExtrudeGeometry.prototype.addShapeList = function(e, t) {
  55520. for (var i = e.length, n = 0; n < i; n++) {
  55521. var r = e[n];
  55522. this.addShape(r, t)
  55523. }
  55524. }
  55525. ,
  55526. n.ExtrudeGeometry.prototype.addShape = function(e, t) {
  55527. function i(e, t, i) {
  55528. return t || console.error("THREE.ExtrudeGeometry: vec does not exist"),
  55529. t.clone().multiplyScalar(i).add(e)
  55530. }
  55531. function r(e, t, i) {
  55532. 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;
  55533. if (Math.abs(d) > Number.EPSILON) {
  55534. var p = Math.sqrt(u)
  55535. , f = Math.sqrt(c * c + h * h)
  55536. , g = t.x - l / p
  55537. , m = t.y + s / p
  55538. , v = i.x - h / f
  55539. , A = i.y + c / f
  55540. , y = ((v - g) * h - (A - m) * c) / (s * h - l * c);
  55541. r = g + s * y - e.x,
  55542. o = m + l * y - e.y;
  55543. var C = r * r + o * o;
  55544. if (C <= 2)
  55545. return new n.Vector2(r,o);
  55546. a = Math.sqrt(C / 2)
  55547. } else {
  55548. var I = !1;
  55549. s > Number.EPSILON ? c > Number.EPSILON && (I = !0) : s < -Number.EPSILON ? c < -Number.EPSILON && (I = !0) : Math.sign(l) === Math.sign(h) && (I = !0),
  55550. I ? (r = -l,
  55551. o = s,
  55552. a = Math.sqrt(u)) : (r = s,
  55553. o = l,
  55554. a = Math.sqrt(u / 2))
  55555. }
  55556. return new n.Vector2(r / a,o / a)
  55557. }
  55558. function o() {
  55559. if (C) {
  55560. var e = 0
  55561. , t = z * e;
  55562. for (Y = 0; Y < W; Y++)
  55563. G = N[Y],
  55564. c(G[2] + t, G[1] + t, G[0] + t);
  55565. for (e = E + 2 * y,
  55566. t = z * e,
  55567. Y = 0; Y < W; Y++)
  55568. G = N[Y],
  55569. c(G[0] + t, G[1] + t, G[2] + t)
  55570. } else {
  55571. for (Y = 0; Y < W; Y++)
  55572. G = N[Y],
  55573. c(G[2], G[1], G[0]);
  55574. for (Y = 0; Y < W; Y++)
  55575. G = N[Y],
  55576. c(G[0] + z * E, G[1] + z * E, G[2] + z * E)
  55577. }
  55578. }
  55579. function a() {
  55580. var e = 0;
  55581. for (s(B, e),
  55582. e += B.length,
  55583. x = 0,
  55584. S = L.length; x < S; x++)
  55585. T = L[x],
  55586. s(T, e),
  55587. e += T.length
  55588. }
  55589. function s(e, t) {
  55590. var i, n;
  55591. for (Y = e.length; --Y >= 0; ) {
  55592. i = Y,
  55593. n = Y - 1,
  55594. n < 0 && (n = e.length - 1);
  55595. var r = 0
  55596. , o = E + 2 * y;
  55597. for (r = 0; r < o; r++) {
  55598. var a = z * r
  55599. , s = z * (r + 1)
  55600. , l = t + i + a
  55601. , c = t + n + a
  55602. , u = t + n + s
  55603. , d = t + i + s;
  55604. h(l, c, u, d, e, r, o, i, n)
  55605. }
  55606. }
  55607. }
  55608. function l(e, t, i) {
  55609. M.vertices.push(new n.Vector3(e,t,i))
  55610. }
  55611. function c(e, t, i) {
  55612. e += R,
  55613. t += R,
  55614. i += R,
  55615. M.faces.push(new n.Face3(e,t,i,null,null,0));
  55616. var r = _.generateTopUV(M, e, t, i);
  55617. M.faceVertexUvs[0].push(r)
  55618. }
  55619. function h(e, t, i, r, o, a, s, l, c) {
  55620. e += R,
  55621. t += R,
  55622. i += R,
  55623. r += R,
  55624. M.faces.push(new n.Face3(e,t,r,null,null,1)),
  55625. M.faces.push(new n.Face3(t,i,r,null,null,1));
  55626. var h = _.generateSideWallUV(M, e, t, i, r);
  55627. M.faceVertexUvs[0].push([h[0], h[1], h[3]]),
  55628. M.faceVertexUvs[0].push([h[1], h[2], h[3]])
  55629. }
  55630. 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;
  55631. b && (u = b.getSpacedPoints(E),
  55632. w = !0,
  55633. C = !1,
  55634. d = void 0 !== t.frames ? t.frames : new n.TubeGeometry.FrenetFrames(b,E,!1),
  55635. p = new n.Vector3,
  55636. f = new n.Vector3,
  55637. g = new n.Vector3),
  55638. C || (y = 0,
  55639. v = 0,
  55640. A = 0);
  55641. 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);
  55642. if (D) {
  55643. for (O = O.reverse(),
  55644. x = 0,
  55645. S = L.length; x < S; x++)
  55646. T = L[x],
  55647. n.ShapeUtils.isClockWise(T) && (L[x] = T.reverse());
  55648. D = !1
  55649. }
  55650. var N = n.ShapeUtils.triangulateShape(O, L)
  55651. , B = O;
  55652. for (x = 0,
  55653. S = L.length; x < S; x++)
  55654. T = L[x],
  55655. O = O.concat(T);
  55656. 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++,
  55657. Z++,
  55658. q++)
  55659. Z === X && (Z = 0),
  55660. q === X && (q = 0),
  55661. j[Y] = r(B[Y], B[Z], B[q]);
  55662. var K, Q = [], J = j.concat();
  55663. for (x = 0,
  55664. S = L.length; x < S; x++) {
  55665. for (T = L[x],
  55666. K = [],
  55667. Y = 0,
  55668. X = T.length,
  55669. Z = X - 1,
  55670. q = Y + 1; Y < X; Y++,
  55671. Z++,
  55672. q++)
  55673. Z === X && (Z = 0),
  55674. q === X && (q = 0),
  55675. K[Y] = r(T[Y], T[Z], T[q]);
  55676. Q.push(K),
  55677. J = J.concat(K)
  55678. }
  55679. for (F = 0; F < y; F++) {
  55680. for (U = F / y,
  55681. k = v * (1 - U),
  55682. V = A * Math.sin(U * Math.PI / 2),
  55683. Y = 0,
  55684. X = B.length; Y < X; Y++)
  55685. H = i(B[Y], j[Y], V),
  55686. l(H.x, H.y, -k);
  55687. for (x = 0,
  55688. S = L.length; x < S; x++)
  55689. for (T = L[x],
  55690. K = Q[x],
  55691. Y = 0,
  55692. X = T.length; Y < X; Y++)
  55693. H = i(T[Y], K[Y], V),
  55694. l(H.x, H.y, -k)
  55695. }
  55696. for (V = A,
  55697. Y = 0; Y < z; Y++)
  55698. H = C ? i(O[Y], J[Y], V) : O[Y],
  55699. w ? (f.copy(d.normals[0]).multiplyScalar(H.x),
  55700. p.copy(d.binormals[0]).multiplyScalar(H.y),
  55701. g.copy(u[0]).add(f).add(p),
  55702. l(g.x, g.y, g.z)) : l(H.x, H.y, 0);
  55703. var $;
  55704. for ($ = 1; $ <= E; $++)
  55705. for (Y = 0; Y < z; Y++)
  55706. H = C ? i(O[Y], J[Y], V) : O[Y],
  55707. w ? (f.copy(d.normals[$]).multiplyScalar(H.x),
  55708. p.copy(d.binormals[$]).multiplyScalar(H.y),
  55709. g.copy(u[$]).add(f).add(p),
  55710. l(g.x, g.y, g.z)) : l(H.x, H.y, m / E * $);
  55711. for (F = y - 1; F >= 0; F--) {
  55712. for (U = F / y,
  55713. k = v * (1 - U),
  55714. V = A * Math.sin(U * Math.PI / 2),
  55715. Y = 0,
  55716. X = B.length; Y < X; Y++)
  55717. H = i(B[Y], j[Y], V),
  55718. l(H.x, H.y, m + k);
  55719. for (x = 0,
  55720. S = L.length; x < S; x++)
  55721. for (T = L[x],
  55722. K = Q[x],
  55723. Y = 0,
  55724. X = T.length; Y < X; Y++)
  55725. H = i(T[Y], K[Y], V),
  55726. w ? l(H.x, H.y + u[E - 1].y, u[E - 1].x + k) : l(H.x, H.y, m + k)
  55727. }
  55728. o(),
  55729. a()
  55730. }
  55731. ,
  55732. n.ExtrudeGeometry.WorldUVGenerator = {
  55733. generateTopUV: function(e, t, i, r) {
  55734. var o = e.vertices
  55735. , a = o[t]
  55736. , s = o[i]
  55737. , l = o[r];
  55738. return [new n.Vector2(a.x,a.y), new n.Vector2(s.x,s.y), new n.Vector2(l.x,l.y)]
  55739. },
  55740. generateSideWallUV: function(e, t, i, r, o) {
  55741. var a = e.vertices
  55742. , s = a[t]
  55743. , l = a[i]
  55744. , c = a[r]
  55745. , h = a[o];
  55746. 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)]
  55747. }
  55748. },
  55749. n.ShapeGeometry = function(e, t) {
  55750. n.Geometry.call(this),
  55751. this.type = "ShapeGeometry",
  55752. Array.isArray(e) === !1 && (e = [e]),
  55753. this.addShapeList(e, t),
  55754. this.computeFaceNormals()
  55755. }
  55756. ,
  55757. n.ShapeGeometry.prototype = Object.create(n.Geometry.prototype),
  55758. n.ShapeGeometry.prototype.constructor = n.ShapeGeometry,
  55759. n.ShapeGeometry.prototype.addShapeList = function(e, t) {
  55760. for (var i = 0, n = e.length; i < n; i++)
  55761. this.addShape(e[i], t);
  55762. return this
  55763. }
  55764. ,
  55765. n.ShapeGeometry.prototype.addShape = function(e, t) {
  55766. void 0 === t && (t = {});
  55767. 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);
  55768. if (p) {
  55769. for (u = u.reverse(),
  55770. i = 0,
  55771. r = d.length; i < r; i++)
  55772. o = d[i],
  55773. n.ShapeUtils.isClockWise(o) && (d[i] = o.reverse());
  55774. p = !1
  55775. }
  55776. var f = n.ShapeUtils.triangulateShape(u, d);
  55777. for (i = 0,
  55778. r = d.length; i < r; i++)
  55779. o = d[i],
  55780. u = u.concat(o);
  55781. var g, m, v = u.length, A = f.length;
  55782. for (i = 0; i < v; i++)
  55783. g = u[i],
  55784. this.vertices.push(new n.Vector3(g.x,g.y,0));
  55785. for (i = 0; i < A; i++) {
  55786. m = f[i];
  55787. var y = m[0] + c
  55788. , C = m[1] + c
  55789. , I = m[2] + c;
  55790. this.faces.push(new n.Face3(y,C,I,null,null,s)),
  55791. this.faceVertexUvs[0].push(l.generateTopUV(this, y, C, I))
  55792. }
  55793. }
  55794. ,
  55795. n.LatheBufferGeometry = function(e, t, i, r) {
  55796. n.BufferGeometry.call(this),
  55797. this.type = "LatheBufferGeometry",
  55798. this.parameters = {
  55799. points: e,
  55800. segments: t,
  55801. phiStart: i,
  55802. phiLength: r
  55803. },
  55804. t = Math.floor(t) || 12,
  55805. i = i || 0,
  55806. r = r || 2 * Math.PI,
  55807. r = n.Math.clamp(r, 0, 2 * Math.PI);
  55808. 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),
  55809. 1 / t), m = new n.Vector3, v = new n.Vector2;
  55810. for (a = 0; a <= t; a++) {
  55811. var A = i + a * g * r
  55812. , y = Math.sin(A)
  55813. , C = Math.cos(A);
  55814. for (s = 0; s <= e.length - 1; s++)
  55815. m.x = e[s].x * y,
  55816. m.y = e[s].y,
  55817. m.z = e[s].x * C,
  55818. u.setXYZ(p, m.x, m.y, m.z),
  55819. v.x = a / t,
  55820. v.y = s / (e.length - 1),
  55821. d.setXY(p, v.x, v.y),
  55822. p++
  55823. }
  55824. for (a = 0; a < t; a++)
  55825. for (s = 0; s < e.length - 1; s++) {
  55826. o = s + a * e.length;
  55827. var I = o
  55828. , E = o + e.length
  55829. , b = o + e.length + 1
  55830. , w = o + 1;
  55831. h.setX(f, I),
  55832. f++,
  55833. h.setX(f, E),
  55834. f++,
  55835. h.setX(f, w),
  55836. f++,
  55837. h.setX(f, E),
  55838. f++,
  55839. h.setX(f, b),
  55840. f++,
  55841. h.setX(f, w),
  55842. f++
  55843. }
  55844. if (this.setIndex(h),
  55845. this.addAttribute("position", u),
  55846. this.addAttribute("uv", d),
  55847. this.computeVertexNormals(),
  55848. r === 2 * Math.PI) {
  55849. var _ = this.attributes.normal.array
  55850. , T = new n.Vector3
  55851. , x = new n.Vector3
  55852. , S = new n.Vector3;
  55853. for (o = t * e.length * 3,
  55854. a = 0,
  55855. s = 0; a < e.length; a++,
  55856. s += 3)
  55857. T.x = _[s + 0],
  55858. T.y = _[s + 1],
  55859. T.z = _[s + 2],
  55860. x.x = _[o + s + 0],
  55861. x.y = _[o + s + 1],
  55862. x.z = _[o + s + 2],
  55863. S.addVectors(T, x).normalize(),
  55864. _[s + 0] = _[o + s + 0] = S.x,
  55865. _[s + 1] = _[o + s + 1] = S.y,
  55866. _[s + 2] = _[o + s + 2] = S.z
  55867. }
  55868. }
  55869. ,
  55870. n.LatheBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  55871. n.LatheBufferGeometry.prototype.constructor = n.LatheBufferGeometry,
  55872. n.LatheGeometry = function(e, t, i, r) {
  55873. n.Geometry.call(this),
  55874. this.type = "LatheGeometry",
  55875. this.parameters = {
  55876. points: e,
  55877. segments: t,
  55878. phiStart: i,
  55879. phiLength: r
  55880. },
  55881. this.fromBufferGeometry(new n.LatheBufferGeometry(e,t,i,r)),
  55882. this.mergeVertices()
  55883. }
  55884. ,
  55885. n.LatheGeometry.prototype = Object.create(n.Geometry.prototype),
  55886. n.LatheGeometry.prototype.constructor = n.LatheGeometry,
  55887. n.PlaneGeometry = function(e, t, i, r) {
  55888. n.Geometry.call(this),
  55889. this.type = "PlaneGeometry",
  55890. this.parameters = {
  55891. width: e,
  55892. height: t,
  55893. widthSegments: i,
  55894. heightSegments: r
  55895. },
  55896. this.fromBufferGeometry(new n.PlaneBufferGeometry(e,t,i,r))
  55897. }
  55898. ,
  55899. n.PlaneGeometry.prototype = Object.create(n.Geometry.prototype),
  55900. n.PlaneGeometry.prototype.constructor = n.PlaneGeometry,
  55901. n.PlaneBufferGeometry = function(e, t, i, r) {
  55902. n.BufferGeometry.call(this),
  55903. this.type = "PlaneBufferGeometry",
  55904. this.parameters = {
  55905. width: e,
  55906. height: t,
  55907. widthSegments: i,
  55908. heightSegments: r
  55909. };
  55910. 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++)
  55911. for (var y = A * d - a, C = 0; C < c; C++) {
  55912. var I = C * u - o;
  55913. p[m] = I,
  55914. p[m + 1] = -y,
  55915. f[m + 2] = 1,
  55916. g[v] = C / s,
  55917. g[v + 1] = 1 - A / l,
  55918. m += 3,
  55919. v += 2
  55920. }
  55921. m = 0;
  55922. for (var E = new (p.length / 3 > 65535 ? Uint32Array : Uint16Array)(s * l * 6), A = 0; A < l; A++)
  55923. for (var C = 0; C < s; C++) {
  55924. var b = C + c * A
  55925. , w = C + c * (A + 1)
  55926. , _ = C + 1 + c * (A + 1)
  55927. , T = C + 1 + c * A;
  55928. E[m] = b,
  55929. E[m + 1] = w,
  55930. E[m + 2] = T,
  55931. E[m + 3] = w,
  55932. E[m + 4] = _,
  55933. E[m + 5] = T,
  55934. m += 6
  55935. }
  55936. this.setIndex(new n.BufferAttribute(E,1)),
  55937. this.addAttribute("position", new n.BufferAttribute(p,3)),
  55938. this.addAttribute("normal", new n.BufferAttribute(f,3)),
  55939. this.addAttribute("uv", new n.BufferAttribute(g,2))
  55940. }
  55941. ,
  55942. n.PlaneBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  55943. n.PlaneBufferGeometry.prototype.constructor = n.PlaneBufferGeometry,
  55944. n.RingBufferGeometry = function(e, t, i, r, o, a) {
  55945. n.BufferGeometry.call(this),
  55946. this.type = "RingBufferGeometry",
  55947. this.parameters = {
  55948. innerRadius: e,
  55949. outerRadius: t,
  55950. thetaSegments: i,
  55951. phiSegments: r,
  55952. thetaStart: o,
  55953. thetaLength: a
  55954. },
  55955. e = e || 20,
  55956. t = t || 50,
  55957. o = void 0 !== o ? o : 0,
  55958. a = void 0 !== a ? a : 2 * Math.PI,
  55959. i = void 0 !== i ? Math.max(3, i) : 8,
  55960. r = void 0 !== r ? Math.max(1, r) : 1;
  55961. 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;
  55962. for (l = 0; l <= r; l++) {
  55963. for (c = 0; c <= i; c++)
  55964. s = o + c / i * a,
  55965. C.x = A * Math.cos(s),
  55966. C.y = A * Math.sin(s),
  55967. p.setXYZ(m, C.x, C.y, C.z),
  55968. f.setXYZ(m, 0, 0, 1),
  55969. I.x = (C.x / t + 1) / 2,
  55970. I.y = (C.y / t + 1) / 2,
  55971. g.setXY(m, I.x, I.y),
  55972. m++;
  55973. A += y
  55974. }
  55975. for (l = 0; l < r; l++) {
  55976. var E = l * (i + 1);
  55977. for (c = 0; c < i; c++) {
  55978. s = c + E;
  55979. var b = s
  55980. , w = s + i + 1
  55981. , _ = s + i + 2
  55982. , T = s + 1;
  55983. d.setX(v, b),
  55984. v++,
  55985. d.setX(v, w),
  55986. v++,
  55987. d.setX(v, _),
  55988. v++,
  55989. d.setX(v, b),
  55990. v++,
  55991. d.setX(v, _),
  55992. v++,
  55993. d.setX(v, T),
  55994. v++
  55995. }
  55996. }
  55997. this.setIndex(d),
  55998. this.addAttribute("position", p),
  55999. this.addAttribute("normal", f),
  56000. this.addAttribute("uv", g)
  56001. }
  56002. ,
  56003. n.RingBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  56004. n.RingBufferGeometry.prototype.constructor = n.RingBufferGeometry,
  56005. n.RingGeometry = function(e, t, i, r, o, a) {
  56006. n.Geometry.call(this),
  56007. this.type = "RingGeometry",
  56008. this.parameters = {
  56009. innerRadius: e,
  56010. outerRadius: t,
  56011. thetaSegments: i,
  56012. phiSegments: r,
  56013. thetaStart: o,
  56014. thetaLength: a
  56015. },
  56016. this.fromBufferGeometry(new n.RingBufferGeometry(e,t,i,r,o,a))
  56017. }
  56018. ,
  56019. n.RingGeometry.prototype = Object.create(n.Geometry.prototype),
  56020. n.RingGeometry.prototype.constructor = n.RingGeometry,
  56021. n.SphereGeometry = function(e, t, i, r, o, a, s) {
  56022. n.Geometry.call(this),
  56023. this.type = "SphereGeometry",
  56024. this.parameters = {
  56025. radius: e,
  56026. widthSegments: t,
  56027. heightSegments: i,
  56028. phiStart: r,
  56029. phiLength: o,
  56030. thetaStart: a,
  56031. thetaLength: s
  56032. },
  56033. this.fromBufferGeometry(new n.SphereBufferGeometry(e,t,i,r,o,a,s))
  56034. }
  56035. ,
  56036. n.SphereGeometry.prototype = Object.create(n.Geometry.prototype),
  56037. n.SphereGeometry.prototype.constructor = n.SphereGeometry,
  56038. n.SphereBufferGeometry = function(e, t, i, r, o, a, s) {
  56039. n.BufferGeometry.call(this),
  56040. this.type = "SphereBufferGeometry",
  56041. this.parameters = {
  56042. radius: e,
  56043. widthSegments: t,
  56044. heightSegments: i,
  56045. phiStart: r,
  56046. phiLength: o,
  56047. thetaStart: a,
  56048. thetaLength: s
  56049. },
  56050. e = e || 50,
  56051. t = Math.max(3, Math.floor(t) || 8),
  56052. i = Math.max(2, Math.floor(i) || 6),
  56053. r = void 0 !== r ? r : 0,
  56054. o = void 0 !== o ? o : 2 * Math.PI,
  56055. a = void 0 !== a ? a : 0,
  56056. s = void 0 !== s ? s : Math.PI;
  56057. 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++) {
  56058. for (var v = [], A = m / i, y = 0; y <= t; y++) {
  56059. var C = y / t
  56060. , I = -e * Math.cos(r + C * o) * Math.sin(a + A * s)
  56061. , E = e * Math.cos(a + A * s)
  56062. , b = e * Math.sin(r + C * o) * Math.sin(a + A * s);
  56063. g.set(I, E, b).normalize(),
  56064. h.setXYZ(p, I, E, b),
  56065. u.setXYZ(p, g.x, g.y, g.z),
  56066. d.setXY(p, C, 1 - A),
  56067. v.push(p),
  56068. p++
  56069. }
  56070. f.push(v)
  56071. }
  56072. for (var w = [], m = 0; m < i; m++)
  56073. for (var y = 0; y < t; y++) {
  56074. var _ = f[m][y + 1]
  56075. , T = f[m][y]
  56076. , x = f[m + 1][y]
  56077. , S = f[m + 1][y + 1];
  56078. (0 !== m || a > 0) && w.push(_, T, S),
  56079. (m !== i - 1 || l < Math.PI) && w.push(T, x, S)
  56080. }
  56081. this.setIndex(new (h.count > 65535 ? n.Uint32Attribute : n.Uint16Attribute)(w,1)),
  56082. this.addAttribute("position", h),
  56083. this.addAttribute("normal", u),
  56084. this.addAttribute("uv", d),
  56085. this.boundingSphere = new n.Sphere(new n.Vector3,e)
  56086. }
  56087. ,
  56088. n.SphereBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  56089. n.SphereBufferGeometry.prototype.constructor = n.SphereBufferGeometry,
  56090. n.TextGeometry = function(e, t) {
  56091. t = t || {};
  56092. var i = t.font;
  56093. if (i instanceof n.Font == !1)
  56094. return console.error("THREE.TextGeometry: font parameter is not an instance of THREE.Font."),
  56095. new n.Geometry;
  56096. var r = i.generateShapes(e, t.size, t.curveSegments);
  56097. t.amount = void 0 !== t.height ? t.height : 50,
  56098. void 0 === t.bevelThickness && (t.bevelThickness = 10),
  56099. void 0 === t.bevelSize && (t.bevelSize = 8),
  56100. void 0 === t.bevelEnabled && (t.bevelEnabled = !1),
  56101. n.ExtrudeGeometry.call(this, r, t),
  56102. this.type = "TextGeometry"
  56103. }
  56104. ,
  56105. n.TextGeometry.prototype = Object.create(n.ExtrudeGeometry.prototype),
  56106. n.TextGeometry.prototype.constructor = n.TextGeometry,
  56107. n.TorusBufferGeometry = function(e, t, i, r, o) {
  56108. n.BufferGeometry.call(this),
  56109. this.type = "TorusBufferGeometry",
  56110. this.parameters = {
  56111. radius: e,
  56112. tube: t,
  56113. radialSegments: i,
  56114. tubularSegments: r,
  56115. arc: o
  56116. },
  56117. e = e || 100,
  56118. t = t || 40,
  56119. i = Math.floor(i) || 8,
  56120. r = Math.floor(r) || 6,
  56121. o = o || 2 * Math.PI;
  56122. 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;
  56123. for (a = 0; a <= i; a++)
  56124. for (s = 0; s <= r; s++) {
  56125. var C = s / r * o
  56126. , I = a / i * Math.PI * 2;
  56127. A.x = (e + t * Math.cos(I)) * Math.cos(C),
  56128. A.y = (e + t * Math.cos(I)) * Math.sin(C),
  56129. A.z = t * Math.sin(I),
  56130. u[f] = A.x,
  56131. u[f + 1] = A.y,
  56132. u[f + 2] = A.z,
  56133. v.x = e * Math.cos(C),
  56134. v.y = e * Math.sin(C),
  56135. y.subVectors(A, v).normalize(),
  56136. d[f] = y.x,
  56137. d[f + 1] = y.y,
  56138. d[f + 2] = y.z,
  56139. p[g] = s / r,
  56140. p[g + 1] = a / i,
  56141. f += 3,
  56142. g += 2
  56143. }
  56144. for (a = 1; a <= i; a++)
  56145. for (s = 1; s <= r; s++) {
  56146. var E = (r + 1) * a + s - 1
  56147. , b = (r + 1) * (a - 1) + s - 1
  56148. , w = (r + 1) * (a - 1) + s
  56149. , _ = (r + 1) * a + s;
  56150. h[m] = E,
  56151. h[m + 1] = b,
  56152. h[m + 2] = _,
  56153. h[m + 3] = b,
  56154. h[m + 4] = w,
  56155. h[m + 5] = _,
  56156. m += 6
  56157. }
  56158. this.setIndex(new n.BufferAttribute(h,1)),
  56159. this.addAttribute("position", new n.BufferAttribute(u,3)),
  56160. this.addAttribute("normal", new n.BufferAttribute(d,3)),
  56161. this.addAttribute("uv", new n.BufferAttribute(p,2))
  56162. }
  56163. ,
  56164. n.TorusBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  56165. n.TorusBufferGeometry.prototype.constructor = n.TorusBufferGeometry,
  56166. n.TorusGeometry = function(e, t, i, r, o) {
  56167. n.Geometry.call(this),
  56168. this.type = "TorusGeometry",
  56169. this.parameters = {
  56170. radius: e,
  56171. tube: t,
  56172. radialSegments: i,
  56173. tubularSegments: r,
  56174. arc: o
  56175. },
  56176. this.fromBufferGeometry(new n.TorusBufferGeometry(e,t,i,r,o))
  56177. }
  56178. ,
  56179. n.TorusGeometry.prototype = Object.create(n.Geometry.prototype),
  56180. n.TorusGeometry.prototype.constructor = n.TorusGeometry,
  56181. n.TorusKnotBufferGeometry = function(e, t, i, r, o, a) {
  56182. function s(e, t, i, n, r) {
  56183. var o = Math.cos(e)
  56184. , a = Math.sin(e)
  56185. , s = i / t * e
  56186. , l = Math.cos(s);
  56187. r.x = n * (2 + l) * .5 * o,
  56188. r.y = n * (2 + l) * a * .5,
  56189. r.z = n * Math.sin(s) * .5
  56190. }
  56191. n.BufferGeometry.call(this),
  56192. this.type = "TorusKnotBufferGeometry",
  56193. this.parameters = {
  56194. radius: e,
  56195. tube: t,
  56196. tubularSegments: i,
  56197. radialSegments: r,
  56198. p: o,
  56199. q: a
  56200. },
  56201. e = e || 100,
  56202. t = t || 40,
  56203. i = Math.floor(i) || 64,
  56204. r = Math.floor(r) || 8,
  56205. o = o || 2,
  56206. a = a || 3;
  56207. 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;
  56208. for (l = 0; l <= i; ++l) {
  56209. var T = l / i * o * Math.PI * 2;
  56210. for (s(T, o, a, e, I),
  56211. s(T + .01, o, a, e, E),
  56212. w.subVectors(E, I),
  56213. _.addVectors(E, I),
  56214. b.crossVectors(w, _),
  56215. _.crossVectors(b, w),
  56216. b.normalize(),
  56217. _.normalize(),
  56218. c = 0; c <= r; ++c) {
  56219. var x = c / r * Math.PI * 2
  56220. , S = -t * Math.cos(x)
  56221. , M = t * Math.sin(x);
  56222. A.x = I.x + (S * _.x + M * b.x),
  56223. A.y = I.y + (S * _.y + M * b.y),
  56224. A.z = I.z + (S * _.z + M * b.z),
  56225. p.setXYZ(m, A.x, A.y, A.z),
  56226. y.subVectors(A, I).normalize(),
  56227. f.setXYZ(m, y.x, y.y, y.z),
  56228. C.x = l / i,
  56229. C.y = c / r,
  56230. g.setXY(m, C.x, C.y),
  56231. m++
  56232. }
  56233. }
  56234. for (c = 1; c <= i; c++)
  56235. for (l = 1; l <= r; l++) {
  56236. var R = (r + 1) * (c - 1) + (l - 1)
  56237. , P = (r + 1) * c + (l - 1)
  56238. , O = (r + 1) * c + l
  56239. , L = (r + 1) * (c - 1) + l;
  56240. d.setX(v, R),
  56241. v++,
  56242. d.setX(v, P),
  56243. v++,
  56244. d.setX(v, L),
  56245. v++,
  56246. d.setX(v, P),
  56247. v++,
  56248. d.setX(v, O),
  56249. v++,
  56250. d.setX(v, L),
  56251. v++
  56252. }
  56253. this.setIndex(d),
  56254. this.addAttribute("position", p),
  56255. this.addAttribute("normal", f),
  56256. this.addAttribute("uv", g)
  56257. }
  56258. ,
  56259. n.TorusKnotBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  56260. n.TorusKnotBufferGeometry.prototype.constructor = n.TorusKnotBufferGeometry,
  56261. n.TorusKnotGeometry = function(e, t, i, r, o, a, s) {
  56262. n.Geometry.call(this),
  56263. this.type = "TorusKnotGeometry",
  56264. this.parameters = {
  56265. radius: e,
  56266. tube: t,
  56267. tubularSegments: i,
  56268. radialSegments: r,
  56269. p: o,
  56270. q: a
  56271. },
  56272. void 0 !== s && console.warn("THREE.TorusKnotGeometry: heightScale has been deprecated. Use .scale( x, y, z ) instead."),
  56273. this.fromBufferGeometry(new n.TorusKnotBufferGeometry(e,t,i,r,o,a)),
  56274. this.mergeVertices()
  56275. }
  56276. ,
  56277. n.TorusKnotGeometry.prototype = Object.create(n.Geometry.prototype),
  56278. n.TorusKnotGeometry.prototype.constructor = n.TorusKnotGeometry,
  56279. n.TubeGeometry = function(e, t, i, r, o, a) {
  56280. function s(e, t, i) {
  56281. return R.vertices.push(new n.Vector3(e,t,i)) - 1
  56282. }
  56283. n.Geometry.call(this),
  56284. this.type = "TubeGeometry",
  56285. this.parameters = {
  56286. path: e,
  56287. segments: t,
  56288. radius: i,
  56289. radialSegments: r,
  56290. closed: o,
  56291. taper: a
  56292. },
  56293. t = t || 64,
  56294. i = i || 1,
  56295. r = r || 8,
  56296. o = o || !1,
  56297. a = a || n.TubeGeometry.NoTaper;
  56298. 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;
  56299. for (this.tangents = D,
  56300. this.normals = N,
  56301. this.binormals = B,
  56302. v = 0; v < P; v++)
  56303. for (M[v] = [],
  56304. u = v / (P - 1),
  56305. m = e.getPointAt(u),
  56306. l = D[v],
  56307. c = N[v],
  56308. h = B[v],
  56309. p = i * a(u),
  56310. A = 0; A < r; A++)
  56311. d = A / r * 2 * Math.PI,
  56312. f = -p * Math.cos(d),
  56313. g = p * Math.sin(d),
  56314. O.copy(m),
  56315. O.x += f * c.x + g * h.x,
  56316. O.y += f * c.y + g * h.y,
  56317. O.z += f * c.z + g * h.z,
  56318. M[v][A] = s(O.x, O.y, O.z);
  56319. for (v = 0; v < t; v++)
  56320. for (A = 0; A < r; A++)
  56321. y = o ? (v + 1) % t : v + 1,
  56322. C = (A + 1) % r,
  56323. I = M[v][A],
  56324. E = M[y][A],
  56325. b = M[y][C],
  56326. w = M[v][C],
  56327. _ = new n.Vector2(v / t,A / r),
  56328. T = new n.Vector2((v + 1) / t,A / r),
  56329. x = new n.Vector2((v + 1) / t,(A + 1) / r),
  56330. S = new n.Vector2(v / t,(A + 1) / r),
  56331. this.faces.push(new n.Face3(I,E,w)),
  56332. this.faceVertexUvs[0].push([_, T, S]),
  56333. this.faces.push(new n.Face3(E,b,w)),
  56334. this.faceVertexUvs[0].push([T.clone(), x, S.clone()]);
  56335. this.computeFaceNormals(),
  56336. this.computeVertexNormals()
  56337. }
  56338. ,
  56339. n.TubeGeometry.prototype = Object.create(n.Geometry.prototype),
  56340. n.TubeGeometry.prototype.constructor = n.TubeGeometry,
  56341. n.TubeGeometry.NoTaper = function(e) {
  56342. return 1
  56343. }
  56344. ,
  56345. n.TubeGeometry.SinusoidalTaper = function(e) {
  56346. return Math.sin(Math.PI * e)
  56347. }
  56348. ,
  56349. n.TubeGeometry.FrenetFrames = function(e, t, i) {
  56350. function r() {
  56351. f[0] = new n.Vector3,
  56352. g[0] = new n.Vector3,
  56353. a = Number.MAX_VALUE,
  56354. s = Math.abs(p[0].x),
  56355. l = Math.abs(p[0].y),
  56356. c = Math.abs(p[0].z),
  56357. s <= a && (a = s,
  56358. d.set(1, 0, 0)),
  56359. l <= a && (a = l,
  56360. d.set(0, 1, 0)),
  56361. c <= a && d.set(0, 0, 1),
  56362. m.crossVectors(p[0], d).normalize(),
  56363. f[0].crossVectors(p[0], m),
  56364. g[0].crossVectors(p[0], f[0])
  56365. }
  56366. 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;
  56367. for (this.tangents = p,
  56368. this.normals = f,
  56369. this.binormals = g,
  56370. h = 0; h < A; h++)
  56371. u = h / (A - 1),
  56372. p[h] = e.getTangentAt(u),
  56373. p[h].normalize();
  56374. for (r(),
  56375. h = 1; h < A; h++)
  56376. f[h] = f[h - 1].clone(),
  56377. g[h] = g[h - 1].clone(),
  56378. m.crossVectors(p[h - 1], p[h]),
  56379. m.length() > Number.EPSILON && (m.normalize(),
  56380. o = Math.acos(n.Math.clamp(p[h - 1].dot(p[h]), -1, 1)),
  56381. f[h].applyMatrix4(v.makeRotationAxis(m, o))),
  56382. g[h].crossVectors(p[h], f[h]);
  56383. if (i)
  56384. for (o = Math.acos(n.Math.clamp(f[0].dot(f[A - 1]), -1, 1)),
  56385. o /= A - 1,
  56386. p[0].dot(m.crossVectors(f[0], f[A - 1])) > 0 && (o = -o),
  56387. h = 1; h < A; h++)
  56388. f[h].applyMatrix4(v.makeRotationAxis(p[h], o * h)),
  56389. g[h].crossVectors(p[h], f[h])
  56390. }
  56391. ,
  56392. n.PolyhedronGeometry = function(e, t, i, r) {
  56393. function o(e) {
  56394. var t = e.normalize().clone();
  56395. t.index = u.vertices.push(t) - 1;
  56396. var i = l(e) / 2 / Math.PI + .5
  56397. , r = c(e) / Math.PI + .5;
  56398. return t.uv = new n.Vector2(i,1 - r),
  56399. t
  56400. }
  56401. function a(e, t, i, r) {
  56402. var o = new n.Face3(e.index,t.index,i.index,[e.clone(), t.clone(), i.clone()],void 0,r);
  56403. u.faces.push(o),
  56404. C.copy(e).add(t).add(i).divideScalar(3);
  56405. var a = l(C);
  56406. u.faceVertexUvs[0].push([h(e.uv, e, a), h(t.uv, t, a), h(i.uv, i, a)])
  56407. }
  56408. function s(e, t) {
  56409. 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++) {
  56410. l[h] = [];
  56411. 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++)
  56412. 0 === g && h === i ? l[h][g] = d : l[h][g] = o(d.clone().lerp(p, g / f))
  56413. }
  56414. for (var h = 0; h < i; h++)
  56415. for (var g = 0; g < 2 * (i - h) - 1; g++) {
  56416. var m = Math.floor(g / 2);
  56417. 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)
  56418. }
  56419. }
  56420. function l(e) {
  56421. return Math.atan2(e.z, -e.x)
  56422. }
  56423. function c(e) {
  56424. return Math.atan2(-e.y, Math.sqrt(e.x * e.x + e.z * e.z))
  56425. }
  56426. function h(e, t, i) {
  56427. return i < 0 && 1 === e.x && (e = new n.Vector2(e.x - 1,e.y)),
  56428. 0 === t.x && 0 === t.z && (e = new n.Vector2(i / 2 / Math.PI + .5,e.y)),
  56429. e.clone()
  56430. }
  56431. n.Geometry.call(this),
  56432. this.type = "PolyhedronGeometry",
  56433. this.parameters = {
  56434. vertices: e,
  56435. indices: t,
  56436. radius: i,
  56437. detail: r
  56438. },
  56439. i = i || 1,
  56440. r = r || 0;
  56441. for (var u = this, d = 0, p = e.length; d < p; d += 3)
  56442. o(new n.Vector3(e[d],e[d + 1],e[d + 2]));
  56443. for (var f = this.vertices, g = [], d = 0, m = 0, p = t.length; d < p; d += 3,
  56444. m++) {
  56445. var v = f[t[d]]
  56446. , A = f[t[d + 1]]
  56447. , y = f[t[d + 2]];
  56448. g[m] = new n.Face3(v.index,A.index,y.index,[v.clone(), A.clone(), y.clone()],void 0,m)
  56449. }
  56450. for (var C = new n.Vector3, d = 0, p = g.length; d < p; d++)
  56451. s(g[d], r);
  56452. for (var d = 0, p = this.faceVertexUvs[0].length; d < p; d++) {
  56453. var I = this.faceVertexUvs[0][d]
  56454. , E = I[0].x
  56455. , b = I[1].x
  56456. , w = I[2].x
  56457. , _ = Math.max(E, b, w)
  56458. , T = Math.min(E, b, w);
  56459. _ > .9 && T < .1 && (E < .2 && (I[0].x += 1),
  56460. b < .2 && (I[1].x += 1),
  56461. w < .2 && (I[2].x += 1))
  56462. }
  56463. for (var d = 0, p = this.vertices.length; d < p; d++)
  56464. this.vertices[d].multiplyScalar(i);
  56465. this.mergeVertices(),
  56466. this.computeFaceNormals(),
  56467. this.boundingSphere = new n.Sphere(new n.Vector3,i)
  56468. }
  56469. ,
  56470. n.PolyhedronGeometry.prototype = Object.create(n.Geometry.prototype),
  56471. n.PolyhedronGeometry.prototype.constructor = n.PolyhedronGeometry,
  56472. n.DodecahedronGeometry = function(e, t) {
  56473. var i = (1 + Math.sqrt(5)) / 2
  56474. , r = 1 / i
  56475. , 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]
  56476. , 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];
  56477. n.PolyhedronGeometry.call(this, o, a, e, t),
  56478. this.type = "DodecahedronGeometry",
  56479. this.parameters = {
  56480. radius: e,
  56481. detail: t
  56482. }
  56483. }
  56484. ,
  56485. n.DodecahedronGeometry.prototype = Object.create(n.PolyhedronGeometry.prototype),
  56486. n.DodecahedronGeometry.prototype.constructor = n.DodecahedronGeometry,
  56487. n.IcosahedronGeometry = function(e, t) {
  56488. var i = (1 + Math.sqrt(5)) / 2
  56489. , 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]
  56490. , 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];
  56491. n.PolyhedronGeometry.call(this, r, o, e, t),
  56492. this.type = "IcosahedronGeometry",
  56493. this.parameters = {
  56494. radius: e,
  56495. detail: t
  56496. }
  56497. }
  56498. ,
  56499. n.IcosahedronGeometry.prototype = Object.create(n.PolyhedronGeometry.prototype),
  56500. n.IcosahedronGeometry.prototype.constructor = n.IcosahedronGeometry,
  56501. n.OctahedronGeometry = function(e, t) {
  56502. var i = [1, 0, 0, -1, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 1, 0, 0, -1]
  56503. , 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];
  56504. n.PolyhedronGeometry.call(this, i, r, e, t),
  56505. this.type = "OctahedronGeometry",
  56506. this.parameters = {
  56507. radius: e,
  56508. detail: t
  56509. }
  56510. }
  56511. ,
  56512. n.OctahedronGeometry.prototype = Object.create(n.PolyhedronGeometry.prototype),
  56513. n.OctahedronGeometry.prototype.constructor = n.OctahedronGeometry,
  56514. n.TetrahedronGeometry = function(e, t) {
  56515. var i = [1, 1, 1, -1, -1, 1, -1, 1, -1, 1, -1, -1]
  56516. , r = [2, 1, 0, 0, 3, 2, 1, 3, 0, 2, 3, 1];
  56517. n.PolyhedronGeometry.call(this, i, r, e, t),
  56518. this.type = "TetrahedronGeometry",
  56519. this.parameters = {
  56520. radius: e,
  56521. detail: t
  56522. }
  56523. }
  56524. ,
  56525. n.TetrahedronGeometry.prototype = Object.create(n.PolyhedronGeometry.prototype),
  56526. n.TetrahedronGeometry.prototype.constructor = n.TetrahedronGeometry,
  56527. n.ParametricGeometry = function(e, t, i) {
  56528. n.Geometry.call(this),
  56529. this.type = "ParametricGeometry",
  56530. this.parameters = {
  56531. func: e,
  56532. slices: t,
  56533. stacks: i
  56534. };
  56535. var r, o, a, s, l, c = this.vertices, h = this.faces, u = this.faceVertexUvs[0], d = t + 1;
  56536. for (r = 0; r <= i; r++)
  56537. for (l = r / i,
  56538. o = 0; o <= t; o++)
  56539. s = o / t,
  56540. a = e(s, l),
  56541. c.push(a);
  56542. var p, f, g, m, v, A, y, C;
  56543. for (r = 0; r < i; r++)
  56544. for (o = 0; o < t; o++)
  56545. p = r * d + o,
  56546. f = r * d + o + 1,
  56547. g = (r + 1) * d + o + 1,
  56548. m = (r + 1) * d + o,
  56549. v = new n.Vector2(o / t,r / i),
  56550. A = new n.Vector2((o + 1) / t,r / i),
  56551. y = new n.Vector2((o + 1) / t,(r + 1) / i),
  56552. C = new n.Vector2(o / t,(r + 1) / i),
  56553. h.push(new n.Face3(p,f,m)),
  56554. u.push([v, A, C]),
  56555. h.push(new n.Face3(f,g,m)),
  56556. u.push([A.clone(), y, C.clone()]);
  56557. this.computeFaceNormals(),
  56558. this.computeVertexNormals()
  56559. }
  56560. ,
  56561. n.ParametricGeometry.prototype = Object.create(n.Geometry.prototype),
  56562. n.ParametricGeometry.prototype.constructor = n.ParametricGeometry,
  56563. n.WireframeGeometry = function(e) {
  56564. function t(e, t) {
  56565. return e - t
  56566. }
  56567. n.BufferGeometry.call(this);
  56568. var i = [0, 0]
  56569. , r = {}
  56570. , o = ["a", "b", "c"];
  56571. if (e instanceof n.Geometry) {
  56572. for (var a = e.vertices, s = e.faces, l = 0, c = new Uint32Array(6 * s.length), h = 0, u = s.length; h < u; h++)
  56573. for (var d = s[h], p = 0; p < 3; p++) {
  56574. i[0] = d[o[p]],
  56575. i[1] = d[o[(p + 1) % 3]],
  56576. i.sort(t);
  56577. var f = i.toString();
  56578. void 0 === r[f] && (c[2 * l] = i[0],
  56579. c[2 * l + 1] = i[1],
  56580. r[f] = !0,
  56581. l++)
  56582. }
  56583. for (var g = new Float32Array(2 * l * 3), h = 0, u = l; h < u; h++)
  56584. for (var p = 0; p < 2; p++) {
  56585. var m = a[c[2 * h + p]]
  56586. , v = 6 * h + 3 * p;
  56587. g[v + 0] = m.x,
  56588. g[v + 1] = m.y,
  56589. g[v + 2] = m.z
  56590. }
  56591. this.addAttribute("position", new n.BufferAttribute(g,3))
  56592. } else if (e instanceof n.BufferGeometry)
  56593. if (null !== e.index) {
  56594. var A = e.index.array
  56595. , a = e.attributes.position
  56596. , y = e.groups
  56597. , l = 0;
  56598. 0 === y.length && e.addGroup(0, A.length);
  56599. for (var c = new Uint32Array(2 * A.length), C = 0, I = y.length; C < I; ++C)
  56600. for (var E = y[C], b = E.start, w = E.count, h = b, _ = b + w; h < _; h += 3)
  56601. for (var p = 0; p < 3; p++) {
  56602. i[0] = A[h + p],
  56603. i[1] = A[h + (p + 1) % 3],
  56604. i.sort(t);
  56605. var f = i.toString();
  56606. void 0 === r[f] && (c[2 * l] = i[0],
  56607. c[2 * l + 1] = i[1],
  56608. r[f] = !0,
  56609. l++)
  56610. }
  56611. for (var g = new Float32Array(2 * l * 3), h = 0, u = l; h < u; h++)
  56612. for (var p = 0; p < 2; p++) {
  56613. var v = 6 * h + 3 * p
  56614. , T = c[2 * h + p];
  56615. g[v + 0] = a.getX(T),
  56616. g[v + 1] = a.getY(T),
  56617. g[v + 2] = a.getZ(T)
  56618. }
  56619. this.addAttribute("position", new n.BufferAttribute(g,3))
  56620. } else {
  56621. 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++)
  56622. for (var p = 0; p < 3; p++) {
  56623. var v = 18 * h + 6 * p
  56624. , S = 9 * h + 3 * p;
  56625. g[v + 0] = a[S],
  56626. g[v + 1] = a[S + 1],
  56627. g[v + 2] = a[S + 2];
  56628. var T = 9 * h + 3 * ((p + 1) % 3);
  56629. g[v + 3] = a[T],
  56630. g[v + 4] = a[T + 1],
  56631. g[v + 5] = a[T + 2]
  56632. }
  56633. this.addAttribute("position", new n.BufferAttribute(g,3))
  56634. }
  56635. }
  56636. ,
  56637. n.WireframeGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  56638. n.WireframeGeometry.prototype.constructor = n.WireframeGeometry,
  56639. n.AxisHelper = function(e) {
  56640. e = e || 1;
  56641. var t = new Float32Array([0, 0, 0, e, 0, 0, 0, 0, 0, 0, e, 0, 0, 0, 0, 0, 0, e])
  56642. , i = new Float32Array([1, 0, 0, 1, .6, 0, 0, 1, 0, .6, 1, 0, 0, 0, 1, 0, .6, 1])
  56643. , r = new n.BufferGeometry;
  56644. r.addAttribute("position", new n.BufferAttribute(t,3)),
  56645. r.addAttribute("color", new n.BufferAttribute(i,3));
  56646. var o = new n.LineBasicMaterial({
  56647. vertexColors: n.VertexColors
  56648. });
  56649. n.LineSegments.call(this, r, o)
  56650. }
  56651. ,
  56652. n.AxisHelper.prototype = Object.create(n.LineSegments.prototype),
  56653. n.AxisHelper.prototype.constructor = n.AxisHelper,
  56654. n.ArrowHelper = function() {
  56655. var e = new n.Geometry;
  56656. e.vertices.push(new n.Vector3(0,0,0), new n.Vector3(0,1,0));
  56657. var t = new n.CylinderGeometry(0,.5,1,5,1);
  56658. return t.translate(0, -.5, 0),
  56659. function(i, r, o, a, s, l) {
  56660. n.Object3D.call(this),
  56661. void 0 === a && (a = 16776960),
  56662. void 0 === o && (o = 1),
  56663. void 0 === s && (s = .2 * o),
  56664. void 0 === l && (l = .2 * s),
  56665. this.position.copy(r),
  56666. this.line = new n.Line(e,new n.LineBasicMaterial({
  56667. color: a
  56668. })),
  56669. this.line.matrixAutoUpdate = !1,
  56670. this.add(this.line),
  56671. this.cone = new n.Mesh(t,new n.MeshBasicMaterial({
  56672. color: a
  56673. })),
  56674. this.cone.matrixAutoUpdate = !1,
  56675. this.add(this.cone),
  56676. this.setDirection(i),
  56677. this.setLength(o, s, l)
  56678. }
  56679. }(),
  56680. n.ArrowHelper.prototype = Object.create(n.Object3D.prototype),
  56681. n.ArrowHelper.prototype.constructor = n.ArrowHelper,
  56682. n.ArrowHelper.prototype.setDirection = function() {
  56683. var e, t = new n.Vector3;
  56684. return function(i) {
  56685. 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(),
  56686. e = Math.acos(i.y),
  56687. this.quaternion.setFromAxisAngle(t, e))
  56688. }
  56689. }(),
  56690. n.ArrowHelper.prototype.setLength = function(e, t, i) {
  56691. void 0 === t && (t = .2 * e),
  56692. void 0 === i && (i = .2 * t),
  56693. this.line.scale.set(1, Math.max(0, e - t), 1),
  56694. this.line.updateMatrix(),
  56695. this.cone.scale.set(i, t, i),
  56696. this.cone.position.y = e,
  56697. this.cone.updateMatrix()
  56698. }
  56699. ,
  56700. n.ArrowHelper.prototype.setColor = function(e) {
  56701. this.line.material.color.set(e),
  56702. this.cone.material.color.set(e)
  56703. }
  56704. ,
  56705. n.BoxHelper = function(e) {
  56706. 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])
  56707. , i = new Float32Array(24)
  56708. , r = new n.BufferGeometry;
  56709. r.setIndex(new n.BufferAttribute(t,1)),
  56710. r.addAttribute("position", new n.BufferAttribute(i,3)),
  56711. n.LineSegments.call(this, r, new n.LineBasicMaterial({
  56712. color: 16776960
  56713. })),
  56714. void 0 !== e && this.update(e)
  56715. }
  56716. ,
  56717. n.BoxHelper.prototype = Object.create(n.LineSegments.prototype),
  56718. n.BoxHelper.prototype.constructor = n.BoxHelper,
  56719. n.BoxHelper.prototype.update = function() {
  56720. var e = new n.Box3;
  56721. return function(t) {
  56722. if (e.setFromObject(t),
  56723. !e.isEmpty()) {
  56724. var i = e.min
  56725. , n = e.max
  56726. , r = this.geometry.attributes.position
  56727. , o = r.array;
  56728. o[0] = n.x,
  56729. o[1] = n.y,
  56730. o[2] = n.z,
  56731. o[3] = i.x,
  56732. o[4] = n.y,
  56733. o[5] = n.z,
  56734. o[6] = i.x,
  56735. o[7] = i.y,
  56736. o[8] = n.z,
  56737. o[9] = n.x,
  56738. o[10] = i.y,
  56739. o[11] = n.z,
  56740. o[12] = n.x,
  56741. o[13] = n.y,
  56742. o[14] = i.z,
  56743. o[15] = i.x,
  56744. o[16] = n.y,
  56745. o[17] = i.z,
  56746. o[18] = i.x,
  56747. o[19] = i.y,
  56748. o[20] = i.z,
  56749. o[21] = n.x,
  56750. o[22] = i.y,
  56751. o[23] = i.z,
  56752. r.needsUpdate = !0,
  56753. this.geometry.computeBoundingSphere()
  56754. }
  56755. }
  56756. }(),
  56757. n.BoundingBoxHelper = function(e, t) {
  56758. var i = void 0 !== t ? t : 8947848;
  56759. this.object = e,
  56760. this.box = new n.Box3,
  56761. n.Mesh.call(this, new n.BoxGeometry(1,1,1), new n.MeshBasicMaterial({
  56762. color: i,
  56763. wireframe: !0
  56764. }))
  56765. }
  56766. ,
  56767. n.BoundingBoxHelper.prototype = Object.create(n.Mesh.prototype),
  56768. n.BoundingBoxHelper.prototype.constructor = n.BoundingBoxHelper,
  56769. n.BoundingBoxHelper.prototype.update = function() {
  56770. this.box.setFromObject(this.object),
  56771. this.box.size(this.scale),
  56772. this.box.center(this.position)
  56773. }
  56774. ,
  56775. n.CameraHelper = function(e) {
  56776. function t(e, t, n) {
  56777. i(e, n),
  56778. i(t, n)
  56779. }
  56780. function i(e, t) {
  56781. r.vertices.push(new n.Vector3),
  56782. r.colors.push(new n.Color(t)),
  56783. void 0 === a[e] && (a[e] = []),
  56784. a[e].push(r.vertices.length - 1)
  56785. }
  56786. var r = new n.Geometry
  56787. , o = new n.LineBasicMaterial({
  56788. color: 16777215,
  56789. vertexColors: n.FaceColors
  56790. })
  56791. , a = {}
  56792. , s = 16755200
  56793. , l = 16711680
  56794. , c = 43775
  56795. , h = 16777215
  56796. , u = 3355443;
  56797. t("n1", "n2", s),
  56798. t("n2", "n4", s),
  56799. t("n4", "n3", s),
  56800. t("n3", "n1", s),
  56801. t("f1", "f2", s),
  56802. t("f2", "f4", s),
  56803. t("f4", "f3", s),
  56804. t("f3", "f1", s),
  56805. t("n1", "f1", s),
  56806. t("n2", "f2", s),
  56807. t("n3", "f3", s),
  56808. t("n4", "f4", s),
  56809. t("p", "n1", l),
  56810. t("p", "n2", l),
  56811. t("p", "n3", l),
  56812. t("p", "n4", l),
  56813. t("u1", "u2", c),
  56814. t("u2", "u3", c),
  56815. t("u3", "u1", c),
  56816. t("c", "t", h),
  56817. t("p", "c", u),
  56818. t("cn1", "cn2", u),
  56819. t("cn3", "cn4", u),
  56820. t("cf1", "cf2", u),
  56821. t("cf3", "cf4", u),
  56822. n.LineSegments.call(this, r, o),
  56823. this.camera = e,
  56824. this.camera.updateProjectionMatrix(),
  56825. this.matrix = e.matrixWorld,
  56826. this.matrixAutoUpdate = !1,
  56827. this.pointMap = a,
  56828. this.update()
  56829. }
  56830. ,
  56831. n.CameraHelper.prototype = Object.create(n.LineSegments.prototype),
  56832. n.CameraHelper.prototype.constructor = n.CameraHelper,
  56833. n.CameraHelper.prototype.update = function() {
  56834. function e(e, n, a, s) {
  56835. r.set(n, a, s).unproject(o);
  56836. var l = i[e];
  56837. if (void 0 !== l)
  56838. for (var c = 0, h = l.length; c < h; c++)
  56839. t.vertices[l[c]].copy(r)
  56840. }
  56841. var t, i, r = new n.Vector3, o = new n.Camera;
  56842. return function() {
  56843. t = this.geometry,
  56844. i = this.pointMap;
  56845. var n = 1
  56846. , r = 1;
  56847. o.projectionMatrix.copy(this.camera.projectionMatrix),
  56848. e("c", 0, 0, -1),
  56849. e("t", 0, 0, 1),
  56850. e("n1", -n, -r, -1),
  56851. e("n2", n, -r, -1),
  56852. e("n3", -n, r, -1),
  56853. e("n4", n, r, -1),
  56854. e("f1", -n, -r, 1),
  56855. e("f2", n, -r, 1),
  56856. e("f3", -n, r, 1),
  56857. e("f4", n, r, 1),
  56858. e("u1", .7 * n, 1.1 * r, -1),
  56859. e("u2", .7 * -n, 1.1 * r, -1),
  56860. e("u3", 0, 2 * r, -1),
  56861. e("cf1", -n, 0, 1),
  56862. e("cf2", n, 0, 1),
  56863. e("cf3", 0, -r, 1),
  56864. e("cf4", 0, r, 1),
  56865. e("cn1", -n, 0, -1),
  56866. e("cn2", n, 0, -1),
  56867. e("cn3", 0, -r, -1),
  56868. e("cn4", 0, r, -1),
  56869. t.verticesNeedUpdate = !0
  56870. }
  56871. }(),
  56872. n.DirectionalLightHelper = function(e, t) {
  56873. n.Object3D.call(this),
  56874. this.light = e,
  56875. this.light.updateMatrixWorld(),
  56876. this.matrix = e.matrixWorld,
  56877. this.matrixAutoUpdate = !1,
  56878. t = t || 1;
  56879. var i = new n.Geometry;
  56880. 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));
  56881. var r = new n.LineBasicMaterial({
  56882. fog: !1
  56883. });
  56884. r.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  56885. this.lightPlane = new n.Line(i,r),
  56886. this.add(this.lightPlane),
  56887. i = new n.Geometry,
  56888. i.vertices.push(new n.Vector3, new n.Vector3),
  56889. r = new n.LineBasicMaterial({
  56890. fog: !1
  56891. }),
  56892. r.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  56893. this.targetLine = new n.Line(i,r),
  56894. this.add(this.targetLine),
  56895. this.update()
  56896. }
  56897. ,
  56898. n.DirectionalLightHelper.prototype = Object.create(n.Object3D.prototype),
  56899. n.DirectionalLightHelper.prototype.constructor = n.DirectionalLightHelper,
  56900. n.DirectionalLightHelper.prototype.dispose = function() {
  56901. this.lightPlane.geometry.dispose(),
  56902. this.lightPlane.material.dispose(),
  56903. this.targetLine.geometry.dispose(),
  56904. this.targetLine.material.dispose()
  56905. }
  56906. ,
  56907. n.DirectionalLightHelper.prototype.update = function() {
  56908. var e = new n.Vector3
  56909. , t = new n.Vector3
  56910. , i = new n.Vector3;
  56911. return function() {
  56912. e.setFromMatrixPosition(this.light.matrixWorld),
  56913. t.setFromMatrixPosition(this.light.target.matrixWorld),
  56914. i.subVectors(t, e),
  56915. this.lightPlane.lookAt(i),
  56916. this.lightPlane.material.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  56917. this.targetLine.geometry.vertices[1].copy(i),
  56918. this.targetLine.geometry.verticesNeedUpdate = !0,
  56919. this.targetLine.material.color.copy(this.lightPlane.material.color)
  56920. }
  56921. }(),
  56922. n.EdgesHelper = function(e, t, i) {
  56923. var r = void 0 !== t ? t : 16777215;
  56924. n.LineSegments.call(this, new n.EdgesGeometry(e.geometry,i), new n.LineBasicMaterial({
  56925. color: r
  56926. })),
  56927. this.matrix = e.matrixWorld,
  56928. this.matrixAutoUpdate = !1
  56929. }
  56930. ,
  56931. n.EdgesHelper.prototype = Object.create(n.LineSegments.prototype),
  56932. n.EdgesHelper.prototype.constructor = n.EdgesHelper,
  56933. n.FaceNormalsHelper = function(e, t, i, r) {
  56934. this.object = e,
  56935. this.size = void 0 !== t ? t : 1;
  56936. var o = void 0 !== i ? i : 16776960
  56937. , a = void 0 !== r ? r : 1
  56938. , s = 0
  56939. , l = this.object.geometry;
  56940. l instanceof n.Geometry ? s = l.faces.length : console.warn("THREE.FaceNormalsHelper: only THREE.Geometry is supported. Use THREE.VertexNormalsHelper, instead.");
  56941. var c = new n.BufferGeometry
  56942. , h = new n.Float32Attribute(2 * s * 3,3);
  56943. c.addAttribute("position", h),
  56944. n.LineSegments.call(this, c, new n.LineBasicMaterial({
  56945. color: o,
  56946. linewidth: a
  56947. })),
  56948. this.matrixAutoUpdate = !1,
  56949. this.update()
  56950. }
  56951. ,
  56952. n.FaceNormalsHelper.prototype = Object.create(n.LineSegments.prototype),
  56953. n.FaceNormalsHelper.prototype.constructor = n.FaceNormalsHelper,
  56954. n.FaceNormalsHelper.prototype.update = function() {
  56955. var e = new n.Vector3
  56956. , t = new n.Vector3
  56957. , i = new n.Matrix3;
  56958. return function() {
  56959. this.object.updateMatrixWorld(!0),
  56960. i.getNormalMatrix(this.object.matrixWorld);
  56961. 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++) {
  56962. var u = s[c]
  56963. , d = u.normal;
  56964. e.copy(a[u.a]).add(a[u.b]).add(a[u.c]).divideScalar(3).applyMatrix4(n),
  56965. t.copy(d).applyMatrix3(i).normalize().multiplyScalar(this.size).add(e),
  56966. r.setXYZ(l, e.x, e.y, e.z),
  56967. l += 1,
  56968. r.setXYZ(l, t.x, t.y, t.z),
  56969. l += 1
  56970. }
  56971. return r.needsUpdate = !0,
  56972. this
  56973. }
  56974. }(),
  56975. n.GridHelper = function(e, t) {
  56976. var i = new n.Geometry
  56977. , r = new n.LineBasicMaterial({
  56978. vertexColors: n.VertexColors
  56979. });
  56980. this.color1 = new n.Color(4473924),
  56981. this.color2 = new n.Color(8947848);
  56982. for (var o = -e; o <= e; o += t) {
  56983. 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));
  56984. var a = 0 === o ? this.color1 : this.color2;
  56985. i.colors.push(a, a, a, a)
  56986. }
  56987. n.LineSegments.call(this, i, r)
  56988. }
  56989. ,
  56990. n.GridHelper.prototype = Object.create(n.LineSegments.prototype),
  56991. n.GridHelper.prototype.constructor = n.GridHelper,
  56992. n.GridHelper.prototype.setColors = function(e, t) {
  56993. this.color1.set(e),
  56994. this.color2.set(t),
  56995. this.geometry.colorsNeedUpdate = !0
  56996. }
  56997. ,
  56998. n.HemisphereLightHelper = function(e, t) {
  56999. n.Object3D.call(this),
  57000. this.light = e,
  57001. this.light.updateMatrixWorld(),
  57002. this.matrix = e.matrixWorld,
  57003. this.matrixAutoUpdate = !1,
  57004. this.colors = [new n.Color, new n.Color];
  57005. var i = new n.SphereGeometry(t,4,2);
  57006. i.rotateX(-Math.PI / 2);
  57007. for (var r = 0, o = 8; r < o; r++)
  57008. i.faces[r].color = this.colors[r < 4 ? 0 : 1];
  57009. var a = new n.MeshBasicMaterial({
  57010. vertexColors: n.FaceColors,
  57011. wireframe: !0
  57012. });
  57013. this.lightSphere = new n.Mesh(i,a),
  57014. this.add(this.lightSphere),
  57015. this.update()
  57016. }
  57017. ,
  57018. n.HemisphereLightHelper.prototype = Object.create(n.Object3D.prototype),
  57019. n.HemisphereLightHelper.prototype.constructor = n.HemisphereLightHelper,
  57020. n.HemisphereLightHelper.prototype.dispose = function() {
  57021. this.lightSphere.geometry.dispose(),
  57022. this.lightSphere.material.dispose()
  57023. }
  57024. ,
  57025. n.HemisphereLightHelper.prototype.update = function() {
  57026. var e = new n.Vector3;
  57027. return function() {
  57028. this.colors[0].copy(this.light.color).multiplyScalar(this.light.intensity),
  57029. this.colors[1].copy(this.light.groundColor).multiplyScalar(this.light.intensity),
  57030. this.lightSphere.lookAt(e.setFromMatrixPosition(this.light.matrixWorld).negate()),
  57031. this.lightSphere.geometry.colorsNeedUpdate = !0
  57032. }
  57033. }(),
  57034. n.PointLightHelper = function(e, t) {
  57035. this.light = e,
  57036. this.light.updateMatrixWorld();
  57037. var i = new n.SphereGeometry(t,4,2)
  57038. , r = new n.MeshBasicMaterial({
  57039. wireframe: !0,
  57040. fog: !1
  57041. });
  57042. r.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  57043. n.Mesh.call(this, i, r),
  57044. this.matrix = this.light.matrixWorld,
  57045. this.matrixAutoUpdate = !1
  57046. }
  57047. ,
  57048. n.PointLightHelper.prototype = Object.create(n.Mesh.prototype),
  57049. n.PointLightHelper.prototype.constructor = n.PointLightHelper,
  57050. n.PointLightHelper.prototype.dispose = function() {
  57051. this.geometry.dispose(),
  57052. this.material.dispose()
  57053. }
  57054. ,
  57055. n.PointLightHelper.prototype.update = function() {
  57056. this.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)
  57057. }
  57058. ,
  57059. n.SkeletonHelper = function(e) {
  57060. this.bones = this.getBoneList(e);
  57061. for (var t = new n.Geometry, i = 0; i < this.bones.length; i++) {
  57062. var r = this.bones[i];
  57063. r.parent instanceof n.Bone && (t.vertices.push(new n.Vector3),
  57064. t.vertices.push(new n.Vector3),
  57065. t.colors.push(new n.Color(0,0,1)),
  57066. t.colors.push(new n.Color(0,1,0)))
  57067. }
  57068. t.dynamic = !0;
  57069. var o = new n.LineBasicMaterial({
  57070. vertexColors: n.VertexColors,
  57071. depthTest: !1,
  57072. depthWrite: !1,
  57073. transparent: !0
  57074. });
  57075. n.LineSegments.call(this, t, o),
  57076. this.root = e,
  57077. this.matrix = e.matrixWorld,
  57078. this.matrixAutoUpdate = !1,
  57079. this.update()
  57080. }
  57081. ,
  57082. n.SkeletonHelper.prototype = Object.create(n.LineSegments.prototype),
  57083. n.SkeletonHelper.prototype.constructor = n.SkeletonHelper,
  57084. n.SkeletonHelper.prototype.getBoneList = function(e) {
  57085. var t = [];
  57086. e instanceof n.Bone && t.push(e);
  57087. for (var i = 0; i < e.children.length; i++)
  57088. t.push.apply(t, this.getBoneList(e.children[i]));
  57089. return t
  57090. }
  57091. ,
  57092. n.SkeletonHelper.prototype.update = function() {
  57093. 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++) {
  57094. var a = this.bones[o];
  57095. a.parent instanceof n.Bone && (i.multiplyMatrices(t, a.matrixWorld),
  57096. e.vertices[r].setFromMatrixPosition(i),
  57097. i.multiplyMatrices(t, a.parent.matrixWorld),
  57098. e.vertices[r + 1].setFromMatrixPosition(i),
  57099. r += 2)
  57100. }
  57101. e.verticesNeedUpdate = !0,
  57102. e.computeBoundingSphere()
  57103. }
  57104. ,
  57105. n.SpotLightHelper = function(e) {
  57106. n.Object3D.call(this),
  57107. this.light = e,
  57108. this.light.updateMatrixWorld(),
  57109. this.matrix = e.matrixWorld,
  57110. this.matrixAutoUpdate = !1;
  57111. var t = new n.CylinderGeometry(0,1,1,8,1,!0);
  57112. t.translate(0, -.5, 0),
  57113. t.rotateX(-Math.PI / 2);
  57114. var i = new n.MeshBasicMaterial({
  57115. wireframe: !0,
  57116. fog: !1
  57117. });
  57118. this.cone = new n.Mesh(t,i),
  57119. this.add(this.cone),
  57120. this.update()
  57121. }
  57122. ,
  57123. n.SpotLightHelper.prototype = Object.create(n.Object3D.prototype),
  57124. n.SpotLightHelper.prototype.constructor = n.SpotLightHelper,
  57125. n.SpotLightHelper.prototype.dispose = function() {
  57126. this.cone.geometry.dispose(),
  57127. this.cone.material.dispose()
  57128. }
  57129. ,
  57130. n.SpotLightHelper.prototype.update = function() {
  57131. var e = new n.Vector3
  57132. , t = new n.Vector3;
  57133. return function() {
  57134. var i = this.light.distance ? this.light.distance : 1e4
  57135. , n = i * Math.tan(this.light.angle);
  57136. this.cone.scale.set(n, n, i),
  57137. e.setFromMatrixPosition(this.light.matrixWorld),
  57138. t.setFromMatrixPosition(this.light.target.matrixWorld),
  57139. this.cone.lookAt(t.sub(e)),
  57140. this.cone.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)
  57141. }
  57142. }(),
  57143. n.VertexNormalsHelper = function(e, t, i, r) {
  57144. this.object = e,
  57145. this.size = void 0 !== t ? t : 1;
  57146. var o = void 0 !== i ? i : 16711680
  57147. , a = void 0 !== r ? r : 1
  57148. , s = 0
  57149. , l = this.object.geometry;
  57150. l instanceof n.Geometry ? s = 3 * l.faces.length : l instanceof n.BufferGeometry && (s = l.attributes.normal.count);
  57151. var c = new n.BufferGeometry
  57152. , h = new n.Float32Attribute(2 * s * 3,3);
  57153. c.addAttribute("position", h),
  57154. n.LineSegments.call(this, c, new n.LineBasicMaterial({
  57155. color: o,
  57156. linewidth: a
  57157. })),
  57158. this.matrixAutoUpdate = !1,
  57159. this.update()
  57160. }
  57161. ,
  57162. n.VertexNormalsHelper.prototype = Object.create(n.LineSegments.prototype),
  57163. n.VertexNormalsHelper.prototype.constructor = n.VertexNormalsHelper,
  57164. n.VertexNormalsHelper.prototype.update = function() {
  57165. var e = new n.Vector3
  57166. , t = new n.Vector3
  57167. , i = new n.Matrix3;
  57168. return function() {
  57169. var r = ["a", "b", "c"];
  57170. this.object.updateMatrixWorld(!0),
  57171. i.getNormalMatrix(this.object.matrixWorld);
  57172. var o = this.object.matrixWorld
  57173. , a = this.geometry.attributes.position
  57174. , s = this.object.geometry;
  57175. if (s instanceof n.Geometry)
  57176. for (var l = s.vertices, c = s.faces, h = 0, u = 0, d = c.length; u < d; u++)
  57177. for (var p = c[u], f = 0, g = p.vertexNormals.length; f < g; f++) {
  57178. var m = l[p[r[f]]]
  57179. , v = p.vertexNormals[f];
  57180. e.copy(m).applyMatrix4(o),
  57181. t.copy(v).applyMatrix3(i).normalize().multiplyScalar(this.size).add(e),
  57182. a.setXYZ(h, e.x, e.y, e.z),
  57183. h += 1,
  57184. a.setXYZ(h, t.x, t.y, t.z),
  57185. h += 1
  57186. }
  57187. else if (s instanceof n.BufferGeometry)
  57188. for (var A = s.attributes.position, y = s.attributes.normal, h = 0, f = 0, g = A.count; f < g; f++)
  57189. e.set(A.getX(f), A.getY(f), A.getZ(f)).applyMatrix4(o),
  57190. t.set(y.getX(f), y.getY(f), y.getZ(f)),
  57191. t.applyMatrix3(i).normalize().multiplyScalar(this.size).add(e),
  57192. a.setXYZ(h, e.x, e.y, e.z),
  57193. h += 1,
  57194. a.setXYZ(h, t.x, t.y, t.z),
  57195. h += 1;
  57196. return a.needsUpdate = !0,
  57197. this
  57198. }
  57199. }(),
  57200. n.WireframeHelper = function(e, t) {
  57201. var i = void 0 !== t ? t : 16777215;
  57202. n.LineSegments.call(this, new n.WireframeGeometry(e.geometry), new n.LineBasicMaterial({
  57203. color: i
  57204. })),
  57205. this.matrix = e.matrixWorld,
  57206. this.matrixAutoUpdate = !1
  57207. }
  57208. ,
  57209. n.WireframeHelper.prototype = Object.create(n.LineSegments.prototype),
  57210. n.WireframeHelper.prototype.constructor = n.WireframeHelper,
  57211. n.ImmediateRenderObject = function(e) {
  57212. n.Object3D.call(this),
  57213. this.material = e,
  57214. this.render = function(e) {}
  57215. }
  57216. ,
  57217. n.ImmediateRenderObject.prototype = Object.create(n.Object3D.prototype),
  57218. n.ImmediateRenderObject.prototype.constructor = n.ImmediateRenderObject,
  57219. n.MorphBlendMesh = function(e, t) {
  57220. n.Mesh.call(this, e, t),
  57221. this.animationsMap = {},
  57222. this.animationsList = [];
  57223. var i = this.geometry.morphTargets.length
  57224. , r = "__default"
  57225. , o = 0
  57226. , a = i - 1
  57227. , s = i / 1;
  57228. this.createAnimation(r, o, a, s),
  57229. this.setAnimationWeight(r, 1)
  57230. }
  57231. ,
  57232. n.MorphBlendMesh.prototype = Object.create(n.Mesh.prototype),
  57233. n.MorphBlendMesh.prototype.constructor = n.MorphBlendMesh,
  57234. n.MorphBlendMesh.prototype.createAnimation = function(e, t, i, n) {
  57235. var r = {
  57236. start: t,
  57237. end: i,
  57238. length: i - t + 1,
  57239. fps: n,
  57240. duration: (i - t) / n,
  57241. lastFrame: 0,
  57242. currentFrame: 0,
  57243. active: !1,
  57244. time: 0,
  57245. direction: 1,
  57246. weight: 1,
  57247. directionBackwards: !1,
  57248. mirroredLoop: !1
  57249. };
  57250. this.animationsMap[e] = r,
  57251. this.animationsList.push(r)
  57252. }
  57253. ,
  57254. n.MorphBlendMesh.prototype.autoCreateAnimations = function(e) {
  57255. for (var t, i = /([a-z]+)_?(\d+)/i, n = {}, r = this.geometry, o = 0, a = r.morphTargets.length; o < a; o++) {
  57256. var s = r.morphTargets[o]
  57257. , l = s.name.match(i);
  57258. if (l && l.length > 1) {
  57259. var c = l[1];
  57260. n[c] || (n[c] = {
  57261. start: 1 / 0,
  57262. end: -(1 / 0)
  57263. });
  57264. var h = n[c];
  57265. o < h.start && (h.start = o),
  57266. o > h.end && (h.end = o),
  57267. t || (t = c)
  57268. }
  57269. }
  57270. for (var c in n) {
  57271. var h = n[c];
  57272. this.createAnimation(c, h.start, h.end, e)
  57273. }
  57274. this.firstAnimation = t
  57275. }
  57276. ,
  57277. n.MorphBlendMesh.prototype.setAnimationDirectionForward = function(e) {
  57278. var t = this.animationsMap[e];
  57279. t && (t.direction = 1,
  57280. t.directionBackwards = !1)
  57281. }
  57282. ,
  57283. n.MorphBlendMesh.prototype.setAnimationDirectionBackward = function(e) {
  57284. var t = this.animationsMap[e];
  57285. t && (t.direction = -1,
  57286. t.directionBackwards = !0)
  57287. }
  57288. ,
  57289. n.MorphBlendMesh.prototype.setAnimationFPS = function(e, t) {
  57290. var i = this.animationsMap[e];
  57291. i && (i.fps = t,
  57292. i.duration = (i.end - i.start) / i.fps)
  57293. }
  57294. ,
  57295. n.MorphBlendMesh.prototype.setAnimationDuration = function(e, t) {
  57296. var i = this.animationsMap[e];
  57297. i && (i.duration = t,
  57298. i.fps = (i.end - i.start) / i.duration)
  57299. }
  57300. ,
  57301. n.MorphBlendMesh.prototype.setAnimationWeight = function(e, t) {
  57302. var i = this.animationsMap[e];
  57303. i && (i.weight = t)
  57304. }
  57305. ,
  57306. n.MorphBlendMesh.prototype.setAnimationTime = function(e, t) {
  57307. var i = this.animationsMap[e];
  57308. i && (i.time = t)
  57309. }
  57310. ,
  57311. n.MorphBlendMesh.prototype.getAnimationTime = function(e) {
  57312. var t = 0
  57313. , i = this.animationsMap[e];
  57314. return i && (t = i.time),
  57315. t
  57316. }
  57317. ,
  57318. n.MorphBlendMesh.prototype.getAnimationDuration = function(e) {
  57319. var t = -1
  57320. , i = this.animationsMap[e];
  57321. return i && (t = i.duration),
  57322. t
  57323. }
  57324. ,
  57325. n.MorphBlendMesh.prototype.playAnimation = function(e) {
  57326. var t = this.animationsMap[e];
  57327. t ? (t.time = 0,
  57328. t.active = !0) : console.warn("THREE.MorphBlendMesh: animation[" + e + "] undefined in .playAnimation()")
  57329. }
  57330. ,
  57331. n.MorphBlendMesh.prototype.stopAnimation = function(e) {
  57332. var t = this.animationsMap[e];
  57333. t && (t.active = !1)
  57334. }
  57335. ,
  57336. n.MorphBlendMesh.prototype.update = function(e) {
  57337. for (var t = 0, i = this.animationsList.length; t < i; t++) {
  57338. var r = this.animationsList[t];
  57339. if (r.active) {
  57340. var o = r.duration / r.length;
  57341. r.time += r.direction * e,
  57342. r.mirroredLoop ? (r.time > r.duration || r.time < 0) && (r.direction *= -1,
  57343. r.time > r.duration && (r.time = r.duration,
  57344. r.directionBackwards = !0),
  57345. r.time < 0 && (r.time = 0,
  57346. r.directionBackwards = !1)) : (r.time = r.time % r.duration,
  57347. r.time < 0 && (r.time += r.duration));
  57348. var a = r.start + n.Math.clamp(Math.floor(r.time / o), 0, r.length - 1)
  57349. , s = r.weight;
  57350. a !== r.currentFrame && (this.morphTargetInfluences[r.lastFrame] = 0,
  57351. this.morphTargetInfluences[r.currentFrame] = 1 * s,
  57352. this.morphTargetInfluences[a] = 0,
  57353. r.lastFrame = r.currentFrame,
  57354. r.currentFrame = a);
  57355. var l = r.time % o / o;
  57356. r.directionBackwards && (l = 1 - l),
  57357. r.currentFrame !== r.lastFrame ? (this.morphTargetInfluences[r.currentFrame] = l * s,
  57358. this.morphTargetInfluences[r.lastFrame] = (1 - l) * s) : this.morphTargetInfluences[r.currentFrame] = s
  57359. }
  57360. }
  57361. }
  57362. ,
  57363. "undefined" != typeof i ? ("undefined" != typeof t && t.exports && (i = t.exports = n),
  57364. i.THREE = n) : this.THREE = n
  57365. }
  57366. , {}]
  57367. }, {}, [116]);