main_2020_show.js 2.5 MB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478194791948019481194821948319484194851948619487194881948919490194911949219493194941949519496194971949819499195001950119502195031950419505195061950719508195091951019511195121951319514195151951619517195181951919520195211952219523195241952519526195271952819529195301953119532195331953419535195361953719538195391954019541195421954319544195451954619547195481954919550195511955219553195541955519556195571955819559195601956119562195631956419565195661956719568195691957019571195721957319574195751957619577195781957919580195811958219583195841958519586195871958819589195901959119592195931959419595195961959719598195991960019601196021960319604196051960619607196081960919610196111961219613196141961519616196171961819619196201962119622196231962419625196261962719628196291963019631196321963319634196351963619637196381963919640196411964219643196441964519646196471964819649196501965119652196531965419655196561965719658196591966019661196621966319664196651966619667196681966919670196711967219673196741967519676196771967819679196801968119682196831968419685196861968719688196891969019691196921969319694196951969619697196981969919700197011970219703197041970519706197071970819709197101971119712197131971419715197161971719718197191972019721197221972319724197251972619727197281972919730197311973219733197341973519736197371973819739197401974119742197431974419745197461974719748197491975019751197521975319754197551975619757197581975919760197611976219763197641976519766197671976819769197701977119772197731977419775197761977719778197791978019781197821978319784197851978619787197881978919790197911979219793197941979519796197971979819799198001980119802198031980419805198061980719808198091981019811198121981319814198151981619817198181981919820198211982219823198241982519826198271982819829198301983119832198331983419835198361983719838198391984019841198421984319844198451984619847198481984919850198511985219853198541985519856198571985819859198601986119862198631986419865198661986719868198691987019871198721987319874198751987619877198781987919880198811988219883198841988519886198871988819889198901989119892198931989419895198961989719898198991990019901199021990319904199051990619907199081990919910199111991219913199141991519916199171991819919199201992119922199231992419925199261992719928199291993019931199321993319934199351993619937199381993919940199411994219943199441994519946199471994819949199501995119952199531995419955199561995719958199591996019961199621996319964199651996619967199681996919970199711997219973199741997519976199771997819979199801998119982199831998419985199861998719988199891999019991199921999319994199951999619997199981999920000200012000220003200042000520006200072000820009200102001120012200132001420015200162001720018200192002020021200222002320024200252002620027200282002920030200312003220033200342003520036200372003820039200402004120042200432004420045200462004720048200492005020051200522005320054200552005620057200582005920060200612006220063200642006520066200672006820069200702007120072200732007420075200762007720078200792008020081200822008320084200852008620087200882008920090200912009220093200942009520096200972009820099201002010120102201032010420105201062010720108201092011020111201122011320114201152011620117201182011920120201212012220123201242012520126201272012820129201302013120132201332013420135201362013720138201392014020141201422014320144201452014620147201482014920150201512015220153201542015520156201572015820159201602016120162201632016420165201662016720168201692017020171201722017320174201752017620177201782017920180201812018220183201842018520186201872018820189201902019120192201932019420195201962019720198201992020020201202022020320204202052020620207202082020920210202112021220213202142021520216202172021820219202202022120222202232022420225202262022720228202292023020231202322023320234202352023620237202382023920240202412024220243202442024520246202472024820249202502025120252202532025420255202562025720258202592026020261202622026320264202652026620267202682026920270202712027220273202742027520276202772027820279202802028120282202832028420285202862028720288202892029020291202922029320294202952029620297202982029920300203012030220303203042030520306203072030820309203102031120312203132031420315203162031720318203192032020321203222032320324203252032620327203282032920330203312033220333203342033520336203372033820339203402034120342203432034420345203462034720348203492035020351203522035320354203552035620357203582035920360203612036220363203642036520366203672036820369203702037120372203732037420375203762037720378203792038020381203822038320384203852038620387203882038920390203912039220393203942039520396203972039820399204002040120402204032040420405204062040720408204092041020411204122041320414204152041620417204182041920420204212042220423204242042520426204272042820429204302043120432204332043420435204362043720438204392044020441204422044320444204452044620447204482044920450204512045220453204542045520456204572045820459204602046120462204632046420465204662046720468204692047020471204722047320474204752047620477204782047920480204812048220483204842048520486204872048820489204902049120492204932049420495204962049720498204992050020501205022050320504205052050620507205082050920510205112051220513205142051520516205172051820519205202052120522205232052420525205262052720528205292053020531205322053320534205352053620537205382053920540205412054220543205442054520546205472054820549205502055120552205532055420555205562055720558205592056020561205622056320564205652056620567205682056920570205712057220573205742057520576205772057820579205802058120582205832058420585205862058720588205892059020591205922059320594205952059620597205982059920600206012060220603206042060520606206072060820609206102061120612206132061420615206162061720618206192062020621206222062320624206252062620627206282062920630206312063220633206342063520636206372063820639206402064120642206432064420645206462064720648206492065020651206522065320654206552065620657206582065920660206612066220663206642066520666206672066820669206702067120672206732067420675206762067720678206792068020681206822068320684206852068620687206882068920690206912069220693206942069520696206972069820699207002070120702207032070420705207062070720708207092071020711207122071320714207152071620717207182071920720207212072220723207242072520726207272072820729207302073120732207332073420735207362073720738207392074020741207422074320744207452074620747207482074920750207512075220753207542075520756207572075820759207602076120762207632076420765207662076720768207692077020771207722077320774207752077620777207782077920780207812078220783207842078520786207872078820789207902079120792207932079420795207962079720798207992080020801208022080320804208052080620807208082080920810208112081220813208142081520816208172081820819208202082120822208232082420825208262082720828208292083020831208322083320834208352083620837208382083920840208412084220843208442084520846208472084820849208502085120852208532085420855208562085720858208592086020861208622086320864208652086620867208682086920870208712087220873208742087520876208772087820879208802088120882208832088420885208862088720888208892089020891208922089320894208952089620897208982089920900209012090220903209042090520906209072090820909209102091120912209132091420915209162091720918209192092020921209222092320924209252092620927209282092920930209312093220933209342093520936209372093820939209402094120942209432094420945209462094720948209492095020951209522095320954209552095620957209582095920960209612096220963209642096520966209672096820969209702097120972209732097420975209762097720978209792098020981209822098320984209852098620987209882098920990209912099220993209942099520996209972099820999210002100121002210032100421005210062100721008210092101021011210122101321014210152101621017210182101921020210212102221023210242102521026210272102821029210302103121032210332103421035210362103721038210392104021041210422104321044210452104621047210482104921050210512105221053210542105521056210572105821059210602106121062210632106421065210662106721068210692107021071210722107321074210752107621077210782107921080210812108221083210842108521086210872108821089210902109121092210932109421095210962109721098210992110021101211022110321104211052110621107211082110921110211112111221113211142111521116211172111821119211202112121122211232112421125211262112721128211292113021131211322113321134211352113621137211382113921140211412114221143211442114521146211472114821149211502115121152211532115421155211562115721158211592116021161211622116321164211652116621167211682116921170211712117221173211742117521176211772117821179211802118121182211832118421185211862118721188211892119021191211922119321194211952119621197211982119921200212012120221203212042120521206212072120821209212102121121212212132121421215212162121721218212192122021221212222122321224212252122621227212282122921230212312123221233212342123521236212372123821239212402124121242212432124421245212462124721248212492125021251212522125321254212552125621257212582125921260212612126221263212642126521266212672126821269212702127121272212732127421275212762127721278212792128021281212822128321284212852128621287212882128921290212912129221293212942129521296212972129821299213002130121302213032130421305213062130721308213092131021311213122131321314213152131621317213182131921320213212132221323213242132521326213272132821329213302133121332213332133421335213362133721338213392134021341213422134321344213452134621347213482134921350213512135221353213542135521356213572135821359213602136121362213632136421365213662136721368213692137021371213722137321374213752137621377213782137921380213812138221383213842138521386213872138821389213902139121392213932139421395213962139721398213992140021401214022140321404214052140621407214082140921410214112141221413214142141521416214172141821419214202142121422214232142421425214262142721428214292143021431214322143321434214352143621437214382143921440214412144221443214442144521446214472144821449214502145121452214532145421455214562145721458214592146021461214622146321464214652146621467214682146921470214712147221473214742147521476214772147821479214802148121482214832148421485214862148721488214892149021491214922149321494214952149621497214982149921500215012150221503215042150521506215072150821509215102151121512215132151421515215162151721518215192152021521215222152321524215252152621527215282152921530215312153221533215342153521536215372153821539215402154121542215432154421545215462154721548215492155021551215522155321554215552155621557215582155921560215612156221563215642156521566215672156821569215702157121572215732157421575215762157721578215792158021581215822158321584215852158621587215882158921590215912159221593215942159521596215972159821599216002160121602216032160421605216062160721608216092161021611216122161321614216152161621617216182161921620216212162221623216242162521626216272162821629216302163121632216332163421635216362163721638216392164021641216422164321644216452164621647216482164921650216512165221653216542165521656216572165821659216602166121662216632166421665216662166721668216692167021671216722167321674216752167621677216782167921680216812168221683216842168521686216872168821689216902169121692216932169421695216962169721698216992170021701217022170321704217052170621707217082170921710217112171221713217142171521716217172171821719217202172121722217232172421725217262172721728217292173021731217322173321734217352173621737217382173921740217412174221743217442174521746217472174821749217502175121752217532175421755217562175721758217592176021761217622176321764217652176621767217682176921770217712177221773217742177521776217772177821779217802178121782217832178421785217862178721788217892179021791217922179321794217952179621797217982179921800218012180221803218042180521806218072180821809218102181121812218132181421815218162181721818218192182021821218222182321824218252182621827218282182921830218312183221833218342183521836218372183821839218402184121842218432184421845218462184721848218492185021851218522185321854218552185621857218582185921860218612186221863218642186521866218672186821869218702187121872218732187421875218762187721878218792188021881218822188321884218852188621887218882188921890218912189221893218942189521896218972189821899219002190121902219032190421905219062190721908219092191021911219122191321914219152191621917219182191921920219212192221923219242192521926219272192821929219302193121932219332193421935219362193721938219392194021941219422194321944219452194621947219482194921950219512195221953219542195521956219572195821959219602196121962219632196421965219662196721968219692197021971219722197321974219752197621977219782197921980219812198221983219842198521986219872198821989219902199121992219932199421995219962199721998219992200022001220022200322004220052200622007220082200922010220112201222013220142201522016220172201822019220202202122022220232202422025220262202722028220292203022031220322203322034220352203622037220382203922040220412204222043220442204522046220472204822049220502205122052220532205422055220562205722058220592206022061220622206322064220652206622067220682206922070220712207222073220742207522076220772207822079220802208122082220832208422085220862208722088220892209022091220922209322094220952209622097220982209922100221012210222103221042210522106221072210822109221102211122112221132211422115221162211722118221192212022121221222212322124221252212622127221282212922130221312213222133221342213522136221372213822139221402214122142221432214422145221462214722148221492215022151221522215322154221552215622157221582215922160221612216222163221642216522166221672216822169221702217122172221732217422175221762217722178221792218022181221822218322184221852218622187221882218922190221912219222193221942219522196221972219822199222002220122202222032220422205222062220722208222092221022211222122221322214222152221622217222182221922220222212222222223222242222522226222272222822229222302223122232222332223422235222362223722238222392224022241222422224322244222452224622247222482224922250222512225222253222542225522256222572225822259222602226122262222632226422265222662226722268222692227022271222722227322274222752227622277222782227922280222812228222283222842228522286222872228822289222902229122292222932229422295222962229722298222992230022301223022230322304223052230622307223082230922310223112231222313223142231522316223172231822319223202232122322223232232422325223262232722328223292233022331223322233322334223352233622337223382233922340223412234222343223442234522346223472234822349223502235122352223532235422355223562235722358223592236022361223622236322364223652236622367223682236922370223712237222373223742237522376223772237822379223802238122382223832238422385223862238722388223892239022391223922239322394223952239622397223982239922400224012240222403224042240522406224072240822409224102241122412224132241422415224162241722418224192242022421224222242322424224252242622427224282242922430224312243222433224342243522436224372243822439224402244122442224432244422445224462244722448224492245022451224522245322454224552245622457224582245922460224612246222463224642246522466224672246822469224702247122472224732247422475224762247722478224792248022481224822248322484224852248622487224882248922490224912249222493224942249522496224972249822499225002250122502225032250422505225062250722508225092251022511225122251322514225152251622517225182251922520225212252222523225242252522526225272252822529225302253122532225332253422535225362253722538225392254022541225422254322544225452254622547225482254922550225512255222553225542255522556225572255822559225602256122562225632256422565225662256722568225692257022571225722257322574225752257622577225782257922580225812258222583225842258522586225872258822589225902259122592225932259422595225962259722598225992260022601226022260322604226052260622607226082260922610226112261222613226142261522616226172261822619226202262122622226232262422625226262262722628226292263022631226322263322634226352263622637226382263922640226412264222643226442264522646226472264822649226502265122652226532265422655226562265722658226592266022661226622266322664226652266622667226682266922670226712267222673226742267522676226772267822679226802268122682226832268422685226862268722688226892269022691226922269322694226952269622697226982269922700227012270222703227042270522706227072270822709227102271122712227132271422715227162271722718227192272022721227222272322724227252272622727227282272922730227312273222733227342273522736227372273822739227402274122742227432274422745227462274722748227492275022751227522275322754227552275622757227582275922760227612276222763227642276522766227672276822769227702277122772227732277422775227762277722778227792278022781227822278322784227852278622787227882278922790227912279222793227942279522796227972279822799228002280122802228032280422805228062280722808228092281022811228122281322814228152281622817228182281922820228212282222823228242282522826228272282822829228302283122832228332283422835228362283722838228392284022841228422284322844228452284622847228482284922850228512285222853228542285522856228572285822859228602286122862228632286422865228662286722868228692287022871228722287322874228752287622877228782287922880228812288222883228842288522886228872288822889228902289122892228932289422895228962289722898228992290022901229022290322904229052290622907229082290922910229112291222913229142291522916229172291822919229202292122922229232292422925229262292722928229292293022931229322293322934229352293622937229382293922940229412294222943229442294522946229472294822949229502295122952229532295422955229562295722958229592296022961229622296322964229652296622967229682296922970229712297222973229742297522976229772297822979229802298122982229832298422985229862298722988229892299022991229922299322994229952299622997229982299923000230012300223003230042300523006230072300823009230102301123012230132301423015230162301723018230192302023021230222302323024230252302623027230282302923030230312303223033230342303523036230372303823039230402304123042230432304423045230462304723048230492305023051230522305323054230552305623057230582305923060230612306223063230642306523066230672306823069230702307123072230732307423075230762307723078230792308023081230822308323084230852308623087230882308923090230912309223093230942309523096230972309823099231002310123102231032310423105231062310723108231092311023111231122311323114231152311623117231182311923120231212312223123231242312523126231272312823129231302313123132231332313423135231362313723138231392314023141231422314323144231452314623147231482314923150231512315223153231542315523156231572315823159231602316123162231632316423165231662316723168231692317023171231722317323174231752317623177231782317923180231812318223183231842318523186231872318823189231902319123192231932319423195231962319723198231992320023201232022320323204232052320623207232082320923210232112321223213232142321523216232172321823219232202322123222232232322423225232262322723228232292323023231232322323323234232352323623237232382323923240232412324223243232442324523246232472324823249232502325123252232532325423255232562325723258232592326023261232622326323264232652326623267232682326923270232712327223273232742327523276232772327823279232802328123282232832328423285232862328723288232892329023291232922329323294232952329623297232982329923300233012330223303233042330523306233072330823309233102331123312233132331423315233162331723318233192332023321233222332323324233252332623327233282332923330233312333223333233342333523336233372333823339233402334123342233432334423345233462334723348233492335023351233522335323354233552335623357233582335923360233612336223363233642336523366233672336823369233702337123372233732337423375233762337723378233792338023381233822338323384233852338623387233882338923390233912339223393233942339523396233972339823399234002340123402234032340423405234062340723408234092341023411234122341323414234152341623417234182341923420234212342223423234242342523426234272342823429234302343123432234332343423435234362343723438234392344023441234422344323444234452344623447234482344923450234512345223453234542345523456234572345823459234602346123462234632346423465234662346723468234692347023471234722347323474234752347623477234782347923480234812348223483234842348523486234872348823489234902349123492234932349423495234962349723498234992350023501235022350323504235052350623507235082350923510235112351223513235142351523516235172351823519235202352123522235232352423525235262352723528235292353023531235322353323534235352353623537235382353923540235412354223543235442354523546235472354823549235502355123552235532355423555235562355723558235592356023561235622356323564235652356623567235682356923570235712357223573235742357523576235772357823579235802358123582235832358423585235862358723588235892359023591235922359323594235952359623597235982359923600236012360223603236042360523606236072360823609236102361123612236132361423615236162361723618236192362023621236222362323624236252362623627236282362923630236312363223633236342363523636236372363823639236402364123642236432364423645236462364723648236492365023651236522365323654236552365623657236582365923660236612366223663236642366523666236672366823669236702367123672236732367423675236762367723678236792368023681236822368323684236852368623687236882368923690236912369223693236942369523696236972369823699237002370123702237032370423705237062370723708237092371023711237122371323714237152371623717237182371923720237212372223723237242372523726237272372823729237302373123732237332373423735237362373723738237392374023741237422374323744237452374623747237482374923750237512375223753237542375523756237572375823759237602376123762237632376423765237662376723768237692377023771237722377323774237752377623777237782377923780237812378223783237842378523786237872378823789237902379123792237932379423795237962379723798237992380023801238022380323804238052380623807238082380923810238112381223813238142381523816238172381823819238202382123822238232382423825238262382723828238292383023831238322383323834238352383623837238382383923840238412384223843238442384523846238472384823849238502385123852238532385423855238562385723858238592386023861238622386323864238652386623867238682386923870238712387223873238742387523876238772387823879238802388123882238832388423885238862388723888238892389023891238922389323894238952389623897238982389923900239012390223903239042390523906239072390823909239102391123912239132391423915239162391723918239192392023921239222392323924239252392623927239282392923930239312393223933239342393523936239372393823939239402394123942239432394423945239462394723948239492395023951239522395323954239552395623957239582395923960239612396223963239642396523966239672396823969239702397123972239732397423975239762397723978239792398023981239822398323984239852398623987239882398923990239912399223993239942399523996239972399823999240002400124002240032400424005240062400724008240092401024011240122401324014240152401624017240182401924020240212402224023240242402524026240272402824029240302403124032240332403424035240362403724038240392404024041240422404324044240452404624047240482404924050240512405224053240542405524056240572405824059240602406124062240632406424065240662406724068240692407024071240722407324074240752407624077240782407924080240812408224083240842408524086240872408824089240902409124092240932409424095240962409724098240992410024101241022410324104241052410624107241082410924110241112411224113241142411524116241172411824119241202412124122241232412424125241262412724128241292413024131241322413324134241352413624137241382413924140241412414224143241442414524146241472414824149241502415124152241532415424155241562415724158241592416024161241622416324164241652416624167241682416924170241712417224173241742417524176241772417824179241802418124182241832418424185241862418724188241892419024191241922419324194241952419624197241982419924200242012420224203242042420524206242072420824209242102421124212242132421424215242162421724218242192422024221242222422324224242252422624227242282422924230242312423224233242342423524236242372423824239242402424124242242432424424245242462424724248242492425024251242522425324254242552425624257242582425924260242612426224263242642426524266242672426824269242702427124272242732427424275242762427724278242792428024281242822428324284242852428624287242882428924290242912429224293242942429524296242972429824299243002430124302243032430424305243062430724308243092431024311243122431324314243152431624317243182431924320243212432224323243242432524326243272432824329243302433124332243332433424335243362433724338243392434024341243422434324344243452434624347243482434924350243512435224353243542435524356243572435824359243602436124362243632436424365243662436724368243692437024371243722437324374243752437624377243782437924380243812438224383243842438524386243872438824389243902439124392243932439424395243962439724398243992440024401244022440324404244052440624407244082440924410244112441224413244142441524416244172441824419244202442124422244232442424425244262442724428244292443024431244322443324434244352443624437244382443924440244412444224443244442444524446244472444824449244502445124452244532445424455244562445724458244592446024461244622446324464244652446624467244682446924470244712447224473244742447524476244772447824479244802448124482244832448424485244862448724488244892449024491244922449324494244952449624497244982449924500245012450224503245042450524506245072450824509245102451124512245132451424515245162451724518245192452024521245222452324524245252452624527245282452924530245312453224533245342453524536245372453824539245402454124542245432454424545245462454724548245492455024551245522455324554245552455624557245582455924560245612456224563245642456524566245672456824569245702457124572245732457424575245762457724578245792458024581245822458324584245852458624587245882458924590245912459224593245942459524596245972459824599246002460124602246032460424605246062460724608246092461024611246122461324614246152461624617246182461924620246212462224623246242462524626246272462824629246302463124632246332463424635246362463724638246392464024641246422464324644246452464624647246482464924650246512465224653246542465524656246572465824659246602466124662246632466424665246662466724668246692467024671246722467324674246752467624677246782467924680246812468224683246842468524686246872468824689246902469124692246932469424695246962469724698246992470024701247022470324704247052470624707247082470924710247112471224713247142471524716247172471824719247202472124722247232472424725247262472724728247292473024731247322473324734247352473624737247382473924740247412474224743247442474524746247472474824749247502475124752247532475424755247562475724758247592476024761247622476324764247652476624767247682476924770247712477224773247742477524776247772477824779247802478124782247832478424785247862478724788247892479024791247922479324794247952479624797247982479924800248012480224803248042480524806248072480824809248102481124812248132481424815248162481724818248192482024821248222482324824248252482624827248282482924830248312483224833248342483524836248372483824839248402484124842248432484424845248462484724848248492485024851248522485324854248552485624857248582485924860248612486224863248642486524866248672486824869248702487124872248732487424875248762487724878248792488024881248822488324884248852488624887248882488924890248912489224893248942489524896248972489824899249002490124902249032490424905249062490724908249092491024911249122491324914249152491624917249182491924920249212492224923249242492524926249272492824929249302493124932249332493424935249362493724938249392494024941249422494324944249452494624947249482494924950249512495224953249542495524956249572495824959249602496124962249632496424965249662496724968249692497024971249722497324974249752497624977249782497924980249812498224983249842498524986249872498824989249902499124992249932499424995249962499724998249992500025001250022500325004250052500625007250082500925010250112501225013250142501525016250172501825019250202502125022250232502425025250262502725028250292503025031250322503325034250352503625037250382503925040250412504225043250442504525046250472504825049250502505125052250532505425055250562505725058250592506025061250622506325064250652506625067250682506925070250712507225073250742507525076250772507825079250802508125082250832508425085250862508725088250892509025091250922509325094250952509625097250982509925100251012510225103251042510525106251072510825109251102511125112251132511425115251162511725118251192512025121251222512325124251252512625127251282512925130251312513225133251342513525136251372513825139251402514125142251432514425145251462514725148251492515025151251522515325154251552515625157251582515925160251612516225163251642516525166251672516825169251702517125172251732517425175251762517725178251792518025181251822518325184251852518625187251882518925190251912519225193251942519525196251972519825199252002520125202252032520425205252062520725208252092521025211252122521325214252152521625217252182521925220252212522225223252242522525226252272522825229252302523125232252332523425235252362523725238252392524025241252422524325244252452524625247252482524925250252512525225253252542525525256252572525825259252602526125262252632526425265252662526725268252692527025271252722527325274252752527625277252782527925280252812528225283252842528525286252872528825289252902529125292252932529425295252962529725298252992530025301253022530325304253052530625307253082530925310253112531225313253142531525316253172531825319253202532125322253232532425325253262532725328253292533025331253322533325334253352533625337253382533925340253412534225343253442534525346253472534825349253502535125352253532535425355253562535725358253592536025361253622536325364253652536625367253682536925370253712537225373253742537525376253772537825379253802538125382253832538425385253862538725388253892539025391253922539325394253952539625397253982539925400254012540225403254042540525406254072540825409254102541125412254132541425415254162541725418254192542025421254222542325424254252542625427254282542925430254312543225433254342543525436254372543825439254402544125442254432544425445254462544725448254492545025451254522545325454254552545625457254582545925460254612546225463254642546525466254672546825469254702547125472254732547425475254762547725478254792548025481254822548325484254852548625487254882548925490254912549225493254942549525496254972549825499255002550125502255032550425505255062550725508255092551025511255122551325514255152551625517255182551925520255212552225523255242552525526255272552825529255302553125532255332553425535255362553725538255392554025541255422554325544255452554625547255482554925550255512555225553255542555525556255572555825559255602556125562255632556425565255662556725568255692557025571255722557325574255752557625577255782557925580255812558225583255842558525586255872558825589255902559125592255932559425595255962559725598255992560025601256022560325604256052560625607256082560925610256112561225613256142561525616256172561825619256202562125622256232562425625256262562725628256292563025631256322563325634256352563625637256382563925640256412564225643256442564525646256472564825649256502565125652256532565425655256562565725658256592566025661256622566325664256652566625667256682566925670256712567225673256742567525676256772567825679256802568125682256832568425685256862568725688256892569025691256922569325694256952569625697256982569925700257012570225703257042570525706257072570825709257102571125712257132571425715257162571725718257192572025721257222572325724257252572625727257282572925730257312573225733257342573525736257372573825739257402574125742257432574425745257462574725748257492575025751257522575325754257552575625757257582575925760257612576225763257642576525766257672576825769257702577125772257732577425775257762577725778257792578025781257822578325784257852578625787257882578925790257912579225793257942579525796257972579825799258002580125802258032580425805258062580725808258092581025811258122581325814258152581625817258182581925820258212582225823258242582525826258272582825829258302583125832258332583425835258362583725838258392584025841258422584325844258452584625847258482584925850258512585225853258542585525856258572585825859258602586125862258632586425865258662586725868258692587025871258722587325874258752587625877258782587925880258812588225883258842588525886258872588825889258902589125892258932589425895258962589725898258992590025901259022590325904259052590625907259082590925910259112591225913259142591525916259172591825919259202592125922259232592425925259262592725928259292593025931259322593325934259352593625937259382593925940259412594225943259442594525946259472594825949259502595125952259532595425955259562595725958259592596025961259622596325964259652596625967259682596925970259712597225973259742597525976259772597825979259802598125982259832598425985259862598725988259892599025991259922599325994259952599625997259982599926000260012600226003260042600526006260072600826009260102601126012260132601426015260162601726018260192602026021260222602326024260252602626027260282602926030260312603226033260342603526036260372603826039260402604126042260432604426045260462604726048260492605026051260522605326054260552605626057260582605926060260612606226063260642606526066260672606826069260702607126072260732607426075260762607726078260792608026081260822608326084260852608626087260882608926090260912609226093260942609526096260972609826099261002610126102261032610426105261062610726108261092611026111261122611326114261152611626117261182611926120261212612226123261242612526126261272612826129261302613126132261332613426135261362613726138261392614026141261422614326144261452614626147261482614926150261512615226153261542615526156261572615826159261602616126162261632616426165261662616726168261692617026171261722617326174261752617626177261782617926180261812618226183261842618526186261872618826189261902619126192261932619426195261962619726198261992620026201262022620326204262052620626207262082620926210262112621226213262142621526216262172621826219262202622126222262232622426225262262622726228262292623026231262322623326234262352623626237262382623926240262412624226243262442624526246262472624826249262502625126252262532625426255262562625726258262592626026261262622626326264262652626626267262682626926270262712627226273262742627526276262772627826279262802628126282262832628426285262862628726288262892629026291262922629326294262952629626297262982629926300263012630226303263042630526306263072630826309263102631126312263132631426315263162631726318263192632026321263222632326324263252632626327263282632926330263312633226333263342633526336263372633826339263402634126342263432634426345263462634726348263492635026351263522635326354263552635626357263582635926360263612636226363263642636526366263672636826369263702637126372263732637426375263762637726378263792638026381263822638326384263852638626387263882638926390263912639226393263942639526396263972639826399264002640126402264032640426405264062640726408264092641026411264122641326414264152641626417264182641926420264212642226423264242642526426264272642826429264302643126432264332643426435264362643726438264392644026441264422644326444264452644626447264482644926450264512645226453264542645526456264572645826459264602646126462264632646426465264662646726468264692647026471264722647326474264752647626477264782647926480264812648226483264842648526486264872648826489264902649126492264932649426495264962649726498264992650026501265022650326504265052650626507265082650926510265112651226513265142651526516265172651826519265202652126522265232652426525265262652726528265292653026531265322653326534265352653626537265382653926540265412654226543265442654526546265472654826549265502655126552265532655426555265562655726558265592656026561265622656326564265652656626567265682656926570265712657226573265742657526576265772657826579265802658126582265832658426585265862658726588265892659026591265922659326594265952659626597265982659926600266012660226603266042660526606266072660826609266102661126612266132661426615266162661726618266192662026621266222662326624266252662626627266282662926630266312663226633266342663526636266372663826639266402664126642266432664426645266462664726648266492665026651266522665326654266552665626657266582665926660266612666226663266642666526666266672666826669266702667126672266732667426675266762667726678266792668026681266822668326684266852668626687266882668926690266912669226693266942669526696266972669826699267002670126702267032670426705267062670726708267092671026711267122671326714267152671626717267182671926720267212672226723267242672526726267272672826729267302673126732267332673426735267362673726738267392674026741267422674326744267452674626747267482674926750267512675226753267542675526756267572675826759267602676126762267632676426765267662676726768267692677026771267722677326774267752677626777267782677926780267812678226783267842678526786267872678826789267902679126792267932679426795267962679726798267992680026801268022680326804268052680626807268082680926810268112681226813268142681526816268172681826819268202682126822268232682426825268262682726828268292683026831268322683326834268352683626837268382683926840268412684226843268442684526846268472684826849268502685126852268532685426855268562685726858268592686026861268622686326864268652686626867268682686926870268712687226873268742687526876268772687826879268802688126882268832688426885268862688726888268892689026891268922689326894268952689626897268982689926900269012690226903269042690526906269072690826909269102691126912269132691426915269162691726918269192692026921269222692326924269252692626927269282692926930269312693226933269342693526936269372693826939269402694126942269432694426945269462694726948269492695026951269522695326954269552695626957269582695926960269612696226963269642696526966269672696826969269702697126972269732697426975269762697726978269792698026981269822698326984269852698626987269882698926990269912699226993269942699526996269972699826999270002700127002270032700427005270062700727008270092701027011270122701327014270152701627017270182701927020270212702227023270242702527026270272702827029270302703127032270332703427035270362703727038270392704027041270422704327044270452704627047270482704927050270512705227053270542705527056270572705827059270602706127062270632706427065270662706727068270692707027071270722707327074270752707627077270782707927080270812708227083270842708527086270872708827089270902709127092270932709427095270962709727098270992710027101271022710327104271052710627107271082710927110271112711227113271142711527116271172711827119271202712127122271232712427125271262712727128271292713027131271322713327134271352713627137271382713927140271412714227143271442714527146271472714827149271502715127152271532715427155271562715727158271592716027161271622716327164271652716627167271682716927170271712717227173271742717527176271772717827179271802718127182271832718427185271862718727188271892719027191271922719327194271952719627197271982719927200272012720227203272042720527206272072720827209272102721127212272132721427215272162721727218272192722027221272222722327224272252722627227272282722927230272312723227233272342723527236272372723827239272402724127242272432724427245272462724727248272492725027251272522725327254272552725627257272582725927260272612726227263272642726527266272672726827269272702727127272272732727427275272762727727278272792728027281272822728327284272852728627287272882728927290272912729227293272942729527296272972729827299273002730127302273032730427305273062730727308273092731027311273122731327314273152731627317273182731927320273212732227323273242732527326273272732827329273302733127332273332733427335273362733727338273392734027341273422734327344273452734627347273482734927350273512735227353273542735527356273572735827359273602736127362273632736427365273662736727368273692737027371273722737327374273752737627377273782737927380273812738227383273842738527386273872738827389273902739127392273932739427395273962739727398273992740027401274022740327404274052740627407274082740927410274112741227413274142741527416274172741827419274202742127422274232742427425274262742727428274292743027431274322743327434274352743627437274382743927440274412744227443274442744527446274472744827449274502745127452274532745427455274562745727458274592746027461274622746327464274652746627467274682746927470274712747227473274742747527476274772747827479274802748127482274832748427485274862748727488274892749027491274922749327494274952749627497274982749927500275012750227503275042750527506275072750827509275102751127512275132751427515275162751727518275192752027521275222752327524275252752627527275282752927530275312753227533275342753527536275372753827539275402754127542275432754427545275462754727548275492755027551275522755327554275552755627557275582755927560275612756227563275642756527566275672756827569275702757127572275732757427575275762757727578275792758027581275822758327584275852758627587275882758927590275912759227593275942759527596275972759827599276002760127602276032760427605276062760727608276092761027611276122761327614276152761627617276182761927620276212762227623276242762527626276272762827629276302763127632276332763427635276362763727638276392764027641276422764327644276452764627647276482764927650276512765227653276542765527656276572765827659276602766127662276632766427665276662766727668276692767027671276722767327674276752767627677276782767927680276812768227683276842768527686276872768827689276902769127692276932769427695276962769727698276992770027701277022770327704277052770627707277082770927710277112771227713277142771527716277172771827719277202772127722277232772427725277262772727728277292773027731277322773327734277352773627737277382773927740277412774227743277442774527746277472774827749277502775127752277532775427755277562775727758277592776027761277622776327764277652776627767277682776927770277712777227773277742777527776277772777827779277802778127782277832778427785277862778727788277892779027791277922779327794277952779627797277982779927800278012780227803278042780527806278072780827809278102781127812278132781427815278162781727818278192782027821278222782327824278252782627827278282782927830278312783227833278342783527836278372783827839278402784127842278432784427845278462784727848278492785027851278522785327854278552785627857278582785927860278612786227863278642786527866278672786827869278702787127872278732787427875278762787727878278792788027881278822788327884278852788627887278882788927890278912789227893278942789527896278972789827899279002790127902279032790427905279062790727908279092791027911279122791327914279152791627917279182791927920279212792227923279242792527926279272792827929279302793127932279332793427935279362793727938279392794027941279422794327944279452794627947279482794927950279512795227953279542795527956279572795827959279602796127962279632796427965279662796727968279692797027971279722797327974279752797627977279782797927980279812798227983279842798527986279872798827989279902799127992279932799427995279962799727998279992800028001280022800328004280052800628007280082800928010280112801228013280142801528016280172801828019280202802128022280232802428025280262802728028280292803028031280322803328034280352803628037280382803928040280412804228043280442804528046280472804828049280502805128052280532805428055280562805728058280592806028061280622806328064280652806628067280682806928070280712807228073280742807528076280772807828079280802808128082280832808428085280862808728088280892809028091280922809328094280952809628097280982809928100281012810228103281042810528106281072810828109281102811128112281132811428115281162811728118281192812028121281222812328124281252812628127281282812928130281312813228133281342813528136281372813828139281402814128142281432814428145281462814728148281492815028151281522815328154281552815628157281582815928160281612816228163281642816528166281672816828169281702817128172281732817428175281762817728178281792818028181281822818328184281852818628187281882818928190281912819228193281942819528196281972819828199282002820128202282032820428205282062820728208282092821028211282122821328214282152821628217282182821928220282212822228223282242822528226282272822828229282302823128232282332823428235282362823728238282392824028241282422824328244282452824628247282482824928250282512825228253282542825528256282572825828259282602826128262282632826428265282662826728268282692827028271282722827328274282752827628277282782827928280282812828228283282842828528286282872828828289282902829128292282932829428295282962829728298282992830028301283022830328304283052830628307283082830928310283112831228313283142831528316283172831828319283202832128322283232832428325283262832728328283292833028331283322833328334283352833628337283382833928340283412834228343283442834528346283472834828349283502835128352283532835428355283562835728358283592836028361283622836328364283652836628367283682836928370283712837228373283742837528376283772837828379283802838128382283832838428385283862838728388283892839028391283922839328394283952839628397283982839928400284012840228403284042840528406284072840828409284102841128412284132841428415284162841728418284192842028421284222842328424284252842628427284282842928430284312843228433284342843528436284372843828439284402844128442284432844428445284462844728448284492845028451284522845328454284552845628457284582845928460284612846228463284642846528466284672846828469284702847128472284732847428475284762847728478284792848028481284822848328484284852848628487284882848928490284912849228493284942849528496284972849828499285002850128502285032850428505285062850728508285092851028511285122851328514285152851628517285182851928520285212852228523285242852528526285272852828529285302853128532285332853428535285362853728538285392854028541285422854328544285452854628547285482854928550285512855228553285542855528556285572855828559285602856128562285632856428565285662856728568285692857028571285722857328574285752857628577285782857928580285812858228583285842858528586285872858828589285902859128592285932859428595285962859728598285992860028601286022860328604286052860628607286082860928610286112861228613286142861528616286172861828619286202862128622286232862428625286262862728628286292863028631286322863328634286352863628637286382863928640286412864228643286442864528646286472864828649286502865128652286532865428655286562865728658286592866028661286622866328664286652866628667286682866928670286712867228673286742867528676286772867828679286802868128682286832868428685286862868728688286892869028691286922869328694286952869628697286982869928700287012870228703287042870528706287072870828709287102871128712287132871428715287162871728718287192872028721287222872328724287252872628727287282872928730287312873228733287342873528736287372873828739287402874128742287432874428745287462874728748287492875028751287522875328754287552875628757287582875928760287612876228763287642876528766287672876828769287702877128772287732877428775287762877728778287792878028781287822878328784287852878628787287882878928790287912879228793287942879528796287972879828799288002880128802288032880428805288062880728808288092881028811288122881328814288152881628817288182881928820288212882228823288242882528826288272882828829288302883128832288332883428835288362883728838288392884028841288422884328844288452884628847288482884928850288512885228853288542885528856288572885828859288602886128862288632886428865288662886728868288692887028871288722887328874288752887628877288782887928880288812888228883288842888528886288872888828889288902889128892288932889428895288962889728898288992890028901289022890328904289052890628907289082890928910289112891228913289142891528916289172891828919289202892128922289232892428925289262892728928289292893028931289322893328934289352893628937289382893928940289412894228943289442894528946289472894828949289502895128952289532895428955289562895728958289592896028961289622896328964289652896628967289682896928970289712897228973289742897528976289772897828979289802898128982289832898428985289862898728988289892899028991289922899328994289952899628997289982899929000290012900229003290042900529006290072900829009290102901129012290132901429015290162901729018290192902029021290222902329024290252902629027290282902929030290312903229033290342903529036290372903829039290402904129042290432904429045290462904729048290492905029051290522905329054290552905629057290582905929060290612906229063290642906529066290672906829069290702907129072290732907429075290762907729078290792908029081290822908329084290852908629087290882908929090290912909229093290942909529096290972909829099291002910129102291032910429105291062910729108291092911029111291122911329114291152911629117291182911929120291212912229123291242912529126291272912829129291302913129132291332913429135291362913729138291392914029141291422914329144291452914629147291482914929150291512915229153291542915529156291572915829159291602916129162291632916429165291662916729168291692917029171291722917329174291752917629177291782917929180291812918229183291842918529186291872918829189291902919129192291932919429195291962919729198291992920029201292022920329204292052920629207292082920929210292112921229213292142921529216292172921829219292202922129222292232922429225292262922729228292292923029231292322923329234292352923629237292382923929240292412924229243292442924529246292472924829249292502925129252292532925429255292562925729258292592926029261292622926329264292652926629267292682926929270292712927229273292742927529276292772927829279292802928129282292832928429285292862928729288292892929029291292922929329294292952929629297292982929929300293012930229303293042930529306293072930829309293102931129312293132931429315293162931729318293192932029321293222932329324293252932629327293282932929330293312933229333293342933529336293372933829339293402934129342293432934429345293462934729348293492935029351293522935329354293552935629357293582935929360293612936229363293642936529366293672936829369293702937129372293732937429375293762937729378293792938029381293822938329384293852938629387293882938929390293912939229393293942939529396293972939829399294002940129402294032940429405294062940729408294092941029411294122941329414294152941629417294182941929420294212942229423294242942529426294272942829429294302943129432294332943429435294362943729438294392944029441294422944329444294452944629447294482944929450294512945229453294542945529456294572945829459294602946129462294632946429465294662946729468294692947029471294722947329474294752947629477294782947929480294812948229483294842948529486294872948829489294902949129492294932949429495294962949729498294992950029501295022950329504295052950629507295082950929510295112951229513295142951529516295172951829519295202952129522295232952429525295262952729528295292953029531295322953329534295352953629537295382953929540295412954229543295442954529546295472954829549295502955129552295532955429555295562955729558295592956029561295622956329564295652956629567295682956929570295712957229573295742957529576295772957829579295802958129582295832958429585295862958729588295892959029591295922959329594295952959629597295982959929600296012960229603296042960529606296072960829609296102961129612296132961429615296162961729618296192962029621296222962329624296252962629627296282962929630296312963229633296342963529636296372963829639296402964129642296432964429645296462964729648296492965029651296522965329654296552965629657296582965929660296612966229663296642966529666296672966829669296702967129672296732967429675296762967729678296792968029681296822968329684296852968629687296882968929690296912969229693296942969529696296972969829699297002970129702297032970429705297062970729708297092971029711297122971329714297152971629717297182971929720297212972229723297242972529726297272972829729297302973129732297332973429735297362973729738297392974029741297422974329744297452974629747297482974929750297512975229753297542975529756297572975829759297602976129762297632976429765297662976729768297692977029771297722977329774297752977629777297782977929780297812978229783297842978529786297872978829789297902979129792297932979429795297962979729798297992980029801298022980329804298052980629807298082980929810298112981229813298142981529816298172981829819298202982129822298232982429825298262982729828298292983029831298322983329834298352983629837298382983929840298412984229843298442984529846298472984829849298502985129852298532985429855298562985729858298592986029861298622986329864298652986629867298682986929870298712987229873298742987529876298772987829879298802988129882298832988429885298862988729888298892989029891298922989329894298952989629897298982989929900299012990229903299042990529906299072990829909299102991129912299132991429915299162991729918299192992029921299222992329924299252992629927299282992929930299312993229933299342993529936299372993829939299402994129942299432994429945299462994729948299492995029951299522995329954299552995629957299582995929960299612996229963299642996529966299672996829969299702997129972299732997429975299762997729978299792998029981299822998329984299852998629987299882998929990299912999229993299942999529996299972999829999300003000130002300033000430005300063000730008300093001030011300123001330014300153001630017300183001930020300213002230023300243002530026300273002830029300303003130032300333003430035300363003730038300393004030041300423004330044300453004630047300483004930050300513005230053300543005530056300573005830059300603006130062300633006430065300663006730068300693007030071300723007330074300753007630077300783007930080300813008230083300843008530086300873008830089300903009130092300933009430095300963009730098300993010030101301023010330104301053010630107301083010930110301113011230113301143011530116301173011830119301203012130122301233012430125301263012730128301293013030131301323013330134301353013630137301383013930140301413014230143301443014530146301473014830149301503015130152301533015430155301563015730158301593016030161301623016330164301653016630167301683016930170301713017230173301743017530176301773017830179301803018130182301833018430185301863018730188301893019030191301923019330194301953019630197301983019930200302013020230203302043020530206302073020830209302103021130212302133021430215302163021730218302193022030221302223022330224302253022630227302283022930230302313023230233302343023530236302373023830239302403024130242302433024430245302463024730248302493025030251302523025330254302553025630257302583025930260302613026230263302643026530266302673026830269302703027130272302733027430275302763027730278302793028030281302823028330284302853028630287302883028930290302913029230293302943029530296302973029830299303003030130302303033030430305303063030730308303093031030311303123031330314303153031630317303183031930320303213032230323303243032530326303273032830329303303033130332303333033430335303363033730338303393034030341303423034330344303453034630347303483034930350303513035230353303543035530356303573035830359303603036130362303633036430365303663036730368303693037030371303723037330374303753037630377303783037930380303813038230383303843038530386303873038830389303903039130392303933039430395303963039730398303993040030401304023040330404304053040630407304083040930410304113041230413304143041530416304173041830419304203042130422304233042430425304263042730428304293043030431304323043330434304353043630437304383043930440304413044230443304443044530446304473044830449304503045130452304533045430455304563045730458304593046030461304623046330464304653046630467304683046930470304713047230473304743047530476304773047830479304803048130482304833048430485304863048730488304893049030491304923049330494304953049630497304983049930500305013050230503305043050530506305073050830509305103051130512305133051430515305163051730518305193052030521305223052330524305253052630527305283052930530305313053230533305343053530536305373053830539305403054130542305433054430545305463054730548305493055030551305523055330554305553055630557305583055930560305613056230563305643056530566305673056830569305703057130572305733057430575305763057730578305793058030581305823058330584305853058630587305883058930590305913059230593305943059530596305973059830599306003060130602306033060430605306063060730608306093061030611306123061330614306153061630617306183061930620306213062230623306243062530626306273062830629306303063130632306333063430635306363063730638306393064030641306423064330644306453064630647306483064930650306513065230653306543065530656306573065830659306603066130662306633066430665306663066730668306693067030671306723067330674306753067630677306783067930680306813068230683306843068530686306873068830689306903069130692306933069430695306963069730698306993070030701307023070330704307053070630707307083070930710307113071230713307143071530716307173071830719307203072130722307233072430725307263072730728307293073030731307323073330734307353073630737307383073930740307413074230743307443074530746307473074830749307503075130752307533075430755307563075730758307593076030761307623076330764307653076630767307683076930770307713077230773307743077530776307773077830779307803078130782307833078430785307863078730788307893079030791307923079330794307953079630797307983079930800308013080230803308043080530806308073080830809308103081130812308133081430815308163081730818308193082030821308223082330824308253082630827308283082930830308313083230833308343083530836308373083830839308403084130842308433084430845308463084730848308493085030851308523085330854308553085630857308583085930860308613086230863308643086530866308673086830869308703087130872308733087430875308763087730878308793088030881308823088330884308853088630887308883088930890308913089230893308943089530896308973089830899309003090130902309033090430905309063090730908309093091030911309123091330914309153091630917309183091930920309213092230923309243092530926309273092830929309303093130932309333093430935309363093730938309393094030941309423094330944309453094630947309483094930950309513095230953309543095530956309573095830959309603096130962309633096430965309663096730968309693097030971309723097330974309753097630977309783097930980309813098230983309843098530986309873098830989309903099130992309933099430995309963099730998309993100031001310023100331004310053100631007310083100931010310113101231013310143101531016310173101831019310203102131022310233102431025310263102731028310293103031031310323103331034310353103631037310383103931040310413104231043310443104531046310473104831049310503105131052310533105431055310563105731058310593106031061310623106331064310653106631067310683106931070310713107231073310743107531076310773107831079310803108131082310833108431085310863108731088310893109031091310923109331094310953109631097310983109931100311013110231103311043110531106311073110831109311103111131112311133111431115311163111731118311193112031121311223112331124311253112631127311283112931130311313113231133311343113531136311373113831139311403114131142311433114431145311463114731148311493115031151311523115331154311553115631157311583115931160311613116231163311643116531166311673116831169311703117131172311733117431175311763117731178311793118031181311823118331184311853118631187311883118931190311913119231193311943119531196311973119831199312003120131202312033120431205312063120731208312093121031211312123121331214312153121631217312183121931220312213122231223312243122531226312273122831229312303123131232312333123431235312363123731238312393124031241312423124331244312453124631247312483124931250312513125231253312543125531256312573125831259312603126131262312633126431265312663126731268312693127031271312723127331274312753127631277312783127931280312813128231283312843128531286312873128831289312903129131292312933129431295312963129731298312993130031301313023130331304313053130631307313083130931310313113131231313313143131531316313173131831319313203132131322313233132431325313263132731328313293133031331313323133331334313353133631337313383133931340313413134231343313443134531346313473134831349313503135131352313533135431355313563135731358313593136031361313623136331364313653136631367313683136931370313713137231373313743137531376313773137831379313803138131382313833138431385313863138731388313893139031391313923139331394313953139631397313983139931400314013140231403314043140531406314073140831409314103141131412314133141431415314163141731418314193142031421314223142331424314253142631427314283142931430314313143231433314343143531436314373143831439314403144131442314433144431445314463144731448314493145031451314523145331454314553145631457314583145931460314613146231463314643146531466314673146831469314703147131472314733147431475314763147731478314793148031481314823148331484314853148631487314883148931490314913149231493314943149531496314973149831499315003150131502315033150431505315063150731508315093151031511315123151331514315153151631517315183151931520315213152231523315243152531526315273152831529315303153131532315333153431535315363153731538315393154031541315423154331544315453154631547315483154931550315513155231553315543155531556315573155831559315603156131562315633156431565315663156731568315693157031571315723157331574315753157631577315783157931580315813158231583315843158531586315873158831589315903159131592315933159431595315963159731598315993160031601316023160331604316053160631607316083160931610316113161231613316143161531616316173161831619316203162131622316233162431625316263162731628316293163031631316323163331634316353163631637316383163931640316413164231643316443164531646316473164831649316503165131652316533165431655316563165731658316593166031661316623166331664316653166631667316683166931670316713167231673316743167531676316773167831679316803168131682316833168431685316863168731688316893169031691316923169331694316953169631697316983169931700317013170231703317043170531706317073170831709317103171131712317133171431715317163171731718317193172031721317223172331724317253172631727317283172931730317313173231733317343173531736317373173831739317403174131742317433174431745317463174731748317493175031751317523175331754317553175631757317583175931760317613176231763317643176531766317673176831769317703177131772317733177431775317763177731778317793178031781317823178331784317853178631787317883178931790317913179231793317943179531796317973179831799318003180131802318033180431805318063180731808318093181031811318123181331814318153181631817318183181931820318213182231823318243182531826318273182831829318303183131832318333183431835318363183731838318393184031841318423184331844318453184631847318483184931850318513185231853318543185531856318573185831859318603186131862318633186431865318663186731868318693187031871318723187331874318753187631877318783187931880318813188231883318843188531886318873188831889318903189131892318933189431895318963189731898318993190031901319023190331904319053190631907319083190931910319113191231913319143191531916319173191831919319203192131922319233192431925319263192731928319293193031931319323193331934319353193631937319383193931940319413194231943319443194531946319473194831949319503195131952319533195431955319563195731958319593196031961319623196331964319653196631967319683196931970319713197231973319743197531976319773197831979319803198131982319833198431985319863198731988319893199031991319923199331994319953199631997319983199932000320013200232003320043200532006320073200832009320103201132012320133201432015320163201732018320193202032021320223202332024320253202632027320283202932030320313203232033320343203532036320373203832039320403204132042320433204432045320463204732048320493205032051320523205332054320553205632057320583205932060320613206232063320643206532066320673206832069320703207132072320733207432075320763207732078320793208032081320823208332084320853208632087320883208932090320913209232093320943209532096320973209832099321003210132102321033210432105321063210732108321093211032111321123211332114321153211632117321183211932120321213212232123321243212532126321273212832129321303213132132321333213432135321363213732138321393214032141321423214332144321453214632147321483214932150321513215232153321543215532156321573215832159321603216132162321633216432165321663216732168321693217032171321723217332174321753217632177321783217932180321813218232183321843218532186321873218832189321903219132192321933219432195321963219732198321993220032201322023220332204322053220632207322083220932210322113221232213322143221532216322173221832219322203222132222322233222432225322263222732228322293223032231322323223332234322353223632237322383223932240322413224232243322443224532246322473224832249322503225132252322533225432255322563225732258322593226032261322623226332264322653226632267322683226932270322713227232273322743227532276322773227832279322803228132282322833228432285322863228732288322893229032291322923229332294322953229632297322983229932300323013230232303323043230532306323073230832309323103231132312323133231432315323163231732318323193232032321323223232332324323253232632327323283232932330323313233232333323343233532336323373233832339323403234132342323433234432345323463234732348323493235032351323523235332354323553235632357323583235932360323613236232363323643236532366323673236832369323703237132372323733237432375323763237732378323793238032381323823238332384323853238632387323883238932390323913239232393323943239532396323973239832399324003240132402324033240432405324063240732408324093241032411324123241332414324153241632417324183241932420324213242232423324243242532426324273242832429324303243132432324333243432435324363243732438324393244032441324423244332444324453244632447324483244932450324513245232453324543245532456324573245832459324603246132462324633246432465324663246732468324693247032471324723247332474324753247632477324783247932480324813248232483324843248532486324873248832489324903249132492324933249432495324963249732498324993250032501325023250332504325053250632507325083250932510325113251232513325143251532516325173251832519325203252132522325233252432525325263252732528325293253032531325323253332534325353253632537325383253932540325413254232543325443254532546325473254832549325503255132552325533255432555325563255732558325593256032561325623256332564325653256632567325683256932570325713257232573325743257532576325773257832579325803258132582325833258432585325863258732588325893259032591325923259332594325953259632597325983259932600326013260232603326043260532606326073260832609326103261132612326133261432615326163261732618326193262032621326223262332624326253262632627326283262932630326313263232633326343263532636326373263832639326403264132642326433264432645326463264732648326493265032651326523265332654326553265632657326583265932660326613266232663326643266532666326673266832669326703267132672326733267432675326763267732678326793268032681326823268332684326853268632687326883268932690326913269232693326943269532696326973269832699327003270132702327033270432705327063270732708327093271032711327123271332714327153271632717327183271932720327213272232723327243272532726327273272832729327303273132732327333273432735327363273732738327393274032741327423274332744327453274632747327483274932750327513275232753327543275532756327573275832759327603276132762327633276432765327663276732768327693277032771327723277332774327753277632777327783277932780327813278232783327843278532786327873278832789327903279132792327933279432795327963279732798327993280032801328023280332804328053280632807328083280932810328113281232813328143281532816328173281832819328203282132822328233282432825328263282732828328293283032831328323283332834328353283632837328383283932840328413284232843328443284532846328473284832849328503285132852328533285432855328563285732858328593286032861328623286332864328653286632867328683286932870328713287232873328743287532876328773287832879328803288132882328833288432885328863288732888328893289032891328923289332894328953289632897328983289932900329013290232903329043290532906329073290832909329103291132912329133291432915329163291732918329193292032921329223292332924329253292632927329283292932930329313293232933329343293532936329373293832939329403294132942329433294432945329463294732948329493295032951329523295332954329553295632957329583295932960329613296232963329643296532966329673296832969329703297132972329733297432975329763297732978329793298032981329823298332984329853298632987329883298932990329913299232993329943299532996329973299832999330003300133002330033300433005330063300733008330093301033011330123301333014330153301633017330183301933020330213302233023330243302533026330273302833029330303303133032330333303433035330363303733038330393304033041330423304333044330453304633047330483304933050330513305233053330543305533056330573305833059330603306133062330633306433065330663306733068330693307033071330723307333074330753307633077330783307933080330813308233083330843308533086330873308833089330903309133092330933309433095330963309733098330993310033101331023310333104331053310633107331083310933110331113311233113331143311533116331173311833119331203312133122331233312433125331263312733128331293313033131331323313333134331353313633137331383313933140331413314233143331443314533146331473314833149331503315133152331533315433155331563315733158331593316033161331623316333164331653316633167331683316933170331713317233173331743317533176331773317833179331803318133182331833318433185331863318733188331893319033191331923319333194331953319633197331983319933200332013320233203332043320533206332073320833209332103321133212332133321433215332163321733218332193322033221332223322333224332253322633227332283322933230332313323233233332343323533236332373323833239332403324133242332433324433245332463324733248332493325033251332523325333254332553325633257332583325933260332613326233263332643326533266332673326833269332703327133272332733327433275332763327733278332793328033281332823328333284332853328633287332883328933290332913329233293332943329533296332973329833299333003330133302333033330433305333063330733308333093331033311333123331333314333153331633317333183331933320333213332233323333243332533326333273332833329333303333133332333333333433335333363333733338333393334033341333423334333344333453334633347333483334933350333513335233353333543335533356333573335833359333603336133362333633336433365333663336733368333693337033371333723337333374333753337633377333783337933380333813338233383333843338533386333873338833389333903339133392333933339433395333963339733398333993340033401334023340333404334053340633407334083340933410334113341233413334143341533416334173341833419334203342133422334233342433425334263342733428334293343033431334323343333434334353343633437334383343933440334413344233443334443344533446334473344833449334503345133452334533345433455334563345733458334593346033461334623346333464334653346633467334683346933470334713347233473334743347533476334773347833479334803348133482334833348433485334863348733488334893349033491334923349333494334953349633497334983349933500335013350233503335043350533506335073350833509335103351133512335133351433515335163351733518335193352033521335223352333524335253352633527335283352933530335313353233533335343353533536335373353833539335403354133542335433354433545335463354733548335493355033551335523355333554335553355633557335583355933560335613356233563335643356533566335673356833569335703357133572335733357433575335763357733578335793358033581335823358333584335853358633587335883358933590335913359233593335943359533596335973359833599336003360133602336033360433605336063360733608336093361033611336123361333614336153361633617336183361933620336213362233623336243362533626336273362833629336303363133632336333363433635336363363733638336393364033641336423364333644336453364633647336483364933650336513365233653336543365533656336573365833659336603366133662336633366433665336663366733668336693367033671336723367333674336753367633677336783367933680336813368233683336843368533686336873368833689336903369133692336933369433695336963369733698336993370033701337023370333704337053370633707337083370933710337113371233713337143371533716337173371833719337203372133722337233372433725337263372733728337293373033731337323373333734337353373633737337383373933740337413374233743337443374533746337473374833749337503375133752337533375433755337563375733758337593376033761337623376333764337653376633767337683376933770337713377233773337743377533776337773377833779337803378133782337833378433785337863378733788337893379033791337923379333794337953379633797337983379933800338013380233803338043380533806338073380833809338103381133812338133381433815338163381733818338193382033821338223382333824338253382633827338283382933830338313383233833338343383533836338373383833839338403384133842338433384433845338463384733848338493385033851338523385333854338553385633857338583385933860338613386233863338643386533866338673386833869338703387133872338733387433875338763387733878338793388033881338823388333884338853388633887338883388933890338913389233893338943389533896338973389833899339003390133902339033390433905339063390733908339093391033911339123391333914339153391633917339183391933920339213392233923339243392533926339273392833929339303393133932339333393433935339363393733938339393394033941339423394333944339453394633947339483394933950339513395233953339543395533956339573395833959339603396133962339633396433965339663396733968339693397033971339723397333974339753397633977339783397933980339813398233983339843398533986339873398833989339903399133992339933399433995339963399733998339993400034001340023400334004340053400634007340083400934010340113401234013340143401534016340173401834019340203402134022340233402434025340263402734028340293403034031340323403334034340353403634037340383403934040340413404234043340443404534046340473404834049340503405134052340533405434055340563405734058340593406034061340623406334064340653406634067340683406934070340713407234073340743407534076340773407834079340803408134082340833408434085340863408734088340893409034091340923409334094340953409634097340983409934100341013410234103341043410534106341073410834109341103411134112341133411434115341163411734118341193412034121341223412334124341253412634127341283412934130341313413234133341343413534136341373413834139341403414134142341433414434145341463414734148341493415034151341523415334154341553415634157341583415934160341613416234163341643416534166341673416834169341703417134172341733417434175341763417734178341793418034181341823418334184341853418634187341883418934190341913419234193341943419534196341973419834199342003420134202342033420434205342063420734208342093421034211342123421334214342153421634217342183421934220342213422234223342243422534226342273422834229342303423134232342333423434235342363423734238342393424034241342423424334244342453424634247342483424934250342513425234253342543425534256342573425834259342603426134262342633426434265342663426734268342693427034271342723427334274342753427634277342783427934280342813428234283342843428534286342873428834289342903429134292342933429434295342963429734298342993430034301343023430334304343053430634307343083430934310343113431234313343143431534316343173431834319343203432134322343233432434325343263432734328343293433034331343323433334334343353433634337343383433934340343413434234343343443434534346343473434834349343503435134352343533435434355343563435734358343593436034361343623436334364343653436634367343683436934370343713437234373343743437534376343773437834379343803438134382343833438434385343863438734388343893439034391343923439334394343953439634397343983439934400344013440234403344043440534406344073440834409344103441134412344133441434415344163441734418344193442034421344223442334424344253442634427344283442934430344313443234433344343443534436344373443834439344403444134442344433444434445344463444734448344493445034451344523445334454344553445634457344583445934460344613446234463344643446534466344673446834469344703447134472344733447434475344763447734478344793448034481344823448334484344853448634487344883448934490344913449234493344943449534496344973449834499345003450134502345033450434505345063450734508345093451034511345123451334514345153451634517345183451934520345213452234523345243452534526345273452834529345303453134532345333453434535345363453734538345393454034541345423454334544345453454634547345483454934550345513455234553345543455534556345573455834559345603456134562345633456434565345663456734568345693457034571345723457334574345753457634577345783457934580345813458234583345843458534586345873458834589345903459134592345933459434595345963459734598345993460034601346023460334604346053460634607346083460934610346113461234613346143461534616346173461834619346203462134622346233462434625346263462734628346293463034631346323463334634346353463634637346383463934640346413464234643346443464534646346473464834649346503465134652346533465434655346563465734658346593466034661346623466334664346653466634667346683466934670346713467234673346743467534676346773467834679346803468134682346833468434685346863468734688346893469034691346923469334694346953469634697346983469934700347013470234703347043470534706347073470834709347103471134712347133471434715347163471734718347193472034721347223472334724347253472634727347283472934730347313473234733347343473534736347373473834739347403474134742347433474434745347463474734748347493475034751347523475334754347553475634757347583475934760347613476234763347643476534766347673476834769347703477134772347733477434775347763477734778347793478034781347823478334784347853478634787347883478934790347913479234793347943479534796347973479834799348003480134802348033480434805348063480734808348093481034811348123481334814348153481634817348183481934820348213482234823348243482534826348273482834829348303483134832348333483434835348363483734838348393484034841348423484334844348453484634847348483484934850348513485234853348543485534856348573485834859348603486134862348633486434865348663486734868348693487034871348723487334874348753487634877348783487934880348813488234883348843488534886348873488834889348903489134892348933489434895348963489734898348993490034901349023490334904349053490634907349083490934910349113491234913349143491534916349173491834919349203492134922349233492434925349263492734928349293493034931349323493334934349353493634937349383493934940349413494234943349443494534946349473494834949349503495134952349533495434955349563495734958349593496034961349623496334964349653496634967349683496934970349713497234973349743497534976349773497834979349803498134982349833498434985349863498734988349893499034991349923499334994349953499634997349983499935000350013500235003350043500535006350073500835009350103501135012350133501435015350163501735018350193502035021350223502335024350253502635027350283502935030350313503235033350343503535036350373503835039350403504135042350433504435045350463504735048350493505035051350523505335054350553505635057350583505935060350613506235063350643506535066350673506835069350703507135072350733507435075350763507735078350793508035081350823508335084350853508635087350883508935090350913509235093350943509535096350973509835099351003510135102351033510435105351063510735108351093511035111351123511335114351153511635117351183511935120351213512235123351243512535126351273512835129351303513135132351333513435135351363513735138351393514035141351423514335144351453514635147351483514935150351513515235153351543515535156351573515835159351603516135162351633516435165351663516735168351693517035171351723517335174351753517635177351783517935180351813518235183351843518535186351873518835189351903519135192351933519435195351963519735198351993520035201352023520335204352053520635207352083520935210352113521235213352143521535216352173521835219352203522135222352233522435225352263522735228352293523035231352323523335234352353523635237352383523935240352413524235243352443524535246352473524835249352503525135252352533525435255352563525735258352593526035261352623526335264352653526635267352683526935270352713527235273352743527535276352773527835279352803528135282352833528435285352863528735288352893529035291352923529335294352953529635297352983529935300353013530235303353043530535306353073530835309353103531135312353133531435315353163531735318353193532035321353223532335324353253532635327353283532935330353313533235333353343533535336353373533835339353403534135342353433534435345353463534735348353493535035351353523535335354353553535635357353583535935360353613536235363353643536535366353673536835369353703537135372353733537435375353763537735378353793538035381353823538335384353853538635387353883538935390353913539235393353943539535396353973539835399354003540135402354033540435405354063540735408354093541035411354123541335414354153541635417354183541935420354213542235423354243542535426354273542835429354303543135432354333543435435354363543735438354393544035441354423544335444354453544635447354483544935450354513545235453354543545535456354573545835459354603546135462354633546435465354663546735468354693547035471354723547335474354753547635477354783547935480354813548235483354843548535486354873548835489354903549135492354933549435495354963549735498354993550035501355023550335504355053550635507355083550935510355113551235513355143551535516355173551835519355203552135522355233552435525355263552735528355293553035531355323553335534355353553635537355383553935540355413554235543355443554535546355473554835549355503555135552355533555435555355563555735558355593556035561355623556335564355653556635567355683556935570355713557235573355743557535576355773557835579355803558135582355833558435585355863558735588355893559035591355923559335594355953559635597355983559935600356013560235603356043560535606356073560835609356103561135612356133561435615356163561735618356193562035621356223562335624356253562635627356283562935630356313563235633356343563535636356373563835639356403564135642356433564435645356463564735648356493565035651356523565335654356553565635657356583565935660356613566235663356643566535666356673566835669356703567135672356733567435675356763567735678356793568035681356823568335684356853568635687356883568935690356913569235693356943569535696356973569835699357003570135702357033570435705357063570735708357093571035711357123571335714357153571635717357183571935720357213572235723357243572535726357273572835729357303573135732357333573435735357363573735738357393574035741357423574335744357453574635747357483574935750357513575235753357543575535756357573575835759357603576135762357633576435765357663576735768357693577035771357723577335774357753577635777357783577935780357813578235783357843578535786357873578835789357903579135792357933579435795357963579735798357993580035801358023580335804358053580635807358083580935810358113581235813358143581535816358173581835819358203582135822358233582435825358263582735828358293583035831358323583335834358353583635837358383583935840358413584235843358443584535846358473584835849358503585135852358533585435855358563585735858358593586035861358623586335864358653586635867358683586935870358713587235873358743587535876358773587835879358803588135882358833588435885358863588735888358893589035891358923589335894358953589635897358983589935900359013590235903359043590535906359073590835909359103591135912359133591435915359163591735918359193592035921359223592335924359253592635927359283592935930359313593235933359343593535936359373593835939359403594135942359433594435945359463594735948359493595035951359523595335954359553595635957359583595935960359613596235963359643596535966359673596835969359703597135972359733597435975359763597735978359793598035981359823598335984359853598635987359883598935990359913599235993359943599535996359973599835999360003600136002360033600436005360063600736008360093601036011360123601336014360153601636017360183601936020360213602236023360243602536026360273602836029360303603136032360333603436035360363603736038360393604036041360423604336044360453604636047360483604936050360513605236053360543605536056360573605836059360603606136062360633606436065360663606736068360693607036071360723607336074360753607636077360783607936080360813608236083360843608536086360873608836089360903609136092360933609436095360963609736098360993610036101361023610336104361053610636107361083610936110361113611236113361143611536116361173611836119361203612136122361233612436125361263612736128361293613036131361323613336134361353613636137361383613936140361413614236143361443614536146361473614836149361503615136152361533615436155361563615736158361593616036161361623616336164361653616636167361683616936170361713617236173361743617536176361773617836179361803618136182361833618436185361863618736188361893619036191361923619336194361953619636197361983619936200362013620236203362043620536206362073620836209362103621136212362133621436215362163621736218362193622036221362223622336224362253622636227362283622936230362313623236233362343623536236362373623836239362403624136242362433624436245362463624736248362493625036251362523625336254362553625636257362583625936260362613626236263362643626536266362673626836269362703627136272362733627436275362763627736278362793628036281362823628336284362853628636287362883628936290362913629236293362943629536296362973629836299363003630136302363033630436305363063630736308363093631036311363123631336314363153631636317363183631936320363213632236323363243632536326363273632836329363303633136332363333633436335363363633736338363393634036341363423634336344363453634636347363483634936350363513635236353363543635536356363573635836359363603636136362363633636436365363663636736368363693637036371363723637336374363753637636377363783637936380363813638236383363843638536386363873638836389363903639136392363933639436395363963639736398363993640036401364023640336404364053640636407364083640936410364113641236413364143641536416364173641836419364203642136422364233642436425364263642736428364293643036431364323643336434364353643636437364383643936440364413644236443364443644536446364473644836449364503645136452364533645436455364563645736458364593646036461364623646336464364653646636467364683646936470364713647236473364743647536476364773647836479364803648136482364833648436485364863648736488364893649036491364923649336494364953649636497364983649936500365013650236503365043650536506365073650836509365103651136512365133651436515365163651736518365193652036521365223652336524365253652636527365283652936530365313653236533365343653536536365373653836539365403654136542365433654436545365463654736548365493655036551365523655336554365553655636557365583655936560365613656236563365643656536566365673656836569365703657136572365733657436575365763657736578365793658036581365823658336584365853658636587365883658936590365913659236593365943659536596365973659836599366003660136602366033660436605366063660736608366093661036611366123661336614366153661636617366183661936620366213662236623366243662536626366273662836629366303663136632366333663436635366363663736638366393664036641366423664336644366453664636647366483664936650366513665236653366543665536656366573665836659366603666136662366633666436665366663666736668366693667036671366723667336674366753667636677366783667936680366813668236683366843668536686366873668836689366903669136692366933669436695366963669736698366993670036701367023670336704367053670636707367083670936710367113671236713367143671536716367173671836719367203672136722367233672436725367263672736728367293673036731367323673336734367353673636737367383673936740367413674236743367443674536746367473674836749367503675136752367533675436755367563675736758367593676036761367623676336764367653676636767367683676936770367713677236773367743677536776367773677836779367803678136782367833678436785367863678736788367893679036791367923679336794367953679636797367983679936800368013680236803368043680536806368073680836809368103681136812368133681436815368163681736818368193682036821368223682336824368253682636827368283682936830368313683236833368343683536836368373683836839368403684136842368433684436845368463684736848368493685036851368523685336854368553685636857368583685936860368613686236863368643686536866368673686836869368703687136872368733687436875368763687736878368793688036881368823688336884368853688636887368883688936890368913689236893368943689536896368973689836899369003690136902369033690436905369063690736908369093691036911369123691336914369153691636917369183691936920369213692236923369243692536926369273692836929369303693136932369333693436935369363693736938369393694036941369423694336944369453694636947369483694936950369513695236953369543695536956369573695836959369603696136962369633696436965369663696736968369693697036971369723697336974369753697636977369783697936980369813698236983369843698536986369873698836989369903699136992369933699436995369963699736998369993700037001370023700337004370053700637007370083700937010370113701237013370143701537016370173701837019370203702137022370233702437025370263702737028370293703037031370323703337034370353703637037370383703937040370413704237043370443704537046370473704837049370503705137052370533705437055370563705737058370593706037061370623706337064370653706637067370683706937070370713707237073370743707537076370773707837079370803708137082370833708437085370863708737088370893709037091370923709337094370953709637097370983709937100371013710237103371043710537106371073710837109371103711137112371133711437115371163711737118371193712037121371223712337124371253712637127371283712937130371313713237133371343713537136371373713837139371403714137142371433714437145371463714737148371493715037151371523715337154371553715637157371583715937160371613716237163371643716537166371673716837169371703717137172371733717437175371763717737178371793718037181371823718337184371853718637187371883718937190371913719237193371943719537196371973719837199372003720137202372033720437205372063720737208372093721037211372123721337214372153721637217372183721937220372213722237223372243722537226372273722837229372303723137232372333723437235372363723737238372393724037241372423724337244372453724637247372483724937250372513725237253372543725537256372573725837259372603726137262372633726437265372663726737268372693727037271372723727337274372753727637277372783727937280372813728237283372843728537286372873728837289372903729137292372933729437295372963729737298372993730037301373023730337304373053730637307373083730937310373113731237313373143731537316373173731837319373203732137322373233732437325373263732737328373293733037331373323733337334373353733637337373383733937340373413734237343373443734537346373473734837349373503735137352373533735437355373563735737358373593736037361373623736337364373653736637367373683736937370373713737237373373743737537376373773737837379373803738137382373833738437385373863738737388373893739037391373923739337394373953739637397373983739937400374013740237403374043740537406374073740837409374103741137412374133741437415374163741737418374193742037421374223742337424374253742637427374283742937430374313743237433374343743537436374373743837439374403744137442374433744437445374463744737448374493745037451374523745337454374553745637457374583745937460374613746237463374643746537466374673746837469374703747137472374733747437475374763747737478374793748037481374823748337484374853748637487374883748937490374913749237493374943749537496374973749837499375003750137502375033750437505375063750737508375093751037511375123751337514375153751637517375183751937520375213752237523375243752537526375273752837529375303753137532375333753437535375363753737538375393754037541375423754337544375453754637547375483754937550375513755237553375543755537556375573755837559375603756137562375633756437565375663756737568375693757037571375723757337574375753757637577375783757937580375813758237583375843758537586375873758837589375903759137592375933759437595375963759737598375993760037601376023760337604376053760637607376083760937610376113761237613376143761537616376173761837619376203762137622376233762437625376263762737628376293763037631376323763337634376353763637637376383763937640376413764237643376443764537646376473764837649376503765137652376533765437655376563765737658376593766037661376623766337664376653766637667376683766937670376713767237673376743767537676376773767837679376803768137682376833768437685376863768737688376893769037691376923769337694376953769637697376983769937700377013770237703377043770537706377073770837709377103771137712377133771437715377163771737718377193772037721377223772337724377253772637727377283772937730377313773237733377343773537736377373773837739377403774137742377433774437745377463774737748377493775037751377523775337754377553775637757377583775937760377613776237763377643776537766377673776837769377703777137772377733777437775377763777737778377793778037781377823778337784377853778637787377883778937790377913779237793377943779537796377973779837799378003780137802378033780437805378063780737808378093781037811378123781337814378153781637817378183781937820378213782237823378243782537826378273782837829378303783137832378333783437835378363783737838378393784037841378423784337844378453784637847378483784937850378513785237853378543785537856378573785837859378603786137862378633786437865378663786737868378693787037871378723787337874378753787637877378783787937880378813788237883378843788537886378873788837889378903789137892378933789437895378963789737898378993790037901379023790337904379053790637907379083790937910379113791237913379143791537916379173791837919379203792137922379233792437925379263792737928379293793037931379323793337934379353793637937379383793937940379413794237943379443794537946379473794837949379503795137952379533795437955379563795737958379593796037961379623796337964379653796637967379683796937970379713797237973379743797537976379773797837979379803798137982379833798437985379863798737988379893799037991379923799337994379953799637997379983799938000380013800238003380043800538006380073800838009380103801138012380133801438015380163801738018380193802038021380223802338024380253802638027380283802938030380313803238033380343803538036380373803838039380403804138042380433804438045380463804738048380493805038051380523805338054380553805638057380583805938060380613806238063380643806538066380673806838069380703807138072380733807438075380763807738078380793808038081380823808338084380853808638087380883808938090380913809238093380943809538096380973809838099381003810138102381033810438105381063810738108381093811038111381123811338114381153811638117381183811938120381213812238123381243812538126381273812838129381303813138132381333813438135381363813738138381393814038141381423814338144381453814638147381483814938150381513815238153381543815538156381573815838159381603816138162381633816438165381663816738168381693817038171381723817338174381753817638177381783817938180381813818238183381843818538186381873818838189381903819138192381933819438195381963819738198381993820038201382023820338204382053820638207382083820938210382113821238213382143821538216382173821838219382203822138222382233822438225382263822738228382293823038231382323823338234382353823638237382383823938240382413824238243382443824538246382473824838249382503825138252382533825438255382563825738258382593826038261382623826338264382653826638267382683826938270382713827238273382743827538276382773827838279382803828138282382833828438285382863828738288382893829038291382923829338294382953829638297382983829938300383013830238303383043830538306383073830838309383103831138312383133831438315383163831738318383193832038321383223832338324383253832638327383283832938330383313833238333383343833538336383373833838339383403834138342383433834438345383463834738348383493835038351383523835338354383553835638357383583835938360383613836238363383643836538366383673836838369383703837138372383733837438375383763837738378383793838038381383823838338384383853838638387383883838938390383913839238393383943839538396383973839838399384003840138402384033840438405384063840738408384093841038411384123841338414384153841638417384183841938420384213842238423384243842538426384273842838429384303843138432384333843438435384363843738438384393844038441384423844338444384453844638447384483844938450384513845238453384543845538456384573845838459384603846138462384633846438465384663846738468384693847038471384723847338474384753847638477384783847938480384813848238483384843848538486384873848838489384903849138492384933849438495384963849738498384993850038501385023850338504385053850638507385083850938510385113851238513385143851538516385173851838519385203852138522385233852438525385263852738528385293853038531385323853338534385353853638537385383853938540385413854238543385443854538546385473854838549385503855138552385533855438555385563855738558385593856038561385623856338564385653856638567385683856938570385713857238573385743857538576385773857838579385803858138582385833858438585385863858738588385893859038591385923859338594385953859638597385983859938600386013860238603386043860538606386073860838609386103861138612386133861438615386163861738618386193862038621386223862338624386253862638627386283862938630386313863238633386343863538636386373863838639386403864138642386433864438645386463864738648386493865038651386523865338654386553865638657386583865938660386613866238663386643866538666386673866838669386703867138672386733867438675386763867738678386793868038681386823868338684386853868638687386883868938690386913869238693386943869538696386973869838699387003870138702387033870438705387063870738708387093871038711387123871338714387153871638717387183871938720387213872238723387243872538726387273872838729387303873138732387333873438735387363873738738387393874038741387423874338744387453874638747387483874938750387513875238753387543875538756387573875838759387603876138762387633876438765387663876738768387693877038771387723877338774387753877638777387783877938780387813878238783387843878538786387873878838789387903879138792387933879438795387963879738798387993880038801388023880338804388053880638807388083880938810388113881238813388143881538816388173881838819388203882138822388233882438825388263882738828388293883038831388323883338834388353883638837388383883938840388413884238843388443884538846388473884838849388503885138852388533885438855388563885738858388593886038861388623886338864388653886638867388683886938870388713887238873388743887538876388773887838879388803888138882388833888438885388863888738888388893889038891388923889338894388953889638897388983889938900389013890238903389043890538906389073890838909389103891138912389133891438915389163891738918389193892038921389223892338924389253892638927389283892938930389313893238933389343893538936389373893838939389403894138942389433894438945389463894738948389493895038951389523895338954389553895638957389583895938960389613896238963389643896538966389673896838969389703897138972389733897438975389763897738978389793898038981389823898338984389853898638987389883898938990389913899238993389943899538996389973899838999390003900139002390033900439005390063900739008390093901039011390123901339014390153901639017390183901939020390213902239023390243902539026390273902839029390303903139032390333903439035390363903739038390393904039041390423904339044390453904639047390483904939050390513905239053390543905539056390573905839059390603906139062390633906439065390663906739068390693907039071390723907339074390753907639077390783907939080390813908239083390843908539086390873908839089390903909139092390933909439095390963909739098390993910039101391023910339104391053910639107391083910939110391113911239113391143911539116391173911839119391203912139122391233912439125391263912739128391293913039131391323913339134391353913639137391383913939140391413914239143391443914539146391473914839149391503915139152391533915439155391563915739158391593916039161391623916339164391653916639167391683916939170391713917239173391743917539176391773917839179391803918139182391833918439185391863918739188391893919039191391923919339194391953919639197391983919939200392013920239203392043920539206392073920839209392103921139212392133921439215392163921739218392193922039221392223922339224392253922639227392283922939230392313923239233392343923539236392373923839239392403924139242392433924439245392463924739248392493925039251392523925339254392553925639257392583925939260392613926239263392643926539266392673926839269392703927139272392733927439275392763927739278392793928039281392823928339284392853928639287392883928939290392913929239293392943929539296392973929839299393003930139302393033930439305393063930739308393093931039311393123931339314393153931639317393183931939320393213932239323393243932539326393273932839329393303933139332393333933439335393363933739338393393934039341393423934339344393453934639347393483934939350393513935239353393543935539356393573935839359393603936139362393633936439365393663936739368393693937039371393723937339374393753937639377393783937939380393813938239383393843938539386393873938839389393903939139392393933939439395393963939739398393993940039401394023940339404394053940639407394083940939410394113941239413394143941539416394173941839419394203942139422394233942439425394263942739428394293943039431394323943339434394353943639437394383943939440394413944239443394443944539446394473944839449394503945139452394533945439455394563945739458394593946039461394623946339464394653946639467394683946939470394713947239473394743947539476394773947839479394803948139482394833948439485394863948739488394893949039491394923949339494394953949639497394983949939500395013950239503395043950539506395073950839509395103951139512395133951439515395163951739518395193952039521395223952339524395253952639527395283952939530395313953239533395343953539536395373953839539395403954139542395433954439545395463954739548395493955039551395523955339554395553955639557395583955939560395613956239563395643956539566395673956839569395703957139572395733957439575395763957739578395793958039581395823958339584395853958639587395883958939590395913959239593395943959539596395973959839599396003960139602396033960439605396063960739608396093961039611396123961339614396153961639617396183961939620396213962239623396243962539626396273962839629396303963139632396333963439635396363963739638396393964039641396423964339644396453964639647396483964939650396513965239653396543965539656396573965839659396603966139662396633966439665396663966739668396693967039671396723967339674396753967639677396783967939680396813968239683396843968539686396873968839689396903969139692396933969439695396963969739698396993970039701397023970339704397053970639707397083970939710397113971239713397143971539716397173971839719397203972139722397233972439725397263972739728397293973039731397323973339734397353973639737397383973939740397413974239743397443974539746397473974839749397503975139752397533975439755397563975739758397593976039761397623976339764397653976639767397683976939770397713977239773397743977539776397773977839779397803978139782397833978439785397863978739788397893979039791397923979339794397953979639797397983979939800398013980239803398043980539806398073980839809398103981139812398133981439815398163981739818398193982039821398223982339824398253982639827398283982939830398313983239833398343983539836398373983839839398403984139842398433984439845398463984739848398493985039851398523985339854398553985639857398583985939860398613986239863398643986539866398673986839869398703987139872398733987439875398763987739878398793988039881398823988339884398853988639887398883988939890398913989239893398943989539896398973989839899399003990139902399033990439905399063990739908399093991039911399123991339914399153991639917399183991939920399213992239923399243992539926399273992839929399303993139932399333993439935399363993739938399393994039941399423994339944399453994639947399483994939950399513995239953399543995539956399573995839959399603996139962399633996439965399663996739968399693997039971399723997339974399753997639977399783997939980399813998239983399843998539986399873998839989399903999139992399933999439995399963999739998399994000040001400024000340004400054000640007400084000940010400114001240013400144001540016400174001840019400204002140022400234002440025400264002740028400294003040031400324003340034400354003640037400384003940040400414004240043400444004540046400474004840049400504005140052400534005440055400564005740058400594006040061400624006340064400654006640067400684006940070400714007240073400744007540076400774007840079400804008140082400834008440085400864008740088400894009040091400924009340094400954009640097400984009940100401014010240103401044010540106401074010840109401104011140112401134011440115401164011740118401194012040121401224012340124401254012640127401284012940130401314013240133401344013540136401374013840139401404014140142401434014440145401464014740148401494015040151401524015340154401554015640157401584015940160401614016240163401644016540166401674016840169401704017140172401734017440175401764017740178401794018040181401824018340184401854018640187401884018940190401914019240193401944019540196401974019840199402004020140202402034020440205402064020740208402094021040211402124021340214402154021640217402184021940220402214022240223402244022540226402274022840229402304023140232402334023440235402364023740238402394024040241402424024340244402454024640247402484024940250402514025240253402544025540256402574025840259402604026140262402634026440265402664026740268402694027040271402724027340274402754027640277402784027940280402814028240283402844028540286402874028840289402904029140292402934029440295402964029740298402994030040301403024030340304403054030640307403084030940310403114031240313403144031540316403174031840319403204032140322403234032440325403264032740328403294033040331403324033340334403354033640337403384033940340403414034240343403444034540346403474034840349403504035140352403534035440355403564035740358403594036040361403624036340364403654036640367403684036940370403714037240373403744037540376403774037840379403804038140382403834038440385403864038740388403894039040391403924039340394403954039640397403984039940400404014040240403404044040540406404074040840409404104041140412404134041440415404164041740418404194042040421404224042340424404254042640427404284042940430404314043240433404344043540436404374043840439404404044140442404434044440445404464044740448404494045040451404524045340454404554045640457404584045940460404614046240463404644046540466404674046840469404704047140472404734047440475404764047740478404794048040481404824048340484404854048640487404884048940490404914049240493404944049540496404974049840499405004050140502405034050440505405064050740508405094051040511405124051340514405154051640517405184051940520405214052240523405244052540526405274052840529405304053140532405334053440535405364053740538405394054040541405424054340544405454054640547405484054940550405514055240553405544055540556405574055840559405604056140562405634056440565405664056740568405694057040571405724057340574405754057640577405784057940580405814058240583405844058540586405874058840589405904059140592405934059440595405964059740598405994060040601406024060340604406054060640607406084060940610406114061240613406144061540616406174061840619406204062140622406234062440625406264062740628406294063040631406324063340634406354063640637406384063940640406414064240643406444064540646406474064840649406504065140652406534065440655406564065740658406594066040661406624066340664406654066640667406684066940670406714067240673406744067540676406774067840679406804068140682406834068440685406864068740688406894069040691406924069340694406954069640697406984069940700407014070240703407044070540706407074070840709407104071140712407134071440715407164071740718407194072040721407224072340724407254072640727407284072940730407314073240733407344073540736407374073840739407404074140742407434074440745407464074740748407494075040751407524075340754407554075640757407584075940760407614076240763407644076540766407674076840769407704077140772407734077440775407764077740778407794078040781407824078340784407854078640787407884078940790407914079240793407944079540796407974079840799408004080140802408034080440805408064080740808408094081040811408124081340814408154081640817408184081940820408214082240823408244082540826408274082840829408304083140832408334083440835408364083740838408394084040841408424084340844408454084640847408484084940850408514085240853408544085540856408574085840859408604086140862408634086440865408664086740868408694087040871408724087340874408754087640877408784087940880408814088240883408844088540886408874088840889408904089140892408934089440895408964089740898408994090040901409024090340904409054090640907409084090940910409114091240913409144091540916409174091840919409204092140922409234092440925409264092740928409294093040931409324093340934409354093640937409384093940940409414094240943409444094540946409474094840949409504095140952409534095440955409564095740958409594096040961409624096340964409654096640967409684096940970409714097240973409744097540976409774097840979409804098140982409834098440985409864098740988409894099040991409924099340994409954099640997409984099941000410014100241003410044100541006410074100841009410104101141012410134101441015410164101741018410194102041021410224102341024410254102641027410284102941030410314103241033410344103541036410374103841039410404104141042410434104441045410464104741048410494105041051410524105341054410554105641057410584105941060410614106241063410644106541066410674106841069410704107141072410734107441075410764107741078410794108041081410824108341084410854108641087410884108941090410914109241093410944109541096410974109841099411004110141102411034110441105411064110741108411094111041111411124111341114411154111641117411184111941120411214112241123411244112541126411274112841129411304113141132411334113441135411364113741138411394114041141411424114341144411454114641147411484114941150411514115241153411544115541156411574115841159411604116141162411634116441165411664116741168411694117041171411724117341174411754117641177411784117941180411814118241183411844118541186411874118841189411904119141192411934119441195411964119741198411994120041201412024120341204412054120641207412084120941210412114121241213412144121541216412174121841219412204122141222412234122441225412264122741228412294123041231412324123341234412354123641237412384123941240412414124241243412444124541246412474124841249412504125141252412534125441255412564125741258412594126041261412624126341264412654126641267412684126941270412714127241273412744127541276412774127841279412804128141282412834128441285412864128741288412894129041291412924129341294412954129641297412984129941300413014130241303413044130541306413074130841309413104131141312413134131441315413164131741318413194132041321413224132341324413254132641327413284132941330413314133241333413344133541336413374133841339413404134141342413434134441345413464134741348413494135041351413524135341354413554135641357413584135941360413614136241363413644136541366413674136841369413704137141372413734137441375413764137741378413794138041381413824138341384413854138641387413884138941390413914139241393413944139541396413974139841399414004140141402414034140441405414064140741408414094141041411414124141341414414154141641417414184141941420414214142241423414244142541426414274142841429414304143141432414334143441435414364143741438414394144041441414424144341444414454144641447414484144941450414514145241453414544145541456414574145841459414604146141462414634146441465414664146741468414694147041471414724147341474414754147641477414784147941480414814148241483414844148541486414874148841489414904149141492414934149441495414964149741498414994150041501415024150341504415054150641507415084150941510415114151241513415144151541516415174151841519415204152141522415234152441525415264152741528415294153041531415324153341534415354153641537415384153941540415414154241543415444154541546415474154841549415504155141552415534155441555415564155741558415594156041561415624156341564415654156641567415684156941570415714157241573415744157541576415774157841579415804158141582415834158441585415864158741588415894159041591415924159341594415954159641597415984159941600416014160241603416044160541606416074160841609416104161141612416134161441615416164161741618416194162041621416224162341624416254162641627416284162941630416314163241633416344163541636416374163841639416404164141642416434164441645416464164741648416494165041651416524165341654416554165641657416584165941660416614166241663416644166541666416674166841669416704167141672416734167441675416764167741678416794168041681416824168341684416854168641687416884168941690416914169241693416944169541696416974169841699417004170141702417034170441705417064170741708417094171041711417124171341714417154171641717417184171941720417214172241723417244172541726417274172841729417304173141732417334173441735417364173741738417394174041741417424174341744417454174641747417484174941750417514175241753417544175541756417574175841759417604176141762417634176441765417664176741768417694177041771417724177341774417754177641777417784177941780417814178241783417844178541786417874178841789417904179141792417934179441795417964179741798417994180041801418024180341804418054180641807418084180941810418114181241813418144181541816418174181841819418204182141822418234182441825418264182741828418294183041831418324183341834418354183641837418384183941840418414184241843418444184541846418474184841849418504185141852418534185441855418564185741858418594186041861418624186341864418654186641867418684186941870418714187241873418744187541876418774187841879418804188141882418834188441885418864188741888418894189041891418924189341894418954189641897418984189941900419014190241903419044190541906419074190841909419104191141912419134191441915419164191741918419194192041921419224192341924419254192641927419284192941930419314193241933419344193541936419374193841939419404194141942419434194441945419464194741948419494195041951419524195341954419554195641957419584195941960419614196241963419644196541966419674196841969419704197141972419734197441975419764197741978419794198041981419824198341984419854198641987419884198941990419914199241993419944199541996419974199841999420004200142002420034200442005420064200742008420094201042011420124201342014420154201642017420184201942020420214202242023420244202542026420274202842029420304203142032420334203442035420364203742038420394204042041420424204342044420454204642047420484204942050420514205242053420544205542056420574205842059420604206142062420634206442065420664206742068420694207042071420724207342074420754207642077420784207942080420814208242083420844208542086420874208842089420904209142092420934209442095420964209742098420994210042101421024210342104421054210642107421084210942110421114211242113421144211542116421174211842119421204212142122421234212442125421264212742128421294213042131421324213342134421354213642137421384213942140421414214242143421444214542146421474214842149421504215142152421534215442155421564215742158421594216042161421624216342164421654216642167421684216942170421714217242173421744217542176421774217842179421804218142182421834218442185421864218742188421894219042191421924219342194421954219642197421984219942200422014220242203422044220542206422074220842209422104221142212422134221442215422164221742218422194222042221422224222342224422254222642227422284222942230422314223242233422344223542236422374223842239422404224142242422434224442245422464224742248422494225042251422524225342254422554225642257422584225942260422614226242263422644226542266422674226842269422704227142272422734227442275422764227742278422794228042281422824228342284422854228642287422884228942290422914229242293422944229542296422974229842299423004230142302423034230442305423064230742308423094231042311423124231342314423154231642317423184231942320423214232242323423244232542326423274232842329423304233142332423334233442335423364233742338423394234042341423424234342344423454234642347423484234942350423514235242353423544235542356423574235842359423604236142362423634236442365423664236742368423694237042371423724237342374423754237642377423784237942380423814238242383423844238542386423874238842389423904239142392423934239442395423964239742398423994240042401424024240342404424054240642407424084240942410424114241242413424144241542416424174241842419424204242142422424234242442425424264242742428424294243042431424324243342434424354243642437424384243942440424414244242443424444244542446424474244842449424504245142452424534245442455424564245742458424594246042461424624246342464424654246642467424684246942470424714247242473424744247542476424774247842479424804248142482424834248442485424864248742488424894249042491424924249342494424954249642497424984249942500425014250242503425044250542506425074250842509425104251142512425134251442515425164251742518425194252042521425224252342524425254252642527425284252942530425314253242533425344253542536425374253842539425404254142542425434254442545425464254742548425494255042551425524255342554425554255642557425584255942560425614256242563425644256542566425674256842569425704257142572425734257442575425764257742578425794258042581425824258342584425854258642587425884258942590425914259242593425944259542596425974259842599426004260142602426034260442605426064260742608426094261042611426124261342614426154261642617426184261942620426214262242623426244262542626426274262842629426304263142632426334263442635426364263742638426394264042641426424264342644426454264642647426484264942650426514265242653426544265542656426574265842659426604266142662426634266442665426664266742668426694267042671426724267342674426754267642677426784267942680426814268242683426844268542686426874268842689426904269142692426934269442695426964269742698426994270042701427024270342704427054270642707427084270942710427114271242713427144271542716427174271842719427204272142722427234272442725427264272742728427294273042731427324273342734427354273642737427384273942740427414274242743427444274542746427474274842749427504275142752427534275442755427564275742758427594276042761427624276342764427654276642767427684276942770427714277242773427744277542776427774277842779427804278142782427834278442785427864278742788427894279042791427924279342794427954279642797427984279942800428014280242803428044280542806428074280842809428104281142812428134281442815428164281742818428194282042821428224282342824428254282642827428284282942830428314283242833428344283542836428374283842839428404284142842428434284442845428464284742848428494285042851428524285342854428554285642857428584285942860428614286242863428644286542866428674286842869428704287142872428734287442875428764287742878428794288042881428824288342884428854288642887428884288942890428914289242893428944289542896428974289842899429004290142902429034290442905429064290742908429094291042911429124291342914429154291642917429184291942920429214292242923429244292542926429274292842929429304293142932429334293442935429364293742938429394294042941429424294342944429454294642947429484294942950429514295242953429544295542956429574295842959429604296142962429634296442965429664296742968429694297042971429724297342974429754297642977429784297942980429814298242983429844298542986429874298842989429904299142992429934299442995429964299742998429994300043001430024300343004430054300643007430084300943010430114301243013430144301543016430174301843019430204302143022430234302443025430264302743028430294303043031430324303343034430354303643037430384303943040430414304243043430444304543046430474304843049430504305143052430534305443055430564305743058430594306043061430624306343064430654306643067430684306943070430714307243073430744307543076430774307843079430804308143082430834308443085430864308743088430894309043091430924309343094430954309643097430984309943100431014310243103431044310543106431074310843109431104311143112431134311443115431164311743118431194312043121431224312343124431254312643127431284312943130431314313243133431344313543136431374313843139431404314143142431434314443145431464314743148431494315043151431524315343154431554315643157431584315943160431614316243163431644316543166431674316843169431704317143172431734317443175431764317743178431794318043181431824318343184431854318643187431884318943190431914319243193431944319543196431974319843199432004320143202432034320443205432064320743208432094321043211432124321343214432154321643217432184321943220432214322243223432244322543226432274322843229432304323143232432334323443235432364323743238432394324043241432424324343244432454324643247432484324943250432514325243253432544325543256432574325843259432604326143262432634326443265432664326743268432694327043271432724327343274432754327643277432784327943280432814328243283432844328543286432874328843289432904329143292432934329443295432964329743298432994330043301433024330343304433054330643307433084330943310433114331243313433144331543316433174331843319433204332143322433234332443325433264332743328433294333043331433324333343334433354333643337433384333943340433414334243343433444334543346433474334843349433504335143352433534335443355433564335743358433594336043361433624336343364433654336643367433684336943370433714337243373433744337543376433774337843379433804338143382433834338443385433864338743388433894339043391433924339343394433954339643397433984339943400434014340243403434044340543406434074340843409434104341143412434134341443415434164341743418434194342043421434224342343424434254342643427434284342943430434314343243433434344343543436434374343843439434404344143442434434344443445434464344743448434494345043451434524345343454434554345643457434584345943460434614346243463434644346543466434674346843469434704347143472434734347443475434764347743478434794348043481434824348343484434854348643487434884348943490434914349243493434944349543496434974349843499435004350143502435034350443505435064350743508435094351043511435124351343514435154351643517435184351943520435214352243523435244352543526435274352843529435304353143532435334353443535435364353743538435394354043541435424354343544435454354643547435484354943550435514355243553435544355543556435574355843559435604356143562435634356443565435664356743568435694357043571435724357343574435754357643577435784357943580435814358243583435844358543586435874358843589435904359143592435934359443595435964359743598435994360043601436024360343604436054360643607436084360943610436114361243613436144361543616436174361843619436204362143622436234362443625436264362743628436294363043631436324363343634436354363643637436384363943640436414364243643436444364543646436474364843649436504365143652436534365443655436564365743658436594366043661436624366343664436654366643667436684366943670436714367243673436744367543676436774367843679436804368143682436834368443685436864368743688436894369043691436924369343694436954369643697436984369943700437014370243703437044370543706437074370843709437104371143712437134371443715437164371743718437194372043721437224372343724437254372643727437284372943730437314373243733437344373543736437374373843739437404374143742437434374443745437464374743748437494375043751437524375343754437554375643757437584375943760437614376243763437644376543766437674376843769437704377143772437734377443775437764377743778437794378043781437824378343784437854378643787437884378943790437914379243793437944379543796437974379843799438004380143802438034380443805438064380743808438094381043811438124381343814438154381643817438184381943820438214382243823438244382543826438274382843829438304383143832438334383443835438364383743838438394384043841438424384343844438454384643847438484384943850438514385243853438544385543856438574385843859438604386143862438634386443865438664386743868438694387043871438724387343874438754387643877438784387943880438814388243883438844388543886438874388843889438904389143892438934389443895438964389743898438994390043901439024390343904439054390643907439084390943910439114391243913439144391543916439174391843919439204392143922439234392443925439264392743928439294393043931439324393343934439354393643937439384393943940439414394243943439444394543946439474394843949439504395143952439534395443955439564395743958439594396043961439624396343964439654396643967439684396943970439714397243973439744397543976439774397843979439804398143982439834398443985439864398743988439894399043991439924399343994439954399643997439984399944000440014400244003440044400544006440074400844009440104401144012440134401444015440164401744018440194402044021440224402344024440254402644027440284402944030440314403244033440344403544036440374403844039440404404144042440434404444045440464404744048440494405044051440524405344054440554405644057440584405944060440614406244063440644406544066440674406844069440704407144072440734407444075440764407744078440794408044081440824408344084440854408644087440884408944090440914409244093440944409544096440974409844099441004410144102441034410444105441064410744108441094411044111441124411344114441154411644117441184411944120441214412244123441244412544126441274412844129441304413144132441334413444135441364413744138441394414044141441424414344144441454414644147441484414944150441514415244153441544415544156441574415844159441604416144162441634416444165441664416744168441694417044171441724417344174441754417644177441784417944180441814418244183441844418544186441874418844189441904419144192441934419444195441964419744198441994420044201442024420344204442054420644207442084420944210442114421244213442144421544216442174421844219442204422144222442234422444225442264422744228442294423044231442324423344234442354423644237442384423944240442414424244243442444424544246442474424844249442504425144252442534425444255442564425744258442594426044261442624426344264442654426644267442684426944270442714427244273442744427544276442774427844279442804428144282442834428444285442864428744288442894429044291442924429344294442954429644297442984429944300443014430244303443044430544306443074430844309443104431144312443134431444315443164431744318443194432044321443224432344324443254432644327443284432944330443314433244333443344433544336443374433844339443404434144342443434434444345443464434744348443494435044351443524435344354443554435644357443584435944360443614436244363443644436544366443674436844369443704437144372443734437444375443764437744378443794438044381443824438344384443854438644387443884438944390443914439244393443944439544396443974439844399444004440144402444034440444405444064440744408444094441044411444124441344414444154441644417444184441944420444214442244423444244442544426444274442844429444304443144432444334443444435444364443744438444394444044441444424444344444444454444644447444484444944450444514445244453444544445544456444574445844459444604446144462444634446444465444664446744468444694447044471444724447344474444754447644477444784447944480444814448244483444844448544486444874448844489444904449144492444934449444495444964449744498444994450044501445024450344504445054450644507445084450944510445114451244513445144451544516445174451844519445204452144522445234452444525445264452744528445294453044531445324453344534445354453644537445384453944540445414454244543445444454544546445474454844549445504455144552445534455444555445564455744558445594456044561445624456344564445654456644567445684456944570445714457244573445744457544576445774457844579445804458144582445834458444585445864458744588445894459044591445924459344594445954459644597445984459944600446014460244603446044460544606446074460844609446104461144612446134461444615446164461744618446194462044621446224462344624446254462644627446284462944630446314463244633446344463544636446374463844639446404464144642446434464444645446464464744648446494465044651446524465344654446554465644657446584465944660446614466244663446644466544666446674466844669446704467144672446734467444675446764467744678446794468044681446824468344684446854468644687446884468944690446914469244693446944469544696446974469844699447004470144702447034470444705447064470744708447094471044711447124471344714447154471644717447184471944720447214472244723447244472544726447274472844729447304473144732447334473444735447364473744738447394474044741447424474344744447454474644747447484474944750447514475244753447544475544756447574475844759447604476144762447634476444765447664476744768447694477044771447724477344774447754477644777447784477944780447814478244783447844478544786447874478844789447904479144792447934479444795447964479744798447994480044801448024480344804448054480644807448084480944810448114481244813448144481544816448174481844819448204482144822448234482444825448264482744828448294483044831448324483344834448354483644837448384483944840448414484244843448444484544846448474484844849448504485144852448534485444855448564485744858448594486044861448624486344864448654486644867448684486944870448714487244873448744487544876448774487844879448804488144882448834488444885448864488744888448894489044891448924489344894448954489644897448984489944900449014490244903449044490544906449074490844909449104491144912449134491444915449164491744918449194492044921449224492344924449254492644927449284492944930449314493244933449344493544936449374493844939449404494144942449434494444945449464494744948449494495044951449524495344954449554495644957449584495944960449614496244963449644496544966449674496844969449704497144972449734497444975449764497744978449794498044981449824498344984449854498644987449884498944990449914499244993449944499544996449974499844999450004500145002450034500445005450064500745008450094501045011450124501345014450154501645017450184501945020450214502245023450244502545026450274502845029450304503145032450334503445035450364503745038450394504045041450424504345044450454504645047450484504945050450514505245053450544505545056450574505845059450604506145062450634506445065450664506745068450694507045071450724507345074450754507645077450784507945080450814508245083450844508545086450874508845089450904509145092450934509445095450964509745098450994510045101451024510345104451054510645107451084510945110451114511245113451144511545116451174511845119451204512145122451234512445125451264512745128451294513045131451324513345134451354513645137451384513945140451414514245143451444514545146451474514845149451504515145152451534515445155451564515745158451594516045161451624516345164451654516645167451684516945170451714517245173451744517545176451774517845179451804518145182451834518445185451864518745188451894519045191451924519345194451954519645197451984519945200452014520245203452044520545206452074520845209452104521145212452134521445215452164521745218452194522045221452224522345224452254522645227452284522945230452314523245233452344523545236452374523845239452404524145242452434524445245452464524745248452494525045251452524525345254452554525645257452584525945260452614526245263452644526545266452674526845269452704527145272452734527445275452764527745278452794528045281452824528345284452854528645287452884528945290452914529245293452944529545296452974529845299453004530145302453034530445305453064530745308453094531045311453124531345314453154531645317453184531945320453214532245323453244532545326453274532845329453304533145332453334533445335453364533745338453394534045341453424534345344453454534645347453484534945350453514535245353453544535545356453574535845359453604536145362453634536445365453664536745368453694537045371453724537345374453754537645377453784537945380453814538245383453844538545386453874538845389453904539145392453934539445395453964539745398453994540045401454024540345404454054540645407454084540945410454114541245413454144541545416454174541845419454204542145422454234542445425454264542745428454294543045431454324543345434454354543645437454384543945440454414544245443454444544545446454474544845449454504545145452454534545445455454564545745458454594546045461454624546345464454654546645467454684546945470454714547245473454744547545476454774547845479454804548145482454834548445485454864548745488454894549045491454924549345494454954549645497454984549945500455014550245503455044550545506455074550845509455104551145512455134551445515455164551745518455194552045521455224552345524455254552645527455284552945530455314553245533455344553545536455374553845539455404554145542455434554445545455464554745548455494555045551455524555345554455554555645557455584555945560455614556245563455644556545566455674556845569455704557145572455734557445575455764557745578455794558045581455824558345584455854558645587455884558945590455914559245593455944559545596455974559845599456004560145602456034560445605456064560745608456094561045611456124561345614456154561645617456184561945620456214562245623456244562545626456274562845629456304563145632456334563445635456364563745638456394564045641456424564345644456454564645647456484564945650456514565245653456544565545656456574565845659456604566145662456634566445665456664566745668456694567045671456724567345674456754567645677456784567945680456814568245683456844568545686456874568845689456904569145692456934569445695456964569745698456994570045701457024570345704457054570645707457084570945710457114571245713457144571545716457174571845719457204572145722457234572445725457264572745728457294573045731457324573345734457354573645737457384573945740457414574245743457444574545746457474574845749457504575145752457534575445755457564575745758457594576045761457624576345764457654576645767457684576945770457714577245773457744577545776457774577845779457804578145782457834578445785457864578745788457894579045791457924579345794457954579645797457984579945800458014580245803458044580545806458074580845809458104581145812458134581445815458164581745818458194582045821458224582345824458254582645827458284582945830458314583245833458344583545836458374583845839458404584145842458434584445845458464584745848458494585045851458524585345854458554585645857458584585945860458614586245863458644586545866458674586845869458704587145872458734587445875458764587745878458794588045881458824588345884458854588645887458884588945890458914589245893458944589545896458974589845899459004590145902459034590445905459064590745908459094591045911459124591345914459154591645917459184591945920459214592245923459244592545926459274592845929459304593145932459334593445935459364593745938459394594045941459424594345944459454594645947459484594945950459514595245953459544595545956459574595845959459604596145962459634596445965459664596745968459694597045971459724597345974459754597645977459784597945980459814598245983459844598545986459874598845989459904599145992459934599445995459964599745998459994600046001460024600346004460054600646007460084600946010460114601246013460144601546016460174601846019460204602146022460234602446025460264602746028460294603046031460324603346034460354603646037460384603946040460414604246043460444604546046460474604846049460504605146052460534605446055460564605746058460594606046061460624606346064460654606646067460684606946070460714607246073460744607546076460774607846079460804608146082460834608446085460864608746088460894609046091460924609346094460954609646097460984609946100461014610246103461044610546106461074610846109461104611146112461134611446115461164611746118461194612046121461224612346124461254612646127461284612946130461314613246133461344613546136461374613846139461404614146142461434614446145461464614746148461494615046151461524615346154461554615646157461584615946160461614616246163461644616546166461674616846169461704617146172461734617446175461764617746178461794618046181461824618346184461854618646187461884618946190461914619246193461944619546196461974619846199462004620146202462034620446205462064620746208462094621046211462124621346214462154621646217462184621946220462214622246223462244622546226462274622846229462304623146232462334623446235462364623746238462394624046241462424624346244462454624646247462484624946250462514625246253462544625546256462574625846259462604626146262462634626446265462664626746268462694627046271462724627346274462754627646277462784627946280462814628246283462844628546286462874628846289462904629146292462934629446295462964629746298462994630046301463024630346304463054630646307463084630946310463114631246313463144631546316463174631846319463204632146322463234632446325463264632746328463294633046331463324633346334463354633646337463384633946340463414634246343463444634546346463474634846349463504635146352463534635446355463564635746358463594636046361463624636346364463654636646367463684636946370463714637246373463744637546376463774637846379463804638146382463834638446385463864638746388463894639046391463924639346394463954639646397463984639946400464014640246403464044640546406464074640846409464104641146412464134641446415464164641746418464194642046421464224642346424464254642646427464284642946430464314643246433464344643546436464374643846439464404644146442464434644446445464464644746448464494645046451464524645346454464554645646457464584645946460464614646246463464644646546466464674646846469464704647146472464734647446475464764647746478464794648046481464824648346484464854648646487464884648946490464914649246493464944649546496464974649846499465004650146502465034650446505465064650746508465094651046511465124651346514465154651646517465184651946520465214652246523465244652546526465274652846529465304653146532465334653446535465364653746538465394654046541465424654346544465454654646547465484654946550465514655246553465544655546556465574655846559465604656146562465634656446565465664656746568465694657046571465724657346574465754657646577465784657946580465814658246583465844658546586465874658846589465904659146592465934659446595465964659746598465994660046601466024660346604466054660646607466084660946610466114661246613466144661546616466174661846619466204662146622466234662446625466264662746628466294663046631466324663346634466354663646637466384663946640466414664246643466444664546646466474664846649466504665146652466534665446655466564665746658466594666046661466624666346664466654666646667466684666946670466714667246673466744667546676466774667846679466804668146682466834668446685466864668746688466894669046691466924669346694466954669646697466984669946700467014670246703467044670546706467074670846709467104671146712467134671446715467164671746718467194672046721467224672346724467254672646727467284672946730467314673246733467344673546736467374673846739467404674146742467434674446745467464674746748467494675046751467524675346754467554675646757467584675946760467614676246763467644676546766467674676846769467704677146772467734677446775467764677746778467794678046781467824678346784467854678646787467884678946790467914679246793467944679546796467974679846799468004680146802468034680446805468064680746808468094681046811468124681346814468154681646817468184681946820468214682246823468244682546826468274682846829468304683146832468334683446835468364683746838468394684046841468424684346844468454684646847468484684946850468514685246853468544685546856468574685846859468604686146862468634686446865468664686746868468694687046871468724687346874468754687646877468784687946880468814688246883468844688546886468874688846889468904689146892468934689446895468964689746898468994690046901469024690346904469054690646907469084690946910469114691246913469144691546916469174691846919469204692146922469234692446925469264692746928469294693046931469324693346934469354693646937469384693946940469414694246943469444694546946469474694846949469504695146952469534695446955469564695746958469594696046961469624696346964469654696646967469684696946970469714697246973469744697546976469774697846979469804698146982469834698446985469864698746988469894699046991469924699346994469954699646997469984699947000470014700247003470044700547006470074700847009470104701147012470134701447015470164701747018470194702047021470224702347024470254702647027470284702947030470314703247033470344703547036470374703847039470404704147042470434704447045470464704747048470494705047051470524705347054470554705647057470584705947060470614706247063470644706547066470674706847069470704707147072470734707447075470764707747078470794708047081470824708347084470854708647087470884708947090470914709247093470944709547096470974709847099471004710147102471034710447105471064710747108471094711047111471124711347114471154711647117471184711947120471214712247123471244712547126471274712847129471304713147132471334713447135471364713747138471394714047141471424714347144471454714647147471484714947150471514715247153471544715547156471574715847159471604716147162471634716447165471664716747168471694717047171471724717347174471754717647177471784717947180471814718247183471844718547186471874718847189471904719147192471934719447195471964719747198471994720047201472024720347204472054720647207472084720947210472114721247213472144721547216472174721847219472204722147222472234722447225472264722747228472294723047231472324723347234472354723647237472384723947240472414724247243472444724547246472474724847249472504725147252472534725447255472564725747258472594726047261472624726347264472654726647267472684726947270472714727247273472744727547276472774727847279472804728147282472834728447285472864728747288472894729047291472924729347294472954729647297472984729947300473014730247303473044730547306473074730847309473104731147312473134731447315473164731747318473194732047321473224732347324473254732647327473284732947330473314733247333473344733547336473374733847339473404734147342473434734447345473464734747348473494735047351473524735347354473554735647357473584735947360473614736247363473644736547366473674736847369473704737147372473734737447375473764737747378473794738047381473824738347384473854738647387473884738947390473914739247393473944739547396473974739847399474004740147402474034740447405474064740747408474094741047411474124741347414474154741647417474184741947420474214742247423474244742547426474274742847429474304743147432474334743447435474364743747438474394744047441474424744347444474454744647447474484744947450474514745247453474544745547456474574745847459474604746147462474634746447465474664746747468474694747047471474724747347474474754747647477474784747947480474814748247483474844748547486474874748847489474904749147492474934749447495474964749747498474994750047501475024750347504475054750647507475084750947510475114751247513475144751547516475174751847519475204752147522475234752447525475264752747528475294753047531475324753347534475354753647537475384753947540475414754247543475444754547546475474754847549475504755147552475534755447555475564755747558475594756047561475624756347564475654756647567475684756947570475714757247573475744757547576475774757847579475804758147582475834758447585475864758747588475894759047591475924759347594475954759647597475984759947600476014760247603476044760547606476074760847609476104761147612476134761447615476164761747618476194762047621476224762347624476254762647627476284762947630476314763247633476344763547636476374763847639476404764147642476434764447645476464764747648476494765047651476524765347654476554765647657476584765947660476614766247663476644766547666476674766847669476704767147672476734767447675476764767747678476794768047681476824768347684476854768647687476884768947690476914769247693476944769547696476974769847699477004770147702477034770447705477064770747708477094771047711477124771347714477154771647717477184771947720477214772247723477244772547726477274772847729477304773147732477334773447735477364773747738477394774047741477424774347744477454774647747477484774947750477514775247753477544775547756477574775847759477604776147762477634776447765477664776747768477694777047771477724777347774477754777647777477784777947780477814778247783477844778547786477874778847789477904779147792477934779447795477964779747798477994780047801478024780347804478054780647807478084780947810478114781247813478144781547816478174781847819478204782147822478234782447825478264782747828478294783047831478324783347834478354783647837478384783947840478414784247843478444784547846478474784847849478504785147852478534785447855478564785747858478594786047861478624786347864478654786647867478684786947870478714787247873478744787547876478774787847879478804788147882478834788447885478864788747888478894789047891478924789347894478954789647897478984789947900479014790247903479044790547906479074790847909479104791147912479134791447915479164791747918479194792047921479224792347924479254792647927479284792947930479314793247933479344793547936479374793847939479404794147942479434794447945479464794747948479494795047951479524795347954479554795647957479584795947960479614796247963479644796547966479674796847969479704797147972479734797447975479764797747978479794798047981479824798347984479854798647987479884798947990479914799247993479944799547996479974799847999480004800148002480034800448005480064800748008480094801048011480124801348014480154801648017480184801948020480214802248023480244802548026480274802848029480304803148032480334803448035480364803748038480394804048041480424804348044480454804648047480484804948050480514805248053480544805548056480574805848059480604806148062480634806448065480664806748068480694807048071480724807348074480754807648077480784807948080480814808248083480844808548086480874808848089480904809148092480934809448095480964809748098480994810048101481024810348104481054810648107481084810948110481114811248113481144811548116481174811848119481204812148122481234812448125481264812748128481294813048131481324813348134481354813648137481384813948140481414814248143481444814548146481474814848149481504815148152481534815448155481564815748158481594816048161481624816348164481654816648167481684816948170481714817248173481744817548176481774817848179481804818148182481834818448185481864818748188481894819048191481924819348194481954819648197481984819948200482014820248203482044820548206482074820848209482104821148212482134821448215482164821748218482194822048221482224822348224482254822648227482284822948230482314823248233482344823548236482374823848239482404824148242482434824448245482464824748248482494825048251482524825348254482554825648257482584825948260482614826248263482644826548266482674826848269482704827148272482734827448275482764827748278482794828048281482824828348284482854828648287482884828948290482914829248293482944829548296482974829848299483004830148302483034830448305483064830748308483094831048311483124831348314483154831648317483184831948320483214832248323483244832548326483274832848329483304833148332483334833448335483364833748338483394834048341483424834348344483454834648347483484834948350483514835248353483544835548356483574835848359483604836148362483634836448365483664836748368483694837048371483724837348374483754837648377483784837948380483814838248383483844838548386483874838848389483904839148392483934839448395483964839748398483994840048401484024840348404484054840648407484084840948410484114841248413484144841548416484174841848419484204842148422484234842448425484264842748428484294843048431484324843348434484354843648437484384843948440484414844248443484444844548446484474844848449484504845148452484534845448455484564845748458484594846048461484624846348464484654846648467484684846948470484714847248473484744847548476484774847848479484804848148482484834848448485484864848748488484894849048491484924849348494484954849648497484984849948500485014850248503485044850548506485074850848509485104851148512485134851448515485164851748518485194852048521485224852348524485254852648527485284852948530485314853248533485344853548536485374853848539485404854148542485434854448545485464854748548485494855048551485524855348554485554855648557485584855948560485614856248563485644856548566485674856848569485704857148572485734857448575485764857748578485794858048581485824858348584485854858648587485884858948590485914859248593485944859548596485974859848599486004860148602486034860448605486064860748608486094861048611486124861348614486154861648617486184861948620486214862248623486244862548626486274862848629486304863148632486334863448635486364863748638486394864048641486424864348644486454864648647486484864948650486514865248653486544865548656486574865848659486604866148662486634866448665486664866748668486694867048671486724867348674486754867648677486784867948680486814868248683486844868548686486874868848689486904869148692486934869448695486964869748698486994870048701487024870348704487054870648707487084870948710487114871248713487144871548716487174871848719487204872148722487234872448725487264872748728487294873048731487324873348734487354873648737487384873948740487414874248743487444874548746487474874848749487504875148752487534875448755487564875748758487594876048761487624876348764487654876648767487684876948770487714877248773487744877548776487774877848779487804878148782487834878448785487864878748788487894879048791487924879348794487954879648797487984879948800488014880248803488044880548806488074880848809488104881148812488134881448815488164881748818488194882048821488224882348824488254882648827488284882948830488314883248833488344883548836488374883848839488404884148842488434884448845488464884748848488494885048851488524885348854488554885648857488584885948860488614886248863488644886548866488674886848869488704887148872488734887448875488764887748878488794888048881488824888348884488854888648887488884888948890488914889248893488944889548896488974889848899489004890148902489034890448905489064890748908489094891048911489124891348914489154891648917489184891948920489214892248923489244892548926489274892848929489304893148932489334893448935489364893748938489394894048941489424894348944489454894648947489484894948950489514895248953489544895548956489574895848959489604896148962489634896448965489664896748968489694897048971489724897348974489754897648977489784897948980489814898248983489844898548986489874898848989489904899148992489934899448995489964899748998489994900049001490024900349004490054900649007490084900949010490114901249013490144901549016490174901849019490204902149022490234902449025490264902749028490294903049031490324903349034490354903649037490384903949040490414904249043490444904549046490474904849049490504905149052490534905449055490564905749058490594906049061490624906349064490654906649067490684906949070490714907249073490744907549076490774907849079490804908149082490834908449085490864908749088490894909049091490924909349094490954909649097490984909949100491014910249103491044910549106491074910849109491104911149112491134911449115491164911749118491194912049121491224912349124491254912649127491284912949130491314913249133491344913549136491374913849139491404914149142491434914449145491464914749148491494915049151491524915349154491554915649157491584915949160491614916249163491644916549166491674916849169491704917149172491734917449175491764917749178491794918049181491824918349184491854918649187491884918949190491914919249193491944919549196491974919849199492004920149202492034920449205492064920749208492094921049211492124921349214492154921649217492184921949220492214922249223492244922549226492274922849229492304923149232492334923449235492364923749238492394924049241492424924349244492454924649247492484924949250492514925249253492544925549256492574925849259492604926149262492634926449265492664926749268492694927049271492724927349274492754927649277492784927949280492814928249283492844928549286492874928849289492904929149292492934929449295492964929749298492994930049301493024930349304493054930649307493084930949310493114931249313493144931549316493174931849319493204932149322493234932449325493264932749328493294933049331493324933349334493354933649337493384933949340493414934249343493444934549346493474934849349493504935149352493534935449355493564935749358493594936049361493624936349364493654936649367493684936949370493714937249373493744937549376493774937849379493804938149382493834938449385493864938749388493894939049391493924939349394493954939649397493984939949400494014940249403494044940549406494074940849409494104941149412494134941449415494164941749418494194942049421494224942349424494254942649427494284942949430494314943249433494344943549436494374943849439494404944149442494434944449445494464944749448494494945049451494524945349454494554945649457494584945949460494614946249463494644946549466494674946849469494704947149472494734947449475494764947749478494794948049481494824948349484494854948649487494884948949490494914949249493494944949549496494974949849499495004950149502495034950449505495064950749508495094951049511495124951349514495154951649517495184951949520495214952249523495244952549526495274952849529495304953149532495334953449535495364953749538495394954049541495424954349544495454954649547495484954949550495514955249553495544955549556495574955849559495604956149562495634956449565495664956749568495694957049571495724957349574495754957649577495784957949580495814958249583495844958549586495874958849589495904959149592495934959449595495964959749598495994960049601496024960349604496054960649607496084960949610496114961249613496144961549616496174961849619496204962149622496234962449625496264962749628496294963049631496324963349634496354963649637496384963949640496414964249643496444964549646496474964849649496504965149652496534965449655496564965749658496594966049661496624966349664496654966649667496684966949670496714967249673496744967549676496774967849679496804968149682496834968449685496864968749688496894969049691496924969349694496954969649697496984969949700497014970249703497044970549706497074970849709497104971149712497134971449715497164971749718497194972049721497224972349724497254972649727497284972949730497314973249733497344973549736497374973849739497404974149742497434974449745497464974749748497494975049751497524975349754497554975649757497584975949760497614976249763497644976549766497674976849769497704977149772497734977449775497764977749778497794978049781497824978349784497854978649787497884978949790497914979249793497944979549796497974979849799498004980149802498034980449805498064980749808498094981049811498124981349814498154981649817498184981949820498214982249823498244982549826498274982849829498304983149832498334983449835498364983749838498394984049841498424984349844498454984649847498484984949850498514985249853498544985549856498574985849859498604986149862498634986449865498664986749868498694987049871498724987349874498754987649877498784987949880498814988249883498844988549886498874988849889498904989149892498934989449895498964989749898498994990049901499024990349904499054990649907499084990949910499114991249913499144991549916499174991849919499204992149922499234992449925499264992749928499294993049931499324993349934499354993649937499384993949940499414994249943499444994549946499474994849949499504995149952499534995449955499564995749958499594996049961499624996349964499654996649967499684996949970499714997249973499744997549976499774997849979499804998149982499834998449985499864998749988499894999049991499924999349994499954999649997499984999950000500015000250003500045000550006500075000850009500105001150012500135001450015500165001750018500195002050021500225002350024500255002650027500285002950030500315003250033500345003550036500375003850039500405004150042500435004450045500465004750048500495005050051500525005350054500555005650057500585005950060500615006250063500645006550066500675006850069500705007150072500735007450075500765007750078500795008050081500825008350084500855008650087500885008950090500915009250093500945009550096500975009850099501005010150102501035010450105501065010750108501095011050111501125011350114501155011650117501185011950120501215012250123501245012550126501275012850129501305013150132501335013450135501365013750138501395014050141501425014350144501455014650147501485014950150501515015250153501545015550156501575015850159501605016150162501635016450165501665016750168501695017050171501725017350174501755017650177501785017950180501815018250183501845018550186501875018850189501905019150192501935019450195501965019750198501995020050201502025020350204502055020650207502085020950210502115021250213502145021550216502175021850219502205022150222502235022450225502265022750228502295023050231502325023350234502355023650237502385023950240502415024250243502445024550246502475024850249502505025150252502535025450255502565025750258502595026050261502625026350264502655026650267502685026950270502715027250273502745027550276502775027850279502805028150282502835028450285502865028750288502895029050291502925029350294502955029650297502985029950300503015030250303503045030550306503075030850309503105031150312503135031450315503165031750318503195032050321503225032350324503255032650327503285032950330503315033250333503345033550336503375033850339503405034150342503435034450345503465034750348503495035050351503525035350354503555035650357503585035950360503615036250363503645036550366503675036850369503705037150372503735037450375503765037750378503795038050381503825038350384503855038650387503885038950390503915039250393503945039550396503975039850399504005040150402504035040450405504065040750408504095041050411504125041350414504155041650417504185041950420504215042250423504245042550426504275042850429504305043150432504335043450435504365043750438504395044050441504425044350444504455044650447504485044950450504515045250453504545045550456504575045850459504605046150462504635046450465504665046750468504695047050471504725047350474504755047650477504785047950480504815048250483504845048550486504875048850489504905049150492504935049450495504965049750498504995050050501505025050350504505055050650507505085050950510505115051250513505145051550516505175051850519505205052150522505235052450525505265052750528505295053050531505325053350534505355053650537505385053950540505415054250543505445054550546505475054850549505505055150552505535055450555505565055750558505595056050561505625056350564505655056650567505685056950570505715057250573505745057550576505775057850579505805058150582505835058450585505865058750588505895059050591505925059350594505955059650597505985059950600506015060250603506045060550606506075060850609506105061150612506135061450615506165061750618506195062050621506225062350624506255062650627506285062950630506315063250633506345063550636506375063850639506405064150642506435064450645506465064750648506495065050651506525065350654506555065650657506585065950660506615066250663506645066550666506675066850669506705067150672506735067450675506765067750678506795068050681506825068350684506855068650687506885068950690506915069250693506945069550696506975069850699507005070150702507035070450705507065070750708507095071050711507125071350714507155071650717507185071950720507215072250723507245072550726507275072850729507305073150732507335073450735507365073750738507395074050741507425074350744507455074650747507485074950750507515075250753507545075550756507575075850759507605076150762507635076450765507665076750768507695077050771507725077350774507755077650777507785077950780507815078250783507845078550786507875078850789507905079150792507935079450795507965079750798507995080050801508025080350804508055080650807508085080950810508115081250813508145081550816508175081850819508205082150822508235082450825508265082750828508295083050831508325083350834508355083650837508385083950840508415084250843508445084550846508475084850849508505085150852508535085450855508565085750858508595086050861508625086350864508655086650867508685086950870508715087250873508745087550876508775087850879508805088150882508835088450885508865088750888508895089050891508925089350894508955089650897508985089950900509015090250903509045090550906509075090850909509105091150912509135091450915509165091750918509195092050921509225092350924509255092650927509285092950930509315093250933509345093550936509375093850939509405094150942509435094450945509465094750948509495095050951509525095350954509555095650957509585095950960509615096250963509645096550966509675096850969509705097150972509735097450975509765097750978509795098050981509825098350984509855098650987509885098950990509915099250993509945099550996509975099850999510005100151002510035100451005510065100751008510095101051011510125101351014510155101651017510185101951020510215102251023510245102551026510275102851029510305103151032510335103451035510365103751038510395104051041510425104351044510455104651047510485104951050510515105251053510545105551056510575105851059510605106151062510635106451065510665106751068510695107051071510725107351074510755107651077510785107951080510815108251083510845108551086510875108851089510905109151092510935109451095510965109751098510995110051101511025110351104511055110651107511085110951110511115111251113511145111551116511175111851119511205112151122511235112451125511265112751128511295113051131511325113351134511355113651137511385113951140511415114251143511445114551146511475114851149511505115151152511535115451155511565115751158511595116051161511625116351164511655116651167511685116951170511715117251173511745117551176511775117851179511805118151182511835118451185511865118751188511895119051191511925119351194511955119651197511985119951200512015120251203512045120551206512075120851209512105121151212512135121451215512165121751218512195122051221512225122351224512255122651227512285122951230512315123251233512345123551236512375123851239512405124151242512435124451245512465124751248512495125051251512525125351254512555125651257512585125951260512615126251263512645126551266512675126851269512705127151272512735127451275512765127751278512795128051281512825128351284512855128651287512885128951290512915129251293512945129551296512975129851299513005130151302513035130451305513065130751308513095131051311513125131351314513155131651317513185131951320513215132251323513245132551326513275132851329513305133151332513335133451335513365133751338513395134051341513425134351344513455134651347513485134951350513515135251353513545135551356513575135851359513605136151362513635136451365513665136751368513695137051371513725137351374513755137651377513785137951380513815138251383513845138551386513875138851389513905139151392513935139451395513965139751398513995140051401514025140351404514055140651407514085140951410514115141251413514145141551416514175141851419514205142151422514235142451425514265142751428514295143051431514325143351434514355143651437514385143951440514415144251443514445144551446514475144851449514505145151452514535145451455514565145751458514595146051461514625146351464514655146651467514685146951470514715147251473514745147551476514775147851479514805148151482514835148451485514865148751488514895149051491514925149351494514955149651497514985149951500515015150251503515045150551506515075150851509515105151151512515135151451515515165151751518515195152051521515225152351524515255152651527515285152951530515315153251533515345153551536515375153851539515405154151542515435154451545515465154751548515495155051551515525155351554515555155651557515585155951560515615156251563515645156551566515675156851569515705157151572515735157451575515765157751578515795158051581515825158351584515855158651587515885158951590515915159251593515945159551596515975159851599516005160151602516035160451605516065160751608516095161051611516125161351614516155161651617516185161951620516215162251623516245162551626516275162851629516305163151632516335163451635516365163751638516395164051641516425164351644516455164651647516485164951650516515165251653516545165551656516575165851659516605166151662516635166451665516665166751668516695167051671516725167351674516755167651677516785167951680516815168251683516845168551686516875168851689516905169151692516935169451695516965169751698516995170051701517025170351704517055170651707517085170951710517115171251713517145171551716517175171851719517205172151722517235172451725517265172751728517295173051731517325173351734517355173651737517385173951740517415174251743517445174551746517475174851749517505175151752517535175451755517565175751758517595176051761517625176351764517655176651767517685176951770517715177251773517745177551776517775177851779517805178151782517835178451785517865178751788517895179051791517925179351794517955179651797517985179951800518015180251803518045180551806518075180851809518105181151812518135181451815518165181751818518195182051821518225182351824518255182651827518285182951830518315183251833518345183551836518375183851839518405184151842518435184451845518465184751848518495185051851518525185351854518555185651857518585185951860518615186251863518645186551866518675186851869518705187151872518735187451875518765187751878518795188051881518825188351884518855188651887518885188951890518915189251893518945189551896518975189851899519005190151902519035190451905519065190751908519095191051911519125191351914519155191651917519185191951920519215192251923519245192551926519275192851929519305193151932519335193451935519365193751938519395194051941519425194351944519455194651947519485194951950519515195251953519545195551956519575195851959519605196151962519635196451965519665196751968519695197051971519725197351974519755197651977519785197951980519815198251983519845198551986519875198851989519905199151992519935199451995519965199751998519995200052001520025200352004520055200652007520085200952010520115201252013520145201552016520175201852019520205202152022520235202452025520265202752028520295203052031520325203352034520355203652037520385203952040520415204252043520445204552046520475204852049520505205152052520535205452055520565205752058520595206052061520625206352064520655206652067520685206952070520715207252073520745207552076520775207852079520805208152082520835208452085520865208752088520895209052091520925209352094520955209652097520985209952100521015210252103521045210552106521075210852109521105211152112521135211452115521165211752118521195212052121521225212352124521255212652127521285212952130521315213252133521345213552136521375213852139521405214152142521435214452145521465214752148521495215052151521525215352154521555215652157521585215952160521615216252163521645216552166521675216852169521705217152172521735217452175521765217752178521795218052181521825218352184521855218652187521885218952190521915219252193521945219552196521975219852199522005220152202522035220452205522065220752208522095221052211522125221352214522155221652217522185221952220522215222252223522245222552226522275222852229522305223152232522335223452235522365223752238522395224052241522425224352244522455224652247522485224952250522515225252253522545225552256522575225852259522605226152262522635226452265522665226752268522695227052271522725227352274522755227652277522785227952280522815228252283522845228552286522875228852289522905229152292522935229452295522965229752298522995230052301523025230352304523055230652307523085230952310523115231252313523145231552316523175231852319523205232152322523235232452325523265232752328523295233052331523325233352334523355233652337523385233952340523415234252343523445234552346523475234852349523505235152352523535235452355523565235752358523595236052361523625236352364523655236652367523685236952370523715237252373523745237552376523775237852379523805238152382523835238452385523865238752388523895239052391523925239352394523955239652397523985239952400524015240252403524045240552406524075240852409524105241152412524135241452415524165241752418524195242052421524225242352424524255242652427524285242952430524315243252433524345243552436524375243852439524405244152442524435244452445524465244752448524495245052451524525245352454524555245652457524585245952460524615246252463524645246552466524675246852469524705247152472524735247452475524765247752478524795248052481524825248352484524855248652487524885248952490524915249252493524945249552496524975249852499525005250152502525035250452505525065250752508525095251052511525125251352514525155251652517525185251952520525215252252523525245252552526525275252852529525305253152532525335253452535525365253752538525395254052541525425254352544525455254652547525485254952550525515255252553525545255552556525575255852559525605256152562525635256452565525665256752568525695257052571525725257352574525755257652577525785257952580525815258252583525845258552586525875258852589525905259152592525935259452595525965259752598525995260052601526025260352604526055260652607526085260952610526115261252613526145261552616526175261852619526205262152622526235262452625526265262752628526295263052631526325263352634526355263652637526385263952640526415264252643526445264552646526475264852649526505265152652526535265452655526565265752658526595266052661526625266352664526655266652667526685266952670526715267252673526745267552676526775267852679526805268152682526835268452685526865268752688526895269052691526925269352694526955269652697526985269952700527015270252703527045270552706527075270852709527105271152712527135271452715527165271752718527195272052721527225272352724527255272652727527285272952730527315273252733527345273552736527375273852739527405274152742527435274452745527465274752748527495275052751527525275352754527555275652757527585275952760527615276252763527645276552766527675276852769527705277152772527735277452775527765277752778527795278052781527825278352784527855278652787527885278952790527915279252793527945279552796527975279852799528005280152802528035280452805528065280752808528095281052811528125281352814528155281652817528185281952820528215282252823528245282552826528275282852829528305283152832528335283452835528365283752838528395284052841528425284352844528455284652847528485284952850528515285252853528545285552856528575285852859528605286152862528635286452865528665286752868528695287052871528725287352874528755287652877528785287952880528815288252883528845288552886528875288852889528905289152892528935289452895528965289752898528995290052901529025290352904529055290652907529085290952910529115291252913529145291552916529175291852919529205292152922529235292452925529265292752928529295293052931529325293352934529355293652937529385293952940529415294252943529445294552946529475294852949529505295152952529535295452955529565295752958529595296052961529625296352964529655296652967529685296952970529715297252973529745297552976529775297852979529805298152982529835298452985529865298752988529895299052991529925299352994529955299652997529985299953000530015300253003530045300553006530075300853009530105301153012530135301453015530165301753018530195302053021530225302353024530255302653027530285302953030530315303253033530345303553036530375303853039530405304153042530435304453045530465304753048530495305053051530525305353054530555305653057530585305953060530615306253063530645306553066530675306853069530705307153072530735307453075530765307753078530795308053081530825308353084530855308653087530885308953090530915309253093530945309553096530975309853099531005310153102531035310453105531065310753108531095311053111531125311353114531155311653117531185311953120531215312253123531245312553126531275312853129531305313153132531335313453135531365313753138531395314053141531425314353144531455314653147531485314953150531515315253153531545315553156531575315853159531605316153162531635316453165531665316753168531695317053171531725317353174531755317653177531785317953180531815318253183531845318553186531875318853189531905319153192531935319453195531965319753198531995320053201532025320353204532055320653207532085320953210532115321253213532145321553216532175321853219532205322153222532235322453225532265322753228532295323053231532325323353234532355323653237532385323953240532415324253243532445324553246532475324853249532505325153252532535325453255532565325753258532595326053261532625326353264532655326653267532685326953270532715327253273532745327553276532775327853279532805328153282532835328453285532865328753288532895329053291532925329353294532955329653297532985329953300533015330253303533045330553306533075330853309533105331153312533135331453315533165331753318533195332053321533225332353324533255332653327533285332953330533315333253333533345333553336533375333853339533405334153342533435334453345533465334753348533495335053351533525335353354533555335653357533585335953360533615336253363533645336553366533675336853369533705337153372533735337453375533765337753378533795338053381533825338353384533855338653387533885338953390533915339253393533945339553396533975339853399534005340153402534035340453405534065340753408534095341053411534125341353414534155341653417534185341953420534215342253423534245342553426534275342853429534305343153432534335343453435534365343753438534395344053441534425344353444534455344653447534485344953450534515345253453534545345553456534575345853459534605346153462534635346453465534665346753468534695347053471534725347353474534755347653477534785347953480534815348253483534845348553486534875348853489534905349153492534935349453495534965349753498534995350053501535025350353504535055350653507535085350953510535115351253513535145351553516535175351853519535205352153522535235352453525535265352753528535295353053531535325353353534535355353653537535385353953540535415354253543535445354553546535475354853549535505355153552535535355453555535565355753558535595356053561535625356353564535655356653567535685356953570535715357253573535745357553576535775357853579535805358153582535835358453585535865358753588535895359053591535925359353594535955359653597535985359953600536015360253603536045360553606536075360853609536105361153612536135361453615536165361753618536195362053621536225362353624536255362653627536285362953630536315363253633536345363553636536375363853639536405364153642536435364453645536465364753648536495365053651536525365353654536555365653657536585365953660536615366253663536645366553666536675366853669536705367153672536735367453675536765367753678536795368053681536825368353684536855368653687536885368953690536915369253693536945369553696536975369853699537005370153702537035370453705537065370753708537095371053711537125371353714537155371653717537185371953720537215372253723537245372553726537275372853729537305373153732537335373453735537365373753738537395374053741537425374353744537455374653747537485374953750537515375253753537545375553756537575375853759537605376153762537635376453765537665376753768537695377053771537725377353774537755377653777537785377953780537815378253783537845378553786537875378853789537905379153792537935379453795537965379753798537995380053801538025380353804538055380653807538085380953810538115381253813538145381553816538175381853819538205382153822538235382453825538265382753828538295383053831538325383353834538355383653837538385383953840538415384253843538445384553846538475384853849538505385153852538535385453855538565385753858538595386053861538625386353864538655386653867538685386953870538715387253873538745387553876538775387853879538805388153882538835388453885538865388753888538895389053891538925389353894538955389653897538985389953900539015390253903539045390553906539075390853909539105391153912539135391453915539165391753918539195392053921539225392353924539255392653927539285392953930539315393253933539345393553936539375393853939539405394153942539435394453945539465394753948539495395053951539525395353954539555395653957539585395953960539615396253963539645396553966539675396853969539705397153972539735397453975539765397753978539795398053981539825398353984539855398653987539885398953990539915399253993539945399553996539975399853999540005400154002540035400454005540065400754008540095401054011540125401354014540155401654017540185401954020540215402254023540245402554026540275402854029540305403154032540335403454035540365403754038540395404054041540425404354044540455404654047540485404954050540515405254053540545405554056540575405854059540605406154062540635406454065540665406754068540695407054071540725407354074540755407654077540785407954080540815408254083540845408554086540875408854089540905409154092540935409454095540965409754098540995410054101541025410354104541055410654107541085410954110541115411254113541145411554116541175411854119541205412154122541235412454125541265412754128541295413054131541325413354134541355413654137541385413954140541415414254143541445414554146541475414854149541505415154152541535415454155541565415754158541595416054161541625416354164541655416654167541685416954170541715417254173541745417554176541775417854179541805418154182541835418454185541865418754188541895419054191541925419354194541955419654197541985419954200542015420254203542045420554206542075420854209542105421154212542135421454215542165421754218542195422054221542225422354224542255422654227542285422954230542315423254233542345423554236542375423854239542405424154242542435424454245542465424754248542495425054251542525425354254542555425654257542585425954260542615426254263542645426554266542675426854269542705427154272542735427454275542765427754278542795428054281542825428354284542855428654287542885428954290542915429254293542945429554296542975429854299543005430154302543035430454305543065430754308543095431054311543125431354314543155431654317543185431954320543215432254323543245432554326543275432854329543305433154332543335433454335543365433754338543395434054341543425434354344543455434654347543485434954350543515435254353543545435554356543575435854359543605436154362543635436454365543665436754368543695437054371543725437354374543755437654377543785437954380543815438254383543845438554386543875438854389543905439154392543935439454395543965439754398543995440054401544025440354404544055440654407544085440954410544115441254413544145441554416544175441854419544205442154422544235442454425544265442754428544295443054431544325443354434544355443654437544385443954440544415444254443544445444554446544475444854449544505445154452544535445454455544565445754458544595446054461544625446354464544655446654467544685446954470544715447254473544745447554476544775447854479544805448154482544835448454485544865448754488544895449054491544925449354494544955449654497544985449954500545015450254503545045450554506545075450854509545105451154512545135451454515545165451754518545195452054521545225452354524545255452654527545285452954530545315453254533545345453554536545375453854539545405454154542545435454454545545465454754548545495455054551545525455354554545555455654557545585455954560545615456254563545645456554566545675456854569545705457154572545735457454575545765457754578545795458054581545825458354584545855458654587545885458954590545915459254593545945459554596545975459854599546005460154602546035460454605546065460754608546095461054611546125461354614546155461654617546185461954620546215462254623546245462554626546275462854629546305463154632546335463454635546365463754638546395464054641546425464354644546455464654647546485464954650546515465254653546545465554656546575465854659546605466154662546635466454665546665466754668546695467054671546725467354674546755467654677546785467954680546815468254683546845468554686546875468854689546905469154692546935469454695546965469754698546995470054701547025470354704547055470654707547085470954710547115471254713547145471554716547175471854719547205472154722547235472454725547265472754728547295473054731547325473354734547355473654737547385473954740547415474254743547445474554746547475474854749547505475154752547535475454755547565475754758547595476054761547625476354764547655476654767547685476954770547715477254773547745477554776547775477854779547805478154782547835478454785547865478754788547895479054791547925479354794547955479654797547985479954800548015480254803548045480554806548075480854809548105481154812548135481454815548165481754818548195482054821548225482354824548255482654827548285482954830548315483254833548345483554836548375483854839548405484154842548435484454845548465484754848548495485054851548525485354854548555485654857548585485954860548615486254863548645486554866548675486854869548705487154872548735487454875548765487754878548795488054881548825488354884548855488654887548885488954890548915489254893548945489554896548975489854899549005490154902549035490454905549065490754908549095491054911549125491354914549155491654917549185491954920549215492254923549245492554926549275492854929549305493154932549335493454935549365493754938549395494054941549425494354944549455494654947549485494954950549515495254953549545495554956549575495854959549605496154962549635496454965549665496754968549695497054971549725497354974549755497654977549785497954980549815498254983549845498554986549875498854989549905499154992549935499454995549965499754998549995500055001550025500355004550055500655007550085500955010550115501255013550145501555016550175501855019550205502155022550235502455025550265502755028550295503055031550325503355034550355503655037550385503955040550415504255043550445504555046550475504855049550505505155052550535505455055550565505755058550595506055061550625506355064550655506655067550685506955070550715507255073550745507555076550775507855079550805508155082550835508455085550865508755088550895509055091550925509355094550955509655097550985509955100551015510255103551045510555106551075510855109551105511155112551135511455115551165511755118551195512055121551225512355124551255512655127551285512955130551315513255133551345513555136551375513855139551405514155142551435514455145551465514755148551495515055151551525515355154551555515655157551585515955160551615516255163551645516555166551675516855169551705517155172551735517455175551765517755178551795518055181551825518355184551855518655187551885518955190551915519255193551945519555196551975519855199552005520155202552035520455205552065520755208552095521055211552125521355214552155521655217552185521955220552215522255223552245522555226552275522855229552305523155232552335523455235552365523755238552395524055241552425524355244552455524655247552485524955250552515525255253552545525555256552575525855259552605526155262552635526455265552665526755268552695527055271552725527355274552755527655277552785527955280552815528255283552845528555286552875528855289552905529155292552935529455295552965529755298552995530055301553025530355304553055530655307553085530955310553115531255313553145531555316553175531855319553205532155322553235532455325553265532755328553295533055331553325533355334553355533655337553385533955340553415534255343553445534555346553475534855349553505535155352553535535455355553565535755358553595536055361553625536355364553655536655367553685536955370553715537255373553745537555376553775537855379553805538155382553835538455385553865538755388553895539055391553925539355394553955539655397553985539955400554015540255403554045540555406554075540855409554105541155412554135541455415554165541755418554195542055421554225542355424554255542655427554285542955430554315543255433554345543555436554375543855439554405544155442554435544455445554465544755448554495545055451554525545355454554555545655457554585545955460554615546255463554645546555466554675546855469554705547155472554735547455475554765547755478554795548055481554825548355484554855548655487554885548955490554915549255493554945549555496554975549855499555005550155502555035550455505555065550755508555095551055511555125551355514555155551655517555185551955520555215552255523555245552555526555275552855529555305553155532555335553455535555365553755538555395554055541555425554355544555455554655547555485554955550555515555255553555545555555556555575555855559555605556155562555635556455565555665556755568555695557055571555725557355574555755557655577555785557955580555815558255583555845558555586555875558855589555905559155592555935559455595555965559755598555995560055601556025560355604556055560655607556085560955610556115561255613556145561555616556175561855619556205562155622556235562455625556265562755628556295563055631556325563355634556355563655637556385563955640556415564255643556445564555646556475564855649556505565155652556535565455655556565565755658556595566055661556625566355664556655566655667556685566955670556715567255673556745567555676556775567855679556805568155682556835568455685556865568755688556895569055691556925569355694556955569655697556985569955700557015570255703557045570555706557075570855709557105571155712557135571455715557165571755718557195572055721557225572355724557255572655727557285572955730557315573255733557345573555736557375573855739557405574155742557435574455745557465574755748557495575055751557525575355754557555575655757557585575955760557615576255763557645576555766557675576855769557705577155772557735577455775557765577755778557795578055781557825578355784557855578655787557885578955790557915579255793557945579555796557975579855799558005580155802558035580455805558065580755808558095581055811558125581355814558155581655817558185581955820558215582255823558245582555826558275582855829558305583155832558335583455835558365583755838558395584055841558425584355844558455584655847558485584955850558515585255853558545585555856558575585855859558605586155862558635586455865558665586755868558695587055871558725587355874558755587655877558785587955880558815588255883558845588555886558875588855889558905589155892558935589455895558965589755898558995590055901559025590355904559055590655907559085590955910559115591255913559145591555916559175591855919559205592155922559235592455925559265592755928559295593055931559325593355934559355593655937559385593955940559415594255943559445594555946559475594855949559505595155952559535595455955559565595755958559595596055961559625596355964559655596655967559685596955970559715597255973559745597555976559775597855979559805598155982559835598455985559865598755988559895599055991559925599355994559955599655997559985599956000560015600256003560045600556006560075600856009560105601156012560135601456015560165601756018560195602056021560225602356024560255602656027560285602956030560315603256033560345603556036560375603856039560405604156042560435604456045560465604756048560495605056051560525605356054560555605656057560585605956060560615606256063560645606556066560675606856069560705607156072560735607456075560765607756078560795608056081560825608356084560855608656087560885608956090560915609256093560945609556096560975609856099561005610156102561035610456105561065610756108561095611056111561125611356114561155611656117561185611956120561215612256123561245612556126561275612856129561305613156132561335613456135561365613756138561395614056141561425614356144561455614656147561485614956150561515615256153561545615556156561575615856159561605616156162561635616456165561665616756168561695617056171561725617356174561755617656177561785617956180561815618256183561845618556186561875618856189561905619156192561935619456195561965619756198561995620056201562025620356204562055620656207562085620956210562115621256213562145621556216562175621856219562205622156222562235622456225562265622756228562295623056231562325623356234562355623656237562385623956240562415624256243562445624556246562475624856249562505625156252562535625456255562565625756258562595626056261562625626356264562655626656267562685626956270562715627256273562745627556276562775627856279562805628156282562835628456285562865628756288562895629056291562925629356294562955629656297562985629956300563015630256303563045630556306563075630856309563105631156312563135631456315563165631756318563195632056321563225632356324563255632656327563285632956330563315633256333563345633556336563375633856339563405634156342563435634456345563465634756348563495635056351563525635356354563555635656357563585635956360563615636256363563645636556366563675636856369563705637156372563735637456375563765637756378563795638056381563825638356384563855638656387563885638956390563915639256393563945639556396563975639856399564005640156402564035640456405564065640756408564095641056411564125641356414564155641656417564185641956420564215642256423564245642556426564275642856429564305643156432564335643456435564365643756438564395644056441564425644356444564455644656447564485644956450564515645256453564545645556456564575645856459564605646156462564635646456465564665646756468564695647056471564725647356474564755647656477564785647956480564815648256483564845648556486564875648856489564905649156492564935649456495564965649756498564995650056501565025650356504565055650656507565085650956510565115651256513565145651556516565175651856519565205652156522565235652456525565265652756528565295653056531565325653356534565355653656537565385653956540565415654256543565445654556546565475654856549565505655156552565535655456555565565655756558565595656056561565625656356564565655656656567565685656956570565715657256573565745657556576565775657856579565805658156582565835658456585565865658756588565895659056591565925659356594565955659656597565985659956600566015660256603566045660556606566075660856609566105661156612566135661456615566165661756618566195662056621566225662356624566255662656627566285662956630566315663256633566345663556636566375663856639566405664156642566435664456645566465664756648566495665056651566525665356654566555665656657566585665956660566615666256663566645666556666566675666856669566705667156672566735667456675566765667756678566795668056681566825668356684566855668656687566885668956690566915669256693566945669556696566975669856699567005670156702567035670456705567065670756708567095671056711567125671356714567155671656717567185671956720567215672256723567245672556726567275672856729567305673156732567335673456735567365673756738567395674056741567425674356744567455674656747567485674956750567515675256753567545675556756567575675856759567605676156762567635676456765567665676756768567695677056771567725677356774567755677656777567785677956780567815678256783567845678556786567875678856789567905679156792567935679456795567965679756798567995680056801568025680356804568055680656807568085680956810568115681256813568145681556816568175681856819568205682156822568235682456825568265682756828568295683056831568325683356834568355683656837568385683956840568415684256843568445684556846568475684856849568505685156852568535685456855568565685756858568595686056861568625686356864568655686656867568685686956870568715687256873568745687556876568775687856879568805688156882568835688456885568865688756888568895689056891568925689356894568955689656897568985689956900569015690256903569045690556906569075690856909569105691156912569135691456915569165691756918569195692056921569225692356924569255692656927569285692956930569315693256933569345693556936569375693856939569405694156942569435694456945569465694756948569495695056951569525695356954569555695656957569585695956960569615696256963569645696556966569675696856969569705697156972569735697456975569765697756978569795698056981569825698356984569855698656987569885698956990569915699256993569945699556996569975699856999570005700157002570035700457005570065700757008570095701057011570125701357014570155701657017570185701957020570215702257023570245702557026570275702857029570305703157032570335703457035570365703757038570395704057041570425704357044570455704657047570485704957050570515705257053570545705557056570575705857059570605706157062570635706457065570665706757068570695707057071570725707357074570755707657077570785707957080570815708257083570845708557086570875708857089570905709157092570935709457095570965709757098570995710057101571025710357104571055710657107571085710957110571115711257113571145711557116571175711857119571205712157122571235712457125571265712757128571295713057131571325713357134571355713657137571385713957140571415714257143571445714557146571475714857149571505715157152571535715457155571565715757158571595716057161571625716357164571655716657167571685716957170571715717257173571745717557176571775717857179571805718157182571835718457185571865718757188571895719057191571925719357194571955719657197571985719957200572015720257203572045720557206572075720857209572105721157212572135721457215572165721757218572195722057221572225722357224572255722657227572285722957230572315723257233572345723557236572375723857239572405724157242572435724457245572465724757248572495725057251572525725357254572555725657257572585725957260572615726257263572645726557266572675726857269572705727157272572735727457275572765727757278572795728057281572825728357284572855728657287572885728957290572915729257293572945729557296572975729857299573005730157302573035730457305573065730757308573095731057311573125731357314573155731657317573185731957320573215732257323573245732557326573275732857329573305733157332573335733457335573365733757338573395734057341573425734357344573455734657347573485734957350573515735257353573545735557356573575735857359573605736157362573635736457365573665736757368573695737057371573725737357374573755737657377573785737957380573815738257383573845738557386573875738857389573905739157392573935739457395573965739757398573995740057401574025740357404574055740657407574085740957410574115741257413574145741557416574175741857419574205742157422574235742457425574265742757428574295743057431574325743357434574355743657437574385743957440574415744257443574445744557446574475744857449574505745157452574535745457455574565745757458574595746057461574625746357464574655746657467574685746957470574715747257473574745747557476574775747857479574805748157482574835748457485574865748757488574895749057491574925749357494574955749657497574985749957500575015750257503575045750557506575075750857509575105751157512575135751457515575165751757518575195752057521575225752357524575255752657527575285752957530575315753257533575345753557536575375753857539575405754157542575435754457545575465754757548575495755057551575525755357554575555755657557575585755957560575615756257563575645756557566575675756857569575705757157572575735757457575575765757757578575795758057581575825758357584575855758657587575885758957590575915759257593575945759557596575975759857599576005760157602576035760457605576065760757608576095761057611576125761357614576155761657617576185761957620576215762257623576245762557626576275762857629576305763157632576335763457635576365763757638576395764057641576425764357644576455764657647576485764957650576515765257653576545765557656576575765857659576605766157662576635766457665576665766757668576695767057671576725767357674576755767657677576785767957680576815768257683576845768557686576875768857689576905769157692576935769457695576965769757698576995770057701577025770357704577055770657707577085770957710577115771257713577145771557716577175771857719577205772157722577235772457725577265772757728577295773057731577325773357734577355773657737577385773957740577415774257743577445774557746577475774857749577505775157752577535775457755577565775757758577595776057761577625776357764577655776657767577685776957770577715777257773577745777557776577775777857779577805778157782577835778457785577865778757788577895779057791577925779357794577955779657797577985779957800578015780257803578045780557806578075780857809578105781157812578135781457815578165781757818578195782057821578225782357824578255782657827578285782957830578315783257833578345783557836578375783857839578405784157842578435784457845578465784757848578495785057851578525785357854578555785657857578585785957860578615786257863578645786557866578675786857869578705787157872578735787457875578765787757878578795788057881578825788357884578855788657887578885788957890578915789257893578945789557896578975789857899579005790157902579035790457905579065790757908579095791057911579125791357914579155791657917579185791957920579215792257923579245792557926579275792857929579305793157932579335793457935579365793757938579395794057941579425794357944579455794657947579485794957950579515795257953579545795557956579575795857959579605796157962579635796457965579665796757968579695797057971579725797357974579755797657977579785797957980579815798257983579845798557986579875798857989579905799157992579935799457995579965799757998579995800058001580025800358004580055800658007580085800958010580115801258013580145801558016580175801858019580205802158022580235802458025580265802758028580295803058031580325803358034580355803658037580385803958040580415804258043580445804558046580475804858049580505805158052580535805458055580565805758058580595806058061580625806358064580655806658067580685806958070580715807258073580745807558076580775807858079580805808158082580835808458085580865808758088580895809058091580925809358094580955809658097580985809958100581015810258103581045810558106581075810858109581105811158112581135811458115581165811758118581195812058121581225812358124581255812658127581285812958130581315813258133581345813558136581375813858139581405814158142581435814458145581465814758148581495815058151581525815358154581555815658157581585815958160581615816258163581645816558166581675816858169581705817158172581735817458175581765817758178581795818058181581825818358184581855818658187581885818958190581915819258193581945819558196581975819858199582005820158202582035820458205582065820758208582095821058211582125821358214582155821658217582185821958220582215822258223582245822558226582275822858229582305823158232582335823458235582365823758238582395824058241582425824358244582455824658247582485824958250582515825258253582545825558256582575825858259582605826158262582635826458265582665826758268582695827058271582725827358274582755827658277582785827958280582815828258283582845828558286582875828858289582905829158292582935829458295582965829758298582995830058301583025830358304583055830658307583085830958310583115831258313583145831558316583175831858319583205832158322583235832458325583265832758328583295833058331583325833358334
  1. /* 许钟文修改的 标记 xzw
  2. 另外 所有"matter"字样已被我删除 原因:删除matterport信息
  3. */
  4. !function() {
  5. "use strict";
  6. function t(t, i) {
  7. return typeof t === i
  8. }
  9. function i(t, i) {
  10. return t instanceof i
  11. }
  12. function n(t) {
  13. return t && t.nodeType
  14. }
  15. function e(t) {
  16. return n(t) ? t : i(t, g) ? t[0] : void 0
  17. }
  18. function o(t, i, n) {
  19. return g.each(t, function(t, e) {
  20. n = i.call(e, n, t, e)
  21. }),
  22. n
  23. }
  24. function r(t, i, n) {
  25. var e, o, r;
  26. if (t === i)
  27. return !0;
  28. if (!t || !i || t.constructor !== i.constructor)
  29. return !1;
  30. for (e = 0,
  31. o = n.length; o > e; e += 1) {
  32. if (r = n[e],
  33. t[r] && y(t[r].equals) && !t[r].equals(i[r]))
  34. return !1;
  35. if (t[r] !== i[r])
  36. return !1
  37. }
  38. return !0
  39. }
  40. function s(t, i, n, e) {
  41. this.left = E(t),
  42. this.top = E(i),
  43. this.width = E(n),
  44. this.height = E(e),
  45. this.right = this.left + this.width,
  46. this.bottom = this.top + this.height
  47. }
  48. function h(t, i, n, e) {
  49. this.visible = t || 0,
  50. this.viewport = i || 0,
  51. this.possible = n || 0,
  52. this.rects = e && T({}, e) || null
  53. }
  54. function l(t, i) {
  55. this.els = t,
  56. this.viewport = i
  57. }
  58. function c(t, i, n) {
  59. var e;
  60. return g.inArray(n, q) >= 0 ? e = s.ofElement(t) : g.inArray(n, S) >= 0 && (e = h.of(t, i)),
  61. e ? e[n] : 0
  62. }
  63. function u(t, i) {
  64. return t.val - i.val
  65. }
  66. function a(t, i) {
  67. return i.val - t.val
  68. }
  69. function f(t) {
  70. var i = s.ofContent(t, !0)
  71. , n = s.ofViewport(t, !0)
  72. , e = i.width - n.width
  73. , o = i.height - n.height;
  74. this.content = i,
  75. this.viewport = n,
  76. this.width = 0 >= e ? null : n.left / e,
  77. this.height = 0 >= o ? null : n.top / o,
  78. this.left = n.left,
  79. this.top = n.top,
  80. this.right = i.right - n.right,
  81. this.bottom = i.bottom - n.bottom
  82. }
  83. function p(t) {
  84. this.el = t || window
  85. }
  86. function d(t, i) {
  87. this.context = t,
  88. this.viewport = i,
  89. this.init()
  90. }
  91. function v(t, i, n, e) {
  92. this.context = new l(t,i),
  93. this.property = n,
  94. this.descending = e,
  95. this.init()
  96. }
  97. function w(t) {
  98. t && t !== window && t !== document ? (this.context = t,
  99. this.$autoTarget = g(t)) : this.context = window,
  100. this.init()
  101. }
  102. var g = jQuery
  103. , m = g(window)
  104. , b = g(document)
  105. , T = g.extend
  106. , y = g.isFunction
  107. , k = Math.max
  108. , V = Math.min
  109. , E = Math.round
  110. , x = function() {
  111. var t = {}
  112. , i = 1;
  113. return function(n) {
  114. return n ? (t[n] || (t[n] = i,
  115. i += 1),
  116. t[n]) : 0
  117. }
  118. }();
  119. T(s.prototype, {
  120. equals: function(t) {
  121. return r(this, t, ["left", "top", "width", "height"])
  122. },
  123. area: function() {
  124. return this.width * this.height
  125. },
  126. relativeTo: function(t) {
  127. return new s(this.left - t.left,this.top - t.top,this.width,this.height)
  128. },
  129. intersection: function(t) {
  130. if (!i(t, s))
  131. return null;
  132. var n = k(this.left, t.left)
  133. , e = V(this.right, t.right)
  134. , o = k(this.top, t.top)
  135. , r = V(this.bottom, t.bottom)
  136. , h = e - n
  137. , l = r - o;
  138. return h >= 0 && l >= 0 ? new s(n,o,h,l) : null
  139. },
  140. envelope: function(t) {
  141. if (!i(t, s))
  142. return this;
  143. var n = V(this.left, t.left)
  144. , e = k(this.right, t.right)
  145. , o = V(this.top, t.top)
  146. , r = k(this.bottom, t.bottom)
  147. , h = e - n
  148. , l = r - o;
  149. return new s(n,o,h,l)
  150. }
  151. }),
  152. T(s, {
  153. ofContent: function(t, i) {
  154. return t && t !== document && t !== window ? i ? new s(0,0,t.scrollWidth,t.scrollHeight) : new s(t.offsetLeft - t.scrollLeft,t.offsetTop - t.scrollTop,t.scrollWidth,t.scrollHeight) : new s(0,0,b.width(),b.height())
  155. },
  156. ofViewport: function(t, i) {
  157. return t && t !== document && t !== window ? i ? new s(t.scrollLeft,t.scrollTop,t.clientWidth,t.clientHeight) : new s(t.offsetLeft,t.offsetTop,t.clientWidth,t.clientHeight) : new s(m.scrollLeft(),m.scrollTop(),m.width(),m.height())
  158. },
  159. ofElement: function(t) {
  160. var i = g(t);
  161. if (!i.is(":visible"))
  162. return null;
  163. var n = i.offset();
  164. return new s(n.left,n.top,i.outerWidth(),i.outerHeight())
  165. }
  166. }),
  167. T(h.prototype, {
  168. equals: function(t) {
  169. return this.fracsEqual(t) && this.rectsEqual(t)
  170. },
  171. fracsEqual: function(t) {
  172. return r(this, t, ["visible", "viewport", "possible"])
  173. },
  174. rectsEqual: function(t) {
  175. return r(this.rects, t.rects, ["document", "element", "viewport"])
  176. }
  177. }),
  178. T(h, {
  179. of: function(t, i) {
  180. var e, o, r;
  181. return t = n(t) && s.ofElement(t) || t,
  182. i = n(i) && s.ofViewport(i) || i || s.ofViewport(),
  183. t instanceof s && (e = t.intersection(i)) ? (o = e.area(),
  184. r = V(t.width, i.width) * V(t.height, i.height),
  185. new h(o / t.area(),o / i.area(),o / r,{
  186. document: e,
  187. element: e.relativeTo(t),
  188. viewport: e.relativeTo(i)
  189. })) : new h
  190. }
  191. });
  192. var q = ["width", "height", "left", "right", "top", "bottom"]
  193. , S = ["possible", "visible", "viewport"];
  194. T(l.prototype, {
  195. sorted: function(t, i) {
  196. var n = this.viewport;
  197. return g.map(this.els, function(i) {
  198. return {
  199. el: i,
  200. val: c(i, n, t)
  201. }
  202. }).sort(i ? a : u)
  203. },
  204. best: function(t, i) {
  205. return this.els.length ? this.sorted(t, i)[0] : null
  206. }
  207. }),
  208. T(f.prototype, {
  209. equals: function(t) {
  210. return r(this, t, ["width", "height", "left", "top", "right", "bottom", "content", "viewport"])
  211. }
  212. }),
  213. T(p.prototype, {
  214. equals: function(t) {
  215. return r(this, t, ["el"])
  216. },
  217. scrollState: function() {
  218. return new f(this.el)
  219. },
  220. scrollTo: function(t, i, n) {
  221. var e = g(this.el === window ? "html,body" : this.el);
  222. t = t || 0,
  223. i = i || 0,
  224. n = isNaN(n) ? 1e3 : n,
  225. e.stop(!0).animate({
  226. scrollLeft: t,
  227. scrollTop: i
  228. }, n)
  229. },
  230. scroll: function(t, i, n) {
  231. var e = this.el === window ? m : g(this.el);
  232. t = t || 0,
  233. i = i || 0,
  234. this.scrollTo(e.scrollLeft() + t, e.scrollTop() + i, n)
  235. },
  236. scrollToRect: function(t, i, n, e) {
  237. i = i || 0,
  238. n = n || 0,
  239. this.scrollTo(t.left - i, t.top - n, e)
  240. },
  241. scrollToElement: function(t, i, n, e) {
  242. var o = s.ofElement(t).relativeTo(s.ofContent(this.el));
  243. this.scrollToRect(o, i, n, e)
  244. }
  245. });
  246. var C = {
  247. init: function() {
  248. this.callbacks = g.Callbacks("memory unique"),
  249. this.currVal = null,
  250. this.prevVal = null,
  251. this.checkProxy = g.proxy(this.check, this),
  252. this.autoCheck()
  253. },
  254. bind: function(t) {
  255. this.callbacks.add(t)
  256. },
  257. unbind: function(t) {
  258. t ? this.callbacks.remove(t) : this.callbacks.empty()
  259. },
  260. trigger: function() {
  261. this.callbacks.fireWith(this.context, [this.currVal, this.prevVal])
  262. },
  263. check: function(t) {
  264. var i = this.updatedValue(t);
  265. return void 0 !== i && (this.prevVal = this.currVal,
  266. this.currVal = i,
  267. this.trigger(),
  268. !0)
  269. },
  270. $autoTarget: m,
  271. autoEvents: "load resize scroll",
  272. autoCheck: function(t) {
  273. this.$autoTarget[t === !1 ? "off" : "on"](this.autoEvents, this.checkProxy)
  274. }
  275. };
  276. T(d.prototype, C, {
  277. updatedValue: function() {
  278. var t = h.of(this.context, this.viewport);
  279. return this.currVal && this.currVal.equals(t) ? void 0 : t
  280. }
  281. }),
  282. T(v.prototype, C, {
  283. updatedValue: function() {
  284. var t = this.context.best(this.property, this.descending);
  285. return t && (t = t.val > 0 ? t.el : null,
  286. this.currVal !== t) ? t : void 0
  287. }
  288. }),
  289. T(w.prototype, C, {
  290. updatedValue: function() {
  291. var t = new f(this.context);
  292. return this.currVal && this.currVal.equals(t) ? void 0 : t
  293. }
  294. });
  295. var L = function(t, i) {
  296. var n = [].slice
  297. , e = jQuery
  298. , o = e.extend
  299. , r = e.isFunction
  300. , s = o({}, i)
  301. , h = function(i, n, o, s) {
  302. return o = r(o) ? o.apply(i, n) : o,
  303. r(s[o]) ? s[o].apply(i, n) : void e.error('Method "' + o + '" does not exist on jQuery.' + t)
  304. }
  305. , l = function() {
  306. return h(this, n.call(arguments), s.defaultStatic, l)
  307. }
  308. , c = function(t) {
  309. return r(c[t]) ? c[t].apply(this, n.call(arguments, 1)) : h(this, n.call(arguments), s.defaultMethod, c)
  310. }
  311. , u = function(t) {
  312. t && (o(l, t.statics),
  313. o(c, t.methods)),
  314. l.modplug = u
  315. };
  316. u.prev = {
  317. statics: e[t],
  318. methods: e.fn[t]
  319. },
  320. u(i),
  321. e[t] = l,
  322. e.fn[t] = c
  323. }
  324. , M = "fracs";
  325. L(M, {
  326. statics: {
  327. version: "0.15.0",
  328. Rect: s,
  329. Fractions: h,
  330. Group: l,
  331. ScrollState: f,
  332. Viewport: p,
  333. FracsCallbacks: d,
  334. GroupCallbacks: v,
  335. ScrollStateCallbacks: w,
  336. fracs: function(t, i) {
  337. return h.of(t, i)
  338. }
  339. },
  340. methods: {
  341. content: function(t) {
  342. return this.length ? s.ofContent(this[0], t) : null
  343. },
  344. envelope: function() {
  345. return o(this, function(t) {
  346. var i = s.ofElement(this);
  347. return t ? t.envelope(i) : i
  348. })
  349. },
  350. fracs: function(i, n, o) {
  351. t(i, "string") || (o = n,
  352. n = i,
  353. i = null),
  354. y(n) || (o = n,
  355. n = null),
  356. o = e(o);
  357. var r = M + ".fracs." + x(o);
  358. return "unbind" === i ? this.each(function() {
  359. var t = g(this).data(r);
  360. t && t.unbind(n)
  361. }) : "check" === i ? this.each(function() {
  362. var t = g(this).data(r);
  363. t && t.check()
  364. }) : y(n) ? this.each(function() {
  365. var t = g(this)
  366. , i = t.data(r);
  367. i || (i = new d(this,o),
  368. t.data(r, i)),
  369. i.bind(n)
  370. }) : this.length ? h.of(this[0], o) : null
  371. },
  372. intersection: function() {
  373. return o(this, function(t) {
  374. var i = s.ofElement(this);
  375. return t ? t.intersection(i) : i
  376. })
  377. },
  378. max: function(t, i, n) {
  379. return y(i) || (n = i,
  380. i = null),
  381. n = e(n),
  382. i ? (new v(this,n,t,!0).bind(i),
  383. this) : this.pushStack(new l(this,n).best(t, !0).el)
  384. },
  385. min: function(t, i, n) {
  386. return y(i) || (n = i,
  387. i = null),
  388. n = e(n),
  389. i ? (new v(this,n,t).bind(i),
  390. this) : this.pushStack(new l(this,n).best(t).el)
  391. },
  392. rect: function() {
  393. return this.length ? s.ofElement(this[0]) : null
  394. },
  395. scrollState: function(i, n) {
  396. var e = M + ".scrollState";
  397. return t(i, "string") || (n = i,
  398. i = null),
  399. "unbind" === i ? this.each(function() {
  400. var t = g(this).data(e);
  401. t && t.unbind(n)
  402. }) : "check" === i ? this.each(function() {
  403. var t = g(this).data(e);
  404. t && t.check()
  405. }) : y(n) ? this.each(function() {
  406. var t = g(this)
  407. , i = t.data(e);
  408. i || (i = new w(this),
  409. t.data(e, i)),
  410. i.bind(n)
  411. }) : this.length ? new f(this[0]) : null
  412. },
  413. scroll: function(t, i, n) {
  414. return this.each(function() {
  415. new p(this).scroll(t, i, n)
  416. })
  417. },
  418. scrollTo: function(t, i, n, o) {
  419. return g.isNumeric(t) && (o = n,
  420. n = i,
  421. i = t,
  422. t = null),
  423. t = e(t),
  424. this.each(function() {
  425. t ? new p(this).scrollToElement(t, i, n, o) : new p(this).scrollTo(i, n, o)
  426. })
  427. },
  428. scrollToThis: function(t, i, n, o) {
  429. return o = new p(e(o)),
  430. o.scrollToElement(this[0], t, i, n),
  431. this
  432. },
  433. softLink: function(t, i, n, o) {
  434. return o = new p(e(o)),
  435. this.filter("a[href^=#]").each(function() {
  436. var e = g(this);
  437. e.on("click", function() {
  438. o.scrollToElement(g(e.attr("href"))[0], t, i, n)
  439. })
  440. })
  441. },
  442. sort: function(i, n, o) {
  443. return t(n, "boolean") || (o = n,
  444. n = null),
  445. o = e(o),
  446. this.pushStack(g.map(new l(this,o).sorted(i, !n), function(t) {
  447. return t.el
  448. }))
  449. },
  450. viewport: function(t) {
  451. return this.length ? s.ofViewport(this[0], t) : null
  452. }
  453. },
  454. defaultStatic: "fracs",
  455. defaultMethod: "fracs"
  456. })
  457. }();
  458. if ("undefined" == typeof jQuery)
  459. throw new Error("Bootstrap's JavaScript requires jQuery");
  460. +function(t) {
  461. "use strict";
  462. function e(e) {
  463. return this.each(function() {
  464. var o = t(this)
  465. , s = o.data("bs.tooltip")
  466. , n = "object" == typeof e && e;
  467. (s || "destroy" != e) && (s || o.data("bs.tooltip", s = new i(this,n)),
  468. "string" == typeof e && s[e]())
  469. })
  470. }
  471. var i = function(t, e) {
  472. this.type = this.options = this.enabled = this.timeout = this.hoverState = this.$element = null,
  473. this.init("tooltip", t, e)
  474. };
  475. i.VERSION = "3.2.0",
  476. i.DEFAULTS = {
  477. animation: !0,
  478. placement: "top",
  479. selector: !1,
  480. template: '<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',
  481. trigger: "hover focus",
  482. title: "",
  483. delay: 0,
  484. html: !1,
  485. container: !1,
  486. viewport: {
  487. selector: "body",
  488. padding: 0
  489. }
  490. },
  491. i.prototype.init = function(e, i, o) {
  492. this.enabled = !0,
  493. this.type = e,
  494. this.$element = t(i),
  495. this.options = this.getOptions(o),
  496. this.$viewport = this.options.viewport && t(this.options.viewport.selector || this.options.viewport);
  497. for (var s = this.options.trigger.split(" "), n = s.length; n--; ) {
  498. var r = s[n];
  499. if ("click" == r)
  500. this.$element.on("click." + this.type, this.options.selector, t.proxy(this.toggle, this));
  501. else if ("manual" != r) {
  502. var a = "hover" == r ? "mouseenter" : "focusin"
  503. , l = "hover" == r ? "mouseleave" : "focusout";
  504. this.$element.on(a + "." + this.type, this.options.selector, t.proxy(this.enter, this)),
  505. this.$element.on(l + "." + this.type, this.options.selector, t.proxy(this.leave, this))
  506. }
  507. }
  508. this.options.selector ? this._options = t.extend({}, this.options, {
  509. trigger: "manual",
  510. selector: ""
  511. }) : this.fixTitle()
  512. }
  513. ,
  514. i.prototype.getDefaults = function() {
  515. return i.DEFAULTS
  516. }
  517. ,
  518. i.prototype.getOptions = function(e) {
  519. return e = t.extend({}, this.getDefaults(), this.$element.data(), e),
  520. e.delay && "number" == typeof e.delay && (e.delay = {
  521. show: e.delay,
  522. hide: e.delay
  523. }),
  524. e
  525. }
  526. ,
  527. i.prototype.getDelegateOptions = function() {
  528. var e = {}
  529. , i = this.getDefaults();
  530. return this._options && t.each(this._options, function(t, o) {
  531. i[t] != o && (e[t] = o)
  532. }),
  533. e
  534. }
  535. ,
  536. i.prototype.enter = function(e) {
  537. var i = e instanceof this.constructor ? e : t(e.currentTarget).data("bs." + this.type);
  538. return i || (i = new this.constructor(e.currentTarget,this.getDelegateOptions()),
  539. t(e.currentTarget).data("bs." + this.type, i)),
  540. clearTimeout(i.timeout),
  541. i.hoverState = "in",
  542. i.options.delay && i.options.delay.show ? void (i.timeout = setTimeout(function() {
  543. // "in" == i.hoverState && i.show()
  544. }, i.options.delay.show)) : i.show()
  545. }
  546. ,
  547. i.prototype.leave = function(e) {
  548. var i = e instanceof this.constructor ? e : t(e.currentTarget).data("bs." + this.type);
  549. return i || (i = new this.constructor(e.currentTarget,this.getDelegateOptions()),
  550. t(e.currentTarget).data("bs." + this.type, i)),
  551. clearTimeout(i.timeout),
  552. i.hoverState = "out",
  553. i.options.delay && i.options.delay.hide ? void (i.timeout = setTimeout(function() {
  554. "out" == i.hoverState && i.hide()
  555. }, i.options.delay.hide)) : i.hide()
  556. }
  557. ,
  558. i.prototype.show = function() {
  559. var e = t.Event("show.bs." + this.type);
  560. if (this.hasContent() && this.enabled) {
  561. this.$element.trigger(e);
  562. var i = t.contains(document.documentElement, this.$element[0]);
  563. if (e.isDefaultPrevented() || !i)
  564. return;
  565. var o = this
  566. , s = this.tip()
  567. , n = this.getUID(this.type);
  568. this.setContent(),
  569. s.attr("id", n),
  570. this.$element.attr("aria-describedby", n),
  571. this.options.animation && s.addClass("fade");
  572. var r = "function" == typeof this.options.placement ? this.options.placement.call(this, s[0], this.$element[0]) : this.options.placement
  573. , a = /\s?auto?\s?/i
  574. , l = a.test(r);
  575. l && (r = r.replace(a, "") || "top"),
  576. s.detach().css({
  577. top: 0,
  578. left: 0,
  579. display: "block"
  580. }).addClass(r).data("bs." + this.type, this),
  581. this.options.container ? s.appendTo(this.options.container) : s.insertAfter(this.$element);
  582. var p = this.getPosition()
  583. , h = s[0].offsetWidth
  584. , f = s[0].offsetHeight;
  585. if (l) {
  586. var u = r
  587. , c = this.$element.parent()
  588. , d = this.getPosition(c);
  589. r = "bottom" == r && p.top + p.height + f - d.scroll > d.height ? "top" : "top" == r && p.top - d.scroll - f < 0 ? "bottom" : "right" == r && p.right + h > d.width ? "left" : "left" == r && p.left - h < d.left ? "right" : r,
  590. s.removeClass(u).addClass(r)
  591. }
  592. var g = this.getCalculatedOffset(r, p, h, f);
  593. this.applyPlacement(g, r);
  594. var y = function() {
  595. o.$element.trigger("shown.bs." + o.type),
  596. o.hoverState = null
  597. };
  598. t.support.transition && this.$tip.hasClass("fade") ? s.one("bsTransitionEnd", y).emulateTransitionEnd(150) : y()
  599. }
  600. }
  601. ,
  602. i.prototype.applyPlacement = function(e, i) {
  603. var o = this.tip()
  604. , s = o[0].offsetWidth
  605. , n = o[0].offsetHeight
  606. , r = parseInt(o.css("margin-top"), 10)
  607. , a = parseInt(o.css("margin-left"), 10);
  608. isNaN(r) && (r = 0),
  609. isNaN(a) && (a = 0),
  610. e.top = e.top + r,
  611. e.left = e.left + a,
  612. t.offset.setOffset(o[0], t.extend({
  613. using: function(t) {
  614. o.css({
  615. top: Math.round(t.top),
  616. left: Math.round(t.left)
  617. })
  618. }
  619. }, e), 0),
  620. o.addClass("in");
  621. var l = o[0].offsetWidth
  622. , p = o[0].offsetHeight;
  623. "top" == i && p != n && (e.top = e.top + n - p);
  624. var h = this.getViewportAdjustedDelta(i, e, l, p);
  625. h.left ? e.left += h.left : e.top += h.top;
  626. var f = h.left ? 2 * h.left - s + l : 2 * h.top - n + p
  627. , u = h.left ? "left" : "top"
  628. , c = h.left ? "offsetWidth" : "offsetHeight";
  629. o.offset(e),
  630. this.replaceArrow(f, o[0][c], u)
  631. }
  632. ,
  633. i.prototype.replaceArrow = function(t, e, i) {
  634. this.arrow().css(i, t ? 50 * (1 - t / e) + "%" : "")
  635. }
  636. ,
  637. i.prototype.setContent = function() {
  638. var t = this.tip()
  639. , e = this.getTitle();
  640. t.find(".tooltip-inner")[this.options.html ? "html" : "text"](e),
  641. t.removeClass("fade in top bottom left right")
  642. }
  643. ,
  644. i.prototype.hide = function() {
  645. function e() {
  646. "in" != i.hoverState && o.detach(),
  647. i.$element.trigger("hidden.bs." + i.type)
  648. }
  649. var i = this
  650. , o = this.tip()
  651. , s = t.Event("hide.bs." + this.type);
  652. if (this.$element.removeAttr("aria-describedby"),
  653. this.$element.trigger(s),
  654. !s.isDefaultPrevented())
  655. return o.removeClass("in"),
  656. t.support.transition && this.$tip.hasClass("fade") ? o.one("bsTransitionEnd", e).emulateTransitionEnd(150) : e(),
  657. this.hoverState = null,
  658. this
  659. }
  660. ,
  661. i.prototype.fixTitle = function() {
  662. var t = this.$element;
  663. (t.attr("title") || "string" != typeof t.attr("data-original-title")) && t.attr("data-original-title", t.attr("title") || "").attr("title", "")
  664. }
  665. ,
  666. i.prototype.hasContent = function() {
  667. return this.getTitle()
  668. }
  669. ,
  670. i.prototype.getPosition = function(e) {
  671. e = e || this.$element;
  672. var i = e[0]
  673. , o = "BODY" == i.tagName;
  674. return t.extend({}, "function" == typeof i.getBoundingClientRect ? i.getBoundingClientRect() : null, {
  675. scroll: o ? document.documentElement.scrollTop || document.body.scrollTop : e.scrollTop(),
  676. width: o ? t(window).width() : e.outerWidth(),
  677. height: o ? t(window).height() : e.outerHeight()
  678. }, o ? {
  679. top: 0,
  680. left: 0
  681. } : e.offset())
  682. }
  683. ,
  684. i.prototype.getCalculatedOffset = function(t, e, i, o) {
  685. return "bottom" == t ? {
  686. top: e.top + e.height,
  687. left: e.left + e.width / 2 - i / 2
  688. } : "top" == t ? {
  689. top: e.top - o,
  690. left: e.left + e.width / 2 - i / 2
  691. } : "left" == t ? {
  692. top: e.top + e.height / 2 - o / 2,
  693. left: e.left - i
  694. } : {
  695. top: e.top + e.height / 2 - o / 2,
  696. left: e.left + e.width
  697. }
  698. }
  699. ,
  700. i.prototype.getViewportAdjustedDelta = function(t, e, i, o) {
  701. var s = {
  702. top: 0,
  703. left: 0
  704. };
  705. if (!this.$viewport)
  706. return s;
  707. var n = this.options.viewport && this.options.viewport.padding || 0
  708. , r = this.getPosition(this.$viewport);
  709. if (/right|left/.test(t)) {
  710. var a = e.top - n - r.scroll
  711. , l = e.top + n - r.scroll + o;
  712. a < r.top ? s.top = r.top - a : l > r.top + r.height && (s.top = r.top + r.height - l)
  713. } else {
  714. var p = e.left - n
  715. , h = e.left + n + i;
  716. p < r.left ? s.left = r.left - p : h > r.width && (s.left = r.left + r.width - h)
  717. }
  718. return s
  719. }
  720. ,
  721. i.prototype.getTitle = function() {
  722. var t, e = this.$element, i = this.options;
  723. return t = e.attr("data-original-title") || ("function" == typeof i.title ? i.title.call(e[0]) : i.title)
  724. }
  725. ,
  726. i.prototype.getUID = function(t) {
  727. do
  728. t += ~~(1e6 * Math.random());
  729. while (document.getElementById(t));return t
  730. }
  731. ,
  732. i.prototype.tip = function() {
  733. return this.$tip = this.$tip || t(this.options.template)
  734. }
  735. ,
  736. i.prototype.arrow = function() {
  737. return this.$arrow = this.$arrow || this.tip().find(".tooltip-arrow")
  738. }
  739. ,
  740. i.prototype.validate = function() {
  741. this.$element[0].parentNode || (this.hide(),
  742. this.$element = null,
  743. this.options = null)
  744. }
  745. ,
  746. i.prototype.enable = function() {
  747. this.enabled = !0
  748. }
  749. ,
  750. i.prototype.disable = function() {
  751. this.enabled = !1
  752. }
  753. ,
  754. i.prototype.toggleEnabled = function() {
  755. this.enabled = !this.enabled
  756. }
  757. ,
  758. i.prototype.toggle = function(e) {
  759. var i = this;
  760. e && (i = t(e.currentTarget).data("bs." + this.type),
  761. i || (i = new this.constructor(e.currentTarget,this.getDelegateOptions()),
  762. t(e.currentTarget).data("bs." + this.type, i))),
  763. i.tip().hasClass("in") ? i.leave(i) : i.enter(i)
  764. }
  765. ,
  766. i.prototype.destroy = function() {
  767. clearTimeout(this.timeout),
  768. this.hide().$element.off("." + this.type).removeData("bs." + this.type)
  769. }
  770. ;
  771. var o = t.fn.tooltip;
  772. t.fn.tooltip = e,
  773. t.fn.tooltip.Constructor = i,
  774. t.fn.tooltip.noConflict = function() {
  775. return t.fn.tooltip = o,
  776. this
  777. }
  778. }(jQuery);
  779. !function(e, t, n) {
  780. "undefined" != typeof module && module.exports ? module.exports = n() : "function" == typeof define && define.amd ? define(n) : t[e] = n()
  781. }("Keen", this, function() {
  782. "use strict";
  783. function Keen() {
  784. return _init.apply(this, arguments)
  785. }
  786. function _init(e) {
  787. if (_isUndefined(e))
  788. throw new Error("Check out our JavaScript SDK Usage Guide: https://keen.io/docs/clients/javascript/usage-guide/");
  789. if (_isUndefined(e.projectId) || "String" !== _type(e.projectId) || e.projectId.length < 1)
  790. throw new Error("Please provide a projectId");
  791. this.configure(e)
  792. }
  793. function _extend(e) {
  794. for (var t = 1; t < arguments.length; t++)
  795. for (var n in arguments[t])
  796. e[n] = arguments[t][n];
  797. return e
  798. }
  799. function _isUndefined(e) {
  800. return void 0 === e
  801. }
  802. function _type(e) {
  803. var t = e && e.constructor ? e.constructor.toString() : void 0;
  804. return t ? t.match(/function (.*)\(/)[1] : "Null"
  805. }
  806. function _each(e, t, n) {
  807. var r;
  808. if (!e)
  809. return 0;
  810. if (n = n ? n : e,
  811. "array" === _type(e)) {
  812. for (r = 0; r < e.length; r++)
  813. if (t.call(n, e[r], r, e) === !1)
  814. return 0
  815. } else
  816. for (r in e)
  817. if (e.hasOwnProperty(r) && t.call(n, e[r], r, e) === !1)
  818. return 0;
  819. return 1
  820. }
  821. function _parse_params(e) {
  822. for (var t, n = {}, r = /\+/g, i = /([^&=]+)=?([^&]*)/g, o = function(e) {
  823. return decodeURIComponent(e.replace(r, " "))
  824. }, a = e.split("?")[1]; t = i.exec(a); )
  825. n[o(t[1])] = o(t[2]);
  826. return n
  827. }
  828. function _set_protocol(e) {
  829. switch (e) {
  830. case "http":
  831. return "http";
  832. case "auto":
  833. return location.protocol.replace(/:/g, "");
  834. case "https":
  835. case void 0:
  836. default:
  837. return "https"
  838. }
  839. }
  840. function _set_request_type(e) {
  841. var t = e || "jsonp"
  842. , n = !1;
  843. return ("Object" === _type(XMLHttpRequest) || "Function" === _type(XMLHttpRequest)) && "withCredentials"in new XMLHttpRequest && (n = !0),
  844. null == t || "xhr" == t ? n ? "xhr" : "jsonp" : t
  845. }
  846. function _build_url(e) {
  847. return this.client.endpoint + "/projects/" + this.client.projectId + e
  848. }
  849. function _uploadEvent(e, t, n, r, i) {
  850. var o = _build_url.apply(this, ["/events/" + e])
  851. , a = {};
  852. n = n !== !1,
  853. this.client.globalProperties && (a = this.client.globalProperties(e));
  854. for (var c in t)
  855. t.hasOwnProperty(c) && (a[c] = t[c]);
  856. switch (this.client.requestType) {
  857. case "xhr":
  858. _request.xhr.apply(this, ["POST", o, null, a, this.client.writeKey, n, r, i]);
  859. break;
  860. case "jsonp":
  861. var s = JSON.stringify(a)
  862. , l = Keen.Base64.encode(s);
  863. o = o + "?api_key=" + this.client.writeKey,
  864. o = o + "&data=" + l,
  865. o = o + "&modified=" + (new Date).getTime(),
  866. _request.jsonp.apply(this, [o, this.client.writeKey, r, i]);
  867. break;
  868. case "beacon":
  869. var s = JSON.stringify(a)
  870. , l = Keen.Base64.encode(s);
  871. o = o + "?api_key=" + encodeURIComponent(this.client.writeKey),
  872. o = o + "&data=" + encodeURIComponent(l),
  873. o = o + "&modified=" + encodeURIComponent((new Date).getTime()),
  874. o += "&c=clv1",
  875. _request.beacon.apply(this, [o, null, r, i])
  876. }
  877. }
  878. Keen.prototype.configure = function(e) {
  879. return e.host = _isUndefined(e.host) ? "api.keen.io/3.0" : e.host.replace(/.*?:\/\//g, ""),
  880. e.protocol = _set_protocol(e.protocol),
  881. e.requestType = _set_request_type(e.requestType),
  882. this.client = {
  883. projectId: e.projectId,
  884. writeKey: e.writeKey,
  885. readKey: e.readKey,
  886. globalProperties: null,
  887. endpoint: e.protocol + "://" + e.host,
  888. requestType: e.requestType
  889. },
  890. Keen.trigger("client", this, e),
  891. this.trigger("ready"),
  892. this
  893. }
  894. ;
  895. var _request = {
  896. xhr: function(e, t, n, r, i, o, a, c) {
  897. if (!i)
  898. return Keen.log("Please provide a writeKey for https://keen.io/project/" + this.client.projectId);
  899. var s = new XMLHttpRequest;
  900. if (s.onreadystatechange = function() {
  901. if (4 == s.readyState)
  902. if (s.status >= 200 && s.status < 300) {
  903. var e;
  904. try {
  905. e = JSON.parse(s.responseText)
  906. } catch (e) {
  907. Keen.log("Could not JSON parse HTTP response: " + s.responseText),
  908. c && c(s, e)
  909. }
  910. a && e && a(e)
  911. } else
  912. Keen.log("HTTP request failed."),
  913. c && c(s, null)
  914. }
  915. ,
  916. s.open(e, t, o),
  917. i && s.setRequestHeader("Authorization", i),
  918. r && s.setRequestHeader("Content-Type", "application/json"),
  919. n)
  920. for (var l in n)
  921. n.hasOwnProperty(l) && s.setRequestHeader(l, n[l]);
  922. var u = r ? JSON.stringify(r) : null;
  923. s.send(u)
  924. },
  925. jsonp: function(e, t, n, r) {
  926. if (!t)
  927. return Keen.log("Please provide a writeKey for https://keen.io/project/" + this.client.projectId);
  928. if (t && e.indexOf("api_key") < 0) {
  929. var i = e.indexOf("?") > 0 ? "&" : "?";
  930. e = e + i + "api_key=" + t
  931. }
  932. for (var o = "keenJSONPCallback" + (new Date).getTime(); o in window; )
  933. o += "a";
  934. var a = !1;
  935. window[o] = function(e) {
  936. a = !0,
  937. n && e && n(e),
  938. window[o] = void 0
  939. }
  940. ,
  941. e = e + "&jsonp=" + o;
  942. var c = document.createElement("script");
  943. c.id = "keen-jsonp",
  944. c.src = e,
  945. document.getElementsByTagName("head")[0].appendChild(c),
  946. c.onreadystatechange = function() {
  947. a === !1 && "loaded" === this.readyState && (a = !0,
  948. r && r())
  949. }
  950. ,
  951. c.onerror = function() {
  952. a === !1 && (a = !0,
  953. r && r())
  954. }
  955. },
  956. beacon: function(e, t, n, r) {
  957. if (t && e.indexOf("api_key") < 0) {
  958. var i = e.indexOf("?") > 0 ? "&" : "?";
  959. e = e + i + "api_key=" + t
  960. }
  961. var o = !1
  962. , a = document.createElement("img");
  963. a.onload = function() {
  964. if (o = !0,
  965. "naturalHeight"in this) {
  966. if (this.naturalHeight + this.naturalWidth === 0)
  967. return void this.onerror()
  968. } else if (this.width + this.height === 0)
  969. return void this.onerror();
  970. n && n({
  971. created: !0
  972. })
  973. }
  974. ,
  975. a.onerror = function() {
  976. o = !0,
  977. r && r()
  978. }
  979. ,
  980. a.src = e
  981. }
  982. }
  983. , Events = Keen.Events = {
  984. on: function(e, t) {
  985. this.listeners || (this.listeners = {});
  986. var n = this.listeners[e] || (this.listeners[e] = []);
  987. return n.push({
  988. callback: t
  989. }),
  990. this
  991. },
  992. off: function(e, t) {
  993. if (!e && !t)
  994. return this.listeners = void 0,
  995. delete this.listeners,
  996. this;
  997. for (var n = this.listeners[e] || [], r = n.length; r--; )
  998. t && t == n[r].callback && this.listeners[e].splice(r, 1),
  999. t && 0 != n.length || (this.listeners[e] = void 0,
  1000. delete this.listeners[e]);
  1001. return this
  1002. },
  1003. trigger: function(e) {
  1004. if (!this.listeners)
  1005. return this;
  1006. for (var t = Array.prototype.slice.call(arguments, 1), n = this.listeners[e] || [], r = 0; r < n.length; r++)
  1007. n[r].callback.apply(this, t);
  1008. return this
  1009. }
  1010. };
  1011. _extend(Keen.prototype, Events),
  1012. _extend(Keen, Events),
  1013. Keen.loaded = !0,
  1014. Keen.utils = {
  1015. each: _each,
  1016. extend: _extend,
  1017. parseParams: _parse_params
  1018. },
  1019. Keen.ready = function(e) {
  1020. Keen.loaded ? e() : Keen.on("ready", e)
  1021. }
  1022. ,
  1023. Keen.log = function(e) {
  1024. "object" == typeof console && console.log("[Keen IO]", e)
  1025. }
  1026. ;
  1027. var Plugins = Keen.Plugins = {};
  1028. Keen.prototype.addEvent = function() {
  1029. _uploadEvent.apply(this, arguments)
  1030. }
  1031. ,
  1032. Keen.prototype.addEventSync = function(e, t, n, r) {
  1033. _uploadEvent.apply(this, [e, t, !1, n, r])
  1034. }
  1035. ,
  1036. Keen.prototype.trackExternalLink = function(e, t, n, r, i) {
  1037. var o = e
  1038. , a = o.metaKey
  1039. , c = o.target
  1040. , s = !1
  1041. , l = function() {};
  1042. return void 0 === r && (r = 500),
  1043. "A" === c.nodeName ? l = function() {
  1044. a || s || (s = !0,
  1045. window.location = c.href)
  1046. }
  1047. : "FORM" === c.nodeName && (l = function() {
  1048. s || (s = !0,
  1049. c.submit())
  1050. }
  1051. ),
  1052. i && (l = function() {
  1053. s || (s = !0,
  1054. i())
  1055. }
  1056. ),
  1057. _uploadEvent.call(this, t, n, l, l),
  1058. setTimeout(function() {
  1059. l()
  1060. }, r),
  1061. !!a && void 0
  1062. }
  1063. ,
  1064. Keen.prototype.setGlobalProperties = function(e) {
  1065. if (!this.client)
  1066. return Keen.log("Check out our JavaScript SDK Usage Guide: https://keen.io/docs/clients/javascript/usage-guide/");
  1067. if (!e || "function" != typeof e)
  1068. throw new Error("Invalid value for global properties: " + e);
  1069. this.client.globalProperties = e
  1070. }
  1071. ,
  1072. Keen.Base64 = {
  1073. map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
  1074. encode: function(e) {
  1075. var t, n, r, i, o, a, c, s = "", l = 0, u = this.map;
  1076. for (e = this.utf8.encode(e); l < e.length; )
  1077. t = e.charCodeAt(l++),
  1078. n = e.charCodeAt(l++),
  1079. r = e.charCodeAt(l++),
  1080. i = t >> 2,
  1081. o = (3 & t) << 4 | n >> 4,
  1082. a = isNaN(n) ? 64 : (15 & n) << 2 | r >> 6,
  1083. c = isNaN(n) || isNaN(r) ? 64 : 63 & r,
  1084. s = s + u.charAt(i) + u.charAt(o) + u.charAt(a) + u.charAt(c);
  1085. return s
  1086. },
  1087. decode: function(e) {
  1088. var t, n, r, i, o, a, c, s = "", l = 0, u = this.map, f = String.fromCharCode;
  1089. for (e = e.replace(/[^A-Za-z0-9\+\/\=]/g, ""); l < e.length; )
  1090. t = u.indexOf(e.charAt(l++)),
  1091. n = u.indexOf(e.charAt(l++)),
  1092. r = u.indexOf(e.charAt(l++)),
  1093. i = u.indexOf(e.charAt(l++)),
  1094. o = t << 2 | n >> 4,
  1095. a = (15 & n) << 4 | r >> 2,
  1096. c = (3 & r) << 6 | i,
  1097. s = s + (f(o) + (64 != r ? f(a) : "")) + (64 != i ? f(c) : "");
  1098. return this.utf8.decode(s)
  1099. },
  1100. utf8: {
  1101. encode: function(e) {
  1102. for (var t, n = "", r = 0, i = String.fromCharCode; r < e.length; )
  1103. t = e.charCodeAt(r++),
  1104. n += 128 > t ? i(t) : t > 127 && 2048 > t ? i(t >> 6 | 192) + i(63 & t | 128) : i(t >> 12 | 224) + i(t >> 6 & 63 | 128) + i(63 & t | 128);
  1105. return n
  1106. },
  1107. decode: function(e) {
  1108. for (var t, n, r = "", i = 0, o = String.fromCharCode; i < e.length; )
  1109. n = e.charCodeAt(i),
  1110. r += 128 > n ? [o(n), i++][0] : n > 191 && 224 > n ? [o((31 & n) << 6 | 63 & (t = e.charCodeAt(i + 1))), i += 2][0] : [o((15 & n) << 12 | (63 & (t = e.charCodeAt(i + 1))) << 6 | 63 & (c3 = e.charCodeAt(i + 2))), i += 3][0];
  1111. return r
  1112. }
  1113. }
  1114. },
  1115. "object" != typeof JSON && (JSON = {}),
  1116. function() {
  1117. function f(e) {
  1118. return 10 > e ? "0" + e : e
  1119. }
  1120. function quote(e) {
  1121. return escapable.lastIndex = 0,
  1122. escapable.test(e) ? '"' + e.replace(escapable, function(e) {
  1123. var t = meta[e];
  1124. return "string" == typeof t ? t : "\\u" + ("0000" + e.charCodeAt(0).toString(16)).slice(-4)
  1125. }) + '"' : '"' + e + '"'
  1126. }
  1127. function str(e, t) {
  1128. var n, r, i, o, a, c = gap, s = t[e];
  1129. switch (s && "object" == typeof s && "function" == typeof s.toJSON && (s = s.toJSON(e)),
  1130. "function" == typeof rep && (s = rep.call(t, e, s)),
  1131. typeof s) {
  1132. case "string":
  1133. return quote(s);
  1134. case "number":
  1135. return isFinite(s) ? String(s) : "null";
  1136. case "boolean":
  1137. case "null":
  1138. return String(s);
  1139. case "object":
  1140. if (!s)
  1141. return "null";
  1142. if (gap += indent,
  1143. a = [],
  1144. "[object Array]" === Object.prototype.toString.apply(s)) {
  1145. for (o = s.length,
  1146. n = 0; o > n; n += 1)
  1147. a[n] = str(n, s) || "null";
  1148. return i = 0 === a.length ? "[]" : gap ? "[\n" + gap + a.join(",\n" + gap) + "\n" + c + "]" : "[" + a.join(",") + "]",
  1149. gap = c,
  1150. i
  1151. }
  1152. if (rep && "object" == typeof rep)
  1153. for (o = rep.length,
  1154. n = 0; o > n; n += 1)
  1155. "string" == typeof rep[n] && (r = rep[n],
  1156. i = str(r, s),
  1157. i && a.push(quote(r) + (gap ? ": " : ":") + i));
  1158. else
  1159. for (r in s)
  1160. Object.prototype.hasOwnProperty.call(s, r) && (i = str(r, s),
  1161. i && a.push(quote(r) + (gap ? ": " : ":") + i));
  1162. return i = 0 === a.length ? "{}" : gap ? "{\n" + gap + a.join(",\n" + gap) + "\n" + c + "}" : "{" + a.join(",") + "}",
  1163. gap = c,
  1164. i
  1165. }
  1166. }
  1167. "function" != typeof Date.prototype.toJSON && (Date.prototype.toJSON = function() {
  1168. return isFinite(this.valueOf()) ? this.getUTCFullYear() + "-" + f(this.getUTCMonth() + 1) + "-" + f(this.getUTCDate()) + "T" + f(this.getUTCHours()) + ":" + f(this.getUTCMinutes()) + ":" + f(this.getUTCSeconds()) + "Z" : null
  1169. }
  1170. ,
  1171. String.prototype.toJSON = Number.prototype.toJSON = Boolean.prototype.toJSON = function() {
  1172. return this.valueOf()
  1173. }
  1174. );
  1175. var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, gap, indent, meta = {
  1176. "\b": "\\b",
  1177. "\t": "\\t",
  1178. "\n": "\\n",
  1179. "\f": "\\f",
  1180. "\r": "\\r",
  1181. '"': '\\"',
  1182. "\\": "\\\\"
  1183. }, rep;
  1184. "function" != typeof JSON.stringify && (JSON.stringify = function(e, t, n) {
  1185. var r;
  1186. if (gap = "",
  1187. indent = "",
  1188. "number" == typeof n)
  1189. for (r = 0; n > r; r += 1)
  1190. indent += " ";
  1191. else
  1192. "string" == typeof n && (indent = n);
  1193. if (rep = t,
  1194. t && "function" != typeof t && ("object" != typeof t || "number" != typeof t.length))
  1195. throw new Error("JSON.stringify");
  1196. return str("", {
  1197. "": e
  1198. })
  1199. }
  1200. ),
  1201. "function" != typeof JSON.parse && (JSON.parse = function(text, reviver) {
  1202. function walk(e, t) {
  1203. var n, r, i = e[t];
  1204. if (i && "object" == typeof i)
  1205. for (n in i)
  1206. Object.prototype.hasOwnProperty.call(i, n) && (r = walk(i, n),
  1207. void 0 !== r ? i[n] = r : delete i[n]);
  1208. return reviver.call(e, t, i)
  1209. }
  1210. var j;
  1211. if (text = String(text),
  1212. cx.lastIndex = 0,
  1213. cx.test(text) && (text = text.replace(cx, function(e) {
  1214. return "\\u" + ("0000" + e.charCodeAt(0).toString(16)).slice(-4)
  1215. })),
  1216. /^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, "@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, "]").replace(/(?:^|:|,)(?:\s*\[)+/g, "")))
  1217. return j = eval("(" + text + ")"),
  1218. "function" == typeof reviver ? walk({
  1219. "": j
  1220. }, "") : j;
  1221. throw new SyntaxError("JSON.parse")
  1222. }
  1223. )
  1224. }(),
  1225. !function(e, t, n) {
  1226. "undefined" != typeof module && module.exports ? module.exports = n() : "function" == typeof define && define.amd ? define(n) : t[e] = n()
  1227. }("domready", Keen.utils, function(e) {
  1228. function t(e) {
  1229. for (d = 1; e = r.shift(); )
  1230. e()
  1231. }
  1232. var n, r = [], i = !1, o = document, a = o.documentElement, c = a.doScroll, s = "DOMContentLoaded", l = "addEventListener", u = "onreadystatechange", f = "readyState", p = c ? /^loaded|^c/ : /^loaded|c/, d = p.test(o[f]);
  1233. return o[l] && o[l](s, n = function() {
  1234. o.removeEventListener(s, n, i),
  1235. t()
  1236. }
  1237. , i),
  1238. c && o.attachEvent(u, n = function() {
  1239. /^c/.test(o[f]) && (o.detachEvent(u, n),
  1240. t())
  1241. }
  1242. ),
  1243. e = c ? function(t) {
  1244. self != top ? d ? t() : r.push(t) : function() {
  1245. try {
  1246. a.doScroll("left")
  1247. } catch (n) {
  1248. return setTimeout(function() {
  1249. e(t)
  1250. }, 50)
  1251. }
  1252. t()
  1253. }()
  1254. }
  1255. : function(e) {
  1256. d ? e() : r.push(e)
  1257. }
  1258. });
  1259. var loaded = window.Keen, cached = window._Keen || {}, clients, ready;
  1260. if (loaded && cached) {
  1261. clients = cached.clients || {},
  1262. ready = cached.ready || [];
  1263. for (var instance in clients)
  1264. if (clients.hasOwnProperty(instance)) {
  1265. var client = clients[instance];
  1266. for (var method in Keen.prototype)
  1267. Keen.prototype.hasOwnProperty(method) && (loaded.prototype[method] = Keen.prototype[method]);
  1268. if (loaded.Query = Keen.Query ? Keen.Query : function() {}
  1269. ,
  1270. loaded.Visualization = Keen.Visualization ? Keen.Visualization : function() {}
  1271. ,
  1272. client._config && (client.configure.call(client, client._config),
  1273. delete client._config),
  1274. client._setGlobalProperties) {
  1275. for (var globals = client._setGlobalProperties, i = 0; i < globals.length; i++)
  1276. client.setGlobalProperties.apply(client, globals[i]);
  1277. delete client._setGlobalProperties
  1278. }
  1279. if (client._addEvent) {
  1280. for (var queue = client._addEvent || [], i = 0; i < queue.length; i++)
  1281. client.addEvent.apply(client, queue[i]);
  1282. delete client._addEvent
  1283. }
  1284. var callback = client._on || [];
  1285. if (client._on) {
  1286. for (var i = 0; i < callback.length; i++)
  1287. client.on.apply(client, callback[i]);
  1288. client.trigger("ready"),
  1289. delete client._on
  1290. }
  1291. }
  1292. for (var i = 0; i < ready.length; i++) {
  1293. var callback = ready[i];
  1294. Keen.on("ready", function() {
  1295. callback()
  1296. })
  1297. }
  1298. }
  1299. return Keen.loaded && setTimeout(function() {
  1300. Keen.utils.domready(function() {
  1301. Keen.trigger("ready")
  1302. })
  1303. }, 0),
  1304. Keen
  1305. });
  1306. !function() {
  1307. var t = window.analytics = window.analytics || [];
  1308. if (!t.initialize) {
  1309. if (t.invoked)
  1310. return void (window.console && console.error && console.error("Segment snippet included twice."));
  1311. t.invoked = !0,
  1312. t.methods = ["trackSubmit", "trackClick", "trackLink", "trackForm", "pageview", "identify", "reset", "group", "track", "ready", "alias", "debug", "page", "once", "off", "on"],
  1313. t.factory = function(e) {
  1314. return function() {
  1315. var n = Array.prototype.slice.call(arguments);
  1316. return n.unshift(e),
  1317. t.push(n),
  1318. t
  1319. }
  1320. }
  1321. ;
  1322. for (var e = 0; e < t.methods.length; e++) {
  1323. var n = t.methods[e];
  1324. t[n] = t.factory(n)
  1325. }
  1326. t.load = function(t) {
  1327. var e = document.createElement("script");
  1328. e.type = "text/javascript",
  1329. e.async = !0,
  1330. e.src = ("https:" === document.location.protocol ? "https://" : "http://") + "cdn.segment.com/analytics.js/v1/" + t + "/analytics.min.js";
  1331. var n = document.getElementsByTagName("script")[0];
  1332. n.parentNode.insertBefore(e, n)
  1333. }
  1334. ,
  1335. t.SNIPPET_VERSION = "4.0.0"
  1336. }
  1337. }();
  1338. !function(i, e) {
  1339. "use strict";
  1340. var s = ""
  1341. , r = "?"
  1342. , o = "function"
  1343. , a = "undefined"
  1344. , n = "object"
  1345. , t = "major"
  1346. , d = "model"
  1347. , w = "name"
  1348. , l = "type"
  1349. , p = "vendor"
  1350. , m = "version"
  1351. , c = "architecture"
  1352. , u = "console"
  1353. , g = "mobile"
  1354. , f = "tablet"
  1355. , h = "smarttv"
  1356. , b = {
  1357. has: function(i, e) {
  1358. return e.toLowerCase().indexOf(i.toLowerCase()) !== -1
  1359. },
  1360. lowerize: function(i) {
  1361. return i.toLowerCase()
  1362. }
  1363. }
  1364. , y = {
  1365. rgx: function() {
  1366. for (var i, s, r, t, d, w, l, p = 0, m = arguments; p < m.length; p += 2) {
  1367. var c = m[p]
  1368. , u = m[p + 1];
  1369. if (typeof i === a) {
  1370. i = {};
  1371. for (t in u)
  1372. d = u[t],
  1373. typeof d === n ? i[d[0]] = e : i[d] = e
  1374. }
  1375. for (s = r = 0; s < c.length; s++)
  1376. if (w = c[s].exec(this.getUA())) {
  1377. for (t = 0; t < u.length; t++)
  1378. l = w[++r],
  1379. d = u[t],
  1380. typeof d === n && d.length > 0 ? 2 == d.length ? typeof d[1] == o ? i[d[0]] = d[1].call(this, l) : i[d[0]] = d[1] : 3 == d.length ? typeof d[1] !== o || d[1].exec && d[1].test ? i[d[0]] = l ? l.replace(d[1], d[2]) : e : i[d[0]] = l ? d[1].call(this, l, d[2]) : e : 4 == d.length && (i[d[0]] = l ? d[3].call(this, l.replace(d[1], d[2])) : e) : i[d] = l ? l : e;
  1381. break
  1382. }
  1383. if (w)
  1384. break
  1385. }
  1386. return i
  1387. },
  1388. str: function(i, s) {
  1389. for (var o in s)
  1390. if (typeof s[o] === n && s[o].length > 0) {
  1391. for (var a = 0; a < s[o].length; a++)
  1392. if (b.has(s[o][a], i))
  1393. return o === r ? e : o
  1394. } else if (b.has(s[o], i))
  1395. return o === r ? e : o;
  1396. return i
  1397. }
  1398. }
  1399. , v = {
  1400. browser: {
  1401. oldsafari: {
  1402. major: {
  1403. 1: ["/8", "/1", "/3"],
  1404. 2: "/4",
  1405. "?": "/"
  1406. },
  1407. version: {
  1408. "1.0": "/8",
  1409. 1.2: "/1",
  1410. 1.3: "/3",
  1411. "2.0": "/412",
  1412. "2.0.2": "/416",
  1413. "2.0.3": "/417",
  1414. "2.0.4": "/419",
  1415. "?": "/"
  1416. }
  1417. }
  1418. },
  1419. device: {
  1420. sprint: {
  1421. model: {
  1422. "Evo Shift 4G": "7373KT"
  1423. },
  1424. vendor: {
  1425. HTC: "APA",
  1426. Sprint: "Sprint"
  1427. }
  1428. }
  1429. },
  1430. os: {
  1431. windows: {
  1432. version: {
  1433. ME: "4.90",
  1434. "NT 3.11": "NT3.51",
  1435. "NT 4.0": "NT4.0",
  1436. 2e3: "NT 5.0",
  1437. XP: ["NT 5.1", "NT 5.2"],
  1438. Vista: "NT 6.0",
  1439. 7: "NT 6.1",
  1440. 8: "NT 6.2",
  1441. 8.1: "NT 6.3",
  1442. RT: "ARM"
  1443. }
  1444. }
  1445. }
  1446. }
  1447. , k = {
  1448. browser: [[/(opera\smini)\/((\d+)?[\w\.-]+)/i, /(opera\s[mobiletab]+).+version\/((\d+)?[\w\.-]+)/i, /(opera).+version\/((\d+)?[\w\.]+)/i, /(opera)[\/\s]+((\d+)?[\w\.]+)/i], [w, m, t], [/\s(opr)\/((\d+)?[\w\.]+)/i], [[w, "Opera"], m, t], [/(kindle)\/((\d+)?[\w\.]+)/i, /(lunascape|maxthon|netfront|jasmine|blazer)[\/\s]?((\d+)?[\w\.]+)*/i, /(avant\s|iemobile|slim|baidu)(?:browser)?[\/\s]?((\d+)?[\w\.]*)/i, /(?:ms|\()(ie)\s((\d+)?[\w\.]+)/i, /(rekonq)((?:\/)[\w\.]+)*/i, /(chromium|flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron)\/((\d+)?[\w\.-]+)/i], [w, m, t], [/(trident).+rv[:\s]((\d+)?[\w\.]+).+like\sgecko/i], [[w, "IE"], m, t], [/(yabrowser)\/((\d+)?[\w\.]+)/i], [[w, "Yandex"], m, t], [/(comodo_dragon)\/((\d+)?[\w\.]+)/i], [[w, /_/g, " "], m, t], [/(chrome|omniweb|arora|[tizenoka]{5}\s?browser)\/v?((\d+)?[\w\.]+)/i], [w, m, t], [/(dolfin)\/((\d+)?[\w\.]+)/i], [[w, "Dolphin"], m, t], [/((?:android.+)crmo|crios)\/((\d+)?[\w\.]+)/i], [[w, "Chrome"], m, t], [/version\/((\d+)?[\w\.]+).+?mobile\/\w+\s(safari)/i], [m, t, [w, "Mobile Safari"]], [/version\/((\d+)?[\w\.]+).+?(mobile\s?safari|safari)/i], [m, t, w], [/webkit.+?(mobile\s?safari|safari)((\/[\w\.]+))/i], [w, [t, y.str, v.browser.oldsafari.major], [m, y.str, v.browser.oldsafari.version]], [/(konqueror)\/((\d+)?[\w\.]+)/i, /(webkit|khtml)\/((\d+)?[\w\.]+)/i], [w, m, t], [/(navigator|netscape)\/((\d+)?[\w\.-]+)/i], [[w, "Netscape"], m, t], [/(swiftfox)/i, /(icedragon|iceweasel|camino|chimera|fennec|maemo\sbrowser|minimo|conkeror)[\/\s]?((\d+)?[\w\.\+]+)/i, /(firefox|seamonkey|k-meleon|icecat|iceape|firebird|phoenix)\/((\d+)?[\w\.-]+)/i, /(mozilla)\/((\d+)?[\w\.]+).+rv\:.+gecko\/\d+/i, /(uc\s?browser|polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|qqbrowser)[\/\s]?((\d+)?[\w\.]+)/i, /(links)\s\(((\d+)?[\w\.]+)/i, /(gobrowser)\/?((\d+)?[\w\.]+)*/i, /(ice\s?browser)\/v?((\d+)?[\w\._]+)/i, /(mosaic)[\/\s]((\d+)?[\w\.]+)/i], [w, m, t], [/(apple(?:coremedia|))\/((\d+)[\w\._]+)/i, /(coremedia) v((\d+)[\w\._]+)/i], [w, m, t], [/(aqualung|lyssna|bsplayer)\/([\w\.-]+)/i], [w, m], [/(ares|ossproxy)\s((\d+)[\w\.-]+)/i], [w, m, t], [/(audacious|audimusicstream|amarok|bass|core|dalvik|gnomemplayer|music on console|nsplayer|psp-internetradioplayer|videos)\/((\d+)[\w\.-]+)/i, /(clementine|music player daemon)\s((\d+)[\w\.-]+)/i, /(lg player|nexplayer)\s((\d+)[\d\.]+)/i, /player\/(nexplayer|lg player)\s((\d+)[\w\.-]+)/i], [w, m, t], [/(nexplayer)\s((\d+)[\w\.-]+)/i], [w, m, t], [/(flrp)\/((\d+)[\w\.-]+)/i], [[w, "Flip Player"], m, t], [/(fstream|nativehost|queryseekspider|ia-archiver|facebookexternalhit)/i], [w], [/(gstreamer) souphttpsrc (?:\([^\)]+\)){0,1} libsoup\/((\d+)[\w\.-]+)/i], [w, m, t], [/(htc streaming player)\s[\w_]+\s\/\s((\d+)[\d\.]+)/i, /(java|python-urllib|python-requests|wget|libcurl)\/((\d+)[\w\.-_]+)/i, /(lavf)((\d+)[\d\.]+)/i], [w, m, t], [/(htc_one_s)\/((\d+)[\d\.]+)/i], [[w, /_/g, " "], m, t], [/(mplayer)(?:\s|\/)(?:(?:sherpya-){0,1}svn)(?:-|\s)(r\d+(?:-\d+[\w\.-]+){0,1})/i], [w, m], [/(mplayer)(?:\s|\/)((\d+)[\w\.-]+)/i, /(mplayer) unknown-((\d+)[\w\.\-]+)/i], [w, m, t], [/(mplayer)/i, /(yourmuze)/i, /(media player classic|nero showtime)/i], [w], [/(nero (?:home|scout))\/((\d+)[\w\.-]+)/i], [w, m, t], [/(nokia\d+)\/((\d+)[\w\.-]+)/i], [w, m, t], [/\s(songbird)\/((\d+)[\w\.-]+)/i], [w, m, t], [/(winamp)3 version ((\d+)[\w\.-]+)/i, /(winamp)\s((\d+)[\w\.-]+)/i, /(winamp)mpeg\/((\d+)[\w\.-]+)/i], [w, m, t], [/(ocms-bot|tapinradio|tunein radio|unknown|winamp|inlight radio)/i], [w], [/(quicktime|rma|radioapp|radioclientapplication|soundtap|totem|stagefright|streamium)\/((\d+)[\w\.-]+)/i], [w, m, t], [/(smp)((\d+)[\d\.]+)/i], [w, m, t], [/(vlc) media player - version ((\d+)[\w\.]+)/i, /(vlc)\/((\d+)[\w\.-]+)/i, /(xbmc|gvfs|xine|xmms|irapp)\/((\d+)[\w\.-]+)/i, /(foobar2000)\/((\d+)[\d\.]+)/i, /(itunes)\/((\d+)[\d\.]+)/i], [w, m, t], [/(wmplayer)\/((\d+)[\w\.-]+)/i, /(windows-media-player)\/((\d+)[\w\.-]+)/i], [[w, /-/g, " "], m, t], [/windows\/((\d+)[\w\.-]+) upnp\/[\d\.]+ dlnadoc\/[\d\.]+ (home media server)/i], [m, t, [w, "Windows"]], [/(com\.riseupradioalarm)\/((\d+)[\d\.]*)/i], [w, m, t], [/(rad.io)\s((\d+)[\d\.]+)/i, /(radio.(?:de|at|fr))\s((\d+)[\d\.]+)/i], [[w, "rad.io"], m, t]],
  1449. cpu: [[/(?:(amd|x(?:(?:86|64)[_-])?|wow|win)64)[;\)]/i], [[c, "amd64"]], [/(ia32(?=;))/i], [[c, b.lowerize]], [/((?:i[346]|x)86)[;\)]/i], [[c, "ia32"]], [/windows\s(ce|mobile);\sppc;/i], [[c, "arm"]], [/((?:ppc|powerpc)(?:64)?)(?:\smac|;|\))/i], [[c, /ower/, "", b.lowerize]], [/(sun4\w)[;\)]/i], [[c, "sparc"]], [/(ia64(?=;)|68k(?=\))|arm(?=v\d+;)|(?:irix|mips|sparc)(?:64)?(?=;)|pa-risc)/i], [c, b.lowerize]],
  1450. device: [[/\((ipad|playbook);[\w\s\);-]+(rim|apple)/i], [d, p, [l, f]], [/applecoremedia\/[\w\.]+ \((ipad)/], [d, [p, "Apple"], [l, f]], [/(apple\s{0,1}tv)/i], [[d, "Apple TV"], [p, "Apple"]], [/(hp).+(touchpad)/i, /(kindle)\/([\w\.]+)/i, /\s(nook)[\w\s]+build\/(\w+)/i, /(dell)\s(strea[kpr\s\d]*[\dko])/i], [p, d, [l, f]], [/\((ip[honed|\s\w*]+);.+(apple)/i], [d, p, [l, g]], [/\((ip[honed|\s\w*]+);/i], [d, [p, "Apple"], [l, g]], [/(blackberry)[\s-]?(\w+)/i, /(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|huawei|meizu|motorola)[\s_-]?([\w-]+)*/i, /(hp)\s([\w\s]+\w)/i, /(asus)-?(\w+)/i], [p, d, [l, g]], [/\((bb10);\s(\w+)/i], [[p, "BlackBerry"], d, [l, g]], [/android.+((transfo[prime\s]{4,10}\s\w+|eeepc|slider\s\w+))/i], [[p, "Asus"], d, [l, f]], [/(sony)\s(tablet\s[ps])/i], [p, d, [l, f]], [/(nintendo)\s([wids3u]+)/i], [p, d, [l, u]], [/((playstation)\s[3portablevi]+)/i], [[p, "Sony"], d, [l, u]], [/(sprint\s(\w+))/i], [[p, y.str, v.device.sprint.vendor], [d, y.str, v.device.sprint.model], [l, g]], [/(htc)[;_\s-]+([\w\s]+(?=\))|\w+)*/i, /(zte)-(\w+)*/i, /(alcatel|geeksphone|huawei|lenovo|nexian|panasonic|(?=;\s)sony)[_\s-]?([\w-]+)*/i], [p, [d, /_/g, " "], [l, g]], [/\s((milestone|droid(?:[2-4x]|\s(?:bionic|x2|pro|razr))?(:?\s4g)?))[\w\s]+build\//i, /(mot)[\s-]?(\w+)*/i], [[p, "Motorola"], d, [l, g]], [/android.+\s((mz60\d|xoom[\s2]{0,2}))\sbuild\//i], [[p, "Motorola"], d, [l, f]], [/android.+((sch-i[89]0\d|shw-m380s|gt-p\d{4}|gt-n8000|sgh-t8[56]9))/i], [[p, "Samsung"], d, [l, f]], [/((s[cgp]h-\w+|gt-\w+|galaxy\snexus))/i, /(sam[sung]*)[\s-]*(\w+-?[\w-]*)*/i, /sec-((sgh\w+))/i], [[p, "Samsung"], d, [l, g]], [/(sie)-(\w+)*/i], [[p, "Siemens"], d, [l, g]], [/(maemo|nokia).*(n900|lumia\s\d+)/i, /(nokia)[\s_-]?([\w-]+)*/i], [[p, "Nokia"], d, [l, g]], [/android\s3\.[\s\w-;]{10}((a\d{3}))/i], [[p, "Acer"], d, [l, f]], [/android\s3\.[\s\w-;]{10}(lg?)-([06cv9]{3,4})/i], [[p, "LG"], d, [l, f]], [/((nexus\s[45]))/i, /(lg)[e;\s-\/]+(\w+)*/i], [[p, "LG"], d, [l, g]], [/android.+((ideatab[a-z0-9\-\s]+))/i], [[p, "Lenovo"], d, [l, f]], [/(lg) netcast\.tv/i], [p, [l, h]], [/(mobile|tablet);.+rv\:.+gecko\//i], [l, p, d]],
  1451. engine: [[/(presto)\/([\w\.]+)/i, /(webkit|trident|netfront|netsurf|amaya|lynx|w3m)\/([\w\.]+)/i, /(khtml|tasman|links)[\/\s]\(?([\w\.]+)/i, /(icab)[\/\s]([23]\.[\d\.]+)/i], [w, m], [/rv\:([\w\.]+).*(gecko)/i], [m, w]],
  1452. os: [[/microsoft\s(windows)\s(vista|xp)/i], [w, m], [/(windows)\snt\s6\.2;\s(arm)/i, /(windows\sphone(?:\sos)*|windows\smobile|windows)[\s\/]?([ntce\d\.\s]+\w)/i], [w, [m, y.str, v.os.windows.version]], [/(win(?=3|9|n)|win\s9x\s)([nt\d\.]+)/i], [[w, "Windows"], [m, y.str, v.os.windows.version]], [/\((bb)(10);/i], [[w, "BlackBerry"], m], [/(blackberry)\w*\/?([\w\.]+)*/i, /(tizen)\/([\w\.]+)/i, /(android|webos|palm\os|qnx|bada|rim\stablet\sos|meego)[\/\s-]?([\w\.]+)*/i], [w, m], [/(symbian\s?os|symbos|s60(?=;))[\/\s-]?([\w\.]+)*/i], [[w, "Symbian"], m], [/mozilla.+\(mobile;.+gecko.+firefox/i], [[w, "Firefox OS"], m], [/(nintendo|playstation)\s([wids3portablevu]+)/i, /(mint)[\/\s\(]?(\w+)*/i, /(joli|[kxln]?ubuntu|debian|[open]*suse|gentoo|arch|slackware|fedora|mandriva|centos|pclinuxos|redhat|zenwalk)[\/\s-]?([\w\.-]+)*/i, /(hurd|linux)\s?([\w\.]+)*/i, /(gnu)\s?([\w\.]+)*/i], [w, m], [/(cros)\s[\w]+\s([\w\.]+\w)/i], [[w, "Chromium OS"], m], [/(sunos)\s?([\w\.]+\d)*/i], [[w, "Solaris"], m], [/\s([frentopc-]{0,4}bsd|dragonfly)\s?([\w\.]+)*/i], [w, m], [/(ip[honead]+)(?:.*os\s*([\w]+)*\slike\smac|;\sopera)/i], [[w, "iOS"], [m, /_/g, "."]], [/(mac\sos\sx)\s?([\w\s\.]+\w)*/i], [w, [m, /_/g, "."]], [/(haiku)\s(\w+)/i, /(aix)\s((\d)(?=\.|\)|\s)[\w\.]*)*/i, /(macintosh|mac(?=_powerpc)|plan\s9|minix|beos|os\/2|amigaos|morphos|risc\sos)/i, /(unix)\s?([\w\.]+)*/i], [w, m]]
  1453. }
  1454. , x = function(e) {
  1455. var r = e || (i && i.navigator && i.navigator.userAgent ? i.navigator.userAgent : s);
  1456. return this instanceof x ? (this.getBrowser = function() {
  1457. return y.rgx.apply(this, k.browser)
  1458. }
  1459. ,
  1460. this.getCPU = function() {
  1461. return y.rgx.apply(this, k.cpu)
  1462. }
  1463. ,
  1464. this.getDevice = function() {
  1465. return y.rgx.apply(this, k.device)
  1466. }
  1467. ,
  1468. this.getEngine = function() {
  1469. return y.rgx.apply(this, k.engine)
  1470. }
  1471. ,
  1472. this.getOS = function() {
  1473. return y.rgx.apply(this, k.os)
  1474. }
  1475. ,
  1476. this.getResult = function() {
  1477. return {
  1478. ua: this.getUA(),
  1479. browser: this.getBrowser(),
  1480. engine: this.getEngine(),
  1481. os: this.getOS(),
  1482. device: this.getDevice(),
  1483. cpu: this.getCPU()
  1484. }
  1485. }
  1486. ,
  1487. this.getUA = function() {
  1488. return r
  1489. }
  1490. ,
  1491. this.setUA = function(i) {
  1492. return r = i,
  1493. this
  1494. }
  1495. ,
  1496. void this.setUA(r)) : new x(e).getResult()
  1497. };
  1498. if (typeof exports !== a)
  1499. typeof module !== a && module.exports && (exports = module.exports = x),
  1500. exports.UAParser = x;
  1501. else if (i.UAParser = x,
  1502. typeof define === o && define.amd && define(function() {
  1503. return x
  1504. }),
  1505. typeof i.jQuery !== a) {
  1506. var A = i.jQuery
  1507. , _ = new x;
  1508. A.ua = _.getResult(),
  1509. A.ua.get = function() {
  1510. return _.getUA()
  1511. }
  1512. ,
  1513. A.ua.set = function(i) {
  1514. _.setUA(i);
  1515. var e = _.getResult();
  1516. for (var s in e)
  1517. A.ua[s] = e[s]
  1518. }
  1519. }
  1520. }(this);
  1521. window.Modernizr = function(n, e, t) {
  1522. function o(n) {
  1523. d.cssText = n
  1524. }
  1525. function r(n, e) {
  1526. return typeof n === e
  1527. }
  1528. var i, c, u, a = "2.8.2", f = {}, s = e.documentElement, l = "modernizr", p = e.createElement(l), d = p.style, y = ({}.toString,
  1529. {}), w = [], b = w.slice, v = {}.hasOwnProperty;
  1530. u = r(v, "undefined") || r(v.call, "undefined") ? function(n, e) {
  1531. return e in n && r(n.constructor.prototype[e], "undefined")
  1532. }
  1533. : function(n, e) {
  1534. return v.call(n, e)
  1535. }
  1536. ,
  1537. Function.prototype.bind || (Function.prototype.bind = function(n) {
  1538. var e = this;
  1539. if ("function" != typeof e)
  1540. throw new TypeError;
  1541. var t = b.call(arguments, 1)
  1542. , o = function() {
  1543. if (this instanceof o) {
  1544. var r = function() {};
  1545. r.prototype = e.prototype;
  1546. var i = new r
  1547. , c = e.apply(i, t.concat(b.call(arguments)));
  1548. return Object(c) === c ? c : i
  1549. }
  1550. return e.apply(n, t.concat(b.call(arguments)))
  1551. };
  1552. return o
  1553. }
  1554. ),
  1555. y.webgl = function() {
  1556. return !!n.WebGLRenderingContext
  1557. }
  1558. ;
  1559. for (var h in y)
  1560. u(y, h) && (c = h.toLowerCase(),
  1561. f[c] = y[h](),
  1562. w.push((f[c] ? "" : "no-") + c));
  1563. return f.addTest = function(n, e) {
  1564. if ("object" == typeof n)
  1565. for (var o in n)
  1566. u(n, o) && f.addTest(o, n[o]);
  1567. else {
  1568. if (n = n.toLowerCase(),
  1569. f[n] !== t)
  1570. return f;
  1571. e = "function" == typeof e ? e() : e,
  1572. "undefined" != typeof enableClasses && enableClasses && (s.className += " " + (e ? "" : "no-") + n),
  1573. f[n] = e
  1574. }
  1575. return f
  1576. }
  1577. ,
  1578. o(""),
  1579. p = i = null,
  1580. f._version = a,
  1581. f
  1582. }(this, this.document);
  1583. !function(e, t, a) {
  1584. "use strict";
  1585. function n(t, h, m) {
  1586. function H(a) {
  1587. var n = 0
  1588. , i = Ee.length;
  1589. if (Ce.old = e.extend({}, Ce),
  1590. Ie = we ? 0 : be[ge.horizontal ? "width" : "height"](),
  1591. ke = Be[ge.horizontal ? "width" : "height"](),
  1592. ze = we ? t : Pe[ge.horizontal ? "outerWidth" : "outerHeight"](),
  1593. Ee.length = 0,
  1594. Ce.start = 0,
  1595. Ce.end = q(ze - Ie, 0),
  1596. Re) {
  1597. n = Ne.length,
  1598. qe = Pe.children(ge.itemSelector),
  1599. Ne.length = 0;
  1600. var r, s = c(Pe, ge.horizontal ? "paddingLeft" : "paddingTop"), o = c(Pe, ge.horizontal ? "paddingRight" : "paddingBottom"), l = "border-box" === e(qe).css("boxSizing"), u = "none" !== qe.css("float"), f = 0, v = qe.length - 1;
  1601. ze = 0,
  1602. qe.each(function(t, a) {
  1603. var n = e(a)
  1604. , i = a.getBoundingClientRect()
  1605. , l = E(ge.horizontal ? i.width || i.right - i.left : i.height || i.bottom - i.top)
  1606. , d = c(n, ge.horizontal ? "marginLeft" : "marginTop")
  1607. , p = c(n, ge.horizontal ? "marginRight" : "marginBottom")
  1608. , h = l + d + p
  1609. , m = !d || !p
  1610. , g = {};
  1611. g.el = a,
  1612. g.size = m ? l : h,
  1613. g.half = g.size / 2,
  1614. g.start = ze + (m ? d : 0),
  1615. g.center = g.start - E(Ie / 2 - g.size / 2),
  1616. g.end = g.start - Ie + g.size,
  1617. t || (ze += s),
  1618. ze += h,
  1619. ge.horizontal || u || p && d && t > 0 && (ze -= N(d, p)),
  1620. t === v && (g.end += o,
  1621. ze += o,
  1622. f = m ? p : 0),
  1623. Ne.push(g),
  1624. r = g
  1625. }),
  1626. Pe[0].style[ge.horizontal ? "width" : "height"] = (l ? ze : ze - s - o) + "px",
  1627. ze -= f,
  1628. Ne.length ? (Ce.start = Ne[0][Me ? "center" : "start"],
  1629. Ce.end = Me ? r.center : ze > Ie ? r.end : Ce.start) : Ce.start = Ce.end = 0
  1630. }
  1631. if (Ce.center = E(Ce.end / 2 + Ce.start / 2),
  1632. Q(),
  1633. Se.length && ke > 0 && (ge.dynamicHandle ? (Te = Ce.start === Ce.end ? ke : E(ke * Ie / ze),
  1634. Te = d(Te, ge.minHandleSize, ke),
  1635. Se[0].style[ge.horizontal ? "width" : "height"] = Te + "px") : Te = Se[ge.horizontal ? "outerWidth" : "outerHeight"](),
  1636. xe.end = ke - Te,
  1637. it || j()),
  1638. !we && Ie > 0) {
  1639. var p = Ce.start
  1640. , h = "";
  1641. if (Re)
  1642. e.each(Ne, function(e, t) {
  1643. Me ? Ee.push(t.center) : t.start + t.size > p && p <= Ce.end && (p = t.start,
  1644. Ee.push(p),
  1645. p += Ie,
  1646. p > Ce.end && p < Ce.end + Ie && Ee.push(Ce.end))
  1647. });
  1648. else
  1649. for (; p - Ie < Ce.end; )
  1650. Ee.push(p),
  1651. p += Ie;
  1652. if (De[0] && i !== Ee.length) {
  1653. for (var m = 0; m < Ee.length; m++)
  1654. h += ge.pageBuilder.call(ye, m);
  1655. Ae = De.html(h).children(),
  1656. Ae.eq(Oe.activePage).addClass(ge.activeClass)
  1657. }
  1658. }
  1659. if (Oe.slideeSize = ze,
  1660. Oe.frameSize = Ie,
  1661. Oe.sbSize = ke,
  1662. Oe.handleSize = Te,
  1663. Re) {
  1664. a && null != ge.startAt && (W(ge.startAt),
  1665. ye[Le ? "toCenter" : "toStart"](ge.startAt));
  1666. var g = Ne[Oe.activeItem];
  1667. X(Le && g ? g.center : d(Ce.dest, Ce.start, Ce.end))
  1668. } else
  1669. a ? null != ge.startAt && X(ge.startAt, 1) : X(d(Ce.dest, Ce.start, Ce.end));
  1670. pe("load")
  1671. }
  1672. function X(e, t, a) {
  1673. if (Re && at.released && !a) {
  1674. var n = $(e)
  1675. , i = e > Ce.start && e < Ce.end;
  1676. Le ? (i && (e = Ne[n.centerItem].center),
  1677. Me && ge.activateMiddle && W(n.centerItem)) : i && (e = Ne[n.firstItem].start)
  1678. }
  1679. at.init && at.slidee && ge.elasticBounds ? e > Ce.end ? e = Ce.end + (e - Ce.end) / 6 : e < Ce.start && (e = Ce.start + (e - Ce.start) / 6) : e = d(e, Ce.start, Ce.end),
  1680. et.start = +new Date,
  1681. et.time = 0,
  1682. et.from = Ce.cur,
  1683. et.to = e,
  1684. et.delta = e - Ce.cur,
  1685. et.tweesing = at.tweese || at.init && !at.slidee,
  1686. et.immediate = !et.tweesing && (t || at.init && at.slidee || !ge.speed),
  1687. at.tweese = 0,
  1688. e !== Ce.dest && (Ce.dest = e,
  1689. pe("change"),
  1690. it || Y()),
  1691. K(),
  1692. Q(),
  1693. Z(),
  1694. F()
  1695. }
  1696. function Y() {
  1697. if (ye.initialized) {
  1698. if (!it)
  1699. return it = w(Y),
  1700. void (at.released && pe("moveStart"));
  1701. et.immediate ? Ce.cur = et.to : et.tweesing ? (et.tweeseDelta = et.to - Ce.cur,
  1702. x(et.tweeseDelta) < .1 ? Ce.cur = et.to : Ce.cur += et.tweeseDelta * (at.released ? ge.swingSpeed : ge.syncSpeed)) : (et.time = N(+new Date - et.start, ge.speed),
  1703. Ce.cur = et.from + et.delta * e.easing[ge.easing](et.time / ge.speed, et.time, 0, 1, ge.speed)),
  1704. et.to === Ce.cur ? (Ce.cur = et.to,
  1705. at.tweese = it = 0) : it = w(Y),
  1706. pe("move"),
  1707. we || (f ? Pe[0].style[f] = v + (ge.horizontal ? "translateX" : "translateY") + "(" + -Ce.cur + "px)" : Pe[0].style[ge.horizontal ? "left" : "top"] = -E(Ce.cur) + "px"),
  1708. !it && at.released && pe("moveEnd"),
  1709. j()
  1710. }
  1711. }
  1712. function j() {
  1713. Se.length && (xe.cur = Ce.start === Ce.end ? 0 : ((at.init && !at.slidee ? Ce.dest : Ce.cur) - Ce.start) / (Ce.end - Ce.start) * xe.end,
  1714. xe.cur = d(E(xe.cur), xe.start, xe.end),
  1715. _e.hPos !== xe.cur && (_e.hPos = xe.cur,
  1716. f ? Se[0].style[f] = v + (ge.horizontal ? "translateX" : "translateY") + "(" + xe.cur + "px)" : Se[0].style[ge.horizontal ? "left" : "top"] = xe.cur + "px"))
  1717. }
  1718. function F() {
  1719. Ae[0] && _e.page !== Oe.activePage && (_e.page = Oe.activePage,
  1720. Ae.removeClass(ge.activeClass).eq(Oe.activePage).addClass(ge.activeClass),
  1721. pe("activePage", _e.page))
  1722. }
  1723. function M() {
  1724. tt.speed && Ce.cur !== (tt.speed > 0 ? Ce.end : Ce.start) || ye.stop(),
  1725. ot = at.init ? w(M) : 0,
  1726. tt.now = +new Date,
  1727. tt.pos = Ce.cur + (tt.now - tt.lastTime) / 1e3 * tt.speed,
  1728. X(at.init ? tt.pos : E(tt.pos)),
  1729. at.init || Ce.cur !== Ce.dest || pe("moveEnd"),
  1730. tt.lastTime = tt.now
  1731. }
  1732. function L(e, t, n) {
  1733. if ("boolean" === i(t) && (n = t,
  1734. t = a),
  1735. t === a)
  1736. X(Ce[e], n);
  1737. else {
  1738. if (Le && "center" !== e)
  1739. return;
  1740. var r = ye.getPos(t);
  1741. r && X(r[e], n, !Le)
  1742. }
  1743. }
  1744. function R(e) {
  1745. return null != e ? l(e) ? e >= 0 && e < Ne.length ? e : -1 : qe.index(e) : -1
  1746. }
  1747. function U(e) {
  1748. return R(l(e) && 0 > e ? e + Ne.length : e)
  1749. }
  1750. function W(e, t) {
  1751. var a = R(e);
  1752. return !(!Re || 0 > a) && ((_e.active !== a || t) && (qe.eq(Oe.activeItem).removeClass(ge.activeClass),
  1753. qe.eq(a).addClass(ge.activeClass),
  1754. _e.active = Oe.activeItem = a,
  1755. Z(),
  1756. pe("active", a)),
  1757. a)
  1758. }
  1759. function $(e) {
  1760. e = d(l(e) ? e : Ce.dest, Ce.start, Ce.end);
  1761. var t = {}
  1762. , a = Me ? 0 : Ie / 2;
  1763. if (!we)
  1764. for (var n = 0, i = Ee.length; i > n; n++) {
  1765. if (e >= Ce.end || n === Ee.length - 1) {
  1766. t.activePage = Ee.length - 1;
  1767. break
  1768. }
  1769. if (e <= Ee[n] + a) {
  1770. t.activePage = n;
  1771. break
  1772. }
  1773. }
  1774. if (Re) {
  1775. for (var r = !1, s = !1, o = !1, c = 0, u = Ne.length; u > c; c++)
  1776. if (r === !1 && e <= Ne[c].start + Ne[c].half && (r = c),
  1777. o === !1 && e <= Ne[c].center + Ne[c].half && (o = c),
  1778. c === u - 1 || e <= Ne[c].end + Ne[c].half) {
  1779. s = c;
  1780. break
  1781. }
  1782. t.firstItem = l(r) ? r : 0,
  1783. t.centerItem = l(o) ? o : t.firstItem,
  1784. t.lastItem = l(s) ? s : t.centerItem
  1785. }
  1786. return t
  1787. }
  1788. function Q(t) {
  1789. e.extend(Oe, $(t))
  1790. }
  1791. function Z() {
  1792. var e = Ce.dest <= Ce.start
  1793. , t = Ce.dest >= Ce.end
  1794. , a = (e ? 1 : 0) | (t ? 2 : 0);
  1795. if (_e.slideePosState !== a && (_e.slideePosState = a,
  1796. Je.is("button,input") && Je.prop("disabled", e),
  1797. Ke.is("button,input") && Ke.prop("disabled", t),
  1798. Je.add(Qe)[e ? "addClass" : "removeClass"](ge.disabledClass),
  1799. Ke.add($e)[t ? "addClass" : "removeClass"](ge.disabledClass)),
  1800. _e.fwdbwdState !== a && at.released && (_e.fwdbwdState = a,
  1801. Qe.is("button,input") && Qe.prop("disabled", e),
  1802. $e.is("button,input") && $e.prop("disabled", t)),
  1803. Re && null != Oe.activeItem) {
  1804. var n = 0 === Oe.activeItem
  1805. , i = Oe.activeItem >= Ne.length - 1
  1806. , r = (n ? 1 : 0) | (i ? 2 : 0);
  1807. _e.itemsButtonState !== r && (_e.itemsButtonState = r,
  1808. Ze.is("button,input") && Ze.prop("disabled", n),
  1809. Ge.is("button,input") && Ge.prop("disabled", i),
  1810. Ze[n ? "addClass" : "removeClass"](ge.disabledClass),
  1811. Ge[i ? "addClass" : "removeClass"](ge.disabledClass))
  1812. }
  1813. }
  1814. function G(e, t, a) {
  1815. if (e = U(e),
  1816. t = U(t),
  1817. e > -1 && t > -1 && e !== t && (!a || t !== e - 1) && (a || t !== e + 1)) {
  1818. qe.eq(e)[a ? "insertAfter" : "insertBefore"](Ne[t].el);
  1819. var n = t > e ? e : a ? t : t - 1
  1820. , i = e > t ? e : a ? t + 1 : t
  1821. , r = e > t;
  1822. null != Oe.activeItem && (e === Oe.activeItem ? _e.active = Oe.activeItem = a ? r ? t + 1 : t : r ? t : t - 1 : Oe.activeItem > n && Oe.activeItem < i && (_e.active = Oe.activeItem += r ? 1 : -1)),
  1823. H()
  1824. }
  1825. }
  1826. function J(e, t) {
  1827. for (var a = 0, n = Ve[e].length; n > a; a++)
  1828. if (Ve[e][a] === t)
  1829. return a;
  1830. return -1
  1831. }
  1832. function K() {
  1833. at.released && !ye.isPaused && ye.resume()
  1834. }
  1835. function V(e) {
  1836. return E(d(e, xe.start, xe.end) / xe.end * (Ce.end - Ce.start)) + Ce.start
  1837. }
  1838. function _() {
  1839. at.history[0] = at.history[1],
  1840. at.history[1] = at.history[2],
  1841. at.history[2] = at.history[3],
  1842. at.history[3] = at.delta
  1843. }
  1844. function ee(e) {
  1845. at.released = 0,
  1846. at.source = e,
  1847. at.slidee = "slidee" === e
  1848. }
  1849. function te(t) {
  1850. var a = "touchstart" === t.type
  1851. , n = t.data.source
  1852. , i = "slidee" === n;
  1853. at.init || !a && ie(t.target) || ("handle" !== n || ge.dragHandle && xe.start !== xe.end) && (!i || (a ? ge.touchDragging : ge.mouseDragging && t.which < 2)) && (a || r(t),
  1854. ee(n),
  1855. at.init = 0,
  1856. at.$source = e(t.target),
  1857. at.touch = a,
  1858. at.pointer = a ? t.originalEvent.touches[0] : t,
  1859. at.initX = at.pointer.pageX,
  1860. at.initY = at.pointer.pageY,
  1861. at.initPos = i ? Ce.cur : xe.cur,
  1862. at.start = +new Date,
  1863. at.time = 0,
  1864. at.path = 0,
  1865. at.delta = 0,
  1866. at.locked = 0,
  1867. at.history = [0, 0, 0, 0],
  1868. at.pathToLock = i ? a ? 30 : 10 : 0,
  1869. b.on(a ? z : I, ae),
  1870. ye.pause(1),
  1871. (i ? Pe : Se).addClass(ge.draggedClass),
  1872. pe("moveStart"),
  1873. i && (rt = setInterval(_, 10)))
  1874. }
  1875. function ae(e) {
  1876. if (at.released = "mouseup" === e.type || "touchend" === e.type,
  1877. at.pointer = at.touch ? e.originalEvent[at.released ? "changedTouches" : "touches"][0] : e,
  1878. at.pathX = at.pointer.pageX - at.initX,
  1879. at.pathY = at.pointer.pageY - at.initY,
  1880. at.path = D(A(at.pathX, 2) + A(at.pathY, 2)),
  1881. at.delta = ge.horizontal ? at.pathX : at.pathY,
  1882. at.released || !(at.path < 1)) {
  1883. if (!at.init) {
  1884. if (!(ge.horizontal ? x(at.pathX) > x(at.pathY) : x(at.pathX) < x(at.pathY)))
  1885. return ne();
  1886. at.init = 1
  1887. }
  1888. r(e),
  1889. !at.locked && at.path > at.pathToLock && at.slidee && (at.locked = 1,
  1890. at.$source.on(B, s)),
  1891. at.released && (ne(),
  1892. ge.releaseSwing && at.slidee && (at.swing = (at.delta - at.history[0]) / 40 * 300,
  1893. at.delta += at.swing,
  1894. at.tweese = x(at.swing) > 10)),
  1895. X(at.slidee ? E(at.initPos - at.delta) : V(at.initPos + at.delta))
  1896. }
  1897. }
  1898. function ne() {
  1899. clearInterval(rt),
  1900. at.released = !0,
  1901. b.off(at.touch ? z : I, ae),
  1902. (at.slidee ? Pe : Se).removeClass(ge.draggedClass),
  1903. setTimeout(function() {
  1904. at.$source.off(B, s)
  1905. }),
  1906. Ce.cur === Ce.dest && at.init && pe("moveEnd"),
  1907. ye.resume(1),
  1908. at.init = 0
  1909. }
  1910. function ie(t) {
  1911. return ~e.inArray(t.nodeName, k) || e(t).is(ge.interactive)
  1912. }
  1913. function re() {
  1914. ye.stop(),
  1915. b.off("mouseup", re)
  1916. }
  1917. function se(e) {
  1918. switch (r(e),
  1919. this) {
  1920. case $e[0]:
  1921. case Qe[0]:
  1922. ye.moveBy($e.is(this) ? ge.moveBy : -ge.moveBy),
  1923. b.on("mouseup", re);
  1924. break;
  1925. case Ze[0]:
  1926. ye.prev();
  1927. break;
  1928. case Ge[0]:
  1929. ye.next();
  1930. break;
  1931. case Je[0]:
  1932. ye.prevPage();
  1933. break;
  1934. case Ke[0]:
  1935. ye.nextPage()
  1936. }
  1937. }
  1938. function oe(e) {
  1939. return nt.curDelta = (ge.horizontal ? e.deltaY || e.deltaX : e.deltaY) || -e.wheelDelta,
  1940. nt.curDelta /= 1 === e.deltaMode ? 3 : 100,
  1941. Re ? (p = +new Date,
  1942. nt.last < p - nt.resetTime && (nt.delta = 0),
  1943. nt.last = p,
  1944. nt.delta += nt.curDelta,
  1945. x(nt.delta) < 1 ? nt.finalDelta = 0 : (nt.finalDelta = E(nt.delta / 1),
  1946. nt.delta %= 1),
  1947. nt.finalDelta) : nt.curDelta
  1948. }
  1949. function le(e) {
  1950. e.originalEvent[g] = ye;
  1951. var t = +new Date;
  1952. if (O + ge.scrollHijack > t && Ue[0] !== document && Ue[0] !== window)
  1953. return void (O = t);
  1954. if (ge.scrollBy && Ce.start !== Ce.end) {
  1955. var a = oe(e.originalEvent);
  1956. (ge.scrollTrap || a > 0 && Ce.dest < Ce.end || 0 > a && Ce.dest > Ce.start) && r(e, 1),
  1957. ye.slideBy(ge.scrollBy * a)
  1958. }
  1959. }
  1960. function ce(e) {
  1961. ge.clickBar && e.target === Be[0] && (r(e),
  1962. X(V((ge.horizontal ? e.pageX - Be.offset().left : e.pageY - Be.offset().top) - Te / 2)))
  1963. }
  1964. function de(e) {
  1965. if (ge.keyboardNavBy)
  1966. switch (e.which) {
  1967. case ge.horizontal ? 37 : 38:
  1968. r(e),
  1969. ye["pages" === ge.keyboardNavBy ? "prevPage" : "prev"]();
  1970. break;
  1971. case ge.horizontal ? 39 : 40:
  1972. r(e),
  1973. ye["pages" === ge.keyboardNavBy ? "nextPage" : "next"]()
  1974. }
  1975. }
  1976. function ue(e) {
  1977. return ie(this) ? void (e.originalEvent[g + "ignore"] = !0) : void (this.parentNode !== Pe[0] || e.originalEvent[g + "ignore"] || ye.activate(this))
  1978. }
  1979. function fe() {
  1980. this.parentNode === De[0] && ye.activatePage(Ae.index(this))
  1981. }
  1982. function ve(e) {
  1983. ge.pauseOnHover && ye["mouseenter" === e.type ? "pause" : "resume"](2)
  1984. }
  1985. function pe(e, t) {
  1986. if (Ve[e]) {
  1987. for (me = Ve[e].length,
  1988. T.length = 0,
  1989. he = 0; me > he; he++)
  1990. T.push(Ve[e][he]);
  1991. for (he = 0; me > he; he++)
  1992. T[he].call(ye, e, t)
  1993. }
  1994. }
  1995. var he, me, ge = e.extend({}, n.defaults, h), ye = this, we = l(t), be = e(t), Pe = ge.slidee ? e(ge.slidee).eq(0) : be.children().eq(0), Ie = 0, ze = 0, Ce = {
  1996. start: 0,
  1997. center: 0,
  1998. end: 0,
  1999. cur: 0,
  2000. dest: 0
  2001. }, Be = e(ge.scrollBar).eq(0), Se = Be.children().eq(0), ke = 0, Te = 0, xe = {
  2002. start: 0,
  2003. end: 0,
  2004. cur: 0
  2005. }, De = e(ge.pagesBar), Ae = 0, Ee = [], qe = 0, Ne = [], Oe = {
  2006. firstItem: 0,
  2007. lastItem: 0,
  2008. centerItem: 0,
  2009. activeItem: null,
  2010. activePage: 0
  2011. }, He = new u(be[0]), Xe = new u(Pe[0]), Ye = new u(Be[0]), je = new u(Se[0]), Fe = "basic" === ge.itemNav, Me = "forceCentered" === ge.itemNav, Le = "centered" === ge.itemNav || Me, Re = !we && (Fe || Le || Me), Ue = ge.scrollSource ? e(ge.scrollSource) : be, We = ge.dragSource ? e(ge.dragSource) : be, $e = e(ge.forward), Qe = e(ge.backward), Ze = e(ge.prev), Ge = e(ge.next), Je = e(ge.prevPage), Ke = e(ge.nextPage), Ve = {}, _e = {}, et = {}, tt = {}, at = {
  2012. released: 1
  2013. }, nt = {
  2014. last: 0,
  2015. delta: 0,
  2016. resetTime: 200
  2017. }, it = 0, rt = 0, st = 0, ot = 0;
  2018. we || (t = be[0]),
  2019. ye.initialized = 0,
  2020. ye.frame = t,
  2021. ye.slidee = Pe[0],
  2022. ye.pos = Ce,
  2023. ye.rel = Oe,
  2024. ye.items = Ne,
  2025. ye.pages = Ee,
  2026. ye.isPaused = 0,
  2027. ye.options = ge,
  2028. ye.dragging = at,
  2029. ye.reload = function() {
  2030. H()
  2031. }
  2032. ,
  2033. ye.getPos = function(e) {
  2034. if (Re) {
  2035. var t = R(e);
  2036. return -1 !== t && Ne[t]
  2037. }
  2038. var a = Pe.find(e).eq(0);
  2039. if (a[0]) {
  2040. var n = ge.horizontal ? a.offset().left - Pe.offset().left : a.offset().top - Pe.offset().top
  2041. , i = a[ge.horizontal ? "outerWidth" : "outerHeight"]();
  2042. return {
  2043. start: n,
  2044. center: n - Ie / 2 + i / 2,
  2045. end: n - Ie + i,
  2046. size: i
  2047. }
  2048. }
  2049. return !1
  2050. }
  2051. ,
  2052. ye.moveBy = function(e) {
  2053. tt.speed = e,
  2054. !at.init && tt.speed && Ce.cur !== (tt.speed > 0 ? Ce.end : Ce.start) && (tt.lastTime = +new Date,
  2055. tt.startPos = Ce.cur,
  2056. ee("button"),
  2057. at.init = 1,
  2058. pe("moveStart"),
  2059. y(ot),
  2060. M())
  2061. }
  2062. ,
  2063. ye.stop = function() {
  2064. "button" === at.source && (at.init = 0,
  2065. at.released = 1)
  2066. }
  2067. ,
  2068. ye.prev = function() {
  2069. ye.activate(null == Oe.activeItem ? 0 : Oe.activeItem - 1)
  2070. }
  2071. ,
  2072. ye.next = function() {
  2073. ye.activate(null == Oe.activeItem ? 0 : Oe.activeItem + 1)
  2074. }
  2075. ,
  2076. ye.prevPage = function() {
  2077. ye.activatePage(Oe.activePage - 1)
  2078. }
  2079. ,
  2080. ye.nextPage = function() {
  2081. ye.activatePage(Oe.activePage + 1)
  2082. }
  2083. ,
  2084. ye.slideBy = function(e, t) {
  2085. e && (Re ? ye[Le ? "toCenter" : "toStart"](d((Le ? Oe.centerItem : Oe.firstItem) + ge.scrollBy * e, 0, Ne.length)) : X(Ce.dest + e, t))
  2086. }
  2087. ,
  2088. ye.slideTo = function(e, t) {
  2089. X(e, t)
  2090. }
  2091. ,
  2092. ye.toStart = function(e, t) {
  2093. L("start", e, t)
  2094. }
  2095. ,
  2096. ye.toEnd = function(e, t) {
  2097. L("end", e, t)
  2098. }
  2099. ,
  2100. ye.toCenter = function(e, t) {
  2101. L("center", e, t)
  2102. }
  2103. ,
  2104. ye.getIndex = R,
  2105. ye.activate = function(e, t) {
  2106. var a = W(e);
  2107. ge.smart && a !== !1 && (Le ? ye.toCenter(a, t) : a >= Oe.lastItem ? ye.toStart(a, t) : a <= Oe.firstItem ? ye.toEnd(a, t) : K())
  2108. }
  2109. ,
  2110. ye.activatePage = function(e, t) {
  2111. l(e) && X(Ee[d(e, 0, Ee.length - 1)], t)
  2112. }
  2113. ,
  2114. ye.resume = function(e) {
  2115. ge.cycleBy && ge.cycleInterval && ("items" !== ge.cycleBy || Ne[0] && null != Oe.activeItem) && !(e < ye.isPaused) && (ye.isPaused = 0,
  2116. st ? st = clearTimeout(st) : pe("resume"),
  2117. st = setTimeout(function() {
  2118. switch (pe("cycle"),
  2119. ge.cycleBy) {
  2120. case "items":
  2121. ye.activate(Oe.activeItem >= Ne.length - 1 ? 0 : Oe.activeItem + 1);
  2122. break;
  2123. case "pages":
  2124. ye.activatePage(Oe.activePage >= Ee.length - 1 ? 0 : Oe.activePage + 1)
  2125. }
  2126. }, ge.cycleInterval))
  2127. }
  2128. ,
  2129. ye.pause = function(e) {
  2130. e < ye.isPaused || (ye.isPaused = e || 100,
  2131. st && (st = clearTimeout(st),
  2132. pe("pause")))
  2133. }
  2134. ,
  2135. ye.toggle = function() {
  2136. ye[st ? "pause" : "resume"]()
  2137. }
  2138. ,
  2139. ye.set = function(t, a) {
  2140. e.isPlainObject(t) ? e.extend(ge, t) : ge.hasOwnProperty(t) && (ge[t] = a)
  2141. }
  2142. ,
  2143. ye.add = function(t, a) {
  2144. var n = e(t);
  2145. Re ? (null == a || !Ne[0] || a >= Ne.length ? n.appendTo(Pe) : Ne.length && n.insertBefore(Ne[a].el),
  2146. null != Oe.activeItem && a <= Oe.activeItem && (_e.active = Oe.activeItem += n.length)) : Pe.append(n),
  2147. H()
  2148. }
  2149. ,
  2150. ye.remove = function(t) {
  2151. if (Re) {
  2152. var a = U(t);
  2153. if (a > -1) {
  2154. qe.eq(a).remove();
  2155. var n = a === Oe.activeItem;
  2156. null != Oe.activeItem && a < Oe.activeItem && (_e.active = --Oe.activeItem),
  2157. H(),
  2158. n && (_e.active = null,
  2159. ye.activate(Oe.activeItem))
  2160. }
  2161. } else
  2162. e(t).remove(),
  2163. H()
  2164. }
  2165. ,
  2166. ye.moveAfter = function(e, t) {
  2167. G(e, t, 1)
  2168. }
  2169. ,
  2170. ye.moveBefore = function(e, t) {
  2171. G(e, t)
  2172. }
  2173. ,
  2174. ye.on = function(e, t) {
  2175. if ("object" === i(e))
  2176. for (var a in e)
  2177. e.hasOwnProperty(a) && ye.on(a, e[a]);
  2178. else if ("function" === i(t))
  2179. for (var n = e.split(" "), r = 0, s = n.length; s > r; r++)
  2180. Ve[n[r]] = Ve[n[r]] || [],
  2181. -1 === J(n[r], t) && Ve[n[r]].push(t);
  2182. else if ("array" === i(t))
  2183. for (var o = 0, l = t.length; l > o; o++)
  2184. ye.on(e, t[o])
  2185. }
  2186. ,
  2187. ye.one = function(e, t) {
  2188. function a() {
  2189. t.apply(ye, arguments),
  2190. ye.off(e, a)
  2191. }
  2192. ye.on(e, a)
  2193. }
  2194. ,
  2195. ye.off = function(e, t) {
  2196. if (t instanceof Array)
  2197. for (var a = 0, n = t.length; n > a; a++)
  2198. ye.off(e, t[a]);
  2199. else
  2200. for (var i = e.split(" "), r = 0, s = i.length; s > r; r++)
  2201. if (Ve[i[r]] = Ve[i[r]] || [],
  2202. null == t)
  2203. Ve[i[r]].length = 0;
  2204. else {
  2205. var o = J(i[r], t);
  2206. -1 !== o && Ve[i[r]].splice(o, 1)
  2207. }
  2208. }
  2209. ,
  2210. ye.destroy = function() {
  2211. return Ue.add(Se).add(Be).add(De).add($e).add(Qe).add(Ze).add(Ge).add(Je).add(Ke).off("." + g),
  2212. b.off("keydown", de),
  2213. Ze.add(Ge).add(Je).add(Ke).removeClass(ge.disabledClass),
  2214. qe && null != Oe.activeItem && qe.eq(Oe.activeItem).removeClass(ge.activeClass),
  2215. De.empty(),
  2216. we || (be.off("." + g),
  2217. He.restore(),
  2218. Xe.restore(),
  2219. Ye.restore(),
  2220. je.restore(),
  2221. e.removeData(t, g)),
  2222. Ne.length = Ee.length = 0,
  2223. _e = {},
  2224. ye.initialized = 0,
  2225. ye
  2226. }
  2227. ,
  2228. ye.init = function() {
  2229. if (!ye.initialized) {
  2230. ye.on(m);
  2231. var e = ["overflow", "position"]
  2232. , t = ["position", "webkitTransform", "msTransform", "transform", "left", "top", "width", "height"];
  2233. He.save.apply(He, e),
  2234. Ye.save.apply(Ye, e),
  2235. Xe.save.apply(Xe, t),
  2236. je.save.apply(je, t);
  2237. var a = Se;
  2238. return we || (a = a.add(Pe),
  2239. be.css("overflow", "hidden"),
  2240. f || "static" !== be.css("position") || be.css("position", "relative")),
  2241. f ? v && a.css(f, v) : ("static" === Be.css("position") && Be.css("position", "relative"),
  2242. a.css({
  2243. position: "absolute"
  2244. })),
  2245. ge.forward && $e.on(S, se),
  2246. ge.backward && Qe.on(S, se),
  2247. ge.prev && Ze.on(B, se),
  2248. ge.next && Ge.on(B, se),
  2249. ge.prevPage && Je.on(B, se),
  2250. ge.nextPage && Ke.on(B, se),
  2251. Ue.on(C, le),
  2252. Be[0] && Be.on(B, ce),
  2253. Re && ge.activateOn && be.on(ge.activateOn + "." + g, "*", ue),
  2254. De[0] && ge.activatePageOn && De.on(ge.activatePageOn + "." + g, "*", fe),
  2255. We.on(P, {
  2256. source: "slidee"
  2257. }, te),
  2258. Se && Se.on(P, {
  2259. source: "handle"
  2260. }, te),
  2261. b.on("keydown", de),
  2262. we || (be.on("mouseenter." + g + " mouseleave." + g, ve),
  2263. be.on("scroll." + g, o)),
  2264. ye.initialized = 1,
  2265. H(!0),
  2266. ge.cycleBy && !we && ye[ge.startPaused ? "pause" : "resume"](),
  2267. ye
  2268. }
  2269. }
  2270. }
  2271. function i(e) {
  2272. return null == e ? String(e) : "object" == typeof e || "function" == typeof e ? Object.prototype.toString.call(e).match(/\s([a-z]+)/i)[1].toLowerCase() || "object" : typeof e
  2273. }
  2274. function r(e, t) {
  2275. e.preventDefault(),
  2276. t && e.stopPropagation()
  2277. }
  2278. function s(t) {
  2279. r(t, 1),
  2280. e(this).off(t.type, s)
  2281. }
  2282. function o() {
  2283. this.scrollLeft = 0,
  2284. this.scrollTop = 0
  2285. }
  2286. function l(e) {
  2287. return !isNaN(parseFloat(e)) && isFinite(e)
  2288. }
  2289. function c(e, t) {
  2290. return 0 | E(String(e.css(t)).replace(/[^\-0-9.]/g, ""))
  2291. }
  2292. function d(e, t, a) {
  2293. return t > e ? t : e > a ? a : e
  2294. }
  2295. function u(e) {
  2296. var t = {};
  2297. return t.style = {},
  2298. t.save = function() {
  2299. if (e && e.nodeType) {
  2300. for (var a = 0; a < arguments.length; a++)
  2301. t.style[arguments[a]] = e.style[arguments[a]];
  2302. return t
  2303. }
  2304. }
  2305. ,
  2306. t.restore = function() {
  2307. if (e && e.nodeType) {
  2308. for (var a in t.style)
  2309. t.style.hasOwnProperty(a) && (e.style[a] = t.style[a]);
  2310. return t
  2311. }
  2312. }
  2313. ,
  2314. t
  2315. }
  2316. var f, v, p, h = "sly", m = "Sly", g = h, y = t.cancelAnimationFrame || t.cancelRequestAnimationFrame, w = t.requestAnimationFrame, b = e(document), P = "touchstart." + g + " mousedown." + g, I = "mousemove." + g + " mouseup." + g, z = "touchmove." + g + " touchend." + g, C = (document.implementation.hasFeature("Event.wheel", "3.0") ? "wheel." : "mousewheel.") + g, B = "click." + g, S = "mousedown." + g, k = ["INPUT", "SELECT", "BUTTON", "TEXTAREA"], T = [], x = Math.abs, D = Math.sqrt, A = Math.pow, E = Math.round, q = Math.max, N = Math.min, O = 0;
  2317. b.on(C, function(e) {
  2318. var t = e.originalEvent[g]
  2319. , a = +new Date;
  2320. (!t || t.options.scrollHijack < a - O) && (O = a)
  2321. }),
  2322. function(e) {
  2323. function t(e) {
  2324. var t = (new Date).getTime()
  2325. , n = Math.max(0, 16 - (t - a))
  2326. , i = setTimeout(e, n);
  2327. return a = t,
  2328. i
  2329. }
  2330. w = e.requestAnimationFrame || e.webkitRequestAnimationFrame || t;
  2331. var a = (new Date).getTime()
  2332. , n = e.cancelAnimationFrame || e.webkitCancelAnimationFrame || e.clearTimeout;
  2333. y = function(t) {
  2334. n.call(e, t)
  2335. }
  2336. }(window),
  2337. function() {
  2338. function e(e) {
  2339. for (var n = 0, i = t.length; i > n; n++) {
  2340. var r = t[n] ? t[n] + e.charAt(0).toUpperCase() + e.slice(1) : e;
  2341. if (null != a.style[r])
  2342. return r
  2343. }
  2344. }
  2345. var t = ["", "webkit", "moz", "ms", "o"]
  2346. , a = document.createElement("div");
  2347. f = e("transform"),
  2348. v = e("perspective") ? "translateZ(0) " : ""
  2349. }(),
  2350. t[m] = n,
  2351. e.fn[h] = function(t, a) {
  2352. var r, s;
  2353. return e.isPlainObject(t) || (("string" === i(t) || t === !1) && (r = t === !1 ? "destroy" : t,
  2354. s = Array.prototype.slice.call(arguments, 1)),
  2355. t = {}),
  2356. this.each(function(i, o) {
  2357. var l = e.data(o, g);
  2358. l || r ? l && r && l[r] && l[r].apply(l, s) : l = e.data(o, g, new n(o,t,a).init())
  2359. })
  2360. }
  2361. ,
  2362. n.defaults = {
  2363. slidee: null,
  2364. horizontal: !1,
  2365. itemNav: null,
  2366. itemSelector: null,
  2367. smart: !1,
  2368. activateOn: null,
  2369. activateMiddle: !1,
  2370. scrollSource: null,
  2371. scrollBy: 0,
  2372. scrollHijack: 300,
  2373. scrollTrap: !1,
  2374. dragSource: null,
  2375. mouseDragging: !1,
  2376. touchDragging: !1,
  2377. releaseSwing: !1,
  2378. swingSpeed: .2,
  2379. elasticBounds: !1,
  2380. interactive: null,
  2381. scrollBar: null,
  2382. dragHandle: !1,
  2383. dynamicHandle: !1,
  2384. minHandleSize: 50,
  2385. clickBar: !1,
  2386. syncSpeed: .5,
  2387. pagesBar: null,
  2388. activatePageOn: null,
  2389. pageBuilder: function(e) {
  2390. return "<li>" + (e + 1) + "</li>"
  2391. },
  2392. forward: null,
  2393. backward: null,
  2394. prev: null,
  2395. next: null,
  2396. prevPage: null,
  2397. nextPage: null,
  2398. cycleBy: null,
  2399. cycleInterval: 5e3,
  2400. pauseOnHover: !1,
  2401. startPaused: !1,
  2402. moveBy: 300,
  2403. speed: 0,
  2404. easing: "swing",
  2405. startAt: null,
  2406. keyboardNavBy: null,
  2407. draggedClass: "dragged",
  2408. activeClass: "active",
  2409. disabledClass: "disabled"
  2410. }
  2411. }(jQuery, window);
  2412. !function e(t, i, n) {
  2413. function r(a, s) {
  2414. if (!i[a]) {
  2415. if (!t[a]) {
  2416. var l = "function" == typeof require && require;
  2417. if (!s && l)
  2418. return l(a, !0);
  2419. if (o)
  2420. return o(a, !0);
  2421. var c = new Error("Cannot find module '" + a + "'");
  2422. throw c.code = "MODULE_NOT_FOUND",
  2423. c
  2424. }
  2425. var h = i[a] = {
  2426. exports: {}
  2427. };
  2428. t[a][0].call(h.exports, function(e) {
  2429. var i = t[a][1][e];
  2430. return r(i ? i : e)
  2431. }, h, h.exports, e, t, i, n)
  2432. }
  2433. return i[a].exports
  2434. }
  2435. for (var o = "function" == typeof require && require, a = 0; a < n.length; a++)
  2436. r(n[a]);
  2437. return r
  2438. }({
  2439. 1: [function(e, t, i) {
  2440. (function(i) {
  2441. "use strict";
  2442. function n(e) {
  2443. this.player = null,
  2444. this.director = null,
  2445. this.modelManager = null,
  2446. this.container = null,
  2447. this.tagManager = null,
  2448. this.fadeInSpeed = e,
  2449. null !== this.fadeInSpeed && void 0 !== this.fadeInSpeed || (this.fadeInSpeed = 0)
  2450. }
  2451. var r = e("three")
  2452. , o = e("./util/logger")
  2453. , a = (e("./util/common"),
  2454. e("./enum/PlayerEvents"))
  2455. , s = e("./enum/DirectorEvents")
  2456. , l = e("./settings")
  2457. , c = e("./enum/Viewmode")
  2458. , h = (e("./enum/WarpStyle"),
  2459. e("./enum/BlackoutStyle"),
  2460. e("./enum/ModelManagerEvents"))
  2461. , u = e("./enum/tagEvents")
  2462. , d = e("./util/transitions")
  2463. , p = e("./util/lerp")
  2464. , f = new o(i);
  2465. //window.THREE = r;
  2466. n.prototype.init = function(e, t, i, n, r) {
  2467. window.app = this;
  2468. this.player = t,
  2469. this.director = e,
  2470. this.modelManager = i,
  2471. this.tagManager = n,
  2472. this.container = r,
  2473. this.updateModel(),
  2474. this.bindEvents()
  2475. }
  2476. ,
  2477. n.prototype.bindEvents = function() {
  2478. this.modelManager.on(h.ActiveModelChanged, this.updateModel.bind(this)),
  2479. this.player.on(a.ModeChanging, this.handlePlayerModeChanging.bind(this)),
  2480. this.player.on(a.ModeChanged, this.handlePlayerModeChanged.bind(this)),
  2481. this.player.on(a.ClosestPanoChanging, this.handleClosestPanoChanging.bind(this)),
  2482. this.player.on(a.StartInside, this.handleStartInside.bind(this)),
  2483. this.player.on(a.StartOutside, this.handleStartOutside.bind(this)),
  2484. this.player.on(a.WarpStarted, this.handleWarpStarted.bind(this)),
  2485. this.director.on(s.ActionInterrupted, this.handleActionInterruption.bind(this)),
  2486. this.tagManager.on(u.TagActivated, this.ontagActivated.bind(this)),
  2487. this.tagManager.on(u.TagNavigation, this.onNavigationTotag.bind(this))
  2488. }
  2489. ,
  2490. n.prototype.updateModel = function() {
  2491. //模型this.model
  2492. this.model = this.modelManager.getActiveModel()
  2493. }
  2494. ,
  2495. n.prototype.handleWarpStarted = function() {
  2496. this.hidePlayerReticule()
  2497. }
  2498. ,
  2499. n.prototype.ontagActivated = function() {
  2500. this.hidePlayerReticule()
  2501. }
  2502. ,
  2503. n.prototype.onNavigationTotag = function() {
  2504. this.hidePlayerReticule()
  2505. }
  2506. ,
  2507. n.prototype.handlePlayerModeChanging = function(e, t, i) {
  2508. var n = this.modelManager.getActiveModel()
  2509. , r = this.player.is360View(t, i) || this.director.tourIsPlaying ? 0 : l[t].markerOpacity;
  2510. n.fadePanoMarkers(r),
  2511. n.setMode(t)
  2512. }
  2513. ,
  2514. n.prototype.handlePlayerModeChanged = function(e, t) {
  2515. var i = this.modelManager.getActiveModel()
  2516. , n = t === c.PANORAMA ? r.DoubleSide : r.FrontSide;
  2517. i.setSide(n),
  2518. i.setMode(t)
  2519. }
  2520. ,
  2521. n.prototype.handleClosestPanoChanging = function(e, t, i) {
  2522. i !== c.TRANSITIONING && (e && !this.director.tourIsPlaying && e.hoverOff(i),
  2523. t && !this.director.tourIsPlaying && t.hoverOn(i))
  2524. }
  2525. ,
  2526. n.prototype.handleActionInterruption = function() {}
  2527. ,
  2528. n.prototype.handleStartInside = function(e) {
  2529. var t = l[this.player.mode]
  2530. , i = e ? 0 : t.transitionTime * t.skyboxOpacityLength;
  2531. this.fadeIn(this.fadeInSpeed),
  2532. this.model.alpha = 0,
  2533. this.model.skybox.material.uniforms.opacity.value = 1,
  2534. this.model.fadePanoMarkers(e ? 0 : t.markerOpacity);
  2535. var n = this.player.reticule;
  2536. d.start(p.property(n.material, "opacity", 0), i, null, 0, null, "retReOpac")
  2537. }
  2538. ,
  2539. n.prototype.handleStartOutside = function(e) {
  2540. this.fadeIn(e)
  2541. }
  2542. ,
  2543. n.prototype.fadeIn = function(e) {
  2544. null !== e && void 0 !== e || (e = 2e3,
  2545. f.warn("DisplayController.fadeIn -> no transition time specified, defaulting to 2000 ms.")),
  2546. $(this.container).fadeIn(e)
  2547. }
  2548. ,
  2549. n.prototype.hidePlayerReticule = function() {
  2550. this.player.reticule.hide()
  2551. }
  2552. ,
  2553. t.exports = n
  2554. }
  2555. ).call(this, "/js/DisplayController.js")
  2556. }
  2557. , {
  2558. "./enum/BlackoutStyle": 18,
  2559. "./enum/DirectorEvents": 23,
  2560. "./enum/tagEvents": 32,
  2561. "./enum/ModelManagerEvents": 33,
  2562. "./enum/PlayerEvents": 40,
  2563. "./enum/Viewmode": 51,
  2564. "./enum/WarpStyle": 52,
  2565. "./settings": 166,
  2566. "./util/common": 185,
  2567. "./util/lerp": 188,
  2568. "./util/logger": 189,
  2569. "./util/transitions": 195,
  2570. three: 217
  2571. }],
  2572. 2: [function(e, t, i) {
  2573. "use strict";
  2574. function n() {
  2575. this.baseStartTime = performance.timing.navigationStart,
  2576. this.loadingStartTime = null,
  2577. this.waitingStartTime = null,
  2578. this.appReadyTime = null
  2579. }
  2580. n.prototype.setBaseStartTime = function(e) {
  2581. this.baseStartTime = e || Date.now()
  2582. }
  2583. ,
  2584. n.prototype.setWaitingStartTime = function(e) {
  2585. this.waitingStartTime = e || Date.now()
  2586. }
  2587. ,
  2588. n.prototype.setLoadingStartTime = function(e) {
  2589. this.loadingStartTime = e || Date.now()
  2590. }
  2591. ,
  2592. n.prototype.setAppReadyTime = function(e) {
  2593. this.appReadyTime = e || Date.now()
  2594. }
  2595. ,
  2596. n.prototype.calcFullLoadingTime = function() {
  2597. var e = this.appReadyTime - this.baseStartTime;
  2598. return this.waitingStartTime && (e -= this.loadingStartTime - this.waitingStartTime),
  2599. e
  2600. }
  2601. ,
  2602. t.exports = n
  2603. }
  2604. , {}],
  2605. 3: [function(e, t, i) {
  2606. (function(i) {
  2607. "use strict";
  2608. function n() {
  2609. return 100 * Math.random()
  2610. }
  2611. var r = e("./util/logger")
  2612. , o = e("./util/browser")
  2613. , a = new r(i)
  2614. , s = window.MP_AB_TESTS = window.MP_AB_TESTS || {
  2615. initialized: !1,
  2616. init: function(e, t) {
  2617. if (t = t || {},
  2618. !this.initialized) {
  2619. this.initialized = !0,
  2620. o.valueFromHash("tilegen") && (t.tilegen = 1 === o.valueFromHash("tilegen", 0)),
  2621. o.valueFromHash("imgopt") && (t.imgopt = 1 === o.valueFromHash("imgopt", 0));
  2622. for (var i in e) {
  2623. var r = i.match("^sc_tilegen_([0-9]+)$");
  2624. r && (s.tilegen = n() < parseInt(r[1]));
  2625. var l = i.match("^sc_imgopt_([0-9]+)$");
  2626. l && (s.imgopt = n() < parseInt(l[1]))
  2627. }
  2628. for (var c in t)
  2629. s[c] = t[c],
  2630. a.debug("A/B override:", c, s[c])
  2631. }
  2632. },
  2633. changeIfTileGenerating: function(e) {
  2634. return s.tilegen && (e += e.indexOf("?") === -1 ? "?" : "&",
  2635. e += ""),
  2636. e
  2637. },
  2638. changeIfImageOptimzing: function(e) {
  2639. return s.imgopt && e.indexOf("imgopt=1") === -1 && (e += e.indexOf("?") === -1 ? "?" : "&",
  2640. e += ""),
  2641. e
  2642. },
  2643. tilegen: !1,
  2644. imgopt: !1
  2645. };
  2646. t.exports = s
  2647. }
  2648. ).call(this, "/js/ab.js")
  2649. }
  2650. , {
  2651. "./util/browser": 182,
  2652. "./util/logger": 189
  2653. }],
  2654. 4: [function(e, t, i) {
  2655. (function(i) {
  2656. "use strict";
  2657. function n() {
  2658. return {
  2659. addons: [{
  2660. name: "keen:ua_parser",
  2661. input: {
  2662. ua_string: "user_agent"
  2663. },
  2664. output: "parsed_user_agent"
  2665. }]
  2666. }
  2667. }
  2668. function r(e, t, i, n) {
  2669. function r(t) {
  2670. l[t.sid] = !0;
  2671. var i = t.billboard.media && t.billboard.media.type
  2672. , n = {
  2673. tag_id: t.sid,
  2674. tags_visited: Object.keys(l).length,
  2675. tag_count: Object.keys(e.tags).length,
  2676. tag_view_count: ++E,
  2677. has_media: !!i
  2678. };
  2679. i && (n.media_type = i),
  2680. u("tag_opened", n)
  2681. }
  2682. var l = {}
  2683. , h = Date.now() - N
  2684. , f = null;
  2685. n && (f = Date.now() - window.navigationStart);
  2686. var g;
  2687. try {
  2688. g = /* e.data.player_options.highlight_reel && */ e.heroLocations.length > 0
  2689. } catch (e) {
  2690. g = !1
  2691. }
  2692. var v, A = e.supportsVR;
  2693. A || (v = "VR disabled at the model/account level",
  2694. 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"))),
  2695. u("model_loaded", {
  2696. duration: h,
  2697. duration_from_navigation_start: f,
  2698. has_hlr: g,
  2699. has_vr: A,
  2700. vr_reason: v
  2701. });
  2702. var I = 0;
  2703. e.panos.forEach(function(e) {
  2704. e.on("enter", function() {
  2705. c("pano_viewed", {
  2706. pano_id: e.id,
  2707. pano_view_count: ++I,
  2708. alignment_type: e.alignmentType,
  2709. interaction_source: O,
  2710. navigation_source: p
  2711. })
  2712. })
  2713. });
  2714. var E = 0;
  2715. for (var T in e.tags)
  2716. e.tags[T].billboard.on(M.OPENED, r.bind(this, e.tags[T]));
  2717. t.on("tour_auto", function(e) {
  2718. p = "tour_" + e
  2719. }),
  2720. t.on("tour_manual", function(e) {
  2721. O = "gui-" + e,
  2722. p = "tour_manual"
  2723. }),
  2724. i.on(C.InteractionKey, function() {
  2725. t.mode === y.TRANSITIONING || t.flying || d(C.InteractionKey)
  2726. }),
  2727. i.on(C.InteractionDirect, function() {
  2728. t.mode === y.TRANSITIONING || t.flying || d(C.InteractionDirect)
  2729. }),
  2730. o(t),
  2731. a(),
  2732. s()
  2733. }
  2734. function o(e) {
  2735. I.on(T.OPENED, function() {
  2736. c("showcase_share_intent", {
  2737. pano_id: e.currentPano && e.currentPano.id
  2738. })
  2739. }),
  2740. I.on(T.LINK_CLICKED, function(t) {
  2741. c("showcase_share_action", {
  2742. channel: t.channel,
  2743. pano_id: e.currentPano && e.currentPano.id
  2744. })
  2745. }),
  2746. E.on(x.ORIGIN_LINK_CLICKED, function() {
  2747. c("showcase_share_origin_link_clicked")
  2748. })
  2749. }
  2750. function a() {}
  2751. function s() {
  2752. b.on(S.OPENED, c.bind(this, "showcase_gui", {
  2753. gui_action: "click_vr_button"
  2754. })),
  2755. b.on(S.LAUNCH, function(e) {
  2756. c("showcase_gui", {
  2757. gui_action: "launch_vr",
  2758. vr_platform: e.vr_platform,
  2759. vr_app: e.vr_app
  2760. })
  2761. }),
  2762. b.on(S.PREV, c.bind(this, "showcase_gui", {
  2763. gui_action: "vr_modal_prev"
  2764. })),
  2765. b.on(S.NEXT, function(e) {
  2766. c("showcase_gui", {
  2767. gui_action: e.nextAction
  2768. })
  2769. }),
  2770. b.on(S.CLOSED, c.bind(this, "showcase_gui", {
  2771. gui_action: "vr_modal_close"
  2772. })),
  2773. b.on(S.falseICECHOSEN, function(e) {
  2774. c("showcase_gui", {
  2775. gui_action: e.name + " "
  2776. })
  2777. }),
  2778. b.on(S.STORE, function(e) {
  2779. c("showcase_gui", {
  2780. gui_action: "launch_store",
  2781. store: e
  2782. })
  2783. })
  2784. }
  2785. function l(e, t) {
  2786. if (f)
  2787. try {
  2788. f.addEvent(e, v.extendObject({
  2789. host: window.location.host,
  2790. keen: n(),
  2791. user_agent: "${keen.user_agent}",
  2792. referrer: {
  2793. url: v.normalizeUrl(document.referrer),
  2794. domain: v.domainFromUrl(document.referrer),
  2795. url_original: document.referrer
  2796. },
  2797. embedded: m.inIframe(),
  2798. is_mobile: m.isMobile(),
  2799. version: "2.25.6-0-gd87e5b1"
  2800. }, t))
  2801. } catch (e) {
  2802. P.warn("analytics.report -> client.addEvent() error (is there blocking software installed?). Error message: " + e)
  2803. }
  2804. }
  2805. function c(e, t) {
  2806. if (t = t || {},
  2807. L)
  2808. try {
  2809. window.analytics.track(e, v.extendObject(t, B), {
  2810. context: {
  2811. app: {
  2812. name: "showcase",
  2813. version: "2.25.6-0-gd87e5b1"
  2814. },
  2815. screen: {
  2816. width: window.screen.width,
  2817. height: window.screen.height,
  2818. density: window.devicePixelRatio
  2819. }
  2820. }
  2821. })
  2822. } catch (t) {
  2823. console.warn("Failed to send data to segment for " + e)
  2824. }
  2825. }
  2826. function h(e, t) {
  2827. if (t = t || {},
  2828. navigator.sendBeacon && L)
  2829. try {
  2830. navigator.sendBeacon("https://api.segment.io/v1/t", JSON.stringify({
  2831. event: e,
  2832. anonymousId: window.analytics.user().anonymousId(),
  2833. properties: v.extendObject(t, B),
  2834. writeKey: L,
  2835. sentAt: Date.now(),
  2836. type: "track",
  2837. context: {
  2838. userAgent: m.userAgent(),
  2839. library: {
  2840. name: "showcase-beacon",
  2841. version: "2.25.6-0-gd87e5b1"
  2842. },
  2843. app: {
  2844. name: "showcase",
  2845. version: "2.25.6-0-gd87e5b1"
  2846. }
  2847. }
  2848. }))
  2849. } catch (e) {
  2850. console.warn("Failed to send async segment request")
  2851. }
  2852. }
  2853. function u(e, t) {
  2854. t = t || {},
  2855. c(e, t)
  2856. }
  2857. function d(e, t) {
  2858. O = e === C.InteractionGui ? "gui-" + t : e,
  2859. p = "self_guided"
  2860. }
  2861. var p, f, g = (e("three"),
  2862. e("./util/ajax"),
  2863. e("./ab")), m = e("./util/browser"), v = e("./util/common"), A = e("./settings"), y = (e("./localization/localize"),
  2864. 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"),
  2865. "direct"), L = null, D = !1, N = null, B = null, F = v.uuid4();
  2866. t.exports = {
  2867. report: function(e, t, i, n) {
  2868. l("Session starts", {
  2869. model: e,
  2870. status: t,
  2871. loadtime: Date.now() - (N || Date.now()),
  2872. loadtime_from_navigation_start: i ? Date.now() - window.navigationStart : null,
  2873. autoplay: i,
  2874. quickstart: n,
  2875. ab_tilegen: g.tilegen,
  2876. ab_imgopt: g.imgopt
  2877. })
  2878. },
  2879. impression: function(e) {
  2880. e = e || {};
  2881. var t = void 0 === e.isVisible || e.isVisible
  2882. , i = (void 0 !== e.immediate && e.immediate,
  2883. window.location.search.substr(1).split("&"));
  2884. u("impression", {
  2885. visible: t,
  2886. url_params: i
  2887. })
  2888. },
  2889. initKeen: function(e) {
  2890. return e.token && e.appId ? void (f = new Keen({
  2891. projectId: e.appId,
  2892. writeKey: e.token,
  2893. readKey: "",
  2894. requestType: "xhr"
  2895. })) : void P.warn("no keen token/appId")
  2896. },
  2897. initSegment: function(e) {
  2898. return e.token ? (L = e.token,
  2899. window.analytics.load(e.token),
  2900. B = {
  2901. model_id: e.model,
  2902. start_source: e.startSource,
  2903. autoplay: e.autoplay,
  2904. quickstart: e.quickstart,
  2905. language_tag: A.languageTag,
  2906. is_mobile: m.isMobile(),
  2907. iframe: m.inIframe(),
  2908. aspect_ratio: m.aspectRatio(),
  2909. session_id: F,
  2910. window: {
  2911. width: $("#player").width(),
  2912. height: $("#player").height()
  2913. },
  2914. platform: {
  2915. browser: {
  2916. name: $.ua.browser.name,
  2917. major: $.ua.browser.major,
  2918. version: $.ua.browser.version
  2919. },
  2920. os: {
  2921. name: $.ua.os.name,
  2922. version: $.ua.os.version
  2923. },
  2924. device: {
  2925. vendor: $.ua.device.vendor,
  2926. model: $.ua.device.model,
  2927. type: $.ua.device.type
  2928. }
  2929. }
  2930. },
  2931. D = Math.random() < A.analytics.sessionTrackingRate,
  2932. P.debug("tracking sample rate = " + A.analytics.sessionTrackingRate),
  2933. void P.debug("tracking this session = " + D)) : void P.warn("no segment token")
  2934. },
  2935. sessionStart: function(e) {
  2936. P.debug("analytics user_session_start"),
  2937. c("session_started"),
  2938. N = Date.now(),
  2939. window.addEventListener("unload", function() {
  2940. h("session_ended", {
  2941. duration: Date.now() - N
  2942. })
  2943. })
  2944. },
  2945. modelLoaded: function(e, t, i, n) {
  2946. r(e, t, i, n)
  2947. },
  2948. loadComplete: function(e) {
  2949. var t = {
  2950. time_to_app_start: e
  2951. };
  2952. c("load_times", t)
  2953. },
  2954. track: function(e, t) {
  2955. D && (P.debug('analytics.track("' + e + '", ' + JSON.stringify(t) + " )"),
  2956. c(e, t))
  2957. },
  2958. trackAlways: function(e, t) {
  2959. P.debug('analytics.trackAlways("' + e + '", ' + JSON.stringify(t) + " )"),
  2960. c(e, t)
  2961. },
  2962. getSessionId: function() {
  2963. return F
  2964. },
  2965. updateInteraction: d
  2966. }
  2967. }
  2968. ).call(this, "/js/analytics.js")
  2969. }
  2970. , {
  2971. "./ab": 3,
  2972. "./enum/ControlEvents": 21,
  2973. "./enum/PlayerEvents": 40,
  2974. "./enum/VROption": 47,
  2975. "./enum/VRPlatforms": 49,
  2976. "./enum/Viewmode": 51,
  2977. "./gui/sharing/ShareEvents": 76,
  2978. "./gui/sharing/modal": 77,
  2979. "./gui/title/TitleEvents": 80,
  2980. "./gui/title/titleBar": 82,
  2981. "./gui/vr/vrEvent": 85,
  2982. "./gui/vr/vrModal": 87,
  2983. "./localization/localize": 108,
  2984. "./tag/Billboard/BillboardEvent": 120,
  2985. "./settings": 166,
  2986. "./util/ajax": 181,
  2987. "./util/browser": 182,
  2988. "./util/common": 185,
  2989. "./util/logger": 189,
  2990. three: 217
  2991. }],
  2992. 5: [function(e, t, i) {
  2993. "use strict";
  2994. function n() {
  2995. r.PerspectiveCamera.call(this, a.clampVFOV(o.dollhouseFOV), $("#player").width() / $("#player").height(), o.dollhouseNear, o.dollhouseFar),
  2996. this.controls = null
  2997. }
  2998. var r = e("three")
  2999. , o = e("../constants")
  3000. , a = e("../util/cameraLight");
  3001. n.prototype = Object.create(r.PerspectiveCamera.prototype),
  3002. n.prototype.updateAspect = function(e) {
  3003. this.aspect = e,
  3004. this.updateProjectionMatrix()
  3005. }
  3006. ,
  3007. t.exports = n
  3008. }
  3009. , {
  3010. "../constants": 8,
  3011. "../util/cameraLight": 184,
  3012. three: 217
  3013. }],
  3014. 6: [function(e, t, i) {
  3015. "use strict";
  3016. function n() {
  3017. var e = $("#player").width() / $("#player").height();
  3018. r.OrthographicCamera.call(this, -o.orthoBase, o.orthoBase, o.orthoBase / e, -o.orthoBase / e, o.orthoNear, o.orthoFar),
  3019. this.controls = null,
  3020. this.updateAspect(e)
  3021. }
  3022. var r = e("three")
  3023. , o = e("../constants");
  3024. n.prototype = Object.create(r.OrthographicCamera.prototype),
  3025. n.prototype.updateAspect = function(e) {
  3026. this.aspect = e,
  3027. this.top = o.orthoBase / e,
  3028. this.bottom = -o.orthoBase / e,
  3029. this.updateProjectionMatrix()
  3030. }
  3031. ,
  3032. t.exports = n
  3033. }
  3034. , {
  3035. "../constants": 8,
  3036. three: 217
  3037. }],
  3038. 7: [function(e, t, i) {
  3039. "use strict";
  3040. function n() {
  3041. r.PerspectiveCamera.call(this, a.clampVFOV(o.insideFOV), $("#player").width() / $("#player").height(), o.insideNear, o.insideFar),
  3042. this.controls = null
  3043. }
  3044. var r = e("three")
  3045. , o = e("../settings")
  3046. , a = e("../util/cameraLight");
  3047. n.prototype = Object.create(r.PerspectiveCamera.prototype),
  3048. n.prototype.updateAspect = function(e) {
  3049. this.aspect = e,
  3050. this.updateProjectionMatrix()
  3051. }
  3052. ,
  3053. t.exports = n
  3054. }
  3055. , {
  3056. "../settings": 166,
  3057. "../util/cameraLight": 184,
  3058. three: 217
  3059. }],
  3060. 8: [function(e, t, i) {
  3061. "use strict";
  3062. t.exports = {
  3063. signedUrlDefaultExpireTime: 24e4,
  3064. signedUrlCheckInterval: 1e4,
  3065. signedUrlRefreshBuffer: 15e3,
  3066. dollhouseFOV: 70,
  3067. dollhouseNear: 1,
  3068. dollhouseFar: 5e3,
  3069. insideFOV: 70,
  3070. insideFOVMax: 120,
  3071. insideNear: .1,
  3072. insideFar: 5e3,
  3073. insideLookSpeed: .12,
  3074. insideLookLimitUp: 40,
  3075. insideLookLimitDown: -40,
  3076. orthoNear: 1,
  3077. orthoFar: 5e3,
  3078. orthoBase: 10,
  3079. narrowLandscapeHeight: 290,
  3080. reallyNarrowLandscapeHeight: 250,
  3081. visionTilingStartDate: new Date("8/26/2016"),
  3082. visionTilingStartVersion: "1.1.407.13667",
  3083. windowHeightHighQualityThreshold: 900,
  3084. tourStepDelayDefault: 3500,
  3085. tourStepDelaySlideShow: 5e3,
  3086. workshopApsect: 9 / 16,
  3087. highQualityMaxZoom: 2,
  3088. ultraHighQualityMaxZoom: 3
  3089. }
  3090. }
  3091. , {}],
  3092. 9: [function(e, t, i) {
  3093. "use strict";
  3094. function n() {
  3095. this.activeControl = null,
  3096. this.controls = {},
  3097. this.cameras = {}
  3098. }
  3099. var r = e("./PanoramaControls")
  3100. , o = e("./DollhouseControls")
  3101. , a = e("./FloorplanControls")
  3102. , s = e("../cameras/PanoramaCamera")
  3103. , l = e("../cameras/DollhouseCamera")
  3104. , c = e("../cameras/FloorplanCamera")
  3105. , h = e("events").EventEmitter
  3106. , u = e("../enum/ControlEvents")
  3107. , d = e("../enum/ModelManagerEvents")
  3108. , p = e("../enum/Viewmode")
  3109. , f = e("../settings");
  3110. n.prototype = Object.create(h.prototype),
  3111. n.prototype.init = function(e, t) {
  3112. this.setUpControls(),
  3113. this.bindEvents(e, t)
  3114. }
  3115. ,
  3116. n.prototype.activateControls = function(e) {
  3117. this.activeControl && (this.activeControl.reset(),
  3118. this.activeControl.enabled = !1),
  3119. this.controls[e] && (this.controls[e].enabled = !0),
  3120. this.activeControl = this.controls[e]
  3121. }
  3122. ,
  3123. n.prototype.setUpControls = function() {
  3124. var e = {}
  3125. , t = {}
  3126. , i = [p.PANORAMA, p.DOLLHOUSE, p.FLOORPLAN]
  3127. , n = [s, l, c]
  3128. , h = [r, o, a];
  3129. i.forEach(function(i, r) {
  3130. e[i] = new n[r],
  3131. t[i] = new h[r](e[i]),
  3132. t[i].on(u.Move, this.emit.bind(this, u.Move)),
  3133. t[i].on(u.InputStart, this.emit.bind(this, u.InputStart)),
  3134. t[i].on(u.InteractionDirect, this.emit.bind(this, u.InteractionDirect)),
  3135. t[i].on(u.InteractionKey, this.emit.bind(this, u.InteractionKey)),
  3136. t[i].on(u.Pinch, this.emit.bind(this, u.Pinch)),
  3137. t[i].on(u.Scroll, this.emit.bind(this, u.Scroll))
  3138. }
  3139. .bind(this)),
  3140. this.controls = t,
  3141. this.cameras = e
  3142. }
  3143. ,
  3144. n.prototype.bindEvents = function(e, t) {
  3145. e.addEventListener("mousemove", this.onMouseMove.bind(this)),
  3146. e.addEventListener("mousedown", this.onMouseDown.bind(this)),
  3147. e.addEventListener("mouseup", this.onMouseUp.bind(this)),
  3148. e.addEventListener("mouseover", this.onMouseOver.bind(this)),
  3149. f.useWheel && (e.addEventListener("mousewheel", this.onMouseWheel.bind(this),{ passive: false }),
  3150. e.addEventListener("DOMMouseScroll", this.onMouseWheel.bind(this))),
  3151. e.addEventListener("touchstart", this.onTouchStart.bind(this)),
  3152. e.addEventListener("touchmove", this.onTouchMove.bind(this)),
  3153. e.addEventListener("touchend", this.onTouchEnd.bind(this)),
  3154. e.addEventListener("contextmenu", function(e) {
  3155. e.preventDefault()
  3156. }),
  3157. e.addEventListener("pointerdown", this.onPointerDown.bind(this)),
  3158. e.addEventListener("pointermove", this.onPointerMove.bind(this)),
  3159. e.addEventListener("pointerup", this.onPointerUp.bind(this)),
  3160. e.addEventListener("pointerout", this.onPointerCancel.bind(this)),
  3161. e.addEventListener("pointercancel", this.onPointerCancel.bind(this)),
  3162. document.addEventListener("keydown", this.onKeyDown.bind(this)),
  3163. document.addEventListener("keyup", this.onKeyUp.bind(this)),
  3164. t.on(d.ActiveModelChanged, function(e) {
  3165. this.setModelForControls(e.model)
  3166. }
  3167. .bind(this))
  3168. }
  3169. ,
  3170. n.prototype.setModelForControls = function(e) {
  3171. this.controls[p.DOLLHOUSE].setZoomBounds(e.boundingBox);
  3172. var t = e.boundingBox.clone().expandByScalar(f.modelBoundsPadding);
  3173. [p.DOLLHOUSE, p.FLOORPLAN].forEach(function(e) {
  3174. this.controls[e].setBounds(t)
  3175. }
  3176. .bind(this))
  3177. }
  3178. ,
  3179. n.prototype.onMouseDown = function(e) {
  3180. e.preventDefault(),
  3181. this.activeControl && this.activeControl.onMouseDown(e)
  3182. }
  3183. ,
  3184. n.prototype.onMouseMove = function(e) {
  3185. e.preventDefault(),
  3186. this.activeControl && this.activeControl.onMouseMove(e)
  3187. }
  3188. ,
  3189. n.prototype.onMouseUp = function(e) {
  3190. e.preventDefault(),
  3191. this.activeControl && this.activeControl.onMouseUp(e)
  3192. }
  3193. ,
  3194. n.prototype.onMouseOver = function(e) {
  3195. e.preventDefault(),
  3196. this.activeControl && this.activeControl.onMouseOver(e)
  3197. }
  3198. ,
  3199. n.prototype.onMouseWheel = function(e) {
  3200. e.preventDefault(),
  3201. this.activeControl && this.activeControl.onMouseWheel(e)
  3202. }
  3203. ,
  3204. n.prototype.onTouchStart = function(e) {
  3205. e.preventDefault(),
  3206. this.activeControl && this.activeControl.onTouchStart(e);
  3207. var hotList = $('#hotListWrap')[0];
  3208. hotList.classList.remove('hotListActive');
  3209. $('#hotListContent ul .active').removeClass('active');
  3210. $('#hotList')[0].classList.remove('active')
  3211. }
  3212. ,
  3213. n.prototype.onTouchMove = function(e) {
  3214. e.preventDefault(),
  3215. this.activeControl && this.activeControl.onTouchMove(e)
  3216. }
  3217. ,
  3218. n.prototype.onTouchEnd = function(e) {
  3219. e.preventDefault(),
  3220. this.activeControl && this.activeControl.onTouchEnd(e)
  3221. }
  3222. ,
  3223. n.prototype.onPointerDown = function(e) {
  3224. if (e.preventDefault(),
  3225. this.activeControl)
  3226. switch (e.pointerType) {
  3227. case "mouse":
  3228. this.activeControl.onMouseDown(e);
  3229. break;
  3230. default:
  3231. this.activeControl.onPointerDown(e)
  3232. }
  3233. }
  3234. ,
  3235. n.prototype.onPointerMove = function(e) {
  3236. if (e.preventDefault(),
  3237. this.activeControl)
  3238. switch (e.pointerType) {
  3239. case "mouse":
  3240. this.activeControl.onMouseMove(e);
  3241. break;
  3242. default:
  3243. this.activeControl.onPointerMove(e)
  3244. }
  3245. }
  3246. ,
  3247. n.prototype.onPointerUp = function(e) {
  3248. if (e.preventDefault(),
  3249. this.activeControl)
  3250. switch (e.pointerType) {
  3251. case "mouse":
  3252. this.activeControl.onMouseUp(e);
  3253. break;
  3254. default:
  3255. this.activeControl.onPointerUp(e)
  3256. }
  3257. }
  3258. ,
  3259. n.prototype.onPointerCancel = function(e) {
  3260. e.preventDefault(),
  3261. this.activeControl && "mouse" !== e.pointerType && this.activeControl.onPointerUp(e)
  3262. }
  3263. ,
  3264. n.prototype.onKeyDown = function(e) {
  3265. e.metaKey || e.ctrlKey || (e.preventDefault(),
  3266. this.activeControl && this.activeControl.onKeyDown(e))
  3267. }
  3268. ,
  3269. n.prototype.onKeyUp = function(e) {
  3270. e.preventDefault(),
  3271. this.activeControl && this.activeControl.onKeyUp(e)
  3272. }
  3273. ,
  3274. t.exports = n
  3275. }
  3276. , {
  3277. "../cameras/DollhouseCamera": 5,
  3278. "../cameras/FloorplanCamera": 6,
  3279. "../cameras/PanoramaCamera": 7,
  3280. "../enum/ControlEvents": 21,
  3281. "../enum/ModelManagerEvents": 33,
  3282. "../enum/Viewmode": 51,
  3283. "../settings": 166,
  3284. "./DollhouseControls": 10,
  3285. "./FloorplanControls": 11,
  3286. "./PanoramaControls": 13,
  3287. events: 202
  3288. }],
  3289. 10: [function(e, t, i) {
  3290. "use strict";
  3291. function n(e) {
  3292. a.call(this, e),
  3293. this.minPolarAngle = o.dollhouseDefault.minPolarAngle,
  3294. this.maxPolarAngle = o.dollhouseDefault.maxPolarAngle,
  3295. this.minDistance = o.dollhouseDefault.minDistance,
  3296. this.maxDistance = o.dollhouseDefault.maxDistance,
  3297. this.adjustedMinDistance = this.minDistance,
  3298. this.adjustedMaxDistance = this.maxDistance
  3299. }
  3300. var r = e("three")
  3301. , o = e("../settings")
  3302. , a = e("./OutsideControls");
  3303. n.prototype = Object.create(a.prototype),
  3304. n.prototype.pan = function(e, t) {
  3305. this.camera.updateMatrix();
  3306. var i = this.camera.position.clone().sub(this.target).length();
  3307. i *= Math.tan(this.camera.fov / 2 * Math.PI / 180),
  3308. this.panLeft(2 * e * i / $("#player").height()),
  3309. this.panUp(-2 * t * i / $("#player").height())
  3310. }
  3311. ,
  3312. n.prototype.updateZoom = function() {
  3313. var e = this.offset.length();
  3314. return e * this.scale
  3315. }
  3316. ,
  3317. n.prototype.setZoomBounds = function(e) {
  3318. var t = e.min.distanceTo(e.max);
  3319. this.adjustedMinDistance = Math.max(Math.min(t / 2, o.dollhouseDefault.minDistance), 0),
  3320. this.adjustedMaxDistance = Math.min(Math.max(t, o.dollhouseDefault.maxDistance), o.skyboxRadius),
  3321. this.minDistance = this.adjustedMinDistance,
  3322. this.maxDistance = this.adjustedMaxDistance
  3323. }
  3324. ,
  3325. n.prototype.resetRanges = function(e, t) {
  3326. e ? (this.minDistance = Math.min(e, this.minDistance),
  3327. this.maxDistance = Math.max(e, this.maxDistance)) : (this.minDistance = this.adjustedMinDistance,
  3328. this.maxDistance = this.adjustedMaxDistance),
  3329. t ? (this.minPolarAngle = r.Math.degToRad(-15),
  3330. this.maxPolarAngle = r.Math.degToRad(89.9)) : (this.minPolarAngle = o.dollhouseDefault.minPolarAngle,
  3331. this.maxPolarAngle = o.dollhouseDefault.maxPolarAngle)
  3332. }
  3333. ,
  3334. n.prototype.toJSON = function() {
  3335. return a.prototype.toJSON.call(this)
  3336. }
  3337. ,
  3338. t.exports = n
  3339. }
  3340. , {
  3341. "../settings": 166,
  3342. "./OutsideControls": 12,
  3343. three: 217
  3344. }],
  3345. 11: [function(e, t, i) {
  3346. "use strict";
  3347. function n(e) {
  3348. a.call(this, e),
  3349. this.minDistance = 15,
  3350. this.maxDistance = 50,
  3351. this.noRotateUpDown = !0,
  3352. this.minPolarAngle = 0,
  3353. this.maxPolarAngle = 0,
  3354. this.mouseActions[l.LEFT] = s.PAN,
  3355. this.mouseActions[l.MIDDLE] = s.DOLLY,
  3356. this.mouseActions[l.RIGHT] = s.ROTATE,
  3357. this.touchActions[1] = s.PAN,
  3358. this.touchActions[2] = s.ROTATE_DOLLY,
  3359. this.absoluteScale = 1,
  3360. this.currentScale = 1
  3361. }
  3362. var r = e("three")
  3363. , o = e("../settings")
  3364. , a = e("./OutsideControls")
  3365. , s = e("../enum/ControlActions")
  3366. , l = e("../enum/MouseButton")
  3367. , c = e("../util/math")
  3368. , h = e("../util/browser");
  3369. n.prototype = Object.create(a.prototype),
  3370. n.prototype.zoomToContain = function(e) {
  3371. this.absoluteScale = this.getDefaultAbsoluteScale(e);
  3372. this.currentScale = this.absoluteScale
  3373. }
  3374. ,
  3375. n.prototype.getDefaultAbsoluteScale = function(modelSize, ratio) {
  3376. let defaultRatio = 1.2 , absoluteScale
  3377. if(_settings.floorPlanAngle){//指定了角度的话,就和browser.aspectRatio()无关,总使用纵向
  3378. var angle = parseFloat(_settings.floorPlanAngle)
  3379. modelSize = modelSize.clone().applyEuler(new THREE.Euler(0, angle, 0))
  3380. var n = Math.max(Math.abs(modelSize.x), Math.abs(modelSize.z) * this.camera.aspect) //视口宽高比 >= 1 情况下,模型所占最大视口尺寸
  3381. var screenSize = Math.min($("#player").width(), $("#player").height())
  3382. var maxSize = 800;//模型最大占据像素
  3383. ratio = ratio != void 0 ? ratio : Math.max(screenSize * defaultRatio / maxSize, defaultRatio) ;
  3384. absoluteScale = n / 2 / o.orthoBase * ratio; //根据模型所占最大视口尺寸调整缩放
  3385. }else{
  3386. var t = Math.max(modelSize.x, modelSize.z)
  3387. , i = Math.min(modelSize.x, modelSize.z)
  3388. , n = Math.max(t, i * this.camera.aspect)
  3389. , r = Math.max(i, t * this.camera.aspect);
  3390. absoluteScale = (h.aspectRatio() < 1 ? r : n) / 2 / o.orthoBase * defaultRatio
  3391. }
  3392. return absoluteScale
  3393. },
  3394. /* n.prototype.rotateToView = function(e, t) {
  3395. var i = 0
  3396. , n = h.aspectRatio() < 1
  3397. , r = e.x < e.z;
  3398. n === r ? t.z > 0 && (i = Math.PI) : i = t.x > 0 ? Math.PI / 2 : -Math.PI / 2,
  3399. this.rotateLeft(i),
  3400. this.update(0)
  3401. },
  3402. */
  3403. n.prototype.rotateToView = function(modelSize, direction) {
  3404. let i = 0, n = h.aspectRatio() < 1 //是否模型尺寸显“细长”
  3405. if(_settings.floorPlanAngle ){//规定了cadImage旋转值的话 (0是无效的,将不设置)
  3406. i = parseFloat(_settings.floorPlanAngle)
  3407. }else{
  3408. let r = modelSize.x < modelSize.z; //是否视口为“窄屏”
  3409. if(n === r) //“细长” 且 “窄屏”,说明模型尺寸比例与视口比例匹配,相机坐标只需要调转“前”“后”
  3410. {
  3411. if(direction.z > 0) //(第一种情况)相机是否位于背面。 注:在默认情况下webgl的相机朝向-z, direction.z > 0 说明相机视野已经偏向+z,说明相机位于模型“背面”
  3412. {
  3413. i = Math.PI; //经度上做180度轨道角位移,使相机移到静止模型的“前面”
  3414. }
  3415. //(第二种情况) 不做处理
  3416. }
  3417. else if(direction.x > 0)
  3418. {
  3419. i = Math.PI / 2;
  3420. }
  3421. else
  3422. {
  3423. i = -Math.PI / 2;
  3424. }
  3425. }
  3426. this.rotateLeft(i);
  3427. this.update(0);
  3428. }
  3429. ,
  3430. n.prototype.rotateToAngle = function(angle){//add 旋转到特定角度
  3431. this.rotateLeft(angle + this.lon);
  3432. this.update(0);
  3433. }
  3434. ,
  3435. n.prototype.pan = function(e, t) {
  3436. this.camera.updateMatrix(),
  3437. this.panLeft(e * (this.camera.right - this.camera.left) / $("#player").width()),
  3438. this.panUp(-t * (this.camera.top - this.camera.bottom) / $("#player").height())
  3439. }
  3440. ,
  3441. n.prototype.updateZoom = function() {
  3442. return this.absoluteScale *= this.scale - .03 * this.keyboardZoomSpeed,
  3443. this.absoluteScale = Math.max(o.zoomNearLimit, Math.min(this.absoluteScale, o.zoomFarLimit)),
  3444. this.currentScale = .8 * this.currentScale + .2 * this.absoluteScale,
  3445. this.camera.left = -o.orthoBase * this.currentScale,
  3446. this.camera.right = o.orthoBase * this.currentScale,
  3447. this.camera.top = o.orthoBase * this.currentScale / this.camera.aspect,
  3448. this.camera.bottom = -o.orthoBase * this.currentScale / this.camera.aspect,
  3449. this.camera.updateProjectionMatrix(),
  3450. this.offset.length()
  3451. }
  3452. ,
  3453. n.prototype.toJSON = function() {
  3454. var e = new r.Quaternion
  3455. , t = (new r.Quaternion).setFromAxisAngle(new r.Vector3(0,1,0), r.Math.degToRad(90))
  3456. , i = new r.Quaternion;
  3457. return function() {
  3458. var n = a.prototype.toJSON.call(this);
  3459. return e.copy(n.camera_quaternion),
  3460. i.copy(t),
  3461. i.multiply(e),
  3462. n.camera_quaternion.x = c.toPrecision(i.x, 4),
  3463. n.camera_quaternion.y = c.toPrecision(i.y, 4),
  3464. n.camera_quaternion.z = c.toPrecision(i.z, 4),
  3465. n.camera_quaternion.w = c.toPrecision(i.w, 4),
  3466. n.ortho_zoom = c.toPrecision(this.currentScale * this.camera.aspect, 4),
  3467. n
  3468. }
  3469. }(),
  3470. t.exports = n
  3471. }
  3472. , {
  3473. "../enum/ControlActions": 20,
  3474. "../enum/MouseButton": 34,
  3475. "../settings": 166,
  3476. "../util/browser": 182,
  3477. "../util/math": 190,
  3478. "./OutsideControls": 12,
  3479. three: 217
  3480. }],
  3481. 12: [function(e, t, i) {
  3482. "use strict";
  3483. function n(e) {
  3484. this.camera = e,
  3485. this.camera.controls = this,
  3486. this.enabled = !1,
  3487. this.target = new r.Vector3,
  3488. this.targetBounds = new r.Box3,
  3489. this.zoomSpeed = 1,
  3490. this.minDistance = 0,
  3491. this.maxDistance = 1 / 0,
  3492. this.noRotateUpDown = !1,
  3493. this.rotateSpeed = 1,
  3494. this.keyboardZoomSpeed = 0,
  3495. this.keyPanSpeed = 7,
  3496. this.autoRotate = !1,
  3497. this.autoRotateSpeed = 2,
  3498. this.autoPan = !1,
  3499. this.autoPanPosition = new r.Vector3,
  3500. this.minPolarAngle = r.Math.degToRad(25),
  3501. this.maxPolarAngle = r.Math.degToRad(65),
  3502. this.rotationAcceleration = new r.Vector2,
  3503. this.rotationSpeed = new r.Vector2,
  3504. this.panAcceleration = new r.Vector2,
  3505. this.panSpeed = new r.Vector2,
  3506. this.rotateStart = new r.Vector2,
  3507. this.rotateEnd = new r.Vector2,
  3508. this.rotateDelta = new r.Vector2,
  3509. this.panStart = new r.Vector2,
  3510. this.panEnd = new r.Vector2,
  3511. this.panDelta = new r.Vector2,
  3512. this.panOffset = new r.Vector3,
  3513. this.offset = new r.Vector3,
  3514. this.dollyStart = new r.Vector2,
  3515. this.dollyEnd = new r.Vector2,
  3516. this.dollyDelta = new r.Vector2,
  3517. this.phiDelta = 0,
  3518. this.thetaDelta = 0,
  3519. this.scale = 1,
  3520. this.panVector = new r.Vector3,
  3521. this.lastPosition = new r.Vector3,
  3522. this.state = c.NONE,
  3523. this.mouseActions = {},
  3524. this.mouseActions[h.LEFT] = c.ROTATE,
  3525. this.mouseActions[h.MIDDLE] = c.DOLLY,
  3526. this.mouseActions[h.RIGHT] = c.PAN,
  3527. this.touchActions = {},
  3528. this.touchActions[1] = c.ROTATE,
  3529. this.touchActions[2] = c.PAN_DOLLY,
  3530. this.lastMoveTime = 0,
  3531. this.pointersLimit = 2,
  3532. this.pointers = []
  3533. }
  3534. var r = e("three")
  3535. , o = e("../settings")
  3536. , a = e("../util/common")
  3537. , s = e("../util/math")
  3538. , l = e("../enum/Vectors")
  3539. , c = e("../enum/ControlActions")
  3540. , h = e("../enum/MouseButton")
  3541. , u = e("../enum/Keys")
  3542. , d = e("../enum/ControlEvents")
  3543. , p = e("events").EventEmitter
  3544. , f = 1e-6;
  3545. n.prototype = Object.create(p.prototype),
  3546. n.prototype.setBounds = function(e) {
  3547. this.targetBounds = e
  3548. }
  3549. ,
  3550. n.prototype.isEngaged = function() {
  3551. return this.state !== c.NONE
  3552. }
  3553. ,
  3554. n.prototype.rotateLeft = function(e) {
  3555. void 0 === e && (e = this.getAutoRotationAngle()),
  3556. this.thetaDelta -= e
  3557. }
  3558. ,
  3559. n.prototype.rotateUp = function(e) {
  3560. this.noRotateUpDown || (void 0 === e && (e = this.getAutoRotationAngle()),
  3561. this.phiDelta -= e)
  3562. }
  3563. ,
  3564. n.prototype.panLeft = function(e) {
  3565. var t = this.camera.matrix.elements;
  3566. this.panOffset.set(t[0], 0, t[2]).normalize(),
  3567. this.panOffset.multiplyScalar(-e),
  3568. this.panVector.add(this.panOffset)
  3569. }
  3570. ,
  3571. n.prototype.panUp = function(e) {
  3572. var t = this.camera.matrix.elements;
  3573. this.panOffset.set(t[4], 0, t[6]).normalize(),
  3574. this.panOffset.multiplyScalar(-e),
  3575. this.panVector.add(this.panOffset)
  3576. }
  3577. ,
  3578. n.prototype.startRotating = function(e, t) {
  3579. e && this.navRotationAcc("x", e),
  3580. t && this.navRotationAcc("y", t)
  3581. }
  3582. ,
  3583. n.prototype.stopRotating = function(e) {
  3584. e && (this.rotationSpeed.x = this.rotationSpeed.y = 0),
  3585. this.navRotationAcc("x", 0),
  3586. this.navRotationAcc("y", 0)
  3587. }
  3588. ,
  3589. n.prototype.setAutoPanPosition = function(e, t) {
  3590. var i = new r.Vector3
  3591. , n = new r.Vector3;
  3592. return function(e, t) {
  3593. i.copy(this.camera.position),
  3594. void 0 === e && null === e || i.setX(e),
  3595. void 0 === t && null === t || i.setZ(t);
  3596. var r = this.camera.position.distanceTo(this.target)
  3597. , o = l.FORWARD.clone().applyQuaternion(this.camera.quaternion);
  3598. this.targetClamped = !1,
  3599. n.copy(i).addScaledVector(o, r),
  3600. this.targetBounds.containsPoint(n) || (this.targetBounds.clampPoint(n, n),
  3601. i.copy(n).addScaledVector(o, -r),
  3602. this.targetClamped = !0),
  3603. this.autoPanPosition.x = i.x,
  3604. this.autoPanPosition.z = i.z,
  3605. this.autoPan && this.stopAutoPanning()
  3606. }
  3607. }(),
  3608. n.prototype.stopAutoPanning = function() {
  3609. var e = this.autoPan;
  3610. this.autoPan = !1,
  3611. this.emit(this.targetClamped ? d.AutoPanClamped : e ? d.AutoPanInterrupt : d.AutoPanComplete)
  3612. }
  3613. ,
  3614. n.prototype.dollyIn = function(e) {
  3615. void 0 === e && (e = this.getZoomScale()),
  3616. this.scale /= e
  3617. }
  3618. ,
  3619. n.prototype.dollyOut = function(e) {
  3620. void 0 === e && (e = this.getZoomScale()),
  3621. this.scale *= e
  3622. }
  3623. ,
  3624. n.prototype.updatePan = function(e) {
  3625. if (this.panSpeed.multiplyScalar(1 - o.panFriction).addScaledVector(this.panAcceleration, o.panAccelerationOutside * e),
  3626. this.pan(-this.panSpeed.x, this.panSpeed.y),
  3627. this.autoPan) {
  3628. var t = (new r.Vector3).copy(this.autoPanPosition).sub(this.camera.position);
  3629. t.setY(0).clampLength(0, 50 * e),
  3630. this.target.add(t),
  3631. this.camera.position.add(t),
  3632. this.autoPanPosition.x === this.camera.position.x && this.autoPanPosition.z === this.camera.position.z && (this.autoPan = !1,
  3633. this.stopAutoPanning())
  3634. }
  3635. }
  3636. ,
  3637. n.prototype.update = function(e) {
  3638. e || (e = 1 / 60),
  3639. this.rotationSpeed.multiplyScalar(1 - o.rotationFriction).addScaledVector(this.rotationAcceleration, o.rotationAccelerationOutside * e),
  3640. this.rotateLeft(-this.rotationSpeed.x),
  3641. this.noRotateUpDown || this.rotateUp(this.rotationSpeed.y),
  3642. this.updatePan(e);
  3643. var t = this.camera.position;
  3644. this.offset.copy(t).sub(this.target);
  3645. var i = Math.atan2(this.offset.x, this.offset.z)
  3646. , n = Math.atan2(Math.sqrt(this.offset.x * this.offset.x + this.offset.z * this.offset.z), this.offset.y);
  3647. this.autoRotate && this.rotateLeft(this.getAutoRotationAngle()),
  3648. i += this.thetaDelta,
  3649. n += this.phiDelta,
  3650. n = Math.max(this.minPolarAngle, Math.min(this.maxPolarAngle, n)),
  3651. n = Math.max(f, Math.min(Math.PI - f, n));
  3652. this.lon = i, this.lat = n//add
  3653. var r = this.updateZoom();
  3654. r = Math.max(this.minDistance, Math.min(this.maxDistance, r)),
  3655. this.target.add(this.panVector),
  3656. this.targetBounds.clampPoint(this.target, this.target),
  3657. this.offset.x = r * Math.sin(n) * Math.sin(i),
  3658. this.offset.y = r * Math.cos(n),
  3659. this.offset.z = r * Math.sin(n) * Math.cos(i),
  3660. t.copy(this.target).add(this.offset),
  3661. this.camera.lookAt(this.target),
  3662. this.thetaDelta = 0,
  3663. this.phiDelta = 0,
  3664. this.scale = 1,
  3665. this.panVector.set(0, 0, 0),
  3666. this.lastPosition.distanceTo(this.camera.position) > 0 && this.lastPosition.copy(this.camera.position)
  3667. }
  3668. ,
  3669. n.prototype.getAutoRotationAngle = function() {
  3670. return 2 * Math.PI / 60 / 60 * this.autoRotateSpeed
  3671. }
  3672. ,
  3673. n.prototype.getZoomScale = function() {
  3674. return Math.pow(.95, this.zoomSpeed)
  3675. }
  3676. ,
  3677. n.prototype.onMouseDown = function(e) {
  3678. if (this.enabled) {
  3679. switch (e.preventDefault(),
  3680. this.stopAutoPanning(),
  3681. this.mouseDown = !0,
  3682. this.state = this.mouseActions[e.button],
  3683. this.state) {
  3684. case c.ROTATE:
  3685. this.rotateStart.set(e.clientX, this.noRotateUpDown ? 0 : e.clientY),
  3686. this.rotationSpeed.set(0, 0);
  3687. break;
  3688. case c.DOLLY:
  3689. this.dollyStart.set(e.clientX, e.clientY);
  3690. break;
  3691. case c.PAN:
  3692. this.panStart.set(e.clientX, e.clientY)
  3693. }
  3694. this.emit(d.InputStart, "mouse")
  3695. }
  3696. }
  3697. ,
  3698. n.prototype.onMouseMove = function(e) {
  3699. if (this.enabled && this.mouseDown && 0 !== e.buttons) {
  3700. switch (e.preventDefault(),
  3701. this.state) {
  3702. case c.ROTATE:
  3703. this.rotateEnd.set(e.clientX, this.noRotateUpDown ? 0 : e.clientY),
  3704. this.rotateDelta.subVectors(this.rotateEnd, this.rotateStart),
  3705. this.rotateLeft(2 * Math.PI * this.rotateDelta.x / $("#player").width() * this.rotateSpeed),
  3706. this.rotateUp(2 * Math.PI * this.rotateDelta.y / $("#player").height() * this.rotateSpeed),
  3707. this.rotateStart.copy(this.rotateEnd);
  3708. break;
  3709. case c.DOLLY:
  3710. this.dollyEnd.set(e.clientX, e.clientY),
  3711. this.dollyDelta.subVectors(this.dollyEnd, this.dollyStart);
  3712. var t = this.dollyDelta.y > 0 ? this.dollyIn : this.dollyOut;
  3713. t.call(this),
  3714. this.dollyStart.copy(this.dollyEnd);
  3715. break;
  3716. case c.PAN:
  3717. this.panEnd.set(e.clientX, e.clientY),
  3718. this.panDelta.subVectors(this.panEnd, this.panStart),
  3719. this.pan(this.panDelta.x, this.panDelta.y),
  3720. this.panStart.copy(this.panEnd)
  3721. }
  3722. this.emit(d.Move, "mouse"),
  3723. this.lastMoveTime = e.timeStamp,
  3724. this.update()
  3725. }
  3726. }
  3727. ,
  3728. n.prototype.onMouseUp = function(e) {
  3729. this.enabled && (this.mouseDown = !1,
  3730. this.state = c.NONE,
  3731. "mouseover" !== e.type && (e.timeStamp > this.lastMoveTime + 100 ? (this.rotationSpeed.set(0, 0),
  3732. this.rotationAcceleration.set(0, 0)) : this.rotationAcceleration.set(-this.rotateDelta.x, this.rotateDelta.y),
  3733. this.update(),
  3734. this.rotationAcceleration.set(0, 0),
  3735. this.rotateDelta.set(0, 0)))
  3736. }
  3737. ,
  3738. n.prototype.onMouseOver = function(e) {
  3739. 0 !== e.which && 0 !== e.buttons || this.onMouseUp(e)
  3740. }
  3741. ,
  3742. n.prototype.onMouseWheel = function(e) {
  3743. if (this.enabled && o.useWheel) {
  3744. this.emit(d.Move, "wheel");
  3745. var t = e.wheelDelta || -e.detail
  3746. , i = t > 0 ? this.dollyOut : this.dollyIn;
  3747. i.call(this),
  3748. this.update()
  3749. }
  3750. }
  3751. ,
  3752. n.prototype.onKeyDown = function(e) {
  3753. this.enabled && (e.metaKey || e.ctrlKey || (e.preventDefault(),
  3754. this.handleKeyDown(e.which)))
  3755. }
  3756. ,
  3757. n.prototype.navRotationAcc = function(e, t) {
  3758. "y" === e ? this.noRotateUpDown ? this.keyboardZoomSpeed = t : this.rotationAcceleration.y = t : this.rotationAcceleration.x = t
  3759. }
  3760. ,
  3761. n.prototype.navPanAcc = function(e, t) {
  3762. this.stopAutoPanning(),
  3763. this.panAcceleration[e] = t
  3764. }
  3765. ,
  3766. n.prototype.handleKeyDown = function(e) {
  3767. var t = !0;
  3768. switch (e) {
  3769. case u.UPARROW:
  3770. case u.I:
  3771. this.navRotationAcc("y", 1);
  3772. break;
  3773. case u.DOWNARROW:
  3774. case u.K:
  3775. this.navRotationAcc("y", -1);
  3776. break;
  3777. case u.LEFTARROW:
  3778. case u.J:
  3779. this.navRotationAcc("x", -1);
  3780. break;
  3781. case u.RIGHTARROW:
  3782. case u.L:
  3783. this.navRotationAcc("x", 1);
  3784. break;
  3785. case u.W:
  3786. this.navPanAcc("y", 1);
  3787. break;
  3788. case u.S:
  3789. this.navPanAcc("y", -1);
  3790. break;
  3791. case u.A:
  3792. this.navPanAcc("x", -1);
  3793. break;
  3794. case u.D:
  3795. this.navPanAcc("x", 1);
  3796. break;
  3797. default:
  3798. t = !1
  3799. }
  3800. t && this.emit(d.Move, "key")
  3801. }
  3802. ,
  3803. n.prototype.onKeyUp = function(e) {
  3804. this.enabled && (e.preventDefault(),
  3805. e.stopPropagation(),
  3806. this.handleKeyUp(e.which))
  3807. }
  3808. ,
  3809. n.prototype.handleKeyUp = function(e) {
  3810. switch (e) {
  3811. case u.I:
  3812. case u.K:
  3813. case u.UPARROW:
  3814. case u.DOWNARROW:
  3815. this.keyboardZoomSpeed = 0,
  3816. this.rotationAcceleration.y = 0;
  3817. break;
  3818. case u.J:
  3819. case u.L:
  3820. case u.LEFTARROW:
  3821. case u.RIGHTARROW:
  3822. this.rotationAcceleration.x = 0;
  3823. break;
  3824. case u.S:
  3825. case u.W:
  3826. this.panAcceleration.y = 0;
  3827. break;
  3828. case u.A:
  3829. case u.D:
  3830. this.panAcceleration.x = 0
  3831. }
  3832. }
  3833. ,
  3834. n.prototype.onTouchStart = function(e) {
  3835. if (this.enabled || this.state === c.NONE) {
  3836. e.preventDefault(),
  3837. e.stopPropagation(),
  3838. this.stopAutoPanning();
  3839. var t = function() {
  3840. if (2 === e.touches.length) {
  3841. var t = e.touches[0].pageX - e.touches[1].pageX
  3842. , i = e.touches[0].pageY - e.touches[1].pageY;
  3843. this.dollyStart.set(t, i)
  3844. }
  3845. }
  3846. .bind(this)
  3847. , i = function() {
  3848. this.panStart.set(a.average(e.touches, "pageX"), a.average(e.touches, "pageY"))
  3849. }
  3850. .bind(this)
  3851. , n = function() {
  3852. this.rotateStart.set(a.average(e.touches, "pageX"), a.average(e.touches, "pageY"))
  3853. }
  3854. .bind(this);
  3855. switch (this.state = this.touchActions[e.touches.length],
  3856. this.state) {
  3857. case c.PAN_DOLLY:
  3858. t();
  3859. case c.PAN:
  3860. i();
  3861. break;
  3862. case c.ROTATE_DOLLY:
  3863. t();
  3864. case c.ROTATE:
  3865. n()
  3866. }
  3867. this.rotationSpeed.set(0, 0),
  3868. this.emit(d.InputStart, "touch")
  3869. }
  3870. }
  3871. ,
  3872. n.prototype.onTouchMove = function(e) {
  3873. if (this.enabled && this.state !== c.NONE) {
  3874. e.preventDefault(),
  3875. e.stopPropagation();
  3876. var t = function() {
  3877. var t = e.touches[0].pageX - e.touches[1].pageX
  3878. , i = e.touches[0].pageY - e.touches[1].pageY;
  3879. this.dollyEnd.set(t, i);
  3880. var n = this.dollyStart.length() - this.dollyEnd.length();
  3881. n > 0 ? this.dollyOut(1 + n / 500) : this.dollyIn(1 - n / 500),
  3882. this.dollyStart.copy(this.dollyEnd)
  3883. }
  3884. .bind(this)
  3885. , i = function() {
  3886. this.panEnd.set(a.average(e.touches, "pageX"), a.average(e.touches, "pageY")),
  3887. this.panDelta.subVectors(this.panEnd, this.panStart),
  3888. this.pan(this.panDelta.x, this.panDelta.y),
  3889. this.panStart.copy(this.panEnd),
  3890. this.rotateDelta.set(0, 0)
  3891. }
  3892. .bind(this)
  3893. , n = function() {
  3894. this.rotateEnd.set(a.average(e.touches, "pageX"), a.average(e.touches, "pageY")),
  3895. this.rotateDelta.subVectors(this.rotateEnd, this.rotateStart),
  3896. this.rotateLeft(2 * Math.PI * this.rotateDelta.x / $("#player").width() * this.rotateSpeed),
  3897. this.rotateUp(2 * Math.PI * this.rotateDelta.y / $("#player").height() * this.rotateSpeed),
  3898. this.rotateStart.copy(this.rotateEnd)
  3899. }
  3900. .bind(this)
  3901. , r = function() {
  3902. if (2 === e.touches.length) {
  3903. var i = window.devicePixelRatio || 1
  3904. , r = e.touches[1].pageX - e.touches[0].pageX
  3905. , s = e.touches[1].pageY - e.touches[0].pageY
  3906. , l = Math.sqrt(r * r + s * s)
  3907. , h = Math.abs(this.dollyStart.length() - l);
  3908. if (h > o.input.touchMoveThreshold * i)
  3909. this.state = c.DOLLY,
  3910. t();
  3911. else {
  3912. var u = a.average(e.touches, "pageX")
  3913. , d = a.average(e.touches, "pageY")
  3914. , p = this.rotateDelta.set(u, d).sub(this.rotateStart).length();
  3915. p > o.input.touchMoveThreshold && (this.state = c.ROTATE,
  3916. this.rotateStart.set(u, d),
  3917. n())
  3918. }
  3919. }
  3920. }
  3921. .bind(this);
  3922. switch (this.state) {
  3923. case c.PAN_DOLLY:
  3924. t();
  3925. case c.PAN:
  3926. i();
  3927. break;
  3928. case c.ROTATE_DOLLY:
  3929. r();
  3930. break;
  3931. case c.DOLLY:
  3932. t();
  3933. break;
  3934. case c.ROTATE:
  3935. n();
  3936. break;
  3937. default:
  3938. this.state = c.NONE
  3939. }
  3940. this.lastMoveTime = e.timeStamp,
  3941. this.emit(d.Move, "touch")
  3942. }
  3943. }
  3944. ,
  3945. n.prototype.onTouchEnd = function(e) {
  3946. this.enabled && (this.state === c.ROTATE && (e.timeStamp > this.lastMoveTime + 100 ? (this.rotationSpeed.set(0, 0),
  3947. this.rotationAcceleration.set(0, 0)) : this.rotationAcceleration.set(-this.rotateDelta.x, this.rotateDelta.y)),
  3948. this.state = c.NONE,
  3949. this.update(),
  3950. this.rotationAcceleration.set(0, 0),
  3951. this.rotateDelta.set(0, 0))
  3952. }
  3953. ,
  3954. n.prototype.onPointerDown = function(e) {
  3955. this.enabled && ("touch" === e.pointerType && (this.pointers.length < this.pointersLimit && this.pointers.push({
  3956. id: e.pointerId,
  3957. pageX: e.pageX,
  3958. pageY: e.pageY
  3959. }),
  3960. e.touches = this.pointers,
  3961. this.onTouchStart(e)),
  3962. this.emit(d.InputStart, "pointer"))
  3963. }
  3964. ,
  3965. n.prototype.onPointerMove = function(e) {
  3966. this.enabled && "touch" === e.pointerType && (this.pointers.forEach(function(t) {
  3967. e.pointerId === t.id && (t.pageX = e.pageX,
  3968. t.pageY = e.pageY)
  3969. }),
  3970. e.touches = this.pointers,
  3971. this.onTouchMove(e))
  3972. }
  3973. ,
  3974. n.prototype.onPointerUp = function(e) {
  3975. this.enabled && "touch" === e.pointerType && (this.pointers.forEach(function(t, i) {
  3976. e.pointerId === t.id && this.pointers.splice(i, 1)
  3977. }
  3978. .bind(this)),
  3979. e.touches = this.pointers,
  3980. this.onTouchEnd(e))
  3981. }
  3982. ,
  3983. n.prototype.reset = function() {
  3984. this.state = c.NONE,
  3985. this.stopAutoPanning(),
  3986. this.rotationSpeed.set(0, 0),
  3987. this.rotationAcceleration.set(0, 0),
  3988. this.panSpeed.set(0, 0),
  3989. this.panAcceleration.set(0, 0)
  3990. }
  3991. ,
  3992. n.prototype.toJSON = function() {
  3993. var e = {
  3994. camera_position: {
  3995. x: s.toPrecision(this.camera.position.x, 4),
  3996. y: s.toPrecision(this.camera.position.y, 4),
  3997. z: s.toPrecision(this.camera.position.z, 4)
  3998. },
  3999. camera_quaternion: {
  4000. x: s.toPrecision(this.camera.quaternion.x, 4),
  4001. y: s.toPrecision(this.camera.quaternion.y, 4),
  4002. z: s.toPrecision(this.camera.quaternion.z, 4),
  4003. w: s.toPrecision(this.camera.quaternion.w, 4)
  4004. }
  4005. };
  4006. return e
  4007. }
  4008. ,
  4009. t.exports = n
  4010. }
  4011. , {
  4012. "../enum/ControlActions": 20,
  4013. "../enum/ControlEvents": 21,
  4014. "../enum/Keys": 30,
  4015. "../enum/MouseButton": 34,
  4016. "../enum/Vectors": 50,
  4017. "../settings": 166,
  4018. "../util/common": 185,
  4019. "../util/math": 190,
  4020. events: 202,
  4021. three: 217
  4022. }],
  4023. 13: [function(e, t, i) {
  4024. (function(i) {
  4025. "use strict";
  4026. function n(e) {
  4027. this.camera = e,
  4028. this.camera.controls = this,
  4029. this.target = new r.Vector3(0,0,0),
  4030. this.lookVector = new r.Vector3,
  4031. this.lookSpeed = .05,
  4032. this.rotationAcc = new r.Vector2,
  4033. this.rotationSpeed = new r.Vector2,
  4034. this.lat = 0,
  4035. this.lon = 0,
  4036. this.phi = 0,
  4037. this.theta = 0,
  4038. this.enabled = !1,
  4039. this.locked = !1,
  4040. this.pointer = new r.Vector2(0,0),
  4041. this.rotationHistory = [],
  4042. this.rotationDifference = new r.Vector2,
  4043. this.pointerDragOn = !1,
  4044. this.pointerDragStart = new r.Vector2(0,0),
  4045. this.pinchDistance = 0,
  4046. this.moveStart = new r.Vector2,
  4047. this.moveTolerance = .01,
  4048. this.pointersLimit = 2,
  4049. this.pointers = []
  4050. }
  4051. var r = e("three")
  4052. , o = e("../util/logger")
  4053. , a = e("../settings")
  4054. , s = e("../util/common")
  4055. , l = e("../util/math")
  4056. , c = (e("../enum/Vectors"),
  4057. e("../enum/MouseButton"))
  4058. , h = e("../enum/Keys")
  4059. , u = e("../enum/ControlEvents")
  4060. , d = e("events").EventEmitter;
  4061. new o(i);
  4062. n.prototype = Object.create(d.prototype),
  4063. n.prototype.usable = function() {
  4064. return this.enabled && !this.locked
  4065. }
  4066. ,
  4067. /* n.prototype.lookAt = function(e) {
  4068. var t = this.camera.position.clone().sub(e)
  4069. , i = Math.atan(t.z / t.x);
  4070. i += t.x < 0 ? Math.PI : 0,
  4071. i += t.x > 0 && t.z < 0 ? 2 * Math.PI : 0,
  4072. this.lon = r.Math.radToDeg(i) + 180;
  4073. var n = Math.sqrt(t.x * t.x + t.z * t.z)
  4074. , o = Math.atan(t.y / n);
  4075. this.lat = -r.Math.radToDeg(o)
  4076. }
  4077. */
  4078. n.prototype.lookAt = function(aim, dir) {
  4079. var t = dir || this.camera.position.clone().sub(aim); //aim所指点的笛卡尔坐标系
  4080. var i = Math.atan(t.z / t.x);
  4081. i += t.x < 0 ? Math.PI : 0;
  4082. i += t.x > 0 && t.z < 0 ? 2 * Math.PI : 0;
  4083. this.lon = r.Math.radToDeg(i) + 180;
  4084. var n = Math.sqrt(t.x * t.x + t.z * t.z),
  4085. o = Math.atan(t.y / n);
  4086. this.lat = -r.Math.radToDeg(o);
  4087. }
  4088. ,
  4089. n.prototype.startRotationFrom = function(e, t) {
  4090. l.convertScreenPositionToNDC(e, t, this.pointer),
  4091. this.pointerDragOn = !0,
  4092. this.pointerDragStart.copy(this.pointer),
  4093. this.moveStart.copy(this.pointer),
  4094. this.rotationHistory = [],
  4095. this.rotationSpeed.set(0, 0)
  4096. }
  4097. ,
  4098. n.prototype.onMouseOver = function(e) {
  4099. !this.pointerDragOn || 0 !== e.which && 0 !== e.buttons || this.onMouseUp(e)
  4100. }
  4101. ,
  4102. n.prototype.onTouchStart = function(e) {
  4103. if (this.usable()) {
  4104. switch (e.preventDefault(),
  4105. e.stopPropagation(),
  4106. e.touches.length) {
  4107. case 1:
  4108. this.startRotationFrom(e.touches[0].clientX, e.touches[0].clientY);
  4109. break;
  4110. case 2:
  4111. var t = (e.touches[0].clientX - e.touches[1].clientX) / $("#player").width()
  4112. , i = (e.touches[0].clientY - e.touches[1].clientY) / $("#player").height();
  4113. this.pinchDistance = Math.sqrt(t * t + i * i)
  4114. }
  4115. this.emit(u.InputStart, "touch")
  4116. }
  4117. }
  4118. ,
  4119. n.prototype.onPointerDown = function(e) {
  4120. this.usable() && "touch" === e.pointerType && (this.pointers.length < this.pointersLimit && this.pointers.push({
  4121. id: e.pointerId,
  4122. clientX: e.clientX,
  4123. clientY: e.clientY
  4124. }),
  4125. e.touches = this.pointers,
  4126. this.onTouchStart(e),
  4127. this.emit(u.InputStart, "pointer"))
  4128. }
  4129. ,
  4130. n.prototype.onMouseDown = function(e) {
  4131. if (this.usable()) {
  4132. switch (e.preventDefault(),
  4133. e.stopPropagation(),
  4134. e.button) {
  4135. case c.LEFT:
  4136. this.startRotationFrom(e.clientX, e.clientY)
  4137. }
  4138. this.emit(u.InputStart, "mouse")
  4139. }
  4140. }
  4141. ,
  4142. n.prototype.updateRotation = function() {
  4143. if (this.usable() && this.pointerDragOn) {
  4144. var e = new r.Vector3(this.pointerDragStart.x,this.pointerDragStart.y,-1).unproject(this.camera)
  4145. , t = new r.Vector3(this.pointer.x,this.pointer.y,-1).unproject(this.camera)
  4146. , i = Math.sqrt(e.x * e.x + e.z * e.z)
  4147. , n = Math.sqrt(t.x * t.x + t.z * t.z)
  4148. , o = Math.atan2(e.y, i)
  4149. , a = Math.atan2(t.y, n);
  4150. this.rotationDifference.y = r.Math.radToDeg(o - a),
  4151. e.y = 0,
  4152. t.y = 0;
  4153. var s = Math.acos(e.dot(t) / e.length() / t.length());
  4154. isNaN(s) || (this.rotationDifference.x = r.Math.radToDeg(s),
  4155. this.pointerDragStart.x < this.pointer.x && (this.rotationDifference.x *= -1)),
  4156. this.pointerDragStart.copy(this.pointer)
  4157. }
  4158. }
  4159. ,
  4160. n.prototype.onMouseMove = function(e) {
  4161. this.usable() && (l.convertScreenPositionToNDC(e.clientX, e.clientY, this.pointer),
  4162. 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"))
  4163. }
  4164. ,
  4165. n.prototype.onTouchMove = function(e) {
  4166. if (this.usable())
  4167. switch (this.emit(u.Move, "touch"),
  4168. e.touches.length) {
  4169. case 1:
  4170. l.convertScreenPositionToNDC(e.touches[0].clientX, e.touches[0].clientY, this.pointer);
  4171. break;
  4172. case 2:
  4173. var t = (e.touches[0].clientX - e.touches[1].clientX) / $("#player").width()
  4174. , i = (e.touches[0].clientY - e.touches[1].clientY) / $("#player").height()
  4175. , n = this.pinchDistance - Math.sqrt(t * t + i * i);
  4176. Math.abs(n) > .01 && (this.emit(u.InteractionDirect),
  4177. this.emit(u.Pinch, n),
  4178. this.pinchDistance -= n)
  4179. }
  4180. }
  4181. ,
  4182. n.prototype.onPointerMove = function(e) {
  4183. this.usable() && "touch" === e.pointerType && (this.pointers.forEach(function(t) {
  4184. e.pointerId === t.id && (t.clientX = e.clientX,
  4185. t.clientY = e.clientY)
  4186. }),
  4187. e.touches = this.pointers,
  4188. this.onTouchMove(e))
  4189. }
  4190. ,
  4191. n.prototype.endRotation = function() {
  4192. this.pointerDragOn = !1;
  4193. var e = s.averageVectors(this.rotationHistory);
  4194. this.rotationSpeed.set(e.x * a.rotationAfterMoveMultiplier, e.y * a.rotationAfterMoveMultiplier)
  4195. }
  4196. ,
  4197. n.prototype.onTouchEnd = function(e) {
  4198. this.usable() && (e.preventDefault(),
  4199. e.stopPropagation(),
  4200. this.endRotation())
  4201. }
  4202. ,
  4203. n.prototype.onMouseUp = function(e) {
  4204. this.usable() && (e.preventDefault(),
  4205. e.stopPropagation(),
  4206. this.endRotation())
  4207. }
  4208. ,
  4209. n.prototype.onPointerUp = function(e) {
  4210. this.usable() && "touch" === e.pointerType && (this.pointers.forEach(function(t, i) {
  4211. e.pointerId === t.id && this.pointers.splice(i, 1)
  4212. }
  4213. .bind(this)),
  4214. e.touches = this.pointers,
  4215. this.onTouchEnd(e))
  4216. }
  4217. ,
  4218. n.prototype.update = function(e) {
  4219. this.lon,
  4220. this.lat;
  4221. for (this.updateRotation(),
  4222. this.rotationHistory.push(this.rotationDifference.clone()); this.rotationHistory.length > a.rotationAfterMoveHistoryCount; )
  4223. this.rotationHistory.shift();
  4224. this.lon += this.rotationDifference.x,
  4225. this.lat += this.rotationDifference.y,
  4226. this.rotationDifference.set(0, 0),
  4227. this.rotationSpeed.x = this.rotationSpeed.x * (1 - a.rotationFriction) + this.rotationAcc.x * a.rotationAccelerationInside,
  4228. this.rotationSpeed.y = this.rotationSpeed.y * (1 - a.rotationFriction) + this.rotationAcc.y * a.rotationAccelerationInside,
  4229. this.lon += this.rotationSpeed.x * e,
  4230. this.lat += this.rotationSpeed.y * e
  4231. //this.lat = Math.max(a.insideLookLimitDown, Math.min(a.insideLookLimitUp, this.lat)),
  4232. var insideLookLimitDown = a.insideLookLimitDown - a.insideFOV/2 + this.camera.fov / 2
  4233. var insideLookLimitUp = a.insideLookLimitUp + a.insideFOV/2 - this.camera.fov / 2
  4234. this.lat = Math.max(insideLookLimitDown, Math.min(insideLookLimitUp, this.lat)); //通过预定义的俯仰角最大最小范围(insideLookLimitUp、insideLookLimitDown)来限制俯仰角。 注:这种数学计算很常见,因此API也很常见(clamp),等价于 this.lat = THREE.Math.clamp( this.lat, settings.insideLookLimitDown, settings.insideLookLimitUp );
  4235. this.phi = r.Math.degToRad(90 - this.lat),
  4236. this.theta = r.Math.degToRad(this.lon),
  4237. this.lookVector.x = Math.sin(this.phi) * Math.cos(this.theta),
  4238. this.lookVector.y = Math.cos(this.phi),
  4239. this.lookVector.z = Math.sin(this.phi) * Math.sin(this.theta),
  4240. this.target.copy(this.lookVector).add(this.camera.position),
  4241. this.camera.lookAt(this.target)
  4242. }
  4243. ,
  4244. n.prototype.onMouseWheel = function(e) {
  4245. if (this.usable()) {
  4246. var t = e.wheelDelta || -e.detail;
  4247. this.emit(u.InteractionDirect),
  4248. this.emit(u.Scroll, t)
  4249. }
  4250. }
  4251. ,
  4252. n.prototype.onKeyDown = function(e) {
  4253. this.usable() && (e.metaKey || e.ctrlKey || (e.preventDefault(),
  4254. this.handleKeyDown(e.which)))
  4255. }
  4256. ,
  4257. n.prototype.handleKeyDown = function(e) {
  4258. var t = function(e, t) {
  4259. this.rotationAcc[e] = t
  4260. }
  4261. .bind(this);
  4262. this.emit(u.InteractionKey);
  4263. var i = !0;
  4264. switch (e) {
  4265. case h.LEFTARROW:
  4266. case h.J:
  4267. t("x", -1);
  4268. break;
  4269. case h.RIGHTARROW:
  4270. case h.L:
  4271. t("x", 1);
  4272. break;
  4273. case h.I:
  4274. t("y", 1);
  4275. break;
  4276. case h.K:
  4277. t("y", -1);
  4278. break;
  4279. default:
  4280. i = !1
  4281. }
  4282. i && this.emit(u.Move, "key")
  4283. }
  4284. ,
  4285. n.prototype.onKeyUp = function(e) {
  4286. this.usable() && (e.preventDefault(),
  4287. e.stopPropagation(),
  4288. this.handleKeyUp(e.which))
  4289. }
  4290. ,
  4291. n.prototype.handleKeyUp = function(e) {
  4292. switch (e) {
  4293. case h.LEFTARROW:
  4294. case h.J:
  4295. case h.RIGHTARROW:
  4296. case h.L:
  4297. this.rotationAcc.x = 0;
  4298. break;
  4299. case h.I:
  4300. case h.K:
  4301. this.rotationAcc.y = 0
  4302. }
  4303. }
  4304. ,
  4305. n.prototype.startRotating = function(e, t) {
  4306. e && (this.rotationAcc.x = e),
  4307. t && (this.rotationAcc.y = t)
  4308. }
  4309. ,
  4310. n.prototype.stopRotating = function(e) {
  4311. e && (this.rotationSpeed.x = this.rotationSpeed.y = 0),
  4312. this.rotationAcc.set(0, 0)
  4313. }
  4314. ,
  4315. n.prototype.reset = function() {
  4316. this.pointerDragOn = !1,
  4317. this.rotationAcc.set(0, 0),
  4318. this.rotationSpeed.set(0, 0),
  4319. this.pointers = []
  4320. }
  4321. ,
  4322. n.prototype.toJSON = function() {
  4323. var e = {
  4324. camera_position: {
  4325. x: l.toPrecision(this.camera.position.x, 4),
  4326. y: l.toPrecision(this.camera.position.y, 4),
  4327. z: l.toPrecision(this.camera.position.z, 4)
  4328. },
  4329. camera_quaternion: {
  4330. x: l.toPrecision(this.camera.quaternion.x, 4),
  4331. y: l.toPrecision(this.camera.quaternion.y, 4),
  4332. z: l.toPrecision(this.camera.quaternion.z, 4),
  4333. w: l.toPrecision(this.camera.quaternion.w, 4)
  4334. }
  4335. };
  4336. return e
  4337. }
  4338. ,
  4339. n.prototype.setStateFromJSON = function(e) {
  4340. this.camera.position.copy(e.camera_position),
  4341. this.camera.quaternion.copy(e.camera_quaternion)
  4342. }
  4343. ,
  4344. t.exports = n
  4345. }
  4346. ).call(this, "/js/controls/PanoramaControls.js")
  4347. }
  4348. , {
  4349. "../enum/ControlEvents": 21,
  4350. "../enum/Keys": 30,
  4351. "../enum/MouseButton": 34,
  4352. "../enum/Vectors": 50,
  4353. "../settings": 166,
  4354. "../util/common": 185,
  4355. "../util/logger": 189,
  4356. "../util/math": 190,
  4357. events: 202,
  4358. three: 217
  4359. }],
  4360. 14: [function(e, t, i) {
  4361. (function(i) {
  4362. "use strict";
  4363. var n = e("three")
  4364. , r = e("../enum/Viewmode")
  4365. , o = e("../util/logger")
  4366. , a = new o(i);
  4367. t.exports = {
  4368. serialize: function(e) {
  4369. return encodeURI(JSON.stringify(e))
  4370. },
  4371. deserialize: function(e) {
  4372. function t(e) {
  4373. function t(e, t) {
  4374. return e && "number" == typeof t && !isNaN(t)
  4375. }
  4376. return e.reduce(t, !0)
  4377. }
  4378. try {
  4379. var i = JSON.parse(decodeURI(e))
  4380. , o = {
  4381. mode: r.fromInt(i.camera_mode),
  4382. panoId: i.scan_id,
  4383. position: (new n.Vector3).copy(i.camera_position),
  4384. quaternion: (new n.Quaternion).copy(i.camera_quaternion),
  4385. zoom: i.ortho_zoom,
  4386. floorVisibility: i.floor_visibility
  4387. }
  4388. , s = o.position;
  4389. t([s.x, s.y, s.z]) || o.position.set(0, 0, 0);
  4390. var l = o.quaternion;
  4391. return t([l.x, l.y, l.z, l.w]) || o.quaternion.set(0, 0, 0, 1),
  4392. o
  4393. } catch (i) {
  4394. a.debug("Not able to parse start location as JSON; falling back to old array style parsing");
  4395. try {
  4396. var c = e.split(",")
  4397. , h = {
  4398. x: parseFloat(c[2]),
  4399. y: parseFloat(c[3]),
  4400. z: parseFloat(c[4])
  4401. }
  4402. , u = {
  4403. x: parseFloat(c[5]),
  4404. y: parseFloat(c[6]),
  4405. z: parseFloat(c[7]),
  4406. w: parseFloat(c[8])
  4407. };
  4408. return t([h.x, h.y, h.z]) || (h.x = 0,
  4409. h.y = 0,
  4410. h.z = 0),
  4411. t([u.x, u.y, u.z, u.w]) || (u.x = 0,
  4412. u.y = 0,
  4413. u.z = 0,
  4414. u.w = 1),
  4415. {
  4416. mode: r.fromInt(c[0]),
  4417. panoId: c[1],
  4418. position: (new n.Vector3).copy(h),
  4419. quaternion: (new n.Quaternion).copy(u)
  4420. }
  4421. } catch (t) {
  4422. a.warn('Invalid start override, ignoring: "' + e + '"', t.message)
  4423. }
  4424. }
  4425. return null
  4426. }
  4427. }
  4428. }
  4429. ).call(this, "/js/controls/serializer.js")
  4430. }
  4431. , {
  4432. "../enum/Viewmode": 51,
  4433. "../util/logger": 189,
  4434. three: 217
  4435. }],
  4436. 15: [function(e, t, i) {
  4437. (function(i) {
  4438. "use strict";
  4439. function n() {
  4440. this.endlessLoop = a.warp.loop,
  4441. this.clock = new r.Clock(!0),
  4442. this.model = null,
  4443. this.player = null,
  4444. this.currentItem = null,
  4445. this.destinationItem = null,
  4446. this.tourIsPlaying = !1,
  4447. this.transitionStage = y.None,
  4448. this.nextFunc = null,
  4449. this.onTheBus = !1,
  4450. this.tourInProgress = !1,
  4451. this.reachSource = null,
  4452. this.interrupted = !1,
  4453. this.nItems = 0,
  4454. this.walkingSectionPaused = !1
  4455. }
  4456. var r = e("three")
  4457. , o = e("./util/logger")
  4458. , a = e("./settings")
  4459. , s = e("./util/transitions")
  4460. , l = e("events").EventEmitter
  4461. , c = e("./enum/Viewmode")
  4462. , h = e("./analytics")
  4463. , u = e("./enum/WarpStyle")
  4464. , s = e("./util/transitions")
  4465. , d = (e("./model/ModelManager"),
  4466. e("./enum/ModelManagerEvents"))
  4467. , p = e("./enum/DirectorEvents")
  4468. , f = e("./enum/PlayerEvents")
  4469. , g = (e("./enum/ControlEvents"),
  4470. e("./enum/BlackoutStyle"))
  4471. , m = e("./enum/PathDiscardMode")
  4472. , v = e("./enum/PathDisplayMode")
  4473. , A = (e("./player"),
  4474. new o(i))
  4475. , y = Object.freeze({
  4476. None: 0,
  4477. Moving: 1,
  4478. Aiming: 2,
  4479. Interlude: 3
  4480. })
  4481. , C = Object.freeze({
  4482. Forward: 1,
  4483. NoChange: 0,
  4484. Backwards: -1
  4485. })
  4486. , I = s.getUniqueId();
  4487. n.prototype = Object.create(l.prototype),
  4488. n.prototype.init = function(e, t) {
  4489. this.player = e,
  4490. this.modelManager = t,
  4491. this.updateModel(),
  4492. this.resetAll(),
  4493. this.bindEvents()
  4494. }
  4495. ,
  4496. n.prototype.resetAll = function() {
  4497. if (this.currentItem = null,
  4498. this.destinationItem = null,
  4499. this.tourIsPlaying = !1,
  4500. //this.bgmReplay(),//xzw
  4501. this.transitionStage = y.None,
  4502. this.nextFunc = null,
  4503. this.onTheBus = !1,
  4504. this.reachSource = null,
  4505. this.interrupted = !1,
  4506. this.model) {
  4507. var e = a.path.typ === u.WALK ? u.WALK : u.STD;
  4508. this.defaultWarpStyle = this.model.data.hasOwnProperty("player_options") && this.model.data.player_options && this.model.data.player_options.fast_transitions === !1 ? e : u.BLACK
  4509. } else
  4510. this.defaultWarpStyle = u.BLACK,
  4511. A.warn('No model yet, choosing "' + this.defaultWarpStyle + '" transitions');
  4512. this.resetSpecialTransition()
  4513. }
  4514. ,
  4515. n.prototype.updateModel = function() {
  4516. this.model = this.modelManager.getActiveModel(),
  4517. this.nItems = this.model.heroLocations.length
  4518. }
  4519. ,
  4520. n.prototype.bindEvents = function() {
  4521. this.modelManager.on(d.ActiveModelChanged, this.updateModel.bind(this)),
  4522. this.player.on(f.WarpInterruptedWithFlyTo, this.checkAndHandleWalkingtourInterruption.bind(this)),
  4523. this.player.on(f.Move, this.handlePlayerMove.bind(this)),
  4524. this.player.on(f.PanoChosen, this.handlePlayerPanoChosen.bind(this)),
  4525. this.player.on(f.ModeChanged, this.handlePlayerModeChanged.bind(this)),
  4526. this.player.on(f.InputStart, this.handlePlayerInputStart.bind(this)),
  4527. this.player.on(f.FlyingStarted, this.handlePlayerFlyingStarted.bind(this)),
  4528. this.player.once(f.Move, function() {
  4529. s.cancelById(I)
  4530. })
  4531. }
  4532. ,
  4533. n.prototype.checkAndHandleWalkingtourInterruption = function(e) {//快速停止。 改:去掉判断nextWarpStyle,因为这个属性改乱了,导致点击停止按钮不执行
  4534. return /* e === u.WALK && ( */this.interrupt(g.NONE),
  4535. this.pauseWalkingSection(),
  4536. this.player.fastForwardActivePanoFlight(),
  4537. !0/* ) */
  4538. }
  4539. ,
  4540. n.prototype.handlePlayerMove = function(e) {
  4541. this.transitionStage === y.Interlude && this.interrupt(g.NONE),
  4542. this.emit("update.controls")
  4543. }
  4544. ,
  4545. n.prototype.handlePlayerPanoChosen = function(e, t) {
  4546. this.intermediateState() || e.id === t.id || (this.onTheBus = !1,
  4547. this.emit("update.controls"))
  4548. }
  4549. ,
  4550. n.prototype.handlePlayerModeChanged = function(e, t) {
  4551. this.intermediateState() || e === t || (this.onTheBus = !1,
  4552. this.emit("update.controls"))
  4553. }
  4554. ,
  4555. n.prototype.handlePlayerInputStart = function(e) {
  4556. this.transitionStage === y.Interlude && this.interrupt(g.NONE)
  4557. }
  4558. ,
  4559. n.prototype.handlePlayerFlyingStarted = function() {
  4560. this.clearWalkingSectionPaused()
  4561. }
  4562. ,
  4563. n.prototype.describe = function() {
  4564. return {
  4565. nItems: this.nItems,
  4566. currentItem: this.currentItem,
  4567. destinationItem: this.destinationItem,
  4568. tourIsPlaying: this.tourIsPlaying,
  4569. onTheBus: this.onTheBus,
  4570. endlessLoop: this.endlessLoop,
  4571. viewMode: this.player.mode,
  4572. inTransition: this._inTransition(),
  4573. transitionStage: this.transitionStage,
  4574. tourInProgress: this.tourInProgress
  4575. }
  4576. }
  4577. ,
  4578. n.prototype._inTransition = function() {
  4579. return this.player.flying || this.player.isWarping() || this.player.isWaitingToWarp() || this.player.mode === c.TRANSITIONING || this.tourIsPlaying
  4580. }
  4581. ,
  4582. n.prototype.bounceable = function() {
  4583. var e = this.clock.getDelta();
  4584. return this.isInterrupted() || e < .9 && e > .01 || this.player.flying && !this.player.isWarping()
  4585. }
  4586. ,
  4587. n.prototype.itemCompare = function(item1, item2, type){//add
  4588. if(type == 'equal'){//==
  4589. return item1 && item2 && item1[0] == item2[0] && item1[1] == item2[1]
  4590. }else if(type == 'less'){//<
  4591. return item1 && item2 && (item1[0] < item2[0]) || (item1[0] == item2[0] && item1[1] < item2[1])
  4592. }
  4593. }
  4594. n.prototype.currentMoveDirection = function() {
  4595. //return null === this.currentItem || void 0 === this.currentItem ? y.Forward : this.destinationItem === this.currentItem ? y.NoChange : this.destinationItem > this.currentItem ? y.Forward : y.Backwards
  4596. return null === this.currentItem || void 0 === this.currentItem ? y.Forward : this.itemCompare(this.destinationItem, this.currentItem,'equal') ? y.NoChange : this.itemCompare(this.currentItem, this.destinationItem,'less') ? y.Forward : y.Backwards
  4597. }
  4598. ,
  4599. n.prototype.clearPath = function() {
  4600. this._inTransition() || this.player.path.discardPathObject()
  4601. }
  4602. ,
  4603. n.prototype.allFloors = function() {
  4604. this.model.toggleAllFloors()
  4605. }
  4606. ,
  4607. n.prototype.actionComplete = function(e) {
  4608. if (this.interrupted = !1,
  4609. this.transitionStage = y.None,
  4610. this.resetSpecialTransition(),
  4611. null !== this.destinationItem && this.setCurrentItem(this.destinationItem),
  4612. this.tourIsPlaying || (this.player.disablePreRendering(),
  4613. this.player.mode === c.PANORAMA && this.player.currentPano.isAligned() && this.model.fadePanoMarkers()),
  4614. this.emit("update.controls"),
  4615. this.nextFunc) {
  4616. var t = this.nextFunc;
  4617. this.nextFunc = null,
  4618. t()
  4619. }
  4620. }
  4621. ,
  4622. n.prototype.awaitCompletion = function(e, t) {
  4623. this.nextFunc = t,
  4624. e()
  4625. }
  4626. ,
  4627. n.prototype.updateSuccessFunction = function(e) {
  4628. this.nextFunc = e
  4629. }
  4630. ,
  4631. n.prototype.interrupt = function(e, t) {
  4632. return !!this.wouldInterrupt() && (this.tourIsPlaying && (this.player.zoomEnabled = this.wasZoomEnabled),
  4633. this.tourIsPlaying = !1,
  4634. //this.bgmReplay(),//xzw
  4635. this.interrupted = !0,
  4636. this.nextFunc = null,
  4637. this.emit(p.ActionInterrupted),
  4638. null !== e && void 0 !== e || (e = g.BEGINNING),
  4639. this.player.interruptAndFastForward(e, t),
  4640. !0)
  4641. }
  4642. ,
  4643. n.prototype.wouldInterrupt = function() {
  4644. return this.transitionStage !== y.None
  4645. }
  4646. ,
  4647. n.prototype.intermediateState = function() {
  4648. return this.transitionStage !== y.None
  4649. }
  4650. ,
  4651. n.prototype.isInterrupted = function() {
  4652. return this.interrupted
  4653. }
  4654. ,
  4655. n.prototype.pauseWalkingSection = function() {
  4656. this.walkingSectionPaused = !0
  4657. }
  4658. ,
  4659. n.prototype.clearWalkingSectionPaused = function() {
  4660. this.walkingSectionPaused = !1
  4661. }
  4662. ,
  4663. n.prototype.autoTour = function() {
  4664. var e = Date.now();
  4665. this.model.auxDataPromise.then(function() {
  4666. e = Date.now() - e;
  4667. var t = a.warp.auto
  4668. , i = this.model.data && this.model.data.player_options /* && this.model.data.player_options.highlight_reel */;
  4669. t >= 0 && this.model.heroCount() > 1 && i && s.trigger({
  4670. duration: Math.max(1e3 * Math.min(300, t) - e, 0),
  4671. done: function() {
  4672. this.playTour()
  4673. }
  4674. .bind(this),
  4675. name: "_atr",
  4676. id: I
  4677. })
  4678. }
  4679. .bind(this))
  4680. }
  4681. ,
  4682. n.prototype.atDestinationPano = function() {
  4683. if (!this.player.currentPano || null === this.destinationItem)
  4684. return !1;
  4685. var e = this.player.currentPano.id;
  4686. if (void 0 === e)
  4687. return !1;
  4688. var t = this.model.heroLocations;
  4689. //return null !== this.destinationItem && void 0 !== t[this.destinationItem] && e === t[this.destinationItem].panoId
  4690. var destination = this.destinationItem && this.model.getHeroDescriptorByIndex(this.destinationItem)
  4691. return destination && destination.panoId == e
  4692. }
  4693. ,
  4694. n.prototype.redirectToItem = function(e, t) {
  4695. if (null === e || void 0 === e)
  4696. return void A.warn("Director.redirectToItem() -> Redirecting to null item.");
  4697. if (!this.wouldInterrupt())
  4698. return void A.warn("Director.redirectToItem() -> Director cannot redirect if there is nothing to interrupt.");
  4699. if (this.player.mode === c.TRANSITIONING)
  4700. return void A.debug("Director.redirectToItem() -> Cannot redirect while transitioning.");
  4701. A.debug("Director.redirectToItem() -> Redirecting to " + e + " via " + t);
  4702. var i = function() {
  4703. s.setTimeout(function() {
  4704. this.setDestinationItem(e),
  4705. this.goToDestination(!0, g.BEGINNING, a.warp.warpInterruptionRedirectTime, !1)
  4706. }
  4707. .bind(this), 0)
  4708. }
  4709. .bind(this);
  4710. this.interrupt(g.END, 0),
  4711. this.updateSuccessFunction(i)
  4712. }
  4713. ,
  4714. n.prototype.useSpecialTransition = function(e) {
  4715. void 0 !== e && this.defaultWarpStyle !== u.BLACK && A.debug("useSpecialTransition(): " + e),
  4716. this.nextWarpStyle = u.BLACK
  4717. }
  4718. ,
  4719. n.prototype.resetSpecialTransition = function() {
  4720. this.nextWarpStyle = this.defaultWarpStyle
  4721. }
  4722. ,
  4723. n.prototype.arrivedAtDestination = function(e) {
  4724. if (this.player.flying || this.player.isWarping())
  4725. A.warn("Cannot advance to interlude or aiming while player is flying or warping.");
  4726. else {
  4727. this.transitionStage = y.Aiming;
  4728. var t = this.tourIsPlaying ? this.tourInterlude.bind(this, this.nextItem(this.currentItem)) : null;
  4729. this.player.model.fadePanoMarkers(0),
  4730. this.awaitCompletion(function() {
  4731. this.resetSpecialTransition(),
  4732. e ? this.player.aimTourCamera(this.destinationItem, v.Retain, v.Slow, this.actionComplete.bind(this)) : this.actionComplete()
  4733. }
  4734. .bind(this), t)
  4735. }
  4736. }
  4737. ,
  4738. n.prototype.goToDestination = function(e, t, i, n) {
  4739. //音频
  4740. var musicInfo = this.model.heroLocations[this.destinationItem[0]].musicInfo
  4741. if(musicInfo && musicInfo.music){
  4742. let src = musicInfo.music.includes(g_Prefix.slice(-10)) ? musicInfo.music : g_Prefix + musicInfo.music;
  4743. let audioObj = SoundManager.list.find(e=>e.name == 'tour')
  4744. let audioSrc1 = common.getFileNameFromUrl(audioObj.src);
  4745. let audioSrc2 = common.getFileNameFromUrl(src)
  4746. if(audioSrc1 == audioSrc2){//应该是继续播放该folder
  4747. if(this.destinationItem[1] == 0){//从头开始播放 因为可能暂停后然后再点该缩略图播
  4748. SoundManager.play('tour',null,0) // currentTime = 0;
  4749. }else if( audioObj.audio.paused && audioObj.audio.currentTime < audioObj.audio.duration ){//未播完
  4750. SoundManager.play('tour')//继续播。为什么会有暂停的情况?如果手动切换到bgm了呢?
  4751. }
  4752. }else{//很可能是该folder的起始
  4753. SoundManager.play('tour', manage.dealURL(src))
  4754. }
  4755. }
  4756. if (this.onTheBus = !0,
  4757. this.emit("update.controls"),
  4758. this.player.updateLastView(),
  4759. !n && this.atDestinationPano()){
  4760. /*
  4761. // 原地旋转时, 写到_warpCameraAim里,因那有时间
  4762. var r = this.model.getHeroDescriptorByIndex(this.destinationItem)
  4763. if(r.zoom && r.zoom != this.player.zoomLevel){//add
  4764. this.player.smoothZoomFovTo(null, r.zoom, a.warp.teleportTime) //瞬间过渡的时间
  4765. } */
  4766. return void this.arrivedAtDestination(!0);
  4767. }
  4768. if (this.player.flying || this.player.isWarping())
  4769. A.warn("Cannot go to new destination while player is flying or warping.");
  4770. else {
  4771. var r = this.model.getHeroDescriptorByIndex(this.destinationItem)
  4772. , o = null
  4773. , a1 = null;
  4774. if (r.isPano()) {
  4775. //var s = 0 === this.destinationItem || e ? u.BLACK : this.nextWarpStyle;
  4776. //var walk = window.DATA.black ? 'black' : 'walk';
  4777. //若是点击item,直接瞬间过渡。
  4778. var s = e ? 'black' : this.getMomentTour(this.destinationItem) //window.DATA.momentTour || "walk";
  4779. a1 = this.player.warpToPanoByHeroIndex.bind(this.player, this.destinationItem, v.Show, m.Slow, s, true, i, this.actionComplete.bind(this)),
  4780. o = this.arrivedAtDestination.bind(this, !0)
  4781. if(s=='black' && r.zoom && r.zoom != this.player.zoomLevel){//add
  4782. this.player.smoothZoomFovTo(null, r.zoom, a.warp.teleportTime) //瞬间过渡的时间
  4783. }
  4784. } else{
  4785. a1 = this.player.warpToNonPanoByHeroIndex.bind(this.player, this.destinationItem, this.actionComplete.bind(this)),
  4786. o = this.arrivedAtDestination.bind(this, !1);
  4787. }
  4788. this.transitionStage = y.Moving,
  4789. this.model.fadePanoMarkers(0),
  4790. this.awaitCompletion(function() {
  4791. a1();
  4792. }
  4793. .bind(this), o),
  4794. this.emit("update.controls")
  4795. }
  4796. }
  4797. ,
  4798. n.prototype.tourInterlude = function() {
  4799. if (h.trackAlways("reach_highlight", {
  4800. reach_source: this.reachSource
  4801. }),
  4802. this.model.fadePanoMarkers(0),
  4803. this.emit("update.controls"),
  4804. this.tourIsPlaying)
  4805. return this.atEndOfTour() && !this.endlessLoop ? (this.tourInProgress = !1,
  4806. this.stopTour(true),
  4807. this.emit(p.TourEnd),
  4808. void (this.player.mode === c.PANORAMA && this.model.fadePanoMarkers(a.panorama.markerOpacity))) : void this.awaitCompletion(function() {
  4809. this.transitionStage = y.Interlude,
  4810. this.player.tourInterlude(this.nextItem(this.currentItem),this.actionComplete.bind(this))
  4811. }
  4812. .bind(this), this.goNext.bind(this))
  4813. }
  4814. ,
  4815. n.prototype.playTour = function() {
  4816. if (!this.bounceable())
  4817. return this.tourIsPlaying ? void A.info("tour is already playing") : void (this.wouldInterrupt() || (this.player.emit("tour_auto", this.defaultWarpStyle),
  4818. this.tourInProgress = !0,
  4819. this.reachSource = "play",
  4820. this.tourIsPlaying = !0,
  4821. this.wasZoomEnabled = this.player.zoomEnabled,
  4822. this.player.zoomEnabled = !1,
  4823. this.resetSpecialTransition(),
  4824. this.emit("update.controls"),
  4825. this.emit(p.TourStart),
  4826. this.player.enablePreRendering(),
  4827. this.walkingSectionPaused ? (this.clearWalkingSectionPaused(),
  4828. this.goToDestination()) : this.goNext()))
  4829. }
  4830. ,
  4831. /* n.prototype.bgmReplay = function() {//xzw add 结束tour后可能要继续播放背景音乐
  4832. } */
  4833. n.prototype.stopTour = function(isAutoStop) {//停止导览 isAutoStop 希望仅在飞完结束自动停止时的stopTour不停止tourSound, 这样才能完整播放tourSound. 不过似乎会在倒数第二个片段点击按钮停止导览时也视作自动结束的(执行this.interrupt() )。
  4834. this.isInterrupted() || this.transitionStage === y.Moving && this.checkAndHandleWalkingtourInterruption(this.nextWarpStyle) || (this.tourIsPlaying && (this.player.zoomEnabled = this.wasZoomEnabled),
  4835. this.tourIsPlaying = !1,
  4836. this.interrupt(),
  4837. this.clearWalkingSectionPaused(),
  4838. this.resetSpecialTransition(),
  4839. this.emit("update.controls"))
  4840. }
  4841. ,
  4842. n.prototype.endTourProgress = function() {
  4843. this.tourInProgress = !1,
  4844. this.emit("update.controls"),
  4845. this.emit(p.TourEnd)
  4846. }
  4847. ,
  4848. n.prototype.goToHighlight = function(e) {
  4849. if (this.wouldInterrupt())
  4850. this.itemCompare(this.destinationItem,e,'equal') ? this.interrupt() : this.redirectToItem(e, "goToHighlight");
  4851. else {
  4852. if (A.debug("<tour.goto " + e + ">"),
  4853. this.isInterrupted())
  4854. return;
  4855. this.clearWalkingSectionPaused(),
  4856. this.setDestinationItem(e),
  4857. this.useSpecialTransition("Hilight")
  4858. this.goToDestination(true),//add true
  4859. h.trackAlways("reach_highlight", {
  4860. reach_source: "thumb"
  4861. })
  4862. }
  4863. }
  4864. ,
  4865. n.prototype.prevHighlight = function() {
  4866. this.bounceable() || (this.player.emit("tour_manual", "prev"),
  4867. this.interrupt(g.BEGINNING) || this.isInterrupted() || (this.clearWalkingSectionPaused(),
  4868. this.reachSource = "prev",
  4869. this.goPrev()))
  4870. }
  4871. ,
  4872. n.prototype.nextHighlight = function() {
  4873. this.bounceable() || (this.player.emit("tour_manual", "next"),
  4874. this.interrupt(g.BEGINNING) || this.isInterrupted() || (this.clearWalkingSectionPaused(),
  4875. this.reachSource = "next",
  4876. this.goNext()))
  4877. }
  4878. ,
  4879. n.prototype.changeMode = function(e) {
  4880. var t = $.Deferred()
  4881. , i = t.resolve.bind(t)
  4882. , n = t.reject.bind(t);
  4883. this.emit(p.StartModeChange);
  4884. var r = function() {
  4885. return this.clearWalkingSectionPaused(),
  4886. !!this.wouldInterrupt() && (this.interrupt(),
  4887. !0)
  4888. }
  4889. .bind(this);
  4890. if (!r()) {
  4891. switch (e) {
  4892. case c.PANORAMA:
  4893. 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);
  4894. break;
  4895. case c.DOLLHOUSE:
  4896. case c.FLOORPLAN:
  4897. this.player.flyToNewMode({
  4898. mode: e
  4899. }).done(i).fail(n);
  4900. break;
  4901. case c.OUTDOOR:
  4902. 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)
  4903. }
  4904. return t.promise()
  4905. }
  4906. }
  4907. ,
  4908. n.prototype.atEndOfTour = function() {
  4909. //return this.currentItem >= this.nItems - 1
  4910. var end = this.currentItem && this.currentItem[0] >= this.nItems - 1;
  4911. if(end){
  4912. var heroLocations = this.model.heroLocations[this.nItems-1].heroLocations
  4913. if(heroLocations){
  4914. end = this.currentItem[1] >= heroLocations.length - 1
  4915. }
  4916. }
  4917. return end;
  4918. }
  4919. ,
  4920. n.prototype.firstDestination = function() {
  4921. //return 0 < this.nItems ? 0 : null
  4922. return 0 < this.nItems ? [0,0]: null
  4923. }
  4924. ,
  4925. n.prototype.finalDestination = function() {
  4926. //return 0 < this.nItems ? this.nItems - 1 : null
  4927. return 0 < this.nItems ? [this.nItems - 1,0]: null
  4928. }
  4929. ,
  4930. n.prototype.goPrev = function() {
  4931. this.tourAdvance(-1)
  4932. }
  4933. ,
  4934. n.prototype.goNext = function() {
  4935. this.tourAdvance(1)
  4936. }
  4937. ,
  4938. n.prototype.setDestinationItem = function(e) {
  4939. this.destinationItem = e,
  4940. this.emit("update.controls")
  4941. }
  4942. ,
  4943. n.prototype.setCurrentItem = function(e) {
  4944. this.currentItem = e,
  4945. this.emit("update.controls")
  4946. }
  4947. ,
  4948. n.prototype.nextItem = function(currentItem) {
  4949. //return null === e ? this.firstDestination() : e >= this.nItems - 1 ? this.endlessLoop ? this.firstDestination() : null : e + 1
  4950. if(currentItem == void 0)return this.firstDestination()
  4951. var currentLocation = this.model.heroLocations[currentItem[0]];
  4952. var currentChildNum = currentLocation.heroLocations ? currentLocation.heroLocations.length : 1
  4953. var item;
  4954. if(this.currentItem[1] >= currentChildNum - 1){//子目录中最后一个
  4955. item = [currentItem[0] + 1, 0] //结果可能超出nItems
  4956. }else{
  4957. item = [currentItem[0] , currentItem[1]+1]
  4958. }
  4959. if(item[0] >= this.nItems ){
  4960. item = this.firstDestination()
  4961. }
  4962. return item;
  4963. //暂时不理会endlessLoop,默认为false
  4964. }
  4965. ,
  4966. n.prototype.prevItem = function(currentItem) {
  4967. //return null === e ? this.firstDestination() : e < 0 ? this.endlessLoop ? this.lastDestination() : null : e - 1
  4968. if(currentItem == void 0)return this.firstDestination()
  4969. var item;
  4970. var lastLocation = this.model.heroLocations[currentItem[0]-1];
  4971. if(!lastLocation) return this.finalDestination()//[-1, 0]//this.setDestinationItem([-1, 0]) //结果小于0
  4972. else{
  4973. var lastChildNum = lastLocation.heroLocations ? lastLocation.heroLocations.length : 1
  4974. if(this.currentItem[1] == 0){//子目录中第一个
  4975. return [currentItem[0] - 1, lastChildNum-1]
  4976. }else{
  4977. return [currentItem[0], currentItem[1]-1]
  4978. }
  4979. }
  4980. }
  4981. ,
  4982. n.prototype.tourAdvance = function(e) {//e是1或-1
  4983. A.debug("tourAdvance(" + e + ")")
  4984. if(null === this.currentItem || void 0 === this.currentItem){
  4985. this.setDestinationItem(this.firstDestination())
  4986. }else{
  4987. var item
  4988. if(e == 1){
  4989. item = this.nextItem(this.currentItem)
  4990. }else if(e == -1){
  4991. item = this.prevItem(this.currentItem)
  4992. }
  4993. this.setDestinationItem(item)
  4994. }
  4995. if(this.itemCompare(this.destinationItem, this.finalDestination(), 'equal')[0] < 0 ){
  4996. this.useSpecialTransition("reverse-looping to end")
  4997. }else if(this.itemCompare(this.destinationItem, this.firstDestination(), 'equal')){
  4998. this.useSpecialTransition("looping back to start")
  4999. }
  5000. /* var momentTour = this.getMomentTour(this.destinationItem);
  5001. if ( "black" === momentTour) { // 方奕卓 瞬间过渡, 相机缩放至1
  5002. var zoomLevel = this.player.zoomLevel;
  5003. this.player.zoomEnabled = true;
  5004. var zoom = function(e, d) {
  5005. this.player.zoomTo((1-e)*zoomLevel, true)
  5006. }.bind(this)
  5007. s.start(zoom, 1500, function(){
  5008. }, 0, d.easeOutQuad, "zoom")
  5009. } */
  5010. this.goToDestination()
  5011. }
  5012. ,
  5013. n.prototype.getMomentTour = function(destinationItem) {//add
  5014. var wholeMomentTour = window.DATA.momentTour || "walk"; //最外层
  5015. if(!destinationItem) return wholeMomentTour
  5016. else{
  5017. var currentLocation = this.model.getHeroDescriptorByIndex(destinationItem)//最内层。 如果有使用最内层
  5018. if(currentLocation.momentTour)return currentLocation.momentTour;
  5019. var currentLocation_ = this.model.heroLocations[destinationItem[0]];
  5020. return currentLocation_.momentTour || wholeMomentTour; //若中间层或最内层有就使用,否则使用最外层
  5021. }
  5022. }
  5023. ,
  5024. t.exports = n
  5025. }
  5026. ).call(this, "/js/director.js")
  5027. }
  5028. , {
  5029. "./analytics": 4,
  5030. "./enum/BlackoutStyle": 18,
  5031. "./enum/ControlEvents": 21,
  5032. "./enum/DirectorEvents": 23,
  5033. "./enum/ModelManagerEvents": 33,
  5034. "./enum/PathDiscardMode": 38,
  5035. "./enum/PathDisplayMode": 39,
  5036. "./enum/PlayerEvents": 40,
  5037. "./enum/Viewmode": 51,
  5038. "./enum/WarpStyle": 52,
  5039. "./model/ModelManager": 140,
  5040. "./player": 155,
  5041. "./settings": 166,
  5042. "./util/logger": 189,
  5043. "./util/transitions": 195,
  5044. events: 202,
  5045. three: 217
  5046. }],
  5047. 16: [function(e, t, i) {
  5048. "use strict";
  5049. var n = e("three")
  5050. , r = e("./enum/Viewmode")
  5051. , o = (e("./settings"),
  5052. e("./util/transitions"))
  5053. , a = e("./enum/PlayerEvents")
  5054. , s = new n.ShaderPass(n.HorizontalBlurShader)
  5055. , l = new n.ShaderPass(n.VerticalBlurShader);
  5056. l.renderToScreen = !0;
  5057. var c = $("#player").width() / $("#player").height();
  5058. isNaN(c) && (c = 1);
  5059. initTransitionPass(n)
  5060. var h = {
  5061. currentBlur: 0,
  5062. aspect: c,
  5063. blurStrength: 1,
  5064. hblurPass: s,
  5065. vblurPass: l,
  5066. transitionMaskPass : new n.TransitionPass()
  5067. ,
  5068. bindEvents: function(e) {
  5069. e.on(a.ModeChanged, function(e, t) {
  5070. e === r.PANORAMA && (o.cancel(h.blur),
  5071. o.cancel(h.addBlur),
  5072. o.start(h.removeBlur, 500, null, 0, null, "deblur"))
  5073. })
  5074. },
  5075. blur: function(e) {
  5076. h.currentBlur = e;
  5077. var t = e * h.blurStrength;
  5078. l.uniforms.v.value = t / 512 * h.aspect,
  5079. s.uniforms.h.value = t / 512
  5080. },
  5081. addBlur: function(e) {
  5082. e = Math.max(e, h.currentBlur),
  5083. h.blur(e)
  5084. },
  5085. removeBlur: function(e) {
  5086. e = Math.min(1 - e, h.currentBlur),
  5087. h.blur(e)
  5088. }
  5089. };
  5090. h.blur(0),
  5091. t.exports = h
  5092. }
  5093. , {
  5094. "./enum/PlayerEvents": 40,
  5095. "./enum/Viewmode": 51,
  5096. "./settings": 166,
  5097. "./util/transitions": 195,
  5098. three: 217
  5099. }],
  5100. 17: [function(e, t, i) {
  5101. "use strict";
  5102. t.exports = {
  5103. UNKNOWN: 0,
  5104. ALIGNED: 1,
  5105. UNALIGNED: 2,
  5106. PLACED: 3
  5107. }
  5108. }
  5109. , {}],
  5110. 18: [function(e, t, i) {
  5111. "use strict";
  5112. t.exports = {
  5113. NONE: 0,
  5114. MIDDLE: 1,
  5115. END: 2,
  5116. BEGINNING: 3,
  5117. FADEIN: 4
  5118. }
  5119. }
  5120. , {}],
  5121. 19: [function(e, t, i) {
  5122. "use strict";
  5123. var n = e("three");
  5124. t.exports = {
  5125. newBlue: new n.Color(4967932),
  5126. altBlue: new n.Color(47355),
  5127. tagDefault: new n.Color(223357),
  5128. classicBlue: new n.Color(53759),
  5129. mpYellow: new n.Color(16502016),
  5130. mpOrange: new n.Color(16428055),
  5131. mpBlue: new n.Color(12096),
  5132. mpLtGrey: new n.Color(13751252),
  5133. mpDkGrey: new n.Color(10000019),
  5134. mpRed: new n.Color(12525854),
  5135. mpOrangeDesat: new n.Color(16764529),
  5136. mpBlueDesat: new n.Color(4034734),
  5137. mpRedDesat: new n.Color(14705505),
  5138. white: new n.Color(16777215),
  5139. black: new n.Color(0),
  5140. _desat: function(e, t) {
  5141. var i = t || .3
  5142. , r = (new n.Color).copy(e).getHSL();
  5143. return (new n.Color).setHSL(r.h, r.s * (1 - i), r.l)
  5144. },
  5145. _darken: function(e, t) {
  5146. var i = t || .2
  5147. , r = e.getHSL();
  5148. return (new n.Color).setHSL(r.h, r.s, r.l * (1 - i))
  5149. }
  5150. }
  5151. }
  5152. , {
  5153. three: 217
  5154. }],
  5155. 20: [function(e, t, i) {
  5156. "use strict";
  5157. t.exports = {
  5158. NONE: -1,
  5159. ROTATE: 0,
  5160. DOLLY: 1,
  5161. PAN: 2,
  5162. ROTATE_DOLLY: 3,
  5163. PAN_DOLLY: 4
  5164. }
  5165. }
  5166. , {}],
  5167. 21: [function(e, t, i) {
  5168. "use strict";
  5169. t.exports = {
  5170. Move: "move",
  5171. InteractionDirect: "interaction.direct",
  5172. InteractionKey: "interaction.key",
  5173. InteractionGui: "interaction.gui",
  5174. FlyInDirection: "fly.direction",
  5175. InputStart: "input.start",
  5176. Pinch: "input.pinch",
  5177. Scroll: "input.scroll",
  5178. AutoPanInterrupt: "autopan.interrupt",
  5179. AutoPanComplete: "autopan.complete",
  5180. AutoPanClamped: "autopan.clamped",
  5181. LongTap: "longtap"
  5182. }
  5183. }
  5184. , {}],
  5185. 22: [function(e, t, i) {
  5186. "use strict";
  5187. t.exports = Object.freeze({
  5188. FORWARD: "FORWARD",
  5189. LEFT: "LEFT",
  5190. RIGHT: "RIGHT",
  5191. BACK: "BACK",
  5192. UP: "UP",
  5193. DOWN: "DOWN"
  5194. })
  5195. }
  5196. , {}],
  5197. 23: [function(e, t, i) {
  5198. "use strict";
  5199. t.exports = {
  5200. ActionInterrupted: "action.interrupted",
  5201. TourStart: "tour.start",
  5202. TourEnd: "tour.end",
  5203. StartModeChange: "mode.startChange"
  5204. }
  5205. }
  5206. , {}],
  5207. 24: [function(e, t, i) {
  5208. "use strict";
  5209. t.exports = Object.freeze({
  5210. None: 0,
  5211. Queued: 1,
  5212. ForceQueued: 2,
  5213. Downloading: 3,
  5214. Downloaded: 4,
  5215. DownloadFailed: 5
  5216. })
  5217. }
  5218. , {}],
  5219. 25: [function(e, t, i) {
  5220. "use strict";
  5221. t.exports = {
  5222. GL_TEXTURE_CUBE_MAP_POSITIVE_X: 0,
  5223. GL_TEXTURE_CUBE_MAP_NEGATIVE_X: 1,
  5224. GL_TEXTURE_CUBE_MAP_POSITIVE_Y: 2,
  5225. GL_TEXTURE_CUBE_MAP_NEGATIVE_Y: 3,
  5226. GL_TEXTURE_CUBE_MAP_POSITIVE_Z: 4,
  5227. GL_TEXTURE_CUBE_MAP_NEGATIVE_Z: 5
  5228. }
  5229. }
  5230. , {}],
  5231. 26: [function(e, t, i) {
  5232. "use strict";
  5233. t.exports = {
  5234. Texture2D: 0,
  5235. TextureCube: 1
  5236. }
  5237. }
  5238. , {}],
  5239. 27: [function(e, t, i) {
  5240. "use strict";
  5241. t.exports = {
  5242. SMALL: "small",
  5243. LARGE: "large"
  5244. }
  5245. }
  5246. , {}],
  5247. 28: [function(e, t, i) {
  5248. "use strict";
  5249. var n = e("./Viewmode")
  5250. , r = {
  5251. LANDING: {},
  5252. NAVIGATION: "navigation",
  5253. MORE_HELP: "moreHelp",
  5254. TOUR_INTERACTION: {}
  5255. };
  5256. r.LANDING[n.PANORAMA] = "panorama.landing",
  5257. r.LANDING[n.OUTDOOR] = "outdoor.landing",
  5258. r.LANDING[n.DOLLHOUSE] = "dollhouse.landing",
  5259. r.LANDING[n.FLOORPLAN] = "floorplan.landing",
  5260. r.TOUR_INTERACTION.standard = "standard.tour",
  5261. r.TOUR_INTERACTION[n.OUTDOOR] = "outdoor.tour",
  5262. r.TOUR_INTERACTION[n.FLOORPLAN] = "floorplan.tour",
  5263. t.exports = r
  5264. }
  5265. , {
  5266. "./Viewmode": 51
  5267. }],
  5268. 29: [function(e, t, i) {
  5269. "use strict";
  5270. var n = {
  5271. UP: 1,
  5272. DOWN: -1,
  5273. LEFT: "L",
  5274. RIGHT: "R",
  5275. FORWARD: "F",
  5276. BACK: "B",
  5277. reverse: {},
  5278. opposite: function(e) {
  5279. return this.reverse[e.toString()]
  5280. }
  5281. };
  5282. !function() {
  5283. n.reverse[n.UP] = n.DOWN,
  5284. n.reverse[n.DOWN] = n.UP,
  5285. n.reverse[n.LEFT] = n.RIGHT,
  5286. n.reverse[n.RIGHT] = n.LEFT,
  5287. n.reverse[n.FORWARD] = n.BACK,
  5288. n.reverse[n.BACK] = n.FORWARD
  5289. }(),
  5290. t.exports = n
  5291. }
  5292. , {}],
  5293. 30: [function(e, t, i) {
  5294. "use strict";
  5295. var n = e("../util/browser")
  5296. , r = {
  5297. ZERO: 48,
  5298. ONE: 49,
  5299. TWO: 50,
  5300. THREE: 51,
  5301. FOUR: 52,
  5302. FIVE: 53,
  5303. SIX: 54,
  5304. SEVEN: 55,
  5305. EIGHT: 56,
  5306. NINE: 57,
  5307. LEFTARROW: 37,
  5308. UPARROW: 38,
  5309. RIGHTARROW: 39,
  5310. DOWNARROW: 40,
  5311. A: 65,
  5312. B: 66,
  5313. C: 67,
  5314. D: 68,
  5315. E: 69,
  5316. F: 70,
  5317. G: 71,
  5318. H: 72,
  5319. I: 73,
  5320. J: 74,
  5321. K: 75,
  5322. L: 76,
  5323. M: 77,
  5324. N: 78,
  5325. O: 79,
  5326. P: 80,
  5327. Q: 81,
  5328. R: 82,
  5329. S: 83,
  5330. T: 84,
  5331. U: 85,
  5332. V: 86,
  5333. W: 87,
  5334. X: 88,
  5335. Y: 89,
  5336. Z: 90,
  5337. SPACE: 32,
  5338. RETURN: 13,
  5339. SEMICOLON: 186,
  5340. PLUSEQUALS: 187,
  5341. DASHUNDERSCORE: 189,
  5342. OPENBRACKET: 219
  5343. };
  5344. n.detectFirefox() && (r.SEMICOLON = 59,
  5345. r.PLUSEQUALS = 61,
  5346. r.DASHUNDERSCORE = 173),
  5347. t.exports = r
  5348. }
  5349. , {
  5350. "../util/browser": 182
  5351. }],
  5352. 31: [function(e, t, i) {
  5353. "use strict";
  5354. t.exports = {
  5355. EN_US: "en-US",
  5356. ES_MX: "es-MX",
  5357. FR_FR: "fr-FR",
  5358. DE_DE: "de-DE",
  5359. RU_RU: "ru-RU",
  5360. CN_CN: "cn-CN",
  5361. JP_JP: "jp-JP"
  5362. }
  5363. }
  5364. , {}],
  5365. 32: [function(e, t, i) {
  5366. "use strict";
  5367. t.exports = {
  5368. TagActivated: "tag.activated",
  5369. TagDismissed: "tag.dismissed",
  5370. TagNavigation: "tag.navigation"
  5371. }
  5372. }
  5373. , {}],
  5374. 33: [function(e, t, i) {
  5375. "use strict";
  5376. t.exports = {
  5377. ModelAdded: "model-added",
  5378. ActiveModelChanged: "active-model-changed"
  5379. }
  5380. }
  5381. , {}],
  5382. 34: [function(e, t, i) {
  5383. "use strict";
  5384. t.exports = {
  5385. LEFT: 0,
  5386. MIDDLE: 1,
  5387. RIGHT: 2
  5388. }
  5389. }
  5390. , {}],
  5391. 35: [function(e, t, i) {
  5392. "use strict";
  5393. t.exports = {
  5394. PanoRenderComplete: "panorama.render.complete",
  5395. TileRenderFailure: "panorama.tile.render.failed",
  5396. TileRenderSuccess: "panorama.tile.render.success",
  5397. TileUploadAttempted: "panorama.tile.upload.attempted",
  5398. UploadAttemptedForAllTiles: "panorama.upload.attempted.all.tiles",
  5399. ZoomLevelRenderStarted: "panorama.zoom.render.started"
  5400. }
  5401. }
  5402. , {}],
  5403. 36: [function(e, t, i) {
  5404. "use strict";
  5405. t.exports = {
  5406. BASE: 1,
  5407. STANDARD: 2,
  5408. HIGH: 3,
  5409. ULTRAHIGH: 4
  5410. }
  5411. }
  5412. , {}],
  5413. 37: [function(e, t, i) {
  5414. "use strict";
  5415. t.exports = {
  5416. LoadComplete: "panorama.load.complete",
  5417. LoadFailed: "panorama.load.failed",
  5418. TileLoaded: "panorama.tile.loaded"
  5419. }
  5420. }
  5421. , {}],
  5422. 38: [function(e, t, i) {
  5423. "use strict";
  5424. t.exports = Object.freeze({
  5425. Standard: 0,
  5426. Slow: 1,
  5427. Retain: 2
  5428. })
  5429. }
  5430. , {}],
  5431. 39: [function(e, t, i) {
  5432. "use strict";
  5433. t.exports = Object.freeze({
  5434. Show: 0,
  5435. Hide: 1,
  5436. Retain: 2
  5437. })
  5438. }
  5439. , {}],
  5440. 40: [function(e, t, i) {
  5441. "use strict";
  5442. t.exports = {
  5443. Move: "move",
  5444. MoveComplete: "move.complete",
  5445. ModeChanged: "mode.changed",
  5446. ModeChanging: "mode.changing",
  5447. PanoChosen: "pano.chosen",
  5448. ClosestPanoChanging: "closest.pano.changing",
  5449. WarpStarted: "warp.started",
  5450. WarpInterrupted: "warp.interrupted",
  5451. WarpEnded: "warp.ended",
  5452. FlyinFinished: "flyin.finished",
  5453. FlyingStarted: "flying.started",
  5454. FlyingInterrupted: "flying.interrupted",
  5455. FlyingEnded: "flying.ended",
  5456. Ready: "ready",
  5457. StartInside: "start.inside",
  5458. StartOutside: "start.outside",
  5459. ViewChanged: "view.changed",
  5460. WarpInterruptedWithFlyTo: "warp.interrupted.flyto",
  5461. InputStart: "input.start"
  5462. }
  5463. }
  5464. , {}],
  5465. 41: [function(e, t, i) {
  5466. "use strict";
  5467. t.exports = Object.freeze({
  5468. DEFAULT: 0,
  5469. PANOMARKERS: 1,
  5470. RETICULE: 2,
  5471. TAG: 3
  5472. })
  5473. }
  5474. , {}],
  5475. 42: [function(e, t, i) {
  5476. "use strict";
  5477. t.exports = {
  5478. visibleFloor: 1,
  5479. ghostFloor: 3,
  5480. boundingSkybox: 1,
  5481. panoMarker: 2,
  5482. reticule: 3,
  5483. tagStem: 4,
  5484. tagDisc: 5,
  5485. ribbon: 100
  5486. }
  5487. }
  5488. , {}],
  5489. 43: [function(e, t, i) {
  5490. "use strict";
  5491. t.exports = {
  5492. ContextCreated: "scene-renderer-context-created",
  5493. AfterRender: "after-render",
  5494. MemoryUsageUpdated: "scene-renderer-memory-usage-updated"
  5495. }
  5496. }
  5497. , {}],
  5498. 44: [function(e, t, i) {
  5499. "use strict";
  5500. t.exports = {
  5501. IDLE: "idle",
  5502. BROWSE: "browse",
  5503. EXAMINE: "examine"
  5504. }
  5505. }
  5506. , {}],
  5507. 45: [function(e, t, i) {
  5508. "use strict";
  5509. t.exports = {
  5510. TileDownloadSuccess: "tiledownloader.download.success",
  5511. TileDownloadFailure: "tiledownloader.download.failure",
  5512. PanoDownloadComplete: "tiledownloader.pano.download.complete"
  5513. }
  5514. }
  5515. , {}],
  5516. 46: [function(e, t, i) {
  5517. "use strict";
  5518. t.exports = {
  5519. CardboardAndroid: "googlevr",
  5520. GearVR: "gearvr",
  5521. CardboardIOS: "googlevrios",
  5522. Cardboard: "googlevr"
  5523. }
  5524. }
  5525. , {}],
  5526. 47: [function(e, t, i) {
  5527. "use strict";
  5528. t.exports = {
  5529. NONE: 0,
  5530. CONTEXTUAL: 1,
  5531. ANDROID: 2
  5532. }
  5533. }
  5534. , {}],
  5535. 48: [function(e, t, i) {
  5536. "use strict";
  5537. var n = {
  5538. Title: 0,
  5539. Cardboard: 1
  5540. }
  5541. , r = {
  5542. Title: 0,
  5543. Cardboard: 1,
  5544. Gear: 2
  5545. };
  5546. !function() {
  5547. [n, r].forEach(function(e) {
  5548. e.pageCount = Object.keys(e).length
  5549. })
  5550. }(),
  5551. t.exports.ios = n,
  5552. t.exports.standard = r
  5553. }
  5554. , {}],
  5555. 49: [function(e, t, i) {
  5556. "use strict";
  5557. t.exports = {
  5558. Android: "android",
  5559. IOS: "ios",
  5560. Desktop: "desktop",
  5561. UnsupportedAndroid: "android-unsupported"
  5562. }
  5563. }
  5564. , {}],
  5565. 50: [function(e, t, i) {
  5566. "use strict";
  5567. var n = e("three");
  5568. t.exports = {
  5569. UP: new n.Vector3(0,1,0),
  5570. DOWN: new n.Vector3(0,-1,0),
  5571. LEFT: new n.Vector3(-1,0,0),
  5572. RIGHT: new n.Vector3(1,0,0),
  5573. FORWARD: new n.Vector3(0,0,-1),
  5574. BACK: new n.Vector3(0,0,1)
  5575. }
  5576. }
  5577. , {
  5578. three: 217
  5579. }],
  5580. 51: [function(e, t, i) {
  5581. "use strict";
  5582. var n = e("../exception/ViewmodeConvertException")
  5583. , r = e("./coreViewmodes")
  5584. , o = e("../util/common")
  5585. , a = {
  5586. MESH: "mesh",
  5587. OUTDOOR: "outdoor",
  5588. TRANSITIONING: "transitioning",
  5589. toInt: function(e) {
  5590. switch (e) {
  5591. case this.PANORAMA:
  5592. return 1;
  5593. case this.DOLLHOUSE:
  5594. return 2;
  5595. case this.FLOORPLAN:
  5596. return 3;
  5597. case this.OUTDOOR:
  5598. return 4;
  5599. case this.TRANSITIONING:
  5600. return -1
  5601. }
  5602. throw new n("No known conversion for Viewmode to int for mode: " + e)
  5603. },
  5604. fromInt: function(e) {
  5605. switch (e) {
  5606. case "1":
  5607. case 1:
  5608. return this.PANORAMA;
  5609. case "2":
  5610. case 2:
  5611. return this.DOLLHOUSE;
  5612. case "3":
  5613. case 3:
  5614. return this.FLOORPLAN;
  5615. case "4":
  5616. case 4:
  5617. return this.OUTDOOR
  5618. }
  5619. throw new n("No known conversion for int to viewmode for int: " + e)
  5620. },
  5621. convertWorkshopModeInt: function(e) {
  5622. switch (e) {
  5623. case "0":
  5624. case 0:
  5625. case undefined: //xzw add
  5626. return this.PANORAMA;
  5627. case "1":
  5628. case 1:
  5629. return this.FLOORPLAN;
  5630. case "2":
  5631. case 2:
  5632. return this.DOLLHOUSE;
  5633. case "3":
  5634. case 3:
  5635. return this.MESH
  5636. }
  5637. throw new n("No known conversion for Workshop int to viewmode for int: " + e)
  5638. }
  5639. };
  5640. o.extendObject(a, r),
  5641. t.exports = a
  5642. }
  5643. , {
  5644. "../exception/ViewmodeConvertException": 58,
  5645. "../util/common": 185,
  5646. "./coreViewmodes": 54
  5647. }],
  5648. 52: [function(e, t, i) {
  5649. "use strict";
  5650. t.exports = {
  5651. BLACK: "black",
  5652. STD: "std",
  5653. WALK: "walk"
  5654. }
  5655. }
  5656. , {}],
  5657. 53: [function(e, t, i) {
  5658. "use strict";
  5659. t.exports = {
  5660. ZoomIn: "zoom.in",
  5661. ZoomOut: "zoom.out",
  5662. ZoomMax: "zoom.max",
  5663. ZoomMin: "zoom.min"
  5664. }
  5665. }
  5666. , {}],
  5667. 54: [function(e, t, i) {
  5668. "use strict";
  5669. t.exports = {
  5670. PANORAMA: "panorama",
  5671. DOLLHOUSE: "dollhouse",
  5672. FLOORPLAN: "floorplan"
  5673. }
  5674. }
  5675. , {}],
  5676. 55: [function(e, t, i) {
  5677. "use strict";
  5678. function n(e) {
  5679. this.message = e
  5680. }
  5681. t.exports = n
  5682. }
  5683. , {}],
  5684. 56: [function(e, t, i) {
  5685. "use strict";
  5686. function n(e) {
  5687. r.call(this, e)
  5688. }
  5689. var r = e("./BasicException");
  5690. n.prototype = Object.create(r.prototype),
  5691. t.exports = n
  5692. }
  5693. , {
  5694. "./BasicException": 55
  5695. }],
  5696. 57: [function(e, t, i) {
  5697. "use strict";
  5698. function n(e) {
  5699. r.call(this, e)
  5700. }
  5701. var r = e("./BasicException");
  5702. n.prototype = Object.create(r.prototype),
  5703. t.exports = n
  5704. }
  5705. , {
  5706. "./BasicException": 55
  5707. }],
  5708. 58: [function(e, t, i) {
  5709. "use strict";
  5710. function n(e) {
  5711. r.call(this, e)
  5712. }
  5713. var r = e("./BasicException");
  5714. n.prototype = Object.create(r.prototype),
  5715. t.exports = n
  5716. }
  5717. , {
  5718. "./BasicException": 55
  5719. }],
  5720. 59: [function(e, t, i) {
  5721. (function(i) {
  5722. "use strict";
  5723. function n(e) {
  5724. var t = {};
  5725. if (e) {
  5726. var i = e.flags;
  5727. if (i)
  5728. for (var n in i)
  5729. i.hasOwnProperty(n) && (t[i[n]] = !0);
  5730. return t
  5731. }
  5732. return l.debug("Feature flags -> parseFeatureFlags: rawData is null."),
  5733. null
  5734. }
  5735. var r = e("./util/ajax")
  5736. , o = e("./util/showcase")
  5737. , a = e("./util/logger")
  5738. , s = ""
  5739. , l = new a(i)
  5740. , c = {};
  5741. t.exports = {
  5742. loadFeatureFlags: function(e) {
  5743. var t = $.Deferred();
  5744. return r.get(e.urlBase + s, {
  5745. responseType: "json",
  5746. prefetchFrom: "user",
  5747. auth: o.getAuthorizationHeader()
  5748. }).done(function(e) {
  5749. c = n(e),
  5750. c ? t.resolve(c) : t.reject("loading-failed")
  5751. }).fail(function() {
  5752. l.debug("Retrieval of feature flags failed."),
  5753. t.reject("loading-failed")
  5754. }),
  5755. t.promise()
  5756. },
  5757. getFlags: function() {
  5758. return c
  5759. },
  5760. updateDependentSettings: function(e, t) {
  5761. e = e || c,
  5762. e.labels && (t.labels.enabled = !0),
  5763. e.zooming && !t.zoom.forceOff && (t.zoom.enabled = !0),
  5764. e.showcase_sdk && (t.sdkInit = !0),
  5765. e.mobile_highq_override && (t.tiling.mobileHighQualityOverride = !0),
  5766. e.showcase_webvr && (t.vr.allowWebVR = !0),
  5767. e.uhql && (t.tiling.allowUltraHighResolution = !0),
  5768. e.hide_sc_sharing && (t.share.enabled = !1)
  5769. }
  5770. }
  5771. }
  5772. ).call(this, "/js/featureflags.js")
  5773. }
  5774. , {
  5775. "./util/ajax": 181,
  5776. "./util/logger": 189,
  5777. "./util/showcase": 193
  5778. }],
  5779. 60: [function(e, t, i) {
  5780. "use strict";
  5781. var n = (e("../util/common"),
  5782. {
  5783. status: 0,
  5784. set: function(e) {
  5785. if (isNaN(e))
  5786. return !1;
  5787. var t = $('.progressbar');
  5788. 0 > e && (e = 0);
  5789. e > 100 && (e = 100);
  5790. var width = parseInt(t.css('width').replace("px",""))/100; //获取进度条总长度除以100
  5791. var barperc = e*width;
  5792. var perc = Math.round(e);
  5793. var labelpos = (parseInt(barperc)-15);
  5794. t.find('.bar').css('width',barperc); //已经再跑颜色的百分比
  5795. t.find('.label').css('left', labelpos); //上面跟着的字的百分比
  5796. t.find('.perc').text(perc+'%'); //具体数字的百分比
  5797. this.status = e
  5798. },
  5799. done: function(e) {
  5800. return e || this.status ? (this.status = null,
  5801. this.set(100)) : this
  5802. }
  5803. });
  5804. t.exports.circleLoader = n
  5805. }
  5806. , {
  5807. "../util/common": 185
  5808. }],
  5809. 61: [function(e, t, i) {
  5810. "use strict";
  5811. t.exports = Object.freeze({
  5812. CLOSE: "modal.closer.close"
  5813. })
  5814. }
  5815. , {}],
  5816. 62: [function(e, t, i) {
  5817. "use strict";
  5818. function n(e, t) {
  5819. t && (t.stopPropagation(),
  5820. t.preventDefault()),
  5821. e && this.emit(l.CLOSE, e),
  5822. g.reset()
  5823. }
  5824. function r(e, t) {
  5825. function i() {
  5826. var t = e.offsetHeight >= $("#player").height() && e.offsetWidth >= $("#player").width();
  5827. t !== f && (f = t,
  5828. t ? (e.classList.add("closeByFooter"),
  5829. h.classList.add("closeByFooter")) : (e.classList.remove("closeByFooter"),
  5830. h.classList.remove("closeByFooter")))
  5831. }
  5832. t ? setTimeout(i, o.guiAnimationSpeed) : i()
  5833. }
  5834. var o = e("../../settings")
  5835. , a = (e("../../tag/Media/MediaEvent"),
  5836. e("../../util/browser"))
  5837. , s = e("../../util/common")
  5838. , l = e("./ModalCloserEvent")
  5839. , c = e("events").EventEmitter
  5840. , h = document.getElementsByClassName("footer")[0]
  5841. , u = h.querySelectorAll(".close")[0]
  5842. , d = null
  5843. , p = null
  5844. , f = null
  5845. , g = (a.isMobile(),
  5846. {
  5847. open: function(e) {
  5848. e && (r(e),
  5849. d && u.removeEventListener("click", d, !0),
  5850. d = n.bind(this, e.id),
  5851. u.addEventListener("click", d, !0),
  5852. p && window.removeEventListener("resize", p, !0),
  5853. p = r.bind(this, e),
  5854. window.addEventListener("resize", p, !0))
  5855. },
  5856. reset: function() {
  5857. h.classList.remove("closeByFooter"),
  5858. u.removeEventListener("click", d, !0),
  5859. window.removeEventListener("resize", p, !0),
  5860. d = p = f = null
  5861. }
  5862. });
  5863. s.extendObject(g, c.prototype),
  5864. t.exports = g
  5865. }
  5866. , {
  5867. "../../tag/Media/MediaEvent": 131,
  5868. "../../settings": 166,
  5869. "../../util/browser": 182,
  5870. "../../util/common": 185,
  5871. "./ModalCloserEvent": 61,
  5872. events: 202
  5873. }],
  5874. 63: [function(e, t, i) {
  5875. "use strict";
  5876. function n(e, t, i) {
  5877. var n = new r.GUI({
  5878. width: 400
  5879. })
  5880. , u = n.addFolder("Flydown from Dollhouse");
  5881. u.add(h.flydown, "movementEasing", Object.keys(a)),
  5882. u.add(h.flydown, "movementDelay", 0, 1).step(.01),
  5883. u.add(h.flydown, "rotationEasing", Object.keys(a)),
  5884. u.add(h.flydown, "rotationDelay", 0, 1).step(.01),
  5885. u.add(h.flydown, "modelTextureDelay", 0, 1).step(.01),
  5886. u.add(h.flydown, "skyboxDelay", 0, 1).step(.01),
  5887. u.add(h.dollhouseDefault, "minPolarAngle", 0, o.Math.degToRad(50)),
  5888. u.add(h.dollhouseDefault, "maxPolarAngle", o.Math.degToRad(50), o.Math.degToRad(170));
  5889. var d = n.addFolder("Transition between panos");
  5890. d.add(h.transition, "blur", 0, 10).onFinishChange(function() {}),
  5891. d.add(h.transition, "flySpeed", 0, 10).step(.01).onFinishChange(function() {
  5892. h.transition.flyTime = 0,
  5893. d.__controllers.forEach(function(e) {
  5894. e.updateDisplay()
  5895. })
  5896. }),
  5897. d.add(h.transition, "flyTime", 0, 5e3).onFinishChange(function() {
  5898. h.transition.flySpeed = 0,
  5899. d.__controllers.forEach(function(e) {
  5900. e.updateDisplay()
  5901. })
  5902. }),
  5903. d.add(h.transition, "aimTime", 500, 2500).step(50),
  5904. d.add(h.transition, "aimSlowFactor", 1, 3).step(.1),
  5905. d.add(h.transition, "movementEasing", Object.keys(a));
  5906. var p = n.addFolder("Path Display");
  5907. p.add(h.path, "opacity", 0, 1).step(.01).onFinishChange(function() {}),
  5908. p.add(h.path, "height", 0, .2).step(.01).onFinishChange(function() {}),
  5909. p.add(h.path, "outsideHeight", 0, 2).step(.01).onFinishChange(function() {}),
  5910. p.add(h.path, "ribbonWidth", .01, .35).step(.01).onFinishChange(function() {}),
  5911. p.add(h.path, "waypointRadius", .01, 1.2).step(.01).onFinishChange(function() {}),
  5912. p.add(h.path, "waypointPulse", 0, 3600).step(20).onFinishChange(function() {}),
  5913. p.add(h.path, "waypointIndoorRadius", .01, 1.2).step(.01).onFinishChange(function() {}),
  5914. p.add(h.path, "fadeInTime", 0, 1200).step(10).onFinishChange(function() {}),
  5915. p.add(h.path, "fadeOutTime", 0, 1200).step(10).onFinishChange(function() {}),
  5916. p.add(h.path, "color", Object.keys(l)).onFinishChange(function() {
  5917. h.path.color = l[h.path.color],
  5918. h.path.colorUp = l._desat(h.path.color),
  5919. h.path.colorDown = l.darken(h.path.color)
  5920. }),
  5921. p.add(h, "reticuleColor", Object.keys(l)).onFinishChange(function() {
  5922. h.reticuleColor = l[h.reticuleColor]
  5923. });
  5924. var f = n.addFolder("Warping")
  5925. , g = f.addFolder("Warp/Teleport");
  5926. g.add(h.warp, "softPushDist", 0, 2).onFinishChange(function() {}),
  5927. g.add(h.warp, "softPushEnd", 0, 1).step(.01).onFinishChange(function() {}),
  5928. g.add(h.warp, "softBendAngle", 0, 45).onFinishChange(function() {}),
  5929. g.add(h.warp, "softBendTilt", 0, 45).onFinishChange(function() {}),
  5930. g.add(h.warp, "softBendEnd", 0, 1).step(.01).onFinishChange(function() {}),
  5931. g.add(h.warp, "burnsAngle", 0, 30).onFinishChange(function() {}),
  5932. g.add(h.warp, "minBurnsAngle", 0, 10).onFinishChange(function() {}),
  5933. g.add(h.warp, "brakeStrength", 1, 8).onFinishChange(function() {}),
  5934. g.add(h.warp, "minBrakeAngle", 0, 5).step(.01).onFinishChange(function() {}),
  5935. g.add(h.warp, "maxBrakeAngle", 0, 5).step(.01).onFinishChange(function() {}),
  5936. g.add(h.path, "mapGuides").onFinishChange(function() {}),
  5937. g.add(h.warp, "teleportTime", 0, 5e3).step(10).onFinishChange(function() {}),
  5938. g.add(h.warp, "outsideTime", 0, 5e3).step(10).onFinishChange(function() {}),
  5939. g.add(h.path, "typ", Object.keys(c)).onFinishChange(function() {
  5940. h.path.typ = c[h.path.typ]
  5941. }),
  5942. g.add(h.warp, "loop").onChange(function() {}).onFinishChange(function() {
  5943. t.endlessLoop = h.warp.loop
  5944. }),
  5945. g.add(h.warp, "walkSlideShowThreshhold", 1, 1e4).step(1).onFinishChange(function() {}),
  5946. g.add(h.warp, "walkExtraPanosDistance", 0, 3).step(.1).onFinishChange(function() {}),
  5947. g.add(h.transition, "fastForwardFactor", 1, 10).step(1).onFinishChange(function() {});
  5948. var m = f.addFolder("Long Warp Only");
  5949. m.add(h.warp, "minWarpTime", 0, 5e3).step(10).onFinishChange(function() {
  5950. h.warp.flySpeed = 0,
  5951. m.__controllers.forEach(function(e) {
  5952. e.updateDisplay()
  5953. })
  5954. }),
  5955. m.add(h.warp, "timePerMeter", 0, 5e3).step(10).onFinishChange(function() {}),
  5956. m.add(h.warp, "lookAheadMax", .01, 1).step(.01).onFinishChange(function() {}),
  5957. m.add(h.warp, "lookAheadDist", .01, 4).step(.01).onFinishChange(function() {}),
  5958. m.add(h.warp, "maxTurnPerSec", 0, 720).step(1).onFinishChange(function() {}),
  5959. m.add(h.warp, "maxAimPerSec", 0, 720).step(1).onFinishChange(function() {}),
  5960. m.add(h.warp, "turnFriction", 0, 1).step(.01).onFinishChange(function() {}),
  5961. m.add(h.warp, "walkDelay", 0, 2e3).step(10).onFinishChange(function() {}),
  5962. m.add(h.transition, "flytimeMaxDistanceThreshold", 0, 25).step(10).onFinishChange(function() {}),
  5963. m.add(h.warp, "walkMaxDist", 0, 100).step(1).onFinishChange(function() {});
  5964. var v = n.addFolder("Warp Esoterica");
  5965. v.add(h.warp, "nearPanoDist", .01, 12).step(0).onFinishChange(function() {}),
  5966. v.add(h.warp, "blur", .01, 1).onFinishChange(function() {}),
  5967. v.add(h.warp, "flySpeed", 0, 10).step(.01).onFinishChange(function() {
  5968. h.warp.minWarpTime = 0,
  5969. v.__controllers.forEach(function(e) {
  5970. e.updateDisplay()
  5971. })
  5972. }),
  5973. v.add(h.warp, "showBunny").onFinishChange(function() {}),
  5974. v.add(h.warp, "fastTime", 0, 2500).step(10).onFinishChange(function() {}),
  5975. v.add(h.warp, "movementEasing", Object.keys(a));
  5976. var A = n.addFolder("Misc");
  5977. A.add(h, "dollhouseFOV", 10, 180).onChange(function() {
  5978. i.cameras[s.DOLLHOUSE].fov = h.dollhouseFOV
  5979. }),
  5980. A.add(h, "insideFOV", 10, 180).onChange(function() {
  5981. i.cameras[s.PANORAMA].fov = h.insideFOV
  5982. }),
  5983. A.add(h, "insideLookSpeed", .01, .3).step(.01).onChange(function() {}),
  5984. A.add(h, "rotationAccelerationInside", .1, 10).step(.1).onChange(function() {}),
  5985. A.add(h, "rotationAccelerationOutside", .1, 10).step(.1).onChange(function() {});
  5986. var y = n.addFolder("Navigation");
  5987. y.add(h.navigation, "panoScores").onFinishChange(function() {
  5988. h.navigation.panoScores || e.panos.forEach(function(e) {
  5989. e.floor.remove(e.text3d),
  5990. e.text3d = null
  5991. })
  5992. }),
  5993. y.add(h.navigation, "mouseDirection"),
  5994. y.add(h.navigation, "filterStrictness", 0, 1),
  5995. y.add(h.navigation, "angleFactor", -60, 0),
  5996. y.add(h.navigation, "directionFactor", 1, 20),
  5997. y.add(h.navigation, "distanceFactor", -5, 5),
  5998. y.add(h.navigation, "optionalityFactor", .1, 10);
  5999. var C = n.addFolder("tags")
  6000. , I = C.addFolder("Tag Creation");
  6001. I.add(h.tags.pole, "enabled").name("poleEnabled"),
  6002. I.add(h.tags.pole, "height", 0, 2.5).step(.01).name("poleHeight"),
  6003. I.add(h.tags.pole, "width", 1, 10).step(1).name("poleWidth"),
  6004. I.add(h.tags.pole, "opacity", .1, 1).step(.1).name("poleOpacity");
  6005. var E = C.addFolder("Visibility");
  6006. E.add(h.tags.visibility, "anyDistance"),
  6007. E.add(h.tags.visibility, "visibleDistance", .1, 30).step(.1),
  6008. E.add(h.tags.visibility, "cameraClearance", 0, 1).step(.01),
  6009. E.add(h.tags.visibility, "hideViaFloor"),
  6010. E.add(h.tags.visibility, "hideOffScreenDisc").name("hideEdgeDisc"),
  6011. E.add(h.tags.visibility, "hideOffScreenObject").name("hideEdgeObject");
  6012. var b = C.addFolder("Disc Parameters");
  6013. b.add(h.tags.disc.scale, "nearBound", .1, 10).step(.1),
  6014. b.add(h.tags.disc.scale, "farBound", .1, 20).step(.1).listen(),
  6015. b.add(h.tags.disc.scale, "linkFarBound").onChange(function(e) {
  6016. e && (h.tags.disc.scale.farBound = h.tags.visibility.visibleDistance * (1 - h.tags.disc.scale.linkPercent / 100))
  6017. }),
  6018. b.add(h.tags.disc.scale, "linkPercent", 0, 100).step(1).onChange(function(e) {
  6019. h.tags.disc.scale.linkFarBound && (h.tags.disc.scale.farBound = h.tags.visibility.visibleDistance * (1 - e / 100))
  6020. }),
  6021. b.add(h.tags.disc.scale, "maxSize", 40, 200).step(1),
  6022. b.add(h.tags.disc.scale, "minSize", 20, 100).step(1),
  6023. b.add(h.tags.disc.scale, "responsiveness", 0, 100).step(1);
  6024. var w = C.addFolder("Navigate");
  6025. w.add(h.tags.navigate, "nearestPano").name("nearestPano"),
  6026. w.add(h.tags.navigate, "lineOfSight").name("lineOfSight"),
  6027. w.add(h.tags.navigate, "reactivate").name("reactivate"),
  6028. w.add(h.tags.navigate, "aimAt", ["disc", "object", "pole", "nothing"]).name("aim at"),
  6029. w.add(h.tags.navigate, "tiltTolerance", 0, 50).step(1),
  6030. w.add(h.tags.navigate, "rotateSpeedFactor", 0, 5).step(.1);
  6031. var _ = n.addFolder("Debug");
  6032. _.add(h, "wireframe").onFinishChange(function() {
  6033. e.chunks.forEach(function(t) {
  6034. t.material && (t.wireframeTwin || (t.wireframeTwin = new o.WireframeHelper(t),
  6035. t.wireframeTwin.material.depthWrite = !1,
  6036. t.wireframeTwin.material.depthTest = !1,
  6037. t.wireframeTwin.material.opacity = .5,
  6038. t.wireframeTwin.material.transparent = !0),
  6039. h.wireframe ? e.add(t.wireframeTwin) : e.remove(t.wireframeTwin))
  6040. })
  6041. }),
  6042. _.add(h, "skyboxWireframe").onFinishChange(function() {
  6043. h.skyboxWireframe ? (e.skybox.wireframe = new o.WireframeHelper(e.skybox),
  6044. e.add(e.skybox.wireframe)) : (e.remove(e.skybox.wireframe),
  6045. e.skybox.wireframe = null)
  6046. }),
  6047. _.add(h, "showSweeps").onFinishChange(function() {
  6048. e.setSweepVisibility(h.showSweeps)
  6049. }),
  6050. _.add(h, "showMesh").onFinishChange(function() {
  6051. e.chunks.forEach(function(e) {
  6052. e.visible = h.showMesh
  6053. })
  6054. }),
  6055. _.add(h, "showFloors").onFinishChange(function() {
  6056. e.floors.forEach(function(e) {
  6057. e.collider.children.forEach(function(e) {
  6058. e.material.visible = h.showFloors
  6059. })
  6060. })
  6061. }),
  6062. _.add(h, "showSkyboxes").onFinishChange(function() {
  6063. e.panos.forEach(function(e) {
  6064. e.skyboxMesh.visible = h.showSkyboxes
  6065. })
  6066. }),
  6067. _.add(h, "showNeighbors").onChange(function() {}),
  6068. _.add(e, "alpha", 0, 1)
  6069. }
  6070. var r = e("../lib/dat.gui")
  6071. , o = e("three")
  6072. , a = e("../util/easing")
  6073. , s = e("../enum/Viewmode")
  6074. , l = e("../enum/Colors")
  6075. , c = e("../enum/WarpStyle")
  6076. , h = e("../settings");
  6077. e("../tag/tag");
  6078. r.GUI.prototype.removeFolder = function(e) {
  6079. var t = this.__folders[e];
  6080. t && (t.close(),
  6081. this.__ul.removeChild(t.domElement.parentNode),
  6082. delete this.__folders[e],
  6083. this.onResize())
  6084. }
  6085. ,
  6086. t.exports.toggle = n
  6087. }
  6088. , {
  6089. "../enum/Colors": 19,
  6090. "../enum/Viewmode": 51,
  6091. "../enum/WarpStyle": 52,
  6092. "../lib/dat.gui": 93,
  6093. "../tag/tag": 123,
  6094. "../settings": 166,
  6095. "../util/easing": 186,
  6096. three: 217
  6097. }],
  6098. 64: [function(e, t, i) {
  6099. (function(i) {
  6100. "use strict";
  6101. function n(e, t, i, n) {
  6102. $(".gui-error .error-problem-text").text(e),
  6103. $(".gui-error .error-solution-text").text(t),
  6104. $(".gui-error .error-explanation").text(i),
  6105. $(".gui-error .error-actions").html(n),
  6106. $(window).resize(),
  6107. $(".gui-error").fadeIn(),
  6108. $("#bottom-logo").fadeIn()
  6109. }
  6110. function r(e) {
  6111. 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("");
  6112. n(e, h.ERROR_BROWSER_SOLUTION, h.ERROR_BROWSER_EXPLANATION, t),
  6113. s.isMobile() || $("[rel=tiletip]").tooltip({
  6114. placement: "bottom",
  6115. delay: {
  6116. show: 50,
  6117. hide: 0
  6118. },
  6119. trigger: "hover",
  6120. viewport: {
  6121. selector: "body",
  6122. padding: 10
  6123. }
  6124. })
  6125. }
  6126. function o() {
  6127. var e = s.isMobile() ? "" : '<span class="link install-browser">' + h.ERROR_GENERIC_ACTIONS_2 + "</span>" + h.ERROR_GENERIC_ACTIONS_3
  6128. , t = [h.ERROR_GENERIC_ACTIONS_1, e,].join("");
  6129. n(h.ERROR_GENERIC_PROBLEM, h.ERROR_GENERIC_SOLUTION, "", t),
  6130. s.isMobile() || $(".install-browser").on("click touchstart", function(e) {
  6131. e.preventDefault(),
  6132. e.stopPropagation(),
  6133. r(" ")
  6134. })
  6135. }
  6136. function a(e) {
  6137. if ($("head title").text(c.pageTitle),
  6138. $("#gui-message, #gui-loading, #nprogress, #gui-thumb, #bottom-logo").hide(),
  6139. $("#gui-loading").fadeOut(250),
  6140. $("#quick-blackout").hide(),
  6141. l.track("showcase_error", {
  6142. error_key: e
  6143. }),
  6144. h.locale || h.init(),
  6145. "webgl-unsupported" === e)
  6146. s.isMobile() ? o() : r(h.ERROR_WEBGL_UNSUPPORTED_PROBLEM);
  6147. else if ("webgl-ios" === e)
  6148. 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>.");
  6149. else if ("webgl-safari" === e)
  6150. 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>.");
  6151. else if ("webgl-generic" === e)
  6152. o();
  6153. else if ("missing-urls" === e)
  6154. n(h.ERROR_MISSING_URLS_PROBLEM, "", h.ERROR_MISSING_URLS_EXPLANATION);
  6155. else if ("loading-failed" === e)
  6156. 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>.");
  6157. else {
  6158. if ("loading-failed-maintenance" !== e)
  6159. return void d.error("Unhandled error: " + e);
  6160. n(h.ERROR_MAINTENANCE_PROBLEM, h.ERROR_MAINTENANCE_SOLUTION)
  6161. }
  6162. }
  6163. var s = e("./../util/browser")
  6164. , l = e("./../analytics")
  6165. , c = e("./../settings")
  6166. , h = e("../localization/localize")
  6167. , u = e("./../util/logger")
  6168. , d = new u(i)
  6169. , p = '"https://support.port.com/hc/articles/208220058"';
  6170. t.exports.error = a
  6171. }
  6172. ).call(this, "/js/gui/error.js")
  6173. }
  6174. , {
  6175. "../localization/localize": 108,
  6176. "./../analytics": 4,
  6177. "./../settings": 166,
  6178. "./../util/browser": 182,
  6179. "./../util/logger": 189
  6180. }],
  6181. 65: [function(e, t, i) {
  6182. (function(i) {
  6183. "use strict";
  6184. function n() {
  6185. Ue = [],
  6186. je.floors.visible && Ue.push(".gui-floor", ".gui-floor-title"),
  6187. Ue.push(".hideTarget", ".pinTop.right")
  6188. }
  6189. function r() {
  6190. for (var e in je)
  6191. if (je.hasOwnProperty(e)) {
  6192. var t = je[e];
  6193. if (!t.visible)
  6194. for (var i = 0; i < t.elements.length; i++)
  6195. $(t.elements[i]).hide()
  6196. }
  6197. je.highlight.visible && $(".pinBottom").addClass("highlightExists"),
  6198. je.tourControls.visible === !1 && $("#drawer").addClass("fullWidth"),
  6199. n()
  6200. }
  6201. function o(e, t) {
  6202. var i = !K.isMobile() && Q.zoom.enabled && t.mode === _e.PANORAMA && !e.tourIsPlaying;
  6203. $("#gui-zoomin").toggle(i),
  6204. $("#gui-zoomout").toggle(i)
  6205. }
  6206. function a() {
  6207. c(),
  6208. $(".pinBottom").toggleClass("open"),
  6209. $("#drawer").toggleClass("open"),
  6210. $(".footer").toggleClass("open"),
  6211. $("#drawer").hasClass("open") ? ($("#pullTab .icon").attr("data-original-title", Re.CLOSE_HIGHLIGHTS),
  6212. Ze("highlights")) : ($("#pullTab .icon").attr("data-original-title", Re.OPEN_HIGHLIGHTS),
  6213. ie.resetDrawer()),
  6214. setTimeout(function() {
  6215. $("#pullTab").toggleClass("opened");
  6216. }, $("#drawer").hasClass("open") ? 0 : Q.highlightAnimationDuration),
  6217. $(".pinBottom").hasClass("open") && s($(".vr-popup")) && $(".vr-popup").is(":visible") && Ae.dismiss()
  6218. }
  6219. function s(e) {
  6220. var t;
  6221. "none" !== e.css("display") ? t = e.position().top + e.outerHeight() : (e.attr("style", "visibility: hidden"),
  6222. t = e.position().top + e.outerHeight(),
  6223. e.attr("style", "display: none"));
  6224. var i = $("#player").outerHeight()
  6225. , n = i - 130;
  6226. return n < t + 25
  6227. }
  6228. function l(e) {
  6229. "touchstart" === e.type && e.preventDefault(),
  6230. e.stopPropagation()
  6231. }
  6232. function c() {
  6233. W && (W.reload(),
  6234. W.init())
  6235. }
  6236. function h(e) {
  6237. ne.show(e),
  6238. r()
  6239. }
  6240. function u(e) {
  6241. ne.progress(e)
  6242. }
  6243. function d(e, t, i) {
  6244. var n = t.player;
  6245. $("#gui-thumb").fadeOut(2500),
  6246. ne.hide(function() {
  6247. Ge = !1
  6248. }),
  6249. me.init(e, i),
  6250. de.finishSetup(Object.keys(e.tags).length),
  6251. i.on(Te.IMAGE_OPENED, Ze.bind(this, "tag"));
  6252. var s = function() {
  6253. i.dismissExaminedTag(),
  6254. i.disableHovering()
  6255. };
  6256. Ae.on(ye.OPENED, s),
  6257. Ce.on(Me.OPENED, s),
  6258. he.on(ue.OPENED, s),
  6259. fe.on(ge.OPENED, s);
  6260. var l = i.enableHovering.bind(i);
  6261. if (Ae.on(ye.CLOSED, l),
  6262. Ce.on(Me.CLOSED, l),
  6263. he.on(ue.CLOSED, l),
  6264. fe.on(ge.CLOSED, l),
  6265. Q.labels.enabled && Object.keys(e.labels).length,
  6266. e.floors.length <= 1 || !je.floors.visible ? je.floors.visible = !1 : (y(e, t),
  6267. C(e.currentFloor, n.mode)),
  6268. getQueryVariable('m') === '372'&& (je.floors.visible = 1, y(e,t)),
  6269. r(),
  6270. o(t, t.player),
  6271. $("#gui").fadeIn(1500),
  6272. je.highlight.visible && (2 !== Q.startHighlights || e.has360Views) && setTimeout(function() {
  6273. a(),
  6274. (!e.has360Views && 1 !== Q.startHighlights || e.has360Views && 0 === Q.startHighlights) && setTimeout(a, 2e3)
  6275. }, 2e3),
  6276. !K.isMobile())
  6277. for (var c = ["a", "#title-toggle", ".next-button", ".prev-button", ".gui-floor", ".meta-toggle", ".thumbImg", "logo-button"], h = 0; h < c.length; h++)
  6278. $(c[h]).addClass("hasHover");
  6279. O(e),
  6280. de.setupToggling();
  6281. //xzw:
  6282. window.editHotPanel && editHotPanel();
  6283. //czj
  6284. navBorderRadius(e);
  6285. //czj 编辑界面
  6286. //window.EditingInterface && new EditingInterface(n.sceneRenderer);
  6287. window.EditTools && new EditTools(n.sceneRenderer);
  6288. }
  6289. function navBorderRadius(e){
  6290. var pullTab = $("#pullTab"),
  6291. mobileRadius = {
  6292. "bottom":{"border-bottom-left-radius":"10px","border-bottom-right-radius":"10px"},
  6293. "top":{"border-top-left-radius":"10px","border-top-right-radius":"10px"}
  6294. },
  6295. topRadius = {
  6296. "bottom":{"border-top-right-radius":"10px","border-bottom-right-radius":"10px"},
  6297. "top":{"border-bottom-left-radius":"10px","border-top-left-radius":"10px"}
  6298. };
  6299. function BorderRadius(bottom,top){
  6300. $("#gui-modes-map > div:visible:last").css(bottom);
  6301. if(pullTab.is(':visible')){
  6302. $(".viewContainer > div:visible:first").css(top);
  6303. }else{
  6304. $("#gui-modes-map > div:visible:first").css(top);
  6305. }
  6306. }
  6307. if(/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)){
  6308. BorderRadius(mobileRadius.bottom,mobileRadius.top);
  6309. }else{
  6310. BorderRadius(topRadius.bottom,topRadius.top);
  6311. }
  6312. //判断someData里面是否有special字段,如果有就会处理这些特殊的大场景
  6313. if(window.DATA.model.special || window.DATA.special){
  6314. window.specialScene && specialScene.special().afterImplement();
  6315. }
  6316. }
  6317. function p(e) {
  6318. e || (e = 0),
  6319. We = !1,
  6320. window.setTimeout(function() {
  6321. We || (ze = !0,
  6322. $("#gui-spinner").stop(!0, !0).show())
  6323. }
  6324. .bind(this), e)
  6325. }
  6326. function f() {
  6327. $("#gui-spinner").stop(!0, !0),
  6328. $("#gui-spinner").fadeOut(1e3),
  6329. We = !0,
  6330. ze = !1
  6331. }
  6332. function g(e, t) {
  6333. var i = e.mode
  6334. , n = t || e.currentPano;
  6335. $("#gui-modes-dollhouse").toggleClass("active", i === _e.DOLLHOUSE),
  6336. $("#gui-modes-floorplan").toggleClass("active", i === _e.FLOORPLAN),
  6337. $("#gui-modes-inside").toggleClass("active", i === _e.PANORAMA),
  6338. i === _e.PANORAMA ? ($("#view-controllers").slideUp(500),
  6339. Q.show360Views.enabled && !n.isAligned() ? (
  6340. $(".gui-floor").addClass("hidden"),
  6341. $("#gui-modes-outside").addClass("desktop-only")) : (
  6342. $(".gui-floor").removeClass("hidden"),
  6343. $("#gui-modes-outside").removeClass("desktop-only")),
  6344. $("#gui-modes-outside").removeClass("hidden")) : i !== _e.TRANSITIONING && (f(),
  6345. Be = i,
  6346. $("#gui-modes-outside").addClass("hidden"),
  6347. e.model.has360Views && $(".gui-floor").removeClass("hidden"),
  6348. $("#view-controllers").is(":visible") || $("#view-controllers").slideDown(Q.guiAnimationSpeed))
  6349. }
  6350. function m(e, t) {
  6351. var i = t.player;
  6352. $("#gui-modes-inside").on("mousedown touchstart", function(e) {
  6353. l(e),
  6354. J.updateInteraction(Se.InteractionGui, "inside-button"),
  6355. J.track("USER", {
  6356. event_type: "showcase_gui",
  6357. gui_action: "click_inside_mode_button"
  6358. }),
  6359. t.changeMode(_e.PANORAMA);
  6360. }),
  6361. $("#gui-modes-outside").find("a").on("click", function(e) {
  6362. l(e),
  6363. J.track("showcase_gui", {
  6364. gui_action: "click_outside_mode_button"
  6365. }),
  6366. t.changeMode(Be)
  6367. }),
  6368. $("#gui-modes-floorplan").on("click", function(e) {
  6369. l(e),
  6370. i.mode !== _e.FLOORPLAN && (J.track("showcase_gui", {
  6371. gui_action: "click_floorplan_mode_button"
  6372. }),
  6373. t.changeMode(_e.FLOORPLAN));
  6374. }),
  6375. $("#gui-modes-dollhouse").on("click", function(e) {
  6376. l(e),
  6377. i.mode !== _e.DOLLHOUSE && (J.track("showcase_gui", {
  6378. gui_action: "click_dollhouse_mode_button"
  6379. }),
  6380. t.changeMode(_e.DOLLHOUSE));
  6381. })
  6382. }
  6383. function v(e, t) {
  6384. function i() {
  6385. document.getElementById("vr").classList.remove("hidden"),
  6386. Q.vr.allowWebVR ? K.getVRDisplay().then(function(e) {
  6387. K.supportsFullscreen() ? n(e) : (De.warn("Unable to use WebVR when full screen is not supported"),
  6388. $(".improper-embed").toggleClass("hidden", !1),
  6389. r())
  6390. }, function(e) {
  6391. r()
  6392. }) : r()
  6393. }
  6394. function n(i) {
  6395. De.info(i.displayName + " detected, VR button activates WebVR experience"),
  6396. Ie.init(e.data, t, i, q),
  6397. Ie.on(Ee.OPENED, Ze.bind(gui, "vr")),
  6398. Ie.on(Ee.SHOW_TERMS, fe.show.bind(fe))
  6399. }
  6400. function r() {
  6401. De.info("WebVR support not found, VR button activates native app VR modal"),
  6402. Ae.init(e.data, q),
  6403. Ae.on(ye.OPENED, function() {
  6404. var e = document.getElementById("vr-modal");
  6405. return function() {
  6406. Ze("vr"),
  6407. le.open(e)
  6408. }
  6409. }()),
  6410. Ae.on(ye.CLOSED, le.reset)
  6411. }
  6412. if (Q.vr.enabled && e.supportsVR && !K.valueFromHash("mls", 0)){
  6413. /*********************** 方奕卓 VR功能事件监听 ********************/
  6414. K.isMobile() && $('#vr').css('display', ''); // 显示vr功能按钮
  6415. switch (Q.vr.option) {
  6416. case Pe.CONTEXTUAL:
  6417. i();
  6418. break;
  6419. case Pe.ANDROID:
  6420. K.detectAndroid() && i();
  6421. break;
  6422. case Pe.NONE:
  6423. }
  6424. }
  6425. }
  6426. function A(e, t) {
  6427. $("#play").on("mousedown touchstart", function(e) {
  6428. l(e);
  6429. Ze("tour");
  6430. ve.play();
  6431. J.trackAlways("showcase_gui", {
  6432. gui_action: "play_highlights"
  6433. })
  6434. }),
  6435. window.startAndPlay = function(e) {
  6436. // l(e);
  6437. Ze("tour");
  6438. ve.play();
  6439. J.trackAlways("showcase_gui", {
  6440. gui_action: "play_highlights"
  6441. })
  6442. };
  6443. $("#pause").on("mousedown touchstart", function(e) {
  6444. l(e),
  6445. ve.pause(),
  6446. J.trackAlways("showcase_gui", {
  6447. gui_action: "pause_highlights"
  6448. })
  6449. }),
  6450. $("#gui-zoomin").find("a").on("click", function(e) {
  6451. l(e),
  6452. t.player.zoomInIncrementally()
  6453. }),
  6454. $("#gui-zoomout").find("a").on("click", function(e) {
  6455. l(e),
  6456. t.player.zoomOutIncrementally()
  6457. })
  6458. }
  6459. function y(e, t) {
  6460. for (var i = $(".gui-floor"), n = 0; n < e.floors.length; n++) {
  6461. if(getQueryVariable('m') === '372') continue;
  6462. var r = $('<div class="floorChoice" data-index="' + n + '"></div>').text(e.floors.get(n).name);
  6463. $(".gui-floor").find(".container").prepend(r)
  6464. //cxz 本来一开始是prepend 后来改了append 按顺序插入
  6465. }
  6466. i.find(".container").prepend('<div class="floorChoice darkGlass allFloorBtn" data-index="all" style="display:none">' + Re.FLOOR_ALL + "</div>"),
  6467. i.on("click", function(e) {
  6468. l(e),
  6469. Ze("floor"),
  6470. i.toggleClass("open")
  6471. }),
  6472. $(".floorChoice").on("click", function(e) {
  6473. l(e);
  6474. var n = $(this).data("index");
  6475. "all" !== n ? (J.updateInteraction(Se.InteractionGui, "floor-control"),
  6476. t.player.gotoFloor(n),
  6477. J.track("showcase_gui", {
  6478. gui_action: "click_floor_select_button",
  6479. interaction_source: "gui"
  6480. })) : (J.updateInteraction(Se.InteractionGui, "floor-control"),
  6481. Ze("move"),
  6482. t.allFloors(),
  6483. J.track("showcase_gui", {
  6484. gui_action: "click_toggle_all_floors_button",
  6485. interaction_source: "gui"
  6486. })),
  6487. i.removeClass("open")
  6488. })
  6489. }
  6490. function C(e, t) {
  6491. 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()),
  6492. e.model.allFloorsVisible ? ($(".gui-floor-title").text(Re.FLOOR_ALL),
  6493. $(".gui-floor-number").text(Re.FLOOR_ALL),
  6494. $(".floorChoice").removeClass("active"),
  6495. $('.floorChoice[data-index="all"]').addClass("active")) : ($(".gui-floor-title").text(e.name),
  6496. $(".gui-floor-number").text(" " + (e.floorIndex + 1)),
  6497. $(".floorChoice").removeClass("active"),
  6498. $(".floorChoice[data-index=" + e.floorIndex + "]").addClass("active")))
  6499. }
  6500. function I(e) {
  6501. return e.describe().inTransition
  6502. }
  6503. function b(e, t, i) {
  6504. Fe = e.heroLocations.length;
  6505. var n = '<li class="thumbImg" data-index=""><img src=""></li>'
  6506. , r = 100 / Fe + "%"
  6507. , o = $("#thumb-container")
  6508. , a = $("#progressBar");
  6509. $("#status").find(".totalSteps").text(Fe);
  6510. for (var s = 0; s < Fe; s++) {
  6511. var c = e.heroLocations[s]
  6512. , h = $(n);
  6513. var thumbUrl
  6514. if(c.heroLocations){//有子项,选第一张截图
  6515. thumbUrl = manage.dealURL(c.heroLocations[0].thumbUrl)//.replace('https://','').replace('http://','')
  6516. }else{
  6517. thumbUrl = manage.dealURL(c.thumbUrl)//.replace('https://','').replace('http://','')
  6518. }
  6519. h.attr("data-index", s)
  6520. je.highlight.visible && h.find("img").attr("src", thumbUrl)
  6521. if (c.name) {
  6522. var u = $('<div class="overlay"></div>').text(c.name);
  6523. h.prepend(u)
  6524. }
  6525. if (e.has360Views && c.cameraMode === _e.PANORAMA) {
  6526. var d = e.panos.get(c.panoId)
  6527. , p = d && !d.isAligned()
  6528. , 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>';
  6529. h.prepend(f)
  6530. }
  6531. o.append(h),
  6532. a.append('<div class="step" data-idx="' + s + '" style="width:' + r + '"></div>')
  6533. }
  6534. j = 144 * Fe,
  6535. Y = 111 * Fe,
  6536. $(".thumbImg").on("mouseover", function() {
  6537. I(t) || i.showPathToHeroLocation([$(this).data("index"),0])//改
  6538. }),
  6539. $(".thumbImg").on("mouseout", function() {
  6540. t.clearPath()
  6541. }),
  6542. $(".thumbImg").on("click", function(e) {
  6543. l(e);
  6544. var i = $(this);
  6545. J.updateInteraction(Se.InteractionGui, "thumbnail"),
  6546. J.trackAlways("showcase_gui", {
  6547. gui_action: "click_highlight"
  6548. }),
  6549. t.goToHighlight([i.data("index"),0])//改
  6550. }),
  6551. $(".previous").find("a").on("click", function(e) {
  6552. l(e),
  6553. J.trackAlways("showcase_gui", {
  6554. gui_action: "prev_highlight"
  6555. }),
  6556. t.prevHighlight()
  6557. }),
  6558. $(".next").find("a").on("click", function(e) {
  6559. l(e),
  6560. J.trackAlways("showcase_gui", {
  6561. gui_action: "next_highlight"
  6562. }),
  6563. t.nextHighlight()
  6564. }),
  6565. $("#drawer").on("mouseleave", function(e) {
  6566. l(e);
  6567. var t;
  6568. try {
  6569. t = new MouseEvent("mouseup",{
  6570. clientX: e.clientX,
  6571. clientY: e.clientY,
  6572. screenX: e.screenX,
  6573. screenY: e.screenY
  6574. })
  6575. } catch (i) {
  6576. t = document.createEvent("MouseEvents"),
  6577. 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)
  6578. }
  6579. document.dispatchEvent(t)
  6580. }),
  6581. W = new Sly($("#scrollFrame"),{
  6582. horizontal: !0,
  6583. itemNav: "centered",
  6584. smart: !0,
  6585. scrollTrap: !0,
  6586. scrollBy: 1,
  6587. mouseDragging: !0,
  6588. touchDragging: !0,
  6589. speed: 300,
  6590. dragHandle: !0,
  6591. dynamicHandle: !0,
  6592. clickBar: !0,
  6593. scrollBar: $("#scroller"),
  6594. activateOn: null
  6595. }).init(),
  6596. W.on("active", function(e, t) {
  6597. Ve = t,
  6598. Ze("tour"),
  6599. $(".step").removeClass("active"),
  6600. $("#status").find(".curIdx").text(t + 1);
  6601. for (var i = 0; i <= t; i++)
  6602. $("#progressBar").find("[data-idx='" + i + "']").addClass("active")
  6603. }),
  6604. w()
  6605. }
  6606. function w() {
  6607. var e = $("#player").width() - 20
  6608. , t = $("#scroller")
  6609. , i = $("#drawer")
  6610. , n = $(".pinBottom");
  6611. if ($("#player").width() < 488 || $("#player").height() < 488)
  6612. t.addClass("hidden"),
  6613. i.addClass("noScroll"),
  6614. n.addClass("noScroll");
  6615. else {
  6616. var r = j > e
  6617. , o = !i.hasClass("noScroll")
  6618. , a = r !== o;
  6619. a && (t.toggleClass("hidden"),
  6620. i.toggleClass("noScroll"),
  6621. n.toggleClass("noScroll"))
  6622. }
  6623. }
  6624. function _(e) {
  6625. je.tourControls.visible = true//e.tour_buttons && K.valueFromHash("gt", 1),
  6626. je.coBrand.visible = e.presented_by && 1 !== Q.specialEdition && Q.brand && !K.valueFromHash("mls", !1),
  6627. je.highlight.visible = /* e.highlight_reel && */ 1 !== Q.specialEdition && Q.showHighlights
  6628. }
  6629. function T(e) {
  6630. function t(t, i) {
  6631. return !!e.player_options[t] && e[i || t]
  6632. }
  6633. $(".model-title").text(e.name);
  6634. var i = Q.pageTitle;
  6635. // 2 !== K.valueFromHash("mls", 0) && (i = e.name + " - " + i),
  6636. 2 !== K.valueFromHash("mls", 0) && e.name && (i = e.name),
  6637. document.title = i ,
  6638. K.isMobile() ? $("#gui-fullscreen").css("display", "none") : ($("[rel=tooltip]").tooltip({
  6639. delay: {
  6640. show: 50,
  6641. hide: 0
  6642. },
  6643. trigger: "hover",
  6644. html: !1,
  6645. viewport: {
  6646. selector: "body",
  6647. padding: 10
  6648. }
  6649. }),
  6650. K.inIframe() && document.getElementsByClassName("pinBottom-container")[0].classList.add("embed")),
  6651. // 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"),
  6652. de.populate({
  6653. name: t("model_name", "name"),
  6654. coBrand: t("presented_by"),
  6655. description: t("model_summary", "summary") || "暂无内容",
  6656. contactName: t("contact_name"),
  6657. address: t("address"),
  6658. phone: t("contact_phone"),
  6659. formattedPhone: e.formatted_contact_phone,
  6660. email: t("contact_email"),
  6661. url: t("external_url"),
  6662. socialSharing: e.enable_social_sharing && e.is_public
  6663. })
  6664. }
  6665. function x(e, t, i, n, r, o) {
  6666. function a() {
  6667. o.setLoadingStartTime(),
  6668. H(),
  6669. r ? (re.showMessage(t, i, je.coBrand.visible),
  6670. l()) : h(l)
  6671. }
  6672. var s = $.Deferred()
  6673. , l = s.resolve.bind(s);
  6674. return Ge = !0,
  6675. O(e),
  6676. e.data.player_options && _(e.data.player_options),
  6677. 1 === Q.specialEdition && $("body").addClass("specialEdition"),
  6678. Re.localizeGUI(),
  6679. T(e.data),
  6680. r || $(".quick").addClass("hidden"),
  6681. //e.data.image && !r && E(e.data.image),
  6682. n ? (J.impression(),
  6683. a()) : (o.setWaitingStartTime(),
  6684. oe.show(r, a)),
  6685. s
  6686. }
  6687. function S(e, t, i, n, r, a, s) {
  6688. q = s,
  6689. e.outsideAllowed() || $("#gui-modes-outside").addClass("invisible"),
  6690. e.supportedModes[_e.PANORAMA] || $("#gui-modes-inside").addClass("invisible"),
  6691. ae.init(),
  6692. re.init(e, a),
  6693. Oe.init(e, t, n),
  6694. $(".icon").on("mouseover", function() {
  6695. t.player && t.player.reticule.hide()
  6696. }),
  6697. m(e, t),
  6698. A(e, t),
  6699. e.data.enable_social_sharing && e.data.is_public && Q.share.enabled && (Ce.init(window.DATA.name/* e.data.name */),
  6700. Ce.on(Me.OPENED, function() {
  6701. var e = document.getElementById("share-modal");
  6702. return function() {
  6703. Ze("share"),
  6704. le.open(e)
  6705. }
  6706. }()),
  6707. Ce.on(Me.CLOSED, le.reset)),
  6708. e.heroLocations.length > 0 ? b(e, t, i) : (je.highlight.visible = !1,
  6709. je.tourControls.visible = !1),
  6710. de.on(pe.OPEN_INFO, Ze.bind(this, "info")),
  6711. z(),
  6712. g(i),
  6713. v(e, r),
  6714. e.on("floor.changed", C),
  6715. e.on("waiting", R.bind(this, e)),
  6716. e.on("waiting-done", P.bind(this, e)),
  6717. i.on(xe.ModeChanged, function(e, n) {
  6718. g(i),
  6719. o(t, i),
  6720. n === _e.PANORAMA && i.currentPano && !i.currentPano.isAligned() && (n = _e.OUTDOOR),
  6721. he.updateMode(n)
  6722. }),
  6723. n.on(Se.Move, Ze.bind(this, "move")),
  6724. i.on(xe.Ready, function() {
  6725. ie.init(n, i, i.tagManager, t),
  6726. i.on(xe.ModeChanged, function(e, t) {
  6727. e !== t && $(".vr-popup").is(":visible") && Ae.dismiss()
  6728. })
  6729. }),
  6730. i.on(xe.PanoChosen, function(e, t) {
  6731. g(i, t),
  6732. he.updateMode(t && !t.isAligned() ? _e.OUTDOOR : _e.PANORAMA)
  6733. }),
  6734. le.on(ce.CLOSE, function(e) {
  6735. switch (e) {
  6736. case "vr-modal":
  6737. Ae.dismiss();
  6738. break;
  6739. case "share-modal":
  6740. Ce.hide();
  6741. break;
  6742. case "terms-modal":
  6743. fe.hide()
  6744. }
  6745. });
  6746. var l = $("#play").eq(0)
  6747. , c = $("#pause").eq(0)
  6748. , h = $(".pinBottom").toArray()
  6749. , u = $("#drawer").eq(0)
  6750. , d = $("#playHead").eq(0)
  6751. , p = $("#progressBar").eq(0)
  6752. , f = $("#thumb-container").eq(0)
  6753. , y = f.children()
  6754. , I = p.children();
  6755. t.on("update.controls", function() {
  6756. var n = t.describe();
  6757. n.tourIsPlaying || i.isWarping() ? (je.tourControls.visible && (l.hide(),
  6758. c.show()),
  6759. n.tourInProgress && (h.forEach(function(e) {
  6760. e.classList.add("playing")
  6761. }),
  6762. u.addClass("playing"),
  6763. d.addClass("playing"))) : (je.tourControls.visible && (l.show(),
  6764. c.hide()),
  6765. n.tourInProgress || (ve.stopTour(),
  6766. h.forEach(function(e) {
  6767. e.classList.remove("playing")
  6768. }),
  6769. u.removeClass("playing"),
  6770. d.removeClass("playing")));
  6771. var r, a, s;
  6772. if (null !== n.currentItem) {
  6773. var p, f;
  6774. $("#status").find(".curIdx").text(n.currentItem[0] + 1),
  6775. n.onTheBus ? (p = "active",
  6776. f = "recent") : (f = "active",
  6777. p = "recent");
  6778. var g = null === n.destinationItem || n.currentItem[0] === n.destinationItem[0];
  6779. for (r = 0; r < e.heroLocations.length; r += 1)
  6780. s = y.eq(r),
  6781. a = I.eq(r),
  6782. s.removeClass(f),
  6783. a.removeClass(f),
  6784. n.onTheBus && r === n.destinationItem[0] ? (s.addClass(p),
  6785. a.addClass(p),
  6786. W.activate(r)) : n.onTheBus && g && r === n.currentItem[0] ? (s.addClass(p),
  6787. a.addClass(p)) : (s.removeClass(p),
  6788. a.removeClass(p))
  6789. } else
  6790. for (r = 0; r < e.heroLocations.length; r += 1)
  6791. s = y.eq(r),
  6792. a = I.eq(r),
  6793. s.removeClass("active recent"),
  6794. a.removeClass("active recent");
  6795. o(t, i)
  6796. }),
  6797. document.addEventListener("keydown", function(n) {
  6798. switch (J.updateInteraction(Se.InteractionKey),
  6799. n.which) {
  6800. case we.ZERO:
  6801. Q.debug && e.toggleAlpha();
  6802. break;
  6803. case we.NINE:
  6804. Q.debug && se.toggle();
  6805. break;
  6806. case we.ONE:
  6807. i.isInMode(_e.TRANSITIONING) || t.changeMode(_e.PANORAMA);
  6808. break;
  6809. case we.TWO:
  6810. e.outsideAllowed() && !i.isInMode(_e.DOLLHOUSE, _e.TRANSITIONING) && t.changeMode(_e.DOLLHOUSE);
  6811. break;
  6812. case we.THREE:
  6813. e.outsideAllowed() && !i.isInMode(_e.FLOORPLAN, _e.TRANSITIONING) && t.changeMode(_e.FLOORPLAN);
  6814. break;
  6815. case we.FOUR:
  6816. i.isInMode(_e.TRANSITIONING) || t.changeMode(_e.OUTDOOR);
  6817. break;
  6818. case we.SPACE:
  6819. je.tourControls.visible && ($("#playHead").hasClass("playing") || Ze("tour"));
  6820. break;
  6821. case we.RETURN:
  6822. Q.debug && e.toggleExplodeUp();
  6823. break;
  6824. case we.P:
  6825. k();
  6826. break;
  6827. case we.U:
  6828. B();
  6829. break;
  6830. case we.X:
  6831. Q.debug && e.toggleExplode();
  6832. break;
  6833. case we.PLUSEQUALS:
  6834. t.player.activatePersistentZooming(!0),
  6835. ie.hideUi();
  6836. break;
  6837. case we.DASHUNDERSCORE:
  6838. t.player.activatePersistentZooming(!1),
  6839. ie.hideUi();
  6840. break;
  6841. case we.SEVEN:
  6842. De.info("Zoom level: " + t.player.zoomLevel + ", FOV: " + t.player.zoomFov);
  6843. break;
  6844. case we.EIGHT:
  6845. t.player.decreaseZoomSpeed();
  6846. break;
  6847. case we.NINE:
  6848. t.player.increaseZoomSpeed()
  6849. }
  6850. return i && i.reticule.hide(),
  6851. !0
  6852. }
  6853. .bind(this)),
  6854. document.addEventListener("keyup", function(e) {
  6855. switch (e.which) {
  6856. case we.PLUSEQUALS:
  6857. t.player.deactivatePersistentZooming();
  6858. break;
  6859. case we.DASHUNDERSCORE:
  6860. t.player.deactivatePersistentZooming()
  6861. }
  6862. }
  6863. .bind(this)),
  6864. F(e),
  6865. L(e, t.player),
  6866. M(i),
  6867. te.setAutoPlay(e.heroCount()),
  6868. he.init(i, a.mode),
  6869. he.on(ue.OPENED, Ze.bind(this, "help")),
  6870. fe.init(),
  6871. fe.on(ge.OPENED, function() {
  6872. var e = document.getElementById("terms-modal");
  6873. return function() {
  6874. Ze("terms"),
  6875. le.open(e)
  6876. }
  6877. }()),
  6878. fe.on(ge.CLOSED, le.reset),
  6879. Q.quickstart.enabled || re.delayLanding(a.mode).then(re.showMessage.bind(this, i, t, je.coBrand.visible)),
  6880. (Q.quickstart.enabled || i.model.outsideAllowed()) && ie.init(n, i, i.tagManager, t),
  6881. Q.profiling.enabled && se.show(),
  6882. ve.init(t)
  6883. }
  6884. function M(e) {
  6885. var t = function(e, t) {
  6886. $(e).find("a").each(function(e, i) {
  6887. t ? $(i).removeClass("buttonZoomDisabled").addClass("buttonZoomEnabled") : $(i).addClass("buttonZoomDisabled").removeClass("buttonZoomEnabled"),
  6888. i.style.pointerEvents = t ? "auto" : "none"
  6889. })
  6890. }
  6891. , i = function() {
  6892. e.zoomLevel >= Q.zoom.max ? t("#gui-zoomin", !1) : t("#gui-zoomin", !0),
  6893. e.zoomLevel <= Q.zoom.min ? t("#gui-zoomout", !1) : t("#gui-zoomout", !0)
  6894. };
  6895. e.on(Ne.ZoomMax, function() {
  6896. t("#gui-zoomin", !1),
  6897. t("#gui-zoomout", !0)
  6898. }),
  6899. e.on(Ne.ZoomMin, function() {
  6900. t("#gui-zoomin", !0),
  6901. t("#gui-zoomout", !1)
  6902. }),
  6903. e.on(Ne.ZoomIn, function() {
  6904. t("#gui-zoomout", !0)
  6905. }),
  6906. e.on(Ne.ZoomOut, function() {
  6907. t("#gui-zoomin", !0)
  6908. }),
  6909. i()
  6910. }
  6911. function R(e) {
  6912. O(e)
  6913. }
  6914. function P(e) {
  6915. O(e)
  6916. }
  6917. function O(e) {
  6918. var t = e.waitQueue.length;
  6919. t <= 0 ? f() : Ge || p(Q.modelComponentLoadSpinnerDelay)
  6920. }
  6921. function L(e, t) {
  6922. He = {
  6923. gui: null,
  6924. visible: !1,
  6925. model: e,
  6926. player: t
  6927. }
  6928. }
  6929. function D(e, t) {
  6930. function i() {
  6931. var i = t.toJSON();
  6932. n.linkToLocation = window.location.protocol + "//" + window.location.host + window.location.pathname + "?m=" + e.sid + "&start=" + be.serialize(i),
  6933. t.tagManager.activeTag && (n.linkToLocation += "&tag=" + t.tagManager.activeTag.sid)
  6934. }
  6935. var n = {}
  6936. , r = new Le.GUI({
  6937. autoPlace: !0,
  6938. width: "60%"
  6939. });
  6940. i(),
  6941. t.on(xe.ViewChanged, i),
  6942. r.add(n, "linkToLocation").name(Re.LINK_TO_LOCATION).listen(),
  6943. r.domElement.id = "datLinks";
  6944. var o = [].slice.call(r.domElement.querySelectorAll(".property-name"));
  6945. return o.forEach(function(e) {
  6946. if (!K.detectSafari()) {
  6947. var t = document.createElement("button");
  6948. t.classList.add("btn-deep-link"),
  6949. t.innerText = Re.MENU_COPY,
  6950. e.nextSibling.appendChild(t);
  6951. var i = function() {
  6952. alert(Re.LINK_ALERT_COPY),
  6953. t.hide()
  6954. };
  6955. t.addEventListener("click", function(e) {
  6956. try {
  6957. var t = e.target.parentNode.childNodes[0];
  6958. t.select();
  6959. var n = document.execCommand("copy");
  6960. t.blur(),
  6961. n || i()
  6962. } catch (e) {
  6963. i()
  6964. }
  6965. })
  6966. }
  6967. }),
  6968. $(r.__closeButton).hide(),
  6969. r
  6970. }
  6971. function N(e) {
  6972. He.gui || (He.gui = D(He.model, He.player)),
  6973. He.visible = e,
  6974. e ? $(He.gui.domElement).show() : $(He.gui.domElement).hide()
  6975. }
  6976. function B() {
  6977. N(!He.visible)
  6978. }
  6979. function F(e) {
  6980. ke = {
  6981. gui: null,
  6982. visible: !1,
  6983. model: e
  6984. }
  6985. }
  6986. function V(e) {
  6987. var t = new Le.GUI;
  6988. return t.add(Q, "showSweeps").name("Show sweeps").onFinishChange(function() {
  6989. e.setSweepVisibility(Q.showSweeps)
  6990. }),
  6991. t.add(Q, "rotationAccelerationInside", .1, 10).name("Rotation speed").step(.1),
  6992. t.add(Q.transition, "flyTime", 0, 5e3).name("Transition time").onFinishChange(function() {
  6993. Q.transition.flySpeed = 0,
  6994. t.__controllers.forEach(function(e) {
  6995. e.updateDisplay()
  6996. })
  6997. }),
  6998. t.add(Q.path, "opacity", 0, 1).name("Path opacity"),
  6999. $(t.__closeButton).hide(),
  7000. t
  7001. }
  7002. function U(e) {
  7003. ke.gui || (ke.gui = V(ke.model)),
  7004. ke.visible = e,
  7005. e ? $(ke.gui.domElement).show() : $(ke.gui.domElement).hide()
  7006. }
  7007. function k() {
  7008. U(!ke.visible)
  7009. }
  7010. function H() {
  7011. function e(e) {
  7012. e.target === t || $.contains(t, e.target) || e.target === i || $.contains(i, e.target) || e.target === n || $.contains(n, e.target)/* || e.preventDefault()*/
  7013. }
  7014. $("body").css("touch-action", "none"),
  7015. $("#gui-parent").find("*:not(#tag-billboards)").on("touchmove", function(e) {
  7016. // e.preventDefault()
  7017. });
  7018. var t = document.getElementById("terms-text")
  7019. , i = document.getElementById("more-help-wrapper")
  7020. , n = (document.getElementById("navigation-help-wrapper"),
  7021. document.getElementById("help-dialog"),
  7022. document.getElementById("tag-billboards"));
  7023. Q.useWheel && (document.body.addEventListener("mousewheel", e, { passive: false }),
  7024. document.body.addEventListener("DOMMouseScroll", e)),
  7025. $("#terms-text, #more-help-wrapper, #navigation-help-wrapper").off("touchmove").on("touchmove", function(e) {
  7026. e.stopPropagation()
  7027. })
  7028. }
  7029. function G(e, t) {
  7030. for (var i = []; e; )
  7031. i.push(e),
  7032. e = e.parentNode;
  7033. for (; t && i.indexOf(t) === -1; )
  7034. t = t.parentNode;
  7035. return t
  7036. }
  7037. function z() {
  7038. var e, t = function(t) {
  7039. e = 0 === t.button || 1 === t.which ? t.target : null
  7040. }, i = function(t) {
  7041. e !== t.target && (e = G(e, t.target));
  7042. var i = document.getElementById("gui-parent");
  7043. if (G(i, e) !== i && (e = null),
  7044. e) {
  7045. var n;
  7046. try {
  7047. n = new MouseEvent("click",t)
  7048. } catch (e) {
  7049. n = document.createEvent("MouseEvents"),
  7050. 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)
  7051. }
  7052. n.syntheticClick = !0,
  7053. e.dispatchEvent(n),
  7054. e = null
  7055. }
  7056. };
  7057. document.body.addEventListener("mousedown", t, !0),
  7058. document.body.addEventListener("mouseup", i, !0),
  7059. document.getElementById("gui-parent").addEventListener("click", function(e) {
  7060. e.syntheticClick || (e.stopPropagation(),
  7061. "A" === e.target.nodeName && e.preventDefault())
  7062. }, !0)
  7063. }
  7064. var W, j, Y, X, Z, q, K = (e("three"),
  7065. e("../util/ajax"),
  7066. e("../util/browser")), Q = e("../settings"), J = e("../analytics"), ee = (e("../util/transitions"),
  7067. e("../util/camera"),
  7068. e("../util/logger")), te = (e("../objects/Snapshot"),
  7069. 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"),
  7070. e("../tag/Media/MediaEvent")), xe = (e("../enum/PathDiscardMode"),
  7071. e("../enum/PathDisplayMode"),
  7072. e("../enum/DirectorEvents"),
  7073. e("../enum/PlayerEvents")), Se = e("../enum/ControlEvents"), Me = e("./sharing/ShareEvents"), Re = e("../localization/localize"), Pe = (e("../enum/Vectors"),
  7074. e("../enum/WarpStyle"),
  7075. e("../enum/AlignmentType"),
  7076. e("../enum/VROption")), Oe = e("./konami"), Le = e("../lib/dat.gui"), De = new ee(i), Ne = (e("../util/showcase"),
  7077. e("../enum/ZoomEvents")), Be = _e.DOLLHOUSE, Fe = 0, Ve = 0, Ue = [".hideTarget"], ke = null, He = null, Ge = !1, ze = !1, We = !1, je = {
  7078. coBrand: {
  7079. visible: !0,
  7080. elements: [".co-brand", "#loaderCoBrand"]
  7081. },
  7082. help: {
  7083. visible: !0,
  7084. elements: [".nav-help", "#nav-help"]
  7085. },
  7086. tourControls: {
  7087. visible: !0,
  7088. elements: [".next", ".previous", "#play"]
  7089. },
  7090. highlight: {
  7091. visible: !0,
  7092. elements: ["#drawer", "#pullTab"]
  7093. },
  7094. share: {
  7095. visible: !0,
  7096. elements: [".socialButton", "#share"]
  7097. },
  7098. fullScreen: {
  7099. visible: !0,
  7100. elements: ["#gui-fullscreen"]
  7101. },
  7102. floors: {
  7103. visible: !0,
  7104. elements: [".gui-floor"]
  7105. }
  7106. }, Ye = function() {
  7107. var e = document.getElementById("drawer");
  7108. return function() {
  7109. $("#player").height() < 400 && e.classList.contains("open") && a()
  7110. }
  7111. }(), Xe = function() {
  7112. var e = document.getElementById("meta-info");
  7113. return function() {
  7114. $("#player").height() < 400 && e.classList.contains("expand") && de.toggleMeta(!0)
  7115. }
  7116. }(), Ze = function(e) {
  7117. function t() {
  7118. u.classList.contains("expand") && de.toggleMeta(!0)
  7119. }
  7120. function i() {
  7121. fe.hide()
  7122. }
  7123. function n() {
  7124. he.close()
  7125. }
  7126. function r() {
  7127. Ae.dismiss()
  7128. }
  7129. function o() {
  7130. p.hasClass("open") && a(!0)
  7131. }
  7132. function l() {
  7133. Ce.hide()
  7134. }
  7135. function c() {
  7136. f.hasClass("open") && f.removeClass("open")
  7137. }
  7138. function h() {
  7139. d.classList.contains("fadeIn") && (d.classList.contains("landing") ? re.dismissModal() : d.classList.contains("tour") && ve.dismissModal())
  7140. }
  7141. var u = document.getElementById("meta-info")
  7142. , d = document.getElementById("interaction-modal")
  7143. , p = $("#drawer").eq(0)
  7144. , f = $(".gui-floor").eq(0)
  7145. , g = $(".vr-popup").eq(0);
  7146. return function(e) {
  7147. switch (e) {
  7148. case "info":
  7149. i(),
  7150. n(),
  7151. Ye(),
  7152. l(),
  7153. c(),
  7154. r(),
  7155. h();
  7156. break;
  7157. case "terms":
  7158. t(),
  7159. n(),
  7160. o(),
  7161. l(),
  7162. c(),
  7163. r(),
  7164. h();
  7165. break;
  7166. case "help":
  7167. t(),
  7168. i(),
  7169. l(),
  7170. c(),
  7171. r(),
  7172. h();
  7173. break;
  7174. case "vr":
  7175. t(),
  7176. i(),
  7177. l(),
  7178. c(),
  7179. n(),
  7180. h(),
  7181. s(g) && o();
  7182. break;
  7183. case "highlights":
  7184. Xe(),
  7185. i(),
  7186. l(),
  7187. c();
  7188. break;
  7189. case "share":
  7190. t(),
  7191. i(),
  7192. n(),
  7193. c(),
  7194. r(),
  7195. h();
  7196. break;
  7197. case "floor":
  7198. i(),
  7199. l(),
  7200. r();
  7201. break;
  7202. case "view":
  7203. c(),
  7204. l(),
  7205. i(),
  7206. r();
  7207. break;
  7208. case "tour":
  7209. i(),
  7210. l(),
  7211. c(),
  7212. r();
  7213. break;
  7214. case "move":
  7215. i(),
  7216. l(),
  7217. c(),
  7218. r();
  7219. break;
  7220. case "resize":
  7221. t(),
  7222. Ye(),
  7223. c();
  7224. break;
  7225. case "tag":
  7226. i(),
  7227. n(),
  7228. l(),
  7229. c(),
  7230. r()
  7231. }
  7232. }
  7233. }();
  7234. $(document).on("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", function(e) {
  7235. $("#gui-fullscreen").toggle(!K.isFullscreen()),
  7236. $("#gui-fullscreen-exit").toggle(!!K.isFullscreen()),
  7237. setTimeout(function() {
  7238. $(".icon:visible").hide().show(0)
  7239. }, 100)
  7240. }),
  7241. $("#gui-fullscreen").find("a").on("click", function(e) {
  7242. l(e),
  7243. K.requestFullscreen($("body")[0]),
  7244. J.track("showcase_gui", {
  7245. gui_action: "click_enter_fullscreen",
  7246. interaction_source: "gui"
  7247. })
  7248. //czj
  7249. //W.reload()
  7250. }),
  7251. $("#gui-fullscreen-exit").find("a").on("click", function(e) {
  7252. l(e),
  7253. K.exitFullscreen(),
  7254. J.track("showcase_gui", {
  7255. gui_action: "click_exit_fullscreen",
  7256. interaction_source: "gui"
  7257. })
  7258. })
  7259. $(window).on("resize", function(e) {
  7260. var t = e.target.innerHeight
  7261. , i = e.target.innerWidth;
  7262. t === X && i === Z || (je.highlight.visible && w(),
  7263. Ze("resize"),
  7264. $(".pinTop.right").removeClass("hideUnderMeta"),
  7265. c(),
  7266. X = t,
  7267. Z = i)
  7268. }).resize(),
  7269. K.supportsFullscreen() || $("#gui-fullscreen").hide(),
  7270. $("#pullTab").on("click", function(e) {
  7271. l(e),
  7272. $("#drawer").hasClass("open") ? (J.trackAlways("showcase_gui", {
  7273. gui_action: "hide_highlight_reel"
  7274. }),
  7275. $(this).addClass("open").children("img").attr("src","images/auto.png")) : (J.trackAlways("showcase_gui", {
  7276. gui_action: "show_highlight_reel"
  7277. }),
  7278. $(this).removeClass("open").children("img").attr("src","images/auto-suspend.png"));
  7279. a()
  7280. });
  7281. /***********************方奕卓 热点列表事件监听 ************************/
  7282. if(window.DATA.showHotListSta) {
  7283. $('#hotList').css('display', '');
  7284. $('#hotList').on('click',function(e){
  7285. l(e);
  7286. var hotList = $('#hotListWrap')[0];
  7287. var isActive = hotList.classList.contains('hotListActive');
  7288. if(isActive){
  7289. hotList.classList.remove('hotListActive');
  7290. this.classList.remove('active')
  7291. }else{
  7292. hotList.classList.add('hotListActive');
  7293. this.classList.add('active')
  7294. }
  7295. }),
  7296. $('#hotListContent ul').on('mouseover', function(e){
  7297. l(e);
  7298. var target = e.target;
  7299. var hotList = document.getElementById('hotListWrap');
  7300. if(target.tagName === 'SPAN'){
  7301. var targetParent = target.parentElement.parentElement;
  7302. if(target.offsetWidth + 116 >= targetParent.clientWidth){
  7303. hotList.style.width = target.offsetWidth + 116 + 'px';
  7304. }else{
  7305. hotList.style.width = '';
  7306. }
  7307. }else if(target.tagName === 'LI'){
  7308. var targetParent = target.parentElement;
  7309. if(target.children[0].offsetWidth + 116 >= targetParent.clientWidth){
  7310. hotList.style.width = target.children[0].offsetWidth + 116 + 'px';
  7311. }else{
  7312. hotList.style.width = ''
  7313. }
  7314. }else {
  7315. hotList.style.width = '';
  7316. }
  7317. });
  7318. $('#hotListContent ul').on('click', function(e){
  7319. l(e);
  7320. this.preElem && this.preElem.classList.remove('active');
  7321. if(e.target.tagName === 'SPAN'){
  7322. e.target.parentElement.classList.add('active');
  7323. e.target.parentElement.hot && e.target.parentElement.hot.examine(window.player,true); // 打开热点
  7324. this.preElem = e.target.parentElement;
  7325. }else{
  7326. e.target.classList.add('active');
  7327. e.target.hot && e.target.hot.examine(window.player,true); // 打开热点
  7328. this.preElem = e.target;
  7329. }
  7330. })
  7331. $('#hotListClose').on('click', function(e){
  7332. l(e);
  7333. var hotList = $('#hotListWrap')[0];
  7334. hotList.classList.remove('hotListActive');
  7335. $('#hotListContent ul .active').removeClass('active');
  7336. $('#hotList')[0].classList.remove('active')
  7337. })
  7338. }
  7339. /*****************************************************************/
  7340. $("#more-menu-button").on("click", function(e) {
  7341. l(e);
  7342. var t = $("#more-menu");
  7343. t.toggleClass("open")
  7344. }),
  7345. t.exports.init = S,
  7346. t.exports.startLoading = x,
  7347. t.exports.endLoading = d,
  7348. t.exports.onProgress = u
  7349. }
  7350. ).call(this, "/js/gui/gui.js")
  7351. }
  7352. , {
  7353. "../analytics": 4,
  7354. "../controls/serializer": 14,
  7355. "../enum/AlignmentType": 17,
  7356. "../enum/BlackoutStyle": 18,
  7357. "../enum/ControlEvents": 21,
  7358. "../enum/DirectorEvents": 23,
  7359. "../enum/Keys": 30,
  7360. "../enum/PathDiscardMode": 38,
  7361. "../enum/PathDisplayMode": 39,
  7362. "../enum/PlayerEvents": 40,
  7363. "../enum/VROption": 47,
  7364. "../enum/Vectors": 50,
  7365. "../enum/Viewmode": 51,
  7366. "../enum/WarpStyle": 52,
  7367. "../enum/ZoomEvents": 53,
  7368. "../lib/dat.gui": 93,
  7369. "../localization/localize": 108,
  7370. "../tag/Media/MediaEvent": 131,
  7371. "../objects/Snapshot": 153,
  7372. "../settings": 166,
  7373. "../util/ajax": 181,
  7374. "../util/browser": 182,
  7375. "../util/camera": 183,
  7376. "../util/logger": 189,
  7377. "../util/showcase": 193,
  7378. "../util/transitions": 195,
  7379. "./closer/ModalCloserEvent": 61,
  7380. "./closer/modalCloser": 62,
  7381. "./help/HelpEvent": 66,
  7382. "./help/help": 67,
  7383. "./helpManager": 68,
  7384. "./immersiveMode": 69,
  7385. "./konami": 70,
  7386. "./landingScreen": 71,
  7387. "./loadingScreen": 72,
  7388. "./memoryUsage": 73,
  7389. "./playButton": 74,
  7390. "./populateModal": 75,
  7391. "./sharing/ShareEvents": 76,
  7392. "./sharing/modal": 77,
  7393. "./terms/TermsEvent": 78,
  7394. "./terms/terms": 79,
  7395. "./title/TitleEvents": 80,
  7396. "./title/tagToggle": 81,
  7397. "./title/titleBar": 82,
  7398. "./tourInteraction": 84,
  7399. "./vr/vrEvent": 85,
  7400. "./vr/vrModal": 87,
  7401. "./webvr/WebVrEvent": 88,
  7402. "./webvr/webVRgui": 89,
  7403. three: 217
  7404. }],
  7405. 66: [function(e, t, i) {
  7406. "use strict";
  7407. t.exports = Object.freeze({
  7408. OPENED: "help.opened",
  7409. CLOSED: "help.closed"
  7410. })
  7411. }
  7412. , {}],
  7413. 67: [function(e, t, i) {
  7414. "use strict";
  7415. function n() {
  7416. g.on("click", function(e) {
  7417. if (S && S !== l.TRANSITIONING) {
  7418. var t = window.getComputedStyle(y).getPropertyValue("opacity") > 0;
  7419. t && !M ? R.close() : r()
  7420. }
  7421. }),
  7422. w.on("click", function(e) {
  7423. R.close()
  7424. }),
  7425. E.on("click", function(e) {
  7426. S && S !== l.TRANSITIONING && (s(),
  7427. o())
  7428. }),
  7429. b.on("click", function(e) {
  7430. s(),
  7431. a()
  7432. })
  7433. }
  7434. function r() {
  7435. S && S !== l.TRANSITIONING && (M = !0,
  7436. setTimeout(function() {
  7437. M = !1
  7438. }, d.help.modalStayDuration),
  7439. R.emit(h.OPENED),
  7440. m.addClass("open " + S),
  7441. g.addClass("open"),
  7442. s(),
  7443. o(),
  7444. y.style.removeProperty ? y.style.removeProperty("display") : y.style.removeAttribute("display"),
  7445. y.classList.add("fadeIn"))
  7446. }
  7447. function o() {
  7448. E.addClass("underline-tab"),
  7449. u.fill(_, c.NAVIGATION, S),
  7450. m.addClass(S)
  7451. }
  7452. function a() {
  7453. b.addClass("underline-tab"),
  7454. u.fill(T, c.MORE_HELP),
  7455. m.addClass("more-help")
  7456. }
  7457. function s(e, t) {
  7458. m.removeClass("more-help " + l.PANORAMA + " " + l.DOLLHOUSE + " " + l.FLOORPLAN + " " + l.OUTDOOR),
  7459. I.forEach(function(e) {
  7460. e.classList.remove("underline-tab")
  7461. })
  7462. }
  7463. var l = e("../../enum/Viewmode")
  7464. , c = e("../../enum/HelpModalType")
  7465. , h = e("./HelpEvent")
  7466. , u = (e("../helpManager"),
  7467. e("./../populateModal"))
  7468. , d = e("../../settings")
  7469. , p = e("../../util/common")
  7470. , f = e("events").EventEmitter
  7471. , g = $(".footer-help").eq(0)
  7472. , m = $("#help-dialog").eq(0)
  7473. , v = document.querySelector("#quick-logo")
  7474. , A = document.querySelector("#loaderCoBrand")
  7475. , y = document.querySelector("#help-dialog")
  7476. , C = document.querySelector(".footer")
  7477. , I = $(".help-tabs").children().toArray()
  7478. , E = $(".navigation-tab").eq(0)
  7479. , b = $(".more-help-tab").eq(0)
  7480. , w = ($("#interaction-modal").eq(0).find(".interaction").toArray(),
  7481. m.find(".close").eq(0))
  7482. , _ = m.find(".interactions").toArray()
  7483. , T = m.find(".ui-instructions").toArray()
  7484. , x = l.PANORAMA
  7485. , S = l.PANORAMA
  7486. , M = !1
  7487. , R = {
  7488. init: function(e, t) {
  7489. S = t,
  7490. x = t,
  7491. [y, A, v, C].forEach(function(e) {
  7492. e.classList.add(u.deviceType)
  7493. }),
  7494. n()
  7495. },
  7496. close: function() {
  7497. if (m.hasClass("open") && (this.emit(h.CLOSED),
  7498. g.removeClass("open"),
  7499. m.removeClass("open"),
  7500. y.classList.contains("fadeIn"))) {
  7501. y.classList.remove("fadeIn");
  7502. var e = S === l.TRANSITIONING ? x : S;
  7503. u.clear(_, c.NAVIGATION, e)
  7504. }
  7505. },
  7506. updateMode: function(e) {
  7507. x = S,
  7508. S = e
  7509. }
  7510. };
  7511. p.extendObject(R, f.prototype),
  7512. t.exports = R
  7513. }
  7514. , {
  7515. "../../enum/HelpModalType": 28,
  7516. "../../enum/Viewmode": 51,
  7517. "../../settings": 166,
  7518. "../../util/common": 185,
  7519. "../helpManager": 68,
  7520. "./../populateModal": 75,
  7521. "./HelpEvent": 66,
  7522. events: 202
  7523. }],
  7524. 68: [function(e, t, i) {
  7525. (function(i) {
  7526. "use strict";
  7527. var n = e("../util/browser")
  7528. , r = e("./../util/logger")
  7529. , o = e("./../settings")
  7530. , a = new r(i)
  7531. , s = function() {
  7532. var e;
  7533. try {
  7534. return e = window.localStorage.getItem("visitCount") || "0",
  7535. e = (parseFloat(e) + 1).toString(),
  7536. window.localStorage.setItem("visitCount", e),
  7537. a.debug("visitCount = " + e),
  7538. e
  7539. } catch (t) {
  7540. e = "1",
  7541. a.debug("couldn't set local storage")
  7542. }
  7543. }()
  7544. , l = !1;
  7545. t.exports = {
  7546. isHelpDisabled: function() {
  7547. return "0" === n.valueFromHash("help", null) || l
  7548. },
  7549. isLargeHelpEnabled: function() {
  7550. return ("1" === s || "1" === n.valueFromHash("help", null)) && !this.isHelpDisabled()
  7551. },
  7552. isSmallHelpEnabled: function() {
  7553. return "2" === n.valueFromHash("help", null) && !this.isHelpDisabled()
  7554. },
  7555. isHelpEnabled: function() {
  7556. return this.isLargeHelpEnabled() || this.isSmallHelpEnabled()
  7557. },
  7558. setAutoPlay: function(e) {
  7559. l = o.warp.auto >= 0 && e > 1
  7560. }
  7561. }
  7562. }
  7563. ).call(this, "/js/gui/helpManager.js")
  7564. }
  7565. , {
  7566. "../util/browser": 182,
  7567. "./../settings": 166,
  7568. "./../util/logger": 189
  7569. }],
  7570. 69: [function(e, t, i) {
  7571. "use strict";
  7572. function n(e, t, i, n) {
  7573. F = n,
  7574. r(e, t, i, F),
  7575. o(),
  7576. N = t.mode
  7577. }
  7578. function r(e, t, i, n) {
  7579. [C.PANORAMA, C.DOLLHOUSE, C.FLOORPLAN].forEach(function(t) {
  7580. e.controls[t].on(v.Move, a),
  7581. e.controls[t].on(v.LongTap, c)
  7582. }),
  7583. M.on("mousewheel DOMMouseScroll", a),
  7584. i.on(m.TagActivated, a),
  7585. i.on(m.TagNavigation, a),
  7586. t.on(A.FlyingEnded, s),
  7587. t.on(A.ModeChanging, function(e, t) {
  7588. B = t !== C.PANORAMA && e !== C.PANORAMA
  7589. }),
  7590. t.on(A.ModeChanged, function(e, i) {
  7591. N = t.mode,
  7592. i !== C.TRANSITIONING ? l() : a("modeChange")
  7593. }),
  7594. n.on(y.TourStart, function() {
  7595. L = !0,
  7596. a()
  7597. }),
  7598. n.on(y.TourEnd, function() {
  7599. L = !1,
  7600. l()
  7601. }),
  7602. n.on(y.ActionInterrupted, function() {
  7603. L = !1
  7604. }),
  7605. R.addEventListener("touchend", function() {
  7606. $("#pullTab").hasClass("opened") && !L && l()
  7607. }, !0)
  7608. }
  7609. function o() {
  7610. p.isMobile() ? (b.forEach(function(e) {
  7611. e.classList.add("mobile")
  7612. }),
  7613. w.click(l)) : (b.forEach(function(e) {
  7614. e.addEventListener("mouseleave", function() {
  7615. !M.is(":hover") && b[0].classList.contains("detectHover") && l()
  7616. }, !0)
  7617. }),
  7618. M.mouseleave(function() {
  7619. b[0].classList.contains("detectHover") && l()
  7620. }))
  7621. }
  7622. function a(e) {
  7623. D || d(e) && _.hasClass("playing") || (clearTimeout(O),
  7624. P = !0,
  7625. g.close(),
  7626. h(e),
  7627. N !== C.DOLLHOUSE && N !== C.FLOORPLAN && (x.hasClass("expand") && !S.hasClass("closed") || 2 === p.valueFromHash("title", 1) ,
  7628. _.hasClass("playing") || (b.forEach(function(e) {
  7629. e.classList.add("detectHover")
  7630. }),
  7631. O = setTimeout(l, f.immersive.timeToShowAgain))))
  7632. }
  7633. function s() {
  7634. _.hasClass("playing") || (clearTimeout(O),
  7635. O = setTimeout(l, f.immersive.timeToShowAgain))
  7636. }
  7637. function l() {
  7638. clearTimeout(O),
  7639. P = !1,
  7640. I.forEach(function(e) {
  7641. e.classList.remove("drawerOpen")
  7642. }),
  7643. L || E.forEach(function(e) {
  7644. e.classList.remove("duringTour")
  7645. }),
  7646. b.forEach(function(e) {
  7647. e.classList.remove("detectHover")
  7648. })
  7649. }
  7650. function c() {
  7651. P ? l() : a(),
  7652. D = !0,
  7653. setTimeout(function() {
  7654. D = !1
  7655. }, f.immersive.uiStayDuration)
  7656. }
  7657. function h(e) {
  7658. !d(e) && L ? E.forEach(function(e) {
  7659. e.classList.remove("drawerOpen"),
  7660. e.classList.add("duringTour")
  7661. }) : _.hasClass("open") ? E.forEach(function(e) {
  7662. e.classList.remove("duringTour"),
  7663. e.classList.add("drawerOpen")
  7664. }) : B || N === C.FLOORPLAN || N === C.DOLLHOUSE || E.forEach(function(e) {
  7665. e.classList.add("fadeOut")
  7666. })
  7667. }
  7668. function u() {
  7669. T.hasClass("duringTour") || (L = !1,
  7670. a("gui"),
  7671. l())
  7672. }
  7673. function d(e) {
  7674. return "mouse" === e || "touch" === e || "key" === e || "gui" === e
  7675. }
  7676. var p = e("../util/browser")
  7677. , f = e("../settings")
  7678. , g = e("./help/help")
  7679. , m = e("../enum/tagEvents")
  7680. , v = e("../enum/ControlEvents")
  7681. , A = e("../enum/PlayerEvents")
  7682. , y = e("../enum/DirectorEvents")
  7683. , A = e("../enum/PlayerEvents")
  7684. , C = e("../enum/Viewmode")
  7685. , I = $(".pinTop.left, .pinBottom-container, #drawer-container, #drawer, .footer").toArray()
  7686. , E = $(".pinBottom-container, #drawer-container, .footer").toArray()
  7687. , b = $("#hover-bottom, #hover-top").toArray()
  7688. , w = ($("#pullTab").eq(0),
  7689. $("#playHead").eq(0),
  7690. $(".pinBottom-container").eq(0))
  7691. , _ = $("#drawer").eq(0)
  7692. , T = $("#drawer-container").eq(0)
  7693. , x = $("#meta-info").eq(0)
  7694. , S = $(".pinTop.left").eq(0)
  7695. , M = $("#player").eq(0)
  7696. , R = document.getElementById("pullTab")
  7697. , P = !1
  7698. , O = null
  7699. , L = !1
  7700. , D = !1
  7701. , N = null
  7702. , B = !1
  7703. , F = null;
  7704. t.exports.init = n,
  7705. t.exports.hideUi = a,
  7706. t.exports.resetDrawer = u
  7707. }
  7708. , {
  7709. "../enum/ControlEvents": 21,
  7710. "../enum/DirectorEvents": 23,
  7711. "../enum/tagEvents": 32,
  7712. "../enum/PlayerEvents": 40,
  7713. "../enum/Viewmode": 51,
  7714. "../settings": 166,
  7715. "../util/browser": 182,
  7716. "./help/help": 67
  7717. }],
  7718. 70: [function(e, t, i) {
  7719. (function(i) {
  7720. "use strict";
  7721. function n(e, t, i) {
  7722. l.debug("konami has the modelInstance");
  7723. var n = [];
  7724. $(window).on("keydown", function(e) {
  7725. n.push(e.which),
  7726. n.length > o.secretPanelWord.length && n.shift(),
  7727. s.equalLists(n, o.secretPanelWord) && (l.debug("Developer mode active."),
  7728. o.debug = !0)
  7729. }),
  7730. $(window).on("keydown", function n(r) {
  7731. o.debug && 72 === r.which && (e && i ? (a.toggle(e, t, i),
  7732. $(window).off("keydown", n)) : console.warn("sorry we're not ready yet"))
  7733. })
  7734. }
  7735. var r = e("./../util/logger")
  7736. , o = e("./../settings")
  7737. , a = e("./debug")
  7738. , s = e("./../util/common")
  7739. , l = (e("./gui"),
  7740. new r(i));
  7741. o.console && $("body").append('<div id="debug-console"></div>'),
  7742. t.exports.init = n
  7743. }
  7744. ).call(this, "/js/gui/konami.js")
  7745. }
  7746. , {
  7747. "./../settings": 166,
  7748. "./../util/common": 185,
  7749. "./../util/logger": 189,
  7750. "./debug": 63,
  7751. "./gui": 65
  7752. }],
  7753. 71: [function(e, t, i) {
  7754. "use strict";
  7755. function n(e, t) {
  7756. E = t.mode === p.PANORAMA && t.pano && !t.pano.isAligned() ? p.OUTDOOR : t.mode
  7757. }
  7758. function r(e) {
  7759. var t = $.Deferred();
  7760. e || t.resolve();
  7761. var i = c.startupFlyinDelay;
  7762. return e === p.PANORAMA && (i += c.dollhouse.transitionTime),
  7763. setTimeout(t.resolve.bind(t), i),
  7764. t
  7765. }
  7766. function o(e, t, i) {
  7767. var n = 0;
  7768. c.quickstart.enabled && (a(i),
  7769. n = c.quickstart.showTextDelay + c.quickstart.fadeOutDelay);
  7770. var r = function() {
  7771. e.once(g.Move, l),
  7772. t.once(f.TourStart, l)
  7773. };
  7774. s(n, r)
  7775. }
  7776. function a(e) {
  7777. return /* e && (y.addClass("quick-brand"), //quick-brand样式有问题 会遮住屏幕
  7778. v.before(y),
  7779. A = $(".quick-brand").toArray()),*/
  7780. m.addClass("fadeOut"),
  7781. setTimeout(function() {
  7782. A.forEach(function(e) {
  7783. e.classList.add("fadeIn")
  7784. })
  7785. }, c.quickstart.showTextDelay),
  7786. setTimeout(function() {
  7787. A.forEach(function(e) {
  7788. e.classList.add("fadeOut")
  7789. })
  7790. }, c.quickstart.fadeOutDelay),
  7791. !0
  7792. }
  7793. function s(e, t) {
  7794. setTimeout(function() {
  7795. if (h.isHelpEnabled()) {
  7796. if (t(),
  7797. u.init(),
  7798. C.addClass("fadeIn landing " + u.deviceType),
  7799. h.isSmallHelpEnabled())
  7800. return void C.addClass("small");
  7801. u.fill(I, d.LANDING[E]),
  7802. C.addClass(E)
  7803. }
  7804. }, e)
  7805. //csz 用户引导界面
  7806. var helpData = {
  7807. "pc":["images/pc_step1.png","images/pc_step2.png","images/pc_step3.png"],
  7808. "mobile":["images/phone_step1.png","images/phone_step2.png","images/phone_step3.png"]
  7809. }
  7810. var navIcon = $(".nav-icon .icon");
  7811. if(/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)) navIcon.attr("src",helpData.mobile[0]);
  7812. function paging(id){
  7813. id.on("click",function(){
  7814. var navPage = null;
  7815. $(this).attr("data-id") == "plus" ? navPage = +navIcon.attr("data-page")+1 : navPage = +navIcon.attr("data-page")-1;
  7816. if(navPage > helpData.length || navPage < 1) return false
  7817. if(/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)){
  7818. navIcon.attr({"data-page":navPage,"src":helpData.mobile[navPage - 1]});
  7819. }else{
  7820. navIcon.attr({"data-page":navPage,"src":helpData.pc[navPage - 1]});
  7821. }
  7822. })
  7823. };
  7824. paging($(".next-button"));
  7825. paging($(".prev-button"));
  7826. }
  7827. function l() {
  7828. u.clear(I, d.LANDING[E]),
  7829. C.removeClass("fadeIn")
  7830. }
  7831. var c = e("../settings")
  7832. , h = (e("./help/help"),
  7833. e("./helpManager"))
  7834. , u = e("./populateModal")
  7835. , d = e("../enum/HelpModalType")
  7836. , p = e("../enum/Viewmode")
  7837. , f = e("../enum/DirectorEvents")
  7838. , g = e("../enum/PlayerEvents")
  7839. , m = $("#quick-blackout").eq(0)
  7840. , v = $("#quick-logo").eq(0)
  7841. , A = $(".quick-brand").toArray()
  7842. , y = $("#loaderCoBrand").eq(0)
  7843. , C = $("#interaction-modal").eq(0)
  7844. , I = C.find(".interaction").toArray()
  7845. , E = ($("#model-title, .pinBottom-container, #drawer-container, #drawer, .footer").toArray(),
  7846. "");
  7847. t.exports.delayLanding = r,
  7848. t.exports.showMessage = o,
  7849. t.exports.init = n,
  7850. t.exports.dismissModal = l
  7851. }
  7852. , {
  7853. "../enum/DirectorEvents": 23,
  7854. "../enum/HelpModalType": 28,
  7855. "../enum/PlayerEvents": 40,
  7856. "../enum/Viewmode": 51,
  7857. "../settings": 166,
  7858. "./help/help": 67,
  7859. "./helpManager": 68,
  7860. "./populateModal": 75
  7861. }],
  7862. 72: [function(e, t, i) {
  7863. "use strict";
  7864. var n = e("./circleLoader").circleLoader;
  7865. t.exports = {
  7866. element: $("#gui-loading"),
  7867. hide: function(e) {
  7868. n.done(),
  7869. this.element.fadeOut(1500, e)
  7870. },
  7871. show: function(e) {
  7872. this.element.fadeIn(500, function() {
  7873. this.element.css("display", "table"),
  7874. e && e()
  7875. }
  7876. .bind(this))
  7877. },
  7878. progress: function(e) {
  7879. n.set(e)
  7880. }
  7881. }
  7882. }
  7883. , {
  7884. "./circleLoader": 60
  7885. }],
  7886. 73: [function(e, t, i) {
  7887. "use strict";
  7888. var n = e("../settings")
  7889. , r = $("#memory-info")
  7890. , o = r.find("#memory-gpu")
  7891. , a = !1;
  7892. t.exports = {
  7893. show: function() {
  7894. n.profiling.enabled && (r.show(),
  7895. a = !0)
  7896. },
  7897. hide: function() {
  7898. r.hide(),
  7899. a = !1
  7900. },
  7901. toggle: function() {
  7902. a ? this.hide() : this.show()
  7903. },
  7904. update: function(e) {
  7905. n.profiling.enabled && o.text(Math.floor(e / 1e6) + "MB")
  7906. }
  7907. }
  7908. }
  7909. , {
  7910. "../settings": 166
  7911. }],
  7912. 74: [function(e, t, i) {
  7913. "use strict";
  7914. var n = e("../util/browser")
  7915. , r = e("../analytics");
  7916. e("../settings");
  7917. t.exports = {
  7918. show: function(e, t) {
  7919. $("#gui-message").fadeOut(500, function() {
  7920. t()
  7921. })
  7922. }
  7923. }
  7924. }
  7925. , {
  7926. "../analytics": 4,
  7927. "../settings": 166,
  7928. "../util/browser": 182
  7929. }],
  7930. 75: [function(e, t, i) {
  7931. "use strict";
  7932. function n(e, t, i, n) {
  7933. function r(e) {
  7934. return e.classList.contains(a)
  7935. }
  7936. var o = i ? this.assets[t][i][this.deviceType] : this.assets[t][this.deviceType];
  7937. //for (var a in o) {
  7938. //var s = e.find(r);
  7939. //for (var l in o[a]) {
  7940. //var c = o[a][l];
  7941. //if ("top-info" === l || "bottom-info" === l) {
  7942. //var h = n ? c : "";
  7943. //czj 注释掉第一次打开的用户引导
  7944. //s.querySelector("." + l).textContent = h
  7945. //} else {
  7946. //var u = n ? c : "";
  7947. //, d = s.querySelector("." + l);
  7948. //d.src = u,
  7949. //n ? d.classList.remove("hidden") : d.classList.add("hidden")
  7950. //}
  7951. //}
  7952. //}
  7953. //var p = Array.prototype.slice.call(e[0].parentElement.querySelectorAll("hr"));
  7954. // p.forEach(function(e) {
  7955. // n ? e.classList.remove("hidden") : e.classList.add("hidden")
  7956. // })
  7957. }
  7958. var r = e("../util/browser")
  7959. , o = e("../localization/localize")
  7960. , a = e("../enum/HelpModalType")
  7961. , s = (e("../enum/HelpModalSize"),
  7962. e("../enum/Viewmode"));
  7963. t.exports = {
  7964. init: function() {
  7965. if (!this.hasInitialized) {
  7966. this.hasInitialized = !0,
  7967. this.deviceType = r.isMobile() ? "mobile" : "desktop",
  7968. this.assets = {},
  7969. this.assets[a.LANDING[s.PANORAMA]] = {
  7970. desktop: {
  7971. left: {
  7972. "top-info": o.ROTATE,
  7973. "big-image": "images/nav_help_mouse_drag_left.png",
  7974. keyboard: "images/nav_help_keyboard_left_right.png"
  7975. },
  7976. middle: {
  7977. "top-info": o.MOVE,
  7978. "big-image": "images/nav_help_mouse_click.png",
  7979. keyboard: "images/nav_help_keyboard_up_down.png"
  7980. },
  7981. right: {
  7982. "top-info": o.ZOOM,
  7983. "big-image": "images/nav_help_mouse_zoom.png",
  7984. keyboard: "images/nav_help_zoom_keys.png"
  7985. }
  7986. },
  7987. mobile: {
  7988. left: {
  7989. "top-info": o.ROTATE,
  7990. "big-image": "images/nav_help_gesture_drag.png"
  7991. },
  7992. middle: {
  7993. "top-info": o.MOVE,
  7994. "big-image": "images/nav_help_gesture_tap.png"
  7995. },
  7996. right: {
  7997. "top-info": o.ZOOM,
  7998. "big-image": "images/nav_help_gesture_pinch.png"
  7999. }
  8000. }
  8001. },
  8002. this.assets[a.LANDING[s.OUTDOOR]] = JSON.parse(JSON.stringify(this.assets[a.LANDING[s.PANORAMA]])),
  8003. this.assets[a.LANDING[s.DOLLHOUSE]] = {
  8004. desktop: {
  8005. left: {
  8006. "top-info": o.ROTATE,
  8007. "big-image": "images/nav_help_mouse_drag_left.png",
  8008. keyboard: "images/nav_help_keyboard_left_right.png"
  8009. },
  8010. middle: {
  8011. "top-info": o.MOVE,
  8012. "big-image": "images/nav_help_mouse_position_right.png"
  8013. }
  8014. },
  8015. mobile: {
  8016. left: {
  8017. "top-info": o.ROTATE,
  8018. "big-image": "images/nav_help_gesture_drag.png"
  8019. },
  8020. middle: {
  8021. "top-info": o.MOVE,
  8022. "big-image": "images/nav_help_gesture_position_two_finger.png"
  8023. }
  8024. }
  8025. },
  8026. this.assets[a.LANDING[s.FLOORPLAN]] = {
  8027. desktop: {
  8028. left: {
  8029. "top-info": o.MOVE,
  8030. "big-image": "images/nav_help_mouse_position_left.png"
  8031. },
  8032. middle: {
  8033. "top-info": o.ROTATE,
  8034. "big-image": "images/nav_help_mouse_drag_right.png",
  8035. keyboard: "images/nav_help_keyboard_left_right.png"
  8036. }
  8037. },
  8038. mobile: {
  8039. left: {
  8040. "top-info": o.MOVE,
  8041. "big-image": "images/nav_help_gesture_position.png"
  8042. },
  8043. middle: {
  8044. "top-info": o.ROTATE,
  8045. "big-image": "images/nav_help_gesture_drag_two_finger.png"
  8046. }
  8047. }
  8048. };
  8049. var e = {
  8050. "top-info": o.INSIDE,
  8051. "big-image": "images/nav_help_click_inside.png",
  8052. keyboard: "images/nav_help_inside_key.png"
  8053. };
  8054. this.assets[a.LANDING[s.OUTDOOR]].desktop.middle = e,
  8055. this.assets[a.LANDING[s.DOLLHOUSE]].desktop.right = e,
  8056. this.assets[a.LANDING[s.FLOORPLAN]].desktop.right = e;
  8057. var t = {
  8058. "top-info": o.INSIDE,
  8059. "big-image": "images/nav_help_tap_inside.png"
  8060. };
  8061. this.assets[a.LANDING[s.OUTDOOR]].mobile.middle = t,
  8062. this.assets[a.LANDING[s.DOLLHOUSE]].mobile.right = t,
  8063. this.assets[a.LANDING[s.FLOORPLAN]].mobile.right = t,
  8064. this.assets[a.NAVIGATION] = {},
  8065. this.assets[a.NAVIGATION][s.PANORAMA] = {
  8066. desktop: {
  8067. left: {
  8068. "top-info": o.HELP_DESKTOP_PANORAMA_1A,
  8069. "bottom-info": o.HELP_DESKTOP_PANORAMA_1B,
  8070. "big-image": "images/nav_help_mouse_drag_left.png",
  8071. keyboard: "images/nav_help_keyboard_left_right.png"
  8072. },
  8073. middle: {
  8074. "top-info": o.HELP_DESKTOP_PANORAMA_2A,
  8075. "bottom-info": o.HELP_DESKTOP_PANORAMA_2B,
  8076. "big-image": "images/nav_help_mouse_click.png",
  8077. keyboard: "images/nav_help_keyboard_up_down.png"
  8078. },
  8079. right: {
  8080. "top-info": o.HELP_DESKTOP_PANORAMA_3A,
  8081. "bottom-info": o.HELP_DESKTOP_PANORAMA_3B,
  8082. "big-image": "images/nav_help_mouse_zoom.png",
  8083. keyboard: "images/nav_help_zoom_keys.png"
  8084. }
  8085. },
  8086. mobile: {
  8087. left: {
  8088. "top-info": o.HELP_MOBILE_PANORAMA_1,
  8089. "big-image": "images/nav_help_gesture_drag.png"
  8090. },
  8091. middle: {
  8092. "top-info": o.HELP_MOBILE_PANORAMA_2,
  8093. "big-image": "images/nav_help_gesture_tap.png"
  8094. },
  8095. right: {
  8096. "top-info": o.HELP_MOBILE_3,
  8097. "big-image": "images/nav_help_gesture_pinch.png"
  8098. }
  8099. }
  8100. },
  8101. this.assets[a.NAVIGATION][s.DOLLHOUSE] = {
  8102. desktop: {
  8103. left: {
  8104. "top-info": o.HELP_DESKTOP_DOLLHOUSE_1A,
  8105. "bottom-info": o.HELP_DESKTOP_DOLLHOUSE_1B,
  8106. "big-image": "images/nav_help_mouse_drag_left.png",
  8107. keyboard: "images/nav_help_keyboard_all.png"
  8108. },
  8109. middle: {
  8110. "top-info": o.HELP_DESKTOP_DOLLHOUSE_2A,
  8111. "big-image": "images/nav_help_mouse_position_right.png"
  8112. },
  8113. right: {
  8114. "top-info": o.HELP_DESKTOP_DOLLHOUSE_3A,
  8115. "big-image": "images/nav_help_mouse_zoom.png"
  8116. }
  8117. },
  8118. mobile: {
  8119. left: {
  8120. "top-info": o.HELP_MOBILE_DOLLHOUSE_1,
  8121. "big-image": "images/nav_help_gesture_drag.png"
  8122. },
  8123. middle: {
  8124. "top-info": o.HELP_MOBILE_DOLLHOUSE_2,
  8125. "big-image": "images/nav_help_gesture_position_two_finger.png"
  8126. },
  8127. right: {
  8128. "top-info": o.HELP_MOBILE_3,
  8129. "big-image": "images/nav_help_gesture_pinch.png"
  8130. }
  8131. }
  8132. },
  8133. this.assets[a.NAVIGATION][s.FLOORPLAN] = {
  8134. desktop: {
  8135. left: {
  8136. "top-info": o.HELP_DESKTOP_FLOORPLAN_1A,
  8137. "big-image": "images/nav_help_mouse_position_left.png"
  8138. },
  8139. middle: {
  8140. "top-info": o.HELP_DESKTOP_FLOORPLAN_2A,
  8141. "bottom-info": o.HELP_DESKTOP_FLOORPLAN_2B,
  8142. "big-image": "images/nav_help_mouse_drag_right.png",
  8143. keyboard: "images/nav_help_keyboard_left_right.png"
  8144. },
  8145. right: {
  8146. "top-info": o.HELP_DESKTOP_FLOORPLAN_3A,
  8147. "bottom-info": o.HELP_DESKTOP_FLOORPLAN_3B,
  8148. "big-image": "images/nav_help_mouse_zoom.png",
  8149. keyboard: "images/nav_help_keyboard_up_down.png"
  8150. }
  8151. },
  8152. mobile: {
  8153. left: {
  8154. "top-info": o.HELP_MOBILE_FLOORPLAN_1,
  8155. "big-image": "images/nav_help_gesture_position.png"
  8156. },
  8157. middle: {
  8158. "top-info": o.HELP_MOBILE_FLOORPLAN_2,
  8159. "big-image": "images/nav_help_gesture_drag_two_finger.png"
  8160. },
  8161. right: {
  8162. "top-info": o.HELP_MOBILE_3,
  8163. "big-image": "images/nav_help_gesture_pinch.png"
  8164. }
  8165. }
  8166. },
  8167. this.assets[a.NAVIGATION][s.OUTDOOR] = JSON.parse(JSON.stringify(this.assets[a.NAVIGATION][s.PANORAMA])),
  8168. this.assets[a.NAVIGATION][s.OUTDOOR].desktop.middle = {
  8169. "top-info": o.HELP_DESKTOP_360_2A,
  8170. "bottom-info": o.HELP_DESKTOP_360_2B,
  8171. "big-image": "images/nav_help_click_inside.png",
  8172. keyboard: "images/nav_help_inside_key.png"
  8173. },
  8174. this.assets[a.NAVIGATION][s.OUTDOOR].mobile.middle = {
  8175. "top-info": o.HELP_MOBILE_360_2,
  8176. "big-image": "images/nav_help_tap_inside.png"
  8177. },
  8178. this.assets[a.MORE_HELP] = {
  8179. desktop: {
  8180. "more-help-hlr": {
  8181. "top-info": o.HELP_MORE_HLR_A,
  8182. "big-image": "images/nav_help_expand.svg",
  8183. "bottom-info": o.HELP_DESKTOP_MORE_HLR_B
  8184. },
  8185. "more-help-dollhouse": {
  8186. "top-info": o.HELP_MORE_DOLLHOUSE_A,
  8187. "big-image": "images/nav_help_dollhouse.svg",
  8188. "bottom-info": o.HELP_DESKTOP_MORE_DOLLHOUSE_B
  8189. },
  8190. "more-help-floors": {
  8191. "top-info": o.HELP_MORE_FLOORS_A,
  8192. "big-image": "images/nav_help_floor picker.svg",
  8193. "bottom-info": o.HELP_DESKTOP_MORE_FLOORS_B
  8194. },
  8195. "more-help-tag": {
  8196. "top-info": o.HELP_MORE_TAG_A,
  8197. "big-image": "images/nav_help_tag.svg",
  8198. "bottom-info": o.HELP_DESKTOP_MORE_TAG_B
  8199. },
  8200. "more-help-zoom": {
  8201. "top-info": o.HELP_MORE_ZOOM_A,
  8202. "big-image": "images/nav_help_zoom.svg",
  8203. "bottom-info": o.HELP_DESKTOP_MORE_ZOOM_B
  8204. },
  8205. "more-help-tour": {
  8206. "top-info": o.HELP_MORE_TOUR_A,
  8207. "big-image": "images/nav_help_play.png",
  8208. "bottom-info": o.HELP_DESKTOP_MORE_TOUR_B
  8209. },
  8210. "more-help-inside": {
  8211. "top-info": o.HELP_MORE_INSIDE_A,
  8212. "big-image": "images/nav_help_inside.svg",
  8213. "bottom-info": o.HELP_DESKTOP_MORE_INSIDE_B
  8214. },
  8215. "more-help-vr": {
  8216. "top-info": o.HELP_MORE_VR_A,
  8217. "big-image": "images/nav_help_vr.svg",
  8218. "bottom-info": o.HELP_DESKTOP_MORE_VR_B
  8219. },
  8220. "more-help-360": {
  8221. "top-info": o.HELP_MORE_360_A,
  8222. "big-image": "images/nav_help_360.svg",
  8223. "bottom-info": o.HELP_DESKTOP_MORE_360_B
  8224. },
  8225. "more-help-fullscreen": {
  8226. "top-info": o.HELP_MORE_FULLSCREEN_A,
  8227. "big-image": "images/nav_help_fullscreen.svg",
  8228. "bottom-info": o.HELP_DESKTOP_MORE_FULLSCREEN_B
  8229. }
  8230. },
  8231. mobile: {
  8232. "more-help-hlr": {
  8233. "top-info": o.HELP_MORE_HLR_A,
  8234. "big-image": "images/nav_help_expand.svg",
  8235. "bottom-info": o.HELP_DESKTOP_MORE_HLR_B
  8236. },
  8237. "more-help-dollhouse": {
  8238. "top-info": o.HELP_MORE_DOLLHOUSE_A,
  8239. "big-image": "images/nav_help_dollhouse.svg",
  8240. "bottom-info": o.HELP_MOBILE_MORE_DOLLHOUSE_B
  8241. },
  8242. "more-help-floors": {
  8243. "top-info": o.HELP_MORE_FLOORS_A,
  8244. "big-image": "images/nav_help_floor picker.svg",
  8245. "bottom-info": o.HELP_DESKTOP_MORE_FLOORS_B
  8246. },
  8247. "more-help-tag": {
  8248. "top-info": o.HELP_MORE_TAG_A,
  8249. "big-image": "images/nav_help_tag.svg",
  8250. "bottom-info": o.HELP_MOBILE_MORE_TAG_B
  8251. },
  8252. "more-help-tour": {
  8253. "top-info": o.HELP_MORE_TOUR_A,
  8254. "big-image": "images/nav_help_play.png",
  8255. "bottom-info": o.HELP_DESKTOP_MORE_TOUR_B
  8256. },
  8257. "more-help-inside": {
  8258. "top-info": o.HELP_MORE_INSIDE_A,
  8259. "big-image": "images/nav_help_inside.svg",
  8260. "bottom-info": o.HELP_MOBILE_MORE_INSIDE_B
  8261. },
  8262. "more-help-vr": {
  8263. "top-info": o.HELP_MORE_VR_A,
  8264. "big-image": "images/webvr.svg",
  8265. "bottom-info": o.HELP_MOBILE_MORE_VR_B
  8266. },
  8267. "more-help-360": {
  8268. "top-info": o.HELP_MORE_360_A,
  8269. "big-image": "images/nav_help_360.svg",
  8270. "bottom-info": o.HELP_MOBILE_MORE_360_B
  8271. }
  8272. }
  8273. },
  8274. this.assets[a.TOUR_INTERACTION[s.PANORAMA]] = {
  8275. desktop: {
  8276. left: {
  8277. "top-info": o.ROTATE,
  8278. "big-image": "images/nav_help_mouse_drag_left.png",
  8279. keyboard: "images/nav_help_keyboard_left_right.png"
  8280. },
  8281. middle: {
  8282. "top-info": o.MOVE,
  8283. "big-image": "images/nav_help_mouse_click.png",
  8284. keyboard: "images/nav_help_keyboard_up_down.png"
  8285. },
  8286. right: {
  8287. "top-info": o.PLAY,
  8288. "big-image": "images/Desktop-help-play-button.svg",
  8289. keyboard: "images/Desktop-help-spacebar-2.svg"
  8290. }
  8291. },
  8292. mobile: {
  8293. left: {
  8294. "top-info": o.ROTATE,
  8295. "big-image": "images/nav_help_gesture_drag.png"
  8296. },
  8297. middle: {
  8298. "top-info": o.MOVE,
  8299. "big-image": "images/nav_help_gesture_tap.png"
  8300. },
  8301. right: {
  8302. "top-info": o.PLAY,
  8303. "big-image": "images/mobile-help-play-button.svg"
  8304. }
  8305. }
  8306. },
  8307. this.assets[a.TOUR_INTERACTION[s.OUTDOOR]] = JSON.parse(JSON.stringify(this.assets[a.TOUR_INTERACTION[s.PANORAMA]])),
  8308. this.assets[a.TOUR_INTERACTION[s.OUTDOOR]].desktop.middle = this.assets[a.LANDING[s.OUTDOOR]].desktop.middle,
  8309. this.assets[a.TOUR_INTERACTION[s.OUTDOOR]].mobile.middle = this.assets[a.LANDING[s.OUTDOOR]].mobile.middle,
  8310. this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]] = JSON.parse(JSON.stringify(this.assets[a.TOUR_INTERACTION[s.OUTDOOR]])),
  8311. this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]].desktop.left = this.assets[a.LANDING[s.FLOORPLAN]].desktop.left,
  8312. this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]].mobile.left = this.assets[a.LANDING[s.FLOORPLAN]].mobile.left
  8313. }
  8314. },
  8315. fill: function(e, t, i) {
  8316. n.call(this, e, t, i, !0)
  8317. },
  8318. clear: function(e, t, i) {
  8319. n.call(this, e, t, i, !1)
  8320. }
  8321. }
  8322. }
  8323. , {
  8324. "../enum/HelpModalSize": 27,
  8325. "../enum/HelpModalType": 28,
  8326. "../enum/Viewmode": 51,
  8327. "../localization/localize": 108,
  8328. "../util/browser": 182
  8329. }],
  8330. 76: [function(e, t, i) {
  8331. "use strict";
  8332. t.exports = Object.freeze({
  8333. OPENED: "share.open",
  8334. CLOSED: "share.closed",
  8335. LINK_CLICKED: "share.linked"
  8336. })
  8337. }
  8338. , {}],
  8339. 77: [function(e, t, i) {
  8340. "use strict";
  8341. function n(e) {
  8342. function t(t, i) {
  8343. var n = window.screenY + ($("#player").height() - i) / 2
  8344. , r = window.screenX + ($("#player").width() - t) / 2
  8345. , o = "top=" + n + ",left=" + r + ",width=" + t + ",height=" + i;
  8346. I.emit(l.LINK_CLICKED, {
  8347. channel: e
  8348. }),
  8349. window.open(C[e], "shareWindow", o)
  8350. }
  8351. switch (e) {
  8352. case y.FACEBOOK:
  8353. t(580, 420);
  8354. break;
  8355. case y.TWITTER:
  8356. t(550, 440);
  8357. break;
  8358. case y.MAIL:
  8359. I.emit(l.LINK_CLICKED, {
  8360. channel: "email"
  8361. }),
  8362. window.open(C[e], "_blank");
  8363. break;
  8364. case y.LINKEDIN:
  8365. }
  8366. }
  8367. function r(e) {
  8368. I.emit(l.LINK_CLICKED, {
  8369. channel: "copylink"
  8370. });
  8371. var t = document.createRange();
  8372. t.selectNodeContents(v);
  8373. var i = window.getSelection();
  8374. i.removeAllRanges(),
  8375. i.addRange(t),
  8376. document.execCommand("copy"),
  8377. A.classList.remove("hidden"),
  8378. v.classList.add("highlighted")
  8379. }
  8380. function o(e) {
  8381. e && (e.stopPropagation(),
  8382. e.target === v) || (window.getSelection().removeAllRanges(),
  8383. v.classList.remove("highlighted"),
  8384. A.classList.add("hidden"))
  8385. }
  8386. var a = e("../../util/browser")
  8387. , s = e("../../localization/localize")
  8388. , l = e("./ShareEvents")
  8389. , c = e("../../util/common")
  8390. , h = e("events").EventEmitter
  8391. , u = document.getElementById("sharing")
  8392. , d = document.getElementById("share-modal")
  8393. , p = document.getElementById("share-close")
  8394. , f = document.getElementById("facebook-share")
  8395. , g = document.getElementById("twitter-share")
  8396. , m = document.getElementById("mail-share")
  8397. , v = document.getElementById("share-url-text")
  8398. , A = document.getElementById("copy-success")
  8399. , y = Object.freeze({
  8400. FACEBOOK: "facebook",
  8401. TWITTER: "twitter",
  8402. MAIL: "mail",
  8403. LINKEDIN: "linkedin"
  8404. })
  8405. , C = {};
  8406. C[y.FACEBOOK] = "http://www.facebook.com/sharer.php?u=" + encodeURIComponent(window.location.href + "&utm_source=1") + "&t=",
  8407. C[y.TWITTER] = "http://twitter.com/intent/tweet?text=",
  8408. C[y.MAIL] = "mailto:?subject=";
  8409. var I = {
  8410. init: function(e) {
  8411. var t = encodeURIComponent(s.SHARE_EXPLORE + e + " " + s.SHARE_AT + " ");
  8412. C[y.FACEBOOK] += t + encodeURIComponent(window.location.href + "&utm_source=1"),
  8413. C[y.TWITTER] += t + encodeURIComponent(window.location.href + "&utm_source=2 " + s.SHARE_WITH + " #port"),
  8414. C[y.MAIL] += encodeURIComponent(s.SHARE_EXPLORE + e + s.SHARE_3D) + "&body=" + t + encodeURIComponent(window.location.href + "&utm_source=3"),
  8415. u.addEventListener("click", this.toggle.bind(this)),
  8416. p.addEventListener("click", this.hide.bind(this)),
  8417. v.addEventListener("click", r),
  8418. d.addEventListener("click", o),
  8419. f.addEventListener("click", n.bind(this, y.FACEBOOK)),
  8420. g.addEventListener("click", n.bind(this, y.TWITTER)),
  8421. m.addEventListener("click", n.bind(this, y.MAIL)),
  8422. v.textContent = window.location.href + "&utm_source=4",
  8423. d.classList.add(a.isMobile() ? "mobile" : "desktop"),
  8424. u.classList.remove("hidden")
  8425. },
  8426. show: function() {
  8427. this.emit(l.OPENED),
  8428. d.classList.add("fadeIn")
  8429. },
  8430. hide: function() {
  8431. d.classList.contains("fadeIn") && (this.emit(l.CLOSED),
  8432. document.selection && document.selection.empty(),
  8433. window.getSelection().removeAllRanges(),
  8434. o(),
  8435. d.classList.remove("fadeIn"))
  8436. },
  8437. toggle: function() {
  8438. d.classList.contains("fadeIn") ? this.hide() : this.show()
  8439. }
  8440. };
  8441. c.extendObject(I, h.prototype),
  8442. t.exports = I
  8443. }
  8444. , {
  8445. "../../localization/localize": 108,
  8446. "../../util/browser": 182,
  8447. "../../util/common": 185,
  8448. "./ShareEvents": 76,
  8449. events: 202
  8450. }],
  8451. 78: [function(e, t, i) {
  8452. "use strict";
  8453. t.exports = Object.freeze({
  8454. OPENED: "terms.opened",
  8455. CLOSED: "terms.closed"
  8456. })
  8457. }
  8458. , {}],
  8459. 79: [function(e, t, i) {
  8460. "use strict";
  8461. var n = e("./TermsEvent")
  8462. , r = e("../../localization/localize")
  8463. , o = e("../../analytics")
  8464. , a = e("../../util/ajax")
  8465. , s = e("../../util/common")
  8466. , l = e("events").EventEmitter
  8467. , c = document.getElementById("terms-modal")
  8468. , h = {
  8469. init: function() {
  8470. $(".footer-terms").on("click", function(e) {
  8471. e.preventDefault(),
  8472. this.show()
  8473. }
  8474. .bind(this)),
  8475. $("#terms-modal .close").on("click", this.hide.bind(this))
  8476. },
  8477. show: function() {
  8478. this.emit(n.OPENED),
  8479. a.get("static/" + r.TERMS_TEXT_FILE).done(function(e) {
  8480. var t = $("#terms-text").html(e);
  8481. o.track("showcase_gui", {
  8482. gui_action: "click_terms_button",
  8483. interaction_source: "gui"
  8484. }),
  8485. t.find("a").attr("target", "_blank")
  8486. }).fail(function() {
  8487. $("#terms-text").html("<h1>" + r.TERMS_OF_USE + "</h1><p>" + r.TERMS_FAIL)
  8488. }),
  8489. c.classList.add("fadeIn")
  8490. },
  8491. hide: function(e) {
  8492. e && e.preventDefault(),
  8493. c.classList.contains("fadeIn") && this.emit(n.CLOSED),
  8494. c.classList.remove("fadeIn")
  8495. }
  8496. };
  8497. s.extendObject(h, l.prototype),
  8498. t.exports = h
  8499. }
  8500. , {
  8501. "../../analytics": 4,
  8502. "../../localization/localize": 108,
  8503. "../../util/ajax": 181,
  8504. "../../util/common": 185,
  8505. "./TermsEvent": 78,
  8506. events: 202
  8507. }],
  8508. 80: [function(e, t, i) {
  8509. "use strict";
  8510. t.exports = Object.freeze({
  8511. OPEN_INFO: "title.open.info",
  8512. CLOSE_INFO: "title.close.info",
  8513. SHOW_INFO: "title.show.info",
  8514. HIDE_INFO: "title.hide.info",
  8515. LINK_CLICKED: "title.link.click",
  8516. CONTACT_LINK_CLICKED: "title.contact.click",
  8517. ORIGIN_LINK_CLICKED: "title.origin.click"
  8518. })
  8519. }
  8520. , {}],
  8521. 81: [function(e, t, i) {
  8522. "use strict";
  8523. function n(e, t) {
  8524. o.tags.enabled && 0 !== Object.keys(e.tags).length && r(e, t)
  8525. }
  8526. function r(e, t) {
  8527. function i(i) {
  8528. e.shouldShowtags = "show" === this.value,
  8529. e.shouldShowtags ? t.showAlltags(o.tags.startup.fadeInDuration) : t.hideAlltags(o.tags.startup.fadeInDuration)
  8530. }
  8531. document.getElementById("tag-toggles").classList.remove("hidden"),
  8532. document.getElementById("radio-tag-show").checked = !0;
  8533. for (var n = document.getElementById("tag-inputs").querySelectorAll("input"), r = 0; r < n.length; r++)
  8534. n[r].addEventListener("change", i)
  8535. }
  8536. var o = e("../../settings");
  8537. t.exports.init = n
  8538. }
  8539. , {
  8540. "../../settings": 166
  8541. }],
  8542. 82: [function(e, t, i) {
  8543. (function(i) {
  8544. "use strict";
  8545. function n(e, t) {
  8546. return e && u.valueFromHash("title", 1) && 2 !== u.valueFromHash("mls", 0) ? (document.getElementsByClassName("titleText")[0].innerText = e, g_weixinObj.title = e,
  8547. e.length > g.minTooltipCharacters && I.parentElement.setAttribute("data-original-title", e),
  8548. t && 1 !== m.specialEdition && m.brand && !m.mls ? document.getElementById("cobrandTitle").innerText = t : (document.getElementsByClassName("co-brand")[0].classList.add("hidden"),
  8549. document.getElementById("gui-name").classList.add("noCoBrand"),
  8550. document.getElementById("cobrandTitle").classList.add("hidden")),
  8551. !0) : (document.getElementById("model-title").classList.add("hidden"),
  8552. !1)
  8553. }
  8554. function r(e) {
  8555. return e ? (L = !0,
  8556. void (_.innerHTML = e)) : void _.classList.add("hidden")
  8557. }
  8558. function o(e, t, i, n) {
  8559. if (!e && !t && !i || !m.brand || u.valueFromHash("mls", !1))
  8560. return void T.classList.add("hidden");
  8561. L = !0;
  8562. var r = []
  8563. , o = c(r, "<br>");
  8564. if (e && o('<span id="contactName">' + e + "</span>"),
  8565. t) {
  8566. var a = n || t
  8567. , s = u.isMobile() ? '<a id="phone" href="callto:' + t + '">' + a + "</a>" : "<span>" + a + "</span>";
  8568. o(s)
  8569. }
  8570. i && o('<a id="email" href="mailTo:' + i + '">' + i + "</a>"),
  8571. r[0] = "",
  8572. x.innerHTML = r.join("")
  8573. }
  8574. function a(e) {
  8575. if ("string" == typeof e)
  8576. try {
  8577. e = JSON.parse(e)
  8578. } catch (e) {
  8579. return y.warn("Unable to parse address data"),
  8580. void S.parentElement.classList.add("hidden")
  8581. }
  8582. if (!(e && (e.address_1 || e.address_2 || e.city || e.state || e.zip)))
  8583. return void S.parentElement.classList.add("hidden");
  8584. L = !0;
  8585. var t = []
  8586. , i = c(t, " ");
  8587. e.address_1 && i(e.address_1),
  8588. e.address_2 && i(e.address_2),
  8589. e.city && i(e.city, ", "),
  8590. e.state && i(e.state, ", "),
  8591. e.zip && i(e.zip, e.state ? " " : ", "),
  8592. t[0] = "",
  8593. S.innerText = t.join("")
  8594. }
  8595. function s(e) {
  8596. var t = document.createElement("a");
  8597. return t.id = "url",
  8598. t.target = "_blank",
  8599. t.href = e,
  8600. t.innerText = e,
  8601. t.addEventListener("click", N.emit.bind(N, v.ORIGIN_LINK_CLICKED)),
  8602. t
  8603. }
  8604. function l(e) {
  8605. return !(!e || u.inIframe() && document.referrer === e) && (R.classList.remove("hidden"),
  8606. P.innerHTML = f.WEBVR_LEARN_MORE + ": ",
  8607. P.appendChild(s(e)),
  8608. O.forEach(function(e) {
  8609. e.classList.add("share-link")
  8610. }),
  8611. !0)
  8612. }
  8613. function c(e, t) {
  8614. var i = e
  8615. , n = t;
  8616. return function(e, t) {
  8617. i.push(t || n, e)
  8618. }
  8619. }
  8620. function h() {
  8621. document.getElementById("title-toggle").addEventListener("click", N.toggleTitle.bind(N)),
  8622. L && I.addEventListener("click", N.toggleMeta.bind(N, !1));
  8623. var e = [].slice.call(_.querySelectorAll("a"));
  8624. e.forEach(function(e) {
  8625. e.addEventListener("click", N.emit.bind(N, v.LINK_CLICKED))
  8626. });
  8627. var t = [].slice.call(T.querySelectorAll("a"));
  8628. t.forEach(function(e) {
  8629. e.addEventListener("click", N.emit.bind(N, v.CONTACT_LINK_CLICKED, {
  8630. contact_type: e.getAttribute("id")
  8631. }))
  8632. })
  8633. }
  8634. var u = e("../../util/browser")
  8635. , d = e("../../util/common")
  8636. , p = e("../../util/logger")
  8637. , f = e("../../localization/localize")
  8638. , g = e("./titleBarSettings")
  8639. , m = e("../../settings")
  8640. , v = e("./TitleEvents")
  8641. , A = e("events").EventEmitter
  8642. , y = new p(i)
  8643. , C = document.querySelector(".pinTop.left")
  8644. , I = document.getElementsByClassName("title-container")[0]
  8645. , E = document.getElementById("title-toggle").querySelector("i")
  8646. , b = document.getElementById("meta-info-wrapper")
  8647. , w = document.getElementById("meta-info")
  8648. , _ = document.getElementById("meta-description")
  8649. , T = document.getElementsByClassName("contact-info")[0]
  8650. , x = document.getElementById("contact-data")
  8651. , S = document.getElementById("addressTxt")
  8652. , M = document.getElementById("tag-toggles")
  8653. , R = document.getElementById("share-origin")
  8654. , P = document.getElementById("share-link-wrapper")
  8655. , O = [w, b, I]
  8656. , L = !1
  8657. , D = !1
  8658. , N = {
  8659. populate: function(e) {
  8660. if (n(window.DATA.name, e.coBrand)) {
  8661. if (r(e.description),
  8662. o(e.contactName, e.phone, e.email, e.formatted_contact_phone),
  8663. a(e.address),
  8664. L) {
  8665. var t = document.createElement("br");
  8666. M.insertBefore(t, M.firstElementChild)
  8667. }
  8668. e.socialSharing && m.share.enabled && (D = l(e.url))
  8669. }
  8670. },
  8671. finishSetup: function(e) {
  8672. L = L || !!e,
  8673. h(),
  8674. L || (D ? I.classList.add("share-only") : I.classList.add("no-meta"))
  8675. },
  8676. toggleMeta: function(e, t) {
  8677. var title = document.getElementById("model-title");
  8678. t && t.preventDefault();
  8679. var i = w.classList.contains("expand");
  8680. e && !i || (i ? (O.forEach(function(e) {
  8681. e.classList.remove("expand")
  8682. }),
  8683. this.emit(v.CLOSE_INFO),title.classList.remove("expand")) : (O.forEach(function(e) {
  8684. e.classList.add("expand");
  8685. }),
  8686. title.classList.add("expand"),
  8687. this.emit(v.OPEN_INFO)))
  8688. },
  8689. setupToggling: function() {
  8690. b.style.height = w.offsetHeight + "px",
  8691. w.addEventListener("transitionend", function() {
  8692. b.style.height = w.offsetHeight + "px"
  8693. })
  8694. },
  8695. toggleTitle: function(e) {
  8696. e && e.preventDefault(),
  8697. C.classList.contains("closed") ? (C.classList.add("open"),
  8698. E.classList.remove("icon-dpad-right"),
  8699. E.classList.add("icon-dpad-left"),
  8700. this.emit(v.SHOW_INFO),
  8701. setTimeout(function() {
  8702. C.classList.remove("closed"),
  8703. C.classList.remove("open")
  8704. }, g.removeAnimationClasses)) : (C.classList.add("closed"),
  8705. E.classList.remove("icon-dpad-left"),
  8706. E.classList.add("icon-dpad-right"),
  8707. this.emit(v.HIDE_INFO))
  8708. }
  8709. };
  8710. d.extendObject(N, A.prototype),
  8711. t.exports = N
  8712. }
  8713. ).call(this, "/js/gui/title/titleBar.js")
  8714. }
  8715. , {
  8716. "../../localization/localize": 108,
  8717. "../../settings": 166,
  8718. "../../util/browser": 182,
  8719. "../../util/common": 185,
  8720. "../../util/logger": 189,
  8721. "./TitleEvents": 80,
  8722. "./titleBarSettings": 83,
  8723. events: 202
  8724. }],
  8725. 83: [function(e, t, i) {
  8726. "use strict";
  8727. t.exports = Object.freeze({
  8728. minTooltipCharacters: 19,
  8729. removeAnimationClasses: 500
  8730. })
  8731. }
  8732. , {}],
  8733. 84: [function(e, t, i) {
  8734. "use strict";
  8735. function n(e) {
  8736. C = e,
  8737. P.forEach(function(e) {
  8738. b.addEventListener(e, u.bind(this, !1), !0),
  8739. w.addEventListener(e, u.bind(this, !0), !0),
  8740. E.addEventListener(e, o, !0)
  8741. S.forEach(function(t) {//会触发导览停止
  8742. t.addEventListener(e, a, !0)
  8743. })
  8744. $("#drawer img").on(e, a)
  8745. })
  8746. document.addEventListener("keydown", u.bind(this, !1), !0)
  8747. C.on(v.TourStart, function() {
  8748. E.classList.add("playing")
  8749. })
  8750. }
  8751. function r() {
  8752. C.playTour(),
  8753. I && clearTimeout(I),
  8754. d(),
  8755. _.removeClass("fadeIn")
  8756. }
  8757. function o() {
  8758. E.classList.contains("playing") && (C.stopTour(),
  8759. _.addClass("fadeIn"),
  8760. setTimeout(function() {
  8761. _.removeClass("fadeIn")
  8762. }, p.tourInteraction.showPauseButton),
  8763. O || (clearTimeout(I),
  8764. I = setTimeout(h, p.tourInteraction.showModal)),
  8765. setTimeout(function() {
  8766. E.classList.remove("playing")
  8767. }, p.tourInteraction.allowNextClick))
  8768. }
  8769. function a() {
  8770. C.tourInProgress && (C.stopTour(),
  8771. C.endTourProgress(),
  8772. E.classList.remove("playing"))
  8773. }
  8774. function s() {
  8775. T.is(":visible") ? r() : o()
  8776. }
  8777. function l() {
  8778. x.hasClass("playing") && (clearTimeout(I),
  8779. C.atEndOfTour() ? c() : _.removeClass("fadeIn"))
  8780. }
  8781. function c() {
  8782. E.classList.remove("playing"),
  8783. h()
  8784. }
  8785. function h() {//去掉导览结束时的提示
  8786. /* if (!p.tourInteraction.disabled) {
  8787. M.removeClass("small landing " + g.FLOORPLAN + " " + g.OUTDOOR + " " + g.PANORAMA),
  8788. M.addClass("fadeIn tour " + m.deviceType);
  8789. var e = p.tourInteraction.smallModal ? y.SMALL : y.LARGE;
  8790. if (!p.tourInteraction.smallModal) {
  8791. var t;
  8792. 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,
  8793. m.fill(R, A.TOUR_INTERACTION[t]),
  8794. M.addClass(t)
  8795. }
  8796. M.addClass(e)
  8797. } */
  8798. }
  8799. function u(e, t) {
  8800. if (t) {
  8801. var i = "keydown" === t.type
  8802. , n = t.which === f.SPACE || C.tourIsPlaying;
  8803. i && n || e || (O = !0),
  8804. C.atEndOfTour() && d(),
  8805. !C.tourIsPlaying && C.tourInProgress && (_.removeClass("fadeIn"),
  8806. d(),
  8807. t.which !== f.SPACE && a()),
  8808. i && n && s()
  8809. }
  8810. }
  8811. function d() {
  8812. M.removeClass("fadeIn")
  8813. }
  8814. var p = (e("../util/browser"),
  8815. e("../settings"))
  8816. , f = e("../enum/Keys")
  8817. , g = e("../enum/Viewmode")
  8818. , m = (e("./helpManager"),
  8819. e("./populateModal"))
  8820. , v = e("../enum/DirectorEvents")
  8821. , A = e("../enum/HelpModalType")
  8822. , y = e("../enum/HelpModalSize")
  8823. , C = null
  8824. , I = null
  8825. , E = document.getElementById("pause-overlay")
  8826. , b = document.getElementById("player")
  8827. , w = document.getElementById("gui")
  8828. , _ = $("#pause-icon").eq(0)
  8829. , T = $("#play").eq(0)
  8830. , x = $("#playHead").eq(0)
  8831. , S = $(".rightViewContainer, #previous, #next, #gui-modes-inside, #gui-modes-outside, #gui-modes-dollhouse, #gui-modes-floorplan").toArray()
  8832. , M = $("#interaction-modal").eq(0)
  8833. , R = $("#interaction-modal .interaction").toArray()
  8834. , P = ["touchstart", "mousedown", "pointerdown"]
  8835. , O = !1;
  8836. t.exports.init = n,
  8837. t.exports.play = r,
  8838. t.exports.pause = o,
  8839. t.exports.pauseWithoutCTA = a,
  8840. t.exports.togglePlay = s,
  8841. t.exports.stopTour = l,
  8842. t.exports.dismissModal = d
  8843. }
  8844. , {
  8845. "../enum/DirectorEvents": 23,
  8846. "../enum/HelpModalSize": 27,
  8847. "../enum/HelpModalType": 28,
  8848. "../enum/Keys": 30,
  8849. "../enum/Viewmode": 51,
  8850. "../settings": 166,
  8851. "../util/browser": 182,
  8852. "./helpManager": 68,
  8853. "./populateModal": 75
  8854. }],
  8855. 85: [function(e, t, i) {
  8856. "use strict";
  8857. t.exports = Object.freeze({
  8858. OPENED: "vr.modal.opened",
  8859. LAUNCH: "vr.modal.launch",
  8860. CLOSED: "vr.modal.closed",
  8861. NEXT: "vr.modal.next",
  8862. PREV: "vr.modal.prev",
  8863. STORE: "vr.modal.store",
  8864. falseICECHOSEN: "vr.modal.device"
  8865. })
  8866. }
  8867. , {}],
  8868. 86: [function(e, t, i) {
  8869. "use strict";
  8870. function n(e, t, i) {
  8871. function n(e, t, n, r) {
  8872. function o() {
  8873. return p + "&m=" + t + "&display=" + e
  8874. }
  8875. function s() {
  8876. var e = "&utm_medium=" + (a.inIframe() ? "embed" : "direct")
  8877. , t = "&utm_source=" + u
  8878. , n = "&utm_showcase_session_id=" + i;
  8879. return e + t + n
  8880. }
  8881. function l() {
  8882. return d + "&sids=" + t + "&lsid=" + t + "&ln=" + encodeURIComponent(n) + "&ld=" + encodeURIComponent(r) + "&display=" + e
  8883. }
  8884. return a.valueFromHash("vrcoll", !1) ? l() + s() : o() + s()
  8885. }
  8886. function r(e, t, i, r) {
  8887. var o = "https://api.branch.io/v1/url"
  8888. , a = n(e, t, i, r)
  8889. , s = {
  8890. responseType: "json",
  8891. data: {
  8892. branch_key: h.appConfig.branch_key,
  8893. data: {
  8894. m: t,
  8895. full_url: a,
  8896. $desktop_url: m,
  8897. $og_app_id: "331853976762864119",
  8898. $og_title: i,
  8899. $og_description: r,
  8900. $og_image_url: location.origin + "/api/v1/player/models/" + t + "/thumb",
  8901. $canonical_url: window.location.href
  8902. }
  8903. }
  8904. };
  8905. c.post(o, s).done(function(t) {
  8906. f[e] = t.url
  8907. }).fail(function(t) {
  8908. f[e] = t
  8909. }
  8910. .bind(this, a))
  8911. }
  8912. function o(e, t, i) {
  8913. for (var r in s) {
  8914. var o = s[r]
  8915. , a = n(o, e, t, i);
  8916. f[o] = a
  8917. }
  8918. }
  8919. var u = a.inIframe() ? encodeURIComponent(document.referrer) : encodeURIComponent(window.location.href)
  8920. , d = g + "/vr/dlist/?ret=" + u
  8921. , p = g + "/vr/show/?ret=" + u
  8922. , m = "";
  8923. switch (e) {
  8924. case l.IOS:
  8925. r(s.CardboardIOS, t.sid, t.name, t.summary);
  8926. break;
  8927. default:
  8928. o(t.sid, t.name, t.summary)
  8929. }
  8930. }
  8931. function r(e) {
  8932. var t = f[e];
  8933. window.open(t, "_blank")
  8934. }
  8935. function o(e) {
  8936. var t = u[e];
  8937. window.open(t, "_blank")
  8938. }
  8939. var a = e("../../util/browser")
  8940. , s = e("../../enum/VRApps")
  8941. , l = e("../../enum/VRPlatforms")
  8942. , c = e("../../util/ajax")
  8943. , h = e("../../settings")
  8944. , u = {};
  8945. u[s.CardboardAndroid] = "https://play.google.com/store/apps/details?id=com.port.mpvrcardboard&redirect_uri=",
  8946. u[s.CardboardIOS] = "https://itunes.apple.com/us/app/port-vr/id1168808473&redirect_uri=",
  8947. u[s.GearVR] = "https://www.oculus.com/experiences/gear-vr/811670972252145/?redirect_uri=";
  8948. for (var d in s) {
  8949. var p = s[d];
  8950. u[p] += encodeURIComponent(document.referrer + "&display=" + p)
  8951. }
  8952. var f = {}
  8953. , g = function() {
  8954. var e = window.location.host;
  8955. return e.indexOf(".port.com") === -1 && e.indexOf("localhost") === -1 && (e = "my.port.com"),
  8956. "https://" + e
  8957. }();
  8958. t.exports.init = n,
  8959. t.exports.launch = r,
  8960. t.exports.launchStore = o
  8961. }
  8962. , {
  8963. "../../enum/VRApps": 46,
  8964. "../../enum/VRPlatforms": 49,
  8965. "../../settings": 166,
  8966. "../../util/ajax": 181,
  8967. "../../util/browser": 182
  8968. }],
  8969. 87: [function(e, t, i) {
  8970. "use strict";
  8971. function n(e) {
  8972. var t;
  8973. switch (e) {
  8974. case m.IOS:
  8975. return t = p.iosVersion(),
  8976. t.major > 9 || 9 === t.major && t.minor >= 1;
  8977. case m.Android:
  8978. return t = p.androidVersion(),
  8979. t.major > 4 || 4 === t.major && t.minor > 4 || 4 === t.major && 4 === t.minor && t.patch >= 4
  8980. }
  8981. return !1
  8982. }
  8983. function r(e, t) {
  8984. function i(e) {
  8985. K.emit(A.STORE, {
  8986. type: e
  8987. }),
  8988. f.launchStore(e)
  8989. }
  8990. function r(e) {
  8991. switch (e !== _.pageCount && (a(e),
  8992. N.text(e + 1 + " / " + _.pageCount)),
  8993. e) {
  8994. case _.Title:
  8995. O.css("display", "none"),
  8996. L.text(u[e]),
  8997. o(s);
  8998. break;
  8999. case _.Cardboard:
  9000. O.css("display", "block"),
  9001. L.text(u[e]),
  9002. M.filter(".cardboard").off(),
  9003. M.filter(".gearvr").off(),
  9004. c(e, s),
  9005. h(H, X, Z);
  9006. break;
  9007. case _.Gear:
  9008. L.text(u[e]),
  9009. c(e, s),
  9010. T.addClass("lastPage"),
  9011. h(G, X, Z);
  9012. break;
  9013. case _.pageCount:
  9014. T.removeClass("fadeIn"),
  9015. K.emit(A.CLOSED)
  9016. }
  9017. B.filter("[src='']").hide()
  9018. }
  9019. var s = function() {
  9020. return p.detectAndroid() ? p.detectAndroidMobile() && n(m.Android) ? (T.addClass("supported"),
  9021. w = ".show-supported",
  9022. m.Android) : (T.addClass("unsupported"),
  9023. w = ".show-unsupported",
  9024. m.UnsupportedAndroid) : p.detectIPhone() || p.detectIPod() ? (T.addClass("ios"),
  9025. w = ".show-ios",
  9026. _ = v.ios,
  9027. m.IOS) : (T.addClass("desktop"),
  9028. w = ".show-desktop",
  9029. m.Desktop)
  9030. }();
  9031. f.init(s, e, t),
  9032. s !== m.Desktop && T.addClass("mobile");
  9033. var l = function(e) {
  9034. K.emit(A.LAUNCH, {
  9035. vr_platform: s,
  9036. vr_app: e
  9037. }),
  9038. f.launch(e)
  9039. };
  9040. q.cardboardAndroid = l.bind(this, g.CardboardAndroid),
  9041. q.gear = l.bind(this, g.GearVR),
  9042. q.cardboardIOS = l.bind(this, g.CardboardIOS),
  9043. d(),
  9044. $(".show-supported, .show-unsupported, .show-ios, .show-desktop").hide(),
  9045. $(w).show();
  9046. var u = [C.VR_LEARN_MORE_CAPS, C.VR_NEXT_CAPS, C.VR_GOT_IT_CAPS]
  9047. , y = ["vr_modal_learn_more", "vr_modal_next", "vr_modal_done"];
  9048. s === m.IOS && (u.splice(1, 1),
  9049. y.splice(1, 1)),
  9050. $("#vr").on("click", function(e) {
  9051. e.preventDefault();
  9052. player.FlyToMode("panorama", ()=>{
  9053. if(!window.vrEnabled) { // 开启VR
  9054. window.vrEnabled = true;
  9055. this.classList.add('active');
  9056. $('#gui div').not('#vrOff').addClass('vrHide');
  9057. $('#vrOffImg').css({'display':'inline-block'});
  9058. }else{
  9059. }
  9060. })
  9061. });
  9062. $('#vrOff').on('click', function(){
  9063. window.vrEnabled = false;
  9064. $('#gui div').not('#vrOff').removeClass('vrHide');
  9065. $('#vrOffImg').css({'display':'none'});
  9066. $('#player canvas').css({width:'', 'height': ''}); // 清楚vr下给canvas设置的宽高, 避免横竖屏切换的时候出现宽高错误的现象
  9067. $('#vr').removeClass('active'); // 清除vr按钮的激活样式
  9068. })
  9069. var I = "https://my.port.com/vr/show/?m=" + e.sid;
  9070. s === m.IOS ? $(".cardboardLink").on("click", i.bind(this, g.CardboardIOS)) : $(".cardboardLink").on("click", i.bind(this, g.CardboardAndroid)),
  9071. $(".gearLink").on("click", i.bind(this, g.GearVR)),
  9072. $("span.modelLink").text(I),
  9073. O.on("click", function(e) {
  9074. K.emit(A.PREV),
  9075. b--,
  9076. r(b)
  9077. }),
  9078. L.on("click", function(e) {
  9079. L.text();
  9080. K.emit(A.NEXT, {
  9081. nextAction: y[b]
  9082. }),
  9083. b++,
  9084. r(b)
  9085. }),
  9086. T.find(".close").on("click", K.dismiss)
  9087. }
  9088. function o(e) {
  9089. switch (e) {
  9090. case m.Android:
  9091. M.filter(".cardboard").off().on("click", q.cardboardAndroid),
  9092. M.filter(".gearvr").off().on("click", q.gear),
  9093. s(H, G, "logo-button", "same-line");
  9094. break;
  9095. case m.UnsupportedAndroid:
  9096. s("", z, "", "");
  9097. break;
  9098. case m.IOS:
  9099. M.filter(".cardboard").off().on("click", q.cardboardIOS),
  9100. s(H, "", "logo-button", "");
  9101. break;
  9102. case m.Desktop:
  9103. M.filter(".cardboard").off().on("click", l.bind(this, null, F, U)),
  9104. M.filter(".gearvr").off().on("click", l.bind(this, G, V, null)),
  9105. s(H, G, "logo-button", "same-line"),
  9106. Q.cardboard()
  9107. }
  9108. }
  9109. function a(e) {
  9110. $(".p1, .p2, .p3").hide(),
  9111. x.insertAfter(S),
  9112. T.removeClass("front-page"),
  9113. T.removeClass("details-page"),
  9114. T.removeClass("lastPage"),
  9115. M.removeClass("logo-button"),
  9116. M.removeClass("same-line"),
  9117. S.removeClass("headsetOptions"),
  9118. R.attr("src", ""),
  9119. R.filter(".second").removeClass("gear"),
  9120. R.css("display", "inline-block"),
  9121. R.off(),
  9122. P.filter(".second").css("display", ""),
  9123. D.css("display", "none"),
  9124. $(".p" + (e + 1) + w).show(),
  9125. R.filter(".third").insertBefore(P.filter(".third"))
  9126. }
  9127. function s(e, t, i, n) {
  9128. T.addClass("front-page"),
  9129. R.filter(".first").attr("src", e),
  9130. R.filter(".second").attr("src", t),
  9131. M.filter(".first").addClass(i),
  9132. M.filter(".second").addClass(i),
  9133. M.addClass(n),
  9134. ".show-desktop" === w && S.insertAfter(x)
  9135. }
  9136. function l(e, t, i) {
  9137. S.addClass("headsetOptions"),
  9138. M.off(),
  9139. R.filter(".second").attr("src", t),
  9140. D.css("display", "block"),
  9141. P.filter(".second").css("display", "none"),
  9142. D.on("click", function() {
  9143. a(_.Title),
  9144. o(m.Desktop)
  9145. }),
  9146. e && (K.emit(A.falseICECHOSEN, {
  9147. name: g.GearVR
  9148. }),
  9149. R.filter(".first").attr("src", e),
  9150. R.filter(".second").addClass("gear"),
  9151. R.filter(".second").on("click", f.launchStore.bind(this, g.GearVR)),
  9152. Q.gearvr()),
  9153. i && (K.emit(A.falseICECHOSEN, {
  9154. name: g.Cardboard
  9155. }),
  9156. R.filter(".third").attr("src", i),
  9157. R.filter(".third").show(),
  9158. R.filter(".third").insertAfter(R.filter(".second")),
  9159. R.filter(".third").addClass("link"),
  9160. R.filter(".second").addClass("link"),
  9161. R.filter(".second").on("click", f.launchStore.bind(this, g.CardboardIOS)),
  9162. R.filter(".third").on("click", f.launchStore.bind(this, g.CardboardAndroid)),
  9163. Q.cardboard())
  9164. }
  9165. function c(e, t) {
  9166. switch (t) {
  9167. case m.IOS:
  9168. X = Y,
  9169. Z = j;
  9170. break;
  9171. case m.Desktop:
  9172. e === _.Cardboard ? (X = F,
  9173. Z = U,
  9174. R.filter(".second").on("click", f.launchStore.bind(this, g.CardboardIOS)),
  9175. R.filter(".third").on("click", f.launchStore.bind(this, g.CardboardAndroid))) : (X = V,
  9176. R.filter(".second").on("click", f.launchStore.bind(this, g.GearVR)),
  9177. Z = "");
  9178. break;
  9179. default:
  9180. e === _.Cardboard ? (X = z,
  9181. Z = j) : (X = k,
  9182. Z = W)
  9183. }
  9184. }
  9185. function h(e, t, i) {
  9186. T.find(".inner").addClass("details-page"),
  9187. T.addClass("details-page"),
  9188. R.filter(".first").attr("src", e),
  9189. R.filter(".second").attr("src", t),
  9190. R.filter(".third").attr("src", i)
  9191. }
  9192. function u() {
  9193. T.hasClass("fadeIn") && (T.removeClass("fadeIn"),
  9194. K.emit(A.CLOSED))
  9195. }
  9196. function d() {
  9197. var e = p.aspectRatio() > 1 && p.isMobile();
  9198. T.toggleClass("landscape", e).toggleClass("portrait", !e),
  9199. T.toggleClass("tiny", $("#player").height() <= y.narrowLandscapeHeight),
  9200. T.toggleClass("tinier", $("#player").height() <= y.reallyNarrowLandscapeHeight)
  9201. }
  9202. var p = e("../../util/browser")
  9203. , f = e("./vrLink")
  9204. , g = e("../../enum/VRApps")
  9205. , m = e("../../enum/VRPlatforms")
  9206. , v = e("../../enum/VRPages")
  9207. , A = e("./vrEvent")
  9208. , y = (e("../../settings"),
  9209. e("../../constants"))
  9210. , C = e("../../localization/localize")
  9211. , I = e("../../util/common")
  9212. , E = e("events").EventEmitter
  9213. , b = 0
  9214. , w = null
  9215. , _ = v.standard
  9216. , T = $(".vr-popup")
  9217. , x = T.find(".vr-popup-body")
  9218. , S = T.find(".vr-images")
  9219. , M = T.find(".img-container")
  9220. , R = T.find(".vr-sm-image")
  9221. , P = M.find(".vr-img-caption")
  9222. , O = $(".vr-buttons").find(".prev-button")
  9223. , L = $(".vr-buttons").find(".next-button")
  9224. , D = S.find(".front-close")
  9225. , N = $(".vr-page")
  9226. , B = T.find("img")
  9227. , F = "images/apple-store.png"
  9228. , V = "images/badge-oculus.png"
  9229. , U = "images/badge-cardboard.png"
  9230. , k = "images/logo-samsung.png"
  9231. , H = "images/headset-cardboard.png"
  9232. , G = "images/headset-gearvr.png"
  9233. , z = "images/ico-android-robot.png"
  9234. , W = "images/ico-gearvr.png"
  9235. , j = "images/ico-vr.png"
  9236. , Y = "images/apple-logo-white.svg"
  9237. , X = null
  9238. , Z = null
  9239. , q = {}
  9240. , K = {
  9241. init: r,
  9242. dismiss: u,
  9243. isDeviceSupported: n
  9244. };
  9245. I.extendObject(K, E.prototype),
  9246. $(window).resize(d);
  9247. var Q = function() {
  9248. var e = P.filter(".first").find(".cardboard")
  9249. , t = P.filter(".first").find(".gearvr");
  9250. return {
  9251. cardboard: function() {
  9252. t.addClass("hidden"),
  9253. e.removeClass("hidden")
  9254. },
  9255. gearvr: function() {
  9256. e.addClass("hidden"),
  9257. t.removeClass("hidden")
  9258. }
  9259. }
  9260. }();
  9261. t.exports = K
  9262. }
  9263. , {
  9264. "../../constants": 8,
  9265. "../../enum/VRApps": 46,
  9266. "../../enum/VRPages": 48,
  9267. "../../enum/VRPlatforms": 49,
  9268. "../../localization/localize": 108,
  9269. "../../settings": 166,
  9270. "../../util/browser": 182,
  9271. "../../util/common": 185,
  9272. "./vrEvent": 85,
  9273. "./vrLink": 86,
  9274. events: 202
  9275. }],
  9276. 88: [function(e, t, i) {
  9277. "use strict";
  9278. t.exports = Object.freeze({
  9279. OPENED: "webvr.modal.opened",
  9280. SHOW_TERMS: "webvr.footer.show.terms"
  9281. })
  9282. }
  9283. , {}],
  9284. 89: [function(e, t, i) {
  9285. (function(i) {
  9286. "use strict";
  9287. function n(e, t, i, n) {
  9288. function r(e) {
  9289. e.preventDefault(),
  9290. a(e.currentTarget.id)
  9291. }
  9292. function a(e) {
  9293. ne[e](),
  9294. Object.keys(ne).map(function(t, i) {
  9295. $("#" + t).toggleClass("tabs-underlined", t === e)
  9296. })
  9297. }
  9298. y = i,
  9299. v = t,
  9300. w.init(E.Android, e, n),
  9301. m();
  9302. var l = new RegExp("daydream","i")
  9303. , c = l.test(y.displayName);
  9304. c ? (a("tabdaydream"),
  9305. B.filter(".device-headset-side").attr("src", H),
  9306. D.find(".title").text(x.localizeText("WEBVR_FOR_DAYDREAM"))) : (a("tabcardboard"),
  9307. B.filter(".device-headset-side").attr("src", Y),
  9308. D.find(".title").text(x.localizeText("WEBVR_FOR_CARDBOARD"))),
  9309. $("#vr").on("click", function(e) {
  9310. e.preventDefault(),
  9311. g("click_webvr_button"),
  9312. L.is(":hidden") && (ie.emit(_.OPENED),
  9313. o())
  9314. }),
  9315. $(".webvr-popup .close").on("click", function(e) {
  9316. e.preventDefault(),
  9317. D.hasClass("hidden") ? (g("webvr_help_close"),
  9318. p()) : s()
  9319. }),
  9320. $("#tabcardboard").on("click", r),
  9321. $("#tabdaydream").on("click", r),
  9322. $("#tabnative").on("click", r),
  9323. $(".webvr-popup .open-with-app").on("click", function(e) {
  9324. e.preventDefault(),
  9325. g("webvr_learn_more"),
  9326. a("tabnative"),
  9327. p()
  9328. }),
  9329. $(".webvr-popup .help").on("click", function(e) {
  9330. e.preventDefault(),
  9331. g(D.hasClass("hidden") ? "webvr_help_close" : "webvr_help_show"),
  9332. p()
  9333. }),
  9334. $(".webvr-popup .terms").on("click", function(e) {
  9335. e.preventDefault(),
  9336. g("webvr_click_terms"),
  9337. s(),
  9338. ie.emit(_.SHOW_TERMS)
  9339. }),
  9340. F.on("click", function(e) {
  9341. e.preventDefault(),
  9342. g(ee),
  9343. window.open(J, "_blank")
  9344. }),
  9345. V.on("click", function(e) {
  9346. e.preventDefault(),
  9347. g("webvr_phone_link"),
  9348. window.open(te, "_blank")
  9349. }),
  9350. $(".webvr-popup .badge-cardboard").on("click", function(e) {
  9351. e.preventDefault(),
  9352. g("webvr_cardboard_link"),
  9353. w.launch(b.CardboardAndroid)
  9354. }),
  9355. $(".webvr-popup .badge-oculus").on("click", function(e) {
  9356. e.preventDefault(),
  9357. g("webvr_oculus_link"),
  9358. w.launch(b.GearVR)
  9359. })
  9360. }
  9361. function r() {
  9362. function e() {
  9363. y.isPresenting || (f(),
  9364. window.removeEventListener("vrdisplaypresentchange", e))
  9365. }
  9366. R.info("Headset mounted"),
  9367. v.suspend();
  9368. var t = document.createElement("canvas");
  9369. for (t.getContext("webgl"),
  9370. t.className = "webvr-canvas",
  9371. document.bgColor = "#000",
  9372. document.body.style.backgroundColor = "#000"; document.body.firstChild; )
  9373. document.body.removeChild(document.body.firstChild);
  9374. document.body.appendChild(t),
  9375. g("webvr_enter_app"),
  9376. y.requestPresent([{
  9377. source: t,
  9378. predistorted: !0
  9379. }]).catch(function(t) {
  9380. R.error("Failed to present: " + t),
  9381. g("webvr_exit_calibrate"),
  9382. e()
  9383. }),
  9384. A.then(function() {
  9385. window.dispatchEvent(new Event("vrapp-start"))
  9386. }),
  9387. window.addEventListener("vrdisplaypresentchange", e)
  9388. }
  9389. function o() {
  9390. O.fadeOut(I.guiAnimationSpeed),
  9391. L.fadeIn(I.guiAnimationSpeed),
  9392. a()
  9393. }
  9394. function a() {
  9395. if (!A) {
  9396. var e = C.valueFromHash("webvr") || I.appConfig.webvr_version
  9397. , t = "https://static.port.com/webvr/" + e + "/js/main.js";
  9398. A = new Promise(function(e, i) {
  9399. var n = document.createElement("script");
  9400. n.type = "text/javascript",
  9401. n.src = t,
  9402. n.onload = e,
  9403. document.head.appendChild(n)
  9404. }
  9405. )
  9406. }
  9407. D.find(".enter-button").on("click", r)
  9408. }
  9409. function s() {
  9410. g("webvr_modal_close"),
  9411. D.find(".enter-button").off("click", r),
  9412. L.fadeOut(I.guiAnimationSpeed, function() {
  9413. D.toggleClass("hidden", !1),
  9414. N.toggleClass("hidden", !0),
  9415. C.exitFullscreen()
  9416. }),
  9417. O.fadeIn(I.guiAnimationSpeed)
  9418. }
  9419. function l() {
  9420. k.toggleClass("hidden", !1),
  9421. U.toggleClass("hidden", !0)
  9422. }
  9423. function c() {
  9424. k.toggleClass("hidden", !0),
  9425. U.toggleClass("hidden", !1)
  9426. }
  9427. function h() {
  9428. B.filter(".device-headset").attr("src", G),
  9429. B.filter(".device-phone").attr("src", z),
  9430. J = Z,
  9431. ee = K,
  9432. F.text(x.localizeText("WEBVR_DAYDREAM_VIEW")),
  9433. V.text(x.localizeText("VR_NEED_DAYDREAM_PHONE")),
  9434. $(".webvr-popup .detail.daydream-label").toggleClass("hidden", !1),
  9435. c()
  9436. }
  9437. function u() {
  9438. B.filter(".badge-cardboard").attr("src", j),
  9439. B.filter(".badge-oculus").attr("src", X),
  9440. l()
  9441. }
  9442. function d() {
  9443. B.filter(".device-headset").attr("src", Y),
  9444. B.filter(".device-phone").attr("src", W),
  9445. J = q,
  9446. ee = Q,
  9447. F.text(x.localizeText("VR_GOOGLE_CARDBOARD")),
  9448. V.text(x.localizeText("VR_COMPATIBLE_ANDROID_LONG")),
  9449. $(".webvr-popup .detail.daydream-label").toggleClass("hidden", !0),
  9450. c()
  9451. }
  9452. function p() {
  9453. D.toggleClass("hidden"),
  9454. N.toggleClass("hidden")
  9455. }
  9456. function f() {
  9457. R.info("exiting webVR"),
  9458. g("webvr_exit_app"),
  9459. window.location.search.indexOf("&qs=1") === -1 ? window.location = window.location + "&qs=1" : window.location = window.location
  9460. }
  9461. function g(e) {
  9462. var t = C.isLandscape() ? "landscape" : "portrait";
  9463. T.trackAlways("showcase_gui", {
  9464. gui_action: e,
  9465. orientation: t
  9466. })
  9467. }
  9468. function m() {
  9469. var e = C.isLandscape();
  9470. L.toggleClass("landscape", e).toggleClass("portrait", !e)
  9471. }
  9472. var v, A, y, C = e("../../util/browser"), I = e("../../settings"), E = (e("./../gui"),
  9473. e("../../enum/VRPlatforms")), b = e("../../enum/VRApps"), w = e("./../vr/vrLink"), _ = e("./WebVrEvent"), T = e("../../analytics"), x = (e("../../constants"),
  9474. 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 = {
  9475. init: n
  9476. }, ne = {
  9477. tabcardboard: d,
  9478. tabdaydream: h,
  9479. tabnative: u
  9480. };
  9481. S.extendObject(ie, P.prototype),
  9482. $(window).resize(m),
  9483. t.exports = ie
  9484. }
  9485. ).call(this, "/js/gui/webvr/webVRgui.js")
  9486. }
  9487. , {
  9488. "../../analytics": 4,
  9489. "../../constants": 8,
  9490. "../../enum/VRApps": 46,
  9491. "../../enum/VRPlatforms": 49,
  9492. "../../localization/localize": 108,
  9493. "../../settings": 166,
  9494. "../../util/browser": 182,
  9495. "../../util/common": 185,
  9496. "../../util/logger": 189,
  9497. "./../gui": 65,
  9498. "./../vr/vrLink": 86,
  9499. "./WebVrEvent": 88,
  9500. events: 202
  9501. }],
  9502. 90: [function(e, t, i) {
  9503. "use strict";
  9504. function n(e, t, i, n, o) {
  9505. n || 0 === n ? this.floorId = n : this.floorId = -1,
  9506. this.roomId = o || "",
  9507. this.labelId = e,
  9508. this.position = (new r.Vector3).copy(t),
  9509. this.text = i
  9510. }
  9511. var r = e("three")
  9512. , o = e("../util/browser");
  9513. n.prototype.build = function() {
  9514. var e = window.document.createElement("div");
  9515. o.isMobile() ? e.setAttribute("class", "gui-floorplan-label gui-floorplan-label-mobile") : e.setAttribute("class", "gui-floorplan-label");
  9516. var t = window.document.createElement("div");
  9517. t.setAttribute("class", "gui-floorplan-label-text");
  9518. var i = window.document.createTextNode(this.text);
  9519. t.appendChild(i),
  9520. e.appendChild(t),
  9521. window.document.body.appendChild(e),
  9522. this.labelGui = e,
  9523. this.textBlock = t,
  9524. $(this.labelGui).hide();
  9525. var n = window.getComputedStyle(this.labelGui);
  9526. this.initialTransform = n.transform || n.webkitTransform
  9527. }
  9528. ,
  9529. t.exports = n
  9530. }
  9531. , {
  9532. "../util/browser": 182,
  9533. three: 217
  9534. }],
  9535. 91: [function(e, t, i) {
  9536. "use strict";
  9537. function n() {
  9538. this.player = null,
  9539. this.modelManager = null,
  9540. this.container = null
  9541. }
  9542. var r = e("three")
  9543. , o = (e("../util/common"),
  9544. e("../enum/PlayerEvents"))
  9545. , a = (e("../enum/DirectorEvents"),
  9546. e("../enum/ModelManagerEvents"))
  9547. , s = e("../settings")
  9548. , l = e("../enum/Viewmode")
  9549. , c = (e("../enum/WarpStyle"),
  9550. e("../util/transitions"),
  9551. e("../util/lerp"),
  9552. e("../util/browser"));
  9553. //场景初始化
  9554. n.prototype.init = function(e, t, i) {
  9555. this.player = e,
  9556. this.modelManager = t,
  9557. this.container = i,
  9558. this.updateModel(),
  9559. this.bindEvents()
  9560. }
  9561. ,
  9562. n.prototype.bindEvents = function() {
  9563. this.modelManager.on(a.ActiveModelChanged, this.updateModel.bind(this)),
  9564. this.player.on(o.ViewChanged, this.handlePlayerViewChanged.bind(this)),
  9565. this.player.on(o.ModeChanged, this.handlePlayerViewChanged.bind(this)),
  9566. this.player.on(o.StartInside, this.handleStartInside.bind(this)),
  9567. this.player.on(o.StartOutside, this.handleStartOutside.bind(this))
  9568. }
  9569. ,
  9570. n.prototype.updateModel = function() {
  9571. this.model = this.modelManager.getActiveModel()
  9572. }
  9573. ,
  9574. n.prototype.handlePlayerViewChanged = function() {
  9575. this.updateLabelVisibility(),
  9576. this.updateLabelDisplay()
  9577. }
  9578. ,
  9579. n.prototype.getLabelsForFloor = function(e, t) {
  9580. return t = t || [],
  9581. t.length = 0,
  9582. this.model.labels.forEach(function(i) {
  9583. this.labelVisibleForFloor(i, e) && t.push(i)
  9584. }
  9585. .bind(this)),
  9586. t
  9587. }
  9588. ,
  9589. n.prototype.getLabelsForCurrentFloor = function(e) {
  9590. return this.getLabelsForFloor(this.model.currentFloor.floorIndex, e)
  9591. }
  9592. ,
  9593. n.prototype.labelVisibleForFloor = function(e, t) {
  9594. var i = c.isMobile() && this.player.getLabelScaleFactor() < s.labels.zoomHideThreshhold.mobile || !c.isMobile() && this.player.getLabelScaleFactor() < s.labels.zoomHideThreshhold.desktop;
  9595. if (!this.model.showingLabels || !e.labelGui || !i)
  9596. return !1;
  9597. var n = e.floorId === this.model.floors.size() - 1;
  9598. return this.model.allFloorsVisible ? n : e.floorId === t
  9599. }
  9600. ,
  9601. n.prototype.updateLabelVisibility = function(e) {
  9602. this.model.labels.forEach(function(e) {
  9603. 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)
  9604. }
  9605. .bind(this))
  9606. }
  9607. ,
  9608. n.prototype.showAllLabels = function(e, t) {
  9609. this.model.labels.forEach(function(i) {
  9610. this.showLabel(i, e, t)
  9611. }
  9612. .bind(this))
  9613. }
  9614. ,
  9615. n.prototype.hideAllLabels = function(e, t) {
  9616. this.model.labels.forEach(function(i) {
  9617. this.hideLabel(i, e, t)
  9618. }
  9619. .bind(this))
  9620. }
  9621. ,
  9622. n.prototype.showLabel = function(e, t, i) {
  9623. this.model.showingLabels && (e.visible || (e.visible = !0,
  9624. e.labelGui.style.display = "block",
  9625. e.labelGui.style.opacity = 0,
  9626. $(e.labelGui).delay(t).fadeTo(i, 1)))
  9627. }
  9628. ,
  9629. n.prototype.hideLabel = function(e, t, i) {
  9630. e.visible && (e.visible = !1,
  9631. c.isMobile() ? $(e.labelGui).hide() : $(e.labelGui).delay(t).fadeOut(i))
  9632. }
  9633. ,
  9634. n.prototype.supportedMode = function() {
  9635. return this.player.mode === l.FLOORPLAN
  9636. }
  9637. ,
  9638. n.prototype.updateLabelDisplay = function() {
  9639. var e = (new r.Vector3,
  9640. new r.Vector3,
  9641. []);
  9642. return function() {
  9643. var t = this.player.getLabelScaleFactor()
  9644. , i = .6
  9645. , n = 1.2
  9646. , r = (1 - t) * n + i
  9647. , o = c.isMobile() ? s.labels.zoomTruncateThreshhold.mobile : s.labels.zoomTruncateThreshhold.desktop;
  9648. this.getLabelsForCurrentFloor(e);
  9649. for (var a = 0; a < e.length; a++) {
  9650. var l = e[a];
  9651. this.supportedMode() && l.labelGui && (this.updateProjectedGuiElement(l.labelGui, l.textBlock, l.position, r, r),
  9652. 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)
  9653. }
  9654. }
  9655. }(),
  9656. n.prototype.updateProjectedGuiElement = function() {
  9657. var e = new r.Vector3;
  9658. new r.Vector3;
  9659. return function(t, i, n, r, o) {
  9660. i.style.fontSize = 100 * o + "%";
  9661. var a = $("#player").width()
  9662. , s = $("#player").height()
  9663. , l = .5 * a
  9664. , c = .5 * s;
  9665. e.copy(n),
  9666. e.project(this.player.camera);
  9667. var h = e.x * l + l
  9668. , u = -(e.y * c) + c;
  9669. h -= t.offsetWidth / 2,
  9670. u -= t.offsetHeight / 2,
  9671. t.style.left = h + "px",
  9672. t.style.top = u + "px"
  9673. }
  9674. }(),
  9675. n.prototype.handleStartInside = function(e) {
  9676. this.updateLabelVisibility()
  9677. }
  9678. ,
  9679. n.prototype.handleStartOutside = function() {
  9680. this.updateLabelVisibility()
  9681. }
  9682. ,
  9683. t.exports = n
  9684. }
  9685. , {
  9686. "../enum/DirectorEvents": 23,
  9687. "../enum/ModelManagerEvents": 33,
  9688. "../enum/PlayerEvents": 40,
  9689. "../enum/Viewmode": 51,
  9690. "../enum/WarpStyle": 52,
  9691. "../settings": 166,
  9692. "../util/browser": 182,
  9693. "../util/common": 185,
  9694. "../util/lerp": 188,
  9695. "../util/transitions": 195,
  9696. three: 217
  9697. }],
  9698. 92: [function(e, t, i) {
  9699. "use strict";
  9700. Array.prototype.findIndex || (Array.prototype.findIndex = function(e) {
  9701. if (null == this)
  9702. throw new TypeError("Array.prototype.findIndex called on null or undefined");
  9703. if ("function" != typeof e)
  9704. throw new TypeError("predicate must be a function");
  9705. for (var t, i = Object(this), n = i.length >>> 0, r = arguments[1], o = 0; o < n; o++)
  9706. if (t = i[o],
  9707. e.call(r, t, o, i))
  9708. return o;
  9709. return -1
  9710. }
  9711. ),
  9712. Array.prototype.find || Object.defineProperty(Array.prototype, "find", {
  9713. value: function(e) {
  9714. if (null == this)
  9715. throw new TypeError('"this" is null or not defined');
  9716. var t = Object(this)
  9717. , i = t.length >>> 0;
  9718. if ("function" != typeof e)
  9719. throw new TypeError("predicate must be a function");
  9720. for (var n = arguments[1], r = 0; r < i; ) {
  9721. var o = t[r];
  9722. if (e.call(n, o, r, t))
  9723. return o;
  9724. r++
  9725. }
  9726. }
  9727. })
  9728. }
  9729. , {}],
  9730. 93: [function(e, t, i) {
  9731. "use strict";
  9732. var n = n || {};
  9733. t.exports = n,
  9734. n.gui = n.gui || {},
  9735. n.utils = n.utils || {},
  9736. n.controllers = n.controllers || {},
  9737. n.dom = n.dom || {},
  9738. n.color = n.color || {},
  9739. n.utils.css = function() {
  9740. return {
  9741. load: function(e, t) {
  9742. t = t || document;
  9743. var i = t.createElement("link");
  9744. i.type = "text/css",
  9745. i.rel = "stylesheet",
  9746. i.href = e,
  9747. t.getElementsByTagName("head")[0].appendChild(i)
  9748. },
  9749. inject: function(e, t) {
  9750. t = t || document;
  9751. var i = document.createElement("style");
  9752. i.type = "text/css",
  9753. i.innerHTML = e,
  9754. t.getElementsByTagName("head")[0].appendChild(i)
  9755. }
  9756. }
  9757. }(),
  9758. n.utils.common = function() {
  9759. var e = Array.prototype.forEach
  9760. , t = Array.prototype.slice;
  9761. return {
  9762. BREAK: {},
  9763. extend: function(e) {
  9764. return this.each(t.call(arguments, 1), function(t) {
  9765. for (var i in t)
  9766. this.isUndefined(t[i]) || (e[i] = t[i])
  9767. }, this),
  9768. e
  9769. },
  9770. defaults: function(e) {
  9771. return this.each(t.call(arguments, 1), function(t) {
  9772. for (var i in t)
  9773. this.isUndefined(e[i]) && (e[i] = t[i])
  9774. }, this),
  9775. e
  9776. },
  9777. compose: function() {
  9778. var e = t.call(arguments);
  9779. return function() {
  9780. for (var i = t.call(arguments), n = e.length - 1; n >= 0; n--)
  9781. i = [e[n].apply(this, i)];
  9782. return i[0]
  9783. }
  9784. },
  9785. each: function(t, i, n) {
  9786. if (t)
  9787. if (e && t.forEach && t.forEach === e)
  9788. t.forEach(i, n);
  9789. else if (t.length === t.length + 0) {
  9790. for (var r = 0, o = t.length; r < o; r++)
  9791. if (r in t && i.call(n, t[r], r) === this.BREAK)
  9792. return
  9793. } else
  9794. for (var r in t)
  9795. if (i.call(n, t[r], r) === this.BREAK)
  9796. return
  9797. },
  9798. defer: function(e) {
  9799. setTimeout(e, 0)
  9800. },
  9801. toArray: function(e) {
  9802. return e.toArray ? e.toArray() : t.call(e)
  9803. },
  9804. isUndefined: function(e) {
  9805. return void 0 === e
  9806. },
  9807. isNull: function(e) {
  9808. return null === e
  9809. },
  9810. isNaN: function(e) {
  9811. return e !== e
  9812. },
  9813. isArray: Array.isArray || function(e) {
  9814. return e.constructor === Array
  9815. }
  9816. ,
  9817. isObject: function(e) {
  9818. return e === Object(e)
  9819. },
  9820. isNumber: function(e) {
  9821. return e === e + 0
  9822. },
  9823. isString: function(e) {
  9824. return e === e + ""
  9825. },
  9826. isBoolean: function(e) {
  9827. return e === !1 || e === !0
  9828. },
  9829. isFunction: function(e) {
  9830. return "[object Function]" === Object.prototype.toString.call(e)
  9831. }
  9832. }
  9833. }(),
  9834. n.controllers.Controller = function(e) {
  9835. var t = function(e, t) {
  9836. this.initialValue = e[t],
  9837. this.domElement = document.createElement("div"),
  9838. this.object = e,
  9839. this.property = t,
  9840. this.__onChange = void 0,
  9841. this.__onFinishChange = void 0
  9842. };
  9843. return e.extend(t.prototype, {
  9844. onChange: function(e) {
  9845. return this.__onChange = e,
  9846. this
  9847. },
  9848. onFinishChange: function(e) {
  9849. return this.__onFinishChange = e,
  9850. this
  9851. },
  9852. setValue: function(e) {
  9853. return this.object[this.property] = e,
  9854. this.__onChange && this.__onChange.call(this, e),
  9855. this.updateDisplay(),
  9856. this
  9857. },
  9858. getValue: function() {
  9859. return this.object[this.property]
  9860. },
  9861. updateDisplay: function() {
  9862. return this
  9863. },
  9864. isModified: function() {
  9865. return this.initialValue !== this.getValue()
  9866. }
  9867. }),
  9868. t
  9869. }(n.utils.common),
  9870. n.dom.dom = function(e) {
  9871. function t(t) {
  9872. if ("0" === t || e.isUndefined(t))
  9873. return 0;
  9874. var i = t.match(r);
  9875. return e.isNull(i) ? 0 : parseFloat(i[1])
  9876. }
  9877. var i = {
  9878. HTMLEvents: ["change"],
  9879. MouseEvents: ["click", "mousemove", "mousedown", "mouseup", "mouseover"],
  9880. KeyboardEvents: ["keydown"]
  9881. }
  9882. , n = {};
  9883. e.each(i, function(t, i) {
  9884. e.each(t, function(e) {
  9885. n[e] = i
  9886. })
  9887. });
  9888. var r = /(\d+(\.\d+)?)px/
  9889. , o = {
  9890. makeSelectable: function(e, t) {
  9891. void 0 !== e && void 0 !== e.style && (e.onselectstart = t ? function() {
  9892. return !1
  9893. }
  9894. : function() {}
  9895. ,
  9896. e.style.MozUserSelect = t ? "auto" : "none",
  9897. e.style.KhtmlUserSelect = t ? "auto" : "none",
  9898. e.unselectable = t ? "on" : "off")
  9899. },
  9900. makeFullscreen: function(t, i, n) {
  9901. e.isUndefined(i) && (i = !0),
  9902. e.isUndefined(n) && (n = !0),
  9903. t.style.position = "absolute",
  9904. i && (t.style.left = 0,
  9905. t.style.right = 0),
  9906. n && (t.style.top = 0,
  9907. t.style.bottom = 0)
  9908. },
  9909. fakeEvent: function(t, i, r, o) {
  9910. r = r || {};
  9911. var a = n[i];
  9912. if (!a)
  9913. throw new Error("Event type " + i + " not supported.");
  9914. var s = document.createEvent(a);
  9915. switch (a) {
  9916. case "MouseEvents":
  9917. var l = r.x || r.clientX || 0
  9918. , c = r.y || r.clientY || 0;
  9919. s.initMouseEvent(i, r.bubbles || !1, r.cancelable || !0, window, r.clickCount || 1, 0, 0, l, c, !1, !1, !1, !1, 0, null);
  9920. break;
  9921. case "KeyboardEvents":
  9922. var h = s.initKeyboardEvent || s.initKeyEvent;
  9923. e.defaults(r, {
  9924. cancelable: !0,
  9925. ctrlKey: !1,
  9926. altKey: !1,
  9927. shiftKey: !1,
  9928. metaKey: !1,
  9929. keyCode: void 0,
  9930. charCode: void 0
  9931. }),
  9932. h(i, r.bubbles || !1, r.cancelable, window, r.ctrlKey, r.altKey, r.shiftKey, r.metaKey, r.keyCode, r.charCode);
  9933. break;
  9934. default:
  9935. s.initEvent(i, r.bubbles || !1, r.cancelable || !0)
  9936. }
  9937. e.defaults(s, o),
  9938. t.dispatchEvent(s)
  9939. },
  9940. bind: function(e, t, i, n) {
  9941. return n = n || !1,
  9942. e.addEventListener ? e.addEventListener(t, i, n) : e.attachEvent && e.attachEvent("on" + t, i),
  9943. o
  9944. },
  9945. unbind: function(e, t, i, n) {
  9946. return n = n || !1,
  9947. e.removeEventListener ? e.removeEventListener(t, i, n) : e.detachEvent && e.detachEvent("on" + t, i),
  9948. o
  9949. },
  9950. addClass: function(e, t) {
  9951. if (void 0 === e.className)
  9952. e.className = t;
  9953. else if (e.className !== t) {
  9954. var i = e.className.split(/ +/);
  9955. i.indexOf(t) == -1 && (i.push(t),
  9956. e.className = i.join(" ").replace(/^\s+/, "").replace(/\s+$/, ""))
  9957. }
  9958. return o
  9959. },
  9960. removeClass: function(e, t) {
  9961. if (t)
  9962. if (void 0 === e.className)
  9963. ;
  9964. else if (e.className === t)
  9965. e.removeAttribute("class");
  9966. else {
  9967. var i = e.className.split(/ +/)
  9968. , n = i.indexOf(t);
  9969. n != -1 && (i.splice(n, 1),
  9970. e.className = i.join(" "))
  9971. }
  9972. else
  9973. e.className = void 0;
  9974. return o
  9975. },
  9976. hasClass: function(e, t) {
  9977. return new RegExp("(?:^|\\s+)" + t + "(?:\\s+|$)").test(e.className) || !1
  9978. },
  9979. getWidth: function(e) {
  9980. var i = getComputedStyle(e);
  9981. return t(i["border-left-width"]) + t(i["border-right-width"]) + t(i["padding-left"]) + t(i["padding-right"]) + t(i.width)
  9982. },
  9983. getHeight: function(e) {
  9984. var i = getComputedStyle(e);
  9985. return t(i["border-top-width"]) + t(i["border-bottom-width"]) + t(i["padding-top"]) + t(i["padding-bottom"]) + t(i.height)
  9986. },
  9987. getOffset: function(e) {
  9988. var t = {
  9989. left: 0,
  9990. top: 0
  9991. };
  9992. if (e.offsetParent)
  9993. do
  9994. t.left += e.offsetLeft,
  9995. t.top += e.offsetTop;
  9996. while (e = e.offsetParent);return t
  9997. },
  9998. isActive: function(e) {
  9999. return e === document.activeElement && (e.type || e.href)
  10000. }
  10001. };
  10002. return o
  10003. }(n.utils.common),
  10004. n.controllers.OptionController = function(e, t, i) {
  10005. var n = function(e, r, o) {
  10006. n.superclass.call(this, e, r);
  10007. var a = this;
  10008. if (this.__select = document.createElement("select"),
  10009. i.isArray(o)) {
  10010. var s = {};
  10011. i.each(o, function(e) {
  10012. s[e] = e
  10013. }),
  10014. o = s
  10015. }
  10016. i.each(o, function(e, t) {
  10017. var i = document.createElement("option");
  10018. i.innerHTML = t,
  10019. i.setAttribute("value", e),
  10020. a.__select.appendChild(i)
  10021. }),
  10022. this.updateDisplay(),
  10023. t.bind(this.__select, "change", function() {
  10024. var e = this.options[this.selectedIndex].value;
  10025. a.setValue(e)
  10026. }),
  10027. this.domElement.appendChild(this.__select)
  10028. };
  10029. return n.superclass = e,
  10030. i.extend(n.prototype, e.prototype, {
  10031. setValue: function(e) {
  10032. var t = n.superclass.prototype.setValue.call(this, e);
  10033. return this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  10034. t
  10035. },
  10036. updateDisplay: function() {
  10037. return this.__select.value = this.getValue(),
  10038. n.superclass.prototype.updateDisplay.call(this)
  10039. }
  10040. }),
  10041. n
  10042. }(n.controllers.Controller, n.dom.dom, n.utils.common),
  10043. n.controllers.NumberController = function(e, t) {
  10044. function i(e) {
  10045. return e = e.toString(),
  10046. e.indexOf(".") > -1 ? e.length - e.indexOf(".") - 1 : 0
  10047. }
  10048. var n = function(e, r, o) {
  10049. n.superclass.call(this, e, r),
  10050. o = o || {},
  10051. this.__min = o.min,
  10052. this.__max = o.max,
  10053. this.__step = o.step,
  10054. 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,
  10055. this.__precision = i(this.__impliedStep)
  10056. };
  10057. return n.superclass = e,
  10058. t.extend(n.prototype, e.prototype, {
  10059. setValue: function(e) {
  10060. return void 0 !== this.__min && e < this.__min ? e = this.__min : void 0 !== this.__max && e > this.__max && (e = this.__max),
  10061. void 0 !== this.__step && e % this.__step != 0 && (e = Math.round(e / this.__step) * this.__step),
  10062. n.superclass.prototype.setValue.call(this, e)
  10063. },
  10064. min: function(e) {
  10065. return this.__min = e,
  10066. this
  10067. },
  10068. max: function(e) {
  10069. return this.__max = e,
  10070. this
  10071. },
  10072. step: function(e) {
  10073. return this.__step = e,
  10074. this.__impliedStep = e,
  10075. this.__precision = i(e),
  10076. this
  10077. }
  10078. }),
  10079. n
  10080. }(n.controllers.Controller, n.utils.common),
  10081. n.controllers.NumberControllerBox = function(e, t, i) {
  10082. function n(e, t) {
  10083. var i = Math.pow(10, t);
  10084. return Math.round(e * i) / i
  10085. }
  10086. var r = function(e, n, o) {
  10087. function a() {
  10088. var e = parseFloat(d.__input.value);
  10089. i.isNaN(e) || d.setValue(e)
  10090. }
  10091. function s() {
  10092. a(),
  10093. d.__onFinishChange && d.__onFinishChange.call(d, d.getValue())
  10094. }
  10095. function l(e) {
  10096. t.bind(window, "mousemove", c),
  10097. t.bind(window, "mouseup", h),
  10098. u = e.clientY
  10099. }
  10100. function c(e) {
  10101. var t = u - e.clientY;
  10102. d.setValue(d.getValue() + t * d.__impliedStep),
  10103. u = e.clientY
  10104. }
  10105. function h() {
  10106. t.unbind(window, "mousemove", c),
  10107. t.unbind(window, "mouseup", h)
  10108. }
  10109. this.__truncationSuspended = !1,
  10110. r.superclass.call(this, e, n, o);
  10111. var u, d = this;
  10112. this.__input = document.createElement("input"),
  10113. this.__input.setAttribute("type", "text"),
  10114. t.bind(this.__input, "change", a),
  10115. t.bind(this.__input, "blur", s),
  10116. t.bind(this.__input, "mousedown", l),
  10117. t.bind(this.__input, "keydown", function(e) {
  10118. 13 === e.keyCode && (d.__truncationSuspended = !0,
  10119. this.blur(),
  10120. d.__truncationSuspended = !1)
  10121. }),
  10122. this.updateDisplay(),
  10123. this.domElement.appendChild(this.__input)
  10124. };
  10125. return r.superclass = e,
  10126. i.extend(r.prototype, e.prototype, {
  10127. updateDisplay: function() {
  10128. return this.__input.value = this.__truncationSuspended ? this.getValue() : n(this.getValue(), this.__precision),
  10129. r.superclass.prototype.updateDisplay.call(this)
  10130. }
  10131. }),
  10132. r
  10133. }(n.controllers.NumberController, n.dom.dom, n.utils.common),
  10134. n.controllers.NumberControllerSlider = function(e, t, i, n, r) {
  10135. function o(e, t, i, n, r) {
  10136. return n + (r - n) * ((e - t) / (i - t))
  10137. }
  10138. var a = function(e, i, n, r, s) {
  10139. function l(e) {
  10140. t.bind(window, "mousemove", c),
  10141. t.bind(window, "mouseup", h),
  10142. c(e)
  10143. }
  10144. function c(e) {
  10145. e.preventDefault();
  10146. var i = t.getOffset(u.__background)
  10147. , n = t.getWidth(u.__background);
  10148. return u.setValue(o(e.clientX, i.left, i.left + n, u.__min, u.__max)),
  10149. !1
  10150. }
  10151. function h() {
  10152. t.unbind(window, "mousemove", c),
  10153. t.unbind(window, "mouseup", h),
  10154. u.__onFinishChange && u.__onFinishChange.call(u, u.getValue())
  10155. }
  10156. a.superclass.call(this, e, i, {
  10157. min: n,
  10158. max: r,
  10159. step: s
  10160. });
  10161. var u = this;
  10162. this.__background = document.createElement("div"),
  10163. this.__foreground = document.createElement("div"),
  10164. t.bind(this.__background, "mousedown", l),
  10165. t.addClass(this.__background, "slider"),
  10166. t.addClass(this.__foreground, "slider-fg"),
  10167. this.updateDisplay(),
  10168. this.__background.appendChild(this.__foreground),
  10169. this.domElement.appendChild(this.__background)
  10170. };
  10171. return a.superclass = e,
  10172. a.useDefaultStyles = function() {
  10173. i.inject(r)
  10174. }
  10175. ,
  10176. n.extend(a.prototype, e.prototype, {
  10177. updateDisplay: function() {
  10178. var e = (this.getValue() - this.__min) / (this.__max - this.__min);
  10179. return this.__foreground.style.width = 100 * e + "%",
  10180. a.superclass.prototype.updateDisplay.call(this)
  10181. }
  10182. }),
  10183. a
  10184. }(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}"),
  10185. n.controllers.FunctionController = function(e, t, i) {
  10186. var n = function(e, i, r) {
  10187. n.superclass.call(this, e, i);
  10188. var o = this;
  10189. this.__button = document.createElement("div"),
  10190. this.__button.innerHTML = void 0 === r ? "Fire" : r,
  10191. t.bind(this.__button, "click", function(e) {
  10192. return e.preventDefault(),
  10193. o.fire(),
  10194. !1
  10195. }),
  10196. t.addClass(this.__button, "button"),
  10197. this.domElement.appendChild(this.__button)
  10198. };
  10199. return n.superclass = e,
  10200. i.extend(n.prototype, e.prototype, {
  10201. fire: function() {
  10202. this.__onChange && this.__onChange.call(this),
  10203. this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  10204. this.getValue().call(this.object)
  10205. }
  10206. }),
  10207. n
  10208. }(n.controllers.Controller, n.dom.dom, n.utils.common),
  10209. n.controllers.BooleanController = function(e, t, i) {
  10210. var n = function(e, i) {
  10211. function r() {
  10212. o.setValue(!o.__prev)
  10213. }
  10214. n.superclass.call(this, e, i);
  10215. var o = this;
  10216. this.__prev = this.getValue(),
  10217. this.__checkbox = document.createElement("input"),
  10218. this.__checkbox.setAttribute("type", "checkbox"),
  10219. t.bind(this.__checkbox, "change", r, !1),
  10220. this.domElement.appendChild(this.__checkbox),
  10221. this.updateDisplay()
  10222. };
  10223. return n.superclass = e,
  10224. i.extend(n.prototype, e.prototype, {
  10225. setValue: function(e) {
  10226. var t = n.superclass.prototype.setValue.call(this, e);
  10227. return this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  10228. this.__prev = this.getValue(),
  10229. t
  10230. },
  10231. updateDisplay: function() {
  10232. return this.getValue() === !0 ? (this.__checkbox.setAttribute("checked", "checked"),
  10233. this.__checkbox.checked = !0) : this.__checkbox.checked = !1,
  10234. n.superclass.prototype.updateDisplay.call(this)
  10235. }
  10236. }),
  10237. n
  10238. }(n.controllers.Controller, n.dom.dom, n.utils.common),
  10239. n.color.toString = function(e) {
  10240. return function(t) {
  10241. if (1 == t.a || e.isUndefined(t.a)) {
  10242. for (var i = t.hex.toString(16); i.length < 6; )
  10243. i = "0" + i;
  10244. return "#" + i
  10245. }
  10246. return "rgba(" + Math.round(t.r) + "," + Math.round(t.g) + "," + Math.round(t.b) + "," + t.a + ")"
  10247. }
  10248. }(n.utils.common),
  10249. n.color.interpret = function(e, t) {
  10250. var i, n, r = function() {
  10251. n = !1;
  10252. var e = arguments.length > 1 ? t.toArray(arguments) : arguments[0];
  10253. return t.each(o, function(r) {
  10254. if (r.litmus(e))
  10255. return t.each(r.conversions, function(r, o) {
  10256. if (i = r.read(e),
  10257. n === !1 && i !== !1)
  10258. return n = i,
  10259. i.conversionName = o,
  10260. i.conversion = r,
  10261. t.BREAK
  10262. }),
  10263. t.BREAK
  10264. }),
  10265. n
  10266. }, o = [{
  10267. litmus: t.isString,
  10268. conversions: {
  10269. THREE_CHAR_HEX: {
  10270. read: function(e) {
  10271. var t = e.match(/^#([A-F0-9])([A-F0-9])([A-F0-9])$/i);
  10272. return null !== t && {
  10273. space: "HEX",
  10274. hex: parseInt("0x" + t[1].toString() + t[1].toString() + t[2].toString() + t[2].toString() + t[3].toString() + t[3].toString())
  10275. }
  10276. },
  10277. write: e
  10278. },
  10279. SIX_CHAR_HEX: {
  10280. read: function(e) {
  10281. var t = e.match(/^#([A-F0-9]{6})$/i);
  10282. return null !== t && {
  10283. space: "HEX",
  10284. hex: parseInt("0x" + t[1].toString())
  10285. }
  10286. },
  10287. write: e
  10288. },
  10289. CSS_RGB: {
  10290. read: function(e) {
  10291. var t = e.match(/^rgb\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\)/);
  10292. return null !== t && {
  10293. space: "RGB",
  10294. r: parseFloat(t[1]),
  10295. g: parseFloat(t[2]),
  10296. b: parseFloat(t[3])
  10297. }
  10298. },
  10299. write: e
  10300. },
  10301. CSS_RGBA: {
  10302. read: function(e) {
  10303. var t = e.match(/^rgba\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\,\s*(.+)\s*\)/);
  10304. return null !== t && {
  10305. space: "RGB",
  10306. r: parseFloat(t[1]),
  10307. g: parseFloat(t[2]),
  10308. b: parseFloat(t[3]),
  10309. a: parseFloat(t[4])
  10310. }
  10311. },
  10312. write: e
  10313. }
  10314. }
  10315. }, {
  10316. litmus: t.isNumber,
  10317. conversions: {
  10318. HEX: {
  10319. read: function(e) {
  10320. return {
  10321. space: "HEX",
  10322. hex: e,
  10323. conversionName: "HEX"
  10324. }
  10325. },
  10326. write: function(e) {
  10327. return e.hex
  10328. }
  10329. }
  10330. }
  10331. }, {
  10332. litmus: t.isArray,
  10333. conversions: {
  10334. RGB_ARRAY: {
  10335. read: function(e) {
  10336. return 3 == e.length && {
  10337. space: "RGB",
  10338. r: e[0],
  10339. g: e[1],
  10340. b: e[2]
  10341. }
  10342. },
  10343. write: function(e) {
  10344. return [e.r, e.g, e.b]
  10345. }
  10346. },
  10347. RGBA_ARRAY: {
  10348. read: function(e) {
  10349. return 4 == e.length && {
  10350. space: "RGB",
  10351. r: e[0],
  10352. g: e[1],
  10353. b: e[2],
  10354. a: e[3]
  10355. }
  10356. },
  10357. write: function(e) {
  10358. return [e.r, e.g, e.b, e.a]
  10359. }
  10360. }
  10361. }
  10362. }, {
  10363. litmus: t.isObject,
  10364. conversions: {
  10365. RGBA_OBJ: {
  10366. read: function(e) {
  10367. return !!(t.isNumber(e.r) && t.isNumber(e.g) && t.isNumber(e.b) && t.isNumber(e.a)) && {
  10368. space: "RGB",
  10369. r: e.r,
  10370. g: e.g,
  10371. b: e.b,
  10372. a: e.a
  10373. }
  10374. },
  10375. write: function(e) {
  10376. return {
  10377. r: e.r,
  10378. g: e.g,
  10379. b: e.b,
  10380. a: e.a
  10381. }
  10382. }
  10383. },
  10384. RGB_OBJ: {
  10385. read: function(e) {
  10386. return !!(t.isNumber(e.r) && t.isNumber(e.g) && t.isNumber(e.b)) && {
  10387. space: "RGB",
  10388. r: e.r,
  10389. g: e.g,
  10390. b: e.b
  10391. }
  10392. },
  10393. write: function(e) {
  10394. return {
  10395. r: e.r,
  10396. g: e.g,
  10397. b: e.b
  10398. }
  10399. }
  10400. },
  10401. HSVA_OBJ: {
  10402. read: function(e) {
  10403. return !!(t.isNumber(e.h) && t.isNumber(e.s) && t.isNumber(e.v) && t.isNumber(e.a)) && {
  10404. space: "HSV",
  10405. h: e.h,
  10406. s: e.s,
  10407. v: e.v,
  10408. a: e.a
  10409. }
  10410. },
  10411. write: function(e) {
  10412. return {
  10413. h: e.h,
  10414. s: e.s,
  10415. v: e.v,
  10416. a: e.a
  10417. }
  10418. }
  10419. },
  10420. HSV_OBJ: {
  10421. read: function(e) {
  10422. return !!(t.isNumber(e.h) && t.isNumber(e.s) && t.isNumber(e.v)) && {
  10423. space: "HSV",
  10424. h: e.h,
  10425. s: e.s,
  10426. v: e.v
  10427. }
  10428. },
  10429. write: function(e) {
  10430. return {
  10431. h: e.h,
  10432. s: e.s,
  10433. v: e.v
  10434. }
  10435. }
  10436. }
  10437. }
  10438. }];
  10439. return r
  10440. }(n.color.toString, n.utils.common),
  10441. n.GUI = n.gui.GUI = function(e, t, i, n, r, o, a, s, l, c, h, u, d, p, f) {
  10442. function g(e, t, i, o) {
  10443. if (void 0 === t[i])
  10444. throw new Error("Object " + t + ' has no property "' + i + '"');
  10445. var a;
  10446. if (o.color)
  10447. a = new h(t,i);
  10448. else {
  10449. var s = [t, i].concat(o.factoryArgs);
  10450. a = n.apply(e, s)
  10451. }
  10452. o.before instanceof r && (o.before = o.before.__li),
  10453. A(e, a),
  10454. p.addClass(a.domElement, "c");
  10455. var l = document.createElement("span");
  10456. p.addClass(l, "property-name"),
  10457. l.innerHTML = a.property;
  10458. var c = document.createElement("div");
  10459. c.appendChild(l),
  10460. c.appendChild(a.domElement);
  10461. var u = m(e, c, o.before);
  10462. return p.addClass(u, V.CLASS_CONTROLLER_ROW),
  10463. p.addClass(u, typeof a.getValue()),
  10464. v(e, u, a),
  10465. e.__controllers.push(a),
  10466. a
  10467. }
  10468. function m(e, t, i) {
  10469. var n = document.createElement("li");
  10470. return t && n.appendChild(t),
  10471. i ? e.__ul.insertBefore(n, params.before) : e.__ul.appendChild(n),
  10472. e.onResize(),
  10473. n
  10474. }
  10475. function v(e, t, i) {
  10476. if (i.__li = t,
  10477. i.__gui = e,
  10478. f.extend(i, {
  10479. options: function(t) {
  10480. return arguments.length > 1 ? (i.remove(),
  10481. g(e, i.object, i.property, {
  10482. before: i.__li.nextElementSibling,
  10483. factoryArgs: [f.toArray(arguments)]
  10484. })) : f.isArray(t) || f.isObject(t) ? (i.remove(),
  10485. g(e, i.object, i.property, {
  10486. before: i.__li.nextElementSibling,
  10487. factoryArgs: [t]
  10488. })) : void 0
  10489. },
  10490. name: function(e) {
  10491. return i.__li.firstElementChild.firstElementChild.innerHTML = e,
  10492. i
  10493. },
  10494. listen: function() {
  10495. return i.__gui.listen(i),
  10496. i
  10497. },
  10498. remove: function() {
  10499. return i.__gui.remove(i),
  10500. i
  10501. }
  10502. }),
  10503. i instanceof l) {
  10504. var n = new s(i.object,i.property,{
  10505. min: i.__min,
  10506. max: i.__max,
  10507. step: i.__step
  10508. });
  10509. f.each(["updateDisplay", "onChange", "onFinishChange"], function(e) {
  10510. var t = i[e]
  10511. , r = n[e];
  10512. i[e] = n[e] = function() {
  10513. var e = Array.prototype.slice.call(arguments);
  10514. return t.apply(i, e),
  10515. r.apply(n, e)
  10516. }
  10517. }),
  10518. p.addClass(t, "has-slider"),
  10519. i.domElement.insertBefore(n.domElement, i.domElement.firstElementChild)
  10520. } else if (i instanceof s) {
  10521. var r = function(t) {
  10522. return f.isNumber(i.__min) && f.isNumber(i.__max) ? (i.remove(),
  10523. g(e, i.object, i.property, {
  10524. before: i.__li.nextElementSibling,
  10525. factoryArgs: [i.__min, i.__max, i.__step]
  10526. })) : t
  10527. };
  10528. i.min = f.compose(r, i.min),
  10529. i.max = f.compose(r, i.max)
  10530. } else
  10531. i instanceof o ? (p.bind(t, "click", function() {
  10532. p.fakeEvent(i.__checkbox, "click")
  10533. }),
  10534. p.bind(i.__checkbox, "click", function(e) {
  10535. e.stopPropagation()
  10536. })) : i instanceof a ? (p.bind(t, "click", function() {
  10537. p.fakeEvent(i.__button, "click")
  10538. }),
  10539. p.bind(t, "mouseover", function() {
  10540. p.addClass(i.__button, "hover")
  10541. }),
  10542. p.bind(t, "mouseout", function() {
  10543. p.removeClass(i.__button, "hover")
  10544. })) : i instanceof h && (p.addClass(t, "color"),
  10545. i.updateDisplay = f.compose(function(e) {
  10546. return t.style.borderLeftColor = i.__color.toString(),
  10547. e
  10548. }, i.updateDisplay),
  10549. i.updateDisplay());
  10550. i.setValue = f.compose(function(t) {
  10551. return e.getRoot().__preset_select && i.isModified() && T(e.getRoot(), !0),
  10552. t
  10553. }, i.setValue)
  10554. }
  10555. function A(e, t) {
  10556. var i = e.getRoot()
  10557. , n = i.__rememberedObjects.indexOf(t.object);
  10558. if (n != -1) {
  10559. var r = i.__rememberedObjectIndecesToControllers[n];
  10560. if (void 0 === r && (r = {},
  10561. i.__rememberedObjectIndecesToControllers[n] = r),
  10562. r[t.property] = t,
  10563. i.load && i.load.remembered) {
  10564. var o, a = i.load.remembered;
  10565. if (a[e.preset])
  10566. o = a[e.preset];
  10567. else {
  10568. if (!a[L])
  10569. return;
  10570. o = a[L]
  10571. }
  10572. if (o[n] && void 0 !== o[n][t.property]) {
  10573. var s = o[n][t.property];
  10574. t.initialValue = s,
  10575. t.setValue(s)
  10576. }
  10577. }
  10578. }
  10579. }
  10580. function y(e, t) {
  10581. return document.location.href + "." + t
  10582. }
  10583. function C(e) {
  10584. var t = e.__save_row = document.createElement("li");
  10585. p.addClass(e.domElement, "has-save"),
  10586. e.__ul.insertBefore(t, e.__ul.firstChild),
  10587. p.addClass(t, "save-row");
  10588. var i = document.createElement("span");
  10589. i.innerHTML = "&nbsp;",
  10590. p.addClass(i, "button gears");
  10591. var n = document.createElement("span");
  10592. n.innerHTML = "Save",
  10593. p.addClass(n, "button"),
  10594. p.addClass(n, "save");
  10595. var r = document.createElement("span");
  10596. r.innerHTML = "New",
  10597. p.addClass(r, "button"),
  10598. p.addClass(r, "save-as");
  10599. var o = document.createElement("span");
  10600. o.innerHTML = "Revert",
  10601. p.addClass(o, "button"),
  10602. p.addClass(o, "revert");
  10603. var a = e.__preset_select = document.createElement("select");
  10604. if (e.load && e.load.remembered ? f.each(e.load.remembered, function(t, i) {
  10605. w(e, i, i == e.preset)
  10606. }) : w(e, L, !1),
  10607. p.bind(a, "change", function() {
  10608. for (var t = 0; t < e.__preset_select.length; t++)
  10609. e.__preset_select[t].innerHTML = e.__preset_select[t].value;
  10610. e.preset = this.value
  10611. }),
  10612. t.appendChild(a),
  10613. t.appendChild(i),
  10614. t.appendChild(n),
  10615. t.appendChild(r),
  10616. t.appendChild(o),
  10617. D) {
  10618. var s = document.getElementById("dg-save-locally")
  10619. , l = document.getElementById("dg-local-explain");
  10620. s.style.display = "block";
  10621. var c = document.getElementById("dg-local-storage");
  10622. "true" === localStorage.getItem(y(e, "isLocal")) && c.setAttribute("checked", "checked");
  10623. var h = function() {
  10624. l.style.display = e.useLocalStorage ? "block" : "none"
  10625. };
  10626. h(),
  10627. p.bind(c, "change", function() {
  10628. e.useLocalStorage = !e.useLocalStorage,
  10629. h()
  10630. })
  10631. }
  10632. var u = document.getElementById("dg-new-constructor");
  10633. p.bind(u, "keydown", function(e) {
  10634. !e.metaKey || 67 !== e.which && 67 != e.keyCode || S.hide()
  10635. }),
  10636. p.bind(i, "click", function() {
  10637. u.innerHTML = JSON.stringify(e.getSaveObject(), void 0, 2),
  10638. S.show(),
  10639. u.focus(),
  10640. u.select()
  10641. }),
  10642. p.bind(n, "click", function() {
  10643. e.save()
  10644. }),
  10645. p.bind(r, "click", function() {
  10646. var t = prompt("Enter a new preset name.");
  10647. t && e.saveAs(t)
  10648. }),
  10649. p.bind(o, "click", function() {
  10650. e.revert()
  10651. })
  10652. }
  10653. function I(e) {
  10654. function t(t) {
  10655. return t.preventDefault(),
  10656. r = t.clientX,
  10657. p.addClass(e.__closeButton, V.CLASS_DRAG),
  10658. p.bind(window, "mousemove", i),
  10659. p.bind(window, "mouseup", n),
  10660. !1
  10661. }
  10662. function i(t) {
  10663. return t.preventDefault(),
  10664. e.width += r - t.clientX,
  10665. e.onResize(),
  10666. r = t.clientX,
  10667. !1
  10668. }
  10669. function n() {
  10670. p.removeClass(e.__closeButton, V.CLASS_DRAG),
  10671. p.unbind(window, "mousemove", i),
  10672. p.unbind(window, "mouseup", n)
  10673. }
  10674. e.__resize_handle = document.createElement("div"),
  10675. f.extend(e.__resize_handle.style, {
  10676. width: "6px",
  10677. marginLeft: "-3px",
  10678. height: "200px",
  10679. cursor: "ew-resize",
  10680. position: "absolute"
  10681. });
  10682. var r;
  10683. p.bind(e.__resize_handle, "mousedown", t),
  10684. p.bind(e.__closeButton, "mousedown", t),
  10685. e.domElement.insertBefore(e.__resize_handle, e.domElement.firstElementChild)
  10686. }
  10687. function E(e, t) {
  10688. e.domElement.style.width = t + "px",
  10689. e.__save_row && e.autoPlace && (e.__save_row.style.width = t + "px"),
  10690. e.__closeButton && (e.__closeButton.style.width = t + "px")
  10691. }
  10692. function b(e, t) {
  10693. var i = {};
  10694. return f.each(e.__rememberedObjects, function(n, r) {
  10695. var o = {}
  10696. , a = e.__rememberedObjectIndecesToControllers[r];
  10697. f.each(a, function(e, i) {
  10698. o[i] = t ? e.initialValue : e.getValue()
  10699. }),
  10700. i[r] = o
  10701. }),
  10702. i
  10703. }
  10704. function w(e, t, i) {
  10705. var n = document.createElement("option");
  10706. n.innerHTML = t,
  10707. n.value = t,
  10708. e.__preset_select.appendChild(n),
  10709. i && (e.__preset_select.selectedIndex = e.__preset_select.length - 1)
  10710. }
  10711. function _(e) {
  10712. for (var t = 0; t < e.__preset_select.length; t++)
  10713. e.__preset_select[t].value == e.preset && (e.__preset_select.selectedIndex = t)
  10714. }
  10715. function T(e, t) {
  10716. var i = e.__preset_select[e.__preset_select.selectedIndex];
  10717. t ? i.innerHTML = i.value + "*" : i.innerHTML = i.value
  10718. }
  10719. function x(e) {
  10720. 0 != e.length && u(function() {
  10721. x(e)
  10722. }),
  10723. f.each(e, function(e) {
  10724. e.updateDisplay()
  10725. })
  10726. }
  10727. e.inject(i);
  10728. var S, M, R = "dg", P = 72, O = 20, L = "Default", D = function() {
  10729. try {
  10730. return "localStorage"in window && null !== window.localStorage
  10731. } catch (e) {
  10732. return !1
  10733. }
  10734. }(), N = !0, B = !1, F = [], V = function(e) {
  10735. function t() {
  10736. var e = i.getRoot();
  10737. e.width += 1,
  10738. f.defer(function() {
  10739. e.width -= 1
  10740. })
  10741. }
  10742. var i = this;
  10743. this.domElement = document.createElement("div"),
  10744. this.__ul = document.createElement("ul"),
  10745. this.domElement.appendChild(this.__ul),
  10746. p.addClass(this.domElement, R),
  10747. this.__folders = {},
  10748. this.__controllers = [],
  10749. this.__rememberedObjects = [],
  10750. this.__rememberedObjectIndecesToControllers = [],
  10751. this.__listening = [],
  10752. e = e || {},
  10753. e = f.defaults(e, {
  10754. autoPlace: !0,
  10755. width: V.DEFAULT_WIDTH
  10756. }),
  10757. e = f.defaults(e, {
  10758. resizable: e.autoPlace,
  10759. hideable: e.autoPlace
  10760. }),
  10761. f.isUndefined(e.load) ? e.load = {
  10762. preset: L
  10763. } : e.preset && (e.load.preset = e.preset),
  10764. f.isUndefined(e.parent) && e.hideable && F.push(this),
  10765. e.resizable = f.isUndefined(e.parent) && e.resizable,
  10766. e.autoPlace && f.isUndefined(e.scrollable) && (e.scrollable = !0);
  10767. var n, r = D && "true" === localStorage.getItem(y(this, "isLocal"));
  10768. if (Object.defineProperties(this, {
  10769. parent: {
  10770. get: function() {
  10771. return e.parent
  10772. }
  10773. },
  10774. scrollable: {
  10775. get: function() {
  10776. return e.scrollable
  10777. }
  10778. },
  10779. autoPlace: {
  10780. get: function() {
  10781. return e.autoPlace
  10782. }
  10783. },
  10784. preset: {
  10785. get: function() {
  10786. return i.parent ? i.getRoot().preset : e.load.preset
  10787. },
  10788. set: function(t) {
  10789. i.parent ? i.getRoot().preset = t : e.load.preset = t,
  10790. _(this),
  10791. i.revert()
  10792. }
  10793. },
  10794. width: {
  10795. get: function() {
  10796. return e.width
  10797. },
  10798. set: function(t) {
  10799. e.width = t,
  10800. E(i, t)
  10801. }
  10802. },
  10803. name: {
  10804. get: function() {
  10805. return e.name
  10806. },
  10807. set: function(t) {
  10808. e.name = t,
  10809. a && (a.innerHTML = e.name)
  10810. }
  10811. },
  10812. closed: {
  10813. get: function() {
  10814. return e.closed
  10815. },
  10816. set: function(t) {
  10817. e.closed = t,
  10818. e.closed ? p.addClass(i.__ul, V.CLASS_CLOSED) : p.removeClass(i.__ul, V.CLASS_CLOSED),
  10819. this.onResize(),
  10820. i.__closeButton && (i.__closeButton.innerHTML = t ? V.TEXT_OPEN : V.TEXT_CLOSED)
  10821. }
  10822. },
  10823. load: {
  10824. get: function() {
  10825. return e.load
  10826. }
  10827. },
  10828. useLocalStorage: {
  10829. get: function() {
  10830. return r
  10831. },
  10832. set: function(e) {
  10833. D && (r = e,
  10834. e ? p.bind(window, "unload", n) : p.unbind(window, "unload", n),
  10835. localStorage.setItem(y(i, "isLocal"), e))
  10836. }
  10837. }
  10838. }),
  10839. f.isUndefined(e.parent)) {
  10840. if (e.closed = !1,
  10841. p.addClass(this.domElement, V.CLASS_MAIN),
  10842. p.makeSelectable(this.domElement, !1),
  10843. D && r) {
  10844. i.useLocalStorage = !0;
  10845. var o = localStorage.getItem(y(this, "gui"));
  10846. o && (e.load = JSON.parse(o))
  10847. }
  10848. this.__closeButton = document.createElement("div"),
  10849. this.__closeButton.innerHTML = V.TEXT_CLOSED,
  10850. p.addClass(this.__closeButton, V.CLASS_CLOSE_BUTTON),
  10851. this.domElement.appendChild(this.__closeButton),
  10852. p.bind(this.__closeButton, "click", function() {
  10853. i.closed = !i.closed
  10854. })
  10855. } else {
  10856. void 0 === e.closed && (e.closed = !0);
  10857. var a = document.createTextNode(e.name);
  10858. p.addClass(a, "controller-name");
  10859. var s = m(i, a)
  10860. , l = function(e) {
  10861. return e.preventDefault(),
  10862. i.closed = !i.closed,
  10863. !1
  10864. };
  10865. p.addClass(this.__ul, V.CLASS_CLOSED),
  10866. p.addClass(s, "title"),
  10867. p.bind(s, "click", l),
  10868. e.closed || (this.closed = !1)
  10869. }
  10870. e.autoPlace && (f.isUndefined(e.parent) && (N && (M = document.createElement("div"),
  10871. p.addClass(M, R),
  10872. p.addClass(M, V.CLASS_AUTO_PLACE_CONTAINER),
  10873. document.body.appendChild(M),
  10874. N = !1),
  10875. M.appendChild(this.domElement),
  10876. p.addClass(this.domElement, V.CLASS_AUTO_PLACE)),
  10877. this.parent || E(i, e.width)),
  10878. p.bind(window, "resize", function() {
  10879. i.onResize()
  10880. }),
  10881. p.bind(this.__ul, "webkitTransitionEnd", function() {
  10882. i.onResize()
  10883. }),
  10884. p.bind(this.__ul, "transitionend", function() {
  10885. i.onResize()
  10886. }),
  10887. p.bind(this.__ul, "oTransitionEnd", function() {
  10888. i.onResize()
  10889. }),
  10890. this.onResize(),
  10891. e.resizable && I(this),
  10892. n = function() {
  10893. D && "true" === localStorage.getItem(y(i, "isLocal")) && localStorage.setItem(y(i, "gui"), JSON.stringify(i.getSaveObject()))
  10894. }
  10895. ,
  10896. this.saveToLocalStorageIfPossible = n;
  10897. i.getRoot();
  10898. e.parent || t()
  10899. };
  10900. return V.toggleHide = function() {
  10901. B = !B,
  10902. f.each(F, function(e) {
  10903. e.domElement.style.zIndex = B ? -999 : 999,
  10904. e.domElement.style.opacity = B ? 0 : 1
  10905. })
  10906. }
  10907. ,
  10908. V.CLASS_AUTO_PLACE = "a",
  10909. V.CLASS_AUTO_PLACE_CONTAINER = "ac",
  10910. V.CLASS_MAIN = "main",
  10911. V.CLASS_CONTROLLER_ROW = "cr",
  10912. V.CLASS_TOO_TALL = "taller-than-window",
  10913. V.CLASS_CLOSED = "closed",
  10914. V.CLASS_CLOSE_BUTTON = "close-button",
  10915. V.CLASS_DRAG = "drag",
  10916. V.DEFAULT_WIDTH = 245,
  10917. V.TEXT_CLOSED = "Close Controls",
  10918. V.TEXT_OPEN = "Open Controls",
  10919. p.bind(window, "keydown", function(e) {
  10920. "text" === document.activeElement.type || e.which !== P && e.keyCode != P || V.toggleHide()
  10921. }, !1),
  10922. f.extend(V.prototype, {
  10923. add: function(e, t) {
  10924. return g(this, e, t, {
  10925. factoryArgs: Array.prototype.slice.call(arguments, 2)
  10926. })
  10927. },
  10928. addColor: function(e, t) {
  10929. return g(this, e, t, {
  10930. color: !0
  10931. })
  10932. },
  10933. remove: function(e) {
  10934. this.__ul.removeChild(e.__li),
  10935. this.__controllers.slice(this.__controllers.indexOf(e), 1);
  10936. var t = this;
  10937. f.defer(function() {
  10938. t.onResize()
  10939. })
  10940. },
  10941. destroy: function() {
  10942. this.autoPlace && M.removeChild(this.domElement)
  10943. },
  10944. addFolder: function(e) {
  10945. if (void 0 !== this.__folders[e])
  10946. throw new Error('You already have a folder in this GUI by the name "' + e + '"');
  10947. var t = {
  10948. name: e,
  10949. parent: this
  10950. };
  10951. t.autoPlace = this.autoPlace,
  10952. this.load && this.load.folders && this.load.folders[e] && (t.closed = this.load.folders[e].closed,
  10953. t.load = this.load.folders[e]);
  10954. var i = new V(t);
  10955. this.__folders[e] = i;
  10956. var n = m(this, i.domElement);
  10957. return p.addClass(n, "folder"),
  10958. i
  10959. },
  10960. open: function() {
  10961. this.closed = !1
  10962. },
  10963. close: function() {
  10964. this.closed = !0
  10965. },
  10966. onResize: function() {
  10967. var e = this.getRoot();
  10968. if (e.scrollable) {
  10969. var t = p.getOffset(e.__ul).top
  10970. , i = 0;
  10971. f.each(e.__ul.childNodes, function(t) {
  10972. e.autoPlace && t === e.__save_row || (i += p.getHeight(t))
  10973. }),
  10974. $("#player").height() - t - O < i ? (p.addClass(e.domElement, V.CLASS_TOO_TALL),
  10975. e.__ul.style.height = $("#player").height() - t - O + "px") : (p.removeClass(e.domElement, V.CLASS_TOO_TALL),
  10976. e.__ul.style.height = "auto")
  10977. }
  10978. e.__resize_handle && f.defer(function() {
  10979. e.__resize_handle.style.height = e.__ul.offsetHeight + "px"
  10980. }),
  10981. e.__closeButton && (e.__closeButton.style.width = e.width + "px")
  10982. },
  10983. remember: function() {
  10984. if (f.isUndefined(S) && (S = new d,
  10985. S.domElement.innerHTML = t),
  10986. this.parent)
  10987. throw new Error("You can only call remember on a top level GUI.");
  10988. var e = this;
  10989. f.each(Array.prototype.slice.call(arguments), function(t) {
  10990. 0 == e.__rememberedObjects.length && C(e),
  10991. e.__rememberedObjects.indexOf(t) == -1 && e.__rememberedObjects.push(t)
  10992. }),
  10993. this.autoPlace && E(this, this.width)
  10994. },
  10995. getRoot: function() {
  10996. for (var e = this; e.parent; )
  10997. e = e.parent;
  10998. return e
  10999. },
  11000. getSaveObject: function() {
  11001. var e = this.load;
  11002. return e.closed = this.closed,
  11003. this.__rememberedObjects.length > 0 && (e.preset = this.preset,
  11004. e.remembered || (e.remembered = {}),
  11005. e.remembered[this.preset] = b(this)),
  11006. e.folders = {},
  11007. f.each(this.__folders, function(t, i) {
  11008. e.folders[i] = t.getSaveObject()
  11009. }),
  11010. e
  11011. },
  11012. save: function() {
  11013. this.load.remembered || (this.load.remembered = {}),
  11014. this.load.remembered[this.preset] = b(this),
  11015. T(this, !1),
  11016. this.saveToLocalStorageIfPossible()
  11017. },
  11018. saveAs: function(e) {
  11019. this.load.remembered || (this.load.remembered = {},
  11020. this.load.remembered[L] = b(this, !0)),
  11021. this.load.remembered[e] = b(this),
  11022. this.preset = e,
  11023. w(this, e, !0),
  11024. this.saveToLocalStorageIfPossible()
  11025. },
  11026. revert: function(e) {
  11027. f.each(this.__controllers, function(t) {
  11028. this.getRoot().load.remembered ? A(e || this.getRoot(), t) : t.setValue(t.initialValue)
  11029. }, this),
  11030. f.each(this.__folders, function(e) {
  11031. e.revert(e)
  11032. }),
  11033. e || T(this.getRoot(), !1)
  11034. },
  11035. listen: function(e) {
  11036. var t = 0 == this.__listening.length;
  11037. this.__listening.push(e),
  11038. t && x(this.__listening)
  11039. }
  11040. }),
  11041. V
  11042. }(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) {
  11043. return function(s, l) {
  11044. var c = s[l];
  11045. 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,{
  11046. min: arguments[2],
  11047. max: arguments[3]
  11048. }) : a.isString(c) ? new n(s,l) : a.isFunction(c) ? new r(s,l,"") : a.isBoolean(c) ? new o(s,l) : void 0
  11049. }
  11050. }(n.controllers.OptionController, n.controllers.NumberControllerBox, n.controllers.NumberControllerSlider, n.controllers.StringController = function(e, t, i) {
  11051. var n = function(e, i) {
  11052. function r() {
  11053. a.setValue(a.__input.value)
  11054. }
  11055. function o() {
  11056. a.__onFinishChange && a.__onFinishChange.call(a, a.getValue())
  11057. }
  11058. n.superclass.call(this, e, i);
  11059. var a = this;
  11060. this.__input = document.createElement("input"),
  11061. this.__input.setAttribute("type", "text"),
  11062. t.bind(this.__input, "keyup", r),
  11063. t.bind(this.__input, "change", r),
  11064. t.bind(this.__input, "blur", o),
  11065. t.bind(this.__input, "keydown", function(e) {
  11066. 13 === e.keyCode && this.blur()
  11067. }),
  11068. this.updateDisplay(),
  11069. this.domElement.appendChild(this.__input)
  11070. };
  11071. return n.superclass = e,
  11072. i.extend(n.prototype, e.prototype, {
  11073. updateDisplay: function() {
  11074. return t.isActive(this.__input) || (this.__input.value = this.getValue()),
  11075. n.superclass.prototype.updateDisplay.call(this)
  11076. }
  11077. }),
  11078. n
  11079. }(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) {
  11080. function o(e, t, i, n) {
  11081. e.style.background = "",
  11082. r.each(l, function(r) {
  11083. e.style.cssText += "background: " + r + "linear-gradient(" + t + ", " + i + " 0%, " + n + " 100%); "
  11084. })
  11085. }
  11086. function a(e) {
  11087. e.style.background = "",
  11088. e.style.cssText += "background: -moz-linear-gradient(top, #ff0000 0%, #ff00ff 17%, #0000ff 34%, #00ffff 50%, #00ff00 67%, #ffff00 84%, #ff0000 100%);",
  11089. e.style.cssText += "background: -webkit-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",
  11090. e.style.cssText += "background: -o-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",
  11091. e.style.cssText += "background: -ms-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",
  11092. e.style.cssText += "background: linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);"
  11093. }
  11094. var s = function(e, l) {
  11095. function c(e) {
  11096. p(e),
  11097. t.bind(window, "mousemove", p),
  11098. t.bind(window, "mouseup", h)
  11099. }
  11100. function h() {
  11101. t.unbind(window, "mousemove", p),
  11102. t.unbind(window, "mouseup", h)
  11103. }
  11104. function u() {
  11105. var e = n(this.value);
  11106. e !== !1 ? (g.__color.__state = e,
  11107. g.setValue(g.__color.toOriginal())) : this.value = g.__color.toString()
  11108. }
  11109. function d() {
  11110. t.unbind(window, "mousemove", f),
  11111. t.unbind(window, "mouseup", d)
  11112. }
  11113. function p(e) {
  11114. e.preventDefault();
  11115. var i = t.getWidth(g.__saturation_field)
  11116. , n = t.getOffset(g.__saturation_field)
  11117. , r = (e.clientX - n.left + document.body.scrollLeft) / i
  11118. , o = 1 - (e.clientY - n.top + document.body.scrollTop) / i;
  11119. return o > 1 ? o = 1 : o < 0 && (o = 0),
  11120. r > 1 ? r = 1 : r < 0 && (r = 0),
  11121. g.__color.v = o,
  11122. g.__color.s = r,
  11123. g.setValue(g.__color.toOriginal()),
  11124. !1
  11125. }
  11126. function f(e) {
  11127. e.preventDefault();
  11128. var i = t.getHeight(g.__hue_field)
  11129. , n = t.getOffset(g.__hue_field)
  11130. , r = 1 - (e.clientY - n.top + document.body.scrollTop) / i;
  11131. return r > 1 ? r = 1 : r < 0 && (r = 0),
  11132. g.__color.h = 360 * r,
  11133. g.setValue(g.__color.toOriginal()),
  11134. !1
  11135. }
  11136. s.superclass.call(this, e, l),
  11137. this.__color = new i(this.getValue()),
  11138. this.__temp = new i(0);
  11139. var g = this;
  11140. this.domElement = document.createElement("div"),
  11141. t.makeSelectable(this.domElement, !1),
  11142. this.__selector = document.createElement("div"),
  11143. this.__selector.className = "selector",
  11144. this.__saturation_field = document.createElement("div"),
  11145. this.__saturation_field.className = "saturation-field",
  11146. this.__field_knob = document.createElement("div"),
  11147. this.__field_knob.className = "field-knob",
  11148. this.__field_knob_border = "2px solid ",
  11149. this.__hue_knob = document.createElement("div"),
  11150. this.__hue_knob.className = "hue-knob",
  11151. this.__hue_field = document.createElement("div"),
  11152. this.__hue_field.className = "hue-field",
  11153. this.__input = document.createElement("input"),
  11154. this.__input.type = "text",
  11155. this.__input_textShadow = "0 1px 1px ",
  11156. t.bind(this.__input, "keydown", function(e) {
  11157. 13 === e.keyCode && u.call(this)
  11158. }),
  11159. t.bind(this.__input, "blur", u),
  11160. t.bind(this.__selector, "mousedown", function(e) {
  11161. t.addClass(this, "drag").bind(window, "mouseup", function(e) {
  11162. t.removeClass(g.__selector, "drag")
  11163. })
  11164. });
  11165. var m = document.createElement("div");
  11166. r.extend(this.__selector.style, {
  11167. width: "122px",
  11168. height: "102px",
  11169. padding: "3px",
  11170. backgroundColor: "#222",
  11171. boxShadow: "0px 1px 3px rgba(0,0,0,0.3)"
  11172. }),
  11173. r.extend(this.__field_knob.style, {
  11174. position: "absolute",
  11175. width: "12px",
  11176. height: "12px",
  11177. border: this.__field_knob_border + (this.__color.v < .5 ? "#fff" : "#000"),
  11178. boxShadow: "0px 1px 3px rgba(0,0,0,0.5)",
  11179. borderRadius: "12px",
  11180. zIndex: 1
  11181. }),
  11182. r.extend(this.__hue_knob.style, {
  11183. position: "absolute",
  11184. width: "15px",
  11185. height: "2px",
  11186. borderRight: "4px solid #fff",
  11187. zIndex: 1
  11188. }),
  11189. r.extend(this.__saturation_field.style, {
  11190. width: "100px",
  11191. height: "100px",
  11192. border: "1px solid #555",
  11193. marginRight: "3px",
  11194. display: "inline-block",
  11195. cursor: "pointer"
  11196. }),
  11197. r.extend(m.style, {
  11198. width: "100%",
  11199. height: "100%",
  11200. background: "none"
  11201. }),
  11202. o(m, "top", "rgba(0,0,0,0)", "#000"),
  11203. r.extend(this.__hue_field.style, {
  11204. width: "15px",
  11205. height: "100px",
  11206. display: "inline-block",
  11207. border: "1px solid #555",
  11208. cursor: "ns-resize"
  11209. }),
  11210. a(this.__hue_field),
  11211. r.extend(this.__input.style, {
  11212. outline: "none",
  11213. textAlign: "center",
  11214. color: "#fff",
  11215. border: 0,
  11216. fontWeight: "bold",
  11217. textShadow: this.__input_textShadow + "rgba(0,0,0,0.7)"
  11218. }),
  11219. t.bind(this.__saturation_field, "mousedown", c),
  11220. t.bind(this.__field_knob, "mousedown", c),
  11221. t.bind(this.__hue_field, "mousedown", function(e) {
  11222. f(e),
  11223. t.bind(window, "mousemove", f),
  11224. t.bind(window, "mouseup", d)
  11225. }),
  11226. this.__saturation_field.appendChild(m),
  11227. this.__selector.appendChild(this.__field_knob),
  11228. this.__selector.appendChild(this.__saturation_field),
  11229. this.__selector.appendChild(this.__hue_field),
  11230. this.__hue_field.appendChild(this.__hue_knob),
  11231. this.domElement.appendChild(this.__input),
  11232. this.domElement.appendChild(this.__selector),
  11233. this.updateDisplay()
  11234. };
  11235. s.superclass = e,
  11236. r.extend(s.prototype, e.prototype, {
  11237. updateDisplay: function() {
  11238. var e = n(this.getValue());
  11239. if (e !== !1) {
  11240. var t = !1;
  11241. r.each(i.COMPONENTS, function(i) {
  11242. if (!r.isUndefined(e[i]) && !r.isUndefined(this.__color.__state[i]) && e[i] !== this.__color.__state[i])
  11243. return t = !0,
  11244. {}
  11245. }, this),
  11246. t && r.extend(this.__color.__state, e)
  11247. }
  11248. r.extend(this.__temp.__state, this.__color.__state),
  11249. this.__temp.a = 1;
  11250. var a = this.__color.v < .5 || this.__color.s > .5 ? 255 : 0
  11251. , s = 255 - a;
  11252. r.extend(this.__field_knob.style, {
  11253. marginLeft: 100 * this.__color.s - 7 + "px",
  11254. marginTop: 100 * (1 - this.__color.v) - 7 + "px",
  11255. backgroundColor: this.__temp.toString(),
  11256. border: this.__field_knob_border + "rgb(" + a + "," + a + "," + a + ")"
  11257. }),
  11258. this.__hue_knob.style.marginTop = 100 * (1 - this.__color.h / 360) + "px",
  11259. this.__temp.s = 1,
  11260. this.__temp.v = 1,
  11261. o(this.__saturation_field, "left", "#fff", this.__temp.toString()),
  11262. r.extend(this.__input.style, {
  11263. backgroundColor: this.__input.value = this.__color.toString(),
  11264. color: "rgb(" + a + "," + a + "," + a + ")",
  11265. textShadow: this.__input_textShadow + "rgba(" + s + "," + s + "," + s + ",.7)"
  11266. })
  11267. }
  11268. });
  11269. var l = ["-moz-", "-o-", "-webkit-", "-ms-", ""];
  11270. return s
  11271. }(n.controllers.Controller, n.dom.dom, n.color.Color = function(e, t, i, n) {
  11272. function r(e, t, i) {
  11273. Object.defineProperty(e, t, {
  11274. get: function() {
  11275. return "RGB" === this.__state.space ? this.__state[t] : (a(this, t, i),
  11276. this.__state[t])
  11277. },
  11278. set: function(e) {
  11279. "RGB" !== this.__state.space && (a(this, t, i),
  11280. this.__state.space = "RGB"),
  11281. this.__state[t] = e
  11282. }
  11283. })
  11284. }
  11285. function o(e, t) {
  11286. Object.defineProperty(e, t, {
  11287. get: function() {
  11288. return "HSV" === this.__state.space ? this.__state[t] : (s(this),
  11289. this.__state[t])
  11290. },
  11291. set: function(e) {
  11292. "HSV" !== this.__state.space && (s(this),
  11293. this.__state.space = "HSV"),
  11294. this.__state[t] = e
  11295. }
  11296. })
  11297. }
  11298. function a(e, i, r) {
  11299. if ("HEX" === e.__state.space)
  11300. e.__state[i] = t.component_from_hex(e.__state.hex, r);
  11301. else {
  11302. if ("HSV" !== e.__state.space)
  11303. throw "Corrupted color state";
  11304. n.extend(e.__state, t.hsv_to_rgb(e.__state.h, e.__state.s, e.__state.v))
  11305. }
  11306. }
  11307. function s(e) {
  11308. var i = t.rgb_to_hsv(e.r, e.g, e.b);
  11309. n.extend(e.__state, {
  11310. s: i.s,
  11311. v: i.v
  11312. }),
  11313. n.isNaN(i.h) ? n.isUndefined(e.__state.h) && (e.__state.h = 0) : e.__state.h = i.h
  11314. }
  11315. var l = function() {
  11316. if (this.__state = e.apply(this, arguments),
  11317. this.__state === !1)
  11318. throw "Failed to interpret color arguments";
  11319. this.__state.a = this.__state.a || 1
  11320. };
  11321. return l.COMPONENTS = ["r", "g", "b", "h", "s", "v", "hex", "a"],
  11322. n.extend(l.prototype, {
  11323. toString: function() {
  11324. return i(this)
  11325. },
  11326. toOriginal: function() {
  11327. return this.__state.conversion.write(this)
  11328. }
  11329. }),
  11330. r(l.prototype, "r", 2),
  11331. r(l.prototype, "g", 1),
  11332. r(l.prototype, "b", 0),
  11333. o(l.prototype, "h"),
  11334. o(l.prototype, "s"),
  11335. o(l.prototype, "v"),
  11336. Object.defineProperty(l.prototype, "a", {
  11337. get: function() {
  11338. return this.__state.a
  11339. },
  11340. set: function(e) {
  11341. this.__state.a = e
  11342. }
  11343. }),
  11344. Object.defineProperty(l.prototype, "hex", {
  11345. get: function() {
  11346. return "HEX" !== !this.__state.space && (this.__state.hex = t.rgb_to_hex(this.r, this.g, this.b)),
  11347. this.__state.hex
  11348. },
  11349. set: function(e) {
  11350. this.__state.space = "HEX",
  11351. this.__state.hex = e
  11352. }
  11353. }),
  11354. l
  11355. }(n.color.interpret, n.color.math = function() {
  11356. var e;
  11357. return {
  11358. hsv_to_rgb: function(e, t, i) {
  11359. var n = Math.floor(e / 60) % 6
  11360. , r = e / 60 - Math.floor(e / 60)
  11361. , o = i * (1 - t)
  11362. , a = i * (1 - r * t)
  11363. , s = i * (1 - (1 - r) * t)
  11364. , l = [[i, s, o], [a, i, o], [o, i, s], [o, a, i], [s, o, i], [i, o, a]][n];
  11365. return {
  11366. r: 255 * l[0],
  11367. g: 255 * l[1],
  11368. b: 255 * l[2]
  11369. }
  11370. },
  11371. rgb_to_hsv: function(e, t, i) {
  11372. var n, r, o = Math.min(e, t, i), a = Math.max(e, t, i), s = a - o;
  11373. return 0 == a ? {
  11374. h: NaN,
  11375. s: 0,
  11376. v: 0
  11377. } : (r = s / a,
  11378. n = e == a ? (t - i) / s : t == a ? 2 + (i - e) / s : 4 + (e - t) / s,
  11379. n /= 6,
  11380. n < 0 && (n += 1),
  11381. {
  11382. h: 360 * n,
  11383. s: r,
  11384. v: a / 255
  11385. })
  11386. },
  11387. rgb_to_hex: function(e, t, i) {
  11388. var n = this.hex_with_component(0, 2, e);
  11389. return n = this.hex_with_component(n, 1, t),
  11390. n = this.hex_with_component(n, 0, i)
  11391. },
  11392. component_from_hex: function(e, t) {
  11393. return e >> 8 * t & 255
  11394. },
  11395. hex_with_component: function(t, i, n) {
  11396. return n << (e = 8 * i) | t & ~(255 << e)
  11397. }
  11398. }
  11399. }(), n.color.toString, n.utils.common), n.color.interpret, n.utils.common), n.utils.requestAnimationFrame = function() {
  11400. return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function(e, t) {
  11401. window.setTimeout(e, 1e3 / 60)
  11402. }
  11403. }(), n.dom.CenteredDiv = function(e, t) {
  11404. var i = function() {
  11405. this.backgroundElement = document.createElement("div"),
  11406. t.extend(this.backgroundElement.style, {
  11407. backgroundColor: "rgba(0,0,0,0.8)",
  11408. top: 0,
  11409. left: 0,
  11410. display: "none",
  11411. zIndex: "1000",
  11412. opacity: 0,
  11413. WebkitTransition: "opacity 0.2s linear"
  11414. }),
  11415. e.makeFullscreen(this.backgroundElement),
  11416. this.backgroundElement.style.position = "fixed",
  11417. this.domElement = document.createElement("div"),
  11418. t.extend(this.domElement.style, {
  11419. position: "fixed",
  11420. display: "none",
  11421. zIndex: "1001",
  11422. opacity: 0,
  11423. WebkitTransition: "-webkit-transform 0.2s ease-out, opacity 0.2s linear"
  11424. }),
  11425. document.body.appendChild(this.backgroundElement),
  11426. document.body.appendChild(this.domElement);
  11427. var i = this;
  11428. e.bind(this.backgroundElement, "click", function() {
  11429. i.hide()
  11430. })
  11431. };
  11432. return i.prototype.show = function() {
  11433. var e = this;
  11434. this.backgroundElement.style.display = "block",
  11435. this.domElement.style.display = "block",
  11436. this.domElement.style.opacity = 0,
  11437. this.domElement.style.webkitTransform = "scale(1.1)",
  11438. this.layout(),
  11439. t.defer(function() {
  11440. e.backgroundElement.style.opacity = 1,
  11441. e.domElement.style.opacity = 1,
  11442. e.domElement.style.webkitTransform = "scale(1)"
  11443. })
  11444. }
  11445. ,
  11446. i.prototype.hide = function() {
  11447. var t = this
  11448. , i = function() {
  11449. t.domElement.style.display = "none",
  11450. t.backgroundElement.style.display = "none",
  11451. e.unbind(t.domElement, "webkitTransitionEnd", i),
  11452. e.unbind(t.domElement, "transitionend", i),
  11453. e.unbind(t.domElement, "oTransitionEnd", i)
  11454. };
  11455. e.bind(this.domElement, "webkitTransitionEnd", i),
  11456. e.bind(this.domElement, "transitionend", i),
  11457. e.bind(this.domElement, "oTransitionEnd", i),
  11458. this.backgroundElement.style.opacity = 0,
  11459. this.domElement.style.opacity = 0,
  11460. this.domElement.style.webkitTransform = "scale(1.1)"
  11461. }
  11462. ,
  11463. i.prototype.layout = function() {
  11464. this.domElement.style.left = $("#player").width() / 2 - e.getWidth(this.domElement) / 2 + "px",
  11465. this.domElement.style.top = $("#player").height() / 2 - e.getHeight(this.domElement) / 2 + "px"
  11466. }
  11467. ,
  11468. i
  11469. }(n.dom.dom, n.utils.common), n.dom.dom, n.utils.common)
  11470. }
  11471. , {}],
  11472. 94: [function(e, t, i) {
  11473. (function(e) {
  11474. "use strict";
  11475. function i(t) {
  11476. function i(e) {
  11477. 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++) {
  11478. var n = _((t[i] * e + 50) / 100);
  11479. n < 1 ? n = 1 : n > 255 && (n = 255),
  11480. T[G[i]] = n
  11481. }
  11482. 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++) {
  11483. var a = _((r[o] * e + 50) / 100);
  11484. a < 1 ? a = 1 : a > 255 && (a = 255),
  11485. x[G[o]] = a
  11486. }
  11487. for (var s = [1, 1.387039845, 1.306562965, 1.175875602, 1, .785694958, .5411961, .275899379], l = 0, c = 0; c < 8; c++)
  11488. for (var h = 0; h < 8; h++)
  11489. S[l] = 1 / (T[G[l]] * s[c] * s[h] * 8),
  11490. M[l] = 1 / (x[G[l]] * s[c] * s[h] * 8),
  11491. l++
  11492. }
  11493. function n(e, t) {
  11494. for (var i = 0, n = 0, r = new Array, o = 1; o <= 16; o++) {
  11495. for (var a = 1; a <= e[o]; a++)
  11496. r[t[n]] = [],
  11497. r[t[n]][0] = i,
  11498. r[t[n]][1] = o,
  11499. n++,
  11500. i++;
  11501. i *= 2
  11502. }
  11503. return r
  11504. }
  11505. function r() {
  11506. C = n(z, W),
  11507. I = n(X, Z),
  11508. E = n(j, Y),
  11509. b = n(q, K)
  11510. }
  11511. function o() {
  11512. for (var e = 1, t = 2, i = 1; i <= 15; i++) {
  11513. for (var n = e; n < t; n++)
  11514. P[32767 + n] = i,
  11515. R[32767 + n] = [],
  11516. R[32767 + n][1] = i,
  11517. R[32767 + n][0] = n;
  11518. for (var r = -(t - 1); r <= -e; r++)
  11519. P[32767 + r] = i,
  11520. R[32767 + r] = [],
  11521. R[32767 + r][1] = i,
  11522. R[32767 + r][0] = t - 1 + r;
  11523. e <<= 1,
  11524. t <<= 1
  11525. }
  11526. }
  11527. function a() {
  11528. for (var e = 0; e < 256; e++)
  11529. H[e] = 19595 * e,
  11530. H[e + 256 >> 0] = 38470 * e,
  11531. H[e + 512 >> 0] = 7471 * e + 32768,
  11532. H[e + 768 >> 0] = -11059 * e,
  11533. H[e + 1024 >> 0] = -21709 * e,
  11534. H[e + 1280 >> 0] = 32768 * e + 8421375,
  11535. H[e + 1536 >> 0] = -27439 * e,
  11536. H[e + 1792 >> 0] = -5329 * e
  11537. }
  11538. function s(e) {
  11539. for (var t = e[0], i = e[1] - 1; i >= 0; )
  11540. t & 1 << i && (N |= 1 << B),
  11541. i--,
  11542. B--,
  11543. B < 0 && (255 == N ? (l(255),
  11544. l(0)) : l(N),
  11545. B = 7,
  11546. N = 0)
  11547. }
  11548. function l(e) {
  11549. D.push(e)
  11550. }
  11551. function c(e) {
  11552. l(e >> 8 & 255),
  11553. l(255 & e)
  11554. }
  11555. function h(e, t) {
  11556. var i, n, r, o, a, s, l, c, h, u = 0, d = 8, p = 64;
  11557. for (h = 0; h < d; ++h) {
  11558. i = e[u],
  11559. n = e[u + 1],
  11560. r = e[u + 2],
  11561. o = e[u + 3],
  11562. a = e[u + 4],
  11563. s = e[u + 5],
  11564. l = e[u + 6],
  11565. c = e[u + 7];
  11566. var f = i + c
  11567. , g = i - c
  11568. , m = n + l
  11569. , v = n - l
  11570. , A = r + s
  11571. , y = r - s
  11572. , C = o + a
  11573. , I = o - a
  11574. , E = f + C
  11575. , b = f - C
  11576. , w = m + A
  11577. , _ = m - A;
  11578. e[u] = E + w,
  11579. e[u + 4] = E - w;
  11580. var T = .707106781 * (_ + b);
  11581. e[u + 2] = b + T,
  11582. e[u + 6] = b - T,
  11583. E = I + y,
  11584. w = y + v,
  11585. _ = v + g;
  11586. var x = .382683433 * (E - _)
  11587. , S = .5411961 * E + x
  11588. , M = 1.306562965 * _ + x
  11589. , R = .707106781 * w
  11590. , P = g + R
  11591. , L = g - R;
  11592. e[u + 5] = L + S,
  11593. e[u + 3] = L - S,
  11594. e[u + 1] = P + M,
  11595. e[u + 7] = P - M,
  11596. u += 8
  11597. }
  11598. for (u = 0,
  11599. h = 0; h < d; ++h) {
  11600. i = e[u],
  11601. n = e[u + 8],
  11602. r = e[u + 16],
  11603. o = e[u + 24],
  11604. a = e[u + 32],
  11605. s = e[u + 40],
  11606. l = e[u + 48],
  11607. c = e[u + 56];
  11608. var D = i + c
  11609. , N = i - c
  11610. , B = n + l
  11611. , F = n - l
  11612. , V = r + s
  11613. , U = r - s
  11614. , k = o + a
  11615. , H = o - a
  11616. , G = D + k
  11617. , z = D - k
  11618. , W = B + V
  11619. , j = B - V;
  11620. e[u] = G + W,
  11621. e[u + 32] = G - W;
  11622. var Y = .707106781 * (j + z);
  11623. e[u + 16] = z + Y,
  11624. e[u + 48] = z - Y,
  11625. G = H + U,
  11626. W = U + F,
  11627. j = F + N;
  11628. var X = .382683433 * (G - j)
  11629. , Z = .5411961 * G + X
  11630. , q = 1.306562965 * j + X
  11631. , K = .707106781 * W
  11632. , Q = N + K
  11633. , J = N - K;
  11634. e[u + 40] = J + Z,
  11635. e[u + 24] = J - Z,
  11636. e[u + 8] = Q + q,
  11637. e[u + 56] = Q - q,
  11638. u++
  11639. }
  11640. var $;
  11641. for (h = 0; h < p; ++h)
  11642. $ = e[h] * t[h],
  11643. O[h] = $ > 0 ? $ + .5 | 0 : $ - .5 | 0;
  11644. return O
  11645. }
  11646. function u() {
  11647. c(65504),
  11648. c(16),
  11649. l(74),
  11650. l(70),
  11651. l(73),
  11652. l(70),
  11653. l(0),
  11654. l(1),
  11655. l(1),
  11656. l(0),
  11657. c(1),
  11658. c(1),
  11659. l(0),
  11660. l(0)
  11661. }
  11662. function d(e, t) {
  11663. c(65472),
  11664. c(17),
  11665. l(8),
  11666. c(t),
  11667. c(e),
  11668. l(3),
  11669. l(1),
  11670. l(17),
  11671. l(0),
  11672. l(2),
  11673. l(17),
  11674. l(1),
  11675. l(3),
  11676. l(17),
  11677. l(1)
  11678. }
  11679. function p() {
  11680. c(65499),
  11681. c(132),
  11682. l(0);
  11683. for (var e = 0; e < 64; e++)
  11684. l(T[e]);
  11685. l(1);
  11686. for (var t = 0; t < 64; t++)
  11687. l(x[t])
  11688. }
  11689. function f() {
  11690. c(65476),
  11691. c(418),
  11692. l(0);
  11693. for (var e = 0; e < 16; e++)
  11694. l(z[e + 1]);
  11695. for (var t = 0; t <= 11; t++)
  11696. l(W[t]);
  11697. l(16);
  11698. for (var i = 0; i < 16; i++)
  11699. l(j[i + 1]);
  11700. for (var n = 0; n <= 161; n++)
  11701. l(Y[n]);
  11702. l(1);
  11703. for (var r = 0; r < 16; r++)
  11704. l(X[r + 1]);
  11705. for (var o = 0; o <= 11; o++)
  11706. l(Z[o]);
  11707. l(17);
  11708. for (var a = 0; a < 16; a++)
  11709. l(q[a + 1]);
  11710. for (var s = 0; s <= 161; s++)
  11711. l(K[s])
  11712. }
  11713. function g() {
  11714. c(65498),
  11715. c(12),
  11716. l(3),
  11717. l(1),
  11718. l(0),
  11719. l(2),
  11720. l(17),
  11721. l(3),
  11722. l(17),
  11723. l(0),
  11724. l(63),
  11725. l(0)
  11726. }
  11727. function m(e, t, i, n, r) {
  11728. for (var o, a = r[0], l = r[240], c = 16, u = 63, d = 64, p = h(e, t), f = 0; f < d; ++f)
  11729. L[G[f]] = p[f];
  11730. var g = L[0] - i;
  11731. i = L[0],
  11732. 0 == g ? s(n[0]) : (o = 32767 + g,
  11733. s(n[P[o]]),
  11734. s(R[o]));
  11735. for (var m = 63; m > 0 && 0 == L[m]; m--)
  11736. ;
  11737. if (0 == m)
  11738. return s(a),
  11739. i;
  11740. for (var v, A = 1; A <= m; ) {
  11741. for (var y = A; 0 == L[A] && A <= m; ++A)
  11742. ;
  11743. var C = A - y;
  11744. if (C >= c) {
  11745. v = C >> 4;
  11746. for (var I = 1; I <= v; ++I)
  11747. s(l);
  11748. C &= 15
  11749. }
  11750. o = 32767 + L[A],
  11751. s(r[(C << 4) + P[o]]),
  11752. s(R[o]),
  11753. A++
  11754. }
  11755. return m != u && s(a),
  11756. i
  11757. }
  11758. function v() {
  11759. for (var e = String.fromCharCode, t = 0; t < 256; t++)
  11760. k[t] = e(t)
  11761. }
  11762. function A(e) {
  11763. if (e <= 0 && (e = 1),
  11764. e > 100 && (e = 100),
  11765. w != e) {
  11766. var t = 0;
  11767. t = e < 50 ? Math.floor(5e3 / e) : Math.floor(200 - 2 * e),
  11768. i(t),
  11769. w = e
  11770. }
  11771. }
  11772. function y() {
  11773. var e = (new Date).getTime();
  11774. t || (t = 50),
  11775. v(),
  11776. r(),
  11777. o(),
  11778. a(),
  11779. A(t);
  11780. (new Date).getTime() - e
  11781. }
  11782. var C, I, E, b, w, _ = (Math.round,
  11783. 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];
  11784. this.encode = function(t, i) {
  11785. var n = ((new Date).getTime(),
  11786. i.quality);
  11787. n && A(n),
  11788. D = new Array,
  11789. N = 0,
  11790. B = 7,
  11791. c(65496),
  11792. u(),
  11793. p(),
  11794. d(t.width, t.height),
  11795. f(),
  11796. g();
  11797. var r = 0
  11798. , o = 0
  11799. , a = 0;
  11800. N = 0,
  11801. B = 7,
  11802. this.encode.displayName = "_encode_";
  11803. 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; ) {
  11804. for (l = 0; l < G; ) {
  11805. for (w = G * z + l,
  11806. _ = w,
  11807. T = -1,
  11808. x = 0,
  11809. R = 0; R < 64; R++)
  11810. x = (k ? 63 - R : R) >> 3,
  11811. T = 4 * (7 & R),
  11812. _ = w + x * G + T,
  11813. z + x >= L && (_ -= G * (z + 1 + x - L)),
  11814. l + T >= G && (_ -= l + T - G + 4),
  11815. h = P[_++],
  11816. v = P[_++],
  11817. y = P[_++],
  11818. F[R] = (H[h] + H[v + 256 >> 0] + H[y + 512 >> 0] >> 16) - 128,
  11819. V[R] = (H[h + 768 >> 0] + H[v + 1024 >> 0] + H[y + 1280 >> 0] >> 16) - 128,
  11820. U[R] = (H[h + 1280 >> 0] + H[v + 1536 >> 0] + H[y + 1792 >> 0] >> 16) - 128;
  11821. r = m(F, S, r, C, E),
  11822. o = m(V, M, o, I, b),
  11823. a = m(U, M, a, I, b),
  11824. l += 32
  11825. }
  11826. z += W
  11827. }
  11828. if (B >= 0) {
  11829. var j = [];
  11830. j[1] = B + 1,
  11831. j[0] = (1 << B + 1) - 1,
  11832. s(j)
  11833. }
  11834. return c(65497),
  11835. new e(D)
  11836. }
  11837. ,
  11838. y()
  11839. }
  11840. function n(e, t) {
  11841. t = t || {},
  11842. t.quality = t.quality || 50;
  11843. var n = t.quality
  11844. , r = new i(n)
  11845. , o = r.encode(e, t);
  11846. return {
  11847. data: o,
  11848. width: e.width,
  11849. height: e.height
  11850. }
  11851. }
  11852. t.exports.encode = n
  11853. }
  11854. ).call(this, e("buffer").Buffer)
  11855. }
  11856. , {
  11857. buffer: 198
  11858. }],
  11859. 95: [function(e, t, i) {
  11860. "use strict";
  11861. !function() {
  11862. if ("performance"in window == !1 && (window.performance = {}),
  11863. Date.now = Date.now || function() {
  11864. return (new Date).getTime()
  11865. }
  11866. ,
  11867. "now"in window.performance == !1) {
  11868. var e = Date.now();
  11869. performance.timing && performance.timing.navigationStart && (e = performance.timing.navigationStart),
  11870. window.performance.now = function() {
  11871. return Date.now() - e
  11872. }
  11873. }
  11874. }()
  11875. }
  11876. , {}],
  11877. 96: [function(e, t, i) {
  11878. "use strict";
  11879. var n = e("three");
  11880. n.EffectComposer = function(e, t) {
  11881. if (this.renderer = e,
  11882. void 0 === t) {
  11883. var i = {
  11884. minFilter: n.LinearFilter,
  11885. magFilter: n.LinearFilter,
  11886. format: n.RGBAFormat,
  11887. stencilBuffer: !1
  11888. }
  11889. , r = e.getSize();
  11890. t = new n.WebGLRenderTarget(r.width,r.height,i)
  11891. }
  11892. this.renderTarget1 = t,
  11893. this.renderTarget2 = t.clone(),
  11894. this.writeBuffer = this.renderTarget1,
  11895. this.readBuffer = this.renderTarget2,
  11896. this.passes = [],
  11897. void 0 === n.CopyShader && console.error("THREE.EffectComposer relies on THREE.CopyShader"),
  11898. this.copyPass = new n.ShaderPass(n.CopyShader)
  11899. }
  11900. ,
  11901. n.EffectComposer.prototype = {
  11902. swapBuffers: function() {
  11903. var e = this.readBuffer;
  11904. this.readBuffer = this.writeBuffer,
  11905. this.writeBuffer = e
  11906. },
  11907. addPass: function(e) {
  11908. this.passes.push(e)
  11909. },
  11910. insertPass: function(e, t) {
  11911. this.passes.splice(t, 0, e)
  11912. },
  11913. render: function(e) {
  11914. this.writeBuffer = this.renderTarget1,
  11915. this.readBuffer = this.renderTarget2;
  11916. var t, i, r = !1, o = this.passes.length;
  11917. for (i = 0; i < o; i++)
  11918. if (t = this.passes[i],
  11919. t.enabled) {
  11920. if (t.render(this.renderer, this.writeBuffer, this.readBuffer, e, r),
  11921. t.needsSwap) {
  11922. if (r) {
  11923. var a = this.renderer.context;
  11924. a.stencilFunc(a.NOTEQUAL, 1, 4294967295),
  11925. this.copyPass.render(this.renderer, this.writeBuffer, this.readBuffer, e),
  11926. a.stencilFunc(a.EQUAL, 1, 4294967295)
  11927. }
  11928. this.swapBuffers()
  11929. }
  11930. t instanceof n.MaskPass ? r = !0 : t instanceof n.ClearMaskPass && (r = !1)
  11931. }
  11932. },
  11933. reset: function(e) {
  11934. if (void 0 === e) {
  11935. var t = this.renderer.getSize();
  11936. e = this.renderTarget1.clone(),
  11937. e.setSize(t.width, t.height)
  11938. }
  11939. this.renderTarget1.dispose(),
  11940. this.renderTarget2.dispose(),
  11941. this.renderTarget1 = e,
  11942. this.renderTarget2 = e.clone(),
  11943. this.writeBuffer = this.renderTarget1,
  11944. this.readBuffer = this.renderTarget2
  11945. },
  11946. setSize: function(e, t) {
  11947. this.renderTarget1.setSize(e, t),
  11948. this.renderTarget2.setSize(e, t)
  11949. this.passes.forEach(a=>{//add
  11950. a.setSize && a.setSize(e, t)
  11951. })
  11952. }
  11953. }
  11954. }
  11955. , {
  11956. three: 217
  11957. }],
  11958. 97: [function(e, t, i) {
  11959. "use strict";
  11960. var n = e("three");
  11961. n.MaskPass = function(e, t) {
  11962. this.scene = e,
  11963. this.camera = t,
  11964. this.enabled = !0,
  11965. this.clear = !0,
  11966. this.needsSwap = !1,
  11967. this.inverse = !1
  11968. }
  11969. ,
  11970. n.MaskPass.prototype = {
  11971. render: function(e, t, i, n) {
  11972. var r = e.context;
  11973. r.colorMask(!1, !1, !1, !1),
  11974. r.depthMask(!1);
  11975. var o, a;
  11976. this.inverse ? (o = 0,
  11977. a = 1) : (o = 1,
  11978. a = 0),
  11979. r.enable(r.STENCIL_TEST),
  11980. r.stencilOp(r.REPLACE, r.REPLACE, r.REPLACE),
  11981. r.stencilFunc(r.ALWAYS, o, 4294967295),
  11982. r.clearStencil(a),
  11983. e.render(this.scene, this.camera, i, this.clear),
  11984. e.render(this.scene, this.camera, t, this.clear),
  11985. r.colorMask(!0, !0, !0, !0),
  11986. r.depthMask(!0),
  11987. r.stencilFunc(r.EQUAL, 1, 4294967295),
  11988. r.stencilOp(r.KEEP, r.KEEP, r.KEEP)
  11989. }
  11990. },
  11991. n.ClearMaskPass = function() {
  11992. this.enabled = !0
  11993. }
  11994. ,
  11995. n.ClearMaskPass.prototype = {
  11996. render: function(e, t, i, n) {
  11997. var r = e.context;
  11998. r.disable(r.STENCIL_TEST)
  11999. }
  12000. }
  12001. }
  12002. , {
  12003. three: 217
  12004. }],
  12005. 98: [function(e, t, i) {
  12006. "use strict";
  12007. var n = e("three");
  12008. n.RenderPass = function(e, t, i, r, o) {
  12009. this.scene = e,
  12010. this.camera = t,
  12011. this.overrideMaterial = i,
  12012. this.clearColor = r,
  12013. this.clearAlpha = void 0 !== o ? o : 1,
  12014. this.oldClearColor = new n.Color,
  12015. this.oldClearAlpha = 1,
  12016. this.enabled = !0,
  12017. this.clear = !0,
  12018. this.needsSwap = !1
  12019. }
  12020. ,
  12021. n.RenderPass.prototype = {
  12022. render: function(e, t, i, n) {
  12023. this.scene.overrideMaterial = this.overrideMaterial,
  12024. this.clearColor && (this.oldClearColor.copy(e.getClearColor()),
  12025. this.oldClearAlpha = e.getClearAlpha(),
  12026. e.setClearColor(this.clearColor, this.clearAlpha)),
  12027. e.render(this.scene, this.camera, i, this.clear),
  12028. this.clearColor && e.setClearColor(this.oldClearColor, this.oldClearAlpha),
  12029. this.scene.overrideMaterial = null
  12030. }
  12031. }
  12032. }
  12033. , {
  12034. three: 217
  12035. }],
  12036. 99: [function(e, t, i) {
  12037. "use strict";
  12038. var n = e("three");
  12039. n.ShaderPass = function(e, t) {
  12040. this.textureID = void 0 !== t ? t : "tDiffuse",
  12041. e instanceof n.ShaderMaterial ? (this.uniforms = e.uniforms,
  12042. this.material = e) : e && (this.uniforms = n.UniformsUtils.clone(e.uniforms),
  12043. this.material = new n.ShaderMaterial({
  12044. defines: e.defines || {},
  12045. uniforms: this.uniforms,
  12046. vertexShader: e.vertexShader,
  12047. fragmentShader: e.fragmentShader
  12048. })),
  12049. this.renderToScreen = !1,
  12050. this.enabled = !0,
  12051. this.needsSwap = !0,
  12052. this.clear = !1,
  12053. this.camera = new n.OrthographicCamera(-1,1,1,-1,0,1),
  12054. this.scene = new n.Scene,
  12055. this.quad = new n.Mesh(new n.PlaneBufferGeometry(2,2),null),
  12056. this.scene.add(this.quad)
  12057. }
  12058. ,
  12059. n.ShaderPass.prototype = {
  12060. render: function(e, t, i, n) {
  12061. this.uniforms[this.textureID] && (this.uniforms[this.textureID].value = i),
  12062. this.quad.material = this.material,
  12063. this.renderToScreen ? e.render(this.scene, this.camera) : e.render(this.scene, this.camera, t, this.clear)
  12064. }
  12065. }
  12066. }
  12067. , {
  12068. three: 217
  12069. }],
  12070. 100: [function(e, t, i) {
  12071. "use strict";
  12072. var n = e("three");
  12073. n.CopyShader = {
  12074. uniforms: {
  12075. tDiffuse: {
  12076. type: "t",
  12077. value: null
  12078. },
  12079. opacity: {
  12080. type: "f",
  12081. value: 1
  12082. }
  12083. },
  12084. vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  12085. fragmentShader: ["uniform float opacity;", "uniform sampler2D tDiffuse;", "varying vec2 vUv;", "void main() {", "vec4 texel = texture2D( tDiffuse, vUv );", "gl_FragColor = opacity * texel;", "}"].join("\n")
  12086. }
  12087. }
  12088. , {
  12089. three: 217
  12090. }],
  12091. 101: [function(e, t, i) {
  12092. "use strict";
  12093. var n = e("three");
  12094. n.HorizontalBlurShader = {
  12095. uniforms: {
  12096. tDiffuse: {
  12097. type: "t",
  12098. value: null
  12099. },
  12100. h: {
  12101. type: "f",
  12102. value: 1 / 512
  12103. }
  12104. },
  12105. vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  12106. 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")
  12107. }
  12108. }
  12109. , {
  12110. three: 217
  12111. }],
  12112. 102: [function(e, t, i) {
  12113. "use strict";
  12114. var n = e("three");
  12115. n.VerticalBlurShader = {
  12116. uniforms: {
  12117. tDiffuse: {
  12118. type: "t",
  12119. value: null
  12120. },
  12121. v: {
  12122. type: "f",
  12123. value: 1 / 512
  12124. }
  12125. },
  12126. vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  12127. 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")
  12128. }
  12129. }
  12130. , {
  12131. three: 217
  12132. }],
  12133. 103: [function(e, t, i) {
  12134. "use strict";
  12135. var n = e("three");
  12136. !function() {
  12137. if ("performance"in window == 0 && (window.performance = {}),
  12138. "now"in window.performance == 0) {
  12139. var e = Date.now();
  12140. performance.timing && performance.timing.navigationStart && (e = performance.timing.navigationStart),
  12141. window.performance.now = function() {
  12142. return Date.now() - e
  12143. }
  12144. }
  12145. }(),
  12146. n.WebGLRenderer.prototype.paramThreeToGL = function(e) {
  12147. var t, i = this.extensions, r = this.context;
  12148. if (e === n.RepeatWrapping)
  12149. return r.REPEAT;
  12150. if (e === n.ClampToEdgeWrapping)
  12151. return r.CLAMP_TO_EDGE;
  12152. if (e === n.MirroredRepeatWrapping)
  12153. return r.MIRRORED_REPEAT;
  12154. if (e === n.NearestFilter)
  12155. return r.NEAREST;
  12156. if (e === n.NearestMipMapNearestFilter)
  12157. return r.NEAREST_MIPMAP_NEAREST;
  12158. if (e === n.NearestMipMapLinearFilter)
  12159. return r.NEAREST_MIPMAP_LINEAR;
  12160. if (e === n.LinearFilter)
  12161. return r.LINEAR;
  12162. if (e === n.LinearMipMapNearestFilter)
  12163. return r.LINEAR_MIPMAP_NEAREST;
  12164. if (e === n.LinearMipMapLinearFilter)
  12165. return r.LINEAR_MIPMAP_LINEAR;
  12166. if (e === n.UnsignedByteType)
  12167. return r.UNSIGNED_BYTE;
  12168. if (e === n.UnsignedShort4444Type)
  12169. return r.UNSIGNED_SHORT_4_4_4_4;
  12170. if (e === n.UnsignedShort5551Type)
  12171. return r.UNSIGNED_SHORT_5_5_5_1;
  12172. if (e === n.UnsignedShort565Type)
  12173. return r.UNSIGNED_SHORT_5_6_5;
  12174. if (e === n.ByteType)
  12175. return r.BYTE;
  12176. if (e === n.ShortType)
  12177. return r.SHORT;
  12178. if (e === n.UnsignedShortType)
  12179. return r.UNSIGNED_SHORT;
  12180. if (e === n.IntType)
  12181. return r.INT;
  12182. if (e === n.UnsignedIntType)
  12183. return r.UNSIGNED_INT;
  12184. if (e === n.FloatType)
  12185. return r.FLOAT;
  12186. if (t = i.get("OES_texture_half_float"),
  12187. null !== t && e === n.HalfFloatType)
  12188. return t.HALF_FLOAT_OES;
  12189. if (e === n.AlphaFormat)
  12190. return r.ALPHA;
  12191. if (e === n.RGBFormat)
  12192. return r.RGB;
  12193. if (e === n.RGBAFormat)
  12194. return r.RGBA;
  12195. if (e === n.LuminanceFormat)
  12196. return r.LUMINANCE;
  12197. if (e === n.LuminanceAlphaFormat)
  12198. return r.LUMINANCE_ALPHA;
  12199. if (e === n.AddEquation)
  12200. return r.FUNC_ADD;
  12201. if (e === n.SubtractEquation)
  12202. return r.FUNC_SUBTRACT;
  12203. if (e === n.ReverseSubtractEquation)
  12204. return r.FUNC_REVERSE_SUBTRACT;
  12205. if (e === n.ZeroFactor)
  12206. return r.ZERO;
  12207. if (e === n.OneFactor)
  12208. return r.ONE;
  12209. if (e === n.SrcColorFactor)
  12210. return r.SRC_COLOR;
  12211. if (e === n.OneMinusSrcColorFactor)
  12212. return r.ONE_MINUS_SRC_COLOR;
  12213. if (e === n.SrcAlphaFactor)
  12214. return r.SRC_ALPHA;
  12215. if (e === n.OneMinusSrcAlphaFactor)
  12216. return r.ONE_MINUS_SRC_ALPHA;
  12217. if (e === n.DstAlphaFactor)
  12218. return r.DST_ALPHA;
  12219. if (e === n.OneMinusDstAlphaFactor)
  12220. return r.ONE_MINUS_DST_ALPHA;
  12221. if (e === n.DstColorFactor)
  12222. return r.DST_COLOR;
  12223. if (e === n.OneMinusDstColorFactor)
  12224. return r.ONE_MINUS_DST_COLOR;
  12225. if (e === n.SrcAlphaSaturateFactor)
  12226. return r.SRC_ALPHA_SATURATE;
  12227. if (t = i.get("WEBGL_compressed_texture_s3tc"),
  12228. null !== t) {
  12229. if (e === n.RGB_S3TC_DXT1_Format)
  12230. return t.COMPRESSED_RGB_S3TC_DXT1_EXT;
  12231. if (e === n.RGBA_S3TC_DXT1_Format)
  12232. return t.COMPRESSED_RGBA_S3TC_DXT1_EXT;
  12233. if (e === n.RGBA_S3TC_DXT3_Format)
  12234. return t.COMPRESSED_RGBA_S3TC_DXT3_EXT;
  12235. if (e === n.RGBA_S3TC_DXT5_Format)
  12236. return t.COMPRESSED_RGBA_S3TC_DXT5_EXT
  12237. }
  12238. if (t = i.get("WEBGL_compressed_texture_pvrtc"),
  12239. null !== t) {
  12240. if (e === n.RGB_PVRTC_4BPPV1_Format)
  12241. return t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;
  12242. if (e === n.RGB_PVRTC_2BPPV1_Format)
  12243. return t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;
  12244. if (e === n.RGBA_PVRTC_4BPPV1_Format)
  12245. return t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;
  12246. if (e === n.RGBA_PVRTC_2BPPV1_Format)
  12247. return t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG
  12248. }
  12249. if (t = i.get("WEBGL_compressed_texture_etc1"),
  12250. null !== t && e === n.RGB_ETC1_Format)
  12251. return t.COMPRESSED_RGB_ETC1_WEBGL;
  12252. if (t = i.get("EXT_blend_minmax"),
  12253. null !== t) {
  12254. if (e === n.MinEquation)
  12255. return t.MIN_EXT;
  12256. if (e === n.MaxEquation)
  12257. return t.MAX_EXT
  12258. }
  12259. return 0
  12260. }
  12261. ,
  12262. n.WebGLState = function(e, t, i) {
  12263. var r = this
  12264. , o = new n.Vector4
  12265. , a = e.getParameter(e.MAX_VERTEX_ATTRIBS)
  12266. , s = new Uint8Array(a)
  12267. , l = new Uint8Array(a)
  12268. , c = new Uint8Array(a)
  12269. , h = {}
  12270. , u = null
  12271. , d = null
  12272. , p = null
  12273. , f = null
  12274. , g = null
  12275. , m = null
  12276. , v = null
  12277. , A = null
  12278. , y = !1
  12279. , C = null
  12280. , I = null
  12281. , E = null
  12282. , b = null
  12283. , w = null
  12284. , _ = null
  12285. , T = null
  12286. , x = null
  12287. , S = null
  12288. , M = null
  12289. , R = null
  12290. , P = null
  12291. , O = null
  12292. , L = null
  12293. , D = null
  12294. , N = e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS)
  12295. , B = void 0
  12296. , F = {}
  12297. , V = new n.Vector4
  12298. , U = null
  12299. , k = null
  12300. , H = new n.Vector4
  12301. , G = new n.Vector4;
  12302. this.init = function() {
  12303. this.clearColor(0, 0, 0, 1),
  12304. this.clearDepth(1),
  12305. this.clearStencil(0),
  12306. this.enable(e.DEPTH_TEST),
  12307. e.depthFunc(e.LEQUAL),
  12308. e.frontFace(e.CCW),
  12309. e.cullFace(e.BACK),
  12310. this.enable(e.CULL_FACE),
  12311. this.enable(e.BLEND),
  12312. e.blendEquation(e.FUNC_ADD),
  12313. e.blendFunc(e.SRC_ALPHA, e.ONE_MINUS_SRC_ALPHA)
  12314. }
  12315. ,
  12316. this.initAttributes = function() {
  12317. for (var e = 0, t = s.length; e < t; e++)
  12318. s[e] = 0
  12319. }
  12320. ,
  12321. this.enableAttribute = function(i) {
  12322. if (s[i] = 1,
  12323. 0 === l[i] && (e.enableVertexAttribArray(i),
  12324. l[i] = 1),
  12325. 0 !== c[i]) {
  12326. var n = t.get("ANGLE_instanced_arrays");
  12327. n.vertexAttribDivisorANGLE(i, 0),
  12328. c[i] = 0
  12329. }
  12330. }
  12331. ,
  12332. this.enableAttributeAndDivisor = function(t, i, n) {
  12333. s[t] = 1,
  12334. 0 === l[t] && (e.enableVertexAttribArray(t),
  12335. l[t] = 1),
  12336. c[t] !== i && (n.vertexAttribDivisorANGLE(t, i),
  12337. c[t] = i)
  12338. }
  12339. ,
  12340. this.disableUnusedAttributes = function() {
  12341. for (var t = 0, i = l.length; t < i; t++)
  12342. l[t] !== s[t] && (e.disableVertexAttribArray(t),
  12343. l[t] = 0)
  12344. }
  12345. ,
  12346. this.enable = function(t) {
  12347. h[t] !== !0 && (e.enable(t),
  12348. h[t] = !0)
  12349. }
  12350. ,
  12351. this.disable = function(t) {
  12352. h[t] !== !1 && (e.disable(t),
  12353. h[t] = !1)
  12354. }
  12355. ,
  12356. this.getCompressedTextureFormats = function() {
  12357. if (null === u && (u = [],
  12358. t.get("WEBGL_compressed_texture_pvrtc") || t.get("WEBGL_compressed_texture_s3tc") || t.get("WEBGL_compressed_texture_etc1")))
  12359. for (var i = e.getParameter(e.COMPRESSED_TEXTURE_FORMATS), n = 0; n < i.length; n++)
  12360. u.push(i[n]);
  12361. return u
  12362. }
  12363. ,
  12364. this.setBlending = function(t, r, o, a, s, l, c, h) {
  12365. t === n.NoBlending ? this.disable(e.BLEND) : this.enable(e.BLEND),
  12366. t === d && h === y || (t === n.AdditiveBlending ? h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  12367. e.blendFuncSeparate(e.ONE, e.ONE, e.ONE, e.ONE)) : (e.blendEquation(e.FUNC_ADD),
  12368. e.blendFunc(e.SRC_ALPHA, e.ONE)) : t === n.SubtractiveBlending ? h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  12369. e.blendFuncSeparate(e.ZERO, e.ZERO, e.ONE_MINUS_SRC_COLOR, e.ONE_MINUS_SRC_ALPHA)) : (e.blendEquation(e.FUNC_ADD),
  12370. e.blendFunc(e.ZERO, e.ONE_MINUS_SRC_COLOR)) : t === n.MultiplyBlending ? h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  12371. e.blendFuncSeparate(e.ZERO, e.ZERO, e.SRC_COLOR, e.SRC_ALPHA)) : (e.blendEquation(e.FUNC_ADD),
  12372. e.blendFunc(e.ZERO, e.SRC_COLOR)) : h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  12373. e.blendFuncSeparate(e.ONE, e.ONE_MINUS_SRC_ALPHA, e.ONE, e.ONE_MINUS_SRC_ALPHA)) : (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  12374. e.blendFuncSeparate(e.SRC_ALPHA, e.ONE_MINUS_SRC_ALPHA, e.ONE, e.ONE_MINUS_SRC_ALPHA)),
  12375. d = t,
  12376. y = h),
  12377. t === n.CustomBlending ? (s = s || r,
  12378. l = l || o,
  12379. c = c || a,
  12380. r === p && s === m || (e.blendEquationSeparate(i(r), i(s)),
  12381. p = r,
  12382. m = s),
  12383. o === f && a === g && l === v && c === A || (e.blendFuncSeparate(i(o), i(a), i(l), i(c)),
  12384. f = o,
  12385. g = a,
  12386. v = l,
  12387. A = c)) : (p = null,
  12388. f = null,
  12389. g = null,
  12390. m = null,
  12391. v = null,
  12392. A = null)
  12393. }
  12394. ,
  12395. this.setDepthFunc = function(t) {
  12396. if (C !== t) {
  12397. if (t)
  12398. switch (t) {
  12399. case n.NeverDepth:
  12400. e.depthFunc(e.NEVER);
  12401. break;
  12402. case n.AlwaysDepth:
  12403. e.depthFunc(e.ALWAYS);
  12404. break;
  12405. case n.LessDepth:
  12406. e.depthFunc(e.LESS);
  12407. break;
  12408. case n.LessEqualDepth:
  12409. e.depthFunc(e.LEQUAL);
  12410. break;
  12411. case n.EqualDepth:
  12412. e.depthFunc(e.EQUAL);
  12413. break;
  12414. case n.GreaterEqualDepth:
  12415. e.depthFunc(e.GEQUAL);
  12416. break;
  12417. case n.GreaterDepth:
  12418. e.depthFunc(e.GREATER);
  12419. break;
  12420. case n.NotEqualDepth:
  12421. e.depthFunc(e.NOTEQUAL);
  12422. break;
  12423. default:
  12424. e.depthFunc(e.LEQUAL)
  12425. }
  12426. else
  12427. e.depthFunc(e.LEQUAL);
  12428. C = t
  12429. }
  12430. }
  12431. ,
  12432. this.setDepthTest = function(t) {
  12433. t ? this.enable(e.DEPTH_TEST) : this.disable(e.DEPTH_TEST)
  12434. }
  12435. ,
  12436. this.setDepthWrite = function(t) {
  12437. I !== t && (e.depthMask(t),
  12438. I = t)
  12439. }
  12440. ,
  12441. this.setColorWrite = function(t) {
  12442. E !== t && (e.colorMask(t, t, t, t),
  12443. E = t)
  12444. }
  12445. ,
  12446. this.setStencilFunc = function(t, i, n) {
  12447. w === t && _ === i && T === n || (e.stencilFunc(t, i, n),
  12448. w = t,
  12449. _ = i,
  12450. T = n)
  12451. }
  12452. ,
  12453. this.setStencilOp = function(t, i, n) {
  12454. x === t && S === i && M === n || (e.stencilOp(t, i, n),
  12455. x = t,
  12456. S = i,
  12457. M = n)
  12458. }
  12459. ,
  12460. this.setStencilTest = function(t) {
  12461. t ? this.enable(e.STENCIL_TEST) : this.disable(e.STENCIL_TEST)
  12462. }
  12463. ,
  12464. this.setStencilWrite = function(t) {
  12465. b !== t && (e.stencilMask(t),
  12466. b = t)
  12467. }
  12468. ,
  12469. this.setFlipSided = function(t) {
  12470. R !== t && (t ? e.frontFace(e.CW) : e.frontFace(e.CCW),
  12471. R = t)
  12472. }
  12473. ,
  12474. this.setLineWidth = function(t) {
  12475. t !== P && (e.lineWidth(t),
  12476. P = t)
  12477. }
  12478. ,
  12479. this.setPolygonOffset = function(t, i, n) {
  12480. t ? this.enable(e.POLYGON_OFFSET_FILL) : this.disable(e.POLYGON_OFFSET_FILL),
  12481. !t || O === i && L === n || (e.polygonOffset(i, n),
  12482. O = i,
  12483. L = n)
  12484. }
  12485. ,
  12486. this.getScissorTest = function() {
  12487. return D
  12488. }
  12489. ,
  12490. this.setScissorTest = function(t) {
  12491. D = t,
  12492. t ? this.enable(e.SCISSOR_TEST) : this.disable(e.SCISSOR_TEST)
  12493. }
  12494. ,
  12495. this.activeTexture = function(t) {
  12496. void 0 === t && (t = e.TEXTURE0 + N - 1),
  12497. B !== t && (e.activeTexture(t),
  12498. B = t)
  12499. }
  12500. ,
  12501. this.bindTexture = function(t, i) {
  12502. void 0 === B && r.activeTexture();
  12503. var n = F[B];
  12504. void 0 === n && (n = {
  12505. type: void 0,
  12506. texture: void 0
  12507. },
  12508. F[B] = n),
  12509. n.type === t && n.texture === i || (e.bindTexture(t, i),
  12510. n.type = t,
  12511. n.texture = i)
  12512. }
  12513. ,
  12514. this.compressedTexImage2D = function() {
  12515. try {
  12516. e.compressedTexImage2D.apply(e, arguments)
  12517. } catch (e) {
  12518. console.error(e)
  12519. }
  12520. }
  12521. ,
  12522. this.texImage2D = function() {
  12523. try {
  12524. e.texImage2D.apply(e, arguments)
  12525. } catch (e) {
  12526. console.error(e)
  12527. }
  12528. }
  12529. ,
  12530. this.clearColor = function(t, i, n, r) {
  12531. o.set(t, i, n, r),
  12532. V.equals(o) === !1 && (e.clearColor(t, i, n, r),
  12533. V.copy(o))
  12534. }
  12535. ,
  12536. this.clearDepth = function(t) {
  12537. U !== t && (e.clearDepth(t),
  12538. U = t)
  12539. }
  12540. ,
  12541. this.clearStencil = function(t) {
  12542. k !== t && (e.clearStencil(t),
  12543. k = t)
  12544. }
  12545. ,
  12546. this.scissor = function(t) {
  12547. H.equals(t) === !1 && (e.scissor(t.x, t.y, t.z, t.w),
  12548. H.copy(t))
  12549. }
  12550. ,
  12551. this.viewport = function(t) {
  12552. G.equals(t) === !1 && (e.viewport(t.x, t.y, t.z, t.w),
  12553. G.copy(t))
  12554. }
  12555. ,
  12556. this.reset = function() {
  12557. for (var t = 0; t < l.length; t++)
  12558. 1 === l[t] && (e.disableVertexAttribArray(t),
  12559. l[t] = 0);
  12560. h = {},
  12561. u = null,
  12562. B = void 0,
  12563. F = {},
  12564. d = null,
  12565. E = null,
  12566. I = null,
  12567. b = null,
  12568. R = null
  12569. }
  12570. }
  12571. }
  12572. , {
  12573. three: 217
  12574. }],
  12575. 104: [function(e, t, i) {
  12576. (function(i, n) {
  12577. "use strict";
  12578. function r(e) {
  12579. this.urls = e;
  12580. var t = i("bWVzc2FnZSBiaW5hcnlfbWVzaCB7CglyZXBlYXRlZCBjaHVua19zaW1wbGUgY2h1bmsgPSAxOwoJcmVwZWF0ZWQgY2h1bmtfcXVhbnRpemVkIHF1YW50aXplZF9jaHVuayA9IDI7Cn0KCi8vIERlZmluaXRpb24gb2YgdmVydGljZXM6IDNEIGNvb3JkaW5hdGVzLCBhbmQgMkQgdGV4dHVyZSBjb29yZGluYXRlcy4KbWVzc2FnZSB2ZXJ0aWNlc19zaW1wbGUgewoJcmVwZWF0ZWQgZmxvYXQgeHl6ID0gMSBbcGFja2VkPXRydWVdOyAgLy8geF8wLHlfMCx6XzAsIHhfMSx5XzEsel8xLCAuLi4KCXJlcGVhdGVkIGZsb2F0IHV2ID0gMiBbcGFja2VkPXRydWVdOyAgLy8gdV8wLHZfMCwgdV8xLHZfMSwgLi4uCn0KCi8vIEluZGV4ZXMgb2YgdmVydGljZXMgb2YgZmFjZXMKbWVzc2FnZSBmYWNlc19zaW1wbGUgewoJcmVwZWF0ZWQgdWludDMyIGZhY2VzID0gMSBbcGFja2VkPXRydWVdOyAvLyBpMDAsaTAxLGkwMiwgaTEwLGkxMSxpMTIsIC4uLgp9CgovLyBBIHNpbXBseSBlbmNvZGVkIGNodW5rLgovLyBUT0RPOiBhZGQgY2h1bmsgcHJvcGVyaXRlcyAoc3VjaCBhcyAicmVmbGVjdGl2ZSIpCm1lc3NhZ2UgY2h1bmtfc2ltcGxlIHsKCW9wdGlvbmFsIHZlcnRpY2VzX3NpbXBsZSB2ZXJ0aWNlcyA9IDE7CglvcHRpb25hbCBmYWNlc19zaW1wbGUgZmFjZXMgPSAyOwoJb3B0aW9uYWwgc3RyaW5nIGNodW5rX25hbWUgPSAzOwoJb3B0aW9uYWwgc3RyaW5nIG1hdGVyaWFsX25hbWUgPSA0Owp9CgovLyBRdWFudGl6ZWQgdmVyc2lvbnMgZm9sbG93OgptZXNzYWdlIHZlcnRpY2VzX3F1YW50aXplZCB7CglvcHRpb25hbCBmbG9hdCBxdWFudGl6YXRpb24gPSAxOwoJcmVwZWF0ZWQgZmxvYXQgdHJhbnNsYXRpb24gPSAyOwoJcmVwZWF0ZWQgc2ludDMyIHggPSAzIFtwYWNrZWQ9dHJ1ZV07CglyZXBlYXRlZCBzaW50MzIgeSA9IDQgW3BhY2tlZD10cnVlXTsKCXJlcGVhdGVkIHNpbnQzMiB6ID0gNSBbcGFja2VkPXRydWVdOwp9CgptZXNzYWdlIHV2X3F1YW50aXplZCB7CglvcHRpb25hbCBzdHJpbmcgbmFtZSA9IDE7CglvcHRpb25hbCBmbG9hdCBxdWFudGl6YXRpb24gPSAyOwoJcmVwZWF0ZWQgc2ludDMyIHUgPSAzIFtwYWNrZWQ9dHJ1ZV07CglyZXBlYXRlZCBzaW50MzIgdiA9IDQgW3BhY2tlZD10cnVlXTsKfQoKLy8gSW5kZXhlcyBvZiB2ZXJ0aWNlcyBvZiBmYWNlcwptZXNzYWdlIGZhY2VzX2NvbXByZXNzZWQgewoJcmVwZWF0ZWQgc2ludDMyIGZhY2VzID0gMSBbcGFja2VkPXRydWVdOyAvLyBpMDAsaTAxLGkwMiwgaTEwLGkxMSxpMTIsIC4uLgp9CgptZXNzYWdlIGNodW5rX3F1YW50aXplZCB7CglvcHRpb25hbCBzdHJpbmcgY2h1bmtfbmFtZSA9IDE7CglvcHRpb25hbCBzdHJpbmcgbWF0ZXJpYWxfbmFtZSA9IDI7CglvcHRpb25hbCB2ZXJ0aWNlc19xdWFudGl6ZWQgdmVydGljZXMgPSAzOwoJcmVwZWF0ZWQgdXZfcXVhbnRpemVkIHV2cyA9IDQ7CglvcHRpb25hbCBmYWNlc19zaW1wbGUgZmFjZXMgPSA1Owp9Cg==", "base64");
  12581. this.builder = a.loadProto(t),
  12582. this.decoder = this.builder.build("binary_mesh")
  12583. }
  12584. var o = e("three")
  12585. , a = e("protobufjs")
  12586. , s = e("../util/logger")
  12587. , l = (e("../util/common"),
  12588. e("../util/ajax"))
  12589. , c = e("../objects/Chunk")
  12590. , h = new s(n);
  12591. r.prototype = {
  12592. constructor: r,
  12593. load: function(e, t, i, n) {
  12594. return h.time("download"),
  12595. l.get(e, {
  12596. responseType: "arraybuffer"
  12597. }).done(function(r) {
  12598. h.timeEnd("download"),
  12599. this.parse(r, e, t, i, n)
  12600. }
  12601. .bind(this)).fail(n)
  12602. },
  12603. parse: function(e, t, i, n, r) {
  12604. var o = this.readProtobuf(e);
  12605. if (!o)
  12606. return r();
  12607. try {
  12608. h.time("convert to webgl"),
  12609. this.convertProtobufToSceneObject(o, t, i, n, r),
  12610. h.timeEnd("convert to webgl")
  12611. } catch (e) {
  12612. return h.error("failed parsing .dam"),
  12613. h.error(e.message),
  12614. r()
  12615. }
  12616. },
  12617. readProtobuf: function(e) {
  12618. var t;
  12619. try {
  12620. h.time("parse proto"),
  12621. t = this.decoder.decode(e),
  12622. h.timeEnd("parse proto")
  12623. } catch (e) {
  12624. return h.error("failed parsing proto for .dam"),
  12625. h.error(e.message),
  12626. null
  12627. }
  12628. return t
  12629. },
  12630. convertProtobufToSceneObject: function(e, t, i, n, r) {
  12631. function a(e) {
  12632. var i = new o.BufferGeometry;
  12633. return i.addAttribute("position", new o.BufferAttribute(new Float32Array(e.vertices.xyz,0,3),3)),
  12634. e.vertices.uv.length > 0 && i.addAttribute("uv", new o.BufferAttribute(new Float32Array(e.vertices.uv,0,2),2)),
  12635. i.setIndex(new o.BufferAttribute(new Uint32Array(e.faces.faces,0,1),1)),
  12636. i.applyMatrix(s),
  12637. i.computeBoundingBox(),
  12638. new c({
  12639. geometry: i,
  12640. textureName: e.material_name,
  12641. name: e.chunk_name,
  12642. meshUrl: t
  12643. })
  12644. }
  12645. if (0 === e.chunk.length)
  12646. return h.warn("No chunks in damfile..."),
  12647. i([]);
  12648. var s = new o.Matrix4;
  12649. s.set(1, 0, 0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1);
  12650. var l = e.chunk.map(a);
  12651. return l ? i(l) : (h.error(".dam protobuf came out with no chunks..."),
  12652. r())
  12653. }
  12654. },
  12655. t.exports = r
  12656. }
  12657. ).call(this, e("buffer").Buffer, "/js/loaders/DamLoader.js")
  12658. }
  12659. , {
  12660. "../objects/Chunk": 144,
  12661. "../util/ajax": 181,
  12662. "../util/common": 185,
  12663. "../util/logger": 189,
  12664. buffer: 198,
  12665. protobufjs: 214,
  12666. three: 217
  12667. }],
  12668. 105: [function(e, t, i) {
  12669. (function(i) {
  12670. "use strict";
  12671. var n = (e("three"),
  12672. e("../settings"),
  12673. e("../util/browser"),
  12674. e("./DamLoader"))
  12675. , r = e("../util/logger")
  12676. , o = (e("../ab"),
  12677. new r(i));
  12678. t.exports = {
  12679. getLoaders: function() {
  12680. return [["_50k", ".dam", n], ["", ".dam", n]]
  12681. },
  12682. load: function(e, t, i, n, r, a) {
  12683. var s = this.getLoaders();
  12684. a = a || 0;
  12685. var l = s[a];
  12686. if (!l)
  12687. return void (r && r("No suitable model file found..."));
  12688. var c = l[0]
  12689. , h = l[1]
  12690. , u = new l[2](t)
  12691. , d = t.get(e + c + h);
  12692. d ? (o.debug("Trying " + c + h),
  12693. u.load(d, i, n, function() {
  12694. this.load(e, t, i, n, r, ++a)
  12695. }
  12696. .bind(this))) : (o.debug("Skipping " + h + ", not available"),
  12697. this.load(e, t, i, n, r, ++a))
  12698. }
  12699. }
  12700. }
  12701. ).call(this, "/js/loaders/ModelLoader.js")
  12702. }
  12703. , {
  12704. "../ab": 3,
  12705. "../settings": 166,
  12706. "../util/browser": 182,
  12707. "../util/logger": 189,
  12708. "./DamLoader": 104,
  12709. three: 217
  12710. }],
  12711. 106: [function(e, t, i) {
  12712. (function(i) {
  12713. "use strict";
  12714. var n = e("../util/common")
  12715. , r = e("../util/texture")
  12716. , o = e("../util/browser")
  12717. , a = e("../util/logger")
  12718. , s = e("../settings")
  12719. , l = new a(i);
  12720. t.exports = {
  12721. load: function(e, t) {
  12722. function i(e, i) {
  12723. e || (t.push(i),
  12724. p++,
  12725. d.notify(p, a),
  12726. p === a && d.resolve())
  12727. }
  12728. if (!e.chunks[0] || !e.chunks[0].meshUrl)
  12729. return $.when();
  12730. var a = n.countUnique(e.chunks.map(function(e) {
  12731. return e.textureName
  12732. }))
  12733. , c = e.chunks[0].meshUrl.indexOf("_50k") !== -1 ? "_50k" : ""
  12734. , h = "_50k" === c ? "high" : "low";
  12735. s.minimalMemoryMode && "high" === h && (o.detectSamsungS6() ? (l.warn("Galaxy S6 cannot handle large textures, turning down quality."),
  12736. h = "low") : a > s.maxMobileTextures && (l.warn("Model probably too large for mobile, turning down quality."),
  12737. h = "low"));
  12738. var u = e.data.job.uuid + c + "_texture_jpg_" + h + "/"
  12739. , d = $.Deferred()
  12740. , p = 0;
  12741. return e.chunks.forEach(function(t) {
  12742. if (!t.material.map && t.textureName) {
  12743. var n = e.urls.get(u + t.textureName);
  12744. t.setTextureMap(r.load(n, i.bind(this, r.isLoaded(n))))
  12745. }
  12746. }),
  12747. d.promise()
  12748. }
  12749. }
  12750. }
  12751. ).call(this, "/js/loaders/ModelTextureLoader.js")
  12752. }
  12753. , {
  12754. "../settings": 166,
  12755. "../util/browser": 182,
  12756. "../util/common": 185,
  12757. "../util/logger": 189,
  12758. "../util/texture": 194
  12759. }],
  12760. 107: [function(e, t, i) {
  12761. (function(i, n) {
  12762. "use strict";
  12763. function r(e) {
  12764. this.model = e,
  12765. this.modelDataPath = this.model.urls.get("vision.modeldata")+"?m="+new Date().getTime(),
  12766. this.sweepLocationsPath = this.model.urls.get("sweep_locations.csv");
  12767. var t = i("Ly8gUHJvdG9jb2wgQnVmZmVyIGZvciBwdWNrIHZpc2liaWxpdHkgYW5kIHJlbGF0ZWQgZGF0YQovLwovLyBUbyBkdW1wIG91dCBhIGJpbnJheSBtYW5pZmVzdCBpbiB0ZXh0IGZvcm1hdCwgeW91IGNhbiB1c2UgcHJvdG9jIGRpcmVjdGx5OgovLyAgIHByb3RvYyAtLXByb3RvX3BhdGggfi9kZXYvbXBfdmlzaW9uLyAgLS1kZWNvZGU9ZW9zLnN0b3JhZ2UuVmlzaW9uTW9kZWxkYXRhIH4vZGV2L21wX3Zpc2lvbi9lb3Mvc3RvcmFnZS92aXNpb25fbW9kZWxkYXRhLnByb3RvIDwgdmlzaW9uLm1vZGVsZGF0YQoKLy8gcGFja2FnZSBlb3Muc3RvcmFnZTsKCi8vIGltcG9ydCAiZW9zL2luZnJhL2NvbW1vbi5wcm90byI7Ci8vIFRoZSBmb2xsb3dpbmcgd2VyZSBtYW51YWxseSBleHRyYWN0ZWQgaGVyZSwgSlMgZG9lcyBub3QgbGlrZSBwcm90b2J1ZiBpbXBvcnRzCgptZXNzYWdlIEFmZmluZTNmIHsKCW9wdGlvbmFsIFF1YXRlcm5pb25mIHJvdGF0aW9uID0gMTsKCW9wdGlvbmFsIFZlY3RvcjNmIHRyYW5zbGF0aW9uID0gMjsKfQoKbWVzc2FnZSBRdWF0ZXJuaW9uZiB7CglvcHRpb25hbCBmbG9hdCB3ID0gMTsKCW9wdGlvbmFsIGZsb2F0IHggPSAyOwoJb3B0aW9uYWwgZmxvYXQgeSA9IDM7CglvcHRpb25hbCBmbG9hdCB6ID0gNDsKfQoKbWVzc2FnZSBWZWN0b3IzZiB7CglvcHRpb25hbCBmbG9hdCB4ID0gMTsKCW9wdGlvbmFsIGZsb2F0IHkgPSAyOwoJb3B0aW9uYWwgZmxvYXQgeiA9IDM7Cn0KCi8vCi8vIE9uZSBzd2VlcCAvIHBhbm8KLy8KbWVzc2FnZSBTd2VlcExvY2F0aW9uIHsKCW9wdGlvbmFsIGJ5dGVzIHV1aWQgPSAxOyAgLyogdXVpZCAqLwoJb3B0aW9uYWwgQWZmaW5lM2YgcG9zZSA9IDI7ICAvKiBjYW1lcmEgcG9zZSAoeCwgeSx6KSBpbiBtZXRlciBhbmQgYSBxdWF0ZXJuaW9uKi8KCW9wdGlvbmFsIFZlY3RvcjNmIHB1Y2sgPSAzOyAgLyogcHVjayBsb2NhdGlvbiAtIHggYW55IGlzIGdlbmVyYWxseSB0aGUgc2FtZSBhcyBwb3NlLCB6IGlzIHRoZSBoZWlnaHQgb2YgdGhlIGNsb3Nlc3QgZmxvb3IgdW5kZXIgdGhlIGNhbWVyYSAqLwoJb3B0aW9uYWwgaW50MzIgZ3JvdXAgPSA0OyAgLyogZmxvb3IgaW5kZXggKi8KCW9wdGlvbmFsIGludDMyIHN1Ymdyb3VwID0gNTsgIC8qIHJvb20gaW5kZXggKi8KCXJlcGVhdGVkIGludDMyIHZpc2libGVzID0gNjsgIC8qIGxpc3Qgb2YgaW5kaWNlcyB0byBhbGwgcHVja3MgdmlzaWJsZSBmcm9tIHRoaXMgcHVjayAqLwoJcmVwZWF0ZWQgZmxvYXQgc2NvcmVzID0gNzsgLyogdXNlZCBhcyBwYXJ0IG9mIHNjb3JpbmcgZnVuY3Rpb24gZm9yIGRldGVybWluaW5nIHdoaWNoIHB1Y2sgdG8gZ28gdG8gbmV4dCAqLwogIG9wdGlvbmFsIHN0cmluZyBzd2VlcF9uYW1lID0gODsKCiAgLy8gV2l0aCBvdXRkb29yIHBhbm9zLCB3ZSBoYXZlIGEgY291cGxlIG9mIGRpZmZlcmVudCBzaXR1YXRpb25zIGZvciBhbGlnbm1lbnQuIFRoZSBjb21tb24KICAvLyBjYXNlIGlzIHRoYXQgdGhlIHBhbm8gYWxpZ25lZCBub3JtYWxseS4gSXQgY291bGQgYWxzbyBoYXZlIGJlZW4gcGxhY2VkIG1hbnVhbGx5IGluCiAgLy8gQ2FwdHVyZUFwcCBvciBXb3Jrc2hvcCwgb3IgbGVmdCB1bmFsaWduZWQgZm9yIGhpZ2hsaWdodC1yZWVsIHZpZXdpbmcuCiAgZW51bSBBbGlnbm1lbnRUeXBlCiAgewogICAgICBVTktOT1dOID0gMDsKICAgICAgQUxJR05FRCA9IDE7CiAgICAgIFVOQUxJR05FRCA9IDI7CiAgICAgIE1BTlVBTExZX1BMQUNFRCA9IDM7CiAgfQogIG9wdGlvbmFsIEFsaWdubWVudFR5cGUgYWxpZ25tZW50X3R5cGUgPSA5IFtkZWZhdWx0ID0gQUxJR05FRF07Cn0KCm1lc3NhZ2UgU3ViZ3JvdXBJbmZvIHsKCW9wdGlvbmFsIGludDMyIHN1Ymdyb3VwID0gMTsKCW9wdGlvbmFsIGZsb2F0IGFyZWEgPSAyOyAvKiBmbG9vciBhcmVhIGluIG1eMiAoc3F1YXJlIG1ldGVyYWdlKSAqLwp9CgovKiBBbGwgcHVja3MgaW4gYSBtb2RlbC4gUHVja3MgYXJlIHN0b3JlZCBpbiBzY2FubmluZyBvcmRlci4gKi8KbWVzc2FnZSBWaXNpb25Nb2RlbGRhdGEgewoJcmVwZWF0ZWQgU3dlZXBMb2NhdGlvbiBzd2VlcExvY2F0aW9ucyA9IDE7CglyZXBlYXRlZCBTdWJncm91cEluZm8gc3ViZ3JvdXBJbmZvcyA9IDI7Cn0K", "base64")
  12768. , n = o.loadProto(t);
  12769. this.decoder = n.build("VisionModeldata")
  12770. }
  12771. var o = e("protobufjs")
  12772. , a = e("../util/ajax")
  12773. , s = (e("../util/common"),
  12774. e("../util/math"))
  12775. , l = e("../util/logger")
  12776. , c = new l(n);
  12777. r.prototype.load = function() {
  12778. return this.modelDataPath ? (c.info("Using vision.modeldata"),
  12779. this.loadVisionModelData()) : this.sweepLocationsPath ? (c.warn("Using sweep_locations.csv"),
  12780. this.loadSweepLocationsCSV()) : (c.warn("No sweep file found"),
  12781. $.when([]))
  12782. }
  12783. ,
  12784. r.prototype.loadVisionModelData = function() {
  12785. return a.get(this.modelDataPath, {
  12786. responseType: "arraybuffer"
  12787. }).then(function(e) {
  12788. var t;
  12789. try {
  12790. t = this.decoder.decode(e)
  12791. } catch (e) {
  12792. return c.warn("Could not decode vision.modeldata, trying sweep_locations.csv"),
  12793. this.loadSweepLocationsCSV()
  12794. }
  12795. var i = t.sweepLocations.map(function(e) {
  12796. return {
  12797. uuid: e.uuid.toUTF8().replace(/-/g, ""),
  12798. position: {
  12799. x: e.pose.translation.x,
  12800. y: e.pose.translation.y,
  12801. z: e.pose.translation.z
  12802. },
  12803. quaternion: {
  12804. x: e.pose.rotation.x,
  12805. y: e.pose.rotation.y,
  12806. z: e.pose.rotation.z,
  12807. w: e.pose.rotation.w
  12808. },
  12809. puck: {
  12810. x: e.puck.x,
  12811. y: e.puck.y,
  12812. z: e.puck.z
  12813. },
  12814. floor: e.group,
  12815. neighbours: e.visibles,
  12816. alignmentType: e.alignment_type
  12817. }
  12818. }).map(function(e) {
  12819. return e.position = s.convertVisionVector(e.position),
  12820. e.quaternion = s.convertVisionQuaternion(e.quaternion),
  12821. e.puck = s.convertVisionVector(e.puck),
  12822. e
  12823. });
  12824. return i.forEach(function(e) {
  12825. e.neighbours = e.neighbours.map(function(e) {
  12826. return i[e].uuid
  12827. })
  12828. }),
  12829. i
  12830. }
  12831. .bind(this), function() {
  12832. return c.warn("Could not load vision.modeldata, trying sweep_locations.csv"),
  12833. this.loadSweepLocationsCSV()
  12834. }
  12835. .bind(this))
  12836. }
  12837. ,
  12838. r.prototype.loadSweepLocationsCSV = function() {
  12839. return a.get(this.sweepLocationsPath).then(function(e) {
  12840. var t = e.split("\n").map(function(e) {
  12841. return e.split(", ")
  12842. }).filter(function(e) {
  12843. return e.length > 1
  12844. }).map(function(e) {
  12845. return {
  12846. uuid: e[0],
  12847. position: {
  12848. x: parseFloat(e[1]),
  12849. y: parseFloat(e[2]),
  12850. z: parseFloat(e[3])
  12851. },
  12852. quaternion: {
  12853. x: parseFloat(e[4]),
  12854. y: parseFloat(e[5]),
  12855. z: parseFloat(e[6]),
  12856. w: parseFloat(e[7])
  12857. }
  12858. }
  12859. }).map(function(e) {
  12860. return e.position = s.convertVisionVector(e.position),
  12861. e.quaternion = s.convertVisionQuaternion(e.quaternion),
  12862. e
  12863. });
  12864. return t
  12865. }).fail(function() {
  12866. c.warn("Could not load sweep_locations.csv, no sweeps loaded.")
  12867. })
  12868. }
  12869. ,
  12870. t.exports = r
  12871. }
  12872. ).call(this, e("buffer").Buffer, "/js/loaders/SweepDataLoader.js")
  12873. }
  12874. , {
  12875. "../util/ajax": 181,
  12876. "../util/common": 185,
  12877. "../util/logger": 189,
  12878. "../util/math": 190,
  12879. buffer: 198,
  12880. protobufjs: 214
  12881. }],
  12882. 108: [function(e, t, i) {
  12883. (function(i) {
  12884. "use strict";
  12885. function n() {
  12886. this.locale = null
  12887. }
  12888. var r = e("../settings")
  12889. , o = e("../util/common")
  12890. , a = e("../util/logger")
  12891. , s = e("../enum/Locale")
  12892. , l = new a(i);
  12893. n.prototype.init = function() {
  12894. var t;
  12895. switch (r.languageTag) {
  12896. case null:
  12897. case "en":
  12898. case s.EN_US:
  12899. this.locale = s.EN_US,
  12900. t = e("./strings-en-US");
  12901. break;
  12902. case "es":
  12903. case s.ES_MX:
  12904. this.locale = s.ES_MX,
  12905. t = e("./strings-es-MX");
  12906. break;
  12907. case "fr":
  12908. case s.FR_FR:
  12909. this.locale = s.FR_FR,
  12910. t = e("./strings-fr-FR");
  12911. break;
  12912. case "de":
  12913. case s.DE_DE:
  12914. this.locale = s.DE_DE,
  12915. t = e("./strings-de-DE");
  12916. break;
  12917. case "ru":
  12918. case s.RU_RU:
  12919. this.locale = s.RU_RU,
  12920. t = e("./strings-ru-RU");
  12921. break;
  12922. case "cn":
  12923. case s.CN_CN:
  12924. this.locale = s.CN_CN,
  12925. t = e("./strings-cn-CN");
  12926. break;
  12927. case "jp":
  12928. case s.JP_JP:
  12929. this.locale = s.JP_JP,
  12930. t = e("./strings-jp-JP");
  12931. break;
  12932. default:
  12933. l.info("Unsupported language tag, defaulting to 'en-US'"),
  12934. this.locale = s.EN_US,
  12935. t = e("./strings-en-US")
  12936. }
  12937. l.info("Using locale '" + this.locale + "'"),
  12938. o.extendObject(this, t)
  12939. }
  12940. ,
  12941. n.prototype.localizeGUI = function() {
  12942. var e = document.querySelector("#gui-parent");
  12943. this.localizeTree(e),
  12944. this.localizeLoadingText()
  12945. }
  12946. ,
  12947. n.prototype.localizeLoadingText = function() {
  12948. // var e = document.querySelector("#loader-cont")
  12949. // , t = e.getAttribute("title");
  12950. // e.removeAttribute("title"),
  12951. // e.setAttribute("data-status", t),
  12952. // e.classList.add(this.locale),
  12953. document.querySelector("#help-dialog").classList.add(this.locale),
  12954. document.querySelector("#interaction-modal").classList.add(this.locale),
  12955. document.querySelector("#gui").classList.add(this.locale);
  12956. }
  12957. ,
  12958. n.prototype.localizeTree = function(e) {
  12959. var t, i, n = /{\[{ ?(\w+) ?}\]}/;
  12960. if (e.nodeType === Node.TEXT_NODE)
  12961. t = e.data.match(n),
  12962. t && (i = t[1],
  12963. e.data = this.localizeText(i) || i);
  12964. else if (e.nodeType === Node.ELEMENT_NODE) {
  12965. var r = e.getAttribute("title");
  12966. r && (t = r.match(n),
  12967. t && (i = t[1],
  12968. e.setAttribute("title", this.localizeText(i) || i)))
  12969. }
  12970. for (e = e.firstChild; e; )
  12971. this.localizeTree(e),
  12972. e = e.nextSibling
  12973. }
  12974. ,
  12975. n.prototype.localizeText = function(t) {
  12976. var i = this[t];
  12977. return i || this.locale === s.EN_US || (l.warn("Localization key '" + t + "' not available for locale '" + this.locale + "', defaulting to English."),
  12978. i = e("./strings-en-US")[t]),
  12979. i || l.warn("Localization key '" + t + "' not available for locale 'en-US'"),
  12980. i
  12981. }
  12982. ,
  12983. t.exports = new n
  12984. }
  12985. ).call(this, "/js/localization/localize.js")
  12986. }
  12987. , {
  12988. "../enum/Locale": 31,
  12989. "../settings": 166,
  12990. "../util/common": 185,
  12991. "../util/logger": 189,
  12992. "./strings-cn-CN": 109,
  12993. "./strings-de-DE": 110,
  12994. "./strings-en-US": 111,
  12995. "./strings-es-MX": 112,
  12996. "./strings-fr-FR": 113,
  12997. "./strings-jp-JP": 114,
  12998. "./strings-ru-RU": 115
  12999. }],
  13000. 109: [function(e, t, i) {
  13001. "use strict";
  13002. t.exports = {
  13003. PAGE_TITLE: "",
  13004. LOADING: "正在加载",
  13005. PRESENTED_BY_CAPS: "呈现者:",
  13006. POWERED_BY: "技术支持:",
  13007. POWERED_BY_CAPS: "技术支持:",
  13008. DESKTOP_SHORT_CTA: "点击一次以探索这个 3D 空间。",
  13009. MOBILE_SHORT_CTA: "点击一次以探索这个 3D 空间。",
  13010. PRESENTED_BY: "呈现者:",
  13011. MORE: "更多 ",
  13012. LESS: "更少 ",
  13013. TAG_CONTENT: "tag™ 内容",
  13014. SHOW: "显示",
  13015. HIDE: "隐藏",
  13016. DOLLHOUSE: "场景屋",
  13017. FLOOR_PLAN: "楼层平面图",
  13018. OPEN_HIGHLIGHTS: "打开精彩片段",
  13019. CLOSE_HIGHLIGHTS: "关闭",
  13020. PREVIOUS: "上一个",
  13021. PLAY: "播放",
  13022. PAUSE: "暂停",
  13023. NEXT: "下一个",
  13024. EXPLORE_3D_SPACE: "探索 3D 空间",
  13025. VIEW_DOLLHOUSE: "观看场景屋",
  13026. SOCIAL_SHARING: "分享这个空间",
  13027. VIEW_IN_VR: "以 VR 观看",
  13028. VIEW_FULLSCREEN: "全屏观看",
  13029. EXIT_FULLSCREEN: " 退出全屏",
  13030. ZOOM_IN: "放大",
  13031. ZOOM_OUT: "缩小",
  13032. FLOOR_NAME: "楼层",
  13033. FLOOR_ALL: "ALL",
  13034. FLOOR_Lang: ["Floor",""],
  13035. TERMS: "条款",
  13036. PORT_TERMS: "port 条款",
  13037. TERMS_OF_USE: "使用条款",
  13038. CLOSE_TERMS: "关闭",
  13039. TERMS_TEXT_FILE: "terms-cn-CN.html",
  13040. TERMS_FAIL: "无法获取条款。请确保您有互联网连接以查看使用条款。",
  13041. WEBVR_FOR_DAYDREAM: "用于 Daydream 视图",
  13042. WEBVR_ENTER_WEBVR: "进入 VR",
  13043. WEBVR_DIFFERENT_HEADSET: "有其他耳机吗?",
  13044. WEBVR_LEARN_MORE: "了解更多",
  13045. WEBVR_VIEW_SPACE: "在 VR 中观看空间",
  13046. WEBVR_DAYDREAM_VIEW: "Daydream 视图",
  13047. WEBVR_DAYDREAM_PHONE: "支持 Daydream 的手机",
  13048. WEBVR_FOR_CARDBOARD: "用于 Google Cardboard",
  13049. WEBVR_VIEW_CARDBOARD: "或在 Google Cardboard 上观看",
  13050. VR_VIEW_SPACE: "在虚拟现实中观看空间",
  13051. VR_LEARN_MORE_CAPS: "了解更多",
  13052. VR_PREVIOUS_CAPS: "上一个’,",
  13053. VR_NEXT_CAPS: "下一个",
  13054. VR_GOT_IT_CAPS: "明白了",
  13055. VR_SHOW_SUPPORTED: "点击以使用 VR 观看空间",
  13056. VR_SHOW_UNSUPPORTED: "很遗憾,您的设备不符合在 VR 中观看空间的最低要求。",
  13057. VR_SHOW_IOS_1: "点击以使用 VR 观看空间",
  13058. VR_SHOW_IOS_2: "需要有 port VR 应用程序和兼容的 iPhone 才能观看",
  13059. VR_WHAT_YOU_NEED: "关于...您需要什么",
  13060. VR_NEED_CARDBOARD: "您使用 Google Cardboard 时需要什么",
  13061. VR_NEED_SAMSUNG: "您使用 Samsung Gear VR 时需要什么",
  13062. VR_NEED_DAYDREAM: "需要事先与 DAYDREAM VIEW 配对",
  13063. VR_NEED_DAYDREAM_PHONE: "支持 Daydream 的手机",
  13064. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13065. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13066. VR_APP: "port VR 应用程序",
  13067. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13068. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13069. VR_COMPATIBLE_IPHONES_2: "iPhone 5s 和更高版本,运行 iOS 9.1 和更高版本",
  13070. VR_COMPATIBLE_IPHONES_3: "兼容的 iPhone",
  13071. VR_COMPATIBLE_ANDROID: "兼容的 Android 设备",
  13072. VR_COMPATIBLE_ANDROID_LONG: "4.5-5.5 英寸、运行 Android OS 4.4.4 和更高版本的兼容型 Android 设备显示屏",
  13073. VR_ANDROID_DETAIL: "4.5 至 5.5 英寸、运行 Android OS 4.4.4 和更高版本的显示屏",
  13074. VR_ANDROID_DVICES: "Android 设备",
  13075. VR_COMPATIBLE_SAMSUNG: "兼容的 Samsung 设备",
  13076. VR_SAMSUNG_DETAIL: "Galaxy S6 和更高版本",
  13077. VR_APP_FOR_CARDBOARD: "用于 Google Cardboard 的 port VR 应用程序",
  13078. VR_APP_FOR_SAMSUNG: "用于 Gear VR 的 port VR 应用程序",
  13079. VR_APP_FOR_ANDROID: "用于 Android 手机的 port VR 应用程序",
  13080. VR_APP_OPEN: "请使用 port VR 应用程序打开",
  13081. VR_DOWNLOAD_HERE: "在此下载",
  13082. VR_REQUIRE_HEADSET: "需要一副 VR 耳机并安装用于 Android 的 port VR 应用程序",
  13083. VR_REDIRECT_TO_STORE: "如果未安装应用程序,您将跳转到应用程序商店。",
  13084. VR_IMPROPER_EMBED: "port 空间未正确嵌入,无法在您的 Web 浏览器支持 VR。",
  13085. VR_OPEN_ANDROID_LINK: "在您的手机上打开链接",
  13086. VR_ANDROID_OPTIONS: "可用的 VR 耳机选项",
  13087. SHARE_TO: "分享到",
  13088. SHARE_LINK: "直接链接",
  13089. SHARE_EXPLORE: "探索",
  13090. SHARE_AT: "在",
  13091. SHARE_WITH: "使用",
  13092. SHARE_3D: "以 3D",
  13093. SHARE_COPIED: "已复制!",
  13094. ERROR_BROWSER_SOLUTION: "安装更新的浏览器以探索 3D。",
  13095. ERROR_BROWSER_EXPLANATION: "WebGL 需要现代的浏览器。",
  13096. ERROR_GENERIC_PROBLEM: "糟糕,出现问题。",
  13097. ERROR_GENERIC_SOLUTION: "重新启动您的浏览器。",
  13098. ERROR_GENERIC_ACTIONS_1: "如果问题仍然存在,",
  13099. ERROR_GENERIC_ACTIONS_2: "请安装支持的浏览器",
  13100. ERROR_GENERIC_ACTIONS_3: " 或",
  13101. ERROR_GENERIC_ACTIONS_4: "查看我们的故障排除指南",
  13102. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "浏览器不受支持。",
  13103. ERROR_WEBGL_IOS_PROBLEM: "iOS 版本不受支持。",
  13104. ERROR_WEBGL_IOS_SOLUTION: "升级到 iOS 8 或更高版本以在 3D 中探索。",
  13105. ERROR_WEBGL_IOS_ACTIONS_1: "点击 ",
  13106. ERROR_WEBGL_IOS_ACTIONS_2: "设置 > 通用 > 软件更新",
  13107. ERROR_WEBGL_SAFARI_PROBLEM: "启用 WebGL 以在 3D 中探索。",
  13108. ERROR_WEBGL_SAFARI_ACTIONS_1: "单击",
  13109. ERROR_WEBGL_SAFARI_ACTIONS_2: "菜单栏中的首选项 > 高级 > 显示开发菜单",
  13110. ERROR_WEBGL_SAFARI_ACTIONS_3: "然后单击",
  13111. ERROR_WEBGL_SAFARI_ACTIONS_4: "开发 > 启用 WebGL",
  13112. ERROR_MISSING_URLS_PROBLEM: "糟糕,没有此模型的全景。",
  13113. ERROR_MISSING_URLS_EXPLANATION: "这是较早的模型。网站所有者可能正在开发一种新模型。",
  13114. ERROR_LOADING_FAILED_PROBLEM: "糟糕,模式不可用。",
  13115. ERROR_LOADING_FAILED_ACTIONS_1: "如果问题仍然存在,",
  13116. ERROR_LOADING_FAILED_ACTIONS_2: "查看我们的故障排除指南",
  13117. ERROR_MAINTENANCE_PROBLEM: "正在进行维护",
  13118. ERROR_MAINTENANCE_SOLUTION: "请过几分钟再来。",
  13119. LINK_TO_LOCATION: "地点链接",
  13120. MENU_COPY: "复制",
  13121. LINK_ALERT_COPY: "请使用 CTRL/CMD + C 复制。",
  13122. ROTATE: "旋转",
  13123. MOVE: "移动",
  13124. INSIDE: "内部",
  13125. ZOOM: "缩放",
  13126. HELP: "小帮手",
  13127. HELP_NAVIGATION_TAB: "导航",
  13128. HELP_MORE_HELP_TAB: "更多帮助",
  13129. HELP_DESKTOP_PANORAMA_1A: "单击并拖动以环顾空间。",
  13130. HELP_DESKTOP_PANORAMA_2A: "单击整个空间内的圆环以四处移动。",
  13131. HELP_DESKTOP_PANORAMA_3A: "使用鼠标滚轮来放大和缩小。",
  13132. HELP_DESKTOP_PANORAMA_1B: "或者,使用箭头键向左向右转。",
  13133. HELP_DESKTOP_PANORAMA_2B: "或者,使用箭头键向前移动和向后移动。",
  13134. HELP_DESKTOP_PANORAMA_3B: "或者,使用加号和减号键来放大和缩小。",
  13135. HELP_DESKTOP_360_2A: "单击内部视图图标以进入空间。",
  13136. HELP_DESKTOP_360_2B: "或者,按 1 号键进入内部视图。 ",
  13137. HELP_DESKTOP_DOLLHOUSE_1A: "左键单击并向左、向右、向上和向下拖动以旋转场景屋。",
  13138. HELP_DESKTOP_DOLLHOUSE_2A: "右键单击并向左、向右、向上和向下拖动以改变场景屋在屏幕上的位置。",
  13139. HELP_DESKTOP_DOLLHOUSE_3A: "使用鼠标滚轮来放大和缩小。",
  13140. HELP_DESKTOP_DOLLHOUSE_1B: "或者,使用箭头键来旋转场景屋。",
  13141. HELP_DESKTOP_FLOORPLAN_1A: "左键单击并向左、向右、向上和向下拖动以改变楼层平面图在屏幕上的位置。",
  13142. HELP_DESKTOP_FLOORPLAN_2A: "右键单击并向左或向右拖动以旋转楼层平面图。",
  13143. HELP_DESKTOP_FLOORPLAN_3A: "使用鼠标滚轮来放大和缩小。",
  13144. HELP_DESKTOP_FLOORPLAN_2B: "或者,使用箭头键以向左或向右旋转。",
  13145. HELP_DESKTOP_FLOORPLAN_3B: "或者,使用箭头键来放大和缩小。",
  13146. HELP_MOBILE_PANORAMA_1: "触摸并拖动以环顾空间。",
  13147. HELP_MOBILE_PANORAMA_2: "点击整个空间内的圆环以四处移动。",
  13148. HELP_MOBILE_3: "使用捏合手势来放大和缩小。",
  13149. HELP_MOBILE_360_2: "点击内部视图图标以进入空间。",
  13150. HELP_MOBILE_DOLLHOUSE_1: "触摸并向上、向下、向左和向右拖动以旋转场景屋。",
  13151. HELP_MOBILE_DOLLHOUSE_2: "用两指触摸并拖动以定位场景屋。",
  13152. HELP_MOBILE_FLOORPLAN_1: "触摸并拖动以定位楼层平面图。",
  13153. HELP_MOBILE_FLOORPLAN_2: "用两指触摸并拖动以旋转楼层平面图。",
  13154. HELP_MORE_HLR_A: "精彩片段集锦",
  13155. HELP_DESKTOP_MORE_HLR_B: "打开以使用缩略图图像在空间中流览。",
  13156. HELP_MORE_DOLLHOUSE_A: "场景屋",
  13157. HELP_DESKTOP_MORE_DOLLHOUSE_B: "单击以查看和旋转 3D 内整个空间的俯视图。",
  13158. HELP_MOBILE_MORE_DOLLHOUSE_B: "点击以查看和旋转 3D 内整个空间的俯视图。",
  13159. HELP_MORE_FLOORS_A: "楼层选择器",
  13160. HELP_DESKTOP_MORE_FLOORS_B: "在空间中的楼层之间切换。",
  13161. HELP_MORE_TAG_A: "tag™ 贴文",
  13162. HELP_DESKTOP_MORE_TAG_B: "单击或悬停鼠标以查看空间中的功能信息。",
  13163. HELP_MOBILE_MORE_TAG_B: "点击以查看空间中的功能信息。",
  13164. HELP_MORE_ZOOM_A: "缩放控件",
  13165. HELP_DESKTOP_MORE_ZOOM_B: "使用这些控件来放大和缩小或使用滚轮。",
  13166. HELP_MORE_TOUR_A: "导览控件",
  13167. HELP_DESKTOP_MORE_TOUR_B: "通过导览播放、暂停以及向前和向后流览。",
  13168. HELP_MORE_INSIDE_A: "内部视图",
  13169. HELP_DESKTOP_MORE_INSIDE_B: "单击以探索空间内部。",
  13170. HELP_MOBILE_MORE_INSIDE_B: "点击以探索空间内部。",
  13171. HELP_MORE_VR_A: "VR 模式",
  13172. HELP_DESKTOP_MORE_VR_B: "单击以在虚拟现实中启动空间。",
  13173. HELP_MOBILE_MORE_VR_B: "点击以在虚拟现实中启动空间。",
  13174. HELP_MORE_360_A: "360° 视图",
  13175. HELP_DESKTOP_MORE_360_B: "单击精彩片段集锦中的 360 视图中以观看室外场景。",
  13176. HELP_MOBILE_MORE_360_B: "点击精彩片段集锦中的 360 视图中以观看室外场景。",
  13177. HELP_MORE_FULLSCREEN_A: "全屏",
  13178. HELP_DESKTOP_MORE_FULLSCREEN_B: "将 3D Showcase 扩展到全屏。",
  13179. CLOSE: "关闭"
  13180. }
  13181. }
  13182. , {}],
  13183. 110: [function(e, t, i) {
  13184. "use strict";
  13185. t.exports = {
  13186. PAGE_TITLE: "",
  13187. LOADING: "Lädt",
  13188. PRESENTED_BY_CAPS: "PRÄSENTIERT VON",
  13189. POWERED_BY: "Angetrieben von",
  13190. POWERED_BY_CAPS: "ANGETRIEBEN VON",
  13191. DESKTOP_SHORT_CTA: "Sehen sie sich in diesem 3D Raum um.",
  13192. MOBILE_SHORT_CTA: "Sehen sie sich in diesem 3D Raum um.",
  13193. PRESENTED_BY: "Präsentiert von ",
  13194. MORE: "Mehr ",
  13195. LESS: "Weniger ",
  13196. TAG_CONTENT: "tag™ Inhalt",
  13197. SHOW: "Anzeigen",
  13198. HIDE: "Verbergen",
  13199. DOLLHOUSE: "Puppenhaus",
  13200. FLOOR_PLAN: "Grundriss",
  13201. OPEN_HIGHLIGHTS: "Highlights anzeigen",
  13202. CLOSE_HIGHLIGHTS: "Schließen",
  13203. PREVIOUS: "Vorheriges",
  13204. PLAY: "Abspielen",
  13205. PAUSE: "Pausieren",
  13206. NEXT: "Nächstes",
  13207. EXPLORE_3D_SPACE: "Innenraum betreten",
  13208. VIEW_DOLLHOUSE: "Puppenhaus ansehen",
  13209. SOCIAL_SHARING: "Teilen Sie diesen Raum",
  13210. VIEW_IN_VR: "In VR ansehen",
  13211. VIEW_FULLSCREEN: "Ansicht im Vollbildmodus",
  13212. EXIT_FULLSCREEN: "Beenden des Vollbildmodus",
  13213. ZOOM_IN: "Vergrößern",
  13214. ZOOM_OUT: "Verkleinern",
  13215. FLOOR_NAME: "Etage ",
  13216. FLOOR_ALL: "Alle",
  13217. TERMS: "Bedingungen",
  13218. PORT_TERMS: "port Bedingungen",
  13219. TERMS_OF_USE: "Nutzungsbedingungen",
  13220. TERMS_TEXT_FILE: "terms-de-DE.html",
  13221. CLOSE_TERMS: "Schließen",
  13222. TERMS_FAIL: "Konnte die Nutzungsbedingungen nicht abrufen. Bitte stellen Sie sicher, dass Sie zum Internet verbunden sind.",
  13223. HELP: "Hilfe",
  13224. HELP_NAVIGATION_TAB: "Navigation",
  13225. HELP_MORE_HELP_TAB: "Hilfe-Details",
  13226. CLOSE: "Schließen",
  13227. HELP_DESKTOP_PANORAMA_1A: "Klicken und ziehen Sie um sich im Raum umzusehen.",
  13228. HELP_DESKTOP_PANORAMA_2A: "Klicken Sie auf die Ringe im Raum um sich zu bewegen.",
  13229. HELP_DESKTOP_PANORAMA_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  13230. HELP_DESKTOP_PANORAMA_1B: "Oder verwenden Sie die Pfeiltasten um sich nach links und rechts zu bewegen.",
  13231. HELP_DESKTOP_PANORAMA_2B: "Oder verwenden Sie die Pfeiltasten um sich vorwärts und rückwärts zubewegen.",
  13232. HELP_DESKTOP_PANORAMA_3B: "Oder verwenden Sie die Plus- und Minus-Tasten zum Vergrößern und Verkleinern.",
  13233. HELP_DESKTOP_360_2A: "Klicken Sie die Innenansicht ikone, um diesen Raum zu starten .",
  13234. HELP_DESKTOP_360_2B: "Oder, drücken Sie die 1-Taste um die Innenraumansicht zu starten.",
  13235. HELP_DESKTOP_DOLLHOUSE_1A: "Klicken Sie mit der linken Maustaste und ziehen Sie nach links, rechts, oben und unten um das Puppenhaus zu drehen.",
  13236. 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.",
  13237. HELP_DESKTOP_DOLLHOUSE_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  13238. HELP_DESKTOP_DOLLHOUSE_1B: "Oder verwenden Sie die Pfeiltasten um das Puppenhaus zu drehen.",
  13239. 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.",
  13240. HELP_DESKTOP_FLOORPLAN_2A: "Klicken Sie mit der rechten Maustaste und ziehen Sie nach links oder rechts um den Grundriss zu drehen.",
  13241. HELP_DESKTOP_FLOORPLAN_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  13242. HELP_DESKTOP_FLOORPLAN_2B: "Oder verwenden Sie die Pfeiltasten um das Modell nach links oder rechts zu drehen.",
  13243. HELP_DESKTOP_FLOORPLAN_3B: "Oder verwenden Sie die Pfeiltasten zum Vergrößern und Verkleinern.",
  13244. HELP_MOBILE_PANORAMA_1: "Berühren und ziehen an dem Raum um sich umzusehen.",
  13245. HELP_MOBILE_PANORAMA_2: "Klicken Sie auf die Ringe im Raum, um sich zu bewegen.",
  13246. HELP_MOBILE_3: "Benutzen Sie die Zoom-Gäste zum Vergrößern und Verkleinern.",
  13247. HELP_MOBILE_360_2: "Tippen Sie die Innenansicht ikone, um diesen Raum zu starten.",
  13248. HELP_MOBILE_DOLLHOUSE_1: "Berühren und nach oben, unten, links und rechts ziehen um das Puppenhaus zu drehen.",
  13249. HELP_MOBILE_DOLLHOUSE_2: "Berühren und mit zwei Fingern ziehen um das Puppenhaus zu positionieren.",
  13250. HELP_MOBILE_FLOORPLAN_1: "Berühren und ziehen, um den Grundriss zu positionieren.",
  13251. HELP_MOBILE_FLOORPLAN_2: "Berühren und ziehen mit zwei Fingern, um den Grundriss zu drehen.",
  13252. HELP_MORE_HLR_A: "Liste das Highlight",
  13253. HELP_DESKTOP_MORE_HLR_B: "Öffnen um durch den Raum mit Vorschau-Bildern zu navigieren.",
  13254. HELP_MORE_DOLLHOUSE_A: "Puppenhaus Ansicht",
  13255. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Klicken Sie um die von oben nach unten Sicht des gesamten Raumes in 3D anzuzeigen und zu drehen.",
  13256. HELP_MOBILE_MORE_DOLLHOUSE_B: "Tippen Sie um die von oben nach unten Sicht des gesamten Raumes in 3D anzuzeigen und zu drehen.",
  13257. HELP_MORE_FLOORS_A: "Etage auswählen",
  13258. HELP_DESKTOP_MORE_FLOORS_B: "Zwischen den Etagen im Raum wechseln.",
  13259. HELP_MORE_TAG_A: "tag™ Posts",
  13260. HELP_DESKTOP_MORE_TAG_B: "Klicken Sie auf oder bewegen Sie Ihren Mauszeiger über die Informationen über die Funktionen im Raum.",
  13261. HELP_MOBILE_MORE_TAG_B: "Tippen Sie für Informationen über die Funktionen im Raum.",
  13262. HELP_MORE_ZOOM_A: "Zoom Steuerung",
  13263. HELP_DESKTOP_MORE_ZOOM_B: "Verwenden Sie diese Steuerung oder das Scrollrad zum Vergrößern und Verkleinern.",
  13264. HELP_MORE_TOUR_A: "Tour Steuerung",
  13265. HELP_DESKTOP_MORE_TOUR_B: "Abspielen, pausieren und vorwärts und rückwärts durch eine geführte Tour navigieren.",
  13266. HELP_MORE_INSIDE_A: "Innenansicht",
  13267. HELP_DESKTOP_MORE_INSIDE_B: "Klicken Sie hier um sich im Raum umzusehen.",
  13268. HELP_MOBILE_MORE_INSIDE_B: "Sehen Sie sich in diesen 3D Raum um.",
  13269. HELP_MORE_VR_A: "VR Modus",
  13270. HELP_DESKTOP_MORE_VR_B: "Klicken Sie hier, um den Raum in der virtuellen Realität zu starten.",
  13271. HELP_MOBILE_MORE_VR_B: "Tippen Sie um den Raum in der virtuellen Realität zu starten.",
  13272. HELP_MORE_360_A: "360° Views Ansicht ",
  13273. HELP_DESKTOP_MORE_360_B: "Klicken Sie die 360° Views Ansicht in das Highlight um Aussen-Szenen zu sehen.",
  13274. HELP_MOBILE_MORE_360_B: "Tippen Sie die 360° Views Ansicht in das Highlight um Aussen-Szenen zu sehen.",
  13275. HELP_MORE_FULLSCREEN_A: "Vollbild",
  13276. HELP_DESKTOP_MORE_FULLSCREEN_B: "Erweitern Sie 3D Showcase im Vollbildmodus.",
  13277. WEBVR_FOR_CARDBOARD: "Für Google Cardboard",
  13278. WEBVR_FOR_DAYDREAM: "Für Daydream View",
  13279. WEBVR_ENTER_WEBVR: "Starten Sie VR",
  13280. WEBVR_DIFFERENT_HEADSET: "Haben Sie anderes Headset?",
  13281. WEBVR_LEARN_MORE: "Mehr Infos",
  13282. WEBVR_VIEW_SPACE: "Ansicht des Raumes in VR",
  13283. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13284. WEBVR_DAYDREAM_PHONE: "Daydream-fähiges Handy",
  13285. WEBVR_VIEW_CARDBOARD: "Oder mit Google Cardboard ansehen",
  13286. VR_WHAT_YOU_NEED: "Was Sie dafür brauchen...",
  13287. VR_NEED_DAYDREAM_PHONE: "Daydream-fähiges Handy",
  13288. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13289. VR_APP: "port VR App",
  13290. VR_APP_OPEN: "Oder öffnen Sie die port VR App",
  13291. 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",
  13292. VR_SAMSUNG_DETAIL: "Galaxy S6 und neuer",
  13293. VR_APP_FOR_ANDROID: "port VR app für Android",
  13294. VR_NEED_DAYDREAM: "ERFORDERT VOR DER 'PAIRING' MIT DAYDREAM VIEW",
  13295. VR_VIEW_SPACE: "Ansicht des Raumes in VR",
  13296. VR_LEARN_MORE_CAPS: "MEHR INFOS",
  13297. VR_PREVIOUS_CAPS: "ZURÜCK",
  13298. VR_NEXT_CAPS: "WEITER",
  13299. VR_GOT_IT_CAPS: "VERSTANDEN",
  13300. VR_SHOW_SUPPORTED: "Tippen Sie um den Raum in VR zu sehen",
  13301. VR_SHOW_UNSUPPORTED: "Schade, aber Ihr Gerät erfüllt nicht die Mindestanforderungen um den Raum in VR zu sehen.",
  13302. VR_SHOW_IOS_1: "Tippen Sie um den Raum in VR zu sehen",
  13303. VR_SHOW_IOS_2: "port VR App sowie kompatibles iPhone sind von nöten um diesen Raum zu sehen",
  13304. VR_NEED_CARDBOARD: "Was Sie dafür brauchen ist Google Cardboard",
  13305. VR_NEED_SAMSUNG: "Was Sie dafür brauchen ist Samsung Gear VR",
  13306. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13307. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13308. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13309. VR_COMPATIBLE_IPHONES_2: "iPhone 5s oder neuer, mit iOS 9.1 und später",
  13310. VR_COMPATIBLE_IPHONES_3: "Kompatibles iPhones",
  13311. VR_COMPATIBLE_ANDROID: "Kompatibles Android Gerät",
  13312. VR_ANDROID_DETAIL: "Bildschirmdiagonale von 11,5 bis 14 cm (4,5 - 5,5 Zoll) und Android 4.4.4 und neuer",
  13313. VR_ANDROID_DVICES: "Android Geräte",
  13314. VR_COMPATIBLE_SAMSUNG: "Kompatible Samsung Geräte",
  13315. VR_APP_FOR_CARDBOARD: "port VR App für Google Cardboard",
  13316. VR_APP_FOR_SAMSUNG: "port VR App für Gear VR",
  13317. VR_DOWNLOAD_HERE: "Hier runterladen",
  13318. VR_REQUIRE_HEADSET: "Benötigt das ein VR-Headset und port VR App für Android installiert wird",
  13319. VR_REDIRECT_TO_STORE: "Wenn App nicht installiert ist, werden Sie zum App Store umgeleitet.",
  13320. VR_IMPROPER_EMBED: "Der port Raum ist nicht richtig eingebettet um VR in Ihrem Webbrowser zu unterstützen.",
  13321. VR_OPEN_ANDROID_LINK: "Öffnen Sie den Link auf Ihrem Handy",
  13322. VR_ANDROID_OPTIONS: "VR Headset Optionen",
  13323. SHARE_TO: "Teilen auf",
  13324. SHARE_LINK: "Direkter Link",
  13325. SHARE_EXPLORE: "Umsehen",
  13326. SHARE_AT: "auf",
  13327. SHARE_WITH: "mit",
  13328. SHARE_3D: "in 3D",
  13329. SHARE_COPIED: "Kopiert!",
  13330. ERROR_BROWSER_SOLUTION: "Installieren Sie einen neueren Browser um sich in 3D umzusehen.",
  13331. ERROR_BROWSER_EXPLANATION: "WebGL benötigt einen modernen Browser.",
  13332. ERROR_GENERIC_PROBLEM: "Huch, etwas ist schief gelaufen.",
  13333. ERROR_GENERIC_SOLUTION: "Starten Sie Ihren Browser neu.",
  13334. ERROR_GENERIC_ACTIONS_1: "Wenn das Problem weiterhin besteht, ",
  13335. ERROR_GENERIC_ACTIONS_2: "Installieren Sie einen unterstützten Browser",
  13336. ERROR_GENERIC_ACTIONS_3: " oder ",
  13337. ERROR_GENERIC_ACTIONS_4: "Sehen Sie unseren Leitfaden zur Fehlerbehebung",
  13338. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Browser wird nicht unterstützt.",
  13339. ERROR_WEBGL_IOS_PROBLEM: "iOS-Version wird nicht unterstützt.",
  13340. ERROR_WEBGL_IOS_SOLUTION: "Aktualisieren Sie auf iOS 8 oder neuer um sich in 3D umzusehen.",
  13341. ERROR_WEBGL_IOS_ACTIONS_1: "Tippen ",
  13342. ERROR_WEBGL_IOS_ACTIONS_2: "Einstellungen > Allgemein > Softwareaktualisierung",
  13343. ERROR_WEBGL_SAFARI_PROBLEM: "Aktivieren Sie WebVR um sich in 3D umzusehen.",
  13344. ERROR_WEBGL_SAFARI_ACTIONS_1: "Klicken ",
  13345. ERROR_WEBGL_SAFARI_ACTIONS_2: "Präferenzen > Fortgeschrittene > Entwickler-Menü anzeigen",
  13346. ERROR_WEBGL_SAFARI_ACTIONS_3: "Klicken Sie dann ",
  13347. ERROR_WEBGL_SAFARI_ACTIONS_4: "Entwickler > WebGL Aktivieren",
  13348. ERROR_MISSING_URLS_PROBLEM: "Huch, es gibt keine Panoramen für dieses Modell .",
  13349. ERROR_MISSING_URLS_EXPLANATION: "Dies ist ein älteres Modell. Der Website-Besitzer hat eventuell ein neues Modell in Arbeit.",
  13350. ERROR_LOADING_FAILED_PROBLEM: "Huch, das Modell ist nicht verfügbar.",
  13351. ERROR_LOADING_FAILED_ACTIONS_1: "Wenn das Problem weiterhin besteht, ",
  13352. ERROR_LOADING_FAILED_ACTIONS_2: "sehen Sie unseren Leitfaden zur Fehlerbehebung",
  13353. ERROR_MAINTENANCE_PROBLEM: "Wartung im Gange.",
  13354. ERROR_MAINTENANCE_SOLUTION: "Bitte versuchen Sie es in ein paar Minuten nochmal.",
  13355. LINK_TO_LOCATION: "Link zu",
  13356. MENU_COPY: "Kopieren",
  13357. LINK_ALERT_COPY: "Bitte benutzen Sie CTRL/CMD + C zum kopieren.",
  13358. ROTATE: "Drehen",
  13359. INSIDE: "Drinnen",
  13360. MOVE: "Bewegen",
  13361. ZOOM: "Vergrößern"
  13362. }
  13363. }
  13364. , {}],
  13365. 111: [function(e, t, i) {
  13366. "use strict";
  13367. t.exports = {
  13368. PAGE_TITLE: "",
  13369. LOADING: "Loading",
  13370. PRESENTED_BY_CAPS: "PRESENTED BY",
  13371. POWERED_BY: "powered by ",
  13372. POWERED_BY_CAPS: "POWERED BY",
  13373. DESKTOP_SHORT_CTA: "Click to explore this 3D space.",
  13374. MOBILE_SHORT_CTA: "Tap to explore this 3D space.",
  13375. PRESENTED_BY: "Presented by ",
  13376. MORE: "More ",
  13377. LESS: "Less ",
  13378. TAG_CONTENT: "tag™ Content",
  13379. SHOW: "Show",
  13380. HIDE: "Hide",
  13381. DOLLHOUSE: "Dollhouse",
  13382. FLOOR_PLAN: "Floor plan",
  13383. OPEN_HIGHLIGHTS: "Open Highlights",
  13384. CLOSE_HIGHLIGHTS: "Close",
  13385. PREVIOUS: "Previous",
  13386. PLAY: "Play",
  13387. PAUSE: "Pause",
  13388. NEXT: "Next",
  13389. EXPLORE_3D_SPACE: "Explore 3D Space",
  13390. VIEW_DOLLHOUSE: "View dollhouse",
  13391. SOCIAL_SHARING: "Share this Space",
  13392. VIEW_IN_VR: "View in VR",
  13393. VIEW_FULLSCREEN: "全屏",
  13394. EXIT_FULLSCREEN: "退出全屏",
  13395. ZOOM_IN: "Zoom in",
  13396. ZOOM_OUT: "Zoom out",
  13397. FLOOR_NAME: "Floor ",
  13398. FLOOR_ALL: "全部",
  13399. TERMS: "Terms",
  13400. PORT_TERMS: "port terms",
  13401. TERMS_OF_USE: "Terms of Use",
  13402. TERMS_TEXT_FILE: "terms-en-US.html",
  13403. CLOSE_TERMS: "Close",
  13404. TERMS_FAIL: "Could not fetch terms. Please make sure you have an internet connection to view the terms of use.",
  13405. HELP: "Help",
  13406. HELP_NAVIGATION_TAB: "Navigation",
  13407. HELP_MORE_HELP_TAB: "More Help",
  13408. CLOSE: "Close",
  13409. HELP_DESKTOP_PANORAMA_1A: "Click and Drag to look around the Space.",
  13410. HELP_DESKTOP_PANORAMA_2A: "Click on the rings throughout the space to move around.",
  13411. HELP_DESKTOP_PANORAMA_3A: "Use the scroll wheel to zoom in and out.",
  13412. HELP_DESKTOP_PANORAMA_1B: "Or, use the arrow keys to turn left and right.",
  13413. HELP_DESKTOP_PANORAMA_2B: "Or, use the arrow keys to move forward and back.",
  13414. HELP_DESKTOP_PANORAMA_3B: "Or, use the plus and minus keys to zoom in and out.",
  13415. HELP_DESKTOP_360_2A: "Click the Inside View icon to enter the Space.",
  13416. HELP_DESKTOP_360_2B: "Or, press the number 1 key to enter Inside View.",
  13417. HELP_DESKTOP_DOLLHOUSE_1A: "Left click and drag left, right, up, and down to rotate the Dollhouse.",
  13418. HELP_DESKTOP_DOLLHOUSE_2A: "Right click and drag left, right, up, and down to change the Dollhouse position on screen.",
  13419. HELP_DESKTOP_DOLLHOUSE_3A: "Use the scroll wheel to zoom in and out.",
  13420. HELP_DESKTOP_DOLLHOUSE_1B: "Or, use the arrow keys to rotate the Dollhouse.",
  13421. HELP_DESKTOP_FLOORPLAN_1A: "Left click and drag left, right, up, and down to change the Floorplan position on screen.",
  13422. HELP_DESKTOP_FLOORPLAN_2A: "Right click and drag left or right to rotate the Floorplan.",
  13423. HELP_DESKTOP_FLOORPLAN_3A: "Use the scroll wheel to zoom in and out.",
  13424. HELP_DESKTOP_FLOORPLAN_2B: "Or, use the arrow keys to rotate left or right.",
  13425. HELP_DESKTOP_FLOORPLAN_3B: "Or, use the arrow keys to zoom in and out.",
  13426. HELP_MOBILE_PANORAMA_1: "Touch and Drag to look around the Space.",
  13427. HELP_MOBILE_PANORAMA_2: "Tap on the rings throughout the Space to move around.",
  13428. HELP_MOBILE_3: "Use a pinch gesture to zoom in and out.",
  13429. HELP_MOBILE_360_2: "Tap the Inside View icon to enter the Space.",
  13430. HELP_MOBILE_DOLLHOUSE_1: "Touch and drag up, down, left, and right to rotate the Dollhouse.",
  13431. HELP_MOBILE_DOLLHOUSE_2: "Touch and drag with two fingers to position the Dollhouse.",
  13432. HELP_MOBILE_FLOORPLAN_1: "Touch and drag to position the Floorplan.",
  13433. HELP_MOBILE_FLOORPLAN_2: "Touch and drag with two fingers to rotate the Floorplan.",
  13434. HELP_MORE_HLR_A: "Highlight Reel",
  13435. HELP_DESKTOP_MORE_HLR_B: "Open to navigate through the Space using thumbnail images.",
  13436. HELP_MORE_DOLLHOUSE_A: "Dollhouse View",
  13437. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Click to view and rotate a top-down view of the entire Space in 3D.",
  13438. HELP_MOBILE_MORE_DOLLHOUSE_B: "Tap to view and rotate a top-down view of the entire Space in 3D.",
  13439. HELP_MORE_FLOORS_A: "Floor Selector",
  13440. HELP_DESKTOP_MORE_FLOORS_B: "Switch between floors in the Space.",
  13441. HELP_MORE_TAG_A: "tag™ Posts",
  13442. HELP_DESKTOP_MORE_TAG_B: "Click or hover over for information about features in the Space.",
  13443. HELP_MOBILE_MORE_TAG_B: "Tap for information about features in the Space.",
  13444. HELP_MORE_ZOOM_A: "Zoom Controls",
  13445. HELP_DESKTOP_MORE_ZOOM_B: "Use these controls to zoom in and out or use the scroll wheel.",
  13446. HELP_MORE_TOUR_A: "Tour Controls",
  13447. HELP_DESKTOP_MORE_TOUR_B: "Play, pause, and navigate forward and backward through a Guided Tour.",
  13448. HELP_MORE_INSIDE_A: "Inside View",
  13449. HELP_DESKTOP_MORE_INSIDE_B: "Click to explore inside the Space.",
  13450. HELP_MOBILE_MORE_INSIDE_B: "Tap to explore inside the Space.",
  13451. HELP_MORE_VR_A: "VR Mode",
  13452. HELP_DESKTOP_MORE_VR_B: "Click to launch the Space in virtual reality.",
  13453. HELP_MOBILE_MORE_VR_B: "Tap to launch the Space in virtual reality.",
  13454. HELP_MORE_360_A: "360° Views",
  13455. HELP_DESKTOP_MORE_360_B: "Click 360 Views in the Highlight Reel to view outdoor scenes.",
  13456. HELP_MOBILE_MORE_360_B: "Tap 360 Views in the Highlight Reel to view outdoor scenes.",
  13457. HELP_MORE_FULLSCREEN_A: "Full screen",
  13458. HELP_DESKTOP_MORE_FULLSCREEN_B: "Expand 3D Showcase to full screen.",
  13459. WEBVR_FOR_CARDBOARD: "For Google Cardboard",
  13460. WEBVR_VIEW_CARDBOARD: "Or View on Google Cardboard",
  13461. WEBVR_FOR_DAYDREAM: "For Daydream View",
  13462. WEBVR_ENTER_WEBVR: "ENTER VR",
  13463. WEBVR_DIFFERENT_HEADSET: "Have a different headset?",
  13464. WEBVR_LEARN_MORE: "Learn more",
  13465. WEBVR_VIEW_SPACE: "View Space in VR",
  13466. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13467. WEBVR_DAYDREAM_PHONE: "Daydream-ready phone",
  13468. VR_VIEW_SPACE: "View Space in Virtual Reality",
  13469. VR_LEARN_MORE_CAPS: "LEARN MORE",
  13470. VR_PREVIOUS_CAPS: "PREVIOUS",
  13471. VR_NEXT_CAPS: "NEXT",
  13472. VR_GOT_IT_CAPS: "GOT IT",
  13473. VR_SHOW_SUPPORTED: "Tap to view the Space in VR with",
  13474. VR_SHOW_UNSUPPORTED: "Sorry, but your device doesn't meet the minimum requirements to view a space in VR.",
  13475. VR_SHOW_IOS_1: "Tap to view the space in VR",
  13476. VR_SHOW_IOS_2: "Requires port VR app and compatible iPhone to view",
  13477. VR_WHAT_YOU_NEED: "What You'll Need For...",
  13478. VR_NEED_CARDBOARD: "What you'll need with Google Cardboard",
  13479. VR_NEED_SAMSUNG: "What you'll need with Samsung Gear VR",
  13480. VR_NEED_DAYDREAM: "NEEDS PRIOR PAIRING WITH DAYDREAM VIEW",
  13481. VR_NEED_DAYDREAM_PHONE: "Daydream-ready phone",
  13482. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13483. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13484. VR_APP: "port VR App",
  13485. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13486. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13487. VR_COMPATIBLE_IPHONES_2: "iPhone 5s and newer, running iOS 9.1 and higher",
  13488. VR_COMPATIBLE_IPHONES_3: "Compatible iPhones",
  13489. VR_COMPATIBLE_ANDROID: "Compatible Android Devices",
  13490. VR_COMPATIBLE_ANDROID_LONG: 'Compatible Android Devices Displays from 4.5"-5.5" running Android OS 4.4.4 and higher',
  13491. VR_ANDROID_DETAIL: 'Displays from 4.5"-5.5" running Android OS 4.4.4 and higher',
  13492. VR_ANDROID_DVICES: "Android Devices",
  13493. VR_COMPATIBLE_SAMSUNG: "Compatible Samsung Devices",
  13494. VR_SAMSUNG_DETAIL: "Galaxy S6 and Above",
  13495. VR_APP_FOR_CARDBOARD: "port VR app for Google Cardboard",
  13496. VR_APP_FOR_SAMSUNG: "port VR app for Gear VR",
  13497. VR_APP_FOR_ANDROID: "port VR app for Android Phones",
  13498. VR_APP_OPEN: "Open with the port VR app instead",
  13499. VR_DOWNLOAD_HERE: "Download here",
  13500. VR_REQUIRE_HEADSET: "Requires a VR headset and port VR app for Android to be installed",
  13501. VR_REDIRECT_TO_STORE: "If app is not installed, you will be redirected to the app store.",
  13502. VR_IMPROPER_EMBED: "The port Space is not embedded properly to support VR in your web browser.",
  13503. VR_OPEN_ANDROID_LINK: "Open the Link on Your Mobile Phone",
  13504. VR_ANDROID_OPTIONS: "Available VR Headset Options",
  13505. SHARE_TO: "Share to",
  13506. SHARE_LINK: "Direct Link",
  13507. SHARE_EXPLORE: "Explore ",
  13508. SHARE_AT: "at",
  13509. SHARE_WITH: "with",
  13510. SHARE_3D: " in 3D",
  13511. SHARE_COPIED: "Copied!",
  13512. ERROR_BROWSER_SOLUTION: "Install a new browser to explore in 3D.",
  13513. ERROR_BROWSER_EXPLANATION: "WebGL requires a modern browser.",
  13514. ERROR_GENERIC_PROBLEM: "Oops, something went wrong.",
  13515. ERROR_GENERIC_SOLUTION: "Restart your browser.",
  13516. ERROR_GENERIC_ACTIONS_1: "If the problem persists, ",
  13517. ERROR_GENERIC_ACTIONS_2: "install a supported browser",
  13518. ERROR_GENERIC_ACTIONS_3: " or ",
  13519. ERROR_GENERIC_ACTIONS_4: "see our troubleshooting guide",
  13520. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Browser not supported.",
  13521. ERROR_WEBGL_IOS_PROBLEM: "iOS version not supported.",
  13522. ERROR_WEBGL_IOS_SOLUTION: "Upgrade to iOS 8 or higher to explore in 3D.",
  13523. ERROR_WEBGL_IOS_ACTIONS_1: "Tap ",
  13524. ERROR_WEBGL_IOS_ACTIONS_2: "Settings > General > Software Update",
  13525. ERROR_WEBGL_SAFARI_PROBLEM: "Enable WebGL to explore in 3D.",
  13526. ERROR_WEBGL_SAFARI_ACTIONS_1: "Click ",
  13527. ERROR_WEBGL_SAFARI_ACTIONS_2: "Preferences > Advanced > Show Develop menu",
  13528. ERROR_WEBGL_SAFARI_ACTIONS_3: "Then click ",
  13529. ERROR_WEBGL_SAFARI_ACTIONS_4: "Develop > Enable WebGL",
  13530. ERROR_MISSING_URLS_PROBLEM: "Oops, there are no panoramas for this model.",
  13531. ERROR_MISSING_URLS_EXPLANATION: "This is an older model. The website owner may have a new model on the way.",
  13532. ERROR_LOADING_FAILED_PROBLEM: "模型不可用.",
  13533. ERROR_LOADING_FAILED_ACTIONS_1: "If the problem persists, ",
  13534. ERROR_LOADING_FAILED_ACTIONS_2: "see our troubleshooting guide",
  13535. ERROR_MAINTENANCE_PROBLEM: "Maintenance in progress.",
  13536. ERROR_MAINTENANCE_SOLUTION: "Please come back in a few minutes.",
  13537. LINK_TO_LOCATION: "Link to location",
  13538. MENU_COPY: "Copy",
  13539. LINK_ALERT_COPY: "Please use CTRL/CMD + C to copy.",
  13540. ROTATE: "Rotate",
  13541. INSIDE: "Inside",
  13542. MOVE: "Move",
  13543. ZOOM: "Zoom"
  13544. }
  13545. }
  13546. , {}],
  13547. 112: [function(e, t, i) {
  13548. "use strict";
  13549. t.exports = {
  13550. PAGE_TITLE: "",
  13551. LOADING: "Cargando",
  13552. PRESENTED_BY_CAPS: "PRESENTADO POR",
  13553. POWERED_BY: "potenciando por ",
  13554. POWERED_BY_CAPS: "POTENCIADO POR ",
  13555. DESKTOP_SHORT_CTA: "Haga clic para explorar este Espacio 3D.",
  13556. MOBILE_SHORT_CTA: "Pulse para explorar este Espacio 3D.",
  13557. PRESENTED_BY: "Presentado por ",
  13558. MORE: "Más ",
  13559. LESS: "Menos ",
  13560. TAG_CONTENT: "Contenido de tag™",
  13561. SHOW: "Mostrar",
  13562. HIDE: "Ocultar",
  13563. DOLLHOUSE: "Dollhouse",
  13564. FLOOR_PLAN: "Planos",
  13565. OPEN_HIGHLIGHTS: "Aspectos Destacados",
  13566. CLOSE_HIGHLIGHTS: "Cerrar",
  13567. PREVIOUS: "Anterior",
  13568. PLAY: "Play",
  13569. PAUSE: "Pausa",
  13570. NEXT: "Siguiente",
  13571. EXPLORE_3D_SPACE: "Explorar el Espacio 3D",
  13572. VIEW_DOLLHOUSE: "Ver dollhouse",
  13573. SOCIAL_SHARING: "Compartir este espacio",
  13574. VIEW_IN_VR: "Ver en realidad virtual",
  13575. VIEW_FULLSCREEN: "Ver en pantalla completa",
  13576. EXIT_FULLSCREEN: "Salir de pantalla completa",
  13577. ZOOM_IN: "Acercar",
  13578. ZOOM_OUT: "Alejar",
  13579. FLOOR_NAME: "Piso ",
  13580. FLOOR_ALL: "Todas",
  13581. TERMS: "Condiciones",
  13582. PORT_TERMS: "port términos de uso",
  13583. TERMS_OF_USE: "Términos de uso",
  13584. TERMS_TEXT_FILE: "terms-es-MX.html",
  13585. CLOSE_TERMS: "Cerrar",
  13586. 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.",
  13587. HELP: "Ayuda",
  13588. HELP_NAVIGATION_TAB: "Navegación",
  13589. HELP_MORE_HELP_TAB: "Más Ayuda",
  13590. CLOSE: "Cerrar",
  13591. HELP_DESKTOP_PANORAMA_1A: "Haga clic y arrastre para mirar alrededor del espacio.",
  13592. HELP_DESKTOP_PANORAMA_2A: "Haga clic en los aros a lo largo del espacio para moverse.",
  13593. HELP_DESKTOP_PANORAMA_3A: "Use la rueda de desplazamiento para acercar o alejar.",
  13594. HELP_DESKTOP_PANORAMA_1B: "O use las teclas de flecha para girar a la izquierda y a la derecha.",
  13595. HELP_DESKTOP_PANORAMA_2B: "O use las teclas de dirección para adelantar o retroceder.",
  13596. HELP_DESKTOP_PANORAMA_3B: "O use la tecla más para acercar y la tecla menos para alejar.",
  13597. HELP_DESKTOP_360_2A: "Haga clic en el icono Vista Interior para ingresar al Espacio.",
  13598. HELP_DESKTOP_360_2B: "O bien, presione la tecla numero 1 para entrar en la Vista Interior.",
  13599. HELP_DESKTOP_DOLLHOUSE_1A: "Haga clic izquierdo y arrastre hacia la izquierda, derecha, arriba o abajo para girar la Dollhouse.",
  13600. HELP_DESKTOP_DOLLHOUSE_2A: "Haga clic derecho y arrastre hacia la izquierda, derecha, arriba o abajo para cambiar la posición della dollhouse.",
  13601. HELP_DESKTOP_DOLLHOUSE_3A: "Use la rueda de desplazamiento para acercar o alejar.",
  13602. HELP_DESKTOP_DOLLHOUSE_1B: "O use las teclas de dirección para girar la Dollhouse.",
  13603. 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.",
  13604. HELP_DESKTOP_FLOORPLAN_2A: "Haga clic derecho y arrastre hacia la izquierda o derecha para girar la planta.",
  13605. HELP_DESKTOP_FLOORPLAN_3A: "Use la rueda de desplazamiento para acercar o alejar.",
  13606. HELP_DESKTOP_FLOORPLAN_2B: "O use las teclas para girar hacia la izquierda o derecha.",
  13607. HELP_DESKTOP_FLOORPLAN_3B: "O use las teclas de dirección para acercar o alejar.",
  13608. HELP_MOBILE_PANORAMA_1: "Toque y arrastre para mirar alrededor del espacio.",
  13609. HELP_MOBILE_PANORAMA_2: "Toque en los aros a lo largo del espacio para moverse.",
  13610. HELP_MOBILE_3: "Use el gesto de pellizcar para acercar o alejar.",
  13611. HELP_MOBILE_360_2: "Toque el ícono Vista Interior para entrar en el Espacio.",
  13612. HELP_MOBILE_DOLLHOUSE_1: "Toque y arrastre con dos dedos para cambiar la posición della dollhouse.",
  13613. HELP_MOBILE_DOLLHOUSE_2: "Toque y arrastre con dos dedos para cambiar la posición de la vista aérea.",
  13614. HELP_MOBILE_FLOORPLAN_1: "Toque y arrastre para cambiar la posición de la planta.",
  13615. HELP_MOBILE_FLOORPLAN_2: "Toque y arrastre con dos dedos para girar la planta.",
  13616. HELP_MORE_HLR_A: "Galería destacada",
  13617. HELP_DESKTOP_MORE_HLR_B: "Abra para navegar a través del espacio utilizando imágenes en miniatura.",
  13618. HELP_MORE_DOLLHOUSE_A: "Vista aérea por pisos",
  13619. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Haga clic para ver y girar la Dollhouse del espacio completo en 3D.",
  13620. HELP_MOBILE_MORE_DOLLHOUSE_B: "Toque para ver y girar la vista Dollhouse del espacio completo en 3D.",
  13621. HELP_MORE_FLOORS_A: "Seleccionador de plantas",
  13622. HELP_DESKTOP_MORE_FLOORS_B: "Cambie de una planta a otra en el espacio.",
  13623. HELP_MORE_TAG_A: "tag™ Posts",
  13624. HELP_DESKTOP_MORE_TAG_B: "Haga clic o coloque el cursor para obtener más información acerca de las características del espacio.",
  13625. HELP_MOBILE_MORE_TAG_B: "Toque para obtener más información acerca de las características del espacio.",
  13626. HELP_MORE_ZOOM_A: "Controles de zoom",
  13627. HELP_DESKTOP_MORE_ZOOM_B: "Use estos controles o la rueda de desplazamiento para acercar o alejar.",
  13628. HELP_MORE_TOUR_A: "Controles de recorrido",
  13629. HELP_DESKTOP_MORE_TOUR_B: "Reproduzca, pause, adelante o retroceda a través de un recorrido guiado.",
  13630. HELP_MORE_INSIDE_A: "Vista interior",
  13631. HELP_DESKTOP_MORE_INSIDE_B: "Haga clic para explorar el interior del espacio.",
  13632. HELP_MOBILE_MORE_INSIDE_B: "Toque para explorar el interior del espacio.",
  13633. HELP_MORE_VR_A: "Modo de realidad virtual",
  13634. HELP_DESKTOP_MORE_VR_B: "Toque para ver el espacio en realidad virtual.",
  13635. HELP_MOBILE_MORE_VR_B: "Toque para ver el espacio en realidad virtual.",
  13636. HELP_MORE_360_A: "360° Views",
  13637. HELP_DESKTOP_MORE_360_B: "Una vez que se encuentre en galería destacada, haga clic en vistas de 360º para ver el exterior.",
  13638. HELP_MOBILE_MORE_360_B: "Una vez que se encuentre en galería destacada, toque en vistas de 360º para ver el exterior.",
  13639. HELP_MORE_FULLSCREEN_A: "Pantalla completa",
  13640. HELP_DESKTOP_MORE_FULLSCREEN_B: "Expanda el escenario 3D para verlo en pantalla completa.",
  13641. WEBVR_FOR_CARDBOARD: "Para Google Cardboard",
  13642. WEBVR_FOR_DAYDREAM: "Para Daydream View",
  13643. WEBVR_ENTER_WEBVR: "ENTRAR VR",
  13644. WEBVR_DIFFERENT_HEADSET: "¿Tiene un auricular diferente?",
  13645. WEBVR_LEARN_MORE: "Más información",
  13646. WEBVR_VIEW_SPACE: "Ver Espacio en VR",
  13647. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13648. WEBVR_DAYDREAM_PHONE: "Daydream Teléfono listos",
  13649. WEBVR_VIEW_CARDBOARD: "O Ver en Google Cardboard",
  13650. VR_NEED_DAYDREAM: "Necesidades antes de acoplarse con Daydream View",
  13651. VR_NEED_DAYDREAM_PHONE: "Teléfono listo para Daydream",
  13652. VR_GOOGLE_DAYDREAM: "Daydream de Google",
  13653. VR_APP: "port VR App",
  13654. VR_COMPATIBLE_ANDROID_LONG: 'Compatible con los Dispositivos Android con Pantallas de 4.5"-5.5" operando Android OS 4.4.4 y posteriores',
  13655. VR_APP_FOR_ANDROID: "Aplicación port VR para Teléfonos Android",
  13656. VR_APP_OPEN: "Abrir con la aplicación port VR en su lugar",
  13657. VR_VIEW_SPACE: "Ver Espacio en realidad virtual",
  13658. VR_LEARN_MORE_CAPS: "SABER MÁS",
  13659. VR_PREVIOUS_CAPS: "ANTERIOR",
  13660. VR_NEXT_CAPS: "SIGUIENTE",
  13661. VR_GOT_IT_CAPS: "COMPRENDIDO",
  13662. VR_SHOW_SUPPORTED: "Pulse para ver el Espacio en realidad virtual con",
  13663. VR_SHOW_UNSUPPORTED: "Lo sentimos, pero su dispositivo no cumple los requisitos mínimos para ver un Espacio en realidad virtual.",
  13664. VR_SHOW_IOS_1: "Pulse para ver el Espacio en realidad virtual",
  13665. VR_SHOW_IOS_2: "Necesita la aplicación port VR y un iPhone compatible para ver",
  13666. VR_WHAT_YOU_NEED: "Lo que necesitaras...",
  13667. VR_NEED_CARDBOARD: "Lo que necesitaras con Google Cardboard",
  13668. VR_NEED_SAMSUNG: "Lo que necesitaras con el Samsung Gear VR",
  13669. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13670. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13671. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13672. VR_COMPATIBLE_IPHONES_2: "Compatible con iPhone 6S o superior y con iOS 9.1 en adelante",
  13673. VR_COMPATIBLE_IPHONES_3: "iPhones compatibles",
  13674. VR_COMPATIBLE_ANDROID: "Dispositivos Android compatibles",
  13675. VR_ANDROID_DETAIL: "Pantallas de 11.43 cm a 13.97 cm con OS de Android 4.4.4 en adelante",
  13676. VR_ANDROID_DVICES: "Dispositivos Android",
  13677. VR_COMPATIBLE_SAMSUNG: "Dispositivos compatibles del Samsung",
  13678. VR_SAMSUNG_DETAIL: "Galaxy S5 en adelante",
  13679. VR_APP_FOR_CARDBOARD: "Aplicación port VR para Google Cardboard",
  13680. VR_APP_FOR_SAMSUNG: "Aplicación port VR para Gear VR",
  13681. VR_DOWNLOAD_HERE: "Descargar aquí",
  13682. VR_REQUIRE_HEADSET: "Necesita un casco de realidad virtual y que se instale la aplicación port VR para Android",
  13683. VR_REDIRECT_TO_STORE: "Si la aplicación no está instalada, se le redirigirá a la tienda de aplicaciones.",
  13684. VR_IMPROPER_EMBED: "El espacio de port no está incorporado correctamente para apoyar VR en su navegador web.",
  13685. VR_OPEN_ANDROID_LINK: "Abre el enlace en tu teléfono móvil",
  13686. VR_ANDROID_OPTIONS: "Opciones de auriculares en RV disponibles",
  13687. SHARE_TO: "Compartir en",
  13688. SHARE_LINK: "Enlace directo",
  13689. SHARE_EXPLORE: "Explorar ",
  13690. SHARE_AT: "en",
  13691. SHARE_WITH: "con",
  13692. SHARE_3D: " en 3D",
  13693. SHARE_COPIED: "¡Copiado!",
  13694. ERROR_BROWSER_SOLUTION: "Instale un nuevo navegador para explorar en 3D.",
  13695. ERROR_BROWSER_EXPLANATION: "WebGL requiere un navegador moderno.",
  13696. ERROR_GENERIC_PROBLEM: "Vaya, algo ha ido mal.",
  13697. ERROR_GENERIC_SOLUTION: "Reinicie su navegador.",
  13698. ERROR_GENERIC_ACTIONS_1: "Si el problema persiste, ",
  13699. ERROR_GENERIC_ACTIONS_2: "instale un navegador compatible",
  13700. ERROR_GENERIC_ACTIONS_3: " o ",
  13701. ERROR_GENERIC_ACTIONS_4: "consulte nuestra guía de solución de problemas",
  13702. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Navegador no compatible.",
  13703. ERROR_WEBGL_IOS_PROBLEM: "Versión de iOS no compatible.",
  13704. ERROR_WEBGL_IOS_SOLUTION: "Actualice a iOS 8 o superior para explorar en 3D.",
  13705. ERROR_WEBGL_IOS_ACTIONS_1: "Pulse ",
  13706. ERROR_WEBGL_IOS_ACTIONS_2: "Ajustes > General > Actualización de software",
  13707. ERROR_WEBGL_SAFARI_PROBLEM: "Habilite WebGL para explorar en 3D.",
  13708. ERROR_WEBGL_SAFARI_ACTIONS_1: "Haga clic en ",
  13709. ERROR_WEBGL_SAFARI_ACTIONS_2: "Preferencias > Avanzado > Mostrar el menú Desarrollar",
  13710. ERROR_WEBGL_SAFARI_ACTIONS_3: "Después, haga clic en ",
  13711. ERROR_WEBGL_SAFARI_ACTIONS_4: "Desarrollar > Habilitar WebGL",
  13712. ERROR_MISSING_URLS_PROBLEM: "Vaya, no hay panoramas para este modelo.",
  13713. ERROR_MISSING_URLS_EXPLANATION: "Este es un modelo antiguo. El propietario del sitio web puede tener un nuevo modelo en mente.",
  13714. ERROR_LOADING_FAILED_PROBLEM: "Vaya, modelo no disponible.",
  13715. ERROR_LOADING_FAILED_ACTIONS_1: "Si el problema persiste, ",
  13716. ERROR_LOADING_FAILED_ACTIONS_2: "consulte nuestra guía de solución de problemas",
  13717. ERROR_MAINTENANCE_PROBLEM: "Mantenimiento en progreso.",
  13718. ERROR_MAINTENANCE_SOLUTION: "Regrese en unos minutos.",
  13719. LINK_TO_LOCATION: "Enlace a la ubicación",
  13720. MENU_COPY: "Copiar",
  13721. LINK_ALERT_COPY: "Utilice CTRL/CMD + C para copiar.",
  13722. ROTATE: "Girar",
  13723. INSIDE: "Interior",
  13724. MOVE: "Moverse",
  13725. ZOOM: "Acercar o alejar"
  13726. }
  13727. }
  13728. , {}],
  13729. 113: [function(e, t, i) {
  13730. "use strict";
  13731. t.exports = {
  13732. PAGE_TITLE: "",
  13733. LOADING: "Chargement",
  13734. PRESENTED_BY_CAPS: "PRÉSENTÉ PAR",
  13735. POWERED_BY: "alimenté par ",
  13736. POWERED_BY_CAPS: "ALIMENTÉ PAR",
  13737. DESKTOP_SHORT_CTA: "Cliquez pour explorer l'Espace 3D.",
  13738. MOBILE_SHORT_CTA: "Cliquez pour explorer l'Espace 3D.",
  13739. PRESENTED_BY: "Présenté par ",
  13740. MORE: "Plus ",
  13741. LESS: "Moins ",
  13742. TAG_CONTENT: "Contenu tag™",
  13743. SHOW: "Montrer",
  13744. HIDE: "Cacher",
  13745. DOLLHOUSE: "Dollhouse",
  13746. FLOOR_PLAN: "Plan de sol",
  13747. OPEN_HIGHLIGHTS: "Ouvrir les faits saillants",
  13748. CLOSE_HIGHLIGHTS: "Fermer",
  13749. PREVIOUS: "Précédent",
  13750. PLAY: "Lecture",
  13751. PAUSE: "Pause",
  13752. NEXT: "Suivant",
  13753. EXPLORE_3D_SPACE: "Explorer l'Espace en 3D",
  13754. VIEW_DOLLHOUSE: "Voir dollhouse",
  13755. SOCIAL_SHARING: "Partager cet espace",
  13756. VIEW_IN_VR: "Voir en VR",
  13757. VIEW_FULLSCREEN: "Plein écran",
  13758. EXIT_FULLSCREEN: "Fermer plein écran",
  13759. ZOOM_IN: "Zoom avant",
  13760. ZOOM_OUT: "Zoom arrière",
  13761. FLOOR_NAME: "Étage ",
  13762. FLOOR_ALL: "Tous",
  13763. TERMS: "Mentions légales",
  13764. PORT_TERMS: "port mentions légales",
  13765. TERMS_OF_USE: "Conditions d'utilisation",
  13766. TERMS_TEXT_FILE: "terms-fr-FR.html",
  13767. CLOSE_TERMS: "Fermer",
  13768. TERMS_FAIL: "Impossible d'accéder aux mentions légales. Vérifiez que vous avez une connexion Internet pour afficher les conditions d'utilisation.",
  13769. HELP: "Aide",
  13770. HELP_NAVIGATION_TAB: "Navigation",
  13771. HELP_MORE_HELP_TAB: "Aide",
  13772. CLOSE: "Fermer",
  13773. HELP_DESKTOP_PANORAMA_1A: "Cliquez et faites glisser pour regarder autour de l’espace.",
  13774. HELP_DESKTOP_PANORAMA_2A: "Cliquez sur les anneaux pour vous déplacer.",
  13775. HELP_DESKTOP_PANORAMA_3A: "Utilisez la molette de votre souris pour zoomer.",
  13776. HELP_DESKTOP_PANORAMA_1B: "Ou utilisez les touches pour tourner.",
  13777. HELP_DESKTOP_PANORAMA_2B: "Ou utilisez les touches pour avancer et reculer.",
  13778. HELP_DESKTOP_PANORAMA_3B: "Ou utilisez les touches plus et moins pour zoomer.",
  13779. HELP_DESKTOP_360_2A: "Cliquez sur l’icône Vue Intérieure pour entrer dans l’Espace.",
  13780. HELP_DESKTOP_360_2B: "Ou, appuyez sur la touche numéro 1 pour entrer dans la Vue Intérieure.",
  13781. HELP_DESKTOP_DOLLHOUSE_1A: "Faites un clic gauche et bougez votre souris pour faire pivoter la vue Dollhouse.",
  13782. HELP_DESKTOP_DOLLHOUSE_2A: "Faites un clic droit et bougez votre souris pour changer la position de la vue Dollhouse.",
  13783. HELP_DESKTOP_DOLLHOUSE_3A: "Utilisez la molette de votre souris pour zoomer.",
  13784. HELP_DESKTOP_DOLLHOUSE_1B: "Ou utilisez les touches pour faire pivoter la vue Dollhouse.",
  13785. HELP_DESKTOP_FLOORPLAN_1A: "Faites un clic droit pour changer la position du plan sur l’écran.",
  13786. HELP_DESKTOP_FLOORPLAN_2A: "Faites un clic droit et faites glisser à gauche ou à droite pour faire pivoter le plan.",
  13787. HELP_DESKTOP_FLOORPLAN_3A: "Utilisez la molette de votre souris pour zoomer.",
  13788. HELP_DESKTOP_FLOORPLAN_2B: "Ou utilisez les touches pour faire pivoter à gauche ou à droite.",
  13789. HELP_DESKTOP_FLOORPLAN_3B: "Ou utilisez les touches pour effectuer un zoom avant ou arrière.",
  13790. HELP_MOBILE_PANORAMA_1: "Touchez et faites glisser pour regarder autour de l’espace.",
  13791. HELP_MOBILE_PANORAMA_2: "Tapez sur les anneaux dans tout l’espace pour vous déplacer.",
  13792. HELP_MOBILE_3: "Utilisez un geste de pincement pour zoomer avant/arrière.",
  13793. HELP_MOBILE_360_2: "Tapez sur l’icône Vue Intérieure pour entrer dans l’Espace.",
  13794. HELP_MOBILE_DOLLHOUSE_1: "Touchez et faites glisser vers le haut/bas/gauche/droite pour faire pivoter la vue Dollhouse.",
  13795. HELP_MOBILE_DOLLHOUSE_2: "Touchez et faites glisser avec deux doigts pour positionner vue en coupe.",
  13796. HELP_MOBILE_FLOORPLAN_1: "Touchez et faites glisser pour positionner le plan.",
  13797. HELP_MOBILE_FLOORPLAN_2: "Touchez et faites glisser avec deux doigts pour faire pivoter le plan.",
  13798. HELP_MORE_HLR_A: "Carrousel",
  13799. HELP_DESKTOP_MORE_HLR_B: "Ouvrez pour naviguer dans l’espace en utilisant les vignettes.",
  13800. HELP_MORE_DOLLHOUSE_A: "Vue en coupe",
  13801. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Cliquez pour afficher et faire pivoter l’espace entier en 3D.",
  13802. HELP_MOBILE_MORE_DOLLHOUSE_B: "Tapez pour afficher et faire pivoter l’espace entier en 3D.",
  13803. HELP_MORE_FLOORS_A: "Sélecteur d’étage",
  13804. HELP_DESKTOP_MORE_FLOORS_B: "Basculer entre les étages dans l’espace.",
  13805. HELP_MORE_TAG_A: "tag™ Posts",
  13806. HELP_DESKTOP_MORE_TAG_B: "Cliquez ou survolez pour obtenir des informations sur l’espace.",
  13807. HELP_MOBILE_MORE_TAG_B: "Tapez pour obtenir des informations sur l’espace.",
  13808. HELP_MORE_ZOOM_A: "Commandes de zoom",
  13809. HELP_DESKTOP_MORE_ZOOM_B: "Utilisez votre clavier ou la molette de votre souris pour zoomer.",
  13810. HELP_MORE_TOUR_A: "Commandes de la visite",
  13811. HELP_DESKTOP_MORE_TOUR_B: "Mettez en marche ou en pause, avancez et reculez lors d'une visite guidée.",
  13812. HELP_MORE_INSIDE_A: "Vue intérieure",
  13813. HELP_DESKTOP_MORE_INSIDE_B: "Cliquez pour explorer l’intérieur de l’espace.",
  13814. HELP_MOBILE_MORE_INSIDE_B: "Tapez pour explorer l’intérieur de l’espace.",
  13815. HELP_MORE_VR_A: "Mode RV",
  13816. HELP_DESKTOP_MORE_VR_B: "Cliquez pour lancer l’espace en réalité virtuelle.",
  13817. HELP_MOBILE_MORE_VR_B: "Tapez pour lancer l’espace en réalité virtuelle.",
  13818. HELP_MORE_360_A: "Vues 360°",
  13819. HELP_DESKTOP_MORE_360_B: "Cliquez sur vues 360°, dans le carrousel pour voir les scènes extérieures.",
  13820. HELP_MOBILE_MORE_360_B: "Tapez sur vues 360°, dans le carrousel pour voir les scènes extérieures.",
  13821. HELP_MORE_FULLSCREEN_A: "Plein écran",
  13822. HELP_DESKTOP_MORE_FULLSCREEN_B: "Voir 3D Showcase en plein écran.",
  13823. WEBVR_FOR_CARDBOARD: "Pour Google Cardboard",
  13824. WEBVR_FOR_DAYDREAM: "Pour Daydream View",
  13825. WEBVR_ENTER_WEBVR: "ENTRER VR",
  13826. WEBVR_DIFFERENT_HEADSET: "Avez-vous un casque différent?",
  13827. WEBVR_LEARN_MORE: "En savoir plus",
  13828. WEBVR_VIEW_SPACE: "Voir Espace en VR",
  13829. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13830. WEBVR_DAYDREAM_PHONE: "Téléphone compatibles Daydream",
  13831. WEBVR_VIEW_CARDBOARD: "Ou Afficher sur Google Cardboard",
  13832. VR_VIEW_SPACE: "Voir l'Espace en Réalité Virtuelle",
  13833. VR_LEARN_MORE_CAPS: "EN SAVOIR PLUS",
  13834. VR_PREVIOUS_CAPS: "PRÉCÉDENT",
  13835. VR_NEXT_CAPS: "SUIVANT",
  13836. VR_GOT_IT_CAPS: "BIEN COMPRIS",
  13837. VR_SHOW_SUPPORTED: "Taper pour voir l'Espace en VR avec",
  13838. VR_SHOW_UNSUPPORTED: "Désolé mais votre appareil ne répond pas aux critères minimaux pour voir cet Espace en mode VR.",
  13839. VR_SHOW_IOS_1: "Taper pour voir l’Espace en Realité Virtuelle",
  13840. VR_SHOW_IOS_2: "Nécessite l’application port VR et un iPhone compatible pour voir",
  13841. VR_WHAT_YOU_NEED: "Ce dont vous aurez besoin pour...",
  13842. VR_NEED_CARDBOARD: "Ce dont vous aurez besoin avec Google Cardboard",
  13843. VR_NEED_SAMSUNG: "Ce dont vous aurez besoin avec Samsung Gear VR",
  13844. VR_NEED_DAYDREAM: "BESOINS AVANT APPARIEMENT AVEC DAYDREAM VIEW",
  13845. VR_NEED_DAYDREAM_PHONE: "Téléphone compatible avec Daydream",
  13846. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13847. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13848. VR_APP: "port VR App",
  13849. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13850. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13851. VR_COMPATIBLE_IPHONES_2: "iPhone 5s et plus récent, avec iOS 9.1 et plus récent",
  13852. VR_COMPATIBLE_IPHONES_3: "iPhones compatibles",
  13853. VR_COMPATIBLE_ANDROID: "Appareils Android compatibles",
  13854. 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",
  13855. VR_ANDROID_DETAIL: 'Écrans 4.5" à 5.5" avec Android 4.4.4 ou plus récent',
  13856. VR_ANDROID_DVICES: "Appareils Android",
  13857. VR_COMPATIBLE_SAMSUNG: "Appareils Samsung Compatibles",
  13858. VR_SAMSUNG_DETAIL: "Galaxy S6 et plus récents",
  13859. VR_APP_FOR_CARDBOARD: "Application port VR pour Google Cardboard",
  13860. VR_APP_FOR_SAMSUNG: "Application port VR pour Gear VR",
  13861. VR_APP_FOR_ANDROID: "Application port VR pour téléphones Android",
  13862. VR_APP_OPEN: "Ouvrir plutôt avec l’application port VR",
  13863. VR_DOWNLOAD_HERE: "Télécharger ici",
  13864. VR_REQUIRE_HEADSET: "Nécessite un casque VR et l'application port VR pour Android afin d'être installé",
  13865. VR_REDIRECT_TO_STORE: "Si l'application n'est pas installée, vous serez rediriger vers l'App store.",
  13866. VR_IMPROPER_EMBED: "L'Espace port n'est pas correctement intégré pour supporter VR dans votre navigateur Web.",
  13867. VR_OPEN_ANDROID_LINK: "Ouvrez ce lien avec votre appareil mobile",
  13868. VR_ANDROID_OPTIONS: "Options disponibles pour casque VR sous",
  13869. SHARE_TO: "Partager sur",
  13870. SHARE_LINK: "Lien direct",
  13871. SHARE_EXPLORE: "Explorer ",
  13872. SHARE_AT: "à",
  13873. SHARE_WITH: "avec",
  13874. SHARE_3D: " en 3D",
  13875. SHARE_COPIED: "Copié!",
  13876. ERROR_BROWSER_SOLUTION: "Installer un nouveau navigateur pour explorer en 3D.",
  13877. ERROR_BROWSER_EXPLANATION: "WebGL a besoin d'un navigateur récent.",
  13878. ERROR_GENERIC_PROBLEM: "Il y eu un problème.",
  13879. ERROR_GENERIC_SOLUTION: "Redémarrer votre navigateur.",
  13880. ERROR_GENERIC_ACTIONS_1: "Si le problème persiste, ",
  13881. ERROR_GENERIC_ACTIONS_2: "installez un navigateur plus récent",
  13882. ERROR_GENERIC_ACTIONS_3: " ou ",
  13883. ERROR_GENERIC_ACTIONS_4: "voir notre guide de dépannage",
  13884. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Navigateur non-supporté.",
  13885. ERROR_WEBGL_IOS_PROBLEM: "Version iOS non-supportée.",
  13886. ERROR_WEBGL_IOS_SOLUTION: "Mettre à jour avec iOS8 au minimum pour voir l'Espace en 3D.",
  13887. ERROR_WEBGL_IOS_ACTIONS_1: "Tapez ",
  13888. ERROR_WEBGL_IOS_ACTIONS_2: "Paramètres > Général > Mise à jour Software",
  13889. ERROR_WEBGL_SAFARI_PROBLEM: "Activez WegGL pour explorer en 3D.",
  13890. ERROR_WEBGL_SAFARI_ACTIONS_1: "Cliquez ",
  13891. ERROR_WEBGL_SAFARI_ACTIONS_2: "Préferences > Avancés > Voir menu développeur",
  13892. ERROR_WEBGL_SAFARI_ACTIONS_3: "Puis cliquez ",
  13893. ERROR_WEBGL_SAFARI_ACTIONS_4: "Développe > Activé WebGL",
  13894. ERROR_MISSING_URLS_PROBLEM: "Il n'y a pas de panoromas pour ce modèle.",
  13895. ERROR_MISSING_URLS_EXPLANATION: "Ceci est un ancien modèle. Le propriétaire du site a peut-être un nouveau modèle en cours.",
  13896. ERROR_LOADING_FAILED_PROBLEM: "Ce modèle n'est pas disponible.",
  13897. ERROR_LOADING_FAILED_ACTIONS_1: "Si le problème persiste, ",
  13898. ERROR_LOADING_FAILED_ACTIONS_2: "voir notre guide de dépannage",
  13899. ERROR_MAINTENANCE_PROBLEM: "Maintenance en cours.",
  13900. ERROR_MAINTENANCE_SOLUTION: "Revenez dans quelques instants.",
  13901. LINK_TO_LOCATION: "Lien vers l'emplacement",
  13902. MENU_COPY: "Copie",
  13903. LINK_ALERT_COPY: "Utiliser CTRL+CMD C pour copier.",
  13904. ROTATE: "Faire pivoter",
  13905. INSIDE: "Intérieure",
  13906. MOVE: "Se déplacer",
  13907. ZOOM: "Zoom"
  13908. }
  13909. }
  13910. , {}],
  13911. 114: [function(e, t, i) {
  13912. "use strict";
  13913. t.exports = {
  13914. PAGE_TITLE: "",
  13915. LOADING: "読み込み中",
  13916. PRESENTED_BY_CAPS: "PRESENTED BY",
  13917. POWERED_BY: "powered by",
  13918. POWERED_BY_CAPS: "POWERED BY",
  13919. DESKTOP_SHORT_CTA: "クリックしてこの3D Spaceを探索",
  13920. MOBILE_SHORT_CTA: "タップしてこの3D Spaceを探索",
  13921. PRESENTED_BY: "Presented by ",
  13922. MORE: "全て表示 ",
  13923. LESS: "閉じる ",
  13924. TAG_CONTENT: "tag™コンテンツ ",
  13925. SHOW: "表示",
  13926. HIDE: "非表示",
  13927. DOLLHOUSE: "ドールハウス",
  13928. FLOOR_PLAN: "フロアプラン",
  13929. OPEN_HIGHLIGHTS: "ハイライトを開く",
  13930. CLOSE_HIGHLIGHTS: "閉じる",
  13931. PREVIOUS: "前へ",
  13932. PLAY: "再生",
  13933. PAUSE: "一時停止",
  13934. NEXT: "次へ",
  13935. EXPLORE_3D_SPACE: "3DSpaceの探索",
  13936. VIEW_DOLLHOUSE: "ドールハウスの表示",
  13937. SOCIAL_SHARING: "このSpaceを共有する",
  13938. VIEW_IN_VR: "VRで表示",
  13939. VIEW_FULLSCREEN: "フルスクリーン表示",
  13940. EXIT_FULLSCREEN: "フルスクリーン表示を終了",
  13941. ZOOM_IN: "ズームイン",
  13942. ZOOM_OUT: "ズームアウト",
  13943. FLOOR_NAME: "フロア ",
  13944. FLOOR_ALL: "すべて",
  13945. TERMS: "規約",
  13946. PORT_TERMS: "port規約",
  13947. TERMS_OF_USE: "利用規約",
  13948. CLOSE_TERMS: "閉じる",
  13949. TERMS_TEXT_FILE: "terms-jp-JP.html",
  13950. TERMS_FAIL: "規約を取得できませんでした。利用規約を表示するためにインターネットに接続されていることを確認してください。",
  13951. WEBVR_FOR_DAYDREAM: "Daydream View用",
  13952. WEBVR_ENTER_WEBVR: "VRに入る",
  13953. WEBVR_DIFFERENT_HEADSET: "別のヘッドセットをお持ちですか?",
  13954. WEBVR_LEARN_MORE: "もっと詳しく",
  13955. WEBVR_VIEW_SPACE: "VRでSpaceを表示",
  13956. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13957. WEBVR_DAYDREAM_PHONE: "Daydream対応スマホ",
  13958. WEBVR_FOR_CARDBOARD: "Google Cardboard用",
  13959. WEBVR_VIEW_CARDBOARD: "またはGoogle Cardboardで表示",
  13960. VR_VIEW_SPACE: "バーチャルリアリティでSpaceを表示",
  13961. VR_LEARN_MORE_CAPS: "もっと詳しく",
  13962. VR_PREVIOUS_CAPS: "前へ",
  13963. VR_NEXT_CAPS: "次へ",
  13964. VR_GOT_IT_CAPS: "了解",
  13965. VR_SHOW_SUPPORTED: "タップして次を使用してVRでSpaceを表示: ",
  13966. VR_SHOW_UNSUPPORTED: "お使いのデバイスはVRでSpaceを表示する最低要件を満たしていません",
  13967. VR_SHOW_IOS_1: "タップしてVRでSpaceを表示",
  13968. VR_SHOW_IOS_2: "表示するにはport VRアプリと互換性のあるiPhoneが必要です",
  13969. VR_WHAT_YOU_NEED: "必要なもの",
  13970. VR_NEED_CARDBOARD: "Google Cardboardに必要なもの",
  13971. VR_NEED_SAMSUNG: "Samsung Gear VRに必要なもの",
  13972. VR_NEED_DAYDREAM: "事前にDaydream Viewとのペアリングが必要です",
  13973. VR_NEED_DAYDREAM_PHONE: "Daydream対応スマホ",
  13974. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13975. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13976. VR_APP: "port VRアプリ",
  13977. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13978. VR_COMPATIBLE_IPHONES_1: "iPhone",
  13979. VR_COMPATIBLE_IPHONES_2: "iOS 9.1以降で動作するiPhone 5s以降のモデル",
  13980. VR_COMPATIBLE_IPHONES_3: "互換性のあるiPhone",
  13981. VR_COMPATIBLE_ANDROID: "互換性のあるAndroidデバイス",
  13982. VR_COMPATIBLE_ANDROID_LONG: "Android OS 4.4.4以降で動作する互換性のあるAndroidデバイスの4.5~5.5インチディスプレイ",
  13983. VR_ANDROID_DETAIL: "Android OS 4.4.4以降で動作する4.5~5.5インチディスプレイ",
  13984. VR_ANDROID_DVICES: "Androidデバイス",
  13985. VR_COMPATIBLE_SAMSUNG: "互換性のあるSamsungデバイス",
  13986. VR_SAMSUNG_DETAIL: "Galaxy S5以降のモデル",
  13987. VR_APP_FOR_CARDBOARD: "Google Cardboard用のport VRアプリ",
  13988. VR_APP_FOR_SAMSUNG: "Gear VR 用のport VRアプリ",
  13989. VR_APP_FOR_ANDROID: "Androidフォン用のport VRアプリ",
  13990. VR_APP_OPEN: "port VRアプリで開く",
  13991. VR_DOWNLOAD_HERE: "ここからダウンロード",
  13992. VR_REQUIRE_HEADSET: "Android 用のVRヘッドセットとport VRアプリ をインストールする必要があります",
  13993. VR_REDIRECT_TO_STORE: "アプリがインストールされていない場合、App Storeにリダイレクトされます",
  13994. VR_IMPROPER_EMBED: "お使いのウェブブラウザでVRがサポートされるようport Spaceが適切に埋め込まれていません。",
  13995. VR_OPEN_ANDROID_LINK: "お使いの携帯電話でリンクを開いてください",
  13996. VR_ANDROID_OPTIONS: "利用可能なVRヘッドセットオプション",
  13997. SHARE_TO: "共有先",
  13998. SHARE_LINK: "ダイレクトリンク",
  13999. SHARE_EXPLORE: "探索",
  14000. SHARE_AT: "場所",
  14001. SHARE_WITH: "使用アプリ",
  14002. SHARE_3D: "3Dで",
  14003. SHARE_COPIED: "コピーされました!",
  14004. ERROR_BROWSER_SOLUTION: "3D探索するには、新しいバージョンのブラウザをインストールしてください",
  14005. ERROR_BROWSER_EXPLANATION: "WebGLにはモダンブラウザが必要です。",
  14006. ERROR_GENERIC_PROBLEM: "問題が発生しました。",
  14007. ERROR_GENERIC_SOLUTION: "ブラウザを再起動してください。",
  14008. ERROR_GENERIC_ACTIONS_1: "問題が解決しない場合は、",
  14009. ERROR_GENERIC_ACTIONS_2: "サポートされているブラウザをインストールしてください",
  14010. ERROR_GENERIC_ACTIONS_3: "または",
  14011. ERROR_GENERIC_ACTIONS_4: "トラブルシューティングガイドを参照してください",
  14012. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "ブラウザがサポートされていません。",
  14013. ERROR_WEBGL_IOS_PROBLEM: "サポートされていないiOSバージョンです。",
  14014. ERROR_WEBGL_IOS_SOLUTION: "3D探索するには、iOS 8以降にアップグレードしてください。",
  14015. ERROR_WEBGL_IOS_ACTIONS_1: "以下の順にタップします:",
  14016. ERROR_WEBGL_IOS_ACTIONS_2: "設定 > 全般 > ソフトウェアの更新",
  14017. ERROR_WEBGL_SAFARI_PROBLEM: "WebGLを有効にして3Dで探索します。",
  14018. ERROR_WEBGL_SAFARI_ACTIONS_1: "以下の順にクリックします:",
  14019. ERROR_WEBGL_SAFARI_ACTIONS_2: "環境設定 > 詳細 > メニューバーに開発メニューを表示",
  14020. ERROR_WEBGL_SAFARI_ACTIONS_3: "その後、以下の順にクリックします:",
  14021. ERROR_WEBGL_SAFARI_ACTIONS_4: "開発 > WebGLを有効にする",
  14022. ERROR_MISSING_URLS_PROBLEM: "このモデルではパノラマを使用できません。",
  14023. ERROR_MISSING_URLS_EXPLANATION: "これは古いモデルです。ウェブサイト所有者が新しいモデルを開発中かもしれません。",
  14024. ERROR_LOADING_FAILED_PROBLEM: "モデルは利用できません。",
  14025. ERROR_LOADING_FAILED_ACTIONS_1: "問題が解決しない場合は、",
  14026. ERROR_LOADING_FAILED_ACTIONS_2: "トラブルシューティングガイドを参照してください",
  14027. ERROR_MAINTENANCE_PROBLEM: "メンテナンスは進行中です。",
  14028. ERROR_MAINTENANCE_SOLUTION: "しばらくしてからやり直し てください。",
  14029. LINK_TO_LOCATION: "ロケーションへのリンク",
  14030. MENU_COPY: "コピー",
  14031. LINK_ALERT_COPY: "コピーするにはCTRL/CMD + Cを使用してください。",
  14032. ROTATE: "回転",
  14033. MOVE: "移動",
  14034. INSIDE: "内側",
  14035. ZOOM: "ズーム",
  14036. HELP: "ヘルプ",
  14037. HELP_NAVIGATION_TAB: "ナビゲーション",
  14038. HELP_MORE_HELP_TAB: "その他のヘルプ",
  14039. HELP_DESKTOP_PANORAMA_1A: "Spaceを見回すには、クリックしてドラッグします。",
  14040. HELP_DESKTOP_PANORAMA_2A: "移動するには、Space全体にあるリングをクリックします。",
  14041. HELP_DESKTOP_PANORAMA_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
  14042. HELP_DESKTOP_PANORAMA_1B: "または、矢印キーを使用して左右に向きを変えます。",
  14043. HELP_DESKTOP_PANORAMA_2B: "または、矢印キーを使用して前後に向きを変えます。",
  14044. HELP_DESKTOP_PANORAMA_3B: "あるいは、プラス(+)キーまたはマイナス(-)キーを使用して、ズームイン、ズームアウトします。",
  14045. HELP_DESKTOP_360_2A: "内側ビューアイコンをクリックしてSpaceに入ります。",
  14046. HELP_DESKTOP_360_2B: "または、数字キー1を押して内側ビューに入ります。",
  14047. HELP_DESKTOP_DOLLHOUSE_1A: "左クリックと左右、上下のドラッグでドールハウスを回転します。",
  14048. HELP_DESKTOP_DOLLHOUSE_2A: "右クリックと左右、上下のドラッグでドールハウスの画面上の位置を変更します。",
  14049. HELP_DESKTOP_DOLLHOUSE_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
  14050. HELP_DESKTOP_DOLLHOUSE_1B: "または、矢印キーを使用してドールハウスを回転します。",
  14051. HELP_DESKTOP_FLOORPLAN_1A: "左ボタンを押しながら、上下左右にドラッグしてフロアプランの画面上の位置を変更します。",
  14052. HELP_DESKTOP_FLOORPLAN_2A: "右ボタンを押しながら左右にドラッグして、フロアプランを回転します。",
  14053. HELP_DESKTOP_FLOORPLAN_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
  14054. HELP_DESKTOP_FLOORPLAN_2B: "または、矢印キーを使用して左右に回転します。",
  14055. HELP_DESKTOP_FLOORPLAN_3B: "または、矢印キーを使用して、ズームイン、ズームアウトします。",
  14056. HELP_MOBILE_PANORAMA_1: "Spaceを見回すには、タッチしてドラッグします。",
  14057. HELP_MOBILE_PANORAMA_2: "移動するには、Space全体にあるリングをタップします。",
  14058. HELP_MOBILE_3: "ピンチジェスチャーを使用してズームイン、ズームアウトします。",
  14059. HELP_MOBILE_360_2: "内側ビューアイコンをタップしてSpaceに入ります。",
  14060. HELP_MOBILE_DOLLHOUSE_1: "タッチして上下左右にドラッグしてドールハウスを回転します。",
  14061. HELP_MOBILE_DOLLHOUSE_2: "タッチして、2本指でドラッグしてドールハウスを配置します。",
  14062. HELP_MOBILE_FLOORPLAN_1: "タッチ&ドラッグしてフロアプランを配置します。",
  14063. HELP_MOBILE_FLOORPLAN_2: "タッチして、2本指でドラッグしてフロアプランを回転します。",
  14064. HELP_MORE_HLR_A: "ハイライト",
  14065. HELP_DESKTOP_MORE_HLR_B: "サムネイル画像を使用してSpaceを移動するために開きます。",
  14066. HELP_MORE_DOLLHOUSE_A: "ドールハウス",
  14067. HELP_DESKTOP_MORE_DOLLHOUSE_B: "クリックして3DでSpace全体のトップダウンビューを表示して回転します。",
  14068. HELP_MOBILE_MORE_DOLLHOUSE_B: "タップして3DでSpace全体のトップダウンビューを表示して回転します。",
  14069. HELP_MORE_FLOORS_A: "フロアセレクター",
  14070. HELP_DESKTOP_MORE_FLOORS_B: "Space内のフロアを切り替えます。",
  14071. HELP_MORE_TAG_A: "tag™ Posts",
  14072. HELP_DESKTOP_MORE_TAG_B: "クリックするか、カーソルを置くとSpace内の機能についての説明が表示されます。",
  14073. HELP_MOBILE_MORE_TAG_B: "タップするとSpace内の機能についての説明が表示されます。",
  14074. HELP_MORE_ZOOM_A: "ズームコントロール",
  14075. HELP_DESKTOP_MORE_ZOOM_B: "これらのコントロールまたはスクロールホイールを使用して、ズームイン、ズームアウトします。",
  14076. HELP_MORE_TOUR_A: "ツアーコントロール",
  14077. HELP_DESKTOP_MORE_TOUR_B: "ガイド付きツアー中に再生、一時停止、前方・後方に移動します。",
  14078. HELP_MORE_INSIDE_A: "内側ビュー",
  14079. HELP_DESKTOP_MORE_INSIDE_B: "クリックしてSpace内を探索します。",
  14080. HELP_MOBILE_MORE_INSIDE_B: "タップしてSpace内を探索します。",
  14081. HELP_MORE_VR_A: "VRモード",
  14082. HELP_DESKTOP_MORE_VR_B: "クリックしてバーチャルリアリティでSpaceを起動します。",
  14083. HELP_MOBILE_MORE_VR_B: "タップしてバーチャルリアリティでSpaceを起動します。",
  14084. HELP_MORE_360_A: "360° Views",
  14085. HELP_DESKTOP_MORE_360_B: "Highlight Reelの360° Viewsをクリックして屋外シーンを表示します。",
  14086. HELP_MOBILE_MORE_360_B: "Highlight Reelの360° Viewsをタップして屋外シーンを表示します。",
  14087. HELP_MORE_FULLSCREEN_A: "フルスクリーン",
  14088. HELP_DESKTOP_MORE_FULLSCREEN_B: "3D Showcaseをフルスクリーン表示にします。",
  14089. CLOSE: "閉じる"
  14090. }
  14091. }
  14092. , {}],
  14093. 115: [function(e, t, i) {
  14094. "use strict";
  14095. t.exports = {
  14096. PAGE_TITLE: "",
  14097. LOADING: "Загрузка",
  14098. PRESENTED_BY_CAPS: "ПРЕДСТАВЛЕНО",
  14099. POWERED_BY: "разработано на платформе ",
  14100. POWERED_BY_CAPS: "РАЗРАБОТАНО НА ПЛАТФОРМЕ",
  14101. DESKTOP_SHORT_CTA: "Нажмите для просмотра.",
  14102. MOBILE_SHORT_CTA: "Нажмите для просмотра.",
  14103. PRESENTED_BY: "Представлено ",
  14104. MORE: "Больше ",
  14105. LESS: "Меньше ",
  14106. TAG_CONTENT: "tag™ Контент",
  14107. SHOW: "Показать",
  14108. HIDE: "Скрыть",
  14109. DOLLHOUSE: "Dollhouse",
  14110. FLOOR_PLAN: "Планировка",
  14111. OPEN_HIGHLIGHTS: "Открыть Фотоколлаж",
  14112. CLOSE_HIGHLIGHTS: "Закрыть",
  14113. PREVIOUS: "Предыдущий",
  14114. PLAY: "Воспроизвести",
  14115. PAUSE: "Пауза",
  14116. NEXT: "Следующий",
  14117. EXPLORE_3D_SPACE: "Просмотреть 3D модель",
  14118. VIEW_DOLLHOUSE: "Посмотреть Dollhouse",
  14119. SOCIAL_SHARING: "Поделиться этой моделью",
  14120. VIEW_IN_VR: "Посмотреть в VR",
  14121. VIEW_FULLSCREEN: "Полный экран",
  14122. EXIT_FULLSCREEN: "Выйти из полноэкранного режима",
  14123. ZOOM_IN: "Увеличить",
  14124. ZOOM_OUT: "Уменьшить",
  14125. FLOOR_NAME: "Этаж ",
  14126. FLOOR_ALL: "Все",
  14127. TERMS: "Условия",
  14128. PORT_TERMS: "Правила пользования",
  14129. TERMS_OF_USE: "Условия использования",
  14130. TERMS_TEXT_FILE: "terms-ru-RU.html",
  14131. CLOSE_TERMS: "Закрыть",
  14132. TERMS_FAIL: "Не удалось загрузить условия использования. Для просмотра условий использования, пожалуйста, убедитесь, что у Вас есть подключение к Интернету.",
  14133. HELP: "Помощь",
  14134. HELP_NAVIGATION_TAB: "Навигация",
  14135. HELP_MORE_HELP_TAB: "Доп. Помощь",
  14136. CLOSE: "Закрыть",
  14137. HELP_DESKTOP_PANORAMA_1A: "Нажмите и перетащите, чтобы осмотреть пространство вокруг.",
  14138. HELP_DESKTOP_PANORAMA_2A: "Для передвижения по модели нажимайте на круги .",
  14139. HELP_DESKTOP_PANORAMA_3A: "Используйте колесо прокрутки для увеличения и уменьшения.",
  14140. HELP_DESKTOP_PANORAMA_1B: "Или используйте клавиши со стрелками для поворота влево и вправо.",
  14141. HELP_DESKTOP_PANORAMA_2B: "Или используйте стрелки для перемещения вперед и назад.",
  14142. HELP_DESKTOP_PANORAMA_3B: "Или используйте клавиши ‘плюс’ и ‘минус’ для увеличения и уменьшения изображения.",
  14143. HELP_DESKTOP_360_2A: "Нажмите на значок ‘Вид Изнутри’, чтобы увидеть внутреннюю панораму.",
  14144. HELP_DESKTOP_360_2B: "или нажмите 1 на клавиатуре, чтобы увидеть внутреннюю панораму.",
  14145. HELP_DESKTOP_DOLLHOUSE_1A: "Нажмите левую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы повернуть Dollhouse.",
  14146. HELP_DESKTOP_DOLLHOUSE_2A: "Нажмите правую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы изменить позицию Dollhouse на экране.",
  14147. HELP_DESKTOP_DOLLHOUSE_3A: "Используйте колесо прокрутки чтобы увеличить и уменьшить.",
  14148. HELP_DESKTOP_DOLLHOUSE_1B: "Или используйте клавиши со стрелками, чтобы повернуть Dollhouse.",
  14149. HELP_DESKTOP_FLOORPLAN_1A: "Нажмите левую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы изменить положение Планировки на экране.",
  14150. HELP_DESKTOP_FLOORPLAN_2A: "Нажмите правую кнопку мыши и перетащите влево или вправо, чтобы повернуть Планировку.",
  14151. HELP_DESKTOP_FLOORPLAN_3A: "Используйте колесо прокрутки чтобы увеличить и уменьшить.",
  14152. HELP_DESKTOP_FLOORPLAN_2B: "Или используйте клавиши со стрелками для поворота влево или вправо.",
  14153. HELP_DESKTOP_FLOORPLAN_3B: "Или используйте стрелки для увеличения и уменьшения.",
  14154. HELP_MOBILE_PANORAMA_1: "Нажмите и перетащите, чтобы осмотреть модель.",
  14155. HELP_MOBILE_PANORAMA_2: "Для передвижения по модели нажимайте на круги.",
  14156. HELP_MOBILE_3: "Используйте движение двумя пальцами в разные стороны, чтобы увеличить и уменьшить.",
  14157. HELP_MOBILE_360_2: "Нажмите на значок ‘Вид Изнутри’, чтобы увидеть внутреннюю панораму.",
  14158. HELP_MOBILE_DOLLHOUSE_1: "Нажмите и перетащите вверх, вниз, влево и вправо, чтобы повернуть Dollhouse.",
  14159. HELP_MOBILE_DOLLHOUSE_2: "Нажмите и перетащите, чтобы расположить Dollhouse.",
  14160. HELP_MOBILE_FLOORPLAN_1: "Нажмите и перетащите, чтобы расположить план здания.",
  14161. HELP_MOBILE_FLOORPLAN_2: "Коснитесь и перетащите двумя пальцами, чтобы повернуть план здания.",
  14162. HELP_MORE_HLR_A: "Фотоколлаж",
  14163. HELP_DESKTOP_MORE_HLR_B: "Откройте для перемещения по модели, используя иконки изображений.",
  14164. HELP_MORE_DOLLHOUSE_A: "Dollhouse",
  14165. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Нажмите и поверните сверху вниз чтобы просмотреть всю 3D модель.",
  14166. HELP_MOBILE_MORE_DOLLHOUSE_B: "Нажмите и поверните сверху вниз чтобы просмотреть всю 3D модель.",
  14167. HELP_MORE_FLOORS_A: "Выбор Этажа",
  14168. HELP_DESKTOP_MORE_FLOORS_B: "Переключение между этажами.",
  14169. HELP_MORE_TAG_A: "tag™ Posts",
  14170. HELP_DESKTOP_MORE_TAG_B: "Нажмите или наведите курсор мыши для получения информации о функциях в Пространстве.",
  14171. HELP_MOBILE_MORE_TAG_B: "Нажмите для получения информации о функциях.",
  14172. HELP_MORE_ZOOM_A: "Масштаб",
  14173. HELP_DESKTOP_MORE_ZOOM_B: "Используйте эти кнопки для увеличения и уменьшения изображения или используйте колесо прокрутки.",
  14174. HELP_MORE_TOUR_A: "Управление Туром",
  14175. HELP_DESKTOP_MORE_TOUR_B: "Используйте кнопки Воспроизвести, Пауза, Вперед и Назад для управления фотоколлажем.",
  14176. HELP_MORE_INSIDE_A: "Вид Изнутри",
  14177. HELP_DESKTOP_MORE_INSIDE_B: "Нажмите, чтобы просмотреть модель изнутри.",
  14178. HELP_MOBILE_MORE_INSIDE_B: "Нажмите, чтобы просмотреть модель изнутри.",
  14179. HELP_MORE_VR_A: "Режим VR",
  14180. HELP_DESKTOP_MORE_VR_B: "Нажмите, чтобы запустить модель в виртуальной реальности.",
  14181. HELP_MOBILE_MORE_VR_B: "Нажмите, чтобы запустить модель в виртуальной реальности.",
  14182. HELP_MORE_360_A: "360° Views",
  14183. HELP_DESKTOP_MORE_360_B: "Нажмите на “360 Views” в фотоколлаже, чтобы просмотреть внешний пейзаж.",
  14184. HELP_MOBILE_MORE_360_B: "Нажмите на “360 Views” в фотоколлаже, чтобы просмотреть внешний пейзаж.",
  14185. HELP_MORE_FULLSCREEN_A: "Полный экран",
  14186. HELP_DESKTOP_MORE_FULLSCREEN_B: "Развернуть 3D Showcase во весь экран.",
  14187. WEBVR_FOR_CARDBOARD: "Для Google Cardboard",
  14188. WEBVR_FOR_DAYDREAM: "Для просмотра в Daydream",
  14189. WEBVR_ENTER_WEBVR: "ВОЙТИ В VR ",
  14190. WEBVR_DIFFERENT_HEADSET: "Есть другой VR-шлем?",
  14191. WEBVR_LEARN_MORE: "Узнать больше",
  14192. WEBVR_VIEW_SPACE: "Запустить модель в VR",
  14193. WEBVR_DAYDREAM_VIEW: "Посмотреть в Daydream",
  14194. WEBVR_DAYDREAM_PHONE: "Daydream-готовый телефон",
  14195. WEBVR_VIEW_CARDBOARD: "Или просмотреть в Google Cardboard",
  14196. VR_WHAT_YOU_NEED: "Что Вам потребуется...",
  14197. VR_NEED_DAYDREAM_PHONE: "Daydream-готовый телефон",
  14198. VR_GOOGLE_DAYDREAM: "Google Daydream",
  14199. VR_APP: "port VR App",
  14200. VR_APP_OPEN: "Или открыть через приложение port VR",
  14201. VR_COMPATIBLE_ANDROID_LONG: 'Совместимые Android устройства с диагональю экрана 4.5"-5.5" дюймов и Android версией 4.4.4, и выше',
  14202. VR_SAMSUNG_DETAIL: "Galaxy S6 и выше",
  14203. VR_APP_FOR_ANDROID: "Приложение port VR для Android",
  14204. VR_NEED_DAYDREAM: "Необходимо для соединением с Daydream",
  14205. VR_VIEW_SPACE: "Запустить модель в VR",
  14206. VR_LEARN_MORE_CAPS: "УЗНАТЬ БОЛЬШЕ",
  14207. VR_PREVIOUS_CAPS: "ПРЕДЫДУЩИЙ",
  14208. VR_NEXT_CAPS: "СЛЕДУЮЩИЙ",
  14209. VR_GOT_IT_CAPS: "ЯСНО",
  14210. VR_SHOW_SUPPORTED: "Нажмите, чтобы просмотреть модель в VR с помощью",
  14211. VR_SHOW_UNSUPPORTED: "Извините, но Ваше устройство не соответствует минимальным требованиям для просмотра модели в VR.",
  14212. VR_SHOW_IOS_1: "Нажмите, чтобы просмотреть модель в VR",
  14213. VR_SHOW_IOS_2: "Для просмотра требуется приложение port VR и совместимый iPhone",
  14214. VR_NEED_CARDBOARD: "Что Вам потребуется для Google Cardboard",
  14215. VR_NEED_SAMSUNG: "Что Вам потребуется для Samsung Gear VR",
  14216. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  14217. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  14218. VR_COMPATIBLE_IPHONES_1: "iPhones",
  14219. VR_COMPATIBLE_IPHONES_2: "iPhone 5s или новее с iOS 9.1 и выше",
  14220. VR_COMPATIBLE_IPHONES_3: "Совместимые модели iPhone",
  14221. VR_COMPATIBLE_ANDROID: "Совместимые Android устройства",
  14222. VR_ANDROID_DETAIL: 'Экран от 4.5" до 5.5" и Android 4.4.4, и выше',
  14223. VR_ANDROID_DVICES: "Android устройства",
  14224. VR_COMPATIBLE_SAMSUNG: "Совместимые Samsung устройства",
  14225. VR_APP_FOR_CARDBOARD: "Приложение port VR для Google Cardboard",
  14226. VR_APP_FOR_SAMSUNG: "Приложение port VR для Gear VR",
  14227. VR_DOWNLOAD_HERE: "Скачать здесь",
  14228. VR_REQUIRE_HEADSET: "Требуется VR-шлем и установленное приложение port VR для Android",
  14229. VR_REDIRECT_TO_STORE: "Если приложение не установлено, Вы будете перенаправлены на страницу магазина приложений.",
  14230. VR_IMPROPER_EMBED: "port модель не встроена должным образом для поддержки VR в вашем веб-браузере.",
  14231. VR_OPEN_ANDROID_LINK: "Откройте ссылку на Вашем мобильном телефоне",
  14232. VR_ANDROID_OPTIONS: "Доступные опции VR-шлемов",
  14233. SHARE_TO: "Поделиться",
  14234. SHARE_LINK: "Прямая ссылка",
  14235. SHARE_EXPLORE: "просмотреть",
  14236. SHARE_AT: "на",
  14237. SHARE_WITH: "с",
  14238. SHARE_3D: "в 3D",
  14239. SHARE_COPIED: "Скопировано!",
  14240. ERROR_BROWSER_SOLUTION: "установите новый браузер, чтобы просмотреть 3D пространство.",
  14241. ERROR_BROWSER_EXPLANATION: "WebGL требует современный браузер.",
  14242. ERROR_GENERIC_PROBLEM: "Ой, что-то пошло не так.",
  14243. ERROR_GENERIC_SOLUTION: "Перезапустите браузер.",
  14244. ERROR_GENERIC_ACTIONS_1: "Если проблема не устранена, ",
  14245. ERROR_GENERIC_ACTIONS_2: "установите поддерживаемый браузер",
  14246. ERROR_GENERIC_ACTIONS_3: " или ",
  14247. ERROR_GENERIC_ACTIONS_4: "смотрите наше руководство по устранению неполадок",
  14248. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Браузер не поддерживается.",
  14249. ERROR_WEBGL_IOS_PROBLEM: "iOS-версия не поддерживается.",
  14250. ERROR_WEBGL_IOS_SOLUTION: "Обновите до iOS 8 или выше, чтобы просмотреть пространство в 3D.",
  14251. ERROR_WEBGL_IOS_ACTIONS_1: "Нажмите ",
  14252. ERROR_WEBGL_IOS_ACTIONS_2: "Настройки > Общие > Обновление ПО",
  14253. ERROR_WEBGL_SAFARI_PROBLEM: "Включите WebGL для 3D-просмотра.",
  14254. ERROR_WEBGL_SAFARI_ACTIONS_1: "Нажмите ",
  14255. ERROR_WEBGL_SAFARI_ACTIONS_2: "Настойки > Дополнения > Показывать меню “Разработка” в строке меню",
  14256. ERROR_WEBGL_SAFARI_ACTIONS_3: "Затем нажмите ",
  14257. ERROR_WEBGL_SAFARI_ACTIONS_4: "Разработка > Разрешить WebGL",
  14258. ERROR_MISSING_URLS_PROBLEM: "Ой, для этой модели нет панорамы.",
  14259. ERROR_MISSING_URLS_EXPLANATION: "Эта модель устарела. У владельца веб-сайта может быть новая модель.",
  14260. ERROR_LOADING_FAILED_PROBLEM: "Ой, модель недоступна.",
  14261. ERROR_LOADING_FAILED_ACTIONS_1: "Если проблема не устранена, ",
  14262. ERROR_LOADING_FAILED_ACTIONS_2: "посмотрите наше руководство по устранению неполадок",
  14263. ERROR_MAINTENANCE_PROBLEM: "Выполняется техническое обслуживание.",
  14264. ERROR_MAINTENANCE_SOLUTION: "Пожалуйста, попробуйте снова через несколько минут.",
  14265. LINK_TO_LOCATION: "Ссылка на местоположение",
  14266. MENU_COPY: "Копировать",
  14267. LINK_ALERT_COPY: "Для того, чтобы скопировать, пожалуйста, используйте CTRL/CMD + C.",
  14268. ROTATE: "Вращать",
  14269. MOVE: "Передвигаться",
  14270. INSIDE: "Вид изнутри",
  14271. ZOOM: "Масштаб"
  14272. }
  14273. }
  14274. , {}],
  14275. 116: [function(e, t, i) {//main.js
  14276. (function(t) {
  14277. "use strict";
  14278. var modelProgressBase = 0.4;
  14279. var progressUpdate = function(e){ // 0 <= e <= 1
  14280. console.log('e1:'+e)
  14281. e = Math.round(modelProgressBase * e * 100);
  14282. console.log('e2:'+e)
  14283. var t = $('.progressbar');
  14284. t.find('.bar').css('width',e+'%');
  14285. t.find('.label').css('left', t.width() * e / 100 - 15 + 'px' ); //上面跟着的字的百分比
  14286. t.find('.perc').text(e +'%'); //具体数字的百分比
  14287. }
  14288. $('#gui-loading').fadeIn(200);
  14289. progressUpdate(0.1)
  14290. var fileName = g_version ? 'modeldata.js' : 'someData.json' ;
  14291. $.ajax(g_Prefix + "data/"+window.number+"/"+fileName+"?"+randomTime().getTime(),{dataType: "json"}).done( function(e){ //改
  14292. var data = matcher(e);
  14293. data.files.templates[0] = g_Prefix + e.files.templates[0].replace("{{number}}",window.number);
  14294. data.user = {
  14295. "is_authenticated": false,
  14296. "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"]
  14297. }
  14298. try{//处理一下导览数据
  14299. data.model.images = data.model.images.filter(e=>{
  14300. if(!e.locations && !e.thumbnail_signed_src)return; //旧的曾有导览数据是错误的,将它删除
  14301. if(e.locations && e.locations.length == 0)return;
  14302. return e
  14303. })
  14304. }catch(e){console.log(e) }
  14305. window.DATA = data;
  14306. data.model.summary = data.summary
  14307. data.model.name = data.name
  14308. for(let i in data){
  14309. data[i] == "false" && (data[i] = false)
  14310. }
  14311. progressUpdate(0.7);
  14312. StartLoad(); //xzw someData.js是我整合的 原本在html里 但这样每个场景的html都不一样了
  14313. if(data.weixinDesc){
  14314. g_weixinObj.desc = data.weixinDesc;
  14315. }
  14316. if(data.shareImgUrl){
  14317. g_weixinObj.imgUrl = data.shareImgUrl
  14318. }
  14319. window.wx && manage.weixinShare();
  14320. //初始画面
  14321. data.camera_start && data.camera_start.thumbImg && E(data.camera_start.thumbImg)
  14322. function E(e) {
  14323. $("<img/>").attr("src", e).on("load", function() {
  14324. $("#gui-thumb").css("backgroundImage", "url(" + e + ")").fadeIn(500),
  14325. $(this).remove()
  14326. })
  14327. }
  14328. //背景
  14329. settings.transparentBg = settings.transparentBg || data.transparentBg || false,
  14330. settings.bgImg = settings.bgImg || data.bgImg || null
  14331. if(settings.bgImg){
  14332. $("#player").css({'background-image': "url("+settings.bgImg+")",
  14333. "background-position": "center center"
  14334. })
  14335. }
  14336. {//初始化导览时间
  14337. if(DATA.tourBlackSpeed == void 0)DATA.tourBlackSpeed = 100
  14338. window._settings.warp.teleportTime = settings.teleportTime / DATA.tourBlackSpeed * 100;
  14339. if(DATA.tourWalkSpeed == void 0)DATA.tourWalkSpeed = 100
  14340. if(DATA.tourRotTime == '' || DATA.tourRotTime == void 0){
  14341. DATA.tourRotTime = settings.tourRotTime; //默认停留2秒
  14342. }
  14343. }
  14344. {//其他
  14345. _settings.floorPlanAngle = DATA.floorPlanAngle || 0
  14346. }
  14347. }).fail(e=>{
  14348. alert("缺少someData文件,请检查场景码是否正确。")
  14349. })
  14350. function StartLoad(){//当加载完data后
  14351. function i() {
  14352. var e = window.number//Y.getModelIDFromQueryString();
  14353. if (!e)
  14354. return b(null, "loading-failed");
  14355. var t = Y.parseSidUrl(e)
  14356. , i = l()
  14357. , a = c()
  14358. , s = o()
  14359. , u = V.quickstart.enabled
  14360. , g = null
  14361. , m = null
  14362. , v = null
  14363. , w = null
  14364. , T = null
  14365. , x = null
  14366. , S = null
  14367. , M = null
  14368. , R = null
  14369. , P = null
  14370. , O = null
  14371. , L = null
  14372. , N = new ue;
  14373. r(s);
  14374. h({ //MP开头写法
  14375. urlBase: t.urlBase
  14376. }).then(function() {
  14377. return re.init(),
  14378. d(t, e) //getModel and load
  14379. }).then(function(e) {
  14380. progressUpdate(0.9)
  14381. return P = e,
  14382. p(P, V.appConfig.segment_key, V.appConfig.keen_write_key, V.appConfig.keen_project_id, {
  14383. startSource: i,
  14384. autoplay: V.autoplay,
  14385. quickstart: u
  14386. }),
  14387. P.urls.init()
  14388. }).then(function() {
  14389. return P.loadPanos()
  14390. }).then(function() {
  14391. m = X.getStartCameraOptions(P, P.panos),
  14392. S = A(P),
  14393. O = y(u, m.mode),
  14394. v = O.controls,
  14395. w = O.player,
  14396. T = O.director,
  14397. x = O.tagManager,
  14398. M = O.tileDownloader,
  14399. R = O.qualityManager,
  14400. L = O.panoRenderer,
  14401. C(P, S, O, s),
  14402. w.director = T,//xzw add
  14403. P.supportsTiles && M.start(),
  14404. !u || m.mode === D.PANORAMA && m.pano || (de.warn("Tried to quickstart, but failed as we are not starting in inside mode."),
  14405. u = !1);
  14406. var e = null;
  14407. if (u) {
  14408. de.warn("Quickstart engaged. Hold on to your knickers.");
  14409. var t = v.controls[D.PANORAMA];
  14410. g = new ie(R,S.scene,S.camera,t,s),
  14411. _(S, s, P),
  14412. e = g.load(m).then(function() {
  14413. S.addComponent(g),
  14414. S.once(le.AfterRender, function() {
  14415. de.warn("First render after quickstart load finished.")
  14416. })
  14417. })
  14418. }
  14419. window.flyToFirst = function(){//xzw add
  14420. var pano = w.model.panos.get("8d778e19657f433fb9cf8947d823bb70");
  14421. var q = new _x.Quaternion(0.7099827027821568,-0.07708150183830938,0.6958985789714591,0.07555241737970636);
  14422. var lookAtPoint = new _x.Vector3(0,0,-1).applyQuaternion(q).add(pano.position);
  14423. w.flyToPano({pano:pano, lookAtPoint:lookAtPoint})
  14424. };
  14425. return $.when(e, U.startLoading(P, w, T, V.autoplay, u, N))
  14426. }).then(function() {
  14427. return f(P, U.onProgress, i, !u, a)
  14428. }).then(function() {
  14429. if (m.quickstart = u,
  14430. I(P, S, O, s),
  14431. S.started || _(S, s, P),
  14432. H.modelLoaded(P, w, v, V.autoplay),
  14433. E(w, P, m, V.autoplay).done(function() {
  14434. T.autoTour()
  14435. }),
  14436. !P.supportsTiles) {
  14437. var e = new Z(P,w);
  14438. e.start()
  14439. }
  14440. u && (S.removeComponent(g),
  14441. g.destroy(),
  14442. m.pano.enter()),
  14443. U.init(P, T, w, v, S, m, H.getSessionId()),
  14444. U.endLoading(P, T, x),
  14445. S.once(le.AfterRender, function() {
  14446. N.setAppReadyTime();
  14447. var e = N.calcFullLoadingTime();
  14448. de.warn("Total load time: " + e / 1e3),
  14449. H.loadComplete(e),
  14450. de.warn("First render after model load finished.")
  14451. }),
  14452. S.on(le.MemoryUsageUpdated, n)
  14453. }).fail(b.bind(this, e))
  14454. }
  14455. function n(e) {
  14456. ce.update(e)
  14457. }
  14458. function r(e) {
  14459. de.info("Version", "2.25.6-0-gd87e5b1"),
  14460. q.defaultMaxListeners = 1e3,
  14461. a(e),
  14462. s()
  14463. }
  14464. function o() {
  14465. return document.getElementById("player")
  14466. }
  14467. function a(e) {
  14468. e.addEventListener("dragenter", T, !1),
  14469. e.addEventListener("dragover", T, !1)
  14470. }
  14471. function s() {
  14472. F.valueFromHash("title", !0) || $(document).ready(function() {
  14473. var e = $(".model-title");
  14474. e.hide()
  14475. })
  14476. }
  14477. function l() {
  14478. return F.valueFromHash("play", !1) ? "autoplay" : F.inIframe() ? "click" : "fullpage"
  14479. }
  14480. function c() {
  14481. return {
  14482. panoElementsToLoad: 6,
  14483. modelElementsToLoad: 0,
  14484. totalElementsLoaded: 0,
  14485. totalElementsToLoad: 0,
  14486. totalPercentageLoaded: 0,
  14487. progressCallback: null
  14488. }
  14489. }
  14490. function h(e) {
  14491. return K.loadFeatureFlags(e).done(function(e) {
  14492. K.updateDependentSettings(e, V)
  14493. })
  14494. }
  14495. // function u(e) {
  14496. // return Q.get(e.urlBase + "/api/v1/config/showcase", {
  14497. // responseType: "json",
  14498. // prefetchFrom: "config"
  14499. // }).then(function(e) {
  14500. // return e ? void j.extendObject(V.appConfig, e) : {}
  14501. // }, function(e) {
  14502. // return de.warn("Failed loading runtime config, using defaults."),
  14503. // $.when({})
  14504. // })
  14505. // }
  14506. function d(e, t) {
  14507. var i = B.getModel({
  14508. url: t,
  14509. floors: F.valueFromHash("f", !0),
  14510. autoload: !1
  14511. })
  14512. ;
  14513. return $.when(i, n).then(null, function(e) {
  14514. return this
  14515. })
  14516. }
  14517. function p(e, t, i, n, r) {
  14518. de.info("Model data loaded"),
  14519. de.debug("UUID: " + e.data.job.uuid),
  14520. J.init(K.getFlags()),
  14521. i && H.initKeen({
  14522. token: i,
  14523. appId: n
  14524. }),
  14525. H.initSegment({
  14526. model: e.sid,
  14527. version: "2.25.6-0-gd87e5b1",
  14528. startSource: r.startSource,
  14529. token: t,
  14530. autoplay: r.autoplay,
  14531. quickstart: r.quickstart
  14532. })
  14533. }
  14534. function f(e, t, i, n, r) {
  14535. return r.progressCallback = t,
  14536. H.sessionStart(),
  14537. e.load(n).progress(g.bind(this, r))
  14538. }
  14539. function g(e, t) {
  14540. e.modelElementsToLoad = t[1],
  14541. v(e),
  14542. m(e)
  14543. }
  14544. function m(e) {
  14545. e.totalElementsLoaded++,
  14546. e.totalPercentageLoaded = e.totalElementsLoaded / e.totalElementsToLoad,
  14547. //----许钟文-----------------模型进度条向后调整
  14548. isNaN(e.totalPercentageLoaded) && (e.totalPercentageLoaded = 0);
  14549. e.totalPercentageLoaded = modelProgressBase + (1-modelProgressBase)*e.totalPercentageLoaded;
  14550. console.log('pro:'+e.totalPercentageLoaded)
  14551. //---------------------------
  14552. e.progressCallback && e.progressCallback(100 * e.totalPercentageLoaded)
  14553. }
  14554. function v(e) {
  14555. e.totalElementsToLoad = e.modelElementsToLoad + e.panoElementsToLoad
  14556. }
  14557. function A(e) {
  14558. var t = new x.PerspectiveCamera;
  14559. t.layers.enable(he.PANOMARKERS),
  14560. t.layers.enable(he.RETICULE),
  14561. t.layers.enable(he.TAG);
  14562. var i = new x.Scene
  14563. , n = new x.AmbientLight(16777215);
  14564. i.add(n),
  14565. i.plane = new x.Mesh(new x.PlaneBufferGeometry(1e5,1e5),new x.RawShaderMaterial({
  14566. side: x.DoubleSide
  14567. })),
  14568. i.plane.position.y = 0,
  14569. i.plane.rotateX(-Math.PI / 2),
  14570. i.plane.material.visible = !1,
  14571. i.add(i.plane),
  14572. i.updateMatrixWorld(),
  14573. V.showScreenshotLocations && e.data.images.forEach(function(e) {
  14574. if (e.metadata && e.metadata.camera_position) {
  14575. var t = e.metadata.camera_position
  14576. , n = new x.Mesh(new x.BoxGeometry(.3,.3,.3));
  14577. n.position = t.clone(),
  14578. i.add(n);
  14579. var r = e.metadata.camera_quaternion
  14580. , o = new x.Vector3(0,0,-1).applyQuaternion(r);
  14581. i.add(new x.ArrowHelper(o,t.clone(),1,16711680))
  14582. }
  14583. }),
  14584. V.showAxis && (i.add(new x.ArrowHelper(new x.Vector3(0,1,0),new x.Vector3(0,0,0),1,255)),
  14585. i.add(new x.ArrowHelper(new x.Vector3(0,0,1),new x.Vector3(0,0,0),1,16711680)),
  14586. i.add(new x.ArrowHelper(new x.Vector3(1,0,0),new x.Vector3(0,0,0),1,65280)));
  14587. //背景
  14588. if(!settings.transparentBg && !settings.bgImg){
  14589. i.skybox = new W
  14590. i.add(i.skybox)
  14591. }
  14592. var r = new te(i,t,z);
  14593. return r
  14594. }
  14595. function y(e, t) {
  14596. var i = e ? 1 : 1e3
  14597. , n = J.tilegen || J.imgopt ? 6 : 2;
  14598. n = F.valueFromHash("tileconc", n);
  14599. var r = new ne
  14600. , o = new ae({
  14601. concurrentDownloads: n
  14602. })
  14603. , a = new se
  14604. , s = new P
  14605. , l = new M
  14606. , c = new S(t)
  14607. , h = new R
  14608. , u = new O(i)
  14609. , d = new L
  14610. , p = new oe;
  14611. return {
  14612. qualityManager: r,
  14613. panoRenderer: a,
  14614. tileDownloader: o,
  14615. player: c,
  14616. director: l,
  14617. modelManager: s,
  14618. tagManager: p,
  14619. displayController: u,
  14620. labelDisplayController: d,
  14621. controls: h
  14622. }
  14623. }
  14624. function C(e, t, i, n) {
  14625. var r = i.controls
  14626. , o = i.qualityManager
  14627. , a = i.panoRenderer
  14628. , s = i.tileDownloader
  14629. , l = i.modelManager;
  14630. r.init(n, l),
  14631. ee.init(i.director, r, i.player, l, t),
  14632. o.init(l),
  14633. s.init(o),
  14634. a.init(t, s, o),
  14635. l.init(s, a, o),
  14636. l.addModel(e),
  14637. t.addComponent(G)
  14638. }
  14639. function I(e, t, i, n) {
  14640. var r = i.qualityManager
  14641. , o = i.panoRenderer
  14642. , a = i.tileDownloader
  14643. , s = i.modelManager
  14644. , l = i.player
  14645. , c = i.director
  14646. , h = i.tagManager
  14647. , u = i.displayController
  14648. , d = i.labelDisplayController
  14649. , p = i.controls;
  14650. t.scene.add(e),
  14651. t.qualityManager = r;
  14652. var f = {
  14653. camera: t.camera,
  14654. director: c,
  14655. modelManager: s,
  14656. tileDownloader: a,
  14657. panoRenderer: o,
  14658. qualityManager: r,
  14659. tagManager: h,
  14660. container: n,
  14661. controls: p
  14662. };
  14663. l.init(f),
  14664. l.setScene(t.scene),
  14665. h.init(s, l),
  14666. c.init(l, s),
  14667. u.init(c, l, s, h, n),
  14668. d.init(l, s, n),
  14669. z.bindEvents(l),
  14670. t.addComponent(h),
  14671. t.addComponent(l),
  14672. t.addComponent(o),
  14673. l.sceneRenderer = t; //xzw add 方便resize
  14674. }
  14675. function E(e, t, i, n) {
  14676. return de.info("Starting player in " + i.mode),
  14677. H.report(t.sid, "started-playing", n, i.quickstart),
  14678. e.start(i)
  14679. }
  14680. function b(e, t) {
  14681. de.error(t),
  14682. k.error(t),
  14683. H.report(e, "error-" + t)
  14684. }
  14685. function w(e) {
  14686. var t = F.details();
  14687. t && "Safari" === t.name && t.version > 500 && t.version < 600 ? (k.error("webgl-safari"),
  14688. H.report(e, "error-webgl-safari")) : (k.error("webgl-generic"),
  14689. H.report(e, "error-webgl-generic"))
  14690. }
  14691. function _(e, t, i) {
  14692. try {
  14693. e.start(t)
  14694. } catch (e) {
  14695. throw de.warn(e.message),
  14696. w(i.sid),
  14697. e
  14698. }
  14699. }
  14700. function T(e) {
  14701. e.stopPropagation(),
  14702. e.preventDefault()
  14703. }
  14704. //czj 判断someData 有没有hoticon字段 修改热点的样式
  14705. if (window.DATA.hoticon){
  14706. g_HotImage = {
  14707. point: window.DATA.hoticon.default || "https://super.4dage.com/images/4dagePoint2.png",
  14708. point2: window.DATA.hoticon.higt || "https://super.4dage.com/images/4dagePoint.png"
  14709. } ;
  14710. }
  14711. //czj 判断someData 有没有backgroundMusic 添加音乐
  14712. if (window.DATA.backgroundMusic) {
  14713. if(window.isLocal){
  14714. SoundManager.setSrc('bgm', manage.dealURL(window.DATA.backgroundMusic))
  14715. }else{
  14716. SoundManager.setSrc('bgm', window.DATA.backgroundMusic )
  14717. }
  14718. $("#volume").show();
  14719. }else if (g_version === "one"){
  14720. SoundManager.setSrc('bgm', manage.dealURL( g_Prefix+"/audio/"+"audio"+window.number + "/background.mp3"))
  14721. $("#volume").show();
  14722. }
  14723. //隐藏公司logo
  14724. if(window.DATA.loadlogo){
  14725. showLogo();
  14726. }
  14727. e("./lib/three75-shim"),
  14728. e("./lib/array-polyfill"),
  14729. e("./lib/performance-polyfill"),
  14730. e("./lib/shaders/CopyShader.js"),
  14731. e("./lib/shaders/HorizontalBlurShader.js"),
  14732. e("./lib/shaders/VerticalBlurShader.js"),
  14733. e("./lib/postprocessing/EffectComposer.js"),
  14734. e("./lib/postprocessing/RenderPass.js"),
  14735. e("./lib/postprocessing/MaskPass.js"),
  14736. e("./lib/postprocessing/ShaderPass.js"),
  14737. window.Promise || (window.Promise = e("promise-polyfill"));
  14738. var x = e("three")
  14739. , _x = e("three")
  14740. , S = (e("./util/sentry"),
  14741. e("./player"))
  14742. , M = e("./director")
  14743. , R = e("./controls/CameraControls")
  14744. , P = e("./model/ModelManager")
  14745. , O = e("./DisplayController")
  14746. , L = e("./label/LabelDisplayController")
  14747. , D = e("./enum/Viewmode")
  14748. , N = e("./util/logger")
  14749. , B = e("./showcase")
  14750. , F = e("./util/browser")
  14751. , V = e("./settings")
  14752. , U = e("./gui/gui")
  14753. , k = e("./gui/error")
  14754. , H = e("./analytics")
  14755. , G = e("./util/transitions")
  14756. , z = e("./effects")
  14757. , W = e("./objects/Skybox")
  14758. , j = e("./util/common")
  14759. , Y = (e("./util/PanoramaCollection"),
  14760. e("./util/math"),
  14761. e("./util/showcase"))
  14762. , X = e("./util/camera")
  14763. , Z = (e("./objects/Panorama"),
  14764. e("./cameras/PanoramaCamera"),
  14765. e("./preloaders"))
  14766. , q = e("events").EventEmitter
  14767. , K = e("./featureflags")
  14768. , Q = (e("./util/lerp"),
  14769. e("./util/ajax"))
  14770. , J = e("./ab")
  14771. , ee = e("./sdk/automation.js")
  14772. , te = e("./scene/SceneRenderer")
  14773. , ie = e("./scene/QuickstartManager")
  14774. , ne = e("./tile/QualityManager.js")
  14775. , re = e("./localization/localize")
  14776. , oe = e("./tag/tagManager")
  14777. , ae = e("./tile/TileDownloader")
  14778. , se = e("./tile/PanoRenderer")
  14779. , le = (e("./enum/PanoSizeClass"),
  14780. e("./enum/PanoramaEvents"),
  14781. e("./enum/SceneRendererEvents"))
  14782. , ce = e("./gui/memoryUsage")
  14783. , he = e("./enum/RenderLayers")
  14784. , ue = e("./TimingData")
  14785. , de = new N(t);
  14786. N.level = V.logLevel,
  14787. N.consoleEnabled = V.console,
  14788. i()
  14789. }
  14790. }
  14791. ).call(this, "/js/main.js")
  14792. }
  14793. , {
  14794. "./DisplayController": 1,
  14795. "./TimingData": 2,
  14796. "./ab": 3,
  14797. "./analytics": 4,
  14798. "./cameras/PanoramaCamera": 7,
  14799. "./controls/CameraControls": 9,
  14800. "./director": 15,
  14801. "./effects": 16,
  14802. "./enum/PanoSizeClass": 36,
  14803. "./enum/PanoramaEvents": 37,
  14804. "./enum/RenderLayers": 41,
  14805. "./enum/SceneRendererEvents": 43,
  14806. "./enum/Viewmode": 51,
  14807. "./featureflags": 59,
  14808. "./gui/error": 64,
  14809. "./gui/gui": 65,
  14810. "./gui/memoryUsage": 73,
  14811. "./label/LabelDisplayController": 91,
  14812. "./lib/array-polyfill": 92,
  14813. "./lib/performance-polyfill": 95,
  14814. "./lib/postprocessing/EffectComposer.js": 96,
  14815. "./lib/postprocessing/MaskPass.js": 97,
  14816. "./lib/postprocessing/RenderPass.js": 98,
  14817. "./lib/postprocessing/ShaderPass.js": 99,
  14818. "./lib/shaders/CopyShader.js": 100,
  14819. "./lib/shaders/HorizontalBlurShader.js": 101,
  14820. "./lib/shaders/VerticalBlurShader.js": 102,
  14821. "./lib/three75-shim": 103,
  14822. "./localization/localize": 108,
  14823. "./tag/tagManager": 124,
  14824. "./model/ModelManager": 140,
  14825. "./objects/Panorama": 148,
  14826. "./objects/Skybox": 152,
  14827. "./player": 155,
  14828. "./preloaders": 156,
  14829. "./scene/QuickstartManager": 157,
  14830. "./scene/SceneRenderer": 158,
  14831. "./sdk/automation.js": 164,
  14832. "./settings": 166,
  14833. "./showcase": 168,
  14834. "./tile/PanoRenderer": 169,
  14835. "./tile/QualityManager.js": 170,
  14836. "./tile/TileDownloader": 171,
  14837. "./util/PanoramaCollection": 178,
  14838. "./util/ajax": 181,
  14839. "./util/browser": 182,
  14840. "./util/camera": 183,
  14841. "./util/common": 185,
  14842. "./util/lerp": 188,
  14843. "./util/logger": 189,
  14844. "./util/math": 190,
  14845. "./util/sentry": 192,
  14846. "./util/showcase": 193,
  14847. "./util/transitions": 195,
  14848. events: 202,
  14849. "promise-polyfill": 213,
  14850. three: 217
  14851. }],
  14852. 117: [function(e, t, i) {
  14853. "use strict";
  14854. function n(e) {
  14855. e = e || {}
  14856. r.RawShaderMaterial.call(this, a.extendObject({
  14857. fragmentShader: o.cube.fragmentShader,
  14858. vertexShader: o.cube.vertexShader,
  14859. uniforms: r.UniformsUtils.clone(o.cube.uniforms),
  14860. name: "CubemapMaterial",
  14861. }, e))
  14862. }
  14863. var r = e("three")
  14864. , o = e("../shaders")
  14865. , a = e("../util/common");
  14866. n.prototype = Object.create(r.RawShaderMaterial.prototype),
  14867. n.prototype.constructor = n,
  14868. t.exports = n
  14869. }
  14870. , {
  14871. "../shaders": 167,
  14872. "../util/common": 185,
  14873. three: 217
  14874. }],
  14875. 118: [function(e, t, i) {
  14876. "use strict";
  14877. function n(e) {
  14878. e = e || {}
  14879. r.RawShaderMaterial.call(this, a.extendObject({
  14880. fragmentShader: o.model.fragmentShader,
  14881. vertexShader: o.model.vertexShader,
  14882. uniforms: r.UniformsUtils.clone(o.model.uniforms),
  14883. name: "ModelTextureMaterial",
  14884. }, e))
  14885. }
  14886. var r = e("three")
  14887. , o = e("../shaders")
  14888. , a = e("../util/common");
  14889. n.prototype = Object.create(r.RawShaderMaterial.prototype),
  14890. n.prototype.constructor = n,
  14891. n.prototype.setProjectedPanos = function(e, t, i) {
  14892. i && (this.uniforms.progress.value = 0),
  14893. e.ensureSkyboxReadyForRender(),
  14894. this.uniforms.pano0Map.value = e.getSkyboxTexture(),
  14895. this.uniforms.pano0Position.value.copy(e.position),
  14896. this.uniforms.pano0Matrix.value.copy(e.skyboxMesh.matrixWorld),
  14897. t.ensureSkyboxReadyForRender(),
  14898. this.uniforms.pano1Map.value = t.getSkyboxTexture(),
  14899. this.uniforms.pano1Position.value.copy(t.position),
  14900. this.uniforms.pano1Matrix.value.copy(t.skyboxMesh.matrixWorld)
  14901. }
  14902. /* n.prototype.setEyeDir = function(dir, pos) {//加
  14903. this.uniforms.eyeDir.value.copy(dir)
  14904. this.uniforms.eyePos.value.copy(pos)
  14905. }
  14906. n.prototype.setBendCameraQua = function(matrix) {//加
  14907. this.uniforms.cameraDeltaMatrix.value.copy(matrix)
  14908. } */
  14909. ,
  14910. t.exports = n
  14911. }
  14912. , {
  14913. "../shaders": 167,
  14914. "../util/common": 185,
  14915. three: 217
  14916. }],
  14917. 119: [function(e, t, i) {
  14918. (function(i) {
  14919. "use strict";
  14920. function n(e, t, i, n) {
  14921. this.div = null,
  14922. this.body = null,
  14923. this.label = e,
  14924. this.description = t,
  14925. this.parsedDescription = [],
  14926. this.media = i || {
  14927. type: null
  14928. },
  14929. this.loadingSpinner = null,
  14930. this.parser = new r({
  14931. supportLinks: !u.valueFromHash("mls"),
  14932. keepLinkLabels: !0
  14933. }),
  14934. this.state = I.CLOSED,
  14935. this.orientation = "",
  14936. this.initialTransform = "",
  14937. this.hovering = !1,
  14938. this.openTransition = null,
  14939. this.closeTransition = null,
  14940. this.openPromise = null,
  14941. this.closePromise = null,
  14942. this.animationTransition = null,
  14943. this.animationScale = 0
  14944. }
  14945. var r = e("../Parser/DescriptionParser")
  14946. , o = e("../Media/Link")
  14947. , a = e("../Media/Image")
  14948. , s = e("../Media/EmbedlyPlayer")
  14949. , l = e("../Media/EmbedlyEmbed")
  14950. , c = e("../../util/transitions")
  14951. , h = e("../../util/lerp")
  14952. , u = e("../../util/browser")
  14953. , d = e("./BillboardEvent")
  14954. , p = e("../Media/MediaEvent")
  14955. , f = e("../Parser/DescriptionChunkType")
  14956. , g = e("events").EventEmitter
  14957. , m = e("./billboardSettings")
  14958. , v = e("./overlaySettings")
  14959. , A = e("../../util/logger")
  14960. , y = new A(i)
  14961. , C = document.getElementById("tag-billboards");
  14962. C.addEventListener("touchend", function(e) {
  14963. C.style.pointerEvents = "none"
  14964. }),
  14965. C.addEventListener("touchcancel", function(e) {
  14966. C.style.pointerEvents = "none"
  14967. });
  14968. var I = {
  14969. CLOSED: "closed",
  14970. OPENING: "opening",
  14971. OPEN: "open",
  14972. CLOSING: "closing",
  14973. ACTIVE: "active"
  14974. };
  14975. n.prototype = Object.create(g.prototype),
  14976. n.prototype.build = function(e) {
  14977. this.parsedDescription = this.parser.parse(this.description);
  14978. var t = document.createElement("div");
  14979. t.className = "tag-container has-hotzone",
  14980. this.div = t,
  14981. this.body = document.createElement("div"),
  14982. this.body.className = "tag-body";
  14983. var i = document.createElement("div");
  14984. i.classList.add("tag-content");
  14985. var n = document.createElement("div");
  14986. n.classList.add("tag-text-content");
  14987. var r = document.createElement("div");
  14988. r.className = "tag-label",
  14989. r.textContent = this.label,
  14990. n.appendChild(r);
  14991. var o = document.createElement("div");
  14992. o.className = "tag-desc",
  14993. n.appendChild(o),
  14994. i.appendChild(n),
  14995. this.body.appendChild(i),
  14996. this.appendDescriptionElements(this.parsedDescription, o),
  14997. this.appendMedia(),
  14998. t.appendChild(this.body),
  14999. C.appendChild(t),
  15000. this.bindEvents(t, this.body)
  15001. }
  15002. ,
  15003. n.prototype.bindEvents = function(e, t) {
  15004. var i = function(e) {
  15005. return function(t) {
  15006. if (!this.div.classList.contains("overlay")) {
  15007. var i, n = document.getElementById("player");
  15008. try {
  15009. i = new MouseEvent(e,t)
  15010. } catch (n) {
  15011. i = document.createEvent("MouseEvents"),
  15012. 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)
  15013. }
  15014. n.dispatchEvent(i)
  15015. }
  15016. }
  15017. };
  15018. t.addEventListener("mousedown", function(e) {
  15019. e.stopPropagation()
  15020. }),
  15021. t.addEventListener("mouseup", function(e) {
  15022. e.stopPropagation()
  15023. }),
  15024. e.addEventListener("touchstart", function(e) {
  15025. C.style.pointerEvents = "auto"
  15026. }),
  15027. e.addEventListener("mousedown", i("mousedown").bind(this)),
  15028. e.addEventListener("mouseup", i("mouseup").bind(this)),
  15029. t.addEventListener("mouseover", function(t) {
  15030. this.state === I.OPEN && e.classList.remove("has-hotzone")
  15031. }
  15032. .bind(this)),
  15033. e.addEventListener("mouseenter", function(e) {
  15034. this.state !== I.CLOSING && (this.hovering = !0,
  15035. this.emit(d.ENTER))
  15036. }
  15037. .bind(this)),
  15038. e.addEventListener("mouseleave", function(e) {
  15039. this.hovering = !1,
  15040. this.emit(d.LEAVE)
  15041. }
  15042. .bind(this)),
  15043. e.addEventListener("gesturestart", function(e) {
  15044. e.preventDefault()
  15045. });
  15046. var n = e.querySelector(".tag-text-content")
  15047. , r = 0;
  15048. n.addEventListener("touchstart", function(e) {
  15049. r = e.changedTouches[0].clientY
  15050. }),
  15051. n.addEventListener("touchmove", function(t) {
  15052. function i(e) {
  15053. e && (0 === e.scrollTop && t.changedTouches[0].clientY > r || e.scrollTop + e.clientHeight - e.scrollHeight === 0 && t.changedTouches[0].clientY < r) && t.preventDefault()
  15054. }
  15055. return e.classList.contains("overlay") ? i(this.querySelector(".tag-desc")) : void i(this)
  15056. }),
  15057. e.addEventListener("touchmove", function(e) {
  15058. 0 === (n.compareDocumentPosition(e.target) & Node.DOCUMENT_POSITION_CONTAINED_BY) && e.preventDefault()
  15059. })
  15060. }
  15061. ,
  15062. n.prototype.appendDescriptionElements = function(e, t) {
  15063. e.length > 0 && this.div.classList.add("has-text"),
  15064. e.forEach(function(e, i) {
  15065. switch (e.type) {
  15066. case f.TEXT:
  15067. t.appendChild(this.createTextElement(e.text));
  15068. break;
  15069. case f.LINK:
  15070. t.appendChild(this.createLinkElement(e.link))
  15071. }
  15072. }
  15073. .bind(this))
  15074. }
  15075. ,
  15076. n.prototype.appendLoadingSpinner = function() {
  15077. this.loadingSpinner = document.createElement("div"),
  15078. this.loadingSpinner.classList.add("loading-spinner");
  15079. var e = document.createElement("div");
  15080. e.classList.add("gui-spinner-icon"),
  15081. this.loadingSpinner.appendChild(e),
  15082. this.body.appendChild(this.loadingSpinner)
  15083. }
  15084. ,
  15085. n.prototype.onMediaLoadFinished = function() {
  15086. this.loadingSpinner && (this.loadingSpinner.parentNode.removeChild(this.loadingSpinner),
  15087. this.applyOrientation(this.orientation),
  15088. this.loadingSpinner = null)
  15089. }
  15090. ,
  15091. n.prototype.appendMedia = function() {
  15092. if (this.media && this.media.type && "error" !== this.media.type && (!u.valueFromHash("mls", 0) || this.media.type === f.IMAGE)) {
  15093. this.appendLoadingSpinner();
  15094. var e = document.createElement("div");
  15095. e.classList.add("tag-media-content");
  15096. var t = document.createElement("i");
  15097. switch (["icon", "icon-close-thin", "close"].forEach(function(e) {
  15098. t.classList.add(e)
  15099. }),
  15100. this.body.appendChild(t),
  15101. this.body.appendChild(e),
  15102. this.media.type) {
  15103. case f.IMAGE:
  15104. e.appendChild(this.createImageElement(this.media, this.body));
  15105. break;
  15106. case f.VIDEO:
  15107. e.appendChild(this.createVideoElement(this.media, this.body));
  15108. break;
  15109. case f.RICH:
  15110. e.appendChild(this.createEmbedElement(this.media, this.body))
  15111. }
  15112. }
  15113. }
  15114. ,
  15115. n.prototype.createTextElement = function(e) {
  15116. var t = document.createElement("span");
  15117. return t.textContent = e,
  15118. t
  15119. }
  15120. ;
  15121. n.prototype.createLinkElement = function(e) {
  15122. var t = new o(e);
  15123. return t.on(p.LINK_CLICK, this.emit.bind(this, p.LINK_CLICK)),
  15124. t.createDomElement()
  15125. }
  15126. ,
  15127. n.prototype.createImageElement = function(e, t) {
  15128. function i() {
  15129. function e() {
  15130. m || (r.classList.remove("view-image"),
  15131. c.classList.add("overlay"),
  15132. i(),
  15133. window.addEventListener("resize", b),
  15134. c.addEventListener("click", a),
  15135. g.addEventListener("click", l),
  15136. f.addEventListener("click", s),
  15137. m = !0,
  15138. o.emit(p.IMAGE_OPENED))
  15139. }
  15140. function i() {
  15141. t.classList.add("show-info"),
  15142. h.classList.remove("collapsible"),
  15143. h.style.height = "";
  15144. var e = parseFloat(getComputedStyle(I).lineHeight)
  15145. , i = y + e
  15146. , r = c.clientWidth - 2 * v.boundaryWidth - C
  15147. , a = c.clientHeight - 2 * v.boundaryHeight - C - i
  15148. , s = a
  15149. , l = s * n.aspect;
  15150. l > r && (l = r,
  15151. s = l / n.aspect),
  15152. s > a && (s = a,
  15153. l = s * n.aspect),
  15154. l += C,
  15155. s += C + i,
  15156. t.style.width = l + "px",
  15157. t.style.height = s + "px",
  15158. u.style.paddingTop = e + C + "px",
  15159. o.description.length > 0 && (h.classList.add("collapsible"),
  15160. h.style.height = h.clientHeight + 12 + "px",
  15161. E.style.height = "calc(100% - " + I.clientHeight + "px)")
  15162. }
  15163. function a(e) {
  15164. e.target === c && s()
  15165. }
  15166. function s() {
  15167. m && (m = !1,
  15168. r.classList.add("view-image"),
  15169. c.classList.remove("overlay"),
  15170. h.style.height = "",
  15171. u.style.paddingTop = "",
  15172. t.style.width = "",
  15173. t.style.height = "",
  15174. window.removeEventListener("resize", b),
  15175. c.removeEventListener("click", a),
  15176. g.removeEventListener("click", l),
  15177. f.removeEventListener("click", s),
  15178. o.emit(p.IMAGE_CLOSED),
  15179. o.close(!0))
  15180. }
  15181. function l(e) {
  15182. t.classList.toggle("show-info")
  15183. }
  15184. var c = o.div
  15185. , h = c.getElementsByClassName("tag-content")[0]
  15186. , u = c.getElementsByClassName("tag-media-content")[0]
  15187. , f = t.getElementsByClassName("close")[0]
  15188. , g = h.getElementsByClassName("tag-label")[0];
  15189. c.classList.add("has-image"),
  15190. r.classList.add("view-image"),
  15191. c.classList.add(n.aspect >= 1 ? "image-landscape" : "image-portrait"),
  15192. o.applyOrientation(o.orientation);
  15193. var m = !1
  15194. , A = getComputedStyle(h)
  15195. , y = parseFloat(A.paddingTop) + parseFloat(A.paddingBottom)
  15196. , C = 2 * parseFloat(getComputedStyle(u).paddingLeft)
  15197. , I = h.querySelector(".tag-label")
  15198. , E = h.querySelector(".tag-desc")
  15199. , b = function() {
  15200. var e, t, n = 0;
  15201. return function() {
  15202. clearInterval(e),
  15203. clearTimeout(t),
  15204. e = setInterval(function() {
  15205. var e = c.clientHeight;
  15206. n !== e && (i(),
  15207. n = e)
  15208. }, 100),
  15209. t = setTimeout(clearInterval.bind(this, e), 1e3)
  15210. }
  15211. }();
  15212. n.on(p.IMAGE_OPENING, e),
  15213. o.on(d.ACTIVATE, e),
  15214. o.on(p.IMAGE_CLOSED, n.onClosed.bind(n)),
  15215. o.on(d.CLOSING, s)
  15216. }
  15217. var n = new a
  15218. , r = n.createDomElement();
  15219. this.once(d.OPENED, function() {
  15220. n.load(e.src).then(i).catch(function(t) {
  15221. y.warn("Failed to load image:", e.src),
  15222. y.warn("with error:", t)
  15223. }).then(this.onMediaLoadFinished.bind(this))
  15224. });
  15225. var o = this;
  15226. return r
  15227. }
  15228. ,
  15229. n.prototype.createVideoElement = function(e, t) {
  15230. var i = new s({
  15231. autoPlay: !0,
  15232. autoResume: !0,
  15233. startMuted: !1,
  15234. loop: !1
  15235. })
  15236. , n = i.createDomElement();
  15237. return this.once(d.OPENED, function() {
  15238. i.load(e.src).then(function() {
  15239. this.div.classList.add("has-video"),
  15240. this.state !== I.OPEN && this.state !== I.ACTIVE || (i.show(),
  15241. i.play()),
  15242. this.on(d.OPENING, i.show.bind(i)),
  15243. this.on(d.OPENED, i.play.bind(i)),
  15244. this.on(d.CLOSING, i.pause.bind(i)),
  15245. this.on(d.CLOSED, i.hide.bind(i))
  15246. }
  15247. .bind(this)).catch(function(t) {
  15248. y.warn("Failed to embed video:", e.src),
  15249. y.warn("with error:", t)
  15250. }).then(this.onMediaLoadFinished.bind(this))
  15251. }
  15252. .bind(this)),
  15253. n
  15254. }
  15255. ,
  15256. n.prototype.createEmbedElement = function(e, t) {
  15257. var i = new l
  15258. , n = i.createDomElement();
  15259. return this.once(d.OPENED, function() {
  15260. i.load(e.src).then(function() {
  15261. this.div.classList.add("has-embed"),
  15262. this.state !== I.OPEN && this.state !== I.ACTIVE || i.show(),
  15263. this.applyOrientation(this.orientation),
  15264. this.on(d.OPENING, i.show.bind(i)),
  15265. this.on(d.CLOSED, i.hide.bind(i))
  15266. }
  15267. .bind(this)).catch(function(t) {
  15268. y.warn("Failed to embed:", e.src),
  15269. y.warn("with error:", t)
  15270. }).then(this.onMediaLoadFinished.bind(this))
  15271. }
  15272. .bind(this)),
  15273. n
  15274. }
  15275. ,
  15276. n.prototype.open = function(e) {
  15277. return this.openPromise = $.Deferred(),
  15278. this.state === I.ACTIVE ? this.openPromise.resolve().promise() : (this.hovering || this.div.classList.add("has-hotzone"),
  15279. this.openTransition ? e && this.setActiveState() : this.openTransition = c.setTimeout(function() {
  15280. this.state !== I.OPEN && (this.emit(d.OPENING),
  15281. e && this.emit(d.ACTIVATING),
  15282. this.state = I.OPENING,
  15283. this.animateOpen(function() {
  15284. e && this.setActiveState(),
  15285. this.openPromise.resolve()
  15286. }
  15287. .bind(this)))
  15288. }
  15289. .bind(this), m.animation.openDelay),
  15290. c.cancel(this.closeTransition),
  15291. this.closePromise && this.closePromise.reject(),
  15292. this.closeTransition = void 0,
  15293. this.openPromise.promise())
  15294. }
  15295. ,
  15296. n.prototype.close = function(e) {
  15297. return this.closePromise = $.Deferred(),
  15298. !e && this.hovering ? this.closePromise.reject().promise() : (this.closeTransition || (this.closeTransition = c.setTimeout(function() {
  15299. this.state !== I.CLOSED && (this.emit(d.CLOSING),
  15300. this.state = I.CLOSING,
  15301. this.animateClose())
  15302. }
  15303. .bind(this), m.animation.closeDelay)),
  15304. c.cancel(this.openTransition),
  15305. this.openPromise && this.openPromise.reject(),
  15306. this.openTransition = void 0,
  15307. this.closePromise.resolve(),
  15308. this.closePromise.promise())
  15309. }
  15310. ,
  15311. n.prototype.setActiveState = function() {
  15312. this.state !== I.CLOSED && (this.state = I.ACTIVE,
  15313. this.emit(d.ACTIVATE),
  15314. this.div.classList.remove("has-hotzone"))
  15315. }
  15316. ,
  15317. n.prototype.animateOpen = function(e) {
  15318. if (this.state === I.OPENING) {
  15319. if (c.cancel(this.animationTransition),
  15320. u.detectSamsungNative())
  15321. return this.boardOrientation = null,
  15322. this.div.style.visibility = "visible",
  15323. this.emit(d.OPENED),
  15324. this.state = I.OPEN,
  15325. void (e && e());
  15326. this.div.style.webkitTransform = "scale(0)",
  15327. this.div.style.transform = "scale(0)",
  15328. this.div.style.visibility = "visible",
  15329. this.animationTransition = c.start(h.property(this, "animationScale", 1), m.animation.openDuration, function() {
  15330. this.emit(d.OPENED),
  15331. this.state = I.OPEN,
  15332. e && e()
  15333. }
  15334. .bind(this))
  15335. }
  15336. }
  15337. ,
  15338. n.prototype.animateClose = function(e) {
  15339. this.state === I.CLOSING && (c.cancel(this.animationTransition),
  15340. this.animationTransition = c.start(h.property(this, "animationScale", 0), m.animation.closeDuration, function() {
  15341. this.emit(d.CLOSED),
  15342. this.state = I.CLOSED,
  15343. this.div.style.visibility = "hidden",
  15344. this.div.classList.contains("has-hotzone") || this.div.classList.add("has-hotzone"),
  15345. e && e()
  15346. }
  15347. .bind(this)))
  15348. }
  15349. ,
  15350. n.prototype.needsUpdate = function() {
  15351. return this.state !== I.CLOSED
  15352. }
  15353. ,
  15354. n.prototype.update = function(e, t) {
  15355. if (this.needsUpdate()) {
  15356. var i = (this.updateOrientation(e),
  15357. this.calcScale(t))
  15358. , n = {
  15359. x: (e.x + 1) * $("#player").width() / 2,
  15360. y: (e.y + 1) * $("#player").height() / 2
  15361. };
  15362. this.div.screenTransform = this.initialTransform + " translate(" + n.x + "px, " + n.y + "px) scale(" + i * this.animationScale + ")",
  15363. this.div.style.webkitTransform = this.div.screenTransform,
  15364. this.div.style.transform = this.div.screenTransform
  15365. }
  15366. }
  15367. ,
  15368. n.prototype.getDimensions = function() {
  15369. return this.div.getBoundingClientRect()
  15370. }
  15371. ,
  15372. n.prototype.calcScale = function(e) {
  15373. return Math.sqrt(e / 40) * m.boardToDiscRatio
  15374. }
  15375. ,
  15376. n.prototype.updateOrientation = function(e) {
  15377. if (this.state !== I.ACTIVE) {
  15378. var t = 1 / 3
  15379. , i = e.y < -t ? 0 : e.y < t ? 1 : 2
  15380. , n = e.x < -t ? 0 : e.x < t ? 1 : 2
  15381. , r = "";
  15382. r += 0 === n ? "right" : 2 === n ? "left" : "",
  15383. r += 0 === i ? "-down" : 2 === i ? "-up" : "",
  15384. 1 === n && (r = 0 === i ? "bottom" : 2 === i ? "top" : "",
  15385. 1 === i && (r = $("#player").width() > $("#player").height() ? e.x < 0 ? "right" : "left" : e.y < 0 ? "bottom" : "top")),
  15386. 1 === n && 1 === i && r === this.orientation || this.applyOrientation(r)
  15387. }
  15388. }
  15389. ,
  15390. n.prototype.applyOrientation = function(e) {
  15391. this.div.style.transform = this.div.style.webkitTransform = "",
  15392. this.div.classList.remove("tag-container-" + this.orientation),
  15393. this.div.classList.add("tag-container-" + e);
  15394. var t = window.getComputedStyle(this.div);
  15395. this.initialTransform = t.transform || t.webkitTransform,
  15396. "none" === this.initialTransform && (this.initialTransform = "");
  15397. var i = t.transform.slice(7, -1).split(",")
  15398. , n = -i[4]
  15399. , r = -i[5];
  15400. this.div.style.webkitTransformOrigin = n + "px " + r + "px",
  15401. this.div.style.transformOrigin = n + "px " + r + "px",
  15402. this.orientation = e
  15403. }
  15404. ,
  15405. t.exports = n
  15406. }
  15407. ).call(this, "/js/tag/Billboard/Billboard.js")
  15408. }
  15409. , {
  15410. "../../util/browser": 182,
  15411. "../../util/lerp": 188,
  15412. "../../util/logger": 189,
  15413. "../../util/transitions": 195,
  15414. "../Media/EmbedlyEmbed": 125,
  15415. "../Media/EmbedlyPlayer": 126,
  15416. "../Media/Image": 128,
  15417. "../Media/Link": 129,
  15418. "../Media/MediaEvent": 131,
  15419. "../Parser/DescriptionChunkType": 133,
  15420. "../Parser/DescriptionParser": 134,
  15421. "./BillboardEvent": 120,
  15422. "./billboardSettings": 121,
  15423. "./overlaySettings": 122,
  15424. events: 202
  15425. }],
  15426. 120: [function(e, t, i) {
  15427. "use strict";
  15428. t.exports = Object.freeze({
  15429. ENTER: "billboard.enter",
  15430. LEAVE: "billboard.leave",
  15431. OPENING: "billboard.opening",
  15432. OPENED: "billboard.open",
  15433. CLOSING: "billboard.closing",
  15434. CLOSED: "billboard.closed",
  15435. ACTIVATING: "billboard.activating",
  15436. ACTIVATE: "billboard.activate"
  15437. })
  15438. }
  15439. , {}],
  15440. 121: [function(e, t, i) {
  15441. "use strict";
  15442. t.exports = Object.freeze({
  15443. animation: Object.freeze({
  15444. hoverOnClosing: !1,
  15445. openDelay: 100,
  15446. closeDelay: 50,
  15447. openDuration: 200,
  15448. closeDuration: 100
  15449. }),
  15450. boardToDiscRatio: 1.2
  15451. })
  15452. }
  15453. , {}],
  15454. 122: [function(e, t, i) {
  15455. "use strict";
  15456. t.exports = Object.freeze({
  15457. boundaryWidth: 30,
  15458. boundaryHeight: 0
  15459. })
  15460. }
  15461. , {}],
  15462. 123: [function(e, t, i) {//tag
  15463. (function(i) {
  15464. "use strict";
  15465. function n(e, t, i) {
  15466. var n = i.version || "0";
  15467. "0" !== n && I.info("tag defined using version " + n),
  15468. this.model = e,
  15469. this.sid = t,
  15470. this.color = (new r.Color).set(i.color || l.tagDefault),
  15471. this.hoverColor = l._darken(this.color, .2),
  15472. this.floor = null,
  15473. this.floorIndex = i.floor,
  15474. this.mode = s.PANORAMA,
  15475. i.preferred_camera && i.preferred_camera.mode && (this.mode = i.preferred_camera.mode),
  15476. this.obj3d = null,
  15477. this.disc = null,
  15478. this.materials = {
  15479. disc: null,
  15480. pole: null
  15481. },
  15482. this.position = (new r.Vector3).copy(i.position),
  15483. this.discPosition = (new r.Vector3).copy(i.stem.direction),
  15484. this.discWorldPosition = null,
  15485. this.discScale = .05,
  15486. this.poleEnabled = i.stem.enabled,
  15487. this.billboard = new o(i.label,i.description,i.media,this),
  15488. this.visibleTransition = null,
  15489. this.hoveringDisc = !1
  15490. }
  15491. var r = e("three")
  15492. , o = e("./Billboard/Billboard")
  15493. , a = e("../settings")
  15494. , s = e("../enum/Viewmode")
  15495. , l = e("../enum/Colors")
  15496. , c = e("../enum/RenderLayers")
  15497. , h = e("../enum/RenderOrder")
  15498. , u = (e("../util/common"),
  15499. e("../util/math"))
  15500. , d = e("../util/texture")
  15501. , p = e("../objects/Panorama")
  15502. , f = e("../shaders")
  15503. , g = e("../util/transitions")
  15504. , m = e("../util/lerp")
  15505. , v = e("../util/easing")
  15506. , A = e("./Billboard/BillboardEvent")
  15507. , y = e("events").EventEmitter
  15508. , C = e("../util/logger")
  15509. , I = new C(i)
  15510. , 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==")
  15511. , 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")
  15512. , w = new r.PlaneBufferGeometry(1,1);
  15513. n.prototype = Object.create(y.prototype),
  15514. n.raycaster = new r.Raycaster,
  15515. n.prototype.bindEvents = function() {
  15516. this.billboard.on(A.ENTER, this.setHoverState.bind(this)),
  15517. this.billboard.on(A.LEAVE, this.setFreeState.bind(this))
  15518. }
  15519. ,
  15520. n.prototype.build = function() {
  15521. return this.floor = this.model.floors.get(this.floorIndex) || this.model.floors.first(),
  15522. this.floor && (this.billboard.build(this.model.sid),
  15523. this.obj3d = this.buildObject3D(),
  15524. this.floor.add(this.obj3d)),
  15525. this
  15526. }
  15527. ,
  15528. n.prototype.buildObject3D = function() {
  15529. var e = new r.Object3D;
  15530. e.position.copy(this.position);
  15531. var t = r.UniformsUtils.clone(f.tagDisc.uniforms);
  15532. t.bg.value = b,
  15533. t.mask.value = E,
  15534. t.color.value.copy(this.color),
  15535. this.materials.disc = new r.RawShaderMaterial({
  15536. transparent: !0,
  15537. vertexShader: f.tagDisc.vertexShader,
  15538. fragmentShader: f.tagDisc.fragmentShader,
  15539. uniforms: t
  15540. }),
  15541. this.disc = new r.Mesh(w,this.materials.disc),
  15542. this.disc.layers.set(c.TAG),
  15543. this.disc.position.copy(this.discPosition),
  15544. this.disc.renderOrder = h.tagDisc,
  15545. this.disc.tag = this;
  15546. var i = this.buildPole();
  15547. return i.layers.set(c.TAG),
  15548. i.renderOrder = h.tagStem,
  15549. e.add(i),
  15550. e.layers.set(c.TAG),
  15551. e.add(this.disc)
  15552. }
  15553. ,
  15554. n.prototype.buildPole = function() {
  15555. var e = new r.BufferGeometry
  15556. , t = new Float32Array(6);
  15557. return t[0] = t[1] = t[2] = 0,
  15558. t[3] = this.discPosition.x,
  15559. t[4] = this.discPosition.y,
  15560. t[5] = this.discPosition.z,
  15561. e.addAttribute("position", new r.BufferAttribute(t,3)),
  15562. this.materials.pole = new r.LineBasicMaterial({
  15563. linewidth: a.tags.pole.width,
  15564. color: a.tags.pole.color,
  15565. opacity: 0,
  15566. visible: this.poleEnabled,
  15567. transparent: !0,
  15568. depthWrite: !1
  15569. }),
  15570. new r.Line(e,this.materials.pole)
  15571. }
  15572. ,
  15573. n.prototype.setFreeState = function(e) {
  15574. !e && this.hoveringDisc || this.billboard.close(e).then(function() {
  15575. this.materials.disc.uniforms.color.value = this.color
  15576. }
  15577. .bind(this))
  15578. }
  15579. ,
  15580. n.prototype.setHoverState = function(e) {
  15581. this.billboard.open(e),
  15582. this.materials.disc.uniforms.color.value = this.hoverColor
  15583. }
  15584. ,
  15585. n.prototype.hide = function(e, t) {
  15586. var i = $.Deferred();
  15587. if (0 === this.materials.disc.uniforms.opacity.value && !g.isRunning(this.visibleTransition))
  15588. return i.resolve().promise();
  15589. e = e || 0,
  15590. t = t || 0,
  15591. g.cancel(this.visibleTransition);
  15592. var n = this.materials.disc.uniforms.opacity.value / a.tags.disc.opacity
  15593. , r = t + e
  15594. , o = t / r;
  15595. return this.visibleTransition = g.start(function(e) {
  15596. var t = m.property(e.materials.disc.uniforms.opacity, "value", 0)
  15597. , i = m.property(e.materials.pole, "opacity", 0);
  15598. return function(n) {
  15599. t(n),
  15600. e.materials.pole && i(n)
  15601. }
  15602. }(this), r * n, function() {
  15603. i.resolve()
  15604. }, o, v[a.warp.blendEasing]),
  15605. i.promise()
  15606. }
  15607. ,
  15608. n.prototype.show = function(e, t) {
  15609. var i = $.Deferred();
  15610. if (this.materials.disc.uniforms.opacity.value === a.tags.disc.opacity && !g.isRunning(this.visibleTransition))
  15611. return i.resolve().promise();
  15612. e = e || 0,
  15613. t = t || 0,
  15614. g.cancel(this.visibleTransition);
  15615. var n = (a.tags.disc.opacity - this.materials.disc.uniforms.opacity.value) / a.tags.disc.opacity
  15616. , r = t + e
  15617. , o = t / r;
  15618. return this.visibleTransition = g.start(function(e) {
  15619. var t = m.property(e.materials.disc.uniforms.opacity, "value", a.tags.disc.opacity)
  15620. , i = m.property(e.materials.pole, "opacity", a.tags.pole.opacity);
  15621. return function(n) {
  15622. t(n),
  15623. e.materials.pole && i(n)
  15624. }
  15625. }(this), r * n, function() {
  15626. i.resolve()
  15627. }, o, v[a.warp.blendEasing]),
  15628. i.promise()
  15629. }
  15630. ,
  15631. n.prototype.closestPanoTowardTag = function(e, t) {
  15632. var i = []
  15633. , o = []
  15634. , l = this.disc.getWorldPosition();
  15635. if (e === s.PANORAMA) {
  15636. var c = .5
  15637. , h = t.position.clone().sub(l).normalize();
  15638. i.push(p.filters.isPanoAligned()),
  15639. i.push(p.filters.inPanoDirection(l, h, c)),
  15640. i.push(p.filters.isNeighbourPanoTo(t)),
  15641. o.push(p.scoreFunctions.direction(l, h))
  15642. }
  15643. var u = new r.Vector3
  15644. , d = function(e) {
  15645. u.copy(l).sub(e.position);
  15646. var t = -r.Math.radToDeg(Math.atan(u.y / Math.sqrt(u.x * u.x + u.z * u.z)))
  15647. , i = a.tags.navigate.tiltTolerance;
  15648. return a.insideLookLimitDown - i < t && t < a.insideLookLimitUp + i
  15649. }
  15650. , f = function(e) {
  15651. return Math.abs(e.position.x - l.x) > a.tags.visibility.cameraClearance || Math.abs(e.position.z - l.z) > a.tags.visibility.cameraClearance
  15652. };
  15653. i.push(f, d),
  15654. o.push(p.scoreFunctions.distanceSquared(this, -2));
  15655. var g = this.model.panos.sortByScore(i, o);
  15656. if (a.tags.navigate.lineOfSight) {
  15657. for (var m = 0; m < g.length; m++) {
  15658. var v = g[m].pano
  15659. , A = v.position.distanceTo(l);
  15660. if (!a.tags.visibility.anyDistance && A > a.tags.visibility.visibleDistance)
  15661. return null;
  15662. n.raycaster.set(v.position, l.clone().sub(v.position).normalize());
  15663. var y = n.raycaster.intersectObjects(this.model.colliders);
  15664. if (0 === y.length || y[0].distance > A)
  15665. return v
  15666. }
  15667. return null
  15668. }
  15669. return g.length > 0 && g[0].pano
  15670. }
  15671. ,
  15672. n.prototype.examine = function(e) {
  15673. var t = e.mode
  15674. , i = a.tags.navigate.nearestPano && this.closestPanoTowardTag(t, e.currentPano) || e.currentPano
  15675. , n = this.disc.getWorldPosition();
  15676. this.billboard.setActiveState();
  15677. var o = function() {
  15678. var t = this.billboard.getDimensions()
  15679. , n = new r.Vector3;
  15680. u.convertScreenPositionToNDC(t.left + t.width / 2, t.top + t.height / 2, n),
  15681. n.unproject(e.camera),
  15682. e.flyToPano({
  15683. pano: i,
  15684. lookAtPoint: n
  15685. })
  15686. }
  15687. .bind(this);
  15688. if (t === s.PANORAMA)
  15689. if (i !== e.currentPano) {
  15690. var l = {
  15691. pano: i,
  15692. lookAtPoint: n,
  15693. duration: null,
  15694. maxDistanceOverride: null,
  15695. skipWarpingCheck: !1
  15696. };
  15697. e.flyToPano(l, o)
  15698. } else
  15699. setTimeout(function() {
  15700. this.billboard.open().then(function() {
  15701. o()
  15702. })
  15703. }
  15704. .bind(this), 0);
  15705. else {
  15706. var c = {
  15707. pano: i
  15708. };
  15709. if (n) {
  15710. var h = (new r.Matrix4).lookAt(i.position, n, new r.Vector3(0,1,0));
  15711. c.quaternion = (new r.Quaternion).setFromRotationMatrix(h)
  15712. }
  15713. c.callback = o,
  15714. c.duration = 1500,
  15715. c.mode = s.PANORAMA,
  15716. e.flyToNewMode(c)
  15717. }
  15718. }
  15719. ,
  15720. n.prototype.update = function(e, t) {
  15721. var i = new r.Vector3;
  15722. return function(e, t) {
  15723. this.discWorldPosition = this.disc.getWorldPosition(),
  15724. this.updateDisc(e, t),
  15725. this.billboard.needsUpdate() && (i.copy(this.discWorldPosition).project(t),
  15726. i.z < 1 && (i.y *= -1,
  15727. this.billboard.update(i, this.getDiscRadius(i, t))))
  15728. }
  15729. }(),
  15730. n.prototype.updateDisc = function(e, t) {
  15731. var i = new r.Vector3
  15732. , o = new r.Vector3
  15733. , l = new r.Vector3
  15734. , c = new r.Vector3
  15735. , h = new r.Vector3;
  15736. return function(e, t) {
  15737. var u = a.tags.visibility
  15738. , d = a.tags.disc.scale
  15739. , p = e === s.DOLLHOUSE || e === s.FLOORPLAN ? a.tags.visibility.visibleDistance : t.position.distanceTo(this.discWorldPosition);
  15740. 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)),
  15741. this.obj3d.visible) {
  15742. this.disc.quaternion.copy(t.quaternion);
  15743. var f = d.maxSize - (d.maxSize - d.minSize) * r.Math.smoothstep(p, d.nearBound, d.farBound);
  15744. i.copy(this.discWorldPosition).project(t),
  15745. o.set($("#player").width() / 2, $("#player").height() / 2, 1).multiply(i),
  15746. l.set(f / 2, 0, 0).add(o),
  15747. c.set(2 / $("#player").width(), 2 / $("#player").height(), 1).multiply(l),
  15748. h.copy(c).unproject(t);
  15749. var g = h.distanceTo(this.discWorldPosition)
  15750. , m = 1 + a.tags.disc.scale.responsiveness / 100 * (n.viewportScale() - 1);
  15751. this.discScale = g * m,
  15752. this.disc.scale.set(this.discScale, this.discScale, this.discScale)
  15753. }
  15754. }
  15755. }(),
  15756. n.prototype.getDiscRadius = function(e, t) {
  15757. var i = new r.Vector3;
  15758. return function(e, t) {
  15759. return i.set(-this.discScale / 2, 0, 0).applyQuaternion(t.quaternion).add(this.discWorldPosition).project(t),
  15760. Math.abs(e.x - i.x) * $("#player").width()
  15761. }
  15762. }(),
  15763. n.prototype.tagVisibleOnCurrentFloor = function(e) {
  15764. return !(e === s.DOLLHOUSE || e === s.FLOORPLAN) || this.model.allFloorsVisible || !this.floor.hidden
  15765. }
  15766. ,
  15767. n.prototype.offScreen = function(e, t) {
  15768. var i = e.getWorldPosition().project(t);
  15769. return !(-1 < i.x && i.x < 1 && -1 < i.y && i.y < 1)
  15770. }
  15771. ,
  15772. n.viewportScale = function() {
  15773. return n.viewportWidth === $("#player").width() && n.viewportHeight === $("#player").height() || (n.viewportWidth = $("#player").width(),
  15774. n.viewportHeight = $("#player").height(),
  15775. n.currentViewportScale = Math.sqrt(Math.min(n.viewportWidth, n.viewportHeight) / a.tags.disc.scale.baseViewportSize)),
  15776. n.currentViewportScale
  15777. }
  15778. ,
  15779. t.exports = n
  15780. }
  15781. ).call(this, "/js/tag/tag.js")
  15782. }
  15783. , {
  15784. "../enum/Colors": 19,
  15785. "../enum/RenderLayers": 41,
  15786. "../enum/RenderOrder": 42,
  15787. "../enum/Viewmode": 51,
  15788. "../objects/Panorama": 148,
  15789. "../settings": 166,
  15790. "../shaders": 167,
  15791. "../util/common": 185,
  15792. "../util/easing": 186,
  15793. "../util/lerp": 188,
  15794. "../util/logger": 189,
  15795. "../util/math": 190,
  15796. "../util/texture": 194,
  15797. "../util/transitions": 195,
  15798. "./Billboard/Billboard": 119,
  15799. "./Billboard/BillboardEvent": 120,
  15800. events: 202,
  15801. three: 217
  15802. }],
  15803. 124: [function(e, t, i) {
  15804. (function(i) {
  15805. "use strict";
  15806. function n() {
  15807. this.tagState = y.IDLE,
  15808. this.intersectTag = null,
  15809. this.hoveredTag = null,
  15810. this.activeTag = null,
  15811. this.tagDiscs = [],
  15812. this.raycaster = new r.Raycaster,
  15813. this.modelManager = null,
  15814. this.player = null,
  15815. this.totaltags = 0,
  15816. this.navigatingViaTag = !1,
  15817. this.enabled = !1
  15818. }
  15819. var r = e("three")
  15820. , o = e("../util/logger")
  15821. , a = e("../util/common")
  15822. , s = e("../controls/serializer")
  15823. , l = e("../objects/Snapshot")
  15824. , c = e("../settings")
  15825. , h = e("./Billboard/BillboardEvent")
  15826. , u = e("./Media/MediaEvent")
  15827. , d = e("./Media/LinkType")
  15828. , p = e("../enum/Viewmode")
  15829. , f = e("../enum/WarpStyle")
  15830. , g = e("../enum/BlackoutStyle")
  15831. , m = e("../enum/ModelManagerEvents")
  15832. , v = e("../enum/tagEvents")
  15833. , A = e("../enum/PlayerEvents")
  15834. , y = (e("../util/lerp"),
  15835. e("../enum/TagStates"))
  15836. , C = e("events").EventEmitter
  15837. , I = new o(i);
  15838. a.extend(n, C),
  15839. n.prototype.init = function(e, t) {
  15840. this.modelManager = e,
  15841. this.player = t,
  15842. this.updateModel(),
  15843. this.bindEvents()
  15844. }
  15845. ,
  15846. n.prototype.update = function(e) {
  15847. this.updateTags(this.player.mode, this.player.camera, this.player.currentPano, this.player.flying)
  15848. }
  15849. ,
  15850. n.prototype.updateTags = function(e, t, i, n) {
  15851. for (var r in this.model.tags)
  15852. this.model.tags[r].update(e, t, i, n)
  15853. }
  15854. ,
  15855. n.prototype.updateModel = function() {
  15856. this.model = this.modelManager.getActiveModel(),
  15857. this.gettagsFromModel(),
  15858. this.totaltags = Object.keys(this.model.tags).length
  15859. }
  15860. ,
  15861. n.prototype.gettagsFromModel = function() {
  15862. this.tagDiscs = [];
  15863. for (var e in this.model.tags) {
  15864. var t = this.model.tags[e].disc;
  15865. t && this.tagDiscs.push(t)
  15866. }
  15867. }
  15868. ,
  15869. n.prototype.bindEvents = function() {
  15870. function e() {
  15871. Object.keys(this.model.tags).forEach(function(e) {
  15872. var t = this.model.tags[e];
  15873. t.bindEvents(),
  15874. t.billboard.on(u.LINK_CLICK, function(e) {
  15875. e.type === d.NAVIGATION && this.navigateViaLink(e.url)
  15876. }
  15877. .bind(this)),
  15878. t.billboard.on(u.IMAGE_OPENED, function() {
  15879. this.tagState = y.EXAMINE,
  15880. this.emit(u.IMAGE_OPENED)
  15881. }
  15882. .bind(this)),
  15883. t.billboard.on(h.CLOSING, this.dismissExaminedTag.bind(this))
  15884. }
  15885. .bind(this))
  15886. }
  15887. this.modelManager.on(m.ActiveModelChanged, this.updateModel.bind(this)),
  15888. this.modelManager.on(m.ActiveModelChanged, e.bind(this)),
  15889. this.player.on(A.ModeChanging, this.onPlayerModeChanging.bind(this)),
  15890. this.player.on(A.PanoChosen, this.onPanoChange.bind(this)),
  15891. this.player.on(A.Ready, this.onPlayerReady.bind(this)),
  15892. this.player.on(A.FlyingEnded, this.onPlayerFlyingEnded.bind(this)),
  15893. this.player.on(A.WarpStarted, this.handleWarpStart.bind(this)),
  15894. this.player.on(A.WarpInterrupted, this.handleWarpInterruption.bind(this)),
  15895. e.call(this)
  15896. }
  15897. ,
  15898. n.prototype.navigateViaLink = function(e) {
  15899. var t = s.deserialize(e);
  15900. if (t)
  15901. if (t.mode === p.PANORAMA) {
  15902. try {
  15903. this.player.model.panos.get(t.panoId)
  15904. } catch (e) {
  15905. return void I.warn("Unable to find panorama location", t.panoId)
  15906. }
  15907. this.player.warpToPanoById(t.panoId, t.quaternion, null, null, f.BLACK)
  15908. } else {
  15909. var i = {
  15910. cameraMode: t.mode,
  15911. position: t.position,
  15912. quaternion: t.quaternion,
  15913. scanId: t.panoId,
  15914. orthoZoom: t.zoom,
  15915. floorVisibility: t.floorVisibility,
  15916. thumbUrl: null,
  15917. name: null
  15918. };
  15919. this.player.flyToNewMode({
  15920. mode: t.mode,
  15921. duration: c.warp.outsideTime,
  15922. warpDest: new l(i),
  15923. force: !0
  15924. })
  15925. }
  15926. }
  15927. ,
  15928. n.prototype.handleWarpStart = function(e, t, i, n) {
  15929. this.dismissExaminedTag(),
  15930. t === f.BLACK && (null !== n && void 0 !== n || (n = c.warp.teleportTime),
  15931. e && (i = g.END),
  15932. this.hideShowTagsForBlackoutStyle(i, n))
  15933. }
  15934. ,
  15935. n.prototype.handleWarpInterruption = function(e, t, i) {
  15936. null !== i && void 0 !== i || (i = c.warp.teleportTime),
  15937. this.hideShowTagsForBlackoutStyle(t, i)
  15938. }
  15939. ,
  15940. n.prototype.hideShowTagsForBlackoutStyle = function(e, t) {
  15941. var i = 0
  15942. , n = 0
  15943. , r = t / 2;
  15944. switch (null !== e && void 0 !== e || (e = g.MIDDLE),
  15945. e) {
  15946. case g.END:
  15947. this.hideAlltags(r);
  15948. break;
  15949. case g.BEGINNING:
  15950. this.hideAlltags().done(this.showAlltags.bind(this, r));
  15951. break;
  15952. case g.NONE:
  15953. break;
  15954. case g.MIDDLE:
  15955. i = r,
  15956. n = r,
  15957. this.hideAlltags(n),
  15958. setTimeout(function() {
  15959. this.showAlltags(i)
  15960. }
  15961. .bind(this), n);
  15962. break;
  15963. case g.FADEIN:
  15964. setTimeout(function() {
  15965. this.showAlltags(r)
  15966. }
  15967. .bind(this), r)
  15968. }
  15969. }
  15970. ,
  15971. n.prototype.onPlayerModeChanging = function(e, t) {
  15972. t !== p.PANORAMA && this.dismissExaminedTag(),
  15973. t === p.PANORAMA && player.currentPano && !player.currentPano.isAligned() && (t = p.OUTDOOR);
  15974. var i = t !== p.OUTDOOR;
  15975. i !== this.model.tagsShown && (i ? this.showAlltags(c.tags.startup.fadeInDuration) : this.hideAlltags(c.tags.startup.fadeInDuration))
  15976. }
  15977. ,
  15978. n.prototype.onPanoChange = function(e, t) {
  15979. var i = this.navigatingViaTag;
  15980. if (this.navigatingViaTag = !1,
  15981. !i) {
  15982. this.dismissExaminedTag();
  15983. var n = e && !e.isAligned() ? p.OUTDOOR : p.PANORAMA
  15984. , r = t && !t.isAligned() ? p.OUTDOOR : p.PANORAMA;
  15985. n !== r && (r === p.PANORAMA ? this.showAlltags(c.tags.startup.fadeInDuration, null, !0) : this.hideAlltags(c.tags.startup.fadeInDuration))
  15986. }
  15987. }
  15988. ,
  15989. n.prototype.onPlayerReady = function(e, t, i) {
  15990. this.startAlltags(e, t ? i : null)
  15991. }
  15992. ,
  15993. n.prototype.onPlayerFlyingEnded = function(e, t) {
  15994. this.updateClosestTags(e)
  15995. }
  15996. ,
  15997. n.prototype.dismissExaminedTag = function() {
  15998. this.activeTag && this.tagState === y.EXAMINE && this.dismissActiveTag(),
  15999. this.hoveredTag && (this.hoveredTag.setFreeState(!0),
  16000. this.hoveredTag = null)
  16001. }
  16002. ,
  16003. n.prototype.startAlltags = function(e, t) {
  16004. this.model.shouldShowtags = c.tags.enabled,
  16005. this.enabled = !0,
  16006. e || (this.showAlltags(c.tags.startup.fadeInDuration, c.tags.startup.fadeInDelay),
  16007. t && setTimeout(function() {
  16008. this.activateTag(this.model.getTagBySid(t))
  16009. }
  16010. .bind(this), c.tags.startup.fadeInDuration / 2))
  16011. }
  16012. ,
  16013. n.prototype.showAlltags = function(e, t, i) {
  16014. function n() {
  16015. o++,
  16016. o === this.totaltags && (this.model.tagsShown = !0,
  16017. r.resolve())
  16018. }
  16019. var r = $.Deferred();
  16020. if (!i && this.player.mode === p.PANORAMA && this.player.currentPano && !this.player.currentPano.isAligned() || !this.model.shouldShowtags)
  16021. return r.resolve().promise();
  16022. var o = 0;
  16023. for (var a in this.model.tags) {
  16024. var s = this.model.tags[a];
  16025. s.show(e, t).done(n.bind(this))
  16026. }
  16027. return r.promise()
  16028. }
  16029. ,
  16030. n.prototype.hideAlltags = function(e, t) {
  16031. function i() {
  16032. r++,
  16033. r === this.totaltags && (this.model.tagsShown = !1,
  16034. n.resolve())
  16035. }
  16036. var n = $.Deferred()
  16037. , r = 0;
  16038. for (var o in this.model.tags) {
  16039. var a = this.model.tags[o];
  16040. a.hide(e, t).done(i.bind(this)),
  16041. a === this.activeTag && this.dismissActiveTag()
  16042. }
  16043. return n.promise()
  16044. }
  16045. ,
  16046. n.prototype.enableHovering = function() {
  16047. this.enabled = !0
  16048. }
  16049. ,
  16050. n.prototype.disableHovering = function() {
  16051. this.enabled = !1
  16052. }
  16053. ,
  16054. n.prototype.activateTag = function(e, t) {
  16055. t = t || y.EXAMINE,
  16056. this.activeTag = e,
  16057. this.activeTag.hoveringDisc = !0,
  16058. this.activeTag.setHoverState(t === y.EXAMINE),
  16059. this.tagState = t,
  16060. this.emit(v.TagActivated, e)
  16061. }
  16062. ,
  16063. n.prototype.dismissActiveTag = function() {
  16064. this.activeTag.hoveringDisc = !1,
  16065. this.activeTag.setFreeState(!0);
  16066. var e = this.activeTag;
  16067. this.activeTag = null,
  16068. this.tagState = y.IDLE,
  16069. this.emit(v.TagDismissed, e)
  16070. }
  16071. ,
  16072. n.prototype.clickedOnTag = function(e) {
  16073. var t = function() {
  16074. this.navigatingViaTag = !0,
  16075. this.activeTag.examine(this.player),
  16076. this.emit(v.TagNavigation, this.activeTag)
  16077. }
  16078. .bind(this);
  16079. return this.tagState !== y.EXAMINE ? (this.activateTag(this.intersectTag, y.EXAMINE),
  16080. this.activeTag = this.intersectTag,
  16081. t(),
  16082. !0) : (this.dismissActiveTag(),
  16083. !1)
  16084. }
  16085. ,
  16086. n.prototype.intersecttag = function() {
  16087. var e = new r.Vector3
  16088. , t = new r.Vector3
  16089. , i = new r.Vector3;
  16090. return function(n, r, o) {
  16091. if (!this.enabled)
  16092. return null;
  16093. var a = null
  16094. , s = this.tagDiscs.filter(function(e) {
  16095. return e.parent.visible
  16096. });
  16097. if (s.length > 0) {
  16098. var l = this.model.floors.reduce(function(e, t) {
  16099. return t.hidden ? e : e.concat(t.collider.children)
  16100. }, s);
  16101. e.set(n.x, n.y, -1).unproject(o),
  16102. t.set(n.x, n.y, 1).unproject(o),
  16103. i.copy(t).sub(e).normalize(),
  16104. this.raycaster.set(e, i);
  16105. var c = this.raycaster.intersectObjects(l);
  16106. c.length > 0 && s.indexOf(c[0].object) !== -1 && (a = c[0].object.tag)
  16107. }
  16108. return this.intersectTag = a,
  16109. r && (this.activeTag && a !== this.activeTag && (this.tagState === y.BROWSE || this.tagState === y.EXAMINE && a) && this.dismissActiveTag(),
  16110. a && a !== this.activeTag && (a.listeners(h.ENTER).length < 1 && (a.billboard.on(h.ENTER, function() {
  16111. this.hoveredTag = a
  16112. }
  16113. .bind(this)),
  16114. a.billboard.on(h.LEAVE, function() {
  16115. this.hoveredTag = null
  16116. }
  16117. .bind(this))),
  16118. this.activateTag(a, y.BROWSE))),
  16119. a
  16120. }
  16121. }(),
  16122. n.prototype.rankedtagInDirection = function() {
  16123. var e = []
  16124. , t = []
  16125. , i = new r.Vector3
  16126. , n = new r.Vector3
  16127. , o = new r.Vector3;
  16128. return function(r, a, s, l) {
  16129. var c = 0;
  16130. t.length = 0;
  16131. for (var h = 0; h < this.closesttags.length; h++) {
  16132. var u = this.closesttags[h];
  16133. n.copy(u.position),
  16134. n.add(u.discPosition),
  16135. i.copy(a),
  16136. i.sub(n).negate(),
  16137. i.normalize();
  16138. var d = i.dot(l);
  16139. if (d >= 0) {
  16140. o.copy(n),
  16141. o.project(s);
  16142. var p = this.intersecttag(o, !1, s);
  16143. if (p) {
  16144. if (c >= e.length)
  16145. for (var f = 0; f < 64; f++)
  16146. e.push({
  16147. tag: u,
  16148. dot: d
  16149. });
  16150. var g = e[c];
  16151. g.tag = u,
  16152. g.dot = d,
  16153. g.position = math.projectPositionToCanvas(n, s),
  16154. t.push(g),
  16155. c++
  16156. }
  16157. }
  16158. }
  16159. return t.sort(function(e, t) {
  16160. return e.dot > t.dot ? -1 : e.dot < t.dot ? 1 : 0
  16161. }),
  16162. r < t.length ? t[r].tag : null
  16163. }
  16164. }(),
  16165. n.prototype.updateClosestTags = function() {
  16166. var e = new r.Vector3
  16167. , t = 30;
  16168. return function(i) {
  16169. this.closesttags || (this.closesttags = []),
  16170. this.closesttags.length = 0;
  16171. var n = this.model.tags;
  16172. if (n)
  16173. for (var r in n)
  16174. if (n.hasOwnProperty(r)) {
  16175. var o = n[r]
  16176. , a = o.position;
  16177. e.copy(i),
  16178. e.sub(a).negate();
  16179. var s = e.lengthSq();
  16180. s < t && this.closesttags.push(o)
  16181. }
  16182. }
  16183. }(),
  16184. t.exports = n
  16185. }
  16186. ).call(this, "/js/tag/tagManager.js")
  16187. }
  16188. , {
  16189. "../controls/serializer": 14,
  16190. "../enum/BlackoutStyle": 18,
  16191. "../enum/tagEvents": 32,
  16192. "../enum/ModelManagerEvents": 33,
  16193. "../enum/PlayerEvents": 40,
  16194. "../enum/TagStates": 44,
  16195. "../enum/Viewmode": 51,
  16196. "../enum/WarpStyle": 52,
  16197. "../objects/Snapshot": 153,
  16198. "../settings": 166,
  16199. "../util/common": 185,
  16200. "../util/lerp": 188,
  16201. "../util/logger": 189,
  16202. "./Billboard/BillboardEvent": 120,
  16203. "./Media/LinkType": 130,
  16204. "./Media/MediaEvent": 131,
  16205. events: 202,
  16206. three: 217
  16207. }],
  16208. 125: [function(e, t, i) {
  16209. (function(i) {
  16210. "use strict";
  16211. function n() {
  16212. this.embedWrapper = null,
  16213. this.embedElement = null
  16214. }
  16215. var r = e("../../util/ajax")
  16216. , o = e("./mediaSettings")
  16217. , a = e("../../settings")
  16218. , s = e("../../util/logger")
  16219. , l = new s(i);
  16220. n.prototype.createDomElement = function() {
  16221. return this.embedWrapper = document.createElement("div"),
  16222. this.embedWrapper.classList.add("tag-embed"),
  16223. this.embedWrapper.classList.add("hidden"),
  16224. this.embedWrapper
  16225. }
  16226. ,
  16227. n.prototype.load = function(e) {
  16228. var t = "https://api.embedly.com/1/oembed?key=" + a.appConfig.embedly_key + "&url=" + encodeURIComponent(e) + "&maxwidth=" + o.maxEmbedWidth;
  16229. return new Promise(function(e, i) {
  16230. r.get(t).then(function(t) {
  16231. if (t = JSON.parse(t),
  16232. t.html && t.html.indexOf("<script") === -1) {
  16233. this.embedWrapper.innerHTML = t.html;
  16234. var n = Math.min(t.width, o.maxEmbedWidth) || o.maxEmbedWidth;
  16235. if (this.embedWrapper.style.width = n + "px",
  16236. t.height) {
  16237. var r = t.height / t.width;
  16238. this.embedWrapper.style.height = n * r + "px"
  16239. }
  16240. this.embedElement = this.embedWrapper.firstChild;
  16241. var a = [];
  16242. try {
  16243. a = [].slice.call(this.embedElement.querySelectorAll("a"))
  16244. } catch (e) {
  16245. l.debug("Error getting `a` elements for embed; was it an iframe?")
  16246. }
  16247. a.forEach(function(e) {
  16248. e.setAttribute("target", "_blank")
  16249. }),
  16250. this.embedElement.classList.add("hidden"),
  16251. this.embedWrapper.classList.remove("hidden"),
  16252. e()
  16253. } else
  16254. i("Not a valid embed")
  16255. }
  16256. .bind(this), function(e) {
  16257. i(e.response)
  16258. })
  16259. }
  16260. .bind(this))
  16261. }
  16262. ,
  16263. n.prototype.show = function() {
  16264. this.embedElement && this.embedElement.classList.remove("hidden")
  16265. }
  16266. ,
  16267. n.prototype.hide = function() {
  16268. this.embedElement && this.embedElement.classList.add("hidden")
  16269. }
  16270. ,
  16271. t.exports = n
  16272. }
  16273. ).call(this, "/js/tag/Media/EmbedlyEmbed.js")
  16274. }
  16275. , {
  16276. "../../settings": 166,
  16277. "../../util/ajax": 181,
  16278. "../../util/logger": 189,
  16279. "./mediaSettings": 132
  16280. }],
  16281. 126: [function(e, t, i) {
  16282. (function(i) {
  16283. "use strict";
  16284. function n(e) {
  16285. o.call(this),
  16286. this.options = e,
  16287. this.playerControls = null,
  16288. this.state = s.NOT_READY
  16289. }
  16290. var r = e("../../util/browser")
  16291. , o = e("./EmbedlyEmbed")
  16292. , a = e("../../util/logger")
  16293. , s = (new a(i),
  16294. Object.freeze({
  16295. NOT_READY: "player.not.ready",
  16296. CUED: "player.cued",
  16297. PLAYING: "player.playing",
  16298. PAUSED: "player.paused"
  16299. }));
  16300. n.prototype = Object.create(o.prototype),
  16301. n.prototype.createDomElement = function() {
  16302. return this.embedWrapper = document.createElement("div"),
  16303. this.embedWrapper.classList.add("tag-video"),
  16304. this.embedWrapper.classList.add("hidden"),
  16305. this.embedWrapper
  16306. }
  16307. ,
  16308. n.prototype.load = function(e) {
  16309. var t = function() {
  16310. function e(e) {
  16311. this.playerState = s.CUED,
  16312. this.options.startMuted && this.playerControls.mute()
  16313. }
  16314. function t(e) {
  16315. this.playerState = e
  16316. }
  16317. function i(e) {
  16318. this.playerControls.setCurrentTime(0),
  16319. this.options.loop ? this.playerControls.play() : this.playerControls.pause()
  16320. }
  16321. this.playerControls = new playerjs.Player(this.embedElement),
  16322. this.playerControls.on("ready", e.bind(this)),
  16323. this.playerControls.on("play", t.bind(this, s.PLAYING)),
  16324. this.playerControls.on("pause", t.bind(this, s.PAUSED)),
  16325. this.playerControls.on("ended", i.bind(this))
  16326. }
  16327. .bind(this);
  16328. return o.prototype.load.call(this, e).then(t.bind(this))
  16329. }
  16330. ,
  16331. n.prototype.play = function() {
  16332. var e = r.isMobile();
  16333. return function() {
  16334. this.playerState !== s.NOT_READY && this.playerControls && !e && (this.state === s.CUED && this.options.autoPlay || this.options.autoResume) && this.playerControls.play()
  16335. }
  16336. }(),
  16337. n.prototype.pause = function() {
  16338. this.playerState !== s.NOT_READY && this.playerControls && this.playerControls.pause()
  16339. }
  16340. ,
  16341. t.exports = n
  16342. }
  16343. ).call(this, "/js/tag/Media/EmbedlyPlayer.js")
  16344. }
  16345. , {
  16346. "../../util/browser": 182,
  16347. "../../util/logger": 189,
  16348. "./EmbedlyEmbed": 125
  16349. }],
  16350. 127: [function(e, t, i) {
  16351. (function(i) {
  16352. "use strict";
  16353. function n(e) {
  16354. function t() {
  16355. return a.debug("requesting file from embedly:", e.href),
  16356. r.get(e.href, {
  16357. responseType: e.responseType
  16358. }).then(function(t) {
  16359. return a.debug("requesting file finished:", e.href),
  16360. t
  16361. })
  16362. }
  16363. function i() {}
  16364. return s = new Promise(function(e, n) {
  16365. s.catch(i).then(function() {
  16366. t().then(e, n)
  16367. })
  16368. }
  16369. )
  16370. }
  16371. var r = e("../../util/ajax")
  16372. , o = (e("./mediaSettings"),
  16373. e("../../util/logger"))
  16374. , a = new o(i)
  16375. , s = Promise.resolve();
  16376. t.exports.enqueue = n
  16377. }
  16378. ).call(this, "/js/tag/Media/EmbedlyQueue.js")
  16379. }
  16380. , {
  16381. "../../util/ajax": 181,
  16382. "../../util/logger": 189,
  16383. "./mediaSettings": 132
  16384. }],
  16385. 128: [function(e, t, i) {
  16386. (function(i) {
  16387. "use strict";
  16388. function n() {
  16389. this.imageWrapper = null,
  16390. this.width = 0,
  16391. this.height = 0,
  16392. this.aspect = 1
  16393. }
  16394. var r = e("./MediaEvent")
  16395. , o = e("./EmbedlyQueue")
  16396. , a = e("events").EventEmitter
  16397. , s = e("../../util/logger")
  16398. , l = e("../../settings");
  16399. new s(i);
  16400. n.prototype = Object.create(a.prototype),
  16401. n.prototype.createDomElement = function() {
  16402. return this.imageWrapper = document.createElement("div"),
  16403. this.imageWrapper.classList.add("tag-image"),
  16404. this.imageWrapper.classList.add("hidden"),
  16405. this.imageWrapper.addEventListener("click", function(e) {
  16406. e.stopPropagation(),
  16407. this.emit(r.IMAGE_OPENING),
  16408. this.imageWrapper.style.pointerEvents = "none"
  16409. }
  16410. .bind(this)),
  16411. this.imageWrapper
  16412. }
  16413. ,
  16414. n.prototype.onClosed = function() {
  16415. this.imageWrapper.style.pointerEvents = "auto"
  16416. }
  16417. ,
  16418. n.prototype.load = function(e) {
  16419. var t = Math.max(window.screen.height, window.screen.width)
  16420. , i = "https://i.embed.ly/1/display/resize?key=" + l.appConfig.embedly_key + "&url=" + encodeURIComponent(e) + "&width=" + t + "&height=" + t;
  16421. return new Promise(function(e, t) {
  16422. function n(t) {
  16423. var i = t.target;
  16424. this.width = i.naturalWidth,
  16425. this.height = i.naturalHeight,
  16426. this.aspect = this.width / this.height;
  16427. var n = t.target.src;
  16428. this.imageWrapper.style.backgroundImage = 'url("' + n + '")',
  16429. this.imageWrapper.style.width = this.width + "px",
  16430. this.imageWrapper.style.height = this.height + "px",
  16431. this.imageWrapper.classList.remove("hidden"),
  16432. e()
  16433. }
  16434. o.enqueue({
  16435. href: i,
  16436. responseType: "arraybuffer"
  16437. }).then(function(e) {
  16438. var t = new Uint8Array(e)
  16439. , i = new Blob([t])
  16440. , r = new window.Image;
  16441. r.addEventListener("load", n.bind(this));
  16442. var o = URL.createObjectURL(i);
  16443. r.src = o
  16444. }
  16445. .bind(this), t)
  16446. }
  16447. .bind(this))
  16448. }
  16449. ,
  16450. t.exports = n
  16451. }
  16452. ).call(this, "/js/tag/Media/Image.js")
  16453. }
  16454. , {
  16455. "../../settings": 166,
  16456. "../../util/logger": 189,
  16457. "./EmbedlyQueue": 127,
  16458. "./MediaEvent": 131,
  16459. events: 202
  16460. }],
  16461. 129: [function(e, t, i) {
  16462. "use strict";
  16463. function n(e) {
  16464. this.label = e.label,
  16465. this.href = e.url,
  16466. this.type = this.updateLinkForType(),
  16467. this.domElement = null,
  16468. this.id = c++
  16469. }
  16470. var r = e("./LinkType")
  16471. , o = e("./MediaEvent")
  16472. , a = e("../../util/browser")
  16473. , s = e("../../analytics")
  16474. , l = e("events").EventEmitter
  16475. , c = 0;
  16476. n.prototype = Object.create(l.prototype),
  16477. n.prototype.updateLinkForType = function() {
  16478. function e(e) {
  16479. var t = new RegExp("[#&?]start=([^#&?]*)")
  16480. , i = t.exec(e);
  16481. return i[1]
  16482. }
  16483. function t(e) {
  16484. return e + "&play=1"
  16485. }
  16486. var i = a.valueFromHash("m") || a.valueFromHash("model");
  16487. 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),
  16488. r.NAVIGATION) : (this.href = t(this.href),
  16489. r.MODEL) : r.EXT_LINK
  16490. }
  16491. ;
  16492. var h = {};
  16493. n.prototype.createDomElement = function() {
  16494. function e(e) {
  16495. switch (e.stopPropagation(),
  16496. h[this.id] = !0,
  16497. s.trackAlways("click_tag_link", {
  16498. link_type: this.type,
  16499. link_count: c,
  16500. links_clicked: Object.keys(h).length
  16501. }),
  16502. this.type) {
  16503. case r.MODEL:
  16504. window.location.replace(this.href);
  16505. break;
  16506. case r.EXT_LINK:
  16507. window.open(this.href, "_blank")
  16508. }
  16509. this.emit(o.LINK_CLICK, {
  16510. type: this.type,
  16511. url: this.href
  16512. })
  16513. }
  16514. if (this.domElement = document.createElement("a"),
  16515. this.domElement.classList.add("tag-link"),
  16516. this.domElement.textContent = this.label,
  16517. this.type === r.EXT_LINK) {
  16518. this.domElement.textContent += " ";
  16519. var t = document.createElement("i");
  16520. t.classList.add("icon-ext-link"),
  16521. t.title = "Link to external web site",
  16522. this.domElement.appendChild(t)
  16523. }
  16524. return this.domElement.addEventListener("click", e.bind(this)),
  16525. this.domElement
  16526. }
  16527. ,
  16528. t.exports = n
  16529. }
  16530. , {
  16531. "../../analytics": 4,
  16532. "../../util/browser": 182,
  16533. "./LinkType": 130,
  16534. "./MediaEvent": 131,
  16535. events: 202
  16536. }],
  16537. 130: [function(e, t, i) {
  16538. "use strict";
  16539. t.exports = {
  16540. NAVIGATION: "navigation",
  16541. MODEL: "model",
  16542. EXT_LINK: "ext-link"
  16543. }
  16544. }
  16545. , {}],
  16546. 131: [function(e, t, i) {
  16547. "use strict";
  16548. t.exports = Object.freeze({
  16549. LINK_CLICK: "mtmedia.link",
  16550. IMAGE_LOADED: "mtmedia.image.loaded",
  16551. IMAGE_OPENING: "mtmedia.image.opening",
  16552. IMAGE_OPENED: "mtmedia.image.opened",
  16553. IMAGE_CLOSING: "mtmedia.image.closing",
  16554. IMAGE_CLOSED: "mtmedia.image.closed",
  16555. VIDEO_START: "mtmedia.video.start",
  16556. VIDEO_PAUSE: "mtmedia.video.pause",
  16557. VIDEO_ENDED: "mtmedia.video.end"
  16558. })
  16559. }
  16560. , {}],
  16561. 132: [function(e, t, i) {
  16562. "use strict";
  16563. t.exports = Object.freeze({
  16564. maxEmbedWidth: 350,
  16565. defaultAspectRatio: .75
  16566. })
  16567. }
  16568. , {}],
  16569. 133: [function(e, t, i) {
  16570. "use strict";
  16571. t.exports = Object.freeze({
  16572. TEXT: "text",
  16573. LINK: "link",
  16574. IMAGE: "photo",
  16575. VIDEO: "video",
  16576. RICH: "rich"
  16577. })
  16578. }
  16579. , {}],
  16580. 134: [function(e, t, i) {
  16581. "use strict";
  16582. function n(e) {
  16583. this.capabilities = {
  16584. links: {
  16585. enable: e.supportLinks,
  16586. keepLabels: e.keepLinkLabels
  16587. }
  16588. }
  16589. }
  16590. var r = e("./DescriptionChunkType");
  16591. n.prototype.parse = function(e, t) {
  16592. var i = []
  16593. , n = e.split("[").map(function(e, t) {
  16594. return 0 === t ? e : "[" + e
  16595. });
  16596. return n.forEach(function(e) {
  16597. var n = this.findMarkdown(e);
  16598. if (n) {
  16599. if (n.url.indexOf("javascript:") !== -1)
  16600. return;
  16601. this.addLinkChunk(i, n, t),
  16602. this.addTextChunk(i, e.slice(n.markdown.length))
  16603. } else
  16604. this.addTextChunk(i, e)
  16605. }
  16606. .bind(this)),
  16607. i
  16608. }
  16609. ,
  16610. n.prototype.findMarkdown = function(e) {
  16611. var t = /\[([^\]]*)\]\((.*)\)/
  16612. , i = e.match(t);
  16613. if (i) {
  16614. for (var n = i[2], r = 1, o = 0; o < n.length && ("(" === n[o] ? r++ : ")" === n[o] && r--,
  16615. 0 !== r); )
  16616. o++;
  16617. var a = n.length - o;
  16618. return {
  16619. markdown: i[0].substring(0, i[0].length - a),
  16620. label: i[1],
  16621. url: i[2].substring(0, o)
  16622. }
  16623. }
  16624. }
  16625. ,
  16626. n.prototype.addTextChunk = function(e, t) {
  16627. 0 !== t.length && e.push({
  16628. type: r.TEXT,
  16629. text: t
  16630. })
  16631. }
  16632. ,
  16633. n.prototype.addLinkChunk = function(e, t) {
  16634. if (!this.capabilities.links.enable)
  16635. return void (this.capabilities.links.keepLabels && this.addTextChunk(e, t.label));
  16636. var i = {
  16637. label: t.label,
  16638. url: t.url
  16639. };
  16640. i.url.indexOf("://") === -1 && (i.url = "http://" + i.url),
  16641. e.push({
  16642. type: r.LINK,
  16643. link: i
  16644. })
  16645. }
  16646. ,
  16647. t.exports = n
  16648. }
  16649. , {
  16650. "./DescriptionChunkType": 133
  16651. }],
  16652. 135: [function(e, t, i) {
  16653. (function(i) {
  16654. "use strict";
  16655. var n = e("../util/logger")
  16656. , r = new n(i)
  16657. , o = {
  16658. parseIdsFromChunkName: function(e, t) {
  16659. t.floorId = o.parseFloor(e),
  16660. t.roomId = o.parseRoom(e)
  16661. },
  16662. parseFloor: function(e) {
  16663. var t = e.match(/_group([0-9]+)/);
  16664. if (!t)
  16665. return 0;
  16666. try {
  16667. return parseInt(t[1], 10)
  16668. } catch (e) {
  16669. return r.warn('Non-int value "' + t[1] + '" for mesh group, defaulting to floor 0'),
  16670. 0
  16671. }
  16672. },
  16673. parseRoom: function(e) {
  16674. var t = e.match(/_sub([0-9]+)/);
  16675. if (!t)
  16676. return -1;
  16677. try {
  16678. return parseInt(t[1], 10)
  16679. } catch (e) {
  16680. return r.warn('Non-int value "' + t[1] + '" for mesh subgroup, defaulting to subgroup 0'),
  16681. 0
  16682. }
  16683. }
  16684. };
  16685. t.exports = o
  16686. }
  16687. ).call(this, "/js/model/Chunks.js")
  16688. }
  16689. , {
  16690. "../util/logger": 189
  16691. }],
  16692. 136: [function(e, t, i) {
  16693. (function(i) {
  16694. "use strict";
  16695. function n(e) {
  16696. s.call(this),
  16697. this.model = e,
  16698. this.exploded = !1
  16699. }
  16700. var r = e("../objects/Floor")
  16701. , o = (e("../settings"),
  16702. e("../util/logger"))
  16703. , a = e("../util/transitions")
  16704. , s = e("../util/IndexedCollection")
  16705. , l = e("../util/common")
  16706. , c = e("../util/easing");
  16707. new o(i);
  16708. l.inherit(n, s),
  16709. n.prototype.add = function(e) {
  16710. s.prototype.add.call(this, e),
  16711. this.model.add(e)
  16712. }
  16713. ,
  16714. n.prototype.getIndex = function(e) {
  16715. return e.floorIndex
  16716. }
  16717. ,
  16718. n.prototype.build = function() {
  16719. this.list.forEach(function(e) {
  16720. e.build()
  16721. })
  16722. }
  16723. ,
  16724. n.prototype.size = function() {
  16725. return this.length
  16726. }
  16727. ,
  16728. n.prototype.sort = function() {
  16729. s.prototype.sort.call(this, function(e, t) {
  16730. return e.floorIndex - t.floorIndex
  16731. })
  16732. }
  16733. ,
  16734. n.prototype.nextFloor = function(e, t) {
  16735. return this.index[e.floorIndex + t] || null
  16736. }
  16737. ,
  16738. n.prototype.getFloorAtPoint = function(e) {
  16739. for (var t = null, i = 1 / 0, n = 0; n < this.list.length; n++) {
  16740. var r = this.list[n]
  16741. , o = r.distanceToPoint(e);
  16742. (!t || i > o) && (i = o,
  16743. t = r)
  16744. }
  16745. return t
  16746. }
  16747. ,
  16748. n.prototype.getOrMakeFloor = function(e) {
  16749. var t = this.index[e];
  16750. return t || (t = new r(this.model,e),
  16751. this.add(t)),
  16752. t
  16753. }
  16754. ,
  16755. n.prototype.hide = function() {
  16756. this.list.forEach(function(e) {
  16757. e.hide()
  16758. })
  16759. }
  16760. ,
  16761. n.prototype.show = function() {
  16762. this.list.forEach(function(e) {
  16763. e.show()
  16764. })
  16765. }
  16766. ,
  16767. n.prototype.names = function() {
  16768. return this.list.reduce(function(e, t) {
  16769. return e.concat(t.name)
  16770. }, [])
  16771. }
  16772. ,
  16773. n.prototype.toggleExplodeHorizontal = function() {
  16774. function e(e, t) {
  16775. r.copy(e.position),
  16776. e.position.x = i[e.floorIndex] * t,
  16777. e.position.y = 1 * e.floorIndex * t,
  16778. r.sub(e.position).multiplyScalar(-1),
  16779. e.panos.forEach(function(e) {
  16780. e.translate(r)
  16781. })
  16782. }
  16783. var t, i = [], n = 0;
  16784. this.list.forEach(function(e, r, o) {
  16785. t = r > 0 ? Math.max(o[r - 1].boundingBox.max.x - e.boundingBox.min.x, e.boundingBox.size().x / 2) : 0,
  16786. n += t,
  16787. i[r] = n
  16788. }),
  16789. i = i.map(function(e) {
  16790. return e - n / 2
  16791. });
  16792. var r = this.list[0].position.clone();
  16793. this.exploded ? this.list.forEach(function(t) {
  16794. a.start(function(i) {
  16795. e(t, 1 - i)
  16796. }, 1500, null, 0, c.easeOutExpo)
  16797. }) : this.list.forEach(function(t) {
  16798. a.start(function(i) {
  16799. e(t, i)
  16800. }, 1500, null, 0, c.easeOutExpo)
  16801. }),
  16802. this.exploded = !this.exploded
  16803. }
  16804. ,
  16805. n.prototype.toggleExplodeVertical = function() {
  16806. function e(e, i) {
  16807. var n = n.copy(e.position);
  16808. e.position.y = (5 * e.floorIndex - t.y / 2) * i,
  16809. n.sub(e.position).multiplyScalar(-1),
  16810. e.panos.forEach(function(e) {
  16811. e.translate(n)
  16812. })
  16813. }
  16814. var t = this.model.size;
  16815. this.list[0].position.clone();
  16816. this.exploded ? this.list.forEach(function(t) {
  16817. a.start(function(i) {
  16818. e(t, 1 - i)
  16819. }, 1500, null, 0, c.easeOutExpo)
  16820. }) : this.list.forEach(function(t) {
  16821. a.start(function(i) {
  16822. e(t, i)
  16823. }, 1500, null, 0, c.easeOutExpo)
  16824. }),
  16825. this.exploded = !this.exploded
  16826. }
  16827. ,
  16828. t.exports = n
  16829. }
  16830. ).call(this, "/js/model/FloorCollection.js")
  16831. }
  16832. , {
  16833. "../objects/Floor": 146,
  16834. "../settings": 166,
  16835. "../util/IndexedCollection": 175,
  16836. "../util/common": 185,
  16837. "../util/easing": 186,
  16838. "../util/logger": 189,
  16839. "../util/transitions": 195
  16840. }],
  16841. 137: [function(e, t, i) {
  16842. (function(i) {
  16843. "use strict";
  16844. function n() {
  16845. c.call(this)
  16846. }
  16847. var r = e("../settings")
  16848. , o = e("../util/logger")
  16849. , a = e("../enum/Viewmode")
  16850. , s = e("../objects/Snapshot")
  16851. , l = (e("../util/math"),
  16852. e("../util/common"))
  16853. , c = e("../util/IndexedCollection")
  16854. , h = new o(i);
  16855. l.inherit(n, c),
  16856. n.prototype.getImage = function(e) {
  16857. return e && this.index.hasOwnProperty(e) ? this.index[e] : null
  16858. }
  16859. ,
  16860. n.prototype.filterByModesAndReel = function(e, t) {
  16861. for (var i = [], n = 0; n < t.length; n += 1) {
  16862. var r = t[n]
  16863. , o = this.index[r.sid];
  16864. o && i.push(o)
  16865. }
  16866. var s = e[a.DOLLHOUSE]
  16867. , l = e[a.FLOORPLAN];
  16868. i = i.filter(function(e) {
  16869. if (!e.metadata || void 0 === e.metadata.camera_mode)
  16870. return !0;
  16871. var t;
  16872. try {
  16873. t = a.convertWorkshopModeInt(e.metadata.camera_mode)
  16874. } catch (e) {
  16875. return h.debug(e.message),
  16876. !1
  16877. }
  16878. return t === a.PANORAMA || t === a.FLOORPLAN && l || t === a.DOLLHOUSE && s
  16879. }),
  16880. i.length !== this.list.length && h.info("Disallowed " + (this.list.length - i.length) + " highlight images"),
  16881. this.list = i,
  16882. this.reIndex()
  16883. }
  16884. ,
  16885. n.prototype.getHeroLocations = function(panos) {//改 增加二级location
  16886. if (0 === this.list.length)
  16887. return [];
  16888. var locations = [];
  16889. var deal = (info, container)=>{
  16890. var src = info.thumbnail_signed_src,
  16891. o = info.name || "";
  16892. if (info.metadata && void 0 !== info.metadata.camera_quaternion) {
  16893. if (!r.show360Views.enabled && info.metadata.scan_id) {
  16894. let a = panos.get(info.metadata.scan_id);
  16895. if (a && !a.isAligned()) return
  16896. }
  16897. var cameraMode = a.convertWorkshopModeInt(info.metadata.camera_mode);
  16898. if (cameraMode === a.MESH) return
  16899. if(window.isLocal)src = manage.dealURL(src)
  16900. else src = "one" === g_version ? g_Prefix + src + "?" + randomTime().getTime() : src + "?" + randomTime().getTime()
  16901. var l = {
  16902. cameraMode: cameraMode,
  16903. position: info.metadata.camera_position,
  16904. quaternion: info.metadata.camera_quaternion,
  16905. zoom: info.metadata.zoom,
  16906. panoId: info.metadata.scan_id,
  16907. orthoZoom: info.metadata.ortho_zoom,
  16908. floorVisibility: void 0 !== info.metadata.floor_visibility ? info.metadata.floor_visibility.slice(0) : [],
  16909. thumbUrl: src,
  16910. name: n.filterImageName(o),
  16911. sid: info.sid
  16912. }
  16913. var item = new s(l);
  16914. item.momentTour = info.momentTour
  16915. item.dontRot = info.dontRot
  16916. item.rotTime = info.rotTime
  16917. container.push(item)
  16918. return item
  16919. }
  16920. }
  16921. this.list.forEach(image=>{
  16922. if(image.images){
  16923. var folder = $.extend({}, image )
  16924. folder.heroLocations = [];
  16925. image.images.list.forEach(child=>{
  16926. deal(child, folder.heroLocations);
  16927. })
  16928. folder.musicInfo = folder.musicInfo || {}
  16929. locations.push(folder)
  16930. delete folder.images;
  16931. delete folder.locations;
  16932. }else{
  16933. var item = deal(image, locations);
  16934. item.musicInfo = image.musicInfo || g_data2.tourAudio[item.sid] || {}//新的music数据统一写在每个info下,如果有musicInfo则覆盖g_data2.tourAudio
  16935. }
  16936. })
  16937. return locations
  16938. }
  16939. ,
  16940. n.prototype.getIndex = function(e) {
  16941. return e.sid
  16942. }
  16943. ,
  16944. n.filterImageName = function(e) {
  16945. return "" === e || e.match(/^[0-9.]+_[0-9.]+$/) ? null : e
  16946. }
  16947. ,
  16948. t.exports = n
  16949. }
  16950. ).call(this, "/js/model/ImageCollection.js")
  16951. }
  16952. , {
  16953. "../enum/Viewmode": 51,
  16954. "../objects/Snapshot": 153,
  16955. "../settings": 166,
  16956. "../util/IndexedCollection": 175,
  16957. "../util/common": 185,
  16958. "../util/logger": 189,
  16959. "../util/math": 190
  16960. }],
  16961. 138: [function(e, t, i) {
  16962. (function(i) {
  16963. "use strict";
  16964. function n() {
  16965. u.call(this)
  16966. }
  16967. var r = e("../label/Label")
  16968. , o = e("../settings")
  16969. , a = e("../util/logger")
  16970. , s = e("../util/math")
  16971. , l = e("../util/ajax")
  16972. , c = e("./RoomCollection")
  16973. , h = e("../util/common")
  16974. , u = e("../util/IndexedCollection");
  16975. new a(i);
  16976. h.inherit(n, u),
  16977. n.prototype.getIndex = function(e) {
  16978. return e.labelId
  16979. }
  16980. ,
  16981. n.prototype.associateWithRooms = function(e) {
  16982. this.forEach(function(t) {
  16983. e.forEach(function(e) {
  16984. e.roomId === t.roomId && (t.room = e)
  16985. })
  16986. })
  16987. }
  16988. ,
  16989. n.prototype.createFromLabelData = function(e) {
  16990. e.forEach(function(e) {
  16991. var t = n.parseRoomIndexFromWorkshopRoomId(e.roomId);
  16992. t = c.generateRoomId(e.floorId, t);
  16993. var i = new r(e.sid,e.position || e.positions[0],e.text,e.floorId,t);
  16994. i.position = s.convertWorkshopVector(i.position),
  16995. this.add(i),
  16996. i.build()
  16997. }
  16998. .bind(this))
  16999. }
  17000. ,
  17001. n.prototype.load = function(e, t) {
  17002. return l.get(e, {
  17003. responseType: "json",
  17004. auth: t ? o.authorizationHeader : null
  17005. }).done(function(e) {
  17006. var t = [];
  17007. for (var i in e) {
  17008. var n = e[i];
  17009. t.push(n)
  17010. }
  17011. this.createFromLabelData(t)
  17012. }
  17013. .bind(this))
  17014. }
  17015. ,
  17016. n.parseRoomIndexFromWorkshopRoomId = function(e) {
  17017. var t = -1;
  17018. if (e) {
  17019. if(typeof e == 'number'){//add
  17020. t = parseInt(e)
  17021. }else{
  17022. var i = e.split("_");
  17023. t = parseInt(i[0])
  17024. }
  17025. }
  17026. return t
  17027. },
  17028. t.exports = n
  17029. }
  17030. ).call(this, "/js/model/LabelCollection.js")
  17031. }
  17032. , {
  17033. "../label/Label": 90,
  17034. "../settings": 166,
  17035. "../util/IndexedCollection": 175,
  17036. "../util/ajax": 181,
  17037. "../util/common": 185,
  17038. "../util/logger": 189,
  17039. "../util/math": 190,
  17040. "./RoomCollection": 141
  17041. }],
  17042. 139: [function(e, t, i) {
  17043. (function(i) {
  17044. "use strict";
  17045. function n(e, t) {
  17046. o.Object3D.call(this)
  17047. this.sid = window.number;//t.sid,
  17048. this.data = t,
  17049. this.options = e,
  17050. this.urls = new s(e.urlFiles),
  17051. this.isPublic = void 0 !== t.is_public && t.is_public,
  17052. //创建heroLocations
  17053. this.images = new _(this),
  17054. this.images.extend(t.images),
  17055. this.images.forEach((info)=>{
  17056. if(info.locations){
  17057. info.images = new _(this);
  17058. info.images.extend(info.locations)
  17059. }
  17060. })
  17061. this.heroLocations = []
  17062. //this.heroImage = this.images.getImage(t.icon), //初始画面沒有用到icon
  17063. this.outdoorPanoLocations = [],
  17064. this.floors = new d(this),
  17065. this.floorsEnabled = void 0 === e.floors || e.floors,
  17066. this.changingFloor = !1,
  17067. this.chunks = [],
  17068. this.panos = new A,
  17069. this.colliders = [],
  17070. this.loadPanosPromise = null,
  17071. this.loadMeshTexturesPromise = null,
  17072. this.auxDataPromise = null,
  17073. this.meshTexturesLoaded = !1,
  17074. this.meshTextures = [],
  17075. this.tags = {},
  17076. this.tagsShown = !1,
  17077. this.shouldShowtags = !1,
  17078. this.has360Views = !1,
  17079. this.showingLabels = f.labels.enabled && t.player_options.labels,
  17080. this.supportedModes = {},
  17081. this.supportedModes[c.PANORAMA] = !0,
  17082. this.supportedModes[c.DOLLHOUSE] = !t.player_options || t.player_options.dollhouse && w.valueFromHash("dh", 1),
  17083. this.supportedModes[c.FLOORPLAN] = !t.player_options || t.player_options.floor_plan && w.valueFromHash("dh", 1),
  17084. this.supportedModes[c.TRANSITIONING] = !0,
  17085. this.supportsTiles = this.configureTiling(),
  17086. // this.supportsVR = t.is_vr,
  17087. this.supportsVR = window.DATA.supportsVR || false//true; // 方奕卓 VR功能可配置
  17088. this.mode = c.DOLLHOUSE,
  17089. this.size = null,
  17090. this.center = null,
  17091. this.boundingBox = new o.Box3,
  17092. this.currentFloor = null,
  17093. this.allFloorsVisible = !0,
  17094. this.projectedPano0 = null,
  17095. this.projectedPano1 = null,
  17096. this.floorsEnabled && t.floors && t.floors.indexOf(",") !== -1 && t.floors.split(",").forEach(function(e, t) {
  17097. this.addFloor(new u(this,t,e.trim()))
  17098. }
  17099. .bind(this)),
  17100. this.waitQueue = [],
  17101. this.on("load", function(e) {
  17102. 0 !== this.waitQueue.length && (this.waitQueue = this.waitQueue.filter(function(e) {
  17103. return !e.isLoadedCallback()
  17104. }),
  17105. 0 === this.waitQueue.length && this.emit("waiting-done"))
  17106. }
  17107. .bind(this)),
  17108. this.setupCustomProperties()
  17109. this.hots = {};
  17110. }
  17111. function r() {
  17112. try {
  17113. var e = document.createElement("canvas")
  17114. , t = e.getContext("webgl");
  17115. t || (t = e.getContext("experimental-webgl"));
  17116. var i = t.getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE);
  17117. return i
  17118. } catch (e) {
  17119. return 0
  17120. }
  17121. }
  17122. var o = e("three")
  17123. , a = e("../util/ajax")
  17124. , s = e("../util/ModelUrls")
  17125. , l = e("../objects/BoundingTextureSkybox")
  17126. , c = e("../enum/Viewmode")
  17127. , h = e("../enum/RenderOrder")
  17128. , u = (e("../enum/AlignmentType"),
  17129. e("../objects/Floor"))
  17130. , d = e("./FloorCollection")
  17131. , p = e("../objects/Chunk")
  17132. , f = (e("../objects/Room"),
  17133. e("../objects/Snapshot"),
  17134. e("../label/Label"),
  17135. e("../util/math"),
  17136. e("../settings"))
  17137. ,ss = e("../shaders")
  17138. , g = e("../util/logger")
  17139. , m = e("../tag/tag")
  17140. , v = (e("../tag/tagManager"),
  17141. e("../objects/Panorama"))
  17142. , A = e("../util/PanoramaCollection")
  17143. , y = e("../loaders/ModelLoader")
  17144. , C = e("../loaders/ModelTextureLoader")
  17145. , I = e("../loaders/SweepDataLoader")
  17146. , E = e("../util/transitions")
  17147. , b = e("../util/common")
  17148. , es = e("../util/easing")
  17149. ,lerp = e("../util/lerp")
  17150. ,tex = e("../util/texture")
  17151. , w = e("./../util/browser")
  17152. , _ = e("./ImageCollection")
  17153. , T = e("./RoomCollection")
  17154. , x = e("./LabelCollection")
  17155. , S = e("./Chunks")
  17156. , M = e("./../util/showcase")
  17157. , R = e("../exception/BasicException")
  17158. , P = (e("../constants")
  17159. ,e("events").EventEmitter)
  17160. //,Hot = e("hot")
  17161. , O = new g(i);
  17162. n.prototype = Object.create(o.Object3D.prototype),
  17163. b.extend(n, P),
  17164. n.prototype.setupCustomProperties = function() {
  17165. var e = f.modelAlpha;
  17166. Object.defineProperty(this, "alpha", {
  17167. get: function() {
  17168. return e
  17169. },
  17170. set: function(t) {
  17171. e = t,
  17172. this.chunks.forEach(function(t) {
  17173. t.material && t.material.uniforms.modelAlpha && (t.material.uniforms.modelAlpha.value = e)
  17174. })
  17175. }
  17176. })
  17177. }
  17178. ,
  17179. n.prototype.configureTiling = function() {
  17180. var e = r();
  17181. if (e < 2048)
  17182. return !1;
  17183. O.warn("Max cube texture size: " + e);
  17184. for (var t = 0; t < f.tiling.tilingFlagNames.length; t++) {
  17185. var i = f.tiling.tilingFlagNames[t];
  17186. if ("1" === w.valueFromHash(i, null))
  17187. return !0;
  17188. if ("0" === w.valueFromHash(i, null))
  17189. return !1
  17190. }
  17191. //--------------------------------------------许钟文-------------------------------------------
  17192. //return true;
  17193. return !!M.modelDataPromisesTiles(this.data) //免去访问mdoeldata.json的vision_version,不明白这是什么
  17194. //--------------------------------------------e n d -------------------------------------------
  17195. }
  17196. ,
  17197. n.prototype.toggleAlpha = function() {
  17198. this.alpha < 1 ? this.alpha = 1 : this.alpha = 0
  17199. }
  17200. ,
  17201. n.prototype.load = function(e) {
  17202. var t = function() {
  17203. return $.when(this.loadPanos(), this.loadMesh())
  17204. }
  17205. , i = this.urls.init().then(t.bind(this));
  17206. return e ? i = i.then(this.loadMeshTextures.bind(this)) : i.then(this.loadMeshTextures.bind(this)),
  17207. this.auxDataPromise = $.when( /*this.loadHighlightReel(), this.loadtags() */this.loadhots(), this.loadLabels()),
  17208. $.when(i, this.auxDataPromise).done(this.build.bind(this)) //不要另外使用active_reel文件
  17209. }
  17210. ,
  17211. n.prototype.loadMesh = function() {
  17212. function e(e) {
  17213. O.error(e),
  17214. n.reject("loading-failed")
  17215. }
  17216. function t(e, t) {
  17217. n.notify(e, t)
  17218. }
  17219. function i(e, t) {
  17220. if (0 === e.length) {
  17221. O.warn("No geometry found for model, loading faux geometry, disabling outside mode"),
  17222. r.supportedModes[c.DOLLHOUSE] = !1,
  17223. r.supportedModes[c.FLOORPLAN] = !1;
  17224. var i = new p({
  17225. geometry: new o.PlaneBufferGeometry(5,5,1,1)
  17226. });
  17227. i.material.visible = !1,
  17228. i.rotateX(-Math.PI / 2),
  17229. i.geometry.computeBoundingBox(),
  17230. e = [i]
  17231. }
  17232. e.forEach(function(e) {
  17233. var t = r.floorsEnabled ? S.parseFloor(e.name) : 0;
  17234. r.addChunk(t, e)
  17235. }),
  17236. r.floors.sort(),
  17237. n.resolve(r)
  17238. }
  17239. var n = $.Deferred()
  17240. , r = this;
  17241. return y.load(r.data.job.uuid, r.urls, i, t, e),
  17242. n.promise()
  17243. }
  17244. ,
  17245. n.prototype.loadMeshTextures = function() {
  17246. return this.loadTexturesPromise ? this.loadTexturesPromise : (this.loadTexturesPromise = C.load(this, this.meshTextures).then(function() {
  17247. this.meshTexturesLoaded = !0
  17248. }
  17249. .bind(this)),
  17250. this.loadTexturesPromise)
  17251. }
  17252. ,
  17253. /* n.prototype.loadtags = function() {//xzw改
  17254. var e = $.Deferred();
  17255. if (!f.tags.enabled)
  17256. return e.resolve();
  17257. //var t = this.options.urlBase + "/api/v1/jsonstore/model/tags/" + this.sid;
  17258. t = "data/" + this.sid + "/tags.json"
  17259. return a.get(t, {
  17260. responseType: "json",
  17261. auth: this.isPublic ? null : f.authorizationHeader
  17262. }).done(function(t) {
  17263. var i = 0
  17264. , n = 0;
  17265. for (var r in t) {
  17266. var o = t[r];
  17267. o.enabled && (n++,
  17268. (o.label.length || o.description.length) && (this.tags[r] = new m(this,r,o),
  17269. i++))
  17270. }
  17271. i !== n && O.warn("Disallowed " + (n - i) + " tags with no text data"),
  17272. e.resolve()
  17273. }
  17274. .bind(this)).fail(function() {
  17275. O.warn("Getting tags failed, not displaying tags."),
  17276. e.resolve()
  17277. }),
  17278. e
  17279. } */
  17280. n.prototype.shineHots = function(){ //xzw
  17281. E.trigger({
  17282. func: function(e) {
  17283. var opa = e <= .5 ? 2 * e : -2 * e + 2
  17284. for(var i in this.hots){
  17285. this.hots[i].mesh.material.uniforms.opac.value = opa;
  17286. }
  17287. }.bind(this),
  17288. cycling: true,
  17289. duration: 3000,
  17290. //easing: "easeInOutQuad",
  17291. name: "hotShine"
  17292. })
  17293. },
  17294. /* n.prototype.loadOverlays = function(overlays){
  17295. var overlays = window.data2 && window.data2.overlays
  17296. overlays && overlays.forEach((info)=>{
  17297. new Overlay(info)
  17298. })
  17299. Overlay.load()
  17300. }
  17301. */
  17302. n.prototype.loadhots = function() {//xzw
  17303. initHot(this)
  17304. var r = $.Deferred();
  17305. var t = g_Prefix+"data/" + this.sid + "/data2.js" +'?'+ randomTime().getTime();
  17306. return a.get(t, {
  17307. responseType: "json",
  17308. auth: this.isPublic ? null : f.authorizationHeader
  17309. }).done(function(e) {
  17310. window.data2 = e;
  17311. if(!e){
  17312. console.error("data2 is null")
  17313. }else{
  17314. g_data2 = hotMatcher(e);
  17315. this.hotsCount = 0;
  17316. //因为热点保存后在hots里的顺序会被修改,所以使用order来记录顺序,这里要重排序:
  17317. if(e.hots){
  17318. var sids = Object.keys(e.hots).sort((a,b)=>{return e.hots[a].order - e.hots[b].order});
  17319. sids.forEach((sid)=>{
  17320. e.hots[sid].sid = sid
  17321. new Hot(e.hots[sid], e.hots[sid].version != 'multi' && "byHot" )
  17322. })
  17323. }
  17324. if(e.overlays){
  17325. e.overlays.forEach((info)=>{
  17326. //if(info.file.includes('m/data/762/edit/20210312_112357584.mp4') )return;
  17327. new Hot(info, 'byOverlay')
  17328. })
  17329. }
  17330. Hot.createHotList();
  17331. Hot.startLoad()
  17332. g_index = w.valueFromHash("m");
  17333. }
  17334. /***************************方奕卓 请求data.js数据, 用于初始化热点列表 ****************************/
  17335. /* var dataJsPromise = $.Deferred();
  17336. var dataJsUrl = g_Prefix+"data/" + this.sid + "/hot/js/data.js" +'?'+ randomTime().getTime();
  17337. a.get(dataJsUrl,{
  17338. responseType: "json",
  17339. auth: this.isPublic ? null : f.authorizationHeader
  17340. }).done(function(data) {
  17341. window.hotData = data;
  17342. this.createHotItem(data, this.hots);
  17343. for(let i in this.hots){//add
  17344. data[i] && this.hots[i].initStyleImg(data[i]);
  17345. }
  17346. dataJsPromise.resolve();
  17347. }.bind(this)).fail(function(){
  17348. console.log('Data.js is empty');
  17349. dataJsPromise.resolve();
  17350. }) */
  17351. r.resolve();
  17352. }.bind(this)).fail(function() {
  17353. console.log('没有热点');
  17354. r.resolve()
  17355. }),
  17356. r
  17357. }
  17358. ,
  17359. n.prototype.loadPanos = function() {
  17360. if (this.loadPanosPromise)
  17361. return this.loadPanosPromise;
  17362. var e = new I(this);
  17363. return this.loadPanosPromise = e.load().then(function(e) {
  17364. return this.data.sweeps && Object.keys(this.data.sweeps).length > 0 && (e = e.filter(function(e) {
  17365. if(this.data.sweeps[e.uuid])return this.data.sweeps[e.uuid].enabled
  17366. else console.log(e.uuid)
  17367. }
  17368. .bind(this))),
  17369. this.panos.extend(e.map(function(e) {
  17370. return new v(this,e.uuid,e,this.supportsTiles)
  17371. }
  17372. .bind(this))),
  17373. this.panos.forEach(function(e) {
  17374. e.neighbourUUIDs && (e.neighbourUUIDs.forEach(function(t) {
  17375. var i = this.panos.get(t);
  17376. i && this.panos.setNeighbour(e, i, !0)
  17377. }
  17378. .bind(this)),
  17379. e.neighbourPanos = this.panos.getNeighbours(e) || this.panos.setNeighbour(e, e, !0))
  17380. }
  17381. .bind(this)),
  17382. 0 === this.panos.length && (O.warn("Model has no panos, turning off inside mode"),
  17383. this.supportedModes[c.PANORAMA] = !1),
  17384. $.when(this)
  17385. }
  17386. .bind(this)),
  17387. this.loadPanosPromise
  17388. }
  17389. ,
  17390. n.prototype.loadHighlightReel = function() {//xzw
  17391. var e = $.Deferred()
  17392. // , t = this.options.urlBase + "/api/v1/jsonstore/model/highlights/" + this.sid + "/active_reel";
  17393. ,t = this.options.urlBase + "data/" + this.sid + "/active_reel.json";
  17394. return a.get(t, {
  17395. responseType: "json",
  17396. auth: this.isPublic ? null : f.authorizationHeader
  17397. }).done(function(t) {
  17398. t.reel ? (O.info("Got highlight reel with " + t.reel.length + " items"),
  17399. this.images.filterByModesAndReel(this.supportedModes, t.reel)) : O.info("No highlight reel found"),
  17400. e.resolve()
  17401. }
  17402. .bind(this)).fail(function() {
  17403. O.warn("Getting highlight reel failed, no highlights available"),
  17404. e.resolve()
  17405. }),
  17406. e
  17407. }
  17408. ,
  17409. n.prototype.waitForLoad = function(e, t) {
  17410. t() || (this.waitQueue.push({
  17411. object: e,
  17412. isLoadedCallback: t
  17413. }),
  17414. 1 === this.waitQueue.length && this.emit("waiting"))
  17415. }
  17416. ,
  17417. n.prototype.hide = function() {
  17418. this.floors.hide()
  17419. }
  17420. ,
  17421. n.prototype.show = function() {
  17422. this.floors.show()
  17423. }
  17424. ,
  17425. n.prototype.floorNames = function() {
  17426. return this.floors.names()
  17427. }
  17428. ,
  17429. n.prototype.warpDestFloors = function(e, t) {
  17430. if (!e || this.floors.length !== e.length)
  17431. return void this.toggleAllFloors(!0);
  17432. var i = e.findIndex(function(e) {
  17433. return e
  17434. }
  17435. .bind(this));
  17436. i !== -1 && this.setFloor(this.floors.list[i], null, t)
  17437. }
  17438. ,
  17439. n.prototype.setFloor = function(e, t, i) {
  17440. this.allFloorsVisible && this.emit("allfloors.toggled", !1, this.currentFloor),
  17441. this.allFloorsVisible = !1,
  17442. this._setFloor(e, t, i)
  17443. }
  17444. ,
  17445. n.prototype.toggleAllFloors = function(e) {
  17446. this.allFloorsVisible = void 0 !== e ? e : !this.allFloorsVisible,
  17447. this.emit("allfloors.toggled", this.allFloorsVisible, this.currentFloor),
  17448. this._setFloor(this.currentFloor)
  17449. }
  17450. ,
  17451. n.prototype._setFloor = function(e, t, i) {
  17452. t = t || this.mode,
  17453. this.emit("floor.changed", e, t, this.currentFloor),
  17454. this.currentFloor = e;
  17455. var n;
  17456. if (t === c.PANORAMA) {
  17457. if (this.show(),
  17458. this.shouldShowtags && this.tagsShown)
  17459. for (n in this.tags)
  17460. this.tags[n].show(f.showFloorDuration)
  17461. } else if ((t === c.FLOORPLAN || t === c.DOLLHOUSE) && (this.floors.list.forEach(function(e, t) {
  17462. e.toggle(e === this.currentFloor || this.allFloorsVisible, i || this.allFloorsVisible)
  17463. }
  17464. .bind(this)),
  17465. this.shouldShowtags && this.tagsShown))
  17466. for (n in this.tags) {
  17467. var r = this.tags[n];
  17468. this.allFloorsVisible ? r.show(f.showFloorDuration) : r.floor === this.currentFloor ? r.show(f.showFloorDuration, f.showFloorDelay) : r.hide(f.hideFloorDuration, f.hideFloorDelay)
  17469. }
  17470. var o = this
  17471. , a = e;
  17472. E.start(function() {}, f.showFloorDelay, function() {
  17473. o.floors.forEach(function(e) {
  17474. e.chunks.forEach(function(t) {
  17475. t.renderOrder = e === a ? h.visibleFloor : h.ghostFloor
  17476. })
  17477. })
  17478. }
  17479. .bind(this))
  17480. }
  17481. ,
  17482. n.prototype.toggleExplode = function() {
  17483. this.floors.toggleExplodeHorizontal()
  17484. }
  17485. ,
  17486. n.prototype.toggleExplodeUp = function() {
  17487. this.floors.toggleExplodeVertical()
  17488. }
  17489. ,
  17490. n.prototype.nextFloor = function(e) {
  17491. return this.floors.nextFloor(this.currentFloor, e)
  17492. }
  17493. ,
  17494. n.prototype.addFloor = function(e) {
  17495. this.floors.add(e)
  17496. }
  17497. ,
  17498. n.prototype.getFloorAtPoint = function(e) {
  17499. return this.floors.getFloorAtPoint(e)
  17500. }
  17501. ,
  17502. n.prototype.getTagBySid = function(e) {
  17503. return this.tags[e]
  17504. }
  17505. ,
  17506. n.prototype.addChunk = function(e, t) {
  17507. this.floors.getOrMakeFloor(e).addChunk(t),
  17508. this.chunks.push(t)
  17509. }
  17510. ,
  17511. n.prototype.setMode = function(e) {
  17512. if (!this.supportedModes[e])
  17513. throw new R("Mode not supported for this model: " + e);
  17514. this.mode = e;
  17515. this.skybox.material.transparent = e == "panorama" ? false : true //xzw add // 如果skybox透明,会让其中其他mesh 如热点的透明出问题
  17516. this.chunks.forEach(function(t) {
  17517. t.setMode(e)
  17518. })
  17519. }
  17520. ,
  17521. n.prototype.build = function() {
  17522. this.heroLocations = this.images.getHeroLocations(this.panos);
  17523. var e = function() {
  17524. 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()
  17525. }
  17526. .bind(this)();
  17527. this.has360Views = f.show360Views.enabled && this.heroLocations.some(function(e) {
  17528. return e.cameraMode === c.PANORAMA && this.panos.get(e.panoId) && !this.panos.get(e.panoId).isAligned()
  17529. }
  17530. .bind(this)) || e,
  17531. null === this.heroImage && O.warn("No hero image defined."),
  17532. this.currentFloor = this.floors.last(),
  17533. this.floors.build(),
  17534. this.colliders = this.floors.reduce(function(e, t) {
  17535. return e.concat(t.collider.children)
  17536. }, []),
  17537. this.panos.forEach(function(e) {
  17538. e.build1(),
  17539. e.on("enter", function() {
  17540. e.floor !== this.currentFloor && this.setFloor(e.floor)
  17541. }
  17542. .bind(this))
  17543. }
  17544. .bind(this)),
  17545. this.panos.forEach(function(e) {
  17546. e.build2()
  17547. }),
  17548. this.floors.forEach(function(e) {
  17549. this.boundingBox.union(e.boundingBox)
  17550. }
  17551. .bind(this)),
  17552. this.size = this.boundingBox.size(),
  17553. this.center = this.boundingBox.center(),
  17554. this.floors.forEach(function(e) {
  17555. O.info("Floor " + e + ": " + e.children.length + " chunks, " + e.panos.length + " panos.")
  17556. }
  17557. .bind(this)),
  17558. this.panos.populate_path_graph(),
  17559. this.skybox = new l(this.boundingBox),
  17560. this.skybox.matrixWorldNeedsUpdate = !0,
  17561. this.add(this.skybox);
  17562. setTimeout(function() {
  17563. //this.hotsCount && this.shineHots()
  17564. Hot.beginShineHot()
  17565. }
  17566. .bind(this), 1300)
  17567. //add-----
  17568. {
  17569. let maxCount = browser.isMobile() ? 200000 : 400000
  17570. let noVisiHots = this.hotGroup.children.filter(e=>!e.info.visiblePanos && e.info.texType != 'shine') //只看非热点的,否则数据太多
  17571. let visiHots = this.hotGroup.children.filter(e=>e.info.visiblePanos)
  17572. let c = this.panos.list.length * this.colliders.length * noVisiHots.length
  17573. if(c > maxCount){ //防止加载时间过长,分批计算
  17574. console.log('hot分批setVisiblePanos')
  17575. Hot.visiPanosCountSlice = Math.ceil(maxCount / this.colliders.length / noVisiHots.length)
  17576. Hot.visiEveryDurSlice = browser.isMobile() ? 25 : 16;
  17577. let dur = Math.ceil(this.panos.list.length / Hot.visiPanosCountSlice) * Hot.visiEveryDurSlice
  17578. console.log(Hot.visiPanosCountSlice, Hot.visiEveryDurSlice, dur, Math.round(dur*noVisiHots.length))
  17579. if(noVisiHots.length){
  17580. let i = 0
  17581. let hotVisiInterval = setInterval(()=>{
  17582. noVisiHots[i].setVisiblePanos(noVisiHots[i].info.visiblePanos);
  17583. i++;
  17584. if(i>=noVisiHots.length){
  17585. clearInterval(hotVisiInterval)
  17586. }
  17587. }, dur)
  17588. }
  17589. }
  17590. }
  17591. //---------
  17592. this.createFloorLogo()
  17593. return O.debug("Done building model"),
  17594. v.raycastsDone > 0 && (O.warn("raycasts: " + v.raycastsDone),
  17595. O.warn("raycasts skipped: " + v.raycastsSkipped)),
  17596. this.buildRooms(),
  17597. this.labels.associateWithRooms(this.rooms),
  17598. $.when(this)
  17599. }
  17600. ,
  17601. n.prototype.createFloorLogo = function(){
  17602. console.log('createFloorLogo')
  17603. if(this.floorLogos || !settings.floorlogoURL)return;
  17604. var url = settings.floorlogoURL
  17605. var map = tex.load(url);//可以追加done
  17606. this.floorLogos = [];
  17607. for(var i=0; i<2; i++){ //不可共用uniforms等 [0]在上一个位置,[1]是下一个位置、 是飞入及飞出后的位置
  17608. var material = new o.MeshBasicMaterial({
  17609. opacity:0,
  17610. map:map,
  17611. side: o.DoubleSide,
  17612. transparent: !0,
  17613. depthWrite: !1,
  17614. depthTest:false//改 在chunk\skybox外也可看到
  17615. });
  17616. var logo = new o.Mesh(new o.PlaneGeometry(2,2,1,1),material);
  17617. //var s = (Store.metadata.floorLogoSize || 100)/100;
  17618. //logo.scale.set(s,s,s);
  17619. logo.position.set(0,-1.5,0);
  17620. logo.lookAt(logo.position.clone().add(new o.Vector3(0,1,0)));
  17621. logo.renderOrder = 100;//cover the videoSkybox
  17622. //logo.layers.set(0)
  17623. this.add(logo);
  17624. this.floorLogos.push(logo);
  17625. }
  17626. this.floorLogos[1].visible = false;
  17627. }
  17628. n.prototype.adjustfloorLogoHeight = function(o){
  17629. var h = player.currentPano.floorPosition.y + 0.01;
  17630. this.floorLogos[1].position.setY(h);
  17631. this.floorLogos[0].position.setY(h);
  17632. //publicObjectSet.player.path.currentPanoMarker.mesh.position.y = h
  17633. },
  17634. n.prototype.changefloorLogoOpa = function(o){//改 i, opacity, time, delay
  17635. if(!this.floorLogos) return;
  17636. E.cancelById("flOpa_"+o.index);//先停止之前该logo的透明度变化
  17637. if(o.from!=void 0)this.floorLogos[o.index].material.opacity = o.from;//初始透明度
  17638. if(!o.dur){//立刻
  17639. //this.floorLogos[o.index].material.uniforms.opacity.value = o.opa;
  17640. this.floorLogos[o.index].material.opacity = o.opa;
  17641. }else{
  17642. //E.start(lerp.uniform(this.floorLogos[o.index], "opacity", o.opa), o.dur || 0, null,
  17643. E.start(lerp.property(this.floorLogos[o.index].material, "opacity", o.opa), o.dur || 0, null,
  17644. o.delay||0, es["easeInQuad"], "changefloorLogoOpa", "flOpa_"+o.index)
  17645. }
  17646. },
  17647. n.prototype.updateFloorlogo = function() { //xzw add 更新地标的旋转
  17648. var lastQ, lastP;
  17649. var equals = function(v1, v2, min){
  17650. return Math.abs(v1-v2) < min
  17651. }
  17652. var isSame = function(now, last, k){//如果和上次相同就不改变
  17653. if(!last)return false;
  17654. var R = k.sceneRenderer;
  17655. //var min = R.AFPS < 38 ? 0.005 : R.AFPS < 45 ? 0.0008 : R.AFPS < 50 ? 0.0006 : 0.0003;
  17656. //暂时:
  17657. var min = 0.0008
  17658. var same = equals(now.x , last.x, min) && equals(now.y , last.y, min) && equals(now.z , last.z, min)
  17659. && (now.w!=void 0 ? equals(now.w , last.w, min) : true)
  17660. return same;
  17661. }
  17662. return function(Q, k){
  17663. if(!Q)return;
  17664. /* if(Config.ifFish && window.lowFPS){
  17665. this.fLCompute++;
  17666. if(R.AFPS < 38){
  17667. if(k.flyingToTag && k.flying && k.fLCompute %4 !=1) return; //点击tag过渡
  17668. else if(k.flying && k.fLCompute%2 !=1) return;
  17669. k.fLCompute %= 4;
  17670. }else if(R.AFPS < 45){
  17671. if(k.flyingToTag && k.flying && k.fLCompute %3 !=1) return; //点击tag过渡
  17672. else if(k.flying && k.fLCompute%2 !=1) return;
  17673. k.fLCompute %= 6;
  17674. }else{
  17675. if(k.flyingToTag && k.flying && k.fLCompute %2 !=1) return;
  17676. //else if(k.flying && k.fLCompute%2 !=1) return;
  17677. k.fLCompute %= 2;
  17678. }
  17679. } */
  17680. var sameQ, sameP, quaternion, visible;
  17681. for(var i=0;i<2;i++){
  17682. var logo = this.floorLogos[i];
  17683. if(!logo.visible || logo.material.uniforms.opacity.value==0) continue;
  17684. visible = true;
  17685. }
  17686. if(!visible)return; //如果两个都不可见,就不更改,如果有一个可见,就都改
  17687. var c = k.cameraControls.activeControl;
  17688. var sameQ = c ? ( c.lat < 10 ? equals(c.lon, lastQ, 0.1) : equals(c.lon, lastQ, 1) ): false;
  17689. sameQ || (lastQ = c ? c.lon : null); //相机旋转是否改变了
  17690. for(var i=0;i<2;i++){
  17691. var logo = this.floorLogos[i];
  17692. if(!sameQ){
  17693. if(!quaternion){
  17694. var a = new THREE.Vector3(0,0,-1);
  17695. a.applyQuaternion(Q);
  17696. a.setY(0);
  17697. var _ = (new THREE.Matrix4).lookAt(a,new THREE.Vector3, new THREE.Vector3(0,1,0));
  17698. quaternion = (new THREE.Quaternion).setFromRotationMatrix(_)
  17699. var a = new THREE.Quaternion( 0, 0.7071067811865476, 0.7071067811865476 , 0)//计算得
  17700. quaternion.multiply(a);
  17701. }
  17702. logo.quaternion.copy(quaternion);
  17703. }
  17704. }
  17705. }
  17706. }()
  17707. n.prototype.loadLabels = function() {//xzw
  17708. this.labels = new x(this);
  17709. var e = $.Deferred();
  17710. //加载俯视图的标签 注释这个备注就会加载
  17711. //原先是labels, 改为showLabels,因为之前的somedata写的labels都是true
  17712. window.DATA.showingLabels ? this.showingLabels = true : '';
  17713. if (!this.showingLabels)
  17714. return e.resolve();
  17715. // var t = this.options.urlBase + "/api/v1/jsonstore/model/labels/" + this.sid;
  17716. var t = g_Prefix + "data/" + this.sid + "/labels.json";
  17717. return this.labels.load(t, !this.isPublic).done(e.resolve.bind(e)).fail(function() {
  17718. O.warn("Getting labels failed, not displaying labels."),
  17719. e.resolve()
  17720. }),
  17721. e
  17722. }
  17723. ,
  17724. n.prototype.buildRooms = function() {
  17725. this.rooms = new T(this),
  17726. this.rooms.createFromChunks(this.chunks),
  17727. this.rooms.calcRoomBoundaries()
  17728. }
  17729. ,
  17730. n.prototype.updateProjectedPanos = function() {
  17731. this.projectedPano0 && this.projectedPano1 && this.setProjectedPanos(this.projectedPano0, this.projectedPano1, !1)
  17732. }
  17733. ,
  17734. n.prototype.setProjectedPanos = function(e, t, i) {
  17735. void 0 !== i && null !== i || (i = !0),
  17736. i = !!i,
  17737. this.projectedPano0 = e,
  17738. this.projectedPano1 = t,
  17739. this.skybox.material.setProjectedPanos(e, t, i),
  17740. this.chunks.forEach(function(n) {
  17741. n.materialInside.setProjectedPanos(e, t, i)
  17742. })
  17743. }
  17744. ,
  17745. n.prototype.setSide = function(e) {
  17746. this.floors.forEach(function(t) {
  17747. t.collider.material.side = e
  17748. })
  17749. }
  17750. ,
  17751. n.prototype.heroCount = function() {
  17752. return this.heroLocations ? this.heroLocations.length : 0
  17753. }
  17754. ,
  17755. n.prototype.getHeroDescriptorByIndex = function(e=[]) {//改 因增加了二级目录
  17756. if (e[0] < 0)
  17757. return O.warn("Model.getHeroDescriptorByHeroIndex() -> heroIndex is less than 0."),
  17758. null;
  17759. if (this.heroCount() < 1)
  17760. return O.warn("Model.getHeroDescriptorByIndex() -> No hero locations in this model"),
  17761. null;
  17762. var t = this.heroLocations[e[0]];
  17763. if(t.heroLocations && e[1]!=void 0){
  17764. t = t.heroLocations[e[1]];
  17765. }
  17766. return void 0 === t ? (O.warn("Model.getHeroDescriptorByIndex() -> Index " + e + " is not a validindex"),
  17767. null) : t
  17768. }
  17769. ,
  17770. n.prototype.findPanoramicHero = function() {
  17771. for (var e in this.heroLocations)
  17772. if (this.heroLocations[e].cameraMode === c.PANORAMA)
  17773. return this.heroLocations[e];
  17774. return null
  17775. }
  17776. ,
  17777. n.prototype.listImagePanos = function() {
  17778. var e = []
  17779. , t = this;
  17780. return this.images.forEach(function(i) {
  17781. if (i.metadata && i.metadata.scan_id) {
  17782. var n = t.panos.get(i.metadata.scan_id);
  17783. n && (t.supportsTiles || n.isLoaded("high") || e.push(n))
  17784. }
  17785. }),
  17786. e
  17787. }
  17788. ,
  17789. n.prototype.fadePanoMarkers = function(e, t) {
  17790. this.panos.fadeMarkerOpacity(e, t)
  17791. }
  17792. ,
  17793. n.prototype.setSweepVisibility = function(e) {
  17794. this.panos.forEach(function(t) {
  17795. t.marker && (t.marker.visible = e)
  17796. })
  17797. }
  17798. ,
  17799. n.prototype.outsideAllowed = function() {
  17800. return this.supportedModes[c.DOLLHOUSE] && this.supportedModes[c.FLOORPLAN]
  17801. }
  17802. ,
  17803. t.exports = n
  17804. }
  17805. ).call(this, "/js/model/Model.js")
  17806. }
  17807. , {
  17808. "../constants": 8,
  17809. "../enum/AlignmentType": 17,
  17810. "../enum/RenderOrder": 42,
  17811. "../enum/Viewmode": 51,
  17812. "../exception/BasicException": 55,
  17813. "../label/Label": 90,
  17814. "../loaders/ModelLoader": 105,
  17815. "../loaders/ModelTextureLoader": 106,
  17816. "../loaders/SweepDataLoader": 107,
  17817. "../tag/tag": 123,
  17818. "../tag/tagManager": 124,
  17819. "../objects/BoundingTextureSkybox": 143,
  17820. "../objects/Chunk": 144,
  17821. "../objects/Floor": 146,
  17822. "../objects/Panorama": 148,
  17823. "../objects/Room": 150,
  17824. "../objects/Snapshot": 153,
  17825. "../settings": 166,
  17826. "../shaders": 167,
  17827. "../util/ModelUrls": 177,
  17828. "../util/PanoramaCollection": 178,
  17829. "../util/ajax": 181,
  17830. "../util/common": 185,
  17831. "../util/easing": 186,
  17832. "../util/lerp": 188,
  17833. "../util/logger": 189,
  17834. "../util/math": 190,
  17835. "../util/texture": 194,
  17836. "../util/transitions": 195,
  17837. "./../util/browser": 182,
  17838. "./../util/showcase": 193,
  17839. "./Chunks": 135,
  17840. "./FloorCollection": 136,
  17841. "./ImageCollection": 137,
  17842. "./LabelCollection": 138,
  17843. "./RoomCollection": 141,
  17844. events: 202,
  17845. three: 217,
  17846. "hot": "hot"
  17847. }],
  17848. 140: [function(e, t, i) {
  17849. "use strict";
  17850. function n() {
  17851. this.modelMap = {},
  17852. this.activeModel = null,
  17853. this.modelCount = 0,
  17854. this.tileDownloader = null,
  17855. this.panoRenderer = null
  17856. }
  17857. var r = (e("three"),
  17858. e("../util/common"))
  17859. , o = e("../exception/BasicException")
  17860. , a = e("../enum/ModelManagerEvents")
  17861. , s = e("../enum/PanoRendererEvents")
  17862. , l = e("events").EventEmitter;
  17863. n.prototype.init = function(e, t, i) {
  17864. this.tileDownloader = e,
  17865. this.panoRenderer = t,
  17866. this.qualityManager = i,
  17867. this.bindEvents()
  17868. }
  17869. ,
  17870. n.prototype.bindEvents = function() {
  17871. this.panoRenderer.on(s.TileRenderSuccess, this.onTileRendered.bind(this))
  17872. }
  17873. ,
  17874. n.prototype.onTileRendered = function(e, t, i, n) {}
  17875. ,
  17876. n.prototype.addModel = function(e) {
  17877. this.modelMap[e.sid] = e,
  17878. 0 === this.modelCount && this.activateModel(e.sid),
  17879. this.modelCount++,
  17880. this.emit(a.ModelAdded)
  17881. }
  17882. ,
  17883. n.prototype.getModel = function(e) {
  17884. return this.modelMap[e]
  17885. }
  17886. ,
  17887. n.prototype.activateModel = function(e) {
  17888. var t = this.modelMap[e];
  17889. if (!t)
  17890. throw new o("Tried to activate invalid model!");
  17891. var i = this.activeModel;
  17892. this.activeModel = t,
  17893. this.tileDownloader.setPanoData(t.panos, t.listImagePanos(), t.sid),
  17894. this.tileDownloader.setUrls(t.urls),
  17895. t.panos.forEach(function(e) {
  17896. e.attachToPanoRenderer(this.panoRenderer),
  17897. e.tileDownloader = this.tileDownloader,
  17898. e.qualityManager = this.qualityManager
  17899. }
  17900. .bind(this)),
  17901. this.emit(a.ActiveModelChanged, {
  17902. oldModel: i,
  17903. model: t
  17904. })
  17905. }
  17906. ,
  17907. n.prototype.getActiveModel = function() {
  17908. return this.activeModel
  17909. }
  17910. ,
  17911. r.extend(n, l),
  17912. t.exports = n
  17913. }
  17914. , {
  17915. "../enum/ModelManagerEvents": 33,
  17916. "../enum/PanoRendererEvents": 35,
  17917. "../exception/BasicException": 55,
  17918. "../util/common": 185,
  17919. events: 202,
  17920. three: 217
  17921. }],
  17922. 141: [function(e, t, i) {
  17923. (function(i) {
  17924. "use strict";
  17925. function n() {
  17926. s.call(this)
  17927. }
  17928. var r = e("../objects/Room")
  17929. , o = (e("../settings"),
  17930. e("../util/logger"))
  17931. , a = (e("../util/transitions"),
  17932. e("../util/easing"),
  17933. e("../util/common"))
  17934. , s = e("../util/IndexedCollection")
  17935. , l = e("./Chunks");
  17936. new o(i);
  17937. a.inherit(n, s),
  17938. n.prototype.getIndex = function(e) {
  17939. return e.roomId
  17940. }
  17941. ,
  17942. n.prototype.calcRoomBoundaries = function() {
  17943. this.forEach(function(e) {
  17944. e.calcBoundaries()
  17945. })
  17946. }
  17947. ,
  17948. n.prototype.createFromChunks = function(e) {
  17949. var t = {
  17950. floorId: -1,
  17951. roomId: -1
  17952. }
  17953. , i = {};
  17954. e.forEach(function(e) {
  17955. l.parseIdsFromChunkName(e.name, t);
  17956. var o = i[t.roomId];
  17957. if (!o) {
  17958. var a = n.generateRoomId(t.floorId, t.roomId);
  17959. o = new r(t.floorId,a),
  17960. this.add(o),
  17961. i[t.roomId] = o
  17962. }
  17963. o.addChunk(e)
  17964. }
  17965. .bind(this)),
  17966. this.calcRoomBoundaries()
  17967. }
  17968. ,
  17969. n.generateRoomId = function(e, t) {
  17970. return e + "_" + t
  17971. }
  17972. ,
  17973. t.exports = n
  17974. }
  17975. ).call(this, "/js/model/RoomCollection.js")
  17976. }
  17977. , {
  17978. "../objects/Room": 150,
  17979. "../settings": 166,
  17980. "../util/IndexedCollection": 175,
  17981. "../util/common": 185,
  17982. "../util/easing": 186,
  17983. "../util/logger": 189,
  17984. "../util/transitions": 195,
  17985. "./Chunks": 135
  17986. }],
  17987. 142: [function(e, t, i) {
  17988. "use strict";
  17989. function n(e, t, i) {
  17990. e = e.clone().expandByScalar(0.01);//改
  17991. var n = e.size()
  17992. , o = new r.BoxGeometry(n.x,n.y,n.z);
  17993. o.boundingBox = e,
  17994. r.Mesh.call(this, o, t),
  17995. this.position.copy(e.center()),
  17996. this.frustumCulled = !1,
  17997. i && this.add(new r.WireframeHelper(this))
  17998. }
  17999. var r = e("three");
  18000. n.prototype = Object.create(r.Mesh.prototype),
  18001. n.prototype.constructor = n,
  18002. t.exports = n
  18003. }
  18004. , {
  18005. three: 217
  18006. }],
  18007. 143: [function(e, t, i) {
  18008. (function(i) {
  18009. "use strict";
  18010. function n(e) {
  18011. h.time("Computing a nice bounding cubemap");
  18012. var t = new a({
  18013. side: r.BackSide,
  18014. transparent: !0
  18015. });
  18016. t.uniforms.modelAlpha.value = 0,
  18017. t.uniforms.opacity.value = 1 - s.modelAlpha,
  18018. this.renderOrder = l.boundingSkybox,
  18019. o.call(this, e, t),
  18020. h.timeEnd("Computing a nice bounding cubemap")
  18021. }
  18022. var r = e("three")
  18023. , o = (e("../enum/Viewmode"),
  18024. e("../shaders"),
  18025. e("./BoundingMesh"))
  18026. , a = e("../materials/ModelTextureMaterial")
  18027. , s = e("../settings")
  18028. , l = e("../enum/RenderOrder")
  18029. , c = e("../util/logger")
  18030. , h = new c(i);
  18031. n.prototype = Object.create(o.prototype),
  18032. n.prototype.constructor = n,
  18033. t.exports = n
  18034. }
  18035. ).call(this, "/js/objects/BoundingTextureSkybox.js")
  18036. }
  18037. , {
  18038. "../enum/RenderOrder": 42,
  18039. "../enum/Viewmode": 51,
  18040. "../materials/ModelTextureMaterial": 118,
  18041. "../settings": 166,
  18042. "../shaders": 167,
  18043. "../util/logger": 189,
  18044. "./BoundingMesh": 142,
  18045. three: 217
  18046. }],
  18047. 144: [function(e, t, i) {
  18048. "use strict";
  18049. function n(e) {
  18050. this.materialInside = new s({
  18051. side: r.DoubleSide
  18052. });
  18053. var t = r.UniformsUtils.clone(o.modelOutside.uniforms);
  18054. this.materialOutside = new r.RawShaderMaterial({
  18055. fragmentShader: o.modelOutside.fragmentShader,
  18056. vertexShader: o.modelOutside.vertexShader,
  18057. uniforms: t,
  18058. side: r.FrontSide,
  18059. name: "chunkOut"
  18060. }),
  18061. r.Mesh.call(this, e.geometry, this.materialInside),
  18062. this.name = e.name || "",
  18063. this.textureName = e.textureName,
  18064. this.meshUrl = e.meshUrl
  18065. }
  18066. var r = e("three")
  18067. , o = e("../shaders")
  18068. , a = e("../enum/Viewmode")
  18069. , s = e("../materials/ModelTextureMaterial");
  18070. n.prototype = Object.create(r.Mesh.prototype),
  18071. n.prototype.setTextureMap = function(e) {
  18072. this.materialInside.uniforms.map.value = e,
  18073. this.materialOutside.uniforms.map.value = e
  18074. }
  18075. ,
  18076. n.prototype.setMode = function(e) {
  18077. var t = e === a.DOLLHOUSE || e === a.FLOORPLAN ? this.materialOutside : this.materialInside;
  18078. t.side = e === a.PANORAMA ? r.DoubleSide : r.FrontSide,
  18079. t.transparent = this.material.transparent,
  18080. t.uniforms.opacity.value = this.material.uniforms.opacity.value,
  18081. this.material = t
  18082. }
  18083. ,
  18084. t.exports = n
  18085. }
  18086. , {
  18087. "../enum/Viewmode": 51,
  18088. "../materials/ModelTextureMaterial": 118,
  18089. "../shaders": 167,
  18090. three: 217
  18091. }],
  18092. 145: [function(e, t, i) {
  18093. "use strict";
  18094. function n(e) {
  18095. this.chunksize = e || 10,
  18096. this.chunks = {},
  18097. this.boundingBoxes = {},
  18098. this.children = [],
  18099. this.offset = new r.Vector3(0,.5,0),
  18100. this.material = new r.MeshBasicMaterial({
  18101. color: 16777215 * Math.random(),
  18102. side: r.DoubleSide
  18103. })
  18104. }
  18105. var r = e("three");
  18106. e("../enum/Viewmode");
  18107. n.prototype.add = function(e) {
  18108. var t, i, n, o, a, s, l, c, h, u, d, p, f, g, m = e.attributes;
  18109. m ? (t = m.position.array,
  18110. i = void 0 !== e.index ? e.index.array : void 0) : (t = e.vertices,
  18111. n = e.faces);
  18112. var v = new r.Vector3;
  18113. if (i)
  18114. for (o = 0,
  18115. a = i.length; o < a; o += 3) {
  18116. var A = 3 * i[o]
  18117. , y = 3 * i[o + 1]
  18118. , C = 3 * i[o + 2];
  18119. s = (t[A] + t[y] + t[C]) / 3,
  18120. l = (t[A + 1] + t[y + 1] + t[C + 1]) / 3,
  18121. c = (t[A + 2] + t[y + 2] + t[C + 2]) / 3,
  18122. h = Math.floor(s / this.chunksize),
  18123. u = Math.floor(l / this.chunksize),
  18124. d = Math.floor(c / this.chunksize),
  18125. p = h + "." + u + "." + d,
  18126. p in this.chunks ? (g = this.chunks[p],
  18127. f = this.boundingBoxes[p]) : (g = this.chunks[p] = [],
  18128. f = this.boundingBoxes[p] = new r.Box3),
  18129. 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]),
  18130. f.expandByPoint(v.set(t[A], t[A + 1], t[A + 2])),
  18131. f.expandByPoint(v.set(t[y], t[y + 1], t[y + 2])),
  18132. f.expandByPoint(v.set(t[C], t[C + 1], t[C + 2]))
  18133. }
  18134. else
  18135. for (o = 0,
  18136. a = t.length; o < a; o += 9)
  18137. s = (t[o] + t[o + 3] + t[o + 6]) / 3,
  18138. l = (t[o + 1] + t[o + 4] + t[o + 7]) / 3,
  18139. c = (t[o + 2] + t[o + 5] + t[o + 8]) / 3,
  18140. h = Math.floor(s / this.chunksize),
  18141. u = Math.floor(l / this.chunksize),
  18142. d = Math.floor(c / this.chunksize),
  18143. p = h + "." + u + "." + d,
  18144. p in this.chunks ? (g = this.chunks[p],
  18145. f = this.boundingBoxes[p]) : (g = this.chunks[p] = [],
  18146. f = this.boundingBoxes[p] = new r.Box3),
  18147. 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]),
  18148. f.expandByPoint(v.set(t[o], t[o + 1], t[o + 2])),
  18149. f.expandByPoint(v.set(t[o + 3], t[o + 4], t[o + 5])),
  18150. f.expandByPoint(v.set(t[o + 6], t[o + 7], t[o + 8]))
  18151. }
  18152. ,
  18153. n.prototype.build = function() {
  18154. var e = new r.Object3D;
  18155. e.material = this.material;
  18156. for (var t in this.chunks) {
  18157. var i = this.chunks[t]
  18158. , n = new r.BufferGeometry;
  18159. n.addAttribute("position", new r.BufferAttribute(new Float32Array(i),3)),
  18160. n.boundingBox = this.boundingBoxes[t];
  18161. var o = new r.Mesh(n,this.material);
  18162. o.material.visible = !1,
  18163. e.add(o),
  18164. this.chunks[t] = []
  18165. }
  18166. return e
  18167. }
  18168. ,
  18169. t.exports = n
  18170. }
  18171. , {
  18172. "../enum/Viewmode": 51,
  18173. three: 217
  18174. }],
  18175. 146: [function(e, t, i) {
  18176. "use strict";
  18177. var r = e("three")
  18178. , o = e("../settings")
  18179. , a = e("../util/common")
  18180. , s = e("../util/lerp")
  18181. , l = e("./ChunkedCollider")
  18182. , c = e("../util/transitions")
  18183. , h = e("../util/easing")
  18184. , u = (e("../objects/Panorama"),
  18185. e("../enum/RenderOrder"))
  18186. , d = e("../localization/localize");
  18187. function n(e, t, i) {
  18188. r.Object3D.call(this),
  18189. this.model = e,
  18190. this.floorIndex = t,
  18191. this.lang = o.languageTag,
  18192. this.name = i || o.languageTag === "cn" ? "Floor " + (t + 1) + "" : "第" + (t + 1) + "层",
  18193. this.panos = [],
  18194. this.chunks = [],
  18195. this.colliderBuilder = new l(3),
  18196. this.collider = null,
  18197. this.center = null,
  18198. this.boundingBox = new r.Box3,
  18199. this.size = null,
  18200. this.hidden = !1,
  18201. this.conservativeBoundingBox = new r.Box3,
  18202. this.debugColor = 16777215 * Math.random(),
  18203. this.transition = null
  18204. }
  18205. n.prototype = Object.create(r.Object3D.prototype),
  18206. n.prototype.enter = function(e) {
  18207. this.model.setFloor(this, e)
  18208. }
  18209. ,
  18210. n.prototype.hide = function(e) {
  18211. if (!this.hidden || this.transition) {
  18212. this.chunks.forEach(function(e) {
  18213. e.material.transparent = !0
  18214. }),
  18215. c.cancel(this.transition);
  18216. var t = e ? 0 : o.hideFloorDuration + o.hideFloorDelay
  18217. , i = e ? 0 : o.hideFloorDelay / t;
  18218. this.transition = c.start(s.allUniforms(this.chunks, "opacity", .08), t, function() {
  18219. this.hidden = !0
  18220. }
  18221. .bind(this), i, h.easeInOutQuad)
  18222. }
  18223. }
  18224. ,
  18225. n.prototype.show = function(e) {
  18226. if (this.hidden || this.transition) {
  18227. this.hidden = !1,
  18228. c.cancel(this.transition);
  18229. var t = e ? o.showFloorDuration : o.showFloorDuration + o.showFloorDelay
  18230. , i = e ? 0 : o.showFloorDelay / t;
  18231. this.transition = c.start(s.allUniforms(this.chunks, "opacity", 1), t, function() {
  18232. this.hidden || this.chunks.forEach(function(e) {
  18233. e.material.transparent = !1
  18234. })
  18235. }
  18236. .bind(this), i, h.easeInOutQuad)
  18237. }
  18238. }
  18239. ,
  18240. n.prototype.toggle = function(e, t) {
  18241. e = void 0 === e ? this.hidden : e,
  18242. e ? this.show(t) : this.hide(t)
  18243. }
  18244. ,
  18245. n.prototype.containsPoint = function(e) {
  18246. return this.collider.children.some(function(t) {
  18247. return t.geometry.boundingBox || t.geometry.computeBoundingBox(),
  18248. t.geometry.boundingBox.containsPoint(e)
  18249. })
  18250. }
  18251. ,
  18252. n.prototype.distanceToPoint = function(e) {
  18253. var t = null
  18254. , i = 1 / 0;
  18255. return this.collider.children.forEach(function(n) {
  18256. n.geometry.boundingBox || n.geometry.computeBoundingBox();
  18257. var r = n.geometry.boundingBox.distanceToPoint(e);
  18258. (!t || i > r) && (i = r,
  18259. t = n)
  18260. }),
  18261. i
  18262. }
  18263. ,
  18264. n.prototype.addChunk = function(e) {
  18265. e.renderOrder = u.ghostFloor,
  18266. this.add(e),
  18267. this.chunks.push(e),
  18268. this.boundingBox.union(e.geometry.boundingBox),
  18269. this.size = this.boundingBox.size(),
  18270. this.colliderBuilder.add(e.geometry)
  18271. }
  18272. ,
  18273. n.prototype.addPano = function(e) {
  18274. this.panos.push(e),
  18275. this.add(e.skyboxMesh),
  18276. e.marker && this.add(e.marker);
  18277. if(e.neighbourUUIDs && e.neighbourUUIDs.length){//add 有相邻点才算入bound 因为拍摄有bug,会出现floorPosition为000,且position位置很偏的点,它们一般都是不可见点。
  18278. var t = new r.Vector3(1,1,1)
  18279. , i = (new r.Box3).setFromCenterAndSize(e.position, t);
  18280. this.boundingBox.union(i)
  18281. }
  18282. }
  18283. ,
  18284. n.prototype.build = function() {
  18285. this.collider = this.colliderBuilder.build(!0),
  18286. this.add(this.collider),
  18287. this.center = this.boundingBox.center(),
  18288. this.conservativeBoundingBox.copy(this.boundingBox),
  18289. this.conservativeBoundingBox.min.y = a.lowerMedian(this.collider.children.map(function(e) {
  18290. return e.geometry.boundingBox.min.y
  18291. }), 5),
  18292. this.conservativeBoundingBox.max.y = a.lowerMedian(this.collider.children.map(function(e) {
  18293. return e.geometry.boundingBox.max.y
  18294. }), 5),
  18295. this.colliderBuilder = null
  18296. }
  18297. ,
  18298. n.prototype.toShortString = function() {
  18299. return a.nth(this.floorIndex + 1)
  18300. }
  18301. ,
  18302. n.prototype.toString = function() {
  18303. return this.name
  18304. }
  18305. ,
  18306. t.exports = n
  18307. }
  18308. , {
  18309. "../enum/RenderOrder": 42,
  18310. "../localization/localize": 108,
  18311. "./strings-cn-CN": 109,
  18312. "../objects/Panorama": 148,
  18313. "../settings": 166,
  18314. "../util/common": 185,
  18315. "../util/easing": 186,
  18316. "../util/lerp": 188,
  18317. "../util/transitions": 195,
  18318. "./ChunkedCollider": 145,
  18319. three: 217
  18320. }],
  18321. 147: [function(e, t, i) {
  18322. "use strict";
  18323. function n(e) {
  18324. this.player = e,
  18325. this.obj3d = null,
  18326. this.UP = new r.Vector3(0,1,0)
  18327. }
  18328. var r = e("three")
  18329. , o = e("../settings");
  18330. n.prototype.prefs = {
  18331. linewidth: 3,
  18332. height: .07,
  18333. opacity: .45,
  18334. endScale: .05
  18335. },
  18336. n.prototype.discard = function() {
  18337. if (this.obj3d) {
  18338. var e = this.obj3d.parent;
  18339. e && e.remove(this.obj3d)
  18340. }
  18341. this.obj3d = null
  18342. }
  18343. ,
  18344. n.prototype.draw = function() {
  18345. if (this.discard(),
  18346. o.showNeighbors) {
  18347. var e = this.player.currentPano.floor;
  18348. this.obj3d = new r.Object3D;
  18349. var t = this.player.model.panos.getNeighbours(this.player.currentPano)
  18350. , i = this.player.currentPano.floorPosition.clone().sub(this.player.model.position);
  18351. i.y += this.prefs.height;
  18352. var n = .1525
  18353. , a = .127
  18354. , s = .0127
  18355. , l = .1
  18356. , c = .19
  18357. , h = .2032
  18358. , u = .2286
  18359. , d = .255
  18360. , p = new r.Matrix4;
  18361. for (var f in t)
  18362. if (t[f]) {
  18363. var g = this.player.model.panos.get(f)
  18364. , m = (g.position.clone().sub(this.player.model.position),
  18365. g.position.clone().sub(g.floorPosition))
  18366. , v = g.floorPosition.clone().sub(this.player.model.position);
  18367. v.y += this.prefs.height;
  18368. var A = new r.Geometry;
  18369. 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)),
  18370. 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)),
  18371. p.identity().setPosition(m),
  18372. A.applyMatrix(p),
  18373. A.vertices.push(new r.Vector3(0,-this.prefs.endScale,0)),
  18374. 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)),
  18375. p.lookAt(v, i, this.UP).setPosition(v),
  18376. A.applyMatrix(p),
  18377. A.vertices.push(v, i);
  18378. var y = new r.Line(A,new r.LineBasicMaterial({
  18379. color: g.debugColor.getHex(),
  18380. transparent: !0,
  18381. opacity: this.prefs.opacity,
  18382. depthWrite: !1,
  18383. name: "sLine" + f,
  18384. linewidth: this.prefs.linewidth
  18385. }));
  18386. this.obj3d.add(y)
  18387. }
  18388. e.add(this.obj3d)
  18389. }
  18390. }
  18391. ,
  18392. n.prototype.update = function() {
  18393. o.showNeighbors && this.obj3d && this.obj3d.updateMatrixWorld()
  18394. }
  18395. ,
  18396. t.exports = n
  18397. }
  18398. , {
  18399. "../settings": 166,
  18400. three: 217
  18401. }],
  18402. 148: [function(e, t, i) {
  18403. (function(i) {
  18404. "use strict";
  18405. function n(e, t, i, n) {
  18406. this.model = e,
  18407. this.id = t,
  18408. this.alignmentType = i.alignmentType || l.ALIGNED,
  18409. this.neighbourUUIDs = i.neighbours || null,
  18410. this.neighbourPanos = null,
  18411. this.floor = null,
  18412. this.floorIndex = i.floor,
  18413. this.failedLoadingAt = 0,
  18414. this.maxLoadRetries = 4,
  18415. this.origin = i.position.clone(),
  18416. this.position = this.alignmentType === l.UNALIGNED ? new r.Vector3(0,-5,0) : i.position.clone(),
  18417. this.quaternion = i.quaternion.clone(),
  18418. this.skyboxMesh = new r.Mesh(E),
  18419. this.skyboxMesh.position.copy(this.position),
  18420. this.skyboxMesh.quaternion.copy(this.quaternion),
  18421. this.skyboxMesh.name = "skybox",
  18422. this.skyboxMesh.visible = !1,
  18423. this.skyboxMesh.updateMatrix(),
  18424. this.skyboxMesh.updateMatrixWorld(),
  18425. this.marker = null,
  18426. this.showFloorMarker = !window.DATA.hideFloorMarker;
  18427. this.isAligned() && (this.marker = new r.Mesh(b,new r.MeshBasicMaterial({
  18428. map: w,
  18429. side: r.DoubleSide,
  18430. opacity: 0,
  18431. transparent: !0,
  18432. depthWrite: !1
  18433. })),
  18434. this.marker.visible = this.showFloorMarker,
  18435. this.marker.renderOrder = s.panoMarker,
  18436. this.marker.name = "marker",
  18437. this.marker.pano = this,
  18438. this.marker.layers.set(v.PANOMARKERS),
  18439. this.marker.updateMatrixWorld(),
  18440. a.colorMarkerOnLoad && this.on("load", function() {
  18441. this.marker.material.color.set(65280)
  18442. })),
  18443. this.debugColor = (new r.Color).setHSL(.06 + .53 * Math.random(), .8 + .2 * Math.random(), .5 + .2 * Math.random()),
  18444. this.floorPosition = i.puck ? i.puck.clone() : null,
  18445. this.tiled = n,
  18446. this.tiled ? this.solidSkybox = null : (this.solidSkybox = new r.Texture([null, null, null, null, null, null]),
  18447. this.solidSkybox.flipY = !1,
  18448. a.minimalMemoryMode && (this.solidSkybox.minFilter = r.LinearFilter,
  18449. this.solidSkybox.magFilter = r.LinearFilter,
  18450. this.solidSkybox.generateMipmaps = !1)),
  18451. this.zoomed = !1,
  18452. this.panoRenderer = null,
  18453. this.qualityManager = null,
  18454. this.tileDownloader = null,
  18455. this.tiledPanoRenderTarget = null,
  18456. this.minimumTiledPanoLoaded = !1,
  18457. this.highestPartialTileRenderOpCompleted = 0,
  18458. this.highestFullTileRenderOpCompleted = 0,
  18459. this.shouldRedrawOnBaseLoaded = !1,
  18460. this.lockUntilRenderingComplete = !1,
  18461. a.colorMarkerOnLoad && this.on("load", function() {
  18462. this.marker.material.color.set(65280)
  18463. });
  18464. /********************************************************************fyz改vr from徐世廷*************************************************************/
  18465. var e = new r.TextureLoader;
  18466. e.setCrossOrigin(!0);
  18467. var g = e.load("images/texture.jpg");
  18468. if (this.vrMarker = new r.Mesh(new r.OctahedronGeometry(.1,0),new r.MeshLambertMaterial({
  18469. color: 16777215,
  18470. transparent: !0,
  18471. opacity: .75,
  18472. map: g
  18473. })),
  18474. this.vrMarker.boluoType = "vr",
  18475. this.vrMarker.position.z = 1,
  18476. this.vrMarker.enabled = !0,
  18477. this.vrMarker.visible = !1,
  18478. window.vrMarkers = window.vrMarkers || [],
  18479. window.vrMarkers.push(this.vrMarker),
  18480. this.marker && this.marker.add(this.vrMarker),
  18481. a.showAxis && (this.skyboxMesh.add(new r.ArrowHelper(new r.Vector3(0,1,0),new r.Vector3(0,0,0),1,255)),
  18482. this.skyboxMesh.add(new r.ArrowHelper(new r.Vector3(0,0,1),new r.Vector3(0,0,0),1,16711680)),
  18483. this.skyboxMesh.add(new r.ArrowHelper(new r.Vector3(1,0,0),new r.Vector3(0,0,0),1,65280))),
  18484. this.adjustAngleEnable) {
  18485. var i = new r.Quaternion;
  18486. i.setFromAxisAngle(new r.Vector3(1,0,0), this.adjustAngleX),
  18487. this.skyboxMesh.quaternion.multiply(i);
  18488. var m = new r.Quaternion;
  18489. m.setFromAxisAngle(new r.Vector3(0,1,0), this.adjustAngleY),
  18490. this.skyboxMesh.quaternion.multiply(m);
  18491. var n = new r.Quaternion;
  18492. n.setFromAxisAngle(new r.Vector3(0,0,1), this.adjustAngleZ),
  18493. this.skyboxMesh.quaternion.multiply(n),
  18494. this.skyboxMesh.updateMatrix(),
  18495. this.skyboxMesh.updateMatrixWorld(),
  18496. this.model.updateProjectedPanos()
  18497. }
  18498. /**************************************************************************************************************************************/
  18499. }
  18500. var r = e("three")
  18501. , o = e("../util/logger")
  18502. , a = e("../settings")
  18503. , s = (e("../enum/Viewmode"),
  18504. e("../enum/RenderOrder"))
  18505. , l = e("../enum/AlignmentType")
  18506. , c = (e("../util/common"),
  18507. e("../util/transitions"))
  18508. , h = e("../util/lerp")
  18509. , u = e("../util/ajax")
  18510. , d = e("../util/texture")
  18511. , p = e("../util/panorama")
  18512. , f = (e("../enum/TileDownloaderEvents"),
  18513. e("../enum/PanoramaEvents"))
  18514. , g = e("../enum/PanoRendererEvents")
  18515. , m = e("../enum/PanoSizeClass")
  18516. , v = e("../enum/RenderLayers")
  18517. , A = (e("../scene/SceneRenderer"),
  18518. e("../enum/GLCubeFaces"),
  18519. e("../exception/BasicException"))
  18520. , y = e("../tile/TileUtils")
  18521. , C = e("events").EventEmitter
  18522. , I = new o(i)
  18523. , E = new r.SphereBufferGeometry(.1)
  18524. , b = new r.PlaneBufferGeometry(.4,.4,1,1)
  18525. , w = d.load("images/marker-256x256.png");
  18526. n.prototype = Object.create(C.prototype),
  18527. n.prototype.enter = function() {
  18528. var e = null;
  18529. return function() {
  18530. this.setZoomed(!1),
  18531. this.emit("enter", {
  18532. oldPano: e,
  18533. newPano: this
  18534. }),
  18535. e = this
  18536. }
  18537. }(),
  18538. n.prototype.exit = function() {
  18539. this.tiled ? (this.clearWaitDeferreds(),
  18540. this.minimumTiledPanoLoaded = !1,
  18541. this.tiledPanoRenderTarget = null,
  18542. this.setZoomed(!1),
  18543. this.panoRenderer.deactivateTiledPano(this),
  18544. this.highestPartialTileRenderOpCompleted = 0,
  18545. this.highestFullTileRenderOpCompleted = 0) : (this.solidSkybox.dispose(),
  18546. this.solidSkybox.loaded = !1,
  18547. this.solidSkybox.version = 0),
  18548. this.emit("exit")
  18549. }
  18550. ,
  18551. n.prototype.hoverOn = function(e) {
  18552. this.marker && (c.start(h.property(this.marker.material, "opacity", a[e].markerOpacityOnHover), 250),
  18553. a.navigation.panoScores & a.navigation.mouseDirection && this.addTextSprite("HIT", 12525854))
  18554. }
  18555. ,
  18556. n.prototype.hoverOff = function(e) {
  18557. this.marker && c.start(h.property(this.marker.material, "opacity", a[e].markerOpacity), 250)
  18558. }
  18559. ,
  18560. n.prototype.build1 = function() {
  18561. this.floor = this.floor || this.model.floors.get(this.floorIndex) || (this.model.floors.list.length == 1 ? this.model.floors.list[0] : this.raycastToFindFloor()) || this.model.getFloorAtPoint(this.position),
  18562. this.floor.addPano(this),
  18563. this.floorPosition = this.floorPosition || this.raycastFloorPosition(),
  18564. this.neighbourPanos = this.neighbourPanos || this.findNeighourPanos(),
  18565. a.colorMarkerByFloor && this.marker && this.marker.material.color.set(this.floor.debugColor)
  18566. }
  18567. ,
  18568. n.prototype.build2 = function() {
  18569. this.floorPosition = this.floorPosition || this.interpolateFloorPosition(),
  18570. this.height = this.position.distanceTo(this.floorPosition),
  18571. this.placeMarker()
  18572. }
  18573. ,
  18574. n.prototype.interpolateFloorPosition = function() {
  18575. var e = this.model.panos.filter(n.filters.isNeighbourPanoTo(this)).filter(function(e) {
  18576. return !!e.floorPosition
  18577. }).sort(function(e, t) {
  18578. return e.position.distanceTo(this.position) - t.position.distanceTo(this.position)
  18579. }
  18580. .bind(this))
  18581. , t = this.position.clone();
  18582. return e.length >= 2 ? t.y = (e[0].floorPosition.y + e[1].floorPosition.y) / 2 : t.add(a.noMeshFloorPositionOffset),
  18583. t
  18584. }
  18585. ,
  18586. n.prototype.raycastFloorPosition = function() {
  18587. I.warn("Performance warning: Raycasting to find floor position");
  18588. var e = new r.Raycaster(this.position,new r.Vector3(0,-1,0))
  18589. , t = e.intersectObjects(this.model.colliders);
  18590. return t.length ? t[0].point : null
  18591. }
  18592. ,
  18593. n.prototype.raycastToFindFloor = function() {
  18594. 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)];
  18595. return function() {
  18596. I.warn("Performance warning: Raycasting to find floor index");
  18597. for (var t = 0; t < e.length; t++) {
  18598. var i = new r.Raycaster(this.position.clone(),e[t].clone())
  18599. , n = i.intersectObjects(this.model.colliders);
  18600. if (n.length)
  18601. return n[0].object.parent.parent
  18602. }
  18603. return null
  18604. }
  18605. }(),
  18606. n.prototype.placeMarker = function() {
  18607. this.marker && (this.marker.position.copy(this.floorPosition),
  18608. this.marker.position.y += .05,
  18609. this.marker.lookAt(new r.Vector3(0,1,0).add(this.marker.position)))
  18610. }
  18611. ,
  18612. n.prototype.translate = function(e) {
  18613. this.position.add(e),
  18614. this.floorPosition.add(e)
  18615. }
  18616. ,
  18617. n.prototype.findClosestMidtpointPanoTo = function(e) {
  18618. (new r.Vector3).addVectors(this.position, e.position).divideScalar(2);
  18619. return this.model.panos.find([n.filters.notIn([this, e])], [n.sortFunctions.distanceToPoint(point)])
  18620. }
  18621. ,
  18622. n.prototype.attachToPanoRenderer = function(e) {
  18623. this.panoRenderer = e,
  18624. this.panoRenderer.on(g.TileRenderSuccess, this.onTileRendered.bind(this)),
  18625. this.panoRenderer.on(g.PanoRenderComplete, this.onPanoRendered.bind(this)),
  18626. this.panoRenderer.on(g.TileRenderFailure, this.onTileRenderFail.bind(this)),
  18627. this.panoRenderer.on(g.UploadAttemptedForAllTiles, this.onUploadAttemptedForAllTiles.bind(this))
  18628. }
  18629. ;
  18630. var _ = {};
  18631. n.prototype.getWaitDeferred = function(e) {
  18632. var t = _[this.id];
  18633. t || (t = {},
  18634. _[this.id] = t);
  18635. var i = t[e];
  18636. return i || (i = {
  18637. deferred: $.Deferred(),
  18638. active: !1
  18639. },
  18640. t[e] = i),
  18641. i
  18642. }
  18643. ,
  18644. n.prototype.resetWaitDeferred = function(e) {
  18645. var t = this.getWaitDeferred(e);
  18646. t.active = !1,
  18647. t.deferred = $.Deferred()
  18648. }
  18649. ,
  18650. n.prototype.clearWaitDeferreds = function() {
  18651. var e = _[this.id];
  18652. e || (e = {},
  18653. _[this.id] = e);
  18654. for (var t in e)
  18655. if (e.hasOwnProperty(t)) {
  18656. var i = e[t];
  18657. i.active = !1,
  18658. i.deferred = $.Deferred()
  18659. }
  18660. }
  18661. ,
  18662. n.prototype.loadTiledPano = function() {
  18663. var e = (new r.Vector3,
  18664. [])
  18665. , t = [];
  18666. return function(i, n, r, o, a, s) {
  18667. null !== o && void 0 !== o || (o = !0),
  18668. null !== a && void 0 !== a || (a = !0);
  18669. var l = this.getWaitDeferred(i)
  18670. , c = l.deferred
  18671. , h = null
  18672. , u = null;
  18673. if (r && ("number" == typeof r ? h = r : (h = r.hFov,
  18674. u = r.vFov)),
  18675. !this.isLoaded(i)) {
  18676. if (!l.active) {
  18677. if (l.active = !0,
  18678. r) {
  18679. var d = y.matchingTilesInDirection(this, i, n, h, u);
  18680. e[this.id + ":" + i] = {
  18681. tileCount: 0,
  18682. targetTileCount: d
  18683. },
  18684. I.info("Loading partial pano: " + this.id + " with " + d + " tiles")
  18685. }
  18686. t[this.id] || (t[this.id] = !0,
  18687. this.on(f.LoadComplete, function(e, t) {
  18688. var i = this.getWaitDeferred(e).deferred;
  18689. i && "pending" === i.state() && this.highestPartialTileRenderOpCompleted >= e && (i.resolve(e, t),
  18690. this.resetWaitDeferred(e))
  18691. }
  18692. .bind(this)),
  18693. this.on(f.LoadFailed, function(e) {
  18694. var t = this.getWaitDeferred(e).deferred;
  18695. t && "pending" === t.state() && this.highestPartialTileRenderOpCompleted >= e && (t.reject(e),
  18696. this.resetWaitDeferred(e))
  18697. }
  18698. .bind(this)),
  18699. this.on(f.TileLoaded, function(t, i, n) {
  18700. var r = this.getWaitDeferred(t).deferred;
  18701. if (r && "pending" === r.state()) {
  18702. r.notify(t, i, n);
  18703. var o = e[this.id + ":" + t];
  18704. o && (o.tileCount++,
  18705. o.tileCount === o.targetTileCount && (this.onPanoRendered(this.id, t, n, !0),
  18706. r.resolve(t, n),
  18707. this.resetWaitDeferred(t)))
  18708. }
  18709. }
  18710. .bind(this)))
  18711. }
  18712. this.tileDownloader.clearForceQueue(),
  18713. this.tileDownloader.forceQueueTilesForPano(this, i, n, h, u, s),
  18714. this.tiledPanoRenderTarget = this.panoRenderer.activateTiledPano(this, this.qualityManager.getMaxNavPanoSize(), o),
  18715. this.panoRenderer.renderPanoTiles(this.id, n, a)
  18716. }
  18717. return c.promise()
  18718. }
  18719. }(),
  18720. n.prototype.onUploadAttemptedForAllTiles = function(e, t, i) {
  18721. if (e === this.id) {
  18722. var n = this.qualityManager.getPanoSize(m.BASE);
  18723. t === n && this.shouldRedrawOnBaseLoaded && (this.shouldRedrawOnBaseLoaded = !1,
  18724. this.panoRenderer.resetRenderStatus(this.id, !0, !1),
  18725. this.panoRenderer.renderPanoTiles(this.id, null, !0, !0))
  18726. }
  18727. }
  18728. ,
  18729. n.prototype.onTileRendered = function(e, t, i, n) {
  18730. e === this.id && this.emit(f.TileLoaded, t, i, n)
  18731. }
  18732. ,
  18733. n.prototype.onPanoRendered = function(e, t, i, n) {
  18734. e === this.id && (this.minimumTiledPanoLoaded = !0,
  18735. this.updateSkyboxForZoomLevel(),
  18736. t > this.highestPartialTileRenderOpCompleted && (this.highestPartialTileRenderOpCompleted = t),
  18737. !n && t > this.highestFullTileRenderOpCompleted && (this.highestFullTileRenderOpCompleted = t),
  18738. this.emit("load", t),
  18739. this.model.emit("load", this),
  18740. this.emit(f.LoadComplete, t, i))
  18741. }
  18742. ,
  18743. n.prototype.setZoomed = function(e) {
  18744. this.zoomed = e,
  18745. this.updateSkyboxForZoomLevel()
  18746. }
  18747. ,
  18748. n.prototype.ensureSkyboxReadyForRender = function() {
  18749. this.tiled || (this.solidSkybox.loaded || (this.solidSkybox.needsUpdate = !0),
  18750. this.solidSkybox.loaded = !0)
  18751. }
  18752. ,
  18753. n.prototype.updateSkyboxForZoomLevel = function() {
  18754. this.minimumTiledPanoLoaded && this.model.updateProjectedPanos()
  18755. }
  18756. ,
  18757. n.prototype.getSkyboxTexture = function() {
  18758. return this.tiled ? this.minimumTiledPanoLoaded ? this.zoomed ? this.panoRenderer.zoomRenderTarget.texture : this.tiledPanoRenderTarget.texture : null : this.solidSkybox
  18759. }
  18760. ,
  18761. n.prototype.onTileRenderFail = function(e, t, i) {
  18762. e === this.id && this.emit(f.LoadFailed, t)
  18763. }
  18764. ,
  18765. n.prototype.isLoaded = function(e) {
  18766. if (this.tiled) {
  18767. if (e && "string" == typeof e)
  18768. throw new A("Wrong panoSize given to Panorama.isLoaded(); a tiled pano uses PanoSizeClass");
  18769. return !!this.minimumTiledPanoLoaded && (!e || this.highestPartialTileRenderOpCompleted >= e)
  18770. }
  18771. if (e && "number" == typeof e)
  18772. throw new A("Wrong panoSize given to Panorama.isLoaded(); a non-tiled pano uses high/low.");
  18773. return !!this.solidSkybox.high || e in this.solidSkybox
  18774. }
  18775. ,
  18776. n.prototype.loadCube = function(e) {
  18777. if (this.isLoaded(e))
  18778. return I.info("Skipping load of pano, already loaded"),
  18779. $.when();
  18780. this.emit("loading", e),
  18781. this.model.emit("loading", this);
  18782. var t = p.getCubemapUrls(this.model.urls, this.id, e)
  18783. , i = t.filter(function(e) {
  18784. return !e
  18785. });
  18786. "low" === e && i.length > 0 && (I.info("Pano", this.id, "not available in low res, loading high res right away"),
  18787. e = "high",
  18788. t = p.getCubemapUrls(this.model.urls, this.id, e));
  18789. var n = 0
  18790. , r = [0, 1, 2, 3, 4, 5].map(function(e, i, n) {
  18791. return u.getImage(t[i])
  18792. }
  18793. .bind(this));
  18794. return $.when(r[0], r[1], r[2], r[3], r[4], r[5]).then(function(t, i, n, r, o, a) {
  18795. return this.solidSkybox[e] = [t, i, n, r, o, a],
  18796. "high" !== e && this.solidSkybox.high || (this.solidSkybox.image = this.solidSkybox[e],
  18797. this.solidSkybox.low = null),
  18798. this.solidSkybox.needsUpdate = !0,
  18799. this.emit("load", e),
  18800. this.model.emit("load", this),
  18801. this
  18802. }
  18803. .bind(this), function() {
  18804. I.error("Downloading cubemap for pano", this.id, "failed"),
  18805. this.failedLoadingAt = Date.now()
  18806. }
  18807. .bind(this), function() {
  18808. return $.when(++n, 6)
  18809. })
  18810. }
  18811. ,
  18812. n.raycastsSkipped = 0,
  18813. n.raycastsDone = 0,
  18814. n.prototype.findNeighourPanos = function() {
  18815. return this.model.panos.setNeighbour(this.id, this.id, !1),
  18816. this.model.panos.forEach(function(e) {
  18817. if (e !== this && (!this.model.panos.neighbourMap[this.id] || void 0 === this.model.panos.neighbourMap[this.id][e.id])) {
  18818. var t = this.position.distanceTo(e.position);
  18819. if (t > a.panoramaNeighbourMaxDistance)
  18820. return this.model.panos.setNeighbour(this, e, !1),
  18821. void n.raycastsSkipped++;
  18822. var i = e.position.clone().sub(this.position).normalize()
  18823. , o = new r.Raycaster(this.position,i.clone(),0,t)
  18824. , s = o.intersectObjects(this.model.colliders);
  18825. n.raycastsDone++,
  18826. this.model.panos.setNeighbour(this, e, 0 === s.length),
  18827. 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)))
  18828. }
  18829. }
  18830. .bind(this)),
  18831. this.model.panos.neighbourMap[this.id]
  18832. }
  18833. ,
  18834. n.prototype.worldPosition = function() {
  18835. return this.position
  18836. }
  18837. ,
  18838. n.prototype.addTextSprite = function(e, t) {
  18839. this.removeTextSprite();
  18840. var i = document.createElement("canvas")
  18841. , n = i.getContext("2d");
  18842. i.width = 256,
  18843. i.height = 256;
  18844. var o = "Arial"
  18845. , a = 60;
  18846. n.font = "bold " + a + "px " + o,
  18847. n.fillStyle = "white";
  18848. var s = n.measureText(e).width;
  18849. n.fillText(e, (i.width - s) / 2, (i.height + a) / 2);
  18850. var l = new r.Texture(i);
  18851. l.needsUpdate = !0;
  18852. var c = new r.SpriteMaterial({
  18853. map: l,
  18854. color: t || 16428055
  18855. });
  18856. this.text3d = new r.Sprite(c),
  18857. this.text3d.position.copy(this.skyboxMesh.position),
  18858. this.floor.add(this.text3d)
  18859. }
  18860. ,
  18861. n.prototype.removeTextSprite = function() {
  18862. this.text3d && (this.floor.remove(this.text3d),
  18863. this.text3d = null)
  18864. }
  18865. ,
  18866. n.prototype.isAligned = function() {
  18867. return this.alignmentType === l.ALIGNED
  18868. }
  18869. ,
  18870. n.filters = {
  18871. inDirection: function(e, t, i) {
  18872. return function(n) {
  18873. var r = n.position.clone().sub(e).normalize();
  18874. return r.dot(t) > i
  18875. }
  18876. },
  18877. inFloorDirection: function(e, t, i) {
  18878. return function(n) {
  18879. var r = n.floorPosition.clone().sub(e).normalize();
  18880. return r.dot(t) > i
  18881. }
  18882. },
  18883. inPanoDirection: function(e, t, i) {
  18884. return i = a.navigation.panoScores ? a.navigation.filterStrictness : i,
  18885. function(n) {
  18886. var r = n.floorPosition.clone().sub(e).normalize()
  18887. , o = n.position.clone().sub(e).normalize();
  18888. return r.dot(t) > i || o.dot(t) > i
  18889. }
  18890. },
  18891. atFloor: function(e) {
  18892. return function(t) {
  18893. return !e || t.floor === e
  18894. }
  18895. },
  18896. not: function(e) {
  18897. return function(t) {
  18898. return t !== e
  18899. }
  18900. },
  18901. notIn: function(e) {
  18902. return function(t) {
  18903. return e.indexOf(t) === -1
  18904. }
  18905. },
  18906. isLoaded: function() {
  18907. return function(e) {
  18908. return e.isLoaded()
  18909. }
  18910. },
  18911. isNotLoaded: function() {
  18912. return function(e) {
  18913. return !e.isLoaded()
  18914. }
  18915. },
  18916. isCloseEnoughTo: function(e, t) {
  18917. return function(i) {
  18918. return e.distanceTo(i.floorPosition) < t
  18919. }
  18920. },
  18921. hasMinimumHeightDifferenceTo: function(e, t) {
  18922. return function(i) {
  18923. return Math.abs(i.position.y - e.y) > t
  18924. }
  18925. },
  18926. isNotBehindNormal: function(e, t) {
  18927. var i = new r.Vector3;
  18928. return t = t.clone(),
  18929. function(n) {
  18930. var r = i.copy(n.position).sub(e).normalize();
  18931. return r.dot(t) > 0
  18932. }
  18933. },
  18934. isNeighbourPanoTo: function(e) {
  18935. return function(t) {
  18936. return !e || !e.neighbourPanos || !!e.neighbourPanos[t.id]
  18937. }
  18938. },
  18939. isNeighbourOfNeighbourTo: function(e) {
  18940. return function(t) {
  18941. return !!e.neighbourPanos[t.id] || e.neighbourUUIDs.some(function(i) {
  18942. var n = e.model.panos.get(i);
  18943. return !!n && n.neighbourPanos[t.id]
  18944. })
  18945. }
  18946. },
  18947. isNotRecentlyFailed: function(e) {
  18948. return function(t) {
  18949. return Date.now() - t.failedLoadingAt > e
  18950. }
  18951. },
  18952. isOnVisibleFloor: function() {
  18953. return function(e) {
  18954. return !e.floor.hidden
  18955. }
  18956. },
  18957. isPanoAligned: function() {
  18958. return function(e) {
  18959. return e.isAligned()
  18960. }
  18961. }
  18962. },
  18963. n.sortFunctions = {
  18964. distanceToPoint: function(e) {
  18965. return function(t, i) {
  18966. return t.position.distanceTo(e) - i.position.distanceTo(e)
  18967. }
  18968. },
  18969. floorDistanceToPoint: function(e) {
  18970. return function(t, i) {
  18971. return t.floorPosition.distanceTo(e) - i.floorPosition.distanceTo(e)
  18972. }
  18973. },
  18974. choose: function(e) {
  18975. return function(t, i) {
  18976. return e.id === t.id ? -1 : e.id === i.id ? 1 : 0
  18977. }
  18978. }
  18979. },
  18980. n.scoreFunctions = {
  18981. distance: function(e, t) {
  18982. return t = t || a.navigation.distanceFactor,
  18983. function(i) {
  18984. return e ? e.position.distanceTo(i.position) * t : 0
  18985. }
  18986. },
  18987. distanceSquared: function(e, t) {
  18988. return t = t || a.navigation.distanceFactor,
  18989. function(i) {
  18990. return e ? e.position.distanceToSquared(i.position) * t : 0
  18991. }
  18992. },
  18993. direction: function(e, t) {
  18994. return function(i) {
  18995. var n = i.position.clone().sub(e).normalize();
  18996. return n.dot(t) * a.navigation.directionFactor
  18997. }
  18998. },
  18999. angle: function(e, t) {
  19000. return function(i) {
  19001. var n = i.position.clone().sub(e).normalize();
  19002. return n.angleTo(t) * a.navigation.angleFactor
  19003. }
  19004. },
  19005. inFieldOfView: function(e, t) {
  19006. return function(i) {
  19007. var n = i.position.clone().sub(e).normalize();
  19008. return n.dot(t) > .75 ? 10 : -1
  19009. }
  19010. },
  19011. optionality: function(e) {
  19012. return function(t) {
  19013. var i = t.neighbourUUIDs.filter(function(t) {
  19014. return !(t in e.neighbourUUIDs) && t !== e.id
  19015. });
  19016. return i.length * a.navigation.optionalityFactor
  19017. }
  19018. },
  19019. penalizeHeightDifferenceUnder: function(e, t) {
  19020. return function(i) {
  19021. return e.y - i.position.y < t ? -20 : 0
  19022. }
  19023. }
  19024. },
  19025. t.exports = n
  19026. }
  19027. ).call(this, "/js/objects/Panorama.js")
  19028. }
  19029. , {
  19030. "../enum/AlignmentType": 17,
  19031. "../enum/GLCubeFaces": 25,
  19032. "../enum/PanoRendererEvents": 35,
  19033. "../enum/PanoSizeClass": 36,
  19034. "../enum/PanoramaEvents": 37,
  19035. "../enum/RenderLayers": 41,
  19036. "../enum/RenderOrder": 42,
  19037. "../enum/TileDownloaderEvents": 45,
  19038. "../enum/Viewmode": 51,
  19039. "../exception/BasicException": 55,
  19040. "../scene/SceneRenderer": 158,
  19041. "../settings": 166,
  19042. "../tile/TileUtils": 174,
  19043. "../util/ajax": 181,
  19044. "../util/common": 185,
  19045. "../util/lerp": 188,
  19046. "../util/logger": 189,
  19047. "../util/panorama": 191,
  19048. "../util/texture": 194,
  19049. "../util/transitions": 195,
  19050. events: 202,
  19051. three: 217
  19052. }],
  19053. 149: [function(e, t, i) {
  19054. "use strict";
  19055. function n(e) {
  19056. var t = r.UniformsUtils.clone(c.waypoint.uniforms);
  19057. t.map.value = d,
  19058. t.opacity.value = 0,
  19059. t.color.value.set(o.reticuleColor),
  19060. t.showMouseMarker = !window.DATA.hideMouseMarker;
  19061. r.Mesh.call(this, new r.PlaneBufferGeometry(.4,.4,1,1), new r.RawShaderMaterial({
  19062. side: r.DoubleSide,
  19063. depthWrite: !1,
  19064. depthTest: !1,
  19065. transparent: !0,
  19066. vertexShader: c.waypoint.vertexShader,
  19067. fragmentShader: c.waypoint.fragmentShader,
  19068. uniforms: t,
  19069. name: "waypoint",
  19070. opacity: 0,
  19071. visible: t.showMouseMarker // 显示/隐藏鼠标标志
  19072. })),
  19073. this.layers.set(h.RETICULE),
  19074. this.renderOrder = u.reticule,
  19075. this.player = e,
  19076. this.direction = new r.Vector3,
  19077. this.hidden = !0,
  19078. this.mouseLastMoveTime = Date.now()
  19079. }
  19080. var r = e("three")
  19081. , o = e("../settings")
  19082. , a = e("../util/transitions")
  19083. , s = e("../util/texture")
  19084. , l = e("../util/lerp")
  19085. , c = e("../shaders")
  19086. , h = e("../enum/RenderLayers")
  19087. , u = e("../enum/RenderOrder")
  19088. , d = s.load("images/reticule-256x256.png");
  19089. n.prototype = Object.create(r.Mesh.prototype),
  19090. n.prototype.move = function(e, t, i) {
  19091. this.hidden = i,
  19092. this.mouseLastMoveTime = Date.now()
  19093. }
  19094. ,
  19095. n.prototype.hide = function() {
  19096. this.hidden || (this.hidden = !0,
  19097. a.start(l.property(this.material.uniforms.opacity, "value", 0), o.reticuleOpacityTransitionTime))
  19098. }
  19099. ,
  19100. n.prototype.show = function() {
  19101. this.hidden = !1,
  19102. this.material.opacity <= 0 && a.start(l.property(this.material.uniforms.opacity, "value", o[this.player.mode].reticuleOpacity), o.reticuleOpacityTransitionTime)
  19103. }
  19104. ,
  19105. n.prototype.update = function() {
  19106. Date.now() - this.mouseLastMoveTime > o.hideReticuleTimeout && !this.hidden && this.hide()
  19107. }
  19108. ,
  19109. n.prototype.updatePosition = function(e, t) {
  19110. if (!this.hidden) {
  19111. if (!t)
  19112. return this.hide();
  19113. var i = t.point
  19114. , n = e.distanceTo(i)
  19115. , r = 1 + .01 * n;
  19116. n < 1 && (r -= 1 - n),
  19117. this.show(),
  19118. this.scale.set(r, r, r),
  19119. this.direction = this.direction.multiplyScalar(.8),
  19120. this.direction.add(t.face.normal.clone().multiplyScalar(.2)),
  19121. this.position.copy(i).add(t.face.normal.clone().multiplyScalar(.01)),
  19122. this.lookAt(this.position.clone().add(this.direction))
  19123. }
  19124. }
  19125. ,
  19126. n.prototype.writeAstag = function() {
  19127. var e = Math.floor(4294967296 * (1 + Math.random())).toString(16) + Math.floor(16 * (1 + Math.random())).toString(16)
  19128. , t = new Date;
  19129. this.tagCount = "undefined" == typeof this.tagCount ? 1 : this.tagCount + 1;
  19130. var i = {
  19131. enabled: !0,
  19132. version: "0",
  19133. created: t.toISOString(),
  19134. created_by: "APITest",
  19135. position: this.position.clone(),
  19136. stem: {
  19137. enabled: o.tags.pole.enabled,
  19138. direction: this.direction.multiplyScalar(o.tags.pole.height)
  19139. },
  19140. label: "tag " + this.tagCount,
  19141. description: "Description " + e,
  19142. floor: function(e) {
  19143. if (e.currentFloor) {
  19144. var t = e.floors.indexOf(e.currentFloor);
  19145. return t > -1 ? t : void 0
  19146. }
  19147. }(this.player.model),
  19148. type: "info",
  19149. metadata: {
  19150. preferred_camera: {
  19151. mode: this.player.mode
  19152. }
  19153. }
  19154. };
  19155. console.log("--------------------------"),
  19156. console.log(JSON.stringify(i));
  19157. var n = this.player.model.addtag(e, i).build();
  19158. n && (n.disc && this.player.tagDiscs.push(n.disc),
  19159. n.visible || n.show(o.tags.startup.fadeInDuration))
  19160. }
  19161. ,
  19162. t.exports = n
  19163. }
  19164. , {
  19165. "../enum/RenderLayers": 41,
  19166. "../enum/RenderOrder": 42,
  19167. "../settings": 166,
  19168. "../shaders": 167,
  19169. "../util/lerp": 188,
  19170. "../util/texture": 194,
  19171. "../util/transitions": 195,
  19172. three: 217
  19173. }],
  19174. 150: [function(e, t, i) {
  19175. "use strict";
  19176. function n(e, t) {
  19177. this.chunks = [],
  19178. this.floorId = e,
  19179. this.roomId = t,
  19180. this.position = new r.Vector3
  19181. }
  19182. var r = e("three");
  19183. n.prototype.addChunk = function(e) {
  19184. this.chunks.push(e)
  19185. }
  19186. ,
  19187. n.prototype.calcBoundaries = function() {
  19188. 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++) {
  19189. var s = this.chunks[a]
  19190. , l = s.geometry.attributes.position;
  19191. if (l)
  19192. for (var c = 0; c < l.array.length; c += 3)
  19193. e.set(l.array[c], l.array[c + 1], l.array[c + 2]),
  19194. t.add(e),
  19195. 0 === c ? (i.copy(e),
  19196. n.copy(e)) : (i.max(e),
  19197. n.min(e)),
  19198. o++
  19199. }
  19200. o > 0 ? (t.multiplyScalar(1 / o),
  19201. this.average = t) : this.average = null,
  19202. this.boundsMax = i,
  19203. this.boundsMin = n,
  19204. this.center = new r.Vector3,
  19205. this.center.copy(i).sub(n).multiplyScalar(.5).add(n)
  19206. }
  19207. ,
  19208. t.exports = n
  19209. }
  19210. , {
  19211. three: 217
  19212. }],
  19213. 151: [function(e, t, i) {
  19214. (function(i) {
  19215. "use strict";
  19216. function n(e, t, i) {
  19217. this.obj3d = null,
  19218. this.nodes = [],
  19219. this.colorHull = [],
  19220. this.shortPaths = {},
  19221. this.floorHull = null,
  19222. this.cameraHull = null,
  19223. this.floorPathDistance = 0,
  19224. this.floorCurvePoints = null,
  19225. this.floorCurveColors = null,
  19226. this.camCurvePoints = null,
  19227. this.warpDestHeroLoc = null,
  19228. this.warpDestPano = null,
  19229. this.warpPathPoints = null,
  19230. this.warpPathLengths = [0],
  19231. this.warpLength = 0,
  19232. this.closeWarpDistance = 4,
  19233. this.UP = A.UP.clone(),
  19234. this.longestStep = 0,
  19235. this.upcomingTransType = null,
  19236. this.burnsDir = 1, //导览在DOLLHOUSE停留时的旋转方向 1 或 -1
  19237. this.prevNextDist = 0,
  19238. this.nextI = 0,
  19239. this.activeTransType = null,
  19240. this.lastTransType = null,
  19241. this.bunnyObj = null,
  19242. this.director = e,
  19243. this.player = t,
  19244. this.playerControls = i,
  19245. this.modelManager = t.modelManager,
  19246. this.updateModel(),
  19247. this.updateDefaultsFromModelData(),
  19248. this.bindEvents(),
  19249. this.warping = !1,
  19250. this.waitingToWarp = !1,
  19251. this.warpInterrupted = !1,
  19252. this.warpInterruptionBlackoutStyle = null,
  19253. this.warpInterruptionTravelTime = null
  19254. }
  19255. var r = e("three")
  19256. , o = e("../util/logger")
  19257. , a = e("../enum/Viewmode")
  19258. , s = e("../enum/RenderOrder")
  19259. , l = e("../enum/WarpStyle")
  19260. , c = e("../settings")
  19261. , h = e("../util/math")
  19262. , u = e("../util/lerp")
  19263. , d = e("../util/easing")
  19264. , p = e("../util/transitions")
  19265. , f = e("../objects/Snapshot")
  19266. , g = e("../effects")
  19267. , m = e("../shaders")
  19268. , v = (e("../gui/gui"),
  19269. e("../util/texture"))
  19270. , A = e("../enum/Vectors")
  19271. , y = (e("../model/ModelManager"),
  19272. new o(i))
  19273. , C = e("../enum/PlayerEvents")
  19274. , I = e("../enum/BlackoutStyle")
  19275. , E = e("../enum/ModelManagerEvents")
  19276. , b = e("../constants")
  19277. , w = {
  19278. 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"),
  19279. pathEnd: v.load("images/End.png"),
  19280. 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==")
  19281. };
  19282. n.prototype.setScene = function(e) {
  19283. this.createCpm(e),
  19284. this.createBunnyObj(e)
  19285. }
  19286. ,
  19287. n.prototype.updateModel = function() {
  19288. this.model = this.modelManager.getActiveModel()
  19289. }
  19290. ,
  19291. n.prototype.bindEvents = function() {
  19292. this.modelManager.on(E.ActiveModelChanged, this.updateModel.bind(this))
  19293. }
  19294. ,
  19295. n.prototype.updateDefaultsFromModelData = function() {
  19296. this.model.data
  19297. }
  19298. ,
  19299. n.prototype.pointPathDistance = function(e) {
  19300. for (var t = 0, i = 1; i < e.length; i += 1)
  19301. t += e[i - 1].distanceTo(e[i]);
  19302. return t
  19303. }
  19304. ,
  19305. n.prototype.pointPathLengths = function(e) {
  19306. for (var t = [0], i = 1; i < e.length; i += 1)
  19307. t.push(t[i - 1] + e[i - 1].distanceTo(e[i]));
  19308. return t
  19309. }
  19310. ,
  19311. n.prototype.interpAlongPath = function(e, t, i) {
  19312. var n, o = new r.Vector3, a = t[t.length - 1];
  19313. if (i < 1) {
  19314. n = i * a;
  19315. for (var s = 1; s < t.length; s += 1)
  19316. if (t[s] > n) {
  19317. var l = (n - t[s - 1]) / (t[s] - t[s - 1]);
  19318. return o.copy(e[s]),
  19319. o.sub(e[s - 1]),
  19320. o.multiplyScalar(l),
  19321. o.add(e[s - 1]),
  19322. o
  19323. }
  19324. } else
  19325. o.copy(e[e.length - 1]);
  19326. return o
  19327. }
  19328. ,
  19329. n.prototype.pathHeight = function() {
  19330. return this.player.mode !== a.FLOORPLAN ? c.path.height : c.path.outsideHeight
  19331. }
  19332. ,
  19333. n.prototype.createBunnyObj = function(e) {
  19334. this.bunnyObj || (this.bunnyObj = new r.AxisHelper(.1),
  19335. this.bunnyObj.visible = c.warp.showBunny),
  19336. this.bunnyObj.parent && this.bunnyObj.parent.remove(bunnyObj),
  19337. e.add(this.bunnyObj)
  19338. }
  19339. ,
  19340. n.prototype.createCpm = function(e) {
  19341. if (!this.currentPanoMarker) {
  19342. var t = this.makeWaypointObj(w.pathEnd, "Current");
  19343. t.material.uniforms.opacity.value = 0,
  19344. this.currentPanoMarker = {
  19345. mesh: t,
  19346. placed: !1
  19347. }
  19348. }
  19349. this.currentPanoMarker.mesh.parent && this.currentPanoMarker.mesh.parent.remove(this.currentPanoMarker.mesh),
  19350. this.placeCpm(),
  19351. this.currentPanoMarker.mesh.parent || e.add(this.currentPanoMarker.mesh)
  19352. }
  19353. ,
  19354. n.prototype.placeCpm = function() {
  19355. if (c.path.mapGuides && this.player.currentPano && this.player.currentPano.isAligned()) {
  19356. var e = this.player.currentPano.floor;
  19357. this.currentPanoMarker.mesh.parent !== this.player.currentPano.floor && (this.currentPanoMarker.mesh.parent && this.currentPanoMarker.mesh.parent.remove(this.currentPanoMarker.mesh),
  19358. e.add(this.currentPanoMarker.mesh)),
  19359. this.currentPanoMarker.mesh.position.copy(this.player.currentPano.floorPosition).sub(e.position),
  19360. this.currentPanoMarker.mesh.position.y += this.pathHeight(),
  19361. this.currentPanoMarker.placed = !0
  19362. } else
  19363. this.popOutCpm()
  19364. }
  19365. ,
  19366. n.prototype.fadeInCpm = function(e) {
  19367. 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)
  19368. }
  19369. ,
  19370. n.prototype.fadeOutCpm = function(e) {
  19371. p.start(u.property(this.currentPanoMarker.mesh.material.uniforms.opacity, "value", 0), e)
  19372. }
  19373. ,
  19374. n.prototype.popInCpm = function() {
  19375. c.path.mapGuides && this.currentPanoMarker.placed && this.fadeInCpm(2)
  19376. }
  19377. ,
  19378. n.prototype.popOutCpm = function() {
  19379. this.fadeOutCpm(2)
  19380. }
  19381. ,
  19382. n.prototype.brushPrefs = {
  19383. linewidth: 7,
  19384. strokeWidth: 15,
  19385. cvSegments: 48,
  19386. paveStep: .1,
  19387. paveWidth: .2,
  19388. lookBlendDist: 3,
  19389. maxTurn: r.Math.degToRad(2)
  19390. },
  19391. n.prototype.panoPathDistance = function(e) {
  19392. var t = this.model.panos;
  19393. if (!e || e.length < 2)
  19394. return 0;
  19395. for (var i = [], n = 0; n < e.length; n += 1)
  19396. i.push(t.get(e[n]).floorPosition);
  19397. return this.pointPathDistance(i)
  19398. }
  19399. ,
  19400. n.prototype.loadTileTexture = function(e) {
  19401. var t = v.load(e, function(t) {
  19402. t.wrapS = r.RepeatWrapping,
  19403. t.wrapT = r.RepeatWrapping,
  19404. t.needsUpdate = !0,
  19405. y.debug('path texture "' + e + '" is ready')
  19406. }, function() {
  19407. y.error('path texture "' + e + '" failed')
  19408. });
  19409. return t.mapping = r.UVMapping,
  19410. t
  19411. }
  19412. ,
  19413. n.prototype.buildWarpDestinationDescriptor = function(e, t, i, n, r, o) {
  19414. var a = {
  19415. cameraMode: n,
  19416. position: e,
  19417. quaternion: t,
  19418. panoId: i,
  19419. orthoZoom: o,
  19420. floorVisibility: r,
  19421. thumbUrl: null,
  19422. name: null
  19423. };
  19424. return new f(a)
  19425. }
  19426. ,
  19427. n.prototype.buildWarpDestinationDescriptorFromHero = function(e) {
  19428. return this.buildWarpDestinationDescriptor(e.position, e.quaternion, this.getHeroId(e), e.cameraMode, e.floorVisibility, e.orthoZoom)
  19429. }
  19430. ,
  19431. n.prototype.setWarpDestination = function(e) {
  19432. this.warpDestHeroLoc = e
  19433. }
  19434. ,
  19435. n.prototype.setWarpDestinationByHeroIndex = function(e) {
  19436. var t = this.getHeroDescriptorByHeroIndex(e);
  19437. return null !== t && (this.setWarpDestination(t),
  19438. !0)
  19439. }
  19440. ,
  19441. n.prototype.setWarpDestinationByPano = function(e, t) {
  19442. var i = this.model.panos.get(e.id);
  19443. return !!i && this.setWarpDestinationByPanoId(e.id, t)
  19444. }
  19445. ,
  19446. n.prototype.setWarpDestinationByPanoId = function(e, t) {
  19447. var i = this.model.panos.get(e);
  19448. if (i) {
  19449. t = t || new r.Quaternion;
  19450. var n = this.buildWarpDestinationDescriptor(i.position, t, i.id, "panorama", [], -1);
  19451. return this.setWarpDestination(n),
  19452. !0
  19453. }
  19454. return !1
  19455. }
  19456. ,
  19457. n.prototype.getHeroDescriptorByHeroIndex = function(e) {
  19458. var t = this.model.heroCount();
  19459. /* if (null !== this.warpDestHeroLoc && t < 2)
  19460. return y.info("ShowPath.getHeroDescriptorByHeroIndex() -> Only one hero location is available."),
  19461. this.model.getHeroDescriptorByIndex(0); */
  19462. var i = this.model.getHeroDescriptorByIndex(e);
  19463. if (i) {
  19464. var n = i.isPano() ? i.panoId : i.cameraMode;
  19465. y.debug('ShowPath.getHeroDescriptorByHeroIndex() -> New brush/warp destination: "' + n + '" out of ' + t + " choices.")
  19466. }
  19467. return i
  19468. }
  19469. ,
  19470. n.prototype.getHeroDescriptorByPano = function(e) {
  19471. var t = this.model.panos.get(e.id);
  19472. return t ? this.getHeroDescriptorByPanoId(e.id) : null
  19473. }
  19474. ,
  19475. n.prototype.getHeroDescriptorByPanoId = function(e) {
  19476. var t = this.getHeroIndexFromPanoId(e);
  19477. return this.getHeroDescriptorByHeroIndex(t)
  19478. }
  19479. ,
  19480. n.prototype.getHeroIndexFromPanoId = function(e) {
  19481. for (var t = 0; t < this.model.heroLocations.length; t++) {
  19482. var i = this.model.heroLocations[t]
  19483. , n = this.getHeroId(i);
  19484. if (n && n === e)
  19485. return t
  19486. }
  19487. return -1
  19488. }
  19489. ,
  19490. n.prototype.getHeroPano = function(e) {
  19491. if (null === e)
  19492. return y.warn("getHeroPano(): no destination"),
  19493. null;
  19494. var t = this.getHeroId(e)
  19495. , i = this.model.panos.get(t);
  19496. return void 0 === i && (i = null,
  19497. "" !== t && y.debug('unable to find pano "' + t + '"')),
  19498. i
  19499. }
  19500. ,
  19501. n.prototype.getHeroId = function(e) {
  19502. return e.panoId
  19503. }
  19504. ,
  19505. n.prototype.setWarpDestPano = function() {
  19506. return this.warpDestPano = this.getHeroPano(this.warpDestHeroLoc),
  19507. this.warpDestPano
  19508. }
  19509. ,
  19510. n.prototype.brushToWarpPano = function(e, t) {
  19511. if (this.discardPathObject(),
  19512. !this.setWarpDestPano())
  19513. return !1;
  19514. if (this.warpDestHeroLoc.cameraMode !== a.PANORAMA && y.warn("Can only brush from pano to pano"),
  19515. !this.warpDestPano)
  19516. return y.info("No brush"),
  19517. !1;
  19518. if (!this.player.currentPano)
  19519. return y.debug("No current pano, visibility undefined"),
  19520. !1;
  19521. if (!this.warpDestPano)
  19522. return y.info("No wPano, visibility undefined"),
  19523. !1;
  19524. if (!this.warpDestPano.isAligned())
  19525. return y.debug("Cannot brush to unaligned pano"),
  19526. !1;
  19527. var i = (e === l.STD || e === l.WALK) && c.path.mapGuides
  19528. , n = !0;
  19529. if (this.player.currentPano.id === this.warpDestPano.id)
  19530. y.debug("Already at destination pano");
  19531. else {
  19532. this.nodes = this.findShortestPath(this.player.currentPano, this.warpDestPano),
  19533. n = void 0 === this.nodes || null === this.nodes || this.nodes.length < 1,
  19534. this.obj3d = new r.Object3D,
  19535. y.debug('Brushing from "' + this.player.currentPano.id + '" to "' + this.warpDestPano.id + '" (' + (this.nodes ? this.nodes.length : 0) + ")"),
  19536. n ? (y.info('No "walkable" route, using fall-back warp style transition'),
  19537. e = t) : (this.setPathHulls(this.nodes),
  19538. this.setFloorCurves(),
  19539. 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)))),
  19540. this.player.currentPano.floor.add(this.obj3d);
  19541. var o = this.player.mode === a.DOLLHOUSE || this.player.mode === a.FLOORPLAN
  19542. , s = e === l.STD;
  19543. if (!n && (i || s)) {
  19544. if (o) {
  19545. var h = this.makeStartMarker(this.floorHull[0], this.floorCurvePoints);
  19546. this.obj3d.add(h)
  19547. }
  19548. var u = this.makeEndMarker(this.floorHull[this.floorHull.length - 1]);
  19549. this.obj3d.add(u)
  19550. }
  19551. this.appearSlow()
  19552. }
  19553. return this.upcomingTransType = e,
  19554. !n
  19555. }
  19556. ,
  19557. n.prototype.findShortestPath = function(e, t) {
  19558. if (!e || !t)
  19559. return null;
  19560. var i = c.warp.walkExtraPanosDistance
  19561. , n = e.id + ":" + t.id + ":" + i;
  19562. if (this.shortPaths.hasOwnProperty(n))
  19563. return this.shortPaths[n] ? this.shortPaths[n].slice() : null;
  19564. var r = t.id + ":" + e.id + ":" + i;
  19565. if (this.shortPaths.hasOwnProperty(r))
  19566. return this.shortPaths[r] ? this.shortPaths[r].slice().reverse() : null;
  19567. var o = this.model.panos.aStarSearch(e, t);
  19568. return this.model.panos.includeNodesNearPath(o, i),
  19569. this.shortPaths[n] = o ? o.slice() : null,
  19570. o
  19571. }
  19572. ,
  19573. n.prototype.makePathHulls = function(e) {
  19574. var t, i, n, r, o, a = 0, s = [], l = [], h = [], u = this.model.panos;
  19575. t = u.get(e[0]),
  19576. r = t.floor.floorIndex;
  19577. for (var d = 0; d < e.length; d += 1)
  19578. t = u.get(e[d]),
  19579. i = t.floorPosition.clone().sub(this.model.position),
  19580. i.y += this.pathHeight(),
  19581. s.push(i),
  19582. l.push(t.position.clone()),
  19583. n = t.floor.floorIndex,
  19584. h.push(n > r ? c.path.colorUp : n < r ? c.path.colorDown : c.path.color),
  19585. d > 0 && (o = l[d].distanceTo(l[d - 1]),
  19586. o > a && (a = o));
  19587. return a > this.longestStep && (this.longestStep = a,
  19588. y.debug("path contains " + a + " meter segment")),
  19589. {
  19590. floor: s,
  19591. camera: l,
  19592. color: h
  19593. }
  19594. }
  19595. ,
  19596. n.prototype.makeFloorCurves = function(e, t, i) {
  19597. var n = this.player.mode === a.PANORAMA ? c.path.waypointIndoorRadius : c.path.waypointRadius
  19598. , o = this.pointPathDistance(e) - 2 * n
  19599. , s = e.slice(0)
  19600. , l = s[1].clone().sub(s[0]);
  19601. l.y = 0,
  19602. l.normalize().multiplyScalar(n),
  19603. s[0] = (new r.Vector3).copy(s[0]).add(l),
  19604. l = s[s.length - 2].clone().sub(s[s.length - 1]),
  19605. l.y = 0,
  19606. l.normalize().multiplyScalar(n),
  19607. s[s.length - 1] = (new r.Vector3).copy(s[s.length - 1]).add(l);
  19608. var h = new r.CatmullRomCurve3(s)
  19609. , u = Math.floor(o / i);
  19610. u = 4 * Math.floor(u / 4),
  19611. u = Math.max(4, u);
  19612. for (var d, p, f, g = h.getSpacedPoints(u), m = [], v = new r.Vector3, A = 0; A < g.length; A += 1) {
  19613. f = 0,
  19614. d = g[A].distanceTo(e[0]);
  19615. for (var y = 1; y < e.length; y += 1)
  19616. v.copy(g[A]).sub(e[y]),
  19617. v.y *= 4,
  19618. p = v.length(),
  19619. p < d && (f = y);
  19620. m.push(t[f])
  19621. }
  19622. return {
  19623. distance: o,
  19624. points: g,
  19625. colors: m
  19626. }
  19627. }
  19628. ,
  19629. n.prototype.makeCameraCurvePoints = function(e, t) {
  19630. var i = this.pointPathDistance(e)
  19631. , n = new r.CatmullRomCurve3(e);
  19632. return n.getSpacedPoints(Math.max(2, Math.floor(i / t)))
  19633. }
  19634. ,
  19635. n.prototype.makeCameraCurveTangents = function(e, t) {
  19636. var i = this.pointPathDistance(e)
  19637. , n = new r.CatmullRomCurve3(e)
  19638. , o = Math.max(2, Math.floor(i / t));
  19639. o || (o = 5);
  19640. for (var a = [], s = 0; s <= o; s++)
  19641. a.push(n.getTangentAt(s / o));
  19642. return a
  19643. }
  19644. ,
  19645. n.prototype.setPathHulls = function(e) {
  19646. var t = this.makePathHulls(e);
  19647. this.floorHull = t.floor,
  19648. this.cameraHull = t.camera,
  19649. this.colorHull = t.color
  19650. }
  19651. ,
  19652. n.prototype.setFloorCurves = function() {
  19653. var e = this.makeFloorCurves(this.floorHull, this.colorHull, this.brushPrefs.paveStep);
  19654. this.floorPathDistance = e.distance,
  19655. this.floorCurvePoints = e.points,
  19656. this.floorCurveColors = e.colors
  19657. }
  19658. ,
  19659. n.prototype.setCameraCurvePoints = function() {
  19660. this.camCurvePoints = this.makeCameraCurvePoints(this.cameraHull, c.warp.stepFactor * this.brushPrefs.paveStep)
  19661. }
  19662. ,
  19663. n.prototype.chooseWarpPath = function(e) {
  19664. var t, i, n, o = this.playerControls.cameras[a.PANORAMA];
  19665. if (this.player.currentPano === this.warpDestPano || !e)
  19666. return this.warpPathPoints = null,
  19667. this.warpLength = 0,
  19668. !1;
  19669. this.nodes = this.findShortestPath(this.player.currentPano, this.warpDestPano),
  19670. void 0 === this.nodes || null === this.nodes || this.nodes.length < 1 ? (y.debug("warp path to unreachable node"),
  19671. t = this.warpDestPano.position.clone().sub(o.position),
  19672. i = t.clone().negate(),
  19673. t.multiplyScalar(.15).add(o.position),
  19674. i.multiplyScalar(.15).add(this.warpDestPano.position),
  19675. t.y = o.position.y,
  19676. i.y = this.warpDestPano.position.y,
  19677. n = new r.CubicBezierCurve3(o.position.clone(),t,i,this.warpDestPano.position.clone()),
  19678. this.warpPathPoints = n.getSpacedPoints(this.brushPrefs.cvSegments)) : (y.debug("follow warp path (path distance was " + this.nodes.length + " nodes, " + this.floorPathDistance + ")"),
  19679. this.setCameraCurvePoints(),
  19680. this.warpPathPoints = this.camCurvePoints.slice(0)),
  19681. this.warpLength = 0,
  19682. this.warpPathLengths = [0];
  19683. 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) {
  19684. s.copy(this.warpPathPoints[d - 1]).sub(this.warpPathPoints[d]);
  19685. var p = s.length();
  19686. s.y *= c.warp.climbEffort;
  19687. var f = s.length() / p;
  19688. if (d > 1) {
  19689. s.setY(0).normalize(),
  19690. l.copy(this.warpPathPoints[d - 2]).sub(this.warpPathPoints[d - 1]).setY(0).normalize();
  19691. var g = Math.min(1, s.dot(l))
  19692. , m = 1 + (c.warp.brakeStrength - 1) * (1 - r.Math.smoothstep(g, u, h));
  19693. f = Math.max(m, f)
  19694. }
  19695. this.warpLength += p * f,
  19696. this.warpPathLengths[d] = this.warpLength
  19697. }
  19698. return !0
  19699. }
  19700. ,
  19701. n.prototype.drawPathRibbon = function(e, t) {
  19702. this.bunnyObj.visible = c.warp.showBunny;
  19703. 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) {
  19704. h.copy(e[u]),
  19705. 0 === u ? h.sub(e[u + 1]) : h.sub(e[u - 1]).negate(),
  19706. h.normalize(),
  19707. n.crossVectors(h, A.UP),
  19708. n.multiplyScalar(i);
  19709. var d = (new r.Vector3).copy(e[u]).add(o);
  19710. d.sub(n),
  19711. l.vertices.push(d),
  19712. d = (new r.Vector3).copy(e[u]).add(o),
  19713. d.add(n),
  19714. l.vertices.push(d)
  19715. }
  19716. var p, f = 0;
  19717. for (u = 0; u < e.length - 1; u += 1) {
  19718. var g = 2 * u
  19719. , v = f;
  19720. f += e[u + 1].distanceTo(e[u]);
  19721. var y = f
  19722. , C = t[u]
  19723. , I = t[u + 1];
  19724. p = new r.Face3(g,g + 1,g + 2),
  19725. p.vertexColors = [new r.Color(C), new r.Color(C), new r.Color(I)],
  19726. l.faces.push(p),
  19727. l.faceVertexUvs[0].push([new r.Vector2(0,v), new r.Vector2(1,v), new r.Vector2(0,y)]),
  19728. p = new r.Face3(g + 2,g + 1,g + 3),
  19729. p.vertexColors = [new r.Color(I), new r.Color(C), new r.Color(I)],
  19730. l.faces.push(p),
  19731. l.faceVertexUvs[0].push([new r.Vector2(0,y), new r.Vector2(1,v), new r.Vector2(1,y)])
  19732. }
  19733. l.computeFaceNormals(),
  19734. l.computeVertexNormals();
  19735. var E, b;
  19736. this.player.mode === a.PANORAMA ? (b = r.UniformsUtils.clone(m.ribbon.uniforms),
  19737. b.map.value = w.path,
  19738. b.opacity.value = 0,
  19739. b.color.value.set(c.path.color),
  19740. E = new r.RawShaderMaterial({
  19741. side: r.DoubleSide,
  19742. depthWrite: !1,
  19743. transparent: !0,
  19744. vertexShader: m.ribbon.vertexShader,
  19745. fragmentShader: m.ribbon.fragmentShader,
  19746. uniforms: b,
  19747. name: "ribbonT",
  19748. opacity: 0
  19749. })) : E = new r.MeshBasicMaterial({
  19750. color: 16777215,
  19751. side: r.DoubleSide,
  19752. name: "ribbonOut",
  19753. vertexColors: r.VertexColors
  19754. });
  19755. var _ = new r.Mesh(l,E);
  19756. return _.name = "ribbon",
  19757. this.player.mode === a.PANORAMA && (_.renderOrder = s.ribbon),
  19758. _
  19759. }
  19760. ,
  19761. n.prototype.drawPathPavement = function(e) {
  19762. for (var t, i = .25, n = new r.Vector3, o = new r.Geometry, s = new r.Vector3, l = 0; l < e.length; l += 1)
  19763. s.copy(e[l]),
  19764. 0 === l ? s.sub(e[l + 1]).negate() : s.sub(e[l - 1]),
  19765. s.normalize(),
  19766. n.crossVectors(s, A.UP),
  19767. n.multiplyScalar(this.brushPrefs.paveWidth),
  19768. t = (new r.Vector3).copy(e[l]),
  19769. t.sub(n),
  19770. o.vertices.push(t),
  19771. o.vertices.push((new r.Vector3).copy(e[l])),
  19772. t = (new r.Vector3).copy(e[l]),
  19773. t.add(n),
  19774. o.vertices.push(t);
  19775. var h, u, d;
  19776. for (l = 0; l < e.length - 1; l += 1)
  19777. h = 3 * l + 1,
  19778. u = l * i,
  19779. d = u + i,
  19780. o.faces.push(new r.Face3(h - 1,h,h + 3)),
  19781. o.faceVertexUvs[0].push([new r.Vector2(0,u), new r.Vector2(.5,u), new r.Vector2(.5,d)]),
  19782. o.faces.push(new r.Face3(h + 3,h + 2,h - 1)),
  19783. o.faceVertexUvs[0].push([new r.Vector2(.5,d), new r.Vector2(0,d), new r.Vector2(0,u)]),
  19784. o.faces.push(new r.Face3(h + 3,h,h + 1)),
  19785. o.faceVertexUvs[0].push([new r.Vector2(.5,d), new r.Vector2(.5,u), new r.Vector2(1,u)]),
  19786. o.faces.push(new r.Face3(h + 3,h + 1,h + 4)),
  19787. o.faceVertexUvs[0].push([new r.Vector2(.5,d), new r.Vector2(1,u), new r.Vector2(1,d)]);
  19788. var p = this.player.mode === a.PANORAMA ? new r.MeshBasicMaterial({
  19789. color: c.path.color,
  19790. side: r.DoubleSide,
  19791. transparent: !0,
  19792. depthWrite: !1,
  19793. opacity: 0,
  19794. name: "paveT",
  19795. map: w.path
  19796. }) : new r.MeshBasicMaterial({
  19797. color: c.path.color,
  19798. side: r.DoubleSide,
  19799. transparent: !0,
  19800. depthWrite: !1,
  19801. opacity: 1,
  19802. name: "paveO",
  19803. map: w.path
  19804. });
  19805. return new r.Mesh(o,p)
  19806. }
  19807. ,
  19808. n.prototype.hintPrefs = {
  19809. rad: .18,
  19810. width: .0125,
  19811. depth: .0625,
  19812. setBack: -.04,
  19813. markRad: .25,
  19814. markInnerRad: .16
  19815. },
  19816. n.prototype.makeWaypointObj = function(e, t) {
  19817. var i = new r.Geometry
  19818. , n = this.player.mode === a.PANORAMA ? c.path.waypointIndoorRadius : c.path.waypointRadius
  19819. , o = this.pathHeight();
  19820. 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)),
  19821. i.faces.push(new r.Face3(0,1,2), new r.Face3(2,3,0)),
  19822. i.faceVertexUvs[0].push([new r.Vector2(0,0), new r.Vector2(1,0), new r.Vector2(1,1)]),
  19823. i.faceVertexUvs[0].push([new r.Vector2(1,1), new r.Vector2(0,1), new r.Vector2(0,0)]);
  19824. var s = r.UniformsUtils.clone(m.waypoint.uniforms);
  19825. s.map.value = e,
  19826. s.opacity.value = 0,
  19827. s.color.value.set(c.path.color);
  19828. var l = {
  19829. side: r.DoubleSide,
  19830. depthWrite: !1,
  19831. transparent: !0,
  19832. vertexShader: m.waypoint.vertexShader,
  19833. fragmentShader: m.waypoint.fragmentShader,
  19834. uniforms: s,
  19835. name: "waypoint",
  19836. opacity: 0
  19837. };
  19838. this.player.mode !== a.PANORAMA && (l.depthTest = !1,
  19839. l.name = "wayPtOut");
  19840. var h = new r.RawShaderMaterial(l)
  19841. , u = new r.Mesh(i,h);
  19842. return u.name = t,
  19843. u
  19844. }
  19845. ,
  19846. n.prototype.makeStartMarker = function(e, t) {
  19847. var i = (new r.Vector3).copy(t[1]).sub(t[0]);
  19848. i.y = 0,
  19849. i.normalize();
  19850. var n = Math.acos(i.x)
  19851. , o = this.makeWaypointObj(w.pathStart, "Start");
  19852. return o.rotateOnAxis(new r.Vector3(0,1,0), n),
  19853. o.position.copy(e),
  19854. o
  19855. }
  19856. ,
  19857. n.prototype.makeEndMarker = function(e) {
  19858. var t = this.makeWaypointObj(w.pathEnd, "End")
  19859. , i = this.model.panos.get(this.nodes[0]).floor.floorIndex
  19860. , n = this.model.panos.get(this.nodes[this.nodes.length - 1]).floor.floorIndex;
  19861. return i < n ? t.material.uniforms.color.value.set(c.path.colorUp) : i > n && t.material.uniforms.color.value.set(c.path.colorDown),
  19862. t.position.copy(e),
  19863. t
  19864. }
  19865. ,
  19866. n.prototype.pathClean = function(e) {
  19867. if (e) {
  19868. for (var t in e.children)
  19869. this.pathClean(e.children[t]);
  19870. e.geometry && e.geometry.dispose(),
  19871. e.material && e.material.dispose()
  19872. }
  19873. }
  19874. ,
  19875. n.prototype.discardPathObject = function() {
  19876. if (this.obj3d) {
  19877. var e = this.obj3d.parent;
  19878. e && e.remove(this.obj3d),
  19879. this.pathClean(this.obj3d)
  19880. }
  19881. this.obj3d = null,
  19882. this.popInCpm()
  19883. }
  19884. ,
  19885. n.prototype.discardSlow = function() {
  19886. if (this.obj3d) {
  19887. if (this.player.mode !== a.PANORAMA)
  19888. return void this.discardPathObject();
  19889. for (var e, t = this, i = 0, n = function() {
  19890. this.discardPathObject()
  19891. }
  19892. .bind(this), r = 0; r < t.obj3d.children.length; r += 1)
  19893. e = t.obj3d.children[r],
  19894. 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]),
  19895. i += 1,
  19896. n = null);
  19897. 0 === i && this.discardPathObject(),
  19898. this.player.mode !== a.PANORAMA && this.fadeInCpm(c.path.fadeInTime - 3)
  19899. }
  19900. }
  19901. ,
  19902. n.prototype.appearSlow = function() {
  19903. var e, t = this;
  19904. this.fadeOutCpm(c.path.fadeInTime);
  19905. for (var i = this.player.mode === a.PANORAMA ? c.path.opacity : 1, n = 0; n < t.obj3d.children.length; n += 1)
  19906. e = t.obj3d.children[n],
  19907. 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]))
  19908. }
  19909. ,
  19910. n.prototype.update = function() {
  19911. this.obj3d && this.obj3d.updateMatrixWorld()
  19912. }
  19913. ,
  19914. n.prototype.calcBurnsAmount = function(e) {//计算导览点旋转角
  19915. var t = r.Math.degToRad(c.warp.burnsAngle);
  19916. if (this.player.mode === a.PANORAMA) {
  19917. var i = this.burnsDir * t;
  19918. if (this.upcomingTransType === l.BLACK)
  19919. return i;
  19920. var n = e;
  19921. if (null === n)
  19922. return y.warn("Transition request for non-highlight"),
  19923. i;
  19924. var o = this.getHeroDescriptorByHeroIndex(n);
  19925. if (null === o)
  19926. return i;
  19927. if (!o.isPano())
  19928. return i;
  19929. var s = this.getHeroPano(o)
  19930. , h = this.playerControls.cameras[a.PANORAMA]
  19931. , u = A.FORWARD.clone().applyQuaternion(h.quaternion).setY(0).normalize()
  19932. , d = Math.min(r.Math.degToRad(c.warp.minBurnsAngle), t)
  19933. , p = function(e) {
  19934. var i = Math.acos(Math.min(1, e.dot(u)))
  19935. , n = (new r.Vector3).crossVectors(u, e);
  19936. return Math.max(d, Math.min(Math.abs(i), t)) * Math.sign(n.y)
  19937. };
  19938. if (s === this.player.currentPano)
  19939. return i = p(A.FORWARD.clone().applyQuaternion(o.quaternion).setY(0).normalize());
  19940. var f = this.findShortestPath(this.player.currentPano, s);
  19941. if (void 0 === f || null === f || f.length < 1)
  19942. return y.debug("Empty path ahead..."),
  19943. i;
  19944. var g = this.makePathHulls(f)
  19945. , m = new r.CatmullRomCurve3(g.camera)
  19946. , v = Math.min(.1, c.warp.lookAheadDist / m.getLength());
  19947. return i = p(m.getPointAt(v).clone().sub(h.position).setY(0).normalize())
  19948. }
  19949. return this.player.mode === a.DOLLHOUSE ? .02 * this.burnsDir : this.burnsDir
  19950. }
  19951. ,
  19952. n.prototype.waitNextStep = function(e, t, time) {//xzw 改时间
  19953. var i = (time==void 0)? c.warp.tourStepDelay : time;
  19954. i==void 0 && (i = this.lastTransType === l.BLACK ? b.tourStepDelaySlideShow : b.tourStepDelayDefault);
  19955. var n = new r.Euler
  19956. , o = new r.Vector3;
  19957. y.debug("Starting wait: " + (void 0 !== t));
  19958. var currentLocation = this.model.heroLocations[this.director.currentItem[0]]
  19959. var s = currentLocation.dontRot || this.calcBurnsAmount(e)
  19960. , h = function() {
  19961. this.endWarpState(),
  19962. this.player.mode === a.DOLLHOUSE && (this.playerControls.cameras[a.DOLLHOUSE].controls.rotationAcceleration.x = 0),
  19963. t && t()
  19964. }
  19965. .bind(this)
  19966. , u = function(e, t) {
  19967. if (this.warpInterrupted)
  19968. return h(),
  19969. !0;
  19970. var r = t || 1e3 / 60;
  19971. if (c.warp.doBurns && !currentLocation.dontRot )
  19972. if (this.player.mode === a.PANORAMA) {
  19973. var l = this.playerControls.cameras[a.PANORAMA];
  19974. n.setFromQuaternion(l.quaternion, c.warp.eOrder);
  19975. var u = i == 0 ? s : r * s / i;
  19976. u = Math.sign(u) * Math.max(u, 0.0001) //add 如果音频长的话,使旋转可见,否则以为停住了
  19977. n.y += u,
  19978. o.set(0, 0, -1),
  19979. o.applyEuler(n),
  19980. o.add(l.position),
  19981. l.controls.lookAt(o),
  19982. l.controls.lookVector.copy(o)
  19983. ,l.lookAt(o)
  19984. } else
  19985. this.player.mode === a.DOLLHOUSE ? this.playerControls.controls[a.DOLLHOUSE].rotationAcceleration.x = s : this.playerControls.controls[a.FLOORPLAN].absoluteScale *= .9996
  19986. }
  19987. .bind(this);
  19988. this.startWarpState(),
  19989. p.start(u, i, h, 0, d.easeInOutQuad, "wait")
  19990. }
  19991. ,
  19992. n.prototype.warpToNonPano = function(e) {
  19993. if (this.discardPathObject(),
  19994. this.warpDestHeroLoc.cameraMode === a.DOLLHOUSE || this.warpDestHeroLoc.cameraMode === a.FLOORPLAN) {
  19995. var t = function() {
  19996. e && e()
  19997. }
  19998. .bind(this);
  19999. this.player.flyToNewMode({
  20000. mode: this.warpDestHeroLoc.cameraMode,
  20001. duration: c.warp.outsideTime,
  20002. warpDest: this.warpDestHeroLoc,
  20003. callback: t,
  20004. force: !0
  20005. })
  20006. } else
  20007. y.warn("no warp destination!!!"),
  20008. e && e()
  20009. }
  20010. ,
  20011. n.prototype._resetWarpShaderParams = function(e) {//
  20012. this.player.mode === a.PANORAMA && (void 0 !== e.material.uniforms.blackout && (e.material.uniforms.blackout.value = 0),
  20013. void 0 !== e.material.uniforms.modelAlpha && (e.material.uniforms.modelAlpha.value = 0))
  20014. /* if(momentTourBlackNewType && "newBlack" in e.material.defines){
  20015. delete e.material.defines.newBlack;
  20016. e.material.needsUpdate = true
  20017. } */
  20018. }
  20019. ,
  20020. n.prototype._clearWarpShading = function() {
  20021. for (var e = this.model.chunks, t = 0; t < e.length; t += 1)
  20022. this._resetWarpShaderParams(e[t]),
  20023. e[t].visible = !0;
  20024. this._resetWarpShaderParams(this.model.skybox)
  20025. }
  20026. ,
  20027. n.prototype._warpStopFlying = function() {
  20028. this.activeTransType = null,
  20029. this.placeCpm()
  20030. }
  20031. ,
  20032. n.prototype._wrapupTravelOnlyBits = function() {
  20033. this._warpStopFlying(),
  20034. this.warpPathPoints && (this.player.currentPano.exit(),
  20035. this.warpDestPano.enter(),
  20036. this.player.currentPano = this.warpDestPano),
  20037. this.player.spider.draw(),
  20038. this.placeCpm()
  20039. }
  20040. ,
  20041. n.prototype._wrapupTravel = function(e) {
  20042. this._wrapupTravelOnlyBits(),
  20043. this.warpCameraAim(e)
  20044. }
  20045. ,
  20046. n.prototype._wrapupWarpShading = function(e) {
  20047. this._clearWarpShading(),
  20048. this._wrapupTravel(e)
  20049. }
  20050. ,
  20051. n.prototype.wrapupWarpShadingOnly = function(e, t) {
  20052. t !== I.END && this._clearWarpShading(),
  20053. this._wrapupTravelOnlyBits(),
  20054. this.upcomingTransType = null,
  20055. e && e()
  20056. }
  20057. ,
  20058. n.prototype._warpCameraAim = function(e, t) {//到每个片段终点时转向终点朝向。
  20059. var i = this.warpDestHeroLoc.quaternion
  20060. , n = this.playerControls.cameras[a.PANORAMA]
  20061. , o = new r.Vector3(0,0,1).applyQuaternion(i).normalize()
  20062. , s = new r.Vector3(0,0,1).applyQuaternion(n.quaternion).normalize()
  20063. , l = s.dot(o)
  20064. , u = r.Math.radToDeg(Math.acos(l))
  20065. , f = new r.Euler(0,0,0,c.warp.eOrder).setFromQuaternion(i, c.warp.eOrder)
  20066. , g = (new r.Euler).setFromQuaternion(n.quaternion, c.warp.eOrder)
  20067. , m = new r.Euler(f.x - g.x,f.y - g.y,f.z - g.z,c.warp.eOrder);
  20068. m.y = h.constrainedTurn(m.y),
  20069. this.burnsDir = Math.sign(m.y);
  20070. var v = new r.Euler(0,0,0,c.warp.eOrder)
  20071. , A = new r.Vector3
  20072. , C = function(e, t) {
  20073. return !!this.warpInterrupted || (v.x = g.x + e * m.x,
  20074. v.y = g.y + e * m.y,
  20075. v.z = g.z + e * m.z,
  20076. A.set(0, 0, -1),
  20077. A.applyEuler(v),
  20078. A.add(n.position),
  20079. n.controls.lookAt(A),
  20080. n.controls.lookVector.copy(A),
  20081. void n.lookAt(A))
  20082. }
  20083. .bind(this);
  20084. /* return u > c.warp.minRotation ? (p.start(C, e, t, 0, d[c.warp.movementEasing])
  20085. ,(this.warpDestHeroLoc.zoom != this.player.zoomLevel) && //add 原地转向最终方位时
  20086. this.player.smoothZoomFovTo(null, this.warpDestHeroLoc.zoom , e)
  20087. ):
  20088. (y.info("Aim angle only is " + u.toPrecision(3) + " degrees, skipping explicit re-aim")
  20089. ,void (t && t())
  20090. ) */
  20091. (this.warpDestHeroLoc.zoom != this.player.zoomLevel) && //add 原地转向最终方位时
  20092. this.player.smoothZoomFovTo(null, this.warpDestHeroLoc.zoom , e)
  20093. return u > c.warp.minRotation ? p.start(C, e, t, 0, d[c.warp.movementEasing]) :
  20094. (y.info("Aim angle only is " + u.toPrecision(3) + " degrees, skipping explicit re-aim")
  20095. ,void (t && t())
  20096. )
  20097. }
  20098. ,
  20099. n.prototype._warpBendAim = function(e, t, i, n) {
  20100. var o = n || 0
  20101. , s = this.playerControls.cameras[a.PANORAMA]
  20102. , l = new r.Euler(0,0,0,c.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, c.warp.eOrder)
  20103. , u = (new r.Euler).setFromQuaternion(s.quaternion, c.warp.eOrder)
  20104. , f = new r.Euler(l.x - u.x,l.y - u.y,l.z - u.z,c.warp.eOrder);
  20105. f.y = h.constrainedTurn(f.y);
  20106. var g = Math.min(r.Math.degToRad(c.warp.softBendTilt), Math.abs(f.x));
  20107. f.x = g * Math.sign(f.x),
  20108. g = Math.min(r.Math.degToRad(Math.max(0, c.warp.softBendAngle)), g),
  20109. this.burnsDir = Math.sign(f.y),
  20110. g *= Math.sign(f.y),
  20111. f.y = g;
  20112. var m = new r.Euler(0,0,0,c.warp.eOrder)
  20113. , v = new r.Vector3
  20114. , A = function(e, t) {
  20115. if (e < .5)
  20116. m.x = u.x + e * f.x,
  20117. m.y = u.y + e * f.y,
  20118. m.z = u.z + e * f.z;
  20119. else {
  20120. var i = (1 - e) * c.warp.softBendEnd;
  20121. m.x = l.x - i * f.x,
  20122. m.y = l.y - i * f.y,
  20123. m.z = l.z - i * f.z
  20124. }
  20125. v.set(0, 0, -1),
  20126. v.applyEuler(m),
  20127. v.add(s.position);
  20128. s.controls.lookAt(v),
  20129. s.controls.lookVector.copy(v),
  20130. s.lookAt(v);
  20131. }
  20132. .bind(this);
  20133. if(momentTourBlackNewType){
  20134. A(1)
  20135. }else return p.start(A, t, i, o, d[c.warp.movementEasing])
  20136. }
  20137. ,
  20138. n.prototype._warpStepCameraAim = function(e, t, i) {
  20139. var n = this.playerControls.cameras[a.PANORAMA]
  20140. , o = new r.Euler(0,0,0,c.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, c.warp.eOrder)
  20141. , s = (new r.Euler).setFromQuaternion(n.quaternion, c.warp.eOrder)
  20142. , l = new r.Euler(o.x - s.x,o.y - s.y,o.z - s.z,c.warp.eOrder);
  20143. l.y = h.constrainedTurn(l.y),
  20144. this.burnsDir = Math.sign(l.y);
  20145. var u = new r.Euler(0,0,0,c.warp.eOrder)
  20146. , f = new r.Vector3
  20147. , g = function(e, t) {
  20148. e < .5 ? u.copy(s) : u.copy(o),
  20149. f.set(0, 0, -1),
  20150. f.applyEuler(u),
  20151. f.add(n.position),
  20152. n.controls.lookAt(f),
  20153. n.controls.lookVector.copy(f),
  20154. n.lookAt(f)
  20155. }
  20156. .bind(this);
  20157. return p.start(g, t, i, 0, d[c.warp.movementEasing])
  20158. }
  20159. ,
  20160. n.prototype.setBurnsDir = function() {
  20161. var e = this.playerControls.cameras[a.PANORAMA]
  20162. , t = new r.Euler(0,0,0,c.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, c.warp.eOrder)
  20163. , i = (new r.Euler).setFromQuaternion(e.quaternion, c.warp.eOrder)
  20164. , n = new r.Euler(t.x - i.x,t.y - i.y,t.z - i.z,c.warp.eOrder);
  20165. n.y = h.constrainedTurn(n.y),
  20166. this.burnsDir = Math.sign(n.y)
  20167. }
  20168. ,
  20169. n.prototype.stepWarpPath = function(firstPos, e ) {
  20170. var i = this.playerControls.cameras[a.PANORAMA];
  20171. var n = this.warpPathPoints ? this.warpPathPoints[0] : firstPos
  20172. if (!n){
  20173. return i.position.copy(this.warpDestPano.position),
  20174. !0;
  20175. }
  20176. /* if (!this.warpPathPoints)
  20177. return i.position.copy(this.warpDestPano.position),
  20178. !0;
  20179. var n = this.warpPathPoints[0] */
  20180. var o = this.warpDestPano.position;
  20181. /* console.log(firstPos)
  20182. console.log(o) */
  20183. if (null !== this.nodes && this.cameraHull && this.cameraHull.length > 1) {
  20184. var s = new r.Vector3;
  20185. 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),
  20186. i.position.copy(s)
  20187. } else
  20188. e < .5 ? i.position.copy(n) : i.position.copy(o)
  20189. }
  20190. ,
  20191. n.prototype.interruptAndFastForward = function(e, t) {
  20192. this.warping && (this.warpInterrupted = !0,
  20193. this.warpInterruptionBlackoutStyle = e,
  20194. this.warpInterruptionTravelTime = t,
  20195. null !== this.warpInterruptionBlackoutStyle && void 0 !== this.warpInterruptionBlackoutStyle || (this.warpInterruptionBlackoutStyle = I.MIDDLE),
  20196. null !== this.warpInterruptionTravelTime && void 0 !== this.warpInterruptionTravelTime || (this.warpInterruptionTravelTime = c.minWarpTime))
  20197. }
  20198. ,
  20199. n.prototype.warpCameraAim = function(e) {
  20200. var t = c.warp.minWarpTime;
  20201. if (this.upcomingTransType === l.BLACK)
  20202. t = c.warp.teleportTime;
  20203. else {
  20204. var i = this.playerControls.cameras[a.PANORAMA]
  20205. , n = new r.Euler(0,0,0,c.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, c.warp.eOrder)
  20206. , o = (new r.Euler).setFromQuaternion(i.quaternion, c.warp.eOrder)
  20207. , s = new r.Euler(n.x - o.x,n.y - o.y,n.z - o.z,c.warp.eOrder);
  20208. s.y = h.constrainedTurn(s.y);
  20209. var u = 1e3 * Math.abs(s.y) / r.Math.degToRad(c.warp.maxAimPerSec);
  20210. t = Math.max(t, u)
  20211. }
  20212. var d = function() {
  20213. this._warpStopFlying(),
  20214. this.discardSlow(),
  20215. e && e()
  20216. }
  20217. .bind(this);
  20218. this._warpCameraAim(t, d)
  20219. }
  20220. ,
  20221. n.prototype.warpCommonParameters = function(e, t, i, n) {
  20222. this.model.skybox.material.uniforms.blackout.value = n;
  20223. var r = u.uniform(this.model.skybox, "progress", 1)
  20224. , o = u.allUniforms(this.model.chunks, "progress", 1)
  20225. , a = !1
  20226. , s = function() {
  20227. if (this.warpInterrupted)
  20228. return a = !0,
  20229. !0
  20230. }
  20231. .bind(this)
  20232. , l = function(e, t) {
  20233. return i && a ? (this.model.skybox.material.uniforms.progress.value = 0,
  20234. !0) : void r(e, t)
  20235. }
  20236. .bind(this)
  20237. , h = function(e, t) {
  20238. return i && a ? (o(0),
  20239. !0) : void o(e, t)
  20240. }
  20241. .bind(this);
  20242. p.start(s, e, null, t, null, "safeHaltWatch"),
  20243. p.start(l, e, null, t, d[c.warp.blendEasing], "skyboxProgress"),
  20244. p.start(h, e, null, t, d[c.warp.blendEasing], "chunkProgress")
  20245. }
  20246. ,
  20247. n.prototype.warpTravel_STD = function(e) {
  20248. 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),
  20249. 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;
  20250. w += this.warpLength * c.warp.timePerMeter,
  20251. c.warp.flySpeed > .01 && (w = 1e3 * this.warpLength / c.warp.flySpeed);
  20252. var _ = !1
  20253. , T = this.warpDestHeroLoc.quaternion
  20254. , x = new r.Vector3(0,0,-1).applyQuaternion(T).normalize()
  20255. , S = this.warpPathPoints[this.warpPathPoints.length - 1].clone().sub(this.warpPathPoints[this.warpPathPoints.length - 2]).normalize()
  20256. , M = S.dot(x)
  20257. , R = r.Math.radToDeg(Math.acos(M))
  20258. , P = function(e) {
  20259. var t = o
  20260. , i = r.Math.smoothstep(e, 0, t) * (1 - r.Math.smoothstep(e, 1 - t, 1));
  20261. return i
  20262. }
  20263. , O = function() {
  20264. return E.lookAt(C, t, A.UP),
  20265. s.setFromRotationMatrix(E, c.warp.eOrder),
  20266. m.setFromQuaternion(n.quaternion, c.warp.eOrder),
  20267. b.set(s.x - m.x, s.y - m.y, s.z - m.z, c.warp.eOrder),
  20268. h.constrainedTurn(b.y)
  20269. }
  20270. .bind(this)
  20271. , L = function(e, t) {
  20272. if (this.warpInterrupted)
  20273. return _ = !0,
  20274. !0
  20275. }
  20276. .bind(this)
  20277. , D = function(e, t) {
  20278. return _ || !this.warpPathPoints ? (g.blur(0),
  20279. !0) : void g.blur(e)
  20280. }
  20281. .bind(this)
  20282. , N = u.allUniforms(this.model.chunks, "modelAlpha", 1)
  20283. , B = function(e, t) {
  20284. return _ || !this.warpPathPoints ? (N(0),
  20285. !0) : void N(e, t)
  20286. }
  20287. .bind(this)
  20288. , F = function(e, t) {
  20289. if (!this.warpPathPoints)
  20290. return n.position.copy(this.warpDestPano.position),
  20291. !0;
  20292. if (_)
  20293. return !0;
  20294. var i = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, e);
  20295. n.position.copy(i),
  20296. C = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, .99 * e)
  20297. }
  20298. .bind(this)
  20299. , V = function(e, n) {
  20300. return this.warpPathPoints ? !!_ || void (t = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, Math.min(e + i, 1))) : (y.debug("Lost bunny."),
  20301. !0)
  20302. }
  20303. .bind(this)
  20304. , U = function(e, o) {
  20305. if (_)
  20306. return y.debug(">>>> Walkthrough interupted at t=" + e),
  20307. !0;
  20308. if (!this.warpPathPoints)
  20309. return !0;
  20310. var a = this.warpLength * e
  20311. , l = r.Math.smoothstep(a, 0, this.brushPrefs.lookBlendDist)
  20312. , u = r.Math.smoothstep(a, this.warpLength - this.brushPrefs.lookBlendDist, this.warpLength);
  20313. c.warp.matchCam && (l *= 1 - u),
  20314. E.lookAt(C, t, A.UP),
  20315. s.setFromRotationMatrix(E, c.warp.eOrder),
  20316. m.setFromQuaternion(n.quaternion, c.warp.eOrder),
  20317. b.set(s.x - m.x, s.y - m.y, s.z - m.z, c.warp.eOrder),
  20318. b.y = h.constrainedTurn(b.y),
  20319. s.x = m.x + l * b.x,
  20320. s.y = m.y + l * b.y,
  20321. s.z = m.z + l * b.z,
  20322. b.set(s.x - v.x, s.y - v.y, s.z - v.z, c.warp.eOrder),
  20323. b.y = h.constrainedTurn(b.y);
  20324. var d = r.Math.degToRad(c.warp.maxTurnPerSec) * o / 1e3;
  20325. b.y = Math.sign(b.y) * Math.min(d, Math.abs(b.y)),
  20326. v.x = v.x + b.x * c.warp.turnFriction,
  20327. v.y = v.y + b.y * c.warp.turnFriction,
  20328. v.z = v.z + b.z * c.warp.turnFriction,
  20329. v.x = Math.max(r.Math.degToRad(c.warp.minDownAngle), v.x);
  20330. var p = t.clone().sub(C).normalize();
  20331. if (R < c.warp.maxAimRotation && u > 0) {
  20332. var g = 1 - u;
  20333. p.x = p.x * g + u * S.x,
  20334. p.y = p.y * g + u * S.y,
  20335. p.z = p.z * g + u * S.z,
  20336. p.normalize()
  20337. }
  20338. this.bunnyObj.position.copy(n.position).add(p),
  20339. f.set(0, 0, -1).applyEuler(v).normalize(),
  20340. f.multiplyScalar(8),
  20341. f.add(n.position),
  20342. e > 1 - i && c.warp.matchCam || (n.controls.lookAt(f),
  20343. n.controls.lookVector.copy(f),
  20344. n.lookAt(f))
  20345. }
  20346. .bind(this)
  20347. , k = function() {
  20348. _ ? (this.discardSlow(),
  20349. this.upcomingTransType = l.BLACK,
  20350. this.warpTravel_BLACK(-.5, this.warpInterruptionTravelTime, I.BEGINNING, e)) : this._wrapupWarpShading(e)
  20351. }
  20352. .bind(this);
  20353. V(0);
  20354. var H = c.warp.motionLeadTime + 1e3 * Math.abs(O()) / r.Math.degToRad(c.warp.maxTurnPerSec);
  20355. w += H;
  20356. var G = H / w;
  20357. this.warpCommonParameters(w, G, !0, I.NONE),
  20358. p.start(L, w, null, 0, null, "_haltWatcher"),
  20359. c.warp.blur > 0 && (g.blurStrength = c.warp.blur,
  20360. p.start(D, w, null, G, P, "blurring")),
  20361. p.start(B, w, null, G, P, "modelAlpha"),
  20362. p.start(F, w, null, G, d[c.warp.blendEasing], "followPath"),
  20363. p.start(V, w, null, G, d[c.warp.blendEasing], "goBunny"),
  20364. p.start(U, w, k, 0, d[c.warp.blendEasing], "lookAtBunny")
  20365. }
  20366. ,
  20367. n.prototype.warpTravel_BLACK = function(e, t, i, n) {
  20368. var r = e || 0;
  20369. void 0 !== t && null !== t || (t = c.warp.teleportTime)
  20370. //add
  20371. var done = ()=>{
  20372. Hot.updateVisibles([this.player.currentPano]) //更新热点显示
  20373. this.player.transitionPos({type:"beforeFlytopano", pano:this.player.currentPano, dur:100})//add
  20374. }
  20375. if(momentTourBlackNewType){
  20376. player.sceneRenderer.effects.transitionMaskPass.start(player.sceneRenderer)
  20377. var camera = this.playerControls.cameras[a.PANORAMA];
  20378. var end = this.warpDestHeroLoc.position
  20379. camera.position.copy(end)
  20380. setTimeout(()=>{
  20381. player.sceneRenderer.effects.transitionMaskPass.stop()
  20382. this.wrapupWarpShadingOnly(n, i);
  20383. done()
  20384. },t)
  20385. }else{
  20386. var o = function() {
  20387. this.wrapupWarpShadingOnly(n, i);
  20388. done()
  20389. }
  20390. .bind(this);
  20391. var firstPos = this.player.position.clone()//add
  20392. p.start(this.stepWarpPath.bind(this, firstPos), t, o, r, d[c.warp.blendEasing], "stepMotion")
  20393. }
  20394. this.warpCommonParameters(t, r, !1, i)
  20395. this.model.chunks.concat(this.model.skybox).forEach(function(e) {// 改
  20396. if(window.momentTourBlackNewType){
  20397. e.material.uniforms.blackout.value = 5//i 改
  20398. //e.material.defines.newBlack = ''
  20399. //e.material.needsUpdate = true
  20400. }else{
  20401. e.material.uniforms.blackout.value = i
  20402. }
  20403. }),
  20404. this._warpBendAim(null, t, null, r);
  20405. }
  20406. ,
  20407. n.prototype.flightStepWalk = function(e, t, i) {
  20408. var n = .001
  20409. , o = 1
  20410. , a = 1.2
  20411. , s = new r.Vector3
  20412. , h = new r.Vector3
  20413. , u = function(e, t) {
  20414. //导览速度
  20415. var i = Math.min(this.player.position.distanceTo(e.position), c.transition.flytimeMaxDistanceThreshold)
  20416. // , r = i * c.transition.flytimeDistanceMultiplier + c.transition.flyTime;
  20417. , r = i * c.warp.flytimeDistanceMultiplier + c.warp.flyTime;
  20418. h.copy(A.FORWARD),
  20419. this.player.getDirection(h),
  20420. s.copy(t).sub(e.position).normalize();
  20421. var l = s.dot(h)
  20422. , u = Math.acos(l)
  20423. , d = u / r;
  20424. d > n && (r *= d / n,
  20425. u < o && (r *= a))
  20426. return r / DATA.tourWalkSpeed * 100 // 改
  20427. };
  20428. return function(e, t, i) {
  20429. if (this.warpInterrupted)
  20430. i && i();
  20431. else if (this.activeTransType !== l.WALK)
  20432. this._clearWarpShading(),
  20433. this._warpStopFlying(),
  20434. this.player.spider.draw(),
  20435. this.placeCpm(),
  20436. i && i();
  20437. else if (this.player.currentPano !== e) {
  20438. var n = {
  20439. pano: e,
  20440. lookAtPoint: t,
  20441. duration: null,
  20442. maxDistanceOverride: c.warp.walkMaxDist,
  20443. skipWarpingCheck: !1,
  20444. constantMoveSpeed: !0
  20445. };
  20446. if(e == this.warpDestPano){//到达终点前,放大到终点的zoom
  20447. n.zoomLevel = this.warpDestHeroLoc.zoom
  20448. }
  20449. n.duration = u.call(this, e, t),
  20450. this.player.nonInterruptingFlyToPano(n, i)
  20451. } else
  20452. i && i()
  20453. }
  20454. }(),
  20455. n.prototype.makeWalkFlightFunc = function(e, t, i) {
  20456. return this.flightStepWalk.bind(this, e, t, i)
  20457. }
  20458. ,
  20459. n.prototype.warpTravel_WALK = function() {
  20460. var e = [];
  20461. return function(t) {
  20462. var i = this.player.model.panos;
  20463. e.length = 0;
  20464. for (var n = null, o = !1, a = 0; a < this.nodes.length; a++) {
  20465. var s = this.nodes[a]
  20466. , l = i.get(s);
  20467. a === this.nodes.length - 1;
  20468. o = n && l.position.distanceTo(n.position) < c.warp.walkMinDist,
  20469. n && o || (e.push(s),
  20470. n = l)
  20471. }
  20472. o && this.nodes.length > 1 && (e[e.length - 1] = this.nodes[this.nodes.length - 1]);
  20473. var h = e.length
  20474. , u = i.get(e[h - 1])
  20475. , d = new Array(h + 1);
  20476. d[d.length - 1] = function() {
  20477. t && t()
  20478. }
  20479. .bind(this);
  20480. for (var p = h - 1, f = d.length - 1; f > 0; f -= 1) {
  20481. var g = e[p];
  20482. u = i.get(g);
  20483. var m = new r.Vector3;
  20484. this.getLookAtForWalkingTourNode(e, p, m),
  20485. d[f - 1] = this.makeWalkFlightFunc(u, m, d[f]),
  20486. p--
  20487. }
  20488. d[0]()
  20489. }
  20490. }(),
  20491. n.prototype.getLookAtForWalkingTourNode = function() {
  20492. var e = new r.Vector3
  20493. , t = new r.Vector3
  20494. , i = new r.Vector3
  20495. , n = new r.Vector3
  20496. , o = new r.Vector3
  20497. , a = .65
  20498. , s = .75
  20499. , l = .2
  20500. , c = .4
  20501. , h = .2
  20502. , u = 3;
  20503. return function(r, d, p) {
  20504. var f = r.length;
  20505. if (d >= f)
  20506. return !1;
  20507. var g = 1
  20508. , m = 1;
  20509. t.set(0, 0, 0),
  20510. o.set(0, 0, 0);
  20511. for (var v = null, A = d; A < d + u && !(A >= f); A++) {
  20512. if (v = this.player.model.panos.get(r[A]),
  20513. this.getOrientationForWalkingTourNode(r, A, i),
  20514. A === d && e.copy(i),
  20515. n.copy(i),
  20516. A > d) {
  20517. var y = n.dot(e) < a;
  20518. g *= y ? l : s,
  20519. m *= y ? h : c
  20520. }
  20521. i.multiplyScalar(g),
  20522. t.add(i),
  20523. o.lerp(v.position, m)
  20524. }
  20525. return t.normalize(),
  20526. p.copy(o),
  20527. p.add(t),
  20528. !0
  20529. }
  20530. }(),
  20531. n.prototype.getOrientationForWalkingTourNode = function(e, t, i) {
  20532. var n = e.length;
  20533. if (t >= n)
  20534. return !1;
  20535. if (t === n - 1)
  20536. i.copy(A.FORWARD).applyQuaternion(this.warpDestHeroLoc.quaternion);
  20537. else {
  20538. var r = this.player.model.panos.get(e[t])
  20539. , o = this.player.model.panos.get(e[t + 1]);
  20540. i.copy(o.position).sub(r.position)
  20541. }
  20542. return i.normalize(),
  20543. !0
  20544. }
  20545. ,
  20546. n.prototype.warpCameraTravel = function(e, t, i, n) {
  20547. if (this.activeTransType = this.upcomingTransType,
  20548. this.lastTransType = this.activeTransType,
  20549. this.upcomingTransType = null,
  20550. !e) {
  20551. var r = function() {
  20552. this._wrapupTravel(n)
  20553. }
  20554. .bind(this)
  20555. , o = {
  20556. pano: this.warpDestPano,
  20557. lookAtPoint: null,
  20558. duration: null,
  20559. maxDistanceOverride: null,
  20560. skipWarpingCheck: !1
  20561. };
  20562. return void this.player.flyToPano(o, r)
  20563. }
  20564. this.activeTransType === l.BLACK ? this.warpTravel_BLACK(null, i, t, n) : this.activeTransType === l.WALK ? this.warpTravel_WALK(function() {
  20565. this._clearWarpShading(),
  20566. this._warpStopFlying(),
  20567. this.player.spider.draw(),
  20568. this.placeCpm(),
  20569. n && n()
  20570. }
  20571. .bind(this)) : this.warpTravel_STD(n)
  20572. }
  20573. ,
  20574. n.prototype.startWarpState = function() {
  20575. this.warping = !0,
  20576. this.warpInterrupted = !1,
  20577. this.warpInterruptionBlackoutStyle = null,
  20578. this.warpInterruptionTravelTime = null
  20579. }
  20580. ,
  20581. n.prototype.endWarpState = function() {
  20582. this.warping = !1
  20583. }
  20584. ,
  20585. n.prototype.warpToPano = function(e, t, i, n) {
  20586. if (this.warping)
  20587. return void y.warn("Cannot warp when already warping");
  20588. if (this.upcomingTransType = e,
  20589. this.activeTransType = null,
  20590. !this.setWarpDestPano())
  20591. return this.upcomingTransType = null,
  20592. void this.warpToNonPano(n);
  20593. if (this.player.mode !== a.PANORAMA)
  20594. return this.upcomingTransType = null,
  20595. this.discardSlow(),
  20596. void this.player.flyToNewMode({
  20597. mode: a.PANORAMA,
  20598. pano: this.warpDestPano,
  20599. duration: c.warp.outsideTime,
  20600. warpDest: this.warpDestHeroLoc,
  20601. callback: n,
  20602. force: !0
  20603. });
  20604. if (!this.warpDestPano)
  20605. return y.warn("no warp destination, callback dropped"),
  20606. void (this.upcomingTransType = null);
  20607. 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)
  20608. , o = this.chooseWarpPath(r);
  20609. if (o && this.upcomingTransType !== l.WALK) {
  20610. var s = function() {
  20611. this.waitingToWarp = !1,
  20612. this.warpToPano(e, t, i, n)
  20613. }
  20614. .bind(this);
  20615. if (this.player.checkAndWaitForPanoLoad(this.warpDestPano, "high", "low", this.player.basePanoSize, s))
  20616. return void (this.waitingToWarp = !0)
  20617. }
  20618. this.player.currentPano || (y.warn("Arrived at a very strange spot!"),
  20619. this.player.currentPano = this.warpDestPano,
  20620. this.placeCpm(),
  20621. this.fadeOutCpm(c.path.fadeOutTime),
  20622. this.player.spider.draw()),
  20623. y.debug("Warping to pano ", this.warpDestPano.position),
  20624. this.upcomingTransType !== l.WALK && this.player.emit(C.PanoChosen, this.player.currentPano, this.warpDestPano),
  20625. this.startWarpState();
  20626. var h = function() {
  20627. this.endWarpState(),
  20628. n && n()
  20629. }
  20630. .bind(this);
  20631. o ? this.warpCameraTravel(r, t, i, h) : this.warpCameraAim(h)
  20632. //this.player.smoothZoomToDefault(c.zoom.restoreTime);
  20633. }
  20634. ,
  20635. t.exports = n
  20636. }
  20637. ).call(this, "/js/objects/ShowPath.js")
  20638. }
  20639. , {
  20640. "../constants": 8,
  20641. "../effects": 16,
  20642. "../enum/BlackoutStyle": 18,
  20643. "../enum/ModelManagerEvents": 33,
  20644. "../enum/PlayerEvents": 40,
  20645. "../enum/RenderOrder": 42,
  20646. "../enum/Vectors": 50,
  20647. "../enum/Viewmode": 51,
  20648. "../enum/WarpStyle": 52,
  20649. "../gui/gui": 65,
  20650. "../model/ModelManager": 140,
  20651. "../objects/Snapshot": 153,
  20652. "../settings": 166,
  20653. "../shaders": 167,
  20654. "../util/easing": 186,
  20655. "../util/lerp": 188,
  20656. "../util/logger": 189,
  20657. "../util/math": 190,
  20658. "../util/texture": 194,
  20659. "../util/transitions": 195,
  20660. three: 217
  20661. }],
  20662. 152: [function(e, t, i) {
  20663. "use strict";
  20664. function n() {
  20665. var e = new r.SphereBufferGeometry(a.skyboxRadius,20,5)
  20666. , t = new r.RawShaderMaterial({
  20667. fragmentShader: o.skysphere.fragmentShader,
  20668. vertexShader: o.skysphere.vertexShader,
  20669. uniforms: r.UniformsUtils.clone(o.skysphere.uniforms),
  20670. side: r.BackSide,
  20671. name: "skysphere"
  20672. });
  20673. t.uniforms.radius.value = e.parameters.radius,
  20674. r.Mesh.call(this, e, t)
  20675. }
  20676. var r = e("three")
  20677. , o = e("../shaders")
  20678. , a = e("../settings");
  20679. n.prototype = Object.create(r.Mesh.prototype),
  20680. n.prototype.constructor = n,
  20681. t.exports = n
  20682. }
  20683. , {
  20684. "../settings": 166,
  20685. "../shaders": 167,
  20686. three: 217
  20687. }],
  20688. 153: [function(e, t, i) {
  20689. (function(i) {
  20690. "use strict";
  20691. function n(e) {
  20692. o.call(this, e),
  20693. this.sid = e.sid,//xzw add
  20694. this.panoId = e.panoId,
  20695. this.orthoZoom = e.orthoZoom,
  20696. this.floorVisibility = e.floorVisibility,
  20697. this.thumbUrl = e.thumbUrl,
  20698. this.name = e.name,
  20699. this.zoom = e.zoom
  20700. }
  20701. var r = (e("three"),
  20702. e("../util/logger"))
  20703. , o = (e("../settings"),
  20704. e("../enum/Viewmode"),
  20705. e("../util/common"),
  20706. e("../util/transitions"),
  20707. e("../util/lerp"),
  20708. e("../util/ajax"),
  20709. e("../util/texture"),
  20710. e("./View"));
  20711. e("events").EventEmitter,
  20712. new r(i);
  20713. n.prototype = Object.create(o.prototype),
  20714. n.prototype.isPano = function() {
  20715. return this.panoId && "" !== this.panoId && this.panoId != "outside"
  20716. }
  20717. ,
  20718. t.exports = n
  20719. }
  20720. ).call(this, "/js/objects/Snapshot.js")
  20721. }
  20722. , {
  20723. "../enum/Viewmode": 51,
  20724. "../settings": 166,
  20725. "../util/ajax": 181,
  20726. "../util/common": 185,
  20727. "../util/lerp": 188,
  20728. "../util/logger": 189,
  20729. "../util/texture": 194,
  20730. "../util/transitions": 195,
  20731. "./View": 154,
  20732. events: 202,
  20733. three: 217
  20734. }],
  20735. 154: [function(e, t, i) {
  20736. (function(i) {
  20737. "use strict";
  20738. function n(e) {
  20739. e = e || {},
  20740. this.position = new r.Vector3,
  20741. this.quaternion = new r.Quaternion,
  20742. this.update(e)
  20743. }
  20744. var r = e("three")
  20745. , o = e("../util/logger")
  20746. , a = (e("../settings"),
  20747. e("../enum/Viewmode"),
  20748. e("../util/common"),
  20749. e("../util/transitions"),
  20750. e("../util/lerp"),
  20751. e("../util/ajax"),
  20752. e("../util/texture"),
  20753. e("events").EventEmitter);
  20754. new o(i);
  20755. n.prototype = Object.create(a.prototype),
  20756. n.prototype.isValid = function() {
  20757. return !!this.cameraMode
  20758. }
  20759. ,
  20760. n.prototype.update = function(e) {
  20761. return this.cameraMode = e.cameraMode || this.cameraMode,
  20762. this.pano = e.pano || this.pano,
  20763. e.position && this.position.copy(e.position),
  20764. e.quaternion && this.quaternion.copy(e.quaternion),
  20765. this
  20766. }
  20767. ,
  20768. t.exports = n
  20769. }
  20770. ).call(this, "/js/objects/View.js")
  20771. }
  20772. , {
  20773. "../enum/Viewmode": 51,
  20774. "../settings": 166,
  20775. "../util/ajax": 181,
  20776. "../util/common": 185,
  20777. "../util/lerp": 188,
  20778. "../util/logger": 189,
  20779. "../util/texture": 194,
  20780. "../util/transitions": 195,
  20781. events: 202,
  20782. three: 217
  20783. }],
  20784. 155: [function(e, t, i) {//player.js
  20785. (function(i) {
  20786. "use strict";
  20787. function n(e) {
  20788. this.currentPano = null,
  20789. this.nextPano = null,
  20790. this.camera = null,
  20791. this.paused = !1,
  20792. this.flying = !1,
  20793. this.sceneIntersectionPlane = null,
  20794. this.target = new r.Vector3,
  20795. this.mouse = new r.Vector3(1.1,1.1,.5),
  20796. this.mouseAtMouseDown = new r.Vector2,
  20797. this.mouseCouldBeClickToMove = !1,
  20798. this.mouseLastMoveTime = Date.now(),
  20799. this.mouseDown = !1,
  20800. this.mouseDownTimer = null,
  20801. this.couldBeLongTap = !1,
  20802. this.containsMouse = !1, //
  20803. this.isTouchEvent = !1,
  20804. this.isPanoHover = !1,
  20805. this.reticule = new a(this),
  20806. this.panoMarkers = [],
  20807. this.spider = new h(this),
  20808. this.quaternion = new r.Quaternion,
  20809. this.position = new r.Vector3(15,10,15),
  20810. this.previousState = null,
  20811. this.lastInsideView = new c,
  20812. this.last360View = new c,
  20813. this.raycaster = new r.Raycaster,
  20814. this.intersect = null,
  20815. this.lastChangeTime = Date.now(),
  20816. this.history = new I,
  20817. this.cameraControls = null,
  20818. this.path = null,
  20819. this.model = null,
  20820. this.domElement = null,
  20821. this.cachedPanoCandidates = null,
  20822. this.basePanoSize = 0,
  20823. this.standardPanoSize = 0,
  20824. this.highPanoSize = 0,
  20825. this.ultraHighPanoSize = 0,
  20826. this.zoomLevel = 1,
  20827. this.zooming = 0,
  20828. this.zoomSpeed = .5,
  20829. this.scrollZoomSpeed = .06,
  20830. this.zoomSpeedAdjust = .05,
  20831. this.defaultZoomIncrement = .2,
  20832. this.baseFov = f.insideFOV,
  20833. this.zoomFov = this.baseFov,
  20834. this.zoomEnabled = !0,
  20835. this.preRenderingEnabled = !1,
  20836. this.setupCustomProperties(e),
  20837. this.zoomStats = new L
  20838. }
  20839. var r = e("three")
  20840. , o = e("./util/logger")
  20841. , a = e("./objects/Reticule")
  20842. , s = e("./objects/Panorama")
  20843. , l = e("./objects/ShowPath")
  20844. , c = e("./objects/View")
  20845. , h = (e("./objects/Snapshot"),
  20846. e("./objects/NSpider"))
  20847. , u = e("./enum/Viewmode")
  20848. , d = (e("./enum/TagStates"),
  20849. e("./enum/Vectors"))
  20850. , p = e("./enum/Keys")
  20851. , f = (e("./enum/AlignmentType"),
  20852. e("./settings"))
  20853. , g = e("./util/common")
  20854. , m = (e("./util/browser"),
  20855. e("./util/math"))
  20856. , v = e("./util/lerp")
  20857. , A = e("./util/easing")
  20858. , y = e("./util/transitions")
  20859. , C = e("events").EventEmitter
  20860. , I = (e("./shaders"),
  20861. e("./util/history"))
  20862. , E = (e("./util/camera"),
  20863. e("./model/ModelManager"),
  20864. e("./enum/PathDiscardMode"))
  20865. , b = e("./enum/PathDisplayMode")
  20866. , w = e("./enum/PlayerEvents")
  20867. , _ = e("./enum/ControlEvents")
  20868. , T = e("./enum/ModelManagerEvents")
  20869. , x = e("./enum/WarpStyle")
  20870. , S = e("./enum/BlackoutStyle")
  20871. , M = e("./exception/BasicException")
  20872. , R = e("./enum/PanoSizeClass")
  20873. , P = (e("./tile/TileDownloader"),
  20874. e("./tile/TilePrioritizer"))
  20875. , O = (e("./enum/PanoramaEvents"),
  20876. e("./enum/ZoomEvents"))
  20877. , L = e("./util/ZoomStats")
  20878. , D = e("./constants")
  20879. , N = e("./util/common")
  20880. , B = e("./util/cameraLight")
  20881. //, Hot = e('hot')
  20882. , F = new o(i)
  20883. , V = Object.freeze({
  20884. FlyToPano: y.getUniqueId(),
  20885. FlyToNewMode: y.getUniqueId(),
  20886. FlyToSameMode: y.getUniqueId(),
  20887. FlyToViewFloor: y.getUniqueId(),
  20888. LookTransition: y.getUniqueId(),
  20889. ZoomTransition: y.getUniqueId()
  20890. });
  20891. n.prototype = Object.create(C.prototype),
  20892. n.prototype.init = function(e) {
  20893. window.player = this
  20894. this.modelManager = e.modelManager,
  20895. this.tileDownloader = e.tileDownloader,
  20896. this.panoRenderer = e.panoRenderer,
  20897. this.qualityManager = e.qualityManager,
  20898. this.domElement = e.container,
  20899. this.camera = e.camera,
  20900. this.tagManager = e.tagManager,
  20901. this.cameraControls = e.controls,
  20902. this.path = new l(e.director,this,e.controls),
  20903. this.basePanoSize = this.qualityManager.getPanoSize(R.BASE),
  20904. this.standardPanoSize = this.qualityManager.getPanoSize(R.STANDARD),
  20905. this.highPanoSize = this.qualityManager.getPanoSize(R.HIGH),
  20906. this.ultraHighPanoSize = this.qualityManager.getPanoSize(R.ULTRAHIGH),
  20907. this.tileDownloader.processPriorityQueue = !1,
  20908. this.tileDownloader.tilePrioritizer = new P(this.qualityManager,this.basePanoSize,this.standardPanoSize,this.highPanoSize,this.ultraHighPanoSize),
  20909. this.bindEvents(e.container),
  20910. this.updateModel()
  20911. this.modeTran = ''
  20912. }
  20913. //xzw add: 截图
  20914. function dataURLtoBlob(dataurl) {
  20915. var arr = dataurl.split(','), mime = arr[0].match(/:(.*?);/)[1],
  20916. bstr = atob(arr[1]), n = bstr.length, u8arr = new Uint8Array(n);
  20917. while(n--){
  20918. u8arr[n] = bstr.charCodeAt(n);
  20919. };
  20920. return new Blob([u8arr], {type:mime});
  20921. }
  20922. n.prototype.screenShot = function(o){
  20923. if(this.flying || this.flyingToTag) return;
  20924. var R = this.sceneRenderer;
  20925. R.updateScreenSize(o);
  20926. for(var i in this.model.panos.index){
  20927. if(!this.model.panos.index[i].marker) continue;
  20928. this.model.panos.index[i].marker.forceHide = this.model.panos.index[i].marker.visible;
  20929. this.model.panos.index[i].marker.visible = false;
  20930. }
  20931. for(var i in this.model.hots){
  20932. this.model.hots[i].mesh.visible = false;
  20933. }
  20934. this.reticule.visible = false;
  20935. this.reticule.forceUnvisible = true;
  20936. this.path.currentPanoMarker.mesh.visible = false;
  20937. setTimeout(function(){//因resize效用没办法立即生效(原因未知),故而延后
  20938. R.renderer.clear(true,true,true);
  20939. R.renderer.render(R.scene, R.camera);
  20940. var imgData = R.renderer.domElement.toDataURL(o.type,0.9);
  20941. o.f && o.f(imgData)
  20942. R.updateScreenSize({resize:true});
  20943. this.reticule.visible = true;
  20944. for(var i in this.model.hots){
  20945. this.model.hots[i].mesh.visible = true;
  20946. }
  20947. for(var i in this.model.panos.index){
  20948. this.model.panos.index[i].marker.visible = this.model.panos.index[i].marker.forceHide;
  20949. }
  20950. this.path.currentPanoMarker.mesh.visible = true;
  20951. R.renderer.render(R.scene, R.camera);
  20952. }.bind(this),30) //这个数字不能太小
  20953. }
  20954. var scaleImg = e("scaleImg");
  20955. var ResizeImg = function(img, option){
  20956. var img2; //不能直接改img 否则可能触发第二次img.onload
  20957. var compress = function(ratio,type){
  20958. var image = img2 || img;
  20959. var c = document.createElement('canvas');
  20960. c.width = image.width; c.height = image.height;
  20961. var ctx = c.getContext('2d');
  20962. ctx.drawImage(image,0,0,image.width,image.height);
  20963. img2 = scaleImg(ratio/* option.maxSize/oldSize */, c, type/* option.type||"png" */);//最大不能超过0.8M
  20964. }
  20965. var reCom = function(){ //如果有了img2 就只需要img2 否则创造新的img2
  20966. var image = img2 || img;
  20967. var blob = dataURLtoBlob(image.src);
  20968. if(option.maxWeight && blob.size > option.maxWeight){
  20969. compress(option.maxWeight/blob.size, "jpeg")
  20970. blob = dataURLtoBlob(image.src);
  20971. }
  20972. if(!img2){
  20973. img2 = new Image();
  20974. }
  20975. img2.base64Src = image.src;
  20976. img2.src = window.URL.createObjectURL(blob);
  20977. }
  20978. var oldSize = Math.max(img.width, img.height);
  20979. if(option.toType != "png"){//不是非要png的话
  20980. if(option.oldType == "jpeg"){//jpeg先判断尺寸,然后是尺寸
  20981. if(oldSize > option.maxSize){
  20982. compress(option.maxSize/oldSize, "jpeg");
  20983. }
  20984. reCom();
  20985. }else if(option.oldType == "png"){//png先判断数据量 如果数据量达标,就无视大小(有可能超出大小)
  20986. if(option.maxWeight && option.weight > option.maxWeight){//如果一开始大小不大就不压缩 还是png
  20987. compress(oldSize>option.maxSize ? option.maxSize/oldSize : 1, "jpeg");
  20988. reCom();
  20989. }
  20990. }
  20991. }else{
  20992. //?貌似png会越压缩越大?
  20993. }
  20994. return img2 || img;
  20995. }
  20996. var _fixType=function(type) {
  20997. type = type.toLowerCase().replace(/jpg/i, 'jpeg');
  20998. var r = type.match(/png|jpeg|bmp|gif/)[0];
  20999. return 'image/' + r;
  21000. };
  21001. var saveFile=function(data, filename){
  21002. var save_link = document.createElementNS('http://www.w3.org/1999/xhtml', 'a');
  21003. save_link.href = data;
  21004. save_link.download = filename;
  21005. var event = document.createEvent('MouseEvents');
  21006. event.initMouseEvent('click', true, false, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
  21007. save_link.dispatchEvent(event);
  21008. };
  21009. n.prototype.getWrapShot = function(){ //获取导览点截图/初始画面和信息
  21010. var info = this.getSnapAngleInfo();
  21011. var str = ',{\r\t' + info;
  21012. var arg = arguments[0];
  21013. this.screenShot({ width:g_snapShotWidth*4, height:g_snapShotHeight*4, type:"image/jpeg", f:function(imgData){
  21014. if (arg && arg.__callback) {
  21015. return arg.__callback(imgData, info)
  21016. }
  21017. var img = new Image();
  21018. img.src = imgData;
  21019. img.onload = function(){
  21020. var img2 = ResizeImg(this,{maxSize: g_snapShotWidth, oldType:"jpeg"}); //暂定缩略图大小
  21021. img2.src.replace(_fixType("image/jpeg"),'image/octet-stream');
  21022. var filename = "snap" + (new Date()).getTime();
  21023. saveFile(img2.src,filename + ".jpg");
  21024. str +=(',\r\t"thumbnail_signed_src":"'+filename+'.jpg",');
  21025. str +=('\r\t"sid":"'+filename+'",');
  21026. str +=('\r\t"name":"'+filename+'"\r}');
  21027. logData(str)
  21028. }
  21029. }});
  21030. }
  21031. ,
  21032. n.prototype.getSnapAngleInfo = function(){
  21033. var info = {};
  21034. var str = '"metadata":{';
  21035. var q = this.camera.quaternion.clone();
  21036. switch (this.mode) {
  21037. case "panorama":
  21038. info.scan_id = this.currentPano.id;
  21039. str += ('"scan_id":"'+this.currentPano.id+'",');
  21040. break;
  21041. case "floorplan":
  21042. info.camera_mode = 1;
  21043. q = (new r.Quaternion).setFromAxisAngle(new r.Vector3(0,1,0), r.Math.degToRad(90))
  21044. q.multiply(this.camera.quaternion);
  21045. str += ('"camera_mode":1,');
  21046. //str += ('"ortho_zoom":'+m.toPrecision(this.cameraControls.activeControl.currentScale * $("#player").height() / $("#player").width() * D.workshopApsect * 16, 4)+",");
  21047. str += ('"ortho_zoom":'+ m.toPrecision(this.cameraControls.activeControl.currentScale, 4 )+",");
  21048. break;
  21049. case "dollhouse":
  21050. info.camera_mode = 2;
  21051. str += ('"camera_mode":2,');
  21052. break;
  21053. }
  21054. info.camera_position = m.toPrecision(this.camera.position.toArray(),4);
  21055. console.log(info.camera_position)
  21056. if(window.screenSta === 'tour'){ // fyz 导览截屏需要做额外的
  21057. /**fyz 对相机截屏的角度进行校对 */
  21058. var out = new r.Quaternion(q.x, q.y, q.z, q.w)
  21059. out.multiply(new r.Quaternion(Math.sqrt(2) / 2, Math.sqrt(2) / 2, 0, 0).conjugate())
  21060. out.x *= -1;
  21061. out.w *= -1;
  21062. info.camera_quaternion = m.toPrecision(out.toArray(),4);
  21063. }else{
  21064. info.camera_quaternion = m.toPrecision(q.toArray(),4);;
  21065. }
  21066. info.zoom = this.zoomLevel;
  21067. console.log(info.camera_quaternion)
  21068. // str += ( '"camera_position":['+ info.camera_position + '],"camera_quaternion":['+info.camera_quaternion+"]}");
  21069. // fyz 扩展编辑页面, 加上导览点缩放值
  21070. str += ( '"camera_position":['+ info.camera_position + '],"camera_quaternion":['+info.camera_quaternion+'], "zoom":' + info.zoom + '}');
  21071. return str;
  21072. }
  21073. //------end
  21074. n.prototype.setupCustomProperties = function(e) {
  21075. var t = e || u.PANORAMA;
  21076. Object.defineProperty(this, "mode", {
  21077. get: function() {
  21078. return t
  21079. },
  21080. set: function(e) {
  21081. var i = t;
  21082. t = e,
  21083. this.onModeUpdated(i, t)
  21084. }
  21085. })
  21086. }
  21087. ,
  21088. n.prototype.isInMode = function() {
  21089. for (var e = 0; e < arguments.length; e++)
  21090. if (this.mode === arguments[e])
  21091. return !0;
  21092. return !1
  21093. }
  21094. ,
  21095. n.prototype.isOutsideMode = function(e) {
  21096. return e = e || this.mode,
  21097. e === u.DOLLHOUSE || e === u.FLOORPLAN
  21098. }
  21099. ,
  21100. n.prototype.is360View = function(e, t) {
  21101. return e === u.PANORAMA && t && !t.isAligned()
  21102. }
  21103. ,
  21104. n.prototype.setScene = function(e) {
  21105. this.sceneIntersectionPlane = e.plane,
  21106. this.path.setScene(e),
  21107. this.moveReticuleToScene(e)
  21108. }
  21109. ,
  21110. n.prototype.moveReticuleToScene = function(e) {
  21111. this.reticule.parent && this.reticule.parent.remove(this.reticule),
  21112. e.add(this.reticule)
  21113. }
  21114. ,
  21115. n.prototype.updateModel = function() {
  21116. function e(e, t, n) {
  21117. this.mode === u.DOLLHOUSE && e !== n && i.call(this, e.center.y)
  21118. }
  21119. function t(e, t) {
  21120. if (this.mode === u.DOLLHOUSE) {
  21121. var n = e ? this.model.center.y : n = t.center.y;
  21122. i.call(this, n)
  21123. }
  21124. }
  21125. function i(e) {
  21126. var t = this.cameraControls.cameras[u.DOLLHOUSE]
  21127. , i = this.cameraControls.controls[u.DOLLHOUSE]
  21128. , n = t.position.y + (e - i.target.y)
  21129. , r = f.showFloorDuration + f.showFloorDelay;
  21130. y.start(v.property(i.target, "y", e), r, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToViewFloor),
  21131. y.start(v.property(t.position, "y", n), r, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToViewFloor)
  21132. }
  21133. this.model = this.modelManager.getActiveModel(),
  21134. this.model.on("floor.changed", e.bind(this)),
  21135. this.model.on("allfloors.toggled", t.bind(this)),
  21136. this.on(w.PanoChosen, this.model.setProjectedPanos.bind(this.model));
  21137. /*******************************************************************VR fyz改 from徐世廷*******************************************************************/
  21138. var e2 = this;
  21139. this.model.panos.list.forEach(function(a) {
  21140. a.vrMarker.addEventListener("click", function() {
  21141. e2.flyToPano({
  21142. pano: a
  21143. })
  21144. })
  21145. })
  21146. /********************************************************************************************************************************************/
  21147. }
  21148. ,
  21149. n.prototype.updateModelDependentData = function() {
  21150. this.cameraControls.setModelForControls(this.model),
  21151. this.getPanoMarkersFromModel(this.model)
  21152. }
  21153. ,
  21154. n.prototype.onModelChanged = function() {
  21155. this.updateModel(),
  21156. this.updateModelDependentData()
  21157. }
  21158. ,
  21159. n.prototype.getPanoMarkersFromModel = function(e) {
  21160. this.panoMarkers = e.panos.list.reduce(function(e, t) {
  21161. return t.marker ? e.concat(t.marker) : e
  21162. }, [])
  21163. }
  21164. ,
  21165. n.prototype.handleControlMove = function(e) {
  21166. this.emit(w.Move, e)
  21167. }
  21168. ,
  21169. n.prototype.handleControlInputStart = function(e) {
  21170. this.emit(w.InputStart, e)
  21171. }
  21172. ,
  21173. n.prototype.onModeUpdated = function(e, t) {
  21174. this.cameraControls.activateControls(t),
  21175. this.emit(w.ModeChanged, e, t)
  21176. }
  21177. ,
  21178. n.prototype.isWarping = function() {//是否导览缓慢走向某个点
  21179. return this.path.warping
  21180. }
  21181. ,
  21182. n.prototype.isWaitingToWarp = function() {
  21183. return this.path.waitingToWarp
  21184. }
  21185. ,
  21186. n.prototype.getLabelScaleFactor = function() {
  21187. if (this.isOutsideMode()) {
  21188. var e = 10
  21189. , t = Math.sqrt(this.cameraControls.controls[u.FLOORPLAN].currentScale / e);
  21190. return t
  21191. }
  21192. return .5
  21193. }
  21194. ,
  21195. /* n.prototype.changeMusic = function() {//xzw add
  21196. if(!this.director.tourIsPlaying) this.director.bgmReplay()
  21197. } */
  21198. n.prototype.bindEvents = function(e) {
  21199. e !== document && e.setAttribute("tabindex", -1),
  21200. e.addEventListener("mousedown", this.onMouseDown.bind(this)),
  21201. e.addEventListener("mousemove", this.onMouseMove.bind(this)),
  21202. e.addEventListener("mouseover", this.onMouseOver.bind(this)),
  21203. e.addEventListener("mouseout", this.onMouseOut.bind(this)),
  21204. e.addEventListener("mouseup", this.onMouseUp.bind(this)),
  21205. this.modelManager.on(T.ActiveModelChanged, this.onModelChanged.bind(this)),
  21206. e.addEventListener("touchstart", this.onTouchStart.bind(this)),
  21207. e.addEventListener("touchmove", this.onTouchMove.bind(this)),
  21208. e.addEventListener("touchend", this.onTouchEnd.bind(this)),
  21209. e.addEventListener("pointerdown", this.onPointerDown.bind(this)),
  21210. e.addEventListener("pointermove", this.onPointerMove.bind(this)),
  21211. e.addEventListener("pointerup", this.onPointerUp.bind(this)),
  21212. e.addEventListener("pointerout", this.onPointerOut.bind(this)),
  21213. e.addEventListener("pointercancel", this.onPointerCancel.bind(this)),
  21214. document.addEventListener("keydown", this.onKeyDown.bind(this)),
  21215. this.cameraControls.on(_.Move, this.handleControlMove.bind(this)),
  21216. this.cameraControls.on(_.InputStart, this.handleControlInputStart.bind(this)),
  21217. this.cameraControls.on(_.Pinch, this.handleControlPinch.bind(this)),
  21218. this.cameraControls.on(_.Scroll, this.handleControlScroll.bind(this)),
  21219. window.addEventListener("snapshotBegin", this.getWrapShot.bind(this)),//xzw add
  21220. //window.addEventListener("tourAudioEnded", this.changeMusic.bind(this));//xzw add
  21221. // lzb
  21222. window.getSeft && getSeft(this);
  21223. }
  21224. ,
  21225. n.prototype.onMouseDown = function(e) {
  21226. e.currentTarget !== document && e.currentTarget.focus(),
  21227. 0 === e.button && (this.handleInputStart.call(this, e.clientX, e.clientY, !1),
  21228. this.updateIntersect())
  21229. }
  21230. ,
  21231. n.prototype.onMouseMove = function(e) {
  21232. this.isTouchEvent = !1,
  21233. this.handleInputMove.call(this, e.clientX, e.clientY, !1)
  21234. }
  21235. ,
  21236. n.prototype.onMouseOver = function(e) {
  21237. this.containsMouse = !0,
  21238. !this.mouseDown || 0 !== e.which && 0 !== e.buttons || (this.mouseDown = !1)
  21239. }
  21240. ,
  21241. n.prototype.onMouseOut = function(e) {
  21242. this.containsMouse = !1
  21243. }
  21244. ,
  21245. n.prototype.onMouseUp = function(e) {
  21246. this.handleInputEnd.call(this, e.clientX, e.clientY, !1);
  21247. }
  21248. ,
  21249. n.prototype.onTouchStart = function(e) {
  21250. if (e.currentTarget !== document && e.currentTarget.focus(),
  21251. !this.mouseDown) {
  21252. this.couldBeLongTap = !0;
  21253. var t = g.average(e.changedTouches, "clientX")
  21254. , i = g.average(e.changedTouches, "clientY");
  21255. this.handleInputStart.call(this, t, i, !0),
  21256. this.mouseDownTimer = setTimeout(function() {
  21257. this.updateIntersect(),
  21258. this.handleInputEnd.call(this, t, i, !0)
  21259. }
  21260. .bind(this), f.input.longTapThreshold)
  21261. }
  21262. }
  21263. ,
  21264. n.prototype.onTouchMove = function(e) {
  21265. var t = g.average(e.changedTouches, "clientX")
  21266. , i = g.average(e.changedTouches, "clientY");
  21267. this.handleInputMove.call(this, t, i, !0)
  21268. }
  21269. ,
  21270. n.prototype.onTouchEnd = function(e) {
  21271. if (clearTimeout(this.mouseDownTimer),
  21272. this.mouseDown) {
  21273. this.couldBeLongTap = !1,
  21274. this.updateIntersect();
  21275. var t = g.average(e.changedTouches, "clientX")
  21276. , i = g.average(e.changedTouches, "clientY");
  21277. this.handleInputEnd.call(this, t, i, !0)
  21278. }
  21279. }
  21280. ,
  21281. n.prototype.onPointerDown = function(e) {
  21282. return e.currentTarget !== document && e.currentTarget.focus(),
  21283. this.mouseDown || "mouse" === e.pointerType ? this.onMouseDown(e) : (this.couldBeLongTap = !0,
  21284. this.handleInputStart.call(this, e.clientX, e.clientY, !0),
  21285. void (this.mouseDownTimer = setTimeout(function() {
  21286. this.updateIntersect(),
  21287. this.handleInputEnd.call(this, e.clientX, e.clientY, !0)
  21288. }
  21289. .bind(this), f.input.longTapThreshold)))
  21290. }
  21291. ,
  21292. n.prototype.onPointerMove = function(e) {
  21293. "mouse" !== e.pointerType ? this.handleInputMove.call(this, e.clientX, e.clientY, !0) : this.onMouseMove(e)
  21294. }
  21295. ,
  21296. n.prototype.onPointerUp = function(e) {
  21297. return this.mouseDown && "mouse" !== e.pointerType ? (clearTimeout(this.mouseDownTimer),
  21298. this.couldBeLongTap = !1,
  21299. this.updateIntersect(),
  21300. void this.handleInputEnd.call(this, e.clientX, e.clientY, !0)) : this.onMouseUp(e)
  21301. }
  21302. ,
  21303. n.prototype.onPointerOut = function(e) {
  21304. this.mouseDown = !1
  21305. }
  21306. ,
  21307. n.prototype.onPointerCancel = function(e) {
  21308. this.mouseDown = !1
  21309. }
  21310. ,
  21311. n.prototype.onKeyDown = function(e) {
  21312. var t = function() {
  21313. this.cameraControls.activeControl && this.cameraControls.activeControl.emit(_.Move, "key")
  21314. }
  21315. .bind(this)
  21316. , i = e.which;
  21317. switch (i) {
  21318. case p.F:
  21319. t(),
  21320. this.changeFloor(-1);
  21321. break;
  21322. case p.R:
  21323. t(),
  21324. this.changeFloor(1)
  21325. }
  21326. if (this.mode === u.PANORAMA)
  21327. switch (i) {
  21328. case p.UPARROW:
  21329. case p.W:
  21330. this.flyLocalDirection(d.FORWARD.clone());
  21331. break;
  21332. case p.DOWNARROW:
  21333. case p.S:
  21334. this.flyLocalDirection(d.BACK.clone());
  21335. break;
  21336. case p.A:
  21337. this.flyLocalDirection(d.LEFT.clone());
  21338. break;
  21339. case p.D:
  21340. this.flyLocalDirection(d.RIGHT.clone())
  21341. }
  21342. }
  21343. ,
  21344. n.prototype.handleScrollPinchZoom = function() {
  21345. return function(e) {
  21346. var t = e
  21347. , i = this.zoomLevel;
  21348. this.zoomBy(t),
  21349. this.currentPano && this.zoomStats.addZoomAction(i, this.zoomLevel, this.currentPano.id)
  21350. }
  21351. }(),
  21352. n.prototype.handleControlPinch = function(e) {
  21353. f.zoom.enabled ? this.handleScrollPinchZoom(1 - e) : this.flyLocalDirection(new r.Vector3(0,0,e).normalize())
  21354. }
  21355. ,
  21356. n.prototype.handleControlScroll = function(e) {
  21357. f.zoom.enabled ? (e > 0 ? e = 1 + this.scrollZoomSpeed : e < 0 && (e = 1 - this.scrollZoomSpeed),
  21358. 0 !== e && this.handleScrollPinchZoom(e)) : this.flyLocalDirection(new r.Vector3(0,0,-e).normalize())
  21359. }
  21360. ,
  21361. n.prototype.handleInputStart = function(e, t, i) {
  21362. //许钟文加
  21363. var pad = this.handelPadding(e, t);
  21364. e = pad.x;
  21365. t = pad.y;
  21366. this.isTouchEvent = i,
  21367. m.convertScreenPositionToNDC(e, t, this.mouse),
  21368. m.convertScreenPositionToNDC(e, t, this.mouseAtMouseDown),
  21369. this.mouseCouldBeClickToMove = !0,
  21370. this.mouseDown = !0;
  21371. }
  21372. ,
  21373. n.prototype.handelPadding = function(x, y) {
  21374. //去除player左边和上面的宽高,因为pc的player左上有其他element 许钟文
  21375. if (!this.pad)
  21376. this.pad = {
  21377. x: dom.getOffset("left", $("#player")[0]),
  21378. y: dom.getOffset("top", $("#player")[0])
  21379. }
  21380. return {
  21381. x: x - this.pad.x,
  21382. y: y - this.pad.y
  21383. }
  21384. }
  21385. n.prototype.handleInputMove = function(e, t, i) {
  21386. //许钟文加
  21387. var pad = this.handelPadding(e, t);
  21388. e = pad.x;
  21389. t = pad.y;
  21390. this.isTouchEvent = i,
  21391. m.convertScreenPositionToNDC(e, t, this.mouse),
  21392. this.mouseAtMouseDown.distanceTo(this.mouse) > f.input.moveToleranceNDC && (this.mouseCouldBeClickToMove = !1,
  21393. this.couldBeLongTap = !1,
  21394. clearTimeout(this.mouseDownTimer)),
  21395. this.mouseLastMoveTime = Date.now(),
  21396. this.reticule.move(e, t, i)
  21397. }
  21398. ,
  21399. n.prototype.handleInputEnd = function(e, t, i) {//xzw
  21400. if (this.isTouchEvent = i,
  21401. this.mouseDown = !1,
  21402. this.cameraControls.controls[u.PANORAMA].emit("interaction.direct"),
  21403. !i && this.couldBeLongTap)
  21404. return !0;
  21405. if (this.handleLongTap())
  21406. return !0;
  21407. if (this.mouseCouldBeClickToMove) {
  21408. if (this.flying)
  21409. return this.path.activeTransType === x.WALK && this.emit(w.WarpInterruptedWithFlyTo, this.path.activeTransType),
  21410. !0;
  21411. //add----
  21412. if(this.checkHotClick())//add
  21413. return !0;
  21414. if(this.hoveringPlane){
  21415. this.clickOverlay(this.hoveringPlane)
  21416. return;
  21417. }
  21418. if (this.cameraControls.activeControl && this.cameraControls.activeControl.emit(_.Move, this.isTouchEvent ? "touch" : "mouse"),
  21419. this.history.invalidate(),
  21420. this.intersect)
  21421. return this.flyToPanoClosestToMouse();
  21422. if (this.mode === u.PANORAMA) {
  21423. var n = this.closestPanoInDirection(this.getMouseDirection());
  21424. return n ? this.flyToPano({
  21425. pano: n
  21426. }) : this.bump(this.getMouseDirection())
  21427. }
  21428. }
  21429. this.intersect && this.closestPano && this.closestPano.hoverOff(this.mode)
  21430. }
  21431. ,
  21432. n.prototype.handleLongTap = function() {
  21433. if (this.couldBeLongTap && (!this.isPanoHover || this.mode !== u.PANORAMA))
  21434. return this.cameraControls.activeControl && this.cameraControls.activeControl.emit(_.LongTap, "touch"),
  21435. !0
  21436. }
  21437. ,
  21438. n.prototype.checktagClick = function() {
  21439. if (this.tagManager.intersectTag) {
  21440. var e = this.isTouchEvent
  21441. , t = this.tagManager.clickedOnTag(e, this);
  21442. return e || t || y.cancelById(V.LookTransition),
  21443. !0
  21444. }
  21445. if (this.tagManager.activeTag)
  21446. return this.tagManager.dismissActiveTag(),
  21447. !1
  21448. }
  21449. ,
  21450. n.prototype.rankedtagInDirection = function(e, t) {
  21451. return this.tagManager.rankedtagInDirection(e, this.position, this.camera, t)
  21452. }
  21453. ,
  21454. n.prototype.start = function(e) {
  21455. //-------------------
  21456. //-------------------
  21457. var t = e.mode
  21458. , i = e.pano
  21459. , n = e.position
  21460. , rr = e.quaternion
  21461. , o = e.tag
  21462. , a = e.quickstart
  21463. , s = $.Deferred();
  21464. this.updateModelDependentData(),
  21465. this.updateFromControls(),
  21466. this.findDefaultViews();
  21467. var l = this.is360View(t, i);
  21468. return !this.model.outsideAllowed() || l || a ? this.startInside(i, n, rr, o, s) : this.startOutside(e, s),
  21469. s.done(function(e) {
  21470. this.emit(w.Ready, l, e, o)
  21471. }
  21472. .bind(this)),
  21473. s.promise()
  21474. }
  21475. ,
  21476. n.prototype.startOutside = function(e, t) {
  21477. var i = e.mode
  21478. , n = e.pano
  21479. , r = e.position
  21480. , o = e.quaternion
  21481. , a = e.zoom
  21482. , s = e.floorVisibility
  21483. , l = e.tag;
  21484. this.emit(w.StartOutside, f[i].transitionTime),
  21485. this.isOutsideMode(i) ? (this.model.warpDestFloors(s, !0),
  21486. y.cancelById(V.FlyToViewFloor),
  21487. i === u.FLOORPLAN ? this.floorplanMode(r, o, a) : this.dollhouseMode(r, o),
  21488. t.resolve(!1)) : this.startInsideWithFlyin(n, r, o, l, t)
  21489. }
  21490. ,
  21491. n.prototype.startInside = function(e, t, i, n, r) {
  21492. r = r || $.Deferred(),
  21493. this.currentPano = e;
  21494. var o = e && !e.isAligned();
  21495. if (t = o ? e.position : t || e.position,
  21496. i = i || e.quaternion,
  21497. e) {
  21498. var a = this.startInside.bind(this, e, t, i, n, r);
  21499. if (this.checkAndWaitForPanoLoad(e, "high", "low", this.basePanoSize, a))
  21500. return
  21501. }
  21502. //add
  21503. this.transitionPos({type:"beforeFlytopano", pano:this.currentPano, dur:0})
  21504. this.updateHotVisible()
  21505. Hot.updateVisibles([this.currentPano])
  21506. this.modeTran = "panorama-panorama"
  21507. return this.mode = u.PANORAMA,
  21508. e.floor.enter(this.mode),
  21509. this.emit(w.PanoChosen, this.currentPano, this.currentPano),
  21510. this.switchCameraMode(this.mode, i),
  21511. this.emit(w.StartInside, o),
  21512. r.resolve(!0),
  21513. r
  21514. }
  21515. ,
  21516. n.prototype.startInsideWithFlyin = function(e, t, i, n, r) {
  21517. if (r = r || $.Deferred(),
  21518. this.dollhouseMode(),
  21519. !e)
  21520. return F.warn("Player.startInsideWithFlyin() -> targetPano is invalid."),
  21521. r.resolve(!1),
  21522. r;
  21523. t = t || e.position;
  21524. var o = i || this.cameraControls.activeControl.camera.quaternion
  21525. , a = e.position;
  21526. return this.fitDollhouse(a, t, o),
  21527. setTimeout(function(t) {
  21528. this.cameraControls.activeControl && (this.cameraControls.activeControl.maxDistance = t);
  21529. var n = {
  21530. mode: u.PANORAMA,
  21531. pano: e,
  21532. quaternion: i,
  21533. callback: function() {
  21534. this.emit(w.FlyinFinished),
  21535. r.resolve(!0)
  21536. }
  21537. .bind(this)
  21538. };
  21539. this.flyToNewMode(n)
  21540. }.bind(this, this.cameraControls.activeControl.maxDistance), f.startupFlyinDelay),
  21541. r
  21542. }
  21543. ,
  21544. n.prototype.checkAndWaitForPanoLoad = function() {
  21545. var e = {}
  21546. , t = {}
  21547. , i = 5e3
  21548. , n = function() {
  21549. for (var n in e)
  21550. if (e.hasOwnProperty(n) && e[n]) {
  21551. var r = performance.now() - t[n];
  21552. if (r < i)
  21553. return !0
  21554. }
  21555. return !1
  21556. };
  21557. return function(r, o, a, s, l, c, h, u, d, p) {
  21558. if (n())
  21559. return !0;
  21560. var f = function(t, i, n) {
  21561. N.delayOneFrame(function() {
  21562. e[t] = !1,
  21563. l && l(i, n)
  21564. }
  21565. .bind(this))
  21566. }
  21567. .bind(this, r.id)
  21568. , g = function(t, i) {
  21569. N.delayOneFrame(function() {
  21570. e[t] = !1,
  21571. c && c(i)
  21572. }
  21573. .bind(this))
  21574. }
  21575. .bind(this, r.id);
  21576. try {
  21577. return null !== u && void 0 !== u || (u = !0),
  21578. 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),
  21579. e[r.id] && (t[r.id] = performance.now()),
  21580. e[r.id]
  21581. } catch (n) {
  21582. throw e[r.id] = !1,
  21583. t[r.id] = performance.now() - i,
  21584. n
  21585. }
  21586. }
  21587. }(),
  21588. n.prototype.checkAndWaitForWholePanoLoad = function(e, t, i, n, r) {
  21589. if (!e)
  21590. throw new M("Player.checkAndWaitForWholePanoLoad() -> Cannot load texture for null pano.");
  21591. return r && this.model.waitForLoad(e, function() {
  21592. return e.isLoaded(i)
  21593. }),
  21594. !e.isLoaded(t) && (e.loadCube(t).done(n),
  21595. !0)
  21596. }
  21597. ,
  21598. n.prototype.checkAndWaitForTiledPanoLoad = function() {
  21599. var e = new r.Vector3;
  21600. return function(t, i, n, r, o, a, s, l) {
  21601. if (!t)
  21602. throw new M("Player.checkAndWaitForTiledPanoLoad() -> Cannot load texture for null pano.");
  21603. return e.copy(d.FORWARD),
  21604. this.getDirection(e),
  21605. !t.isLoaded(i) && (a && this.model.waitForLoad(t, function() {
  21606. return t.isLoaded(i)
  21607. }),
  21608. t.loadTiledPano(i, e, null, s, l).done(function(e, t) {
  21609. n && n(e, t)
  21610. }
  21611. .bind(this)).fail(function(e) {
  21612. r && r(e)
  21613. }
  21614. .bind(this)).progress(function(e, t, i) {
  21615. o && o(e, t, i)
  21616. }
  21617. .bind(this)),
  21618. !0)
  21619. }
  21620. }(),
  21621. n.prototype.switchCameraMode = function(e, t) {
  21622. var i = this.cameraControls.controls[e]
  21623. , n = i.camera;
  21624. switch (e) {
  21625. case u.PANORAMA:
  21626. n.position.copy(this.currentPano.position);
  21627. var o = t ? d.FORWARD.clone().applyQuaternion(t) : this.getDirection().setY(0).normalize();
  21628. i.lookAt(o.add(n.position));
  21629. break;
  21630. case u.DOLLHOUSE:
  21631. /* var a = this.position.clone();
  21632. 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),
  21633. n.position.copy(a),
  21634. i.target.copy(this.target.clone().setY(this.model.center.y));
  21635. break; */
  21636. //for多楼层 且 让模型刚好适应屏幕
  21637. var box = this.model.boundingBox.clone();
  21638. box.applyMatrix4(this.camera.matrixWorld);//将 boundingbox、也就是模型, 转换到当前相机朝向
  21639. var boxSize = box.size() //其中boxSize.x是模型在当前相机视角下的横向宽度,当飞出后,该宽度要刚好占满窗口宽度
  21640. var fov = B.getHFOVFromVFOV(f.insideFOV, n.aspect, 1); //获得在当前窗口的横向的fov
  21641. var distance = Math.abs(boxSize.x) / 2 / Math.tan(THREE.Math.degToRad(fov / 2))//根据上面获得的参数得到target到相机的距离
  21642. console.log(boxSize.x,distance, boxSize.length() / 2)
  21643. distance += boxSize.length() / 2 //由于此时模型从中心向相机的部分由于近大远小仍超出屏幕,所以将target放在靠近模型靠近相机的这一端,故而再加上box的对角线长度的一半, 虽然本该加上Math.sqrt(boxSize.z*boxSize.z +boxSize.y+boxSize.y)/2,但是这样模型显得比较满
  21644. if(this.mode === u.PANORAMA){
  21645. i.target.copy(this.model.center);
  21646. var vec = this.getDirection().negate().setY(1).normalize()//获得朝向
  21647. }else{
  21648. i.target.copy(this.target.clone().setY(this.model.center.y))
  21649. var vec = d.DOWN.clone().applyQuaternion(this.quaternion).setY(1).normalize()
  21650. }
  21651. vec.multiplyScalar(distance )
  21652. n.position.copy(i.target.clone().add(vec))
  21653. break
  21654. case u.FLOORPLAN:
  21655. n.position.copy(this.model.center).setY(f.floorplan.cameraHeight),
  21656. i.target.copy(this.model.center).setY(0),
  21657. i.zoomToContain(this.model.size),
  21658. i.rotateToView(this.model.size, this.getDirection())
  21659. }
  21660. i.update(0)
  21661. }
  21662. ,
  21663. n.prototype.update = function() {
  21664. var e = (new r.Vector3,
  21665. {})
  21666. , t = [];
  21667. return function(i) {
  21668. this.updatePersistentZooming(i),
  21669. this.updateFromControls(i),
  21670. this.getCurrentNodePanos(t)
  21671. if(this.hasChanged(e) ) {
  21672. this.lastChangeTime = Date.now(),
  21673. !this.mouseDown && this.containsMouse && this.updateIntersect(),
  21674. this.emit(w.ViewChanged),
  21675. this.intersectHot && this.intersectHot.showTitle()
  21676. this.intersect && this.magnifier && this.magnifier.update(this.intersect.point)
  21677. }
  21678. if(e.cameraChanged){
  21679. this.mode == "panorama" && window.cad && cad.setSign({ x: this.position.x, y: this.position.z }, this.cameraControls.controls.panorama.lon);
  21680. }
  21681. if(e.cameraChanged2){ //变化要更大些
  21682. for(var i in this.model.hots){
  21683. this.model.hots[i].update(this)
  21684. }
  21685. }
  21686. this.model.supportsTiles && (this.updateTileDownloader(t),
  21687. this.updatePanoRenderer(t)),
  21688. this.updatePreRendering(t),
  21689. this.reticule.update(),
  21690. this.path.update(),
  21691. this.spider.update(),
  21692. this.cachedPanoCandidates && f.navigation.panoScores && this.model.panos.showPanoScores(this.cachedPanoCandidates),
  21693. this.updateControlLocks(),
  21694. this.model.supportsTiles && this.updateZoomPano()
  21695. }
  21696. }(),
  21697. /* n.prototype.controlVideosPlay = function() {//判断box视频是否可见 不可见就暂停
  21698. var lastMode, lastPano;
  21699. return function(){
  21700. var mode = this.mode;
  21701. var pano = mode == "panorama" ? this.currentPano : "";
  21702. if(mode != "panorama" || pano != lastPano){
  21703. overlay.noBlock = null
  21704. }
  21705. this.overlayGroup.children.forEach((overlay)=>{
  21706. if(overlay.overlayType == "video" ){
  21707. var matrix = overlay.plane.matrixWorld;
  21708. var inSight = false;
  21709. var cameraDir = this.getDirection();
  21710. var planeDir = (new r.Vector3).copy(d.FORWARD).applyQuaternion(overlay.plane.quaternion)
  21711. var vertexes = []
  21712. if(cameraDir.angleTo(planeDir)>Math.PI/2){//朝向相机视线
  21713. for(let i=0; i<4; i++){
  21714. var vertex = overlay.plane.geometry.vertices[i].clone().applyMatrix4(matrix)
  21715. vertexes.push(vertex)
  21716. if(overlay.noBlock == null){
  21717. if(!m.ifShelter(vertex)){
  21718. overlay.noBlock = true
  21719. }
  21720. inSight = true; break;
  21721. }else{
  21722. overlay.noBlock = true
  21723. }
  21724. if(m.getPos2d(vertex, this.camera, $("#player")[0]).inSight){
  21725. inSight = true; break;
  21726. }
  21727. }
  21728. }
  21729. overlay.inSight = inSight
  21730. if(!inSight)overlay.plane.material.map.image.pause()
  21731. else overlay.plane.material.map.image.play()//maybe fail
  21732. }
  21733. })
  21734. lastMode = mode, lastPano = pano
  21735. }
  21736. }() */
  21737. n.prototype.updatePersistentZooming = function(e) {
  21738. 1 === this.zooming ? this.zoomBy(1 + this.zoomSpeed * e) : this.zooming === -1 && this.zoomBy(1 - this.zoomSpeed * e)
  21739. }
  21740. ,
  21741. n.prototype.updateControlLocks = function() {
  21742. this.currentPano && this.model.supportsTiles && (this.cameraControls.controls[u.PANORAMA].locked = !this.currentPano.highestFullTileRenderOpCompleted && this.currentPano.lockUntilRenderingComplete)
  21743. }
  21744. ,
  21745. n.prototype.updatePanoRenderer = function() {
  21746. var e = new r.Vector3;
  21747. return function(t) {
  21748. var i = this.nextPano || this.currentPano;
  21749. this.panoRenderer.hasQueuedTiles() && i && (e.copy(d.FORWARD),
  21750. this.getDirection(e),
  21751. this.panoRenderer.updateDirection(e))
  21752. }
  21753. }(),
  21754. n.prototype.cleanupInactivePanos = function() {
  21755. var e = []
  21756. , t = [];
  21757. return function() {
  21758. e.length = 0,
  21759. e.push(this.currentPano),
  21760. this.nextPano && e.push(this.nextPano),
  21761. t.length = 0;
  21762. for (var i = 0; i < this.panoRenderer.activePanos.length; i++)
  21763. t.push(this.panoRenderer.activePanos[i]);
  21764. for (var n = 0; n < t.length; n++) {
  21765. for (var r = t[n], o = !0, a = 0; a < e.length; a++)
  21766. r.id === e[a].id && (o = !1);
  21767. o && r.exit()
  21768. }
  21769. }
  21770. }(),
  21771. n.prototype.updatePreRendering = function() {
  21772. var e = {};
  21773. return function(t) {
  21774. if (1 === f.tiling.preRenderTourPanos && this.preRenderingEnabled) {
  21775. var i = this.nextPano || this.currentPano;
  21776. if (i && t && t.length > 1) {
  21777. var n = t.findIndex(function(e) {
  21778. if (e.id === i.id)
  21779. return !0
  21780. });
  21781. if (n >= 0 && n + 1 < t.length) {
  21782. var r = t[n + 1];
  21783. r.isLoaded(this.basePanoSize) || e[r.id] || (window.setTimeout(function(t) {
  21784. this.checkAndWaitForPanoLoad(t, "high", "low", this.basePanoSize, null, null, null, !1, !1, !1),
  21785. window.setTimeout(function(t) {
  21786. e[t.id] = !1
  21787. }
  21788. .bind(this, t), f.tiling.panoPreRenderRepeatDelay)
  21789. }
  21790. .bind(this, r), f.tiling.panoPreRenderDelay),
  21791. e[r.id] = !0)
  21792. }
  21793. }
  21794. }
  21795. }
  21796. }(),
  21797. n.prototype.enablePreRendering = function() {
  21798. this.preRenderingEnabled = !0
  21799. }
  21800. ,
  21801. n.prototype.disablePreRendering = function() {
  21802. this.preRenderingEnabled = !1,
  21803. this.cleanupInactivePanos()
  21804. }
  21805. ,
  21806. n.prototype.updateTileDownloader = function() {
  21807. var e = new r.Vector3;
  21808. return function(t) {
  21809. var i = this.nextPano || this.currentPano;
  21810. i && (e.copy(d.FORWARD),
  21811. this.getDirection(e),
  21812. this.tileDownloader.tilePrioritizer.updateCriteria(i, this.position, e, t.length > 0 ? t : null),
  21813. this.tileDownloader.processPriorityQueue = !0)
  21814. }
  21815. }(),
  21816. n.prototype.updateFromControls = function(e) {
  21817. null !== e && void 0 !== e || (e = 0),
  21818. this.cameraControls.activeControl && (this.cameraControls.activeControl.update(e),
  21819. this.quaternion.copy(this.cameraControls.activeControl.camera.quaternion),
  21820. this.position.copy(this.cameraControls.activeControl.camera.position),
  21821. this.target.copy(this.cameraControls.activeControl.target),
  21822. this.cameraControls.activeControl.camera.updateProjectionMatrix(),
  21823. this.camera.projectionMatrix.copy(this.cameraControls.activeControl.camera.projectionMatrix)),
  21824. this.camera.position.copy(this.position),
  21825. this.camera.quaternion.copy(this.quaternion),
  21826. this.camera.updateMatrix(),
  21827. this.camera.updateMatrixWorld()
  21828. }
  21829. ,
  21830. n.prototype.hasChanged = function(e) {
  21831. /* if (!this.previousState)
  21832. return this.previousState = {
  21833. allFloorsVisible: this.model.allFloorsVisible,
  21834. position: this.position.clone(),
  21835. quaternion: this.quaternion.clone(),
  21836. mouse: this.mouse.clone(),
  21837. labelScaleFactor: this.getLabelScaleFactor(),
  21838. currentFloor: this.model.currentFloor,
  21839. projectionMatrix: this.camera.projectionMatrix.clone(),
  21840. worldMatrix: this.camera.matrixWorld.clone(),
  21841. mode: this.mode,
  21842. modelPosition: this.model.position.clone(),
  21843. modelCenter: this.model.center.clone(),
  21844. zoomLevel: this.zoomLevel
  21845. },
  21846. !0;
  21847. 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;
  21848. return e.allFloorsVisible = this.model.allFloorsVisible !== this.previousState.allFloorsVisible,
  21849. e.moved = !this.position.equals(this.previousState.position),
  21850. e.rotated = !this.quaternion.equals(this.previousState.quaternion),
  21851. e.mouseMoved = !this.mouse.equals(this.previousState.mouse),
  21852. e.labelScaleFactor = this.getLabelScaleFactor() !== this.previousState.labelScaleFactor,
  21853. e.floorChanged = this.model.currentFloor !== this.previousState.currentFloor,
  21854. e.cameraProjectionChanged = !this.camera.projectionMatrix.equals(this.previousState.projectionMatrix),
  21855. e.cameraWorldMatrixChanged = !this.camera.matrixWorld.equals(this.previousState.worldMatrix),
  21856. e.modeChanged = this.mode !== this.previousState.mode,
  21857. e.modelPositionChanged = !this.model.position.equals(this.previousState.modelPosition),
  21858. e.modelCenterChanged = !this.model.center.equals(this.previousState.modelCenter),
  21859. e.nextPanoActive = null !== this.nextPano,
  21860. e.zoomLevel = this.zoomLevel !== this.previousState.zoomLevel,
  21861. this.previousState.allFloorsVisible = this.model.allFloorsVisible,
  21862. this.previousState.position.copy(this.position),
  21863. this.previousState.quaternion.copy(this.quaternion),
  21864. this.previousState.mouse.copy(this.mouse),
  21865. this.previousState.labelScaleFactor = this.getLabelScaleFactor(),
  21866. this.previousState.currentFloor = this.model.currentFloor,
  21867. this.previousState.projectionMatrix.copy(this.camera.projectionMatrix),
  21868. this.previousState.worldMatrix.copy(this.camera.matrixWorld),
  21869. this.previousState.mode = this.mode,
  21870. this.previousState.modelPosition.copy(this.model.position),
  21871. this.previousState.modelCenter.copy(this.model.center),
  21872. this.previousState.zoomLevel = this.zoomLevel,
  21873. !t */
  21874. if (!this.previousState)
  21875. {
  21876. this.previousState = {
  21877. allFloorsVisible: this.model.allFloorsVisible,
  21878. position: this.position.clone(),
  21879. quaternion: this.quaternion.clone(),
  21880. mouse: this.mouse.clone(),
  21881. //labelScaleFactor: this.getLabelScaleFactor(),
  21882. currentFloor: this.model.currentFloor,
  21883. projectionMatrix: this.camera.projectionMatrix.clone(),
  21884. worldMatrix: this.camera.matrixWorld.clone(),
  21885. mode: this.mode,
  21886. modelPosition: this.model.position.clone(),
  21887. modelCenter: this.model.center.clone(),
  21888. zoomLevel: this.zoomLevel
  21889. };
  21890. return !0;
  21891. }
  21892. //许钟文改 分成相机是否改变cameraChanged 和其他
  21893. 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)
  21894. 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 ;
  21895. e.cameraChanged = !a;
  21896. if(e.cameraChanged){//
  21897. e.cameraChanged2 = !MathLight.closeTo(this.quaternion, this.previousState.quaternion, 3) || !MathLight.closeTo(this.position, this.previousState.position, 4) || !this.camera.projectionMatrix.equals(this.previousState.projectionMatrix)
  21898. }else e.cameraChanged2 = false
  21899. e.allFloorsVisible = this.model.allFloorsVisible !== this.previousState.allFloorsVisible,
  21900. e.moved = !this.position.equals(this.previousState.position),
  21901. e.rotated = !this.quaternion.equals(this.previousState.quaternion),
  21902. e.mouseMoved = !this.mouse.equals(this.previousState.mouse),
  21903. // e.labelScaleFactor = this.getLabelScaleFactor() !== this.previousState.labelScaleFactor,
  21904. e.floorChanged = this.model.currentFloor !== this.previousState.currentFloor,
  21905. e.cameraProjectionChanged = !this.camera.projectionMatrix.equals(this.previousState.projectionMatrix),
  21906. e.cameraWorldMatrixChanged = !this.camera.matrixWorld.equals(this.previousState.worldMatrix),
  21907. e.modeChanged = this.mode !== this.previousState.mode,
  21908. e.modelPositionChanged = !this.model.position.equals(this.previousState.modelPosition),
  21909. e.modelCenterChanged = !this.model.center.equals(this.previousState.modelCenter),
  21910. e.nextPanoActive = null !== this.nextPano,
  21911. e.zoomLevel = this.zoomLevel !== this.previousState.zoomLevel,
  21912. this.previousState.allFloorsVisible = this.model.allFloorsVisible,
  21913. this.previousState.position.copy(this.position),
  21914. this.previousState.quaternion.copy(this.quaternion),
  21915. this.previousState.mouse.copy(this.mouse),
  21916. //this.previousState.labelScaleFactor = this.getLabelScaleFactor(),
  21917. this.previousState.currentFloor = this.model.currentFloor,
  21918. this.previousState.projectionMatrix.copy(this.camera.projectionMatrix),
  21919. this.previousState.worldMatrix.copy(this.camera.matrixWorld),
  21920. this.previousState.mode = this.mode,
  21921. this.previousState.modelPosition.copy(this.model.position),
  21922. this.previousState.modelCenter.copy(this.model.center),
  21923. this.previousState.zoomLevel = this.zoomLevel;
  21924. //console.log("cameraChanged2 "+ e.cameraChanged2 + ", mouseMoved "+e.mouseMoved)
  21925. return !t
  21926. }
  21927. ,
  21928. n.prototype.updateIntersect = function() {
  21929. var e = this.flying || this.isWarping()
  21930. , t = this.isOutsideMode() && this.cameraControls.controls[this.mode].isEngaged()
  21931. , i = y.getById(V.LookTransition)
  21932. , n = !(e || t || this.isTouchEvent || i.length && i[0].running);
  21933. {//clear:
  21934. if(this.intersectHot) this.intersectHot.hideTitle()
  21935. this.intersectHot = null
  21936. $("#player").css("cursor", "")
  21937. }
  21938. var deal = ()=>{
  21939. if(this.intersect && this.intersect.object.visible ){
  21940. if("hotSprite" == this.intersect.object.type){
  21941. this.intersectHot = this.intersect.object
  21942. while(!(this.intersectHot instanceof Hot)){
  21943. this.intersectHot = this.intersectHot.parent
  21944. }
  21945. $(`.toolRight .spotList ul li[data-spid=${this.intersectHot.sid}]`).addClass("active")
  21946. this.intersectHot.showTitle()
  21947. }
  21948. }
  21949. }
  21950. if(this.model.hotGroup){
  21951. var hots = this.model.hotGroup.children.filter(e=> e.info.actionType.examine || e.info.actionType.openHot || e.info.actionType.playAndPause)
  21952. this.intersect = this.getMouseIntersect(null, hots.concat(this.model.colliders));
  21953. if(this.intersect){
  21954. deal()
  21955. this.intersectHot && $("#player").css("cursor", "pointer");
  21956. }
  21957. }
  21958. this.intersect = this.getMouseIntersect(),
  21959. this.intersect && this.updateClosestPano(this.intersect),
  21960. this.closestPano || this.closestPanoInDirection(this.getMouseDirection()) ? (this.reticule.updatePosition(this.position, this.intersect),
  21961. f.navigation.panoScores && !f.navigation.mouseDirection && this.closestPanoInDirection(this.getDirection())) : this.reticule.hide()
  21962. }
  21963. ,
  21964. n.prototype.checkHotClick = function() {
  21965. if(this.intersectHot){
  21966. if(this.intersectHot.texType == "video" && this.intersectHot.info.actionType.playAndPause){
  21967. this.intersectHot.switchPlay(!!this.intersectHot.pausedByUser)
  21968. }
  21969. this.intersectHot.examine(this)
  21970. return true;
  21971. }
  21972. },
  21973. n.prototype.getMouseDirection = function(e) {
  21974. e = e || this.mouse;
  21975. var t = new r.Vector3(e.x,e.y,-1).unproject(this.camera)
  21976. , i = new r.Vector3(e.x,e.y,1).unproject(this.camera);
  21977. return i.sub(t).normalize()
  21978. }
  21979. ,
  21980. n.prototype.hoverOverlay = function(mesh){
  21981. if(!mesh){
  21982. this.hoveringPlane = null;
  21983. $("#player").css("cursor",this.currentCursor || "" );
  21984. }else{
  21985. var overlay = mesh.parent;
  21986. $("#player").css("cursor","pointer");
  21987. this.hoveringPlane = overlay;
  21988. return true;
  21989. }
  21990. },
  21991. n.prototype.clickOverlay = function(overlay){
  21992. if(this.openOverlay && !overlay)return;
  21993. var plane = overlay.plane;
  21994. /* if(overlay.overlayType == "video"){
  21995. if(plane.material.map.image.paused) plane.material.map.image.play()
  21996. else plane.material.map.image.pause()
  21997. } */
  21998. if(overlay.overlayType == "video"){
  21999. overlay.switchPlay(!!overlay.pausedByUser)
  22000. }
  22001. /* if(window.EditOverlay &&EditOverlay.editing){
  22002. if(EditOverlay.editPlane && overlay != EditOverlay.editPlane) EditOverlay.closeOverlayPanel('cancel')
  22003. $('#overlayProp').removeClass('atRight').removeClass('hide')
  22004. EditOverlay.endAddPlane();
  22005. EditOverlay.updateOverlayPanel(overlay)
  22006. EditOverlay.controlSelectOverlay(overlay)
  22007. return;
  22008. } */
  22009. },
  22010. n.prototype.getMouseIntersect = function(e, t) {//xzw change
  22011. e = e || this.mouse.clone(),
  22012. t = t || this.model.floors.reduce(function(e, t) {
  22013. return t.hidden ? e : e.concat(t.collider.children)
  22014. }, this.mode === u.PANORAMA ? this.panoMarkers : []);
  22015. var i = new r.Vector3(e.x,e.y,-1).unproject(this.camera);
  22016. this.raycaster.set(i, this.getMouseDirection(e));
  22017. var n = this.raycaster.intersectObjects(t, true);//add true
  22018. var o = n[0];
  22019. if(o){
  22020. o.face && (o.normal = o.face.normal.applyQuaternion(o.object.quaternion),
  22021. this.position.clone().sub(o.point).dot(o.normal) < 0 && o.normal.negate(),
  22022. this.currentPano ? o.onFloor = o.point.y < this.position.y - .5 * this.currentPano.height : o.onFloor = o.point.y < this.position.y - .5,
  22023. o.horizontal = .8 < o.normal.y);
  22024. return o
  22025. }
  22026. }
  22027. ,
  22028. n.prototype.updateClosestPano = function(e) {
  22029. var t = [s.filters.isPanoAligned()];
  22030. if (this.mode === u.PANORAMA) {
  22031. if (!this.currentPano)
  22032. return;
  22033. t.push(s.filters.not(this.currentPano)),
  22034. t.push(s.filters.inFloorDirection(this.currentPano.floorPosition, this.getDirection(), .25)),
  22035. t.push(s.filters.isNeighbourPanoTo(this.currentPano)),
  22036. t.push(s.filters.isCloseEnoughTo(e.point, f.panoFloorClickRadius)),
  22037. t.push(s.filters.isNotBehindNormal(e.point, e.normal))
  22038. } else{
  22039. t.push((pano)=>{ // add
  22040. return this.checkHasNeighbor(pano)
  22041. })
  22042. t.push(s.filters.isOnVisibleFloor()),
  22043. this.mode !== u.FLOORPLAN && t.push(s.filters.inDirection(this.position, this.getDirection(), .25));
  22044. }
  22045. var i = this.model.panos.find(t, [s.sortFunctions.floorDistanceToPoint(e.point)]);
  22046. i !== this.closestPano ? (i && (this.isPanoHover = !0),
  22047. this.emit(w.ClosestPanoChanging, this.closestPano, i, this.mode),
  22048. this.closestPano = i) : this.isPanoHover = !1
  22049. }
  22050. ,
  22051. n.prototype.dollhouseMode = function(e, t) {
  22052. this.emit(w.ModeChanging, this.mode, u.DOLLHOUSE),
  22053. this.mode = u.DOLLHOUSE,
  22054. this.cameraControls.controls[u.DOLLHOUSE].reset();
  22055. var i = new r.Vector3(this.model.center.x,0,this.model.center.z)
  22056. , n = new r.Vector3(15,10,15);
  22057. if (e && t) {
  22058. var o = d.FORWARD.clone().applyQuaternion(t)
  22059. , a = this.model.center.clone().sub(e)
  22060. , s = a.dot(o);
  22061. s > 0 ? (i = o.clone().multiplyScalar(s).add(e),
  22062. n.copy(e)) : F.warn("Tried to initiate dollhouse mode that wasn't looking at the model", e, t)
  22063. }
  22064. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(0, !0),
  22065. this.cameraControls.controls[u.DOLLHOUSE].target.copy(i),
  22066. this.cameraControls.cameras[u.DOLLHOUSE].position.copy(n),
  22067. this.updateFromControls(),
  22068. this.model.alpha = 1,
  22069. this.model.skybox.material.uniforms.opacity.value = 0
  22070. }
  22071. ,
  22072. n.prototype.insideMode = function(e, t) {
  22073. var i = $.Deferred()
  22074. , n = t || null;
  22075. if (this.mode !== u.PANORAMA && this.mode !== u.TRANSITIONING) {
  22076. var r = [s.filters.isPanoAligned()];
  22077. this.model.currentFloor && r.push(s.filters.atFloor(this.model.currentFloor)),
  22078. e = e || this.currentPano || this.model.panos.find(r, [s.sortFunctions.distanceToPoint(this.cameraControls.activeControl.target)]),
  22079. this.flyToNewMode({
  22080. mode: u.PANORAMA,
  22081. pano: e,
  22082. callback: n
  22083. }).done(i.resolve.bind(i)).fail(i.reject.bind(i))
  22084. } else {
  22085. var o = this.mode === u.PANORAMA ? "Already in panorama mode" : "Cannot change mode during mode transition";
  22086. i.reject(o)
  22087. }
  22088. return i.promise()
  22089. }
  22090. ,
  22091. n.prototype.fitDollhouse = function(e, t, i) {//许钟文改 飞入前寻找和初始视角最合适的位置
  22092. //if(urlHasValue('oldEntry')){
  22093. //搬自一代。
  22094. var maxY = this.model.boundingBox.max.y;
  22095. var n = d.FORWARD.clone().applyQuaternion(i)
  22096. , i = n.clone().add(e);
  22097. this.cameraControls.activeControl.target.copy(i),
  22098. this.cameraControls.activeControl.camera.position.set(0, maxY * 2.4, 0).add(e).add(n.multiplyScalar(-10))
  22099. //return;
  22100. /* //this.camera.position.copy(this.model.center);
  22101. //this.camera.updateMatrixWorld()
  22102. this.switchCameraMode("dollhouse", i) */
  22103. //}//下面是二代代码,看不太懂。因为有的场景在靠近一端的某个方向截取的初始视角会甩镜头,也就是不是下去之后的方向
  22104. //直接用一代的这个 效果和二代几乎一样,且不会甩
  22105. /* var n = d.FORWARD.clone().applyQuaternion(i);
  22106. this.cameraControls.activeControl.target.copy(n).add(e);
  22107. var o = d.RIGHT.clone().applyQuaternion(i)
  22108. , a = d.UP.clone()
  22109. , s = o.clone().applyAxisAngle(a, Math.PI / 2)
  22110. , l = this.model.boundingBox.max.clone()
  22111. , c = this.model.boundingBox.min.clone()
  22112. , 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)]
  22113. , u = 0
  22114. , p = 0
  22115. , g = 0;
  22116. h.forEach(function(e, t, i) {
  22117. var n = Math.abs(e.dot(o))
  22118. , r = e.dot(s);
  22119. n > u && (u = n,
  22120. p = r),
  22121. r > g && (g = r)
  22122. });
  22123. 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)))
  22124. , v = s.clone().multiplyScalar(p).add(t)
  22125. , A = s.clone().multiplyScalar(g).add(t);
  22126. p = u / Math.tan(this.cameraControls.activeControl.camera.fov / 2 * this.cameraControls.activeControl.camera.aspect * (Math.PI / 180));
  22127. g = m / Math.tan(this.cameraControls.activeControl.camera.fov / 2 * (Math.PI / 180));
  22128. p = Math.max(p, 10),
  22129. g = Math.max(g, 10);
  22130. var y = n.clone().multiplyScalar(-p).add(v).sub(t).length()
  22131. , C = n.clone().multiplyScalar(-g).add(v).sub(t).length();
  22132. this.cameraControls.activeControl.maxDistance = f.skyboxRadius - 1;
  22133. y >= C ? this.cameraControls.activeControl.camera.position.set(0, 6, 0).add(v).add(n.multiplyScalar(1.1 * -p))
  22134. : this.cameraControls.activeControl.camera.position.set(0, 6, 0).add(A).add(n.multiplyScalar(1.1 * -g))
  22135. */
  22136. }
  22137. ,
  22138. n.prototype.floorplanMode = function(e, t, i) {
  22139. this.mode = u.FLOORPLAN;
  22140. var n = this.cameraControls.controls[u.FLOORPLAN];
  22141. n.reset();
  22142. var r = e ? e : this.model.center;
  22143. if (n.target.copy(r).setY(0),
  22144. n.camera.position.copy(r).setY(f.floorplan.cameraHeight),
  22145. i ? (n.currentScale = i / ($("#player").width() / $("#player").height()),
  22146. n.absoluteScale = n.currentScale) : n.zoomToContain(this.model.size),
  22147. t) {
  22148. var o = d.LEFT.clone().applyQuaternion(t);
  22149. n.rotateLeft(-Math.atan2(o.x, o.z))
  22150. } else
  22151. n.rotateToView(this.model.size, this.getDirection());
  22152. n.update(0)
  22153. }
  22154. ,
  22155. n.prototype.nonInterruptingFlyToPano = function(e, t) {
  22156. return e.skipWarpingCheck = !0,
  22157. this.flyToPano(e, t)
  22158. }
  22159. ,
  22160. n.prototype.updateMarkerVisi = function() {//加
  22161. if(this.mode != "panorama")return;
  22162. this.model.panos.list.forEach((pano)=>{
  22163. if(!pano.marker)return;
  22164. pano.marker.material.visible = !!pano.neighbourPanos[this.currentPano.id];
  22165. })
  22166. }
  22167. ,
  22168. n.prototype.updateHotVisible = function(pano){
  22169. var hots = this.model.hots;
  22170. pano = pano || this.currentPano;
  22171. for (var index in hots){
  22172. var visible;
  22173. if(this.mode != "panorama"){
  22174. visible = true;
  22175. }else{
  22176. //hots[index].mesh.material.depthTest = false;
  22177. visible = !hots[index].visiblePanos || hots[index].visiblePanos.indexOf(pano.id) > -1
  22178. }
  22179. hots[index].mesh.visible = visible;
  22180. }
  22181. }
  22182. n.prototype.flyToPano = function(e, t) {
  22183. var i = e.pano
  22184. , aim = e.lookAtPoint
  22185. , aimQua = e.quaternion //ADD
  22186. , o = e.duration
  22187. , a = e.aimDuration
  22188. , s = e.maxDistanceOverride
  22189. , l = e.skipWarpingCheck
  22190. , c = e.constantMoveSpeed
  22191. , h = null
  22192. , p = null
  22193. if (aim){
  22194. var _ = (new r.Matrix4).lookAt(i.position, aim, d.UP)
  22195. aimQua = (new r.Quaternion).setFromRotationMatrix(_)
  22196. }
  22197. else aimQua = aimQua
  22198. var zoomLevel = e.zoomLevel || 1 //add
  22199. if(this.flying) return t && t(e)
  22200. window.specialScene && specialScene.special().specifySpot && specialScene.special().specifySpot(i);
  22201. if (this.isWarping() && !l && (this.path.activeTransType === x.BLACK || this.path.activeTransType === x.STD))
  22202. return F.warn("Player.flyToPano() -> Cannot fly when warping"),
  22203. t && t(),
  22204. !1;
  22205. if (this.updateLastView(),
  22206. this.mode !== u.PANORAMA) {
  22207. var m;
  22208. void this.flyToNewMode({
  22209. mode: u.PANORAMA,
  22210. pano: i,
  22211. duration: o,
  22212. quaternion: aimQua ,
  22213. callback: t
  22214. })
  22215. }
  22216. if (!i || (h = g.deepExtend(e),
  22217. p = function() {
  22218. N.delayOneFrame(function() {
  22219. this.flyToPano(h, t)
  22220. }
  22221. .bind(this))
  22222. }
  22223. .bind(this),
  22224. !this.checkAndWaitForPanoLoad(i, "high", "low", this.basePanoSize, p))) {
  22225. var C = function(e) {
  22226. t && t(e)
  22227. }
  22228. .bind(this);
  22229. this.currentPano || (this.currentPano = i,
  22230. this.path.placeCpm(),
  22231. this.path.fadeOutCpm(f.path.fadeOutTime),
  22232. this.spider.draw());
  22233. var I = o;
  22234. if ("number" != typeof o) {
  22235. var E = s || f.transition.flytimeMaxDistanceThreshold;
  22236. I = Math.min(this.currentPano.position.distanceTo(i.position), E) * f.transition.flytimeDistanceMultiplier + f.transition.flyTime
  22237. }
  22238. if (f.transition.flySpeed > .01 && (I = 1e3 * this.currentPano.position.distanceTo(i.position) / f.transition.flySpeed),
  22239. zoomLevel !== this.zoomLevel)
  22240. switch (f.zoom.transitionStyle) {
  22241. case 1:
  22242. this.smoothZoomFovTo(null, zoomLevel, zoomLevel == 1 ? I / 2 : I); //改
  22243. break;
  22244. case 2:
  22245. return h = g.deepExtend(e),
  22246. p = this.flyToPano.bind(this, h, t),
  22247. void this.smoothZoomFovTo(null, zoomLevel, f.zoom.restoreTime * (this.zoomLevel - 1), p)
  22248. }
  22249. if (aimQua) {
  22250. y.cancelById(V.LookTransition),
  22251. I *= f.transition.aimSlowFactor;
  22252. var b = this.cameraControls.activeControl.camera.quaternion.clone()
  22253. , S = b.clone()
  22254. , M = new r.Vector3;
  22255. if (i === this.currentPano) {
  22256. var R = d.FORWARD.clone().applyQuaternion(b)
  22257. , P = d.FORWARD.clone().applyQuaternion(aimQua)
  22258. , O = R.angleTo(P);
  22259. return void 0 !== a && null !== a || (a = 1 * Math.sqrt(O) / f.tags.navigate.rotateSpeedFactor * 1e3),
  22260. void y.start(function(e) {
  22261. S.copy(b),
  22262. v.quaternion(S, aimQua)(e),
  22263. M.copy(d.FORWARD).applyQuaternion(S).add(this.cameraControls.activeControl.camera.position),
  22264. this.cameraControls.activeControl.lookAt(M)
  22265. }
  22266. .bind(this), a, C, 0, A[f.transition.movementEasing], null, V.LookTransition)
  22267. }
  22268. }
  22269. if (i === this.currentPano )
  22270. return void C();
  22271. this.flying = !0;
  22272. var L = this.position.clone()
  22273. , D = this.currentPano;
  22274. F.debug("Flying to pano ", i.position),
  22275. this.emit(w.PanoChosen, this.currentPano, i),
  22276. this.emit(w.FlyingStarted, i.position, L, i, D)
  22277. //---------before fly--------------- add
  22278. this.updateHotVisible(i); //更新热点显示
  22279. this.transitionPos({type:"beforeFlytopano", pano:i, dur:I})//add
  22280. Hot.updateVisibles([this.currentPano, i])
  22281. //地标变化
  22282. if(this.model.floorLogos){
  22283. this.model.changefloorLogoOpa({index:0, opa:0, dur: p, delay:0.7})//this.model.floorLogoFade(0, _duration*0.5, 0.7);
  22284. this.model.floorLogos[1].position.copy(i.floorPosition.clone().sub(this.model.position));
  22285. //this.model.adjustfloorLogoHeight();
  22286. this.model.floorLogos[1].material.opacity = 0;//uniforms.opacity.value = 0;
  22287. this.model.floorLogos[1].visible = true;
  22288. this.model.changefloorLogoOpa({index:1, opa:1, dur: 250})//this.model.floorLogoShow(1,250);
  22289. }
  22290. //=======================================
  22291. aimQua && y.start(function(e) {
  22292. S.copy(b),
  22293. v.quaternion(S, aimQua)(e),
  22294. M.copy(d.FORWARD).applyQuaternion(S).add(this.cameraControls.activeControl.camera.position),
  22295. this.cameraControls.activeControl.lookAt(M)
  22296. }
  22297. .bind(this), I, null, 0, A[f.transition.movementEasing], null, V.LookTransition);
  22298. var B = c ? null : A[f.transition.movementEasing];
  22299. this.nextPano = i,
  22300. y.start(v.uniform(this.model.skybox, "progress", 1), I, null, 0, A[f.transition.blendEasing], "skyFly", V.FlyToPano),
  22301. y.start(v.allUniforms(this.model.chunks, "progress", 1), I, null, 0, A[f.transition.blendEasing], "chunkFly", V.FlyToPano),
  22302. y.start(v.vector(this.cameraControls.cameras[u.PANORAMA].position, i.position), I, function(e) {
  22303. this.flying = !1,
  22304. this.currentPano !== i && this.currentPano.exit(),
  22305. i.enter(),
  22306. this.currentPano = i,
  22307. this.nextPano = null,
  22308. this.path.placeCpm(),
  22309. this.path.fadeOutCpm(f.path.fadeOutTime),
  22310. this.spider.draw(),
  22311. this.emit(w.FlyingEnded, i.position, L, i, D),
  22312. this.updateMarkerVisi(),//add
  22313. C(e)
  22314. //add:
  22315. if(this.mode == "panorama" ){
  22316. if(this.model.floorLogos){
  22317. this.model.floorLogos[0].position.copy(this.model.floorLogos[1].position)
  22318. //this.model.adjustfloorLogoHeight()
  22319. this.model.changefloorLogoOpa({index:0,opa:1,dur:0});//this.model.floorLogos[0].material.uniforms.opacity.value = 1;
  22320. this.model.floorLogos[1].visible = false;
  22321. }
  22322. Hot.updateVisibles([this.currentPano])//add
  22323. }
  22324. }
  22325. .bind(this), 0, B, "camFly", V.FlyToPano)
  22326. }
  22327. }
  22328. ,
  22329. n.prototype.warpToPano = function(o={}) {
  22330. }
  22331. n.prototype.blackToPano = function(o={}) {//add 瞬间过渡
  22332. //o.panoId = "8bc9156b288d48459e4e0f74d7051ef1"
  22333. if(this.flying || this.isWarping() )return;
  22334. let oldPos = this.position.clone();
  22335. let oldPano = this.currentPano
  22336. let pano = o.pano || this.model.panos.index[o.panoId]
  22337. this.path.warpDestPano = pano
  22338. var retry = ()=>{
  22339. this.waitingToWarp = !1,
  22340. this.blackToPano(o)
  22341. }
  22342. if (this.checkAndWaitForPanoLoad(pano, "high", "low", this.basePanoSize, retry))
  22343. return void (this.waitingToWarp = !0)
  22344. this.emit("pano.chosen", oldPano, pano)
  22345. /* if(window.momentTourBlackNewType == 1) { */
  22346. this.flying = true
  22347. this.path.warpDestHeroLoc = {
  22348. panoId : o.panoId,
  22349. position: pano.position,
  22350. quaternion: o.quaternion || this.quaternion.clone()
  22351. }
  22352. this.path.warpTravel_BLACK(null, 1500,1, ()=>{
  22353. pano != this.currentPano && this.currentPano.exit()
  22354. pano.enter()
  22355. this.currentPano = pano
  22356. this.emit("flying.ended", pano.position, oldPos, pano, oldPano)
  22357. this.flying = false
  22358. } )
  22359. }
  22360. window._transitionPosId = 9999
  22361. n.prototype.transitionPos = function(o={}) {//渐变overlay和热点的位置
  22362. y.cancelById(_transitionPosId)
  22363. var begin = function(object, pos, qua, scale){
  22364. if(pos){
  22365. if(!same(object.position, pos, 0.01)){
  22366. y.start(v.vector(object.position, pos), o.dur, (e)=>{
  22367. },0, A[f.transition.movementEasing], "transitionPos", _transitionPosId)
  22368. }
  22369. if(qua && !same(object.quaternion, qua, 1e-6)){
  22370. y.start(v.quaternion(object.quaternion, qua), o.dur, (e)=>{
  22371. },0, A[f.transition.movementEasing], "transitionPos", _transitionPosId)
  22372. }
  22373. if(scale && !same(object.scale, scale, 0.001)){
  22374. y.start(v.vector(object.scale, scale), o.dur, (e)=>{
  22375. },0, A[f.transition.movementEasing], "transitionPos", _transitionPosId)
  22376. }
  22377. }
  22378. }
  22379. var same = function(vec1, vec2, diff){
  22380. var s = Math.abs(vec1.x-vec2.x) < diff && Math.abs(vec1.y-vec2.y) < diff && Math.abs(vec1.z-vec2.z) < diff
  22381. if(s && vec1.w) s = Math.abs(vec1.w-vec2.w) < diff
  22382. return s
  22383. }
  22384. var sid = o.pano != void 0 ? o.pano.id : "outside";
  22385. for(let i in this.model.hots){//是否判断visible?
  22386. var hot = this.model.hots[i];
  22387. var panoData = hot.info.transformAtPanos[sid];
  22388. var useCustom = !panoData
  22389. //if(hot.usingTransformData || !useCustom){
  22390. var pos = useCustom ? hot.info.position : panoData.pos;
  22391. begin(hot, pos/* , qua */ )
  22392. //}
  22393. }
  22394. }
  22395. window._tranOutsideFocus = 4399
  22396. n.prototype.focusPoint = function(o={}){//当在外时,聚焦相机到这一点
  22397. console.log("focusPoint")
  22398. if(this.mode == "floorplan"){
  22399. var modelSize = o.modelSize || new THREE.Vector3(8,8,8);//可视范围
  22400. var control = this.cameraControls.controls.floorplan;
  22401. var absoluteScale = control.getDefaultAbsoluteScale(modelSize)
  22402. var currentScale = control.absoluteScale;
  22403. var currentTarget = control.target.clone()
  22404. y.cancelById(window._tranOutsideFocus, true);
  22405. y.start(function(progress){
  22406. control.absoluteScale = absoluteScale*progress + currentScale*(1-progress);
  22407. control.target = o.aim.clone().multiplyScalar(progress).add(currentTarget.clone().multiplyScalar(1-progress))
  22408. control.camera.position.copy(control.target.clone().add(control.offset)) //维持角度
  22409. }.bind(this) , o.dur || 600, null/* cancelFuc */, 0, A[f.transition.movementEasing], "outsideFocus", window._tranOutsideFocus, null/* cancelFuc */);
  22410. }else if(player.mode == "dollhouse"){
  22411. var control = player.cameraControls.controls.dollhouse;
  22412. var radius = o.radius || 8;
  22413. var currentTarget = control.target.clone()
  22414. var dir = control.offset.clone().normalize()
  22415. var currentRadius = control.offset.length();
  22416. y.cancelById(window._tranOutsideFocus, true);
  22417. y.start(function(progress){
  22418. control.target = o.aim.clone().multiplyScalar(progress).add(currentTarget.clone().multiplyScalar(1-progress))
  22419. let radius_ = radius*progress+currentRadius*(1-progress)
  22420. control.camera.position.copy(control.target.clone().add(dir.clone().multiplyScalar(radius_)))
  22421. }.bind(this) , o.dur || 600, null/* cancelFuc */, 0, A[f.transition.movementEasing], "outsideFocus", window._tranOutsideFocus, null/* cancelFuc */);
  22422. }else if(this.mode == 'panorama'){
  22423. this.flyToPano({
  22424. lookAtPoint: o.aim.clone() ,
  22425. pano: this.currentPano,
  22426. aimDuration: o.dur || 600
  22427. })
  22428. }
  22429. }
  22430. /*
  22431. 切换到某个模式后再执行函数
  22432. */
  22433. n.prototype.FlyToMode = function(mode, f1, duration){
  22434. var f2;
  22435. if (this.mode == mode) {
  22436. f1 && f1()
  22437. } else {
  22438. f2 = f1;
  22439. if (this.mode == "transitioning" && this.modeTran.split('-')[1] != mode) {//正飞向其他模式,就要先飞完再飞进来然后执行
  22440. this.afterCModeFuc = function() {
  22441. /* objects.gui.modeChange[mode](null, {
  22442. fuc: f2 这个写法会使得先添加的回调fuc取代之后添加的afterCModeFuc,所以统一改为afterCModeFuc
  22443. }); */
  22444. this.afterCModeFuc = f2
  22445. this.flyToNewMode({mode:mode, pano: mode == "panorama" && this.currentPano,
  22446. //callback : f2
  22447. });
  22448. //这个fuc在trainsitioning状态下传入是无效的,所以后面得用afterCModeFuc。但是执行完afterCModeFuc,afterCModeFuc会变为null,所以里面得用fuc。。orz
  22449. }.bind(this)
  22450. } else {
  22451. if(this.afterCModeFuc)console.log("已经有afterCModeFuc了!!!!!!!!!!!!!!!")
  22452. this.afterCModeFuc = f2;//飞入后执行
  22453. try{ //在场景刚开始加载 control还没建好时这句可能会报错所以用try。 不用callback而用 afterCModeFuc也是这个原因,因为会有别的函数可以飞入然后执行它
  22454. this.flyToNewMode({mode:mode, pano: mode == "panorama" && this.currentPano, duration:duration});
  22455. }catch(e){
  22456. console.log('FlyToMode遇到问题?')
  22457. }
  22458. }
  22459. }
  22460. }
  22461. n.prototype.fastForwardActivePanoFlight = function(e) {
  22462. e = e || f.transition.fastForwardFactor / 10 * 4 + 1
  22463. y.adjustSpeed(V.FlyToPano, e)
  22464. y.adjustSpeed(V.LookTransition, e)
  22465. }
  22466. ,
  22467. n.prototype.flyToPanoClosestToMouse = function() {
  22468. if (Date.now() - this.mouseLastMoveTime > 50 && (this.intersect = this.getMouseIntersect(),
  22469. this.intersect && this.updateClosestPano(this.intersect)),
  22470. this.closestPano)
  22471. return this.flyToPano({
  22472. pano: this.closestPano
  22473. });
  22474. var e = this.getMouseDirection();
  22475. this.flyDirection(e) || this.flyToPano({
  22476. pano: this.currentPano
  22477. })
  22478. }
  22479. ,
  22480. n.prototype.flyLocalDirection = function(e) {
  22481. var t = this.getDirection(e)
  22482. , i = 1 === e.z ? .4 : .75
  22483. , n = 1 === Math.abs(e.x);
  22484. return this.flyDirection(t, i, n)
  22485. }
  22486. ,
  22487. n.prototype.flyDirection = function(e, t, i) {
  22488. Hot.closePopup();//xzw add
  22489. var n = $.Deferred();
  22490. this.history.invalidate();
  22491. var r = this.closestPanoInDirection(e, t, i);
  22492. return r ? this.flyToPano({
  22493. pano: r
  22494. }, n.resolve.bind(n, !0)) : (this.bump(e),
  22495. n.resolve(!1)),
  22496. n.promise()
  22497. }
  22498. ,
  22499. n.prototype.closestPanoInDirection = function(e, t, i) {
  22500. return this.rankedPanoInDirection(0, e, t, i)
  22501. }
  22502. ,
  22503. n.prototype.rankedPanoInDirection = function() {
  22504. var e = {
  22505. pano: null,
  22506. candidates: []
  22507. };
  22508. return function(t, i, n, r) {
  22509. t || (t = 0),
  22510. n = void 0 !== n ? n : .75;
  22511. var o = r ? "angle" : "direction";
  22512. 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),
  22513. this.cachedPanoCandidates = e.candidates,
  22514. e.pano
  22515. }
  22516. }(),
  22517. n.prototype.bump = function(e) {
  22518. if (this.mode === u.PANORAMA && !this.flying && !this.isWarping()) {
  22519. 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;
  22520. if (s)
  22521. t = function() {
  22522. y.start(v.property(this.cameraControls.cameras[u.PANORAMA], "zoom", a > 0 ? 1.04 : .96), o, i, 0, A.easeInOutSine, "bumpZStart")
  22523. }
  22524. .bind(this),
  22525. i = function() {
  22526. y.start(v.property(this.cameraControls.cameras[u.PANORAMA], "zoom", 1), 5 * o, n, 0, A.easeInOutSine, "bumpZRelax")
  22527. }
  22528. .bind(this);
  22529. else {
  22530. var l = this.camera.position.clone()
  22531. , c = e.clone();
  22532. this.raycaster.set(l, c);
  22533. var h = this.model.floors.reduce(function(e, t) {
  22534. return e.concat(t.collider.children)
  22535. }, [])
  22536. , d = this.raycaster.intersectObjects(h)
  22537. , p = d.length > 0 ? d[0].distance / 25 : .04
  22538. , g = l.clone().add(c.multiplyScalar(p));
  22539. t = function() {
  22540. y.start(v.vector(this.cameraControls.cameras[u.PANORAMA].position, g), o, i, 0, A.easeInOutSine, "bumpTStart")
  22541. }
  22542. .bind(this),
  22543. i = function() {
  22544. y.start(v.vector(this.cameraControls.cameras[u.PANORAMA].position, l), 5 * o, n, 0, A.easeInOutSine, "bumpTRelax")
  22545. }
  22546. .bind(this)
  22547. }
  22548. n = function() {
  22549. this.flying = !1
  22550. }
  22551. .bind(this),
  22552. this.flying = !0,
  22553. t()
  22554. }
  22555. }
  22556. ,
  22557. n.prototype.changeFloor = function(e) {
  22558. if (!this.is360View(this.mode, this.currentPano))
  22559. if (this.mode === u.PANORAMA) {
  22560. var t = this.history.reversePano(e);
  22561. t && t.isAligned() ? this.flyToPano({
  22562. pano: t
  22563. }) : this.changeFloorByScore(e)
  22564. } else
  22565. this.model.setFloor(this.model.nextFloor(e) || this.model.currentFloor)
  22566. }
  22567. ,
  22568. n.prototype.changeFloorByScore = function() {
  22569. var e = {
  22570. pano: null,
  22571. candidates: []
  22572. };
  22573. return function(t) {
  22574. var i = this.model.nextFloor(t);
  22575. 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),
  22576. void (e.pano ? (this.cachedPanoCandidates = e.candidates,
  22577. this.history.push(t, this.currentPano),
  22578. this.flyToPano({
  22579. pano: e.pano
  22580. })) : F.warn("No pano found on selected floor, not moving there."))) : void F.debug("player.changeFloor(" + t + "): no such floor")
  22581. }
  22582. }(),
  22583. n.prototype.gotoFloor = function(e) {
  22584. var t = e - this.model.currentFloor.floorIndex;
  22585. this.changeFloor(t)
  22586. }
  22587. ,
  22588. n.prototype.getDirection = function(e) {
  22589. return e = e ? e : (new r.Vector3).copy(d.FORWARD),
  22590. e.applyQuaternion(this.camera.quaternion)
  22591. }
  22592. ,
  22593. n.prototype.flyToSameMode = function(e, t, i, n, o) {
  22594. if (o = o || $.Deferred(),
  22595. this.mode === u.TRANSITIONING)
  22596. return F.warn("should not be transitioning here"),
  22597. n && n(!1),
  22598. o.reject().promise();
  22599. var a = i || !1
  22600. , s = i ? i.position : this.position
  22601. , l = this.position.clone()
  22602. , c = this.currentPano;
  22603. if (F.debug("New pose in mode " + this.mode),
  22604. !e || (retryCallback = function() {
  22605. N.delayOneFrame(function() {
  22606. this.flyToSameMode(e, t, i, n, o)
  22607. }
  22608. .bind(this))
  22609. }
  22610. .bind(this),
  22611. !this.checkAndWaitForPanoLoad(e, "high", "low", this.basePanoSize, retryCallback))) {
  22612. var h = function() {
  22613. this.emit(w.FlyingEnded, s, l, e, c),
  22614. n && n(!0)
  22615. }
  22616. .bind(this)
  22617. , d = f[this.mode]
  22618. , p = void 0 !== t ? t : d.transitionTime
  22619. , g = new r.Vector3
  22620. , C = new r.Vector3;
  22621. if (this.emit(w.FlyingStarted, s, l, e, c),
  22622. this.mode === u.PANORAMA)
  22623. F.warn("we should not be here for panorama views");
  22624. else if (this.mode === u.DOLLHOUSE)
  22625. if (a) {
  22626. var I = new r.Vector3(0,1,0);
  22627. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(1, !0),
  22628. this.model.warpDestFloors(i.floorVisibility),
  22629. C.copy(i.position);
  22630. var E = new r.Vector3(0,0,-1).applyQuaternion(i.quaternion)
  22631. , b = new r.Raycaster(C.clone(),E.clone(),0,1 / 0)
  22632. , _ = b.intersectObjects(this.model.colliders)
  22633. , T = 3;
  22634. _.length ? (g.copy(_[0].point),
  22635. T = .75 * C.distanceTo(g)) : (g.copy(E).multiplyScalar(3).add(C),
  22636. F.debug("Tried to restore dollhouse mode that did not intersect...", i.position, i.quaternion));
  22637. var x = (new r.Matrix4).lookAt(C, g, I)
  22638. , S = (new r.Euler).setFromRotationMatrix(x, f.warp.eOrder)
  22639. , M = g.distanceTo(C)
  22640. , R = (new r.Matrix4).lookAt(this.cameraControls.cameras[u.DOLLHOUSE].position, this.cameraControls.controls[u.DOLLHOUSE].target, I)
  22641. , P = (new r.Euler).setFromRotationMatrix(R, f.warp.eOrder)
  22642. , O = this.cameraControls.cameras[u.DOLLHOUSE].position.distanceTo(this.cameraControls.controls[u.DOLLHOUSE].target);
  22643. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(Math.min(O, T), !0);
  22644. var L = new r.Euler(S.x - P.x,S.y - P.y,S.z - P.z,f.warp.eOrder);
  22645. L.y = L.y > Math.PI ? L.y -= 2 * Math.PI : L.y < -Math.PI ? L.y += 2 * Math.PI : L.y,
  22646. this.path.burnsDir = Math.sign(L.y);
  22647. var D = new r.Euler(0,0,0,f.warp.eOrder)
  22648. , B = new r.Vector3;
  22649. y.start(v.vector(this.cameraControls.controls[u.DOLLHOUSE].target, g), p, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToSameMode),
  22650. y.start(function(e, t) {
  22651. D.x = P.x + e * L.x,
  22652. D.y = P.y + e * L.y,
  22653. D.z = P.z + e * L.z;
  22654. var i = O + e * (M - O);
  22655. B.set(0, 0, i).applyEuler(D).add(this.cameraControls.controls[u.DOLLHOUSE].target),
  22656. this.cameraControls.cameras[u.DOLLHOUSE].position.copy(B).add(this.model.position)
  22657. }
  22658. .bind(this), p, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToSameMode),
  22659. y.start(function(e, t) {
  22660. this.cameraControls.controls[u.DOLLHOUSE].update(),
  22661. this.quaternion.copy(this.cameraControls.cameras[u.DOLLHOUSE].quaternion),
  22662. this.position.copy(this.cameraControls.cameras[u.DOLLHOUSE].position)
  22663. }
  22664. .bind(this), p, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToSameMode)
  22665. } else
  22666. F.warn("invalid warp destination in flyToSameMode()? ignore it then");
  22667. else if (this.path.placeCpm(),
  22668. this.path.fadeInCpm(f.path.fadeInTime),
  22669. i) {
  22670. this.model.warpDestFloors(i.floorVisibility);
  22671. var U = this.cameraControls.cameras[u.FLOORPLAN]
  22672. , k = this.cameraControls.controls[u.FLOORPLAN]
  22673. , H = k.target.clone()
  22674. , G = i.position.clone().sub(H)
  22675. , z = U.position.clone().sub(k.target)
  22676. , W = z.length()
  22677. , j = new r.Vector3(-1,0,0).applyQuaternion(i.quaternion).normalize()
  22678. , Y = Math.atan2(k.offset.x, k.offset.z)
  22679. , X = Math.atan2(j.x, j.z)
  22680. , Z = k.absoluteScale
  22681. , q = m.convertWorkshopOrthoZoom(i.orthoZoom);
  22682. y.start(function(e, t) {
  22683. k.target.copy(G).multiplyScalar(e).add(H);
  22684. var i = Y + (X - Y) * e;
  22685. k.offset.x = W * Math.sin(i),
  22686. k.offset.z = W * Math.cos(i),
  22687. U.position.copy(k.target).add(k.offset),
  22688. k.absoluteScale = Z + e * (q - Z),
  22689. k.update(),
  22690. this.quaternion.copy(U.quaternion),
  22691. this.position.copy(U.position),
  22692. this.target.copy(k.target),
  22693. this.camera.projectionMatrix.copy(U.projectionMatrix)
  22694. }
  22695. .bind(this), p, null, 0, A[f.flydown.movementEasing], null, V.FlyToSameMode)
  22696. } else
  22697. F.info("flyToSameMode() funny floorplan view? skipping");
  22698. return y.setTimeout(function(e) {
  22699. this.mode = e,
  22700. h(),
  22701. o.resolve(!0)
  22702. }
  22703. .bind(this, this.mode), p, V.FlyToSameMode),
  22704. this.mode = u.TRANSITIONING,
  22705. o.promise()
  22706. }
  22707. }
  22708. ,
  22709. n.prototype.flyToNewMode = function(e, t) {
  22710. Hot.closePopup();//xzw add
  22711. e = e || {};
  22712. var i = e.mode
  22713. , n = e.pano
  22714. , o = e.duration
  22715. , a = e.warpDest
  22716. , s = e.callback
  22717. , l = e.force
  22718. , c = e.quaternion;
  22719. if (t = t || $.Deferred(),
  22720. this.isWarping())
  22721. return F.warn("Player.flyToNewMode() -> Cannot fly when warping"),
  22722. s && s(!1),
  22723. t.reject("Cannot change mode during tour transition").promise();
  22724. if (this.mode === u.TRANSITIONING)
  22725. return s && s(!1),
  22726. t.reject("Cannot change mode during mode transition").promise();
  22727. if (i === this.mode)
  22728. return l ? (this.flyToSameMode(n, o, a, s).done(t.resolve.bind(t)).fail(t.reject.bind(t)),
  22729. t.promise()) : (s && s(!1),
  22730. t.reject("Already in " + i + " mode").promise());
  22731. var h = a || !1;
  22732. F.debug("Switching mode to " + i);
  22733. var d = function() {
  22734. N.delayOneFrame(function() {
  22735. this.flyToNewMode(e, t)
  22736. }
  22737. .bind(this))
  22738. }
  22739. .bind(this);
  22740. if (n && this.checkAndWaitForPanoLoad(n, "low", "low", this.basePanoSize, d))
  22741. return t.promise();
  22742. if (!this.model.meshTexturesLoaded && this.isOutsideMode(i))
  22743. return F.info("Waiting for model textures to be loaded before going out to dollhouse"),
  22744. this.model.waitForLoad(this.model, function() {
  22745. return this.model.meshTexturesLoaded;
  22746. }
  22747. .bind(this)),
  22748. this.model.loadMeshTextures().done(d),
  22749. t.promise();
  22750. this.history.invalidate(),
  22751. this.updateLastView();
  22752. var p = this.mode
  22753. , C = this.cameraControls.cameras[i];
  22754. e = g.deepExtend({}, f[i], f[p + "-" + i]);
  22755. var I = void 0 !== o ? o : e.transitionTime;
  22756. this.emit(w.ModeChanging, p, i, n),
  22757. n && (this.currentPano = n),
  22758. this.switchCameraMode(i, c),
  22759. y.cancelById(V.LookTransition);
  22760. //before fly---------------------
  22761. this.modeTran = p + "-" + i; //add
  22762. if(this.mode == "panorama"){
  22763. if(this.model.floorLogos){
  22764. this.model.floorLogos[0].visible = false;
  22765. this.model.floorLogos[1].visible = false;
  22766. }
  22767. }
  22768. if(i == "panorama"){
  22769. this.transitionPos({type:"beforeFlyIn", pano:n, dur:I})//add
  22770. }else{
  22771. this.transitionPos({type:"beforeFlyOut", dur:I/2})//add
  22772. }
  22773. //------------------------------------
  22774. var _ = (new r.Vector3).copy(this.position);
  22775. if (i === u.PANORAMA){
  22776. this.emit(w.PanoChosen, n, n),
  22777. setTimeout(function() {
  22778. n.floor.enter(i)
  22779. }
  22780. .bind(this), I / 2),
  22781. this.path.fadeOutCpm(f.path.fadeOutTime);
  22782. if(this.model.floorLogos){
  22783. this.model.floorLogos[0].position.copy(n.floorPosition.clone().sub(this.model.position));//改
  22784. this.model.floorLogos[1].position.copy(this.model.floorLogos[0].position);//for floorIcon position
  22785. }
  22786. }else if (i === u.DOLLHOUSE) {
  22787. if (h && (this.model.stayPut = !0),
  22788. a ? (this.cameraControls.controls[u.DOLLHOUSE].resetRanges(1, !0),
  22789. this.model.warpDestFloors(a.floorVisibility)) : this.model.toggleAllFloors(!0),
  22790. this.path.placeCpm(),
  22791. this.path.fadeInCpm(f.path.fadeInTime),
  22792. h) {
  22793. var T = new r.Vector3(this.model.center.x,0,this.model.center.z);
  22794. _.set(15, 10, 15);
  22795. var M = new r.Vector3(0,0,-1).applyQuaternion(a.quaternion)
  22796. , R = new r.Raycaster(a.position.clone(),M.clone(),0,1 / 0)
  22797. , P = R.intersectObjects([this.sceneIntersectionPlane]);
  22798. P.length ? (T.copy(P[0].point),
  22799. _.copy(a.position),
  22800. 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),
  22801. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(3, !0)),
  22802. this.cameraControls.controls[u.DOLLHOUSE].target.copy(T),
  22803. _.add(this.model.position),
  22804. C.position.copy(_),
  22805. this.cameraControls.controls[u.DOLLHOUSE].update()
  22806. }
  22807. } else if (this.path.placeCpm(),
  22808. this.path.fadeInCpm(f.path.fadeInTime),
  22809. a) {
  22810. this.model.warpDestFloors(a.floorVisibility);
  22811. var O = this.cameraControls.cameras[u.FLOORPLAN]
  22812. , L = this.cameraControls.controls[u.FLOORPLAN]
  22813. , D = O.position.clone().sub(L.target)
  22814. , B = new r.Vector3(-1,0,0).applyQuaternion(a.quaternion).normalize()
  22815. , U = Math.atan2(B.x, B.z);
  22816. L.target.copy(a.position);
  22817. var k = D.length();
  22818. L.offset.x = k * Math.sin(U),
  22819. L.offset.y = 0,
  22820. L.offset.z = k * Math.cos(U),
  22821. O.position.copy(L.target).add(L.offset);
  22822. L.target.clone().sub(C.position);
  22823. C.quaternion.copy(a.quaternion),
  22824. L.currentScale = m.convertWorkshopOrthoZoom(a.orthoZoom),
  22825. L.absoluteScale = L.currentScale,
  22826. L.update()
  22827. } else
  22828. this.model.currentFloor.enter(i);
  22829. var H = this.currentPano
  22830. , G = this.position.clone();
  22831. return this.emit(w.FlyingStarted, _, G, n, this.currentPano),
  22832. this.flying = !0,
  22833. this.isOutsideMode(i) && this.is360View(p, H) ? (h || i !== u.DOLLHOUSE || (C.position.set(15, 10, 15),
  22834. C.controls.target.set(this.model.center.x, 0, this.model.center.z),
  22835. C.controls.update()),
  22836. e.blackoutStyle = S.FADEIN,
  22837. I = f.show360Views.transitionTime,
  22838. this.fade360View(I, C, e)) : this.isOutsideMode(p) && this.is360View(i, n) ? (h && this.switchCameraMode(i, h.quaternion),
  22839. this.mode = i,
  22840. this.path && this.path.popOutCpm(),
  22841. e.blackoutStyle = S.END,
  22842. I = f.show360Views.transitionTime,
  22843. this.fade360View(I, C, e)) : (y.start(v.property(this.model, "alpha", e.modelAlpha, null), I * e.modelAlphaLength, null, e.modelAlphaDelay, null, V.FlyToNewMode),
  22844. y.start(v.vector(this.position, C.position), I, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToNewMode),
  22845. y.start(v.quaternion(this.quaternion, C.quaternion), I * e.rotationDuration, null, e.rotationDelay, A[f.flydown.rotationEasing], null, V.FlyToNewMode),
  22846. y.start(v.matrix4(this.camera.projectionMatrix, C.projectionMatrix), I * e.cameraMatrixDuration, null, e.cameraMatrixDelay, e.cameraMatrixEase, null, V.FlyToNewMode),
  22847. y.start(v.uniform(this.model.skybox, "opacity", e.skyboxOpacity), I * e.skyboxOpacityLength, null, e.skyboxOpacityDelay, null, V.FlyToNewMode),
  22848. y.start(v.property(this.reticule.material.uniforms.opacity, "value", 0), I, null, V.FlyToNewMode)),
  22849. y.setTimeout(function() {
  22850. this.flying = !1,
  22851. p === u.PANORAMA && i !== u.PANORAMA ? this.currentPano.exit() : p !== u.PANORAMA && i === u.PANORAMA && (this.currentPano !== H && H.exit(),
  22852. this.currentPano.enter(),
  22853. this.path.placeCpm(),
  22854. this.path.fadeOutCpm(f.path.fadeOutTime),
  22855. this.spider.draw()),
  22856. p === u.DOLLHOUSE && this.cameraControls.controls[u.DOLLHOUSE].resetRanges(),
  22857. this.mode = i,
  22858. this.emit(w.FlyingEnded, _, G, this.currentPano, H)
  22859. //add:
  22860. this.updateMarkerVisi() ;
  22861. (this.mode == u.PANORAMA) && this.updateHotVisible(),
  22862. this.mode == u.PANORAMA&&this.model.floorLogos&&(
  22863. this.model.changefloorLogoOpa({index:0, from:0, opa:1, dur: 150 }),//this.model.floorLogoShow(0,150);
  22864. this.model.floorLogos[0].visible = true
  22865. )
  22866. if (this.afterCModeFuc) {
  22867. //手动加的函数
  22868. var cf = this.afterCModeFuc;
  22869. this.afterCModeFuc = null;//因为可能在执行afterCModeFuc时需要再添加afterCModeFuc所以要置空的话提前
  22870. cf();
  22871. }
  22872. if(this.mode == u.PANORAMA){
  22873. Hot.updateVisibles([this.currentPano])
  22874. }else{
  22875. Hot.updateVisibles(true)
  22876. this.model.hotGroup.children.forEach(overlay=>{
  22877. if(overlay.animateInfo){
  22878. GifTexDeal.start(overlay.animation)
  22879. }
  22880. })
  22881. }
  22882. h && p !== u.PANORAMA && i === u.PANORAMA ? this.startWarp(b.Retain, E.Retain, x.BLACK, null, null, s) : (s && s(),
  22883. t.resolve())
  22884. }
  22885. .bind(this), I, V.FlyToNewMode),
  22886. this.mode = u.TRANSITIONING,
  22887. p == "panorama" && this.updateHotVisible(),
  22888. t.promise()
  22889. }
  22890. ,
  22891. n.prototype.fade360View = function(e, t, i) {
  22892. this.tagManager.hideShowTagsForBlackoutStyle(i.blackoutStyle, e),
  22893. $(this.domElement).fadeOut(.5 * e, function() {
  22894. this.model.skybox.material.uniforms.opacity.value = i.skyboxOpacity,
  22895. this.model.alpha = i.modelAlpha,
  22896. this.position.copy(t.position),
  22897. this.quaternion.copy(t.quaternion),
  22898. this.camera.projectionMatrix.copy(t.projectionMatrix),
  22899. $(this.domElement).fadeIn(.5 * e)
  22900. }
  22901. .bind(this))
  22902. }
  22903. ,
  22904. n.prototype.findDefaultViews = function() {
  22905. this.findDefaultView(this.lastInsideView, !0),
  22906. this.findDefaultView(this.last360View, !1)
  22907. }
  22908. ,
  22909. n.prototype.findDefaultView = function(e, t) {
  22910. var i, n = this.model.heroLocations, r = this.model.panos, o = n.findIndex(function(e) {
  22911. if (e.cameraMode !== u.PANORAMA)
  22912. return !1;
  22913. var i = r.get(e.panoId);
  22914. return i && i.isAligned() === t
  22915. });
  22916. o >= 0 ? (i = r.get(n[o].panoId),
  22917. e.update({
  22918. cameraMode: u.PANORAMA,
  22919. pano: i,
  22920. position: n[o].position,
  22921. quaternion: n[o].quaternion
  22922. })) : (o = r.list.findIndex(function(e) {
  22923. return e.isAligned() === t
  22924. }),
  22925. o >= 0 ? (i = r.list[o],
  22926. e.update({
  22927. cameraMode: u.PANORAMA,
  22928. pano: i,
  22929. position: i.position
  22930. })) : F.warn("There are no", t ? "inside" : "360º", "views in this model"))
  22931. }
  22932. ,
  22933. n.prototype.updateLastView = function() {
  22934. if (this.mode === u.PANORAMA) {
  22935. var e = this.currentPano.isAligned() ? this.lastInsideView : this.last360View;
  22936. e.update({
  22937. pano: this.currentPano,
  22938. position: this.position,
  22939. quaternion: this.quaternion
  22940. })
  22941. }
  22942. }
  22943. ,
  22944. n.prototype.goToLastView = function(e, t) {
  22945. var i = $.Deferred()
  22946. , n = i.resolve.bind(i)
  22947. , r = i.reject.bind(i)
  22948. , o = e ? this.lastInsideView : this.last360View;
  22949. return this.isInMode(u.PANORAMA) && this.currentPano.isAligned() !== e && this.updateLastView(),
  22950. this.isInMode(u.PANORAMA) ? (this.path && this.path.popOutCpm(),
  22951. this.fadeToView(e, o, f.show360Views.transitionTime, t).done(n).fail(r)) : this.isOutsideMode() && this.flyToNewMode({
  22952. mode: o.cameraMode,
  22953. pano: o.pano,
  22954. quaternion: o.quaternion,
  22955. callback: t
  22956. }).done(n).fail(r),
  22957. i.promise()
  22958. }
  22959. ,
  22960. n.prototype.fadeToView = function(e, t, i, n) {
  22961. var r = $.Deferred()
  22962. , o = r.resolve.bind(r)
  22963. , a = r.reject.bind(r);
  22964. if (!t.isValid() || t.cameraMode === u.PANORAMA && !t.pano)
  22965. return F.warn("Tried to fade to an illegal view", t.cameraMode),
  22966. a("Cannot go to illegal view"),
  22967. r.promise();
  22968. var s = (f[t.cameraMode],
  22969. function() {
  22970. $(this.domElement).fadeIn(.5 * i),
  22971. n && n(),
  22972. o()
  22973. }
  22974. .bind(this))
  22975. , l = e ? S.FADEIN : S.END;
  22976. return this.tagManager.hideShowTagsForBlackoutStyle(l, i),
  22977. $(this.domElement).fadeOut(.5 * i, function() {
  22978. this.model.fadePanoMarkers(e ? f.panorama.markerOpacity : 0),
  22979. t.cameraMode === u.PANORAMA ? this.flyToPano({
  22980. pano: t.pano,
  22981. lookAtPoint: d.FORWARD.clone().applyQuaternion(t.quaternion).add(t.pano.position),
  22982. duration: 0
  22983. }, s) : this.flyToNewMode({
  22984. mode: t.cameraMode,
  22985. quaternion: t.quaternion,
  22986. duration: 0,
  22987. callback: s
  22988. })
  22989. }
  22990. .bind(this)),
  22991. r.promise()
  22992. }
  22993. ,
  22994. n.prototype.startWarp = function(e, t, i, n, r, o) {
  22995. if (this.cameraControls.activeControl && (this.cameraControls.activeControl.enabled = !1),
  22996. this.flying)
  22997. return F.warn("Player.startWarp() -> Cannot warp when flying"),
  22998. o && o(),
  22999. !1;
  23000. null !== e && void 0 !== e || (e = b.Show),
  23001. this.history.invalidate()
  23002. e !== b.Retain ? this.path.brushToWarpPano(i, x.BLACK) || (i = x.BLACK) : i = this.path.upcomingTransType;
  23003. var a = this.path.warpDestPano && !this.path.warpDestPano.isAligned();
  23004. return this.emit(w.WarpStarted, a, i, n, r),
  23005. n = n || S.MIDDLE,
  23006. this.path.warpToPano(i, n, r, function() {
  23007. t === E.Slow ? this.path.discardSlow() : t === E.Standard && this.path.discardPathObject(),
  23008. this.emit(w.WarpEnded, i),
  23009. this.cameraControls.activeControl && (this.cameraControls.activeControl.enabled = !0),
  23010. o && o()
  23011. }
  23012. .bind(this)),
  23013. e === b.Hide && this.path.discardPathObject(),
  23014. !0
  23015. }
  23016. ,
  23017. n.prototype.warpToPanoById = function(e, t, i, n, r, o, a, s) {
  23018. return this.path.setWarpDestinationByPanoId(e, t) ? this.startWarp(i, n, r, o, a, s) : (F.warn("Player.warpToPanoById() -> Could not setWarpDestinationByPanoId()"),
  23019. s && s(),
  23020. !1)
  23021. }
  23022. ,
  23023. n.prototype.warpToPanoByHeroIndex = function(e, t, i, n, r, o, a) {
  23024. return this.path.setWarpDestinationByHeroIndex(e) ? this.startWarp(t, i, n, r, o, a) : (F.warn("Player.warpToPanoByHeroIndex() -> Could not setWarpDestinationByHeroIndex()"),
  23025. a && a(),
  23026. !1)
  23027. }
  23028. ,
  23029. n.prototype.warpToPano = function(e, t, i, n, r, o, a, s) {
  23030. return this.warpToPanoById(e.id, t, i, n, r, o, a, s)
  23031. }
  23032. ,
  23033. n.prototype.warpToNonPanoByHeroIndex = function(e, t) {
  23034. return this.path.setWarpDestinationByHeroIndex(e) ? (this.path.warpToNonPano(t),
  23035. !0) : (F.warn("Player.warpToNonPanoByHeroIndex() -> Could not setWarpDestinationByHeroIndex()"),
  23036. t && t(),
  23037. !1)
  23038. }
  23039. ,
  23040. n.prototype.aimTourCamera = function(e, t, i, n) {
  23041. return F.debug("player.aimTourCamera(" + e + ") calling warpToPanoByHeroIndex(" + e + ")"),
  23042. this.warpToPanoByHeroIndex(e, t, i, null, null, null, n)
  23043. }
  23044. ,
  23045. n.prototype.showPathToHeroLocation = function(e) {
  23046. this.path.setWarpDestinationByHeroIndex(e) && this.path.brushToWarpPano(x.STD, x.BLACK)
  23047. }
  23048. ,
  23049. n.prototype.tourInterlude = function(e, t) {
  23050. this.history.invalidate();
  23051. this.path.discardSlow();
  23052. //xzw:
  23053. var defaultRotTime = DATA.tourRotTime * 1000
  23054. var timeEachItem = 2e3 / (DATA.tourWalkSpeed + DATA.tourBlackSpeed) * 200 //预估时间假设每个item飞的时间(如果距离远就少了)
  23055. var currentLocation = this.model.heroLocations[this.director.currentItem[0]]
  23056. var rotTime
  23057. if(currentLocation.rotTime == void 0 || currentLocation.rotTime == ''){
  23058. var restChildCount = currentLocation.heroLocations ? (currentLocation.heroLocations.length-this.director.currentItem[1]-1) : 0
  23059. var hasMusic = currentLocation && currentLocation.musicInfo.music
  23060. if(hasMusic){
  23061. var audioObj = SoundManager.list.find(e=>e.name == 'tour')
  23062. var current = audioObj.audio.currentTime * 1e3 // || 0 //g_tourAudio ? 1e3 * g_tourAudio.currentTime : 0
  23063. rotTime = currentLocation.musicInfo.time - current
  23064. if(restChildCount){//如果当前folder中还有剩下的item,平分一下时间
  23065. rotTime = (rotTime-timeEachItem*restChildCount) / (restChildCount+1);
  23066. }
  23067. }else{
  23068. rotTime = defaultRotTime
  23069. }
  23070. rotTime = Math.max(0, rotTime)
  23071. Log("rotTime "+rotTime +" at item "+this.director.currentItem + (hasMusic ? (",musicCurrentTime:"+current+'音乐总长:'+currentLocation.musicInfo.time) : ''),"#E8E")
  23072. }else{
  23073. rotTime = currentLocation.rotTime * 1000
  23074. Log("rotTime "+rotTime +" at item "+this.director.currentItem,"#E8E")
  23075. }
  23076. this.path.waitNextStep(e, function() {
  23077. t && t()
  23078. }.bind(this), rotTime)
  23079. }
  23080. ,
  23081. n.prototype.stopInterlude = function() {
  23082. this.interruptAndFastForward(null, 0)
  23083. }
  23084. ,
  23085. n.prototype.interruptAndFastForward = function(e, t) {
  23086. //Log('interruptAndFastForward' , '#f00')
  23087. this.isWarping() && this.emit(w.WarpInterrupted, this.path.activeTransType, e, t),
  23088. this.flying && this.emit(w.FlyingInterrupted),
  23089. this.path.interruptAndFastForward(e, t)
  23090. }
  23091. ,
  23092. n.prototype.setSize = function(e, t) {
  23093. var i = e / t;
  23094. this.baseFov = B.clampVFOV(f.insideFOV, f.insideFOVMax, e, t);
  23095. var n = B.getHFOVFromVFOV(f.insideFOV, e, t);
  23096. n > f.insideFOVMax ? this.baseFov = B.getVFOVFromHFOV(f.insideFOVMax, e, t) : this.baseFov = f.insideFOV;
  23097. for (var r in this.cameraControls.cameras) {
  23098. var o = this.cameraControls.cameras[r];
  23099. o.fov = this.baseFov * (1 / this.zoomLevel),
  23100. o.updateAspect(i)
  23101. }
  23102. }
  23103. ,
  23104. n.prototype.toJSON = function() {
  23105. var e = {};
  23106. return this.cameraControls.activeControl ? (e = this.cameraControls.activeControl.toJSON(),
  23107. e.camera_mode = u.toInt(this.mode),
  23108. this.isOutsideMode() ? this.model.allFloorsVisible ? e.floor_visibility = [] : e.floor_visibility = this.model.floors.list.map(function(e) {
  23109. return e.hidden ? 0 : 1
  23110. }) : u.PANORAMA && (e.scan_id = this.currentPano.id),
  23111. e) : e
  23112. }
  23113. ,
  23114. n.prototype.getCurrentNodePanos = function(e) {
  23115. this.model.panos.map;
  23116. if (e.length = 0, this.path.nodes){
  23117. var momentTour = this.director.getMomentTour(this.director.destinationItem)
  23118. if(momentTour == 'black'){ //改 upcomingPanos如果是black的只需要起点和终点
  23119. if(this.path.nodes.length){
  23120. e.push(this.model.panos.get(this.path.nodes[0]))
  23121. }
  23122. if(this.path.nodes.length>1){
  23123. e.push(this.model.panos.get(this.path.nodes[this.path.nodes.length-1]))
  23124. }
  23125. }else{
  23126. for (var t = 0; t < this.path.nodes.length; t++) {
  23127. var i = this.path.nodes[t];
  23128. e.push(this.model.panos.get(i))
  23129. }
  23130. }
  23131. }
  23132. }
  23133. ,
  23134. n.prototype.zoomIncrementally = function(e) {
  23135. var t = this.zoomLevel;
  23136. this.zoomTo(this.zoomLevel + e),
  23137. t !== this.zoomLevel && this.currentPano && this.zoomStats.addZoomAction(t, this.zoomLevel, this.currentPano.id)
  23138. }
  23139. ,
  23140. n.prototype.zoomInIncrementally = function(e) {
  23141. e = e || this.defaultZoomIncrement,
  23142. this.zoomIncrementally(e)
  23143. }
  23144. ,
  23145. n.prototype.zoomOutIncrementally = function(e) {
  23146. e = e || -this.defaultZoomIncrement,
  23147. this.zoomIncrementally(e)
  23148. }
  23149. ,
  23150. n.prototype.zoomBy = function(e) {
  23151. this.zoomTo(this.zoomLevel * e)
  23152. }
  23153. ,
  23154. n.prototype.zoomIn = function() {
  23155. this.zoomBy(1 + this.zoomSpeed)
  23156. }
  23157. ,
  23158. n.prototype.zoomOut = function() {
  23159. this.zoomBy(1 - this.zoomSpeed)
  23160. }
  23161. ,
  23162. n.prototype.zoomTo = function(e, t) {
  23163. if (t || f.zoom.enabled && this.mode === u.PANORAMA && this.zoomEnabled) {
  23164. if (e < f.zoom.min && (e = f.zoom.min),
  23165. e > f.zoom.max && (e = f.zoom.max),
  23166. e > this.zoomLevel ? (this.emit(O.ZoomIn),
  23167. e === f.zoom.max && this.emit(O.ZoomMax)) : e < this.zoomLevel && (this.emit(O.ZoomOut),
  23168. e === f.zoom.min && this.emit(O.ZoomMin)),
  23169. this.cameraControls.activeControl) {
  23170. var i = this.cameraControls.activeControl.camera;
  23171. this.zoomLevel = e,
  23172. i.fov = this.baseFov * (1 / this.zoomLevel),
  23173. i.updateProjectionMatrix(),
  23174. this.zoomFov = i.fov
  23175. }
  23176. }
  23177. }
  23178. ,
  23179. n.prototype.increaseZoomSpeed = function() {
  23180. this.zoomSpeed = this.clampZoomSpeed(this.zoomSpeed + this.zoomSpeedAdjust)
  23181. }
  23182. ,
  23183. n.prototype.decreaseZoomSpeed = function() {
  23184. this.zoomSpeed = this.clampZoomSpeed(this.zoomSpeed - this.zoomSpeedAdjust)
  23185. }
  23186. ,
  23187. n.prototype.clampZoomSpeed = function(e) {
  23188. return e < 0 ? 0 : e
  23189. }
  23190. ,
  23191. n.prototype.activatePersistentZooming = function(e) {
  23192. this.zooming = e ? 1 : -1
  23193. }
  23194. ,
  23195. n.prototype.deactivatePersistentZooming = function() {
  23196. this.zooming = 0
  23197. }
  23198. ,
  23199. n.prototype.zoomDefault = function() {
  23200. this.zoomTo(1, !0)
  23201. }
  23202. ,
  23203. window.fovTranId = 333;//add
  23204. n.prototype.smoothZoomToDefault = function(e, t) {
  23205. y.cancelById(window.fovTranId)
  23206. var i, n = this.zoomLevel,
  23207. r = function(e) {
  23208. e > 1 && (e = 1),
  23209. i = n * (1 - e) + e,
  23210. this.zoomTo(i, !0)
  23211. }.bind(this),
  23212. o = function() {
  23213. this.zoomDefault(),
  23214. t && window.setTimeout(t, 50)
  23215. }.bind(this);
  23216. y.start(r, e, o, null, 0, A[f.transition.blendEasing], null, window.fovTranId)
  23217. }
  23218. n.prototype.smoothZoomFovTo = function (fov, zoomLevel, dur, callback) {//add
  23219. y.cancelById(window.fovTranId)
  23220. console.log("smoothZoomFovTo "+zoomLevel)
  23221. var i,
  23222. n = this.zoomLevel,
  23223. aimLevel = zoomLevel || this.baseFov / fov
  23224. if (n == aimLevel) return
  23225. var fun = function (e) {
  23226. e > 1 && (e = 1), (i = n * (1 - e) + e * aimLevel),
  23227. this.zoomTo(i, !0)
  23228. }.bind(this)
  23229. y.start(fun, dur, callback, null, 0, A[f.transition.blendEasing], null, window.fovTranId)
  23230. }
  23231. ,
  23232. n.prototype.updateZoomPano = function() {
  23233. if (!this.panoRenderer.zoomPanoRenderingDisabled && this.mode === u.PANORAMA) {
  23234. var e = this.currentPano;
  23235. if (e) {
  23236. var t = this.zoomLevel > f.zoom.activationThreshold
  23237. , i = this.flying && this.nextPano && this.nextPano !== this.currentPano
  23238. , n = !i && !this.isWarping()
  23239. , r = t /*&& n*/; // 允许flying状态下加载4K图
  23240. this.tileDownloader.tilePrioritizer.setZoomingActive(r),
  23241. this.panoRenderer.setZoomingActive(r, e, !0);
  23242. var o = function(e, t) {
  23243. this.panoRenderer.resetRenderStatus(e.id, !1, !0, this.qualityManager.getMaxNavPanoSize()),
  23244. this.panoRenderer.clearAllQueuedUploadsForPano(e.id),
  23245. this.panoRenderer.renderPanoTiles(e.id, null, !1, !1),
  23246. e.setZoomed(t)
  23247. }
  23248. .bind(this);
  23249. r && !e.zoomed ? (o(e, !0),
  23250. this.panoRenderer.enableUltraHighQualityMode(function() {
  23251. this.qualityManager.useUltraHighResolutionPanos && !f.zoom.overridemax && (f.zoom.max = D.ultraHighQualityMaxZoom),
  23252. r && o(e, !0)
  23253. }
  23254. .bind(this))) : !t && e.zoomed && o(e, !1)
  23255. }
  23256. }
  23257. },
  23258. n.prototype.checkHasNeighbor = function(pano){//add
  23259. for(var i in pano.neighbourPanos ){
  23260. if(i == pano.id)continue;
  23261. if(pano.neighbourPanos[i]){
  23262. return true;
  23263. }
  23264. }
  23265. }
  23266. ,
  23267. t.exports = n
  23268. }
  23269. ).call(this, "/js/player.js")
  23270. }
  23271. , {
  23272. "./constants": 8,
  23273. "./enum/AlignmentType": 17,
  23274. "./enum/BlackoutStyle": 18,
  23275. "./enum/ControlEvents": 21,
  23276. "./enum/Keys": 30,
  23277. "./enum/ModelManagerEvents": 33,
  23278. "./enum/PanoSizeClass": 36,
  23279. "./enum/PanoramaEvents": 37,
  23280. "./enum/PathDiscardMode": 38,
  23281. "./enum/PathDisplayMode": 39,
  23282. "./enum/PlayerEvents": 40,
  23283. "./enum/TagStates": 44,
  23284. "./enum/Vectors": 50,
  23285. "./enum/Viewmode": 51,
  23286. "./enum/WarpStyle": 52,
  23287. "./enum/ZoomEvents": 53,
  23288. "./exception/BasicException": 55,
  23289. "./model/ModelManager": 140,
  23290. "./objects/NSpider": 147,
  23291. "./objects/Panorama": 148,
  23292. "./objects/Reticule": 149,
  23293. "./objects/ShowPath": 151,
  23294. "./objects/Snapshot": 153,
  23295. "./objects/View": 154,
  23296. "./settings": 166,
  23297. "./shaders": 167,
  23298. "./tile/TileDownloader": 171,
  23299. "./tile/TilePrioritizer": 172,
  23300. "./util/ZoomStats": 179,
  23301. "./util/browser": 182,
  23302. "./util/camera": 183,
  23303. "./util/cameraLight": 184,
  23304. "./util/common": 185,
  23305. "./util/easing": 186,
  23306. "./util/history": 187,
  23307. "./util/lerp": 188,
  23308. "./util/logger": 189,
  23309. "./util/math": 190,
  23310. "./util/transitions": 195,
  23311. "hot":"hot",
  23312. "scaleImg":"scaleImg",
  23313. events: 202,
  23314. three: 217
  23315. }],
  23316. "scaleImg":[function(t, e){// xzw
  23317. var OUTPUT = e;
  23318. (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")}
  23319. function n(t){if(t){var e,a=G.getImageData(0,0,s,f),i=a.data;for(e=0;at>e;e+=4)
  23320. 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}
  23321. return G.getImageData(0,0,s,f)}
  23322. 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}
  23323. a||(a=t.input,i=t.output,r=t.inputRemovable,t.scale&&(t=t.scale));var u,d;if(a.src)
  23324. if(u=document.createElement("canvas"),null!=a.naturalWidth)
  23325. 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}
  23326. else
  23327. 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)
  23328. 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)
  23329. for(h(),J=n(),K=J.data,x=0;f>x;x++)
  23330. 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)
  23331. 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)
  23332. W=new Float32Array(at);else
  23333. for(W=[],et=0;at>et;++et)
  23334. W[et]=0;for(b=0;w>b;b++)
  23335. 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)
  23336. 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;}
  23337. delete p,h(),J=n(W)}
  23338. 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}
  23339. if("png-src"===i||"jpeg-src"===i)
  23340. return B.toDataURL("image/"+i.split("-")[0],0.85)}
  23341. return B}
  23342. var e=this;"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=t),exports.scale=t):c=t}).call(this);
  23343. OUTPUT.exports = c;
  23344. }, {}
  23345. ],
  23346. 156: [function(e, t, i) {
  23347. (function(i) {
  23348. "use strict";
  23349. function n(e, t) {
  23350. this.model = e,
  23351. this.panos = e.panos,
  23352. this.player = t,
  23353. this.imagePanos = this.listImagePanos(),
  23354. this.retryMinimumTime = 1e4
  23355. }
  23356. var r = (e("three"),
  23357. e("./enum/Viewmode"))
  23358. , o = (e("./settings"),
  23359. e("./objects/Panorama"))
  23360. , a = e("./util/logger")
  23361. , s = new a(i);
  23362. n.prototype.start = function() {
  23363. this.loadNextPano(function(e) {
  23364. e ? this.start() : (s.debug("No suitable pano loaded, waiting a little while before looking again"),
  23365. setTimeout(function() {
  23366. this.start()
  23367. }
  23368. .bind(this), 1e3))
  23369. }
  23370. .bind(this))
  23371. }
  23372. ,
  23373. n.prototype.validLoadTarget = function(e) {
  23374. return e && !e.isLoaded("high") && Date.now() - e.failedLoadingAt > this.retryMinimumTime
  23375. }
  23376. ,
  23377. n.prototype.listImagePanos = function() {
  23378. var e = []
  23379. , t = this;
  23380. return this.model.images.forEach(function(i) {
  23381. if (i.metadata && i.metadata.scan_id) {
  23382. var n = t.model.panos.get(i.metadata.scan_id);
  23383. n && !n.isLoaded("high") && e.push(n)
  23384. }
  23385. }),
  23386. e
  23387. }
  23388. ,
  23389. n.prototype.nextNotLoadedImage = function() {
  23390. for (; this.imagePanos.length > 0; ) {
  23391. var e = this.imagePanos[0];
  23392. if (!e.isLoaded("high"))
  23393. return e;
  23394. this.imagePanos.shift()
  23395. }
  23396. return null
  23397. }
  23398. ,
  23399. n.prototype.loadNextPano = function(e) {
  23400. var t, i, n = this.model.waitQueue.filter(function(e) {
  23401. return e.object instanceof o
  23402. });
  23403. n.length > 0 ? (t = n[0].object,
  23404. s.debug("Overrode pano selection: Flying to an unloaded pano " + t.id)) : this.validLoadTarget(this.player.currentPano) ? (t = this.player.currentPano,
  23405. s.debug("Overrode pano selection: Currently at an unloaded pano " + t.id)) : this.validLoadTarget(this.player.closestPano) ? (t = this.player.closestPano,
  23406. s.debug("Overrode pano selection: Hovering over an unloaded pano " + t.id)) : this.validLoadTarget(this.nextNotLoadedImage()) ? (i = "high",
  23407. t = this.imagePanos[0],
  23408. 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())]),
  23409. t && s.debug("Normal pano selection: neighbor " + t.id)),
  23410. t ? (i = i || t.isLoaded("low") ? "high" : "low",
  23411. s.debug("Preloading " + i + "-res pano " + t.id),
  23412. t.loadCube(i).done(e).fail(function() {
  23413. s.warn("Failed preloading pano", t.id, ", marking it as failed and forgetting it for a while"),
  23414. e()
  23415. })) : e && e(null)
  23416. }
  23417. ,
  23418. t.exports = n
  23419. }
  23420. ).call(this, "/js/preloaders.js")
  23421. }
  23422. , {
  23423. "./enum/Viewmode": 51,
  23424. "./objects/Panorama": 148,
  23425. "./settings": 166,
  23426. "./util/logger": 189,
  23427. three: 217
  23428. }],
  23429. 157: [function(e, t, i) {
  23430. (function(i) {
  23431. "use strict";
  23432. function n(e, t, i, n, r) {
  23433. this.qualityManager = e,
  23434. this.scene = t,
  23435. this.camera = i,
  23436. this.container = r,
  23437. this.controls = n,
  23438. this.controls.enabled = !0,
  23439. this.controls.locked = !0,
  23440. this.quickstartCamera = n.camera,
  23441. this.quickstartCamera.fov = h.clampVFOV(a.insideFOV, a.insideFOVMax, $("#player").width(), $("#player").height()),
  23442. this.skybox = null
  23443. }
  23444. var r = e("three")
  23445. , o = e("../util/logger")
  23446. , a = e("../constants")
  23447. , s = (e("../util/transitions"),
  23448. e("../util/lerp"),
  23449. e("../util/easing"),
  23450. e("../enum/Vectors"))
  23451. , l = e("../enum/PanoSizeClass")
  23452. , c = (e("../materials/ModelTextureMaterial"),
  23453. e("../materials/CubemapMaterial"))
  23454. , h = (e("../cameras/PanoramaCamera"),
  23455. e("../controls/PanoramaControls"),
  23456. e("../tile/TileUtils"),
  23457. e("../util/camera"),
  23458. e("../util/cameraLight"))
  23459. , u = (e("../util/browser"),
  23460. e("../settings"),
  23461. e("../gui/helpManager"),
  23462. new o(i));
  23463. n.prototype.load = function(e) {
  23464. e.pano.shouldRedrawOnBaseLoaded = !0;
  23465. var t, i, n = this, r = s.FORWARD.clone().applyQuaternion(e.quaternion), o = r.clone().negate();
  23466. this.controls.lookAt(r.add(this.quickstartCamera.position));
  23467. var a = this.qualityManager.getPanoSize(l.BASE)
  23468. , c = this.qualityManager.getPanoSize(l.STANDARD);
  23469. if (e.pano.tiled) {
  23470. u.warn("Loading startPano, TILED", e.pano.id);
  23471. var d = h.getHFOVForCamera(this.quickstartCamera, $("#player").width(), $("#player").height())
  23472. , p = this.quickstartCamera.fov;
  23473. u.warn("Quickstart loading tiles in frustum: [horizontal FOV: " + d + ", vertical FOV: " + p + "]"),
  23474. t = e.pano.loadTiledPano(c, r, {
  23475. hFov: d,
  23476. vFov: p
  23477. }, !1, !1, !0),
  23478. i = e.pano.loadTiledPano(a, o, null, !1, !1, !0)
  23479. } else
  23480. u.warn("Loading startPano", e.pano.id),
  23481. t = e.pano.loadCube("high");
  23482. return $.when(t).then(function() {
  23483. n.init(e.pano, e.quaternion),
  23484. e.pano.tiled ? i.done(function() {
  23485. e.pano.lockUntilRenderingComplete = !1,
  23486. this.controls.locked = !1
  23487. }
  23488. .bind(this)) : this.controls.locked = !1
  23489. }
  23490. .bind(this))
  23491. }
  23492. ,
  23493. n.prototype.init = function(e, t) {
  23494. u.info("Quickstart done loading, adding scene objects"),
  23495. e.lockUntilRenderingComplete = !0,
  23496. this.skybox = new r.Mesh(new r.CubeGeometry(1,1,1),new c({
  23497. side: r.BackSide
  23498. })),
  23499. this.skybox.material.uniforms.map.value = e.getSkyboxTexture(),
  23500. this.skybox.quaternion.copy(e.quaternion),
  23501. this.scene.add(this.skybox),
  23502. $(this.container).show()
  23503. }
  23504. ,
  23505. n.prototype.update = function(e) {
  23506. this.controls.update(e),
  23507. this.camera.copy(this.quickstartCamera)
  23508. }
  23509. ,
  23510. n.prototype.setSize = function(e, t) {
  23511. this.quickstartCamera.updateAspect(e / t)
  23512. }
  23513. ,
  23514. n.prototype.destroy = function() {
  23515. this.scene.remove(this.skybox)
  23516. }
  23517. ,
  23518. t.exports = n
  23519. }
  23520. ).call(this, "/js/scene/QuickstartManager.js")
  23521. }
  23522. , {
  23523. "../cameras/PanoramaCamera": 7,
  23524. "../constants": 8,
  23525. "../controls/PanoramaControls": 13,
  23526. "../enum/PanoSizeClass": 36,
  23527. "../enum/Vectors": 50,
  23528. "../gui/helpManager": 68,
  23529. "../materials/CubemapMaterial": 117,
  23530. "../materials/ModelTextureMaterial": 118,
  23531. "../settings": 166,
  23532. "../tile/TileUtils": 174,
  23533. "../util/browser": 182,
  23534. "../util/camera": 183,
  23535. "../util/cameraLight": 184,
  23536. "../util/easing": 186,
  23537. "../util/lerp": 188,
  23538. "../util/logger": 189,
  23539. "../util/transitions": 195,
  23540. three: 217
  23541. }],
  23542. 158: [function(e, t, i) {
  23543. "use strict";
  23544. function n(e, t, i) {
  23545. this.scene = e,
  23546. this.camera = t,
  23547. this.renderer = null,
  23548. this.effects = i,
  23549. this.animateCallback = null,
  23550. this.composer = null,
  23551. this.qualityManager = null,
  23552. e.renderWidth = 0,
  23553. e.renderHeight = 0,
  23554. this.updateClock = new r.Clock,
  23555. this.components = [],
  23556. this.updateListeners = [],
  23557. this.resizeListeners = [],
  23558. this.forceUpdateSize = !1,
  23559. this.started = !1,
  23560. this.textures = {},
  23561. this.suspendedObjects = []
  23562. }
  23563. var r = e("three")
  23564. , o = e("../shaders")
  23565. , a = e("../enum/SceneRendererEvents")
  23566. , s = e("../enum/GLTextureType")
  23567. , l = e("../enum/GLCubeFaces")
  23568. , c = e("../exception/BasicException")
  23569. , h = e("../exception/RendererCreationException")
  23570. /**********************************************************************fyz改 from徐世廷**********************************************************************/
  23571. , m = e("../util/browser")
  23572. /**************************************************************************************************************************************************/
  23573. , u = e("../settings")
  23574. , d = e("events").EventEmitter;
  23575. window.requestAnimationFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame,
  23576. n.prototype = Object.create(d.prototype),
  23577. n.prototype.addComponent = function(e) {
  23578. this.components.push(e),
  23579. e.update && this.updateListeners.push(e),
  23580. e.setSize && (this.resizeListeners.push(e),
  23581. this.forceUpdateSize = !0)
  23582. }
  23583. ,
  23584. n.prototype.removeComponent = function(e) {
  23585. var t = function(t) {
  23586. return t !== e
  23587. };
  23588. this.components = this.components.filter(t),
  23589. this.updateListeners = this.updateListeners.filter(t),
  23590. this.resizeListeners = this.resizeListeners.filter(t)
  23591. }
  23592. ,
  23593. n.prototype.start = function(e) {
  23594. if (this.started)
  23595. throw new c("Can't start SceneRenderer, already started");
  23596. this.createContext(e),
  23597. /***************************************************VR fyz改 from徐世廷**********************************************************************/
  23598. m.isMobile() && this.boluoVrInit(),
  23599. /*******************************************************************************************************************************/
  23600. this.initComposer(),
  23601. this.started = !0,
  23602. (p = p.bind(this))()
  23603. }
  23604. ,
  23605. n.prototype.createContext = function(e) {
  23606. var transparent = !!(settings.transparentBg || settings.bgImg)
  23607. try {
  23608. this.renderer = new r.WebGLRenderer({antialias: !m.isMobile(), alpha:transparent}),
  23609. this.renderer.autoClear = !0,
  23610. this.renderer.setPixelRatio(window.devicePixelRatio ? window.devicePixelRatio : 1),
  23611. this.renderer.setSize($("#player").width(), $("#player").height(), false), //改
  23612. transparent && this.renderer.setClearColor( 0x000000, 0 ); //透明
  23613. this.emit(a.ContextCreated)
  23614. } catch (e) {
  23615. throw new h("Unable to create a WebGL rendering context")
  23616. }
  23617. u.profiling.enabled && this.overrideTextures(),
  23618. e.appendChild(this.renderer.domElement)
  23619. /* window.stats = new Stats();
  23620. e.appendChild( stats.dom ); */
  23621. }
  23622. ,
  23623. n.prototype.overrideTextures = function() {
  23624. var e = this.renderer.context
  23625. , t = 0
  23626. , i = e.createTexture;
  23627. e.createTexture = function() {
  23628. var n = i.call(e);
  23629. return n.id = t++,
  23630. this.textures[n.id] = n,
  23631. n
  23632. }
  23633. .bind(this);
  23634. var n = e.texImage2D;
  23635. e.texImage2D = function(t, i, r, o, a, l, c, h, u) {
  23636. var d, p = this.getTextureTypeFromTarget(e, t);
  23637. d = p === s.TextureCube ? e.getParameter(e.TEXTURE_BINDING_CUBE_MAP) : e.getParameter(e.TEXTURE_BINDING_2D),
  23638. void 0 !== c ? n.call(e, t, i, r, o, a, l, c, h, u) : (c = o,
  23639. h = a,
  23640. u = l,
  23641. o = u.naturalWidth,
  23642. a = u.naturalHeight,
  23643. n.call(e, t, i, r, c, h, u));
  23644. var f = this.textures[d.id];
  23645. f.width = p === s.TextureCube ? 6 * o : o,
  23646. f.height = a
  23647. }
  23648. .bind(this);
  23649. var r = e.deleteTexture;
  23650. e.deleteTexture = function(t) {
  23651. delete this.textures[t.id],
  23652. r.call(e, t)
  23653. }
  23654. .bind(this)
  23655. }
  23656. ,
  23657. n.prototype.updateTextureMemory = function() {
  23658. var e = null;
  23659. return function() {
  23660. var t = 0;
  23661. for (var i in this.textures) {
  23662. var n = this.textures[i];
  23663. n.width && n.height && (t += n.width * n.height * 4)
  23664. }
  23665. t !== e && this.emit(a.MemoryUsageUpdated, t),
  23666. e = t
  23667. }
  23668. }(),
  23669. n.prototype.getTextureTypeFromTarget = function(e, t) {
  23670. switch (t) {
  23671. case e.TEXTURE_CUBE_MAP_POSITIVE_X:
  23672. case e.TEXTURE_CUBE_MAP_NEGATIVE_X:
  23673. case e.TEXTURE_CUBE_MAP_POSITIVE_Y:
  23674. case e.TEXTURE_CUBE_MAP_NEGATIVE_Y:
  23675. case e.TEXTURE_CUBE_MAP_POSITIVE_Z:
  23676. case e.TEXTURE_CUBE_MAP_NEGATIVE_Z:
  23677. return s.TextureCube;
  23678. case e.TEXTURE_2D:
  23679. return s.Texture2D;
  23680. default:
  23681. return null
  23682. }
  23683. }
  23684. ,
  23685. n.prototype.initComposer = function() {
  23686. this.composer = new r.EffectComposer(this.renderer),
  23687. this.composer.addPass(new r.RenderPass(this.scene,this.camera)),
  23688. //this.composer.addPass(this.effects.hblurPass),
  23689. //this.composer.addPass(this.effects.vblurPass)
  23690. this.composer.addPass(this.effects.transitionMaskPass)//add
  23691. }
  23692. ,
  23693. n.prototype.setSize = function(e, t, devicePixelRatio) {
  23694. this.renderWidth = e,
  23695. this.renderHeight = t,
  23696. this.effects.aspect = e / t,
  23697. /* this.renderer.setSize(e, t), -----MP */
  23698. this.renderer.setSize(e, t, false, devicePixelRatio), //改 为了防止给canvas设置宽高
  23699. this.composer.setSize(e, t);
  23700. for (var i = 0; i < this.resizeListeners.length; i++)
  23701. this.resizeListeners[i].setSize(e, t)
  23702. }
  23703. ,
  23704. n.prototype.render = function() {
  23705. //this.effects.currentBlur > 0 ? this.composer.render() : this.renderer.render(this.scene, this.camera)
  23706. this.effects.transitionMaskPass.enabled ? this.composer.render() : this.renderer.render(this.scene, this.camera)
  23707. }
  23708. /******************************************************************************************************徐世廷**********************************************************************/
  23709. var vrPermission = {};
  23710. var vrPermissionCallBack = function(info1,info2){
  23711. if(info1 == "reset"){
  23712. vrPermission = {};
  23713. }else{
  23714. vrPermission[info1] = info2
  23715. if(Object.keys(vrPermission).length == 2 && (vrPermission.deviceMotion != "granted" || vrPermission.deviceOrientation != "granted")){
  23716. alert("运动和方向访问失败。这会导致画面视角一直固定。您需要完全关闭此应用,然后再次打开,并允许访问运动与方向。" )
  23717. }
  23718. }
  23719. }
  23720. n.prototype.boluoVrInit = function() {
  23721. console.log("boluoVrInit")
  23722. this.isHuawei5X = m.detectHUAWEI5X(),
  23723. this.oldRenderer = this.renderer,
  23724. this.newRenderer = new this.vrRenderer(this.renderer,this,this.camera);
  23725. window.panoCamera = this.camera;
  23726. var a = this;
  23727. window._vrEnabled = !1,
  23728. Object.defineProperty(window, "vrEnabled", {
  23729. get: function() {
  23730. return window._vrEnabled
  23731. },
  23732. set: function(b) {
  23733. b = !!b,
  23734. b ? (a.renderer = a.newRenderer,
  23735. window.vrMarkers.forEach(function(a) {
  23736. a.visible = !0
  23737. })) : (a.renderer = a.oldRenderer,
  23738. window.vrMarkers.forEach(function(a) {
  23739. a.visible = !1
  23740. })),
  23741. a.cursor.visible = b,
  23742. a.setSize(window.innerWidth, window.innerHeight),
  23743. window._vrEnabled = b
  23744. if(b){
  23745. setTimeout(function(){
  23746. console.log("orientEnable"+window.orientEnable)
  23747. if(window.vrEnabled && !window.orientEnable){//很可能没能触发陀螺仪事件
  23748. if(m.detectIOS()/* && m.detectSafari() */){
  23749. var b = m.iosVersion();//{major: 10, minor: 3, patch: 1}
  23750. console.log("开始获取权限 major"+b.major)
  23751. if(b.major == 12 && b.minor>=2){
  23752. if(browser.detectSafari()) alert("浏览器未能检测到转动。为完整体验VR效果,请打开 “设置” > “Safari” > “隐私和安全” 下的 “运动和方向访问” 开关,然后刷新此页面。")
  23753. else{//app??
  23754. alert("浏览器未能检测到转动。请在手机或浏览器设置中开启了运动和方向访问等设置,然后刷新此页面。")
  23755. }
  23756. }else if(b.major >= 13){
  23757. if(!window.location.href.includes("https://")){
  23758. console.log("需要https");
  23759. alert("当前网页下,高于ios12的浏览器版本可能不支持陀螺仪开启。")
  23760. return;
  23761. }
  23762. var hasFailed = window.vrPermission && (window.vrPermission.deviceMotion != "granted" || window.vrPermission.deviceOrientation != "granted")
  23763. setTimeout(()=>{//如果使用了alert会阻断这个事件,报以下错requusting device orientation or motion access requires a user gesture
  23764. if(!window.vrEnabled || window.orientEnable)return;
  23765. vrPermissionCallBack("reset")
  23766. console.log(window.DeviceMotionEvent)
  23767. if ( window.DeviceMotionEvent && window.DeviceMotionEvent.requestPermission && typeof window.DeviceMotionEvent.requestPermission === 'function') {
  23768. console.log("开始获取权限1")
  23769. ///注意:需要https 本地服务器permissionState会得到denied
  23770. window.DeviceMotionEvent.requestPermission().then(permissionState => {
  23771. console.log("permissionState1: "+permissionState)
  23772. vrPermissionCallBack("deviceMotion", permissionState)
  23773. }).catch(function(e){
  23774. vrPermissionCallBack("deviceMotion", false)
  23775. console.log(e)
  23776. })
  23777. }else{
  23778. console.log("window.DeviceMotionEvent undefined")
  23779. vrPermissionCallBack("deviceMotion", false)
  23780. }
  23781. if ( window.DeviceOrientationEvent && window.DeviceOrientationEvent.requestPermission && typeof window.DeviceOrientationEvent.requestPermission === 'function') {
  23782. console.log("开始获取权限2")
  23783. window.DeviceOrientationEvent.requestPermission().then(permissionState => {
  23784. console.log("permissionState2: "+permissionState)
  23785. vrPermissionCallBack("deviceOrientation", permissionState)
  23786. }).catch(function(e){
  23787. vrPermissionCallBack("deviceOrientation", false)
  23788. console.log(e)
  23789. })
  23790. }else{
  23791. console.log("window.DeviceOrientationEvent undefined")
  23792. vrPermissionCallBack("deviceOrientation", false)
  23793. }
  23794. },hasFailed ? 0 : 150)
  23795. /* /* setTimeout(function(){
  23796. if(settings.vrEnabled && !window.orientEnable){
  23797. $alert("若画面视角一直固定,您需要完全关闭Safari浏览器,然后再次打开以开启运动和方向访问。")
  23798. }
  23799. },4000) */
  23800. }else console.log("陀螺仪未能启用 ios "+b.major+"."+b.minor)
  23801. }else{
  23802. //$alert("浏览器未能检测到转动", "请在手机或浏览器设置中开启了运动和方向访问等设置,然后刷新此页面。")
  23803. }
  23804. }else{
  23805. //已经触发了
  23806. }
  23807. },200);
  23808. }
  23809. }
  23810. }),
  23811. this.createCursor(.5, !1, 1, 16777215, 0);
  23812. var b = {
  23813. setSize: function(b, c) {
  23814. a.camera.aspect = b / c
  23815. }
  23816. };
  23817. this.resizeListeners.push(b),
  23818. this.vrLoadingInit()
  23819. }
  23820. ,
  23821. n.prototype.vrLoadingInit = function() {
  23822. var a = function(camera) {
  23823. var a = this
  23824. , b = new r.RingGeometry(1.3,1.5,32,32,0,1.2 * Math.PI)
  23825. , c = new r.MeshBasicMaterial({
  23826. color: 4967932,
  23827. side: r.DoubleSide
  23828. })
  23829. , d = new r.Mesh(b,c);
  23830. this.mesh = d,
  23831. d.position.z = -2,
  23832. d.scale.set(.08, .08, .08),
  23833. d.visible = !1,
  23834. camera.add(d),
  23835. //window.player.camera.add(d),
  23836. a.enabled = !1,
  23837. this.update = function(b) {
  23838. 1 == a.enabled && (d.rotation.z += 15 * b)
  23839. }
  23840. }
  23841. , a = new a(this.camera);
  23842. window.Loading = a,
  23843. this.updateListeners.push(a)
  23844. }
  23845. ,
  23846. n.prototype.createCursor = function(a, b, c, d, e) {
  23847. var g, h = new r.SpriteMaterial({
  23848. opacity: c,
  23849. color: d,
  23850. transparent: b,
  23851. map: this.boluoGetTexture("images/cursor.png"),
  23852. needsUpdate: !0,
  23853. side: r.DoubleSide
  23854. });
  23855. h.map.offset = new r.Vector2(1 / 17 * e,0),
  23856. h.map.repeat = new r.Vector2(1 / 17,1),
  23857. h.depthTest = !1,
  23858. h.blending = r.AdditiveBlending,
  23859. g = new r.Sprite(h),
  23860. // g.scale.set(a, a, a),
  23861. g.scale.set(.3,.3,.3)
  23862. g.position.z = -2,
  23863. g.visible = !1,
  23864. g.name = "cursor",
  23865. this.camera.add(g),
  23866. this.scene.add(this.camera),
  23867. this.cursor = g;
  23868. var i = new this.CursorAnimation(this.scene,g,this.camera);
  23869. this.cursor.triggerTargetEvent = i.triggerTargetEvent,
  23870. this.updateListeners.push(i)
  23871. }
  23872. ,
  23873. window.orientEnable = 0; //是否能触发deviceorientation
  23874. n.prototype.CursorAnimation = function(a, b, c) {
  23875. function d() {
  23876. g.orient = r.Math.degToRad(window.orientation || 0)
  23877. }
  23878. function e(a) {
  23879. if(!window.vrEnabled && window.orientEnable) return;
  23880. window.orientEnable || (window.orientEnable = 1);
  23881. var b = r.Math.degToRad(a.alpha)
  23882. , c = r.Math.degToRad(a.beta)
  23883. , d = r.Math.degToRad(a.gamma);
  23884. if (this.isHuawei5X ? (-1e3 === g.alpha && (g.alpha = b),
  23885. -1e3 === g.beta && (g.beta = c),
  23886. -1e3 === g.gamma && (g.gamma = d),
  23887. Math.abs(b - g.alpha) > .06 && (g.alpha = b),
  23888. Math.abs(c - g.beta) > .006 && (g.beta = c),
  23889. Math.abs(d - g.gamma) > .006 && (g.gamma = d)) : (g.alpha = b,
  23890. g.beta = c,
  23891. g.gamma = d),
  23892. n.vrDebug) {
  23893. $("#info-device-orientation").css("display", "block");
  23894. var e = "";
  23895. e += "alpha=(" + g.alpha + ")<BR/>",
  23896. e += "beta=(" + g.beta + ")<BR/>",
  23897. e += "gamma=" + g.gamma + "<BR/>",
  23898. document.getElementById("info-device-orientation").innerHTML = e
  23899. }
  23900. }
  23901. this.cursor = b,
  23902. this.raycaster = new r.Raycaster,
  23903. this.targetEventObj = {},
  23904. this.type = 1,
  23905. this.tweenFlag = !0;
  23906. var g = this;
  23907. this.target = c,
  23908. console.log(c.uuid),
  23909. this.euler = new r.Euler,
  23910. this.q0 = new r.Quaternion,
  23911. this.q1 = new r.Quaternion(-Math.sqrt(.5),0,0,Math.sqrt(.5)),
  23912. this.zee = new r.Vector3(0,0,1),
  23913. this.alpha = -1e3,
  23914. this.beta = -1e3,
  23915. this.gamma = -1e3,
  23916. this.orient = r.Math.degToRad(window.orientation || 0),
  23917. window.addEventListener("orientationchange", d),
  23918. window.addEventListener("deviceorientation", e),
  23919. this.setObjectQuaternion = function(a, b, d, e, f) {
  23920. g.euler.set(d, b, -e, "YXZ"),
  23921. a.setFromEuler(g.euler),
  23922. a.multiply(g.q1),
  23923. a.multiply(g.q0.setFromAxisAngle(g.zee, -f)),
  23924. c.updateMatrixWorld()
  23925. }
  23926. ,
  23927. parent !== window && window.addEventListener("message", function(a) {
  23928. var b = JSON.parse(a.data)
  23929. , c = -1 !== window.navigator.userAgent.indexOf("KIW-TL00H");
  23930. b && b.alpha && b.beta && b.gamma && function(a) {
  23931. var c = r.Math.degToRad(b.alpha)
  23932. , d = r.Math.degToRad(b.beta)
  23933. , e = r.Math.degToRad(b.gamma);
  23934. a ? (-1e3 === g.alpha && (g.alpha = c),
  23935. -1e3 === g.beta && (g.beta = d),
  23936. -1e3 === g.gamma && (g.gamma = e),
  23937. Math.abs(c - g.alpha) > .06 && (g.alpha = c),
  23938. Math.abs(d - g.beta) > .006 && (g.beta = d),
  23939. Math.abs(e - g.gamma) > .006 && (g.gamma = e)) : (g.alpha = c,
  23940. g.beta = d,
  23941. g.gamma = e)
  23942. }(c)
  23943. }),
  23944. this.update = function(a) {
  23945. TWEEN.update();
  23946. if(window.ifTest && window.vrEnabled) this.triggerTargetEvent() //测试时不根据陀螺仪来转向
  23947. else window.vrEnabled && (this.setObjectQuaternion(this.target.quaternion, this.alpha, this.beta, this.gamma, this.orient ),
  23948. this.triggerTargetEvent())
  23949. }
  23950. ,
  23951. this.triggerTargetEvent = function() {
  23952. var a = this.choseObj()
  23953. , b = a ? a.object : void 0;
  23954. this.targetEventObj.currentObj = b,
  23955. b !== this.targetEventObj.lastObj && (b && this.autoCursorPosition(a),
  23956. 1 === this.type ? (this.cursorAnimate && this.cursorAnimate.stop(),
  23957. b && b.enabled && this.startAnimate(function() {
  23958. this.clickCallback(b)
  23959. }
  23960. .bind(this))) : this.type,
  23961. this.targetEventObj.lastObj = b)
  23962. }
  23963. ,
  23964. this.choseObj = function() {
  23965. this.raycaster.setFromCamera({
  23966. x: 0,
  23967. y: 0
  23968. }, c);
  23969. var a = (this.raycaster.ray,
  23970. window.vrMarkers)
  23971. , b = this.raycaster.intersectObjects(a);
  23972. if (b.length > 0)
  23973. return b[0]
  23974. }
  23975. ,
  23976. this.clickCallback = function(a) {
  23977. this.runTHREEAction(a, "onclick")
  23978. }
  23979. ,
  23980. this.runTHREEAction = function(a, b) {
  23981. switch (b) {
  23982. case "onclick":
  23983. a._listeners && a._listeners.click && a._listeners.click.forEach(function(a) {
  23984. a()
  23985. });
  23986. break;
  23987. case "onhover":
  23988. a._listeners && a._listeners.hover && a._listeners.hover.forEach(function(a) {
  23989. a()
  23990. });
  23991. break;
  23992. case "onout":
  23993. a._listeners && a._listeners.out && a._listeners.out.forEach(function(a) {
  23994. a()
  23995. })
  23996. }
  23997. }
  23998. ,
  23999. this.startAnimate = function(a) {
  24000. this.tweenFlag && this.initAnimation(a)
  24001. }
  24002. ,
  24003. this.initAnimation = function(a) {
  24004. var b = this
  24005. , c = this.cursor.material.map.offset
  24006. , d = function(a) {
  24007. return Math.floor(17 * a) / 17
  24008. };
  24009. b.tweenFlag = !1,
  24010. this.cursorAnimate = new TWEEN.Tween(c).to({
  24011. x: 1
  24012. }, 1e3).onStart(function() {
  24013. b.tweenFlag = !1
  24014. }).onStop(function() {
  24015. b.tweenFlag = !0,
  24016. this.x = 0,
  24017. c.x = 0
  24018. }).onUpdate(function() {}).onComplete(function() {
  24019. a(),
  24020. c.x = 0,
  24021. setTimeout(function() {
  24022. b.tweenFlag = !0
  24023. }, 1500)
  24024. }),
  24025. this.cursorAnimate.easing(d),
  24026. this.cursorAnimate.start()
  24027. }
  24028. ,
  24029. this.autoCursorPosition = function(a) {
  24030. // var b = Math.abs(a.distance - 10);
  24031. // this.cursor.position.z = -b,
  24032. // b /= 10;
  24033. // alert(b);
  24034. // this.cursor.scale.set(b, b, b)
  24035. this.cursor.scale.set(.3,.3,.3)
  24036. }
  24037. }
  24038. ,
  24039. n.prototype.vrRenderer = function(a, b, c) {
  24040. var d = new b.vrCamera(c);
  24041. d.bananaAspect = .8,
  24042. this.width,
  24043. this.height;
  24044. var b = this;
  24045. this.setSize = function(c, d) {
  24046. a.setSize.call(this, c, d),
  24047. b.width = c,
  24048. b.height = d
  24049. }
  24050. ,
  24051. this.render = function(b, c, e, f) {
  24052. window.cameraQua = c.quaternion.clone();
  24053. var g, h;
  24054. if (c.__RESS__SKIP__STEREO__)
  24055. return a.render(b, c, e, f);
  24056. if ("PerspectiveCamera" === c.type)
  24057. g = d.cameraL,
  24058. h = d.cameraR,
  24059. b.updateMatrixWorld(),
  24060. null === c.parent && c.updateMatrixWorld(),
  24061. d.vrCameraUpdate(c);
  24062. else {
  24063. if ("OrthographicCamera" !== c.type)
  24064. return DEBUG && console.error("Unsupported renderer: ", c.type);
  24065. g = h = c
  24066. }
  24067. a.setScissorTest(!0),
  24068. a.setScissor(0, 0, this.width / 2, this.height),
  24069. a.setViewport(0, 0, this.width / 2, this.height),
  24070. a.render.call(this, b, g, e, f),
  24071. a.setScissor(this.width / 2, 0, this.width / 2, this.height),
  24072. a.setViewport(this.width / 2, 0, this.width / 2, this.height),
  24073. a.render.call(this, b, h, e, f),
  24074. a.setScissorTest(!1)
  24075. }
  24076. ,
  24077. this.__proto__ = {
  24078. __proto__: a
  24079. }
  24080. }
  24081. ,
  24082. n.prototype.vrCamera = function(a) {
  24083. this.type = "StereoCamera",
  24084. this._aspect = 1,
  24085. this._overlap = .064,
  24086. this.cameraL = new r.PerspectiveCamera,
  24087. this.cameraL.layers.enable(1),
  24088. this.cameraL.near = 0.01,//xzw add
  24089. this.cameraL.matrixAutoUpdate = !1,
  24090. this.cameraR = new r.PerspectiveCamera,
  24091. this.cameraR.layers.enable(2),
  24092. this.cameraR.near = 0.01,//xzw add
  24093. this.cameraR.matrixAutoUpdate = !1,
  24094. this.eyeRight = new r.Matrix4,
  24095. this.eyeLeft = new r.Matrix4,
  24096. this.vrCameraNeedsUpdate = !0,
  24097. window.vrCameraL = this.cameraL; // fyz 记录vr相机
  24098. Object.defineProperty(this, "bananaAspect", {
  24099. get: function() {
  24100. return this._aspect
  24101. },
  24102. set: function(a) {
  24103. this._aspect !== a && (this.vrCameraNeedsUpdate = !0),
  24104. this._aspect = a
  24105. }
  24106. }),
  24107. Object.defineProperty(this, "overlap", {
  24108. get: function() {
  24109. return this._overlap
  24110. },
  24111. set: function(a) {
  24112. this._overlap !== a && (this.vrCameraNeedsUpdate = !0),
  24113. this._overlap = a
  24114. }
  24115. }),
  24116. this.vrCameraUpdate = function(a) {
  24117. this.vrCameraNeedsUpdate = true;
  24118. if (this.vrCameraNeedsUpdate = this.vrCameraNeedsUpdate || this.bananaFov !== a.fov || this.bananaReal_aspect !== a.aspect * this.bananaAspect || this.bananaNear !== a.near || this.bananaFar !== a.far,
  24119. this.vrCameraNeedsUpdate) {
  24120. this.vrCameraNeedsUpdate = !1,
  24121. //console.debug("vrCameraUpdate"),
  24122. this.bananaFocus = a.focus,
  24123. this.bananaFov = a.fov,
  24124. this.bananaReal_aspect = a.aspect * this.bananaAspect,
  24125. this.bananaNear = a.near,
  24126. this.bananaFar = a.far,
  24127. //console.debug(a.aspect),
  24128. this.bananaFocus = 10;
  24129. 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);
  24130. this.eyeLeft.elements[12] = -e,
  24131. this.eyeRight.elements[12] = e,
  24132. b = -g * this.bananaReal_aspect + f,
  24133. c = g * this.bananaReal_aspect + f,
  24134. d.elements[0] = 2 * this.bananaNear / (c - b),
  24135. d.elements[8] = (c + b) / (c - b),
  24136. this.cameraL.projectionMatrix.copy(d),
  24137. b = -g * this.bananaReal_aspect - f,
  24138. c = g * this.bananaReal_aspect - f,
  24139. d.elements[0] = 2 * this.bananaNear / (c - b),
  24140. d.elements[8] = (c + b) / (c - b),
  24141. this.cameraR.projectionMatrix.copy(d)
  24142. }
  24143. this.cameraL.matrixWorld.copy(a.matrixWorld).multiply(this.eyeLeft),
  24144. this.cameraR.matrixWorld.copy(a.matrixWorld).multiply(this.eyeRight)
  24145. }
  24146. }
  24147. ,
  24148. n.prototype.boluoGetTexture = function(a) {
  24149. var b = new r.TextureLoader;
  24150. return b.crossOrigin = "anonymous",
  24151. b.load(a)
  24152. }
  24153. ,
  24154. /***********************************************************************************************************************************************************************************/
  24155. n.prototype.updateScreenSize = function() {//xzw 改 为了截屏 要改canvas大小 以及缩放时不模糊
  24156. var W,H;//当截屏时有setTimeout 期间不能恢复大小,所以要用W,H记录正常大小
  24157. return function(o){
  24158. var render = false;
  24159. var ratio;
  24160. var w, h; //记录应当render的大小
  24161. if(o && !o.resize && o.width!= void 0 && o.height!= void 0){
  24162. w = o.width, h = o.height, render = true, ratio=1;
  24163. }else{
  24164. w = $('#player').width();
  24165. h = $('#player').height();
  24166. o && o.resize && (W = this.renderWidth, H = this.renderHeight);
  24167. (w !== W || h !== H || this.forceUpdateSize) &&
  24168. (W = w, H = h, render = true, ratio = window.devicePixelRatio);
  24169. }
  24170. if(render){
  24171. this.setSize(w, h, ratio);
  24172. this.forceUpdateSize = !1
  24173. }
  24174. }
  24175. }()
  24176. ,
  24177. n.prototype.updateComponents = function() {
  24178. for (var e = Math.min(1, this.updateClock.getDelta()), t = 0; t < this.updateListeners.length; t++)
  24179. this.updateListeners[t].update(e)
  24180. }
  24181. ,
  24182. n.prototype.suspend = function() {
  24183. this.started = !1,
  24184. this.suspendedObjects = this.scene.children.map(function(e) {
  24185. return this.scene.remove(e),
  24186. e
  24187. }
  24188. .bind(this)),
  24189. this.render()
  24190. }
  24191. ,
  24192. n.prototype.resume = function() {
  24193. this.suspendedObjects.forEach(function(e) {
  24194. this.scene.add(e)
  24195. }
  24196. .bind(this)),
  24197. this.suspendedObjects = [],
  24198. this.started = !0,
  24199. p()
  24200. }
  24201. ;
  24202. var p = function() {
  24203. this.started && (window.requestAnimationFrame(p),
  24204. this.updateScreenSize(), // fyz resize
  24205. this.updateComponents(),
  24206. this.updateTextureMemory(),
  24207. this.render(),
  24208. window.stats && (window.fps = stats.update()),
  24209. this.emit(a.AfterRender))
  24210. };
  24211. n.prototype.getImageData = function() {
  24212. var e = document.createElement("canvas")
  24213. , t = e.getContext("2d");
  24214. return function(i, n, r) {
  24215. return e.width === n && e.height === r || (e.width = n,
  24216. e.height = r),
  24217. t.drawImage(i, 0, 0, n, r),
  24218. t.getImageData(0, 0, n, r)
  24219. }
  24220. }(),
  24221. n.prototype.initSizedTexture2D = function(e, t, i) {
  24222. var n = this.renderer
  24223. , o = n.context
  24224. , a = n.state
  24225. , s = new r.Texture(null);
  24226. s.flipY = !1,
  24227. i !== !0 && (i = !1),
  24228. s.generateMipmaps = i;
  24229. var l = n.paramThreeToGL(s.format)
  24230. , c = n.paramThreeToGL(s.type)
  24231. , h = n.properties.get(s)
  24232. , u = o.createTexture();
  24233. a.bindTexture(o.TEXTURE_2D, u),
  24234. o.pixelStorei(o.UNPACK_FLIP_Y_WEBGL, s.flipY),
  24235. o.texImage2D(o.TEXTURE_2D, 0, l, e, e, 0, l, c, null),
  24236. s.wrapS = t,
  24237. s.wrapT = t;
  24238. var d = n.paramThreeToGL(t);
  24239. return o.texParameteri(o.TEXTURE_2D, o.TEXTURE_WRAP_S, d),
  24240. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_WRAP_T, d),
  24241. i ? (s.magFilter = r.LinearFilter,
  24242. s.minFilter = r.LinearMipMapLinearFilter,
  24243. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_MAG_FILTER, o.LINEAR),
  24244. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_MIN_FILTER, o.LINEAR_MIPMAP_NEAREST),
  24245. o.generateMipmap(o.TEXTURE_2D)) : (s.magFilter = r.LinearFilter,
  24246. s.minFilter = r.LinearFilter,
  24247. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_MAG_FILTER, o.LINEAR),
  24248. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_MIN_FILTER, o.LINEAR)),
  24249. a.bindTexture(o.TEXTURE_2D, null),
  24250. h.__webglTexture = u,
  24251. s
  24252. }
  24253. ,
  24254. n.prototype.initSizedCubeMap = function(e, t) {
  24255. var i = this.renderer
  24256. , n = i.context
  24257. , o = i.state
  24258. , a = new r.CubeTexture([null, null, null, null, null, null]);
  24259. a.flipY = !1,
  24260. a.generateMipmaps = t;
  24261. var s = i.paramThreeToGL(a.format)
  24262. , l = i.paramThreeToGL(a.type)
  24263. , c = i.properties.get(a)
  24264. , h = n.createTexture();
  24265. o.bindTexture(n.TEXTURE_CUBE_MAP, h),
  24266. n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL, a.flipY);
  24267. for (var u = 0; u < 6; u++)
  24268. n.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X + u, 0, s, e, e, 0, s, l, null);
  24269. return t ? (a.magFilter = r.LinearFilter,
  24270. a.minFilter = r.LinearMipMapLinearFilter,
  24271. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MAG_FILTER, n.LINEAR),
  24272. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MIN_FILTER, n.LINEAR_MIPMAP_LINEAR),
  24273. n.texParameteri(n.TEXTURE_CUBE_MAP, n.GENERATE_MIPMAP, n.TRUE),
  24274. n.generateMipmap(n.TEXTURE_CUBE_MAP)) : (a.magFilter = r.LinearFilter,
  24275. a.minFilter = r.LinearFilter,
  24276. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MAG_FILTER, n.LINEAR),
  24277. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MIN_FILTER, n.LINEAR)),
  24278. o.bindTexture(n.TEXTURE_CUBE_MAP, null),
  24279. c.__image__webglTextureCube = h,
  24280. a
  24281. }
  24282. ,
  24283. n.prototype.deallocateCubeTexture = function(e) {
  24284. var t = this.renderer
  24285. , i = t.context
  24286. , n = t.properties.get(e);
  24287. i.deleteTexture(n.__image__webglTextureCube)
  24288. }
  24289. ,
  24290. n.prototype.uploadTexture2D = function(e, t, i, n, r, o) {
  24291. var a = this.renderer
  24292. , s = a.context
  24293. , l = a.state
  24294. , c = a.properties.get(t);
  24295. l.bindTexture(s.TEXTURE_2D, c.__webglTexture),
  24296. s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL, t.flipY),
  24297. s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL, t.premultiplyAlpha),
  24298. s.pixelStorei(s.UNPACK_ALIGNMENT, t.unpackAlignment),
  24299. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_WRAP_S, a.paramThreeToGL(t.wrapS)),
  24300. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_WRAP_T, a.paramThreeToGL(t.wrapT)),
  24301. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_MAG_FILTER, a.paramThreeToGL(t.magFilter)),
  24302. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_MIN_FILTER, a.paramThreeToGL(t.minFilter)),
  24303. s.texSubImage2D(s.TEXTURE_2D, 0, i, n, s.RGBA, s.UNSIGNED_BYTE, e),
  24304. t.generateMipmaps && s.generateMipmap(s.TEXTURE_2D),
  24305. l.bindTexture(s.TEXTURE_2D, null)
  24306. }
  24307. ,
  24308. n.prototype.uploadTexture3D = function(e, t, i, n, r, o, a) {
  24309. var s = this.renderer
  24310. , l = s.context
  24311. , c = s.state
  24312. , h = s.properties.get(t);
  24313. c.bindTexture(l.TEXTURE_CUBE_MAP, h.__image__webglTextureCube),
  24314. l.pixelStorei(l.UNPACK_FLIP_Y_WEBGL, t.flipY),
  24315. l.texSubImage2D(r, 0, i, n, l.RGBA, l.UNSIGNED_BYTE, e),
  24316. t.generateMipmaps && l.generateMipmap(l.TEXTURE_CUBE_MAP),
  24317. c.bindTexture(l.TEXTURE_CUBE_MAP, null)
  24318. }
  24319. ,
  24320. n.prototype.rebuildMipMaps2D = function(e) {
  24321. var t = this.renderer
  24322. , i = t.context
  24323. , n = t.state;
  24324. t.properties.get(e);
  24325. i.generateMipmap(i.TEXTURE_2D),
  24326. n.bindTexture(i.TEXTURE_2D, null)
  24327. }
  24328. ,
  24329. n.prototype.rebuildMipMaps3D = function(e) {
  24330. var t = this.renderer
  24331. , i = t.context
  24332. , n = t.state
  24333. , r = t.properties.get(e);
  24334. n.bindTexture(i.TEXTURE_CUBE_MAP, r.__image__webglTextureCube),
  24335. i.generateMipmap(i.TEXTURE_CUBE_MAP),
  24336. n.bindTexture(i.TEXTURE_CUBE_MAP, null)
  24337. }
  24338. ,
  24339. n.prototype.renderToCubeMap = function() {
  24340. var e = !1
  24341. , t = null
  24342. , i = null
  24343. , n = null
  24344. , a = null
  24345. , s = null
  24346. , l = 1;
  24347. return function(c, h, u, d, p, f, g, m, v, A, y, C, I, E, b, w) {
  24348. var _ = this.renderer;
  24349. _.context;
  24350. e || (i = new r.OrthographicCamera(l / -2,l / 2,l / 2,l / -2,-200,200),
  24351. i.position.z = 150,
  24352. t = new r.Scene,
  24353. t.add(i),
  24354. n = new r.ShaderMaterial({
  24355. uniforms: {
  24356. tDiffuse: {
  24357. type: "t",
  24358. value: null
  24359. },
  24360. alpha: {
  24361. type: "f",
  24362. value: 1
  24363. }
  24364. },
  24365. vertexShader: o.basicTextured.vertexShader,
  24366. fragmentShader: o.basicTextured.fragmentShader,
  24367. depthWrite: !1,
  24368. depthTest: !1,
  24369. side: r.DoubleSide
  24370. }),
  24371. a = new r.PlaneBufferGeometry(l,l),
  24372. s = new r.Mesh(a,n),
  24373. s.position.z = 0,
  24374. t.add(s),
  24375. e = !0);
  24376. var T = a.getAttribute("uv");
  24377. T.setDynamic(!0),
  24378. T.needsUpdate = !0;
  24379. var x = T.array
  24380. , S = p / u
  24381. , M = f / d
  24382. , R = g / u
  24383. , P = m / d;
  24384. x[0] = S,
  24385. x[1] = M + P,
  24386. x[2] = S + R,
  24387. x[3] = M + P,
  24388. x[4] = S,
  24389. x[5] = M,
  24390. x[6] = S + R,
  24391. x[7] = M;
  24392. var O = a.getAttribute("position");
  24393. O.setDynamic(!0),
  24394. O.needsUpdate = !0;
  24395. var L = O.array
  24396. , D = v / h.width - l / 2
  24397. , N = A / h.height - l / 2
  24398. , B = y / h.width
  24399. , F = C / h.height;
  24400. L[0] = D,
  24401. L[1] = N + F,
  24402. L[3] = D + B,
  24403. L[4] = N + F,
  24404. L[6] = D,
  24405. L[7] = N,
  24406. L[9] = D + B,
  24407. L[10] = N;
  24408. this.renderer.properties.get(c);
  24409. n.uniforms.tDiffuse.value = c,
  24410. n.blending = E || r.NoBlending,
  24411. n.transparent = !!b,
  24412. void 0 !== w && null !== w || (w = 1),
  24413. n.uniforms.alpha.value = w,
  24414. n.needUpdate = !0,
  24415. h.activeCubeFace = I,
  24416. h.viewport.set(0, 0, h.width, h.height);
  24417. var V = this.renderer.autoClear;
  24418. this.renderer.autoClear = !1,
  24419. this.renderer.render(t, i, h, !1),
  24420. this.renderer.autoClear = V
  24421. }
  24422. }(),
  24423. n.prototype.copyCubeMap = function() {
  24424. var e = !1
  24425. , t = null
  24426. , i = null
  24427. , a = null
  24428. , s = null
  24429. , l = null
  24430. , c = new r.Euler;
  24431. new r.Vector3;
  24432. return function(h, u, d, p, f, g, m, v, A) {
  24433. this.renderer;
  24434. if (!e) {
  24435. var y = 2;
  24436. i = new r.OrthographicCamera(y / -2,y / 2,y / 2,y / -2,0,200),
  24437. i.position.set(0, 0, 0),
  24438. t = new r.Scene,
  24439. t.add(i),
  24440. a = new r.ShaderMaterial({
  24441. uniforms: {
  24442. tDiffuse: {
  24443. type: "t",
  24444. value: null
  24445. },
  24446. alpha: {
  24447. type: "f",
  24448. value: 1
  24449. }
  24450. },
  24451. vertexShader: o.copyCubeMap.vertexShader,
  24452. fragmentShader: o.copyCubeMap.fragmentShader,
  24453. depthWrite: !1,
  24454. depthTest: !1,
  24455. side: r.DoubleSide
  24456. }),
  24457. s = new r.BoxGeometry(y,y,y),
  24458. l = new r.Mesh(s,a),
  24459. t.add(l),
  24460. e = !0
  24461. }
  24462. for (var C = 0; C < 6; C++)
  24463. n.getCubeOrientationForCubeFace(C, c),
  24464. l.rotation.copy(c),
  24465. l.matrixWorldNeedsUpdate = !0,
  24466. l.updateMatrixWorld(),
  24467. a.uniforms.tDiffuse.value = h,
  24468. a.blending = m || r.NoBlending,
  24469. a.transparent = !!v,
  24470. void 0 !== A && null !== A || (A = 1),
  24471. a.uniforms.alpha.value = A,
  24472. a.needUpdate = !0,
  24473. u.activeCubeFace = C,
  24474. u.viewport.set(0, 0, f, g),
  24475. this.renderer.render(t, i, u, !1)
  24476. }
  24477. }(),
  24478. n.getLookAtForCubeFace = function(e, t) {
  24479. switch (e) {
  24480. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  24481. t.set(1, 0, 0);
  24482. break;
  24483. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  24484. t.set(-1, 0, 0);
  24485. break;
  24486. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  24487. t.set(0, 1, 0);
  24488. break;
  24489. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  24490. t.set(0, -1, 0);
  24491. break;
  24492. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  24493. t.set(0, 0, 1);
  24494. break;
  24495. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  24496. t.set(0, 0, -1)
  24497. }
  24498. }
  24499. ,
  24500. n.getCubeOrientationForCubeFace = function(e, t) {
  24501. switch (e) {
  24502. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  24503. t.set(0, -Math.PI / 2, 0);
  24504. break;
  24505. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  24506. t.set(0, Math.PI / 2, 0);
  24507. break;
  24508. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  24509. t.set(Math.PI / 2, Math.PI, 0);
  24510. break;
  24511. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  24512. t.set(-Math.PI / 2, Math.PI, 0);
  24513. break;
  24514. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  24515. t.set(0, -Math.PI, 0);
  24516. break;
  24517. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  24518. t.set(0, 0, 0)
  24519. }
  24520. }
  24521. ,
  24522. t.exports = n
  24523. }
  24524. , {
  24525. "../enum/GLCubeFaces": 25,
  24526. "../enum/GLTextureType": 26,
  24527. "../enum/SceneRendererEvents": 43,
  24528. "../exception/BasicException": 55,
  24529. "../exception/RendererCreationException": 57,
  24530. "../settings": 166,
  24531. "../shaders": 167,
  24532. /********************************************************************fyz改 from徐世廷**********************************************************************/
  24533. "../util/browser": 182,
  24534. /************************************************************************************************************************************************/
  24535. events: 202,
  24536. three: 217
  24537. }],
  24538. 159: [function(e, t, i) {
  24539. "use strict";
  24540. function n(e) {
  24541. this.messenger = new a(e),
  24542. this.clientKey = null
  24543. }
  24544. var r = e("../util/ajax")
  24545. , o = e("./PostMessageType")
  24546. , a = e("./postmessage")
  24547. , s = e("./VersionInfo")
  24548. , l = e("events").EventEmitter
  24549. , c = window.location.origin + "/api/v1/user/";
  24550. n.prototype = Object.create(l.prototype),
  24551. n.prototype.bindEvents = function() {
  24552. this.messenger.on(o.ACTION, this.onMessageReceived.bind(this))
  24553. }
  24554. ,
  24555. n.prototype.waitForConnection = function() {
  24556. var e = new Promise(function(e, t) {
  24557. this.messenger.on(o.CONNECT, function(i) {
  24558. this.onConnectionReceived(i).then(e.bind(this, i.sdkVersion), t.bind())
  24559. }
  24560. .bind(this))
  24561. }
  24562. .bind(this));
  24563. return e
  24564. }
  24565. ,
  24566. n.prototype.onConnectionReceived = function(e) {
  24567. return this.messenger.setTarget(e.source, e.origin),
  24568. this.verifyConnection(e).then(function(t, i) {
  24569. this.messenger.send({
  24570. type: o.ACCEPT,
  24571. toId: e.fromId,
  24572. warning: i
  24573. }),
  24574. this.clientKey = t,
  24575. this.messenger.removeAllListeners(o.CONNECT),
  24576. this.bindEvents()
  24577. }
  24578. .bind(this), function(t) {
  24579. this.messenger.send({
  24580. type: o.REJECT,
  24581. toId: e.fromId,
  24582. reason: t
  24583. }),
  24584. this.messenger.setTarget()
  24585. }
  24586. .bind(this))
  24587. }
  24588. ,
  24589. n.prototype.verifyConnection = function(e) {
  24590. return new Promise(function(t, i) {
  24591. var n;
  24592. if (s.isDeprecated(e.sdkVersion))
  24593. n = "这个版本正在被弃用";
  24594. else if (!s.isSupported(e.sdkVersion))
  24595. return i("不支持此版本的SDK");
  24596. var o = {
  24597. cache: !1,
  24598. headers: {
  24599. "X-port-Application-Key": e.applicationKey,
  24600. "X-port-Referrer": e.origin
  24601. }
  24602. };
  24603. r.get(c, o).done(t.bind(this, e.applicationKey, n)).fail(i.bind(this, "key/referrer mismatch"))
  24604. }
  24605. )
  24606. }
  24607. ,
  24608. n.prototype.onMessageReceived = function(e) {
  24609. if (this.validateClientApplicationKey(e.applicationKey)) {
  24610. var t = this;
  24611. e.onDone = function(i) {
  24612. i.toId = e.fromId,
  24613. i.uid = e.uid,
  24614. i.type = o.RESPONSE,
  24615. t.messenger.send(i)
  24616. }
  24617. ,
  24618. this.emit(o.ACTION, e)
  24619. }
  24620. }
  24621. ,
  24622. n.prototype.validateClientApplicationKey = function(e) {
  24623. return this.clientKey === e
  24624. }
  24625. ,
  24626. n.prototype.sendEvent = function(e, t) {
  24627. this.messenger.send({
  24628. type: o.EVENT,
  24629. eventType: e,
  24630. eventData: t
  24631. })
  24632. }
  24633. ,
  24634. t.exports = n
  24635. }
  24636. , {
  24637. "../util/ajax": 181,
  24638. "./PostMessageType": 160,
  24639. "./VersionInfo": 163,
  24640. "./postmessage": 165,
  24641. events: 202
  24642. }],
  24643. 160: [function(e, t, i) {
  24644. "use strict";
  24645. t.exports = Object.freeze({
  24646. CONNECT: "postmessage.connect",
  24647. ACCEPT: "postmessage.accept",
  24648. REJECT: "postmessage.reject",
  24649. ACTION: "postmessage.action",
  24650. RESPONSE: "postmessage.response",
  24651. EVENT: "postmessage.event"
  24652. })
  24653. }
  24654. , {}],
  24655. 161: [function(e, t, i) {
  24656. "use strict";
  24657. t.exports = Object.freeze({
  24658. MOVE: "sdk.move",
  24659. ENTER_PANO: "sdk.enterpano",
  24660. MODEL_LOADED: "sdk.modelloaded"
  24661. })
  24662. }
  24663. , {}],
  24664. 162: [function(e, t, i) {
  24665. "use strict";
  24666. t.exports = Object.freeze({
  24667. FLY: "transition.fly",
  24668. FADEOUT: "transition.fade",
  24669. INSTANT: "transition.instant"
  24670. })
  24671. }
  24672. , {}],
  24673. 163: [function(e, t, i) {
  24674. "use strict";
  24675. t.exports = {
  24676. current: "1.0",
  24677. supported: ["1.0"],
  24678. deprecated: [],
  24679. isSupported: function(e) {
  24680. return this.supported.indexOf(e) !== -1
  24681. },
  24682. isDeprecated: function(e) {
  24683. return this.deprecated.indexOf(e) !== -1
  24684. },
  24685. isValid: function(e) {
  24686. return this.isSupported(e) || this.isDeprecated(e)
  24687. }
  24688. }
  24689. }
  24690. , {}],
  24691. 164: [function(e, t, i) {
  24692. (function(i) {
  24693. "use strict";
  24694. function n(e, t, i) {
  24695. e && (e = e.toLowerCase().trim());
  24696. var n = new I.UP.clone
  24697. , r = Math.PI / 3
  24698. , o = Math.PI / 2;
  24699. switch (e) {
  24700. case "left":
  24701. i.copy(t),
  24702. i.applyAxisAngle(n, o);
  24703. break;
  24704. case "right":
  24705. i.copy(t),
  24706. i.applyAxisAngle(n, -o);
  24707. break;
  24708. case "forwardleft":
  24709. i.copy(t),
  24710. i.applyAxisAngle(n, r);
  24711. break;
  24712. case "forwardright":
  24713. i.copy(t),
  24714. i.applyAxisAngle(n, -r);
  24715. break;
  24716. case "forward":
  24717. default:
  24718. i.copy(t)
  24719. }
  24720. return i
  24721. }
  24722. function r(e, t) {
  24723. if (e) {
  24724. var i = {
  24725. pano: e,
  24726. lookAtPoint: null,
  24727. duration: null,
  24728. maxDistanceOverride: null,
  24729. skipWarpingCheck: !1
  24730. };
  24731. this.player.flyToPano(i, function() {
  24732. t && t({
  24733. success: !0,
  24734. message: "Transition complete."
  24735. })
  24736. })
  24737. } else
  24738. R.warn("Showcase -> clickPanoObject: Unable to find pano."),
  24739. t && t({
  24740. success: !1,
  24741. error: "Unable to find pano."
  24742. })
  24743. }
  24744. function o(e, t) {
  24745. var i = this.findRankedPano(e, t);
  24746. return i >= 0 ? this.handleToObject[i] : (R.warn("Showcase -> findRankedPanoObject: Unable to find nearby pano."),
  24747. null)
  24748. }
  24749. function a(e, t) {
  24750. var i = this.findRankedtag(e, t);
  24751. return i >= 0 ? this.handleToObject[i] : (R.warn("Showcase -> findRankedtagObject: Unable to find nearby tag."),
  24752. null)
  24753. }
  24754. function s(e, t) {
  24755. t.copy(I.FORWARD),
  24756. e.getDirection(t)
  24757. }
  24758. function l(e) {
  24759. function t(e) {
  24760. var t = (new c.Euler).setFromQuaternion(e.quaternion, "YXZ");
  24761. return {
  24762. x: c.Math.radToDeg(t._x),
  24763. y: c.Math.radToDeg(t._y),
  24764. z: c.Math.radToDeg(t._z)
  24765. }
  24766. }
  24767. var i = function(e) {
  24768. return e.alignmentType !== m.ALIGNED ? null : {
  24769. x: e.position.x,
  24770. y: e.position.y,
  24771. z: e.position.z
  24772. }
  24773. };
  24774. return {
  24775. panos: e.panos.list.map(function(n) {
  24776. var r = y.getCubemapUrls(e.urls, n.id, "high")[C.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z];
  24777. return {
  24778. uuid: n.id,
  24779. aligned: n.alignmentType === m.ALIGNED,
  24780. neighbourUUIDs: n.neighbourUUIDs.slice(),
  24781. position: i(n),
  24782. rotation: t(n),
  24783. thumbnail: r
  24784. }
  24785. })
  24786. }
  24787. }
  24788. var c = e("three")
  24789. , h = e("./ApiHost")
  24790. , u = e("../util/logger")
  24791. , d = e("../util/common")
  24792. , p = e("../util/math")
  24793. , f = e("../enum/ModelManagerEvents")
  24794. , g = e("./PostMessageType")
  24795. , m = e("../enum/AlignmentType")
  24796. , v = e("../enum/Direction")
  24797. , A = e("./TransitionStyles")
  24798. , y = e("../util/panorama")
  24799. , C = e("../enum/GLCubeFaces")
  24800. , I = e("../enum/Vectors")
  24801. , E = e("../enum/Viewmode")
  24802. , b = e("../enum/WarpStyle")
  24803. , w = (e("../enum/Keys"),
  24804. e("../enum/PlayerEvents"))
  24805. , _ = e("../sdk/SdkEvents")
  24806. , I = e("../enum/Vectors")
  24807. , T = e("../enum/ControlEvents")
  24808. , x = e("../enum/RenderLayers")
  24809. , S = (e("../constants"),
  24810. e("../settings"))
  24811. , M = e("../lib/jpeg_encoder")
  24812. , R = new u(i)
  24813. , P = function() {
  24814. var e = function e() {
  24815. e.playerDirection.copy(e.player.mode === E.FLOORPLAN ? I.UP : I.FORWARD),
  24816. e.player.getDirection(e.playerDirection),
  24817. e.projectVectors();
  24818. var t = e.playerDirection.angleTo(e.lastFacingDirection);
  24819. if (e.angleTravelled += Math.abs(t),
  24820. e.angleTravelled >= Math.abs(e.angle)) {
  24821. if (e.active = !1,
  24822. e.onDone) {
  24823. var i = e.onDone;
  24824. i()
  24825. }
  24826. } else
  24827. e.lastFacingDirection.copy(e.playerDirection),
  24828. window.setTimeout(e, 4)
  24829. };
  24830. return e.active = !1,
  24831. e.angle = 0,
  24832. e.angleTravelled = 0,
  24833. e.playerDirection = new c.Vector3,
  24834. e.lastFacingDirection = new c.Vector3,
  24835. e.onDone = null,
  24836. e.player = null,
  24837. e.start = function(t, i, n, r) {
  24838. e.active = !0,
  24839. t && i && (i = 0),
  24840. e.angle = t || i,
  24841. e.xAngle = t,
  24842. e.yAngle = i,
  24843. e.angleTravelled = 0,
  24844. e.playerDirection.copy(n.mode === E.FLOORPLAN ? I.UP : I.FORWARD),
  24845. n.getDirection(e.playerDirection),
  24846. e.lastFacingDirection.copy(e.playerDirection),
  24847. e.projectVectors(),
  24848. e.onDone = r,
  24849. e.player = n,
  24850. e()
  24851. }
  24852. ,
  24853. e.projectVectors = function() {
  24854. e.xAngle && (e.playerDirection.projectOnPlane(I.UP),
  24855. e.lastFacingDirection.projectOnPlane(I.UP))
  24856. }
  24857. ,
  24858. e
  24859. }()
  24860. , O = function() {
  24861. var e = new c.Vector3;
  24862. return function(t) {
  24863. t ? (e.copy(t.position),
  24864. e.add(t.discPosition),
  24865. p.projectPositionToCanvas(e, this.player.camera, e),
  24866. this.click(e.x, e.y)) : R.warn("Showcase -> clicktagObject: Unable to find tag.")
  24867. }
  24868. }()
  24869. , L = function() {
  24870. return this.player.mode === E.PANORAMA ? S.insideLookLimitUp : this.player.mode === E.DOLLHOUSE ? 90 - c.Math.radToDeg(S.dollhouseDefault.minPolarAngle) : null
  24871. }
  24872. , D = function() {
  24873. return this.player.mode === E.PANORAMA ? S.insideLookLimitDown : this.player.mode === E.DOLLHOUSE ? 90 - c.Math.radToDeg(S.dollhouseDefault.maxPolarAngle) : null
  24874. }
  24875. , N = function(e) {
  24876. var t = new c.Vector3;
  24877. return function(e) {
  24878. var i = this.player.getDirection();
  24879. t.copy(i);
  24880. var n = t.y;
  24881. t.y = 0,
  24882. t.normalize();
  24883. var r = c.Math.radToDeg(t.angleTo(i)) * (n < 0 ? -1 : 1);
  24884. if (this.player.mode !== E.DOLLHOUSE && this.player.mode !== E.PANORAMA)
  24885. return 0 !== e && R.warn("Cannot rotate in y direction when in " + this.player.mode + " mode"),
  24886. 0;
  24887. this.player.mode === E.DOLLHOUSE && (r = -r);
  24888. var o = L.call(this) - .1
  24889. , a = D.call(this) + .1
  24890. , s = r + e;
  24891. s > o ? s = o : s < a && (s = a);
  24892. var l = s - r;
  24893. return e > 0 && l < .01 && (l = 0),
  24894. e < 0 && l > -.01 && (l = 0),
  24895. l
  24896. }
  24897. }()
  24898. , B = function() {
  24899. var e = new c.Euler;
  24900. return function(t) {
  24901. return e.setFromQuaternion(t.quaternion, "YXZ"),
  24902. {
  24903. position: {
  24904. x: t.position.x,
  24905. y: t.position.y,
  24906. z: t.position.z
  24907. },
  24908. rotation: {
  24909. x: c.Math.radToDeg(e.x),
  24910. y: c.Math.radToDeg(e.y),
  24911. z: 0
  24912. },
  24913. pano: t.currentPano ? t.currentPano.id : null,
  24914. mode: t.mode
  24915. }
  24916. }
  24917. }()
  24918. , F = null;
  24919. t.exports = {
  24920. init: function(e, t, i, n, r) {
  24921. V.init(e, t, i, r),
  24922. F = new Promise(function(e, t) {
  24923. i.on(w.Ready, function() {
  24924. e()
  24925. })
  24926. }
  24927. .bind(this));
  24928. var o = new h(window)
  24929. , a = o.waitForConnection();
  24930. a.then(function(e) {
  24931. o.on(g.ACTION, V.onMessageReceive.bind(V))
  24932. });
  24933. var s = function() {
  24934. var e = Date.now();
  24935. return function() {
  24936. if (!(Date.now() - e < 100)) {
  24937. var t = B(i);
  24938. o.sendEvent(_.MOVE, {
  24939. state: t
  24940. }),
  24941. e = Date.now()
  24942. }
  24943. }
  24944. }();
  24945. i.on(w.Move, s),
  24946. i.on(w.ViewChanged, s),
  24947. n.on(f.ActiveModelChanged, function(e) {
  24948. function t(e) {
  24949. var t, i = e.newPano.id;
  24950. e.oldPano && (t = e.oldPano.id),
  24951. i !== t && o.sendEvent(_.ENTER_PANO, {
  24952. oldPano: t,
  24953. newPano: i
  24954. })
  24955. }
  24956. var i = e.model
  24957. , n = e.oldModel;
  24958. V.model = i,
  24959. a.then(function() {
  24960. o.sendEvent(_.MODEL_LOADED, {
  24961. metadata: l(i)
  24962. })
  24963. }),
  24964. n && n.panos.forEach(function(e) {
  24965. e.removeEventListener("enter", t)
  24966. }),
  24967. i.panos.forEach(function(e) {
  24968. e.on("enter", t)
  24969. })
  24970. })
  24971. }
  24972. };
  24973. var V = {
  24974. director: null,
  24975. player: null,
  24976. controls: null,
  24977. sceneRenderer: null,
  24978. model: null,
  24979. init: function(e, t, i, n) {
  24980. this.director = e,
  24981. this.player = i,
  24982. this.controls = t,
  24983. this.sceneRenderer = n
  24984. },
  24985. handleToObject: {},
  24986. objectToHandle: {},
  24987. handleCount: 0,
  24988. onMessageReceive: function(e) {
  24989. if (e) {
  24990. var t = e.targetFunction
  24991. , i = e.params
  24992. , n = e.onDone;
  24993. t && this[t] && this[t](i, n)
  24994. }
  24995. },
  24996. waitForInit: function(e, t) {
  24997. F.then(t.bind({
  24998. success: !0,
  24999. message: "Init complete."
  25000. }))
  25001. },
  25002. moveToPano: function(e, t) {
  25003. var i = new c.Euler(0,0,0,"YXZ")
  25004. , n = new c.Quaternion;
  25005. return function(e, t) {
  25006. var r = e.pano
  25007. , o = e.rotation
  25008. , a = e.transition;
  25009. if (!this.model)
  25010. return t({
  25011. success: !1,
  25012. error: "The model has not been loaded yet"
  25013. });
  25014. var s = this.model.panos.get(r);
  25015. if (!s)
  25016. return t({
  25017. success: !1,
  25018. error: r + " does not exist in this model"
  25019. });
  25020. if (!o)
  25021. return t({
  25022. sucess: !1,
  25023. erorr: o + " is not a valid rotation"
  25024. });
  25025. i.set(c.Math.degToRad(o.x || 0), c.Math.degToRad(o.y || 0), c.Math.degToRad(o.z || 0), "YXZ"),
  25026. console.log(o.z);
  25027. var l = {
  25028. success: !0,
  25029. message: r
  25030. };
  25031. if (a === A.FADEOUT)
  25032. n.setFromEuler(i),
  25033. this.player.warpToPano(s, n, null, null, b.BLACK, null, null, t.bind(this, l));
  25034. else {
  25035. var h, u;
  25036. a === A.INSTANT && (h = 0,
  25037. u = 0);
  25038. var d = I.FORWARD.clone().applyEuler(i).add(s.position);
  25039. this.player.flyToPano({
  25040. pano: s,
  25041. lookAtPoint: d,
  25042. duration: h,
  25043. aimDuration: u
  25044. }, t.bind(this, l))
  25045. }
  25046. }
  25047. }(),
  25048. moveInDirection: function(e, t) {
  25049. var i = e.direction;
  25050. return "undefined" == typeof v[i] ? (R.warn("Showcase -> moveInDirection: Cannot move in invalid direction."),
  25051. void (t && t({
  25052. success: !1,
  25053. error: "Invalid direction."
  25054. }))) : void this.player.flyLocalDirection(I[i].clone()).then(function(e) {
  25055. t(e ? {
  25056. success: !0,
  25057. message: "moved " + i
  25058. } : {
  25059. success: !1,
  25060. error: "Cannot move in direction: " + i
  25061. })
  25062. })
  25063. },
  25064. getPose: function(e, t) {
  25065. this.player.camera.position,
  25066. (new c.Euler).setFromQuaternion(this.player.camera.quaternion, "YXZ");
  25067. return t({
  25068. success: !0,
  25069. message: B(this.player)
  25070. })
  25071. },
  25072. takeScreenShot: function() {
  25073. var e = new c.PerspectiveCamera
  25074. , t = new c.WebGLRenderTarget;
  25075. return function(i, n) {
  25076. if (!i.resolution)
  25077. return n({
  25078. success: !1,
  25079. error: "An invalid resolution was specified"
  25080. });
  25081. if (i.resolution.width === -1 || i.resolution.height === -1) {
  25082. var r = this.sceneRenderer.renderer.getSize();
  25083. i.resolution.width = r.width,
  25084. i.resolution.height = r.height
  25085. }
  25086. e.layers.set(x.DEFAULT),
  25087. i.visibleObjects && (i.visibleObjects.showtags && e.layers.enable(x.TAG),
  25088. i.visibleObjects.showPucks && e.layers.enable(x.PANOMARKERS),
  25089. i.visibleObjects.showReticule && e.layers.enable(x.RETICULE));
  25090. var o = i.resolution.width
  25091. , a = i.resolution.height
  25092. , s = o / a;
  25093. e.position.copy(this.sceneRenderer.camera.position),
  25094. e.quaternion.copy(this.sceneRenderer.camera.quaternion),
  25095. e.projectionMatrix.copy(this.player.camera.projectionMatrix),
  25096. e.projectionMatrix.elements[0] = this.player.camera.projectionMatrix.elements[5] / s,
  25097. t.setSize(o, a),
  25098. this.sceneRenderer.renderer.render(this.sceneRenderer.scene, e, t);
  25099. var l = new Uint8Array(o * a * 4);
  25100. this.sceneRenderer.renderer.readRenderTargetPixels(t, 0, 0, o, a, l);
  25101. var c = M.encode({
  25102. data: l,
  25103. width: o,
  25104. height: a,
  25105. heading: 180,
  25106. pitch: 0
  25107. }, {
  25108. quality: 75,
  25109. flipY: !0
  25110. })
  25111. , h = "data:image/jpg;base64," + d.uint8ToBase64(c.data);
  25112. n({
  25113. success: !0,
  25114. message: h
  25115. })
  25116. }
  25117. }(),
  25118. findRankedPano: function(e, t) {
  25119. var i = new c.Vector3
  25120. , r = new c.Vector3;
  25121. return function(e, t) {
  25122. s(this.player, r),
  25123. n(t, r, i);
  25124. var o = this.player.rankedPanoInDirection(e, i);
  25125. if (o) {
  25126. var a = this.objectToHandle[o.id];
  25127. return a || (this.objectToHandle[o.id] = a = this.handleCount++,
  25128. this.handleToObject[a] = o),
  25129. a
  25130. }
  25131. return R.warn("Showcase -> findRankedPano: Unable to find nearby pano."),
  25132. -1
  25133. }
  25134. }(),
  25135. findRankedtag: function(e, t) {
  25136. var i = new c.Vector3
  25137. , r = new c.Vector3;
  25138. return function(e, t) {
  25139. s(this.player, r),
  25140. n(t, r, i);
  25141. var o = this.player.rankedtagInDirection(e, i);
  25142. if (o) {
  25143. var a = this.objectToHandle[o.sid];
  25144. return a || (this.objectToHandle[o.sid] = a = this.handleCount++,
  25145. this.handleToObject[a] = o),
  25146. a
  25147. }
  25148. return R.warn("Showcase -> findRankedtag: Unable to find nearby tag."),
  25149. -1
  25150. }
  25151. }(),
  25152. clickNearesttag: function(e) {
  25153. this.clickRankedtag(0, e)
  25154. },
  25155. clickRankedtag: function(e, t) {
  25156. var i = a.call(this, e, t);
  25157. i && O.call(this, i)
  25158. },
  25159. clickNearestPano: function(e, t) {
  25160. this.clickRankedPano(0, e, t)
  25161. },
  25162. clickRankedPano: function(e, t, i) {
  25163. var n = o.call(this, e, t);
  25164. n ? r.call(this, n, i) : i(null)
  25165. },
  25166. clickPano: function(e, t) {
  25167. var i = this.handleTable[e];
  25168. i ? r.call(this, i, t) : t(null)
  25169. },
  25170. rotateDirection: function() {
  25171. return function(e, t) {
  25172. var i = e.direction
  25173. , n = e.angle;
  25174. if (!P.active) {
  25175. var r = 0
  25176. , o = 0
  25177. , a = 0
  25178. , s = 0;
  25179. if (!n || isNaN(n))
  25180. return R.warn("Showcase -> rotateDirection: Invalid rotation angle."),
  25181. void (t && t({
  25182. success: !1,
  25183. error: "Invalid rotation angle."
  25184. }));
  25185. if (this.player.mode === E.TRANSITIONING)
  25186. return R.warn("Automation -> rotateDirection: Cannot rotate while transitioning"),
  25187. void (t && t({
  25188. success: !1,
  25189. error: "Cannot rotate while transitioning"
  25190. }));
  25191. if (i === v.RIGHT || i === v.LEFT)
  25192. i === v.RIGHT && (n = -n),
  25193. r = n > 0 ? -1 : 1,
  25194. a = n;
  25195. else {
  25196. if (i !== v.UP && i !== v.DOWN)
  25197. return R.warn("Showcase -> rotateDirection: Invalid direction for rotation: " + i),
  25198. void (t && t({
  25199. success: !1,
  25200. error: "Invalid direction for rotation."
  25201. }));
  25202. if (this.player.mode === E.FLOORPLAN)
  25203. return R.warn("Showcase -> rotateDirection: Cannot rotate " + i + " in floorplan mode"),
  25204. void (t && t({
  25205. success: !1,
  25206. error: "Cannot rotate " + i + " in floorplan mode"
  25207. }));
  25208. if (i === v.DOWN && (n = -n),
  25209. n = N.call(this, n),
  25210. 0 === n)
  25211. return R.warn("Showcase -> rotateDirection: Already at maximum rotation in direction: " + i),
  25212. void (t && t({
  25213. success: !1,
  25214. error: "Already at maximum rotation in direction: " + i
  25215. }));
  25216. o = n > 0 ? 1 : -1,
  25217. s = n
  25218. }
  25219. var l = n;
  25220. n = c.Math.degToRad(n),
  25221. a = c.Math.degToRad(a),
  25222. s = c.Math.degToRad(s);
  25223. var h = this.controls.activeControl
  25224. , u = function() {
  25225. h.stopRotating(!0),
  25226. t && t({
  25227. success: !0,
  25228. message: "Rotated " + l.toFixed(2) + "° in direction: " + e.direction
  25229. })
  25230. };
  25231. h.startRotating(r, o),
  25232. P.start(a, s, this.player, u)
  25233. }
  25234. }
  25235. }(),
  25236. rotate: function() {
  25237. var e = new c.Vector3
  25238. , t = new c.Vector3;
  25239. return function(i, n) {
  25240. var r = i.xAngle
  25241. , o = i.yAngle;
  25242. if (!P.active) {
  25243. if (r = r || 0,
  25244. o = o || 0,
  25245. isNaN(r) || isNaN(o))
  25246. return R.warn("Showcase -> rotate: Invalid rotation angle."),
  25247. void (n && n({
  25248. success: !1,
  25249. error: "Invalid rotation angle."
  25250. }));
  25251. if (this.player.mode === E.TRANSITIONING)
  25252. return R.warn("Automation -> rotate: Cannot rotate while transitioning"),
  25253. void (n && n({
  25254. success: !1,
  25255. error: "Cannot rotate while transitioning"
  25256. }));
  25257. Math.abs(r) < .01 && (r = 0),
  25258. Math.abs(o) < .01 && (o = 0);
  25259. var a = o;
  25260. o = N.call(this, o),
  25261. r = -r;
  25262. var s = a > 0 ? "UP" : "DOWN";
  25263. if (!r && a && !o)
  25264. return R.warn("Showcase -> rotate: Already at maximum rotation in direction: " + s),
  25265. void (n && n({
  25266. success: !1,
  25267. error: "Already at maximum rotation in direction: " + s
  25268. }));
  25269. a > o && R.warn("Showcase -> rotate: Reached maximum rotation in direction: " + s);
  25270. var l = o;
  25271. o = c.Math.degToRad(o),
  25272. r = c.Math.degToRad(r),
  25273. e.copy(this.player.mode === E.FLOORPLAN ? I.UP : I.FORWARD),
  25274. this.player.getDirection(e),
  25275. t.copy(e).applyAxisAngle(I.UP, r),
  25276. t.applyAxisAngle(I.RIGHT, o);
  25277. var h = (e.angleTo(t),
  25278. r > 0 ? -1 : r < 0 ? 1 : 0)
  25279. , u = o > 0 ? 1 : o < 0 ? -1 : 0;
  25280. Math.abs(r) > Math.abs(o) ? u *= Math.abs(o / r) : Math.abs(o) > Math.abs(r) && (h *= Math.abs(r / o));
  25281. var d = this.controls.activeControl
  25282. , p = function() {
  25283. d.stopRotating(!0),
  25284. n && n({
  25285. success: !0,
  25286. message: "Rotated " + i.xAngle.toFixed(2) + "° horizontally, " + l.toFixed(2) + "° vertically"
  25287. })
  25288. };
  25289. d.startRotating(h, u),
  25290. P.start(r, o, this.player, p)
  25291. }
  25292. }
  25293. }(),
  25294. panCamera: function(e, t) {
  25295. function i(e) {
  25296. switch (r.removeAllListeners(T.AutoPanComplete),
  25297. r.removeAllListeners(T.AutoPanInterrupt),
  25298. r.removeAllListeners(T.AutoPanClamped),
  25299. e) {
  25300. case T.AutoPanInterrupt:
  25301. t({
  25302. success: !0,
  25303. message: "Camera panning interrupted."
  25304. });
  25305. break;
  25306. case T.AutoPanClamped:
  25307. if (r.autoPanPosition.x !== n.x || r.autoPanPosition.z !== n.z) {
  25308. if (Math.abs(this.player.position.x - r.autoPanPosition.x) < .01 && Math.abs(this.player.position.z - r.autoPanPosition.z) < .01)
  25309. return void t({
  25310. success: !1,
  25311. error: "Already at edge of current model bounds."
  25312. });
  25313. var i = "The view point is outside the bounds for the current model. ";
  25314. i += "The view point was clamped to " + o(r.target.x, r.target.z),
  25315. console.warn(i)
  25316. }
  25317. case T.AutoPanComplete:
  25318. t({
  25319. success: !0,
  25320. message: "Panned camera to position " + o(r.autoPanPosition.x, r.autoPanPosition.z)
  25321. })
  25322. }
  25323. }
  25324. if (this.player.mode !== E.DOLLHOUSE && this.player.mode !== E.FLOORPLAN)
  25325. return t({
  25326. success: !1,
  25327. error: "Camera panning is not available in the current mode: " + this.player.mode
  25328. });
  25329. var n = e.position
  25330. , r = this.player.control;
  25331. r.setAutoPanPosition(n.x, n.z),
  25332. r.autoPan = !0;
  25333. var o = function(e, t) {
  25334. return "(" + e.toFixed(2) + ", " + t.toFixed(2) + ")"
  25335. };
  25336. r.on(T.AutoPanComplete, i.bind(this, T.AutoPanComplete)),
  25337. r.on(T.AutoPanInterrupt, i.bind(this, T.AutoPanInterrupt)),
  25338. r.on(T.AutoPanClamped, i.bind(this, T.AutoPanClamped))
  25339. },
  25340. click: function(e, t) {
  25341. var i = e.x
  25342. , n = e.y
  25343. , r = e.percentage;
  25344. r === !0 && (i = i / 100 * $("#player").width(),
  25345. n = n / 100 * $("#player").height()),
  25346. this.player.handleInputStart(i, n),
  25347. this.player.updateIntersect(),
  25348. this.player.handleInputEnd(i, n)
  25349. },
  25350. mouseOver: function(e, t) {
  25351. var i = e.x
  25352. , n = e.y
  25353. , r = e.percentage;
  25354. r === !0 && (i = i / 100 * $("#player").width(),
  25355. n = n / 100 * $("#player").height()),
  25356. this.player.handleInputMove(i, n),
  25357. this.player.updateIntersect()
  25358. },
  25359. moveToMode: function(e, t) {
  25360. function i(e) {
  25361. t(e ? {
  25362. success: !1,
  25363. error: "Failed to load new mode: " + e
  25364. } : {
  25365. success: !0,
  25366. message: "Moved to new mode: " + n
  25367. })
  25368. }
  25369. var n = e.mode;
  25370. n === E.PANORAMA || n === E.DOLLHOUSE || n === E.FLOORPLAN ? this.director.changeMode(n).then(function() {
  25371. i()
  25372. }, function(e) {
  25373. i(e)
  25374. }) : t({
  25375. success: !1,
  25376. error: "Invalid mode selection"
  25377. })
  25378. }
  25379. }
  25380. }
  25381. ).call(this, "/js/sdk/automation.js")
  25382. }
  25383. , {
  25384. "../constants": 8,
  25385. "../enum/AlignmentType": 17,
  25386. "../enum/ControlEvents": 21,
  25387. "../enum/Direction": 22,
  25388. "../enum/GLCubeFaces": 25,
  25389. "../enum/Keys": 30,
  25390. "../enum/ModelManagerEvents": 33,
  25391. "../enum/PlayerEvents": 40,
  25392. "../enum/RenderLayers": 41,
  25393. "../enum/Vectors": 50,
  25394. "../enum/Viewmode": 51,
  25395. "../enum/WarpStyle": 52,
  25396. "../lib/jpeg_encoder": 94,
  25397. "../sdk/SdkEvents": 161,
  25398. "../settings": 166,
  25399. "../util/common": 185,
  25400. "../util/logger": 189,
  25401. "../util/math": 190,
  25402. "../util/panorama": 191,
  25403. "./ApiHost": 159,
  25404. "./PostMessageType": 160,
  25405. "./TransitionStyles": 162,
  25406. three: 217
  25407. }],
  25408. 165: [function(e, t, i) {
  25409. "use strict";
  25410. function n(e) {
  25411. this.sourceWindow = e,
  25412. this.targetWindow = null,
  25413. this.targetOrigin = null,
  25414. this.id = Math.floor(1e5 * Math.random()),
  25415. this.bindEvents()
  25416. }
  25417. var r = e("./PostMessageType")
  25418. , o = e("events").EventEmitter;
  25419. n.prototype = Object.create(o.prototype),
  25420. n.prototype.bindEvents = function() {
  25421. this.sourceWindow.addEventListener("message", this.onPostmessageReceived.bind(this))
  25422. }
  25423. ,
  25424. n.prototype.setTarget = function(e, t) {
  25425. this.targetWindow = e,
  25426. this.targetOrigin = t
  25427. }
  25428. ,
  25429. n.prototype.onPostmessageReceived = function(e) {
  25430. var t = e.origin || e.originalEvent.origin
  25431. , i = e.source;
  25432. switch (e.data.type) {
  25433. case r.CONNECT:
  25434. break;
  25435. case r.RESPONSE:
  25436. if (this.id !== e.data.toId)
  25437. return;
  25438. default:
  25439. if (!this.validateMessageOrigin(t))
  25440. return
  25441. }
  25442. var n = e.data;
  25443. n.source = i,
  25444. n.origin = t,
  25445. n.timestamp = Date.now(),
  25446. this.emit(e.data.type, n)
  25447. }
  25448. ,
  25449. n.prototype.validateMessageOrigin = function(e) {
  25450. return "*" === this.targetOrigin || e === this.targetOrigin
  25451. }
  25452. ,
  25453. n.prototype.send = function(e) {
  25454. this.targetWindow && this.targetOrigin && (e.fromId = this.id,
  25455. this.targetWindow.postMessage(e, this.targetOrigin))
  25456. }
  25457. ,
  25458. t.exports = n
  25459. }
  25460. , {
  25461. "./PostMessageType": 160,
  25462. events: 202
  25463. }],
  25464. 166: [function(e, t, i) {
  25465. "use strict";
  25466. var n = e("three")
  25467. , r = e("./util/browser")
  25468. , o = e("./enum/Viewmode")
  25469. , a = e("./enum/VROption")
  25470. , s = e("./enum/Colors")
  25471. , l = e("./enum/WarpStyle")
  25472. , c = e("./util/easing")
  25473. , h = e("./util/common")
  25474. , u = e("./util/showcase")
  25475. , d = e("./constants")
  25476. , p = {
  25477. debug: !1,
  25478. version: "2.25.6-0-gd87e5b1",
  25479. languageTag: r.valueFromHash("lang", null),
  25480. pageTitle: "四维虚拟漫游",
  25481. authorizationHeader: u.getAuthorizationHeader(),
  25482. autoplay: r.valueFromHash("play", !1) || !r.inIframe(),
  25483. logLevel: r.valueFromHash("log", 2),
  25484. skyboxRadius: 2500,
  25485. modelBoundsPadding: 5,
  25486. showNeighbors: !1,
  25487. brand: r.valueFromHash("brand", !0),
  25488. showHighlights: r.valueFromHash("hhl", !0) && r.valueFromHash("hr", 1),
  25489. startHighlights: r.valueFromHash("hl", -1),
  25490. specialEdition: r.valueFromHash("bn", 0),
  25491. useWheel: r.valueFromHash("wh", !0),
  25492. crossOrigin: "anonymous",
  25493. fancierTransition: !1,
  25494. wireframe: !1,
  25495. skyboxWireframe: !1,
  25496. modelAlpha: 1,
  25497. highlightPanoSelection: !1,
  25498. showSweeps: !0,
  25499. showSkyboxes: !1,
  25500. showMesh: !0,
  25501. showFloors: !1,
  25502. showFloorDuration: 300,
  25503. showFloorDelay: 300,
  25504. hideFloorDuration: 300,
  25505. hideFloorDelay: 0,
  25506. reticuleOpacityTransitionTime: 250,
  25507. reticuleColor: window.DATA.mouseMarkerColor || s.newBlue, // 方奕卓 配置鼠标标志颜色
  25508. markerOpacityTransitionTime: 500,
  25509. guiAnimationSpeed: 250,
  25510. highlightAnimationDuration: 500,
  25511. modelComponentLoadSpinnerDelay: 150,
  25512. captureErrors: !1,
  25513. maxMobileTextures: 6,
  25514. minimalMemoryMode: r.valueFromHash("m3", r.isMobile()),
  25515. startupFlyinDelay: 3e3,
  25516. dollhouseDefault: {
  25517. minDistance: 15,
  25518. maxDistance: 50,
  25519. minPolarAngle: n.Math.degToRad(10),
  25520. maxPolarAngle: n.Math.degToRad(90)
  25521. },
  25522. hideReticuleTimeout: 1e3,
  25523. analytics: {
  25524. inactivityThreshold: 30,
  25525. sessionTrackingRate: .15,
  25526. maxTrackedErrors: 20,
  25527. sessionDurationPingFrequency: 10,
  25528. sessionDurationTimeout: 15
  25529. },
  25530. flydown: {
  25531. movementEasing: "easeInOutQuad",
  25532. movementDelay: .001,
  25533. rotationEasing: "easeInOutQuad",
  25534. rotationDelay: .5,
  25535. modelTextureDelay: .75,
  25536. skyboxDelay: .75
  25537. },
  25538. transition: {
  25539. flySpeed: .001,
  25540. flyTime: 750,
  25541. flytimeMaxDistanceThreshold: 5,
  25542. flytimeDistanceMultiplier: 150,
  25543. aimTime: 1500,
  25544. aimSlowFactor: 1.5,
  25545. blur: 0.8,
  25546. movementEasing: "easeInOutQuad",
  25547. blendEasing: "easeInOutQuad",
  25548. fastForwardFactor: 4,//r.valueFromHash("mfis", 3) //快速停止导览的速度,原先是3
  25549. },
  25550. show360Views: {
  25551. enabled: !0,
  25552. transitionTime: 1e3
  25553. },
  25554. quickstart: {
  25555. enabled: 1 === r.valueFromHash("qust", 0) || 1 === r.valueFromHash("qs", 0),
  25556. animation: 1400,
  25557. showTextDelay: 500,
  25558. fadeOutDelay: 3e3,
  25559. fovChange: 10
  25560. },
  25561. appConfig: {
  25562. webvr_version: null,
  25563. segment_key: null,
  25564. embedly_key: null,
  25565. branch_key: null,
  25566. keen_write_key: null,
  25567. keen_project_id: null
  25568. },
  25569. vr: {
  25570. enabled: !0,
  25571. allowWebVR: !1,
  25572. option: r.valueFromHash("vr", a.CONTEXTUAL)
  25573. },
  25574. share: {
  25575. enabled: !r.valueFromHash("mls", 0) && r.valueFromHash("brand", !0)
  25576. },
  25577. input: {
  25578. longTapThreshold: 200,
  25579. moveToleranceNDC: .08,
  25580. touchMoveThreshold: 25
  25581. },
  25582. help: {
  25583. modalStayDuration: 600
  25584. },
  25585. immersive: {
  25586. timeToShowAgain: 1250,
  25587. uiStayDuration: 600
  25588. },
  25589. tourInteraction: {
  25590. disabled: "0" === r.valueFromHash("tourcta", null),
  25591. showPauseButton: 1e3,
  25592. showModal: 1500,
  25593. allowNextClick: 200,
  25594. largeModal: "1" === r.valueFromHash("tourcta", null),
  25595. smallModal: "2" === r.valueFromHash("tourcta", null)
  25596. },
  25597. labels: {
  25598. enabled: !1,
  25599. hideUntilStart: !0,
  25600. fadeInDuration: 250,
  25601. fadeInDelay: 250,
  25602. fadeOutDuration: 250,
  25603. fadeOutDelay: 0,
  25604. zoomHideThreshhold: {
  25605. mobile: r.isSmallScreen() ? .45 : .6,
  25606. desktop: 2
  25607. },
  25608. zoomTruncateThreshhold: {
  25609. mobile: r.isSmallScreen() ? .35 : .45,
  25610. desktop: .85
  25611. },
  25612. minLengthForTruncate: 16,
  25613. truncateLength: 12,
  25614. truncateSuffix: "..."
  25615. },
  25616. tags: {
  25617. enabled: r.valueFromHash("mt", 1),
  25618. startup: {
  25619. hideUntilStart: !0,
  25620. fadeInDuration: 500,
  25621. fadeInDelay: 100
  25622. },
  25623. visibility: {
  25624. anyDistance: !0,
  25625. visibleDistance: 8,
  25626. cameraClearance: .1,
  25627. alphaTestLevel: .05,
  25628. hideViaFloor: !0,
  25629. hideOffScreenDisc: !1,
  25630. hideOffScreenObject: !1
  25631. },
  25632. disc: {
  25633. opacity: 1,
  25634. disabledOpacity: .5,
  25635. scale: {
  25636. nearBound: 1.5,
  25637. farBound: 4.8,
  25638. linkFarBound: !1,
  25639. linkPercent: 40,
  25640. maxSize: 80,
  25641. minSize: 40,
  25642. baseViewportSize: 800,
  25643. responsiveness: 100
  25644. }
  25645. },
  25646. pole: {
  25647. enabled: !0,
  25648. height: .5,
  25649. width: 2,
  25650. opacity: .5,
  25651. color: "white"
  25652. },
  25653. navigate: {
  25654. nearestPano: !0,
  25655. lineOfSight: !0,
  25656. reactivate: !0,
  25657. aimAt: "disc",
  25658. tiltTolerance: 25,
  25659. rotateSpeedFactor: .6
  25660. }
  25661. },
  25662. path: {
  25663. color: window.DATA.floorMarkerColor || s.newBlue, // 方奕卓 配置导览标志颜色
  25664. colorUp: s._desat(s.newBlue, .5),
  25665. colorDown: s._darken(s.newBlue, .35),
  25666. opacity: .5,
  25667. style: "ribbon",
  25668. height: .025,
  25669. ribbonWidth: .24,
  25670. outsideHeight: .5,
  25671. waypointRadius: .5,
  25672. waypointIndoorRadius: .24,
  25673. waypointPulse: 1e3,
  25674. typ: l.BLACK,
  25675. meshFree: r.valueFromHash("mf", 1),
  25676. mapGuides: r.valueFromHash("guides", !0),
  25677. fadeInTime: 400,
  25678. fadeOutTime: 300
  25679. },
  25680. warp: {
  25681. nearPanoDist: .1,
  25682. matchCam: !1,
  25683. blur: .33,
  25684. fastTime: 1500,
  25685. teleportTime: 1500,//瞬间过渡的时间
  25686. flytimeDistanceMultiplier:150,//add
  25687. flyTime:750,//add
  25688. outsideTime: 2e3,
  25689. lookAheadMax: .3,
  25690. lookAheadDist: 2.5,
  25691. softPushDist: .37,
  25692. softPushEnd: .3,
  25693. softBendAngle: 8,
  25694. softBendTilt: 4,
  25695. softBendEnd: .3,
  25696. doBurns: true, //r.valueFromHash("kb", !0),
  25697. burnsAngle: 8, //导览在每个点停留时的旋转角度
  25698. minBurnsAngle: 35,
  25699. minDownAngle: -35,
  25700. maxTurnPerSec: 280,
  25701. maxAimPerSec: 35,
  25702. minRotation: 12,
  25703. maxAimRotation: 33.2,
  25704. turnFriction: .2,
  25705. flySpeed: .01,
  25706. minWarpTime: 1200,
  25707. warpInterruptionRedirectTime: 500,
  25708. tourStepDelay: r.valueFromHash("st", 0),
  25709. walkDelay: 0,
  25710. walkMaxDist: 50,
  25711. walkMinDist: .8,
  25712. walkSlideShowThreshhold: 3000,
  25713. walkExtraPanosDistance: .4,
  25714. timePerMeter: 1200,
  25715. motionLeadTime: 5000,
  25716. movementEasing: "easeInOutQuad",
  25717. blendEasing: "easeInOutQuad",
  25718. showBunny: !1,
  25719. loop: r.valueFromHash("lp", !1),
  25720. auto: r.valueFromHash("ts", -1),
  25721. eOrder: 'YXZ', //"YXZ",
  25722. stepFactor: .25,
  25723. brakeStrength: 2,
  25724. minBrakeAngle: .1,
  25725. maxBrakeAngle: 1.8,
  25726. climbEffort: 4
  25727. },
  25728. rotationFriction: .05,
  25729. rotationAccelerationInside: 4.5,
  25730. rotationAccelerationOutside: .15,
  25731. rotationAfterMoveMultiplier: 40,
  25732. rotationAfterMoveHistoryCount: 5,
  25733. panFriction: .09,
  25734. panAccelerationOutside: 60,
  25735. onload: r.valueFromHash("onload", o.PANORAMA),
  25736. zoomNearLimit: .1,
  25737. zoomFarLimit: 50,
  25738. navigation: {
  25739. panoScores: !1,
  25740. mouseDirection: !0,
  25741. filterStrictness: .75,
  25742. angleFactor: -30,
  25743. directionFactor: 10,
  25744. distanceFactor: -1,
  25745. optionalityFactor: 3
  25746. },
  25747. sdkInit: !1,
  25748. secretPanelWord: [38, 38, 40, 40, 37, 39, 37, 39, 66, 65],
  25749. console: r.valueFromHash("console", !1),
  25750. noMeshFloorPositionOffset: new n.Vector3(0,-1.2,0),
  25751. panoramaNeighbourMaxDistance: 5,
  25752. panoFloorClickRadius: .35,
  25753. showScreenshotLocations: !1,
  25754. showAxis: !1,
  25755. showNeighbourRaycasts: !1,
  25756. colorMarkerOnLoad: !1,
  25757. colorMarkerByFloor: !1,
  25758. tiling: {
  25759. panoPreRenderRepeatDelay: 2500,
  25760. panoPreRenderDelay: 500,
  25761. preRenderTourPanos: r.valueFromHash("tileprerender", 0),
  25762. tilingFlagNames: ["usetiles", "tiles"],
  25763. maxNavPanoQuality: r.valueFromHash("maxtileq", null),
  25764. maxZoomPanoQuality: r.valueFromHash("maxztileq", null),
  25765. overlayStyle: r.valueFromHash("tileoverlay", 0),
  25766. uploadIntervalDelay: r.valueFromHash("tileupdelay", 10),
  25767. initialIntervalDelay: r.valueFromHash("itiledelay", 0),
  25768. maxNonBaseUploadsPerFrame: r.valueFromHash("maxnbtpf", 2),
  25769. maxBaseUploadsPerFrame: r.valueFromHash("maxbtpf", 6),
  25770. customCompression: r.valueFromHash("tilecustcomp", 0),
  25771. // mobileHighQualityOverride: !1,
  25772. mobileHighQualityOverride: 1,
  25773. allowUltraHighResolution: true
  25774. },
  25775. zoom: {
  25776. enabled: true,
  25777. forceOff: r.valueFromHash("nozoom", 0),
  25778. overridemax: r.valueFromHash("maxzoom", null),
  25779. overridemin: r.valueFromHash("minzoom", null),
  25780. max: d.highQualityMaxZoom,
  25781. min: 1,
  25782. transitionStyle: r.valueFromHash("zoomtrans", 1),
  25783. activationThreshold: 1.1,
  25784. restoreTime: 500
  25785. },
  25786. profiling: {
  25787. enabled: r.valueFromHash("mem", !1)
  25788. }
  25789. };
  25790. p = h.deepExtend(p, d, {
  25791. insideFOV: r.valueFromHash("fov", d.insideFOV),
  25792. insideFOVMax: r.valueFromHash("fovmax", d.insideFOVMax),
  25793. panorama: {
  25794. transitionTime: 1e3,
  25795. modelAlpha: 0,
  25796. modelAlphaDelay: p.flydown.modelTextureDelay,
  25797. modelAlphaLength: 1,
  25798. skyboxOpacity: 1,
  25799. skyboxOpacityDelay: p.flydown.skyboxDelay,
  25800. skyboxOpacityLength: .9,
  25801. fovLength: 1,
  25802. fovDelay: 0,
  25803. cameraMatrixDuration: .8,
  25804. cameraMatrixDelay: 0,
  25805. cameraMatrixEase: c.easeInCubic,
  25806. reticuleOpacity: 1,
  25807. markerOpacity: .3,
  25808. markerOpacityOnHover: 1
  25809. },
  25810. dollhouse: {
  25811. transitionTime: 1e3,
  25812. modelAlpha: 1,
  25813. modelAlphaDelay: 0,
  25814. modelAlphaLength: 1 - p.flydown.modelTextureDelay,
  25815. skyboxOpacity: 0,
  25816. skyboxOpacityDelay: 0,
  25817. skyboxOpacityLength: 1 - p.flydown.skyboxDelay,
  25818. fovLength: 1,
  25819. fovDelay: 0,
  25820. cameraMatrixDuration: .8,
  25821. cameraMatrixDelay: .3,
  25822. cameraMatrixEase: c.easeInCubic,
  25823. reticuleOpacity: 1,
  25824. markerOpacity: 0,
  25825. markerOpacityOnHover: 0
  25826. },
  25827. floorplan: {
  25828. transitionTime: 1e3,
  25829. modelAlpha: 1,
  25830. modelAlphaDelay: 0,
  25831. modelAlphaLength: 1 - p.flydown.modelTextureDelay,
  25832. skyboxOpacity: 0,
  25833. skyboxOpacityDelay: 0,
  25834. skyboxOpacityLength: 1 - p.flydown.skyboxDelay,
  25835. fovLength: 1,
  25836. fovDelay: 0,
  25837. cameraMatrixDuration: .5,
  25838. cameraMatrixDelay: 0,
  25839. cameraMatrixEase: c.easeOutCubic,
  25840. reticuleOpacity: 1,
  25841. markerOpacity: 0,
  25842. markerOpacityOnHover: 0,
  25843. cameraHeight: 50
  25844. },
  25845. transitioning: {
  25846. reticuleOpacity: 0,
  25847. markerOpacity: .3,
  25848. markerOpacityOnHover: 1
  25849. },
  25850. "floorplan-dollhouse": {
  25851. rotationDelay: 0,
  25852. rotationDuration: 1
  25853. },
  25854. "floorplan-panorama": {
  25855. rotationDelay: .5,
  25856. rotationDuration: 1
  25857. },
  25858. "dollhouse-panorama": {
  25859. rotationDelay: .5,
  25860. rotationDuration: 1
  25861. },
  25862. "dollhouse-floorplan": {
  25863. rotationDelay: 0,
  25864. rotationDuration: 1,
  25865. cameraMatrixDuration: 1.05,
  25866. cameraMatrixDelay: .5
  25867. },
  25868. "panorama-dollhouse": {
  25869. rotationDelay: 0,
  25870. rotationDuration: .5
  25871. },
  25872. "panorama-floorplan": {
  25873. transitionTime: 1500,
  25874. rotationDelay: 0,
  25875. rotationDuration: .5
  25876. }
  25877. }),
  25878. p.path.meshFree && (p.path.typ = l.WALK),
  25879. p.zoom.max = p.zoom.overridemax || p.zoom.max,
  25880. p.zoom.min = p.zoom.overridemin || p.zoom.min,
  25881. window._settings = t.exports = p
  25882. }
  25883. , {
  25884. "./constants": 8,
  25885. "./enum/Colors": 19,
  25886. "./enum/VROption": 47,
  25887. "./enum/Viewmode": 51,
  25888. "./enum/WarpStyle": 52,
  25889. "./util/browser": 182,
  25890. "./util/common": 185,
  25891. "./util/easing": 186,
  25892. "./util/showcase": 193,
  25893. three: 217
  25894. }],
  25895. 167: [function(e, t, i) {
  25896. "use strict";
  25897. var n = e("three")
  25898. , r = e("./settings")
  25899. , 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"
  25900. , a = "precision highp float;\nprecision highp int;\n\nuniform mat4 viewMatrix;\nuniform vec3 cameraPosition;\n";
  25901. t.exports = {
  25902. basicTextured: {
  25903. uniforms: {
  25904. tDiffuse: {
  25905. type: "t",
  25906. value: null
  25907. },
  25908. alpha: {
  25909. type: "f",
  25910. value: 1
  25911. }
  25912. },
  25913. vertexShader: "varying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}",
  25914. 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}"
  25915. },
  25916. copyCubeMap: {
  25917. uniforms: {
  25918. tDiffuse: {
  25919. type: "t",
  25920. value: null
  25921. },
  25922. alpha: {
  25923. type: "f",
  25924. value: 1
  25925. }
  25926. },
  25927. 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}",
  25928. 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}"
  25929. },
  25930. cube: {
  25931. uniforms: {
  25932. map: {
  25933. type: "t",
  25934. value: null
  25935. },
  25936. opacity: {
  25937. type: "f",
  25938. value: 1
  25939. }
  25940. },
  25941. vertexShader: o + "varying vec3 vWorldPosition;\n\nvoid main() {\n vWorldPosition = position;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}\n",
  25942. 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"
  25943. },
  25944. model: {
  25945. uniforms: {
  25946. map: {
  25947. type: "t",
  25948. value: null
  25949. },
  25950. modelAlpha: {
  25951. type: "f",
  25952. value: r.modelAlpha
  25953. },
  25954. opacity: {
  25955. type: "f",
  25956. value: 1
  25957. },
  25958. progress: {
  25959. type: "f",
  25960. value: 0
  25961. },
  25962. blackout: {
  25963. type: "i",
  25964. value: 0
  25965. },
  25966. pano0Map: {
  25967. type: "t",
  25968. value: null
  25969. },
  25970. pano0Position: {
  25971. type: "v3",
  25972. value: new n.Vector3
  25973. },
  25974. pano0Matrix: {
  25975. type: "m4",
  25976. value: new n.Matrix4
  25977. },
  25978. pano1Map: {
  25979. type: "t",
  25980. value: null
  25981. },
  25982. pano1Position: {
  25983. type: "v3",
  25984. value: new n.Vector3
  25985. },
  25986. pano1Matrix: {
  25987. type: "m4",
  25988. value: new n.Matrix4
  25989. }
  25990. },
  25991. vertexShader: o + `uniform vec3 pano0Position;
  25992. uniform mat4 pano0Matrix;\n\nuniform vec3 pano1Position;\n
  25993. uniform mat4 pano1Matrix;\n\nvarying vec2 vUv;\n
  25994. varying vec3 vWorldPosition0;
  25995. varying vec3 vWorldPosition1;
  25996. uniform int blackout;
  25997. void main() {
  25998. vUv = uv;
  25999. vec4 worldPosition = modelMatrix * vec4(position, 1.0);
  26000. vec3 positionLocalToPanoCenter0 = worldPosition.xyz - pano0Position;
  26001. vWorldPosition0 = (vec4(positionLocalToPanoCenter0, 1.0) * pano0Matrix).xyz;
  26002. vWorldPosition0.x *= -1.0;
  26003. vec3 positionLocalToPanoCenter1 = worldPosition.xyz - pano1Position;
  26004. vWorldPosition1 = (vec4(positionLocalToPanoCenter1, 1.0) * pano1Matrix).xyz;
  26005. vWorldPosition1.x *= -1.0;
  26006. gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
  26007. }`,
  26008. fragmentShader: a + `uniform sampler2D map;\nuniform float modelAlpha;\nuniform float opacity;\n
  26009. uniform 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\n
  26010. void main() {
  26011. const vec4 BLACK = vec4(0.0, 0.0, 0.0, 1.0);
  26012. const vec4 GREY = vec4(0.5, 0.5, 0.5, 1.0);
  26013. vec4 colorFromPanos;
  26014. if (blackout == 5){
  26015. colorFromPanos = textureCube( pano1Map, vWorldPosition1.xyz) ;
  26016. }else{
  26017. vec4 colorFromPano0 = textureCube( pano0Map, vWorldPosition0.xyz);
  26018. vec4 colorFromPano1 = textureCube( pano1Map, vWorldPosition1.xyz);
  26019. if (blackout == 0) {colorFromPanos = mix(colorFromPano0, colorFromPano1, progress);}
  26020. else if (blackout == 1) {
  26021. colorFromPanos = mix(colorFromPano0, BLACK, min(1.0, progress*2.0));
  26022. colorFromPanos = mix(colorFromPanos, colorFromPano1, max(0.0, progress * 2.0 - 1.0));
  26023. }
  26024. else if (blackout == 2) {colorFromPanos = mix(colorFromPano0, BLACK, progress);}
  26025. else if (blackout == 3) {colorFromPanos = mix(BLACK, colorFromPano1, max(0.0, progress * 2.0 - 1.0));}
  26026. }
  26027. vec4 colorFromTexture = texture2D( map, vUv );
  26028. colorFromPanos = mix(colorFromPanos, colorFromTexture, modelAlpha);
  26029. float whiteness = 1.0 - smoothstep(0.1, 0.2, opacity);
  26030. colorFromPanos = mix(colorFromPanos, GREY, whiteness);
  26031. gl_FragColor = vec4(colorFromPanos.rgb, opacity);
  26032. }`
  26033. },
  26034. hot:{
  26035. uniforms:{
  26036. color:{
  26037. type: "c",
  26038. value: new n.Color( 0xff2200 )
  26039. },
  26040. opac:{
  26041. type: "f",
  26042. value: 0
  26043. },
  26044. texture1:{
  26045. type: "t",
  26046. value: null
  26047. },
  26048. texture2:{
  26049. type: "t",
  26050. value: null
  26051. }
  26052. },
  26053. vertexShader:"varying vec2 vUv;\n\nvoid main() {\n\n vUv = uv ;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n",
  26054. 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"
  26055. },
  26056. modelOutside: {
  26057. uniforms: {
  26058. map: {
  26059. type: "t",
  26060. value: null
  26061. },
  26062. opacity: {
  26063. type: "f",
  26064. value: 1
  26065. }
  26066. },
  26067. vertexShader: o + "varying vec2 vUv;\n\nvoid main() {\n\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n",
  26068. 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"
  26069. },
  26070. ribbon: {
  26071. uniforms: {
  26072. map: {
  26073. type: "t",
  26074. value: null
  26075. },
  26076. opacity: {
  26077. type: "f",
  26078. value: 1
  26079. },
  26080. color: {
  26081. type: "c",
  26082. value: new n.Color(r.path.color)
  26083. }
  26084. },
  26085. 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",
  26086. 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"
  26087. },
  26088. waypoint: {
  26089. uniforms: {
  26090. map: {
  26091. type: "t",
  26092. value: null
  26093. },
  26094. opacity: {
  26095. type: "f",
  26096. value: 1
  26097. },
  26098. pulse: {
  26099. type: "f",
  26100. value: 1
  26101. },
  26102. nearFade: {
  26103. type: "v2",
  26104. value: new n.Vector2(2 * r.insideNear,2 * r.path.waypointIndoorRadius)
  26105. },
  26106. color: {
  26107. type: "c",
  26108. value: new n.Color(r.reticuleColor)
  26109. }
  26110. },
  26111. 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",
  26112. 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"
  26113. },
  26114. modelDebug: {
  26115. uniforms: {
  26116. map: {
  26117. type: "t",
  26118. value: null
  26119. },
  26120. modelAlpha: {
  26121. type: "f",
  26122. value: r.modelAlpha
  26123. },
  26124. depthmapRatio: {
  26125. type: "f",
  26126. value: 0
  26127. },
  26128. opacity: {
  26129. type: "f",
  26130. value: 1
  26131. },
  26132. progress: {
  26133. type: "f",
  26134. value: 0
  26135. },
  26136. considerOcclusion: {
  26137. type: "i",
  26138. value: r.fancierTransition
  26139. },
  26140. highlightPanoSelection: {
  26141. type: "i",
  26142. value: 0
  26143. },
  26144. useThirdPano: {
  26145. type: "i",
  26146. value: r.useThirdPano
  26147. },
  26148. pano0Map: {
  26149. type: "t",
  26150. value: null
  26151. },
  26152. pano0Depth: {
  26153. type: "t",
  26154. value: null
  26155. },
  26156. pano0Position: {
  26157. type: "v3",
  26158. value: new n.Vector3
  26159. },
  26160. pano0Matrix: {
  26161. type: "m4",
  26162. value: new n.Matrix4
  26163. },
  26164. pano0Weight: {
  26165. type: "f",
  26166. value: r.transition.pano0Weight
  26167. },
  26168. pano1Map: {
  26169. type: "t",
  26170. value: null
  26171. },
  26172. pano1Depth: {
  26173. type: "t",
  26174. value: null
  26175. },
  26176. pano1Position: {
  26177. type: "v3",
  26178. value: new n.Vector3
  26179. },
  26180. pano1Matrix: {
  26181. type: "m4",
  26182. value: new n.Matrix4
  26183. },
  26184. pano1Weight: {
  26185. type: "f",
  26186. value: r.transition.pano1Weight
  26187. },
  26188. pano2Map: {
  26189. type: "t",
  26190. value: null
  26191. },
  26192. pano2Depth: {
  26193. type: "t",
  26194. value: null
  26195. },
  26196. pano2Position: {
  26197. type: "v3",
  26198. value: new n.Vector3
  26199. },
  26200. pano2Matrix: {
  26201. type: "m4",
  26202. value: new n.Matrix4
  26203. },
  26204. pano2Weight: {
  26205. type: "f",
  26206. value: r.transition.pano2Weight
  26207. }
  26208. },
  26209. 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",
  26210. 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"
  26211. },
  26212. customDepth: {
  26213. uniforms: {
  26214. panoPosition: {
  26215. type: "v3",
  26216. value: new n.Vector3
  26217. }
  26218. },
  26219. 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",
  26220. 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"
  26221. },
  26222. skysphere: {
  26223. uniforms: {
  26224. radius: {
  26225. type: "f",
  26226. value: 0
  26227. }
  26228. },
  26229. 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",
  26230. 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"
  26231. },
  26232. tagDisc: {
  26233. uniforms: {
  26234. opacity: {
  26235. type: "f",
  26236. value: 0
  26237. },
  26238. color: {
  26239. type: "c",
  26240. value: new n.Color
  26241. },
  26242. bg: {
  26243. type: "t",
  26244. value: null
  26245. },
  26246. mask: {
  26247. type: "t",
  26248. value: null
  26249. }
  26250. },
  26251. vertexShader: o + "varying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}",
  26252. 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"
  26253. }
  26254. }
  26255. }
  26256. , {
  26257. "./settings": 166,
  26258. three: 217
  26259. }],
  26260. 168: [function(e, t, i) {
  26261. (function(i) {
  26262. "use strict";
  26263. var n = e("three")
  26264. , r = (e("url"),
  26265. e("./util/ajax"))
  26266. , o = e("./settings")
  26267. , a = e("./util/logger")
  26268. , s = e("./util/math")
  26269. , l = e("./util/showcase")
  26270. , c = e("./objects/Panorama")
  26271. , h = new a(i)
  26272. , u = e("./model/Model")
  26273. , d = e("./shaders")
  26274. , p = e("./util/transitions")
  26275. , f = e("./objects/Chunk")
  26276. , g = e("./objects/Reticule")
  26277. , m = e("./objects/Skybox")
  26278. , v = e("./objects/Floor")
  26279. , A = e("./cameras/DollhouseCamera")
  26280. , y = e("./cameras/FloorplanCamera")
  26281. , C = e("./cameras/PanoramaCamera")
  26282. , I = e("./controls/DollhouseControls")
  26283. , E = e("./controls/FloorplanControls")
  26284. , b = e("./controls/PanoramaControls");
  26285. n.ImageUtils.crossOrigin = o.crossOrigin,
  26286. t.exports = {
  26287. shaders: d,
  26288. transitions: p,
  26289. Model: u,
  26290. Chunk: f,
  26291. Floor: v,
  26292. Skybox: m,
  26293. Reticule: g,
  26294. Panorama: c,
  26295. DollhouseCamera: A,
  26296. FloorplanCamera: y,
  26297. PanoramaCamera: C,
  26298. DollhouseControls: I,
  26299. FloorplanControls: E,
  26300. PanoramaControls: b,
  26301. getModel: function(e) {
  26302. if (!e.url)
  26303. throw 'getModel(): missing parameter "url"';
  26304. e.autoload = void 0 === e.autoload || e.autoload;
  26305. var t = l.parseSidUrl(e.url);
  26306. e.urlBase = t.urlBase,
  26307. e.urlModel = t.urlModel,
  26308. e.urlFiles = t.urlFiles;
  26309. var i = this._getPlatformError();
  26310. return i ? $.Deferred().reject(i).promise() : (this.options = e,
  26311. this._loadModel().then(this._buildModel.bind(this)))
  26312. },
  26313. _getPlatformError: function() {
  26314. 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"
  26315. },
  26316. _loadModel: function() {
  26317. return r.get(this.options.urlModel, {
  26318. responseType: "json",
  26319. prefetchFrom: "model",
  26320. auth: l.getAuthorizationHeader()
  26321. }).then(null, function() {
  26322. return h.warn("Model loading failed at initial metadata load"),
  26323. "loading-failed"
  26324. })
  26325. },
  26326. _buildModel: function(e) {
  26327. e = l.normalizeModeldata(e, s);
  26328. var t = new u(this.options,e);
  26329. return this.options.autoload ? t.load(!0) : $.when(t)
  26330. }
  26331. }
  26332. }
  26333. ).call(this, "/js/showcase.js")
  26334. }
  26335. , {
  26336. "./cameras/DollhouseCamera": 5,
  26337. "./cameras/FloorplanCamera": 6,
  26338. "./cameras/PanoramaCamera": 7,
  26339. "./controls/DollhouseControls": 10,
  26340. "./controls/FloorplanControls": 11,
  26341. "./controls/PanoramaControls": 13,
  26342. "./model/Model": 139,
  26343. "./objects/Chunk": 144,
  26344. "./objects/Floor": 146,
  26345. "./objects/Panorama": 148,
  26346. "./objects/Reticule": 149,
  26347. "./objects/Skybox": 152,
  26348. "./settings": 166,
  26349. "./shaders": 167,
  26350. "./util/ajax": 181,
  26351. "./util/logger": 189,
  26352. "./util/math": 190,
  26353. "./util/showcase": 193,
  26354. "./util/transitions": 195,
  26355. three: 217,
  26356. url: 208
  26357. }],
  26358. 169: [function(e, t, i) {
  26359. "use strict";
  26360. function n() {
  26361. var e = {
  26362. renderTarget: null,
  26363. inUse: !1,
  26364. size: -1,
  26365. pano: null
  26366. };
  26367. return e
  26368. }
  26369. function r(e) {
  26370. M.push(e)
  26371. }
  26372. function o(e) {
  26373. var t = n();
  26374. return t.inUse = !0,
  26375. t.size = e,
  26376. r(t),
  26377. t
  26378. }
  26379. function a(e) {
  26380. for (var t = 0; t < M.length; t++) {
  26381. var i = M[t];
  26382. if (!i.inUse && i.size === e)
  26383. return i.inUse = !0,
  26384. i
  26385. }
  26386. return null
  26387. }
  26388. function s(e) {
  26389. for (var t = 0; t < M.length; t++) {
  26390. var i = M[t];
  26391. if (i.renderTarget === e)
  26392. return i.inUse = !1,
  26393. !0
  26394. }
  26395. return !1
  26396. }
  26397. function l() {
  26398. this.tileDirectory = {},
  26399. this.activeRenderTargetDescriptors = {},
  26400. this.activePanos = [],
  26401. this.panoLODDescriptors = {},
  26402. this.panoDescriptors = {},
  26403. this.tileTrees = {},
  26404. this.sceneRenderer = null,
  26405. this.tileDownloader = null,
  26406. this.forceQueue = [],
  26407. this.uploadQueues = {},
  26408. this.uploadInterval = null,
  26409. this.uploadIntervalCancelled = !1,
  26410. this.usingTileOverlay = !1,
  26411. this.overlayTilesLoaded = !1,
  26412. this.overlayTileBase = null,
  26413. this.overlayTilesBasic = {},
  26414. this.overlayTilesEnhanced = {},
  26415. this.zoomRenderTarget = null,
  26416. this.zoomPano = null,
  26417. this.zoomingActive = !1,
  26418. this.zoomPanoId = null,
  26419. this.zoomPanoRenderingDisabled = !1,
  26420. this.direction = new h.Vector3,
  26421. this.initTime = -1,
  26422. this.maxBaseUploadsPerFrame = x,
  26423. this.maxNonBaseUploadsPerFrame = T
  26424. }
  26425. function c() {
  26426. this.uploadIntervalCancelled || (this.overlayTilesLoaded || !this.usingTileOverlay ? (b = !0,
  26427. this.updateUploadQueue(this.maxNonBaseUploadsPerFrame, this.maxBaseUploadsPerFrame),
  26428. this.peekNextFromUploadQueue() ? this.refreshUploadInterval(w) : this.uploadInterval = null) : this.refreshUploadInterval(this.uploadIntervalDelay))
  26429. }
  26430. var h = e("three")
  26431. , u = e("../exception/BasicException")
  26432. , d = e("../settings")
  26433. , p = e("../enum/PanoSizeClass")
  26434. , f = (e("../objects/Panorama"),
  26435. e("../enum/PanoRendererEvents"))
  26436. , g = e("../enum/SceneRendererEvents")
  26437. , m = e("../enum/TileDownloaderEvents")
  26438. , v = e("../enum/Vectors")
  26439. , A = (e("../enum/GLCubeFaces"),
  26440. e("../objects/Panorama"),
  26441. e("./TileTree"))
  26442. , y = (e("./TileDownloader"),
  26443. e("./TilePrioritizer"))
  26444. , C = e("./TileUtils")
  26445. , p = e("../enum/PanoSizeClass")
  26446. , I = (e("../util/browser"),
  26447. e("../util/panorama"))
  26448. , E = e("events").EventEmitter
  26449. , b = !1
  26450. , w = d.tiling.uploadIntervalDelay
  26451. , _ = d.tiling.initialIntervalDelay
  26452. , T = d.tiling.maxNonBaseUploadsPerFrame
  26453. , x = d.tiling.maxBaseUploadsPerFrame
  26454. , S = {
  26455. Base: 0,
  26456. Remaining: 1
  26457. }
  26458. , M = [];
  26459. l.prototype = Object.create(E.prototype),
  26460. l.prototype.init = function(e, t, i) {
  26461. this.sceneRenderer = e,
  26462. this.tileDownloader = t,
  26463. this.qualityManager = i,
  26464. this.bindEvents(),
  26465. this.sceneRenderer.on(g.ContextCreated, this.loadOverlayTiles.bind(this)),
  26466. this.initTime = performance.now()
  26467. }
  26468. ,
  26469. l.prototype.getActivePanoTextures = function(e) {
  26470. e = e || [];
  26471. for (var t = 0; t < M.length; t++) {
  26472. var i = M[t];
  26473. i.renderTarget && i.renderTarget.texture && e.push(i.renderTarget.texture)
  26474. }
  26475. }
  26476. ,
  26477. l.prototype.hasQueuedTiles = function() {
  26478. var e = this.peekNextFromUploadQueue();
  26479. return null !== e && void 0 !== e
  26480. }
  26481. ,
  26482. l.prototype.getActiveRenderTargetDescriptor = function(e) {
  26483. return this.activeRenderTargetDescriptors[e]
  26484. }
  26485. ,
  26486. l.prototype.setActiveRenderTargetDescriptor = function(e, t) {
  26487. this.activeRenderTargetDescriptors[e] = t
  26488. }
  26489. ,
  26490. l.prototype.loadOverlayTiles = function() {
  26491. if (0 !== d.tiling.overlayStyle) {
  26492. var e = 0
  26493. , t = function(t, n, r) {
  26494. t = n ? t[n] = this.sceneRenderer.initSizedTexture2D(C.TILE_SIZE, h.ClampToEdgeWrapping) : this.overlayTileBase = this.sceneRenderer.initSizedTexture2D(C.TILE_SIZE, h.ClampToEdgeWrapping),
  26495. this.sceneRenderer.uploadTexture2D(r, t, 0, 0, C.TILE_SIZE, C.TILE_SIZE),
  26496. e++,
  26497. e === i.length && (this.overlayTilesLoaded = !0)
  26498. }
  26499. .bind(this)
  26500. , 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)]];
  26501. i.forEach(function(e) {
  26502. this.tileDownloader.loadImage(e[0], 0, e[1])
  26503. }
  26504. .bind(this)),
  26505. this.usingTileOverlay = !0
  26506. } else
  26507. this.usingTileOverlay = !1
  26508. }
  26509. ,
  26510. l.prototype.bindEvents = function() {
  26511. this.tileDownloader.on(m.TileDownloadSuccess, this.onTileDownloaded.bind(this))
  26512. }
  26513. ,
  26514. l.prototype.setupZoomRenderTarget = function() {
  26515. if (this.qualityManager.getMaxZoomPanoSize() >= this.qualityManager.getMaxNavPanoSize()) {
  26516. if (this.zoomRenderTarget && this.zoomRenderTarget.width === this.qualityManager.getMaxZoomPanoSize())
  26517. return;
  26518. var e = this.zoomRenderTarget;
  26519. if (this.zoomRenderTarget = this.initTiledPano(this.qualityManager.getMaxZoomPanoSize(), !1),
  26520. e) {
  26521. var t = e.width
  26522. , i = this.zoomRenderTarget.width;
  26523. this.sceneRenderer.copyCubeMap(e.texture, this.zoomRenderTarget, t, t, i, i),
  26524. e.texture.dispose(),
  26525. e.texture.loaded = !1,
  26526. e.texture.version = 0,
  26527. this.sceneRenderer.deallocateCubeTexture(e.texture),
  26528. e.texture = null
  26529. }
  26530. this.zoomPanoRenderingDisabled = !1
  26531. } else
  26532. this.zoomPanoRenderingDisabled = !0
  26533. }
  26534. ,
  26535. l.prototype.enableUltraHighQualityMode = function(e) {
  26536. if (!this.qualityManager.ultraHighQualityModeEnabled()) {
  26537. var t = this.qualityManager.getPanoSize(p.ULTRAHIGH);
  26538. this.tileDownloader.testDownload(t, C.TILE_SIZE, function(t) {
  26539. t && (this.qualityManager.enableUltraHighQualityMode(),
  26540. this.setupZoomRenderTarget(),
  26541. e())
  26542. }
  26543. .bind(this))
  26544. }
  26545. }
  26546. ,
  26547. l.prototype.activateTiledPano = function(e, t, i) {
  26548. i && this.clearAllQueuedUploads();
  26549. for (var n = 0; n < C.FACES_PER_PANO; n++)
  26550. this.initTileTree(e.id, n, this.qualityManager.getMaxPossiblePanoSize());
  26551. this.linkAllTilesAndNodes(e);
  26552. var r = this.getActiveRenderTargetDescriptor(e.id)
  26553. , l = t;
  26554. if (l > this.qualityManager.getMaxNavPanoSize() && (l = this.qualityManager.getMaxNavPanoSize()),
  26555. !r || l !== r.size) {
  26556. if (r && s(r.renderTarget),
  26557. r = a(l),
  26558. !r) {
  26559. var c = this.initTiledPano(l, !1);
  26560. r = o(c.width),
  26561. r.renderTarget = c
  26562. }
  26563. r.pano = e,
  26564. this.resetPanoDescriptor(e.id),
  26565. this.resetPanoLODDescriptors(e.id),
  26566. this.resetRenderStatus(e.id, !0, !0)
  26567. }
  26568. this.setActiveRenderTargetDescriptor(e.id, r);
  26569. var h = i ? 0 : 1;
  26570. return this.updateActivePanos(e, h),
  26571. r.renderTarget
  26572. }
  26573. ,
  26574. l.prototype.deactivateTiledPano = function(e) {
  26575. var t = this.getActiveRenderTargetDescriptor(e.id);
  26576. this.isRenderTargetDescriptorValid(t) && s(t.renderTarget),
  26577. this.setActiveRenderTargetDescriptor(e.id, null);
  26578. var i = this.getUploadQueueForPano(e.id);
  26579. this.clearUploadQueue(i),
  26580. this.updateActivePanos()
  26581. }
  26582. ,
  26583. l.prototype.updateActivePanos = function() {
  26584. var e = [];
  26585. return function(t, i) {
  26586. e.length = 0;
  26587. for (var n = 0; n < this.activePanos.length; n++) {
  26588. t && e.length === i && e.push(t);
  26589. var r = this.activePanos[n]
  26590. , o = this.getActiveRenderTargetDescriptor(r.id);
  26591. t && r.id === t.id || !this.isRenderTargetDescriptorValid(o) || e.push(r)
  26592. }
  26593. t && i >= e.length && e.push(t),
  26594. this.activePanos.length = 0,
  26595. this.activePanos.push.apply(this.activePanos, e)
  26596. }
  26597. }(),
  26598. l.prototype.getActivePanoCount = function() {
  26599. return this.activePanos.length
  26600. }
  26601. ,
  26602. l.prototype.resetRenderStatus = function(e, t, i, n) {
  26603. var r = null;
  26604. n && (r = A.getLevelCountForSize(C.TILE_SIZE, n) + 1);
  26605. for (var o = function(e, n, r, o) {
  26606. i && (n.tile.zoomUploaded = !1),
  26607. t && (n.tile.uploaded = !1)
  26608. }, a = 0; a < C.FACES_PER_PANO; a++) {
  26609. var s = this.getTileTree(e, a);
  26610. s.breadthFirst({
  26611. callback: o.bind(this, a),
  26612. minLevel: r
  26613. })
  26614. }
  26615. }
  26616. ,
  26617. l.prototype.copyBaseRenderStatusToZoomed = function(e) {
  26618. for (var t = A.getLevelCountForSize(C.TILE_SIZE, this.qualityManager.getMaxNavPanoSize()), i = function(e, t, i, n) {
  26619. t.tile.zoomUploaded = t.tile.uploaded,
  26620. t.zoomCovered = t.covered
  26621. }, n = 0; n < C.FACES_PER_PANO; n++) {
  26622. var r = this.getTileTree(e, n);
  26623. r.breadthFirst({
  26624. callback: i.bind(this, n),
  26625. maxLevel: t
  26626. })
  26627. }
  26628. }
  26629. ,
  26630. l.prototype.renderPanoTiles = function() {
  26631. var e = [];
  26632. return function(t, i, n, r) {
  26633. this.zoomRenderTarget && this.zoomRenderTarget.width === this.qualityManager.getMaxZoomPanoSize() || this.zoomPanoRenderingDisabled || this.setupZoomRenderTarget(),
  26634. i = i || this.direction || v.FORWARD;
  26635. var o = this.getActiveRenderTargetDescriptor(t);
  26636. if (!this.isRenderTargetDescriptorValid(o))
  26637. throw new u("PanoRenderer.renderPanoTiles() -> Cannot render to a pano that is not activated.");
  26638. for (var a = 0; a < C.FACES_PER_PANO; a++) {
  26639. var s = this.getTileTree(t, a);
  26640. e.length = 0,
  26641. s.breadthFirst({
  26642. saveVisited: e
  26643. });
  26644. for (var l = 0; l < e.length; l++) {
  26645. var c = e[l];
  26646. this.queueTileUpload(c.tile, !1, r || 0 === l && n)
  26647. }
  26648. }
  26649. this.updateDirection(i)
  26650. }
  26651. }(),
  26652. l.prototype.isRenderTargetDescriptorValid = function(e) {
  26653. return e && e.renderTarget
  26654. }
  26655. ,
  26656. l.prototype.isPanoActive = function(e) {
  26657. var t = this.getActiveRenderTargetDescriptor(e);
  26658. return this.isRenderTargetDescriptorValid(t)
  26659. }
  26660. ,
  26661. l.prototype.isPanoZoomed = function(e) {
  26662. return this.zoomingActive && this.zoomPanoId === e
  26663. }
  26664. ,
  26665. l.prototype.initTileTree = function(e, t, i) {
  26666. var n = this.tileTrees[e];
  26667. n || (n = [],
  26668. this.tileTrees[e] = n);
  26669. var r = n[t];
  26670. if (!r) {
  26671. var o = A.getLevelCountForSize(C.TILE_SIZE, i);
  26672. r = new A(C.TILE_SIZE,o),
  26673. n[t] = r
  26674. }
  26675. }
  26676. ,
  26677. l.prototype.getTileTree = function(e, t) {
  26678. var i = this.tileTrees[e];
  26679. if (!i)
  26680. throw new u("PanoRenderer.getTileTree() -> Tree array not yet initialized!");
  26681. var n = i[t];
  26682. if (!n)
  26683. throw new u("PanoRenderer.getTileTree() -> Tree not yet initialized!");
  26684. return n
  26685. }
  26686. ,
  26687. l.prototype.initTiledPano = function(e, t) {
  26688. var i = this.sceneRenderer.renderer
  26689. , n = (i.context,
  26690. new h.WebGLRenderTargetCube(e,e,{
  26691. stencilBuffer: !1
  26692. }))
  26693. , r = new h.CubeTexture([]);
  26694. n.texture = r,
  26695. r.image = [null, null, null, null, null, null],
  26696. r.flipY = !0,
  26697. t ? (r.generateMipmaps = !0,
  26698. r.magFilter = h.LinearFilter,
  26699. r.minFilter = h.LinearMipMapLinearFilter) : (r.generateMipmaps = !1,
  26700. r.magFilter = h.LinearFilter,
  26701. r.minFilter = h.LinearFilter),
  26702. r.format = h.RGBAFormat,
  26703. i.setRenderTarget(n),
  26704. i.setRenderTarget(null);
  26705. var o = i.properties.get(r);
  26706. return o.__image__webglTextureCube = o.__webglTexture,
  26707. n
  26708. }
  26709. ,
  26710. l.prototype.getUploadQueueForPano = function(e) {
  26711. var t = this.uploadQueues[e];
  26712. return t || (t = [],
  26713. this.uploadQueues[e] = t),
  26714. t
  26715. }
  26716. ,
  26717. l.prototype.isTileUploaded = function(e) {
  26718. return this.isPanoZoomed(e.panoId) ? e.zoomUploaded : e.uploaded
  26719. }
  26720. ,
  26721. l.prototype.setUploaded = function(e, t) {
  26722. this.isPanoZoomed(e.panoId) ? e.zoomUploaded = t : e.uploaded = t
  26723. }
  26724. ,
  26725. l.prototype.queueTileUpload = function(e, t, i) {
  26726. var n = this.getActiveRenderTargetDescriptor(e.panoId);
  26727. if (this.isRenderTargetDescriptorValid(n) && e.downloaded && !this.isTileUploaded(e) && (!e.uploadQueued || i) && (!(e.panoSize > this.qualityManager.getMaxNavPanoSize()) || this.zoomingActive)) {
  26728. var r = this.getUploadQueueForPano(e.panoId);
  26729. 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),
  26730. e.uploadQueued = !0,
  26731. this.uploadInterval || this.uploadIntervalCancelled || this.refreshUploadInterval(0))
  26732. }
  26733. }
  26734. ,
  26735. l.prototype.shoulPushToFrontOfQueue = function(e) {
  26736. return 0 === A.getLevelCountForSize(C.TILE_SIZE, e.panoSize)
  26737. }
  26738. ,
  26739. l.prototype.getTopUploadQueue = function() {
  26740. for (var e = null, t = null, i = S.Base; i <= S.Remaining; i++)
  26741. for (var n = 0; n < this.activePanos.length; n++)
  26742. if (e = this.activePanos[n],
  26743. t = this.getUploadQueueForPano(e.id),
  26744. t.length > 0)
  26745. switch (i) {
  26746. case S.Base:
  26747. if (0 === t[0].level)
  26748. return t;
  26749. break;
  26750. case S.Remaining:
  26751. return t
  26752. }
  26753. return null
  26754. }
  26755. ,
  26756. l.prototype.getNextFromUploadQueue = function() {
  26757. var e = function(e) {
  26758. var t = e.shift();
  26759. return t.uploadQueued = !1,
  26760. t
  26761. };
  26762. return function() {
  26763. if (this.forceQueue.length > 0)
  26764. return e(this.forceQueue);
  26765. var t = this.getTopUploadQueue();
  26766. return t && t.length > 0 ? e(t) : null
  26767. }
  26768. }(),
  26769. l.prototype.peekNextFromUploadQueue = function() {
  26770. if (this.forceQueue.length > 0)
  26771. return this.forceQueue[0];
  26772. var e = this.getTopUploadQueue();
  26773. return e && e.length > 0 ? e[0] : null
  26774. }
  26775. ,
  26776. l.prototype.clearAllQueuedUploads = function() {
  26777. this.clearAllUploadQueues(null, 0)
  26778. }
  26779. ,
  26780. l.prototype.clearAllQueuedUploadsForPano = function(e) {
  26781. this.clearAllUploadQueues(e, 0)
  26782. }
  26783. ,
  26784. l.prototype.clearAllUploadQueues = function(e, t) {
  26785. if (e)
  26786. this.clearUploadQueue(this.getUploadQueueForPano(e), t),
  26787. this.clearUploadQueue(this.forceQueue, t, e);
  26788. else {
  26789. for (var i = 0; i < this.activePanos.length; i++) {
  26790. var n = this.activePanos[i];
  26791. this.clearUploadQueue(this.getUploadQueueForPano(n.id), t)
  26792. }
  26793. this.clearUploadQueue(this.forceQueue, t)
  26794. }
  26795. }
  26796. ,
  26797. l.prototype.clearUploadQueue = function(e, t, i) {
  26798. void 0 !== t && null !== t || (t = 0);
  26799. for (var n = 0; n < e.length; ) {
  26800. var r = e[n];
  26801. (!i || i && i === r.tile.panoId) && r.level >= t ? (r.uploadQueued = !1,
  26802. e.splice(n, 1)) : n++
  26803. }
  26804. }
  26805. ,
  26806. l.prototype.refreshUploadInterval = function() {
  26807. var e = null;
  26808. return function(t) {
  26809. this.uploadIntervalCancelled || (e || (e = c.bind(this)),
  26810. null !== t && void 0 !== t || (t = w),
  26811. b || (t = _),
  26812. this.uploadInterval = window.setTimeout(e, t),
  26813. this.uploadIntervalDelay = t)
  26814. }
  26815. }(),
  26816. l.prototype.update = function() {
  26817. var e = performance.now()
  26818. , t = 0;
  26819. return function() {
  26820. this.uploadIntervalCancelled = !0,
  26821. window.clearTimeout(this.uploadInterval),
  26822. this.uploadInterval = null;
  26823. var i = performance.now() - e;
  26824. !(i > w || 0 === t) || !this.overlayTilesLoaded && this.usingTileOverlay || (this.updateUploadQueue(this.maxNonBaseUploadsPerFrame, this.maxBaseUploadsPerFrame),
  26825. e = performance.now()),
  26826. t++
  26827. }
  26828. }(),
  26829. l.prototype.updateUploadQueue = function(e, t) {
  26830. e || (e = 1);
  26831. for (var i = 0, n = 0; ; ) {
  26832. if (n >= t || i >= e)
  26833. break;
  26834. var r = this.getNextFromUploadQueue();
  26835. if (!r)
  26836. break;
  26837. if (0 !== r.level ? i++ : n++,
  26838. !(r.panoSize > this.qualityManager.getMaxNavPanoSize()) || this.zoomingActive) {
  26839. var o = this.getActiveRenderTargetDescriptor(r.panoId);
  26840. this.isRenderTargetDescriptorValid(o) && this.uploadTile(r, r.forceUpload)
  26841. }
  26842. }
  26843. }
  26844. ,
  26845. l.prototype.updateDirection = function(e) {
  26846. if (e = e || this.direction) {
  26847. this.direction = e;
  26848. for (var t = 0; t < this.activePanos.length; t++) {
  26849. var i = this.activePanos[t]
  26850. , n = this.getUploadQueueForPano(i.id);
  26851. y.sortPanoTiles(n, i, this.direction)
  26852. }
  26853. }
  26854. }
  26855. ,
  26856. l.prototype.uploadTile = function() {
  26857. var e = {}
  26858. , t = (new h.Vector4,
  26859. d.tiling.overlayStyle);
  26860. return function(i, n) {
  26861. var r = i.panoId
  26862. , o = i.image
  26863. , a = i.tileSize
  26864. , s = i.panoSize
  26865. , l = i.tileIndex
  26866. , c = (i.faceTileIndex,
  26867. i.totalTiles)
  26868. , u = (i.face,
  26869. i.tileX)
  26870. , d = i.tileY
  26871. , p = !0
  26872. , g = !1
  26873. , m = (this.getPanoDescriptor(r),
  26874. this.getPanoLODDescriptor(r, s))
  26875. , v = this.getActiveRenderTargetDescriptor(r)
  26876. , A = v.renderTarget
  26877. , y = v.size;
  26878. if (this.isPanoZoomed(r) && (A = this.zoomRenderTarget,
  26879. y = this.qualityManager.getMaxZoomPanoSize()),
  26880. this.isRenderTargetDescriptorValid(v) || (p = !1,
  26881. g = !1),
  26882. n || (this.anyUploaded(i.node) && (p = !1,
  26883. g = !0),
  26884. this.isTileUploaded(i) && (p = !1,
  26885. g = !1)),
  26886. p) {
  26887. var C = u * a
  26888. , I = d * a
  26889. , E = a / s * y
  26890. , b = C / s * y
  26891. , w = I / s * y;
  26892. e[a] || (e[a] = this.sceneRenderer.initSizedTexture2D(a, h.ClampToEdgeWrapping));
  26893. var _ = e[a];
  26894. if (this.sceneRenderer.uploadTexture2D(o, _, 0, 0, a, a),
  26895. 1 === t || 2 === t) {
  26896. var T = 1 === t ? this.overlayTilesBasic : this.overlayTilesEnhanced;
  26897. this.sceneRenderer.renderToCubeMap(_, A, a, a, 0, 0, a, a, b, w, E, E, i.cubeFace),
  26898. this.sceneRenderer.renderToCubeMap(T[s], A, a, a, 0, 0, a, a, b, w, E, E, i.cubeFace, h.NormalBlending, !0, .5)
  26899. } else
  26900. this.sceneRenderer.renderToCubeMap(_, A, a, a, 0, 0, a, a, b, w, E, E, i.cubeFace);
  26901. m.uploadCount++,
  26902. this.emit(f.TileRenderSuccess, r, s, l, c),
  26903. m.uploadCount === c && this.emit(f.PanoRenderComplete, r, s, c),
  26904. this.setUploaded(i, !0),
  26905. this.addCoverageForNode(i.node)
  26906. } else
  26907. this.setUploaded(i, !1);
  26908. return i.uploadAttempted || (m.uploadAttempts++,
  26909. this.emit(f.TileUploadAttempted, r, s, l, c)),
  26910. i.uploadAttempted = !0,
  26911. m.uploadAttempts === c && this.emit(f.UploadAttemptedForAllTiles, r, s, c),
  26912. g
  26913. }
  26914. }(),
  26915. l.prototype.linkTileAndNode = function(e, t) {
  26916. t.tile = e,
  26917. e.node = t
  26918. }
  26919. ,
  26920. l.prototype.linkAllTilesAndNodes = function(e) {
  26921. for (var t = function(t, i, n, r, o) {
  26922. var a = this.getTileDirectoryEntry(e.id, i, r, o);
  26923. this.linkTileAndNode(a, n)
  26924. }, i = 0; i < C.FACES_PER_PANO; i++) {
  26925. var n = this.getTileTree(e.id, i);
  26926. n.breadthFirst({
  26927. callback: t.bind(this, n, i)
  26928. })
  26929. }
  26930. }
  26931. ,
  26932. l.prototype.anyUploaded = function(e) {
  26933. if (!e)
  26934. return !1;
  26935. if (e.tile && this.isTileUploaded(e.tile))
  26936. return !0;
  26937. if (e.children)
  26938. for (var t = 0; t < e.children.length; t++) {
  26939. var i = e.children[t];
  26940. if (this.anyUploaded(i))
  26941. return !0
  26942. }
  26943. return !1
  26944. }
  26945. ,
  26946. l.prototype.setNodeCovered = function(e, t) {
  26947. this.isPanoZoomed(e.tile.panoId) ? e.zoomCovered = t : e.covered = t
  26948. }
  26949. ,
  26950. l.prototype.isNodeCovered = function(e) {
  26951. return !!e && (this.isPanoZoomed(e.tile.panoId) ? e.zoomCovered : e.covered)
  26952. }
  26953. ,
  26954. l.prototype.addCoverageForNode = function(e) {
  26955. if (this.setNodeCovered(e, !0),
  26956. e.parent && e.covered) {
  26957. var t = e.parent;
  26958. this.nodeSubcovered(t) && this.addCoverageForNode(t, !0)
  26959. }
  26960. }
  26961. ,
  26962. l.prototype.calcFullCoverage = function(e) {
  26963. var t = !1;
  26964. if (e.children)
  26965. for (var i = 0; i < e.children.length; i++) {
  26966. var n = e.children[i];
  26967. t = t || this.calcFullCoverage(n)
  26968. }
  26969. e.covered = e.tile.uploaded || t
  26970. }
  26971. ,
  26972. l.prototype.nodeSubcovered = function(e) {
  26973. if (!e.children)
  26974. return !1;
  26975. for (var t = 0; t < e.children.length; t++)
  26976. if (!e.children[t] || !this.isNodeCovered(e.children[t]))
  26977. return !1;
  26978. return !0
  26979. }
  26980. ,
  26981. l.prototype.resetPanoDescriptor = function(e) {
  26982. this.getPanoDescriptor(e)
  26983. }
  26984. ,
  26985. l.prototype.getPanoDescriptor = function(e) {
  26986. var t = this.panoDescriptors[e];
  26987. return t || (t = {},
  26988. this.panoDescriptors[e] = t),
  26989. t
  26990. }
  26991. ,
  26992. l.prototype.resetPanoLODDescriptors = function(e) {
  26993. var t = this.getPanoLODDescriptors(e);
  26994. for (var i in t)
  26995. if (t.hasOwnProperty(i)) {
  26996. var n = t[i];
  26997. n.uploadCount = 0,
  26998. n.uploadAttempts = 0
  26999. }
  27000. }
  27001. ,
  27002. l.prototype.getPanoLODDescriptor = function(e, t) {
  27003. var i = this.getPanoLODDescriptors(e)
  27004. , n = i[t];
  27005. return n || (n = {
  27006. uploadCount: 0,
  27007. uploadAttempts: 0
  27008. },
  27009. i[t] = n),
  27010. n
  27011. }
  27012. ,
  27013. l.prototype.getPanoLODDescriptors = function(e) {
  27014. var t = this.panoLODDescriptors[e];
  27015. return t || (t = {},
  27016. this.panoLODDescriptors[e] = t),
  27017. t
  27018. }
  27019. ,
  27020. l.prototype.onTileDownloaded = function(e) {
  27021. var t = A.getLevelCountForSize(C.TILE_SIZE, e.panoSize)
  27022. , i = this.getTileDirectoryEntry(e.panoId, e.face, t, e.faceTileIndex);
  27023. if (i.downloaded = !0,
  27024. i.image = e.image,
  27025. i.panoSize = e.panoSize,
  27026. i.tileX = e.tileX,
  27027. i.tileY = e.tileY,
  27028. i.totalTiles = e.totalTiles,
  27029. i.tileIndex = e.tileIndex,
  27030. i.faceTileIndex = e.faceTileIndex,
  27031. i.face = e.face,
  27032. i.cubeFace = I.mapFaceToCubemapFace(e.face),
  27033. i.panoId = e.panoId,
  27034. i.tileSize = e.tileSize,
  27035. i.direction = (new h.Vector3).copy(e.direction),
  27036. i.node = null,
  27037. i.level = A.getLevelCountForSize(C.TILE_SIZE, i.panoSize),
  27038. this.isPanoActive(i.panoId)) {
  27039. var n = this.getTileTree(i.panoId, i.face)
  27040. , r = n.getSubNode(i.panoSize, i.tileX, i.tileY);
  27041. this.linkTileAndNode(i, r),
  27042. this.queueTileUpload(i, !0)
  27043. }
  27044. }
  27045. ,
  27046. l.prototype.getTileDirectoryEntry = function(e, t, i, n) {
  27047. var r = this.tileDirectory[e];
  27048. r || (r = {},
  27049. this.tileDirectory[e] = r);
  27050. var o = 16384 * t + 1024 * i + n
  27051. , a = r[o];
  27052. return a || (a = {
  27053. downloaded: !1,
  27054. uploaded: !1,
  27055. zoomUploaded: !1
  27056. },
  27057. r[o] = a),
  27058. a._key = e + ":" + t + ":" + i + ":" + n,
  27059. a._tileKey = o,
  27060. a
  27061. }
  27062. ,
  27063. l.prototype.setZoomingActive = function(e, t, i) {
  27064. this.zoomPanoRenderingDisabled || e === this.zoomingActive && this.zoomPanoId === t.id || (this.zoomingActive = e,
  27065. this.zoomPanoId = t.id,
  27066. this.zoomingActive && (this.zoomPanoId !== t.id || i) && this.updateZoomedPanoFromBase(t))
  27067. }
  27068. ,
  27069. l.prototype.updateZoomedPanoFromBase = function(e) {
  27070. if (!this.zoomPanoRenderingDisabled) {
  27071. var t = this.getActiveRenderTargetDescriptor(e.id);
  27072. if (t && t.renderTarget) {
  27073. var i = this.qualityManager.getMaxZoomPanoSize()
  27074. , n = t.renderTarget
  27075. , r = t.size;
  27076. this.sceneRenderer.copyCubeMap(n.texture, this.zoomRenderTarget, r, r, i, i),
  27077. this.copyBaseRenderStatusToZoomed(e.id)
  27078. }
  27079. }
  27080. }
  27081. ,
  27082. t.exports = l
  27083. }
  27084. , {
  27085. "../enum/GLCubeFaces": 25,
  27086. "../enum/PanoRendererEvents": 35,
  27087. "../enum/PanoSizeClass": 36,
  27088. "../enum/SceneRendererEvents": 43,
  27089. "../enum/TileDownloaderEvents": 45,
  27090. "../enum/Vectors": 50,
  27091. "../exception/BasicException": 55,
  27092. "../objects/Panorama": 148,
  27093. "../settings": 166,
  27094. "../util/browser": 182,
  27095. "../util/panorama": 191,
  27096. "./TileDownloader": 171,
  27097. "./TilePrioritizer": 172,
  27098. "./TileTree": 173,
  27099. "./TileUtils": 174,
  27100. events: 202,
  27101. three: 217
  27102. }],
  27103. 170: [function(e, t, i) {
  27104. "use strict";
  27105. function n(e, t, i) {
  27106. this.maxNavPanoSize = -1,
  27107. this.maxZoomPanoSize = -1,
  27108. this.devicePixelDensity = e,
  27109. this.deviceScreenSize = t,
  27110. this.clientBandwidth = i,
  27111. this.panoSizeClassMap = {},
  27112. this.useHighResolutionPanos = !0,
  27113. this.useUltraHighResolutionPanos = !1,
  27114. this.modelHasUltraHighPanos = !1
  27115. }
  27116. var r = e("../enum/PanoSizeClass")
  27117. , o = e("../settings")
  27118. , a = e("../util/browser")
  27119. , s = e("../constants")
  27120. , l = e("../util/showcase")
  27121. , c = e("../enum/ModelManagerEvents");
  27122. n.prototype.init = function(e) {
  27123. this.buildPanoSizeClassMap(this.devicePixelDensity, this.deviceScreenSize, this.clientBandwidth),
  27124. this.ultraHighSize = this.getPanoSize(r.ULTRAHIGH),
  27125. this.highSize = this.getPanoSize(r.HIGH),
  27126. this.standardSize = this.getPanoSize(r.STANDARD),
  27127. this.baseSize = this.getPanoSize(r.BASE),
  27128. o.tiling.maxZoomPanoQuality && this.ultraHighSize <= o.tiling.maxZoomPanoQuality && (o.tiling.allowUltraHighResolution = !0),
  27129. this.highQualityThreshold = a.valueFromHash("threshold2k", s.windowHeightHighQualityThreshold),
  27130. this.updateMaximums(),
  27131. e.on(c.ActiveModelChanged, this.onModelChanged.bind(this))
  27132. }
  27133. ,
  27134. n.prototype.updateFromModel = function(e) {
  27135. this.updateHighResolutionSettings(e),
  27136. this.updateUltraHighResolutionSettings(e)
  27137. }
  27138. ,
  27139. n.prototype.updateHighResolutionSettings = function(e) {
  27140. //---------------------许钟文---------原始的会判断modeldata里version,以致useHighResolutionPanos为false,所以我直接变为true啦----------------------------------
  27141. l.modelDataPromisesTiles(e.data) ? this.useHighResolutionPanos = !0 : this.useHighResolutionPanos = !1,
  27142. //this.useHighResolutionPanos = !0;
  27143. //----------------------e n d -----------------------------------------------------------------
  27144. this.updateMaximums()
  27145. }
  27146. ,
  27147. n.prototype.updateUltraHighResolutionSettings = function(e) {
  27148. o.tiling.allowUltraHighResolution && this.modelHasUltraHighPanos ? this.useUltraHighResolutionPanos = !0 : this.useUltraHighResolutionPanos = !1,
  27149. this.updateMaximums()
  27150. }
  27151. ,
  27152. n.prototype.enableUltraHighQualityMode = function() {
  27153. this.modelHasUltraHighPanos = !0,
  27154. this.updateUltraHighResolutionSettings(null)
  27155. }
  27156. ,
  27157. n.prototype.ultraHighQualityModeEnabled = function() {
  27158. return this.modelHasUltraHighPanos
  27159. }
  27160. ,
  27161. n.prototype.onModelChanged = function(e) {
  27162. this.updateFromModel(e.model),
  27163. this.updateMaximums()
  27164. }
  27165. ,
  27166. n.prototype.updateMaximums = function() {
  27167. this.maxNavPanoSize = o.tiling.maxNavPanoQuality || this.detectMaxNavPanoSize(),
  27168. this.maxZoomPanoSize = o.tiling.maxZoomPanoQuality || this.detectMaxZoomPanoSize(),
  27169. this.maxZoomPanoSize < this.maxNavPanoSize && (this.maxNavPanoSize = this.maxZoomPanoSize)
  27170. }
  27171. ,
  27172. n.prototype.buildPanoSizeClassMap = function() {
  27173. this.panoSizeClassMap[r.BASE] = 512,
  27174. this.panoSizeClassMap[r.STANDARD] = 1024,
  27175. this.panoSizeClassMap[r.HIGH] = 2048,
  27176. this.panoSizeClassMap[r.ULTRAHIGH] = 4096
  27177. }
  27178. ,
  27179. n.prototype.getPanoSize = function(e) {
  27180. return this.panoSizeClassMap[e]
  27181. }
  27182. ,
  27183. n.prototype.getMaxPossiblePanoSize = function() {
  27184. return this.getPanoSize(r.ULTRAHIGH)
  27185. }
  27186. ,
  27187. n.prototype.getMaxPanoSize = function() {
  27188. return this.maxZoomPanoSize
  27189. }
  27190. ,
  27191. n.prototype.getMaxNavPanoSize = function() {
  27192. return this.maxNavPanoSize
  27193. }
  27194. ,
  27195. n.prototype.getMaxZoomPanoSize = function() {
  27196. return this.maxZoomPanoSize
  27197. }
  27198. ,
  27199. n.prototype.detectMaxNavPanoSizeClass = function() {
  27200. if(settings.mobileNavHigh)return r.HIGH //改
  27201. else return this.useHighResolutionPanos ? a.isMobile() ? r.STANDARD : $("#player").height() < this.highQualityThreshold ? r.STANDARD : r.HIGH : r.STANDARD
  27202. }
  27203. ,
  27204. n.prototype.detectMaxNavPanoSize = function() {
  27205. var e = this.detectMaxNavPanoSizeClass();
  27206. return this.getPanoSize(e)
  27207. }
  27208. ,
  27209. n.prototype.detectMaxZoomPanoSize = function() {
  27210. 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)
  27211. }
  27212. ,
  27213. t.exports = n
  27214. }
  27215. , {
  27216. "../constants": 8,
  27217. "../enum/ModelManagerEvents": 33,
  27218. "../enum/PanoSizeClass": 36,
  27219. "../settings": 166,
  27220. "../util/browser": 182,
  27221. "../util/showcase": 193
  27222. }],
  27223. 171: [function(e, t, i) {
  27224. (function(i) {
  27225. "use strict";
  27226. function n(e) {
  27227. this.panos = null,
  27228. this.retryMinimumTime = 1e4,
  27229. this.urls = null,
  27230. this.panoLoadCallbacks = {},
  27231. this.downloadDescriptors = {},
  27232. this.priorityQueue = [],
  27233. this.forceQueue = [],
  27234. this.activeDownloads = [],
  27235. this.qualityManager = null,
  27236. this.tilePrioritizer = null,
  27237. this.refreshInterval = null,
  27238. this.processPriorityQueue = !1,
  27239. this.concurrentDownloads = e.concurrentDownloads || 1,
  27240. this.downloadTestResults = {}
  27241. }
  27242. var r = e("three")
  27243. , o = (e("../enum/Viewmode"),
  27244. e("../settings"))
  27245. , a = (e("../objects/Panorama"),
  27246. e("../util/logger"))
  27247. , s = (e("../enum/Vectors"),
  27248. e("../enum/PanoSizeClass"),
  27249. e("../enum/TileDownloaderEvents"))
  27250. , l = e("./TilePrioritizer")
  27251. , c = e("./TileUtils")
  27252. , h = (e("../enum/GLCubeFaces"),
  27253. e("../enum/DownloadStatus"))
  27254. , u = e("../util/panorama")
  27255. , d = e("../util/ajax")
  27256. , p = e("../ab")
  27257. , f = e("events").EventEmitter
  27258. , g = (new a(i),
  27259. Object.freeze({
  27260. Testing: 1,
  27261. Success: 2,
  27262. Fail: 3
  27263. }));
  27264. n.prototype = Object.create(f.prototype),
  27265. n.IDLE_REFRESH_DELAY = 500,
  27266. n.ACTIVE_REFRESH_DELAY = 16,
  27267. n.DOWNLOAD_RETRIES = 4,
  27268. n.prototype.init = function(e) {
  27269. this.qualityManager = e
  27270. }
  27271. ,
  27272. n.prototype.setUrls = function(e) {
  27273. this.urls = e
  27274. }
  27275. ,
  27276. n.prototype.setPanoData = function(e, t, i) {
  27277. this.panos = e,
  27278. this.imagePanos = t,
  27279. this.panoGroupId = i
  27280. }
  27281. ,
  27282. n.prototype.start = function() {
  27283. this.refreshUpdateInterval(0)
  27284. }
  27285. ,
  27286. n.prototype.stop = function() {
  27287. window.cancel(this.refreshInterval)
  27288. }
  27289. ,
  27290. n.prototype.refreshUpdateInterval = function(e) {
  27291. e || (e = 0),
  27292. this.refreshInterval = window.setTimeout(function() {
  27293. var e = this.update();
  27294. e ? this.refreshUpdateInterval(n.ACTIVE_REFRESH_DELAY) : this.refreshUpdateInterval(n.IDLE_REFRESH_DELAY)
  27295. }
  27296. .bind(this), e)
  27297. }
  27298. ,
  27299. n.prototype.update = function() {
  27300. var e = this.forceQueue.length > 0;
  27301. return this.processQueueForDownloading(this.forceQueue),
  27302. this.processPriorityQueue && (this.queuePrioritizedTilesForPanos(this.panos),
  27303. this.priorityQueue.length > 0 && (e = !0),
  27304. this.processQueueForDownloading(this.priorityQueue)),
  27305. e
  27306. }
  27307. ,
  27308. n.prototype.forceQueueTilesForPano = function() {
  27309. var e = []
  27310. , t = [];
  27311. return function(i, n, r, o, a, s) {
  27312. e.length = 0;
  27313. for (var u = this.getTileDownloadDescriptors(i, n), d = 0; d < u.length; d++) {
  27314. var p = u[d];
  27315. p.status !== h.None && p.status !== h.Queued || e.push(p)
  27316. }
  27317. if (r && e.length > 0) {
  27318. l.sortPanoTiles(e, i, r),
  27319. t.length = 0,
  27320. c.matchingTilesInDirection(i, n, r, o, a, t);
  27321. for (var f = 0, g = function(e) {
  27322. return e.face === m.face && e.faceTileIndex === m.faceTileIndex
  27323. }; f < e.length; ) {
  27324. var m = e[f]
  27325. , v = t.findIndex(g);
  27326. v < 0 ? e.splice(f, 1) : f++
  27327. }
  27328. }
  27329. for (var A = 0; A < e.length; A++)
  27330. this.forceQueue.push(e[A]);
  27331. this.setStatusForAllDescriptors(this.forceQueue, h.ForceQueued),
  27332. this.clearFromQueue(this.priorityQueue, h.ForceQueued, !1),
  27333. s && this.processQueueForDownloading(this.forceQueue, !0)
  27334. }
  27335. }(),
  27336. n.prototype.clearForceQueue = function() {
  27337. this.clearQueue(this.forceQueue)
  27338. }
  27339. ,
  27340. n.prototype.queuePrioritizedTilesForPanos = function(e) {
  27341. this.tilePrioritizer && (this.clearQueue(this.priorityQueue),
  27342. this.tilePrioritizer.filterAndPrioritize(this.priorityQueue, e, this),
  27343. this.clearFromQueue(this.priorityQueue, h.None, !0),
  27344. this.setStatusOrRemoveForAllDescriptors(this.priorityQueue, h.Queued))
  27345. }
  27346. ,
  27347. n.prototype.clearQueue = function(e) {
  27348. this.setStatusForAllDescriptors(e, h.None),
  27349. e.length = 0
  27350. }
  27351. ,
  27352. n.prototype.clearFromQueue = function(e, t, i) {
  27353. for (var n = 0; n < e.length; n++) {
  27354. var r = e[n];
  27355. r && (t === r.status && !i || t !== r.status && i) && (e[n] = null)
  27356. }
  27357. }
  27358. ,
  27359. n.prototype.setStatusForAllDescriptors = function(e, t) {
  27360. for (var i = 0; i < e.length; i++) {
  27361. var n = e[i];
  27362. n && (n.status = t)
  27363. }
  27364. }
  27365. ,
  27366. n.prototype.setStatusOrRemoveForAllDescriptors = function(e, t) {
  27367. for (var i = 0; i < e.length; i++) {
  27368. var n = e[i];
  27369. n && (n.status !== t ? n.status = t : e[i] = null)
  27370. }
  27371. }
  27372. ,
  27373. n.prototype.getTileDownloadDescriptors = function(e, t) {
  27374. var i = this.getAllTileDownloadDescriptorsForPano(e)
  27375. , n = i[t];
  27376. return n || (n = this.buildDownloadDescriptorArray(t),
  27377. i[t] = n,
  27378. this.initTileDownloadDescriptors(n, e, t)),
  27379. n
  27380. }
  27381. ,
  27382. n.prototype.getAllTileDownloadDescriptorsForPano = function(e) {
  27383. var t = this.downloadDescriptors[e.id];
  27384. return t || (t = {},
  27385. this.downloadDescriptors[e.id] = t),
  27386. t
  27387. }
  27388. ,
  27389. n.prototype.processQueueForDownloading = function(e, t) {
  27390. if (this.cleanupActiveDownloads(),
  27391. this.activeDownloads.length < this.concurrentDownloads || t)
  27392. for (var i = t ? e.length : this.concurrentDownloads - this.activeDownloads.length, n = 0, r = 0; n < i && e.length > 0; r++) {
  27393. var o = e.shift();
  27394. o && (this.startDownload(o),
  27395. n++)
  27396. }
  27397. }
  27398. ,
  27399. n.prototype.testDownload = function(e, t, i) {
  27400. var n = this.downloadTestResults[e];
  27401. if (n)
  27402. return void (n === g.Success ? i(!0) : n === g.Fail && i(!1));
  27403. this.downloadTestResults[e] = g.Testing;
  27404. var r = this.panos.list[0]
  27405. , o = this.getTileUrl(r.id, e, t, 0)
  27406. , a = function(t) {
  27407. this.downloadTestResults[e] = g.Success,
  27408. i(!0)
  27409. }
  27410. .bind(this)
  27411. , s = function() {
  27412. this.downloadTestResults[e] = g.Fail,
  27413. i(!1)
  27414. }
  27415. .bind(this);
  27416. this.loadImage(o, 0, a, s)
  27417. }
  27418. ,
  27419. n.prototype.startDownload = function(e) {
  27420. e.status = h.Downloading;
  27421. var t = this.getTileUrl(e.pano.id, e.panoSize, e.tileSize, e.tileIndex);
  27422. this.activeDownloads.push(e),
  27423. this.loadImage(t, n.DOWNLOAD_RETRIES, this.downloadComplete.bind(this, e), this.downloadFailed.bind(this, e))
  27424. }
  27425. ,
  27426. n.prototype.downloadFailed = function(e, t) {}
  27427. ,
  27428. n.prototype.downloadComplete = function(e, t) {
  27429. if (e.panoGroupId === this.panoGroupId) {
  27430. var i = this.getPanoLoadCallbacks(e.pano, e.panoSize);
  27431. e.status = h.Downloaded,
  27432. i && i.onProgress && i.onProgress(e.pano, e.panoSize);
  27433. var n = {
  27434. panoId: e.pano.id,
  27435. image: t,
  27436. tileSize: e.tileSize,
  27437. panoSize: e.panoSize,
  27438. tileIndex: e.tileIndex,
  27439. faceTileIndex: e.faceTileIndex,
  27440. totalTiles: e.totalTiles,
  27441. face: e.face,
  27442. tileX: e.tileX,
  27443. tileY: e.tileY,
  27444. direction: e.direction
  27445. };
  27446. e.image = t,
  27447. this.emit(s.TileDownloadSuccess, n),
  27448. this.isPanoDownloaded(e.pano, e.panoSize) && (n = {
  27449. panoId: e.pano.id,
  27450. tileSize: e.tileSize,
  27451. panoSize: e.panoSize
  27452. },
  27453. this.emit(s.PanoDownloadComplete, n),
  27454. i && i.onLoad && i.onLoad(e.pano, e.panoSize))
  27455. }
  27456. }
  27457. ,
  27458. n.prototype.cleanupActiveDownloads = function() {
  27459. var e = [];
  27460. return function() {
  27461. e.length = 0;
  27462. for (var t = 0; t < this.activeDownloads.length; t++) {
  27463. var i = this.activeDownloads[t];
  27464. i.status !== h.Downloaded && i.status !== h.Failed && e.push(i)
  27465. }
  27466. this.activeDownloads.length = 0,
  27467. this.activeDownloads.push.apply(this.activeDownloads, e)
  27468. }
  27469. }(),
  27470. n.prototype.isPanoDownloaded = function(e, t) {
  27471. var i = this.getTileDownloadDescriptors(e, t);
  27472. if (i.length <= 0)
  27473. return !1;
  27474. for (var n = 0; n < i.length; n++) {
  27475. var r = i[n];
  27476. if (r.status !== h.Downloaded)
  27477. return !1
  27478. }
  27479. return !0
  27480. }
  27481. ,
  27482. n.prototype.setPanoLoadCallbacks = function(e, t, i, n, r) {
  27483. var o = e.id + ":" + this.qualityManager.getPanoSize(t);
  27484. this.panoLoadCallbacks[o] = {
  27485. onLoad: i,
  27486. onFail: n,
  27487. onProgress: r
  27488. }
  27489. }
  27490. ,
  27491. n.prototype.getPanoLoadCallbacks = function(e, t) {
  27492. var i = e.id + ":" + t;
  27493. return this.panoLoadCallbacks[i]
  27494. }
  27495. ,
  27496. n.prototype.buildDownloadDescriptorArray = function(e) {
  27497. for (var t = c.getTileCountForSize(e), i = [], n = 0; n < t; n++) {
  27498. var r = this.buildDownloadDescriptor();
  27499. i.push(r)
  27500. }
  27501. return i
  27502. }
  27503. ,
  27504. n.prototype.buildDownloadDescriptor = function() {
  27505. var e = {
  27506. panoGroupId: null,
  27507. pano: null,
  27508. panoSize: -1,
  27509. tileSize: -1,
  27510. tileIndex: -1,
  27511. totalTiles: -1,
  27512. faceTileIndex: -1,
  27513. status: h.None,
  27514. url: null,
  27515. image: null,
  27516. direction: new r.Vector3,
  27517. face: -1,
  27518. cubeFace: -1,
  27519. tileX: -1,
  27520. tileY: -1
  27521. };
  27522. return e
  27523. }
  27524. ,
  27525. n.prototype.initTileDownloadDescriptors = function(e, t, i) {
  27526. for (var n = 0; n < e.length; n++) {
  27527. var r = e[n];
  27528. this.initTileDownloadDescriptor(r, t, i, n)
  27529. }
  27530. }
  27531. ,
  27532. n.prototype.initTileDownloadDescriptor = function(e, t, i, n) {
  27533. var r = i >= c.TILE_SIZE ? c.TILE_SIZE : i;
  27534. e.face = c.getFaceForTile(i, n),
  27535. e.cubeFace = u.mapFaceToCubemapFace(e.face),
  27536. e.panoGroupId = this.panoGroupId,
  27537. e.pano = t,
  27538. e.panoSize = i,
  27539. e.tileSize = r,
  27540. e.tileIndex = n,
  27541. e.totalTiles = c.getTileCountForSize(i),
  27542. e.status = h.None,
  27543. e.image = null,
  27544. c.getTileLocation(e.panoSize, e.tileIndex, e),
  27545. c.getTileVector(e.panoSize, e.tileSize, e.cubeFace, e.tileX, e.tileY, c.LocationOnTile.Center, 0, e.direction)
  27546. }
  27547. ,
  27548. n.prototype.getTileUrl = function() {
  27549. var e = {
  27550. 256: "256",
  27551. 512: "512",
  27552. 1024: "1k",
  27553. 2048: "2k",
  27554. 4096: "4k"
  27555. }
  27556. , t = {
  27557. face: -1,
  27558. faceTileIndex: -1,
  27559. tileX: -1,
  27560. tileY: -1
  27561. };
  27562. return function(i, n, r, a) {
  27563. c.getTileLocation(n, a, t);
  27564. var s = Math.floor(n / r)
  27565. , l = s * s
  27566. , h = Math.floor(a / l)
  27567. , u = "";
  27568. 1 === o.tiling.customCompression && (u = "_" + o.tiling["q" + e[n]]);
  27569. var d = this.urls.get("tiles/" + i + "/" + e[n] + u + "_face" + h + "_" + t.tileX + "_" + t.tileY + ".jpg");
  27570. return d = p.changeIfTileGenerating(d)
  27571. }
  27572. }(),
  27573. n.prototype.loadImage = function(e, t, i, n) {
  27574. d.getImage(e, t).then(function(e) {
  27575. i(e)
  27576. }).fail(n)
  27577. }
  27578. ,
  27579. t.exports = n
  27580. }
  27581. ).call(this, "/js/tile/TileDownloader.js")
  27582. }
  27583. , {
  27584. "../ab": 3,
  27585. "../enum/DownloadStatus": 24,
  27586. "../enum/GLCubeFaces": 25,
  27587. "../enum/PanoSizeClass": 36,
  27588. "../enum/TileDownloaderEvents": 45,
  27589. "../enum/Vectors": 50,
  27590. "../enum/Viewmode": 51,
  27591. "../objects/Panorama": 148,
  27592. "../settings": 166,
  27593. "../util/ajax": 181,
  27594. "../util/logger": 189,
  27595. "../util/panorama": 191,
  27596. "./TilePrioritizer": 172,
  27597. "./TileUtils": 174,
  27598. events: 202,
  27599. three: 217
  27600. }],
  27601. 172: [function(e, t, i) {
  27602. (function(i) {
  27603. "use strict";
  27604. function n(e, t, i, o, a) {
  27605. this.qualityManager = e,
  27606. this.maxNavQuality = this.qualityManager.getMaxNavPanoSize(),
  27607. this.maxZoomQuality = this.qualityManager.getMaxZoomPanoSize(),
  27608. this.baseSize = t,
  27609. this.standardSize = i,
  27610. this.highSize = o,
  27611. this.ultraHighSize = a,
  27612. this.priorityCriteria = new n.PriorityCriteria(null,new r.Vector3(0,0,0),new r.Vector3(0,0,-1),new r.Vector3(0,0,-1))
  27613. }
  27614. var r = e("three")
  27615. , o = (e("../enum/Viewmode"),
  27616. e("../settings"),
  27617. e("../settings"),
  27618. e("../objects/Panorama"))
  27619. , a = e("../util/logger")
  27620. , s = (e("../enum/Vectors"),
  27621. e("../enum/PanoSizeClass"),
  27622. e("../enum/ModelManagerEvents"),
  27623. e("../enum/GLCubeFaces"),
  27624. e("../enum/DownloadStatus"))
  27625. , l = (e("../util/browser"),
  27626. e("./TileUtils"))
  27627. , c = e("../util/math")
  27628. , h = (e("events").EventEmitter,
  27629. new a(i),
  27630. Object.freeze({
  27631. None: 0,
  27632. DirectionalFOV: 1
  27633. }));
  27634. n.PriorityCriteria = function(e, t, i, n, o) {
  27635. this.pano = e,
  27636. this.cameraPosition = (new r.Vector3).copy(t),
  27637. this.cameraDir = (new r.Vector3).copy(i),
  27638. this.panoSpaceDir = (new r.Vector3).copy(n),
  27639. this.upcomingPanos = o,
  27640. this.copy = function(e) {
  27641. this.pano = e.pano,
  27642. this.cameraPosition.copy(e.cameraPosition),
  27643. this.cameraDir.copy(e.cameraDir),
  27644. this.panoSpaceDir.copy(e.panoSpaceDir),
  27645. this.upcomingPanos = o
  27646. }
  27647. ,
  27648. this.zoomingActive = !1
  27649. }
  27650. ,
  27651. n.DIRECTIONAL_FOV = 180,
  27652. n.DIRECTIONAL_FOV_NARROW = 120,
  27653. n.MAX_SCORED_PANOS_TOCONSIDER = 6,
  27654. n.MAX_SCORED_PANOS_TOADD = 2,
  27655. n.MAX_UPCOMING_PANOS_TOADD = 3,
  27656. n.DIRECTION_SCORE_STRICTNESS = .75,
  27657. n.appendQueue = function(e, t) {
  27658. if (e && t)
  27659. for (var i = 0; i < t.length; i++)
  27660. e.push(t[i])
  27661. }
  27662. ,
  27663. n.prototype.updateCriteria = function(e, t, i, n) {
  27664. this.priorityCriteria.pano = e,
  27665. this.priorityCriteria.cameraPosition.copy(t),
  27666. this.priorityCriteria.cameraDir.copy(i),
  27667. this.priorityCriteria.upcomingPanos = n,
  27668. this.maxNavQuality = this.qualityManager.getMaxNavPanoSize(),
  27669. this.maxZoomQuality = this.qualityManager.getMaxZoomPanoSize()
  27670. }
  27671. ,
  27672. n.prototype.filterAndPrioritize = function() {
  27673. var e = []
  27674. , t = []
  27675. , i = [];
  27676. return function(r, o, a) {
  27677. this.populateNeighborPanos(this.priorityCriteria.pano, o, e),
  27678. this.populateScoredPanos(this.priorityCriteria.pano, o, t, this.priorityCriteria.cameraDir, n.MAX_SCORED_PANOS_TOCONSIDER);
  27679. var s = this.baseSize
  27680. , l = this.standardSize
  27681. , c = this.highSize
  27682. , h = this.ultraHighSize;
  27683. this.queueTilesForPano(r, a, this.priorityCriteria.pano, s),
  27684. this.priorityCriteria.upcomingPanos && this.queueTilesForPanos(r, this.priorityCriteria.upcomingPanos, a, s, n.MAX_UPCOMING_PANOS_TOADD),
  27685. this.priorityCriteria.upcomingPanos && this.queueTilesForPanos(r, this.priorityCriteria.upcomingPanos, a, 1024 , n.MAX_UPCOMING_PANOS_TOADD),//更清晰些
  27686. i.length = 0,
  27687. this.canDownloadSize(l) && this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, l, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV_NARROW),
  27688. n.sortPanoTiles(i, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  27689. n.appendQueue(r, i),
  27690. this.queueTilesForPanos(r, t, a, s, n.MAX_SCORED_PANOS_TOADD),
  27691. i.length = 0,
  27692. this.canDownloadSize(c) && this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, c, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV_NARROW),
  27693. this.canDownloadSize(h) && this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, h, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV_NARROW),
  27694. n.sortPanoTiles(i, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  27695. n.appendQueue(r, i),
  27696. i.length = 0,
  27697. this.canDownloadSize(l) && this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, l, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV),
  27698. this.canDownloadSize(c) && this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, c, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV),
  27699. this.canDownloadSize(h) && this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, h, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV),
  27700. n.sortPanoTiles(i, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  27701. n.appendQueue(r, i),
  27702. this.queueTilesForPanos(r, e, a, s)
  27703. }
  27704. }(),
  27705. n.prototype.canDownloadSize = function(e) {
  27706. return this.maxNavQuality >= e || this.maxZoomQuality >= e && this.zoomingActive
  27707. }
  27708. ,
  27709. n.prototype.populateNeighborPanos = function(e, t, i) {
  27710. i = i || [],
  27711. i.length = 0;
  27712. var n = t.getNeighbours(e);
  27713. for (var r in n)
  27714. if (n.hasOwnProperty(r)) {
  27715. var o = t.get(r);
  27716. i.push(o)
  27717. }
  27718. return i
  27719. }
  27720. ,
  27721. n.prototype.populateScoredPanos = function(e, t, i, r, a) {
  27722. i = i || [],
  27723. i.length = 0;
  27724. var s = [o.filters.inPanoDirection(e.position, r, n.DIRECTION_SCORE_STRICTNESS), o.filters.not(e)]
  27725. , l = [o.scoreFunctions.distanceSquared(e), o.scoreFunctions.direction(e.position, r)]
  27726. , c = t.sortByScore(s, l);
  27727. if (c)
  27728. for (var h = 0; h < c.length && h < a; h++) {
  27729. var u = c[h].pano;
  27730. i.push(u)
  27731. }
  27732. return i
  27733. }
  27734. ,
  27735. n.prototype.queueTilesForPanos = function(e, t, i, n, r) {
  27736. for (var o = 0, a = 0; a < t.length; a++) {
  27737. var s = t[a]
  27738. , l = this.queueTilesForPano(e, i, s, n);
  27739. if (o += l > 0 ? 1 : 0,
  27740. r && o >= r)
  27741. break
  27742. }
  27743. return o
  27744. }
  27745. ,
  27746. n.prototype.queueTilesForPano = function() {
  27747. var e = {
  27748. filter: h.None
  27749. };
  27750. return function(t, i, n, r) {
  27751. return this.filterAndQueueTileDownloadDescriptors(t, i, n, r, e)
  27752. }
  27753. }(),
  27754. n.prototype.queueTilesForPanosInDirection = function() {
  27755. var e = new r.Vector3;
  27756. return function(t, i, n, r, o, a, s, l) {
  27757. for (var h = 0, u = 0; u < n.length; u++) {
  27758. var d = n[u];
  27759. e.copy(d.position),
  27760. e.sub(o),
  27761. e.normalize();
  27762. var p = Math.max(Math.min(a.dot(e), 1), -1)
  27763. , f = c.getFOVDotThreshold(s);
  27764. if (p >= f) {
  27765. var g = this.queueTilesInDirectionForPano(t, i, d, r, o, a, s);
  27766. if (h += g > 0 ? 1 : 0,
  27767. l && h >= l)
  27768. break
  27769. }
  27770. }
  27771. return h
  27772. }
  27773. }(),
  27774. n.prototype.queueTilesInDirectionForPanos = function(e, t, i, n, r, o, a, s) {
  27775. for (var l = 0, c = 0; c < i.length; c++) {
  27776. var h = i[c]
  27777. , u = this.queueTilesInDirectionForPano(e, t, h, n, o, a);
  27778. if (l += u > 0 ? 1 : 0,
  27779. s && l >= s)
  27780. break
  27781. }
  27782. return l
  27783. }
  27784. ,
  27785. n.prototype.queueTilesInDirectionForPano = function() {
  27786. var e = {
  27787. filter: h.DirectionalFOV,
  27788. direction: new r.Vector3,
  27789. fov: 60
  27790. }
  27791. , t = new r.Vector3;
  27792. return function(i, n, r, o, a, s, c) {
  27793. return t.copy(s),
  27794. l.getRelativeDirection(r.quaternion, t),
  27795. e.direction.copy(t),
  27796. e.fov = c,
  27797. this.filterAndQueueTileDownloadDescriptors(i, n, r, o, e)
  27798. }
  27799. }(),
  27800. n.prototype.filterAndQueueTileDownloadDescriptors = function() {
  27801. var e = [];
  27802. return function(t, i, n, r, o) {
  27803. var a = i.getTileDownloadDescriptors(n, r);
  27804. e.length = 0,
  27805. this.filterTileDownloadDescriptors(n, a, e, o);
  27806. for (var s = 0, l = 0; l < e.length; l++) {
  27807. var c = e[l];
  27808. c && (t.push(c),
  27809. s++)
  27810. }
  27811. return s
  27812. }
  27813. }(),
  27814. n.prototype.filterTileDownloadDescriptors = function() {
  27815. new r.Vector3;
  27816. return function(e, t, i, n) {
  27817. var r, o;
  27818. switch (n.filter) {
  27819. case h.DirectionalFOV:
  27820. for (r = 0; r < t.length; r++)
  27821. o = t[r],
  27822. l.isTileWithinFOV(o.panoSize, o.tileSize, o.face, o.tileX, o.tileY, n.direction, n.fov) && i.push(o);
  27823. break;
  27824. default:
  27825. for (r = 0; r < t.length; r++)
  27826. o = t[r],
  27827. i.push(o)
  27828. }
  27829. for (r = 0; r < i.length; r++)
  27830. o = i[r],
  27831. this.canIncludeDescriptor(o) || (i[r] = null)
  27832. }
  27833. }(),
  27834. n.prototype.canIncludeDescriptor = function(e) {
  27835. return e.status !== s.Downloading && e.status !== s.Downloaded
  27836. }
  27837. ,
  27838. n.prototype.canIncludePano = function(e, t) {
  27839. return !e.isLoaded(t)
  27840. }
  27841. ,
  27842. n.getFOVDotThreshold = function(e) {
  27843. return Math.cos(r.Math.degToRad(e / 2))
  27844. }
  27845. ;
  27846. var u = function() {
  27847. var e = function e(t, i) {
  27848. var n = e._panoSpaceDir
  27849. , r = e._fovThreshold
  27850. , o = e._fovThresholdNarrow
  27851. , a = Math.max(Math.min(n.dot(t.direction), 1), -1)
  27852. , s = Math.max(Math.min(n.dot(i.direction), 1), -1);
  27853. return t._dot = a,
  27854. i._dot = s,
  27855. 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)
  27856. };
  27857. return e._panoSpaceDir = new r.Vector3,
  27858. e._fovThreshold = -1,
  27859. e._fovThresholdNarrow = -1,
  27860. e
  27861. }();
  27862. n.sortPanoTiles = function(e, t, i) {
  27863. u._panoSpaceDir.copy(i),
  27864. l.getRelativeDirection(t.quaternion, u._panoSpaceDir),
  27865. u._fovThresholdNarrow = c.getFOVDotThreshold(n.DIRECTIONAL_FOV_NARROW),
  27866. u._fovThreshold = c.getFOVDotThreshold(n.DIRECTIONAL_FOV),
  27867. e.sort(u)
  27868. }
  27869. ,
  27870. n.insertSortedPanoTile = function(e, t, i, r) {
  27871. u._panoSpaceDir.copy(r),
  27872. l.getRelativeDirection(i.quaternion, u._panoSpaceDir),
  27873. u._fovThresholdNarrow = c.getFOVDotThreshold(n.DIRECTIONAL_FOV_NARROW),
  27874. u._fovThreshold = c.getFOVDotThreshold(n.DIRECTIONAL_FOV);
  27875. for (var o = -1, a = 0; a < e.length; a++) {
  27876. var s = u(t, e[a]);
  27877. if (s <= 0) {
  27878. o = a;
  27879. break
  27880. }
  27881. }
  27882. if (o === -1)
  27883. e[e.length] = t;
  27884. else {
  27885. for (var h = e.length; h > o; h--)
  27886. e[h] = e[h - 1];
  27887. e[o] = t
  27888. }
  27889. }
  27890. ,
  27891. n.prototype.setZoomingActive = function(e) {
  27892. e !== this.zoomingActive && (this.zoomingActive = e)
  27893. }
  27894. ,
  27895. t.exports = n
  27896. }
  27897. ).call(this, "/js/tile/TilePrioritizer.js")
  27898. }
  27899. , {
  27900. "../enum/DownloadStatus": 24,
  27901. "../enum/GLCubeFaces": 25,
  27902. "../enum/ModelManagerEvents": 33,
  27903. "../enum/PanoSizeClass": 36,
  27904. "../enum/Vectors": 50,
  27905. "../enum/Viewmode": 51,
  27906. "../objects/Panorama": 148,
  27907. "../settings": 166,
  27908. "../util/browser": 182,
  27909. "../util/logger": 189,
  27910. "../util/math": 190,
  27911. "./TileUtils": 174,
  27912. events: 202,
  27913. three: 217
  27914. }],
  27915. 173: [function(e, t, i) {
  27916. "use strict";
  27917. function n(e, t) {
  27918. this.levels = t,
  27919. this.tileSize = e,
  27920. this.root = null,
  27921. this.allNodes = [],
  27922. a(this)
  27923. }
  27924. function r(e, t) {
  27925. this.tree = e,
  27926. this.parent = t,
  27927. this.children = [],
  27928. this.id = ++u
  27929. }
  27930. function o(e, t, i, r, a, s, l, h) {
  27931. if (e) {
  27932. l = l || n.TraversalType.PreOrder;
  27933. var u = r * c + i;
  27934. if (l === n.TraversalType.PreOrder && (a && a(e, t, u, i, r),
  27935. s && s.push(e)),
  27936. e.children && 0 !== e.children.length) {
  27937. for (var d = r * c, p = i * c, f = 0; f < c; f++)
  27938. for (var g = 0; g < c; g++)
  27939. o(e.children[g * c + f], t + 1, p + f, d + g, a, s, l, h);
  27940. l === n.TraversalType.PostOrder && (a && a(e, t, u, i, r),
  27941. s && s.push(e))
  27942. }
  27943. }
  27944. }
  27945. function a(e) {
  27946. e.root = s(e, null, 0)
  27947. }
  27948. function s(e, t, i) {
  27949. if (i > e.levels)
  27950. return null;
  27951. var n = new r(e,t);
  27952. e.allNodes.push(n);
  27953. for (var o = 0; o < h; o++)
  27954. n.children[o] = s(e, n, i + 1);
  27955. return n
  27956. }
  27957. function l(e, t, i, n, r) {
  27958. if (!e)
  27959. return null;
  27960. if (0 === i)
  27961. return e;
  27962. if (!e.children || 0 === e.children.length)
  27963. return null;
  27964. var o = Math.pow(c, i)
  27965. , a = o / c
  27966. , s = n % a
  27967. , h = r % a
  27968. , u = Math.floor(r / a)
  27969. , d = Math.floor(n / a)
  27970. , p = u * c + d
  27971. , f = e.children[p];
  27972. return l(f, t + 1, i - 1, s, h)
  27973. }
  27974. var c = (e("three"),
  27975. e("./TileUtils"),
  27976. e("../objects/Panorama"),
  27977. e("../util/panorama"),
  27978. e("events").EventEmitter,
  27979. 2)
  27980. , h = c * c;
  27981. n.TraversalType = Object.freeze({
  27982. PreOrder: 0,
  27983. PostOrder: 1
  27984. });
  27985. var u = 0;
  27986. n.getLevelCountForSize = function(e, t) {
  27987. var i = 0;
  27988. for (t < e && (t = e); ; ) {
  27989. if (t /= c,
  27990. t < e)
  27991. break;
  27992. i++
  27993. }
  27994. return i
  27995. }
  27996. ,
  27997. n.getSizeForLevel = function(e, t) {
  27998. return Math.pow(c, t) * e
  27999. }
  28000. ,
  28001. n.prototype.getSubNode = function(e, t, i) {
  28002. (!t || e < this.tileSize) && (t = 0),
  28003. (!i || e < this.tileSize) && (i = 0),
  28004. e < this.tileSize && (e = this.tileSize);
  28005. var r = n.getLevelCountForSize(this.tileSize, e)
  28006. , o = l(this.root, 0, r, t, i);
  28007. return o
  28008. }
  28009. ,
  28010. n.prototype.breadthFirst = function(e) {
  28011. e = e || {};
  28012. var t = !!e.nullLevelEnd
  28013. , i = e.maxLevel
  28014. , n = e.minLevel
  28015. , r = e.callback
  28016. , o = e.saveVisited
  28017. , a = []
  28018. , s = {}
  28019. , l = 0
  28020. , c = 0;
  28021. for (a.push(this.root),
  28022. a.push(s); a.length > 0 && !(i && l > i); ) {
  28023. var h = a.shift();
  28024. if (h === s)
  28025. (!n || l >= n) && (r && t && r(null),
  28026. o && t && o.push(null)),
  28027. a.length > 0 && a.push(s),
  28028. l++,
  28029. c = 0;
  28030. else {
  28031. if (h.children)
  28032. for (var u = 0; u < h.children.length; u++) {
  28033. var d = h.children[u];
  28034. d && a.push(h.children[u])
  28035. }
  28036. var p = this.getFaceIndexFromNode(h);
  28037. (!n || l >= n) && (r && r(h, l, p),
  28038. o && o.push(h)),
  28039. c++
  28040. }
  28041. }
  28042. }
  28043. ,
  28044. n.prototype.getFaceIndexFromNode = function(e) {
  28045. if (!e)
  28046. return -1;
  28047. for (var t = 1, i = e, n = 0, r = 0; ; ) {
  28048. var o = i.parent;
  28049. if (!o)
  28050. break;
  28051. for (var a = -1, s = 0; s < o.children.length; s++)
  28052. o.children[s] === i && (a = s);
  28053. var l = a % c
  28054. , h = Math.floor(a / c);
  28055. n = l * t + n,
  28056. r = h * t + r,
  28057. t *= c,
  28058. i = o
  28059. }
  28060. return r * t + n
  28061. }
  28062. ,
  28063. n.prototype.depthFirst = function(e, t, i) {
  28064. o(this.root, 0, 0, 0, e, t, i, this.tileSize)
  28065. }
  28066. ,
  28067. t.exports = n
  28068. }
  28069. , {
  28070. "../objects/Panorama": 148,
  28071. "../util/panorama": 191,
  28072. "./TileUtils": 174,
  28073. events: 202,
  28074. three: 217
  28075. }],
  28076. 174: [function(e, t, i) {
  28077. "use strict";
  28078. var n = e("../enum/GLCubeFaces")
  28079. , r = e("../util/MathLight")
  28080. , o = {};
  28081. o.TILE_SIZE = 512,
  28082. o.FACES_PER_PANO = 6,
  28083. o.LocationOnTile = {
  28084. Center: 0,
  28085. UpperLeft: 1,
  28086. UpperRight: 2,
  28087. LowerRight: 3,
  28088. LowerLeft: 4
  28089. },
  28090. o.getTileVector = function() {
  28091. return function(e, t, i, a, s, l, c, h) {
  28092. l = l || o.LocationOnTile.Center;
  28093. var u = e / t
  28094. , d = a / u;
  28095. s = -s + (u - 1);
  28096. var p = s / u
  28097. , f = t / e
  28098. , g = 2 * f
  28099. , m = g / 2
  28100. , v = 2 * d - 1 + m
  28101. , A = 2 * p - 1 + m;
  28102. switch (l) {
  28103. case o.LocationOnTile.UpperLeft:
  28104. v -= m,
  28105. A += m,
  28106. v += c * g;
  28107. break;
  28108. case o.LocationOnTile.UpperRight:
  28109. v += m,
  28110. A += m,
  28111. A -= c * g;
  28112. break;
  28113. case o.LocationOnTile.LowerRight:
  28114. v += m,
  28115. A -= m,
  28116. v -= c * g;
  28117. break;
  28118. case o.LocationOnTile.LowerLeft:
  28119. v -= m,
  28120. A -= m,
  28121. A += c * g;
  28122. break;
  28123. case o.LocationOnTile.Center:
  28124. }
  28125. switch (i) {
  28126. case n.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  28127. r.setVector(h, -1, A, -v);
  28128. break;
  28129. case n.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  28130. r.setVector(h, 1, A, v);
  28131. break;
  28132. case n.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  28133. r.setVector(h, -v, 1, -A);
  28134. break;
  28135. case n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  28136. r.setVector(h, -v, -1, A);
  28137. break;
  28138. case n.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  28139. r.setVector(h, -v, A, 1);
  28140. break;
  28141. case n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  28142. r.setVector(h, v, A, -1)
  28143. }
  28144. r.normalize(h)
  28145. }
  28146. }(),
  28147. o.getFaceForTile = function(e, t) {
  28148. var i = o.TILE_SIZE;
  28149. e < o.TILE_SIZE && (i = e);
  28150. var n = Math.floor(e / i)
  28151. , r = n * n;
  28152. return Math.floor(t / r)
  28153. }
  28154. ,
  28155. o.getTileLocation = function(e, t, i) {
  28156. var n = o.TILE_SIZE;
  28157. e < o.TILE_SIZE && (n = e);
  28158. var r = o.getFaceForTile(e, t)
  28159. , a = Math.floor(e / n)
  28160. , s = a * a
  28161. , l = t - r * s;
  28162. i.tileX = l % a,
  28163. i.tileY = Math.floor(l / a),
  28164. i.face = r,
  28165. i.faceTileIndex = l
  28166. }
  28167. ,
  28168. o.getTileCountForSize = function(e) {
  28169. if (e <= o.TILE_SIZE)
  28170. return o.FACES_PER_PANO;
  28171. var t = Math.floor(e / o.TILE_SIZE)
  28172. , i = t * t
  28173. , n = i * o.FACES_PER_PANO;
  28174. return n
  28175. }
  28176. ,
  28177. o.getRelativeDirection = function() {
  28178. var e = new r.Matrix4
  28179. , t = new r.Quaternion;
  28180. return function(i, n) {
  28181. t.copy(i),
  28182. t.inverse(),
  28183. e.makeRotationFromQuaternion(t),
  28184. e.applyToVector3(n),
  28185. r.normalize(n)
  28186. }
  28187. }(),
  28188. o.matchingTilesInDirection = function() {
  28189. var e = new r.Vector3
  28190. , t = new r.Vector3(0,0,-1)
  28191. , i = new r.Quaternion
  28192. , n = function(e, t) {
  28193. e.push({
  28194. face: t.face,
  28195. faceTileIndex: t.faceTileIndex,
  28196. tileX: t.tileX,
  28197. tileY: t.tileY
  28198. })
  28199. }
  28200. , a = function() {
  28201. var e = {
  28202. face: -1,
  28203. faceTileIndex: -1,
  28204. tileX: -1,
  28205. tileY: -1
  28206. };
  28207. return function(t, i, r) {
  28208. for (var a = o.getTileCountForSize(t), s = 0, l = 0; l < a; l++)
  28209. o.getTileLocation(t, l, e),
  28210. i && !i(e) || (s++,
  28211. r && n(r, e));
  28212. return s
  28213. }
  28214. }();
  28215. return function(n, s, l, c, h, u) {
  28216. var d = s < o.TILE_SIZE ? s : o.TILE_SIZE;
  28217. o.getTileCountForSize(s);
  28218. if (!c && !h)
  28219. return a(s, null, u);
  28220. var p = !!h;
  28221. if (h = h || c,
  28222. h = Math.max(0, Math.min(h, 360)),
  28223. c = Math.max(0, Math.min(c, 360)),
  28224. r.copyVector(l, e),
  28225. o.getRelativeDirection(n.quaternion, e),
  28226. p) {
  28227. i.setFromUnitVectors(e, t);
  28228. var f = function(e) {
  28229. return o.isTileWithinFrustum(s, d, e.face, e.tileX, e.tileY, i, c, h)
  28230. };
  28231. return a(s, f, u)
  28232. }
  28233. var g = function(t) {
  28234. return o.isTileWithinFOV(s, d, t.face, t.tileX, t.tileY, e, c)
  28235. };
  28236. return a(s, g, u)
  28237. }
  28238. }(),
  28239. o.isTileWithinFrustum = function() {
  28240. var e = new r.Vector3
  28241. , t = 1e-5;
  28242. return function(i, n, a, s, l, c, h, u) {
  28243. 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++)
  28244. if (o.getTileVector(i, n, m, s, l, b, 0, e),
  28245. r.applyQuaternionToVector(c, e),
  28246. e.z >= -t)
  28247. I++;
  28248. else {
  28249. var w = -1 / e.z
  28250. , _ = e.x * w
  28251. , T = e.y * w;
  28252. T > d ? v++ : T < p && A++,
  28253. _ > f ? y++ : _ < g && C++,
  28254. E++
  28255. }
  28256. return A !== E && v !== E && y !== E && C !== E
  28257. }
  28258. }(),
  28259. o.isTileWithinFOV = function() {
  28260. var e = new r.Vector3
  28261. , t = new r.Vector3(0,1,0)
  28262. , i = new r.Vector3(1,0,0);
  28263. return function(n, a, s, l, c, h, u) {
  28264. var d = o.mapFaceToCubemapFace(s);
  28265. if (r.cross(h, t, i),
  28266. o.getTileVector(n, a, d, l, c, o.LocationOnTile.Center, 0, e),
  28267. o.isWithinFOV(e, h, u, null))
  28268. return !0;
  28269. for (var p = u / 360, f = Math.floor(1 / p), g = 0, m = 0; m < f; m++) {
  28270. for (var v = o.LocationOnTile.UpperLeft; v <= o.LocationOnTile.LowerLeft; v++)
  28271. if (o.getTileVector(n, a, d, l, c, v, g, e),
  28272. o.isWithinFOV(e, h, u, null))
  28273. return !0;
  28274. g += p
  28275. }
  28276. return !1
  28277. }
  28278. }(),
  28279. o.isWithinFOV = function() {
  28280. var e = new r.Vector3
  28281. , t = new r.Vector3;
  28282. return function(i, n, o, a) {
  28283. if (r.copyVector(i, t),
  28284. a) {
  28285. r.copyVector(a, e),
  28286. r.normalize(e);
  28287. var s = r.dot(e, i);
  28288. e.x *= s,
  28289. e.y *= s,
  28290. e.z *= s,
  28291. r.subVector(t, e)
  28292. }
  28293. var l = o / 2 * r.RADIANS_PER_DEGREE
  28294. , c = Math.cos(l)
  28295. , h = r.dot(t, n);
  28296. return h >= c
  28297. }
  28298. }(),
  28299. o.mapFaceToCubemapFace = function() {
  28300. var e = {
  28301. 0: n.GL_TEXTURE_CUBE_MAP_POSITIVE_Y,
  28302. 1: n.GL_TEXTURE_CUBE_MAP_POSITIVE_Z,
  28303. 2: n.GL_TEXTURE_CUBE_MAP_POSITIVE_X,
  28304. 3: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,
  28305. 4: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
  28306. 5: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
  28307. };
  28308. return function(t) {
  28309. return e[t]
  28310. }
  28311. }(),
  28312. t.exports = o
  28313. }
  28314. , {
  28315. "../enum/GLCubeFaces": 25,
  28316. "../util/MathLight": 176
  28317. }],
  28318. 175: [function(e, t, i) {
  28319. (function(i) {
  28320. "use strict";
  28321. function n() {
  28322. this.list = [],
  28323. this.index = {},
  28324. Object.defineProperty(this, "length", {
  28325. get: function() {
  28326. return this.list.length
  28327. }
  28328. })
  28329. }
  28330. var r = (e("./common"),
  28331. e("./logger"));
  28332. new r(i);
  28333. n.prototype.forEach = function(e) {
  28334. this.list.forEach(e)
  28335. }
  28336. ,
  28337. n.prototype.add = function(e) {
  28338. this.list.push(e),
  28339. this.index[this.getIndex(e)] = e
  28340. }
  28341. ,
  28342. n.prototype.getIndex = function(e) {
  28343. throw new Error("IndexedCollection.getIndex not implemented in subclass.")
  28344. }
  28345. ,
  28346. n.prototype.extend = function(e) {
  28347. for (var t = 0; t < e.length; t++)
  28348. this.add(e[t])
  28349. }
  28350. ,
  28351. n.prototype.get = function(e) {
  28352. return this.index[e]
  28353. }
  28354. ,
  28355. n.prototype.first = function() {
  28356. return this.list[0]
  28357. }
  28358. ,
  28359. n.prototype.last = function() {
  28360. return this.list[this.list.length - 1]
  28361. }
  28362. ,
  28363. n.prototype.reIndex = function() {
  28364. this.index = {};
  28365. var e = this;
  28366. this.forEach(function(t) {
  28367. e.index[e.getIndex(t)] = t
  28368. })
  28369. }
  28370. ,
  28371. n.prototype.filter = function(e) {
  28372. var t = this.list.filter(e);
  28373. return this.reIndex(),
  28374. t
  28375. }
  28376. ,
  28377. n.prototype.reduce = function(e, t) {
  28378. return this.list.reduce(e, t)
  28379. }
  28380. ,
  28381. n.prototype.sort = function(e) {
  28382. return this.list.sort(e)
  28383. }
  28384. ,
  28385. n.prototype.indexOf = function(e) {
  28386. for (var t = 0; t < this.list.length; ++t)
  28387. if (this.list[t] === e)
  28388. return t;
  28389. return -1
  28390. }
  28391. ,
  28392. t.exports = n
  28393. }
  28394. ).call(this, "/js/util/IndexedCollection.js")
  28395. }
  28396. , {
  28397. "./common": 185,
  28398. "./logger": 189
  28399. }],
  28400. 176: [function(e, t, i) {
  28401. "use strict";
  28402. var n = e("../constants")
  28403. , r = {};
  28404. r.RADIANS_PER_DEGREE = Math.PI / 180,
  28405. r.DEGREES_PER_RADIAN = 180 / Math.PI,
  28406. r.Vector3 = function(e, t, i) {
  28407. this.x = e || 0,
  28408. this.y = t || 0,
  28409. this.z = i || 0
  28410. }
  28411. ,
  28412. r.Matrix4 = function() {
  28413. this.elements = new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]),
  28414. arguments.length > 0 && console.error("MathLight.Matrix4: the constructor no longer reads arguments. use .set() instead.")
  28415. }
  28416. ,
  28417. r.Matrix4.prototype = {
  28418. identity: function() {
  28419. return this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
  28420. this
  28421. },
  28422. copy: function(e) {
  28423. return this.elements.set(e.elements),
  28424. this
  28425. },
  28426. applyToVector3: function(e) {
  28427. var t = e.x
  28428. , i = e.y
  28429. , n = e.z
  28430. , r = this.elements;
  28431. return e.x = r[0] * t + r[4] * i + r[8] * n + r[12],
  28432. e.y = r[1] * t + r[5] * i + r[9] * n + r[13],
  28433. e.z = r[2] * t + r[6] * i + r[10] * n + r[14],
  28434. this
  28435. },
  28436. getInverse: function(e, t) {
  28437. var i = this.elements
  28438. , n = e.elements
  28439. , r = n[0]
  28440. , o = n[1]
  28441. , a = n[2]
  28442. , s = n[3]
  28443. , l = n[4]
  28444. , c = n[5]
  28445. , h = n[6]
  28446. , u = n[7]
  28447. , d = n[8]
  28448. , p = n[9]
  28449. , f = n[10]
  28450. , g = n[11]
  28451. , m = n[12]
  28452. , v = n[13]
  28453. , A = n[14]
  28454. , y = n[15]
  28455. , C = p * A * u - v * f * u + v * h * g - c * A * g - p * h * y + c * f * y
  28456. , I = m * f * u - d * A * u - m * h * g + l * A * g + d * h * y - l * f * y
  28457. , E = d * v * u - m * p * u + m * c * g - l * v * g - d * c * y + l * p * y
  28458. , b = m * p * h - d * v * h - m * c * f + l * v * f + d * c * A - l * p * A
  28459. , w = r * C + o * I + a * E + s * b;
  28460. if (0 === w) {
  28461. var _ = "MathLight.Matrix4.getInverse(): can't invert matrix, determinant is 0";
  28462. if (t)
  28463. throw new Error(_);
  28464. return console.warn(_),
  28465. this.identity()
  28466. }
  28467. var T = 1 / w;
  28468. return i[0] = C * T,
  28469. i[1] = (v * f * s - p * A * s - v * a * g + o * A * g + p * a * y - o * f * y) * T,
  28470. i[2] = (c * A * s - v * h * s + v * a * u - o * A * u - c * a * y + o * h * y) * T,
  28471. i[3] = (p * h * s - c * f * s - p * a * u + o * f * u + c * a * g - o * h * g) * T,
  28472. i[4] = I * T,
  28473. i[5] = (d * A * s - m * f * s + m * a * g - r * A * g - d * a * y + r * f * y) * T,
  28474. i[6] = (m * h * s - l * A * s - m * a * u + r * A * u + l * a * y - r * h * y) * T,
  28475. i[7] = (l * f * s - d * h * s + d * a * u - r * f * u - l * a * g + r * h * g) * T,
  28476. i[8] = E * T,
  28477. i[9] = (m * p * s - d * v * s - m * o * g + r * v * g + d * o * y - r * p * y) * T,
  28478. i[10] = (l * v * s - m * c * s + m * o * u - r * v * u - l * o * y + r * c * y) * T,
  28479. i[11] = (d * c * s - l * p * s - d * o * u + r * p * u + l * o * g - r * c * g) * T,
  28480. i[12] = b * T,
  28481. i[13] = (d * v * a - m * p * a + m * o * f - r * v * f - d * o * A + r * p * A) * T,
  28482. i[14] = (m * c * a - l * v * a - m * o * h + r * v * h + l * o * A - r * c * A) * T,
  28483. i[15] = (l * p * a - d * c * a + d * o * h - r * p * h - l * o * f + r * c * f) * T,
  28484. this
  28485. },
  28486. makeRotationFromQuaternion: function(e) {
  28487. var t = this.elements
  28488. , i = e.x
  28489. , n = e.y
  28490. , r = e.z
  28491. , o = e.w
  28492. , a = i + i
  28493. , s = n + n
  28494. , l = r + r
  28495. , c = i * a
  28496. , h = i * s
  28497. , u = i * l
  28498. , d = n * s
  28499. , p = n * l
  28500. , f = r * l
  28501. , g = o * a
  28502. , m = o * s
  28503. , v = o * l;
  28504. return t[0] = 1 - (d + f),
  28505. t[4] = h - v,
  28506. t[8] = u + m,
  28507. t[1] = h + v,
  28508. t[5] = 1 - (c + f),
  28509. t[9] = p - g,
  28510. t[2] = u - m,
  28511. t[6] = p + g,
  28512. t[10] = 1 - (c + d),
  28513. t[3] = 0,
  28514. t[7] = 0,
  28515. t[11] = 0,
  28516. t[12] = 0,
  28517. t[13] = 0,
  28518. t[14] = 0,
  28519. t[15] = 1,
  28520. this
  28521. }
  28522. },
  28523. r.Quaternion = function(e, t, i, n) {
  28524. this._x = e || 0,
  28525. this._y = t || 0,
  28526. this._z = i || 0,
  28527. this._w = void 0 !== n ? n : 1
  28528. }
  28529. ,
  28530. r.Quaternion.prototype = {
  28531. get x() {
  28532. return this._x
  28533. },
  28534. set x(e) {
  28535. this._x = e
  28536. },
  28537. get y() {
  28538. return this._y
  28539. },
  28540. set y(e) {
  28541. this._y = e
  28542. },
  28543. get z() {
  28544. return this._z
  28545. },
  28546. set z(e) {
  28547. this._z = e
  28548. },
  28549. get w() {
  28550. return this._w
  28551. },
  28552. set w(e) {
  28553. this._w = e
  28554. },
  28555. copy: function(e) {
  28556. this._x = e.x,
  28557. this._y = e.y,
  28558. this._z = e.z,
  28559. this._w = e.w
  28560. },
  28561. inverse: function() {
  28562. return this.conjugate().normalize()
  28563. },
  28564. conjugate: function() {
  28565. return this._x *= -1,
  28566. this._y *= -1,
  28567. this._z *= -1,
  28568. this
  28569. },
  28570. length: function() {
  28571. return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w)
  28572. },
  28573. normalize: function() {
  28574. var e = this.length();
  28575. return 0 === e ? (this._x = 0,
  28576. this._y = 0,
  28577. this._z = 0,
  28578. this._w = 1) : (e = 1 / e,
  28579. this._x = this._x * e,
  28580. this._y = this._y * e,
  28581. this._z = this._z * e,
  28582. this._w = this._w * e),
  28583. this
  28584. },
  28585. setFromAxisAngle: function(e, t) {
  28586. var i = t / 2
  28587. , n = Math.sin(i);
  28588. return this._x = e.x * n,
  28589. this._y = e.y * n,
  28590. this._z = e.z * n,
  28591. this._w = Math.cos(i),
  28592. this
  28593. },
  28594. setFromUnitVectors: function() {
  28595. var e, t, i = 1e-6;
  28596. return function(n, o) {
  28597. return void 0 === e && (e = new r.Vector3),
  28598. t = r.dot(n, o) + 1,
  28599. t < i ? (t = 0,
  28600. 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),
  28601. this._x = e.x,
  28602. this._y = e.y,
  28603. this._z = e.z,
  28604. this._w = t,
  28605. this.normalize()
  28606. }
  28607. }(),
  28608. multiply: function(e) {
  28609. return this.multiplyQuaternions(this, e)
  28610. },
  28611. premultiply: function(e) {
  28612. return this.multiplyQuaternions(e, this)
  28613. },
  28614. multiplyQuaternions: function(e, t) {
  28615. var i = e._x
  28616. , n = e._y
  28617. , r = e._z
  28618. , o = e._w
  28619. , a = t._x
  28620. , s = t._y
  28621. , l = t._z
  28622. , c = t._w;
  28623. return this._x = i * c + o * a + n * l - r * s,
  28624. this._y = n * c + o * s + r * a - i * l,
  28625. this._z = r * c + o * l + i * s - n * a,
  28626. this._w = o * c - i * a - n * s - r * l,
  28627. this
  28628. }
  28629. },
  28630. r.convertWorkshopVector = function(e) {
  28631. return new r.Vector3(-e.x,e.y,e.z)
  28632. }
  28633. ,
  28634. r.convertWorkshopQuaternion = function(e) {
  28635. 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))
  28636. }
  28637. ;
  28638. r.convertWorkshopOrthoZoom = function(e) {//xzw
  28639. //return e === -1 ? -1 : e / 16 * ($("#player").width() / $("#player").height()) / n.workshopApsect
  28640. return e === -1 ? -1 : e * ($("#player").width() / $("#player").height()) / g_snapShotWidth * g_snapShotHeight;
  28641. }
  28642. ,
  28643. r.convertWorkshopPanoramaQuaternion = function(e) {
  28644. 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))
  28645. }
  28646. ,
  28647. r.normalize = function(e) {
  28648. var t = e.x * e.x + e.y * e.y + e.z * e.z
  28649. , i = Math.sqrt(t);
  28650. e.x /= i,
  28651. e.y /= i,
  28652. e.z /= i
  28653. }
  28654. ,
  28655. r.dot = function(e, t) {
  28656. return e.x * t.x + e.y * t.y + e.z * t.z
  28657. }
  28658. ,
  28659. r.cross = function(e, t, i) {
  28660. var n = e.x
  28661. , r = e.y
  28662. , o = e.z;
  28663. i.x = r * t.z - o * t.y,
  28664. i.y = o * t.x - n * t.z,
  28665. i.z = n * t.y - r * t.x
  28666. }
  28667. ,
  28668. r.setVector = function(e, t, i, n) {
  28669. e.x = t,
  28670. e.y = i,
  28671. e.z = n
  28672. }
  28673. ,
  28674. r.copyVector = function(e, t) {
  28675. t.x = e.x,
  28676. t.y = e.y,
  28677. t.z = e.z
  28678. }
  28679. ,
  28680. r.addVector = function(e, t) {
  28681. e.x += t.x,
  28682. e.y += t.y,
  28683. e.z += t.z
  28684. }
  28685. ,
  28686. r.subVector = function(e, t) {
  28687. e.x -= t.x,
  28688. e.y -= t.y,
  28689. e.z -= t.z
  28690. }
  28691. ,
  28692. r.applyQuaternionToVector = function(e, t) {
  28693. var i = t.x
  28694. , n = t.y
  28695. , r = t.z
  28696. , o = e.x
  28697. , a = e.y
  28698. , s = e.z
  28699. , l = e.w
  28700. , c = l * i + a * r - s * n
  28701. , h = l * n + s * i - o * r
  28702. , u = l * r + o * n - a * i
  28703. , d = -o * i - a * n - s * r;
  28704. t.x = c * l + d * -o + h * -s - u * -a,
  28705. t.y = h * l + d * -a + u * -o - c * -s,
  28706. t.z = u * l + d * -s + c * -a - h * -o
  28707. }
  28708. ,
  28709. r.angleBetweenVectors = function(e, t) {
  28710. return Math.acos(r.dot(e, t))
  28711. }
  28712. ,
  28713. t.exports = r
  28714. }
  28715. , {
  28716. "../constants": 8
  28717. }],
  28718. 177: [function(e, t, i) {
  28719. (function(i) {
  28720. "use strict";
  28721. function n(e) {
  28722. this.cache = null,
  28723. this.expires = 0
  28724. }
  28725. function r() {
  28726. this.baseUrl = null,
  28727. this.cache = null,
  28728. this.expires = 0
  28729. }
  28730. function o() {
  28731. this.baseUrl = null,
  28732. this.expires = 0
  28733. }
  28734. function a(e) {
  28735. this.initialLoadingPromise = null,
  28736. this.endpoint = e + "?type=3",
  28737. this.urlContainer = null,
  28738. this.authorizationHeader = h.getAuthorizationHeader(),
  28739. this.containerClasses = [o, r, n]
  28740. }
  28741. var s = e("./ajax")
  28742. , l = e("./logger")
  28743. , c = e("../constants")
  28744. , h = e("./showcase")
  28745. , u = (e("../ab"),
  28746. new l(i));
  28747. n.prototype = {
  28748. version: 1,
  28749. validate: function(e) {
  28750. return "catalog.json"in e && Object.keys(e).length > 0
  28751. },
  28752. update: function(e) {
  28753. return this.cache = e,
  28754. this.expires = Date.now() + c.signedUrlDefaultExpireTime,
  28755. $.when()
  28756. },
  28757. get: function(e) {
  28758. return this.cache[e]
  28759. }
  28760. },
  28761. r.prototype = {
  28762. version: 2,
  28763. validate: function(e) {
  28764. return "catalog.json"in e && "base.url"in e && Object.keys(e).length > 1
  28765. },
  28766. update: function(e) {
  28767. return this.baseUrl = e["base.url"],
  28768. this.cache = e,
  28769. this.expires = Date.now() + c.signedUrlDefaultExpireTime,
  28770. $.when()
  28771. },
  28772. get: function(e) {
  28773. var t = this.cache[e];
  28774. return t ? this.baseUrl.replace("{{filename}}", e) + t : null
  28775. }
  28776. },
  28777. o.prototype = {
  28778. version: 3,
  28779. validate: function(e) {
  28780. return e.templates && e.catalog_file && (!e.expires || 1e3 * e.expires > Date.now())
  28781. },
  28782. update: function(e) {
  28783. return this.baseUrl = e.templates[0],
  28784. e.expires ? this.expires = 1e3 * e.expires : this.expires = Date.now() + c.signedUrlDefaultExpireTime,
  28785. $.when()
  28786. },
  28787. get: function(e) {
  28788. return this.baseUrl.replace("{{filename}}", e)
  28789. }
  28790. },
  28791. a.prototype = {
  28792. init: function() {
  28793. return this.initialLoadingPromise ? this.initialLoadingPromise : (setInterval(function() {
  28794. var e = this.urlContainer ? this.urlContainer.expires : Date.now();
  28795. Date.now() + c.signedUrlRefreshBuffer > e && (u.debug("Refreshing urls..."),
  28796. this.refresh().done(function() {
  28797. u.debug("Refreshed")
  28798. }).fail(function() {
  28799. u.error("Failed url refresh, urls might go stale soon")
  28800. }))
  28801. }
  28802. .bind(this), c.signedUrlCheckInterval),
  28803. this.initialLoadingPromise = this.refresh(),
  28804. this.initialLoadingPromise)
  28805. },
  28806. refresh: function(e) { //已经在someData.js里加载过了 不用再加载file了吧
  28807. e = e || {};
  28808. /*var t = void 0 === e.cache || e.cache;
  28809. return s.get( this.endpoint , { //file
  28810. responseType: "json",
  28811. prefetchFrom: t ? "files" : null,
  28812. cache: t,
  28813. auth: this.authorizationHeader
  28814. }).then(function(e) {
  28815. if (this.urlContainer && this.urlContainer.validate(e))
  28816. return this.urlContainer.update(e);
  28817. for (var i = 0; i < this.containerClasses.length; i++) {
  28818. var n = this.containerClasses[i]
  28819. , r = new n;
  28820. if (r.validate(e))
  28821. return u.info("Using urls version " + r.version),
  28822. this.urlContainer = r,
  28823. this.urlContainer.update(e)
  28824. }
  28825. return t ? this.refresh({
  28826. cache: !1
  28827. }) : $.Deferred().reject("missing-urls")
  28828. }
  28829. .bind(this), function(e) {
  28830. return "loading-failed"
  28831. }) */
  28832. return $.Deferred().resolve();
  28833. },
  28834. get: function(e) {
  28835. //return this.urlContainer.get(e)
  28836. return window.DATA.files.templates[0].replace("{{filename}}", e)
  28837. }
  28838. },
  28839. t.exports = a
  28840. }
  28841. ).call(this, "/js/util/ModelUrls.js")
  28842. }
  28843. , {
  28844. "../ab": 3,
  28845. "../constants": 8,
  28846. "./ajax": 181,
  28847. "./logger": 189,
  28848. "./showcase": 193
  28849. }],
  28850. 178: [function(e, t, i) {
  28851. (function(i) {
  28852. "use strict";
  28853. function n() {
  28854. u.call(this),
  28855. this.neighbourMap = {},
  28856. this.map = null
  28857. }
  28858. var r = e("three")
  28859. , o = e("./common")
  28860. , a = e("../settings")
  28861. , s = e("../objects/Panorama")
  28862. , a = e("../settings")
  28863. , l = e("./aStar")
  28864. , c = e("./logger")
  28865. , h = new c(i)
  28866. , u = e("./IndexedCollection")
  28867. , d = e("./transitions");
  28868. o.inherit(n, u),
  28869. n.prototype.getIndex = function(e) {
  28870. return e.id
  28871. }
  28872. ,
  28873. n.prototype.find = function(e, t) {
  28874. var i = o.filterAll(this.list, e);
  28875. return 0 === i.length ? null : (t && t.forEach(function(e) {
  28876. i = o.stableSort(i, e)
  28877. }),
  28878. i[0])
  28879. }
  28880. ,
  28881. n.prototype.sortByScore = function(e, t) {
  28882. var i = o.filterAll(this.list, e);
  28883. return 0 === i.length ? null : i = i.map(function(e) {
  28884. return {
  28885. pano: e,
  28886. score: t.reduce(function(t, i) {
  28887. return t + i(e)
  28888. }, 0)
  28889. }
  28890. }).sort(function(e, t) {
  28891. return t.score - e.score;
  28892. })
  28893. }
  28894. ,
  28895. n.prototype.lowestByScore = function(e, t, i) {
  28896. return this.findRankedByScore(0, e, t, i)
  28897. }
  28898. ,
  28899. n.prototype.findRankedByScore = function(e, t, i, n) {
  28900. n && (n.candidates = null,
  28901. n.pano = null),
  28902. e || (e = 0);
  28903. var r = this.sortByScore(t, i);
  28904. return !r || 0 === r.length || e >= r.length ? null : (n && (n.candidates = r,
  28905. n.pano = r[e].pano),
  28906. r[e].pano)
  28907. }
  28908. ,
  28909. n.prototype.showPanoScores = function(e) {
  28910. this.list.forEach(function(e) {
  28911. e.removeTextSprite()
  28912. });
  28913. var t = 6344768;
  28914. e.forEach(function(e) {
  28915. e.pano.addTextSprite(e.score.toFixed(2), t),
  28916. t = 16428055
  28917. })
  28918. }
  28919. ,
  28920. n.prototype.isNeighbour = function(e, t) {
  28921. return this.neighbourMap[e.id][t.id]
  28922. }
  28923. ,
  28924. n.prototype.getNeighbours = function(e) {
  28925. return this.neighbourMap[e.id]
  28926. }
  28927. ,
  28928. n.prototype.setNeighbour = function(e, t, i) {
  28929. return this.neighbourMap[e.id] || (this.neighbourMap[e.id] = {}),
  28930. this.neighbourMap[t.id] || (this.neighbourMap[t.id] = {}),
  28931. this.neighbourMap[e.id][e.id] = !0,
  28932. this.neighbourMap[t.id][t.id] = !0,
  28933. this.neighbourMap[e.id][t.id] = i,
  28934. this.neighbourMap[t.id][e.id] = i,
  28935. this.neighbourMap[e.id]
  28936. }
  28937. ,
  28938. n.prototype.findClosest = function(e, t) {
  28939. var i = [s.filters.isPanoAligned()];
  28940. return t && i.push(s.filters.inDirection(e, t, .75)),
  28941. this.find(i, [s.sortFunctions.distanceToPoint(e)])
  28942. }
  28943. ,
  28944. n.prototype.dualNeighbors = function(e, t) {
  28945. var i, n = [];
  28946. for (i in this.neighbourMap[e.id])
  28947. this.neighbourMap[t.id][i] && n.push(i);
  28948. return n
  28949. }
  28950. ,
  28951. n.prototype.populate_path_graph = function() {
  28952. 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;
  28953. for (e = 0; e < this.list.length; e += 1) {
  28954. o = this.list[e],
  28955. s = {},
  28956. l = !1,
  28957. i = o.neighbourPanos || o.findNeighourPanos();
  28958. for (t in i)
  28959. if (i[t]) {
  28960. a = this.index[t],
  28961. p.copy(o.floorPosition),
  28962. p.sub(a.floorPosition);
  28963. var m = Math.sqrt(p.x * p.x + p.z * p.z)
  28964. , v = (Math.abs(p.y) / Math.max(m, .01),
  28965. Math.max(0, Math.abs(p.y) - .2));
  28966. v > 0 ? (f += 1,
  28967. v = Math.pow(4 * v, 2),
  28968. m = Math.pow(m, 2),
  28969. n = Math.sqrt(v * v + m * m)) : (g += 1,
  28970. n = p.length()),
  28971. s[a.id] = n,
  28972. l = !0
  28973. }
  28974. l ? u[o.id] = s : d += 1
  28975. }
  28976. this.map = u,
  28977. h.info("graph ready in " + (Date.now() - c) + "ms, " + d + " had no neighbors")
  28978. }
  28979. ,
  28980. n.prototype.aStarSearch = function(e, t) {
  28981. var i = Date.now()
  28982. , n = new l({
  28983. start: e,
  28984. isEnd: function(e) {
  28985. return e === t
  28986. },
  28987. neighbor: function(e) {
  28988. var t = e.neighbourPanos || e.findNeighourPanos()
  28989. , i = [];
  28990. for (var n in t)
  28991. t[n] && i.push(this.index[n]); //add: t[n] &&
  28992. return i
  28993. }
  28994. .bind(this),
  28995. distance: function(e, t) {
  28996. var i = this.map[e.id]
  28997. , n = i[t.id];
  28998. return n
  28999. }
  29000. .bind(this),
  29001. heuristic: function(e, t) {
  29002. return 1
  29003. }
  29004. .bind(this),
  29005. hash: function(e) {
  29006. return e.id
  29007. },
  29008. timeout: 5e3
  29009. });
  29010. if (h.debug("A* search in " + (Date.now() - i) + "ms"),
  29011. "success" !== n.status)
  29012. return h.debug("Did not find A* path from " + e + " to " + t),
  29013. null;
  29014. h.debug("Total cost " + n.cost.toPrecision(3) + ", " + n.path.length + " steps");
  29015. var r = [];
  29016. return n.path.forEach(function(e) {
  29017. r.push(e.id)
  29018. }),
  29019. r
  29020. }
  29021. ,
  29022. n.prototype.includeNodesNearPath = function() {
  29023. var e = new r.Vector3
  29024. , t = new r.Vector3
  29025. , i = new r.Vector3
  29026. , n = new r.Vector3
  29027. , o = new r.Vector3
  29028. , a = new r.Vector3
  29029. , s = new r.Vector3
  29030. , l = new r.Vector3
  29031. , c = []
  29032. , h = new r.Vector3
  29033. , u = new r.Vector3;
  29034. return function(r, d) {
  29035. if (r)
  29036. for (var p = function(e, t, i) {
  29037. return o.copy(t).sub(e),
  29038. o.dot(i)
  29039. }, f = function(e, t) {
  29040. return p(h, e.position, i) - p(h, t.position, i)
  29041. }, g = 0; g < r.length - 1; ) {
  29042. var m = r[g]
  29043. , v = r[g + 1]
  29044. , A = this.index[m]
  29045. , y = this.index[v];
  29046. h.copy(A.position),
  29047. u.copy(y.position),
  29048. c.length = 0,
  29049. e.copy(u).sub(h),
  29050. i.copy(e).normalize();
  29051. for (var C = 0; C < this.list.length; C++) {
  29052. var I = this.list[C];
  29053. o.copy(I.position).sub(h);
  29054. var E = o.dot(i);
  29055. if (E > 0) {
  29056. s.copy(i),
  29057. s.multiplyScalar(E),
  29058. a.copy(o),
  29059. a.sub(s);
  29060. var b = a.length();
  29061. if (b < d) {
  29062. t.copy(e).negate(),
  29063. n.copy(t).normalize(),
  29064. l.copy(I.position).sub(u);
  29065. var w = l.dot(n);
  29066. w > 0 && c.push(I)
  29067. }
  29068. }
  29069. }
  29070. if (c.length > 0) {
  29071. c.sort(f);
  29072. for (var _ = r.length + c.length - 1; _ >= g + c.length; _--)
  29073. r[_] = r[_ - c.length];
  29074. for (var T = 0; T < c.length; T++)
  29075. r[T + g + 1] = c[T].id
  29076. }
  29077. g += c.length + 1
  29078. }
  29079. }
  29080. }(),
  29081. n.prototype.fadeMarkerOpacity = function(e, t) {
  29082. var i = void 0 === e ? a.panorama.markerOpacity : e
  29083. , n = this.list.findIndex(function(e) {
  29084. return e.marker
  29085. });
  29086. if (!(n < 0)) {
  29087. var r = this.list[n].marker.material.opacity;
  29088. if (r !== e) {
  29089. var o = i - r;
  29090. d.trigger({
  29091. func: function(e, t) {
  29092. var i = r + e * o;
  29093. this.forEach(function(e) {
  29094. e.marker && (e.marker.material.opacity = i)
  29095. })
  29096. }
  29097. .bind(this),
  29098. duration: void 0 === t ? a.markerOpacityTransitionTime : t,
  29099. name: "_fpm"
  29100. })
  29101. }
  29102. }
  29103. }
  29104. ,
  29105. t.exports = n
  29106. }
  29107. ).call(this, "/js/util/PanoramaCollection.js")
  29108. }
  29109. , {
  29110. "../objects/Panorama": 148,
  29111. "../settings": 166,
  29112. "./IndexedCollection": 175,
  29113. "./aStar": 180,
  29114. "./common": 185,
  29115. "./logger": 189,
  29116. "./transitions": 195,
  29117. three: 217
  29118. }],
  29119. 179: [function(e, t, i) {
  29120. "use strict";
  29121. function n() {
  29122. this.actionSequence = [],
  29123. this.actionSequenceInProgress = !1
  29124. }
  29125. function r(e, t, i, n) {
  29126. s.trackAlways("zoom_" + e, {
  29127. from: t,
  29128. to: i,
  29129. pano: n
  29130. })
  29131. }
  29132. function o(e, t) {
  29133. r("initial", 1, e, t)
  29134. }
  29135. function a(e, t, i) {
  29136. r("followup", e, t, i)
  29137. }
  29138. var s = e("../analytics");
  29139. n.prototype.reset = function(e) {
  29140. this.actionSequenceInProgress = !1,
  29141. this.actionSequence.length = 0
  29142. }
  29143. ,
  29144. n.prototype.addZoomAction = function() {
  29145. var e = null
  29146. , t = null
  29147. , i = !1
  29148. , n = function() {
  29149. if (e = null,
  29150. this.actionSequence.length > 0) {
  29151. var i = this.actionSequence[0].start
  29152. , n = this.actionSequence[this.actionSequence.length - 1].end;
  29153. 1 === i ? o(n, t) : a(i, n, t)
  29154. }
  29155. this.reset()
  29156. };
  29157. return function(r, o, a) {
  29158. if (r !== o) {
  29159. i || (n = n.bind(this),
  29160. i = !0),
  29161. e && (window.clearTimeout(e),
  29162. e = null),
  29163. a === t && this.actionSequenceInProgress || (this.reset(),
  29164. t = a),
  29165. this.actionSequenceInProgress = !0;
  29166. var s = {
  29167. start: r,
  29168. end: o
  29169. };
  29170. this.actionSequence.push(s),
  29171. e = window.setTimeout(n, 150)
  29172. }
  29173. }
  29174. }(),
  29175. t.exports = n
  29176. }
  29177. , {
  29178. "../analytics": 4
  29179. }],
  29180. 180: [function(e, t, i) {
  29181. "use strict";
  29182. function n(e) {
  29183. void 0 === e.timeout && (e.timeout = 1 / 0);
  29184. var t = e.hash || o
  29185. , i = {
  29186. data: e.start,
  29187. g: 0,
  29188. h: e.heuristic(e.start)
  29189. }
  29190. , n = i;
  29191. i.f = i.h;
  29192. var h = new s
  29193. , u = new l(a)
  29194. , d = c();
  29195. u.push(i),
  29196. d.set(t(i.data), i);
  29197. for (var p = new Date; u.size(); ) {
  29198. if (new Date - p > e.timeout)
  29199. return {
  29200. status: "timeout",
  29201. cost: n.g,
  29202. path: r(n)
  29203. };
  29204. var f = u.pop();
  29205. if (d.delete(t(f.data)),
  29206. e.isEnd(f.data))
  29207. return {
  29208. status: "success",
  29209. cost: f.g,
  29210. path: r(f)
  29211. };
  29212. h.add(t(f.data));
  29213. for (var g = e.neighbor(f.data), m = 0; m < g.length; m++) {
  29214. var v = g[m];
  29215. if (!h.contains(t(v))) {
  29216. var A = f.g + e.distance(f.data, v)
  29217. , y = d.get(t(v))
  29218. , C = !1;
  29219. if (void 0 === y)
  29220. y = {
  29221. data: v
  29222. },
  29223. d.set(t(v), y);
  29224. else {
  29225. if (y.g < A)
  29226. continue;
  29227. C = !0
  29228. }
  29229. y.parent = f,
  29230. y.g = A,
  29231. y.h = e.heuristic(v),
  29232. y.f = A + y.h,
  29233. y.h < n.h && (n = y),
  29234. C ? u.heapify() : u.push(y)
  29235. }
  29236. }
  29237. }
  29238. return {
  29239. status: "noPath",
  29240. cost: n.g,
  29241. path: r(n)
  29242. }
  29243. }
  29244. function r(e) {
  29245. if (void 0 !== e.parent) {
  29246. var t = r(e.parent);
  29247. return t.push(e.data),
  29248. t
  29249. }
  29250. return [e.data]
  29251. }
  29252. function o(e) {
  29253. return e.toString()
  29254. }
  29255. function a(e, t) {
  29256. return e.f - t.f
  29257. }
  29258. var s = e("Set")
  29259. , l = e("heap")
  29260. , c = e("dict");
  29261. t.exports = n
  29262. }
  29263. , {
  29264. Set: 196,
  29265. dict: 210,
  29266. heap: 211
  29267. }],
  29268. 181: [function(e, t, i) {
  29269. (function(i) {
  29270. "use strict";
  29271. function n(e, t, i) {
  29272. var n = new XMLHttpRequest;
  29273. if (i && "withCredentials"in n)
  29274. n.open(e, t, i);
  29275. else if ("undefined" != typeof XDomainRequest)
  29276. n = new XDomainRequest,
  29277. n.open(e, t);
  29278. else {
  29279. if (i)
  29280. throw "Browser does not support CORS!";
  29281. n.open(e, t)
  29282. }
  29283. return n
  29284. }
  29285. function r(e, t, i) {
  29286. function o() {
  29287. u.warn("Retrying ", t),
  29288. r(e, t, i).done(c.resolve.bind(c)).progress(c.notify.bind(c)).fail(c.reject.bind(c))
  29289. }
  29290. function a(e, t) {
  29291. var i = e.response;
  29292. if ("json" === t && "object" != typeof i)
  29293. try {
  29294. i = JSON.parse(e.responseText)
  29295. } catch (e) {
  29296. return void c.reject({
  29297. error: "Failed parsing JSON"
  29298. })
  29299. }
  29300. else if ("image/jpeg" === t) {
  29301. var n = new Uint8Array(e.response)
  29302. , r = new Blob([n],{
  29303. type: "image/jpeg"
  29304. })
  29305. , o = URL.createObjectURL(r);
  29306. i = new Image,
  29307. i.src = o,
  29308. i.crossOrigin = "Anonymous",
  29309. i.onload = function() {
  29310. URL.revokeObjectURL(o)
  29311. }
  29312. }
  29313. return i
  29314. }
  29315. var s = n(e, t, !1);
  29316. if (i = i || {},
  29317. i.retries = void 0 !== i.retries ? i.retries : 0,
  29318. i.retry = void 0 !== i.retry ? i.retry : "get" === e.toLowerCase(),
  29319. i.responseType)
  29320. if (["arraybuffer", "text", "json"].indexOf(i.responseType) > -1)
  29321. s.responseType = i.responseType;
  29322. else {
  29323. if ("image/jpeg" !== i.responseType)
  29324. throw new Error('reponseType can only be one of "arraybuffer", "text" or "json", "image/jpeg"');
  29325. s.responseType = "arraybuffer"
  29326. }
  29327. if ("json" === i.responseType && s.setRequestHeader("Accept", "application/json"),
  29328. i.auth && s.setRequestHeader("Authorization", i.auth),
  29329. "object" == typeof i.data && (i.data = JSON.stringify(i.data),
  29330. s.setRequestHeader("Content-Type", "application/json")),
  29331. "object" == typeof i.headers)
  29332. for (var l in i.headers)
  29333. s.setRequestHeader(l, i.headers[l]);
  29334. var c = $.Deferred();
  29335. return s.onreadystatechange = function(e) {
  29336. if (4 === this.readyState)
  29337. if (this.status >= 500 && this.status <= 600 && i.retry && i.retries < 3)
  29338. i.retries++,
  29339. setTimeout(o, 1e3);
  29340. else if (200 === this.status) {
  29341. var t = a(this, i.responseType);
  29342. c.resolve(t)
  29343. } else
  29344. c.reject(this)
  29345. }
  29346. ,
  29347. s.onprogress = function(e) {
  29348. c.notify(e)
  29349. }
  29350. ,
  29351. s.send(i.data),
  29352. c.promise()
  29353. }
  29354. function o(e) {
  29355. return Object.keys(e).sort().map(function(t) {
  29356. return {
  29357. key: t,
  29358. value: e[t]
  29359. }
  29360. })
  29361. }
  29362. function a(e, t) {
  29363. var i = t.responseType || null
  29364. , n = t.auth || null
  29365. , r = t.prefetchFrom || null
  29366. , a = e + "__" + i + "__" + n + "__" + r;
  29367. return t.headers && o(t.headers).forEach(function(e) {
  29368. a += "__" + e.key + ":" + e.value
  29369. }),
  29370. a
  29371. }
  29372. function s(e, t) {
  29373. return window.MP_REQUEST_CACHE ? window.MP_REQUEST_CACHE[a(e, t)] : null
  29374. }
  29375. function l(e, t, i) {
  29376. window.MP_REQUEST_CACHE && (window.MP_REQUEST_CACHE[a(e, t)] = i)
  29377. }
  29378. var c = e("./logger")
  29379. , h = e("../ab")
  29380. , u = new c(i);
  29381. window.URL = window.URL || window.webkitURL,
  29382. window.MP_REQUEST_CACHE = window.MP_REQUEST_CACHE || {},
  29383. window.DATA = window.DATA || {}
  29384. /* setTimeout(function() {//MP-- xzw delete
  29385. window.MP_REQUEST_CACHE = null,
  29386. window.DATA = {}
  29387. }, 6e4),
  29388. window.onpageshow = function(e) {
  29389. e.persisted && (window.MP_REQUEST_CACHE = null,
  29390. window.DATA = {})
  29391. } */
  29392. ,
  29393. t.exports = {
  29394. get: function(e, t) {
  29395. t = t || {};
  29396. var i = void 0 === t.cache || t.cache;
  29397. if (i) {
  29398. var n = s(e, t);
  29399. if (n)
  29400. return n
  29401. }
  29402. var o;
  29403. return o = t.prefetchFrom && window.DATA[t.prefetchFrom] ? $.when(window.DATA[t.prefetchFrom]) : r("GET", e, t),
  29404. i && l(e, t, o),
  29405. o
  29406. },
  29407. post: function(e, t) {
  29408. return r("POST", e, t)
  29409. },
  29410. patch: function(e, t) {
  29411. return r("PATCH", e, t)
  29412. },
  29413. getImage: function(e, t) {
  29414. function i() {
  29415. u.warn("Retrying ", e),
  29416. o.getImage(e, t - 1).done(n.resolve.bind(n)).progress(n.notify.bind(n)).fail(n.reject.bind(n))
  29417. }
  29418. var n = $.Deferred()
  29419. , r = new Image
  29420. , o = this;
  29421. return e = h.changeIfImageOptimzing(e),
  29422. null !== t && void 0 !== t || (t = 3),
  29423. r.onerror = function() {
  29424. t > 0 ? setTimeout(i, 1e3) : n.reject()
  29425. }
  29426. ,
  29427. r.onload = function() {
  29428. n.resolve(r)
  29429. }
  29430. ,
  29431. r.crossOrigin = "anonymous",
  29432. r.src = e,
  29433. n
  29434. }
  29435. }
  29436. }
  29437. ).call(this, "/js/util/ajax.js")
  29438. }
  29439. , {
  29440. "../ab": 3,
  29441. "./logger": 189
  29442. }],
  29443. 182: [function(e, t, i) {
  29444. "use strict";
  29445. function n(e, t) {
  29446. var i = window.navigator.userAgent
  29447. , n = i.match(e);
  29448. return n = n ? n[1].split(t) : [],
  29449. {
  29450. major: parseInt(n[0]) || 0,
  29451. minor: parseInt(n[1]) || 0,
  29452. patch: parseInt(n[2]) || 0
  29453. }
  29454. }
  29455. var r = e("../exception/DeviceMismatchException");
  29456. window.browser = t.exports = {
  29457. isFullscreen: function() {
  29458. return document.fullscreenElement || document.mozFullscreenElement || document.mozFullScreenElement || document.webkitFullscreenElement || document.msFullscreenElement
  29459. },
  29460. supportsFullscreen: function() {
  29461. return document.fullscreenEnabled || document.mozFullscreenEnabled || document.mozFullScreenEnabled || document.webkitFullscreenEnabled || document.msFullscreenEnabled
  29462. },
  29463. isPointerLocked: function() {
  29464. return document.pointerLockElement || document.mozPointerLockElement || document.webkitPointerLockElement
  29465. },
  29466. requestFullscreen: function(e, t) {
  29467. e.requestFullscreen ? e.requestFullscreen() : e.mozRequestFullScreen ? e.mozRequestFullScreen() : e.webkitRequestFullscreen ? e.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT) : e.msRequestFullscreen && e.msRequestFullscreen(),
  29468. t && $(document).on("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", browser.requestPointerLock)
  29469. },
  29470. requestPointerLock: function() {
  29471. var e;
  29472. if (document.fullscreenElement)
  29473. e = document.fullscreenElement();
  29474. else if (document.mozFullscreenElement)
  29475. e = document.mozFullscreenElement();
  29476. else if (document.mozFullScreenElement)
  29477. e = document.mozFullScreenElement();
  29478. else {
  29479. if (!document.webkitFullscreenElement)
  29480. return;
  29481. e = document.webkitFullscreenElement()
  29482. }
  29483. e.requestPointerLock = e.requestPointerLock || e.mozRequestPointerLock || e.webkitRequestPointerLock,
  29484. e.requestPointerLock(),
  29485. $(document).off("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", this)
  29486. },
  29487. exitPointerLock: function() {
  29488. document.exitPointerLock = document.exitPointerLock || document.mozExitPointerLock || document.webkitExitPointerLock,
  29489. document.exitPointerLock()
  29490. },
  29491. exitFullscreen: function() {
  29492. document.exitFullscreen ? document.exitFullscreen() : document.msExitFullscreen ? document.msExitFullscreen() : document.mozCancelFullScreen ? document.mozCancelFullScreen() : document.webkitExitFullscreen && document.webkitExitFullscreen()
  29493. },
  29494. details: function() {
  29495. var e = navigator.userAgent.match("(Firefox|Chrome|Safari)/([\\d]+)");
  29496. return e ? {
  29497. name: e[1],
  29498. version: parseInt(e[2]),
  29499. platform: navigator.platform
  29500. } : {}
  29501. },
  29502. is: function(e) {
  29503. return this.details() && this.details().name === e
  29504. },
  29505. inIframe: function() {
  29506. return window.parent !== window
  29507. },
  29508. aspectRatio: function() {
  29509. var e = $("#player").width() / $("#player").height();
  29510. return isFinite(e) ? e : 0
  29511. },
  29512. userAgent: function() {
  29513. return window.navigator.userAgent
  29514. },
  29515. isMobile: function() {
  29516. var e = navigator.userAgent || navigator.vendor || window.opera;
  29517. 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))
  29518. },
  29519. isLandscape: function() {
  29520. return this.isMobile && this.aspectRatio() > 1
  29521. },
  29522. isSmallScreen: function() {
  29523. var e = screen.width / window.devicePixelRatio;
  29524. return e < 240
  29525. },
  29526. detectIE: function() {
  29527. var e = window.navigator.userAgent
  29528. , t = e.indexOf("MSIE ");
  29529. return t !== -1 || !!navigator.userAgent.match(/Trident.*rv\:11\./)
  29530. },
  29531. detectSafari: function() {
  29532. var e = window.navigator.userAgent
  29533. , t = e.indexOf("Safari");
  29534. return t !== -1 && !this.detectChrome()
  29535. },
  29536. detectFirefox: function() {
  29537. var e = window.navigator.userAgent;
  29538. return e.indexOf("Firefox") !== -1
  29539. },
  29540. detectChrome: function() {
  29541. var e = window.navigator.userAgent;
  29542. return e.indexOf("Chrome") !== -1 && !this.detectOpera()
  29543. },
  29544. detectOpera: function() {
  29545. var e = window.navigator.userAgent;
  29546. return e.indexOf("OPR") !== -1
  29547. },
  29548. detectIOS: function() {
  29549. return this.detectIPhone() || this.detectIPad() || this.detectIPod()
  29550. },
  29551. detectIPad: function() {
  29552. var e = window.navigator.userAgent
  29553. , t = /iPad/;
  29554. return t.test(e)
  29555. },
  29556. detectIPod: function() {
  29557. var e = window.navigator.userAgent
  29558. , t = /iPod/;
  29559. return t.test(e)
  29560. },
  29561. detectIPhone: function() {
  29562. var e = window.navigator.userAgent
  29563. , t = /iPhone/;
  29564. return t.test(e)
  29565. },
  29566. detectAndroid: function() {
  29567. var e = window.navigator.userAgent;
  29568. return e.indexOf("Android") !== -1
  29569. },
  29570. detectAndroidMobile: function() {
  29571. var e = window.navigator.userAgent;
  29572. return this.detectAndroid() && e.indexOf("Mobile") !== -1
  29573. },
  29574. detectSamsungNative: function() {
  29575. var e = window.navigator.userAgent;
  29576. return e.indexOf("SM-G900H") !== -1 || e.indexOf("GT-I9500") !== -1 || e.indexOf("SM-N900") !== -1
  29577. },
  29578. detectSamsungS6: function() {
  29579. var e = window.navigator.userAgent;
  29580. return e.indexOf("SM-G92") !== -1
  29581. },
  29582. /************************************************************fyz改from徐世廷*************************************************************/
  29583. detectHUAWEI5X: function() {
  29584. return -1 !== window.navigator.userAgent.indexOf("KIW-TL00H")
  29585. },
  29586. /*******************************************************************************************************************************/
  29587. detectWebVR: function() {
  29588. return !(!window.navigator.getVRDisplays || !window.VRDisplay)
  29589. },
  29590. getVRDisplay: function() {
  29591. var e = $.Deferred();
  29592. return this.detectWebVR() ? (navigator.getVRDisplays().then(function(t) {
  29593. t.length >= 1 && e.resolve(t[0]),
  29594. e.reject(null)
  29595. }),
  29596. e) : e.reject(null)
  29597. },
  29598. iosVersion: function() {
  29599. if (!this.detectIOS())
  29600. throw new r("Did not detect an iDevice");
  29601. var e = /((?:\d+\_?){1,3}) like Mac OS/
  29602. , t = "_";
  29603. return n(e, t)
  29604. },
  29605. androidVersion: function() {
  29606. if (!this.detectAndroid())
  29607. throw new r("Did not detect an Android based device");
  29608. var e = /Android ((?:\d+\.?){1,3})/
  29609. , t = ".";
  29610. return n(e, t)
  29611. },
  29612. valueFromCookie: function(e, t) {
  29613. var i = new RegExp(e + "=([0-9a-f]+)(; ?|$)").exec(document.cookie);
  29614. if (!i)
  29615. return t;
  29616. var n = i[1];
  29617. return "boolean" == typeof t ? "true" === n || "1" === n : "number" == typeof t ? parseFloat(n) : n
  29618. },
  29619. valueFromHash: function(e, t) {
  29620. var i = new RegExp("[#&?]" + e + "=([^#&?]*)")
  29621. , n = i.exec(window.location.href);
  29622. if (!n)
  29623. return t;
  29624. var r = n[1];
  29625. return "boolean" == typeof t ? "true" === r || "1" === r : "number" == typeof t ? parseFloat(r) : window.decodeURIComponent(r)
  29626. }
  29627. }
  29628. changeLog()
  29629. }
  29630. , {
  29631. "../exception/DeviceMismatchException": 56
  29632. }],
  29633. 183: [function(e, t, i) {
  29634. (function(i) {
  29635. "use strict";
  29636. function n(e, t) {
  29637. var i = r(t);
  29638. var replaceAll = function (str, f, e) {
  29639. //f全部替换成e
  29640. var reg = new RegExp(f, "g"); //创建正则RegExp对象
  29641. return str.replace(reg, e);
  29642. };
  29643. var urlFirstView = c.valueFromHash('firstView');
  29644. if(urlFirstView){
  29645. try{
  29646. urlFirstView = replaceAll(urlFirstView, "pano:", '"pano":"')
  29647. urlFirstView = replaceAll(urlFirstView, ",qua:", '","qua":[')
  29648. urlFirstView = "{"+urlFirstView+"]}"
  29649. let info = JSON.parse(urlFirstView);
  29650. i.pano = t.index[info.pano] //panos.get(info.pano)
  29651. if(!i.pano){
  29652. urlFirstView = false
  29653. console.error('检测到firstView但是 找不到该pano')
  29654. }else{
  29655. i.quaternion = new THREE.Quaternion().fromArray(info.qua)
  29656. i.zoom = -1;
  29657. i.mode = "panorama"
  29658. i.setByUrl = true
  29659. }
  29660. }catch(e){
  29661. urlFirstView = false
  29662. console.error('检测到firstView但是解析出错'+e)
  29663. }
  29664. }
  29665. if (Object.keys(i).length > 0)
  29666. return i;
  29667. if (e.heroImage)
  29668. i = o(e, t);
  29669. else if (window.DATA.camera_start) {
  29670. var n = window.DATA.camera_start;
  29671. try {
  29672. Object.keys(n).length > 0 && !l.isEmptyQuaternion(n.camera.quaternion) && (i.mode = h.convertWorkshopModeInt(n.mode),
  29673. i.position = n.camera.position,
  29674. //i.quaternion = n.camera.quaternion,
  29675. i.quaternion = new th.Quaternion().fromArray(n.camera.quaternion),//xzw
  29676. i.zoom = l.convertWorkshopOrthoZoom(n.camera.zoom),
  29677. n.pano && (i.pano = t.get(n.pano.uuid) || t.findClosest(i.position),
  29678. d.debug("Using camera_start"),
  29679. d.debug("Modeldata pano: ", i.pano.quaternion),
  29680. d.debug("Camera start pano: ", n.pano.quaternion)),
  29681. i.mode !== h.PANORAMA && (i.floorVisibility = e.heroImage.metadata.floor_visibility))
  29682. } catch (e) {
  29683. d.warn(e.message)
  29684. if(i.mode == "panorama" && !i.pano)i.pano = t.list[0]
  29685. }
  29686. }
  29687. if (e.outsideAllowed() || i.mode === h.PANORAMA || (i = {}),
  29688. i.mode === h.MESH && i.position && (i.mode = h.PANORAMA,
  29689. i.pano = t.findClosest(i.position),
  29690. i.quaternion = i.pano.quaternion),
  29691. 0 === Object.keys(i).length) {
  29692. var a = t.list[0];
  29693. a && (i.mode = h.PANORAMA,
  29694. i.pano = a,
  29695. i.position = a.position,
  29696. i.quaternion = a.quaternion,
  29697. d.info("Starting at 1st pano " + a.id))
  29698. }
  29699. return i.mode = i.mode || h.DOLLHOUSE,
  29700. i
  29701. }
  29702. function r(e) {
  29703. var t = c.valueFromHash("start", "")
  29704. , i = {};
  29705. if ("" !== t) {
  29706. d.debug("Start override found in parameters, trying to parse..."),
  29707. i = a(t) || {};
  29708. var n = c.valueFromHash("tag", null);
  29709. n && (i.tag = n),
  29710. i.panoId && (i.pano = e.get(i.panoId))
  29711. }
  29712. return i
  29713. }
  29714. function o(e, t) {
  29715. if (!e.heroImage || !e.heroImage.metadata.camera_position)
  29716. return {};
  29717. var i = {}
  29718. , n = e.heroImage.metadata;
  29719. d.debug("Using start position from thumbnail image"),
  29720. i.position = n.camera_position,
  29721. i.quaternion = n.camera_quaternion;
  29722. try {
  29723. i.mode = h.convertWorkshopModeInt(n.camera_mode),
  29724. i.mode === h.PANORAMA ? i.pano = t.get(n.scan_id) : i.floorVisibility = n.floor_visibility
  29725. } catch (e) {
  29726. d.debug(e.message)
  29727. }
  29728. return i
  29729. }
  29730. function a(e) {
  29731. return s.deserialize(e)
  29732. }
  29733. var s = e("../controls/serializer")
  29734. , l = e("../util/math")
  29735. , c = e("./browser")
  29736. , h = e("../enum/Viewmode")
  29737. , u = e("../util/logger")
  29738. , th = e("three")//xzw
  29739. , d = new u(i);
  29740. t.exports = {
  29741. getStartCameraOptions: n
  29742. }
  29743. }
  29744. ).call(this, "/js/util/camera.js")
  29745. }
  29746. , {
  29747. "../controls/serializer": 14,
  29748. "../enum/Viewmode": 51,
  29749. "../util/logger": 189,
  29750. "../util/math": 190,
  29751. "./browser": 182,
  29752. "three": 217
  29753. }],
  29754. 184: [function(e, t, i) {
  29755. "use strict";
  29756. function n(e, t, i) {
  29757. return o(e.fov, t, i)
  29758. }
  29759. var r = e("./MathLight")
  29760. , o = function(e, t, i) {
  29761. var n = t
  29762. , o = i
  29763. , a = 2 * Math.atan(Math.tan(e * r.RADIANS_PER_DEGREE / 2) * (n / o)) * r.DEGREES_PER_RADIAN;
  29764. return a
  29765. }
  29766. , a = function(e, t, i) {
  29767. var n = t
  29768. , o = i
  29769. , a = 2 * Math.atan(Math.tan(e * r.RADIANS_PER_DEGREE / 2) * (o / n)) * r.DEGREES_PER_RADIAN;
  29770. return a
  29771. }
  29772. , s = function(e, t, i, n) {
  29773. var r = o(e, i, n);
  29774. return r > t ? a(t, i, n) : e
  29775. };
  29776. t.exports = {
  29777. clampVFOV: s,
  29778. getHFOVForCamera: n,
  29779. getHFOVFromVFOV: o,
  29780. getVFOVFromHFOV: a
  29781. }
  29782. window.MathLight = t.exports
  29783. MathLight.closeTo = function(e1,e2, precision){//xzw add 判断e1,e2是否接近
  29784. var prec = Math.pow(10, - (precision || 4));
  29785. var s1 = Math.abs(e1.x - e2.x) < prec && Math.abs(e1.y - e2.y) < prec && Math.abs(e1.z - e2.z) < prec
  29786. if(e1.w){
  29787. return s1 && Math.abs(e1.w - e2.w) < prec
  29788. }else return s1
  29789. }
  29790. }
  29791. , {
  29792. "./MathLight": 176
  29793. }],
  29794. 185: [function(e, t, i) {
  29795. "use strict";
  29796. var n = e("three");
  29797. t.exports = {
  29798. delayOneFrame: function(e) {
  29799. window.setTimeout(e, 1)
  29800. },
  29801. normalizeUrl: function(e) {
  29802. return e.replace("https://", "http://")
  29803. },
  29804. domainFromUrl: function(e) {
  29805. var t = /^([^:]*:\/\/)?(www\.)?([^\/]+)/.exec(e);
  29806. return t ? t[3] : e
  29807. },
  29808. average: function(e, t) {
  29809. if (0 === e.length)
  29810. return null;
  29811. for (var i = 0, n = 0, r = 0; r < e.length; r++) {
  29812. var o = t ? e[r][t] : e[r];
  29813. i += o,
  29814. n++
  29815. }
  29816. return i / n
  29817. },
  29818. countUnique: function(e) {
  29819. for (var t = {}, i = 0; i < e.length; i++)
  29820. t[e[i]] = 1 + (t[e[i]] || 0);
  29821. return Object.keys(t).length
  29822. },
  29823. averageVectors: function(e, t) {
  29824. var i = new n.Vector3;
  29825. if (0 === e.length)
  29826. return i;
  29827. for (var r = 0, o = 0; o < e.length; o++) {
  29828. var a = t ? e[o][t] : e[o];
  29829. i.add(a),
  29830. r++
  29831. }
  29832. return i.divideScalar(r)
  29833. },
  29834. equalLists: function(e, t) {
  29835. if (e.length !== t.length)
  29836. return !1;
  29837. for (var i = 0; i < e.length; i++)
  29838. if (e[i] !== t[i])
  29839. return !1;
  29840. return !0
  29841. },
  29842. lowerMedian: function(e, t) {
  29843. if (0 === e.length)
  29844. return null;
  29845. t = t || 2,
  29846. e.sort(function(e, t) {
  29847. return e - t
  29848. });
  29849. var i = Math.floor(e.length / t);
  29850. return e[i]
  29851. },
  29852. stableSort: function(e, t) {
  29853. return e.map(function(e, t) {
  29854. return {
  29855. value: e,
  29856. index: t
  29857. }
  29858. }).sort(function(e, i) {
  29859. var n = t(e.value, i.value);
  29860. return 0 !== n ? n : e.index - i.index
  29861. }).map(function(e) {
  29862. return e.value
  29863. })
  29864. },
  29865. filterAll: function(e, t) {
  29866. return e.filter(function(e) {
  29867. return t.every(function(t) {
  29868. return t(e)
  29869. })
  29870. })
  29871. },
  29872. formatDate: function(e) {
  29873. return [e.getFullYear(), e.getMonth() + 1, e.getDate()].join("-")
  29874. },
  29875. formatDatetime: function(e) {
  29876. return [e.getFullYear(), e.getMonth() + 1, e.getDate(), e.getHours(), e.getMinutes()].join("-")
  29877. },
  29878. randomString: function(e) {
  29879. for (var t = "", i = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", n = 0; n < e; n++)
  29880. t += i.charAt(Math.floor(Math.random() * i.length));
  29881. return t
  29882. },
  29883. uint8ToBase64: function(e, t) {
  29884. t && "number" == typeof t || (t = 8192);
  29885. for (var i = [], n = 0; n < e.length; n += t)
  29886. i.push(String.fromCharCode.apply(null, e.subarray(n, n + t)));
  29887. return btoa(i.join(""))
  29888. },
  29889. uuid4: function e(t) {
  29890. return t ? (t ^ 16 * Math.random() >> t / 4).toString(16) : ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, e)
  29891. },
  29892. nth: function(e) {
  29893. return e %= 10,
  29894. 1 === e ? e + "st" : 2 === e ? e + "nd" : 3 === e ? e + "rd" : e + "th"
  29895. },
  29896. extendObject: function(e, t) {
  29897. return Object.keys(t).forEach(function(i) {
  29898. e[i] = t[i]
  29899. }),
  29900. e
  29901. },
  29902. deepExtend: function e(t) {
  29903. t = t || {};
  29904. for (var i = 1; i < arguments.length; i++) {
  29905. var n = arguments[i];
  29906. if (n)
  29907. for (var r in n)
  29908. n.hasOwnProperty(r) && ("object" == typeof n[r] ? t[r] = e(t[r], n[r]) : t[r] = n[r])
  29909. }
  29910. return t
  29911. },
  29912. inherit: function(e, t) {
  29913. e.prototype = Object.create(t.prototype),
  29914. e.prototype.constructor = e
  29915. },
  29916. extend: function(e, t) {
  29917. for (var i in t.prototype)
  29918. e.prototype[i] = t.prototype[i]
  29919. }
  29920. ,
  29921. getVisiblePano : function(positions = [], panos, options={}){//add
  29922. var visiblePanos = [];
  29923. options.posAtPanos = options.posAtPanos || {}//在不同漫游点的positions
  29924. panos.forEach((pano)=>{
  29925. if(!pano.isAligned())return;
  29926. var A = pano.position.clone();
  29927. var posB = options.posAtPanos[pano.id] || positions;
  29928. var posLength = posB.length
  29929. for(let i=0;i<posLength;i++){
  29930. var B = posB[i];
  29931. var ray = new THREE.Raycaster(A.clone(), B.clone().sub(A).normalize(), 0, A.distanceTo(B) - (options.tolerance||0) )
  29932. var o = ray.intersectObjects(options.model || player.model.colliders, true);
  29933. if (!o || !o.length){ //只要有一点可见,就算整体可见
  29934. visiblePanos.push(pano.id);
  29935. break;
  29936. }
  29937. }
  29938. })
  29939. return visiblePanos
  29940. }
  29941. ,
  29942. sortByScore : function(list, request, rank) {
  29943. var i = this.filterAll(list, request);
  29944. return 0 === i.length ? null : i = i.map(function(e) {
  29945. return {
  29946. item: e,
  29947. score: rank.reduce(function(t, i) {
  29948. return t + i(e);
  29949. }, 0)
  29950. };
  29951. }).sort(function(e, t) {
  29952. return t.score - e.score;
  29953. });
  29954. },
  29955. getFileNameFromUrl:function(url){
  29956. return url.split('/').pop();
  29957. }
  29958. },
  29959. Math.sign = function(e) {
  29960. return e < 0 ? -1 : 1
  29961. }
  29962. window.common = t.exports
  29963. }
  29964. , {
  29965. three: 217
  29966. }],
  29967. 186: [function(e, t, i) {
  29968. "use strict";
  29969. var n = {};
  29970. n.linearTween = function(e, t, i, n) {
  29971. return i * e / n + t
  29972. }
  29973. ,
  29974. n.easeInQuad = function(e, t, i, n) {
  29975. return e /= n,
  29976. i * e * e + t
  29977. }
  29978. ,
  29979. n.easeOutQuad = function(e, t, i, n) {
  29980. return e /= n,
  29981. -i * e * (e - 2) + t
  29982. }
  29983. ,
  29984. n.easeInOutQuad = function(e, t, i, n) {
  29985. return e /= n / 2,
  29986. e < 1 ? i / 2 * e * e + t : (e--,
  29987. -i / 2 * (e * (e - 2) - 1) + t)
  29988. }
  29989. ,
  29990. n.easeInCubic = function(e, t, i, n) {
  29991. return e /= n,
  29992. i * e * e * e + t
  29993. }
  29994. ,
  29995. n.easeOutCubic = function(e, t, i, n) {
  29996. return e /= n,
  29997. e--,
  29998. i * (e * e * e + 1) + t
  29999. }
  30000. ,
  30001. n.easeInOutCubic = function(e, t, i, n) {
  30002. return e /= n / 2,
  30003. e < 1 ? i / 2 * e * e * e + t : (e -= 2,
  30004. i / 2 * (e * e * e + 2) + t)
  30005. }
  30006. ,
  30007. n.easeInQuart = function(e, t, i, n) {
  30008. return e /= n,
  30009. i * e * e * e * e + t
  30010. }
  30011. ,
  30012. n.easeOutQuart = function(e, t, i, n) {
  30013. return e /= n,
  30014. e--,
  30015. -i * (e * e * e * e - 1) + t
  30016. }
  30017. ,
  30018. n.easeInOutQuart = function(e, t, i, n) {
  30019. return e /= n / 2,
  30020. e < 1 ? i / 2 * e * e * e * e + t : (e -= 2,
  30021. -i / 2 * (e * e * e * e - 2) + t)
  30022. }
  30023. ,
  30024. n.easeInQuint = function(e, t, i, n) {
  30025. return e /= n,
  30026. i * e * e * e * e * e + t
  30027. }
  30028. ,
  30029. n.easeOutQuint = function(e, t, i, n) {
  30030. return e /= n,
  30031. e--,
  30032. i * (e * e * e * e * e + 1) + t
  30033. }
  30034. ,
  30035. n.easeInOutQuint = function(e, t, i, n) {
  30036. return e /= n / 2,
  30037. e < 1 ? i / 2 * e * e * e * e * e + t : (e -= 2,
  30038. i / 2 * (e * e * e * e * e + 2) + t)
  30039. }
  30040. ,
  30041. n.easeInSine = function(e, t, i, n) {
  30042. return -i * Math.cos(e / n * (Math.PI / 2)) + i + t
  30043. }
  30044. ,
  30045. n.easeOutSine = function(e, t, i, n) {
  30046. return i * Math.sin(e / n * (Math.PI / 2)) + t
  30047. }
  30048. ,
  30049. n.easeInOutSine = function(e, t, i, n) {
  30050. return -i / 2 * (Math.cos(Math.PI * e / n) - 1) + t
  30051. }
  30052. ,
  30053. n.easeInExpo = function(e, t, i, n) {
  30054. return i * Math.pow(2, 10 * (e / n - 1)) + t
  30055. }
  30056. ,
  30057. n.easeOutExpo = function(e, t, i, n) {
  30058. return i * (-Math.pow(2, -10 * e / n) + 1) + t
  30059. }
  30060. ,
  30061. n.easeInOutExpo = function(e, t, i, n) {
  30062. return e /= n / 2,
  30063. e < 1 ? i / 2 * Math.pow(2, 10 * (e - 1)) + t : (e--,
  30064. i / 2 * (-Math.pow(2, -10 * e) + 2) + t)
  30065. }
  30066. ,
  30067. n.easeInCirc = function(e, t, i, n) {
  30068. return e /= n,
  30069. -i * (Math.sqrt(1 - e * e) - 1) + t
  30070. }
  30071. ,
  30072. n.easeOutCirc = function(e, t, i, n) {
  30073. return e /= n,
  30074. e--,
  30075. i * Math.sqrt(1 - e * e) + t
  30076. }
  30077. ,
  30078. n.easeInOutCirc = function(e, t, i, n) {
  30079. return e /= n / 2,
  30080. e < 1 ? -i / 2 * (Math.sqrt(1 - e * e) - 1) + t : (e -= 2,
  30081. i / 2 * (Math.sqrt(1 - e * e) + 1) + t)
  30082. }
  30083. ,
  30084. n.easeInElastic = function(e, t, i, n) {
  30085. var r = 1.70158
  30086. , o = 0
  30087. , a = i;
  30088. return 0 === e ? t : 1 === (e /= n) ? t + i : (o || (o = .3 * n),
  30089. a < Math.abs(i) ? (a = i,
  30090. r = o / 4) : r = o / (2 * Math.PI) * Math.asin(i / a),
  30091. -(a * Math.pow(2, 10 * (e -= 1)) * Math.sin((e * n - r) * (2 * Math.PI) / o)) + t)
  30092. }
  30093. ,
  30094. n.easeOutElastic = function(e, t, i, n) {
  30095. var r = 1.70158
  30096. , o = 0
  30097. , a = i;
  30098. return 0 === e ? t : 1 === (e /= n) ? t + i : (o || (o = .3 * n),
  30099. a < Math.abs(i) ? (a = i,
  30100. r = o / 4) : r = o / (2 * Math.PI) * Math.asin(i / a),
  30101. a * Math.pow(2, -10 * e) * Math.sin((e * n - r) * (2 * Math.PI) / o) + i + t)
  30102. }
  30103. ,
  30104. n.easeInOutElastic = function(e, t, i, n) {
  30105. var r = 1.70158
  30106. , o = 0
  30107. , a = i;
  30108. return 0 === e ? t : 2 === (e /= n / 2) ? t + i : (o || (o = n * (.3 * 1.5)),
  30109. a < Math.abs(i) ? (a = i,
  30110. r = o / 4) : r = o / (2 * Math.PI) * Math.asin(i / a),
  30111. 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)
  30112. }
  30113. ,
  30114. n.easeInBack = function(e, t, i, n, r) {
  30115. return void 0 === r && (r = 1.70158),
  30116. i * (e /= n) * e * ((r + 1) * e - r) + t
  30117. }
  30118. ,
  30119. n.easeOutBack = function(e, t, i, n, r) {
  30120. return void 0 === r && (r = 1.70158),
  30121. i * ((e = e / n - 1) * e * ((r + 1) * e + r) + 1) + t
  30122. }
  30123. ,
  30124. n.easeInOutBack = function(e, t, i, n, r) {
  30125. return void 0 === r && (r = 1.70158),
  30126. (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
  30127. }
  30128. ,
  30129. n.easeOutBounce = function(e, t, i, n) {
  30130. 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
  30131. }
  30132. ,
  30133. n.easeInBounce = function(e, t, i, r) {
  30134. return i - n.easeOutBounce(r - e, 0, i, r) + t
  30135. }
  30136. ,
  30137. n.easeInOutBounce = function(e, t, i, r) {
  30138. 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
  30139. }
  30140. ,
  30141. t.exports = n
  30142. window.easing = n
  30143. }
  30144. , {}],
  30145. 187: [function(e, t, i) {
  30146. "use strict";
  30147. function n() {
  30148. this.events = [],
  30149. this.valid = !1
  30150. }
  30151. var r = e("../enum/Joystick");
  30152. n.prototype.push = function(e, t) {
  30153. this.events.push({
  30154. direction: e,
  30155. pano: t
  30156. }),
  30157. this.valid = !0
  30158. }
  30159. ,
  30160. n.prototype.pop = function(e) {
  30161. var t = this.events.pop();
  30162. return this.events.length < 1 && (this.valid = !1),
  30163. t
  30164. }
  30165. ,
  30166. n.prototype.peek = function() {
  30167. return this.events.length ? this.events[this.events.length - 1] : {
  30168. direction: null,
  30169. pano: null
  30170. }
  30171. }
  30172. ,
  30173. n.prototype.invalidate = function() {
  30174. this.events = [],
  30175. this.valid = !1
  30176. }
  30177. ,
  30178. n.prototype.reversePano = function(e) {
  30179. if (!this.valid)
  30180. return null;
  30181. var t = this.peek();
  30182. return r.opposite(e) === t.direction ? (this.pop(),
  30183. t.pano) : null
  30184. }
  30185. ,
  30186. t.exports = n
  30187. }
  30188. , {
  30189. "../enum/Joystick": 29
  30190. }],
  30191. 188: [function(e, t, i) {
  30192. "use strict";
  30193. window.lerp = t.exports = {
  30194. vector: function(e, t) {
  30195. var i = e.clone();
  30196. return t = t.clone(),
  30197. function(n) {
  30198. e.set(i.x * (1 - n) + t.x * n, i.y * (1 - n) + t.y * n, i.z * (1 - n) + t.z * n)
  30199. }
  30200. },
  30201. quaternion: function(e, t) {
  30202. var i = e.clone();
  30203. return function(n) {
  30204. e.copy(i).slerp(t, n)
  30205. }
  30206. },
  30207. property: function(e, t, i, n) {
  30208. var r = e[t];
  30209. return function(o) {
  30210. e[t] = r * (1 - o) + i * o,
  30211. n && n(e[t])
  30212. }
  30213. },
  30214. uniform: function(e, t, i) {
  30215. var n = e.material.uniforms[t].value;
  30216. return function(r) {
  30217. e.material.uniforms[t] && (e.material.uniforms[t].value = n * (1 - r) + i * r)
  30218. }
  30219. },
  30220. matrix4: function(e, t) {
  30221. var i = e.clone();
  30222. return function(n) {
  30223. for (var r = e.elements, o = i.elements, a = t.elements, s = 0; s < 16; s++)
  30224. r[s] = o[s] * (1 - n) + a[s] * n
  30225. }
  30226. },
  30227. allUniforms: function(e, t, i) {
  30228. var n = e.map(function(e) {
  30229. return this.uniform(e, t, i)
  30230. }
  30231. .bind(this));
  30232. return function(e) {
  30233. n.forEach(function(t) {
  30234. t(e)
  30235. })
  30236. }
  30237. }
  30238. }
  30239. }
  30240. , {}],
  30241. 189: [function(e, t, i) {
  30242. "use strict";
  30243. function n(e) {
  30244. var t, i, o, a, s = e.split("/"), l = "[" + s[s.length - 1].replace(".js", "") + "]", c = {};
  30245. if (n.consoleEnabled) {
  30246. var h = function(e) {
  30247. $("#debug-console").append("<p>" + e + "</p>"),
  30248. $("#debug-console")[0].scrollTop = $("#debug-console")[0].scrollHeight
  30249. };
  30250. t = function(e) {
  30251. h(Array.prototype.slice.call(arguments).join(" "))
  30252. }
  30253. ,
  30254. i = function(e) {
  30255. h(Array.prototype.slice.call(arguments).join(" "))
  30256. }
  30257. ,
  30258. o = function(e) {
  30259. h("WARN: " + Array.prototype.slice.call(arguments).join(" "))
  30260. }
  30261. ,
  30262. a = function(e) {
  30263. h("ERROR: " + Array.prototype.slice.call(arguments).join(" "))
  30264. }
  30265. } else
  30266. console.log ? (t = console.log,
  30267. i = console.info ? console.info : console.log,
  30268. o = console.warn ? console.warn : console.log,
  30269. a = console.error ? console.error : console.log) : t = i = o = a = function() {}
  30270. ;
  30271. var u = function(e) {
  30272. return [l, n.timestamp()].concat(Array.prototype.slice.call(e))
  30273. }
  30274. , d = function(t, i) {
  30275. if (r) {
  30276. var o = Array.prototype.slice.call(t).join(" ");
  30277. r.captureMessage(o, {
  30278. level: i,
  30279. path: e,
  30280. timestamp: n.timestamp()
  30281. })
  30282. }
  30283. }
  30284. , p = function(t, i) {
  30285. if (r) {
  30286. var o = Array.prototype.slice.call(t).join(" ");
  30287. r.captureException(new Error(o), {
  30288. level: i,
  30289. path: e,
  30290. timestamp: n.timestamp()
  30291. })
  30292. }
  30293. };
  30294. return {
  30295. debug: function() {
  30296. n.level >= n.levels.debug && t.apply(console, u(arguments))
  30297. },
  30298. info: function() {
  30299. n.level >= n.levels.info && i.apply(console, u(arguments))
  30300. },
  30301. warn: function() {
  30302. d(arguments, "warn"),
  30303. n.level >= n.levels.warn && o.apply(console, u(arguments))
  30304. },
  30305. error: function() {
  30306. p(arguments, "error"),
  30307. n.level >= n.levels.error && a.apply(console, u(arguments))
  30308. },
  30309. v3str: function(e, t) {
  30310. var i = void 0 === t ? 2 : t;
  30311. return "(" + e.x.toPrecision(i) + ", " + e.y.toPrecision(i) + ", " + e.z.toPrecision(i) + ")"
  30312. },
  30313. eulstr: function(e, t) {
  30314. var i = void 0 === t ? 2 : t;
  30315. return "(" + THREE.Math.radToDeg(e.x).toPrecision(i) + ", " + THREE.Math.radToDeg(e.y).toPrecision(i) + ", " + THREE.Math.radToDeg(e.z).toPrecision(i) + ' "' + e.order + '")'
  30316. },
  30317. time: function(e) {
  30318. n.level >= n.levels.debug && (c[e] = Date.now())
  30319. },
  30320. timeEnd: function(e) {
  30321. if (n.level >= n.levels.debug) {
  30322. var t = c[e];
  30323. if (!t)
  30324. return;
  30325. var i = (Date.now() - t) / 1e3;
  30326. this.debug(e, i + "s")
  30327. }
  30328. }
  30329. }
  30330. }
  30331. var r = window.Raven;
  30332. n.timestamp = function() {
  30333. return (Date.now() - window.navigationStart) / 1e3 + "s"
  30334. }
  30335. ,
  30336. n.levels = {
  30337. debug: 3,
  30338. info: 2,
  30339. warn: 1,
  30340. error: 0
  30341. },
  30342. n.level = n.levels.info,
  30343. t.exports = n
  30344. }
  30345. , {}],
  30346. 190: [function(e, t, i) {
  30347. "use strict";
  30348. var n = e("three")
  30349. , r = e("../enum/GLCubeFaces")
  30350. , o = e("../constants");
  30351. t.exports = {
  30352. convertVisionVector: function(e) {
  30353. return new n.Vector3(e.x,e.z,-e.y)
  30354. },
  30355. convertVisionQuaternion: function(e) {
  30356. 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)))
  30357. },
  30358. convertWorkshopVector: function(e) {
  30359. return new n.Vector3(-e.x,e.y,e.z)
  30360. },
  30361. convertWorkshopQuaternion: function(e) {
  30362. 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))
  30363. },
  30364. convertWorkshopPanoramaQuaternion: function(e) {
  30365. 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)))
  30366. },
  30367. convertWorkshopOrthoZoom: function(e) {// xzw
  30368. //return e === -1 ? -1 : e / 16 * ($("#player").width() / $("#player").height()) / o.workshopApsect
  30369. //return e;
  30370. return e === -1 ? -1 : e * ($("#player").width() / $("#player").height()) / g_snapShotWidth * g_snapShotHeight;
  30371. },
  30372. toPrecision: function(e, t) {//xzw change
  30373. var f = function(e, t){
  30374. var i = Math.pow(10, t);
  30375. return Math.round(e * i) / i
  30376. }
  30377. if(e instanceof Array){
  30378. for(var s=0; s<e.length; s++){
  30379. e[s] = f(e[s],t);
  30380. }
  30381. return e;
  30382. }
  30383. else return f(e,t)
  30384. },
  30385. isEmptyQuaternion: function(e) {
  30386. return 0 === Math.abs(e.x) && 0 === Math.abs(e.y) && 0 === Math.abs(e.z) && 0 === Math.abs(e.w)
  30387. },
  30388. projectPositionToCanvas: function(e, t, i) {
  30389. i = i || new n.Vector3,
  30390. i.copy(e);
  30391. var r = .5 * $("#player").width()
  30392. , o = .5 * $("#player").height();
  30393. return i.project(t),
  30394. i.x = i.x * r + r,
  30395. i.y = -(i.y * o) + o,
  30396. i
  30397. },
  30398. convertScreenPositionToNDC: function(e, t, i) {
  30399. return i = i || new n.Vector2,
  30400. i.x = e / $("#player").width() * 2 - 1,
  30401. i.y = 2 * -(t / $("#player").height()) + 1,
  30402. i
  30403. },
  30404. constrainedTurn: function(e) {
  30405. var t = e % (2 * Math.PI);
  30406. return t = t > Math.PI ? t -= 2 * Math.PI : t < -Math.PI ? t += 2 * Math.PI : t
  30407. },
  30408. getFOVDotThreshold: function(e) {
  30409. return Math.cos(n.Math.degToRad(e / 2))
  30410. },
  30411. transform2DForwardVectorByCubeFace: function(e, t, i, n) {
  30412. switch (e) {
  30413. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  30414. i.set(1, t.y, t.x);
  30415. break;
  30416. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  30417. i.set(-1, t.y, -t.x);
  30418. break;
  30419. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  30420. i.set(-t.x, 1, -t.y);
  30421. break;
  30422. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  30423. i.set(-t.x, -1, t.y);
  30424. break;
  30425. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  30426. i.set(-t.x, t.y, 1);
  30427. break;
  30428. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  30429. i.set(t.x, t.y, -1)
  30430. }
  30431. n && i.normalize()
  30432. },
  30433. //add:
  30434. getPos2d : function(point, camera, dom){
  30435. var camera = camera ;
  30436. var dom = dom;
  30437. 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);
  30438. var x,y;
  30439. x = (pos.x + 1) / 2 * dom.clientWidth;
  30440. y = (1 - (pos.y + 1) / 2) * dom.clientHeight;
  30441. var inSight = x <= dom.clientWidth && x >= 0
  30442. && y <= dom.clientHeight && y >= 0
  30443. return {
  30444. pos: new THREE.Vector2(x,y),
  30445. vector: pos,
  30446. trueSide : pos.z<1, //trueSide为false时,即使在屏幕范围内可见,也是反方向的另一个不可以被渲染的点 参见Tag.update
  30447. inSight : inSight //在屏幕范围内可见
  30448. };
  30449. },
  30450. getDirByLonLat: function(lon, lat) {
  30451. var dir = new THREE.Vector3();
  30452. var phi = THREE.Math.degToRad(90 - lat);
  30453. var theta = THREE.Math.degToRad(lon);
  30454. dir.x = Math.sin(phi) * Math.cos(theta);
  30455. dir.y = Math.cos(phi);
  30456. dir.z = Math.sin(phi) * Math.sin(theta);
  30457. return dir.negate();
  30458. }
  30459. }
  30460. window.math = t.exports
  30461. }
  30462. , {
  30463. "../constants": 8,
  30464. "../enum/GLCubeFaces": 25,
  30465. three: 217
  30466. }],
  30467. 191: [function(e, t, i) {
  30468. "use strict";
  30469. function n(e, t, i) {
  30470. return a.map(function(n, o) {
  30471. return e.get("pan/" + i + "/" + t + "_skybox" + r(n) + ".jpg")
  30472. }
  30473. .bind(this))
  30474. }
  30475. function r(e) {
  30476. return s[e]
  30477. }
  30478. var o = e("../enum/GLCubeFaces")
  30479. , a = [0, 1, 2, 3, 4, 5]
  30480. , s = {
  30481. 0: o.GL_TEXTURE_CUBE_MAP_POSITIVE_Y,
  30482. 1: o.GL_TEXTURE_CUBE_MAP_POSITIVE_Z,
  30483. 2: o.GL_TEXTURE_CUBE_MAP_POSITIVE_X,
  30484. 3: o.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,
  30485. 4: o.GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
  30486. 5: o.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
  30487. };
  30488. t.exports = {
  30489. mapFaceToCubemapFace: r,
  30490. getCubemapUrls: n
  30491. }
  30492. }
  30493. , {
  30494. "../enum/GLCubeFaces": 25
  30495. }],
  30496. 192: [function(e, t, i) {
  30497. "use strict";
  30498. t.exports = {
  30499. captureErrors: function(e, t, i) {
  30500. if ("Raven"in window) {
  30501. Raven.config(e, t).install(),
  30502. i && Raven.setTagsContext(i);
  30503. var n = console.warn
  30504. , r = console.error;
  30505. console.warn = function() {
  30506. var e = Array.prototype.slice.call(arguments);
  30507. Raven.captureMessage(e.join(" "), {
  30508. level: "warning"
  30509. }),
  30510. n.apply(console, e)
  30511. }
  30512. ,
  30513. console.error = function() {
  30514. var e = Array.prototype.slice.call(arguments);
  30515. Raven.captureException(new Error(e.join(" ")), {
  30516. level: "error"
  30517. }),
  30518. r.apply(console, e)
  30519. }
  30520. } else
  30521. console.error("Raven not found, not capturing errors.")
  30522. }
  30523. }
  30524. }
  30525. , {}],
  30526. 193: [function(e, t, i) {
  30527. (function(i) {
  30528. "use strict";
  30529. var n = e("./browser")
  30530. , r = e("../constants")
  30531. , o = e("url")
  30532. , a = e("./logger")
  30533. , ss = e('three')
  30534. , s = new a(i)
  30535. , l = {
  30536. getAuthorizationHeader: function() {
  30537. var e = n.valueFromHash("auth");
  30538. if (e)
  30539. return e.replace(",", " ");
  30540. var t = n.valueFromCookie("token");
  30541. return t ? "Token " + t : null
  30542. },
  30543. parseSidUrl: function(e) {
  30544. var t, i;
  30545. t=g_Prefix;
  30546. if (e = e || "",
  30547. e.match(/^https?/)) {
  30548. var n = o.parse(e);
  30549. t = g_Prefix,
  30550. i = e
  30551. } else{
  30552. //xzw 原先的不能用
  30553. //t = window.location.protocol + "//" + window.location.host, //MP
  30554. t = g_Prefix
  30555. //i = t + "/api/player/models/" + e; //MP
  30556. i = t + "data/" + e;
  30557. }
  30558. return {
  30559. urlBase: t,
  30560. urlModel: i,
  30561. urlFiles: i + (i.match(/\/$/) ? "files" : "/files"),
  30562. urlThumb: i + (i.match(/\/$/) ? "thumb" : "/thumb")
  30563. }
  30564. },
  30565. getModelIDFromQueryString: function() {
  30566. return n.valueFromHash("model") || n.valueFromHash("m")
  30567. },
  30568. /* normalizeModeldata: function(e, t) {//xzw 修改导览images数据
  30569. e = JSON.parse(JSON.stringify(e));
  30570. var i = null;
  30571. if (e.images.forEach(function(n) {
  30572. if(!n.metadata) return;
  30573. if ("string" == typeof n.metadata)
  30574. try {
  30575. n.metadata = JSON.parse(n.metadata)
  30576. } catch (e) {
  30577. s.warn("Unable to parse image metadata"),
  30578. n.metadata = null
  30579. }
  30580. else{
  30581. "object" == typeof n.metadata && s.debug("image.metadata already a JSON object");
  30582. }
  30583. if(n.metadata.camera_position instanceof Array){//xzw 改的格式
  30584. n.metadata.camera_position = new ss.Vector3().fromArray(n.metadata.camera_position);
  30585. n.metadata.camera_quaternion = new ss.Quaternion().fromArray(n.metadata.camera_quaternion);
  30586. }else{
  30587. n.metadata.camera_quaternion && (n.metadata.camera_quaternion = t.convertWorkshopQuaternion(n.metadata.camera_quaternion)),
  30588. n.metadata.camera_position && (n.metadata.camera_position = t.convertWorkshopVector(n.metadata.camera_position))
  30589. n.metadata.zoom = n.metadata.zoom || 1;
  30590. }
  30591. !i && e.icon && e.icon === n.sid && (i = n.metadata)
  30592. }),
  30593. //icon初始视角的:
  30594. i && i.camera_quaternion && i.camera_position && i.scan_position && i.scan_quaternion) {
  30595. var n = {};
  30596. n.pano = {
  30597. quaternion: t.convertWorkshopPanoramaQuaternion(i.scan_quaternion),
  30598. position: t.convertWorkshopVector(i.scan_position),
  30599. uuid: i.scan_id
  30600. },
  30601. n.camera = {
  30602. quaternion: i.camera_quaternion,
  30603. position: i.camera_position
  30604. },
  30605. e.startPano = n
  30606. }
  30607. return e
  30608. },
  30609. */
  30610. normalizeModeldata: function(e, t) {//xzw 修改导览images数据
  30611. e = JSON.parse(JSON.stringify(e));
  30612. var i = null;
  30613. var deal = function(n) {
  30614. if(!n.metadata) return;
  30615. if ("string" == typeof n.metadata)
  30616. try {
  30617. n.metadata = JSON.parse(n.metadata)
  30618. } catch (e) {
  30619. s.warn("Unable to parse image metadata"),
  30620. n.metadata = null
  30621. }
  30622. else{
  30623. "object" == typeof n.metadata && s.debug("image.metadata already a JSON object");
  30624. }
  30625. if(n.metadata.camera_position instanceof Array){//xzw 改的格式
  30626. n.metadata.camera_position = new ss.Vector3().fromArray(n.metadata.camera_position);
  30627. n.metadata.camera_quaternion = new ss.Quaternion().fromArray(n.metadata.camera_quaternion);
  30628. }else{
  30629. n.metadata.camera_position = new ss.Vector3().copy(n.metadata.camera_position)
  30630. n.metadata.camera_quaternion = new ss.Quaternion().copy(n.metadata.camera_quaternion)
  30631. /* n.metadata.camera_quaternion && (n.metadata.camera_quaternion = i.convertWorkshopQuaternion(n.metadata.camera_quaternion)),
  30632. n.metadata.camera_position && (n.metadata.camera_position = i.convertWorkshopVector(n.metadata.camera_position)) */
  30633. }
  30634. !i && e.icon && e.icon === n.sid && (i = n.metadata)
  30635. }
  30636. //改
  30637. e.images.forEach(info=>{
  30638. if(info.locations){
  30639. info.locations.forEach(a=>deal(a))
  30640. }else{
  30641. deal(info)
  30642. }
  30643. })
  30644. //icon初始视角的:
  30645. if(i && i.camera_quaternion && i.camera_position && i.scan_position && i.scan_quaternion) {
  30646. var n = {};
  30647. n.pano = {
  30648. quaternion: t.convertWorkshopPanoramaQuaternion(i.scan_quaternion),
  30649. position: t.convertWorkshopVector(i.scan_position),
  30650. uuid: i.scan_id
  30651. },
  30652. n.camera = {
  30653. quaternion: i.camera_quaternion,
  30654. position: i.camera_position
  30655. },
  30656. e.startPano = n
  30657. }
  30658. return e
  30659. },
  30660. visionVersionToInt: function() {
  30661. var e = new RegExp(["(?:[0-9.]+\\.){1,4}", "([0-9]+)", "[^\\.]*$"].join(""));
  30662. return function(t) {
  30663. if (!t)
  30664. throw new Error("Vision version is required");
  30665. var i = e.exec(t);
  30666. if (null === i)
  30667. throw new Error("String is not a vision version: " + t);
  30668. return parseInt(i[1])
  30669. }
  30670. }(),
  30671. modelDataPromisesTiles: function(e) {
  30672. var vision_version = e.vision_version || window.DATA.vision_version
  30673. if (vision_version)
  30674. try {
  30675. return l.visionVersionToInt(vision_version) >= l.visionVersionToInt(r.visionTilingStartVersion)
  30676. } catch (t) {
  30677. s.warn("Invalid vision version: " + vision_version)
  30678. }
  30679. // var t = e.created ? new Date(e.created) : null;
  30680. // return t && t >= r.visionTilingStartDate
  30681. return false
  30682. }
  30683. };
  30684. t.exports = l
  30685. }
  30686. ).call(this, "/js/util/showcase.js")
  30687. }
  30688. , {
  30689. "../constants": 8,
  30690. "./browser": 182,
  30691. "./logger": 189,
  30692. three:217,
  30693. url: 208
  30694. }],
  30695. 194: [function(e, t, i) {
  30696. "use strict";
  30697. var n = e("../util/ajax")
  30698. , r = e("three")
  30699. , o = e("../settings")
  30700. , a = {};
  30701. t.exports = {
  30702. load: function(e, t, i) {
  30703. var s = a[e];
  30704. return s ? (t && setTimeout(function() {
  30705. t(s)
  30706. }, 1),
  30707. s) : (s = new r.Texture,
  30708. o.minimalMemoryMode && (s.minFilter = r.LinearFilter,
  30709. s.magFilter = r.LinearFilter,
  30710. s.generateMipmaps = !1),
  30711. s.sourceFile = e,
  30712. a[e] = s,
  30713. n.getImage(e).then(function(e) {
  30714. s.image = e,
  30715. s.needsUpdate = !0,
  30716. t && t(s)
  30717. }).fail(i),
  30718. s)
  30719. },
  30720. loadBase64: function(e, t) {
  30721. t = t || "png";
  30722. var i = new r.Texture;
  30723. return i.image = document.createElement("img"),
  30724. i.image.setAttribute("src", "data:image/" + t + ";base64," + e),
  30725. o.minimalMemoryMode && (i.minFilter = r.LinearFilter,
  30726. i.magFilter = r.LinearFilter,
  30727. i.generateMipmaps = !1),
  30728. i.needsUpdate = !0,
  30729. i
  30730. },
  30731. isLoaded: function(e) {
  30732. return !!a[e]
  30733. }
  30734. }
  30735. window.Texture = t.exports
  30736. }
  30737. , {
  30738. "../settings": 166,
  30739. "../util/ajax": 181,
  30740. three: 217
  30741. }],
  30742. 195: [function(e, t, i) {
  30743. "use strict";
  30744. var n = e("./easing");
  30745. window.transitions = t.exports = {
  30746. globalDone: null,
  30747. funcs: [],
  30748. counter: 0,
  30749. uniqueID: 0,
  30750. start: function(e, t, i, r, o, a, s) {
  30751. return r = r || 0,
  30752. this.funcs.push({
  30753. func: e,
  30754. current: -r * Math.abs(t),
  30755. duration: (1 - Math.max(r, 0)) * Math.abs(t),
  30756. done: i,
  30757. easing: o || n.linearTween,
  30758. cycling: t < 0,
  30759. running: !0,
  30760. debug: r < 0,
  30761. name: a || "T" + this.counter,
  30762. id: void 0 === s ? this.counter : s,
  30763. paused: !1
  30764. }),
  30765. e(0, 16),
  30766. this.counter += 1,
  30767. e
  30768. },
  30769. trigger: function(e) {
  30770. var t = void 0 === e.delayRatio ? 0 : e.delayRatio
  30771. , i = e.func || function() {}
  30772. , r = void 0 === e.duration ? 0 : e.duration;
  30773. void 0 !== e.cycling && e.cycling && (r = -Math.abs(r));
  30774. var o = e.done || null
  30775. , a = e.easing || n.linearTween
  30776. , s = e.name || "R" + this.counter
  30777. , l = void 0 === e.id ? this.counter : e.id;
  30778. return this.start(i, r, o, t, a, s, l)
  30779. },
  30780. setTimeout: function(e, t, i) {
  30781. var n = void 0 === i ? this.counter : i;
  30782. return this.trigger({
  30783. done: e,
  30784. duration: void 0 === t ? 0 : t,
  30785. name: "O" + this.counter,
  30786. id: n
  30787. })
  30788. },
  30789. pause: function() {
  30790. this.paused = !0
  30791. },
  30792. resume: function() {
  30793. this.paused = !1
  30794. },
  30795. update: function(e) {
  30796. this.funcs.forEach(function(t) {
  30797. if (!(t.paused || (t.current += 1e3 * e,
  30798. t.current < 0)))
  30799. if (t.current >= t.duration && !t.cycling) {
  30800. var i = t.easing(1, 0, 1, 1);
  30801. t.func(i, 1e3 * e),
  30802. t.done && t.done(),
  30803. t.running = !1
  30804. } else {
  30805. var n = t.easing(t.current % t.duration / t.duration, 0, 1, 1)
  30806. , r = t.func(n, 1e3 * e) || !1;
  30807. r && (t.done && t.done(),
  30808. t.running = !1)
  30809. }
  30810. });
  30811. var t = this.funcs.length;
  30812. this.funcs = this.funcs.filter(function(e) {
  30813. return e.running
  30814. });
  30815. var i = this.funcs.length;
  30816. if (t > 0 && 0 === i && this.globalDone) {
  30817. var n = this.globalDone;
  30818. this.globalDone = null,
  30819. n()
  30820. }
  30821. },
  30822. adjustSpeed: function(e, t) {
  30823. for (var i = this.getById(e), n = 0; n < i.length; n++) {
  30824. var r = i[n];
  30825. r.duration /= t,
  30826. r.current /= t
  30827. }
  30828. },
  30829. getById: function(e) {
  30830. return this.funcs.filter(function(t) {
  30831. return e === t.id
  30832. })
  30833. },
  30834. get: function(e) {
  30835. for (var t = 0; t < this.funcs.length; t += 1)
  30836. if (this.funcs[t].func === e)
  30837. return this.funcs[t];
  30838. return null
  30839. },
  30840. isRunning: function(e) {
  30841. var t = this.get(e);
  30842. return null !== t && t.running
  30843. },
  30844. countActive: function() {
  30845. for (var e = 0, t = 0; t < this.funcs.length; t += 1)
  30846. e += this.funcs[t].running;
  30847. return e
  30848. },
  30849. listActive: function() {
  30850. for (var e = [], t = 0; t < this.funcs.length; t += 1)
  30851. this.funcs[t].running && e.push(this.funcs[t].name);
  30852. return e
  30853. },
  30854. done: function(e) {
  30855. this.globalDone = e
  30856. },
  30857. cancelById: function(e) {
  30858. var t = void 0 === e ? 0 : e;
  30859. this.funcs = this.funcs.filter(function(e) {
  30860. return e.id !== t
  30861. })
  30862. },
  30863. cancel: function(e) {
  30864. this.funcs = this.funcs.filter(function(t) {
  30865. return t.func !== e
  30866. })
  30867. },
  30868. getUniqueId: function() {
  30869. return this.uniqueID -= 1,
  30870. this.uniqueID
  30871. }
  30872. }
  30873. }
  30874. , {
  30875. "./easing": 186
  30876. }],
  30877. 196: [function(e, t, i) {
  30878. function n(e) {
  30879. if (this.set = {},
  30880. this.infContains = function() {
  30881. return !0
  30882. }
  30883. ,
  30884. "object" == typeof e)
  30885. if (e instanceof Array)
  30886. for (var t = 0; t < e.length; t++)
  30887. this.set[e[t]] = !0;
  30888. else
  30889. this.set = e;
  30890. else if ("function" == typeof e)
  30891. this.infContains = e;
  30892. else if ("undefined" != typeof e)
  30893. throw new Error("set must be either an array or an object.")
  30894. }
  30895. t.exports = n,
  30896. n.prototype.contains = function(e) {
  30897. return !!this.set[e]
  30898. }
  30899. ,
  30900. n.prototype.has = n.prototype.contains,
  30901. n.prototype.add = function(e) {
  30902. if (1 == arguments.length)
  30903. this.set[e] = !0;
  30904. else
  30905. for (var t = 0; t < arguments.length; t++)
  30906. this.set[arguments[t]] = !0
  30907. }
  30908. ,
  30909. n.prototype.addAll = function(e) {
  30910. if ("object" != typeof e && !(e instanceof Array))
  30911. throw new Error("arr must be an array.");
  30912. for (var t = 0; t < e.length; t++)
  30913. this.add(e[t])
  30914. }
  30915. ,
  30916. n.prototype.remove = function(e) {
  30917. if (1 == arguments.length)
  30918. delete this.set[e];
  30919. else
  30920. for (var t = 0; t < arguments.length; t++)
  30921. delete this.set[arguments[t]]
  30922. }
  30923. ,
  30924. n.prototype.delete = n.prototype.remove,
  30925. n.prototype.clear = function() {
  30926. this.set = {}
  30927. }
  30928. ,
  30929. n.prototype.size = function() {
  30930. return Object.keys(this.set).length
  30931. }
  30932. ,
  30933. n.prototype.toString = function() {
  30934. return "{" + Object.keys(this.set).toString() + "}"
  30935. }
  30936. ,
  30937. n.prototype.toArray = function() {
  30938. return "undefined" == typeof this.set ? [] : Object.keys(this.set)
  30939. }
  30940. ,
  30941. n.prototype["*values"] = n.prototype.toArray
  30942. }
  30943. , {}],
  30944. 197: [function(e, t, i) {}
  30945. , {}],
  30946. 198: [function(e, t, i) {
  30947. (function(t) {
  30948. "use strict";
  30949. function n() {
  30950. try {
  30951. var e = new Uint8Array(1);
  30952. return e.__proto__ = {
  30953. __proto__: Uint8Array.prototype,
  30954. foo: function() {
  30955. return 42
  30956. }
  30957. },
  30958. 42 === e.foo() && "function" == typeof e.subarray && 0 === e.subarray(1, 1).byteLength
  30959. } catch (e) {
  30960. return !1
  30961. }
  30962. }
  30963. function r() {
  30964. return a.TYPED_ARRAY_SUPPORT ? 2147483647 : 1073741823
  30965. }
  30966. function o(e, t) {
  30967. if (r() < t)
  30968. throw new RangeError("Invalid typed array length");
  30969. return a.TYPED_ARRAY_SUPPORT ? (e = new Uint8Array(t),
  30970. e.__proto__ = a.prototype) : (null === e && (e = new a(t)),
  30971. e.length = t),
  30972. e
  30973. }
  30974. function a(e, t, i) {
  30975. if (!(a.TYPED_ARRAY_SUPPORT || this instanceof a))
  30976. return new a(e,t,i);
  30977. if ("number" == typeof e) {
  30978. if ("string" == typeof t)
  30979. throw new Error("If encoding is specified then the first argument must be a string");
  30980. return h(this, e)
  30981. }
  30982. return s(this, e, t, i)
  30983. }
  30984. function s(e, t, i, n) {
  30985. if ("number" == typeof t)
  30986. throw new TypeError('"value" argument must not be a number');
  30987. return "undefined" != typeof ArrayBuffer && t instanceof ArrayBuffer ? p(e, t, i, n) : "string" == typeof t ? u(e, t, i) : f(e, t)
  30988. }
  30989. function l(e) {
  30990. if ("number" != typeof e)
  30991. throw new TypeError('"size" argument must be a number');
  30992. if (e < 0)
  30993. throw new RangeError('"size" argument must not be negative')
  30994. }
  30995. function c(e, t, i, n) {
  30996. return l(t),
  30997. 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)
  30998. }
  30999. function h(e, t) {
  31000. if (l(t),
  31001. e = o(e, t < 0 ? 0 : 0 | g(t)),
  31002. !a.TYPED_ARRAY_SUPPORT)
  31003. for (var i = 0; i < t; ++i)
  31004. e[i] = 0;
  31005. return e
  31006. }
  31007. function u(e, t, i) {
  31008. if ("string" == typeof i && "" !== i || (i = "utf8"),
  31009. !a.isEncoding(i))
  31010. throw new TypeError('"encoding" must be a valid string encoding');
  31011. var n = 0 | v(t, i);
  31012. e = o(e, n);
  31013. var r = e.write(t, i);
  31014. return r !== n && (e = e.slice(0, r)),
  31015. e
  31016. }
  31017. function d(e, t) {
  31018. var i = t.length < 0 ? 0 : 0 | g(t.length);
  31019. e = o(e, i);
  31020. for (var n = 0; n < i; n += 1)
  31021. e[n] = 255 & t[n];
  31022. return e
  31023. }
  31024. function p(e, t, i, n) {
  31025. if (t.byteLength,
  31026. i < 0 || t.byteLength < i)
  31027. throw new RangeError("'offset' is out of bounds");
  31028. if (t.byteLength < i + (n || 0))
  31029. throw new RangeError("'length' is out of bounds");
  31030. return t = void 0 === i && void 0 === n ? new Uint8Array(t) : void 0 === n ? new Uint8Array(t,i) : new Uint8Array(t,i,n),
  31031. a.TYPED_ARRAY_SUPPORT ? (e = t,
  31032. e.__proto__ = a.prototype) : e = d(e, t),
  31033. e
  31034. }
  31035. function f(e, t) {
  31036. if (a.isBuffer(t)) {
  31037. var i = 0 | g(t.length);
  31038. return e = o(e, i),
  31039. 0 === e.length ? e : (t.copy(e, 0, 0, i),
  31040. e)
  31041. }
  31042. if (t) {
  31043. if ("undefined" != typeof ArrayBuffer && t.buffer instanceof ArrayBuffer || "length"in t)
  31044. return "number" != typeof t.length || K(t.length) ? o(e, 0) : d(e, t);
  31045. if ("Buffer" === t.type && $(t.data))
  31046. return d(e, t.data)
  31047. }
  31048. throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")
  31049. }
  31050. function g(e) {
  31051. if (e >= r())
  31052. throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + r().toString(16) + " bytes");
  31053. return 0 | e
  31054. }
  31055. function m(e) {
  31056. return +e != e && (e = 0),
  31057. a.alloc(+e)
  31058. }
  31059. function v(e, t) {
  31060. if (a.isBuffer(e))
  31061. return e.length;
  31062. if ("undefined" != typeof ArrayBuffer && "function" == typeof ArrayBuffer.isView && (ArrayBuffer.isView(e) || e instanceof ArrayBuffer))
  31063. return e.byteLength;
  31064. "string" != typeof e && (e = "" + e);
  31065. var i = e.length;
  31066. if (0 === i)
  31067. return 0;
  31068. for (var n = !1; ; )
  31069. switch (t) {
  31070. case "ascii":
  31071. case "latin1":
  31072. case "binary":
  31073. return i;
  31074. case "utf8":
  31075. case "utf-8":
  31076. case void 0:
  31077. return j(e).length;
  31078. case "ucs2":
  31079. case "ucs-2":
  31080. case "utf16le":
  31081. case "utf-16le":
  31082. return 2 * i;
  31083. case "hex":
  31084. return i >>> 1;
  31085. case "base64":
  31086. return Z(e).length;
  31087. default:
  31088. if (n)
  31089. return j(e).length;
  31090. t = ("" + t).toLowerCase(),
  31091. n = !0
  31092. }
  31093. }
  31094. function A(e, t, i) {
  31095. var n = !1;
  31096. if ((void 0 === t || t < 0) && (t = 0),
  31097. t > this.length)
  31098. return "";
  31099. if ((void 0 === i || i > this.length) && (i = this.length),
  31100. i <= 0)
  31101. return "";
  31102. if (i >>>= 0,
  31103. t >>>= 0,
  31104. i <= t)
  31105. return "";
  31106. for (e || (e = "utf8"); ; )
  31107. switch (e) {
  31108. case "hex":
  31109. return L(this, t, i);
  31110. case "utf8":
  31111. case "utf-8":
  31112. return M(this, t, i);
  31113. case "ascii":
  31114. return P(this, t, i);
  31115. case "latin1":
  31116. case "binary":
  31117. return O(this, t, i);
  31118. case "base64":
  31119. return S(this, t, i);
  31120. case "ucs2":
  31121. case "ucs-2":
  31122. case "utf16le":
  31123. case "utf-16le":
  31124. return D(this, t, i);
  31125. default:
  31126. if (n)
  31127. throw new TypeError("Unknown encoding: " + e);
  31128. e = (e + "").toLowerCase(),
  31129. n = !0
  31130. }
  31131. }
  31132. function y(e, t, i) {
  31133. var n = e[t];
  31134. e[t] = e[i],
  31135. e[i] = n
  31136. }
  31137. function C(e, t, i, n, r) {
  31138. if (0 === e.length)
  31139. return -1;
  31140. if ("string" == typeof i ? (n = i,
  31141. i = 0) : i > 2147483647 ? i = 2147483647 : i < -2147483648 && (i = -2147483648),
  31142. i = +i,
  31143. isNaN(i) && (i = r ? 0 : e.length - 1),
  31144. i < 0 && (i = e.length + i),
  31145. i >= e.length) {
  31146. if (r)
  31147. return -1;
  31148. i = e.length - 1
  31149. } else if (i < 0) {
  31150. if (!r)
  31151. return -1;
  31152. i = 0
  31153. }
  31154. if ("string" == typeof t && (t = a.from(t, n)),
  31155. a.isBuffer(t))
  31156. return 0 === t.length ? -1 : I(e, t, i, n, r);
  31157. if ("number" == typeof t)
  31158. return t &= 255,
  31159. 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);
  31160. throw new TypeError("val must be string, number or Buffer")
  31161. }
  31162. function I(e, t, i, n, r) {
  31163. function o(e, t) {
  31164. return 1 === a ? e[t] : e.readUInt16BE(t * a)
  31165. }
  31166. var a = 1
  31167. , s = e.length
  31168. , l = t.length;
  31169. if (void 0 !== n && (n = String(n).toLowerCase(),
  31170. "ucs2" === n || "ucs-2" === n || "utf16le" === n || "utf-16le" === n)) {
  31171. if (e.length < 2 || t.length < 2)
  31172. return -1;
  31173. a = 2,
  31174. s /= 2,
  31175. l /= 2,
  31176. i /= 2
  31177. }
  31178. var c;
  31179. if (r) {
  31180. var h = -1;
  31181. for (c = i; c < s; c++)
  31182. if (o(e, c) === o(t, h === -1 ? 0 : c - h)) {
  31183. if (h === -1 && (h = c),
  31184. c - h + 1 === l)
  31185. return h * a
  31186. } else
  31187. h !== -1 && (c -= c - h),
  31188. h = -1
  31189. } else
  31190. for (i + l > s && (i = s - l),
  31191. c = i; c >= 0; c--) {
  31192. for (var u = !0, d = 0; d < l; d++)
  31193. if (o(e, c + d) !== o(t, d)) {
  31194. u = !1;
  31195. break
  31196. }
  31197. if (u)
  31198. return c
  31199. }
  31200. return -1
  31201. }
  31202. function E(e, t, i, n) {
  31203. i = Number(i) || 0;
  31204. var r = e.length - i;
  31205. n ? (n = Number(n),
  31206. n > r && (n = r)) : n = r;
  31207. var o = t.length;
  31208. if (o % 2 !== 0)
  31209. throw new TypeError("Invalid hex string");
  31210. n > o / 2 && (n = o / 2);
  31211. for (var a = 0; a < n; ++a) {
  31212. var s = parseInt(t.substr(2 * a, 2), 16);
  31213. if (isNaN(s))
  31214. return a;
  31215. e[i + a] = s
  31216. }
  31217. return a
  31218. }
  31219. function b(e, t, i, n) {
  31220. return q(j(t, e.length - i), e, i, n)
  31221. }
  31222. function w(e, t, i, n) {
  31223. return q(Y(t), e, i, n)
  31224. }
  31225. function _(e, t, i, n) {
  31226. return w(e, t, i, n)
  31227. }
  31228. function T(e, t, i, n) {
  31229. return q(Z(t), e, i, n)
  31230. }
  31231. function x(e, t, i, n) {
  31232. return q(X(t, e.length - i), e, i, n)
  31233. }
  31234. function S(e, t, i) {
  31235. return 0 === t && i === e.length ? Q.fromByteArray(e) : Q.fromByteArray(e.slice(t, i))
  31236. }
  31237. function M(e, t, i) {
  31238. i = Math.min(e.length, i);
  31239. for (var n = [], r = t; r < i; ) {
  31240. var o = e[r]
  31241. , a = null
  31242. , s = o > 239 ? 4 : o > 223 ? 3 : o > 191 ? 2 : 1;
  31243. if (r + s <= i) {
  31244. var l, c, h, u;
  31245. switch (s) {
  31246. case 1:
  31247. o < 128 && (a = o);
  31248. break;
  31249. case 2:
  31250. l = e[r + 1],
  31251. 128 === (192 & l) && (u = (31 & o) << 6 | 63 & l,
  31252. u > 127 && (a = u));
  31253. break;
  31254. case 3:
  31255. l = e[r + 1],
  31256. c = e[r + 2],
  31257. 128 === (192 & l) && 128 === (192 & c) && (u = (15 & o) << 12 | (63 & l) << 6 | 63 & c,
  31258. u > 2047 && (u < 55296 || u > 57343) && (a = u));
  31259. break;
  31260. case 4:
  31261. l = e[r + 1],
  31262. c = e[r + 2],
  31263. h = e[r + 3],
  31264. 128 === (192 & l) && 128 === (192 & c) && 128 === (192 & h) && (u = (15 & o) << 18 | (63 & l) << 12 | (63 & c) << 6 | 63 & h,
  31265. u > 65535 && u < 1114112 && (a = u))
  31266. }
  31267. }
  31268. null === a ? (a = 65533,
  31269. s = 1) : a > 65535 && (a -= 65536,
  31270. n.push(a >>> 10 & 1023 | 55296),
  31271. a = 56320 | 1023 & a),
  31272. n.push(a),
  31273. r += s
  31274. }
  31275. return R(n)
  31276. }
  31277. function R(e) {
  31278. var t = e.length;
  31279. if (t <= ee)
  31280. return String.fromCharCode.apply(String, e);
  31281. for (var i = "", n = 0; n < t; )
  31282. i += String.fromCharCode.apply(String, e.slice(n, n += ee));
  31283. return i
  31284. }
  31285. function P(e, t, i) {
  31286. var n = "";
  31287. i = Math.min(e.length, i);
  31288. for (var r = t; r < i; ++r)
  31289. n += String.fromCharCode(127 & e[r]);
  31290. return n
  31291. }
  31292. function O(e, t, i) {
  31293. var n = "";
  31294. i = Math.min(e.length, i);
  31295. for (var r = t; r < i; ++r)
  31296. n += String.fromCharCode(e[r]);
  31297. return n
  31298. }
  31299. function L(e, t, i) {
  31300. var n = e.length;
  31301. (!t || t < 0) && (t = 0),
  31302. (!i || i < 0 || i > n) && (i = n);
  31303. for (var r = "", o = t; o < i; ++o)
  31304. r += W(e[o]);
  31305. return r
  31306. }
  31307. function D(e, t, i) {
  31308. for (var n = e.slice(t, i), r = "", o = 0; o < n.length; o += 2)
  31309. r += String.fromCharCode(n[o] + 256 * n[o + 1]);
  31310. return r
  31311. }
  31312. function N(e, t, i) {
  31313. if (e % 1 !== 0 || e < 0)
  31314. throw new RangeError("offset is not uint");
  31315. if (e + t > i)
  31316. throw new RangeError("Trying to access beyond buffer length")
  31317. }
  31318. function B(e, t, i, n, r, o) {
  31319. if (!a.isBuffer(e))
  31320. throw new TypeError('"buffer" argument must be a Buffer instance');
  31321. if (t > r || t < o)
  31322. throw new RangeError('"value" argument is out of bounds');
  31323. if (i + n > e.length)
  31324. throw new RangeError("Index out of range")
  31325. }
  31326. function F(e, t, i, n) {
  31327. t < 0 && (t = 65535 + t + 1);
  31328. for (var r = 0, o = Math.min(e.length - i, 2); r < o; ++r)
  31329. e[i + r] = (t & 255 << 8 * (n ? r : 1 - r)) >>> 8 * (n ? r : 1 - r)
  31330. }
  31331. function V(e, t, i, n) {
  31332. t < 0 && (t = 4294967295 + t + 1);
  31333. for (var r = 0, o = Math.min(e.length - i, 4); r < o; ++r)
  31334. e[i + r] = t >>> 8 * (n ? r : 3 - r) & 255
  31335. }
  31336. function U(e, t, i, n, r, o) {
  31337. if (i + n > e.length)
  31338. throw new RangeError("Index out of range");
  31339. if (i < 0)
  31340. throw new RangeError("Index out of range")
  31341. }
  31342. function k(e, t, i, n, r) {
  31343. return r || U(e, t, i, 4, 3.4028234663852886e38, -3.4028234663852886e38),
  31344. J.write(e, t, i, n, 23, 4),
  31345. i + 4
  31346. }
  31347. function H(e, t, i, n, r) {
  31348. return r || U(e, t, i, 8, 1.7976931348623157e308, -1.7976931348623157e308),
  31349. J.write(e, t, i, n, 52, 8),
  31350. i + 8
  31351. }
  31352. function G(e) {
  31353. if (e = z(e).replace(te, ""),
  31354. e.length < 2)
  31355. return "";
  31356. for (; e.length % 4 !== 0; )
  31357. e += "=";
  31358. return e
  31359. }
  31360. function z(e) {
  31361. return e.trim ? e.trim() : e.replace(/^\s+|\s+$/g, "")
  31362. }
  31363. function W(e) {
  31364. return e < 16 ? "0" + e.toString(16) : e.toString(16)
  31365. }
  31366. function j(e, t) {
  31367. t = t || 1 / 0;
  31368. for (var i, n = e.length, r = null, o = [], a = 0; a < n; ++a) {
  31369. if (i = e.charCodeAt(a),
  31370. i > 55295 && i < 57344) {
  31371. if (!r) {
  31372. if (i > 56319) {
  31373. (t -= 3) > -1 && o.push(239, 191, 189);
  31374. continue
  31375. }
  31376. if (a + 1 === n) {
  31377. (t -= 3) > -1 && o.push(239, 191, 189);
  31378. continue
  31379. }
  31380. r = i;
  31381. continue
  31382. }
  31383. if (i < 56320) {
  31384. (t -= 3) > -1 && o.push(239, 191, 189),
  31385. r = i;
  31386. continue
  31387. }
  31388. i = (r - 55296 << 10 | i - 56320) + 65536
  31389. } else
  31390. r && (t -= 3) > -1 && o.push(239, 191, 189);
  31391. if (r = null,
  31392. i < 128) {
  31393. if ((t -= 1) < 0)
  31394. break;
  31395. o.push(i)
  31396. } else if (i < 2048) {
  31397. if ((t -= 2) < 0)
  31398. break;
  31399. o.push(i >> 6 | 192, 63 & i | 128)
  31400. } else if (i < 65536) {
  31401. if ((t -= 3) < 0)
  31402. break;
  31403. o.push(i >> 12 | 224, i >> 6 & 63 | 128, 63 & i | 128)
  31404. } else {
  31405. if (!(i < 1114112))
  31406. throw new Error("Invalid code point");
  31407. if ((t -= 4) < 0)
  31408. break;
  31409. o.push(i >> 18 | 240, i >> 12 & 63 | 128, i >> 6 & 63 | 128, 63 & i | 128)
  31410. }
  31411. }
  31412. return o
  31413. }
  31414. function Y(e) {
  31415. for (var t = [], i = 0; i < e.length; ++i)
  31416. t.push(255 & e.charCodeAt(i));
  31417. return t
  31418. }
  31419. function X(e, t) {
  31420. for (var i, n, r, o = [], a = 0; a < e.length && !((t -= 2) < 0); ++a)
  31421. i = e.charCodeAt(a),
  31422. n = i >> 8,
  31423. r = i % 256,
  31424. o.push(r),
  31425. o.push(n);
  31426. return o
  31427. }
  31428. function Z(e) {
  31429. return Q.toByteArray(G(e))
  31430. }
  31431. function q(e, t, i, n) {
  31432. for (var r = 0; r < n && !(r + i >= t.length || r >= e.length); ++r)
  31433. t[r + i] = e[r];
  31434. return r
  31435. }
  31436. function K(e) {
  31437. return e !== e
  31438. }
  31439. var Q = e("base64-js")
  31440. , J = e("ieee754")
  31441. , $ = e("isarray");
  31442. i.Buffer = a,
  31443. i.SlowBuffer = m,
  31444. i.INSPECT_MAX_BYTES = 50,
  31445. a.TYPED_ARRAY_SUPPORT = void 0 !== t.TYPED_ARRAY_SUPPORT ? t.TYPED_ARRAY_SUPPORT : n(),
  31446. i.kMaxLength = r(),
  31447. a.poolSize = 8192,
  31448. a._augment = function(e) {
  31449. return e.__proto__ = a.prototype,
  31450. e
  31451. }
  31452. ,
  31453. a.from = function(e, t, i) {
  31454. return s(null, e, t, i)
  31455. }
  31456. ,
  31457. a.TYPED_ARRAY_SUPPORT && (a.prototype.__proto__ = Uint8Array.prototype,
  31458. a.__proto__ = Uint8Array,
  31459. "undefined" != typeof Symbol && Symbol.species && a[Symbol.species] === a && Object.defineProperty(a, Symbol.species, {
  31460. value: null,
  31461. configurable: !0
  31462. })),
  31463. a.alloc = function(e, t, i) {
  31464. return c(null, e, t, i)
  31465. }
  31466. ,
  31467. a.allocUnsafe = function(e) {
  31468. return h(null, e)
  31469. }
  31470. ,
  31471. a.allocUnsafeSlow = function(e) {
  31472. return h(null, e)
  31473. }
  31474. ,
  31475. a.isBuffer = function(e) {
  31476. return !(null == e || !e._isBuffer)
  31477. }
  31478. ,
  31479. a.compare = function(e, t) {
  31480. if (!a.isBuffer(e) || !a.isBuffer(t))
  31481. throw new TypeError("Arguments must be Buffers");
  31482. if (e === t)
  31483. return 0;
  31484. for (var i = e.length, n = t.length, r = 0, o = Math.min(i, n); r < o; ++r)
  31485. if (e[r] !== t[r]) {
  31486. i = e[r],
  31487. n = t[r];
  31488. break
  31489. }
  31490. return i < n ? -1 : n < i ? 1 : 0
  31491. }
  31492. ,
  31493. a.isEncoding = function(e) {
  31494. switch (String(e).toLowerCase()) {
  31495. case "hex":
  31496. case "utf8":
  31497. case "utf-8":
  31498. case "ascii":
  31499. case "latin1":
  31500. case "binary":
  31501. case "base64":
  31502. case "ucs2":
  31503. case "ucs-2":
  31504. case "utf16le":
  31505. case "utf-16le":
  31506. return !0;
  31507. default:
  31508. return !1
  31509. }
  31510. }
  31511. ,
  31512. a.concat = function(e, t) {
  31513. if (!$(e))
  31514. throw new TypeError('"list" argument must be an Array of Buffers');
  31515. if (0 === e.length)
  31516. return a.alloc(0);
  31517. var i;
  31518. if (void 0 === t)
  31519. for (t = 0,
  31520. i = 0; i < e.length; ++i)
  31521. t += e[i].length;
  31522. var n = a.allocUnsafe(t)
  31523. , r = 0;
  31524. for (i = 0; i < e.length; ++i) {
  31525. var o = e[i];
  31526. if (!a.isBuffer(o))
  31527. throw new TypeError('"list" argument must be an Array of Buffers');
  31528. o.copy(n, r),
  31529. r += o.length
  31530. }
  31531. return n
  31532. }
  31533. ,
  31534. a.byteLength = v,
  31535. a.prototype._isBuffer = !0,
  31536. a.prototype.swap16 = function() {
  31537. var e = this.length;
  31538. if (e % 2 !== 0)
  31539. throw new RangeError("Buffer size must be a multiple of 16-bits");
  31540. for (var t = 0; t < e; t += 2)
  31541. y(this, t, t + 1);
  31542. return this
  31543. }
  31544. ,
  31545. a.prototype.swap32 = function() {
  31546. var e = this.length;
  31547. if (e % 4 !== 0)
  31548. throw new RangeError("Buffer size must be a multiple of 32-bits");
  31549. for (var t = 0; t < e; t += 4)
  31550. y(this, t, t + 3),
  31551. y(this, t + 1, t + 2);
  31552. return this
  31553. }
  31554. ,
  31555. a.prototype.swap64 = function() {
  31556. var e = this.length;
  31557. if (e % 8 !== 0)
  31558. throw new RangeError("Buffer size must be a multiple of 64-bits");
  31559. for (var t = 0; t < e; t += 8)
  31560. y(this, t, t + 7),
  31561. y(this, t + 1, t + 6),
  31562. y(this, t + 2, t + 5),
  31563. y(this, t + 3, t + 4);
  31564. return this
  31565. }
  31566. ,
  31567. a.prototype.toString = function() {
  31568. var e = 0 | this.length;
  31569. return 0 === e ? "" : 0 === arguments.length ? M(this, 0, e) : A.apply(this, arguments)
  31570. }
  31571. ,
  31572. a.prototype.equals = function(e) {
  31573. if (!a.isBuffer(e))
  31574. throw new TypeError("Argument must be a Buffer");
  31575. return this === e || 0 === a.compare(this, e)
  31576. }
  31577. ,
  31578. a.prototype.inspect = function() {
  31579. var e = ""
  31580. , t = i.INSPECT_MAX_BYTES;
  31581. return this.length > 0 && (e = this.toString("hex", 0, t).match(/.{2}/g).join(" "),
  31582. this.length > t && (e += " ... ")),
  31583. "<Buffer " + e + ">"
  31584. }
  31585. ,
  31586. a.prototype.compare = function(e, t, i, n, r) {
  31587. if (!a.isBuffer(e))
  31588. throw new TypeError("Argument must be a Buffer");
  31589. if (void 0 === t && (t = 0),
  31590. void 0 === i && (i = e ? e.length : 0),
  31591. void 0 === n && (n = 0),
  31592. void 0 === r && (r = this.length),
  31593. t < 0 || i > e.length || n < 0 || r > this.length)
  31594. throw new RangeError("out of range index");
  31595. if (n >= r && t >= i)
  31596. return 0;
  31597. if (n >= r)
  31598. return -1;
  31599. if (t >= i)
  31600. return 1;
  31601. if (t >>>= 0,
  31602. i >>>= 0,
  31603. n >>>= 0,
  31604. r >>>= 0,
  31605. this === e)
  31606. return 0;
  31607. 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)
  31608. if (c[u] !== h[u]) {
  31609. o = c[u],
  31610. s = h[u];
  31611. break
  31612. }
  31613. return o < s ? -1 : s < o ? 1 : 0
  31614. }
  31615. ,
  31616. a.prototype.includes = function(e, t, i) {
  31617. return this.indexOf(e, t, i) !== -1
  31618. }
  31619. ,
  31620. a.prototype.indexOf = function(e, t, i) {
  31621. return C(this, e, t, i, !0)
  31622. }
  31623. ,
  31624. a.prototype.lastIndexOf = function(e, t, i) {
  31625. return C(this, e, t, i, !1)
  31626. }
  31627. ,
  31628. a.prototype.write = function(e, t, i, n) {
  31629. if (void 0 === t)
  31630. n = "utf8",
  31631. i = this.length,
  31632. t = 0;
  31633. else if (void 0 === i && "string" == typeof t)
  31634. n = t,
  31635. i = this.length,
  31636. t = 0;
  31637. else {
  31638. if (!isFinite(t))
  31639. throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");
  31640. t |= 0,
  31641. isFinite(i) ? (i |= 0,
  31642. void 0 === n && (n = "utf8")) : (n = i,
  31643. i = void 0)
  31644. }
  31645. var r = this.length - t;
  31646. if ((void 0 === i || i > r) && (i = r),
  31647. e.length > 0 && (i < 0 || t < 0) || t > this.length)
  31648. throw new RangeError("Attempt to write outside buffer bounds");
  31649. n || (n = "utf8");
  31650. for (var o = !1; ; )
  31651. switch (n) {
  31652. case "hex":
  31653. return E(this, e, t, i);
  31654. case "utf8":
  31655. case "utf-8":
  31656. return b(this, e, t, i);
  31657. case "ascii":
  31658. return w(this, e, t, i);
  31659. case "latin1":
  31660. case "binary":
  31661. return _(this, e, t, i);
  31662. case "base64":
  31663. return T(this, e, t, i);
  31664. case "ucs2":
  31665. case "ucs-2":
  31666. case "utf16le":
  31667. case "utf-16le":
  31668. return x(this, e, t, i);
  31669. default:
  31670. if (o)
  31671. throw new TypeError("Unknown encoding: " + n);
  31672. n = ("" + n).toLowerCase(),
  31673. o = !0
  31674. }
  31675. }
  31676. ,
  31677. a.prototype.toJSON = function() {
  31678. return {
  31679. type: "Buffer",
  31680. data: Array.prototype.slice.call(this._arr || this, 0)
  31681. }
  31682. }
  31683. ;
  31684. var ee = 4096;
  31685. a.prototype.slice = function(e, t) {
  31686. var i = this.length;
  31687. e = ~~e,
  31688. t = void 0 === t ? i : ~~t,
  31689. e < 0 ? (e += i,
  31690. e < 0 && (e = 0)) : e > i && (e = i),
  31691. t < 0 ? (t += i,
  31692. t < 0 && (t = 0)) : t > i && (t = i),
  31693. t < e && (t = e);
  31694. var n;
  31695. if (a.TYPED_ARRAY_SUPPORT)
  31696. n = this.subarray(e, t),
  31697. n.__proto__ = a.prototype;
  31698. else {
  31699. var r = t - e;
  31700. n = new a(r,void 0);
  31701. for (var o = 0; o < r; ++o)
  31702. n[o] = this[o + e]
  31703. }
  31704. return n
  31705. }
  31706. ,
  31707. a.prototype.readUIntLE = function(e, t, i) {
  31708. e |= 0,
  31709. t |= 0,
  31710. i || N(e, t, this.length);
  31711. for (var n = this[e], r = 1, o = 0; ++o < t && (r *= 256); )
  31712. n += this[e + o] * r;
  31713. return n
  31714. }
  31715. ,
  31716. a.prototype.readUIntBE = function(e, t, i) {
  31717. e |= 0,
  31718. t |= 0,
  31719. i || N(e, t, this.length);
  31720. for (var n = this[e + --t], r = 1; t > 0 && (r *= 256); )
  31721. n += this[e + --t] * r;
  31722. return n
  31723. }
  31724. ,
  31725. a.prototype.readUInt8 = function(e, t) {
  31726. return t || N(e, 1, this.length),
  31727. this[e]
  31728. }
  31729. ,
  31730. a.prototype.readUInt16LE = function(e, t) {
  31731. return t || N(e, 2, this.length),
  31732. this[e] | this[e + 1] << 8
  31733. }
  31734. ,
  31735. a.prototype.readUInt16BE = function(e, t) {
  31736. return t || N(e, 2, this.length),
  31737. this[e] << 8 | this[e + 1]
  31738. }
  31739. ,
  31740. a.prototype.readUInt32LE = function(e, t) {
  31741. return t || N(e, 4, this.length),
  31742. (this[e] | this[e + 1] << 8 | this[e + 2] << 16) + 16777216 * this[e + 3]
  31743. }
  31744. ,
  31745. a.prototype.readUInt32BE = function(e, t) {
  31746. return t || N(e, 4, this.length),
  31747. 16777216 * this[e] + (this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3])
  31748. }
  31749. ,
  31750. a.prototype.readIntLE = function(e, t, i) {
  31751. e |= 0,
  31752. t |= 0,
  31753. i || N(e, t, this.length);
  31754. for (var n = this[e], r = 1, o = 0; ++o < t && (r *= 256); )
  31755. n += this[e + o] * r;
  31756. return r *= 128,
  31757. n >= r && (n -= Math.pow(2, 8 * t)),
  31758. n
  31759. }
  31760. ,
  31761. a.prototype.readIntBE = function(e, t, i) {
  31762. e |= 0,
  31763. t |= 0,
  31764. i || N(e, t, this.length);
  31765. for (var n = t, r = 1, o = this[e + --n]; n > 0 && (r *= 256); )
  31766. o += this[e + --n] * r;
  31767. return r *= 128,
  31768. o >= r && (o -= Math.pow(2, 8 * t)),
  31769. o
  31770. }
  31771. ,
  31772. a.prototype.readInt8 = function(e, t) {
  31773. return t || N(e, 1, this.length),
  31774. 128 & this[e] ? (255 - this[e] + 1) * -1 : this[e]
  31775. }
  31776. ,
  31777. a.prototype.readInt16LE = function(e, t) {
  31778. t || N(e, 2, this.length);
  31779. var i = this[e] | this[e + 1] << 8;
  31780. return 32768 & i ? 4294901760 | i : i
  31781. }
  31782. ,
  31783. a.prototype.readInt16BE = function(e, t) {
  31784. t || N(e, 2, this.length);
  31785. var i = this[e + 1] | this[e] << 8;
  31786. return 32768 & i ? 4294901760 | i : i
  31787. }
  31788. ,
  31789. a.prototype.readInt32LE = function(e, t) {
  31790. return t || N(e, 4, this.length),
  31791. this[e] | this[e + 1] << 8 | this[e + 2] << 16 | this[e + 3] << 24
  31792. }
  31793. ,
  31794. a.prototype.readInt32BE = function(e, t) {
  31795. return t || N(e, 4, this.length),
  31796. this[e] << 24 | this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3]
  31797. }
  31798. ,
  31799. a.prototype.readFloatLE = function(e, t) {
  31800. return t || N(e, 4, this.length),
  31801. J.read(this, e, !0, 23, 4)
  31802. }
  31803. ,
  31804. a.prototype.readFloatBE = function(e, t) {
  31805. return t || N(e, 4, this.length),
  31806. J.read(this, e, !1, 23, 4)
  31807. }
  31808. ,
  31809. a.prototype.readDoubleLE = function(e, t) {
  31810. return t || N(e, 8, this.length),
  31811. J.read(this, e, !0, 52, 8)
  31812. }
  31813. ,
  31814. a.prototype.readDoubleBE = function(e, t) {
  31815. return t || N(e, 8, this.length),
  31816. J.read(this, e, !1, 52, 8)
  31817. }
  31818. ,
  31819. a.prototype.writeUIntLE = function(e, t, i, n) {
  31820. if (e = +e,
  31821. t |= 0,
  31822. i |= 0,
  31823. !n) {
  31824. var r = Math.pow(2, 8 * i) - 1;
  31825. B(this, e, t, i, r, 0)
  31826. }
  31827. var o = 1
  31828. , a = 0;
  31829. for (this[t] = 255 & e; ++a < i && (o *= 256); )
  31830. this[t + a] = e / o & 255;
  31831. return t + i
  31832. }
  31833. ,
  31834. a.prototype.writeUIntBE = function(e, t, i, n) {
  31835. if (e = +e,
  31836. t |= 0,
  31837. i |= 0,
  31838. !n) {
  31839. var r = Math.pow(2, 8 * i) - 1;
  31840. B(this, e, t, i, r, 0)
  31841. }
  31842. var o = i - 1
  31843. , a = 1;
  31844. for (this[t + o] = 255 & e; --o >= 0 && (a *= 256); )
  31845. this[t + o] = e / a & 255;
  31846. return t + i
  31847. }
  31848. ,
  31849. a.prototype.writeUInt8 = function(e, t, i) {
  31850. return e = +e,
  31851. t |= 0,
  31852. i || B(this, e, t, 1, 255, 0),
  31853. a.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)),
  31854. this[t] = 255 & e,
  31855. t + 1
  31856. }
  31857. ,
  31858. a.prototype.writeUInt16LE = function(e, t, i) {
  31859. return e = +e,
  31860. t |= 0,
  31861. i || B(this, e, t, 2, 65535, 0),
  31862. a.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e,
  31863. this[t + 1] = e >>> 8) : F(this, e, t, !0),
  31864. t + 2
  31865. }
  31866. ,
  31867. a.prototype.writeUInt16BE = function(e, t, i) {
  31868. return e = +e,
  31869. t |= 0,
  31870. i || B(this, e, t, 2, 65535, 0),
  31871. a.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 8,
  31872. this[t + 1] = 255 & e) : F(this, e, t, !1),
  31873. t + 2
  31874. }
  31875. ,
  31876. a.prototype.writeUInt32LE = function(e, t, i) {
  31877. return e = +e,
  31878. t |= 0,
  31879. i || B(this, e, t, 4, 4294967295, 0),
  31880. a.TYPED_ARRAY_SUPPORT ? (this[t + 3] = e >>> 24,
  31881. this[t + 2] = e >>> 16,
  31882. this[t + 1] = e >>> 8,
  31883. this[t] = 255 & e) : V(this, e, t, !0),
  31884. t + 4
  31885. }
  31886. ,
  31887. a.prototype.writeUInt32BE = function(e, t, i) {
  31888. return e = +e,
  31889. t |= 0,
  31890. i || B(this, e, t, 4, 4294967295, 0),
  31891. a.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 24,
  31892. this[t + 1] = e >>> 16,
  31893. this[t + 2] = e >>> 8,
  31894. this[t + 3] = 255 & e) : V(this, e, t, !1),
  31895. t + 4
  31896. }
  31897. ,
  31898. a.prototype.writeIntLE = function(e, t, i, n) {
  31899. if (e = +e,
  31900. t |= 0,
  31901. !n) {
  31902. var r = Math.pow(2, 8 * i - 1);
  31903. B(this, e, t, i, r - 1, -r)
  31904. }
  31905. var o = 0
  31906. , a = 1
  31907. , s = 0;
  31908. for (this[t] = 255 & e; ++o < i && (a *= 256); )
  31909. e < 0 && 0 === s && 0 !== this[t + o - 1] && (s = 1),
  31910. this[t + o] = (e / a >> 0) - s & 255;
  31911. return t + i
  31912. }
  31913. ,
  31914. a.prototype.writeIntBE = function(e, t, i, n) {
  31915. if (e = +e,
  31916. t |= 0,
  31917. !n) {
  31918. var r = Math.pow(2, 8 * i - 1);
  31919. B(this, e, t, i, r - 1, -r)
  31920. }
  31921. var o = i - 1
  31922. , a = 1
  31923. , s = 0;
  31924. for (this[t + o] = 255 & e; --o >= 0 && (a *= 256); )
  31925. e < 0 && 0 === s && 0 !== this[t + o + 1] && (s = 1),
  31926. this[t + o] = (e / a >> 0) - s & 255;
  31927. return t + i
  31928. }
  31929. ,
  31930. a.prototype.writeInt8 = function(e, t, i) {
  31931. return e = +e,
  31932. t |= 0,
  31933. i || B(this, e, t, 1, 127, -128),
  31934. a.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)),
  31935. e < 0 && (e = 255 + e + 1),
  31936. this[t] = 255 & e,
  31937. t + 1
  31938. }
  31939. ,
  31940. a.prototype.writeInt16LE = function(e, t, i) {
  31941. return e = +e,
  31942. t |= 0,
  31943. i || B(this, e, t, 2, 32767, -32768),
  31944. a.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e,
  31945. this[t + 1] = e >>> 8) : F(this, e, t, !0),
  31946. t + 2
  31947. }
  31948. ,
  31949. a.prototype.writeInt16BE = function(e, t, i) {
  31950. return e = +e,
  31951. t |= 0,
  31952. i || B(this, e, t, 2, 32767, -32768),
  31953. a.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 8,
  31954. this[t + 1] = 255 & e) : F(this, e, t, !1),
  31955. t + 2
  31956. }
  31957. ,
  31958. a.prototype.writeInt32LE = function(e, t, i) {
  31959. return e = +e,
  31960. t |= 0,
  31961. i || B(this, e, t, 4, 2147483647, -2147483648),
  31962. a.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e,
  31963. this[t + 1] = e >>> 8,
  31964. this[t + 2] = e >>> 16,
  31965. this[t + 3] = e >>> 24) : V(this, e, t, !0),
  31966. t + 4
  31967. }
  31968. ,
  31969. a.prototype.writeInt32BE = function(e, t, i) {
  31970. return e = +e,
  31971. t |= 0,
  31972. i || B(this, e, t, 4, 2147483647, -2147483648),
  31973. e < 0 && (e = 4294967295 + e + 1),
  31974. a.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 24,
  31975. this[t + 1] = e >>> 16,
  31976. this[t + 2] = e >>> 8,
  31977. this[t + 3] = 255 & e) : V(this, e, t, !1),
  31978. t + 4
  31979. }
  31980. ,
  31981. a.prototype.writeFloatLE = function(e, t, i) {
  31982. return k(this, e, t, !0, i)
  31983. }
  31984. ,
  31985. a.prototype.writeFloatBE = function(e, t, i) {
  31986. return k(this, e, t, !1, i)
  31987. }
  31988. ,
  31989. a.prototype.writeDoubleLE = function(e, t, i) {
  31990. return H(this, e, t, !0, i)
  31991. }
  31992. ,
  31993. a.prototype.writeDoubleBE = function(e, t, i) {
  31994. return H(this, e, t, !1, i)
  31995. }
  31996. ,
  31997. a.prototype.copy = function(e, t, i, n) {
  31998. if (i || (i = 0),
  31999. n || 0 === n || (n = this.length),
  32000. t >= e.length && (t = e.length),
  32001. t || (t = 0),
  32002. n > 0 && n < i && (n = i),
  32003. n === i)
  32004. return 0;
  32005. if (0 === e.length || 0 === this.length)
  32006. return 0;
  32007. if (t < 0)
  32008. throw new RangeError("targetStart out of bounds");
  32009. if (i < 0 || i >= this.length)
  32010. throw new RangeError("sourceStart out of bounds");
  32011. if (n < 0)
  32012. throw new RangeError("sourceEnd out of bounds");
  32013. n > this.length && (n = this.length),
  32014. e.length - t < n - i && (n = e.length - t + i);
  32015. var r, o = n - i;
  32016. if (this === e && i < t && t < n)
  32017. for (r = o - 1; r >= 0; --r)
  32018. e[r + t] = this[r + i];
  32019. else if (o < 1e3 || !a.TYPED_ARRAY_SUPPORT)
  32020. for (r = 0; r < o; ++r)
  32021. e[r + t] = this[r + i];
  32022. else
  32023. Uint8Array.prototype.set.call(e, this.subarray(i, i + o), t);
  32024. return o
  32025. }
  32026. ,
  32027. a.prototype.fill = function(e, t, i, n) {
  32028. if ("string" == typeof e) {
  32029. if ("string" == typeof t ? (n = t,
  32030. t = 0,
  32031. i = this.length) : "string" == typeof i && (n = i,
  32032. i = this.length),
  32033. 1 === e.length) {
  32034. var r = e.charCodeAt(0);
  32035. r < 256 && (e = r)
  32036. }
  32037. if (void 0 !== n && "string" != typeof n)
  32038. throw new TypeError("encoding must be a string");
  32039. if ("string" == typeof n && !a.isEncoding(n))
  32040. throw new TypeError("Unknown encoding: " + n)
  32041. } else
  32042. "number" == typeof e && (e &= 255);
  32043. if (t < 0 || this.length < t || this.length < i)
  32044. throw new RangeError("Out of range index");
  32045. if (i <= t)
  32046. return this;
  32047. t >>>= 0,
  32048. i = void 0 === i ? this.length : i >>> 0,
  32049. e || (e = 0);
  32050. var o;
  32051. if ("number" == typeof e)
  32052. for (o = t; o < i; ++o)
  32053. this[o] = e;
  32054. else {
  32055. var s = a.isBuffer(e) ? e : j(new a(e,n).toString())
  32056. , l = s.length;
  32057. for (o = 0; o < i - t; ++o)
  32058. this[o + t] = s[o % l]
  32059. }
  32060. return this
  32061. }
  32062. ;
  32063. var te = /[^+\/0-9A-Za-z-_]/g
  32064. }
  32065. ).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
  32066. }
  32067. , {
  32068. "base64-js": 199,
  32069. ieee754: 200,
  32070. isarray: 201
  32071. }],
  32072. 199: [function(e, t, i) {
  32073. "use strict";
  32074. function n(e) {
  32075. var t = e.length;
  32076. if (t % 4 > 0)
  32077. throw new Error("Invalid string. Length must be a multiple of 4");
  32078. return "=" === e[t - 2] ? 2 : "=" === e[t - 1] ? 1 : 0
  32079. }
  32080. function r(e) {
  32081. return 3 * e.length / 4 - n(e)
  32082. }
  32083. function o(e) {
  32084. var t, i, r, o, a, s, l = e.length;
  32085. a = n(e),
  32086. s = new u(3 * l / 4 - a),
  32087. r = a > 0 ? l - 4 : l;
  32088. var c = 0;
  32089. for (t = 0,
  32090. i = 0; t < r; t += 4,
  32091. i += 3)
  32092. o = h[e.charCodeAt(t)] << 18 | h[e.charCodeAt(t + 1)] << 12 | h[e.charCodeAt(t + 2)] << 6 | h[e.charCodeAt(t + 3)],
  32093. s[c++] = o >> 16 & 255,
  32094. s[c++] = o >> 8 & 255,
  32095. s[c++] = 255 & o;
  32096. return 2 === a ? (o = h[e.charCodeAt(t)] << 2 | h[e.charCodeAt(t + 1)] >> 4,
  32097. s[c++] = 255 & o) : 1 === a && (o = h[e.charCodeAt(t)] << 10 | h[e.charCodeAt(t + 1)] << 4 | h[e.charCodeAt(t + 2)] >> 2,
  32098. s[c++] = o >> 8 & 255,
  32099. s[c++] = 255 & o),
  32100. s
  32101. }
  32102. function a(e) {
  32103. return c[e >> 18 & 63] + c[e >> 12 & 63] + c[e >> 6 & 63] + c[63 & e]
  32104. }
  32105. function s(e, t, i) {
  32106. for (var n, r = [], o = t; o < i; o += 3)
  32107. n = (e[o] << 16) + (e[o + 1] << 8) + e[o + 2],
  32108. r.push(a(n));
  32109. return r.join("")
  32110. }
  32111. function l(e) {
  32112. for (var t, i = e.length, n = i % 3, r = "", o = [], a = 16383, l = 0, h = i - n; l < h; l += a)
  32113. o.push(s(e, l, l + a > h ? h : l + a));
  32114. return 1 === n ? (t = e[i - 1],
  32115. r += c[t >> 2],
  32116. r += c[t << 4 & 63],
  32117. r += "==") : 2 === n && (t = (e[i - 2] << 8) + e[i - 1],
  32118. r += c[t >> 10],
  32119. r += c[t >> 4 & 63],
  32120. r += c[t << 2 & 63],
  32121. r += "="),
  32122. o.push(r),
  32123. o.join("")
  32124. }
  32125. i.byteLength = r,
  32126. i.toByteArray = o,
  32127. i.fromByteArray = l;
  32128. for (var c = [], h = [], u = "undefined" != typeof Uint8Array ? Uint8Array : Array, d = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", p = 0, f = d.length; p < f; ++p)
  32129. c[p] = d[p],
  32130. h[d.charCodeAt(p)] = p;
  32131. h["-".charCodeAt(0)] = 62,
  32132. h["_".charCodeAt(0)] = 63
  32133. }
  32134. , {}],
  32135. 200: [function(e, t, i) {
  32136. i.read = function(e, t, i, n, r) {
  32137. 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];
  32138. for (u += d,
  32139. o = p & (1 << -h) - 1,
  32140. p >>= -h,
  32141. h += s; h > 0; o = 256 * o + e[t + u],
  32142. u += d,
  32143. h -= 8)
  32144. ;
  32145. for (a = o & (1 << -h) - 1,
  32146. o >>= -h,
  32147. h += n; h > 0; a = 256 * a + e[t + u],
  32148. u += d,
  32149. h -= 8)
  32150. ;
  32151. if (0 === o)
  32152. o = 1 - c;
  32153. else {
  32154. if (o === l)
  32155. return a ? NaN : (p ? -1 : 1) * (1 / 0);
  32156. a += Math.pow(2, n),
  32157. o -= c
  32158. }
  32159. return (p ? -1 : 1) * a * Math.pow(2, o - n)
  32160. }
  32161. ,
  32162. i.write = function(e, t, i, n, r, o) {
  32163. 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;
  32164. for (t = Math.abs(t),
  32165. isNaN(t) || t === 1 / 0 ? (s = isNaN(t) ? 1 : 0,
  32166. a = h) : (a = Math.floor(Math.log(t) / Math.LN2),
  32167. t * (l = Math.pow(2, -a)) < 1 && (a--,
  32168. l *= 2),
  32169. t += a + u >= 1 ? d / l : d * Math.pow(2, 1 - u),
  32170. t * l >= 2 && (a++,
  32171. l /= 2),
  32172. a + u >= h ? (s = 0,
  32173. a = h) : a + u >= 1 ? (s = (t * l - 1) * Math.pow(2, r),
  32174. a += u) : (s = t * Math.pow(2, u - 1) * Math.pow(2, r),
  32175. a = 0)); r >= 8; e[i + p] = 255 & s,
  32176. p += f,
  32177. s /= 256,
  32178. r -= 8)
  32179. ;
  32180. for (a = a << r | s,
  32181. c += r; c > 0; e[i + p] = 255 & a,
  32182. p += f,
  32183. a /= 256,
  32184. c -= 8)
  32185. ;
  32186. e[i + p - f] |= 128 * g
  32187. }
  32188. }
  32189. , {}],
  32190. 201: [function(e, t, i) {
  32191. var n = {}.toString;
  32192. t.exports = Array.isArray || function(e) {
  32193. return "[object Array]" == n.call(e)
  32194. }
  32195. }
  32196. , {}],
  32197. 202: [function(e, t, i) {
  32198. function n() {
  32199. this._events = this._events || {},
  32200. this._maxListeners = this._maxListeners || void 0
  32201. }
  32202. function r(e) {
  32203. return "function" == typeof e
  32204. }
  32205. function o(e) {
  32206. return "number" == typeof e
  32207. }
  32208. function a(e) {
  32209. return "object" == typeof e && null !== e
  32210. }
  32211. function s(e) {
  32212. return void 0 === e
  32213. }
  32214. t.exports = n,
  32215. n.EventEmitter = n,
  32216. n.prototype._events = void 0,
  32217. n.prototype._maxListeners = void 0,
  32218. n.defaultMaxListeners = 10,
  32219. n.prototype.setMaxListeners = function(e) {
  32220. if (!o(e) || e < 0 || isNaN(e))
  32221. throw TypeError("n must be a positive number");
  32222. return this._maxListeners = e,
  32223. this
  32224. }
  32225. ,
  32226. n.prototype.emit = function(e) {
  32227. var t, i, n, o, l, c;
  32228. if (this._events || (this._events = {}),
  32229. "error" === e && (!this._events.error || a(this._events.error) && !this._events.error.length)) {
  32230. if (t = arguments[1],
  32231. t instanceof Error)
  32232. throw t;
  32233. var h = new Error('Uncaught, unspecified "error" event. (' + t + ")");
  32234. throw h.context = t,
  32235. h
  32236. }
  32237. if (i = this._events[e],
  32238. s(i))
  32239. return !1;
  32240. if (r(i))
  32241. switch (arguments.length) {
  32242. case 1:
  32243. i.call(this);
  32244. break;
  32245. case 2:
  32246. i.call(this, arguments[1]);
  32247. break;
  32248. case 3:
  32249. i.call(this, arguments[1], arguments[2]);
  32250. break;
  32251. default:
  32252. o = Array.prototype.slice.call(arguments, 1),
  32253. i.apply(this, o)
  32254. }
  32255. else if (a(i))
  32256. for (o = Array.prototype.slice.call(arguments, 1),
  32257. c = i.slice(),
  32258. n = c.length,
  32259. l = 0; l < n; l++)
  32260. c[l].apply(this, o);
  32261. return !0
  32262. }
  32263. ,
  32264. n.prototype.addListener = function(e, t) {
  32265. var i;
  32266. if (!r(t))
  32267. throw TypeError("listener must be a function");
  32268. return this._events || (this._events = {}),
  32269. this._events.newListener && this.emit("newListener", e, r(t.listener) ? t.listener : t),
  32270. this._events[e] ? a(this._events[e]) ? this._events[e].push(t) : this._events[e] = [this._events[e], t] : this._events[e] = t,
  32271. a(this._events[e]) && !this._events[e].warned && (i = s(this._maxListeners) ? n.defaultMaxListeners : this._maxListeners,
  32272. i && i > 0 && this._events[e].length > i && (this._events[e].warned = !0,
  32273. console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.", this._events[e].length),
  32274. "function" == typeof console.trace && console.trace())),
  32275. this
  32276. }
  32277. ,
  32278. n.prototype.on = n.prototype.addListener,
  32279. n.prototype.once = function(e, t) {
  32280. function i() {
  32281. this.removeListener(e, i),
  32282. n || (n = !0,
  32283. t.apply(this, arguments))
  32284. }
  32285. if (!r(t))
  32286. throw TypeError("listener must be a function");
  32287. var n = !1;
  32288. return i.listener = t,
  32289. this.on(e, i),
  32290. this
  32291. }
  32292. ,
  32293. n.prototype.removeListener = function(e, t) {
  32294. var i, n, o, s;
  32295. if (!r(t))
  32296. throw TypeError("listener must be a function");
  32297. if (!this._events || !this._events[e])
  32298. return this;
  32299. if (i = this._events[e],
  32300. o = i.length,
  32301. n = -1,
  32302. i === t || r(i.listener) && i.listener === t)
  32303. delete this._events[e],
  32304. this._events.removeListener && this.emit("removeListener", e, t);
  32305. else if (a(i)) {
  32306. for (s = o; s-- > 0; )
  32307. if (i[s] === t || i[s].listener && i[s].listener === t) {
  32308. n = s;
  32309. break
  32310. }
  32311. if (n < 0)
  32312. return this;
  32313. 1 === i.length ? (i.length = 0,
  32314. delete this._events[e]) : i.splice(n, 1),
  32315. this._events.removeListener && this.emit("removeListener", e, t)
  32316. }
  32317. return this
  32318. }
  32319. ,
  32320. n.prototype.removeAllListeners = function(e) {
  32321. var t, i;
  32322. if (!this._events)
  32323. return this;
  32324. if (!this._events.removeListener)
  32325. return 0 === arguments.length ? this._events = {} : this._events[e] && delete this._events[e],
  32326. this;
  32327. if (0 === arguments.length) {
  32328. for (t in this._events)
  32329. "removeListener" !== t && this.removeAllListeners(t);
  32330. return this.removeAllListeners("removeListener"),
  32331. this._events = {},
  32332. this
  32333. }
  32334. if (i = this._events[e],
  32335. r(i))
  32336. this.removeListener(e, i);
  32337. else if (i)
  32338. for (; i.length; )
  32339. this.removeListener(e, i[i.length - 1]);
  32340. return delete this._events[e],
  32341. this
  32342. }
  32343. ,
  32344. n.prototype.listeners = function(e) {
  32345. var t;
  32346. return t = this._events && this._events[e] ? r(this._events[e]) ? [this._events[e]] : this._events[e].slice() : []
  32347. }
  32348. ,
  32349. n.prototype.listenerCount = function(e) {
  32350. if (this._events) {
  32351. var t = this._events[e];
  32352. if (r(t))
  32353. return 1;
  32354. if (t)
  32355. return t.length
  32356. }
  32357. return 0
  32358. }
  32359. ,
  32360. n.listenerCount = function(e, t) {
  32361. return e.listenerCount(t)
  32362. }
  32363. }
  32364. , {}],
  32365. 203: [function(e, t, i) {
  32366. function n() {
  32367. throw new Error("setTimeout has not been defined")
  32368. }
  32369. function r() {
  32370. throw new Error("clearTimeout has not been defined")
  32371. }
  32372. function o(e) {
  32373. if (u === setTimeout)
  32374. return setTimeout(e, 0);
  32375. if ((u === n || !u) && setTimeout)
  32376. return u = setTimeout,
  32377. setTimeout(e, 0);
  32378. try {
  32379. return u(e, 0)
  32380. } catch (t) {
  32381. try {
  32382. return u.call(null, e, 0)
  32383. } catch (t) {
  32384. return u.call(this, e, 0)
  32385. }
  32386. }
  32387. }
  32388. function a(e) {
  32389. if (d === clearTimeout)
  32390. return clearTimeout(e);
  32391. if ((d === r || !d) && clearTimeout)
  32392. return d = clearTimeout,
  32393. clearTimeout(e);
  32394. try {
  32395. return d(e)
  32396. } catch (t) {
  32397. try {
  32398. return d.call(null, e)
  32399. } catch (t) {
  32400. return d.call(this, e)
  32401. }
  32402. }
  32403. }
  32404. function s() {
  32405. m && f && (m = !1,
  32406. f.length ? g = f.concat(g) : v = -1,
  32407. g.length && l())
  32408. }
  32409. function l() {
  32410. if (!m) {
  32411. var e = o(s);
  32412. m = !0;
  32413. for (var t = g.length; t; ) {
  32414. for (f = g,
  32415. g = []; ++v < t; )
  32416. f && f[v].run();
  32417. v = -1,
  32418. t = g.length
  32419. }
  32420. f = null,
  32421. m = !1,
  32422. a(e)
  32423. }
  32424. }
  32425. function c(e, t) {
  32426. this.fun = e,
  32427. this.array = t
  32428. }
  32429. function h() {}
  32430. var u, d, p = t.exports = {};
  32431. !function() {
  32432. try {
  32433. u = "function" == typeof setTimeout ? setTimeout : n
  32434. } catch (e) {
  32435. u = n
  32436. }
  32437. try {
  32438. d = "function" == typeof clearTimeout ? clearTimeout : r
  32439. } catch (e) {
  32440. d = r
  32441. }
  32442. }();
  32443. var f, g = [], m = !1, v = -1;
  32444. p.nextTick = function(e) {
  32445. var t = new Array(arguments.length - 1);
  32446. if (arguments.length > 1)
  32447. for (var i = 1; i < arguments.length; i++)
  32448. t[i - 1] = arguments[i];
  32449. g.push(new c(e,t)),
  32450. 1 !== g.length || m || o(l)
  32451. }
  32452. ,
  32453. c.prototype.run = function() {
  32454. this.fun.apply(null, this.array)
  32455. }
  32456. ,
  32457. p.title = "browser",
  32458. p.browser = !0,
  32459. p.env = {},
  32460. p.argv = [],
  32461. p.version = "",
  32462. p.versions = {},
  32463. p.on = h,
  32464. p.addListener = h,
  32465. p.once = h,
  32466. p.off = h,
  32467. p.removeListener = h,
  32468. p.removeAllListeners = h,
  32469. p.emit = h,
  32470. p.binding = function(e) {
  32471. throw new Error("process.binding is not supported")
  32472. }
  32473. ,
  32474. p.cwd = function() {
  32475. return "/"
  32476. }
  32477. ,
  32478. p.chdir = function(e) {
  32479. throw new Error("process.chdir is not supported")
  32480. }
  32481. ,
  32482. p.umask = function() {
  32483. return 0
  32484. }
  32485. }
  32486. , {}],
  32487. 204: [function(e, t, i) {
  32488. (function(e) {
  32489. !function(n) {
  32490. function r(e) {
  32491. throw new RangeError(L[e])
  32492. }
  32493. function o(e, t) {
  32494. for (var i = e.length, n = []; i--; )
  32495. n[i] = t(e[i]);
  32496. return n
  32497. }
  32498. function a(e, t) {
  32499. var i = e.split("@")
  32500. , n = "";
  32501. i.length > 1 && (n = i[0] + "@",
  32502. e = i[1]),
  32503. e = e.replace(O, ".");
  32504. var r = e.split(".")
  32505. , a = o(r, t).join(".");
  32506. return n + a
  32507. }
  32508. function s(e) {
  32509. for (var t, i, n = [], r = 0, o = e.length; r < o; )
  32510. t = e.charCodeAt(r++),
  32511. t >= 55296 && t <= 56319 && r < o ? (i = e.charCodeAt(r++),
  32512. 56320 == (64512 & i) ? n.push(((1023 & t) << 10) + (1023 & i) + 65536) : (n.push(t),
  32513. r--)) : n.push(t);
  32514. return n
  32515. }
  32516. function l(e) {
  32517. return o(e, function(e) {
  32518. var t = "";
  32519. return e > 65535 && (e -= 65536,
  32520. t += B(e >>> 10 & 1023 | 55296),
  32521. e = 56320 | 1023 & e),
  32522. t += B(e)
  32523. }).join("")
  32524. }
  32525. function c(e) {
  32526. return e - 48 < 10 ? e - 22 : e - 65 < 26 ? e - 65 : e - 97 < 26 ? e - 97 : E
  32527. }
  32528. function h(e, t) {
  32529. return e + 22 + 75 * (e < 26) - ((0 != t) << 5)
  32530. }
  32531. function u(e, t, i) {
  32532. var n = 0;
  32533. for (e = i ? N(e / T) : e >> 1,
  32534. e += N(e / t); e > D * w >> 1; n += E)
  32535. e = N(e / D);
  32536. return N(n + (D + 1) * e / (e + _))
  32537. }
  32538. function d(e) {
  32539. var t, i, n, o, a, s, h, d, p, f, g = [], m = e.length, v = 0, A = S, y = x;
  32540. for (i = e.lastIndexOf(M),
  32541. i < 0 && (i = 0),
  32542. n = 0; n < i; ++n)
  32543. e.charCodeAt(n) >= 128 && r("not-basic"),
  32544. g.push(e.charCodeAt(n));
  32545. for (o = i > 0 ? i + 1 : 0; o < m; ) {
  32546. for (a = v,
  32547. s = 1,
  32548. h = E; o >= m && r("invalid-input"),
  32549. d = c(e.charCodeAt(o++)),
  32550. (d >= E || d > N((I - v) / s)) && r("overflow"),
  32551. v += d * s,
  32552. p = h <= y ? b : h >= y + w ? w : h - y,
  32553. !(d < p); h += E)
  32554. f = E - p,
  32555. s > N(I / f) && r("overflow"),
  32556. s *= f;
  32557. t = g.length + 1,
  32558. y = u(v - a, t, 0 == a),
  32559. N(v / t) > I - A && r("overflow"),
  32560. A += N(v / t),
  32561. v %= t,
  32562. g.splice(v++, 0, A)
  32563. }
  32564. return l(g)
  32565. }
  32566. function p(e) {
  32567. var t, i, n, o, a, l, c, d, p, f, g, m, v, A, y, C = [];
  32568. for (e = s(e),
  32569. m = e.length,
  32570. t = S,
  32571. i = 0,
  32572. a = x,
  32573. l = 0; l < m; ++l)
  32574. g = e[l],
  32575. g < 128 && C.push(B(g));
  32576. for (n = o = C.length,
  32577. o && C.push(M); n < m; ) {
  32578. for (c = I,
  32579. l = 0; l < m; ++l)
  32580. g = e[l],
  32581. g >= t && g < c && (c = g);
  32582. for (v = n + 1,
  32583. c - t > N((I - i) / v) && r("overflow"),
  32584. i += (c - t) * v,
  32585. t = c,
  32586. l = 0; l < m; ++l)
  32587. if (g = e[l],
  32588. g < t && ++i > I && r("overflow"),
  32589. g == t) {
  32590. for (d = i,
  32591. p = E; f = p <= a ? b : p >= a + w ? w : p - a,
  32592. !(d < f); p += E)
  32593. y = d - f,
  32594. A = E - f,
  32595. C.push(B(h(f + y % A, 0))),
  32596. d = N(y / A);
  32597. C.push(B(h(d, 0))),
  32598. a = u(i, v, n == o),
  32599. i = 0,
  32600. ++n
  32601. }
  32602. ++i,
  32603. ++t
  32604. }
  32605. return C.join("")
  32606. }
  32607. function f(e) {
  32608. return a(e, function(e) {
  32609. return R.test(e) ? d(e.slice(4).toLowerCase()) : e
  32610. })
  32611. }
  32612. function g(e) {
  32613. return a(e, function(e) {
  32614. return P.test(e) ? "xn--" + p(e) : e
  32615. })
  32616. }
  32617. var m = "object" == typeof i && i && !i.nodeType && i
  32618. , v = "object" == typeof t && t && !t.nodeType && t
  32619. , A = "object" == typeof e && e;
  32620. A.global !== A && A.window !== A && A.self !== A || (n = A);
  32621. 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 = {
  32622. overflow: "Overflow: input needs wider integers to process",
  32623. "not-basic": "Illegal input >= 0x80 (not a basic code point)",
  32624. "invalid-input": "Invalid input"
  32625. }, D = E - b, N = Math.floor, B = String.fromCharCode;
  32626. if (y = {
  32627. version: "1.4.1",
  32628. ucs2: {
  32629. decode: s,
  32630. encode: l
  32631. },
  32632. decode: d,
  32633. encode: p,
  32634. toASCII: g,
  32635. toUnicode: f
  32636. },
  32637. "function" == typeof define && "object" == typeof define.amd && define.amd)
  32638. define("punycode", function() {
  32639. return y
  32640. });
  32641. else if (m && v)
  32642. if (t.exports == m)
  32643. v.exports = y;
  32644. else
  32645. for (C in y)
  32646. y.hasOwnProperty(C) && (m[C] = y[C]);
  32647. else
  32648. n.punycode = y
  32649. }(this)
  32650. }
  32651. ).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
  32652. }
  32653. , {}],
  32654. 205: [function(e, t, i) {
  32655. "use strict";
  32656. function n(e, t) {
  32657. return Object.prototype.hasOwnProperty.call(e, t)
  32658. }
  32659. t.exports = function(e, t, i, o) {
  32660. t = t || "&",
  32661. i = i || "=";
  32662. var a = {};
  32663. if ("string" != typeof e || 0 === e.length)
  32664. return a;
  32665. var s = /\+/g;
  32666. e = e.split(t);
  32667. var l = 1e3;
  32668. o && "number" == typeof o.maxKeys && (l = o.maxKeys);
  32669. var c = e.length;
  32670. l > 0 && c > l && (c = l);
  32671. for (var h = 0; h < c; ++h) {
  32672. var u, d, p, f, g = e[h].replace(s, "%20"), m = g.indexOf(i);
  32673. m >= 0 ? (u = g.substr(0, m),
  32674. d = g.substr(m + 1)) : (u = g,
  32675. d = ""),
  32676. p = decodeURIComponent(u),
  32677. f = decodeURIComponent(d),
  32678. n(a, p) ? r(a[p]) ? a[p].push(f) : a[p] = [a[p], f] : a[p] = f
  32679. }
  32680. return a
  32681. }
  32682. ;
  32683. var r = Array.isArray || function(e) {
  32684. return "[object Array]" === Object.prototype.toString.call(e)
  32685. }
  32686. }
  32687. , {}],
  32688. 206: [function(e, t, i) {
  32689. "use strict";
  32690. function n(e, t) {
  32691. if (e.map)
  32692. return e.map(t);
  32693. for (var i = [], n = 0; n < e.length; n++)
  32694. i.push(t(e[n], n));
  32695. return i
  32696. }
  32697. var r = function(e) {
  32698. switch (typeof e) {
  32699. case "string":
  32700. return e;
  32701. case "boolean":
  32702. return e ? "true" : "false";
  32703. case "number":
  32704. return isFinite(e) ? e : "";
  32705. default:
  32706. return ""
  32707. }
  32708. };
  32709. t.exports = function(e, t, i, s) {
  32710. return t = t || "&",
  32711. i = i || "=",
  32712. null === e && (e = void 0),
  32713. "object" == typeof e ? n(a(e), function(a) {
  32714. var s = encodeURIComponent(r(a)) + i;
  32715. return o(e[a]) ? n(e[a], function(e) {
  32716. return s + encodeURIComponent(r(e))
  32717. }).join(t) : s + encodeURIComponent(r(e[a]))
  32718. }).join(t) : s ? encodeURIComponent(r(s)) + i + encodeURIComponent(r(e)) : ""
  32719. }
  32720. ;
  32721. var o = Array.isArray || function(e) {
  32722. return "[object Array]" === Object.prototype.toString.call(e)
  32723. }
  32724. , a = Object.keys || function(e) {
  32725. var t = [];
  32726. for (var i in e)
  32727. Object.prototype.hasOwnProperty.call(e, i) && t.push(i);
  32728. return t
  32729. }
  32730. }
  32731. , {}],
  32732. 207: [function(e, t, i) {
  32733. "use strict";
  32734. i.decode = i.parse = e("./decode"),
  32735. i.encode = i.stringify = e("./encode")
  32736. }
  32737. , {
  32738. "./decode": 205,
  32739. "./encode": 206
  32740. }],
  32741. 208: [function(e, t, i) {
  32742. "use strict";
  32743. function n() {
  32744. this.protocol = null,
  32745. this.slashes = null,
  32746. this.auth = null,
  32747. this.host = null,
  32748. this.port = null,
  32749. this.hostname = null,
  32750. this.hash = null,
  32751. this.search = null,
  32752. this.query = null,
  32753. this.pathname = null,
  32754. this.path = null,
  32755. this.href = null
  32756. }
  32757. function r(e, t, i) {
  32758. if (e && c.isObject(e) && e instanceof n)
  32759. return e;
  32760. var r = new n;
  32761. return r.parse(e, t, i),
  32762. r
  32763. }
  32764. function o(e) {
  32765. return c.isString(e) && (e = r(e)),
  32766. e instanceof n ? e.format() : n.prototype.format.call(e)
  32767. }
  32768. function a(e, t) {
  32769. return r(e, !1, !0).resolve(t)
  32770. }
  32771. function s(e, t) {
  32772. return e ? r(e, !1, !0).resolveObject(t) : t
  32773. }
  32774. var l = e("punycode")
  32775. , c = e("./util");
  32776. i.parse = r,
  32777. i.resolve = a,
  32778. i.resolveObject = s,
  32779. i.format = o,
  32780. i.Url = n;
  32781. var h = /^([a-z0-9.+-]+:)/i
  32782. , u = /:[0-9]*$/
  32783. , d = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/
  32784. , p = ["<", ">", '"', "`", " ", "\r", "\n", "\t"]
  32785. , f = ["{", "}", "|", "\\", "^", "`"].concat(p)
  32786. , g = ["'"].concat(f)
  32787. , m = ["%", "/", "?", ";", "#"].concat(g)
  32788. , v = ["/", "?", "#"]
  32789. , A = 255
  32790. , y = /^[+a-z0-9A-Z_-]{0,63}$/
  32791. , C = /^([+a-z0-9A-Z_-]{0,63})(.*)$/
  32792. , I = {
  32793. javascript: !0,
  32794. "javascript:": !0
  32795. }
  32796. , E = {
  32797. javascript: !0,
  32798. "javascript:": !0
  32799. }
  32800. , b = {
  32801. http: !0,
  32802. https: !0,
  32803. ftp: !0,
  32804. gopher: !0,
  32805. file: !0,
  32806. "http:": !0,
  32807. "https:": !0,
  32808. "ftp:": !0,
  32809. "gopher:": !0,
  32810. "file:": !0
  32811. }
  32812. , w = e("querystring");
  32813. n.prototype.parse = function(e, t, i) {
  32814. if (!c.isString(e))
  32815. throw new TypeError("Parameter 'url' must be a string, not " + typeof e);
  32816. var n = e.indexOf("?")
  32817. , r = n !== -1 && n < e.indexOf("#") ? "?" : "#"
  32818. , o = e.split(r)
  32819. , a = /\\/g;
  32820. o[0] = o[0].replace(a, "/"),
  32821. e = o.join(r);
  32822. var s = e;
  32823. if (s = s.trim(),
  32824. !i && 1 === e.split("#").length) {
  32825. var u = d.exec(s);
  32826. if (u)
  32827. return this.path = s,
  32828. this.href = s,
  32829. this.pathname = u[1],
  32830. u[2] ? (this.search = u[2],
  32831. t ? this.query = w.parse(this.search.substr(1)) : this.query = this.search.substr(1)) : t && (this.search = "",
  32832. this.query = {}),
  32833. this
  32834. }
  32835. var p = h.exec(s);
  32836. if (p) {
  32837. p = p[0];
  32838. var f = p.toLowerCase();
  32839. this.protocol = f,
  32840. s = s.substr(p.length)
  32841. }
  32842. if (i || p || s.match(/^\/\/[^@\/]+@[^@\/]+/)) {
  32843. var _ = "//" === s.substr(0, 2);
  32844. !_ || p && E[p] || (s = s.substr(2),
  32845. this.slashes = !0)
  32846. }
  32847. if (!E[p] && (_ || p && !b[p])) {
  32848. for (var T = -1, x = 0; x < v.length; x++) {
  32849. var S = s.indexOf(v[x]);
  32850. S !== -1 && (T === -1 || S < T) && (T = S)
  32851. }
  32852. var M, R;
  32853. R = T === -1 ? s.lastIndexOf("@") : s.lastIndexOf("@", T),
  32854. R !== -1 && (M = s.slice(0, R),
  32855. s = s.slice(R + 1),
  32856. this.auth = decodeURIComponent(M)),
  32857. T = -1;
  32858. for (var x = 0; x < m.length; x++) {
  32859. var S = s.indexOf(m[x]);
  32860. S !== -1 && (T === -1 || S < T) && (T = S)
  32861. }
  32862. T === -1 && (T = s.length),
  32863. this.host = s.slice(0, T),
  32864. s = s.slice(T),
  32865. this.parseHost(),
  32866. this.hostname = this.hostname || "";
  32867. var P = "[" === this.hostname[0] && "]" === this.hostname[this.hostname.length - 1];
  32868. if (!P)
  32869. for (var O = this.hostname.split(/\./), x = 0, L = O.length; x < L; x++) {
  32870. var D = O[x];
  32871. if (D && !D.match(y)) {
  32872. for (var N = "", B = 0, F = D.length; B < F; B++)
  32873. N += D.charCodeAt(B) > 127 ? "x" : D[B];
  32874. if (!N.match(y)) {
  32875. var V = O.slice(0, x)
  32876. , U = O.slice(x + 1)
  32877. , k = D.match(C);
  32878. k && (V.push(k[1]),
  32879. U.unshift(k[2])),
  32880. U.length && (s = "/" + U.join(".") + s),
  32881. this.hostname = V.join(".");
  32882. break
  32883. }
  32884. }
  32885. }
  32886. this.hostname.length > A ? this.hostname = "" : this.hostname = this.hostname.toLowerCase(),
  32887. P || (this.hostname = l.toASCII(this.hostname));
  32888. var H = this.port ? ":" + this.port : ""
  32889. , G = this.hostname || "";
  32890. this.host = G + H,
  32891. this.href += this.host,
  32892. P && (this.hostname = this.hostname.substr(1, this.hostname.length - 2),
  32893. "/" !== s[0] && (s = "/" + s))
  32894. }
  32895. if (!I[f])
  32896. for (var x = 0, L = g.length; x < L; x++) {
  32897. var z = g[x];
  32898. if (s.indexOf(z) !== -1) {
  32899. var W = encodeURIComponent(z);
  32900. W === z && (W = escape(z)),
  32901. s = s.split(z).join(W)
  32902. }
  32903. }
  32904. var j = s.indexOf("#");
  32905. j !== -1 && (this.hash = s.substr(j),
  32906. s = s.slice(0, j));
  32907. var Y = s.indexOf("?");
  32908. if (Y !== -1 ? (this.search = s.substr(Y),
  32909. this.query = s.substr(Y + 1),
  32910. t && (this.query = w.parse(this.query)),
  32911. s = s.slice(0, Y)) : t && (this.search = "",
  32912. this.query = {}),
  32913. s && (this.pathname = s),
  32914. b[f] && this.hostname && !this.pathname && (this.pathname = "/"),
  32915. this.pathname || this.search) {
  32916. var H = this.pathname || ""
  32917. , X = this.search || "";
  32918. this.path = H + X
  32919. }
  32920. return this.href = this.format(),
  32921. this
  32922. }
  32923. ,
  32924. n.prototype.format = function() {
  32925. var e = this.auth || "";
  32926. e && (e = encodeURIComponent(e),
  32927. e = e.replace(/%3A/i, ":"),
  32928. e += "@");
  32929. var t = this.protocol || ""
  32930. , i = this.pathname || ""
  32931. , n = this.hash || ""
  32932. , r = !1
  32933. , o = "";
  32934. this.host ? r = e + this.host : this.hostname && (r = e + (this.hostname.indexOf(":") === -1 ? this.hostname : "[" + this.hostname + "]"),
  32935. this.port && (r += ":" + this.port)),
  32936. this.query && c.isObject(this.query) && Object.keys(this.query).length && (o = w.stringify(this.query));
  32937. var a = this.search || o && "?" + o || "";
  32938. return t && ":" !== t.substr(-1) && (t += ":"),
  32939. this.slashes || (!t || b[t]) && r !== !1 ? (r = "//" + (r || ""),
  32940. i && "/" !== i.charAt(0) && (i = "/" + i)) : r || (r = ""),
  32941. n && "#" !== n.charAt(0) && (n = "#" + n),
  32942. a && "?" !== a.charAt(0) && (a = "?" + a),
  32943. i = i.replace(/[?#]/g, function(e) {
  32944. return encodeURIComponent(e)
  32945. }),
  32946. a = a.replace("#", "%23"),
  32947. t + r + i + a + n
  32948. }
  32949. ,
  32950. n.prototype.resolve = function(e) {
  32951. return this.resolveObject(r(e, !1, !0)).format()
  32952. }
  32953. ,
  32954. n.prototype.resolveObject = function(e) {
  32955. if (c.isString(e)) {
  32956. var t = new n;
  32957. t.parse(e, !1, !0),
  32958. e = t
  32959. }
  32960. for (var i = new n, r = Object.keys(this), o = 0; o < r.length; o++) {
  32961. var a = r[o];
  32962. i[a] = this[a]
  32963. }
  32964. if (i.hash = e.hash,
  32965. "" === e.href)
  32966. return i.href = i.format(),
  32967. i;
  32968. if (e.slashes && !e.protocol) {
  32969. for (var s = Object.keys(e), l = 0; l < s.length; l++) {
  32970. var h = s[l];
  32971. "protocol" !== h && (i[h] = e[h])
  32972. }
  32973. return b[i.protocol] && i.hostname && !i.pathname && (i.path = i.pathname = "/"),
  32974. i.href = i.format(),
  32975. i
  32976. }
  32977. if (e.protocol && e.protocol !== i.protocol) {
  32978. if (!b[e.protocol]) {
  32979. for (var u = Object.keys(e), d = 0; d < u.length; d++) {
  32980. var p = u[d];
  32981. i[p] = e[p]
  32982. }
  32983. return i.href = i.format(),
  32984. i
  32985. }
  32986. if (i.protocol = e.protocol,
  32987. e.host || E[e.protocol])
  32988. i.pathname = e.pathname;
  32989. else {
  32990. for (var f = (e.pathname || "").split("/"); f.length && !(e.host = f.shift()); )
  32991. ;
  32992. e.host || (e.host = ""),
  32993. e.hostname || (e.hostname = ""),
  32994. "" !== f[0] && f.unshift(""),
  32995. f.length < 2 && f.unshift(""),
  32996. i.pathname = f.join("/")
  32997. }
  32998. if (i.search = e.search,
  32999. i.query = e.query,
  33000. i.host = e.host || "",
  33001. i.auth = e.auth,
  33002. i.hostname = e.hostname || e.host,
  33003. i.port = e.port,
  33004. i.pathname || i.search) {
  33005. var g = i.pathname || ""
  33006. , m = i.search || "";
  33007. i.path = g + m
  33008. }
  33009. return i.slashes = i.slashes || e.slashes,
  33010. i.href = i.format(),
  33011. i
  33012. }
  33013. var v = i.pathname && "/" === i.pathname.charAt(0)
  33014. , A = e.host || e.pathname && "/" === e.pathname.charAt(0)
  33015. , y = A || v || i.host && e.pathname
  33016. , C = y
  33017. , I = i.pathname && i.pathname.split("/") || []
  33018. , f = e.pathname && e.pathname.split("/") || []
  33019. , w = i.protocol && !b[i.protocol];
  33020. if (w && (i.hostname = "",
  33021. i.port = null,
  33022. i.host && ("" === I[0] ? I[0] = i.host : I.unshift(i.host)),
  33023. i.host = "",
  33024. e.protocol && (e.hostname = null,
  33025. e.port = null,
  33026. e.host && ("" === f[0] ? f[0] = e.host : f.unshift(e.host)),
  33027. e.host = null),
  33028. y = y && ("" === f[0] || "" === I[0])),
  33029. A)
  33030. i.host = e.host || "" === e.host ? e.host : i.host,
  33031. i.hostname = e.hostname || "" === e.hostname ? e.hostname : i.hostname,
  33032. i.search = e.search,
  33033. i.query = e.query,
  33034. I = f;
  33035. else if (f.length)
  33036. I || (I = []),
  33037. I.pop(),
  33038. I = I.concat(f),
  33039. i.search = e.search,
  33040. i.query = e.query;
  33041. else if (!c.isNullOrUndefined(e.search)) {
  33042. if (w) {
  33043. i.hostname = i.host = I.shift();
  33044. var _ = !!(i.host && i.host.indexOf("@") > 0) && i.host.split("@");
  33045. _ && (i.auth = _.shift(),
  33046. i.host = i.hostname = _.shift())
  33047. }
  33048. return i.search = e.search,
  33049. i.query = e.query,
  33050. c.isNull(i.pathname) && c.isNull(i.search) || (i.path = (i.pathname ? i.pathname : "") + (i.search ? i.search : "")),
  33051. i.href = i.format(),
  33052. i
  33053. }
  33054. if (!I.length)
  33055. return i.pathname = null,
  33056. i.search ? i.path = "/" + i.search : i.path = null,
  33057. i.href = i.format(),
  33058. i;
  33059. 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--)
  33060. T = I[M],
  33061. "." === T ? I.splice(M, 1) : ".." === T ? (I.splice(M, 1),
  33062. S++) : S && (I.splice(M, 1),
  33063. S--);
  33064. if (!y && !C)
  33065. for (; S--; S)
  33066. I.unshift("..");
  33067. !y || "" === I[0] || I[0] && "/" === I[0].charAt(0) || I.unshift(""),
  33068. x && "/" !== I.join("/").substr(-1) && I.push("");
  33069. var R = "" === I[0] || I[0] && "/" === I[0].charAt(0);
  33070. if (w) {
  33071. i.hostname = i.host = R ? "" : I.length ? I.shift() : "";
  33072. var _ = !!(i.host && i.host.indexOf("@") > 0) && i.host.split("@");
  33073. _ && (i.auth = _.shift(),
  33074. i.host = i.hostname = _.shift())
  33075. }
  33076. return y = y || i.host && I.length,
  33077. y && !R && I.unshift(""),
  33078. I.length ? i.pathname = I.join("/") : (i.pathname = null,
  33079. i.path = null),
  33080. c.isNull(i.pathname) && c.isNull(i.search) || (i.path = (i.pathname ? i.pathname : "") + (i.search ? i.search : "")),
  33081. i.auth = e.auth || i.auth,
  33082. i.slashes = i.slashes || e.slashes,
  33083. i.href = i.format(),
  33084. i
  33085. }
  33086. ,
  33087. n.prototype.parseHost = function() {
  33088. var e = this.host
  33089. , t = u.exec(e);
  33090. t && (t = t[0],
  33091. ":" !== t && (this.port = t.substr(1)),
  33092. e = e.substr(0, e.length - t.length)),
  33093. e && (this.hostname = e)
  33094. }
  33095. }
  33096. , {
  33097. "./util": 209,
  33098. punycode: 204,
  33099. querystring: 207
  33100. }],
  33101. 209: [function(e, t, i) {
  33102. "use strict";
  33103. t.exports = {
  33104. isString: function(e) {
  33105. return "string" == typeof e
  33106. },
  33107. isObject: function(e) {
  33108. return "object" == typeof e && null !== e
  33109. },
  33110. isNull: function(e) {
  33111. return null === e
  33112. },
  33113. isNullOrUndefined: function(e) {
  33114. return null == e
  33115. }
  33116. }
  33117. }
  33118. , {}],
  33119. 210: [function(e, t, i) {
  33120. "use strict";
  33121. function n(e) {
  33122. return l + e
  33123. }
  33124. function r(e) {
  33125. return e.substring(l.length)
  33126. }
  33127. function o(e, t) {
  33128. for (var i in t)
  33129. Object.defineProperty(e, i, {
  33130. value: t[i],
  33131. configurable: !0,
  33132. writable: !0
  33133. })
  33134. }
  33135. function a(e) {
  33136. if ("string" != typeof e)
  33137. throw new TypeError("key must be a string.")
  33138. }
  33139. var s = Object.prototype.hasOwnProperty
  33140. , l = "~";
  33141. t.exports = function(e) {
  33142. var t = Object.create(null)
  33143. , i = 0
  33144. , l = {};
  33145. return o(l, {
  33146. get: function(e, i) {
  33147. a(e);
  33148. var r = n(e);
  33149. return r in t ? t[r] : i
  33150. },
  33151. set: function(e, r) {
  33152. a(e);
  33153. var o = n(e);
  33154. return o in t || ++i,
  33155. t[o] = r
  33156. },
  33157. has: function(e) {
  33158. return a(e),
  33159. n(e)in t
  33160. },
  33161. delete: function(e) {
  33162. a(e);
  33163. var r = n(e);
  33164. return r in t && (--i,
  33165. delete t[r],
  33166. !0)
  33167. },
  33168. clear: function() {
  33169. t = Object.create(null),
  33170. i = 0
  33171. },
  33172. forEach: function(e, i) {
  33173. if ("function" != typeof e)
  33174. throw new TypeError("`callback` must be a function");
  33175. for (var n in t)
  33176. if (s.call(t, n)) {
  33177. var o = r(n)
  33178. , a = t[n];
  33179. e.call(i, a, o, l)
  33180. }
  33181. }
  33182. }),
  33183. Object.defineProperty(l, "size", {
  33184. get: function() {
  33185. return i
  33186. },
  33187. configurable: !0
  33188. }),
  33189. "object" == typeof e && null !== e && Object.keys(e).forEach(function(t) {
  33190. l.set(t, e[t])
  33191. }),
  33192. l
  33193. }
  33194. }
  33195. , {}],
  33196. 211: [function(e, t, i) {
  33197. t.exports = e("./lib/heap")
  33198. }
  33199. , {
  33200. "./lib/heap": 212
  33201. }],
  33202. 212: [function(e, t, i) {
  33203. (function() {
  33204. var e, n, r, o, a, s, l, c, h, u, d, p, f, g, m;
  33205. r = Math.floor,
  33206. u = Math.min,
  33207. n = function(e, t) {
  33208. return e < t ? -1 : e > t ? 1 : 0
  33209. }
  33210. ,
  33211. h = function(e, t, i, o, a) {
  33212. var s;
  33213. if (null == i && (i = 0),
  33214. null == a && (a = n),
  33215. i < 0)
  33216. throw new Error("lo must be non-negative");
  33217. for (null == o && (o = e.length); i < o; )
  33218. s = r((i + o) / 2),
  33219. a(t, e[s]) < 0 ? o = s : i = s + 1;
  33220. return [].splice.apply(e, [i, i - i].concat(t)),
  33221. t
  33222. }
  33223. ,
  33224. s = function(e, t, i) {
  33225. return null == i && (i = n),
  33226. e.push(t),
  33227. g(e, 0, e.length - 1, i)
  33228. }
  33229. ,
  33230. a = function(e, t) {
  33231. var i, r;
  33232. return null == t && (t = n),
  33233. i = e.pop(),
  33234. e.length ? (r = e[0],
  33235. e[0] = i,
  33236. m(e, 0, t)) : r = i,
  33237. r
  33238. }
  33239. ,
  33240. c = function(e, t, i) {
  33241. var r;
  33242. return null == i && (i = n),
  33243. r = e[0],
  33244. e[0] = t,
  33245. m(e, 0, i),
  33246. r
  33247. }
  33248. ,
  33249. l = function(e, t, i) {
  33250. var r;
  33251. return null == i && (i = n),
  33252. e.length && i(e[0], t) < 0 && (r = [e[0], t],
  33253. t = r[0],
  33254. e[0] = r[1],
  33255. m(e, 0, i)),
  33256. t
  33257. }
  33258. ,
  33259. o = function(e, t) {
  33260. var i, o, a, s, l, c;
  33261. for (null == t && (t = n),
  33262. s = function() {
  33263. c = [];
  33264. for (var t = 0, i = r(e.length / 2); 0 <= i ? t < i : t > i; 0 <= i ? t++ : t--)
  33265. c.push(t);
  33266. return c
  33267. }
  33268. .apply(this).reverse(),
  33269. l = [],
  33270. o = 0,
  33271. a = s.length; o < a; o++)
  33272. i = s[o],
  33273. l.push(m(e, i, t));
  33274. return l
  33275. }
  33276. ,
  33277. f = function(e, t, i) {
  33278. var r;
  33279. if (null == i && (i = n),
  33280. r = e.indexOf(t),
  33281. r !== -1)
  33282. return g(e, 0, r, i),
  33283. m(e, r, i)
  33284. }
  33285. ,
  33286. d = function(e, t, i) {
  33287. var r, a, s, c, h;
  33288. if (null == i && (i = n),
  33289. a = e.slice(0, t),
  33290. !a.length)
  33291. return a;
  33292. for (o(a, i),
  33293. h = e.slice(t),
  33294. s = 0,
  33295. c = h.length; s < c; s++)
  33296. r = h[s],
  33297. l(a, r, i);
  33298. return a.sort(i).reverse()
  33299. }
  33300. ,
  33301. p = function(e, t, i) {
  33302. var r, s, l, c, d, p, f, g, m, v;
  33303. if (null == i && (i = n),
  33304. 10 * t <= e.length) {
  33305. if (c = e.slice(0, t).sort(i),
  33306. !c.length)
  33307. return c;
  33308. for (l = c[c.length - 1],
  33309. g = e.slice(t),
  33310. d = 0,
  33311. f = g.length; d < f; d++)
  33312. r = g[d],
  33313. i(r, l) < 0 && (h(c, r, 0, null, i),
  33314. c.pop(),
  33315. l = c[c.length - 1]);
  33316. return c
  33317. }
  33318. for (o(e, i),
  33319. v = [],
  33320. s = p = 0,
  33321. m = u(t, e.length); 0 <= m ? p < m : p > m; s = 0 <= m ? ++p : --p)
  33322. v.push(a(e, i));
  33323. return v
  33324. }
  33325. ,
  33326. g = function(e, t, i, r) {
  33327. var o, a, s;
  33328. for (null == r && (r = n),
  33329. o = e[i]; i > t && (s = i - 1 >> 1,
  33330. a = e[s],
  33331. r(o, a) < 0); )
  33332. e[i] = a,
  33333. i = s;
  33334. return e[i] = o
  33335. }
  33336. ,
  33337. m = function(e, t, i) {
  33338. var r, o, a, s, l;
  33339. for (null == i && (i = n),
  33340. o = e.length,
  33341. l = t,
  33342. a = e[t],
  33343. r = 2 * t + 1; r < o; )
  33344. s = r + 1,
  33345. s < o && !(i(e[r], e[s]) < 0) && (r = s),
  33346. e[t] = e[r],
  33347. t = r,
  33348. r = 2 * t + 1;
  33349. return e[t] = a,
  33350. g(e, l, t, i)
  33351. }
  33352. ,
  33353. e = function() {
  33354. function e(e) {
  33355. this.cmp = null != e ? e : n,
  33356. this.nodes = []
  33357. }
  33358. return e.push = s,
  33359. e.pop = a,
  33360. e.replace = c,
  33361. e.pushpop = l,
  33362. e.heapify = o,
  33363. e.updateItem = f,
  33364. e.nlargest = d,
  33365. e.nsmallest = p,
  33366. e.prototype.push = function(e) {
  33367. return s(this.nodes, e, this.cmp)
  33368. }
  33369. ,
  33370. e.prototype.pop = function() {
  33371. return a(this.nodes, this.cmp)
  33372. }
  33373. ,
  33374. e.prototype.peek = function() {
  33375. return this.nodes[0]
  33376. }
  33377. ,
  33378. e.prototype.contains = function(e) {
  33379. return this.nodes.indexOf(e) !== -1
  33380. }
  33381. ,
  33382. e.prototype.replace = function(e) {
  33383. return c(this.nodes, e, this.cmp)
  33384. }
  33385. ,
  33386. e.prototype.pushpop = function(e) {
  33387. return l(this.nodes, e, this.cmp)
  33388. }
  33389. ,
  33390. e.prototype.heapify = function() {
  33391. return o(this.nodes, this.cmp)
  33392. }
  33393. ,
  33394. e.prototype.updateItem = function(e) {
  33395. return f(this.nodes, e, this.cmp)
  33396. }
  33397. ,
  33398. e.prototype.clear = function() {
  33399. return this.nodes = []
  33400. }
  33401. ,
  33402. e.prototype.empty = function() {
  33403. return 0 === this.nodes.length
  33404. }
  33405. ,
  33406. e.prototype.size = function() {
  33407. return this.nodes.length
  33408. }
  33409. ,
  33410. e.prototype.clone = function() {
  33411. var t;
  33412. return t = new e,
  33413. t.nodes = this.nodes.slice(0),
  33414. t
  33415. }
  33416. ,
  33417. e.prototype.toArray = function() {
  33418. return this.nodes.slice(0)
  33419. }
  33420. ,
  33421. e.prototype.insert = e.prototype.push,
  33422. e.prototype.top = e.prototype.peek,
  33423. e.prototype.front = e.prototype.peek,
  33424. e.prototype.has = e.prototype.contains,
  33425. e.prototype.copy = e.prototype.clone,
  33426. e
  33427. }(),
  33428. function(e, n) {
  33429. return "function" == typeof define && define.amd ? define([], n) : "object" == typeof i ? t.exports = n() : e.Heap = n()
  33430. }(this, function() {
  33431. return e
  33432. })
  33433. }
  33434. ).call(this)
  33435. }
  33436. , {}],
  33437. 213: [function(e, t, i) {
  33438. !function(e) {
  33439. function i() {}
  33440. function n(e, t) {
  33441. return function() {
  33442. e.apply(t, arguments)
  33443. }
  33444. }
  33445. function r(e) {
  33446. if ("object" != typeof this)
  33447. throw new TypeError("Promises must be constructed via new");
  33448. if ("function" != typeof e)
  33449. throw new TypeError("not a function");
  33450. this._state = 0,
  33451. this._handled = !1,
  33452. this._value = void 0,
  33453. this._deferreds = [],
  33454. h(e, this)
  33455. }
  33456. function o(e, t) {
  33457. for (; 3 === e._state; )
  33458. e = e._value;
  33459. return 0 === e._state ? void e._deferreds.push(t) : (e._handled = !0,
  33460. void r._immediateFn(function() {
  33461. var i = 1 === e._state ? t.onFulfilled : t.onRejected;
  33462. if (null === i)
  33463. return void (1 === e._state ? a : s)(t.promise, e._value);
  33464. var n;
  33465. try {
  33466. n = i(e._value)
  33467. } catch (e) {
  33468. return void s(t.promise, e)
  33469. }
  33470. a(t.promise, n)
  33471. }))
  33472. }
  33473. function a(e, t) {
  33474. try {
  33475. if (t === e)
  33476. throw new TypeError("A promise cannot be resolved with itself.");
  33477. if (t && ("object" == typeof t || "function" == typeof t)) {
  33478. var i = t.then;
  33479. if (t instanceof r)
  33480. return e._state = 3,
  33481. e._value = t,
  33482. void l(e);
  33483. if ("function" == typeof i)
  33484. return void h(n(i, t), e)
  33485. }
  33486. e._state = 1,
  33487. e._value = t,
  33488. l(e)
  33489. } catch (t) {
  33490. s(e, t)
  33491. }
  33492. }
  33493. function s(e, t) {
  33494. e._state = 2,
  33495. e._value = t,
  33496. l(e)
  33497. }
  33498. function l(e) {
  33499. 2 === e._state && 0 === e._deferreds.length && r._immediateFn(function() {
  33500. e._handled || r._unhandledRejectionFn(e._value)
  33501. });
  33502. for (var t = 0, i = e._deferreds.length; t < i; t++)
  33503. o(e, e._deferreds[t]);
  33504. e._deferreds = null
  33505. }
  33506. function c(e, t, i) {
  33507. this.onFulfilled = "function" == typeof e ? e : null,
  33508. this.onRejected = "function" == typeof t ? t : null,
  33509. this.promise = i
  33510. }
  33511. function h(e, t) {
  33512. var i = !1;
  33513. try {
  33514. e(function(e) {
  33515. i || (i = !0,
  33516. a(t, e))
  33517. }, function(e) {
  33518. i || (i = !0,
  33519. s(t, e))
  33520. })
  33521. } catch (e) {
  33522. if (i)
  33523. return;
  33524. i = !0,
  33525. s(t, e)
  33526. }
  33527. }
  33528. var u = setTimeout;
  33529. r.prototype.catch = function(e) {
  33530. return this.then(null, e)
  33531. }
  33532. ,
  33533. r.prototype.then = function(e, t) {
  33534. var n = new this.constructor(i);
  33535. return o(this, new c(e,t,n)),
  33536. n
  33537. }
  33538. ,
  33539. r.all = function(e) {
  33540. var t = Array.prototype.slice.call(e);
  33541. return new r(function(e, i) {
  33542. function n(o, a) {
  33543. try {
  33544. if (a && ("object" == typeof a || "function" == typeof a)) {
  33545. var s = a.then;
  33546. if ("function" == typeof s)
  33547. return void s.call(a, function(e) {
  33548. n(o, e)
  33549. }, i)
  33550. }
  33551. t[o] = a,
  33552. 0 === --r && e(t)
  33553. } catch (e) {
  33554. i(e)
  33555. }
  33556. }
  33557. if (0 === t.length)
  33558. return e([]);
  33559. for (var r = t.length, o = 0; o < t.length; o++)
  33560. n(o, t[o])
  33561. }
  33562. )
  33563. }
  33564. ,
  33565. r.resolve = function(e) {
  33566. return e && "object" == typeof e && e.constructor === r ? e : new r(function(t) {
  33567. t(e)
  33568. }
  33569. )
  33570. }
  33571. ,
  33572. r.reject = function(e) {
  33573. return new r(function(t, i) {
  33574. i(e)
  33575. }
  33576. )
  33577. }
  33578. ,
  33579. r.race = function(e) {
  33580. return new r(function(t, i) {
  33581. for (var n = 0, r = e.length; n < r; n++)
  33582. e[n].then(t, i)
  33583. }
  33584. )
  33585. }
  33586. ,
  33587. r._immediateFn = "function" == typeof setImmediate && function(e) {
  33588. setImmediate(e)
  33589. }
  33590. || function(e) {
  33591. u(e, 0)
  33592. }
  33593. ,
  33594. r._unhandledRejectionFn = function(e) {
  33595. "undefined" != typeof console && console && console.warn("Possible Unhandled Promise Rejection:", e)
  33596. }
  33597. ,
  33598. r._setImmediateFn = function(e) {
  33599. r._immediateFn = e
  33600. }
  33601. ,
  33602. r._setUnhandledRejectionFn = function(e) {
  33603. r._unhandledRejectionFn = e
  33604. }
  33605. ,
  33606. "undefined" != typeof t && t.exports ? t.exports = r : e.Promise || (e.Promise = r)
  33607. }(this)
  33608. }
  33609. , {}],
  33610. 214: [function(e, t, i) {
  33611. (function(i) {
  33612. !function(i, n) {
  33613. "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)
  33614. }(this, function(t, n) {
  33615. "use strict";
  33616. var r = {};
  33617. return r.ByteBuffer = t,
  33618. r.Long = t.Long || null,
  33619. r.VERSION = "5.0.1",
  33620. r.WIRE_TYPES = {},
  33621. r.WIRE_TYPES.VARINT = 0,
  33622. r.WIRE_TYPES.BITS64 = 1,
  33623. r.WIRE_TYPES.LDELIM = 2,
  33624. r.WIRE_TYPES.STARTGROUP = 3,
  33625. r.WIRE_TYPES.ENDGROUP = 4,
  33626. r.WIRE_TYPES.BITS32 = 5,
  33627. r.PACKABLE_WIRE_TYPES = [r.WIRE_TYPES.VARINT, r.WIRE_TYPES.BITS64, r.WIRE_TYPES.BITS32],
  33628. r.TYPES = {
  33629. int32: {
  33630. name: "int32",
  33631. wireType: r.WIRE_TYPES.VARINT,
  33632. defaultValue: 0
  33633. },
  33634. uint32: {
  33635. name: "uint32",
  33636. wireType: r.WIRE_TYPES.VARINT,
  33637. defaultValue: 0
  33638. },
  33639. sint32: {
  33640. name: "sint32",
  33641. wireType: r.WIRE_TYPES.VARINT,
  33642. defaultValue: 0
  33643. },
  33644. int64: {
  33645. name: "int64",
  33646. wireType: r.WIRE_TYPES.VARINT,
  33647. defaultValue: r.Long ? r.Long.ZERO : void 0
  33648. },
  33649. uint64: {
  33650. name: "uint64",
  33651. wireType: r.WIRE_TYPES.VARINT,
  33652. defaultValue: r.Long ? r.Long.UZERO : void 0
  33653. },
  33654. sint64: {
  33655. name: "sint64",
  33656. wireType: r.WIRE_TYPES.VARINT,
  33657. defaultValue: r.Long ? r.Long.ZERO : void 0
  33658. },
  33659. bool: {
  33660. name: "bool",
  33661. wireType: r.WIRE_TYPES.VARINT,
  33662. defaultValue: !1
  33663. },
  33664. double: {
  33665. name: "double",
  33666. wireType: r.WIRE_TYPES.BITS64,
  33667. defaultValue: 0
  33668. },
  33669. string: {
  33670. name: "string",
  33671. wireType: r.WIRE_TYPES.LDELIM,
  33672. defaultValue: ""
  33673. },
  33674. bytes: {
  33675. name: "bytes",
  33676. wireType: r.WIRE_TYPES.LDELIM,
  33677. defaultValue: null
  33678. },
  33679. fixed32: {
  33680. name: "fixed32",
  33681. wireType: r.WIRE_TYPES.BITS32,
  33682. defaultValue: 0
  33683. },
  33684. sfixed32: {
  33685. name: "sfixed32",
  33686. wireType: r.WIRE_TYPES.BITS32,
  33687. defaultValue: 0
  33688. },
  33689. fixed64: {
  33690. name: "fixed64",
  33691. wireType: r.WIRE_TYPES.BITS64,
  33692. defaultValue: r.Long ? r.Long.UZERO : void 0
  33693. },
  33694. sfixed64: {
  33695. name: "sfixed64",
  33696. wireType: r.WIRE_TYPES.BITS64,
  33697. defaultValue: r.Long ? r.Long.ZERO : void 0
  33698. },
  33699. float: {
  33700. name: "float",
  33701. wireType: r.WIRE_TYPES.BITS32,
  33702. defaultValue: 0
  33703. },
  33704. enum: {
  33705. name: "enum",
  33706. wireType: r.WIRE_TYPES.VARINT,
  33707. defaultValue: 0
  33708. },
  33709. message: {
  33710. name: "message",
  33711. wireType: r.WIRE_TYPES.LDELIM,
  33712. defaultValue: null
  33713. },
  33714. group: {
  33715. name: "group",
  33716. wireType: r.WIRE_TYPES.STARTGROUP,
  33717. defaultValue: null
  33718. }
  33719. },
  33720. 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],
  33721. r.ID_MIN = 1,
  33722. r.ID_MAX = 536870911,
  33723. r.convertFieldsToCamelCase = !1,
  33724. r.populateAccessors = !0,
  33725. r.populateDefaults = !0,
  33726. r.Util = function() {
  33727. var t = {};
  33728. return t.IS_NODE = !("object" != typeof i || i + "" != "[object process]" || i.browser),
  33729. t.XHR = function() {
  33730. for (var e = [function() {
  33731. return new XMLHttpRequest
  33732. }
  33733. , function() {
  33734. return new ActiveXObject("Msxml2.XMLHTTP")
  33735. }
  33736. , function() {
  33737. return new ActiveXObject("Msxml3.XMLHTTP")
  33738. }
  33739. , function() {
  33740. return new ActiveXObject("Microsoft.XMLHTTP")
  33741. }
  33742. ], t = null, i = 0; i < e.length; i++) {
  33743. try {
  33744. t = e[i]()
  33745. } catch (e) {
  33746. continue
  33747. }
  33748. break
  33749. }
  33750. if (!t)
  33751. throw Error("XMLHttpRequest is not supported");
  33752. return t
  33753. }
  33754. ,
  33755. t.fetch = function(i, n) {
  33756. if (n && "function" != typeof n && (n = null),
  33757. t.IS_NODE) {
  33758. var r = e("fs");
  33759. if (n)
  33760. r.readFile(i, function(e, t) {
  33761. n(e ? null : "" + t)
  33762. });
  33763. else
  33764. try {
  33765. return r.readFileSync(i)
  33766. } catch (e) {
  33767. return null
  33768. }
  33769. } else {
  33770. var o = t.XHR();
  33771. if (o.open("GET", i, !!n),
  33772. o.setRequestHeader("Accept", "text/plain"),
  33773. "function" == typeof o.overrideMimeType && o.overrideMimeType("text/plain"),
  33774. !n)
  33775. return o.send(null),
  33776. 200 == o.status || 0 == o.status && "string" == typeof o.responseText ? o.responseText : null;
  33777. if (o.onreadystatechange = function() {
  33778. 4 == o.readyState && n(200 == o.status || 0 == o.status && "string" == typeof o.responseText ? o.responseText : null)
  33779. }
  33780. ,
  33781. 4 == o.readyState)
  33782. return;
  33783. o.send(null)
  33784. }
  33785. }
  33786. ,
  33787. t.toCamelCase = function(e) {
  33788. return e.replace(/_([a-zA-Z])/g, function(e, t) {
  33789. return t.toUpperCase()
  33790. })
  33791. }
  33792. ,
  33793. t
  33794. }(),
  33795. r.Lang = {
  33796. DELIM: /[\s\{\}=;:\[\],'"\(\)<>]/g,
  33797. RULE: /^(?:required|optional|repeated|map)$/,
  33798. TYPE: /^(?:double|float|int32|uint32|sint32|int64|uint64|sint64|fixed32|sfixed32|fixed64|sfixed64|bool|string|bytes)$/,
  33799. NAME: /^[a-zA-Z_][a-zA-Z_0-9]*$/,
  33800. TYPEDEF: /^[a-zA-Z][a-zA-Z_0-9]*$/,
  33801. TYPEREF: /^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)+$/,
  33802. FQTYPEREF: /^(?:\.[a-zA-Z][a-zA-Z_0-9]*)+$/,
  33803. NUMBER: /^-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+|([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?)|inf|nan)$/,
  33804. NUMBER_DEC: /^(?:[1-9][0-9]*|0)$/,
  33805. NUMBER_HEX: /^0[xX][0-9a-fA-F]+$/,
  33806. NUMBER_OCT: /^0[0-7]+$/,
  33807. NUMBER_FLT: /^([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?|inf|nan)$/,
  33808. BOOL: /^(?:true|false)$/i,
  33809. ID: /^(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,
  33810. NEGID: /^\-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,
  33811. WHITESPACE: /\s/,
  33812. STRING: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")|(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,
  33813. STRING_DQ: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,
  33814. STRING_SQ: /(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g
  33815. },
  33816. r.DotProto = function(e, t) {
  33817. function i(e, i) {
  33818. var n = -1
  33819. , r = 1;
  33820. if ("-" == e.charAt(0) && (r = -1,
  33821. e = e.substring(1)),
  33822. t.NUMBER_DEC.test(e))
  33823. n = parseInt(e);
  33824. else if (t.NUMBER_HEX.test(e))
  33825. n = parseInt(e.substring(2), 16);
  33826. else {
  33827. if (!t.NUMBER_OCT.test(e))
  33828. throw Error("illegal id value: " + (r < 0 ? "-" : "") + e);
  33829. n = parseInt(e.substring(1), 8)
  33830. }
  33831. if (n = r * n | 0,
  33832. !i && n < 0)
  33833. throw Error("illegal id value: " + (r < 0 ? "-" : "") + e);
  33834. return n
  33835. }
  33836. function n(e) {
  33837. var i = 1;
  33838. if ("-" == e.charAt(0) && (i = -1,
  33839. e = e.substring(1)),
  33840. t.NUMBER_DEC.test(e))
  33841. return i * parseInt(e, 10);
  33842. if (t.NUMBER_HEX.test(e))
  33843. return i * parseInt(e.substring(2), 16);
  33844. if (t.NUMBER_OCT.test(e))
  33845. return i * parseInt(e.substring(1), 8);
  33846. if ("inf" === e)
  33847. return i * (1 / 0);
  33848. if ("nan" === e)
  33849. return NaN;
  33850. if (t.NUMBER_FLT.test(e))
  33851. return i * parseFloat(e);
  33852. throw Error("illegal number value: " + (i < 0 ? "-" : "") + e)
  33853. }
  33854. function r(e, t, i) {
  33855. "undefined" == typeof e[t] ? e[t] = i : (Array.isArray(e[t]) || (e[t] = [e[t]]),
  33856. e[t].push(i))
  33857. }
  33858. var o = {}
  33859. , a = function(e) {
  33860. this.source = e + "",
  33861. this.index = 0,
  33862. this.line = 1,
  33863. this.stack = [],
  33864. this._stringOpen = null
  33865. }
  33866. , s = a.prototype;
  33867. s._readString = function() {
  33868. var e = '"' === this._stringOpen ? t.STRING_DQ : t.STRING_SQ;
  33869. e.lastIndex = this.index - 1;
  33870. var i = e.exec(this.source);
  33871. if (!i)
  33872. throw Error("unterminated string");
  33873. return this.index = e.lastIndex,
  33874. this.stack.push(this._stringOpen),
  33875. this._stringOpen = null,
  33876. i[1]
  33877. }
  33878. ,
  33879. s.next = function() {
  33880. if (this.stack.length > 0)
  33881. return this.stack.shift();
  33882. if (this.index >= this.source.length)
  33883. return null;
  33884. if (null !== this._stringOpen)
  33885. return this._readString();
  33886. var e, i, n;
  33887. do {
  33888. for (e = !1; t.WHITESPACE.test(n = this.source.charAt(this.index)); )
  33889. if ("\n" === n && ++this.line,
  33890. ++this.index === this.source.length)
  33891. return null;
  33892. if ("/" === this.source.charAt(this.index))
  33893. if (++this.index,
  33894. "/" === this.source.charAt(this.index)) {
  33895. for (; "\n" !== this.source.charAt(++this.index); )
  33896. if (this.index == this.source.length)
  33897. return null;
  33898. ++this.index,
  33899. ++this.line,
  33900. e = !0
  33901. } else {
  33902. if ("*" !== (n = this.source.charAt(this.index)))
  33903. return "/";
  33904. do {
  33905. if ("\n" === n && ++this.line,
  33906. ++this.index === this.source.length)
  33907. return null;
  33908. i = n,
  33909. n = this.source.charAt(this.index)
  33910. } while ("*" !== i || "/" !== n);++this.index,
  33911. e = !0
  33912. }
  33913. } while (e);if (this.index === this.source.length)
  33914. return null;
  33915. var r = this.index;
  33916. t.DELIM.lastIndex = 0;
  33917. var o = t.DELIM.test(this.source.charAt(r++));
  33918. if (!o)
  33919. for (; r < this.source.length && !t.DELIM.test(this.source.charAt(r)); )
  33920. ++r;
  33921. var a = this.source.substring(this.index, this.index = r);
  33922. return '"' !== a && "'" !== a || (this._stringOpen = a),
  33923. a
  33924. }
  33925. ,
  33926. s.peek = function() {
  33927. if (0 === this.stack.length) {
  33928. var e = this.next();
  33929. if (null === e)
  33930. return null;
  33931. this.stack.push(e)
  33932. }
  33933. return this.stack[0]
  33934. }
  33935. ,
  33936. s.skip = function(e) {
  33937. var t = this.next();
  33938. if (t !== e)
  33939. throw Error("illegal '" + t + "', '" + e + "' expected")
  33940. }
  33941. ,
  33942. s.omit = function(e) {
  33943. return this.peek() === e && (this.next(),
  33944. !0)
  33945. }
  33946. ,
  33947. s.toString = function() {
  33948. return "Tokenizer (" + this.index + "/" + this.source.length + " at line " + this.line + ")"
  33949. }
  33950. ,
  33951. o.Tokenizer = a;
  33952. var l = function(e) {
  33953. this.tn = new a(e),
  33954. this.proto3 = !1
  33955. }
  33956. , c = l.prototype;
  33957. return c.parse = function() {
  33958. var e, i, n = {
  33959. name: "[ROOT]",
  33960. package: null,
  33961. messages: [],
  33962. enums: [],
  33963. imports: [],
  33964. options: {},
  33965. services: []
  33966. }, r = !0;
  33967. try {
  33968. for (; e = this.tn.next(); )
  33969. switch (e) {
  33970. case "package":
  33971. if (!r || null !== n.package)
  33972. throw Error("unexpected 'package'");
  33973. if (e = this.tn.next(),
  33974. !t.TYPEREF.test(e))
  33975. throw Error("illegal package name: " + e);
  33976. this.tn.skip(";"),
  33977. n.package = e;
  33978. break;
  33979. case "import":
  33980. if (!r)
  33981. throw Error("unexpected 'import'");
  33982. e = this.tn.peek(),
  33983. ("public" === e || (i = "weak" === e)) && this.tn.next(),
  33984. e = this._readString(),
  33985. this.tn.skip(";"),
  33986. i || n.imports.push(e);
  33987. break;
  33988. case "syntax":
  33989. if (!r)
  33990. throw Error("unexpected 'syntax'");
  33991. this.tn.skip("="),
  33992. "proto3" === (n.syntax = this._readString()) && (this.proto3 = !0),
  33993. this.tn.skip(";");
  33994. break;
  33995. case "message":
  33996. this._parseMessage(n, null),
  33997. r = !1;
  33998. break;
  33999. case "enum":
  34000. this._parseEnum(n),
  34001. r = !1;
  34002. break;
  34003. case "option":
  34004. this._parseOption(n);
  34005. break;
  34006. case "service":
  34007. this._parseService(n);
  34008. break;
  34009. case "extend":
  34010. this._parseExtend(n);
  34011. break;
  34012. default:
  34013. throw Error("unexpected '" + e + "'")
  34014. }
  34015. } catch (e) {
  34016. throw e.message = "Parse error at line " + this.tn.line + ": " + e.message,
  34017. e
  34018. }
  34019. return delete n.name,
  34020. n
  34021. }
  34022. ,
  34023. l.parse = function(e) {
  34024. return new l(e).parse()
  34025. }
  34026. ,
  34027. c._readString = function() {
  34028. var e, t, i = "";
  34029. do {
  34030. if (t = this.tn.next(),
  34031. "'" !== t && '"' !== t)
  34032. throw Error("illegal string delimiter: " + t);
  34033. i += this.tn.next(),
  34034. this.tn.skip(t),
  34035. e = this.tn.peek()
  34036. } while ('"' === e || '"' === e);return i
  34037. }
  34038. ,
  34039. c._readValue = function(e) {
  34040. var i = this.tn.peek();
  34041. if ('"' === i || "'" === i)
  34042. return this._readString();
  34043. if (this.tn.next(),
  34044. t.NUMBER.test(i))
  34045. return n(i);
  34046. if (t.BOOL.test(i))
  34047. return "true" === i.toLowerCase();
  34048. if (e && t.TYPEREF.test(i))
  34049. return i;
  34050. throw Error("illegal value: " + i)
  34051. }
  34052. ,
  34053. c._parseOption = function(e, i) {
  34054. var n = this.tn.next()
  34055. , r = !1;
  34056. if ("(" === n && (r = !0,
  34057. n = this.tn.next()),
  34058. !t.TYPEREF.test(n))
  34059. throw Error("illegal option name: " + n);
  34060. var o = n;
  34061. r && (this.tn.skip(")"),
  34062. o = "(" + o + ")",
  34063. n = this.tn.peek(),
  34064. t.FQTYPEREF.test(n) && (o += n,
  34065. this.tn.next())),
  34066. this.tn.skip("="),
  34067. this._parseOptionValue(e, o),
  34068. i || this.tn.skip(";")
  34069. }
  34070. ,
  34071. c._parseOptionValue = function(e, i) {
  34072. var n = this.tn.peek();
  34073. if ("{" !== n)
  34074. r(e.options, i, this._readValue(!0));
  34075. else
  34076. for (this.tn.skip("{"); "}" !== (n = this.tn.next()); ) {
  34077. if (!t.NAME.test(n))
  34078. throw Error("illegal option name: " + i + "." + n);
  34079. this.tn.omit(":") ? r(e.options, i + "." + n, this._readValue(!0)) : this._parseOptionValue(e, i + "." + n)
  34080. }
  34081. }
  34082. ,
  34083. c._parseService = function(e) {
  34084. var i = this.tn.next();
  34085. if (!t.NAME.test(i))
  34086. throw Error("illegal service name at line " + this.tn.line + ": " + i);
  34087. var n = i
  34088. , r = {
  34089. name: n,
  34090. rpc: {},
  34091. options: {}
  34092. };
  34093. for (this.tn.skip("{"); "}" !== (i = this.tn.next()); )
  34094. if ("option" === i)
  34095. this._parseOption(r);
  34096. else {
  34097. if ("rpc" !== i)
  34098. throw Error("illegal service token: " + i);
  34099. this._parseServiceRPC(r)
  34100. }
  34101. this.tn.omit(";"),
  34102. e.services.push(r)
  34103. }
  34104. ,
  34105. c._parseServiceRPC = function(e) {
  34106. var i = "rpc"
  34107. , n = this.tn.next();
  34108. if (!t.NAME.test(n))
  34109. throw Error("illegal rpc service method name: " + n);
  34110. var r = n
  34111. , o = {
  34112. request: null,
  34113. response: null,
  34114. request_stream: !1,
  34115. response_stream: !1,
  34116. options: {}
  34117. };
  34118. if (this.tn.skip("("),
  34119. n = this.tn.next(),
  34120. "stream" === n.toLowerCase() && (o.request_stream = !0,
  34121. n = this.tn.next()),
  34122. !t.TYPEREF.test(n))
  34123. throw Error("illegal rpc service request type: " + n);
  34124. if (o.request = n,
  34125. this.tn.skip(")"),
  34126. n = this.tn.next(),
  34127. "returns" !== n.toLowerCase())
  34128. throw Error("illegal rpc service request type delimiter: " + n);
  34129. if (this.tn.skip("("),
  34130. n = this.tn.next(),
  34131. "stream" === n.toLowerCase() && (o.response_stream = !0,
  34132. n = this.tn.next()),
  34133. o.response = n,
  34134. this.tn.skip(")"),
  34135. n = this.tn.peek(),
  34136. "{" === n) {
  34137. for (this.tn.next(); "}" !== (n = this.tn.next()); ) {
  34138. if ("option" !== n)
  34139. throw Error("illegal rpc service token: " + n);
  34140. this._parseOption(o)
  34141. }
  34142. this.tn.omit(";")
  34143. } else
  34144. this.tn.skip(";");
  34145. "undefined" == typeof e[i] && (e[i] = {}),
  34146. e[i][r] = o
  34147. }
  34148. ,
  34149. c._parseMessage = function(e, n) {
  34150. var r = !!n
  34151. , o = this.tn.next()
  34152. , a = {
  34153. name: "",
  34154. fields: [],
  34155. enums: [],
  34156. messages: [],
  34157. options: {},
  34158. services: [],
  34159. oneofs: {}
  34160. };
  34161. if (!t.NAME.test(o))
  34162. throw Error("illegal " + (r ? "group" : "message") + " name: " + o);
  34163. for (a.name = o,
  34164. r && (this.tn.skip("="),
  34165. n.id = i(this.tn.next()),
  34166. a.isGroup = !0),
  34167. o = this.tn.peek(),
  34168. "[" === o && n && this._parseFieldOptions(n),
  34169. this.tn.skip("{"); "}" !== (o = this.tn.next()); )
  34170. if (t.RULE.test(o))
  34171. this._parseMessageField(a, o);
  34172. else if ("oneof" === o)
  34173. this._parseMessageOneOf(a);
  34174. else if ("enum" === o)
  34175. this._parseEnum(a);
  34176. else if ("message" === o)
  34177. this._parseMessage(a);
  34178. else if ("option" === o)
  34179. this._parseOption(a);
  34180. else if ("service" === o)
  34181. this._parseService(a);
  34182. else if ("extensions" === o)
  34183. a.extensions = this._parseExtensionRanges();
  34184. else if ("reserved" === o)
  34185. this._parseIgnored();
  34186. else if ("extend" === o)
  34187. this._parseExtend(a);
  34188. else {
  34189. if (!t.TYPEREF.test(o))
  34190. throw Error("illegal message token: " + o);
  34191. if (!this.proto3)
  34192. throw Error("illegal field rule: " + o);
  34193. this._parseMessageField(a, "optional", o)
  34194. }
  34195. return this.tn.omit(";"),
  34196. e.messages.push(a),
  34197. a
  34198. }
  34199. ,
  34200. c._parseIgnored = function() {
  34201. for (; ";" !== this.tn.peek(); )
  34202. this.tn.next();
  34203. this.tn.skip(";")
  34204. }
  34205. ,
  34206. c._parseMessageField = function(e, n, r) {
  34207. if (!t.RULE.test(n))
  34208. throw Error("illegal message field rule: " + n);
  34209. var o, a = {
  34210. rule: n,
  34211. type: "",
  34212. name: "",
  34213. options: {},
  34214. id: 0
  34215. };
  34216. if ("map" === n) {
  34217. if (r)
  34218. throw Error("illegal type: " + r);
  34219. if (this.tn.skip("<"),
  34220. o = this.tn.next(),
  34221. !t.TYPE.test(o) && !t.TYPEREF.test(o))
  34222. throw Error("illegal message field type: " + o);
  34223. if (a.keytype = o,
  34224. this.tn.skip(","),
  34225. o = this.tn.next(),
  34226. !t.TYPE.test(o) && !t.TYPEREF.test(o))
  34227. throw Error("illegal message field: " + o);
  34228. if (a.type = o,
  34229. this.tn.skip(">"),
  34230. o = this.tn.next(),
  34231. !t.NAME.test(o))
  34232. throw Error("illegal message field name: " + o);
  34233. a.name = o,
  34234. this.tn.skip("="),
  34235. a.id = i(this.tn.next()),
  34236. o = this.tn.peek(),
  34237. "[" === o && this._parseFieldOptions(a),
  34238. this.tn.skip(";")
  34239. } else if (r = "undefined" != typeof r ? r : this.tn.next(),
  34240. "group" === r) {
  34241. var s = this._parseMessage(e, a);
  34242. if (!/^[A-Z]/.test(s.name))
  34243. throw Error("illegal group name: " + s.name);
  34244. a.type = s.name,
  34245. a.name = s.name.toLowerCase(),
  34246. this.tn.omit(";")
  34247. } else {
  34248. if (!t.TYPE.test(r) && !t.TYPEREF.test(r))
  34249. throw Error("illegal message field type: " + r);
  34250. if (a.type = r,
  34251. o = this.tn.next(),
  34252. !t.NAME.test(o))
  34253. throw Error("illegal message field name: " + o);
  34254. a.name = o,
  34255. this.tn.skip("="),
  34256. a.id = i(this.tn.next()),
  34257. o = this.tn.peek(),
  34258. "[" === o && this._parseFieldOptions(a),
  34259. this.tn.skip(";")
  34260. }
  34261. return e.fields.push(a),
  34262. a
  34263. }
  34264. ,
  34265. c._parseMessageOneOf = function(e) {
  34266. var i = this.tn.next();
  34267. if (!t.NAME.test(i))
  34268. throw Error("illegal oneof name: " + i);
  34269. var n, r = i, o = [];
  34270. for (this.tn.skip("{"); "}" !== (i = this.tn.next()); )
  34271. n = this._parseMessageField(e, "optional", i),
  34272. n.oneof = r,
  34273. o.push(n.id);
  34274. this.tn.omit(";"),
  34275. e.oneofs[r] = o
  34276. }
  34277. ,
  34278. c._parseFieldOptions = function(e) {
  34279. this.tn.skip("[");
  34280. for (var t, i = !0; "]" !== (t = this.tn.peek()); )
  34281. i || this.tn.skip(","),
  34282. this._parseOption(e, !0),
  34283. i = !1;
  34284. this.tn.next()
  34285. }
  34286. ,
  34287. c._parseEnum = function(e) {
  34288. var n = {
  34289. name: "",
  34290. values: [],
  34291. options: {}
  34292. }
  34293. , r = this.tn.next();
  34294. if (!t.NAME.test(r))
  34295. throw Error("illegal name: " + r);
  34296. for (n.name = r,
  34297. this.tn.skip("{"); "}" !== (r = this.tn.next()); )
  34298. if ("option" === r)
  34299. this._parseOption(n);
  34300. else {
  34301. if (!t.NAME.test(r))
  34302. throw Error("illegal name: " + r);
  34303. this.tn.skip("=");
  34304. var o = {
  34305. name: r,
  34306. id: i(this.tn.next(), !0)
  34307. };
  34308. r = this.tn.peek(),
  34309. "[" === r && this._parseFieldOptions({
  34310. options: {}
  34311. }),
  34312. this.tn.skip(";"),
  34313. n.values.push(o)
  34314. }
  34315. this.tn.omit(";"),
  34316. e.enums.push(n)
  34317. }
  34318. ,
  34319. c._parseExtensionRanges = function() {
  34320. var t, i, r, o = [];
  34321. do {
  34322. for (i = []; ; ) {
  34323. switch (t = this.tn.next()) {
  34324. case "min":
  34325. r = e.ID_MIN;
  34326. break;
  34327. case "max":
  34328. r = e.ID_MAX;
  34329. break;
  34330. default:
  34331. r = n(t)
  34332. }
  34333. if (i.push(r),
  34334. 2 === i.length)
  34335. break;
  34336. if ("to" !== this.tn.peek()) {
  34337. i.push(r);
  34338. break
  34339. }
  34340. this.tn.next()
  34341. }
  34342. o.push(i)
  34343. } while (this.tn.omit(","));return this.tn.skip(";"),
  34344. o
  34345. }
  34346. ,
  34347. c._parseExtend = function(e) {
  34348. var i = this.tn.next();
  34349. if (!t.TYPEREF.test(i))
  34350. throw Error("illegal extend reference: " + i);
  34351. var n = {
  34352. ref: i,
  34353. fields: []
  34354. };
  34355. for (this.tn.skip("{"); "}" !== (i = this.tn.next()); )
  34356. if (t.RULE.test(i))
  34357. this._parseMessageField(n, i);
  34358. else {
  34359. if (!t.TYPEREF.test(i))
  34360. throw Error("illegal extend token: " + i);
  34361. if (!this.proto3)
  34362. throw Error("illegal field rule: " + i);
  34363. this._parseMessageField(n, "optional", i)
  34364. }
  34365. return this.tn.omit(";"),
  34366. e.messages.push(n),
  34367. n
  34368. }
  34369. ,
  34370. c.toString = function() {
  34371. return "Parser at line " + this.tn.line
  34372. }
  34373. ,
  34374. o.Parser = l,
  34375. o
  34376. }(r, r.Lang),
  34377. r.Reflect = function(e) {
  34378. function i(i) {
  34379. if ("string" == typeof i && (i = e.TYPES[i]),
  34380. "undefined" == typeof i.defaultValue)
  34381. throw Error("default value for type " + i.name + " is not supported");
  34382. return i == e.TYPES.bytes ? new t(0) : i.defaultValue
  34383. }
  34384. function n(t, i) {
  34385. if (t && "number" == typeof t.low && "number" == typeof t.high && "boolean" == typeof t.unsigned && t.low === t.low && t.high === t.high)
  34386. return new e.Long(t.low,t.high,"undefined" == typeof i ? t.unsigned : i);
  34387. if ("string" == typeof t)
  34388. return e.Long.fromString(t, i || !1, 10);
  34389. if ("number" == typeof t)
  34390. return e.Long.fromNumber(t, i || !1);
  34391. throw Error("not convertible to Long")
  34392. }
  34393. function r(t, i) {
  34394. var n = i.readVarint32()
  34395. , o = 7 & n
  34396. , a = n >>> 3;
  34397. switch (o) {
  34398. case e.WIRE_TYPES.VARINT:
  34399. do
  34400. n = i.readUint8();
  34401. while (128 === (128 & n));break;
  34402. case e.WIRE_TYPES.BITS64:
  34403. i.offset += 8;
  34404. break;
  34405. case e.WIRE_TYPES.LDELIM:
  34406. n = i.readVarint32(),
  34407. i.offset += n;
  34408. break;
  34409. case e.WIRE_TYPES.STARTGROUP:
  34410. r(a, i);
  34411. break;
  34412. case e.WIRE_TYPES.ENDGROUP:
  34413. if (a === t)
  34414. return !1;
  34415. throw Error("Illegal GROUPEND after unknown group: " + a + " (" + t + " expected)");
  34416. case e.WIRE_TYPES.BITS32:
  34417. i.offset += 4;
  34418. break;
  34419. default:
  34420. throw Error("Illegal wire type in unknown group " + t + ": " + o)
  34421. }
  34422. return !0
  34423. }
  34424. var o = {}
  34425. , a = function(e, t, i) {
  34426. this.builder = e,
  34427. this.parent = t,
  34428. this.name = i,
  34429. this.className
  34430. }
  34431. , s = a.prototype;
  34432. s.fqn = function() {
  34433. for (var e = this.name, t = this; ; ) {
  34434. if (t = t.parent,
  34435. null == t)
  34436. break;
  34437. e = t.name + "." + e
  34438. }
  34439. return e
  34440. }
  34441. ,
  34442. s.toString = function(e) {
  34443. return (e ? this.className + " " : "") + this.fqn()
  34444. }
  34445. ,
  34446. s.build = function() {
  34447. throw Error(this.toString(!0) + " cannot be built directly")
  34448. }
  34449. ,
  34450. o.T = a;
  34451. var l = function(e, t, i, n, r) {
  34452. a.call(this, e, t, i),
  34453. this.className = "Namespace",
  34454. this.children = [],
  34455. this.options = n || {},
  34456. this.syntax = r || "proto2"
  34457. }
  34458. , c = l.prototype = Object.create(a.prototype);
  34459. c.getChildren = function(e) {
  34460. if (e = e || null,
  34461. null == e)
  34462. return this.children.slice();
  34463. for (var t = [], i = 0, n = this.children.length; i < n; ++i)
  34464. this.children[i]instanceof e && t.push(this.children[i]);
  34465. return t
  34466. }
  34467. ,
  34468. c.addChild = function(e) {
  34469. var t;
  34470. if (t = this.getChild(e.name))
  34471. if (t instanceof d.Field && t.name !== t.originalName && null === this.getChild(t.originalName))
  34472. t.name = t.originalName;
  34473. else {
  34474. if (!(e instanceof d.Field && e.name !== e.originalName && null === this.getChild(e.originalName)))
  34475. throw Error("Duplicate name in namespace " + this.toString(!0) + ": " + e.name);
  34476. e.name = e.originalName
  34477. }
  34478. this.children.push(e)
  34479. }
  34480. ,
  34481. c.getChild = function(e) {
  34482. for (var t = "number" == typeof e ? "id" : "name", i = 0, n = this.children.length; i < n; ++i)
  34483. if (this.children[i][t] === e)
  34484. return this.children[i];
  34485. return null
  34486. }
  34487. ,
  34488. c.resolve = function(e, t) {
  34489. var i = "string" == typeof e ? e.split(".") : e
  34490. , n = this
  34491. , r = 0;
  34492. if ("" === i[r]) {
  34493. for (; null !== n.parent; )
  34494. n = n.parent;
  34495. r++
  34496. }
  34497. var a;
  34498. do {
  34499. do {
  34500. if (!(n instanceof o.Namespace)) {
  34501. n = null;
  34502. break
  34503. }
  34504. if (a = n.getChild(i[r]),
  34505. !a || !(a instanceof o.T) || t && !(a instanceof o.Namespace)) {
  34506. n = null;
  34507. break
  34508. }
  34509. n = a,
  34510. r++
  34511. } while (r < i.length);if (null != n)
  34512. break;
  34513. if (null !== this.parent)
  34514. return this.parent.resolve(e, t)
  34515. } while (null != n);return n
  34516. }
  34517. ,
  34518. c.qn = function(e) {
  34519. var t = []
  34520. , i = e;
  34521. do
  34522. t.unshift(i.name),
  34523. i = i.parent;
  34524. while (null !== i);for (var n = 1; n <= t.length; n++) {
  34525. var r = t.slice(t.length - n);
  34526. if (e === this.resolve(r, e instanceof o.Namespace))
  34527. return r.join(".")
  34528. }
  34529. return e.fqn()
  34530. }
  34531. ,
  34532. c.build = function() {
  34533. for (var e, t = {}, i = this.children, n = 0, r = i.length; n < r; ++n)
  34534. e = i[n],
  34535. e instanceof l && (t[e.name] = e.build());
  34536. return Object.defineProperty && Object.defineProperty(t, "$options", {
  34537. value: this.buildOpt()
  34538. }),
  34539. t
  34540. }
  34541. ,
  34542. c.buildOpt = function() {
  34543. for (var e = {}, t = Object.keys(this.options), i = 0, n = t.length; i < n; ++i) {
  34544. var r = t[i]
  34545. , o = this.options[t[i]];
  34546. e[r] = o
  34547. }
  34548. return e
  34549. }
  34550. ,
  34551. c.getOption = function(e) {
  34552. return "undefined" == typeof e ? this.options : "undefined" != typeof this.options[e] ? this.options[e] : null
  34553. }
  34554. ,
  34555. o.Namespace = l;
  34556. var h = function(t, i, n, r) {
  34557. if (this.type = t,
  34558. this.resolvedType = i,
  34559. this.isMapKey = n,
  34560. this.syntax = r,
  34561. n && e.MAP_KEY_TYPES.indexOf(t) < 0)
  34562. throw Error("Invalid map key type: " + t.name)
  34563. }
  34564. , u = h.prototype;
  34565. h.defaultFieldValue = i,
  34566. u.verifyValue = function(i) {
  34567. function r(e, t) {
  34568. throw Error("Illegal value for " + o.toString(!0) + " of type " + o.type.name + ": " + e + " (" + t + ")")
  34569. }
  34570. var o = this;
  34571. switch (this.type) {
  34572. case e.TYPES.int32:
  34573. case e.TYPES.sint32:
  34574. case e.TYPES.sfixed32:
  34575. return ("number" != typeof i || i === i && i % 1 !== 0) && r(typeof i, "not an integer"),
  34576. i > 4294967295 ? 0 | i : i;
  34577. case e.TYPES.uint32:
  34578. case e.TYPES.fixed32:
  34579. return ("number" != typeof i || i === i && i % 1 !== 0) && r(typeof i, "not an integer"),
  34580. i < 0 ? i >>> 0 : i;
  34581. case e.TYPES.int64:
  34582. case e.TYPES.sint64:
  34583. case e.TYPES.sfixed64:
  34584. if (e.Long)
  34585. try {
  34586. return n(i, !1)
  34587. } catch (e) {
  34588. r(typeof i, e.message)
  34589. }
  34590. else
  34591. r(typeof i, "requires Long.js");
  34592. case e.TYPES.uint64:
  34593. case e.TYPES.fixed64:
  34594. if (e.Long)
  34595. try {
  34596. return n(i, !0)
  34597. } catch (e) {
  34598. r(typeof i, e.message)
  34599. }
  34600. else
  34601. r(typeof i, "requires Long.js");
  34602. case e.TYPES.bool:
  34603. return "boolean" != typeof i && r(typeof i, "not a boolean"),
  34604. i;
  34605. case e.TYPES.float:
  34606. case e.TYPES.double:
  34607. return "number" != typeof i && r(typeof i, "not a number"),
  34608. i;
  34609. case e.TYPES.string:
  34610. return "string" == typeof i || i && i instanceof String || r(typeof i, "not a string"),
  34611. "" + i;
  34612. case e.TYPES.bytes:
  34613. return t.isByteBuffer(i) ? i : t.wrap(i, "base64");
  34614. case e.TYPES.enum:
  34615. var a = this.resolvedType.getChildren(e.Reflect.Enum.Value);
  34616. for (l = 0; l < a.length; l++) {
  34617. if (a[l].name == i)
  34618. return a[l].id;
  34619. if (a[l].id == i)
  34620. return a[l].id
  34621. }
  34622. if ("proto3" === this.syntax)
  34623. return ("number" != typeof i || i === i && i % 1 !== 0) && r(typeof i, "not an integer"),
  34624. (i > 4294967295 || i < 0) && r(typeof i, "not in range for uint32"),
  34625. i;
  34626. r(i, "not a valid enum value");
  34627. case e.TYPES.group:
  34628. case e.TYPES.message:
  34629. if (i && "object" == typeof i || r(typeof i, "object expected"),
  34630. i instanceof this.resolvedType.clazz)
  34631. return i;
  34632. if (i instanceof e.Builder.Message) {
  34633. var s = {};
  34634. for (var l in i)
  34635. i.hasOwnProperty(l) && (s[l] = i[l]);
  34636. i = s
  34637. }
  34638. return new this.resolvedType.clazz(i)
  34639. }
  34640. throw Error("[INTERNAL] Illegal value for " + this.toString(!0) + ": " + i + " (undefined type " + this.type + ")")
  34641. }
  34642. ,
  34643. u.calculateLength = function(i, n) {
  34644. if (null === n)
  34645. return 0;
  34646. var r;
  34647. switch (this.type) {
  34648. case e.TYPES.int32:
  34649. return n < 0 ? t.calculateVarint64(n) : t.calculateVarint32(n);
  34650. case e.TYPES.uint32:
  34651. return t.calculateVarint32(n);
  34652. case e.TYPES.sint32:
  34653. return t.calculateVarint32(t.zigZagEncode32(n));
  34654. case e.TYPES.fixed32:
  34655. case e.TYPES.sfixed32:
  34656. case e.TYPES.float:
  34657. return 4;
  34658. case e.TYPES.int64:
  34659. case e.TYPES.uint64:
  34660. return t.calculateVarint64(n);
  34661. case e.TYPES.sint64:
  34662. return t.calculateVarint64(t.zigZagEncode64(n));
  34663. case e.TYPES.fixed64:
  34664. case e.TYPES.sfixed64:
  34665. return 8;
  34666. case e.TYPES.bool:
  34667. return 1;
  34668. case e.TYPES.enum:
  34669. return t.calculateVarint32(n);
  34670. case e.TYPES.double:
  34671. return 8;
  34672. case e.TYPES.string:
  34673. return r = t.calculateUTF8Bytes(n),
  34674. t.calculateVarint32(r) + r;
  34675. case e.TYPES.bytes:
  34676. if (n.remaining() < 0)
  34677. throw Error("Illegal value for " + this.toString(!0) + ": " + n.remaining() + " bytes remaining");
  34678. return t.calculateVarint32(n.remaining()) + n.remaining();
  34679. case e.TYPES.message:
  34680. return r = this.resolvedType.calculate(n),
  34681. t.calculateVarint32(r) + r;
  34682. case e.TYPES.group:
  34683. return r = this.resolvedType.calculate(n),
  34684. r + t.calculateVarint32(i << 3 | e.WIRE_TYPES.ENDGROUP)
  34685. }
  34686. throw Error("[INTERNAL] Illegal value to encode in " + this.toString(!0) + ": " + n + " (unknown type)")
  34687. }
  34688. ,
  34689. u.encodeValue = function(i, n, r) {
  34690. if (null === n)
  34691. return r;
  34692. switch (this.type) {
  34693. case e.TYPES.int32:
  34694. n < 0 ? r.writeVarint64(n) : r.writeVarint32(n);
  34695. break;
  34696. case e.TYPES.uint32:
  34697. r.writeVarint32(n);
  34698. break;
  34699. case e.TYPES.sint32:
  34700. r.writeVarint32ZigZag(n);
  34701. break;
  34702. case e.TYPES.fixed32:
  34703. r.writeUint32(n);
  34704. break;
  34705. case e.TYPES.sfixed32:
  34706. r.writeInt32(n);
  34707. break;
  34708. case e.TYPES.int64:
  34709. case e.TYPES.uint64:
  34710. r.writeVarint64(n);
  34711. break;
  34712. case e.TYPES.sint64:
  34713. r.writeVarint64ZigZag(n);
  34714. break;
  34715. case e.TYPES.fixed64:
  34716. r.writeUint64(n);
  34717. break;
  34718. case e.TYPES.sfixed64:
  34719. r.writeInt64(n);
  34720. break;
  34721. case e.TYPES.bool:
  34722. "string" == typeof n ? r.writeVarint32("false" === n.toLowerCase() ? 0 : !!n) : r.writeVarint32(n ? 1 : 0);
  34723. break;
  34724. case e.TYPES.enum:
  34725. r.writeVarint32(n);
  34726. break;
  34727. case e.TYPES.float:
  34728. r.writeFloat32(n);
  34729. break;
  34730. case e.TYPES.double:
  34731. r.writeFloat64(n);
  34732. break;
  34733. case e.TYPES.string:
  34734. r.writeVString(n);
  34735. break;
  34736. case e.TYPES.bytes:
  34737. if (n.remaining() < 0)
  34738. throw Error("Illegal value for " + this.toString(!0) + ": " + n.remaining() + " bytes remaining");
  34739. var o = n.offset;
  34740. r.writeVarint32(n.remaining()),
  34741. r.append(n),
  34742. n.offset = o;
  34743. break;
  34744. case e.TYPES.message:
  34745. var a = (new t).LE();
  34746. this.resolvedType.encode(n, a),
  34747. r.writeVarint32(a.offset),
  34748. r.append(a.flip());
  34749. break;
  34750. case e.TYPES.group:
  34751. this.resolvedType.encode(n, r),
  34752. r.writeVarint32(i << 3 | e.WIRE_TYPES.ENDGROUP);
  34753. break;
  34754. default:
  34755. throw Error("[INTERNAL] Illegal value to encode in " + this.toString(!0) + ": " + n + " (unknown type)")
  34756. }
  34757. return r
  34758. }
  34759. ,
  34760. u.decode = function(t, i, n) {
  34761. if (i != this.type.wireType)
  34762. throw Error("Unexpected wire type for element");
  34763. var r, o;
  34764. switch (this.type) {
  34765. case e.TYPES.int32:
  34766. return 0 | t.readVarint32();
  34767. case e.TYPES.uint32:
  34768. return t.readVarint32() >>> 0;
  34769. case e.TYPES.sint32:
  34770. return 0 | t.readVarint32ZigZag();
  34771. case e.TYPES.fixed32:
  34772. return t.readUint32() >>> 0;
  34773. case e.TYPES.sfixed32:
  34774. return 0 | t.readInt32();
  34775. case e.TYPES.int64:
  34776. return t.readVarint64();
  34777. case e.TYPES.uint64:
  34778. return t.readVarint64().toUnsigned();
  34779. case e.TYPES.sint64:
  34780. return t.readVarint64ZigZag();
  34781. case e.TYPES.fixed64:
  34782. return t.readUint64();
  34783. case e.TYPES.sfixed64:
  34784. return t.readInt64();
  34785. case e.TYPES.bool:
  34786. return !!t.readVarint32();
  34787. case e.TYPES.enum:
  34788. return t.readVarint32();
  34789. case e.TYPES.float:
  34790. return t.readFloat();
  34791. case e.TYPES.double:
  34792. return t.readDouble();
  34793. case e.TYPES.string:
  34794. return t.readVString();
  34795. case e.TYPES.bytes:
  34796. if (o = t.readVarint32(),
  34797. t.remaining() < o)
  34798. throw Error("Illegal number of bytes for " + this.toString(!0) + ": " + o + " required but got only " + t.remaining());
  34799. return r = t.clone(),
  34800. r.limit = r.offset + o,
  34801. t.offset += o,
  34802. r;
  34803. case e.TYPES.message:
  34804. return o = t.readVarint32(),
  34805. this.resolvedType.decode(t, o);
  34806. case e.TYPES.group:
  34807. return this.resolvedType.decode(t, -1, n)
  34808. }
  34809. throw Error("[INTERNAL] Illegal decode type")
  34810. }
  34811. ,
  34812. u.valueFromString = function(i) {
  34813. if (!this.isMapKey)
  34814. throw Error("valueFromString() called on non-map-key element");
  34815. switch (this.type) {
  34816. case e.TYPES.int32:
  34817. case e.TYPES.sint32:
  34818. case e.TYPES.sfixed32:
  34819. case e.TYPES.uint32:
  34820. case e.TYPES.fixed32:
  34821. return this.verifyValue(parseInt(i));
  34822. case e.TYPES.int64:
  34823. case e.TYPES.sint64:
  34824. case e.TYPES.sfixed64:
  34825. case e.TYPES.uint64:
  34826. case e.TYPES.fixed64:
  34827. return this.verifyValue(i);
  34828. case e.TYPES.bool:
  34829. return "true" === i;
  34830. case e.TYPES.string:
  34831. return this.verifyValue(i);
  34832. case e.TYPES.bytes:
  34833. return t.fromBinary(i)
  34834. }
  34835. }
  34836. ,
  34837. u.valueToString = function(t) {
  34838. if (!this.isMapKey)
  34839. throw Error("valueToString() called on non-map-key element");
  34840. return this.type === e.TYPES.bytes ? t.toString("binary") : t.toString()
  34841. }
  34842. ,
  34843. o.Element = h;
  34844. var d = function(e, t, i, n, r, o) {
  34845. l.call(this, e, t, i, n, o),
  34846. this.className = "Message",
  34847. this.extensions = void 0,
  34848. this.clazz = null,
  34849. this.isGroup = !!r,
  34850. this._fields = null,
  34851. this._fieldsById = null,
  34852. this._fieldsByName = null
  34853. }
  34854. , p = d.prototype = Object.create(l.prototype);
  34855. p.build = function(i) {
  34856. if (this.clazz && !i)
  34857. return this.clazz;
  34858. var n = function(e, i) {
  34859. function n(i, r, o, a) {
  34860. if (null === i || "object" != typeof i) {
  34861. if (a && a instanceof e.Reflect.Enum) {
  34862. var s = e.Reflect.Enum.getName(a.object, i);
  34863. if (null !== s)
  34864. return s
  34865. }
  34866. return i
  34867. }
  34868. if (t.isByteBuffer(i))
  34869. return r ? i.toBase64() : i.toBuffer();
  34870. if (e.Long.isLong(i))
  34871. return o ? i.toString() : e.Long.fromValue(i);
  34872. var l;
  34873. if (Array.isArray(i))
  34874. return l = [],
  34875. i.forEach(function(e, t) {
  34876. l[t] = n(e, r, o, a)
  34877. }),
  34878. l;
  34879. if (l = {},
  34880. i instanceof e.Map) {
  34881. for (var c = i.entries(), h = c.next(); !h.done; h = c.next())
  34882. l[i.keyElem.valueToString(h.value[0])] = n(h.value[1], r, o, i.valueElem.resolvedType);
  34883. return l
  34884. }
  34885. var u = i.$type
  34886. , d = void 0;
  34887. for (var p in i)
  34888. i.hasOwnProperty(p) && (u && (d = u.getChild(p)) ? l[p] = n(i[p], r, o, d.resolvedType) : l[p] = n(i[p], r, o));
  34889. return l
  34890. }
  34891. var r = i.getChildren(e.Reflect.Message.Field)
  34892. , o = i.getChildren(e.Reflect.Message.OneOf)
  34893. , a = function(n, s) {
  34894. e.Builder.Message.call(this);
  34895. for (var l = 0, c = o.length; l < c; ++l)
  34896. this[o[l].name] = null;
  34897. for (l = 0,
  34898. c = r.length; l < c; ++l) {
  34899. var h = r[l];
  34900. this[h.name] = h.repeated ? [] : h.map ? new e.Map(h) : null,
  34901. !h.required && "proto3" !== i.syntax || null === h.defaultValue || (this[h.name] = h.defaultValue)
  34902. }
  34903. if (arguments.length > 0) {
  34904. var u;
  34905. 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)
  34906. for (l = 0,
  34907. c = arguments.length; l < c; ++l)
  34908. "undefined" != typeof (u = arguments[l]) && this.$set(r[l].name, u);
  34909. else
  34910. this.$set(n)
  34911. }
  34912. }
  34913. , s = a.prototype = Object.create(e.Builder.Message.prototype);
  34914. s.add = function(t, n, r) {
  34915. var o = i._fieldsByName[t];
  34916. if (!r) {
  34917. if (!o)
  34918. throw Error(this + "#" + t + " is undefined");
  34919. if (!(o instanceof e.Reflect.Message.Field))
  34920. throw Error(this + "#" + t + " is not a field: " + o.toString(!0));
  34921. if (!o.repeated)
  34922. throw Error(this + "#" + t + " is not a repeated field");
  34923. n = o.verifyValue(n, !0)
  34924. }
  34925. return null === this[t] && (this[t] = []),
  34926. this[t].push(n),
  34927. this
  34928. }
  34929. ,
  34930. s.$add = s.add,
  34931. s.set = function(t, n, r) {
  34932. if (t && "object" == typeof t) {
  34933. r = n;
  34934. for (var o in t)
  34935. t.hasOwnProperty(o) && "undefined" != typeof (n = t[o]) && this.$set(o, n, r);
  34936. return this
  34937. }
  34938. var a = i._fieldsByName[t];
  34939. if (r)
  34940. this[t] = n;
  34941. else {
  34942. if (!a)
  34943. throw Error(this + "#" + t + " is not a field: undefined");
  34944. if (!(a instanceof e.Reflect.Message.Field))
  34945. throw Error(this + "#" + t + " is not a field: " + a.toString(!0));
  34946. this[a.name] = n = a.verifyValue(n)
  34947. }
  34948. if (a && a.oneof) {
  34949. var s = this[a.oneof.name];
  34950. null !== n ? (null !== s && s !== a.name && (this[s] = null),
  34951. this[a.oneof.name] = a.name) : s === t && (this[a.oneof.name] = null)
  34952. }
  34953. return this
  34954. }
  34955. ,
  34956. s.$set = s.set,
  34957. s.get = function(t, n) {
  34958. if (n)
  34959. return this[t];
  34960. var r = i._fieldsByName[t];
  34961. if (!(r && r instanceof e.Reflect.Message.Field))
  34962. throw Error(this + "#" + t + " is not a field: undefined");
  34963. if (!(r instanceof e.Reflect.Message.Field))
  34964. throw Error(this + "#" + t + " is not a field: " + r.toString(!0));
  34965. return this[r.name]
  34966. }
  34967. ,
  34968. s.$get = s.get;
  34969. for (var l = 0; l < r.length; l++) {
  34970. var c = r[l];
  34971. c instanceof e.Reflect.Message.ExtensionField || i.builder.options.populateAccessors && function(e) {
  34972. var t = e.originalName.replace(/(_[a-zA-Z])/g, function(e) {
  34973. return e.toUpperCase().replace("_", "")
  34974. });
  34975. t = t.substring(0, 1).toUpperCase() + t.substring(1);
  34976. var n = e.originalName.replace(/([A-Z])/g, function(e) {
  34977. return "_" + e
  34978. })
  34979. , r = function(t, i) {
  34980. return this[e.name] = i ? t : e.verifyValue(t),
  34981. this
  34982. }
  34983. , o = function() {
  34984. return this[e.name]
  34985. };
  34986. null === i.getChild("set" + t) && (s["set" + t] = r),
  34987. null === i.getChild("set_" + n) && (s["set_" + n] = r),
  34988. null === i.getChild("get" + t) && (s["get" + t] = o),
  34989. null === i.getChild("get_" + n) && (s["get_" + n] = o)
  34990. }(c)
  34991. }
  34992. s.encode = function(e, n) {
  34993. "boolean" == typeof e && (n = e,
  34994. e = void 0);
  34995. var r = !1;
  34996. e || (e = new t,
  34997. r = !0);
  34998. var o = e.littleEndian;
  34999. try {
  35000. return i.encode(this, e.LE(), n),
  35001. (r ? e.flip() : e).LE(o)
  35002. } catch (t) {
  35003. throw e.LE(o),
  35004. t
  35005. }
  35006. }
  35007. ,
  35008. a.encode = function(e, t, i) {
  35009. return new a(e).encode(t, i)
  35010. }
  35011. ,
  35012. s.calculate = function() {
  35013. return i.calculate(this)
  35014. }
  35015. ,
  35016. s.encodeDelimited = function(e, n) {
  35017. var r = !1;
  35018. e || (e = new t,
  35019. r = !0);
  35020. var o = (new t).LE();
  35021. return i.encode(this, o, n).flip(),
  35022. e.writeVarint32(o.remaining()),
  35023. e.append(o),
  35024. r ? e.flip() : e
  35025. }
  35026. ,
  35027. s.encodeAB = function() {
  35028. try {
  35029. return this.encode().toArrayBuffer()
  35030. } catch (e) {
  35031. throw e.encoded && (e.encoded = e.encoded.toArrayBuffer()),
  35032. e
  35033. }
  35034. }
  35035. ,
  35036. s.toArrayBuffer = s.encodeAB,
  35037. s.encodeNB = function() {
  35038. try {
  35039. return this.encode().toBuffer()
  35040. } catch (e) {
  35041. throw e.encoded && (e.encoded = e.encoded.toBuffer()),
  35042. e
  35043. }
  35044. }
  35045. ,
  35046. s.toBuffer = s.encodeNB,
  35047. s.encode64 = function() {
  35048. try {
  35049. return this.encode().toBase64()
  35050. } catch (e) {
  35051. throw e.encoded && (e.encoded = e.encoded.toBase64()),
  35052. e
  35053. }
  35054. }
  35055. ,
  35056. s.toBase64 = s.encode64,
  35057. s.encodeHex = function() {
  35058. try {
  35059. return this.encode().toHex()
  35060. } catch (e) {
  35061. throw e.encoded && (e.encoded = e.encoded.toHex()),
  35062. e
  35063. }
  35064. }
  35065. ,
  35066. s.toHex = s.encodeHex,
  35067. s.toRaw = function(e, t) {
  35068. return n(this, !!e, !!t, this.$type)
  35069. }
  35070. ,
  35071. s.encodeJSON = function() {
  35072. return JSON.stringify(n(this, !0, !0, this.$type))
  35073. }
  35074. ,
  35075. a.decode = function(e, n, r) {
  35076. "string" == typeof n && (r = n,
  35077. n = -1),
  35078. "string" == typeof e && (e = t.wrap(e, r ? r : "base64")),
  35079. e = t.isByteBuffer(e) ? e : t.wrap(e);
  35080. var o = e.littleEndian;
  35081. try {
  35082. var a = i.decode(e.LE());
  35083. return e.LE(o),
  35084. a
  35085. } catch (t) {
  35086. throw e.LE(o),
  35087. t
  35088. }
  35089. }
  35090. ,
  35091. a.decodeDelimited = function(e, n) {
  35092. if ("string" == typeof e && (e = t.wrap(e, n ? n : "base64")),
  35093. e = t.isByteBuffer(e) ? e : t.wrap(e),
  35094. e.remaining() < 1)
  35095. return null;
  35096. var r = e.offset
  35097. , o = e.readVarint32();
  35098. if (e.remaining() < o)
  35099. return e.offset = r,
  35100. null;
  35101. try {
  35102. var a = i.decode(e.slice(e.offset, e.offset + o).LE());
  35103. return e.offset += o,
  35104. a
  35105. } catch (t) {
  35106. throw e.offset += o,
  35107. t
  35108. }
  35109. }
  35110. ,
  35111. a.decode64 = function(e) {
  35112. return a.decode(e, "base64")
  35113. }
  35114. ,
  35115. a.decodeHex = function(e) {
  35116. return a.decode(e, "hex")
  35117. }
  35118. ,
  35119. a.decodeJSON = function(e) {
  35120. return new a(JSON.parse(e))
  35121. }
  35122. ,
  35123. s.toString = function() {
  35124. return i.toString()
  35125. }
  35126. ;
  35127. return Object.defineProperty && (Object.defineProperty(a, "$options", {
  35128. value: i.buildOpt()
  35129. }),
  35130. Object.defineProperty(s, "$options", {
  35131. value: a.$options
  35132. }),
  35133. Object.defineProperty(a, "$type", {
  35134. value: i
  35135. }),
  35136. Object.defineProperty(s, "$type", {
  35137. value: i
  35138. })),
  35139. a
  35140. }(e, this);
  35141. this._fields = [],
  35142. this._fieldsById = {},
  35143. this._fieldsByName = {};
  35144. for (var r, o = 0, a = this.children.length; o < a; o++)
  35145. if (r = this.children[o],
  35146. r instanceof A || r instanceof d || r instanceof E) {
  35147. if (n.hasOwnProperty(r.name))
  35148. throw Error("Illegal reflect child of " + this.toString(!0) + ": " + r.toString(!0) + " cannot override static property '" + r.name + "'");
  35149. n[r.name] = r.build()
  35150. } else if (r instanceof d.Field)
  35151. r.build(),
  35152. this._fields.push(r),
  35153. this._fieldsById[r.id] = r,
  35154. this._fieldsByName[r.name] = r;
  35155. else if (!(r instanceof d.OneOf || r instanceof I))
  35156. throw Error("Illegal reflect child of " + this.toString(!0) + ": " + this.children[o].toString(!0));
  35157. return this.clazz = n
  35158. }
  35159. ,
  35160. p.encode = function(e, t, i) {
  35161. for (var n, r, o = null, a = 0, s = this._fields.length; a < s; ++a)
  35162. n = this._fields[a],
  35163. r = e[n.name],
  35164. n.required && null === r ? null === o && (o = n) : n.encode(i ? r : n.verifyValue(r), t, e);
  35165. if (null !== o) {
  35166. var l = Error("Missing at least one required field for " + this.toString(!0) + ": " + o);
  35167. throw l.encoded = t,
  35168. l
  35169. }
  35170. return t
  35171. }
  35172. ,
  35173. p.calculate = function(e) {
  35174. for (var t, i, n = 0, r = 0, o = this._fields.length; r < o; ++r) {
  35175. if (t = this._fields[r],
  35176. i = e[t.name],
  35177. t.required && null === i)
  35178. throw Error("Missing at least one required field for " + this.toString(!0) + ": " + t);
  35179. n += t.calculate(i, e)
  35180. }
  35181. return n
  35182. }
  35183. ,
  35184. p.decode = function(t, i, n) {
  35185. i = "number" == typeof i ? i : -1;
  35186. for (var o, a, s, l, c = t.offset, h = new this.clazz; t.offset < c + i || i === -1 && t.remaining() > 0; ) {
  35187. if (o = t.readVarint32(),
  35188. a = 7 & o,
  35189. s = o >>> 3,
  35190. a === e.WIRE_TYPES.ENDGROUP) {
  35191. if (s !== n)
  35192. throw Error("Illegal group end indicator for " + this.toString(!0) + ": " + s + " (" + (n ? n + " expected" : "not a group") + ")");
  35193. break
  35194. }
  35195. if (l = this._fieldsById[s]) {
  35196. if (l.repeated && !l.options.packed)
  35197. h[l.name].push(l.decode(a, t));
  35198. else if (l.map) {
  35199. var u = l.decode(a, t);
  35200. h[l.name].set(u[0], u[1])
  35201. } else if (h[l.name] = l.decode(a, t),
  35202. l.oneof) {
  35203. var d = h[l.oneof.name];
  35204. null !== d && d !== l.name && (h[d] = null),
  35205. h[l.oneof.name] = l.name
  35206. }
  35207. } else
  35208. switch (a) {
  35209. case e.WIRE_TYPES.VARINT:
  35210. t.readVarint32();
  35211. break;
  35212. case e.WIRE_TYPES.BITS32:
  35213. t.offset += 4;
  35214. break;
  35215. case e.WIRE_TYPES.BITS64:
  35216. t.offset += 8;
  35217. break;
  35218. case e.WIRE_TYPES.LDELIM:
  35219. var p = t.readVarint32();
  35220. t.offset += p;
  35221. break;
  35222. case e.WIRE_TYPES.STARTGROUP:
  35223. for (; r(s, t); )
  35224. ;
  35225. break;
  35226. default:
  35227. throw Error("Illegal wire type for unknown field " + s + " in " + this.toString(!0) + "#decode: " + a)
  35228. }
  35229. }
  35230. for (var f = 0, g = this._fields.length; f < g; ++f)
  35231. if (l = this._fields[f],
  35232. null === h[l.name])
  35233. if ("proto3" === this.syntax)
  35234. h[l.name] = l.defaultValue;
  35235. else {
  35236. if (l.required) {
  35237. var m = Error("Missing at least one required field for " + this.toString(!0) + ": " + l.name);
  35238. throw m.decoded = h,
  35239. m
  35240. }
  35241. e.populateDefaults && null !== l.defaultValue && (h[l.name] = l.defaultValue)
  35242. }
  35243. return h
  35244. }
  35245. ,
  35246. o.Message = d;
  35247. var f = function(t, i, n, r, o, s, l, c, h, u) {
  35248. a.call(this, t, i, s),
  35249. this.className = "Message.Field",
  35250. this.required = "required" === n,
  35251. this.repeated = "repeated" === n,
  35252. this.map = "map" === n,
  35253. this.keyType = r || null,
  35254. this.type = o,
  35255. this.resolvedType = null,
  35256. this.id = l,
  35257. this.options = c || {},
  35258. this.defaultValue = null,
  35259. this.oneof = h || null,
  35260. this.syntax = u || "proto2",
  35261. this.originalName = this.name,
  35262. this.element = null,
  35263. this.keyElement = null,
  35264. !this.builder.options.convertFieldsToCamelCase || this instanceof d.ExtensionField || (this.name = e.Util.toCamelCase(this.name))
  35265. }
  35266. , g = f.prototype = Object.create(a.prototype);
  35267. g.build = function() {
  35268. this.element = new h(this.type,this.resolvedType,!1,this.syntax),
  35269. this.map && (this.keyElement = new h(this.keyType,void 0,!0,this.syntax)),
  35270. "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)
  35271. }
  35272. ,
  35273. g.verifyValue = function(t, i) {
  35274. function n(e, t) {
  35275. throw Error("Illegal value for " + r.toString(!0) + " of type " + r.type.name + ": " + e + " (" + t + ")")
  35276. }
  35277. i = i || !1;
  35278. var r = this;
  35279. if (null === t)
  35280. return this.required && n(typeof t, "required"),
  35281. "proto3" === this.syntax && this.type !== e.TYPES.message && n(typeof t, "proto3 field without field presence cannot be null"),
  35282. null;
  35283. var o;
  35284. if (this.repeated && !i) {
  35285. Array.isArray(t) || (t = [t]);
  35286. var a = [];
  35287. for (o = 0; o < t.length; o++)
  35288. a.push(this.element.verifyValue(t[o]));
  35289. return a
  35290. }
  35291. return this.map && !i ? t instanceof e.Map ? t : (t instanceof Object || n(typeof t, "expected ProtoBuf.Map or raw object for map field"),
  35292. new e.Map(this,t)) : (!this.repeated && Array.isArray(t) && n(typeof t, "no array expected"),
  35293. this.element.verifyValue(t))
  35294. }
  35295. ,
  35296. g.hasWirePresence = function(t, i) {
  35297. if ("proto3" !== this.syntax)
  35298. return null !== t;
  35299. if (this.oneof && i[this.oneof.name] === this.name)
  35300. return !0;
  35301. switch (this.type) {
  35302. case e.TYPES.int32:
  35303. case e.TYPES.sint32:
  35304. case e.TYPES.sfixed32:
  35305. case e.TYPES.uint32:
  35306. case e.TYPES.fixed32:
  35307. return 0 !== t;
  35308. case e.TYPES.int64:
  35309. case e.TYPES.sint64:
  35310. case e.TYPES.sfixed64:
  35311. case e.TYPES.uint64:
  35312. case e.TYPES.fixed64:
  35313. return 0 !== t.low || 0 !== t.high;
  35314. case e.TYPES.bool:
  35315. return t;
  35316. case e.TYPES.float:
  35317. case e.TYPES.double:
  35318. return 0 !== t;
  35319. case e.TYPES.string:
  35320. return t.length > 0;
  35321. case e.TYPES.bytes:
  35322. return t.remaining() > 0;
  35323. case e.TYPES.enum:
  35324. return 0 !== t;
  35325. case e.TYPES.message:
  35326. return null !== t;
  35327. default:
  35328. return !0
  35329. }
  35330. }
  35331. ,
  35332. g.encode = function(i, n, r) {
  35333. if (null === this.type || "object" != typeof this.type)
  35334. throw Error("[INTERNAL] Unresolved type in " + this.toString(!0) + ": " + this.type);
  35335. if (null === i || this.repeated && 0 == i.length)
  35336. return n;
  35337. try {
  35338. if (this.repeated) {
  35339. var o;
  35340. if (this.options.packed && e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0) {
  35341. n.writeVarint32(this.id << 3 | e.WIRE_TYPES.LDELIM),
  35342. n.ensureCapacity(n.offset += 1);
  35343. var a = n.offset;
  35344. for (o = 0; o < i.length; o++)
  35345. this.element.encodeValue(this.id, i[o], n);
  35346. var s = n.offset - a
  35347. , l = t.calculateVarint32(s);
  35348. if (l > 1) {
  35349. var c = n.slice(a, n.offset);
  35350. a += l - 1,
  35351. n.offset = a,
  35352. n.append(c)
  35353. }
  35354. n.writeVarint32(s, a - l)
  35355. } else
  35356. for (o = 0; o < i.length; o++)
  35357. n.writeVarint32(this.id << 3 | this.type.wireType),
  35358. this.element.encodeValue(this.id, i[o], n)
  35359. } else
  35360. this.map ? i.forEach(function(i, r, o) {
  35361. var a = t.calculateVarint32(8 | this.keyType.wireType) + this.keyElement.calculateLength(1, r) + t.calculateVarint32(16 | this.type.wireType) + this.element.calculateLength(2, i);
  35362. n.writeVarint32(this.id << 3 | e.WIRE_TYPES.LDELIM),
  35363. n.writeVarint32(a),
  35364. n.writeVarint32(8 | this.keyType.wireType),
  35365. this.keyElement.encodeValue(1, r, n),
  35366. n.writeVarint32(16 | this.type.wireType),
  35367. this.element.encodeValue(2, i, n)
  35368. }, this) : this.hasWirePresence(i, r) && (n.writeVarint32(this.id << 3 | this.type.wireType),
  35369. this.element.encodeValue(this.id, i, n))
  35370. } catch (e) {
  35371. throw Error("Illegal value for " + this.toString(!0) + ": " + i + " (" + e + ")")
  35372. }
  35373. return n
  35374. }
  35375. ,
  35376. g.calculate = function(i, n) {
  35377. if (i = this.verifyValue(i),
  35378. null === this.type || "object" != typeof this.type)
  35379. throw Error("[INTERNAL] Unresolved type in " + this.toString(!0) + ": " + this.type);
  35380. if (null === i || this.repeated && 0 == i.length)
  35381. return 0;
  35382. var r = 0;
  35383. try {
  35384. if (this.repeated) {
  35385. var o, a;
  35386. if (this.options.packed && e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0) {
  35387. for (r += t.calculateVarint32(this.id << 3 | e.WIRE_TYPES.LDELIM),
  35388. a = 0,
  35389. o = 0; o < i.length; o++)
  35390. a += this.element.calculateLength(this.id, i[o]);
  35391. r += t.calculateVarint32(a),
  35392. r += a
  35393. } else
  35394. for (o = 0; o < i.length; o++)
  35395. r += t.calculateVarint32(this.id << 3 | this.type.wireType),
  35396. r += this.element.calculateLength(this.id, i[o])
  35397. } else
  35398. this.map ? i.forEach(function(i, n, o) {
  35399. var a = t.calculateVarint32(8 | this.keyType.wireType) + this.keyElement.calculateLength(1, n) + t.calculateVarint32(16 | this.type.wireType) + this.element.calculateLength(2, i);
  35400. r += t.calculateVarint32(this.id << 3 | e.WIRE_TYPES.LDELIM),
  35401. r += t.calculateVarint32(a),
  35402. r += a
  35403. }, this) : this.hasWirePresence(i, n) && (r += t.calculateVarint32(this.id << 3 | this.type.wireType),
  35404. r += this.element.calculateLength(this.id, i))
  35405. } catch (e) {
  35406. throw Error("Illegal value for " + this.toString(!0) + ": " + i + " (" + e + ")")
  35407. }
  35408. return r
  35409. }
  35410. ,
  35411. g.decode = function(t, i, n) {
  35412. 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;
  35413. if (!a)
  35414. throw Error("Illegal wire type for field " + this.toString(!0) + ": " + t + " (" + this.type.wireType + " expected)");
  35415. if (t == e.WIRE_TYPES.LDELIM && this.repeated && this.options.packed && e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0 && !n) {
  35416. o = i.readVarint32(),
  35417. o = i.offset + o;
  35418. for (var s = []; i.offset < o; )
  35419. s.push(this.decode(this.type.wireType, i, !0));
  35420. return s
  35421. }
  35422. if (this.map) {
  35423. var l = h.defaultFieldValue(this.keyType);
  35424. if (r = h.defaultFieldValue(this.type),
  35425. o = i.readVarint32(),
  35426. i.remaining() < o)
  35427. throw Error("Illegal number of bytes for " + this.toString(!0) + ": " + o + " required but got only " + i.remaining());
  35428. var c = i.clone();
  35429. for (c.limit = c.offset + o,
  35430. i.offset += o; c.remaining() > 0; ) {
  35431. var u = c.readVarint32();
  35432. t = 7 & u;
  35433. var d = u >>> 3;
  35434. if (1 === d)
  35435. l = this.keyElement.decode(c, t, d);
  35436. else {
  35437. if (2 !== d)
  35438. throw Error("Unexpected tag in map field key/value submessage");
  35439. r = this.element.decode(c, t, d)
  35440. }
  35441. }
  35442. return [l, r]
  35443. }
  35444. return this.element.decode(i, t, this.id)
  35445. }
  35446. ,
  35447. o.Message.Field = f;
  35448. var m = function(e, t, i, n, r, o, a) {
  35449. f.call(this, e, t, i, null, n, r, o, a),
  35450. this.extension
  35451. };
  35452. m.prototype = Object.create(f.prototype),
  35453. o.Message.ExtensionField = m;
  35454. var v = function(e, t, i) {
  35455. a.call(this, e, t, i),
  35456. this.fields = []
  35457. };
  35458. o.Message.OneOf = v;
  35459. var A = function(e, t, i, n, r) {
  35460. l.call(this, e, t, i, n, r),
  35461. this.className = "Enum",
  35462. this.object = null
  35463. };
  35464. A.getName = function(e, t) {
  35465. for (var i, n = Object.keys(e), r = 0; r < n.length; ++r)
  35466. if (e[i = n[r]] === t)
  35467. return i;
  35468. return null
  35469. }
  35470. ;
  35471. var y = A.prototype = Object.create(l.prototype);
  35472. y.build = function(t) {
  35473. if (this.object && !t)
  35474. return this.object;
  35475. for (var i = new e.Builder.Enum, n = this.getChildren(A.Value), r = 0, o = n.length; r < o; ++r)
  35476. i[n[r].name] = n[r].id;
  35477. return Object.defineProperty && Object.defineProperty(i, "$options", {
  35478. value: this.buildOpt(),
  35479. enumerable: !1
  35480. }),
  35481. this.object = i
  35482. }
  35483. ,
  35484. o.Enum = A;
  35485. var C = function(e, t, i, n) {
  35486. a.call(this, e, t, i),
  35487. this.className = "Enum.Value",
  35488. this.id = n
  35489. };
  35490. C.prototype = Object.create(a.prototype),
  35491. o.Enum.Value = C;
  35492. var I = function(e, t, i, n) {
  35493. a.call(this, e, t, i),
  35494. this.field = n
  35495. };
  35496. I.prototype = Object.create(a.prototype),
  35497. o.Extension = I;
  35498. var E = function(e, t, i, n) {
  35499. l.call(this, e, t, i, n),
  35500. this.className = "Service",
  35501. this.clazz = null
  35502. }
  35503. , b = E.prototype = Object.create(l.prototype);
  35504. b.build = function(i) {
  35505. return this.clazz && !i ? this.clazz : this.clazz = function(e, i) {
  35506. for (var n = function(t) {
  35507. e.Builder.Service.call(this),
  35508. this.rpcImpl = t || function(e, t, i) {
  35509. setTimeout(i.bind(this, Error("Not implemented, see: https://github.com/dcodeIO/ProtoBuf.js/wiki/Services")), 0)
  35510. }
  35511. }, r = n.prototype = Object.create(e.Builder.Service.prototype), o = i.getChildren(e.Reflect.Service.RPCMethod), a = 0; a < o.length; a++)
  35512. !function(e) {
  35513. r[e.name] = function(n, r) {
  35514. try {
  35515. try {
  35516. n = e.resolvedRequestType.clazz.decode(t.wrap(n))
  35517. } catch (e) {
  35518. if (!(e instanceof TypeError))
  35519. throw e
  35520. }
  35521. if (null === n || "object" != typeof n)
  35522. throw Error("Illegal arguments");
  35523. n instanceof e.resolvedRequestType.clazz || (n = new e.resolvedRequestType.clazz(n)),
  35524. this.rpcImpl(e.fqn(), n, function(t, n) {
  35525. if (t)
  35526. return void r(t);
  35527. null === n && (n = "");
  35528. try {
  35529. n = e.resolvedResponseType.clazz.decode(n)
  35530. } catch (e) {}
  35531. 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))
  35532. })
  35533. } catch (e) {
  35534. setTimeout(r.bind(this, e), 0)
  35535. }
  35536. }
  35537. ,
  35538. n[e.name] = function(t, i, r) {
  35539. new n(t)[e.name](i, r)
  35540. }
  35541. ,
  35542. Object.defineProperty && (Object.defineProperty(n[e.name], "$options", {
  35543. value: e.buildOpt()
  35544. }),
  35545. Object.defineProperty(r[e.name], "$options", {
  35546. value: n[e.name].$options
  35547. }))
  35548. }(o[a]);
  35549. return Object.defineProperty && (Object.defineProperty(n, "$options", {
  35550. value: i.buildOpt()
  35551. }),
  35552. Object.defineProperty(r, "$options", {
  35553. value: n.$options
  35554. }),
  35555. Object.defineProperty(n, "$type", {
  35556. value: i
  35557. }),
  35558. Object.defineProperty(r, "$type", {
  35559. value: i
  35560. })),
  35561. n
  35562. }(e, this)
  35563. }
  35564. ,
  35565. o.Service = E;
  35566. var w = function(e, t, i, n) {
  35567. a.call(this, e, t, i),
  35568. this.className = "Service.Method",
  35569. this.options = n || {}
  35570. }
  35571. , _ = w.prototype = Object.create(a.prototype);
  35572. _.buildOpt = c.buildOpt,
  35573. o.Service.Method = w;
  35574. var T = function(e, t, i, n, r, o, a, s) {
  35575. w.call(this, e, t, i, s),
  35576. this.className = "Service.RPCMethod",
  35577. this.requestName = n,
  35578. this.responseName = r,
  35579. this.requestStream = o,
  35580. this.responseStream = a,
  35581. this.resolvedRequestType = null,
  35582. this.resolvedResponseType = null
  35583. };
  35584. return T.prototype = Object.create(w.prototype),
  35585. o.Service.RPCMethod = T,
  35586. o
  35587. }(r),
  35588. r.Builder = function(t, i, n) {
  35589. function r(e) {
  35590. e.messages && e.messages.forEach(function(t) {
  35591. t.syntax = e.syntax,
  35592. r(t)
  35593. }),
  35594. e.enums && e.enums.forEach(function(t) {
  35595. t.syntax = e.syntax
  35596. })
  35597. }
  35598. var o = function(e) {
  35599. this.ns = new n.Namespace(this,null,""),
  35600. this.ptr = this.ns,
  35601. this.resolved = !1,
  35602. this.result = null,
  35603. this.files = {},
  35604. this.importRoot = null,
  35605. this.options = e || {}
  35606. }
  35607. , a = o.prototype;
  35608. return o.isMessage = function(e) {
  35609. return "string" == typeof e.name && ("undefined" == typeof e.values && "undefined" == typeof e.rpc)
  35610. }
  35611. ,
  35612. o.isMessageField = function(e) {
  35613. return "string" == typeof e.rule && "string" == typeof e.name && "string" == typeof e.type && "undefined" != typeof e.id
  35614. }
  35615. ,
  35616. o.isEnum = function(e) {
  35617. return "string" == typeof e.name && !("undefined" == typeof e.values || !Array.isArray(e.values) || 0 === e.values.length)
  35618. }
  35619. ,
  35620. o.isService = function(e) {
  35621. return !("string" != typeof e.name || "object" != typeof e.rpc || !e.rpc)
  35622. }
  35623. ,
  35624. o.isExtend = function(e) {
  35625. return "string" == typeof e.ref
  35626. }
  35627. ,
  35628. a.reset = function() {
  35629. return this.ptr = this.ns,
  35630. this
  35631. }
  35632. ,
  35633. a.define = function(e) {
  35634. if ("string" != typeof e || !i.TYPEREF.test(e))
  35635. throw Error("illegal namespace: " + e);
  35636. return e.split(".").forEach(function(e) {
  35637. var t = this.ptr.getChild(e);
  35638. null === t && this.ptr.addChild(t = new n.Namespace(this,this.ptr,e)),
  35639. this.ptr = t
  35640. }, this),
  35641. this
  35642. }
  35643. ,
  35644. a.create = function(e) {
  35645. if (!e)
  35646. return this;
  35647. if (Array.isArray(e)) {
  35648. if (0 === e.length)
  35649. return this;
  35650. e = e.slice()
  35651. } else
  35652. e = [e];
  35653. for (var i = [e]; i.length > 0; ) {
  35654. if (e = i.pop(),
  35655. !Array.isArray(e))
  35656. throw Error("not a valid namespace: " + JSON.stringify(e));
  35657. for (; e.length > 0; ) {
  35658. var r = e.shift();
  35659. if (o.isMessage(r)) {
  35660. var a = new n.Message(this,this.ptr,r.name,r.options,r.isGroup,r.syntax)
  35661. , s = {};
  35662. r.oneofs && Object.keys(r.oneofs).forEach(function(e) {
  35663. a.addChild(s[e] = new n.Message.OneOf(this,a,e))
  35664. }, this),
  35665. r.fields && r.fields.forEach(function(e) {
  35666. if (null !== a.getChild(0 | e.id))
  35667. throw Error("duplicate or invalid field id in " + a.name + ": " + e.id);
  35668. if (e.options && "object" != typeof e.options)
  35669. throw Error("illegal field options in " + a.name + "#" + e.name);
  35670. var t = null;
  35671. if ("string" == typeof e.oneof && !(t = s[e.oneof]))
  35672. throw Error("illegal oneof in " + a.name + "#" + e.name + ": " + e.oneof);
  35673. e = new n.Message.Field(this,a,e.rule,e.keytype,e.type,e.name,e.id,e.options,t,r.syntax),
  35674. t && t.fields.push(e),
  35675. a.addChild(e)
  35676. }, this);
  35677. var l = [];
  35678. if (r.enums && r.enums.forEach(function(e) {
  35679. l.push(e)
  35680. }),
  35681. r.messages && r.messages.forEach(function(e) {
  35682. l.push(e)
  35683. }),
  35684. r.services && r.services.forEach(function(e) {
  35685. l.push(e)
  35686. }),
  35687. r.extensions && ("number" == typeof r.extensions[0] ? a.extensions = [r.extensions] : a.extensions = r.extensions),
  35688. this.ptr.addChild(a),
  35689. l.length > 0) {
  35690. i.push(e),
  35691. e = l,
  35692. l = null,
  35693. this.ptr = a,
  35694. a = null;
  35695. continue
  35696. }
  35697. l = null
  35698. } else if (o.isEnum(r))
  35699. a = new n.Enum(this,this.ptr,r.name,r.options,r.syntax),
  35700. r.values.forEach(function(e) {
  35701. a.addChild(new n.Enum.Value(this,a,e.name,e.id))
  35702. }, this),
  35703. this.ptr.addChild(a);
  35704. else if (o.isService(r))
  35705. a = new n.Service(this,this.ptr,r.name,r.options),
  35706. Object.keys(r.rpc).forEach(function(e) {
  35707. var t = r.rpc[e];
  35708. a.addChild(new n.Service.RPCMethod(this,a,e,t.request,t.response,!!t.request_stream,!!t.response_stream,t.options))
  35709. }, this),
  35710. this.ptr.addChild(a);
  35711. else {
  35712. if (!o.isExtend(r))
  35713. throw Error("not a valid definition: " + JSON.stringify(r));
  35714. if (a = this.ptr.resolve(r.ref, !0))
  35715. r.fields.forEach(function(e) {
  35716. if (null !== a.getChild(0 | e.id))
  35717. throw Error("duplicate extended field id in " + a.name + ": " + e.id);
  35718. if (a.extensions) {
  35719. var i = !1;
  35720. if (a.extensions.forEach(function(t) {
  35721. e.id >= t[0] && e.id <= t[1] && (i = !0)
  35722. }),
  35723. !i)
  35724. throw Error("illegal extended field id in " + a.name + ": " + e.id + " (not within valid ranges)")
  35725. }
  35726. var r = e.name;
  35727. this.options.convertFieldsToCamelCase && (r = t.Util.toCamelCase(r));
  35728. var o = new n.Message.ExtensionField(this,a,e.rule,e.type,this.ptr.fqn() + "." + r,e.id,e.options)
  35729. , s = new n.Extension(this,this.ptr,e.name,o);
  35730. o.extension = s,
  35731. this.ptr.addChild(s),
  35732. a.addChild(o)
  35733. }, this);
  35734. else if (!/\.?google\.protobuf\./.test(r.ref))
  35735. throw Error("extended message " + r.ref + " is not defined")
  35736. }
  35737. r = null,
  35738. a = null
  35739. }
  35740. e = null,
  35741. this.ptr = this.ptr.parent
  35742. }
  35743. return this.resolved = !1,
  35744. this.result = null,
  35745. this
  35746. }
  35747. ,
  35748. a.import = function(i, n) {
  35749. var o = "/";
  35750. if ("string" == typeof n) {
  35751. if (t.Util.IS_NODE && (n = e("path").resolve(n)),
  35752. this.files[n] === !0)
  35753. return this.reset();
  35754. this.files[n] = !0
  35755. } else if ("object" == typeof n) {
  35756. var a = n.root;
  35757. t.Util.IS_NODE && (a = e("path").resolve(a)),
  35758. (a.indexOf("\\") >= 0 || n.file.indexOf("\\") >= 0) && (o = "\\");
  35759. var s = a + o + n.file;
  35760. if (this.files[s] === !0)
  35761. return this.reset();
  35762. this.files[s] = !0
  35763. }
  35764. if (i.imports && i.imports.length > 0) {
  35765. var l, c = !1;
  35766. "object" == typeof n ? (this.importRoot = n.root,
  35767. c = !0,
  35768. l = this.importRoot,
  35769. n = n.file,
  35770. (l.indexOf("\\") >= 0 || n.indexOf("\\") >= 0) && (o = "\\")) : "string" == typeof n ? this.importRoot ? l = this.importRoot : n.indexOf("/") >= 0 ? (l = n.replace(/\/[^\/]*$/, ""),
  35771. "" === l && (l = "/")) : n.indexOf("\\") >= 0 ? (l = n.replace(/\\[^\\]*$/, ""),
  35772. o = "\\") : l = "." : l = null;
  35773. for (var h = 0; h < i.imports.length; h++)
  35774. if ("string" == typeof i.imports[h]) {
  35775. if (!l)
  35776. throw Error("cannot determine import root");
  35777. var u = i.imports[h];
  35778. if ("google/protobuf/descriptor.proto" === u)
  35779. continue;
  35780. if (u = l + o + u,
  35781. this.files[u] === !0)
  35782. continue;
  35783. /\.proto$/i.test(u) && !t.DotProto && (u = u.replace(/\.proto$/, ".json"));
  35784. var d = t.Util.fetch(u);
  35785. if (null === d)
  35786. throw Error("failed to import '" + u + "' in '" + n + "': file not found");
  35787. /\.json$/i.test(u) ? this.import(JSON.parse(d + ""), u) : this.import(t.DotProto.Parser.parse(d), u)
  35788. } else
  35789. n ? /\.(\w+)$/.test(n) ? this.import(i.imports[h], n.replace(/^(.+)\.(\w+)$/, function(e, t, i) {
  35790. return t + "_import" + h + "." + i
  35791. })) : this.import(i.imports[h], n + "_import" + h) : this.import(i.imports[h]);
  35792. c && (this.importRoot = null)
  35793. }
  35794. i.package && this.define(i.package),
  35795. i.syntax && r(i);
  35796. var p = this.ptr;
  35797. return i.options && Object.keys(i.options).forEach(function(e) {
  35798. p.options[e] = i.options[e]
  35799. }),
  35800. i.messages && (this.create(i.messages),
  35801. this.ptr = p),
  35802. i.enums && (this.create(i.enums),
  35803. this.ptr = p),
  35804. i.services && (this.create(i.services),
  35805. this.ptr = p),
  35806. i.extends && this.create(i.extends),
  35807. this.reset()
  35808. }
  35809. ,
  35810. a.resolveAll = function() {
  35811. var e;
  35812. if (null == this.ptr || "object" == typeof this.ptr.type)
  35813. return this;
  35814. if (this.ptr instanceof n.Namespace)
  35815. this.ptr.children.forEach(function(e) {
  35816. this.ptr = e,
  35817. this.resolveAll()
  35818. }, this);
  35819. else if (this.ptr instanceof n.Message.Field) {
  35820. if (i.TYPE.test(this.ptr.type))
  35821. this.ptr.type = t.TYPES[this.ptr.type];
  35822. else {
  35823. if (!i.TYPEREF.test(this.ptr.type))
  35824. throw Error("illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  35825. if (e = (this.ptr instanceof n.Message.ExtensionField ? this.ptr.extension.parent : this.ptr.parent).resolve(this.ptr.type, !0),
  35826. !e)
  35827. throw Error("unresolvable type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  35828. if (this.ptr.resolvedType = e,
  35829. e instanceof n.Enum) {
  35830. if (this.ptr.type = t.TYPES.enum,
  35831. "proto3" === this.ptr.syntax && "proto3" !== e.syntax)
  35832. throw Error("proto3 message cannot reference proto2 enum")
  35833. } else {
  35834. if (!(e instanceof n.Message))
  35835. throw Error("illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  35836. this.ptr.type = e.isGroup ? t.TYPES.group : t.TYPES.message
  35837. }
  35838. }
  35839. if (this.ptr.map) {
  35840. if (!i.TYPE.test(this.ptr.keyType))
  35841. throw Error("illegal key type for map field in " + this.ptr.toString(!0) + ": " + this.ptr.keyType);
  35842. this.ptr.keyType = t.TYPES[this.ptr.keyType]
  35843. }
  35844. } else if (this.ptr instanceof t.Reflect.Service.Method) {
  35845. if (!(this.ptr instanceof t.Reflect.Service.RPCMethod))
  35846. throw Error("illegal service type in " + this.ptr.toString(!0));
  35847. if (e = this.ptr.parent.resolve(this.ptr.requestName, !0),
  35848. !(e && e instanceof t.Reflect.Message))
  35849. throw Error("Illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.requestName);
  35850. if (this.ptr.resolvedRequestType = e,
  35851. e = this.ptr.parent.resolve(this.ptr.responseName, !0),
  35852. !(e && e instanceof t.Reflect.Message))
  35853. throw Error("Illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.responseName);
  35854. this.ptr.resolvedResponseType = e
  35855. } else if (!(this.ptr instanceof t.Reflect.Message.OneOf || this.ptr instanceof t.Reflect.Extension || this.ptr instanceof t.Reflect.Enum.Value))
  35856. throw Error("illegal object in namespace: " + typeof this.ptr + ": " + this.ptr);
  35857. return this.reset()
  35858. }
  35859. ,
  35860. a.build = function(e) {
  35861. if (this.reset(),
  35862. this.resolved || (this.resolveAll(),
  35863. this.resolved = !0,
  35864. this.result = null),
  35865. null === this.result && (this.result = this.ns.build()),
  35866. !e)
  35867. return this.result;
  35868. for (var t = "string" == typeof e ? e.split(".") : e, i = this.result, n = 0; n < t.length; n++) {
  35869. if (!i[t[n]]) {
  35870. i = null;
  35871. break
  35872. }
  35873. i = i[t[n]]
  35874. }
  35875. return i
  35876. }
  35877. ,
  35878. a.lookup = function(e, t) {
  35879. return e ? this.ns.resolve(e, t) : this.ns
  35880. }
  35881. ,
  35882. a.toString = function() {
  35883. return "Builder"
  35884. }
  35885. ,
  35886. o.Message = function() {}
  35887. ,
  35888. o.Enum = function() {}
  35889. ,
  35890. o.Service = function() {}
  35891. ,
  35892. o
  35893. }(r, r.Lang, r.Reflect),
  35894. r.Map = function(e, t) {
  35895. function i(e) {
  35896. var t = 0;
  35897. return {
  35898. next: function() {
  35899. return t < e.length ? {
  35900. done: !1,
  35901. value: e[t++]
  35902. } : {
  35903. done: !0
  35904. }
  35905. }
  35906. }
  35907. }
  35908. var n = function(e, i) {
  35909. if (!e.map)
  35910. throw Error("field is not a map");
  35911. if (this.field = e,
  35912. this.keyElem = new t.Element(e.keyType,null,!0,e.syntax),
  35913. this.valueElem = new t.Element(e.type,e.resolvedType,!1,e.syntax),
  35914. this.map = {},
  35915. Object.defineProperty(this, "size", {
  35916. get: function() {
  35917. return Object.keys(this.map).length
  35918. }
  35919. }),
  35920. i)
  35921. for (var n = Object.keys(i), r = 0; r < n.length; r++) {
  35922. var o = this.keyElem.valueFromString(n[r])
  35923. , a = this.valueElem.verifyValue(i[n[r]]);
  35924. this.map[this.keyElem.valueToString(o)] = {
  35925. key: o,
  35926. value: a
  35927. }
  35928. }
  35929. }
  35930. , r = n.prototype;
  35931. return r.clear = function() {
  35932. this.map = {}
  35933. }
  35934. ,
  35935. r.delete = function(e) {
  35936. var t = this.keyElem.valueToString(this.keyElem.verifyValue(e))
  35937. , i = t in this.map;
  35938. return delete this.map[t],
  35939. i
  35940. }
  35941. ,
  35942. r.entries = function() {
  35943. for (var e, t = [], n = Object.keys(this.map), r = 0; r < n.length; r++)
  35944. t.push([(e = this.map[n[r]]).key, e.value]);
  35945. return i(t)
  35946. }
  35947. ,
  35948. r.keys = function() {
  35949. for (var e = [], t = Object.keys(this.map), n = 0; n < t.length; n++)
  35950. e.push(this.map[t[n]].key);
  35951. return i(e)
  35952. }
  35953. ,
  35954. r.values = function() {
  35955. for (var e = [], t = Object.keys(this.map), n = 0; n < t.length; n++)
  35956. e.push(this.map[t[n]].value);
  35957. return i(e)
  35958. }
  35959. ,
  35960. r.forEach = function(e, t) {
  35961. for (var i, n = Object.keys(this.map), r = 0; r < n.length; r++)
  35962. e.call(t, (i = this.map[n[r]]).value, i.key, this)
  35963. }
  35964. ,
  35965. r.set = function(e, t) {
  35966. var i = this.keyElem.verifyValue(e)
  35967. , n = this.valueElem.verifyValue(t);
  35968. return this.map[this.keyElem.valueToString(i)] = {
  35969. key: i,
  35970. value: n
  35971. },
  35972. this
  35973. }
  35974. ,
  35975. r.get = function(e) {
  35976. var t = this.keyElem.valueToString(this.keyElem.verifyValue(e));
  35977. if (t in this.map)
  35978. return this.map[t].value
  35979. }
  35980. ,
  35981. r.has = function(e) {
  35982. var t = this.keyElem.valueToString(this.keyElem.verifyValue(e));
  35983. return t in this.map
  35984. }
  35985. ,
  35986. n
  35987. }(r, r.Reflect),
  35988. r.loadProto = function(e, t, i) {
  35989. return ("string" == typeof t || t && "string" == typeof t.file && "string" == typeof t.root) && (i = t,
  35990. t = void 0),
  35991. r.loadJson(r.DotProto.Parser.parse(e), t, i)
  35992. }
  35993. ,
  35994. r.protoFromString = r.loadProto,
  35995. r.loadProtoFile = function(e, t, i) {
  35996. if (t && "object" == typeof t ? (i = t,
  35997. t = null) : t && "function" == typeof t || (t = null),
  35998. t)
  35999. return r.Util.fetch("string" == typeof e ? e : e.root + "/" + e.file, function(n) {
  36000. if (null === n)
  36001. return void t(Error("Failed to fetch file"));
  36002. try {
  36003. t(null, r.loadProto(n, i, e))
  36004. } catch (e) {
  36005. t(e)
  36006. }
  36007. });
  36008. var n = r.Util.fetch("object" == typeof e ? e.root + "/" + e.file : e);
  36009. return null === n ? null : r.loadProto(n, i, e)
  36010. }
  36011. ,
  36012. r.protoFromFile = r.loadProtoFile,
  36013. r.newBuilder = function(e) {
  36014. return e = e || {},
  36015. "undefined" == typeof e.convertFieldsToCamelCase && (e.convertFieldsToCamelCase = r.convertFieldsToCamelCase),
  36016. "undefined" == typeof e.populateAccessors && (e.populateAccessors = r.populateAccessors),
  36017. new r.Builder(e)
  36018. }
  36019. ,
  36020. r.loadJson = function(e, t, i) {
  36021. return ("string" == typeof t || t && "string" == typeof t.file && "string" == typeof t.root) && (i = t,
  36022. t = null),
  36023. t && "object" == typeof t || (t = r.newBuilder()),
  36024. "string" == typeof e && (e = JSON.parse(e)),
  36025. t.import(e, i),
  36026. t.resolveAll(),
  36027. t
  36028. }
  36029. ,
  36030. r.loadJsonFile = function(e, t, i) {
  36031. if (t && "object" == typeof t ? (i = t,
  36032. t = null) : t && "function" == typeof t || (t = null),
  36033. t)
  36034. return r.Util.fetch("string" == typeof e ? e : e.root + "/" + e.file, function(n) {
  36035. if (null === n)
  36036. return void t(Error("Failed to fetch file"));
  36037. try {
  36038. t(null, r.loadJson(JSON.parse(n), i, e))
  36039. } catch (e) {
  36040. t(e)
  36041. }
  36042. });
  36043. var n = r.Util.fetch("object" == typeof e ? e.root + "/" + e.file : e);
  36044. return null === n ? null : r.loadJson(JSON.parse(n), i, e)
  36045. }
  36046. ,
  36047. r
  36048. })
  36049. }
  36050. ).call(this, e("_process"))
  36051. }
  36052. , {
  36053. _process: 203,
  36054. bytebuffer: 215,
  36055. fs: 197,
  36056. path: 197
  36057. }],
  36058. 215: [function(e, t, i) {
  36059. !function(i, n) {
  36060. "function" == typeof define && define.amd ? define(["long"], n) : "function" == typeof e && "object" == typeof t && t && t.exports ? t.exports = function() {
  36061. var t;
  36062. try {
  36063. t = e("long")
  36064. } catch (e) {}
  36065. return n(t)
  36066. }() : (i.dcodeIO = i.dcodeIO || {}).ByteBuffer = n(i.dcodeIO.Long)
  36067. }(this, function(e) {
  36068. "use strict";
  36069. function t(e) {
  36070. var t = 0;
  36071. return function() {
  36072. return t < e.length ? e.charCodeAt(t++) : null
  36073. }
  36074. }
  36075. function i() {
  36076. var e = []
  36077. , t = [];
  36078. return function() {
  36079. return 0 === arguments.length ? t.join("") + l.apply(String, e) : (e.length + arguments.length > 1024 && (t.push(l.apply(String, e)),
  36080. e.length = 0),
  36081. void Array.prototype.push.apply(e, arguments))
  36082. }
  36083. }
  36084. function n(e, t, i, n, r) {
  36085. 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];
  36086. for (u += d,
  36087. o = p & (1 << -h) - 1,
  36088. p >>= -h,
  36089. h += s; h > 0; o = 256 * o + e[t + u],
  36090. u += d,
  36091. h -= 8)
  36092. ;
  36093. for (a = o & (1 << -h) - 1,
  36094. o >>= -h,
  36095. h += n; h > 0; a = 256 * a + e[t + u],
  36096. u += d,
  36097. h -= 8)
  36098. ;
  36099. if (0 === o)
  36100. o = 1 - c;
  36101. else {
  36102. if (o === l)
  36103. return a ? NaN : (p ? -1 : 1) * (1 / 0);
  36104. a += Math.pow(2, n),
  36105. o -= c
  36106. }
  36107. return (p ? -1 : 1) * a * Math.pow(2, o - n)
  36108. }
  36109. function r(e, t, i, n, r, o) {
  36110. 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;
  36111. for (t = Math.abs(t),
  36112. isNaN(t) || t === 1 / 0 ? (s = isNaN(t) ? 1 : 0,
  36113. a = h) : (a = Math.floor(Math.log(t) / Math.LN2),
  36114. t * (l = Math.pow(2, -a)) < 1 && (a--,
  36115. l *= 2),
  36116. t += a + u >= 1 ? d / l : d * Math.pow(2, 1 - u),
  36117. t * l >= 2 && (a++,
  36118. l /= 2),
  36119. a + u >= h ? (s = 0,
  36120. a = h) : a + u >= 1 ? (s = (t * l - 1) * Math.pow(2, r),
  36121. a += u) : (s = t * Math.pow(2, u - 1) * Math.pow(2, r),
  36122. a = 0)); r >= 8; e[i + p] = 255 & s,
  36123. p += f,
  36124. s /= 256,
  36125. r -= 8)
  36126. ;
  36127. for (a = a << r | s,
  36128. c += r; c > 0; e[i + p] = 255 & a,
  36129. p += f,
  36130. a /= 256,
  36131. c -= 8)
  36132. ;
  36133. e[i + p - f] |= 128 * g
  36134. }
  36135. var o = function(e, t, i) {
  36136. if ("undefined" == typeof e && (e = o.DEFAULT_CAPACITY),
  36137. "undefined" == typeof t && (t = o.DEFAULT_ENDIAN),
  36138. "undefined" == typeof i && (i = o.DEFAULT_NOASSERT),
  36139. !i) {
  36140. if (e |= 0,
  36141. e < 0)
  36142. throw RangeError("Illegal capacity");
  36143. t = !!t,
  36144. i = !!i
  36145. }
  36146. this.buffer = 0 === e ? s : new ArrayBuffer(e),
  36147. this.view = 0 === e ? null : new Uint8Array(this.buffer),
  36148. this.offset = 0,
  36149. this.markedOffset = -1,
  36150. this.limit = e,
  36151. this.littleEndian = t,
  36152. this.noAssert = i
  36153. };
  36154. o.VERSION = "5.0.1",
  36155. o.LITTLE_ENDIAN = !0,
  36156. o.BIG_ENDIAN = !1,
  36157. o.DEFAULT_CAPACITY = 16,
  36158. o.DEFAULT_ENDIAN = o.BIG_ENDIAN,
  36159. o.DEFAULT_NOASSERT = !1,
  36160. o.Long = e || null;
  36161. var a = o.prototype;
  36162. a.__isByteBuffer__,
  36163. Object.defineProperty(a, "__isByteBuffer__", {
  36164. value: !0,
  36165. enumerable: !1,
  36166. configurable: !1
  36167. });
  36168. var s = new ArrayBuffer(0)
  36169. , l = String.fromCharCode;
  36170. o.accessor = function() {
  36171. return Uint8Array
  36172. }
  36173. ,
  36174. o.allocate = function(e, t, i) {
  36175. return new o(e,t,i)
  36176. }
  36177. ,
  36178. o.concat = function(e, t, i, n) {
  36179. "boolean" != typeof t && "string" == typeof t || (n = i,
  36180. i = t,
  36181. t = void 0);
  36182. for (var r, a = 0, s = 0, l = e.length; s < l; ++s)
  36183. o.isByteBuffer(e[s]) || (e[s] = o.wrap(e[s], t)),
  36184. r = e[s].limit - e[s].offset,
  36185. r > 0 && (a += r);
  36186. if (0 === a)
  36187. return new o(0,i,n);
  36188. var c, h = new o(a,i,n);
  36189. for (s = 0; s < l; )
  36190. c = e[s++],
  36191. r = c.limit - c.offset,
  36192. r <= 0 || (h.view.set(c.view.subarray(c.offset, c.limit), h.offset),
  36193. h.offset += r);
  36194. return h.limit = h.offset,
  36195. h.offset = 0,
  36196. h
  36197. }
  36198. ,
  36199. o.isByteBuffer = function(e) {
  36200. return (e && e.__isByteBuffer__) === !0
  36201. }
  36202. ,
  36203. o.type = function() {
  36204. return ArrayBuffer
  36205. }
  36206. ,
  36207. o.wrap = function(e, t, i, n) {
  36208. if ("string" != typeof t && (n = i,
  36209. i = t,
  36210. t = void 0),
  36211. "string" == typeof e)
  36212. switch ("undefined" == typeof t && (t = "utf8"),
  36213. t) {
  36214. case "base64":
  36215. return o.fromBase64(e, i);
  36216. case "hex":
  36217. return o.fromHex(e, i);
  36218. case "binary":
  36219. return o.fromBinary(e, i);
  36220. case "utf8":
  36221. return o.fromUTF8(e, i);
  36222. case "debug":
  36223. return o.fromDebug(e, i);
  36224. default:
  36225. throw Error("Unsupported encoding: " + t)
  36226. }
  36227. if (null === e || "object" != typeof e)
  36228. throw TypeError("Illegal buffer");
  36229. var r;
  36230. if (o.isByteBuffer(e))
  36231. return r = a.clone.call(e),
  36232. r.markedOffset = -1,
  36233. r;
  36234. if (e instanceof Uint8Array)
  36235. r = new o(0,i,n),
  36236. e.length > 0 && (r.buffer = e.buffer,
  36237. r.offset = e.byteOffset,
  36238. r.limit = e.byteOffset + e.byteLength,
  36239. r.view = new Uint8Array(e.buffer));
  36240. else if (e instanceof ArrayBuffer)
  36241. r = new o(0,i,n),
  36242. e.byteLength > 0 && (r.buffer = e,
  36243. r.offset = 0,
  36244. r.limit = e.byteLength,
  36245. r.view = e.byteLength > 0 ? new Uint8Array(e) : null);
  36246. else {
  36247. if ("[object Array]" !== Object.prototype.toString.call(e))
  36248. throw TypeError("Illegal buffer");
  36249. r = new o(e.length,i,n),
  36250. r.limit = e.length;
  36251. for (var s = 0; s < e.length; ++s)
  36252. r.view[s] = e[s]
  36253. }
  36254. return r
  36255. }
  36256. ,
  36257. a.writeBitSet = function(e, t) {
  36258. var i = "undefined" == typeof t;
  36259. if (i && (t = this.offset),
  36260. !this.noAssert) {
  36261. if (!(e instanceof Array))
  36262. throw TypeError("Illegal BitSet: Not an array");
  36263. if ("number" != typeof t || t % 1 !== 0)
  36264. throw TypeError("Illegal offset: " + t + " (not an integer)");
  36265. if (t >>>= 0,
  36266. t < 0 || t + 0 > this.buffer.byteLength)
  36267. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  36268. }
  36269. var n, r = t, o = e.length, a = o >> 3, s = 0;
  36270. for (t += this.writeVarint32(o, t); a--; )
  36271. 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,
  36272. this.writeByte(n, t++);
  36273. if (s < o) {
  36274. var l = 0;
  36275. for (n = 0; s < o; )
  36276. n |= (1 & !!e[s++]) << l++;
  36277. this.writeByte(n, t++)
  36278. }
  36279. return i ? (this.offset = t,
  36280. this) : t - r
  36281. }
  36282. ,
  36283. a.readBitSet = function(e) {
  36284. var t = "undefined" == typeof e;
  36285. t && (e = this.offset);
  36286. var i, n = this.readVarint32(e), r = n.value, o = r >> 3, a = 0, s = [];
  36287. for (e += n.length; o--; )
  36288. i = this.readByte(e++),
  36289. s[a++] = !!(1 & i),
  36290. s[a++] = !!(2 & i),
  36291. s[a++] = !!(4 & i),
  36292. s[a++] = !!(8 & i),
  36293. s[a++] = !!(16 & i),
  36294. s[a++] = !!(32 & i),
  36295. s[a++] = !!(64 & i),
  36296. s[a++] = !!(128 & i);
  36297. if (a < r) {
  36298. var l = 0;
  36299. for (i = this.readByte(e++); a < r; )
  36300. s[a++] = !!(i >> l++ & 1)
  36301. }
  36302. return t && (this.offset = e),
  36303. s
  36304. }
  36305. ,
  36306. a.readBytes = function(e, t) {
  36307. var i = "undefined" == typeof t;
  36308. if (i && (t = this.offset),
  36309. !this.noAssert) {
  36310. if ("number" != typeof t || t % 1 !== 0)
  36311. throw TypeError("Illegal offset: " + t + " (not an integer)");
  36312. if (t >>>= 0,
  36313. t < 0 || t + e > this.buffer.byteLength)
  36314. throw RangeError("Illegal offset: 0 <= " + t + " (+" + e + ") <= " + this.buffer.byteLength)
  36315. }
  36316. var n = this.slice(t, t + e);
  36317. return i && (this.offset += e),
  36318. n
  36319. }
  36320. ,
  36321. a.writeBytes = a.append,
  36322. a.writeInt8 = function(e, t) {
  36323. var i = "undefined" == typeof t;
  36324. if (i && (t = this.offset),
  36325. !this.noAssert) {
  36326. if ("number" != typeof e || e % 1 !== 0)
  36327. throw TypeError("Illegal value: " + e + " (not an integer)");
  36328. if (e |= 0,
  36329. "number" != typeof t || t % 1 !== 0)
  36330. throw TypeError("Illegal offset: " + t + " (not an integer)");
  36331. if (t >>>= 0,
  36332. t < 0 || t + 0 > this.buffer.byteLength)
  36333. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  36334. }
  36335. t += 1;
  36336. var n = this.buffer.byteLength;
  36337. return t > n && this.resize((n *= 2) > t ? n : t),
  36338. t -= 1,
  36339. this.view[t] = e,
  36340. i && (this.offset += 1),
  36341. this
  36342. }
  36343. ,
  36344. a.writeByte = a.writeInt8,
  36345. a.readInt8 = function(e) {
  36346. var t = "undefined" == typeof e;
  36347. if (t && (e = this.offset),
  36348. !this.noAssert) {
  36349. if ("number" != typeof e || e % 1 !== 0)
  36350. throw TypeError("Illegal offset: " + e + " (not an integer)");
  36351. if (e >>>= 0,
  36352. e < 0 || e + 1 > this.buffer.byteLength)
  36353. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  36354. }
  36355. var i = this.view[e];
  36356. return 128 === (128 & i) && (i = -(255 - i + 1)),
  36357. t && (this.offset += 1),
  36358. i
  36359. }
  36360. ,
  36361. a.readByte = a.readInt8,
  36362. a.writeUint8 = function(e, t) {
  36363. var i = "undefined" == typeof t;
  36364. if (i && (t = this.offset),
  36365. !this.noAssert) {
  36366. if ("number" != typeof e || e % 1 !== 0)
  36367. throw TypeError("Illegal value: " + e + " (not an integer)");
  36368. if (e >>>= 0,
  36369. "number" != typeof t || t % 1 !== 0)
  36370. throw TypeError("Illegal offset: " + t + " (not an integer)");
  36371. if (t >>>= 0,
  36372. t < 0 || t + 0 > this.buffer.byteLength)
  36373. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  36374. }
  36375. t += 1;
  36376. var n = this.buffer.byteLength;
  36377. return t > n && this.resize((n *= 2) > t ? n : t),
  36378. t -= 1,
  36379. this.view[t] = e,
  36380. i && (this.offset += 1),
  36381. this
  36382. }
  36383. ,
  36384. a.writeUInt8 = a.writeUint8,
  36385. a.readUint8 = function(e) {
  36386. var t = "undefined" == typeof e;
  36387. if (t && (e = this.offset),
  36388. !this.noAssert) {
  36389. if ("number" != typeof e || e % 1 !== 0)
  36390. throw TypeError("Illegal offset: " + e + " (not an integer)");
  36391. if (e >>>= 0,
  36392. e < 0 || e + 1 > this.buffer.byteLength)
  36393. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  36394. }
  36395. var i = this.view[e];
  36396. return t && (this.offset += 1),
  36397. i
  36398. }
  36399. ,
  36400. a.readUInt8 = a.readUint8,
  36401. a.writeInt16 = function(e, t) {
  36402. var i = "undefined" == typeof t;
  36403. if (i && (t = this.offset),
  36404. !this.noAssert) {
  36405. if ("number" != typeof e || e % 1 !== 0)
  36406. throw TypeError("Illegal value: " + e + " (not an integer)");
  36407. if (e |= 0,
  36408. "number" != typeof t || t % 1 !== 0)
  36409. throw TypeError("Illegal offset: " + t + " (not an integer)");
  36410. if (t >>>= 0,
  36411. t < 0 || t + 0 > this.buffer.byteLength)
  36412. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  36413. }
  36414. t += 2;
  36415. var n = this.buffer.byteLength;
  36416. return t > n && this.resize((n *= 2) > t ? n : t),
  36417. t -= 2,
  36418. this.littleEndian ? (this.view[t + 1] = (65280 & e) >>> 8,
  36419. this.view[t] = 255 & e) : (this.view[t] = (65280 & e) >>> 8,
  36420. this.view[t + 1] = 255 & e),
  36421. i && (this.offset += 2),
  36422. this
  36423. }
  36424. ,
  36425. a.writeShort = a.writeInt16,
  36426. a.readInt16 = function(e) {
  36427. var t = "undefined" == typeof e;
  36428. if (t && (e = this.offset),
  36429. !this.noAssert) {
  36430. if ("number" != typeof e || e % 1 !== 0)
  36431. throw TypeError("Illegal offset: " + e + " (not an integer)");
  36432. if (e >>>= 0,
  36433. e < 0 || e + 2 > this.buffer.byteLength)
  36434. throw RangeError("Illegal offset: 0 <= " + e + " (+2) <= " + this.buffer.byteLength)
  36435. }
  36436. var i = 0;
  36437. return this.littleEndian ? (i = this.view[e],
  36438. i |= this.view[e + 1] << 8) : (i = this.view[e] << 8,
  36439. i |= this.view[e + 1]),
  36440. 32768 === (32768 & i) && (i = -(65535 - i + 1)),
  36441. t && (this.offset += 2),
  36442. i
  36443. }
  36444. ,
  36445. a.readShort = a.readInt16,
  36446. a.writeUint16 = function(e, t) {
  36447. var i = "undefined" == typeof t;
  36448. if (i && (t = this.offset),
  36449. !this.noAssert) {
  36450. if ("number" != typeof e || e % 1 !== 0)
  36451. throw TypeError("Illegal value: " + e + " (not an integer)");
  36452. if (e >>>= 0,
  36453. "number" != typeof t || t % 1 !== 0)
  36454. throw TypeError("Illegal offset: " + t + " (not an integer)");
  36455. if (t >>>= 0,
  36456. t < 0 || t + 0 > this.buffer.byteLength)
  36457. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  36458. }
  36459. t += 2;
  36460. var n = this.buffer.byteLength;
  36461. return t > n && this.resize((n *= 2) > t ? n : t),
  36462. t -= 2,
  36463. this.littleEndian ? (this.view[t + 1] = (65280 & e) >>> 8,
  36464. this.view[t] = 255 & e) : (this.view[t] = (65280 & e) >>> 8,
  36465. this.view[t + 1] = 255 & e),
  36466. i && (this.offset += 2),
  36467. this
  36468. }
  36469. ,
  36470. a.writeUInt16 = a.writeUint16,
  36471. a.readUint16 = function(e) {
  36472. var t = "undefined" == typeof e;
  36473. if (t && (e = this.offset),
  36474. !this.noAssert) {
  36475. if ("number" != typeof e || e % 1 !== 0)
  36476. throw TypeError("Illegal offset: " + e + " (not an integer)");
  36477. if (e >>>= 0,
  36478. e < 0 || e + 2 > this.buffer.byteLength)
  36479. throw RangeError("Illegal offset: 0 <= " + e + " (+2) <= " + this.buffer.byteLength)
  36480. }
  36481. var i = 0;
  36482. return this.littleEndian ? (i = this.view[e],
  36483. i |= this.view[e + 1] << 8) : (i = this.view[e] << 8,
  36484. i |= this.view[e + 1]),
  36485. t && (this.offset += 2),
  36486. i
  36487. }
  36488. ,
  36489. a.readUInt16 = a.readUint16,
  36490. a.writeInt32 = function(e, t) {
  36491. var i = "undefined" == typeof t;
  36492. if (i && (t = this.offset),
  36493. !this.noAssert) {
  36494. if ("number" != typeof e || e % 1 !== 0)
  36495. throw TypeError("Illegal value: " + e + " (not an integer)");
  36496. if (e |= 0,
  36497. "number" != typeof t || t % 1 !== 0)
  36498. throw TypeError("Illegal offset: " + t + " (not an integer)");
  36499. if (t >>>= 0,
  36500. t < 0 || t + 0 > this.buffer.byteLength)
  36501. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  36502. }
  36503. t += 4;
  36504. var n = this.buffer.byteLength;
  36505. return t > n && this.resize((n *= 2) > t ? n : t),
  36506. t -= 4,
  36507. this.littleEndian ? (this.view[t + 3] = e >>> 24 & 255,
  36508. this.view[t + 2] = e >>> 16 & 255,
  36509. this.view[t + 1] = e >>> 8 & 255,
  36510. this.view[t] = 255 & e) : (this.view[t] = e >>> 24 & 255,
  36511. this.view[t + 1] = e >>> 16 & 255,
  36512. this.view[t + 2] = e >>> 8 & 255,
  36513. this.view[t + 3] = 255 & e),
  36514. i && (this.offset += 4),
  36515. this
  36516. }
  36517. ,
  36518. a.writeInt = a.writeInt32,
  36519. a.readInt32 = function(e) {
  36520. var t = "undefined" == typeof e;
  36521. if (t && (e = this.offset),
  36522. !this.noAssert) {
  36523. if ("number" != typeof e || e % 1 !== 0)
  36524. throw TypeError("Illegal offset: " + e + " (not an integer)");
  36525. if (e >>>= 0,
  36526. e < 0 || e + 4 > this.buffer.byteLength)
  36527. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  36528. }
  36529. var i = 0;
  36530. return this.littleEndian ? (i = this.view[e + 2] << 16,
  36531. i |= this.view[e + 1] << 8,
  36532. i |= this.view[e],
  36533. i += this.view[e + 3] << 24 >>> 0) : (i = this.view[e + 1] << 16,
  36534. i |= this.view[e + 2] << 8,
  36535. i |= this.view[e + 3],
  36536. i += this.view[e] << 24 >>> 0),
  36537. i |= 0,
  36538. t && (this.offset += 4),
  36539. i
  36540. }
  36541. ,
  36542. a.readInt = a.readInt32,
  36543. a.writeUint32 = function(e, t) {
  36544. var i = "undefined" == typeof t;
  36545. if (i && (t = this.offset),
  36546. !this.noAssert) {
  36547. if ("number" != typeof e || e % 1 !== 0)
  36548. throw TypeError("Illegal value: " + e + " (not an integer)");
  36549. if (e >>>= 0,
  36550. "number" != typeof t || t % 1 !== 0)
  36551. throw TypeError("Illegal offset: " + t + " (not an integer)");
  36552. if (t >>>= 0,
  36553. t < 0 || t + 0 > this.buffer.byteLength)
  36554. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  36555. }
  36556. t += 4;
  36557. var n = this.buffer.byteLength;
  36558. return t > n && this.resize((n *= 2) > t ? n : t),
  36559. t -= 4,
  36560. this.littleEndian ? (this.view[t + 3] = e >>> 24 & 255,
  36561. this.view[t + 2] = e >>> 16 & 255,
  36562. this.view[t + 1] = e >>> 8 & 255,
  36563. this.view[t] = 255 & e) : (this.view[t] = e >>> 24 & 255,
  36564. this.view[t + 1] = e >>> 16 & 255,
  36565. this.view[t + 2] = e >>> 8 & 255,
  36566. this.view[t + 3] = 255 & e),
  36567. i && (this.offset += 4),
  36568. this
  36569. }
  36570. ,
  36571. a.writeUInt32 = a.writeUint32,
  36572. a.readUint32 = function(e) {
  36573. var t = "undefined" == typeof e;
  36574. if (t && (e = this.offset),
  36575. !this.noAssert) {
  36576. if ("number" != typeof e || e % 1 !== 0)
  36577. throw TypeError("Illegal offset: " + e + " (not an integer)");
  36578. if (e >>>= 0,
  36579. e < 0 || e + 4 > this.buffer.byteLength)
  36580. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  36581. }
  36582. var i = 0;
  36583. return this.littleEndian ? (i = this.view[e + 2] << 16,
  36584. i |= this.view[e + 1] << 8,
  36585. i |= this.view[e],
  36586. i += this.view[e + 3] << 24 >>> 0) : (i = this.view[e + 1] << 16,
  36587. i |= this.view[e + 2] << 8,
  36588. i |= this.view[e + 3],
  36589. i += this.view[e] << 24 >>> 0),
  36590. t && (this.offset += 4),
  36591. i
  36592. }
  36593. ,
  36594. a.readUInt32 = a.readUint32,
  36595. e && (a.writeInt64 = function(t, i) {
  36596. var n = "undefined" == typeof i;
  36597. if (n && (i = this.offset),
  36598. !this.noAssert) {
  36599. if ("number" == typeof t)
  36600. t = e.fromNumber(t);
  36601. else if ("string" == typeof t)
  36602. t = e.fromString(t);
  36603. else if (!(t && t instanceof e))
  36604. throw TypeError("Illegal value: " + t + " (not an integer or Long)");
  36605. if ("number" != typeof i || i % 1 !== 0)
  36606. throw TypeError("Illegal offset: " + i + " (not an integer)");
  36607. if (i >>>= 0,
  36608. i < 0 || i + 0 > this.buffer.byteLength)
  36609. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  36610. }
  36611. "number" == typeof t ? t = e.fromNumber(t) : "string" == typeof t && (t = e.fromString(t)),
  36612. i += 8;
  36613. var r = this.buffer.byteLength;
  36614. i > r && this.resize((r *= 2) > i ? r : i),
  36615. i -= 8;
  36616. var o = t.low
  36617. , a = t.high;
  36618. return this.littleEndian ? (this.view[i + 3] = o >>> 24 & 255,
  36619. this.view[i + 2] = o >>> 16 & 255,
  36620. this.view[i + 1] = o >>> 8 & 255,
  36621. this.view[i] = 255 & o,
  36622. i += 4,
  36623. this.view[i + 3] = a >>> 24 & 255,
  36624. this.view[i + 2] = a >>> 16 & 255,
  36625. this.view[i + 1] = a >>> 8 & 255,
  36626. this.view[i] = 255 & a) : (this.view[i] = a >>> 24 & 255,
  36627. this.view[i + 1] = a >>> 16 & 255,
  36628. this.view[i + 2] = a >>> 8 & 255,
  36629. this.view[i + 3] = 255 & a,
  36630. i += 4,
  36631. this.view[i] = o >>> 24 & 255,
  36632. this.view[i + 1] = o >>> 16 & 255,
  36633. this.view[i + 2] = o >>> 8 & 255,
  36634. this.view[i + 3] = 255 & o),
  36635. n && (this.offset += 8),
  36636. this
  36637. }
  36638. ,
  36639. a.writeLong = a.writeInt64,
  36640. a.readInt64 = function(t) {
  36641. var i = "undefined" == typeof t;
  36642. if (i && (t = this.offset),
  36643. !this.noAssert) {
  36644. if ("number" != typeof t || t % 1 !== 0)
  36645. throw TypeError("Illegal offset: " + t + " (not an integer)");
  36646. if (t >>>= 0,
  36647. t < 0 || t + 8 > this.buffer.byteLength)
  36648. throw RangeError("Illegal offset: 0 <= " + t + " (+8) <= " + this.buffer.byteLength)
  36649. }
  36650. var n = 0
  36651. , r = 0;
  36652. this.littleEndian ? (n = this.view[t + 2] << 16,
  36653. n |= this.view[t + 1] << 8,
  36654. n |= this.view[t],
  36655. n += this.view[t + 3] << 24 >>> 0,
  36656. t += 4,
  36657. r = this.view[t + 2] << 16,
  36658. r |= this.view[t + 1] << 8,
  36659. r |= this.view[t],
  36660. r += this.view[t + 3] << 24 >>> 0) : (r = this.view[t + 1] << 16,
  36661. r |= this.view[t + 2] << 8,
  36662. r |= this.view[t + 3],
  36663. r += this.view[t] << 24 >>> 0,
  36664. t += 4,
  36665. n = this.view[t + 1] << 16,
  36666. n |= this.view[t + 2] << 8,
  36667. n |= this.view[t + 3],
  36668. n += this.view[t] << 24 >>> 0);
  36669. var o = new e(n,r,!1);
  36670. return i && (this.offset += 8),
  36671. o
  36672. }
  36673. ,
  36674. a.readLong = a.readInt64,
  36675. a.writeUint64 = function(t, i) {
  36676. var n = "undefined" == typeof i;
  36677. if (n && (i = this.offset),
  36678. !this.noAssert) {
  36679. if ("number" == typeof t)
  36680. t = e.fromNumber(t);
  36681. else if ("string" == typeof t)
  36682. t = e.fromString(t);
  36683. else if (!(t && t instanceof e))
  36684. throw TypeError("Illegal value: " + t + " (not an integer or Long)");
  36685. if ("number" != typeof i || i % 1 !== 0)
  36686. throw TypeError("Illegal offset: " + i + " (not an integer)");
  36687. if (i >>>= 0,
  36688. i < 0 || i + 0 > this.buffer.byteLength)
  36689. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  36690. }
  36691. "number" == typeof t ? t = e.fromNumber(t) : "string" == typeof t && (t = e.fromString(t)),
  36692. i += 8;
  36693. var r = this.buffer.byteLength;
  36694. i > r && this.resize((r *= 2) > i ? r : i),
  36695. i -= 8;
  36696. var o = t.low
  36697. , a = t.high;
  36698. return this.littleEndian ? (this.view[i + 3] = o >>> 24 & 255,
  36699. this.view[i + 2] = o >>> 16 & 255,
  36700. this.view[i + 1] = o >>> 8 & 255,
  36701. this.view[i] = 255 & o,
  36702. i += 4,
  36703. this.view[i + 3] = a >>> 24 & 255,
  36704. this.view[i + 2] = a >>> 16 & 255,
  36705. this.view[i + 1] = a >>> 8 & 255,
  36706. this.view[i] = 255 & a) : (this.view[i] = a >>> 24 & 255,
  36707. this.view[i + 1] = a >>> 16 & 255,
  36708. this.view[i + 2] = a >>> 8 & 255,
  36709. this.view[i + 3] = 255 & a,
  36710. i += 4,
  36711. this.view[i] = o >>> 24 & 255,
  36712. this.view[i + 1] = o >>> 16 & 255,
  36713. this.view[i + 2] = o >>> 8 & 255,
  36714. this.view[i + 3] = 255 & o),
  36715. n && (this.offset += 8),
  36716. this
  36717. }
  36718. ,
  36719. a.writeUInt64 = a.writeUint64,
  36720. a.readUint64 = function(t) {
  36721. var i = "undefined" == typeof t;
  36722. if (i && (t = this.offset),
  36723. !this.noAssert) {
  36724. if ("number" != typeof t || t % 1 !== 0)
  36725. throw TypeError("Illegal offset: " + t + " (not an integer)");
  36726. if (t >>>= 0,
  36727. t < 0 || t + 8 > this.buffer.byteLength)
  36728. throw RangeError("Illegal offset: 0 <= " + t + " (+8) <= " + this.buffer.byteLength)
  36729. }
  36730. var n = 0
  36731. , r = 0;
  36732. this.littleEndian ? (n = this.view[t + 2] << 16,
  36733. n |= this.view[t + 1] << 8,
  36734. n |= this.view[t],
  36735. n += this.view[t + 3] << 24 >>> 0,
  36736. t += 4,
  36737. r = this.view[t + 2] << 16,
  36738. r |= this.view[t + 1] << 8,
  36739. r |= this.view[t],
  36740. r += this.view[t + 3] << 24 >>> 0) : (r = this.view[t + 1] << 16,
  36741. r |= this.view[t + 2] << 8,
  36742. r |= this.view[t + 3],
  36743. r += this.view[t] << 24 >>> 0,
  36744. t += 4,
  36745. n = this.view[t + 1] << 16,
  36746. n |= this.view[t + 2] << 8,
  36747. n |= this.view[t + 3],
  36748. n += this.view[t] << 24 >>> 0);
  36749. var o = new e(n,r,!0);
  36750. return i && (this.offset += 8),
  36751. o
  36752. }
  36753. ,
  36754. a.readUInt64 = a.readUint64),
  36755. a.writeFloat32 = function(e, t) {
  36756. var i = "undefined" == typeof t;
  36757. if (i && (t = this.offset),
  36758. !this.noAssert) {
  36759. if ("number" != typeof e)
  36760. throw TypeError("Illegal value: " + e + " (not a number)");
  36761. if ("number" != typeof t || t % 1 !== 0)
  36762. throw TypeError("Illegal offset: " + t + " (not an integer)");
  36763. if (t >>>= 0,
  36764. t < 0 || t + 0 > this.buffer.byteLength)
  36765. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  36766. }
  36767. t += 4;
  36768. var n = this.buffer.byteLength;
  36769. return t > n && this.resize((n *= 2) > t ? n : t),
  36770. t -= 4,
  36771. r(this.view, e, t, this.littleEndian, 23, 4),
  36772. i && (this.offset += 4),
  36773. this
  36774. }
  36775. ,
  36776. a.writeFloat = a.writeFloat32,
  36777. a.readFloat32 = function(e) {
  36778. var t = "undefined" == typeof e;
  36779. if (t && (e = this.offset),
  36780. !this.noAssert) {
  36781. if ("number" != typeof e || e % 1 !== 0)
  36782. throw TypeError("Illegal offset: " + e + " (not an integer)");
  36783. if (e >>>= 0,
  36784. e < 0 || e + 4 > this.buffer.byteLength)
  36785. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  36786. }
  36787. var i = n(this.view, e, this.littleEndian, 23, 4);
  36788. return t && (this.offset += 4),
  36789. i
  36790. }
  36791. ,
  36792. a.readFloat = a.readFloat32,
  36793. a.writeFloat64 = function(e, t) {
  36794. var i = "undefined" == typeof t;
  36795. if (i && (t = this.offset),
  36796. !this.noAssert) {
  36797. if ("number" != typeof e)
  36798. throw TypeError("Illegal value: " + e + " (not a number)");
  36799. if ("number" != typeof t || t % 1 !== 0)
  36800. throw TypeError("Illegal offset: " + t + " (not an integer)");
  36801. if (t >>>= 0,
  36802. t < 0 || t + 0 > this.buffer.byteLength)
  36803. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  36804. }
  36805. t += 8;
  36806. var n = this.buffer.byteLength;
  36807. return t > n && this.resize((n *= 2) > t ? n : t),
  36808. t -= 8,
  36809. r(this.view, e, t, this.littleEndian, 52, 8),
  36810. i && (this.offset += 8),
  36811. this
  36812. }
  36813. ,
  36814. a.writeDouble = a.writeFloat64,
  36815. a.readFloat64 = function(e) {
  36816. var t = "undefined" == typeof e;
  36817. if (t && (e = this.offset),
  36818. !this.noAssert) {
  36819. if ("number" != typeof e || e % 1 !== 0)
  36820. throw TypeError("Illegal offset: " + e + " (not an integer)");
  36821. if (e >>>= 0,
  36822. e < 0 || e + 8 > this.buffer.byteLength)
  36823. throw RangeError("Illegal offset: 0 <= " + e + " (+8) <= " + this.buffer.byteLength)
  36824. }
  36825. var i = n(this.view, e, this.littleEndian, 52, 8);
  36826. return t && (this.offset += 8),
  36827. i
  36828. }
  36829. ,
  36830. a.readDouble = a.readFloat64,
  36831. o.MAX_VARINT32_BYTES = 5,
  36832. o.calculateVarint32 = function(e) {
  36833. return e >>>= 0,
  36834. e < 128 ? 1 : e < 16384 ? 2 : e < 1 << 21 ? 3 : e < 1 << 28 ? 4 : 5
  36835. }
  36836. ,
  36837. o.zigZagEncode32 = function(e) {
  36838. return ((e |= 0) << 1 ^ e >> 31) >>> 0
  36839. }
  36840. ,
  36841. o.zigZagDecode32 = function(e) {
  36842. return e >>> 1 ^ -(1 & e) | 0
  36843. }
  36844. ,
  36845. a.writeVarint32 = function(e, t) {
  36846. var i = "undefined" == typeof t;
  36847. if (i && (t = this.offset),
  36848. !this.noAssert) {
  36849. if ("number" != typeof e || e % 1 !== 0)
  36850. throw TypeError("Illegal value: " + e + " (not an integer)");
  36851. if (e |= 0,
  36852. "number" != typeof t || t % 1 !== 0)
  36853. throw TypeError("Illegal offset: " + t + " (not an integer)");
  36854. if (t >>>= 0,
  36855. t < 0 || t + 0 > this.buffer.byteLength)
  36856. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  36857. }
  36858. var n, r = o.calculateVarint32(e);
  36859. t += r;
  36860. var a = this.buffer.byteLength;
  36861. for (t > a && this.resize((a *= 2) > t ? a : t),
  36862. t -= r,
  36863. e >>>= 0; e >= 128; )
  36864. n = 127 & e | 128,
  36865. this.view[t++] = n,
  36866. e >>>= 7;
  36867. return this.view[t++] = e,
  36868. i ? (this.offset = t,
  36869. this) : r
  36870. }
  36871. ,
  36872. a.writeVarint32ZigZag = function(e, t) {
  36873. return this.writeVarint32(o.zigZagEncode32(e), t)
  36874. }
  36875. ,
  36876. a.readVarint32 = function(e) {
  36877. var t = "undefined" == typeof e;
  36878. if (t && (e = this.offset),
  36879. !this.noAssert) {
  36880. if ("number" != typeof e || e % 1 !== 0)
  36881. throw TypeError("Illegal offset: " + e + " (not an integer)");
  36882. if (e >>>= 0,
  36883. e < 0 || e + 1 > this.buffer.byteLength)
  36884. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  36885. }
  36886. var i, n = 0, r = 0;
  36887. do {
  36888. if (!this.noAssert && e > this.limit) {
  36889. var o = Error("Truncated");
  36890. throw o.truncated = !0,
  36891. o
  36892. }
  36893. i = this.view[e++],
  36894. n < 5 && (r |= (127 & i) << 7 * n),
  36895. ++n
  36896. } while (0 !== (128 & i));return r |= 0,
  36897. t ? (this.offset = e,
  36898. r) : {
  36899. value: r,
  36900. length: n
  36901. }
  36902. }
  36903. ,
  36904. a.readVarint32ZigZag = function(e) {
  36905. var t = this.readVarint32(e);
  36906. return "object" == typeof t ? t.value = o.zigZagDecode32(t.value) : t = o.zigZagDecode32(t),
  36907. t
  36908. }
  36909. ,
  36910. e && (o.MAX_VARINT64_BYTES = 10,
  36911. o.calculateVarint64 = function(t) {
  36912. "number" == typeof t ? t = e.fromNumber(t) : "string" == typeof t && (t = e.fromString(t));
  36913. var i = t.toInt() >>> 0
  36914. , n = t.shiftRightUnsigned(28).toInt() >>> 0
  36915. , r = t.shiftRightUnsigned(56).toInt() >>> 0;
  36916. 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
  36917. }
  36918. ,
  36919. o.zigZagEncode64 = function(t) {
  36920. return "number" == typeof t ? t = e.fromNumber(t, !1) : "string" == typeof t ? t = e.fromString(t, !1) : t.unsigned !== !1 && (t = t.toSigned()),
  36921. t.shiftLeft(1).xor(t.shiftRight(63)).toUnsigned()
  36922. }
  36923. ,
  36924. o.zigZagDecode64 = function(t) {
  36925. return "number" == typeof t ? t = e.fromNumber(t, !1) : "string" == typeof t ? t = e.fromString(t, !1) : t.unsigned !== !1 && (t = t.toSigned()),
  36926. t.shiftRightUnsigned(1).xor(t.and(e.ONE).toSigned().negate()).toSigned()
  36927. }
  36928. ,
  36929. a.writeVarint64 = function(t, i) {
  36930. var n = "undefined" == typeof i;
  36931. if (n && (i = this.offset),
  36932. !this.noAssert) {
  36933. if ("number" == typeof t)
  36934. t = e.fromNumber(t);
  36935. else if ("string" == typeof t)
  36936. t = e.fromString(t);
  36937. else if (!(t && t instanceof e))
  36938. throw TypeError("Illegal value: " + t + " (not an integer or Long)");
  36939. if ("number" != typeof i || i % 1 !== 0)
  36940. throw TypeError("Illegal offset: " + i + " (not an integer)");
  36941. if (i >>>= 0,
  36942. i < 0 || i + 0 > this.buffer.byteLength)
  36943. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  36944. }
  36945. "number" == typeof t ? t = e.fromNumber(t, !1) : "string" == typeof t ? t = e.fromString(t, !1) : t.unsigned !== !1 && (t = t.toSigned());
  36946. var r = o.calculateVarint64(t)
  36947. , a = t.toInt() >>> 0
  36948. , s = t.shiftRightUnsigned(28).toInt() >>> 0
  36949. , l = t.shiftRightUnsigned(56).toInt() >>> 0;
  36950. i += r;
  36951. var c = this.buffer.byteLength;
  36952. switch (i > c && this.resize((c *= 2) > i ? c : i),
  36953. i -= r,
  36954. r) {
  36955. case 10:
  36956. this.view[i + 9] = l >>> 7 & 1;
  36957. case 9:
  36958. this.view[i + 8] = 9 !== r ? 128 | l : 127 & l;
  36959. case 8:
  36960. this.view[i + 7] = 8 !== r ? s >>> 21 | 128 : s >>> 21 & 127;
  36961. case 7:
  36962. this.view[i + 6] = 7 !== r ? s >>> 14 | 128 : s >>> 14 & 127;
  36963. case 6:
  36964. this.view[i + 5] = 6 !== r ? s >>> 7 | 128 : s >>> 7 & 127;
  36965. case 5:
  36966. this.view[i + 4] = 5 !== r ? 128 | s : 127 & s;
  36967. case 4:
  36968. this.view[i + 3] = 4 !== r ? a >>> 21 | 128 : a >>> 21 & 127;
  36969. case 3:
  36970. this.view[i + 2] = 3 !== r ? a >>> 14 | 128 : a >>> 14 & 127;
  36971. case 2:
  36972. this.view[i + 1] = 2 !== r ? a >>> 7 | 128 : a >>> 7 & 127;
  36973. case 1:
  36974. this.view[i] = 1 !== r ? 128 | a : 127 & a
  36975. }
  36976. return n ? (this.offset += r,
  36977. this) : r
  36978. }
  36979. ,
  36980. a.writeVarint64ZigZag = function(e, t) {
  36981. return this.writeVarint64(o.zigZagEncode64(e), t)
  36982. }
  36983. ,
  36984. a.readVarint64 = function(t) {
  36985. var i = "undefined" == typeof t;
  36986. if (i && (t = this.offset),
  36987. !this.noAssert) {
  36988. if ("number" != typeof t || t % 1 !== 0)
  36989. throw TypeError("Illegal offset: " + t + " (not an integer)");
  36990. if (t >>>= 0,
  36991. t < 0 || t + 1 > this.buffer.byteLength)
  36992. throw RangeError("Illegal offset: 0 <= " + t + " (+1) <= " + this.buffer.byteLength)
  36993. }
  36994. var n = t
  36995. , r = 0
  36996. , o = 0
  36997. , a = 0
  36998. , s = 0;
  36999. if (s = this.view[t++],
  37000. r = 127 & s,
  37001. 128 & s && (s = this.view[t++],
  37002. r |= (127 & s) << 7,
  37003. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  37004. r |= (127 & s) << 14,
  37005. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  37006. r |= (127 & s) << 21,
  37007. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  37008. o = 127 & s,
  37009. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  37010. o |= (127 & s) << 7,
  37011. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  37012. o |= (127 & s) << 14,
  37013. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  37014. o |= (127 & s) << 21,
  37015. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  37016. a = 127 & s,
  37017. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  37018. a |= (127 & s) << 7,
  37019. 128 & s || this.noAssert && "undefined" == typeof s))))))))))
  37020. throw Error("Buffer overrun");
  37021. var l = e.fromBits(r | o << 28, o >>> 4 | a << 24, !1);
  37022. return i ? (this.offset = t,
  37023. l) : {
  37024. value: l,
  37025. length: t - n
  37026. }
  37027. }
  37028. ,
  37029. a.readVarint64ZigZag = function(t) {
  37030. var i = this.readVarint64(t);
  37031. return i && i.value instanceof e ? i.value = o.zigZagDecode64(i.value) : i = o.zigZagDecode64(i),
  37032. i
  37033. }
  37034. ),
  37035. a.writeCString = function(e, i) {
  37036. var n = "undefined" == typeof i;
  37037. n && (i = this.offset);
  37038. var r, o = e.length;
  37039. if (!this.noAssert) {
  37040. if ("string" != typeof e)
  37041. throw TypeError("Illegal str: Not a string");
  37042. for (r = 0; r < o; ++r)
  37043. if (0 === e.charCodeAt(r))
  37044. throw RangeError("Illegal str: Contains NULL-characters");
  37045. if ("number" != typeof i || i % 1 !== 0)
  37046. throw TypeError("Illegal offset: " + i + " (not an integer)");
  37047. if (i >>>= 0,
  37048. i < 0 || i + 0 > this.buffer.byteLength)
  37049. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  37050. }
  37051. o = h.calculateUTF16asUTF8(t(e))[1],
  37052. i += o + 1;
  37053. var a = this.buffer.byteLength;
  37054. return i > a && this.resize((a *= 2) > i ? a : i),
  37055. i -= o + 1,
  37056. h.encodeUTF16toUTF8(t(e), function(e) {
  37057. this.view[i++] = e
  37058. }
  37059. .bind(this)),
  37060. this.view[i++] = 0,
  37061. n ? (this.offset = i,
  37062. this) : o
  37063. }
  37064. ,
  37065. a.readCString = function(e) {
  37066. var t = "undefined" == typeof e;
  37067. if (t && (e = this.offset),
  37068. !this.noAssert) {
  37069. if ("number" != typeof e || e % 1 !== 0)
  37070. throw TypeError("Illegal offset: " + e + " (not an integer)");
  37071. if (e >>>= 0,
  37072. e < 0 || e + 1 > this.buffer.byteLength)
  37073. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  37074. }
  37075. var n, r = e, o = -1;
  37076. return h.decodeUTF8toUTF16(function() {
  37077. if (0 === o)
  37078. return null;
  37079. if (e >= this.limit)
  37080. throw RangeError("Illegal range: Truncated data, " + e + " < " + this.limit);
  37081. return o = this.view[e++],
  37082. 0 === o ? null : o
  37083. }
  37084. .bind(this), n = i(), !0),
  37085. t ? (this.offset = e,
  37086. n()) : {
  37087. string: n(),
  37088. length: e - r
  37089. }
  37090. }
  37091. ,
  37092. a.writeIString = function(e, i) {
  37093. var n = "undefined" == typeof i;
  37094. if (n && (i = this.offset),
  37095. !this.noAssert) {
  37096. if ("string" != typeof e)
  37097. throw TypeError("Illegal str: Not a string");
  37098. if ("number" != typeof i || i % 1 !== 0)
  37099. throw TypeError("Illegal offset: " + i + " (not an integer)");
  37100. if (i >>>= 0,
  37101. i < 0 || i + 0 > this.buffer.byteLength)
  37102. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  37103. }
  37104. var r, o = i;
  37105. r = h.calculateUTF16asUTF8(t(e), this.noAssert)[1],
  37106. i += 4 + r;
  37107. var a = this.buffer.byteLength;
  37108. if (i > a && this.resize((a *= 2) > i ? a : i),
  37109. i -= 4 + r,
  37110. this.littleEndian ? (this.view[i + 3] = r >>> 24 & 255,
  37111. this.view[i + 2] = r >>> 16 & 255,
  37112. this.view[i + 1] = r >>> 8 & 255,
  37113. this.view[i] = 255 & r) : (this.view[i] = r >>> 24 & 255,
  37114. this.view[i + 1] = r >>> 16 & 255,
  37115. this.view[i + 2] = r >>> 8 & 255,
  37116. this.view[i + 3] = 255 & r),
  37117. i += 4,
  37118. h.encodeUTF16toUTF8(t(e), function(e) {
  37119. this.view[i++] = e
  37120. }
  37121. .bind(this)),
  37122. i !== o + 4 + r)
  37123. throw RangeError("Illegal range: Truncated data, " + i + " == " + (i + 4 + r));
  37124. return n ? (this.offset = i,
  37125. this) : i - o
  37126. }
  37127. ,
  37128. a.readIString = function(e) {
  37129. var t = "undefined" == typeof e;
  37130. if (t && (e = this.offset),
  37131. !this.noAssert) {
  37132. if ("number" != typeof e || e % 1 !== 0)
  37133. throw TypeError("Illegal offset: " + e + " (not an integer)");
  37134. if (e >>>= 0,
  37135. e < 0 || e + 4 > this.buffer.byteLength)
  37136. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  37137. }
  37138. var i = e
  37139. , n = this.readUint32(e)
  37140. , r = this.readUTF8String(n, o.METRICS_BYTES, e += 4);
  37141. return e += r.length,
  37142. t ? (this.offset = e,
  37143. r.string) : {
  37144. string: r.string,
  37145. length: e - i
  37146. }
  37147. }
  37148. ,
  37149. o.METRICS_CHARS = "c",
  37150. o.METRICS_BYTES = "b",
  37151. a.writeUTF8String = function(e, i) {
  37152. var n = "undefined" == typeof i;
  37153. if (n && (i = this.offset),
  37154. !this.noAssert) {
  37155. if ("number" != typeof i || i % 1 !== 0)
  37156. throw TypeError("Illegal offset: " + i + " (not an integer)");
  37157. if (i >>>= 0,
  37158. i < 0 || i + 0 > this.buffer.byteLength)
  37159. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  37160. }
  37161. var r, o = i;
  37162. r = h.calculateUTF16asUTF8(t(e))[1],
  37163. i += r;
  37164. var a = this.buffer.byteLength;
  37165. return i > a && this.resize((a *= 2) > i ? a : i),
  37166. i -= r,
  37167. h.encodeUTF16toUTF8(t(e), function(e) {
  37168. this.view[i++] = e
  37169. }
  37170. .bind(this)),
  37171. n ? (this.offset = i,
  37172. this) : i - o
  37173. }
  37174. ,
  37175. a.writeString = a.writeUTF8String,
  37176. o.calculateUTF8Chars = function(e) {
  37177. return h.calculateUTF16asUTF8(t(e))[0]
  37178. }
  37179. ,
  37180. o.calculateUTF8Bytes = function(e) {
  37181. return h.calculateUTF16asUTF8(t(e))[1]
  37182. }
  37183. ,
  37184. o.calculateString = o.calculateUTF8Bytes,
  37185. a.readUTF8String = function(e, t, n) {
  37186. "number" == typeof t && (n = t,
  37187. t = void 0);
  37188. var r = "undefined" == typeof n;
  37189. if (r && (n = this.offset),
  37190. "undefined" == typeof t && (t = o.METRICS_CHARS),
  37191. !this.noAssert) {
  37192. if ("number" != typeof e || e % 1 !== 0)
  37193. throw TypeError("Illegal length: " + e + " (not an integer)");
  37194. if (e |= 0,
  37195. "number" != typeof n || n % 1 !== 0)
  37196. throw TypeError("Illegal offset: " + n + " (not an integer)");
  37197. if (n >>>= 0,
  37198. n < 0 || n + 0 > this.buffer.byteLength)
  37199. throw RangeError("Illegal offset: 0 <= " + n + " (+0) <= " + this.buffer.byteLength)
  37200. }
  37201. var a, s = 0, l = n;
  37202. if (t === o.METRICS_CHARS) {
  37203. if (a = i(),
  37204. h.decodeUTF8(function() {
  37205. return s < e && n < this.limit ? this.view[n++] : null
  37206. }
  37207. .bind(this), function(e) {
  37208. ++s,
  37209. h.UTF8toUTF16(e, a)
  37210. }),
  37211. s !== e)
  37212. throw RangeError("Illegal range: Truncated data, " + s + " == " + e);
  37213. return r ? (this.offset = n,
  37214. a()) : {
  37215. string: a(),
  37216. length: n - l
  37217. }
  37218. }
  37219. if (t === o.METRICS_BYTES) {
  37220. if (!this.noAssert) {
  37221. if ("number" != typeof n || n % 1 !== 0)
  37222. throw TypeError("Illegal offset: " + n + " (not an integer)");
  37223. if (n >>>= 0,
  37224. n < 0 || n + e > this.buffer.byteLength)
  37225. throw RangeError("Illegal offset: 0 <= " + n + " (+" + e + ") <= " + this.buffer.byteLength)
  37226. }
  37227. var c = n + e;
  37228. if (h.decodeUTF8toUTF16(function() {
  37229. return n < c ? this.view[n++] : null
  37230. }
  37231. .bind(this), a = i(), this.noAssert),
  37232. n !== c)
  37233. throw RangeError("Illegal range: Truncated data, " + n + " == " + c);
  37234. return r ? (this.offset = n,
  37235. a()) : {
  37236. string: a(),
  37237. length: n - l
  37238. }
  37239. }
  37240. throw TypeError("Unsupported metrics: " + t)
  37241. }
  37242. ,
  37243. a.readString = a.readUTF8String,
  37244. a.writeVString = function(e, i) {
  37245. var n = "undefined" == typeof i;
  37246. if (n && (i = this.offset),
  37247. !this.noAssert) {
  37248. if ("string" != typeof e)
  37249. throw TypeError("Illegal str: Not a string");
  37250. if ("number" != typeof i || i % 1 !== 0)
  37251. throw TypeError("Illegal offset: " + i + " (not an integer)");
  37252. if (i >>>= 0,
  37253. i < 0 || i + 0 > this.buffer.byteLength)
  37254. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  37255. }
  37256. var r, a, s = i;
  37257. r = h.calculateUTF16asUTF8(t(e), this.noAssert)[1],
  37258. a = o.calculateVarint32(r),
  37259. i += a + r;
  37260. var l = this.buffer.byteLength;
  37261. if (i > l && this.resize((l *= 2) > i ? l : i),
  37262. i -= a + r,
  37263. i += this.writeVarint32(r, i),
  37264. h.encodeUTF16toUTF8(t(e), function(e) {
  37265. this.view[i++] = e
  37266. }
  37267. .bind(this)),
  37268. i !== s + r + a)
  37269. throw RangeError("Illegal range: Truncated data, " + i + " == " + (i + r + a));
  37270. return n ? (this.offset = i,
  37271. this) : i - s
  37272. }
  37273. ,
  37274. a.readVString = function(e) {
  37275. var t = "undefined" == typeof e;
  37276. if (t && (e = this.offset),
  37277. !this.noAssert) {
  37278. if ("number" != typeof e || e % 1 !== 0)
  37279. throw TypeError("Illegal offset: " + e + " (not an integer)");
  37280. if (e >>>= 0,
  37281. e < 0 || e + 1 > this.buffer.byteLength)
  37282. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  37283. }
  37284. var i = e
  37285. , n = this.readVarint32(e)
  37286. , r = this.readUTF8String(n.value, o.METRICS_BYTES, e += n.length);
  37287. return e += r.length,
  37288. t ? (this.offset = e,
  37289. r.string) : {
  37290. string: r.string,
  37291. length: e - i
  37292. }
  37293. }
  37294. ,
  37295. a.append = function(e, t, i) {
  37296. "number" != typeof t && "string" == typeof t || (i = t,
  37297. t = void 0);
  37298. var n = "undefined" == typeof i;
  37299. if (n && (i = this.offset),
  37300. !this.noAssert) {
  37301. if ("number" != typeof i || i % 1 !== 0)
  37302. throw TypeError("Illegal offset: " + i + " (not an integer)");
  37303. if (i >>>= 0,
  37304. i < 0 || i + 0 > this.buffer.byteLength)
  37305. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  37306. }
  37307. e instanceof o || (e = o.wrap(e, t));
  37308. var r = e.limit - e.offset;
  37309. if (r <= 0)
  37310. return this;
  37311. i += r;
  37312. var a = this.buffer.byteLength;
  37313. return i > a && this.resize((a *= 2) > i ? a : i),
  37314. i -= r,
  37315. this.view.set(e.view.subarray(e.offset, e.limit), i),
  37316. e.offset += r,
  37317. n && (this.offset += r),
  37318. this
  37319. }
  37320. ,
  37321. a.appendTo = function(e, t) {
  37322. return e.append(this, t),
  37323. this
  37324. }
  37325. ,
  37326. a.assert = function(e) {
  37327. return this.noAssert = !e,
  37328. this
  37329. }
  37330. ,
  37331. a.capacity = function() {
  37332. return this.buffer.byteLength
  37333. }
  37334. ,
  37335. a.clear = function() {
  37336. return this.offset = 0,
  37337. this.limit = this.buffer.byteLength,
  37338. this.markedOffset = -1,
  37339. this
  37340. }
  37341. ,
  37342. a.clone = function(e) {
  37343. var t = new o(0,this.littleEndian,this.noAssert);
  37344. return e ? (t.buffer = new ArrayBuffer(this.buffer.byteLength),
  37345. t.view = new Uint8Array(t.buffer)) : (t.buffer = this.buffer,
  37346. t.view = this.view),
  37347. t.offset = this.offset,
  37348. t.markedOffset = this.markedOffset,
  37349. t.limit = this.limit,
  37350. t
  37351. }
  37352. ,
  37353. a.compact = function(e, t) {
  37354. if ("undefined" == typeof e && (e = this.offset),
  37355. "undefined" == typeof t && (t = this.limit),
  37356. !this.noAssert) {
  37357. if ("number" != typeof e || e % 1 !== 0)
  37358. throw TypeError("Illegal begin: Not an integer");
  37359. if (e >>>= 0,
  37360. "number" != typeof t || t % 1 !== 0)
  37361. throw TypeError("Illegal end: Not an integer");
  37362. if (t >>>= 0,
  37363. e < 0 || e > t || t > this.buffer.byteLength)
  37364. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  37365. }
  37366. if (0 === e && t === this.buffer.byteLength)
  37367. return this;
  37368. var i = t - e;
  37369. if (0 === i)
  37370. return this.buffer = s,
  37371. this.view = null,
  37372. this.markedOffset >= 0 && (this.markedOffset -= e),
  37373. this.offset = 0,
  37374. this.limit = 0,
  37375. this;
  37376. var n = new ArrayBuffer(i)
  37377. , r = new Uint8Array(n);
  37378. return r.set(this.view.subarray(e, t)),
  37379. this.buffer = n,
  37380. this.view = r,
  37381. this.markedOffset >= 0 && (this.markedOffset -= e),
  37382. this.offset = 0,
  37383. this.limit = i,
  37384. this
  37385. }
  37386. ,
  37387. a.copy = function(e, t) {
  37388. if ("undefined" == typeof e && (e = this.offset),
  37389. "undefined" == typeof t && (t = this.limit),
  37390. !this.noAssert) {
  37391. if ("number" != typeof e || e % 1 !== 0)
  37392. throw TypeError("Illegal begin: Not an integer");
  37393. if (e >>>= 0,
  37394. "number" != typeof t || t % 1 !== 0)
  37395. throw TypeError("Illegal end: Not an integer");
  37396. if (t >>>= 0,
  37397. e < 0 || e > t || t > this.buffer.byteLength)
  37398. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  37399. }
  37400. if (e === t)
  37401. return new o(0,this.littleEndian,this.noAssert);
  37402. var i = t - e
  37403. , n = new o(i,this.littleEndian,this.noAssert);
  37404. return n.offset = 0,
  37405. n.limit = i,
  37406. n.markedOffset >= 0 && (n.markedOffset -= e),
  37407. this.copyTo(n, 0, e, t),
  37408. n
  37409. }
  37410. ,
  37411. a.copyTo = function(e, t, i, n) {
  37412. var r, a;
  37413. if (!this.noAssert && !o.isByteBuffer(e))
  37414. throw TypeError("Illegal target: Not a ByteBuffer");
  37415. if (t = (a = "undefined" == typeof t) ? e.offset : 0 | t,
  37416. i = (r = "undefined" == typeof i) ? this.offset : 0 | i,
  37417. n = "undefined" == typeof n ? this.limit : 0 | n,
  37418. t < 0 || t > e.buffer.byteLength)
  37419. throw RangeError("Illegal target range: 0 <= " + t + " <= " + e.buffer.byteLength);
  37420. if (i < 0 || n > this.buffer.byteLength)
  37421. throw RangeError("Illegal source range: 0 <= " + i + " <= " + this.buffer.byteLength);
  37422. var s = n - i;
  37423. return 0 === s ? e : (e.ensureCapacity(t + s),
  37424. e.view.set(this.view.subarray(i, n), t),
  37425. r && (this.offset += s),
  37426. a && (e.offset += s),
  37427. this)
  37428. }
  37429. ,
  37430. a.ensureCapacity = function(e) {
  37431. var t = this.buffer.byteLength;
  37432. return t < e ? this.resize((t *= 2) > e ? t : e) : this
  37433. }
  37434. ,
  37435. a.fill = function(e, t, i) {
  37436. var n = "undefined" == typeof t;
  37437. if (n && (t = this.offset),
  37438. "string" == typeof e && e.length > 0 && (e = e.charCodeAt(0)),
  37439. "undefined" == typeof t && (t = this.offset),
  37440. "undefined" == typeof i && (i = this.limit),
  37441. !this.noAssert) {
  37442. if ("number" != typeof e || e % 1 !== 0)
  37443. throw TypeError("Illegal value: " + e + " (not an integer)");
  37444. if (e |= 0,
  37445. "number" != typeof t || t % 1 !== 0)
  37446. throw TypeError("Illegal begin: Not an integer");
  37447. if (t >>>= 0,
  37448. "number" != typeof i || i % 1 !== 0)
  37449. throw TypeError("Illegal end: Not an integer");
  37450. if (i >>>= 0,
  37451. t < 0 || t > i || i > this.buffer.byteLength)
  37452. throw RangeError("Illegal range: 0 <= " + t + " <= " + i + " <= " + this.buffer.byteLength)
  37453. }
  37454. if (t >= i)
  37455. return this;
  37456. for (; t < i; )
  37457. this.view[t++] = e;
  37458. return n && (this.offset = t),
  37459. this
  37460. }
  37461. ,
  37462. a.flip = function() {
  37463. return this.limit = this.offset,
  37464. this.offset = 0,
  37465. this
  37466. }
  37467. ,
  37468. a.mark = function(e) {
  37469. if (e = "undefined" == typeof e ? this.offset : e,
  37470. !this.noAssert) {
  37471. if ("number" != typeof e || e % 1 !== 0)
  37472. throw TypeError("Illegal offset: " + e + " (not an integer)");
  37473. if (e >>>= 0,
  37474. e < 0 || e + 0 > this.buffer.byteLength)
  37475. throw RangeError("Illegal offset: 0 <= " + e + " (+0) <= " + this.buffer.byteLength)
  37476. }
  37477. return this.markedOffset = e,
  37478. this
  37479. }
  37480. ,
  37481. a.order = function(e) {
  37482. if (!this.noAssert && "boolean" != typeof e)
  37483. throw TypeError("Illegal littleEndian: Not a boolean");
  37484. return this.littleEndian = !!e,
  37485. this
  37486. }
  37487. ,
  37488. a.LE = function(e) {
  37489. return this.littleEndian = "undefined" == typeof e || !!e,
  37490. this
  37491. }
  37492. ,
  37493. a.BE = function(e) {
  37494. return this.littleEndian = "undefined" != typeof e && !e,
  37495. this
  37496. }
  37497. ,
  37498. a.prepend = function(e, t, i) {
  37499. "number" != typeof t && "string" == typeof t || (i = t,
  37500. t = void 0);
  37501. var n = "undefined" == typeof i;
  37502. if (n && (i = this.offset),
  37503. !this.noAssert) {
  37504. if ("number" != typeof i || i % 1 !== 0)
  37505. throw TypeError("Illegal offset: " + i + " (not an integer)");
  37506. if (i >>>= 0,
  37507. i < 0 || i + 0 > this.buffer.byteLength)
  37508. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  37509. }
  37510. e instanceof o || (e = o.wrap(e, t));
  37511. var r = e.limit - e.offset;
  37512. if (r <= 0)
  37513. return this;
  37514. var a = r - i;
  37515. if (a > 0) {
  37516. var s = new ArrayBuffer(this.buffer.byteLength + a)
  37517. , l = new Uint8Array(s);
  37518. l.set(this.view.subarray(i, this.buffer.byteLength), r),
  37519. this.buffer = s,
  37520. this.view = l,
  37521. this.offset += a,
  37522. this.markedOffset >= 0 && (this.markedOffset += a),
  37523. this.limit += a,
  37524. i += a
  37525. } else {
  37526. new Uint8Array(this.buffer)
  37527. }
  37528. return this.view.set(e.view.subarray(e.offset, e.limit), i - r),
  37529. e.offset = e.limit,
  37530. n && (this.offset -= r),
  37531. this
  37532. }
  37533. ,
  37534. a.prependTo = function(e, t) {
  37535. return e.prepend(this, t),
  37536. this
  37537. }
  37538. ,
  37539. a.printDebug = function(e) {
  37540. "function" != typeof e && (e = console.log.bind(console)),
  37541. e(this.toString() + "\n-------------------------------------------------------------------\n" + this.toDebug(!0))
  37542. }
  37543. ,
  37544. a.remaining = function() {
  37545. return this.limit - this.offset
  37546. }
  37547. ,
  37548. a.reset = function() {
  37549. return this.markedOffset >= 0 ? (this.offset = this.markedOffset,
  37550. this.markedOffset = -1) : this.offset = 0,
  37551. this
  37552. }
  37553. ,
  37554. a.resize = function(e) {
  37555. if (!this.noAssert) {
  37556. if ("number" != typeof e || e % 1 !== 0)
  37557. throw TypeError("Illegal capacity: " + e + " (not an integer)");
  37558. if (e |= 0,
  37559. e < 0)
  37560. throw RangeError("Illegal capacity: 0 <= " + e)
  37561. }
  37562. if (this.buffer.byteLength < e) {
  37563. var t = new ArrayBuffer(e)
  37564. , i = new Uint8Array(t);
  37565. i.set(this.view),
  37566. this.buffer = t,
  37567. this.view = i
  37568. }
  37569. return this
  37570. }
  37571. ,
  37572. a.reverse = function(e, t) {
  37573. if ("undefined" == typeof e && (e = this.offset),
  37574. "undefined" == typeof t && (t = this.limit),
  37575. !this.noAssert) {
  37576. if ("number" != typeof e || e % 1 !== 0)
  37577. throw TypeError("Illegal begin: Not an integer");
  37578. if (e >>>= 0,
  37579. "number" != typeof t || t % 1 !== 0)
  37580. throw TypeError("Illegal end: Not an integer");
  37581. if (t >>>= 0,
  37582. e < 0 || e > t || t > this.buffer.byteLength)
  37583. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  37584. }
  37585. return e === t ? this : (Array.prototype.reverse.call(this.view.subarray(e, t)),
  37586. this)
  37587. }
  37588. ,
  37589. a.skip = function(e) {
  37590. if (!this.noAssert) {
  37591. if ("number" != typeof e || e % 1 !== 0)
  37592. throw TypeError("Illegal length: " + e + " (not an integer)");
  37593. e |= 0
  37594. }
  37595. var t = this.offset + e;
  37596. if (!this.noAssert && (t < 0 || t > this.buffer.byteLength))
  37597. throw RangeError("Illegal length: 0 <= " + this.offset + " + " + e + " <= " + this.buffer.byteLength);
  37598. return this.offset = t,
  37599. this
  37600. }
  37601. ,
  37602. a.slice = function(e, t) {
  37603. if ("undefined" == typeof e && (e = this.offset),
  37604. "undefined" == typeof t && (t = this.limit),
  37605. !this.noAssert) {
  37606. if ("number" != typeof e || e % 1 !== 0)
  37607. throw TypeError("Illegal begin: Not an integer");
  37608. if (e >>>= 0,
  37609. "number" != typeof t || t % 1 !== 0)
  37610. throw TypeError("Illegal end: Not an integer");
  37611. if (t >>>= 0,
  37612. e < 0 || e > t || t > this.buffer.byteLength)
  37613. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  37614. }
  37615. var i = this.clone();
  37616. return i.offset = e,
  37617. i.limit = t,
  37618. i
  37619. }
  37620. ,
  37621. a.toBuffer = function(e) {
  37622. var t = this.offset
  37623. , i = this.limit;
  37624. if (!this.noAssert) {
  37625. if ("number" != typeof t || t % 1 !== 0)
  37626. throw TypeError("Illegal offset: Not an integer");
  37627. if (t >>>= 0,
  37628. "number" != typeof i || i % 1 !== 0)
  37629. throw TypeError("Illegal limit: Not an integer");
  37630. if (i >>>= 0,
  37631. t < 0 || t > i || i > this.buffer.byteLength)
  37632. throw RangeError("Illegal range: 0 <= " + t + " <= " + i + " <= " + this.buffer.byteLength)
  37633. }
  37634. if (!e && 0 === t && i === this.buffer.byteLength)
  37635. return this.buffer;
  37636. if (t === i)
  37637. return s;
  37638. var n = new ArrayBuffer(i - t);
  37639. return new Uint8Array(n).set(new Uint8Array(this.buffer).subarray(t, i), 0),
  37640. n
  37641. }
  37642. ,
  37643. a.toArrayBuffer = a.toBuffer,
  37644. a.toString = function(e, t, i) {
  37645. if ("undefined" == typeof e)
  37646. return "ByteBufferAB(offset=" + this.offset + ",markedOffset=" + this.markedOffset + ",limit=" + this.limit + ",capacity=" + this.capacity() + ")";
  37647. switch ("number" == typeof e && (e = "utf8",
  37648. t = e,
  37649. i = t),
  37650. e) {
  37651. case "utf8":
  37652. return this.toUTF8(t, i);
  37653. case "base64":
  37654. return this.toBase64(t, i);
  37655. case "hex":
  37656. return this.toHex(t, i);
  37657. case "binary":
  37658. return this.toBinary(t, i);
  37659. case "debug":
  37660. return this.toDebug();
  37661. case "columns":
  37662. return this.toColumns();
  37663. default:
  37664. throw Error("Unsupported encoding: " + e)
  37665. }
  37666. }
  37667. ;
  37668. var c = function() {
  37669. 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)
  37670. i[t[n]] = n;
  37671. return e.encode = function(e, i) {
  37672. for (var n, r; null !== (n = e()); )
  37673. i(t[n >> 2 & 63]),
  37674. r = (3 & n) << 4,
  37675. null !== (n = e()) ? (r |= n >> 4 & 15,
  37676. i(t[63 & (r | n >> 4 & 15)]),
  37677. r = (15 & n) << 2,
  37678. null !== (n = e()) ? (i(t[63 & (r | n >> 6 & 3)]),
  37679. i(t[63 & n])) : (i(t[63 & r]),
  37680. i(61))) : (i(t[63 & r]),
  37681. i(61),
  37682. i(61))
  37683. }
  37684. ,
  37685. e.decode = function(e, t) {
  37686. function n(e) {
  37687. throw Error("Illegal character code: " + e)
  37688. }
  37689. for (var r, o, a; null !== (r = e()); )
  37690. if (o = i[r],
  37691. "undefined" == typeof o && n(r),
  37692. null !== (r = e()) && (a = i[r],
  37693. "undefined" == typeof a && n(r),
  37694. t(o << 2 >>> 0 | (48 & a) >> 4),
  37695. null !== (r = e()))) {
  37696. if (o = i[r],
  37697. "undefined" == typeof o) {
  37698. if (61 === r)
  37699. break;
  37700. n(r)
  37701. }
  37702. if (t((15 & a) << 4 >>> 0 | (60 & o) >> 2),
  37703. null !== (r = e())) {
  37704. if (a = i[r],
  37705. "undefined" == typeof a) {
  37706. if (61 === r)
  37707. break;
  37708. n(r)
  37709. }
  37710. t((3 & o) << 6 >>> 0 | a)
  37711. }
  37712. }
  37713. }
  37714. ,
  37715. e.test = function(e) {
  37716. return /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.test(e)
  37717. }
  37718. ,
  37719. e
  37720. }();
  37721. a.toBase64 = function(e, t) {
  37722. if ("undefined" == typeof e && (e = this.offset),
  37723. "undefined" == typeof t && (t = this.limit),
  37724. e |= 0,
  37725. t |= 0,
  37726. e < 0 || t > this.capacity || e > t)
  37727. throw RangeError("begin, end");
  37728. var n;
  37729. return c.encode(function() {
  37730. return e < t ? this.view[e++] : null
  37731. }
  37732. .bind(this), n = i()),
  37733. n()
  37734. }
  37735. ,
  37736. o.fromBase64 = function(e, i) {
  37737. if ("string" != typeof e)
  37738. throw TypeError("str");
  37739. var n = new o(e.length / 4 * 3,i)
  37740. , r = 0;
  37741. return c.decode(t(e), function(e) {
  37742. n.view[r++] = e
  37743. }),
  37744. n.limit = r,
  37745. n
  37746. }
  37747. ,
  37748. o.btoa = function(e) {
  37749. return o.fromBinary(e).toBase64()
  37750. }
  37751. ,
  37752. o.atob = function(e) {
  37753. return o.fromBase64(e).toBinary()
  37754. }
  37755. ,
  37756. a.toBinary = function(e, t) {
  37757. if ("undefined" == typeof e && (e = this.offset),
  37758. "undefined" == typeof t && (t = this.limit),
  37759. e |= 0,
  37760. t |= 0,
  37761. e < 0 || t > this.capacity() || e > t)
  37762. throw RangeError("begin, end");
  37763. if (e === t)
  37764. return "";
  37765. for (var i = [], n = []; e < t; )
  37766. i.push(this.view[e++]),
  37767. i.length >= 1024 && (n.push(String.fromCharCode.apply(String, i)),
  37768. i = []);
  37769. return n.join("") + String.fromCharCode.apply(String, i)
  37770. }
  37771. ,
  37772. o.fromBinary = function(e, t) {
  37773. if ("string" != typeof e)
  37774. throw TypeError("str");
  37775. for (var i, n = 0, r = e.length, a = new o(r,t); n < r; ) {
  37776. if (i = e.charCodeAt(n),
  37777. i > 255)
  37778. throw RangeError("illegal char code: " + i);
  37779. a.view[n++] = i
  37780. }
  37781. return a.limit = r,
  37782. a
  37783. }
  37784. ,
  37785. a.toDebug = function(e) {
  37786. for (var t, i = -1, n = this.buffer.byteLength, r = "", o = "", a = ""; i < n; ) {
  37787. if (i !== -1 && (t = this.view[i],
  37788. r += t < 16 ? "0" + t.toString(16).toUpperCase() : t.toString(16).toUpperCase(),
  37789. e && (o += t > 32 && t < 127 ? String.fromCharCode(t) : ".")),
  37790. ++i,
  37791. e && i > 0 && i % 16 === 0 && i !== n) {
  37792. for (; r.length < 51; )
  37793. r += " ";
  37794. a += r + o + "\n",
  37795. r = o = ""
  37796. }
  37797. 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 ? " " : ""
  37798. }
  37799. if (e && " " !== r) {
  37800. for (; r.length < 51; )
  37801. r += " ";
  37802. a += r + o + "\n"
  37803. }
  37804. return e ? a : r
  37805. }
  37806. ,
  37807. o.fromDebug = function(e, t, i) {
  37808. 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; ) {
  37809. switch (n = e.charAt(l++)) {
  37810. case "!":
  37811. if (!i) {
  37812. if (u || d || p) {
  37813. f = !0;
  37814. break
  37815. }
  37816. u = d = p = !0
  37817. }
  37818. s.offset = s.markedOffset = s.limit = c,
  37819. h = !1;
  37820. break;
  37821. case "|":
  37822. if (!i) {
  37823. if (u || p) {
  37824. f = !0;
  37825. break
  37826. }
  37827. u = p = !0
  37828. }
  37829. s.offset = s.limit = c,
  37830. h = !1;
  37831. break;
  37832. case "[":
  37833. if (!i) {
  37834. if (u || d) {
  37835. f = !0;
  37836. break
  37837. }
  37838. u = d = !0
  37839. }
  37840. s.offset = s.markedOffset = c,
  37841. h = !1;
  37842. break;
  37843. case "<":
  37844. if (!i) {
  37845. if (u) {
  37846. f = !0;
  37847. break
  37848. }
  37849. u = !0
  37850. }
  37851. s.offset = c,
  37852. h = !1;
  37853. break;
  37854. case "]":
  37855. if (!i) {
  37856. if (p || d) {
  37857. f = !0;
  37858. break
  37859. }
  37860. p = d = !0
  37861. }
  37862. s.limit = s.markedOffset = c,
  37863. h = !1;
  37864. break;
  37865. case ">":
  37866. if (!i) {
  37867. if (p) {
  37868. f = !0;
  37869. break
  37870. }
  37871. p = !0
  37872. }
  37873. s.limit = c,
  37874. h = !1;
  37875. break;
  37876. case "'":
  37877. if (!i) {
  37878. if (d) {
  37879. f = !0;
  37880. break
  37881. }
  37882. d = !0
  37883. }
  37884. s.markedOffset = c,
  37885. h = !1;
  37886. break;
  37887. case " ":
  37888. h = !1;
  37889. break;
  37890. default:
  37891. if (!i && h) {
  37892. f = !0;
  37893. break
  37894. }
  37895. if (r = parseInt(n + e.charAt(l++), 16),
  37896. !i && (isNaN(r) || r < 0 || r > 255))
  37897. throw TypeError("Illegal str: Not a debug encoded string");
  37898. s.view[c++] = r,
  37899. h = !0
  37900. }
  37901. if (f)
  37902. throw TypeError("Illegal str: Invalid symbol at " + l)
  37903. }
  37904. if (!i) {
  37905. if (!u || !p)
  37906. throw TypeError("Illegal str: Missing offset or limit");
  37907. if (c < s.buffer.byteLength)
  37908. throw TypeError("Illegal str: Not a debug encoded string (is it hex?) " + c + " < " + a)
  37909. }
  37910. return s
  37911. }
  37912. ,
  37913. a.toHex = function(e, t) {
  37914. if (e = "undefined" == typeof e ? this.offset : e,
  37915. t = "undefined" == typeof t ? this.limit : t,
  37916. !this.noAssert) {
  37917. if ("number" != typeof e || e % 1 !== 0)
  37918. throw TypeError("Illegal begin: Not an integer");
  37919. if (e >>>= 0,
  37920. "number" != typeof t || t % 1 !== 0)
  37921. throw TypeError("Illegal end: Not an integer");
  37922. if (t >>>= 0,
  37923. e < 0 || e > t || t > this.buffer.byteLength)
  37924. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  37925. }
  37926. for (var i, n = new Array(t - e); e < t; )
  37927. i = this.view[e++],
  37928. i < 16 ? n.push("0", i.toString(16)) : n.push(i.toString(16));
  37929. return n.join("")
  37930. }
  37931. ,
  37932. o.fromHex = function(e, t, i) {
  37933. if (!i) {
  37934. if ("string" != typeof e)
  37935. throw TypeError("Illegal str: Not a string");
  37936. if (e.length % 2 !== 0)
  37937. throw TypeError("Illegal str: Length not a multiple of 2")
  37938. }
  37939. for (var n, r = e.length, a = new o(r / 2 | 0,t), s = 0, l = 0; s < r; s += 2) {
  37940. if (n = parseInt(e.substring(s, s + 2), 16),
  37941. !i && (!isFinite(n) || n < 0 || n > 255))
  37942. throw TypeError("Illegal str: Contains non-hex characters");
  37943. a.view[l++] = n
  37944. }
  37945. return a.limit = l,
  37946. a
  37947. }
  37948. ;
  37949. var h = function() {
  37950. var e = {};
  37951. return e.MAX_CODEPOINT = 1114111,
  37952. e.encodeUTF8 = function(e, t) {
  37953. var i = null;
  37954. for ("number" == typeof e && (i = e,
  37955. e = function() {
  37956. return null
  37957. }
  37958. ); null !== i || null !== (i = e()); )
  37959. i < 128 ? t(127 & i) : i < 2048 ? (t(i >> 6 & 31 | 192),
  37960. t(63 & i | 128)) : i < 65536 ? (t(i >> 12 & 15 | 224),
  37961. t(i >> 6 & 63 | 128),
  37962. t(63 & i | 128)) : (t(i >> 18 & 7 | 240),
  37963. t(i >> 12 & 63 | 128),
  37964. t(i >> 6 & 63 | 128),
  37965. t(63 & i | 128)),
  37966. i = null
  37967. }
  37968. ,
  37969. e.decodeUTF8 = function(e, t) {
  37970. for (var i, n, r, o, a = function(e) {
  37971. e = e.slice(0, e.indexOf(null));
  37972. var t = Error(e.toString());
  37973. throw t.name = "TruncatedError",
  37974. t.bytes = e,
  37975. t
  37976. }; null !== (i = e()); )
  37977. if (0 === (128 & i))
  37978. t(i);
  37979. else if (192 === (224 & i))
  37980. null === (n = e()) && a([i, n]),
  37981. t((31 & i) << 6 | 63 & n);
  37982. else if (224 === (240 & i))
  37983. (null === (n = e()) || null === (r = e())) && a([i, n, r]),
  37984. t((15 & i) << 12 | (63 & n) << 6 | 63 & r);
  37985. else {
  37986. if (240 !== (248 & i))
  37987. throw RangeError("Illegal starting byte: " + i);
  37988. (null === (n = e()) || null === (r = e()) || null === (o = e())) && a([i, n, r, o]),
  37989. t((7 & i) << 18 | (63 & n) << 12 | (63 & r) << 6 | 63 & o)
  37990. }
  37991. }
  37992. ,
  37993. e.UTF16toUTF8 = function(e, t) {
  37994. for (var i, n = null; ; ) {
  37995. if (null === (i = null !== n ? n : e()))
  37996. break;
  37997. i >= 55296 && i <= 57343 && null !== (n = e()) && n >= 56320 && n <= 57343 ? (t(1024 * (i - 55296) + n - 56320 + 65536),
  37998. n = null) : t(i)
  37999. }
  38000. null !== n && t(n)
  38001. }
  38002. ,
  38003. e.UTF8toUTF16 = function(e, t) {
  38004. var i = null;
  38005. for ("number" == typeof e && (i = e,
  38006. e = function() {
  38007. return null
  38008. }
  38009. ); null !== i || null !== (i = e()); )
  38010. i <= 65535 ? t(i) : (i -= 65536,
  38011. t((i >> 10) + 55296),
  38012. t(i % 1024 + 56320)),
  38013. i = null
  38014. }
  38015. ,
  38016. e.encodeUTF16toUTF8 = function(t, i) {
  38017. e.UTF16toUTF8(t, function(t) {
  38018. e.encodeUTF8(t, i)
  38019. })
  38020. }
  38021. ,
  38022. e.decodeUTF8toUTF16 = function(t, i) {
  38023. e.decodeUTF8(t, function(t) {
  38024. e.UTF8toUTF16(t, i)
  38025. })
  38026. }
  38027. ,
  38028. e.calculateCodePoint = function(e) {
  38029. return e < 128 ? 1 : e < 2048 ? 2 : e < 65536 ? 3 : 4
  38030. }
  38031. ,
  38032. e.calculateUTF8 = function(e) {
  38033. for (var t, i = 0; null !== (t = e()); )
  38034. i += t < 128 ? 1 : t < 2048 ? 2 : t < 65536 ? 3 : 4;
  38035. return i
  38036. }
  38037. ,
  38038. e.calculateUTF16asUTF8 = function(t) {
  38039. var i = 0
  38040. , n = 0;
  38041. return e.UTF16toUTF8(t, function(e) {
  38042. ++i,
  38043. n += e < 128 ? 1 : e < 2048 ? 2 : e < 65536 ? 3 : 4
  38044. }),
  38045. [i, n]
  38046. }
  38047. ,
  38048. e
  38049. }();
  38050. return a.toUTF8 = function(e, t) {
  38051. if ("undefined" == typeof e && (e = this.offset),
  38052. "undefined" == typeof t && (t = this.limit),
  38053. !this.noAssert) {
  38054. if ("number" != typeof e || e % 1 !== 0)
  38055. throw TypeError("Illegal begin: Not an integer");
  38056. if (e >>>= 0,
  38057. "number" != typeof t || t % 1 !== 0)
  38058. throw TypeError("Illegal end: Not an integer");
  38059. if (t >>>= 0,
  38060. e < 0 || e > t || t > this.buffer.byteLength)
  38061. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  38062. }
  38063. var n;
  38064. try {
  38065. h.decodeUTF8toUTF16(function() {
  38066. return e < t ? this.view[e++] : null
  38067. }
  38068. .bind(this), n = i())
  38069. } catch (i) {
  38070. if (e !== t)
  38071. throw RangeError("Illegal range: Truncated data, " + e + " != " + t)
  38072. }
  38073. return n()
  38074. }
  38075. ,
  38076. o.fromUTF8 = function(e, i, n) {
  38077. if (!n && "string" != typeof e)
  38078. throw TypeError("Illegal str: Not a string");
  38079. var r = new o(h.calculateUTF16asUTF8(t(e), !0)[1],i,n)
  38080. , a = 0;
  38081. return h.encodeUTF16toUTF8(t(e), function(e) {
  38082. r.view[a++] = e
  38083. }),
  38084. r.limit = a,
  38085. r
  38086. }
  38087. ,
  38088. o
  38089. })
  38090. }
  38091. , {
  38092. long: 216
  38093. }],
  38094. 216: [function(e, t, i) {
  38095. !function(i, n) {
  38096. "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()
  38097. }(this, function() {
  38098. "use strict";
  38099. function e(e, t, i) {
  38100. this.low = 0 | e,
  38101. this.high = 0 | t,
  38102. this.unsigned = !!i
  38103. }
  38104. function t(e) {
  38105. return (e && e.__isLong__) === !0
  38106. }
  38107. function i(e, t) {
  38108. var i, n, o;
  38109. return t ? (e >>>= 0,
  38110. (o = 0 <= e && e < 256) && (n = l[e]) ? n : (i = r(e, (0 | e) < 0 ? -1 : 0, !0),
  38111. o && (l[e] = i),
  38112. i)) : (e |= 0,
  38113. (o = -128 <= e && e < 128) && (n = s[e]) ? n : (i = r(e, e < 0 ? -1 : 0, !1),
  38114. o && (s[e] = i),
  38115. i))
  38116. }
  38117. function n(e, t) {
  38118. if (isNaN(e) || !isFinite(e))
  38119. return t ? m : g;
  38120. if (t) {
  38121. if (e < 0)
  38122. return m;
  38123. if (e >= d)
  38124. return I
  38125. } else {
  38126. if (e <= -p)
  38127. return E;
  38128. if (e + 1 >= p)
  38129. return C
  38130. }
  38131. return e < 0 ? n(-e, t).neg() : r(e % u | 0, e / u | 0, t)
  38132. }
  38133. function r(t, i, n) {
  38134. return new e(t,i,n)
  38135. }
  38136. function o(e, t, i) {
  38137. if (0 === e.length)
  38138. throw Error("empty string");
  38139. if ("NaN" === e || "Infinity" === e || "+Infinity" === e || "-Infinity" === e)
  38140. return g;
  38141. if ("number" == typeof t ? (i = t,
  38142. t = !1) : t = !!t,
  38143. i = i || 10,
  38144. i < 2 || 36 < i)
  38145. throw RangeError("radix");
  38146. var r;
  38147. if ((r = e.indexOf("-")) > 0)
  38148. throw Error("interior hyphen");
  38149. if (0 === r)
  38150. return o(e.substring(1), t, i).neg();
  38151. for (var a = n(c(i, 8)), s = g, l = 0; l < e.length; l += 8) {
  38152. var h = Math.min(8, e.length - l)
  38153. , u = parseInt(e.substring(l, l + h), i);
  38154. if (h < 8) {
  38155. var d = n(c(i, h));
  38156. s = s.mul(d).add(n(u))
  38157. } else
  38158. s = s.mul(a),
  38159. s = s.add(n(u))
  38160. }
  38161. return s.unsigned = t,
  38162. s
  38163. }
  38164. function a(t) {
  38165. return t instanceof e ? t : "number" == typeof t ? n(t) : "string" == typeof t ? o(t) : r(t.low, t.high, t.unsigned)
  38166. }
  38167. e.prototype.__isLong__,
  38168. Object.defineProperty(e.prototype, "__isLong__", {
  38169. value: !0,
  38170. enumerable: !1,
  38171. configurable: !1
  38172. }),
  38173. e.isLong = t;
  38174. var s = {}
  38175. , l = {};
  38176. e.fromInt = i,
  38177. e.fromNumber = n,
  38178. e.fromBits = r;
  38179. var c = Math.pow;
  38180. e.fromString = o,
  38181. e.fromValue = a;
  38182. var h = 1 << 24
  38183. , u = 4294967296
  38184. , d = 0x10000000000000000
  38185. , p = d / 2
  38186. , f = i(h)
  38187. , g = i(0);
  38188. e.ZERO = g;
  38189. var m = i(0, !0);
  38190. e.UZERO = m;
  38191. var v = i(1);
  38192. e.ONE = v;
  38193. var A = i(1, !0);
  38194. e.UONE = A;
  38195. var y = i(-1);
  38196. e.NEG_ONE = y;
  38197. var C = r(-1, 2147483647, !1);
  38198. e.MAX_VALUE = C;
  38199. var I = r(-1, -1, !0);
  38200. e.MAX_UNSIGNED_VALUE = I;
  38201. var E = r(0, -2147483648, !1);
  38202. e.MIN_VALUE = E;
  38203. var b = e.prototype;
  38204. return b.toInt = function() {
  38205. return this.unsigned ? this.low >>> 0 : this.low
  38206. }
  38207. ,
  38208. b.toNumber = function() {
  38209. return this.unsigned ? (this.high >>> 0) * u + (this.low >>> 0) : this.high * u + (this.low >>> 0)
  38210. }
  38211. ,
  38212. b.toString = function(e) {
  38213. if (e = e || 10,
  38214. e < 2 || 36 < e)
  38215. throw RangeError("radix");
  38216. if (this.isZero())
  38217. return "0";
  38218. if (this.isNegative()) {
  38219. if (this.eq(E)) {
  38220. var t = n(e)
  38221. , i = this.div(t)
  38222. , r = i.mul(t).sub(this);
  38223. return i.toString(e) + r.toInt().toString(e)
  38224. }
  38225. return "-" + this.neg().toString(e)
  38226. }
  38227. for (var o = n(c(e, 6), this.unsigned), a = this, s = ""; ; ) {
  38228. var l = a.div(o)
  38229. , h = a.sub(l.mul(o)).toInt() >>> 0
  38230. , u = h.toString(e);
  38231. if (a = l,
  38232. a.isZero())
  38233. return u + s;
  38234. for (; u.length < 6; )
  38235. u = "0" + u;
  38236. s = "" + u + s
  38237. }
  38238. }
  38239. ,
  38240. b.getHighBits = function() {
  38241. return this.high
  38242. }
  38243. ,
  38244. b.getHighBitsUnsigned = function() {
  38245. return this.high >>> 0
  38246. }
  38247. ,
  38248. b.getLowBits = function() {
  38249. return this.low
  38250. }
  38251. ,
  38252. b.getLowBitsUnsigned = function() {
  38253. return this.low >>> 0
  38254. }
  38255. ,
  38256. b.getNumBitsAbs = function() {
  38257. if (this.isNegative())
  38258. return this.eq(E) ? 64 : this.neg().getNumBitsAbs();
  38259. for (var e = 0 != this.high ? this.high : this.low, t = 31; t > 0 && 0 == (e & 1 << t); t--)
  38260. ;
  38261. return 0 != this.high ? t + 33 : t + 1
  38262. }
  38263. ,
  38264. b.isZero = function() {
  38265. return 0 === this.high && 0 === this.low
  38266. }
  38267. ,
  38268. b.isNegative = function() {
  38269. return !this.unsigned && this.high < 0
  38270. }
  38271. ,
  38272. b.isPositive = function() {
  38273. return this.unsigned || this.high >= 0
  38274. }
  38275. ,
  38276. b.isOdd = function() {
  38277. return 1 === (1 & this.low)
  38278. }
  38279. ,
  38280. b.isEven = function() {
  38281. return 0 === (1 & this.low)
  38282. }
  38283. ,
  38284. b.equals = function(e) {
  38285. return t(e) || (e = a(e)),
  38286. (this.unsigned === e.unsigned || this.high >>> 31 !== 1 || e.high >>> 31 !== 1) && (this.high === e.high && this.low === e.low)
  38287. }
  38288. ,
  38289. b.eq = b.equals,
  38290. b.notEquals = function(e) {
  38291. return !this.eq(e)
  38292. }
  38293. ,
  38294. b.neq = b.notEquals,
  38295. b.lessThan = function(e) {
  38296. return this.comp(e) < 0
  38297. }
  38298. ,
  38299. b.lt = b.lessThan,
  38300. b.lessThanOrEqual = function(e) {
  38301. return this.comp(e) <= 0
  38302. }
  38303. ,
  38304. b.lte = b.lessThanOrEqual,
  38305. b.greaterThan = function(e) {
  38306. return this.comp(e) > 0
  38307. }
  38308. ,
  38309. b.gt = b.greaterThan,
  38310. b.greaterThanOrEqual = function(e) {
  38311. return this.comp(e) >= 0
  38312. }
  38313. ,
  38314. b.gte = b.greaterThanOrEqual,
  38315. b.compare = function(e) {
  38316. if (t(e) || (e = a(e)),
  38317. this.eq(e))
  38318. return 0;
  38319. var i = this.isNegative()
  38320. , n = e.isNegative();
  38321. 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
  38322. }
  38323. ,
  38324. b.comp = b.compare,
  38325. b.negate = function() {
  38326. return !this.unsigned && this.eq(E) ? E : this.not().add(v)
  38327. }
  38328. ,
  38329. b.neg = b.negate,
  38330. b.add = function(e) {
  38331. t(e) || (e = a(e));
  38332. var i = this.high >>> 16
  38333. , n = 65535 & this.high
  38334. , o = this.low >>> 16
  38335. , s = 65535 & this.low
  38336. , l = e.high >>> 16
  38337. , c = 65535 & e.high
  38338. , h = e.low >>> 16
  38339. , u = 65535 & e.low
  38340. , d = 0
  38341. , p = 0
  38342. , f = 0
  38343. , g = 0;
  38344. return g += s + u,
  38345. f += g >>> 16,
  38346. g &= 65535,
  38347. f += o + h,
  38348. p += f >>> 16,
  38349. f &= 65535,
  38350. p += n + c,
  38351. d += p >>> 16,
  38352. p &= 65535,
  38353. d += i + l,
  38354. d &= 65535,
  38355. r(f << 16 | g, d << 16 | p, this.unsigned)
  38356. }
  38357. ,
  38358. b.subtract = function(e) {
  38359. return t(e) || (e = a(e)),
  38360. this.add(e.neg())
  38361. }
  38362. ,
  38363. b.sub = b.subtract,
  38364. b.multiply = function(e) {
  38365. if (this.isZero())
  38366. return g;
  38367. if (t(e) || (e = a(e)),
  38368. e.isZero())
  38369. return g;
  38370. if (this.eq(E))
  38371. return e.isOdd() ? E : g;
  38372. if (e.eq(E))
  38373. return this.isOdd() ? E : g;
  38374. if (this.isNegative())
  38375. return e.isNegative() ? this.neg().mul(e.neg()) : this.neg().mul(e).neg();
  38376. if (e.isNegative())
  38377. return this.mul(e.neg()).neg();
  38378. if (this.lt(f) && e.lt(f))
  38379. return n(this.toNumber() * e.toNumber(), this.unsigned);
  38380. var i = this.high >>> 16
  38381. , o = 65535 & this.high
  38382. , s = this.low >>> 16
  38383. , l = 65535 & this.low
  38384. , c = e.high >>> 16
  38385. , h = 65535 & e.high
  38386. , u = e.low >>> 16
  38387. , d = 65535 & e.low
  38388. , p = 0
  38389. , m = 0
  38390. , v = 0
  38391. , A = 0;
  38392. return A += l * d,
  38393. v += A >>> 16,
  38394. A &= 65535,
  38395. v += s * d,
  38396. m += v >>> 16,
  38397. v &= 65535,
  38398. v += l * u,
  38399. m += v >>> 16,
  38400. v &= 65535,
  38401. m += o * d,
  38402. p += m >>> 16,
  38403. m &= 65535,
  38404. m += s * u,
  38405. p += m >>> 16,
  38406. m &= 65535,
  38407. m += l * h,
  38408. p += m >>> 16,
  38409. m &= 65535,
  38410. p += i * d + o * u + s * h + l * c,
  38411. p &= 65535,
  38412. r(v << 16 | A, p << 16 | m, this.unsigned)
  38413. }
  38414. ,
  38415. b.mul = b.multiply,
  38416. b.divide = function(e) {
  38417. if (t(e) || (e = a(e)),
  38418. e.isZero())
  38419. throw Error("division by zero");
  38420. if (this.isZero())
  38421. return this.unsigned ? m : g;
  38422. var i, r, o;
  38423. if (this.unsigned) {
  38424. if (e.unsigned || (e = e.toUnsigned()),
  38425. e.gt(this))
  38426. return m;
  38427. if (e.gt(this.shru(1)))
  38428. return A;
  38429. o = m
  38430. } else {
  38431. if (this.eq(E)) {
  38432. if (e.eq(v) || e.eq(y))
  38433. return E;
  38434. if (e.eq(E))
  38435. return v;
  38436. var s = this.shr(1);
  38437. return i = s.div(e).shl(1),
  38438. i.eq(g) ? e.isNegative() ? v : y : (r = this.sub(e.mul(i)),
  38439. o = i.add(r.div(e)))
  38440. }
  38441. if (e.eq(E))
  38442. return this.unsigned ? m : g;
  38443. if (this.isNegative())
  38444. return e.isNegative() ? this.neg().div(e.neg()) : this.neg().div(e).neg();
  38445. if (e.isNegative())
  38446. return this.div(e.neg()).neg();
  38447. o = g
  38448. }
  38449. for (r = this; r.gte(e); ) {
  38450. i = Math.max(1, Math.floor(r.toNumber() / e.toNumber()));
  38451. 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); )
  38452. i -= h,
  38453. u = n(i, this.unsigned),
  38454. d = u.mul(e);
  38455. u.isZero() && (u = v),
  38456. o = o.add(u),
  38457. r = r.sub(d)
  38458. }
  38459. return o
  38460. }
  38461. ,
  38462. b.div = b.divide,
  38463. b.modulo = function(e) {
  38464. return t(e) || (e = a(e)),
  38465. this.sub(this.div(e).mul(e))
  38466. }
  38467. ,
  38468. b.mod = b.modulo,
  38469. b.not = function() {
  38470. return r(~this.low, ~this.high, this.unsigned)
  38471. }
  38472. ,
  38473. b.and = function(e) {
  38474. return t(e) || (e = a(e)),
  38475. r(this.low & e.low, this.high & e.high, this.unsigned)
  38476. }
  38477. ,
  38478. b.or = function(e) {
  38479. return t(e) || (e = a(e)),
  38480. r(this.low | e.low, this.high | e.high, this.unsigned)
  38481. }
  38482. ,
  38483. b.xor = function(e) {
  38484. return t(e) || (e = a(e)),
  38485. r(this.low ^ e.low, this.high ^ e.high, this.unsigned)
  38486. }
  38487. ,
  38488. b.shiftLeft = function(e) {
  38489. return t(e) && (e = e.toInt()),
  38490. 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)
  38491. }
  38492. ,
  38493. b.shl = b.shiftLeft,
  38494. b.shiftRight = function(e) {
  38495. return t(e) && (e = e.toInt()),
  38496. 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)
  38497. }
  38498. ,
  38499. b.shr = b.shiftRight,
  38500. b.shiftRightUnsigned = function(e) {
  38501. if (t(e) && (e = e.toInt()),
  38502. e &= 63,
  38503. 0 === e)
  38504. return this;
  38505. var i = this.high;
  38506. if (e < 32) {
  38507. var n = this.low;
  38508. return r(n >>> e | i << 32 - e, i >>> e, this.unsigned)
  38509. }
  38510. return 32 === e ? r(i, 0, this.unsigned) : r(i >>> e - 32, 0, this.unsigned)
  38511. }
  38512. ,
  38513. b.shru = b.shiftRightUnsigned,
  38514. b.toSigned = function() {
  38515. return this.unsigned ? r(this.low, this.high, !1) : this
  38516. }
  38517. ,
  38518. b.toUnsigned = function() {
  38519. return this.unsigned ? this : r(this.low, this.high, !0)
  38520. }
  38521. ,
  38522. b.toBytes = function(e) {
  38523. return e ? this.toBytesLE() : this.toBytesBE()
  38524. }
  38525. ,
  38526. b.toBytesLE = function() {
  38527. var e = this.high
  38528. , t = this.low;
  38529. return [255 & t, t >>> 8 & 255, t >>> 16 & 255, t >>> 24 & 255, 255 & e, e >>> 8 & 255, e >>> 16 & 255, e >>> 24 & 255]
  38530. }
  38531. ,
  38532. b.toBytesBE = function() {
  38533. var e = this.high
  38534. , t = this.low;
  38535. return [e >>> 24 & 255, e >>> 16 & 255, e >>> 8 & 255, 255 & e, t >>> 24 & 255, t >>> 16 & 255, t >>> 8 & 255, 255 & t]
  38536. }
  38537. ,
  38538. e
  38539. })
  38540. }
  38541. , {}],
  38542. 217: [function(e, t, i) {
  38543. var n = {
  38544. REVISION: "75"
  38545. };
  38546. "function" == typeof define && define.amd ? define("three", n) : "undefined" != typeof i && "undefined" != typeof t && (t.exports = n),
  38547. void 0 === Number.EPSILON && (Number.EPSILON = Math.pow(2, -52)),
  38548. void 0 === Math.sign && (Math.sign = function(e) {
  38549. return e < 0 ? -1 : e > 0 ? 1 : +e
  38550. }
  38551. ),
  38552. void 0 === Function.prototype.name && void 0 !== Object.defineProperty && Object.defineProperty(Function.prototype, "name", {
  38553. get: function() {
  38554. return this.toString().match(/^\s*function\s*(\S*)\s*\(/)[1]
  38555. }
  38556. }),
  38557. void 0 === Object.assign && Object.defineProperty(Object, "assign", {
  38558. writable: !0,
  38559. configurable: !0,
  38560. value: function(e) {
  38561. "use strict";
  38562. if (void 0 === e || null === e)
  38563. throw new TypeError("Cannot convert first argument to object");
  38564. for (var t = Object(e), i = 1, n = arguments.length; i !== n; ++i) {
  38565. var r = arguments[i];
  38566. if (void 0 !== r && null !== r) {
  38567. r = Object(r);
  38568. for (var o = Object.keys(r), a = 0, s = o.length; a !== s; ++a) {
  38569. var l = o[a]
  38570. , c = Object.getOwnPropertyDescriptor(r, l);
  38571. void 0 !== c && c.enumerable && (t[l] = r[l])
  38572. }
  38573. }
  38574. }
  38575. return t
  38576. }
  38577. }),
  38578. n.MOUSE = {
  38579. LEFT: 0,
  38580. MIDDLE: 1,
  38581. RIGHT: 2
  38582. },
  38583. n.CullFaceNone = 0,
  38584. n.CullFaceBack = 1,
  38585. n.CullFaceFront = 2,
  38586. n.CullFaceFrontBack = 3,
  38587. n.FrontFaceDirectionCW = 0,
  38588. n.FrontFaceDirectionCCW = 1,
  38589. n.BasicShadowMap = 0,
  38590. n.PCFShadowMap = 1,
  38591. n.PCFSoftShadowMap = 2,
  38592. n.FrontSide = 0,
  38593. n.BackSide = 1,
  38594. n.DoubleSide = 2,
  38595. n.FlatShading = 1,
  38596. n.SmoothShading = 2,
  38597. n.NoColors = 0,
  38598. n.FaceColors = 1,
  38599. n.VertexColors = 2,
  38600. n.NoBlending = 0,
  38601. n.NormalBlending = 1,
  38602. n.AdditiveBlending = 2,
  38603. n.SubtractiveBlending = 3,
  38604. n.MultiplyBlending = 4,
  38605. n.CustomBlending = 5,
  38606. n.AddEquation = 100,
  38607. n.SubtractEquation = 101,
  38608. n.ReverseSubtractEquation = 102,
  38609. n.MinEquation = 103,
  38610. n.MaxEquation = 104,
  38611. n.ZeroFactor = 200,
  38612. n.OneFactor = 201,
  38613. n.SrcColorFactor = 202,
  38614. n.OneMinusSrcColorFactor = 203,
  38615. n.SrcAlphaFactor = 204,
  38616. n.OneMinusSrcAlphaFactor = 205,
  38617. n.DstAlphaFactor = 206,
  38618. n.OneMinusDstAlphaFactor = 207,
  38619. n.DstColorFactor = 208,
  38620. n.OneMinusDstColorFactor = 209,
  38621. n.SrcAlphaSaturateFactor = 210,
  38622. n.NeverDepth = 0,
  38623. n.AlwaysDepth = 1,
  38624. n.LessDepth = 2,
  38625. n.LessEqualDepth = 3,
  38626. n.EqualDepth = 4,
  38627. n.GreaterEqualDepth = 5,
  38628. n.GreaterDepth = 6,
  38629. n.NotEqualDepth = 7,
  38630. n.MultiplyOperation = 0,
  38631. n.MixOperation = 1,
  38632. n.AddOperation = 2,
  38633. n.NoToneMapping = 0,
  38634. n.LinearToneMapping = 1,
  38635. n.ReinhardToneMapping = 2,
  38636. n.Uncharted2ToneMapping = 3,
  38637. n.CineonToneMapping = 4,
  38638. n.UVMapping = 300,
  38639. n.CubeReflectionMapping = 301,
  38640. n.CubeRefractionMapping = 302,
  38641. n.EquirectangularReflectionMapping = 303,
  38642. n.EquirectangularRefractionMapping = 304,
  38643. n.SphericalReflectionMapping = 305,
  38644. n.CubeUVReflectionMapping = 306,
  38645. n.CubeUVRefractionMapping = 307,
  38646. n.RepeatWrapping = 1e3,
  38647. n.ClampToEdgeWrapping = 1001,
  38648. n.MirroredRepeatWrapping = 1002,
  38649. n.NearestFilter = 1003,
  38650. n.NearestMipMapNearestFilter = 1004,
  38651. n.NearestMipMapLinearFilter = 1005,
  38652. n.LinearFilter = 1006,
  38653. n.LinearMipMapNearestFilter = 1007,
  38654. n.LinearMipMapLinearFilter = 1008,
  38655. n.UnsignedByteType = 1009,
  38656. n.ByteType = 1010,
  38657. n.ShortType = 1011,
  38658. n.UnsignedShortType = 1012,
  38659. n.IntType = 1013,
  38660. n.UnsignedIntType = 1014,
  38661. n.FloatType = 1015,
  38662. n.HalfFloatType = 1025,
  38663. n.UnsignedShort4444Type = 1016,
  38664. n.UnsignedShort5551Type = 1017,
  38665. n.UnsignedShort565Type = 1018,
  38666. n.AlphaFormat = 1019,
  38667. n.RGBFormat = 1020,
  38668. n.RGBAFormat = 1021,
  38669. n.LuminanceFormat = 1022,
  38670. n.LuminanceAlphaFormat = 1023,
  38671. n.RGBEFormat = n.RGBAFormat,
  38672. n.RGB_S3TC_DXT1_Format = 2001,
  38673. n.RGBA_S3TC_DXT1_Format = 2002,
  38674. n.RGBA_S3TC_DXT3_Format = 2003,
  38675. n.RGBA_S3TC_DXT5_Format = 2004,
  38676. n.RGB_PVRTC_4BPPV1_Format = 2100,
  38677. n.RGB_PVRTC_2BPPV1_Format = 2101,
  38678. n.RGBA_PVRTC_4BPPV1_Format = 2102,
  38679. n.RGBA_PVRTC_2BPPV1_Format = 2103,
  38680. n.RGB_ETC1_Format = 2151,
  38681. n.LoopOnce = 2200,
  38682. n.LoopRepeat = 2201,
  38683. n.LoopPingPong = 2202,
  38684. n.InterpolateDiscrete = 2300,
  38685. n.InterpolateLinear = 2301,
  38686. n.InterpolateSmooth = 2302,
  38687. n.ZeroCurvatureEnding = 2400,
  38688. n.ZeroSlopeEnding = 2401,
  38689. n.WrapAroundEnding = 2402,
  38690. n.TrianglesDrawMode = 0,
  38691. n.TriangleStripDrawMode = 1,
  38692. n.TriangleFanDrawMode = 2,
  38693. n.LinearEncoding = 3e3,
  38694. n.sRGBEncoding = 3001,
  38695. n.GammaEncoding = 3007,
  38696. n.RGBEEncoding = 3002,
  38697. n.LogLuvEncoding = 3003,
  38698. n.RGBM7Encoding = 3004,
  38699. n.RGBM16Encoding = 3005,
  38700. n.RGBDEncoding = 3006,
  38701. n.Color = function(e) {
  38702. return 3 === arguments.length ? this.fromArray(arguments) : this.set(e)
  38703. }
  38704. ,
  38705. n.Color.prototype = {
  38706. constructor: n.Color,
  38707. r: 1,
  38708. g: 1,
  38709. b: 1,
  38710. set: function(e) {
  38711. return e instanceof n.Color ? this.copy(e) : "number" == typeof e ? this.setHex(e) : "string" == typeof e && this.setStyle(e),
  38712. this
  38713. },
  38714. setScalar: function(e) {
  38715. this.r = e,
  38716. this.g = e,
  38717. this.b = e
  38718. },
  38719. setHex: function(e) {
  38720. return e = Math.floor(e),
  38721. this.r = (e >> 16 & 255) / 255,
  38722. this.g = (e >> 8 & 255) / 255,
  38723. this.b = (255 & e) / 255,
  38724. this
  38725. },
  38726. setRGB: function(e, t, i) {
  38727. return this.r = e,
  38728. this.g = t,
  38729. this.b = i,
  38730. this
  38731. },
  38732. setHSL: function() {
  38733. function e(e, t, i) {
  38734. return i < 0 && (i += 1),
  38735. i > 1 && (i -= 1),
  38736. i < 1 / 6 ? e + 6 * (t - e) * i : i < .5 ? t : i < 2 / 3 ? e + 6 * (t - e) * (2 / 3 - i) : e
  38737. }
  38738. return function(t, i, r) {
  38739. if (t = n.Math.euclideanModulo(t, 1),
  38740. i = n.Math.clamp(i, 0, 1),
  38741. r = n.Math.clamp(r, 0, 1),
  38742. 0 === i)
  38743. this.r = this.g = this.b = r;
  38744. else {
  38745. var o = r <= .5 ? r * (1 + i) : r + i - r * i
  38746. , a = 2 * r - o;
  38747. this.r = e(a, o, t + 1 / 3),
  38748. this.g = e(a, o, t),
  38749. this.b = e(a, o, t - 1 / 3)
  38750. }
  38751. return this
  38752. }
  38753. }(),
  38754. setStyle: function(e) {
  38755. function t(t) {
  38756. void 0 !== t && parseFloat(t) < 1 && console.warn("THREE.Color: Alpha component of " + e + " will be ignored.")
  38757. }
  38758. var i;
  38759. if (i = /^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(e)) {
  38760. var r, o = i[1], a = i[2];
  38761. switch (o) {
  38762. case "rgb":
  38763. case "rgba":
  38764. if (r = /^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a))
  38765. return this.r = Math.min(255, parseInt(r[1], 10)) / 255,
  38766. this.g = Math.min(255, parseInt(r[2], 10)) / 255,
  38767. this.b = Math.min(255, parseInt(r[3], 10)) / 255,
  38768. t(r[5]),
  38769. this;
  38770. if (r = /^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a))
  38771. return this.r = Math.min(100, parseInt(r[1], 10)) / 100,
  38772. this.g = Math.min(100, parseInt(r[2], 10)) / 100,
  38773. this.b = Math.min(100, parseInt(r[3], 10)) / 100,
  38774. t(r[5]),
  38775. this;
  38776. break;
  38777. case "hsl":
  38778. case "hsla":
  38779. if (r = /^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a)) {
  38780. var s = parseFloat(r[1]) / 360
  38781. , l = parseInt(r[2], 10) / 100
  38782. , c = parseInt(r[3], 10) / 100;
  38783. return t(r[5]),
  38784. this.setHSL(s, l, c)
  38785. }
  38786. }
  38787. } else if (i = /^\#([A-Fa-f0-9]+)$/.exec(e)) {
  38788. var h = i[1]
  38789. , u = h.length;
  38790. if (3 === u)
  38791. return this.r = parseInt(h.charAt(0) + h.charAt(0), 16) / 255,
  38792. this.g = parseInt(h.charAt(1) + h.charAt(1), 16) / 255,
  38793. this.b = parseInt(h.charAt(2) + h.charAt(2), 16) / 255,
  38794. this;
  38795. if (6 === u)
  38796. return this.r = parseInt(h.charAt(0) + h.charAt(1), 16) / 255,
  38797. this.g = parseInt(h.charAt(2) + h.charAt(3), 16) / 255,
  38798. this.b = parseInt(h.charAt(4) + h.charAt(5), 16) / 255,
  38799. this
  38800. }
  38801. if (e && e.length > 0) {
  38802. var h = n.ColorKeywords[e];
  38803. void 0 !== h ? this.setHex(h) : console.warn("THREE.Color: Unknown color " + e)
  38804. }
  38805. return this
  38806. },
  38807. clone: function() {
  38808. return new this.constructor(this.r,this.g,this.b)
  38809. },
  38810. copy: function(e) {
  38811. return this.r = e.r,
  38812. this.g = e.g,
  38813. this.b = e.b,
  38814. this
  38815. },
  38816. copyGammaToLinear: function(e, t) {
  38817. return void 0 === t && (t = 2),
  38818. this.r = Math.pow(e.r, t),
  38819. this.g = Math.pow(e.g, t),
  38820. this.b = Math.pow(e.b, t),
  38821. this
  38822. },
  38823. copyLinearToGamma: function(e, t) {
  38824. void 0 === t && (t = 2);
  38825. var i = t > 0 ? 1 / t : 1;
  38826. return this.r = Math.pow(e.r, i),
  38827. this.g = Math.pow(e.g, i),
  38828. this.b = Math.pow(e.b, i),
  38829. this
  38830. },
  38831. convertGammaToLinear: function() {
  38832. var e = this.r
  38833. , t = this.g
  38834. , i = this.b;
  38835. return this.r = e * e,
  38836. this.g = t * t,
  38837. this.b = i * i,
  38838. this
  38839. },
  38840. convertLinearToGamma: function() {
  38841. return this.r = Math.sqrt(this.r),
  38842. this.g = Math.sqrt(this.g),
  38843. this.b = Math.sqrt(this.b),
  38844. this
  38845. },
  38846. getHex: function() {
  38847. return 255 * this.r << 16 ^ 255 * this.g << 8 ^ 255 * this.b << 0
  38848. },
  38849. getHexString: function() {
  38850. return ("000000" + this.getHex().toString(16)).slice(-6)
  38851. },
  38852. getHSL: function(e) {
  38853. var t, i, n = e || {
  38854. h: 0,
  38855. s: 0,
  38856. l: 0
  38857. }, 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;
  38858. if (l === s)
  38859. t = 0,
  38860. i = 0;
  38861. else {
  38862. var h = s - l;
  38863. switch (i = c <= .5 ? h / (s + l) : h / (2 - s - l),
  38864. s) {
  38865. case r:
  38866. t = (o - a) / h + (o < a ? 6 : 0);
  38867. break;
  38868. case o:
  38869. t = (a - r) / h + 2;
  38870. break;
  38871. case a:
  38872. t = (r - o) / h + 4
  38873. }
  38874. t /= 6
  38875. }
  38876. return n.h = t,
  38877. n.s = i,
  38878. n.l = c,
  38879. n
  38880. },
  38881. getStyle: function() {
  38882. return "rgb(" + (255 * this.r | 0) + "," + (255 * this.g | 0) + "," + (255 * this.b | 0) + ")"
  38883. },
  38884. offsetHSL: function(e, t, i) {
  38885. var n = this.getHSL();
  38886. return n.h += e,
  38887. n.s += t,
  38888. n.l += i,
  38889. this.setHSL(n.h, n.s, n.l),
  38890. this
  38891. },
  38892. add: function(e) {
  38893. return this.r += e.r,
  38894. this.g += e.g,
  38895. this.b += e.b,
  38896. this
  38897. },
  38898. addColors: function(e, t) {
  38899. return this.r = e.r + t.r,
  38900. this.g = e.g + t.g,
  38901. this.b = e.b + t.b,
  38902. this
  38903. },
  38904. addScalar: function(e) {
  38905. return this.r += e,
  38906. this.g += e,
  38907. this.b += e,
  38908. this
  38909. },
  38910. multiply: function(e) {
  38911. return this.r *= e.r,
  38912. this.g *= e.g,
  38913. this.b *= e.b,
  38914. this
  38915. },
  38916. multiplyScalar: function(e) {
  38917. return this.r *= e,
  38918. this.g *= e,
  38919. this.b *= e,
  38920. this
  38921. },
  38922. lerp: function(e, t) {
  38923. return this.r += (e.r - this.r) * t,
  38924. this.g += (e.g - this.g) * t,
  38925. this.b += (e.b - this.b) * t,
  38926. this
  38927. },
  38928. equals: function(e) {
  38929. return e.r === this.r && e.g === this.g && e.b === this.b
  38930. },
  38931. fromArray: function(e, t) {
  38932. return void 0 === t && (t = 0),
  38933. this.r = e[t],
  38934. this.g = e[t + 1],
  38935. this.b = e[t + 2],
  38936. this
  38937. },
  38938. toArray: function(e, t) {
  38939. return void 0 === e && (e = []),
  38940. void 0 === t && (t = 0),
  38941. e[t] = this.r,
  38942. e[t + 1] = this.g,
  38943. e[t + 2] = this.b,
  38944. e
  38945. }
  38946. },
  38947. n.ColorKeywords = {
  38948. aliceblue: 15792383,
  38949. antiquewhite: 16444375,
  38950. aqua: 65535,
  38951. aquamarine: 8388564,
  38952. azure: 15794175,
  38953. beige: 16119260,
  38954. bisque: 16770244,
  38955. black: 0,
  38956. blanchedalmond: 16772045,
  38957. blue: 255,
  38958. blueviolet: 9055202,
  38959. brown: 10824234,
  38960. burlywood: 14596231,
  38961. cadetblue: 6266528,
  38962. chartreuse: 8388352,
  38963. chocolate: 13789470,
  38964. coral: 16744272,
  38965. cornflowerblue: 6591981,
  38966. cornsilk: 16775388,
  38967. crimson: 14423100,
  38968. cyan: 65535,
  38969. darkblue: 139,
  38970. darkcyan: 35723,
  38971. darkgoldenrod: 12092939,
  38972. darkgray: 11119017,
  38973. darkgreen: 25600,
  38974. darkgrey: 11119017,
  38975. darkkhaki: 12433259,
  38976. darkmagenta: 9109643,
  38977. darkolivegreen: 5597999,
  38978. darkorange: 16747520,
  38979. darkorchid: 10040012,
  38980. darkred: 9109504,
  38981. darksalmon: 15308410,
  38982. darkseagreen: 9419919,
  38983. darkslateblue: 4734347,
  38984. darkslategray: 3100495,
  38985. darkslategrey: 3100495,
  38986. darkturquoise: 52945,
  38987. darkviolet: 9699539,
  38988. deeppink: 16716947,
  38989. deepskyblue: 49151,
  38990. dimgray: 6908265,
  38991. dimgrey: 6908265,
  38992. dodgerblue: 2003199,
  38993. firebrick: 11674146,
  38994. floralwhite: 16775920,
  38995. forestgreen: 2263842,
  38996. fuchsia: 16711935,
  38997. gainsboro: 14474460,
  38998. ghostwhite: 16316671,
  38999. gold: 16766720,
  39000. goldenrod: 14329120,
  39001. gray: 8421504,
  39002. green: 32768,
  39003. greenyellow: 11403055,
  39004. grey: 8421504,
  39005. honeydew: 15794160,
  39006. hotpink: 16738740,
  39007. indianred: 13458524,
  39008. indigo: 4915330,
  39009. ivory: 16777200,
  39010. khaki: 15787660,
  39011. lavender: 15132410,
  39012. lavenderblush: 16773365,
  39013. lawngreen: 8190976,
  39014. lemonchiffon: 16775885,
  39015. lightblue: 11393254,
  39016. lightcoral: 15761536,
  39017. lightcyan: 14745599,
  39018. lightgoldenrodyellow: 16448210,
  39019. lightgray: 13882323,
  39020. lightgreen: 9498256,
  39021. lightgrey: 13882323,
  39022. lightpink: 16758465,
  39023. lightsalmon: 16752762,
  39024. lightseagreen: 2142890,
  39025. lightskyblue: 8900346,
  39026. lightslategray: 7833753,
  39027. lightslategrey: 7833753,
  39028. lightsteelblue: 11584734,
  39029. lightyellow: 16777184,
  39030. lime: 65280,
  39031. limegreen: 3329330,
  39032. linen: 16445670,
  39033. magenta: 16711935,
  39034. maroon: 8388608,
  39035. mediumaquamarine: 6737322,
  39036. mediumblue: 205,
  39037. mediumorchid: 12211667,
  39038. mediumpurple: 9662683,
  39039. mediumseagreen: 3978097,
  39040. mediumslateblue: 8087790,
  39041. mediumspringgreen: 64154,
  39042. mediumturquoise: 4772300,
  39043. mediumvioletred: 13047173,
  39044. midnightblue: 1644912,
  39045. mintcream: 16121850,
  39046. mistyrose: 16770273,
  39047. moccasin: 16770229,
  39048. navajowhite: 16768685,
  39049. navy: 128,
  39050. oldlace: 16643558,
  39051. olive: 8421376,
  39052. olivedrab: 7048739,
  39053. orange: 16753920,
  39054. orangered: 16729344,
  39055. orchid: 14315734,
  39056. palegoldenrod: 15657130,
  39057. palegreen: 10025880,
  39058. paleturquoise: 11529966,
  39059. palevioletred: 14381203,
  39060. papayawhip: 16773077,
  39061. peachpuff: 16767673,
  39062. peru: 13468991,
  39063. pink: 16761035,
  39064. plum: 14524637,
  39065. powderblue: 11591910,
  39066. purple: 8388736,
  39067. red: 16711680,
  39068. rosybrown: 12357519,
  39069. royalblue: 4286945,
  39070. saddlebrown: 9127187,
  39071. salmon: 16416882,
  39072. sandybrown: 16032864,
  39073. seagreen: 3050327,
  39074. seashell: 16774638,
  39075. sienna: 10506797,
  39076. silver: 12632256,
  39077. skyblue: 8900331,
  39078. slateblue: 6970061,
  39079. slategray: 7372944,
  39080. slategrey: 7372944,
  39081. snow: 16775930,
  39082. springgreen: 65407,
  39083. steelblue: 4620980,
  39084. tan: 13808780,
  39085. teal: 32896,
  39086. thistle: 14204888,
  39087. tomato: 16737095,
  39088. turquoise: 4251856,
  39089. violet: 15631086,
  39090. wheat: 16113331,
  39091. white: 16777215,
  39092. whitesmoke: 16119285,
  39093. yellow: 16776960,
  39094. yellowgreen: 10145074
  39095. },
  39096. n.Quaternion = function(e, t, i, n) {
  39097. this._x = e || 0,
  39098. this._y = t || 0,
  39099. this._z = i || 0,
  39100. this._w = void 0 !== n ? n : 1
  39101. }
  39102. ,
  39103. n.Quaternion.prototype = {
  39104. constructor: n.Quaternion,
  39105. get x() {
  39106. return this._x
  39107. },
  39108. set x(e) {
  39109. this._x = e,
  39110. this.onChangeCallback()
  39111. },
  39112. get y() {
  39113. return this._y
  39114. },
  39115. set y(e) {
  39116. this._y = e,
  39117. this.onChangeCallback()
  39118. },
  39119. get z() {
  39120. return this._z
  39121. },
  39122. set z(e) {
  39123. this._z = e,
  39124. this.onChangeCallback()
  39125. },
  39126. get w() {
  39127. return this._w
  39128. },
  39129. set w(e) {
  39130. this._w = e,
  39131. this.onChangeCallback()
  39132. },
  39133. set: function(e, t, i, n) {
  39134. return this._x = e,
  39135. this._y = t,
  39136. this._z = i,
  39137. this._w = n,
  39138. this.onChangeCallback(),
  39139. this
  39140. },
  39141. clone: function() {
  39142. return new this.constructor(this._x,this._y,this._z,this._w)
  39143. },
  39144. copy: function(e) {
  39145. return this._x = e.x,
  39146. this._y = e.y,
  39147. this._z = e.z,
  39148. this._w = e.w,
  39149. this.onChangeCallback(),
  39150. this
  39151. },
  39152. setFromEuler: function(e, t) {
  39153. if (e instanceof n.Euler == !1)
  39154. throw new Error("THREE.Quaternion: .setFromEuler() now expects a Euler rotation rather than a Vector3 and order.");
  39155. var i = Math.cos(e._x / 2)
  39156. , r = Math.cos(e._y / 2)
  39157. , o = Math.cos(e._z / 2)
  39158. , a = Math.sin(e._x / 2)
  39159. , s = Math.sin(e._y / 2)
  39160. , l = Math.sin(e._z / 2)
  39161. , c = e.order;
  39162. return "XYZ" === c ? (this._x = a * r * o + i * s * l,
  39163. this._y = i * s * o - a * r * l,
  39164. this._z = i * r * l + a * s * o,
  39165. this._w = i * r * o - a * s * l) : "YXZ" === c ? (this._x = a * r * o + i * s * l,
  39166. this._y = i * s * o - a * r * l,
  39167. this._z = i * r * l - a * s * o,
  39168. this._w = i * r * o + a * s * l) : "ZXY" === c ? (this._x = a * r * o - i * s * l,
  39169. this._y = i * s * o + a * r * l,
  39170. this._z = i * r * l + a * s * o,
  39171. this._w = i * r * o - a * s * l) : "ZYX" === c ? (this._x = a * r * o - i * s * l,
  39172. this._y = i * s * o + a * r * l,
  39173. this._z = i * r * l - a * s * o,
  39174. this._w = i * r * o + a * s * l) : "YZX" === c ? (this._x = a * r * o + i * s * l,
  39175. this._y = i * s * o + a * r * l,
  39176. this._z = i * r * l - a * s * o,
  39177. this._w = i * r * o - a * s * l) : "XZY" === c && (this._x = a * r * o - i * s * l,
  39178. this._y = i * s * o - a * r * l,
  39179. this._z = i * r * l + a * s * o,
  39180. this._w = i * r * o + a * s * l),
  39181. t !== !1 && this.onChangeCallback(),
  39182. this
  39183. },
  39184. setFromAxisAngle: function(e, t) {
  39185. var i = t / 2
  39186. , n = Math.sin(i);
  39187. return this._x = e.x * n,
  39188. this._y = e.y * n,
  39189. this._z = e.z * n,
  39190. this._w = Math.cos(i),
  39191. this.onChangeCallback(),
  39192. this
  39193. },
  39194. setFromRotationMatrix: function(e) {
  39195. 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;
  39196. return d > 0 ? (t = .5 / Math.sqrt(d + 1),
  39197. this._w = .25 / t,
  39198. this._x = (h - l) * t,
  39199. this._y = (o - c) * t,
  39200. this._z = (a - r) * t) : n > s && n > u ? (t = 2 * Math.sqrt(1 + n - s - u),
  39201. this._w = (h - l) / t,
  39202. this._x = .25 * t,
  39203. this._y = (r + a) / t,
  39204. this._z = (o + c) / t) : s > u ? (t = 2 * Math.sqrt(1 + s - n - u),
  39205. this._w = (o - c) / t,
  39206. this._x = (r + a) / t,
  39207. this._y = .25 * t,
  39208. this._z = (l + h) / t) : (t = 2 * Math.sqrt(1 + u - n - s),
  39209. this._w = (a - r) / t,
  39210. this._x = (o + c) / t,
  39211. this._y = (l + h) / t,
  39212. this._z = .25 * t),
  39213. this.onChangeCallback(),
  39214. this
  39215. },
  39216. setFromUnitVectors: function() {
  39217. var e, t, i = 1e-6;
  39218. return function(r, o) {
  39219. return void 0 === e && (e = new n.Vector3),
  39220. t = r.dot(o) + 1,
  39221. t < i ? (t = 0,
  39222. 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),
  39223. this._x = e.x,
  39224. this._y = e.y,
  39225. this._z = e.z,
  39226. this._w = t,
  39227. this.normalize(),
  39228. this
  39229. }
  39230. }(),
  39231. inverse: function() {
  39232. return this.conjugate().normalize(),
  39233. this
  39234. },
  39235. conjugate: function() {
  39236. return this._x *= -1,
  39237. this._y *= -1,
  39238. this._z *= -1,
  39239. this.onChangeCallback(),
  39240. this
  39241. },
  39242. dot: function(e) {
  39243. return this._x * e._x + this._y * e._y + this._z * e._z + this._w * e._w
  39244. },
  39245. lengthSq: function() {
  39246. return this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w
  39247. },
  39248. length: function() {
  39249. return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w)
  39250. },
  39251. normalize: function() {
  39252. var e = this.length();
  39253. return 0 === e ? (this._x = 0,
  39254. this._y = 0,
  39255. this._z = 0,
  39256. this._w = 1) : (e = 1 / e,
  39257. this._x = this._x * e,
  39258. this._y = this._y * e,
  39259. this._z = this._z * e,
  39260. this._w = this._w * e),
  39261. this.onChangeCallback(),
  39262. this
  39263. },
  39264. multiply: function(e, t) {
  39265. return void 0 !== t ? (console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),
  39266. this.multiplyQuaternions(e, t)) : this.multiplyQuaternions(this, e)
  39267. },
  39268. multiplyQuaternions: function(e, t) {
  39269. var i = e._x
  39270. , n = e._y
  39271. , r = e._z
  39272. , o = e._w
  39273. , a = t._x
  39274. , s = t._y
  39275. , l = t._z
  39276. , c = t._w;
  39277. return this._x = i * c + o * a + n * l - r * s,
  39278. this._y = n * c + o * s + r * a - i * l,
  39279. this._z = r * c + o * l + i * s - n * a,
  39280. this._w = o * c - i * a - n * s - r * l,
  39281. this.onChangeCallback(),
  39282. this
  39283. },
  39284. slerp: function(e, t) {
  39285. if (0 === t)
  39286. return this;
  39287. if (1 === t)
  39288. return this.copy(e);
  39289. var i = this._x
  39290. , n = this._y
  39291. , r = this._z
  39292. , o = this._w
  39293. , a = o * e._w + i * e._x + n * e._y + r * e._z;
  39294. if (a < 0 ? (this._w = -e._w,
  39295. this._x = -e._x,
  39296. this._y = -e._y,
  39297. this._z = -e._z,
  39298. a = -a) : this.copy(e),
  39299. a >= 1)
  39300. return this._w = o,
  39301. this._x = i,
  39302. this._y = n,
  39303. this._z = r,
  39304. this;
  39305. var s = Math.sqrt(1 - a * a);
  39306. if (Math.abs(s) < .001)
  39307. return this._w = .5 * (o + this._w),
  39308. this._x = .5 * (i + this._x),
  39309. this._y = .5 * (n + this._y),
  39310. this._z = .5 * (r + this._z),
  39311. this;
  39312. var l = Math.atan2(s, a)
  39313. , c = Math.sin((1 - t) * l) / s
  39314. , h = Math.sin(t * l) / s;
  39315. return this._w = o * c + this._w * h,
  39316. this._x = i * c + this._x * h,
  39317. this._y = n * c + this._y * h,
  39318. this._z = r * c + this._z * h,
  39319. this.onChangeCallback(),
  39320. this
  39321. },
  39322. equals: function(e) {
  39323. return e._x === this._x && e._y === this._y && e._z === this._z && e._w === this._w
  39324. },
  39325. fromArray: function(e, t) {
  39326. return void 0 === t && (t = 0),
  39327. this._x = e[t],
  39328. this._y = e[t + 1],
  39329. this._z = e[t + 2],
  39330. this._w = e[t + 3],
  39331. this.onChangeCallback(),
  39332. this
  39333. },
  39334. toArray: function(e, t) {
  39335. return void 0 === e && (e = []),
  39336. void 0 === t && (t = 0),
  39337. e[t] = this._x,
  39338. e[t + 1] = this._y,
  39339. e[t + 2] = this._z,
  39340. e[t + 3] = this._w,
  39341. e
  39342. },
  39343. onChange: function(e) {
  39344. return this.onChangeCallback = e,
  39345. this
  39346. },
  39347. onChangeCallback: function() {}
  39348. },
  39349. Object.assign(n.Quaternion, {
  39350. slerp: function(e, t, i, n) {
  39351. return i.copy(e).slerp(t, n)
  39352. },
  39353. slerpFlat: function(e, t, i, n, r, o, a) {
  39354. var s = i[n + 0]
  39355. , l = i[n + 1]
  39356. , c = i[n + 2]
  39357. , h = i[n + 3]
  39358. , u = r[o + 0]
  39359. , d = r[o + 1]
  39360. , p = r[o + 2]
  39361. , f = r[o + 3];
  39362. if (h !== f || s !== u || l !== d || c !== p) {
  39363. var g = 1 - a
  39364. , m = s * u + l * d + c * p + h * f
  39365. , v = m >= 0 ? 1 : -1
  39366. , A = 1 - m * m;
  39367. if (A > Number.EPSILON) {
  39368. var y = Math.sqrt(A)
  39369. , C = Math.atan2(y, m * v);
  39370. g = Math.sin(g * C) / y,
  39371. a = Math.sin(a * C) / y
  39372. }
  39373. var I = a * v;
  39374. if (s = s * g + u * I,
  39375. l = l * g + d * I,
  39376. c = c * g + p * I,
  39377. h = h * g + f * I,
  39378. g === 1 - a) {
  39379. var E = 1 / Math.sqrt(s * s + l * l + c * c + h * h);
  39380. s *= E,
  39381. l *= E,
  39382. c *= E,
  39383. h *= E
  39384. }
  39385. }
  39386. e[t] = s,
  39387. e[t + 1] = l,
  39388. e[t + 2] = c,
  39389. e[t + 3] = h
  39390. }
  39391. }),
  39392. n.Vector2 = function(e, t) {
  39393. this.x = e || 0,
  39394. this.y = t || 0
  39395. }
  39396. ,
  39397. n.Vector2.prototype = {
  39398. constructor: n.Vector2,
  39399. get width() {
  39400. return this.x
  39401. },
  39402. set width(e) {
  39403. this.x = e
  39404. },
  39405. get height() {
  39406. return this.y
  39407. },
  39408. set height(e) {
  39409. this.y = e
  39410. },
  39411. set: function(e, t) {
  39412. return this.x = e,
  39413. this.y = t,
  39414. this
  39415. },
  39416. setScalar: function(e) {
  39417. return this.x = e,
  39418. this.y = e,
  39419. this
  39420. },
  39421. setX: function(e) {
  39422. return this.x = e,
  39423. this
  39424. },
  39425. setY: function(e) {
  39426. return this.y = e,
  39427. this
  39428. },
  39429. setComponent: function(e, t) {
  39430. switch (e) {
  39431. case 0:
  39432. this.x = t;
  39433. break;
  39434. case 1:
  39435. this.y = t;
  39436. break;
  39437. default:
  39438. throw new Error("index is out of range: " + e)
  39439. }
  39440. },
  39441. getComponent: function(e) {
  39442. switch (e) {
  39443. case 0:
  39444. return this.x;
  39445. case 1:
  39446. return this.y;
  39447. default:
  39448. throw new Error("index is out of range: " + e)
  39449. }
  39450. },
  39451. clone: function() {
  39452. return new this.constructor(this.x,this.y)
  39453. },
  39454. copy: function(e) {
  39455. return this.x = e.x,
  39456. this.y = e.y,
  39457. this
  39458. },
  39459. add: function(e, t) {
  39460. return void 0 !== t ? (console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),
  39461. this.addVectors(e, t)) : (this.x += e.x,
  39462. this.y += e.y,
  39463. this)
  39464. },
  39465. addScalar: function(e) {
  39466. return this.x += e,
  39467. this.y += e,
  39468. this
  39469. },
  39470. addVectors: function(e, t) {
  39471. return this.x = e.x + t.x,
  39472. this.y = e.y + t.y,
  39473. this
  39474. },
  39475. addScaledVector: function(e, t) {
  39476. return this.x += e.x * t,
  39477. this.y += e.y * t,
  39478. this
  39479. },
  39480. sub: function(e, t) {
  39481. return void 0 !== t ? (console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
  39482. this.subVectors(e, t)) : (this.x -= e.x,
  39483. this.y -= e.y,
  39484. this)
  39485. },
  39486. subScalar: function(e) {
  39487. return this.x -= e,
  39488. this.y -= e,
  39489. this
  39490. },
  39491. subVectors: function(e, t) {
  39492. return this.x = e.x - t.x,
  39493. this.y = e.y - t.y,
  39494. this
  39495. },
  39496. multiply: function(e) {
  39497. return this.x *= e.x,
  39498. this.y *= e.y,
  39499. this
  39500. },
  39501. multiplyScalar: function(e) {
  39502. return isFinite(e) ? (this.x *= e,
  39503. this.y *= e) : (this.x = 0,
  39504. this.y = 0),
  39505. this
  39506. },
  39507. divide: function(e) {
  39508. return this.x /= e.x,
  39509. this.y /= e.y,
  39510. this
  39511. },
  39512. divideScalar: function(e) {
  39513. return this.multiplyScalar(1 / e)
  39514. },
  39515. min: function(e) {
  39516. return this.x = Math.min(this.x, e.x),
  39517. this.y = Math.min(this.y, e.y),
  39518. this
  39519. },
  39520. max: function(e) {
  39521. return this.x = Math.max(this.x, e.x),
  39522. this.y = Math.max(this.y, e.y),
  39523. this
  39524. },
  39525. clamp: function(e, t) {
  39526. return this.x = Math.max(e.x, Math.min(t.x, this.x)),
  39527. this.y = Math.max(e.y, Math.min(t.y, this.y)),
  39528. this
  39529. },
  39530. clampScalar: function() {
  39531. var e, t;
  39532. return function(i, r) {
  39533. return void 0 === e && (e = new n.Vector2,
  39534. t = new n.Vector2),
  39535. e.set(i, i),
  39536. t.set(r, r),
  39537. this.clamp(e, t)
  39538. }
  39539. }(),
  39540. clampLength: function(e, t) {
  39541. var i = this.length();
  39542. return this.multiplyScalar(Math.max(e, Math.min(t, i)) / i),
  39543. this
  39544. },
  39545. floor: function() {
  39546. return this.x = Math.floor(this.x),
  39547. this.y = Math.floor(this.y),
  39548. this
  39549. },
  39550. ceil: function() {
  39551. return this.x = Math.ceil(this.x),
  39552. this.y = Math.ceil(this.y),
  39553. this
  39554. },
  39555. round: function() {
  39556. return this.x = Math.round(this.x),
  39557. this.y = Math.round(this.y),
  39558. this
  39559. },
  39560. roundToZero: function() {
  39561. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x),
  39562. this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y),
  39563. this
  39564. },
  39565. negate: function() {
  39566. return this.x = -this.x,
  39567. this.y = -this.y,
  39568. this
  39569. },
  39570. dot: function(e) {
  39571. return this.x * e.x + this.y * e.y
  39572. },
  39573. lengthSq: function() {
  39574. return this.x * this.x + this.y * this.y
  39575. },
  39576. length: function() {
  39577. return Math.sqrt(this.x * this.x + this.y * this.y)
  39578. },
  39579. lengthManhattan: function() {
  39580. return Math.abs(this.x) + Math.abs(this.y)
  39581. },
  39582. normalize: function() {
  39583. return this.divideScalar(this.length())
  39584. },
  39585. angle: function() {
  39586. var e = Math.atan2(this.y, this.x);
  39587. return e < 0 && (e += 2 * Math.PI),
  39588. e
  39589. },
  39590. distanceTo: function(e) {
  39591. return Math.sqrt(this.distanceToSquared(e))
  39592. },
  39593. distanceToSquared: function(e) {
  39594. var t = this.x - e.x
  39595. , i = this.y - e.y;
  39596. return t * t + i * i
  39597. },
  39598. setLength: function(e) {
  39599. return this.multiplyScalar(e / this.length())
  39600. },
  39601. lerp: function(e, t) {
  39602. return this.x += (e.x - this.x) * t,
  39603. this.y += (e.y - this.y) * t,
  39604. this
  39605. },
  39606. lerpVectors: function(e, t, i) {
  39607. return this.subVectors(t, e).multiplyScalar(i).add(e),
  39608. this
  39609. },
  39610. equals: function(e) {
  39611. return e.x === this.x && e.y === this.y
  39612. },
  39613. fromArray: function(e, t) {
  39614. return void 0 === t && (t = 0),
  39615. this.x = e[t],
  39616. this.y = e[t + 1],
  39617. this
  39618. },
  39619. toArray: function(e, t) {
  39620. return void 0 === e && (e = []),
  39621. void 0 === t && (t = 0),
  39622. e[t] = this.x,
  39623. e[t + 1] = this.y,
  39624. e
  39625. },
  39626. fromAttribute: function(e, t, i) {
  39627. return void 0 === i && (i = 0),
  39628. t = t * e.itemSize + i,
  39629. this.x = e.array[t],
  39630. this.y = e.array[t + 1],
  39631. this
  39632. },
  39633. rotateAround: function(e, t) {
  39634. var i = Math.cos(t)
  39635. , n = Math.sin(t)
  39636. , r = this.x - e.x
  39637. , o = this.y - e.y;
  39638. return this.x = r * i - o * n + e.x,
  39639. this.y = r * n + o * i + e.y,
  39640. this
  39641. }
  39642. },
  39643. n.Vector3 = function(e, t, i) {
  39644. this.x = e || 0,
  39645. this.y = t || 0,
  39646. this.z = i || 0
  39647. }
  39648. ,
  39649. n.Vector3.prototype = {
  39650. constructor: n.Vector3,
  39651. set: function(e, t, i) {
  39652. return this.x = e,
  39653. this.y = t,
  39654. this.z = i,
  39655. this
  39656. },
  39657. setScalar: function(e) {
  39658. return this.x = e,
  39659. this.y = e,
  39660. this.z = e,
  39661. this
  39662. },
  39663. setX: function(e) {
  39664. return this.x = e,
  39665. this
  39666. },
  39667. setY: function(e) {
  39668. return this.y = e,
  39669. this
  39670. },
  39671. setZ: function(e) {
  39672. return this.z = e,
  39673. this
  39674. },
  39675. setComponent: function(e, t) {
  39676. switch (e) {
  39677. case 0:
  39678. this.x = t;
  39679. break;
  39680. case 1:
  39681. this.y = t;
  39682. break;
  39683. case 2:
  39684. this.z = t;
  39685. break;
  39686. default:
  39687. throw new Error("index is out of range: " + e)
  39688. }
  39689. },
  39690. getComponent: function(e) {
  39691. switch (e) {
  39692. case 0:
  39693. return this.x;
  39694. case 1:
  39695. return this.y;
  39696. case 2:
  39697. return this.z;
  39698. default:
  39699. throw new Error("index is out of range: " + e)
  39700. }
  39701. },
  39702. clone: function() {
  39703. return new this.constructor(this.x,this.y,this.z)
  39704. },
  39705. copy: function(e) {
  39706. return this.x = e.x,
  39707. this.y = e.y,
  39708. this.z = e.z,
  39709. this
  39710. },
  39711. add: function(e, t) {
  39712. return void 0 !== t ? (console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),
  39713. this.addVectors(e, t)) : (this.x += e.x,
  39714. this.y += e.y,
  39715. this.z += e.z,
  39716. this)
  39717. },
  39718. addScalar: function(e) {
  39719. return this.x += e,
  39720. this.y += e,
  39721. this.z += e,
  39722. this
  39723. },
  39724. addVectors: function(e, t) {
  39725. return this.x = e.x + t.x,
  39726. this.y = e.y + t.y,
  39727. this.z = e.z + t.z,
  39728. this
  39729. },
  39730. addScaledVector: function(e, t) {
  39731. return this.x += e.x * t,
  39732. this.y += e.y * t,
  39733. this.z += e.z * t,
  39734. this
  39735. },
  39736. sub: function(e, t) {
  39737. return void 0 !== t ? (console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
  39738. this.subVectors(e, t)) : (this.x -= e.x,
  39739. this.y -= e.y,
  39740. this.z -= e.z,
  39741. this)
  39742. },
  39743. subScalar: function(e) {
  39744. return this.x -= e,
  39745. this.y -= e,
  39746. this.z -= e,
  39747. this
  39748. },
  39749. subVectors: function(e, t) {
  39750. return this.x = e.x - t.x,
  39751. this.y = e.y - t.y,
  39752. this.z = e.z - t.z,
  39753. this
  39754. },
  39755. multiply: function(e, t) {
  39756. return void 0 !== t ? (console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),
  39757. this.multiplyVectors(e, t)) : (this.x *= e.x,
  39758. this.y *= e.y,
  39759. this.z *= e.z,
  39760. this)
  39761. },
  39762. multiplyScalar: function(e) {
  39763. return isFinite(e) ? (this.x *= e,
  39764. this.y *= e,
  39765. this.z *= e) : (this.x = 0,
  39766. this.y = 0,
  39767. this.z = 0),
  39768. this
  39769. },
  39770. multiplyVectors: function(e, t) {
  39771. return this.x = e.x * t.x,
  39772. this.y = e.y * t.y,
  39773. this.z = e.z * t.z,
  39774. this
  39775. },
  39776. applyEuler: function() {
  39777. var e;
  39778. return function(t) {
  39779. return t instanceof n.Euler == !1 && console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),
  39780. void 0 === e && (e = new n.Quaternion),
  39781. this.applyQuaternion(e.setFromEuler(t)),
  39782. this
  39783. }
  39784. }(),
  39785. applyAxisAngle: function() {
  39786. var e;
  39787. return function(t, i) {
  39788. return void 0 === e && (e = new n.Quaternion),
  39789. this.applyQuaternion(e.setFromAxisAngle(t, i)),
  39790. this
  39791. }
  39792. }(),
  39793. applyMatrix3: function(e) {
  39794. var t = this.x
  39795. , i = this.y
  39796. , n = this.z
  39797. , r = e.elements;
  39798. return this.x = r[0] * t + r[3] * i + r[6] * n,
  39799. this.y = r[1] * t + r[4] * i + r[7] * n,
  39800. this.z = r[2] * t + r[5] * i + r[8] * n,
  39801. this
  39802. },
  39803. applyMatrix4: function(e) {
  39804. var t = this.x
  39805. , i = this.y
  39806. , n = this.z
  39807. , r = e.elements;
  39808. return this.x = r[0] * t + r[4] * i + r[8] * n + r[12],
  39809. this.y = r[1] * t + r[5] * i + r[9] * n + r[13],
  39810. this.z = r[2] * t + r[6] * i + r[10] * n + r[14],
  39811. this
  39812. },
  39813. applyProjection: function(e) {
  39814. var t = this.x
  39815. , i = this.y
  39816. , n = this.z
  39817. , r = e.elements
  39818. , o = 1 / (r[3] * t + r[7] * i + r[11] * n + r[15]);
  39819. return this.x = (r[0] * t + r[4] * i + r[8] * n + r[12]) * o,
  39820. this.y = (r[1] * t + r[5] * i + r[9] * n + r[13]) * o,
  39821. this.z = (r[2] * t + r[6] * i + r[10] * n + r[14]) * o,
  39822. this
  39823. },
  39824. applyQuaternion: function(e) {
  39825. var t = this.x
  39826. , i = this.y
  39827. , n = this.z
  39828. , r = e.x
  39829. , o = e.y
  39830. , a = e.z
  39831. , s = e.w
  39832. , l = s * t + o * n - a * i
  39833. , c = s * i + a * t - r * n
  39834. , h = s * n + r * i - o * t
  39835. , u = -r * t - o * i - a * n;
  39836. return this.x = l * s + u * -r + c * -a - h * -o,
  39837. this.y = c * s + u * -o + h * -r - l * -a,
  39838. this.z = h * s + u * -a + l * -o - c * -r,
  39839. this
  39840. },
  39841. project: function() {
  39842. var e;
  39843. return function(t) {
  39844. return void 0 === e && (e = new n.Matrix4),
  39845. e.multiplyMatrices(t.projectionMatrix, e.getInverse(t.matrixWorld)),
  39846. this.applyProjection(e)
  39847. }
  39848. }(),
  39849. unproject: function() {
  39850. var e;
  39851. return function(t) {
  39852. return void 0 === e && (e = new n.Matrix4),
  39853. e.multiplyMatrices(t.matrixWorld, e.getInverse(t.projectionMatrix)),
  39854. this.applyProjection(e)
  39855. }
  39856. }(),
  39857. transformDirection: function(e) {
  39858. var t = this.x
  39859. , i = this.y
  39860. , n = this.z
  39861. , r = e.elements;
  39862. return this.x = r[0] * t + r[4] * i + r[8] * n,
  39863. this.y = r[1] * t + r[5] * i + r[9] * n,
  39864. this.z = r[2] * t + r[6] * i + r[10] * n,
  39865. this.normalize(),
  39866. this
  39867. },
  39868. divide: function(e) {
  39869. return this.x /= e.x,
  39870. this.y /= e.y,
  39871. this.z /= e.z,
  39872. this
  39873. },
  39874. divideScalar: function(e) {
  39875. return this.multiplyScalar(1 / e)
  39876. },
  39877. min: function(e) {
  39878. return this.x = Math.min(this.x, e.x),
  39879. this.y = Math.min(this.y, e.y),
  39880. this.z = Math.min(this.z, e.z),
  39881. this
  39882. },
  39883. max: function(e) {
  39884. return this.x = Math.max(this.x, e.x),
  39885. this.y = Math.max(this.y, e.y),
  39886. this.z = Math.max(this.z, e.z),
  39887. this
  39888. },
  39889. clamp: function(e, t) {
  39890. return this.x = Math.max(e.x, Math.min(t.x, this.x)),
  39891. this.y = Math.max(e.y, Math.min(t.y, this.y)),
  39892. this.z = Math.max(e.z, Math.min(t.z, this.z)),
  39893. this
  39894. },
  39895. clampScalar: function() {
  39896. var e, t;
  39897. return function(i, r) {
  39898. return void 0 === e && (e = new n.Vector3,
  39899. t = new n.Vector3),
  39900. e.set(i, i, i),
  39901. t.set(r, r, r),
  39902. this.clamp(e, t)
  39903. }
  39904. }(),
  39905. clampLength: function(e, t) {
  39906. var i = this.length();
  39907. return this.multiplyScalar(Math.max(e, Math.min(t, i)) / i),
  39908. this
  39909. },
  39910. floor: function() {
  39911. return this.x = Math.floor(this.x),
  39912. this.y = Math.floor(this.y),
  39913. this.z = Math.floor(this.z),
  39914. this
  39915. },
  39916. ceil: function() {
  39917. return this.x = Math.ceil(this.x),
  39918. this.y = Math.ceil(this.y),
  39919. this.z = Math.ceil(this.z),
  39920. this
  39921. },
  39922. round: function() {
  39923. return this.x = Math.round(this.x),
  39924. this.y = Math.round(this.y),
  39925. this.z = Math.round(this.z),
  39926. this
  39927. },
  39928. roundToZero: function() {
  39929. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x),
  39930. this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y),
  39931. this.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z),
  39932. this
  39933. },
  39934. negate: function() {
  39935. return this.x = -this.x,
  39936. this.y = -this.y,
  39937. this.z = -this.z,
  39938. this
  39939. },
  39940. dot: function(e) {
  39941. return this.x * e.x + this.y * e.y + this.z * e.z
  39942. },
  39943. lengthSq: function() {
  39944. return this.x * this.x + this.y * this.y + this.z * this.z
  39945. },
  39946. length: function() {
  39947. return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z)
  39948. },
  39949. lengthManhattan: function() {
  39950. return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z)
  39951. },
  39952. normalize: function() {
  39953. return this.divideScalar(this.length())
  39954. },
  39955. setLength: function(e) {
  39956. return this.multiplyScalar(e / this.length())
  39957. },
  39958. lerp: function(e, t) {
  39959. return this.x += (e.x - this.x) * t,
  39960. this.y += (e.y - this.y) * t,
  39961. this.z += (e.z - this.z) * t,
  39962. this
  39963. },
  39964. lerpVectors: function(e, t, i) {
  39965. return this.subVectors(t, e).multiplyScalar(i).add(e),
  39966. this
  39967. },
  39968. cross: function(e, t) {
  39969. if (void 0 !== t)
  39970. return console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),
  39971. this.crossVectors(e, t);
  39972. var i = this.x
  39973. , n = this.y
  39974. , r = this.z;
  39975. return this.x = n * e.z - r * e.y,
  39976. this.y = r * e.x - i * e.z,
  39977. this.z = i * e.y - n * e.x,
  39978. this
  39979. },
  39980. crossVectors: function(e, t) {
  39981. var i = e.x
  39982. , n = e.y
  39983. , r = e.z
  39984. , o = t.x
  39985. , a = t.y
  39986. , s = t.z;
  39987. return this.x = n * s - r * a,
  39988. this.y = r * o - i * s,
  39989. this.z = i * a - n * o,
  39990. this
  39991. },
  39992. projectOnVector: function() {
  39993. var e, t;
  39994. return function(i) {
  39995. return void 0 === e && (e = new n.Vector3),
  39996. e.copy(i).normalize(),
  39997. t = this.dot(e),
  39998. this.copy(e).multiplyScalar(t)
  39999. }
  40000. }(),
  40001. projectOnPlane: function() {
  40002. var e;
  40003. return function(t) {
  40004. return void 0 === e && (e = new n.Vector3),
  40005. e.copy(this).projectOnVector(t),
  40006. this.sub(e)
  40007. }
  40008. }(),
  40009. reflect: function() {
  40010. var e;
  40011. return function(t) {
  40012. return void 0 === e && (e = new n.Vector3),
  40013. this.sub(e.copy(t).multiplyScalar(2 * this.dot(t)))
  40014. }
  40015. }(),
  40016. angleTo: function(e) {
  40017. var t = this.dot(e) / Math.sqrt(this.lengthSq() * e.lengthSq());
  40018. return Math.acos(n.Math.clamp(t, -1, 1))
  40019. },
  40020. distanceTo: function(e) {
  40021. return Math.sqrt(this.distanceToSquared(e))
  40022. },
  40023. distanceToSquared: function(e) {
  40024. var t = this.x - e.x
  40025. , i = this.y - e.y
  40026. , n = this.z - e.z;
  40027. return t * t + i * i + n * n
  40028. },
  40029. setFromSpherical: function(e) {
  40030. var t = Math.sin(e.phi) * e.radius;
  40031. return this.x = t * Math.sin(e.theta),
  40032. this.y = Math.cos(e.phi) * e.radius,
  40033. this.z = t * Math.cos(e.theta),
  40034. this
  40035. },
  40036. setFromMatrixPosition: function(e) {
  40037. return this.setFromMatrixColumn(e, 3)
  40038. },
  40039. setFromMatrixScale: function(e) {
  40040. var t = this.setFromMatrixColumn(e, 0).length()
  40041. , i = this.setFromMatrixColumn(e, 1).length()
  40042. , n = this.setFromMatrixColumn(e, 2).length();
  40043. return this.x = t,
  40044. this.y = i,
  40045. this.z = n,
  40046. this
  40047. },
  40048. setFromMatrixColumn: function(e, t) {
  40049. return "number" == typeof e && (console.warn("THREE.Vector3: setFromMatrixColumn now expects ( matrix, index )."),
  40050. e = arguments[1],
  40051. t = arguments[0]),
  40052. this.fromArray(e.elements, 4 * t)
  40053. },
  40054. equals: function(e) {
  40055. return e.x === this.x && e.y === this.y && e.z === this.z
  40056. },
  40057. fromArray: function(e, t) {
  40058. return void 0 === t && (t = 0),
  40059. this.x = e[t],
  40060. this.y = e[t + 1],
  40061. this.z = e[t + 2],
  40062. this
  40063. },
  40064. toArray: function(e, t) {
  40065. return void 0 === e && (e = []),
  40066. void 0 === t && (t = 0),
  40067. e[t] = this.x,
  40068. e[t + 1] = this.y,
  40069. e[t + 2] = this.z,
  40070. e
  40071. },
  40072. fromAttribute: function(e, t, i) {
  40073. return void 0 === i && (i = 0),
  40074. t = t * e.itemSize + i,
  40075. this.x = e.array[t],
  40076. this.y = e.array[t + 1],
  40077. this.z = e.array[t + 2],
  40078. this
  40079. }
  40080. },
  40081. n.Vector4 = function(e, t, i, n) {
  40082. this.x = e || 0,
  40083. this.y = t || 0,
  40084. this.z = i || 0,
  40085. this.w = void 0 !== n ? n : 1
  40086. }
  40087. ,
  40088. n.Vector4.prototype = {
  40089. constructor: n.Vector4,
  40090. set: function(e, t, i, n) {
  40091. return this.x = e,
  40092. this.y = t,
  40093. this.z = i,
  40094. this.w = n,
  40095. this
  40096. },
  40097. setScalar: function(e) {
  40098. return this.x = e,
  40099. this.y = e,
  40100. this.z = e,
  40101. this.w = e,
  40102. this
  40103. },
  40104. setX: function(e) {
  40105. return this.x = e,
  40106. this
  40107. },
  40108. setY: function(e) {
  40109. return this.y = e,
  40110. this
  40111. },
  40112. setZ: function(e) {
  40113. return this.z = e,
  40114. this
  40115. },
  40116. setW: function(e) {
  40117. return this.w = e,
  40118. this
  40119. },
  40120. setComponent: function(e, t) {
  40121. switch (e) {
  40122. case 0:
  40123. this.x = t;
  40124. break;
  40125. case 1:
  40126. this.y = t;
  40127. break;
  40128. case 2:
  40129. this.z = t;
  40130. break;
  40131. case 3:
  40132. this.w = t;
  40133. break;
  40134. default:
  40135. throw new Error("index is out of range: " + e)
  40136. }
  40137. },
  40138. getComponent: function(e) {
  40139. switch (e) {
  40140. case 0:
  40141. return this.x;
  40142. case 1:
  40143. return this.y;
  40144. case 2:
  40145. return this.z;
  40146. case 3:
  40147. return this.w;
  40148. default:
  40149. throw new Error("index is out of range: " + e)
  40150. }
  40151. },
  40152. clone: function() {
  40153. return new this.constructor(this.x,this.y,this.z,this.w)
  40154. },
  40155. copy: function(e) {
  40156. return this.x = e.x,
  40157. this.y = e.y,
  40158. this.z = e.z,
  40159. this.w = void 0 !== e.w ? e.w : 1,
  40160. this
  40161. },
  40162. add: function(e, t) {
  40163. return void 0 !== t ? (console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),
  40164. this.addVectors(e, t)) : (this.x += e.x,
  40165. this.y += e.y,
  40166. this.z += e.z,
  40167. this.w += e.w,
  40168. this)
  40169. },
  40170. addScalar: function(e) {
  40171. return this.x += e,
  40172. this.y += e,
  40173. this.z += e,
  40174. this.w += e,
  40175. this
  40176. },
  40177. addVectors: function(e, t) {
  40178. return this.x = e.x + t.x,
  40179. this.y = e.y + t.y,
  40180. this.z = e.z + t.z,
  40181. this.w = e.w + t.w,
  40182. this
  40183. },
  40184. addScaledVector: function(e, t) {
  40185. return this.x += e.x * t,
  40186. this.y += e.y * t,
  40187. this.z += e.z * t,
  40188. this.w += e.w * t,
  40189. this
  40190. },
  40191. sub: function(e, t) {
  40192. return void 0 !== t ? (console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
  40193. this.subVectors(e, t)) : (this.x -= e.x,
  40194. this.y -= e.y,
  40195. this.z -= e.z,
  40196. this.w -= e.w,
  40197. this)
  40198. },
  40199. subScalar: function(e) {
  40200. return this.x -= e,
  40201. this.y -= e,
  40202. this.z -= e,
  40203. this.w -= e,
  40204. this
  40205. },
  40206. subVectors: function(e, t) {
  40207. return this.x = e.x - t.x,
  40208. this.y = e.y - t.y,
  40209. this.z = e.z - t.z,
  40210. this.w = e.w - t.w,
  40211. this
  40212. },
  40213. multiplyScalar: function(e) {
  40214. return isFinite(e) ? (this.x *= e,
  40215. this.y *= e,
  40216. this.z *= e,
  40217. this.w *= e) : (this.x = 0,
  40218. this.y = 0,
  40219. this.z = 0,
  40220. this.w = 0),
  40221. this
  40222. },
  40223. applyMatrix4: function(e) {
  40224. var t = this.x
  40225. , i = this.y
  40226. , n = this.z
  40227. , r = this.w
  40228. , o = e.elements;
  40229. return this.x = o[0] * t + o[4] * i + o[8] * n + o[12] * r,
  40230. this.y = o[1] * t + o[5] * i + o[9] * n + o[13] * r,
  40231. this.z = o[2] * t + o[6] * i + o[10] * n + o[14] * r,
  40232. this.w = o[3] * t + o[7] * i + o[11] * n + o[15] * r,
  40233. this
  40234. },
  40235. divideScalar: function(e) {
  40236. return this.multiplyScalar(1 / e)
  40237. },
  40238. setAxisAngleFromQuaternion: function(e) {
  40239. this.w = 2 * Math.acos(e.w);
  40240. var t = Math.sqrt(1 - e.w * e.w);
  40241. return t < 1e-4 ? (this.x = 1,
  40242. this.y = 0,
  40243. this.z = 0) : (this.x = e.x / t,
  40244. this.y = e.y / t,
  40245. this.z = e.z / t),
  40246. this
  40247. },
  40248. setAxisAngleFromRotationMatrix: function(e) {
  40249. 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];
  40250. if (Math.abs(c - u) < o && Math.abs(h - f) < o && Math.abs(p - g) < o) {
  40251. if (Math.abs(c + u) < a && Math.abs(h + f) < a && Math.abs(p + g) < a && Math.abs(l + d + m - 3) < a)
  40252. return this.set(1, 0, 0, 0),
  40253. this;
  40254. t = Math.PI;
  40255. var v = (l + 1) / 2
  40256. , A = (d + 1) / 2
  40257. , y = (m + 1) / 2
  40258. , C = (c + u) / 4
  40259. , I = (h + f) / 4
  40260. , E = (p + g) / 4;
  40261. return v > A && v > y ? v < o ? (i = 0,
  40262. n = .707106781,
  40263. r = .707106781) : (i = Math.sqrt(v),
  40264. n = C / i,
  40265. r = I / i) : A > y ? A < o ? (i = .707106781,
  40266. n = 0,
  40267. r = .707106781) : (n = Math.sqrt(A),
  40268. i = C / n,
  40269. r = E / n) : y < o ? (i = .707106781,
  40270. n = .707106781,
  40271. r = 0) : (r = Math.sqrt(y),
  40272. i = I / r,
  40273. n = E / r),
  40274. this.set(i, n, r, t),
  40275. this
  40276. }
  40277. var b = Math.sqrt((g - p) * (g - p) + (h - f) * (h - f) + (u - c) * (u - c));
  40278. return Math.abs(b) < .001 && (b = 1),
  40279. this.x = (g - p) / b,
  40280. this.y = (h - f) / b,
  40281. this.z = (u - c) / b,
  40282. this.w = Math.acos((l + d + m - 1) / 2),
  40283. this
  40284. },
  40285. min: function(e) {
  40286. return this.x = Math.min(this.x, e.x),
  40287. this.y = Math.min(this.y, e.y),
  40288. this.z = Math.min(this.z, e.z),
  40289. this.w = Math.min(this.w, e.w),
  40290. this
  40291. },
  40292. max: function(e) {
  40293. return this.x = Math.max(this.x, e.x),
  40294. this.y = Math.max(this.y, e.y),
  40295. this.z = Math.max(this.z, e.z),
  40296. this.w = Math.max(this.w, e.w),
  40297. this
  40298. },
  40299. clamp: function(e, t) {
  40300. return this.x = Math.max(e.x, Math.min(t.x, this.x)),
  40301. this.y = Math.max(e.y, Math.min(t.y, this.y)),
  40302. this.z = Math.max(e.z, Math.min(t.z, this.z)),
  40303. this.w = Math.max(e.w, Math.min(t.w, this.w)),
  40304. this
  40305. },
  40306. clampScalar: function() {
  40307. var e, t;
  40308. return function(i, r) {
  40309. return void 0 === e && (e = new n.Vector4,
  40310. t = new n.Vector4),
  40311. e.set(i, i, i, i),
  40312. t.set(r, r, r, r),
  40313. this.clamp(e, t)
  40314. }
  40315. }(),
  40316. floor: function() {
  40317. return this.x = Math.floor(this.x),
  40318. this.y = Math.floor(this.y),
  40319. this.z = Math.floor(this.z),
  40320. this.w = Math.floor(this.w),
  40321. this
  40322. },
  40323. ceil: function() {
  40324. return this.x = Math.ceil(this.x),
  40325. this.y = Math.ceil(this.y),
  40326. this.z = Math.ceil(this.z),
  40327. this.w = Math.ceil(this.w),
  40328. this
  40329. },
  40330. round: function() {
  40331. return this.x = Math.round(this.x),
  40332. this.y = Math.round(this.y),
  40333. this.z = Math.round(this.z),
  40334. this.w = Math.round(this.w),
  40335. this
  40336. },
  40337. roundToZero: function() {
  40338. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x),
  40339. this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y),
  40340. this.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z),
  40341. this.w = this.w < 0 ? Math.ceil(this.w) : Math.floor(this.w),
  40342. this
  40343. },
  40344. negate: function() {
  40345. return this.x = -this.x,
  40346. this.y = -this.y,
  40347. this.z = -this.z,
  40348. this.w = -this.w,
  40349. this
  40350. },
  40351. dot: function(e) {
  40352. return this.x * e.x + this.y * e.y + this.z * e.z + this.w * e.w
  40353. },
  40354. lengthSq: function() {
  40355. return this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w
  40356. },
  40357. length: function() {
  40358. return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w)
  40359. },
  40360. lengthManhattan: function() {
  40361. return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z) + Math.abs(this.w)
  40362. },
  40363. normalize: function() {
  40364. return this.divideScalar(this.length())
  40365. },
  40366. setLength: function(e) {
  40367. return this.multiplyScalar(e / this.length())
  40368. },
  40369. lerp: function(e, t) {
  40370. return this.x += (e.x - this.x) * t,
  40371. this.y += (e.y - this.y) * t,
  40372. this.z += (e.z - this.z) * t,
  40373. this.w += (e.w - this.w) * t,
  40374. this
  40375. },
  40376. lerpVectors: function(e, t, i) {
  40377. return this.subVectors(t, e).multiplyScalar(i).add(e),
  40378. this
  40379. },
  40380. equals: function(e) {
  40381. return e.x === this.x && e.y === this.y && e.z === this.z && e.w === this.w
  40382. },
  40383. fromArray: function(e, t) {
  40384. return void 0 === t && (t = 0),
  40385. this.x = e[t],
  40386. this.y = e[t + 1],
  40387. this.z = e[t + 2],
  40388. this.w = e[t + 3],
  40389. this
  40390. },
  40391. toArray: function(e, t) {
  40392. return void 0 === e && (e = []),
  40393. void 0 === t && (t = 0),
  40394. e[t] = this.x,
  40395. e[t + 1] = this.y,
  40396. e[t + 2] = this.z,
  40397. e[t + 3] = this.w,
  40398. e
  40399. },
  40400. fromAttribute: function(e, t, i) {
  40401. return void 0 === i && (i = 0),
  40402. t = t * e.itemSize + i,
  40403. this.x = e.array[t],
  40404. this.y = e.array[t + 1],
  40405. this.z = e.array[t + 2],
  40406. this.w = e.array[t + 3],
  40407. this
  40408. }
  40409. },
  40410. n.Euler = function(e, t, i, r) {
  40411. this._x = e || 0,
  40412. this._y = t || 0,
  40413. this._z = i || 0,
  40414. this._order = r || n.Euler.DefaultOrder
  40415. }
  40416. ,
  40417. n.Euler.RotationOrders = ["XYZ", "YZX", "ZXY", "XZY", "YXZ", "ZYX"],
  40418. n.Euler.DefaultOrder = "XYZ",
  40419. n.Euler.prototype = {
  40420. constructor: n.Euler,
  40421. get x() {
  40422. return this._x
  40423. },
  40424. set x(e) {
  40425. this._x = e,
  40426. this.onChangeCallback()
  40427. },
  40428. get y() {
  40429. return this._y
  40430. },
  40431. set y(e) {
  40432. this._y = e,
  40433. this.onChangeCallback()
  40434. },
  40435. get z() {
  40436. return this._z
  40437. },
  40438. set z(e) {
  40439. this._z = e,
  40440. this.onChangeCallback()
  40441. },
  40442. get order() {
  40443. return this._order
  40444. },
  40445. set order(e) {
  40446. this._order = e,
  40447. this.onChangeCallback()
  40448. },
  40449. set: function(e, t, i, n) {
  40450. return this._x = e,
  40451. this._y = t,
  40452. this._z = i,
  40453. this._order = n || this._order,
  40454. this.onChangeCallback(),
  40455. this
  40456. },
  40457. clone: function() {
  40458. return new this.constructor(this._x,this._y,this._z,this._order)
  40459. },
  40460. copy: function(e) {
  40461. return this._x = e._x,
  40462. this._y = e._y,
  40463. this._z = e._z,
  40464. this._order = e._order,
  40465. this.onChangeCallback(),
  40466. this
  40467. },
  40468. setFromRotationMatrix: function(e, t, i) {
  40469. var r = n.Math.clamp
  40470. , o = e.elements
  40471. , a = o[0]
  40472. , s = o[4]
  40473. , l = o[8]
  40474. , c = o[1]
  40475. , h = o[5]
  40476. , u = o[9]
  40477. , d = o[2]
  40478. , p = o[6]
  40479. , f = o[10];
  40480. return t = t || this._order,
  40481. "XYZ" === t ? (this._y = Math.asin(r(l, -1, 1)),
  40482. Math.abs(l) < .99999 ? (this._x = Math.atan2(-u, f),
  40483. this._z = Math.atan2(-s, a)) : (this._x = Math.atan2(p, h),
  40484. this._z = 0)) : "YXZ" === t ? (this._x = Math.asin(-r(u, -1, 1)),
  40485. Math.abs(u) < .99999 ? (this._y = Math.atan2(l, f),
  40486. this._z = Math.atan2(c, h)) : (this._y = Math.atan2(-d, a),
  40487. this._z = 0)) : "ZXY" === t ? (this._x = Math.asin(r(p, -1, 1)),
  40488. Math.abs(p) < .99999 ? (this._y = Math.atan2(-d, f),
  40489. this._z = Math.atan2(-s, h)) : (this._y = 0,
  40490. this._z = Math.atan2(c, a))) : "ZYX" === t ? (this._y = Math.asin(-r(d, -1, 1)),
  40491. Math.abs(d) < .99999 ? (this._x = Math.atan2(p, f),
  40492. this._z = Math.atan2(c, a)) : (this._x = 0,
  40493. this._z = Math.atan2(-s, h))) : "YZX" === t ? (this._z = Math.asin(r(c, -1, 1)),
  40494. Math.abs(c) < .99999 ? (this._x = Math.atan2(-u, h),
  40495. this._y = Math.atan2(-d, a)) : (this._x = 0,
  40496. this._y = Math.atan2(l, f))) : "XZY" === t ? (this._z = Math.asin(-r(s, -1, 1)),
  40497. Math.abs(s) < .99999 ? (this._x = Math.atan2(p, h),
  40498. this._y = Math.atan2(l, a)) : (this._x = Math.atan2(-u, f),
  40499. this._y = 0)) : console.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: " + t),
  40500. this._order = t,
  40501. i !== !1 && this.onChangeCallback(),
  40502. this
  40503. },
  40504. setFromQuaternion: function() {
  40505. var e;
  40506. return function(t, i, r) {
  40507. return void 0 === e && (e = new n.Matrix4),
  40508. e.makeRotationFromQuaternion(t),
  40509. this.setFromRotationMatrix(e, i, r),
  40510. this
  40511. }
  40512. }(),
  40513. setFromVector3: function(e, t) {
  40514. return this.set(e.x, e.y, e.z, t || this._order)
  40515. },
  40516. reorder: function() {
  40517. var e = new n.Quaternion;
  40518. return function(t) {
  40519. e.setFromEuler(this),
  40520. this.setFromQuaternion(e, t)
  40521. }
  40522. }(),
  40523. equals: function(e) {
  40524. return e._x === this._x && e._y === this._y && e._z === this._z && e._order === this._order
  40525. },
  40526. fromArray: function(e) {
  40527. return this._x = e[0],
  40528. this._y = e[1],
  40529. this._z = e[2],
  40530. void 0 !== e[3] && (this._order = e[3]),
  40531. this.onChangeCallback(),
  40532. this
  40533. },
  40534. toArray: function(e, t) {
  40535. return void 0 === e && (e = []),
  40536. void 0 === t && (t = 0),
  40537. e[t] = this._x,
  40538. e[t + 1] = this._y,
  40539. e[t + 2] = this._z,
  40540. e[t + 3] = this._order,
  40541. e
  40542. },
  40543. toVector3: function(e) {
  40544. return e ? e.set(this._x, this._y, this._z) : new n.Vector3(this._x,this._y,this._z)
  40545. },
  40546. onChange: function(e) {
  40547. return this.onChangeCallback = e,
  40548. this
  40549. },
  40550. onChangeCallback: function() {}
  40551. },
  40552. n.Line3 = function(e, t) {
  40553. this.start = void 0 !== e ? e : new n.Vector3,
  40554. this.end = void 0 !== t ? t : new n.Vector3
  40555. }
  40556. ,
  40557. n.Line3.prototype = {
  40558. constructor: n.Line3,
  40559. set: function(e, t) {
  40560. return this.start.copy(e),
  40561. this.end.copy(t),
  40562. this
  40563. },
  40564. clone: function() {
  40565. return (new this.constructor).copy(this)
  40566. },
  40567. copy: function(e) {
  40568. return this.start.copy(e.start),
  40569. this.end.copy(e.end),
  40570. this
  40571. },
  40572. center: function(e) {
  40573. var t = e || new n.Vector3;
  40574. return t.addVectors(this.start, this.end).multiplyScalar(.5)
  40575. },
  40576. delta: function(e) {
  40577. var t = e || new n.Vector3;
  40578. return t.subVectors(this.end, this.start)
  40579. },
  40580. distanceSq: function() {
  40581. return this.start.distanceToSquared(this.end)
  40582. },
  40583. distance: function() {
  40584. return this.start.distanceTo(this.end)
  40585. },
  40586. at: function(e, t) {
  40587. var i = t || new n.Vector3;
  40588. return this.delta(i).multiplyScalar(e).add(this.start)
  40589. },
  40590. closestPointToPointParameter: function() {
  40591. var e = new n.Vector3
  40592. , t = new n.Vector3;
  40593. return function(i, r) {
  40594. e.subVectors(i, this.start),
  40595. t.subVectors(this.end, this.start);
  40596. var o = t.dot(t)
  40597. , a = t.dot(e)
  40598. , s = a / o;
  40599. return r && (s = n.Math.clamp(s, 0, 1)),
  40600. s
  40601. }
  40602. }(),
  40603. closestPointToPoint: function(e, t, i) {
  40604. var r = this.closestPointToPointParameter(e, t)
  40605. , o = i || new n.Vector3;
  40606. return this.delta(o).multiplyScalar(r).add(this.start)
  40607. },
  40608. applyMatrix4: function(e) {
  40609. return this.start.applyMatrix4(e),
  40610. this.end.applyMatrix4(e),
  40611. this
  40612. },
  40613. equals: function(e) {
  40614. return e.start.equals(this.start) && e.end.equals(this.end)
  40615. }
  40616. },
  40617. n.Box2 = function(e, t) {
  40618. this.min = void 0 !== e ? e : new n.Vector2(+(1 / 0),+(1 / 0)),
  40619. this.max = void 0 !== t ? t : new n.Vector2(-(1 / 0),-(1 / 0))
  40620. }
  40621. ,
  40622. n.Box2.prototype = {
  40623. constructor: n.Box2,
  40624. set: function(e, t) {
  40625. return this.min.copy(e),
  40626. this.max.copy(t),
  40627. this
  40628. },
  40629. setFromPoints: function(e) {
  40630. this.makeEmpty();
  40631. for (var t = 0, i = e.length; t < i; t++)
  40632. this.expandByPoint(e[t]);
  40633. return this
  40634. },
  40635. setFromCenterAndSize: function() {
  40636. var e = new n.Vector2;
  40637. return function(t, i) {
  40638. var n = e.copy(i).multiplyScalar(.5);
  40639. return this.min.copy(t).sub(n),
  40640. this.max.copy(t).add(n),
  40641. this
  40642. }
  40643. }(),
  40644. clone: function() {
  40645. return (new this.constructor).copy(this)
  40646. },
  40647. copy: function(e) {
  40648. return this.min.copy(e.min),
  40649. this.max.copy(e.max),
  40650. this
  40651. },
  40652. makeEmpty: function() {
  40653. return this.min.x = this.min.y = +(1 / 0),
  40654. this.max.x = this.max.y = -(1 / 0),
  40655. this
  40656. },
  40657. isEmpty: function() {
  40658. return this.max.x < this.min.x || this.max.y < this.min.y
  40659. },
  40660. center: function(e) {
  40661. var t = e || new n.Vector2;
  40662. return t.addVectors(this.min, this.max).multiplyScalar(.5)
  40663. },
  40664. size: function(e) {
  40665. var t = e || new n.Vector2;
  40666. return t.subVectors(this.max, this.min)
  40667. },
  40668. expandByPoint: function(e) {
  40669. return this.min.min(e),
  40670. this.max.max(e),
  40671. this
  40672. },
  40673. expandByVector: function(e) {
  40674. return this.min.sub(e),
  40675. this.max.add(e),
  40676. this
  40677. },
  40678. expandByScalar: function(e) {
  40679. return this.min.addScalar(-e),
  40680. this.max.addScalar(e),
  40681. this
  40682. },
  40683. containsPoint: function(e) {
  40684. return !(e.x < this.min.x || e.x > this.max.x || e.y < this.min.y || e.y > this.max.y)
  40685. },
  40686. containsBox: function(e) {
  40687. 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
  40688. },
  40689. getParameter: function(e, t) {
  40690. var i = t || new n.Vector2;
  40691. 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))
  40692. },
  40693. intersectsBox: function(e) {
  40694. 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)
  40695. },
  40696. clampPoint: function(e, t) {
  40697. var i = t || new n.Vector2;
  40698. return i.copy(e).clamp(this.min, this.max)
  40699. },
  40700. distanceToPoint: function() {
  40701. var e = new n.Vector2;
  40702. return function(t) {
  40703. var i = e.copy(t).clamp(this.min, this.max);
  40704. return i.sub(t).length()
  40705. }
  40706. }(),
  40707. intersect: function(e) {
  40708. return this.min.max(e.min),
  40709. this.max.min(e.max),
  40710. this
  40711. },
  40712. union: function(e) {
  40713. return this.min.min(e.min),
  40714. this.max.max(e.max),
  40715. this
  40716. },
  40717. translate: function(e) {
  40718. return this.min.add(e),
  40719. this.max.add(e),
  40720. this
  40721. },
  40722. equals: function(e) {
  40723. return e.min.equals(this.min) && e.max.equals(this.max)
  40724. }
  40725. },
  40726. n.Box3 = function(e, t) {
  40727. this.min = void 0 !== e ? e : new n.Vector3(+(1 / 0),+(1 / 0),+(1 / 0)),
  40728. this.max = void 0 !== t ? t : new n.Vector3(-(1 / 0),-(1 / 0),-(1 / 0))
  40729. }
  40730. ,
  40731. n.Box3.prototype = {
  40732. constructor: n.Box3,
  40733. set: function(e, t) {
  40734. return this.min.copy(e),
  40735. this.max.copy(t),
  40736. this
  40737. },
  40738. setFromArray: function(e) {
  40739. this.makeEmpty();
  40740. 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) {
  40741. var c = e[s]
  40742. , h = e[s + 1]
  40743. , u = e[s + 2];
  40744. c < t && (t = c),
  40745. h < i && (i = h),
  40746. u < n && (n = u),
  40747. c > r && (r = c),
  40748. h > o && (o = h),
  40749. u > a && (a = u)
  40750. }
  40751. this.min.set(t, i, n),
  40752. this.max.set(r, o, a)
  40753. },
  40754. setFromPoints: function(e) {
  40755. this.makeEmpty();
  40756. for (var t = 0, i = e.length; t < i; t++)
  40757. this.expandByPoint(e[t]);
  40758. return this
  40759. },
  40760. setFromCenterAndSize: function() {
  40761. var e = new n.Vector3;
  40762. return function(t, i) {
  40763. var n = e.copy(i).multiplyScalar(.5);
  40764. return this.min.copy(t).sub(n),
  40765. this.max.copy(t).add(n),
  40766. this
  40767. }
  40768. }(),
  40769. setFromObject: function() {
  40770. var e;
  40771. return function(t) {
  40772. void 0 === e && (e = new n.Box3);
  40773. var i = this;
  40774. return this.makeEmpty(),
  40775. t.updateMatrixWorld(!0),
  40776. t.traverse(function(t) {
  40777. var n = t.geometry;
  40778. void 0 !== n && (null === n.boundingBox && n.computeBoundingBox(),
  40779. n.boundingBox.isEmpty() === !1 && (e.copy(n.boundingBox),
  40780. e.applyMatrix4(t.matrixWorld),
  40781. i.union(e)))
  40782. }),
  40783. this
  40784. }
  40785. }(),
  40786. clone: function() {
  40787. return (new this.constructor).copy(this)
  40788. },
  40789. copy: function(e) {
  40790. return this.min.copy(e.min),
  40791. this.max.copy(e.max),
  40792. this
  40793. },
  40794. makeEmpty: function() {
  40795. return this.min.x = this.min.y = this.min.z = +(1 / 0),
  40796. this.max.x = this.max.y = this.max.z = -(1 / 0),
  40797. this
  40798. },
  40799. isEmpty: function() {
  40800. return this.max.x < this.min.x || this.max.y < this.min.y || this.max.z < this.min.z
  40801. },
  40802. center: function(e) {
  40803. var t = e || new n.Vector3;
  40804. return t.addVectors(this.min, this.max).multiplyScalar(.5)
  40805. },
  40806. size: function(e) {
  40807. var t = e || new n.Vector3;
  40808. return t.subVectors(this.max, this.min)
  40809. },
  40810. expandByPoint: function(e) {
  40811. return this.min.min(e),
  40812. this.max.max(e),
  40813. this
  40814. },
  40815. expandByVector: function(e) {
  40816. return this.min.sub(e),
  40817. this.max.add(e),
  40818. this
  40819. },
  40820. expandByScalar: function(e) {
  40821. return this.min.addScalar(-e),
  40822. this.max.addScalar(e),
  40823. this
  40824. },
  40825. containsPoint: function(e) {
  40826. 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)
  40827. },
  40828. containsBox: function(e) {
  40829. 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
  40830. },
  40831. getParameter: function(e, t) {
  40832. var i = t || new n.Vector3;
  40833. 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))
  40834. },
  40835. intersectsBox: function(e) {
  40836. 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)
  40837. },
  40838. intersectsSphere: function() {
  40839. var e;
  40840. return function(t) {
  40841. return void 0 === e && (e = new n.Vector3),
  40842. this.clampPoint(t.center, e),
  40843. e.distanceToSquared(t.center) <= t.radius * t.radius
  40844. }
  40845. }(),
  40846. intersectsPlane: function(e) {
  40847. var t, i;
  40848. return e.normal.x > 0 ? (t = e.normal.x * this.min.x,
  40849. i = e.normal.x * this.max.x) : (t = e.normal.x * this.max.x,
  40850. i = e.normal.x * this.min.x),
  40851. e.normal.y > 0 ? (t += e.normal.y * this.min.y,
  40852. i += e.normal.y * this.max.y) : (t += e.normal.y * this.max.y,
  40853. i += e.normal.y * this.min.y),
  40854. e.normal.z > 0 ? (t += e.normal.z * this.min.z,
  40855. i += e.normal.z * this.max.z) : (t += e.normal.z * this.max.z,
  40856. i += e.normal.z * this.min.z),
  40857. t <= e.constant && i >= e.constant
  40858. },
  40859. clampPoint: function(e, t) {
  40860. var i = t || new n.Vector3;
  40861. return i.copy(e).clamp(this.min, this.max)
  40862. },
  40863. distanceToPoint: function() {
  40864. var e = new n.Vector3;
  40865. return function(t) {
  40866. var i = e.copy(t).clamp(this.min, this.max);
  40867. return i.sub(t).length()
  40868. }
  40869. }(),
  40870. getBoundingSphere: function() {
  40871. var e = new n.Vector3;
  40872. return function(t) {
  40873. var i = t || new n.Sphere;
  40874. return i.center = this.center(),
  40875. i.radius = .5 * this.size(e).length(),
  40876. i
  40877. }
  40878. }(),
  40879. intersect: function(e) {
  40880. return this.min.max(e.min),
  40881. this.max.min(e.max),
  40882. this
  40883. },
  40884. union: function(e) {
  40885. return this.min.min(e.min),
  40886. this.max.max(e.max),
  40887. this
  40888. },
  40889. applyMatrix4: function() {
  40890. 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];
  40891. return function(t) {
  40892. return e[0].set(this.min.x, this.min.y, this.min.z).applyMatrix4(t),
  40893. e[1].set(this.min.x, this.min.y, this.max.z).applyMatrix4(t),
  40894. e[2].set(this.min.x, this.max.y, this.min.z).applyMatrix4(t),
  40895. e[3].set(this.min.x, this.max.y, this.max.z).applyMatrix4(t),
  40896. e[4].set(this.max.x, this.min.y, this.min.z).applyMatrix4(t),
  40897. e[5].set(this.max.x, this.min.y, this.max.z).applyMatrix4(t),
  40898. e[6].set(this.max.x, this.max.y, this.min.z).applyMatrix4(t),
  40899. e[7].set(this.max.x, this.max.y, this.max.z).applyMatrix4(t),
  40900. this.makeEmpty(),
  40901. this.setFromPoints(e),
  40902. this
  40903. }
  40904. }(),
  40905. translate: function(e) {
  40906. return this.min.add(e),
  40907. this.max.add(e),
  40908. this
  40909. },
  40910. equals: function(e) {
  40911. return e.min.equals(this.min) && e.max.equals(this.max)
  40912. }
  40913. },
  40914. n.Matrix3 = function() {
  40915. this.elements = new Float32Array([1, 0, 0, 0, 1, 0, 0, 0, 1]),
  40916. arguments.length > 0 && console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")
  40917. }
  40918. ,
  40919. n.Matrix3.prototype = {
  40920. constructor: n.Matrix3,
  40921. set: function(e, t, i, n, r, o, a, s, l) {
  40922. var c = this.elements;
  40923. return c[0] = e,
  40924. c[1] = n,
  40925. c[2] = a,
  40926. c[3] = t,
  40927. c[4] = r,
  40928. c[5] = s,
  40929. c[6] = i,
  40930. c[7] = o,
  40931. c[8] = l,
  40932. this
  40933. },
  40934. identity: function() {
  40935. return this.set(1, 0, 0, 0, 1, 0, 0, 0, 1),
  40936. this
  40937. },
  40938. clone: function() {
  40939. return (new this.constructor).fromArray(this.elements)
  40940. },
  40941. copy: function(e) {
  40942. var t = e.elements;
  40943. return this.set(t[0], t[3], t[6], t[1], t[4], t[7], t[2], t[5], t[8]),
  40944. this
  40945. },
  40946. setFromMatrix4: function(e) {
  40947. var t = e.elements;
  40948. return this.set(t[0], t[4], t[8], t[1], t[5], t[9], t[2], t[6], t[10]),
  40949. this
  40950. },
  40951. applyToVector3Array: function() {
  40952. var e;
  40953. return function(t, i, r) {
  40954. void 0 === e && (e = new n.Vector3),
  40955. void 0 === i && (i = 0),
  40956. void 0 === r && (r = t.length);
  40957. for (var o = 0, a = i; o < r; o += 3,
  40958. a += 3)
  40959. e.fromArray(t, a),
  40960. e.applyMatrix3(this),
  40961. e.toArray(t, a);
  40962. return t
  40963. }
  40964. }(),
  40965. applyToBuffer: function() {
  40966. var e;
  40967. return function(t, i, r) {
  40968. void 0 === e && (e = new n.Vector3),
  40969. void 0 === i && (i = 0),
  40970. void 0 === r && (r = t.length / t.itemSize);
  40971. for (var o = 0, a = i; o < r; o++,
  40972. a++)
  40973. e.x = t.getX(a),
  40974. e.y = t.getY(a),
  40975. e.z = t.getZ(a),
  40976. e.applyMatrix3(this),
  40977. t.setXYZ(e.x, e.y, e.z);
  40978. return t
  40979. }
  40980. }(),
  40981. multiplyScalar: function(e) {
  40982. var t = this.elements;
  40983. return t[0] *= e,
  40984. t[3] *= e,
  40985. t[6] *= e,
  40986. t[1] *= e,
  40987. t[4] *= e,
  40988. t[7] *= e,
  40989. t[2] *= e,
  40990. t[5] *= e,
  40991. t[8] *= e,
  40992. this
  40993. },
  40994. determinant: function() {
  40995. var e = this.elements
  40996. , t = e[0]
  40997. , i = e[1]
  40998. , n = e[2]
  40999. , r = e[3]
  41000. , o = e[4]
  41001. , a = e[5]
  41002. , s = e[6]
  41003. , l = e[7]
  41004. , c = e[8];
  41005. return t * o * c - t * a * l - i * r * c + i * a * s + n * r * l - n * o * s
  41006. },
  41007. getInverse: function(e, t) {
  41008. e instanceof n.Matrix4 && console.warn("THREE.Matrix3.getInverse no longer takes a Matrix4 argument.");
  41009. var i = e.elements
  41010. , r = this.elements
  41011. , o = i[0]
  41012. , a = i[1]
  41013. , s = i[2]
  41014. , l = i[3]
  41015. , c = i[4]
  41016. , h = i[5]
  41017. , u = i[6]
  41018. , d = i[7]
  41019. , p = i[8]
  41020. , f = p * c - h * d
  41021. , g = h * u - p * l
  41022. , m = d * l - c * u
  41023. , v = o * f + a * g + s * m;
  41024. if (0 === v) {
  41025. var A = "THREE.Matrix3.getInverse(): can't invert matrix, determinant is 0";
  41026. if (t)
  41027. throw new Error(A);
  41028. return console.warn(A),
  41029. this.identity()
  41030. }
  41031. return r[0] = f,
  41032. r[1] = s * d - p * a,
  41033. r[2] = h * a - s * c,
  41034. r[3] = g,
  41035. r[4] = p * o - s * u,
  41036. r[5] = s * l - h * o,
  41037. r[6] = m,
  41038. r[7] = a * u - d * o,
  41039. r[8] = c * o - a * l,
  41040. this.multiplyScalar(1 / v)
  41041. },
  41042. transpose: function() {
  41043. var e, t = this.elements;
  41044. return e = t[1],
  41045. t[1] = t[3],
  41046. t[3] = e,
  41047. e = t[2],
  41048. t[2] = t[6],
  41049. t[6] = e,
  41050. e = t[5],
  41051. t[5] = t[7],
  41052. t[7] = e,
  41053. this
  41054. },
  41055. flattenToArrayOffset: function(e, t) {
  41056. var i = this.elements;
  41057. return e[t] = i[0],
  41058. e[t + 1] = i[1],
  41059. e[t + 2] = i[2],
  41060. e[t + 3] = i[3],
  41061. e[t + 4] = i[4],
  41062. e[t + 5] = i[5],
  41063. e[t + 6] = i[6],
  41064. e[t + 7] = i[7],
  41065. e[t + 8] = i[8],
  41066. e
  41067. },
  41068. getNormalMatrix: function(e) {
  41069. return this.setFromMatrix4(e).getInverse(this).transpose()
  41070. },
  41071. transposeIntoArray: function(e) {
  41072. var t = this.elements;
  41073. return e[0] = t[0],
  41074. e[1] = t[3],
  41075. e[2] = t[6],
  41076. e[3] = t[1],
  41077. e[4] = t[4],
  41078. e[5] = t[7],
  41079. e[6] = t[2],
  41080. e[7] = t[5],
  41081. e[8] = t[8],
  41082. this
  41083. },
  41084. fromArray: function(e) {
  41085. return this.elements.set(e),
  41086. this
  41087. },
  41088. toArray: function() {
  41089. var e = this.elements;
  41090. return [e[0], e[1], e[2], e[3], e[4], e[5], e[6], e[7], e[8]]
  41091. }
  41092. },
  41093. n.Matrix4 = function() {
  41094. this.elements = new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]),
  41095. arguments.length > 0 && console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")
  41096. }
  41097. ,
  41098. n.Matrix4.prototype = {
  41099. constructor: n.Matrix4,
  41100. set: function(e, t, i, n, r, o, a, s, l, c, h, u, d, p, f, g) {
  41101. var m = this.elements;
  41102. return m[0] = e,
  41103. m[4] = t,
  41104. m[8] = i,
  41105. m[12] = n,
  41106. m[1] = r,
  41107. m[5] = o,
  41108. m[9] = a,
  41109. m[13] = s,
  41110. m[2] = l,
  41111. m[6] = c,
  41112. m[10] = h,
  41113. m[14] = u,
  41114. m[3] = d,
  41115. m[7] = p,
  41116. m[11] = f,
  41117. m[15] = g,
  41118. this
  41119. },
  41120. identity: function() {
  41121. return this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
  41122. this
  41123. },
  41124. clone: function() {
  41125. return (new n.Matrix4).fromArray(this.elements)
  41126. },
  41127. copy: function(e) {
  41128. return this.elements.set(e.elements),
  41129. this
  41130. },
  41131. copyPosition: function(e) {
  41132. var t = this.elements
  41133. , i = e.elements;
  41134. return t[12] = i[12],
  41135. t[13] = i[13],
  41136. t[14] = i[14],
  41137. this
  41138. },
  41139. extractBasis: function(e, t, i) {
  41140. return e.setFromMatrixColumn(this, 0),
  41141. t.setFromMatrixColumn(this, 1),
  41142. i.setFromMatrixColumn(this, 2),
  41143. this
  41144. },
  41145. makeBasis: function(e, t, i) {
  41146. 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),
  41147. this
  41148. },
  41149. extractRotation: function() {
  41150. var e;
  41151. return function(t) {
  41152. void 0 === e && (e = new n.Vector3);
  41153. var i = this.elements
  41154. , r = t.elements
  41155. , o = 1 / e.setFromMatrixColumn(t, 0).length()
  41156. , a = 1 / e.setFromMatrixColumn(t, 1).length()
  41157. , s = 1 / e.setFromMatrixColumn(t, 2).length();
  41158. return i[0] = r[0] * o,
  41159. i[1] = r[1] * o,
  41160. i[2] = r[2] * o,
  41161. i[4] = r[4] * a,
  41162. i[5] = r[5] * a,
  41163. i[6] = r[6] * a,
  41164. i[8] = r[8] * s,
  41165. i[9] = r[9] * s,
  41166. i[10] = r[10] * s,
  41167. this
  41168. }
  41169. }(),
  41170. makeRotationFromEuler: function(e) {
  41171. e instanceof n.Euler == !1 && console.error("THREE.Matrix: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");
  41172. var t = this.elements
  41173. , i = e.x
  41174. , r = e.y
  41175. , o = e.z
  41176. , a = Math.cos(i)
  41177. , s = Math.sin(i)
  41178. , l = Math.cos(r)
  41179. , c = Math.sin(r)
  41180. , h = Math.cos(o)
  41181. , u = Math.sin(o);
  41182. if ("XYZ" === e.order) {
  41183. var d = a * h
  41184. , p = a * u
  41185. , f = s * h
  41186. , g = s * u;
  41187. t[0] = l * h,
  41188. t[4] = -l * u,
  41189. t[8] = c,
  41190. t[1] = p + f * c,
  41191. t[5] = d - g * c,
  41192. t[9] = -s * l,
  41193. t[2] = g - d * c,
  41194. t[6] = f + p * c,
  41195. t[10] = a * l
  41196. } else if ("YXZ" === e.order) {
  41197. var m = l * h
  41198. , v = l * u
  41199. , A = c * h
  41200. , y = c * u;
  41201. t[0] = m + y * s,
  41202. t[4] = A * s - v,
  41203. t[8] = a * c,
  41204. t[1] = a * u,
  41205. t[5] = a * h,
  41206. t[9] = -s,
  41207. t[2] = v * s - A,
  41208. t[6] = y + m * s,
  41209. t[10] = a * l
  41210. } else if ("ZXY" === e.order) {
  41211. var m = l * h
  41212. , v = l * u
  41213. , A = c * h
  41214. , y = c * u;
  41215. t[0] = m - y * s,
  41216. t[4] = -a * u,
  41217. t[8] = A + v * s,
  41218. t[1] = v + A * s,
  41219. t[5] = a * h,
  41220. t[9] = y - m * s,
  41221. t[2] = -a * c,
  41222. t[6] = s,
  41223. t[10] = a * l
  41224. } else if ("ZYX" === e.order) {
  41225. var d = a * h
  41226. , p = a * u
  41227. , f = s * h
  41228. , g = s * u;
  41229. t[0] = l * h,
  41230. t[4] = f * c - p,
  41231. t[8] = d * c + g,
  41232. t[1] = l * u,
  41233. t[5] = g * c + d,
  41234. t[9] = p * c - f,
  41235. t[2] = -c,
  41236. t[6] = s * l,
  41237. t[10] = a * l
  41238. } else if ("YZX" === e.order) {
  41239. var C = a * l
  41240. , I = a * c
  41241. , E = s * l
  41242. , b = s * c;
  41243. t[0] = l * h,
  41244. t[4] = b - C * u,
  41245. t[8] = E * u + I,
  41246. t[1] = u,
  41247. t[5] = a * h,
  41248. t[9] = -s * h,
  41249. t[2] = -c * h,
  41250. t[6] = I * u + E,
  41251. t[10] = C - b * u
  41252. } else if ("XZY" === e.order) {
  41253. var C = a * l
  41254. , I = a * c
  41255. , E = s * l
  41256. , b = s * c;
  41257. t[0] = l * h,
  41258. t[4] = -u,
  41259. t[8] = c * h,
  41260. t[1] = C * u + b,
  41261. t[5] = a * h,
  41262. t[9] = I * u - E,
  41263. t[2] = E * u - I,
  41264. t[6] = s * h,
  41265. t[10] = b * u + C
  41266. }
  41267. return t[3] = 0,
  41268. t[7] = 0,
  41269. t[11] = 0,
  41270. t[12] = 0,
  41271. t[13] = 0,
  41272. t[14] = 0,
  41273. t[15] = 1,
  41274. this
  41275. },
  41276. makeRotationFromQuaternion: function(e) {
  41277. var t = this.elements
  41278. , i = e.x
  41279. , n = e.y
  41280. , r = e.z
  41281. , o = e.w
  41282. , a = i + i
  41283. , s = n + n
  41284. , l = r + r
  41285. , c = i * a
  41286. , h = i * s
  41287. , u = i * l
  41288. , d = n * s
  41289. , p = n * l
  41290. , f = r * l
  41291. , g = o * a
  41292. , m = o * s
  41293. , v = o * l;
  41294. return t[0] = 1 - (d + f),
  41295. t[4] = h - v,
  41296. t[8] = u + m,
  41297. t[1] = h + v,
  41298. t[5] = 1 - (c + f),
  41299. t[9] = p - g,
  41300. t[2] = u - m,
  41301. t[6] = p + g,
  41302. t[10] = 1 - (c + d),
  41303. t[3] = 0,
  41304. t[7] = 0,
  41305. t[11] = 0,
  41306. t[12] = 0,
  41307. t[13] = 0,
  41308. t[14] = 0,
  41309. t[15] = 1,
  41310. this
  41311. },
  41312. lookAt: function() {
  41313. var e, t, i;
  41314. return function(r, o, a) {
  41315. void 0 === e && (e = new n.Vector3),
  41316. void 0 === t && (t = new n.Vector3),
  41317. void 0 === i && (i = new n.Vector3);
  41318. var s = this.elements;
  41319. return i.subVectors(r, o).normalize(),
  41320. 0 === i.lengthSq() && (i.z = 1),
  41321. e.crossVectors(a, i).normalize(),
  41322. 0 === e.lengthSq() && (i.x += 1e-4,
  41323. e.crossVectors(a, i).normalize()),
  41324. t.crossVectors(i, e),
  41325. s[0] = e.x,
  41326. s[4] = t.x,
  41327. s[8] = i.x,
  41328. s[1] = e.y,
  41329. s[5] = t.y,
  41330. s[9] = i.y,
  41331. s[2] = e.z,
  41332. s[6] = t.z,
  41333. s[10] = i.z,
  41334. this
  41335. }
  41336. }(),
  41337. multiply: function(e, t) {
  41338. return void 0 !== t ? (console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),
  41339. this.multiplyMatrices(e, t)) : this.multiplyMatrices(this, e)
  41340. },
  41341. multiplyMatrices: function(e, t) {
  41342. var i = e.elements
  41343. , n = t.elements
  41344. , r = this.elements
  41345. , o = i[0]
  41346. , a = i[4]
  41347. , s = i[8]
  41348. , l = i[12]
  41349. , c = i[1]
  41350. , h = i[5]
  41351. , u = i[9]
  41352. , d = i[13]
  41353. , p = i[2]
  41354. , f = i[6]
  41355. , g = i[10]
  41356. , m = i[14]
  41357. , v = i[3]
  41358. , A = i[7]
  41359. , y = i[11]
  41360. , C = i[15]
  41361. , I = n[0]
  41362. , E = n[4]
  41363. , b = n[8]
  41364. , w = n[12]
  41365. , _ = n[1]
  41366. , T = n[5]
  41367. , x = n[9]
  41368. , S = n[13]
  41369. , M = n[2]
  41370. , R = n[6]
  41371. , P = n[10]
  41372. , O = n[14]
  41373. , L = n[3]
  41374. , D = n[7]
  41375. , N = n[11]
  41376. , B = n[15];
  41377. return r[0] = o * I + a * _ + s * M + l * L,
  41378. r[4] = o * E + a * T + s * R + l * D,
  41379. r[8] = o * b + a * x + s * P + l * N,
  41380. r[12] = o * w + a * S + s * O + l * B,
  41381. r[1] = c * I + h * _ + u * M + d * L,
  41382. r[5] = c * E + h * T + u * R + d * D,
  41383. r[9] = c * b + h * x + u * P + d * N,
  41384. r[13] = c * w + h * S + u * O + d * B,
  41385. r[2] = p * I + f * _ + g * M + m * L,
  41386. r[6] = p * E + f * T + g * R + m * D,
  41387. r[10] = p * b + f * x + g * P + m * N,
  41388. r[14] = p * w + f * S + g * O + m * B,
  41389. r[3] = v * I + A * _ + y * M + C * L,
  41390. r[7] = v * E + A * T + y * R + C * D,
  41391. r[11] = v * b + A * x + y * P + C * N,
  41392. r[15] = v * w + A * S + y * O + C * B,
  41393. this
  41394. },
  41395. multiplyToArray: function(e, t, i) {
  41396. var n = this.elements;
  41397. return this.multiplyMatrices(e, t),
  41398. i[0] = n[0],
  41399. i[1] = n[1],
  41400. i[2] = n[2],
  41401. i[3] = n[3],
  41402. i[4] = n[4],
  41403. i[5] = n[5],
  41404. i[6] = n[6],
  41405. i[7] = n[7],
  41406. i[8] = n[8],
  41407. i[9] = n[9],
  41408. i[10] = n[10],
  41409. i[11] = n[11],
  41410. i[12] = n[12],
  41411. i[13] = n[13],
  41412. i[14] = n[14],
  41413. i[15] = n[15],
  41414. this
  41415. },
  41416. multiplyScalar: function(e) {
  41417. var t = this.elements;
  41418. return t[0] *= e,
  41419. t[4] *= e,
  41420. t[8] *= e,
  41421. t[12] *= e,
  41422. t[1] *= e,
  41423. t[5] *= e,
  41424. t[9] *= e,
  41425. t[13] *= e,
  41426. t[2] *= e,
  41427. t[6] *= e,
  41428. t[10] *= e,
  41429. t[14] *= e,
  41430. t[3] *= e,
  41431. t[7] *= e,
  41432. t[11] *= e,
  41433. t[15] *= e,
  41434. this
  41435. },
  41436. applyToVector3Array: function() {
  41437. var e;
  41438. return function(t, i, r) {
  41439. void 0 === e && (e = new n.Vector3),
  41440. void 0 === i && (i = 0),
  41441. void 0 === r && (r = t.length);
  41442. for (var o = 0, a = i; o < r; o += 3,
  41443. a += 3)
  41444. e.fromArray(t, a),
  41445. e.applyMatrix4(this),
  41446. e.toArray(t, a);
  41447. return t
  41448. }
  41449. }(),
  41450. applyToBuffer: function() {
  41451. var e;
  41452. return function(t, i, r) {
  41453. void 0 === e && (e = new n.Vector3),
  41454. void 0 === i && (i = 0),
  41455. void 0 === r && (r = t.length / t.itemSize);
  41456. for (var o = 0, a = i; o < r; o++,
  41457. a++)
  41458. e.x = t.getX(a),
  41459. e.y = t.getY(a),
  41460. e.z = t.getZ(a),
  41461. e.applyMatrix4(this),
  41462. t.setXYZ(e.x, e.y, e.z);
  41463. return t
  41464. }
  41465. }(),
  41466. determinant: function() {
  41467. var e = this.elements
  41468. , t = e[0]
  41469. , i = e[4]
  41470. , n = e[8]
  41471. , r = e[12]
  41472. , o = e[1]
  41473. , a = e[5]
  41474. , s = e[9]
  41475. , l = e[13]
  41476. , c = e[2]
  41477. , h = e[6]
  41478. , u = e[10]
  41479. , d = e[14]
  41480. , p = e[3]
  41481. , f = e[7]
  41482. , g = e[11]
  41483. , m = e[15];
  41484. 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)
  41485. },
  41486. transpose: function() {
  41487. var e, t = this.elements;
  41488. return e = t[1],
  41489. t[1] = t[4],
  41490. t[4] = e,
  41491. e = t[2],
  41492. t[2] = t[8],
  41493. t[8] = e,
  41494. e = t[6],
  41495. t[6] = t[9],
  41496. t[9] = e,
  41497. e = t[3],
  41498. t[3] = t[12],
  41499. t[12] = e,
  41500. e = t[7],
  41501. t[7] = t[13],
  41502. t[13] = e,
  41503. e = t[11],
  41504. t[11] = t[14],
  41505. t[14] = e,
  41506. this
  41507. },
  41508. flattenToArrayOffset: function(e, t) {
  41509. var i = this.elements;
  41510. return e[t] = i[0],
  41511. e[t + 1] = i[1],
  41512. e[t + 2] = i[2],
  41513. e[t + 3] = i[3],
  41514. e[t + 4] = i[4],
  41515. e[t + 5] = i[5],
  41516. e[t + 6] = i[6],
  41517. e[t + 7] = i[7],
  41518. e[t + 8] = i[8],
  41519. e[t + 9] = i[9],
  41520. e[t + 10] = i[10],
  41521. e[t + 11] = i[11],
  41522. e[t + 12] = i[12],
  41523. e[t + 13] = i[13],
  41524. e[t + 14] = i[14],
  41525. e[t + 15] = i[15],
  41526. e
  41527. },
  41528. getPosition: function() {
  41529. var e;
  41530. return function() {
  41531. return void 0 === e && (e = new n.Vector3),
  41532. console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),
  41533. e.setFromMatrixColumn(this, 3)
  41534. }
  41535. }(),
  41536. setPosition: function(e) {
  41537. var t = this.elements;
  41538. return t[12] = e.x,
  41539. t[13] = e.y,
  41540. t[14] = e.z,
  41541. this
  41542. },
  41543. getInverse: function(e, t) {
  41544. var i = this.elements
  41545. , n = e.elements
  41546. , r = n[0]
  41547. , o = n[1]
  41548. , a = n[2]
  41549. , s = n[3]
  41550. , l = n[4]
  41551. , c = n[5]
  41552. , h = n[6]
  41553. , u = n[7]
  41554. , d = n[8]
  41555. , p = n[9]
  41556. , f = n[10]
  41557. , g = n[11]
  41558. , m = n[12]
  41559. , v = n[13]
  41560. , A = n[14]
  41561. , y = n[15]
  41562. , C = p * A * u - v * f * u + v * h * g - c * A * g - p * h * y + c * f * y
  41563. , I = m * f * u - d * A * u - m * h * g + l * A * g + d * h * y - l * f * y
  41564. , E = d * v * u - m * p * u + m * c * g - l * v * g - d * c * y + l * p * y
  41565. , b = m * p * h - d * v * h - m * c * f + l * v * f + d * c * A - l * p * A
  41566. , w = r * C + o * I + a * E + s * b;
  41567. if (0 === w) {
  41568. var _ = "THREE.Matrix4.getInverse(): can't invert matrix, determinant is 0";
  41569. if (t)
  41570. throw new Error(_);
  41571. return console.warn(_),
  41572. this.identity()
  41573. }
  41574. return i[0] = C,
  41575. i[1] = v * f * s - p * A * s - v * a * g + o * A * g + p * a * y - o * f * y,
  41576. i[2] = c * A * s - v * h * s + v * a * u - o * A * u - c * a * y + o * h * y,
  41577. i[3] = p * h * s - c * f * s - p * a * u + o * f * u + c * a * g - o * h * g,
  41578. i[4] = I,
  41579. i[5] = d * A * s - m * f * s + m * a * g - r * A * g - d * a * y + r * f * y,
  41580. i[6] = m * h * s - l * A * s - m * a * u + r * A * u + l * a * y - r * h * y,
  41581. i[7] = l * f * s - d * h * s + d * a * u - r * f * u - l * a * g + r * h * g,
  41582. i[8] = E,
  41583. i[9] = m * p * s - d * v * s - m * o * g + r * v * g + d * o * y - r * p * y,
  41584. i[10] = l * v * s - m * c * s + m * o * u - r * v * u - l * o * y + r * c * y,
  41585. i[11] = d * c * s - l * p * s - d * o * u + r * p * u + l * o * g - r * c * g,
  41586. i[12] = b,
  41587. i[13] = d * v * a - m * p * a + m * o * f - r * v * f - d * o * A + r * p * A,
  41588. i[14] = m * c * a - l * v * a - m * o * h + r * v * h + l * o * A - r * c * A,
  41589. i[15] = l * p * a - d * c * a + d * o * h - r * p * h - l * o * f + r * c * f,
  41590. this.multiplyScalar(1 / w)
  41591. },
  41592. scale: function(e) {
  41593. var t = this.elements
  41594. , i = e.x
  41595. , n = e.y
  41596. , r = e.z;
  41597. return t[0] *= i,
  41598. t[4] *= n,
  41599. t[8] *= r,
  41600. t[1] *= i,
  41601. t[5] *= n,
  41602. t[9] *= r,
  41603. t[2] *= i,
  41604. t[6] *= n,
  41605. t[10] *= r,
  41606. t[3] *= i,
  41607. t[7] *= n,
  41608. t[11] *= r,
  41609. this
  41610. },
  41611. getMaxScaleOnAxis: function() {
  41612. var e = this.elements
  41613. , t = e[0] * e[0] + e[1] * e[1] + e[2] * e[2]
  41614. , i = e[4] * e[4] + e[5] * e[5] + e[6] * e[6]
  41615. , n = e[8] * e[8] + e[9] * e[9] + e[10] * e[10];
  41616. return Math.sqrt(Math.max(t, i, n))
  41617. },
  41618. makeTranslation: function(e, t, i) {
  41619. return this.set(1, 0, 0, e, 0, 1, 0, t, 0, 0, 1, i, 0, 0, 0, 1),
  41620. this
  41621. },
  41622. makeRotationX: function(e) {
  41623. var t = Math.cos(e)
  41624. , i = Math.sin(e);
  41625. return this.set(1, 0, 0, 0, 0, t, -i, 0, 0, i, t, 0, 0, 0, 0, 1),
  41626. this
  41627. },
  41628. makeRotationY: function(e) {
  41629. var t = Math.cos(e)
  41630. , i = Math.sin(e);
  41631. return this.set(t, 0, i, 0, 0, 1, 0, 0, -i, 0, t, 0, 0, 0, 0, 1),
  41632. this
  41633. },
  41634. makeRotationZ: function(e) {
  41635. var t = Math.cos(e)
  41636. , i = Math.sin(e);
  41637. return this.set(t, -i, 0, 0, i, t, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
  41638. this
  41639. },
  41640. makeRotationAxis: function(e, t) {
  41641. var i = Math.cos(t)
  41642. , n = Math.sin(t)
  41643. , r = 1 - i
  41644. , o = e.x
  41645. , a = e.y
  41646. , s = e.z
  41647. , l = r * o
  41648. , c = r * a;
  41649. 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),
  41650. this
  41651. },
  41652. makeScale: function(e, t, i) {
  41653. return this.set(e, 0, 0, 0, 0, t, 0, 0, 0, 0, i, 0, 0, 0, 0, 1),
  41654. this
  41655. },
  41656. compose: function(e, t, i) {
  41657. return this.makeRotationFromQuaternion(t),
  41658. this.scale(i),
  41659. this.setPosition(e),
  41660. this
  41661. },
  41662. decompose: function() {
  41663. var e, t;
  41664. return function(i, r, o) {
  41665. void 0 === e && (e = new n.Vector3),
  41666. void 0 === t && (t = new n.Matrix4);
  41667. var a = this.elements
  41668. , s = e.set(a[0], a[1], a[2]).length()
  41669. , l = e.set(a[4], a[5], a[6]).length()
  41670. , c = e.set(a[8], a[9], a[10]).length()
  41671. , h = this.determinant();
  41672. h < 0 && (s = -s),
  41673. i.x = a[12],
  41674. i.y = a[13],
  41675. i.z = a[14],
  41676. t.elements.set(this.elements);
  41677. var u = 1 / s
  41678. , d = 1 / l
  41679. , p = 1 / c;
  41680. return t.elements[0] *= u,
  41681. t.elements[1] *= u,
  41682. t.elements[2] *= u,
  41683. t.elements[4] *= d,
  41684. t.elements[5] *= d,
  41685. t.elements[6] *= d,
  41686. t.elements[8] *= p,
  41687. t.elements[9] *= p,
  41688. t.elements[10] *= p,
  41689. r.setFromRotationMatrix(t),
  41690. o.x = s,
  41691. o.y = l,
  41692. o.z = c,
  41693. this
  41694. }
  41695. }(),
  41696. makeFrustum: function(e, t, i, n, r, o) {
  41697. var a = this.elements
  41698. , s = 2 * r / (t - e)
  41699. , l = 2 * r / (n - i)
  41700. , c = (t + e) / (t - e)
  41701. , h = (n + i) / (n - i)
  41702. , u = -(o + r) / (o - r)
  41703. , d = -2 * o * r / (o - r);
  41704. return a[0] = s,
  41705. a[4] = 0,
  41706. a[8] = c,
  41707. a[12] = 0,
  41708. a[1] = 0,
  41709. a[5] = l,
  41710. a[9] = h,
  41711. a[13] = 0,
  41712. a[2] = 0,
  41713. a[6] = 0,
  41714. a[10] = u,
  41715. a[14] = d,
  41716. a[3] = 0,
  41717. a[7] = 0,
  41718. a[11] = -1,
  41719. a[15] = 0,
  41720. this
  41721. },
  41722. makePerspective: function(e, t, i, r) {
  41723. var o = i * Math.tan(n.Math.degToRad(.5 * e))
  41724. , a = -o
  41725. , s = a * t
  41726. , l = o * t;
  41727. return this.makeFrustum(s, l, a, o, i, r)
  41728. },
  41729. makeOrthographic: function(e, t, i, n, r, o) {
  41730. var a = this.elements
  41731. , s = 1 / (t - e)
  41732. , l = 1 / (i - n)
  41733. , c = 1 / (o - r)
  41734. , h = (t + e) * s
  41735. , u = (i + n) * l
  41736. , d = (o + r) * c;
  41737. return a[0] = 2 * s,
  41738. a[4] = 0,
  41739. a[8] = 0,
  41740. a[12] = -h,
  41741. a[1] = 0,
  41742. a[5] = 2 * l,
  41743. a[9] = 0,
  41744. a[13] = -u,
  41745. a[2] = 0,
  41746. a[6] = 0,
  41747. a[10] = -2 * c,
  41748. a[14] = -d,
  41749. a[3] = 0,
  41750. a[7] = 0,
  41751. a[11] = 0,
  41752. a[15] = 1,
  41753. this
  41754. },
  41755. equals: function(e) {
  41756. for (var t = this.elements, i = e.elements, n = 0; n < 16; n++)
  41757. if (t[n] !== i[n])
  41758. return !1;
  41759. return !0
  41760. },
  41761. fromArray: function(e) {
  41762. return this.elements.set(e),
  41763. this
  41764. },
  41765. toArray: function() {
  41766. var e = this.elements;
  41767. 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]]
  41768. }
  41769. },
  41770. n.Ray = function(e, t) {
  41771. this.origin = void 0 !== e ? e : new n.Vector3,
  41772. this.direction = void 0 !== t ? t : new n.Vector3
  41773. }
  41774. ,
  41775. n.Ray.prototype = {
  41776. constructor: n.Ray,
  41777. set: function(e, t) {
  41778. return this.origin.copy(e),
  41779. this.direction.copy(t),
  41780. this
  41781. },
  41782. clone: function() {
  41783. return (new this.constructor).copy(this)
  41784. },
  41785. copy: function(e) {
  41786. return this.origin.copy(e.origin),
  41787. this.direction.copy(e.direction),
  41788. this
  41789. },
  41790. at: function(e, t) {
  41791. var i = t || new n.Vector3;
  41792. return i.copy(this.direction).multiplyScalar(e).add(this.origin)
  41793. },
  41794. lookAt: function(e) {
  41795. this.direction.copy(e).sub(this.origin).normalize()
  41796. },
  41797. recast: function() {
  41798. var e = new n.Vector3;
  41799. return function(t) {
  41800. return this.origin.copy(this.at(t, e)),
  41801. this
  41802. }
  41803. }(),
  41804. closestPointToPoint: function(e, t) {
  41805. var i = t || new n.Vector3;
  41806. i.subVectors(e, this.origin);
  41807. var r = i.dot(this.direction);
  41808. return r < 0 ? i.copy(this.origin) : i.copy(this.direction).multiplyScalar(r).add(this.origin)
  41809. },
  41810. distanceToPoint: function(e) {
  41811. return Math.sqrt(this.distanceSqToPoint(e))
  41812. },
  41813. distanceSqToPoint: function() {
  41814. var e = new n.Vector3;
  41815. return function(t) {
  41816. var i = e.subVectors(t, this.origin).dot(this.direction);
  41817. return i < 0 ? this.origin.distanceToSquared(t) : (e.copy(this.direction).multiplyScalar(i).add(this.origin),
  41818. e.distanceToSquared(t))
  41819. }
  41820. }(),
  41821. distanceSqToSegment: function() {
  41822. var e = new n.Vector3
  41823. , t = new n.Vector3
  41824. , i = new n.Vector3;
  41825. return function(n, r, o, a) {
  41826. e.copy(n).add(r).multiplyScalar(.5),
  41827. t.copy(r).sub(n).normalize(),
  41828. i.copy(this.origin).sub(e);
  41829. 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);
  41830. if (m > 0)
  41831. if (s = d * f - p,
  41832. l = d * p - f,
  41833. h = u * m,
  41834. s >= 0)
  41835. if (l >= -h)
  41836. if (l <= h) {
  41837. var v = 1 / m;
  41838. s *= v,
  41839. l *= v,
  41840. c = s * (s + d * l + 2 * p) + l * (d * s + l + 2 * f) + g
  41841. } else
  41842. l = u,
  41843. s = Math.max(0, -(d * l + p)),
  41844. c = -s * s + l * (l + 2 * f) + g;
  41845. else
  41846. l = -u,
  41847. s = Math.max(0, -(d * l + p)),
  41848. c = -s * s + l * (l + 2 * f) + g;
  41849. else
  41850. l <= -h ? (s = Math.max(0, -(-d * u + p)),
  41851. l = s > 0 ? -u : Math.min(Math.max(-u, -f), u),
  41852. c = -s * s + l * (l + 2 * f) + g) : l <= h ? (s = 0,
  41853. l = Math.min(Math.max(-u, -f), u),
  41854. c = l * (l + 2 * f) + g) : (s = Math.max(0, -(d * u + p)),
  41855. l = s > 0 ? u : Math.min(Math.max(-u, -f), u),
  41856. c = -s * s + l * (l + 2 * f) + g);
  41857. else
  41858. l = d > 0 ? -u : u,
  41859. s = Math.max(0, -(d * l + p)),
  41860. c = -s * s + l * (l + 2 * f) + g;
  41861. return o && o.copy(this.direction).multiplyScalar(s).add(this.origin),
  41862. a && a.copy(t).multiplyScalar(l).add(e),
  41863. c
  41864. }
  41865. }(),
  41866. intersectSphere: function() {
  41867. var e = new n.Vector3;
  41868. return function(t, i) {
  41869. e.subVectors(t.center, this.origin);
  41870. var n = e.dot(this.direction)
  41871. , r = e.dot(e) - n * n
  41872. , o = t.radius * t.radius;
  41873. if (r > o)
  41874. return null;
  41875. var a = Math.sqrt(o - r)
  41876. , s = n - a
  41877. , l = n + a;
  41878. return s < 0 && l < 0 ? null : s < 0 ? this.at(l, i) : this.at(s, i)
  41879. }
  41880. }(),
  41881. intersectsSphere: function(e) {
  41882. return this.distanceToPoint(e.center) <= e.radius
  41883. },
  41884. distanceToPlane: function(e) {
  41885. var t = e.normal.dot(this.direction);
  41886. if (0 === t)
  41887. return 0 === e.distanceToPoint(this.origin) ? 0 : null;
  41888. var i = -(this.origin.dot(e.normal) + e.constant) / t;
  41889. return i >= 0 ? i : null
  41890. },
  41891. intersectPlane: function(e, t) {
  41892. var i = this.distanceToPlane(e);
  41893. return null === i ? null : this.at(i, t)
  41894. },
  41895. intersectsPlane: function(e) {
  41896. var t = e.distanceToPoint(this.origin);
  41897. if (0 === t)
  41898. return !0;
  41899. var i = e.normal.dot(this.direction);
  41900. return i * t < 0
  41901. },
  41902. intersectBox: function(e, t) {
  41903. 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;
  41904. return l >= 0 ? (i = (e.min.x - u.x) * l,
  41905. n = (e.max.x - u.x) * l) : (i = (e.max.x - u.x) * l,
  41906. n = (e.min.x - u.x) * l),
  41907. c >= 0 ? (r = (e.min.y - u.y) * c,
  41908. o = (e.max.y - u.y) * c) : (r = (e.max.y - u.y) * c,
  41909. o = (e.min.y - u.y) * c),
  41910. i > o || r > n ? null : ((r > i || i !== i) && (i = r),
  41911. (o < n || n !== n) && (n = o),
  41912. h >= 0 ? (a = (e.min.z - u.z) * h,
  41913. s = (e.max.z - u.z) * h) : (a = (e.max.z - u.z) * h,
  41914. s = (e.min.z - u.z) * h),
  41915. i > s || a > n ? null : ((a > i || i !== i) && (i = a),
  41916. (s < n || n !== n) && (n = s),
  41917. n < 0 ? null : this.at(i >= 0 ? i : n, t)))
  41918. },
  41919. intersectsBox: function() {
  41920. var e = new n.Vector3;
  41921. return function(t) {
  41922. return null !== this.intersectBox(t, e)
  41923. }
  41924. }(),
  41925. intersectTriangle: function() {
  41926. var e = new n.Vector3
  41927. , t = new n.Vector3
  41928. , i = new n.Vector3
  41929. , r = new n.Vector3;
  41930. return function(n, o, a, s, l) {
  41931. t.subVectors(o, n),
  41932. i.subVectors(a, n),
  41933. r.crossVectors(t, i);
  41934. var c, h = this.direction.dot(r);
  41935. if (h > 0) {
  41936. if (s)
  41937. return null;
  41938. c = 1
  41939. } else {
  41940. if (!(h < 0))
  41941. return null;
  41942. c = -1,
  41943. h = -h
  41944. }
  41945. e.subVectors(this.origin, n);
  41946. var u = c * this.direction.dot(i.crossVectors(e, i));
  41947. if (u < 0)
  41948. return null;
  41949. var d = c * this.direction.dot(t.cross(e));
  41950. if (d < 0)
  41951. return null;
  41952. if (u + d > h)
  41953. return null;
  41954. var p = -c * e.dot(r);
  41955. return p < 0 ? null : this.at(p / h, l)
  41956. }
  41957. }(),
  41958. applyMatrix4: function(e) {
  41959. return this.direction.add(this.origin).applyMatrix4(e),
  41960. this.origin.applyMatrix4(e),
  41961. this.direction.sub(this.origin),
  41962. this.direction.normalize(),
  41963. this
  41964. },
  41965. equals: function(e) {
  41966. return e.origin.equals(this.origin) && e.direction.equals(this.direction)
  41967. }
  41968. },
  41969. n.Sphere = function(e, t) {
  41970. this.center = void 0 !== e ? e : new n.Vector3,
  41971. this.radius = void 0 !== t ? t : 0
  41972. }
  41973. ,
  41974. n.Sphere.prototype = {
  41975. constructor: n.Sphere,
  41976. set: function(e, t) {
  41977. return this.center.copy(e),
  41978. this.radius = t,
  41979. this
  41980. },
  41981. setFromPoints: function() {
  41982. var e = new n.Box3;
  41983. return function(t, i) {
  41984. var n = this.center;
  41985. void 0 !== i ? n.copy(i) : e.setFromPoints(t).center(n);
  41986. for (var r = 0, o = 0, a = t.length; o < a; o++)
  41987. r = Math.max(r, n.distanceToSquared(t[o]));
  41988. return this.radius = Math.sqrt(r),
  41989. this
  41990. }
  41991. }(),
  41992. clone: function() {
  41993. return (new this.constructor).copy(this)
  41994. },
  41995. copy: function(e) {
  41996. return this.center.copy(e.center),
  41997. this.radius = e.radius,
  41998. this
  41999. },
  42000. empty: function() {
  42001. return this.radius <= 0
  42002. },
  42003. containsPoint: function(e) {
  42004. return e.distanceToSquared(this.center) <= this.radius * this.radius
  42005. },
  42006. distanceToPoint: function(e) {
  42007. return e.distanceTo(this.center) - this.radius
  42008. },
  42009. intersectsSphere: function(e) {
  42010. var t = this.radius + e.radius;
  42011. return e.center.distanceToSquared(this.center) <= t * t
  42012. },
  42013. intersectsBox: function(e) {
  42014. return e.intersectsSphere(this)
  42015. },
  42016. intersectsPlane: function(e) {
  42017. return Math.abs(this.center.dot(e.normal) - e.constant) <= this.radius
  42018. },
  42019. clampPoint: function(e, t) {
  42020. var i = this.center.distanceToSquared(e)
  42021. , r = t || new n.Vector3;
  42022. return r.copy(e),
  42023. i > this.radius * this.radius && (r.sub(this.center).normalize(),
  42024. r.multiplyScalar(this.radius).add(this.center)),
  42025. r
  42026. },
  42027. getBoundingBox: function(e) {
  42028. var t = e || new n.Box3;
  42029. return t.set(this.center, this.center),
  42030. t.expandByScalar(this.radius),
  42031. t
  42032. },
  42033. applyMatrix4: function(e) {
  42034. return this.center.applyMatrix4(e),
  42035. this.radius = this.radius * e.getMaxScaleOnAxis(),
  42036. this
  42037. },
  42038. translate: function(e) {
  42039. return this.center.add(e),
  42040. this
  42041. },
  42042. equals: function(e) {
  42043. return e.center.equals(this.center) && e.radius === this.radius
  42044. }
  42045. },
  42046. n.Frustum = function(e, t, i, r, o, a) {
  42047. 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]
  42048. }
  42049. ,
  42050. n.Frustum.prototype = {
  42051. constructor: n.Frustum,
  42052. set: function(e, t, i, n, r, o) {
  42053. var a = this.planes;
  42054. return a[0].copy(e),
  42055. a[1].copy(t),
  42056. a[2].copy(i),
  42057. a[3].copy(n),
  42058. a[4].copy(r),
  42059. a[5].copy(o),
  42060. this
  42061. },
  42062. clone: function() {
  42063. return (new this.constructor).copy(this)
  42064. },
  42065. copy: function(e) {
  42066. for (var t = this.planes, i = 0; i < 6; i++)
  42067. t[i].copy(e.planes[i]);
  42068. return this
  42069. },
  42070. setFromMatrix: function(e) {
  42071. var t = this.planes
  42072. , i = e.elements
  42073. , n = i[0]
  42074. , r = i[1]
  42075. , o = i[2]
  42076. , a = i[3]
  42077. , s = i[4]
  42078. , l = i[5]
  42079. , c = i[6]
  42080. , h = i[7]
  42081. , u = i[8]
  42082. , d = i[9]
  42083. , p = i[10]
  42084. , f = i[11]
  42085. , g = i[12]
  42086. , m = i[13]
  42087. , v = i[14]
  42088. , A = i[15];
  42089. return t[0].setComponents(a - n, h - s, f - u, A - g).normalize(),
  42090. t[1].setComponents(a + n, h + s, f + u, A + g).normalize(),
  42091. t[2].setComponents(a + r, h + l, f + d, A + m).normalize(),
  42092. t[3].setComponents(a - r, h - l, f - d, A - m).normalize(),
  42093. t[4].setComponents(a - o, h - c, f - p, A - v).normalize(),
  42094. t[5].setComponents(a + o, h + c, f + p, A + v).normalize(),
  42095. this
  42096. },
  42097. intersectsObject: function() {
  42098. var e = new n.Sphere;
  42099. return function(t) {
  42100. var i = t.geometry;
  42101. return null === i.boundingSphere && i.computeBoundingSphere(),
  42102. e.copy(i.boundingSphere),
  42103. e.applyMatrix4(t.matrixWorld),
  42104. this.intersectsSphere(e)
  42105. }
  42106. }(),
  42107. intersectsSphere: function(e) {
  42108. for (var t = this.planes, i = e.center, n = -e.radius, r = 0; r < 6; r++) {
  42109. var o = t[r].distanceToPoint(i);
  42110. if (o < n)
  42111. return !1
  42112. }
  42113. return !0
  42114. },
  42115. intersectsBox: function() {
  42116. var e = new n.Vector3
  42117. , t = new n.Vector3;
  42118. return function(i) {
  42119. for (var n = this.planes, r = 0; r < 6; r++) {
  42120. var o = n[r];
  42121. e.x = o.normal.x > 0 ? i.min.x : i.max.x,
  42122. t.x = o.normal.x > 0 ? i.max.x : i.min.x,
  42123. e.y = o.normal.y > 0 ? i.min.y : i.max.y,
  42124. t.y = o.normal.y > 0 ? i.max.y : i.min.y,
  42125. e.z = o.normal.z > 0 ? i.min.z : i.max.z,
  42126. t.z = o.normal.z > 0 ? i.max.z : i.min.z;
  42127. var a = o.distanceToPoint(e)
  42128. , s = o.distanceToPoint(t);
  42129. if (a < 0 && s < 0)
  42130. return !1
  42131. }
  42132. return !0
  42133. }
  42134. }(),
  42135. containsPoint: function(e) {
  42136. for (var t = this.planes, i = 0; i < 6; i++)
  42137. if (t[i].distanceToPoint(e) < 0)
  42138. return !1;
  42139. return !0
  42140. }
  42141. },
  42142. n.Plane = function(e, t) {
  42143. this.normal = void 0 !== e ? e : new n.Vector3(1,0,0),
  42144. this.constant = void 0 !== t ? t : 0
  42145. }
  42146. ,
  42147. n.Plane.prototype = {
  42148. constructor: n.Plane,
  42149. set: function(e, t) {
  42150. return this.normal.copy(e),
  42151. this.constant = t,
  42152. this
  42153. },
  42154. setComponents: function(e, t, i, n) {
  42155. return this.normal.set(e, t, i),
  42156. this.constant = n,
  42157. this
  42158. },
  42159. setFromNormalAndCoplanarPoint: function(e, t) {
  42160. return this.normal.copy(e),
  42161. this.constant = -t.dot(this.normal),
  42162. this
  42163. },
  42164. setFromCoplanarPoints: function() {
  42165. var e = new n.Vector3
  42166. , t = new n.Vector3;
  42167. return function(i, n, r) {
  42168. var o = e.subVectors(r, n).cross(t.subVectors(i, n)).normalize();
  42169. return this.setFromNormalAndCoplanarPoint(o, i),
  42170. this
  42171. }
  42172. }(),
  42173. clone: function() {
  42174. return (new this.constructor).copy(this)
  42175. },
  42176. copy: function(e) {
  42177. return this.normal.copy(e.normal),
  42178. this.constant = e.constant,
  42179. this
  42180. },
  42181. normalize: function() {
  42182. var e = 1 / this.normal.length();
  42183. return this.normal.multiplyScalar(e),
  42184. this.constant *= e,
  42185. this
  42186. },
  42187. negate: function() {
  42188. return this.constant *= -1,
  42189. this.normal.negate(),
  42190. this
  42191. },
  42192. distanceToPoint: function(e) {
  42193. return this.normal.dot(e) + this.constant
  42194. },
  42195. distanceToSphere: function(e) {
  42196. return this.distanceToPoint(e.center) - e.radius
  42197. },
  42198. projectPoint: function(e, t) {
  42199. return this.orthoPoint(e, t).sub(e).negate()
  42200. },
  42201. orthoPoint: function(e, t) {
  42202. var i = this.distanceToPoint(e)
  42203. , r = t || new n.Vector3;
  42204. return r.copy(this.normal).multiplyScalar(i)
  42205. },
  42206. intersectLine: function() {
  42207. var e = new n.Vector3;
  42208. return function(t, i) {
  42209. var r = i || new n.Vector3
  42210. , o = t.delta(e)
  42211. , a = this.normal.dot(o);
  42212. if (0 !== a) {
  42213. var s = -(t.start.dot(this.normal) + this.constant) / a;
  42214. if (!(s < 0 || s > 1))
  42215. return r.copy(o).multiplyScalar(s).add(t.start)
  42216. } else if (0 === this.distanceToPoint(t.start))
  42217. return r.copy(t.start)
  42218. }
  42219. }(),
  42220. intersectsLine: function(e) {
  42221. var t = this.distanceToPoint(e.start)
  42222. , i = this.distanceToPoint(e.end);
  42223. return t < 0 && i > 0 || i < 0 && t > 0
  42224. },
  42225. intersectsBox: function(e) {
  42226. return e.intersectsPlane(this)
  42227. },
  42228. intersectsSphere: function(e) {
  42229. return e.intersectsPlane(this)
  42230. },
  42231. coplanarPoint: function(e) {
  42232. var t = e || new n.Vector3;
  42233. return t.copy(this.normal).multiplyScalar(-this.constant)
  42234. },
  42235. applyMatrix4: function() {
  42236. var e = new n.Vector3
  42237. , t = new n.Vector3
  42238. , i = new n.Matrix3;
  42239. return function(n, r) {
  42240. var o = r || i.getNormalMatrix(n)
  42241. , a = e.copy(this.normal).applyMatrix3(o)
  42242. , s = this.coplanarPoint(t);
  42243. return s.applyMatrix4(n),
  42244. this.setFromNormalAndCoplanarPoint(a, s),
  42245. this
  42246. }
  42247. }(),
  42248. translate: function(e) {
  42249. return this.constant = this.constant - e.dot(this.normal),
  42250. this
  42251. },
  42252. equals: function(e) {
  42253. return e.normal.equals(this.normal) && e.constant === this.constant
  42254. }
  42255. },
  42256. n.Spherical = function(e, t, i) {
  42257. return this.radius = void 0 !== e ? e : 1,
  42258. this.phi = void 0 !== t ? t : 0,
  42259. this.theta = void 0 !== i ? i : 0,
  42260. this
  42261. }
  42262. ,
  42263. n.Spherical.prototype = {
  42264. constructor: n.Spherical,
  42265. set: function(e, t, i) {
  42266. this.radius = e,
  42267. this.phi = t,
  42268. this.theta = i
  42269. },
  42270. clone: function() {
  42271. return (new this.constructor).copy(this)
  42272. },
  42273. copy: function(e) {
  42274. return this.radius.copy(e.radius),
  42275. this.phi.copy(e.phi),
  42276. this.theta.copy(e.theta),
  42277. this
  42278. },
  42279. makeSafe: function() {
  42280. var e = 1e-6;
  42281. this.phi = Math.max(e, Math.min(Math.PI - e, this.phi))
  42282. },
  42283. setFromVector3: function(e) {
  42284. return this.radius = e.length(),
  42285. 0 === this.radius ? (this.theta = 0,
  42286. this.phi = 0) : (this.theta = Math.atan2(e.x, e.z),
  42287. this.phi = Math.acos(n.Math.clamp(e.y / this.radius, -1, 1))),
  42288. this
  42289. }
  42290. },
  42291. n.Math = {
  42292. generateUUID: function() {
  42293. var e, t = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""), i = new Array(36), n = 0;
  42294. return function() {
  42295. for (var r = 0; r < 36; r++)
  42296. 8 === r || 13 === r || 18 === r || 23 === r ? i[r] = "-" : 14 === r ? i[r] = "4" : (n <= 2 && (n = 33554432 + 16777216 * Math.random() | 0),
  42297. e = 15 & n,
  42298. n >>= 4,
  42299. i[r] = t[19 === r ? 3 & e | 8 : e]);
  42300. return i.join("")
  42301. }
  42302. }(),
  42303. clamp: function(e, t, i) {
  42304. return Math.max(t, Math.min(i, e))
  42305. },
  42306. euclideanModulo: function(e, t) {
  42307. return (e % t + t) % t
  42308. },
  42309. mapLinear: function(e, t, i, n, r) {
  42310. return n + (e - t) * (r - n) / (i - t)
  42311. },
  42312. smoothstep: function(e, t, i) {
  42313. return e <= t ? 0 : e >= i ? 1 : (e = (e - t) / (i - t),
  42314. e * e * (3 - 2 * e))
  42315. },
  42316. smootherstep: function(e, t, i) {
  42317. return e <= t ? 0 : e >= i ? 1 : (e = (e - t) / (i - t),
  42318. e * e * e * (e * (6 * e - 15) + 10))
  42319. },
  42320. random16: function() {
  42321. return console.warn("THREE.Math.random16() has been deprecated. Use Math.random() instead."),
  42322. Math.random()
  42323. },
  42324. randInt: function(e, t) {
  42325. return e + Math.floor(Math.random() * (t - e + 1))
  42326. },
  42327. randFloat: function(e, t) {
  42328. return e + Math.random() * (t - e)
  42329. },
  42330. randFloatSpread: function(e) {
  42331. return e * (.5 - Math.random())
  42332. },
  42333. degToRad: function() {
  42334. var e = Math.PI / 180;
  42335. return function(t) {
  42336. return t * e
  42337. }
  42338. }(),
  42339. radToDeg: function() {
  42340. var e = 180 / Math.PI;
  42341. return function(t) {
  42342. return t * e
  42343. }
  42344. }(),
  42345. isPowerOfTwo: function(e) {
  42346. return 0 === (e & e - 1) && 0 !== e
  42347. },
  42348. nearestPowerOfTwo: function(e) {
  42349. return Math.pow(2, Math.round(Math.log(e) / Math.LN2))
  42350. },
  42351. nextPowerOfTwo: function(e) {
  42352. return e--,
  42353. e |= e >> 1,
  42354. e |= e >> 2,
  42355. e |= e >> 4,
  42356. e |= e >> 8,
  42357. e |= e >> 16,
  42358. e++,
  42359. e
  42360. }
  42361. },
  42362. n.Spline = function(e) {
  42363. function t(e, t, i, n, r, o, a) {
  42364. var s = .5 * (i - e)
  42365. , l = .5 * (n - t);
  42366. return (2 * (t - i) + s + l) * a + (-3 * (t - i) - 2 * s - l) * o + s * r + t
  42367. }
  42368. this.points = e;
  42369. var i, r, o, a, s, l, c, h, u, d = [], p = {
  42370. x: 0,
  42371. y: 0,
  42372. z: 0
  42373. };
  42374. this.initFromArray = function(e) {
  42375. this.points = [];
  42376. for (var t = 0; t < e.length; t++)
  42377. this.points[t] = {
  42378. x: e[t][0],
  42379. y: e[t][1],
  42380. z: e[t][2]
  42381. }
  42382. }
  42383. ,
  42384. this.getPoint = function(e) {
  42385. return i = (this.points.length - 1) * e,
  42386. r = Math.floor(i),
  42387. o = i - r,
  42388. d[0] = 0 === r ? r : r - 1,
  42389. d[1] = r,
  42390. d[2] = r > this.points.length - 2 ? this.points.length - 1 : r + 1,
  42391. d[3] = r > this.points.length - 3 ? this.points.length - 1 : r + 2,
  42392. l = this.points[d[0]],
  42393. c = this.points[d[1]],
  42394. h = this.points[d[2]],
  42395. u = this.points[d[3]],
  42396. a = o * o,
  42397. s = o * a,
  42398. p.x = t(l.x, c.x, h.x, u.x, o, a, s),
  42399. p.y = t(l.y, c.y, h.y, u.y, o, a, s),
  42400. p.z = t(l.z, c.z, h.z, u.z, o, a, s),
  42401. p
  42402. }
  42403. ,
  42404. this.getControlPointsArray = function() {
  42405. var e, t, i = this.points.length, n = [];
  42406. for (e = 0; e < i; e++)
  42407. t = this.points[e],
  42408. n[e] = [t.x, t.y, t.z];
  42409. return n
  42410. }
  42411. ,
  42412. this.getLength = function(e) {
  42413. var t, i, r, o, a = 0, s = 0, l = 0, c = new n.Vector3, h = new n.Vector3, u = [], d = 0;
  42414. for (u[0] = 0,
  42415. e || (e = 100),
  42416. r = this.points.length * e,
  42417. c.copy(this.points[0]),
  42418. t = 1; t < r; t++)
  42419. i = t / r,
  42420. o = this.getPoint(i),
  42421. h.copy(o),
  42422. d += h.distanceTo(c),
  42423. c.copy(o),
  42424. a = (this.points.length - 1) * i,
  42425. s = Math.floor(a),
  42426. s !== l && (u[s] = d,
  42427. l = s);
  42428. return u[u.length] = d,
  42429. {
  42430. chunks: u,
  42431. total: d
  42432. }
  42433. }
  42434. ,
  42435. this.reparametrizeByArcLength = function(e) {
  42436. var t, i, r, o, a, s, l, c, h = [], u = new n.Vector3, d = this.getLength();
  42437. for (h.push(u.copy(this.points[0]).clone()),
  42438. t = 1; t < this.points.length; t++) {
  42439. for (s = d.chunks[t] - d.chunks[t - 1],
  42440. l = Math.ceil(e * s / d.total),
  42441. o = (t - 1) / (this.points.length - 1),
  42442. a = t / (this.points.length - 1),
  42443. i = 1; i < l - 1; i++)
  42444. r = o + i * (1 / l) * (a - o),
  42445. c = this.getPoint(r),
  42446. h.push(u.copy(c).clone());
  42447. h.push(u.copy(this.points[t]).clone())
  42448. }
  42449. this.points = h
  42450. }
  42451. }
  42452. ,
  42453. n.Triangle = function(e, t, i) {
  42454. this.a = void 0 !== e ? e : new n.Vector3,
  42455. this.b = void 0 !== t ? t : new n.Vector3,
  42456. this.c = void 0 !== i ? i : new n.Vector3
  42457. }
  42458. ,
  42459. n.Triangle.normal = function() {
  42460. var e = new n.Vector3;
  42461. return function(t, i, r, o) {
  42462. var a = o || new n.Vector3;
  42463. a.subVectors(r, i),
  42464. e.subVectors(t, i),
  42465. a.cross(e);
  42466. var s = a.lengthSq();
  42467. return s > 0 ? a.multiplyScalar(1 / Math.sqrt(s)) : a.set(0, 0, 0)
  42468. }
  42469. }(),
  42470. n.Triangle.barycoordFromPoint = function() {
  42471. var e = new n.Vector3
  42472. , t = new n.Vector3
  42473. , i = new n.Vector3;
  42474. return function(r, o, a, s, l) {
  42475. e.subVectors(s, o),
  42476. t.subVectors(a, o),
  42477. i.subVectors(r, o);
  42478. var c = e.dot(e)
  42479. , h = e.dot(t)
  42480. , u = e.dot(i)
  42481. , d = t.dot(t)
  42482. , p = t.dot(i)
  42483. , f = c * d - h * h
  42484. , g = l || new n.Vector3;
  42485. if (0 === f)
  42486. return g.set(-2, -1, -1);
  42487. var m = 1 / f
  42488. , v = (d * u - h * p) * m
  42489. , A = (c * p - h * u) * m;
  42490. return g.set(1 - v - A, A, v)
  42491. }
  42492. }(),
  42493. n.Triangle.containsPoint = function() {
  42494. var e = new n.Vector3;
  42495. return function(t, i, r, o) {
  42496. var a = n.Triangle.barycoordFromPoint(t, i, r, o, e);
  42497. return a.x >= 0 && a.y >= 0 && a.x + a.y <= 1
  42498. }
  42499. }(),
  42500. n.Triangle.prototype = {
  42501. constructor: n.Triangle,
  42502. set: function(e, t, i) {
  42503. return this.a.copy(e),
  42504. this.b.copy(t),
  42505. this.c.copy(i),
  42506. this
  42507. },
  42508. setFromPointsAndIndices: function(e, t, i, n) {
  42509. return this.a.copy(e[t]),
  42510. this.b.copy(e[i]),
  42511. this.c.copy(e[n]),
  42512. this
  42513. },
  42514. clone: function() {
  42515. return (new this.constructor).copy(this)
  42516. },
  42517. copy: function(e) {
  42518. return this.a.copy(e.a),
  42519. this.b.copy(e.b),
  42520. this.c.copy(e.c),
  42521. this
  42522. },
  42523. area: function() {
  42524. var e = new n.Vector3
  42525. , t = new n.Vector3;
  42526. return function() {
  42527. return e.subVectors(this.c, this.b),
  42528. t.subVectors(this.a, this.b),
  42529. .5 * e.cross(t).length()
  42530. }
  42531. }(),
  42532. midpoint: function(e) {
  42533. var t = e || new n.Vector3;
  42534. return t.addVectors(this.a, this.b).add(this.c).multiplyScalar(1 / 3)
  42535. },
  42536. normal: function(e) {
  42537. return n.Triangle.normal(this.a, this.b, this.c, e)
  42538. },
  42539. plane: function(e) {
  42540. var t = e || new n.Plane;
  42541. return t.setFromCoplanarPoints(this.a, this.b, this.c)
  42542. },
  42543. barycoordFromPoint: function(e, t) {
  42544. return n.Triangle.barycoordFromPoint(e, this.a, this.b, this.c, t)
  42545. },
  42546. containsPoint: function(e) {
  42547. return n.Triangle.containsPoint(e, this.a, this.b, this.c)
  42548. },
  42549. equals: function(e) {
  42550. return e.a.equals(this.a) && e.b.equals(this.b) && e.c.equals(this.c)
  42551. }
  42552. },
  42553. n.Interpolant = function(e, t, i, n) {
  42554. this.parameterPositions = e,
  42555. this._cachedIndex = 0,
  42556. this.resultBuffer = void 0 !== n ? n : new t.constructor(i),
  42557. this.sampleValues = t,
  42558. this.valueSize = i
  42559. }
  42560. ,
  42561. n.Interpolant.prototype = {
  42562. constructor: n.Interpolant,
  42563. evaluate: function(e) {
  42564. var t = this.parameterPositions
  42565. , i = this._cachedIndex
  42566. , n = t[i]
  42567. , r = t[i - 1];
  42568. e: {
  42569. t: {
  42570. var o;
  42571. i: {
  42572. n: if (!(e < n)) {
  42573. for (var a = i + 2; ; ) {
  42574. if (void 0 === n) {
  42575. if (e < r)
  42576. break n;
  42577. return i = t.length,
  42578. this._cachedIndex = i,
  42579. this.afterEnd_(i - 1, e, r)
  42580. }
  42581. if (i === a)
  42582. break;
  42583. if (r = n,
  42584. n = t[++i],
  42585. e < n)
  42586. break t
  42587. }
  42588. o = t.length;
  42589. break i
  42590. }
  42591. {
  42592. if (e >= r)
  42593. break e;
  42594. var s = t[1];
  42595. e < s && (i = 2,
  42596. r = s);
  42597. for (var a = i - 2; ; ) {
  42598. if (void 0 === r)
  42599. return this._cachedIndex = 0,
  42600. this.beforeStart_(0, e, n);
  42601. if (i === a)
  42602. break;
  42603. if (n = r,
  42604. r = t[--i - 1],
  42605. e >= r)
  42606. break t
  42607. }
  42608. o = i,
  42609. i = 0
  42610. }
  42611. }
  42612. for (; i < o; ) {
  42613. var l = i + o >>> 1;
  42614. e < t[l] ? o = l : i = l + 1
  42615. }
  42616. if (n = t[i],
  42617. r = t[i - 1],
  42618. void 0 === r)
  42619. return this._cachedIndex = 0,
  42620. this.beforeStart_(0, e, n);
  42621. if (void 0 === n)
  42622. return i = t.length,
  42623. this._cachedIndex = i,
  42624. this.afterEnd_(i - 1, r, e)
  42625. }
  42626. this._cachedIndex = i,
  42627. this.intervalChanged_(i, r, n)
  42628. }
  42629. return this.interpolate_(i, r, e, n)
  42630. },
  42631. settings: null,
  42632. DefaultSettings_: {},
  42633. getSettings_: function() {
  42634. return this.settings || this.DefaultSettings_
  42635. },
  42636. copySampleValue_: function(e) {
  42637. for (var t = this.resultBuffer, i = this.sampleValues, n = this.valueSize, r = e * n, o = 0; o !== n; ++o)
  42638. t[o] = i[r + o];
  42639. return t
  42640. },
  42641. interpolate_: function(e, t, i, n) {
  42642. throw new Error("call to abstract method")
  42643. },
  42644. intervalChanged_: function(e, t, i) {}
  42645. },
  42646. Object.assign(n.Interpolant.prototype, {
  42647. beforeStart_: n.Interpolant.prototype.copySampleValue_,
  42648. afterEnd_: n.Interpolant.prototype.copySampleValue_
  42649. }),
  42650. n.CubicInterpolant = function(e, t, i, r) {
  42651. n.Interpolant.call(this, e, t, i, r),
  42652. this._weightPrev = -0,
  42653. this._offsetPrev = -0,
  42654. this._weightNext = -0,
  42655. this._offsetNext = -0
  42656. }
  42657. ,
  42658. n.CubicInterpolant.prototype = Object.assign(Object.create(n.Interpolant.prototype), {
  42659. constructor: n.CubicInterpolant,
  42660. DefaultSettings_: {
  42661. endingStart: n.ZeroCurvatureEnding,
  42662. endingEnd: n.ZeroCurvatureEnding
  42663. },
  42664. intervalChanged_: function(e, t, i) {
  42665. var r = this.parameterPositions
  42666. , o = e - 2
  42667. , a = e + 1
  42668. , s = r[o]
  42669. , l = r[a];
  42670. if (void 0 === s)
  42671. switch (this.getSettings_().endingStart) {
  42672. case n.ZeroSlopeEnding:
  42673. o = e,
  42674. s = 2 * t - i;
  42675. break;
  42676. case n.WrapAroundEnding:
  42677. o = r.length - 2,
  42678. s = t + r[o] - r[o + 1];
  42679. break;
  42680. default:
  42681. o = e,
  42682. s = i
  42683. }
  42684. if (void 0 === l)
  42685. switch (this.getSettings_().endingEnd) {
  42686. case n.ZeroSlopeEnding:
  42687. a = e,
  42688. l = 2 * i - t;
  42689. break;
  42690. case n.WrapAroundEnding:
  42691. a = 1,
  42692. l = i + r[1] - r[0];
  42693. break;
  42694. default:
  42695. a = e - 1,
  42696. l = t
  42697. }
  42698. var c = .5 * (i - t)
  42699. , h = this.valueSize;
  42700. this._weightPrev = c / (t - s),
  42701. this._weightNext = c / (l - i),
  42702. this._offsetPrev = o * h,
  42703. this._offsetNext = a * h
  42704. },
  42705. interpolate_: function(e, t, i, n) {
  42706. 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)
  42707. r[C] = m * o[c + C] + v * o[l + C] + A * o[s + C] + y * o[h + C];
  42708. return r
  42709. }
  42710. }),
  42711. n.DiscreteInterpolant = function(e, t, i, r) {
  42712. n.Interpolant.call(this, e, t, i, r)
  42713. }
  42714. ,
  42715. n.DiscreteInterpolant.prototype = Object.assign(Object.create(n.Interpolant.prototype), {
  42716. constructor: n.DiscreteInterpolant,
  42717. interpolate_: function(e, t, i, n) {
  42718. return this.copySampleValue_(e - 1)
  42719. }
  42720. }),
  42721. n.LinearInterpolant = function(e, t, i, r) {
  42722. n.Interpolant.call(this, e, t, i, r)
  42723. }
  42724. ,
  42725. n.LinearInterpolant.prototype = Object.assign(Object.create(n.Interpolant.prototype), {
  42726. constructor: n.LinearInterpolant,
  42727. interpolate_: function(e, t, i, n) {
  42728. 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)
  42729. r[u] = o[l + u] * h + o[s + u] * c;
  42730. return r
  42731. }
  42732. }),
  42733. n.QuaternionLinearInterpolant = function(e, t, i, r) {
  42734. n.Interpolant.call(this, e, t, i, r)
  42735. }
  42736. ,
  42737. n.QuaternionLinearInterpolant.prototype = Object.assign(Object.create(n.Interpolant.prototype), {
  42738. constructor: n.QuaternionLinearInterpolant,
  42739. interpolate_: function(e, t, i, r) {
  42740. 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)
  42741. n.Quaternion.slerpFlat(o, 0, a, l - s, a, l, c);
  42742. return o
  42743. }
  42744. }),
  42745. n.Clock = function(e) {
  42746. this.autoStart = void 0 === e || e,
  42747. this.startTime = 0,
  42748. this.oldTime = 0,
  42749. this.elapsedTime = 0,
  42750. this.running = !1
  42751. }
  42752. ,
  42753. n.Clock.prototype = {
  42754. constructor: n.Clock,
  42755. start: function() {
  42756. this.startTime = performance.now(),
  42757. this.oldTime = this.startTime,
  42758. this.running = !0
  42759. },
  42760. stop: function() {
  42761. this.getElapsedTime(),
  42762. this.running = !1
  42763. },
  42764. getElapsedTime: function() {
  42765. return this.getDelta(),
  42766. this.elapsedTime
  42767. },
  42768. getDelta: function() {
  42769. var e = 0;
  42770. if (this.autoStart && !this.running && this.start(),
  42771. this.running) {
  42772. var t = performance.now();
  42773. e = .001 * (t - this.oldTime),
  42774. this.oldTime = t,
  42775. this.elapsedTime += e
  42776. }
  42777. return e
  42778. }
  42779. },
  42780. n.EventDispatcher = function() {}
  42781. ,
  42782. n.EventDispatcher.prototype = {
  42783. constructor: n.EventDispatcher,
  42784. apply: function(e) {
  42785. e.addEventListener = n.EventDispatcher.prototype.addEventListener,
  42786. e.hasEventListener = n.EventDispatcher.prototype.hasEventListener,
  42787. e.removeEventListener = n.EventDispatcher.prototype.removeEventListener,
  42788. e.dispatchEvent = n.EventDispatcher.prototype.dispatchEvent
  42789. },
  42790. addEventListener: function(e, t) {
  42791. void 0 === this._listeners && (this._listeners = {});
  42792. var i = this._listeners;
  42793. void 0 === i[e] && (i[e] = []),
  42794. i[e].indexOf(t) === -1 && i[e].push(t)
  42795. },
  42796. hasEventListener: function(e, t) {
  42797. if (void 0 === this._listeners)
  42798. return !1;
  42799. var i = this._listeners;
  42800. return void 0 !== i[e] && i[e].indexOf(t) !== -1
  42801. },
  42802. removeEventListener: function(e, t) {
  42803. if (void 0 !== this._listeners) {
  42804. var i = this._listeners
  42805. , n = i[e];
  42806. if (void 0 !== n) {
  42807. var r = n.indexOf(t);
  42808. r !== -1 && n.splice(r, 1)
  42809. }
  42810. }
  42811. },
  42812. dispatchEvent: function(e) {
  42813. if (void 0 !== this._listeners) {
  42814. var t = this._listeners
  42815. , i = t[e.type];
  42816. if (void 0 !== i) {
  42817. e.target = this;
  42818. for (var n = [], r = i.length, o = 0; o < r; o++)
  42819. n[o] = i[o];
  42820. for (var o = 0; o < r; o++)
  42821. n[o].call(this, e)
  42822. }
  42823. }
  42824. }
  42825. },
  42826. n.Layers = function() {
  42827. this.mask = 1
  42828. }
  42829. ,
  42830. n.Layers.prototype = {
  42831. constructor: n.Layers,
  42832. set: function(e) {
  42833. this.mask = 1 << e
  42834. },
  42835. enable: function(e) {
  42836. this.mask |= 1 << e
  42837. },
  42838. toggle: function(e) {
  42839. this.mask ^= 1 << e
  42840. },
  42841. disable: function(e) {
  42842. this.mask &= ~(1 << e)
  42843. },
  42844. test: function(e) {
  42845. return 0 !== (this.mask & e.mask)
  42846. }
  42847. },
  42848. function(e) {
  42849. function t(e, t) {
  42850. return e.distance - t.distance
  42851. }
  42852. function i(e, t, n, r) {
  42853. if (e.visible !== !1 && (e.raycast(t, n),
  42854. r === !0))
  42855. for (var o = e.children, a = 0, s = o.length; a < s; a++)
  42856. i(o[a], t, n, !0)
  42857. }
  42858. e.Raycaster = function(t, i, n, r) {
  42859. this.ray = new e.Ray(t,i),
  42860. this.near = n || 0,
  42861. this.far = r || 1 / 0,
  42862. this.params = {
  42863. Mesh: {},
  42864. Line: {},
  42865. LOD: {},
  42866. Points: {
  42867. threshold: 1
  42868. },
  42869. Sprite: {}
  42870. },
  42871. Object.defineProperties(this.params, {
  42872. PointCloud: {
  42873. get: function() {
  42874. return console.warn("THREE.Raycaster: params.PointCloud has been renamed to params.Points."),
  42875. this.Points
  42876. }
  42877. }
  42878. })
  42879. }
  42880. ,
  42881. e.Raycaster.prototype = {
  42882. constructor: e.Raycaster,
  42883. linePrecision: 1,
  42884. set: function(e, t) {
  42885. this.ray.set(e, t)
  42886. },
  42887. setFromCamera: function(t, i) {
  42888. i instanceof e.PerspectiveCamera ? (this.ray.origin.setFromMatrixPosition(i.matrixWorld),
  42889. 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),
  42890. this.ray.direction.set(0, 0, -1).transformDirection(i.matrixWorld)) : console.error("THREE.Raycaster: Unsupported camera type.")
  42891. },
  42892. intersectObject: function(e, n) {
  42893. var r = [];
  42894. return i(e, this, r, n),
  42895. r.sort(t),
  42896. r
  42897. },
  42898. intersectObjects: function(e, n) {
  42899. var r = [];
  42900. if (Array.isArray(e) === !1)
  42901. return console.warn("THREE.Raycaster.intersectObjects: objects is not an Array."),
  42902. r;
  42903. for (var o = 0, a = e.length; o < a; o++)
  42904. i(e[o], this, r, n);
  42905. return r.sort(t),
  42906. r
  42907. }
  42908. }
  42909. }(n),
  42910. n.Object3D = function() {
  42911. function e() {
  42912. o.setFromEuler(r, !1)
  42913. }
  42914. function t() {
  42915. r.setFromQuaternion(o, void 0, !1)
  42916. }
  42917. Object.defineProperty(this, "id", {
  42918. value: n.Object3DIdCount++
  42919. }),
  42920. this.uuid = n.Math.generateUUID(),
  42921. this.name = "",
  42922. this.type = "Object3D",
  42923. this.parent = null,
  42924. this.children = [],
  42925. this.up = n.Object3D.DefaultUp.clone();
  42926. var i = new n.Vector3
  42927. , r = new n.Euler
  42928. , o = new n.Quaternion
  42929. , a = new n.Vector3(1,1,1);
  42930. r.onChange(e),
  42931. o.onChange(t),
  42932. Object.defineProperties(this, {
  42933. position: {
  42934. enumerable: !0,
  42935. value: i
  42936. },
  42937. rotation: {
  42938. enumerable: !0,
  42939. value: r
  42940. },
  42941. quaternion: {
  42942. enumerable: !0,
  42943. value: o
  42944. },
  42945. scale: {
  42946. enumerable: !0,
  42947. value: a
  42948. },
  42949. modelViewMatrix: {
  42950. value: new n.Matrix4
  42951. },
  42952. normalMatrix: {
  42953. value: new n.Matrix3
  42954. }
  42955. }),
  42956. this.rotationAutoUpdate = !0,
  42957. this.matrix = new n.Matrix4,
  42958. this.matrixWorld = new n.Matrix4,
  42959. this.matrixAutoUpdate = n.Object3D.DefaultMatrixAutoUpdate,
  42960. this.matrixWorldNeedsUpdate = !1,
  42961. this.layers = new n.Layers,
  42962. this.visible = !0,
  42963. this.castShadow = !1,
  42964. this.receiveShadow = !1,
  42965. this.frustumCulled = !0,
  42966. this.renderOrder = 0,
  42967. this.userData = {}
  42968. }
  42969. ,
  42970. n.Object3D.DefaultUp = new n.Vector3(0,1,0),
  42971. n.Object3D.DefaultMatrixAutoUpdate = !0,
  42972. n.Object3D.prototype = {
  42973. constructor: n.Object3D,
  42974. applyMatrix: function(e) {
  42975. this.matrix.multiplyMatrices(e, this.matrix),
  42976. this.matrix.decompose(this.position, this.quaternion, this.scale)
  42977. },
  42978. setRotationFromAxisAngle: function(e, t) {
  42979. this.quaternion.setFromAxisAngle(e, t)
  42980. },
  42981. setRotationFromEuler: function(e) {
  42982. this.quaternion.setFromEuler(e, !0)
  42983. },
  42984. setRotationFromMatrix: function(e) {
  42985. this.quaternion.setFromRotationMatrix(e)
  42986. },
  42987. setRotationFromQuaternion: function(e) {
  42988. this.quaternion.copy(e)
  42989. },
  42990. rotateOnAxis: function() {
  42991. var e = new n.Quaternion;
  42992. return function(t, i) {
  42993. return e.setFromAxisAngle(t, i),
  42994. this.quaternion.multiply(e),
  42995. this
  42996. }
  42997. }(),
  42998. rotateX: function() {
  42999. var e = new n.Vector3(1,0,0);
  43000. return function(t) {
  43001. return this.rotateOnAxis(e, t)
  43002. }
  43003. }(),
  43004. rotateY: function() {
  43005. var e = new n.Vector3(0,1,0);
  43006. return function(t) {
  43007. return this.rotateOnAxis(e, t)
  43008. }
  43009. }(),
  43010. rotateZ: function() {
  43011. var e = new n.Vector3(0,0,1);
  43012. return function(t) {
  43013. return this.rotateOnAxis(e, t)
  43014. }
  43015. }(),
  43016. translateOnAxis: function() {
  43017. var e = new n.Vector3;
  43018. return function(t, i) {
  43019. return e.copy(t).applyQuaternion(this.quaternion),
  43020. this.position.add(e.multiplyScalar(i)),
  43021. this
  43022. }
  43023. }(),
  43024. translateX: function() {
  43025. var e = new n.Vector3(1,0,0);
  43026. return function(t) {
  43027. return this.translateOnAxis(e, t)
  43028. }
  43029. }(),
  43030. translateY: function() {
  43031. var e = new n.Vector3(0,1,0);
  43032. return function(t) {
  43033. return this.translateOnAxis(e, t)
  43034. }
  43035. }(),
  43036. translateZ: function() {
  43037. var e = new n.Vector3(0,0,1);
  43038. return function(t) {
  43039. return this.translateOnAxis(e, t)
  43040. }
  43041. }(),
  43042. localToWorld: function(e) {
  43043. return e.applyMatrix4(this.matrixWorld)
  43044. },
  43045. worldToLocal: function() {
  43046. var e = new n.Matrix4;
  43047. return function(t) {
  43048. return t.applyMatrix4(e.getInverse(this.matrixWorld))
  43049. }
  43050. }(),
  43051. lookAt: function() {
  43052. var e = new n.Matrix4;
  43053. return function(t) {
  43054. e.lookAt(t, this.position, this.up),
  43055. this.quaternion.setFromRotationMatrix(e)
  43056. }
  43057. }(),
  43058. add: function(e) {
  43059. if (arguments.length > 1) {
  43060. for (var t = 0; t < arguments.length; t++)
  43061. this.add(arguments[t]);
  43062. return this
  43063. }
  43064. return e === this ? (console.error("THREE.Object3D.add: object can't be added as a child of itself.", e),
  43065. this) : (e instanceof n.Object3D ? (null !== e.parent && e.parent.remove(e),
  43066. e.parent = this,
  43067. e.dispatchEvent({
  43068. type: "added"
  43069. }),
  43070. this.children.push(e)) : console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.", e),
  43071. this)
  43072. },
  43073. remove: function(e) {
  43074. if (arguments.length > 1)
  43075. for (var t = 0; t < arguments.length; t++)
  43076. this.remove(arguments[t]);
  43077. var i = this.children.indexOf(e);
  43078. i !== -1 && (e.parent = null,
  43079. e.dispatchEvent({
  43080. type: "removed"
  43081. }),
  43082. this.children.splice(i, 1))
  43083. },
  43084. getObjectById: function(e) {
  43085. return this.getObjectByProperty("id", e)
  43086. },
  43087. getObjectByName: function(e) {
  43088. return this.getObjectByProperty("name", e)
  43089. },
  43090. getObjectByProperty: function(e, t) {
  43091. if (this[e] === t)
  43092. return this;
  43093. for (var i = 0, n = this.children.length; i < n; i++) {
  43094. var r = this.children[i]
  43095. , o = r.getObjectByProperty(e, t);
  43096. if (void 0 !== o)
  43097. return o
  43098. }
  43099. },
  43100. getWorldPosition: function(e) {
  43101. var t = e || new n.Vector3;
  43102. return this.updateMatrixWorld(!0),
  43103. t.setFromMatrixPosition(this.matrixWorld)
  43104. },
  43105. getWorldQuaternion: function() {
  43106. var e = new n.Vector3
  43107. , t = new n.Vector3;
  43108. return function(i) {
  43109. var r = i || new n.Quaternion;
  43110. return this.updateMatrixWorld(!0),
  43111. this.matrixWorld.decompose(e, r, t),
  43112. r
  43113. }
  43114. }(),
  43115. getWorldRotation: function() {
  43116. var e = new n.Quaternion;
  43117. return function(t) {
  43118. var i = t || new n.Euler;
  43119. return this.getWorldQuaternion(e),
  43120. i.setFromQuaternion(e, this.rotation.order, !1)
  43121. }
  43122. }(),
  43123. getWorldScale: function() {
  43124. var e = new n.Vector3
  43125. , t = new n.Quaternion;
  43126. return function(i) {
  43127. var r = i || new n.Vector3;
  43128. return this.updateMatrixWorld(!0),
  43129. this.matrixWorld.decompose(e, t, r),
  43130. r
  43131. }
  43132. }(),
  43133. getWorldDirection: function() {
  43134. var e = new n.Quaternion;
  43135. return function(t) {
  43136. var i = t || new n.Vector3;
  43137. return this.getWorldQuaternion(e),
  43138. i.set(0, 0, 1).applyQuaternion(e)
  43139. }
  43140. }(),
  43141. raycast: function() {},
  43142. traverse: function(e) {
  43143. e(this);
  43144. for (var t = this.children, i = 0, n = t.length; i < n; i++)
  43145. t[i].traverse(e)
  43146. },
  43147. traverseVisible: function(e) {
  43148. if (this.visible !== !1) {
  43149. e(this);
  43150. for (var t = this.children, i = 0, n = t.length; i < n; i++)
  43151. t[i].traverseVisible(e)
  43152. }
  43153. },
  43154. traverseAncestors: function(e) {
  43155. var t = this.parent;
  43156. null !== t && (e(t),
  43157. t.traverseAncestors(e))
  43158. },
  43159. updateMatrix: function() {
  43160. this.matrix.compose(this.position, this.quaternion, this.scale),
  43161. this.matrixWorldNeedsUpdate = !0
  43162. },
  43163. updateMatrixWorld: function(e) {
  43164. this.matrixAutoUpdate === !0 && this.updateMatrix(),
  43165. this.matrixWorldNeedsUpdate !== !0 && e !== !0 || (null === this.parent ? this.matrixWorld.copy(this.matrix) : this.matrixWorld.multiplyMatrices(this.parent.matrixWorld, this.matrix),
  43166. this.matrixWorldNeedsUpdate = !1,
  43167. e = !0);
  43168. for (var t = 0, i = this.children.length; t < i; t++)
  43169. this.children[t].updateMatrixWorld(e)
  43170. },
  43171. toJSON: function(e) {
  43172. function t(e) {
  43173. var t = [];
  43174. for (var i in e) {
  43175. var n = e[i];
  43176. delete n.metadata,
  43177. t.push(n)
  43178. }
  43179. return t
  43180. }
  43181. var i = void 0 === e
  43182. , n = {};
  43183. i && (e = {
  43184. geometries: {},
  43185. materials: {},
  43186. textures: {},
  43187. images: {}
  43188. },
  43189. n.metadata = {
  43190. version: 4.4,
  43191. type: "Object",
  43192. generator: "Object3D.toJSON"
  43193. });
  43194. var r = {};
  43195. if (r.uuid = this.uuid,
  43196. r.type = this.type,
  43197. "" !== this.name && (r.name = this.name),
  43198. "{}" !== JSON.stringify(this.userData) && (r.userData = this.userData),
  43199. this.castShadow === !0 && (r.castShadow = !0),
  43200. this.receiveShadow === !0 && (r.receiveShadow = !0),
  43201. this.visible === !1 && (r.visible = !1),
  43202. r.matrix = this.matrix.toArray(),
  43203. void 0 !== this.geometry && (void 0 === e.geometries[this.geometry.uuid] && (e.geometries[this.geometry.uuid] = this.geometry.toJSON(e)),
  43204. r.geometry = this.geometry.uuid),
  43205. void 0 !== this.material && (void 0 === e.materials[this.material.uuid] && (e.materials[this.material.uuid] = this.material.toJSON(e)),
  43206. r.material = this.material.uuid),
  43207. this.children.length > 0) {
  43208. r.children = [];
  43209. for (var o = 0; o < this.children.length; o++)
  43210. r.children.push(this.children[o].toJSON(e).object)
  43211. }
  43212. if (i) {
  43213. var a = t(e.geometries)
  43214. , s = t(e.materials)
  43215. , l = t(e.textures)
  43216. , c = t(e.images);
  43217. a.length > 0 && (n.geometries = a),
  43218. s.length > 0 && (n.materials = s),
  43219. l.length > 0 && (n.textures = l),
  43220. c.length > 0 && (n.images = c)
  43221. }
  43222. return n.object = r,
  43223. n
  43224. },
  43225. clone: function(e) {
  43226. return (new this.constructor).copy(this, e)
  43227. },
  43228. copy: function(e, t) {
  43229. if (void 0 === t && (t = !0),
  43230. this.name = e.name,
  43231. this.up.copy(e.up),
  43232. this.position.copy(e.position),
  43233. this.quaternion.copy(e.quaternion),
  43234. this.scale.copy(e.scale),
  43235. this.rotationAutoUpdate = e.rotationAutoUpdate,
  43236. this.matrix.copy(e.matrix),
  43237. this.matrixWorld.copy(e.matrixWorld),
  43238. this.matrixAutoUpdate = e.matrixAutoUpdate,
  43239. this.matrixWorldNeedsUpdate = e.matrixWorldNeedsUpdate,
  43240. this.visible = e.visible,
  43241. this.castShadow = e.castShadow,
  43242. this.receiveShadow = e.receiveShadow,
  43243. this.frustumCulled = e.frustumCulled,
  43244. this.renderOrder = e.renderOrder,
  43245. this.userData = JSON.parse(JSON.stringify(e.userData)),
  43246. t === !0)
  43247. for (var i = 0; i < e.children.length; i++) {
  43248. var n = e.children[i];
  43249. this.add(n.clone())
  43250. }
  43251. return this
  43252. }
  43253. },
  43254. n.EventDispatcher.prototype.apply(n.Object3D.prototype),
  43255. n.Object3DIdCount = 0,
  43256. n.Face3 = function(e, t, i, r, o, a) {
  43257. this.a = e,
  43258. this.b = t,
  43259. this.c = i,
  43260. this.normal = r instanceof n.Vector3 ? r : new n.Vector3,
  43261. this.vertexNormals = Array.isArray(r) ? r : [],
  43262. this.color = o instanceof n.Color ? o : new n.Color,
  43263. this.vertexColors = Array.isArray(o) ? o : [],
  43264. this.materialIndex = void 0 !== a ? a : 0
  43265. }
  43266. ,
  43267. n.Face3.prototype = {
  43268. constructor: n.Face3,
  43269. clone: function() {
  43270. return (new this.constructor).copy(this)
  43271. },
  43272. copy: function(e) {
  43273. this.a = e.a,
  43274. this.b = e.b,
  43275. this.c = e.c,
  43276. this.normal.copy(e.normal),
  43277. this.color.copy(e.color),
  43278. this.materialIndex = e.materialIndex;
  43279. for (var t = 0, i = e.vertexNormals.length; t < i; t++)
  43280. this.vertexNormals[t] = e.vertexNormals[t].clone();
  43281. for (var t = 0, i = e.vertexColors.length; t < i; t++)
  43282. this.vertexColors[t] = e.vertexColors[t].clone();
  43283. return this
  43284. }
  43285. },
  43286. n.BufferAttribute = function(e, t) {
  43287. this.uuid = n.Math.generateUUID(),
  43288. this.array = e,
  43289. this.itemSize = t,
  43290. this.dynamic = !1,
  43291. this.updateRange = {
  43292. offset: 0,
  43293. count: -1
  43294. },
  43295. this.version = 0
  43296. }
  43297. ,
  43298. n.BufferAttribute.prototype = {
  43299. constructor: n.BufferAttribute,
  43300. get count() {
  43301. return this.array.length / this.itemSize
  43302. },
  43303. set needsUpdate(e) {
  43304. e === !0 && this.version++
  43305. },
  43306. setDynamic: function(e) {
  43307. return this.dynamic = e,
  43308. this
  43309. },
  43310. copy: function(e) {
  43311. return this.array = new e.array.constructor(e.array),
  43312. this.itemSize = e.itemSize,
  43313. this.dynamic = e.dynamic,
  43314. this
  43315. },
  43316. copyAt: function(e, t, i) {
  43317. e *= this.itemSize,
  43318. i *= t.itemSize;
  43319. for (var n = 0, r = this.itemSize; n < r; n++)
  43320. this.array[e + n] = t.array[i + n];
  43321. return this
  43322. },
  43323. copyArray: function(e) {
  43324. return this.array.set(e),
  43325. this
  43326. },
  43327. copyColorsArray: 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.copyColorsArray(): color is undefined", r),
  43331. a = new n.Color),
  43332. t[i++] = a.r,
  43333. t[i++] = a.g,
  43334. t[i++] = a.b
  43335. }
  43336. return this
  43337. },
  43338. copyIndicesArray: function(e) {
  43339. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  43340. var o = e[n];
  43341. t[i++] = o.a,
  43342. t[i++] = o.b,
  43343. t[i++] = o.c
  43344. }
  43345. return this
  43346. },
  43347. copyVector2sArray: function(e) {
  43348. for (var t = this.array, i = 0, r = 0, o = e.length; r < o; r++) {
  43349. var a = e[r];
  43350. void 0 === a && (console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined", r),
  43351. a = new n.Vector2),
  43352. t[i++] = a.x,
  43353. t[i++] = a.y
  43354. }
  43355. return this
  43356. },
  43357. copyVector3sArray: function(e) {
  43358. for (var t = this.array, i = 0, r = 0, o = e.length; r < o; r++) {
  43359. var a = e[r];
  43360. void 0 === a && (console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined", r),
  43361. a = new n.Vector3),
  43362. t[i++] = a.x,
  43363. t[i++] = a.y,
  43364. t[i++] = a.z
  43365. }
  43366. return this
  43367. },
  43368. copyVector4sArray: function(e) {
  43369. for (var t = this.array, i = 0, r = 0, o = e.length; r < o; r++) {
  43370. var a = e[r];
  43371. void 0 === a && (console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined", r),
  43372. a = new n.Vector4),
  43373. t[i++] = a.x,
  43374. t[i++] = a.y,
  43375. t[i++] = a.z,
  43376. t[i++] = a.w
  43377. }
  43378. return this
  43379. },
  43380. set: function(e, t) {
  43381. return void 0 === t && (t = 0),
  43382. this.array.set(e, t),
  43383. this
  43384. },
  43385. getX: function(e) {
  43386. return this.array[e * this.itemSize]
  43387. },
  43388. setX: function(e, t) {
  43389. return this.array[e * this.itemSize] = t,
  43390. this
  43391. },
  43392. getY: function(e) {
  43393. return this.array[e * this.itemSize + 1]
  43394. },
  43395. setY: function(e, t) {
  43396. return this.array[e * this.itemSize + 1] = t,
  43397. this
  43398. },
  43399. getZ: function(e) {
  43400. return this.array[e * this.itemSize + 2]
  43401. },
  43402. setZ: function(e, t) {
  43403. return this.array[e * this.itemSize + 2] = t,
  43404. this
  43405. },
  43406. getW: function(e) {
  43407. return this.array[e * this.itemSize + 3]
  43408. },
  43409. setW: function(e, t) {
  43410. return this.array[e * this.itemSize + 3] = t,
  43411. this
  43412. },
  43413. setXY: function(e, t, i) {
  43414. return e *= this.itemSize,
  43415. this.array[e + 0] = t,
  43416. this.array[e + 1] = i,
  43417. this
  43418. },
  43419. setXYZ: function(e, t, i, n) {
  43420. return e *= this.itemSize,
  43421. this.array[e + 0] = t,
  43422. this.array[e + 1] = i,
  43423. this.array[e + 2] = n,
  43424. this
  43425. },
  43426. setXYZW: function(e, t, i, n, r) {
  43427. return e *= this.itemSize,
  43428. this.array[e + 0] = t,
  43429. this.array[e + 1] = i,
  43430. this.array[e + 2] = n,
  43431. this.array[e + 3] = r,
  43432. this
  43433. },
  43434. clone: function() {
  43435. return (new this.constructor).copy(this)
  43436. }
  43437. },
  43438. n.Int8Attribute = function(e, t) {
  43439. return new n.BufferAttribute(new Int8Array(e),t)
  43440. }
  43441. ,
  43442. n.Uint8Attribute = function(e, t) {
  43443. return new n.BufferAttribute(new Uint8Array(e),t)
  43444. }
  43445. ,
  43446. n.Uint8ClampedAttribute = function(e, t) {
  43447. return new n.BufferAttribute(new Uint8ClampedArray(e),t)
  43448. }
  43449. ,
  43450. n.Int16Attribute = function(e, t) {
  43451. return new n.BufferAttribute(new Int16Array(e),t)
  43452. }
  43453. ,
  43454. n.Uint16Attribute = function(e, t) {
  43455. return new n.BufferAttribute(new Uint16Array(e),t)
  43456. }
  43457. ;
  43458. n.Int32Attribute = function(e, t) {
  43459. return new n.BufferAttribute(new Int32Array(e),t)
  43460. }
  43461. ;
  43462. n.Uint32Attribute = function(e, t) {
  43463. return new n.BufferAttribute(new Uint32Array(e),t)
  43464. }
  43465. ,
  43466. n.Float32Attribute = function(e, t) {
  43467. return new n.BufferAttribute(new Float32Array(e),t)
  43468. }
  43469. ,
  43470. n.Float64Attribute = function(e, t) {
  43471. return new n.BufferAttribute(new Float64Array(e),t)
  43472. }
  43473. ,
  43474. n.DynamicBufferAttribute = function(e, t) {
  43475. return console.warn("THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setDynamic( true ) instead."),
  43476. new n.BufferAttribute(e,t).setDynamic(!0)
  43477. }
  43478. ,
  43479. n.InstancedBufferAttribute = function(e, t, i) {
  43480. n.BufferAttribute.call(this, e, t),
  43481. this.meshPerAttribute = i || 1
  43482. }
  43483. ,
  43484. n.InstancedBufferAttribute.prototype = Object.create(n.BufferAttribute.prototype),
  43485. n.InstancedBufferAttribute.prototype.constructor = n.InstancedBufferAttribute,
  43486. n.InstancedBufferAttribute.prototype.copy = function(e) {
  43487. return n.BufferAttribute.prototype.copy.call(this, e),
  43488. this.meshPerAttribute = e.meshPerAttribute,
  43489. this
  43490. }
  43491. ,
  43492. n.InterleavedBuffer = function(e, t) {
  43493. this.uuid = n.Math.generateUUID(),
  43494. this.array = e,
  43495. this.stride = t,
  43496. this.dynamic = !1,
  43497. this.updateRange = {
  43498. offset: 0,
  43499. count: -1
  43500. },
  43501. this.version = 0
  43502. }
  43503. ,
  43504. n.InterleavedBuffer.prototype = {
  43505. constructor: n.InterleavedBuffer,
  43506. get length() {
  43507. return this.array.length
  43508. },
  43509. get count() {
  43510. return this.array.length / this.stride
  43511. },
  43512. set needsUpdate(e) {
  43513. e === !0 && this.version++
  43514. },
  43515. setDynamic: function(e) {
  43516. return this.dynamic = e,
  43517. this
  43518. },
  43519. copy: function(e) {
  43520. return this.array = new e.array.constructor(e.array),
  43521. this.stride = e.stride,
  43522. this.dynamic = e.dynamic,
  43523. this
  43524. },
  43525. copyAt: function(e, t, i) {
  43526. e *= this.stride,
  43527. i *= t.stride;
  43528. for (var n = 0, r = this.stride; n < r; n++)
  43529. this.array[e + n] = t.array[i + n];
  43530. return this
  43531. },
  43532. set: function(e, t) {
  43533. return void 0 === t && (t = 0),
  43534. this.array.set(e, t),
  43535. this
  43536. },
  43537. clone: function() {
  43538. return (new this.constructor).copy(this)
  43539. }
  43540. },
  43541. n.InstancedInterleavedBuffer = function(e, t, i) {
  43542. n.InterleavedBuffer.call(this, e, t),
  43543. this.meshPerAttribute = i || 1
  43544. }
  43545. ,
  43546. n.InstancedInterleavedBuffer.prototype = Object.create(n.InterleavedBuffer.prototype),
  43547. n.InstancedInterleavedBuffer.prototype.constructor = n.InstancedInterleavedBuffer,
  43548. n.InstancedInterleavedBuffer.prototype.copy = function(e) {
  43549. return n.InterleavedBuffer.prototype.copy.call(this, e),
  43550. this.meshPerAttribute = e.meshPerAttribute,
  43551. this
  43552. }
  43553. ,
  43554. n.InterleavedBufferAttribute = function(e, t, i) {
  43555. this.uuid = n.Math.generateUUID(),
  43556. this.data = e,
  43557. this.itemSize = t,
  43558. this.offset = i
  43559. }
  43560. ,
  43561. n.InterleavedBufferAttribute.prototype = {
  43562. constructor: n.InterleavedBufferAttribute,
  43563. get length() {
  43564. return console.warn("THREE.BufferAttribute: .length has been deprecated. Please use .count."),
  43565. this.array.length
  43566. },
  43567. get count() {
  43568. return this.data.count
  43569. },
  43570. setX: function(e, t) {
  43571. return this.data.array[e * this.data.stride + this.offset] = t,
  43572. this
  43573. },
  43574. setY: function(e, t) {
  43575. return this.data.array[e * this.data.stride + this.offset + 1] = t,
  43576. this
  43577. },
  43578. setZ: function(e, t) {
  43579. return this.data.array[e * this.data.stride + this.offset + 2] = t,
  43580. this
  43581. },
  43582. setW: function(e, t) {
  43583. return this.data.array[e * this.data.stride + this.offset + 3] = t,
  43584. this
  43585. },
  43586. getX: function(e) {
  43587. return this.data.array[e * this.data.stride + this.offset]
  43588. },
  43589. getY: function(e) {
  43590. return this.data.array[e * this.data.stride + this.offset + 1]
  43591. },
  43592. getZ: function(e) {
  43593. return this.data.array[e * this.data.stride + this.offset + 2]
  43594. },
  43595. getW: function(e) {
  43596. return this.data.array[e * this.data.stride + this.offset + 3]
  43597. },
  43598. setXY: function(e, t, i) {
  43599. return e = e * this.data.stride + this.offset,
  43600. this.data.array[e + 0] = t,
  43601. this.data.array[e + 1] = i,
  43602. this
  43603. },
  43604. setXYZ: function(e, t, i, n) {
  43605. return e = e * this.data.stride + this.offset,
  43606. this.data.array[e + 0] = t,
  43607. this.data.array[e + 1] = i,
  43608. this.data.array[e + 2] = n,
  43609. this
  43610. },
  43611. setXYZW: function(e, t, i, n, r) {
  43612. return e = e * this.data.stride + this.offset,
  43613. this.data.array[e + 0] = t,
  43614. this.data.array[e + 1] = i,
  43615. this.data.array[e + 2] = n,
  43616. this.data.array[e + 3] = r,
  43617. this
  43618. }
  43619. },
  43620. n.Geometry = function() {
  43621. Object.defineProperty(this, "id", {
  43622. value: n.GeometryIdCount++
  43623. }),
  43624. this.uuid = n.Math.generateUUID(),
  43625. this.name = "",
  43626. this.type = "Geometry",
  43627. this.vertices = [],
  43628. this.colors = [],
  43629. this.faces = [],
  43630. this.faceVertexUvs = [[]],
  43631. this.morphTargets = [],
  43632. this.morphNormals = [],
  43633. this.skinWeights = [],
  43634. this.skinIndices = [],
  43635. this.lineDistances = [],
  43636. this.boundingBox = null,
  43637. this.boundingSphere = null,
  43638. this.verticesNeedUpdate = !1,
  43639. this.elementsNeedUpdate = !1,
  43640. this.uvsNeedUpdate = !1,
  43641. this.normalsNeedUpdate = !1,
  43642. this.colorsNeedUpdate = !1,
  43643. this.lineDistancesNeedUpdate = !1,
  43644. this.groupsNeedUpdate = !1
  43645. }
  43646. ,
  43647. n.Geometry.prototype = {
  43648. constructor: n.Geometry,
  43649. applyMatrix: function(e) {
  43650. for (var t = (new n.Matrix3).getNormalMatrix(e), i = 0, r = this.vertices.length; i < r; i++) {
  43651. var o = this.vertices[i];
  43652. o.applyMatrix4(e)
  43653. }
  43654. for (var i = 0, r = this.faces.length; i < r; i++) {
  43655. var a = this.faces[i];
  43656. a.normal.applyMatrix3(t).normalize();
  43657. for (var s = 0, l = a.vertexNormals.length; s < l; s++)
  43658. a.vertexNormals[s].applyMatrix3(t).normalize()
  43659. }
  43660. return null !== this.boundingBox && this.computeBoundingBox(),
  43661. null !== this.boundingSphere && this.computeBoundingSphere(),
  43662. this.verticesNeedUpdate = !0,
  43663. this.normalsNeedUpdate = !0,
  43664. this
  43665. },
  43666. rotateX: function() {
  43667. var e;
  43668. return function(t) {
  43669. return void 0 === e && (e = new n.Matrix4),
  43670. e.makeRotationX(t),
  43671. this.applyMatrix(e),
  43672. this
  43673. }
  43674. }(),
  43675. rotateY: function() {
  43676. var e;
  43677. return function(t) {
  43678. return void 0 === e && (e = new n.Matrix4),
  43679. e.makeRotationY(t),
  43680. this.applyMatrix(e),
  43681. this
  43682. }
  43683. }(),
  43684. rotateZ: function() {
  43685. var e;
  43686. return function(t) {
  43687. return void 0 === e && (e = new n.Matrix4),
  43688. e.makeRotationZ(t),
  43689. this.applyMatrix(e),
  43690. this
  43691. }
  43692. }(),
  43693. translate: function() {
  43694. var e;
  43695. return function(t, i, r) {
  43696. return void 0 === e && (e = new n.Matrix4),
  43697. e.makeTranslation(t, i, r),
  43698. this.applyMatrix(e),
  43699. this
  43700. }
  43701. }(),
  43702. scale: function() {
  43703. var e;
  43704. return function(t, i, r) {
  43705. return void 0 === e && (e = new n.Matrix4),
  43706. e.makeScale(t, i, r),
  43707. this.applyMatrix(e),
  43708. this
  43709. }
  43710. }(),
  43711. lookAt: function() {
  43712. var e;
  43713. return function(t) {
  43714. void 0 === e && (e = new n.Object3D),
  43715. e.lookAt(t),
  43716. e.updateMatrix(),
  43717. this.applyMatrix(e.matrix)
  43718. }
  43719. }(),
  43720. fromBufferGeometry: function(e) {
  43721. function t(e, t, r, o) {
  43722. var a = void 0 !== s ? [u[e].clone(), u[t].clone(), u[r].clone()] : []
  43723. , f = void 0 !== l ? [i.colors[e].clone(), i.colors[t].clone(), i.colors[r].clone()] : []
  43724. , g = new n.Face3(e,t,r,a,f,o);
  43725. i.faces.push(g),
  43726. void 0 !== c && i.faceVertexUvs[0].push([d[e].clone(), d[t].clone(), d[r].clone()]),
  43727. void 0 !== h && i.faceVertexUvs[1].push([p[e].clone(), p[t].clone(), p[r].clone()])
  43728. }
  43729. var i = this
  43730. , r = null !== e.index ? e.index.array : void 0
  43731. , o = e.attributes
  43732. , a = o.position.array
  43733. , s = void 0 !== o.normal ? o.normal.array : void 0
  43734. , l = void 0 !== o.color ? o.color.array : void 0
  43735. , c = void 0 !== o.uv ? o.uv.array : void 0
  43736. , h = void 0 !== o.uv2 ? o.uv2.array : void 0;
  43737. void 0 !== h && (this.faceVertexUvs[1] = []);
  43738. for (var u = [], d = [], p = [], f = 0, g = 0; f < a.length; f += 3,
  43739. g += 2)
  43740. i.vertices.push(new n.Vector3(a[f],a[f + 1],a[f + 2])),
  43741. void 0 !== s && u.push(new n.Vector3(s[f],s[f + 1],s[f + 2])),
  43742. void 0 !== l && i.colors.push(new n.Color(l[f],l[f + 1],l[f + 2])),
  43743. void 0 !== c && d.push(new n.Vector2(c[g],c[g + 1])),
  43744. void 0 !== h && p.push(new n.Vector2(h[g],h[g + 1]));
  43745. if (void 0 !== r) {
  43746. var m = e.groups;
  43747. if (m.length > 0)
  43748. for (var f = 0; f < m.length; f++)
  43749. for (var v = m[f], A = v.start, y = v.count, g = A, C = A + y; g < C; g += 3)
  43750. t(r[g], r[g + 1], r[g + 2], v.materialIndex);
  43751. else
  43752. for (var f = 0; f < r.length; f += 3)
  43753. t(r[f], r[f + 1], r[f + 2])
  43754. } else
  43755. for (var f = 0; f < a.length / 3; f += 3)
  43756. t(f, f + 1, f + 2);
  43757. return this.computeFaceNormals(),
  43758. null !== e.boundingBox && (this.boundingBox = e.boundingBox.clone()),
  43759. null !== e.boundingSphere && (this.boundingSphere = e.boundingSphere.clone()),
  43760. this
  43761. },
  43762. center: function() {
  43763. this.computeBoundingBox();
  43764. var e = this.boundingBox.center().negate();
  43765. return this.translate(e.x, e.y, e.z),
  43766. e
  43767. },
  43768. normalize: function() {
  43769. this.computeBoundingSphere();
  43770. var e = this.boundingSphere.center
  43771. , t = this.boundingSphere.radius
  43772. , i = 0 === t ? 1 : 1 / t
  43773. , r = new n.Matrix4;
  43774. 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),
  43775. this.applyMatrix(r),
  43776. this
  43777. },
  43778. computeFaceNormals: function() {
  43779. for (var e = new n.Vector3, t = new n.Vector3, i = 0, r = this.faces.length; i < r; i++) {
  43780. var o = this.faces[i]
  43781. , a = this.vertices[o.a]
  43782. , s = this.vertices[o.b]
  43783. , l = this.vertices[o.c];
  43784. e.subVectors(l, s),
  43785. t.subVectors(a, s),
  43786. e.cross(t),
  43787. e.normalize(),
  43788. o.normal.copy(e)
  43789. }
  43790. },
  43791. computeVertexNormals: function(e) {
  43792. void 0 === e && (e = !0);
  43793. var t, i, r, o, a, s;
  43794. for (s = new Array(this.vertices.length),
  43795. t = 0,
  43796. i = this.vertices.length; t < i; t++)
  43797. s[t] = new n.Vector3;
  43798. if (e) {
  43799. var l, c, h, u = new n.Vector3, d = new n.Vector3;
  43800. for (r = 0,
  43801. o = this.faces.length; r < o; r++)
  43802. a = this.faces[r],
  43803. l = this.vertices[a.a],
  43804. c = this.vertices[a.b],
  43805. h = this.vertices[a.c],
  43806. u.subVectors(h, c),
  43807. d.subVectors(l, c),
  43808. u.cross(d),
  43809. s[a.a].add(u),
  43810. s[a.b].add(u),
  43811. s[a.c].add(u)
  43812. } else
  43813. for (r = 0,
  43814. o = this.faces.length; r < o; r++)
  43815. a = this.faces[r],
  43816. s[a.a].add(a.normal),
  43817. s[a.b].add(a.normal),
  43818. s[a.c].add(a.normal);
  43819. for (t = 0,
  43820. i = this.vertices.length; t < i; t++)
  43821. s[t].normalize();
  43822. for (r = 0,
  43823. o = this.faces.length; r < o; r++) {
  43824. a = this.faces[r];
  43825. var p = a.vertexNormals;
  43826. 3 === p.length ? (p[0].copy(s[a.a]),
  43827. p[1].copy(s[a.b]),
  43828. p[2].copy(s[a.c])) : (p[0] = s[a.a].clone(),
  43829. p[1] = s[a.b].clone(),
  43830. p[2] = s[a.c].clone())
  43831. }
  43832. this.faces.length > 0 && (this.normalsNeedUpdate = !0)
  43833. },
  43834. computeMorphNormals: function() {
  43835. var e, t, i, r, o;
  43836. for (i = 0,
  43837. r = this.faces.length; i < r; i++)
  43838. for (o = this.faces[i],
  43839. o.__originalFaceNormal ? o.__originalFaceNormal.copy(o.normal) : o.__originalFaceNormal = o.normal.clone(),
  43840. o.__originalVertexNormals || (o.__originalVertexNormals = []),
  43841. e = 0,
  43842. t = o.vertexNormals.length; e < t; e++)
  43843. o.__originalVertexNormals[e] ? o.__originalVertexNormals[e].copy(o.vertexNormals[e]) : o.__originalVertexNormals[e] = o.vertexNormals[e].clone();
  43844. var a = new n.Geometry;
  43845. for (a.faces = this.faces,
  43846. e = 0,
  43847. t = this.morphTargets.length; e < t; e++) {
  43848. if (!this.morphNormals[e]) {
  43849. this.morphNormals[e] = {},
  43850. this.morphNormals[e].faceNormals = [],
  43851. this.morphNormals[e].vertexNormals = [];
  43852. var s, l, c = this.morphNormals[e].faceNormals, h = this.morphNormals[e].vertexNormals;
  43853. for (i = 0,
  43854. r = this.faces.length; i < r; i++)
  43855. s = new n.Vector3,
  43856. l = {
  43857. a: new n.Vector3,
  43858. b: new n.Vector3,
  43859. c: new n.Vector3
  43860. },
  43861. c.push(s),
  43862. h.push(l)
  43863. }
  43864. var u = this.morphNormals[e];
  43865. a.vertices = this.morphTargets[e].vertices,
  43866. a.computeFaceNormals(),
  43867. a.computeVertexNormals();
  43868. var s, l;
  43869. for (i = 0,
  43870. r = this.faces.length; i < r; i++)
  43871. o = this.faces[i],
  43872. s = u.faceNormals[i],
  43873. l = u.vertexNormals[i],
  43874. s.copy(o.normal),
  43875. l.a.copy(o.vertexNormals[0]),
  43876. l.b.copy(o.vertexNormals[1]),
  43877. l.c.copy(o.vertexNormals[2])
  43878. }
  43879. for (i = 0,
  43880. r = this.faces.length; i < r; i++)
  43881. o = this.faces[i],
  43882. o.normal = o.__originalFaceNormal,
  43883. o.vertexNormals = o.__originalVertexNormals
  43884. },
  43885. computeTangents: function() {
  43886. console.warn("THREE.Geometry: .computeTangents() has been removed.")
  43887. },
  43888. computeLineDistances: function() {
  43889. for (var e = 0, t = this.vertices, i = 0, n = t.length; i < n; i++)
  43890. i > 0 && (e += t[i].distanceTo(t[i - 1])),
  43891. this.lineDistances[i] = e
  43892. },
  43893. computeBoundingBox: function() {
  43894. null === this.boundingBox && (this.boundingBox = new n.Box3),
  43895. this.boundingBox.setFromPoints(this.vertices)
  43896. },
  43897. computeBoundingSphere: function() {
  43898. null === this.boundingSphere && (this.boundingSphere = new n.Sphere),
  43899. this.boundingSphere.setFromPoints(this.vertices)
  43900. },
  43901. merge: function(e, t, i) {
  43902. if (e instanceof n.Geometry == !1)
  43903. return void console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.", e);
  43904. 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];
  43905. void 0 === i && (i = 0),
  43906. void 0 !== t && (r = (new n.Matrix3).getNormalMatrix(t));
  43907. for (var d = 0, p = s.length; d < p; d++) {
  43908. var f = s[d]
  43909. , g = f.clone();
  43910. void 0 !== t && g.applyMatrix4(t),
  43911. a.push(g)
  43912. }
  43913. for (d = 0,
  43914. p = c.length; d < p; d++) {
  43915. var m, v, A, y = c[d], C = y.vertexNormals, I = y.vertexColors;
  43916. m = new n.Face3(y.a + o,y.b + o,y.c + o),
  43917. m.normal.copy(y.normal),
  43918. void 0 !== r && m.normal.applyMatrix3(r).normalize();
  43919. for (var E = 0, b = C.length; E < b; E++)
  43920. v = C[E].clone(),
  43921. void 0 !== r && v.applyMatrix3(r).normalize(),
  43922. m.vertexNormals.push(v);
  43923. m.color.copy(y.color);
  43924. for (var E = 0, b = I.length; E < b; E++)
  43925. A = I[E],
  43926. m.vertexColors.push(A.clone());
  43927. m.materialIndex = y.materialIndex + i,
  43928. l.push(m)
  43929. }
  43930. for (d = 0,
  43931. p = u.length; d < p; d++) {
  43932. var w = u[d]
  43933. , _ = [];
  43934. if (void 0 !== w) {
  43935. for (var E = 0, b = w.length; E < b; E++)
  43936. _.push(w[E].clone());
  43937. h.push(_)
  43938. }
  43939. }
  43940. },
  43941. mergeMesh: function(e) {
  43942. return e instanceof n.Mesh == !1 ? void console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.", e) : (e.matrixAutoUpdate && e.updateMatrix(),
  43943. void this.merge(e.geometry, e.matrix))
  43944. },
  43945. mergeVertices: function() {
  43946. var e, t, i, n, r, o, a, s, l = {}, c = [], h = [], u = 4, d = Math.pow(10, u);
  43947. for (i = 0,
  43948. n = this.vertices.length; i < n; i++)
  43949. e = this.vertices[i],
  43950. t = Math.round(e.x * d) + "_" + Math.round(e.y * d) + "_" + Math.round(e.z * d),
  43951. void 0 === l[t] ? (l[t] = i,
  43952. c.push(this.vertices[i]),
  43953. h[i] = c.length - 1) : h[i] = h[l[t]];
  43954. var p = [];
  43955. for (i = 0,
  43956. n = this.faces.length; i < n; i++) {
  43957. r = this.faces[i],
  43958. r.a = h[r.a],
  43959. r.b = h[r.b],
  43960. r.c = h[r.c],
  43961. o = [r.a, r.b, r.c];
  43962. for (var f = -1, g = 0; g < 3; g++)
  43963. if (o[g] === o[(g + 1) % 3]) {
  43964. f = g,
  43965. p.push(i);
  43966. break
  43967. }
  43968. }
  43969. for (i = p.length - 1; i >= 0; i--) {
  43970. var m = p[i];
  43971. for (this.faces.splice(m, 1),
  43972. a = 0,
  43973. s = this.faceVertexUvs.length; a < s; a++)
  43974. this.faceVertexUvs[a].splice(m, 1)
  43975. }
  43976. var v = this.vertices.length - c.length;
  43977. return this.vertices = c,
  43978. v
  43979. },
  43980. sortFacesByMaterialIndex: function() {
  43981. function e(e, t) {
  43982. return e.materialIndex - t.materialIndex
  43983. }
  43984. for (var t = this.faces, i = t.length, n = 0; n < i; n++)
  43985. t[n]._id = n;
  43986. t.sort(e);
  43987. var r, o, a = this.faceVertexUvs[0], s = this.faceVertexUvs[1];
  43988. a && a.length === i && (r = []),
  43989. s && s.length === i && (o = []);
  43990. for (var n = 0; n < i; n++) {
  43991. var l = t[n]._id;
  43992. r && r.push(a[l]),
  43993. o && o.push(s[l])
  43994. }
  43995. r && (this.faceVertexUvs[0] = r),
  43996. o && (this.faceVertexUvs[1] = o)
  43997. },
  43998. toJSON: function() {
  43999. function e(e, t, i) {
  44000. return i ? e | 1 << t : e & ~(1 << t)
  44001. }
  44002. function t(e) {
  44003. var t = e.x.toString() + e.y.toString() + e.z.toString();
  44004. return void 0 !== d[t] ? d[t] : (d[t] = u.length / 3,
  44005. u.push(e.x, e.y, e.z),
  44006. d[t])
  44007. }
  44008. function i(e) {
  44009. var t = e.r.toString() + e.g.toString() + e.b.toString();
  44010. return void 0 !== f[t] ? f[t] : (f[t] = p.length,
  44011. p.push(e.getHex()),
  44012. f[t])
  44013. }
  44014. function n(e) {
  44015. var t = e.x.toString() + e.y.toString();
  44016. return void 0 !== m[t] ? m[t] : (m[t] = g.length / 2,
  44017. g.push(e.x, e.y),
  44018. m[t])
  44019. }
  44020. var r = {
  44021. metadata: {
  44022. version: 4.4,
  44023. type: "Geometry",
  44024. generator: "Geometry.toJSON"
  44025. }
  44026. };
  44027. if (r.uuid = this.uuid,
  44028. r.type = this.type,
  44029. "" !== this.name && (r.name = this.name),
  44030. void 0 !== this.parameters) {
  44031. var o = this.parameters;
  44032. for (var a in o)
  44033. void 0 !== o[a] && (r[a] = o[a]);
  44034. return r
  44035. }
  44036. for (var s = [], l = 0; l < this.vertices.length; l++) {
  44037. var c = this.vertices[l];
  44038. s.push(c.x, c.y, c.z)
  44039. }
  44040. for (var h = [], u = [], d = {}, p = [], f = {}, g = [], m = {}, l = 0; l < this.faces.length; l++) {
  44041. var v = this.faces[l]
  44042. , A = !0
  44043. , y = !1
  44044. , C = void 0 !== this.faceVertexUvs[0][l]
  44045. , I = v.normal.length() > 0
  44046. , E = v.vertexNormals.length > 0
  44047. , b = 1 !== v.color.r || 1 !== v.color.g || 1 !== v.color.b
  44048. , w = v.vertexColors.length > 0
  44049. , _ = 0;
  44050. if (_ = e(_, 0, 0),
  44051. _ = e(_, 1, A),
  44052. _ = e(_, 2, y),
  44053. _ = e(_, 3, C),
  44054. _ = e(_, 4, I),
  44055. _ = e(_, 5, E),
  44056. _ = e(_, 6, b),
  44057. _ = e(_, 7, w),
  44058. h.push(_),
  44059. h.push(v.a, v.b, v.c),
  44060. h.push(v.materialIndex),
  44061. C) {
  44062. var T = this.faceVertexUvs[0][l];
  44063. h.push(n(T[0]), n(T[1]), n(T[2]))
  44064. }
  44065. if (I && h.push(t(v.normal)),
  44066. E) {
  44067. var x = v.vertexNormals;
  44068. h.push(t(x[0]), t(x[1]), t(x[2]))
  44069. }
  44070. if (b && h.push(i(v.color)),
  44071. w) {
  44072. var S = v.vertexColors;
  44073. h.push(i(S[0]), i(S[1]), i(S[2]))
  44074. }
  44075. }
  44076. return r.data = {},
  44077. r.data.vertices = s,
  44078. r.data.normals = u,
  44079. p.length > 0 && (r.data.colors = p),
  44080. g.length > 0 && (r.data.uvs = [g]),
  44081. r.data.faces = h,
  44082. r
  44083. },
  44084. clone: function() {
  44085. return (new n.Geometry).copy(this)
  44086. },
  44087. copy: function(e) {
  44088. this.vertices = [],
  44089. this.faces = [],
  44090. this.faceVertexUvs = [[]];
  44091. for (var t = e.vertices, i = 0, n = t.length; i < n; i++)
  44092. this.vertices.push(t[i].clone());
  44093. for (var r = e.faces, i = 0, n = r.length; i < n; i++)
  44094. this.faces.push(r[i].clone());
  44095. for (var i = 0, n = e.faceVertexUvs.length; i < n; i++) {
  44096. var o = e.faceVertexUvs[i];
  44097. void 0 === this.faceVertexUvs[i] && (this.faceVertexUvs[i] = []);
  44098. for (var a = 0, s = o.length; a < s; a++) {
  44099. for (var l = o[a], c = [], h = 0, u = l.length; h < u; h++) {
  44100. var d = l[h];
  44101. c.push(d.clone())
  44102. }
  44103. this.faceVertexUvs[i].push(c)
  44104. }
  44105. }
  44106. return this
  44107. },
  44108. dispose: function() {
  44109. this.dispatchEvent({
  44110. type: "dispose"
  44111. })
  44112. }
  44113. },
  44114. n.EventDispatcher.prototype.apply(n.Geometry.prototype),
  44115. n.GeometryIdCount = 0,
  44116. n.DirectGeometry = function() {
  44117. Object.defineProperty(this, "id", {
  44118. value: n.GeometryIdCount++
  44119. }),
  44120. this.uuid = n.Math.generateUUID(),
  44121. this.name = "",
  44122. this.type = "DirectGeometry",
  44123. this.indices = [],
  44124. this.vertices = [],
  44125. this.normals = [],
  44126. this.colors = [],
  44127. this.uvs = [],
  44128. this.uvs2 = [],
  44129. this.groups = [],
  44130. this.morphTargets = {},
  44131. this.skinWeights = [],
  44132. this.skinIndices = [],
  44133. this.boundingBox = null,
  44134. this.boundingSphere = null,
  44135. this.verticesNeedUpdate = !1,
  44136. this.normalsNeedUpdate = !1,
  44137. this.colorsNeedUpdate = !1,
  44138. this.uvsNeedUpdate = !1,
  44139. this.groupsNeedUpdate = !1
  44140. }
  44141. ,
  44142. n.DirectGeometry.prototype = {
  44143. constructor: n.DirectGeometry,
  44144. computeBoundingBox: n.Geometry.prototype.computeBoundingBox,
  44145. computeBoundingSphere: n.Geometry.prototype.computeBoundingSphere,
  44146. computeFaceNormals: function() {
  44147. console.warn("THREE.DirectGeometry: computeFaceNormals() is not a method of this type of geometry.")
  44148. },
  44149. computeVertexNormals: function() {
  44150. console.warn("THREE.DirectGeometry: computeVertexNormals() is not a method of this type of geometry.")
  44151. },
  44152. computeGroups: function(e) {
  44153. for (var t, i, n = [], r = e.faces, o = 0; o < r.length; o++) {
  44154. var a = r[o];
  44155. a.materialIndex !== i && (i = a.materialIndex,
  44156. void 0 !== t && (t.count = 3 * o - t.start,
  44157. n.push(t)),
  44158. t = {
  44159. start: 3 * o,
  44160. materialIndex: i
  44161. })
  44162. }
  44163. void 0 !== t && (t.count = 3 * o - t.start,
  44164. n.push(t)),
  44165. this.groups = n
  44166. },
  44167. fromGeometry: function(e) {
  44168. 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;
  44169. if (c > 0) {
  44170. t = [];
  44171. for (var h = 0; h < c; h++)
  44172. t[h] = [];
  44173. this.morphTargets.position = t
  44174. }
  44175. var u, d = e.morphNormals, p = d.length;
  44176. if (p > 0) {
  44177. u = [];
  44178. for (var h = 0; h < p; h++)
  44179. u[h] = [];
  44180. this.morphTargets.normal = u
  44181. }
  44182. for (var f = e.skinIndices, g = e.skinWeights, m = f.length === r.length, v = g.length === r.length, h = 0; h < i.length; h++) {
  44183. var A = i[h];
  44184. this.vertices.push(r[A.a], r[A.b], r[A.c]);
  44185. var y = A.vertexNormals;
  44186. if (3 === y.length)
  44187. this.normals.push(y[0], y[1], y[2]);
  44188. else {
  44189. var C = A.normal;
  44190. this.normals.push(C, C, C)
  44191. }
  44192. var I = A.vertexColors;
  44193. if (3 === I.length)
  44194. this.colors.push(I[0], I[1], I[2]);
  44195. else {
  44196. var E = A.color;
  44197. this.colors.push(E, E, E)
  44198. }
  44199. if (a === !0) {
  44200. var b = o[0][h];
  44201. void 0 !== b ? this.uvs.push(b[0], b[1], b[2]) : (console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ", h),
  44202. this.uvs.push(new n.Vector2, new n.Vector2, new n.Vector2))
  44203. }
  44204. if (s === !0) {
  44205. var b = o[1][h];
  44206. void 0 !== b ? this.uvs2.push(b[0], b[1], b[2]) : (console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ", h),
  44207. this.uvs2.push(new n.Vector2, new n.Vector2, new n.Vector2))
  44208. }
  44209. for (var w = 0; w < c; w++) {
  44210. var _ = l[w].vertices;
  44211. t[w].push(_[A.a], _[A.b], _[A.c])
  44212. }
  44213. for (var w = 0; w < p; w++) {
  44214. var T = d[w].vertexNormals[h];
  44215. u[w].push(T.a, T.b, T.c)
  44216. }
  44217. m && this.skinIndices.push(f[A.a], f[A.b], f[A.c]),
  44218. v && this.skinWeights.push(g[A.a], g[A.b], g[A.c])
  44219. }
  44220. return this.computeGroups(e),
  44221. this.verticesNeedUpdate = e.verticesNeedUpdate,
  44222. this.normalsNeedUpdate = e.normalsNeedUpdate,
  44223. this.colorsNeedUpdate = e.colorsNeedUpdate,
  44224. this.uvsNeedUpdate = e.uvsNeedUpdate,
  44225. this.groupsNeedUpdate = e.groupsNeedUpdate,
  44226. this
  44227. },
  44228. dispose: function() {
  44229. this.dispatchEvent({
  44230. type: "dispose"
  44231. })
  44232. }
  44233. },
  44234. n.EventDispatcher.prototype.apply(n.DirectGeometry.prototype),
  44235. n.BufferGeometry = function() {
  44236. Object.defineProperty(this, "id", {
  44237. value: n.GeometryIdCount++
  44238. }),
  44239. this.uuid = n.Math.generateUUID(),
  44240. this.name = "",
  44241. this.type = "BufferGeometry",
  44242. this.index = null,
  44243. this.attributes = {},
  44244. this.morphAttributes = {},
  44245. this.groups = [],
  44246. this.boundingBox = null,
  44247. this.boundingSphere = null,
  44248. this.drawRange = {
  44249. start: 0,
  44250. count: 1 / 0
  44251. }
  44252. }
  44253. ,
  44254. n.BufferGeometry.prototype = {
  44255. constructor: n.BufferGeometry,
  44256. getIndex: function() {
  44257. return this.index
  44258. },
  44259. setIndex: function(e) {
  44260. this.index = e
  44261. },
  44262. addAttribute: function(e, t) {
  44263. return t instanceof n.BufferAttribute == !1 && t instanceof n.InterleavedBufferAttribute == !1 ? (console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),
  44264. void this.addAttribute(e, new n.BufferAttribute(arguments[1],arguments[2]))) : "index" === e ? (console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),
  44265. void this.setIndex(t)) : (this.attributes[e] = t,
  44266. this)
  44267. },
  44268. getAttribute: function(e) {
  44269. return this.attributes[e]
  44270. },
  44271. removeAttribute: function(e) {
  44272. return delete this.attributes[e],
  44273. this
  44274. },
  44275. addGroup: function(e, t, i) {
  44276. this.groups.push({
  44277. start: e,
  44278. count: t,
  44279. materialIndex: void 0 !== i ? i : 0
  44280. })
  44281. },
  44282. clearGroups: function() {
  44283. this.groups = []
  44284. },
  44285. setDrawRange: function(e, t) {
  44286. this.drawRange.start = e,
  44287. this.drawRange.count = t
  44288. },
  44289. applyMatrix: function(e) {
  44290. var t = this.attributes.position;
  44291. void 0 !== t && (e.applyToVector3Array(t.array),
  44292. t.needsUpdate = !0);
  44293. var i = this.attributes.normal;
  44294. if (void 0 !== i) {
  44295. var r = (new n.Matrix3).getNormalMatrix(e);
  44296. r.applyToVector3Array(i.array),
  44297. i.needsUpdate = !0
  44298. }
  44299. return null !== this.boundingBox && this.computeBoundingBox(),
  44300. null !== this.boundingSphere && this.computeBoundingSphere(),
  44301. this
  44302. },
  44303. rotateX: function() {
  44304. var e;
  44305. return function(t) {
  44306. return void 0 === e && (e = new n.Matrix4),
  44307. e.makeRotationX(t),
  44308. this.applyMatrix(e),
  44309. this
  44310. }
  44311. }(),
  44312. rotateY: function() {
  44313. var e;
  44314. return function(t) {
  44315. return void 0 === e && (e = new n.Matrix4),
  44316. e.makeRotationY(t),
  44317. this.applyMatrix(e),
  44318. this
  44319. }
  44320. }(),
  44321. rotateZ: function() {
  44322. var e;
  44323. return function(t) {
  44324. return void 0 === e && (e = new n.Matrix4),
  44325. e.makeRotationZ(t),
  44326. this.applyMatrix(e),
  44327. this
  44328. }
  44329. }(),
  44330. translate: function() {
  44331. var e;
  44332. return function(t, i, r) {
  44333. return void 0 === e && (e = new n.Matrix4),
  44334. e.makeTranslation(t, i, r),
  44335. this.applyMatrix(e),
  44336. this
  44337. }
  44338. }(),
  44339. scale: function() {
  44340. var e;
  44341. return function(t, i, r) {
  44342. return void 0 === e && (e = new n.Matrix4),
  44343. e.makeScale(t, i, r),
  44344. this.applyMatrix(e),
  44345. this
  44346. }
  44347. }(),
  44348. lookAt: function() {
  44349. var e;
  44350. return function(t) {
  44351. void 0 === e && (e = new n.Object3D),
  44352. e.lookAt(t),
  44353. e.updateMatrix(),
  44354. this.applyMatrix(e.matrix)
  44355. }
  44356. }(),
  44357. center: function() {
  44358. this.computeBoundingBox();
  44359. var e = this.boundingBox.center().negate();
  44360. return this.translate(e.x, e.y, e.z),
  44361. e
  44362. },
  44363. setFromObject: function(e) {
  44364. var t = e.geometry;
  44365. if (e instanceof n.Points || e instanceof n.Line) {
  44366. var i = new n.Float32Attribute(3 * t.vertices.length,3)
  44367. , r = new n.Float32Attribute(3 * t.colors.length,3);
  44368. if (this.addAttribute("position", i.copyVector3sArray(t.vertices)),
  44369. this.addAttribute("color", r.copyColorsArray(t.colors)),
  44370. t.lineDistances && t.lineDistances.length === t.vertices.length) {
  44371. var o = new n.Float32Attribute(t.lineDistances.length,1);
  44372. this.addAttribute("lineDistance", o.copyArray(t.lineDistances))
  44373. }
  44374. null !== t.boundingSphere && (this.boundingSphere = t.boundingSphere.clone()),
  44375. null !== t.boundingBox && (this.boundingBox = t.boundingBox.clone())
  44376. } else
  44377. e instanceof n.Mesh && t instanceof n.Geometry && this.fromGeometry(t);
  44378. return this
  44379. },
  44380. updateFromObject: function(e) {
  44381. var t = e.geometry;
  44382. if (e instanceof n.Mesh) {
  44383. var i = t.__directGeometry;
  44384. if (void 0 === i)
  44385. return this.fromGeometry(t);
  44386. i.verticesNeedUpdate = t.verticesNeedUpdate,
  44387. i.normalsNeedUpdate = t.normalsNeedUpdate,
  44388. i.colorsNeedUpdate = t.colorsNeedUpdate,
  44389. i.uvsNeedUpdate = t.uvsNeedUpdate,
  44390. i.groupsNeedUpdate = t.groupsNeedUpdate,
  44391. t.verticesNeedUpdate = !1,
  44392. t.normalsNeedUpdate = !1,
  44393. t.colorsNeedUpdate = !1,
  44394. t.uvsNeedUpdate = !1,
  44395. t.groupsNeedUpdate = !1,
  44396. t = i
  44397. }
  44398. if (t.verticesNeedUpdate === !0) {
  44399. var r = this.attributes.position;
  44400. void 0 !== r && (r.copyVector3sArray(t.vertices),
  44401. r.needsUpdate = !0),
  44402. t.verticesNeedUpdate = !1
  44403. }
  44404. if (t.normalsNeedUpdate === !0) {
  44405. var r = this.attributes.normal;
  44406. void 0 !== r && (r.copyVector3sArray(t.normals),
  44407. r.needsUpdate = !0),
  44408. t.normalsNeedUpdate = !1
  44409. }
  44410. if (t.colorsNeedUpdate === !0) {
  44411. var r = this.attributes.color;
  44412. void 0 !== r && (r.copyColorsArray(t.colors),
  44413. r.needsUpdate = !0),
  44414. t.colorsNeedUpdate = !1
  44415. }
  44416. if (t.uvsNeedUpdate) {
  44417. var r = this.attributes.uv;
  44418. void 0 !== r && (r.copyVector2sArray(t.uvs),
  44419. r.needsUpdate = !0),
  44420. t.uvsNeedUpdate = !1
  44421. }
  44422. if (t.lineDistancesNeedUpdate) {
  44423. var r = this.attributes.lineDistance;
  44424. void 0 !== r && (r.copyArray(t.lineDistances),
  44425. r.needsUpdate = !0),
  44426. t.lineDistancesNeedUpdate = !1
  44427. }
  44428. return t.groupsNeedUpdate && (t.computeGroups(e.geometry),
  44429. this.groups = t.groups,
  44430. t.groupsNeedUpdate = !1),
  44431. this
  44432. },
  44433. fromGeometry: function(e) {
  44434. return e.__directGeometry = (new n.DirectGeometry).fromGeometry(e),
  44435. this.fromDirectGeometry(e.__directGeometry)
  44436. },
  44437. fromDirectGeometry: function(e) {
  44438. var t = new Float32Array(3 * e.vertices.length);
  44439. if (this.addAttribute("position", new n.BufferAttribute(t,3).copyVector3sArray(e.vertices)),
  44440. e.normals.length > 0) {
  44441. var i = new Float32Array(3 * e.normals.length);
  44442. this.addAttribute("normal", new n.BufferAttribute(i,3).copyVector3sArray(e.normals))
  44443. }
  44444. if (e.colors.length > 0) {
  44445. var r = new Float32Array(3 * e.colors.length);
  44446. this.addAttribute("color", new n.BufferAttribute(r,3).copyColorsArray(e.colors))
  44447. }
  44448. if (e.uvs.length > 0) {
  44449. var o = new Float32Array(2 * e.uvs.length);
  44450. this.addAttribute("uv", new n.BufferAttribute(o,2).copyVector2sArray(e.uvs))
  44451. }
  44452. if (e.uvs2.length > 0) {
  44453. var a = new Float32Array(2 * e.uvs2.length);
  44454. this.addAttribute("uv2", new n.BufferAttribute(a,2).copyVector2sArray(e.uvs2))
  44455. }
  44456. if (e.indices.length > 0) {
  44457. var s = e.vertices.length > 65535 ? Uint32Array : Uint16Array
  44458. , l = new s(3 * e.indices.length);
  44459. this.setIndex(new n.BufferAttribute(l,1).copyIndicesArray(e.indices))
  44460. }
  44461. this.groups = e.groups;
  44462. for (var c in e.morphTargets) {
  44463. for (var h = [], u = e.morphTargets[c], d = 0, p = u.length; d < p; d++) {
  44464. var f = u[d]
  44465. , g = new n.Float32Attribute(3 * f.length,3);
  44466. h.push(g.copyVector3sArray(f))
  44467. }
  44468. this.morphAttributes[c] = h
  44469. }
  44470. if (e.skinIndices.length > 0) {
  44471. var m = new n.Float32Attribute(4 * e.skinIndices.length,4);
  44472. this.addAttribute("skinIndex", m.copyVector4sArray(e.skinIndices))
  44473. }
  44474. if (e.skinWeights.length > 0) {
  44475. var v = new n.Float32Attribute(4 * e.skinWeights.length,4);
  44476. this.addAttribute("skinWeight", v.copyVector4sArray(e.skinWeights))
  44477. }
  44478. return null !== e.boundingSphere && (this.boundingSphere = e.boundingSphere.clone()),
  44479. null !== e.boundingBox && (this.boundingBox = e.boundingBox.clone()),
  44480. this
  44481. },
  44482. computeBoundingBox: function() {
  44483. new n.Vector3;
  44484. return function() {
  44485. null === this.boundingBox && (this.boundingBox = new n.Box3);
  44486. var e = this.attributes.position.array;
  44487. e && this.boundingBox.setFromArray(e),
  44488. void 0 !== e && 0 !== e.length || (this.boundingBox.min.set(0, 0, 0),
  44489. this.boundingBox.max.set(0, 0, 0)),
  44490. (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)
  44491. }
  44492. }(),
  44493. computeBoundingSphere: function() {
  44494. var e = new n.Box3
  44495. , t = new n.Vector3;
  44496. return function() {
  44497. null === this.boundingSphere && (this.boundingSphere = new n.Sphere);
  44498. var i = this.attributes.position.array;
  44499. if (i) {
  44500. var r = this.boundingSphere.center;
  44501. e.setFromArray(i),
  44502. e.center(r);
  44503. for (var o = 0, a = 0, s = i.length; a < s; a += 3)
  44504. t.fromArray(i, a),
  44505. o = Math.max(o, r.distanceToSquared(t));
  44506. this.boundingSphere.radius = Math.sqrt(o),
  44507. isNaN(this.boundingSphere.radius) && console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.', this)
  44508. }
  44509. }
  44510. }(),
  44511. computeFaceNormals: function() {},
  44512. computeVertexNormals: function() {
  44513. var e = this.index
  44514. , t = this.attributes
  44515. , i = this.groups;
  44516. if (t.position) {
  44517. var r = t.position.array;
  44518. if (void 0 === t.normal)
  44519. this.addAttribute("normal", new n.BufferAttribute(new Float32Array(r.length),3));
  44520. else
  44521. for (var o = t.normal.array, a = 0, s = o.length; a < s; a++)
  44522. o[a] = 0;
  44523. 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;
  44524. if (e) {
  44525. var v = e.array;
  44526. 0 === i.length && this.addGroup(0, v.length);
  44527. for (var A = 0, y = i.length; A < y; ++A)
  44528. for (var C = i[A], I = C.start, E = C.count, a = I, s = I + E; a < s; a += 3)
  44529. l = 3 * v[a + 0],
  44530. c = 3 * v[a + 1],
  44531. h = 3 * v[a + 2],
  44532. d.fromArray(r, l),
  44533. p.fromArray(r, c),
  44534. f.fromArray(r, h),
  44535. g.subVectors(f, p),
  44536. m.subVectors(d, p),
  44537. g.cross(m),
  44538. u[l] += g.x,
  44539. u[l + 1] += g.y,
  44540. u[l + 2] += g.z,
  44541. u[c] += g.x,
  44542. u[c + 1] += g.y,
  44543. u[c + 2] += g.z,
  44544. u[h] += g.x,
  44545. u[h + 1] += g.y,
  44546. u[h + 2] += g.z
  44547. } else
  44548. for (var a = 0, s = r.length; a < s; a += 9)
  44549. d.fromArray(r, a),
  44550. p.fromArray(r, a + 3),
  44551. f.fromArray(r, a + 6),
  44552. g.subVectors(f, p),
  44553. m.subVectors(d, p),
  44554. g.cross(m),
  44555. u[a] = g.x,
  44556. u[a + 1] = g.y,
  44557. u[a + 2] = g.z,
  44558. u[a + 3] = g.x,
  44559. u[a + 4] = g.y,
  44560. u[a + 5] = g.z,
  44561. u[a + 6] = g.x,
  44562. u[a + 7] = g.y,
  44563. u[a + 8] = g.z;
  44564. this.normalizeNormals(),
  44565. t.normal.needsUpdate = !0
  44566. }
  44567. },
  44568. merge: function(e, t) {
  44569. if (e instanceof n.BufferGeometry == !1)
  44570. return void console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.", e);
  44571. void 0 === t && (t = 0);
  44572. var i = this.attributes;
  44573. for (var r in i)
  44574. if (void 0 !== e.attributes[r])
  44575. 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++,
  44576. u++)
  44577. a[u] = l[h];
  44578. return this
  44579. },
  44580. normalizeNormals: function() {
  44581. for (var e, t, i, n, r = this.attributes.normal.array, o = 0, a = r.length; o < a; o += 3)
  44582. e = r[o],
  44583. t = r[o + 1],
  44584. i = r[o + 2],
  44585. n = 1 / Math.sqrt(e * e + t * t + i * i),
  44586. r[o] *= n,
  44587. r[o + 1] *= n,
  44588. r[o + 2] *= n
  44589. },
  44590. toNonIndexed: function() {
  44591. if (null === this.index)
  44592. return console.warn("THREE.BufferGeometry.toNonIndexed(): Geometry is already non-indexed."),
  44593. this;
  44594. var e = new n.BufferGeometry
  44595. , t = this.index.array
  44596. , i = this.attributes;
  44597. for (var r in i) {
  44598. 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++) {
  44599. c = t[u] * s;
  44600. for (var p = 0; p < s; p++)
  44601. l[h++] = a[c++]
  44602. }
  44603. e.addAttribute(r, new n.BufferAttribute(l,s))
  44604. }
  44605. return e
  44606. },
  44607. toJSON: function() {
  44608. var e = {
  44609. metadata: {
  44610. version: 4.4,
  44611. type: "BufferGeometry",
  44612. generator: "BufferGeometry.toJSON"
  44613. }
  44614. };
  44615. if (e.uuid = this.uuid,
  44616. e.type = this.type,
  44617. "" !== this.name && (e.name = this.name),
  44618. void 0 !== this.parameters) {
  44619. var t = this.parameters;
  44620. for (var i in t)
  44621. void 0 !== t[i] && (e[i] = t[i]);
  44622. return e
  44623. }
  44624. e.data = {
  44625. attributes: {}
  44626. };
  44627. var n = this.index;
  44628. if (null !== n) {
  44629. var r = Array.prototype.slice.call(n.array);
  44630. e.data.index = {
  44631. type: n.array.constructor.name,
  44632. array: r
  44633. }
  44634. }
  44635. var o = this.attributes;
  44636. for (var i in o) {
  44637. var a = o[i]
  44638. , r = Array.prototype.slice.call(a.array);
  44639. e.data.attributes[i] = {
  44640. itemSize: a.itemSize,
  44641. type: a.array.constructor.name,
  44642. array: r
  44643. }
  44644. }
  44645. var s = this.groups;
  44646. s.length > 0 && (e.data.groups = JSON.parse(JSON.stringify(s)));
  44647. var l = this.boundingSphere;
  44648. return null !== l && (e.data.boundingSphere = {
  44649. center: l.center.toArray(),
  44650. radius: l.radius
  44651. }),
  44652. e
  44653. },
  44654. clone: function() {
  44655. return (new n.BufferGeometry).copy(this)
  44656. },
  44657. copy: function(e) {
  44658. var t = e.index;
  44659. null !== t && this.setIndex(t.clone());
  44660. var i = e.attributes;
  44661. for (var n in i) {
  44662. var r = i[n];
  44663. this.addAttribute(n, r.clone())
  44664. }
  44665. for (var o = e.groups, a = 0, s = o.length; a < s; a++) {
  44666. var l = o[a];
  44667. this.addGroup(l.start, l.count)
  44668. }
  44669. return this
  44670. },
  44671. dispose: function() {
  44672. this.dispatchEvent({
  44673. type: "dispose"
  44674. })
  44675. }
  44676. },
  44677. n.EventDispatcher.prototype.apply(n.BufferGeometry.prototype),
  44678. n.BufferGeometry.MaxIndex = 65535,
  44679. n.InstancedBufferGeometry = function() {
  44680. n.BufferGeometry.call(this),
  44681. this.type = "InstancedBufferGeometry",
  44682. this.maxInstancedCount = void 0
  44683. }
  44684. ,
  44685. n.InstancedBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  44686. n.InstancedBufferGeometry.prototype.constructor = n.InstancedBufferGeometry,
  44687. n.InstancedBufferGeometry.prototype.addGroup = function(e, t, i) {
  44688. this.groups.push({
  44689. start: e,
  44690. count: t,
  44691. instances: i
  44692. })
  44693. }
  44694. ,
  44695. n.InstancedBufferGeometry.prototype.copy = function(e) {
  44696. var t = e.index;
  44697. null !== t && this.setIndex(t.clone());
  44698. var i = e.attributes;
  44699. for (var n in i) {
  44700. var r = i[n];
  44701. this.addAttribute(n, r.clone())
  44702. }
  44703. for (var o = e.groups, a = 0, s = o.length; a < s; a++) {
  44704. var l = o[a];
  44705. this.addGroup(l.start, l.count, l.instances)
  44706. }
  44707. return this
  44708. }
  44709. ,
  44710. n.EventDispatcher.prototype.apply(n.InstancedBufferGeometry.prototype),
  44711. n.Uniform = function(e, t) {
  44712. this.type = e,
  44713. this.value = t,
  44714. this.dynamic = !1
  44715. }
  44716. ,
  44717. n.Uniform.prototype = {
  44718. constructor: n.Uniform,
  44719. onUpdate: function(e) {
  44720. return this.dynamic = !0,
  44721. this.onUpdateCallback = e,
  44722. this
  44723. }
  44724. },
  44725. n.AnimationClip = function(e, t, i) {
  44726. this.name = e || n.Math.generateUUID(),
  44727. this.tracks = i,
  44728. this.duration = void 0 !== t ? t : -1,
  44729. this.duration < 0 && this.resetDuration(),
  44730. this.trim(),
  44731. this.optimize()
  44732. }
  44733. ,
  44734. n.AnimationClip.prototype = {
  44735. constructor: n.AnimationClip,
  44736. resetDuration: function() {
  44737. for (var e = this.tracks, t = 0, i = 0, n = e.length; i !== n; ++i) {
  44738. var r = this.tracks[i];
  44739. t = Math.max(t, r.times[r.times.length - 1])
  44740. }
  44741. this.duration = t
  44742. },
  44743. trim: function() {
  44744. for (var e = 0; e < this.tracks.length; e++)
  44745. this.tracks[e].trim(0, this.duration);
  44746. return this
  44747. },
  44748. optimize: function() {
  44749. for (var e = 0; e < this.tracks.length; e++)
  44750. this.tracks[e].optimize();
  44751. return this
  44752. }
  44753. },
  44754. Object.assign(n.AnimationClip, {
  44755. parse: function(e) {
  44756. for (var t = [], i = e.tracks, r = 1 / (e.fps || 1), o = 0, a = i.length; o !== a; ++o)
  44757. t.push(n.KeyframeTrack.parse(i[o]).scale(r));
  44758. return new n.AnimationClip(e.name,e.duration,t)
  44759. },
  44760. toJSON: function(e) {
  44761. for (var t = [], i = e.tracks, r = {
  44762. name: e.name,
  44763. duration: e.duration,
  44764. tracks: t
  44765. }, o = 0, a = i.length; o !== a; ++o)
  44766. t.push(n.KeyframeTrack.toJSON(i[o]));
  44767. return r
  44768. },
  44769. CreateFromMorphTargetSequence: function(e, t, i) {
  44770. for (var r = t.length, o = [], a = 0; a < r; a++) {
  44771. var s = []
  44772. , l = [];
  44773. s.push((a + r - 1) % r, a, (a + 1) % r),
  44774. l.push(0, 1, 0);
  44775. var c = n.AnimationUtils.getKeyframeOrder(s);
  44776. s = n.AnimationUtils.sortedArray(s, 1, c),
  44777. l = n.AnimationUtils.sortedArray(l, 1, c),
  44778. 0 === s[0] && (s.push(r),
  44779. l.push(l[0])),
  44780. o.push(new n.NumberKeyframeTrack(".morphTargetInfluences[" + t[a].name + "]",s,l).scale(1 / i))
  44781. }
  44782. return new n.AnimationClip(e,-1,o)
  44783. },
  44784. findByName: function(e, t) {
  44785. for (var i = 0; i < e.length; i++)
  44786. if (e[i].name === t)
  44787. return e[i];
  44788. return null
  44789. },
  44790. CreateClipsFromMorphTargetSequences: function(e, t) {
  44791. for (var i = {}, r = /^([\w-]*?)([\d]+)$/, o = 0, a = e.length; o < a; o++) {
  44792. var s = e[o]
  44793. , l = s.name.match(r);
  44794. if (l && l.length > 1) {
  44795. var c = l[1]
  44796. , h = i[c];
  44797. h || (i[c] = h = []),
  44798. h.push(s)
  44799. }
  44800. }
  44801. var u = [];
  44802. for (var c in i)
  44803. u.push(n.AnimationClip.CreateFromMorphTargetSequence(c, i[c], t));
  44804. return u
  44805. },
  44806. parseAnimation: function(e, t, i) {
  44807. if (!e)
  44808. return console.error(" no animation in JSONLoader data"),
  44809. null;
  44810. for (var r = function(e, t, i, r, o) {
  44811. if (0 !== i.length) {
  44812. var a = []
  44813. , s = [];
  44814. n.AnimationUtils.flattenJSON(i, a, s, r),
  44815. 0 !== a.length && o.push(new e(t,a,s))
  44816. }
  44817. }, o = [], a = e.name || "default", s = e.length || -1, l = e.fps || 30, c = e.hierarchy || [], h = 0; h < c.length; h++) {
  44818. var u = c[h].keys;
  44819. if (u && 0 != u.length)
  44820. if (u[0].morphTargets) {
  44821. for (var d = {}, p = 0; p < u.length; p++)
  44822. if (u[p].morphTargets)
  44823. for (var f = 0; f < u[p].morphTargets.length; f++)
  44824. d[u[p].morphTargets[f]] = -1;
  44825. for (var g in d) {
  44826. for (var m = [], v = [], f = 0; f !== u[p].morphTargets.length; ++f) {
  44827. var A = u[p];
  44828. m.push(A.time),
  44829. v.push(A.morphTarget === g ? 1 : 0)
  44830. }
  44831. o.push(new n.NumberKeyframeTrack(".morphTargetInfluence[" + g + "]",m,v))
  44832. }
  44833. s = d.length * (l || 1)
  44834. } else {
  44835. var y = ".bones[" + t[h].name + "]";
  44836. r(n.VectorKeyframeTrack, y + ".position", u, "pos", o),
  44837. r(n.QuaternionKeyframeTrack, y + ".quaternion", u, "rot", o),
  44838. r(n.VectorKeyframeTrack, y + ".scale", u, "scl", o)
  44839. }
  44840. }
  44841. if (0 === o.length)
  44842. return null;
  44843. var C = new n.AnimationClip(a,s,o);
  44844. return C
  44845. }
  44846. }),
  44847. n.AnimationMixer = function(e) {
  44848. this._root = e,
  44849. this._initMemoryManager(),
  44850. this._accuIndex = 0,
  44851. this.time = 0,
  44852. this.timeScale = 1
  44853. }
  44854. ,
  44855. n.AnimationMixer.prototype = {
  44856. constructor: n.AnimationMixer,
  44857. clipAction: function(e, t) {
  44858. 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];
  44859. if (void 0 !== l) {
  44860. var c = l.actionByRoot[o];
  44861. if (void 0 !== c)
  44862. return c;
  44863. if (i = l.knownActions[0],
  44864. s = i._clip,
  44865. e !== a && e !== s)
  44866. throw new Error("Different clips with the same name detected!")
  44867. }
  44868. if (null === s)
  44869. return null;
  44870. var h = new n.AnimationMixer._Action(this,s,t);
  44871. return this._bindAction(h, i),
  44872. this._addInactiveAction(h, a, o),
  44873. h
  44874. },
  44875. existingAction: function(e, t) {
  44876. var i = t || this._root
  44877. , n = i.uuid
  44878. , r = "string" == typeof e ? e : e.name
  44879. , o = this._actionsByClip[r];
  44880. return void 0 !== o ? o.actionByRoot[n] || null : null
  44881. },
  44882. stopAllAction: function() {
  44883. var e = this._actions
  44884. , t = this._nActiveActions
  44885. , i = this._bindings
  44886. , n = this._nActiveBindings;
  44887. this._nActiveActions = 0,
  44888. this._nActiveBindings = 0;
  44889. for (var r = 0; r !== t; ++r)
  44890. e[r].reset();
  44891. for (var r = 0; r !== n; ++r)
  44892. i[r].useCount = 0;
  44893. return this
  44894. },
  44895. update: function(e) {
  44896. e *= this.timeScale;
  44897. 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) {
  44898. var s = t[a];
  44899. s.enabled && s._update(n, e, r, o)
  44900. }
  44901. for (var l = this._bindings, c = this._nActiveBindings, a = 0; a !== c; ++a)
  44902. l[a].apply(o);
  44903. return this
  44904. },
  44905. getRoot: function() {
  44906. return this._root
  44907. },
  44908. uncacheClip: function(e) {
  44909. var t = this._actions
  44910. , i = e.name
  44911. , n = this._actionsByClip
  44912. , r = n[i];
  44913. if (void 0 !== r) {
  44914. for (var o = r.knownActions, a = 0, s = o.length; a !== s; ++a) {
  44915. var l = o[a];
  44916. this._deactivateAction(l);
  44917. var c = l._cacheIndex
  44918. , h = t[t.length - 1];
  44919. l._cacheIndex = null,
  44920. l._byClipCacheIndex = null,
  44921. h._cacheIndex = c,
  44922. t[c] = h,
  44923. t.pop(),
  44924. this._removeInactiveBindingsForAction(l)
  44925. }
  44926. delete n[i]
  44927. }
  44928. },
  44929. uncacheRoot: function(e) {
  44930. var t = e.uuid
  44931. , i = this._actionsByClip;
  44932. for (var n in i) {
  44933. var r = i[n].actionByRoot
  44934. , o = r[t];
  44935. void 0 !== o && (this._deactivateAction(o),
  44936. this._removeInactiveAction(o))
  44937. }
  44938. var a = this._bindingsByRootAndName
  44939. , s = a[t];
  44940. if (void 0 !== s)
  44941. for (var l in s) {
  44942. var c = s[l];
  44943. c.restoreOriginalState(),
  44944. this._removeInactiveBinding(c)
  44945. }
  44946. },
  44947. uncacheAction: function(e, t) {
  44948. var i = this.existingAction(e, t);
  44949. null !== i && (this._deactivateAction(i),
  44950. this._removeInactiveAction(i))
  44951. }
  44952. },
  44953. n.EventDispatcher.prototype.apply(n.AnimationMixer.prototype),
  44954. n.AnimationMixer._Action = function(e, t, i) {
  44955. this._mixer = e,
  44956. this._clip = t,
  44957. this._localRoot = i || null;
  44958. for (var r = t.tracks, o = r.length, a = new Array(o), s = {
  44959. endingStart: n.ZeroCurvatureEnding,
  44960. endingEnd: n.ZeroCurvatureEnding
  44961. }, l = 0; l !== o; ++l) {
  44962. var c = r[l].createInterpolant(null);
  44963. a[l] = c,
  44964. c.settings = s
  44965. }
  44966. this._interpolantSettings = s,
  44967. this._interpolants = a,
  44968. this._propertyBindings = new Array(o),
  44969. this._cacheIndex = null,
  44970. this._byClipCacheIndex = null,
  44971. this._timeScaleInterpolant = null,
  44972. this._weightInterpolant = null,
  44973. this.loop = n.LoopRepeat,
  44974. this._loopCount = -1,
  44975. this._startTime = null,
  44976. this.time = 0,
  44977. this.timeScale = 1,
  44978. this._effectiveTimeScale = 1,
  44979. this.weight = 1,
  44980. this._effectiveWeight = 1,
  44981. this.repetitions = 1 / 0,
  44982. this.paused = !1,
  44983. this.enabled = !0,
  44984. this.clampWhenFinished = !1,
  44985. this.zeroSlopeAtStart = !0,
  44986. this.zeroSlopeAtEnd = !0
  44987. }
  44988. ,
  44989. n.AnimationMixer._Action.prototype = {
  44990. constructor: n.AnimationMixer._Action,
  44991. play: function() {
  44992. return this._mixer._activateAction(this),
  44993. this
  44994. },
  44995. stop: function() {
  44996. return this._mixer._deactivateAction(this),
  44997. this.reset()
  44998. },
  44999. reset: function() {
  45000. return this.paused = !1,
  45001. this.enabled = !0,
  45002. this.time = 0,
  45003. this._loopCount = -1,
  45004. this._startTime = null,
  45005. this.stopFading().stopWarping()
  45006. },
  45007. isRunning: function() {
  45008. this._startTime;
  45009. return this.enabled && !this.paused && 0 !== this.timeScale && null === this._startTime && this._mixer._isActiveAction(this)
  45010. },
  45011. isScheduled: function() {
  45012. return this._mixer._isActiveAction(this)
  45013. },
  45014. startAt: function(e) {
  45015. return this._startTime = e,
  45016. this
  45017. },
  45018. setLoop: function(e, t) {
  45019. return this.loop = e,
  45020. this.repetitions = t,
  45021. this
  45022. },
  45023. setEffectiveWeight: function(e) {
  45024. return this.weight = e,
  45025. this._effectiveWeight = this.enabled ? e : 0,
  45026. this.stopFading()
  45027. },
  45028. getEffectiveWeight: function() {
  45029. return this._effectiveWeight
  45030. },
  45031. fadeIn: function(e) {
  45032. return this._scheduleFading(e, 0, 1)
  45033. },
  45034. fadeOut: function(e) {
  45035. return this._scheduleFading(e, 1, 0)
  45036. },
  45037. crossFadeFrom: function(e, t, i) {
  45038. this._mixer;
  45039. if (e.fadeOut(t),
  45040. this.fadeIn(t),
  45041. i) {
  45042. var n = this._clip.duration
  45043. , r = e._clip.duration
  45044. , o = r / n
  45045. , a = n / r;
  45046. e.warp(1, o, t),
  45047. this.warp(a, 1, t)
  45048. }
  45049. return this
  45050. },
  45051. crossFadeTo: function(e, t, i) {
  45052. return e.crossFadeFrom(this, t, i)
  45053. },
  45054. stopFading: function() {
  45055. var e = this._weightInterpolant;
  45056. return null !== e && (this._weightInterpolant = null,
  45057. this._mixer._takeBackControlInterpolant(e)),
  45058. this
  45059. },
  45060. setEffectiveTimeScale: function(e) {
  45061. return this.timeScale = e,
  45062. this._effectiveTimeScale = this.paused ? 0 : e,
  45063. this.stopWarping()
  45064. },
  45065. getEffectiveTimeScale: function() {
  45066. return this._effectiveTimeScale
  45067. },
  45068. setDuration: function(e) {
  45069. return this.timeScale = this._clip.duration / e,
  45070. this.stopWarping()
  45071. },
  45072. syncWith: function(e) {
  45073. return this.time = e.time,
  45074. this.timeScale = e.timeScale,
  45075. this.stopWarping()
  45076. },
  45077. halt: function(e) {
  45078. return this.warp(this._currentTimeScale, 0, e)
  45079. },
  45080. warp: function(e, t, i) {
  45081. var n = this._mixer
  45082. , r = n.time
  45083. , o = this._timeScaleInterpolant
  45084. , a = this.timeScale;
  45085. null === o && (o = n._lendControlInterpolant(),
  45086. this._timeScaleInterpolant = o);
  45087. var s = o.parameterPositions
  45088. , l = o.sampleValues;
  45089. return s[0] = r,
  45090. s[1] = r + i,
  45091. l[0] = e / a,
  45092. l[1] = t / a,
  45093. this
  45094. },
  45095. stopWarping: function() {
  45096. var e = this._timeScaleInterpolant;
  45097. return null !== e && (this._timeScaleInterpolant = null,
  45098. this._mixer._takeBackControlInterpolant(e)),
  45099. this
  45100. },
  45101. getMixer: function() {
  45102. return this._mixer
  45103. },
  45104. getClip: function() {
  45105. return this._clip
  45106. },
  45107. getRoot: function() {
  45108. return this._localRoot || this._mixer._root
  45109. },
  45110. _update: function(e, t, i, n) {
  45111. var r = this._startTime;
  45112. if (null !== r) {
  45113. var o = (e - r) * i;
  45114. if (o < 0 || 0 === i)
  45115. return;
  45116. this._startTime = null,
  45117. t = i * o
  45118. }
  45119. t *= this._updateTimeScale(e);
  45120. var a = this._updateTime(t)
  45121. , s = this._updateWeight(e);
  45122. if (s > 0)
  45123. for (var l = this._interpolants, c = this._propertyBindings, h = 0, u = l.length; h !== u; ++h)
  45124. l[h].evaluate(a),
  45125. c[h].accumulate(n, s)
  45126. },
  45127. _updateWeight: function(e) {
  45128. var t = 0;
  45129. if (this.enabled) {
  45130. t = this.weight;
  45131. var i = this._weightInterpolant;
  45132. if (null !== i) {
  45133. var n = i.evaluate(e)[0];
  45134. t *= n,
  45135. e > i.parameterPositions[1] && (this.stopFading(),
  45136. 0 === n && (this.enabled = !1))
  45137. }
  45138. }
  45139. return this._effectiveWeight = t,
  45140. t
  45141. },
  45142. _updateTimeScale: function(e) {
  45143. var t = 0;
  45144. if (!this.paused) {
  45145. t = this.timeScale;
  45146. var i = this._timeScaleInterpolant;
  45147. if (null !== i) {
  45148. var n = i.evaluate(e)[0];
  45149. t *= n,
  45150. e > i.parameterPositions[1] && (this.stopWarping(),
  45151. 0 === t ? this.pause = !0 : this.timeScale = t)
  45152. }
  45153. }
  45154. return this._effectiveTimeScale = t,
  45155. t
  45156. },
  45157. _updateTime: function(e) {
  45158. var t = this.time + e;
  45159. if (0 === e)
  45160. return t;
  45161. var i = this._clip.duration
  45162. , r = this.loop
  45163. , o = this._loopCount
  45164. , a = !1;
  45165. switch (r) {
  45166. case n.LoopOnce:
  45167. if (o === -1 && (this.loopCount = 0,
  45168. this._setEndings(!0, !0, !1)),
  45169. t >= i)
  45170. t = i;
  45171. else {
  45172. if (!(t < 0))
  45173. break;
  45174. t = 0
  45175. }
  45176. this.clampWhenFinished ? this.pause = !0 : this.enabled = !1,
  45177. this._mixer.dispatchEvent({
  45178. type: "finished",
  45179. action: this,
  45180. direction: e < 0 ? -1 : 1
  45181. });
  45182. break;
  45183. case n.LoopPingPong:
  45184. a = !0;
  45185. case n.LoopRepeat:
  45186. if (o === -1 && (e > 0 ? (o = 0,
  45187. this._setEndings(!0, 0 === this.repetitions, a)) : this._setEndings(0 === this.repetitions, !0, a)),
  45188. t >= i || t < 0) {
  45189. var s = Math.floor(t / i);
  45190. t -= i * s,
  45191. o += Math.abs(s);
  45192. var l = this.repetitions - o;
  45193. if (l < 0) {
  45194. this.clampWhenFinished ? this.paused = !0 : this.enabled = !1,
  45195. t = e > 0 ? i : 0,
  45196. this._mixer.dispatchEvent({
  45197. type: "finished",
  45198. action: this,
  45199. direction: e > 0 ? 1 : -1
  45200. });
  45201. break
  45202. }
  45203. if (0 === l) {
  45204. var c = e < 0;
  45205. this._setEndings(c, !c, a)
  45206. } else
  45207. this._setEndings(!1, !1, a);
  45208. this._loopCount = o,
  45209. this._mixer.dispatchEvent({
  45210. type: "loop",
  45211. action: this,
  45212. loopDelta: s
  45213. })
  45214. }
  45215. if (r === n.LoopPingPong && 1 === (1 & o))
  45216. return this.time = t,
  45217. i - t
  45218. }
  45219. return this.time = t,
  45220. t
  45221. },
  45222. _setEndings: function(e, t, i) {
  45223. var r = this._interpolantSettings;
  45224. i ? (r.endingStart = n.ZeroSlopeEnding,
  45225. r.endingEnd = n.ZeroSlopeEnding) : (e ? r.endingStart = this.zeroSlopeAtStart ? n.ZeroSlopeEnding : n.ZeroCurvatureEnding : r.endingStart = n.WrapAroundEnding,
  45226. t ? r.endingEnd = this.zeroSlopeAtEnd ? n.ZeroSlopeEnding : n.ZeroCurvatureEnding : r.endingEnd = n.WrapAroundEnding)
  45227. },
  45228. _scheduleFading: function(e, t, i) {
  45229. var n = this._mixer
  45230. , r = n.time
  45231. , o = this._weightInterpolant;
  45232. null === o && (o = n._lendControlInterpolant(),
  45233. this._weightInterpolant = o);
  45234. var a = o.parameterPositions
  45235. , s = o.sampleValues;
  45236. return a[0] = r,
  45237. s[0] = t,
  45238. a[1] = r + e,
  45239. s[1] = i,
  45240. this
  45241. }
  45242. },
  45243. Object.assign(n.AnimationMixer.prototype, {
  45244. _bindAction: function(e, t) {
  45245. var i = e._localRoot || this._root
  45246. , r = e._clip.tracks
  45247. , o = r.length
  45248. , a = e._propertyBindings
  45249. , s = e._interpolants
  45250. , l = i.uuid
  45251. , c = this._bindingsByRootAndName
  45252. , h = c[l];
  45253. void 0 === h && (h = {},
  45254. c[l] = h);
  45255. for (var u = 0; u !== o; ++u) {
  45256. var d = r[u]
  45257. , p = d.name
  45258. , f = h[p];
  45259. if (void 0 !== f)
  45260. a[u] = f;
  45261. else {
  45262. if (f = a[u],
  45263. void 0 !== f) {
  45264. null === f._cacheIndex && (++f.referenceCount,
  45265. this._addInactiveBinding(f, l, p));
  45266. continue
  45267. }
  45268. var g = t && t._propertyBindings[u].binding.parsedPath;
  45269. f = new n.PropertyMixer(n.PropertyBinding.create(i, p, g),d.ValueTypeName,d.getValueSize()),
  45270. ++f.referenceCount,
  45271. this._addInactiveBinding(f, l, p),
  45272. a[u] = f
  45273. }
  45274. s[u].resultBuffer = f.buffer
  45275. }
  45276. },
  45277. _activateAction: function(e) {
  45278. if (!this._isActiveAction(e)) {
  45279. if (null === e._cacheIndex) {
  45280. var t = (e._localRoot || this._root).uuid
  45281. , i = e._clip.name
  45282. , n = this._actionsByClip[i];
  45283. this._bindAction(e, n && n.knownActions[0]),
  45284. this._addInactiveAction(e, i, t)
  45285. }
  45286. for (var r = e._propertyBindings, o = 0, a = r.length; o !== a; ++o) {
  45287. var s = r[o];
  45288. 0 === s.useCount++ && (this._lendBinding(s),
  45289. s.saveOriginalState())
  45290. }
  45291. this._lendAction(e)
  45292. }
  45293. },
  45294. _deactivateAction: function(e) {
  45295. if (this._isActiveAction(e)) {
  45296. for (var t = e._propertyBindings, i = 0, n = t.length; i !== n; ++i) {
  45297. var r = t[i];
  45298. 0 === --r.useCount && (r.restoreOriginalState(),
  45299. this._takeBackBinding(r))
  45300. }
  45301. this._takeBackAction(e)
  45302. }
  45303. },
  45304. _initMemoryManager: function() {
  45305. this._actions = [],
  45306. this._nActiveActions = 0,
  45307. this._actionsByClip = {},
  45308. this._bindings = [],
  45309. this._nActiveBindings = 0,
  45310. this._bindingsByRootAndName = {},
  45311. this._controlInterpolants = [],
  45312. this._nActiveControlInterpolants = 0;
  45313. var e = this;
  45314. this.stats = {
  45315. actions: {
  45316. get total() {
  45317. return e._actions.length
  45318. },
  45319. get inUse() {
  45320. return e._nActiveActions
  45321. }
  45322. },
  45323. bindings: {
  45324. get total() {
  45325. return e._bindings.length
  45326. },
  45327. get inUse() {
  45328. return e._nActiveBindings
  45329. }
  45330. },
  45331. controlInterpolants: {
  45332. get total() {
  45333. return e._controlInterpolants.length
  45334. },
  45335. get inUse() {
  45336. return e._nActiveControlInterpolants
  45337. }
  45338. }
  45339. }
  45340. },
  45341. _isActiveAction: function(e) {
  45342. var t = e._cacheIndex;
  45343. return null !== t && t < this._nActiveActions
  45344. },
  45345. _addInactiveAction: function(e, t, i) {
  45346. var n = this._actions
  45347. , r = this._actionsByClip
  45348. , o = r[t];
  45349. if (void 0 === o)
  45350. o = {
  45351. knownActions: [e],
  45352. actionByRoot: {}
  45353. },
  45354. e._byClipCacheIndex = 0,
  45355. r[t] = o;
  45356. else {
  45357. var a = o.knownActions;
  45358. e._byClipCacheIndex = a.length,
  45359. a.push(e)
  45360. }
  45361. e._cacheIndex = n.length,
  45362. n.push(e),
  45363. o.actionByRoot[i] = e
  45364. },
  45365. _removeInactiveAction: function(e) {
  45366. var t = this._actions
  45367. , i = t[t.length - 1]
  45368. , n = e._cacheIndex;
  45369. i._cacheIndex = n,
  45370. t[n] = i,
  45371. t.pop(),
  45372. e._cacheIndex = null;
  45373. var r = e._clip.name
  45374. , o = this._actionsByClip
  45375. , a = o[r]
  45376. , s = a.knownActions
  45377. , l = s[s.length - 1]
  45378. , c = e._byClipCacheIndex;
  45379. l._byClipCacheIndex = c,
  45380. s[c] = l,
  45381. s.pop(),
  45382. e._byClipCacheIndex = null;
  45383. var h = a.actionByRoot
  45384. , u = (t._localRoot || this._root).uuid;
  45385. delete h[u],
  45386. 0 === s.length && delete o[r],
  45387. this._removeInactiveBindingsForAction(e)
  45388. },
  45389. _removeInactiveBindingsForAction: function(e) {
  45390. for (var t = e._propertyBindings, i = 0, n = t.length; i !== n; ++i) {
  45391. var r = t[i];
  45392. 0 === --r.referenceCount && this._removeInactiveBinding(r)
  45393. }
  45394. },
  45395. _lendAction: function(e) {
  45396. var t = this._actions
  45397. , i = e._cacheIndex
  45398. , n = this._nActiveActions++
  45399. , r = t[n];
  45400. e._cacheIndex = n,
  45401. t[n] = e,
  45402. r._cacheIndex = i,
  45403. t[i] = r
  45404. },
  45405. _takeBackAction: function(e) {
  45406. var t = this._actions
  45407. , i = e._cacheIndex
  45408. , n = --this._nActiveActions
  45409. , r = t[n];
  45410. e._cacheIndex = n,
  45411. t[n] = e,
  45412. r._cacheIndex = i,
  45413. t[i] = r
  45414. },
  45415. _addInactiveBinding: function(e, t, i) {
  45416. var n = this._bindingsByRootAndName
  45417. , r = n[t]
  45418. , o = this._bindings;
  45419. void 0 === r && (r = {},
  45420. n[t] = r),
  45421. r[i] = e,
  45422. e._cacheIndex = o.length,
  45423. o.push(e)
  45424. },
  45425. _removeInactiveBinding: function(e) {
  45426. var t = this._bindings
  45427. , i = e.binding
  45428. , n = i.rootNode.uuid
  45429. , r = i.path
  45430. , o = this._bindingsByRootAndName
  45431. , a = o[n]
  45432. , s = t[t.length - 1]
  45433. , l = e._cacheIndex;
  45434. s._cacheIndex = l,
  45435. t[l] = s,
  45436. t.pop(),
  45437. delete a[r];
  45438. e: {
  45439. for (var c in a)
  45440. break e;
  45441. delete o[n]
  45442. }
  45443. },
  45444. _lendBinding: function(e) {
  45445. var t = this._bindings
  45446. , i = e._cacheIndex
  45447. , n = this._nActiveBindings++
  45448. , r = t[n];
  45449. e._cacheIndex = n,
  45450. t[n] = e,
  45451. r._cacheIndex = i,
  45452. t[i] = r
  45453. },
  45454. _takeBackBinding: function(e) {
  45455. var t = this._bindings
  45456. , i = e._cacheIndex
  45457. , n = --this._nActiveBindings
  45458. , r = t[n];
  45459. e._cacheIndex = n,
  45460. t[n] = e,
  45461. r._cacheIndex = i,
  45462. t[i] = r
  45463. },
  45464. _lendControlInterpolant: function() {
  45465. var e = this._controlInterpolants
  45466. , t = this._nActiveControlInterpolants++
  45467. , i = e[t];
  45468. return void 0 === i && (i = new n.LinearInterpolant(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer),
  45469. i.__cacheIndex = t,
  45470. e[t] = i),
  45471. i
  45472. },
  45473. _takeBackControlInterpolant: function(e) {
  45474. var t = this._controlInterpolants
  45475. , i = e.__cacheIndex
  45476. , n = --this._nActiveControlInterpolants
  45477. , r = t[n];
  45478. e.__cacheIndex = n,
  45479. t[n] = e,
  45480. r.__cacheIndex = i,
  45481. t[i] = r
  45482. },
  45483. _controlInterpolantsResultBuffer: new Float32Array(1)
  45484. }),
  45485. n.AnimationObjectGroup = function(e) {
  45486. this.uuid = n.Math.generateUUID(),
  45487. this._objects = Array.prototype.slice.call(arguments),
  45488. this.nCachedObjects_ = 0;
  45489. var t = {};
  45490. this._indicesByUUID = t;
  45491. for (var i = 0, r = arguments.length; i !== r; ++i)
  45492. t[arguments[i].uuid] = i;
  45493. this._paths = [],
  45494. this._parsedPaths = [],
  45495. this._bindings = [],
  45496. this._bindingsIndicesByPath = {};
  45497. var o = this;
  45498. this.stats = {
  45499. objects: {
  45500. get total() {
  45501. return o._objects.length
  45502. },
  45503. get inUse() {
  45504. return this.total - o.nCachedObjects_
  45505. }
  45506. },
  45507. get bindingsPerObject() {
  45508. return o._bindings.length
  45509. }
  45510. }
  45511. }
  45512. ,
  45513. n.AnimationObjectGroup.prototype = {
  45514. constructor: n.AnimationObjectGroup,
  45515. add: function(e) {
  45516. 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) {
  45517. var d = arguments[h]
  45518. , p = d.uuid
  45519. , f = o[p];
  45520. if (void 0 === f) {
  45521. f = i++,
  45522. o[p] = f,
  45523. t.push(d);
  45524. for (var g = 0, m = c; g !== m; ++g)
  45525. l[g].push(new n.PropertyBinding(d,a[g],s[g]))
  45526. } else if (f < r) {
  45527. var v = t[f]
  45528. , A = --r
  45529. , y = t[A];
  45530. o[y.uuid] = f,
  45531. t[f] = y,
  45532. o[p] = A,
  45533. t[A] = d;
  45534. for (var g = 0, m = c; g !== m; ++g) {
  45535. var C = l[g]
  45536. , I = C[A]
  45537. , E = C[f];
  45538. C[f] = I,
  45539. void 0 === E && (E = new n.PropertyBinding(d,a[g],s[g])),
  45540. C[A] = E
  45541. }
  45542. } else
  45543. t[f] !== v && console.error("Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes...")
  45544. }
  45545. this.nCachedObjects_ = r
  45546. },
  45547. remove: function(e) {
  45548. for (var t = this._objects, i = (t.length,
  45549. this.nCachedObjects_), n = this._indicesByUUID, r = this._bindings, o = r.length, a = 0, s = arguments.length; a !== s; ++a) {
  45550. var l = arguments[a]
  45551. , c = l.uuid
  45552. , h = n[c];
  45553. if (void 0 !== h && h >= i) {
  45554. var u = i++
  45555. , d = t[u];
  45556. n[d.uuid] = h,
  45557. t[h] = d,
  45558. n[c] = u,
  45559. t[u] = l;
  45560. for (var p = 0, f = o; p !== f; ++p) {
  45561. var g = r[p]
  45562. , m = g[u]
  45563. , v = g[h];
  45564. g[h] = m,
  45565. g[u] = v
  45566. }
  45567. }
  45568. }
  45569. this.nCachedObjects_ = i
  45570. },
  45571. uncache: function(e) {
  45572. 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) {
  45573. var c = arguments[s]
  45574. , h = c.uuid
  45575. , u = r[h];
  45576. if (void 0 !== u)
  45577. if (delete r[h],
  45578. u < n) {
  45579. var d = --n
  45580. , p = t[d]
  45581. , f = --i
  45582. , g = t[f];
  45583. r[p.uuid] = u,
  45584. t[u] = p,
  45585. r[g.uuid] = d,
  45586. t[d] = g,
  45587. t.pop();
  45588. for (var m = 0, v = a; m !== v; ++m) {
  45589. var A = o[m]
  45590. , y = A[d]
  45591. , C = A[f];
  45592. A[u] = y,
  45593. A[d] = C,
  45594. A.pop()
  45595. }
  45596. } else {
  45597. var f = --i
  45598. , g = t[f];
  45599. r[g.uuid] = u,
  45600. t[u] = g,
  45601. t.pop();
  45602. for (var m = 0, v = a; m !== v; ++m) {
  45603. var A = o[m];
  45604. A[u] = A[f],
  45605. A.pop()
  45606. }
  45607. }
  45608. }
  45609. this.nCachedObjects_ = n
  45610. },
  45611. subscribe_: function(e, t) {
  45612. var i = this._bindingsIndicesByPath
  45613. , r = i[e]
  45614. , o = this._bindings;
  45615. if (void 0 !== r)
  45616. return o[r];
  45617. var a = this._paths
  45618. , s = this._parsedPaths
  45619. , l = this._objects
  45620. , c = l.length
  45621. , h = this.nCachedObjects_
  45622. , u = new Array(c);
  45623. r = o.length,
  45624. i[e] = r,
  45625. a.push(e),
  45626. s.push(t),
  45627. o.push(u);
  45628. for (var d = h, p = l.length; d !== p; ++d) {
  45629. var f = l[d];
  45630. u[d] = new n.PropertyBinding(f,e,t)
  45631. }
  45632. return u
  45633. },
  45634. unsubscribe_: function(e) {
  45635. var t = this._bindingsIndicesByPath
  45636. , i = t[e];
  45637. if (void 0 !== i) {
  45638. var n = this._paths
  45639. , r = this._parsedPaths
  45640. , o = this._bindings
  45641. , a = o.length - 1
  45642. , s = o[a]
  45643. , l = e[a];
  45644. t[l] = i,
  45645. o[i] = s,
  45646. o.pop(),
  45647. r[i] = r[a],
  45648. r.pop(),
  45649. n[i] = n[a],
  45650. n.pop()
  45651. }
  45652. }
  45653. },
  45654. n.AnimationUtils = {
  45655. arraySlice: function(e, t, i) {
  45656. return n.AnimationUtils.isTypedArray(e) ? new e.constructor(e.subarray(t, i)) : e.slice(t, i)
  45657. },
  45658. convertArray: function(e, t, i) {
  45659. return !e || !i && e.constructor === t ? e : "number" == typeof t.BYTES_PER_ELEMENT ? new t(e) : Array.prototype.slice.call(e)
  45660. },
  45661. isTypedArray: function(e) {
  45662. return ArrayBuffer.isView(e) && !(e instanceof DataView)
  45663. },
  45664. getKeyframeOrder: function(e) {
  45665. function t(t, i) {
  45666. return e[t] - e[i]
  45667. }
  45668. for (var i = e.length, n = new Array(i), r = 0; r !== i; ++r)
  45669. n[r] = r;
  45670. return n.sort(t),
  45671. n
  45672. },
  45673. sortedArray: function(e, t, i) {
  45674. for (var n = e.length, r = new e.constructor(n), o = 0, a = 0; a !== n; ++o)
  45675. for (var s = i[o] * t, l = 0; l !== t; ++l)
  45676. r[a++] = e[s + l];
  45677. return r
  45678. },
  45679. flattenJSON: function(e, t, i, n) {
  45680. for (var r = 1, o = e[0]; void 0 !== o && void 0 === o[n]; )
  45681. o = e[r++];
  45682. if (void 0 !== o) {
  45683. var a = o[n];
  45684. if (void 0 !== a)
  45685. if (Array.isArray(a)) {
  45686. do
  45687. a = o[n],
  45688. void 0 !== a && (t.push(o.time),
  45689. i.push.apply(i, a)),
  45690. o = e[r++];
  45691. while (void 0 !== o)
  45692. } else if (void 0 !== a.toArray) {
  45693. do
  45694. a = o[n],
  45695. void 0 !== a && (t.push(o.time),
  45696. a.toArray(i, i.length)),
  45697. o = e[r++];
  45698. while (void 0 !== o)
  45699. } else
  45700. do
  45701. a = o[n],
  45702. void 0 !== a && (t.push(o.time),
  45703. i.push(a)),
  45704. o = e[r++];
  45705. while (void 0 !== o)
  45706. }
  45707. }
  45708. },
  45709. n.KeyframeTrack = function(e, t, i, r) {
  45710. if (void 0 === e)
  45711. throw new Error("track name is undefined");
  45712. if (void 0 === t || 0 === t.length)
  45713. throw new Error("no keyframes in track named " + e);
  45714. this.name = e,
  45715. this.times = n.AnimationUtils.convertArray(t, this.TimeBufferType),
  45716. this.values = n.AnimationUtils.convertArray(i, this.ValueBufferType),
  45717. this.setInterpolation(r || this.DefaultInterpolation),
  45718. this.validate(),
  45719. this.optimize()
  45720. }
  45721. ,
  45722. n.KeyframeTrack.prototype = {
  45723. constructor: n.KeyframeTrack,
  45724. TimeBufferType: Float32Array,
  45725. ValueBufferType: Float32Array,
  45726. DefaultInterpolation: n.InterpolateLinear,
  45727. InterpolantFactoryMethodDiscrete: function(e) {
  45728. return new n.DiscreteInterpolant(this.times,this.values,this.getValueSize(),e)
  45729. },
  45730. InterpolantFactoryMethodLinear: function(e) {
  45731. return new n.LinearInterpolant(this.times,this.values,this.getValueSize(),e)
  45732. },
  45733. InterpolantFactoryMethodSmooth: function(e) {
  45734. return new n.CubicInterpolant(this.times,this.values,this.getValueSize(),e)
  45735. },
  45736. setInterpolation: function(e) {
  45737. var t = void 0;
  45738. switch (e) {
  45739. case n.InterpolateDiscrete:
  45740. t = this.InterpolantFactoryMethodDiscrete;
  45741. break;
  45742. case n.InterpolateLinear:
  45743. t = this.InterpolantFactoryMethodLinear;
  45744. break;
  45745. case n.InterpolateSmooth:
  45746. t = this.InterpolantFactoryMethodSmooth
  45747. }
  45748. if (void 0 === t) {
  45749. var i = "unsupported interpolation for " + this.ValueTypeName + " keyframe track named " + this.name;
  45750. if (void 0 === this.createInterpolant) {
  45751. if (e === this.DefaultInterpolation)
  45752. throw new Error(i);
  45753. this.setInterpolation(this.DefaultInterpolation)
  45754. }
  45755. return void console.warn(i)
  45756. }
  45757. this.createInterpolant = t
  45758. },
  45759. getInterpolation: function() {
  45760. switch (this.createInterpolant) {
  45761. case this.InterpolantFactoryMethodDiscrete:
  45762. return n.InterpolateDiscrete;
  45763. case this.InterpolantFactoryMethodLinear:
  45764. return n.InterpolateLinear;
  45765. case this.InterpolantFactoryMethodSmooth:
  45766. return n.InterpolateSmooth
  45767. }
  45768. },
  45769. getValueSize: function() {
  45770. return this.values.length / this.times.length
  45771. },
  45772. shift: function(e) {
  45773. if (0 !== e)
  45774. for (var t = this.times, i = 0, n = t.length; i !== n; ++i)
  45775. t[i] += e;
  45776. return this
  45777. },
  45778. scale: function(e) {
  45779. if (1 !== e)
  45780. for (var t = this.times, i = 0, n = t.length; i !== n; ++i)
  45781. t[i] *= e;
  45782. return this
  45783. },
  45784. trim: function(e, t) {
  45785. for (var i = this.times, r = i.length, o = 0, a = r - 1; o !== r && i[o] < e; )
  45786. ++o;
  45787. for (; a !== -1 && i[a] > t; )
  45788. --a;
  45789. if (++a,
  45790. 0 !== o || a !== r) {
  45791. o >= a && (a = Math.max(a, 1),
  45792. o = a - 1);
  45793. var s = this.getValueSize();
  45794. this.times = n.AnimationUtils.arraySlice(i, o, a),
  45795. this.values = n.AnimationUtils.arraySlice(this.values, o * s, a * s)
  45796. }
  45797. return this
  45798. },
  45799. validate: function() {
  45800. var e = !0
  45801. , t = this.getValueSize();
  45802. t - Math.floor(t) !== 0 && (console.error("invalid value size in track", this),
  45803. e = !1);
  45804. var i = this.times
  45805. , r = this.values
  45806. , o = i.length;
  45807. 0 === o && (console.error("track is empty", this),
  45808. e = !1);
  45809. for (var a = null, s = 0; s !== o; s++) {
  45810. var l = i[s];
  45811. if ("number" == typeof l && isNaN(l)) {
  45812. console.error("time is not a valid number", this, s, l),
  45813. e = !1;
  45814. break
  45815. }
  45816. if (null !== a && a > l) {
  45817. console.error("out of order keys", this, s, l, a),
  45818. e = !1;
  45819. break
  45820. }
  45821. a = l
  45822. }
  45823. if (void 0 !== r && n.AnimationUtils.isTypedArray(r))
  45824. for (var s = 0, c = r.length; s !== c; ++s) {
  45825. var h = r[s];
  45826. if (isNaN(h)) {
  45827. console.error("value is not a valid number", this, s, h),
  45828. e = !1;
  45829. break
  45830. }
  45831. }
  45832. return e
  45833. },
  45834. optimize: function() {
  45835. for (var e = this.times, t = this.values, i = this.getValueSize(), r = 1, o = 1, a = e.length - 1; o <= a; ++o) {
  45836. var s = !1
  45837. , l = e[o]
  45838. , c = e[o + 1];
  45839. if (l !== c && (1 !== o || l !== l[0]))
  45840. for (var h = o * i, u = h - i, d = h + i, p = 0; p !== i; ++p) {
  45841. var f = t[h + p];
  45842. if (f !== t[u + p] || f !== t[d + p]) {
  45843. s = !0;
  45844. break
  45845. }
  45846. }
  45847. if (s) {
  45848. if (o !== r) {
  45849. e[r] = e[o];
  45850. for (var g = o * i, m = r * i, p = 0; p !== i; ++p)
  45851. t[m + p] = t[g + p]
  45852. }
  45853. ++r
  45854. }
  45855. }
  45856. return r !== e.length && (this.times = n.AnimationUtils.arraySlice(e, 0, r),
  45857. this.values = n.AnimationUtils.arraySlice(t, 0, r * i)),
  45858. this
  45859. }
  45860. },
  45861. Object.assign(n.KeyframeTrack, {
  45862. parse: function(e) {
  45863. if (void 0 === e.type)
  45864. throw new Error("track type undefined, can not parse");
  45865. var t = n.KeyframeTrack._getTrackTypeForValueTypeName(e.type);
  45866. if (void 0 === e.times) {
  45867. console.warn("legacy JSON format detected, converting");
  45868. var i = []
  45869. , r = [];
  45870. n.AnimationUtils.flattenJSON(e.keys, i, r, "value"),
  45871. e.times = i,
  45872. e.values = r
  45873. }
  45874. return void 0 !== t.parse ? t.parse(e) : new t(e.name,e.times,e.values,e.interpolation)
  45875. },
  45876. toJSON: function(e) {
  45877. var t, i = e.constructor;
  45878. if (void 0 !== i.toJSON)
  45879. t = i.toJSON(e);
  45880. else {
  45881. t = {
  45882. name: e.name,
  45883. times: n.AnimationUtils.convertArray(e.times, Array),
  45884. values: n.AnimationUtils.convertArray(e.values, Array)
  45885. };
  45886. var r = e.getInterpolation();
  45887. r !== e.DefaultInterpolation && (t.interpolation = r)
  45888. }
  45889. return t.type = e.ValueTypeName,
  45890. t
  45891. },
  45892. _getTrackTypeForValueTypeName: function(e) {
  45893. switch (e.toLowerCase()) {
  45894. case "scalar":
  45895. case "double":
  45896. case "float":
  45897. case "number":
  45898. case "integer":
  45899. return n.NumberKeyframeTrack;
  45900. case "vector":
  45901. case "vector2":
  45902. case "vector3":
  45903. case "vector4":
  45904. return n.VectorKeyframeTrack;
  45905. case "color":
  45906. return n.ColorKeyframeTrack;
  45907. case "quaternion":
  45908. return n.QuaternionKeyframeTrack;
  45909. case "bool":
  45910. case "boolean":
  45911. return n.BooleanKeyframeTrack;
  45912. case "string":
  45913. return n.StringKeyframeTrack
  45914. }
  45915. throw new Error("Unsupported typeName: " + e)
  45916. }
  45917. }),
  45918. n.PropertyBinding = function(e, t, i) {
  45919. this.path = t,
  45920. this.parsedPath = i || n.PropertyBinding.parseTrackName(t),
  45921. this.node = n.PropertyBinding.findNode(e, this.parsedPath.nodeName) || e,
  45922. this.rootNode = e
  45923. }
  45924. ,
  45925. n.PropertyBinding.prototype = {
  45926. constructor: n.PropertyBinding,
  45927. getValue: function(e, t) {
  45928. this.bind(),
  45929. this.getValue(e, t)
  45930. },
  45931. setValue: function(e, t) {
  45932. this.bind(),
  45933. this.setValue(e, t)
  45934. },
  45935. bind: function() {
  45936. var e = this.node
  45937. , t = this.parsedPath
  45938. , i = t.objectName
  45939. , r = t.propertyName
  45940. , o = t.propertyIndex;
  45941. if (e || (e = n.PropertyBinding.findNode(this.rootNode, t.nodeName) || this.rootNode,
  45942. this.node = e),
  45943. this.getValue = this._getValue_unavailable,
  45944. this.setValue = this._setValue_unavailable,
  45945. !e)
  45946. return void console.error(" trying to update node for track: " + this.path + " but it wasn't found.");
  45947. if (i) {
  45948. var a = t.objectIndex;
  45949. switch (i) {
  45950. case "materials":
  45951. if (!e.material)
  45952. return void console.error(" can not bind to material as node does not have a material", this);
  45953. if (!e.material.materials)
  45954. return void console.error(" can not bind to material.materials as node.material does not have a materials array", this);
  45955. e = e.material.materials;
  45956. break;
  45957. case "bones":
  45958. if (!e.skeleton)
  45959. return void console.error(" can not bind to bones as node does not have a skeleton", this);
  45960. e = e.skeleton.bones;
  45961. for (var s = 0; s < e.length; s++)
  45962. if (e[s].name === a) {
  45963. a = s;
  45964. break
  45965. }
  45966. break;
  45967. default:
  45968. if (void 0 === e[i])
  45969. return void console.error(" can not bind to objectName of node, undefined", this);
  45970. e = e[i]
  45971. }
  45972. if (void 0 !== a) {
  45973. if (void 0 === e[a])
  45974. return void console.error(" trying to bind to objectIndex of objectName, but is undefined:", this, e);
  45975. e = e[a]
  45976. }
  45977. }
  45978. var l = e[r];
  45979. if (!l) {
  45980. var c = t.nodeName;
  45981. return void console.error(" trying to update property for track: " + c + "." + r + " but it wasn't found.", e)
  45982. }
  45983. var h = this.Versioning.None;
  45984. void 0 !== e.needsUpdate ? (h = this.Versioning.NeedsUpdate,
  45985. this.targetObject = e) : void 0 !== e.matrixWorldNeedsUpdate && (h = this.Versioning.MatrixWorldNeedsUpdate,
  45986. this.targetObject = e);
  45987. var u = this.BindingType.Direct;
  45988. if (void 0 !== o) {
  45989. if ("morphTargetInfluences" === r) {
  45990. if (!e.geometry)
  45991. return void console.error(" can not bind to morphTargetInfluences becasuse node does not have a geometry", this);
  45992. if (!e.geometry.morphTargets)
  45993. return void console.error(" can not bind to morphTargetInfluences becasuse node does not have a geometry.morphTargets", this);
  45994. for (var s = 0; s < this.node.geometry.morphTargets.length; s++)
  45995. if (e.geometry.morphTargets[s].name === o) {
  45996. o = s;
  45997. break
  45998. }
  45999. }
  46000. u = this.BindingType.ArrayElement,
  46001. this.resolvedProperty = l,
  46002. this.propertyIndex = o
  46003. } else
  46004. void 0 !== l.fromArray && void 0 !== l.toArray ? (u = this.BindingType.HasFromToArray,
  46005. this.resolvedProperty = l) : void 0 !== l.length ? (u = this.BindingType.EntireArray,
  46006. this.resolvedProperty = l) : this.propertyName = r;
  46007. this.getValue = this.GetterByBindingType[u],
  46008. this.setValue = this.SetterByBindingTypeAndVersioning[u][h]
  46009. },
  46010. unbind: function() {
  46011. this.node = null,
  46012. this.getValue = this._getValue_unbound,
  46013. this.setValue = this._setValue_unbound
  46014. }
  46015. },
  46016. Object.assign(n.PropertyBinding.prototype, {
  46017. _getValue_unavailable: function() {},
  46018. _setValue_unavailable: function() {},
  46019. _getValue_unbound: n.PropertyBinding.prototype.getValue,
  46020. _setValue_unbound: n.PropertyBinding.prototype.setValue,
  46021. BindingType: {
  46022. Direct: 0,
  46023. EntireArray: 1,
  46024. ArrayElement: 2,
  46025. HasFromToArray: 3
  46026. },
  46027. Versioning: {
  46028. None: 0,
  46029. NeedsUpdate: 1,
  46030. MatrixWorldNeedsUpdate: 2
  46031. },
  46032. GetterByBindingType: [function(e, t) {
  46033. e[t] = this.node[this.propertyName]
  46034. }
  46035. , function(e, t) {
  46036. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  46037. e[t++] = i[n]
  46038. }
  46039. , function(e, t) {
  46040. e[t] = this.resolvedProperty[this.propertyIndex]
  46041. }
  46042. , function(e, t) {
  46043. this.resolvedProperty.toArray(e, t)
  46044. }
  46045. ],
  46046. SetterByBindingTypeAndVersioning: [[function(e, t) {
  46047. this.node[this.propertyName] = e[t]
  46048. }
  46049. , function(e, t) {
  46050. this.node[this.propertyName] = e[t],
  46051. this.targetObject.needsUpdate = !0
  46052. }
  46053. , function(e, t) {
  46054. this.node[this.propertyName] = e[t],
  46055. this.targetObject.matrixWorldNeedsUpdate = !0
  46056. }
  46057. ], [function(e, t) {
  46058. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  46059. i[n] = e[t++]
  46060. }
  46061. , function(e, t) {
  46062. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  46063. i[n] = e[t++];
  46064. this.targetObject.needsUpdate = !0
  46065. }
  46066. , function(e, t) {
  46067. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  46068. i[n] = e[t++];
  46069. this.targetObject.matrixWorldNeedsUpdate = !0
  46070. }
  46071. ], [function(e, t) {
  46072. this.resolvedProperty[this.propertyIndex] = e[t]
  46073. }
  46074. , function(e, t) {
  46075. this.resolvedProperty[this.propertyIndex] = e[t],
  46076. this.targetObject.needsUpdate = !0
  46077. }
  46078. , function(e, t) {
  46079. this.resolvedProperty[this.propertyIndex] = e[t],
  46080. this.targetObject.matrixWorldNeedsUpdate = !0
  46081. }
  46082. ], [function(e, t) {
  46083. this.resolvedProperty.fromArray(e, t)
  46084. }
  46085. , function(e, t) {
  46086. this.resolvedProperty.fromArray(e, t),
  46087. this.targetObject.needsUpdate = !0
  46088. }
  46089. , function(e, t) {
  46090. this.resolvedProperty.fromArray(e, t),
  46091. this.targetObject.matrixWorldNeedsUpdate = !0
  46092. }
  46093. ]]
  46094. }),
  46095. n.PropertyBinding.Composite = function(e, t, i) {
  46096. var r = i || n.PropertyBinding.parseTrackName(t);
  46097. this._targetGroup = e,
  46098. this._bindings = e.subscribe_(t, r)
  46099. }
  46100. ,
  46101. n.PropertyBinding.Composite.prototype = {
  46102. constructor: n.PropertyBinding.Composite,
  46103. getValue: function(e, t) {
  46104. this.bind();
  46105. var i = this._targetGroup.nCachedObjects_
  46106. , n = this._bindings[i];
  46107. void 0 !== n && n.getValue(e, t)
  46108. },
  46109. setValue: function(e, t) {
  46110. for (var i = this._bindings, n = this._targetGroup.nCachedObjects_, r = i.length; n !== r; ++n)
  46111. i[n].setValue(e, t)
  46112. },
  46113. bind: function() {
  46114. for (var e = this._bindings, t = this._targetGroup.nCachedObjects_, i = e.length; t !== i; ++t)
  46115. e[t].bind()
  46116. },
  46117. unbind: function() {
  46118. for (var e = this._bindings, t = this._targetGroup.nCachedObjects_, i = e.length; t !== i; ++t)
  46119. e[t].unbind()
  46120. }
  46121. },
  46122. n.PropertyBinding.create = function(e, t, i) {
  46123. return e instanceof n.AnimationObjectGroup ? new n.PropertyBinding.Composite(e,t,i) : new n.PropertyBinding(e,t,i)
  46124. }
  46125. ,
  46126. n.PropertyBinding.parseTrackName = function(e) {
  46127. var t = /^(([\w]+\/)*)([\w-\d]+)?(\.([\w]+)(\[([\w\d\[\]\_.:\- ]+)\])?)?(\.([\w.]+)(\[([\w\d\[\]\_. ]+)\])?)$/
  46128. , i = t.exec(e);
  46129. if (!i)
  46130. throw new Error("cannot parse trackName at all: " + e);
  46131. i.index === t.lastIndex && t.lastIndex++;
  46132. var n = {
  46133. nodeName: i[3],
  46134. objectName: i[5],
  46135. objectIndex: i[7],
  46136. propertyName: i[9],
  46137. propertyIndex: i[11]
  46138. };
  46139. if (null === n.propertyName || 0 === n.propertyName.length)
  46140. throw new Error("can not parse propertyName from trackName: " + e);
  46141. return n
  46142. }
  46143. ,
  46144. n.PropertyBinding.findNode = function(e, t) {
  46145. if (!t || "" === t || "root" === t || "." === t || t === -1 || t === e.name || t === e.uuid)
  46146. return e;
  46147. if (e.skeleton) {
  46148. var i = function(e) {
  46149. for (var i = 0; i < e.bones.length; i++) {
  46150. var n = e.bones[i];
  46151. if (n.name === t)
  46152. return n
  46153. }
  46154. return null
  46155. }
  46156. , n = i(e.skeleton);
  46157. if (n)
  46158. return n
  46159. }
  46160. if (e.children) {
  46161. var r = function(e) {
  46162. for (var i = 0; i < e.length; i++) {
  46163. var n = e[i];
  46164. if (n.name === t || n.uuid === t)
  46165. return n;
  46166. var o = r(n.children);
  46167. if (o)
  46168. return o
  46169. }
  46170. return null
  46171. }
  46172. , o = r(e.children);
  46173. if (o)
  46174. return o
  46175. }
  46176. return null
  46177. }
  46178. ,
  46179. n.PropertyMixer = function(e, t, i) {
  46180. this.binding = e,
  46181. this.valueSize = i;
  46182. var n, r = Float64Array;
  46183. switch (t) {
  46184. case "quaternion":
  46185. n = this._slerp;
  46186. break;
  46187. case "string":
  46188. case "bool":
  46189. r = Array,
  46190. n = this._select;
  46191. break;
  46192. default:
  46193. n = this._lerp
  46194. }
  46195. this.buffer = new r(4 * i),
  46196. this._mixBufferRegion = n,
  46197. this.cumulativeWeight = 0,
  46198. this.useCount = 0,
  46199. this.referenceCount = 0
  46200. }
  46201. ,
  46202. n.PropertyMixer.prototype = {
  46203. constructor: n.PropertyMixer,
  46204. accumulate: function(e, t) {
  46205. var i = this.buffer
  46206. , n = this.valueSize
  46207. , r = e * n + n
  46208. , o = this.cumulativeWeight;
  46209. if (0 === o) {
  46210. for (var a = 0; a !== n; ++a)
  46211. i[r + a] = i[a];
  46212. o = t
  46213. } else {
  46214. o += t;
  46215. var s = t / o;
  46216. this._mixBufferRegion(i, r, 0, s, n)
  46217. }
  46218. this.cumulativeWeight = o
  46219. },
  46220. apply: function(e) {
  46221. var t = this.valueSize
  46222. , i = this.buffer
  46223. , n = e * t + t
  46224. , r = this.cumulativeWeight
  46225. , o = this.binding;
  46226. if (this.cumulativeWeight = 0,
  46227. r < 1) {
  46228. var a = 3 * t;
  46229. this._mixBufferRegion(i, n, a, 1 - r, t)
  46230. }
  46231. for (var s = t, l = t + t; s !== l; ++s)
  46232. if (i[s] !== i[s + t]) {
  46233. o.setValue(i, n);
  46234. break
  46235. }
  46236. },
  46237. saveOriginalState: function() {
  46238. var e = this.binding
  46239. , t = this.buffer
  46240. , i = this.valueSize
  46241. , n = 3 * i;
  46242. e.getValue(t, n);
  46243. for (var r = i, o = n; r !== o; ++r)
  46244. t[r] = t[n + r % i];
  46245. this.cumulativeWeight = 0
  46246. },
  46247. restoreOriginalState: function() {
  46248. var e = 3 * this.valueSize;
  46249. this.binding.setValue(this.buffer, e)
  46250. },
  46251. _select: function(e, t, i, n, r) {
  46252. if (n >= .5)
  46253. for (var o = 0; o !== r; ++o)
  46254. e[t + o] = e[i + o]
  46255. },
  46256. _slerp: function(e, t, i, r, o) {
  46257. n.Quaternion.slerpFlat(e, t, e, t, e, i, r)
  46258. },
  46259. _lerp: function(e, t, i, n, r) {
  46260. for (var o = 1 - n, a = 0; a !== r; ++a) {
  46261. var s = t + a;
  46262. e[s] = e[s] * o + e[i + a] * n
  46263. }
  46264. }
  46265. },
  46266. n.BooleanKeyframeTrack = function(e, t, i) {
  46267. n.KeyframeTrack.call(this, e, t, i)
  46268. }
  46269. ,
  46270. n.BooleanKeyframeTrack.prototype = Object.assign(Object.create(n.KeyframeTrack.prototype), {
  46271. constructor: n.BooleanKeyframeTrack,
  46272. ValueTypeName: "bool",
  46273. ValueBufferType: Array,
  46274. DefaultInterpolation: n.IntepolateDiscrete,
  46275. InterpolantFactoryMethodLinear: void 0,
  46276. InterpolantFactoryMethodSmooth: void 0
  46277. }),
  46278. n.NumberKeyframeTrack = function(e, t, i, r) {
  46279. n.KeyframeTrack.call(this, e, t, i, r)
  46280. }
  46281. ,
  46282. n.NumberKeyframeTrack.prototype = Object.assign(Object.create(n.KeyframeTrack.prototype), {
  46283. constructor: n.NumberKeyframeTrack,
  46284. ValueTypeName: "number"
  46285. }),
  46286. n.QuaternionKeyframeTrack = function(e, t, i, r) {
  46287. n.KeyframeTrack.call(this, e, t, i, r)
  46288. }
  46289. ,
  46290. n.QuaternionKeyframeTrack.prototype = Object.assign(Object.create(n.KeyframeTrack.prototype), {
  46291. constructor: n.QuaternionKeyframeTrack,
  46292. ValueTypeName: "quaternion",
  46293. DefaultInterpolation: n.InterpolateLinear,
  46294. InterpolantFactoryMethodLinear: function(e) {
  46295. return new n.QuaternionLinearInterpolant(this.times,this.values,this.getValueSize(),e)
  46296. },
  46297. InterpolantFactoryMethodSmooth: void 0
  46298. }),
  46299. n.StringKeyframeTrack = function(e, t, i, r) {
  46300. n.KeyframeTrack.call(this, e, t, i, r)
  46301. }
  46302. ,
  46303. n.StringKeyframeTrack.prototype = Object.assign(Object.create(n.KeyframeTrack.prototype), {
  46304. constructor: n.StringKeyframeTrack,
  46305. ValueTypeName: "string",
  46306. ValueBufferType: Array,
  46307. DefaultInterpolation: n.IntepolateDiscrete,
  46308. InterpolantFactoryMethodLinear: void 0,
  46309. InterpolantFactoryMethodSmooth: void 0
  46310. }),
  46311. n.VectorKeyframeTrack = function(e, t, i, r) {
  46312. n.KeyframeTrack.call(this, e, t, i, r)
  46313. }
  46314. ,
  46315. n.VectorKeyframeTrack.prototype = Object.assign(Object.create(n.KeyframeTrack.prototype), {
  46316. constructor: n.VectorKeyframeTrack,
  46317. ValueTypeName: "vector"
  46318. }),
  46319. n.Audio = function(e) {
  46320. n.Object3D.call(this),
  46321. this.type = "Audio",
  46322. this.context = e.context,
  46323. this.source = this.context.createBufferSource(),
  46324. this.source.onended = this.onEnded.bind(this),
  46325. this.gain = this.context.createGain(),
  46326. this.gain.connect(e.getInput()),
  46327. this.autoplay = !1,
  46328. this.startTime = 0,
  46329. this.playbackRate = 1,
  46330. this.isPlaying = !1,
  46331. this.hasPlaybackControl = !0,
  46332. this.sourceType = "empty",
  46333. this.filter = null
  46334. }
  46335. ,
  46336. n.Audio.prototype = Object.create(n.Object3D.prototype),
  46337. n.Audio.prototype.constructor = n.Audio,
  46338. n.Audio.prototype.getOutput = function() {
  46339. return this.gain
  46340. }
  46341. ,
  46342. n.Audio.prototype.load = function(e) {
  46343. var t = new n.AudioBuffer(this.context);
  46344. return t.load(e),
  46345. this.setBuffer(t),
  46346. this
  46347. }
  46348. ,
  46349. n.Audio.prototype.setNodeSource = function(e) {
  46350. return this.hasPlaybackControl = !1,
  46351. this.sourceType = "audioNode",
  46352. this.source = e,
  46353. this.connect(),
  46354. this
  46355. }
  46356. ,
  46357. n.Audio.prototype.setBuffer = function(e) {
  46358. var t = this;
  46359. return e.onReady(function(e) {
  46360. t.source.buffer = e,
  46361. t.sourceType = "buffer",
  46362. t.autoplay && t.play()
  46363. }),
  46364. this
  46365. }
  46366. ,
  46367. n.Audio.prototype.play = function() {
  46368. if (this.isPlaying === !0)
  46369. return void console.warn("THREE.Audio: Audio is already playing.");
  46370. if (this.hasPlaybackControl === !1)
  46371. return void console.warn("THREE.Audio: this Audio has no playback control.");
  46372. var e = this.context.createBufferSource();
  46373. e.buffer = this.source.buffer,
  46374. e.loop = this.source.loop,
  46375. e.onended = this.source.onended,
  46376. e.start(0, this.startTime),
  46377. e.playbackRate.value = this.playbackRate,
  46378. this.isPlaying = !0,
  46379. this.source = e,
  46380. this.connect()
  46381. }
  46382. ,
  46383. n.Audio.prototype.pause = function() {
  46384. return this.hasPlaybackControl === !1 ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.source.stop(),
  46385. void (this.startTime = this.context.currentTime))
  46386. }
  46387. ,
  46388. n.Audio.prototype.stop = function() {
  46389. return this.hasPlaybackControl === !1 ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.source.stop(),
  46390. void (this.startTime = 0))
  46391. }
  46392. ,
  46393. n.Audio.prototype.connect = function() {
  46394. null !== this.filter ? (this.source.connect(this.filter),
  46395. this.filter.connect(this.getOutput())) : this.source.connect(this.getOutput())
  46396. }
  46397. ,
  46398. n.Audio.prototype.disconnect = function() {
  46399. null !== this.filter ? (this.source.disconnect(this.filter),
  46400. this.filter.disconnect(this.getOutput())) : this.source.disconnect(this.getOutput())
  46401. }
  46402. ,
  46403. n.Audio.prototype.getFilter = function() {
  46404. return this.filter
  46405. }
  46406. ,
  46407. n.Audio.prototype.setFilter = function(e) {
  46408. void 0 === e && (e = null),
  46409. this.isPlaying === !0 ? (this.disconnect(),
  46410. this.filter = e,
  46411. this.connect()) : this.filter = e
  46412. }
  46413. ,
  46414. n.Audio.prototype.setPlaybackRate = function(e) {
  46415. return this.hasPlaybackControl === !1 ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.playbackRate = e,
  46416. void (this.isPlaying === !0 && (this.source.playbackRate.value = this.playbackRate)))
  46417. }
  46418. ,
  46419. n.Audio.prototype.getPlaybackRate = function() {
  46420. return this.playbackRate
  46421. }
  46422. ,
  46423. n.Audio.prototype.onEnded = function() {
  46424. this.isPlaying = !1
  46425. }
  46426. ,
  46427. n.Audio.prototype.setLoop = function(e) {
  46428. return this.hasPlaybackControl === !1 ? void console.warn("THREE.Audio: this Audio has no playback control.") : void (this.source.loop = e)
  46429. }
  46430. ,
  46431. n.Audio.prototype.getLoop = function() {
  46432. return this.hasPlaybackControl === !1 ? (console.warn("THREE.Audio: this Audio has no playback control."),
  46433. !1) : this.source.loop
  46434. }
  46435. ,
  46436. n.Audio.prototype.setVolume = function(e) {
  46437. this.gain.gain.value = e
  46438. }
  46439. ,
  46440. n.Audio.prototype.getVolume = function() {
  46441. return this.gain.gain.value
  46442. }
  46443. ,
  46444. n.AudioAnalyser = function(e, t) {
  46445. this.analyser = e.context.createAnalyser(),
  46446. this.analyser.fftSize = void 0 !== t ? t : 2048,
  46447. this.data = new Uint8Array(this.analyser.frequencyBinCount),
  46448. e.getOutput().connect(this.analyser)
  46449. }
  46450. ,
  46451. n.AudioAnalyser.prototype = {
  46452. constructor: n.AudioAnalyser,
  46453. getData: function() {
  46454. return this.analyser.getByteFrequencyData(this.data),
  46455. this.data
  46456. }
  46457. },
  46458. n.AudioBuffer = function(e) {
  46459. this.context = e,
  46460. this.ready = !1,
  46461. this.readyCallbacks = []
  46462. }
  46463. ,
  46464. n.AudioBuffer.prototype.load = function(e) {
  46465. var t = this
  46466. , i = new XMLHttpRequest;
  46467. return i.open("GET", e, !0),
  46468. i.responseType = "arraybuffer",
  46469. i.onload = function(e) {
  46470. t.context.decodeAudioData(this.response, function(e) {
  46471. t.buffer = e,
  46472. t.ready = !0;
  46473. for (var i = 0; i < t.readyCallbacks.length; i++)
  46474. t.readyCallbacks[i](t.buffer);
  46475. t.readyCallbacks = []
  46476. })
  46477. }
  46478. ,
  46479. i.send(),
  46480. this
  46481. }
  46482. ,
  46483. n.AudioBuffer.prototype.onReady = function(e) {
  46484. this.ready ? e(this.buffer) : this.readyCallbacks.push(e)
  46485. }
  46486. ,
  46487. n.PositionalAudio = function(e) {
  46488. n.Audio.call(this, e),
  46489. this.panner = this.context.createPanner(),
  46490. this.panner.connect(this.gain)
  46491. }
  46492. ,
  46493. n.PositionalAudio.prototype = Object.create(n.Audio.prototype),
  46494. n.PositionalAudio.prototype.constructor = n.PositionalAudio,
  46495. n.PositionalAudio.prototype.getOutput = function() {
  46496. return this.panner
  46497. }
  46498. ,
  46499. n.PositionalAudio.prototype.setRefDistance = function(e) {
  46500. this.panner.refDistance = e
  46501. }
  46502. ,
  46503. n.PositionalAudio.prototype.getRefDistance = function() {
  46504. return this.panner.refDistance
  46505. }
  46506. ,
  46507. n.PositionalAudio.prototype.setRolloffFactor = function(e) {
  46508. this.panner.rolloffFactor = e
  46509. }
  46510. ,
  46511. n.PositionalAudio.prototype.getRolloffFactor = function() {
  46512. return this.panner.rolloffFactor
  46513. }
  46514. ,
  46515. n.PositionalAudio.prototype.setDistanceModel = function(e) {
  46516. this.panner.distanceModel = e
  46517. }
  46518. ,
  46519. n.PositionalAudio.prototype.getDistanceModel = function() {
  46520. return this.panner.distanceModel
  46521. }
  46522. ,
  46523. n.PositionalAudio.prototype.setMaxDistance = function(e) {
  46524. this.panner.maxDistance = e
  46525. }
  46526. ,
  46527. n.PositionalAudio.prototype.getMaxDistance = function() {
  46528. return this.panner.maxDistance
  46529. }
  46530. ,
  46531. n.PositionalAudio.prototype.updateMatrixWorld = function() {
  46532. var e = new n.Vector3;
  46533. return function(t) {
  46534. n.Object3D.prototype.updateMatrixWorld.call(this, t),
  46535. e.setFromMatrixPosition(this.matrixWorld),
  46536. this.panner.setPosition(e.x, e.y, e.z)
  46537. }
  46538. }(),
  46539. n.AudioListener = function() {
  46540. n.Object3D.call(this),
  46541. this.type = "AudioListener",
  46542. this.context = new (window.AudioContext || window.webkitAudioContext),
  46543. this.gain = this.context.createGain(),
  46544. this.gain.connect(this.context.destination),
  46545. this.filter = null
  46546. }
  46547. ,
  46548. n.AudioListener.prototype = Object.create(n.Object3D.prototype),
  46549. n.AudioListener.prototype.constructor = n.AudioListener,
  46550. n.AudioListener.prototype.getInput = function() {
  46551. return this.gain
  46552. }
  46553. ,
  46554. n.AudioListener.prototype.removeFilter = function() {
  46555. null !== this.filter && (this.gain.disconnect(this.filter),
  46556. this.filter.disconnect(this.context.destination),
  46557. this.gain.connect(this.context.destination),
  46558. this.filter = null)
  46559. }
  46560. ,
  46561. n.AudioListener.prototype.setFilter = function(e) {
  46562. null !== this.filter ? (this.gain.disconnect(this.filter),
  46563. this.filter.disconnect(this.context.destination)) : this.gain.disconnect(this.context.destination),
  46564. this.filter = e,
  46565. this.gain.connect(this.filter),
  46566. this.filter.connect(this.context.destination)
  46567. }
  46568. ,
  46569. n.AudioListener.prototype.getFilter = function() {
  46570. return this.filter
  46571. }
  46572. ,
  46573. n.AudioListener.prototype.setMasterVolume = function(e) {
  46574. this.gain.gain.value = e
  46575. }
  46576. ,
  46577. n.AudioListener.prototype.getMasterVolume = function() {
  46578. return this.gain.gain.value
  46579. }
  46580. ,
  46581. n.AudioListener.prototype.updateMatrixWorld = function() {
  46582. var e = new n.Vector3
  46583. , t = new n.Quaternion
  46584. , i = new n.Vector3
  46585. , r = new n.Vector3;
  46586. return function(o) {
  46587. n.Object3D.prototype.updateMatrixWorld.call(this, o);
  46588. var a = this.context.listener
  46589. , s = this.up;
  46590. this.matrixWorld.decompose(e, t, i),
  46591. r.set(0, 0, -1).applyQuaternion(t),
  46592. a.setPosition(e.x, e.y, e.z),
  46593. a.setOrientation(r.x, r.y, r.z, s.x, s.y, s.z)
  46594. }
  46595. }(),
  46596. n.Camera = function() {
  46597. n.Object3D.call(this),
  46598. this.type = "Camera",
  46599. this.matrixWorldInverse = new n.Matrix4,
  46600. this.projectionMatrix = new n.Matrix4
  46601. }
  46602. ,
  46603. n.Camera.prototype = Object.create(n.Object3D.prototype),
  46604. n.Camera.prototype.constructor = n.Camera,
  46605. n.Camera.prototype.getWorldDirection = function() {
  46606. var e = new n.Quaternion;
  46607. return function(t) {
  46608. var i = t || new n.Vector3;
  46609. return this.getWorldQuaternion(e),
  46610. i.set(0, 0, -1).applyQuaternion(e)
  46611. }
  46612. }(),
  46613. n.Camera.prototype.lookAt = function() {
  46614. var e = new n.Matrix4;
  46615. return function(t) {
  46616. e.lookAt(this.position, t, this.up),
  46617. this.quaternion.setFromRotationMatrix(e)
  46618. }
  46619. }(),
  46620. n.Camera.prototype.clone = function() {
  46621. return (new this.constructor).copy(this)
  46622. }
  46623. ,
  46624. n.Camera.prototype.copy = function(e) {
  46625. return n.Object3D.prototype.copy.call(this, e),
  46626. this.matrixWorldInverse.copy(e.matrixWorldInverse),
  46627. this.projectionMatrix.copy(e.projectionMatrix),
  46628. this
  46629. }
  46630. ,
  46631. n.CubeCamera = function(e, t, i) {
  46632. n.Object3D.call(this),
  46633. this.type = "CubeCamera";
  46634. var r = 90
  46635. , o = 1
  46636. , a = new n.PerspectiveCamera(r,o,e,t);
  46637. a.up.set(0, -1, 0),
  46638. a.lookAt(new n.Vector3(1,0,0)),
  46639. this.add(a);
  46640. var s = new n.PerspectiveCamera(r,o,e,t);
  46641. s.up.set(0, -1, 0),
  46642. s.lookAt(new n.Vector3(-1,0,0)),
  46643. this.add(s);
  46644. var l = new n.PerspectiveCamera(r,o,e,t);
  46645. l.up.set(0, 0, 1),
  46646. l.lookAt(new n.Vector3(0,1,0)),
  46647. this.add(l);
  46648. var c = new n.PerspectiveCamera(r,o,e,t);
  46649. c.up.set(0, 0, -1),
  46650. c.lookAt(new n.Vector3(0,-1,0)),
  46651. this.add(c);
  46652. var h = new n.PerspectiveCamera(r,o,e,t);
  46653. h.up.set(0, -1, 0),
  46654. h.lookAt(new n.Vector3(0,0,1)),
  46655. this.add(h);
  46656. var u = new n.PerspectiveCamera(r,o,e,t);
  46657. u.up.set(0, -1, 0),
  46658. u.lookAt(new n.Vector3(0,0,-1)),
  46659. this.add(u);
  46660. var d = {
  46661. format: n.RGBFormat,
  46662. magFilter: n.LinearFilter,
  46663. minFilter: n.LinearFilter
  46664. };
  46665. this.renderTarget = new n.WebGLRenderTargetCube(i,i,d),
  46666. this.updateCubeMap = function(e, t) {
  46667. null === this.parent && this.updateMatrixWorld();
  46668. var i = this.renderTarget
  46669. , n = i.texture.generateMipmaps;
  46670. i.texture.generateMipmaps = !1,
  46671. i.activeCubeFace = 0,
  46672. e.render(t, a, i),
  46673. i.activeCubeFace = 1,
  46674. e.render(t, s, i),
  46675. i.activeCubeFace = 2,
  46676. e.render(t, l, i),
  46677. i.activeCubeFace = 3,
  46678. e.render(t, c, i),
  46679. i.activeCubeFace = 4,
  46680. e.render(t, h, i),
  46681. i.texture.generateMipmaps = n,
  46682. i.activeCubeFace = 5,
  46683. e.render(t, u, i),
  46684. e.setRenderTarget(null)
  46685. }
  46686. }
  46687. ,
  46688. n.CubeCamera.prototype = Object.create(n.Object3D.prototype),
  46689. n.CubeCamera.prototype.constructor = n.CubeCamera,
  46690. n.OrthographicCamera = function(e, t, i, r, o, a) {
  46691. n.Camera.call(this),
  46692. this.type = "OrthographicCamera",
  46693. this.zoom = 1,
  46694. this.left = e,
  46695. this.right = t,
  46696. this.top = i,
  46697. this.bottom = r,
  46698. this.near = void 0 !== o ? o : .1,
  46699. this.far = void 0 !== a ? a : 2e3,
  46700. this.updateProjectionMatrix()
  46701. }
  46702. ,
  46703. n.OrthographicCamera.prototype = Object.create(n.Camera.prototype),
  46704. n.OrthographicCamera.prototype.constructor = n.OrthographicCamera,
  46705. n.OrthographicCamera.prototype.updateProjectionMatrix = function() {
  46706. var e = (this.right - this.left) / (2 * this.zoom)
  46707. , t = (this.top - this.bottom) / (2 * this.zoom)
  46708. , i = (this.right + this.left) / 2
  46709. , n = (this.top + this.bottom) / 2;
  46710. this.projectionMatrix.makeOrthographic(i - e, i + e, n + t, n - t, this.near, this.far)
  46711. }
  46712. ,
  46713. n.OrthographicCamera.prototype.copy = function(e) {
  46714. return n.Camera.prototype.copy.call(this, e),
  46715. this.left = e.left,
  46716. this.right = e.right,
  46717. this.top = e.top,
  46718. this.bottom = e.bottom,
  46719. this.near = e.near,
  46720. this.far = e.far,
  46721. this.zoom = e.zoom,
  46722. this
  46723. }
  46724. ,
  46725. n.OrthographicCamera.prototype.toJSON = function(e) {
  46726. var t = n.Object3D.prototype.toJSON.call(this, e);
  46727. return t.object.zoom = this.zoom,
  46728. t.object.left = this.left,
  46729. t.object.right = this.right,
  46730. t.object.top = this.top,
  46731. t.object.bottom = this.bottom,
  46732. t.object.near = this.near,
  46733. t.object.far = this.far,
  46734. t
  46735. }
  46736. ,
  46737. n.PerspectiveCamera = function(e, t, i, r) {
  46738. n.Camera.call(this),
  46739. this.type = "PerspectiveCamera",
  46740. this.focalLength = 10,
  46741. this.zoom = 1,
  46742. this.fov = void 0 !== e ? e : 50,
  46743. this.aspect = void 0 !== t ? t : 1,
  46744. this.near = void 0 !== i ? i : .1,
  46745. this.far = void 0 !== r ? r : 2e3,
  46746. this.updateProjectionMatrix()
  46747. }
  46748. ,
  46749. n.PerspectiveCamera.prototype = Object.create(n.Camera.prototype),
  46750. n.PerspectiveCamera.prototype.constructor = n.PerspectiveCamera,
  46751. n.PerspectiveCamera.prototype.setLens = function(e, t) {
  46752. void 0 === t && (t = 24),
  46753. this.fov = 2 * n.Math.radToDeg(Math.atan(t / (2 * e))),
  46754. this.updateProjectionMatrix()
  46755. }
  46756. ,
  46757. n.PerspectiveCamera.prototype.setViewOffset = function(e, t, i, n, r, o) {
  46758. this.fullWidth = e,
  46759. this.fullHeight = t,
  46760. this.x = i,
  46761. this.y = n,
  46762. this.width = r,
  46763. this.height = o,
  46764. this.updateProjectionMatrix()
  46765. }
  46766. ,
  46767. n.PerspectiveCamera.prototype.updateProjectionMatrix = function() {
  46768. var e = n.Math.radToDeg(2 * Math.atan(Math.tan(.5 * n.Math.degToRad(this.fov)) / this.zoom));
  46769. if (this.fullWidth) {
  46770. var t = this.fullWidth / this.fullHeight
  46771. , i = Math.tan(n.Math.degToRad(.5 * e)) * this.near
  46772. , r = -i
  46773. , o = t * r
  46774. , a = t * i
  46775. , s = Math.abs(a - o)
  46776. , l = Math.abs(i - r);
  46777. 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)
  46778. } else
  46779. this.projectionMatrix.makePerspective(e, this.aspect, this.near, this.far)
  46780. }
  46781. ,
  46782. n.PerspectiveCamera.prototype.copy = function(e) {
  46783. return n.Camera.prototype.copy.call(this, e),
  46784. this.focalLength = e.focalLength,
  46785. this.zoom = e.zoom,
  46786. this.fov = e.fov,
  46787. this.aspect = e.aspect,
  46788. this.near = e.near,
  46789. this.far = e.far,
  46790. this
  46791. }
  46792. ,
  46793. n.PerspectiveCamera.prototype.toJSON = function(e) {
  46794. var t = n.Object3D.prototype.toJSON.call(this, e);
  46795. return t.object.focalLength = this.focalLength,
  46796. t.object.zoom = this.zoom,
  46797. t.object.fov = this.fov,
  46798. t.object.aspect = this.aspect,
  46799. t.object.near = this.near,
  46800. t.object.far = this.far,
  46801. t
  46802. }
  46803. ,
  46804. n.StereoCamera = function() {
  46805. this.type = "StereoCamera",
  46806. this.aspect = 1,
  46807. this.cameraL = new n.PerspectiveCamera,
  46808. this.cameraL.layers.enable(1),
  46809. this.cameraL.matrixAutoUpdate = !1,
  46810. this.cameraR = new n.PerspectiveCamera,
  46811. this.cameraR.layers.enable(2),
  46812. this.cameraR.matrixAutoUpdate = !1
  46813. }
  46814. ,
  46815. n.StereoCamera.prototype = {
  46816. constructor: n.StereoCamera,
  46817. update: function() {
  46818. var e, t, i, r, o, a = new n.Matrix4, s = new n.Matrix4;
  46819. return function(l) {
  46820. var c = e !== l.focalLength || t !== l.fov || i !== l.aspect * this.aspect || r !== l.near || o !== l.far;
  46821. if (c) {
  46822. e = l.focalLength,
  46823. t = l.fov,
  46824. i = l.aspect * this.aspect,
  46825. r = l.near,
  46826. o = l.far;
  46827. var h, u, d = l.projectionMatrix.clone(), p = .032, f = p * r / e, g = r * Math.tan(n.Math.degToRad(.5 * t));
  46828. s.elements[12] = -p,
  46829. a.elements[12] = p,
  46830. h = -g * i + f,
  46831. u = g * i + f,
  46832. d.elements[0] = 2 * r / (u - h),
  46833. d.elements[8] = (u + h) / (u - h),
  46834. this.cameraL.projectionMatrix.copy(d),
  46835. h = -g * i - f,
  46836. u = g * i - f,
  46837. d.elements[0] = 2 * r / (u - h),
  46838. d.elements[8] = (u + h) / (u - h),
  46839. this.cameraR.projectionMatrix.copy(d)
  46840. }
  46841. this.cameraL.matrixWorld.copy(l.matrixWorld).multiply(s),
  46842. this.cameraR.matrixWorld.copy(l.matrixWorld).multiply(a)
  46843. }
  46844. }()
  46845. },
  46846. n.Light = function(e, t) {
  46847. n.Object3D.call(this),
  46848. this.type = "Light",
  46849. this.color = new n.Color(e),
  46850. this.intensity = void 0 !== t ? t : 1,
  46851. this.receiveShadow = void 0
  46852. }
  46853. ,
  46854. n.Light.prototype = Object.create(n.Object3D.prototype),
  46855. n.Light.prototype.constructor = n.Light,
  46856. n.Light.prototype.copy = function(e) {
  46857. return n.Object3D.prototype.copy.call(this, e),
  46858. this.color.copy(e.color),
  46859. this.intensity = e.intensity,
  46860. this
  46861. }
  46862. ,
  46863. n.Light.prototype.toJSON = function(e) {
  46864. var t = n.Object3D.prototype.toJSON.call(this, e);
  46865. return t.object.color = this.color.getHex(),
  46866. t.object.intensity = this.intensity,
  46867. void 0 !== this.groundColor && (t.object.groundColor = this.groundColor.getHex()),
  46868. void 0 !== this.distance && (t.object.distance = this.distance),
  46869. void 0 !== this.angle && (t.object.angle = this.angle),
  46870. void 0 !== this.decay && (t.object.decay = this.decay),
  46871. void 0 !== this.penumbra && (t.object.penumbra = this.penumbra),
  46872. t
  46873. }
  46874. ,
  46875. n.LightShadow = function(e) {
  46876. this.camera = e,
  46877. this.bias = 0,
  46878. this.radius = 1,
  46879. this.mapSize = new n.Vector2(512,512),
  46880. this.map = null,
  46881. this.matrix = new n.Matrix4
  46882. }
  46883. ,
  46884. n.LightShadow.prototype = {
  46885. constructor: n.LightShadow,
  46886. copy: function(e) {
  46887. return this.camera = e.camera.clone(),
  46888. this.bias = e.bias,
  46889. this.radius = e.radius,
  46890. this.mapSize.copy(e.mapSize),
  46891. this
  46892. },
  46893. clone: function() {
  46894. return (new this.constructor).copy(this)
  46895. }
  46896. },
  46897. n.AmbientLight = function(e, t) {
  46898. n.Light.call(this, e, t),
  46899. this.type = "AmbientLight",
  46900. this.castShadow = void 0
  46901. }
  46902. ,
  46903. n.AmbientLight.prototype = Object.create(n.Light.prototype),
  46904. n.AmbientLight.prototype.constructor = n.AmbientLight,
  46905. n.DirectionalLight = function(e, t) {
  46906. n.Light.call(this, e, t),
  46907. this.type = "DirectionalLight",
  46908. this.position.set(0, 1, 0),
  46909. this.updateMatrix(),
  46910. this.target = new n.Object3D,
  46911. this.shadow = new n.LightShadow(new n.OrthographicCamera(-5,5,5,-5,.5,500))
  46912. }
  46913. ,
  46914. n.DirectionalLight.prototype = Object.create(n.Light.prototype),
  46915. n.DirectionalLight.prototype.constructor = n.DirectionalLight,
  46916. n.DirectionalLight.prototype.copy = function(e) {
  46917. return n.Light.prototype.copy.call(this, e),
  46918. this.target = e.target.clone(),
  46919. this.shadow = e.shadow.clone(),
  46920. this
  46921. }
  46922. ,
  46923. n.HemisphereLight = function(e, t, i) {
  46924. n.Light.call(this, e, i),
  46925. this.type = "HemisphereLight",
  46926. this.castShadow = void 0,
  46927. this.position.set(0, 1, 0),
  46928. this.updateMatrix(),
  46929. this.groundColor = new n.Color(t)
  46930. }
  46931. ,
  46932. n.HemisphereLight.prototype = Object.create(n.Light.prototype),
  46933. n.HemisphereLight.prototype.constructor = n.HemisphereLight,
  46934. n.HemisphereLight.prototype.copy = function(e) {
  46935. return n.Light.prototype.copy.call(this, e),
  46936. this.groundColor.copy(e.groundColor),
  46937. this
  46938. }
  46939. ,
  46940. n.PointLight = function(e, t, i, r) {
  46941. n.Light.call(this, e, t),
  46942. this.type = "PointLight",
  46943. this.distance = void 0 !== i ? i : 0,
  46944. this.decay = void 0 !== r ? r : 1,
  46945. this.shadow = new n.LightShadow(new n.PerspectiveCamera(90,1,.5,500))
  46946. }
  46947. ,
  46948. n.PointLight.prototype = Object.create(n.Light.prototype),
  46949. n.PointLight.prototype.constructor = n.PointLight,
  46950. Object.defineProperty(n.PointLight.prototype, "power", {
  46951. get: function() {
  46952. return 4 * this.intensity * Math.PI
  46953. },
  46954. set: function(e) {
  46955. this.intensity = e / (4 * Math.PI)
  46956. }
  46957. }),
  46958. n.PointLight.prototype.copy = function(e) {
  46959. return n.Light.prototype.copy.call(this, e),
  46960. this.distance = e.distance,
  46961. this.decay = e.decay,
  46962. this.shadow = e.shadow.clone(),
  46963. this
  46964. }
  46965. ,
  46966. n.SpotLight = function(e, t, i, r, o, a) {
  46967. n.Light.call(this, e, t),
  46968. this.type = "SpotLight",
  46969. this.position.set(0, 1, 0),
  46970. this.updateMatrix(),
  46971. this.target = new n.Object3D,
  46972. this.distance = void 0 !== i ? i : 0,
  46973. this.angle = void 0 !== r ? r : Math.PI / 3,
  46974. this.penumbra = void 0 !== o ? o : 0,
  46975. this.decay = void 0 !== a ? a : 1,
  46976. this.shadow = new n.LightShadow(new n.PerspectiveCamera(50,1,.5,500))
  46977. }
  46978. ,
  46979. n.SpotLight.prototype = Object.create(n.Light.prototype),
  46980. n.SpotLight.prototype.constructor = n.SpotLight,
  46981. Object.defineProperty(n.SpotLight.prototype, "power", {
  46982. get: function() {
  46983. return this.intensity * Math.PI
  46984. },
  46985. set: function(e) {
  46986. this.intensity = e / Math.PI
  46987. }
  46988. }),
  46989. n.SpotLight.prototype.copy = function(e) {
  46990. return n.Light.prototype.copy.call(this, e),
  46991. this.distance = e.distance,
  46992. this.angle = e.angle,
  46993. this.penumbra = e.penumbra,
  46994. this.decay = e.decay,
  46995. this.target = e.target.clone(),
  46996. this.shadow = e.shadow.clone(),
  46997. this
  46998. }
  46999. ,
  47000. n.Cache = {
  47001. enabled: !1,
  47002. files: {},
  47003. add: function(e, t) {
  47004. this.enabled !== !1 && (this.files[e] = t)
  47005. },
  47006. get: function(e) {
  47007. if (this.enabled !== !1)
  47008. return this.files[e]
  47009. },
  47010. remove: function(e) {
  47011. delete this.files[e]
  47012. },
  47013. clear: function() {
  47014. this.files = {}
  47015. }
  47016. },
  47017. n.Loader = function() {
  47018. this.onLoadStart = function() {}
  47019. ,
  47020. this.onLoadProgress = function() {}
  47021. ,
  47022. this.onLoadComplete = function() {}
  47023. }
  47024. ,
  47025. n.Loader.prototype = {
  47026. constructor: n.Loader,
  47027. crossOrigin: void 0,
  47028. extractUrlBase: function(e) {
  47029. var t = e.split("/");
  47030. return 1 === t.length ? "./" : (t.pop(),
  47031. t.join("/") + "/")
  47032. },
  47033. initMaterials: function(e, t, i) {
  47034. for (var n = [], r = 0; r < e.length; ++r)
  47035. n[r] = this.createMaterial(e[r], t, i);
  47036. return n
  47037. },
  47038. createMaterial: function() {
  47039. var e, t, i;
  47040. return function(r, o, a) {
  47041. function s(e, i, r, s, c) {
  47042. var h, u = o + e, d = n.Loader.Handlers.get(u);
  47043. null !== d ? h = d.load(u) : (t.setCrossOrigin(a),
  47044. h = t.load(u)),
  47045. void 0 !== i && (h.repeat.fromArray(i),
  47046. 1 !== i[0] && (h.wrapS = n.RepeatWrapping),
  47047. 1 !== i[1] && (h.wrapT = n.RepeatWrapping)),
  47048. void 0 !== r && h.offset.fromArray(r),
  47049. void 0 !== s && ("repeat" === s[0] && (h.wrapS = n.RepeatWrapping),
  47050. "mirror" === s[0] && (h.wrapS = n.MirroredRepeatWrapping),
  47051. "repeat" === s[1] && (h.wrapT = n.RepeatWrapping),
  47052. "mirror" === s[1] && (h.wrapT = n.MirroredRepeatWrapping)),
  47053. void 0 !== c && (h.anisotropy = c);
  47054. var p = n.Math.generateUUID();
  47055. return l[p] = h,
  47056. p
  47057. }
  47058. void 0 === e && (e = new n.Color),
  47059. void 0 === t && (t = new n.TextureLoader),
  47060. void 0 === i && (i = new n.MaterialLoader);
  47061. var l = {}
  47062. , c = {
  47063. uuid: n.Math.generateUUID(),
  47064. type: "MeshLambertMaterial"
  47065. };
  47066. for (var h in r) {
  47067. var u = r[h];
  47068. switch (h) {
  47069. case "DbgColor":
  47070. case "DbgIndex":
  47071. case "opticalDensity":
  47072. case "illumination":
  47073. break;
  47074. case "DbgName":
  47075. c.name = u;
  47076. break;
  47077. case "blending":
  47078. c.blending = n[u];
  47079. break;
  47080. case "colorAmbient":
  47081. case "mapAmbient":
  47082. console.warn("THREE.Loader.createMaterial:", h, "is no longer supported.");
  47083. break;
  47084. case "colorDiffuse":
  47085. c.color = e.fromArray(u).getHex();
  47086. break;
  47087. case "colorSpecular":
  47088. c.specular = e.fromArray(u).getHex();
  47089. break;
  47090. case "colorEmissive":
  47091. c.emissive = e.fromArray(u).getHex();
  47092. break;
  47093. case "specularCoef":
  47094. c.shininess = u;
  47095. break;
  47096. case "shading":
  47097. "basic" === u.toLowerCase() && (c.type = "MeshBasicMaterial"),
  47098. "phong" === u.toLowerCase() && (c.type = "MeshPhongMaterial");
  47099. break;
  47100. case "mapDiffuse":
  47101. c.map = s(u, r.mapDiffuseRepeat, r.mapDiffuseOffset, r.mapDiffuseWrap, r.mapDiffuseAnisotropy);
  47102. break;
  47103. case "mapDiffuseRepeat":
  47104. case "mapDiffuseOffset":
  47105. case "mapDiffuseWrap":
  47106. case "mapDiffuseAnisotropy":
  47107. break;
  47108. case "mapLight":
  47109. c.lightMap = s(u, r.mapLightRepeat, r.mapLightOffset, r.mapLightWrap, r.mapLightAnisotropy);
  47110. break;
  47111. case "mapLightRepeat":
  47112. case "mapLightOffset":
  47113. case "mapLightWrap":
  47114. case "mapLightAnisotropy":
  47115. break;
  47116. case "mapAO":
  47117. c.aoMap = s(u, r.mapAORepeat, r.mapAOOffset, r.mapAOWrap, r.mapAOAnisotropy);
  47118. break;
  47119. case "mapAORepeat":
  47120. case "mapAOOffset":
  47121. case "mapAOWrap":
  47122. case "mapAOAnisotropy":
  47123. break;
  47124. case "mapBump":
  47125. c.bumpMap = s(u, r.mapBumpRepeat, r.mapBumpOffset, r.mapBumpWrap, r.mapBumpAnisotropy);
  47126. break;
  47127. case "mapBumpScale":
  47128. c.bumpScale = u;
  47129. break;
  47130. case "mapBumpRepeat":
  47131. case "mapBumpOffset":
  47132. case "mapBumpWrap":
  47133. case "mapBumpAnisotropy":
  47134. break;
  47135. case "mapNormal":
  47136. c.normalMap = s(u, r.mapNormalRepeat, r.mapNormalOffset, r.mapNormalWrap, r.mapNormalAnisotropy);
  47137. break;
  47138. case "mapNormalFactor":
  47139. c.normalScale = [u, u];
  47140. break;
  47141. case "mapNormalRepeat":
  47142. case "mapNormalOffset":
  47143. case "mapNormalWrap":
  47144. case "mapNormalAnisotropy":
  47145. break;
  47146. case "mapSpecular":
  47147. c.specularMap = s(u, r.mapSpecularRepeat, r.mapSpecularOffset, r.mapSpecularWrap, r.mapSpecularAnisotropy);
  47148. break;
  47149. case "mapSpecularRepeat":
  47150. case "mapSpecularOffset":
  47151. case "mapSpecularWrap":
  47152. case "mapSpecularAnisotropy":
  47153. break;
  47154. case "mapAlpha":
  47155. c.alphaMap = s(u, r.mapAlphaRepeat, r.mapAlphaOffset, r.mapAlphaWrap, r.mapAlphaAnisotropy);
  47156. break;
  47157. case "mapAlphaRepeat":
  47158. case "mapAlphaOffset":
  47159. case "mapAlphaWrap":
  47160. case "mapAlphaAnisotropy":
  47161. break;
  47162. case "flipSided":
  47163. c.side = n.BackSide;
  47164. break;
  47165. case "doubleSided":
  47166. c.side = n.DoubleSide;
  47167. break;
  47168. case "transparency":
  47169. console.warn("THREE.Loader.createMaterial: transparency has been renamed to opacity"),
  47170. c.opacity = u;
  47171. break;
  47172. case "depthTest":
  47173. case "depthWrite":
  47174. case "colorWrite":
  47175. case "opacity":
  47176. case "reflectivity":
  47177. case "transparent":
  47178. case "visible":
  47179. case "wireframe":
  47180. c[h] = u;
  47181. break;
  47182. case "vertexColors":
  47183. u === !0 && (c.vertexColors = n.VertexColors),
  47184. "face" === u && (c.vertexColors = n.FaceColors);
  47185. break;
  47186. default:
  47187. console.error("THREE.Loader.createMaterial: Unsupported", h, u)
  47188. }
  47189. }
  47190. return "MeshBasicMaterial" === c.type && delete c.emissive,
  47191. "MeshPhongMaterial" !== c.type && delete c.specular,
  47192. c.opacity < 1 && (c.transparent = !0),
  47193. i.setTextures(l),
  47194. i.parse(c)
  47195. }
  47196. }()
  47197. },
  47198. n.Loader.Handlers = {
  47199. handlers: [],
  47200. add: function(e, t) {
  47201. this.handlers.push(e, t)
  47202. },
  47203. get: function(e) {
  47204. for (var t = this.handlers, i = 0, n = t.length; i < n; i += 2) {
  47205. var r = t[i]
  47206. , o = t[i + 1];
  47207. if (r.test(e))
  47208. return o
  47209. }
  47210. return null
  47211. }
  47212. },
  47213. n.XHRLoader = function(e) {
  47214. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  47215. }
  47216. ,
  47217. n.XHRLoader.prototype = {
  47218. constructor: n.XHRLoader,
  47219. load: function(e, t, i, r) {
  47220. void 0 !== this.path && (e = this.path + e);
  47221. var o = this
  47222. , a = n.Cache.get(e);
  47223. if (void 0 !== a)
  47224. return t && setTimeout(function() {
  47225. t(a)
  47226. }, 0),
  47227. a;
  47228. var s = new XMLHttpRequest;
  47229. return s.overrideMimeType("text/plain"),
  47230. s.open("GET", e, !0),
  47231. s.addEventListener("load", function(i) {
  47232. var a = i.target.response;
  47233. n.Cache.add(e, a),
  47234. 200 === this.status ? (t && t(a),
  47235. o.manager.itemEnd(e)) : 0 === this.status ? (console.warn("THREE.XHRLoader: HTTP Status 0 received."),
  47236. t && t(a),
  47237. o.manager.itemEnd(e)) : (r && r(i),
  47238. o.manager.itemError(e))
  47239. }, !1),
  47240. void 0 !== i && s.addEventListener("progress", function(e) {
  47241. i(e)
  47242. }, !1),
  47243. s.addEventListener("error", function(t) {
  47244. r && r(t),
  47245. o.manager.itemError(e)
  47246. }, !1),
  47247. void 0 !== this.responseType && (s.responseType = this.responseType),
  47248. void 0 !== this.withCredentials && (s.withCredentials = this.withCredentials),
  47249. s.send(null),
  47250. o.manager.itemStart(e),
  47251. s
  47252. },
  47253. setPath: function(e) {
  47254. this.path = e
  47255. },
  47256. setResponseType: function(e) {
  47257. this.responseType = e
  47258. },
  47259. setWithCredentials: function(e) {
  47260. this.withCredentials = e
  47261. }
  47262. },
  47263. n.FontLoader = function(e) {
  47264. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  47265. }
  47266. ,
  47267. n.FontLoader.prototype = {
  47268. constructor: n.FontLoader,
  47269. load: function(e, t, i, r) {
  47270. var o = new n.XHRLoader(this.manager);
  47271. o.load(e, function(e) {
  47272. t(new n.Font(JSON.parse(e.substring(65, e.length - 2))))
  47273. }, i, r)
  47274. }
  47275. },
  47276. n.ImageLoader = function(e) {
  47277. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  47278. }
  47279. ,
  47280. n.ImageLoader.prototype = {
  47281. constructor: n.ImageLoader,
  47282. load: function(e, t, i, r) {
  47283. void 0 !== this.path && (e = this.path + e);
  47284. var o = this
  47285. , a = n.Cache.get(e);
  47286. if (void 0 !== a)
  47287. return o.manager.itemStart(e),
  47288. t ? setTimeout(function() {
  47289. t(a),
  47290. o.manager.itemEnd(e)
  47291. }, 0) : o.manager.itemEnd(e),
  47292. a;
  47293. var s = document.createElement("img");
  47294. return s.addEventListener("load", function(i) {
  47295. n.Cache.add(e, this),
  47296. t && t(this),
  47297. o.manager.itemEnd(e)
  47298. }, !1),
  47299. void 0 !== i && s.addEventListener("progress", function(e) {
  47300. i(e)
  47301. }, !1),
  47302. s.addEventListener("error", function(t) {
  47303. r && r(t),
  47304. o.manager.itemError(e)
  47305. }, !1),
  47306. void 0 !== this.crossOrigin && (s.crossOrigin = this.crossOrigin),
  47307. o.manager.itemStart(e),
  47308. s.src = e,
  47309. s
  47310. },
  47311. setCrossOrigin: function(e) {
  47312. this.crossOrigin = e
  47313. },
  47314. setPath: function(e) {
  47315. this.path = e
  47316. }
  47317. },
  47318. n.JSONLoader = function(e) {
  47319. "boolean" == typeof e && (console.warn("THREE.JSONLoader: showStatus parameter has been removed from constructor."),
  47320. e = void 0),
  47321. this.manager = void 0 !== e ? e : n.DefaultLoadingManager,
  47322. this.withCredentials = !1
  47323. }
  47324. ,
  47325. n.JSONLoader.prototype = {
  47326. constructor: n.JSONLoader,
  47327. get statusDomElement() {
  47328. return void 0 === this._statusDomElement && (this._statusDomElement = document.createElement("div")),
  47329. console.warn("THREE.JSONLoader: .statusDomElement has been removed."),
  47330. this._statusDomElement
  47331. },
  47332. load: function(e, t, i, r) {
  47333. var o = this
  47334. , a = this.texturePath && "string" == typeof this.texturePath ? this.texturePath : n.Loader.prototype.extractUrlBase(e)
  47335. , s = new n.XHRLoader(this.manager);
  47336. s.setWithCredentials(this.withCredentials),
  47337. s.load(e, function(i) {
  47338. var n = JSON.parse(i)
  47339. , r = n.metadata;
  47340. if (void 0 !== r) {
  47341. var s = r.type;
  47342. if (void 0 !== s) {
  47343. if ("object" === s.toLowerCase())
  47344. return void console.error("THREE.JSONLoader: " + e + " should be loaded with THREE.ObjectLoader instead.");
  47345. if ("scene" === s.toLowerCase())
  47346. return void console.error("THREE.JSONLoader: " + e + " should be loaded with THREE.SceneLoader instead.")
  47347. }
  47348. }
  47349. var l = o.parse(n, a);
  47350. t(l.geometry, l.materials)
  47351. }, i, r)
  47352. },
  47353. setTexturePath: function(e) {
  47354. this.texturePath = e
  47355. },
  47356. parse: function(e, t) {
  47357. function i(t) {
  47358. function i(e, t) {
  47359. return e & 1 << t
  47360. }
  47361. 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;
  47362. if (void 0 !== e.uvs) {
  47363. for (r = 0; r < e.uvs.length; r++)
  47364. e.uvs[r].length && B++;
  47365. for (r = 0; r < B; r++)
  47366. s.faceVertexUvs[r] = []
  47367. }
  47368. for (l = 0,
  47369. c = L.length; l < c; )
  47370. E = new n.Vector3,
  47371. E.x = L[l++] * t,
  47372. E.y = L[l++] * t,
  47373. E.z = L[l++] * t,
  47374. s.vertices.push(E);
  47375. for (l = 0,
  47376. c = O.length; l < c; )
  47377. if (f = O[l++],
  47378. g = i(f, 0),
  47379. m = i(f, 1),
  47380. v = i(f, 3),
  47381. A = i(f, 4),
  47382. y = i(f, 5),
  47383. C = i(f, 6),
  47384. I = i(f, 7),
  47385. g) {
  47386. if (w = new n.Face3,
  47387. w.a = O[l],
  47388. w.b = O[l + 1],
  47389. w.c = O[l + 3],
  47390. _ = new n.Face3,
  47391. _.a = O[l + 1],
  47392. _.b = O[l + 2],
  47393. _.c = O[l + 3],
  47394. l += 4,
  47395. m && (p = O[l++],
  47396. w.materialIndex = p,
  47397. _.materialIndex = p),
  47398. a = s.faces.length,
  47399. v)
  47400. for (r = 0; r < B; r++)
  47401. for (S = e.uvs[r],
  47402. s.faceVertexUvs[r][a] = [],
  47403. s.faceVertexUvs[r][a + 1] = [],
  47404. o = 0; o < 4; o++)
  47405. d = O[l++],
  47406. R = S[2 * d],
  47407. P = S[2 * d + 1],
  47408. M = new n.Vector2(R,P),
  47409. 2 !== o && s.faceVertexUvs[r][a].push(M),
  47410. 0 !== o && s.faceVertexUvs[r][a + 1].push(M);
  47411. if (A && (u = 3 * O[l++],
  47412. w.normal.set(D[u++], D[u++], D[u]),
  47413. _.normal.copy(w.normal)),
  47414. y)
  47415. for (r = 0; r < 4; r++)
  47416. u = 3 * O[l++],
  47417. x = new n.Vector3(D[u++],D[u++],D[u]),
  47418. 2 !== r && w.vertexNormals.push(x),
  47419. 0 !== r && _.vertexNormals.push(x);
  47420. if (C && (h = O[l++],
  47421. T = N[h],
  47422. w.color.setHex(T),
  47423. _.color.setHex(T)),
  47424. I)
  47425. for (r = 0; r < 4; r++)
  47426. h = O[l++],
  47427. T = N[h],
  47428. 2 !== r && w.vertexColors.push(new n.Color(T)),
  47429. 0 !== r && _.vertexColors.push(new n.Color(T));
  47430. s.faces.push(w),
  47431. s.faces.push(_)
  47432. } else {
  47433. if (b = new n.Face3,
  47434. b.a = O[l++],
  47435. b.b = O[l++],
  47436. b.c = O[l++],
  47437. m && (p = O[l++],
  47438. b.materialIndex = p),
  47439. a = s.faces.length,
  47440. v)
  47441. for (r = 0; r < B; r++)
  47442. for (S = e.uvs[r],
  47443. s.faceVertexUvs[r][a] = [],
  47444. o = 0; o < 3; o++)
  47445. d = O[l++],
  47446. R = S[2 * d],
  47447. P = S[2 * d + 1],
  47448. M = new n.Vector2(R,P),
  47449. s.faceVertexUvs[r][a].push(M);
  47450. if (A && (u = 3 * O[l++],
  47451. b.normal.set(D[u++], D[u++], D[u])),
  47452. y)
  47453. for (r = 0; r < 3; r++)
  47454. u = 3 * O[l++],
  47455. x = new n.Vector3(D[u++],D[u++],D[u]),
  47456. b.vertexNormals.push(x);
  47457. if (C && (h = O[l++],
  47458. b.color.setHex(N[h])),
  47459. I)
  47460. for (r = 0; r < 3; r++)
  47461. h = O[l++],
  47462. b.vertexColors.push(new n.Color(N[h]));
  47463. s.faces.push(b)
  47464. }
  47465. }
  47466. function r() {
  47467. var t = void 0 !== e.influencesPerVertex ? e.influencesPerVertex : 2;
  47468. if (e.skinWeights)
  47469. for (var i = 0, r = e.skinWeights.length; i < r; i += t) {
  47470. var o = e.skinWeights[i]
  47471. , a = t > 1 ? e.skinWeights[i + 1] : 0
  47472. , l = t > 2 ? e.skinWeights[i + 2] : 0
  47473. , c = t > 3 ? e.skinWeights[i + 3] : 0;
  47474. s.skinWeights.push(new n.Vector4(o,a,l,c))
  47475. }
  47476. if (e.skinIndices)
  47477. for (var i = 0, r = e.skinIndices.length; i < r; i += t) {
  47478. var h = e.skinIndices[i]
  47479. , u = t > 1 ? e.skinIndices[i + 1] : 0
  47480. , d = t > 2 ? e.skinIndices[i + 2] : 0
  47481. , p = t > 3 ? e.skinIndices[i + 3] : 0;
  47482. s.skinIndices.push(new n.Vector4(h,u,d,p))
  47483. }
  47484. s.bones = e.bones,
  47485. 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.")
  47486. }
  47487. function o(t) {
  47488. if (void 0 !== e.morphTargets)
  47489. for (var i = 0, r = e.morphTargets.length; i < r; i++) {
  47490. s.morphTargets[i] = {},
  47491. s.morphTargets[i].name = e.morphTargets[i].name,
  47492. s.morphTargets[i].vertices = [];
  47493. for (var o = s.morphTargets[i].vertices, a = e.morphTargets[i].vertices, l = 0, c = a.length; l < c; l += 3) {
  47494. var h = new n.Vector3;
  47495. h.x = a[l] * t,
  47496. h.y = a[l + 1] * t,
  47497. h.z = a[l + 2] * t,
  47498. o.push(h)
  47499. }
  47500. }
  47501. if (void 0 !== e.morphColors && e.morphColors.length > 0) {
  47502. console.warn('THREE.JSONLoader: "morphColors" no longer supported. Using them as face colors.');
  47503. for (var u = s.faces, d = e.morphColors[0].colors, i = 0, r = u.length; i < r; i++)
  47504. u[i].color.fromArray(d, 3 * i)
  47505. }
  47506. }
  47507. function a() {
  47508. var t = []
  47509. , i = [];
  47510. void 0 !== e.animation && i.push(e.animation),
  47511. void 0 !== e.animations && (e.animations.length ? i = i.concat(e.animations) : i.push(e.animations));
  47512. for (var r = 0; r < i.length; r++) {
  47513. var o = n.AnimationClip.parseAnimation(i[r], s.bones);
  47514. o && t.push(o)
  47515. }
  47516. if (s.morphTargets) {
  47517. var a = n.AnimationClip.CreateClipsFromMorphTargetSequences(s.morphTargets, 10);
  47518. t = t.concat(a)
  47519. }
  47520. t.length > 0 && (s.animations = t)
  47521. }
  47522. var s = new n.Geometry
  47523. , l = void 0 !== e.scale ? 1 / e.scale : 1;
  47524. if (i(l),
  47525. r(),
  47526. o(l),
  47527. a(),
  47528. s.computeFaceNormals(),
  47529. s.computeBoundingSphere(),
  47530. void 0 === e.materials || 0 === e.materials.length)
  47531. return {
  47532. geometry: s
  47533. };
  47534. var c = n.Loader.prototype.initMaterials(e.materials, t, this.crossOrigin);
  47535. return {
  47536. geometry: s,
  47537. materials: c
  47538. }
  47539. }
  47540. },
  47541. n.LoadingManager = function(e, t, i) {
  47542. var n = this
  47543. , r = !1
  47544. , o = 0
  47545. , a = 0;
  47546. this.onStart = void 0,
  47547. this.onLoad = e,
  47548. this.onProgress = t,
  47549. this.onError = i,
  47550. this.itemStart = function(e) {
  47551. a++,
  47552. r === !1 && void 0 !== n.onStart && n.onStart(e, o, a),
  47553. r = !0
  47554. }
  47555. ,
  47556. this.itemEnd = function(e) {
  47557. o++,
  47558. void 0 !== n.onProgress && n.onProgress(e, o, a),
  47559. o === a && (r = !1,
  47560. void 0 !== n.onLoad && n.onLoad())
  47561. }
  47562. ,
  47563. this.itemError = function(e) {
  47564. void 0 !== n.onError && n.onError(e)
  47565. }
  47566. }
  47567. ,
  47568. n.DefaultLoadingManager = new n.LoadingManager,
  47569. n.BufferGeometryLoader = function(e) {
  47570. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  47571. }
  47572. ,
  47573. n.BufferGeometryLoader.prototype = {
  47574. constructor: n.BufferGeometryLoader,
  47575. load: function(e, t, i, r) {
  47576. var o = this
  47577. , a = new n.XHRLoader(o.manager);
  47578. a.load(e, function(e) {
  47579. t(o.parse(JSON.parse(e)))
  47580. }, i, r)
  47581. },
  47582. parse: function(e) {
  47583. var t = new n.BufferGeometry
  47584. , i = e.data.index
  47585. , r = {
  47586. Int8Array: Int8Array,
  47587. Uint8Array: Uint8Array,
  47588. Uint8ClampedArray: Uint8ClampedArray,
  47589. Int16Array: Int16Array,
  47590. Uint16Array: Uint16Array,
  47591. Int32Array: Int32Array,
  47592. Uint32Array: Uint32Array,
  47593. Float32Array: Float32Array,
  47594. Float64Array: Float64Array
  47595. };
  47596. if (void 0 !== i) {
  47597. var o = new r[i.type](i.array);
  47598. t.setIndex(new n.BufferAttribute(o,1))
  47599. }
  47600. var a = e.data.attributes;
  47601. for (var s in a) {
  47602. var l = a[s]
  47603. , o = new r[l.type](l.array);
  47604. t.addAttribute(s, new n.BufferAttribute(o,l.itemSize))
  47605. }
  47606. var c = e.data.groups || e.data.drawcalls || e.data.offsets;
  47607. if (void 0 !== c)
  47608. for (var h = 0, u = c.length; h !== u; ++h) {
  47609. var d = c[h];
  47610. t.addGroup(d.start, d.count, d.materialIndex)
  47611. }
  47612. var p = e.data.boundingSphere;
  47613. if (void 0 !== p) {
  47614. var f = new n.Vector3;
  47615. void 0 !== p.center && f.fromArray(p.center),
  47616. t.boundingSphere = new n.Sphere(f,p.radius)
  47617. }
  47618. return t
  47619. }
  47620. },
  47621. n.MaterialLoader = function(e) {
  47622. this.manager = void 0 !== e ? e : n.DefaultLoadingManager,
  47623. this.textures = {}
  47624. }
  47625. ,
  47626. n.MaterialLoader.prototype = {
  47627. constructor: n.MaterialLoader,
  47628. load: function(e, t, i, r) {
  47629. var o = this
  47630. , a = new n.XHRLoader(o.manager);
  47631. a.load(e, function(e) {
  47632. t(o.parse(JSON.parse(e)))
  47633. }, i, r)
  47634. },
  47635. setTextures: function(e) {
  47636. this.textures = e
  47637. },
  47638. getTexture: function(e) {
  47639. var t = this.textures;
  47640. return void 0 === t[e] && console.warn("THREE.MaterialLoader: Undefined texture", e),
  47641. t[e]
  47642. },
  47643. parse: function(e) {
  47644. var t = new n[e.type];
  47645. if (void 0 !== e.uuid && (t.uuid = e.uuid),
  47646. void 0 !== e.name && (t.name = e.name),
  47647. void 0 !== e.color && t.color.setHex(e.color),
  47648. void 0 !== e.roughness && (t.roughness = e.roughness),
  47649. void 0 !== e.metalness && (t.metalness = e.metalness),
  47650. void 0 !== e.emissive && t.emissive.setHex(e.emissive),
  47651. void 0 !== e.specular && t.specular.setHex(e.specular),
  47652. void 0 !== e.shininess && (t.shininess = e.shininess),
  47653. void 0 !== e.uniforms && (t.uniforms = e.uniforms),
  47654. void 0 !== e.vertexShader && (t.vertexShader = e.vertexShader),
  47655. void 0 !== e.fragmentShader && (t.fragmentShader = e.fragmentShader),
  47656. void 0 !== e.vertexColors && (t.vertexColors = e.vertexColors),
  47657. void 0 !== e.shading && (t.shading = e.shading),
  47658. void 0 !== e.blending && (t.blending = e.blending),
  47659. void 0 !== e.side && (t.side = e.side),
  47660. void 0 !== e.opacity && (t.opacity = e.opacity),
  47661. void 0 !== e.transparent && (t.transparent = e.transparent),
  47662. void 0 !== e.alphaTest && (t.alphaTest = e.alphaTest),
  47663. void 0 !== e.depthTest && (t.depthTest = e.depthTest),
  47664. void 0 !== e.depthWrite && (t.depthWrite = e.depthWrite),
  47665. void 0 !== e.colorWrite && (t.colorWrite = e.colorWrite),
  47666. void 0 !== e.wireframe && (t.wireframe = e.wireframe),
  47667. void 0 !== e.wireframeLinewidth && (t.wireframeLinewidth = e.wireframeLinewidth),
  47668. void 0 !== e.size && (t.size = e.size),
  47669. void 0 !== e.sizeAttenuation && (t.sizeAttenuation = e.sizeAttenuation),
  47670. void 0 !== e.map && (t.map = this.getTexture(e.map)),
  47671. void 0 !== e.alphaMap && (t.alphaMap = this.getTexture(e.alphaMap),
  47672. t.transparent = !0),
  47673. void 0 !== e.bumpMap && (t.bumpMap = this.getTexture(e.bumpMap)),
  47674. void 0 !== e.bumpScale && (t.bumpScale = e.bumpScale),
  47675. void 0 !== e.normalMap && (t.normalMap = this.getTexture(e.normalMap)),
  47676. void 0 !== e.normalScale) {
  47677. var i = e.normalScale;
  47678. Array.isArray(i) === !1 && (i = [i, i]),
  47679. t.normalScale = (new n.Vector2).fromArray(i)
  47680. }
  47681. if (void 0 !== e.displacementMap && (t.displacementMap = this.getTexture(e.displacementMap)),
  47682. void 0 !== e.displacementScale && (t.displacementScale = e.displacementScale),
  47683. void 0 !== e.displacementBias && (t.displacementBias = e.displacementBias),
  47684. void 0 !== e.roughnessMap && (t.roughnessMap = this.getTexture(e.roughnessMap)),
  47685. void 0 !== e.metalnessMap && (t.metalnessMap = this.getTexture(e.metalnessMap)),
  47686. void 0 !== e.emissiveMap && (t.emissiveMap = this.getTexture(e.emissiveMap)),
  47687. void 0 !== e.emissiveIntensity && (t.emissiveIntensity = e.emissiveIntensity),
  47688. void 0 !== e.specularMap && (t.specularMap = this.getTexture(e.specularMap)),
  47689. void 0 !== e.envMap && (t.envMap = this.getTexture(e.envMap),
  47690. t.combine = n.MultiplyOperation),
  47691. e.reflectivity && (t.reflectivity = e.reflectivity),
  47692. void 0 !== e.lightMap && (t.lightMap = this.getTexture(e.lightMap)),
  47693. void 0 !== e.lightMapIntensity && (t.lightMapIntensity = e.lightMapIntensity),
  47694. void 0 !== e.aoMap && (t.aoMap = this.getTexture(e.aoMap)),
  47695. void 0 !== e.aoMapIntensity && (t.aoMapIntensity = e.aoMapIntensity),
  47696. void 0 !== e.materials)
  47697. for (var r = 0, o = e.materials.length; r < o; r++)
  47698. t.materials.push(this.parse(e.materials[r]));
  47699. return t
  47700. }
  47701. },
  47702. n.ObjectLoader = function(e) {
  47703. this.manager = void 0 !== e ? e : n.DefaultLoadingManager,
  47704. this.texturePath = ""
  47705. }
  47706. ,
  47707. n.ObjectLoader.prototype = {
  47708. constructor: n.ObjectLoader,
  47709. load: function(e, t, i, r) {
  47710. "" === this.texturePath && (this.texturePath = e.substring(0, e.lastIndexOf("/") + 1));
  47711. var o = this
  47712. , a = new n.XHRLoader(o.manager);
  47713. a.load(e, function(e) {
  47714. o.parse(JSON.parse(e), t)
  47715. }, i, r)
  47716. },
  47717. setTexturePath: function(e) {
  47718. this.texturePath = e
  47719. },
  47720. setCrossOrigin: function(e) {
  47721. this.crossOrigin = e
  47722. },
  47723. parse: function(e, t) {
  47724. var i = this.parseGeometries(e.geometries)
  47725. , n = this.parseImages(e.images, function() {
  47726. void 0 !== t && t(a)
  47727. })
  47728. , r = this.parseTextures(e.textures, n)
  47729. , o = this.parseMaterials(e.materials, r)
  47730. , a = this.parseObject(e.object, i, o);
  47731. return e.animations && (a.animations = this.parseAnimations(e.animations)),
  47732. void 0 !== e.images && 0 !== e.images.length || void 0 !== t && t(a),
  47733. a
  47734. },
  47735. parseGeometries: function(e) {
  47736. var t = {};
  47737. if (void 0 !== e)
  47738. for (var i = new n.JSONLoader, r = new n.BufferGeometryLoader, o = 0, a = e.length; o < a; o++) {
  47739. var s, l = e[o];
  47740. switch (l.type) {
  47741. case "PlaneGeometry":
  47742. case "PlaneBufferGeometry":
  47743. s = new n[l.type](l.width,l.height,l.widthSegments,l.heightSegments);
  47744. break;
  47745. case "BoxGeometry":
  47746. case "BoxBufferGeometry":
  47747. case "CubeGeometry":
  47748. s = new n[l.type](l.width,l.height,l.depth,l.widthSegments,l.heightSegments,l.depthSegments);
  47749. break;
  47750. case "CircleGeometry":
  47751. case "CircleBufferGeometry":
  47752. s = new n[l.type](l.radius,l.segments,l.thetaStart,l.thetaLength);
  47753. break;
  47754. case "CylinderGeometry":
  47755. case "CylinderBufferGeometry":
  47756. s = new n[l.type](l.radiusTop,l.radiusBottom,l.height,l.radialSegments,l.heightSegments,l.openEnded,l.thetaStart,l.thetaLength);
  47757. break;
  47758. case "SphereGeometry":
  47759. case "SphereBufferGeometry":
  47760. s = new n[l.type](l.radius,l.widthSegments,l.heightSegments,l.phiStart,l.phiLength,l.thetaStart,l.thetaLength);
  47761. break;
  47762. case "DodecahedronGeometry":
  47763. s = new n.DodecahedronGeometry(l.radius,l.detail);
  47764. break;
  47765. case "IcosahedronGeometry":
  47766. s = new n.IcosahedronGeometry(l.radius,l.detail);
  47767. break;
  47768. case "OctahedronGeometry":
  47769. s = new n.OctahedronGeometry(l.radius,l.detail);
  47770. break;
  47771. case "TetrahedronGeometry":
  47772. s = new n.TetrahedronGeometry(l.radius,l.detail);
  47773. break;
  47774. case "RingGeometry":
  47775. case "RingBufferGeometry":
  47776. s = new n[l.type](l.innerRadius,l.outerRadius,l.thetaSegments,l.phiSegments,l.thetaStart,l.thetaLength);
  47777. break;
  47778. case "TorusGeometry":
  47779. case "TorusBufferGeometry":
  47780. s = new n[l.type](l.radius,l.tube,l.radialSegments,l.tubularSegments,l.arc);
  47781. break;
  47782. case "TorusKnotGeometry":
  47783. case "TorusKnotBufferGeometry":
  47784. s = new n[l.type](l.radius,l.tube,l.tubularSegments,l.radialSegments,l.p,l.q);
  47785. break;
  47786. case "LatheGeometry":
  47787. s = new n.LatheGeometry(l.points,l.segments,l.phiStart,l.phiLength);
  47788. break;
  47789. case "BufferGeometry":
  47790. s = r.parse(l);
  47791. break;
  47792. case "Geometry":
  47793. s = i.parse(l.data, this.texturePath).geometry;
  47794. break;
  47795. default:
  47796. console.warn('THREE.ObjectLoader: Unsupported geometry type "' + l.type + '"');
  47797. continue
  47798. }
  47799. s.uuid = l.uuid,
  47800. void 0 !== l.name && (s.name = l.name),
  47801. t[l.uuid] = s
  47802. }
  47803. return t
  47804. },
  47805. parseMaterials: function(e, t) {
  47806. var i = {};
  47807. if (void 0 !== e) {
  47808. var r = new n.MaterialLoader;
  47809. r.setTextures(t);
  47810. for (var o = 0, a = e.length; o < a; o++) {
  47811. var s = r.parse(e[o]);
  47812. i[s.uuid] = s
  47813. }
  47814. }
  47815. return i
  47816. },
  47817. parseAnimations: function(e) {
  47818. for (var t = [], i = 0; i < e.length; i++) {
  47819. var r = n.AnimationClip.parse(e[i]);
  47820. t.push(r)
  47821. }
  47822. return t
  47823. },
  47824. parseImages: function(e, t) {
  47825. function i(e) {
  47826. return r.manager.itemStart(e),
  47827. s.load(e, function() {
  47828. r.manager.itemEnd(e)
  47829. })
  47830. }
  47831. var r = this
  47832. , o = {};
  47833. if (void 0 !== e && e.length > 0) {
  47834. var a = new n.LoadingManager(t)
  47835. , s = new n.ImageLoader(a);
  47836. s.setCrossOrigin(this.crossOrigin);
  47837. for (var l = 0, c = e.length; l < c; l++) {
  47838. var h = e[l]
  47839. , u = /^(\/\/)|([a-z]+:(\/\/)?)/i.test(h.url) ? h.url : r.texturePath + h.url;
  47840. o[h.uuid] = i(u)
  47841. }
  47842. }
  47843. return o
  47844. },
  47845. parseTextures: function(e, t) {
  47846. function i(e) {
  47847. return "number" == typeof e ? e : (console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.", e),
  47848. n[e])
  47849. }
  47850. var r = {};
  47851. if (void 0 !== e)
  47852. for (var o = 0, a = e.length; o < a; o++) {
  47853. var s = e[o];
  47854. void 0 === s.image && console.warn('THREE.ObjectLoader: No "image" specified for', s.uuid),
  47855. void 0 === t[s.image] && console.warn("THREE.ObjectLoader: Undefined image", s.image);
  47856. var l = new n.Texture(t[s.image]);
  47857. l.needsUpdate = !0,
  47858. l.uuid = s.uuid,
  47859. void 0 !== s.name && (l.name = s.name),
  47860. void 0 !== s.mapping && (l.mapping = i(s.mapping)),
  47861. void 0 !== s.offset && (l.offset = new n.Vector2(s.offset[0],s.offset[1])),
  47862. void 0 !== s.repeat && (l.repeat = new n.Vector2(s.repeat[0],s.repeat[1])),
  47863. void 0 !== s.minFilter && (l.minFilter = i(s.minFilter)),
  47864. void 0 !== s.magFilter && (l.magFilter = i(s.magFilter)),
  47865. void 0 !== s.anisotropy && (l.anisotropy = s.anisotropy),
  47866. Array.isArray(s.wrap) && (l.wrapS = i(s.wrap[0]),
  47867. l.wrapT = i(s.wrap[1])),
  47868. r[s.uuid] = l
  47869. }
  47870. return r
  47871. },
  47872. parseObject: function() {
  47873. var e = new n.Matrix4;
  47874. return function(t, i, r) {
  47875. function o(e) {
  47876. return void 0 === i[e] && console.warn("THREE.ObjectLoader: Undefined geometry", e),
  47877. i[e]
  47878. }
  47879. function a(e) {
  47880. if (void 0 !== e)
  47881. return void 0 === r[e] && console.warn("THREE.ObjectLoader: Undefined material", e),
  47882. r[e]
  47883. }
  47884. var s;
  47885. switch (t.type) {
  47886. case "Scene":
  47887. s = new n.Scene;
  47888. break;
  47889. case "PerspectiveCamera":
  47890. s = new n.PerspectiveCamera(t.fov,t.aspect,t.near,t.far);
  47891. break;
  47892. case "OrthographicCamera":
  47893. s = new n.OrthographicCamera(t.left,t.right,t.top,t.bottom,t.near,t.far);
  47894. break;
  47895. case "AmbientLight":
  47896. s = new n.AmbientLight(t.color,t.intensity);
  47897. break;
  47898. case "DirectionalLight":
  47899. s = new n.DirectionalLight(t.color,t.intensity);
  47900. break;
  47901. case "PointLight":
  47902. s = new n.PointLight(t.color,t.intensity,t.distance,t.decay);
  47903. break;
  47904. case "SpotLight":
  47905. s = new n.SpotLight(t.color,t.intensity,t.distance,t.angle,t.penumbra,t.decay);
  47906. break;
  47907. case "HemisphereLight":
  47908. s = new n.HemisphereLight(t.color,t.groundColor,t.intensity);
  47909. break;
  47910. case "Mesh":
  47911. var l = o(t.geometry)
  47912. , c = a(t.material);
  47913. s = l.bones && l.bones.length > 0 ? new n.SkinnedMesh(l,c) : new n.Mesh(l,c);
  47914. break;
  47915. case "LOD":
  47916. s = new n.LOD;
  47917. break;
  47918. case "Line":
  47919. s = new n.Line(o(t.geometry),a(t.material),t.mode);
  47920. break;
  47921. case "PointCloud":
  47922. case "Points":
  47923. s = new n.Points(o(t.geometry),a(t.material));
  47924. break;
  47925. case "Sprite":
  47926. s = new n.Sprite(a(t.material));
  47927. break;
  47928. case "Group":
  47929. s = new n.Group;
  47930. break;
  47931. default:
  47932. s = new n.Object3D
  47933. }
  47934. if (s.uuid = t.uuid,
  47935. void 0 !== t.name && (s.name = t.name),
  47936. void 0 !== t.matrix ? (e.fromArray(t.matrix),
  47937. e.decompose(s.position, s.quaternion, s.scale)) : (void 0 !== t.position && s.position.fromArray(t.position),
  47938. void 0 !== t.rotation && s.rotation.fromArray(t.rotation),
  47939. void 0 !== t.scale && s.scale.fromArray(t.scale)),
  47940. void 0 !== t.castShadow && (s.castShadow = t.castShadow),
  47941. void 0 !== t.receiveShadow && (s.receiveShadow = t.receiveShadow),
  47942. void 0 !== t.visible && (s.visible = t.visible),
  47943. void 0 !== t.userData && (s.userData = t.userData),
  47944. void 0 !== t.children)
  47945. for (var h in t.children)
  47946. s.add(this.parseObject(t.children[h], i, r));
  47947. if ("LOD" === t.type)
  47948. for (var u = t.levels, d = 0; d < u.length; d++) {
  47949. var p = u[d]
  47950. , h = s.getObjectByProperty("uuid", p.object);
  47951. void 0 !== h && s.addLevel(h, p.distance)
  47952. }
  47953. return s
  47954. }
  47955. }()
  47956. },
  47957. n.TextureLoader = function(e) {
  47958. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  47959. }
  47960. ,
  47961. n.TextureLoader.prototype = {
  47962. constructor: n.TextureLoader,
  47963. load: function(e, t, i, r) {
  47964. var o = new n.Texture
  47965. , a = new n.ImageLoader(this.manager);
  47966. return a.setCrossOrigin(this.crossOrigin),
  47967. a.setPath(this.path),
  47968. a.load(e, function(e) {
  47969. o.image = e,
  47970. o.needsUpdate = !0,
  47971. void 0 !== t && t(o)
  47972. }, i, r),
  47973. o
  47974. },
  47975. setCrossOrigin: function(e) {
  47976. this.crossOrigin = e
  47977. },
  47978. setPath: function(e) {
  47979. this.path = e
  47980. }
  47981. },
  47982. n.CubeTextureLoader = function(e) {
  47983. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  47984. }
  47985. ,
  47986. n.CubeTextureLoader.prototype = {
  47987. constructor: n.CubeTextureLoader,
  47988. load: function(e, t, i, r) {
  47989. function o(i) {
  47990. s.load(e[i], function(e) {
  47991. a.images[i] = e,
  47992. l++,
  47993. 6 === l && (a.needsUpdate = !0,
  47994. t && t(a))
  47995. }, void 0, r)
  47996. }
  47997. var a = new n.CubeTexture
  47998. , s = new n.ImageLoader(this.manager);
  47999. s.setCrossOrigin(this.crossOrigin),
  48000. s.setPath(this.path);
  48001. for (var l = 0, c = 0; c < e.length; ++c)
  48002. o(c);
  48003. return a
  48004. },
  48005. setCrossOrigin: function(e) {
  48006. this.crossOrigin = e
  48007. },
  48008. setPath: function(e) {
  48009. this.path = e
  48010. }
  48011. },
  48012. n.DataTextureLoader = n.BinaryTextureLoader = function(e) {
  48013. this.manager = void 0 !== e ? e : n.DefaultLoadingManager,
  48014. this._parser = null
  48015. }
  48016. ,
  48017. n.BinaryTextureLoader.prototype = {
  48018. constructor: n.BinaryTextureLoader,
  48019. load: function(e, t, i, r) {
  48020. var o = this
  48021. , a = new n.DataTexture
  48022. , s = new n.XHRLoader(this.manager);
  48023. return s.setResponseType("arraybuffer"),
  48024. s.load(e, function(e) {
  48025. var i = o._parser(e);
  48026. i && (void 0 !== i.image ? a.image = i.image : void 0 !== i.data && (a.image.width = i.width,
  48027. a.image.height = i.height,
  48028. a.image.data = i.data),
  48029. a.wrapS = void 0 !== i.wrapS ? i.wrapS : n.ClampToEdgeWrapping,
  48030. a.wrapT = void 0 !== i.wrapT ? i.wrapT : n.ClampToEdgeWrapping,
  48031. a.magFilter = void 0 !== i.magFilter ? i.magFilter : n.LinearFilter,
  48032. a.minFilter = void 0 !== i.minFilter ? i.minFilter : n.LinearMipMapLinearFilter,
  48033. a.anisotropy = void 0 !== i.anisotropy ? i.anisotropy : 1,
  48034. void 0 !== i.format && (a.format = i.format),
  48035. void 0 !== i.type && (a.type = i.type),
  48036. void 0 !== i.mipmaps && (a.mipmaps = i.mipmaps),
  48037. 1 === i.mipmapCount && (a.minFilter = n.LinearFilter),
  48038. a.needsUpdate = !0,
  48039. t && t(a, i))
  48040. }, i, r),
  48041. a
  48042. }
  48043. },
  48044. n.CompressedTextureLoader = function(e) {
  48045. this.manager = void 0 !== e ? e : n.DefaultLoadingManager,
  48046. this._parser = null
  48047. }
  48048. ;
  48049. n.CompressedTextureLoader.prototype = {
  48050. constructor: n.CompressedTextureLoader,
  48051. load: function(e, t, i, r) {
  48052. function o(o) {
  48053. c.load(e[o], function(e) {
  48054. var i = a._parser(e, !0);
  48055. s[o] = {
  48056. width: i.width,
  48057. height: i.height,
  48058. format: i.format,
  48059. mipmaps: i.mipmaps
  48060. },
  48061. h += 1,
  48062. 6 === h && (1 === i.mipmapCount && (l.minFilter = n.LinearFilter),
  48063. l.format = i.format,
  48064. l.needsUpdate = !0,
  48065. t && t(l))
  48066. }, i, r)
  48067. }
  48068. var a = this
  48069. , s = []
  48070. , l = new n.CompressedTexture;
  48071. l.image = s;
  48072. var c = new n.XHRLoader(this.manager);
  48073. if (c.setPath(this.path),
  48074. c.setResponseType("arraybuffer"),
  48075. Array.isArray(e))
  48076. for (var h = 0, u = 0, d = e.length; u < d; ++u)
  48077. o(u);
  48078. else
  48079. c.load(e, function(e) {
  48080. var i = a._parser(e, !0);
  48081. if (i.isCubemap)
  48082. for (var r = i.mipmaps.length / i.mipmapCount, o = 0; o < r; o++) {
  48083. s[o] = {
  48084. mipmaps: []
  48085. };
  48086. for (var c = 0; c < i.mipmapCount; c++)
  48087. s[o].mipmaps.push(i.mipmaps[o * i.mipmapCount + c]),
  48088. s[o].format = i.format,
  48089. s[o].width = i.width,
  48090. s[o].height = i.height
  48091. }
  48092. else
  48093. l.image.width = i.width,
  48094. l.image.height = i.height,
  48095. l.mipmaps = i.mipmaps;
  48096. 1 === i.mipmapCount && (l.minFilter = n.LinearFilter),
  48097. l.format = i.format,
  48098. l.needsUpdate = !0,
  48099. t && t(l)
  48100. }, i, r);
  48101. return l
  48102. },
  48103. setPath: function(e) {
  48104. this.path = e
  48105. }
  48106. };
  48107. n.Material = function() {
  48108. Object.defineProperty(this, "id", {
  48109. value: n.MaterialIdCount++
  48110. }),
  48111. this.uuid = n.Math.generateUUID(),
  48112. this.name = "",
  48113. this.type = "Material",
  48114. this.side = n.FrontSide,
  48115. this.opacity = 1,
  48116. this.transparent = !1,
  48117. this.blending = n.NormalBlending,
  48118. this.blendSrc = n.SrcAlphaFactor,
  48119. this.blendDst = n.OneMinusSrcAlphaFactor,
  48120. this.blendEquation = n.AddEquation,
  48121. this.blendSrcAlpha = null,
  48122. this.blendDstAlpha = null,
  48123. this.blendEquationAlpha = null,
  48124. this.depthFunc = n.LessEqualDepth,
  48125. this.depthTest = !0,
  48126. this.depthWrite = !0,
  48127. this.colorWrite = !0,
  48128. this.precision = null,
  48129. this.polygonOffset = !1,
  48130. this.polygonOffsetFactor = 0,
  48131. this.polygonOffsetUnits = 0,
  48132. this.alphaTest = 0,
  48133. this.premultipliedAlpha = !1,
  48134. this.overdraw = 0,
  48135. this.visible = !0,
  48136. this._needsUpdate = !0
  48137. }
  48138. ,
  48139. n.Material.prototype = {
  48140. constructor: n.Material,
  48141. get needsUpdate() {
  48142. return this._needsUpdate
  48143. },
  48144. set needsUpdate(e) {
  48145. e === !0 && this.update(),
  48146. this._needsUpdate = e
  48147. },
  48148. setValues: function(e) {
  48149. if (void 0 !== e)
  48150. for (var t in e) {
  48151. var i = e[t];
  48152. if (void 0 !== i) {
  48153. var r = this[t];
  48154. 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.")
  48155. } else
  48156. console.warn("THREE.Material: '" + t + "' parameter is undefined.")
  48157. }
  48158. },
  48159. toJSON: function(e) {
  48160. function t(e) {
  48161. var t = [];
  48162. for (var i in e) {
  48163. var n = e[i];
  48164. delete n.metadata,
  48165. t.push(n)
  48166. }
  48167. return t
  48168. }
  48169. var i = void 0 === e;
  48170. i && (e = {
  48171. textures: {},
  48172. images: {}
  48173. });
  48174. var r = {
  48175. metadata: {
  48176. version: 4.4,
  48177. type: "Material",
  48178. generator: "Material.toJSON"
  48179. }
  48180. };
  48181. if (r.uuid = this.uuid,
  48182. r.type = this.type,
  48183. "" !== this.name && (r.name = this.name),
  48184. this.color instanceof n.Color && (r.color = this.color.getHex()),
  48185. .5 !== this.roughness && (r.roughness = this.roughness),
  48186. .5 !== this.metalness && (r.metalness = this.metalness),
  48187. this.emissive instanceof n.Color && (r.emissive = this.emissive.getHex()),
  48188. this.specular instanceof n.Color && (r.specular = this.specular.getHex()),
  48189. void 0 !== this.shininess && (r.shininess = this.shininess),
  48190. this.map instanceof n.Texture && (r.map = this.map.toJSON(e).uuid),
  48191. this.alphaMap instanceof n.Texture && (r.alphaMap = this.alphaMap.toJSON(e).uuid),
  48192. this.lightMap instanceof n.Texture && (r.lightMap = this.lightMap.toJSON(e).uuid),
  48193. this.bumpMap instanceof n.Texture && (r.bumpMap = this.bumpMap.toJSON(e).uuid,
  48194. r.bumpScale = this.bumpScale),
  48195. this.normalMap instanceof n.Texture && (r.normalMap = this.normalMap.toJSON(e).uuid,
  48196. r.normalScale = this.normalScale.toArray()),
  48197. this.displacementMap instanceof n.Texture && (r.displacementMap = this.displacementMap.toJSON(e).uuid,
  48198. r.displacementScale = this.displacementScale,
  48199. r.displacementBias = this.displacementBias),
  48200. this.roughnessMap instanceof n.Texture && (r.roughnessMap = this.roughnessMap.toJSON(e).uuid),
  48201. this.metalnessMap instanceof n.Texture && (r.metalnessMap = this.metalnessMap.toJSON(e).uuid),
  48202. this.emissiveMap instanceof n.Texture && (r.emissiveMap = this.emissiveMap.toJSON(e).uuid),
  48203. this.specularMap instanceof n.Texture && (r.specularMap = this.specularMap.toJSON(e).uuid),
  48204. this.envMap instanceof n.Texture && (r.envMap = this.envMap.toJSON(e).uuid,
  48205. r.reflectivity = this.reflectivity),
  48206. void 0 !== this.size && (r.size = this.size),
  48207. void 0 !== this.sizeAttenuation && (r.sizeAttenuation = this.sizeAttenuation),
  48208. void 0 !== this.vertexColors && this.vertexColors !== n.NoColors && (r.vertexColors = this.vertexColors),
  48209. void 0 !== this.shading && this.shading !== n.SmoothShading && (r.shading = this.shading),
  48210. void 0 !== this.blending && this.blending !== n.NormalBlending && (r.blending = this.blending),
  48211. void 0 !== this.side && this.side !== n.FrontSide && (r.side = this.side),
  48212. this.opacity < 1 && (r.opacity = this.opacity),
  48213. this.transparent === !0 && (r.transparent = this.transparent),
  48214. this.alphaTest > 0 && (r.alphaTest = this.alphaTest),
  48215. this.premultipliedAlpha === !0 && (r.premultipliedAlpha = this.premultipliedAlpha),
  48216. this.wireframe === !0 && (r.wireframe = this.wireframe),
  48217. this.wireframeLinewidth > 1 && (r.wireframeLinewidth = this.wireframeLinewidth),
  48218. i) {
  48219. var o = t(e.textures)
  48220. , a = t(e.images);
  48221. o.length > 0 && (r.textures = o),
  48222. a.length > 0 && (r.images = a)
  48223. }
  48224. return r
  48225. },
  48226. clone: function() {
  48227. return (new this.constructor).copy(this)
  48228. },
  48229. copy: function(e) {
  48230. return this.name = e.name,
  48231. this.side = e.side,
  48232. this.opacity = e.opacity,
  48233. this.transparent = e.transparent,
  48234. this.blending = e.blending,
  48235. this.blendSrc = e.blendSrc,
  48236. this.blendDst = e.blendDst,
  48237. this.blendEquation = e.blendEquation,
  48238. this.blendSrcAlpha = e.blendSrcAlpha,
  48239. this.blendDstAlpha = e.blendDstAlpha,
  48240. this.blendEquationAlpha = e.blendEquationAlpha,
  48241. this.depthFunc = e.depthFunc,
  48242. this.depthTest = e.depthTest,
  48243. this.depthWrite = e.depthWrite,
  48244. this.colorWrite = e.colorWrite,
  48245. this.precision = e.precision,
  48246. this.polygonOffset = e.polygonOffset,
  48247. this.polygonOffsetFactor = e.polygonOffsetFactor,
  48248. this.polygonOffsetUnits = e.polygonOffsetUnits,
  48249. this.alphaTest = e.alphaTest,
  48250. this.premultipliedAlpha = e.premultipliedAlpha,
  48251. this.overdraw = e.overdraw,
  48252. this.visible = e.visible,
  48253. this
  48254. },
  48255. update: function() {
  48256. this.dispatchEvent({
  48257. type: "update"
  48258. })
  48259. },
  48260. dispose: function() {
  48261. this.dispatchEvent({
  48262. type: "dispose"
  48263. })
  48264. }
  48265. },
  48266. n.EventDispatcher.prototype.apply(n.Material.prototype),
  48267. n.MaterialIdCount = 0,
  48268. n.LineBasicMaterial = function(e) {
  48269. n.Material.call(this),
  48270. this.type = "LineBasicMaterial",
  48271. this.color = new n.Color(16777215),
  48272. this.linewidth = 1,
  48273. this.linecap = "round",
  48274. this.linejoin = "round",
  48275. this.blending = n.NormalBlending,
  48276. this.vertexColors = n.NoColors,
  48277. this.fog = !0,
  48278. this.setValues(e)
  48279. }
  48280. ,
  48281. n.LineBasicMaterial.prototype = Object.create(n.Material.prototype),
  48282. n.LineBasicMaterial.prototype.constructor = n.LineBasicMaterial,
  48283. n.LineBasicMaterial.prototype.copy = function(e) {
  48284. return n.Material.prototype.copy.call(this, e),
  48285. this.color.copy(e.color),
  48286. this.linewidth = e.linewidth,
  48287. this.linecap = e.linecap,
  48288. this.linejoin = e.linejoin,
  48289. this.vertexColors = e.vertexColors,
  48290. this.fog = e.fog,
  48291. this
  48292. }
  48293. ,
  48294. n.LineDashedMaterial = function(e) {
  48295. n.Material.call(this),
  48296. this.type = "LineDashedMaterial",
  48297. this.color = new n.Color(16777215),
  48298. this.linewidth = 1,
  48299. this.scale = 1,
  48300. this.dashSize = 3,
  48301. this.gapSize = 1,
  48302. this.blending = n.NormalBlending,
  48303. this.vertexColors = n.NoColors,
  48304. this.fog = !0,
  48305. this.setValues(e)
  48306. }
  48307. ,
  48308. n.LineDashedMaterial.prototype = Object.create(n.Material.prototype),
  48309. n.LineDashedMaterial.prototype.constructor = n.LineDashedMaterial,
  48310. n.LineDashedMaterial.prototype.copy = function(e) {
  48311. return n.Material.prototype.copy.call(this, e),
  48312. this.color.copy(e.color),
  48313. this.linewidth = e.linewidth,
  48314. this.scale = e.scale,
  48315. this.dashSize = e.dashSize,
  48316. this.gapSize = e.gapSize,
  48317. this.vertexColors = e.vertexColors,
  48318. this.fog = e.fog,
  48319. this
  48320. }
  48321. ,
  48322. n.MeshBasicMaterial = function(e) {
  48323. n.Material.call(this),
  48324. this.type = "MeshBasicMaterial",
  48325. this.color = new n.Color(16777215),
  48326. this.map = null,
  48327. this.aoMap = null,
  48328. this.aoMapIntensity = 1,
  48329. this.specularMap = null,
  48330. this.alphaMap = null,
  48331. this.envMap = null,
  48332. this.combine = n.MultiplyOperation,
  48333. this.reflectivity = 1,
  48334. this.refractionRatio = .98,
  48335. this.fog = !0,
  48336. this.shading = n.SmoothShading,
  48337. this.blending = n.NormalBlending,
  48338. this.wireframe = !1,
  48339. this.wireframeLinewidth = 1,
  48340. this.wireframeLinecap = "round",
  48341. this.wireframeLinejoin = "round",
  48342. this.vertexColors = n.NoColors,
  48343. this.skinning = !1,
  48344. this.morphTargets = !1,
  48345. this.setValues(e)
  48346. }
  48347. ,
  48348. n.MeshBasicMaterial.prototype = Object.create(n.Material.prototype),
  48349. n.MeshBasicMaterial.prototype.constructor = n.MeshBasicMaterial,
  48350. n.MeshBasicMaterial.prototype.copy = function(e) {
  48351. return n.Material.prototype.copy.call(this, e),
  48352. this.color.copy(e.color),
  48353. this.map = e.map,
  48354. this.aoMap = e.aoMap,
  48355. this.aoMapIntensity = e.aoMapIntensity,
  48356. this.specularMap = e.specularMap,
  48357. this.alphaMap = e.alphaMap,
  48358. this.envMap = e.envMap,
  48359. this.combine = e.combine,
  48360. this.reflectivity = e.reflectivity,
  48361. this.refractionRatio = e.refractionRatio,
  48362. this.fog = e.fog,
  48363. this.shading = e.shading,
  48364. this.wireframe = e.wireframe,
  48365. this.wireframeLinewidth = e.wireframeLinewidth,
  48366. this.wireframeLinecap = e.wireframeLinecap,
  48367. this.wireframeLinejoin = e.wireframeLinejoin,
  48368. this.vertexColors = e.vertexColors,
  48369. this.skinning = e.skinning,
  48370. this.morphTargets = e.morphTargets,
  48371. this
  48372. }
  48373. ,
  48374. n.MeshLambertMaterial = function(e) {
  48375. n.Material.call(this),
  48376. this.type = "MeshLambertMaterial",
  48377. this.color = new n.Color(16777215),
  48378. this.map = null,
  48379. this.lightMap = null,
  48380. this.lightMapIntensity = 1,
  48381. this.aoMap = null,
  48382. this.aoMapIntensity = 1,
  48383. this.emissive = new n.Color(0),
  48384. this.emissiveIntensity = 1,
  48385. this.emissiveMap = null,
  48386. this.specularMap = null,
  48387. this.alphaMap = null,
  48388. this.envMap = null,
  48389. this.combine = n.MultiplyOperation,
  48390. this.reflectivity = 1,
  48391. this.refractionRatio = .98,
  48392. this.fog = !0,
  48393. this.blending = n.NormalBlending,
  48394. this.wireframe = !1,
  48395. this.wireframeLinewidth = 1,
  48396. this.wireframeLinecap = "round",
  48397. this.wireframeLinejoin = "round",
  48398. this.vertexColors = n.NoColors,
  48399. this.skinning = !1,
  48400. this.morphTargets = !1,
  48401. this.morphNormals = !1,
  48402. this.setValues(e)
  48403. }
  48404. ,
  48405. n.MeshLambertMaterial.prototype = Object.create(n.Material.prototype),
  48406. n.MeshLambertMaterial.prototype.constructor = n.MeshLambertMaterial,
  48407. n.MeshLambertMaterial.prototype.copy = function(e) {
  48408. return n.Material.prototype.copy.call(this, e),
  48409. this.color.copy(e.color),
  48410. this.map = e.map,
  48411. this.lightMap = e.lightMap,
  48412. this.lightMapIntensity = e.lightMapIntensity,
  48413. this.aoMap = e.aoMap,
  48414. this.aoMapIntensity = e.aoMapIntensity,
  48415. this.emissive.copy(e.emissive),
  48416. this.emissiveMap = e.emissiveMap,
  48417. this.emissiveIntensity = e.emissiveIntensity,
  48418. this.specularMap = e.specularMap,
  48419. this.alphaMap = e.alphaMap,
  48420. this.envMap = e.envMap,
  48421. this.combine = e.combine,
  48422. this.reflectivity = e.reflectivity,
  48423. this.refractionRatio = e.refractionRatio,
  48424. this.fog = e.fog,
  48425. this.wireframe = e.wireframe,
  48426. this.wireframeLinewidth = e.wireframeLinewidth,
  48427. this.wireframeLinecap = e.wireframeLinecap,
  48428. this.wireframeLinejoin = e.wireframeLinejoin,
  48429. this.vertexColors = e.vertexColors,
  48430. this.skinning = e.skinning,
  48431. this.morphTargets = e.morphTargets,
  48432. this.morphNormals = e.morphNormals,
  48433. this
  48434. }
  48435. ,
  48436. n.MeshPhongMaterial = function(e) {
  48437. n.Material.call(this),
  48438. this.type = "MeshPhongMaterial",
  48439. this.color = new n.Color(16777215),
  48440. this.specular = new n.Color(1118481),
  48441. this.shininess = 30,
  48442. this.map = null,
  48443. this.lightMap = null,
  48444. this.lightMapIntensity = 1,
  48445. this.aoMap = null,
  48446. this.aoMapIntensity = 1,
  48447. this.emissive = new n.Color(0),
  48448. this.emissiveIntensity = 1,
  48449. this.emissiveMap = null,
  48450. this.bumpMap = null,
  48451. this.bumpScale = 1,
  48452. this.normalMap = null,
  48453. this.normalScale = new n.Vector2(1,1),
  48454. this.displacementMap = null,
  48455. this.displacementScale = 1,
  48456. this.displacementBias = 0,
  48457. this.specularMap = null,
  48458. this.alphaMap = null,
  48459. this.envMap = null,
  48460. this.combine = n.MultiplyOperation,
  48461. this.reflectivity = 1,
  48462. this.refractionRatio = .98,
  48463. this.fog = !0,
  48464. this.shading = n.SmoothShading,
  48465. this.blending = n.NormalBlending,
  48466. this.wireframe = !1,
  48467. this.wireframeLinewidth = 1,
  48468. this.wireframeLinecap = "round",
  48469. this.wireframeLinejoin = "round",
  48470. this.vertexColors = n.NoColors,
  48471. this.skinning = !1,
  48472. this.morphTargets = !1,
  48473. this.morphNormals = !1,
  48474. this.setValues(e)
  48475. }
  48476. ,
  48477. n.MeshPhongMaterial.prototype = Object.create(n.Material.prototype),
  48478. n.MeshPhongMaterial.prototype.constructor = n.MeshPhongMaterial,
  48479. n.MeshPhongMaterial.prototype.copy = function(e) {
  48480. return n.Material.prototype.copy.call(this, e),
  48481. this.color.copy(e.color),
  48482. this.specular.copy(e.specular),
  48483. this.shininess = e.shininess,
  48484. this.map = e.map,
  48485. this.lightMap = e.lightMap,
  48486. this.lightMapIntensity = e.lightMapIntensity,
  48487. this.aoMap = e.aoMap,
  48488. this.aoMapIntensity = e.aoMapIntensity,
  48489. this.emissive.copy(e.emissive),
  48490. this.emissiveMap = e.emissiveMap,
  48491. this.emissiveIntensity = e.emissiveIntensity,
  48492. this.bumpMap = e.bumpMap,
  48493. this.bumpScale = e.bumpScale,
  48494. this.normalMap = e.normalMap,
  48495. this.normalScale.copy(e.normalScale),
  48496. this.displacementMap = e.displacementMap,
  48497. this.displacementScale = e.displacementScale,
  48498. this.displacementBias = e.displacementBias,
  48499. this.specularMap = e.specularMap,
  48500. this.alphaMap = e.alphaMap,
  48501. this.envMap = e.envMap,
  48502. this.combine = e.combine,
  48503. this.reflectivity = e.reflectivity,
  48504. this.refractionRatio = e.refractionRatio,
  48505. this.fog = e.fog,
  48506. this.shading = e.shading,
  48507. this.wireframe = e.wireframe,
  48508. this.wireframeLinewidth = e.wireframeLinewidth,
  48509. this.wireframeLinecap = e.wireframeLinecap,
  48510. this.wireframeLinejoin = e.wireframeLinejoin,
  48511. this.vertexColors = e.vertexColors,
  48512. this.skinning = e.skinning,
  48513. this.morphTargets = e.morphTargets,
  48514. this.morphNormals = e.morphNormals,
  48515. this
  48516. }
  48517. ,
  48518. n.MeshStandardMaterial = function(e) {
  48519. n.Material.call(this),
  48520. this.type = "MeshStandardMaterial",
  48521. this.color = new n.Color(16777215),
  48522. this.roughness = .5,
  48523. this.metalness = .5,
  48524. this.map = null,
  48525. this.lightMap = null,
  48526. this.lightMapIntensity = 1,
  48527. this.aoMap = null,
  48528. this.aoMapIntensity = 1,
  48529. this.emissive = new n.Color(0),
  48530. this.emissiveIntensity = 1,
  48531. this.emissiveMap = null,
  48532. this.bumpMap = null,
  48533. this.bumpScale = 1,
  48534. this.normalMap = null,
  48535. this.normalScale = new n.Vector2(1,1),
  48536. this.displacementMap = null,
  48537. this.displacementScale = 1,
  48538. this.displacementBias = 0,
  48539. this.roughnessMap = null,
  48540. this.metalnessMap = null,
  48541. this.alphaMap = null,
  48542. this.envMap = null,
  48543. this.envMapIntensity = 1,
  48544. this.refractionRatio = .98,
  48545. this.fog = !0,
  48546. this.shading = n.SmoothShading,
  48547. this.blending = n.NormalBlending,
  48548. this.wireframe = !1,
  48549. this.wireframeLinewidth = 1,
  48550. this.wireframeLinecap = "round",
  48551. this.wireframeLinejoin = "round",
  48552. this.vertexColors = n.NoColors,
  48553. this.skinning = !1,
  48554. this.morphTargets = !1,
  48555. this.morphNormals = !1,
  48556. this.setValues(e)
  48557. }
  48558. ,
  48559. n.MeshStandardMaterial.prototype = Object.create(n.Material.prototype),
  48560. n.MeshStandardMaterial.prototype.constructor = n.MeshStandardMaterial,
  48561. n.MeshStandardMaterial.prototype.copy = function(e) {
  48562. return n.Material.prototype.copy.call(this, e),
  48563. this.color.copy(e.color),
  48564. this.roughness = e.roughness,
  48565. this.metalness = e.metalness,
  48566. this.map = e.map,
  48567. this.lightMap = e.lightMap,
  48568. this.lightMapIntensity = e.lightMapIntensity,
  48569. this.aoMap = e.aoMap,
  48570. this.aoMapIntensity = e.aoMapIntensity,
  48571. this.emissive.copy(e.emissive),
  48572. this.emissiveMap = e.emissiveMap,
  48573. this.emissiveIntensity = e.emissiveIntensity,
  48574. this.bumpMap = e.bumpMap,
  48575. this.bumpScale = e.bumpScale,
  48576. this.normalMap = e.normalMap,
  48577. this.normalScale.copy(e.normalScale),
  48578. this.displacementMap = e.displacementMap,
  48579. this.displacementScale = e.displacementScale,
  48580. this.displacementBias = e.displacementBias,
  48581. this.roughnessMap = e.roughnessMap,
  48582. this.metalnessMap = e.metalnessMap,
  48583. this.alphaMap = e.alphaMap,
  48584. this.envMap = e.envMap,
  48585. this.envMapIntensity = e.envMapIntensity,
  48586. this.refractionRatio = e.refractionRatio,
  48587. this.fog = e.fog,
  48588. this.shading = e.shading,
  48589. this.wireframe = e.wireframe,
  48590. this.wireframeLinewidth = e.wireframeLinewidth,
  48591. this.wireframeLinecap = e.wireframeLinecap,
  48592. this.wireframeLinejoin = e.wireframeLinejoin,
  48593. this.vertexColors = e.vertexColors,
  48594. this.skinning = e.skinning,
  48595. this.morphTargets = e.morphTargets,
  48596. this.morphNormals = e.morphNormals,
  48597. this
  48598. }
  48599. ,
  48600. n.MeshDepthMaterial = function(e) {
  48601. n.Material.call(this),
  48602. this.type = "MeshDepthMaterial",
  48603. this.morphTargets = !1,
  48604. this.wireframe = !1,
  48605. this.wireframeLinewidth = 1,
  48606. this.setValues(e)
  48607. }
  48608. ,
  48609. n.MeshDepthMaterial.prototype = Object.create(n.Material.prototype),
  48610. n.MeshDepthMaterial.prototype.constructor = n.MeshDepthMaterial,
  48611. n.MeshDepthMaterial.prototype.copy = function(e) {
  48612. return n.Material.prototype.copy.call(this, e),
  48613. this.wireframe = e.wireframe,
  48614. this.wireframeLinewidth = e.wireframeLinewidth,
  48615. this
  48616. }
  48617. ,
  48618. n.MeshNormalMaterial = function(e) {
  48619. n.Material.call(this, e),
  48620. this.type = "MeshNormalMaterial",
  48621. this.wireframe = !1,
  48622. this.wireframeLinewidth = 1,
  48623. this.morphTargets = !1,
  48624. this.setValues(e)
  48625. }
  48626. ,
  48627. n.MeshNormalMaterial.prototype = Object.create(n.Material.prototype),
  48628. n.MeshNormalMaterial.prototype.constructor = n.MeshNormalMaterial,
  48629. n.MeshNormalMaterial.prototype.copy = function(e) {
  48630. return n.Material.prototype.copy.call(this, e),
  48631. this.wireframe = e.wireframe,
  48632. this.wireframeLinewidth = e.wireframeLinewidth,
  48633. this
  48634. }
  48635. ,
  48636. n.MultiMaterial = function(e) {
  48637. this.uuid = n.Math.generateUUID(),
  48638. this.type = "MultiMaterial",
  48639. this.materials = e instanceof Array ? e : [],
  48640. this.visible = !0
  48641. }
  48642. ,
  48643. n.MultiMaterial.prototype = {
  48644. constructor: n.MultiMaterial,
  48645. toJSON: function(e) {
  48646. for (var t = {
  48647. metadata: {
  48648. version: 4.2,
  48649. type: "material",
  48650. generator: "MaterialExporter"
  48651. },
  48652. uuid: this.uuid,
  48653. type: this.type,
  48654. materials: []
  48655. }, i = this.materials, n = 0, r = i.length; n < r; n++) {
  48656. var o = i[n].toJSON(e);
  48657. delete o.metadata,
  48658. t.materials.push(o)
  48659. }
  48660. return t.visible = this.visible,
  48661. t
  48662. },
  48663. clone: function() {
  48664. for (var e = new this.constructor, t = 0; t < this.materials.length; t++)
  48665. e.materials.push(this.materials[t].clone());
  48666. return e.visible = this.visible,
  48667. e
  48668. }
  48669. },
  48670. n.PointsMaterial = function(e) {
  48671. n.Material.call(this),
  48672. this.type = "PointsMaterial",
  48673. this.color = new n.Color(16777215),
  48674. this.map = null,
  48675. this.size = 1,
  48676. this.sizeAttenuation = !0,
  48677. this.blending = n.NormalBlending,
  48678. this.vertexColors = n.NoColors,
  48679. this.fog = !0,
  48680. this.setValues(e)
  48681. }
  48682. ,
  48683. n.PointsMaterial.prototype = Object.create(n.Material.prototype),
  48684. n.PointsMaterial.prototype.constructor = n.PointsMaterial,
  48685. n.PointsMaterial.prototype.copy = function(e) {
  48686. return n.Material.prototype.copy.call(this, e),
  48687. this.color.copy(e.color),
  48688. this.map = e.map,
  48689. this.size = e.size,
  48690. this.sizeAttenuation = e.sizeAttenuation,
  48691. this.vertexColors = e.vertexColors,
  48692. this.fog = e.fog,
  48693. this
  48694. }
  48695. ,
  48696. n.ShaderMaterial = function(e) {
  48697. n.Material.call(this),
  48698. this.type = "ShaderMaterial",
  48699. this.defines = {},
  48700. this.uniforms = {},
  48701. this.vertexShader = "void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",
  48702. this.fragmentShader = "void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}",
  48703. this.shading = n.SmoothShading,
  48704. this.linewidth = 1,
  48705. this.wireframe = !1,
  48706. this.wireframeLinewidth = 1,
  48707. this.fog = !1,
  48708. this.lights = !1,
  48709. this.vertexColors = n.NoColors,
  48710. this.skinning = !1,
  48711. this.morphTargets = !1,
  48712. this.morphNormals = !1,
  48713. this.extensions = {
  48714. derivatives: !1,
  48715. fragDepth: !1,
  48716. drawBuffers: !1,
  48717. shaderTextureLOD: !1
  48718. },
  48719. this.defaultAttributeValues = {
  48720. color: [1, 1, 1],
  48721. uv: [0, 0],
  48722. uv2: [0, 0]
  48723. },
  48724. this.index0AttributeName = void 0,
  48725. void 0 !== e && (void 0 !== e.attributes && console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."),
  48726. this.setValues(e))
  48727. }
  48728. ,
  48729. n.ShaderMaterial.prototype = Object.create(n.Material.prototype),
  48730. n.ShaderMaterial.prototype.constructor = n.ShaderMaterial,
  48731. n.ShaderMaterial.prototype.copy = function(e) {
  48732. return n.Material.prototype.copy.call(this, e),
  48733. this.fragmentShader = e.fragmentShader,
  48734. this.vertexShader = e.vertexShader,
  48735. this.uniforms = n.UniformsUtils.clone(e.uniforms),
  48736. this.defines = e.defines,
  48737. this.shading = e.shading,
  48738. this.wireframe = e.wireframe,
  48739. this.wireframeLinewidth = e.wireframeLinewidth,
  48740. this.fog = e.fog,
  48741. this.lights = e.lights,
  48742. this.vertexColors = e.vertexColors,
  48743. this.skinning = e.skinning,
  48744. this.morphTargets = e.morphTargets,
  48745. this.morphNormals = e.morphNormals,
  48746. this.extensions = e.extensions,
  48747. this
  48748. }
  48749. ,
  48750. n.ShaderMaterial.prototype.toJSON = function(e) {
  48751. var t = n.Material.prototype.toJSON.call(this, e);
  48752. return t.uniforms = this.uniforms,
  48753. t.vertexShader = this.vertexShader,
  48754. t.fragmentShader = this.fragmentShader,
  48755. t
  48756. }
  48757. ,
  48758. n.RawShaderMaterial = function(e) {
  48759. n.ShaderMaterial.call(this, e),
  48760. this.type = "RawShaderMaterial"
  48761. }
  48762. ,
  48763. n.RawShaderMaterial.prototype = Object.create(n.ShaderMaterial.prototype),
  48764. n.RawShaderMaterial.prototype.constructor = n.RawShaderMaterial,
  48765. n.SpriteMaterial = function(e) {
  48766. n.Material.call(this),
  48767. this.type = "SpriteMaterial",
  48768. this.color = new n.Color(16777215),
  48769. this.map = null,
  48770. this.rotation = 0,
  48771. this.fog = !1,
  48772. this.setValues(e)
  48773. }
  48774. ,
  48775. n.SpriteMaterial.prototype = Object.create(n.Material.prototype),
  48776. n.SpriteMaterial.prototype.constructor = n.SpriteMaterial,
  48777. n.SpriteMaterial.prototype.copy = function(e) {
  48778. return n.Material.prototype.copy.call(this, e),
  48779. this.color.copy(e.color),
  48780. this.map = e.map,
  48781. this.rotation = e.rotation,
  48782. this.fog = e.fog,
  48783. this
  48784. }
  48785. ,
  48786. n.Texture = function(e, t, i, r, o, a, s, l, c) {
  48787. Object.defineProperty(this, "id", {
  48788. value: n.TextureIdCount++
  48789. }),
  48790. this.uuid = n.Math.generateUUID(),
  48791. this.name = "",
  48792. this.sourceFile = "",
  48793. this.image = void 0 !== e ? e : n.Texture.DEFAULT_IMAGE,
  48794. this.mipmaps = [],
  48795. this.mapping = void 0 !== t ? t : n.Texture.DEFAULT_MAPPING,
  48796. this.wrapS = void 0 !== i ? i : n.ClampToEdgeWrapping,
  48797. this.wrapT = void 0 !== r ? r : n.ClampToEdgeWrapping,
  48798. this.magFilter = void 0 !== o ? o : n.LinearFilter,
  48799. this.minFilter = void 0 !== a ? a : n.LinearMipMapLinearFilter,
  48800. this.anisotropy = void 0 !== c ? c : 1,
  48801. this.format = void 0 !== s ? s : n.RGBAFormat,
  48802. this.type = void 0 !== l ? l : n.UnsignedByteType,
  48803. this.offset = new n.Vector2(0,0),
  48804. this.repeat = new n.Vector2(1,1),
  48805. this.generateMipmaps = !0,
  48806. this.premultiplyAlpha = !1,
  48807. this.flipY = !0,
  48808. this.unpackAlignment = 4,
  48809. this.encoding = n.LinearEncoding,
  48810. this.version = 0,
  48811. this.onUpdate = null
  48812. }
  48813. ,
  48814. n.Texture.DEFAULT_IMAGE = void 0,
  48815. n.Texture.DEFAULT_MAPPING = n.UVMapping,
  48816. n.Texture.prototype = {
  48817. constructor: n.Texture,
  48818. set needsUpdate(e) {
  48819. e === !0 && this.version++
  48820. },
  48821. clone: function() {
  48822. return (new this.constructor).copy(this)
  48823. },
  48824. copy: function(e) {
  48825. return this.image = e.image,
  48826. this.mipmaps = e.mipmaps.slice(0),
  48827. this.mapping = e.mapping,
  48828. this.wrapS = e.wrapS,
  48829. this.wrapT = e.wrapT,
  48830. this.magFilter = e.magFilter,
  48831. this.minFilter = e.minFilter,
  48832. this.anisotropy = e.anisotropy,
  48833. this.format = e.format,
  48834. this.type = e.type,
  48835. this.offset.copy(e.offset),
  48836. this.repeat.copy(e.repeat),
  48837. this.generateMipmaps = e.generateMipmaps,
  48838. this.premultiplyAlpha = e.premultiplyAlpha,
  48839. this.flipY = e.flipY,
  48840. this.unpackAlignment = e.unpackAlignment,
  48841. this.encoding = e.encoding,
  48842. this
  48843. },
  48844. toJSON: function(e) {
  48845. function t(e) {
  48846. var t;
  48847. return void 0 !== e.toDataURL ? t = e : (t = document.createElement("canvas"),
  48848. t.width = e.width,
  48849. t.height = e.height,
  48850. t.getContext("2d").drawImage(e, 0, 0, e.width, e.height)),
  48851. t.width > 2048 || t.height > 2048 ? t.toDataURL("image/jpeg", .6) : t.toDataURL("image/png")
  48852. }
  48853. if (void 0 !== e.textures[this.uuid])
  48854. return e.textures[this.uuid];
  48855. var i = {
  48856. metadata: {
  48857. version: 4.4,
  48858. type: "Texture",
  48859. generator: "Texture.toJSON"
  48860. },
  48861. uuid: this.uuid,
  48862. name: this.name,
  48863. mapping: this.mapping,
  48864. repeat: [this.repeat.x, this.repeat.y],
  48865. offset: [this.offset.x, this.offset.y],
  48866. wrap: [this.wrapS, this.wrapT],
  48867. minFilter: this.minFilter,
  48868. magFilter: this.magFilter,
  48869. anisotropy: this.anisotropy
  48870. };
  48871. if (void 0 !== this.image) {
  48872. var r = this.image;
  48873. void 0 === r.uuid && (r.uuid = n.Math.generateUUID()),
  48874. void 0 === e.images[r.uuid] && (e.images[r.uuid] = {
  48875. uuid: r.uuid,
  48876. url: t(r)
  48877. }),
  48878. i.image = r.uuid
  48879. }
  48880. return e.textures[this.uuid] = i,
  48881. i
  48882. },
  48883. dispose: function() {
  48884. this.dispatchEvent({
  48885. type: "dispose"
  48886. })
  48887. },
  48888. transformUv: function(e) {
  48889. if (this.mapping === n.UVMapping) {
  48890. if (e.multiply(this.repeat),
  48891. e.add(this.offset),
  48892. e.x < 0 || e.x > 1)
  48893. switch (this.wrapS) {
  48894. case n.RepeatWrapping:
  48895. e.x = e.x - Math.floor(e.x);
  48896. break;
  48897. case n.ClampToEdgeWrapping:
  48898. e.x = e.x < 0 ? 0 : 1;
  48899. break;
  48900. case n.MirroredRepeatWrapping:
  48901. 1 === Math.abs(Math.floor(e.x) % 2) ? e.x = Math.ceil(e.x) - e.x : e.x = e.x - Math.floor(e.x)
  48902. }
  48903. if (e.y < 0 || e.y > 1)
  48904. switch (this.wrapT) {
  48905. case n.RepeatWrapping:
  48906. e.y = e.y - Math.floor(e.y);
  48907. break;
  48908. case n.ClampToEdgeWrapping:
  48909. e.y = e.y < 0 ? 0 : 1;
  48910. break;
  48911. case n.MirroredRepeatWrapping:
  48912. 1 === Math.abs(Math.floor(e.y) % 2) ? e.y = Math.ceil(e.y) - e.y : e.y = e.y - Math.floor(e.y)
  48913. }
  48914. this.flipY && (e.y = 1 - e.y)
  48915. }
  48916. }
  48917. },
  48918. n.EventDispatcher.prototype.apply(n.Texture.prototype),
  48919. n.TextureIdCount = 0,
  48920. n.CanvasTexture = function(e, t, i, r, o, a, s, l, c) {
  48921. n.Texture.call(this, e, t, i, r, o, a, s, l, c),
  48922. this.needsUpdate = !0
  48923. }
  48924. ,
  48925. n.CanvasTexture.prototype = Object.create(n.Texture.prototype),
  48926. n.CanvasTexture.prototype.constructor = n.CanvasTexture,
  48927. n.CubeTexture = function(e, t, i, r, o, a, s, l, c) {
  48928. e = void 0 !== e ? e : [],
  48929. t = void 0 !== t ? t : n.CubeReflectionMapping,
  48930. n.Texture.call(this, e, t, i, r, o, a, s, l, c),
  48931. this.flipY = !1
  48932. }
  48933. ,
  48934. n.CubeTexture.prototype = Object.create(n.Texture.prototype),
  48935. n.CubeTexture.prototype.constructor = n.CubeTexture,
  48936. Object.defineProperty(n.CubeTexture.prototype, "images", {
  48937. get: function() {
  48938. return this.image
  48939. },
  48940. set: function(e) {
  48941. this.image = e
  48942. }
  48943. }),
  48944. n.CompressedTexture = function(e, t, i, r, o, a, s, l, c, h, u) {
  48945. n.Texture.call(this, null, a, s, l, c, h, r, o, u),
  48946. this.image = {
  48947. width: t,
  48948. height: i
  48949. },
  48950. this.mipmaps = e,
  48951. this.flipY = !1,
  48952. this.generateMipmaps = !1
  48953. }
  48954. ,
  48955. n.CompressedTexture.prototype = Object.create(n.Texture.prototype),
  48956. n.CompressedTexture.prototype.constructor = n.CompressedTexture,
  48957. n.DataTexture = function(e, t, i, r, o, a, s, l, c, h, u) {
  48958. n.Texture.call(this, null, a, s, l, c, h, r, o, u),
  48959. this.image = {
  48960. data: e,
  48961. width: t,
  48962. height: i
  48963. },
  48964. this.magFilter = void 0 !== c ? c : n.NearestFilter,
  48965. this.minFilter = void 0 !== h ? h : n.NearestFilter,
  48966. this.flipY = !1,
  48967. this.generateMipmaps = !1
  48968. }
  48969. ,
  48970. n.DataTexture.prototype = Object.create(n.Texture.prototype),
  48971. n.DataTexture.prototype.constructor = n.DataTexture,
  48972. n.VideoTexture = function(e, t, i, r, o, a, s, l, c) {
  48973. function h() {
  48974. requestAnimationFrame(h)
  48975. if( !e.paused && e.readyState === e.HAVE_ENOUGH_DATA){//改 add !e.paused
  48976. u.needsUpdate = !0
  48977. }
  48978. }
  48979. n.Texture.call(this, e, t, i, r, o, a, s, l, c),
  48980. this.generateMipmaps = !1;
  48981. var u = this;
  48982. h()
  48983. }
  48984. ,
  48985. n.VideoTexture.prototype = Object.create(n.Texture.prototype),
  48986. n.VideoTexture.prototype.constructor = n.VideoTexture,
  48987. n.Group = function() {
  48988. n.Object3D.call(this),
  48989. this.type = "Group"
  48990. }
  48991. ,
  48992. n.Group.prototype = Object.create(n.Object3D.prototype),
  48993. n.Group.prototype.constructor = n.Group,
  48994. n.Points = function(e, t) {
  48995. n.Object3D.call(this),
  48996. this.type = "Points",
  48997. this.geometry = void 0 !== e ? e : new n.Geometry,
  48998. this.material = void 0 !== t ? t : new n.PointsMaterial({
  48999. color: 16777215 * Math.random()
  49000. })
  49001. }
  49002. ,
  49003. n.Points.prototype = Object.create(n.Object3D.prototype),
  49004. n.Points.prototype.constructor = n.Points,
  49005. n.Points.prototype.raycast = function() {
  49006. var e = new n.Matrix4
  49007. , t = new n.Ray
  49008. , i = new n.Sphere;
  49009. return function(r, o) {
  49010. function a(e, i) {
  49011. var n = t.distanceSqToPoint(e);
  49012. if (n < d) {
  49013. var a = t.closestPointToPoint(e);
  49014. a.applyMatrix4(c);
  49015. var l = r.ray.origin.distanceTo(a);
  49016. if (l < r.near || l > r.far)
  49017. return;
  49018. o.push({
  49019. distance: l,
  49020. distanceToRay: Math.sqrt(n),
  49021. point: a.clone(),
  49022. index: i,
  49023. face: null,
  49024. object: s
  49025. })
  49026. }
  49027. }
  49028. var s = this
  49029. , l = this.geometry
  49030. , c = this.matrixWorld
  49031. , h = r.params.Points.threshold;
  49032. if (null === l.boundingSphere && l.computeBoundingSphere(),
  49033. i.copy(l.boundingSphere),
  49034. i.applyMatrix4(c),
  49035. r.ray.intersectsSphere(i) !== !1) {
  49036. e.getInverse(c),
  49037. t.copy(r.ray).applyMatrix4(e);
  49038. var u = h / ((this.scale.x + this.scale.y + this.scale.z) / 3)
  49039. , d = u * u
  49040. , p = new n.Vector3;
  49041. if (l instanceof n.BufferGeometry) {
  49042. var f = l.index
  49043. , g = l.attributes
  49044. , m = g.position.array;
  49045. if (null !== f)
  49046. for (var v = f.array, A = 0, y = v.length; A < y; A++) {
  49047. var C = v[A];
  49048. p.fromArray(m, 3 * C),
  49049. a(p, C)
  49050. }
  49051. else
  49052. for (var A = 0, I = m.length / 3; A < I; A++)
  49053. p.fromArray(m, 3 * A),
  49054. a(p, A)
  49055. } else
  49056. for (var E = l.vertices, A = 0, I = E.length; A < I; A++)
  49057. a(E[A], A)
  49058. }
  49059. }
  49060. }(),
  49061. n.Points.prototype.clone = function() {
  49062. return new this.constructor(this.geometry,this.material).copy(this)
  49063. }
  49064. ,
  49065. n.Line = function(e, t, i) {
  49066. return 1 === i ? (console.warn("THREE.Line: parameter THREE.LinePieces no longer supported. Created THREE.LineSegments instead."),
  49067. new n.LineSegments(e,t)) : (n.Object3D.call(this),
  49068. this.type = "Line",
  49069. this.geometry = void 0 !== e ? e : new n.Geometry,
  49070. void (this.material = void 0 !== t ? t : new n.LineBasicMaterial({
  49071. color: 16777215 * Math.random()
  49072. })))
  49073. }
  49074. ,
  49075. n.Line.prototype = Object.create(n.Object3D.prototype),
  49076. n.Line.prototype.constructor = n.Line,
  49077. n.Line.prototype.raycast = function() {
  49078. var e = new n.Matrix4
  49079. , t = new n.Ray
  49080. , i = new n.Sphere;
  49081. return function(r, o) {
  49082. var a = r.linePrecision
  49083. , s = a * a
  49084. , l = this.geometry
  49085. , c = this.matrixWorld;
  49086. if (null === l.boundingSphere && l.computeBoundingSphere(),
  49087. i.copy(l.boundingSphere),
  49088. i.applyMatrix4(c),
  49089. r.ray.intersectsSphere(i) !== !1) {
  49090. e.getInverse(c),
  49091. t.copy(r.ray).applyMatrix4(e);
  49092. var h = new n.Vector3
  49093. , u = new n.Vector3
  49094. , d = new n.Vector3
  49095. , p = new n.Vector3
  49096. , f = this instanceof n.LineSegments ? 2 : 1;
  49097. if (l instanceof n.BufferGeometry) {
  49098. var g = l.index
  49099. , m = l.attributes
  49100. , v = m.position.array;
  49101. if (null !== g)
  49102. for (var A = g.array, y = 0, C = A.length - 1; y < C; y += f) {
  49103. var I = A[y]
  49104. , E = A[y + 1];
  49105. h.fromArray(v, 3 * I),
  49106. u.fromArray(v, 3 * E);
  49107. var b = t.distanceSqToSegment(h, u, p, d);
  49108. if (!(b > s)) {
  49109. p.applyMatrix4(this.matrixWorld);
  49110. var w = r.ray.origin.distanceTo(p);
  49111. w < r.near || w > r.far || o.push({
  49112. distance: w,
  49113. point: d.clone().applyMatrix4(this.matrixWorld),
  49114. index: y,
  49115. face: null,
  49116. faceIndex: null,
  49117. object: this
  49118. })
  49119. }
  49120. }
  49121. else
  49122. for (var y = 0, C = v.length / 3 - 1; y < C; y += f) {
  49123. h.fromArray(v, 3 * y),
  49124. u.fromArray(v, 3 * y + 3);
  49125. var b = t.distanceSqToSegment(h, u, p, d);
  49126. if (!(b > s)) {
  49127. p.applyMatrix4(this.matrixWorld);
  49128. var w = r.ray.origin.distanceTo(p);
  49129. w < r.near || w > r.far || o.push({
  49130. distance: w,
  49131. point: d.clone().applyMatrix4(this.matrixWorld),
  49132. index: y,
  49133. face: null,
  49134. faceIndex: null,
  49135. object: this
  49136. })
  49137. }
  49138. }
  49139. } else if (l instanceof n.Geometry)
  49140. for (var _ = l.vertices, T = _.length, y = 0; y < T - 1; y += f) {
  49141. var b = t.distanceSqToSegment(_[y], _[y + 1], p, d);
  49142. if (!(b > s)) {
  49143. p.applyMatrix4(this.matrixWorld);
  49144. var w = r.ray.origin.distanceTo(p);
  49145. w < r.near || w > r.far || o.push({
  49146. distance: w,
  49147. point: d.clone().applyMatrix4(this.matrixWorld),
  49148. index: y,
  49149. face: null,
  49150. faceIndex: null,
  49151. object: this
  49152. })
  49153. }
  49154. }
  49155. }
  49156. }
  49157. }(),
  49158. n.Line.prototype.clone = function() {
  49159. return new this.constructor(this.geometry,this.material).copy(this)
  49160. }
  49161. ,
  49162. n.LineStrip = 0,
  49163. n.LinePieces = 1,
  49164. n.LineSegments = function(e, t) {
  49165. n.Line.call(this, e, t),
  49166. this.type = "LineSegments"
  49167. }
  49168. ,
  49169. n.LineSegments.prototype = Object.create(n.Line.prototype),
  49170. n.LineSegments.prototype.constructor = n.LineSegments,
  49171. n.Mesh = function(e, t) {
  49172. n.Object3D.call(this),
  49173. this.type = "Mesh",
  49174. this.geometry = void 0 !== e ? e : new n.Geometry,
  49175. this.material = void 0 !== t ? t : new n.MeshBasicMaterial({
  49176. color: 16777215 * Math.random()
  49177. }),
  49178. this.drawMode = n.TrianglesDrawMode,
  49179. this.updateMorphTargets()
  49180. }
  49181. ,
  49182. n.Mesh.prototype = Object.create(n.Object3D.prototype),
  49183. n.Mesh.prototype.constructor = n.Mesh,
  49184. n.Mesh.prototype.setDrawMode = function(e) {
  49185. this.drawMode = e
  49186. }
  49187. ,
  49188. n.Mesh.prototype.updateMorphTargets = function() {
  49189. if (void 0 !== this.geometry.morphTargets && this.geometry.morphTargets.length > 0) {
  49190. this.morphTargetBase = -1,
  49191. this.morphTargetInfluences = [],
  49192. this.morphTargetDictionary = {};
  49193. for (var e = 0, t = this.geometry.morphTargets.length; e < t; e++)
  49194. this.morphTargetInfluences.push(0),
  49195. this.morphTargetDictionary[this.geometry.morphTargets[e].name] = e
  49196. }
  49197. }
  49198. ,
  49199. n.Mesh.prototype.getMorphTargetIndexByName = function(e) {
  49200. return void 0 !== this.morphTargetDictionary[e] ? this.morphTargetDictionary[e] : (console.warn("THREE.Mesh.getMorphTargetIndexByName: morph target " + e + " does not exist. Returning 0."),
  49201. 0)
  49202. }
  49203. ,
  49204. n.Mesh.prototype.raycast = function() {
  49205. function e(e, t, i, r, o, a, s) {
  49206. return n.Triangle.barycoordFromPoint(e, t, i, r, m),
  49207. o.multiplyScalar(m.x),
  49208. a.multiplyScalar(m.y),
  49209. s.multiplyScalar(m.z),
  49210. o.add(a).add(s),
  49211. o.clone()
  49212. }
  49213. function t(e, t, i, r, o, a, s) {
  49214. var l, c = e.material;
  49215. if (l = c.side === n.BackSide ? i.intersectTriangle(a, o, r, !0, s) : i.intersectTriangle(r, o, a, c.side !== n.DoubleSide, s),
  49216. null === l)
  49217. return null;
  49218. A.copy(s),
  49219. A.applyMatrix4(e.matrixWorld);
  49220. var h = t.ray.origin.distanceTo(A);
  49221. return h < t.near || h > t.far ? null : {
  49222. distance: h,
  49223. point: A.clone(),
  49224. object: e
  49225. }
  49226. }
  49227. function i(i, r, o, a, h, u, d, m) {
  49228. s.fromArray(a, 3 * u),
  49229. l.fromArray(a, 3 * d),
  49230. c.fromArray(a, 3 * m);
  49231. var A = t(i, r, o, s, l, c, v);
  49232. return A && (h && (p.fromArray(h, 2 * u),
  49233. f.fromArray(h, 2 * d),
  49234. g.fromArray(h, 2 * m),
  49235. A.uv = e(v, s, l, c, p, f, g)),
  49236. A.face = new n.Face3(u,d,m,n.Triangle.normal(s, l, c)),
  49237. A.faceIndex = u),
  49238. A
  49239. }
  49240. var r = new n.Matrix4
  49241. , o = new n.Ray
  49242. , a = new n.Sphere
  49243. , s = new n.Vector3
  49244. , l = new n.Vector3
  49245. , c = new n.Vector3
  49246. , h = new n.Vector3
  49247. , u = new n.Vector3
  49248. , d = new n.Vector3
  49249. , p = new n.Vector2
  49250. , f = new n.Vector2
  49251. , g = new n.Vector2
  49252. , m = new n.Vector3
  49253. , v = new n.Vector3
  49254. , A = new n.Vector3;
  49255. return function(m, A) {
  49256. var y = this.geometry
  49257. , C = this.material
  49258. , I = this.matrixWorld;
  49259. if (void 0 !== C && (null === y.boundingSphere && y.computeBoundingSphere(),
  49260. a.copy(y.boundingSphere),
  49261. a.applyMatrix4(I),
  49262. m.ray.intersectsSphere(a) !== !1 && (r.getInverse(I),
  49263. o.copy(m.ray).applyMatrix4(r),
  49264. null === y.boundingBox || o.intersectsBox(y.boundingBox) !== !1))) {
  49265. var E, b;
  49266. if (y instanceof n.BufferGeometry) {
  49267. var w, _, T, x = y.index, S = y.attributes, M = S.position.array;
  49268. if (void 0 !== S.uv && (E = S.uv.array),
  49269. null !== x)
  49270. for (var R = x.array, P = 0, O = R.length; P < O; P += 3)
  49271. w = R[P],
  49272. _ = R[P + 1],
  49273. T = R[P + 2],
  49274. b = i(this, m, o, M, E, w, _, T),
  49275. b && (b.faceIndex = Math.floor(P / 3),
  49276. A.push(b));
  49277. else
  49278. for (var P = 0, O = M.length; P < O; P += 9)
  49279. w = P / 3,
  49280. _ = w + 1,
  49281. T = w + 2,
  49282. b = i(this, m, o, M, E, w, _, T),
  49283. b && (b.index = w,
  49284. A.push(b))
  49285. } else if (y instanceof n.Geometry) {
  49286. 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];
  49287. k.length > 0 && (E = k);
  49288. for (var H = 0, G = U.length; H < G; H++) {
  49289. var z = U[H]
  49290. , W = B === !0 ? F[z.materialIndex] : C;
  49291. if (void 0 !== W) {
  49292. if (L = V[z.a],
  49293. D = V[z.b],
  49294. N = V[z.c],
  49295. W.morphTargets === !0) {
  49296. var j = y.morphTargets
  49297. , Y = this.morphTargetInfluences;
  49298. s.set(0, 0, 0),
  49299. l.set(0, 0, 0),
  49300. c.set(0, 0, 0);
  49301. for (var X = 0, Z = j.length; X < Z; X++) {
  49302. var q = Y[X];
  49303. if (0 !== q) {
  49304. var K = j[X].vertices;
  49305. s.addScaledVector(h.subVectors(K[z.a], L), q),
  49306. l.addScaledVector(u.subVectors(K[z.b], D), q),
  49307. c.addScaledVector(d.subVectors(K[z.c], N), q)
  49308. }
  49309. }
  49310. s.add(L),
  49311. l.add(D),
  49312. c.add(N),
  49313. L = s,
  49314. D = l,
  49315. N = c
  49316. }
  49317. if (b = t(this, m, o, L, D, N, v)) {
  49318. if (E) {
  49319. var Q = E[H];
  49320. p.copy(Q[0]),
  49321. f.copy(Q[1]),
  49322. g.copy(Q[2]),
  49323. b.uv = e(v, L, D, N, p, f, g)
  49324. }
  49325. b.face = z,
  49326. b.faceIndex = H,
  49327. A.push(b)
  49328. }
  49329. }
  49330. }
  49331. }
  49332. }
  49333. }
  49334. }(),
  49335. n.Mesh.prototype.clone = function() {
  49336. return new this.constructor(this.geometry,this.material).copy(this)
  49337. }
  49338. ,
  49339. n.Bone = function(e) {
  49340. n.Object3D.call(this),
  49341. this.type = "Bone",
  49342. this.skin = e
  49343. }
  49344. ,
  49345. n.Bone.prototype = Object.create(n.Object3D.prototype),
  49346. n.Bone.prototype.constructor = n.Bone,
  49347. n.Bone.prototype.copy = function(e) {
  49348. return n.Object3D.prototype.copy.call(this, e),
  49349. this.skin = e.skin,
  49350. this
  49351. }
  49352. ,
  49353. n.Skeleton = function(e, t, i) {
  49354. if (this.useVertexTexture = void 0 === i || i,
  49355. this.identityMatrix = new n.Matrix4,
  49356. e = e || [],
  49357. this.bones = e.slice(0),
  49358. this.useVertexTexture) {
  49359. var r = Math.sqrt(4 * this.bones.length);
  49360. r = n.Math.nextPowerOfTwo(Math.ceil(r)),
  49361. r = Math.max(r, 4),
  49362. this.boneTextureWidth = r,
  49363. this.boneTextureHeight = r,
  49364. this.boneMatrices = new Float32Array(this.boneTextureWidth * this.boneTextureHeight * 4),
  49365. this.boneTexture = new n.DataTexture(this.boneMatrices,this.boneTextureWidth,this.boneTextureHeight,n.RGBAFormat,n.FloatType)
  49366. } else
  49367. this.boneMatrices = new Float32Array(16 * this.bones.length);
  49368. if (void 0 === t)
  49369. this.calculateInverses();
  49370. else if (this.bones.length === t.length)
  49371. this.boneInverses = t.slice(0);
  49372. else {
  49373. console.warn("THREE.Skeleton bonInverses is the wrong length."),
  49374. this.boneInverses = [];
  49375. for (var o = 0, a = this.bones.length; o < a; o++)
  49376. this.boneInverses.push(new n.Matrix4)
  49377. }
  49378. }
  49379. ,
  49380. n.Skeleton.prototype.calculateInverses = function() {
  49381. this.boneInverses = [];
  49382. for (var e = 0, t = this.bones.length; e < t; e++) {
  49383. var i = new n.Matrix4;
  49384. this.bones[e] && i.getInverse(this.bones[e].matrixWorld),
  49385. this.boneInverses.push(i)
  49386. }
  49387. }
  49388. ,
  49389. n.Skeleton.prototype.pose = function() {
  49390. for (var e, t = 0, i = this.bones.length; t < i; t++)
  49391. e = this.bones[t],
  49392. e && e.matrixWorld.getInverse(this.boneInverses[t]);
  49393. for (var t = 0, i = this.bones.length; t < i; t++)
  49394. e = this.bones[t],
  49395. e && (e.parent ? (e.matrix.getInverse(e.parent.matrixWorld),
  49396. e.matrix.multiply(e.matrixWorld)) : e.matrix.copy(e.matrixWorld),
  49397. e.matrix.decompose(e.position, e.quaternion, e.scale));
  49398. }
  49399. ,
  49400. n.Skeleton.prototype.update = function() {
  49401. var e = new n.Matrix4;
  49402. return function() {
  49403. for (var t = 0, i = this.bones.length; t < i; t++) {
  49404. var n = this.bones[t] ? this.bones[t].matrixWorld : this.identityMatrix;
  49405. e.multiplyMatrices(n, this.boneInverses[t]),
  49406. e.flattenToArrayOffset(this.boneMatrices, 16 * t)
  49407. }
  49408. this.useVertexTexture && (this.boneTexture.needsUpdate = !0)
  49409. }
  49410. }(),
  49411. n.Skeleton.prototype.clone = function() {
  49412. return new n.Skeleton(this.bones,this.boneInverses,this.useVertexTexture)
  49413. }
  49414. ,
  49415. n.SkinnedMesh = function(e, t, i) {
  49416. n.Mesh.call(this, e, t),
  49417. this.type = "SkinnedMesh",
  49418. this.bindMode = "attached",
  49419. this.bindMatrix = new n.Matrix4,
  49420. this.bindMatrixInverse = new n.Matrix4;
  49421. var r = [];
  49422. if (this.geometry && void 0 !== this.geometry.bones) {
  49423. for (var o, a, s = 0, l = this.geometry.bones.length; s < l; ++s)
  49424. a = this.geometry.bones[s],
  49425. o = new n.Bone(this),
  49426. r.push(o),
  49427. o.name = a.name,
  49428. o.position.fromArray(a.pos),
  49429. o.quaternion.fromArray(a.rotq),
  49430. void 0 !== a.scl && o.scale.fromArray(a.scl);
  49431. for (var s = 0, l = this.geometry.bones.length; s < l; ++s)
  49432. a = this.geometry.bones[s],
  49433. a.parent !== -1 && null !== a.parent ? r[a.parent].add(r[s]) : this.add(r[s])
  49434. }
  49435. this.normalizeSkinWeights(),
  49436. this.updateMatrixWorld(!0),
  49437. this.bind(new n.Skeleton(r,void 0,i), this.matrixWorld)
  49438. }
  49439. ,
  49440. n.SkinnedMesh.prototype = Object.create(n.Mesh.prototype),
  49441. n.SkinnedMesh.prototype.constructor = n.SkinnedMesh,
  49442. n.SkinnedMesh.prototype.bind = function(e, t) {
  49443. this.skeleton = e,
  49444. void 0 === t && (this.updateMatrixWorld(!0),
  49445. this.skeleton.calculateInverses(),
  49446. t = this.matrixWorld),
  49447. this.bindMatrix.copy(t),
  49448. this.bindMatrixInverse.getInverse(t)
  49449. }
  49450. ,
  49451. n.SkinnedMesh.prototype.pose = function() {
  49452. this.skeleton.pose()
  49453. }
  49454. ,
  49455. n.SkinnedMesh.prototype.normalizeSkinWeights = function() {
  49456. if (this.geometry instanceof n.Geometry)
  49457. for (var e = 0; e < this.geometry.skinWeights.length; e++) {
  49458. var t = this.geometry.skinWeights[e]
  49459. , i = 1 / t.lengthManhattan();
  49460. i !== 1 / 0 ? t.multiplyScalar(i) : t.set(1, 0, 0, 0)
  49461. }
  49462. else if (this.geometry instanceof n.BufferGeometry)
  49463. for (var r = new n.Vector4, o = this.geometry.attributes.skinWeight, e = 0; e < o.count; e++) {
  49464. r.x = o.getX(e),
  49465. r.y = o.getY(e),
  49466. r.z = o.getZ(e),
  49467. r.w = o.getW(e);
  49468. var i = 1 / r.lengthManhattan();
  49469. i !== 1 / 0 ? r.multiplyScalar(i) : r.set(1, 0, 0, 0),
  49470. o.setXYZW(e, r.x, r.y, r.z, r.w)
  49471. }
  49472. }
  49473. ,
  49474. n.SkinnedMesh.prototype.updateMatrixWorld = function(e) {
  49475. n.Mesh.prototype.updateMatrixWorld.call(this, !0),
  49476. "attached" === this.bindMode ? this.bindMatrixInverse.getInverse(this.matrixWorld) : "detached" === this.bindMode ? this.bindMatrixInverse.getInverse(this.bindMatrix) : console.warn("THREE.SkinnedMesh unrecognized bindMode: " + this.bindMode)
  49477. }
  49478. ,
  49479. n.SkinnedMesh.prototype.clone = function() {
  49480. return new this.constructor(this.geometry,this.material,this.useVertexTexture).copy(this)
  49481. }
  49482. ,
  49483. n.LOD = function() {
  49484. n.Object3D.call(this),
  49485. this.type = "LOD",
  49486. Object.defineProperties(this, {
  49487. levels: {
  49488. enumerable: !0,
  49489. value: []
  49490. },
  49491. objects: {
  49492. get: function() {
  49493. return console.warn("THREE.LOD: .objects has been renamed to .levels."),
  49494. this.levels
  49495. }
  49496. }
  49497. })
  49498. }
  49499. ,
  49500. n.LOD.prototype = Object.create(n.Object3D.prototype),
  49501. n.LOD.prototype.constructor = n.LOD,
  49502. n.LOD.prototype.addLevel = function(e, t) {
  49503. void 0 === t && (t = 0),
  49504. t = Math.abs(t);
  49505. for (var i = this.levels, n = 0; n < i.length && !(t < i[n].distance); n++)
  49506. ;
  49507. i.splice(n, 0, {
  49508. distance: t,
  49509. object: e
  49510. }),
  49511. this.add(e)
  49512. }
  49513. ,
  49514. n.LOD.prototype.getObjectForDistance = function(e) {
  49515. for (var t = this.levels, i = 1, n = t.length; i < n && !(e < t[i].distance); i++)
  49516. ;
  49517. return t[i - 1].object
  49518. }
  49519. ,
  49520. n.LOD.prototype.raycast = function() {
  49521. var e = new n.Vector3;
  49522. return function(t, i) {
  49523. e.setFromMatrixPosition(this.matrixWorld);
  49524. var n = t.ray.origin.distanceTo(e);
  49525. this.getObjectForDistance(n).raycast(t, i)
  49526. }
  49527. }(),
  49528. n.LOD.prototype.update = function() {
  49529. var e = new n.Vector3
  49530. , t = new n.Vector3;
  49531. return function(i) {
  49532. var n = this.levels;
  49533. if (n.length > 1) {
  49534. e.setFromMatrixPosition(i.matrixWorld),
  49535. t.setFromMatrixPosition(this.matrixWorld);
  49536. var r = e.distanceTo(t);
  49537. n[0].object.visible = !0;
  49538. for (var o = 1, a = n.length; o < a && r >= n[o].distance; o++)
  49539. n[o - 1].object.visible = !1,
  49540. n[o].object.visible = !0;
  49541. for (; o < a; o++)
  49542. n[o].object.visible = !1
  49543. }
  49544. }
  49545. }(),
  49546. n.LOD.prototype.copy = function(e) {
  49547. n.Object3D.prototype.copy.call(this, e, !1);
  49548. for (var t = e.levels, i = 0, r = t.length; i < r; i++) {
  49549. var o = t[i];
  49550. this.addLevel(o.object.clone(), o.distance)
  49551. }
  49552. return this
  49553. }
  49554. ,
  49555. n.LOD.prototype.toJSON = function(e) {
  49556. var t = n.Object3D.prototype.toJSON.call(this, e);
  49557. t.object.levels = [];
  49558. for (var i = this.levels, r = 0, o = i.length; r < o; r++) {
  49559. var a = i[r];
  49560. t.object.levels.push({
  49561. object: a.object.uuid,
  49562. distance: a.distance
  49563. })
  49564. }
  49565. return t
  49566. }
  49567. ,
  49568. n.Sprite = function() {
  49569. var e = new Uint16Array([0, 1, 2, 0, 2, 3])
  49570. , t = new Float32Array([-.5, -.5, 0, .5, -.5, 0, .5, .5, 0, -.5, .5, 0])
  49571. , i = new Float32Array([0, 0, 1, 0, 1, 1, 0, 1])
  49572. , r = new n.BufferGeometry;
  49573. return r.setIndex(new n.BufferAttribute(e,1)),
  49574. r.addAttribute("position", new n.BufferAttribute(t,3)),
  49575. r.addAttribute("uv", new n.BufferAttribute(i,2)),
  49576. function(e) {
  49577. n.Object3D.call(this),
  49578. this.type = "Sprite",
  49579. this.geometry = r,
  49580. this.material = void 0 !== e ? e : new n.SpriteMaterial
  49581. }
  49582. }(),
  49583. n.Sprite.prototype = Object.create(n.Object3D.prototype),
  49584. n.Sprite.prototype.constructor = n.Sprite,
  49585. n.Sprite.prototype.raycast = function() {
  49586. var e = new n.Vector3;
  49587. return function(t, i) {
  49588. e.setFromMatrixPosition(this.matrixWorld);
  49589. var n = t.ray.distanceSqToPoint(e)
  49590. , r = this.scale.x * this.scale.y;
  49591. n > r || i.push({
  49592. distance: Math.sqrt(n),
  49593. point: this.position,
  49594. face: null,
  49595. object: this
  49596. })
  49597. }
  49598. }(),
  49599. n.Sprite.prototype.clone = function() {
  49600. return new this.constructor(this.material).copy(this)
  49601. }
  49602. ,
  49603. n.Particle = n.Sprite,
  49604. n.LensFlare = function(e, t, i, r, o) {
  49605. n.Object3D.call(this),
  49606. this.lensFlares = [],
  49607. this.positionScreen = new n.Vector3,
  49608. this.customUpdateCallback = void 0,
  49609. void 0 !== e && this.add(e, t, i, r, o)
  49610. }
  49611. ,
  49612. n.LensFlare.prototype = Object.create(n.Object3D.prototype),
  49613. n.LensFlare.prototype.constructor = n.LensFlare,
  49614. n.LensFlare.prototype.add = function(e, t, i, r, o, a) {
  49615. void 0 === t && (t = -1),
  49616. void 0 === i && (i = 0),
  49617. void 0 === a && (a = 1),
  49618. void 0 === o && (o = new n.Color(16777215)),
  49619. void 0 === r && (r = n.NormalBlending),
  49620. i = Math.min(i, Math.max(0, i)),
  49621. this.lensFlares.push({
  49622. texture: e,
  49623. size: t,
  49624. distance: i,
  49625. x: 0,
  49626. y: 0,
  49627. z: 0,
  49628. scale: 1,
  49629. rotation: 0,
  49630. opacity: a,
  49631. color: o,
  49632. blending: r
  49633. })
  49634. }
  49635. ,
  49636. n.LensFlare.prototype.updateLensFlares = function() {
  49637. var e, t, i = this.lensFlares.length, n = 2 * -this.positionScreen.x, r = 2 * -this.positionScreen.y;
  49638. for (e = 0; e < i; e++)
  49639. t = this.lensFlares[e],
  49640. t.x = this.positionScreen.x + n * t.distance,
  49641. t.y = this.positionScreen.y + r * t.distance,
  49642. t.wantedRotation = t.x * Math.PI * .25,
  49643. t.rotation += .25 * (t.wantedRotation - t.rotation)
  49644. }
  49645. ,
  49646. n.LensFlare.prototype.copy = function(e) {
  49647. n.Object3D.prototype.copy.call(this, e),
  49648. this.positionScreen.copy(e.positionScreen),
  49649. this.customUpdateCallback = e.customUpdateCallback;
  49650. for (var t = 0, i = e.lensFlares.length; t < i; t++)
  49651. this.lensFlares.push(e.lensFlares[t]);
  49652. return this
  49653. }
  49654. ,
  49655. n.Scene = function() {
  49656. n.Object3D.call(this),
  49657. this.type = "Scene",
  49658. this.fog = null,
  49659. this.overrideMaterial = null,
  49660. this.autoUpdate = !0
  49661. }
  49662. ,
  49663. n.Scene.prototype = Object.create(n.Object3D.prototype),
  49664. n.Scene.prototype.constructor = n.Scene,
  49665. n.Scene.prototype.copy = function(e, t) {
  49666. return n.Object3D.prototype.copy.call(this, e, t),
  49667. null !== e.fog && (this.fog = e.fog.clone()),
  49668. null !== e.overrideMaterial && (this.overrideMaterial = e.overrideMaterial.clone()),
  49669. this.autoUpdate = e.autoUpdate,
  49670. this.matrixAutoUpdate = e.matrixAutoUpdate,
  49671. this
  49672. }
  49673. ,
  49674. n.Fog = function(e, t, i) {
  49675. this.name = "",
  49676. this.color = new n.Color(e),
  49677. this.near = void 0 !== t ? t : 1,
  49678. this.far = void 0 !== i ? i : 1e3
  49679. }
  49680. ,
  49681. n.Fog.prototype.clone = function() {
  49682. return new n.Fog(this.color.getHex(),this.near,this.far)
  49683. }
  49684. ,
  49685. n.FogExp2 = function(e, t) {
  49686. this.name = "",
  49687. this.color = new n.Color(e),
  49688. this.density = void 0 !== t ? t : 25e-5
  49689. }
  49690. ,
  49691. n.FogExp2.prototype.clone = function() {
  49692. return new n.FogExp2(this.color.getHex(),this.density)
  49693. }
  49694. ,
  49695. n.ShaderChunk = {},
  49696. n.ShaderChunk.alphamap_fragment = "#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif\n",
  49697. n.ShaderChunk.alphamap_pars_fragment = "#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif\n",
  49698. n.ShaderChunk.alphatest_fragment = "#ifdef ALPHATEST\n\tif ( diffuseColor.a < ALPHATEST ) discard;\n#endif\n",
  49699. 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",
  49700. n.ShaderChunk.aomap_pars_fragment = "#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",
  49701. n.ShaderChunk.begin_vertex = "\nvec3 transformed = vec3( position );\n",
  49702. n.ShaderChunk.beginnormal_vertex = "\nvec3 objectNormal = vec3( normal );\n",
  49703. 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",
  49704. 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",
  49705. n.ShaderChunk.color_fragment = "#ifdef USE_COLOR\n\tdiffuseColor.rgb *= vColor;\n#endif",
  49706. n.ShaderChunk.color_pars_fragment = "#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif\n",
  49707. n.ShaderChunk.color_pars_vertex = "#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",
  49708. n.ShaderChunk.color_vertex = "#ifdef USE_COLOR\n\tvColor.xyz = color.xyz;\n#endif",
  49709. 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",
  49710. 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",
  49711. n.ShaderChunk.defaultnormal_vertex = "#ifdef FLIP_SIDED\n\tobjectNormal = -objectNormal;\n#endif\nvec3 transformedNormal = normalMatrix * objectNormal;\n",
  49712. n.ShaderChunk.displacementmap_vertex = "#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normal * ( texture2D( displacementMap, uv ).x * displacementScale + displacementBias );\n#endif\n",
  49713. n.ShaderChunk.displacementmap_pars_vertex = "#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif\n",
  49714. 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",
  49715. n.ShaderChunk.emissivemap_pars_fragment = "#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif\n",
  49716. 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",
  49717. n.ShaderChunk.encodings_fragment = " gl_FragColor = linearToOutputTexel( gl_FragColor );\n",
  49718. 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",
  49719. 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",
  49720. 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",
  49721. 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",
  49722. 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",
  49723. 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",
  49724. n.ShaderChunk.lightmap_fragment = "#ifdef USE_LIGHTMAP\n\treflectedLight.indirectDiffuse += PI * texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n#endif\n",
  49725. n.ShaderChunk.lightmap_pars_fragment = "#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",
  49726. 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",
  49727. 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",
  49728. n.ShaderChunk.lights_phong_fragment = "BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;\n",
  49729. 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",
  49730. n.ShaderChunk.lights_phong_pars_vertex = "#ifdef USE_ENVMAP\n\tvarying vec3 vWorldPosition;\n#endif\n",
  49731. n.ShaderChunk.lights_phong_vertex = "#ifdef USE_ENVMAP\n\tvWorldPosition = worldPosition.xyz;\n#endif\n",
  49732. 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",
  49733. 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",
  49734. 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",
  49735. n.ShaderChunk.logdepthbuf_fragment = "#if defined(USE_LOGDEPTHBUF) && defined(USE_LOGDEPTHBUF_EXT)\n\tgl_FragDepthEXT = log2(vFragDepth) * logDepthBufFC * 0.5;\n#endif",
  49736. 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",
  49737. 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",
  49738. 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",
  49739. n.ShaderChunk.map_fragment = "#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif\n",
  49740. n.ShaderChunk.map_pars_fragment = "#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n",
  49741. 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",
  49742. n.ShaderChunk.map_particle_pars_fragment = "#ifdef USE_MAP\n\tuniform vec4 offsetRepeat;\n\tuniform sampler2D map;\n#endif\n",
  49743. n.ShaderChunk.metalnessmap_fragment = "float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.r;\n#endif\n",
  49744. n.ShaderChunk.metalnessmap_pars_fragment = "#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",
  49745. 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",
  49746. 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";
  49747. 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";
  49748. 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",
  49749. 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",
  49750. n.ShaderChunk.premultiplied_alpha_fragment = "#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif\n",
  49751. 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",
  49752. n.ShaderChunk.roughnessmap_fragment = "float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.r;\n#endif\n",
  49753. n.ShaderChunk.roughnessmap_pars_fragment = "#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",
  49754. 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",
  49755. 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",
  49756. 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",
  49757. 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",
  49758. 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",
  49759. 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",
  49760. 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",
  49761. 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",
  49762. 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",
  49763. n.ShaderChunk.specularmap_pars_fragment = "#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",
  49764. n.ShaderChunk.tonemapping_fragment = "#if defined( TONE_MAPPING )\n gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif\n",
  49765. 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",
  49766. n.ShaderChunk.uv2_pars_fragment = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif",
  49767. n.ShaderChunk.uv2_pars_vertex = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n#endif",
  49768. n.ShaderChunk.uv2_vertex = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = uv2;\n#endif",
  49769. 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",
  49770. 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",
  49771. 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",
  49772. 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",
  49773. n.UniformsUtils = {
  49774. merge: function(e) {
  49775. for (var t = {}, i = 0; i < e.length; i++) {
  49776. var n = this.clone(e[i]);
  49777. for (var r in n)
  49778. t[r] = n[r]
  49779. }
  49780. return t
  49781. },
  49782. clone: function(e) {
  49783. var t = {};
  49784. for (var i in e) {
  49785. t[i] = {};
  49786. for (var r in e[i]) {
  49787. var o = e[i][r];
  49788. 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
  49789. }
  49790. }
  49791. return t
  49792. }
  49793. },
  49794. n.UniformsLib = {
  49795. common: {
  49796. diffuse: {
  49797. type: "c",
  49798. value: new n.Color(15658734)
  49799. },
  49800. opacity: {
  49801. type: "f",
  49802. value: 1
  49803. },
  49804. map: {
  49805. type: "t",
  49806. value: null
  49807. },
  49808. offsetRepeat: {
  49809. type: "v4",
  49810. value: new n.Vector4(0,0,1,1)
  49811. },
  49812. specularMap: {
  49813. type: "t",
  49814. value: null
  49815. },
  49816. alphaMap: {
  49817. type: "t",
  49818. value: null
  49819. },
  49820. envMap: {
  49821. type: "t",
  49822. value: null
  49823. },
  49824. flipEnvMap: {
  49825. type: "f",
  49826. value: -1
  49827. },
  49828. reflectivity: {
  49829. type: "f",
  49830. value: 1
  49831. },
  49832. refractionRatio: {
  49833. type: "f",
  49834. value: .98
  49835. }
  49836. },
  49837. aomap: {
  49838. aoMap: {
  49839. type: "t",
  49840. value: null
  49841. },
  49842. aoMapIntensity: {
  49843. type: "f",
  49844. value: 1
  49845. }
  49846. },
  49847. lightmap: {
  49848. lightMap: {
  49849. type: "t",
  49850. value: null
  49851. },
  49852. lightMapIntensity: {
  49853. type: "f",
  49854. value: 1
  49855. }
  49856. },
  49857. emissivemap: {
  49858. emissiveMap: {
  49859. type: "t",
  49860. value: null
  49861. }
  49862. },
  49863. bumpmap: {
  49864. bumpMap: {
  49865. type: "t",
  49866. value: null
  49867. },
  49868. bumpScale: {
  49869. type: "f",
  49870. value: 1
  49871. }
  49872. },
  49873. normalmap: {
  49874. normalMap: {
  49875. type: "t",
  49876. value: null
  49877. },
  49878. normalScale: {
  49879. type: "v2",
  49880. value: new n.Vector2(1,1)
  49881. }
  49882. },
  49883. displacementmap: {
  49884. displacementMap: {
  49885. type: "t",
  49886. value: null
  49887. },
  49888. displacementScale: {
  49889. type: "f",
  49890. value: 1
  49891. },
  49892. displacementBias: {
  49893. type: "f",
  49894. value: 0
  49895. }
  49896. },
  49897. roughnessmap: {
  49898. roughnessMap: {
  49899. type: "t",
  49900. value: null
  49901. }
  49902. },
  49903. metalnessmap: {
  49904. metalnessMap: {
  49905. type: "t",
  49906. value: null
  49907. }
  49908. },
  49909. fog: {
  49910. fogDensity: {
  49911. type: "f",
  49912. value: 25e-5
  49913. },
  49914. fogNear: {
  49915. type: "f",
  49916. value: 1
  49917. },
  49918. fogFar: {
  49919. type: "f",
  49920. value: 2e3
  49921. },
  49922. fogColor: {
  49923. type: "c",
  49924. value: new n.Color(16777215)
  49925. }
  49926. },
  49927. lights: {
  49928. ambientLightColor: {
  49929. type: "fv",
  49930. value: []
  49931. },
  49932. directionalLights: {
  49933. type: "sa",
  49934. value: [],
  49935. properties: {
  49936. direction: {
  49937. type: "v3"
  49938. },
  49939. color: {
  49940. type: "c"
  49941. },
  49942. shadow: {
  49943. type: "i"
  49944. },
  49945. shadowBias: {
  49946. type: "f"
  49947. },
  49948. shadowRadius: {
  49949. type: "f"
  49950. },
  49951. shadowMapSize: {
  49952. type: "v2"
  49953. }
  49954. }
  49955. },
  49956. directionalShadowMap: {
  49957. type: "tv",
  49958. value: []
  49959. },
  49960. directionalShadowMatrix: {
  49961. type: "m4v",
  49962. value: []
  49963. },
  49964. spotLights: {
  49965. type: "sa",
  49966. value: [],
  49967. properties: {
  49968. color: {
  49969. type: "c"
  49970. },
  49971. position: {
  49972. type: "v3"
  49973. },
  49974. direction: {
  49975. type: "v3"
  49976. },
  49977. distance: {
  49978. type: "f"
  49979. },
  49980. coneCos: {
  49981. type: "f"
  49982. },
  49983. penumbraCos: {
  49984. type: "f"
  49985. },
  49986. decay: {
  49987. type: "f"
  49988. },
  49989. shadow: {
  49990. type: "i"
  49991. },
  49992. shadowBias: {
  49993. type: "f"
  49994. },
  49995. shadowRadius: {
  49996. type: "f"
  49997. },
  49998. shadowMapSize: {
  49999. type: "v2"
  50000. }
  50001. }
  50002. },
  50003. spotShadowMap: {
  50004. type: "tv",
  50005. value: []
  50006. },
  50007. spotShadowMatrix: {
  50008. type: "m4v",
  50009. value: []
  50010. },
  50011. pointLights: {
  50012. type: "sa",
  50013. value: [],
  50014. properties: {
  50015. color: {
  50016. type: "c"
  50017. },
  50018. position: {
  50019. type: "v3"
  50020. },
  50021. decay: {
  50022. type: "f"
  50023. },
  50024. distance: {
  50025. type: "f"
  50026. },
  50027. shadow: {
  50028. type: "i"
  50029. },
  50030. shadowBias: {
  50031. type: "f"
  50032. },
  50033. shadowRadius: {
  50034. type: "f"
  50035. },
  50036. shadowMapSize: {
  50037. type: "v2"
  50038. }
  50039. }
  50040. },
  50041. pointShadowMap: {
  50042. type: "tv",
  50043. value: []
  50044. },
  50045. pointShadowMatrix: {
  50046. type: "m4v",
  50047. value: []
  50048. },
  50049. hemisphereLights: {
  50050. type: "sa",
  50051. value: [],
  50052. properties: {
  50053. direction: {
  50054. type: "v3"
  50055. },
  50056. skyColor: {
  50057. type: "c"
  50058. },
  50059. groundColor: {
  50060. type: "c"
  50061. }
  50062. }
  50063. }
  50064. },
  50065. points: {
  50066. diffuse: {
  50067. type: "c",
  50068. value: new n.Color(15658734)
  50069. },
  50070. opacity: {
  50071. type: "f",
  50072. value: 1
  50073. },
  50074. size: {
  50075. type: "f",
  50076. value: 1
  50077. },
  50078. scale: {
  50079. type: "f",
  50080. value: 1
  50081. },
  50082. map: {
  50083. type: "t",
  50084. value: null
  50085. },
  50086. offsetRepeat: {
  50087. type: "v4",
  50088. value: new n.Vector4(0,0,1,1)
  50089. }
  50090. }
  50091. },
  50092. 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",
  50093. 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",
  50094. 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",
  50095. 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",
  50096. 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",
  50097. 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",
  50098. 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",
  50099. 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",
  50100. 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",
  50101. 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",
  50102. 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",
  50103. 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",
  50104. 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",
  50105. 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",
  50106. 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",
  50107. 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",
  50108. 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",
  50109. 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",
  50110. 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",
  50111. 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",
  50112. 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",
  50113. 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",
  50114. 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",
  50115. 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",
  50116. n.ShaderLib = {
  50117. basic: {
  50118. uniforms: n.UniformsUtils.merge([n.UniformsLib.common, n.UniformsLib.aomap, n.UniformsLib.fog]),
  50119. vertexShader: n.ShaderChunk.meshbasic_vert,
  50120. fragmentShader: n.ShaderChunk.meshbasic_frag
  50121. },
  50122. lambert: {
  50123. uniforms: n.UniformsUtils.merge([n.UniformsLib.common, n.UniformsLib.aomap, n.UniformsLib.lightmap, n.UniformsLib.emissivemap, n.UniformsLib.fog, n.UniformsLib.lights, {
  50124. emissive: {
  50125. type: "c",
  50126. value: new n.Color(0)
  50127. }
  50128. }]),
  50129. vertexShader: n.ShaderChunk.meshlambert_vert,
  50130. fragmentShader: n.ShaderChunk.meshlambert_frag
  50131. },
  50132. phong: {
  50133. 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, {
  50134. emissive: {
  50135. type: "c",
  50136. value: new n.Color(0)
  50137. },
  50138. specular: {
  50139. type: "c",
  50140. value: new n.Color(1118481)
  50141. },
  50142. shininess: {
  50143. type: "f",
  50144. value: 30
  50145. }
  50146. }]),
  50147. vertexShader: n.ShaderChunk.meshphong_vert,
  50148. fragmentShader: n.ShaderChunk.meshphong_frag
  50149. },
  50150. standard: {
  50151. 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, {
  50152. emissive: {
  50153. type: "c",
  50154. value: new n.Color(0)
  50155. },
  50156. roughness: {
  50157. type: "f",
  50158. value: .5
  50159. },
  50160. metalness: {
  50161. type: "f",
  50162. value: 0
  50163. },
  50164. envMapIntensity: {
  50165. type: "f",
  50166. value: 1
  50167. }
  50168. }]),
  50169. vertexShader: n.ShaderChunk.meshstandard_vert,
  50170. fragmentShader: n.ShaderChunk.meshstandard_frag
  50171. },
  50172. points: {
  50173. uniforms: n.UniformsUtils.merge([n.UniformsLib.points, n.UniformsLib.fog]),
  50174. vertexShader: n.ShaderChunk.points_vert,
  50175. fragmentShader: n.ShaderChunk.points_frag
  50176. },
  50177. dashed: {
  50178. uniforms: n.UniformsUtils.merge([n.UniformsLib.common, n.UniformsLib.fog, {
  50179. scale: {
  50180. type: "f",
  50181. value: 1
  50182. },
  50183. dashSize: {
  50184. type: "f",
  50185. value: 1
  50186. },
  50187. totalSize: {
  50188. type: "f",
  50189. value: 2
  50190. }
  50191. }]),
  50192. vertexShader: n.ShaderChunk.linedashed_vert,
  50193. fragmentShader: n.ShaderChunk.linedashed_frag
  50194. },
  50195. depth: {
  50196. uniforms: {
  50197. mNear: {
  50198. type: "f",
  50199. value: 1
  50200. },
  50201. mFar: {
  50202. type: "f",
  50203. value: 2e3
  50204. },
  50205. opacity: {
  50206. type: "f",
  50207. value: 1
  50208. }
  50209. },
  50210. vertexShader: n.ShaderChunk.depth_vert,
  50211. fragmentShader: n.ShaderChunk.depth_frag
  50212. },
  50213. normal: {
  50214. uniforms: {
  50215. opacity: {
  50216. type: "f",
  50217. value: 1
  50218. }
  50219. },
  50220. vertexShader: n.ShaderChunk.normal_vert,
  50221. fragmentShader: n.ShaderChunk.normal_frag
  50222. },
  50223. cube: {
  50224. uniforms: {
  50225. tCube: {
  50226. type: "t",
  50227. value: null
  50228. },
  50229. tFlip: {
  50230. type: "f",
  50231. value: -1
  50232. }
  50233. },
  50234. vertexShader: n.ShaderChunk.cube_vert,
  50235. fragmentShader: n.ShaderChunk.cube_frag
  50236. },
  50237. equirect: {
  50238. uniforms: {
  50239. tEquirect: {
  50240. type: "t",
  50241. value: null
  50242. },
  50243. tFlip: {
  50244. type: "f",
  50245. value: -1
  50246. }
  50247. },
  50248. vertexShader: n.ShaderChunk.equirect_vert,
  50249. fragmentShader: n.ShaderChunk.equirect_frag
  50250. },
  50251. depthRGBA: {
  50252. uniforms: {},
  50253. vertexShader: n.ShaderChunk.depthRGBA_vert,
  50254. fragmentShader: n.ShaderChunk.depthRGBA_frag
  50255. },
  50256. distanceRGBA: {
  50257. uniforms: {
  50258. lightPos: {
  50259. type: "v3",
  50260. value: new n.Vector3(0,0,0)
  50261. }
  50262. },
  50263. vertexShader: n.ShaderChunk.distanceRGBA_vert,
  50264. fragmentShader: n.ShaderChunk.distanceRGBA_frag
  50265. }
  50266. },
  50267. n.WebGLRenderer = function(e) {
  50268. function t() {
  50269. return null === ye ? Oe : 1
  50270. }
  50271. function i(e, t, i, n) {
  50272. se === !0 && (e *= n,
  50273. t *= n,
  50274. i *= n),
  50275. Ye.clearColor(e, t, i, n)
  50276. }
  50277. function r() {
  50278. Ye.init(),
  50279. Ye.scissor(we.copy(Le).multiplyScalar(Oe)),
  50280. Ye.viewport(Te.copy(Ne).multiplyScalar(Oe)),
  50281. i(Se.r, Se.g, Se.b, Me)
  50282. }
  50283. function o() {
  50284. Ae = null,
  50285. be = null,
  50286. Ee = "",
  50287. Ie = -1,
  50288. Ye.reset()
  50289. }
  50290. function a(e) {
  50291. e.preventDefault(),
  50292. o(),
  50293. r(),
  50294. Xe.clear()
  50295. }
  50296. function s(e) {
  50297. var t = e.target;
  50298. t.removeEventListener("dispose", s),
  50299. h(t),
  50300. ke.textures--
  50301. }
  50302. function l(e) {
  50303. var t = e.target;
  50304. t.removeEventListener("dispose", l),
  50305. u(t),
  50306. ke.textures--
  50307. }
  50308. function c(e) {
  50309. var t = e.target;
  50310. t.removeEventListener("dispose", c),
  50311. d(t)
  50312. }
  50313. function h(e) {
  50314. var t = Xe.get(e);
  50315. if (e.image && t.__image__webglTextureCube)
  50316. Ge.deleteTexture(t.__image__webglTextureCube);
  50317. else {
  50318. if (void 0 === t.__webglInit)
  50319. return;
  50320. Ge.deleteTexture(t.__webglTexture)
  50321. }
  50322. Xe.delete(e)
  50323. }
  50324. function u(e) {
  50325. var t = Xe.get(e)
  50326. , i = Xe.get(e.texture);
  50327. if (e && void 0 !== i.__webglTexture) {
  50328. if (Ge.deleteTexture(i.__webglTexture),
  50329. e instanceof n.WebGLRenderTargetCube)
  50330. for (var r = 0; r < 6; r++)
  50331. Ge.deleteFramebuffer(t.__webglFramebuffer[r]),
  50332. Ge.deleteRenderbuffer(t.__webglDepthbuffer[r]);
  50333. else
  50334. Ge.deleteFramebuffer(t.__webglFramebuffer),
  50335. Ge.deleteRenderbuffer(t.__webglDepthbuffer);
  50336. Xe.delete(e.texture),
  50337. Xe.delete(e)
  50338. }
  50339. }
  50340. function d(e) {
  50341. p(e),
  50342. Xe.delete(e)
  50343. }
  50344. function p(e) {
  50345. var t = Xe.get(e).program;
  50346. e.program = void 0,
  50347. void 0 !== t && qe.releaseProgram(t)
  50348. }
  50349. function f(e, t, i, r) {
  50350. var o;
  50351. if (i instanceof n.InstancedBufferGeometry && (o = We.get("ANGLE_instanced_arrays"),
  50352. null === o))
  50353. return void console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");
  50354. void 0 === r && (r = 0),
  50355. Ye.initAttributes();
  50356. var a = i.attributes
  50357. , s = t.getAttributes()
  50358. , l = e.defaultAttributeValues;
  50359. for (var c in s) {
  50360. var h = s[c];
  50361. if (h >= 0) {
  50362. var u = a[c];
  50363. if (void 0 !== u) {
  50364. var d = u.itemSize
  50365. , p = Ze.getAttributeBuffer(u);
  50366. if (u instanceof n.InterleavedBufferAttribute) {
  50367. var f = u.data
  50368. , g = f.stride
  50369. , m = u.offset;
  50370. f instanceof n.InstancedInterleavedBuffer ? (Ye.enableAttributeAndDivisor(h, f.meshPerAttribute, o),
  50371. void 0 === i.maxInstancedCount && (i.maxInstancedCount = f.meshPerAttribute * f.count)) : Ye.enableAttribute(h),
  50372. Ge.bindBuffer(Ge.ARRAY_BUFFER, p),
  50373. Ge.vertexAttribPointer(h, d, Ge.FLOAT, !1, g * f.array.BYTES_PER_ELEMENT, (r * g + m) * f.array.BYTES_PER_ELEMENT)
  50374. } else
  50375. u instanceof n.InstancedBufferAttribute ? (Ye.enableAttributeAndDivisor(h, u.meshPerAttribute, o),
  50376. void 0 === i.maxInstancedCount && (i.maxInstancedCount = u.meshPerAttribute * u.count)) : Ye.enableAttribute(h),
  50377. Ge.bindBuffer(Ge.ARRAY_BUFFER, p),
  50378. Ge.vertexAttribPointer(h, d, Ge.FLOAT, !1, 0, r * d * 4)
  50379. } else if (void 0 !== l) {
  50380. var v = l[c];
  50381. if (void 0 !== v)
  50382. switch (v.length) {
  50383. case 2:
  50384. Ge.vertexAttrib2fv(h, v);
  50385. break;
  50386. case 3:
  50387. Ge.vertexAttrib3fv(h, v);
  50388. break;
  50389. case 4:
  50390. Ge.vertexAttrib4fv(h, v);
  50391. break;
  50392. default:
  50393. Ge.vertexAttrib1fv(h, v)
  50394. }
  50395. }
  50396. }
  50397. }
  50398. Ye.disableUnusedAttributes()
  50399. }
  50400. function g(e, t) {
  50401. return Math.abs(t[0]) - Math.abs(e[0])
  50402. }
  50403. function m(e, t) {
  50404. 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
  50405. }
  50406. function v(e, t) {
  50407. 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
  50408. }
  50409. function A(e, t, i, n, r) {
  50410. var o, a;
  50411. i.transparent ? (o = de,
  50412. a = ++pe) : (o = he,
  50413. a = ++ue);
  50414. var s = o[a];
  50415. void 0 !== s ? (s.id = e.id,
  50416. s.object = e,
  50417. s.geometry = t,
  50418. s.material = i,
  50419. s.z = Ve.z,
  50420. s.group = r) : (s = {
  50421. id: e.id,
  50422. object: e,
  50423. geometry: t,
  50424. material: i,
  50425. z: Ve.z,
  50426. group: r
  50427. },
  50428. o.push(s))
  50429. }
  50430. function y(e, t) {
  50431. if (e.visible !== !1) {
  50432. if (e.layers.test(t.layers))
  50433. if (e instanceof n.Light)
  50434. ce.push(e);
  50435. else if (e instanceof n.Sprite)
  50436. e.frustumCulled !== !1 && Be.intersectsObject(e) !== !0 || ge.push(e);
  50437. else if (e instanceof n.LensFlare)
  50438. me.push(e);
  50439. else if (e instanceof n.ImmediateRenderObject)
  50440. ve.sortObjects === !0 && (Ve.setFromMatrixPosition(e.matrixWorld),
  50441. Ve.applyProjection(Fe)),
  50442. A(e, null, e.material, Ve.z, null);
  50443. else if ((e instanceof n.Mesh || e instanceof n.Line || e instanceof n.Points) && (e instanceof n.SkinnedMesh && e.skeleton.update(),
  50444. e.frustumCulled === !1 || Be.intersectsObject(e) === !0)) {
  50445. var i = e.material;
  50446. if (i.visible === !0) {
  50447. ve.sortObjects === !0 && (Ve.setFromMatrixPosition(e.matrixWorld),
  50448. Ve.applyProjection(Fe));
  50449. var r = Ze.update(e);
  50450. if (i instanceof n.MultiMaterial)
  50451. for (var o = r.groups, a = i.materials, s = 0, l = o.length; s < l; s++) {
  50452. var c = o[s]
  50453. , h = a[c.materialIndex];
  50454. h.visible === !0 && A(e, r, h, Ve.z, c)
  50455. }
  50456. else
  50457. A(e, r, i, Ve.z, null)
  50458. }
  50459. }
  50460. for (var u = e.children, s = 0, l = u.length; s < l; s++)
  50461. y(u[s], t)
  50462. }
  50463. }
  50464. function C(e, t, i, r) {
  50465. for (var o = 0, a = e.length; o < a; o++) {
  50466. var s = e[o]
  50467. , l = s.object
  50468. , c = s.geometry
  50469. , h = void 0 === r ? s.material : r
  50470. , u = s.group;
  50471. if (l.modelViewMatrix.multiplyMatrices(t.matrixWorldInverse, l.matrixWorld),
  50472. l.normalMatrix.getNormalMatrix(l.modelViewMatrix),
  50473. l instanceof n.ImmediateRenderObject) {
  50474. E(h);
  50475. var d = w(t, i, h, l);
  50476. Ee = "",
  50477. l.render(function(e) {
  50478. ve.renderBufferImmediate(e, d, h)
  50479. })
  50480. } else
  50481. ve.renderBufferDirect(t, i, c, h, l, u)
  50482. }
  50483. }
  50484. function I(e, t, i) {
  50485. var r = Xe.get(e)
  50486. , o = qe.getParameters(e, Ue, t, i)
  50487. , a = qe.getProgramCode(e, o)
  50488. , s = r.program
  50489. , l = !0;
  50490. if (void 0 === s)
  50491. e.addEventListener("dispose", c);
  50492. else if (s.code !== a)
  50493. p(e);
  50494. else {
  50495. if (void 0 !== o.shaderID)
  50496. return;
  50497. l = !1
  50498. }
  50499. if (l) {
  50500. if (o.shaderID) {
  50501. var h = n.ShaderLib[o.shaderID];
  50502. r.__webglShader = {
  50503. name: e.type,
  50504. uniforms: n.UniformsUtils.clone(h.uniforms),
  50505. vertexShader: h.vertexShader,
  50506. fragmentShader: h.fragmentShader
  50507. }
  50508. } else
  50509. r.__webglShader = {
  50510. name: e.type,
  50511. uniforms: e.uniforms,
  50512. vertexShader: e.vertexShader,
  50513. fragmentShader: e.fragmentShader
  50514. };
  50515. e.__webglShader = r.__webglShader,
  50516. s = qe.acquireProgram(e, o, a),
  50517. r.program = s,
  50518. e.program = s
  50519. }
  50520. var u = s.getAttributes();
  50521. if (e.morphTargets) {
  50522. e.numSupportedMorphTargets = 0;
  50523. for (var d = 0; d < ve.maxMorphTargets; d++)
  50524. u["morphTarget" + d] >= 0 && e.numSupportedMorphTargets++
  50525. }
  50526. if (e.morphNormals) {
  50527. e.numSupportedMorphNormals = 0;
  50528. for (var d = 0; d < ve.maxMorphNormals; d++)
  50529. u["morphNormal" + d] >= 0 && e.numSupportedMorphNormals++
  50530. }
  50531. r.uniformsList = [];
  50532. var f = r.__webglShader.uniforms
  50533. , g = r.program.getUniforms();
  50534. for (var m in f) {
  50535. var v = g[m];
  50536. v && r.uniformsList.push([r.__webglShader.uniforms[m], v])
  50537. }
  50538. (e instanceof n.MeshPhongMaterial || e instanceof n.MeshLambertMaterial || e instanceof n.MeshStandardMaterial || e.lights) && (r.lightsHash = Ue.hash,
  50539. f.ambientLightColor.value = Ue.ambient,
  50540. f.directionalLights.value = Ue.directional,
  50541. f.spotLights.value = Ue.spot,
  50542. f.pointLights.value = Ue.point,
  50543. f.hemisphereLights.value = Ue.hemi,
  50544. f.directionalShadowMap.value = Ue.directionalShadowMap,
  50545. f.directionalShadowMatrix.value = Ue.directionalShadowMatrix,
  50546. f.spotShadowMap.value = Ue.spotShadowMap,
  50547. f.spotShadowMatrix.value = Ue.spotShadowMatrix,
  50548. f.pointShadowMap.value = Ue.pointShadowMap,
  50549. f.pointShadowMatrix.value = Ue.pointShadowMatrix),
  50550. r.hasDynamicUniforms = !1;
  50551. for (var A = 0, y = r.uniformsList.length; A < y; A++) {
  50552. var C = r.uniformsList[A][0];
  50553. if (C.dynamic === !0) {
  50554. r.hasDynamicUniforms = !0;
  50555. break
  50556. }
  50557. }
  50558. }
  50559. function E(e) {
  50560. b(e),
  50561. 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),
  50562. Ye.setDepthFunc(e.depthFunc),
  50563. Ye.setDepthTest(e.depthTest),
  50564. Ye.setDepthWrite(e.depthWrite),
  50565. Ye.setColorWrite(e.colorWrite),
  50566. Ye.setPolygonOffset(e.polygonOffset, e.polygonOffsetFactor, e.polygonOffsetUnits)
  50567. }
  50568. function b(e) {
  50569. e.side !== n.DoubleSide ? Ye.enable(Ge.CULL_FACE) : Ye.disable(Ge.CULL_FACE),
  50570. Ye.setFlipSided(e.side === n.BackSide)
  50571. }
  50572. function w(e, t, i, r) {
  50573. xe = 0;
  50574. var o = Xe.get(i);
  50575. void 0 === o.program && (i.needsUpdate = !0),
  50576. void 0 !== o.lightsHash && o.lightsHash !== Ue.hash && (i.needsUpdate = !0),
  50577. i.needsUpdate && (I(i, t, r),
  50578. i.needsUpdate = !1);
  50579. var a = !1
  50580. , s = !1
  50581. , l = !1
  50582. , c = o.program
  50583. , h = c.getUniforms()
  50584. , u = o.__webglShader.uniforms;
  50585. if (c.id !== Ae && (Ge.useProgram(c.program),
  50586. Ae = c.id,
  50587. a = !0,
  50588. s = !0,
  50589. l = !0),
  50590. i.id !== Ie && (Ie = i.id,
  50591. s = !0),
  50592. (a || e !== be) && (Ge.uniformMatrix4fv(h.projectionMatrix, !1, e.projectionMatrix.elements),
  50593. je.logarithmicDepthBuffer && Ge.uniform1f(h.logDepthBufFC, 2 / (Math.log(e.far + 1) / Math.LN2)),
  50594. e !== be && (be = e,
  50595. s = !0,
  50596. l = !0),
  50597. (i instanceof n.ShaderMaterial || i instanceof n.MeshPhongMaterial || i instanceof n.MeshStandardMaterial || i.envMap) && void 0 !== h.cameraPosition && (Ve.setFromMatrixPosition(e.matrixWorld),
  50598. Ge.uniform3f(h.cameraPosition, Ve.x, Ve.y, Ve.z)),
  50599. (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),
  50600. void 0 !== h.toneMappingExposure && Ge.uniform1f(h.toneMappingExposure, ve.toneMappingExposure),
  50601. void 0 !== h.toneMappingWhitePoint && Ge.uniform1f(h.toneMappingWhitePoint, ve.toneMappingWhitePoint)),
  50602. i.skinning)
  50603. if (r.bindMatrix && void 0 !== h.bindMatrix && Ge.uniformMatrix4fv(h.bindMatrix, !1, r.bindMatrix.elements),
  50604. r.bindMatrixInverse && void 0 !== h.bindMatrixInverse && Ge.uniformMatrix4fv(h.bindMatrixInverse, !1, r.bindMatrixInverse.elements),
  50605. je.floatVertexTextures && r.skeleton && r.skeleton.useVertexTexture) {
  50606. if (void 0 !== h.boneTexture) {
  50607. var d = B();
  50608. Ge.uniform1i(h.boneTexture, d),
  50609. ve.setTexture(r.skeleton.boneTexture, d)
  50610. }
  50611. void 0 !== h.boneTextureWidth && Ge.uniform1i(h.boneTextureWidth, r.skeleton.boneTextureWidth),
  50612. void 0 !== h.boneTextureHeight && Ge.uniform1i(h.boneTextureHeight, r.skeleton.boneTextureHeight)
  50613. } else
  50614. r.skeleton && r.skeleton.boneMatrices && void 0 !== h.boneGlobalMatrices && Ge.uniformMatrix4fv(h.boneGlobalMatrices, !1, r.skeleton.boneMatrices);
  50615. return s && ((i instanceof n.MeshPhongMaterial || i instanceof n.MeshLambertMaterial || i instanceof n.MeshStandardMaterial || i.lights) && D(u, l),
  50616. t && i.fog && R(u, t),
  50617. (i instanceof n.MeshBasicMaterial || i instanceof n.MeshLambertMaterial || i instanceof n.MeshPhongMaterial || i instanceof n.MeshStandardMaterial) && T(u, i),
  50618. i instanceof n.LineBasicMaterial ? x(u, i) : i instanceof n.LineDashedMaterial ? (x(u, i),
  50619. 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,
  50620. u.mFar.value = e.far,
  50621. u.opacity.value = i.opacity) : i instanceof n.MeshNormalMaterial && (u.opacity.value = i.opacity),
  50622. V(o.uniformsList)),
  50623. N(h, r),
  50624. void 0 !== h.modelMatrix && Ge.uniformMatrix4fv(h.modelMatrix, !1, r.matrixWorld.elements),
  50625. o.hasDynamicUniforms === !0 && _(o.uniformsList, r, e),
  50626. c
  50627. }
  50628. function _(e, t, i) {
  50629. for (var n = [], r = 0, o = e.length; r < o; r++) {
  50630. var a = e[r][0]
  50631. , s = a.onUpdateCallback;
  50632. void 0 !== s && (s.bind(a)(t, i),
  50633. n.push(e[r]))
  50634. }
  50635. V(n)
  50636. }
  50637. function T(e, t) {
  50638. e.opacity.value = t.opacity,
  50639. e.diffuse.value = t.color,
  50640. t.emissive && e.emissive.value.copy(t.emissive).multiplyScalar(t.emissiveIntensity),
  50641. e.map.value = t.map,
  50642. e.specularMap.value = t.specularMap,
  50643. e.alphaMap.value = t.alphaMap,
  50644. t.aoMap && (e.aoMap.value = t.aoMap,
  50645. e.aoMapIntensity.value = t.aoMapIntensity);
  50646. var i;
  50647. 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),
  50648. void 0 !== i) {
  50649. i instanceof n.WebGLRenderTarget && (i = i.texture);
  50650. var r = i.offset
  50651. , o = i.repeat;
  50652. e.offsetRepeat.value.set(r.x, r.y, o.x, o.y)
  50653. }
  50654. e.envMap.value = t.envMap,
  50655. e.flipEnvMap.value = t.envMap instanceof n.WebGLRenderTargetCube ? 1 : -1,
  50656. e.reflectivity.value = t.reflectivity,
  50657. e.refractionRatio.value = t.refractionRatio
  50658. }
  50659. function x(e, t) {
  50660. e.diffuse.value = t.color,
  50661. e.opacity.value = t.opacity
  50662. }
  50663. function S(e, t) {
  50664. e.dashSize.value = t.dashSize,
  50665. e.totalSize.value = t.dashSize + t.gapSize,
  50666. e.scale.value = t.scale
  50667. }
  50668. function M(e, t) {
  50669. if (e.diffuse.value = t.color,
  50670. e.opacity.value = t.opacity,
  50671. e.size.value = t.size * Oe,
  50672. e.scale.value = te.clientHeight / 2,
  50673. e.map.value = t.map,
  50674. null !== t.map) {
  50675. var i = t.map.offset
  50676. , n = t.map.repeat;
  50677. e.offsetRepeat.value.set(i.x, i.y, n.x, n.y)
  50678. }
  50679. }
  50680. function R(e, t) {
  50681. e.fogColor.value = t.color,
  50682. t instanceof n.Fog ? (e.fogNear.value = t.near,
  50683. e.fogFar.value = t.far) : t instanceof n.FogExp2 && (e.fogDensity.value = t.density)
  50684. }
  50685. function P(e, t) {
  50686. t.lightMap && (e.lightMap.value = t.lightMap,
  50687. e.lightMapIntensity.value = t.lightMapIntensity),
  50688. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap)
  50689. }
  50690. function O(e, t) {
  50691. e.specular.value = t.specular,
  50692. e.shininess.value = Math.max(t.shininess, 1e-4),
  50693. t.lightMap && (e.lightMap.value = t.lightMap,
  50694. e.lightMapIntensity.value = t.lightMapIntensity),
  50695. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap),
  50696. t.bumpMap && (e.bumpMap.value = t.bumpMap,
  50697. e.bumpScale.value = t.bumpScale),
  50698. t.normalMap && (e.normalMap.value = t.normalMap,
  50699. e.normalScale.value.copy(t.normalScale)),
  50700. t.displacementMap && (e.displacementMap.value = t.displacementMap,
  50701. e.displacementScale.value = t.displacementScale,
  50702. e.displacementBias.value = t.displacementBias)
  50703. }
  50704. function L(e, t) {
  50705. e.roughness.value = t.roughness,
  50706. e.metalness.value = t.metalness,
  50707. t.roughnessMap && (e.roughnessMap.value = t.roughnessMap),
  50708. t.metalnessMap && (e.metalnessMap.value = t.metalnessMap),
  50709. t.lightMap && (e.lightMap.value = t.lightMap,
  50710. e.lightMapIntensity.value = t.lightMapIntensity),
  50711. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap),
  50712. t.bumpMap && (e.bumpMap.value = t.bumpMap,
  50713. e.bumpScale.value = t.bumpScale),
  50714. t.normalMap && (e.normalMap.value = t.normalMap,
  50715. e.normalScale.value.copy(t.normalScale)),
  50716. t.displacementMap && (e.displacementMap.value = t.displacementMap,
  50717. e.displacementScale.value = t.displacementScale,
  50718. e.displacementBias.value = t.displacementBias),
  50719. t.envMap && (e.envMapIntensity.value = t.envMapIntensity)
  50720. }
  50721. function D(e, t) {
  50722. e.ambientLightColor.needsUpdate = t,
  50723. e.directionalLights.needsUpdate = t,
  50724. e.pointLights.needsUpdate = t,
  50725. e.spotLights.needsUpdate = t,
  50726. e.hemisphereLights.needsUpdate = t
  50727. }
  50728. function N(e, t) {
  50729. Ge.uniformMatrix4fv(e.modelViewMatrix, !1, t.modelViewMatrix.elements),
  50730. e.normalMatrix && Ge.uniformMatrix3fv(e.normalMatrix, !1, t.normalMatrix.elements)
  50731. }
  50732. function B() {
  50733. var e = xe;
  50734. return e >= je.maxTextures && console.warn("WebGLRenderer: trying to use " + e + " texture units while this GPU supports only " + je.maxTextures),
  50735. xe += 1,
  50736. e
  50737. }
  50738. function F(e, t, i, r) {
  50739. var o, a;
  50740. if ("1i" === t)
  50741. Ge.uniform1i(i, r);
  50742. else if ("1f" === t)
  50743. Ge.uniform1f(i, r);
  50744. else if ("2f" === t)
  50745. Ge.uniform2f(i, r[0], r[1]);
  50746. else if ("3f" === t)
  50747. Ge.uniform3f(i, r[0], r[1], r[2]);
  50748. else if ("4f" === t)
  50749. Ge.uniform4f(i, r[0], r[1], r[2], r[3]);
  50750. else if ("1iv" === t)
  50751. Ge.uniform1iv(i, r);
  50752. else if ("3iv" === t)
  50753. Ge.uniform3iv(i, r);
  50754. else if ("1fv" === t)
  50755. Ge.uniform1fv(i, r);
  50756. else if ("2fv" === t)
  50757. Ge.uniform2fv(i, r);
  50758. else if ("3fv" === t)
  50759. Ge.uniform3fv(i, r);
  50760. else if ("4fv" === t)
  50761. Ge.uniform4fv(i, r);
  50762. else if ("Matrix2fv" === t)
  50763. Ge.uniformMatrix2fv(i, !1, r);
  50764. else if ("Matrix3fv" === t)
  50765. Ge.uniformMatrix3fv(i, !1, r);
  50766. else if ("Matrix4fv" === t)
  50767. Ge.uniformMatrix4fv(i, !1, r);
  50768. else if ("i" === t)
  50769. Ge.uniform1i(i, r);
  50770. else if ("f" === t)
  50771. Ge.uniform1f(i, r);
  50772. else if ("v2" === t)
  50773. Ge.uniform2f(i, r.x, r.y);
  50774. else if ("v3" === t)
  50775. Ge.uniform3f(i, r.x, r.y, r.z);
  50776. else if ("v4" === t)
  50777. Ge.uniform4f(i, r.x, r.y, r.z, r.w);
  50778. else if ("c" === t)
  50779. Ge.uniform3f(i, r.r, r.g, r.b);
  50780. else if ("s" === t) {
  50781. var s = e.properties;
  50782. for (var l in s) {
  50783. var c = s[l]
  50784. , h = i[l]
  50785. , u = r[l];
  50786. F(c, c.type, h, u)
  50787. }
  50788. } else if ("sa" === t)
  50789. for (var s = e.properties, d = 0, p = r.length; d < p; d++)
  50790. for (var l in s) {
  50791. var c = s[l]
  50792. , h = i[d][l]
  50793. , u = r[d][l];
  50794. F(c, c.type, h, u)
  50795. }
  50796. else if ("iv1" === t)
  50797. Ge.uniform1iv(i, r);
  50798. else if ("iv" === t)
  50799. Ge.uniform3iv(i, r);
  50800. else if ("fv1" === t)
  50801. Ge.uniform1fv(i, r);
  50802. else if ("fv" === t)
  50803. Ge.uniform3fv(i, r);
  50804. else if ("v2v" === t) {
  50805. void 0 === e._array && (e._array = new Float32Array(2 * r.length));
  50806. for (var d = 0, f = 0, g = r.length; d < g; d++,
  50807. f += 2)
  50808. e._array[f + 0] = r[d].x,
  50809. e._array[f + 1] = r[d].y;
  50810. Ge.uniform2fv(i, e._array)
  50811. } else if ("v3v" === t) {
  50812. void 0 === e._array && (e._array = new Float32Array(3 * r.length));
  50813. for (var d = 0, m = 0, g = r.length; d < g; d++,
  50814. m += 3)
  50815. e._array[m + 0] = r[d].x,
  50816. e._array[m + 1] = r[d].y,
  50817. e._array[m + 2] = r[d].z;
  50818. Ge.uniform3fv(i, e._array)
  50819. } else if ("v4v" === t) {
  50820. void 0 === e._array && (e._array = new Float32Array(4 * r.length));
  50821. for (var d = 0, v = 0, g = r.length; d < g; d++,
  50822. v += 4)
  50823. e._array[v + 0] = r[d].x,
  50824. e._array[v + 1] = r[d].y,
  50825. e._array[v + 2] = r[d].z,
  50826. e._array[v + 3] = r[d].w;
  50827. Ge.uniform4fv(i, e._array)
  50828. } else if ("m2" === t)
  50829. Ge.uniformMatrix2fv(i, !1, r.elements);
  50830. else if ("m3" === t)
  50831. Ge.uniformMatrix3fv(i, !1, r.elements);
  50832. else if ("m3v" === t) {
  50833. void 0 === e._array && (e._array = new Float32Array(9 * r.length));
  50834. for (var d = 0, g = r.length; d < g; d++)
  50835. r[d].flattenToArrayOffset(e._array, 9 * d);
  50836. Ge.uniformMatrix3fv(i, !1, e._array)
  50837. } else if ("m4" === t)
  50838. Ge.uniformMatrix4fv(i, !1, r.elements);
  50839. else if ("m4v" === t) {
  50840. void 0 === e._array && (e._array = new Float32Array(16 * r.length));
  50841. for (var d = 0, g = r.length; d < g; d++)
  50842. r[d].flattenToArrayOffset(e._array, 16 * d);
  50843. Ge.uniformMatrix4fv(i, !1, e._array)
  50844. } else if ("t" === t) {
  50845. if (o = r,
  50846. a = B(),
  50847. Ge.uniform1i(i, a),
  50848. !o)
  50849. return;
  50850. 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)
  50851. } else if ("tv" === t) {
  50852. void 0 === e._array && (e._array = []);
  50853. for (var d = 0, g = e.value.length; d < g; d++)
  50854. e._array[d] = B();
  50855. Ge.uniform1iv(i, e._array);
  50856. for (var d = 0, g = e.value.length; d < g; d++)
  50857. o = e.value[d],
  50858. a = e._array[d],
  50859. 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))
  50860. } else
  50861. console.warn("THREE.WebGLRenderer: Unknown uniform type: " + t)
  50862. }
  50863. function V(e) {
  50864. for (var t = 0, i = e.length; t < i; t++) {
  50865. var n = e[t][0];
  50866. if (n.needsUpdate !== !1) {
  50867. var r = n.type
  50868. , o = e[t][1]
  50869. , a = n.value;
  50870. F(n, r, o, a)
  50871. }
  50872. }
  50873. }
  50874. function U(e, t) {
  50875. 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;
  50876. for (Ue.shadowsPointLight = 0,
  50877. i = 0,
  50878. r = e.length; i < r; i++)
  50879. if (o = e[i],
  50880. a = o.color,
  50881. s = o.intensity,
  50882. l = o.distance,
  50883. o instanceof n.AmbientLight)
  50884. c += a.r * s,
  50885. h += a.g * s,
  50886. u += a.b * s;
  50887. else if (o instanceof n.DirectionalLight) {
  50888. var A = Ke.get(o);
  50889. A.color.copy(o.color).multiplyScalar(o.intensity),
  50890. A.direction.setFromMatrixPosition(o.matrixWorld),
  50891. Ve.setFromMatrixPosition(o.target.matrixWorld),
  50892. A.direction.sub(Ve),
  50893. A.direction.transformDirection(d),
  50894. A.shadow = o.castShadow,
  50895. o.castShadow && (A.shadowBias = o.shadow.bias,
  50896. A.shadowRadius = o.shadow.radius,
  50897. A.shadowMapSize = o.shadow.mapSize,
  50898. Ue.shadows[v++] = o),
  50899. Ue.directionalShadowMap[p] = o.shadow.map,
  50900. Ue.directionalShadowMatrix[p] = o.shadow.matrix,
  50901. Ue.directional[p++] = A
  50902. } else if (o instanceof n.SpotLight) {
  50903. var A = Ke.get(o);
  50904. A.position.setFromMatrixPosition(o.matrixWorld),
  50905. A.position.applyMatrix4(d),
  50906. A.color.copy(a).multiplyScalar(s),
  50907. A.distance = l,
  50908. A.direction.setFromMatrixPosition(o.matrixWorld),
  50909. Ve.setFromMatrixPosition(o.target.matrixWorld),
  50910. A.direction.sub(Ve),
  50911. A.direction.transformDirection(d),
  50912. A.coneCos = Math.cos(o.angle),
  50913. A.penumbraCos = Math.cos(o.angle * (1 - o.penumbra)),
  50914. A.decay = 0 === o.distance ? 0 : o.decay,
  50915. A.shadow = o.castShadow,
  50916. o.castShadow && (A.shadowBias = o.shadow.bias,
  50917. A.shadowRadius = o.shadow.radius,
  50918. A.shadowMapSize = o.shadow.mapSize,
  50919. Ue.shadows[v++] = o),
  50920. Ue.spotShadowMap[g] = o.shadow.map,
  50921. Ue.spotShadowMatrix[g] = o.shadow.matrix,
  50922. Ue.spot[g++] = A
  50923. } else if (o instanceof n.PointLight) {
  50924. var A = Ke.get(o);
  50925. A.position.setFromMatrixPosition(o.matrixWorld),
  50926. A.position.applyMatrix4(d),
  50927. A.color.copy(o.color).multiplyScalar(o.intensity),
  50928. A.distance = o.distance,
  50929. A.decay = 0 === o.distance ? 0 : o.decay,
  50930. A.shadow = o.castShadow,
  50931. o.castShadow && (A.shadowBias = o.shadow.bias,
  50932. A.shadowRadius = o.shadow.radius,
  50933. A.shadowMapSize = o.shadow.mapSize,
  50934. Ue.shadows[v++] = o),
  50935. Ue.pointShadowMap[f] = o.shadow.map,
  50936. void 0 === Ue.pointShadowMatrix[f] && (Ue.pointShadowMatrix[f] = new n.Matrix4),
  50937. Ve.setFromMatrixPosition(o.matrixWorld).negate(),
  50938. Ue.pointShadowMatrix[f].identity().setPosition(Ve),
  50939. Ue.point[f++] = A
  50940. } else if (o instanceof n.HemisphereLight) {
  50941. var A = Ke.get(o);
  50942. A.direction.setFromMatrixPosition(o.matrixWorld),
  50943. A.direction.transformDirection(d),
  50944. A.direction.normalize(),
  50945. A.skyColor.copy(o.color).multiplyScalar(s),
  50946. A.groundColor.copy(o.groundColor).multiplyScalar(s),
  50947. Ue.hemi[m++] = A
  50948. }
  50949. Ue.ambient[0] = c,
  50950. Ue.ambient[1] = h,
  50951. Ue.ambient[2] = u,
  50952. Ue.directional.length = p,
  50953. Ue.spot.length = g,
  50954. Ue.point.length = f,
  50955. Ue.hemi.length = m,
  50956. Ue.shadows.length = v,
  50957. Ue.hash = p + "," + f + "," + g + "," + m + "," + v
  50958. }
  50959. function k(e, t, i) {
  50960. var r;
  50961. if (i ? (Ge.texParameteri(e, Ge.TEXTURE_WRAP_S, ee(t.wrapS)),
  50962. Ge.texParameteri(e, Ge.TEXTURE_WRAP_T, ee(t.wrapT)),
  50963. Ge.texParameteri(e, Ge.TEXTURE_MAG_FILTER, ee(t.magFilter)),
  50964. Ge.texParameteri(e, Ge.TEXTURE_MIN_FILTER, ee(t.minFilter))) : (Ge.texParameteri(e, Ge.TEXTURE_WRAP_S, Ge.CLAMP_TO_EDGE),
  50965. Ge.texParameteri(e, Ge.TEXTURE_WRAP_T, Ge.CLAMP_TO_EDGE),
  50966. t.wrapS === n.ClampToEdgeWrapping && t.wrapT === n.ClampToEdgeWrapping || console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping.", t),
  50967. Ge.texParameteri(e, Ge.TEXTURE_MAG_FILTER, $(t.magFilter)),
  50968. Ge.texParameteri(e, Ge.TEXTURE_MIN_FILTER, $(t.minFilter)),
  50969. t.minFilter !== n.NearestFilter && t.minFilter !== n.LinearFilter && console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.", t)),
  50970. r = We.get("EXT_texture_filter_anisotropic")) {
  50971. if (t.type === n.FloatType && null === We.get("OES_texture_float_linear"))
  50972. return;
  50973. if (t.type === n.HalfFloatType && null === We.get("OES_texture_half_float_linear"))
  50974. return;
  50975. (t.anisotropy > 1 || Xe.get(t).__currentAnisotropy) && (Ge.texParameterf(e, r.TEXTURE_MAX_ANISOTROPY_EXT, Math.min(t.anisotropy, ve.getMaxAnisotropy())),
  50976. Xe.get(t).__currentAnisotropy = t.anisotropy)
  50977. }
  50978. }
  50979. function H(e, t, i) {
  50980. void 0 === e.__webglInit && (e.__webglInit = !0,
  50981. t.addEventListener("dispose", s),
  50982. e.__webglTexture = Ge.createTexture(),
  50983. ke.textures++),
  50984. Ye.activeTexture(Ge.TEXTURE0 + i),
  50985. Ye.bindTexture(Ge.TEXTURE_2D, e.__webglTexture),
  50986. Ge.pixelStorei(Ge.UNPACK_FLIP_Y_WEBGL, t.flipY),
  50987. Ge.pixelStorei(Ge.UNPACK_PREMULTIPLY_ALPHA_WEBGL, t.premultiplyAlpha),
  50988. Ge.pixelStorei(Ge.UNPACK_ALIGNMENT, t.unpackAlignment);
  50989. var r = G(t.image, je.maxTextureSize);
  50990. W(t) && z(r) === !1 && (r = j(r));
  50991. var o = z(r)
  50992. , a = ee(t.format)
  50993. , l = ee(t.type);
  50994. k(Ge.TEXTURE_2D, t, o);
  50995. var c, h = t.mipmaps;
  50996. if (t instanceof n.DataTexture)
  50997. if (h.length > 0 && o) {
  50998. for (var u = 0, d = h.length; u < d; u++)
  50999. c = h[u],
  51000. Ye.texImage2D(Ge.TEXTURE_2D, u, a, c.width, c.height, 0, a, l, c.data);
  51001. t.generateMipmaps = !1
  51002. } else
  51003. Ye.texImage2D(Ge.TEXTURE_2D, 0, a, r.width, r.height, 0, a, l, r.data);
  51004. else if (t instanceof n.CompressedTexture)
  51005. for (var u = 0, d = h.length; u < d; u++)
  51006. c = h[u],
  51007. 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);
  51008. else if (h.length > 0 && o) {
  51009. for (var u = 0, d = h.length; u < d; u++)
  51010. c = h[u],
  51011. Ye.texImage2D(Ge.TEXTURE_2D, u, a, a, l, c);
  51012. t.generateMipmaps = !1
  51013. } else
  51014. Ye.texImage2D(Ge.TEXTURE_2D, 0, a, a, l, r);
  51015. t.generateMipmaps && o && Ge.generateMipmap(Ge.TEXTURE_2D),
  51016. e.__version = t.version,
  51017. t.onUpdate && t.onUpdate(t)
  51018. }
  51019. function G(e, t) {
  51020. if (e.width > t || e.height > t) {
  51021. var i = t / Math.max(e.width, e.height)
  51022. , n = document.createElement("canvas");
  51023. n.width = Math.floor(e.width * i),
  51024. n.height = Math.floor(e.height * i);
  51025. var r = n.getContext("2d");
  51026. return r.drawImage(e, 0, 0, e.width, e.height, 0, 0, n.width, n.height),
  51027. console.warn("THREE.WebGLRenderer: image is too big (" + e.width + "x" + e.height + "). Resized to " + n.width + "x" + n.height, e),
  51028. n
  51029. }
  51030. return e
  51031. }
  51032. function z(e) {
  51033. return n.Math.isPowerOfTwo(e.width) && n.Math.isPowerOfTwo(e.height)
  51034. }
  51035. function W(e) {
  51036. return e.wrapS !== n.ClampToEdgeWrapping || e.wrapT !== n.ClampToEdgeWrapping || e.minFilter !== n.NearestFilter && e.minFilter !== n.LinearFilter
  51037. }
  51038. function j(e) {
  51039. if (e instanceof HTMLImageElement || e instanceof HTMLCanvasElement) {
  51040. var t = document.createElement("canvas");
  51041. t.width = n.Math.nearestPowerOfTwo(e.width),
  51042. t.height = n.Math.nearestPowerOfTwo(e.height);
  51043. var i = t.getContext("2d");
  51044. return i.drawImage(e, 0, 0, t.width, t.height),
  51045. console.warn("THREE.WebGLRenderer: image is not power of two (" + e.width + "x" + e.height + "). Resized to " + t.width + "x" + t.height, e),
  51046. t
  51047. }
  51048. return e
  51049. }
  51050. function Y(e, t) {
  51051. var i = Xe.get(e);
  51052. if (6 === e.image.length)
  51053. if (e.version > 0 && i.__version !== e.version) {
  51054. i.__image__webglTextureCube || (e.addEventListener("dispose", s),
  51055. i.__image__webglTextureCube = Ge.createTexture(),
  51056. ke.textures++),
  51057. Ye.activeTexture(Ge.TEXTURE0 + t),
  51058. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, i.__image__webglTextureCube),
  51059. Ge.pixelStorei(Ge.UNPACK_FLIP_Y_WEBGL, e.flipY);
  51060. for (var r = e instanceof n.CompressedTexture, o = e.image[0]instanceof n.DataTexture, a = [], l = 0; l < 6; l++)
  51061. !ve.autoScaleCubemaps || r || o ? a[l] = o ? e.image[l].image : e.image[l] : a[l] = G(e.image[l], je.maxCubemapSize);
  51062. var c = a[0]
  51063. , h = z(c)
  51064. , u = ee(e.format)
  51065. , d = ee(e.type);
  51066. k(Ge.TEXTURE_CUBE_MAP, e, h);
  51067. for (var l = 0; l < 6; l++)
  51068. if (r)
  51069. for (var p, f = a[l].mipmaps, g = 0, m = f.length; g < m; g++)
  51070. p = f[g],
  51071. 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);
  51072. else
  51073. 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]);
  51074. e.generateMipmaps && h && Ge.generateMipmap(Ge.TEXTURE_CUBE_MAP),
  51075. i.__version = e.version,
  51076. e.onUpdate && e.onUpdate(e)
  51077. } else
  51078. Ye.activeTexture(Ge.TEXTURE0 + t),
  51079. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, i.__image__webglTextureCube)
  51080. }
  51081. function X(e, t) {
  51082. Ye.activeTexture(Ge.TEXTURE0 + t),
  51083. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, Xe.get(e).__webglTexture)
  51084. }
  51085. function Z(e, t, i, n) {
  51086. var r = ee(t.texture.format)
  51087. , o = ee(t.texture.type);
  51088. Ye.texImage2D(n, 0, r, t.width, t.height, 0, r, o, null),
  51089. Ge.bindFramebuffer(Ge.FRAMEBUFFER, e),
  51090. Ge.framebufferTexture2D(Ge.FRAMEBUFFER, i, n, Xe.get(t.texture).__webglTexture, 0),
  51091. Ge.bindFramebuffer(Ge.FRAMEBUFFER, null)
  51092. }
  51093. function q(e, t) {
  51094. Ge.bindRenderbuffer(Ge.RENDERBUFFER, e),
  51095. t.depthBuffer && !t.stencilBuffer ? (Ge.renderbufferStorage(Ge.RENDERBUFFER, Ge.DEPTH_COMPONENT16, t.width, t.height),
  51096. 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),
  51097. Ge.framebufferRenderbuffer(Ge.FRAMEBUFFER, Ge.DEPTH_STENCIL_ATTACHMENT, Ge.RENDERBUFFER, e)) : Ge.renderbufferStorage(Ge.RENDERBUFFER, Ge.RGBA4, t.width, t.height),
  51098. Ge.bindRenderbuffer(Ge.RENDERBUFFER, null)
  51099. }
  51100. function K(e) {
  51101. var t = Xe.get(e)
  51102. , i = e instanceof n.WebGLRenderTargetCube;
  51103. if (i) {
  51104. t.__webglDepthbuffer = [];
  51105. for (var r = 0; r < 6; r++)
  51106. Ge.bindFramebuffer(Ge.FRAMEBUFFER, t.__webglFramebuffer[r]),
  51107. t.__webglDepthbuffer[r] = Ge.createRenderbuffer(),
  51108. q(t.__webglDepthbuffer[r], e)
  51109. } else
  51110. Ge.bindFramebuffer(Ge.FRAMEBUFFER, t.__webglFramebuffer),
  51111. t.__webglDepthbuffer = Ge.createRenderbuffer(),
  51112. q(t.__webglDepthbuffer, e);
  51113. Ge.bindFramebuffer(Ge.FRAMEBUFFER, null)
  51114. }
  51115. function Q(e) {
  51116. var t = Xe.get(e)
  51117. , i = Xe.get(e.texture);
  51118. e.addEventListener("dispose", l),
  51119. i.__webglTexture = Ge.createTexture(),
  51120. ke.textures++;
  51121. var r = e instanceof n.WebGLRenderTargetCube
  51122. , o = n.Math.isPowerOfTwo(e.width) && n.Math.isPowerOfTwo(e.height);
  51123. if (r) {
  51124. t.__webglFramebuffer = [];
  51125. for (var a = 0; a < 6; a++)
  51126. t.__webglFramebuffer[a] = Ge.createFramebuffer()
  51127. } else
  51128. t.__webglFramebuffer = Ge.createFramebuffer();
  51129. if (r) {
  51130. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, i.__webglTexture),
  51131. k(Ge.TEXTURE_CUBE_MAP, e.texture, o);
  51132. for (var a = 0; a < 6; a++)
  51133. Z(t.__webglFramebuffer[a], e, Ge.COLOR_ATTACHMENT0, Ge.TEXTURE_CUBE_MAP_POSITIVE_X + a);
  51134. e.texture.generateMipmaps && o && Ge.generateMipmap(Ge.TEXTURE_CUBE_MAP),
  51135. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, null)
  51136. } else
  51137. Ye.bindTexture(Ge.TEXTURE_2D, i.__webglTexture),
  51138. k(Ge.TEXTURE_2D, e.texture, o),
  51139. Z(t.__webglFramebuffer, e, Ge.COLOR_ATTACHMENT0, Ge.TEXTURE_2D),
  51140. e.texture.generateMipmaps && o && Ge.generateMipmap(Ge.TEXTURE_2D),
  51141. Ye.bindTexture(Ge.TEXTURE_2D, null);
  51142. e.depthBuffer && K(e)
  51143. }
  51144. function J(e) {
  51145. var t = e instanceof n.WebGLRenderTargetCube ? Ge.TEXTURE_CUBE_MAP : Ge.TEXTURE_2D
  51146. , i = Xe.get(e.texture).__webglTexture;
  51147. Ye.bindTexture(t, i),
  51148. Ge.generateMipmap(t),
  51149. Ye.bindTexture(t, null)
  51150. }
  51151. function $(e) {
  51152. return e === n.NearestFilter || e === n.NearestMipMapNearestFilter || e === n.NearestMipMapLinearFilter ? Ge.NEAREST : Ge.LINEAR
  51153. }
  51154. function ee(e) {
  51155. var t;
  51156. if (e === n.RepeatWrapping)
  51157. return Ge.REPEAT;
  51158. if (e === n.ClampToEdgeWrapping)
  51159. return Ge.CLAMP_TO_EDGE;
  51160. if (e === n.MirroredRepeatWrapping)
  51161. return Ge.MIRRORED_REPEAT;
  51162. if (e === n.NearestFilter)
  51163. return Ge.NEAREST;
  51164. if (e === n.NearestMipMapNearestFilter)
  51165. return Ge.NEAREST_MIPMAP_NEAREST;
  51166. if (e === n.NearestMipMapLinearFilter)
  51167. return Ge.NEAREST_MIPMAP_LINEAR;
  51168. if (e === n.LinearFilter)
  51169. return Ge.LINEAR;
  51170. if (e === n.LinearMipMapNearestFilter)
  51171. return Ge.LINEAR_MIPMAP_NEAREST;
  51172. if (e === n.LinearMipMapLinearFilter)
  51173. return Ge.LINEAR_MIPMAP_LINEAR;
  51174. if (e === n.UnsignedByteType)
  51175. return Ge.UNSIGNED_BYTE;
  51176. if (e === n.UnsignedShort4444Type)
  51177. return Ge.UNSIGNED_SHORT_4_4_4_4;
  51178. if (e === n.UnsignedShort5551Type)
  51179. return Ge.UNSIGNED_SHORT_5_5_5_1;
  51180. if (e === n.UnsignedShort565Type)
  51181. return Ge.UNSIGNED_SHORT_5_6_5;
  51182. if (e === n.ByteType)
  51183. return Ge.BYTE;
  51184. if (e === n.ShortType)
  51185. return Ge.SHORT;
  51186. if (e === n.UnsignedShortType)
  51187. return Ge.UNSIGNED_SHORT;
  51188. if (e === n.IntType)
  51189. return Ge.INT;
  51190. if (e === n.UnsignedIntType)
  51191. return Ge.UNSIGNED_INT;
  51192. if (e === n.FloatType)
  51193. return Ge.FLOAT;
  51194. if (t = We.get("OES_texture_half_float"),
  51195. null !== t && e === n.HalfFloatType)
  51196. return t.HALF_FLOAT_OES;
  51197. if (e === n.AlphaFormat)
  51198. return Ge.ALPHA;
  51199. if (e === n.RGBFormat)
  51200. return Ge.RGB;
  51201. if (e === n.RGBAFormat)
  51202. return Ge.RGBA;
  51203. if (e === n.LuminanceFormat)
  51204. return Ge.LUMINANCE;
  51205. if (e === n.LuminanceAlphaFormat)
  51206. return Ge.LUMINANCE_ALPHA;
  51207. if (e === n.AddEquation)
  51208. return Ge.FUNC_ADD;
  51209. if (e === n.SubtractEquation)
  51210. return Ge.FUNC_SUBTRACT;
  51211. if (e === n.ReverseSubtractEquation)
  51212. return Ge.FUNC_REVERSE_SUBTRACT;
  51213. if (e === n.ZeroFactor)
  51214. return Ge.ZERO;
  51215. if (e === n.OneFactor)
  51216. return Ge.ONE;
  51217. if (e === n.SrcColorFactor)
  51218. return Ge.SRC_COLOR;
  51219. if (e === n.OneMinusSrcColorFactor)
  51220. return Ge.ONE_MINUS_SRC_COLOR;
  51221. if (e === n.SrcAlphaFactor)
  51222. return Ge.SRC_ALPHA;
  51223. if (e === n.OneMinusSrcAlphaFactor)
  51224. return Ge.ONE_MINUS_SRC_ALPHA;
  51225. if (e === n.DstAlphaFactor)
  51226. return Ge.DST_ALPHA;
  51227. if (e === n.OneMinusDstAlphaFactor)
  51228. return Ge.ONE_MINUS_DST_ALPHA;
  51229. if (e === n.DstColorFactor)
  51230. return Ge.DST_COLOR;
  51231. if (e === n.OneMinusDstColorFactor)
  51232. return Ge.ONE_MINUS_DST_COLOR;
  51233. if (e === n.SrcAlphaSaturateFactor)
  51234. return Ge.SRC_ALPHA_SATURATE;
  51235. if (t = We.get("WEBGL_compressed_texture_s3tc"),
  51236. null !== t) {
  51237. if (e === n.RGB_S3TC_DXT1_Format)
  51238. return t.COMPRESSED_RGB_S3TC_DXT1_EXT;
  51239. if (e === n.RGBA_S3TC_DXT1_Format)
  51240. return t.COMPRESSED_RGBA_S3TC_DXT1_EXT;
  51241. if (e === n.RGBA_S3TC_DXT3_Format)
  51242. return t.COMPRESSED_RGBA_S3TC_DXT3_EXT;
  51243. if (e === n.RGBA_S3TC_DXT5_Format)
  51244. return t.COMPRESSED_RGBA_S3TC_DXT5_EXT
  51245. }
  51246. if (t = We.get("WEBGL_compressed_texture_pvrtc"),
  51247. null !== t) {
  51248. if (e === n.RGB_PVRTC_4BPPV1_Format)
  51249. return t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;
  51250. if (e === n.RGB_PVRTC_2BPPV1_Format)
  51251. return t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;
  51252. if (e === n.RGBA_PVRTC_4BPPV1_Format)
  51253. return t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;
  51254. if (e === n.RGBA_PVRTC_2BPPV1_Format)
  51255. return t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG
  51256. }
  51257. if (t = We.get("WEBGL_compressed_texture_etc1"),
  51258. null !== t && e === n.RGB_ETC1_Format)
  51259. return t.COMPRESSED_RGB_ETC1_WEBGL;
  51260. if (t = We.get("EXT_blend_minmax"),
  51261. null !== t) {
  51262. if (e === n.MinEquation)
  51263. return t.MIN_EXT;
  51264. if (e === n.MaxEquation)
  51265. return t.MAX_EXT
  51266. }
  51267. return 0
  51268. }
  51269. console.log("THREE.WebGLRenderer", n.REVISION),
  51270. e = e || {};
  51271. var te = void 0 !== e.canvas ? e.canvas : document.createElement("canvas")
  51272. , ie = void 0 !== e.context ? e.context : null
  51273. , ne = void 0 !== e.alpha && e.alpha
  51274. , re = void 0 === e.depth || e.depth
  51275. , oe = void 0 === e.stencil || e.stencil
  51276. , ae = void 0 !== e.antialias && e.antialias
  51277. , se = void 0 === e.premultipliedAlpha || e.premultipliedAlpha
  51278. , le = void 0 !== e.preserveDrawingBuffer && e.preserveDrawingBuffer
  51279. , ce = []
  51280. , he = []
  51281. , ue = -1
  51282. , de = []
  51283. , pe = -1
  51284. , fe = new Float32Array(8)
  51285. , ge = []
  51286. , me = [];
  51287. this.domElement = te,
  51288. this.context = null,
  51289. this.autoClear = !0,
  51290. this.autoClearColor = !0,
  51291. this.autoClearDepth = !0,
  51292. this.autoClearStencil = !0,
  51293. this.sortObjects = !0,
  51294. this.gammaFactor = 2,
  51295. this.gammaInput = !1,
  51296. this.gammaOutput = !1,
  51297. this.physicallyCorrectLights = !1,
  51298. this.toneMapping = n.LinearToneMapping,
  51299. this.toneMappingExposure = 1,
  51300. this.toneMappingWhitePoint = 1,
  51301. this.maxMorphTargets = 8,
  51302. this.maxMorphNormals = 4,
  51303. this.autoScaleCubemaps = !0;
  51304. var ve = this
  51305. , Ae = null
  51306. , ye = null
  51307. , Ce = null
  51308. , Ie = -1
  51309. , Ee = ""
  51310. , be = null
  51311. , we = new n.Vector4
  51312. , _e = null
  51313. , Te = new n.Vector4
  51314. , xe = 0
  51315. , Se = new n.Color(0)
  51316. , Me = 0
  51317. , Re = te.width
  51318. , Pe = te.height
  51319. , Oe = 1
  51320. , Le = new n.Vector4(0,0,Re,Pe)
  51321. , De = !1
  51322. , Ne = new n.Vector4(0,0,Re,Pe)
  51323. , Be = new n.Frustum
  51324. , Fe = new n.Matrix4
  51325. , Ve = new n.Vector3
  51326. , Ue = {
  51327. hash: "",
  51328. ambient: [0, 0, 0],
  51329. directional: [],
  51330. directionalShadowMap: [],
  51331. directionalShadowMatrix: [],
  51332. spot: [],
  51333. spotShadowMap: [],
  51334. spotShadowMatrix: [],
  51335. point: [],
  51336. pointShadowMap: [],
  51337. pointShadowMatrix: [],
  51338. hemi: [],
  51339. shadows: [],
  51340. shadowsPointLight: 0
  51341. }
  51342. , ke = {
  51343. geometries: 0,
  51344. textures: 0
  51345. }
  51346. , He = {
  51347. calls: 0,
  51348. vertices: 0,
  51349. faces: 0,
  51350. points: 0
  51351. };
  51352. this.info = {
  51353. render: He,
  51354. memory: ke,
  51355. programs: null
  51356. };
  51357. var Ge;
  51358. try {
  51359. var ze = {
  51360. alpha: ne,
  51361. depth: re,
  51362. stencil: oe,
  51363. antialias: ae,
  51364. premultipliedAlpha: se,
  51365. preserveDrawingBuffer: le
  51366. };
  51367. if (Ge = ie || te.getContext("webgl", ze) || te.getContext("experimental-webgl", ze),
  51368. null === Ge)
  51369. throw null !== te.getContext("webgl") ? "Error creating WebGL context with your selected attributes." : "Error creating WebGL context.";
  51370. void 0 === Ge.getShaderPrecisionFormat && (Ge.getShaderPrecisionFormat = function() {
  51371. return {
  51372. rangeMin: 1,
  51373. rangeMax: 1,
  51374. precision: 1
  51375. }
  51376. }
  51377. ),
  51378. te.addEventListener("webglcontextlost", a, !1)
  51379. } catch (e) {
  51380. console.error("THREE.WebGLRenderer: " + e)
  51381. }
  51382. var We = new n.WebGLExtensions(Ge);
  51383. We.get("OES_texture_float"),
  51384. We.get("OES_texture_float_linear"),
  51385. We.get("OES_texture_half_float"),
  51386. We.get("OES_texture_half_float_linear"),
  51387. We.get("OES_standard_derivatives"),
  51388. We.get("ANGLE_instanced_arrays"),
  51389. We.get("OES_element_index_uint") && (n.BufferGeometry.MaxIndex = 4294967296);
  51390. var je = new n.WebGLCapabilities(Ge,We,e)
  51391. , Ye = new n.WebGLState(Ge,We,ee)
  51392. , Xe = new n.WebGLProperties
  51393. , Ze = new n.WebGLObjects(Ge,Xe,this.info)
  51394. , qe = new n.WebGLPrograms(this,je)
  51395. , Ke = new n.WebGLLights;
  51396. this.info.programs = qe.programs;
  51397. var Qe = new n.WebGLBufferRenderer(Ge,We,He)
  51398. , Je = new n.WebGLIndexedBufferRenderer(Ge,We,He);
  51399. r(),
  51400. this.context = Ge,
  51401. this.capabilities = je,
  51402. this.extensions = We,
  51403. this.properties = Xe,
  51404. this.state = Ye;
  51405. var $e = new n.WebGLShadowMap(this,Ue,Ze);
  51406. this.shadowMap = $e;
  51407. var et = new n.SpritePlugin(this,ge)
  51408. , tt = new n.LensFlarePlugin(this,me);
  51409. this.getContext = function() {
  51410. return Ge
  51411. }
  51412. ,
  51413. this.getContextAttributes = function() {
  51414. return Ge.getContextAttributes()
  51415. }
  51416. ,
  51417. this.forceContextLoss = function() {
  51418. We.get("WEBGL_lose_context").loseContext()
  51419. }
  51420. ,
  51421. this.getMaxAnisotropy = function() {
  51422. var e;
  51423. return function() {
  51424. if (void 0 !== e)
  51425. return e;
  51426. var t = We.get("EXT_texture_filter_anisotropic");
  51427. return e = null !== t ? Ge.getParameter(t.MAX_TEXTURE_MAX_ANISOTROPY_EXT) : 0
  51428. }
  51429. }(),
  51430. this.getPrecision = function() {
  51431. return je.precision
  51432. }
  51433. ,
  51434. this.getPixelRatio = function() {
  51435. return Oe
  51436. }
  51437. ,
  51438. this.setPixelRatio = function(e) {
  51439. void 0 !== e && (Oe = e,
  51440. this.setSize(Ne.z, Ne.w, !1))
  51441. }
  51442. ,
  51443. this.getSize = function() {
  51444. return {
  51445. width: Re,
  51446. height: Pe
  51447. }
  51448. }
  51449. ,
  51450. this.setSize = function(e, t, i, devicePixelRatio) {
  51451. if(devicePixelRatio != void 0) Oe = devicePixelRatio; //xzw add 改分辨率 始终保持清晰
  51452. Re = e,
  51453. Pe = t,
  51454. te.width = e * Oe,
  51455. te.height = t * Oe,
  51456. i !== !1 && (te.style.width = e + "px",
  51457. te.style.height = t + "px"),
  51458. this.setViewport(0, 0, e, t)
  51459. }
  51460. ,
  51461. this.setViewport = function(e, t, i, n) {
  51462. Ye.viewport(Ne.set(e, t, i, n))
  51463. }
  51464. ,
  51465. this.setScissor = function(e, t, i, n) {
  51466. Ye.scissor(Le.set(e, t, i, n))
  51467. }
  51468. ,
  51469. this.setScissorTest = function(e) {
  51470. Ye.setScissorTest(De = e)
  51471. }
  51472. ,
  51473. this.getClearColor = function() {
  51474. return Se
  51475. }
  51476. ,
  51477. this.setClearColor = function(e, t) {
  51478. Se.set(e),
  51479. Me = void 0 !== t ? t : 1,
  51480. i(Se.r, Se.g, Se.b, Me)
  51481. }
  51482. ,
  51483. this.getClearAlpha = function() {
  51484. return Me
  51485. }
  51486. ,
  51487. this.setClearAlpha = function(e) {
  51488. Me = e,
  51489. i(Se.r, Se.g, Se.b, Me)
  51490. }
  51491. ,
  51492. this.clear = function(e, t, i) {
  51493. var n = 0;
  51494. (void 0 === e || e) && (n |= Ge.COLOR_BUFFER_BIT),
  51495. (void 0 === t || t) && (n |= Ge.DEPTH_BUFFER_BIT),
  51496. (void 0 === i || i) && (n |= Ge.STENCIL_BUFFER_BIT),
  51497. Ge.clear(n)
  51498. }
  51499. ,
  51500. this.clearColor = function() {
  51501. this.clear(!0, !1, !1)
  51502. }
  51503. ,
  51504. this.clearDepth = function() {
  51505. this.clear(!1, !0, !1)
  51506. }
  51507. ,
  51508. this.clearStencil = function() {
  51509. this.clear(!1, !1, !0)
  51510. }
  51511. ,
  51512. this.clearTarget = function(e, t, i, n) {
  51513. this.setRenderTarget(e),
  51514. this.clear(t, i, n)
  51515. }
  51516. ,
  51517. this.resetGLState = o,
  51518. this.dispose = function() {
  51519. te.removeEventListener("webglcontextlost", a, !1)
  51520. }
  51521. ,
  51522. this.renderBufferImmediate = function(e, t, i) {
  51523. Ye.initAttributes();
  51524. var r = Xe.get(e);
  51525. e.hasPositions && !r.position && (r.position = Ge.createBuffer()),
  51526. e.hasNormals && !r.normal && (r.normal = Ge.createBuffer()),
  51527. e.hasUvs && !r.uv && (r.uv = Ge.createBuffer()),
  51528. e.hasColors && !r.color && (r.color = Ge.createBuffer());
  51529. var o = t.getAttributes();
  51530. if (e.hasPositions && (Ge.bindBuffer(Ge.ARRAY_BUFFER, r.position),
  51531. Ge.bufferData(Ge.ARRAY_BUFFER, e.positionArray, Ge.DYNAMIC_DRAW),
  51532. Ye.enableAttribute(o.position),
  51533. Ge.vertexAttribPointer(o.position, 3, Ge.FLOAT, !1, 0, 0)),
  51534. e.hasNormals) {
  51535. if (Ge.bindBuffer(Ge.ARRAY_BUFFER, r.normal),
  51536. "MeshPhongMaterial" !== i.type && "MeshStandardMaterial" !== i.type && i.shading === n.FlatShading)
  51537. for (var a = 0, s = 3 * e.count; a < s; a += 9) {
  51538. var l = e.normalArray
  51539. , c = (l[a + 0] + l[a + 3] + l[a + 6]) / 3
  51540. , h = (l[a + 1] + l[a + 4] + l[a + 7]) / 3
  51541. , u = (l[a + 2] + l[a + 5] + l[a + 8]) / 3;
  51542. l[a + 0] = c,
  51543. l[a + 1] = h,
  51544. l[a + 2] = u,
  51545. l[a + 3] = c,
  51546. l[a + 4] = h,
  51547. l[a + 5] = u,
  51548. l[a + 6] = c,
  51549. l[a + 7] = h,
  51550. l[a + 8] = u
  51551. }
  51552. Ge.bufferData(Ge.ARRAY_BUFFER, e.normalArray, Ge.DYNAMIC_DRAW),
  51553. Ye.enableAttribute(o.normal),
  51554. Ge.vertexAttribPointer(o.normal, 3, Ge.FLOAT, !1, 0, 0)
  51555. }
  51556. e.hasUvs && i.map && (Ge.bindBuffer(Ge.ARRAY_BUFFER, r.uv),
  51557. Ge.bufferData(Ge.ARRAY_BUFFER, e.uvArray, Ge.DYNAMIC_DRAW),
  51558. Ye.enableAttribute(o.uv),
  51559. Ge.vertexAttribPointer(o.uv, 2, Ge.FLOAT, !1, 0, 0)),
  51560. e.hasColors && i.vertexColors !== n.NoColors && (Ge.bindBuffer(Ge.ARRAY_BUFFER, r.color),
  51561. Ge.bufferData(Ge.ARRAY_BUFFER, e.colorArray, Ge.DYNAMIC_DRAW),
  51562. Ye.enableAttribute(o.color),
  51563. Ge.vertexAttribPointer(o.color, 3, Ge.FLOAT, !1, 0, 0)),
  51564. Ye.disableUnusedAttributes(),
  51565. Ge.drawArrays(Ge.TRIANGLES, 0, e.count),
  51566. e.count = 0
  51567. }
  51568. ,
  51569. this.renderBufferDirect = function(e, i, r, o, a, s) {
  51570. E(o);
  51571. var l = w(e, i, o, a)
  51572. , c = !1
  51573. , h = r.id + "_" + l.id + "_" + o.wireframe;
  51574. h !== Ee && (Ee = h,
  51575. c = !0);
  51576. var u = a.morphTargetInfluences;
  51577. if (void 0 !== u) {
  51578. for (var d = [], p = 0, m = u.length; p < m; p++) {
  51579. var v = u[p];
  51580. d.push([v, p])
  51581. }
  51582. d.sort(g),
  51583. d.length > 8 && (d.length = 8);
  51584. for (var A = r.morphAttributes, p = 0, m = d.length; p < m; p++) {
  51585. var v = d[p];
  51586. if (fe[p] = v[0],
  51587. 0 !== v[0]) {
  51588. var y = v[1];
  51589. o.morphTargets === !0 && A.position && r.addAttribute("morphTarget" + p, A.position[y]),
  51590. o.morphNormals === !0 && A.normal && r.addAttribute("morphNormal" + p, A.normal[y])
  51591. } else
  51592. o.morphTargets === !0 && r.removeAttribute("morphTarget" + p),
  51593. o.morphNormals === !0 && r.removeAttribute("morphNormal" + p)
  51594. }
  51595. var C = l.getUniforms();
  51596. null !== C.morphTargetInfluences && Ge.uniform1fv(C.morphTargetInfluences, fe),
  51597. c = !0
  51598. }
  51599. var y = r.index
  51600. , I = r.attributes.position;
  51601. o.wireframe === !0 && (y = Ze.getWireframeAttribute(r));
  51602. var b;
  51603. null !== y ? (b = Je,
  51604. b.setIndex(y)) : b = Qe,
  51605. c && (f(o, l, r),
  51606. null !== y && Ge.bindBuffer(Ge.ELEMENT_ARRAY_BUFFER, Ze.getAttributeBuffer(y)));
  51607. var _ = 0
  51608. , T = 1 / 0;
  51609. null !== y ? T = y.count : void 0 !== I && (T = I.count);
  51610. var x = r.drawRange.start
  51611. , S = r.drawRange.count
  51612. , M = null !== s ? s.start : 0
  51613. , R = null !== s ? s.count : 1 / 0
  51614. , P = Math.max(_, x, M)
  51615. , O = Math.min(_ + T, x + S, M + R) - 1
  51616. , L = Math.max(0, O - P + 1);
  51617. if (a instanceof n.Mesh)
  51618. if (o.wireframe === !0)
  51619. Ye.setLineWidth(o.wireframeLinewidth * t()),
  51620. b.setMode(Ge.LINES);
  51621. else
  51622. switch (a.drawMode) {
  51623. case n.TrianglesDrawMode:
  51624. b.setMode(Ge.TRIANGLES);
  51625. break;
  51626. case n.TriangleStripDrawMode:
  51627. b.setMode(Ge.TRIANGLE_STRIP);
  51628. break;
  51629. case n.TriangleFanDrawMode:
  51630. b.setMode(Ge.TRIANGLE_FAN)
  51631. }
  51632. else if (a instanceof n.Line) {
  51633. var D = o.linewidth;
  51634. void 0 === D && (D = 1),
  51635. Ye.setLineWidth(D * t()),
  51636. a instanceof n.LineSegments ? b.setMode(Ge.LINES) : b.setMode(Ge.LINE_STRIP)
  51637. } else
  51638. a instanceof n.Points && b.setMode(Ge.POINTS);
  51639. r instanceof n.InstancedBufferGeometry ? r.maxInstancedCount > 0 && b.renderInstances(r, P, L) : b.render(P, L)
  51640. }
  51641. ,
  51642. this.render = function(e, t, i, r) {
  51643. if (t instanceof n.Camera == !1)
  51644. return void console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");
  51645. var o = e.fog;
  51646. if (Ee = "",
  51647. Ie = -1,
  51648. be = null,
  51649. e.autoUpdate === !0 && e.updateMatrixWorld(),
  51650. null === t.parent && t.updateMatrixWorld(),
  51651. t.matrixWorldInverse.getInverse(t.matrixWorld),
  51652. Fe.multiplyMatrices(t.projectionMatrix, t.matrixWorldInverse),
  51653. Be.setFromMatrix(Fe),
  51654. ce.length = 0,
  51655. ue = -1,
  51656. pe = -1,
  51657. ge.length = 0,
  51658. me.length = 0,
  51659. y(e, t),
  51660. he.length = ue + 1,
  51661. de.length = pe + 1,
  51662. ve.sortObjects === !0 && (he.sort(m),
  51663. de.sort(v)),
  51664. U(ce, t),
  51665. $e.render(e, t),
  51666. He.calls = 0,
  51667. He.vertices = 0,
  51668. He.faces = 0,
  51669. He.points = 0,
  51670. void 0 === i && (i = null),
  51671. this.setRenderTarget(i),
  51672. (this.autoClear || r) && this.clear(this.autoClearColor, this.autoClearDepth, this.autoClearStencil),
  51673. e.overrideMaterial) {
  51674. var a = e.overrideMaterial;
  51675. C(he, t, o, a),
  51676. C(de, t, o, a)
  51677. } else
  51678. Ye.setBlending(n.NoBlending),
  51679. C(he, t, o),
  51680. C(de, t, o);
  51681. if (et.render(e, t),
  51682. tt.render(e, t, Te),
  51683. i) {
  51684. var s = i.texture;
  51685. s.generateMipmaps && z(i) && s.minFilter !== n.NearestFilter && s.minFilter !== n.LinearFilter && J(i)
  51686. }
  51687. Ye.setDepthTest(!0),
  51688. Ye.setDepthWrite(!0),
  51689. Ye.setColorWrite(!0)
  51690. }
  51691. ,
  51692. this.setFaceCulling = function(e, t) {
  51693. e === n.CullFaceNone ? Ye.disable(Ge.CULL_FACE) : (t === n.FrontFaceDirectionCW ? Ge.frontFace(Ge.CW) : Ge.frontFace(Ge.CCW),
  51694. e === n.CullFaceBack ? Ge.cullFace(Ge.BACK) : e === n.CullFaceFront ? Ge.cullFace(Ge.FRONT) : Ge.cullFace(Ge.FRONT_AND_BACK),
  51695. Ye.enable(Ge.CULL_FACE))
  51696. }
  51697. ,
  51698. this.setTexture = function(e, t) {
  51699. var i = Xe.get(e);
  51700. if (e.version > 0 && i.__version !== e.version) {
  51701. var n = e.image;
  51702. 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)
  51703. }
  51704. Ye.activeTexture(Ge.TEXTURE0 + t),
  51705. Ye.bindTexture(Ge.TEXTURE_2D, i.__webglTexture)
  51706. }
  51707. ,
  51708. this.getCurrentRenderTarget = function() {
  51709. return ye
  51710. }
  51711. ,
  51712. this.setRenderTarget = function(e) {
  51713. ye = e,
  51714. e && void 0 === Xe.get(e).__webglFramebuffer && Q(e);
  51715. var t, i = e instanceof n.WebGLRenderTargetCube;
  51716. if (e) {
  51717. var r = Xe.get(e);
  51718. t = i ? r.__webglFramebuffer[e.activeCubeFace] : r.__webglFramebuffer,
  51719. we.copy(e.scissor),
  51720. _e = e.scissorTest,
  51721. Te.copy(e.viewport)
  51722. } else
  51723. t = null,
  51724. we.copy(Le).multiplyScalar(Oe),
  51725. _e = De,
  51726. Te.copy(Ne).multiplyScalar(Oe);
  51727. if (Ce !== t && (Ge.bindFramebuffer(Ge.FRAMEBUFFER, t),
  51728. Ce = t),
  51729. Ye.scissor(we),
  51730. Ye.setScissorTest(_e),
  51731. Ye.viewport(Te),
  51732. i) {
  51733. var o = Xe.get(e.texture);
  51734. Ge.framebufferTexture2D(Ge.FRAMEBUFFER, Ge.COLOR_ATTACHMENT0, Ge.TEXTURE_CUBE_MAP_POSITIVE_X + e.activeCubeFace, o.__webglTexture, e.activeMipMapLevel)
  51735. }
  51736. }
  51737. ,
  51738. this.readRenderTargetPixels = function(e, t, i, r, o, a) {
  51739. if (e instanceof n.WebGLRenderTarget == !1)
  51740. return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");
  51741. var s = Xe.get(e).__webglFramebuffer;
  51742. if (s) {
  51743. var l = !1;
  51744. s !== Ce && (Ge.bindFramebuffer(Ge.FRAMEBUFFER, s),
  51745. l = !0);
  51746. try {
  51747. var c = e.texture;
  51748. if (c.format !== n.RGBAFormat && ee(c.format) !== Ge.getParameter(Ge.IMPLEMENTATION_COLOR_READ_FORMAT))
  51749. return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");
  51750. 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")))
  51751. return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");
  51752. 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.")
  51753. } finally {
  51754. l && Ge.bindFramebuffer(Ge.FRAMEBUFFER, Ce)
  51755. }
  51756. }
  51757. }
  51758. }
  51759. ,
  51760. n.WebGLRenderTarget = function(e, t, i) {
  51761. this.uuid = n.Math.generateUUID(),
  51762. this.width = e,
  51763. this.height = t,
  51764. this.scissor = new n.Vector4(0,0,e,t),
  51765. this.scissorTest = !1,
  51766. this.viewport = new n.Vector4(0,0,e,t),
  51767. i = i || {},
  51768. void 0 === i.minFilter && (i.minFilter = n.LinearFilter),
  51769. this.texture = new n.Texture(void 0,void 0,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy),
  51770. this.depthBuffer = void 0 === i.depthBuffer || i.depthBuffer,
  51771. this.stencilBuffer = void 0 === i.stencilBuffer || i.stencilBuffer
  51772. }
  51773. ,
  51774. n.WebGLRenderTarget.prototype = {
  51775. constructor: n.WebGLRenderTarget,
  51776. setSize: function(e, t) {
  51777. this.width === e && this.height === t || (this.width = e,
  51778. this.height = t,
  51779. this.dispose()),
  51780. this.viewport.set(0, 0, e, t),
  51781. this.scissor.set(0, 0, e, t)
  51782. },
  51783. clone: function() {
  51784. return (new this.constructor).copy(this)
  51785. },
  51786. copy: function(e) {
  51787. return this.width = e.width,
  51788. this.height = e.height,
  51789. this.viewport.copy(e.viewport),
  51790. this.texture = e.texture.clone(),
  51791. this.depthBuffer = e.depthBuffer,
  51792. this.stencilBuffer = e.stencilBuffer,
  51793. this
  51794. },
  51795. dispose: function() {
  51796. this.dispatchEvent({
  51797. type: "dispose"
  51798. })
  51799. }
  51800. },
  51801. n.EventDispatcher.prototype.apply(n.WebGLRenderTarget.prototype),
  51802. n.WebGLRenderTargetCube = function(e, t, i) {
  51803. n.WebGLRenderTarget.call(this, e, t, i),
  51804. this.activeCubeFace = 0,
  51805. this.activeMipMapLevel = 0
  51806. }
  51807. ,
  51808. n.WebGLRenderTargetCube.prototype = Object.create(n.WebGLRenderTarget.prototype),
  51809. n.WebGLRenderTargetCube.prototype.constructor = n.WebGLRenderTargetCube,
  51810. n.WebGLBufferRenderer = function(e, t, i) {
  51811. function r(e) {
  51812. s = e
  51813. }
  51814. function o(t, n) {
  51815. e.drawArrays(s, t, n),
  51816. i.calls++,
  51817. i.vertices += n,
  51818. s === e.TRIANGLES && (i.faces += n / 3)
  51819. }
  51820. function a(r) {
  51821. var o = t.get("ANGLE_instanced_arrays");
  51822. if (null === o)
  51823. return void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");
  51824. var a = r.attributes.position
  51825. , l = 0;
  51826. a instanceof n.InterleavedBufferAttribute ? (l = a.data.count,
  51827. o.drawArraysInstancedANGLE(s, 0, l, r.maxInstancedCount)) : (l = a.count,
  51828. o.drawArraysInstancedANGLE(s, 0, l, r.maxInstancedCount)),
  51829. i.calls++,
  51830. i.vertices += l * r.maxInstancedCount,
  51831. s === e.TRIANGLES && (i.faces += r.maxInstancedCount * l / 3)
  51832. }
  51833. var s;
  51834. this.setMode = r,
  51835. this.render = o,
  51836. this.renderInstances = a
  51837. }
  51838. ,
  51839. n.WebGLIndexedBufferRenderer = function(e, t, i) {
  51840. function n(e) {
  51841. s = e
  51842. }
  51843. function r(i) {
  51844. i.array instanceof Uint32Array && t.get("OES_element_index_uint") ? (l = e.UNSIGNED_INT,
  51845. c = 4) : (l = e.UNSIGNED_SHORT,
  51846. c = 2)
  51847. }
  51848. function o(t, n) {
  51849. e.drawElements(s, n, l, t * c),
  51850. i.calls++,
  51851. i.vertices += n,
  51852. s === e.TRIANGLES && (i.faces += n / 3)
  51853. }
  51854. function a(n, r, o) {
  51855. var a = t.get("ANGLE_instanced_arrays");
  51856. 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),
  51857. i.calls++,
  51858. i.vertices += o * n.maxInstancedCount,
  51859. void (s === e.TRIANGLES && (i.faces += n.maxInstancedCount * o / 3)))
  51860. }
  51861. var s, l, c;
  51862. this.setMode = n,
  51863. this.setIndex = r,
  51864. this.render = o,
  51865. this.renderInstances = a
  51866. }
  51867. ,
  51868. n.WebGLExtensions = function(e) {
  51869. var t = {};
  51870. this.get = function(i) {
  51871. if (void 0 !== t[i])
  51872. return t[i];
  51873. var n;
  51874. switch (i) {
  51875. case "EXT_texture_filter_anisotropic":
  51876. n = e.getExtension("EXT_texture_filter_anisotropic") || e.getExtension("MOZ_EXT_texture_filter_anisotropic") || e.getExtension("WEBKIT_EXT_texture_filter_anisotropic");
  51877. break;
  51878. case "WEBGL_compressed_texture_s3tc":
  51879. n = e.getExtension("WEBGL_compressed_texture_s3tc") || e.getExtension("MOZ_WEBGL_compressed_texture_s3tc") || e.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");
  51880. break;
  51881. case "WEBGL_compressed_texture_pvrtc":
  51882. n = e.getExtension("WEBGL_compressed_texture_pvrtc") || e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");
  51883. break;
  51884. case "WEBGL_compressed_texture_etc1":
  51885. n = e.getExtension("WEBGL_compressed_texture_etc1");
  51886. break;
  51887. default:
  51888. n = e.getExtension(i)
  51889. }
  51890. return null === n && console.warn("THREE.WebGLRenderer: " + i + " extension not supported."),
  51891. t[i] = n,
  51892. n
  51893. }
  51894. }
  51895. ,
  51896. n.WebGLCapabilities = function(e, t, i) {
  51897. function n(t) {
  51898. if ("highp" === t) {
  51899. if (e.getShaderPrecisionFormat(e.VERTEX_SHADER, e.HIGH_FLOAT).precision > 0 && e.getShaderPrecisionFormat(e.FRAGMENT_SHADER, e.HIGH_FLOAT).precision > 0)
  51900. return "highp";
  51901. t = "mediump"
  51902. }
  51903. 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"
  51904. }
  51905. this.getMaxPrecision = n,
  51906. this.precision = void 0 !== i.precision ? i.precision : "highp",
  51907. this.logarithmicDepthBuffer = void 0 !== i.logarithmicDepthBuffer && i.logarithmicDepthBuffer,
  51908. this.maxTextures = e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),
  51909. this.maxVertexTextures = e.getParameter(e.MAX_VERTEX_TEXTURE_IMAGE_UNITS),
  51910. this.maxTextureSize = e.getParameter(e.MAX_TEXTURE_SIZE),
  51911. this.maxCubemapSize = e.getParameter(e.MAX_CUBE_MAP_TEXTURE_SIZE),
  51912. this.maxAttributes = e.getParameter(e.MAX_VERTEX_ATTRIBS),
  51913. this.maxVertexUniforms = e.getParameter(e.MAX_VERTEX_UNIFORM_VECTORS),
  51914. this.maxVaryings = e.getParameter(e.MAX_VARYING_VECTORS),
  51915. this.maxFragmentUniforms = e.getParameter(e.MAX_FRAGMENT_UNIFORM_VECTORS),
  51916. this.vertexTextures = this.maxVertexTextures > 0,
  51917. this.floatFragmentTextures = !!t.get("OES_texture_float"),
  51918. this.floatVertexTextures = this.vertexTextures && this.floatFragmentTextures;
  51919. var r = n(this.precision);
  51920. r !== this.precision && (console.warn("THREE.WebGLRenderer:", this.precision, "not supported, using", r, "instead."),
  51921. this.precision = r),
  51922. this.logarithmicDepthBuffer && (this.logarithmicDepthBuffer = !!t.get("EXT_frag_depth"))
  51923. }
  51924. ,
  51925. n.WebGLGeometries = function(e, t, i) {
  51926. function r(e) {
  51927. var t = e.geometry;
  51928. if (void 0 !== h[t.id])
  51929. return h[t.id];
  51930. t.addEventListener("dispose", o);
  51931. var r;
  51932. return t instanceof n.BufferGeometry ? r = t : t instanceof n.Geometry && (void 0 === t._bufferGeometry && (t._bufferGeometry = (new n.BufferGeometry).setFromObject(e)),
  51933. r = t._bufferGeometry),
  51934. h[t.id] = r,
  51935. i.memory.geometries++,
  51936. r
  51937. }
  51938. function o(e) {
  51939. var n = e.target
  51940. , r = h[n.id];
  51941. null !== r.index && s(r.index),
  51942. l(r.attributes),
  51943. n.removeEventListener("dispose", o),
  51944. delete h[n.id];
  51945. var a = t.get(n);
  51946. a.wireframe && s(a.wireframe),
  51947. t.delete(n);
  51948. var c = t.get(r);
  51949. c.wireframe && s(c.wireframe),
  51950. t.delete(r),
  51951. i.memory.geometries--
  51952. }
  51953. function a(e) {
  51954. return e instanceof n.InterleavedBufferAttribute ? t.get(e.data).__webglBuffer : t.get(e).__webglBuffer
  51955. }
  51956. function s(t) {
  51957. var i = a(t);
  51958. void 0 !== i && (e.deleteBuffer(i),
  51959. c(t))
  51960. }
  51961. function l(e) {
  51962. for (var t in e)
  51963. s(e[t])
  51964. }
  51965. function c(e) {
  51966. e instanceof n.InterleavedBufferAttribute ? t.delete(e.data) : t.delete(e)
  51967. }
  51968. var h = {};
  51969. this.get = r
  51970. }
  51971. ,
  51972. n.WebGLLights = function() {
  51973. var e = {};
  51974. this.get = function(t) {
  51975. if (void 0 !== e[t.id])
  51976. return e[t.id];
  51977. var i;
  51978. switch (t.type) {
  51979. case "DirectionalLight":
  51980. i = {
  51981. direction: new n.Vector3,
  51982. color: new n.Color,
  51983. shadow: !1,
  51984. shadowBias: 0,
  51985. shadowRadius: 1,
  51986. shadowMapSize: new n.Vector2
  51987. };
  51988. break;
  51989. case "SpotLight":
  51990. i = {
  51991. position: new n.Vector3,
  51992. direction: new n.Vector3,
  51993. color: new n.Color,
  51994. distance: 0,
  51995. coneCos: 0,
  51996. penumbraCos: 0,
  51997. decay: 0,
  51998. shadow: !1,
  51999. shadowBias: 0,
  52000. shadowRadius: 1,
  52001. shadowMapSize: new n.Vector2
  52002. };
  52003. break;
  52004. case "PointLight":
  52005. i = {
  52006. position: new n.Vector3,
  52007. color: new n.Color,
  52008. distance: 0,
  52009. decay: 0,
  52010. shadow: !1,
  52011. shadowBias: 0,
  52012. shadowRadius: 1,
  52013. shadowMapSize: new n.Vector2
  52014. };
  52015. break;
  52016. case "HemisphereLight":
  52017. i = {
  52018. direction: new n.Vector3,
  52019. skyColor: new n.Color,
  52020. groundColor: new n.Color
  52021. }
  52022. }
  52023. return e[t.id] = i,
  52024. i
  52025. }
  52026. }
  52027. ,
  52028. n.WebGLObjects = function(e, t, i) {
  52029. function r(t) {
  52030. var i = u.get(t);
  52031. t.geometry instanceof n.Geometry && i.updateFromObject(t);
  52032. var r = i.index
  52033. , a = i.attributes;
  52034. null !== r && o(r, e.ELEMENT_ARRAY_BUFFER);
  52035. for (var s in a)
  52036. o(a[s], e.ARRAY_BUFFER);
  52037. var l = i.morphAttributes;
  52038. for (var s in l)
  52039. for (var c = l[s], h = 0, d = c.length; h < d; h++)
  52040. o(c[h], e.ARRAY_BUFFER);
  52041. return i
  52042. }
  52043. function o(e, i) {
  52044. var r = e instanceof n.InterleavedBufferAttribute ? e.data : e
  52045. , o = t.get(r);
  52046. void 0 === o.__webglBuffer ? a(o, r, i) : o.version !== r.version && s(o, r, i)
  52047. }
  52048. function a(t, i, n) {
  52049. t.__webglBuffer = e.createBuffer(),
  52050. e.bindBuffer(n, t.__webglBuffer);
  52051. var r = i.dynamic ? e.DYNAMIC_DRAW : e.STATIC_DRAW;
  52052. e.bufferData(n, i.array, r),
  52053. t.version = i.version
  52054. }
  52055. function s(t, i, n) {
  52056. e.bindBuffer(n, t.__webglBuffer),
  52057. 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)),
  52058. i.updateRange.count = 0),
  52059. t.version = i.version
  52060. }
  52061. function l(e) {
  52062. return e instanceof n.InterleavedBufferAttribute ? t.get(e.data).__webglBuffer : t.get(e).__webglBuffer
  52063. }
  52064. function c(i) {
  52065. var r = t.get(i);
  52066. if (void 0 !== r.wireframe)
  52067. return r.wireframe;
  52068. var a = []
  52069. , s = i.index
  52070. , l = i.attributes
  52071. , c = l.position;
  52072. if (null !== s)
  52073. for (var u = {}, d = s.array, p = 0, f = d.length; p < f; p += 3) {
  52074. var g = d[p + 0]
  52075. , m = d[p + 1]
  52076. , v = d[p + 2];
  52077. h(u, g, m) && a.push(g, m),
  52078. h(u, m, v) && a.push(m, v),
  52079. h(u, v, g) && a.push(v, g)
  52080. }
  52081. else
  52082. for (var d = l.position.array, p = 0, f = d.length / 3 - 1; p < f; p += 3) {
  52083. var g = p + 0
  52084. , m = p + 1
  52085. , v = p + 2;
  52086. a.push(g, m, m, v, v, g)
  52087. }
  52088. var A = c.count > 65535 ? Uint32Array : Uint16Array
  52089. , y = new n.BufferAttribute(new A(a),1);
  52090. return o(y, e.ELEMENT_ARRAY_BUFFER),
  52091. r.wireframe = y,
  52092. y
  52093. }
  52094. function h(e, t, i) {
  52095. if (t > i) {
  52096. var n = t;
  52097. t = i,
  52098. i = n
  52099. }
  52100. var r = e[t];
  52101. return void 0 === r ? (e[t] = [i],
  52102. !0) : r.indexOf(i) === -1 && (r.push(i),
  52103. !0)
  52104. }
  52105. var u = new n.WebGLGeometries(e,t,i);
  52106. this.getAttributeBuffer = l,
  52107. this.getWireframeAttribute = c,
  52108. this.update = r
  52109. }
  52110. ,
  52111. n.WebGLProgram = function() {
  52112. function e(e) {
  52113. switch (e) {
  52114. case n.LinearEncoding:
  52115. return ["Linear", "( value )"];
  52116. case n.sRGBEncoding:
  52117. return ["sRGB", "( value )"];
  52118. case n.RGBEEncoding:
  52119. return ["RGBE", "( value )"];
  52120. case n.RGBM7Encoding:
  52121. return ["RGBM", "( value, 7.0 )"];
  52122. case n.RGBM16Encoding:
  52123. return ["RGBM", "( value, 16.0 )"];
  52124. case n.RGBDEncoding:
  52125. return ["RGBD", "( value, 256.0 )"];
  52126. case n.GammaEncoding:
  52127. return ["Gamma", "( value, float( GAMMA_FACTOR ) )"];
  52128. default:
  52129. throw new Error("unsupported encoding: " + e)
  52130. }
  52131. }
  52132. function t(t, i) {
  52133. var n = e(i);
  52134. return "vec4 " + t + "( vec4 value ) { return " + n[0] + "ToLinear" + n[1] + "; }"
  52135. }
  52136. function i(t, i) {
  52137. var n = e(i);
  52138. return "vec4 " + t + "( vec4 value ) { return LinearTo" + n[0] + n[1] + "; }"
  52139. }
  52140. function r(e, t) {
  52141. var i;
  52142. switch (t) {
  52143. case n.LinearToneMapping:
  52144. i = "Linear";
  52145. break;
  52146. case n.ReinhardToneMapping:
  52147. i = "Reinhard";
  52148. break;
  52149. case n.Uncharted2ToneMapping:
  52150. i = "Uncharted2";
  52151. break;
  52152. case n.CineonToneMapping:
  52153. i = "OptimizedCineon";
  52154. break;
  52155. default:
  52156. throw new Error("unsupported toneMapping: " + t)
  52157. }
  52158. return "vec3 " + e + "( vec3 color ) { return " + i + "ToneMapping( color ); }"
  52159. }
  52160. function o(e, t, i) {
  52161. e = e || {};
  52162. 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" : ""];
  52163. return n.filter(c).join("\n")
  52164. }
  52165. function a(e) {
  52166. var t = [];
  52167. for (var i in e) {
  52168. var n = e[i];
  52169. n !== !1 && t.push("#define " + i + " " + n)
  52170. }
  52171. return t.join("\n")
  52172. }
  52173. function s(e, t, i) {
  52174. for (var n = {}, r = e.getProgramParameter(t, e.ACTIVE_UNIFORMS), o = 0; o < r; o++) {
  52175. var a = e.getActiveUniform(t, o)
  52176. , s = a.name
  52177. , l = e.getUniformLocation(t, s)
  52178. , c = f.exec(s);
  52179. if (c) {
  52180. var h = c[1]
  52181. , u = c[2]
  52182. , d = n[h];
  52183. d || (d = n[h] = {}),
  52184. d[u] = l
  52185. } else if (c = g.exec(s)) {
  52186. var p = c[1]
  52187. , v = c[2]
  52188. , A = c[3]
  52189. , y = n[p];
  52190. y || (y = n[p] = []);
  52191. var C = y[v];
  52192. C || (C = y[v] = {}),
  52193. C[A] = l
  52194. } else if (c = m.exec(s)) {
  52195. var p = c[1];
  52196. n[p] = l
  52197. } else
  52198. n[s] = l
  52199. }
  52200. return n
  52201. }
  52202. function l(e, t, i) {
  52203. for (var n = {}, r = e.getProgramParameter(t, e.ACTIVE_ATTRIBUTES), o = 0; o < r; o++) {
  52204. var a = e.getActiveAttrib(t, o)
  52205. , s = a.name;
  52206. n[s] = e.getAttribLocation(t, s)
  52207. }
  52208. return n
  52209. }
  52210. function c(e) {
  52211. return "" !== e
  52212. }
  52213. function h(e, t) {
  52214. 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)
  52215. }
  52216. function u(e) {
  52217. function t(e, t) {
  52218. var i = n.ShaderChunk[t];
  52219. if (void 0 === i)
  52220. throw new Error("Can not resolve #include <" + t + ">");
  52221. return u(i)
  52222. }
  52223. var i = /#include +<([\w\d.]+)>/g;
  52224. return e.replace(i, t)
  52225. }
  52226. function d(e) {
  52227. function t(e, t, i, n) {
  52228. for (var r = "", o = parseInt(t); o < parseInt(i); o++)
  52229. r += n.replace(/\[ i \]/g, "[ " + o + " ]");
  52230. return r
  52231. }
  52232. var i = /for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g;
  52233. return e.replace(i, t)
  52234. }
  52235. var p = 0
  52236. , f = /^([\w\d_]+)\.([\w\d_]+)$/
  52237. , g = /^([\w\d_]+)\[(\d+)\]\.([\w\d_]+)$/
  52238. , m = /^([\w\d_]+)\[0\]$/;
  52239. return function(e, f, g, m) {
  52240. var v = e.context
  52241. , A = g.extensions
  52242. , y = g.defines
  52243. , C = g.__webglShader.vertexShader
  52244. , I = g.__webglShader.fragmentShader
  52245. , E = "SHADOWMAP_TYPE_BASIC";
  52246. m.shadowMapType === n.PCFShadowMap ? E = "SHADOWMAP_TYPE_PCF" : m.shadowMapType === n.PCFSoftShadowMap && (E = "SHADOWMAP_TYPE_PCF_SOFT");
  52247. var b = "ENVMAP_TYPE_CUBE"
  52248. , w = "ENVMAP_MODE_REFLECTION"
  52249. , _ = "ENVMAP_BLENDING_MULTIPLY";
  52250. if (m.envMap) {
  52251. switch (g.envMap.mapping) {
  52252. case n.CubeReflectionMapping:
  52253. case n.CubeRefractionMapping:
  52254. b = "ENVMAP_TYPE_CUBE";
  52255. break;
  52256. case n.CubeUVReflectionMapping:
  52257. case n.CubeUVRefractionMapping:
  52258. b = "ENVMAP_TYPE_CUBE_UV";
  52259. break;
  52260. case n.EquirectangularReflectionMapping:
  52261. case n.EquirectangularRefractionMapping:
  52262. b = "ENVMAP_TYPE_EQUIREC";
  52263. break;
  52264. case n.SphericalReflectionMapping:
  52265. b = "ENVMAP_TYPE_SPHERE"
  52266. }
  52267. switch (g.envMap.mapping) {
  52268. case n.CubeRefractionMapping:
  52269. case n.EquirectangularRefractionMapping:
  52270. w = "ENVMAP_MODE_REFRACTION"
  52271. }
  52272. switch (g.combine) {
  52273. case n.MultiplyOperation:
  52274. _ = "ENVMAP_BLENDING_MULTIPLY";
  52275. break;
  52276. case n.MixOperation:
  52277. _ = "ENVMAP_BLENDING_MIX";
  52278. break;
  52279. case n.AddOperation:
  52280. _ = "ENVMAP_BLENDING_ADD"
  52281. }
  52282. }
  52283. var T, x, S = e.gammaFactor > 0 ? e.gammaFactor : 1, M = o(A, m, e.extensions), R = a(y), P = v.createProgram();
  52284. g instanceof n.RawShaderMaterial ? (T = "",
  52285. 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"),
  52286. 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")),
  52287. C = u(C, m),
  52288. C = h(C, m),
  52289. I = u(I, m),
  52290. I = h(I, m),
  52291. g instanceof n.ShaderMaterial == !1 && (C = d(C),
  52292. I = d(I));
  52293. var O = T + C
  52294. , L = x + I
  52295. , D = n.WebGLShader(v, v.VERTEX_SHADER, O)
  52296. , N = n.WebGLShader(v, v.FRAGMENT_SHADER, L);
  52297. v.attachShader(P, D),
  52298. v.attachShader(P, N),
  52299. void 0 !== g.index0AttributeName ? v.bindAttribLocation(P, 0, g.index0AttributeName) : m.morphTargets === !0 && v.bindAttribLocation(P, 0, "position"),
  52300. v.linkProgram(P);
  52301. var B = v.getProgramInfoLog(P)
  52302. , F = v.getShaderInfoLog(D)
  52303. , V = v.getShaderInfoLog(N)
  52304. , U = !0
  52305. , k = !0;
  52306. v.getProgramParameter(P, v.LINK_STATUS) === !1 ? (U = !1,
  52307. 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),
  52308. k && (this.diagnostics = {
  52309. runnable: U,
  52310. material: g,
  52311. programLog: B,
  52312. vertexShader: {
  52313. log: F,
  52314. prefix: T
  52315. },
  52316. fragmentShader: {
  52317. log: V,
  52318. prefix: x
  52319. }
  52320. }),
  52321. v.deleteShader(D),
  52322. v.deleteShader(N);
  52323. var H;
  52324. this.getUniforms = function() {
  52325. return void 0 === H && (H = s(v, P)),
  52326. H
  52327. }
  52328. ;
  52329. var G;
  52330. return this.getAttributes = function() {
  52331. return void 0 === G && (G = l(v, P)),
  52332. G
  52333. }
  52334. ,
  52335. this.destroy = function() {
  52336. v.deleteProgram(P),
  52337. this.program = void 0
  52338. }
  52339. ,
  52340. Object.defineProperties(this, {
  52341. uniforms: {
  52342. get: function() {
  52343. return console.warn("THREE.WebGLProgram: .uniforms is now .getUniforms()."),
  52344. this.getUniforms()
  52345. }
  52346. },
  52347. attributes: {
  52348. get: function() {
  52349. return console.warn("THREE.WebGLProgram: .attributes is now .getAttributes()."),
  52350. this.getAttributes()
  52351. }
  52352. }
  52353. }),
  52354. this.id = p++,
  52355. this.code = f,
  52356. this.usedTimes = 1,
  52357. this.program = P,
  52358. this.vertexShader = D,
  52359. this.fragmentShader = N,
  52360. this
  52361. }
  52362. }(),
  52363. n.WebGLPrograms = function(e, t) {
  52364. function i(e) {
  52365. if (t.floatVertexTextures && e && e.skeleton && e.skeleton.useVertexTexture)
  52366. return 1024;
  52367. var i = t.maxVertexUniforms
  52368. , r = Math.floor((i - 20) / 4)
  52369. , o = r;
  52370. return void 0 !== e && e instanceof n.SkinnedMesh && (o = Math.min(e.skeleton.bones.length, o),
  52371. 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)")),
  52372. o
  52373. }
  52374. function r(e, t) {
  52375. var i;
  52376. return e ? e instanceof n.Texture ? i = e.encoding : e instanceof n.WebGLRenderTarget && (i = e.texture.encoding) : i = n.LinearEncoding,
  52377. i === n.LinearEncoding && t && (i = n.GammaEncoding),
  52378. i
  52379. }
  52380. var o = []
  52381. , a = {
  52382. MeshDepthMaterial: "depth",
  52383. MeshNormalMaterial: "normal",
  52384. MeshBasicMaterial: "basic",
  52385. MeshLambertMaterial: "lambert",
  52386. MeshPhongMaterial: "phong",
  52387. MeshStandardMaterial: "standard",
  52388. LineBasicMaterial: "basic",
  52389. LineDashedMaterial: "dashed",
  52390. PointsMaterial: "points"
  52391. }
  52392. , 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"];
  52393. this.getParameters = function(o, s, l, c) {
  52394. var h = a[o.type]
  52395. , u = i(c)
  52396. , d = e.getPrecision();
  52397. null !== o.precision && (d = t.getMaxPrecision(o.precision),
  52398. d !== o.precision && console.warn("THREE.WebGLProgram.getParameters:", o.precision, "not supported, using", d, "instead."));
  52399. var p = {
  52400. shaderID: h,
  52401. precision: d,
  52402. supportsVertexTextures: t.vertexTextures,
  52403. outputEncoding: r(e.getCurrentRenderTarget(), e.gammaOutput),
  52404. map: !!o.map,
  52405. mapEncoding: r(o.map, e.gammaInput),
  52406. envMap: !!o.envMap,
  52407. envMapMode: o.envMap && o.envMap.mapping,
  52408. envMapEncoding: r(o.envMap, e.gammaInput),
  52409. envMapCubeUV: !!o.envMap && (o.envMap.mapping === n.CubeUVReflectionMapping || o.envMap.mapping === n.CubeUVRefractionMapping),
  52410. lightMap: !!o.lightMap,
  52411. aoMap: !!o.aoMap,
  52412. emissiveMap: !!o.emissiveMap,
  52413. emissiveMapEncoding: r(o.emissiveMap, e.gammaInput),
  52414. bumpMap: !!o.bumpMap,
  52415. normalMap: !!o.normalMap,
  52416. displacementMap: !!o.displacementMap,
  52417. roughnessMap: !!o.roughnessMap,
  52418. metalnessMap: !!o.metalnessMap,
  52419. specularMap: !!o.specularMap,
  52420. alphaMap: !!o.alphaMap,
  52421. combine: o.combine,
  52422. vertexColors: o.vertexColors,
  52423. fog: l,
  52424. useFog: o.fog,
  52425. fogExp: l instanceof n.FogExp2,
  52426. flatShading: o.shading === n.FlatShading,
  52427. sizeAttenuation: o.sizeAttenuation,
  52428. logarithmicDepthBuffer: t.logarithmicDepthBuffer,
  52429. skinning: o.skinning,
  52430. maxBones: u,
  52431. useVertexTexture: t.floatVertexTextures && c && c.skeleton && c.skeleton.useVertexTexture,
  52432. morphTargets: o.morphTargets,
  52433. morphNormals: o.morphNormals,
  52434. maxMorphTargets: e.maxMorphTargets,
  52435. maxMorphNormals: e.maxMorphNormals,
  52436. numDirLights: s.directional.length,
  52437. numPointLights: s.point.length,
  52438. numSpotLights: s.spot.length,
  52439. numHemiLights: s.hemi.length,
  52440. pointLightShadows: s.shadowsPointLight,
  52441. shadowMapEnabled: e.shadowMap.enabled && c.receiveShadow && s.shadows.length > 0,
  52442. shadowMapType: e.shadowMap.type,
  52443. toneMapping: e.toneMapping,
  52444. physicallyCorrectLights: e.physicallyCorrectLights,
  52445. premultipliedAlpha: o.premultipliedAlpha,
  52446. alphaTest: o.alphaTest,
  52447. doubleSided: o.side === n.DoubleSide,
  52448. flipSided: o.side === n.BackSide
  52449. };
  52450. return p
  52451. }
  52452. ,
  52453. this.getProgramCode = function(e, t) {
  52454. var i = [];
  52455. if (t.shaderID ? i.push(t.shaderID) : (i.push(e.fragmentShader),
  52456. i.push(e.vertexShader)),
  52457. void 0 !== e.defines)
  52458. for (var n in e.defines)
  52459. i.push(n),
  52460. i.push(e.defines[n]);
  52461. for (var r = 0; r < s.length; r++) {
  52462. var o = s[r];
  52463. i.push(o),
  52464. i.push(t[o])
  52465. }
  52466. return i.join()
  52467. }
  52468. ,
  52469. this.acquireProgram = function(t, i, r) {
  52470. for (var a, s = 0, l = o.length; s < l; s++) {
  52471. var c = o[s];
  52472. if (c.code === r) {
  52473. a = c,
  52474. ++a.usedTimes;
  52475. break
  52476. }
  52477. }
  52478. return void 0 === a && (a = new n.WebGLProgram(e,r,t,i),
  52479. o.push(a)),
  52480. a
  52481. }
  52482. ,
  52483. this.releaseProgram = function(e) {
  52484. if (0 === --e.usedTimes) {
  52485. var t = o.indexOf(e);
  52486. o[t] = o[o.length - 1],
  52487. o.pop(),
  52488. e.destroy()
  52489. }
  52490. }
  52491. ,
  52492. this.programs = o
  52493. }
  52494. ,
  52495. n.WebGLProperties = function() {
  52496. var e = {};
  52497. this.get = function(t) {
  52498. var i = t.uuid
  52499. , n = e[i];
  52500. return void 0 === n && (n = {},
  52501. e[i] = n),
  52502. n
  52503. }
  52504. ,
  52505. this.delete = function(t) {
  52506. delete e[t.uuid]
  52507. }
  52508. ,
  52509. this.clear = function() {
  52510. e = {}
  52511. }
  52512. }
  52513. ,
  52514. n.WebGLShader = function() {
  52515. function e(e) {
  52516. for (var t = e.split("\n"), i = 0; i < t.length; i++)
  52517. t[i] = i + 1 + ": " + t[i];
  52518. return t.join("\n")
  52519. }
  52520. return function(t, i, n) {
  52521. var r = t.createShader(i);
  52522. return t.shaderSource(r, n),
  52523. t.compileShader(r),
  52524. t.getShaderParameter(r, t.COMPILE_STATUS) === !1 && console.error("THREE.WebGLShader: Shader couldn't compile."),
  52525. "" !== t.getShaderInfoLog(r) && console.warn("THREE.WebGLShader: gl.getShaderInfoLog()", i === t.VERTEX_SHADER ? "vertex" : "fragment", t.getShaderInfoLog(r), e(n)),
  52526. r
  52527. }
  52528. }(),
  52529. n.WebGLShadowMap = function(e, t, i) {
  52530. function r(e, t, i, r) {
  52531. var o = e.geometry
  52532. , a = null
  52533. , s = v
  52534. , l = e.customDepthMaterial;
  52535. if (i && (s = A,
  52536. l = e.customDistanceMaterial),
  52537. l)
  52538. a = l;
  52539. else {
  52540. var c = void 0 !== o.morphTargets && o.morphTargets.length > 0 && t.morphTargets
  52541. , h = e instanceof n.SkinnedMesh && t.skinning
  52542. , u = 0;
  52543. c && (u |= f),
  52544. h && (u |= g),
  52545. a = s[u]
  52546. }
  52547. return a.visible = t.visible,
  52548. a.wireframe = t.wireframe,
  52549. a.wireframeLinewidth = t.wireframeLinewidth,
  52550. i && void 0 !== a.uniforms.lightPos && a.uniforms.lightPos.value.copy(r),
  52551. a
  52552. }
  52553. function o(e, t, i) {
  52554. if (e.visible !== !1) {
  52555. 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)) {
  52556. var r = e.material;
  52557. r.visible === !0 && (e.modelViewMatrix.multiplyMatrices(i.matrixWorldInverse, e.matrixWorld),
  52558. p.push(e))
  52559. }
  52560. for (var a = e.children, s = 0, c = a.length; s < c; s++)
  52561. o(a[s], t, i)
  52562. }
  52563. }
  52564. 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) {
  52565. var x = 0 !== (T & f)
  52566. , S = 0 !== (T & g)
  52567. , M = new n.ShaderMaterial({
  52568. uniforms: b,
  52569. vertexShader: E.vertexShader,
  52570. fragmentShader: E.fragmentShader,
  52571. morphTargets: x,
  52572. skinning: S
  52573. });
  52574. v[T] = M;
  52575. var R = new n.ShaderMaterial({
  52576. defines: {
  52577. USE_SHADOWMAP: ""
  52578. },
  52579. uniforms: _,
  52580. vertexShader: w.vertexShader,
  52581. fragmentShader: w.fragmentShader,
  52582. morphTargets: x,
  52583. skinning: S
  52584. });
  52585. A[T] = R
  52586. }
  52587. var P = this;
  52588. this.enabled = !1,
  52589. this.autoUpdate = !0,
  52590. this.needsUpdate = !1,
  52591. this.type = n.PCFShadowMap,
  52592. this.cullFace = n.CullFaceFront,
  52593. this.render = function(f, g) {
  52594. var m, v, A = t.shadows;
  52595. if (0 !== A.length && P.enabled !== !1 && (P.autoUpdate !== !1 || P.needsUpdate !== !1)) {
  52596. s.clearColor(1, 1, 1, 1),
  52597. s.disable(a.BLEND),
  52598. s.enable(a.CULL_FACE),
  52599. a.frontFace(a.CCW),
  52600. a.cullFace(P.cullFace === n.CullFaceFront ? a.FRONT : a.BACK),
  52601. s.setDepthTest(!0),
  52602. s.setScissorTest(!1);
  52603. for (var E = 0, b = A.length; E < b; E++) {
  52604. var w = A[E]
  52605. , _ = w.shadow
  52606. , T = _.camera;
  52607. if (h.copy(_.mapSize),
  52608. w instanceof n.PointLight) {
  52609. m = 6,
  52610. v = !0;
  52611. var x = h.x
  52612. , S = h.y;
  52613. I[0].set(2 * x, S, x, S),
  52614. I[1].set(0, S, x, S),
  52615. I[2].set(3 * x, S, x, S),
  52616. I[3].set(x, S, x, S),
  52617. I[4].set(3 * x, 0, x, S),
  52618. I[5].set(x, 0, x, S),
  52619. h.x *= 4,
  52620. h.y *= 2
  52621. } else
  52622. m = 1,
  52623. v = !1;
  52624. if (null === _.map) {
  52625. var M = {
  52626. minFilter: n.NearestFilter,
  52627. magFilter: n.NearestFilter,
  52628. format: n.RGBAFormat
  52629. };
  52630. _.map = new n.WebGLRenderTarget(h.x,h.y,M),
  52631. w instanceof n.SpotLight && (T.aspect = h.x / h.y),
  52632. T.updateProjectionMatrix()
  52633. }
  52634. var R = _.map
  52635. , O = _.matrix;
  52636. d.setFromMatrixPosition(w.matrixWorld),
  52637. T.position.copy(d),
  52638. e.setRenderTarget(R),
  52639. e.clear();
  52640. for (var L = 0; L < m; L++) {
  52641. if (v) {
  52642. u.copy(T.position),
  52643. u.add(y[L]),
  52644. T.up.copy(C[L]),
  52645. T.lookAt(u);
  52646. var D = I[L];
  52647. s.viewport(D)
  52648. } else
  52649. u.setFromMatrixPosition(w.target.matrixWorld),
  52650. T.lookAt(u);
  52651. T.updateMatrixWorld(),
  52652. T.matrixWorldInverse.getInverse(T.matrixWorld),
  52653. O.set(.5, 0, 0, .5, 0, .5, 0, .5, 0, 0, .5, .5, 0, 0, 0, 1),
  52654. O.multiply(T.projectionMatrix),
  52655. O.multiply(T.matrixWorldInverse),
  52656. c.multiplyMatrices(T.projectionMatrix, T.matrixWorldInverse),
  52657. l.setFromMatrix(c),
  52658. p.length = 0,
  52659. o(f, g, T);
  52660. for (var N = 0, B = p.length; N < B; N++) {
  52661. var F = p[N]
  52662. , V = i.update(F)
  52663. , U = F.material;
  52664. if (U instanceof n.MultiMaterial)
  52665. for (var k = V.groups, H = U.materials, G = 0, z = k.length; G < z; G++) {
  52666. var W = k[G]
  52667. , j = H[W.materialIndex];
  52668. if (j.visible === !0) {
  52669. var Y = r(F, j, v, d);
  52670. e.renderBufferDirect(T, null, V, Y, F, W)
  52671. }
  52672. }
  52673. else {
  52674. var Y = r(F, U, v, d);
  52675. e.renderBufferDirect(T, null, V, Y, F, null)
  52676. }
  52677. }
  52678. }
  52679. }
  52680. var X = e.getClearColor()
  52681. , Z = e.getClearAlpha();
  52682. e.setClearColor(X, Z),
  52683. s.enable(a.BLEND),
  52684. P.cullFace === n.CullFaceFront && a.cullFace(a.BACK),
  52685. P.needsUpdate = !1
  52686. }
  52687. }
  52688. }
  52689. ,
  52690. n.WebGLState = function(e, t, i) {
  52691. var r = this
  52692. , o = new n.Vector4
  52693. , a = new Uint8Array(16)
  52694. , s = new Uint8Array(16)
  52695. , l = new Uint8Array(16)
  52696. , c = {}
  52697. , h = null
  52698. , u = null
  52699. , d = null
  52700. , p = null
  52701. , f = null
  52702. , g = null
  52703. , m = null
  52704. , v = null
  52705. , A = !1
  52706. , y = null
  52707. , C = null
  52708. , I = null
  52709. , E = null
  52710. , b = null
  52711. , w = null
  52712. , _ = null
  52713. , T = null
  52714. , x = null
  52715. , S = null
  52716. , M = null
  52717. , R = null
  52718. , P = null
  52719. , O = null
  52720. , L = null
  52721. , D = e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS)
  52722. , N = void 0
  52723. , B = {}
  52724. , F = new n.Vector4
  52725. , V = null
  52726. , U = null
  52727. , k = new n.Vector4
  52728. , H = new n.Vector4
  52729. , G = e.createTexture();
  52730. e.bindTexture(e.TEXTURE_2D, G),
  52731. e.texParameteri(e.TEXTURE_2D, e.TEXTURE_MIN_FILTER, e.LINEAR),
  52732. e.texImage2D(e.TEXTURE_2D, 0, e.RGB, 1, 1, 0, e.RGB, e.UNSIGNED_BYTE, new Uint8Array(3)),
  52733. this.init = function() {
  52734. this.clearColor(0, 0, 0, 1),
  52735. this.clearDepth(1),
  52736. this.clearStencil(0),
  52737. this.enable(e.DEPTH_TEST),
  52738. e.depthFunc(e.LEQUAL),
  52739. e.frontFace(e.CCW),
  52740. e.cullFace(e.BACK),
  52741. this.enable(e.CULL_FACE),
  52742. this.enable(e.BLEND),
  52743. e.blendEquation(e.FUNC_ADD),
  52744. e.blendFunc(e.SRC_ALPHA, e.ONE_MINUS_SRC_ALPHA)
  52745. }
  52746. ,
  52747. this.initAttributes = function() {
  52748. for (var e = 0, t = a.length; e < t; e++)
  52749. a[e] = 0
  52750. }
  52751. ,
  52752. this.enableAttribute = function(i) {
  52753. if (a[i] = 1,
  52754. 0 === s[i] && (e.enableVertexAttribArray(i),
  52755. s[i] = 1),
  52756. 0 !== l[i]) {
  52757. var n = t.get("ANGLE_instanced_arrays");
  52758. n.vertexAttribDivisorANGLE(i, 0),
  52759. l[i] = 0
  52760. }
  52761. }
  52762. ,
  52763. this.enableAttributeAndDivisor = function(t, i, n) {
  52764. a[t] = 1,
  52765. 0 === s[t] && (e.enableVertexAttribArray(t),
  52766. s[t] = 1),
  52767. l[t] !== i && (n.vertexAttribDivisorANGLE(t, i),
  52768. l[t] = i)
  52769. }
  52770. ,
  52771. this.disableUnusedAttributes = function() {
  52772. for (var t = 0, i = s.length; t < i; t++)
  52773. s[t] !== a[t] && (e.disableVertexAttribArray(t),
  52774. s[t] = 0)
  52775. }
  52776. ,
  52777. this.enable = function(t) {
  52778. c[t] !== !0 && (e.enable(t),
  52779. c[t] = !0)
  52780. }
  52781. ,
  52782. this.disable = function(t) {
  52783. c[t] !== !1 && (e.disable(t),
  52784. c[t] = !1)
  52785. }
  52786. ,
  52787. this.getCompressedTextureFormats = function() {
  52788. if (null === h && (h = [],
  52789. t.get("WEBGL_compressed_texture_pvrtc") || t.get("WEBGL_compressed_texture_s3tc") || t.get("WEBGL_compressed_texture_etc1")))
  52790. for (var i = e.getParameter(e.COMPRESSED_TEXTURE_FORMATS), n = 0; n < i.length; n++)
  52791. h.push(i[n]);
  52792. return h
  52793. }
  52794. ,
  52795. this.setBlending = function(t, r, o, a, s, l, c, h) {
  52796. t === n.NoBlending ? this.disable(e.BLEND) : this.enable(e.BLEND),
  52797. t === u && h === A || (t === n.AdditiveBlending ? h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  52798. e.blendFuncSeparate(e.ONE, e.ONE, e.ONE, e.ONE)) : (e.blendEquation(e.FUNC_ADD),
  52799. e.blendFunc(e.SRC_ALPHA, e.ONE)) : t === n.SubtractiveBlending ? h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  52800. e.blendFuncSeparate(e.ZERO, e.ZERO, e.ONE_MINUS_SRC_COLOR, e.ONE_MINUS_SRC_ALPHA)) : (e.blendEquation(e.FUNC_ADD),
  52801. e.blendFunc(e.ZERO, e.ONE_MINUS_SRC_COLOR)) : t === n.MultiplyBlending ? h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  52802. e.blendFuncSeparate(e.ZERO, e.ZERO, e.SRC_COLOR, e.SRC_ALPHA)) : (e.blendEquation(e.FUNC_ADD),
  52803. e.blendFunc(e.ZERO, e.SRC_COLOR)) : h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  52804. e.blendFuncSeparate(e.ONE, e.ONE_MINUS_SRC_ALPHA, e.ONE, e.ONE_MINUS_SRC_ALPHA)) : (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  52805. e.blendFuncSeparate(e.SRC_ALPHA, e.ONE_MINUS_SRC_ALPHA, e.ONE, e.ONE_MINUS_SRC_ALPHA)),
  52806. u = t,
  52807. A = h),
  52808. t === n.CustomBlending ? (s = s || r,
  52809. l = l || o,
  52810. c = c || a,
  52811. r === d && s === g || (e.blendEquationSeparate(i(r), i(s)),
  52812. d = r,
  52813. g = s),
  52814. o === p && a === f && l === m && c === v || (e.blendFuncSeparate(i(o), i(a), i(l), i(c)),
  52815. p = o,
  52816. f = a,
  52817. m = l,
  52818. v = c)) : (d = null,
  52819. p = null,
  52820. f = null,
  52821. g = null,
  52822. m = null,
  52823. v = null)
  52824. }
  52825. ,
  52826. this.setDepthFunc = function(t) {
  52827. if (y !== t) {
  52828. if (t)
  52829. switch (t) {
  52830. case n.NeverDepth:
  52831. e.depthFunc(e.NEVER);
  52832. break;
  52833. case n.AlwaysDepth:
  52834. e.depthFunc(e.ALWAYS);
  52835. break;
  52836. case n.LessDepth:
  52837. e.depthFunc(e.LESS);
  52838. break;
  52839. case n.LessEqualDepth:
  52840. e.depthFunc(e.LEQUAL);
  52841. break;
  52842. case n.EqualDepth:
  52843. e.depthFunc(e.EQUAL);
  52844. break;
  52845. case n.GreaterEqualDepth:
  52846. e.depthFunc(e.GEQUAL);
  52847. break;
  52848. case n.GreaterDepth:
  52849. e.depthFunc(e.GREATER);
  52850. break;
  52851. case n.NotEqualDepth:
  52852. e.depthFunc(e.NOTEQUAL);
  52853. break;
  52854. default:
  52855. e.depthFunc(e.LEQUAL)
  52856. }
  52857. else
  52858. e.depthFunc(e.LEQUAL);
  52859. y = t
  52860. }
  52861. }
  52862. ,
  52863. this.setDepthTest = function(t) {
  52864. t ? this.enable(e.DEPTH_TEST) : this.disable(e.DEPTH_TEST)
  52865. }
  52866. ,
  52867. this.setDepthWrite = function(t) {
  52868. C !== t && (e.depthMask(t),
  52869. C = t)
  52870. }
  52871. ,
  52872. this.setColorWrite = function(t) {
  52873. I !== t && (e.colorMask(t, t, t, t),
  52874. I = t)
  52875. }
  52876. ,
  52877. this.setStencilFunc = function(t, i, n) {
  52878. b === t && w === i && _ === n || (e.stencilFunc(t, i, n),
  52879. b = t,
  52880. w = i,
  52881. _ = n)
  52882. }
  52883. ,
  52884. this.setStencilOp = function(t, i, n) {
  52885. T === t && x === i && S === n || (e.stencilOp(t, i, n),
  52886. T = t,
  52887. x = i,
  52888. S = n)
  52889. }
  52890. ,
  52891. this.setStencilTest = function(t) {
  52892. t ? this.enable(e.STENCIL_TEST) : this.disable(e.STENCIL_TEST)
  52893. }
  52894. ,
  52895. this.setStencilWrite = function(t) {
  52896. E !== t && (e.stencilMask(t),
  52897. E = t)
  52898. }
  52899. ,
  52900. this.setFlipSided = function(t) {
  52901. M !== t && (t ? e.frontFace(e.CW) : e.frontFace(e.CCW),
  52902. M = t)
  52903. }
  52904. ,
  52905. this.setLineWidth = function(t) {
  52906. t !== R && (e.lineWidth(t),
  52907. R = t)
  52908. }
  52909. ,
  52910. this.setPolygonOffset = function(t, i, n) {
  52911. t ? this.enable(e.POLYGON_OFFSET_FILL) : this.disable(e.POLYGON_OFFSET_FILL),
  52912. !t || P === i && O === n || (e.polygonOffset(i, n),
  52913. P = i,
  52914. O = n)
  52915. }
  52916. ,
  52917. this.getScissorTest = function() {
  52918. return L
  52919. }
  52920. ,
  52921. this.setScissorTest = function(t) {
  52922. L = t,
  52923. t ? this.enable(e.SCISSOR_TEST) : this.disable(e.SCISSOR_TEST)
  52924. }
  52925. ,
  52926. this.activeTexture = function(t) {
  52927. void 0 === t && (t = e.TEXTURE0 + D - 1),
  52928. N !== t && (e.activeTexture(t),
  52929. N = t)
  52930. }
  52931. ,
  52932. this.bindTexture = function(t, i) {
  52933. void 0 === N && r.activeTexture();
  52934. var n = B[N];
  52935. void 0 === n && (n = {
  52936. type: void 0,
  52937. texture: void 0
  52938. },
  52939. B[N] = n),
  52940. n.type === t && n.texture === i || (e.bindTexture(t, i || G),
  52941. n.type = t,
  52942. n.texture = i)
  52943. }
  52944. ,
  52945. this.compressedTexImage2D = function() {
  52946. try {
  52947. e.compressedTexImage2D.apply(e, arguments)
  52948. } catch (e) {
  52949. console.error(e)
  52950. }
  52951. }
  52952. ,
  52953. this.texImage2D = function() {
  52954. try {
  52955. e.texImage2D.apply(e, arguments)
  52956. } catch (e) {
  52957. console.error(e)
  52958. }
  52959. }
  52960. ,
  52961. this.clearColor = function(t, i, n, r) {
  52962. o.set(t, i, n, r),
  52963. F.equals(o) === !1 && (e.clearColor(t, i, n, r),
  52964. F.copy(o))
  52965. }
  52966. ,
  52967. this.clearDepth = function(t) {
  52968. V !== t && (e.clearDepth(t),
  52969. V = t)
  52970. }
  52971. ,
  52972. this.clearStencil = function(t) {
  52973. U !== t && (e.clearStencil(t),
  52974. U = t)
  52975. }
  52976. ,
  52977. this.scissor = function(t) {
  52978. k.equals(t) === !1 && (e.scissor(t.x, t.y, t.z, t.w),
  52979. k.copy(t))
  52980. }
  52981. ,
  52982. this.viewport = function(t) {
  52983. H.equals(t) === !1 && (e.viewport(t.x, t.y, t.z, t.w),
  52984. H.copy(t))
  52985. }
  52986. ,
  52987. this.reset = function() {
  52988. for (var t = 0; t < s.length; t++)
  52989. 1 === s[t] && (e.disableVertexAttribArray(t),
  52990. s[t] = 0);
  52991. c = {},
  52992. h = null,
  52993. N = void 0,
  52994. B = {},
  52995. u = null,
  52996. I = null,
  52997. C = null,
  52998. E = null,
  52999. M = null
  53000. }
  53001. }
  53002. ,
  53003. n.LensFlarePlugin = function(e, t) {
  53004. function i() {
  53005. var e = new Float32Array([-1, -1, 0, 0, 1, -1, 1, 0, 1, 1, 1, 1, -1, 1, 0, 1])
  53006. , t = new Uint16Array([0, 1, 2, 0, 2, 3]);
  53007. o = p.createBuffer(),
  53008. a = p.createBuffer(),
  53009. p.bindBuffer(p.ARRAY_BUFFER, o),
  53010. p.bufferData(p.ARRAY_BUFFER, e, p.STATIC_DRAW),
  53011. p.bindBuffer(p.ELEMENT_ARRAY_BUFFER, a),
  53012. p.bufferData(p.ELEMENT_ARRAY_BUFFER, t, p.STATIC_DRAW),
  53013. u = p.createTexture(),
  53014. d = p.createTexture(),
  53015. f.bindTexture(p.TEXTURE_2D, u),
  53016. p.texImage2D(p.TEXTURE_2D, 0, p.RGB, 16, 16, 0, p.RGB, p.UNSIGNED_BYTE, null),
  53017. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_WRAP_S, p.CLAMP_TO_EDGE),
  53018. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_WRAP_T, p.CLAMP_TO_EDGE),
  53019. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_MAG_FILTER, p.NEAREST),
  53020. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_MIN_FILTER, p.NEAREST),
  53021. f.bindTexture(p.TEXTURE_2D, d),
  53022. p.texImage2D(p.TEXTURE_2D, 0, p.RGBA, 16, 16, 0, p.RGBA, p.UNSIGNED_BYTE, null),
  53023. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_WRAP_S, p.CLAMP_TO_EDGE),
  53024. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_WRAP_T, p.CLAMP_TO_EDGE),
  53025. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_MAG_FILTER, p.NEAREST),
  53026. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_MIN_FILTER, p.NEAREST),
  53027. h = p.getParameter(p.MAX_VERTEX_TEXTURE_IMAGE_UNITS) > 0;
  53028. var i;
  53029. i = h ? {
  53030. 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"),
  53031. 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")
  53032. } : {
  53033. 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"),
  53034. 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")
  53035. },
  53036. s = r(i),
  53037. l = {
  53038. vertex: p.getAttribLocation(s, "position"),
  53039. uv: p.getAttribLocation(s, "uv")
  53040. },
  53041. c = {
  53042. renderType: p.getUniformLocation(s, "renderType"),
  53043. map: p.getUniformLocation(s, "map"),
  53044. occlusionMap: p.getUniformLocation(s, "occlusionMap"),
  53045. opacity: p.getUniformLocation(s, "opacity"),
  53046. color: p.getUniformLocation(s, "color"),
  53047. scale: p.getUniformLocation(s, "scale"),
  53048. rotation: p.getUniformLocation(s, "rotation"),
  53049. screenPosition: p.getUniformLocation(s, "screenPosition")
  53050. }
  53051. }
  53052. function r(t) {
  53053. var i = p.createProgram()
  53054. , n = p.createShader(p.FRAGMENT_SHADER)
  53055. , r = p.createShader(p.VERTEX_SHADER)
  53056. , o = "precision " + e.getPrecision() + " float;\n";
  53057. return p.shaderSource(n, o + t.fragmentShader),
  53058. p.shaderSource(r, o + t.vertexShader),
  53059. p.compileShader(n),
  53060. p.compileShader(r),
  53061. p.attachShader(i, n),
  53062. p.attachShader(i, r),
  53063. p.linkProgram(i),
  53064. i
  53065. }
  53066. var o, a, s, l, c, h, u, d, p = e.context, f = e.state;
  53067. this.render = function(r, g, m) {
  53068. if (0 !== t.length) {
  53069. var v = new n.Vector3
  53070. , A = m.w / m.z
  53071. , y = .5 * m.z
  53072. , C = .5 * m.w
  53073. , I = 16 / m.w
  53074. , E = new n.Vector2(I * A,I)
  53075. , b = new n.Vector3(1,1,0)
  53076. , w = new n.Vector2(1,1);
  53077. void 0 === s && i(),
  53078. p.useProgram(s),
  53079. f.initAttributes(),
  53080. f.enableAttribute(l.vertex),
  53081. f.enableAttribute(l.uv),
  53082. f.disableUnusedAttributes(),
  53083. p.uniform1i(c.occlusionMap, 0),
  53084. p.uniform1i(c.map, 1),
  53085. p.bindBuffer(p.ARRAY_BUFFER, o),
  53086. p.vertexAttribPointer(l.vertex, 2, p.FLOAT, !1, 16, 0),
  53087. p.vertexAttribPointer(l.uv, 2, p.FLOAT, !1, 16, 8),
  53088. p.bindBuffer(p.ELEMENT_ARRAY_BUFFER, a),
  53089. f.disable(p.CULL_FACE),
  53090. f.setDepthWrite(!1);
  53091. for (var _ = 0, T = t.length; _ < T; _++) {
  53092. I = 16 / m.w,
  53093. E.set(I * A, I);
  53094. var x = t[_];
  53095. if (v.set(x.matrixWorld.elements[12], x.matrixWorld.elements[13], x.matrixWorld.elements[14]),
  53096. v.applyMatrix4(g.matrixWorldInverse),
  53097. v.applyProjection(g.projectionMatrix),
  53098. b.copy(v),
  53099. w.x = b.x * y + y,
  53100. w.y = b.y * C + C,
  53101. h || w.x > 0 && w.x < m.z && w.y > 0 && w.y < m.w) {
  53102. f.activeTexture(p.TEXTURE0),
  53103. f.bindTexture(p.TEXTURE_2D, null),
  53104. f.activeTexture(p.TEXTURE1),
  53105. f.bindTexture(p.TEXTURE_2D, u),
  53106. p.copyTexImage2D(p.TEXTURE_2D, 0, p.RGB, m.x + w.x - 8, m.y + w.y - 8, 16, 16, 0),
  53107. p.uniform1i(c.renderType, 0),
  53108. p.uniform2f(c.scale, E.x, E.y),
  53109. p.uniform3f(c.screenPosition, b.x, b.y, b.z),
  53110. f.disable(p.BLEND),
  53111. f.enable(p.DEPTH_TEST),
  53112. p.drawElements(p.TRIANGLES, 6, p.UNSIGNED_SHORT, 0),
  53113. f.activeTexture(p.TEXTURE0),
  53114. f.bindTexture(p.TEXTURE_2D, d),
  53115. p.copyTexImage2D(p.TEXTURE_2D, 0, p.RGBA, m.x + w.x - 8, m.y + w.y - 8, 16, 16, 0),
  53116. p.uniform1i(c.renderType, 1),
  53117. f.disable(p.DEPTH_TEST),
  53118. f.activeTexture(p.TEXTURE1),
  53119. f.bindTexture(p.TEXTURE_2D, u),
  53120. p.drawElements(p.TRIANGLES, 6, p.UNSIGNED_SHORT, 0),
  53121. x.positionScreen.copy(b),
  53122. x.customUpdateCallback ? x.customUpdateCallback(x) : x.updateLensFlares(),
  53123. p.uniform1i(c.renderType, 2),
  53124. f.enable(p.BLEND);
  53125. for (var S = 0, M = x.lensFlares.length; S < M; S++) {
  53126. var R = x.lensFlares[S];
  53127. R.opacity > .001 && R.scale > .001 && (b.x = R.x,
  53128. b.y = R.y,
  53129. b.z = R.z,
  53130. I = R.size * R.scale / m.w,
  53131. E.x = I * A,
  53132. E.y = I,
  53133. p.uniform3f(c.screenPosition, b.x, b.y, b.z),
  53134. p.uniform2f(c.scale, E.x, E.y),
  53135. p.uniform1f(c.rotation, R.rotation),
  53136. p.uniform1f(c.opacity, R.opacity),
  53137. p.uniform3f(c.color, R.color.r, R.color.g, R.color.b),
  53138. f.setBlending(R.blending, R.blendEquation, R.blendSrc, R.blendDst),
  53139. e.setTexture(R.texture, 1),
  53140. p.drawElements(p.TRIANGLES, 6, p.UNSIGNED_SHORT, 0))
  53141. }
  53142. }
  53143. }
  53144. f.enable(p.CULL_FACE),
  53145. f.enable(p.DEPTH_TEST),
  53146. f.setDepthWrite(!0),
  53147. e.resetGLState()
  53148. }
  53149. }
  53150. }
  53151. ,
  53152. n.SpritePlugin = function(e, t) {
  53153. function i() {
  53154. var e = new Float32Array([-.5, -.5, 0, 0, .5, -.5, 1, 0, .5, .5, 1, 1, -.5, .5, 0, 1])
  53155. , t = new Uint16Array([0, 1, 2, 0, 2, 3]);
  53156. a = d.createBuffer(),
  53157. s = d.createBuffer(),
  53158. d.bindBuffer(d.ARRAY_BUFFER, a),
  53159. d.bufferData(d.ARRAY_BUFFER, e, d.STATIC_DRAW),
  53160. d.bindBuffer(d.ELEMENT_ARRAY_BUFFER, s),
  53161. d.bufferData(d.ELEMENT_ARRAY_BUFFER, t, d.STATIC_DRAW),
  53162. l = r(),
  53163. c = {
  53164. position: d.getAttribLocation(l, "position"),
  53165. uv: d.getAttribLocation(l, "uv")
  53166. },
  53167. h = {
  53168. uvOffset: d.getUniformLocation(l, "uvOffset"),
  53169. uvScale: d.getUniformLocation(l, "uvScale"),
  53170. rotation: d.getUniformLocation(l, "rotation"),
  53171. scale: d.getUniformLocation(l, "scale"),
  53172. color: d.getUniformLocation(l, "color"),
  53173. map: d.getUniformLocation(l, "map"),
  53174. opacity: d.getUniformLocation(l, "opacity"),
  53175. modelViewMatrix: d.getUniformLocation(l, "modelViewMatrix"),
  53176. projectionMatrix: d.getUniformLocation(l, "projectionMatrix"),
  53177. fogType: d.getUniformLocation(l, "fogType"),
  53178. fogDensity: d.getUniformLocation(l, "fogDensity"),
  53179. fogNear: d.getUniformLocation(l, "fogNear"),
  53180. fogFar: d.getUniformLocation(l, "fogFar"),
  53181. fogColor: d.getUniformLocation(l, "fogColor"),
  53182. alphaTest: d.getUniformLocation(l, "alphaTest")
  53183. };
  53184. var i = document.createElement("canvas");
  53185. i.width = 8,
  53186. i.height = 8;
  53187. var o = i.getContext("2d");
  53188. o.fillStyle = "white",
  53189. o.fillRect(0, 0, 8, 8),
  53190. u = new n.Texture(i),
  53191. u.needsUpdate = !0
  53192. }
  53193. function r() {
  53194. var t = d.createProgram()
  53195. , i = d.createShader(d.VERTEX_SHADER)
  53196. , n = d.createShader(d.FRAGMENT_SHADER);
  53197. 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")),
  53198. 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")),
  53199. d.compileShader(i),
  53200. d.compileShader(n),
  53201. d.attachShader(t, i),
  53202. d.attachShader(t, n),
  53203. d.linkProgram(t),
  53204. t
  53205. }
  53206. function o(e, t) {
  53207. return e.renderOrder !== t.renderOrder ? e.renderOrder - t.renderOrder : e.z !== t.z ? t.z - e.z : t.id - e.id
  53208. }
  53209. 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;
  53210. this.render = function(r, v) {
  53211. if (0 !== t.length) {
  53212. void 0 === l && i(),
  53213. d.useProgram(l),
  53214. p.initAttributes(),
  53215. p.enableAttribute(c.position),
  53216. p.enableAttribute(c.uv),
  53217. p.disableUnusedAttributes(),
  53218. p.disable(d.CULL_FACE),
  53219. p.enable(d.BLEND),
  53220. d.bindBuffer(d.ARRAY_BUFFER, a),
  53221. d.vertexAttribPointer(c.position, 2, d.FLOAT, !1, 16, 0),
  53222. d.vertexAttribPointer(c.uv, 2, d.FLOAT, !1, 16, 8),
  53223. d.bindBuffer(d.ELEMENT_ARRAY_BUFFER, s),
  53224. d.uniformMatrix4fv(h.projectionMatrix, !1, v.projectionMatrix.elements),
  53225. p.activeTexture(d.TEXTURE0),
  53226. d.uniform1i(h.map, 0);
  53227. var A = 0
  53228. , y = 0
  53229. , C = r.fog;
  53230. C ? (d.uniform3f(h.fogColor, C.color.r, C.color.g, C.color.b),
  53231. C instanceof n.Fog ? (d.uniform1f(h.fogNear, C.near),
  53232. d.uniform1f(h.fogFar, C.far),
  53233. d.uniform1i(h.fogType, 1),
  53234. A = 1,
  53235. y = 1) : C instanceof n.FogExp2 && (d.uniform1f(h.fogDensity, C.density),
  53236. d.uniform1i(h.fogType, 2),
  53237. A = 2,
  53238. y = 2)) : (d.uniform1i(h.fogType, 0),
  53239. A = 0,
  53240. y = 0);
  53241. for (var I = 0, E = t.length; I < E; I++) {
  53242. var b = t[I];
  53243. b.modelViewMatrix.multiplyMatrices(v.matrixWorldInverse, b.matrixWorld),
  53244. b.z = -b.modelViewMatrix.elements[14]
  53245. }
  53246. t.sort(o);
  53247. for (var w = [], I = 0, E = t.length; I < E; I++) {
  53248. var b = t[I]
  53249. , _ = b.material;
  53250. d.uniform1f(h.alphaTest, _.alphaTest),
  53251. d.uniformMatrix4fv(h.modelViewMatrix, !1, b.modelViewMatrix.elements),
  53252. b.matrixWorld.decompose(f, g, m),
  53253. w[0] = m.x,
  53254. w[1] = m.y;
  53255. var T = 0;
  53256. r.fog && _.fog && (T = y),
  53257. A !== T && (d.uniform1i(h.fogType, T),
  53258. A = T),
  53259. null !== _.map ? (d.uniform2f(h.uvOffset, _.map.offset.x, _.map.offset.y),
  53260. d.uniform2f(h.uvScale, _.map.repeat.x, _.map.repeat.y)) : (d.uniform2f(h.uvOffset, 0, 0),
  53261. d.uniform2f(h.uvScale, 1, 1)),
  53262. d.uniform1f(h.opacity, _.opacity),
  53263. d.uniform3f(h.color, _.color.r, _.color.g, _.color.b),
  53264. d.uniform1f(h.rotation, _.rotation),
  53265. d.uniform2fv(h.scale, w),
  53266. p.setBlending(_.blending, _.blendEquation, _.blendSrc, _.blendDst),
  53267. p.setDepthTest(_.depthTest),
  53268. p.setDepthWrite(_.depthWrite),
  53269. _.map && _.map.image && _.map.image.width ? e.setTexture(_.map, 0) : e.setTexture(u, 0),
  53270. d.drawElements(d.TRIANGLES, 6, d.UNSIGNED_SHORT, 0)
  53271. }
  53272. p.enable(d.CULL_FACE),
  53273. e.resetGLState()
  53274. }
  53275. }
  53276. }
  53277. ,
  53278. Object.defineProperties(n.Box2.prototype, {
  53279. empty: {
  53280. value: function() {
  53281. return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."),
  53282. this.isEmpty()
  53283. }
  53284. },
  53285. isIntersectionBox: {
  53286. value: function(e) {
  53287. return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."),
  53288. this.intersectsBox(e)
  53289. }
  53290. }
  53291. }),
  53292. Object.defineProperties(n.Box3.prototype, {
  53293. empty: {
  53294. value: function() {
  53295. return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),
  53296. this.isEmpty()
  53297. }
  53298. },
  53299. isIntersectionBox: {
  53300. value: function(e) {
  53301. return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),
  53302. this.intersectsBox(e)
  53303. }
  53304. },
  53305. isIntersectionSphere: {
  53306. value: function(e) {
  53307. return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),
  53308. this.intersectsSphere(e)
  53309. }
  53310. }
  53311. }),
  53312. Object.defineProperties(n.Matrix3.prototype, {
  53313. multiplyVector3: {
  53314. value: function(e) {
  53315. return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),
  53316. e.applyMatrix3(this)
  53317. }
  53318. },
  53319. multiplyVector3Array: {
  53320. value: function(e) {
  53321. return console.warn("THREE.Matrix3: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead."),
  53322. this.applyToVector3Array(e)
  53323. }
  53324. }
  53325. }),
  53326. Object.defineProperties(n.Matrix4.prototype, {
  53327. extractPosition: {
  53328. value: function(e) {
  53329. return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),
  53330. this.copyPosition(e)
  53331. }
  53332. },
  53333. setRotationFromQuaternion: {
  53334. value: function(e) {
  53335. return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),
  53336. this.makeRotationFromQuaternion(e)
  53337. }
  53338. },
  53339. multiplyVector3: {
  53340. value: function(e) {
  53341. return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) or vector.applyProjection( matrix ) instead."),
  53342. e.applyProjection(this)
  53343. }
  53344. },
  53345. multiplyVector4: {
  53346. value: function(e) {
  53347. return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),
  53348. e.applyMatrix4(this)
  53349. }
  53350. },
  53351. multiplyVector3Array: {
  53352. value: function(e) {
  53353. return console.warn("THREE.Matrix4: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead."),
  53354. this.applyToVector3Array(e)
  53355. }
  53356. },
  53357. rotateAxis: {
  53358. value: function(e) {
  53359. console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),
  53360. e.transformDirection(this)
  53361. }
  53362. },
  53363. crossVector: {
  53364. value: function(e) {
  53365. return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),
  53366. e.applyMatrix4(this)
  53367. }
  53368. },
  53369. translate: {
  53370. value: function(e) {
  53371. console.error("THREE.Matrix4: .translate() has been removed.")
  53372. }
  53373. },
  53374. rotateX: {
  53375. value: function(e) {
  53376. console.error("THREE.Matrix4: .rotateX() has been removed.")
  53377. }
  53378. },
  53379. rotateY: {
  53380. value: function(e) {
  53381. console.error("THREE.Matrix4: .rotateY() has been removed.")
  53382. }
  53383. },
  53384. rotateZ: {
  53385. value: function(e) {
  53386. console.error("THREE.Matrix4: .rotateZ() has been removed.")
  53387. }
  53388. },
  53389. rotateByAxis: {
  53390. value: function(e, t) {
  53391. console.error("THREE.Matrix4: .rotateByAxis() has been removed.")
  53392. }
  53393. }
  53394. }),
  53395. Object.defineProperties(n.Plane.prototype, {
  53396. isIntersectionLine: {
  53397. value: function(e) {
  53398. return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),
  53399. this.intersectsLine(e)
  53400. }
  53401. }
  53402. }),
  53403. Object.defineProperties(n.Quaternion.prototype, {
  53404. multiplyVector3: {
  53405. value: function(e) {
  53406. return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),
  53407. e.applyQuaternion(this)
  53408. }
  53409. }
  53410. }),
  53411. Object.defineProperties(n.Ray.prototype, {
  53412. isIntersectionBox: {
  53413. value: function(e) {
  53414. return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),
  53415. this.intersectsBox(e)
  53416. }
  53417. },
  53418. isIntersectionPlane: {
  53419. value: function(e) {
  53420. return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),
  53421. this.intersectsPlane(e)
  53422. }
  53423. },
  53424. isIntersectionSphere: {
  53425. value: function(e) {
  53426. return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),
  53427. this.intersectsSphere(e)
  53428. }
  53429. }
  53430. }),
  53431. Object.defineProperties(n.Vector3.prototype, {
  53432. setEulerFromRotationMatrix: {
  53433. value: function() {
  53434. console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")
  53435. }
  53436. },
  53437. setEulerFromQuaternion: {
  53438. value: function() {
  53439. console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")
  53440. }
  53441. },
  53442. getPositionFromMatrix: {
  53443. value: function(e) {
  53444. return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),
  53445. this.setFromMatrixPosition(e)
  53446. }
  53447. },
  53448. getScaleFromMatrix: {
  53449. value: function(e) {
  53450. return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),
  53451. this.setFromMatrixScale(e)
  53452. }
  53453. },
  53454. getColumnFromMatrix: {
  53455. value: function(e, t) {
  53456. return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),
  53457. this.setFromMatrixColumn(e, t)
  53458. }
  53459. }
  53460. }),
  53461. n.Face4 = function(e, t, i, r, o, a, s) {
  53462. return console.warn("THREE.Face4 has been removed. A THREE.Face3 will be created instead."),
  53463. new n.Face3(e,t,i,o,a,s)
  53464. }
  53465. ,
  53466. n.Vertex = function(e, t, i) {
  53467. return console.warn("THREE.Vertex has been removed. Use THREE.Vector3 instead."),
  53468. new n.Vector3(e,t,i)
  53469. }
  53470. ,
  53471. Object.defineProperties(n.Object3D.prototype, {
  53472. eulerOrder: {
  53473. get: function() {
  53474. return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),
  53475. this.rotation.order
  53476. },
  53477. set: function(e) {
  53478. console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),
  53479. this.rotation.order = e
  53480. }
  53481. },
  53482. getChildByName: {
  53483. value: function(e) {
  53484. return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),
  53485. this.getObjectByName(e)
  53486. }
  53487. },
  53488. renderDepth: {
  53489. set: function(e) {
  53490. console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")
  53491. }
  53492. },
  53493. translate: {
  53494. value: function(e, t) {
  53495. return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),
  53496. this.translateOnAxis(t, e)
  53497. }
  53498. },
  53499. useQuaternion: {
  53500. get: function() {
  53501. console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")
  53502. },
  53503. set: function(e) {
  53504. console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")
  53505. }
  53506. }
  53507. }),
  53508. Object.defineProperties(n, {
  53509. PointCloud: {
  53510. value: function(e, t) {
  53511. return console.warn("THREE.PointCloud has been renamed to THREE.Points."),
  53512. new n.Points(e,t)
  53513. }
  53514. },
  53515. ParticleSystem: {
  53516. value: function(e, t) {
  53517. return console.warn("THREE.ParticleSystem has been renamed to THREE.Points."),
  53518. new n.Points(e,t)
  53519. }
  53520. }
  53521. }),
  53522. Object.defineProperties(n.Light.prototype, {
  53523. onlyShadow: {
  53524. set: function(e) {
  53525. console.warn("THREE.Light: .onlyShadow has been removed.")
  53526. }
  53527. },
  53528. shadowCameraFov: {
  53529. set: function(e) {
  53530. console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."),
  53531. this.shadow.camera.fov = e
  53532. }
  53533. },
  53534. shadowCameraLeft: {
  53535. set: function(e) {
  53536. console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."),
  53537. this.shadow.camera.left = e
  53538. }
  53539. },
  53540. shadowCameraRight: {
  53541. set: function(e) {
  53542. console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),
  53543. this.shadow.camera.right = e
  53544. }
  53545. },
  53546. shadowCameraTop: {
  53547. set: function(e) {
  53548. console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),
  53549. this.shadow.camera.top = e
  53550. }
  53551. },
  53552. shadowCameraBottom: {
  53553. set: function(e) {
  53554. console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),
  53555. this.shadow.camera.bottom = e
  53556. }
  53557. },
  53558. shadowCameraNear: {
  53559. set: function(e) {
  53560. console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),
  53561. this.shadow.camera.near = e
  53562. }
  53563. },
  53564. shadowCameraFar: {
  53565. set: function(e) {
  53566. console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),
  53567. this.shadow.camera.far = e
  53568. }
  53569. },
  53570. shadowCameraVisible: {
  53571. set: function(e) {
  53572. console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")
  53573. }
  53574. },
  53575. shadowBias: {
  53576. set: function(e) {
  53577. console.warn("THREE.Light: .shadowBias is now .shadow.bias."),
  53578. this.shadow.bias = e
  53579. }
  53580. },
  53581. shadowDarkness: {
  53582. set: function(e) {
  53583. console.warn("THREE.Light: .shadowDarkness has been removed.")
  53584. }
  53585. },
  53586. shadowMapWidth: {
  53587. set: function(e) {
  53588. console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),
  53589. this.shadow.mapSize.width = e
  53590. }
  53591. },
  53592. shadowMapHeight: {
  53593. set: function(e) {
  53594. console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),
  53595. this.shadow.mapSize.height = e
  53596. }
  53597. }
  53598. }),
  53599. Object.defineProperties(n.BufferAttribute.prototype, {
  53600. length: {
  53601. get: function() {
  53602. return console.warn("THREE.BufferAttribute: .length has been deprecated. Please use .count."),
  53603. this.array.length
  53604. }
  53605. }
  53606. }),
  53607. Object.defineProperties(n.BufferGeometry.prototype, {
  53608. drawcalls: {
  53609. get: function() {
  53610. return console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups."),
  53611. this.groups
  53612. }
  53613. },
  53614. offsets: {
  53615. get: function() {
  53616. return console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups."),
  53617. this.groups
  53618. }
  53619. },
  53620. addIndex: {
  53621. value: function(e) {
  53622. console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),
  53623. this.setIndex(e)
  53624. }
  53625. },
  53626. addDrawCall: {
  53627. value: function(e, t, i) {
  53628. void 0 !== i && console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),
  53629. console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),
  53630. this.addGroup(e, t)
  53631. }
  53632. },
  53633. clearDrawCalls: {
  53634. value: function() {
  53635. console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."),
  53636. this.clearGroups()
  53637. }
  53638. },
  53639. computeTangents: {
  53640. value: function() {
  53641. console.warn("THREE.BufferGeometry: .computeTangents() has been removed.")
  53642. }
  53643. },
  53644. computeOffsets: {
  53645. value: function() {
  53646. console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")
  53647. }
  53648. }
  53649. }),
  53650. Object.defineProperties(n.Material.prototype, {
  53651. wrapAround: {
  53652. get: function() {
  53653. console.warn("THREE." + this.type + ": .wrapAround has been removed.")
  53654. },
  53655. set: function(e) {
  53656. console.warn("THREE." + this.type + ": .wrapAround has been removed.")
  53657. }
  53658. },
  53659. wrapRGB: {
  53660. get: function() {
  53661. return console.warn("THREE." + this.type + ": .wrapRGB has been removed."),
  53662. new n.Color
  53663. }
  53664. }
  53665. }),
  53666. Object.defineProperties(n, {
  53667. PointCloudMaterial: {
  53668. value: function(e) {
  53669. return console.warn("THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial."),
  53670. new n.PointsMaterial(e)
  53671. }
  53672. },
  53673. ParticleBasicMaterial: {
  53674. value: function(e) {
  53675. return console.warn("THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial."),
  53676. new n.PointsMaterial(e)
  53677. }
  53678. },
  53679. ParticleSystemMaterial: {
  53680. value: function(e) {
  53681. return console.warn("THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial."),
  53682. new n.PointsMaterial(e)
  53683. }
  53684. }
  53685. }),
  53686. Object.defineProperties(n.MeshPhongMaterial.prototype, {
  53687. metal: {
  53688. get: function() {
  53689. return console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead."),
  53690. !1
  53691. },
  53692. set: function(e) {
  53693. console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead")
  53694. }
  53695. }
  53696. }),
  53697. Object.defineProperties(n.ShaderMaterial.prototype, {
  53698. derivatives: {
  53699. get: function() {
  53700. return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),
  53701. this.extensions.derivatives
  53702. },
  53703. set: function(e) {
  53704. console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),
  53705. this.extensions.derivatives = e
  53706. }
  53707. }
  53708. }),
  53709. Object.defineProperties(n.WebGLRenderer.prototype, {
  53710. supportsFloatTextures: {
  53711. value: function() {
  53712. return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."),
  53713. this.extensions.get("OES_texture_float")
  53714. }
  53715. },
  53716. supportsHalfFloatTextures: {
  53717. value: function() {
  53718. return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."),
  53719. this.extensions.get("OES_texture_half_float")
  53720. }
  53721. },
  53722. supportsStandardDerivatives: {
  53723. value: function() {
  53724. return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."),
  53725. this.extensions.get("OES_standard_derivatives")
  53726. }
  53727. },
  53728. supportsCompressedTextureS3TC: {
  53729. value: function() {
  53730. return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),
  53731. this.extensions.get("WEBGL_compressed_texture_s3tc")
  53732. }
  53733. },
  53734. supportsCompressedTexturePVRTC: {
  53735. value: function() {
  53736. return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),
  53737. this.extensions.get("WEBGL_compressed_texture_pvrtc")
  53738. }
  53739. },
  53740. supportsBlendMinMax: {
  53741. value: function() {
  53742. return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."),
  53743. this.extensions.get("EXT_blend_minmax")
  53744. }
  53745. },
  53746. supportsVertexTextures: {
  53747. value: function() {
  53748. return this.capabilities.vertexTextures
  53749. }
  53750. },
  53751. supportsInstancedArrays: {
  53752. value: function() {
  53753. return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."),
  53754. this.extensions.get("ANGLE_instanced_arrays")
  53755. }
  53756. },
  53757. enableScissorTest: {
  53758. value: function(e) {
  53759. console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),
  53760. this.setScissorTest(e)
  53761. }
  53762. },
  53763. initMaterial: {
  53764. value: function() {
  53765. console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")
  53766. }
  53767. },
  53768. addPrePlugin: {
  53769. value: function() {
  53770. console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")
  53771. }
  53772. },
  53773. addPostPlugin: {
  53774. value: function() {
  53775. console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")
  53776. }
  53777. },
  53778. updateShadowMap: {
  53779. value: function() {
  53780. console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")
  53781. }
  53782. },
  53783. shadowMapEnabled: {
  53784. get: function() {
  53785. return this.shadowMap.enabled
  53786. },
  53787. set: function(e) {
  53788. console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),
  53789. this.shadowMap.enabled = e
  53790. }
  53791. },
  53792. shadowMapType: {
  53793. get: function() {
  53794. return this.shadowMap.type
  53795. },
  53796. set: function(e) {
  53797. console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),
  53798. this.shadowMap.type = e
  53799. }
  53800. },
  53801. shadowMapCullFace: {
  53802. get: function() {
  53803. return this.shadowMap.cullFace
  53804. },
  53805. set: function(e) {
  53806. console.warn("THREE.WebGLRenderer: .shadowMapCullFace is now .shadowMap.cullFace."),
  53807. this.shadowMap.cullFace = e
  53808. }
  53809. }
  53810. }),
  53811. Object.defineProperties(n.WebGLRenderTarget.prototype, {
  53812. wrapS: {
  53813. get: function() {
  53814. return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),
  53815. this.texture.wrapS
  53816. },
  53817. set: function(e) {
  53818. console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),
  53819. this.texture.wrapS = e
  53820. }
  53821. },
  53822. wrapT: {
  53823. get: function() {
  53824. return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),
  53825. this.texture.wrapT
  53826. },
  53827. set: function(e) {
  53828. console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),
  53829. this.texture.wrapT = e
  53830. }
  53831. },
  53832. magFilter: {
  53833. get: function() {
  53834. return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),
  53835. this.texture.magFilter
  53836. },
  53837. set: function(e) {
  53838. console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),
  53839. this.texture.magFilter = e
  53840. }
  53841. },
  53842. minFilter: {
  53843. get: function() {
  53844. return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),
  53845. this.texture.minFilter
  53846. },
  53847. set: function(e) {
  53848. console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),
  53849. this.texture.minFilter = e
  53850. }
  53851. },
  53852. anisotropy: {
  53853. get: function() {
  53854. return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),
  53855. this.texture.anisotropy
  53856. },
  53857. set: function(e) {
  53858. console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),
  53859. this.texture.anisotropy = e
  53860. }
  53861. },
  53862. offset: {
  53863. get: function() {
  53864. return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),
  53865. this.texture.offset
  53866. },
  53867. set: function(e) {
  53868. console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),
  53869. this.texture.offset = e
  53870. }
  53871. },
  53872. repeat: {
  53873. get: function() {
  53874. return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),
  53875. this.texture.repeat
  53876. },
  53877. set: function(e) {
  53878. console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),
  53879. this.texture.repeat = e
  53880. }
  53881. },
  53882. format: {
  53883. get: function() {
  53884. return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),
  53885. this.texture.format
  53886. },
  53887. set: function(e) {
  53888. console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),
  53889. this.texture.format = e
  53890. }
  53891. },
  53892. type: {
  53893. get: function() {
  53894. return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),
  53895. this.texture.type
  53896. },
  53897. set: function(e) {
  53898. console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),
  53899. this.texture.type = e
  53900. }
  53901. },
  53902. generateMipmaps: {
  53903. get: function() {
  53904. return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),
  53905. this.texture.generateMipmaps
  53906. },
  53907. set: function(e) {
  53908. console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),
  53909. this.texture.generateMipmaps = e
  53910. }
  53911. }
  53912. }),
  53913. n.GeometryUtils = {
  53914. merge: function(e, t, i) {
  53915. console.warn("THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead.");
  53916. var r;
  53917. t instanceof n.Mesh && (t.matrixAutoUpdate && t.updateMatrix(),
  53918. r = t.matrix,
  53919. t = t.geometry),
  53920. e.merge(t, r, i)
  53921. },
  53922. center: function(e) {
  53923. return console.warn("THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead."),
  53924. e.center()
  53925. }
  53926. },
  53927. n.ImageUtils = {
  53928. crossOrigin: void 0,
  53929. loadTexture: function(e, t, i, r) {
  53930. console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");
  53931. var o = new n.TextureLoader;
  53932. o.setCrossOrigin(this.crossOrigin);
  53933. var a = o.load(e, i, void 0, r);
  53934. return t && (a.mapping = t),
  53935. a
  53936. },
  53937. loadTextureCube: function(e, t, i, r) {
  53938. console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");
  53939. var o = new n.CubeTextureLoader;
  53940. o.setCrossOrigin(this.crossOrigin);
  53941. var a = o.load(e, i, void 0, r);
  53942. return t && (a.mapping = t),
  53943. a
  53944. },
  53945. loadCompressedTexture: function() {
  53946. console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")
  53947. },
  53948. loadCompressedTextureCube: function() {
  53949. console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")
  53950. }
  53951. },
  53952. n.Projector = function() {
  53953. console.error("THREE.Projector has been moved to /examples/js/renderers/Projector.js."),
  53954. this.projectVector = function(e, t) {
  53955. console.warn("THREE.Projector: .projectVector() is now vector.project()."),
  53956. e.project(t)
  53957. }
  53958. ,
  53959. this.unprojectVector = function(e, t) {
  53960. console.warn("THREE.Projector: .unprojectVector() is now vector.unproject()."),
  53961. e.unproject(t)
  53962. }
  53963. ,
  53964. this.pickingRay = function(e, t) {
  53965. console.error("THREE.Projector: .pickingRay() is now raycaster.setFromCamera().")
  53966. }
  53967. }
  53968. ,
  53969. n.CanvasRenderer = function() {
  53970. console.error("THREE.CanvasRenderer has been moved to /examples/js/renderers/CanvasRenderer.js"),
  53971. this.domElement = document.createElement("canvas"),
  53972. this.clear = function() {}
  53973. ,
  53974. this.render = function() {}
  53975. ,
  53976. this.setClearColor = function() {}
  53977. ,
  53978. this.setSize = function() {}
  53979. }
  53980. ,
  53981. n.MeshFaceMaterial = n.MultiMaterial,
  53982. n.CurveUtils = {
  53983. tangentQuadraticBezier: function(e, t, i, n) {
  53984. return 2 * (1 - e) * (i - t) + 2 * e * (n - i)
  53985. },
  53986. tangentCubicBezier: function(e, t, i, n, r) {
  53987. 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
  53988. },
  53989. tangentSpline: function(e, t, i, n, r) {
  53990. var o = 6 * e * e - 6 * e
  53991. , a = 3 * e * e - 4 * e + 1
  53992. , s = -6 * e * e + 6 * e
  53993. , l = 3 * e * e - 2 * e;
  53994. return o + a + s + l
  53995. },
  53996. interpolate: function(e, t, i, n, r) {
  53997. var o = .5 * (i - e)
  53998. , a = .5 * (n - t)
  53999. , s = r * r
  54000. , l = r * s;
  54001. return (2 * t - 2 * i + o + a) * l + (-3 * t + 3 * i - 2 * o - a) * s + o * r + t
  54002. }
  54003. },
  54004. n.SceneUtils = {
  54005. createMultiMaterialObject: function(e, t) {
  54006. for (var i = new n.Group, r = 0, o = t.length; r < o; r++)
  54007. i.add(new n.Mesh(e,t[r]));
  54008. return i
  54009. },
  54010. detach: function(e, t, i) {
  54011. e.applyMatrix(t.matrixWorld),
  54012. t.remove(e),
  54013. i.add(e)
  54014. },
  54015. attach: function(e, t, i) {
  54016. var r = new n.Matrix4;
  54017. r.getInverse(i.matrixWorld),
  54018. e.applyMatrix(r),
  54019. t.remove(e),
  54020. i.add(e)
  54021. }
  54022. },
  54023. n.ShapeUtils = {
  54024. area: function(e) {
  54025. for (var t = e.length, i = 0, n = t - 1, r = 0; r < t; n = r++)
  54026. i += e[n].x * e[r].y - e[r].x * e[n].y;
  54027. return .5 * i
  54028. },
  54029. triangulate: function() {
  54030. function e(e, t, i, n, r, o) {
  54031. var a, s, l, c, h, u, d, p, f;
  54032. if (s = e[o[t]].x,
  54033. l = e[o[t]].y,
  54034. c = e[o[i]].x,
  54035. h = e[o[i]].y,
  54036. u = e[o[n]].x,
  54037. d = e[o[n]].y,
  54038. Number.EPSILON > (c - s) * (d - l) - (h - l) * (u - s))
  54039. return !1;
  54040. var g, m, v, A, y, C, I, E, b, w, _, T, x, S, M;
  54041. for (g = u - c,
  54042. m = d - h,
  54043. v = s - u,
  54044. A = l - d,
  54045. y = c - s,
  54046. C = h - l,
  54047. a = 0; a < r; a++)
  54048. if (p = e[o[a]].x,
  54049. f = e[o[a]].y,
  54050. !(p === s && f === l || p === c && f === h || p === u && f === d) && (I = p - s,
  54051. E = f - l,
  54052. b = p - c,
  54053. w = f - h,
  54054. _ = p - u,
  54055. T = f - d,
  54056. M = g * w - m * b,
  54057. x = y * E - C * I,
  54058. S = v * T - A * _,
  54059. M >= -Number.EPSILON && S >= -Number.EPSILON && x >= -Number.EPSILON))
  54060. return !1;
  54061. return !0
  54062. }
  54063. return function(t, i) {
  54064. var r = t.length;
  54065. if (r < 3)
  54066. return null;
  54067. var o, a, s, l = [], c = [], h = [];
  54068. if (n.ShapeUtils.area(t) > 0)
  54069. for (a = 0; a < r; a++)
  54070. c[a] = a;
  54071. else
  54072. for (a = 0; a < r; a++)
  54073. c[a] = r - 1 - a;
  54074. var u = r
  54075. , d = 2 * u;
  54076. for (a = u - 1; u > 2; ) {
  54077. if (d-- <= 0)
  54078. return console.warn("THREE.ShapeUtils: Unable to triangulate polygon! in triangulate()"),
  54079. i ? h : l;
  54080. if (o = a,
  54081. u <= o && (o = 0),
  54082. a = o + 1,
  54083. u <= a && (a = 0),
  54084. s = a + 1,
  54085. u <= s && (s = 0),
  54086. e(t, o, a, s, u, c)) {
  54087. var p, f, g, m, v;
  54088. for (p = c[o],
  54089. f = c[a],
  54090. g = c[s],
  54091. l.push([t[p], t[f], t[g]]),
  54092. h.push([c[o], c[a], c[s]]),
  54093. m = a,
  54094. v = a + 1; v < u; m++,
  54095. v++)
  54096. c[m] = c[v];
  54097. u--,
  54098. d = 2 * u
  54099. }
  54100. }
  54101. return i ? h : l
  54102. }
  54103. }(),
  54104. triangulateShape: function(e, t) {
  54105. function i(e, t, i) {
  54106. 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
  54107. }
  54108. function r(e, t, n, r, o) {
  54109. var a = t.x - e.x
  54110. , s = t.y - e.y
  54111. , l = r.x - n.x
  54112. , c = r.y - n.y
  54113. , h = e.x - n.x
  54114. , u = e.y - n.y
  54115. , d = s * l - a * c
  54116. , p = s * h - a * u;
  54117. if (Math.abs(d) > Number.EPSILON) {
  54118. var f;
  54119. if (d > 0) {
  54120. if (p < 0 || p > d)
  54121. return [];
  54122. if (f = c * h - l * u,
  54123. f < 0 || f > d)
  54124. return []
  54125. } else {
  54126. if (p > 0 || p < d)
  54127. return [];
  54128. if (f = c * h - l * u,
  54129. f > 0 || f < d)
  54130. return []
  54131. }
  54132. if (0 === f)
  54133. return !o || 0 !== p && p !== d ? [e] : [];
  54134. if (f === d)
  54135. return !o || 0 !== p && p !== d ? [t] : [];
  54136. if (0 === p)
  54137. return [n];
  54138. if (p === d)
  54139. return [r];
  54140. var g = f / d;
  54141. return [{
  54142. x: e.x + g * a,
  54143. y: e.y + g * s
  54144. }]
  54145. }
  54146. if (0 !== p || c * h !== l * u)
  54147. return [];
  54148. var m = 0 === a && 0 === s
  54149. , v = 0 === l && 0 === c;
  54150. if (m && v)
  54151. return e.x !== n.x || e.y !== n.y ? [] : [e];
  54152. if (m)
  54153. return i(n, r, e) ? [e] : [];
  54154. if (v)
  54155. return i(e, t, n) ? [n] : [];
  54156. var A, y, C, I, E, b, w, _;
  54157. return 0 !== a ? (e.x < t.x ? (A = e,
  54158. C = e.x,
  54159. y = t,
  54160. I = t.x) : (A = t,
  54161. C = t.x,
  54162. y = e,
  54163. I = e.x),
  54164. n.x < r.x ? (E = n,
  54165. w = n.x,
  54166. b = r,
  54167. _ = r.x) : (E = r,
  54168. w = r.x,
  54169. b = n,
  54170. _ = n.x)) : (e.y < t.y ? (A = e,
  54171. C = e.y,
  54172. y = t,
  54173. I = t.y) : (A = t,
  54174. C = t.y,
  54175. y = e,
  54176. I = e.y),
  54177. n.y < r.y ? (E = n,
  54178. w = n.y,
  54179. b = r,
  54180. _ = r.y) : (E = r,
  54181. w = r.y,
  54182. b = n,
  54183. _ = n.y)),
  54184. C <= w ? I < w ? [] : I === w ? o ? [] : [E] : I <= _ ? [E, y] : [E, b] : C > _ ? [] : C === _ ? o ? [] : [A] : I <= _ ? [A, y] : [A, b]
  54185. }
  54186. function o(e, t, i, n) {
  54187. var r = t.x - e.x
  54188. , o = t.y - e.y
  54189. , a = i.x - e.x
  54190. , s = i.y - e.y
  54191. , l = n.x - e.x
  54192. , c = n.y - e.y
  54193. , h = r * s - o * a
  54194. , u = r * c - o * l;
  54195. if (Math.abs(h) > Number.EPSILON) {
  54196. var d = l * s - c * a;
  54197. return h > 0 ? u >= 0 && d >= 0 : u >= 0 || d >= 0
  54198. }
  54199. return u > 0
  54200. }
  54201. function a(e, t) {
  54202. function i(e, t) {
  54203. var i = A.length - 1
  54204. , n = e - 1;
  54205. n < 0 && (n = i);
  54206. var r = e + 1;
  54207. r > i && (r = 0);
  54208. var a = o(A[e], A[n], A[r], s[t]);
  54209. if (!a)
  54210. return !1;
  54211. var l = s.length - 1
  54212. , c = t - 1;
  54213. c < 0 && (c = l);
  54214. var h = t + 1;
  54215. return h > l && (h = 0),
  54216. a = o(s[t], s[c], s[h], A[e]),
  54217. !!a
  54218. }
  54219. function n(e, t) {
  54220. var i, n, o;
  54221. for (i = 0; i < A.length; i++)
  54222. if (n = i + 1,
  54223. n %= A.length,
  54224. o = r(e, t, A[i], A[n], !0),
  54225. o.length > 0)
  54226. return !0;
  54227. return !1
  54228. }
  54229. function a(e, i) {
  54230. var n, o, a, s, l;
  54231. for (n = 0; n < y.length; n++)
  54232. for (o = t[y[n]],
  54233. a = 0; a < o.length; a++)
  54234. if (s = a + 1,
  54235. s %= o.length,
  54236. l = r(e, i, o[a], o[s], !0),
  54237. l.length > 0)
  54238. return !0;
  54239. return !1
  54240. }
  54241. 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++)
  54242. y.push(I);
  54243. for (var b = 0, w = 2 * y.length; y.length > 0; ) {
  54244. if (w--,
  54245. w < 0) {
  54246. console.log("Infinite Loop! Holes left:" + y.length + ", Probably Hole outside Shape!");
  54247. break
  54248. }
  54249. for (c = b; c < A.length; c++) {
  54250. h = A[c],
  54251. l = -1;
  54252. for (var I = 0; I < y.length; I++)
  54253. if (d = y[I],
  54254. p = h.x + ":" + h.y + ":" + d,
  54255. void 0 === C[p]) {
  54256. s = t[d];
  54257. for (var _ = 0; _ < s.length; _++)
  54258. if (u = s[_],
  54259. i(c, _) && !n(h, u) && !a(h, u)) {
  54260. l = _,
  54261. y.splice(I, 1),
  54262. f = A.slice(0, c + 1),
  54263. g = A.slice(c),
  54264. m = s.slice(l),
  54265. v = s.slice(0, l + 1),
  54266. A = f.concat(m).concat(v).concat(g),
  54267. b = c;
  54268. break
  54269. }
  54270. if (l >= 0)
  54271. break;
  54272. C[p] = !0
  54273. }
  54274. if (l >= 0)
  54275. break
  54276. }
  54277. }
  54278. return A
  54279. }
  54280. for (var s, l, c, h, u, d, p = {}, f = e.concat(), g = 0, m = t.length; g < m; g++)
  54281. Array.prototype.push.apply(f, t[g]);
  54282. for (s = 0,
  54283. l = f.length; s < l; s++)
  54284. u = f[s].x + ":" + f[s].y,
  54285. void 0 !== p[u] && console.warn("THREE.Shape: Duplicate point", u),
  54286. p[u] = s;
  54287. var v = a(e, t)
  54288. , A = n.ShapeUtils.triangulate(v, !1);
  54289. for (s = 0,
  54290. l = A.length; s < l; s++)
  54291. for (h = A[s],
  54292. c = 0; c < 3; c++)
  54293. u = h[c].x + ":" + h[c].y,
  54294. d = p[u],
  54295. void 0 !== d && (h[c] = d);
  54296. return A.concat()
  54297. },
  54298. isClockWise: function(e) {
  54299. return n.ShapeUtils.area(e) < 0
  54300. },
  54301. b2: function() {
  54302. function e(e, t) {
  54303. var i = 1 - e;
  54304. return i * i * t
  54305. }
  54306. function t(e, t) {
  54307. return 2 * (1 - e) * e * t
  54308. }
  54309. function i(e, t) {
  54310. return e * e * t
  54311. }
  54312. return function(n, r, o, a) {
  54313. return e(n, r) + t(n, o) + i(n, a)
  54314. }
  54315. }(),
  54316. b3: function() {
  54317. function e(e, t) {
  54318. var i = 1 - e;
  54319. return i * i * i * t
  54320. }
  54321. function t(e, t) {
  54322. var i = 1 - e;
  54323. return 3 * i * i * e * t
  54324. }
  54325. function i(e, t) {
  54326. var i = 1 - e;
  54327. return 3 * i * e * e * t
  54328. }
  54329. function n(e, t) {
  54330. return e * e * e * t
  54331. }
  54332. return function(r, o, a, s, l) {
  54333. return e(r, o) + t(r, a) + i(r, s) + n(r, l)
  54334. }
  54335. }()
  54336. },
  54337. n.Curve = function() {}
  54338. ,
  54339. n.Curve.prototype = {
  54340. constructor: n.Curve,
  54341. getPoint: function(e) {
  54342. return console.warn("THREE.Curve: Warning, getPoint() not implemented!"),
  54343. null
  54344. },
  54345. getPointAt: function(e) {
  54346. var t = this.getUtoTmapping(e);
  54347. return this.getPoint(t)
  54348. },
  54349. getPoints: function(e) {
  54350. e || (e = 5);
  54351. var t, i = [];
  54352. for (t = 0; t <= e; t++)
  54353. i.push(this.getPoint(t / e));
  54354. return i
  54355. },
  54356. getSpacedPoints: function(e) {
  54357. e || (e = 5);
  54358. var t, i = [];
  54359. for (t = 0; t <= e; t++)
  54360. i.push(this.getPointAt(t / e));
  54361. return i
  54362. },
  54363. getLength: function() {
  54364. var e = this.getLengths();
  54365. return e[e.length - 1]
  54366. },
  54367. getLengths: function(e) {
  54368. if (e || (e = this.__arcLengthDivisions ? this.__arcLengthDivisions : 200),
  54369. this.cacheArcLengths && this.cacheArcLengths.length === e + 1 && !this.needsUpdate)
  54370. return this.cacheArcLengths;
  54371. this.needsUpdate = !1;
  54372. var t, i, n = [], r = this.getPoint(0), o = 0;
  54373. for (n.push(0),
  54374. i = 1; i <= e; i++)
  54375. t = this.getPoint(i / e),
  54376. o += t.distanceTo(r),
  54377. n.push(o),
  54378. r = t;
  54379. return this.cacheArcLengths = n,
  54380. n
  54381. },
  54382. updateArcLengths: function() {
  54383. this.needsUpdate = !0,
  54384. this.getLengths()
  54385. },
  54386. getUtoTmapping: function(e, t) {
  54387. var i, n = this.getLengths(), r = 0, o = n.length;
  54388. i = t ? t : e * n[o - 1];
  54389. for (var a, s = 0, l = o - 1; s <= l; )
  54390. if (r = Math.floor(s + (l - s) / 2),
  54391. a = n[r] - i,
  54392. a < 0)
  54393. s = r + 1;
  54394. else {
  54395. if (!(a > 0)) {
  54396. l = r;
  54397. break
  54398. }
  54399. l = r - 1
  54400. }
  54401. if (r = l,
  54402. n[r] === i) {
  54403. var c = r / (o - 1);
  54404. return c
  54405. }
  54406. var h = n[r]
  54407. , u = n[r + 1]
  54408. , d = u - h
  54409. , p = (i - h) / d
  54410. , c = (r + p) / (o - 1);
  54411. return c
  54412. },
  54413. getTangent: function(e) {
  54414. var t = 1e-4
  54415. , i = e - t
  54416. , n = e + t;
  54417. i < 0 && (i = 0),
  54418. n > 1 && (n = 1);
  54419. var r = this.getPoint(i)
  54420. , o = this.getPoint(n)
  54421. , a = o.clone().sub(r);
  54422. return a.normalize()
  54423. },
  54424. getTangentAt: function(e) {
  54425. var t = this.getUtoTmapping(e);
  54426. return this.getTangent(t)
  54427. }
  54428. },
  54429. n.Curve.create = function(e, t) {
  54430. return e.prototype = Object.create(n.Curve.prototype),
  54431. e.prototype.constructor = e,
  54432. e.prototype.getPoint = t,
  54433. e
  54434. }
  54435. ,
  54436. n.CurvePath = function() {
  54437. this.curves = [],
  54438. this.autoClose = !1
  54439. }
  54440. ,
  54441. n.CurvePath.prototype = Object.create(n.Curve.prototype),
  54442. n.CurvePath.prototype.constructor = n.CurvePath,
  54443. n.CurvePath.prototype.add = function(e) {
  54444. this.curves.push(e)
  54445. }
  54446. ,
  54447. n.CurvePath.prototype.closePath = function() {
  54448. var e = this.curves[0].getPoint(0)
  54449. , t = this.curves[this.curves.length - 1].getPoint(1);
  54450. e.equals(t) || this.curves.push(new n.LineCurve(t,e))
  54451. }
  54452. ,
  54453. n.CurvePath.prototype.getPoint = function(e) {
  54454. for (var t = e * this.getLength(), i = this.getCurveLengths(), n = 0; n < i.length; ) {
  54455. if (i[n] >= t) {
  54456. var r = i[n] - t
  54457. , o = this.curves[n]
  54458. , a = 1 - r / o.getLength();
  54459. return o.getPointAt(a)
  54460. }
  54461. n++
  54462. }
  54463. return null
  54464. }
  54465. ,
  54466. n.CurvePath.prototype.getLength = function() {
  54467. var e = this.getCurveLengths();
  54468. return e[e.length - 1]
  54469. }
  54470. ,
  54471. n.CurvePath.prototype.getCurveLengths = function() {
  54472. if (this.cacheLengths && this.cacheLengths.length === this.curves.length)
  54473. return this.cacheLengths;
  54474. for (var e = [], t = 0, i = 0, n = this.curves.length; i < n; i++)
  54475. t += this.curves[i].getLength(),
  54476. e.push(t);
  54477. return this.cacheLengths = e,
  54478. e
  54479. }
  54480. ,
  54481. n.CurvePath.prototype.createPointsGeometry = function(e) {
  54482. var t = this.getPoints(e);
  54483. return this.createGeometry(t)
  54484. }
  54485. ,
  54486. n.CurvePath.prototype.createSpacedPointsGeometry = function(e) {
  54487. var t = this.getSpacedPoints(e);
  54488. return this.createGeometry(t)
  54489. }
  54490. ,
  54491. n.CurvePath.prototype.createGeometry = function(e) {
  54492. for (var t = new n.Geometry, i = 0, r = e.length; i < r; i++) {
  54493. var o = e[i];
  54494. t.vertices.push(new n.Vector3(o.x,o.y,o.z || 0))
  54495. }
  54496. return t
  54497. }
  54498. ,
  54499. n.Font = function(e) {
  54500. this.data = e
  54501. }
  54502. ,
  54503. n.Font.prototype = {
  54504. constructor: n.Font,
  54505. generateShapes: function(e, t, i) {
  54506. function r(e) {
  54507. for (var i = String(e).split(""), n = t / a.resolution, r = 0, s = [], l = 0; l < i.length; l++) {
  54508. var c = o(i[l], n, r);
  54509. r += c.offset,
  54510. s.push(c.path)
  54511. }
  54512. return s
  54513. }
  54514. function o(e, t, r) {
  54515. var o = a.glyphs[e] || a.glyphs["?"];
  54516. if (o) {
  54517. 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;
  54518. if (o.o)
  54519. for (var E = o._cachedOutline || (o._cachedOutline = o.o.split(" ")), b = 0, w = E.length; b < w; ) {
  54520. var _ = E[b++];
  54521. switch (_) {
  54522. case "m":
  54523. s = E[b++] * t + r,
  54524. l = E[b++] * t,
  54525. A.moveTo(s, l);
  54526. break;
  54527. case "l":
  54528. s = E[b++] * t + r,
  54529. l = E[b++] * t,
  54530. A.lineTo(s, l);
  54531. break;
  54532. case "q":
  54533. if (c = E[b++] * t + r,
  54534. h = E[b++] * t,
  54535. p = E[b++] * t + r,
  54536. f = E[b++] * t,
  54537. A.quadraticCurveTo(p, f, c, h),
  54538. v = y[y.length - 1]) {
  54539. u = v.x,
  54540. d = v.y;
  54541. for (var T = 1; T <= i; T++) {
  54542. var x = T / i;
  54543. C(x, u, p, c),
  54544. C(x, d, f, h)
  54545. }
  54546. }
  54547. break;
  54548. case "b":
  54549. if (c = E[b++] * t + r,
  54550. h = E[b++] * t,
  54551. p = E[b++] * t + r,
  54552. f = E[b++] * t,
  54553. g = E[b++] * t + r,
  54554. m = E[b++] * t,
  54555. A.bezierCurveTo(p, f, g, m, c, h),
  54556. v = y[y.length - 1]) {
  54557. u = v.x,
  54558. d = v.y;
  54559. for (var T = 1; T <= i; T++) {
  54560. var x = T / i;
  54561. I(x, u, p, g, c),
  54562. I(x, d, f, m, h)
  54563. }
  54564. }
  54565. }
  54566. }
  54567. return {
  54568. offset: o.ha * t,
  54569. path: A
  54570. }
  54571. }
  54572. }
  54573. void 0 === t && (t = 100),
  54574. void 0 === i && (i = 4);
  54575. for (var a = this.data, s = r(e), l = [], c = 0, h = s.length; c < h; c++)
  54576. Array.prototype.push.apply(l, s[c].toShapes());
  54577. return l
  54578. }
  54579. },
  54580. n.Path = function(e) {
  54581. n.CurvePath.call(this),
  54582. this.actions = [],
  54583. e && this.fromPoints(e)
  54584. }
  54585. ,
  54586. n.Path.prototype = Object.create(n.CurvePath.prototype),
  54587. n.Path.prototype.constructor = n.Path,
  54588. n.Path.prototype.fromPoints = function(e) {
  54589. this.moveTo(e[0].x, e[0].y);
  54590. for (var t = 1, i = e.length; t < i; t++)
  54591. this.lineTo(e[t].x, e[t].y)
  54592. }
  54593. ,
  54594. n.Path.prototype.moveTo = function(e, t) {
  54595. this.actions.push({
  54596. action: "moveTo",
  54597. args: [e, t]
  54598. })
  54599. }
  54600. ,
  54601. n.Path.prototype.lineTo = function(e, t) {
  54602. var i = this.actions[this.actions.length - 1].args
  54603. , r = i[i.length - 2]
  54604. , o = i[i.length - 1]
  54605. , a = new n.LineCurve(new n.Vector2(r,o),new n.Vector2(e,t));
  54606. this.curves.push(a),
  54607. this.actions.push({
  54608. action: "lineTo",
  54609. args: [e, t]
  54610. })
  54611. }
  54612. ,
  54613. n.Path.prototype.quadraticCurveTo = function(e, t, i, r) {
  54614. var o = this.actions[this.actions.length - 1].args
  54615. , a = o[o.length - 2]
  54616. , s = o[o.length - 1]
  54617. , l = new n.QuadraticBezierCurve(new n.Vector2(a,s),new n.Vector2(e,t),new n.Vector2(i,r));
  54618. this.curves.push(l),
  54619. this.actions.push({
  54620. action: "quadraticCurveTo",
  54621. args: [e, t, i, r]
  54622. })
  54623. }
  54624. ,
  54625. n.Path.prototype.bezierCurveTo = function(e, t, i, r, o, a) {
  54626. var s = this.actions[this.actions.length - 1].args
  54627. , l = s[s.length - 2]
  54628. , c = s[s.length - 1]
  54629. , h = new n.CubicBezierCurve(new n.Vector2(l,c),new n.Vector2(e,t),new n.Vector2(i,r),new n.Vector2(o,a));
  54630. this.curves.push(h),
  54631. this.actions.push({
  54632. action: "bezierCurveTo",
  54633. args: [e, t, i, r, o, a]
  54634. })
  54635. }
  54636. ,
  54637. n.Path.prototype.splineThru = function(e) {
  54638. var t = Array.prototype.slice.call(arguments)
  54639. , i = this.actions[this.actions.length - 1].args
  54640. , r = i[i.length - 2]
  54641. , o = i[i.length - 1]
  54642. , a = [new n.Vector2(r,o)];
  54643. Array.prototype.push.apply(a, e);
  54644. var s = new n.SplineCurve(a);
  54645. this.curves.push(s),
  54646. this.actions.push({
  54647. action: "splineThru",
  54648. args: t
  54649. })
  54650. }
  54651. ,
  54652. n.Path.prototype.arc = function(e, t, i, n, r, o) {
  54653. var a = this.actions[this.actions.length - 1].args
  54654. , s = a[a.length - 2]
  54655. , l = a[a.length - 1];
  54656. this.absarc(e + s, t + l, i, n, r, o)
  54657. }
  54658. ,
  54659. n.Path.prototype.absarc = function(e, t, i, n, r, o) {
  54660. this.absellipse(e, t, i, i, n, r, o)
  54661. }
  54662. ,
  54663. n.Path.prototype.ellipse = function(e, t, i, n, r, o, a, s) {
  54664. var l = this.actions[this.actions.length - 1].args
  54665. , c = l[l.length - 2]
  54666. , h = l[l.length - 1];
  54667. this.absellipse(e + c, t + h, i, n, r, o, a, s)
  54668. }
  54669. ,
  54670. n.Path.prototype.absellipse = function(e, t, i, r, o, a, s, l) {
  54671. var c = [e, t, i, r, o, a, s, l || 0]
  54672. , h = new n.EllipseCurve(e,t,i,r,o,a,s,l);
  54673. this.curves.push(h);
  54674. var u = h.getPoint(1);
  54675. c.push(u.x),
  54676. c.push(u.y),
  54677. this.actions.push({
  54678. action: "ellipse",
  54679. args: c
  54680. })
  54681. }
  54682. ,
  54683. n.Path.prototype.getSpacedPoints = function(e) {
  54684. e || (e = 40);
  54685. for (var t = [], i = 0; i < e; i++)
  54686. t.push(this.getPoint(i / e));
  54687. return this.autoClose && t.push(t[0]),
  54688. t
  54689. }
  54690. ,
  54691. n.Path.prototype.getPoints = function(e) {
  54692. e = e || 12;
  54693. 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++) {
  54694. var A = this.actions[m]
  54695. , y = A.action
  54696. , C = A.args;
  54697. switch (y) {
  54698. case "moveTo":
  54699. g.push(new n.Vector2(C[0],C[1]));
  54700. break;
  54701. case "lineTo":
  54702. g.push(new n.Vector2(C[0],C[1]));
  54703. break;
  54704. case "quadraticCurveTo":
  54705. t = C[2],
  54706. i = C[3],
  54707. a = C[0],
  54708. s = C[1],
  54709. g.length > 0 ? (h = g[g.length - 1],
  54710. l = h.x,
  54711. c = h.y) : (h = this.actions[m - 1].args,
  54712. l = h[h.length - 2],
  54713. c = h[h.length - 1]);
  54714. for (var I = 1; I <= e; I++) {
  54715. var E = I / e;
  54716. u = p(E, l, a, t),
  54717. d = p(E, c, s, i),
  54718. g.push(new n.Vector2(u,d))
  54719. }
  54720. break;
  54721. case "bezierCurveTo":
  54722. t = C[4],
  54723. i = C[5],
  54724. a = C[0],
  54725. s = C[1],
  54726. r = C[2],
  54727. o = C[3],
  54728. g.length > 0 ? (h = g[g.length - 1],
  54729. l = h.x,
  54730. c = h.y) : (h = this.actions[m - 1].args,
  54731. l = h[h.length - 2],
  54732. c = h[h.length - 1]);
  54733. for (var I = 1; I <= e; I++) {
  54734. var E = I / e;
  54735. u = f(E, l, a, r, t),
  54736. d = f(E, c, s, o, i),
  54737. g.push(new n.Vector2(u,d))
  54738. }
  54739. break;
  54740. case "splineThru":
  54741. h = this.actions[m - 1].args;
  54742. var b = new n.Vector2(h[h.length - 2],h[h.length - 1])
  54743. , w = [b]
  54744. , _ = e * C[0].length;
  54745. w = w.concat(C[0]);
  54746. for (var T = new n.SplineCurve(w), I = 1; I <= _; I++)
  54747. g.push(T.getPointAt(I / _));
  54748. break;
  54749. case "arc":
  54750. 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++) {
  54751. var E = I / N;
  54752. L || (E = 1 - E),
  54753. x = P + E * D,
  54754. u = S + R * Math.cos(x),
  54755. d = M + R * Math.sin(x),
  54756. g.push(new n.Vector2(u,d))
  54757. }
  54758. break;
  54759. case "ellipse":
  54760. 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;
  54761. 0 !== k && (B = Math.cos(k),
  54762. F = Math.sin(k));
  54763. for (var I = 1; I <= N; I++) {
  54764. var E = I / N;
  54765. if (L || (E = 1 - E),
  54766. x = P + E * D,
  54767. u = S + V * Math.cos(x),
  54768. d = M + U * Math.sin(x),
  54769. 0 !== k) {
  54770. var H = u
  54771. , G = d;
  54772. u = (H - S) * B - (G - M) * F + S,
  54773. d = (H - S) * F + (G - M) * B + M
  54774. }
  54775. g.push(new n.Vector2(u,d))
  54776. }
  54777. }
  54778. }
  54779. var z = g[g.length - 1];
  54780. 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),
  54781. this.autoClose && g.push(g[0]),
  54782. g
  54783. }
  54784. ,
  54785. n.Path.prototype.toShapes = function(e, t) {
  54786. function i(e) {
  54787. for (var t = [], i = new n.Path, r = 0, o = e.length; r < o; r++) {
  54788. var a = e[r]
  54789. , s = a.args
  54790. , l = a.action;
  54791. "moveTo" === l && 0 !== i.actions.length && (t.push(i),
  54792. i = new n.Path),
  54793. i[l].apply(i, s)
  54794. }
  54795. return 0 !== i.actions.length && t.push(i),
  54796. t
  54797. }
  54798. function r(e) {
  54799. for (var t = [], i = 0, r = e.length; i < r; i++) {
  54800. var o = e[i]
  54801. , a = new n.Shape;
  54802. a.actions = o.actions,
  54803. a.curves = o.curves,
  54804. t.push(a)
  54805. }
  54806. return t
  54807. }
  54808. function o(e, t) {
  54809. for (var i = t.length, n = !1, r = i - 1, o = 0; o < i; r = o++) {
  54810. var a = t[r]
  54811. , s = t[o]
  54812. , l = s.x - a.x
  54813. , c = s.y - a.y;
  54814. if (Math.abs(c) > Number.EPSILON) {
  54815. if (c < 0 && (a = t[o],
  54816. l = -l,
  54817. s = t[r],
  54818. c = -c),
  54819. e.y < a.y || e.y > s.y)
  54820. continue;
  54821. if (e.y === a.y) {
  54822. if (e.x === a.x)
  54823. return !0
  54824. } else {
  54825. var h = c * (e.x - a.x) - l * (e.y - a.y);
  54826. if (0 === h)
  54827. return !0;
  54828. if (h < 0)
  54829. continue;
  54830. n = !n
  54831. }
  54832. } else {
  54833. if (e.y !== a.y)
  54834. continue;
  54835. if (s.x <= e.x && e.x <= a.x || a.x <= e.x && e.x <= s.x)
  54836. return !0
  54837. }
  54838. }
  54839. return n
  54840. }
  54841. var a = n.ShapeUtils.isClockWise
  54842. , s = i(this.actions);
  54843. if (0 === s.length)
  54844. return [];
  54845. if (t === !0)
  54846. return r(s);
  54847. var l, c, h, u = [];
  54848. if (1 === s.length)
  54849. return c = s[0],
  54850. h = new n.Shape,
  54851. h.actions = c.actions,
  54852. h.curves = c.curves,
  54853. u.push(h),
  54854. u;
  54855. var d = !a(s[0].getPoints());
  54856. d = e ? !d : d;
  54857. var p, f = [], g = [], m = [], v = 0;
  54858. g[v] = void 0,
  54859. m[v] = [];
  54860. for (var A = 0, y = s.length; A < y; A++)
  54861. c = s[A],
  54862. p = c.getPoints(),
  54863. l = a(p),
  54864. l = e ? !l : l,
  54865. l ? (!d && g[v] && v++,
  54866. g[v] = {
  54867. s: new n.Shape,
  54868. p: p
  54869. },
  54870. g[v].s.actions = c.actions,
  54871. g[v].s.curves = c.curves,
  54872. d && v++,
  54873. m[v] = []) : m[v].push({
  54874. h: c,
  54875. p: p[0]
  54876. });
  54877. if (!g[0])
  54878. return r(s);
  54879. if (g.length > 1) {
  54880. for (var C = !1, I = [], E = 0, b = g.length; E < b; E++)
  54881. f[E] = [];
  54882. for (var E = 0, b = g.length; E < b; E++)
  54883. for (var w = m[E], _ = 0; _ < w.length; _++) {
  54884. for (var T = w[_], x = !0, S = 0; S < g.length; S++)
  54885. o(T.p, g[S].p) && (E !== S && I.push({
  54886. froms: E,
  54887. tos: S,
  54888. hole: _
  54889. }),
  54890. x ? (x = !1,
  54891. f[S].push(T)) : C = !0);
  54892. x && f[E].push(T)
  54893. }
  54894. I.length > 0 && (C || (m = f))
  54895. }
  54896. for (var M, A = 0, R = g.length; A < R; A++) {
  54897. h = g[A].s,
  54898. u.push(h),
  54899. M = m[A];
  54900. for (var P = 0, O = M.length; P < O; P++)
  54901. h.holes.push(M[P].h)
  54902. }
  54903. return u
  54904. }
  54905. ,
  54906. n.Shape = function() {
  54907. n.Path.apply(this, arguments),
  54908. this.holes = []
  54909. }
  54910. ,
  54911. n.Shape.prototype = Object.create(n.Path.prototype),
  54912. n.Shape.prototype.constructor = n.Shape,
  54913. n.Shape.prototype.extrude = function(e) {
  54914. return new n.ExtrudeGeometry(this,e)
  54915. }
  54916. ,
  54917. n.Shape.prototype.makeGeometry = function(e) {
  54918. return new n.ShapeGeometry(this,e)
  54919. }
  54920. ,
  54921. n.Shape.prototype.getPointsHoles = function(e) {
  54922. for (var t = [], i = 0, n = this.holes.length; i < n; i++)
  54923. t[i] = this.holes[i].getPoints(e);
  54924. return t
  54925. }
  54926. ,
  54927. n.Shape.prototype.extractAllPoints = function(e) {
  54928. return {
  54929. shape: this.getPoints(e),
  54930. holes: this.getPointsHoles(e)
  54931. }
  54932. }
  54933. ,
  54934. n.Shape.prototype.extractPoints = function(e) {
  54935. return this.extractAllPoints(e)
  54936. }
  54937. ,
  54938. n.LineCurve = function(e, t) {
  54939. this.v1 = e,
  54940. this.v2 = t
  54941. }
  54942. ,
  54943. n.LineCurve.prototype = Object.create(n.Curve.prototype),
  54944. n.LineCurve.prototype.constructor = n.LineCurve,
  54945. n.LineCurve.prototype.getPoint = function(e) {
  54946. var t = this.v2.clone().sub(this.v1);
  54947. return t.multiplyScalar(e).add(this.v1),
  54948. t
  54949. }
  54950. ,
  54951. n.LineCurve.prototype.getPointAt = function(e) {
  54952. return this.getPoint(e)
  54953. }
  54954. ,
  54955. n.LineCurve.prototype.getTangent = function(e) {
  54956. var t = this.v2.clone().sub(this.v1);
  54957. return t.normalize()
  54958. }
  54959. ,
  54960. n.QuadraticBezierCurve = function(e, t, i) {
  54961. this.v0 = e,
  54962. this.v1 = t,
  54963. this.v2 = i
  54964. }
  54965. ,
  54966. n.QuadraticBezierCurve.prototype = Object.create(n.Curve.prototype),
  54967. n.QuadraticBezierCurve.prototype.constructor = n.QuadraticBezierCurve,
  54968. n.QuadraticBezierCurve.prototype.getPoint = function(e) {
  54969. var t = n.ShapeUtils.b2;
  54970. 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))
  54971. }
  54972. ,
  54973. n.QuadraticBezierCurve.prototype.getTangent = function(e) {
  54974. var t = n.CurveUtils.tangentQuadraticBezier;
  54975. 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()
  54976. }
  54977. ,
  54978. n.CubicBezierCurve = function(e, t, i, n) {
  54979. this.v0 = e,
  54980. this.v1 = t,
  54981. this.v2 = i,
  54982. this.v3 = n
  54983. }
  54984. ,
  54985. n.CubicBezierCurve.prototype = Object.create(n.Curve.prototype),
  54986. n.CubicBezierCurve.prototype.constructor = n.CubicBezierCurve,
  54987. n.CubicBezierCurve.prototype.getPoint = function(e) {
  54988. var t = n.ShapeUtils.b3;
  54989. 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))
  54990. }
  54991. ,
  54992. n.CubicBezierCurve.prototype.getTangent = function(e) {
  54993. var t = n.CurveUtils.tangentCubicBezier;
  54994. 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()
  54995. }
  54996. ,
  54997. n.SplineCurve = function(e) {
  54998. this.points = void 0 == e ? [] : e
  54999. }
  55000. ,
  55001. n.SplineCurve.prototype = Object.create(n.Curve.prototype),
  55002. n.SplineCurve.prototype.constructor = n.SplineCurve,
  55003. n.SplineCurve.prototype.getPoint = function(e) {
  55004. var t = this.points
  55005. , i = (t.length - 1) * e
  55006. , r = Math.floor(i)
  55007. , o = i - r
  55008. , a = t[0 === r ? r : r - 1]
  55009. , s = t[r]
  55010. , l = t[r > t.length - 2 ? t.length - 1 : r + 1]
  55011. , c = t[r > t.length - 3 ? t.length - 1 : r + 2]
  55012. , h = n.CurveUtils.interpolate;
  55013. return new n.Vector2(h(a.x, s.x, l.x, c.x, o),h(a.y, s.y, l.y, c.y, o))
  55014. }
  55015. ,
  55016. n.EllipseCurve = function(e, t, i, n, r, o, a, s) {
  55017. this.aX = e,
  55018. this.aY = t,
  55019. this.xRadius = i,
  55020. this.yRadius = n,
  55021. this.aStartAngle = r,
  55022. this.aEndAngle = o,
  55023. this.aClockwise = a,
  55024. this.aRotation = s || 0
  55025. }
  55026. ,
  55027. n.EllipseCurve.prototype = Object.create(n.Curve.prototype),
  55028. n.EllipseCurve.prototype.constructor = n.EllipseCurve,
  55029. n.EllipseCurve.prototype.getPoint = function(e) {
  55030. var t = this.aEndAngle - this.aStartAngle;
  55031. t < 0 && (t += 2 * Math.PI),
  55032. t > 2 * Math.PI && (t -= 2 * Math.PI);
  55033. var i;
  55034. i = this.aClockwise === !0 ? this.aEndAngle + (1 - e) * (2 * Math.PI - t) : this.aStartAngle + e * t;
  55035. var r = this.aX + this.xRadius * Math.cos(i)
  55036. , o = this.aY + this.yRadius * Math.sin(i);
  55037. if (0 !== this.aRotation) {
  55038. var a = Math.cos(this.aRotation)
  55039. , s = Math.sin(this.aRotation)
  55040. , l = r
  55041. , c = o;
  55042. r = (l - this.aX) * a - (c - this.aY) * s + this.aX,
  55043. o = (l - this.aX) * s + (c - this.aY) * a + this.aY
  55044. }
  55045. return new n.Vector2(r,o)
  55046. }
  55047. ,
  55048. n.ArcCurve = function(e, t, i, r, o, a) {
  55049. n.EllipseCurve.call(this, e, t, i, i, r, o, a)
  55050. }
  55051. ,
  55052. n.ArcCurve.prototype = Object.create(n.EllipseCurve.prototype),
  55053. n.ArcCurve.prototype.constructor = n.ArcCurve,
  55054. n.LineCurve3 = n.Curve.create(function(e, t) {
  55055. this.v1 = e,
  55056. this.v2 = t
  55057. }, function(e) {
  55058. var t = new n.Vector3;
  55059. return t.subVectors(this.v2, this.v1),
  55060. t.multiplyScalar(e),
  55061. t.add(this.v1),
  55062. t
  55063. }),
  55064. n.QuadraticBezierCurve3 = n.Curve.create(function(e, t, i) {
  55065. this.v0 = e,
  55066. this.v1 = t,
  55067. this.v2 = i
  55068. }, function(e) {
  55069. var t = n.ShapeUtils.b2;
  55070. 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))
  55071. }),
  55072. n.CubicBezierCurve3 = n.Curve.create(function(e, t, i, n) {
  55073. this.v0 = e,
  55074. this.v1 = t,
  55075. this.v2 = i,
  55076. this.v3 = n
  55077. }, function(e) {
  55078. var t = n.ShapeUtils.b3;
  55079. 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))
  55080. }),
  55081. n.SplineCurve3 = n.Curve.create(function(e) {
  55082. console.warn("THREE.SplineCurve3 will be deprecated. Please use THREE.CatmullRomCurve3"),
  55083. this.points = void 0 == e ? [] : e
  55084. }, function(e) {
  55085. var t = this.points
  55086. , i = (t.length - 1) * e
  55087. , r = Math.floor(i)
  55088. , o = i - r
  55089. , a = t[0 == r ? r : r - 1]
  55090. , s = t[r]
  55091. , l = t[r > t.length - 2 ? t.length - 1 : r + 1]
  55092. , c = t[r > t.length - 3 ? t.length - 1 : r + 2]
  55093. , h = n.CurveUtils.interpolate;
  55094. 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))
  55095. }),
  55096. n.CatmullRomCurve3 = function() {
  55097. function e() {}
  55098. var t = new n.Vector3
  55099. , i = new e
  55100. , r = new e
  55101. , o = new e;
  55102. return e.prototype.init = function(e, t, i, n) {
  55103. this.c0 = e,
  55104. this.c1 = i,
  55105. this.c2 = -3 * e + 3 * t - 2 * i - n,
  55106. this.c3 = 2 * e - 2 * t + i + n
  55107. }
  55108. ,
  55109. e.prototype.initNonuniformCatmullRom = function(e, t, i, n, r, o, a) {
  55110. var s = (t - e) / r - (i - e) / (r + o) + (i - t) / o
  55111. , l = (i - t) / o - (n - t) / (o + a) + (n - i) / a;
  55112. s *= o,
  55113. l *= o,
  55114. this.init(t, i, s, l)
  55115. }
  55116. ,
  55117. e.prototype.initCatmullRom = function(e, t, i, n, r) {
  55118. this.init(t, i, r * (i - e), r * (n - t))
  55119. }
  55120. ,
  55121. e.prototype.calc = function(e) {
  55122. var t = e * e
  55123. , i = t * e;
  55124. return this.c0 + this.c1 * e + this.c2 * t + this.c3 * i
  55125. }
  55126. ,
  55127. n.Curve.create(function(e) {
  55128. this.points = e || [],
  55129. this.closed = !1
  55130. }, function(e) {
  55131. var a, s, l, c, h = this.points;
  55132. c = h.length,
  55133. c < 2 && console.log("duh, you need at least 2 points"),
  55134. a = (c - (this.closed ? 0 : 1)) * e,
  55135. s = Math.floor(a),
  55136. l = a - s,
  55137. this.closed ? s += s > 0 ? 0 : (Math.floor(Math.abs(s) / h.length) + 1) * h.length : 0 === l && s === c - 1 && (s = c - 2,
  55138. l = 1);
  55139. var u, d, p, f;
  55140. if (this.closed || s > 0 ? u = h[(s - 1) % c] : (t.subVectors(h[0], h[1]).add(h[0]),
  55141. u = t),
  55142. d = h[s % c],
  55143. p = h[(s + 1) % c],
  55144. this.closed || s + 2 < c ? f = h[(s + 2) % c] : (t.subVectors(h[c - 1], h[c - 2]).add(h[c - 1]),
  55145. f = t),
  55146. void 0 === this.type || "centripetal" === this.type || "chordal" === this.type) {
  55147. var g = "chordal" === this.type ? .5 : .25
  55148. , m = Math.pow(u.distanceToSquared(d), g)
  55149. , v = Math.pow(d.distanceToSquared(p), g)
  55150. , A = Math.pow(p.distanceToSquared(f), g);
  55151. v < 1e-4 && (v = 1),
  55152. m < 1e-4 && (m = v),
  55153. A < 1e-4 && (A = v),
  55154. i.initNonuniformCatmullRom(u.x, d.x, p.x, f.x, m, v, A),
  55155. r.initNonuniformCatmullRom(u.y, d.y, p.y, f.y, m, v, A),
  55156. o.initNonuniformCatmullRom(u.z, d.z, p.z, f.z, m, v, A)
  55157. } else if ("catmullrom" === this.type) {
  55158. var y = void 0 !== this.tension ? this.tension : .5;
  55159. i.initCatmullRom(u.x, d.x, p.x, f.x, y),
  55160. r.initCatmullRom(u.y, d.y, p.y, f.y, y),
  55161. o.initCatmullRom(u.z, d.z, p.z, f.z, y)
  55162. }
  55163. var C = new n.Vector3(i.calc(l),r.calc(l),o.calc(l));
  55164. return C
  55165. })
  55166. }(),
  55167. n.ClosedSplineCurve3 = function(e) {
  55168. console.warn("THREE.ClosedSplineCurve3 has been deprecated. Please use THREE.CatmullRomCurve3."),
  55169. n.CatmullRomCurve3.call(this, e),
  55170. this.type = "catmullrom",
  55171. this.closed = !0
  55172. }
  55173. ,
  55174. n.ClosedSplineCurve3.prototype = Object.create(n.CatmullRomCurve3.prototype),
  55175. n.BoxGeometry = function(e, t, i, r, o, a) {
  55176. n.Geometry.call(this),
  55177. this.type = "BoxGeometry",
  55178. this.parameters = {
  55179. width: e,
  55180. height: t,
  55181. depth: i,
  55182. widthSegments: r,
  55183. heightSegments: o,
  55184. depthSegments: a
  55185. },
  55186. this.fromBufferGeometry(new n.BoxBufferGeometry(e,t,i,r,o,a)),
  55187. this.mergeVertices()
  55188. }
  55189. ,
  55190. n.BoxGeometry.prototype = Object.create(n.Geometry.prototype),
  55191. n.BoxGeometry.prototype.constructor = n.BoxGeometry,
  55192. n.CubeGeometry = n.BoxGeometry,
  55193. n.BoxBufferGeometry = function(e, t, i, r, o, a) {
  55194. function s(e, t, i) {
  55195. var n = 0;
  55196. return n += e * t * 2,
  55197. n += e * i * 2,
  55198. n += i * t * 2,
  55199. 4 * n
  55200. }
  55201. function l(e, t, i, r, o, a, s, l, h, u, I) {
  55202. 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++)
  55203. for (var L = O * b - _, D = 0; D < x; D++) {
  55204. var N = D * E - w;
  55205. P[e] = N * r,
  55206. P[t] = L * o,
  55207. P[i] = T,
  55208. p[m] = P.x,
  55209. p[m + 1] = P.y,
  55210. p[m + 2] = P.z,
  55211. P[e] = 0,
  55212. P[t] = 0,
  55213. P[i] = l > 0 ? 1 : -1,
  55214. f[m] = P.x,
  55215. f[m + 1] = P.y,
  55216. f[m + 2] = P.z,
  55217. g[v] = D / h,
  55218. g[v + 1] = 1 - O / u,
  55219. m += 3,
  55220. v += 2,
  55221. M += 1
  55222. }
  55223. for (O = 0; O < u; O++)
  55224. for (D = 0; D < h; D++) {
  55225. var B = y + D + x * O
  55226. , F = y + D + x * (O + 1)
  55227. , V = y + (D + 1) + x * (O + 1)
  55228. , U = y + (D + 1) + x * O;
  55229. d[A] = B,
  55230. d[A + 1] = F,
  55231. d[A + 2] = U,
  55232. d[A + 3] = F,
  55233. d[A + 4] = V,
  55234. d[A + 5] = U,
  55235. A += 6,
  55236. R += 6
  55237. }
  55238. c.addGroup(C, R, I),
  55239. C += R,
  55240. y += M
  55241. }
  55242. n.BufferGeometry.call(this),
  55243. this.type = "BoxBufferGeometry",
  55244. this.parameters = {
  55245. width: e,
  55246. height: t,
  55247. depth: i,
  55248. widthSegments: r,
  55249. heightSegments: o,
  55250. depthSegments: a
  55251. };
  55252. var c = this;
  55253. r = Math.floor(r) || 1,
  55254. o = Math.floor(o) || 1,
  55255. a = Math.floor(a) || 1;
  55256. var h = s(r, o, a)
  55257. , u = h / 4 * 6
  55258. , d = new (u > 65535 ? Uint32Array : Uint16Array)(u)
  55259. , p = new Float32Array(3 * h)
  55260. , f = new Float32Array(3 * h)
  55261. , g = new Float32Array(2 * h)
  55262. , m = 0
  55263. , v = 0
  55264. , A = 0
  55265. , y = 0
  55266. , C = 0;
  55267. l("z", "y", "x", -1, -1, i, t, e, a, o, 0),
  55268. l("z", "y", "x", 1, -1, i, t, -e, a, o, 1),
  55269. l("x", "z", "y", 1, 1, e, i, t, r, a, 2),
  55270. l("x", "z", "y", 1, -1, e, i, -t, r, a, 3),
  55271. l("x", "y", "z", 1, -1, e, t, i, r, o, 4),
  55272. l("x", "y", "z", -1, -1, e, t, -i, r, o, 5),
  55273. this.setIndex(new n.BufferAttribute(d,1)),
  55274. this.addAttribute("position", new n.BufferAttribute(p,3)),
  55275. this.addAttribute("normal", new n.BufferAttribute(f,3)),
  55276. this.addAttribute("uv", new n.BufferAttribute(g,2))
  55277. }
  55278. ,
  55279. n.BoxBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  55280. n.BoxBufferGeometry.prototype.constructor = n.BoxBufferGeometry,
  55281. n.CircleGeometry = function(e, t, i, r) {
  55282. n.Geometry.call(this),
  55283. this.type = "CircleGeometry",
  55284. this.parameters = {
  55285. radius: e,
  55286. segments: t,
  55287. thetaStart: i,
  55288. thetaLength: r
  55289. },
  55290. this.fromBufferGeometry(new n.CircleBufferGeometry(e,t,i,r))
  55291. }
  55292. ,
  55293. n.CircleGeometry.prototype = Object.create(n.Geometry.prototype),
  55294. n.CircleGeometry.prototype.constructor = n.CircleGeometry,
  55295. n.CircleBufferGeometry = function(e, t, i, r) {
  55296. n.BufferGeometry.call(this),
  55297. this.type = "CircleBufferGeometry",
  55298. this.parameters = {
  55299. radius: e,
  55300. segments: t,
  55301. thetaStart: i,
  55302. thetaLength: r
  55303. },
  55304. e = e || 50,
  55305. t = void 0 !== t ? Math.max(3, t) : 8,
  55306. i = void 0 !== i ? i : 0,
  55307. r = void 0 !== r ? r : 2 * Math.PI;
  55308. var o = t + 2
  55309. , a = new Float32Array(3 * o)
  55310. , s = new Float32Array(3 * o)
  55311. , l = new Float32Array(2 * o);
  55312. s[2] = 1,
  55313. l[0] = .5,
  55314. l[1] = .5;
  55315. for (var c = 0, h = 3, u = 2; c <= t; c++,
  55316. h += 3,
  55317. u += 2) {
  55318. var d = i + c / t * r;
  55319. a[h] = e * Math.cos(d),
  55320. a[h + 1] = e * Math.sin(d),
  55321. s[h + 2] = 1,
  55322. l[u] = (a[h] / e + 1) / 2,
  55323. l[u + 1] = (a[h + 1] / e + 1) / 2
  55324. }
  55325. for (var p = [], h = 1; h <= t; h++)
  55326. p.push(h, h + 1, 0);
  55327. this.setIndex(new n.BufferAttribute(new Uint16Array(p),1)),
  55328. this.addAttribute("position", new n.BufferAttribute(a,3)),
  55329. this.addAttribute("normal", new n.BufferAttribute(s,3)),
  55330. this.addAttribute("uv", new n.BufferAttribute(l,2)),
  55331. this.boundingSphere = new n.Sphere(new n.Vector3,e)
  55332. }
  55333. ,
  55334. n.CircleBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  55335. n.CircleBufferGeometry.prototype.constructor = n.CircleBufferGeometry,
  55336. n.CylinderBufferGeometry = function(e, t, i, r, o, a, s, l) {
  55337. function c() {
  55338. var e = (r + 1) * (o + 1);
  55339. return a === !1 && (e += 2 * (r + 1) + 2 * r),
  55340. e
  55341. }
  55342. function h() {
  55343. var e = r * o * 2 * 3;
  55344. return a === !1 && (e += 2 * r * 3),
  55345. e
  55346. }
  55347. function u() {
  55348. var a, c, h = new n.Vector3, u = new n.Vector3, d = (t - e) / i;
  55349. for (c = 0; c <= o; c++) {
  55350. var p = []
  55351. , f = c / o
  55352. , b = f * (t - e) + e;
  55353. for (a = 0; a <= r; a++) {
  55354. var w = a / r;
  55355. u.x = b * Math.sin(w * l + s),
  55356. u.y = -f * i + E,
  55357. u.z = b * Math.cos(w * l + s),
  55358. m.setXYZ(y, u.x, u.y, u.z),
  55359. h.copy(u),
  55360. (0 === e && 0 === c || 0 === t && c === o) && (h.x = Math.sin(w * l + s),
  55361. h.z = Math.cos(w * l + s)),
  55362. h.setY(Math.sqrt(h.x * h.x + h.z * h.z) * d).normalize(),
  55363. v.setXYZ(y, h.x, h.y, h.z),
  55364. A.setXY(y, w, 1 - f),
  55365. p.push(y),
  55366. y++
  55367. }
  55368. I.push(p)
  55369. }
  55370. for (a = 0; a < r; a++)
  55371. for (c = 0; c < o; c++) {
  55372. var _ = I[c][a]
  55373. , T = I[c + 1][a]
  55374. , x = I[c + 1][a + 1]
  55375. , S = I[c][a + 1];
  55376. g.setX(C, _),
  55377. C++,
  55378. g.setX(C, T),
  55379. C++,
  55380. g.setX(C, S),
  55381. C++,
  55382. g.setX(C, T),
  55383. C++,
  55384. g.setX(C, x),
  55385. C++,
  55386. g.setX(C, S),
  55387. C++
  55388. }
  55389. }
  55390. function d(i) {
  55391. var o, a, c, h = new n.Vector2, u = new n.Vector3, d = i === !0 ? e : t, p = i === !0 ? 1 : -1;
  55392. for (a = y,
  55393. o = 1; o <= r; o++)
  55394. m.setXYZ(y, 0, E * p, 0),
  55395. v.setXYZ(y, 0, p, 0),
  55396. i === !0 ? (h.x = o / r,
  55397. h.y = 0) : (h.x = (o - 1) / r,
  55398. h.y = 1),
  55399. A.setXY(y, h.x, h.y),
  55400. y++;
  55401. for (c = y,
  55402. o = 0; o <= r; o++) {
  55403. var f = o / r;
  55404. u.x = d * Math.sin(f * l + s),
  55405. u.y = E * p,
  55406. u.z = d * Math.cos(f * l + s),
  55407. m.setXYZ(y, u.x, u.y, u.z),
  55408. v.setXYZ(y, 0, p, 0),
  55409. A.setXY(y, f, i === !0 ? 1 : 0),
  55410. y++
  55411. }
  55412. for (o = 0; o < r; o++) {
  55413. var I = a + o
  55414. , b = c + o;
  55415. i === !0 ? (g.setX(C, b),
  55416. C++,
  55417. g.setX(C, b + 1),
  55418. C++,
  55419. g.setX(C, I),
  55420. C++) : (g.setX(C, b + 1),
  55421. C++,
  55422. g.setX(C, b),
  55423. C++,
  55424. g.setX(C, I),
  55425. C++)
  55426. }
  55427. }
  55428. n.BufferGeometry.call(this),
  55429. this.type = "CylinderBufferGeometry",
  55430. this.parameters = {
  55431. radiusTop: e,
  55432. radiusBottom: t,
  55433. height: i,
  55434. radialSegments: r,
  55435. heightSegments: o,
  55436. openEnded: a,
  55437. thetaStart: s,
  55438. thetaLength: l
  55439. },
  55440. e = void 0 !== e ? e : 20,
  55441. t = void 0 !== t ? t : 20,
  55442. i = void 0 !== i ? i : 100,
  55443. r = Math.floor(r) || 8,
  55444. o = Math.floor(o) || 1,
  55445. a = void 0 !== a && a,
  55446. s = void 0 !== s ? s : 0,
  55447. l = void 0 !== l ? l : 2 * Math.PI;
  55448. var p = c()
  55449. , f = h()
  55450. , g = new n.BufferAttribute(new (f > 65535 ? Uint32Array : Uint16Array)(f),1)
  55451. , m = new n.BufferAttribute(new Float32Array(3 * p),3)
  55452. , v = new n.BufferAttribute(new Float32Array(3 * p),3)
  55453. , A = new n.BufferAttribute(new Float32Array(2 * p),2)
  55454. , y = 0
  55455. , C = 0
  55456. , I = []
  55457. , E = i / 2;
  55458. u(),
  55459. a === !1 && (e > 0 && d(!0),
  55460. t > 0 && d(!1)),
  55461. this.setIndex(g),
  55462. this.addAttribute("position", m),
  55463. this.addAttribute("normal", v),
  55464. this.addAttribute("uv", A)
  55465. }
  55466. ,
  55467. n.CylinderBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  55468. n.CylinderBufferGeometry.prototype.constructor = n.CylinderBufferGeometry,
  55469. n.CylinderGeometry = function(e, t, i, r, o, a, s, l) {
  55470. n.Geometry.call(this),
  55471. this.type = "CylinderGeometry",
  55472. this.parameters = {
  55473. radiusTop: e,
  55474. radiusBottom: t,
  55475. height: i,
  55476. radialSegments: r,
  55477. heightSegments: o,
  55478. openEnded: a,
  55479. thetaStart: s,
  55480. thetaLength: l
  55481. },
  55482. this.fromBufferGeometry(new n.CylinderBufferGeometry(e,t,i,r,o,a,s,l)),
  55483. this.mergeVertices()
  55484. }
  55485. ,
  55486. n.CylinderGeometry.prototype = Object.create(n.Geometry.prototype),
  55487. n.CylinderGeometry.prototype.constructor = n.CylinderGeometry,
  55488. n.EdgesGeometry = function(e, t) {
  55489. function i(e, t) {
  55490. return e - t
  55491. }
  55492. n.BufferGeometry.call(this),
  55493. t = void 0 !== t ? t : 1;
  55494. var r, o = Math.cos(n.Math.degToRad(t)), a = [0, 0], s = {}, l = ["a", "b", "c"];
  55495. e instanceof n.BufferGeometry ? (r = new n.Geometry,
  55496. r.fromBufferGeometry(e)) : r = e.clone(),
  55497. r.mergeVertices(),
  55498. r.computeFaceNormals();
  55499. for (var c = r.vertices, h = r.faces, u = 0, d = h.length; u < d; u++)
  55500. for (var p = h[u], f = 0; f < 3; f++) {
  55501. a[0] = p[l[f]],
  55502. a[1] = p[l[(f + 1) % 3]],
  55503. a.sort(i);
  55504. var g = a.toString();
  55505. void 0 === s[g] ? s[g] = {
  55506. vert1: a[0],
  55507. vert2: a[1],
  55508. face1: u,
  55509. face2: void 0
  55510. } : s[g].face2 = u
  55511. }
  55512. var m = [];
  55513. for (var g in s) {
  55514. var v = s[g];
  55515. if (void 0 === v.face2 || h[v.face1].normal.dot(h[v.face2].normal) <= o) {
  55516. var A = c[v.vert1];
  55517. m.push(A.x),
  55518. m.push(A.y),
  55519. m.push(A.z),
  55520. A = c[v.vert2],
  55521. m.push(A.x),
  55522. m.push(A.y),
  55523. m.push(A.z)
  55524. }
  55525. }
  55526. this.addAttribute("position", new n.BufferAttribute(new Float32Array(m),3))
  55527. }
  55528. ,
  55529. n.EdgesGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  55530. n.EdgesGeometry.prototype.constructor = n.EdgesGeometry,
  55531. n.ExtrudeGeometry = function(e, t) {
  55532. return "undefined" == typeof e ? void (e = []) : (n.Geometry.call(this),
  55533. this.type = "ExtrudeGeometry",
  55534. e = Array.isArray(e) ? e : [e],
  55535. this.addShapeList(e, t),
  55536. void this.computeFaceNormals())
  55537. }
  55538. ;
  55539. n.ExtrudeGeometry.prototype = Object.create(n.Geometry.prototype);
  55540. n.ExtrudeGeometry.prototype.constructor = n.ExtrudeGeometry,
  55541. n.ExtrudeGeometry.prototype.addShapeList = function(e, t) {
  55542. for (var i = e.length, n = 0; n < i; n++) {
  55543. var r = e[n];
  55544. this.addShape(r, t)
  55545. }
  55546. }
  55547. ,
  55548. n.ExtrudeGeometry.prototype.addShape = function(e, t) {
  55549. function i(e, t, i) {
  55550. return t || console.error("THREE.ExtrudeGeometry: vec does not exist"),
  55551. t.clone().multiplyScalar(i).add(e)
  55552. }
  55553. function r(e, t, i) {
  55554. 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;
  55555. if (Math.abs(d) > Number.EPSILON) {
  55556. var p = Math.sqrt(u)
  55557. , f = Math.sqrt(c * c + h * h)
  55558. , g = t.x - l / p
  55559. , m = t.y + s / p
  55560. , v = i.x - h / f
  55561. , A = i.y + c / f
  55562. , y = ((v - g) * h - (A - m) * c) / (s * h - l * c);
  55563. r = g + s * y - e.x,
  55564. o = m + l * y - e.y;
  55565. var C = r * r + o * o;
  55566. if (C <= 2)
  55567. return new n.Vector2(r,o);
  55568. a = Math.sqrt(C / 2)
  55569. } else {
  55570. var I = !1;
  55571. s > Number.EPSILON ? c > Number.EPSILON && (I = !0) : s < -Number.EPSILON ? c < -Number.EPSILON && (I = !0) : Math.sign(l) === Math.sign(h) && (I = !0),
  55572. I ? (r = -l,
  55573. o = s,
  55574. a = Math.sqrt(u)) : (r = s,
  55575. o = l,
  55576. a = Math.sqrt(u / 2))
  55577. }
  55578. return new n.Vector2(r / a,o / a)
  55579. }
  55580. function o() {
  55581. if (C) {
  55582. var e = 0
  55583. , t = z * e;
  55584. for (Y = 0; Y < W; Y++)
  55585. G = N[Y],
  55586. c(G[2] + t, G[1] + t, G[0] + t);
  55587. for (e = E + 2 * y,
  55588. t = z * e,
  55589. Y = 0; Y < W; Y++)
  55590. G = N[Y],
  55591. c(G[0] + t, G[1] + t, G[2] + t)
  55592. } else {
  55593. for (Y = 0; Y < W; Y++)
  55594. G = N[Y],
  55595. c(G[2], G[1], G[0]);
  55596. for (Y = 0; Y < W; Y++)
  55597. G = N[Y],
  55598. c(G[0] + z * E, G[1] + z * E, G[2] + z * E)
  55599. }
  55600. }
  55601. function a() {
  55602. var e = 0;
  55603. for (s(B, e),
  55604. e += B.length,
  55605. x = 0,
  55606. S = L.length; x < S; x++)
  55607. T = L[x],
  55608. s(T, e),
  55609. e += T.length
  55610. }
  55611. function s(e, t) {
  55612. var i, n;
  55613. for (Y = e.length; --Y >= 0; ) {
  55614. i = Y,
  55615. n = Y - 1,
  55616. n < 0 && (n = e.length - 1);
  55617. var r = 0
  55618. , o = E + 2 * y;
  55619. for (r = 0; r < o; r++) {
  55620. var a = z * r
  55621. , s = z * (r + 1)
  55622. , l = t + i + a
  55623. , c = t + n + a
  55624. , u = t + n + s
  55625. , d = t + i + s;
  55626. h(l, c, u, d, e, r, o, i, n)
  55627. }
  55628. }
  55629. }
  55630. function l(e, t, i) {
  55631. M.vertices.push(new n.Vector3(e,t,i))
  55632. }
  55633. function c(e, t, i) {
  55634. e += R,
  55635. t += R,
  55636. i += R,
  55637. M.faces.push(new n.Face3(e,t,i,null,null,0));
  55638. var r = _.generateTopUV(M, e, t, i);
  55639. M.faceVertexUvs[0].push(r)
  55640. }
  55641. function h(e, t, i, r, o, a, s, l, c) {
  55642. e += R,
  55643. t += R,
  55644. i += R,
  55645. r += R,
  55646. M.faces.push(new n.Face3(e,t,r,null,null,1)),
  55647. M.faces.push(new n.Face3(t,i,r,null,null,1));
  55648. var h = _.generateSideWallUV(M, e, t, i, r);
  55649. M.faceVertexUvs[0].push([h[0], h[1], h[3]]),
  55650. M.faceVertexUvs[0].push([h[1], h[2], h[3]])
  55651. }
  55652. 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;
  55653. b && (u = b.getSpacedPoints(E),
  55654. w = !0,
  55655. C = !1,
  55656. d = void 0 !== t.frames ? t.frames : new n.TubeGeometry.FrenetFrames(b,E,!1),
  55657. p = new n.Vector3,
  55658. f = new n.Vector3,
  55659. g = new n.Vector3),
  55660. C || (y = 0,
  55661. v = 0,
  55662. A = 0);
  55663. 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);
  55664. if (D) {
  55665. for (O = O.reverse(),
  55666. x = 0,
  55667. S = L.length; x < S; x++)
  55668. T = L[x],
  55669. n.ShapeUtils.isClockWise(T) && (L[x] = T.reverse());
  55670. D = !1
  55671. }
  55672. var N = n.ShapeUtils.triangulateShape(O, L)
  55673. , B = O;
  55674. for (x = 0,
  55675. S = L.length; x < S; x++)
  55676. T = L[x],
  55677. O = O.concat(T);
  55678. 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++,
  55679. Z++,
  55680. q++)
  55681. Z === X && (Z = 0),
  55682. q === X && (q = 0),
  55683. j[Y] = r(B[Y], B[Z], B[q]);
  55684. var K, Q = [], J = j.concat();
  55685. for (x = 0,
  55686. S = L.length; x < S; x++) {
  55687. for (T = L[x],
  55688. K = [],
  55689. Y = 0,
  55690. X = T.length,
  55691. Z = X - 1,
  55692. q = Y + 1; Y < X; Y++,
  55693. Z++,
  55694. q++)
  55695. Z === X && (Z = 0),
  55696. q === X && (q = 0),
  55697. K[Y] = r(T[Y], T[Z], T[q]);
  55698. Q.push(K),
  55699. J = J.concat(K)
  55700. }
  55701. for (F = 0; F < y; F++) {
  55702. for (U = F / y,
  55703. k = v * (1 - U),
  55704. V = A * Math.sin(U * Math.PI / 2),
  55705. Y = 0,
  55706. X = B.length; Y < X; Y++)
  55707. H = i(B[Y], j[Y], V),
  55708. l(H.x, H.y, -k);
  55709. for (x = 0,
  55710. S = L.length; x < S; x++)
  55711. for (T = L[x],
  55712. K = Q[x],
  55713. Y = 0,
  55714. X = T.length; Y < X; Y++)
  55715. H = i(T[Y], K[Y], V),
  55716. l(H.x, H.y, -k)
  55717. }
  55718. for (V = A,
  55719. Y = 0; Y < z; Y++)
  55720. H = C ? i(O[Y], J[Y], V) : O[Y],
  55721. w ? (f.copy(d.normals[0]).multiplyScalar(H.x),
  55722. p.copy(d.binormals[0]).multiplyScalar(H.y),
  55723. g.copy(u[0]).add(f).add(p),
  55724. l(g.x, g.y, g.z)) : l(H.x, H.y, 0);
  55725. var $;
  55726. for ($ = 1; $ <= E; $++)
  55727. for (Y = 0; Y < z; Y++)
  55728. H = C ? i(O[Y], J[Y], V) : O[Y],
  55729. w ? (f.copy(d.normals[$]).multiplyScalar(H.x),
  55730. p.copy(d.binormals[$]).multiplyScalar(H.y),
  55731. g.copy(u[$]).add(f).add(p),
  55732. l(g.x, g.y, g.z)) : l(H.x, H.y, m / E * $);
  55733. for (F = y - 1; F >= 0; F--) {
  55734. for (U = F / y,
  55735. k = v * (1 - U),
  55736. V = A * Math.sin(U * Math.PI / 2),
  55737. Y = 0,
  55738. X = B.length; Y < X; Y++)
  55739. H = i(B[Y], j[Y], V),
  55740. l(H.x, H.y, m + k);
  55741. for (x = 0,
  55742. S = L.length; x < S; x++)
  55743. for (T = L[x],
  55744. K = Q[x],
  55745. Y = 0,
  55746. X = T.length; Y < X; Y++)
  55747. H = i(T[Y], K[Y], V),
  55748. w ? l(H.x, H.y + u[E - 1].y, u[E - 1].x + k) : l(H.x, H.y, m + k)
  55749. }
  55750. o(),
  55751. a()
  55752. }
  55753. ,
  55754. n.ExtrudeGeometry.WorldUVGenerator = {
  55755. generateTopUV: function(e, t, i, r) {
  55756. var o = e.vertices
  55757. , a = o[t]
  55758. , s = o[i]
  55759. , l = o[r];
  55760. return [new n.Vector2(a.x,a.y), new n.Vector2(s.x,s.y), new n.Vector2(l.x,l.y)]
  55761. },
  55762. generateSideWallUV: function(e, t, i, r, o) {
  55763. var a = e.vertices
  55764. , s = a[t]
  55765. , l = a[i]
  55766. , c = a[r]
  55767. , h = a[o];
  55768. 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)]
  55769. }
  55770. },
  55771. n.ShapeGeometry = function(e, t) {
  55772. n.Geometry.call(this),
  55773. this.type = "ShapeGeometry",
  55774. Array.isArray(e) === !1 && (e = [e]),
  55775. this.addShapeList(e, t),
  55776. this.computeFaceNormals()
  55777. }
  55778. ,
  55779. n.ShapeGeometry.prototype = Object.create(n.Geometry.prototype),
  55780. n.ShapeGeometry.prototype.constructor = n.ShapeGeometry,
  55781. n.ShapeGeometry.prototype.addShapeList = function(e, t) {
  55782. for (var i = 0, n = e.length; i < n; i++)
  55783. this.addShape(e[i], t);
  55784. return this
  55785. }
  55786. ,
  55787. n.ShapeGeometry.prototype.addShape = function(e, t) {
  55788. void 0 === t && (t = {});
  55789. 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);
  55790. if (p) {
  55791. for (u = u.reverse(),
  55792. i = 0,
  55793. r = d.length; i < r; i++)
  55794. o = d[i],
  55795. n.ShapeUtils.isClockWise(o) && (d[i] = o.reverse());
  55796. p = !1
  55797. }
  55798. var f = n.ShapeUtils.triangulateShape(u, d);
  55799. for (i = 0,
  55800. r = d.length; i < r; i++)
  55801. o = d[i],
  55802. u = u.concat(o);
  55803. var g, m, v = u.length, A = f.length;
  55804. for (i = 0; i < v; i++)
  55805. g = u[i],
  55806. this.vertices.push(new n.Vector3(g.x,g.y,0));
  55807. for (i = 0; i < A; i++) {
  55808. m = f[i];
  55809. var y = m[0] + c
  55810. , C = m[1] + c
  55811. , I = m[2] + c;
  55812. this.faces.push(new n.Face3(y,C,I,null,null,s)),
  55813. this.faceVertexUvs[0].push(l.generateTopUV(this, y, C, I))
  55814. }
  55815. }
  55816. ,
  55817. n.LatheBufferGeometry = function(e, t, i, r) {
  55818. n.BufferGeometry.call(this),
  55819. this.type = "LatheBufferGeometry",
  55820. this.parameters = {
  55821. points: e,
  55822. segments: t,
  55823. phiStart: i,
  55824. phiLength: r
  55825. },
  55826. t = Math.floor(t) || 12,
  55827. i = i || 0,
  55828. r = r || 2 * Math.PI,
  55829. r = n.Math.clamp(r, 0, 2 * Math.PI);
  55830. 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),
  55831. 1 / t), m = new n.Vector3, v = new n.Vector2;
  55832. for (a = 0; a <= t; a++) {
  55833. var A = i + a * g * r
  55834. , y = Math.sin(A)
  55835. , C = Math.cos(A);
  55836. for (s = 0; s <= e.length - 1; s++)
  55837. m.x = e[s].x * y,
  55838. m.y = e[s].y,
  55839. m.z = e[s].x * C,
  55840. u.setXYZ(p, m.x, m.y, m.z),
  55841. v.x = a / t,
  55842. v.y = s / (e.length - 1),
  55843. d.setXY(p, v.x, v.y),
  55844. p++
  55845. }
  55846. for (a = 0; a < t; a++)
  55847. for (s = 0; s < e.length - 1; s++) {
  55848. o = s + a * e.length;
  55849. var I = o
  55850. , E = o + e.length
  55851. , b = o + e.length + 1
  55852. , w = o + 1;
  55853. h.setX(f, I),
  55854. f++,
  55855. h.setX(f, E),
  55856. f++,
  55857. h.setX(f, w),
  55858. f++,
  55859. h.setX(f, E),
  55860. f++,
  55861. h.setX(f, b),
  55862. f++,
  55863. h.setX(f, w),
  55864. f++
  55865. }
  55866. if (this.setIndex(h),
  55867. this.addAttribute("position", u),
  55868. this.addAttribute("uv", d),
  55869. this.computeVertexNormals(),
  55870. r === 2 * Math.PI) {
  55871. var _ = this.attributes.normal.array
  55872. , T = new n.Vector3
  55873. , x = new n.Vector3
  55874. , S = new n.Vector3;
  55875. for (o = t * e.length * 3,
  55876. a = 0,
  55877. s = 0; a < e.length; a++,
  55878. s += 3)
  55879. T.x = _[s + 0],
  55880. T.y = _[s + 1],
  55881. T.z = _[s + 2],
  55882. x.x = _[o + s + 0],
  55883. x.y = _[o + s + 1],
  55884. x.z = _[o + s + 2],
  55885. S.addVectors(T, x).normalize(),
  55886. _[s + 0] = _[o + s + 0] = S.x,
  55887. _[s + 1] = _[o + s + 1] = S.y,
  55888. _[s + 2] = _[o + s + 2] = S.z
  55889. }
  55890. }
  55891. ,
  55892. n.LatheBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  55893. n.LatheBufferGeometry.prototype.constructor = n.LatheBufferGeometry,
  55894. n.LatheGeometry = function(e, t, i, r) {
  55895. n.Geometry.call(this),
  55896. this.type = "LatheGeometry",
  55897. this.parameters = {
  55898. points: e,
  55899. segments: t,
  55900. phiStart: i,
  55901. phiLength: r
  55902. },
  55903. this.fromBufferGeometry(new n.LatheBufferGeometry(e,t,i,r)),
  55904. this.mergeVertices()
  55905. }
  55906. ,
  55907. n.LatheGeometry.prototype = Object.create(n.Geometry.prototype),
  55908. n.LatheGeometry.prototype.constructor = n.LatheGeometry,
  55909. n.PlaneGeometry = function(e, t, i, r) {
  55910. n.Geometry.call(this),
  55911. this.type = "PlaneGeometry",
  55912. this.parameters = {
  55913. width: e,
  55914. height: t,
  55915. widthSegments: i,
  55916. heightSegments: r
  55917. },
  55918. this.fromBufferGeometry(new n.PlaneBufferGeometry(e,t,i,r))
  55919. }
  55920. ,
  55921. n.PlaneGeometry.prototype = Object.create(n.Geometry.prototype),
  55922. n.PlaneGeometry.prototype.constructor = n.PlaneGeometry,
  55923. n.PlaneBufferGeometry = function(e, t, i, r) {
  55924. n.BufferGeometry.call(this),
  55925. this.type = "PlaneBufferGeometry",
  55926. this.parameters = {
  55927. width: e,
  55928. height: t,
  55929. widthSegments: i,
  55930. heightSegments: r
  55931. };
  55932. 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++)
  55933. for (var y = A * d - a, C = 0; C < c; C++) {
  55934. var I = C * u - o;
  55935. p[m] = I,
  55936. p[m + 1] = -y,
  55937. f[m + 2] = 1,
  55938. g[v] = C / s,
  55939. g[v + 1] = 1 - A / l,
  55940. m += 3,
  55941. v += 2
  55942. }
  55943. m = 0;
  55944. for (var E = new (p.length / 3 > 65535 ? Uint32Array : Uint16Array)(s * l * 6), A = 0; A < l; A++)
  55945. for (var C = 0; C < s; C++) {
  55946. var b = C + c * A
  55947. , w = C + c * (A + 1)
  55948. , _ = C + 1 + c * (A + 1)
  55949. , T = C + 1 + c * A;
  55950. E[m] = b,
  55951. E[m + 1] = w,
  55952. E[m + 2] = T,
  55953. E[m + 3] = w,
  55954. E[m + 4] = _,
  55955. E[m + 5] = T,
  55956. m += 6
  55957. }
  55958. this.setIndex(new n.BufferAttribute(E,1)),
  55959. this.addAttribute("position", new n.BufferAttribute(p,3)),
  55960. this.addAttribute("normal", new n.BufferAttribute(f,3)),
  55961. this.addAttribute("uv", new n.BufferAttribute(g,2))
  55962. }
  55963. ,
  55964. n.PlaneBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  55965. n.PlaneBufferGeometry.prototype.constructor = n.PlaneBufferGeometry,
  55966. n.RingBufferGeometry = function(e, t, i, r, o, a) {
  55967. n.BufferGeometry.call(this),
  55968. this.type = "RingBufferGeometry",
  55969. this.parameters = {
  55970. innerRadius: e,
  55971. outerRadius: t,
  55972. thetaSegments: i,
  55973. phiSegments: r,
  55974. thetaStart: o,
  55975. thetaLength: a
  55976. },
  55977. e = e || 20,
  55978. t = t || 50,
  55979. o = void 0 !== o ? o : 0,
  55980. a = void 0 !== a ? a : 2 * Math.PI,
  55981. i = void 0 !== i ? Math.max(3, i) : 8,
  55982. r = void 0 !== r ? Math.max(1, r) : 1;
  55983. 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;
  55984. for (l = 0; l <= r; l++) {
  55985. for (c = 0; c <= i; c++)
  55986. s = o + c / i * a,
  55987. C.x = A * Math.cos(s),
  55988. C.y = A * Math.sin(s),
  55989. p.setXYZ(m, C.x, C.y, C.z),
  55990. f.setXYZ(m, 0, 0, 1),
  55991. I.x = (C.x / t + 1) / 2,
  55992. I.y = (C.y / t + 1) / 2,
  55993. g.setXY(m, I.x, I.y),
  55994. m++;
  55995. A += y
  55996. }
  55997. for (l = 0; l < r; l++) {
  55998. var E = l * (i + 1);
  55999. for (c = 0; c < i; c++) {
  56000. s = c + E;
  56001. var b = s
  56002. , w = s + i + 1
  56003. , _ = s + i + 2
  56004. , T = s + 1;
  56005. d.setX(v, b),
  56006. v++,
  56007. d.setX(v, w),
  56008. v++,
  56009. d.setX(v, _),
  56010. v++,
  56011. d.setX(v, b),
  56012. v++,
  56013. d.setX(v, _),
  56014. v++,
  56015. d.setX(v, T),
  56016. v++
  56017. }
  56018. }
  56019. this.setIndex(d),
  56020. this.addAttribute("position", p),
  56021. this.addAttribute("normal", f),
  56022. this.addAttribute("uv", g)
  56023. }
  56024. ,
  56025. n.RingBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  56026. n.RingBufferGeometry.prototype.constructor = n.RingBufferGeometry,
  56027. n.RingGeometry = function(e, t, i, r, o, a) {
  56028. n.Geometry.call(this),
  56029. this.type = "RingGeometry",
  56030. this.parameters = {
  56031. innerRadius: e,
  56032. outerRadius: t,
  56033. thetaSegments: i,
  56034. phiSegments: r,
  56035. thetaStart: o,
  56036. thetaLength: a
  56037. },
  56038. this.fromBufferGeometry(new n.RingBufferGeometry(e,t,i,r,o,a))
  56039. }
  56040. ,
  56041. n.RingGeometry.prototype = Object.create(n.Geometry.prototype),
  56042. n.RingGeometry.prototype.constructor = n.RingGeometry,
  56043. n.SphereGeometry = function(e, t, i, r, o, a, s) {
  56044. n.Geometry.call(this),
  56045. this.type = "SphereGeometry",
  56046. this.parameters = {
  56047. radius: e,
  56048. widthSegments: t,
  56049. heightSegments: i,
  56050. phiStart: r,
  56051. phiLength: o,
  56052. thetaStart: a,
  56053. thetaLength: s
  56054. },
  56055. this.fromBufferGeometry(new n.SphereBufferGeometry(e,t,i,r,o,a,s))
  56056. }
  56057. ,
  56058. n.SphereGeometry.prototype = Object.create(n.Geometry.prototype),
  56059. n.SphereGeometry.prototype.constructor = n.SphereGeometry,
  56060. n.SphereBufferGeometry = function(e, t, i, r, o, a, s) {
  56061. n.BufferGeometry.call(this),
  56062. this.type = "SphereBufferGeometry",
  56063. this.parameters = {
  56064. radius: e,
  56065. widthSegments: t,
  56066. heightSegments: i,
  56067. phiStart: r,
  56068. phiLength: o,
  56069. thetaStart: a,
  56070. thetaLength: s
  56071. },
  56072. e = e || 50,
  56073. t = Math.max(3, Math.floor(t) || 8),
  56074. i = Math.max(2, Math.floor(i) || 6),
  56075. r = void 0 !== r ? r : 0,
  56076. o = void 0 !== o ? o : 2 * Math.PI,
  56077. a = void 0 !== a ? a : 0,
  56078. s = void 0 !== s ? s : Math.PI;
  56079. 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++) {
  56080. for (var v = [], A = m / i, y = 0; y <= t; y++) {
  56081. var C = y / t
  56082. , I = -e * Math.cos(r + C * o) * Math.sin(a + A * s)
  56083. , E = e * Math.cos(a + A * s)
  56084. , b = e * Math.sin(r + C * o) * Math.sin(a + A * s);
  56085. g.set(I, E, b).normalize(),
  56086. h.setXYZ(p, I, E, b),
  56087. u.setXYZ(p, g.x, g.y, g.z),
  56088. d.setXY(p, C, 1 - A),
  56089. v.push(p),
  56090. p++
  56091. }
  56092. f.push(v)
  56093. }
  56094. for (var w = [], m = 0; m < i; m++)
  56095. for (var y = 0; y < t; y++) {
  56096. var _ = f[m][y + 1]
  56097. , T = f[m][y]
  56098. , x = f[m + 1][y]
  56099. , S = f[m + 1][y + 1];
  56100. (0 !== m || a > 0) && w.push(_, T, S),
  56101. (m !== i - 1 || l < Math.PI) && w.push(T, x, S)
  56102. }
  56103. this.setIndex(new (h.count > 65535 ? n.Uint32Attribute : n.Uint16Attribute)(w,1)),
  56104. this.addAttribute("position", h),
  56105. this.addAttribute("normal", u),
  56106. this.addAttribute("uv", d),
  56107. this.boundingSphere = new n.Sphere(new n.Vector3,e)
  56108. }
  56109. ,
  56110. n.SphereBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  56111. n.SphereBufferGeometry.prototype.constructor = n.SphereBufferGeometry,
  56112. n.TextGeometry = function(e, t) {
  56113. t = t || {};
  56114. var i = t.font;
  56115. if (i instanceof n.Font == !1)
  56116. return console.error("THREE.TextGeometry: font parameter is not an instance of THREE.Font."),
  56117. new n.Geometry;
  56118. var r = i.generateShapes(e, t.size, t.curveSegments);
  56119. t.amount = void 0 !== t.height ? t.height : 50,
  56120. void 0 === t.bevelThickness && (t.bevelThickness = 10),
  56121. void 0 === t.bevelSize && (t.bevelSize = 8),
  56122. void 0 === t.bevelEnabled && (t.bevelEnabled = !1),
  56123. n.ExtrudeGeometry.call(this, r, t),
  56124. this.type = "TextGeometry"
  56125. }
  56126. ,
  56127. n.TextGeometry.prototype = Object.create(n.ExtrudeGeometry.prototype),
  56128. n.TextGeometry.prototype.constructor = n.TextGeometry,
  56129. n.TorusBufferGeometry = function(e, t, i, r, o) {
  56130. n.BufferGeometry.call(this),
  56131. this.type = "TorusBufferGeometry",
  56132. this.parameters = {
  56133. radius: e,
  56134. tube: t,
  56135. radialSegments: i,
  56136. tubularSegments: r,
  56137. arc: o
  56138. },
  56139. e = e || 100,
  56140. t = t || 40,
  56141. i = Math.floor(i) || 8,
  56142. r = Math.floor(r) || 6,
  56143. o = o || 2 * Math.PI;
  56144. 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;
  56145. for (a = 0; a <= i; a++)
  56146. for (s = 0; s <= r; s++) {
  56147. var C = s / r * o
  56148. , I = a / i * Math.PI * 2;
  56149. A.x = (e + t * Math.cos(I)) * Math.cos(C),
  56150. A.y = (e + t * Math.cos(I)) * Math.sin(C),
  56151. A.z = t * Math.sin(I),
  56152. u[f] = A.x,
  56153. u[f + 1] = A.y,
  56154. u[f + 2] = A.z,
  56155. v.x = e * Math.cos(C),
  56156. v.y = e * Math.sin(C),
  56157. y.subVectors(A, v).normalize(),
  56158. d[f] = y.x,
  56159. d[f + 1] = y.y,
  56160. d[f + 2] = y.z,
  56161. p[g] = s / r,
  56162. p[g + 1] = a / i,
  56163. f += 3,
  56164. g += 2
  56165. }
  56166. for (a = 1; a <= i; a++)
  56167. for (s = 1; s <= r; s++) {
  56168. var E = (r + 1) * a + s - 1
  56169. , b = (r + 1) * (a - 1) + s - 1
  56170. , w = (r + 1) * (a - 1) + s
  56171. , _ = (r + 1) * a + s;
  56172. h[m] = E,
  56173. h[m + 1] = b,
  56174. h[m + 2] = _,
  56175. h[m + 3] = b,
  56176. h[m + 4] = w,
  56177. h[m + 5] = _,
  56178. m += 6
  56179. }
  56180. this.setIndex(new n.BufferAttribute(h,1)),
  56181. this.addAttribute("position", new n.BufferAttribute(u,3)),
  56182. this.addAttribute("normal", new n.BufferAttribute(d,3)),
  56183. this.addAttribute("uv", new n.BufferAttribute(p,2))
  56184. }
  56185. ,
  56186. n.TorusBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  56187. n.TorusBufferGeometry.prototype.constructor = n.TorusBufferGeometry,
  56188. n.TorusGeometry = function(e, t, i, r, o) {
  56189. n.Geometry.call(this),
  56190. this.type = "TorusGeometry",
  56191. this.parameters = {
  56192. radius: e,
  56193. tube: t,
  56194. radialSegments: i,
  56195. tubularSegments: r,
  56196. arc: o
  56197. },
  56198. this.fromBufferGeometry(new n.TorusBufferGeometry(e,t,i,r,o))
  56199. }
  56200. ,
  56201. n.TorusGeometry.prototype = Object.create(n.Geometry.prototype),
  56202. n.TorusGeometry.prototype.constructor = n.TorusGeometry,
  56203. n.TorusKnotBufferGeometry = function(e, t, i, r, o, a) {
  56204. function s(e, t, i, n, r) {
  56205. var o = Math.cos(e)
  56206. , a = Math.sin(e)
  56207. , s = i / t * e
  56208. , l = Math.cos(s);
  56209. r.x = n * (2 + l) * .5 * o,
  56210. r.y = n * (2 + l) * a * .5,
  56211. r.z = n * Math.sin(s) * .5
  56212. }
  56213. n.BufferGeometry.call(this),
  56214. this.type = "TorusKnotBufferGeometry",
  56215. this.parameters = {
  56216. radius: e,
  56217. tube: t,
  56218. tubularSegments: i,
  56219. radialSegments: r,
  56220. p: o,
  56221. q: a
  56222. },
  56223. e = e || 100,
  56224. t = t || 40,
  56225. i = Math.floor(i) || 64,
  56226. r = Math.floor(r) || 8,
  56227. o = o || 2,
  56228. a = a || 3;
  56229. 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;
  56230. for (l = 0; l <= i; ++l) {
  56231. var T = l / i * o * Math.PI * 2;
  56232. for (s(T, o, a, e, I),
  56233. s(T + .01, o, a, e, E),
  56234. w.subVectors(E, I),
  56235. _.addVectors(E, I),
  56236. b.crossVectors(w, _),
  56237. _.crossVectors(b, w),
  56238. b.normalize(),
  56239. _.normalize(),
  56240. c = 0; c <= r; ++c) {
  56241. var x = c / r * Math.PI * 2
  56242. , S = -t * Math.cos(x)
  56243. , M = t * Math.sin(x);
  56244. A.x = I.x + (S * _.x + M * b.x),
  56245. A.y = I.y + (S * _.y + M * b.y),
  56246. A.z = I.z + (S * _.z + M * b.z),
  56247. p.setXYZ(m, A.x, A.y, A.z),
  56248. y.subVectors(A, I).normalize(),
  56249. f.setXYZ(m, y.x, y.y, y.z),
  56250. C.x = l / i,
  56251. C.y = c / r,
  56252. g.setXY(m, C.x, C.y),
  56253. m++
  56254. }
  56255. }
  56256. for (c = 1; c <= i; c++)
  56257. for (l = 1; l <= r; l++) {
  56258. var R = (r + 1) * (c - 1) + (l - 1)
  56259. , P = (r + 1) * c + (l - 1)
  56260. , O = (r + 1) * c + l
  56261. , L = (r + 1) * (c - 1) + l;
  56262. d.setX(v, R),
  56263. v++,
  56264. d.setX(v, P),
  56265. v++,
  56266. d.setX(v, L),
  56267. v++,
  56268. d.setX(v, P),
  56269. v++,
  56270. d.setX(v, O),
  56271. v++,
  56272. d.setX(v, L),
  56273. v++
  56274. }
  56275. this.setIndex(d),
  56276. this.addAttribute("position", p),
  56277. this.addAttribute("normal", f),
  56278. this.addAttribute("uv", g)
  56279. }
  56280. ,
  56281. n.TorusKnotBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  56282. n.TorusKnotBufferGeometry.prototype.constructor = n.TorusKnotBufferGeometry,
  56283. n.TorusKnotGeometry = function(e, t, i, r, o, a, s) {
  56284. n.Geometry.call(this),
  56285. this.type = "TorusKnotGeometry",
  56286. this.parameters = {
  56287. radius: e,
  56288. tube: t,
  56289. tubularSegments: i,
  56290. radialSegments: r,
  56291. p: o,
  56292. q: a
  56293. },
  56294. void 0 !== s && console.warn("THREE.TorusKnotGeometry: heightScale has been deprecated. Use .scale( x, y, z ) instead."),
  56295. this.fromBufferGeometry(new n.TorusKnotBufferGeometry(e,t,i,r,o,a)),
  56296. this.mergeVertices()
  56297. }
  56298. ,
  56299. n.TorusKnotGeometry.prototype = Object.create(n.Geometry.prototype),
  56300. n.TorusKnotGeometry.prototype.constructor = n.TorusKnotGeometry,
  56301. n.TubeGeometry = function(e, t, i, r, o, a) {
  56302. function s(e, t, i) {
  56303. return R.vertices.push(new n.Vector3(e,t,i)) - 1
  56304. }
  56305. n.Geometry.call(this),
  56306. this.type = "TubeGeometry",
  56307. this.parameters = {
  56308. path: e,
  56309. segments: t,
  56310. radius: i,
  56311. radialSegments: r,
  56312. closed: o,
  56313. taper: a
  56314. },
  56315. t = t || 64,
  56316. i = i || 1,
  56317. r = r || 8,
  56318. o = o || !1,
  56319. a = a || n.TubeGeometry.NoTaper;
  56320. 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;
  56321. for (this.tangents = D,
  56322. this.normals = N,
  56323. this.binormals = B,
  56324. v = 0; v < P; v++)
  56325. for (M[v] = [],
  56326. u = v / (P - 1),
  56327. m = e.getPointAt(u),
  56328. l = D[v],
  56329. c = N[v],
  56330. h = B[v],
  56331. p = i * a(u),
  56332. A = 0; A < r; A++)
  56333. d = A / r * 2 * Math.PI,
  56334. f = -p * Math.cos(d),
  56335. g = p * Math.sin(d),
  56336. O.copy(m),
  56337. O.x += f * c.x + g * h.x,
  56338. O.y += f * c.y + g * h.y,
  56339. O.z += f * c.z + g * h.z,
  56340. M[v][A] = s(O.x, O.y, O.z);
  56341. for (v = 0; v < t; v++)
  56342. for (A = 0; A < r; A++)
  56343. y = o ? (v + 1) % t : v + 1,
  56344. C = (A + 1) % r,
  56345. I = M[v][A],
  56346. E = M[y][A],
  56347. b = M[y][C],
  56348. w = M[v][C],
  56349. _ = new n.Vector2(v / t,A / r),
  56350. T = new n.Vector2((v + 1) / t,A / r),
  56351. x = new n.Vector2((v + 1) / t,(A + 1) / r),
  56352. S = new n.Vector2(v / t,(A + 1) / r),
  56353. this.faces.push(new n.Face3(I,E,w)),
  56354. this.faceVertexUvs[0].push([_, T, S]),
  56355. this.faces.push(new n.Face3(E,b,w)),
  56356. this.faceVertexUvs[0].push([T.clone(), x, S.clone()]);
  56357. this.computeFaceNormals(),
  56358. this.computeVertexNormals()
  56359. }
  56360. ,
  56361. n.TubeGeometry.prototype = Object.create(n.Geometry.prototype),
  56362. n.TubeGeometry.prototype.constructor = n.TubeGeometry,
  56363. n.TubeGeometry.NoTaper = function(e) {
  56364. return 1
  56365. }
  56366. ,
  56367. n.TubeGeometry.SinusoidalTaper = function(e) {
  56368. return Math.sin(Math.PI * e)
  56369. }
  56370. ,
  56371. n.TubeGeometry.FrenetFrames = function(e, t, i) {
  56372. function r() {
  56373. f[0] = new n.Vector3,
  56374. g[0] = new n.Vector3,
  56375. a = Number.MAX_VALUE,
  56376. s = Math.abs(p[0].x),
  56377. l = Math.abs(p[0].y),
  56378. c = Math.abs(p[0].z),
  56379. s <= a && (a = s,
  56380. d.set(1, 0, 0)),
  56381. l <= a && (a = l,
  56382. d.set(0, 1, 0)),
  56383. c <= a && d.set(0, 0, 1),
  56384. m.crossVectors(p[0], d).normalize(),
  56385. f[0].crossVectors(p[0], m),
  56386. g[0].crossVectors(p[0], f[0])
  56387. }
  56388. 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;
  56389. for (this.tangents = p,
  56390. this.normals = f,
  56391. this.binormals = g,
  56392. h = 0; h < A; h++)
  56393. u = h / (A - 1),
  56394. p[h] = e.getTangentAt(u),
  56395. p[h].normalize();
  56396. for (r(),
  56397. h = 1; h < A; h++)
  56398. f[h] = f[h - 1].clone(),
  56399. g[h] = g[h - 1].clone(),
  56400. m.crossVectors(p[h - 1], p[h]),
  56401. m.length() > Number.EPSILON && (m.normalize(),
  56402. o = Math.acos(n.Math.clamp(p[h - 1].dot(p[h]), -1, 1)),
  56403. f[h].applyMatrix4(v.makeRotationAxis(m, o))),
  56404. g[h].crossVectors(p[h], f[h]);
  56405. if (i)
  56406. for (o = Math.acos(n.Math.clamp(f[0].dot(f[A - 1]), -1, 1)),
  56407. o /= A - 1,
  56408. p[0].dot(m.crossVectors(f[0], f[A - 1])) > 0 && (o = -o),
  56409. h = 1; h < A; h++)
  56410. f[h].applyMatrix4(v.makeRotationAxis(p[h], o * h)),
  56411. g[h].crossVectors(p[h], f[h])
  56412. }
  56413. ,
  56414. n.PolyhedronGeometry = function(e, t, i, r) {
  56415. function o(e) {
  56416. var t = e.normalize().clone();
  56417. t.index = u.vertices.push(t) - 1;
  56418. var i = l(e) / 2 / Math.PI + .5
  56419. , r = c(e) / Math.PI + .5;
  56420. return t.uv = new n.Vector2(i,1 - r),
  56421. t
  56422. }
  56423. function a(e, t, i, r) {
  56424. var o = new n.Face3(e.index,t.index,i.index,[e.clone(), t.clone(), i.clone()],void 0,r);
  56425. u.faces.push(o),
  56426. C.copy(e).add(t).add(i).divideScalar(3);
  56427. var a = l(C);
  56428. u.faceVertexUvs[0].push([h(e.uv, e, a), h(t.uv, t, a), h(i.uv, i, a)])
  56429. }
  56430. function s(e, t) {
  56431. 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++) {
  56432. l[h] = [];
  56433. 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++)
  56434. 0 === g && h === i ? l[h][g] = d : l[h][g] = o(d.clone().lerp(p, g / f))
  56435. }
  56436. for (var h = 0; h < i; h++)
  56437. for (var g = 0; g < 2 * (i - h) - 1; g++) {
  56438. var m = Math.floor(g / 2);
  56439. 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)
  56440. }
  56441. }
  56442. function l(e) {
  56443. return Math.atan2(e.z, -e.x)
  56444. }
  56445. function c(e) {
  56446. return Math.atan2(-e.y, Math.sqrt(e.x * e.x + e.z * e.z))
  56447. }
  56448. function h(e, t, i) {
  56449. return i < 0 && 1 === e.x && (e = new n.Vector2(e.x - 1,e.y)),
  56450. 0 === t.x && 0 === t.z && (e = new n.Vector2(i / 2 / Math.PI + .5,e.y)),
  56451. e.clone()
  56452. }
  56453. n.Geometry.call(this),
  56454. this.type = "PolyhedronGeometry",
  56455. this.parameters = {
  56456. vertices: e,
  56457. indices: t,
  56458. radius: i,
  56459. detail: r
  56460. },
  56461. i = i || 1,
  56462. r = r || 0;
  56463. for (var u = this, d = 0, p = e.length; d < p; d += 3)
  56464. o(new n.Vector3(e[d],e[d + 1],e[d + 2]));
  56465. for (var f = this.vertices, g = [], d = 0, m = 0, p = t.length; d < p; d += 3,
  56466. m++) {
  56467. var v = f[t[d]]
  56468. , A = f[t[d + 1]]
  56469. , y = f[t[d + 2]];
  56470. g[m] = new n.Face3(v.index,A.index,y.index,[v.clone(), A.clone(), y.clone()],void 0,m)
  56471. }
  56472. for (var C = new n.Vector3, d = 0, p = g.length; d < p; d++)
  56473. s(g[d], r);
  56474. for (var d = 0, p = this.faceVertexUvs[0].length; d < p; d++) {
  56475. var I = this.faceVertexUvs[0][d]
  56476. , E = I[0].x
  56477. , b = I[1].x
  56478. , w = I[2].x
  56479. , _ = Math.max(E, b, w)
  56480. , T = Math.min(E, b, w);
  56481. _ > .9 && T < .1 && (E < .2 && (I[0].x += 1),
  56482. b < .2 && (I[1].x += 1),
  56483. w < .2 && (I[2].x += 1))
  56484. }
  56485. for (var d = 0, p = this.vertices.length; d < p; d++)
  56486. this.vertices[d].multiplyScalar(i);
  56487. this.mergeVertices(),
  56488. this.computeFaceNormals(),
  56489. this.boundingSphere = new n.Sphere(new n.Vector3,i)
  56490. }
  56491. ,
  56492. n.PolyhedronGeometry.prototype = Object.create(n.Geometry.prototype),
  56493. n.PolyhedronGeometry.prototype.constructor = n.PolyhedronGeometry,
  56494. n.DodecahedronGeometry = function(e, t) {
  56495. var i = (1 + Math.sqrt(5)) / 2
  56496. , r = 1 / i
  56497. , 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]
  56498. , 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];
  56499. n.PolyhedronGeometry.call(this, o, a, e, t),
  56500. this.type = "DodecahedronGeometry",
  56501. this.parameters = {
  56502. radius: e,
  56503. detail: t
  56504. }
  56505. }
  56506. ,
  56507. n.DodecahedronGeometry.prototype = Object.create(n.PolyhedronGeometry.prototype),
  56508. n.DodecahedronGeometry.prototype.constructor = n.DodecahedronGeometry,
  56509. n.IcosahedronGeometry = function(e, t) {
  56510. var i = (1 + Math.sqrt(5)) / 2
  56511. , 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]
  56512. , 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];
  56513. n.PolyhedronGeometry.call(this, r, o, e, t),
  56514. this.type = "IcosahedronGeometry",
  56515. this.parameters = {
  56516. radius: e,
  56517. detail: t
  56518. }
  56519. }
  56520. ,
  56521. n.IcosahedronGeometry.prototype = Object.create(n.PolyhedronGeometry.prototype),
  56522. n.IcosahedronGeometry.prototype.constructor = n.IcosahedronGeometry,
  56523. n.OctahedronGeometry = function(e, t) {
  56524. var i = [1, 0, 0, -1, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 1, 0, 0, -1]
  56525. , 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];
  56526. n.PolyhedronGeometry.call(this, i, r, e, t),
  56527. this.type = "OctahedronGeometry",
  56528. this.parameters = {
  56529. radius: e,
  56530. detail: t
  56531. }
  56532. }
  56533. ,
  56534. n.OctahedronGeometry.prototype = Object.create(n.PolyhedronGeometry.prototype),
  56535. n.OctahedronGeometry.prototype.constructor = n.OctahedronGeometry,
  56536. n.TetrahedronGeometry = function(e, t) {
  56537. var i = [1, 1, 1, -1, -1, 1, -1, 1, -1, 1, -1, -1]
  56538. , r = [2, 1, 0, 0, 3, 2, 1, 3, 0, 2, 3, 1];
  56539. n.PolyhedronGeometry.call(this, i, r, e, t),
  56540. this.type = "TetrahedronGeometry",
  56541. this.parameters = {
  56542. radius: e,
  56543. detail: t
  56544. }
  56545. }
  56546. ,
  56547. n.TetrahedronGeometry.prototype = Object.create(n.PolyhedronGeometry.prototype),
  56548. n.TetrahedronGeometry.prototype.constructor = n.TetrahedronGeometry,
  56549. n.ParametricGeometry = function(e, t, i) {
  56550. n.Geometry.call(this),
  56551. this.type = "ParametricGeometry",
  56552. this.parameters = {
  56553. func: e,
  56554. slices: t,
  56555. stacks: i
  56556. };
  56557. var r, o, a, s, l, c = this.vertices, h = this.faces, u = this.faceVertexUvs[0], d = t + 1;
  56558. for (r = 0; r <= i; r++)
  56559. for (l = r / i,
  56560. o = 0; o <= t; o++)
  56561. s = o / t,
  56562. a = e(s, l),
  56563. c.push(a);
  56564. var p, f, g, m, v, A, y, C;
  56565. for (r = 0; r < i; r++)
  56566. for (o = 0; o < t; o++)
  56567. p = r * d + o,
  56568. f = r * d + o + 1,
  56569. g = (r + 1) * d + o + 1,
  56570. m = (r + 1) * d + o,
  56571. v = new n.Vector2(o / t,r / i),
  56572. A = new n.Vector2((o + 1) / t,r / i),
  56573. y = new n.Vector2((o + 1) / t,(r + 1) / i),
  56574. C = new n.Vector2(o / t,(r + 1) / i),
  56575. h.push(new n.Face3(p,f,m)),
  56576. u.push([v, A, C]),
  56577. h.push(new n.Face3(f,g,m)),
  56578. u.push([A.clone(), y, C.clone()]);
  56579. this.computeFaceNormals(),
  56580. this.computeVertexNormals()
  56581. }
  56582. ,
  56583. n.ParametricGeometry.prototype = Object.create(n.Geometry.prototype),
  56584. n.ParametricGeometry.prototype.constructor = n.ParametricGeometry,
  56585. n.WireframeGeometry = function(e) {
  56586. function t(e, t) {
  56587. return e - t
  56588. }
  56589. n.BufferGeometry.call(this);
  56590. var i = [0, 0]
  56591. , r = {}
  56592. , o = ["a", "b", "c"];
  56593. if (e instanceof n.Geometry) {
  56594. for (var a = e.vertices, s = e.faces, l = 0, c = new Uint32Array(6 * s.length), h = 0, u = s.length; h < u; h++)
  56595. for (var d = s[h], p = 0; p < 3; p++) {
  56596. i[0] = d[o[p]],
  56597. i[1] = d[o[(p + 1) % 3]],
  56598. i.sort(t);
  56599. var f = i.toString();
  56600. void 0 === r[f] && (c[2 * l] = i[0],
  56601. c[2 * l + 1] = i[1],
  56602. r[f] = !0,
  56603. l++)
  56604. }
  56605. for (var g = new Float32Array(2 * l * 3), h = 0, u = l; h < u; h++)
  56606. for (var p = 0; p < 2; p++) {
  56607. var m = a[c[2 * h + p]]
  56608. , v = 6 * h + 3 * p;
  56609. g[v + 0] = m.x,
  56610. g[v + 1] = m.y,
  56611. g[v + 2] = m.z
  56612. }
  56613. this.addAttribute("position", new n.BufferAttribute(g,3))
  56614. } else if (e instanceof n.BufferGeometry)
  56615. if (null !== e.index) {
  56616. var A = e.index.array
  56617. , a = e.attributes.position
  56618. , y = e.groups
  56619. , l = 0;
  56620. 0 === y.length && e.addGroup(0, A.length);
  56621. for (var c = new Uint32Array(2 * A.length), C = 0, I = y.length; C < I; ++C)
  56622. for (var E = y[C], b = E.start, w = E.count, h = b, _ = b + w; h < _; h += 3)
  56623. for (var p = 0; p < 3; p++) {
  56624. i[0] = A[h + p],
  56625. i[1] = A[h + (p + 1) % 3],
  56626. i.sort(t);
  56627. var f = i.toString();
  56628. void 0 === r[f] && (c[2 * l] = i[0],
  56629. c[2 * l + 1] = i[1],
  56630. r[f] = !0,
  56631. l++)
  56632. }
  56633. for (var g = new Float32Array(2 * l * 3), h = 0, u = l; h < u; h++)
  56634. for (var p = 0; p < 2; p++) {
  56635. var v = 6 * h + 3 * p
  56636. , T = c[2 * h + p];
  56637. g[v + 0] = a.getX(T),
  56638. g[v + 1] = a.getY(T),
  56639. g[v + 2] = a.getZ(T)
  56640. }
  56641. this.addAttribute("position", new n.BufferAttribute(g,3))
  56642. } else {
  56643. 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++)
  56644. for (var p = 0; p < 3; p++) {
  56645. var v = 18 * h + 6 * p
  56646. , S = 9 * h + 3 * p;
  56647. g[v + 0] = a[S],
  56648. g[v + 1] = a[S + 1],
  56649. g[v + 2] = a[S + 2];
  56650. var T = 9 * h + 3 * ((p + 1) % 3);
  56651. g[v + 3] = a[T],
  56652. g[v + 4] = a[T + 1],
  56653. g[v + 5] = a[T + 2]
  56654. }
  56655. this.addAttribute("position", new n.BufferAttribute(g,3))
  56656. }
  56657. }
  56658. ,
  56659. n.WireframeGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  56660. n.WireframeGeometry.prototype.constructor = n.WireframeGeometry,
  56661. n.AxisHelper = function(e) {
  56662. e = e || 1;
  56663. var t = new Float32Array([0, 0, 0, e, 0, 0, 0, 0, 0, 0, e, 0, 0, 0, 0, 0, 0, e])
  56664. , i = new Float32Array([1, 0, 0, 1, .6, 0, 0, 1, 0, .6, 1, 0, 0, 0, 1, 0, .6, 1])
  56665. , r = new n.BufferGeometry;
  56666. r.addAttribute("position", new n.BufferAttribute(t,3)),
  56667. r.addAttribute("color", new n.BufferAttribute(i,3));
  56668. var o = new n.LineBasicMaterial({
  56669. vertexColors: n.VertexColors
  56670. });
  56671. n.LineSegments.call(this, r, o)
  56672. }
  56673. ,
  56674. n.AxisHelper.prototype = Object.create(n.LineSegments.prototype),
  56675. n.AxisHelper.prototype.constructor = n.AxisHelper,
  56676. n.ArrowHelper = function() {
  56677. var e = new n.Geometry;
  56678. e.vertices.push(new n.Vector3(0,0,0), new n.Vector3(0,1,0));
  56679. var t = new n.CylinderGeometry(0,.5,1,5,1);
  56680. return t.translate(0, -.5, 0),
  56681. function(i, r, o, a, s, l) {
  56682. n.Object3D.call(this),
  56683. void 0 === a && (a = 16776960),
  56684. void 0 === o && (o = 1),
  56685. void 0 === s && (s = .2 * o),
  56686. void 0 === l && (l = .2 * s),
  56687. this.position.copy(r),
  56688. this.line = new n.Line(e,new n.LineBasicMaterial({
  56689. color: a
  56690. })),
  56691. this.line.matrixAutoUpdate = !1,
  56692. this.add(this.line),
  56693. this.cone = new n.Mesh(t,new n.MeshBasicMaterial({
  56694. color: a
  56695. })),
  56696. this.cone.matrixAutoUpdate = !1,
  56697. this.add(this.cone),
  56698. this.setDirection(i),
  56699. this.setLength(o, s, l)
  56700. }
  56701. }(),
  56702. n.ArrowHelper.prototype = Object.create(n.Object3D.prototype),
  56703. n.ArrowHelper.prototype.constructor = n.ArrowHelper,
  56704. n.ArrowHelper.prototype.setDirection = function() {
  56705. var e, t = new n.Vector3;
  56706. return function(i) {
  56707. 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(),
  56708. e = Math.acos(i.y),
  56709. this.quaternion.setFromAxisAngle(t, e))
  56710. }
  56711. }(),
  56712. n.ArrowHelper.prototype.setLength = function(e, t, i) {
  56713. void 0 === t && (t = .2 * e),
  56714. void 0 === i && (i = .2 * t),
  56715. this.line.scale.set(1, Math.max(0, e - t), 1),
  56716. this.line.updateMatrix(),
  56717. this.cone.scale.set(i, t, i),
  56718. this.cone.position.y = e,
  56719. this.cone.updateMatrix()
  56720. }
  56721. ,
  56722. n.ArrowHelper.prototype.setColor = function(e) {
  56723. this.line.material.color.set(e),
  56724. this.cone.material.color.set(e)
  56725. }
  56726. ,
  56727. n.BoxHelper = function(e) {
  56728. 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])
  56729. , i = new Float32Array(24)
  56730. , r = new n.BufferGeometry;
  56731. r.setIndex(new n.BufferAttribute(t,1)),
  56732. r.addAttribute("position", new n.BufferAttribute(i,3)),
  56733. n.LineSegments.call(this, r, new n.LineBasicMaterial({
  56734. color: 16776960
  56735. })),
  56736. void 0 !== e && this.update(e)
  56737. }
  56738. ,
  56739. n.BoxHelper.prototype = Object.create(n.LineSegments.prototype),
  56740. n.BoxHelper.prototype.constructor = n.BoxHelper,
  56741. n.BoxHelper.prototype.update = function() {
  56742. var e = new n.Box3;
  56743. return function(t) {
  56744. if (e.setFromObject(t),
  56745. !e.isEmpty()) {
  56746. var i = e.min
  56747. , n = e.max
  56748. , r = this.geometry.attributes.position
  56749. , o = r.array;
  56750. o[0] = n.x,
  56751. o[1] = n.y,
  56752. o[2] = n.z,
  56753. o[3] = i.x,
  56754. o[4] = n.y,
  56755. o[5] = n.z,
  56756. o[6] = i.x,
  56757. o[7] = i.y,
  56758. o[8] = n.z,
  56759. o[9] = n.x,
  56760. o[10] = i.y,
  56761. o[11] = n.z,
  56762. o[12] = n.x,
  56763. o[13] = n.y,
  56764. o[14] = i.z,
  56765. o[15] = i.x,
  56766. o[16] = n.y,
  56767. o[17] = i.z,
  56768. o[18] = i.x,
  56769. o[19] = i.y,
  56770. o[20] = i.z,
  56771. o[21] = n.x,
  56772. o[22] = i.y,
  56773. o[23] = i.z,
  56774. r.needsUpdate = !0,
  56775. this.geometry.computeBoundingSphere()
  56776. }
  56777. }
  56778. }(),
  56779. n.BoundingBoxHelper = function(e, t) {
  56780. var i = void 0 !== t ? t : 8947848;
  56781. this.object = e,
  56782. this.box = new n.Box3,
  56783. n.Mesh.call(this, new n.BoxGeometry(1,1,1), new n.MeshBasicMaterial({
  56784. color: i,
  56785. wireframe: !0
  56786. }))
  56787. }
  56788. ,
  56789. n.BoundingBoxHelper.prototype = Object.create(n.Mesh.prototype),
  56790. n.BoundingBoxHelper.prototype.constructor = n.BoundingBoxHelper,
  56791. n.BoundingBoxHelper.prototype.update = function() {
  56792. this.box.setFromObject(this.object),
  56793. this.box.size(this.scale),
  56794. this.box.center(this.position)
  56795. }
  56796. ,
  56797. n.CameraHelper = function(e) {
  56798. function t(e, t, n) {
  56799. i(e, n),
  56800. i(t, n)
  56801. }
  56802. function i(e, t) {
  56803. r.vertices.push(new n.Vector3),
  56804. r.colors.push(new n.Color(t)),
  56805. void 0 === a[e] && (a[e] = []),
  56806. a[e].push(r.vertices.length - 1)
  56807. }
  56808. var r = new n.Geometry
  56809. , o = new n.LineBasicMaterial({
  56810. color: 16777215,
  56811. vertexColors: n.FaceColors
  56812. })
  56813. , a = {}
  56814. , s = 16755200
  56815. , l = 16711680
  56816. , c = 43775
  56817. , h = 16777215
  56818. , u = 3355443;
  56819. t("n1", "n2", s),
  56820. t("n2", "n4", s),
  56821. t("n4", "n3", s),
  56822. t("n3", "n1", s),
  56823. t("f1", "f2", s),
  56824. t("f2", "f4", s),
  56825. t("f4", "f3", s),
  56826. t("f3", "f1", s),
  56827. t("n1", "f1", s),
  56828. t("n2", "f2", s),
  56829. t("n3", "f3", s),
  56830. t("n4", "f4", s),
  56831. t("p", "n1", l),
  56832. t("p", "n2", l),
  56833. t("p", "n3", l),
  56834. t("p", "n4", l),
  56835. t("u1", "u2", c),
  56836. t("u2", "u3", c),
  56837. t("u3", "u1", c),
  56838. t("c", "t", h),
  56839. t("p", "c", u),
  56840. t("cn1", "cn2", u),
  56841. t("cn3", "cn4", u),
  56842. t("cf1", "cf2", u),
  56843. t("cf3", "cf4", u),
  56844. n.LineSegments.call(this, r, o),
  56845. this.camera = e,
  56846. this.camera.updateProjectionMatrix(),
  56847. this.matrix = e.matrixWorld,
  56848. this.matrixAutoUpdate = !1,
  56849. this.pointMap = a,
  56850. this.update()
  56851. }
  56852. ,
  56853. n.CameraHelper.prototype = Object.create(n.LineSegments.prototype),
  56854. n.CameraHelper.prototype.constructor = n.CameraHelper,
  56855. n.CameraHelper.prototype.update = function() {
  56856. function e(e, n, a, s) {
  56857. r.set(n, a, s).unproject(o);
  56858. var l = i[e];
  56859. if (void 0 !== l)
  56860. for (var c = 0, h = l.length; c < h; c++)
  56861. t.vertices[l[c]].copy(r)
  56862. }
  56863. var t, i, r = new n.Vector3, o = new n.Camera;
  56864. return function() {
  56865. t = this.geometry,
  56866. i = this.pointMap;
  56867. var n = 1
  56868. , r = 1;
  56869. o.projectionMatrix.copy(this.camera.projectionMatrix),
  56870. e("c", 0, 0, -1),
  56871. e("t", 0, 0, 1),
  56872. e("n1", -n, -r, -1),
  56873. e("n2", n, -r, -1),
  56874. e("n3", -n, r, -1),
  56875. e("n4", n, r, -1),
  56876. e("f1", -n, -r, 1),
  56877. e("f2", n, -r, 1),
  56878. e("f3", -n, r, 1),
  56879. e("f4", n, r, 1),
  56880. e("u1", .7 * n, 1.1 * r, -1),
  56881. e("u2", .7 * -n, 1.1 * r, -1),
  56882. e("u3", 0, 2 * r, -1),
  56883. e("cf1", -n, 0, 1),
  56884. e("cf2", n, 0, 1),
  56885. e("cf3", 0, -r, 1),
  56886. e("cf4", 0, r, 1),
  56887. e("cn1", -n, 0, -1),
  56888. e("cn2", n, 0, -1),
  56889. e("cn3", 0, -r, -1),
  56890. e("cn4", 0, r, -1),
  56891. t.verticesNeedUpdate = !0
  56892. }
  56893. }(),
  56894. n.DirectionalLightHelper = function(e, t) {
  56895. n.Object3D.call(this),
  56896. this.light = e,
  56897. this.light.updateMatrixWorld(),
  56898. this.matrix = e.matrixWorld,
  56899. this.matrixAutoUpdate = !1,
  56900. t = t || 1;
  56901. var i = new n.Geometry;
  56902. 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));
  56903. var r = new n.LineBasicMaterial({
  56904. fog: !1
  56905. });
  56906. r.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  56907. this.lightPlane = new n.Line(i,r),
  56908. this.add(this.lightPlane),
  56909. i = new n.Geometry,
  56910. i.vertices.push(new n.Vector3, new n.Vector3),
  56911. r = new n.LineBasicMaterial({
  56912. fog: !1
  56913. }),
  56914. r.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  56915. this.targetLine = new n.Line(i,r),
  56916. this.add(this.targetLine),
  56917. this.update()
  56918. }
  56919. ,
  56920. n.DirectionalLightHelper.prototype = Object.create(n.Object3D.prototype),
  56921. n.DirectionalLightHelper.prototype.constructor = n.DirectionalLightHelper,
  56922. n.DirectionalLightHelper.prototype.dispose = function() {
  56923. this.lightPlane.geometry.dispose(),
  56924. this.lightPlane.material.dispose(),
  56925. this.targetLine.geometry.dispose(),
  56926. this.targetLine.material.dispose()
  56927. }
  56928. ,
  56929. n.DirectionalLightHelper.prototype.update = function() {
  56930. var e = new n.Vector3
  56931. , t = new n.Vector3
  56932. , i = new n.Vector3;
  56933. return function() {
  56934. e.setFromMatrixPosition(this.light.matrixWorld),
  56935. t.setFromMatrixPosition(this.light.target.matrixWorld),
  56936. i.subVectors(t, e),
  56937. this.lightPlane.lookAt(i),
  56938. this.lightPlane.material.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  56939. this.targetLine.geometry.vertices[1].copy(i),
  56940. this.targetLine.geometry.verticesNeedUpdate = !0,
  56941. this.targetLine.material.color.copy(this.lightPlane.material.color)
  56942. }
  56943. }(),
  56944. n.EdgesHelper = function(e, t, i) {
  56945. var r = void 0 !== t ? t : 16777215;
  56946. n.LineSegments.call(this, new n.EdgesGeometry(e.geometry,i), new n.LineBasicMaterial({
  56947. color: r
  56948. })),
  56949. this.matrix = e.matrixWorld,
  56950. this.matrixAutoUpdate = !1
  56951. }
  56952. ,
  56953. n.EdgesHelper.prototype = Object.create(n.LineSegments.prototype),
  56954. n.EdgesHelper.prototype.constructor = n.EdgesHelper,
  56955. n.FaceNormalsHelper = function(e, t, i, r) {
  56956. this.object = e,
  56957. this.size = void 0 !== t ? t : 1;
  56958. var o = void 0 !== i ? i : 16776960
  56959. , a = void 0 !== r ? r : 1
  56960. , s = 0
  56961. , l = this.object.geometry;
  56962. l instanceof n.Geometry ? s = l.faces.length : console.warn("THREE.FaceNormalsHelper: only THREE.Geometry is supported. Use THREE.VertexNormalsHelper, instead.");
  56963. var c = new n.BufferGeometry
  56964. , h = new n.Float32Attribute(2 * s * 3,3);
  56965. c.addAttribute("position", h),
  56966. n.LineSegments.call(this, c, new n.LineBasicMaterial({
  56967. color: o,
  56968. linewidth: a
  56969. })),
  56970. this.matrixAutoUpdate = !1,
  56971. this.update()
  56972. }
  56973. ,
  56974. n.FaceNormalsHelper.prototype = Object.create(n.LineSegments.prototype),
  56975. n.FaceNormalsHelper.prototype.constructor = n.FaceNormalsHelper,
  56976. n.FaceNormalsHelper.prototype.update = function() {
  56977. var e = new n.Vector3
  56978. , t = new n.Vector3
  56979. , i = new n.Matrix3;
  56980. return function() {
  56981. this.object.updateMatrixWorld(!0),
  56982. i.getNormalMatrix(this.object.matrixWorld);
  56983. 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++) {
  56984. var u = s[c]
  56985. , d = u.normal;
  56986. e.copy(a[u.a]).add(a[u.b]).add(a[u.c]).divideScalar(3).applyMatrix4(n),
  56987. t.copy(d).applyMatrix3(i).normalize().multiplyScalar(this.size).add(e),
  56988. r.setXYZ(l, e.x, e.y, e.z),
  56989. l += 1,
  56990. r.setXYZ(l, t.x, t.y, t.z),
  56991. l += 1
  56992. }
  56993. return r.needsUpdate = !0,
  56994. this
  56995. }
  56996. }(),
  56997. n.GridHelper = function(e, t) {
  56998. var i = new n.Geometry
  56999. , r = new n.LineBasicMaterial({
  57000. vertexColors: n.VertexColors
  57001. });
  57002. this.color1 = new n.Color(4473924),
  57003. this.color2 = new n.Color(8947848);
  57004. for (var o = -e; o <= e; o += t) {
  57005. 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));
  57006. var a = 0 === o ? this.color1 : this.color2;
  57007. i.colors.push(a, a, a, a)
  57008. }
  57009. n.LineSegments.call(this, i, r)
  57010. }
  57011. ,
  57012. n.GridHelper.prototype = Object.create(n.LineSegments.prototype),
  57013. n.GridHelper.prototype.constructor = n.GridHelper,
  57014. n.GridHelper.prototype.setColors = function(e, t) {
  57015. this.color1.set(e),
  57016. this.color2.set(t),
  57017. this.geometry.colorsNeedUpdate = !0
  57018. }
  57019. ,
  57020. n.HemisphereLightHelper = function(e, t) {
  57021. n.Object3D.call(this),
  57022. this.light = e,
  57023. this.light.updateMatrixWorld(),
  57024. this.matrix = e.matrixWorld,
  57025. this.matrixAutoUpdate = !1,
  57026. this.colors = [new n.Color, new n.Color];
  57027. var i = new n.SphereGeometry(t,4,2);
  57028. i.rotateX(-Math.PI / 2);
  57029. for (var r = 0, o = 8; r < o; r++)
  57030. i.faces[r].color = this.colors[r < 4 ? 0 : 1];
  57031. var a = new n.MeshBasicMaterial({
  57032. vertexColors: n.FaceColors,
  57033. wireframe: !0
  57034. });
  57035. this.lightSphere = new n.Mesh(i,a),
  57036. this.add(this.lightSphere),
  57037. this.update()
  57038. }
  57039. ,
  57040. n.HemisphereLightHelper.prototype = Object.create(n.Object3D.prototype),
  57041. n.HemisphereLightHelper.prototype.constructor = n.HemisphereLightHelper,
  57042. n.HemisphereLightHelper.prototype.dispose = function() {
  57043. this.lightSphere.geometry.dispose(),
  57044. this.lightSphere.material.dispose()
  57045. }
  57046. ,
  57047. n.HemisphereLightHelper.prototype.update = function() {
  57048. var e = new n.Vector3;
  57049. return function() {
  57050. this.colors[0].copy(this.light.color).multiplyScalar(this.light.intensity),
  57051. this.colors[1].copy(this.light.groundColor).multiplyScalar(this.light.intensity),
  57052. this.lightSphere.lookAt(e.setFromMatrixPosition(this.light.matrixWorld).negate()),
  57053. this.lightSphere.geometry.colorsNeedUpdate = !0
  57054. }
  57055. }(),
  57056. n.PointLightHelper = function(e, t) {
  57057. this.light = e,
  57058. this.light.updateMatrixWorld();
  57059. var i = new n.SphereGeometry(t,4,2)
  57060. , r = new n.MeshBasicMaterial({
  57061. wireframe: !0,
  57062. fog: !1
  57063. });
  57064. r.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  57065. n.Mesh.call(this, i, r),
  57066. this.matrix = this.light.matrixWorld,
  57067. this.matrixAutoUpdate = !1
  57068. }
  57069. ,
  57070. n.PointLightHelper.prototype = Object.create(n.Mesh.prototype),
  57071. n.PointLightHelper.prototype.constructor = n.PointLightHelper,
  57072. n.PointLightHelper.prototype.dispose = function() {
  57073. this.geometry.dispose(),
  57074. this.material.dispose()
  57075. }
  57076. ,
  57077. n.PointLightHelper.prototype.update = function() {
  57078. this.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)
  57079. }
  57080. ,
  57081. n.SkeletonHelper = function(e) {
  57082. this.bones = this.getBoneList(e);
  57083. for (var t = new n.Geometry, i = 0; i < this.bones.length; i++) {
  57084. var r = this.bones[i];
  57085. r.parent instanceof n.Bone && (t.vertices.push(new n.Vector3),
  57086. t.vertices.push(new n.Vector3),
  57087. t.colors.push(new n.Color(0,0,1)),
  57088. t.colors.push(new n.Color(0,1,0)))
  57089. }
  57090. t.dynamic = !0;
  57091. var o = new n.LineBasicMaterial({
  57092. vertexColors: n.VertexColors,
  57093. depthTest: !1,
  57094. depthWrite: !1,
  57095. transparent: !0
  57096. });
  57097. n.LineSegments.call(this, t, o),
  57098. this.root = e,
  57099. this.matrix = e.matrixWorld,
  57100. this.matrixAutoUpdate = !1,
  57101. this.update()
  57102. }
  57103. ,
  57104. n.SkeletonHelper.prototype = Object.create(n.LineSegments.prototype),
  57105. n.SkeletonHelper.prototype.constructor = n.SkeletonHelper,
  57106. n.SkeletonHelper.prototype.getBoneList = function(e) {
  57107. var t = [];
  57108. e instanceof n.Bone && t.push(e);
  57109. for (var i = 0; i < e.children.length; i++)
  57110. t.push.apply(t, this.getBoneList(e.children[i]));
  57111. return t
  57112. }
  57113. ,
  57114. n.SkeletonHelper.prototype.update = function() {
  57115. 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++) {
  57116. var a = this.bones[o];
  57117. a.parent instanceof n.Bone && (i.multiplyMatrices(t, a.matrixWorld),
  57118. e.vertices[r].setFromMatrixPosition(i),
  57119. i.multiplyMatrices(t, a.parent.matrixWorld),
  57120. e.vertices[r + 1].setFromMatrixPosition(i),
  57121. r += 2)
  57122. }
  57123. e.verticesNeedUpdate = !0,
  57124. e.computeBoundingSphere()
  57125. }
  57126. ,
  57127. n.SpotLightHelper = function(e) {
  57128. n.Object3D.call(this),
  57129. this.light = e,
  57130. this.light.updateMatrixWorld(),
  57131. this.matrix = e.matrixWorld,
  57132. this.matrixAutoUpdate = !1;
  57133. var t = new n.CylinderGeometry(0,1,1,8,1,!0);
  57134. t.translate(0, -.5, 0),
  57135. t.rotateX(-Math.PI / 2);
  57136. var i = new n.MeshBasicMaterial({
  57137. wireframe: !0,
  57138. fog: !1
  57139. });
  57140. this.cone = new n.Mesh(t,i),
  57141. this.add(this.cone),
  57142. this.update()
  57143. }
  57144. ,
  57145. n.SpotLightHelper.prototype = Object.create(n.Object3D.prototype),
  57146. n.SpotLightHelper.prototype.constructor = n.SpotLightHelper,
  57147. n.SpotLightHelper.prototype.dispose = function() {
  57148. this.cone.geometry.dispose(),
  57149. this.cone.material.dispose()
  57150. }
  57151. ,
  57152. n.SpotLightHelper.prototype.update = function() {
  57153. var e = new n.Vector3
  57154. , t = new n.Vector3;
  57155. return function() {
  57156. var i = this.light.distance ? this.light.distance : 1e4
  57157. , n = i * Math.tan(this.light.angle);
  57158. this.cone.scale.set(n, n, i),
  57159. e.setFromMatrixPosition(this.light.matrixWorld),
  57160. t.setFromMatrixPosition(this.light.target.matrixWorld),
  57161. this.cone.lookAt(t.sub(e)),
  57162. this.cone.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)
  57163. }
  57164. }(),
  57165. n.VertexNormalsHelper = function(e, t, i, r) {
  57166. this.object = e,
  57167. this.size = void 0 !== t ? t : 1;
  57168. var o = void 0 !== i ? i : 16711680
  57169. , a = void 0 !== r ? r : 1
  57170. , s = 0
  57171. , l = this.object.geometry;
  57172. l instanceof n.Geometry ? s = 3 * l.faces.length : l instanceof n.BufferGeometry && (s = l.attributes.normal.count);
  57173. var c = new n.BufferGeometry
  57174. , h = new n.Float32Attribute(2 * s * 3,3);
  57175. c.addAttribute("position", h),
  57176. n.LineSegments.call(this, c, new n.LineBasicMaterial({
  57177. color: o,
  57178. linewidth: a
  57179. })),
  57180. this.matrixAutoUpdate = !1,
  57181. this.update()
  57182. }
  57183. ,
  57184. n.VertexNormalsHelper.prototype = Object.create(n.LineSegments.prototype),
  57185. n.VertexNormalsHelper.prototype.constructor = n.VertexNormalsHelper,
  57186. n.VertexNormalsHelper.prototype.update = function() {
  57187. var e = new n.Vector3
  57188. , t = new n.Vector3
  57189. , i = new n.Matrix3;
  57190. return function() {
  57191. var r = ["a", "b", "c"];
  57192. this.object.updateMatrixWorld(!0),
  57193. i.getNormalMatrix(this.object.matrixWorld);
  57194. var o = this.object.matrixWorld
  57195. , a = this.geometry.attributes.position
  57196. , s = this.object.geometry;
  57197. if (s instanceof n.Geometry)
  57198. for (var l = s.vertices, c = s.faces, h = 0, u = 0, d = c.length; u < d; u++)
  57199. for (var p = c[u], f = 0, g = p.vertexNormals.length; f < g; f++) {
  57200. var m = l[p[r[f]]]
  57201. , v = p.vertexNormals[f];
  57202. e.copy(m).applyMatrix4(o),
  57203. t.copy(v).applyMatrix3(i).normalize().multiplyScalar(this.size).add(e),
  57204. a.setXYZ(h, e.x, e.y, e.z),
  57205. h += 1,
  57206. a.setXYZ(h, t.x, t.y, t.z),
  57207. h += 1
  57208. }
  57209. else if (s instanceof n.BufferGeometry)
  57210. for (var A = s.attributes.position, y = s.attributes.normal, h = 0, f = 0, g = A.count; f < g; f++)
  57211. e.set(A.getX(f), A.getY(f), A.getZ(f)).applyMatrix4(o),
  57212. t.set(y.getX(f), y.getY(f), y.getZ(f)),
  57213. t.applyMatrix3(i).normalize().multiplyScalar(this.size).add(e),
  57214. a.setXYZ(h, e.x, e.y, e.z),
  57215. h += 1,
  57216. a.setXYZ(h, t.x, t.y, t.z),
  57217. h += 1;
  57218. return a.needsUpdate = !0,
  57219. this
  57220. }
  57221. }(),
  57222. n.WireframeHelper = function(e, t) {
  57223. var i = void 0 !== t ? t : 16777215;
  57224. n.LineSegments.call(this, new n.WireframeGeometry(e.geometry), new n.LineBasicMaterial({
  57225. color: i
  57226. })),
  57227. this.matrix = e.matrixWorld,
  57228. this.matrixAutoUpdate = !1
  57229. }
  57230. ,
  57231. n.WireframeHelper.prototype = Object.create(n.LineSegments.prototype),
  57232. n.WireframeHelper.prototype.constructor = n.WireframeHelper,
  57233. n.ImmediateRenderObject = function(e) {
  57234. n.Object3D.call(this),
  57235. this.material = e,
  57236. this.render = function(e) {}
  57237. }
  57238. ,
  57239. n.ImmediateRenderObject.prototype = Object.create(n.Object3D.prototype),
  57240. n.ImmediateRenderObject.prototype.constructor = n.ImmediateRenderObject,
  57241. n.MorphBlendMesh = function(e, t) {
  57242. n.Mesh.call(this, e, t),
  57243. this.animationsMap = {},
  57244. this.animationsList = [];
  57245. var i = this.geometry.morphTargets.length
  57246. , r = "__default"
  57247. , o = 0
  57248. , a = i - 1
  57249. , s = i / 1;
  57250. this.createAnimation(r, o, a, s),
  57251. this.setAnimationWeight(r, 1)
  57252. }
  57253. ,
  57254. n.MorphBlendMesh.prototype = Object.create(n.Mesh.prototype),
  57255. n.MorphBlendMesh.prototype.constructor = n.MorphBlendMesh,
  57256. n.MorphBlendMesh.prototype.createAnimation = function(e, t, i, n) {
  57257. var r = {
  57258. start: t,
  57259. end: i,
  57260. length: i - t + 1,
  57261. fps: n,
  57262. duration: (i - t) / n,
  57263. lastFrame: 0,
  57264. currentFrame: 0,
  57265. active: !1,
  57266. time: 0,
  57267. direction: 1,
  57268. weight: 1,
  57269. directionBackwards: !1,
  57270. mirroredLoop: !1
  57271. };
  57272. this.animationsMap[e] = r,
  57273. this.animationsList.push(r)
  57274. }
  57275. ,
  57276. n.MorphBlendMesh.prototype.autoCreateAnimations = function(e) {
  57277. for (var t, i = /([a-z]+)_?(\d+)/i, n = {}, r = this.geometry, o = 0, a = r.morphTargets.length; o < a; o++) {
  57278. var s = r.morphTargets[o]
  57279. , l = s.name.match(i);
  57280. if (l && l.length > 1) {
  57281. var c = l[1];
  57282. n[c] || (n[c] = {
  57283. start: 1 / 0,
  57284. end: -(1 / 0)
  57285. });
  57286. var h = n[c];
  57287. o < h.start && (h.start = o),
  57288. o > h.end && (h.end = o),
  57289. t || (t = c)
  57290. }
  57291. }
  57292. for (var c in n) {
  57293. var h = n[c];
  57294. this.createAnimation(c, h.start, h.end, e)
  57295. }
  57296. this.firstAnimation = t
  57297. }
  57298. ,
  57299. n.MorphBlendMesh.prototype.setAnimationDirectionForward = function(e) {
  57300. var t = this.animationsMap[e];
  57301. t && (t.direction = 1,
  57302. t.directionBackwards = !1)
  57303. }
  57304. ,
  57305. n.MorphBlendMesh.prototype.setAnimationDirectionBackward = function(e) {
  57306. var t = this.animationsMap[e];
  57307. t && (t.direction = -1,
  57308. t.directionBackwards = !0)
  57309. }
  57310. ,
  57311. n.MorphBlendMesh.prototype.setAnimationFPS = function(e, t) {
  57312. var i = this.animationsMap[e];
  57313. i && (i.fps = t,
  57314. i.duration = (i.end - i.start) / i.fps)
  57315. }
  57316. ,
  57317. n.MorphBlendMesh.prototype.setAnimationDuration = function(e, t) {
  57318. var i = this.animationsMap[e];
  57319. i && (i.duration = t,
  57320. i.fps = (i.end - i.start) / i.duration)
  57321. }
  57322. ,
  57323. n.MorphBlendMesh.prototype.setAnimationWeight = function(e, t) {
  57324. var i = this.animationsMap[e];
  57325. i && (i.weight = t)
  57326. }
  57327. ,
  57328. n.MorphBlendMesh.prototype.setAnimationTime = function(e, t) {
  57329. var i = this.animationsMap[e];
  57330. i && (i.time = t)
  57331. }
  57332. ,
  57333. n.MorphBlendMesh.prototype.getAnimationTime = function(e) {
  57334. var t = 0
  57335. , i = this.animationsMap[e];
  57336. return i && (t = i.time),
  57337. t
  57338. }
  57339. ,
  57340. n.MorphBlendMesh.prototype.getAnimationDuration = function(e) {
  57341. var t = -1
  57342. , i = this.animationsMap[e];
  57343. return i && (t = i.duration),
  57344. t
  57345. }
  57346. ,
  57347. n.MorphBlendMesh.prototype.playAnimation = function(e) {
  57348. var t = this.animationsMap[e];
  57349. t ? (t.time = 0,
  57350. t.active = !0) : console.warn("THREE.MorphBlendMesh: animation[" + e + "] undefined in .playAnimation()")
  57351. }
  57352. ,
  57353. n.MorphBlendMesh.prototype.stopAnimation = function(e) {
  57354. var t = this.animationsMap[e];
  57355. t && (t.active = !1)
  57356. }
  57357. ,
  57358. n.MorphBlendMesh.prototype.update = function(e) {
  57359. for (var t = 0, i = this.animationsList.length; t < i; t++) {
  57360. var r = this.animationsList[t];
  57361. if (r.active) {
  57362. var o = r.duration / r.length;
  57363. r.time += r.direction * e,
  57364. r.mirroredLoop ? (r.time > r.duration || r.time < 0) && (r.direction *= -1,
  57365. r.time > r.duration && (r.time = r.duration,
  57366. r.directionBackwards = !0),
  57367. r.time < 0 && (r.time = 0,
  57368. r.directionBackwards = !1)) : (r.time = r.time % r.duration,
  57369. r.time < 0 && (r.time += r.duration));
  57370. var a = r.start + n.Math.clamp(Math.floor(r.time / o), 0, r.length - 1)
  57371. , s = r.weight;
  57372. a !== r.currentFrame && (this.morphTargetInfluences[r.lastFrame] = 0,
  57373. this.morphTargetInfluences[r.currentFrame] = 1 * s,
  57374. this.morphTargetInfluences[a] = 0,
  57375. r.lastFrame = r.currentFrame,
  57376. r.currentFrame = a);
  57377. var l = r.time % o / o;
  57378. r.directionBackwards && (l = 1 - l),
  57379. r.currentFrame !== r.lastFrame ? (this.morphTargetInfluences[r.currentFrame] = l * s,
  57380. this.morphTargetInfluences[r.lastFrame] = (1 - l) * s) : this.morphTargetInfluences[r.currentFrame] = s
  57381. }
  57382. }
  57383. }
  57384. ,
  57385. "undefined" != typeof i ? ("undefined" != typeof t && t.exports && (i = t.exports = n),
  57386. i.THREE = n) : this.THREE = n
  57387. window.THREE = n
  57388. getObjLoader()
  57389. }
  57390. , {}]
  57391. }, {}, [116]);
  57392. function initTransitionPass(THREE){
  57393. THREE.TransitionPass = function ( scene, camera ) {
  57394. this.renderScene = scene;
  57395. this.renderCamera = camera;
  57396. this.coverRenderTarget = new THREE.WebGLRenderTarget( 100, 100, {
  57397. minFilter: THREE.LinearFilter, magFilter: THREE.LinearFilter,
  57398. format: THREE.RGBAFormat
  57399. });
  57400. this.coverTex = this.coverRenderTarget.texture;
  57401. this.enabled = false;
  57402. this.oldClearColor = new THREE.Color();
  57403. this.oldClearAlpha = 1;
  57404. this.camera = new THREE.OrthographicCamera( - 1, 1, 1, - 1, 0, 1 );
  57405. this.scene = new THREE.Scene();
  57406. this.material = this.getMaskMaterial()
  57407. var copyShader = THREE.CopyShader;
  57408. this.materialCopy = new THREE.ShaderMaterial( {
  57409. uniforms: this.copyUniforms,
  57410. vertexShader: copyShader.vertexShader,
  57411. fragmentShader: copyShader.fragmentShader,
  57412. blending: THREE.NoBlending,
  57413. depthTest: false,
  57414. depthWrite: false,
  57415. transparent: true
  57416. } );
  57417. this.quad = new THREE.Mesh( new THREE.PlaneBufferGeometry( 2, 2 ), this.material);
  57418. this.quad.frustumCulled = false; // Avoid getting clipped
  57419. this.scene.add( this.quad );
  57420. }
  57421. THREE.TransitionPass.prototype = {//波形扩散,出下一个画面
  57422. constructor: THREE.TransitionPass,
  57423. setSize: function ( width, height ) {
  57424. this.coverRenderTarget.setSize( width, height );
  57425. },
  57426. render: function ( renderer, writeBuffer, readBuffer, delta, maskActive ) {
  57427. var oldAutoClear = renderer.autoClear;
  57428. renderer.autoClear = false;
  57429. var uniforms = this.quad.material.uniforms
  57430. uniforms.bgTex.value = readBuffer.texture;
  57431. uniforms.coverTex.value = this.coverTex;
  57432. uniforms.progress.value = player.model.skybox.material.uniforms.progress.value//
  57433. uniforms.screenRatio.value = player.domElement.clientWidth / player.domElement.clientHeight;// 使波纹为圆形
  57434. uniforms.screenRatio.value *= uniforms.screenRatio.value
  57435. renderer.render( this.scene, this.camera);
  57436. renderer.autoClear = oldAutoClear;
  57437. },
  57438. start:function(sceneRenderer){
  57439. this.enabled = true
  57440. //draw coverTex
  57441. this.quad.material.uniforms.progress.value = 1;
  57442. sceneRenderer.renderer.render( sceneRenderer.scene, sceneRenderer.camera, this.coverRenderTarget, true );
  57443. },
  57444. stop:function(){
  57445. this.enabled = false
  57446. }
  57447. ,
  57448. getMaskMaterial :function(){
  57449. return new THREE.ShaderMaterial( {
  57450. uniforms: {
  57451. coverTex: {
  57452. type: "t",
  57453. value: null
  57454. },
  57455. bgTex: {
  57456. type: "t",
  57457. value: null
  57458. },
  57459. progress:{
  57460. type: "f",
  57461. value: 0
  57462. },
  57463. screenRatio:{
  57464. type: "f",
  57465. value: 1
  57466. }
  57467. },
  57468. vertexShader: `
  57469. varying vec2 vUv;
  57470. void main()
  57471. {
  57472. vUv = uv;
  57473. gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
  57474. }
  57475. `,
  57476. fragmentShader: `
  57477. uniform sampler2D coverTex;
  57478. uniform sampler2D bgTex;
  57479. uniform float progress;
  57480. uniform float screenRatio;
  57481. varying vec2 vUv;
  57482. void main() {
  57483. const float maxRadius = 0.708; // sqrt(0.5^2+0.5^2)
  57484. const float minRadius = 0.0 ;
  57485. float radius = screenRatio>1.0 ? sqrt((vUv.x - 0.5)*(vUv.x - 0.5) + (vUv.y - 0.5)*(vUv.y - 0.5)/screenRatio) : sqrt((vUv.x - 0.5)*(vUv.x - 0.5)*screenRatio+ (vUv.y - 0.5)*(vUv.y - 0.5));
  57486. float diff = 0.292; //1.0-maxRadius;
  57487. float radiusIn = maxRadius * progress + minRadius * (1.0-progress);
  57488. float radiusOut = radiusIn + diff;
  57489. if(radius < radiusIn) {
  57490. gl_FragColor = texture2D(bgTex, vUv);
  57491. //gl_FragColor = vec4(0.0,0.0,1.0,1.0);//
  57492. }else if(radius>radiusOut){
  57493. gl_FragColor = texture2D(coverTex, vUv) ;
  57494. //gl_FragColor = vec4(1.0,1.0,0.0,1.0);//
  57495. }else{
  57496. vec4 color1 = texture2D(bgTex, vUv);
  57497. vec4 color2 = texture2D(coverTex, vUv);
  57498. float rotio = smoothstep(radiusIn ,radiusOut,radius);
  57499. gl_FragColor = mix(color1, color2, rotio);
  57500. }
  57501. }
  57502. `
  57503. } );
  57504. },
  57505. }
  57506. }
  57507. /*
  57508. var addMagnifier = function(){
  57509. class Magnifier extends THREE.Object3D {
  57510. constructor () {
  57511. super()
  57512. let circleGeo = new THREE.CircleGeometry(0.1, 100);
  57513. this.camera = new THREE.PerspectiveCamera(50, 1, 0.1, 1); //fov aspect near far
  57514. this.renderTarget = new THREE.WebGLRenderTarget(256,256, {
  57515. minFilter: THREE.LinearFilter, magFilter: THREE.LinearFilter,
  57516. format: THREE.RGBAFormat ,
  57517. //type: THREE.FloatType,
  57518. //minFilter: THREE.NearestFilter,
  57519. //magFilter: THREE.NearestFilter,
  57520. } )
  57521. this.mesh = new THREE.Mesh(circleGeo, new THREE.MeshBasicMaterial({
  57522. side: THREE.DoubleSide ,
  57523. map: this.renderTarget.texture ,
  57524. transparent:true,
  57525. depthTest: !1,
  57526. depthWrite: !1,
  57527. }))
  57528. this.overlayMesh = new THREE.Mesh(circleGeo, new THREE.MeshBasicMaterial({
  57529. side: THREE.DoubleSide ,
  57530. map: Texture.load('images/crosshair.png') ,
  57531. transparent:true,
  57532. depthTest: !1,
  57533. depthWrite: !1,
  57534. }))
  57535. this.add(this.mesh)
  57536. this.add(this.overlayMesh)
  57537. player.model.add(this);
  57538. player.magnifier = this;
  57539. }
  57540. update(aimPos){
  57541. const magDistance_ = 0.3;
  57542. var playerPos = player.position
  57543. var vec = playerPos.clone().sub(aimPos).normalize().multiplyScalar(magDistance_)
  57544. this.camera.position.copy(aimPos.clone().add(vec))
  57545. this.camera.lookAt(aimPos)
  57546. var playerCamera = player.camera
  57547. this.quaternion.copy(playerCamera.quaternion);
  57548. var pos2d = player.mouse.clone();
  57549. var shift = 400;
  57550. var clientHeight = player.domElement.clientHeight
  57551. var clientY = - (pos2d.y - 1) * clientHeight / 2;
  57552. pos2d.y = clientY < 300 ? pos2d.y - shift/clientHeight : pos2d.y + shift/clientHeight
  57553. let newPos = new THREE.Vector3(pos2d.x,pos2d.y,0.7).unproject(playerCamera);
  57554. this.position.copy(newPos)
  57555. var renderer = player.sceneRenderer.renderer
  57556. var oldAutoClear = renderer.autoClear
  57557. renderer.autoClear = false
  57558. //renderer.clear( true, true, true );
  57559. renderer.render(player.sceneRenderer.scene, this.camera, this.renderTarget, true)
  57560. renderer.autoClear = oldAutoClear
  57561. }
  57562. }
  57563. new Magnifier()
  57564. }
  57565. */
  57566. /*
  57567. 笔记:
  57568. 导览缩放的几处: 1 搜索smoothZoomFovTo 2 flightStepWalk里
  57569. {
  57570. //到导览中某个点位(假设点位不重复)
  57571. var id = 73
  57572. var p = player.model.heroLocations.find(e=>e.heroLocations && e.heroLocations.find(e=>e.panoId == id))
  57573. var i = player.model.heroLocations.indexOf(p)
  57574. var p1 = p.heroLocations.find(e=>e.panoId == id)
  57575. var j = p.heroLocations.indexOf(p1)
  57576. player.director.goToHighlight([i,j])
  57577. }
  57578. */