main_2020_show.js 2.6 MB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478194791948019481194821948319484194851948619487194881948919490194911949219493194941949519496194971949819499195001950119502195031950419505195061950719508195091951019511195121951319514195151951619517195181951919520195211952219523195241952519526195271952819529195301953119532195331953419535195361953719538195391954019541195421954319544195451954619547195481954919550195511955219553195541955519556195571955819559195601956119562195631956419565195661956719568195691957019571195721957319574195751957619577195781957919580195811958219583195841958519586195871958819589195901959119592195931959419595195961959719598195991960019601196021960319604196051960619607196081960919610196111961219613196141961519616196171961819619196201962119622196231962419625196261962719628196291963019631196321963319634196351963619637196381963919640196411964219643196441964519646196471964819649196501965119652196531965419655196561965719658196591966019661196621966319664196651966619667196681966919670196711967219673196741967519676196771967819679196801968119682196831968419685196861968719688196891969019691196921969319694196951969619697196981969919700197011970219703197041970519706197071970819709197101971119712197131971419715197161971719718197191972019721197221972319724197251972619727197281972919730197311973219733197341973519736197371973819739197401974119742197431974419745197461974719748197491975019751197521975319754197551975619757197581975919760197611976219763197641976519766197671976819769197701977119772197731977419775197761977719778197791978019781197821978319784197851978619787197881978919790197911979219793197941979519796197971979819799198001980119802198031980419805198061980719808198091981019811198121981319814198151981619817198181981919820198211982219823198241982519826198271982819829198301983119832198331983419835198361983719838198391984019841198421984319844198451984619847198481984919850198511985219853198541985519856198571985819859198601986119862198631986419865198661986719868198691987019871198721987319874198751987619877198781987919880198811988219883198841988519886198871988819889198901989119892198931989419895198961989719898198991990019901199021990319904199051990619907199081990919910199111991219913199141991519916199171991819919199201992119922199231992419925199261992719928199291993019931199321993319934199351993619937199381993919940199411994219943199441994519946199471994819949199501995119952199531995419955199561995719958199591996019961199621996319964199651996619967199681996919970199711997219973199741997519976199771997819979199801998119982199831998419985199861998719988199891999019991199921999319994199951999619997199981999920000200012000220003200042000520006200072000820009200102001120012200132001420015200162001720018200192002020021200222002320024200252002620027200282002920030200312003220033200342003520036200372003820039200402004120042200432004420045200462004720048200492005020051200522005320054200552005620057200582005920060200612006220063200642006520066200672006820069200702007120072200732007420075200762007720078200792008020081200822008320084200852008620087200882008920090200912009220093200942009520096200972009820099201002010120102201032010420105201062010720108201092011020111201122011320114201152011620117201182011920120201212012220123201242012520126201272012820129201302013120132201332013420135201362013720138201392014020141201422014320144201452014620147201482014920150201512015220153201542015520156201572015820159201602016120162201632016420165201662016720168201692017020171201722017320174201752017620177201782017920180201812018220183201842018520186201872018820189201902019120192201932019420195201962019720198201992020020201202022020320204202052020620207202082020920210202112021220213202142021520216202172021820219202202022120222202232022420225202262022720228202292023020231202322023320234202352023620237202382023920240202412024220243202442024520246202472024820249202502025120252202532025420255202562025720258202592026020261202622026320264202652026620267202682026920270202712027220273202742027520276202772027820279202802028120282202832028420285202862028720288202892029020291202922029320294202952029620297202982029920300203012030220303203042030520306203072030820309203102031120312203132031420315203162031720318203192032020321203222032320324203252032620327203282032920330203312033220333203342033520336203372033820339203402034120342203432034420345203462034720348203492035020351203522035320354203552035620357203582035920360203612036220363203642036520366203672036820369203702037120372203732037420375203762037720378203792038020381203822038320384203852038620387203882038920390203912039220393203942039520396203972039820399204002040120402204032040420405204062040720408204092041020411204122041320414204152041620417204182041920420204212042220423204242042520426204272042820429204302043120432204332043420435204362043720438204392044020441204422044320444204452044620447204482044920450204512045220453204542045520456204572045820459204602046120462204632046420465204662046720468204692047020471204722047320474204752047620477204782047920480204812048220483204842048520486204872048820489204902049120492204932049420495204962049720498204992050020501205022050320504205052050620507205082050920510205112051220513205142051520516205172051820519205202052120522205232052420525205262052720528205292053020531205322053320534205352053620537205382053920540205412054220543205442054520546205472054820549205502055120552205532055420555205562055720558205592056020561205622056320564205652056620567205682056920570205712057220573205742057520576205772057820579205802058120582205832058420585205862058720588205892059020591205922059320594205952059620597205982059920600206012060220603206042060520606206072060820609206102061120612206132061420615206162061720618206192062020621206222062320624206252062620627206282062920630206312063220633206342063520636206372063820639206402064120642206432064420645206462064720648206492065020651206522065320654206552065620657206582065920660206612066220663206642066520666206672066820669206702067120672206732067420675206762067720678206792068020681206822068320684206852068620687206882068920690206912069220693206942069520696206972069820699207002070120702207032070420705207062070720708207092071020711207122071320714207152071620717207182071920720207212072220723207242072520726207272072820729207302073120732207332073420735207362073720738207392074020741207422074320744207452074620747207482074920750207512075220753207542075520756207572075820759207602076120762207632076420765207662076720768207692077020771207722077320774207752077620777207782077920780207812078220783207842078520786207872078820789207902079120792207932079420795207962079720798207992080020801208022080320804208052080620807208082080920810208112081220813208142081520816208172081820819208202082120822208232082420825208262082720828208292083020831208322083320834208352083620837208382083920840208412084220843208442084520846208472084820849208502085120852208532085420855208562085720858208592086020861208622086320864208652086620867208682086920870208712087220873208742087520876208772087820879208802088120882208832088420885208862088720888208892089020891208922089320894208952089620897208982089920900209012090220903209042090520906209072090820909209102091120912209132091420915209162091720918209192092020921209222092320924209252092620927209282092920930209312093220933209342093520936209372093820939209402094120942209432094420945209462094720948209492095020951209522095320954209552095620957209582095920960209612096220963209642096520966209672096820969209702097120972209732097420975209762097720978209792098020981209822098320984209852098620987209882098920990209912099220993209942099520996209972099820999210002100121002210032100421005210062100721008210092101021011210122101321014210152101621017210182101921020210212102221023210242102521026210272102821029210302103121032210332103421035210362103721038210392104021041210422104321044210452104621047210482104921050210512105221053210542105521056210572105821059210602106121062210632106421065210662106721068210692107021071210722107321074210752107621077210782107921080210812108221083210842108521086210872108821089210902109121092210932109421095210962109721098210992110021101211022110321104211052110621107211082110921110211112111221113211142111521116211172111821119211202112121122211232112421125211262112721128211292113021131211322113321134211352113621137211382113921140211412114221143211442114521146211472114821149211502115121152211532115421155211562115721158211592116021161211622116321164211652116621167211682116921170211712117221173211742117521176211772117821179211802118121182211832118421185211862118721188211892119021191211922119321194211952119621197211982119921200212012120221203212042120521206212072120821209212102121121212212132121421215212162121721218212192122021221212222122321224212252122621227212282122921230212312123221233212342123521236212372123821239212402124121242212432124421245212462124721248212492125021251212522125321254212552125621257212582125921260212612126221263212642126521266212672126821269212702127121272212732127421275212762127721278212792128021281212822128321284212852128621287212882128921290212912129221293212942129521296212972129821299213002130121302213032130421305213062130721308213092131021311213122131321314213152131621317213182131921320213212132221323213242132521326213272132821329213302133121332213332133421335213362133721338213392134021341213422134321344213452134621347213482134921350213512135221353213542135521356213572135821359213602136121362213632136421365213662136721368213692137021371213722137321374213752137621377213782137921380213812138221383213842138521386213872138821389213902139121392213932139421395213962139721398213992140021401214022140321404214052140621407214082140921410214112141221413214142141521416214172141821419214202142121422214232142421425214262142721428214292143021431214322143321434214352143621437214382143921440214412144221443214442144521446214472144821449214502145121452214532145421455214562145721458214592146021461214622146321464214652146621467214682146921470214712147221473214742147521476214772147821479214802148121482214832148421485214862148721488214892149021491214922149321494214952149621497214982149921500215012150221503215042150521506215072150821509215102151121512215132151421515215162151721518215192152021521215222152321524215252152621527215282152921530215312153221533215342153521536215372153821539215402154121542215432154421545215462154721548215492155021551215522155321554215552155621557215582155921560215612156221563215642156521566215672156821569215702157121572215732157421575215762157721578215792158021581215822158321584215852158621587215882158921590215912159221593215942159521596215972159821599216002160121602216032160421605216062160721608216092161021611216122161321614216152161621617216182161921620216212162221623216242162521626216272162821629216302163121632216332163421635216362163721638216392164021641216422164321644216452164621647216482164921650216512165221653216542165521656216572165821659216602166121662216632166421665216662166721668216692167021671216722167321674216752167621677216782167921680216812168221683216842168521686216872168821689216902169121692216932169421695216962169721698216992170021701217022170321704217052170621707217082170921710217112171221713217142171521716217172171821719217202172121722217232172421725217262172721728217292173021731217322173321734217352173621737217382173921740217412174221743217442174521746217472174821749217502175121752217532175421755217562175721758217592176021761217622176321764217652176621767217682176921770217712177221773217742177521776217772177821779217802178121782217832178421785217862178721788217892179021791217922179321794217952179621797217982179921800218012180221803218042180521806218072180821809218102181121812218132181421815218162181721818218192182021821218222182321824218252182621827218282182921830218312183221833218342183521836218372183821839218402184121842218432184421845218462184721848218492185021851218522185321854218552185621857218582185921860218612186221863218642186521866218672186821869218702187121872218732187421875218762187721878218792188021881218822188321884218852188621887218882188921890218912189221893218942189521896218972189821899219002190121902219032190421905219062190721908219092191021911219122191321914219152191621917219182191921920219212192221923219242192521926219272192821929219302193121932219332193421935219362193721938219392194021941219422194321944219452194621947219482194921950219512195221953219542195521956219572195821959219602196121962219632196421965219662196721968219692197021971219722197321974219752197621977219782197921980219812198221983219842198521986219872198821989219902199121992219932199421995219962199721998219992200022001220022200322004220052200622007220082200922010220112201222013220142201522016220172201822019220202202122022220232202422025220262202722028220292203022031220322203322034220352203622037220382203922040220412204222043220442204522046220472204822049220502205122052220532205422055220562205722058220592206022061220622206322064220652206622067220682206922070220712207222073220742207522076220772207822079220802208122082220832208422085220862208722088220892209022091220922209322094220952209622097220982209922100221012210222103221042210522106221072210822109221102211122112221132211422115221162211722118221192212022121221222212322124221252212622127221282212922130221312213222133221342213522136221372213822139221402214122142221432214422145221462214722148221492215022151221522215322154221552215622157221582215922160221612216222163221642216522166221672216822169221702217122172221732217422175221762217722178221792218022181221822218322184221852218622187221882218922190221912219222193221942219522196221972219822199222002220122202222032220422205222062220722208222092221022211222122221322214222152221622217222182221922220222212222222223222242222522226222272222822229222302223122232222332223422235222362223722238222392224022241222422224322244222452224622247222482224922250222512225222253222542225522256222572225822259222602226122262222632226422265222662226722268222692227022271222722227322274222752227622277222782227922280222812228222283222842228522286222872228822289222902229122292222932229422295222962229722298222992230022301223022230322304223052230622307223082230922310223112231222313223142231522316223172231822319223202232122322223232232422325223262232722328223292233022331223322233322334223352233622337223382233922340223412234222343223442234522346223472234822349223502235122352223532235422355223562235722358223592236022361223622236322364223652236622367223682236922370223712237222373223742237522376223772237822379223802238122382223832238422385223862238722388223892239022391223922239322394223952239622397223982239922400224012240222403224042240522406224072240822409224102241122412224132241422415224162241722418224192242022421224222242322424224252242622427224282242922430224312243222433224342243522436224372243822439224402244122442224432244422445224462244722448224492245022451224522245322454224552245622457224582245922460224612246222463224642246522466224672246822469224702247122472224732247422475224762247722478224792248022481224822248322484224852248622487224882248922490224912249222493224942249522496224972249822499225002250122502225032250422505225062250722508225092251022511225122251322514225152251622517225182251922520225212252222523225242252522526225272252822529225302253122532225332253422535225362253722538225392254022541225422254322544225452254622547225482254922550225512255222553225542255522556225572255822559225602256122562225632256422565225662256722568225692257022571225722257322574225752257622577225782257922580225812258222583225842258522586225872258822589225902259122592225932259422595225962259722598225992260022601226022260322604226052260622607226082260922610226112261222613226142261522616226172261822619226202262122622226232262422625226262262722628226292263022631226322263322634226352263622637226382263922640226412264222643226442264522646226472264822649226502265122652226532265422655226562265722658226592266022661226622266322664226652266622667226682266922670226712267222673226742267522676226772267822679226802268122682226832268422685226862268722688226892269022691226922269322694226952269622697226982269922700227012270222703227042270522706227072270822709227102271122712227132271422715227162271722718227192272022721227222272322724227252272622727227282272922730227312273222733227342273522736227372273822739227402274122742227432274422745227462274722748227492275022751227522275322754227552275622757227582275922760227612276222763227642276522766227672276822769227702277122772227732277422775227762277722778227792278022781227822278322784227852278622787227882278922790227912279222793227942279522796227972279822799228002280122802228032280422805228062280722808228092281022811228122281322814228152281622817228182281922820228212282222823228242282522826228272282822829228302283122832228332283422835228362283722838228392284022841228422284322844228452284622847228482284922850228512285222853228542285522856228572285822859228602286122862228632286422865228662286722868228692287022871228722287322874228752287622877228782287922880228812288222883228842288522886228872288822889228902289122892228932289422895228962289722898228992290022901229022290322904229052290622907229082290922910229112291222913229142291522916229172291822919229202292122922229232292422925229262292722928229292293022931229322293322934229352293622937229382293922940229412294222943229442294522946229472294822949229502295122952229532295422955229562295722958229592296022961229622296322964229652296622967229682296922970229712297222973229742297522976229772297822979229802298122982229832298422985229862298722988229892299022991229922299322994229952299622997229982299923000230012300223003230042300523006230072300823009230102301123012230132301423015230162301723018230192302023021230222302323024230252302623027230282302923030230312303223033230342303523036230372303823039230402304123042230432304423045230462304723048230492305023051230522305323054230552305623057230582305923060230612306223063230642306523066230672306823069230702307123072230732307423075230762307723078230792308023081230822308323084230852308623087230882308923090230912309223093230942309523096230972309823099231002310123102231032310423105231062310723108231092311023111231122311323114231152311623117231182311923120231212312223123231242312523126231272312823129231302313123132231332313423135231362313723138231392314023141231422314323144231452314623147231482314923150231512315223153231542315523156231572315823159231602316123162231632316423165231662316723168231692317023171231722317323174231752317623177231782317923180231812318223183231842318523186231872318823189231902319123192231932319423195231962319723198231992320023201232022320323204232052320623207232082320923210232112321223213232142321523216232172321823219232202322123222232232322423225232262322723228232292323023231232322323323234232352323623237232382323923240232412324223243232442324523246232472324823249232502325123252232532325423255232562325723258232592326023261232622326323264232652326623267232682326923270232712327223273232742327523276232772327823279232802328123282232832328423285232862328723288232892329023291232922329323294232952329623297232982329923300233012330223303233042330523306233072330823309233102331123312233132331423315233162331723318233192332023321233222332323324233252332623327233282332923330233312333223333233342333523336233372333823339233402334123342233432334423345233462334723348233492335023351233522335323354233552335623357233582335923360233612336223363233642336523366233672336823369233702337123372233732337423375233762337723378233792338023381233822338323384233852338623387233882338923390233912339223393233942339523396233972339823399234002340123402234032340423405234062340723408234092341023411234122341323414234152341623417234182341923420234212342223423234242342523426234272342823429234302343123432234332343423435234362343723438234392344023441234422344323444234452344623447234482344923450234512345223453234542345523456234572345823459234602346123462234632346423465234662346723468234692347023471234722347323474234752347623477234782347923480234812348223483234842348523486234872348823489234902349123492234932349423495234962349723498234992350023501235022350323504235052350623507235082350923510235112351223513235142351523516235172351823519235202352123522235232352423525235262352723528235292353023531235322353323534235352353623537235382353923540235412354223543235442354523546235472354823549235502355123552235532355423555235562355723558235592356023561235622356323564235652356623567235682356923570235712357223573235742357523576235772357823579235802358123582235832358423585235862358723588235892359023591235922359323594235952359623597235982359923600236012360223603236042360523606236072360823609236102361123612236132361423615236162361723618236192362023621236222362323624236252362623627236282362923630236312363223633236342363523636236372363823639236402364123642236432364423645236462364723648236492365023651236522365323654236552365623657236582365923660236612366223663236642366523666236672366823669236702367123672236732367423675236762367723678236792368023681236822368323684236852368623687236882368923690236912369223693236942369523696236972369823699237002370123702237032370423705237062370723708237092371023711237122371323714237152371623717237182371923720237212372223723237242372523726237272372823729237302373123732237332373423735237362373723738237392374023741237422374323744237452374623747237482374923750237512375223753237542375523756237572375823759237602376123762237632376423765237662376723768237692377023771237722377323774237752377623777237782377923780237812378223783237842378523786237872378823789237902379123792237932379423795237962379723798237992380023801238022380323804238052380623807238082380923810238112381223813238142381523816238172381823819238202382123822238232382423825238262382723828238292383023831238322383323834238352383623837238382383923840238412384223843238442384523846238472384823849238502385123852238532385423855238562385723858238592386023861238622386323864238652386623867238682386923870238712387223873238742387523876238772387823879238802388123882238832388423885238862388723888238892389023891238922389323894238952389623897238982389923900239012390223903239042390523906239072390823909239102391123912239132391423915239162391723918239192392023921239222392323924239252392623927239282392923930239312393223933239342393523936239372393823939239402394123942239432394423945239462394723948239492395023951239522395323954239552395623957239582395923960239612396223963239642396523966239672396823969239702397123972239732397423975239762397723978239792398023981239822398323984239852398623987239882398923990239912399223993239942399523996239972399823999240002400124002240032400424005240062400724008240092401024011240122401324014240152401624017240182401924020240212402224023240242402524026240272402824029240302403124032240332403424035240362403724038240392404024041240422404324044240452404624047240482404924050240512405224053240542405524056240572405824059240602406124062240632406424065240662406724068240692407024071240722407324074240752407624077240782407924080240812408224083240842408524086240872408824089240902409124092240932409424095240962409724098240992410024101241022410324104241052410624107241082410924110241112411224113241142411524116241172411824119241202412124122241232412424125241262412724128241292413024131241322413324134241352413624137241382413924140241412414224143241442414524146241472414824149241502415124152241532415424155241562415724158241592416024161241622416324164241652416624167241682416924170241712417224173241742417524176241772417824179241802418124182241832418424185241862418724188241892419024191241922419324194241952419624197241982419924200242012420224203242042420524206242072420824209242102421124212242132421424215242162421724218242192422024221242222422324224242252422624227242282422924230242312423224233242342423524236242372423824239242402424124242242432424424245242462424724248242492425024251242522425324254242552425624257242582425924260242612426224263242642426524266242672426824269242702427124272242732427424275242762427724278242792428024281242822428324284242852428624287242882428924290242912429224293242942429524296242972429824299243002430124302243032430424305243062430724308243092431024311243122431324314243152431624317243182431924320243212432224323243242432524326243272432824329243302433124332243332433424335243362433724338243392434024341243422434324344243452434624347243482434924350243512435224353243542435524356243572435824359243602436124362243632436424365243662436724368243692437024371243722437324374243752437624377243782437924380243812438224383243842438524386243872438824389243902439124392243932439424395243962439724398243992440024401244022440324404244052440624407244082440924410244112441224413244142441524416244172441824419244202442124422244232442424425244262442724428244292443024431244322443324434244352443624437244382443924440244412444224443244442444524446244472444824449244502445124452244532445424455244562445724458244592446024461244622446324464244652446624467244682446924470244712447224473244742447524476244772447824479244802448124482244832448424485244862448724488244892449024491244922449324494244952449624497244982449924500245012450224503245042450524506245072450824509245102451124512245132451424515245162451724518245192452024521245222452324524245252452624527245282452924530245312453224533245342453524536245372453824539245402454124542245432454424545245462454724548245492455024551245522455324554245552455624557245582455924560245612456224563245642456524566245672456824569245702457124572245732457424575245762457724578245792458024581245822458324584245852458624587245882458924590245912459224593245942459524596245972459824599246002460124602246032460424605246062460724608246092461024611246122461324614246152461624617246182461924620246212462224623246242462524626246272462824629246302463124632246332463424635246362463724638246392464024641246422464324644246452464624647246482464924650246512465224653246542465524656246572465824659246602466124662246632466424665246662466724668246692467024671246722467324674246752467624677246782467924680246812468224683246842468524686246872468824689246902469124692246932469424695246962469724698246992470024701247022470324704247052470624707247082470924710247112471224713247142471524716247172471824719247202472124722247232472424725247262472724728247292473024731247322473324734247352473624737247382473924740247412474224743247442474524746247472474824749247502475124752247532475424755247562475724758247592476024761247622476324764247652476624767247682476924770247712477224773247742477524776247772477824779247802478124782247832478424785247862478724788247892479024791247922479324794247952479624797247982479924800248012480224803248042480524806248072480824809248102481124812248132481424815248162481724818248192482024821248222482324824248252482624827248282482924830248312483224833248342483524836248372483824839248402484124842248432484424845248462484724848248492485024851248522485324854248552485624857248582485924860248612486224863248642486524866248672486824869248702487124872248732487424875248762487724878248792488024881248822488324884248852488624887248882488924890248912489224893248942489524896248972489824899249002490124902249032490424905249062490724908249092491024911249122491324914249152491624917249182491924920249212492224923249242492524926249272492824929249302493124932249332493424935249362493724938249392494024941249422494324944249452494624947249482494924950249512495224953249542495524956249572495824959249602496124962249632496424965249662496724968249692497024971249722497324974249752497624977249782497924980249812498224983249842498524986249872498824989249902499124992249932499424995249962499724998249992500025001250022500325004250052500625007250082500925010250112501225013250142501525016250172501825019250202502125022250232502425025250262502725028250292503025031250322503325034250352503625037250382503925040250412504225043250442504525046250472504825049250502505125052250532505425055250562505725058250592506025061250622506325064250652506625067250682506925070250712507225073250742507525076250772507825079250802508125082250832508425085250862508725088250892509025091250922509325094250952509625097250982509925100251012510225103251042510525106251072510825109251102511125112251132511425115251162511725118251192512025121251222512325124251252512625127251282512925130251312513225133251342513525136251372513825139251402514125142251432514425145251462514725148251492515025151251522515325154251552515625157251582515925160251612516225163251642516525166251672516825169251702517125172251732517425175251762517725178251792518025181251822518325184251852518625187251882518925190251912519225193251942519525196251972519825199252002520125202252032520425205252062520725208252092521025211252122521325214252152521625217252182521925220252212522225223252242522525226252272522825229252302523125232252332523425235252362523725238252392524025241252422524325244252452524625247252482524925250252512525225253252542525525256252572525825259252602526125262252632526425265252662526725268252692527025271252722527325274252752527625277252782527925280252812528225283252842528525286252872528825289252902529125292252932529425295252962529725298252992530025301253022530325304253052530625307253082530925310253112531225313253142531525316253172531825319253202532125322253232532425325253262532725328253292533025331253322533325334253352533625337253382533925340253412534225343253442534525346253472534825349253502535125352253532535425355253562535725358253592536025361253622536325364253652536625367253682536925370253712537225373253742537525376253772537825379253802538125382253832538425385253862538725388253892539025391253922539325394253952539625397253982539925400254012540225403254042540525406254072540825409254102541125412254132541425415254162541725418254192542025421254222542325424254252542625427254282542925430254312543225433254342543525436254372543825439254402544125442254432544425445254462544725448254492545025451254522545325454254552545625457254582545925460254612546225463254642546525466254672546825469254702547125472254732547425475254762547725478254792548025481254822548325484254852548625487254882548925490254912549225493254942549525496254972549825499255002550125502255032550425505255062550725508255092551025511255122551325514255152551625517255182551925520255212552225523255242552525526255272552825529255302553125532255332553425535255362553725538255392554025541255422554325544255452554625547255482554925550255512555225553255542555525556255572555825559255602556125562255632556425565255662556725568255692557025571255722557325574255752557625577255782557925580255812558225583255842558525586255872558825589255902559125592255932559425595255962559725598255992560025601256022560325604256052560625607256082560925610256112561225613256142561525616256172561825619256202562125622256232562425625256262562725628256292563025631256322563325634256352563625637256382563925640256412564225643256442564525646256472564825649256502565125652256532565425655256562565725658256592566025661256622566325664256652566625667256682566925670256712567225673256742567525676256772567825679256802568125682256832568425685256862568725688256892569025691256922569325694256952569625697256982569925700257012570225703257042570525706257072570825709257102571125712257132571425715257162571725718257192572025721257222572325724257252572625727257282572925730257312573225733257342573525736257372573825739257402574125742257432574425745257462574725748257492575025751257522575325754257552575625757257582575925760257612576225763257642576525766257672576825769257702577125772257732577425775257762577725778257792578025781257822578325784257852578625787257882578925790257912579225793257942579525796257972579825799258002580125802258032580425805258062580725808258092581025811258122581325814258152581625817258182581925820258212582225823258242582525826258272582825829258302583125832258332583425835258362583725838258392584025841258422584325844258452584625847258482584925850258512585225853258542585525856258572585825859258602586125862258632586425865258662586725868258692587025871258722587325874258752587625877258782587925880258812588225883258842588525886258872588825889258902589125892258932589425895258962589725898258992590025901259022590325904259052590625907259082590925910259112591225913259142591525916259172591825919259202592125922259232592425925259262592725928259292593025931259322593325934259352593625937259382593925940259412594225943259442594525946259472594825949259502595125952259532595425955259562595725958259592596025961259622596325964259652596625967259682596925970259712597225973259742597525976259772597825979259802598125982259832598425985259862598725988259892599025991259922599325994259952599625997259982599926000260012600226003260042600526006260072600826009260102601126012260132601426015260162601726018260192602026021260222602326024260252602626027260282602926030260312603226033260342603526036260372603826039260402604126042260432604426045260462604726048260492605026051260522605326054260552605626057260582605926060260612606226063260642606526066260672606826069260702607126072260732607426075260762607726078260792608026081260822608326084260852608626087260882608926090260912609226093260942609526096260972609826099261002610126102261032610426105261062610726108261092611026111261122611326114261152611626117261182611926120261212612226123261242612526126261272612826129261302613126132261332613426135261362613726138261392614026141261422614326144261452614626147261482614926150261512615226153261542615526156261572615826159261602616126162261632616426165261662616726168261692617026171261722617326174261752617626177261782617926180261812618226183261842618526186261872618826189261902619126192261932619426195261962619726198261992620026201262022620326204262052620626207262082620926210262112621226213262142621526216262172621826219262202622126222262232622426225262262622726228262292623026231262322623326234262352623626237262382623926240262412624226243262442624526246262472624826249262502625126252262532625426255262562625726258262592626026261262622626326264262652626626267262682626926270262712627226273262742627526276262772627826279262802628126282262832628426285262862628726288262892629026291262922629326294262952629626297262982629926300263012630226303263042630526306263072630826309263102631126312263132631426315263162631726318263192632026321263222632326324263252632626327263282632926330263312633226333263342633526336263372633826339263402634126342263432634426345263462634726348263492635026351263522635326354263552635626357263582635926360263612636226363263642636526366263672636826369263702637126372263732637426375263762637726378263792638026381263822638326384263852638626387263882638926390263912639226393263942639526396263972639826399264002640126402264032640426405264062640726408264092641026411264122641326414264152641626417264182641926420264212642226423264242642526426264272642826429264302643126432264332643426435264362643726438264392644026441264422644326444264452644626447264482644926450264512645226453264542645526456264572645826459264602646126462264632646426465264662646726468264692647026471264722647326474264752647626477264782647926480264812648226483264842648526486264872648826489264902649126492264932649426495264962649726498264992650026501265022650326504265052650626507265082650926510265112651226513265142651526516265172651826519265202652126522265232652426525265262652726528265292653026531265322653326534265352653626537265382653926540265412654226543265442654526546265472654826549265502655126552265532655426555265562655726558265592656026561265622656326564265652656626567265682656926570265712657226573265742657526576265772657826579265802658126582265832658426585265862658726588265892659026591265922659326594265952659626597265982659926600266012660226603266042660526606266072660826609266102661126612266132661426615266162661726618266192662026621266222662326624266252662626627266282662926630266312663226633266342663526636266372663826639266402664126642266432664426645266462664726648266492665026651266522665326654266552665626657266582665926660266612666226663266642666526666266672666826669266702667126672266732667426675266762667726678266792668026681266822668326684266852668626687266882668926690266912669226693266942669526696266972669826699267002670126702267032670426705267062670726708267092671026711267122671326714267152671626717267182671926720267212672226723267242672526726267272672826729267302673126732267332673426735267362673726738267392674026741267422674326744267452674626747267482674926750267512675226753267542675526756267572675826759267602676126762267632676426765267662676726768267692677026771267722677326774267752677626777267782677926780267812678226783267842678526786267872678826789267902679126792267932679426795267962679726798267992680026801268022680326804268052680626807268082680926810268112681226813268142681526816268172681826819268202682126822268232682426825268262682726828268292683026831268322683326834268352683626837268382683926840268412684226843268442684526846268472684826849268502685126852268532685426855268562685726858268592686026861268622686326864268652686626867268682686926870268712687226873268742687526876268772687826879268802688126882268832688426885268862688726888268892689026891268922689326894268952689626897268982689926900269012690226903269042690526906269072690826909269102691126912269132691426915269162691726918269192692026921269222692326924269252692626927269282692926930269312693226933269342693526936269372693826939269402694126942269432694426945269462694726948269492695026951269522695326954269552695626957269582695926960269612696226963269642696526966269672696826969269702697126972269732697426975269762697726978269792698026981269822698326984269852698626987269882698926990269912699226993269942699526996269972699826999270002700127002270032700427005270062700727008270092701027011270122701327014270152701627017270182701927020270212702227023270242702527026270272702827029270302703127032270332703427035270362703727038270392704027041270422704327044270452704627047270482704927050270512705227053270542705527056270572705827059270602706127062270632706427065270662706727068270692707027071270722707327074270752707627077270782707927080270812708227083270842708527086270872708827089270902709127092270932709427095270962709727098270992710027101271022710327104271052710627107271082710927110271112711227113271142711527116271172711827119271202712127122271232712427125271262712727128271292713027131271322713327134271352713627137271382713927140271412714227143271442714527146271472714827149271502715127152271532715427155271562715727158271592716027161271622716327164271652716627167271682716927170271712717227173271742717527176271772717827179271802718127182271832718427185271862718727188271892719027191271922719327194271952719627197271982719927200272012720227203272042720527206272072720827209272102721127212272132721427215272162721727218272192722027221272222722327224272252722627227272282722927230272312723227233272342723527236272372723827239272402724127242272432724427245272462724727248272492725027251272522725327254272552725627257272582725927260272612726227263272642726527266272672726827269272702727127272272732727427275272762727727278272792728027281272822728327284272852728627287272882728927290272912729227293272942729527296272972729827299273002730127302273032730427305273062730727308273092731027311273122731327314273152731627317273182731927320273212732227323273242732527326273272732827329273302733127332273332733427335273362733727338273392734027341273422734327344273452734627347273482734927350273512735227353273542735527356273572735827359273602736127362273632736427365273662736727368273692737027371273722737327374273752737627377273782737927380273812738227383273842738527386273872738827389273902739127392273932739427395273962739727398273992740027401274022740327404274052740627407274082740927410274112741227413274142741527416274172741827419274202742127422274232742427425274262742727428274292743027431274322743327434274352743627437274382743927440274412744227443274442744527446274472744827449274502745127452274532745427455274562745727458274592746027461274622746327464274652746627467274682746927470274712747227473274742747527476274772747827479274802748127482274832748427485274862748727488274892749027491274922749327494274952749627497274982749927500275012750227503275042750527506275072750827509275102751127512275132751427515275162751727518275192752027521275222752327524275252752627527275282752927530275312753227533275342753527536275372753827539275402754127542275432754427545275462754727548275492755027551275522755327554275552755627557275582755927560275612756227563275642756527566275672756827569275702757127572275732757427575275762757727578275792758027581275822758327584275852758627587275882758927590275912759227593275942759527596275972759827599276002760127602276032760427605276062760727608276092761027611276122761327614276152761627617276182761927620276212762227623276242762527626276272762827629276302763127632276332763427635276362763727638276392764027641276422764327644276452764627647276482764927650276512765227653276542765527656276572765827659276602766127662276632766427665276662766727668276692767027671276722767327674276752767627677276782767927680276812768227683276842768527686276872768827689276902769127692276932769427695276962769727698276992770027701277022770327704277052770627707277082770927710277112771227713277142771527716277172771827719277202772127722277232772427725277262772727728277292773027731277322773327734277352773627737277382773927740277412774227743277442774527746277472774827749277502775127752277532775427755277562775727758277592776027761277622776327764277652776627767277682776927770277712777227773277742777527776277772777827779277802778127782277832778427785277862778727788277892779027791277922779327794277952779627797277982779927800278012780227803278042780527806278072780827809278102781127812278132781427815278162781727818278192782027821278222782327824278252782627827278282782927830278312783227833278342783527836278372783827839278402784127842278432784427845278462784727848278492785027851278522785327854278552785627857278582785927860278612786227863278642786527866278672786827869278702787127872278732787427875278762787727878278792788027881278822788327884278852788627887278882788927890278912789227893278942789527896278972789827899279002790127902279032790427905279062790727908279092791027911279122791327914279152791627917279182791927920279212792227923279242792527926279272792827929279302793127932279332793427935279362793727938279392794027941279422794327944279452794627947279482794927950279512795227953279542795527956279572795827959279602796127962279632796427965279662796727968279692797027971279722797327974279752797627977279782797927980279812798227983279842798527986279872798827989279902799127992279932799427995279962799727998279992800028001280022800328004280052800628007280082800928010280112801228013280142801528016280172801828019280202802128022280232802428025280262802728028280292803028031280322803328034280352803628037280382803928040280412804228043280442804528046280472804828049280502805128052280532805428055280562805728058280592806028061280622806328064280652806628067280682806928070280712807228073280742807528076280772807828079280802808128082280832808428085280862808728088280892809028091280922809328094280952809628097280982809928100281012810228103281042810528106281072810828109281102811128112281132811428115281162811728118281192812028121281222812328124281252812628127281282812928130281312813228133281342813528136281372813828139281402814128142281432814428145281462814728148281492815028151281522815328154281552815628157281582815928160281612816228163281642816528166281672816828169281702817128172281732817428175281762817728178281792818028181281822818328184281852818628187281882818928190281912819228193281942819528196281972819828199282002820128202282032820428205282062820728208282092821028211282122821328214282152821628217282182821928220282212822228223282242822528226282272822828229282302823128232282332823428235282362823728238282392824028241282422824328244282452824628247282482824928250282512825228253282542825528256282572825828259282602826128262282632826428265282662826728268282692827028271282722827328274282752827628277282782827928280282812828228283282842828528286282872828828289282902829128292282932829428295282962829728298282992830028301283022830328304283052830628307283082830928310283112831228313283142831528316283172831828319283202832128322283232832428325283262832728328283292833028331283322833328334283352833628337283382833928340283412834228343283442834528346283472834828349283502835128352283532835428355283562835728358283592836028361283622836328364283652836628367283682836928370283712837228373283742837528376283772837828379283802838128382283832838428385283862838728388283892839028391283922839328394283952839628397283982839928400284012840228403284042840528406284072840828409284102841128412284132841428415284162841728418284192842028421284222842328424284252842628427284282842928430284312843228433284342843528436284372843828439284402844128442284432844428445284462844728448284492845028451284522845328454284552845628457284582845928460284612846228463284642846528466284672846828469284702847128472284732847428475284762847728478284792848028481284822848328484284852848628487284882848928490284912849228493284942849528496284972849828499285002850128502285032850428505285062850728508285092851028511285122851328514285152851628517285182851928520285212852228523285242852528526285272852828529285302853128532285332853428535285362853728538285392854028541285422854328544285452854628547285482854928550285512855228553285542855528556285572855828559285602856128562285632856428565285662856728568285692857028571285722857328574285752857628577285782857928580285812858228583285842858528586285872858828589285902859128592285932859428595285962859728598285992860028601286022860328604286052860628607286082860928610286112861228613286142861528616286172861828619286202862128622286232862428625286262862728628286292863028631286322863328634286352863628637286382863928640286412864228643286442864528646286472864828649286502865128652286532865428655286562865728658286592866028661286622866328664286652866628667286682866928670286712867228673286742867528676286772867828679286802868128682286832868428685286862868728688286892869028691286922869328694286952869628697286982869928700287012870228703287042870528706287072870828709287102871128712287132871428715287162871728718287192872028721287222872328724287252872628727287282872928730287312873228733287342873528736287372873828739287402874128742287432874428745287462874728748287492875028751287522875328754287552875628757287582875928760287612876228763287642876528766287672876828769287702877128772287732877428775287762877728778287792878028781287822878328784287852878628787287882878928790287912879228793287942879528796287972879828799288002880128802288032880428805288062880728808288092881028811288122881328814288152881628817288182881928820288212882228823288242882528826288272882828829288302883128832288332883428835288362883728838288392884028841288422884328844288452884628847288482884928850288512885228853288542885528856288572885828859288602886128862288632886428865288662886728868288692887028871288722887328874288752887628877288782887928880288812888228883288842888528886288872888828889288902889128892288932889428895288962889728898288992890028901289022890328904289052890628907289082890928910289112891228913289142891528916289172891828919289202892128922289232892428925289262892728928289292893028931289322893328934289352893628937289382893928940289412894228943289442894528946289472894828949289502895128952289532895428955289562895728958289592896028961289622896328964289652896628967289682896928970289712897228973289742897528976289772897828979289802898128982289832898428985289862898728988289892899028991289922899328994289952899628997289982899929000290012900229003290042900529006290072900829009290102901129012290132901429015290162901729018290192902029021290222902329024290252902629027290282902929030290312903229033290342903529036290372903829039290402904129042290432904429045290462904729048290492905029051290522905329054290552905629057290582905929060290612906229063290642906529066290672906829069290702907129072290732907429075290762907729078290792908029081290822908329084290852908629087290882908929090290912909229093290942909529096290972909829099291002910129102291032910429105291062910729108291092911029111291122911329114291152911629117291182911929120291212912229123291242912529126291272912829129291302913129132291332913429135291362913729138291392914029141291422914329144291452914629147291482914929150291512915229153291542915529156291572915829159291602916129162291632916429165291662916729168291692917029171291722917329174291752917629177291782917929180291812918229183291842918529186291872918829189291902919129192291932919429195291962919729198291992920029201292022920329204292052920629207292082920929210292112921229213292142921529216292172921829219292202922129222292232922429225292262922729228292292923029231292322923329234292352923629237292382923929240292412924229243292442924529246292472924829249292502925129252292532925429255292562925729258292592926029261292622926329264292652926629267292682926929270292712927229273292742927529276292772927829279292802928129282292832928429285292862928729288292892929029291292922929329294292952929629297292982929929300293012930229303293042930529306293072930829309293102931129312293132931429315293162931729318293192932029321293222932329324293252932629327293282932929330293312933229333293342933529336293372933829339293402934129342293432934429345293462934729348293492935029351293522935329354293552935629357293582935929360293612936229363293642936529366293672936829369293702937129372293732937429375293762937729378293792938029381293822938329384293852938629387293882938929390293912939229393293942939529396293972939829399294002940129402294032940429405294062940729408294092941029411294122941329414294152941629417294182941929420294212942229423294242942529426294272942829429294302943129432294332943429435294362943729438294392944029441294422944329444294452944629447294482944929450294512945229453294542945529456294572945829459294602946129462294632946429465294662946729468294692947029471294722947329474294752947629477294782947929480294812948229483294842948529486294872948829489294902949129492294932949429495294962949729498294992950029501295022950329504295052950629507295082950929510295112951229513295142951529516295172951829519295202952129522295232952429525295262952729528295292953029531295322953329534295352953629537295382953929540295412954229543295442954529546295472954829549295502955129552295532955429555295562955729558295592956029561295622956329564295652956629567295682956929570295712957229573295742957529576295772957829579295802958129582295832958429585295862958729588295892959029591295922959329594295952959629597295982959929600296012960229603296042960529606296072960829609296102961129612296132961429615296162961729618296192962029621296222962329624296252962629627296282962929630296312963229633296342963529636296372963829639296402964129642296432964429645296462964729648296492965029651296522965329654296552965629657296582965929660296612966229663296642966529666296672966829669296702967129672296732967429675296762967729678296792968029681296822968329684296852968629687296882968929690296912969229693296942969529696296972969829699297002970129702297032970429705297062970729708297092971029711297122971329714297152971629717297182971929720297212972229723297242972529726297272972829729297302973129732297332973429735297362973729738297392974029741297422974329744297452974629747297482974929750297512975229753297542975529756297572975829759297602976129762297632976429765297662976729768297692977029771297722977329774297752977629777297782977929780297812978229783297842978529786297872978829789297902979129792297932979429795297962979729798297992980029801298022980329804298052980629807298082980929810298112981229813298142981529816298172981829819298202982129822298232982429825298262982729828298292983029831298322983329834298352983629837298382983929840298412984229843298442984529846298472984829849298502985129852298532985429855298562985729858298592986029861298622986329864298652986629867298682986929870298712987229873298742987529876298772987829879298802988129882298832988429885298862988729888298892989029891298922989329894298952989629897298982989929900299012990229903299042990529906299072990829909299102991129912299132991429915299162991729918299192992029921299222992329924299252992629927299282992929930299312993229933299342993529936299372993829939299402994129942299432994429945299462994729948299492995029951299522995329954299552995629957299582995929960299612996229963299642996529966299672996829969299702997129972299732997429975299762997729978299792998029981299822998329984299852998629987299882998929990299912999229993299942999529996299972999829999300003000130002300033000430005300063000730008300093001030011300123001330014300153001630017300183001930020300213002230023300243002530026300273002830029300303003130032300333003430035300363003730038300393004030041300423004330044300453004630047300483004930050300513005230053300543005530056300573005830059300603006130062300633006430065300663006730068300693007030071300723007330074300753007630077300783007930080300813008230083300843008530086300873008830089300903009130092300933009430095300963009730098300993010030101301023010330104301053010630107301083010930110301113011230113301143011530116301173011830119301203012130122301233012430125301263012730128301293013030131301323013330134301353013630137301383013930140301413014230143301443014530146301473014830149301503015130152301533015430155301563015730158301593016030161301623016330164301653016630167301683016930170301713017230173301743017530176301773017830179301803018130182301833018430185301863018730188301893019030191301923019330194301953019630197301983019930200302013020230203302043020530206302073020830209302103021130212302133021430215302163021730218302193022030221302223022330224302253022630227302283022930230302313023230233302343023530236302373023830239302403024130242302433024430245302463024730248302493025030251302523025330254302553025630257302583025930260302613026230263302643026530266302673026830269302703027130272302733027430275302763027730278302793028030281302823028330284302853028630287302883028930290302913029230293302943029530296302973029830299303003030130302303033030430305303063030730308303093031030311303123031330314303153031630317303183031930320303213032230323303243032530326303273032830329303303033130332303333033430335303363033730338303393034030341303423034330344303453034630347303483034930350303513035230353303543035530356303573035830359303603036130362303633036430365303663036730368303693037030371303723037330374303753037630377303783037930380303813038230383303843038530386303873038830389303903039130392303933039430395303963039730398303993040030401304023040330404304053040630407304083040930410304113041230413304143041530416304173041830419304203042130422304233042430425304263042730428304293043030431304323043330434304353043630437304383043930440304413044230443304443044530446304473044830449304503045130452304533045430455304563045730458304593046030461304623046330464304653046630467304683046930470304713047230473304743047530476304773047830479304803048130482304833048430485304863048730488304893049030491304923049330494304953049630497304983049930500305013050230503305043050530506305073050830509305103051130512305133051430515305163051730518305193052030521305223052330524305253052630527305283052930530305313053230533305343053530536305373053830539305403054130542305433054430545305463054730548305493055030551305523055330554305553055630557305583055930560305613056230563305643056530566305673056830569305703057130572305733057430575305763057730578305793058030581305823058330584305853058630587305883058930590305913059230593305943059530596305973059830599306003060130602306033060430605306063060730608306093061030611306123061330614306153061630617306183061930620306213062230623306243062530626306273062830629306303063130632306333063430635306363063730638306393064030641306423064330644306453064630647306483064930650306513065230653306543065530656306573065830659306603066130662306633066430665306663066730668306693067030671306723067330674306753067630677306783067930680306813068230683306843068530686306873068830689306903069130692306933069430695306963069730698306993070030701307023070330704307053070630707307083070930710307113071230713307143071530716307173071830719307203072130722307233072430725307263072730728307293073030731307323073330734307353073630737307383073930740307413074230743307443074530746307473074830749307503075130752307533075430755307563075730758307593076030761307623076330764307653076630767307683076930770307713077230773307743077530776307773077830779307803078130782307833078430785307863078730788307893079030791307923079330794307953079630797307983079930800308013080230803308043080530806308073080830809308103081130812308133081430815308163081730818308193082030821308223082330824308253082630827308283082930830308313083230833308343083530836308373083830839308403084130842308433084430845308463084730848308493085030851308523085330854308553085630857308583085930860308613086230863308643086530866308673086830869308703087130872308733087430875308763087730878308793088030881308823088330884308853088630887308883088930890308913089230893308943089530896308973089830899309003090130902309033090430905309063090730908309093091030911309123091330914309153091630917309183091930920309213092230923309243092530926309273092830929309303093130932309333093430935309363093730938309393094030941309423094330944309453094630947309483094930950309513095230953309543095530956309573095830959309603096130962309633096430965309663096730968309693097030971309723097330974309753097630977309783097930980309813098230983309843098530986309873098830989309903099130992309933099430995309963099730998309993100031001310023100331004310053100631007310083100931010310113101231013310143101531016310173101831019310203102131022310233102431025310263102731028310293103031031310323103331034310353103631037310383103931040310413104231043310443104531046310473104831049310503105131052310533105431055310563105731058310593106031061310623106331064310653106631067310683106931070310713107231073310743107531076310773107831079310803108131082310833108431085310863108731088310893109031091310923109331094310953109631097310983109931100311013110231103311043110531106311073110831109311103111131112311133111431115311163111731118311193112031121311223112331124311253112631127311283112931130311313113231133311343113531136311373113831139311403114131142311433114431145311463114731148311493115031151311523115331154311553115631157311583115931160311613116231163311643116531166311673116831169311703117131172311733117431175311763117731178311793118031181311823118331184311853118631187311883118931190311913119231193311943119531196311973119831199312003120131202312033120431205312063120731208312093121031211312123121331214312153121631217312183121931220312213122231223312243122531226312273122831229312303123131232312333123431235312363123731238312393124031241312423124331244312453124631247312483124931250312513125231253312543125531256312573125831259312603126131262312633126431265312663126731268312693127031271312723127331274312753127631277312783127931280312813128231283312843128531286312873128831289312903129131292312933129431295312963129731298312993130031301313023130331304313053130631307313083130931310313113131231313313143131531316313173131831319313203132131322313233132431325313263132731328313293133031331313323133331334313353133631337313383133931340313413134231343313443134531346313473134831349313503135131352313533135431355313563135731358313593136031361313623136331364313653136631367313683136931370313713137231373313743137531376313773137831379313803138131382313833138431385313863138731388313893139031391313923139331394313953139631397313983139931400314013140231403314043140531406314073140831409314103141131412314133141431415314163141731418314193142031421314223142331424314253142631427314283142931430314313143231433314343143531436314373143831439314403144131442314433144431445314463144731448314493145031451314523145331454314553145631457314583145931460314613146231463314643146531466314673146831469314703147131472314733147431475314763147731478314793148031481314823148331484314853148631487314883148931490314913149231493314943149531496314973149831499315003150131502315033150431505315063150731508315093151031511315123151331514315153151631517315183151931520315213152231523315243152531526315273152831529315303153131532315333153431535315363153731538315393154031541315423154331544315453154631547315483154931550315513155231553315543155531556315573155831559315603156131562315633156431565315663156731568315693157031571315723157331574315753157631577315783157931580315813158231583315843158531586315873158831589315903159131592315933159431595315963159731598315993160031601316023160331604316053160631607316083160931610316113161231613316143161531616316173161831619316203162131622316233162431625316263162731628316293163031631316323163331634316353163631637316383163931640316413164231643316443164531646316473164831649316503165131652316533165431655316563165731658316593166031661316623166331664316653166631667316683166931670316713167231673316743167531676316773167831679316803168131682316833168431685316863168731688316893169031691316923169331694316953169631697316983169931700317013170231703317043170531706317073170831709317103171131712317133171431715317163171731718317193172031721317223172331724317253172631727317283172931730317313173231733317343173531736317373173831739317403174131742317433174431745317463174731748317493175031751317523175331754317553175631757317583175931760317613176231763317643176531766317673176831769317703177131772317733177431775317763177731778317793178031781317823178331784317853178631787317883178931790317913179231793317943179531796317973179831799318003180131802318033180431805318063180731808318093181031811318123181331814318153181631817318183181931820318213182231823318243182531826318273182831829318303183131832318333183431835318363183731838318393184031841318423184331844318453184631847318483184931850318513185231853318543185531856318573185831859318603186131862318633186431865318663186731868318693187031871318723187331874318753187631877318783187931880318813188231883318843188531886318873188831889318903189131892318933189431895318963189731898318993190031901319023190331904319053190631907319083190931910319113191231913319143191531916319173191831919319203192131922319233192431925319263192731928319293193031931319323193331934319353193631937319383193931940319413194231943319443194531946319473194831949319503195131952319533195431955319563195731958319593196031961319623196331964319653196631967319683196931970319713197231973319743197531976319773197831979319803198131982319833198431985319863198731988319893199031991319923199331994319953199631997319983199932000320013200232003320043200532006320073200832009320103201132012320133201432015320163201732018320193202032021320223202332024320253202632027320283202932030320313203232033320343203532036320373203832039320403204132042320433204432045320463204732048320493205032051320523205332054320553205632057320583205932060320613206232063320643206532066320673206832069320703207132072320733207432075320763207732078320793208032081320823208332084320853208632087320883208932090320913209232093320943209532096320973209832099321003210132102321033210432105321063210732108321093211032111321123211332114321153211632117321183211932120321213212232123321243212532126321273212832129321303213132132321333213432135321363213732138321393214032141321423214332144321453214632147321483214932150321513215232153321543215532156321573215832159321603216132162321633216432165321663216732168321693217032171321723217332174321753217632177321783217932180321813218232183321843218532186321873218832189321903219132192321933219432195321963219732198321993220032201322023220332204322053220632207322083220932210322113221232213322143221532216322173221832219322203222132222322233222432225322263222732228322293223032231322323223332234322353223632237322383223932240322413224232243322443224532246322473224832249322503225132252322533225432255322563225732258322593226032261322623226332264322653226632267322683226932270322713227232273322743227532276322773227832279322803228132282322833228432285322863228732288322893229032291322923229332294322953229632297322983229932300323013230232303323043230532306323073230832309323103231132312323133231432315323163231732318323193232032321323223232332324323253232632327323283232932330323313233232333323343233532336323373233832339323403234132342323433234432345323463234732348323493235032351323523235332354323553235632357323583235932360323613236232363323643236532366323673236832369323703237132372323733237432375323763237732378323793238032381323823238332384323853238632387323883238932390323913239232393323943239532396323973239832399324003240132402324033240432405324063240732408324093241032411324123241332414324153241632417324183241932420324213242232423324243242532426324273242832429324303243132432324333243432435324363243732438324393244032441324423244332444324453244632447324483244932450324513245232453324543245532456324573245832459324603246132462324633246432465324663246732468324693247032471324723247332474324753247632477324783247932480324813248232483324843248532486324873248832489324903249132492324933249432495324963249732498324993250032501325023250332504325053250632507325083250932510325113251232513325143251532516325173251832519325203252132522325233252432525325263252732528325293253032531325323253332534325353253632537325383253932540325413254232543325443254532546325473254832549325503255132552325533255432555325563255732558325593256032561325623256332564325653256632567325683256932570325713257232573325743257532576325773257832579325803258132582325833258432585325863258732588325893259032591325923259332594325953259632597325983259932600326013260232603326043260532606326073260832609326103261132612326133261432615326163261732618326193262032621326223262332624326253262632627326283262932630326313263232633326343263532636326373263832639326403264132642326433264432645326463264732648326493265032651326523265332654326553265632657326583265932660326613266232663326643266532666326673266832669326703267132672326733267432675326763267732678326793268032681326823268332684326853268632687326883268932690326913269232693326943269532696326973269832699327003270132702327033270432705327063270732708327093271032711327123271332714327153271632717327183271932720327213272232723327243272532726327273272832729327303273132732327333273432735327363273732738327393274032741327423274332744327453274632747327483274932750327513275232753327543275532756327573275832759327603276132762327633276432765327663276732768327693277032771327723277332774327753277632777327783277932780327813278232783327843278532786327873278832789327903279132792327933279432795327963279732798327993280032801328023280332804328053280632807328083280932810328113281232813328143281532816328173281832819328203282132822328233282432825328263282732828328293283032831328323283332834328353283632837328383283932840328413284232843328443284532846328473284832849328503285132852328533285432855328563285732858328593286032861328623286332864328653286632867328683286932870328713287232873328743287532876328773287832879328803288132882328833288432885328863288732888328893289032891328923289332894328953289632897328983289932900329013290232903329043290532906329073290832909329103291132912329133291432915329163291732918329193292032921329223292332924329253292632927329283292932930329313293232933329343293532936329373293832939329403294132942329433294432945329463294732948329493295032951329523295332954329553295632957329583295932960329613296232963329643296532966329673296832969329703297132972329733297432975329763297732978329793298032981329823298332984329853298632987329883298932990329913299232993329943299532996329973299832999330003300133002330033300433005330063300733008330093301033011330123301333014330153301633017330183301933020330213302233023330243302533026330273302833029330303303133032330333303433035330363303733038330393304033041330423304333044330453304633047330483304933050330513305233053330543305533056330573305833059330603306133062330633306433065330663306733068330693307033071330723307333074330753307633077330783307933080330813308233083330843308533086330873308833089330903309133092330933309433095330963309733098330993310033101331023310333104331053310633107331083310933110331113311233113331143311533116331173311833119331203312133122331233312433125331263312733128331293313033131331323313333134331353313633137331383313933140331413314233143331443314533146331473314833149331503315133152331533315433155331563315733158331593316033161331623316333164331653316633167331683316933170331713317233173331743317533176331773317833179331803318133182331833318433185331863318733188331893319033191331923319333194331953319633197331983319933200332013320233203332043320533206332073320833209332103321133212332133321433215332163321733218332193322033221332223322333224332253322633227332283322933230332313323233233332343323533236332373323833239332403324133242332433324433245332463324733248332493325033251332523325333254332553325633257332583325933260332613326233263332643326533266332673326833269332703327133272332733327433275332763327733278332793328033281332823328333284332853328633287332883328933290332913329233293332943329533296332973329833299333003330133302333033330433305333063330733308333093331033311333123331333314333153331633317333183331933320333213332233323333243332533326333273332833329333303333133332333333333433335333363333733338333393334033341333423334333344333453334633347333483334933350333513335233353333543335533356333573335833359333603336133362333633336433365333663336733368333693337033371333723337333374333753337633377333783337933380333813338233383333843338533386333873338833389333903339133392333933339433395333963339733398333993340033401334023340333404334053340633407334083340933410334113341233413334143341533416334173341833419334203342133422334233342433425334263342733428334293343033431334323343333434334353343633437334383343933440334413344233443334443344533446334473344833449334503345133452334533345433455334563345733458334593346033461334623346333464334653346633467334683346933470334713347233473334743347533476334773347833479334803348133482334833348433485334863348733488334893349033491334923349333494334953349633497334983349933500335013350233503335043350533506335073350833509335103351133512335133351433515335163351733518335193352033521335223352333524335253352633527335283352933530335313353233533335343353533536335373353833539335403354133542335433354433545335463354733548335493355033551335523355333554335553355633557335583355933560335613356233563335643356533566335673356833569335703357133572335733357433575335763357733578335793358033581335823358333584335853358633587335883358933590335913359233593335943359533596335973359833599336003360133602336033360433605336063360733608336093361033611336123361333614336153361633617336183361933620336213362233623336243362533626336273362833629336303363133632336333363433635336363363733638336393364033641336423364333644336453364633647336483364933650336513365233653336543365533656336573365833659336603366133662336633366433665336663366733668336693367033671336723367333674336753367633677336783367933680336813368233683336843368533686336873368833689336903369133692336933369433695336963369733698336993370033701337023370333704337053370633707337083370933710337113371233713337143371533716337173371833719337203372133722337233372433725337263372733728337293373033731337323373333734337353373633737337383373933740337413374233743337443374533746337473374833749337503375133752337533375433755337563375733758337593376033761337623376333764337653376633767337683376933770337713377233773337743377533776337773377833779337803378133782337833378433785337863378733788337893379033791337923379333794337953379633797337983379933800338013380233803338043380533806338073380833809338103381133812338133381433815338163381733818338193382033821338223382333824338253382633827338283382933830338313383233833338343383533836338373383833839338403384133842338433384433845338463384733848338493385033851338523385333854338553385633857338583385933860338613386233863338643386533866338673386833869338703387133872338733387433875338763387733878338793388033881338823388333884338853388633887338883388933890338913389233893338943389533896338973389833899339003390133902339033390433905339063390733908339093391033911339123391333914339153391633917339183391933920339213392233923339243392533926339273392833929339303393133932339333393433935339363393733938339393394033941339423394333944339453394633947339483394933950339513395233953339543395533956339573395833959339603396133962339633396433965339663396733968339693397033971339723397333974339753397633977339783397933980339813398233983339843398533986339873398833989339903399133992339933399433995339963399733998339993400034001340023400334004340053400634007340083400934010340113401234013340143401534016340173401834019340203402134022340233402434025340263402734028340293403034031340323403334034340353403634037340383403934040340413404234043340443404534046340473404834049340503405134052340533405434055340563405734058340593406034061340623406334064340653406634067340683406934070340713407234073340743407534076340773407834079340803408134082340833408434085340863408734088340893409034091340923409334094340953409634097340983409934100341013410234103341043410534106341073410834109341103411134112341133411434115341163411734118341193412034121341223412334124341253412634127341283412934130341313413234133341343413534136341373413834139341403414134142341433414434145341463414734148341493415034151341523415334154341553415634157341583415934160341613416234163341643416534166341673416834169341703417134172341733417434175341763417734178341793418034181341823418334184341853418634187341883418934190341913419234193341943419534196341973419834199342003420134202342033420434205342063420734208342093421034211342123421334214342153421634217342183421934220342213422234223342243422534226342273422834229342303423134232342333423434235342363423734238342393424034241342423424334244342453424634247342483424934250342513425234253342543425534256342573425834259342603426134262342633426434265342663426734268342693427034271342723427334274342753427634277342783427934280342813428234283342843428534286342873428834289342903429134292342933429434295342963429734298342993430034301343023430334304343053430634307343083430934310343113431234313343143431534316343173431834319343203432134322343233432434325343263432734328343293433034331343323433334334343353433634337343383433934340343413434234343343443434534346343473434834349343503435134352343533435434355343563435734358343593436034361343623436334364343653436634367343683436934370343713437234373343743437534376343773437834379343803438134382343833438434385343863438734388343893439034391343923439334394343953439634397343983439934400344013440234403344043440534406344073440834409344103441134412344133441434415344163441734418344193442034421344223442334424344253442634427344283442934430344313443234433344343443534436344373443834439344403444134442344433444434445344463444734448344493445034451344523445334454344553445634457344583445934460344613446234463344643446534466344673446834469344703447134472344733447434475344763447734478344793448034481344823448334484344853448634487344883448934490344913449234493344943449534496344973449834499345003450134502345033450434505345063450734508345093451034511345123451334514345153451634517345183451934520345213452234523345243452534526345273452834529345303453134532345333453434535345363453734538345393454034541345423454334544345453454634547345483454934550345513455234553345543455534556345573455834559345603456134562345633456434565345663456734568345693457034571345723457334574345753457634577345783457934580345813458234583345843458534586345873458834589345903459134592345933459434595345963459734598345993460034601346023460334604346053460634607346083460934610346113461234613346143461534616346173461834619346203462134622346233462434625346263462734628346293463034631346323463334634346353463634637346383463934640346413464234643346443464534646346473464834649346503465134652346533465434655346563465734658346593466034661346623466334664346653466634667346683466934670346713467234673346743467534676346773467834679346803468134682346833468434685346863468734688346893469034691346923469334694346953469634697346983469934700347013470234703347043470534706347073470834709347103471134712347133471434715347163471734718347193472034721347223472334724347253472634727347283472934730347313473234733347343473534736347373473834739347403474134742347433474434745347463474734748347493475034751347523475334754347553475634757347583475934760347613476234763347643476534766347673476834769347703477134772347733477434775347763477734778347793478034781347823478334784347853478634787347883478934790347913479234793347943479534796347973479834799348003480134802348033480434805348063480734808348093481034811348123481334814348153481634817348183481934820348213482234823348243482534826348273482834829348303483134832348333483434835348363483734838348393484034841348423484334844348453484634847348483484934850348513485234853348543485534856348573485834859348603486134862348633486434865348663486734868348693487034871348723487334874348753487634877348783487934880348813488234883348843488534886348873488834889348903489134892348933489434895348963489734898348993490034901349023490334904349053490634907349083490934910349113491234913349143491534916349173491834919349203492134922349233492434925349263492734928349293493034931349323493334934349353493634937349383493934940349413494234943349443494534946349473494834949349503495134952349533495434955349563495734958349593496034961349623496334964349653496634967349683496934970349713497234973349743497534976349773497834979349803498134982349833498434985349863498734988349893499034991349923499334994349953499634997349983499935000350013500235003350043500535006350073500835009350103501135012350133501435015350163501735018350193502035021350223502335024350253502635027350283502935030350313503235033350343503535036350373503835039350403504135042350433504435045350463504735048350493505035051350523505335054350553505635057350583505935060350613506235063350643506535066350673506835069350703507135072350733507435075350763507735078350793508035081350823508335084350853508635087350883508935090350913509235093350943509535096350973509835099351003510135102351033510435105351063510735108351093511035111351123511335114351153511635117351183511935120351213512235123351243512535126351273512835129351303513135132351333513435135351363513735138351393514035141351423514335144351453514635147351483514935150351513515235153351543515535156351573515835159351603516135162351633516435165351663516735168351693517035171351723517335174351753517635177351783517935180351813518235183351843518535186351873518835189351903519135192351933519435195351963519735198351993520035201352023520335204352053520635207352083520935210352113521235213352143521535216352173521835219352203522135222352233522435225352263522735228352293523035231352323523335234352353523635237352383523935240352413524235243352443524535246352473524835249352503525135252352533525435255352563525735258352593526035261352623526335264352653526635267352683526935270352713527235273352743527535276352773527835279352803528135282352833528435285352863528735288352893529035291352923529335294352953529635297352983529935300353013530235303353043530535306353073530835309353103531135312353133531435315353163531735318353193532035321353223532335324353253532635327353283532935330353313533235333353343533535336353373533835339353403534135342353433534435345353463534735348353493535035351353523535335354353553535635357353583535935360353613536235363353643536535366353673536835369353703537135372353733537435375353763537735378353793538035381353823538335384353853538635387353883538935390353913539235393353943539535396353973539835399354003540135402354033540435405354063540735408354093541035411354123541335414354153541635417354183541935420354213542235423354243542535426354273542835429354303543135432354333543435435354363543735438354393544035441354423544335444354453544635447354483544935450354513545235453354543545535456354573545835459354603546135462354633546435465354663546735468354693547035471354723547335474354753547635477354783547935480354813548235483354843548535486354873548835489354903549135492354933549435495354963549735498354993550035501355023550335504355053550635507355083550935510355113551235513355143551535516355173551835519355203552135522355233552435525355263552735528355293553035531355323553335534355353553635537355383553935540355413554235543355443554535546355473554835549355503555135552355533555435555355563555735558355593556035561355623556335564355653556635567355683556935570355713557235573355743557535576355773557835579355803558135582355833558435585355863558735588355893559035591355923559335594355953559635597355983559935600356013560235603356043560535606356073560835609356103561135612356133561435615356163561735618356193562035621356223562335624356253562635627356283562935630356313563235633356343563535636356373563835639356403564135642356433564435645356463564735648356493565035651356523565335654356553565635657356583565935660356613566235663356643566535666356673566835669356703567135672356733567435675356763567735678356793568035681356823568335684356853568635687356883568935690356913569235693356943569535696356973569835699357003570135702357033570435705357063570735708357093571035711357123571335714357153571635717357183571935720357213572235723357243572535726357273572835729357303573135732357333573435735357363573735738357393574035741357423574335744357453574635747357483574935750357513575235753357543575535756357573575835759357603576135762357633576435765357663576735768357693577035771357723577335774357753577635777357783577935780357813578235783357843578535786357873578835789357903579135792357933579435795357963579735798357993580035801358023580335804358053580635807358083580935810358113581235813358143581535816358173581835819358203582135822358233582435825358263582735828358293583035831358323583335834358353583635837358383583935840358413584235843358443584535846358473584835849358503585135852358533585435855358563585735858358593586035861358623586335864358653586635867358683586935870358713587235873358743587535876358773587835879358803588135882358833588435885358863588735888358893589035891358923589335894358953589635897358983589935900359013590235903359043590535906359073590835909359103591135912359133591435915359163591735918359193592035921359223592335924359253592635927359283592935930359313593235933359343593535936359373593835939359403594135942359433594435945359463594735948359493595035951359523595335954359553595635957359583595935960359613596235963359643596535966359673596835969359703597135972359733597435975359763597735978359793598035981359823598335984359853598635987359883598935990359913599235993359943599535996359973599835999360003600136002360033600436005360063600736008360093601036011360123601336014360153601636017360183601936020360213602236023360243602536026360273602836029360303603136032360333603436035360363603736038360393604036041360423604336044360453604636047360483604936050360513605236053360543605536056360573605836059360603606136062360633606436065360663606736068360693607036071360723607336074360753607636077360783607936080360813608236083360843608536086360873608836089360903609136092360933609436095360963609736098360993610036101361023610336104361053610636107361083610936110361113611236113361143611536116361173611836119361203612136122361233612436125361263612736128361293613036131361323613336134361353613636137361383613936140361413614236143361443614536146361473614836149361503615136152361533615436155361563615736158361593616036161361623616336164361653616636167361683616936170361713617236173361743617536176361773617836179361803618136182361833618436185361863618736188361893619036191361923619336194361953619636197361983619936200362013620236203362043620536206362073620836209362103621136212362133621436215362163621736218362193622036221362223622336224362253622636227362283622936230362313623236233362343623536236362373623836239362403624136242362433624436245362463624736248362493625036251362523625336254362553625636257362583625936260362613626236263362643626536266362673626836269362703627136272362733627436275362763627736278362793628036281362823628336284362853628636287362883628936290362913629236293362943629536296362973629836299363003630136302363033630436305363063630736308363093631036311363123631336314363153631636317363183631936320363213632236323363243632536326363273632836329363303633136332363333633436335363363633736338363393634036341363423634336344363453634636347363483634936350363513635236353363543635536356363573635836359363603636136362363633636436365363663636736368363693637036371363723637336374363753637636377363783637936380363813638236383363843638536386363873638836389363903639136392363933639436395363963639736398363993640036401364023640336404364053640636407364083640936410364113641236413364143641536416364173641836419364203642136422364233642436425364263642736428364293643036431364323643336434364353643636437364383643936440364413644236443364443644536446364473644836449364503645136452364533645436455364563645736458364593646036461364623646336464364653646636467364683646936470364713647236473364743647536476364773647836479364803648136482364833648436485364863648736488364893649036491364923649336494364953649636497364983649936500365013650236503365043650536506365073650836509365103651136512365133651436515365163651736518365193652036521365223652336524365253652636527365283652936530365313653236533365343653536536365373653836539365403654136542365433654436545365463654736548365493655036551365523655336554365553655636557365583655936560365613656236563365643656536566365673656836569365703657136572365733657436575365763657736578365793658036581365823658336584365853658636587365883658936590365913659236593365943659536596365973659836599366003660136602366033660436605366063660736608366093661036611366123661336614366153661636617366183661936620366213662236623366243662536626366273662836629366303663136632366333663436635366363663736638366393664036641366423664336644366453664636647366483664936650366513665236653366543665536656366573665836659366603666136662366633666436665366663666736668366693667036671366723667336674366753667636677366783667936680366813668236683366843668536686366873668836689366903669136692366933669436695366963669736698366993670036701367023670336704367053670636707367083670936710367113671236713367143671536716367173671836719367203672136722367233672436725367263672736728367293673036731367323673336734367353673636737367383673936740367413674236743367443674536746367473674836749367503675136752367533675436755367563675736758367593676036761367623676336764367653676636767367683676936770367713677236773367743677536776367773677836779367803678136782367833678436785367863678736788367893679036791367923679336794367953679636797367983679936800368013680236803368043680536806368073680836809368103681136812368133681436815368163681736818368193682036821368223682336824368253682636827368283682936830368313683236833368343683536836368373683836839368403684136842368433684436845368463684736848368493685036851368523685336854368553685636857368583685936860368613686236863368643686536866368673686836869368703687136872368733687436875368763687736878368793688036881368823688336884368853688636887368883688936890368913689236893368943689536896368973689836899369003690136902369033690436905369063690736908369093691036911369123691336914369153691636917369183691936920369213692236923369243692536926369273692836929369303693136932369333693436935369363693736938369393694036941369423694336944369453694636947369483694936950369513695236953369543695536956369573695836959369603696136962369633696436965369663696736968369693697036971369723697336974369753697636977369783697936980369813698236983369843698536986369873698836989369903699136992369933699436995369963699736998369993700037001370023700337004370053700637007370083700937010370113701237013370143701537016370173701837019370203702137022370233702437025370263702737028370293703037031370323703337034370353703637037370383703937040370413704237043370443704537046370473704837049370503705137052370533705437055370563705737058370593706037061370623706337064370653706637067370683706937070370713707237073370743707537076370773707837079370803708137082370833708437085370863708737088370893709037091370923709337094370953709637097370983709937100371013710237103371043710537106371073710837109371103711137112371133711437115371163711737118371193712037121371223712337124371253712637127371283712937130371313713237133371343713537136371373713837139371403714137142371433714437145371463714737148371493715037151371523715337154371553715637157371583715937160371613716237163371643716537166371673716837169371703717137172371733717437175371763717737178371793718037181371823718337184371853718637187371883718937190371913719237193371943719537196371973719837199372003720137202372033720437205372063720737208372093721037211372123721337214372153721637217372183721937220372213722237223372243722537226372273722837229372303723137232372333723437235372363723737238372393724037241372423724337244372453724637247372483724937250372513725237253372543725537256372573725837259372603726137262372633726437265372663726737268372693727037271372723727337274372753727637277372783727937280372813728237283372843728537286372873728837289372903729137292372933729437295372963729737298372993730037301373023730337304373053730637307373083730937310373113731237313373143731537316373173731837319373203732137322373233732437325373263732737328373293733037331373323733337334373353733637337373383733937340373413734237343373443734537346373473734837349373503735137352373533735437355373563735737358373593736037361373623736337364373653736637367373683736937370373713737237373373743737537376373773737837379373803738137382373833738437385373863738737388373893739037391373923739337394373953739637397373983739937400374013740237403374043740537406374073740837409374103741137412374133741437415374163741737418374193742037421374223742337424374253742637427374283742937430374313743237433374343743537436374373743837439374403744137442374433744437445374463744737448374493745037451374523745337454374553745637457374583745937460374613746237463374643746537466374673746837469374703747137472374733747437475374763747737478374793748037481374823748337484374853748637487374883748937490374913749237493374943749537496374973749837499375003750137502375033750437505375063750737508375093751037511375123751337514375153751637517375183751937520375213752237523375243752537526375273752837529375303753137532375333753437535375363753737538375393754037541375423754337544375453754637547375483754937550375513755237553375543755537556375573755837559375603756137562375633756437565375663756737568375693757037571375723757337574375753757637577375783757937580375813758237583375843758537586375873758837589375903759137592375933759437595375963759737598375993760037601376023760337604376053760637607376083760937610376113761237613376143761537616376173761837619376203762137622376233762437625376263762737628376293763037631376323763337634376353763637637376383763937640376413764237643376443764537646376473764837649376503765137652376533765437655376563765737658376593766037661376623766337664376653766637667376683766937670376713767237673376743767537676376773767837679376803768137682376833768437685376863768737688376893769037691376923769337694376953769637697376983769937700377013770237703377043770537706377073770837709377103771137712377133771437715377163771737718377193772037721377223772337724377253772637727377283772937730377313773237733377343773537736377373773837739377403774137742377433774437745377463774737748377493775037751377523775337754377553775637757377583775937760377613776237763377643776537766377673776837769377703777137772377733777437775377763777737778377793778037781377823778337784377853778637787377883778937790377913779237793377943779537796377973779837799378003780137802378033780437805378063780737808378093781037811378123781337814378153781637817378183781937820378213782237823378243782537826378273782837829378303783137832378333783437835378363783737838378393784037841378423784337844378453784637847378483784937850378513785237853378543785537856378573785837859378603786137862378633786437865378663786737868378693787037871378723787337874378753787637877378783787937880378813788237883378843788537886378873788837889378903789137892378933789437895378963789737898378993790037901379023790337904379053790637907379083790937910379113791237913379143791537916379173791837919379203792137922379233792437925379263792737928379293793037931379323793337934379353793637937379383793937940379413794237943379443794537946379473794837949379503795137952379533795437955379563795737958379593796037961379623796337964379653796637967379683796937970379713797237973379743797537976379773797837979379803798137982379833798437985379863798737988379893799037991379923799337994379953799637997379983799938000380013800238003380043800538006380073800838009380103801138012380133801438015380163801738018380193802038021380223802338024380253802638027380283802938030380313803238033380343803538036380373803838039380403804138042380433804438045380463804738048380493805038051380523805338054380553805638057380583805938060380613806238063380643806538066380673806838069380703807138072380733807438075380763807738078380793808038081380823808338084380853808638087380883808938090380913809238093380943809538096380973809838099381003810138102381033810438105381063810738108381093811038111381123811338114381153811638117381183811938120381213812238123381243812538126381273812838129381303813138132381333813438135381363813738138381393814038141381423814338144381453814638147381483814938150381513815238153381543815538156381573815838159381603816138162381633816438165381663816738168381693817038171381723817338174381753817638177381783817938180381813818238183381843818538186381873818838189381903819138192381933819438195381963819738198381993820038201382023820338204382053820638207382083820938210382113821238213382143821538216382173821838219382203822138222382233822438225382263822738228382293823038231382323823338234382353823638237382383823938240382413824238243382443824538246382473824838249382503825138252382533825438255382563825738258382593826038261382623826338264382653826638267382683826938270382713827238273382743827538276382773827838279382803828138282382833828438285382863828738288382893829038291382923829338294382953829638297382983829938300383013830238303383043830538306383073830838309383103831138312383133831438315383163831738318383193832038321383223832338324383253832638327383283832938330383313833238333383343833538336383373833838339383403834138342383433834438345383463834738348383493835038351383523835338354383553835638357383583835938360383613836238363383643836538366383673836838369383703837138372383733837438375383763837738378383793838038381383823838338384383853838638387383883838938390383913839238393383943839538396383973839838399384003840138402384033840438405384063840738408384093841038411384123841338414384153841638417384183841938420384213842238423384243842538426384273842838429384303843138432384333843438435384363843738438384393844038441384423844338444384453844638447384483844938450384513845238453384543845538456384573845838459384603846138462384633846438465384663846738468384693847038471384723847338474384753847638477384783847938480384813848238483384843848538486384873848838489384903849138492384933849438495384963849738498384993850038501385023850338504385053850638507385083850938510385113851238513385143851538516385173851838519385203852138522385233852438525385263852738528385293853038531385323853338534385353853638537385383853938540385413854238543385443854538546385473854838549385503855138552385533855438555385563855738558385593856038561385623856338564385653856638567385683856938570385713857238573385743857538576385773857838579385803858138582385833858438585385863858738588385893859038591385923859338594385953859638597385983859938600386013860238603386043860538606386073860838609386103861138612386133861438615386163861738618386193862038621386223862338624386253862638627386283862938630386313863238633386343863538636386373863838639386403864138642386433864438645386463864738648386493865038651386523865338654386553865638657386583865938660386613866238663386643866538666386673866838669386703867138672386733867438675386763867738678386793868038681386823868338684386853868638687386883868938690386913869238693386943869538696386973869838699387003870138702387033870438705387063870738708387093871038711387123871338714387153871638717387183871938720387213872238723387243872538726387273872838729387303873138732387333873438735387363873738738387393874038741387423874338744387453874638747387483874938750387513875238753387543875538756387573875838759387603876138762387633876438765387663876738768387693877038771387723877338774387753877638777387783877938780387813878238783387843878538786387873878838789387903879138792387933879438795387963879738798387993880038801388023880338804388053880638807388083880938810388113881238813388143881538816388173881838819388203882138822388233882438825388263882738828388293883038831388323883338834388353883638837388383883938840388413884238843388443884538846388473884838849388503885138852388533885438855388563885738858388593886038861388623886338864388653886638867388683886938870388713887238873388743887538876388773887838879388803888138882388833888438885388863888738888388893889038891388923889338894388953889638897388983889938900389013890238903389043890538906389073890838909389103891138912389133891438915389163891738918389193892038921389223892338924389253892638927389283892938930389313893238933389343893538936389373893838939389403894138942389433894438945389463894738948389493895038951389523895338954389553895638957389583895938960389613896238963389643896538966389673896838969389703897138972389733897438975389763897738978389793898038981389823898338984389853898638987389883898938990389913899238993389943899538996389973899838999390003900139002390033900439005390063900739008390093901039011390123901339014390153901639017390183901939020390213902239023390243902539026390273902839029390303903139032390333903439035390363903739038390393904039041390423904339044390453904639047390483904939050390513905239053390543905539056390573905839059390603906139062390633906439065390663906739068390693907039071390723907339074390753907639077390783907939080390813908239083390843908539086390873908839089390903909139092390933909439095390963909739098390993910039101391023910339104391053910639107391083910939110391113911239113391143911539116391173911839119391203912139122391233912439125391263912739128391293913039131391323913339134391353913639137391383913939140391413914239143391443914539146391473914839149391503915139152391533915439155391563915739158391593916039161391623916339164391653916639167391683916939170391713917239173391743917539176391773917839179391803918139182391833918439185391863918739188391893919039191391923919339194391953919639197391983919939200392013920239203392043920539206392073920839209392103921139212392133921439215392163921739218392193922039221392223922339224392253922639227392283922939230392313923239233392343923539236392373923839239392403924139242392433924439245392463924739248392493925039251392523925339254392553925639257392583925939260392613926239263392643926539266392673926839269392703927139272392733927439275392763927739278392793928039281392823928339284392853928639287392883928939290392913929239293392943929539296392973929839299393003930139302393033930439305393063930739308393093931039311393123931339314393153931639317393183931939320393213932239323393243932539326393273932839329393303933139332393333933439335393363933739338393393934039341393423934339344393453934639347393483934939350393513935239353393543935539356393573935839359393603936139362393633936439365393663936739368393693937039371393723937339374393753937639377393783937939380393813938239383393843938539386393873938839389393903939139392393933939439395393963939739398393993940039401394023940339404394053940639407394083940939410394113941239413394143941539416394173941839419394203942139422394233942439425394263942739428394293943039431394323943339434394353943639437394383943939440394413944239443394443944539446394473944839449394503945139452394533945439455394563945739458394593946039461394623946339464394653946639467394683946939470394713947239473394743947539476394773947839479394803948139482394833948439485394863948739488394893949039491394923949339494394953949639497394983949939500395013950239503395043950539506395073950839509395103951139512395133951439515395163951739518395193952039521395223952339524395253952639527395283952939530395313953239533395343953539536395373953839539395403954139542395433954439545395463954739548395493955039551395523955339554395553955639557395583955939560395613956239563395643956539566395673956839569395703957139572395733957439575395763957739578395793958039581395823958339584395853958639587395883958939590395913959239593395943959539596395973959839599396003960139602396033960439605396063960739608396093961039611396123961339614396153961639617396183961939620396213962239623396243962539626396273962839629396303963139632396333963439635396363963739638396393964039641396423964339644396453964639647396483964939650396513965239653396543965539656396573965839659396603966139662396633966439665396663966739668396693967039671396723967339674396753967639677396783967939680396813968239683396843968539686396873968839689396903969139692396933969439695396963969739698396993970039701397023970339704397053970639707397083970939710397113971239713397143971539716397173971839719397203972139722397233972439725397263972739728397293973039731397323973339734397353973639737397383973939740397413974239743397443974539746397473974839749397503975139752397533975439755397563975739758397593976039761397623976339764397653976639767397683976939770397713977239773397743977539776397773977839779397803978139782397833978439785397863978739788397893979039791397923979339794397953979639797397983979939800398013980239803398043980539806398073980839809398103981139812398133981439815398163981739818398193982039821398223982339824398253982639827398283982939830398313983239833398343983539836398373983839839398403984139842398433984439845398463984739848398493985039851398523985339854398553985639857398583985939860398613986239863398643986539866398673986839869398703987139872398733987439875398763987739878398793988039881398823988339884398853988639887398883988939890398913989239893398943989539896398973989839899399003990139902399033990439905399063990739908399093991039911399123991339914399153991639917399183991939920399213992239923399243992539926399273992839929399303993139932399333993439935399363993739938399393994039941399423994339944399453994639947399483994939950399513995239953399543995539956399573995839959399603996139962399633996439965399663996739968399693997039971399723997339974399753997639977399783997939980399813998239983399843998539986399873998839989399903999139992399933999439995399963999739998399994000040001400024000340004400054000640007400084000940010400114001240013400144001540016400174001840019400204002140022400234002440025400264002740028400294003040031400324003340034400354003640037400384003940040400414004240043400444004540046400474004840049400504005140052400534005440055400564005740058400594006040061400624006340064400654006640067400684006940070400714007240073400744007540076400774007840079400804008140082400834008440085400864008740088400894009040091400924009340094400954009640097400984009940100401014010240103401044010540106401074010840109401104011140112401134011440115401164011740118401194012040121401224012340124401254012640127401284012940130401314013240133401344013540136401374013840139401404014140142401434014440145401464014740148401494015040151401524015340154401554015640157401584015940160401614016240163401644016540166401674016840169401704017140172401734017440175401764017740178401794018040181401824018340184401854018640187401884018940190401914019240193401944019540196401974019840199402004020140202402034020440205402064020740208402094021040211402124021340214402154021640217402184021940220402214022240223402244022540226402274022840229402304023140232402334023440235402364023740238402394024040241402424024340244402454024640247402484024940250402514025240253402544025540256402574025840259402604026140262402634026440265402664026740268402694027040271402724027340274402754027640277402784027940280402814028240283402844028540286402874028840289402904029140292402934029440295402964029740298402994030040301403024030340304403054030640307403084030940310403114031240313403144031540316403174031840319403204032140322403234032440325403264032740328403294033040331403324033340334403354033640337403384033940340403414034240343403444034540346403474034840349403504035140352403534035440355403564035740358403594036040361403624036340364403654036640367403684036940370403714037240373403744037540376403774037840379403804038140382403834038440385403864038740388403894039040391403924039340394403954039640397403984039940400404014040240403404044040540406404074040840409404104041140412404134041440415404164041740418404194042040421404224042340424404254042640427404284042940430404314043240433404344043540436404374043840439404404044140442404434044440445404464044740448404494045040451404524045340454404554045640457404584045940460404614046240463404644046540466404674046840469404704047140472404734047440475404764047740478404794048040481404824048340484404854048640487404884048940490404914049240493404944049540496404974049840499405004050140502405034050440505405064050740508405094051040511405124051340514405154051640517405184051940520405214052240523405244052540526405274052840529405304053140532405334053440535405364053740538405394054040541405424054340544405454054640547405484054940550405514055240553405544055540556405574055840559405604056140562405634056440565405664056740568405694057040571405724057340574405754057640577405784057940580405814058240583405844058540586405874058840589405904059140592405934059440595405964059740598405994060040601406024060340604406054060640607406084060940610406114061240613406144061540616406174061840619406204062140622406234062440625406264062740628406294063040631406324063340634406354063640637406384063940640406414064240643406444064540646406474064840649406504065140652406534065440655406564065740658406594066040661406624066340664406654066640667406684066940670406714067240673406744067540676406774067840679406804068140682406834068440685406864068740688406894069040691406924069340694406954069640697406984069940700407014070240703407044070540706407074070840709407104071140712407134071440715407164071740718407194072040721407224072340724407254072640727407284072940730407314073240733407344073540736407374073840739407404074140742407434074440745407464074740748407494075040751407524075340754407554075640757407584075940760407614076240763407644076540766407674076840769407704077140772407734077440775407764077740778407794078040781407824078340784407854078640787407884078940790407914079240793407944079540796407974079840799408004080140802408034080440805408064080740808408094081040811408124081340814408154081640817408184081940820408214082240823408244082540826408274082840829408304083140832408334083440835408364083740838408394084040841408424084340844408454084640847408484084940850408514085240853408544085540856408574085840859408604086140862408634086440865408664086740868408694087040871408724087340874408754087640877408784087940880408814088240883408844088540886408874088840889408904089140892408934089440895408964089740898408994090040901409024090340904409054090640907409084090940910409114091240913409144091540916409174091840919409204092140922409234092440925409264092740928409294093040931409324093340934409354093640937409384093940940409414094240943409444094540946409474094840949409504095140952409534095440955409564095740958409594096040961409624096340964409654096640967409684096940970409714097240973409744097540976409774097840979409804098140982409834098440985409864098740988409894099040991409924099340994409954099640997409984099941000410014100241003410044100541006410074100841009410104101141012410134101441015410164101741018410194102041021410224102341024410254102641027410284102941030410314103241033410344103541036410374103841039410404104141042410434104441045410464104741048410494105041051410524105341054410554105641057410584105941060410614106241063410644106541066410674106841069410704107141072410734107441075410764107741078410794108041081410824108341084410854108641087410884108941090410914109241093410944109541096410974109841099411004110141102411034110441105411064110741108411094111041111411124111341114411154111641117411184111941120411214112241123411244112541126411274112841129411304113141132411334113441135411364113741138411394114041141411424114341144411454114641147411484114941150411514115241153411544115541156411574115841159411604116141162411634116441165411664116741168411694117041171411724117341174411754117641177411784117941180411814118241183411844118541186411874118841189411904119141192411934119441195411964119741198411994120041201412024120341204412054120641207412084120941210412114121241213412144121541216412174121841219412204122141222412234122441225412264122741228412294123041231412324123341234412354123641237412384123941240412414124241243412444124541246412474124841249412504125141252412534125441255412564125741258412594126041261412624126341264412654126641267412684126941270412714127241273412744127541276412774127841279412804128141282412834128441285412864128741288412894129041291412924129341294412954129641297412984129941300413014130241303413044130541306413074130841309413104131141312413134131441315413164131741318413194132041321413224132341324413254132641327413284132941330413314133241333413344133541336413374133841339413404134141342413434134441345413464134741348413494135041351413524135341354413554135641357413584135941360413614136241363413644136541366413674136841369413704137141372413734137441375413764137741378413794138041381413824138341384413854138641387413884138941390413914139241393413944139541396413974139841399414004140141402414034140441405414064140741408414094141041411414124141341414414154141641417414184141941420414214142241423414244142541426414274142841429414304143141432414334143441435414364143741438414394144041441414424144341444414454144641447414484144941450414514145241453414544145541456414574145841459414604146141462414634146441465414664146741468414694147041471414724147341474414754147641477414784147941480414814148241483414844148541486414874148841489414904149141492414934149441495414964149741498414994150041501415024150341504415054150641507415084150941510415114151241513415144151541516415174151841519415204152141522415234152441525415264152741528415294153041531415324153341534415354153641537415384153941540415414154241543415444154541546415474154841549415504155141552415534155441555415564155741558415594156041561415624156341564415654156641567415684156941570415714157241573415744157541576415774157841579415804158141582415834158441585415864158741588415894159041591415924159341594415954159641597415984159941600416014160241603416044160541606416074160841609416104161141612416134161441615416164161741618416194162041621416224162341624416254162641627416284162941630416314163241633416344163541636416374163841639416404164141642416434164441645416464164741648416494165041651416524165341654416554165641657416584165941660416614166241663416644166541666416674166841669416704167141672416734167441675416764167741678416794168041681416824168341684416854168641687416884168941690416914169241693416944169541696416974169841699417004170141702417034170441705417064170741708417094171041711417124171341714417154171641717417184171941720417214172241723417244172541726417274172841729417304173141732417334173441735417364173741738417394174041741417424174341744417454174641747417484174941750417514175241753417544175541756417574175841759417604176141762417634176441765417664176741768417694177041771417724177341774417754177641777417784177941780417814178241783417844178541786417874178841789417904179141792417934179441795417964179741798417994180041801418024180341804418054180641807418084180941810418114181241813418144181541816418174181841819418204182141822418234182441825418264182741828418294183041831418324183341834418354183641837418384183941840418414184241843418444184541846418474184841849418504185141852418534185441855418564185741858418594186041861418624186341864418654186641867418684186941870418714187241873418744187541876418774187841879418804188141882418834188441885418864188741888418894189041891418924189341894418954189641897418984189941900419014190241903419044190541906419074190841909419104191141912419134191441915419164191741918419194192041921419224192341924419254192641927419284192941930419314193241933419344193541936419374193841939419404194141942419434194441945419464194741948419494195041951419524195341954419554195641957419584195941960419614196241963419644196541966419674196841969419704197141972419734197441975419764197741978419794198041981419824198341984419854198641987419884198941990419914199241993419944199541996419974199841999420004200142002420034200442005420064200742008420094201042011420124201342014420154201642017420184201942020420214202242023420244202542026420274202842029420304203142032420334203442035420364203742038420394204042041420424204342044420454204642047420484204942050420514205242053420544205542056420574205842059420604206142062420634206442065420664206742068420694207042071420724207342074420754207642077420784207942080420814208242083420844208542086420874208842089420904209142092420934209442095420964209742098420994210042101421024210342104421054210642107421084210942110421114211242113421144211542116421174211842119421204212142122421234212442125421264212742128421294213042131421324213342134421354213642137421384213942140421414214242143421444214542146421474214842149421504215142152421534215442155421564215742158421594216042161421624216342164421654216642167421684216942170421714217242173421744217542176421774217842179421804218142182421834218442185421864218742188421894219042191421924219342194421954219642197421984219942200422014220242203422044220542206422074220842209422104221142212422134221442215422164221742218422194222042221422224222342224422254222642227422284222942230422314223242233422344223542236422374223842239422404224142242422434224442245422464224742248422494225042251422524225342254422554225642257422584225942260422614226242263422644226542266422674226842269422704227142272422734227442275422764227742278422794228042281422824228342284422854228642287422884228942290422914229242293422944229542296422974229842299423004230142302423034230442305423064230742308423094231042311423124231342314423154231642317423184231942320423214232242323423244232542326423274232842329423304233142332423334233442335423364233742338423394234042341423424234342344423454234642347423484234942350423514235242353423544235542356423574235842359423604236142362423634236442365423664236742368423694237042371423724237342374423754237642377423784237942380423814238242383423844238542386423874238842389423904239142392423934239442395423964239742398423994240042401424024240342404424054240642407424084240942410424114241242413424144241542416424174241842419424204242142422424234242442425424264242742428424294243042431424324243342434424354243642437424384243942440424414244242443424444244542446424474244842449424504245142452424534245442455424564245742458424594246042461424624246342464424654246642467424684246942470424714247242473424744247542476424774247842479424804248142482424834248442485424864248742488424894249042491424924249342494424954249642497424984249942500425014250242503425044250542506425074250842509425104251142512425134251442515425164251742518425194252042521425224252342524425254252642527425284252942530425314253242533425344253542536425374253842539425404254142542425434254442545425464254742548425494255042551425524255342554425554255642557425584255942560425614256242563425644256542566425674256842569425704257142572425734257442575425764257742578425794258042581425824258342584425854258642587425884258942590425914259242593425944259542596425974259842599426004260142602426034260442605426064260742608426094261042611426124261342614426154261642617426184261942620426214262242623426244262542626426274262842629426304263142632426334263442635426364263742638426394264042641426424264342644426454264642647426484264942650426514265242653426544265542656426574265842659426604266142662426634266442665426664266742668426694267042671426724267342674426754267642677426784267942680426814268242683426844268542686426874268842689426904269142692426934269442695426964269742698426994270042701427024270342704427054270642707427084270942710427114271242713427144271542716427174271842719427204272142722427234272442725427264272742728427294273042731427324273342734427354273642737427384273942740427414274242743427444274542746427474274842749427504275142752427534275442755427564275742758427594276042761427624276342764427654276642767427684276942770427714277242773427744277542776427774277842779427804278142782427834278442785427864278742788427894279042791427924279342794427954279642797427984279942800428014280242803428044280542806428074280842809428104281142812428134281442815428164281742818428194282042821428224282342824428254282642827428284282942830428314283242833428344283542836428374283842839428404284142842428434284442845428464284742848428494285042851428524285342854428554285642857428584285942860428614286242863428644286542866428674286842869428704287142872428734287442875428764287742878428794288042881428824288342884428854288642887428884288942890428914289242893428944289542896428974289842899429004290142902429034290442905429064290742908429094291042911429124291342914429154291642917429184291942920429214292242923429244292542926429274292842929429304293142932429334293442935429364293742938429394294042941429424294342944429454294642947429484294942950429514295242953429544295542956429574295842959429604296142962429634296442965429664296742968429694297042971429724297342974429754297642977429784297942980429814298242983429844298542986429874298842989429904299142992429934299442995429964299742998429994300043001430024300343004430054300643007430084300943010430114301243013430144301543016430174301843019430204302143022430234302443025430264302743028430294303043031430324303343034430354303643037430384303943040430414304243043430444304543046430474304843049430504305143052430534305443055430564305743058430594306043061430624306343064430654306643067430684306943070430714307243073430744307543076430774307843079430804308143082430834308443085430864308743088430894309043091430924309343094430954309643097430984309943100431014310243103431044310543106431074310843109431104311143112431134311443115431164311743118431194312043121431224312343124431254312643127431284312943130431314313243133431344313543136431374313843139431404314143142431434314443145431464314743148431494315043151431524315343154431554315643157431584315943160431614316243163431644316543166431674316843169431704317143172431734317443175431764317743178431794318043181431824318343184431854318643187431884318943190431914319243193431944319543196431974319843199432004320143202432034320443205432064320743208432094321043211432124321343214432154321643217432184321943220432214322243223432244322543226432274322843229432304323143232432334323443235432364323743238432394324043241432424324343244432454324643247432484324943250432514325243253432544325543256432574325843259432604326143262432634326443265432664326743268432694327043271432724327343274432754327643277432784327943280432814328243283432844328543286432874328843289432904329143292432934329443295432964329743298432994330043301433024330343304433054330643307433084330943310433114331243313433144331543316433174331843319433204332143322433234332443325433264332743328433294333043331433324333343334433354333643337433384333943340433414334243343433444334543346433474334843349433504335143352433534335443355433564335743358433594336043361433624336343364433654336643367433684336943370433714337243373433744337543376433774337843379433804338143382433834338443385433864338743388433894339043391433924339343394433954339643397433984339943400434014340243403434044340543406434074340843409434104341143412434134341443415434164341743418434194342043421434224342343424434254342643427434284342943430434314343243433434344343543436434374343843439434404344143442434434344443445434464344743448434494345043451434524345343454434554345643457434584345943460434614346243463434644346543466434674346843469434704347143472434734347443475434764347743478434794348043481434824348343484434854348643487434884348943490434914349243493434944349543496434974349843499435004350143502435034350443505435064350743508435094351043511435124351343514435154351643517435184351943520435214352243523435244352543526435274352843529435304353143532435334353443535435364353743538435394354043541435424354343544435454354643547435484354943550435514355243553435544355543556435574355843559435604356143562435634356443565435664356743568435694357043571435724357343574435754357643577435784357943580435814358243583435844358543586435874358843589435904359143592435934359443595435964359743598435994360043601436024360343604436054360643607436084360943610436114361243613436144361543616436174361843619436204362143622436234362443625436264362743628436294363043631436324363343634436354363643637436384363943640436414364243643436444364543646436474364843649436504365143652436534365443655436564365743658436594366043661436624366343664436654366643667436684366943670436714367243673436744367543676436774367843679436804368143682436834368443685436864368743688436894369043691436924369343694436954369643697436984369943700437014370243703437044370543706437074370843709437104371143712437134371443715437164371743718437194372043721437224372343724437254372643727437284372943730437314373243733437344373543736437374373843739437404374143742437434374443745437464374743748437494375043751437524375343754437554375643757437584375943760437614376243763437644376543766437674376843769437704377143772437734377443775437764377743778437794378043781437824378343784437854378643787437884378943790437914379243793437944379543796437974379843799438004380143802438034380443805438064380743808438094381043811438124381343814438154381643817438184381943820438214382243823438244382543826438274382843829438304383143832438334383443835438364383743838438394384043841438424384343844438454384643847438484384943850438514385243853438544385543856438574385843859438604386143862438634386443865438664386743868438694387043871438724387343874438754387643877438784387943880438814388243883438844388543886438874388843889438904389143892438934389443895438964389743898438994390043901439024390343904439054390643907439084390943910439114391243913439144391543916439174391843919439204392143922439234392443925439264392743928439294393043931439324393343934439354393643937439384393943940439414394243943439444394543946439474394843949439504395143952439534395443955439564395743958439594396043961439624396343964439654396643967439684396943970439714397243973439744397543976439774397843979439804398143982439834398443985439864398743988439894399043991439924399343994439954399643997439984399944000440014400244003440044400544006440074400844009440104401144012440134401444015440164401744018440194402044021440224402344024440254402644027440284402944030440314403244033440344403544036440374403844039440404404144042440434404444045440464404744048440494405044051440524405344054440554405644057440584405944060440614406244063440644406544066440674406844069440704407144072440734407444075440764407744078440794408044081440824408344084440854408644087440884408944090440914409244093440944409544096440974409844099441004410144102441034410444105441064410744108441094411044111441124411344114441154411644117441184411944120441214412244123441244412544126441274412844129441304413144132441334413444135441364413744138441394414044141441424414344144441454414644147441484414944150441514415244153441544415544156441574415844159441604416144162441634416444165441664416744168441694417044171441724417344174441754417644177441784417944180441814418244183441844418544186441874418844189441904419144192441934419444195441964419744198441994420044201442024420344204442054420644207442084420944210442114421244213442144421544216442174421844219442204422144222442234422444225442264422744228442294423044231442324423344234442354423644237442384423944240442414424244243442444424544246442474424844249442504425144252442534425444255442564425744258442594426044261442624426344264442654426644267442684426944270442714427244273442744427544276442774427844279442804428144282442834428444285442864428744288442894429044291442924429344294442954429644297442984429944300443014430244303443044430544306443074430844309443104431144312443134431444315443164431744318443194432044321443224432344324443254432644327443284432944330443314433244333443344433544336443374433844339443404434144342443434434444345443464434744348443494435044351443524435344354443554435644357443584435944360443614436244363443644436544366443674436844369443704437144372443734437444375443764437744378443794438044381443824438344384443854438644387443884438944390443914439244393443944439544396443974439844399444004440144402444034440444405444064440744408444094441044411444124441344414444154441644417444184441944420444214442244423444244442544426444274442844429444304443144432444334443444435444364443744438444394444044441444424444344444444454444644447444484444944450444514445244453444544445544456444574445844459444604446144462444634446444465444664446744468444694447044471444724447344474444754447644477444784447944480444814448244483444844448544486444874448844489444904449144492444934449444495444964449744498444994450044501445024450344504445054450644507445084450944510445114451244513445144451544516445174451844519445204452144522445234452444525445264452744528445294453044531445324453344534445354453644537445384453944540445414454244543445444454544546445474454844549445504455144552445534455444555445564455744558445594456044561445624456344564445654456644567445684456944570445714457244573445744457544576445774457844579445804458144582445834458444585445864458744588445894459044591445924459344594445954459644597445984459944600446014460244603446044460544606446074460844609446104461144612446134461444615446164461744618446194462044621446224462344624446254462644627446284462944630446314463244633446344463544636446374463844639446404464144642446434464444645446464464744648446494465044651446524465344654446554465644657446584465944660446614466244663446644466544666446674466844669446704467144672446734467444675446764467744678446794468044681446824468344684446854468644687446884468944690446914469244693446944469544696446974469844699447004470144702447034470444705447064470744708447094471044711447124471344714447154471644717447184471944720447214472244723447244472544726447274472844729447304473144732447334473444735447364473744738447394474044741447424474344744447454474644747447484474944750447514475244753447544475544756447574475844759447604476144762447634476444765447664476744768447694477044771447724477344774447754477644777447784477944780447814478244783447844478544786447874478844789447904479144792447934479444795447964479744798447994480044801448024480344804448054480644807448084480944810448114481244813448144481544816448174481844819448204482144822448234482444825448264482744828448294483044831448324483344834448354483644837448384483944840448414484244843448444484544846448474484844849448504485144852448534485444855448564485744858448594486044861448624486344864448654486644867448684486944870448714487244873448744487544876448774487844879448804488144882448834488444885448864488744888448894489044891448924489344894448954489644897448984489944900449014490244903449044490544906449074490844909449104491144912449134491444915449164491744918449194492044921449224492344924449254492644927449284492944930449314493244933449344493544936449374493844939449404494144942449434494444945449464494744948449494495044951449524495344954449554495644957449584495944960449614496244963449644496544966449674496844969449704497144972449734497444975449764497744978449794498044981449824498344984449854498644987449884498944990449914499244993449944499544996449974499844999450004500145002450034500445005450064500745008450094501045011450124501345014450154501645017450184501945020450214502245023450244502545026450274502845029450304503145032450334503445035450364503745038450394504045041450424504345044450454504645047450484504945050450514505245053450544505545056450574505845059450604506145062450634506445065450664506745068450694507045071450724507345074450754507645077450784507945080450814508245083450844508545086450874508845089450904509145092450934509445095450964509745098450994510045101451024510345104451054510645107451084510945110451114511245113451144511545116451174511845119451204512145122451234512445125451264512745128451294513045131451324513345134451354513645137451384513945140451414514245143451444514545146451474514845149451504515145152451534515445155451564515745158451594516045161451624516345164451654516645167451684516945170451714517245173451744517545176451774517845179451804518145182451834518445185451864518745188451894519045191451924519345194451954519645197451984519945200452014520245203452044520545206452074520845209452104521145212452134521445215452164521745218452194522045221452224522345224452254522645227452284522945230452314523245233452344523545236452374523845239452404524145242452434524445245452464524745248452494525045251452524525345254452554525645257452584525945260452614526245263452644526545266452674526845269452704527145272452734527445275452764527745278452794528045281452824528345284452854528645287452884528945290452914529245293452944529545296452974529845299453004530145302453034530445305453064530745308453094531045311453124531345314453154531645317453184531945320453214532245323453244532545326453274532845329453304533145332453334533445335453364533745338453394534045341453424534345344453454534645347453484534945350453514535245353453544535545356453574535845359453604536145362453634536445365453664536745368453694537045371453724537345374453754537645377453784537945380453814538245383453844538545386453874538845389453904539145392453934539445395453964539745398453994540045401454024540345404454054540645407454084540945410454114541245413454144541545416454174541845419454204542145422454234542445425454264542745428454294543045431454324543345434454354543645437454384543945440454414544245443454444544545446454474544845449454504545145452454534545445455454564545745458454594546045461454624546345464454654546645467454684546945470454714547245473454744547545476454774547845479454804548145482454834548445485454864548745488454894549045491454924549345494454954549645497454984549945500455014550245503455044550545506455074550845509455104551145512455134551445515455164551745518455194552045521455224552345524455254552645527455284552945530455314553245533455344553545536455374553845539455404554145542455434554445545455464554745548455494555045551455524555345554455554555645557455584555945560455614556245563455644556545566455674556845569455704557145572455734557445575455764557745578455794558045581455824558345584455854558645587455884558945590455914559245593455944559545596455974559845599456004560145602456034560445605456064560745608456094561045611456124561345614456154561645617456184561945620456214562245623456244562545626456274562845629456304563145632456334563445635456364563745638456394564045641456424564345644456454564645647456484564945650456514565245653456544565545656456574565845659456604566145662456634566445665456664566745668456694567045671456724567345674456754567645677456784567945680456814568245683456844568545686456874568845689456904569145692456934569445695456964569745698456994570045701457024570345704457054570645707457084570945710457114571245713457144571545716457174571845719457204572145722457234572445725457264572745728457294573045731457324573345734457354573645737457384573945740457414574245743457444574545746457474574845749457504575145752457534575445755457564575745758457594576045761457624576345764457654576645767457684576945770457714577245773457744577545776457774577845779457804578145782457834578445785457864578745788457894579045791457924579345794457954579645797457984579945800458014580245803458044580545806458074580845809458104581145812458134581445815458164581745818458194582045821458224582345824458254582645827458284582945830458314583245833458344583545836458374583845839458404584145842458434584445845458464584745848458494585045851458524585345854458554585645857458584585945860458614586245863458644586545866458674586845869458704587145872458734587445875458764587745878458794588045881458824588345884458854588645887458884588945890458914589245893458944589545896458974589845899459004590145902459034590445905459064590745908459094591045911459124591345914459154591645917459184591945920459214592245923459244592545926459274592845929459304593145932459334593445935459364593745938459394594045941459424594345944459454594645947459484594945950459514595245953459544595545956459574595845959459604596145962459634596445965459664596745968459694597045971459724597345974459754597645977459784597945980459814598245983459844598545986459874598845989459904599145992459934599445995459964599745998459994600046001460024600346004460054600646007460084600946010460114601246013460144601546016460174601846019460204602146022460234602446025460264602746028460294603046031460324603346034460354603646037460384603946040460414604246043460444604546046460474604846049460504605146052460534605446055460564605746058460594606046061460624606346064460654606646067460684606946070460714607246073460744607546076460774607846079460804608146082460834608446085460864608746088460894609046091460924609346094460954609646097460984609946100461014610246103461044610546106461074610846109461104611146112461134611446115461164611746118461194612046121461224612346124461254612646127461284612946130461314613246133461344613546136461374613846139461404614146142461434614446145461464614746148461494615046151461524615346154461554615646157461584615946160461614616246163461644616546166461674616846169461704617146172461734617446175461764617746178461794618046181461824618346184461854618646187461884618946190461914619246193461944619546196461974619846199462004620146202462034620446205462064620746208462094621046211462124621346214462154621646217462184621946220462214622246223462244622546226462274622846229462304623146232462334623446235462364623746238462394624046241462424624346244462454624646247462484624946250462514625246253462544625546256462574625846259462604626146262462634626446265462664626746268462694627046271462724627346274462754627646277462784627946280462814628246283462844628546286462874628846289462904629146292462934629446295462964629746298462994630046301463024630346304463054630646307463084630946310463114631246313463144631546316463174631846319463204632146322463234632446325463264632746328463294633046331463324633346334463354633646337463384633946340463414634246343463444634546346463474634846349463504635146352463534635446355463564635746358463594636046361463624636346364463654636646367463684636946370463714637246373463744637546376463774637846379463804638146382463834638446385463864638746388463894639046391463924639346394463954639646397463984639946400464014640246403464044640546406464074640846409464104641146412464134641446415464164641746418464194642046421464224642346424464254642646427464284642946430464314643246433464344643546436464374643846439464404644146442464434644446445464464644746448464494645046451464524645346454464554645646457464584645946460464614646246463464644646546466464674646846469464704647146472464734647446475464764647746478464794648046481464824648346484464854648646487464884648946490464914649246493464944649546496464974649846499465004650146502465034650446505465064650746508465094651046511465124651346514465154651646517465184651946520465214652246523465244652546526465274652846529465304653146532465334653446535465364653746538465394654046541465424654346544465454654646547465484654946550465514655246553465544655546556465574655846559465604656146562465634656446565465664656746568465694657046571465724657346574465754657646577465784657946580465814658246583465844658546586465874658846589465904659146592465934659446595465964659746598465994660046601466024660346604466054660646607466084660946610466114661246613466144661546616466174661846619466204662146622466234662446625466264662746628466294663046631466324663346634466354663646637466384663946640466414664246643466444664546646466474664846649466504665146652466534665446655466564665746658466594666046661466624666346664466654666646667466684666946670466714667246673466744667546676466774667846679466804668146682466834668446685466864668746688466894669046691466924669346694466954669646697466984669946700467014670246703467044670546706467074670846709467104671146712467134671446715467164671746718467194672046721467224672346724467254672646727467284672946730467314673246733467344673546736467374673846739467404674146742467434674446745467464674746748467494675046751467524675346754467554675646757467584675946760467614676246763467644676546766467674676846769467704677146772467734677446775467764677746778467794678046781467824678346784467854678646787467884678946790467914679246793467944679546796467974679846799468004680146802468034680446805468064680746808468094681046811468124681346814468154681646817468184681946820468214682246823468244682546826468274682846829468304683146832468334683446835468364683746838468394684046841468424684346844468454684646847468484684946850468514685246853468544685546856468574685846859468604686146862468634686446865468664686746868468694687046871468724687346874468754687646877468784687946880468814688246883468844688546886468874688846889468904689146892468934689446895468964689746898468994690046901469024690346904469054690646907469084690946910469114691246913469144691546916469174691846919469204692146922469234692446925469264692746928469294693046931469324693346934469354693646937469384693946940469414694246943469444694546946469474694846949469504695146952469534695446955469564695746958469594696046961469624696346964469654696646967469684696946970469714697246973469744697546976469774697846979469804698146982469834698446985469864698746988469894699046991469924699346994469954699646997469984699947000470014700247003470044700547006470074700847009470104701147012470134701447015470164701747018470194702047021470224702347024470254702647027470284702947030470314703247033470344703547036470374703847039470404704147042470434704447045470464704747048470494705047051470524705347054470554705647057470584705947060470614706247063470644706547066470674706847069470704707147072470734707447075470764707747078470794708047081470824708347084470854708647087470884708947090470914709247093470944709547096470974709847099471004710147102471034710447105471064710747108471094711047111471124711347114471154711647117471184711947120471214712247123471244712547126471274712847129471304713147132471334713447135471364713747138471394714047141471424714347144471454714647147471484714947150471514715247153471544715547156471574715847159471604716147162471634716447165471664716747168471694717047171471724717347174471754717647177471784717947180471814718247183471844718547186471874718847189471904719147192471934719447195471964719747198471994720047201472024720347204472054720647207472084720947210472114721247213472144721547216472174721847219472204722147222472234722447225472264722747228472294723047231472324723347234472354723647237472384723947240472414724247243472444724547246472474724847249472504725147252472534725447255472564725747258472594726047261472624726347264472654726647267472684726947270472714727247273472744727547276472774727847279472804728147282472834728447285472864728747288472894729047291472924729347294472954729647297472984729947300473014730247303473044730547306473074730847309473104731147312473134731447315473164731747318473194732047321473224732347324473254732647327473284732947330473314733247333473344733547336473374733847339473404734147342473434734447345473464734747348473494735047351473524735347354473554735647357473584735947360473614736247363473644736547366473674736847369473704737147372473734737447375473764737747378473794738047381473824738347384473854738647387473884738947390473914739247393473944739547396473974739847399474004740147402474034740447405474064740747408474094741047411474124741347414474154741647417474184741947420474214742247423474244742547426474274742847429474304743147432474334743447435474364743747438474394744047441474424744347444474454744647447474484744947450474514745247453474544745547456474574745847459474604746147462474634746447465474664746747468474694747047471474724747347474474754747647477474784747947480474814748247483474844748547486474874748847489474904749147492474934749447495474964749747498474994750047501475024750347504475054750647507475084750947510475114751247513475144751547516475174751847519475204752147522475234752447525475264752747528475294753047531475324753347534475354753647537475384753947540475414754247543475444754547546475474754847549475504755147552475534755447555475564755747558475594756047561475624756347564475654756647567475684756947570475714757247573475744757547576475774757847579475804758147582475834758447585475864758747588475894759047591475924759347594475954759647597475984759947600476014760247603476044760547606476074760847609476104761147612476134761447615476164761747618476194762047621476224762347624476254762647627476284762947630476314763247633476344763547636476374763847639476404764147642476434764447645476464764747648476494765047651476524765347654476554765647657476584765947660476614766247663476644766547666476674766847669476704767147672476734767447675476764767747678476794768047681476824768347684476854768647687476884768947690476914769247693476944769547696476974769847699477004770147702477034770447705477064770747708477094771047711477124771347714477154771647717477184771947720477214772247723477244772547726477274772847729477304773147732477334773447735477364773747738477394774047741477424774347744477454774647747477484774947750477514775247753477544775547756477574775847759477604776147762477634776447765477664776747768477694777047771477724777347774477754777647777477784777947780477814778247783477844778547786477874778847789477904779147792477934779447795477964779747798477994780047801478024780347804478054780647807478084780947810478114781247813478144781547816478174781847819478204782147822478234782447825478264782747828478294783047831478324783347834478354783647837478384783947840478414784247843478444784547846478474784847849478504785147852478534785447855478564785747858478594786047861478624786347864478654786647867478684786947870478714787247873478744787547876478774787847879478804788147882478834788447885478864788747888478894789047891478924789347894478954789647897478984789947900479014790247903479044790547906479074790847909479104791147912479134791447915479164791747918479194792047921479224792347924479254792647927479284792947930479314793247933479344793547936479374793847939479404794147942479434794447945479464794747948479494795047951479524795347954479554795647957479584795947960479614796247963479644796547966479674796847969479704797147972479734797447975479764797747978479794798047981479824798347984479854798647987479884798947990479914799247993479944799547996479974799847999480004800148002480034800448005480064800748008480094801048011480124801348014480154801648017480184801948020480214802248023480244802548026480274802848029480304803148032480334803448035480364803748038480394804048041480424804348044480454804648047480484804948050480514805248053480544805548056480574805848059480604806148062480634806448065480664806748068480694807048071480724807348074480754807648077480784807948080480814808248083480844808548086480874808848089480904809148092480934809448095480964809748098480994810048101481024810348104481054810648107481084810948110481114811248113481144811548116481174811848119481204812148122481234812448125481264812748128481294813048131481324813348134481354813648137481384813948140481414814248143481444814548146481474814848149481504815148152481534815448155481564815748158481594816048161481624816348164481654816648167481684816948170481714817248173481744817548176481774817848179481804818148182481834818448185481864818748188481894819048191481924819348194481954819648197481984819948200482014820248203482044820548206482074820848209482104821148212482134821448215482164821748218482194822048221482224822348224482254822648227482284822948230482314823248233482344823548236482374823848239482404824148242482434824448245482464824748248482494825048251482524825348254482554825648257482584825948260482614826248263482644826548266482674826848269482704827148272482734827448275482764827748278482794828048281482824828348284482854828648287482884828948290482914829248293482944829548296482974829848299483004830148302483034830448305483064830748308483094831048311483124831348314483154831648317483184831948320483214832248323483244832548326483274832848329483304833148332483334833448335483364833748338483394834048341483424834348344483454834648347483484834948350483514835248353483544835548356483574835848359483604836148362483634836448365483664836748368483694837048371483724837348374483754837648377483784837948380483814838248383483844838548386483874838848389483904839148392483934839448395483964839748398483994840048401484024840348404484054840648407484084840948410484114841248413484144841548416484174841848419484204842148422484234842448425484264842748428484294843048431484324843348434484354843648437484384843948440484414844248443484444844548446484474844848449484504845148452484534845448455484564845748458484594846048461484624846348464484654846648467484684846948470484714847248473484744847548476484774847848479484804848148482484834848448485484864848748488484894849048491484924849348494484954849648497484984849948500485014850248503485044850548506485074850848509485104851148512485134851448515485164851748518485194852048521485224852348524485254852648527485284852948530485314853248533485344853548536485374853848539485404854148542485434854448545485464854748548485494855048551485524855348554485554855648557485584855948560485614856248563485644856548566485674856848569485704857148572485734857448575485764857748578485794858048581485824858348584485854858648587485884858948590485914859248593485944859548596485974859848599486004860148602486034860448605486064860748608486094861048611486124861348614486154861648617486184861948620486214862248623486244862548626486274862848629486304863148632486334863448635486364863748638486394864048641486424864348644486454864648647486484864948650486514865248653486544865548656486574865848659486604866148662486634866448665486664866748668486694867048671486724867348674486754867648677486784867948680486814868248683486844868548686486874868848689486904869148692486934869448695486964869748698486994870048701487024870348704487054870648707487084870948710487114871248713487144871548716487174871848719487204872148722487234872448725487264872748728487294873048731487324873348734487354873648737487384873948740487414874248743487444874548746487474874848749487504875148752487534875448755487564875748758487594876048761487624876348764487654876648767487684876948770487714877248773487744877548776487774877848779487804878148782487834878448785487864878748788487894879048791487924879348794487954879648797487984879948800488014880248803488044880548806488074880848809488104881148812488134881448815488164881748818488194882048821488224882348824488254882648827488284882948830488314883248833488344883548836488374883848839488404884148842488434884448845488464884748848488494885048851488524885348854488554885648857488584885948860488614886248863488644886548866488674886848869488704887148872488734887448875488764887748878488794888048881488824888348884488854888648887488884888948890488914889248893488944889548896488974889848899489004890148902489034890448905489064890748908489094891048911489124891348914489154891648917489184891948920489214892248923489244892548926489274892848929489304893148932489334893448935489364893748938489394894048941489424894348944489454894648947489484894948950489514895248953489544895548956489574895848959489604896148962489634896448965489664896748968489694897048971489724897348974489754897648977489784897948980489814898248983489844898548986489874898848989489904899148992489934899448995489964899748998489994900049001490024900349004490054900649007490084900949010490114901249013490144901549016490174901849019490204902149022490234902449025490264902749028490294903049031490324903349034490354903649037490384903949040490414904249043490444904549046490474904849049490504905149052490534905449055490564905749058490594906049061490624906349064490654906649067490684906949070490714907249073490744907549076490774907849079490804908149082490834908449085490864908749088490894909049091490924909349094490954909649097490984909949100491014910249103491044910549106491074910849109491104911149112491134911449115491164911749118491194912049121491224912349124491254912649127491284912949130491314913249133491344913549136491374913849139491404914149142491434914449145491464914749148491494915049151491524915349154491554915649157491584915949160491614916249163491644916549166491674916849169491704917149172491734917449175491764917749178491794918049181491824918349184491854918649187491884918949190491914919249193491944919549196491974919849199492004920149202492034920449205492064920749208492094921049211492124921349214492154921649217492184921949220492214922249223492244922549226492274922849229492304923149232492334923449235492364923749238492394924049241492424924349244492454924649247492484924949250492514925249253492544925549256492574925849259492604926149262492634926449265492664926749268492694927049271492724927349274492754927649277492784927949280492814928249283492844928549286492874928849289492904929149292492934929449295492964929749298492994930049301493024930349304493054930649307493084930949310493114931249313493144931549316493174931849319493204932149322493234932449325493264932749328493294933049331493324933349334493354933649337493384933949340493414934249343493444934549346493474934849349493504935149352493534935449355493564935749358493594936049361493624936349364493654936649367493684936949370493714937249373493744937549376493774937849379493804938149382493834938449385493864938749388493894939049391493924939349394493954939649397493984939949400494014940249403494044940549406494074940849409494104941149412494134941449415494164941749418494194942049421494224942349424494254942649427494284942949430494314943249433494344943549436494374943849439494404944149442494434944449445494464944749448494494945049451494524945349454494554945649457494584945949460494614946249463494644946549466494674946849469494704947149472494734947449475494764947749478494794948049481494824948349484494854948649487494884948949490494914949249493494944949549496494974949849499495004950149502495034950449505495064950749508495094951049511495124951349514495154951649517495184951949520495214952249523495244952549526495274952849529495304953149532495334953449535495364953749538495394954049541495424954349544495454954649547495484954949550495514955249553495544955549556495574955849559495604956149562495634956449565495664956749568495694957049571495724957349574495754957649577495784957949580495814958249583495844958549586495874958849589495904959149592495934959449595495964959749598495994960049601496024960349604496054960649607496084960949610496114961249613496144961549616496174961849619496204962149622496234962449625496264962749628496294963049631496324963349634496354963649637496384963949640496414964249643496444964549646496474964849649496504965149652496534965449655496564965749658496594966049661496624966349664496654966649667496684966949670496714967249673496744967549676496774967849679496804968149682496834968449685496864968749688496894969049691496924969349694496954969649697496984969949700497014970249703497044970549706497074970849709497104971149712497134971449715497164971749718497194972049721497224972349724497254972649727497284972949730497314973249733497344973549736497374973849739497404974149742497434974449745497464974749748497494975049751497524975349754497554975649757497584975949760497614976249763497644976549766497674976849769497704977149772497734977449775497764977749778497794978049781497824978349784497854978649787497884978949790497914979249793497944979549796497974979849799498004980149802498034980449805498064980749808498094981049811498124981349814498154981649817498184981949820498214982249823498244982549826498274982849829498304983149832498334983449835498364983749838498394984049841498424984349844498454984649847498484984949850498514985249853498544985549856498574985849859498604986149862498634986449865498664986749868498694987049871498724987349874498754987649877498784987949880498814988249883498844988549886498874988849889498904989149892498934989449895498964989749898498994990049901499024990349904499054990649907499084990949910499114991249913499144991549916499174991849919499204992149922499234992449925499264992749928499294993049931499324993349934499354993649937499384993949940499414994249943499444994549946499474994849949499504995149952499534995449955499564995749958499594996049961499624996349964499654996649967499684996949970499714997249973499744997549976499774997849979499804998149982499834998449985499864998749988499894999049991499924999349994499954999649997499984999950000500015000250003500045000550006500075000850009500105001150012500135001450015500165001750018500195002050021500225002350024500255002650027500285002950030500315003250033500345003550036500375003850039500405004150042500435004450045500465004750048500495005050051500525005350054500555005650057500585005950060500615006250063500645006550066500675006850069500705007150072500735007450075500765007750078500795008050081500825008350084500855008650087500885008950090500915009250093500945009550096500975009850099501005010150102501035010450105501065010750108501095011050111501125011350114501155011650117501185011950120501215012250123501245012550126501275012850129501305013150132501335013450135501365013750138501395014050141501425014350144501455014650147501485014950150501515015250153501545015550156501575015850159501605016150162501635016450165501665016750168501695017050171501725017350174501755017650177501785017950180501815018250183501845018550186501875018850189501905019150192501935019450195501965019750198501995020050201502025020350204502055020650207502085020950210502115021250213502145021550216502175021850219502205022150222502235022450225502265022750228502295023050231502325023350234502355023650237502385023950240502415024250243502445024550246502475024850249502505025150252502535025450255502565025750258502595026050261502625026350264502655026650267502685026950270502715027250273502745027550276502775027850279502805028150282502835028450285502865028750288502895029050291502925029350294502955029650297502985029950300503015030250303503045030550306503075030850309503105031150312503135031450315503165031750318503195032050321503225032350324503255032650327503285032950330503315033250333503345033550336503375033850339503405034150342503435034450345503465034750348503495035050351503525035350354503555035650357503585035950360503615036250363503645036550366503675036850369503705037150372503735037450375503765037750378503795038050381503825038350384503855038650387503885038950390503915039250393503945039550396503975039850399504005040150402504035040450405504065040750408504095041050411504125041350414504155041650417504185041950420504215042250423504245042550426504275042850429504305043150432504335043450435504365043750438504395044050441504425044350444504455044650447504485044950450504515045250453504545045550456504575045850459504605046150462504635046450465504665046750468504695047050471504725047350474504755047650477504785047950480504815048250483504845048550486504875048850489504905049150492504935049450495504965049750498504995050050501505025050350504505055050650507505085050950510505115051250513505145051550516505175051850519505205052150522505235052450525505265052750528505295053050531505325053350534505355053650537505385053950540505415054250543505445054550546505475054850549505505055150552505535055450555505565055750558505595056050561505625056350564505655056650567505685056950570505715057250573505745057550576505775057850579505805058150582505835058450585505865058750588505895059050591505925059350594505955059650597505985059950600506015060250603506045060550606506075060850609506105061150612506135061450615506165061750618506195062050621506225062350624506255062650627506285062950630506315063250633506345063550636506375063850639506405064150642506435064450645506465064750648506495065050651506525065350654506555065650657506585065950660506615066250663506645066550666506675066850669506705067150672506735067450675506765067750678506795068050681506825068350684506855068650687506885068950690506915069250693506945069550696506975069850699507005070150702507035070450705507065070750708507095071050711507125071350714507155071650717507185071950720507215072250723507245072550726507275072850729507305073150732507335073450735507365073750738507395074050741507425074350744507455074650747507485074950750507515075250753507545075550756507575075850759507605076150762507635076450765507665076750768507695077050771507725077350774507755077650777507785077950780507815078250783507845078550786507875078850789507905079150792507935079450795507965079750798507995080050801508025080350804508055080650807508085080950810508115081250813508145081550816508175081850819508205082150822508235082450825508265082750828508295083050831508325083350834508355083650837508385083950840508415084250843508445084550846508475084850849508505085150852508535085450855508565085750858508595086050861508625086350864508655086650867508685086950870508715087250873508745087550876508775087850879508805088150882508835088450885508865088750888508895089050891508925089350894508955089650897508985089950900509015090250903509045090550906509075090850909509105091150912509135091450915509165091750918509195092050921509225092350924509255092650927509285092950930509315093250933509345093550936509375093850939509405094150942509435094450945509465094750948509495095050951509525095350954509555095650957509585095950960509615096250963509645096550966509675096850969509705097150972509735097450975509765097750978509795098050981509825098350984509855098650987509885098950990509915099250993509945099550996509975099850999510005100151002510035100451005510065100751008510095101051011510125101351014510155101651017510185101951020510215102251023510245102551026510275102851029510305103151032510335103451035510365103751038510395104051041510425104351044510455104651047510485104951050510515105251053510545105551056510575105851059510605106151062510635106451065510665106751068510695107051071510725107351074510755107651077510785107951080510815108251083510845108551086510875108851089510905109151092510935109451095510965109751098510995110051101511025110351104511055110651107511085110951110511115111251113511145111551116511175111851119511205112151122511235112451125511265112751128511295113051131511325113351134511355113651137511385113951140511415114251143511445114551146511475114851149511505115151152511535115451155511565115751158511595116051161511625116351164511655116651167511685116951170511715117251173511745117551176511775117851179511805118151182511835118451185511865118751188511895119051191511925119351194511955119651197511985119951200512015120251203512045120551206512075120851209512105121151212512135121451215512165121751218512195122051221512225122351224512255122651227512285122951230512315123251233512345123551236512375123851239512405124151242512435124451245512465124751248512495125051251512525125351254512555125651257512585125951260512615126251263512645126551266512675126851269512705127151272512735127451275512765127751278512795128051281512825128351284512855128651287512885128951290512915129251293512945129551296512975129851299513005130151302513035130451305513065130751308513095131051311513125131351314513155131651317513185131951320513215132251323513245132551326513275132851329513305133151332513335133451335513365133751338513395134051341513425134351344513455134651347513485134951350513515135251353513545135551356513575135851359513605136151362513635136451365513665136751368513695137051371513725137351374513755137651377513785137951380513815138251383513845138551386513875138851389513905139151392513935139451395513965139751398513995140051401514025140351404514055140651407514085140951410514115141251413514145141551416514175141851419514205142151422514235142451425514265142751428514295143051431514325143351434514355143651437514385143951440514415144251443514445144551446514475144851449514505145151452514535145451455514565145751458514595146051461514625146351464514655146651467514685146951470514715147251473514745147551476514775147851479514805148151482514835148451485514865148751488514895149051491514925149351494514955149651497514985149951500515015150251503515045150551506515075150851509515105151151512515135151451515515165151751518515195152051521515225152351524515255152651527515285152951530515315153251533515345153551536515375153851539515405154151542515435154451545515465154751548515495155051551515525155351554515555155651557515585155951560515615156251563515645156551566515675156851569515705157151572515735157451575515765157751578515795158051581515825158351584515855158651587515885158951590515915159251593515945159551596515975159851599516005160151602516035160451605516065160751608516095161051611516125161351614516155161651617516185161951620516215162251623516245162551626516275162851629516305163151632516335163451635516365163751638516395164051641516425164351644516455164651647516485164951650516515165251653516545165551656516575165851659516605166151662516635166451665516665166751668516695167051671516725167351674516755167651677516785167951680516815168251683516845168551686516875168851689516905169151692516935169451695516965169751698516995170051701517025170351704517055170651707517085170951710517115171251713517145171551716517175171851719517205172151722517235172451725517265172751728517295173051731517325173351734517355173651737517385173951740517415174251743517445174551746517475174851749517505175151752517535175451755517565175751758517595176051761517625176351764517655176651767517685176951770517715177251773517745177551776517775177851779517805178151782517835178451785517865178751788517895179051791517925179351794517955179651797517985179951800518015180251803518045180551806518075180851809518105181151812518135181451815518165181751818518195182051821518225182351824518255182651827518285182951830518315183251833518345183551836518375183851839518405184151842518435184451845518465184751848518495185051851518525185351854518555185651857518585185951860518615186251863518645186551866518675186851869518705187151872518735187451875518765187751878518795188051881518825188351884518855188651887518885188951890518915189251893518945189551896518975189851899519005190151902519035190451905519065190751908519095191051911519125191351914519155191651917519185191951920519215192251923519245192551926519275192851929519305193151932519335193451935519365193751938519395194051941519425194351944519455194651947519485194951950519515195251953519545195551956519575195851959519605196151962519635196451965519665196751968519695197051971519725197351974519755197651977519785197951980519815198251983519845198551986519875198851989519905199151992519935199451995519965199751998519995200052001520025200352004520055200652007520085200952010520115201252013520145201552016520175201852019520205202152022520235202452025520265202752028520295203052031520325203352034520355203652037520385203952040520415204252043520445204552046520475204852049520505205152052520535205452055520565205752058520595206052061520625206352064520655206652067520685206952070520715207252073520745207552076520775207852079520805208152082520835208452085520865208752088520895209052091520925209352094520955209652097520985209952100521015210252103521045210552106521075210852109521105211152112521135211452115521165211752118521195212052121521225212352124521255212652127521285212952130521315213252133521345213552136521375213852139521405214152142521435214452145521465214752148521495215052151521525215352154521555215652157521585215952160521615216252163521645216552166521675216852169521705217152172521735217452175521765217752178521795218052181521825218352184521855218652187521885218952190521915219252193521945219552196521975219852199522005220152202522035220452205522065220752208522095221052211522125221352214522155221652217522185221952220522215222252223522245222552226522275222852229522305223152232522335223452235522365223752238522395224052241522425224352244522455224652247522485224952250522515225252253522545225552256522575225852259522605226152262522635226452265522665226752268522695227052271522725227352274522755227652277522785227952280522815228252283522845228552286522875228852289522905229152292522935229452295522965229752298522995230052301523025230352304523055230652307523085230952310523115231252313523145231552316523175231852319523205232152322523235232452325523265232752328523295233052331523325233352334523355233652337523385233952340523415234252343523445234552346523475234852349523505235152352523535235452355523565235752358523595236052361523625236352364523655236652367523685236952370523715237252373523745237552376523775237852379523805238152382523835238452385523865238752388523895239052391523925239352394523955239652397523985239952400524015240252403524045240552406524075240852409524105241152412524135241452415524165241752418524195242052421524225242352424524255242652427524285242952430524315243252433524345243552436524375243852439524405244152442524435244452445524465244752448524495245052451524525245352454524555245652457524585245952460524615246252463524645246552466524675246852469524705247152472524735247452475524765247752478524795248052481524825248352484524855248652487524885248952490524915249252493524945249552496524975249852499525005250152502525035250452505525065250752508525095251052511525125251352514525155251652517525185251952520525215252252523525245252552526525275252852529525305253152532525335253452535525365253752538525395254052541525425254352544525455254652547525485254952550525515255252553525545255552556525575255852559525605256152562525635256452565525665256752568525695257052571525725257352574525755257652577525785257952580525815258252583525845258552586525875258852589525905259152592525935259452595525965259752598525995260052601526025260352604526055260652607526085260952610526115261252613526145261552616526175261852619526205262152622526235262452625526265262752628526295263052631526325263352634526355263652637526385263952640526415264252643526445264552646526475264852649526505265152652526535265452655526565265752658526595266052661526625266352664526655266652667526685266952670526715267252673526745267552676526775267852679526805268152682526835268452685526865268752688526895269052691526925269352694526955269652697526985269952700527015270252703527045270552706527075270852709527105271152712527135271452715527165271752718527195272052721527225272352724527255272652727527285272952730527315273252733527345273552736527375273852739527405274152742527435274452745527465274752748527495275052751527525275352754527555275652757527585275952760527615276252763527645276552766527675276852769527705277152772527735277452775527765277752778527795278052781527825278352784527855278652787527885278952790527915279252793527945279552796527975279852799528005280152802528035280452805528065280752808528095281052811528125281352814528155281652817528185281952820528215282252823528245282552826528275282852829528305283152832528335283452835528365283752838528395284052841528425284352844528455284652847528485284952850528515285252853528545285552856528575285852859528605286152862528635286452865528665286752868528695287052871528725287352874528755287652877528785287952880528815288252883528845288552886528875288852889528905289152892528935289452895528965289752898528995290052901529025290352904529055290652907529085290952910529115291252913529145291552916529175291852919529205292152922529235292452925529265292752928529295293052931529325293352934529355293652937529385293952940529415294252943529445294552946529475294852949529505295152952529535295452955529565295752958529595296052961529625296352964529655296652967529685296952970529715297252973529745297552976529775297852979529805298152982529835298452985529865298752988529895299052991529925299352994529955299652997529985299953000530015300253003530045300553006530075300853009530105301153012530135301453015530165301753018530195302053021530225302353024530255302653027530285302953030530315303253033530345303553036530375303853039530405304153042530435304453045530465304753048530495305053051530525305353054530555305653057530585305953060530615306253063530645306553066530675306853069530705307153072530735307453075530765307753078530795308053081530825308353084530855308653087530885308953090530915309253093530945309553096530975309853099531005310153102531035310453105531065310753108531095311053111531125311353114531155311653117531185311953120531215312253123531245312553126531275312853129531305313153132531335313453135531365313753138531395314053141531425314353144531455314653147531485314953150531515315253153531545315553156531575315853159531605316153162531635316453165531665316753168531695317053171531725317353174531755317653177531785317953180531815318253183531845318553186531875318853189531905319153192531935319453195531965319753198531995320053201532025320353204532055320653207532085320953210532115321253213532145321553216532175321853219532205322153222532235322453225532265322753228532295323053231532325323353234532355323653237532385323953240532415324253243532445324553246532475324853249532505325153252532535325453255532565325753258532595326053261532625326353264532655326653267532685326953270532715327253273532745327553276532775327853279532805328153282532835328453285532865328753288532895329053291532925329353294532955329653297532985329953300533015330253303533045330553306533075330853309533105331153312533135331453315533165331753318533195332053321533225332353324533255332653327533285332953330533315333253333533345333553336533375333853339533405334153342533435334453345533465334753348533495335053351533525335353354533555335653357533585335953360533615336253363533645336553366533675336853369533705337153372533735337453375533765337753378533795338053381533825338353384533855338653387533885338953390533915339253393533945339553396533975339853399534005340153402534035340453405534065340753408534095341053411534125341353414534155341653417534185341953420534215342253423534245342553426534275342853429534305343153432534335343453435534365343753438534395344053441534425344353444534455344653447534485344953450534515345253453534545345553456534575345853459534605346153462534635346453465534665346753468534695347053471534725347353474534755347653477534785347953480534815348253483534845348553486534875348853489534905349153492534935349453495534965349753498534995350053501535025350353504535055350653507535085350953510535115351253513535145351553516535175351853519535205352153522535235352453525535265352753528535295353053531535325353353534535355353653537535385353953540535415354253543535445354553546535475354853549535505355153552535535355453555535565355753558535595356053561535625356353564535655356653567535685356953570535715357253573535745357553576535775357853579535805358153582535835358453585535865358753588535895359053591535925359353594535955359653597535985359953600536015360253603536045360553606536075360853609536105361153612536135361453615536165361753618536195362053621536225362353624536255362653627536285362953630536315363253633536345363553636536375363853639536405364153642536435364453645536465364753648536495365053651536525365353654536555365653657536585365953660536615366253663536645366553666536675366853669536705367153672536735367453675536765367753678536795368053681536825368353684536855368653687536885368953690536915369253693536945369553696536975369853699537005370153702537035370453705537065370753708537095371053711537125371353714537155371653717537185371953720537215372253723537245372553726537275372853729537305373153732537335373453735537365373753738537395374053741537425374353744537455374653747537485374953750537515375253753537545375553756537575375853759537605376153762537635376453765537665376753768537695377053771537725377353774537755377653777537785377953780537815378253783537845378553786537875378853789537905379153792537935379453795537965379753798537995380053801538025380353804538055380653807538085380953810538115381253813538145381553816538175381853819538205382153822538235382453825538265382753828538295383053831538325383353834538355383653837538385383953840538415384253843538445384553846538475384853849538505385153852538535385453855538565385753858538595386053861538625386353864538655386653867538685386953870538715387253873538745387553876538775387853879538805388153882538835388453885538865388753888538895389053891538925389353894538955389653897538985389953900539015390253903539045390553906539075390853909539105391153912539135391453915539165391753918539195392053921539225392353924539255392653927539285392953930539315393253933539345393553936539375393853939539405394153942539435394453945539465394753948539495395053951539525395353954539555395653957539585395953960539615396253963539645396553966539675396853969539705397153972539735397453975539765397753978539795398053981539825398353984539855398653987539885398953990539915399253993539945399553996539975399853999540005400154002540035400454005540065400754008540095401054011540125401354014540155401654017540185401954020540215402254023540245402554026540275402854029540305403154032540335403454035540365403754038540395404054041540425404354044540455404654047540485404954050540515405254053540545405554056540575405854059540605406154062540635406454065540665406754068540695407054071540725407354074540755407654077540785407954080540815408254083540845408554086540875408854089540905409154092540935409454095540965409754098540995410054101541025410354104541055410654107541085410954110541115411254113541145411554116541175411854119541205412154122541235412454125541265412754128541295413054131541325413354134541355413654137541385413954140541415414254143541445414554146541475414854149541505415154152541535415454155541565415754158541595416054161541625416354164541655416654167541685416954170541715417254173541745417554176541775417854179541805418154182541835418454185541865418754188541895419054191541925419354194541955419654197541985419954200542015420254203542045420554206542075420854209542105421154212542135421454215542165421754218542195422054221542225422354224542255422654227542285422954230542315423254233542345423554236542375423854239542405424154242542435424454245542465424754248542495425054251542525425354254542555425654257542585425954260542615426254263542645426554266542675426854269542705427154272542735427454275542765427754278542795428054281542825428354284542855428654287542885428954290542915429254293542945429554296542975429854299543005430154302543035430454305543065430754308543095431054311543125431354314543155431654317543185431954320543215432254323543245432554326543275432854329543305433154332543335433454335543365433754338543395434054341543425434354344543455434654347543485434954350543515435254353543545435554356543575435854359543605436154362543635436454365543665436754368543695437054371543725437354374543755437654377543785437954380543815438254383543845438554386543875438854389543905439154392543935439454395543965439754398543995440054401544025440354404544055440654407544085440954410544115441254413544145441554416544175441854419544205442154422544235442454425544265442754428544295443054431544325443354434544355443654437544385443954440544415444254443544445444554446544475444854449544505445154452544535445454455544565445754458544595446054461544625446354464544655446654467544685446954470544715447254473544745447554476544775447854479544805448154482544835448454485544865448754488544895449054491544925449354494544955449654497544985449954500545015450254503545045450554506545075450854509545105451154512545135451454515545165451754518545195452054521545225452354524545255452654527545285452954530545315453254533545345453554536545375453854539545405454154542545435454454545545465454754548545495455054551545525455354554545555455654557545585455954560545615456254563545645456554566545675456854569545705457154572545735457454575545765457754578545795458054581545825458354584545855458654587545885458954590545915459254593545945459554596545975459854599546005460154602546035460454605546065460754608546095461054611546125461354614546155461654617546185461954620546215462254623546245462554626546275462854629546305463154632546335463454635546365463754638546395464054641546425464354644546455464654647546485464954650546515465254653546545465554656546575465854659546605466154662546635466454665546665466754668546695467054671546725467354674546755467654677546785467954680546815468254683546845468554686546875468854689546905469154692546935469454695546965469754698546995470054701547025470354704547055470654707547085470954710547115471254713547145471554716547175471854719547205472154722547235472454725547265472754728547295473054731547325473354734547355473654737547385473954740547415474254743547445474554746547475474854749547505475154752547535475454755547565475754758547595476054761547625476354764547655476654767547685476954770547715477254773547745477554776547775477854779547805478154782547835478454785547865478754788547895479054791547925479354794547955479654797547985479954800548015480254803548045480554806548075480854809548105481154812548135481454815548165481754818548195482054821548225482354824548255482654827548285482954830548315483254833548345483554836548375483854839548405484154842548435484454845548465484754848548495485054851548525485354854548555485654857548585485954860548615486254863548645486554866548675486854869548705487154872548735487454875548765487754878548795488054881548825488354884548855488654887548885488954890548915489254893548945489554896548975489854899549005490154902549035490454905549065490754908549095491054911549125491354914549155491654917549185491954920549215492254923549245492554926549275492854929549305493154932549335493454935549365493754938549395494054941549425494354944549455494654947549485494954950549515495254953549545495554956549575495854959549605496154962549635496454965549665496754968549695497054971549725497354974549755497654977549785497954980549815498254983549845498554986549875498854989549905499154992549935499454995549965499754998549995500055001550025500355004550055500655007550085500955010550115501255013550145501555016550175501855019550205502155022550235502455025550265502755028550295503055031550325503355034550355503655037550385503955040550415504255043550445504555046550475504855049550505505155052550535505455055550565505755058550595506055061550625506355064550655506655067550685506955070550715507255073550745507555076550775507855079550805508155082550835508455085550865508755088550895509055091550925509355094550955509655097550985509955100551015510255103551045510555106551075510855109551105511155112551135511455115551165511755118551195512055121551225512355124551255512655127551285512955130551315513255133551345513555136551375513855139551405514155142551435514455145551465514755148551495515055151551525515355154551555515655157551585515955160551615516255163551645516555166551675516855169551705517155172551735517455175551765517755178551795518055181551825518355184551855518655187551885518955190551915519255193551945519555196551975519855199552005520155202552035520455205552065520755208552095521055211552125521355214552155521655217552185521955220552215522255223552245522555226552275522855229552305523155232552335523455235552365523755238552395524055241552425524355244552455524655247552485524955250552515525255253552545525555256552575525855259552605526155262552635526455265552665526755268552695527055271552725527355274552755527655277552785527955280552815528255283552845528555286552875528855289552905529155292552935529455295552965529755298552995530055301553025530355304553055530655307553085530955310553115531255313553145531555316553175531855319553205532155322553235532455325553265532755328553295533055331553325533355334553355533655337553385533955340553415534255343553445534555346553475534855349553505535155352553535535455355553565535755358553595536055361553625536355364553655536655367553685536955370553715537255373553745537555376553775537855379553805538155382553835538455385553865538755388553895539055391553925539355394553955539655397553985539955400554015540255403554045540555406554075540855409554105541155412554135541455415554165541755418554195542055421554225542355424554255542655427554285542955430554315543255433554345543555436554375543855439554405544155442554435544455445554465544755448554495545055451554525545355454554555545655457554585545955460554615546255463554645546555466554675546855469554705547155472554735547455475554765547755478554795548055481554825548355484554855548655487554885548955490554915549255493554945549555496554975549855499555005550155502555035550455505555065550755508555095551055511555125551355514555155551655517555185551955520555215552255523555245552555526555275552855529555305553155532555335553455535555365553755538555395554055541555425554355544555455554655547555485554955550555515555255553555545555555556555575555855559555605556155562555635556455565555665556755568555695557055571555725557355574555755557655577555785557955580555815558255583555845558555586555875558855589555905559155592555935559455595555965559755598555995560055601556025560355604556055560655607556085560955610556115561255613556145561555616556175561855619556205562155622556235562455625556265562755628556295563055631556325563355634556355563655637556385563955640556415564255643556445564555646556475564855649556505565155652556535565455655556565565755658556595566055661556625566355664556655566655667556685566955670556715567255673556745567555676556775567855679556805568155682556835568455685556865568755688556895569055691556925569355694556955569655697556985569955700557015570255703557045570555706557075570855709557105571155712557135571455715557165571755718557195572055721557225572355724557255572655727557285572955730557315573255733557345573555736557375573855739557405574155742557435574455745557465574755748557495575055751557525575355754557555575655757557585575955760557615576255763557645576555766557675576855769557705577155772557735577455775557765577755778557795578055781557825578355784557855578655787557885578955790557915579255793557945579555796557975579855799558005580155802558035580455805558065580755808558095581055811558125581355814558155581655817558185581955820558215582255823558245582555826558275582855829558305583155832558335583455835558365583755838558395584055841558425584355844558455584655847558485584955850558515585255853558545585555856558575585855859558605586155862558635586455865558665586755868558695587055871558725587355874558755587655877558785587955880558815588255883558845588555886558875588855889558905589155892558935589455895558965589755898558995590055901559025590355904559055590655907559085590955910559115591255913559145591555916559175591855919559205592155922559235592455925559265592755928559295593055931559325593355934559355593655937559385593955940559415594255943559445594555946559475594855949559505595155952559535595455955559565595755958559595596055961559625596355964559655596655967559685596955970559715597255973559745597555976559775597855979559805598155982559835598455985559865598755988559895599055991559925599355994559955599655997559985599956000560015600256003560045600556006560075600856009560105601156012560135601456015560165601756018560195602056021560225602356024560255602656027560285602956030560315603256033560345603556036560375603856039560405604156042560435604456045560465604756048560495605056051560525605356054560555605656057560585605956060560615606256063560645606556066560675606856069560705607156072560735607456075560765607756078560795608056081560825608356084560855608656087560885608956090560915609256093560945609556096560975609856099561005610156102561035610456105561065610756108561095611056111561125611356114561155611656117561185611956120561215612256123561245612556126561275612856129561305613156132561335613456135561365613756138561395614056141561425614356144561455614656147561485614956150561515615256153561545615556156561575615856159561605616156162561635616456165561665616756168561695617056171561725617356174561755617656177561785617956180561815618256183561845618556186561875618856189561905619156192561935619456195561965619756198561995620056201562025620356204562055620656207562085620956210562115621256213562145621556216562175621856219562205622156222562235622456225562265622756228562295623056231562325623356234562355623656237562385623956240562415624256243562445624556246562475624856249562505625156252562535625456255562565625756258562595626056261562625626356264562655626656267562685626956270562715627256273562745627556276562775627856279562805628156282562835628456285562865628756288562895629056291562925629356294562955629656297562985629956300563015630256303563045630556306563075630856309563105631156312563135631456315563165631756318563195632056321563225632356324563255632656327563285632956330563315633256333563345633556336563375633856339563405634156342563435634456345563465634756348563495635056351563525635356354563555635656357563585635956360563615636256363563645636556366563675636856369563705637156372563735637456375563765637756378563795638056381563825638356384563855638656387563885638956390563915639256393563945639556396563975639856399564005640156402564035640456405564065640756408564095641056411564125641356414564155641656417564185641956420564215642256423564245642556426564275642856429564305643156432564335643456435564365643756438564395644056441564425644356444564455644656447564485644956450564515645256453564545645556456564575645856459564605646156462564635646456465564665646756468564695647056471564725647356474564755647656477564785647956480564815648256483564845648556486564875648856489564905649156492564935649456495564965649756498564995650056501565025650356504565055650656507565085650956510565115651256513565145651556516565175651856519565205652156522565235652456525565265652756528565295653056531565325653356534565355653656537565385653956540565415654256543565445654556546565475654856549565505655156552565535655456555565565655756558565595656056561565625656356564565655656656567565685656956570565715657256573565745657556576565775657856579565805658156582565835658456585565865658756588565895659056591565925659356594565955659656597565985659956600566015660256603566045660556606566075660856609566105661156612566135661456615566165661756618566195662056621566225662356624566255662656627566285662956630566315663256633566345663556636566375663856639566405664156642566435664456645566465664756648566495665056651566525665356654566555665656657566585665956660566615666256663566645666556666566675666856669566705667156672566735667456675566765667756678566795668056681566825668356684566855668656687566885668956690566915669256693566945669556696566975669856699567005670156702567035670456705567065670756708567095671056711567125671356714567155671656717567185671956720567215672256723567245672556726567275672856729567305673156732567335673456735567365673756738567395674056741567425674356744567455674656747567485674956750567515675256753567545675556756567575675856759567605676156762567635676456765567665676756768567695677056771567725677356774567755677656777567785677956780567815678256783567845678556786567875678856789567905679156792567935679456795567965679756798567995680056801568025680356804568055680656807568085680956810568115681256813568145681556816568175681856819568205682156822568235682456825568265682756828568295683056831568325683356834568355683656837568385683956840568415684256843568445684556846568475684856849568505685156852568535685456855568565685756858568595686056861568625686356864568655686656867568685686956870568715687256873568745687556876568775687856879568805688156882568835688456885568865688756888568895689056891568925689356894568955689656897568985689956900569015690256903569045690556906569075690856909569105691156912569135691456915569165691756918569195692056921569225692356924569255692656927569285692956930569315693256933569345693556936569375693856939569405694156942569435694456945569465694756948569495695056951569525695356954569555695656957569585695956960569615696256963569645696556966569675696856969569705697156972569735697456975569765697756978569795698056981569825698356984569855698656987569885698956990569915699256993569945699556996569975699856999570005700157002570035700457005570065700757008570095701057011570125701357014570155701657017570185701957020570215702257023570245702557026570275702857029570305703157032570335703457035570365703757038570395704057041570425704357044570455704657047570485704957050570515705257053570545705557056570575705857059570605706157062570635706457065570665706757068570695707057071570725707357074570755707657077570785707957080570815708257083570845708557086570875708857089570905709157092570935709457095570965709757098570995710057101571025710357104571055710657107571085710957110571115711257113571145711557116571175711857119571205712157122571235712457125571265712757128571295713057131571325713357134571355713657137571385713957140571415714257143571445714557146571475714857149571505715157152571535715457155571565715757158571595716057161571625716357164571655716657167571685716957170571715717257173571745717557176571775717857179571805718157182571835718457185571865718757188571895719057191571925719357194571955719657197571985719957200572015720257203572045720557206572075720857209572105721157212572135721457215572165721757218572195722057221572225722357224572255722657227572285722957230572315723257233572345723557236572375723857239572405724157242572435724457245572465724757248572495725057251572525725357254572555725657257572585725957260572615726257263572645726557266572675726857269572705727157272572735727457275572765727757278572795728057281572825728357284572855728657287572885728957290572915729257293572945729557296572975729857299573005730157302573035730457305573065730757308573095731057311573125731357314573155731657317573185731957320573215732257323573245732557326573275732857329573305733157332573335733457335573365733757338573395734057341573425734357344573455734657347573485734957350573515735257353573545735557356573575735857359573605736157362573635736457365573665736757368573695737057371573725737357374573755737657377573785737957380573815738257383573845738557386573875738857389573905739157392573935739457395573965739757398573995740057401574025740357404574055740657407574085740957410574115741257413574145741557416574175741857419574205742157422574235742457425574265742757428574295743057431574325743357434574355743657437574385743957440574415744257443574445744557446574475744857449574505745157452574535745457455574565745757458574595746057461574625746357464574655746657467574685746957470574715747257473574745747557476574775747857479574805748157482574835748457485574865748757488574895749057491574925749357494574955749657497574985749957500575015750257503575045750557506575075750857509575105751157512575135751457515575165751757518575195752057521575225752357524575255752657527575285752957530575315753257533575345753557536575375753857539575405754157542575435754457545575465754757548575495755057551575525755357554575555755657557575585755957560575615756257563575645756557566575675756857569575705757157572575735757457575575765757757578575795758057581575825758357584575855758657587575885758957590575915759257593575945759557596575975759857599576005760157602576035760457605576065760757608576095761057611576125761357614576155761657617576185761957620576215762257623576245762557626576275762857629576305763157632576335763457635576365763757638576395764057641576425764357644576455764657647576485764957650576515765257653576545765557656576575765857659576605766157662576635766457665576665766757668576695767057671576725767357674576755767657677576785767957680576815768257683576845768557686576875768857689576905769157692576935769457695576965769757698576995770057701577025770357704577055770657707577085770957710577115771257713577145771557716577175771857719577205772157722577235772457725577265772757728577295773057731577325773357734577355773657737577385773957740577415774257743577445774557746577475774857749577505775157752577535775457755577565775757758577595776057761577625776357764577655776657767577685776957770577715777257773577745777557776577775777857779577805778157782577835778457785577865778757788577895779057791577925779357794577955779657797577985779957800578015780257803578045780557806578075780857809578105781157812578135781457815578165781757818578195782057821578225782357824578255782657827578285782957830578315783257833578345783557836578375783857839578405784157842578435784457845578465784757848578495785057851578525785357854578555785657857578585785957860578615786257863578645786557866578675786857869578705787157872578735787457875578765787757878578795788057881578825788357884578855788657887578885788957890578915789257893578945789557896578975789857899579005790157902579035790457905579065790757908579095791057911579125791357914579155791657917579185791957920579215792257923579245792557926579275792857929579305793157932579335793457935579365793757938579395794057941579425794357944579455794657947579485794957950579515795257953579545795557956579575795857959579605796157962579635796457965579665796757968579695797057971579725797357974579755797657977579785797957980579815798257983579845798557986579875798857989579905799157992579935799457995579965799757998579995800058001580025800358004580055800658007580085800958010580115801258013580145801558016580175801858019580205802158022580235802458025580265802758028580295803058031580325803358034580355803658037580385803958040580415804258043580445804558046580475804858049580505805158052580535805458055580565805758058580595806058061580625806358064580655806658067580685806958070580715807258073580745807558076580775807858079580805808158082580835808458085580865808758088580895809058091580925809358094580955809658097580985809958100581015810258103581045810558106581075810858109581105811158112581135811458115581165811758118581195812058121581225812358124581255812658127581285812958130581315813258133581345813558136581375813858139581405814158142581435814458145581465814758148581495815058151581525815358154581555815658157581585815958160581615816258163581645816558166581675816858169581705817158172581735817458175581765817758178581795818058181581825818358184581855818658187581885818958190581915819258193581945819558196581975819858199582005820158202582035820458205582065820758208582095821058211582125821358214582155821658217582185821958220582215822258223582245822558226582275822858229582305823158232582335823458235582365823758238582395824058241582425824358244582455824658247582485824958250582515825258253582545825558256582575825858259582605826158262582635826458265582665826758268582695827058271582725827358274582755827658277582785827958280582815828258283582845828558286582875828858289582905829158292582935829458295582965829758298582995830058301583025830358304583055830658307583085830958310583115831258313583145831558316583175831858319583205832158322583235832458325583265832758328583295833058331583325833358334583355833658337583385833958340583415834258343583445834558346583475834858349583505835158352583535835458355583565835758358583595836058361583625836358364583655836658367583685836958370583715837258373583745837558376583775837858379583805838158382583835838458385583865838758388583895839058391583925839358394583955839658397583985839958400584015840258403584045840558406584075840858409584105841158412584135841458415584165841758418584195842058421584225842358424584255842658427584285842958430584315843258433584345843558436584375843858439584405844158442584435844458445584465844758448584495845058451584525845358454584555845658457584585845958460584615846258463584645846558466584675846858469584705847158472584735847458475584765847758478584795848058481584825848358484584855848658487584885848958490584915849258493584945849558496584975849858499585005850158502585035850458505585065850758508585095851058511585125851358514585155851658517585185851958520585215852258523585245852558526585275852858529585305853158532585335853458535585365853758538585395854058541585425854358544585455854658547585485854958550585515855258553585545855558556585575855858559585605856158562585635856458565585665856758568585695857058571585725857358574585755857658577585785857958580585815858258583585845858558586585875858858589585905859158592585935859458595585965859758598585995860058601586025860358604586055860658607586085860958610586115861258613586145861558616586175861858619586205862158622586235862458625586265862758628586295863058631586325863358634586355863658637586385863958640586415864258643586445864558646586475864858649586505865158652586535865458655586565865758658586595866058661586625866358664586655866658667586685866958670586715867258673586745867558676586775867858679586805868158682586835868458685586865868758688586895869058691586925869358694586955869658697586985869958700587015870258703587045870558706587075870858709587105871158712587135871458715587165871758718587195872058721587225872358724587255872658727587285872958730587315873258733587345873558736587375873858739587405874158742587435874458745587465874758748587495875058751587525875358754587555875658757587585875958760587615876258763587645876558766587675876858769587705877158772587735877458775587765877758778587795878058781587825878358784587855878658787587885878958790587915879258793587945879558796587975879858799588005880158802588035880458805588065880758808588095881058811588125881358814588155881658817588185881958820588215882258823588245882558826588275882858829588305883158832588335883458835588365883758838588395884058841588425884358844588455884658847588485884958850588515885258853588545885558856588575885858859588605886158862588635886458865588665886758868588695887058871588725887358874588755887658877588785887958880588815888258883588845888558886588875888858889588905889158892588935889458895588965889758898588995890058901589025890358904589055890658907589085890958910589115891258913589145891558916589175891858919589205892158922589235892458925589265892758928589295893058931589325893358934589355893658937589385893958940589415894258943589445894558946589475894858949589505895158952589535895458955589565895758958589595896058961589625896358964589655896658967589685896958970589715897258973589745897558976589775897858979589805898158982589835898458985589865898758988589895899058991589925899358994589955899658997589985899959000590015900259003590045900559006590075900859009590105901159012590135901459015590165901759018590195902059021590225902359024590255902659027590285902959030590315903259033590345903559036590375903859039590405904159042590435904459045590465904759048590495905059051590525905359054590555905659057590585905959060590615906259063590645906559066590675906859069590705907159072590735907459075590765907759078590795908059081590825908359084590855908659087590885908959090590915909259093590945909559096590975909859099591005910159102591035910459105591065910759108591095911059111591125911359114591155911659117591185911959120591215912259123591245912559126591275912859129591305913159132591335913459135591365913759138591395914059141591425914359144591455914659147591485914959150591515915259153591545915559156591575915859159591605916159162591635916459165591665916759168591695917059171591725917359174591755917659177591785917959180
  1. /* 许钟文修改的 标记 xzw
  2. 另外 所有"matter"字样已被我删除 原因:删除matterport信息
  3. */
  4. window.common = null;
  5. window.MathLight = null;
  6. window.math = null
  7. window.easing = null
  8. window.lerp = null
  9. window.transitions = null
  10. window.browser = null
  11. window.momentTourBlackNewType = 0//true
  12. g_playAudio = null
  13. // 全屏热点退出按钮
  14. exit = null
  15. g_tourAudio = new Audio
  16. g_tourAudio.loop = !1
  17. g_tourAudio.crossOrigin = "anonymous"
  18. g_tourAudio.addEventListener("ended", function() {
  19. var e = document.createEvent("MouseEvent");
  20. e.initEvent("tourAudioEnded", !0, !0),
  21. window.dispatchEvent(e)
  22. })
  23. g_tourAudio.oncanplaythrough = function() {
  24. g_tourAudio.play();
  25. g_playAudio = g_tourAudio;
  26. }
  27. var musicList = {
  28. "0102cp":'3458d3c7ca764ecaa13c88aaa8e0a1a8, 1107bf848a6146059249cc109c6d1472, 8c0e5bcc4a69470aa5f189edde162973, 2d00ef76d93f4a578b356c593da889b0, 61afb8aaf45046be865b1b30d0357754, 0a73cf23993d4f4cbb48337708f8c7b7, 9a32f7d9b29f427182b453b1a8009efc'.split(','),
  29. "04CP":'48930ada7d02438a846f6f6cf5a8693f, d3e00453736549e392ca91e9bd31ee72, b99ae9d8d19144f7866d49ed863a4b84, 14f349b0dd3d4646b2bd98c2ebfeb643'.split(','),
  30. "03cp":'d9b104d7df9244fca5ad5af4d5fca8f7, 2860b361da9246949ab6f57cbb8ce82d, 491d8cce5dfa441db5a52eb248bf4a63'.split(','),
  31. "19CP":'73a354895dc74c30beeb02a8d8bfe328, 256aedca55d6417fb696156279424d42, 10210bebd78b4d33ad05e0bef22cf0a3'.split(','),
  32. "2021cp":'10793e907fa7493c83f73fdcfd7df706, 2e2da10199634b5188c5469c0f52f9f6, 449196f2aa014f9db6a6cda675df7b70'.split(','),
  33. "22cp":'cf2d9fa92e8443aabbcc1a01736a052e, 08967bbdacec4ecf8ff44b219408ac9a, 8d20c6dd62c04564a172430705ba0295, a8a7d94bb9b84e8cb45556bbd548961d'.split(','),
  34. "23cp":'90197f7926e2466498135ef053147aaa, 6138d5511fe546e396a51408dfc9f6c5'.split(','),
  35. "0506CP":'6cee9744a41942f384ca0a9130f65ae8, a1f9e4436ea24f99a360ac327979e555, 8d216c8512264564bcde41c544fdfc69, f8769828fe9f4dda8449cd5d9506eeb4, 12142ab7fbb74122ba0df52eaa5a5363, fb3b381371d04864ab99dfd30a08fe89, 0921140bde3f428180b2d6b603775f51'.split(','),
  36. "07cp":'8902a763387040b2ad15a6325508cfca, 5adf5343a38340de998a0210cc97c00f'.split(','),
  37. "08CP":'f9e6d48c697f455f9b294523a5222624, 4f912bc6dc2848ce924064d025635b81, 518612bb1c884d9bb7aff8d431904f8d'.split(','),
  38. "09cp":'cb5887f7f3da43bf9ce383fbe4bae99b, d236fb56ac954bb29b3a6d0bdbe85588'.split(','),
  39. "10cp":'dca81dee239e4f7e9d8b69c3af629f00, 69ef058f04474e3fbfd4cd22bb440934, 42fe939bbf7c42058f9c32356a08f319'.split(','),
  40. "11cp":'fd62c35e2572460b88fb934e56888a2d, 4836763c382a45dcba1210f616e9e3be'.split(','),
  41. "1213CP":'06fcab3ccc204198ba04bc226d6a049a, c72fe82506234db6bd75919ac0e61ec5, 884d594255f54a88b36f078ec2842669, 921eaf2a769c4f069e9588b0fa99f170, 02abef88316e482b9d4c4f3cb2a34c64'.split(','),
  42. "15cp":'6e4c35329ba1470c8ebdf2ad3f1e92cd'.split(','),
  43. "14cp":'0b168caa5f1848e1b614e97b3cc22923, a05cc1124331484c9d852f4918a3248d'.split(','),
  44. "16cp":'506d2f805551425d938f488746730060, 21fbd2534bc840ebac3a5fac50e54cf5'.split(','),
  45. "17cp":'d756e9288311440599eab62bde2e017e'.split(','),
  46. "18cp":'11bb3c4c831a4151b8c7086f39086878'.split(','),
  47. }
  48. var playMusic = function(pano){//根据漫游点切换bgm
  49. //var describe = player.director.describe();
  50. if(!g_tourAudio.paused || g_currentHot )return;
  51. var shouldplayMusic
  52. for(let i in musicList){
  53. if(musicList[i].find(e=>e.includes(pano.id))){
  54. shouldplayMusic = i;
  55. break
  56. }
  57. }
  58. if(shouldplayMusic){
  59. if(!g_bgAudio.src.includes(shouldplayMusic)){
  60. g_bgAudio.src = "music/"+shouldplayMusic+'.mp3'
  61. }
  62. manage.switchBgmState(true)
  63. }else{
  64. g_bgAudio.src = ''
  65. }
  66. }
  67. var dealMap = (map)=>{//使不resize when image is not power of two
  68. map.wrapS = map.wrapT = THREE.ClampToEdgeWrapping;
  69. map.minFilter = THREE.LinearFilter;
  70. map.magFilter = THREE.LinearFilter;
  71. map.generateMipmaps = true;
  72. }
  73. var dom = {//许钟文add
  74. getOffset: function(type, element, parent) {
  75. left = (type == "left") ? element.offsetLeft : element.offsetTop;
  76. if (!parent) parent = $("body")[0];
  77. while (element = element.offsetParent) {
  78. if (element == parent) break;
  79. left += (type == "left") ? element.offsetLeft : element.offsetTop;
  80. }
  81. return left;
  82. }
  83. };
  84. var getTransformSid = function(){
  85. var name
  86. if(player.mode == 'panorama'){
  87. name = player.currentPano ? player.currentPano.id : 'outside'
  88. }else{
  89. name = 'outside'
  90. }
  91. return name
  92. }
  93. var convertTool = {
  94. getPos2d : function(point, camera, dom){//获取一个三维坐标对应屏幕中的二维坐标
  95. var camera = camera || player.camera;
  96. var dom = dom || player.domElement;
  97. 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);
  98. var x,y;
  99. x = (pos.x + 1) / 2 * dom.clientWidth;
  100. y = (1 - (pos.y + 1) / 2) * dom.clientHeight;
  101. var inSight = x <= dom.clientWidth && x >= 0 //是否在屏幕中
  102. && y <= dom.clientHeight && y >= 0
  103. return {
  104. pos: new THREE.Vector2(x,y), // 屏幕像素坐标
  105. vector: pos, //(范围 -1 ~ 1)
  106. trueSide : pos.z<1, //trueSide为false时,即使在屏幕范围内可见,也是反方向的另一个不可以被渲染的点 参见Tag.update
  107. inSight : inSight //在屏幕范围内可见
  108. };
  109. },
  110. ifShelter: function(pos3d){//检测某点在视线中是否被mesh遮挡
  111. var ori = player.position
  112. var dir = pos3d.clone().sub(ori).normalize()
  113. var ray = new THREE.Raycaster(ori, dir) //由外向里 因为模型从内侧是可见的所以从外侧
  114. /* if(config.isEdit && publicObjectSet.editor.mainDesign.editing){
  115. var o = ray.intersectObjects(publicObjectSet.editor.mainDesign.wallMeshes);
  116. }else{ */
  117. var o = ray.intersectObjects(player.model.colliders);
  118. //}
  119. var len = pos3d.distanceTo(ori);
  120. if (o && o.length) {
  121. for(var i=0;i<o.length;i++){
  122. if(o[i].distance < len){ return true; }//有遮挡
  123. }
  124. }
  125. },
  126. /*
  127. 拖拽时,获取鼠标在拖拽面上的位置(需要借助另一个intersectPlane面来计算,即和相机方向一样的面,可保证铺满屏幕)
  128. 但是不一定能获取到,比如鼠标射线不朝向拖拽面时,即使获取也会是一个意外的反方向的交点。
  129. */
  130. getPosAtPlane : function(pos, info/* , mouse, camera */){ //pos:与intersectPlane的交点 见笔记
  131. var A = pos;
  132. var player = player;
  133. var mouse = player.mouse;
  134. var O = new THREE.Vector3(mouse.x, mouse.y, -1).unproject(player.camera);
  135. if(info.y != void 0){//地面线的
  136. var y = info.y;
  137. if(player.mode == "floorplan"/* || Math.abs(O.x-pos.x)<0.0001 && Math.abs(O.z-pos.z)<0.0001) */){
  138. //intersectPlane和地面平行,无交点
  139. var x = pos.x, z = pos.z;
  140. }else{
  141. if(y<player.camera.position.y && O.y <= A.y /* || y>player.camera.position.y && O.y >= A.y */)return null; //鼠标射线向上。因为相机一定位于地面以上(地面不会抬高到相机上吧?),所以无交点。
  142. if(O.y == A.y){console.log('一样??');return;}
  143. if(A.y == y){console.log('一样2??');return;}
  144. var r = (O.y-y)/(A.y-y);
  145. var x = (r*A.x-O.x)/(r-1);
  146. var z = (r*A.z-O.z)/(r-1);
  147. }
  148. }else{//垂直的也有越过消失点以后反向变化的情况,但使用时影响不大
  149. var N = info.normalVec;
  150. var P = info.pullPos;
  151. if(N.y != 0 ){console.log('N.y != 0');return;} //仅仅支持垂直于地面的的墙壁,目前都是
  152. if(O.z==A.z){console.log('O.z==A.z?');return;}
  153. if(N.z!=0 && N.x != 0){//直接用这个通用的也可以,支持斜线的墙
  154. //console.log('N.z==0 && N.x == 0?');
  155. var c = ( N.x*(A.x-O.x) + N.y*(A.y-O.y) + N.z*(A.z-O.z));
  156. if(c == 0){console.log("分母为0?? return;");return;}
  157. var t = -((N.x*O.x + N.y*O.y + N.z*O.z) - (P.x*N.x + P.y*N.y + P.z*N.z) ) / c
  158. var x = t * (A.x - O.x) + O.x;
  159. var y = t * (A.y - O.y) + O.y;
  160. var z = t * (A.z - O.z) + O.z;
  161. /*原理: 已知空间直线L:(x-a)/m=(x-b)/n=(z-c)/p和空间平面π:Ax+By+Cz+D=0;
  162. 求直线L与平面π的交点的坐标。
  163. 把直线方程改写成参数形式:设(x-a)/m=(x-b)/n=(z-c)/p=t;
  164. 则x=mt+a;y=nt+b;z=pt+c;代入平面π的方程得:
  165. A(mt+a)+B(nt+b)+C(pt+c)+D=0
  166. 由此解得t=-(Aa+Bb+Cc+D)/(Am+Bn+Cp)
  167. 再代入参数方程即得交点的坐标(x,y,z). */
  168. }else if(N.x ==0 ){ //z与pullPos相等
  169. var z = P.z;
  170. if(O.y == A.y){console.log('一样??');return;}
  171. if(A.y == y){console.log('一样2??');return;}
  172. if(A.z == z){console.log('一样3??');return;}
  173. var r = (O.z-z)/(A.z-z);
  174. var x = (r*A.x-O.x)/(r-1);
  175. var y = (r*A.y-O.y)/(r-1);
  176. }else if(N.z == 0){//x与pullPos相等
  177. var x = P.x;
  178. if(O.y == A.y){console.log('一样??');return;}
  179. if(A.y == y){console.log('一样2??');return;}
  180. if(A.x == x){console.log('一样3??');return;}
  181. var r = (O.x-x)/(A.x-x);
  182. var y = (r*A.y-O.y)/(r-1);
  183. var z = (r*A.z-O.z)/(r-1);
  184. }
  185. }
  186. return new THREE.Vector3(x,y,z);
  187. },
  188. getMouseIntersect : function(camera, meshes, mouse){//获取鼠标和meshes交点
  189. var raycaster = new THREE.Raycaster;
  190. camera.updateMatrixWorld();
  191. var origin = new THREE.Vector3(mouse.x,mouse.y,-1).unproject(camera)
  192. , end = new THREE.Vector3(mouse.x,mouse.y,1).unproject(camera);
  193. var dir = end.sub(origin).normalize()
  194. raycaster.set(origin, dir);
  195. var n = raycaster.intersectObjects(meshes);
  196. if (0 === n.length)
  197. return null;
  198. return n[0];
  199. },
  200. ifIntersectChunks : function(A,B,options={}){//获取某个线段/射线和meshes的交点
  201. var dir = B.clone().sub(A).normalize();
  202. var len = options.InfinityLen ? Infinity : A.distanceTo(B) + (options.extLen||0);
  203. var ray = new THREE.Raycaster(A.clone(), dir, 0, len);
  204. var o = ray.intersectObjects(options.model || player.model.colliders);
  205. if (o && o.length)return o;
  206. if(options.throughWidth){ //允许最小宽度,防止穿过极小的缝隙导致撞墙感
  207. var normal = math.getNormal({points:[{x:A.x, y:A.z},{x:B.x, y:B.z}]});//线段法线
  208. normal.multiplyScalar(options.throughWidth)
  209. var normalVec3 = new THREE.Vector3(normal.x, 0, normal.y);
  210. var A2 = A.clone().add(normalVec3)
  211. ray.set(A2, dir);
  212. var o2 = ray.intersectObjects(options.model || player.model.colliders);
  213. ray.set(A.clone().add(normalVec3.negate()), dir);
  214. if (o2 && o2.length)return o2;
  215. var o3 = ray.intersectObjects(options.model || player.model.colliders);
  216. if (o3 && o3.length)return o3;
  217. }
  218. return null;
  219. },
  220. getPosAtSphere : function(pos3d, toPanoPos){
  221. var dir = pos3d.clone().sub(toPanoPos);
  222. dir.normalize();//然后计算在球中
  223. dir.multiplyScalar(Constants.skyRadius);
  224. dir.add(toPanoPos);
  225. return dir;
  226. }
  227. }
  228. var videoPosInfo = {
  229. /* "3458d3c7ca764ecaa13c88aaa8e0a1a8" : [-0.10965598660414333, -0.26776671083073333, 0.2265850992680396],
  230. "1107bf848a6146059249cc109c6d1472":[-0.10965598660414333, -0.26776671083073333, 0.2265850992680396],
  231. "8c0e5bcc4a69470aa5f189edde162973":[-0.10965598660414333, -0.26776671083073333, 0.2265850992680396],//多出的左前
  232. "10444ea5b3ed4629915c3f449b790c58":[0.03080183370988987, -0.26776671083073333, 0.2865850992680396],
  233. "9a32f7d9b29f427182b453b1a8009efc":[0.03080183370988987, -0.26776671083073333, 0.2265850992680396],
  234. "988a92b36f544326896b101b54a69290":[-0.034905996796551514, -0.26776671083073333, 0.3680810776239348],
  235. "a812006399af4c73b6b19941485597a2":[-0.06490599679655151, -0.26776671083073333, 0.3380810776239347],
  236. "9438aaa08cc94456a432ee3a7fa3378f":[-0.06490599679655151, -0.26776671083073333, 0.3380810776239347],
  237. "491d8cce5dfa441db5a52eb248bf4a63": [-0.3375152936642509, -0.26776671083073333, 0.27173181146902703],
  238. */
  239. "3458d3c7ca764ecaa13c88aaa8e0a1a8": [0.15, -0.3, 0.37]
  240. , "1107bf848a6146059249cc109c6d1472" :[0.15, -0.3,0.23]
  241. ,"8c0e5bcc4a69470aa5f189edde162973":[0.08, -0.3,0.25]
  242. ,"9a32f7d9b29f427182b453b1a8009efc" :[ 0.13, -0.3, 0.26]
  243. ,"491d8cce5dfa441db5a52eb248bf4a63":[0.05,-0.3, 0.27 ]
  244. ,"0a73cf23993d4f4cbb48337708f8c7b7":[0.09,-0.3, 0.25 ]
  245. ,"61afb8aaf45046be865b1b30d0357754":[0.290,-0.3,0.38]
  246. ,"58ea5816c49b4c759c26b262f403eab1":[0.034,-0.3,0.38]
  247. ,"6c455875e3834d53b43a2beaba11aa4d":[-0.04,-0.3,0.39]
  248. ,"2d00ef76d93f4a578b356c593da889b0":[0.35,-0.3,0.38]
  249. }
  250. var videoOffset
  251. var videoScale
  252. var loadedVideo = false
  253. var videoMat;
  254. //add 将其中一个曲面材质改成视频
  255. var loadVideo = ()=>{
  256. videoOffset = new THREE.Vector3(0.2638254165649414, -0.039959073066711426, 0.17957305908203125)
  257. videoScale = new THREE.Vector3(1.0199999809265137, 1.0199999809265137, 1.0199999809265137)
  258. //videoScale = new THREE.Vector3(1.02,1.02,1.02)
  259. var video = $('<video controls="controls" loop autoplay x5-playsinline="" webkit-playsinline="true" playsinline="true" controlslist="nodownload"></video>')[0]
  260. video.setAttribute("crossOrigin", 'Anonymous')//要在src设置好前解决跨域
  261. $(video).on('contextmenu', function () { return false; });//禁止右键点击出
  262. video.src = manage.dealURL("images/video/濠江战旗别样红_x264.mp4");
  263. videoMat = new THREE.MeshBasicMaterial({
  264. map : new THREE.VideoTexture( video )
  265. })
  266. videoMat.map.wrapS = videoMat.map.wrapT = THREE.ClampToEdgeWrapping;
  267. videoMat.map.minFilter = THREE.LinearFilter;
  268. videoMat.map.magFilter = THREE.LinearFilter;
  269. videoMat.map.generateMipmaps = true;
  270. video.volume = 0
  271. video.muted = true
  272. window.videoPlane = player.model.chunks[1];
  273. player.model.chunks.splice(1,1)
  274. window.videoShow = video
  275. playVideo()
  276. window.videoPlane.name = 'videoPlane'
  277. video.addEventListener('loadeddata', ()=>{
  278. console.log( "video loaded!!!")
  279. loadedVideo = true
  280. })
  281. var btn = addSoundBtn(video)
  282. window.videoPlane.add(btn)
  283. video.btn = btn; btn.video = video
  284. btn.position.set(-11.6,1.02,-8.5);
  285. btn.rotation.y = -0.4
  286. }
  287. var playVideo = (()=>{
  288. var shouldPlay = true //只和用户点击有关,不点击时都是true
  289. return (state)=>{
  290. if(state != void 0) shouldPlay = state
  291. if(shouldPlay){
  292. window.videoShow && window.videoShow.play()
  293. }else{
  294. window.videoShow && window.videoShow.pause()
  295. }
  296. loadedVideo && changeVideoMat()
  297. }
  298. })()
  299. var changeVideoMat = function(){
  300. window.videoPlane.material = videoMat;
  301. }
  302. var updateVideo = (o)=>{//因为漫游中点位不准,所以在不同点更新视频位置
  303. if(!window.videoShow)return;
  304. if(o.type != "flyDone"){
  305. clearInterval(window.transformVideoTimer)
  306. }
  307. if(o.type == "beforeFlyOut"){
  308. window.videoPlane.visible = true;
  309. playVideo()
  310. changeVideoPos(new THREE.Vector3, o.dur/3)
  311. videoPlane.scale.set(1,1,1)
  312. }else{
  313. if( o.type == "beforeFlyIn"){
  314. videoPlane.scale.copy(videoScale)
  315. }
  316. if( o.type == "flyDone"){
  317. if(videoPosInfo[o.pano.id]){
  318. window.videoPlane.visible = true;
  319. playVideo()
  320. }else{
  321. window.videoPlane.visible = false
  322. window.videoShow.pause()
  323. }
  324. }else{
  325. if(videoPosInfo[o.pano.id]){
  326. window.videoPlane.visible = true;
  327. playVideo()
  328. var end = new THREE.Vector3().fromArray(videoPosInfo[o.pano.id])//.add(videoOffset)
  329. changeVideoPos(end, o.dur)
  330. }else{
  331. }
  332. }
  333. }
  334. }
  335. var easeInOutQuad = function(e, t, i, n) {
  336. return e /= n / 2,
  337. e < 1 ? i / 2 * e * e + t : (e--,
  338. -i / 2 * (e * (e - 2) - 1) + t)
  339. }
  340. var linearTween = function(e, t, i, n) {
  341. return i * e / n + t
  342. }
  343. var changeVideoPos = function(end, dur){//开始渐变位置
  344. var start = window.videoPlane.position.clone();
  345. var startTime = new Date().getTime();
  346. window.transformVideoTimer = setInterval(()=>{
  347. var progress = (new Date().getTime() - startTime) / dur;
  348. progress = Math.min(progress, 1);
  349. progress = linearTween(progress,0,1,1)
  350. if(progress >= 1)clearInterval(window.transformVideoTimer)
  351. window.videoPlane.position.copy(new THREE.Vector3().lerpVectors(start, end, progress))
  352. },20)
  353. }
  354. var getScale = function(){
  355. var s = 1.02;
  356. var center = videoPlane.geometry.boundingBox.center()
  357. var matrix1 = new THREE.Matrix4().setPosition(center.clone().negate());
  358. var scaleM = new THREE.Matrix4().makeScale(s,s,s);
  359. var matrix2 = new THREE.Matrix4().setPosition(center.clone());
  360. var scaleMatrix = new THREE.Matrix4().multiplyMatrices(scaleM, matrix1)
  361. scaleMatrix = new THREE.Matrix4().multiplyMatrices(matrix2, scaleMatrix)
  362. var quaterion = new THREE.Quaternion;
  363. var scale = new THREE.Vector3
  364. var position = new THREE.Vector3
  365. scaleMatrix.decompose(position, quaterion, scale)
  366. console.log(scale.toArray())
  367. console.log(position.toArray())
  368. }
  369. var btnMat;
  370. var btnGeo
  371. var soundOnMat, soundOffMat;
  372. var addSoundBtn = function(video){
  373. if(!soundOffMat){
  374. var videoMusicOffMap = Texture.load("images/videoMusicOff.png")
  375. var videoMusicOnMap = Texture.load("images/videoMusicOn.png")
  376. soundOffMat = new THREE.MeshBasicMaterial({
  377. map : videoMusicOffMap ,
  378. transparent:true,
  379. })
  380. soundOnMat = new THREE.MeshBasicMaterial({
  381. map : videoMusicOnMap ,
  382. transparent:true,
  383. })
  384. btnGeo = new THREE.PlaneGeometry(0.17, 0.17,1,1);
  385. }
  386. var btn = new THREE.Mesh(btnGeo, soundOffMat);
  387. btn.name = 'soundBtn'
  388. btn.video = video;
  389. video.btn = btn;
  390. return btn
  391. }
  392. var SoundOnVideo;
  393. var switchSoundBtn = function(video, belong){
  394. if(video.btn.material == soundOffMat){ //开启
  395. if(SoundOnVideo){
  396. SoundOnVideo.btn.material = soundOffMat,
  397. SoundOnVideo.volume = 0,
  398. SoundOnVideo.muted = true
  399. }else{
  400. if(g_bgAudio && !g_bgAudio.paused){
  401. manage.switchBgmState(false);
  402. g_bgAudio.pauseByVideo = true
  403. }
  404. }
  405. video.btn.material = soundOnMat
  406. video.volume = 1
  407. //从头开始放:
  408. video.currentTime = 0
  409. video.muted = false;
  410. if(g_tourAudio)g_tourAudio.pause()
  411. SoundOnVideo = video
  412. video.pauseByHot = video.pauseByTour = false
  413. if(belong instanceof Overlay){
  414. belong.switchPlay(true)
  415. }else{
  416. video.play()
  417. }
  418. }else{//关闭
  419. video.btn.material = soundOffMat
  420. video.volume = 0
  421. video.muted = true
  422. SoundOnVideo = null
  423. if(g_bgAudio && g_bgAudio.pauseByVideo && !video.pauseByHot && !video.pauseByTour){
  424. manage.switchBgmState(true)
  425. }
  426. }
  427. }
  428. var checkSoundBtnClick = function(intersect){
  429. if(intersect && intersect.object.name == "soundBtn"){
  430. switchSoundBtn(intersect.object.video, intersect.object.parent);
  431. return true
  432. }
  433. }
  434. !function() {
  435. "use strict";
  436. function t(t, i) {
  437. return typeof t === i
  438. }
  439. function i(t, i) {
  440. return t instanceof i
  441. }
  442. function n(t) {
  443. return t && t.nodeType
  444. }
  445. function e(t) {
  446. return n(t) ? t : i(t, g) ? t[0] : void 0
  447. }
  448. function o(t, i, n) {
  449. return g.each(t, function(t, e) {
  450. n = i.call(e, n, t, e)
  451. }),
  452. n
  453. }
  454. function r(t, i, n) {
  455. var e, o, r;
  456. if (t === i)
  457. return !0;
  458. if (!t || !i || t.constructor !== i.constructor)
  459. return !1;
  460. for (e = 0,
  461. o = n.length; o > e; e += 1) {
  462. if (r = n[e],
  463. t[r] && y(t[r].equals) && !t[r].equals(i[r]))
  464. return !1;
  465. if (t[r] !== i[r])
  466. return !1
  467. }
  468. return !0
  469. }
  470. function s(t, i, n, e) {
  471. this.left = E(t),
  472. this.top = E(i),
  473. this.width = E(n),
  474. this.height = E(e),
  475. this.right = this.left + this.width,
  476. this.bottom = this.top + this.height
  477. }
  478. function h(t, i, n, e) {
  479. this.visible = t || 0,
  480. this.viewport = i || 0,
  481. this.possible = n || 0,
  482. this.rects = e && T({}, e) || null
  483. }
  484. function l(t, i) {
  485. this.els = t,
  486. this.viewport = i
  487. }
  488. function c(t, i, n) {
  489. var e;
  490. return g.inArray(n, q) >= 0 ? e = s.ofElement(t) : g.inArray(n, S) >= 0 && (e = h.of(t, i)),
  491. e ? e[n] : 0
  492. }
  493. function u(t, i) {
  494. return t.val - i.val
  495. }
  496. function a(t, i) {
  497. return i.val - t.val
  498. }
  499. function f(t) {
  500. var i = s.ofContent(t, !0)
  501. , n = s.ofViewport(t, !0)
  502. , e = i.width - n.width
  503. , o = i.height - n.height;
  504. this.content = i,
  505. this.viewport = n,
  506. this.width = 0 >= e ? null : n.left / e,
  507. this.height = 0 >= o ? null : n.top / o,
  508. this.left = n.left,
  509. this.top = n.top,
  510. this.right = i.right - n.right,
  511. this.bottom = i.bottom - n.bottom
  512. }
  513. function p(t) {
  514. this.el = t || window
  515. }
  516. function d(t, i) {
  517. this.context = t,
  518. this.viewport = i,
  519. this.init()
  520. }
  521. function v(t, i, n, e) {
  522. this.context = new l(t,i),
  523. this.property = n,
  524. this.descending = e,
  525. this.init()
  526. }
  527. function w(t) {
  528. t && t !== window && t !== document ? (this.context = t,
  529. this.$autoTarget = g(t)) : this.context = window,
  530. this.init()
  531. }
  532. var g = jQuery
  533. , m = g(window)
  534. , b = g(document)
  535. , T = g.extend
  536. , y = g.isFunction
  537. , k = Math.max
  538. , V = Math.min
  539. , E = Math.round
  540. , x = function() {
  541. var t = {}
  542. , i = 1;
  543. return function(n) {
  544. return n ? (t[n] || (t[n] = i,
  545. i += 1),
  546. t[n]) : 0
  547. }
  548. }();
  549. T(s.prototype, {
  550. equals: function(t) {
  551. return r(this, t, ["left", "top", "width", "height"])
  552. },
  553. area: function() {
  554. return this.width * this.height
  555. },
  556. relativeTo: function(t) {
  557. return new s(this.left - t.left,this.top - t.top,this.width,this.height)
  558. },
  559. intersection: function(t) {
  560. if (!i(t, s))
  561. return null;
  562. var n = k(this.left, t.left)
  563. , e = V(this.right, t.right)
  564. , o = k(this.top, t.top)
  565. , r = V(this.bottom, t.bottom)
  566. , h = e - n
  567. , l = r - o;
  568. return h >= 0 && l >= 0 ? new s(n,o,h,l) : null
  569. },
  570. envelope: function(t) {
  571. if (!i(t, s))
  572. return this;
  573. var n = V(this.left, t.left)
  574. , e = k(this.right, t.right)
  575. , o = V(this.top, t.top)
  576. , r = k(this.bottom, t.bottom)
  577. , h = e - n
  578. , l = r - o;
  579. return new s(n,o,h,l)
  580. }
  581. }),
  582. T(s, {
  583. ofContent: function(t, i) {
  584. 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())
  585. },
  586. ofViewport: function(t, i) {
  587. 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())
  588. },
  589. ofElement: function(t) {
  590. var i = g(t);
  591. if (!i.is(":visible"))
  592. return null;
  593. var n = i.offset();
  594. return new s(n.left,n.top,i.outerWidth(),i.outerHeight())
  595. }
  596. }),
  597. T(h.prototype, {
  598. equals: function(t) {
  599. return this.fracsEqual(t) && this.rectsEqual(t)
  600. },
  601. fracsEqual: function(t) {
  602. return r(this, t, ["visible", "viewport", "possible"])
  603. },
  604. rectsEqual: function(t) {
  605. return r(this.rects, t.rects, ["document", "element", "viewport"])
  606. }
  607. }),
  608. T(h, {
  609. of: function(t, i) {
  610. var e, o, r;
  611. return t = n(t) && s.ofElement(t) || t,
  612. i = n(i) && s.ofViewport(i) || i || s.ofViewport(),
  613. t instanceof s && (e = t.intersection(i)) ? (o = e.area(),
  614. r = V(t.width, i.width) * V(t.height, i.height),
  615. new h(o / t.area(),o / i.area(),o / r,{
  616. document: e,
  617. element: e.relativeTo(t),
  618. viewport: e.relativeTo(i)
  619. })) : new h
  620. }
  621. });
  622. var q = ["width", "height", "left", "right", "top", "bottom"]
  623. , S = ["possible", "visible", "viewport"];
  624. T(l.prototype, {
  625. sorted: function(t, i) {
  626. var n = this.viewport;
  627. return g.map(this.els, function(i) {
  628. return {
  629. el: i,
  630. val: c(i, n, t)
  631. }
  632. }).sort(i ? a : u)
  633. },
  634. best: function(t, i) {
  635. return this.els.length ? this.sorted(t, i)[0] : null
  636. }
  637. }),
  638. T(f.prototype, {
  639. equals: function(t) {
  640. return r(this, t, ["width", "height", "left", "top", "right", "bottom", "content", "viewport"])
  641. }
  642. }),
  643. T(p.prototype, {
  644. equals: function(t) {
  645. return r(this, t, ["el"])
  646. },
  647. scrollState: function() {
  648. return new f(this.el)
  649. },
  650. scrollTo: function(t, i, n) {
  651. var e = g(this.el === window ? "html,body" : this.el);
  652. t = t || 0,
  653. i = i || 0,
  654. n = isNaN(n) ? 1e3 : n,
  655. e.stop(!0).animate({
  656. scrollLeft: t,
  657. scrollTop: i
  658. }, n)
  659. },
  660. scroll: function(t, i, n) {
  661. var e = this.el === window ? m : g(this.el);
  662. t = t || 0,
  663. i = i || 0,
  664. this.scrollTo(e.scrollLeft() + t, e.scrollTop() + i, n)
  665. },
  666. scrollToRect: function(t, i, n, e) {
  667. i = i || 0,
  668. n = n || 0,
  669. this.scrollTo(t.left - i, t.top - n, e)
  670. },
  671. scrollToElement: function(t, i, n, e) {
  672. var o = s.ofElement(t).relativeTo(s.ofContent(this.el));
  673. this.scrollToRect(o, i, n, e)
  674. }
  675. });
  676. var C = {
  677. init: function() {
  678. this.callbacks = g.Callbacks("memory unique"),
  679. this.currVal = null,
  680. this.prevVal = null,
  681. this.checkProxy = g.proxy(this.check, this),
  682. this.autoCheck()
  683. },
  684. bind: function(t) {
  685. this.callbacks.add(t)
  686. },
  687. unbind: function(t) {
  688. t ? this.callbacks.remove(t) : this.callbacks.empty()
  689. },
  690. trigger: function() {
  691. this.callbacks.fireWith(this.context, [this.currVal, this.prevVal])
  692. },
  693. check: function(t) {
  694. var i = this.updatedValue(t);
  695. return void 0 !== i && (this.prevVal = this.currVal,
  696. this.currVal = i,
  697. this.trigger(),
  698. !0)
  699. },
  700. $autoTarget: m,
  701. autoEvents: "load resize scroll",
  702. autoCheck: function(t) {
  703. this.$autoTarget[t === !1 ? "off" : "on"](this.autoEvents, this.checkProxy)
  704. }
  705. };
  706. T(d.prototype, C, {
  707. updatedValue: function() {
  708. var t = h.of(this.context, this.viewport);
  709. return this.currVal && this.currVal.equals(t) ? void 0 : t
  710. }
  711. }),
  712. T(v.prototype, C, {
  713. updatedValue: function() {
  714. var t = this.context.best(this.property, this.descending);
  715. return t && (t = t.val > 0 ? t.el : null,
  716. this.currVal !== t) ? t : void 0
  717. }
  718. }),
  719. T(w.prototype, C, {
  720. updatedValue: function() {
  721. var t = new f(this.context);
  722. return this.currVal && this.currVal.equals(t) ? void 0 : t
  723. }
  724. });
  725. var L = function(t, i) {
  726. var n = [].slice
  727. , e = jQuery
  728. , o = e.extend
  729. , r = e.isFunction
  730. , s = o({}, i)
  731. , h = function(i, n, o, s) {
  732. return o = r(o) ? o.apply(i, n) : o,
  733. r(s[o]) ? s[o].apply(i, n) : void e.error('Method "' + o + '" does not exist on jQuery.' + t)
  734. }
  735. , l = function() {
  736. return h(this, n.call(arguments), s.defaultStatic, l)
  737. }
  738. , c = function(t) {
  739. return r(c[t]) ? c[t].apply(this, n.call(arguments, 1)) : h(this, n.call(arguments), s.defaultMethod, c)
  740. }
  741. , u = function(t) {
  742. t && (o(l, t.statics),
  743. o(c, t.methods)),
  744. l.modplug = u
  745. };
  746. u.prev = {
  747. statics: e[t],
  748. methods: e.fn[t]
  749. },
  750. u(i),
  751. e[t] = l,
  752. e.fn[t] = c
  753. }
  754. , M = "fracs";
  755. L(M, {
  756. statics: {
  757. version: "0.15.0",
  758. Rect: s,
  759. Fractions: h,
  760. Group: l,
  761. ScrollState: f,
  762. Viewport: p,
  763. FracsCallbacks: d,
  764. GroupCallbacks: v,
  765. ScrollStateCallbacks: w,
  766. fracs: function(t, i) {
  767. return h.of(t, i)
  768. }
  769. },
  770. methods: {
  771. content: function(t) {
  772. return this.length ? s.ofContent(this[0], t) : null
  773. },
  774. envelope: function() {
  775. return o(this, function(t) {
  776. var i = s.ofElement(this);
  777. return t ? t.envelope(i) : i
  778. })
  779. },
  780. fracs: function(i, n, o) {
  781. t(i, "string") || (o = n,
  782. n = i,
  783. i = null),
  784. y(n) || (o = n,
  785. n = null),
  786. o = e(o);
  787. var r = M + ".fracs." + x(o);
  788. return "unbind" === i ? this.each(function() {
  789. var t = g(this).data(r);
  790. t && t.unbind(n)
  791. }) : "check" === i ? this.each(function() {
  792. var t = g(this).data(r);
  793. t && t.check()
  794. }) : y(n) ? this.each(function() {
  795. var t = g(this)
  796. , i = t.data(r);
  797. i || (i = new d(this,o),
  798. t.data(r, i)),
  799. i.bind(n)
  800. }) : this.length ? h.of(this[0], o) : null
  801. },
  802. intersection: function() {
  803. return o(this, function(t) {
  804. var i = s.ofElement(this);
  805. return t ? t.intersection(i) : i
  806. })
  807. },
  808. max: function(t, i, n) {
  809. return y(i) || (n = i,
  810. i = null),
  811. n = e(n),
  812. i ? (new v(this,n,t,!0).bind(i),
  813. this) : this.pushStack(new l(this,n).best(t, !0).el)
  814. },
  815. min: function(t, i, n) {
  816. return y(i) || (n = i,
  817. i = null),
  818. n = e(n),
  819. i ? (new v(this,n,t).bind(i),
  820. this) : this.pushStack(new l(this,n).best(t).el)
  821. },
  822. rect: function() {
  823. return this.length ? s.ofElement(this[0]) : null
  824. },
  825. scrollState: function(i, n) {
  826. var e = M + ".scrollState";
  827. return t(i, "string") || (n = i,
  828. i = null),
  829. "unbind" === i ? this.each(function() {
  830. var t = g(this).data(e);
  831. t && t.unbind(n)
  832. }) : "check" === i ? this.each(function() {
  833. var t = g(this).data(e);
  834. t && t.check()
  835. }) : y(n) ? this.each(function() {
  836. var t = g(this)
  837. , i = t.data(e);
  838. i || (i = new w(this),
  839. t.data(e, i)),
  840. i.bind(n)
  841. }) : this.length ? new f(this[0]) : null
  842. },
  843. scroll: function(t, i, n) {
  844. return this.each(function() {
  845. new p(this).scroll(t, i, n)
  846. })
  847. },
  848. scrollTo: function(t, i, n, o) {
  849. return g.isNumeric(t) && (o = n,
  850. n = i,
  851. i = t,
  852. t = null),
  853. t = e(t),
  854. this.each(function() {
  855. t ? new p(this).scrollToElement(t, i, n, o) : new p(this).scrollTo(i, n, o)
  856. })
  857. },
  858. scrollToThis: function(t, i, n, o) {
  859. return o = new p(e(o)),
  860. o.scrollToElement(this[0], t, i, n),
  861. this
  862. },
  863. softLink: function(t, i, n, o) {
  864. return o = new p(e(o)),
  865. this.filter("a[href^=#]").each(function() {
  866. var e = g(this);
  867. e.on("click", function() {
  868. o.scrollToElement(g(e.attr("href"))[0], t, i, n)
  869. })
  870. })
  871. },
  872. sort: function(i, n, o) {
  873. return t(n, "boolean") || (o = n,
  874. n = null),
  875. o = e(o),
  876. this.pushStack(g.map(new l(this,o).sorted(i, !n), function(t) {
  877. return t.el
  878. }))
  879. },
  880. viewport: function(t) {
  881. return this.length ? s.ofViewport(this[0], t) : null
  882. }
  883. },
  884. defaultStatic: "fracs",
  885. defaultMethod: "fracs"
  886. })
  887. }();
  888. if ("undefined" == typeof jQuery)
  889. throw new Error("Bootstrap's JavaScript requires jQuery");
  890. +function(t) {
  891. "use strict";
  892. function e(e) {
  893. return this.each(function() {
  894. var o = t(this)
  895. , s = o.data("bs.tooltip")
  896. , n = "object" == typeof e && e;
  897. (s || "destroy" != e) && (s || o.data("bs.tooltip", s = new i(this,n)),
  898. "string" == typeof e && s[e]())
  899. })
  900. }
  901. var i = function(t, e) {
  902. this.type = this.options = this.enabled = this.timeout = this.hoverState = this.$element = null,
  903. this.init("tooltip", t, e)
  904. };
  905. i.VERSION = "3.2.0",
  906. i.DEFAULTS = {
  907. animation: !0,
  908. placement: "top",
  909. selector: !1,
  910. template: '<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',
  911. trigger: "hover focus",
  912. title: "",
  913. delay: 0,
  914. html: !1,
  915. container: !1,
  916. viewport: {
  917. selector: "body",
  918. padding: 0
  919. }
  920. },
  921. i.prototype.init = function(e, i, o) {
  922. this.enabled = !0,
  923. this.type = e,
  924. this.$element = t(i),
  925. this.options = this.getOptions(o),
  926. this.$viewport = this.options.viewport && t(this.options.viewport.selector || this.options.viewport);
  927. for (var s = this.options.trigger.split(" "), n = s.length; n--; ) {
  928. var r = s[n];
  929. if ("click" == r)
  930. this.$element.on("click." + this.type, this.options.selector, t.proxy(this.toggle, this));
  931. else if ("manual" != r) {
  932. var a = "hover" == r ? "mouseenter" : "focusin"
  933. , l = "hover" == r ? "mouseleave" : "focusout";
  934. this.$element.on(a + "." + this.type, this.options.selector, t.proxy(this.enter, this)),
  935. this.$element.on(l + "." + this.type, this.options.selector, t.proxy(this.leave, this))
  936. }
  937. }
  938. this.options.selector ? this._options = t.extend({}, this.options, {
  939. trigger: "manual",
  940. selector: ""
  941. }) : this.fixTitle()
  942. }
  943. ,
  944. i.prototype.getDefaults = function() {
  945. return i.DEFAULTS
  946. }
  947. ,
  948. i.prototype.getOptions = function(e) {
  949. return e = t.extend({}, this.getDefaults(), this.$element.data(), e),
  950. e.delay && "number" == typeof e.delay && (e.delay = {
  951. show: e.delay,
  952. hide: e.delay
  953. }),
  954. e
  955. }
  956. ,
  957. i.prototype.getDelegateOptions = function() {
  958. var e = {}
  959. , i = this.getDefaults();
  960. return this._options && t.each(this._options, function(t, o) {
  961. i[t] != o && (e[t] = o)
  962. }),
  963. e
  964. }
  965. ,
  966. i.prototype.enter = function(e) {
  967. var i = e instanceof this.constructor ? e : t(e.currentTarget).data("bs." + this.type);
  968. return i || (i = new this.constructor(e.currentTarget,this.getDelegateOptions()),
  969. t(e.currentTarget).data("bs." + this.type, i)),
  970. clearTimeout(i.timeout),
  971. i.hoverState = "in",
  972. i.options.delay && i.options.delay.show ? void (i.timeout = setTimeout(function() {
  973. // "in" == i.hoverState && i.show()
  974. }, i.options.delay.show)) : i.show()
  975. }
  976. ,
  977. i.prototype.leave = function(e) {
  978. var i = e instanceof this.constructor ? e : t(e.currentTarget).data("bs." + this.type);
  979. return i || (i = new this.constructor(e.currentTarget,this.getDelegateOptions()),
  980. t(e.currentTarget).data("bs." + this.type, i)),
  981. clearTimeout(i.timeout),
  982. i.hoverState = "out",
  983. i.options.delay && i.options.delay.hide ? void (i.timeout = setTimeout(function() {
  984. "out" == i.hoverState && i.hide()
  985. }, i.options.delay.hide)) : i.hide()
  986. }
  987. ,
  988. i.prototype.show = function() {
  989. var e = t.Event("show.bs." + this.type);
  990. if (this.hasContent() && this.enabled) {
  991. this.$element.trigger(e);
  992. var i = t.contains(document.documentElement, this.$element[0]);
  993. if (e.isDefaultPrevented() || !i)
  994. return;
  995. var o = this
  996. , s = this.tip()
  997. , n = this.getUID(this.type);
  998. this.setContent(),
  999. s.attr("id", n),
  1000. this.$element.attr("aria-describedby", n),
  1001. this.options.animation && s.addClass("fade");
  1002. var r = "function" == typeof this.options.placement ? this.options.placement.call(this, s[0], this.$element[0]) : this.options.placement
  1003. , a = /\s?auto?\s?/i
  1004. , l = a.test(r);
  1005. l && (r = r.replace(a, "") || "top"),
  1006. s.detach().css({
  1007. top: 0,
  1008. left: 0,
  1009. display: "block"
  1010. }).addClass(r).data("bs." + this.type, this),
  1011. this.options.container ? s.appendTo(this.options.container) : s.insertAfter(this.$element);
  1012. var p = this.getPosition()
  1013. , h = s[0].offsetWidth
  1014. , f = s[0].offsetHeight;
  1015. if (l) {
  1016. var u = r
  1017. , c = this.$element.parent()
  1018. , d = this.getPosition(c);
  1019. 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,
  1020. s.removeClass(u).addClass(r)
  1021. }
  1022. var g = this.getCalculatedOffset(r, p, h, f);
  1023. this.applyPlacement(g, r);
  1024. var y = function() {
  1025. o.$element.trigger("shown.bs." + o.type),
  1026. o.hoverState = null
  1027. };
  1028. t.support.transition && this.$tip.hasClass("fade") ? s.one("bsTransitionEnd", y).emulateTransitionEnd(150) : y()
  1029. }
  1030. }
  1031. ,
  1032. i.prototype.applyPlacement = function(e, i) {
  1033. var o = this.tip()
  1034. , s = o[0].offsetWidth
  1035. , n = o[0].offsetHeight
  1036. , r = parseInt(o.css("margin-top"), 10)
  1037. , a = parseInt(o.css("margin-left"), 10);
  1038. isNaN(r) && (r = 0),
  1039. isNaN(a) && (a = 0),
  1040. e.top = e.top + r,
  1041. e.left = e.left + a,
  1042. t.offset.setOffset(o[0], t.extend({
  1043. using: function(t) {
  1044. o.css({
  1045. top: Math.round(t.top),
  1046. left: Math.round(t.left)
  1047. })
  1048. }
  1049. }, e), 0),
  1050. o.addClass("in");
  1051. var l = o[0].offsetWidth
  1052. , p = o[0].offsetHeight;
  1053. "top" == i && p != n && (e.top = e.top + n - p);
  1054. var h = this.getViewportAdjustedDelta(i, e, l, p);
  1055. h.left ? e.left += h.left : e.top += h.top;
  1056. var f = h.left ? 2 * h.left - s + l : 2 * h.top - n + p
  1057. , u = h.left ? "left" : "top"
  1058. , c = h.left ? "offsetWidth" : "offsetHeight";
  1059. o.offset(e),
  1060. this.replaceArrow(f, o[0][c], u)
  1061. }
  1062. ,
  1063. i.prototype.replaceArrow = function(t, e, i) {
  1064. this.arrow().css(i, t ? 50 * (1 - t / e) + "%" : "")
  1065. }
  1066. ,
  1067. i.prototype.setContent = function() {
  1068. var t = this.tip()
  1069. , e = this.getTitle();
  1070. t.find(".tooltip-inner")[this.options.html ? "html" : "text"](e),
  1071. t.removeClass("fade in top bottom left right")
  1072. }
  1073. ,
  1074. i.prototype.hide = function() {
  1075. function e() {
  1076. "in" != i.hoverState && o.detach(),
  1077. i.$element.trigger("hidden.bs." + i.type)
  1078. }
  1079. var i = this
  1080. , o = this.tip()
  1081. , s = t.Event("hide.bs." + this.type);
  1082. if (this.$element.removeAttr("aria-describedby"),
  1083. this.$element.trigger(s),
  1084. !s.isDefaultPrevented())
  1085. return o.removeClass("in"),
  1086. t.support.transition && this.$tip.hasClass("fade") ? o.one("bsTransitionEnd", e).emulateTransitionEnd(150) : e(),
  1087. this.hoverState = null,
  1088. this
  1089. }
  1090. ,
  1091. i.prototype.fixTitle = function() {
  1092. var t = this.$element;
  1093. (t.attr("title") || "string" != typeof t.attr("data-original-title")) && t.attr("data-original-title", t.attr("title") || "").attr("title", "")
  1094. }
  1095. ,
  1096. i.prototype.hasContent = function() {
  1097. return this.getTitle()
  1098. }
  1099. ,
  1100. i.prototype.getPosition = function(e) {
  1101. e = e || this.$element;
  1102. var i = e[0]
  1103. , o = "BODY" == i.tagName;
  1104. return t.extend({}, "function" == typeof i.getBoundingClientRect ? i.getBoundingClientRect() : null, {
  1105. scroll: o ? document.documentElement.scrollTop || document.body.scrollTop : e.scrollTop(),
  1106. width: o ? t(window).width() : e.outerWidth(),
  1107. height: o ? t(window).height() : e.outerHeight()
  1108. }, o ? {
  1109. top: 0,
  1110. left: 0
  1111. } : e.offset())
  1112. }
  1113. ,
  1114. i.prototype.getCalculatedOffset = function(t, e, i, o) {
  1115. return "bottom" == t ? {
  1116. top: e.top + e.height,
  1117. left: e.left + e.width / 2 - i / 2
  1118. } : "top" == t ? {
  1119. top: e.top - o,
  1120. left: e.left + e.width / 2 - i / 2
  1121. } : "left" == t ? {
  1122. top: e.top + e.height / 2 - o / 2,
  1123. left: e.left - i
  1124. } : {
  1125. top: e.top + e.height / 2 - o / 2,
  1126. left: e.left + e.width
  1127. }
  1128. }
  1129. ,
  1130. i.prototype.getViewportAdjustedDelta = function(t, e, i, o) {
  1131. var s = {
  1132. top: 0,
  1133. left: 0
  1134. };
  1135. if (!this.$viewport)
  1136. return s;
  1137. var n = this.options.viewport && this.options.viewport.padding || 0
  1138. , r = this.getPosition(this.$viewport);
  1139. if (/right|left/.test(t)) {
  1140. var a = e.top - n - r.scroll
  1141. , l = e.top + n - r.scroll + o;
  1142. a < r.top ? s.top = r.top - a : l > r.top + r.height && (s.top = r.top + r.height - l)
  1143. } else {
  1144. var p = e.left - n
  1145. , h = e.left + n + i;
  1146. p < r.left ? s.left = r.left - p : h > r.width && (s.left = r.left + r.width - h)
  1147. }
  1148. return s
  1149. }
  1150. ,
  1151. i.prototype.getTitle = function() {
  1152. var t, e = this.$element, i = this.options;
  1153. return t = e.attr("data-original-title") || ("function" == typeof i.title ? i.title.call(e[0]) : i.title)
  1154. }
  1155. ,
  1156. i.prototype.getUID = function(t) {
  1157. do
  1158. t += ~~(1e6 * Math.random());
  1159. while (document.getElementById(t));return t
  1160. }
  1161. ,
  1162. i.prototype.tip = function() {
  1163. return this.$tip = this.$tip || t(this.options.template)
  1164. }
  1165. ,
  1166. i.prototype.arrow = function() {
  1167. return this.$arrow = this.$arrow || this.tip().find(".tooltip-arrow")
  1168. }
  1169. ,
  1170. i.prototype.validate = function() {
  1171. this.$element[0].parentNode || (this.hide(),
  1172. this.$element = null,
  1173. this.options = null)
  1174. }
  1175. ,
  1176. i.prototype.enable = function() {
  1177. this.enabled = !0
  1178. }
  1179. ,
  1180. i.prototype.disable = function() {
  1181. this.enabled = !1
  1182. }
  1183. ,
  1184. i.prototype.toggleEnabled = function() {
  1185. this.enabled = !this.enabled
  1186. }
  1187. ,
  1188. i.prototype.toggle = function(e) {
  1189. var i = this;
  1190. e && (i = t(e.currentTarget).data("bs." + this.type),
  1191. i || (i = new this.constructor(e.currentTarget,this.getDelegateOptions()),
  1192. t(e.currentTarget).data("bs." + this.type, i))),
  1193. i.tip().hasClass("in") ? i.leave(i) : i.enter(i)
  1194. }
  1195. ,
  1196. i.prototype.destroy = function() {
  1197. clearTimeout(this.timeout),
  1198. this.hide().$element.off("." + this.type).removeData("bs." + this.type)
  1199. }
  1200. ;
  1201. var o = t.fn.tooltip;
  1202. t.fn.tooltip = e,
  1203. t.fn.tooltip.Constructor = i,
  1204. t.fn.tooltip.noConflict = function() {
  1205. return t.fn.tooltip = o,
  1206. this
  1207. }
  1208. }(jQuery);
  1209. !function(e, t, n) {
  1210. "undefined" != typeof module && module.exports ? module.exports = n() : "function" == typeof define && define.amd ? define(n) : t[e] = n()
  1211. }("Keen", this, function() {
  1212. "use strict";
  1213. function Keen() {
  1214. return _init.apply(this, arguments)
  1215. }
  1216. function _init(e) {
  1217. if (_isUndefined(e))
  1218. throw new Error("Check out our JavaScript SDK Usage Guide: https://keen.io/docs/clients/javascript/usage-guide/");
  1219. if (_isUndefined(e.projectId) || "String" !== _type(e.projectId) || e.projectId.length < 1)
  1220. throw new Error("Please provide a projectId");
  1221. this.configure(e)
  1222. }
  1223. function _extend(e) {
  1224. for (var t = 1; t < arguments.length; t++)
  1225. for (var n in arguments[t])
  1226. e[n] = arguments[t][n];
  1227. return e
  1228. }
  1229. function _isUndefined(e) {
  1230. return void 0 === e
  1231. }
  1232. function _type(e) {
  1233. var t = e && e.constructor ? e.constructor.toString() : void 0;
  1234. return t ? t.match(/function (.*)\(/)[1] : "Null"
  1235. }
  1236. function _each(e, t, n) {
  1237. var r;
  1238. if (!e)
  1239. return 0;
  1240. if (n = n ? n : e,
  1241. "array" === _type(e)) {
  1242. for (r = 0; r < e.length; r++)
  1243. if (t.call(n, e[r], r, e) === !1)
  1244. return 0
  1245. } else
  1246. for (r in e)
  1247. if (e.hasOwnProperty(r) && t.call(n, e[r], r, e) === !1)
  1248. return 0;
  1249. return 1
  1250. }
  1251. function _parse_params(e) {
  1252. for (var t, n = {}, r = /\+/g, i = /([^&=]+)=?([^&]*)/g, o = function(e) {
  1253. return decodeURIComponent(e.replace(r, " "))
  1254. }, a = e.split("?")[1]; t = i.exec(a); )
  1255. n[o(t[1])] = o(t[2]);
  1256. return n
  1257. }
  1258. function _set_protocol(e) {
  1259. switch (e) {
  1260. case "http":
  1261. return "http";
  1262. case "auto":
  1263. return location.protocol.replace(/:/g, "");
  1264. case "https":
  1265. case void 0:
  1266. default:
  1267. return "https"
  1268. }
  1269. }
  1270. function _set_request_type(e) {
  1271. var t = e || "jsonp"
  1272. , n = !1;
  1273. return ("Object" === _type(XMLHttpRequest) || "Function" === _type(XMLHttpRequest)) && "withCredentials"in new XMLHttpRequest && (n = !0),
  1274. null == t || "xhr" == t ? n ? "xhr" : "jsonp" : t
  1275. }
  1276. function _build_url(e) {
  1277. return this.client.endpoint + "/projects/" + this.client.projectId + e
  1278. }
  1279. function _uploadEvent(e, t, n, r, i) {
  1280. var o = _build_url.apply(this, ["/events/" + e])
  1281. , a = {};
  1282. n = n !== !1,
  1283. this.client.globalProperties && (a = this.client.globalProperties(e));
  1284. for (var c in t)
  1285. t.hasOwnProperty(c) && (a[c] = t[c]);
  1286. switch (this.client.requestType) {
  1287. case "xhr":
  1288. _request.xhr.apply(this, ["POST", o, null, a, this.client.writeKey, n, r, i]);
  1289. break;
  1290. case "jsonp":
  1291. var s = JSON.stringify(a)
  1292. , l = Keen.Base64.encode(s);
  1293. o = o + "?api_key=" + this.client.writeKey,
  1294. o = o + "&data=" + l,
  1295. o = o + "&modified=" + (new Date).getTime(),
  1296. _request.jsonp.apply(this, [o, this.client.writeKey, r, i]);
  1297. break;
  1298. case "beacon":
  1299. var s = JSON.stringify(a)
  1300. , l = Keen.Base64.encode(s);
  1301. o = o + "?api_key=" + encodeURIComponent(this.client.writeKey),
  1302. o = o + "&data=" + encodeURIComponent(l),
  1303. o = o + "&modified=" + encodeURIComponent((new Date).getTime()),
  1304. o += "&c=clv1",
  1305. _request.beacon.apply(this, [o, null, r, i])
  1306. }
  1307. }
  1308. Keen.prototype.configure = function(e) {
  1309. return e.host = _isUndefined(e.host) ? "api.keen.io/3.0" : e.host.replace(/.*?:\/\//g, ""),
  1310. e.protocol = _set_protocol(e.protocol),
  1311. e.requestType = _set_request_type(e.requestType),
  1312. this.client = {
  1313. projectId: e.projectId,
  1314. writeKey: e.writeKey,
  1315. readKey: e.readKey,
  1316. globalProperties: null,
  1317. endpoint: e.protocol + "://" + e.host,
  1318. requestType: e.requestType
  1319. },
  1320. Keen.trigger("client", this, e),
  1321. this.trigger("ready"),
  1322. this
  1323. }
  1324. ;
  1325. var _request = {
  1326. xhr: function(e, t, n, r, i, o, a, c) {
  1327. if (!i)
  1328. return Keen.log("Please provide a writeKey for https://keen.io/project/" + this.client.projectId);
  1329. var s = new XMLHttpRequest;
  1330. if (s.onreadystatechange = function() {
  1331. if (4 == s.readyState)
  1332. if (s.status >= 200 && s.status < 300) {
  1333. var e;
  1334. try {
  1335. e = JSON.parse(s.responseText)
  1336. } catch (e) {
  1337. Keen.log("Could not JSON parse HTTP response: " + s.responseText),
  1338. c && c(s, e)
  1339. }
  1340. a && e && a(e)
  1341. } else
  1342. Keen.log("HTTP request failed."),
  1343. c && c(s, null)
  1344. }
  1345. ,
  1346. s.open(e, t, o),
  1347. i && s.setRequestHeader("Authorization", i),
  1348. r && s.setRequestHeader("Content-Type", "application/json"),
  1349. n)
  1350. for (var l in n)
  1351. n.hasOwnProperty(l) && s.setRequestHeader(l, n[l]);
  1352. var u = r ? JSON.stringify(r) : null;
  1353. s.send(u)
  1354. },
  1355. jsonp: function(e, t, n, r) {
  1356. if (!t)
  1357. return Keen.log("Please provide a writeKey for https://keen.io/project/" + this.client.projectId);
  1358. if (t && e.indexOf("api_key") < 0) {
  1359. var i = e.indexOf("?") > 0 ? "&" : "?";
  1360. e = e + i + "api_key=" + t
  1361. }
  1362. for (var o = "keenJSONPCallback" + (new Date).getTime(); o in window; )
  1363. o += "a";
  1364. var a = !1;
  1365. window[o] = function(e) {
  1366. a = !0,
  1367. n && e && n(e),
  1368. window[o] = void 0
  1369. }
  1370. ,
  1371. e = e + "&jsonp=" + o;
  1372. var c = document.createElement("script");
  1373. c.id = "keen-jsonp",
  1374. c.src = e,
  1375. document.getElementsByTagName("head")[0].appendChild(c),
  1376. c.onreadystatechange = function() {
  1377. a === !1 && "loaded" === this.readyState && (a = !0,
  1378. r && r())
  1379. }
  1380. ,
  1381. c.onerror = function() {
  1382. a === !1 && (a = !0,
  1383. r && r())
  1384. }
  1385. },
  1386. beacon: function(e, t, n, r) {
  1387. if (t && e.indexOf("api_key") < 0) {
  1388. var i = e.indexOf("?") > 0 ? "&" : "?";
  1389. e = e + i + "api_key=" + t
  1390. }
  1391. var o = !1
  1392. , a = document.createElement("img");
  1393. a.onload = function() {
  1394. if (o = !0,
  1395. "naturalHeight"in this) {
  1396. if (this.naturalHeight + this.naturalWidth === 0)
  1397. return void this.onerror()
  1398. } else if (this.width + this.height === 0)
  1399. return void this.onerror();
  1400. n && n({
  1401. created: !0
  1402. })
  1403. }
  1404. ,
  1405. a.onerror = function() {
  1406. o = !0,
  1407. r && r()
  1408. }
  1409. ,
  1410. a.src = e
  1411. }
  1412. }
  1413. , Events = Keen.Events = {
  1414. on: function(e, t) {
  1415. this.listeners || (this.listeners = {});
  1416. var n = this.listeners[e] || (this.listeners[e] = []);
  1417. return n.push({
  1418. callback: t
  1419. }),
  1420. this
  1421. },
  1422. off: function(e, t) {
  1423. if (!e && !t)
  1424. return this.listeners = void 0,
  1425. delete this.listeners,
  1426. this;
  1427. for (var n = this.listeners[e] || [], r = n.length; r--; )
  1428. t && t == n[r].callback && this.listeners[e].splice(r, 1),
  1429. t && 0 != n.length || (this.listeners[e] = void 0,
  1430. delete this.listeners[e]);
  1431. return this
  1432. },
  1433. trigger: function(e) {
  1434. if (!this.listeners)
  1435. return this;
  1436. for (var t = Array.prototype.slice.call(arguments, 1), n = this.listeners[e] || [], r = 0; r < n.length; r++)
  1437. n[r].callback.apply(this, t);
  1438. return this
  1439. }
  1440. };
  1441. _extend(Keen.prototype, Events),
  1442. _extend(Keen, Events),
  1443. Keen.loaded = !0,
  1444. Keen.utils = {
  1445. each: _each,
  1446. extend: _extend,
  1447. parseParams: _parse_params
  1448. },
  1449. Keen.ready = function(e) {
  1450. Keen.loaded ? e() : Keen.on("ready", e)
  1451. }
  1452. ,
  1453. Keen.log = function(e) {
  1454. "object" == typeof console && console.log("[Keen IO]", e)
  1455. }
  1456. ;
  1457. var Plugins = Keen.Plugins = {};
  1458. Keen.prototype.addEvent = function() {
  1459. _uploadEvent.apply(this, arguments)
  1460. }
  1461. ,
  1462. Keen.prototype.addEventSync = function(e, t, n, r) {
  1463. _uploadEvent.apply(this, [e, t, !1, n, r])
  1464. }
  1465. ,
  1466. Keen.prototype.trackExternalLink = function(e, t, n, r, i) {
  1467. var o = e
  1468. , a = o.metaKey
  1469. , c = o.target
  1470. , s = !1
  1471. , l = function() {};
  1472. return void 0 === r && (r = 500),
  1473. "A" === c.nodeName ? l = function() {
  1474. a || s || (s = !0,
  1475. window.location = c.href)
  1476. }
  1477. : "FORM" === c.nodeName && (l = function() {
  1478. s || (s = !0,
  1479. c.submit())
  1480. }
  1481. ),
  1482. i && (l = function() {
  1483. s || (s = !0,
  1484. i())
  1485. }
  1486. ),
  1487. _uploadEvent.call(this, t, n, l, l),
  1488. setTimeout(function() {
  1489. l()
  1490. }, r),
  1491. !!a && void 0
  1492. }
  1493. ,
  1494. Keen.prototype.setGlobalProperties = function(e) {
  1495. if (!this.client)
  1496. return Keen.log("Check out our JavaScript SDK Usage Guide: https://keen.io/docs/clients/javascript/usage-guide/");
  1497. if (!e || "function" != typeof e)
  1498. throw new Error("Invalid value for global properties: " + e);
  1499. this.client.globalProperties = e
  1500. }
  1501. ,
  1502. Keen.Base64 = {
  1503. map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
  1504. encode: function(e) {
  1505. var t, n, r, i, o, a, c, s = "", l = 0, u = this.map;
  1506. for (e = this.utf8.encode(e); l < e.length; )
  1507. t = e.charCodeAt(l++),
  1508. n = e.charCodeAt(l++),
  1509. r = e.charCodeAt(l++),
  1510. i = t >> 2,
  1511. o = (3 & t) << 4 | n >> 4,
  1512. a = isNaN(n) ? 64 : (15 & n) << 2 | r >> 6,
  1513. c = isNaN(n) || isNaN(r) ? 64 : 63 & r,
  1514. s = s + u.charAt(i) + u.charAt(o) + u.charAt(a) + u.charAt(c);
  1515. return s
  1516. },
  1517. decode: function(e) {
  1518. var t, n, r, i, o, a, c, s = "", l = 0, u = this.map, f = String.fromCharCode;
  1519. for (e = e.replace(/[^A-Za-z0-9\+\/\=]/g, ""); l < e.length; )
  1520. t = u.indexOf(e.charAt(l++)),
  1521. n = u.indexOf(e.charAt(l++)),
  1522. r = u.indexOf(e.charAt(l++)),
  1523. i = u.indexOf(e.charAt(l++)),
  1524. o = t << 2 | n >> 4,
  1525. a = (15 & n) << 4 | r >> 2,
  1526. c = (3 & r) << 6 | i,
  1527. s = s + (f(o) + (64 != r ? f(a) : "")) + (64 != i ? f(c) : "");
  1528. return this.utf8.decode(s)
  1529. },
  1530. utf8: {
  1531. encode: function(e) {
  1532. for (var t, n = "", r = 0, i = String.fromCharCode; r < e.length; )
  1533. t = e.charCodeAt(r++),
  1534. 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);
  1535. return n
  1536. },
  1537. decode: function(e) {
  1538. for (var t, n, r = "", i = 0, o = String.fromCharCode; i < e.length; )
  1539. n = e.charCodeAt(i),
  1540. 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];
  1541. return r
  1542. }
  1543. }
  1544. },
  1545. "object" != typeof JSON && (JSON = {}),
  1546. function() {
  1547. function f(e) {
  1548. return 10 > e ? "0" + e : e
  1549. }
  1550. function quote(e) {
  1551. return escapable.lastIndex = 0,
  1552. escapable.test(e) ? '"' + e.replace(escapable, function(e) {
  1553. var t = meta[e];
  1554. return "string" == typeof t ? t : "\\u" + ("0000" + e.charCodeAt(0).toString(16)).slice(-4)
  1555. }) + '"' : '"' + e + '"'
  1556. }
  1557. function str(e, t) {
  1558. var n, r, i, o, a, c = gap, s = t[e];
  1559. switch (s && "object" == typeof s && "function" == typeof s.toJSON && (s = s.toJSON(e)),
  1560. "function" == typeof rep && (s = rep.call(t, e, s)),
  1561. typeof s) {
  1562. case "string":
  1563. return quote(s);
  1564. case "number":
  1565. return isFinite(s) ? String(s) : "null";
  1566. case "boolean":
  1567. case "null":
  1568. return String(s);
  1569. case "object":
  1570. if (!s)
  1571. return "null";
  1572. if (gap += indent,
  1573. a = [],
  1574. "[object Array]" === Object.prototype.toString.apply(s)) {
  1575. for (o = s.length,
  1576. n = 0; o > n; n += 1)
  1577. a[n] = str(n, s) || "null";
  1578. return i = 0 === a.length ? "[]" : gap ? "[\n" + gap + a.join(",\n" + gap) + "\n" + c + "]" : "[" + a.join(",") + "]",
  1579. gap = c,
  1580. i
  1581. }
  1582. if (rep && "object" == typeof rep)
  1583. for (o = rep.length,
  1584. n = 0; o > n; n += 1)
  1585. "string" == typeof rep[n] && (r = rep[n],
  1586. i = str(r, s),
  1587. i && a.push(quote(r) + (gap ? ": " : ":") + i));
  1588. else
  1589. for (r in s)
  1590. Object.prototype.hasOwnProperty.call(s, r) && (i = str(r, s),
  1591. i && a.push(quote(r) + (gap ? ": " : ":") + i));
  1592. return i = 0 === a.length ? "{}" : gap ? "{\n" + gap + a.join(",\n" + gap) + "\n" + c + "}" : "{" + a.join(",") + "}",
  1593. gap = c,
  1594. i
  1595. }
  1596. }
  1597. "function" != typeof Date.prototype.toJSON && (Date.prototype.toJSON = function() {
  1598. 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
  1599. }
  1600. ,
  1601. String.prototype.toJSON = Number.prototype.toJSON = Boolean.prototype.toJSON = function() {
  1602. return this.valueOf()
  1603. }
  1604. );
  1605. 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 = {
  1606. "\b": "\\b",
  1607. "\t": "\\t",
  1608. "\n": "\\n",
  1609. "\f": "\\f",
  1610. "\r": "\\r",
  1611. '"': '\\"',
  1612. "\\": "\\\\"
  1613. }, rep;
  1614. "function" != typeof JSON.stringify && (JSON.stringify = function(e, t, n) {
  1615. var r;
  1616. if (gap = "",
  1617. indent = "",
  1618. "number" == typeof n)
  1619. for (r = 0; n > r; r += 1)
  1620. indent += " ";
  1621. else
  1622. "string" == typeof n && (indent = n);
  1623. if (rep = t,
  1624. t && "function" != typeof t && ("object" != typeof t || "number" != typeof t.length))
  1625. throw new Error("JSON.stringify");
  1626. return str("", {
  1627. "": e
  1628. })
  1629. }
  1630. ),
  1631. "function" != typeof JSON.parse && (JSON.parse = function(text, reviver) {
  1632. function walk(e, t) {
  1633. var n, r, i = e[t];
  1634. if (i && "object" == typeof i)
  1635. for (n in i)
  1636. Object.prototype.hasOwnProperty.call(i, n) && (r = walk(i, n),
  1637. void 0 !== r ? i[n] = r : delete i[n]);
  1638. return reviver.call(e, t, i)
  1639. }
  1640. var j;
  1641. if (text = String(text),
  1642. cx.lastIndex = 0,
  1643. cx.test(text) && (text = text.replace(cx, function(e) {
  1644. return "\\u" + ("0000" + e.charCodeAt(0).toString(16)).slice(-4)
  1645. })),
  1646. /^[\],:{}\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, "")))
  1647. return j = eval("(" + text + ")"),
  1648. "function" == typeof reviver ? walk({
  1649. "": j
  1650. }, "") : j;
  1651. throw new SyntaxError("JSON.parse")
  1652. }
  1653. )
  1654. }(),
  1655. !function(e, t, n) {
  1656. "undefined" != typeof module && module.exports ? module.exports = n() : "function" == typeof define && define.amd ? define(n) : t[e] = n()
  1657. }("domready", Keen.utils, function(e) {
  1658. function t(e) {
  1659. for (d = 1; e = r.shift(); )
  1660. e()
  1661. }
  1662. 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]);
  1663. return o[l] && o[l](s, n = function() {
  1664. o.removeEventListener(s, n, i),
  1665. t()
  1666. }
  1667. , i),
  1668. c && o.attachEvent(u, n = function() {
  1669. /^c/.test(o[f]) && (o.detachEvent(u, n),
  1670. t())
  1671. }
  1672. ),
  1673. e = c ? function(t) {
  1674. self != top ? d ? t() : r.push(t) : function() {
  1675. try {
  1676. a.doScroll("left")
  1677. } catch (n) {
  1678. return setTimeout(function() {
  1679. e(t)
  1680. }, 50)
  1681. }
  1682. t()
  1683. }()
  1684. }
  1685. : function(e) {
  1686. d ? e() : r.push(e)
  1687. }
  1688. });
  1689. var loaded = window.Keen, cached = window._Keen || {}, clients, ready;
  1690. if (loaded && cached) {
  1691. clients = cached.clients || {},
  1692. ready = cached.ready || [];
  1693. for (var instance in clients)
  1694. if (clients.hasOwnProperty(instance)) {
  1695. var client = clients[instance];
  1696. for (var method in Keen.prototype)
  1697. Keen.prototype.hasOwnProperty(method) && (loaded.prototype[method] = Keen.prototype[method]);
  1698. if (loaded.Query = Keen.Query ? Keen.Query : function() {}
  1699. ,
  1700. loaded.Visualization = Keen.Visualization ? Keen.Visualization : function() {}
  1701. ,
  1702. client._config && (client.configure.call(client, client._config),
  1703. delete client._config),
  1704. client._setGlobalProperties) {
  1705. for (var globals = client._setGlobalProperties, i = 0; i < globals.length; i++)
  1706. client.setGlobalProperties.apply(client, globals[i]);
  1707. delete client._setGlobalProperties
  1708. }
  1709. if (client._addEvent) {
  1710. for (var queue = client._addEvent || [], i = 0; i < queue.length; i++)
  1711. client.addEvent.apply(client, queue[i]);
  1712. delete client._addEvent
  1713. }
  1714. var callback = client._on || [];
  1715. if (client._on) {
  1716. for (var i = 0; i < callback.length; i++)
  1717. client.on.apply(client, callback[i]);
  1718. client.trigger("ready"),
  1719. delete client._on
  1720. }
  1721. }
  1722. for (var i = 0; i < ready.length; i++) {
  1723. var callback = ready[i];
  1724. Keen.on("ready", function() {
  1725. callback()
  1726. })
  1727. }
  1728. }
  1729. return Keen.loaded && setTimeout(function() {
  1730. Keen.utils.domready(function() {
  1731. Keen.trigger("ready")
  1732. })
  1733. }, 0),
  1734. Keen
  1735. });
  1736. !function() {
  1737. var t = window.analytics = window.analytics || [];
  1738. if (!t.initialize) {
  1739. if (t.invoked)
  1740. return void (window.console && console.error && console.error("Segment snippet included twice."));
  1741. t.invoked = !0,
  1742. t.methods = ["trackSubmit", "trackClick", "trackLink", "trackForm", "pageview", "identify", "reset", "group", "track", "ready", "alias", "debug", "page", "once", "off", "on"],
  1743. t.factory = function(e) {
  1744. return function() {
  1745. var n = Array.prototype.slice.call(arguments);
  1746. return n.unshift(e),
  1747. t.push(n),
  1748. t
  1749. }
  1750. }
  1751. ;
  1752. for (var e = 0; e < t.methods.length; e++) {
  1753. var n = t.methods[e];
  1754. t[n] = t.factory(n)
  1755. }
  1756. t.load = function(t) {
  1757. var e = document.createElement("script");
  1758. e.type = "text/javascript",
  1759. e.async = !0,
  1760. e.src = ("https:" === document.location.protocol ? "https://" : "http://") + "cdn.segment.com/analytics.js/v1/" + t + "/analytics.min.js";
  1761. var n = document.getElementsByTagName("script")[0];
  1762. n.parentNode.insertBefore(e, n)
  1763. }
  1764. ,
  1765. t.SNIPPET_VERSION = "4.0.0"
  1766. }
  1767. }();
  1768. !function(i, e) {
  1769. "use strict";
  1770. var s = ""
  1771. , r = "?"
  1772. , o = "function"
  1773. , a = "undefined"
  1774. , n = "object"
  1775. , t = "major"
  1776. , d = "model"
  1777. , w = "name"
  1778. , l = "type"
  1779. , p = "vendor"
  1780. , m = "version"
  1781. , c = "architecture"
  1782. , u = "console"
  1783. , g = "mobile"
  1784. , f = "tablet"
  1785. , h = "smarttv"
  1786. , b = {
  1787. has: function(i, e) {
  1788. return e.toLowerCase().indexOf(i.toLowerCase()) !== -1
  1789. },
  1790. lowerize: function(i) {
  1791. return i.toLowerCase()
  1792. }
  1793. }
  1794. , y = {
  1795. rgx: function() {
  1796. for (var i, s, r, t, d, w, l, p = 0, m = arguments; p < m.length; p += 2) {
  1797. var c = m[p]
  1798. , u = m[p + 1];
  1799. if (typeof i === a) {
  1800. i = {};
  1801. for (t in u)
  1802. d = u[t],
  1803. typeof d === n ? i[d[0]] = e : i[d] = e
  1804. }
  1805. for (s = r = 0; s < c.length; s++)
  1806. if (w = c[s].exec(this.getUA())) {
  1807. for (t = 0; t < u.length; t++)
  1808. l = w[++r],
  1809. d = u[t],
  1810. 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;
  1811. break
  1812. }
  1813. if (w)
  1814. break
  1815. }
  1816. return i
  1817. },
  1818. str: function(i, s) {
  1819. for (var o in s)
  1820. if (typeof s[o] === n && s[o].length > 0) {
  1821. for (var a = 0; a < s[o].length; a++)
  1822. if (b.has(s[o][a], i))
  1823. return o === r ? e : o
  1824. } else if (b.has(s[o], i))
  1825. return o === r ? e : o;
  1826. return i
  1827. }
  1828. }
  1829. , v = {
  1830. browser: {
  1831. oldsafari: {
  1832. major: {
  1833. 1: ["/8", "/1", "/3"],
  1834. 2: "/4",
  1835. "?": "/"
  1836. },
  1837. version: {
  1838. "1.0": "/8",
  1839. 1.2: "/1",
  1840. 1.3: "/3",
  1841. "2.0": "/412",
  1842. "2.0.2": "/416",
  1843. "2.0.3": "/417",
  1844. "2.0.4": "/419",
  1845. "?": "/"
  1846. }
  1847. }
  1848. },
  1849. device: {
  1850. sprint: {
  1851. model: {
  1852. "Evo Shift 4G": "7373KT"
  1853. },
  1854. vendor: {
  1855. HTC: "APA",
  1856. Sprint: "Sprint"
  1857. }
  1858. }
  1859. },
  1860. os: {
  1861. windows: {
  1862. version: {
  1863. ME: "4.90",
  1864. "NT 3.11": "NT3.51",
  1865. "NT 4.0": "NT4.0",
  1866. 2e3: "NT 5.0",
  1867. XP: ["NT 5.1", "NT 5.2"],
  1868. Vista: "NT 6.0",
  1869. 7: "NT 6.1",
  1870. 8: "NT 6.2",
  1871. 8.1: "NT 6.3",
  1872. RT: "ARM"
  1873. }
  1874. }
  1875. }
  1876. }
  1877. , k = {
  1878. 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]],
  1879. 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]],
  1880. 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]],
  1881. 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]],
  1882. 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]]
  1883. }
  1884. , x = function(e) {
  1885. var r = e || (i && i.navigator && i.navigator.userAgent ? i.navigator.userAgent : s);
  1886. return this instanceof x ? (this.getBrowser = function() {
  1887. return y.rgx.apply(this, k.browser)
  1888. }
  1889. ,
  1890. this.getCPU = function() {
  1891. return y.rgx.apply(this, k.cpu)
  1892. }
  1893. ,
  1894. this.getDevice = function() {
  1895. return y.rgx.apply(this, k.device)
  1896. }
  1897. ,
  1898. this.getEngine = function() {
  1899. return y.rgx.apply(this, k.engine)
  1900. }
  1901. ,
  1902. this.getOS = function() {
  1903. return y.rgx.apply(this, k.os)
  1904. }
  1905. ,
  1906. this.getResult = function() {
  1907. return {
  1908. ua: this.getUA(),
  1909. browser: this.getBrowser(),
  1910. engine: this.getEngine(),
  1911. os: this.getOS(),
  1912. device: this.getDevice(),
  1913. cpu: this.getCPU()
  1914. }
  1915. }
  1916. ,
  1917. this.getUA = function() {
  1918. return r
  1919. }
  1920. ,
  1921. this.setUA = function(i) {
  1922. return r = i,
  1923. this
  1924. }
  1925. ,
  1926. void this.setUA(r)) : new x(e).getResult()
  1927. };
  1928. if (typeof exports !== a)
  1929. typeof module !== a && module.exports && (exports = module.exports = x),
  1930. exports.UAParser = x;
  1931. else if (i.UAParser = x,
  1932. typeof define === o && define.amd && define(function() {
  1933. return x
  1934. }),
  1935. typeof i.jQuery !== a) {
  1936. var A = i.jQuery
  1937. , _ = new x;
  1938. A.ua = _.getResult(),
  1939. A.ua.get = function() {
  1940. return _.getUA()
  1941. }
  1942. ,
  1943. A.ua.set = function(i) {
  1944. _.setUA(i);
  1945. var e = _.getResult();
  1946. for (var s in e)
  1947. A.ua[s] = e[s]
  1948. }
  1949. }
  1950. }(this);
  1951. window.Modernizr = function(n, e, t) {
  1952. function o(n) {
  1953. d.cssText = n
  1954. }
  1955. function r(n, e) {
  1956. return typeof n === e
  1957. }
  1958. var i, c, u, a = "2.8.2", f = {}, s = e.documentElement, l = "modernizr", p = e.createElement(l), d = p.style, y = ({}.toString,
  1959. {}), w = [], b = w.slice, v = {}.hasOwnProperty;
  1960. u = r(v, "undefined") || r(v.call, "undefined") ? function(n, e) {
  1961. return e in n && r(n.constructor.prototype[e], "undefined")
  1962. }
  1963. : function(n, e) {
  1964. return v.call(n, e)
  1965. }
  1966. ,
  1967. Function.prototype.bind || (Function.prototype.bind = function(n) {
  1968. var e = this;
  1969. if ("function" != typeof e)
  1970. throw new TypeError;
  1971. var t = b.call(arguments, 1)
  1972. , o = function() {
  1973. if (this instanceof o) {
  1974. var r = function() {};
  1975. r.prototype = e.prototype;
  1976. var i = new r
  1977. , c = e.apply(i, t.concat(b.call(arguments)));
  1978. return Object(c) === c ? c : i
  1979. }
  1980. return e.apply(n, t.concat(b.call(arguments)))
  1981. };
  1982. return o
  1983. }
  1984. ),
  1985. y.webgl = function() {
  1986. return !!n.WebGLRenderingContext
  1987. }
  1988. ;
  1989. for (var h in y)
  1990. u(y, h) && (c = h.toLowerCase(),
  1991. f[c] = y[h](),
  1992. w.push((f[c] ? "" : "no-") + c));
  1993. return f.addTest = function(n, e) {
  1994. if ("object" == typeof n)
  1995. for (var o in n)
  1996. u(n, o) && f.addTest(o, n[o]);
  1997. else {
  1998. if (n = n.toLowerCase(),
  1999. f[n] !== t)
  2000. return f;
  2001. e = "function" == typeof e ? e() : e,
  2002. "undefined" != typeof enableClasses && enableClasses && (s.className += " " + (e ? "" : "no-") + n),
  2003. f[n] = e
  2004. }
  2005. return f
  2006. }
  2007. ,
  2008. o(""),
  2009. p = i = null,
  2010. f._version = a,
  2011. f
  2012. }(this, this.document);
  2013. !function(e, t, a) {
  2014. "use strict";
  2015. function n(t, h, m) {
  2016. function H(a) {
  2017. var n = 0
  2018. , i = Ee.length;
  2019. if (Ce.old = e.extend({}, Ce),
  2020. Ie = we ? 0 : be[ge.horizontal ? "width" : "height"](),
  2021. ke = Be[ge.horizontal ? "width" : "height"](),
  2022. ze = we ? t : Pe[ge.horizontal ? "outerWidth" : "outerHeight"](),
  2023. Ee.length = 0,
  2024. Ce.start = 0,
  2025. Ce.end = q(ze - Ie, 0),
  2026. Re) {
  2027. n = Ne.length,
  2028. qe = Pe.children(ge.itemSelector),
  2029. Ne.length = 0;
  2030. 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;
  2031. ze = 0,
  2032. qe.each(function(t, a) {
  2033. var n = e(a)
  2034. , i = a.getBoundingClientRect()
  2035. , l = E(ge.horizontal ? i.width || i.right - i.left : i.height || i.bottom - i.top)
  2036. , d = c(n, ge.horizontal ? "marginLeft" : "marginTop")
  2037. , p = c(n, ge.horizontal ? "marginRight" : "marginBottom")
  2038. , h = l + d + p
  2039. , m = !d || !p
  2040. , g = {};
  2041. g.el = a,
  2042. g.size = m ? l : h,
  2043. g.half = g.size / 2,
  2044. g.start = ze + (m ? d : 0),
  2045. g.center = g.start - E(Ie / 2 - g.size / 2),
  2046. g.end = g.start - Ie + g.size,
  2047. t || (ze += s),
  2048. ze += h,
  2049. ge.horizontal || u || p && d && t > 0 && (ze -= N(d, p)),
  2050. t === v && (g.end += o,
  2051. ze += o,
  2052. f = m ? p : 0),
  2053. Ne.push(g),
  2054. r = g
  2055. }),
  2056. Pe[0].style[ge.horizontal ? "width" : "height"] = (l ? ze : ze - s - o) + "px",
  2057. ze -= f,
  2058. Ne.length ? (Ce.start = Ne[0][Me ? "center" : "start"],
  2059. Ce.end = Me ? r.center : ze > Ie ? r.end : Ce.start) : Ce.start = Ce.end = 0
  2060. }
  2061. if (Ce.center = E(Ce.end / 2 + Ce.start / 2),
  2062. Q(),
  2063. Se.length && ke > 0 && (ge.dynamicHandle ? (Te = Ce.start === Ce.end ? ke : E(ke * Ie / ze),
  2064. Te = d(Te, ge.minHandleSize, ke),
  2065. Se[0].style[ge.horizontal ? "width" : "height"] = Te + "px") : Te = Se[ge.horizontal ? "outerWidth" : "outerHeight"](),
  2066. xe.end = ke - Te,
  2067. it || j()),
  2068. !we && Ie > 0) {
  2069. var p = Ce.start
  2070. , h = "";
  2071. if (Re)
  2072. e.each(Ne, function(e, t) {
  2073. Me ? Ee.push(t.center) : t.start + t.size > p && p <= Ce.end && (p = t.start,
  2074. Ee.push(p),
  2075. p += Ie,
  2076. p > Ce.end && p < Ce.end + Ie && Ee.push(Ce.end))
  2077. });
  2078. else
  2079. for (; p - Ie < Ce.end; )
  2080. Ee.push(p),
  2081. p += Ie;
  2082. if (De[0] && i !== Ee.length) {
  2083. for (var m = 0; m < Ee.length; m++)
  2084. h += ge.pageBuilder.call(ye, m);
  2085. Ae = De.html(h).children(),
  2086. Ae.eq(Oe.activePage).addClass(ge.activeClass)
  2087. }
  2088. }
  2089. if (Oe.slideeSize = ze,
  2090. Oe.frameSize = Ie,
  2091. Oe.sbSize = ke,
  2092. Oe.handleSize = Te,
  2093. Re) {
  2094. a && null != ge.startAt && (W(ge.startAt),
  2095. ye[Le ? "toCenter" : "toStart"](ge.startAt));
  2096. var g = Ne[Oe.activeItem];
  2097. X(Le && g ? g.center : d(Ce.dest, Ce.start, Ce.end))
  2098. } else
  2099. a ? null != ge.startAt && X(ge.startAt, 1) : X(d(Ce.dest, Ce.start, Ce.end));
  2100. pe("load")
  2101. }
  2102. function X(e, t, a) {
  2103. if (Re && at.released && !a) {
  2104. var n = $(e)
  2105. , i = e > Ce.start && e < Ce.end;
  2106. Le ? (i && (e = Ne[n.centerItem].center),
  2107. Me && ge.activateMiddle && W(n.centerItem)) : i && (e = Ne[n.firstItem].start)
  2108. }
  2109. 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),
  2110. et.start = +new Date,
  2111. et.time = 0,
  2112. et.from = Ce.cur,
  2113. et.to = e,
  2114. et.delta = e - Ce.cur,
  2115. et.tweesing = at.tweese || at.init && !at.slidee,
  2116. et.immediate = !et.tweesing && (t || at.init && at.slidee || !ge.speed),
  2117. at.tweese = 0,
  2118. e !== Ce.dest && (Ce.dest = e,
  2119. pe("change"),
  2120. it || Y()),
  2121. K(),
  2122. Q(),
  2123. Z(),
  2124. F()
  2125. }
  2126. function Y() {
  2127. if (ye.initialized) {
  2128. if (!it)
  2129. return it = w(Y),
  2130. void (at.released && pe("moveStart"));
  2131. et.immediate ? Ce.cur = et.to : et.tweesing ? (et.tweeseDelta = et.to - Ce.cur,
  2132. 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),
  2133. Ce.cur = et.from + et.delta * e.easing[ge.easing](et.time / ge.speed, et.time, 0, 1, ge.speed)),
  2134. et.to === Ce.cur ? (Ce.cur = et.to,
  2135. at.tweese = it = 0) : it = w(Y),
  2136. pe("move"),
  2137. 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"),
  2138. !it && at.released && pe("moveEnd"),
  2139. j()
  2140. }
  2141. }
  2142. function j() {
  2143. 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,
  2144. xe.cur = d(E(xe.cur), xe.start, xe.end),
  2145. _e.hPos !== xe.cur && (_e.hPos = xe.cur,
  2146. f ? Se[0].style[f] = v + (ge.horizontal ? "translateX" : "translateY") + "(" + xe.cur + "px)" : Se[0].style[ge.horizontal ? "left" : "top"] = xe.cur + "px"))
  2147. }
  2148. function F() {
  2149. Ae[0] && _e.page !== Oe.activePage && (_e.page = Oe.activePage,
  2150. Ae.removeClass(ge.activeClass).eq(Oe.activePage).addClass(ge.activeClass),
  2151. pe("activePage", _e.page))
  2152. }
  2153. function M() {
  2154. tt.speed && Ce.cur !== (tt.speed > 0 ? Ce.end : Ce.start) || ye.stop(),
  2155. ot = at.init ? w(M) : 0,
  2156. tt.now = +new Date,
  2157. tt.pos = Ce.cur + (tt.now - tt.lastTime) / 1e3 * tt.speed,
  2158. X(at.init ? tt.pos : E(tt.pos)),
  2159. at.init || Ce.cur !== Ce.dest || pe("moveEnd"),
  2160. tt.lastTime = tt.now
  2161. }
  2162. function L(e, t, n) {
  2163. if ("boolean" === i(t) && (n = t,
  2164. t = a),
  2165. t === a)
  2166. X(Ce[e], n);
  2167. else {
  2168. if (Le && "center" !== e)
  2169. return;
  2170. var r = ye.getPos(t);
  2171. r && X(r[e], n, !Le)
  2172. }
  2173. }
  2174. function R(e) {
  2175. return null != e ? l(e) ? e >= 0 && e < Ne.length ? e : -1 : qe.index(e) : -1
  2176. }
  2177. function U(e) {
  2178. return R(l(e) && 0 > e ? e + Ne.length : e)
  2179. }
  2180. function W(e, t) {
  2181. var a = R(e);
  2182. return !(!Re || 0 > a) && ((_e.active !== a || t) && (qe.eq(Oe.activeItem).removeClass(ge.activeClass),
  2183. qe.eq(a).addClass(ge.activeClass),
  2184. _e.active = Oe.activeItem = a,
  2185. Z(),
  2186. pe("active", a)),
  2187. a)
  2188. }
  2189. function $(e) {
  2190. e = d(l(e) ? e : Ce.dest, Ce.start, Ce.end);
  2191. var t = {}
  2192. , a = Me ? 0 : Ie / 2;
  2193. if (!we)
  2194. for (var n = 0, i = Ee.length; i > n; n++) {
  2195. if (e >= Ce.end || n === Ee.length - 1) {
  2196. t.activePage = Ee.length - 1;
  2197. break
  2198. }
  2199. if (e <= Ee[n] + a) {
  2200. t.activePage = n;
  2201. break
  2202. }
  2203. }
  2204. if (Re) {
  2205. for (var r = !1, s = !1, o = !1, c = 0, u = Ne.length; u > c; c++)
  2206. if (r === !1 && e <= Ne[c].start + Ne[c].half && (r = c),
  2207. o === !1 && e <= Ne[c].center + Ne[c].half && (o = c),
  2208. c === u - 1 || e <= Ne[c].end + Ne[c].half) {
  2209. s = c;
  2210. break
  2211. }
  2212. t.firstItem = l(r) ? r : 0,
  2213. t.centerItem = l(o) ? o : t.firstItem,
  2214. t.lastItem = l(s) ? s : t.centerItem
  2215. }
  2216. return t
  2217. }
  2218. function Q(t) {
  2219. e.extend(Oe, $(t))
  2220. }
  2221. function Z() {
  2222. var e = Ce.dest <= Ce.start
  2223. , t = Ce.dest >= Ce.end
  2224. , a = (e ? 1 : 0) | (t ? 2 : 0);
  2225. if (_e.slideePosState !== a && (_e.slideePosState = a,
  2226. Je.is("button,input") && Je.prop("disabled", e),
  2227. Ke.is("button,input") && Ke.prop("disabled", t),
  2228. Je.add(Qe)[e ? "addClass" : "removeClass"](ge.disabledClass),
  2229. Ke.add($e)[t ? "addClass" : "removeClass"](ge.disabledClass)),
  2230. _e.fwdbwdState !== a && at.released && (_e.fwdbwdState = a,
  2231. Qe.is("button,input") && Qe.prop("disabled", e),
  2232. $e.is("button,input") && $e.prop("disabled", t)),
  2233. Re && null != Oe.activeItem) {
  2234. var n = 0 === Oe.activeItem
  2235. , i = Oe.activeItem >= Ne.length - 1
  2236. , r = (n ? 1 : 0) | (i ? 2 : 0);
  2237. _e.itemsButtonState !== r && (_e.itemsButtonState = r,
  2238. Ze.is("button,input") && Ze.prop("disabled", n),
  2239. Ge.is("button,input") && Ge.prop("disabled", i),
  2240. Ze[n ? "addClass" : "removeClass"](ge.disabledClass),
  2241. Ge[i ? "addClass" : "removeClass"](ge.disabledClass))
  2242. }
  2243. }
  2244. function G(e, t, a) {
  2245. if (e = U(e),
  2246. t = U(t),
  2247. e > -1 && t > -1 && e !== t && (!a || t !== e - 1) && (a || t !== e + 1)) {
  2248. qe.eq(e)[a ? "insertAfter" : "insertBefore"](Ne[t].el);
  2249. var n = t > e ? e : a ? t : t - 1
  2250. , i = e > t ? e : a ? t + 1 : t
  2251. , r = e > t;
  2252. 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)),
  2253. H()
  2254. }
  2255. }
  2256. function J(e, t) {
  2257. for (var a = 0, n = Ve[e].length; n > a; a++)
  2258. if (Ve[e][a] === t)
  2259. return a;
  2260. return -1
  2261. }
  2262. function K() {
  2263. at.released && !ye.isPaused && ye.resume()
  2264. }
  2265. function V(e) {
  2266. return E(d(e, xe.start, xe.end) / xe.end * (Ce.end - Ce.start)) + Ce.start
  2267. }
  2268. function _() {
  2269. at.history[0] = at.history[1],
  2270. at.history[1] = at.history[2],
  2271. at.history[2] = at.history[3],
  2272. at.history[3] = at.delta
  2273. }
  2274. function ee(e) {
  2275. at.released = 0,
  2276. at.source = e,
  2277. at.slidee = "slidee" === e
  2278. }
  2279. function te(t) {
  2280. var a = "touchstart" === t.type
  2281. , n = t.data.source
  2282. , i = "slidee" === n;
  2283. 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),
  2284. ee(n),
  2285. at.init = 0,
  2286. at.$source = e(t.target),
  2287. at.touch = a,
  2288. at.pointer = a ? t.originalEvent.touches[0] : t,
  2289. at.initX = at.pointer.pageX,
  2290. at.initY = at.pointer.pageY,
  2291. at.initPos = i ? Ce.cur : xe.cur,
  2292. at.start = +new Date,
  2293. at.time = 0,
  2294. at.path = 0,
  2295. at.delta = 0,
  2296. at.locked = 0,
  2297. at.history = [0, 0, 0, 0],
  2298. at.pathToLock = i ? a ? 30 : 10 : 0,
  2299. b.on(a ? z : I, ae),
  2300. ye.pause(1),
  2301. (i ? Pe : Se).addClass(ge.draggedClass),
  2302. pe("moveStart"),
  2303. i && (rt = setInterval(_, 10)))
  2304. }
  2305. function ae(e) {
  2306. if (at.released = "mouseup" === e.type || "touchend" === e.type,
  2307. at.pointer = at.touch ? e.originalEvent[at.released ? "changedTouches" : "touches"][0] : e,
  2308. at.pathX = at.pointer.pageX - at.initX,
  2309. at.pathY = at.pointer.pageY - at.initY,
  2310. at.path = D(A(at.pathX, 2) + A(at.pathY, 2)),
  2311. at.delta = ge.horizontal ? at.pathX : at.pathY,
  2312. at.released || !(at.path < 1)) {
  2313. if (!at.init) {
  2314. if (!(ge.horizontal ? x(at.pathX) > x(at.pathY) : x(at.pathX) < x(at.pathY)))
  2315. return ne();
  2316. at.init = 1
  2317. }
  2318. r(e),
  2319. !at.locked && at.path > at.pathToLock && at.slidee && (at.locked = 1,
  2320. at.$source.on(B, s)),
  2321. at.released && (ne(),
  2322. ge.releaseSwing && at.slidee && (at.swing = (at.delta - at.history[0]) / 40 * 300,
  2323. at.delta += at.swing,
  2324. at.tweese = x(at.swing) > 10)),
  2325. X(at.slidee ? E(at.initPos - at.delta) : V(at.initPos + at.delta))
  2326. }
  2327. }
  2328. function ne() {
  2329. clearInterval(rt),
  2330. at.released = !0,
  2331. b.off(at.touch ? z : I, ae),
  2332. (at.slidee ? Pe : Se).removeClass(ge.draggedClass),
  2333. setTimeout(function() {
  2334. at.$source.off(B, s)
  2335. }),
  2336. Ce.cur === Ce.dest && at.init && pe("moveEnd"),
  2337. ye.resume(1),
  2338. at.init = 0
  2339. }
  2340. function ie(t) {
  2341. return ~e.inArray(t.nodeName, k) || e(t).is(ge.interactive)
  2342. }
  2343. function re() {
  2344. ye.stop(),
  2345. b.off("mouseup", re)
  2346. }
  2347. function se(e) {
  2348. switch (r(e),
  2349. this) {
  2350. case $e[0]:
  2351. case Qe[0]:
  2352. ye.moveBy($e.is(this) ? ge.moveBy : -ge.moveBy),
  2353. b.on("mouseup", re);
  2354. break;
  2355. case Ze[0]:
  2356. ye.prev();
  2357. break;
  2358. case Ge[0]:
  2359. ye.next();
  2360. break;
  2361. case Je[0]:
  2362. ye.prevPage();
  2363. break;
  2364. case Ke[0]:
  2365. ye.nextPage()
  2366. }
  2367. }
  2368. function oe(e) {
  2369. return nt.curDelta = (ge.horizontal ? e.deltaY || e.deltaX : e.deltaY) || -e.wheelDelta,
  2370. nt.curDelta /= 1 === e.deltaMode ? 3 : 100,
  2371. Re ? (p = +new Date,
  2372. nt.last < p - nt.resetTime && (nt.delta = 0),
  2373. nt.last = p,
  2374. nt.delta += nt.curDelta,
  2375. x(nt.delta) < 1 ? nt.finalDelta = 0 : (nt.finalDelta = E(nt.delta / 1),
  2376. nt.delta %= 1),
  2377. nt.finalDelta) : nt.curDelta
  2378. }
  2379. function le(e) {
  2380. e.originalEvent[g] = ye;
  2381. var t = +new Date;
  2382. if (O + ge.scrollHijack > t && Ue[0] !== document && Ue[0] !== window)
  2383. return void (O = t);
  2384. if (ge.scrollBy && Ce.start !== Ce.end) {
  2385. var a = oe(e.originalEvent);
  2386. (ge.scrollTrap || a > 0 && Ce.dest < Ce.end || 0 > a && Ce.dest > Ce.start) && r(e, 1),
  2387. ye.slideBy(ge.scrollBy * a)
  2388. }
  2389. }
  2390. function ce(e) {
  2391. ge.clickBar && e.target === Be[0] && (r(e),
  2392. X(V((ge.horizontal ? e.pageX - Be.offset().left : e.pageY - Be.offset().top) - Te / 2)))
  2393. }
  2394. function de(e) {
  2395. if (ge.keyboardNavBy)
  2396. switch (e.which) {
  2397. case ge.horizontal ? 37 : 38:
  2398. r(e),
  2399. ye["pages" === ge.keyboardNavBy ? "prevPage" : "prev"]();
  2400. break;
  2401. case ge.horizontal ? 39 : 40:
  2402. r(e),
  2403. ye["pages" === ge.keyboardNavBy ? "nextPage" : "next"]()
  2404. }
  2405. }
  2406. function ue(e) {
  2407. return ie(this) ? void (e.originalEvent[g + "ignore"] = !0) : void (this.parentNode !== Pe[0] || e.originalEvent[g + "ignore"] || ye.activate(this))
  2408. }
  2409. function fe() {
  2410. this.parentNode === De[0] && ye.activatePage(Ae.index(this))
  2411. }
  2412. function ve(e) {
  2413. ge.pauseOnHover && ye["mouseenter" === e.type ? "pause" : "resume"](2)
  2414. }
  2415. function pe(e, t) {
  2416. if (Ve[e]) {
  2417. for (me = Ve[e].length,
  2418. T.length = 0,
  2419. he = 0; me > he; he++)
  2420. T.push(Ve[e][he]);
  2421. for (he = 0; me > he; he++)
  2422. T[he].call(ye, e, t)
  2423. }
  2424. }
  2425. 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 = {
  2426. start: 0,
  2427. center: 0,
  2428. end: 0,
  2429. cur: 0,
  2430. dest: 0
  2431. }, Be = e(ge.scrollBar).eq(0), Se = Be.children().eq(0), ke = 0, Te = 0, xe = {
  2432. start: 0,
  2433. end: 0,
  2434. cur: 0
  2435. }, De = e(ge.pagesBar), Ae = 0, Ee = [], qe = 0, Ne = [], Oe = {
  2436. firstItem: 0,
  2437. lastItem: 0,
  2438. centerItem: 0,
  2439. activeItem: null,
  2440. activePage: 0
  2441. }, 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 = {
  2442. released: 1
  2443. }, nt = {
  2444. last: 0,
  2445. delta: 0,
  2446. resetTime: 200
  2447. }, it = 0, rt = 0, st = 0, ot = 0;
  2448. we || (t = be[0]),
  2449. ye.initialized = 0,
  2450. ye.frame = t,
  2451. ye.slidee = Pe[0],
  2452. ye.pos = Ce,
  2453. ye.rel = Oe,
  2454. ye.items = Ne,
  2455. ye.pages = Ee,
  2456. ye.isPaused = 0,
  2457. ye.options = ge,
  2458. ye.dragging = at,
  2459. ye.reload = function() {
  2460. H()
  2461. }
  2462. ,
  2463. ye.getPos = function(e) {
  2464. if (Re) {
  2465. var t = R(e);
  2466. return -1 !== t && Ne[t]
  2467. }
  2468. var a = Pe.find(e).eq(0);
  2469. if (a[0]) {
  2470. var n = ge.horizontal ? a.offset().left - Pe.offset().left : a.offset().top - Pe.offset().top
  2471. , i = a[ge.horizontal ? "outerWidth" : "outerHeight"]();
  2472. return {
  2473. start: n,
  2474. center: n - Ie / 2 + i / 2,
  2475. end: n - Ie + i,
  2476. size: i
  2477. }
  2478. }
  2479. return !1
  2480. }
  2481. ,
  2482. ye.moveBy = function(e) {
  2483. tt.speed = e,
  2484. !at.init && tt.speed && Ce.cur !== (tt.speed > 0 ? Ce.end : Ce.start) && (tt.lastTime = +new Date,
  2485. tt.startPos = Ce.cur,
  2486. ee("button"),
  2487. at.init = 1,
  2488. pe("moveStart"),
  2489. y(ot),
  2490. M())
  2491. }
  2492. ,
  2493. ye.stop = function() {
  2494. "button" === at.source && (at.init = 0,
  2495. at.released = 1)
  2496. }
  2497. ,
  2498. ye.prev = function() {
  2499. ye.activate(null == Oe.activeItem ? 0 : Oe.activeItem - 1)
  2500. }
  2501. ,
  2502. ye.next = function() {
  2503. ye.activate(null == Oe.activeItem ? 0 : Oe.activeItem + 1)
  2504. }
  2505. ,
  2506. ye.prevPage = function() {
  2507. ye.activatePage(Oe.activePage - 1)
  2508. }
  2509. ,
  2510. ye.nextPage = function() {
  2511. ye.activatePage(Oe.activePage + 1)
  2512. }
  2513. ,
  2514. ye.slideBy = function(e, t) {
  2515. e && (Re ? ye[Le ? "toCenter" : "toStart"](d((Le ? Oe.centerItem : Oe.firstItem) + ge.scrollBy * e, 0, Ne.length)) : X(Ce.dest + e, t))
  2516. }
  2517. ,
  2518. ye.slideTo = function(e, t) {
  2519. X(e, t)
  2520. }
  2521. ,
  2522. ye.toStart = function(e, t) {
  2523. L("start", e, t)
  2524. }
  2525. ,
  2526. ye.toEnd = function(e, t) {
  2527. L("end", e, t)
  2528. }
  2529. ,
  2530. ye.toCenter = function(e, t) {
  2531. L("center", e, t)
  2532. }
  2533. ,
  2534. ye.getIndex = R,
  2535. ye.activate = function(e, t) {
  2536. var a = W(e);
  2537. ge.smart && a !== !1 && (Le ? ye.toCenter(a, t) : a >= Oe.lastItem ? ye.toStart(a, t) : a <= Oe.firstItem ? ye.toEnd(a, t) : K())
  2538. }
  2539. ,
  2540. ye.activatePage = function(e, t) {
  2541. l(e) && X(Ee[d(e, 0, Ee.length - 1)], t)
  2542. }
  2543. ,
  2544. ye.resume = function(e) {
  2545. ge.cycleBy && ge.cycleInterval && ("items" !== ge.cycleBy || Ne[0] && null != Oe.activeItem) && !(e < ye.isPaused) && (ye.isPaused = 0,
  2546. st ? st = clearTimeout(st) : pe("resume"),
  2547. st = setTimeout(function() {
  2548. switch (pe("cycle"),
  2549. ge.cycleBy) {
  2550. case "items":
  2551. ye.activate(Oe.activeItem >= Ne.length - 1 ? 0 : Oe.activeItem + 1);
  2552. break;
  2553. case "pages":
  2554. ye.activatePage(Oe.activePage >= Ee.length - 1 ? 0 : Oe.activePage + 1)
  2555. }
  2556. }, ge.cycleInterval))
  2557. }
  2558. ,
  2559. ye.pause = function(e) {
  2560. e < ye.isPaused || (ye.isPaused = e || 100,
  2561. st && (st = clearTimeout(st),
  2562. pe("pause")))
  2563. }
  2564. ,
  2565. ye.toggle = function() {
  2566. ye[st ? "pause" : "resume"]()
  2567. }
  2568. ,
  2569. ye.set = function(t, a) {
  2570. e.isPlainObject(t) ? e.extend(ge, t) : ge.hasOwnProperty(t) && (ge[t] = a)
  2571. }
  2572. ,
  2573. ye.add = function(t, a) {
  2574. var n = e(t);
  2575. Re ? (null == a || !Ne[0] || a >= Ne.length ? n.appendTo(Pe) : Ne.length && n.insertBefore(Ne[a].el),
  2576. null != Oe.activeItem && a <= Oe.activeItem && (_e.active = Oe.activeItem += n.length)) : Pe.append(n),
  2577. H()
  2578. }
  2579. ,
  2580. ye.remove = function(t) {
  2581. if (Re) {
  2582. var a = U(t);
  2583. if (a > -1) {
  2584. qe.eq(a).remove();
  2585. var n = a === Oe.activeItem;
  2586. null != Oe.activeItem && a < Oe.activeItem && (_e.active = --Oe.activeItem),
  2587. H(),
  2588. n && (_e.active = null,
  2589. ye.activate(Oe.activeItem))
  2590. }
  2591. } else
  2592. e(t).remove(),
  2593. H()
  2594. }
  2595. ,
  2596. ye.moveAfter = function(e, t) {
  2597. G(e, t, 1)
  2598. }
  2599. ,
  2600. ye.moveBefore = function(e, t) {
  2601. G(e, t)
  2602. }
  2603. ,
  2604. ye.on = function(e, t) {
  2605. if ("object" === i(e))
  2606. for (var a in e)
  2607. e.hasOwnProperty(a) && ye.on(a, e[a]);
  2608. else if ("function" === i(t))
  2609. for (var n = e.split(" "), r = 0, s = n.length; s > r; r++)
  2610. Ve[n[r]] = Ve[n[r]] || [],
  2611. -1 === J(n[r], t) && Ve[n[r]].push(t);
  2612. else if ("array" === i(t))
  2613. for (var o = 0, l = t.length; l > o; o++)
  2614. ye.on(e, t[o])
  2615. }
  2616. ,
  2617. ye.one = function(e, t) {
  2618. function a() {
  2619. t.apply(ye, arguments),
  2620. ye.off(e, a)
  2621. }
  2622. ye.on(e, a)
  2623. }
  2624. ,
  2625. ye.off = function(e, t) {
  2626. if (t instanceof Array)
  2627. for (var a = 0, n = t.length; n > a; a++)
  2628. ye.off(e, t[a]);
  2629. else
  2630. for (var i = e.split(" "), r = 0, s = i.length; s > r; r++)
  2631. if (Ve[i[r]] = Ve[i[r]] || [],
  2632. null == t)
  2633. Ve[i[r]].length = 0;
  2634. else {
  2635. var o = J(i[r], t);
  2636. -1 !== o && Ve[i[r]].splice(o, 1)
  2637. }
  2638. }
  2639. ,
  2640. ye.destroy = function() {
  2641. return Ue.add(Se).add(Be).add(De).add($e).add(Qe).add(Ze).add(Ge).add(Je).add(Ke).off("." + g),
  2642. b.off("keydown", de),
  2643. Ze.add(Ge).add(Je).add(Ke).removeClass(ge.disabledClass),
  2644. qe && null != Oe.activeItem && qe.eq(Oe.activeItem).removeClass(ge.activeClass),
  2645. De.empty(),
  2646. we || (be.off("." + g),
  2647. He.restore(),
  2648. Xe.restore(),
  2649. Ye.restore(),
  2650. je.restore(),
  2651. e.removeData(t, g)),
  2652. Ne.length = Ee.length = 0,
  2653. _e = {},
  2654. ye.initialized = 0,
  2655. ye
  2656. }
  2657. ,
  2658. ye.init = function() {
  2659. if (!ye.initialized) {
  2660. ye.on(m);
  2661. var e = ["overflow", "position"]
  2662. , t = ["position", "webkitTransform", "msTransform", "transform", "left", "top", "width", "height"];
  2663. He.save.apply(He, e),
  2664. Ye.save.apply(Ye, e),
  2665. Xe.save.apply(Xe, t),
  2666. je.save.apply(je, t);
  2667. var a = Se;
  2668. return we || (a = a.add(Pe),
  2669. be.css("overflow", "hidden"),
  2670. f || "static" !== be.css("position") || be.css("position", "relative")),
  2671. f ? v && a.css(f, v) : ("static" === Be.css("position") && Be.css("position", "relative"),
  2672. a.css({
  2673. position: "absolute"
  2674. })),
  2675. ge.forward && $e.on(S, se),
  2676. ge.backward && Qe.on(S, se),
  2677. ge.prev && Ze.on(B, se),
  2678. ge.next && Ge.on(B, se),
  2679. ge.prevPage && Je.on(B, se),
  2680. ge.nextPage && Ke.on(B, se),
  2681. Ue.on(C, le),
  2682. Be[0] && Be.on(B, ce),
  2683. Re && ge.activateOn && be.on(ge.activateOn + "." + g, "*", ue),
  2684. De[0] && ge.activatePageOn && De.on(ge.activatePageOn + "." + g, "*", fe),
  2685. We.on(P, {
  2686. source: "slidee"
  2687. }, te),
  2688. Se && Se.on(P, {
  2689. source: "handle"
  2690. }, te),
  2691. b.on("keydown", de),
  2692. we || (be.on("mouseenter." + g + " mouseleave." + g, ve),
  2693. be.on("scroll." + g, o)),
  2694. ye.initialized = 1,
  2695. H(!0),
  2696. ge.cycleBy && !we && ye[ge.startPaused ? "pause" : "resume"](),
  2697. ye
  2698. }
  2699. }
  2700. }
  2701. function i(e) {
  2702. 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
  2703. }
  2704. function r(e, t) {
  2705. e.preventDefault(),
  2706. t && e.stopPropagation()
  2707. }
  2708. function s(t) {
  2709. r(t, 1),
  2710. e(this).off(t.type, s)
  2711. }
  2712. function o() {
  2713. this.scrollLeft = 0,
  2714. this.scrollTop = 0
  2715. }
  2716. function l(e) {
  2717. return !isNaN(parseFloat(e)) && isFinite(e)
  2718. }
  2719. function c(e, t) {
  2720. return 0 | E(String(e.css(t)).replace(/[^\-0-9.]/g, ""))
  2721. }
  2722. function d(e, t, a) {
  2723. return t > e ? t : e > a ? a : e
  2724. }
  2725. function u(e) {
  2726. var t = {};
  2727. return t.style = {},
  2728. t.save = function() {
  2729. if (e && e.nodeType) {
  2730. for (var a = 0; a < arguments.length; a++)
  2731. t.style[arguments[a]] = e.style[arguments[a]];
  2732. return t
  2733. }
  2734. }
  2735. ,
  2736. t.restore = function() {
  2737. if (e && e.nodeType) {
  2738. for (var a in t.style)
  2739. t.style.hasOwnProperty(a) && (e.style[a] = t.style[a]);
  2740. return t
  2741. }
  2742. }
  2743. ,
  2744. t
  2745. }
  2746. 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;
  2747. b.on(C, function(e) {
  2748. var t = e.originalEvent[g]
  2749. , a = +new Date;
  2750. (!t || t.options.scrollHijack < a - O) && (O = a)
  2751. }),
  2752. function(e) {
  2753. function t(e) {
  2754. var t = (new Date).getTime()
  2755. , n = Math.max(0, 16 - (t - a))
  2756. , i = setTimeout(e, n);
  2757. return a = t,
  2758. i
  2759. }
  2760. w = e.requestAnimationFrame || e.webkitRequestAnimationFrame || t;
  2761. var a = (new Date).getTime()
  2762. , n = e.cancelAnimationFrame || e.webkitCancelAnimationFrame || e.clearTimeout;
  2763. y = function(t) {
  2764. n.call(e, t)
  2765. }
  2766. }(window),
  2767. function() {
  2768. function e(e) {
  2769. for (var n = 0, i = t.length; i > n; n++) {
  2770. var r = t[n] ? t[n] + e.charAt(0).toUpperCase() + e.slice(1) : e;
  2771. if (null != a.style[r])
  2772. return r
  2773. }
  2774. }
  2775. var t = ["", "webkit", "moz", "ms", "o"]
  2776. , a = document.createElement("div");
  2777. f = e("transform"),
  2778. v = e("perspective") ? "translateZ(0) " : ""
  2779. }(),
  2780. t[m] = n,
  2781. e.fn[h] = function(t, a) {
  2782. var r, s;
  2783. return e.isPlainObject(t) || (("string" === i(t) || t === !1) && (r = t === !1 ? "destroy" : t,
  2784. s = Array.prototype.slice.call(arguments, 1)),
  2785. t = {}),
  2786. this.each(function(i, o) {
  2787. var l = e.data(o, g);
  2788. l || r ? l && r && l[r] && l[r].apply(l, s) : l = e.data(o, g, new n(o,t,a).init())
  2789. })
  2790. }
  2791. ,
  2792. n.defaults = {
  2793. slidee: null,
  2794. horizontal: !1,
  2795. itemNav: null,
  2796. itemSelector: null,
  2797. smart: !1,
  2798. activateOn: null,
  2799. activateMiddle: !1,
  2800. scrollSource: null,
  2801. scrollBy: 0,
  2802. scrollHijack: 300,
  2803. scrollTrap: !1,
  2804. dragSource: null,
  2805. mouseDragging: !1,
  2806. touchDragging: !1,
  2807. releaseSwing: !1,
  2808. swingSpeed: .2,
  2809. elasticBounds: !1,
  2810. interactive: null,
  2811. scrollBar: null,
  2812. dragHandle: !1,
  2813. dynamicHandle: !1,
  2814. minHandleSize: 50,
  2815. clickBar: !1,
  2816. syncSpeed: .5,
  2817. pagesBar: null,
  2818. activatePageOn: null,
  2819. pageBuilder: function(e) {
  2820. return "<li>" + (e + 1) + "</li>"
  2821. },
  2822. forward: null,
  2823. backward: null,
  2824. prev: null,
  2825. next: null,
  2826. prevPage: null,
  2827. nextPage: null,
  2828. cycleBy: null,
  2829. cycleInterval: 5e3,
  2830. pauseOnHover: !1,
  2831. startPaused: !1,
  2832. moveBy: 300,
  2833. speed: 0,
  2834. easing: "swing",
  2835. startAt: null,
  2836. keyboardNavBy: null,
  2837. draggedClass: "dragged",
  2838. activeClass: "active",
  2839. disabledClass: "disabled"
  2840. }
  2841. }(jQuery, window);
  2842. !function e(t, i, n) {
  2843. function r(a, s) {
  2844. if (!i[a]) {
  2845. if (!t[a]) {
  2846. var l = "function" == typeof require && require;
  2847. if (!s && l)
  2848. return l(a, !0);
  2849. if (o)
  2850. return o(a, !0);
  2851. var c = new Error("Cannot find module '" + a + "'");
  2852. throw c.code = "MODULE_NOT_FOUND",
  2853. c
  2854. }
  2855. var h = i[a] = {
  2856. exports: {}
  2857. };
  2858. t[a][0].call(h.exports, function(e) {
  2859. var i = t[a][1][e];
  2860. return r(i ? i : e)
  2861. }, h, h.exports, e, t, i, n)
  2862. }
  2863. return i[a].exports
  2864. }
  2865. for (var o = "function" == typeof require && require, a = 0; a < n.length; a++)
  2866. r(n[a]);
  2867. return r
  2868. }({
  2869. 1: [function(e, t, i) {
  2870. (function(i) {
  2871. "use strict";
  2872. function n(e) {
  2873. this.player = null,
  2874. this.director = null,
  2875. this.modelManager = null,
  2876. this.container = null,
  2877. this.tagManager = null,
  2878. this.fadeInSpeed = e,
  2879. null !== this.fadeInSpeed && void 0 !== this.fadeInSpeed || (this.fadeInSpeed = 0)
  2880. }
  2881. var r = e("three")
  2882. , o = e("./util/logger")
  2883. , a = (e("./util/common"),
  2884. e("./enum/PlayerEvents"))
  2885. , s = e("./enum/DirectorEvents")
  2886. , l = e("./settings")
  2887. , c = e("./enum/Viewmode")
  2888. , h = (e("./enum/WarpStyle"),
  2889. e("./enum/BlackoutStyle"),
  2890. e("./enum/ModelManagerEvents"))
  2891. , u = e("./enum/tagEvents")
  2892. , d = e("./util/transitions")
  2893. , p = e("./util/lerp")
  2894. , f = new o(i);
  2895. //window.THREE = r;
  2896. n.prototype.init = function(e, t, i, n, r) {
  2897. window.app = this;
  2898. this.player = t,
  2899. this.director = e,
  2900. this.modelManager = i,
  2901. this.tagManager = n,
  2902. this.container = r,
  2903. this.updateModel(),
  2904. this.bindEvents()
  2905. }
  2906. ,
  2907. n.prototype.bindEvents = function() {
  2908. this.modelManager.on(h.ActiveModelChanged, this.updateModel.bind(this)),
  2909. this.player.on(a.ModeChanging, this.handlePlayerModeChanging.bind(this)),
  2910. this.player.on(a.ModeChanged, this.handlePlayerModeChanged.bind(this)),
  2911. this.player.on(a.ClosestPanoChanging, this.handleClosestPanoChanging.bind(this)),
  2912. this.player.on(a.StartInside, this.handleStartInside.bind(this)),
  2913. this.player.on(a.StartOutside, this.handleStartOutside.bind(this)),
  2914. this.player.on(a.WarpStarted, this.handleWarpStarted.bind(this)),
  2915. this.director.on(s.ActionInterrupted, this.handleActionInterruption.bind(this)),
  2916. this.tagManager.on(u.TagActivated, this.ontagActivated.bind(this)),
  2917. this.tagManager.on(u.TagNavigation, this.onNavigationTotag.bind(this))
  2918. }
  2919. ,
  2920. n.prototype.updateModel = function() {
  2921. //模型this.model
  2922. this.model = this.modelManager.getActiveModel()
  2923. }
  2924. ,
  2925. n.prototype.handleWarpStarted = function() {
  2926. this.hidePlayerReticule()
  2927. }
  2928. ,
  2929. n.prototype.ontagActivated = function() {
  2930. this.hidePlayerReticule()
  2931. }
  2932. ,
  2933. n.prototype.onNavigationTotag = function() {
  2934. this.hidePlayerReticule()
  2935. }
  2936. ,
  2937. n.prototype.handlePlayerModeChanging = function(e, t, i) {
  2938. var n = this.modelManager.getActiveModel()
  2939. , r = this.player.is360View(t, i) || this.director.tourIsPlaying ? 0 : l[t].markerOpacity;
  2940. n.fadePanoMarkers(r),
  2941. n.setMode(t)
  2942. }
  2943. ,
  2944. n.prototype.handlePlayerModeChanged = function(e, t) {
  2945. var i = this.modelManager.getActiveModel()
  2946. , n = t === c.PANORAMA ? r.DoubleSide : r.FrontSide;
  2947. i.setSide(n),
  2948. i.setMode(t)
  2949. }
  2950. ,
  2951. n.prototype.handleClosestPanoChanging = function(e, t, i) {
  2952. i !== c.TRANSITIONING && (e && !this.director.tourIsPlaying && e.hoverOff(i),
  2953. t && !this.director.tourIsPlaying && t.hoverOn(i))
  2954. }
  2955. ,
  2956. n.prototype.handleActionInterruption = function() {}
  2957. ,
  2958. n.prototype.handleStartInside = function(e) {
  2959. var t = l[this.player.mode]
  2960. , i = e ? 0 : t.transitionTime * t.skyboxOpacityLength;
  2961. this.fadeIn(this.fadeInSpeed),
  2962. this.model.alpha = 0,
  2963. this.model.skybox.material.uniforms.opacity.value = 1,
  2964. this.model.fadePanoMarkers(e ? 0 : t.markerOpacity);
  2965. var n = this.player.reticule;
  2966. d.start(p.property(n.material, "opacity", 0), i, null, 0, null, "retReOpac")
  2967. }
  2968. ,
  2969. n.prototype.handleStartOutside = function(e) {
  2970. this.fadeIn(e)
  2971. }
  2972. ,
  2973. n.prototype.fadeIn = function(e) {
  2974. null !== e && void 0 !== e || (e = 2e3,
  2975. f.warn("DisplayController.fadeIn -> no transition time specified, defaulting to 2000 ms.")),
  2976. $(this.container).fadeIn(e)
  2977. }
  2978. ,
  2979. n.prototype.hidePlayerReticule = function() {
  2980. this.player.reticule.hide()
  2981. }
  2982. ,
  2983. t.exports = n
  2984. }
  2985. ).call(this, "/js/DisplayController.js")
  2986. }
  2987. , {
  2988. "./enum/BlackoutStyle": 18,
  2989. "./enum/DirectorEvents": 23,
  2990. "./enum/tagEvents": 32,
  2991. "./enum/ModelManagerEvents": 33,
  2992. "./enum/PlayerEvents": 40,
  2993. "./enum/Viewmode": 51,
  2994. "./enum/WarpStyle": 52,
  2995. "./settings": 166,
  2996. "./util/common": 185,
  2997. "./util/lerp": 188,
  2998. "./util/logger": 189,
  2999. "./util/transitions": 195,
  3000. three: 217
  3001. }],
  3002. 2: [function(e, t, i) {
  3003. "use strict";
  3004. function n() {
  3005. this.baseStartTime = performance.timing.navigationStart,
  3006. this.loadingStartTime = null,
  3007. this.waitingStartTime = null,
  3008. this.appReadyTime = null
  3009. }
  3010. n.prototype.setBaseStartTime = function(e) {
  3011. this.baseStartTime = e || Date.now()
  3012. }
  3013. ,
  3014. n.prototype.setWaitingStartTime = function(e) {
  3015. this.waitingStartTime = e || Date.now()
  3016. }
  3017. ,
  3018. n.prototype.setLoadingStartTime = function(e) {
  3019. this.loadingStartTime = e || Date.now()
  3020. }
  3021. ,
  3022. n.prototype.setAppReadyTime = function(e) {
  3023. this.appReadyTime = e || Date.now()
  3024. }
  3025. ,
  3026. n.prototype.calcFullLoadingTime = function() {
  3027. var e = this.appReadyTime - this.baseStartTime;
  3028. return this.waitingStartTime && (e -= this.loadingStartTime - this.waitingStartTime),
  3029. e
  3030. }
  3031. ,
  3032. t.exports = n
  3033. }
  3034. , {}],
  3035. 3: [function(e, t, i) {
  3036. (function(i) {
  3037. "use strict";
  3038. function n() {
  3039. return 100 * Math.random()
  3040. }
  3041. var r = e("./util/logger")
  3042. , o = e("./util/browser")
  3043. , a = new r(i)
  3044. , s = window.MP_AB_TESTS = window.MP_AB_TESTS || {
  3045. initialized: !1,
  3046. init: function(e, t) {
  3047. if (t = t || {},
  3048. !this.initialized) {
  3049. this.initialized = !0,
  3050. o.valueFromHash("tilegen") && (t.tilegen = 1 === o.valueFromHash("tilegen", 0)),
  3051. o.valueFromHash("imgopt") && (t.imgopt = 1 === o.valueFromHash("imgopt", 0));
  3052. for (var i in e) {
  3053. var r = i.match("^sc_tilegen_([0-9]+)$");
  3054. r && (s.tilegen = n() < parseInt(r[1]));
  3055. var l = i.match("^sc_imgopt_([0-9]+)$");
  3056. l && (s.imgopt = n() < parseInt(l[1]))
  3057. }
  3058. for (var c in t)
  3059. s[c] = t[c],
  3060. a.debug("A/B override:", c, s[c])
  3061. }
  3062. },
  3063. changeIfTileGenerating: function(e) {
  3064. return s.tilegen && (e += e.indexOf("?") === -1 ? "?" : "&",
  3065. e += ""),
  3066. e
  3067. },
  3068. changeIfImageOptimzing: function(e) {
  3069. return s.imgopt && e.indexOf("imgopt=1") === -1 && (e += e.indexOf("?") === -1 ? "?" : "&",
  3070. e += ""),
  3071. e
  3072. },
  3073. tilegen: !1,
  3074. imgopt: !1
  3075. };
  3076. t.exports = s
  3077. }
  3078. ).call(this, "/js/ab.js")
  3079. }
  3080. , {
  3081. "./util/browser": 182,
  3082. "./util/logger": 189
  3083. }],
  3084. 4: [function(e, t, i) {
  3085. (function(i) {
  3086. "use strict";
  3087. function n() {
  3088. return {
  3089. addons: [{
  3090. name: "keen:ua_parser",
  3091. input: {
  3092. ua_string: "user_agent"
  3093. },
  3094. output: "parsed_user_agent"
  3095. }]
  3096. }
  3097. }
  3098. function r(e, t, i, n) {
  3099. function r(t) {
  3100. l[t.sid] = !0;
  3101. var i = t.billboard.media && t.billboard.media.type
  3102. , n = {
  3103. tag_id: t.sid,
  3104. tags_visited: Object.keys(l).length,
  3105. tag_count: Object.keys(e.tags).length,
  3106. tag_view_count: ++E,
  3107. has_media: !!i
  3108. };
  3109. i && (n.media_type = i),
  3110. u("tag_opened", n)
  3111. }
  3112. var l = {}
  3113. , h = Date.now() - N
  3114. , f = null;
  3115. n && (f = Date.now() - window.navigationStart);
  3116. var g;
  3117. try {
  3118. g = /* e.data.player_options.highlight_reel && */ e.heroLocations.length > 0
  3119. } catch (e) {
  3120. g = !1
  3121. }
  3122. var v, A = e.supportsVR;
  3123. A || (v = "VR disabled at the model/account level",
  3124. 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"))),
  3125. u("model_loaded", {
  3126. duration: h,
  3127. duration_from_navigation_start: f,
  3128. has_hlr: g,
  3129. has_vr: A,
  3130. vr_reason: v
  3131. });
  3132. var I = 0;
  3133. e.panos.forEach(function(e) {
  3134. e.on("enter", function() {
  3135. c("pano_viewed", {
  3136. pano_id: e.id,
  3137. pano_view_count: ++I,
  3138. alignment_type: e.alignmentType,
  3139. interaction_source: O,
  3140. navigation_source: p
  3141. })
  3142. })
  3143. });
  3144. var E = 0;
  3145. for (var T in e.tags)
  3146. e.tags[T].billboard.on(M.OPENED, r.bind(this, e.tags[T]));
  3147. t.on("tour_auto", function(e) {
  3148. p = "tour_" + e
  3149. }),
  3150. t.on("tour_manual", function(e) {
  3151. O = "gui-" + e,
  3152. p = "tour_manual"
  3153. }),
  3154. i.on(C.InteractionKey, function() {
  3155. t.mode === y.TRANSITIONING || t.flying || d(C.InteractionKey)
  3156. }),
  3157. i.on(C.InteractionDirect, function() {
  3158. t.mode === y.TRANSITIONING || t.flying || d(C.InteractionDirect)
  3159. }),
  3160. o(t),
  3161. a(),
  3162. s()
  3163. }
  3164. function o(e) {
  3165. I.on(T.OPENED, function() {
  3166. c("showcase_share_intent", {
  3167. pano_id: e.currentPano && e.currentPano.id
  3168. })
  3169. }),
  3170. I.on(T.LINK_CLICKED, function(t) {
  3171. c("showcase_share_action", {
  3172. channel: t.channel,
  3173. pano_id: e.currentPano && e.currentPano.id
  3174. })
  3175. }),
  3176. E.on(x.ORIGIN_LINK_CLICKED, function() {
  3177. c("showcase_share_origin_link_clicked")
  3178. })
  3179. }
  3180. function a() {}
  3181. function s() {
  3182. b.on(S.OPENED, c.bind(this, "showcase_gui", {
  3183. gui_action: "click_vr_button"
  3184. })),
  3185. b.on(S.LAUNCH, function(e) {
  3186. c("showcase_gui", {
  3187. gui_action: "launch_vr",
  3188. vr_platform: e.vr_platform,
  3189. vr_app: e.vr_app
  3190. })
  3191. }),
  3192. b.on(S.PREV, c.bind(this, "showcase_gui", {
  3193. gui_action: "vr_modal_prev"
  3194. })),
  3195. b.on(S.NEXT, function(e) {
  3196. c("showcase_gui", {
  3197. gui_action: e.nextAction
  3198. })
  3199. }),
  3200. b.on(S.CLOSED, c.bind(this, "showcase_gui", {
  3201. gui_action: "vr_modal_close"
  3202. })),
  3203. b.on(S.falseICECHOSEN, function(e) {
  3204. c("showcase_gui", {
  3205. gui_action: e.name + " "
  3206. })
  3207. }),
  3208. b.on(S.STORE, function(e) {
  3209. c("showcase_gui", {
  3210. gui_action: "launch_store",
  3211. store: e
  3212. })
  3213. })
  3214. }
  3215. function l(e, t) {
  3216. if (f)
  3217. try {
  3218. f.addEvent(e, v.extendObject({
  3219. host: window.location.host,
  3220. keen: n(),
  3221. user_agent: "${keen.user_agent}",
  3222. referrer: {
  3223. url: v.normalizeUrl(document.referrer),
  3224. domain: v.domainFromUrl(document.referrer),
  3225. url_original: document.referrer
  3226. },
  3227. embedded: m.inIframe(),
  3228. is_mobile: m.isMobile(),
  3229. version: "2.25.6-0-gd87e5b1"
  3230. }, t))
  3231. } catch (e) {
  3232. P.warn("analytics.report -> client.addEvent() error (is there blocking software installed?). Error message: " + e)
  3233. }
  3234. }
  3235. function c(e, t) {
  3236. if (t = t || {},
  3237. L)
  3238. try {
  3239. window.analytics.track(e, v.extendObject(t, B), {
  3240. context: {
  3241. app: {
  3242. name: "showcase",
  3243. version: "2.25.6-0-gd87e5b1"
  3244. },
  3245. screen: {
  3246. width: window.screen.width,
  3247. height: window.screen.height,
  3248. density: window.devicePixelRatio
  3249. }
  3250. }
  3251. })
  3252. } catch (t) {
  3253. console.warn("Failed to send data to segment for " + e)
  3254. }
  3255. }
  3256. function h(e, t) {
  3257. if (t = t || {},
  3258. navigator.sendBeacon && L)
  3259. try {
  3260. navigator.sendBeacon("https://api.segment.io/v1/t", JSON.stringify({
  3261. event: e,
  3262. anonymousId: window.analytics.user().anonymousId(),
  3263. properties: v.extendObject(t, B),
  3264. writeKey: L,
  3265. sentAt: Date.now(),
  3266. type: "track",
  3267. context: {
  3268. userAgent: m.userAgent(),
  3269. library: {
  3270. name: "showcase-beacon",
  3271. version: "2.25.6-0-gd87e5b1"
  3272. },
  3273. app: {
  3274. name: "showcase",
  3275. version: "2.25.6-0-gd87e5b1"
  3276. }
  3277. }
  3278. }))
  3279. } catch (e) {
  3280. console.warn("Failed to send async segment request")
  3281. }
  3282. }
  3283. function u(e, t) {
  3284. t = t || {},
  3285. c(e, t)
  3286. }
  3287. function d(e, t) {
  3288. O = e === C.InteractionGui ? "gui-" + t : e,
  3289. p = "self_guided"
  3290. }
  3291. var p, f, g = (e("three"),
  3292. e("./util/ajax"),
  3293. e("./ab")), m = e("./util/browser"), v = e("./util/common"), A = e("./settings"), y = (e("./localization/localize"),
  3294. 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"),
  3295. "direct"), L = null, D = !1, N = null, B = null, F = v.uuid4();
  3296. t.exports = {
  3297. report: function(e, t, i, n) {
  3298. l("Session starts", {
  3299. model: e,
  3300. status: t,
  3301. loadtime: Date.now() - (N || Date.now()),
  3302. loadtime_from_navigation_start: i ? Date.now() - window.navigationStart : null,
  3303. autoplay: i,
  3304. quickstart: n,
  3305. ab_tilegen: g.tilegen,
  3306. ab_imgopt: g.imgopt
  3307. })
  3308. },
  3309. impression: function(e) {
  3310. e = e || {};
  3311. var t = void 0 === e.isVisible || e.isVisible
  3312. , i = (void 0 !== e.immediate && e.immediate,
  3313. window.location.search.substr(1).split("&"));
  3314. u("impression", {
  3315. visible: t,
  3316. url_params: i
  3317. })
  3318. },
  3319. initKeen: function(e) {
  3320. return e.token && e.appId ? void (f = new Keen({
  3321. projectId: e.appId,
  3322. writeKey: e.token,
  3323. readKey: "",
  3324. requestType: "xhr"
  3325. })) : void P.warn("no keen token/appId")
  3326. },
  3327. initSegment: function(e) {
  3328. return e.token ? (L = e.token,
  3329. window.analytics.load(e.token),
  3330. B = {
  3331. model_id: e.model,
  3332. start_source: e.startSource,
  3333. autoplay: e.autoplay,
  3334. quickstart: e.quickstart,
  3335. language_tag: A.languageTag,
  3336. is_mobile: m.isMobile(),
  3337. iframe: m.inIframe(),
  3338. aspect_ratio: m.aspectRatio(),
  3339. session_id: F,
  3340. window: {
  3341. width: $("#player").width(),
  3342. height: $("#player").height()
  3343. },
  3344. platform: {
  3345. browser: {
  3346. name: $.ua.browser.name,
  3347. major: $.ua.browser.major,
  3348. version: $.ua.browser.version
  3349. },
  3350. os: {
  3351. name: $.ua.os.name,
  3352. version: $.ua.os.version
  3353. },
  3354. device: {
  3355. vendor: $.ua.device.vendor,
  3356. model: $.ua.device.model,
  3357. type: $.ua.device.type
  3358. }
  3359. }
  3360. },
  3361. D = Math.random() < A.analytics.sessionTrackingRate,
  3362. P.debug("tracking sample rate = " + A.analytics.sessionTrackingRate),
  3363. void P.debug("tracking this session = " + D)) : void P.warn("no segment token")
  3364. },
  3365. sessionStart: function(e) {
  3366. P.debug("analytics user_session_start"),
  3367. c("session_started"),
  3368. N = Date.now(),
  3369. window.addEventListener("unload", function() {
  3370. h("session_ended", {
  3371. duration: Date.now() - N
  3372. })
  3373. })
  3374. },
  3375. modelLoaded: function(e, t, i, n) {
  3376. r(e, t, i, n)
  3377. },
  3378. loadComplete: function(e) {
  3379. var t = {
  3380. time_to_app_start: e
  3381. };
  3382. c("load_times", t)
  3383. },
  3384. track: function(e, t) {
  3385. D && (P.debug('analytics.track("' + e + '", ' + JSON.stringify(t) + " )"),
  3386. c(e, t))
  3387. },
  3388. trackAlways: function(e, t) {
  3389. P.debug('analytics.trackAlways("' + e + '", ' + JSON.stringify(t) + " )"),
  3390. c(e, t)
  3391. },
  3392. getSessionId: function() {
  3393. return F
  3394. },
  3395. updateInteraction: d
  3396. }
  3397. }
  3398. ).call(this, "/js/analytics.js")
  3399. }
  3400. , {
  3401. "./ab": 3,
  3402. "./enum/ControlEvents": 21,
  3403. "./enum/PlayerEvents": 40,
  3404. "./enum/VROption": 47,
  3405. "./enum/VRPlatforms": 49,
  3406. "./enum/Viewmode": 51,
  3407. "./gui/sharing/ShareEvents": 76,
  3408. "./gui/sharing/modal": 77,
  3409. "./gui/title/TitleEvents": 80,
  3410. "./gui/title/titleBar": 82,
  3411. "./gui/vr/vrEvent": 85,
  3412. "./gui/vr/vrModal": 87,
  3413. "./localization/localize": 108,
  3414. "./tag/Billboard/BillboardEvent": 120,
  3415. "./settings": 166,
  3416. "./util/ajax": 181,
  3417. "./util/browser": 182,
  3418. "./util/common": 185,
  3419. "./util/logger": 189,
  3420. three: 217
  3421. }],
  3422. 5: [function(e, t, i) {
  3423. "use strict";
  3424. function n() {
  3425. r.PerspectiveCamera.call(this, a.clampVFOV(o.dollhouseFOV), $("#player").width() / $("#player").height(), o.dollhouseNear, o.dollhouseFar),
  3426. this.controls = null
  3427. }
  3428. var r = e("three")
  3429. , o = e("../constants")
  3430. , a = e("../util/cameraLight");
  3431. n.prototype = Object.create(r.PerspectiveCamera.prototype),
  3432. n.prototype.updateAspect = function(e) {
  3433. this.aspect = e,
  3434. this.updateProjectionMatrix()
  3435. }
  3436. ,
  3437. t.exports = n
  3438. }
  3439. , {
  3440. "../constants": 8,
  3441. "../util/cameraLight": 184,
  3442. three: 217
  3443. }],
  3444. 6: [function(e, t, i) {
  3445. "use strict";
  3446. function n() {
  3447. var e = $("#player").width() / $("#player").height();
  3448. r.OrthographicCamera.call(this, -o.orthoBase, o.orthoBase, o.orthoBase / e, -o.orthoBase / e, o.orthoNear, o.orthoFar),
  3449. this.controls = null,
  3450. this.updateAspect(e)
  3451. }
  3452. var r = e("three")
  3453. , o = e("../constants");
  3454. n.prototype = Object.create(r.OrthographicCamera.prototype),
  3455. n.prototype.updateAspect = function(e) {
  3456. this.aspect = e,
  3457. this.top = o.orthoBase / e,
  3458. this.bottom = -o.orthoBase / e,
  3459. this.updateProjectionMatrix()
  3460. }
  3461. ,
  3462. t.exports = n
  3463. }
  3464. , {
  3465. "../constants": 8,
  3466. three: 217
  3467. }],
  3468. 7: [function(e, t, i) {
  3469. "use strict";
  3470. function n() {
  3471. r.PerspectiveCamera.call(this, a.clampVFOV(o.insideFOV), $("#player").width() / $("#player").height(), o.insideNear, o.insideFar),
  3472. this.controls = null
  3473. }
  3474. var r = e("three")
  3475. , o = e("../settings")
  3476. , a = e("../util/cameraLight");
  3477. n.prototype = Object.create(r.PerspectiveCamera.prototype),
  3478. n.prototype.updateAspect = function(e) {
  3479. this.aspect = e,
  3480. this.updateProjectionMatrix()
  3481. }
  3482. ,
  3483. t.exports = n
  3484. }
  3485. , {
  3486. "../settings": 166,
  3487. "../util/cameraLight": 184,
  3488. three: 217
  3489. }],
  3490. 8: [function(e, t, i) {
  3491. "use strict";
  3492. t.exports = {
  3493. signedUrlDefaultExpireTime: 24e4,
  3494. signedUrlCheckInterval: 1e4,
  3495. signedUrlRefreshBuffer: 15e3,
  3496. dollhouseFOV: 70,
  3497. dollhouseNear: 1,
  3498. dollhouseFar: 5e3,
  3499. insideFOV: 70,
  3500. insideFOVMax: 120,
  3501. insideNear: .1,
  3502. insideFar: 5e3,
  3503. insideLookSpeed: .12,
  3504. insideLookLimitUp: 40,
  3505. insideLookLimitDown: -40,
  3506. orthoNear: 1,
  3507. orthoFar: 5e3,
  3508. orthoBase: 10,
  3509. narrowLandscapeHeight: 290,
  3510. reallyNarrowLandscapeHeight: 250,
  3511. visionTilingStartDate: new Date("8/26/2016"),
  3512. visionTilingStartVersion: "1.1.407.13667",
  3513. windowHeightHighQualityThreshold: 900,
  3514. tourStepDelayDefault: 3500,
  3515. tourStepDelaySlideShow: 5e3,
  3516. workshopApsect: 9 / 16,
  3517. highQualityMaxZoom: 2,
  3518. ultraHighQualityMaxZoom: 3
  3519. }
  3520. }
  3521. , {}],
  3522. 9: [function(e, t, i) {
  3523. "use strict";
  3524. function n() {
  3525. this.activeControl = null,
  3526. this.controls = {},
  3527. this.cameras = {}
  3528. }
  3529. var r = e("./PanoramaControls")
  3530. , o = e("./DollhouseControls")
  3531. , a = e("./FloorplanControls")
  3532. , s = e("../cameras/PanoramaCamera")
  3533. , l = e("../cameras/DollhouseCamera")
  3534. , c = e("../cameras/FloorplanCamera")
  3535. , h = e("events").EventEmitter
  3536. , u = e("../enum/ControlEvents")
  3537. , d = e("../enum/ModelManagerEvents")
  3538. , p = e("../enum/Viewmode")
  3539. , f = e("../settings");
  3540. n.prototype = Object.create(h.prototype),
  3541. n.prototype.init = function(e, t) {
  3542. this.setUpControls(),
  3543. this.bindEvents(e, t)
  3544. }
  3545. ,
  3546. n.prototype.activateControls = function(e) {
  3547. this.activeControl && (this.activeControl.reset(),
  3548. this.activeControl.enabled = !1),
  3549. this.controls[e] && (this.controls[e].enabled = !0),
  3550. this.activeControl = this.controls[e]
  3551. }
  3552. ,
  3553. n.prototype.setUpControls = function() {
  3554. var e = {}
  3555. , t = {}
  3556. , i = [p.PANORAMA, p.DOLLHOUSE, p.FLOORPLAN]
  3557. , n = [s, l, c]
  3558. , h = [r, o, a];
  3559. i.forEach(function(i, r) {
  3560. e[i] = new n[r],
  3561. t[i] = new h[r](e[i]),
  3562. t[i].on(u.Move, this.emit.bind(this, u.Move)),
  3563. t[i].on(u.InputStart, this.emit.bind(this, u.InputStart)),
  3564. t[i].on(u.InteractionDirect, this.emit.bind(this, u.InteractionDirect)),
  3565. t[i].on(u.InteractionKey, this.emit.bind(this, u.InteractionKey)),
  3566. t[i].on(u.Pinch, this.emit.bind(this, u.Pinch)),
  3567. t[i].on(u.Scroll, this.emit.bind(this, u.Scroll))
  3568. }
  3569. .bind(this)),
  3570. this.controls = t,
  3571. this.cameras = e
  3572. }
  3573. ,
  3574. n.prototype.bindEvents = function(e, t) {
  3575. e.addEventListener("mousemove", this.onMouseMove.bind(this)),
  3576. e.addEventListener("mousedown", this.onMouseDown.bind(this)),
  3577. e.addEventListener("mouseup", this.onMouseUp.bind(this)),
  3578. e.addEventListener("mouseover", this.onMouseOver.bind(this)),
  3579. f.useWheel && (e.addEventListener("mousewheel", this.onMouseWheel.bind(this),{ passive: false }),
  3580. e.addEventListener("DOMMouseScroll", this.onMouseWheel.bind(this))),
  3581. e.addEventListener("touchstart", this.onTouchStart.bind(this)),
  3582. e.addEventListener("touchmove", this.onTouchMove.bind(this)),
  3583. e.addEventListener("touchend", this.onTouchEnd.bind(this)),
  3584. e.addEventListener("contextmenu", function(e) {
  3585. e.preventDefault()
  3586. }),
  3587. e.addEventListener("pointerdown", this.onPointerDown.bind(this)),
  3588. e.addEventListener("pointermove", this.onPointerMove.bind(this)),
  3589. e.addEventListener("pointerup", this.onPointerUp.bind(this)),
  3590. e.addEventListener("pointerout", this.onPointerCancel.bind(this)),
  3591. e.addEventListener("pointercancel", this.onPointerCancel.bind(this)),
  3592. document.addEventListener("keydown", this.onKeyDown.bind(this)),
  3593. document.addEventListener("keyup", this.onKeyUp.bind(this)),
  3594. t.on(d.ActiveModelChanged, function(e) {
  3595. this.setModelForControls(e.model)
  3596. }
  3597. .bind(this))
  3598. }
  3599. ,
  3600. n.prototype.setModelForControls = function(e) {
  3601. this.controls[p.DOLLHOUSE].setZoomBounds(e.boundingBox);
  3602. var t = e.boundingBox.clone().expandByScalar(f.modelBoundsPadding);
  3603. [p.DOLLHOUSE, p.FLOORPLAN].forEach(function(e) {
  3604. this.controls[e].setBounds(t)
  3605. }
  3606. .bind(this))
  3607. }
  3608. ,
  3609. n.prototype.onMouseDown = function(e) {
  3610. e.preventDefault(),
  3611. this.activeControl && this.activeControl.onMouseDown(e)
  3612. }
  3613. ,
  3614. n.prototype.onMouseMove = function(e) {
  3615. e.preventDefault(),
  3616. this.activeControl && this.activeControl.onMouseMove(e)
  3617. }
  3618. ,
  3619. n.prototype.onMouseUp = function(e) {
  3620. e.preventDefault(),
  3621. this.activeControl && this.activeControl.onMouseUp(e)
  3622. }
  3623. ,
  3624. n.prototype.onMouseOver = function(e) {
  3625. e.preventDefault(),
  3626. this.activeControl && this.activeControl.onMouseOver(e)
  3627. }
  3628. ,
  3629. n.prototype.onMouseWheel = function(e) {
  3630. e.preventDefault(),
  3631. this.activeControl && this.activeControl.onMouseWheel(e)
  3632. }
  3633. ,
  3634. n.prototype.onTouchStart = function(e) {
  3635. e.preventDefault(),
  3636. this.activeControl && this.activeControl.onTouchStart(e);
  3637. var hotList = $('#hotListWrap')[0];
  3638. hotList.classList.remove('hotListActive');
  3639. $('#hotListContent ul .active').removeClass('active');
  3640. $('#hotList')[0].classList.remove('active')
  3641. }
  3642. ,
  3643. n.prototype.onTouchMove = function(e) {
  3644. e.preventDefault(),
  3645. this.activeControl && this.activeControl.onTouchMove(e)
  3646. }
  3647. ,
  3648. n.prototype.onTouchEnd = function(e) {
  3649. e.preventDefault(),
  3650. this.activeControl && this.activeControl.onTouchEnd(e)
  3651. }
  3652. ,
  3653. n.prototype.onPointerDown = function(e) {
  3654. if (e.preventDefault(),
  3655. this.activeControl)
  3656. switch (e.pointerType) {
  3657. case "mouse":
  3658. this.activeControl.onMouseDown(e);
  3659. break;
  3660. default:
  3661. this.activeControl.onPointerDown(e)
  3662. }
  3663. }
  3664. ,
  3665. n.prototype.onPointerMove = function(e) {
  3666. if (e.preventDefault(),
  3667. this.activeControl)
  3668. switch (e.pointerType) {
  3669. case "mouse":
  3670. this.activeControl.onMouseMove(e);
  3671. break;
  3672. default:
  3673. this.activeControl.onPointerMove(e)
  3674. }
  3675. }
  3676. ,
  3677. n.prototype.onPointerUp = function(e) {
  3678. if (e.preventDefault(),
  3679. this.activeControl)
  3680. switch (e.pointerType) {
  3681. case "mouse":
  3682. this.activeControl.onMouseUp(e);
  3683. break;
  3684. default:
  3685. this.activeControl.onPointerUp(e)
  3686. }
  3687. }
  3688. ,
  3689. n.prototype.onPointerCancel = function(e) {
  3690. e.preventDefault(),
  3691. this.activeControl && "mouse" !== e.pointerType && this.activeControl.onPointerUp(e)
  3692. }
  3693. ,
  3694. n.prototype.onKeyDown = function(e) {
  3695. e.metaKey || e.ctrlKey || (e.preventDefault(),
  3696. this.activeControl && this.activeControl.onKeyDown(e))
  3697. }
  3698. ,
  3699. n.prototype.onKeyUp = function(e) {
  3700. e.preventDefault(),
  3701. this.activeControl && this.activeControl.onKeyUp(e)
  3702. }
  3703. ,
  3704. t.exports = n
  3705. }
  3706. , {
  3707. "../cameras/DollhouseCamera": 5,
  3708. "../cameras/FloorplanCamera": 6,
  3709. "../cameras/PanoramaCamera": 7,
  3710. "../enum/ControlEvents": 21,
  3711. "../enum/ModelManagerEvents": 33,
  3712. "../enum/Viewmode": 51,
  3713. "../settings": 166,
  3714. "./DollhouseControls": 10,
  3715. "./FloorplanControls": 11,
  3716. "./PanoramaControls": 13,
  3717. events: 202
  3718. }],
  3719. 10: [function(e, t, i) {
  3720. "use strict";
  3721. function n(e) {
  3722. a.call(this, e),
  3723. this.minPolarAngle = o.dollhouseDefault.minPolarAngle,
  3724. this.maxPolarAngle = o.dollhouseDefault.maxPolarAngle,
  3725. this.minDistance = o.dollhouseDefault.minDistance,
  3726. this.maxDistance = o.dollhouseDefault.maxDistance,
  3727. this.adjustedMinDistance = this.minDistance,
  3728. this.adjustedMaxDistance = this.maxDistance
  3729. }
  3730. var r = e("three")
  3731. , o = e("../settings")
  3732. , a = e("./OutsideControls");
  3733. n.prototype = Object.create(a.prototype),
  3734. n.prototype.pan = function(e, t) {
  3735. this.camera.updateMatrix();
  3736. var i = this.camera.position.clone().sub(this.target).length();
  3737. i *= Math.tan(this.camera.fov / 2 * Math.PI / 180),
  3738. this.panLeft(2 * e * i / $("#player").height()),
  3739. this.panUp(-2 * t * i / $("#player").height())
  3740. }
  3741. ,
  3742. n.prototype.updateZoom = function() {
  3743. var e = this.offset.length();
  3744. return e * this.scale
  3745. }
  3746. ,
  3747. n.prototype.setZoomBounds = function(e) {
  3748. var t = e.min.distanceTo(e.max);
  3749. this.adjustedMinDistance = Math.max(Math.min(t / 2, o.dollhouseDefault.minDistance), 0),
  3750. this.adjustedMaxDistance = Math.min(Math.max(t, o.dollhouseDefault.maxDistance), o.skyboxRadius),
  3751. this.minDistance = this.adjustedMinDistance,
  3752. this.maxDistance = this.adjustedMaxDistance
  3753. }
  3754. ,
  3755. n.prototype.resetRanges = function(e, t) {
  3756. e ? (this.minDistance = Math.min(e, this.minDistance),
  3757. this.maxDistance = Math.max(e, this.maxDistance)) : (this.minDistance = this.adjustedMinDistance,
  3758. this.maxDistance = this.adjustedMaxDistance),
  3759. t ? (this.minPolarAngle = r.Math.degToRad(-15),
  3760. this.maxPolarAngle = r.Math.degToRad(89.9)) : (this.minPolarAngle = o.dollhouseDefault.minPolarAngle,
  3761. this.maxPolarAngle = o.dollhouseDefault.maxPolarAngle)
  3762. }
  3763. ,
  3764. n.prototype.toJSON = function() {
  3765. return a.prototype.toJSON.call(this)
  3766. }
  3767. ,
  3768. t.exports = n
  3769. }
  3770. , {
  3771. "../settings": 166,
  3772. "./OutsideControls": 12,
  3773. three: 217
  3774. }],
  3775. 11: [function(e, t, i) {
  3776. "use strict";
  3777. function n(e) {
  3778. a.call(this, e),
  3779. this.minDistance = 15,
  3780. this.maxDistance = 50,
  3781. this.noRotateUpDown = !0,
  3782. this.minPolarAngle = 0,
  3783. this.maxPolarAngle = 0,
  3784. this.mouseActions[l.LEFT] = s.PAN,
  3785. this.mouseActions[l.MIDDLE] = s.DOLLY,
  3786. this.mouseActions[l.RIGHT] = s.ROTATE,
  3787. this.touchActions[1] = s.PAN,
  3788. this.touchActions[2] = s.ROTATE_DOLLY,
  3789. this.absoluteScale = 1,
  3790. this.currentScale = 1
  3791. }
  3792. var r = e("three")
  3793. , o = e("../settings")
  3794. , a = e("./OutsideControls")
  3795. , s = e("../enum/ControlActions")
  3796. , l = e("../enum/MouseButton")
  3797. , c = e("../util/math")
  3798. , h = e("../util/browser");
  3799. n.prototype = Object.create(a.prototype),
  3800. n.prototype.zoomToContain = function(e) {
  3801. this.absoluteScale = this.getDefaultAbsoluteScale(e);
  3802. this.currentScale = this.absoluteScale
  3803. }
  3804. ,
  3805. n.prototype.getDefaultAbsoluteScale = function(modelSize) {
  3806. var t = Math.max(modelSize.x, modelSize.z)
  3807. , i = Math.min(modelSize.x, modelSize.z)
  3808. , n = Math.max(t, i * this.camera.aspect)
  3809. , r = Math.max(i, t * this.camera.aspect);
  3810. var absoluteScale = (h.aspectRatio() < 1 ? r : n) / 2 / o.orthoBase * 1.2
  3811. return absoluteScale
  3812. },
  3813. n.prototype.rotateToView = function(e, t) {
  3814. var i = 0
  3815. , n = h.aspectRatio() < 1
  3816. , r = e.x < e.z;
  3817. n === r ? t.z > 0 && (i = Math.PI) : i = t.x > 0 ? Math.PI / 2 : -Math.PI / 2,
  3818. this.rotateLeft(i),
  3819. this.update(0)
  3820. }
  3821. ,
  3822. n.prototype.pan = function(e, t) {
  3823. this.camera.updateMatrix(),
  3824. this.panLeft(e * (this.camera.right - this.camera.left) / $("#player").width()),
  3825. this.panUp(-t * (this.camera.top - this.camera.bottom) / $("#player").height())
  3826. }
  3827. ,
  3828. n.prototype.updateZoom = function() {
  3829. return this.absoluteScale *= this.scale - .03 * this.keyboardZoomSpeed,
  3830. this.absoluteScale = Math.max(o.zoomNearLimit, Math.min(this.absoluteScale, o.zoomFarLimit)),
  3831. this.currentScale = .8 * this.currentScale + .2 * this.absoluteScale,
  3832. this.camera.left = -o.orthoBase * this.currentScale,
  3833. this.camera.right = o.orthoBase * this.currentScale,
  3834. this.camera.top = o.orthoBase * this.currentScale / this.camera.aspect,
  3835. this.camera.bottom = -o.orthoBase * this.currentScale / this.camera.aspect,
  3836. this.camera.updateProjectionMatrix(),
  3837. this.offset.length()
  3838. }
  3839. ,
  3840. n.prototype.toJSON = function() {
  3841. var e = new r.Quaternion
  3842. , t = (new r.Quaternion).setFromAxisAngle(new r.Vector3(0,1,0), r.Math.degToRad(90))
  3843. , i = new r.Quaternion;
  3844. return function() {
  3845. var n = a.prototype.toJSON.call(this);
  3846. return e.copy(n.camera_quaternion),
  3847. i.copy(t),
  3848. i.multiply(e),
  3849. n.camera_quaternion.x = c.toPrecision(i.x, 4),
  3850. n.camera_quaternion.y = c.toPrecision(i.y, 4),
  3851. n.camera_quaternion.z = c.toPrecision(i.z, 4),
  3852. n.camera_quaternion.w = c.toPrecision(i.w, 4),
  3853. n.ortho_zoom = c.toPrecision(this.currentScale * this.camera.aspect, 4),
  3854. n
  3855. }
  3856. }(),
  3857. t.exports = n
  3858. }
  3859. , {
  3860. "../enum/ControlActions": 20,
  3861. "../enum/MouseButton": 34,
  3862. "../settings": 166,
  3863. "../util/browser": 182,
  3864. "../util/math": 190,
  3865. "./OutsideControls": 12,
  3866. three: 217
  3867. }],
  3868. 12: [function(e, t, i) {
  3869. "use strict";
  3870. function n(e) {
  3871. this.camera = e,
  3872. this.camera.controls = this,
  3873. this.enabled = !1,
  3874. this.target = new r.Vector3,
  3875. this.targetBounds = new r.Box3,
  3876. this.zoomSpeed = 1,
  3877. this.minDistance = 0,
  3878. this.maxDistance = 1 / 0,
  3879. this.noRotateUpDown = !1,
  3880. this.rotateSpeed = 1,
  3881. this.keyboardZoomSpeed = 0,
  3882. this.keyPanSpeed = 7,
  3883. this.autoRotate = !1,
  3884. this.autoRotateSpeed = 2,
  3885. this.autoPan = !1,
  3886. this.autoPanPosition = new r.Vector3,
  3887. this.minPolarAngle = r.Math.degToRad(25),
  3888. this.maxPolarAngle = r.Math.degToRad(65),
  3889. this.rotationAcceleration = new r.Vector2,
  3890. this.rotationSpeed = new r.Vector2,
  3891. this.panAcceleration = new r.Vector2,
  3892. this.panSpeed = new r.Vector2,
  3893. this.rotateStart = new r.Vector2,
  3894. this.rotateEnd = new r.Vector2,
  3895. this.rotateDelta = new r.Vector2,
  3896. this.panStart = new r.Vector2,
  3897. this.panEnd = new r.Vector2,
  3898. this.panDelta = new r.Vector2,
  3899. this.panOffset = new r.Vector3,
  3900. this.offset = new r.Vector3,
  3901. this.dollyStart = new r.Vector2,
  3902. this.dollyEnd = new r.Vector2,
  3903. this.dollyDelta = new r.Vector2,
  3904. this.phiDelta = 0,
  3905. this.thetaDelta = 0,
  3906. this.scale = 1,
  3907. this.panVector = new r.Vector3,
  3908. this.lastPosition = new r.Vector3,
  3909. this.state = c.NONE,
  3910. this.mouseActions = {},
  3911. this.mouseActions[h.LEFT] = c.ROTATE,
  3912. this.mouseActions[h.MIDDLE] = c.DOLLY,
  3913. this.mouseActions[h.RIGHT] = c.PAN,
  3914. this.touchActions = {},
  3915. this.touchActions[1] = c.ROTATE,
  3916. this.touchActions[2] = c.PAN_DOLLY,
  3917. this.lastMoveTime = 0,
  3918. this.pointersLimit = 2,
  3919. this.pointers = []
  3920. }
  3921. var r = e("three")
  3922. , o = e("../settings")
  3923. , a = e("../util/common")
  3924. , s = e("../util/math")
  3925. , l = e("../enum/Vectors")
  3926. , c = e("../enum/ControlActions")
  3927. , h = e("../enum/MouseButton")
  3928. , u = e("../enum/Keys")
  3929. , d = e("../enum/ControlEvents")
  3930. , p = e("events").EventEmitter
  3931. , f = 1e-6;
  3932. n.prototype = Object.create(p.prototype),
  3933. n.prototype.setBounds = function(e) {
  3934. this.targetBounds = e
  3935. }
  3936. ,
  3937. n.prototype.isEngaged = function() {
  3938. return this.state !== c.NONE
  3939. }
  3940. ,
  3941. n.prototype.rotateLeft = function(e) {
  3942. void 0 === e && (e = this.getAutoRotationAngle()),
  3943. this.thetaDelta -= e
  3944. }
  3945. ,
  3946. n.prototype.rotateUp = function(e) {
  3947. this.noRotateUpDown || (void 0 === e && (e = this.getAutoRotationAngle()),
  3948. this.phiDelta -= e)
  3949. }
  3950. ,
  3951. n.prototype.panLeft = function(e) {
  3952. var t = this.camera.matrix.elements;
  3953. this.panOffset.set(t[0], 0, t[2]).normalize(),
  3954. this.panOffset.multiplyScalar(-e),
  3955. this.panVector.add(this.panOffset)
  3956. }
  3957. ,
  3958. n.prototype.panUp = function(e) {
  3959. var t = this.camera.matrix.elements;
  3960. this.panOffset.set(t[4], 0, t[6]).normalize(),
  3961. this.panOffset.multiplyScalar(-e),
  3962. this.panVector.add(this.panOffset)
  3963. }
  3964. ,
  3965. n.prototype.startRotating = function(e, t) {
  3966. e && this.navRotationAcc("x", e),
  3967. t && this.navRotationAcc("y", t)
  3968. }
  3969. ,
  3970. n.prototype.stopRotating = function(e) {
  3971. e && (this.rotationSpeed.x = this.rotationSpeed.y = 0),
  3972. this.navRotationAcc("x", 0),
  3973. this.navRotationAcc("y", 0)
  3974. }
  3975. ,
  3976. n.prototype.setAutoPanPosition = function(e, t) {
  3977. var i = new r.Vector3
  3978. , n = new r.Vector3;
  3979. return function(e, t) {
  3980. i.copy(this.camera.position),
  3981. void 0 === e && null === e || i.setX(e),
  3982. void 0 === t && null === t || i.setZ(t);
  3983. var r = this.camera.position.distanceTo(this.target)
  3984. , o = l.FORWARD.clone().applyQuaternion(this.camera.quaternion);
  3985. this.targetClamped = !1,
  3986. n.copy(i).addScaledVector(o, r),
  3987. this.targetBounds.containsPoint(n) || (this.targetBounds.clampPoint(n, n),
  3988. i.copy(n).addScaledVector(o, -r),
  3989. this.targetClamped = !0),
  3990. this.autoPanPosition.x = i.x,
  3991. this.autoPanPosition.z = i.z,
  3992. this.autoPan && this.stopAutoPanning()
  3993. }
  3994. }(),
  3995. n.prototype.stopAutoPanning = function() {
  3996. var e = this.autoPan;
  3997. this.autoPan = !1,
  3998. this.emit(this.targetClamped ? d.AutoPanClamped : e ? d.AutoPanInterrupt : d.AutoPanComplete)
  3999. }
  4000. ,
  4001. n.prototype.dollyIn = function(e) {
  4002. void 0 === e && (e = this.getZoomScale()),
  4003. this.scale /= e
  4004. }
  4005. ,
  4006. n.prototype.dollyOut = function(e) {
  4007. void 0 === e && (e = this.getZoomScale()),
  4008. this.scale *= e
  4009. }
  4010. ,
  4011. n.prototype.updatePan = function(e) {
  4012. if (this.panSpeed.multiplyScalar(1 - o.panFriction).addScaledVector(this.panAcceleration, o.panAccelerationOutside * e),
  4013. this.pan(-this.panSpeed.x, this.panSpeed.y),
  4014. this.autoPan) {
  4015. var t = (new r.Vector3).copy(this.autoPanPosition).sub(this.camera.position);
  4016. t.setY(0).clampLength(0, 50 * e),
  4017. this.target.add(t),
  4018. this.camera.position.add(t),
  4019. this.autoPanPosition.x === this.camera.position.x && this.autoPanPosition.z === this.camera.position.z && (this.autoPan = !1,
  4020. this.stopAutoPanning())
  4021. }
  4022. }
  4023. ,
  4024. n.prototype.update = function(e) {
  4025. e || (e = 1 / 60),
  4026. this.rotationSpeed.multiplyScalar(1 - o.rotationFriction).addScaledVector(this.rotationAcceleration, o.rotationAccelerationOutside * e),
  4027. this.rotateLeft(-this.rotationSpeed.x),
  4028. this.noRotateUpDown || this.rotateUp(this.rotationSpeed.y),
  4029. this.updatePan(e);
  4030. var t = this.camera.position;
  4031. this.offset.copy(t).sub(this.target);
  4032. var i = Math.atan2(this.offset.x, this.offset.z)
  4033. , n = Math.atan2(Math.sqrt(this.offset.x * this.offset.x + this.offset.z * this.offset.z), this.offset.y);
  4034. this.autoRotate && this.rotateLeft(this.getAutoRotationAngle()),
  4035. i += this.thetaDelta,
  4036. n += this.phiDelta,
  4037. n = Math.max(this.minPolarAngle, Math.min(this.maxPolarAngle, n)),
  4038. n = Math.max(f, Math.min(Math.PI - f, n));
  4039. var r = this.updateZoom();
  4040. r = Math.max(this.minDistance, Math.min(this.maxDistance, r)),
  4041. this.target.add(this.panVector),
  4042. this.targetBounds.clampPoint(this.target, this.target),
  4043. this.offset.x = r * Math.sin(n) * Math.sin(i),
  4044. this.offset.y = r * Math.cos(n),
  4045. this.offset.z = r * Math.sin(n) * Math.cos(i),
  4046. t.copy(this.target).add(this.offset),
  4047. this.camera.lookAt(this.target),
  4048. this.thetaDelta = 0,
  4049. this.phiDelta = 0,
  4050. this.scale = 1,
  4051. this.panVector.set(0, 0, 0),
  4052. this.lastPosition.distanceTo(this.camera.position) > 0 && this.lastPosition.copy(this.camera.position)
  4053. }
  4054. ,
  4055. n.prototype.getAutoRotationAngle = function() {
  4056. return 2 * Math.PI / 60 / 60 * this.autoRotateSpeed
  4057. }
  4058. ,
  4059. n.prototype.getZoomScale = function() {
  4060. return Math.pow(.95, this.zoomSpeed)
  4061. }
  4062. ,
  4063. n.prototype.onMouseDown = function(e) {
  4064. if (this.enabled) {
  4065. switch (e.preventDefault(),
  4066. this.stopAutoPanning(),
  4067. this.mouseDown = !0,
  4068. this.state = this.mouseActions[e.button],
  4069. this.state) {
  4070. case c.ROTATE:
  4071. this.rotateStart.set(e.clientX, this.noRotateUpDown ? 0 : e.clientY),
  4072. this.rotationSpeed.set(0, 0);
  4073. break;
  4074. case c.DOLLY:
  4075. this.dollyStart.set(e.clientX, e.clientY);
  4076. break;
  4077. case c.PAN:
  4078. this.panStart.set(e.clientX, e.clientY)
  4079. }
  4080. this.emit(d.InputStart, "mouse")
  4081. }
  4082. }
  4083. ,
  4084. n.prototype.onMouseMove = function(e) {
  4085. if (this.enabled && this.mouseDown && 0 !== e.buttons) {
  4086. switch (e.preventDefault(),
  4087. this.state) {
  4088. case c.ROTATE:
  4089. this.rotateEnd.set(e.clientX, this.noRotateUpDown ? 0 : e.clientY),
  4090. this.rotateDelta.subVectors(this.rotateEnd, this.rotateStart),
  4091. this.rotateLeft(2 * Math.PI * this.rotateDelta.x / $("#player").width() * this.rotateSpeed),
  4092. this.rotateUp(2 * Math.PI * this.rotateDelta.y / $("#player").height() * this.rotateSpeed),
  4093. this.rotateStart.copy(this.rotateEnd);
  4094. break;
  4095. case c.DOLLY:
  4096. this.dollyEnd.set(e.clientX, e.clientY),
  4097. this.dollyDelta.subVectors(this.dollyEnd, this.dollyStart);
  4098. var t = this.dollyDelta.y > 0 ? this.dollyIn : this.dollyOut;
  4099. t.call(this),
  4100. this.dollyStart.copy(this.dollyEnd);
  4101. break;
  4102. case c.PAN:
  4103. this.panEnd.set(e.clientX, e.clientY),
  4104. this.panDelta.subVectors(this.panEnd, this.panStart),
  4105. this.pan(this.panDelta.x, this.panDelta.y),
  4106. this.panStart.copy(this.panEnd)
  4107. }
  4108. this.emit(d.Move, "mouse"),
  4109. this.lastMoveTime = e.timeStamp,
  4110. this.update()
  4111. }
  4112. }
  4113. ,
  4114. n.prototype.onMouseUp = function(e) {
  4115. this.enabled && (this.mouseDown = !1,
  4116. this.state = c.NONE,
  4117. "mouseover" !== e.type && (e.timeStamp > this.lastMoveTime + 100 ? (this.rotationSpeed.set(0, 0),
  4118. this.rotationAcceleration.set(0, 0)) : this.rotationAcceleration.set(-this.rotateDelta.x, this.rotateDelta.y),
  4119. this.update(),
  4120. this.rotationAcceleration.set(0, 0),
  4121. this.rotateDelta.set(0, 0)))
  4122. }
  4123. ,
  4124. n.prototype.onMouseOver = function(e) {
  4125. 0 !== e.which && 0 !== e.buttons || this.onMouseUp(e)
  4126. }
  4127. ,
  4128. n.prototype.onMouseWheel = function(e) {
  4129. if (this.enabled && o.useWheel) {
  4130. this.emit(d.Move, "wheel");
  4131. var t = e.wheelDelta || -e.detail
  4132. , i = t > 0 ? this.dollyOut : this.dollyIn;
  4133. i.call(this),
  4134. this.update()
  4135. }
  4136. }
  4137. ,
  4138. n.prototype.onKeyDown = function(e) {
  4139. this.enabled && (e.metaKey || e.ctrlKey || (e.preventDefault(),
  4140. this.handleKeyDown(e.which)))
  4141. }
  4142. ,
  4143. n.prototype.navRotationAcc = function(e, t) {
  4144. "y" === e ? this.noRotateUpDown ? this.keyboardZoomSpeed = t : this.rotationAcceleration.y = t : this.rotationAcceleration.x = t
  4145. }
  4146. ,
  4147. n.prototype.navPanAcc = function(e, t) {
  4148. this.stopAutoPanning(),
  4149. this.panAcceleration[e] = t
  4150. }
  4151. ,
  4152. n.prototype.handleKeyDown = function(e) {
  4153. var t = !0;
  4154. switch (e) {
  4155. case u.UPARROW:
  4156. case u.I:
  4157. this.navRotationAcc("y", 1);
  4158. break;
  4159. case u.DOWNARROW:
  4160. case u.K:
  4161. this.navRotationAcc("y", -1);
  4162. break;
  4163. case u.LEFTARROW:
  4164. case u.J:
  4165. this.navRotationAcc("x", -1);
  4166. break;
  4167. case u.RIGHTARROW:
  4168. case u.L:
  4169. this.navRotationAcc("x", 1);
  4170. break;
  4171. case u.W:
  4172. this.navPanAcc("y", 1);
  4173. break;
  4174. case u.S:
  4175. this.navPanAcc("y", -1);
  4176. break;
  4177. case u.A:
  4178. this.navPanAcc("x", -1);
  4179. break;
  4180. case u.D:
  4181. this.navPanAcc("x", 1);
  4182. break;
  4183. default:
  4184. t = !1
  4185. }
  4186. t && this.emit(d.Move, "key")
  4187. }
  4188. ,
  4189. n.prototype.onKeyUp = function(e) {
  4190. this.enabled && (e.preventDefault(),
  4191. e.stopPropagation(),
  4192. this.handleKeyUp(e.which))
  4193. }
  4194. ,
  4195. n.prototype.handleKeyUp = function(e) {
  4196. switch (e) {
  4197. case u.I:
  4198. case u.K:
  4199. case u.UPARROW:
  4200. case u.DOWNARROW:
  4201. this.keyboardZoomSpeed = 0,
  4202. this.rotationAcceleration.y = 0;
  4203. break;
  4204. case u.J:
  4205. case u.L:
  4206. case u.LEFTARROW:
  4207. case u.RIGHTARROW:
  4208. this.rotationAcceleration.x = 0;
  4209. break;
  4210. case u.S:
  4211. case u.W:
  4212. this.panAcceleration.y = 0;
  4213. break;
  4214. case u.A:
  4215. case u.D:
  4216. this.panAcceleration.x = 0
  4217. }
  4218. }
  4219. ,
  4220. n.prototype.onTouchStart = function(e) {
  4221. if (this.enabled || this.state === c.NONE) {
  4222. e.preventDefault(),
  4223. e.stopPropagation(),
  4224. this.stopAutoPanning();
  4225. var t = function() {
  4226. if (2 === e.touches.length) {
  4227. var t = e.touches[0].pageX - e.touches[1].pageX
  4228. , i = e.touches[0].pageY - e.touches[1].pageY;
  4229. this.dollyStart.set(t, i)
  4230. }
  4231. }
  4232. .bind(this)
  4233. , i = function() {
  4234. this.panStart.set(a.average(e.touches, "pageX"), a.average(e.touches, "pageY"))
  4235. }
  4236. .bind(this)
  4237. , n = function() {
  4238. this.rotateStart.set(a.average(e.touches, "pageX"), a.average(e.touches, "pageY"))
  4239. }
  4240. .bind(this);
  4241. switch (this.state = this.touchActions[e.touches.length],
  4242. this.state) {
  4243. case c.PAN_DOLLY:
  4244. t();
  4245. case c.PAN:
  4246. i();
  4247. break;
  4248. case c.ROTATE_DOLLY:
  4249. t();
  4250. case c.ROTATE:
  4251. n()
  4252. }
  4253. this.rotationSpeed.set(0, 0),
  4254. this.emit(d.InputStart, "touch")
  4255. }
  4256. }
  4257. ,
  4258. n.prototype.onTouchMove = function(e) {
  4259. if (this.enabled && this.state !== c.NONE) {
  4260. e.preventDefault(),
  4261. e.stopPropagation();
  4262. var t = function() {
  4263. var t = e.touches[0].pageX - e.touches[1].pageX
  4264. , i = e.touches[0].pageY - e.touches[1].pageY;
  4265. this.dollyEnd.set(t, i);
  4266. var n = this.dollyStart.length() - this.dollyEnd.length();
  4267. n > 0 ? this.dollyOut(1 + n / 500) : this.dollyIn(1 - n / 500),
  4268. this.dollyStart.copy(this.dollyEnd)
  4269. }
  4270. .bind(this)
  4271. , i = function() {
  4272. this.panEnd.set(a.average(e.touches, "pageX"), a.average(e.touches, "pageY")),
  4273. this.panDelta.subVectors(this.panEnd, this.panStart),
  4274. this.pan(this.panDelta.x, this.panDelta.y),
  4275. this.panStart.copy(this.panEnd),
  4276. this.rotateDelta.set(0, 0)
  4277. }
  4278. .bind(this)
  4279. , n = function() {
  4280. this.rotateEnd.set(a.average(e.touches, "pageX"), a.average(e.touches, "pageY")),
  4281. this.rotateDelta.subVectors(this.rotateEnd, this.rotateStart),
  4282. this.rotateLeft(2 * Math.PI * this.rotateDelta.x / $("#player").width() * this.rotateSpeed),
  4283. this.rotateUp(2 * Math.PI * this.rotateDelta.y / $("#player").height() * this.rotateSpeed),
  4284. this.rotateStart.copy(this.rotateEnd)
  4285. }
  4286. .bind(this)
  4287. , r = function() {
  4288. if (2 === e.touches.length) {
  4289. var i = window.devicePixelRatio || 1
  4290. , r = e.touches[1].pageX - e.touches[0].pageX
  4291. , s = e.touches[1].pageY - e.touches[0].pageY
  4292. , l = Math.sqrt(r * r + s * s)
  4293. , h = Math.abs(this.dollyStart.length() - l);
  4294. if (h > o.input.touchMoveThreshold * i)
  4295. this.state = c.DOLLY,
  4296. t();
  4297. else {
  4298. var u = a.average(e.touches, "pageX")
  4299. , d = a.average(e.touches, "pageY")
  4300. , p = this.rotateDelta.set(u, d).sub(this.rotateStart).length();
  4301. p > o.input.touchMoveThreshold && (this.state = c.ROTATE,
  4302. this.rotateStart.set(u, d),
  4303. n())
  4304. }
  4305. }
  4306. }
  4307. .bind(this);
  4308. switch (this.state) {
  4309. case c.PAN_DOLLY:
  4310. t();
  4311. case c.PAN:
  4312. i();
  4313. break;
  4314. case c.ROTATE_DOLLY:
  4315. r();
  4316. break;
  4317. case c.DOLLY:
  4318. t();
  4319. break;
  4320. case c.ROTATE:
  4321. n();
  4322. break;
  4323. default:
  4324. this.state = c.NONE
  4325. }
  4326. this.lastMoveTime = e.timeStamp,
  4327. this.emit(d.Move, "touch")
  4328. }
  4329. }
  4330. ,
  4331. n.prototype.onTouchEnd = function(e) {
  4332. this.enabled && (this.state === c.ROTATE && (e.timeStamp > this.lastMoveTime + 100 ? (this.rotationSpeed.set(0, 0),
  4333. this.rotationAcceleration.set(0, 0)) : this.rotationAcceleration.set(-this.rotateDelta.x, this.rotateDelta.y)),
  4334. this.state = c.NONE,
  4335. this.update(),
  4336. this.rotationAcceleration.set(0, 0),
  4337. this.rotateDelta.set(0, 0))
  4338. }
  4339. ,
  4340. n.prototype.onPointerDown = function(e) {
  4341. this.enabled && ("touch" === e.pointerType && (this.pointers.length < this.pointersLimit && this.pointers.push({
  4342. id: e.pointerId,
  4343. pageX: e.pageX,
  4344. pageY: e.pageY
  4345. }),
  4346. e.touches = this.pointers,
  4347. this.onTouchStart(e)),
  4348. this.emit(d.InputStart, "pointer"))
  4349. }
  4350. ,
  4351. n.prototype.onPointerMove = function(e) {
  4352. this.enabled && "touch" === e.pointerType && (this.pointers.forEach(function(t) {
  4353. e.pointerId === t.id && (t.pageX = e.pageX,
  4354. t.pageY = e.pageY)
  4355. }),
  4356. e.touches = this.pointers,
  4357. this.onTouchMove(e))
  4358. }
  4359. ,
  4360. n.prototype.onPointerUp = function(e) {
  4361. this.enabled && "touch" === e.pointerType && (this.pointers.forEach(function(t, i) {
  4362. e.pointerId === t.id && this.pointers.splice(i, 1)
  4363. }
  4364. .bind(this)),
  4365. e.touches = this.pointers,
  4366. this.onTouchEnd(e))
  4367. }
  4368. ,
  4369. n.prototype.reset = function() {
  4370. this.state = c.NONE,
  4371. this.stopAutoPanning(),
  4372. this.rotationSpeed.set(0, 0),
  4373. this.rotationAcceleration.set(0, 0),
  4374. this.panSpeed.set(0, 0),
  4375. this.panAcceleration.set(0, 0)
  4376. }
  4377. ,
  4378. n.prototype.toJSON = function() {
  4379. var e = {
  4380. camera_position: {
  4381. x: s.toPrecision(this.camera.position.x, 4),
  4382. y: s.toPrecision(this.camera.position.y, 4),
  4383. z: s.toPrecision(this.camera.position.z, 4)
  4384. },
  4385. camera_quaternion: {
  4386. x: s.toPrecision(this.camera.quaternion.x, 4),
  4387. y: s.toPrecision(this.camera.quaternion.y, 4),
  4388. z: s.toPrecision(this.camera.quaternion.z, 4),
  4389. w: s.toPrecision(this.camera.quaternion.w, 4)
  4390. }
  4391. };
  4392. return e
  4393. }
  4394. ,
  4395. t.exports = n
  4396. }
  4397. , {
  4398. "../enum/ControlActions": 20,
  4399. "../enum/ControlEvents": 21,
  4400. "../enum/Keys": 30,
  4401. "../enum/MouseButton": 34,
  4402. "../enum/Vectors": 50,
  4403. "../settings": 166,
  4404. "../util/common": 185,
  4405. "../util/math": 190,
  4406. events: 202,
  4407. three: 217
  4408. }],
  4409. 13: [function(e, t, i) {
  4410. (function(i) {
  4411. "use strict";
  4412. function n(e) {
  4413. this.camera = e,
  4414. this.camera.controls = this,
  4415. this.target = new r.Vector3(0,0,0),
  4416. this.lookVector = new r.Vector3,
  4417. this.lookSpeed = .05,
  4418. this.rotationAcc = new r.Vector2,
  4419. this.rotationSpeed = new r.Vector2,
  4420. this.lat = 0,
  4421. this.lon = 0,
  4422. this.phi = 0,
  4423. this.theta = 0,
  4424. this.enabled = !1,
  4425. this.locked = !1,
  4426. this.pointer = new r.Vector2(0,0),
  4427. this.rotationHistory = [],
  4428. this.rotationDifference = new r.Vector2,
  4429. this.pointerDragOn = !1,
  4430. this.pointerDragStart = new r.Vector2(0,0),
  4431. this.pinchDistance = 0,
  4432. this.moveStart = new r.Vector2,
  4433. this.moveTolerance = .01,
  4434. this.pointersLimit = 2,
  4435. this.pointers = []
  4436. }
  4437. var r = e("three")
  4438. , o = e("../util/logger")
  4439. , a = e("../settings")
  4440. , s = e("../util/common")
  4441. , l = e("../util/math")
  4442. , c = (e("../enum/Vectors"),
  4443. e("../enum/MouseButton"))
  4444. , h = e("../enum/Keys")
  4445. , u = e("../enum/ControlEvents")
  4446. , d = e("events").EventEmitter;
  4447. new o(i);
  4448. n.prototype = Object.create(d.prototype),
  4449. n.prototype.usable = function() {
  4450. return this.enabled && !this.locked
  4451. }
  4452. ,
  4453. n.prototype.lookAt = function(e) {
  4454. var t = this.camera.position.clone().sub(e)
  4455. , i = Math.atan(t.z / t.x);
  4456. i += t.x < 0 ? Math.PI : 0,
  4457. i += t.x > 0 && t.z < 0 ? 2 * Math.PI : 0,
  4458. this.lon = r.Math.radToDeg(i) + 180;
  4459. var n = Math.sqrt(t.x * t.x + t.z * t.z)
  4460. , o = Math.atan(t.y / n);
  4461. this.lat = -r.Math.radToDeg(o)
  4462. }
  4463. ,
  4464. n.prototype.startRotationFrom = function(e, t) {
  4465. l.convertScreenPositionToNDC(e, t, this.pointer),
  4466. this.pointerDragOn = !0,
  4467. this.pointerDragStart.copy(this.pointer),
  4468. this.moveStart.copy(this.pointer),
  4469. this.rotationHistory = [],
  4470. this.rotationSpeed.set(0, 0)
  4471. }
  4472. ,
  4473. n.prototype.onMouseOver = function(e) {
  4474. !this.pointerDragOn || 0 !== e.which && 0 !== e.buttons || this.onMouseUp(e)
  4475. }
  4476. ,
  4477. n.prototype.onTouchStart = function(e) {
  4478. if (this.usable()) {
  4479. switch (e.preventDefault(),
  4480. e.stopPropagation(),
  4481. e.touches.length) {
  4482. case 1:
  4483. this.startRotationFrom(e.touches[0].clientX, e.touches[0].clientY);
  4484. break;
  4485. case 2:
  4486. var t = (e.touches[0].clientX - e.touches[1].clientX) / $("#player").width()
  4487. , i = (e.touches[0].clientY - e.touches[1].clientY) / $("#player").height();
  4488. this.pinchDistance = Math.sqrt(t * t + i * i)
  4489. }
  4490. this.emit(u.InputStart, "touch")
  4491. }
  4492. }
  4493. ,
  4494. n.prototype.onPointerDown = function(e) {
  4495. this.usable() && "touch" === e.pointerType && (this.pointers.length < this.pointersLimit && this.pointers.push({
  4496. id: e.pointerId,
  4497. clientX: e.clientX,
  4498. clientY: e.clientY
  4499. }),
  4500. e.touches = this.pointers,
  4501. this.onTouchStart(e),
  4502. this.emit(u.InputStart, "pointer"))
  4503. }
  4504. ,
  4505. n.prototype.onMouseDown = function(e) {
  4506. if (this.usable()) {
  4507. switch (e.preventDefault(),
  4508. e.stopPropagation(),
  4509. e.button) {
  4510. case c.LEFT:
  4511. this.startRotationFrom(e.clientX, e.clientY)
  4512. }
  4513. this.emit(u.InputStart, "mouse")
  4514. }
  4515. }
  4516. ,
  4517. n.prototype.updateRotation = function() {
  4518. if (this.usable() && this.pointerDragOn) {
  4519. var e = new r.Vector3(this.pointerDragStart.x,this.pointerDragStart.y,-1).unproject(this.camera)
  4520. , t = new r.Vector3(this.pointer.x,this.pointer.y,-1).unproject(this.camera)
  4521. , i = Math.sqrt(e.x * e.x + e.z * e.z)
  4522. , n = Math.sqrt(t.x * t.x + t.z * t.z)
  4523. , o = Math.atan2(e.y, i)
  4524. , a = Math.atan2(t.y, n);
  4525. this.rotationDifference.y = r.Math.radToDeg(o - a),
  4526. e.y = 0,
  4527. t.y = 0;
  4528. var s = Math.acos(e.dot(t) / e.length() / t.length());
  4529. isNaN(s) || (this.rotationDifference.x = r.Math.radToDeg(s),
  4530. this.pointerDragStart.x < this.pointer.x && (this.rotationDifference.x *= -1)),
  4531. this.pointerDragStart.copy(this.pointer)
  4532. }
  4533. }
  4534. ,
  4535. n.prototype.onMouseMove = function(e) {
  4536. this.usable() && (l.convertScreenPositionToNDC(e.clientX, e.clientY, this.pointer),
  4537. 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"))
  4538. }
  4539. ,
  4540. n.prototype.onTouchMove = function(e) {
  4541. if (this.usable())
  4542. switch (this.emit(u.Move, "touch"),
  4543. e.touches.length) {
  4544. case 1:
  4545. l.convertScreenPositionToNDC(e.touches[0].clientX, e.touches[0].clientY, this.pointer);
  4546. break;
  4547. case 2:
  4548. var t = (e.touches[0].clientX - e.touches[1].clientX) / $("#player").width()
  4549. , i = (e.touches[0].clientY - e.touches[1].clientY) / $("#player").height()
  4550. , n = this.pinchDistance - Math.sqrt(t * t + i * i);
  4551. Math.abs(n) > .01 && (this.emit(u.InteractionDirect),
  4552. this.emit(u.Pinch, n),
  4553. this.pinchDistance -= n)
  4554. }
  4555. }
  4556. ,
  4557. n.prototype.onPointerMove = function(e) {
  4558. this.usable() && "touch" === e.pointerType && (this.pointers.forEach(function(t) {
  4559. e.pointerId === t.id && (t.clientX = e.clientX,
  4560. t.clientY = e.clientY)
  4561. }),
  4562. e.touches = this.pointers,
  4563. this.onTouchMove(e))
  4564. }
  4565. ,
  4566. n.prototype.endRotation = function() {
  4567. this.pointerDragOn = !1;
  4568. var e = s.averageVectors(this.rotationHistory);
  4569. this.rotationSpeed.set(e.x * a.rotationAfterMoveMultiplier, e.y * a.rotationAfterMoveMultiplier)
  4570. }
  4571. ,
  4572. n.prototype.onTouchEnd = function(e) {
  4573. this.usable() && (e.preventDefault(),
  4574. e.stopPropagation(),
  4575. this.endRotation())
  4576. }
  4577. ,
  4578. n.prototype.onMouseUp = function(e) {
  4579. this.usable() && (e.preventDefault(),
  4580. e.stopPropagation(),
  4581. this.endRotation())
  4582. }
  4583. ,
  4584. n.prototype.onPointerUp = function(e) {
  4585. this.usable() && "touch" === e.pointerType && (this.pointers.forEach(function(t, i) {
  4586. e.pointerId === t.id && this.pointers.splice(i, 1)
  4587. }
  4588. .bind(this)),
  4589. e.touches = this.pointers,
  4590. this.onTouchEnd(e))
  4591. }
  4592. ,
  4593. n.prototype.update = function(e) {
  4594. this.lon,
  4595. this.lat;
  4596. for (this.updateRotation(),
  4597. this.rotationHistory.push(this.rotationDifference.clone()); this.rotationHistory.length > a.rotationAfterMoveHistoryCount; )
  4598. this.rotationHistory.shift();
  4599. this.lon += this.rotationDifference.x,
  4600. this.lat += this.rotationDifference.y,
  4601. this.rotationDifference.set(0, 0),
  4602. this.rotationSpeed.x = this.rotationSpeed.x * (1 - a.rotationFriction) + this.rotationAcc.x * a.rotationAccelerationInside,
  4603. this.rotationSpeed.y = this.rotationSpeed.y * (1 - a.rotationFriction) + this.rotationAcc.y * a.rotationAccelerationInside,
  4604. this.lon += this.rotationSpeed.x * e,
  4605. this.lat += this.rotationSpeed.y * e
  4606. //this.lat = Math.max(a.insideLookLimitDown, Math.min(a.insideLookLimitUp, this.lat)),
  4607. var insideLookLimitDown = a.insideLookLimitDown - a.insideFOV/2 + this.camera.fov / 2
  4608. var insideLookLimitUp = a.insideLookLimitUp + a.insideFOV/2 - this.camera.fov / 2
  4609. 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 );
  4610. this.phi = r.Math.degToRad(90 - this.lat),
  4611. this.theta = r.Math.degToRad(this.lon),
  4612. this.lookVector.x = Math.sin(this.phi) * Math.cos(this.theta),
  4613. this.lookVector.y = Math.cos(this.phi),
  4614. this.lookVector.z = Math.sin(this.phi) * Math.sin(this.theta),
  4615. this.target.copy(this.lookVector).add(this.camera.position),
  4616. this.camera.lookAt(this.target)
  4617. }
  4618. ,
  4619. n.prototype.onMouseWheel = function(e) {
  4620. if (this.usable()) {
  4621. var t = e.wheelDelta || -e.detail;
  4622. this.emit(u.InteractionDirect),
  4623. this.emit(u.Scroll, t)
  4624. }
  4625. }
  4626. ,
  4627. n.prototype.onKeyDown = function(e) {
  4628. this.usable() && (e.metaKey || e.ctrlKey || (e.preventDefault(),
  4629. this.handleKeyDown(e.which)))
  4630. }
  4631. ,
  4632. n.prototype.handleKeyDown = function(e) {
  4633. var t = function(e, t) {
  4634. this.rotationAcc[e] = t
  4635. }
  4636. .bind(this);
  4637. this.emit(u.InteractionKey);
  4638. var i = !0;
  4639. switch (e) {
  4640. case h.LEFTARROW:
  4641. case h.J:
  4642. t("x", -1);
  4643. break;
  4644. case h.RIGHTARROW:
  4645. case h.L:
  4646. t("x", 1);
  4647. break;
  4648. case h.I:
  4649. t("y", 1);
  4650. break;
  4651. case h.K:
  4652. t("y", -1);
  4653. break;
  4654. default:
  4655. i = !1
  4656. }
  4657. i && this.emit(u.Move, "key")
  4658. if(e == 27){
  4659. if(exit){
  4660. $(exit).click()
  4661. }
  4662. window.player.closePopup()
  4663. }
  4664. }
  4665. ,
  4666. n.prototype.onKeyUp = function(e) {
  4667. this.usable() && (e.preventDefault(),
  4668. e.stopPropagation(),
  4669. this.handleKeyUp(e.which))
  4670. }
  4671. ,
  4672. n.prototype.handleKeyUp = function(e) {
  4673. switch (e) {
  4674. case h.LEFTARROW:
  4675. case h.J:
  4676. case h.RIGHTARROW:
  4677. case h.L:
  4678. this.rotationAcc.x = 0;
  4679. break;
  4680. case h.I:
  4681. case h.K:
  4682. this.rotationAcc.y = 0
  4683. }
  4684. }
  4685. ,
  4686. n.prototype.startRotating = function(e, t) {
  4687. e && (this.rotationAcc.x = e),
  4688. t && (this.rotationAcc.y = t)
  4689. }
  4690. ,
  4691. n.prototype.stopRotating = function(e) {
  4692. e && (this.rotationSpeed.x = this.rotationSpeed.y = 0),
  4693. this.rotationAcc.set(0, 0)
  4694. }
  4695. ,
  4696. n.prototype.reset = function() {
  4697. this.pointerDragOn = !1,
  4698. this.rotationAcc.set(0, 0),
  4699. this.rotationSpeed.set(0, 0),
  4700. this.pointers = []
  4701. }
  4702. ,
  4703. n.prototype.toJSON = function() {
  4704. var e = {
  4705. camera_position: {
  4706. x: l.toPrecision(this.camera.position.x, 4),
  4707. y: l.toPrecision(this.camera.position.y, 4),
  4708. z: l.toPrecision(this.camera.position.z, 4)
  4709. },
  4710. camera_quaternion: {
  4711. x: l.toPrecision(this.camera.quaternion.x, 4),
  4712. y: l.toPrecision(this.camera.quaternion.y, 4),
  4713. z: l.toPrecision(this.camera.quaternion.z, 4),
  4714. w: l.toPrecision(this.camera.quaternion.w, 4)
  4715. }
  4716. };
  4717. return e
  4718. }
  4719. ,
  4720. n.prototype.setStateFromJSON = function(e) {
  4721. this.camera.position.copy(e.camera_position),
  4722. this.camera.quaternion.copy(e.camera_quaternion)
  4723. }
  4724. ,
  4725. t.exports = n
  4726. }
  4727. ).call(this, "/js/controls/PanoramaControls.js")
  4728. }
  4729. , {
  4730. "../enum/ControlEvents": 21,
  4731. "../enum/Keys": 30,
  4732. "../enum/MouseButton": 34,
  4733. "../enum/Vectors": 50,
  4734. "../settings": 166,
  4735. "../util/common": 185,
  4736. "../util/logger": 189,
  4737. "../util/math": 190,
  4738. events: 202,
  4739. three: 217
  4740. }],
  4741. 14: [function(e, t, i) {
  4742. (function(i) {
  4743. "use strict";
  4744. var n = e("three")
  4745. , r = e("../enum/Viewmode")
  4746. , o = e("../util/logger")
  4747. , a = new o(i);
  4748. t.exports = {
  4749. serialize: function(e) {
  4750. return encodeURI(JSON.stringify(e))
  4751. },
  4752. deserialize: function(e) {
  4753. function t(e) {
  4754. function t(e, t) {
  4755. return e && "number" == typeof t && !isNaN(t)
  4756. }
  4757. return e.reduce(t, !0)
  4758. }
  4759. try {
  4760. var i = JSON.parse(decodeURI(e))
  4761. , o = {
  4762. mode: r.fromInt(i.camera_mode),
  4763. panoId: i.scan_id,
  4764. position: (new n.Vector3).copy(i.camera_position),
  4765. quaternion: (new n.Quaternion).copy(i.camera_quaternion),
  4766. zoom: i.ortho_zoom,
  4767. floorVisibility: i.floor_visibility
  4768. }
  4769. , s = o.position;
  4770. t([s.x, s.y, s.z]) || o.position.set(0, 0, 0);
  4771. var l = o.quaternion;
  4772. return t([l.x, l.y, l.z, l.w]) || o.quaternion.set(0, 0, 0, 1),
  4773. o
  4774. } catch (i) {
  4775. a.debug("Not able to parse start location as JSON; falling back to old array style parsing");
  4776. try {
  4777. var c = e.split(",")
  4778. , h = {
  4779. x: parseFloat(c[2]),
  4780. y: parseFloat(c[3]),
  4781. z: parseFloat(c[4])
  4782. }
  4783. , u = {
  4784. x: parseFloat(c[5]),
  4785. y: parseFloat(c[6]),
  4786. z: parseFloat(c[7]),
  4787. w: parseFloat(c[8])
  4788. };
  4789. return t([h.x, h.y, h.z]) || (h.x = 0,
  4790. h.y = 0,
  4791. h.z = 0),
  4792. t([u.x, u.y, u.z, u.w]) || (u.x = 0,
  4793. u.y = 0,
  4794. u.z = 0,
  4795. u.w = 1),
  4796. {
  4797. mode: r.fromInt(c[0]),
  4798. panoId: c[1],
  4799. position: (new n.Vector3).copy(h),
  4800. quaternion: (new n.Quaternion).copy(u)
  4801. }
  4802. } catch (t) {
  4803. a.warn('Invalid start override, ignoring: "' + e + '"', t.message)
  4804. }
  4805. }
  4806. return null
  4807. }
  4808. }
  4809. }
  4810. ).call(this, "/js/controls/serializer.js")
  4811. }
  4812. , {
  4813. "../enum/Viewmode": 51,
  4814. "../util/logger": 189,
  4815. three: 217
  4816. }],
  4817. 15: [function(e, t, i) {
  4818. (function(i) {
  4819. "use strict";
  4820. function n() {
  4821. this.endlessLoop = a.warp.loop,
  4822. this.clock = new r.Clock(!0),
  4823. this.model = null,
  4824. this.player = null,
  4825. this.currentItem = null,
  4826. this.destinationItem = null,
  4827. this.tourIsPlaying = !1,
  4828. this.transitionStage = y.None,
  4829. this.nextFunc = null,
  4830. this.onTheBus = !1,
  4831. this.tourInProgress = !1,
  4832. this.reachSource = null,
  4833. this.interrupted = !1,
  4834. this.nItems = 0,
  4835. this.walkingSectionPaused = !1
  4836. }
  4837. var r = e("three")
  4838. , o = e("./util/logger")
  4839. , a = e("./settings")
  4840. , s = e("./util/transitions")
  4841. , l = e("events").EventEmitter
  4842. , c = e("./enum/Viewmode")
  4843. , h = e("./analytics")
  4844. , u = e("./enum/WarpStyle")
  4845. , s = e("./util/transitions")
  4846. , d = (e("./model/ModelManager"),
  4847. e("./enum/ModelManagerEvents"))
  4848. , p = e("./enum/DirectorEvents")
  4849. , f = e("./enum/PlayerEvents")
  4850. , g = (e("./enum/ControlEvents"),
  4851. e("./enum/BlackoutStyle"))
  4852. , m = e("./enum/PathDiscardMode")
  4853. , v = e("./enum/PathDisplayMode")
  4854. , A = (e("./player"),
  4855. new o(i))
  4856. , y = Object.freeze({
  4857. None: 0,
  4858. Moving: 1,
  4859. Aiming: 2,
  4860. Interlude: 3
  4861. })
  4862. , C = Object.freeze({
  4863. Forward: 1,
  4864. NoChange: 0,
  4865. Backwards: -1
  4866. })
  4867. , I = s.getUniqueId();
  4868. n.prototype = Object.create(l.prototype),
  4869. n.prototype.init = function(e, t) {
  4870. this.player = e,
  4871. this.modelManager = t,
  4872. this.updateModel(),
  4873. this.resetAll(),
  4874. this.bindEvents()
  4875. }
  4876. ,
  4877. n.prototype.resetAll = function() {
  4878. if (this.currentItem = null,
  4879. this.destinationItem = null,
  4880. this.tourIsPlaying = !1,
  4881. this.bgmReplay(),//xzw
  4882. this.transitionStage = y.None,
  4883. this.nextFunc = null,
  4884. this.onTheBus = !1,
  4885. this.reachSource = null,
  4886. this.interrupted = !1,
  4887. this.model) {
  4888. var e = a.path.typ === u.WALK ? u.WALK : u.STD;
  4889. this.defaultWarpStyle = this.model.data.hasOwnProperty("player_options") && this.model.data.player_options && this.model.data.player_options.fast_transitions === !1 ? e : u.BLACK
  4890. } else
  4891. this.defaultWarpStyle = u.BLACK,
  4892. A.warn('No model yet, choosing "' + this.defaultWarpStyle + '" transitions');
  4893. this.resetSpecialTransition()
  4894. }
  4895. ,
  4896. n.prototype.updateModel = function() {
  4897. this.model = this.modelManager.getActiveModel(),
  4898. this.nItems = this.model.heroLocations.length
  4899. }
  4900. ,
  4901. n.prototype.bindEvents = function() {
  4902. this.modelManager.on(d.ActiveModelChanged, this.updateModel.bind(this)),
  4903. this.player.on(f.WarpInterruptedWithFlyTo, this.checkAndHandleWalkingtourInterruption.bind(this)),
  4904. this.player.on(f.Move, this.handlePlayerMove.bind(this)),
  4905. this.player.on(f.PanoChosen, this.handlePlayerPanoChosen.bind(this)),
  4906. this.player.on(f.ModeChanged, this.handlePlayerModeChanged.bind(this)),
  4907. this.player.on(f.InputStart, this.handlePlayerInputStart.bind(this)),
  4908. this.player.on(f.FlyingStarted, this.handlePlayerFlyingStarted.bind(this)),
  4909. this.player.once(f.Move, function() {
  4910. s.cancelById(I)
  4911. })
  4912. }
  4913. ,
  4914. n.prototype.checkAndHandleWalkingtourInterruption = function(e) {
  4915. return e === u.WALK && (this.interrupt(g.NONE),
  4916. this.pauseWalkingSection(),
  4917. this.player.fastForwardActivePanoFlight(),
  4918. !0)
  4919. }
  4920. ,
  4921. n.prototype.handlePlayerMove = function(e) {
  4922. this.transitionStage === y.Interlude && this.interrupt(g.NONE),
  4923. this.emit("update.controls")
  4924. }
  4925. ,
  4926. n.prototype.handlePlayerPanoChosen = function(e, t) {
  4927. this.intermediateState() || e.id === t.id || (this.onTheBus = !1,
  4928. this.emit("update.controls"))
  4929. }
  4930. ,
  4931. n.prototype.handlePlayerModeChanged = function(e, t) {
  4932. this.intermediateState() || e === t || (this.onTheBus = !1,
  4933. this.emit("update.controls"))
  4934. }
  4935. ,
  4936. n.prototype.handlePlayerInputStart = function(e) {
  4937. this.transitionStage === y.Interlude && this.interrupt(g.NONE)
  4938. }
  4939. ,
  4940. n.prototype.handlePlayerFlyingStarted = function() {
  4941. this.clearWalkingSectionPaused()
  4942. }
  4943. ,
  4944. n.prototype.describe = function() {
  4945. return {
  4946. nItems: this.nItems,
  4947. currentItem: this.currentItem,
  4948. destinationItem: this.destinationItem,
  4949. tourIsPlaying: this.tourIsPlaying,
  4950. onTheBus: this.onTheBus,
  4951. endlessLoop: this.endlessLoop,
  4952. viewMode: this.player.mode,
  4953. inTransition: this._inTransition(),
  4954. transitionStage: this.transitionStage,
  4955. tourInProgress: this.tourInProgress
  4956. }
  4957. }
  4958. ,
  4959. n.prototype._inTransition = function() {
  4960. return this.player.flying || this.player.isWarping() || this.player.isWaitingToWarp() || this.player.mode === c.TRANSITIONING || this.tourIsPlaying
  4961. }
  4962. ,
  4963. n.prototype.bounceable = function() {
  4964. var e = this.clock.getDelta();
  4965. return this.isInterrupted() || e < .9 && e > .01 || this.player.flying && !this.player.isWarping()
  4966. }
  4967. ,
  4968. n.prototype.itemCompare = function(item1, item2, type){//add
  4969. if(type == 'equal'){//==
  4970. return item1 && item2 && item1[0] == item2[0] && item1[1] == item2[1]
  4971. }else if(type == 'less'){//<
  4972. return item1 && item2 && (item1[0] < item2[0]) || (item1[0] == item2[0] && item1[1] < item2[1])
  4973. }
  4974. }
  4975. n.prototype.currentMoveDirection = function() {
  4976. //return null === this.currentItem || void 0 === this.currentItem ? y.Forward : this.destinationItem === this.currentItem ? y.NoChange : this.destinationItem > this.currentItem ? y.Forward : y.Backwards
  4977. 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
  4978. }
  4979. ,
  4980. n.prototype.clearPath = function() {
  4981. this._inTransition() || this.player.path.discardPathObject()
  4982. }
  4983. ,
  4984. n.prototype.allFloors = function() {
  4985. this.model.toggleAllFloors()
  4986. }
  4987. ,
  4988. n.prototype.actionComplete = function(e) {
  4989. if (this.interrupted = !1,
  4990. this.transitionStage = y.None,
  4991. this.resetSpecialTransition(),
  4992. null !== this.destinationItem && this.setCurrentItem(this.destinationItem),
  4993. this.tourIsPlaying || (this.player.disablePreRendering(),
  4994. this.player.mode === c.PANORAMA && this.player.currentPano.isAligned() && this.model.fadePanoMarkers()),
  4995. this.emit("update.controls"),
  4996. this.nextFunc) {
  4997. var t = this.nextFunc;
  4998. this.nextFunc = null,
  4999. t()
  5000. }
  5001. }
  5002. ,
  5003. n.prototype.awaitCompletion = function(e, t) {
  5004. this.nextFunc = t,
  5005. e()
  5006. }
  5007. ,
  5008. n.prototype.updateSuccessFunction = function(e) {
  5009. this.nextFunc = e
  5010. }
  5011. ,
  5012. n.prototype.interrupt = function(e, t) {
  5013. return !!this.wouldInterrupt() && (this.tourIsPlaying && (this.player.zoomEnabled = this.wasZoomEnabled),
  5014. this.tourIsPlaying = !1,
  5015. this.bgmReplay(),//xzw
  5016. this.interrupted = !0,
  5017. this.nextFunc = null,
  5018. this.emit(p.ActionInterrupted),
  5019. null !== e && void 0 !== e || (e = g.BEGINNING),
  5020. this.player.interruptAndFastForward(e, t),
  5021. !0)
  5022. }
  5023. ,
  5024. n.prototype.wouldInterrupt = function() {
  5025. return this.transitionStage !== y.None
  5026. }
  5027. ,
  5028. n.prototype.intermediateState = function() {
  5029. return this.transitionStage !== y.None
  5030. }
  5031. ,
  5032. n.prototype.isInterrupted = function() {
  5033. return this.interrupted
  5034. }
  5035. ,
  5036. n.prototype.pauseWalkingSection = function() {
  5037. this.walkingSectionPaused = !0
  5038. }
  5039. ,
  5040. n.prototype.clearWalkingSectionPaused = function() {
  5041. this.walkingSectionPaused = !1
  5042. }
  5043. ,
  5044. n.prototype.autoTour = function() {
  5045. var e = Date.now();
  5046. this.model.auxDataPromise.then(function() {
  5047. e = Date.now() - e;
  5048. var t = a.warp.auto
  5049. , i = this.model.data && this.model.data.player_options /* && this.model.data.player_options.highlight_reel */;
  5050. t >= 0 && this.model.heroCount() > 1 && i && s.trigger({
  5051. duration: Math.max(1e3 * Math.min(300, t) - e, 0),
  5052. done: function() {
  5053. this.playTour()
  5054. }
  5055. .bind(this),
  5056. name: "_atr",
  5057. id: I
  5058. })
  5059. }
  5060. .bind(this))
  5061. }
  5062. ,
  5063. n.prototype.atDestinationPano = function() {
  5064. if (!this.player.currentPano || null === this.destinationItem)
  5065. return !1;
  5066. var e = this.player.currentPano.id;
  5067. if (void 0 === e)
  5068. return !1;
  5069. var t = this.model.heroLocations;
  5070. //return null !== this.destinationItem && void 0 !== t[this.destinationItem] && e === t[this.destinationItem].panoId
  5071. var destination = this.destinationItem && this.model.getHeroDescriptorByIndex(this.destinationItem)
  5072. return destination && destination.panoId == e
  5073. }
  5074. ,
  5075. n.prototype.redirectToItem = function(e, t) {
  5076. if (null === e || void 0 === e)
  5077. return void A.warn("Director.redirectToItem() -> Redirecting to null item.");
  5078. if (!this.wouldInterrupt())
  5079. return void A.warn("Director.redirectToItem() -> Director cannot redirect if there is nothing to interrupt.");
  5080. if (this.player.mode === c.TRANSITIONING)
  5081. return void A.debug("Director.redirectToItem() -> Cannot redirect while transitioning.");
  5082. A.debug("Director.redirectToItem() -> Redirecting to " + e + " via " + t);
  5083. var i = function() {
  5084. s.setTimeout(function() {
  5085. this.setDestinationItem(e),
  5086. this.goToDestination(!0, g.BEGINNING, a.warp.warpInterruptionRedirectTime, !1)
  5087. }
  5088. .bind(this), 0)
  5089. }
  5090. .bind(this);
  5091. this.interrupt(g.END, 0),
  5092. this.updateSuccessFunction(i)
  5093. }
  5094. ,
  5095. n.prototype.useSpecialTransition = function(e) {
  5096. void 0 !== e && this.defaultWarpStyle !== u.BLACK && A.debug("useSpecialTransition(): " + e),
  5097. this.nextWarpStyle = u.BLACK
  5098. }
  5099. ,
  5100. n.prototype.resetSpecialTransition = function() {
  5101. this.nextWarpStyle = this.defaultWarpStyle
  5102. }
  5103. ,
  5104. n.prototype.arrivedAtDestination = function(e) {
  5105. if (this.player.flying || this.player.isWarping())
  5106. A.warn("Cannot advance to interlude or aiming while player is flying or warping.");
  5107. else {
  5108. this.transitionStage = y.Aiming;
  5109. var t = this.tourIsPlaying ? this.tourInterlude.bind(this, this.nextItem(this.currentItem)) : null;
  5110. this.player.model.fadePanoMarkers(0),
  5111. this.awaitCompletion(function() {
  5112. this.resetSpecialTransition(),
  5113. e ? this.player.aimTourCamera(this.destinationItem, v.Retain, v.Slow, this.actionComplete.bind(this)) : this.actionComplete()
  5114. }
  5115. .bind(this), t)
  5116. }
  5117. }
  5118. ,
  5119. n.prototype.goToDestination = function(e, t, i, n) {
  5120. //音频
  5121. //if(this.destinationItem[1] == 0){//如果是每个folder的起始
  5122. var musicInfo = this.model.heroLocations[this.destinationItem[0]].musicInfo
  5123. if(musicInfo && musicInfo.music){
  5124. var o = musicInfo.music.includes(g_Prefix.slice(-10)) ? musicInfo.music : g_Prefix + musicInfo.music;
  5125. let audioSrc1 = g_tourAudio.src.split('/').pop();
  5126. let audioSrc2 = o.split('/').pop();
  5127. if(audioSrc1 == audioSrc2){//应该是继续播放该folder
  5128. if(this.destinationItem[1] == 0){//从头开始播放 因为可能暂停后然后再点该缩略图播
  5129. g_tourAudio.currentTime = 0; g_tourAudio.play();
  5130. }else if(g_tourAudio.paused && g_tourAudio.currentTime < g_tourAudio.duration){//未播完
  5131. g_tourAudio.play()
  5132. }
  5133. }else{//很可能是该folder的起始
  5134. g_tourAudio.src = manage.dealURL(o);
  5135. g_tourAudio.load()
  5136. }
  5137. if(g_bgAudio && !g_bgAudio.paused){
  5138. manage.switchBgmState(false);
  5139. g_bgAudio.pauseByTour = true
  5140. }
  5141. }
  5142. //}
  5143. if (this.onTheBus = !0,
  5144. this.emit("update.controls"),
  5145. this.player.updateLastView(),
  5146. !n && this.atDestinationPano()){
  5147. /*
  5148. // 原地旋转时, 写到_warpCameraAim里,因那有时间
  5149. var r = this.model.getHeroDescriptorByIndex(this.destinationItem)
  5150. if(r.zoom && r.zoom != this.player.zoomLevel){//add
  5151. this.player.smoothZoomFovTo(null, r.zoom, a.warp.teleportTime) //瞬间过渡的时间
  5152. } */
  5153. return void this.arrivedAtDestination(!0);
  5154. }
  5155. if (this.player.flying || this.player.isWarping())
  5156. A.warn("Cannot go to new destination while player is flying or warping.");
  5157. else {
  5158. var r = this.model.getHeroDescriptorByIndex(this.destinationItem)
  5159. , o = null
  5160. , a1 = null;
  5161. if (r.isPano()) {
  5162. //var s = 0 === this.destinationItem || e ? u.BLACK : this.nextWarpStyle;
  5163. //var walk = window.MP_PREFETCHED_MODELDATA.black ? 'black' : 'walk';
  5164. var s = this.getMomentTour(this.destinationItem) //window.MP_PREFETCHED_MODELDATA.momentTour || "walk";
  5165. a1 = this.player.warpToPanoByHeroIndex.bind(this.player, this.destinationItem, v.Show, m.Slow, s, true, i, this.actionComplete.bind(this)),
  5166. o = this.arrivedAtDestination.bind(this, !0)
  5167. if(s=='black' && r.zoom && r.zoom != this.player.zoomLevel){//add
  5168. this.player.smoothZoomFovTo(null, r.zoom, a.warp.teleportTime) //瞬间过渡的时间
  5169. }
  5170. } else{
  5171. a1 = this.player.warpToNonPanoByHeroIndex.bind(this.player, this.destinationItem, this.actionComplete.bind(this)),
  5172. o = this.arrivedAtDestination.bind(this, !1);
  5173. }
  5174. this.transitionStage = y.Moving,
  5175. this.model.fadePanoMarkers(0),
  5176. this.awaitCompletion(function() {
  5177. a1();
  5178. }
  5179. .bind(this), o),
  5180. this.emit("update.controls")
  5181. }
  5182. }
  5183. ,
  5184. n.prototype.tourInterlude = function() {
  5185. if (h.trackAlways("reach_highlight", {
  5186. reach_source: this.reachSource
  5187. }),
  5188. this.model.fadePanoMarkers(0),
  5189. this.emit("update.controls"),
  5190. this.tourIsPlaying)
  5191. return this.atEndOfTour() && !this.endlessLoop ? (this.tourInProgress = !1,
  5192. this.stopTour(true),
  5193. this.emit(p.TourEnd),
  5194. void (this.player.mode === c.PANORAMA && this.model.fadePanoMarkers(a.panorama.markerOpacity))) : void this.awaitCompletion(function() {
  5195. this.transitionStage = y.Interlude,
  5196. this.player.tourInterlude(this.nextItem(this.currentItem),this.actionComplete.bind(this))
  5197. }
  5198. .bind(this), this.goNext.bind(this))
  5199. }
  5200. ,
  5201. n.prototype.playTour = function() {
  5202. if (!this.bounceable())
  5203. return this.tourIsPlaying ? void A.info("tour is already playing") : void (this.wouldInterrupt() || (this.player.emit("tour_auto", this.defaultWarpStyle),
  5204. this.tourInProgress = !0,
  5205. this.reachSource = "play",
  5206. this.tourIsPlaying = !0,
  5207. this.wasZoomEnabled = this.player.zoomEnabled,
  5208. this.player.zoomEnabled = !1,
  5209. this.resetSpecialTransition(),
  5210. this.emit("update.controls"),
  5211. this.emit(p.TourStart),
  5212. this.player.enablePreRendering(),
  5213. this.walkingSectionPaused ? (this.clearWalkingSectionPaused(),
  5214. this.goToDestination()) : this.goNext()))
  5215. }
  5216. ,
  5217. n.prototype.bgmReplay = function() {//xzw add 结束tour后可能要继续播放背景音乐
  5218. //if(g_tourAudio && g_tourAudio.paused && g_bgAudio && g_bgAudio.paused){
  5219. if(g_bgAudio && g_bgAudio.paused && g_bgAudio.pauseByTour){
  5220. g_playAudio = g_bgAudio;
  5221. g_tourAudio && g_tourAudio.pause();
  5222. //window.tourAudio && window.tourAudio.pause();
  5223. //manage.switchBgmState(true);
  5224. playMusic(player.currentPano)
  5225. }
  5226. }
  5227. ,
  5228. n.prototype.stopTour = function(isAutoStop) {//停止导览 isAutoStop 希望仅在飞完结束自动停止时的stopTour不停止tourSound, 这样才能完整播放tourSound. 不过似乎会在倒数第二个片段点击按钮停止导览时也视作自动结束的(执行this.interrupt() )。
  5229. this.isInterrupted() || this.transitionStage === y.Moving && this.checkAndHandleWalkingtourInterruption(this.nextWarpStyle) || (this.tourIsPlaying && (this.player.zoomEnabled = this.wasZoomEnabled),
  5230. this.tourIsPlaying = !1,
  5231. (!isAutoStop || g_tourAudio && g_tourAudio.paused )&&this.bgmReplay(),//xzw
  5232. this.interrupt(),
  5233. this.clearWalkingSectionPaused(),
  5234. this.resetSpecialTransition(),
  5235. this.emit("update.controls"))
  5236. //window.tourAudio && window.tourAudio.pause();
  5237. if(!isAutoStop && g_tourAudio && g_tourAudio.paused == false )
  5238. {
  5239. g_tourAudio.pause();
  5240. //g_tourAudio.src = ""
  5241. }
  5242. }
  5243. ,
  5244. n.prototype.endTourProgress = function() {
  5245. this.tourInProgress = !1,
  5246. this.emit("update.controls"),
  5247. this.emit(p.TourEnd)
  5248. }
  5249. ,
  5250. n.prototype.goToHighlight = function(e) {
  5251. if (this.wouldInterrupt())
  5252. this.itemCompare(this.destinationItem,e,'equal') ? this.interrupt() : this.redirectToItem(e, "goToHighlight");
  5253. else {
  5254. if (A.debug("<tour.goto " + e + ">"),
  5255. this.isInterrupted())
  5256. return;
  5257. this.clearWalkingSectionPaused(),
  5258. this.setDestinationItem(e),
  5259. this.useSpecialTransition("Hilight"),
  5260. this.goToDestination(),
  5261. h.trackAlways("reach_highlight", {
  5262. reach_source: "thumb"
  5263. })
  5264. }
  5265. }
  5266. ,
  5267. n.prototype.prevHighlight = function() {
  5268. this.bounceable() || (this.player.emit("tour_manual", "prev"),
  5269. this.interrupt(g.BEGINNING) || this.isInterrupted() || (this.clearWalkingSectionPaused(),
  5270. this.reachSource = "prev",
  5271. this.goPrev()))
  5272. }
  5273. ,
  5274. n.prototype.nextHighlight = function() {
  5275. this.bounceable() || (this.player.emit("tour_manual", "next"),
  5276. this.interrupt(g.BEGINNING) || this.isInterrupted() || (this.clearWalkingSectionPaused(),
  5277. this.reachSource = "next",
  5278. this.goNext()))
  5279. }
  5280. ,
  5281. n.prototype.changeMode = function(e) {
  5282. var t = $.Deferred()
  5283. , i = t.resolve.bind(t)
  5284. , n = t.reject.bind(t);
  5285. this.emit(p.StartModeChange);
  5286. var r = function() {
  5287. return this.clearWalkingSectionPaused(),
  5288. !!this.wouldInterrupt() && (this.interrupt(),
  5289. !0)
  5290. }
  5291. .bind(this);
  5292. if (!r()) {
  5293. switch (e) {
  5294. case c.PANORAMA:
  5295. 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);
  5296. break;
  5297. case c.DOLLHOUSE:
  5298. case c.FLOORPLAN:
  5299. this.player.flyToNewMode({
  5300. mode: e
  5301. }).done(i).fail(n);
  5302. break;
  5303. case c.OUTDOOR:
  5304. 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)
  5305. }
  5306. return t.promise()
  5307. }
  5308. }
  5309. ,
  5310. n.prototype.atEndOfTour = function() {
  5311. //return this.currentItem >= this.nItems - 1
  5312. var end = this.currentItem && this.currentItem[0] >= this.nItems - 1;
  5313. if(end){
  5314. var heroLocations = this.model.heroLocations[this.nItems-1].heroLocations
  5315. if(heroLocations){
  5316. end = this.currentItem[1] >= heroLocations.length - 1
  5317. }
  5318. }
  5319. return end;
  5320. }
  5321. ,
  5322. n.prototype.firstDestination = function() {
  5323. //return 0 < this.nItems ? 0 : null
  5324. return 0 < this.nItems ? [0,0]: null
  5325. }
  5326. ,
  5327. n.prototype.finalDestination = function() {
  5328. //return 0 < this.nItems ? this.nItems - 1 : null
  5329. return 0 < this.nItems ? [this.nItems - 1,0]: null
  5330. }
  5331. ,
  5332. n.prototype.goPrev = function() {
  5333. this.tourAdvance(-1)
  5334. }
  5335. ,
  5336. n.prototype.goNext = function() {
  5337. this.tourAdvance(1)
  5338. }
  5339. ,
  5340. n.prototype.setDestinationItem = function(e) {
  5341. this.destinationItem = e,
  5342. this.emit("update.controls")
  5343. }
  5344. ,
  5345. n.prototype.setCurrentItem = function(e) {
  5346. this.currentItem = e,
  5347. this.emit("update.controls")
  5348. }
  5349. ,
  5350. n.prototype.nextItem = function(currentItem) {
  5351. //return null === e ? this.firstDestination() : e >= this.nItems - 1 ? this.endlessLoop ? this.firstDestination() : null : e + 1
  5352. if(currentItem == void 0)return this.firstDestination()
  5353. var currentLocation = this.model.heroLocations[currentItem[0]];
  5354. var currentChildNum = currentLocation.heroLocations ? currentLocation.heroLocations.length : 1
  5355. var item;
  5356. if(this.currentItem[1] >= currentChildNum - 1){//子目录中最后一个
  5357. item = [currentItem[0] + 1, 0] //结果可能超出nItems
  5358. }else{
  5359. item = [currentItem[0] , currentItem[1]+1]
  5360. }
  5361. if(item[0] >= this.nItems ){
  5362. item = this.firstDestination()
  5363. }
  5364. return item;
  5365. //暂时不理会endlessLoop,默认为false
  5366. }
  5367. ,
  5368. n.prototype.prevItem = function(currentItem) {
  5369. //return null === e ? this.firstDestination() : e < 0 ? this.endlessLoop ? this.lastDestination() : null : e - 1
  5370. if(currentItem == void 0)return this.firstDestination()
  5371. var item;
  5372. var lastLocation = this.model.heroLocations[currentItem[0]-1];
  5373. if(!lastLocation) return this.finalDestination()//[-1, 0]//this.setDestinationItem([-1, 0]) //结果小于0
  5374. else{
  5375. var lastChildNum = lastLocation.heroLocations ? lastLocation.heroLocations.length : 1
  5376. if(this.currentItem[1] == 0){//子目录中第一个
  5377. return [currentItem[0] - 1, lastChildNum-1]
  5378. }else{
  5379. return [currentItem[0], currentItem[1]-1]
  5380. }
  5381. }
  5382. }
  5383. ,
  5384. n.prototype.tourAdvance = function(e) {//e是1或-1
  5385. A.debug("tourAdvance(" + e + ")")
  5386. if(null === this.currentItem || void 0 === this.currentItem){
  5387. this.setDestinationItem(this.firstDestination())
  5388. }else{
  5389. var item
  5390. if(e == 1){
  5391. item = this.nextItem(this.currentItem)
  5392. }else if(e == -1){
  5393. item = this.prevItem(this.currentItem)
  5394. }
  5395. this.setDestinationItem(item)
  5396. }
  5397. if(this.itemCompare(this.destinationItem, this.finalDestination(), 'equal')[0] < 0 ){
  5398. this.useSpecialTransition("reverse-looping to end")
  5399. }else if(this.itemCompare(this.destinationItem, this.firstDestination(), 'equal')){
  5400. this.useSpecialTransition("looping back to start")
  5401. }
  5402. /* var momentTour = this.getMomentTour(this.destinationItem);
  5403. if ( "black" === momentTour) { // 方奕卓 瞬间过渡, 相机缩放至1
  5404. var zoomLevel = this.player.zoomLevel;
  5405. this.player.zoomEnabled = true;
  5406. var zoom = function(e, d) {
  5407. this.player.zoomTo((1-e)*zoomLevel, true)
  5408. }.bind(this)
  5409. s.start(zoom, 1500, function(){
  5410. }, 0, d.easeOutQuad, "zoom")
  5411. } */
  5412. this.goToDestination()
  5413. }
  5414. ,
  5415. n.prototype.getMomentTour = function(destinationItem) {//add
  5416. var wholeMomentTour = window.MP_PREFETCHED_MODELDATA.momentTour || "walk"; //最外层
  5417. if(!destinationItem) return wholeMomentTour
  5418. else{
  5419. var currentLocation = this.model.getHeroDescriptorByIndex(destinationItem)//最内层。 如果有使用最内层
  5420. if(currentLocation.momentTour)return currentLocation.momentTour;
  5421. var currentLocation_ = this.model.heroLocations[destinationItem[0]];
  5422. return currentLocation_.momentTour || wholeMomentTour; //若中间层或最内层有就使用,否则使用最外层
  5423. }
  5424. }
  5425. ,
  5426. t.exports = n
  5427. }
  5428. ).call(this, "/js/director.js")
  5429. }
  5430. , {
  5431. "./analytics": 4,
  5432. "./enum/BlackoutStyle": 18,
  5433. "./enum/ControlEvents": 21,
  5434. "./enum/DirectorEvents": 23,
  5435. "./enum/ModelManagerEvents": 33,
  5436. "./enum/PathDiscardMode": 38,
  5437. "./enum/PathDisplayMode": 39,
  5438. "./enum/PlayerEvents": 40,
  5439. "./enum/Viewmode": 51,
  5440. "./enum/WarpStyle": 52,
  5441. "./model/ModelManager": 140,
  5442. "./player": 155,
  5443. "./settings": 166,
  5444. "./util/logger": 189,
  5445. "./util/transitions": 195,
  5446. events: 202,
  5447. three: 217
  5448. }],
  5449. 16: [function(e, t, i) {
  5450. "use strict";
  5451. var n = e("three")
  5452. , r = e("./enum/Viewmode")
  5453. , o = (e("./settings"),
  5454. e("./util/transitions"))
  5455. , a = e("./enum/PlayerEvents")
  5456. , s = new n.ShaderPass(n.HorizontalBlurShader)
  5457. , l = new n.ShaderPass(n.VerticalBlurShader);
  5458. l.renderToScreen = !0;
  5459. var c = $("#player").width() / $("#player").height();
  5460. isNaN(c) && (c = 1);
  5461. //initTransitionPass(n)
  5462. var h = {
  5463. currentBlur: 0,
  5464. aspect: c,
  5465. blurStrength: 1,
  5466. hblurPass: s,
  5467. vblurPass: l,
  5468. // transitionMaskPass : new n.TransitionPass()
  5469. bindEvents: function(e) {
  5470. e.on(a.ModeChanged, function(e, t) {
  5471. e === r.PANORAMA && (o.cancel(h.blur),
  5472. o.cancel(h.addBlur),
  5473. o.start(h.removeBlur, 500, null, 0, null, "deblur"))
  5474. })
  5475. },
  5476. blur: function(e) {
  5477. h.currentBlur = e;
  5478. var t = e * h.blurStrength;
  5479. l.uniforms.v.value = t / 512 * h.aspect,
  5480. s.uniforms.h.value = t / 512
  5481. },
  5482. addBlur: function(e) {
  5483. e = Math.max(e, h.currentBlur),
  5484. h.blur(e)
  5485. },
  5486. removeBlur: function(e) {
  5487. e = Math.min(1 - e, h.currentBlur),
  5488. h.blur(e)
  5489. }
  5490. };
  5491. h.blur(0),
  5492. t.exports = h
  5493. }
  5494. , {
  5495. "./enum/PlayerEvents": 40,
  5496. "./enum/Viewmode": 51,
  5497. "./settings": 166,
  5498. "./util/transitions": 195,
  5499. three: 217
  5500. }],
  5501. 17: [function(e, t, i) {
  5502. "use strict";
  5503. t.exports = {
  5504. UNKNOWN: 0,
  5505. ALIGNED: 1,
  5506. UNALIGNED: 2,
  5507. PLACED: 3
  5508. }
  5509. }
  5510. , {}],
  5511. 18: [function(e, t, i) {
  5512. "use strict";
  5513. t.exports = {
  5514. NONE: 0,
  5515. MIDDLE: 1,
  5516. END: 2,
  5517. BEGINNING: 3,
  5518. FADEIN: 4
  5519. }
  5520. }
  5521. , {}],
  5522. 19: [function(e, t, i) {
  5523. "use strict";
  5524. var n = e("three");
  5525. t.exports = {
  5526. newBlue: new n.Color(4967932),
  5527. altBlue: new n.Color(47355),
  5528. tagDefault: new n.Color(223357),
  5529. classicBlue: new n.Color(53759),
  5530. mpYellow: new n.Color(16502016),
  5531. mpOrange: new n.Color(16428055),
  5532. mpBlue: new n.Color(12096),
  5533. mpLtGrey: new n.Color(13751252),
  5534. mpDkGrey: new n.Color(10000019),
  5535. mpRed: new n.Color(12525854),
  5536. mpOrangeDesat: new n.Color(16764529),
  5537. mpBlueDesat: new n.Color(4034734),
  5538. mpRedDesat: new n.Color(14705505),
  5539. white: new n.Color(16777215),
  5540. black: new n.Color(0),
  5541. _desat: function(e, t) {
  5542. var i = t || .3
  5543. , r = (new n.Color).copy(e).getHSL();
  5544. return (new n.Color).setHSL(r.h, r.s * (1 - i), r.l)
  5545. },
  5546. _darken: function(e, t) {
  5547. var i = t || .2
  5548. , r = e.getHSL();
  5549. return (new n.Color).setHSL(r.h, r.s, r.l * (1 - i))
  5550. }
  5551. }
  5552. }
  5553. , {
  5554. three: 217
  5555. }],
  5556. 20: [function(e, t, i) {
  5557. "use strict";
  5558. t.exports = {
  5559. NONE: -1,
  5560. ROTATE: 0,
  5561. DOLLY: 1,
  5562. PAN: 2,
  5563. ROTATE_DOLLY: 3,
  5564. PAN_DOLLY: 4
  5565. }
  5566. }
  5567. , {}],
  5568. 21: [function(e, t, i) {
  5569. "use strict";
  5570. t.exports = {
  5571. Move: "move",
  5572. InteractionDirect: "interaction.direct",
  5573. InteractionKey: "interaction.key",
  5574. InteractionGui: "interaction.gui",
  5575. FlyInDirection: "fly.direction",
  5576. InputStart: "input.start",
  5577. Pinch: "input.pinch",
  5578. Scroll: "input.scroll",
  5579. AutoPanInterrupt: "autopan.interrupt",
  5580. AutoPanComplete: "autopan.complete",
  5581. AutoPanClamped: "autopan.clamped",
  5582. LongTap: "longtap"
  5583. }
  5584. }
  5585. , {}],
  5586. 22: [function(e, t, i) {
  5587. "use strict";
  5588. t.exports = Object.freeze({
  5589. FORWARD: "FORWARD",
  5590. LEFT: "LEFT",
  5591. RIGHT: "RIGHT",
  5592. BACK: "BACK",
  5593. UP: "UP",
  5594. DOWN: "DOWN"
  5595. })
  5596. }
  5597. , {}],
  5598. 23: [function(e, t, i) {
  5599. "use strict";
  5600. t.exports = {
  5601. ActionInterrupted: "action.interrupted",
  5602. TourStart: "tour.start",
  5603. TourEnd: "tour.end",
  5604. StartModeChange: "mode.startChange"
  5605. }
  5606. }
  5607. , {}],
  5608. 24: [function(e, t, i) {
  5609. "use strict";
  5610. t.exports = Object.freeze({
  5611. None: 0,
  5612. Queued: 1,
  5613. ForceQueued: 2,
  5614. Downloading: 3,
  5615. Downloaded: 4,
  5616. DownloadFailed: 5
  5617. })
  5618. }
  5619. , {}],
  5620. 25: [function(e, t, i) {
  5621. "use strict";
  5622. t.exports = {
  5623. GL_TEXTURE_CUBE_MAP_POSITIVE_X: 0,
  5624. GL_TEXTURE_CUBE_MAP_NEGATIVE_X: 1,
  5625. GL_TEXTURE_CUBE_MAP_POSITIVE_Y: 2,
  5626. GL_TEXTURE_CUBE_MAP_NEGATIVE_Y: 3,
  5627. GL_TEXTURE_CUBE_MAP_POSITIVE_Z: 4,
  5628. GL_TEXTURE_CUBE_MAP_NEGATIVE_Z: 5
  5629. }
  5630. }
  5631. , {}],
  5632. 26: [function(e, t, i) {
  5633. "use strict";
  5634. t.exports = {
  5635. Texture2D: 0,
  5636. TextureCube: 1
  5637. }
  5638. }
  5639. , {}],
  5640. 27: [function(e, t, i) {
  5641. "use strict";
  5642. t.exports = {
  5643. SMALL: "small",
  5644. LARGE: "large"
  5645. }
  5646. }
  5647. , {}],
  5648. 28: [function(e, t, i) {
  5649. "use strict";
  5650. var n = e("./Viewmode")
  5651. , r = {
  5652. LANDING: {},
  5653. NAVIGATION: "navigation",
  5654. MORE_HELP: "moreHelp",
  5655. TOUR_INTERACTION: {}
  5656. };
  5657. r.LANDING[n.PANORAMA] = "panorama.landing",
  5658. r.LANDING[n.OUTDOOR] = "outdoor.landing",
  5659. r.LANDING[n.DOLLHOUSE] = "dollhouse.landing",
  5660. r.LANDING[n.FLOORPLAN] = "floorplan.landing",
  5661. r.TOUR_INTERACTION.standard = "standard.tour",
  5662. r.TOUR_INTERACTION[n.OUTDOOR] = "outdoor.tour",
  5663. r.TOUR_INTERACTION[n.FLOORPLAN] = "floorplan.tour",
  5664. t.exports = r
  5665. }
  5666. , {
  5667. "./Viewmode": 51
  5668. }],
  5669. 29: [function(e, t, i) {
  5670. "use strict";
  5671. var n = {
  5672. UP: 1,
  5673. DOWN: -1,
  5674. LEFT: "L",
  5675. RIGHT: "R",
  5676. FORWARD: "F",
  5677. BACK: "B",
  5678. reverse: {},
  5679. opposite: function(e) {
  5680. return this.reverse[e.toString()]
  5681. }
  5682. };
  5683. !function() {
  5684. n.reverse[n.UP] = n.DOWN,
  5685. n.reverse[n.DOWN] = n.UP,
  5686. n.reverse[n.LEFT] = n.RIGHT,
  5687. n.reverse[n.RIGHT] = n.LEFT,
  5688. n.reverse[n.FORWARD] = n.BACK,
  5689. n.reverse[n.BACK] = n.FORWARD
  5690. }(),
  5691. t.exports = n
  5692. }
  5693. , {}],
  5694. 30: [function(e, t, i) {
  5695. "use strict";
  5696. var n = e("../util/browser")
  5697. , r = {
  5698. ZERO: 48,
  5699. ONE: 49,
  5700. TWO: 50,
  5701. THREE: 51,
  5702. FOUR: 52,
  5703. FIVE: 53,
  5704. SIX: 54,
  5705. SEVEN: 55,
  5706. EIGHT: 56,
  5707. NINE: 57,
  5708. LEFTARROW: 37,
  5709. UPARROW: 38,
  5710. RIGHTARROW: 39,
  5711. DOWNARROW: 40,
  5712. A: 65,
  5713. B: 66,
  5714. C: 67,
  5715. D: 68,
  5716. E: 69,
  5717. F: 70,
  5718. G: 71,
  5719. H: 72,
  5720. I: 73,
  5721. J: 74,
  5722. K: 75,
  5723. L: 76,
  5724. M: 77,
  5725. N: 78,
  5726. O: 79,
  5727. P: 80,
  5728. Q: 81,
  5729. R: 82,
  5730. S: 83,
  5731. T: 84,
  5732. U: 85,
  5733. V: 86,
  5734. W: 87,
  5735. X: 88,
  5736. Y: 89,
  5737. Z: 90,
  5738. SPACE: 32,
  5739. RETURN: 13,
  5740. SEMICOLON: 186,
  5741. PLUSEQUALS: 187,
  5742. DASHUNDERSCORE: 189,
  5743. OPENBRACKET: 219
  5744. };
  5745. n.detectFirefox() && (r.SEMICOLON = 59,
  5746. r.PLUSEQUALS = 61,
  5747. r.DASHUNDERSCORE = 173),
  5748. t.exports = r
  5749. }
  5750. , {
  5751. "../util/browser": 182
  5752. }],
  5753. 31: [function(e, t, i) {
  5754. "use strict";
  5755. t.exports = {
  5756. EN_US: "en-US",
  5757. ES_MX: "es-MX",
  5758. FR_FR: "fr-FR",
  5759. DE_DE: "de-DE",
  5760. RU_RU: "ru-RU",
  5761. CN_CN: "cn-CN",
  5762. JP_JP: "jp-JP"
  5763. }
  5764. }
  5765. , {}],
  5766. 32: [function(e, t, i) {
  5767. "use strict";
  5768. t.exports = {
  5769. TagActivated: "tag.activated",
  5770. TagDismissed: "tag.dismissed",
  5771. TagNavigation: "tag.navigation"
  5772. }
  5773. }
  5774. , {}],
  5775. 33: [function(e, t, i) {
  5776. "use strict";
  5777. t.exports = {
  5778. ModelAdded: "model-added",
  5779. ActiveModelChanged: "active-model-changed"
  5780. }
  5781. }
  5782. , {}],
  5783. 34: [function(e, t, i) {
  5784. "use strict";
  5785. t.exports = {
  5786. LEFT: 0,
  5787. MIDDLE: 1,
  5788. RIGHT: 2
  5789. }
  5790. }
  5791. , {}],
  5792. 35: [function(e, t, i) {
  5793. "use strict";
  5794. t.exports = {
  5795. PanoRenderComplete: "panorama.render.complete",
  5796. TileRenderFailure: "panorama.tile.render.failed",
  5797. TileRenderSuccess: "panorama.tile.render.success",
  5798. TileUploadAttempted: "panorama.tile.upload.attempted",
  5799. UploadAttemptedForAllTiles: "panorama.upload.attempted.all.tiles",
  5800. ZoomLevelRenderStarted: "panorama.zoom.render.started"
  5801. }
  5802. }
  5803. , {}],
  5804. 36: [function(e, t, i) {
  5805. "use strict";
  5806. t.exports = {
  5807. BASE: 1,
  5808. STANDARD: 2,
  5809. HIGH: 3,
  5810. ULTRAHIGH: 4
  5811. }
  5812. }
  5813. , {}],
  5814. 37: [function(e, t, i) {
  5815. "use strict";
  5816. t.exports = {
  5817. LoadComplete: "panorama.load.complete",
  5818. LoadFailed: "panorama.load.failed",
  5819. TileLoaded: "panorama.tile.loaded"
  5820. }
  5821. }
  5822. , {}],
  5823. 38: [function(e, t, i) {
  5824. "use strict";
  5825. t.exports = Object.freeze({
  5826. Standard: 0,
  5827. Slow: 1,
  5828. Retain: 2
  5829. })
  5830. }
  5831. , {}],
  5832. 39: [function(e, t, i) {
  5833. "use strict";
  5834. t.exports = Object.freeze({
  5835. Show: 0,
  5836. Hide: 1,
  5837. Retain: 2
  5838. })
  5839. }
  5840. , {}],
  5841. 40: [function(e, t, i) {
  5842. "use strict";
  5843. t.exports = {
  5844. Move: "move",
  5845. MoveComplete: "move.complete",
  5846. ModeChanged: "mode.changed",
  5847. ModeChanging: "mode.changing",
  5848. PanoChosen: "pano.chosen",
  5849. ClosestPanoChanging: "closest.pano.changing",
  5850. WarpStarted: "warp.started",
  5851. WarpInterrupted: "warp.interrupted",
  5852. WarpEnded: "warp.ended",
  5853. FlyinFinished: "flyin.finished",
  5854. FlyingStarted: "flying.started",
  5855. FlyingInterrupted: "flying.interrupted",
  5856. FlyingEnded: "flying.ended",
  5857. Ready: "ready",
  5858. StartInside: "start.inside",
  5859. StartOutside: "start.outside",
  5860. ViewChanged: "view.changed",
  5861. WarpInterruptedWithFlyTo: "warp.interrupted.flyto",
  5862. InputStart: "input.start"
  5863. }
  5864. }
  5865. , {}],
  5866. 41: [function(e, t, i) {
  5867. "use strict";
  5868. t.exports = Object.freeze({
  5869. DEFAULT: 0,
  5870. PANOMARKERS: 1,
  5871. RETICULE: 2,
  5872. TAG: 3
  5873. })
  5874. }
  5875. , {}],
  5876. 42: [function(e, t, i) {
  5877. "use strict";
  5878. t.exports = {
  5879. visibleFloor: 1,
  5880. ghostFloor: 3,
  5881. boundingSkybox: 1,
  5882. panoMarker: 2,
  5883. reticule: 3,
  5884. tagStem: 4,
  5885. tagDisc: 5,
  5886. ribbon: 100
  5887. }
  5888. }
  5889. , {}],
  5890. 43: [function(e, t, i) {
  5891. "use strict";
  5892. t.exports = {
  5893. ContextCreated: "scene-renderer-context-created",
  5894. AfterRender: "after-render",
  5895. MemoryUsageUpdated: "scene-renderer-memory-usage-updated"
  5896. }
  5897. }
  5898. , {}],
  5899. 44: [function(e, t, i) {
  5900. "use strict";
  5901. t.exports = {
  5902. IDLE: "idle",
  5903. BROWSE: "browse",
  5904. EXAMINE: "examine"
  5905. }
  5906. }
  5907. , {}],
  5908. 45: [function(e, t, i) {
  5909. "use strict";
  5910. t.exports = {
  5911. TileDownloadSuccess: "tiledownloader.download.success",
  5912. TileDownloadFailure: "tiledownloader.download.failure",
  5913. PanoDownloadComplete: "tiledownloader.pano.download.complete"
  5914. }
  5915. }
  5916. , {}],
  5917. 46: [function(e, t, i) {
  5918. "use strict";
  5919. t.exports = {
  5920. CardboardAndroid: "googlevr",
  5921. GearVR: "gearvr",
  5922. CardboardIOS: "googlevrios",
  5923. Cardboard: "googlevr"
  5924. }
  5925. }
  5926. , {}],
  5927. 47: [function(e, t, i) {
  5928. "use strict";
  5929. t.exports = {
  5930. NONE: 0,
  5931. CONTEXTUAL: 1,
  5932. ANDROID: 2
  5933. }
  5934. }
  5935. , {}],
  5936. 48: [function(e, t, i) {
  5937. "use strict";
  5938. var n = {
  5939. Title: 0,
  5940. Cardboard: 1
  5941. }
  5942. , r = {
  5943. Title: 0,
  5944. Cardboard: 1,
  5945. Gear: 2
  5946. };
  5947. !function() {
  5948. [n, r].forEach(function(e) {
  5949. e.pageCount = Object.keys(e).length
  5950. })
  5951. }(),
  5952. t.exports.ios = n,
  5953. t.exports.standard = r
  5954. }
  5955. , {}],
  5956. 49: [function(e, t, i) {
  5957. "use strict";
  5958. t.exports = {
  5959. Android: "android",
  5960. IOS: "ios",
  5961. Desktop: "desktop",
  5962. UnsupportedAndroid: "android-unsupported"
  5963. }
  5964. }
  5965. , {}],
  5966. 50: [function(e, t, i) {
  5967. "use strict";
  5968. var n = e("three");
  5969. t.exports = {
  5970. UP: new n.Vector3(0,1,0),
  5971. DOWN: new n.Vector3(0,-1,0),
  5972. LEFT: new n.Vector3(-1,0,0),
  5973. RIGHT: new n.Vector3(1,0,0),
  5974. FORWARD: new n.Vector3(0,0,-1),
  5975. BACK: new n.Vector3(0,0,1)
  5976. }
  5977. }
  5978. , {
  5979. three: 217
  5980. }],
  5981. 51: [function(e, t, i) {
  5982. "use strict";
  5983. var n = e("../exception/ViewmodeConvertException")
  5984. , r = e("./coreViewmodes")
  5985. , o = e("../util/common")
  5986. , a = {
  5987. MESH: "mesh",
  5988. OUTDOOR: "outdoor",
  5989. TRANSITIONING: "transitioning",
  5990. toInt: function(e) {
  5991. switch (e) {
  5992. case this.PANORAMA:
  5993. return 1;
  5994. case this.DOLLHOUSE:
  5995. return 2;
  5996. case this.FLOORPLAN:
  5997. return 3;
  5998. case this.OUTDOOR:
  5999. return 4;
  6000. case this.TRANSITIONING:
  6001. return -1
  6002. }
  6003. throw new n("No known conversion for Viewmode to int for mode: " + e)
  6004. },
  6005. fromInt: function(e) {
  6006. switch (e) {
  6007. case "1":
  6008. case 1:
  6009. return this.PANORAMA;
  6010. case "2":
  6011. case 2:
  6012. return this.DOLLHOUSE;
  6013. case "3":
  6014. case 3:
  6015. return this.FLOORPLAN;
  6016. case "4":
  6017. case 4:
  6018. return this.OUTDOOR
  6019. }
  6020. throw new n("No known conversion for int to viewmode for int: " + e)
  6021. },
  6022. convertWorkshopModeInt: function(e) {
  6023. switch (e) {
  6024. case "0":
  6025. case 0:
  6026. case undefined: //xzw add
  6027. return this.PANORAMA;
  6028. case "1":
  6029. case 1:
  6030. return this.FLOORPLAN;
  6031. case "2":
  6032. case 2:
  6033. return this.DOLLHOUSE;
  6034. case "3":
  6035. case 3:
  6036. return this.MESH
  6037. }
  6038. throw new n("No known conversion for Workshop int to viewmode for int: " + e)
  6039. }
  6040. };
  6041. o.extendObject(a, r),
  6042. t.exports = a
  6043. }
  6044. , {
  6045. "../exception/ViewmodeConvertException": 58,
  6046. "../util/common": 185,
  6047. "./coreViewmodes": 54
  6048. }],
  6049. 52: [function(e, t, i) {
  6050. "use strict";
  6051. t.exports = {
  6052. BLACK: "black",
  6053. STD: "std",
  6054. WALK: "walk"
  6055. }
  6056. }
  6057. , {}],
  6058. 53: [function(e, t, i) {
  6059. "use strict";
  6060. t.exports = {
  6061. ZoomIn: "zoom.in",
  6062. ZoomOut: "zoom.out",
  6063. ZoomMax: "zoom.max",
  6064. ZoomMin: "zoom.min"
  6065. }
  6066. }
  6067. , {}],
  6068. 54: [function(e, t, i) {
  6069. "use strict";
  6070. t.exports = {
  6071. PANORAMA: "panorama",
  6072. DOLLHOUSE: "dollhouse",
  6073. FLOORPLAN: "floorplan"
  6074. }
  6075. }
  6076. , {}],
  6077. 55: [function(e, t, i) {
  6078. "use strict";
  6079. function n(e) {
  6080. this.message = e
  6081. }
  6082. t.exports = n
  6083. }
  6084. , {}],
  6085. 56: [function(e, t, i) {
  6086. "use strict";
  6087. function n(e) {
  6088. r.call(this, e)
  6089. }
  6090. var r = e("./BasicException");
  6091. n.prototype = Object.create(r.prototype),
  6092. t.exports = n
  6093. }
  6094. , {
  6095. "./BasicException": 55
  6096. }],
  6097. 57: [function(e, t, i) {
  6098. "use strict";
  6099. function n(e) {
  6100. r.call(this, e)
  6101. }
  6102. var r = e("./BasicException");
  6103. n.prototype = Object.create(r.prototype),
  6104. t.exports = n
  6105. }
  6106. , {
  6107. "./BasicException": 55
  6108. }],
  6109. 58: [function(e, t, i) {
  6110. "use strict";
  6111. function n(e) {
  6112. r.call(this, e)
  6113. }
  6114. var r = e("./BasicException");
  6115. n.prototype = Object.create(r.prototype),
  6116. t.exports = n
  6117. }
  6118. , {
  6119. "./BasicException": 55
  6120. }],
  6121. 59: [function(e, t, i) {
  6122. (function(i) {
  6123. "use strict";
  6124. function n(e) {
  6125. var t = {};
  6126. if (e) {
  6127. var i = e.flags;
  6128. if (i)
  6129. for (var n in i)
  6130. i.hasOwnProperty(n) && (t[i[n]] = !0);
  6131. return t
  6132. }
  6133. return l.debug("Feature flags -> parseFeatureFlags: rawData is null."),
  6134. null
  6135. }
  6136. var r = e("./util/ajax")
  6137. , o = e("./util/showcase")
  6138. , a = e("./util/logger")
  6139. , s = ""
  6140. , l = new a(i)
  6141. , c = {};
  6142. t.exports = {
  6143. loadFeatureFlags: function(e) {
  6144. var t = $.Deferred();
  6145. return r.get(e.urlBase + s, {
  6146. responseType: "json",
  6147. prefetchFrom: "user",
  6148. auth: o.getAuthorizationHeader()
  6149. }).done(function(e) {
  6150. c = n(e),
  6151. c ? t.resolve(c) : t.reject("loading-failed")
  6152. }).fail(function() {
  6153. l.debug("Retrieval of feature flags failed."),
  6154. t.reject("loading-failed")
  6155. }),
  6156. t.promise()
  6157. },
  6158. getFlags: function() {
  6159. return c
  6160. },
  6161. updateDependentSettings: function(e, t) {
  6162. e = e || c,
  6163. e.labels && (t.labels.enabled = !0),
  6164. e.zooming && !t.zoom.forceOff && (t.zoom.enabled = !0),
  6165. e.showcase_sdk && (t.sdkInit = !0),
  6166. e.mobile_highq_override && (t.tiling.mobileHighQualityOverride = !0),
  6167. e.showcase_webvr && (t.vr.allowWebVR = !0),
  6168. e.uhql && (t.tiling.allowUltraHighResolution = !0),
  6169. e.hide_sc_sharing && (t.share.enabled = !1)
  6170. }
  6171. }
  6172. }
  6173. ).call(this, "/js/featureflags.js")
  6174. }
  6175. , {
  6176. "./util/ajax": 181,
  6177. "./util/logger": 189,
  6178. "./util/showcase": 193
  6179. }],
  6180. 60: [function(e, t, i) {
  6181. "use strict";
  6182. var n = (e("../util/common"),
  6183. {
  6184. status: 0,
  6185. set: function(e) {
  6186. if (isNaN(e))
  6187. return !1;
  6188. var t = $('.progressbar');
  6189. 0 > e && (e = 0);
  6190. e > 100 && (e = 100);
  6191. var width = parseInt(t.css('width').replace("px",""))/100; //获取进度条总长度除以100
  6192. var barperc = e*width;
  6193. var perc = Math.round(e);
  6194. var labelpos = (parseInt(barperc)-15);
  6195. t.find('.bar').css('width',barperc); //已经再跑颜色的百分比
  6196. t.find('.label').css('left', labelpos); //上面跟着的字的百分比
  6197. t.find('.perc').text(perc+'%'); //具体数字的百分比
  6198. this.status = e
  6199. },
  6200. done: function(e) {
  6201. return e || this.status ? (this.status = null,
  6202. this.set(100)) : this
  6203. }
  6204. });
  6205. t.exports.circleLoader = n
  6206. }
  6207. , {
  6208. "../util/common": 185
  6209. }],
  6210. 61: [function(e, t, i) {
  6211. "use strict";
  6212. t.exports = Object.freeze({
  6213. CLOSE: "modal.closer.close"
  6214. })
  6215. }
  6216. , {}],
  6217. 62: [function(e, t, i) {
  6218. "use strict";
  6219. function n(e, t) {
  6220. t && (t.stopPropagation(),
  6221. t.preventDefault()),
  6222. e && this.emit(l.CLOSE, e),
  6223. g.reset()
  6224. }
  6225. function r(e, t) {
  6226. function i() {
  6227. var t = e.offsetHeight >= $("#player").height() && e.offsetWidth >= $("#player").width();
  6228. t !== f && (f = t,
  6229. t ? (e.classList.add("closeByFooter"),
  6230. h.classList.add("closeByFooter")) : (e.classList.remove("closeByFooter"),
  6231. h.classList.remove("closeByFooter")))
  6232. }
  6233. t ? setTimeout(i, o.guiAnimationSpeed) : i()
  6234. }
  6235. var o = e("../../settings")
  6236. , a = (e("../../tag/Media/MediaEvent"),
  6237. e("../../util/browser"))
  6238. , s = e("../../util/common")
  6239. , l = e("./ModalCloserEvent")
  6240. , c = e("events").EventEmitter
  6241. , h = document.getElementsByClassName("footer")[0]
  6242. , u = h.querySelectorAll(".close")[0]
  6243. , d = null
  6244. , p = null
  6245. , f = null
  6246. , g = (a.isMobile(),
  6247. {
  6248. open: function(e) {
  6249. e && (r(e),
  6250. d && u.removeEventListener("click", d, !0),
  6251. d = n.bind(this, e.id),
  6252. u.addEventListener("click", d, !0),
  6253. p && window.removeEventListener("resize", p, !0),
  6254. p = r.bind(this, e),
  6255. window.addEventListener("resize", p, !0))
  6256. },
  6257. reset: function() {
  6258. h.classList.remove("closeByFooter"),
  6259. u.removeEventListener("click", d, !0),
  6260. window.removeEventListener("resize", p, !0),
  6261. d = p = f = null
  6262. }
  6263. });
  6264. s.extendObject(g, c.prototype),
  6265. t.exports = g
  6266. }
  6267. , {
  6268. "../../tag/Media/MediaEvent": 131,
  6269. "../../settings": 166,
  6270. "../../util/browser": 182,
  6271. "../../util/common": 185,
  6272. "./ModalCloserEvent": 61,
  6273. events: 202
  6274. }],
  6275. 63: [function(e, t, i) {
  6276. "use strict";
  6277. function n(e, t, i) {
  6278. var n = new r.GUI({
  6279. width: 400
  6280. })
  6281. , u = n.addFolder("Flydown from Dollhouse");
  6282. u.add(h.flydown, "movementEasing", Object.keys(a)),
  6283. u.add(h.flydown, "movementDelay", 0, 1).step(.01),
  6284. u.add(h.flydown, "rotationEasing", Object.keys(a)),
  6285. u.add(h.flydown, "rotationDelay", 0, 1).step(.01),
  6286. u.add(h.flydown, "modelTextureDelay", 0, 1).step(.01),
  6287. u.add(h.flydown, "skyboxDelay", 0, 1).step(.01),
  6288. u.add(h.dollhouseDefault, "minPolarAngle", 0, o.Math.degToRad(50)),
  6289. u.add(h.dollhouseDefault, "maxPolarAngle", o.Math.degToRad(50), o.Math.degToRad(170));
  6290. var d = n.addFolder("Transition between panos");
  6291. d.add(h.transition, "blur", 0, 10).onFinishChange(function() {}),
  6292. d.add(h.transition, "flySpeed", 0, 10).step(.01).onFinishChange(function() {
  6293. h.transition.flyTime = 0,
  6294. d.__controllers.forEach(function(e) {
  6295. e.updateDisplay()
  6296. })
  6297. }),
  6298. d.add(h.transition, "flyTime", 0, 5e3).onFinishChange(function() {
  6299. h.transition.flySpeed = 0,
  6300. d.__controllers.forEach(function(e) {
  6301. e.updateDisplay()
  6302. })
  6303. }),
  6304. d.add(h.transition, "aimTime", 500, 2500).step(50),
  6305. d.add(h.transition, "aimSlowFactor", 1, 3).step(.1),
  6306. d.add(h.transition, "movementEasing", Object.keys(a));
  6307. var p = n.addFolder("Path Display");
  6308. p.add(h.path, "opacity", 0, 1).step(.01).onFinishChange(function() {}),
  6309. p.add(h.path, "height", 0, .2).step(.01).onFinishChange(function() {}),
  6310. p.add(h.path, "outsideHeight", 0, 2).step(.01).onFinishChange(function() {}),
  6311. p.add(h.path, "ribbonWidth", .01, .35).step(.01).onFinishChange(function() {}),
  6312. p.add(h.path, "waypointRadius", .01, 1.2).step(.01).onFinishChange(function() {}),
  6313. p.add(h.path, "waypointPulse", 0, 3600).step(20).onFinishChange(function() {}),
  6314. p.add(h.path, "waypointIndoorRadius", .01, 1.2).step(.01).onFinishChange(function() {}),
  6315. p.add(h.path, "fadeInTime", 0, 1200).step(10).onFinishChange(function() {}),
  6316. p.add(h.path, "fadeOutTime", 0, 1200).step(10).onFinishChange(function() {}),
  6317. p.add(h.path, "color", Object.keys(l)).onFinishChange(function() {
  6318. h.path.color = l[h.path.color],
  6319. h.path.colorUp = l._desat(h.path.color),
  6320. h.path.colorDown = l.darken(h.path.color)
  6321. }),
  6322. p.add(h, "reticuleColor", Object.keys(l)).onFinishChange(function() {
  6323. h.reticuleColor = l[h.reticuleColor]
  6324. });
  6325. var f = n.addFolder("Warping")
  6326. , g = f.addFolder("Warp/Teleport");
  6327. g.add(h.warp, "softPushDist", 0, 2).onFinishChange(function() {}),
  6328. g.add(h.warp, "softPushEnd", 0, 1).step(.01).onFinishChange(function() {}),
  6329. g.add(h.warp, "softBendAngle", 0, 45).onFinishChange(function() {}),
  6330. g.add(h.warp, "softBendTilt", 0, 45).onFinishChange(function() {}),
  6331. g.add(h.warp, "softBendEnd", 0, 1).step(.01).onFinishChange(function() {}),
  6332. g.add(h.warp, "burnsAngle", 0, 30).onFinishChange(function() {}),
  6333. g.add(h.warp, "minBurnsAngle", 0, 10).onFinishChange(function() {}),
  6334. g.add(h.warp, "brakeStrength", 1, 8).onFinishChange(function() {}),
  6335. g.add(h.warp, "minBrakeAngle", 0, 5).step(.01).onFinishChange(function() {}),
  6336. g.add(h.warp, "maxBrakeAngle", 0, 5).step(.01).onFinishChange(function() {}),
  6337. g.add(h.path, "mapGuides").onFinishChange(function() {}),
  6338. g.add(h.warp, "teleportTime", 0, 5e3).step(10).onFinishChange(function() {}),
  6339. g.add(h.warp, "outsideTime", 0, 5e3).step(10).onFinishChange(function() {}),
  6340. g.add(h.path, "typ", Object.keys(c)).onFinishChange(function() {
  6341. h.path.typ = c[h.path.typ]
  6342. }),
  6343. g.add(h.warp, "loop").onChange(function() {}).onFinishChange(function() {
  6344. t.endlessLoop = h.warp.loop
  6345. }),
  6346. g.add(h.warp, "walkSlideShowThreshhold", 1, 1e4).step(1).onFinishChange(function() {}),
  6347. g.add(h.warp, "walkExtraPanosDistance", 0, 3).step(.1).onFinishChange(function() {}),
  6348. g.add(h.transition, "fastForwardFactor", 1, 10).step(1).onFinishChange(function() {});
  6349. var m = f.addFolder("Long Warp Only");
  6350. m.add(h.warp, "minWarpTime", 0, 5e3).step(10).onFinishChange(function() {
  6351. h.warp.flySpeed = 0,
  6352. m.__controllers.forEach(function(e) {
  6353. e.updateDisplay()
  6354. })
  6355. }),
  6356. m.add(h.warp, "timePerMeter", 0, 5e3).step(10).onFinishChange(function() {}),
  6357. m.add(h.warp, "lookAheadMax", .01, 1).step(.01).onFinishChange(function() {}),
  6358. m.add(h.warp, "lookAheadDist", .01, 4).step(.01).onFinishChange(function() {}),
  6359. m.add(h.warp, "maxTurnPerSec", 0, 720).step(1).onFinishChange(function() {}),
  6360. m.add(h.warp, "maxAimPerSec", 0, 720).step(1).onFinishChange(function() {}),
  6361. m.add(h.warp, "turnFriction", 0, 1).step(.01).onFinishChange(function() {}),
  6362. m.add(h.warp, "walkDelay", 0, 2e3).step(10).onFinishChange(function() {}),
  6363. m.add(h.transition, "flytimeMaxDistanceThreshold", 0, 25).step(10).onFinishChange(function() {}),
  6364. m.add(h.warp, "walkMaxDist", 0, 100).step(1).onFinishChange(function() {});
  6365. var v = n.addFolder("Warp Esoterica");
  6366. v.add(h.warp, "nearPanoDist", .01, 12).step(0).onFinishChange(function() {}),
  6367. v.add(h.warp, "blur", .01, 1).onFinishChange(function() {}),
  6368. v.add(h.warp, "flySpeed", 0, 10).step(.01).onFinishChange(function() {
  6369. h.warp.minWarpTime = 0,
  6370. v.__controllers.forEach(function(e) {
  6371. e.updateDisplay()
  6372. })
  6373. }),
  6374. v.add(h.warp, "showBunny").onFinishChange(function() {}),
  6375. v.add(h.warp, "fastTime", 0, 2500).step(10).onFinishChange(function() {}),
  6376. v.add(h.warp, "movementEasing", Object.keys(a));
  6377. var A = n.addFolder("Misc");
  6378. A.add(h, "dollhouseFOV", 10, 180).onChange(function() {
  6379. i.cameras[s.DOLLHOUSE].fov = h.dollhouseFOV
  6380. }),
  6381. A.add(h, "insideFOV", 10, 180).onChange(function() {
  6382. i.cameras[s.PANORAMA].fov = h.insideFOV
  6383. }),
  6384. A.add(h, "insideLookSpeed", .01, .3).step(.01).onChange(function() {}),
  6385. A.add(h, "rotationAccelerationInside", .1, 10).step(.1).onChange(function() {}),
  6386. A.add(h, "rotationAccelerationOutside", .1, 10).step(.1).onChange(function() {});
  6387. var y = n.addFolder("Navigation");
  6388. y.add(h.navigation, "panoScores").onFinishChange(function() {
  6389. h.navigation.panoScores || e.panos.forEach(function(e) {
  6390. e.floor.remove(e.text3d),
  6391. e.text3d = null
  6392. })
  6393. }),
  6394. y.add(h.navigation, "mouseDirection"),
  6395. y.add(h.navigation, "filterStrictness", 0, 1),
  6396. y.add(h.navigation, "angleFactor", -60, 0),
  6397. y.add(h.navigation, "directionFactor", 1, 20),
  6398. y.add(h.navigation, "distanceFactor", -5, 5),
  6399. y.add(h.navigation, "optionalityFactor", .1, 10);
  6400. var C = n.addFolder("tags")
  6401. , I = C.addFolder("Tag Creation");
  6402. I.add(h.tags.pole, "enabled").name("poleEnabled"),
  6403. I.add(h.tags.pole, "height", 0, 2.5).step(.01).name("poleHeight"),
  6404. I.add(h.tags.pole, "width", 1, 10).step(1).name("poleWidth"),
  6405. I.add(h.tags.pole, "opacity", .1, 1).step(.1).name("poleOpacity");
  6406. var E = C.addFolder("Visibility");
  6407. E.add(h.tags.visibility, "anyDistance"),
  6408. E.add(h.tags.visibility, "visibleDistance", .1, 30).step(.1),
  6409. E.add(h.tags.visibility, "cameraClearance", 0, 1).step(.01),
  6410. E.add(h.tags.visibility, "hideViaFloor"),
  6411. E.add(h.tags.visibility, "hideOffScreenDisc").name("hideEdgeDisc"),
  6412. E.add(h.tags.visibility, "hideOffScreenObject").name("hideEdgeObject");
  6413. var b = C.addFolder("Disc Parameters");
  6414. b.add(h.tags.disc.scale, "nearBound", .1, 10).step(.1),
  6415. b.add(h.tags.disc.scale, "farBound", .1, 20).step(.1).listen(),
  6416. b.add(h.tags.disc.scale, "linkFarBound").onChange(function(e) {
  6417. e && (h.tags.disc.scale.farBound = h.tags.visibility.visibleDistance * (1 - h.tags.disc.scale.linkPercent / 100))
  6418. }),
  6419. b.add(h.tags.disc.scale, "linkPercent", 0, 100).step(1).onChange(function(e) {
  6420. h.tags.disc.scale.linkFarBound && (h.tags.disc.scale.farBound = h.tags.visibility.visibleDistance * (1 - e / 100))
  6421. }),
  6422. b.add(h.tags.disc.scale, "maxSize", 40, 200).step(1),
  6423. b.add(h.tags.disc.scale, "minSize", 20, 100).step(1),
  6424. b.add(h.tags.disc.scale, "responsiveness", 0, 100).step(1);
  6425. var w = C.addFolder("Navigate");
  6426. w.add(h.tags.navigate, "nearestPano").name("nearestPano"),
  6427. w.add(h.tags.navigate, "lineOfSight").name("lineOfSight"),
  6428. w.add(h.tags.navigate, "reactivate").name("reactivate"),
  6429. w.add(h.tags.navigate, "aimAt", ["disc", "object", "pole", "nothing"]).name("aim at"),
  6430. w.add(h.tags.navigate, "tiltTolerance", 0, 50).step(1),
  6431. w.add(h.tags.navigate, "rotateSpeedFactor", 0, 5).step(.1);
  6432. var _ = n.addFolder("Debug");
  6433. _.add(h, "wireframe").onFinishChange(function() {
  6434. e.chunks.forEach(function(t) {
  6435. t.material && (t.wireframeTwin || (t.wireframeTwin = new o.WireframeHelper(t),
  6436. t.wireframeTwin.material.depthWrite = !1,
  6437. t.wireframeTwin.material.depthTest = !1,
  6438. t.wireframeTwin.material.opacity = .5,
  6439. t.wireframeTwin.material.transparent = !0),
  6440. h.wireframe ? e.add(t.wireframeTwin) : e.remove(t.wireframeTwin))
  6441. })
  6442. }),
  6443. _.add(h, "skyboxWireframe").onFinishChange(function() {
  6444. h.skyboxWireframe ? (e.skybox.wireframe = new o.WireframeHelper(e.skybox),
  6445. e.add(e.skybox.wireframe)) : (e.remove(e.skybox.wireframe),
  6446. e.skybox.wireframe = null)
  6447. }),
  6448. _.add(h, "showSweeps").onFinishChange(function() {
  6449. e.setSweepVisibility(h.showSweeps)
  6450. }),
  6451. _.add(h, "showMesh").onFinishChange(function() {
  6452. e.chunks.forEach(function(e) {
  6453. e.visible = h.showMesh
  6454. })
  6455. }),
  6456. _.add(h, "showFloors").onFinishChange(function() {
  6457. e.floors.forEach(function(e) {
  6458. e.collider.children.forEach(function(e) {
  6459. e.material.visible = h.showFloors
  6460. })
  6461. })
  6462. }),
  6463. _.add(h, "showSkyboxes").onFinishChange(function() {
  6464. e.panos.forEach(function(e) {
  6465. e.skyboxMesh.visible = h.showSkyboxes
  6466. })
  6467. }),
  6468. _.add(h, "showNeighbors").onChange(function() {}),
  6469. _.add(e, "alpha", 0, 1)
  6470. }
  6471. var r = e("../lib/dat.gui")
  6472. , o = e("three")
  6473. , a = e("../util/easing")
  6474. , s = e("../enum/Viewmode")
  6475. , l = e("../enum/Colors")
  6476. , c = e("../enum/WarpStyle")
  6477. , h = e("../settings");
  6478. e("../tag/tag");
  6479. r.GUI.prototype.removeFolder = function(e) {
  6480. var t = this.__folders[e];
  6481. t && (t.close(),
  6482. this.__ul.removeChild(t.domElement.parentNode),
  6483. delete this.__folders[e],
  6484. this.onResize())
  6485. }
  6486. ,
  6487. t.exports.toggle = n
  6488. }
  6489. , {
  6490. "../enum/Colors": 19,
  6491. "../enum/Viewmode": 51,
  6492. "../enum/WarpStyle": 52,
  6493. "../lib/dat.gui": 93,
  6494. "../tag/tag": 123,
  6495. "../settings": 166,
  6496. "../util/easing": 186,
  6497. three: 217
  6498. }],
  6499. 64: [function(e, t, i) {
  6500. (function(i) {
  6501. "use strict";
  6502. function n(e, t, i, n) {
  6503. $(".gui-error .error-problem-text").text(e),
  6504. $(".gui-error .error-solution-text").text(t),
  6505. $(".gui-error .error-explanation").text(i),
  6506. $(".gui-error .error-actions").html(n),
  6507. $(window).resize(),
  6508. $(".gui-error").fadeIn(),
  6509. $("#bottom-logo").fadeIn()
  6510. }
  6511. function r(e) {
  6512. 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("");
  6513. n(e, h.ERROR_BROWSER_SOLUTION, h.ERROR_BROWSER_EXPLANATION, t),
  6514. s.isMobile() || $("[rel=tiletip]").tooltip({
  6515. placement: "bottom",
  6516. delay: {
  6517. show: 50,
  6518. hide: 0
  6519. },
  6520. trigger: "hover",
  6521. viewport: {
  6522. selector: "body",
  6523. padding: 10
  6524. }
  6525. })
  6526. }
  6527. function o() {
  6528. var e = s.isMobile() ? "" : '<span class="link install-browser">' + h.ERROR_GENERIC_ACTIONS_2 + "</span>" + h.ERROR_GENERIC_ACTIONS_3
  6529. , t = [h.ERROR_GENERIC_ACTIONS_1, e,].join("");
  6530. n(h.ERROR_GENERIC_PROBLEM, h.ERROR_GENERIC_SOLUTION, "", t),
  6531. s.isMobile() || $(".install-browser").on("click touchstart", function(e) {
  6532. e.preventDefault(),
  6533. e.stopPropagation(),
  6534. r(" ")
  6535. })
  6536. }
  6537. function a(e) {
  6538. if ($("head title").text(c.pageTitle),
  6539. $("#gui-message, #gui-loading, #nprogress, #gui-thumb, #bottom-logo").hide(),
  6540. $("#gui-loading").fadeOut(250),
  6541. $("#quick-blackout").hide(),
  6542. l.track("showcase_error", {
  6543. error_key: e
  6544. }),
  6545. h.locale || h.init(),
  6546. "webgl-unsupported" === e)
  6547. s.isMobile() ? o() : r(h.ERROR_WEBGL_UNSUPPORTED_PROBLEM);
  6548. else if ("webgl-ios" === e)
  6549. 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>.");
  6550. else if ("webgl-safari" === e)
  6551. 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>.");
  6552. else if ("webgl-generic" === e)
  6553. o();
  6554. else if ("missing-urls" === e)
  6555. n(h.ERROR_MISSING_URLS_PROBLEM, "", h.ERROR_MISSING_URLS_EXPLANATION);
  6556. else if ("loading-failed" === e)
  6557. 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>.");
  6558. else {
  6559. if ("loading-failed-maintenance" !== e)
  6560. return void d.error("Unhandled error: " + e);
  6561. n(h.ERROR_MAINTENANCE_PROBLEM, h.ERROR_MAINTENANCE_SOLUTION)
  6562. }
  6563. }
  6564. var s = e("./../util/browser")
  6565. , l = e("./../analytics")
  6566. , c = e("./../settings")
  6567. , h = e("../localization/localize")
  6568. , u = e("./../util/logger")
  6569. , d = new u(i)
  6570. , p = '"https://support.port.com/hc/articles/208220058"';
  6571. t.exports.error = a
  6572. }
  6573. ).call(this, "/js/gui/error.js")
  6574. }
  6575. , {
  6576. "../localization/localize": 108,
  6577. "./../analytics": 4,
  6578. "./../settings": 166,
  6579. "./../util/browser": 182,
  6580. "./../util/logger": 189
  6581. }],
  6582. 65: [function(e, t, i) {
  6583. (function(i) {
  6584. "use strict";
  6585. function n() {
  6586. Ue = [],
  6587. je.floors.visible && Ue.push(".gui-floor", ".gui-floor-title"),
  6588. Ue.push(".hideTarget", ".pinTop.right")
  6589. }
  6590. function r() {
  6591. for (var e in je)
  6592. if (je.hasOwnProperty(e)) {
  6593. var t = je[e];
  6594. if (!t.visible)
  6595. for (var i = 0; i < t.elements.length; i++)
  6596. $(t.elements[i]).hide()
  6597. }
  6598. je.highlight.visible && $(".pinBottom").addClass("highlightExists"),
  6599. je.tourControls.visible === !1 && $("#drawer").addClass("fullWidth"),
  6600. n()
  6601. }
  6602. function o(e, t) {
  6603. var i = !K.isMobile() && Q.zoom.enabled && t.mode === _e.PANORAMA && !e.tourIsPlaying;
  6604. $("#gui-zoomin").toggle(i),
  6605. $("#gui-zoomout").toggle(i)
  6606. }
  6607. function a() {
  6608. c(),
  6609. $(".pinBottom").toggleClass("open"),
  6610. $("#drawer").toggleClass("open"),
  6611. $(".footer").toggleClass("open"),
  6612. $("#drawer").hasClass("open") ? ($("#pullTab .icon").attr("data-original-title", Re.CLOSE_HIGHLIGHTS),
  6613. Ze("highlights")) : ($("#pullTab .icon").attr("data-original-title", Re.OPEN_HIGHLIGHTS),
  6614. ie.resetDrawer()),
  6615. setTimeout(function() {
  6616. $("#pullTab").toggleClass("opened");
  6617. }, $("#drawer").hasClass("open") ? 0 : Q.highlightAnimationDuration),
  6618. $(".pinBottom").hasClass("open") && s($(".vr-popup")) && $(".vr-popup").is(":visible") && Ae.dismiss()
  6619. }
  6620. function s(e) {
  6621. var t;
  6622. "none" !== e.css("display") ? t = e.position().top + e.outerHeight() : (e.attr("style", "visibility: hidden"),
  6623. t = e.position().top + e.outerHeight(),
  6624. e.attr("style", "display: none"));
  6625. var i = $("#player").outerHeight()
  6626. , n = i - 130;
  6627. return n < t + 25
  6628. }
  6629. function l(e) {
  6630. "touchstart" === e.type && e.preventDefault(),
  6631. e.stopPropagation()
  6632. }
  6633. function c() {
  6634. W && (W.reload(),
  6635. W.init())
  6636. }
  6637. function h(e) {
  6638. ne.show(e),
  6639. r()
  6640. }
  6641. function u(e) {
  6642. ne.progress(e)
  6643. }
  6644. function d(e, t, i) {
  6645. var n = t.player;
  6646. $("#gui-thumb").fadeOut(2500),
  6647. ne.hide(function() {
  6648. Ge = !1
  6649. }),
  6650. me.init(e, i),
  6651. de.finishSetup(Object.keys(e.tags).length),
  6652. i.on(Te.IMAGE_OPENED, Ze.bind(this, "tag"));
  6653. var s = function() {
  6654. i.dismissExaminedTag(),
  6655. i.disableHovering()
  6656. };
  6657. Ae.on(ye.OPENED, s),
  6658. Ce.on(Me.OPENED, s),
  6659. he.on(ue.OPENED, s),
  6660. fe.on(ge.OPENED, s);
  6661. var l = i.enableHovering.bind(i);
  6662. if (Ae.on(ye.CLOSED, l),
  6663. Ce.on(Me.CLOSED, l),
  6664. he.on(ue.CLOSED, l),
  6665. fe.on(ge.CLOSED, l),
  6666. Q.labels.enabled && Object.keys(e.labels).length,
  6667. e.floors.length <= 1 || !je.floors.visible ? je.floors.visible = !1 : (y(e, t),
  6668. C(e.currentFloor, n.mode)),
  6669. getQueryVariable('m') === '372'&& (je.floors.visible = 1, y(e,t)),
  6670. r(),
  6671. o(t, t.player),
  6672. $("#gui").fadeIn(1500),
  6673. je.highlight.visible && (2 !== Q.startHighlights || e.has360Views) && setTimeout(function() {
  6674. a(),
  6675. (!e.has360Views && 1 !== Q.startHighlights || e.has360Views && 0 === Q.startHighlights) && setTimeout(a, 2e3)
  6676. }, 2e3),
  6677. !K.isMobile())
  6678. for (var c = ["a", "#title-toggle", ".next-button", ".prev-button", ".gui-floor", ".meta-toggle", ".thumbImg", "logo-button"], h = 0; h < c.length; h++)
  6679. $(c[h]).addClass("hasHover");
  6680. O(e),
  6681. de.setupToggling();
  6682. //xzw:
  6683. window.editHotPanel && editHotPanel();
  6684. //czj
  6685. navBorderRadius(e);
  6686. //czj 编辑界面
  6687. //window.EditingInterface && new EditingInterface(n.sceneRenderer);
  6688. window.EditTools && new EditTools(n.sceneRenderer);
  6689. }
  6690. function navBorderRadius(e){
  6691. var pullTab = $("#pullTab"),
  6692. mobileRadius = {
  6693. "bottom":{"border-bottom-left-radius":"10px","border-bottom-right-radius":"10px"},
  6694. "top":{"border-top-left-radius":"10px","border-top-right-radius":"10px"}
  6695. },
  6696. topRadius = {
  6697. "bottom":{"border-top-right-radius":"10px","border-bottom-right-radius":"10px"},
  6698. "top":{"border-bottom-left-radius":"10px","border-top-left-radius":"10px"}
  6699. };
  6700. function BorderRadius(bottom,top){
  6701. $("#gui-modes-map > div:visible:last").css(bottom);
  6702. if(pullTab.is(':visible')){
  6703. $(".viewContainer > div:visible:first").css(top);
  6704. }else{
  6705. $("#gui-modes-map > div:visible:first").css(top);
  6706. }
  6707. }
  6708. if(/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)){
  6709. BorderRadius(mobileRadius.bottom,mobileRadius.top);
  6710. }else{
  6711. BorderRadius(topRadius.bottom,topRadius.top);
  6712. }
  6713. //判断someData里面是否有special字段,如果有就会处理这些特殊的大场景
  6714. if(window.MP_PREFETCHED_MODELDATA.model.special || window.MP_PREFETCHED_MODELDATA.special){
  6715. window.specialScene && specialScene.special().afterImplement();
  6716. }
  6717. }
  6718. function p(e) {
  6719. e || (e = 0),
  6720. We = !1,
  6721. window.setTimeout(function() {
  6722. We || (ze = !0,
  6723. $("#gui-spinner").stop(!0, !0).show())
  6724. }
  6725. .bind(this), e)
  6726. }
  6727. function f() {
  6728. $("#gui-spinner").stop(!0, !0),
  6729. $("#gui-spinner").fadeOut(1e3),
  6730. We = !0,
  6731. ze = !1
  6732. }
  6733. function g(e, t) {
  6734. // $('#gui-modes-inside img').attr('src','images/inside1.png')
  6735. // $('#gui-modes-dollhouse img').attr('src','images/dollhouse.png')
  6736. // $('#gui-modes-floorplan img').attr('src','images/floor.png')
  6737. var i = e.mode
  6738. , n = t || e.currentPano;
  6739. $("#gui-modes-dollhouse").toggleClass("active", i === _e.DOLLHOUSE),
  6740. $("#gui-modes-floorplan").toggleClass("active", i === _e.FLOORPLAN),
  6741. $("#gui-modes-inside").toggleClass("active", i === _e.PANORAMA),
  6742. i === _e.PANORAMA ? ($("#view-controllers").slideUp(500),
  6743. Q.show360Views.enabled && !n.isAligned() ? (
  6744. $(".gui-floor").addClass("hidden"),
  6745. $("#gui-modes-outside").addClass("desktop-only")) : (
  6746. $(".gui-floor").removeClass("hidden"),
  6747. $("#gui-modes-outside").removeClass("desktop-only")),
  6748. $("#gui-modes-outside").removeClass("hidden")) : i !== _e.TRANSITIONING && (f(),
  6749. Be = i,
  6750. $("#gui-modes-outside").addClass("hidden"),
  6751. e.model.has360Views && $(".gui-floor").removeClass("hidden"),
  6752. $("#view-controllers").is(":visible") || $("#view-controllers").slideDown(Q.guiAnimationSpeed))
  6753. setTimeout(()=>{
  6754. // console.log(1111111,$('#gui-modes-inside').attr('class'));
  6755. if($('#gui-modes-inside').attr('class')==='active'){
  6756. $('#gui-modes-inside img').attr('src','images/inside1.png')
  6757. $('#gui-modes-dollhouse img').attr('src','images/dollhouse.png')
  6758. $('#gui-modes-floorplan img').attr('src','images/floor.png')
  6759. }
  6760. },500)
  6761. }
  6762. function m(e, t) {
  6763. // console.log(1111111);
  6764. var i = t.player;
  6765. $("#gui-modes-inside").on("mousedown touchstart", function(e) {
  6766. l(e),
  6767. J.updateInteraction(Se.InteractionGui, "inside-button"),
  6768. J.track("USER", {
  6769. event_type: "showcase_gui",
  6770. gui_action: "click_inside_mode_button"
  6771. }),
  6772. t.changeMode(_e.PANORAMA);
  6773. // console.log(333333);
  6774. $('#gui-modes-inside img').attr('src','images/inside1.png')
  6775. $('#gui-modes-dollhouse img').attr('src','images/dollhouse.png')
  6776. $('#gui-modes-floorplan img').attr('src','images/floor.png')
  6777. }),
  6778. // $("#gui-modes-inside").on("click", function(e) {
  6779. // $('#gui-modes-inside img').attr('src','images/inside1.png')
  6780. // $('#gui-modes-dollhouse img').attr('src','images/dollhouse.png')
  6781. // $('#gui-modes-floorplan img').attr('src','images/floor.png')
  6782. // }),
  6783. $("#gui-modes-outside").find("a").on("click", function(e) {
  6784. l(e),
  6785. J.track("showcase_gui", {
  6786. gui_action: "click_outside_mode_button"
  6787. }),
  6788. t.changeMode(Be)
  6789. }),
  6790. $("#gui-modes-floorplan").on("click", function(e) {
  6791. l(e),
  6792. i.mode !== _e.FLOORPLAN && (J.track("showcase_gui", {
  6793. gui_action: "click_floorplan_mode_button"
  6794. }),
  6795. t.changeMode(_e.FLOORPLAN));
  6796. $('#gui-modes-inside img').attr('src','images/inside.png')
  6797. $('#gui-modes-dollhouse img').attr('src','images/dollhouse.png')
  6798. $('#gui-modes-floorplan img').attr('src','images/floor1.png')
  6799. }),
  6800. $("#gui-modes-dollhouse").on("click", function(e) {
  6801. l(e),
  6802. i.mode !== _e.DOLLHOUSE && (J.track("showcase_gui", {
  6803. gui_action: "click_dollhouse_mode_button"
  6804. }),
  6805. t.changeMode(_e.DOLLHOUSE));
  6806. $('#gui-modes-inside img').attr('src','images/inside.png')
  6807. $('#gui-modes-dollhouse img').attr('src','images/dollhouse1.png')
  6808. $('#gui-modes-floorplan img').attr('src','images/floor.png')
  6809. })
  6810. }
  6811. function v(e, t) {
  6812. function i() {
  6813. document.getElementById("vr").classList.remove("hidden"),
  6814. Q.vr.allowWebVR ? K.getVRDisplay().then(function(e) {
  6815. K.supportsFullscreen() ? n(e) : (De.warn("Unable to use WebVR when full screen is not supported"),
  6816. $(".improper-embed").toggleClass("hidden", !1),
  6817. r())
  6818. }, function(e) {
  6819. r()
  6820. }) : r()
  6821. }
  6822. function n(i) {
  6823. De.info(i.displayName + " detected, VR button activates WebVR experience"),
  6824. Ie.init(e.data, t, i, q),
  6825. Ie.on(Ee.OPENED, Ze.bind(gui, "vr")),
  6826. Ie.on(Ee.SHOW_TERMS, fe.show.bind(fe))
  6827. }
  6828. function r() {
  6829. De.info("WebVR support not found, VR button activates native app VR modal"),
  6830. Ae.init(e.data, q),
  6831. Ae.on(ye.OPENED, function() {
  6832. var e = document.getElementById("vr-modal");
  6833. return function() {
  6834. Ze("vr"),
  6835. le.open(e)
  6836. }
  6837. }()),
  6838. Ae.on(ye.CLOSED, le.reset)
  6839. }
  6840. if (Q.vr.enabled && e.supportsVR && !K.valueFromHash("mls", 0)){
  6841. /*********************** 方奕卓 VR功能事件监听 ********************/
  6842. K.isMobile() && $('#vr').css('display', ''); // 显示vr功能按钮
  6843. switch (Q.vr.option) {
  6844. case Pe.CONTEXTUAL:
  6845. i();
  6846. break;
  6847. case Pe.ANDROID:
  6848. K.detectAndroid() && i();
  6849. break;
  6850. case Pe.NONE:
  6851. }
  6852. }
  6853. }
  6854. function A(e, t) {
  6855. $("#play").on("mousedown touchstart", function(e) {
  6856. l(e);
  6857. Ze("tour");
  6858. ve.play();
  6859. J.trackAlways("showcase_gui", {
  6860. gui_action: "play_highlights"
  6861. })
  6862. }),
  6863. window.startAndPlay = function(e) {
  6864. // l(e);
  6865. Ze("tour");
  6866. ve.play();
  6867. J.trackAlways("showcase_gui", {
  6868. gui_action: "play_highlights"
  6869. })
  6870. };
  6871. $("#pause").on("mousedown touchstart", function(e) {
  6872. l(e),
  6873. ve.pause(),
  6874. J.trackAlways("showcase_gui", {
  6875. gui_action: "pause_highlights"
  6876. })
  6877. }),
  6878. $("#gui-zoomin").find("a").on("click", function(e) {
  6879. l(e),
  6880. t.player.zoomInIncrementally()
  6881. }),
  6882. $("#gui-zoomout").find("a").on("click", function(e) {
  6883. l(e),
  6884. t.player.zoomOutIncrementally()
  6885. })
  6886. }
  6887. function y(e, t) {
  6888. for (var i = $(".gui-floor"), n = 0; n < e.floors.length; n++) {
  6889. if(getQueryVariable('m') === '372') continue;
  6890. var r = $('<div class="floorChoice" data-index="' + n + '"></div>').text(e.floors.get(n).name);
  6891. $(".gui-floor").find(".container").prepend(r)
  6892. //cxz 本来一开始是prepend 后来改了append 按顺序插入
  6893. }
  6894. i.find(".container").prepend('<div class="floorChoice darkGlass allFloorBtn" data-index="all" style="display:none">' + Re.FLOOR_ALL + "</div>"),
  6895. i.on("click", function(e) {
  6896. l(e),
  6897. Ze("floor"),
  6898. i.toggleClass("open")
  6899. }),
  6900. $(".floorChoice").on("click", function(e) {
  6901. l(e);
  6902. var n = $(this).data("index");
  6903. "all" !== n ? (J.updateInteraction(Se.InteractionGui, "floor-control"),
  6904. t.player.gotoFloor(n),
  6905. J.track("showcase_gui", {
  6906. gui_action: "click_floor_select_button",
  6907. interaction_source: "gui"
  6908. })) : (J.updateInteraction(Se.InteractionGui, "floor-control"),
  6909. Ze("move"),
  6910. t.allFloors(),
  6911. J.track("showcase_gui", {
  6912. gui_action: "click_toggle_all_floors_button",
  6913. interaction_source: "gui"
  6914. })),
  6915. i.removeClass("open")
  6916. })
  6917. }
  6918. function C(e, t) {
  6919. 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()),
  6920. e.model.allFloorsVisible ? ($(".gui-floor-title").text(Re.FLOOR_ALL),
  6921. $(".gui-floor-number").text(Re.FLOOR_ALL),
  6922. $(".floorChoice").removeClass("active"),
  6923. $('.floorChoice[data-index="all"]').addClass("active")) : ($(".gui-floor-title").text(e.name),
  6924. $(".gui-floor-number").text(" " + (e.floorIndex + 1)),
  6925. $(".floorChoice").removeClass("active"),
  6926. $(".floorChoice[data-index=" + e.floorIndex + "]").addClass("active")))
  6927. }
  6928. function I(e) {
  6929. return e.describe().inTransition
  6930. }
  6931. function b(e, t, i) {
  6932. Fe = e.heroLocations.length;
  6933. var n = '<li class="thumbImg" data-index=""><img src=""></li>'
  6934. , r = 100 / Fe + "%"
  6935. , o = $("#thumb-container")
  6936. , a = $("#progressBar");
  6937. $("#status").find(".totalSteps").text(Fe);
  6938. for (var s = 0; s < Fe; s++) {
  6939. var c = e.heroLocations[s]
  6940. , h = $(n);
  6941. var thumbUrl
  6942. if(c.heroLocations){//有子项,选第一张截图
  6943. thumbUrl = manage.dealURL(c.heroLocations[0].thumbUrl)//.replace('https://','').replace('http://','')
  6944. }else{
  6945. thumbUrl = manage.dealURL(c.thumbUrl)//.replace('https://','').replace('http://','')
  6946. }
  6947. h.attr("data-index", s)
  6948. je.highlight.visible && h.find("img").attr("src", thumbUrl)
  6949. if (c.name) {
  6950. var u = $('<div class="overlay"></div>').text(c.name);
  6951. h.prepend(u)
  6952. }
  6953. if (e.has360Views && c.cameraMode === _e.PANORAMA) {
  6954. var d = e.panos.get(c.panoId)
  6955. , p = d && !d.isAligned()
  6956. , 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>';
  6957. h.prepend(f)
  6958. }
  6959. o.append(h),
  6960. a.append('<div class="step" data-idx="' + s + '" style="width:' + r + '"></div>')
  6961. }
  6962. j = 144 * Fe,
  6963. Y = 111 * Fe,
  6964. $(".thumbImg").on("mouseover", function() {
  6965. I(t) || i.showPathToHeroLocation([$(this).data("index"),0])//改
  6966. }),
  6967. $(".thumbImg").on("mouseout", function() {
  6968. t.clearPath()
  6969. }),
  6970. $(".thumbImg").on("click", function(e) {
  6971. l(e);
  6972. var i = $(this);
  6973. J.updateInteraction(Se.InteractionGui, "thumbnail"),
  6974. J.trackAlways("showcase_gui", {
  6975. gui_action: "click_highlight"
  6976. }),
  6977. t.goToHighlight([i.data("index"),0])//改
  6978. }),
  6979. $(".previous").find("a").on("click", function(e) {
  6980. l(e),
  6981. J.trackAlways("showcase_gui", {
  6982. gui_action: "prev_highlight"
  6983. }),
  6984. t.prevHighlight()
  6985. }),
  6986. $(".next").find("a").on("click", function(e) {
  6987. l(e),
  6988. J.trackAlways("showcase_gui", {
  6989. gui_action: "next_highlight"
  6990. }),
  6991. t.nextHighlight()
  6992. }),
  6993. $("#drawer").on("mouseleave", function(e) {
  6994. l(e);
  6995. var t;
  6996. try {
  6997. t = new MouseEvent("mouseup",{
  6998. clientX: e.clientX,
  6999. clientY: e.clientY,
  7000. screenX: e.screenX,
  7001. screenY: e.screenY
  7002. })
  7003. } catch (i) {
  7004. t = document.createEvent("MouseEvents"),
  7005. 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)
  7006. }
  7007. document.dispatchEvent(t)
  7008. }),
  7009. W = new Sly($("#scrollFrame"),{
  7010. horizontal: !0,
  7011. itemNav: "centered",
  7012. smart: !0,
  7013. scrollTrap: !0,
  7014. scrollBy: 1,
  7015. mouseDragging: !0,
  7016. touchDragging: !0,
  7017. speed: 300,
  7018. dragHandle: !0,
  7019. dynamicHandle: !0,
  7020. clickBar: !0,
  7021. scrollBar: $("#scroller"),
  7022. activateOn: null
  7023. }).init(),
  7024. W.on("active", function(e, t) {
  7025. Ve = t,
  7026. Ze("tour"),
  7027. $(".step").removeClass("active"),
  7028. $("#status").find(".curIdx").text(t + 1);
  7029. for (var i = 0; i <= t; i++)
  7030. $("#progressBar").find("[data-idx='" + i + "']").addClass("active")
  7031. }),
  7032. w()
  7033. }
  7034. function w() {
  7035. var e = $("#player").width() - 20
  7036. , t = $("#scroller")
  7037. , i = $("#drawer")
  7038. , n = $(".pinBottom");
  7039. if ($("#player").width() < 488 || $("#player").height() < 488)
  7040. t.addClass("hidden"),
  7041. i.addClass("noScroll"),
  7042. n.addClass("noScroll");
  7043. else {
  7044. var r = j > e
  7045. , o = !i.hasClass("noScroll")
  7046. , a = r !== o;
  7047. a && (t.toggleClass("hidden"),
  7048. i.toggleClass("noScroll"),
  7049. n.toggleClass("noScroll"))
  7050. }
  7051. }
  7052. function _(e) {
  7053. je.tourControls.visible = true//e.tour_buttons && K.valueFromHash("gt", 1),
  7054. je.coBrand.visible = e.presented_by && 1 !== Q.specialEdition && Q.brand && !K.valueFromHash("mls", !1),
  7055. je.highlight.visible = /* e.highlight_reel && */ 1 !== Q.specialEdition && Q.showHighlights
  7056. }
  7057. function T(e) {
  7058. function t(t, i) {
  7059. return !!e.player_options[t] && e[i || t]
  7060. }
  7061. $(".model-title").text(e.name);
  7062. var i = Q.pageTitle;
  7063. // 2 !== K.valueFromHash("mls", 0) && (i = e.name + " - " + i),
  7064. 2 !== K.valueFromHash("mls", 0) && e.name && (i = e.name),
  7065. document.title = i ,
  7066. K.isMobile() ? $("#gui-fullscreen").css("display", "none") : ($("[rel=tooltip]").tooltip({
  7067. delay: {
  7068. show: 50,
  7069. hide: 0
  7070. },
  7071. trigger: "hover",
  7072. html: !1,
  7073. viewport: {
  7074. selector: "body",
  7075. padding: 10
  7076. }
  7077. }),
  7078. K.inIframe() && document.getElementsByClassName("pinBottom-container")[0].classList.add("embed")),
  7079. // 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"),
  7080. de.populate({
  7081. name: t("model_name", "name"),
  7082. coBrand: t("presented_by"),
  7083. description: t("model_summary", "summary") || "暂无内容",
  7084. contactName: t("contact_name"),
  7085. address: t("address"),
  7086. phone: t("contact_phone"),
  7087. formattedPhone: e.formatted_contact_phone,
  7088. email: t("contact_email"),
  7089. url: t("external_url"),
  7090. socialSharing: e.enable_social_sharing && e.is_public
  7091. })
  7092. }
  7093. function x(e, t, i, n, r, o) {
  7094. function a() {
  7095. o.setLoadingStartTime(),
  7096. H(),
  7097. r ? (re.showMessage(t, i, je.coBrand.visible),
  7098. l()) : h(l)
  7099. }
  7100. var s = $.Deferred()
  7101. , l = s.resolve.bind(s);
  7102. return Ge = !0,
  7103. O(e),
  7104. e.data.player_options && _(e.data.player_options),
  7105. 1 === Q.specialEdition && $("body").addClass("specialEdition"),
  7106. Re.localizeGUI(),
  7107. T(e.data),
  7108. r || $(".quick").addClass("hidden"),
  7109. //e.data.image && !r && E(e.data.image),
  7110. n ? (J.impression(),
  7111. a()) : (o.setWaitingStartTime(),
  7112. oe.show(r, a)),
  7113. s
  7114. }
  7115. function S(e, t, i, n, r, a, s) {
  7116. q = s,
  7117. e.outsideAllowed() || $("#gui-modes-outside").addClass("invisible"),
  7118. e.supportedModes[_e.PANORAMA] || $("#gui-modes-inside").addClass("invisible"),
  7119. ae.init(),
  7120. re.init(e, a),
  7121. Oe.init(e, t, n),
  7122. $(".icon").on("mouseover", function() {
  7123. t.player && t.player.reticule.hide()
  7124. }),
  7125. m(e, t),
  7126. A(e, t),
  7127. e.data.enable_social_sharing && e.data.is_public && Q.share.enabled && (Ce.init(MP_PREFETCHED_MODELDATA.name/* e.data.name */),
  7128. Ce.on(Me.OPENED, function() {
  7129. var e = document.getElementById("share-modal");
  7130. return function() {
  7131. Ze("share"),
  7132. le.open(e)
  7133. }
  7134. }()),
  7135. Ce.on(Me.CLOSED, le.reset)),
  7136. e.heroLocations.length > 0 ? b(e, t, i) : (je.highlight.visible = !1,
  7137. je.tourControls.visible = !1),
  7138. de.on(pe.OPEN_INFO, Ze.bind(this, "info")),
  7139. z(),
  7140. g(i),
  7141. v(e, r),
  7142. e.on("floor.changed", C),
  7143. e.on("waiting", R.bind(this, e)),
  7144. e.on("waiting-done", P.bind(this, e)),
  7145. i.on(xe.ModeChanged, function(e, n) {
  7146. g(i),
  7147. o(t, i),
  7148. n === _e.PANORAMA && i.currentPano && !i.currentPano.isAligned() && (n = _e.OUTDOOR),
  7149. he.updateMode(n)
  7150. }),
  7151. n.on(Se.Move, Ze.bind(this, "move")),
  7152. i.on(xe.Ready, function() {
  7153. ie.init(n, i, i.tagManager, t),
  7154. i.on(xe.ModeChanged, function(e, t) {
  7155. e !== t && $(".vr-popup").is(":visible") && Ae.dismiss()
  7156. })
  7157. }),
  7158. i.on(xe.PanoChosen, function(e, t) {
  7159. g(i, t),
  7160. he.updateMode(t && !t.isAligned() ? _e.OUTDOOR : _e.PANORAMA)
  7161. }),
  7162. le.on(ce.CLOSE, function(e) {
  7163. switch (e) {
  7164. case "vr-modal":
  7165. Ae.dismiss();
  7166. break;
  7167. case "share-modal":
  7168. Ce.hide();
  7169. break;
  7170. case "terms-modal":
  7171. fe.hide()
  7172. }
  7173. });
  7174. var l = $("#play").eq(0)
  7175. , c = $("#pause").eq(0)
  7176. , h = $(".pinBottom").toArray()
  7177. , u = $("#drawer").eq(0)
  7178. , d = $("#playHead").eq(0)
  7179. , p = $("#progressBar").eq(0)
  7180. , f = $("#thumb-container").eq(0)
  7181. , y = f.children()
  7182. , I = p.children();
  7183. t.on("update.controls", function() {
  7184. var n = t.describe();
  7185. n.tourIsPlaying || i.isWarping() ? (je.tourControls.visible && (l.hide(),
  7186. c.show()),
  7187. n.tourInProgress && (h.forEach(function(e) {
  7188. e.classList.add("playing")
  7189. }),
  7190. u.addClass("playing"),
  7191. d.addClass("playing"))) : (je.tourControls.visible && (l.show(),
  7192. c.hide()),
  7193. n.tourInProgress || (ve.stopTour(),
  7194. h.forEach(function(e) {
  7195. e.classList.remove("playing")
  7196. }),
  7197. u.removeClass("playing"),
  7198. d.removeClass("playing")));
  7199. var r, a, s;
  7200. if (null !== n.currentItem) {
  7201. var p, f;
  7202. $("#status").find(".curIdx").text(n.currentItem[0] + 1),
  7203. n.onTheBus ? (p = "active",
  7204. f = "recent") : (f = "active",
  7205. p = "recent");
  7206. var g = null === n.destinationItem || n.currentItem[0] === n.destinationItem[0];
  7207. for (r = 0; r < e.heroLocations.length; r += 1)
  7208. s = y.eq(r),
  7209. a = I.eq(r),
  7210. s.removeClass(f),
  7211. a.removeClass(f),
  7212. n.onTheBus && r === n.destinationItem[0] ? (s.addClass(p),
  7213. a.addClass(p),
  7214. W.activate(r)) : n.onTheBus && g && r === n.currentItem[0] ? (s.addClass(p),
  7215. a.addClass(p)) : (s.removeClass(p),
  7216. a.removeClass(p))
  7217. } else
  7218. for (r = 0; r < e.heroLocations.length; r += 1)
  7219. s = y.eq(r),
  7220. a = I.eq(r),
  7221. s.removeClass("active recent"),
  7222. a.removeClass("active recent");
  7223. o(t, i)
  7224. }),
  7225. document.addEventListener("keydown", function(n) {
  7226. switch (J.updateInteraction(Se.InteractionKey),
  7227. n.which) {
  7228. case we.ZERO:
  7229. Q.debug && e.toggleAlpha();
  7230. break;
  7231. case we.NINE:
  7232. Q.debug && se.toggle();
  7233. break;
  7234. case we.ONE:
  7235. i.isInMode(_e.TRANSITIONING) || t.changeMode(_e.PANORAMA);
  7236. break;
  7237. case we.TWO:
  7238. e.outsideAllowed() && !i.isInMode(_e.DOLLHOUSE, _e.TRANSITIONING) && t.changeMode(_e.DOLLHOUSE);
  7239. break;
  7240. case we.THREE:
  7241. e.outsideAllowed() && !i.isInMode(_e.FLOORPLAN, _e.TRANSITIONING) && t.changeMode(_e.FLOORPLAN);
  7242. break;
  7243. case we.FOUR:
  7244. i.isInMode(_e.TRANSITIONING) || t.changeMode(_e.OUTDOOR);
  7245. break;
  7246. case we.SPACE:
  7247. je.tourControls.visible && ($("#playHead").hasClass("playing") || Ze("tour"));
  7248. break;
  7249. case we.RETURN:
  7250. Q.debug && e.toggleExplodeUp();
  7251. break;
  7252. case we.P:
  7253. k();
  7254. break;
  7255. case we.U:
  7256. B();
  7257. break;
  7258. case we.X:
  7259. Q.debug && e.toggleExplode();
  7260. break;
  7261. case we.PLUSEQUALS:
  7262. t.player.activatePersistentZooming(!0),
  7263. ie.hideUi();
  7264. break;
  7265. case we.DASHUNDERSCORE:
  7266. t.player.activatePersistentZooming(!1),
  7267. ie.hideUi();
  7268. break;
  7269. case we.SEVEN:
  7270. De.info("Zoom level: " + t.player.zoomLevel + ", FOV: " + t.player.zoomFov);
  7271. break;
  7272. case we.EIGHT:
  7273. t.player.decreaseZoomSpeed();
  7274. break;
  7275. case we.NINE:
  7276. t.player.increaseZoomSpeed()
  7277. }
  7278. return i && i.reticule.hide(),
  7279. !0
  7280. }
  7281. .bind(this)),
  7282. document.addEventListener("keyup", function(e) {
  7283. switch (e.which) {
  7284. case we.PLUSEQUALS:
  7285. t.player.deactivatePersistentZooming();
  7286. break;
  7287. case we.DASHUNDERSCORE:
  7288. t.player.deactivatePersistentZooming()
  7289. }
  7290. }
  7291. .bind(this)),
  7292. F(e),
  7293. L(e, t.player),
  7294. M(i),
  7295. te.setAutoPlay(e.heroCount()),
  7296. he.init(i, a.mode),
  7297. he.on(ue.OPENED, Ze.bind(this, "help")),
  7298. fe.init(),
  7299. fe.on(ge.OPENED, function() {
  7300. var e = document.getElementById("terms-modal");
  7301. return function() {
  7302. Ze("terms"),
  7303. le.open(e)
  7304. }
  7305. }()),
  7306. fe.on(ge.CLOSED, le.reset),
  7307. Q.quickstart.enabled || re.delayLanding(a.mode).then(re.showMessage.bind(this, i, t, je.coBrand.visible)),
  7308. (Q.quickstart.enabled || i.model.outsideAllowed()) && ie.init(n, i, i.tagManager, t),
  7309. Q.profiling.enabled && se.show(),
  7310. ve.init(t)
  7311. }
  7312. function M(e) {
  7313. var t = function(e, t) {
  7314. $(e).find("a").each(function(e, i) {
  7315. t ? $(i).removeClass("buttonZoomDisabled").addClass("buttonZoomEnabled") : $(i).addClass("buttonZoomDisabled").removeClass("buttonZoomEnabled"),
  7316. i.style.pointerEvents = t ? "auto" : "none"
  7317. })
  7318. }
  7319. , i = function() {
  7320. e.zoomLevel >= Q.zoom.max ? t("#gui-zoomin", !1) : t("#gui-zoomin", !0),
  7321. e.zoomLevel <= Q.zoom.min ? t("#gui-zoomout", !1) : t("#gui-zoomout", !0)
  7322. };
  7323. e.on(Ne.ZoomMax, function() {
  7324. t("#gui-zoomin", !1),
  7325. t("#gui-zoomout", !0)
  7326. }),
  7327. e.on(Ne.ZoomMin, function() {
  7328. t("#gui-zoomin", !0),
  7329. t("#gui-zoomout", !1)
  7330. }),
  7331. e.on(Ne.ZoomIn, function() {
  7332. t("#gui-zoomout", !0)
  7333. }),
  7334. e.on(Ne.ZoomOut, function() {
  7335. t("#gui-zoomin", !0)
  7336. }),
  7337. i()
  7338. }
  7339. function R(e) {
  7340. O(e)
  7341. }
  7342. function P(e) {
  7343. O(e)
  7344. }
  7345. function O(e) {
  7346. var t = e.waitQueue.length;
  7347. t <= 0 ? f() : Ge || p(Q.modelComponentLoadSpinnerDelay)
  7348. }
  7349. function L(e, t) {
  7350. He = {
  7351. gui: null,
  7352. visible: !1,
  7353. model: e,
  7354. player: t
  7355. }
  7356. }
  7357. function D(e, t) {
  7358. function i() {
  7359. var i = t.toJSON();
  7360. n.linkToLocation = window.location.protocol + "//" + window.location.host + window.location.pathname + "?m=" + e.sid + "&start=" + be.serialize(i),
  7361. t.tagManager.activeTag && (n.linkToLocation += "&tag=" + t.tagManager.activeTag.sid)
  7362. }
  7363. var n = {}
  7364. , r = new Le.GUI({
  7365. autoPlace: !0,
  7366. width: "60%"
  7367. });
  7368. i(),
  7369. t.on(xe.ViewChanged, i),
  7370. r.add(n, "linkToLocation").name(Re.LINK_TO_LOCATION).listen(),
  7371. r.domElement.id = "datLinks";
  7372. var o = [].slice.call(r.domElement.querySelectorAll(".property-name"));
  7373. return o.forEach(function(e) {
  7374. if (!K.detectSafari()) {
  7375. var t = document.createElement("button");
  7376. t.classList.add("btn-deep-link"),
  7377. t.innerText = Re.MENU_COPY,
  7378. e.nextSibling.appendChild(t);
  7379. var i = function() {
  7380. alert(Re.LINK_ALERT_COPY),
  7381. t.hide()
  7382. };
  7383. t.addEventListener("click", function(e) {
  7384. try {
  7385. var t = e.target.parentNode.childNodes[0];
  7386. t.select();
  7387. var n = document.execCommand("copy");
  7388. t.blur(),
  7389. n || i()
  7390. } catch (e) {
  7391. i()
  7392. }
  7393. })
  7394. }
  7395. }),
  7396. $(r.__closeButton).hide(),
  7397. r
  7398. }
  7399. function N(e) {
  7400. He.gui || (He.gui = D(He.model, He.player)),
  7401. He.visible = e,
  7402. e ? $(He.gui.domElement).show() : $(He.gui.domElement).hide()
  7403. }
  7404. function B() {
  7405. N(!He.visible)
  7406. }
  7407. function F(e) {
  7408. ke = {
  7409. gui: null,
  7410. visible: !1,
  7411. model: e
  7412. }
  7413. }
  7414. function V(e) {
  7415. var t = new Le.GUI;
  7416. return t.add(Q, "showSweeps").name("Show sweeps").onFinishChange(function() {
  7417. e.setSweepVisibility(Q.showSweeps)
  7418. }),
  7419. t.add(Q, "rotationAccelerationInside", .1, 10).name("Rotation speed").step(.1),
  7420. t.add(Q.transition, "flyTime", 0, 5e3).name("Transition time").onFinishChange(function() {
  7421. Q.transition.flySpeed = 0,
  7422. t.__controllers.forEach(function(e) {
  7423. e.updateDisplay()
  7424. })
  7425. }),
  7426. t.add(Q.path, "opacity", 0, 1).name("Path opacity"),
  7427. $(t.__closeButton).hide(),
  7428. t
  7429. }
  7430. function U(e) {
  7431. ke.gui || (ke.gui = V(ke.model)),
  7432. ke.visible = e,
  7433. e ? $(ke.gui.domElement).show() : $(ke.gui.domElement).hide()
  7434. }
  7435. function k() {
  7436. U(!ke.visible)
  7437. }
  7438. function H() {
  7439. function e(e) {
  7440. e.target === t || $.contains(t, e.target) || e.target === i || $.contains(i, e.target) || e.target === n || $.contains(n, e.target)/* || e.preventDefault()*/
  7441. }
  7442. $("body").css("touch-action", "none"),
  7443. $("#gui-parent").find("*:not(#tag-billboards)").on("touchmove", function(e) {
  7444. // e.preventDefault()
  7445. });
  7446. var t = document.getElementById("terms-text")
  7447. , i = document.getElementById("more-help-wrapper")
  7448. , n = (document.getElementById("navigation-help-wrapper"),
  7449. document.getElementById("help-dialog"),
  7450. document.getElementById("tag-billboards"));
  7451. Q.useWheel && (document.body.addEventListener("mousewheel", e, { passive: false }),
  7452. document.body.addEventListener("DOMMouseScroll", e)),
  7453. $("#terms-text, #more-help-wrapper, #navigation-help-wrapper").off("touchmove").on("touchmove", function(e) {
  7454. e.stopPropagation()
  7455. })
  7456. }
  7457. function G(e, t) {
  7458. for (var i = []; e; )
  7459. i.push(e),
  7460. e = e.parentNode;
  7461. for (; t && i.indexOf(t) === -1; )
  7462. t = t.parentNode;
  7463. return t
  7464. }
  7465. function z() {
  7466. var e, t = function(t) {
  7467. e = 0 === t.button || 1 === t.which ? t.target : null
  7468. }, i = function(t) {
  7469. e !== t.target && (e = G(e, t.target));
  7470. var i = document.getElementById("gui-parent");
  7471. if (G(i, e) !== i && (e = null),
  7472. e) {
  7473. var n;
  7474. try {
  7475. n = new MouseEvent("click",t)
  7476. } catch (e) {
  7477. n = document.createEvent("MouseEvents"),
  7478. 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)
  7479. }
  7480. n.syntheticClick = !0,
  7481. e.dispatchEvent(n),
  7482. e = null
  7483. }
  7484. };
  7485. document.body.addEventListener("mousedown", t, !0),
  7486. document.body.addEventListener("mouseup", i, !0),
  7487. document.getElementById("gui-parent").addEventListener("click", function(e) {
  7488. e.syntheticClick || (e.stopPropagation(),
  7489. "A" === e.target.nodeName && e.preventDefault())
  7490. }, !0)
  7491. }
  7492. var W, j, Y, X, Z, q, K = (e("three"),
  7493. e("../util/ajax"),
  7494. e("../util/browser")), Q = e("../settings"), J = e("../analytics"), ee = (e("../util/transitions"),
  7495. e("../util/camera"),
  7496. e("../util/logger")), te = (e("../objects/Snapshot"),
  7497. 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"),
  7498. e("../tag/Media/MediaEvent")), xe = (e("../enum/PathDiscardMode"),
  7499. e("../enum/PathDisplayMode"),
  7500. e("../enum/DirectorEvents"),
  7501. e("../enum/PlayerEvents")), Se = e("../enum/ControlEvents"), Me = e("./sharing/ShareEvents"), Re = e("../localization/localize"), Pe = (e("../enum/Vectors"),
  7502. e("../enum/WarpStyle"),
  7503. e("../enum/AlignmentType"),
  7504. e("../enum/VROption")), Oe = e("./konami"), Le = e("../lib/dat.gui"), De = new ee(i), Ne = (e("../util/showcase"),
  7505. e("../enum/ZoomEvents")), Be = _e.DOLLHOUSE, Fe = 0, Ve = 0, Ue = [".hideTarget"], ke = null, He = null, Ge = !1, ze = !1, We = !1, je = {
  7506. coBrand: {
  7507. visible: !0,
  7508. elements: [".co-brand", "#loaderCoBrand"]
  7509. },
  7510. help: {
  7511. visible: !0,
  7512. elements: [".nav-help", "#nav-help"]
  7513. },
  7514. tourControls: {
  7515. visible: !0,
  7516. elements: [".next", ".previous", "#play"]
  7517. },
  7518. highlight: {
  7519. visible: !0,
  7520. elements: ["#drawer", "#pullTab"]
  7521. },
  7522. share: {
  7523. visible: !0,
  7524. elements: [".socialButton", "#share"]
  7525. },
  7526. fullScreen: {
  7527. visible: !0,
  7528. elements: ["#gui-fullscreen"]
  7529. },
  7530. floors: {
  7531. visible: !0,
  7532. elements: [".gui-floor"]
  7533. }
  7534. }, Ye = function() {
  7535. var e = document.getElementById("drawer");
  7536. return function() {
  7537. $("#player").height() < 400 && e.classList.contains("open") && a()
  7538. }
  7539. }(), Xe = function() {
  7540. var e = document.getElementById("meta-info");
  7541. return function() {
  7542. $("#player").height() < 400 && e.classList.contains("expand") && de.toggleMeta(!0)
  7543. }
  7544. }(), Ze = function(e) {
  7545. function t() {
  7546. u.classList.contains("expand") && de.toggleMeta(!0)
  7547. }
  7548. function i() {
  7549. fe.hide()
  7550. }
  7551. function n() {
  7552. he.close()
  7553. }
  7554. function r() {
  7555. Ae.dismiss()
  7556. }
  7557. function o() {
  7558. p.hasClass("open") && a(!0)
  7559. }
  7560. function l() {
  7561. Ce.hide()
  7562. }
  7563. function c() {
  7564. f.hasClass("open") && f.removeClass("open")
  7565. }
  7566. function h() {
  7567. d.classList.contains("fadeIn") && (d.classList.contains("landing") ? re.dismissModal() : d.classList.contains("tour") && ve.dismissModal())
  7568. }
  7569. var u = document.getElementById("meta-info")
  7570. , d = document.getElementById("interaction-modal")
  7571. , p = $("#drawer").eq(0)
  7572. , f = $(".gui-floor").eq(0)
  7573. , g = $(".vr-popup").eq(0);
  7574. return function(e) {
  7575. switch (e) {
  7576. case "info":
  7577. i(),
  7578. n(),
  7579. Ye(),
  7580. l(),
  7581. c(),
  7582. r(),
  7583. h();
  7584. break;
  7585. case "terms":
  7586. t(),
  7587. n(),
  7588. o(),
  7589. l(),
  7590. c(),
  7591. r(),
  7592. h();
  7593. break;
  7594. case "help":
  7595. t(),
  7596. i(),
  7597. l(),
  7598. c(),
  7599. r(),
  7600. h();
  7601. break;
  7602. case "vr":
  7603. t(),
  7604. i(),
  7605. l(),
  7606. c(),
  7607. n(),
  7608. h(),
  7609. s(g) && o();
  7610. break;
  7611. case "highlights":
  7612. Xe(),
  7613. i(),
  7614. l(),
  7615. c();
  7616. break;
  7617. case "share":
  7618. t(),
  7619. i(),
  7620. n(),
  7621. c(),
  7622. r(),
  7623. h();
  7624. break;
  7625. case "floor":
  7626. i(),
  7627. l(),
  7628. r();
  7629. break;
  7630. case "view":
  7631. c(),
  7632. l(),
  7633. i(),
  7634. r();
  7635. break;
  7636. case "tour":
  7637. i(),
  7638. l(),
  7639. c(),
  7640. r();
  7641. break;
  7642. case "move":
  7643. i(),
  7644. l(),
  7645. c(),
  7646. r();
  7647. break;
  7648. case "resize":
  7649. t(),
  7650. Ye(),
  7651. c();
  7652. break;
  7653. case "tag":
  7654. i(),
  7655. n(),
  7656. l(),
  7657. c(),
  7658. r()
  7659. }
  7660. }
  7661. }();
  7662. $(document).on("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", function(e) {
  7663. $("#gui-fullscreen").toggle(!K.isFullscreen()),
  7664. $("#gui-fullscreen-exit").toggle(!!K.isFullscreen()),
  7665. setTimeout(function() {
  7666. $(".icon:visible").hide().show(0)
  7667. }, 100)
  7668. }),
  7669. $("#gui-fullscreen").find("a").on("click", function(e) {
  7670. l(e),
  7671. K.requestFullscreen($("body")[0]),
  7672. J.track("showcase_gui", {
  7673. gui_action: "click_enter_fullscreen",
  7674. interaction_source: "gui"
  7675. })
  7676. //czj
  7677. //W.reload()
  7678. }),
  7679. $("#gui-fullscreen-exit").find("a").on("click", function(e) {
  7680. l(e),
  7681. K.exitFullscreen(),
  7682. J.track("showcase_gui", {
  7683. gui_action: "click_exit_fullscreen",
  7684. interaction_source: "gui"
  7685. })
  7686. })
  7687. $(window).on("resize", function(e) {
  7688. var t = e.target.innerHeight
  7689. , i = e.target.innerWidth;
  7690. t === X && i === Z || (je.highlight.visible && w(),
  7691. Ze("resize"),
  7692. $(".pinTop.right").removeClass("hideUnderMeta"),
  7693. c(),
  7694. X = t,
  7695. Z = i)
  7696. }).resize(),
  7697. K.supportsFullscreen() || $("#gui-fullscreen").hide(),
  7698. $("#pullTab").on("click", function(e) {
  7699. l(e),
  7700. $("#drawer").hasClass("open") ? (J.trackAlways("showcase_gui", {
  7701. gui_action: "hide_highlight_reel"
  7702. }),
  7703. $(this).addClass("open").children("img").attr("src","images/auto.png")) : (J.trackAlways("showcase_gui", {
  7704. gui_action: "show_highlight_reel"
  7705. }),
  7706. $(this).removeClass("open").children("img").attr("src","images/auto-suspend.png"));
  7707. a()
  7708. });
  7709. /***********************方奕卓 热点列表事件监听 ************************/
  7710. if(window.MP_PREFETCHED_MODELDATA.showHotListSta) {
  7711. $('#hotList').css('display', '');
  7712. $('#hotList').on('click',function(e){
  7713. l(e);
  7714. var hotList = $('#hotListWrap')[0];
  7715. var isActive = hotList.classList.contains('hotListActive');
  7716. if(isActive){
  7717. hotList.classList.remove('hotListActive');
  7718. this.classList.remove('active')
  7719. }else{
  7720. hotList.classList.add('hotListActive');
  7721. this.classList.add('active')
  7722. }
  7723. }),
  7724. $('#hotListContent ul').on('mouseover', function(e){
  7725. l(e);
  7726. var target = e.target;
  7727. var hotList = document.getElementById('hotListWrap');
  7728. if(target.tagName === 'SPAN'){
  7729. var targetParent = target.parentElement.parentElement;
  7730. if(target.offsetWidth + 116 >= targetParent.clientWidth){
  7731. hotList.style.width = target.offsetWidth + 116 + 'px';
  7732. }else{
  7733. hotList.style.width = '';
  7734. }
  7735. }else if(target.tagName === 'LI'){
  7736. var targetParent = target.parentElement;
  7737. if(target.children[0].offsetWidth + 116 >= targetParent.clientWidth){
  7738. hotList.style.width = target.children[0].offsetWidth + 116 + 'px';
  7739. }else{
  7740. hotList.style.width = ''
  7741. }
  7742. }else {
  7743. hotList.style.width = '';
  7744. }
  7745. });
  7746. $('#hotListContent ul').on('click', function(e){
  7747. l(e);
  7748. this.preElem && this.preElem.classList.remove('active');
  7749. if(e.target.tagName === 'SPAN'){
  7750. e.target.parentElement.classList.add('active');
  7751. e.target.parentElement.hot && e.target.parentElement.hot.examine(window.player,true); // 打开热点
  7752. this.preElem = e.target.parentElement;
  7753. }else{
  7754. e.target.classList.add('active');
  7755. e.target.hot && e.target.hot.examine(window.player,true); // 打开热点
  7756. this.preElem = e.target;
  7757. }
  7758. })
  7759. $('#hotListClose').on('click', function(e){
  7760. l(e);
  7761. var hotList = $('#hotListWrap')[0];
  7762. hotList.classList.remove('hotListActive');
  7763. $('#hotListContent ul .active').removeClass('active');
  7764. $('#hotList')[0].classList.remove('active')
  7765. })
  7766. }
  7767. /*****************************************************************/
  7768. $("#more-menu-button").on("click", function(e) {
  7769. l(e);
  7770. var t = $("#more-menu");
  7771. t.toggleClass("open")
  7772. }),
  7773. t.exports.init = S,
  7774. t.exports.startLoading = x,
  7775. t.exports.endLoading = d,
  7776. t.exports.onProgress = u
  7777. }
  7778. ).call(this, "/js/gui/gui.js")
  7779. }
  7780. , {
  7781. "../analytics": 4,
  7782. "../controls/serializer": 14,
  7783. "../enum/AlignmentType": 17,
  7784. "../enum/BlackoutStyle": 18,
  7785. "../enum/ControlEvents": 21,
  7786. "../enum/DirectorEvents": 23,
  7787. "../enum/Keys": 30,
  7788. "../enum/PathDiscardMode": 38,
  7789. "../enum/PathDisplayMode": 39,
  7790. "../enum/PlayerEvents": 40,
  7791. "../enum/VROption": 47,
  7792. "../enum/Vectors": 50,
  7793. "../enum/Viewmode": 51,
  7794. "../enum/WarpStyle": 52,
  7795. "../enum/ZoomEvents": 53,
  7796. "../lib/dat.gui": 93,
  7797. "../localization/localize": 108,
  7798. "../tag/Media/MediaEvent": 131,
  7799. "../objects/Snapshot": 153,
  7800. "../settings": 166,
  7801. "../util/ajax": 181,
  7802. "../util/browser": 182,
  7803. "../util/camera": 183,
  7804. "../util/logger": 189,
  7805. "../util/showcase": 193,
  7806. "../util/transitions": 195,
  7807. "./closer/ModalCloserEvent": 61,
  7808. "./closer/modalCloser": 62,
  7809. "./help/HelpEvent": 66,
  7810. "./help/help": 67,
  7811. "./helpManager": 68,
  7812. "./immersiveMode": 69,
  7813. "./konami": 70,
  7814. "./landingScreen": 71,
  7815. "./loadingScreen": 72,
  7816. "./memoryUsage": 73,
  7817. "./playButton": 74,
  7818. "./populateModal": 75,
  7819. "./sharing/ShareEvents": 76,
  7820. "./sharing/modal": 77,
  7821. "./terms/TermsEvent": 78,
  7822. "./terms/terms": 79,
  7823. "./title/TitleEvents": 80,
  7824. "./title/tagToggle": 81,
  7825. "./title/titleBar": 82,
  7826. "./tourInteraction": 84,
  7827. "./vr/vrEvent": 85,
  7828. "./vr/vrModal": 87,
  7829. "./webvr/WebVrEvent": 88,
  7830. "./webvr/webVRgui": 89,
  7831. three: 217
  7832. }],
  7833. 66: [function(e, t, i) {
  7834. "use strict";
  7835. t.exports = Object.freeze({
  7836. OPENED: "help.opened",
  7837. CLOSED: "help.closed"
  7838. })
  7839. }
  7840. , {}],
  7841. 67: [function(e, t, i) {
  7842. "use strict";
  7843. function n() {
  7844. g.on("click", function(e) {
  7845. if (S && S !== l.TRANSITIONING) {
  7846. var t = window.getComputedStyle(y).getPropertyValue("opacity") > 0;
  7847. t && !M ? R.close() : r()
  7848. }
  7849. }),
  7850. w.on("click", function(e) {
  7851. R.close()
  7852. }),
  7853. E.on("click", function(e) {
  7854. S && S !== l.TRANSITIONING && (s(),
  7855. o())
  7856. }),
  7857. b.on("click", function(e) {
  7858. s(),
  7859. a()
  7860. })
  7861. }
  7862. function r() {
  7863. S && S !== l.TRANSITIONING && (M = !0,
  7864. setTimeout(function() {
  7865. M = !1
  7866. }, d.help.modalStayDuration),
  7867. R.emit(h.OPENED),
  7868. m.addClass("open " + S),
  7869. g.addClass("open"),
  7870. s(),
  7871. o(),
  7872. y.style.removeProperty ? y.style.removeProperty("display") : y.style.removeAttribute("display"),
  7873. y.classList.add("fadeIn"))
  7874. }
  7875. function o() {
  7876. E.addClass("underline-tab"),
  7877. u.fill(_, c.NAVIGATION, S),
  7878. m.addClass(S)
  7879. }
  7880. function a() {
  7881. b.addClass("underline-tab"),
  7882. u.fill(T, c.MORE_HELP),
  7883. m.addClass("more-help")
  7884. }
  7885. function s(e, t) {
  7886. m.removeClass("more-help " + l.PANORAMA + " " + l.DOLLHOUSE + " " + l.FLOORPLAN + " " + l.OUTDOOR),
  7887. I.forEach(function(e) {
  7888. e.classList.remove("underline-tab")
  7889. })
  7890. }
  7891. var l = e("../../enum/Viewmode")
  7892. , c = e("../../enum/HelpModalType")
  7893. , h = e("./HelpEvent")
  7894. , u = (e("../helpManager"),
  7895. e("./../populateModal"))
  7896. , d = e("../../settings")
  7897. , p = e("../../util/common")
  7898. , f = e("events").EventEmitter
  7899. , g = $(".footer-help").eq(0)
  7900. , m = $("#help-dialog").eq(0)
  7901. , v = document.querySelector("#quick-logo")
  7902. , A = document.querySelector("#loaderCoBrand")
  7903. , y = document.querySelector("#help-dialog")
  7904. , C = document.querySelector(".footer")
  7905. , I = $(".help-tabs").children().toArray()
  7906. , E = $(".navigation-tab").eq(0)
  7907. , b = $(".more-help-tab").eq(0)
  7908. , w = ($("#interaction-modal").eq(0).find(".interaction").toArray(),
  7909. m.find(".close").eq(0))
  7910. , _ = m.find(".interactions").toArray()
  7911. , T = m.find(".ui-instructions").toArray()
  7912. , x = l.PANORAMA
  7913. , S = l.PANORAMA
  7914. , M = !1
  7915. , R = {
  7916. init: function(e, t) {
  7917. S = t,
  7918. x = t,
  7919. [y, A, v, C].forEach(function(e) {
  7920. e.classList.add(u.deviceType)
  7921. }),
  7922. n()
  7923. },
  7924. close: function() {
  7925. if (m.hasClass("open") && (this.emit(h.CLOSED),
  7926. g.removeClass("open"),
  7927. m.removeClass("open"),
  7928. y.classList.contains("fadeIn"))) {
  7929. y.classList.remove("fadeIn");
  7930. var e = S === l.TRANSITIONING ? x : S;
  7931. u.clear(_, c.NAVIGATION, e)
  7932. }
  7933. },
  7934. updateMode: function(e) {
  7935. x = S,
  7936. S = e
  7937. }
  7938. };
  7939. p.extendObject(R, f.prototype),
  7940. t.exports = R
  7941. }
  7942. , {
  7943. "../../enum/HelpModalType": 28,
  7944. "../../enum/Viewmode": 51,
  7945. "../../settings": 166,
  7946. "../../util/common": 185,
  7947. "../helpManager": 68,
  7948. "./../populateModal": 75,
  7949. "./HelpEvent": 66,
  7950. events: 202
  7951. }],
  7952. 68: [function(e, t, i) {
  7953. (function(i) {
  7954. "use strict";
  7955. var n = e("../util/browser")
  7956. , r = e("./../util/logger")
  7957. , o = e("./../settings")
  7958. , a = new r(i)
  7959. , s = function() {
  7960. var e;
  7961. try {
  7962. return e = window.localStorage.getItem("visitCount") || "0",
  7963. e = (parseFloat(e) + 1).toString(),
  7964. window.localStorage.setItem("visitCount", e),
  7965. a.debug("visitCount = " + e),
  7966. e
  7967. } catch (t) {
  7968. e = "1",
  7969. a.debug("couldn't set local storage")
  7970. }
  7971. }()
  7972. , l = !1;
  7973. t.exports = {
  7974. isHelpDisabled: function() {
  7975. return "0" === n.valueFromHash("help", null) || l
  7976. },
  7977. isLargeHelpEnabled: function() {
  7978. return ("1" === s || "1" === n.valueFromHash("help", null)) && !this.isHelpDisabled()
  7979. },
  7980. isSmallHelpEnabled: function() {
  7981. return "2" === n.valueFromHash("help", null) && !this.isHelpDisabled()
  7982. },
  7983. isHelpEnabled: function() {
  7984. return this.isLargeHelpEnabled() || this.isSmallHelpEnabled()
  7985. },
  7986. setAutoPlay: function(e) {
  7987. l = o.warp.auto >= 0 && e > 1
  7988. }
  7989. }
  7990. }
  7991. ).call(this, "/js/gui/helpManager.js")
  7992. }
  7993. , {
  7994. "../util/browser": 182,
  7995. "./../settings": 166,
  7996. "./../util/logger": 189
  7997. }],
  7998. 69: [function(e, t, i) {
  7999. "use strict";
  8000. function n(e, t, i, n) {
  8001. F = n,
  8002. r(e, t, i, F),
  8003. o(),
  8004. N = t.mode
  8005. }
  8006. function r(e, t, i, n) {
  8007. [C.PANORAMA, C.DOLLHOUSE, C.FLOORPLAN].forEach(function(t) {
  8008. e.controls[t].on(v.Move, a),
  8009. e.controls[t].on(v.LongTap, c)
  8010. }),
  8011. M.on("mousewheel DOMMouseScroll", a),
  8012. i.on(m.TagActivated, a),
  8013. i.on(m.TagNavigation, a),
  8014. t.on(A.FlyingEnded, s),
  8015. t.on(A.ModeChanging, function(e, t) {
  8016. B = t !== C.PANORAMA && e !== C.PANORAMA
  8017. }),
  8018. t.on(A.ModeChanged, function(e, i) {
  8019. N = t.mode,
  8020. i !== C.TRANSITIONING ? l() : a("modeChange")
  8021. }),
  8022. n.on(y.TourStart, function() {
  8023. L = !0,
  8024. a()
  8025. }),
  8026. n.on(y.TourEnd, function() {
  8027. L = !1,
  8028. l()
  8029. }),
  8030. n.on(y.ActionInterrupted, function() {
  8031. L = !1
  8032. }),
  8033. R.addEventListener("touchend", function() {
  8034. $("#pullTab").hasClass("opened") && !L && l()
  8035. }, !0)
  8036. }
  8037. function o() {
  8038. p.isMobile() ? (b.forEach(function(e) {
  8039. e.classList.add("mobile")
  8040. }),
  8041. w.click(l)) : (b.forEach(function(e) {
  8042. e.addEventListener("mouseleave", function() {
  8043. !M.is(":hover") && b[0].classList.contains("detectHover") && l()
  8044. }, !0)
  8045. }),
  8046. M.mouseleave(function() {
  8047. b[0].classList.contains("detectHover") && l()
  8048. }))
  8049. }
  8050. function a(e) {
  8051. D || d(e) && _.hasClass("playing") || (clearTimeout(O),
  8052. P = !0,
  8053. g.close(),
  8054. h(e),
  8055. N !== C.DOLLHOUSE && N !== C.FLOORPLAN && (x.hasClass("expand") && !S.hasClass("closed") || 2 === p.valueFromHash("title", 1) ,
  8056. _.hasClass("playing") || (b.forEach(function(e) {
  8057. e.classList.add("detectHover")
  8058. }),
  8059. O = setTimeout(l, f.immersive.timeToShowAgain))))
  8060. }
  8061. function s() {
  8062. _.hasClass("playing") || (clearTimeout(O),
  8063. O = setTimeout(l, f.immersive.timeToShowAgain))
  8064. }
  8065. function l() {
  8066. clearTimeout(O),
  8067. P = !1,
  8068. I.forEach(function(e) {
  8069. e.classList.remove("drawerOpen")
  8070. }),
  8071. L || E.forEach(function(e) {
  8072. e.classList.remove("duringTour")
  8073. }),
  8074. b.forEach(function(e) {
  8075. e.classList.remove("detectHover")
  8076. })
  8077. }
  8078. function c() {
  8079. P ? l() : a(),
  8080. D = !0,
  8081. setTimeout(function() {
  8082. D = !1
  8083. }, f.immersive.uiStayDuration)
  8084. }
  8085. function h(e) {
  8086. !d(e) && L ? E.forEach(function(e) {
  8087. e.classList.remove("drawerOpen"),
  8088. e.classList.add("duringTour")
  8089. }) : _.hasClass("open") ? E.forEach(function(e) {
  8090. e.classList.remove("duringTour"),
  8091. e.classList.add("drawerOpen")
  8092. }) : B || N === C.FLOORPLAN || N === C.DOLLHOUSE || E.forEach(function(e) {
  8093. e.classList.add("fadeOut")
  8094. })
  8095. }
  8096. function u() {
  8097. T.hasClass("duringTour") || (L = !1,
  8098. a("gui"),
  8099. l())
  8100. }
  8101. function d(e) {
  8102. return "mouse" === e || "touch" === e || "key" === e || "gui" === e
  8103. }
  8104. var p = e("../util/browser")
  8105. , f = e("../settings")
  8106. , g = e("./help/help")
  8107. , m = e("../enum/tagEvents")
  8108. , v = e("../enum/ControlEvents")
  8109. , A = e("../enum/PlayerEvents")
  8110. , y = e("../enum/DirectorEvents")
  8111. , A = e("../enum/PlayerEvents")
  8112. , C = e("../enum/Viewmode")
  8113. , I = $(".pinTop.left, .pinBottom-container, #drawer-container, #drawer, .footer").toArray()
  8114. , E = $(".pinBottom-container, #drawer-container, .footer").toArray()
  8115. , b = $("#hover-bottom, #hover-top").toArray()
  8116. , w = ($("#pullTab").eq(0),
  8117. $("#playHead").eq(0),
  8118. $(".pinBottom-container").eq(0))
  8119. , _ = $("#drawer").eq(0)
  8120. , T = $("#drawer-container").eq(0)
  8121. , x = $("#meta-info").eq(0)
  8122. , S = $(".pinTop.left").eq(0)
  8123. , M = $("#player").eq(0)
  8124. , R = document.getElementById("pullTab")
  8125. , P = !1
  8126. , O = null
  8127. , L = !1
  8128. , D = !1
  8129. , N = null
  8130. , B = !1
  8131. , F = null;
  8132. t.exports.init = n,
  8133. t.exports.hideUi = a,
  8134. t.exports.resetDrawer = u
  8135. }
  8136. , {
  8137. "../enum/ControlEvents": 21,
  8138. "../enum/DirectorEvents": 23,
  8139. "../enum/tagEvents": 32,
  8140. "../enum/PlayerEvents": 40,
  8141. "../enum/Viewmode": 51,
  8142. "../settings": 166,
  8143. "../util/browser": 182,
  8144. "./help/help": 67
  8145. }],
  8146. 70: [function(e, t, i) {
  8147. (function(i) {
  8148. "use strict";
  8149. function n(e, t, i) {
  8150. l.debug("konami has the modelInstance");
  8151. var n = [];
  8152. $(window).on("keydown", function(e) {
  8153. n.push(e.which),
  8154. n.length > o.secretPanelWord.length && n.shift(),
  8155. s.equalLists(n, o.secretPanelWord) && (l.debug("Developer mode active."),
  8156. o.debug = !0)
  8157. }),
  8158. $(window).on("keydown", function n(r) {
  8159. o.debug && 72 === r.which && (e && i ? (a.toggle(e, t, i),
  8160. $(window).off("keydown", n)) : console.warn("sorry we're not ready yet"))
  8161. })
  8162. }
  8163. var r = e("./../util/logger")
  8164. , o = e("./../settings")
  8165. , a = e("./debug")
  8166. , s = e("./../util/common")
  8167. , l = (e("./gui"),
  8168. new r(i));
  8169. o.console && $("body").append('<div id="debug-console"></div>'),
  8170. t.exports.init = n
  8171. }
  8172. ).call(this, "/js/gui/konami.js")
  8173. }
  8174. , {
  8175. "./../settings": 166,
  8176. "./../util/common": 185,
  8177. "./../util/logger": 189,
  8178. "./debug": 63,
  8179. "./gui": 65
  8180. }],
  8181. 71: [function(e, t, i) {
  8182. "use strict";
  8183. function n(e, t) {
  8184. E = t.mode === p.PANORAMA && t.pano && !t.pano.isAligned() ? p.OUTDOOR : t.mode
  8185. }
  8186. function r(e) {
  8187. var t = $.Deferred();
  8188. e || t.resolve();
  8189. var i = c.startupFlyinDelay;
  8190. return e === p.PANORAMA && (i += c.dollhouse.transitionTime),
  8191. setTimeout(t.resolve.bind(t), i),
  8192. t
  8193. }
  8194. function o(e, t, i) {
  8195. var n = 0;
  8196. c.quickstart.enabled && (a(i),
  8197. n = c.quickstart.showTextDelay + c.quickstart.fadeOutDelay);
  8198. var r = function() {
  8199. e.once(g.Move, l),
  8200. t.once(f.TourStart, l)
  8201. };
  8202. s(n, r)
  8203. }
  8204. function a(e) {
  8205. return /* e && (y.addClass("quick-brand"), //quick-brand样式有问题 会遮住屏幕
  8206. v.before(y),
  8207. A = $(".quick-brand").toArray()),*/
  8208. m.addClass("fadeOut"),
  8209. setTimeout(function() {
  8210. A.forEach(function(e) {
  8211. e.classList.add("fadeIn")
  8212. })
  8213. }, c.quickstart.showTextDelay),
  8214. setTimeout(function() {
  8215. A.forEach(function(e) {
  8216. e.classList.add("fadeOut")
  8217. })
  8218. }, c.quickstart.fadeOutDelay),
  8219. !0
  8220. }
  8221. function s(e, t) {
  8222. setTimeout(function() {
  8223. if (h.isHelpEnabled()) {
  8224. if (t(),
  8225. u.init(),
  8226. C.addClass("fadeIn landing " + u.deviceType),
  8227. h.isSmallHelpEnabled())
  8228. return void C.addClass("small");
  8229. u.fill(I, d.LANDING[E]),
  8230. C.addClass(E)
  8231. }
  8232. }, e)
  8233. //csz 用户引导界面
  8234. var helpData = {
  8235. "pc":["images/pc_step1.png","images/pc_step2.png","images/pc_step3.png"],
  8236. "mobile":["images/phone_step1.png","images/phone_step2.png","images/phone_step3.png"]
  8237. }
  8238. var navIcon = $(".nav-icon .icon");
  8239. if(/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)) navIcon.attr("src",helpData.mobile[0]);
  8240. function paging(id){
  8241. id.on("click",function(){
  8242. var navPage = null;
  8243. $(this).attr("data-id") == "plus" ? navPage = +navIcon.attr("data-page")+1 : navPage = +navIcon.attr("data-page")-1;
  8244. if(navPage > helpData.length || navPage < 1) return false
  8245. if(/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)){
  8246. navIcon.attr({"data-page":navPage,"src":helpData.mobile[navPage - 1]});
  8247. }else{
  8248. navIcon.attr({"data-page":navPage,"src":helpData.pc[navPage - 1]});
  8249. }
  8250. })
  8251. };
  8252. paging($(".next-button"));
  8253. paging($(".prev-button"));
  8254. }
  8255. function l() {
  8256. u.clear(I, d.LANDING[E]),
  8257. C.removeClass("fadeIn")
  8258. }
  8259. var c = e("../settings")
  8260. , h = (e("./help/help"),
  8261. e("./helpManager"))
  8262. , u = e("./populateModal")
  8263. , d = e("../enum/HelpModalType")
  8264. , p = e("../enum/Viewmode")
  8265. , f = e("../enum/DirectorEvents")
  8266. , g = e("../enum/PlayerEvents")
  8267. , m = $("#quick-blackout").eq(0)
  8268. , v = $("#quick-logo").eq(0)
  8269. , A = $(".quick-brand").toArray()
  8270. , y = $("#loaderCoBrand").eq(0)
  8271. , C = $("#interaction-modal").eq(0)
  8272. , I = C.find(".interaction").toArray()
  8273. , E = ($("#model-title, .pinBottom-container, #drawer-container, #drawer, .footer").toArray(),
  8274. "");
  8275. t.exports.delayLanding = r,
  8276. t.exports.showMessage = o,
  8277. t.exports.init = n,
  8278. t.exports.dismissModal = l
  8279. }
  8280. , {
  8281. "../enum/DirectorEvents": 23,
  8282. "../enum/HelpModalType": 28,
  8283. "../enum/PlayerEvents": 40,
  8284. "../enum/Viewmode": 51,
  8285. "../settings": 166,
  8286. "./help/help": 67,
  8287. "./helpManager": 68,
  8288. "./populateModal": 75
  8289. }],
  8290. 72: [function(e, t, i) {
  8291. "use strict";
  8292. var n = e("./circleLoader").circleLoader;
  8293. t.exports = {
  8294. element: $("#gui-loading"),
  8295. hide: function(e) {
  8296. n.done(),
  8297. this.element.fadeOut(1500, e)
  8298. },
  8299. show: function(e) {
  8300. this.element.fadeIn(500, function() {
  8301. this.element.css("display", "table"),
  8302. e && e()
  8303. }
  8304. .bind(this))
  8305. },
  8306. progress: function(e) {
  8307. n.set(e)
  8308. }
  8309. }
  8310. }
  8311. , {
  8312. "./circleLoader": 60
  8313. }],
  8314. 73: [function(e, t, i) {
  8315. "use strict";
  8316. var n = e("../settings")
  8317. , r = $("#memory-info")
  8318. , o = r.find("#memory-gpu")
  8319. , a = !1;
  8320. t.exports = {
  8321. show: function() {
  8322. n.profiling.enabled && (r.show(),
  8323. a = !0)
  8324. },
  8325. hide: function() {
  8326. r.hide(),
  8327. a = !1
  8328. },
  8329. toggle: function() {
  8330. a ? this.hide() : this.show()
  8331. },
  8332. update: function(e) {
  8333. n.profiling.enabled && o.text(Math.floor(e / 1e6) + "MB")
  8334. }
  8335. }
  8336. }
  8337. , {
  8338. "../settings": 166
  8339. }],
  8340. 74: [function(e, t, i) {
  8341. "use strict";
  8342. var n = e("../util/browser")
  8343. , r = e("../analytics");
  8344. e("../settings");
  8345. t.exports = {
  8346. show: function(e, t) {
  8347. $("#gui-message").fadeOut(500, function() {
  8348. t()
  8349. })
  8350. }
  8351. }
  8352. }
  8353. , {
  8354. "../analytics": 4,
  8355. "../settings": 166,
  8356. "../util/browser": 182
  8357. }],
  8358. 75: [function(e, t, i) {
  8359. "use strict";
  8360. function n(e, t, i, n) {
  8361. function r(e) {
  8362. return e.classList.contains(a)
  8363. }
  8364. var o = i ? this.assets[t][i][this.deviceType] : this.assets[t][this.deviceType];
  8365. //for (var a in o) {
  8366. //var s = e.find(r);
  8367. //for (var l in o[a]) {
  8368. //var c = o[a][l];
  8369. //if ("top-info" === l || "bottom-info" === l) {
  8370. //var h = n ? c : "";
  8371. //czj 注释掉第一次打开的用户引导
  8372. //s.querySelector("." + l).textContent = h
  8373. //} else {
  8374. //var u = n ? c : "";
  8375. //, d = s.querySelector("." + l);
  8376. //d.src = u,
  8377. //n ? d.classList.remove("hidden") : d.classList.add("hidden")
  8378. //}
  8379. //}
  8380. //}
  8381. //var p = Array.prototype.slice.call(e[0].parentElement.querySelectorAll("hr"));
  8382. // p.forEach(function(e) {
  8383. // n ? e.classList.remove("hidden") : e.classList.add("hidden")
  8384. // })
  8385. }
  8386. var r = e("../util/browser")
  8387. , o = e("../localization/localize")
  8388. , a = e("../enum/HelpModalType")
  8389. , s = (e("../enum/HelpModalSize"),
  8390. e("../enum/Viewmode"));
  8391. t.exports = {
  8392. init: function() {
  8393. if (!this.hasInitialized) {
  8394. this.hasInitialized = !0,
  8395. this.deviceType = r.isMobile() ? "mobile" : "desktop",
  8396. this.assets = {},
  8397. this.assets[a.LANDING[s.PANORAMA]] = {
  8398. desktop: {
  8399. left: {
  8400. "top-info": o.ROTATE,
  8401. "big-image": "images/nav_help_mouse_drag_left.png",
  8402. keyboard: "images/nav_help_keyboard_left_right.png"
  8403. },
  8404. middle: {
  8405. "top-info": o.MOVE,
  8406. "big-image": "images/nav_help_mouse_click.png",
  8407. keyboard: "images/nav_help_keyboard_up_down.png"
  8408. },
  8409. right: {
  8410. "top-info": o.ZOOM,
  8411. "big-image": "images/nav_help_mouse_zoom.png",
  8412. keyboard: "images/nav_help_zoom_keys.png"
  8413. }
  8414. },
  8415. mobile: {
  8416. left: {
  8417. "top-info": o.ROTATE,
  8418. "big-image": "images/nav_help_gesture_drag.png"
  8419. },
  8420. middle: {
  8421. "top-info": o.MOVE,
  8422. "big-image": "images/nav_help_gesture_tap.png"
  8423. },
  8424. right: {
  8425. "top-info": o.ZOOM,
  8426. "big-image": "images/nav_help_gesture_pinch.png"
  8427. }
  8428. }
  8429. },
  8430. this.assets[a.LANDING[s.OUTDOOR]] = JSON.parse(JSON.stringify(this.assets[a.LANDING[s.PANORAMA]])),
  8431. this.assets[a.LANDING[s.DOLLHOUSE]] = {
  8432. desktop: {
  8433. left: {
  8434. "top-info": o.ROTATE,
  8435. "big-image": "images/nav_help_mouse_drag_left.png",
  8436. keyboard: "images/nav_help_keyboard_left_right.png"
  8437. },
  8438. middle: {
  8439. "top-info": o.MOVE,
  8440. "big-image": "images/nav_help_mouse_position_right.png"
  8441. }
  8442. },
  8443. mobile: {
  8444. left: {
  8445. "top-info": o.ROTATE,
  8446. "big-image": "images/nav_help_gesture_drag.png"
  8447. },
  8448. middle: {
  8449. "top-info": o.MOVE,
  8450. "big-image": "images/nav_help_gesture_position_two_finger.png"
  8451. }
  8452. }
  8453. },
  8454. this.assets[a.LANDING[s.FLOORPLAN]] = {
  8455. desktop: {
  8456. left: {
  8457. "top-info": o.MOVE,
  8458. "big-image": "images/nav_help_mouse_position_left.png"
  8459. },
  8460. middle: {
  8461. "top-info": o.ROTATE,
  8462. "big-image": "images/nav_help_mouse_drag_right.png",
  8463. keyboard: "images/nav_help_keyboard_left_right.png"
  8464. }
  8465. },
  8466. mobile: {
  8467. left: {
  8468. "top-info": o.MOVE,
  8469. "big-image": "images/nav_help_gesture_position.png"
  8470. },
  8471. middle: {
  8472. "top-info": o.ROTATE,
  8473. "big-image": "images/nav_help_gesture_drag_two_finger.png"
  8474. }
  8475. }
  8476. };
  8477. var e = {
  8478. "top-info": o.INSIDE,
  8479. "big-image": "images/nav_help_click_inside.png",
  8480. keyboard: "images/nav_help_inside_key.png"
  8481. };
  8482. this.assets[a.LANDING[s.OUTDOOR]].desktop.middle = e,
  8483. this.assets[a.LANDING[s.DOLLHOUSE]].desktop.right = e,
  8484. this.assets[a.LANDING[s.FLOORPLAN]].desktop.right = e;
  8485. var t = {
  8486. "top-info": o.INSIDE,
  8487. "big-image": "images/nav_help_tap_inside.png"
  8488. };
  8489. this.assets[a.LANDING[s.OUTDOOR]].mobile.middle = t,
  8490. this.assets[a.LANDING[s.DOLLHOUSE]].mobile.right = t,
  8491. this.assets[a.LANDING[s.FLOORPLAN]].mobile.right = t,
  8492. this.assets[a.NAVIGATION] = {},
  8493. this.assets[a.NAVIGATION][s.PANORAMA] = {
  8494. desktop: {
  8495. left: {
  8496. "top-info": o.HELP_DESKTOP_PANORAMA_1A,
  8497. "bottom-info": o.HELP_DESKTOP_PANORAMA_1B,
  8498. "big-image": "images/nav_help_mouse_drag_left.png",
  8499. keyboard: "images/nav_help_keyboard_left_right.png"
  8500. },
  8501. middle: {
  8502. "top-info": o.HELP_DESKTOP_PANORAMA_2A,
  8503. "bottom-info": o.HELP_DESKTOP_PANORAMA_2B,
  8504. "big-image": "images/nav_help_mouse_click.png",
  8505. keyboard: "images/nav_help_keyboard_up_down.png"
  8506. },
  8507. right: {
  8508. "top-info": o.HELP_DESKTOP_PANORAMA_3A,
  8509. "bottom-info": o.HELP_DESKTOP_PANORAMA_3B,
  8510. "big-image": "images/nav_help_mouse_zoom.png",
  8511. keyboard: "images/nav_help_zoom_keys.png"
  8512. }
  8513. },
  8514. mobile: {
  8515. left: {
  8516. "top-info": o.HELP_MOBILE_PANORAMA_1,
  8517. "big-image": "images/nav_help_gesture_drag.png"
  8518. },
  8519. middle: {
  8520. "top-info": o.HELP_MOBILE_PANORAMA_2,
  8521. "big-image": "images/nav_help_gesture_tap.png"
  8522. },
  8523. right: {
  8524. "top-info": o.HELP_MOBILE_3,
  8525. "big-image": "images/nav_help_gesture_pinch.png"
  8526. }
  8527. }
  8528. },
  8529. this.assets[a.NAVIGATION][s.DOLLHOUSE] = {
  8530. desktop: {
  8531. left: {
  8532. "top-info": o.HELP_DESKTOP_DOLLHOUSE_1A,
  8533. "bottom-info": o.HELP_DESKTOP_DOLLHOUSE_1B,
  8534. "big-image": "images/nav_help_mouse_drag_left.png",
  8535. keyboard: "images/nav_help_keyboard_all.png"
  8536. },
  8537. middle: {
  8538. "top-info": o.HELP_DESKTOP_DOLLHOUSE_2A,
  8539. "big-image": "images/nav_help_mouse_position_right.png"
  8540. },
  8541. right: {
  8542. "top-info": o.HELP_DESKTOP_DOLLHOUSE_3A,
  8543. "big-image": "images/nav_help_mouse_zoom.png"
  8544. }
  8545. },
  8546. mobile: {
  8547. left: {
  8548. "top-info": o.HELP_MOBILE_DOLLHOUSE_1,
  8549. "big-image": "images/nav_help_gesture_drag.png"
  8550. },
  8551. middle: {
  8552. "top-info": o.HELP_MOBILE_DOLLHOUSE_2,
  8553. "big-image": "images/nav_help_gesture_position_two_finger.png"
  8554. },
  8555. right: {
  8556. "top-info": o.HELP_MOBILE_3,
  8557. "big-image": "images/nav_help_gesture_pinch.png"
  8558. }
  8559. }
  8560. },
  8561. this.assets[a.NAVIGATION][s.FLOORPLAN] = {
  8562. desktop: {
  8563. left: {
  8564. "top-info": o.HELP_DESKTOP_FLOORPLAN_1A,
  8565. "big-image": "images/nav_help_mouse_position_left.png"
  8566. },
  8567. middle: {
  8568. "top-info": o.HELP_DESKTOP_FLOORPLAN_2A,
  8569. "bottom-info": o.HELP_DESKTOP_FLOORPLAN_2B,
  8570. "big-image": "images/nav_help_mouse_drag_right.png",
  8571. keyboard: "images/nav_help_keyboard_left_right.png"
  8572. },
  8573. right: {
  8574. "top-info": o.HELP_DESKTOP_FLOORPLAN_3A,
  8575. "bottom-info": o.HELP_DESKTOP_FLOORPLAN_3B,
  8576. "big-image": "images/nav_help_mouse_zoom.png",
  8577. keyboard: "images/nav_help_keyboard_up_down.png"
  8578. }
  8579. },
  8580. mobile: {
  8581. left: {
  8582. "top-info": o.HELP_MOBILE_FLOORPLAN_1,
  8583. "big-image": "images/nav_help_gesture_position.png"
  8584. },
  8585. middle: {
  8586. "top-info": o.HELP_MOBILE_FLOORPLAN_2,
  8587. "big-image": "images/nav_help_gesture_drag_two_finger.png"
  8588. },
  8589. right: {
  8590. "top-info": o.HELP_MOBILE_3,
  8591. "big-image": "images/nav_help_gesture_pinch.png"
  8592. }
  8593. }
  8594. },
  8595. this.assets[a.NAVIGATION][s.OUTDOOR] = JSON.parse(JSON.stringify(this.assets[a.NAVIGATION][s.PANORAMA])),
  8596. this.assets[a.NAVIGATION][s.OUTDOOR].desktop.middle = {
  8597. "top-info": o.HELP_DESKTOP_360_2A,
  8598. "bottom-info": o.HELP_DESKTOP_360_2B,
  8599. "big-image": "images/nav_help_click_inside.png",
  8600. keyboard: "images/nav_help_inside_key.png"
  8601. },
  8602. this.assets[a.NAVIGATION][s.OUTDOOR].mobile.middle = {
  8603. "top-info": o.HELP_MOBILE_360_2,
  8604. "big-image": "images/nav_help_tap_inside.png"
  8605. },
  8606. this.assets[a.MORE_HELP] = {
  8607. desktop: {
  8608. "more-help-hlr": {
  8609. "top-info": o.HELP_MORE_HLR_A,
  8610. "big-image": "images/nav_help_expand.svg",
  8611. "bottom-info": o.HELP_DESKTOP_MORE_HLR_B
  8612. },
  8613. "more-help-dollhouse": {
  8614. "top-info": o.HELP_MORE_DOLLHOUSE_A,
  8615. "big-image": "images/nav_help_dollhouse.svg",
  8616. "bottom-info": o.HELP_DESKTOP_MORE_DOLLHOUSE_B
  8617. },
  8618. "more-help-floors": {
  8619. "top-info": o.HELP_MORE_FLOORS_A,
  8620. "big-image": "images/nav_help_floor picker.svg",
  8621. "bottom-info": o.HELP_DESKTOP_MORE_FLOORS_B
  8622. },
  8623. "more-help-tag": {
  8624. "top-info": o.HELP_MORE_TAG_A,
  8625. "big-image": "images/nav_help_tag.svg",
  8626. "bottom-info": o.HELP_DESKTOP_MORE_TAG_B
  8627. },
  8628. "more-help-zoom": {
  8629. "top-info": o.HELP_MORE_ZOOM_A,
  8630. "big-image": "images/nav_help_zoom.svg",
  8631. "bottom-info": o.HELP_DESKTOP_MORE_ZOOM_B
  8632. },
  8633. "more-help-tour": {
  8634. "top-info": o.HELP_MORE_TOUR_A,
  8635. "big-image": "images/nav_help_play.png",
  8636. "bottom-info": o.HELP_DESKTOP_MORE_TOUR_B
  8637. },
  8638. "more-help-inside": {
  8639. "top-info": o.HELP_MORE_INSIDE_A,
  8640. "big-image": "images/nav_help_inside.svg",
  8641. "bottom-info": o.HELP_DESKTOP_MORE_INSIDE_B
  8642. },
  8643. "more-help-vr": {
  8644. "top-info": o.HELP_MORE_VR_A,
  8645. "big-image": "images/nav_help_vr.svg",
  8646. "bottom-info": o.HELP_DESKTOP_MORE_VR_B
  8647. },
  8648. "more-help-360": {
  8649. "top-info": o.HELP_MORE_360_A,
  8650. "big-image": "images/nav_help_360.svg",
  8651. "bottom-info": o.HELP_DESKTOP_MORE_360_B
  8652. },
  8653. "more-help-fullscreen": {
  8654. "top-info": o.HELP_MORE_FULLSCREEN_A,
  8655. "big-image": "images/nav_help_fullscreen.svg",
  8656. "bottom-info": o.HELP_DESKTOP_MORE_FULLSCREEN_B
  8657. }
  8658. },
  8659. mobile: {
  8660. "more-help-hlr": {
  8661. "top-info": o.HELP_MORE_HLR_A,
  8662. "big-image": "images/nav_help_expand.svg",
  8663. "bottom-info": o.HELP_DESKTOP_MORE_HLR_B
  8664. },
  8665. "more-help-dollhouse": {
  8666. "top-info": o.HELP_MORE_DOLLHOUSE_A,
  8667. "big-image": "images/nav_help_dollhouse.svg",
  8668. "bottom-info": o.HELP_MOBILE_MORE_DOLLHOUSE_B
  8669. },
  8670. "more-help-floors": {
  8671. "top-info": o.HELP_MORE_FLOORS_A,
  8672. "big-image": "images/nav_help_floor picker.svg",
  8673. "bottom-info": o.HELP_DESKTOP_MORE_FLOORS_B
  8674. },
  8675. "more-help-tag": {
  8676. "top-info": o.HELP_MORE_TAG_A,
  8677. "big-image": "images/nav_help_tag.svg",
  8678. "bottom-info": o.HELP_MOBILE_MORE_TAG_B
  8679. },
  8680. "more-help-tour": {
  8681. "top-info": o.HELP_MORE_TOUR_A,
  8682. "big-image": "images/nav_help_play.png",
  8683. "bottom-info": o.HELP_DESKTOP_MORE_TOUR_B
  8684. },
  8685. "more-help-inside": {
  8686. "top-info": o.HELP_MORE_INSIDE_A,
  8687. "big-image": "images/nav_help_inside.svg",
  8688. "bottom-info": o.HELP_MOBILE_MORE_INSIDE_B
  8689. },
  8690. "more-help-vr": {
  8691. "top-info": o.HELP_MORE_VR_A,
  8692. "big-image": "images/webvr.svg",
  8693. "bottom-info": o.HELP_MOBILE_MORE_VR_B
  8694. },
  8695. "more-help-360": {
  8696. "top-info": o.HELP_MORE_360_A,
  8697. "big-image": "images/nav_help_360.svg",
  8698. "bottom-info": o.HELP_MOBILE_MORE_360_B
  8699. }
  8700. }
  8701. },
  8702. this.assets[a.TOUR_INTERACTION[s.PANORAMA]] = {
  8703. desktop: {
  8704. left: {
  8705. "top-info": o.ROTATE,
  8706. "big-image": "images/nav_help_mouse_drag_left.png",
  8707. keyboard: "images/nav_help_keyboard_left_right.png"
  8708. },
  8709. middle: {
  8710. "top-info": o.MOVE,
  8711. "big-image": "images/nav_help_mouse_click.png",
  8712. keyboard: "images/nav_help_keyboard_up_down.png"
  8713. },
  8714. right: {
  8715. "top-info": o.PLAY,
  8716. "big-image": "images/Desktop-help-play-button.svg",
  8717. keyboard: "images/Desktop-help-spacebar-2.svg"
  8718. }
  8719. },
  8720. mobile: {
  8721. left: {
  8722. "top-info": o.ROTATE,
  8723. "big-image": "images/nav_help_gesture_drag.png"
  8724. },
  8725. middle: {
  8726. "top-info": o.MOVE,
  8727. "big-image": "images/nav_help_gesture_tap.png"
  8728. },
  8729. right: {
  8730. "top-info": o.PLAY,
  8731. "big-image": "images/mobile-help-play-button.svg"
  8732. }
  8733. }
  8734. },
  8735. this.assets[a.TOUR_INTERACTION[s.OUTDOOR]] = JSON.parse(JSON.stringify(this.assets[a.TOUR_INTERACTION[s.PANORAMA]])),
  8736. this.assets[a.TOUR_INTERACTION[s.OUTDOOR]].desktop.middle = this.assets[a.LANDING[s.OUTDOOR]].desktop.middle,
  8737. this.assets[a.TOUR_INTERACTION[s.OUTDOOR]].mobile.middle = this.assets[a.LANDING[s.OUTDOOR]].mobile.middle,
  8738. this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]] = JSON.parse(JSON.stringify(this.assets[a.TOUR_INTERACTION[s.OUTDOOR]])),
  8739. this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]].desktop.left = this.assets[a.LANDING[s.FLOORPLAN]].desktop.left,
  8740. this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]].mobile.left = this.assets[a.LANDING[s.FLOORPLAN]].mobile.left
  8741. }
  8742. },
  8743. fill: function(e, t, i) {
  8744. n.call(this, e, t, i, !0)
  8745. },
  8746. clear: function(e, t, i) {
  8747. n.call(this, e, t, i, !1)
  8748. }
  8749. }
  8750. }
  8751. , {
  8752. "../enum/HelpModalSize": 27,
  8753. "../enum/HelpModalType": 28,
  8754. "../enum/Viewmode": 51,
  8755. "../localization/localize": 108,
  8756. "../util/browser": 182
  8757. }],
  8758. 76: [function(e, t, i) {
  8759. "use strict";
  8760. t.exports = Object.freeze({
  8761. OPENED: "share.open",
  8762. CLOSED: "share.closed",
  8763. LINK_CLICKED: "share.linked"
  8764. })
  8765. }
  8766. , {}],
  8767. 77: [function(e, t, i) {
  8768. "use strict";
  8769. function n(e) {
  8770. function t(t, i) {
  8771. var n = window.screenY + ($("#player").height() - i) / 2
  8772. , r = window.screenX + ($("#player").width() - t) / 2
  8773. , o = "top=" + n + ",left=" + r + ",width=" + t + ",height=" + i;
  8774. I.emit(l.LINK_CLICKED, {
  8775. channel: e
  8776. }),
  8777. window.open(C[e], "shareWindow", o)
  8778. }
  8779. switch (e) {
  8780. case y.FACEBOOK:
  8781. t(580, 420);
  8782. break;
  8783. case y.TWITTER:
  8784. t(550, 440);
  8785. break;
  8786. case y.MAIL:
  8787. I.emit(l.LINK_CLICKED, {
  8788. channel: "email"
  8789. }),
  8790. window.open(C[e], "_blank");
  8791. break;
  8792. case y.LINKEDIN:
  8793. }
  8794. }
  8795. function r(e) {
  8796. I.emit(l.LINK_CLICKED, {
  8797. channel: "copylink"
  8798. });
  8799. var t = document.createRange();
  8800. t.selectNodeContents(v);
  8801. var i = window.getSelection();
  8802. i.removeAllRanges(),
  8803. i.addRange(t),
  8804. document.execCommand("copy"),
  8805. A.classList.remove("hidden"),
  8806. v.classList.add("highlighted")
  8807. }
  8808. function o(e) {
  8809. e && (e.stopPropagation(),
  8810. e.target === v) || (window.getSelection().removeAllRanges(),
  8811. v.classList.remove("highlighted"),
  8812. A.classList.add("hidden"))
  8813. }
  8814. var a = e("../../util/browser")
  8815. , s = e("../../localization/localize")
  8816. , l = e("./ShareEvents")
  8817. , c = e("../../util/common")
  8818. , h = e("events").EventEmitter
  8819. , u = document.getElementById("sharing")
  8820. , d = document.getElementById("share-modal")
  8821. , p = document.getElementById("share-close")
  8822. , f = document.getElementById("facebook-share")
  8823. , g = document.getElementById("twitter-share")
  8824. , m = document.getElementById("mail-share")
  8825. , v = document.getElementById("share-url-text")
  8826. , A = document.getElementById("copy-success")
  8827. , y = Object.freeze({
  8828. FACEBOOK: "facebook",
  8829. TWITTER: "twitter",
  8830. MAIL: "mail",
  8831. LINKEDIN: "linkedin"
  8832. })
  8833. , C = {};
  8834. C[y.FACEBOOK] = "http://www.facebook.com/sharer.php?u=" + encodeURIComponent(window.location.href + "&utm_source=1") + "&t=",
  8835. C[y.TWITTER] = "http://twitter.com/intent/tweet?text=",
  8836. C[y.MAIL] = "mailto:?subject=";
  8837. var I = {
  8838. init: function(e) {
  8839. var t = encodeURIComponent(s.SHARE_EXPLORE + e + " " + s.SHARE_AT + " ");
  8840. C[y.FACEBOOK] += t + encodeURIComponent(window.location.href + "&utm_source=1"),
  8841. C[y.TWITTER] += t + encodeURIComponent(window.location.href + "&utm_source=2 " + s.SHARE_WITH + " #port"),
  8842. C[y.MAIL] += encodeURIComponent(s.SHARE_EXPLORE + e + s.SHARE_3D) + "&body=" + t + encodeURIComponent(window.location.href + "&utm_source=3"),
  8843. u.addEventListener("click", this.toggle.bind(this)),
  8844. p.addEventListener("click", this.hide.bind(this)),
  8845. v.addEventListener("click", r),
  8846. d.addEventListener("click", o),
  8847. f.addEventListener("click", n.bind(this, y.FACEBOOK)),
  8848. g.addEventListener("click", n.bind(this, y.TWITTER)),
  8849. m.addEventListener("click", n.bind(this, y.MAIL)),
  8850. v.textContent = window.location.href + "&utm_source=4",
  8851. d.classList.add(a.isMobile() ? "mobile" : "desktop"),
  8852. u.classList.remove("hidden")
  8853. },
  8854. show: function() {
  8855. this.emit(l.OPENED),
  8856. d.classList.add("fadeIn")
  8857. },
  8858. hide: function() {
  8859. d.classList.contains("fadeIn") && (this.emit(l.CLOSED),
  8860. document.selection && document.selection.empty(),
  8861. window.getSelection().removeAllRanges(),
  8862. o(),
  8863. d.classList.remove("fadeIn"))
  8864. },
  8865. toggle: function() {
  8866. d.classList.contains("fadeIn") ? this.hide() : this.show()
  8867. }
  8868. };
  8869. c.extendObject(I, h.prototype),
  8870. t.exports = I
  8871. }
  8872. , {
  8873. "../../localization/localize": 108,
  8874. "../../util/browser": 182,
  8875. "../../util/common": 185,
  8876. "./ShareEvents": 76,
  8877. events: 202
  8878. }],
  8879. 78: [function(e, t, i) {
  8880. "use strict";
  8881. t.exports = Object.freeze({
  8882. OPENED: "terms.opened",
  8883. CLOSED: "terms.closed"
  8884. })
  8885. }
  8886. , {}],
  8887. 79: [function(e, t, i) {
  8888. "use strict";
  8889. var n = e("./TermsEvent")
  8890. , r = e("../../localization/localize")
  8891. , o = e("../../analytics")
  8892. , a = e("../../util/ajax")
  8893. , s = e("../../util/common")
  8894. , l = e("events").EventEmitter
  8895. , c = document.getElementById("terms-modal")
  8896. , h = {
  8897. init: function() {
  8898. $(".footer-terms").on("click", function(e) {
  8899. e.preventDefault(),
  8900. this.show()
  8901. }
  8902. .bind(this)),
  8903. $("#terms-modal .close").on("click", this.hide.bind(this))
  8904. },
  8905. show: function() {
  8906. this.emit(n.OPENED),
  8907. a.get("static/" + r.TERMS_TEXT_FILE).done(function(e) {
  8908. var t = $("#terms-text").html(e);
  8909. o.track("showcase_gui", {
  8910. gui_action: "click_terms_button",
  8911. interaction_source: "gui"
  8912. }),
  8913. t.find("a").attr("target", "_blank")
  8914. }).fail(function() {
  8915. $("#terms-text").html("<h1>" + r.TERMS_OF_USE + "</h1><p>" + r.TERMS_FAIL)
  8916. }),
  8917. c.classList.add("fadeIn")
  8918. },
  8919. hide: function(e) {
  8920. e && e.preventDefault(),
  8921. c.classList.contains("fadeIn") && this.emit(n.CLOSED),
  8922. c.classList.remove("fadeIn")
  8923. }
  8924. };
  8925. s.extendObject(h, l.prototype),
  8926. t.exports = h
  8927. }
  8928. , {
  8929. "../../analytics": 4,
  8930. "../../localization/localize": 108,
  8931. "../../util/ajax": 181,
  8932. "../../util/common": 185,
  8933. "./TermsEvent": 78,
  8934. events: 202
  8935. }],
  8936. 80: [function(e, t, i) {
  8937. "use strict";
  8938. t.exports = Object.freeze({
  8939. OPEN_INFO: "title.open.info",
  8940. CLOSE_INFO: "title.close.info",
  8941. SHOW_INFO: "title.show.info",
  8942. HIDE_INFO: "title.hide.info",
  8943. LINK_CLICKED: "title.link.click",
  8944. CONTACT_LINK_CLICKED: "title.contact.click",
  8945. ORIGIN_LINK_CLICKED: "title.origin.click"
  8946. })
  8947. }
  8948. , {}],
  8949. 81: [function(e, t, i) {
  8950. "use strict";
  8951. function n(e, t) {
  8952. o.tags.enabled && 0 !== Object.keys(e.tags).length && r(e, t)
  8953. }
  8954. function r(e, t) {
  8955. function i(i) {
  8956. e.shouldShowtags = "show" === this.value,
  8957. e.shouldShowtags ? t.showAlltags(o.tags.startup.fadeInDuration) : t.hideAlltags(o.tags.startup.fadeInDuration)
  8958. }
  8959. document.getElementById("tag-toggles").classList.remove("hidden"),
  8960. document.getElementById("radio-tag-show").checked = !0;
  8961. for (var n = document.getElementById("tag-inputs").querySelectorAll("input"), r = 0; r < n.length; r++)
  8962. n[r].addEventListener("change", i)
  8963. }
  8964. var o = e("../../settings");
  8965. t.exports.init = n
  8966. }
  8967. , {
  8968. "../../settings": 166
  8969. }],
  8970. 82: [function(e, t, i) {
  8971. (function(i) {
  8972. "use strict";
  8973. function n(e, t) {
  8974. return e && u.valueFromHash("title", 1) && 2 !== u.valueFromHash("mls", 0) ? (document.getElementsByClassName("titleText")[0].innerText = e, g_weixinObj.title = e,
  8975. e.length > g.minTooltipCharacters && I.parentElement.setAttribute("data-original-title", e),
  8976. t && 1 !== m.specialEdition && m.brand && !m.mls ? document.getElementById("cobrandTitle").innerText = t : (document.getElementsByClassName("co-brand")[0].classList.add("hidden"),
  8977. document.getElementById("gui-name").classList.add("noCoBrand"),
  8978. document.getElementById("cobrandTitle").classList.add("hidden")),
  8979. !0) : (document.getElementById("model-title").classList.add("hidden"),
  8980. !1)
  8981. }
  8982. function r(e) {
  8983. return e ? (L = !0,
  8984. void (_.innerHTML = e)) : void _.classList.add("hidden")
  8985. }
  8986. function o(e, t, i, n) {
  8987. if (!e && !t && !i || !m.brand || u.valueFromHash("mls", !1))
  8988. return void T.classList.add("hidden");
  8989. L = !0;
  8990. var r = []
  8991. , o = c(r, "<br>");
  8992. if (e && o('<span id="contactName">' + e + "</span>"),
  8993. t) {
  8994. var a = n || t
  8995. , s = u.isMobile() ? '<a id="phone" href="callto:' + t + '">' + a + "</a>" : "<span>" + a + "</span>";
  8996. o(s)
  8997. }
  8998. i && o('<a id="email" href="mailTo:' + i + '">' + i + "</a>"),
  8999. r[0] = "",
  9000. x.innerHTML = r.join("")
  9001. }
  9002. function a(e) {
  9003. if ("string" == typeof e)
  9004. try {
  9005. e = JSON.parse(e)
  9006. } catch (e) {
  9007. return y.warn("Unable to parse address data"),
  9008. void S.parentElement.classList.add("hidden")
  9009. }
  9010. if (!(e && (e.address_1 || e.address_2 || e.city || e.state || e.zip)))
  9011. return void S.parentElement.classList.add("hidden");
  9012. L = !0;
  9013. var t = []
  9014. , i = c(t, " ");
  9015. e.address_1 && i(e.address_1),
  9016. e.address_2 && i(e.address_2),
  9017. e.city && i(e.city, ", "),
  9018. e.state && i(e.state, ", "),
  9019. e.zip && i(e.zip, e.state ? " " : ", "),
  9020. t[0] = "",
  9021. S.innerText = t.join("")
  9022. }
  9023. function s(e) {
  9024. var t = document.createElement("a");
  9025. return t.id = "url",
  9026. t.target = "_blank",
  9027. t.href = e,
  9028. t.innerText = e,
  9029. t.addEventListener("click", N.emit.bind(N, v.ORIGIN_LINK_CLICKED)),
  9030. t
  9031. }
  9032. function l(e) {
  9033. return !(!e || u.inIframe() && document.referrer === e) && (R.classList.remove("hidden"),
  9034. P.innerHTML = f.WEBVR_LEARN_MORE + ": ",
  9035. P.appendChild(s(e)),
  9036. O.forEach(function(e) {
  9037. e.classList.add("share-link")
  9038. }),
  9039. !0)
  9040. }
  9041. function c(e, t) {
  9042. var i = e
  9043. , n = t;
  9044. return function(e, t) {
  9045. i.push(t || n, e)
  9046. }
  9047. }
  9048. function h() {
  9049. document.getElementById("title-toggle").addEventListener("click", N.toggleTitle.bind(N)),
  9050. L && I.addEventListener("click", N.toggleMeta.bind(N, !1));
  9051. var e = [].slice.call(_.querySelectorAll("a"));
  9052. e.forEach(function(e) {
  9053. e.addEventListener("click", N.emit.bind(N, v.LINK_CLICKED))
  9054. });
  9055. var t = [].slice.call(T.querySelectorAll("a"));
  9056. t.forEach(function(e) {
  9057. e.addEventListener("click", N.emit.bind(N, v.CONTACT_LINK_CLICKED, {
  9058. contact_type: e.getAttribute("id")
  9059. }))
  9060. })
  9061. }
  9062. var u = e("../../util/browser")
  9063. , d = e("../../util/common")
  9064. , p = e("../../util/logger")
  9065. , f = e("../../localization/localize")
  9066. , g = e("./titleBarSettings")
  9067. , m = e("../../settings")
  9068. , v = e("./TitleEvents")
  9069. , A = e("events").EventEmitter
  9070. , y = new p(i)
  9071. , C = document.querySelector(".pinTop.left")
  9072. , I = document.getElementsByClassName("title-container")[0]
  9073. , E = document.getElementById("title-toggle").querySelector("i")
  9074. , b = document.getElementById("meta-info-wrapper")
  9075. , w = document.getElementById("meta-info")
  9076. , _ = document.getElementById("meta-description")
  9077. , T = document.getElementsByClassName("contact-info")[0]
  9078. , x = document.getElementById("contact-data")
  9079. , S = document.getElementById("addressTxt")
  9080. , M = document.getElementById("tag-toggles")
  9081. , R = document.getElementById("share-origin")
  9082. , P = document.getElementById("share-link-wrapper")
  9083. , O = [w, b, I]
  9084. , L = !1
  9085. , D = !1
  9086. , N = {
  9087. populate: function(e) {
  9088. if (n(MP_PREFETCHED_MODELDATA.name, e.coBrand)) {
  9089. if (r(e.description),
  9090. o(e.contactName, e.phone, e.email, e.formatted_contact_phone),
  9091. a(e.address),
  9092. L) {
  9093. var t = document.createElement("br");
  9094. M.insertBefore(t, M.firstElementChild)
  9095. }
  9096. e.socialSharing && m.share.enabled && (D = l(e.url))
  9097. }
  9098. },
  9099. finishSetup: function(e) {
  9100. L = L || !!e,
  9101. h(),
  9102. L || (D ? I.classList.add("share-only") : I.classList.add("no-meta"))
  9103. },
  9104. toggleMeta: function(e, t) {
  9105. var title = document.getElementById("model-title");
  9106. t && t.preventDefault();
  9107. var i = w.classList.contains("expand");
  9108. e && !i || (i ? (O.forEach(function(e) {
  9109. e.classList.remove("expand")
  9110. }),
  9111. this.emit(v.CLOSE_INFO),title.classList.remove("expand")) : (O.forEach(function(e) {
  9112. e.classList.add("expand");
  9113. }),
  9114. title.classList.add("expand"),
  9115. this.emit(v.OPEN_INFO)))
  9116. },
  9117. setupToggling: function() {
  9118. b.style.height = w.offsetHeight + "px",
  9119. w.addEventListener("transitionend", function() {
  9120. b.style.height = w.offsetHeight + "px"
  9121. })
  9122. },
  9123. toggleTitle: function(e) {
  9124. e && e.preventDefault(),
  9125. C.classList.contains("closed") ? (C.classList.add("open"),
  9126. E.classList.remove("icon-dpad-right"),
  9127. E.classList.add("icon-dpad-left"),
  9128. this.emit(v.SHOW_INFO),
  9129. setTimeout(function() {
  9130. C.classList.remove("closed"),
  9131. C.classList.remove("open")
  9132. }, g.removeAnimationClasses)) : (C.classList.add("closed"),
  9133. E.classList.remove("icon-dpad-left"),
  9134. E.classList.add("icon-dpad-right"),
  9135. this.emit(v.HIDE_INFO))
  9136. }
  9137. };
  9138. d.extendObject(N, A.prototype),
  9139. t.exports = N
  9140. }
  9141. ).call(this, "/js/gui/title/titleBar.js")
  9142. }
  9143. , {
  9144. "../../localization/localize": 108,
  9145. "../../settings": 166,
  9146. "../../util/browser": 182,
  9147. "../../util/common": 185,
  9148. "../../util/logger": 189,
  9149. "./TitleEvents": 80,
  9150. "./titleBarSettings": 83,
  9151. events: 202
  9152. }],
  9153. 83: [function(e, t, i) {
  9154. "use strict";
  9155. t.exports = Object.freeze({
  9156. minTooltipCharacters: 19,
  9157. removeAnimationClasses: 500
  9158. })
  9159. }
  9160. , {}],
  9161. 84: [function(e, t, i) {
  9162. "use strict";
  9163. function n(e) {
  9164. C = e,
  9165. P.forEach(function(e) {
  9166. b.addEventListener(e, u.bind(this, !1), !0),
  9167. w.addEventListener(e, u.bind(this, !0), !0),
  9168. E.addEventListener(e, o, !0),
  9169. S.forEach(function(t) {
  9170. t.addEventListener(e, a, !0)
  9171. }),
  9172. $("#drawer img").on(e, a)
  9173. }),
  9174. document.addEventListener("keydown", u.bind(this, !1), !0),
  9175. C.on(v.TourStart, function() {
  9176. E.classList.add("playing")
  9177. })
  9178. }
  9179. function r() {
  9180. C.playTour(),
  9181. I && clearTimeout(I),
  9182. d(),
  9183. _.removeClass("fadeIn")
  9184. }
  9185. function o() {
  9186. E.classList.contains("playing") && (C.stopTour(),
  9187. _.addClass("fadeIn"),
  9188. setTimeout(function() {
  9189. _.removeClass("fadeIn")
  9190. }, p.tourInteraction.showPauseButton),
  9191. O || (clearTimeout(I),
  9192. I = setTimeout(h, p.tourInteraction.showModal)),
  9193. setTimeout(function() {
  9194. E.classList.remove("playing")
  9195. }, p.tourInteraction.allowNextClick))
  9196. }
  9197. function a() {
  9198. C.tourInProgress && (C.stopTour(),
  9199. C.endTourProgress(),
  9200. E.classList.remove("playing"))
  9201. }
  9202. function s() {
  9203. T.is(":visible") ? r() : o()
  9204. }
  9205. function l() {
  9206. x.hasClass("playing") && (clearTimeout(I),
  9207. C.atEndOfTour() ? c() : _.removeClass("fadeIn"))
  9208. }
  9209. function c() {
  9210. E.classList.remove("playing"),
  9211. h()
  9212. }
  9213. function h() {//去掉导览结束时的提示
  9214. /* if (!p.tourInteraction.disabled) {
  9215. M.removeClass("small landing " + g.FLOORPLAN + " " + g.OUTDOOR + " " + g.PANORAMA),
  9216. M.addClass("fadeIn tour " + m.deviceType);
  9217. var e = p.tourInteraction.smallModal ? y.SMALL : y.LARGE;
  9218. if (!p.tourInteraction.smallModal) {
  9219. var t;
  9220. 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,
  9221. m.fill(R, A.TOUR_INTERACTION[t]),
  9222. M.addClass(t)
  9223. }
  9224. M.addClass(e)
  9225. } */
  9226. }
  9227. function u(e, t) {
  9228. if (t) {
  9229. var i = "keydown" === t.type
  9230. , n = t.which === f.SPACE || C.tourIsPlaying;
  9231. i && n || e || (O = !0),
  9232. C.atEndOfTour() && d(),
  9233. !C.tourIsPlaying && C.tourInProgress && (_.removeClass("fadeIn"),
  9234. d(),
  9235. t.which !== f.SPACE && a()),
  9236. i && n && s()
  9237. }
  9238. }
  9239. function d() {
  9240. M.removeClass("fadeIn")
  9241. }
  9242. var p = (e("../util/browser"),
  9243. e("../settings"))
  9244. , f = e("../enum/Keys")
  9245. , g = e("../enum/Viewmode")
  9246. , m = (e("./helpManager"),
  9247. e("./populateModal"))
  9248. , v = e("../enum/DirectorEvents")
  9249. , A = e("../enum/HelpModalType")
  9250. , y = e("../enum/HelpModalSize")
  9251. , C = null
  9252. , I = null
  9253. , E = document.getElementById("pause-overlay")
  9254. , b = document.getElementById("player")
  9255. , w = document.getElementById("gui")
  9256. , _ = $("#pause-icon").eq(0)
  9257. , T = $("#play").eq(0)
  9258. , x = $("#playHead").eq(0)
  9259. , S = $(".rightViewContainer, #previous, #next, #gui-modes-inside, #gui-modes-outside, #gui-modes-dollhouse, #gui-modes-floorplan").toArray()
  9260. , M = $("#interaction-modal").eq(0)
  9261. , R = $("#interaction-modal .interaction").toArray()
  9262. , P = ["touchstart", "mousedown", "pointerdown"]
  9263. , O = !1;
  9264. t.exports.init = n,
  9265. t.exports.play = r,
  9266. t.exports.pause = o,
  9267. t.exports.pauseWithoutCTA = a,
  9268. t.exports.togglePlay = s,
  9269. t.exports.stopTour = l,
  9270. t.exports.dismissModal = d
  9271. }
  9272. , {
  9273. "../enum/DirectorEvents": 23,
  9274. "../enum/HelpModalSize": 27,
  9275. "../enum/HelpModalType": 28,
  9276. "../enum/Keys": 30,
  9277. "../enum/Viewmode": 51,
  9278. "../settings": 166,
  9279. "../util/browser": 182,
  9280. "./helpManager": 68,
  9281. "./populateModal": 75
  9282. }],
  9283. 85: [function(e, t, i) {
  9284. "use strict";
  9285. t.exports = Object.freeze({
  9286. OPENED: "vr.modal.opened",
  9287. LAUNCH: "vr.modal.launch",
  9288. CLOSED: "vr.modal.closed",
  9289. NEXT: "vr.modal.next",
  9290. PREV: "vr.modal.prev",
  9291. STORE: "vr.modal.store",
  9292. falseICECHOSEN: "vr.modal.device"
  9293. })
  9294. }
  9295. , {}],
  9296. 86: [function(e, t, i) {
  9297. "use strict";
  9298. function n(e, t, i) {
  9299. function n(e, t, n, r) {
  9300. function o() {
  9301. return p + "&m=" + t + "&display=" + e
  9302. }
  9303. function s() {
  9304. var e = "&utm_medium=" + (a.inIframe() ? "embed" : "direct")
  9305. , t = "&utm_source=" + u
  9306. , n = "&utm_showcase_session_id=" + i;
  9307. return e + t + n
  9308. }
  9309. function l() {
  9310. return d + "&sids=" + t + "&lsid=" + t + "&ln=" + encodeURIComponent(n) + "&ld=" + encodeURIComponent(r) + "&display=" + e
  9311. }
  9312. return a.valueFromHash("vrcoll", !1) ? l() + s() : o() + s()
  9313. }
  9314. function r(e, t, i, r) {
  9315. var o = "https://api.branch.io/v1/url"
  9316. , a = n(e, t, i, r)
  9317. , s = {
  9318. responseType: "json",
  9319. data: {
  9320. branch_key: h.appConfig.branch_key,
  9321. data: {
  9322. m: t,
  9323. full_url: a,
  9324. $desktop_url: m,
  9325. $og_app_id: "331853976762864119",
  9326. $og_title: i,
  9327. $og_description: r,
  9328. $og_image_url: location.origin + "/api/v1/player/models/" + t + "/thumb",
  9329. $canonical_url: window.location.href
  9330. }
  9331. }
  9332. };
  9333. c.post(o, s).done(function(t) {
  9334. f[e] = t.url
  9335. }).fail(function(t) {
  9336. f[e] = t
  9337. }
  9338. .bind(this, a))
  9339. }
  9340. function o(e, t, i) {
  9341. for (var r in s) {
  9342. var o = s[r]
  9343. , a = n(o, e, t, i);
  9344. f[o] = a
  9345. }
  9346. }
  9347. var u = a.inIframe() ? encodeURIComponent(document.referrer) : encodeURIComponent(window.location.href)
  9348. , d = g + "/vr/dlist/?ret=" + u
  9349. , p = g + "/vr/show/?ret=" + u
  9350. , m = "";
  9351. switch (e) {
  9352. case l.IOS:
  9353. r(s.CardboardIOS, t.sid, t.name, t.summary);
  9354. break;
  9355. default:
  9356. o(t.sid, t.name, t.summary)
  9357. }
  9358. }
  9359. function r(e) {
  9360. var t = f[e];
  9361. window.open(t, "_blank")
  9362. }
  9363. function o(e) {
  9364. var t = u[e];
  9365. window.open(t, "_blank")
  9366. }
  9367. var a = e("../../util/browser")
  9368. , s = e("../../enum/VRApps")
  9369. , l = e("../../enum/VRPlatforms")
  9370. , c = e("../../util/ajax")
  9371. , h = e("../../settings")
  9372. , u = {};
  9373. u[s.CardboardAndroid] = "https://play.google.com/store/apps/details?id=com.port.mpvrcardboard&redirect_uri=",
  9374. u[s.CardboardIOS] = "https://itunes.apple.com/us/app/port-vr/id1168808473&redirect_uri=",
  9375. u[s.GearVR] = "https://www.oculus.com/experiences/gear-vr/811670972252145/?redirect_uri=";
  9376. for (var d in s) {
  9377. var p = s[d];
  9378. u[p] += encodeURIComponent(document.referrer + "&display=" + p)
  9379. }
  9380. var f = {}
  9381. , g = function() {
  9382. var e = window.location.host;
  9383. return e.indexOf(".port.com") === -1 && e.indexOf("localhost") === -1 && (e = "my.port.com"),
  9384. "https://" + e
  9385. }();
  9386. t.exports.init = n,
  9387. t.exports.launch = r,
  9388. t.exports.launchStore = o
  9389. }
  9390. , {
  9391. "../../enum/VRApps": 46,
  9392. "../../enum/VRPlatforms": 49,
  9393. "../../settings": 166,
  9394. "../../util/ajax": 181,
  9395. "../../util/browser": 182
  9396. }],
  9397. 87: [function(e, t, i) {
  9398. "use strict";
  9399. function n(e) {
  9400. var t;
  9401. switch (e) {
  9402. case m.IOS:
  9403. return t = p.iosVersion(),
  9404. t.major > 9 || 9 === t.major && t.minor >= 1;
  9405. case m.Android:
  9406. return t = p.androidVersion(),
  9407. t.major > 4 || 4 === t.major && t.minor > 4 || 4 === t.major && 4 === t.minor && t.patch >= 4
  9408. }
  9409. return !1
  9410. }
  9411. function r(e, t) {
  9412. function i(e) {
  9413. K.emit(A.STORE, {
  9414. type: e
  9415. }),
  9416. f.launchStore(e)
  9417. }
  9418. function r(e) {
  9419. switch (e !== _.pageCount && (a(e),
  9420. N.text(e + 1 + " / " + _.pageCount)),
  9421. e) {
  9422. case _.Title:
  9423. O.css("display", "none"),
  9424. L.text(u[e]),
  9425. o(s);
  9426. break;
  9427. case _.Cardboard:
  9428. O.css("display", "block"),
  9429. L.text(u[e]),
  9430. M.filter(".cardboard").off(),
  9431. M.filter(".gearvr").off(),
  9432. c(e, s),
  9433. h(H, X, Z);
  9434. break;
  9435. case _.Gear:
  9436. L.text(u[e]),
  9437. c(e, s),
  9438. T.addClass("lastPage"),
  9439. h(G, X, Z);
  9440. break;
  9441. case _.pageCount:
  9442. T.removeClass("fadeIn"),
  9443. K.emit(A.CLOSED)
  9444. }
  9445. B.filter("[src='']").hide()
  9446. }
  9447. var s = function() {
  9448. return p.detectAndroid() ? p.detectAndroidMobile() && n(m.Android) ? (T.addClass("supported"),
  9449. w = ".show-supported",
  9450. m.Android) : (T.addClass("unsupported"),
  9451. w = ".show-unsupported",
  9452. m.UnsupportedAndroid) : p.detectIPhone() || p.detectIPod() ? (T.addClass("ios"),
  9453. w = ".show-ios",
  9454. _ = v.ios,
  9455. m.IOS) : (T.addClass("desktop"),
  9456. w = ".show-desktop",
  9457. m.Desktop)
  9458. }();
  9459. f.init(s, e, t),
  9460. s !== m.Desktop && T.addClass("mobile");
  9461. var l = function(e) {
  9462. K.emit(A.LAUNCH, {
  9463. vr_platform: s,
  9464. vr_app: e
  9465. }),
  9466. f.launch(e)
  9467. };
  9468. q.cardboardAndroid = l.bind(this, g.CardboardAndroid),
  9469. q.gear = l.bind(this, g.GearVR),
  9470. q.cardboardIOS = l.bind(this, g.CardboardIOS),
  9471. d(),
  9472. $(".show-supported, .show-unsupported, .show-ios, .show-desktop").hide(),
  9473. $(w).show();
  9474. var u = [C.VR_LEARN_MORE_CAPS, C.VR_NEXT_CAPS, C.VR_GOT_IT_CAPS]
  9475. , y = ["vr_modal_learn_more", "vr_modal_next", "vr_modal_done"];
  9476. s === m.IOS && (u.splice(1, 1),
  9477. y.splice(1, 1)),
  9478. $("#vr").on("click", function(e) {
  9479. e.preventDefault();
  9480. if(!window.vrEnabled) { // 开启VR
  9481. window.vrEnabled = true;
  9482. this.classList.add('active');
  9483. $('#gui div').not('#vrOff').addClass('vrHide');
  9484. $('#vrOffImg').css({'display':'inline-block'});
  9485. }else{
  9486. }
  9487. // T.hasClass("fadeIn") ? K.dismiss() : (b = 0,
  9488. // r(b),
  9489. // T.addClass("fadeIn"),
  9490. // K.emit(A.OPENED))
  9491. });
  9492. $('#vrOff').on('click', function(){
  9493. window.vrEnabled = false;
  9494. $('#gui div').not('#vrOff').removeClass('vrHide');
  9495. $('#vrOffImg').css({'display':'none'});
  9496. $('#player canvas').css({width:'', 'height': ''}); // 清楚vr下给canvas设置的宽高, 避免横竖屏切换的时候出现宽高错误的现象
  9497. $('#vr').removeClass('active'); // 清除vr按钮的激活样式
  9498. })
  9499. var I = "https://my.port.com/vr/show/?m=" + e.sid;
  9500. s === m.IOS ? $(".cardboardLink").on("click", i.bind(this, g.CardboardIOS)) : $(".cardboardLink").on("click", i.bind(this, g.CardboardAndroid)),
  9501. $(".gearLink").on("click", i.bind(this, g.GearVR)),
  9502. $("span.modelLink").text(I),
  9503. O.on("click", function(e) {
  9504. K.emit(A.PREV),
  9505. b--,
  9506. r(b)
  9507. }),
  9508. L.on("click", function(e) {
  9509. L.text();
  9510. K.emit(A.NEXT, {
  9511. nextAction: y[b]
  9512. }),
  9513. b++,
  9514. r(b)
  9515. }),
  9516. T.find(".close").on("click", K.dismiss)
  9517. }
  9518. function o(e) {
  9519. switch (e) {
  9520. case m.Android:
  9521. M.filter(".cardboard").off().on("click", q.cardboardAndroid),
  9522. M.filter(".gearvr").off().on("click", q.gear),
  9523. s(H, G, "logo-button", "same-line");
  9524. break;
  9525. case m.UnsupportedAndroid:
  9526. s("", z, "", "");
  9527. break;
  9528. case m.IOS:
  9529. M.filter(".cardboard").off().on("click", q.cardboardIOS),
  9530. s(H, "", "logo-button", "");
  9531. break;
  9532. case m.Desktop:
  9533. M.filter(".cardboard").off().on("click", l.bind(this, null, F, U)),
  9534. M.filter(".gearvr").off().on("click", l.bind(this, G, V, null)),
  9535. s(H, G, "logo-button", "same-line"),
  9536. Q.cardboard()
  9537. }
  9538. }
  9539. function a(e) {
  9540. $(".p1, .p2, .p3").hide(),
  9541. x.insertAfter(S),
  9542. T.removeClass("front-page"),
  9543. T.removeClass("details-page"),
  9544. T.removeClass("lastPage"),
  9545. M.removeClass("logo-button"),
  9546. M.removeClass("same-line"),
  9547. S.removeClass("headsetOptions"),
  9548. R.attr("src", ""),
  9549. R.filter(".second").removeClass("gear"),
  9550. R.css("display", "inline-block"),
  9551. R.off(),
  9552. P.filter(".second").css("display", ""),
  9553. D.css("display", "none"),
  9554. $(".p" + (e + 1) + w).show(),
  9555. R.filter(".third").insertBefore(P.filter(".third"))
  9556. }
  9557. function s(e, t, i, n) {
  9558. T.addClass("front-page"),
  9559. R.filter(".first").attr("src", e),
  9560. R.filter(".second").attr("src", t),
  9561. M.filter(".first").addClass(i),
  9562. M.filter(".second").addClass(i),
  9563. M.addClass(n),
  9564. ".show-desktop" === w && S.insertAfter(x)
  9565. }
  9566. function l(e, t, i) {
  9567. S.addClass("headsetOptions"),
  9568. M.off(),
  9569. R.filter(".second").attr("src", t),
  9570. D.css("display", "block"),
  9571. P.filter(".second").css("display", "none"),
  9572. D.on("click", function() {
  9573. a(_.Title),
  9574. o(m.Desktop)
  9575. }),
  9576. e && (K.emit(A.falseICECHOSEN, {
  9577. name: g.GearVR
  9578. }),
  9579. R.filter(".first").attr("src", e),
  9580. R.filter(".second").addClass("gear"),
  9581. R.filter(".second").on("click", f.launchStore.bind(this, g.GearVR)),
  9582. Q.gearvr()),
  9583. i && (K.emit(A.falseICECHOSEN, {
  9584. name: g.Cardboard
  9585. }),
  9586. R.filter(".third").attr("src", i),
  9587. R.filter(".third").show(),
  9588. R.filter(".third").insertAfter(R.filter(".second")),
  9589. R.filter(".third").addClass("link"),
  9590. R.filter(".second").addClass("link"),
  9591. R.filter(".second").on("click", f.launchStore.bind(this, g.CardboardIOS)),
  9592. R.filter(".third").on("click", f.launchStore.bind(this, g.CardboardAndroid)),
  9593. Q.cardboard())
  9594. }
  9595. function c(e, t) {
  9596. switch (t) {
  9597. case m.IOS:
  9598. X = Y,
  9599. Z = j;
  9600. break;
  9601. case m.Desktop:
  9602. e === _.Cardboard ? (X = F,
  9603. Z = U,
  9604. R.filter(".second").on("click", f.launchStore.bind(this, g.CardboardIOS)),
  9605. R.filter(".third").on("click", f.launchStore.bind(this, g.CardboardAndroid))) : (X = V,
  9606. R.filter(".second").on("click", f.launchStore.bind(this, g.GearVR)),
  9607. Z = "");
  9608. break;
  9609. default:
  9610. e === _.Cardboard ? (X = z,
  9611. Z = j) : (X = k,
  9612. Z = W)
  9613. }
  9614. }
  9615. function h(e, t, i) {
  9616. T.find(".inner").addClass("details-page"),
  9617. T.addClass("details-page"),
  9618. R.filter(".first").attr("src", e),
  9619. R.filter(".second").attr("src", t),
  9620. R.filter(".third").attr("src", i)
  9621. }
  9622. function u() {
  9623. T.hasClass("fadeIn") && (T.removeClass("fadeIn"),
  9624. K.emit(A.CLOSED))
  9625. }
  9626. function d() {
  9627. var e = p.aspectRatio() > 1 && p.isMobile();
  9628. T.toggleClass("landscape", e).toggleClass("portrait", !e),
  9629. T.toggleClass("tiny", $("#player").height() <= y.narrowLandscapeHeight),
  9630. T.toggleClass("tinier", $("#player").height() <= y.reallyNarrowLandscapeHeight)
  9631. }
  9632. var p = e("../../util/browser")
  9633. , f = e("./vrLink")
  9634. , g = e("../../enum/VRApps")
  9635. , m = e("../../enum/VRPlatforms")
  9636. , v = e("../../enum/VRPages")
  9637. , A = e("./vrEvent")
  9638. , y = (e("../../settings"),
  9639. e("../../constants"))
  9640. , C = e("../../localization/localize")
  9641. , I = e("../../util/common")
  9642. , E = e("events").EventEmitter
  9643. , b = 0
  9644. , w = null
  9645. , _ = v.standard
  9646. , T = $(".vr-popup")
  9647. , x = T.find(".vr-popup-body")
  9648. , S = T.find(".vr-images")
  9649. , M = T.find(".img-container")
  9650. , R = T.find(".vr-sm-image")
  9651. , P = M.find(".vr-img-caption")
  9652. , O = $(".vr-buttons").find(".prev-button")
  9653. , L = $(".vr-buttons").find(".next-button")
  9654. , D = S.find(".front-close")
  9655. , N = $(".vr-page")
  9656. , B = T.find("img")
  9657. , F = "images/apple-store.png"
  9658. , V = "images/badge-oculus.png"
  9659. , U = "images/badge-cardboard.png"
  9660. , k = "images/logo-samsung.png"
  9661. , H = "images/headset-cardboard.png"
  9662. , G = "images/headset-gearvr.png"
  9663. , z = "images/ico-android-robot.png"
  9664. , W = "images/ico-gearvr.png"
  9665. , j = "images/ico-vr.png"
  9666. , Y = "images/apple-logo-white.svg"
  9667. , X = null
  9668. , Z = null
  9669. , q = {}
  9670. , K = {
  9671. init: r,
  9672. dismiss: u,
  9673. isDeviceSupported: n
  9674. };
  9675. I.extendObject(K, E.prototype),
  9676. $(window).resize(d);
  9677. var Q = function() {
  9678. var e = P.filter(".first").find(".cardboard")
  9679. , t = P.filter(".first").find(".gearvr");
  9680. return {
  9681. cardboard: function() {
  9682. t.addClass("hidden"),
  9683. e.removeClass("hidden")
  9684. },
  9685. gearvr: function() {
  9686. e.addClass("hidden"),
  9687. t.removeClass("hidden")
  9688. }
  9689. }
  9690. }();
  9691. t.exports = K
  9692. }
  9693. , {
  9694. "../../constants": 8,
  9695. "../../enum/VRApps": 46,
  9696. "../../enum/VRPages": 48,
  9697. "../../enum/VRPlatforms": 49,
  9698. "../../localization/localize": 108,
  9699. "../../settings": 166,
  9700. "../../util/browser": 182,
  9701. "../../util/common": 185,
  9702. "./vrEvent": 85,
  9703. "./vrLink": 86,
  9704. events: 202
  9705. }],
  9706. 88: [function(e, t, i) {
  9707. "use strict";
  9708. t.exports = Object.freeze({
  9709. OPENED: "webvr.modal.opened",
  9710. SHOW_TERMS: "webvr.footer.show.terms"
  9711. })
  9712. }
  9713. , {}],
  9714. 89: [function(e, t, i) {
  9715. (function(i) {
  9716. "use strict";
  9717. function n(e, t, i, n) {
  9718. function r(e) {
  9719. e.preventDefault(),
  9720. a(e.currentTarget.id)
  9721. }
  9722. function a(e) {
  9723. ne[e](),
  9724. Object.keys(ne).map(function(t, i) {
  9725. $("#" + t).toggleClass("tabs-underlined", t === e)
  9726. })
  9727. }
  9728. y = i,
  9729. v = t,
  9730. w.init(E.Android, e, n),
  9731. m();
  9732. var l = new RegExp("daydream","i")
  9733. , c = l.test(y.displayName);
  9734. c ? (a("tabdaydream"),
  9735. B.filter(".device-headset-side").attr("src", H),
  9736. D.find(".title").text(x.localizeText("WEBVR_FOR_DAYDREAM"))) : (a("tabcardboard"),
  9737. B.filter(".device-headset-side").attr("src", Y),
  9738. D.find(".title").text(x.localizeText("WEBVR_FOR_CARDBOARD"))),
  9739. $("#vr").on("click", function(e) {
  9740. e.preventDefault(),
  9741. g("click_webvr_button"),
  9742. L.is(":hidden") && (ie.emit(_.OPENED),
  9743. o())
  9744. }),
  9745. $(".webvr-popup .close").on("click", function(e) {
  9746. e.preventDefault(),
  9747. D.hasClass("hidden") ? (g("webvr_help_close"),
  9748. p()) : s()
  9749. }),
  9750. $("#tabcardboard").on("click", r),
  9751. $("#tabdaydream").on("click", r),
  9752. $("#tabnative").on("click", r),
  9753. $(".webvr-popup .open-with-app").on("click", function(e) {
  9754. e.preventDefault(),
  9755. g("webvr_learn_more"),
  9756. a("tabnative"),
  9757. p()
  9758. }),
  9759. $(".webvr-popup .help").on("click", function(e) {
  9760. e.preventDefault(),
  9761. g(D.hasClass("hidden") ? "webvr_help_close" : "webvr_help_show"),
  9762. p()
  9763. }),
  9764. $(".webvr-popup .terms").on("click", function(e) {
  9765. e.preventDefault(),
  9766. g("webvr_click_terms"),
  9767. s(),
  9768. ie.emit(_.SHOW_TERMS)
  9769. }),
  9770. F.on("click", function(e) {
  9771. e.preventDefault(),
  9772. g(ee),
  9773. window.open(J, "_blank")
  9774. }),
  9775. V.on("click", function(e) {
  9776. e.preventDefault(),
  9777. g("webvr_phone_link"),
  9778. window.open(te, "_blank")
  9779. }),
  9780. $(".webvr-popup .badge-cardboard").on("click", function(e) {
  9781. e.preventDefault(),
  9782. g("webvr_cardboard_link"),
  9783. w.launch(b.CardboardAndroid)
  9784. }),
  9785. $(".webvr-popup .badge-oculus").on("click", function(e) {
  9786. e.preventDefault(),
  9787. g("webvr_oculus_link"),
  9788. w.launch(b.GearVR)
  9789. })
  9790. }
  9791. function r() {
  9792. function e() {
  9793. y.isPresenting || (f(),
  9794. window.removeEventListener("vrdisplaypresentchange", e))
  9795. }
  9796. R.info("Headset mounted"),
  9797. v.suspend();
  9798. var t = document.createElement("canvas");
  9799. for (t.getContext("webgl"),
  9800. t.className = "webvr-canvas",
  9801. document.bgColor = "#000",
  9802. document.body.style.backgroundColor = "#000"; document.body.firstChild; )
  9803. document.body.removeChild(document.body.firstChild);
  9804. document.body.appendChild(t),
  9805. g("webvr_enter_app"),
  9806. y.requestPresent([{
  9807. source: t,
  9808. predistorted: !0
  9809. }]).catch(function(t) {
  9810. R.error("Failed to present: " + t),
  9811. g("webvr_exit_calibrate"),
  9812. e()
  9813. }),
  9814. A.then(function() {
  9815. window.dispatchEvent(new Event("vrapp-start"))
  9816. }),
  9817. window.addEventListener("vrdisplaypresentchange", e)
  9818. }
  9819. function o() {
  9820. O.fadeOut(I.guiAnimationSpeed),
  9821. L.fadeIn(I.guiAnimationSpeed),
  9822. a()
  9823. }
  9824. function a() {
  9825. if (!A) {
  9826. var e = C.valueFromHash("webvr") || I.appConfig.webvr_version
  9827. , t = "https://static.port.com/webvr/" + e + "/js/main.js";
  9828. A = new Promise(function(e, i) {
  9829. var n = document.createElement("script");
  9830. n.type = "text/javascript",
  9831. n.src = t,
  9832. n.onload = e,
  9833. document.head.appendChild(n)
  9834. }
  9835. )
  9836. }
  9837. D.find(".enter-button").on("click", r)
  9838. }
  9839. function s() {
  9840. g("webvr_modal_close"),
  9841. D.find(".enter-button").off("click", r),
  9842. L.fadeOut(I.guiAnimationSpeed, function() {
  9843. D.toggleClass("hidden", !1),
  9844. N.toggleClass("hidden", !0),
  9845. C.exitFullscreen()
  9846. }),
  9847. O.fadeIn(I.guiAnimationSpeed)
  9848. }
  9849. function l() {
  9850. k.toggleClass("hidden", !1),
  9851. U.toggleClass("hidden", !0)
  9852. }
  9853. function c() {
  9854. k.toggleClass("hidden", !0),
  9855. U.toggleClass("hidden", !1)
  9856. }
  9857. function h() {
  9858. B.filter(".device-headset").attr("src", G),
  9859. B.filter(".device-phone").attr("src", z),
  9860. J = Z,
  9861. ee = K,
  9862. F.text(x.localizeText("WEBVR_DAYDREAM_VIEW")),
  9863. V.text(x.localizeText("VR_NEED_DAYDREAM_PHONE")),
  9864. $(".webvr-popup .detail.daydream-label").toggleClass("hidden", !1),
  9865. c()
  9866. }
  9867. function u() {
  9868. B.filter(".badge-cardboard").attr("src", j),
  9869. B.filter(".badge-oculus").attr("src", X),
  9870. l()
  9871. }
  9872. function d() {
  9873. B.filter(".device-headset").attr("src", Y),
  9874. B.filter(".device-phone").attr("src", W),
  9875. J = q,
  9876. ee = Q,
  9877. F.text(x.localizeText("VR_GOOGLE_CARDBOARD")),
  9878. V.text(x.localizeText("VR_COMPATIBLE_ANDROID_LONG")),
  9879. $(".webvr-popup .detail.daydream-label").toggleClass("hidden", !0),
  9880. c()
  9881. }
  9882. function p() {
  9883. D.toggleClass("hidden"),
  9884. N.toggleClass("hidden")
  9885. }
  9886. function f() {
  9887. R.info("exiting webVR"),
  9888. g("webvr_exit_app"),
  9889. window.location.search.indexOf("&qs=1") === -1 ? window.location = window.location + "&qs=1" : window.location = window.location
  9890. }
  9891. function g(e) {
  9892. var t = C.isLandscape() ? "landscape" : "portrait";
  9893. T.trackAlways("showcase_gui", {
  9894. gui_action: e,
  9895. orientation: t
  9896. })
  9897. }
  9898. function m() {
  9899. var e = C.isLandscape();
  9900. L.toggleClass("landscape", e).toggleClass("portrait", !e)
  9901. }
  9902. var v, A, y, C = e("../../util/browser"), I = e("../../settings"), E = (e("./../gui"),
  9903. e("../../enum/VRPlatforms")), b = e("../../enum/VRApps"), w = e("./../vr/vrLink"), _ = e("./WebVrEvent"), T = e("../../analytics"), x = (e("../../constants"),
  9904. 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 = {
  9905. init: n
  9906. }, ne = {
  9907. tabcardboard: d,
  9908. tabdaydream: h,
  9909. tabnative: u
  9910. };
  9911. S.extendObject(ie, P.prototype),
  9912. $(window).resize(m),
  9913. t.exports = ie
  9914. }
  9915. ).call(this, "/js/gui/webvr/webVRgui.js")
  9916. }
  9917. , {
  9918. "../../analytics": 4,
  9919. "../../constants": 8,
  9920. "../../enum/VRApps": 46,
  9921. "../../enum/VRPlatforms": 49,
  9922. "../../localization/localize": 108,
  9923. "../../settings": 166,
  9924. "../../util/browser": 182,
  9925. "../../util/common": 185,
  9926. "../../util/logger": 189,
  9927. "./../gui": 65,
  9928. "./../vr/vrLink": 86,
  9929. "./WebVrEvent": 88,
  9930. events: 202
  9931. }],
  9932. 90: [function(e, t, i) {
  9933. "use strict";
  9934. function n(e, t, i, n, o) {
  9935. n || 0 === n ? this.floorId = n : this.floorId = -1,
  9936. this.roomId = o || "",
  9937. this.labelId = e,
  9938. this.position = (new r.Vector3).copy(t),
  9939. this.text = i
  9940. }
  9941. var r = e("three")
  9942. , o = e("../util/browser");
  9943. n.prototype.build = function() {
  9944. var e = window.document.createElement("div");
  9945. o.isMobile() ? e.setAttribute("class", "gui-floorplan-label gui-floorplan-label-mobile") : e.setAttribute("class", "gui-floorplan-label");
  9946. var t = window.document.createElement("div");
  9947. t.setAttribute("class", "gui-floorplan-label-text");
  9948. var i = window.document.createTextNode(this.text);
  9949. t.appendChild(i),
  9950. e.appendChild(t),
  9951. window.document.body.appendChild(e),
  9952. this.labelGui = e,
  9953. this.textBlock = t,
  9954. $(this.labelGui).hide();
  9955. var n = window.getComputedStyle(this.labelGui);
  9956. this.initialTransform = n.transform || n.webkitTransform
  9957. }
  9958. ,
  9959. t.exports = n
  9960. }
  9961. , {
  9962. "../util/browser": 182,
  9963. three: 217
  9964. }],
  9965. 91: [function(e, t, i) {
  9966. "use strict";
  9967. function n() {
  9968. this.player = null,
  9969. this.modelManager = null,
  9970. this.container = null
  9971. }
  9972. var r = e("three")
  9973. , o = (e("../util/common"),
  9974. e("../enum/PlayerEvents"))
  9975. , a = (e("../enum/DirectorEvents"),
  9976. e("../enum/ModelManagerEvents"))
  9977. , s = e("../settings")
  9978. , l = e("../enum/Viewmode")
  9979. , c = (e("../enum/WarpStyle"),
  9980. e("../util/transitions"),
  9981. e("../util/lerp"),
  9982. e("../util/browser"));
  9983. //场景初始化
  9984. n.prototype.init = function(e, t, i) {
  9985. this.player = e,
  9986. this.modelManager = t,
  9987. this.container = i,
  9988. this.updateModel(),
  9989. this.bindEvents()
  9990. }
  9991. ,
  9992. n.prototype.bindEvents = function() {
  9993. this.modelManager.on(a.ActiveModelChanged, this.updateModel.bind(this)),
  9994. this.player.on(o.ViewChanged, this.handlePlayerViewChanged.bind(this)),
  9995. this.player.on(o.ModeChanged, this.handlePlayerViewChanged.bind(this)),
  9996. this.player.on(o.StartInside, this.handleStartInside.bind(this)),
  9997. this.player.on(o.StartOutside, this.handleStartOutside.bind(this))
  9998. }
  9999. ,
  10000. n.prototype.updateModel = function() {
  10001. this.model = this.modelManager.getActiveModel()
  10002. }
  10003. ,
  10004. n.prototype.handlePlayerViewChanged = function() {
  10005. this.updateLabelVisibility(),
  10006. this.updateLabelDisplay()
  10007. }
  10008. ,
  10009. n.prototype.getLabelsForFloor = function(e, t) {
  10010. return t = t || [],
  10011. t.length = 0,
  10012. this.model.labels.forEach(function(i) {
  10013. this.labelVisibleForFloor(i, e) && t.push(i)
  10014. }
  10015. .bind(this)),
  10016. t
  10017. }
  10018. ,
  10019. n.prototype.getLabelsForCurrentFloor = function(e) {
  10020. return this.getLabelsForFloor(this.model.currentFloor.floorIndex, e)
  10021. }
  10022. ,
  10023. n.prototype.labelVisibleForFloor = function(e, t) {
  10024. var i = c.isMobile() && this.player.getLabelScaleFactor() < s.labels.zoomHideThreshhold.mobile || !c.isMobile() && this.player.getLabelScaleFactor() < s.labels.zoomHideThreshhold.desktop;
  10025. if (!this.model.showingLabels || !e.labelGui || !i)
  10026. return !1;
  10027. var n = e.floorId === this.model.floors.size() - 1;
  10028. return this.model.allFloorsVisible ? n : e.floorId === t
  10029. }
  10030. ,
  10031. n.prototype.updateLabelVisibility = function(e) {
  10032. this.model.labels.forEach(function(e) {
  10033. 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)
  10034. }
  10035. .bind(this))
  10036. }
  10037. ,
  10038. n.prototype.showAllLabels = function(e, t) {
  10039. this.model.labels.forEach(function(i) {
  10040. this.showLabel(i, e, t)
  10041. }
  10042. .bind(this))
  10043. }
  10044. ,
  10045. n.prototype.hideAllLabels = function(e, t) {
  10046. this.model.labels.forEach(function(i) {
  10047. this.hideLabel(i, e, t)
  10048. }
  10049. .bind(this))
  10050. }
  10051. ,
  10052. n.prototype.showLabel = function(e, t, i) {
  10053. this.model.showingLabels && (e.visible || (e.visible = !0,
  10054. e.labelGui.style.display = "block",
  10055. e.labelGui.style.opacity = 0,
  10056. $(e.labelGui).delay(t).fadeTo(i, 1)))
  10057. }
  10058. ,
  10059. n.prototype.hideLabel = function(e, t, i) {
  10060. e.visible && (e.visible = !1,
  10061. c.isMobile() ? $(e.labelGui).hide() : $(e.labelGui).delay(t).fadeOut(i))
  10062. }
  10063. ,
  10064. n.prototype.supportedMode = function() {
  10065. return this.player.mode === l.FLOORPLAN
  10066. }
  10067. ,
  10068. n.prototype.updateLabelDisplay = function() {
  10069. var e = (new r.Vector3,
  10070. new r.Vector3,
  10071. []);
  10072. return function() {
  10073. var t = this.player.getLabelScaleFactor()
  10074. , i = .6
  10075. , n = 1.2
  10076. , r = (1 - t) * n + i
  10077. , o = c.isMobile() ? s.labels.zoomTruncateThreshhold.mobile : s.labels.zoomTruncateThreshhold.desktop;
  10078. this.getLabelsForCurrentFloor(e);
  10079. for (var a = 0; a < e.length; a++) {
  10080. var l = e[a];
  10081. this.supportedMode() && l.labelGui && (this.updateProjectedGuiElement(l.labelGui, l.textBlock, l.position, r, r),
  10082. 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)
  10083. }
  10084. }
  10085. }(),
  10086. n.prototype.updateProjectedGuiElement = function() {
  10087. var e = new r.Vector3;
  10088. new r.Vector3;
  10089. return function(t, i, n, r, o) {
  10090. i.style.fontSize = 100 * o + "%";
  10091. var a = $("#player").width()
  10092. , s = $("#player").height()
  10093. , l = .5 * a
  10094. , c = .5 * s;
  10095. e.copy(n),
  10096. e.project(this.player.camera);
  10097. var h = e.x * l + l
  10098. , u = -(e.y * c) + c;
  10099. h -= t.offsetWidth / 2,
  10100. u -= t.offsetHeight / 2,
  10101. t.style.left = h + "px",
  10102. t.style.top = u + "px"
  10103. }
  10104. }(),
  10105. n.prototype.handleStartInside = function(e) {
  10106. this.updateLabelVisibility()
  10107. }
  10108. ,
  10109. n.prototype.handleStartOutside = function() {
  10110. this.updateLabelVisibility()
  10111. }
  10112. ,
  10113. t.exports = n
  10114. }
  10115. , {
  10116. "../enum/DirectorEvents": 23,
  10117. "../enum/ModelManagerEvents": 33,
  10118. "../enum/PlayerEvents": 40,
  10119. "../enum/Viewmode": 51,
  10120. "../enum/WarpStyle": 52,
  10121. "../settings": 166,
  10122. "../util/browser": 182,
  10123. "../util/common": 185,
  10124. "../util/lerp": 188,
  10125. "../util/transitions": 195,
  10126. three: 217
  10127. }],
  10128. 92: [function(e, t, i) {
  10129. "use strict";
  10130. Array.prototype.findIndex || (Array.prototype.findIndex = function(e) {
  10131. if (null == this)
  10132. throw new TypeError("Array.prototype.findIndex called on null or undefined");
  10133. if ("function" != typeof e)
  10134. throw new TypeError("predicate must be a function");
  10135. for (var t, i = Object(this), n = i.length >>> 0, r = arguments[1], o = 0; o < n; o++)
  10136. if (t = i[o],
  10137. e.call(r, t, o, i))
  10138. return o;
  10139. return -1
  10140. }
  10141. ),
  10142. Array.prototype.find || Object.defineProperty(Array.prototype, "find", {
  10143. value: function(e) {
  10144. if (null == this)
  10145. throw new TypeError('"this" is null or not defined');
  10146. var t = Object(this)
  10147. , i = t.length >>> 0;
  10148. if ("function" != typeof e)
  10149. throw new TypeError("predicate must be a function");
  10150. for (var n = arguments[1], r = 0; r < i; ) {
  10151. var o = t[r];
  10152. if (e.call(n, o, r, t))
  10153. return o;
  10154. r++
  10155. }
  10156. }
  10157. })
  10158. }
  10159. , {}],
  10160. 93: [function(e, t, i) {
  10161. "use strict";
  10162. var n = n || {};
  10163. t.exports = n,
  10164. n.gui = n.gui || {},
  10165. n.utils = n.utils || {},
  10166. n.controllers = n.controllers || {},
  10167. n.dom = n.dom || {},
  10168. n.color = n.color || {},
  10169. n.utils.css = function() {
  10170. return {
  10171. load: function(e, t) {
  10172. t = t || document;
  10173. var i = t.createElement("link");
  10174. i.type = "text/css",
  10175. i.rel = "stylesheet",
  10176. i.href = e,
  10177. t.getElementsByTagName("head")[0].appendChild(i)
  10178. },
  10179. inject: function(e, t) {
  10180. t = t || document;
  10181. var i = document.createElement("style");
  10182. i.type = "text/css",
  10183. i.innerHTML = e,
  10184. t.getElementsByTagName("head")[0].appendChild(i)
  10185. }
  10186. }
  10187. }(),
  10188. n.utils.common = function() {
  10189. var e = Array.prototype.forEach
  10190. , t = Array.prototype.slice;
  10191. return {
  10192. BREAK: {},
  10193. extend: function(e) {
  10194. return this.each(t.call(arguments, 1), function(t) {
  10195. for (var i in t)
  10196. this.isUndefined(t[i]) || (e[i] = t[i])
  10197. }, this),
  10198. e
  10199. },
  10200. defaults: function(e) {
  10201. return this.each(t.call(arguments, 1), function(t) {
  10202. for (var i in t)
  10203. this.isUndefined(e[i]) && (e[i] = t[i])
  10204. }, this),
  10205. e
  10206. },
  10207. compose: function() {
  10208. var e = t.call(arguments);
  10209. return function() {
  10210. for (var i = t.call(arguments), n = e.length - 1; n >= 0; n--)
  10211. i = [e[n].apply(this, i)];
  10212. return i[0]
  10213. }
  10214. },
  10215. each: function(t, i, n) {
  10216. if (t)
  10217. if (e && t.forEach && t.forEach === e)
  10218. t.forEach(i, n);
  10219. else if (t.length === t.length + 0) {
  10220. for (var r = 0, o = t.length; r < o; r++)
  10221. if (r in t && i.call(n, t[r], r) === this.BREAK)
  10222. return
  10223. } else
  10224. for (var r in t)
  10225. if (i.call(n, t[r], r) === this.BREAK)
  10226. return
  10227. },
  10228. defer: function(e) {
  10229. setTimeout(e, 0)
  10230. },
  10231. toArray: function(e) {
  10232. return e.toArray ? e.toArray() : t.call(e)
  10233. },
  10234. isUndefined: function(e) {
  10235. return void 0 === e
  10236. },
  10237. isNull: function(e) {
  10238. return null === e
  10239. },
  10240. isNaN: function(e) {
  10241. return e !== e
  10242. },
  10243. isArray: Array.isArray || function(e) {
  10244. return e.constructor === Array
  10245. }
  10246. ,
  10247. isObject: function(e) {
  10248. return e === Object(e)
  10249. },
  10250. isNumber: function(e) {
  10251. return e === e + 0
  10252. },
  10253. isString: function(e) {
  10254. return e === e + ""
  10255. },
  10256. isBoolean: function(e) {
  10257. return e === !1 || e === !0
  10258. },
  10259. isFunction: function(e) {
  10260. return "[object Function]" === Object.prototype.toString.call(e)
  10261. }
  10262. }
  10263. }(),
  10264. n.controllers.Controller = function(e) {
  10265. var t = function(e, t) {
  10266. this.initialValue = e[t],
  10267. this.domElement = document.createElement("div"),
  10268. this.object = e,
  10269. this.property = t,
  10270. this.__onChange = void 0,
  10271. this.__onFinishChange = void 0
  10272. };
  10273. return e.extend(t.prototype, {
  10274. onChange: function(e) {
  10275. return this.__onChange = e,
  10276. this
  10277. },
  10278. onFinishChange: function(e) {
  10279. return this.__onFinishChange = e,
  10280. this
  10281. },
  10282. setValue: function(e) {
  10283. return this.object[this.property] = e,
  10284. this.__onChange && this.__onChange.call(this, e),
  10285. this.updateDisplay(),
  10286. this
  10287. },
  10288. getValue: function() {
  10289. return this.object[this.property]
  10290. },
  10291. updateDisplay: function() {
  10292. return this
  10293. },
  10294. isModified: function() {
  10295. return this.initialValue !== this.getValue()
  10296. }
  10297. }),
  10298. t
  10299. }(n.utils.common),
  10300. n.dom.dom = function(e) {
  10301. function t(t) {
  10302. if ("0" === t || e.isUndefined(t))
  10303. return 0;
  10304. var i = t.match(r);
  10305. return e.isNull(i) ? 0 : parseFloat(i[1])
  10306. }
  10307. var i = {
  10308. HTMLEvents: ["change"],
  10309. MouseEvents: ["click", "mousemove", "mousedown", "mouseup", "mouseover"],
  10310. KeyboardEvents: ["keydown"]
  10311. }
  10312. , n = {};
  10313. e.each(i, function(t, i) {
  10314. e.each(t, function(e) {
  10315. n[e] = i
  10316. })
  10317. });
  10318. var r = /(\d+(\.\d+)?)px/
  10319. , o = {
  10320. makeSelectable: function(e, t) {
  10321. void 0 !== e && void 0 !== e.style && (e.onselectstart = t ? function() {
  10322. return !1
  10323. }
  10324. : function() {}
  10325. ,
  10326. e.style.MozUserSelect = t ? "auto" : "none",
  10327. e.style.KhtmlUserSelect = t ? "auto" : "none",
  10328. e.unselectable = t ? "on" : "off")
  10329. },
  10330. makeFullscreen: function(t, i, n) {
  10331. e.isUndefined(i) && (i = !0),
  10332. e.isUndefined(n) && (n = !0),
  10333. t.style.position = "absolute",
  10334. i && (t.style.left = 0,
  10335. t.style.right = 0),
  10336. n && (t.style.top = 0,
  10337. t.style.bottom = 0)
  10338. },
  10339. fakeEvent: function(t, i, r, o) {
  10340. r = r || {};
  10341. var a = n[i];
  10342. if (!a)
  10343. throw new Error("Event type " + i + " not supported.");
  10344. var s = document.createEvent(a);
  10345. switch (a) {
  10346. case "MouseEvents":
  10347. var l = r.x || r.clientX || 0
  10348. , c = r.y || r.clientY || 0;
  10349. s.initMouseEvent(i, r.bubbles || !1, r.cancelable || !0, window, r.clickCount || 1, 0, 0, l, c, !1, !1, !1, !1, 0, null);
  10350. break;
  10351. case "KeyboardEvents":
  10352. var h = s.initKeyboardEvent || s.initKeyEvent;
  10353. e.defaults(r, {
  10354. cancelable: !0,
  10355. ctrlKey: !1,
  10356. altKey: !1,
  10357. shiftKey: !1,
  10358. metaKey: !1,
  10359. keyCode: void 0,
  10360. charCode: void 0
  10361. }),
  10362. h(i, r.bubbles || !1, r.cancelable, window, r.ctrlKey, r.altKey, r.shiftKey, r.metaKey, r.keyCode, r.charCode);
  10363. break;
  10364. default:
  10365. s.initEvent(i, r.bubbles || !1, r.cancelable || !0)
  10366. }
  10367. e.defaults(s, o),
  10368. t.dispatchEvent(s)
  10369. },
  10370. bind: function(e, t, i, n) {
  10371. return n = n || !1,
  10372. e.addEventListener ? e.addEventListener(t, i, n) : e.attachEvent && e.attachEvent("on" + t, i),
  10373. o
  10374. },
  10375. unbind: function(e, t, i, n) {
  10376. return n = n || !1,
  10377. e.removeEventListener ? e.removeEventListener(t, i, n) : e.detachEvent && e.detachEvent("on" + t, i),
  10378. o
  10379. },
  10380. addClass: function(e, t) {
  10381. if (void 0 === e.className)
  10382. e.className = t;
  10383. else if (e.className !== t) {
  10384. var i = e.className.split(/ +/);
  10385. i.indexOf(t) == -1 && (i.push(t),
  10386. e.className = i.join(" ").replace(/^\s+/, "").replace(/\s+$/, ""))
  10387. }
  10388. return o
  10389. },
  10390. removeClass: function(e, t) {
  10391. if (t)
  10392. if (void 0 === e.className)
  10393. ;
  10394. else if (e.className === t)
  10395. e.removeAttribute("class");
  10396. else {
  10397. var i = e.className.split(/ +/)
  10398. , n = i.indexOf(t);
  10399. n != -1 && (i.splice(n, 1),
  10400. e.className = i.join(" "))
  10401. }
  10402. else
  10403. e.className = void 0;
  10404. return o
  10405. },
  10406. hasClass: function(e, t) {
  10407. return new RegExp("(?:^|\\s+)" + t + "(?:\\s+|$)").test(e.className) || !1
  10408. },
  10409. getWidth: function(e) {
  10410. var i = getComputedStyle(e);
  10411. return t(i["border-left-width"]) + t(i["border-right-width"]) + t(i["padding-left"]) + t(i["padding-right"]) + t(i.width)
  10412. },
  10413. getHeight: function(e) {
  10414. var i = getComputedStyle(e);
  10415. return t(i["border-top-width"]) + t(i["border-bottom-width"]) + t(i["padding-top"]) + t(i["padding-bottom"]) + t(i.height)
  10416. },
  10417. getOffset: function(e) {
  10418. var t = {
  10419. left: 0,
  10420. top: 0
  10421. };
  10422. if (e.offsetParent)
  10423. do
  10424. t.left += e.offsetLeft,
  10425. t.top += e.offsetTop;
  10426. while (e = e.offsetParent);return t
  10427. },
  10428. isActive: function(e) {
  10429. return e === document.activeElement && (e.type || e.href)
  10430. }
  10431. };
  10432. return o
  10433. }(n.utils.common),
  10434. n.controllers.OptionController = function(e, t, i) {
  10435. var n = function(e, r, o) {
  10436. n.superclass.call(this, e, r);
  10437. var a = this;
  10438. if (this.__select = document.createElement("select"),
  10439. i.isArray(o)) {
  10440. var s = {};
  10441. i.each(o, function(e) {
  10442. s[e] = e
  10443. }),
  10444. o = s
  10445. }
  10446. i.each(o, function(e, t) {
  10447. var i = document.createElement("option");
  10448. i.innerHTML = t,
  10449. i.setAttribute("value", e),
  10450. a.__select.appendChild(i)
  10451. }),
  10452. this.updateDisplay(),
  10453. t.bind(this.__select, "change", function() {
  10454. var e = this.options[this.selectedIndex].value;
  10455. a.setValue(e)
  10456. }),
  10457. this.domElement.appendChild(this.__select)
  10458. };
  10459. return n.superclass = e,
  10460. i.extend(n.prototype, e.prototype, {
  10461. setValue: function(e) {
  10462. var t = n.superclass.prototype.setValue.call(this, e);
  10463. return this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  10464. t
  10465. },
  10466. updateDisplay: function() {
  10467. return this.__select.value = this.getValue(),
  10468. n.superclass.prototype.updateDisplay.call(this)
  10469. }
  10470. }),
  10471. n
  10472. }(n.controllers.Controller, n.dom.dom, n.utils.common),
  10473. n.controllers.NumberController = function(e, t) {
  10474. function i(e) {
  10475. return e = e.toString(),
  10476. e.indexOf(".") > -1 ? e.length - e.indexOf(".") - 1 : 0
  10477. }
  10478. var n = function(e, r, o) {
  10479. n.superclass.call(this, e, r),
  10480. o = o || {},
  10481. this.__min = o.min,
  10482. this.__max = o.max,
  10483. this.__step = o.step,
  10484. 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,
  10485. this.__precision = i(this.__impliedStep)
  10486. };
  10487. return n.superclass = e,
  10488. t.extend(n.prototype, e.prototype, {
  10489. setValue: function(e) {
  10490. return void 0 !== this.__min && e < this.__min ? e = this.__min : void 0 !== this.__max && e > this.__max && (e = this.__max),
  10491. void 0 !== this.__step && e % this.__step != 0 && (e = Math.round(e / this.__step) * this.__step),
  10492. n.superclass.prototype.setValue.call(this, e)
  10493. },
  10494. min: function(e) {
  10495. return this.__min = e,
  10496. this
  10497. },
  10498. max: function(e) {
  10499. return this.__max = e,
  10500. this
  10501. },
  10502. step: function(e) {
  10503. return this.__step = e,
  10504. this.__impliedStep = e,
  10505. this.__precision = i(e),
  10506. this
  10507. }
  10508. }),
  10509. n
  10510. }(n.controllers.Controller, n.utils.common),
  10511. n.controllers.NumberControllerBox = function(e, t, i) {
  10512. function n(e, t) {
  10513. var i = Math.pow(10, t);
  10514. return Math.round(e * i) / i
  10515. }
  10516. var r = function(e, n, o) {
  10517. function a() {
  10518. var e = parseFloat(d.__input.value);
  10519. i.isNaN(e) || d.setValue(e)
  10520. }
  10521. function s() {
  10522. a(),
  10523. d.__onFinishChange && d.__onFinishChange.call(d, d.getValue())
  10524. }
  10525. function l(e) {
  10526. t.bind(window, "mousemove", c),
  10527. t.bind(window, "mouseup", h),
  10528. u = e.clientY
  10529. }
  10530. function c(e) {
  10531. var t = u - e.clientY;
  10532. d.setValue(d.getValue() + t * d.__impliedStep),
  10533. u = e.clientY
  10534. }
  10535. function h() {
  10536. t.unbind(window, "mousemove", c),
  10537. t.unbind(window, "mouseup", h)
  10538. }
  10539. this.__truncationSuspended = !1,
  10540. r.superclass.call(this, e, n, o);
  10541. var u, d = this;
  10542. this.__input = document.createElement("input"),
  10543. this.__input.setAttribute("type", "text"),
  10544. t.bind(this.__input, "change", a),
  10545. t.bind(this.__input, "blur", s),
  10546. t.bind(this.__input, "mousedown", l),
  10547. t.bind(this.__input, "keydown", function(e) {
  10548. 13 === e.keyCode && (d.__truncationSuspended = !0,
  10549. this.blur(),
  10550. d.__truncationSuspended = !1)
  10551. }),
  10552. this.updateDisplay(),
  10553. this.domElement.appendChild(this.__input)
  10554. };
  10555. return r.superclass = e,
  10556. i.extend(r.prototype, e.prototype, {
  10557. updateDisplay: function() {
  10558. return this.__input.value = this.__truncationSuspended ? this.getValue() : n(this.getValue(), this.__precision),
  10559. r.superclass.prototype.updateDisplay.call(this)
  10560. }
  10561. }),
  10562. r
  10563. }(n.controllers.NumberController, n.dom.dom, n.utils.common),
  10564. n.controllers.NumberControllerSlider = function(e, t, i, n, r) {
  10565. function o(e, t, i, n, r) {
  10566. return n + (r - n) * ((e - t) / (i - t))
  10567. }
  10568. var a = function(e, i, n, r, s) {
  10569. function l(e) {
  10570. t.bind(window, "mousemove", c),
  10571. t.bind(window, "mouseup", h),
  10572. c(e)
  10573. }
  10574. function c(e) {
  10575. e.preventDefault();
  10576. var i = t.getOffset(u.__background)
  10577. , n = t.getWidth(u.__background);
  10578. return u.setValue(o(e.clientX, i.left, i.left + n, u.__min, u.__max)),
  10579. !1
  10580. }
  10581. function h() {
  10582. t.unbind(window, "mousemove", c),
  10583. t.unbind(window, "mouseup", h),
  10584. u.__onFinishChange && u.__onFinishChange.call(u, u.getValue())
  10585. }
  10586. a.superclass.call(this, e, i, {
  10587. min: n,
  10588. max: r,
  10589. step: s
  10590. });
  10591. var u = this;
  10592. this.__background = document.createElement("div"),
  10593. this.__foreground = document.createElement("div"),
  10594. t.bind(this.__background, "mousedown", l),
  10595. t.addClass(this.__background, "slider"),
  10596. t.addClass(this.__foreground, "slider-fg"),
  10597. this.updateDisplay(),
  10598. this.__background.appendChild(this.__foreground),
  10599. this.domElement.appendChild(this.__background)
  10600. };
  10601. return a.superclass = e,
  10602. a.useDefaultStyles = function() {
  10603. i.inject(r)
  10604. }
  10605. ,
  10606. n.extend(a.prototype, e.prototype, {
  10607. updateDisplay: function() {
  10608. var e = (this.getValue() - this.__min) / (this.__max - this.__min);
  10609. return this.__foreground.style.width = 100 * e + "%",
  10610. a.superclass.prototype.updateDisplay.call(this)
  10611. }
  10612. }),
  10613. a
  10614. }(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}"),
  10615. n.controllers.FunctionController = function(e, t, i) {
  10616. var n = function(e, i, r) {
  10617. n.superclass.call(this, e, i);
  10618. var o = this;
  10619. this.__button = document.createElement("div"),
  10620. this.__button.innerHTML = void 0 === r ? "Fire" : r,
  10621. t.bind(this.__button, "click", function(e) {
  10622. return e.preventDefault(),
  10623. o.fire(),
  10624. !1
  10625. }),
  10626. t.addClass(this.__button, "button"),
  10627. this.domElement.appendChild(this.__button)
  10628. };
  10629. return n.superclass = e,
  10630. i.extend(n.prototype, e.prototype, {
  10631. fire: function() {
  10632. this.__onChange && this.__onChange.call(this),
  10633. this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  10634. this.getValue().call(this.object)
  10635. }
  10636. }),
  10637. n
  10638. }(n.controllers.Controller, n.dom.dom, n.utils.common),
  10639. n.controllers.BooleanController = function(e, t, i) {
  10640. var n = function(e, i) {
  10641. function r() {
  10642. o.setValue(!o.__prev)
  10643. }
  10644. n.superclass.call(this, e, i);
  10645. var o = this;
  10646. this.__prev = this.getValue(),
  10647. this.__checkbox = document.createElement("input"),
  10648. this.__checkbox.setAttribute("type", "checkbox"),
  10649. t.bind(this.__checkbox, "change", r, !1),
  10650. this.domElement.appendChild(this.__checkbox),
  10651. this.updateDisplay()
  10652. };
  10653. return n.superclass = e,
  10654. i.extend(n.prototype, e.prototype, {
  10655. setValue: function(e) {
  10656. var t = n.superclass.prototype.setValue.call(this, e);
  10657. return this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  10658. this.__prev = this.getValue(),
  10659. t
  10660. },
  10661. updateDisplay: function() {
  10662. return this.getValue() === !0 ? (this.__checkbox.setAttribute("checked", "checked"),
  10663. this.__checkbox.checked = !0) : this.__checkbox.checked = !1,
  10664. n.superclass.prototype.updateDisplay.call(this)
  10665. }
  10666. }),
  10667. n
  10668. }(n.controllers.Controller, n.dom.dom, n.utils.common),
  10669. n.color.toString = function(e) {
  10670. return function(t) {
  10671. if (1 == t.a || e.isUndefined(t.a)) {
  10672. for (var i = t.hex.toString(16); i.length < 6; )
  10673. i = "0" + i;
  10674. return "#" + i
  10675. }
  10676. return "rgba(" + Math.round(t.r) + "," + Math.round(t.g) + "," + Math.round(t.b) + "," + t.a + ")"
  10677. }
  10678. }(n.utils.common),
  10679. n.color.interpret = function(e, t) {
  10680. var i, n, r = function() {
  10681. n = !1;
  10682. var e = arguments.length > 1 ? t.toArray(arguments) : arguments[0];
  10683. return t.each(o, function(r) {
  10684. if (r.litmus(e))
  10685. return t.each(r.conversions, function(r, o) {
  10686. if (i = r.read(e),
  10687. n === !1 && i !== !1)
  10688. return n = i,
  10689. i.conversionName = o,
  10690. i.conversion = r,
  10691. t.BREAK
  10692. }),
  10693. t.BREAK
  10694. }),
  10695. n
  10696. }, o = [{
  10697. litmus: t.isString,
  10698. conversions: {
  10699. THREE_CHAR_HEX: {
  10700. read: function(e) {
  10701. var t = e.match(/^#([A-F0-9])([A-F0-9])([A-F0-9])$/i);
  10702. return null !== t && {
  10703. space: "HEX",
  10704. hex: parseInt("0x" + t[1].toString() + t[1].toString() + t[2].toString() + t[2].toString() + t[3].toString() + t[3].toString())
  10705. }
  10706. },
  10707. write: e
  10708. },
  10709. SIX_CHAR_HEX: {
  10710. read: function(e) {
  10711. var t = e.match(/^#([A-F0-9]{6})$/i);
  10712. return null !== t && {
  10713. space: "HEX",
  10714. hex: parseInt("0x" + t[1].toString())
  10715. }
  10716. },
  10717. write: e
  10718. },
  10719. CSS_RGB: {
  10720. read: function(e) {
  10721. var t = e.match(/^rgb\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\)/);
  10722. return null !== t && {
  10723. space: "RGB",
  10724. r: parseFloat(t[1]),
  10725. g: parseFloat(t[2]),
  10726. b: parseFloat(t[3])
  10727. }
  10728. },
  10729. write: e
  10730. },
  10731. CSS_RGBA: {
  10732. read: function(e) {
  10733. var t = e.match(/^rgba\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\,\s*(.+)\s*\)/);
  10734. return null !== t && {
  10735. space: "RGB",
  10736. r: parseFloat(t[1]),
  10737. g: parseFloat(t[2]),
  10738. b: parseFloat(t[3]),
  10739. a: parseFloat(t[4])
  10740. }
  10741. },
  10742. write: e
  10743. }
  10744. }
  10745. }, {
  10746. litmus: t.isNumber,
  10747. conversions: {
  10748. HEX: {
  10749. read: function(e) {
  10750. return {
  10751. space: "HEX",
  10752. hex: e,
  10753. conversionName: "HEX"
  10754. }
  10755. },
  10756. write: function(e) {
  10757. return e.hex
  10758. }
  10759. }
  10760. }
  10761. }, {
  10762. litmus: t.isArray,
  10763. conversions: {
  10764. RGB_ARRAY: {
  10765. read: function(e) {
  10766. return 3 == e.length && {
  10767. space: "RGB",
  10768. r: e[0],
  10769. g: e[1],
  10770. b: e[2]
  10771. }
  10772. },
  10773. write: function(e) {
  10774. return [e.r, e.g, e.b]
  10775. }
  10776. },
  10777. RGBA_ARRAY: {
  10778. read: function(e) {
  10779. return 4 == e.length && {
  10780. space: "RGB",
  10781. r: e[0],
  10782. g: e[1],
  10783. b: e[2],
  10784. a: e[3]
  10785. }
  10786. },
  10787. write: function(e) {
  10788. return [e.r, e.g, e.b, e.a]
  10789. }
  10790. }
  10791. }
  10792. }, {
  10793. litmus: t.isObject,
  10794. conversions: {
  10795. RGBA_OBJ: {
  10796. read: function(e) {
  10797. return !!(t.isNumber(e.r) && t.isNumber(e.g) && t.isNumber(e.b) && t.isNumber(e.a)) && {
  10798. space: "RGB",
  10799. r: e.r,
  10800. g: e.g,
  10801. b: e.b,
  10802. a: e.a
  10803. }
  10804. },
  10805. write: function(e) {
  10806. return {
  10807. r: e.r,
  10808. g: e.g,
  10809. b: e.b,
  10810. a: e.a
  10811. }
  10812. }
  10813. },
  10814. RGB_OBJ: {
  10815. read: function(e) {
  10816. return !!(t.isNumber(e.r) && t.isNumber(e.g) && t.isNumber(e.b)) && {
  10817. space: "RGB",
  10818. r: e.r,
  10819. g: e.g,
  10820. b: e.b
  10821. }
  10822. },
  10823. write: function(e) {
  10824. return {
  10825. r: e.r,
  10826. g: e.g,
  10827. b: e.b
  10828. }
  10829. }
  10830. },
  10831. HSVA_OBJ: {
  10832. read: function(e) {
  10833. return !!(t.isNumber(e.h) && t.isNumber(e.s) && t.isNumber(e.v) && t.isNumber(e.a)) && {
  10834. space: "HSV",
  10835. h: e.h,
  10836. s: e.s,
  10837. v: e.v,
  10838. a: e.a
  10839. }
  10840. },
  10841. write: function(e) {
  10842. return {
  10843. h: e.h,
  10844. s: e.s,
  10845. v: e.v,
  10846. a: e.a
  10847. }
  10848. }
  10849. },
  10850. HSV_OBJ: {
  10851. read: function(e) {
  10852. return !!(t.isNumber(e.h) && t.isNumber(e.s) && t.isNumber(e.v)) && {
  10853. space: "HSV",
  10854. h: e.h,
  10855. s: e.s,
  10856. v: e.v
  10857. }
  10858. },
  10859. write: function(e) {
  10860. return {
  10861. h: e.h,
  10862. s: e.s,
  10863. v: e.v
  10864. }
  10865. }
  10866. }
  10867. }
  10868. }];
  10869. return r
  10870. }(n.color.toString, n.utils.common),
  10871. n.GUI = n.gui.GUI = function(e, t, i, n, r, o, a, s, l, c, h, u, d, p, f) {
  10872. function g(e, t, i, o) {
  10873. if (void 0 === t[i])
  10874. throw new Error("Object " + t + ' has no property "' + i + '"');
  10875. var a;
  10876. if (o.color)
  10877. a = new h(t,i);
  10878. else {
  10879. var s = [t, i].concat(o.factoryArgs);
  10880. a = n.apply(e, s)
  10881. }
  10882. o.before instanceof r && (o.before = o.before.__li),
  10883. A(e, a),
  10884. p.addClass(a.domElement, "c");
  10885. var l = document.createElement("span");
  10886. p.addClass(l, "property-name"),
  10887. l.innerHTML = a.property;
  10888. var c = document.createElement("div");
  10889. c.appendChild(l),
  10890. c.appendChild(a.domElement);
  10891. var u = m(e, c, o.before);
  10892. return p.addClass(u, V.CLASS_CONTROLLER_ROW),
  10893. p.addClass(u, typeof a.getValue()),
  10894. v(e, u, a),
  10895. e.__controllers.push(a),
  10896. a
  10897. }
  10898. function m(e, t, i) {
  10899. var n = document.createElement("li");
  10900. return t && n.appendChild(t),
  10901. i ? e.__ul.insertBefore(n, params.before) : e.__ul.appendChild(n),
  10902. e.onResize(),
  10903. n
  10904. }
  10905. function v(e, t, i) {
  10906. if (i.__li = t,
  10907. i.__gui = e,
  10908. f.extend(i, {
  10909. options: function(t) {
  10910. return arguments.length > 1 ? (i.remove(),
  10911. g(e, i.object, i.property, {
  10912. before: i.__li.nextElementSibling,
  10913. factoryArgs: [f.toArray(arguments)]
  10914. })) : f.isArray(t) || f.isObject(t) ? (i.remove(),
  10915. g(e, i.object, i.property, {
  10916. before: i.__li.nextElementSibling,
  10917. factoryArgs: [t]
  10918. })) : void 0
  10919. },
  10920. name: function(e) {
  10921. return i.__li.firstElementChild.firstElementChild.innerHTML = e,
  10922. i
  10923. },
  10924. listen: function() {
  10925. return i.__gui.listen(i),
  10926. i
  10927. },
  10928. remove: function() {
  10929. return i.__gui.remove(i),
  10930. i
  10931. }
  10932. }),
  10933. i instanceof l) {
  10934. var n = new s(i.object,i.property,{
  10935. min: i.__min,
  10936. max: i.__max,
  10937. step: i.__step
  10938. });
  10939. f.each(["updateDisplay", "onChange", "onFinishChange"], function(e) {
  10940. var t = i[e]
  10941. , r = n[e];
  10942. i[e] = n[e] = function() {
  10943. var e = Array.prototype.slice.call(arguments);
  10944. return t.apply(i, e),
  10945. r.apply(n, e)
  10946. }
  10947. }),
  10948. p.addClass(t, "has-slider"),
  10949. i.domElement.insertBefore(n.domElement, i.domElement.firstElementChild)
  10950. } else if (i instanceof s) {
  10951. var r = function(t) {
  10952. return f.isNumber(i.__min) && f.isNumber(i.__max) ? (i.remove(),
  10953. g(e, i.object, i.property, {
  10954. before: i.__li.nextElementSibling,
  10955. factoryArgs: [i.__min, i.__max, i.__step]
  10956. })) : t
  10957. };
  10958. i.min = f.compose(r, i.min),
  10959. i.max = f.compose(r, i.max)
  10960. } else
  10961. i instanceof o ? (p.bind(t, "click", function() {
  10962. p.fakeEvent(i.__checkbox, "click")
  10963. }),
  10964. p.bind(i.__checkbox, "click", function(e) {
  10965. e.stopPropagation()
  10966. })) : i instanceof a ? (p.bind(t, "click", function() {
  10967. p.fakeEvent(i.__button, "click")
  10968. }),
  10969. p.bind(t, "mouseover", function() {
  10970. p.addClass(i.__button, "hover")
  10971. }),
  10972. p.bind(t, "mouseout", function() {
  10973. p.removeClass(i.__button, "hover")
  10974. })) : i instanceof h && (p.addClass(t, "color"),
  10975. i.updateDisplay = f.compose(function(e) {
  10976. return t.style.borderLeftColor = i.__color.toString(),
  10977. e
  10978. }, i.updateDisplay),
  10979. i.updateDisplay());
  10980. i.setValue = f.compose(function(t) {
  10981. return e.getRoot().__preset_select && i.isModified() && T(e.getRoot(), !0),
  10982. t
  10983. }, i.setValue)
  10984. }
  10985. function A(e, t) {
  10986. var i = e.getRoot()
  10987. , n = i.__rememberedObjects.indexOf(t.object);
  10988. if (n != -1) {
  10989. var r = i.__rememberedObjectIndecesToControllers[n];
  10990. if (void 0 === r && (r = {},
  10991. i.__rememberedObjectIndecesToControllers[n] = r),
  10992. r[t.property] = t,
  10993. i.load && i.load.remembered) {
  10994. var o, a = i.load.remembered;
  10995. if (a[e.preset])
  10996. o = a[e.preset];
  10997. else {
  10998. if (!a[L])
  10999. return;
  11000. o = a[L]
  11001. }
  11002. if (o[n] && void 0 !== o[n][t.property]) {
  11003. var s = o[n][t.property];
  11004. t.initialValue = s,
  11005. t.setValue(s)
  11006. }
  11007. }
  11008. }
  11009. }
  11010. function y(e, t) {
  11011. return document.location.href + "." + t
  11012. }
  11013. function C(e) {
  11014. var t = e.__save_row = document.createElement("li");
  11015. p.addClass(e.domElement, "has-save"),
  11016. e.__ul.insertBefore(t, e.__ul.firstChild),
  11017. p.addClass(t, "save-row");
  11018. var i = document.createElement("span");
  11019. i.innerHTML = "&nbsp;",
  11020. p.addClass(i, "button gears");
  11021. var n = document.createElement("span");
  11022. n.innerHTML = "Save",
  11023. p.addClass(n, "button"),
  11024. p.addClass(n, "save");
  11025. var r = document.createElement("span");
  11026. r.innerHTML = "New",
  11027. p.addClass(r, "button"),
  11028. p.addClass(r, "save-as");
  11029. var o = document.createElement("span");
  11030. o.innerHTML = "Revert",
  11031. p.addClass(o, "button"),
  11032. p.addClass(o, "revert");
  11033. var a = e.__preset_select = document.createElement("select");
  11034. if (e.load && e.load.remembered ? f.each(e.load.remembered, function(t, i) {
  11035. w(e, i, i == e.preset)
  11036. }) : w(e, L, !1),
  11037. p.bind(a, "change", function() {
  11038. for (var t = 0; t < e.__preset_select.length; t++)
  11039. e.__preset_select[t].innerHTML = e.__preset_select[t].value;
  11040. e.preset = this.value
  11041. }),
  11042. t.appendChild(a),
  11043. t.appendChild(i),
  11044. t.appendChild(n),
  11045. t.appendChild(r),
  11046. t.appendChild(o),
  11047. D) {
  11048. var s = document.getElementById("dg-save-locally")
  11049. , l = document.getElementById("dg-local-explain");
  11050. s.style.display = "block";
  11051. var c = document.getElementById("dg-local-storage");
  11052. "true" === localStorage.getItem(y(e, "isLocal")) && c.setAttribute("checked", "checked");
  11053. var h = function() {
  11054. l.style.display = e.useLocalStorage ? "block" : "none"
  11055. };
  11056. h(),
  11057. p.bind(c, "change", function() {
  11058. e.useLocalStorage = !e.useLocalStorage,
  11059. h()
  11060. })
  11061. }
  11062. var u = document.getElementById("dg-new-constructor");
  11063. p.bind(u, "keydown", function(e) {
  11064. !e.metaKey || 67 !== e.which && 67 != e.keyCode || S.hide()
  11065. }),
  11066. p.bind(i, "click", function() {
  11067. u.innerHTML = JSON.stringify(e.getSaveObject(), void 0, 2),
  11068. S.show(),
  11069. u.focus(),
  11070. u.select()
  11071. }),
  11072. p.bind(n, "click", function() {
  11073. e.save()
  11074. }),
  11075. p.bind(r, "click", function() {
  11076. var t = prompt("Enter a new preset name.");
  11077. t && e.saveAs(t)
  11078. }),
  11079. p.bind(o, "click", function() {
  11080. e.revert()
  11081. })
  11082. }
  11083. function I(e) {
  11084. function t(t) {
  11085. return t.preventDefault(),
  11086. r = t.clientX,
  11087. p.addClass(e.__closeButton, V.CLASS_DRAG),
  11088. p.bind(window, "mousemove", i),
  11089. p.bind(window, "mouseup", n),
  11090. !1
  11091. }
  11092. function i(t) {
  11093. return t.preventDefault(),
  11094. e.width += r - t.clientX,
  11095. e.onResize(),
  11096. r = t.clientX,
  11097. !1
  11098. }
  11099. function n() {
  11100. p.removeClass(e.__closeButton, V.CLASS_DRAG),
  11101. p.unbind(window, "mousemove", i),
  11102. p.unbind(window, "mouseup", n)
  11103. }
  11104. e.__resize_handle = document.createElement("div"),
  11105. f.extend(e.__resize_handle.style, {
  11106. width: "6px",
  11107. marginLeft: "-3px",
  11108. height: "200px",
  11109. cursor: "ew-resize",
  11110. position: "absolute"
  11111. });
  11112. var r;
  11113. p.bind(e.__resize_handle, "mousedown", t),
  11114. p.bind(e.__closeButton, "mousedown", t),
  11115. e.domElement.insertBefore(e.__resize_handle, e.domElement.firstElementChild)
  11116. }
  11117. function E(e, t) {
  11118. e.domElement.style.width = t + "px",
  11119. e.__save_row && e.autoPlace && (e.__save_row.style.width = t + "px"),
  11120. e.__closeButton && (e.__closeButton.style.width = t + "px")
  11121. }
  11122. function b(e, t) {
  11123. var i = {};
  11124. return f.each(e.__rememberedObjects, function(n, r) {
  11125. var o = {}
  11126. , a = e.__rememberedObjectIndecesToControllers[r];
  11127. f.each(a, function(e, i) {
  11128. o[i] = t ? e.initialValue : e.getValue()
  11129. }),
  11130. i[r] = o
  11131. }),
  11132. i
  11133. }
  11134. function w(e, t, i) {
  11135. var n = document.createElement("option");
  11136. n.innerHTML = t,
  11137. n.value = t,
  11138. e.__preset_select.appendChild(n),
  11139. i && (e.__preset_select.selectedIndex = e.__preset_select.length - 1)
  11140. }
  11141. function _(e) {
  11142. for (var t = 0; t < e.__preset_select.length; t++)
  11143. e.__preset_select[t].value == e.preset && (e.__preset_select.selectedIndex = t)
  11144. }
  11145. function T(e, t) {
  11146. var i = e.__preset_select[e.__preset_select.selectedIndex];
  11147. t ? i.innerHTML = i.value + "*" : i.innerHTML = i.value
  11148. }
  11149. function x(e) {
  11150. 0 != e.length && u(function() {
  11151. x(e)
  11152. }),
  11153. f.each(e, function(e) {
  11154. e.updateDisplay()
  11155. })
  11156. }
  11157. e.inject(i);
  11158. var S, M, R = "dg", P = 72, O = 20, L = "Default", D = function() {
  11159. try {
  11160. return "localStorage"in window && null !== window.localStorage
  11161. } catch (e) {
  11162. return !1
  11163. }
  11164. }(), N = !0, B = !1, F = [], V = function(e) {
  11165. function t() {
  11166. var e = i.getRoot();
  11167. e.width += 1,
  11168. f.defer(function() {
  11169. e.width -= 1
  11170. })
  11171. }
  11172. var i = this;
  11173. this.domElement = document.createElement("div"),
  11174. this.__ul = document.createElement("ul"),
  11175. this.domElement.appendChild(this.__ul),
  11176. p.addClass(this.domElement, R),
  11177. this.__folders = {},
  11178. this.__controllers = [],
  11179. this.__rememberedObjects = [],
  11180. this.__rememberedObjectIndecesToControllers = [],
  11181. this.__listening = [],
  11182. e = e || {},
  11183. e = f.defaults(e, {
  11184. autoPlace: !0,
  11185. width: V.DEFAULT_WIDTH
  11186. }),
  11187. e = f.defaults(e, {
  11188. resizable: e.autoPlace,
  11189. hideable: e.autoPlace
  11190. }),
  11191. f.isUndefined(e.load) ? e.load = {
  11192. preset: L
  11193. } : e.preset && (e.load.preset = e.preset),
  11194. f.isUndefined(e.parent) && e.hideable && F.push(this),
  11195. e.resizable = f.isUndefined(e.parent) && e.resizable,
  11196. e.autoPlace && f.isUndefined(e.scrollable) && (e.scrollable = !0);
  11197. var n, r = D && "true" === localStorage.getItem(y(this, "isLocal"));
  11198. if (Object.defineProperties(this, {
  11199. parent: {
  11200. get: function() {
  11201. return e.parent
  11202. }
  11203. },
  11204. scrollable: {
  11205. get: function() {
  11206. return e.scrollable
  11207. }
  11208. },
  11209. autoPlace: {
  11210. get: function() {
  11211. return e.autoPlace
  11212. }
  11213. },
  11214. preset: {
  11215. get: function() {
  11216. return i.parent ? i.getRoot().preset : e.load.preset
  11217. },
  11218. set: function(t) {
  11219. i.parent ? i.getRoot().preset = t : e.load.preset = t,
  11220. _(this),
  11221. i.revert()
  11222. }
  11223. },
  11224. width: {
  11225. get: function() {
  11226. return e.width
  11227. },
  11228. set: function(t) {
  11229. e.width = t,
  11230. E(i, t)
  11231. }
  11232. },
  11233. name: {
  11234. get: function() {
  11235. return e.name
  11236. },
  11237. set: function(t) {
  11238. e.name = t,
  11239. a && (a.innerHTML = e.name)
  11240. }
  11241. },
  11242. closed: {
  11243. get: function() {
  11244. return e.closed
  11245. },
  11246. set: function(t) {
  11247. e.closed = t,
  11248. e.closed ? p.addClass(i.__ul, V.CLASS_CLOSED) : p.removeClass(i.__ul, V.CLASS_CLOSED),
  11249. this.onResize(),
  11250. i.__closeButton && (i.__closeButton.innerHTML = t ? V.TEXT_OPEN : V.TEXT_CLOSED)
  11251. }
  11252. },
  11253. load: {
  11254. get: function() {
  11255. return e.load
  11256. }
  11257. },
  11258. useLocalStorage: {
  11259. get: function() {
  11260. return r
  11261. },
  11262. set: function(e) {
  11263. D && (r = e,
  11264. e ? p.bind(window, "unload", n) : p.unbind(window, "unload", n),
  11265. localStorage.setItem(y(i, "isLocal"), e))
  11266. }
  11267. }
  11268. }),
  11269. f.isUndefined(e.parent)) {
  11270. if (e.closed = !1,
  11271. p.addClass(this.domElement, V.CLASS_MAIN),
  11272. p.makeSelectable(this.domElement, !1),
  11273. D && r) {
  11274. i.useLocalStorage = !0;
  11275. var o = localStorage.getItem(y(this, "gui"));
  11276. o && (e.load = JSON.parse(o))
  11277. }
  11278. this.__closeButton = document.createElement("div"),
  11279. this.__closeButton.innerHTML = V.TEXT_CLOSED,
  11280. p.addClass(this.__closeButton, V.CLASS_CLOSE_BUTTON),
  11281. this.domElement.appendChild(this.__closeButton),
  11282. p.bind(this.__closeButton, "click", function() {
  11283. i.closed = !i.closed
  11284. })
  11285. } else {
  11286. void 0 === e.closed && (e.closed = !0);
  11287. var a = document.createTextNode(e.name);
  11288. p.addClass(a, "controller-name");
  11289. var s = m(i, a)
  11290. , l = function(e) {
  11291. return e.preventDefault(),
  11292. i.closed = !i.closed,
  11293. !1
  11294. };
  11295. p.addClass(this.__ul, V.CLASS_CLOSED),
  11296. p.addClass(s, "title"),
  11297. p.bind(s, "click", l),
  11298. e.closed || (this.closed = !1)
  11299. }
  11300. e.autoPlace && (f.isUndefined(e.parent) && (N && (M = document.createElement("div"),
  11301. p.addClass(M, R),
  11302. p.addClass(M, V.CLASS_AUTO_PLACE_CONTAINER),
  11303. document.body.appendChild(M),
  11304. N = !1),
  11305. M.appendChild(this.domElement),
  11306. p.addClass(this.domElement, V.CLASS_AUTO_PLACE)),
  11307. this.parent || E(i, e.width)),
  11308. p.bind(window, "resize", function() {
  11309. i.onResize()
  11310. }),
  11311. p.bind(this.__ul, "webkitTransitionEnd", function() {
  11312. i.onResize()
  11313. }),
  11314. p.bind(this.__ul, "transitionend", function() {
  11315. i.onResize()
  11316. }),
  11317. p.bind(this.__ul, "oTransitionEnd", function() {
  11318. i.onResize()
  11319. }),
  11320. this.onResize(),
  11321. e.resizable && I(this),
  11322. n = function() {
  11323. D && "true" === localStorage.getItem(y(i, "isLocal")) && localStorage.setItem(y(i, "gui"), JSON.stringify(i.getSaveObject()))
  11324. }
  11325. ,
  11326. this.saveToLocalStorageIfPossible = n;
  11327. i.getRoot();
  11328. e.parent || t()
  11329. };
  11330. return V.toggleHide = function() {
  11331. B = !B,
  11332. f.each(F, function(e) {
  11333. e.domElement.style.zIndex = B ? -999 : 999,
  11334. e.domElement.style.opacity = B ? 0 : 1
  11335. })
  11336. }
  11337. ,
  11338. V.CLASS_AUTO_PLACE = "a",
  11339. V.CLASS_AUTO_PLACE_CONTAINER = "ac",
  11340. V.CLASS_MAIN = "main",
  11341. V.CLASS_CONTROLLER_ROW = "cr",
  11342. V.CLASS_TOO_TALL = "taller-than-window",
  11343. V.CLASS_CLOSED = "closed",
  11344. V.CLASS_CLOSE_BUTTON = "close-button",
  11345. V.CLASS_DRAG = "drag",
  11346. V.DEFAULT_WIDTH = 245,
  11347. V.TEXT_CLOSED = "Close Controls",
  11348. V.TEXT_OPEN = "Open Controls",
  11349. p.bind(window, "keydown", function(e) {
  11350. "text" === document.activeElement.type || e.which !== P && e.keyCode != P || V.toggleHide()
  11351. }, !1),
  11352. f.extend(V.prototype, {
  11353. add: function(e, t) {
  11354. return g(this, e, t, {
  11355. factoryArgs: Array.prototype.slice.call(arguments, 2)
  11356. })
  11357. },
  11358. addColor: function(e, t) {
  11359. return g(this, e, t, {
  11360. color: !0
  11361. })
  11362. },
  11363. remove: function(e) {
  11364. this.__ul.removeChild(e.__li),
  11365. this.__controllers.slice(this.__controllers.indexOf(e), 1);
  11366. var t = this;
  11367. f.defer(function() {
  11368. t.onResize()
  11369. })
  11370. },
  11371. destroy: function() {
  11372. this.autoPlace && M.removeChild(this.domElement)
  11373. },
  11374. addFolder: function(e) {
  11375. if (void 0 !== this.__folders[e])
  11376. throw new Error('You already have a folder in this GUI by the name "' + e + '"');
  11377. var t = {
  11378. name: e,
  11379. parent: this
  11380. };
  11381. t.autoPlace = this.autoPlace,
  11382. this.load && this.load.folders && this.load.folders[e] && (t.closed = this.load.folders[e].closed,
  11383. t.load = this.load.folders[e]);
  11384. var i = new V(t);
  11385. this.__folders[e] = i;
  11386. var n = m(this, i.domElement);
  11387. return p.addClass(n, "folder"),
  11388. i
  11389. },
  11390. open: function() {
  11391. this.closed = !1
  11392. },
  11393. close: function() {
  11394. this.closed = !0
  11395. },
  11396. onResize: function() {
  11397. var e = this.getRoot();
  11398. if (e.scrollable) {
  11399. var t = p.getOffset(e.__ul).top
  11400. , i = 0;
  11401. f.each(e.__ul.childNodes, function(t) {
  11402. e.autoPlace && t === e.__save_row || (i += p.getHeight(t))
  11403. }),
  11404. $("#player").height() - t - O < i ? (p.addClass(e.domElement, V.CLASS_TOO_TALL),
  11405. e.__ul.style.height = $("#player").height() - t - O + "px") : (p.removeClass(e.domElement, V.CLASS_TOO_TALL),
  11406. e.__ul.style.height = "auto")
  11407. }
  11408. e.__resize_handle && f.defer(function() {
  11409. e.__resize_handle.style.height = e.__ul.offsetHeight + "px"
  11410. }),
  11411. e.__closeButton && (e.__closeButton.style.width = e.width + "px")
  11412. },
  11413. remember: function() {
  11414. if (f.isUndefined(S) && (S = new d,
  11415. S.domElement.innerHTML = t),
  11416. this.parent)
  11417. throw new Error("You can only call remember on a top level GUI.");
  11418. var e = this;
  11419. f.each(Array.prototype.slice.call(arguments), function(t) {
  11420. 0 == e.__rememberedObjects.length && C(e),
  11421. e.__rememberedObjects.indexOf(t) == -1 && e.__rememberedObjects.push(t)
  11422. }),
  11423. this.autoPlace && E(this, this.width)
  11424. },
  11425. getRoot: function() {
  11426. for (var e = this; e.parent; )
  11427. e = e.parent;
  11428. return e
  11429. },
  11430. getSaveObject: function() {
  11431. var e = this.load;
  11432. return e.closed = this.closed,
  11433. this.__rememberedObjects.length > 0 && (e.preset = this.preset,
  11434. e.remembered || (e.remembered = {}),
  11435. e.remembered[this.preset] = b(this)),
  11436. e.folders = {},
  11437. f.each(this.__folders, function(t, i) {
  11438. e.folders[i] = t.getSaveObject()
  11439. }),
  11440. e
  11441. },
  11442. save: function() {
  11443. this.load.remembered || (this.load.remembered = {}),
  11444. this.load.remembered[this.preset] = b(this),
  11445. T(this, !1),
  11446. this.saveToLocalStorageIfPossible()
  11447. },
  11448. saveAs: function(e) {
  11449. this.load.remembered || (this.load.remembered = {},
  11450. this.load.remembered[L] = b(this, !0)),
  11451. this.load.remembered[e] = b(this),
  11452. this.preset = e,
  11453. w(this, e, !0),
  11454. this.saveToLocalStorageIfPossible()
  11455. },
  11456. revert: function(e) {
  11457. f.each(this.__controllers, function(t) {
  11458. this.getRoot().load.remembered ? A(e || this.getRoot(), t) : t.setValue(t.initialValue)
  11459. }, this),
  11460. f.each(this.__folders, function(e) {
  11461. e.revert(e)
  11462. }),
  11463. e || T(this.getRoot(), !1)
  11464. },
  11465. listen: function(e) {
  11466. var t = 0 == this.__listening.length;
  11467. this.__listening.push(e),
  11468. t && x(this.__listening)
  11469. }
  11470. }),
  11471. V
  11472. }(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) {
  11473. return function(s, l) {
  11474. var c = s[l];
  11475. 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,{
  11476. min: arguments[2],
  11477. max: arguments[3]
  11478. }) : a.isString(c) ? new n(s,l) : a.isFunction(c) ? new r(s,l,"") : a.isBoolean(c) ? new o(s,l) : void 0
  11479. }
  11480. }(n.controllers.OptionController, n.controllers.NumberControllerBox, n.controllers.NumberControllerSlider, n.controllers.StringController = function(e, t, i) {
  11481. var n = function(e, i) {
  11482. function r() {
  11483. a.setValue(a.__input.value)
  11484. }
  11485. function o() {
  11486. a.__onFinishChange && a.__onFinishChange.call(a, a.getValue())
  11487. }
  11488. n.superclass.call(this, e, i);
  11489. var a = this;
  11490. this.__input = document.createElement("input"),
  11491. this.__input.setAttribute("type", "text"),
  11492. t.bind(this.__input, "keyup", r),
  11493. t.bind(this.__input, "change", r),
  11494. t.bind(this.__input, "blur", o),
  11495. t.bind(this.__input, "keydown", function(e) {
  11496. 13 === e.keyCode && this.blur()
  11497. }),
  11498. this.updateDisplay(),
  11499. this.domElement.appendChild(this.__input)
  11500. };
  11501. return n.superclass = e,
  11502. i.extend(n.prototype, e.prototype, {
  11503. updateDisplay: function() {
  11504. return t.isActive(this.__input) || (this.__input.value = this.getValue()),
  11505. n.superclass.prototype.updateDisplay.call(this)
  11506. }
  11507. }),
  11508. n
  11509. }(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) {
  11510. function o(e, t, i, n) {
  11511. e.style.background = "",
  11512. r.each(l, function(r) {
  11513. e.style.cssText += "background: " + r + "linear-gradient(" + t + ", " + i + " 0%, " + n + " 100%); "
  11514. })
  11515. }
  11516. function a(e) {
  11517. e.style.background = "",
  11518. e.style.cssText += "background: -moz-linear-gradient(top, #ff0000 0%, #ff00ff 17%, #0000ff 34%, #00ffff 50%, #00ff00 67%, #ffff00 84%, #ff0000 100%);",
  11519. e.style.cssText += "background: -webkit-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",
  11520. e.style.cssText += "background: -o-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",
  11521. e.style.cssText += "background: -ms-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",
  11522. e.style.cssText += "background: linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);"
  11523. }
  11524. var s = function(e, l) {
  11525. function c(e) {
  11526. p(e),
  11527. t.bind(window, "mousemove", p),
  11528. t.bind(window, "mouseup", h)
  11529. }
  11530. function h() {
  11531. t.unbind(window, "mousemove", p),
  11532. t.unbind(window, "mouseup", h)
  11533. }
  11534. function u() {
  11535. var e = n(this.value);
  11536. e !== !1 ? (g.__color.__state = e,
  11537. g.setValue(g.__color.toOriginal())) : this.value = g.__color.toString()
  11538. }
  11539. function d() {
  11540. t.unbind(window, "mousemove", f),
  11541. t.unbind(window, "mouseup", d)
  11542. }
  11543. function p(e) {
  11544. e.preventDefault();
  11545. var i = t.getWidth(g.__saturation_field)
  11546. , n = t.getOffset(g.__saturation_field)
  11547. , r = (e.clientX - n.left + document.body.scrollLeft) / i
  11548. , o = 1 - (e.clientY - n.top + document.body.scrollTop) / i;
  11549. return o > 1 ? o = 1 : o < 0 && (o = 0),
  11550. r > 1 ? r = 1 : r < 0 && (r = 0),
  11551. g.__color.v = o,
  11552. g.__color.s = r,
  11553. g.setValue(g.__color.toOriginal()),
  11554. !1
  11555. }
  11556. function f(e) {
  11557. e.preventDefault();
  11558. var i = t.getHeight(g.__hue_field)
  11559. , n = t.getOffset(g.__hue_field)
  11560. , r = 1 - (e.clientY - n.top + document.body.scrollTop) / i;
  11561. return r > 1 ? r = 1 : r < 0 && (r = 0),
  11562. g.__color.h = 360 * r,
  11563. g.setValue(g.__color.toOriginal()),
  11564. !1
  11565. }
  11566. s.superclass.call(this, e, l),
  11567. this.__color = new i(this.getValue()),
  11568. this.__temp = new i(0);
  11569. var g = this;
  11570. this.domElement = document.createElement("div"),
  11571. t.makeSelectable(this.domElement, !1),
  11572. this.__selector = document.createElement("div"),
  11573. this.__selector.className = "selector",
  11574. this.__saturation_field = document.createElement("div"),
  11575. this.__saturation_field.className = "saturation-field",
  11576. this.__field_knob = document.createElement("div"),
  11577. this.__field_knob.className = "field-knob",
  11578. this.__field_knob_border = "2px solid ",
  11579. this.__hue_knob = document.createElement("div"),
  11580. this.__hue_knob.className = "hue-knob",
  11581. this.__hue_field = document.createElement("div"),
  11582. this.__hue_field.className = "hue-field",
  11583. this.__input = document.createElement("input"),
  11584. this.__input.type = "text",
  11585. this.__input_textShadow = "0 1px 1px ",
  11586. t.bind(this.__input, "keydown", function(e) {
  11587. 13 === e.keyCode && u.call(this)
  11588. }),
  11589. t.bind(this.__input, "blur", u),
  11590. t.bind(this.__selector, "mousedown", function(e) {
  11591. t.addClass(this, "drag").bind(window, "mouseup", function(e) {
  11592. t.removeClass(g.__selector, "drag")
  11593. })
  11594. });
  11595. var m = document.createElement("div");
  11596. r.extend(this.__selector.style, {
  11597. width: "122px",
  11598. height: "102px",
  11599. padding: "3px",
  11600. backgroundColor: "#222",
  11601. boxShadow: "0px 1px 3px rgba(0,0,0,0.3)"
  11602. }),
  11603. r.extend(this.__field_knob.style, {
  11604. position: "absolute",
  11605. width: "12px",
  11606. height: "12px",
  11607. border: this.__field_knob_border + (this.__color.v < .5 ? "#fff" : "#000"),
  11608. boxShadow: "0px 1px 3px rgba(0,0,0,0.5)",
  11609. borderRadius: "12px",
  11610. zIndex: 1
  11611. }),
  11612. r.extend(this.__hue_knob.style, {
  11613. position: "absolute",
  11614. width: "15px",
  11615. height: "2px",
  11616. borderRight: "4px solid #fff",
  11617. zIndex: 1
  11618. }),
  11619. r.extend(this.__saturation_field.style, {
  11620. width: "100px",
  11621. height: "100px",
  11622. border: "1px solid #555",
  11623. marginRight: "3px",
  11624. display: "inline-block",
  11625. cursor: "pointer"
  11626. }),
  11627. r.extend(m.style, {
  11628. width: "100%",
  11629. height: "100%",
  11630. background: "none"
  11631. }),
  11632. o(m, "top", "rgba(0,0,0,0)", "#000"),
  11633. r.extend(this.__hue_field.style, {
  11634. width: "15px",
  11635. height: "100px",
  11636. display: "inline-block",
  11637. border: "1px solid #555",
  11638. cursor: "ns-resize"
  11639. }),
  11640. a(this.__hue_field),
  11641. r.extend(this.__input.style, {
  11642. outline: "none",
  11643. textAlign: "center",
  11644. color: "#fff",
  11645. border: 0,
  11646. fontWeight: "bold",
  11647. textShadow: this.__input_textShadow + "rgba(0,0,0,0.7)"
  11648. }),
  11649. t.bind(this.__saturation_field, "mousedown", c),
  11650. t.bind(this.__field_knob, "mousedown", c),
  11651. t.bind(this.__hue_field, "mousedown", function(e) {
  11652. f(e),
  11653. t.bind(window, "mousemove", f),
  11654. t.bind(window, "mouseup", d)
  11655. }),
  11656. this.__saturation_field.appendChild(m),
  11657. this.__selector.appendChild(this.__field_knob),
  11658. this.__selector.appendChild(this.__saturation_field),
  11659. this.__selector.appendChild(this.__hue_field),
  11660. this.__hue_field.appendChild(this.__hue_knob),
  11661. this.domElement.appendChild(this.__input),
  11662. this.domElement.appendChild(this.__selector),
  11663. this.updateDisplay()
  11664. };
  11665. s.superclass = e,
  11666. r.extend(s.prototype, e.prototype, {
  11667. updateDisplay: function() {
  11668. var e = n(this.getValue());
  11669. if (e !== !1) {
  11670. var t = !1;
  11671. r.each(i.COMPONENTS, function(i) {
  11672. if (!r.isUndefined(e[i]) && !r.isUndefined(this.__color.__state[i]) && e[i] !== this.__color.__state[i])
  11673. return t = !0,
  11674. {}
  11675. }, this),
  11676. t && r.extend(this.__color.__state, e)
  11677. }
  11678. r.extend(this.__temp.__state, this.__color.__state),
  11679. this.__temp.a = 1;
  11680. var a = this.__color.v < .5 || this.__color.s > .5 ? 255 : 0
  11681. , s = 255 - a;
  11682. r.extend(this.__field_knob.style, {
  11683. marginLeft: 100 * this.__color.s - 7 + "px",
  11684. marginTop: 100 * (1 - this.__color.v) - 7 + "px",
  11685. backgroundColor: this.__temp.toString(),
  11686. border: this.__field_knob_border + "rgb(" + a + "," + a + "," + a + ")"
  11687. }),
  11688. this.__hue_knob.style.marginTop = 100 * (1 - this.__color.h / 360) + "px",
  11689. this.__temp.s = 1,
  11690. this.__temp.v = 1,
  11691. o(this.__saturation_field, "left", "#fff", this.__temp.toString()),
  11692. r.extend(this.__input.style, {
  11693. backgroundColor: this.__input.value = this.__color.toString(),
  11694. color: "rgb(" + a + "," + a + "," + a + ")",
  11695. textShadow: this.__input_textShadow + "rgba(" + s + "," + s + "," + s + ",.7)"
  11696. })
  11697. }
  11698. });
  11699. var l = ["-moz-", "-o-", "-webkit-", "-ms-", ""];
  11700. return s
  11701. }(n.controllers.Controller, n.dom.dom, n.color.Color = function(e, t, i, n) {
  11702. function r(e, t, i) {
  11703. Object.defineProperty(e, t, {
  11704. get: function() {
  11705. return "RGB" === this.__state.space ? this.__state[t] : (a(this, t, i),
  11706. this.__state[t])
  11707. },
  11708. set: function(e) {
  11709. "RGB" !== this.__state.space && (a(this, t, i),
  11710. this.__state.space = "RGB"),
  11711. this.__state[t] = e
  11712. }
  11713. })
  11714. }
  11715. function o(e, t) {
  11716. Object.defineProperty(e, t, {
  11717. get: function() {
  11718. return "HSV" === this.__state.space ? this.__state[t] : (s(this),
  11719. this.__state[t])
  11720. },
  11721. set: function(e) {
  11722. "HSV" !== this.__state.space && (s(this),
  11723. this.__state.space = "HSV"),
  11724. this.__state[t] = e
  11725. }
  11726. })
  11727. }
  11728. function a(e, i, r) {
  11729. if ("HEX" === e.__state.space)
  11730. e.__state[i] = t.component_from_hex(e.__state.hex, r);
  11731. else {
  11732. if ("HSV" !== e.__state.space)
  11733. throw "Corrupted color state";
  11734. n.extend(e.__state, t.hsv_to_rgb(e.__state.h, e.__state.s, e.__state.v))
  11735. }
  11736. }
  11737. function s(e) {
  11738. var i = t.rgb_to_hsv(e.r, e.g, e.b);
  11739. n.extend(e.__state, {
  11740. s: i.s,
  11741. v: i.v
  11742. }),
  11743. n.isNaN(i.h) ? n.isUndefined(e.__state.h) && (e.__state.h = 0) : e.__state.h = i.h
  11744. }
  11745. var l = function() {
  11746. if (this.__state = e.apply(this, arguments),
  11747. this.__state === !1)
  11748. throw "Failed to interpret color arguments";
  11749. this.__state.a = this.__state.a || 1
  11750. };
  11751. return l.COMPONENTS = ["r", "g", "b", "h", "s", "v", "hex", "a"],
  11752. n.extend(l.prototype, {
  11753. toString: function() {
  11754. return i(this)
  11755. },
  11756. toOriginal: function() {
  11757. return this.__state.conversion.write(this)
  11758. }
  11759. }),
  11760. r(l.prototype, "r", 2),
  11761. r(l.prototype, "g", 1),
  11762. r(l.prototype, "b", 0),
  11763. o(l.prototype, "h"),
  11764. o(l.prototype, "s"),
  11765. o(l.prototype, "v"),
  11766. Object.defineProperty(l.prototype, "a", {
  11767. get: function() {
  11768. return this.__state.a
  11769. },
  11770. set: function(e) {
  11771. this.__state.a = e
  11772. }
  11773. }),
  11774. Object.defineProperty(l.prototype, "hex", {
  11775. get: function() {
  11776. return "HEX" !== !this.__state.space && (this.__state.hex = t.rgb_to_hex(this.r, this.g, this.b)),
  11777. this.__state.hex
  11778. },
  11779. set: function(e) {
  11780. this.__state.space = "HEX",
  11781. this.__state.hex = e
  11782. }
  11783. }),
  11784. l
  11785. }(n.color.interpret, n.color.math = function() {
  11786. var e;
  11787. return {
  11788. hsv_to_rgb: function(e, t, i) {
  11789. var n = Math.floor(e / 60) % 6
  11790. , r = e / 60 - Math.floor(e / 60)
  11791. , o = i * (1 - t)
  11792. , a = i * (1 - r * t)
  11793. , s = i * (1 - (1 - r) * t)
  11794. , l = [[i, s, o], [a, i, o], [o, i, s], [o, a, i], [s, o, i], [i, o, a]][n];
  11795. return {
  11796. r: 255 * l[0],
  11797. g: 255 * l[1],
  11798. b: 255 * l[2]
  11799. }
  11800. },
  11801. rgb_to_hsv: function(e, t, i) {
  11802. var n, r, o = Math.min(e, t, i), a = Math.max(e, t, i), s = a - o;
  11803. return 0 == a ? {
  11804. h: NaN,
  11805. s: 0,
  11806. v: 0
  11807. } : (r = s / a,
  11808. n = e == a ? (t - i) / s : t == a ? 2 + (i - e) / s : 4 + (e - t) / s,
  11809. n /= 6,
  11810. n < 0 && (n += 1),
  11811. {
  11812. h: 360 * n,
  11813. s: r,
  11814. v: a / 255
  11815. })
  11816. },
  11817. rgb_to_hex: function(e, t, i) {
  11818. var n = this.hex_with_component(0, 2, e);
  11819. return n = this.hex_with_component(n, 1, t),
  11820. n = this.hex_with_component(n, 0, i)
  11821. },
  11822. component_from_hex: function(e, t) {
  11823. return e >> 8 * t & 255
  11824. },
  11825. hex_with_component: function(t, i, n) {
  11826. return n << (e = 8 * i) | t & ~(255 << e)
  11827. }
  11828. }
  11829. }(), n.color.toString, n.utils.common), n.color.interpret, n.utils.common), n.utils.requestAnimationFrame = function() {
  11830. return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function(e, t) {
  11831. window.setTimeout(e, 1e3 / 60)
  11832. }
  11833. }(), n.dom.CenteredDiv = function(e, t) {
  11834. var i = function() {
  11835. this.backgroundElement = document.createElement("div"),
  11836. t.extend(this.backgroundElement.style, {
  11837. backgroundColor: "rgba(0,0,0,0.8)",
  11838. top: 0,
  11839. left: 0,
  11840. display: "none",
  11841. zIndex: "1000",
  11842. opacity: 0,
  11843. WebkitTransition: "opacity 0.2s linear"
  11844. }),
  11845. e.makeFullscreen(this.backgroundElement),
  11846. this.backgroundElement.style.position = "fixed",
  11847. this.domElement = document.createElement("div"),
  11848. t.extend(this.domElement.style, {
  11849. position: "fixed",
  11850. display: "none",
  11851. zIndex: "1001",
  11852. opacity: 0,
  11853. WebkitTransition: "-webkit-transform 0.2s ease-out, opacity 0.2s linear"
  11854. }),
  11855. document.body.appendChild(this.backgroundElement),
  11856. document.body.appendChild(this.domElement);
  11857. var i = this;
  11858. e.bind(this.backgroundElement, "click", function() {
  11859. i.hide()
  11860. })
  11861. };
  11862. return i.prototype.show = function() {
  11863. var e = this;
  11864. this.backgroundElement.style.display = "block",
  11865. this.domElement.style.display = "block",
  11866. this.domElement.style.opacity = 0,
  11867. this.domElement.style.webkitTransform = "scale(1.1)",
  11868. this.layout(),
  11869. t.defer(function() {
  11870. e.backgroundElement.style.opacity = 1,
  11871. e.domElement.style.opacity = 1,
  11872. e.domElement.style.webkitTransform = "scale(1)"
  11873. })
  11874. }
  11875. ,
  11876. i.prototype.hide = function() {
  11877. var t = this
  11878. , i = function() {
  11879. t.domElement.style.display = "none",
  11880. t.backgroundElement.style.display = "none",
  11881. e.unbind(t.domElement, "webkitTransitionEnd", i),
  11882. e.unbind(t.domElement, "transitionend", i),
  11883. e.unbind(t.domElement, "oTransitionEnd", i)
  11884. };
  11885. e.bind(this.domElement, "webkitTransitionEnd", i),
  11886. e.bind(this.domElement, "transitionend", i),
  11887. e.bind(this.domElement, "oTransitionEnd", i),
  11888. this.backgroundElement.style.opacity = 0,
  11889. this.domElement.style.opacity = 0,
  11890. this.domElement.style.webkitTransform = "scale(1.1)"
  11891. }
  11892. ,
  11893. i.prototype.layout = function() {
  11894. this.domElement.style.left = $("#player").width() / 2 - e.getWidth(this.domElement) / 2 + "px",
  11895. this.domElement.style.top = $("#player").height() / 2 - e.getHeight(this.domElement) / 2 + "px"
  11896. }
  11897. ,
  11898. i
  11899. }(n.dom.dom, n.utils.common), n.dom.dom, n.utils.common)
  11900. }
  11901. , {}],
  11902. 94: [function(e, t, i) {
  11903. (function(e) {
  11904. "use strict";
  11905. function i(t) {
  11906. function i(e) {
  11907. 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++) {
  11908. var n = _((t[i] * e + 50) / 100);
  11909. n < 1 ? n = 1 : n > 255 && (n = 255),
  11910. T[G[i]] = n
  11911. }
  11912. 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++) {
  11913. var a = _((r[o] * e + 50) / 100);
  11914. a < 1 ? a = 1 : a > 255 && (a = 255),
  11915. x[G[o]] = a
  11916. }
  11917. for (var s = [1, 1.387039845, 1.306562965, 1.175875602, 1, .785694958, .5411961, .275899379], l = 0, c = 0; c < 8; c++)
  11918. for (var h = 0; h < 8; h++)
  11919. S[l] = 1 / (T[G[l]] * s[c] * s[h] * 8),
  11920. M[l] = 1 / (x[G[l]] * s[c] * s[h] * 8),
  11921. l++
  11922. }
  11923. function n(e, t) {
  11924. for (var i = 0, n = 0, r = new Array, o = 1; o <= 16; o++) {
  11925. for (var a = 1; a <= e[o]; a++)
  11926. r[t[n]] = [],
  11927. r[t[n]][0] = i,
  11928. r[t[n]][1] = o,
  11929. n++,
  11930. i++;
  11931. i *= 2
  11932. }
  11933. return r
  11934. }
  11935. function r() {
  11936. C = n(z, W),
  11937. I = n(X, Z),
  11938. E = n(j, Y),
  11939. b = n(q, K)
  11940. }
  11941. function o() {
  11942. for (var e = 1, t = 2, i = 1; i <= 15; i++) {
  11943. for (var n = e; n < t; n++)
  11944. P[32767 + n] = i,
  11945. R[32767 + n] = [],
  11946. R[32767 + n][1] = i,
  11947. R[32767 + n][0] = n;
  11948. for (var r = -(t - 1); r <= -e; r++)
  11949. P[32767 + r] = i,
  11950. R[32767 + r] = [],
  11951. R[32767 + r][1] = i,
  11952. R[32767 + r][0] = t - 1 + r;
  11953. e <<= 1,
  11954. t <<= 1
  11955. }
  11956. }
  11957. function a() {
  11958. for (var e = 0; e < 256; e++)
  11959. H[e] = 19595 * e,
  11960. H[e + 256 >> 0] = 38470 * e,
  11961. H[e + 512 >> 0] = 7471 * e + 32768,
  11962. H[e + 768 >> 0] = -11059 * e,
  11963. H[e + 1024 >> 0] = -21709 * e,
  11964. H[e + 1280 >> 0] = 32768 * e + 8421375,
  11965. H[e + 1536 >> 0] = -27439 * e,
  11966. H[e + 1792 >> 0] = -5329 * e
  11967. }
  11968. function s(e) {
  11969. for (var t = e[0], i = e[1] - 1; i >= 0; )
  11970. t & 1 << i && (N |= 1 << B),
  11971. i--,
  11972. B--,
  11973. B < 0 && (255 == N ? (l(255),
  11974. l(0)) : l(N),
  11975. B = 7,
  11976. N = 0)
  11977. }
  11978. function l(e) {
  11979. D.push(e)
  11980. }
  11981. function c(e) {
  11982. l(e >> 8 & 255),
  11983. l(255 & e)
  11984. }
  11985. function h(e, t) {
  11986. var i, n, r, o, a, s, l, c, h, u = 0, d = 8, p = 64;
  11987. for (h = 0; h < d; ++h) {
  11988. i = e[u],
  11989. n = e[u + 1],
  11990. r = e[u + 2],
  11991. o = e[u + 3],
  11992. a = e[u + 4],
  11993. s = e[u + 5],
  11994. l = e[u + 6],
  11995. c = e[u + 7];
  11996. var f = i + c
  11997. , g = i - c
  11998. , m = n + l
  11999. , v = n - l
  12000. , A = r + s
  12001. , y = r - s
  12002. , C = o + a
  12003. , I = o - a
  12004. , E = f + C
  12005. , b = f - C
  12006. , w = m + A
  12007. , _ = m - A;
  12008. e[u] = E + w,
  12009. e[u + 4] = E - w;
  12010. var T = .707106781 * (_ + b);
  12011. e[u + 2] = b + T,
  12012. e[u + 6] = b - T,
  12013. E = I + y,
  12014. w = y + v,
  12015. _ = v + g;
  12016. var x = .382683433 * (E - _)
  12017. , S = .5411961 * E + x
  12018. , M = 1.306562965 * _ + x
  12019. , R = .707106781 * w
  12020. , P = g + R
  12021. , L = g - R;
  12022. e[u + 5] = L + S,
  12023. e[u + 3] = L - S,
  12024. e[u + 1] = P + M,
  12025. e[u + 7] = P - M,
  12026. u += 8
  12027. }
  12028. for (u = 0,
  12029. h = 0; h < d; ++h) {
  12030. i = e[u],
  12031. n = e[u + 8],
  12032. r = e[u + 16],
  12033. o = e[u + 24],
  12034. a = e[u + 32],
  12035. s = e[u + 40],
  12036. l = e[u + 48],
  12037. c = e[u + 56];
  12038. var D = i + c
  12039. , N = i - c
  12040. , B = n + l
  12041. , F = n - l
  12042. , V = r + s
  12043. , U = r - s
  12044. , k = o + a
  12045. , H = o - a
  12046. , G = D + k
  12047. , z = D - k
  12048. , W = B + V
  12049. , j = B - V;
  12050. e[u] = G + W,
  12051. e[u + 32] = G - W;
  12052. var Y = .707106781 * (j + z);
  12053. e[u + 16] = z + Y,
  12054. e[u + 48] = z - Y,
  12055. G = H + U,
  12056. W = U + F,
  12057. j = F + N;
  12058. var X = .382683433 * (G - j)
  12059. , Z = .5411961 * G + X
  12060. , q = 1.306562965 * j + X
  12061. , K = .707106781 * W
  12062. , Q = N + K
  12063. , J = N - K;
  12064. e[u + 40] = J + Z,
  12065. e[u + 24] = J - Z,
  12066. e[u + 8] = Q + q,
  12067. e[u + 56] = Q - q,
  12068. u++
  12069. }
  12070. var $;
  12071. for (h = 0; h < p; ++h)
  12072. $ = e[h] * t[h],
  12073. O[h] = $ > 0 ? $ + .5 | 0 : $ - .5 | 0;
  12074. return O
  12075. }
  12076. function u() {
  12077. c(65504),
  12078. c(16),
  12079. l(74),
  12080. l(70),
  12081. l(73),
  12082. l(70),
  12083. l(0),
  12084. l(1),
  12085. l(1),
  12086. l(0),
  12087. c(1),
  12088. c(1),
  12089. l(0),
  12090. l(0)
  12091. }
  12092. function d(e, t) {
  12093. c(65472),
  12094. c(17),
  12095. l(8),
  12096. c(t),
  12097. c(e),
  12098. l(3),
  12099. l(1),
  12100. l(17),
  12101. l(0),
  12102. l(2),
  12103. l(17),
  12104. l(1),
  12105. l(3),
  12106. l(17),
  12107. l(1)
  12108. }
  12109. function p() {
  12110. c(65499),
  12111. c(132),
  12112. l(0);
  12113. for (var e = 0; e < 64; e++)
  12114. l(T[e]);
  12115. l(1);
  12116. for (var t = 0; t < 64; t++)
  12117. l(x[t])
  12118. }
  12119. function f() {
  12120. c(65476),
  12121. c(418),
  12122. l(0);
  12123. for (var e = 0; e < 16; e++)
  12124. l(z[e + 1]);
  12125. for (var t = 0; t <= 11; t++)
  12126. l(W[t]);
  12127. l(16);
  12128. for (var i = 0; i < 16; i++)
  12129. l(j[i + 1]);
  12130. for (var n = 0; n <= 161; n++)
  12131. l(Y[n]);
  12132. l(1);
  12133. for (var r = 0; r < 16; r++)
  12134. l(X[r + 1]);
  12135. for (var o = 0; o <= 11; o++)
  12136. l(Z[o]);
  12137. l(17);
  12138. for (var a = 0; a < 16; a++)
  12139. l(q[a + 1]);
  12140. for (var s = 0; s <= 161; s++)
  12141. l(K[s])
  12142. }
  12143. function g() {
  12144. c(65498),
  12145. c(12),
  12146. l(3),
  12147. l(1),
  12148. l(0),
  12149. l(2),
  12150. l(17),
  12151. l(3),
  12152. l(17),
  12153. l(0),
  12154. l(63),
  12155. l(0)
  12156. }
  12157. function m(e, t, i, n, r) {
  12158. for (var o, a = r[0], l = r[240], c = 16, u = 63, d = 64, p = h(e, t), f = 0; f < d; ++f)
  12159. L[G[f]] = p[f];
  12160. var g = L[0] - i;
  12161. i = L[0],
  12162. 0 == g ? s(n[0]) : (o = 32767 + g,
  12163. s(n[P[o]]),
  12164. s(R[o]));
  12165. for (var m = 63; m > 0 && 0 == L[m]; m--)
  12166. ;
  12167. if (0 == m)
  12168. return s(a),
  12169. i;
  12170. for (var v, A = 1; A <= m; ) {
  12171. for (var y = A; 0 == L[A] && A <= m; ++A)
  12172. ;
  12173. var C = A - y;
  12174. if (C >= c) {
  12175. v = C >> 4;
  12176. for (var I = 1; I <= v; ++I)
  12177. s(l);
  12178. C &= 15
  12179. }
  12180. o = 32767 + L[A],
  12181. s(r[(C << 4) + P[o]]),
  12182. s(R[o]),
  12183. A++
  12184. }
  12185. return m != u && s(a),
  12186. i
  12187. }
  12188. function v() {
  12189. for (var e = String.fromCharCode, t = 0; t < 256; t++)
  12190. k[t] = e(t)
  12191. }
  12192. function A(e) {
  12193. if (e <= 0 && (e = 1),
  12194. e > 100 && (e = 100),
  12195. w != e) {
  12196. var t = 0;
  12197. t = e < 50 ? Math.floor(5e3 / e) : Math.floor(200 - 2 * e),
  12198. i(t),
  12199. w = e
  12200. }
  12201. }
  12202. function y() {
  12203. var e = (new Date).getTime();
  12204. t || (t = 50),
  12205. v(),
  12206. r(),
  12207. o(),
  12208. a(),
  12209. A(t);
  12210. (new Date).getTime() - e
  12211. }
  12212. var C, I, E, b, w, _ = (Math.round,
  12213. 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];
  12214. this.encode = function(t, i) {
  12215. var n = ((new Date).getTime(),
  12216. i.quality);
  12217. n && A(n),
  12218. D = new Array,
  12219. N = 0,
  12220. B = 7,
  12221. c(65496),
  12222. u(),
  12223. p(),
  12224. d(t.width, t.height),
  12225. f(),
  12226. g();
  12227. var r = 0
  12228. , o = 0
  12229. , a = 0;
  12230. N = 0,
  12231. B = 7,
  12232. this.encode.displayName = "_encode_";
  12233. 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; ) {
  12234. for (l = 0; l < G; ) {
  12235. for (w = G * z + l,
  12236. _ = w,
  12237. T = -1,
  12238. x = 0,
  12239. R = 0; R < 64; R++)
  12240. x = (k ? 63 - R : R) >> 3,
  12241. T = 4 * (7 & R),
  12242. _ = w + x * G + T,
  12243. z + x >= L && (_ -= G * (z + 1 + x - L)),
  12244. l + T >= G && (_ -= l + T - G + 4),
  12245. h = P[_++],
  12246. v = P[_++],
  12247. y = P[_++],
  12248. F[R] = (H[h] + H[v + 256 >> 0] + H[y + 512 >> 0] >> 16) - 128,
  12249. V[R] = (H[h + 768 >> 0] + H[v + 1024 >> 0] + H[y + 1280 >> 0] >> 16) - 128,
  12250. U[R] = (H[h + 1280 >> 0] + H[v + 1536 >> 0] + H[y + 1792 >> 0] >> 16) - 128;
  12251. r = m(F, S, r, C, E),
  12252. o = m(V, M, o, I, b),
  12253. a = m(U, M, a, I, b),
  12254. l += 32
  12255. }
  12256. z += W
  12257. }
  12258. if (B >= 0) {
  12259. var j = [];
  12260. j[1] = B + 1,
  12261. j[0] = (1 << B + 1) - 1,
  12262. s(j)
  12263. }
  12264. return c(65497),
  12265. new e(D)
  12266. }
  12267. ,
  12268. y()
  12269. }
  12270. function n(e, t) {
  12271. t = t || {},
  12272. t.quality = t.quality || 50;
  12273. var n = t.quality
  12274. , r = new i(n)
  12275. , o = r.encode(e, t);
  12276. return {
  12277. data: o,
  12278. width: e.width,
  12279. height: e.height
  12280. }
  12281. }
  12282. t.exports.encode = n
  12283. }
  12284. ).call(this, e("buffer").Buffer)
  12285. }
  12286. , {
  12287. buffer: 198
  12288. }],
  12289. 95: [function(e, t, i) {
  12290. "use strict";
  12291. !function() {
  12292. if ("performance"in window == !1 && (window.performance = {}),
  12293. Date.now = Date.now || function() {
  12294. return (new Date).getTime()
  12295. }
  12296. ,
  12297. "now"in window.performance == !1) {
  12298. var e = Date.now();
  12299. performance.timing && performance.timing.navigationStart && (e = performance.timing.navigationStart),
  12300. window.performance.now = function() {
  12301. return Date.now() - e
  12302. }
  12303. }
  12304. }()
  12305. }
  12306. , {}],
  12307. 96: [function(e, t, i) {
  12308. "use strict";
  12309. var n = e("three");
  12310. n.EffectComposer = function(e, t) {
  12311. if (this.renderer = e,
  12312. void 0 === t) {
  12313. var i = {
  12314. minFilter: n.LinearFilter,
  12315. magFilter: n.LinearFilter,
  12316. format: n.RGBAFormat,
  12317. stencilBuffer: !1
  12318. }
  12319. , r = e.getSize();
  12320. t = new n.WebGLRenderTarget(r.width,r.height,i)
  12321. }
  12322. this.renderTarget1 = t,
  12323. this.renderTarget2 = t.clone(),
  12324. this.writeBuffer = this.renderTarget1,
  12325. this.readBuffer = this.renderTarget2,
  12326. this.passes = [],
  12327. void 0 === n.CopyShader && console.error("THREE.EffectComposer relies on THREE.CopyShader"),
  12328. this.copyPass = new n.ShaderPass(n.CopyShader)
  12329. }
  12330. ,
  12331. n.EffectComposer.prototype = {
  12332. swapBuffers: function() {
  12333. var e = this.readBuffer;
  12334. this.readBuffer = this.writeBuffer,
  12335. this.writeBuffer = e
  12336. },
  12337. addPass: function(e) {
  12338. this.passes.push(e)
  12339. },
  12340. insertPass: function(e, t) {
  12341. this.passes.splice(t, 0, e)
  12342. },
  12343. render: function(e) {
  12344. this.writeBuffer = this.renderTarget1,
  12345. this.readBuffer = this.renderTarget2;
  12346. var t, i, r = !1, o = this.passes.length;
  12347. for (i = 0; i < o; i++)
  12348. if (t = this.passes[i],
  12349. t.enabled) {
  12350. if (t.render(this.renderer, this.writeBuffer, this.readBuffer, e, r),
  12351. t.needsSwap) {
  12352. if (r) {
  12353. var a = this.renderer.context;
  12354. a.stencilFunc(a.NOTEQUAL, 1, 4294967295),
  12355. this.copyPass.render(this.renderer, this.writeBuffer, this.readBuffer, e),
  12356. a.stencilFunc(a.EQUAL, 1, 4294967295)
  12357. }
  12358. this.swapBuffers()
  12359. }
  12360. t instanceof n.MaskPass ? r = !0 : t instanceof n.ClearMaskPass && (r = !1)
  12361. }
  12362. },
  12363. reset: function(e) {
  12364. if (void 0 === e) {
  12365. var t = this.renderer.getSize();
  12366. e = this.renderTarget1.clone(),
  12367. e.setSize(t.width, t.height)
  12368. }
  12369. this.renderTarget1.dispose(),
  12370. this.renderTarget2.dispose(),
  12371. this.renderTarget1 = e,
  12372. this.renderTarget2 = e.clone(),
  12373. this.writeBuffer = this.renderTarget1,
  12374. this.readBuffer = this.renderTarget2
  12375. },
  12376. setSize: function(e, t) {
  12377. this.renderTarget1.setSize(e, t),
  12378. this.renderTarget2.setSize(e, t)
  12379. }
  12380. }
  12381. }
  12382. , {
  12383. three: 217
  12384. }],
  12385. 97: [function(e, t, i) {
  12386. "use strict";
  12387. var n = e("three");
  12388. n.MaskPass = function(e, t) {
  12389. this.scene = e,
  12390. this.camera = t,
  12391. this.enabled = !0,
  12392. this.clear = !0,
  12393. this.needsSwap = !1,
  12394. this.inverse = !1
  12395. }
  12396. ,
  12397. n.MaskPass.prototype = {
  12398. render: function(e, t, i, n) {
  12399. var r = e.context;
  12400. r.colorMask(!1, !1, !1, !1),
  12401. r.depthMask(!1);
  12402. var o, a;
  12403. this.inverse ? (o = 0,
  12404. a = 1) : (o = 1,
  12405. a = 0),
  12406. r.enable(r.STENCIL_TEST),
  12407. r.stencilOp(r.REPLACE, r.REPLACE, r.REPLACE),
  12408. r.stencilFunc(r.ALWAYS, o, 4294967295),
  12409. r.clearStencil(a),
  12410. e.render(this.scene, this.camera, i, this.clear),
  12411. e.render(this.scene, this.camera, t, this.clear),
  12412. r.colorMask(!0, !0, !0, !0),
  12413. r.depthMask(!0),
  12414. r.stencilFunc(r.EQUAL, 1, 4294967295),
  12415. r.stencilOp(r.KEEP, r.KEEP, r.KEEP)
  12416. }
  12417. },
  12418. n.ClearMaskPass = function() {
  12419. this.enabled = !0
  12420. }
  12421. ,
  12422. n.ClearMaskPass.prototype = {
  12423. render: function(e, t, i, n) {
  12424. var r = e.context;
  12425. r.disable(r.STENCIL_TEST)
  12426. }
  12427. }
  12428. }
  12429. , {
  12430. three: 217
  12431. }],
  12432. 98: [function(e, t, i) {
  12433. "use strict";
  12434. var n = e("three");
  12435. n.RenderPass = function(e, t, i, r, o) {
  12436. this.scene = e,
  12437. this.camera = t,
  12438. this.overrideMaterial = i,
  12439. this.clearColor = r,
  12440. this.clearAlpha = void 0 !== o ? o : 1,
  12441. this.oldClearColor = new n.Color,
  12442. this.oldClearAlpha = 1,
  12443. this.enabled = !0,
  12444. this.clear = !0,
  12445. this.needsSwap = !1
  12446. }
  12447. ,
  12448. n.RenderPass.prototype = {
  12449. render: function(e, t, i, n) {
  12450. this.scene.overrideMaterial = this.overrideMaterial,
  12451. this.clearColor && (this.oldClearColor.copy(e.getClearColor()),
  12452. this.oldClearAlpha = e.getClearAlpha(),
  12453. e.setClearColor(this.clearColor, this.clearAlpha)),
  12454. e.render(this.scene, this.camera, i, this.clear),
  12455. this.clearColor && e.setClearColor(this.oldClearColor, this.oldClearAlpha),
  12456. this.scene.overrideMaterial = null
  12457. }
  12458. }
  12459. }
  12460. , {
  12461. three: 217
  12462. }],
  12463. 99: [function(e, t, i) {
  12464. "use strict";
  12465. var n = e("three");
  12466. n.ShaderPass = function(e, t) {
  12467. this.textureID = void 0 !== t ? t : "tDiffuse",
  12468. e instanceof n.ShaderMaterial ? (this.uniforms = e.uniforms,
  12469. this.material = e) : e && (this.uniforms = n.UniformsUtils.clone(e.uniforms),
  12470. this.material = new n.ShaderMaterial({
  12471. defines: e.defines || {},
  12472. uniforms: this.uniforms,
  12473. vertexShader: e.vertexShader,
  12474. fragmentShader: e.fragmentShader
  12475. })),
  12476. this.renderToScreen = !1,
  12477. this.enabled = !0,
  12478. this.needsSwap = !0,
  12479. this.clear = !1,
  12480. this.camera = new n.OrthographicCamera(-1,1,1,-1,0,1),
  12481. this.scene = new n.Scene,
  12482. this.quad = new n.Mesh(new n.PlaneBufferGeometry(2,2),null),
  12483. this.scene.add(this.quad)
  12484. }
  12485. ,
  12486. n.ShaderPass.prototype = {
  12487. render: function(e, t, i, n) {
  12488. this.uniforms[this.textureID] && (this.uniforms[this.textureID].value = i),
  12489. this.quad.material = this.material,
  12490. this.renderToScreen ? e.render(this.scene, this.camera) : e.render(this.scene, this.camera, t, this.clear)
  12491. }
  12492. }
  12493. }
  12494. , {
  12495. three: 217
  12496. }],
  12497. 100: [function(e, t, i) {
  12498. "use strict";
  12499. var n = e("three");
  12500. n.CopyShader = {
  12501. uniforms: {
  12502. tDiffuse: {
  12503. type: "t",
  12504. value: null
  12505. },
  12506. opacity: {
  12507. type: "f",
  12508. value: 1
  12509. }
  12510. },
  12511. vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  12512. fragmentShader: ["uniform float opacity;", "uniform sampler2D tDiffuse;", "varying vec2 vUv;", "void main() {", "vec4 texel = texture2D( tDiffuse, vUv );", "gl_FragColor = opacity * texel;", "}"].join("\n")
  12513. }
  12514. }
  12515. , {
  12516. three: 217
  12517. }],
  12518. 101: [function(e, t, i) {
  12519. "use strict";
  12520. var n = e("three");
  12521. n.HorizontalBlurShader = {
  12522. uniforms: {
  12523. tDiffuse: {
  12524. type: "t",
  12525. value: null
  12526. },
  12527. h: {
  12528. type: "f",
  12529. value: 1 / 512
  12530. }
  12531. },
  12532. vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  12533. 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")
  12534. }
  12535. }
  12536. , {
  12537. three: 217
  12538. }],
  12539. 102: [function(e, t, i) {
  12540. "use strict";
  12541. var n = e("three");
  12542. n.VerticalBlurShader = {
  12543. uniforms: {
  12544. tDiffuse: {
  12545. type: "t",
  12546. value: null
  12547. },
  12548. v: {
  12549. type: "f",
  12550. value: 1 / 512
  12551. }
  12552. },
  12553. vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  12554. 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")
  12555. }
  12556. }
  12557. , {
  12558. three: 217
  12559. }],
  12560. 103: [function(e, t, i) {
  12561. "use strict";
  12562. var n = e("three");
  12563. !function() {
  12564. if ("performance"in window == 0 && (window.performance = {}),
  12565. "now"in window.performance == 0) {
  12566. var e = Date.now();
  12567. performance.timing && performance.timing.navigationStart && (e = performance.timing.navigationStart),
  12568. window.performance.now = function() {
  12569. return Date.now() - e
  12570. }
  12571. }
  12572. }(),
  12573. n.WebGLRenderer.prototype.paramThreeToGL = function(e) {
  12574. var t, i = this.extensions, r = this.context;
  12575. if (e === n.RepeatWrapping)
  12576. return r.REPEAT;
  12577. if (e === n.ClampToEdgeWrapping)
  12578. return r.CLAMP_TO_EDGE;
  12579. if (e === n.MirroredRepeatWrapping)
  12580. return r.MIRRORED_REPEAT;
  12581. if (e === n.NearestFilter)
  12582. return r.NEAREST;
  12583. if (e === n.NearestMipMapNearestFilter)
  12584. return r.NEAREST_MIPMAP_NEAREST;
  12585. if (e === n.NearestMipMapLinearFilter)
  12586. return r.NEAREST_MIPMAP_LINEAR;
  12587. if (e === n.LinearFilter)
  12588. return r.LINEAR;
  12589. if (e === n.LinearMipMapNearestFilter)
  12590. return r.LINEAR_MIPMAP_NEAREST;
  12591. if (e === n.LinearMipMapLinearFilter)
  12592. return r.LINEAR_MIPMAP_LINEAR;
  12593. if (e === n.UnsignedByteType)
  12594. return r.UNSIGNED_BYTE;
  12595. if (e === n.UnsignedShort4444Type)
  12596. return r.UNSIGNED_SHORT_4_4_4_4;
  12597. if (e === n.UnsignedShort5551Type)
  12598. return r.UNSIGNED_SHORT_5_5_5_1;
  12599. if (e === n.UnsignedShort565Type)
  12600. return r.UNSIGNED_SHORT_5_6_5;
  12601. if (e === n.ByteType)
  12602. return r.BYTE;
  12603. if (e === n.ShortType)
  12604. return r.SHORT;
  12605. if (e === n.UnsignedShortType)
  12606. return r.UNSIGNED_SHORT;
  12607. if (e === n.IntType)
  12608. return r.INT;
  12609. if (e === n.UnsignedIntType)
  12610. return r.UNSIGNED_INT;
  12611. if (e === n.FloatType)
  12612. return r.FLOAT;
  12613. if (t = i.get("OES_texture_half_float"),
  12614. null !== t && e === n.HalfFloatType)
  12615. return t.HALF_FLOAT_OES;
  12616. if (e === n.AlphaFormat)
  12617. return r.ALPHA;
  12618. if (e === n.RGBFormat)
  12619. return r.RGB;
  12620. if (e === n.RGBAFormat)
  12621. return r.RGBA;
  12622. if (e === n.LuminanceFormat)
  12623. return r.LUMINANCE;
  12624. if (e === n.LuminanceAlphaFormat)
  12625. return r.LUMINANCE_ALPHA;
  12626. if (e === n.AddEquation)
  12627. return r.FUNC_ADD;
  12628. if (e === n.SubtractEquation)
  12629. return r.FUNC_SUBTRACT;
  12630. if (e === n.ReverseSubtractEquation)
  12631. return r.FUNC_REVERSE_SUBTRACT;
  12632. if (e === n.ZeroFactor)
  12633. return r.ZERO;
  12634. if (e === n.OneFactor)
  12635. return r.ONE;
  12636. if (e === n.SrcColorFactor)
  12637. return r.SRC_COLOR;
  12638. if (e === n.OneMinusSrcColorFactor)
  12639. return r.ONE_MINUS_SRC_COLOR;
  12640. if (e === n.SrcAlphaFactor)
  12641. return r.SRC_ALPHA;
  12642. if (e === n.OneMinusSrcAlphaFactor)
  12643. return r.ONE_MINUS_SRC_ALPHA;
  12644. if (e === n.DstAlphaFactor)
  12645. return r.DST_ALPHA;
  12646. if (e === n.OneMinusDstAlphaFactor)
  12647. return r.ONE_MINUS_DST_ALPHA;
  12648. if (e === n.DstColorFactor)
  12649. return r.DST_COLOR;
  12650. if (e === n.OneMinusDstColorFactor)
  12651. return r.ONE_MINUS_DST_COLOR;
  12652. if (e === n.SrcAlphaSaturateFactor)
  12653. return r.SRC_ALPHA_SATURATE;
  12654. if (t = i.get("WEBGL_compressed_texture_s3tc"),
  12655. null !== t) {
  12656. if (e === n.RGB_S3TC_DXT1_Format)
  12657. return t.COMPRESSED_RGB_S3TC_DXT1_EXT;
  12658. if (e === n.RGBA_S3TC_DXT1_Format)
  12659. return t.COMPRESSED_RGBA_S3TC_DXT1_EXT;
  12660. if (e === n.RGBA_S3TC_DXT3_Format)
  12661. return t.COMPRESSED_RGBA_S3TC_DXT3_EXT;
  12662. if (e === n.RGBA_S3TC_DXT5_Format)
  12663. return t.COMPRESSED_RGBA_S3TC_DXT5_EXT
  12664. }
  12665. if (t = i.get("WEBGL_compressed_texture_pvrtc"),
  12666. null !== t) {
  12667. if (e === n.RGB_PVRTC_4BPPV1_Format)
  12668. return t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;
  12669. if (e === n.RGB_PVRTC_2BPPV1_Format)
  12670. return t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;
  12671. if (e === n.RGBA_PVRTC_4BPPV1_Format)
  12672. return t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;
  12673. if (e === n.RGBA_PVRTC_2BPPV1_Format)
  12674. return t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG
  12675. }
  12676. if (t = i.get("WEBGL_compressed_texture_etc1"),
  12677. null !== t && e === n.RGB_ETC1_Format)
  12678. return t.COMPRESSED_RGB_ETC1_WEBGL;
  12679. if (t = i.get("EXT_blend_minmax"),
  12680. null !== t) {
  12681. if (e === n.MinEquation)
  12682. return t.MIN_EXT;
  12683. if (e === n.MaxEquation)
  12684. return t.MAX_EXT
  12685. }
  12686. return 0
  12687. }
  12688. ,
  12689. n.WebGLState = function(e, t, i) {
  12690. var r = this
  12691. , o = new n.Vector4
  12692. , a = e.getParameter(e.MAX_VERTEX_ATTRIBS)
  12693. , s = new Uint8Array(a)
  12694. , l = new Uint8Array(a)
  12695. , c = new Uint8Array(a)
  12696. , h = {}
  12697. , u = null
  12698. , d = null
  12699. , p = null
  12700. , f = null
  12701. , g = null
  12702. , m = null
  12703. , v = null
  12704. , A = null
  12705. , y = !1
  12706. , C = null
  12707. , I = null
  12708. , E = null
  12709. , b = null
  12710. , w = null
  12711. , _ = null
  12712. , T = null
  12713. , x = null
  12714. , S = null
  12715. , M = null
  12716. , R = null
  12717. , P = null
  12718. , O = null
  12719. , L = null
  12720. , D = null
  12721. , N = e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS)
  12722. , B = void 0
  12723. , F = {}
  12724. , V = new n.Vector4
  12725. , U = null
  12726. , k = null
  12727. , H = new n.Vector4
  12728. , G = new n.Vector4;
  12729. this.init = function() {
  12730. this.clearColor(0, 0, 0, 1),
  12731. this.clearDepth(1),
  12732. this.clearStencil(0),
  12733. this.enable(e.DEPTH_TEST),
  12734. e.depthFunc(e.LEQUAL),
  12735. e.frontFace(e.CCW),
  12736. e.cullFace(e.BACK),
  12737. this.enable(e.CULL_FACE),
  12738. this.enable(e.BLEND),
  12739. e.blendEquation(e.FUNC_ADD),
  12740. e.blendFunc(e.SRC_ALPHA, e.ONE_MINUS_SRC_ALPHA)
  12741. }
  12742. ,
  12743. this.initAttributes = function() {
  12744. for (var e = 0, t = s.length; e < t; e++)
  12745. s[e] = 0
  12746. }
  12747. ,
  12748. this.enableAttribute = function(i) {
  12749. if (s[i] = 1,
  12750. 0 === l[i] && (e.enableVertexAttribArray(i),
  12751. l[i] = 1),
  12752. 0 !== c[i]) {
  12753. var n = t.get("ANGLE_instanced_arrays");
  12754. n.vertexAttribDivisorANGLE(i, 0),
  12755. c[i] = 0
  12756. }
  12757. }
  12758. ,
  12759. this.enableAttributeAndDivisor = function(t, i, n) {
  12760. s[t] = 1,
  12761. 0 === l[t] && (e.enableVertexAttribArray(t),
  12762. l[t] = 1),
  12763. c[t] !== i && (n.vertexAttribDivisorANGLE(t, i),
  12764. c[t] = i)
  12765. }
  12766. ,
  12767. this.disableUnusedAttributes = function() {
  12768. for (var t = 0, i = l.length; t < i; t++)
  12769. l[t] !== s[t] && (e.disableVertexAttribArray(t),
  12770. l[t] = 0)
  12771. }
  12772. ,
  12773. this.enable = function(t) {
  12774. h[t] !== !0 && (e.enable(t),
  12775. h[t] = !0)
  12776. }
  12777. ,
  12778. this.disable = function(t) {
  12779. h[t] !== !1 && (e.disable(t),
  12780. h[t] = !1)
  12781. }
  12782. ,
  12783. this.getCompressedTextureFormats = function() {
  12784. if (null === u && (u = [],
  12785. t.get("WEBGL_compressed_texture_pvrtc") || t.get("WEBGL_compressed_texture_s3tc") || t.get("WEBGL_compressed_texture_etc1")))
  12786. for (var i = e.getParameter(e.COMPRESSED_TEXTURE_FORMATS), n = 0; n < i.length; n++)
  12787. u.push(i[n]);
  12788. return u
  12789. }
  12790. ,
  12791. this.setBlending = function(t, r, o, a, s, l, c, h) {
  12792. t === n.NoBlending ? this.disable(e.BLEND) : this.enable(e.BLEND),
  12793. t === d && h === y || (t === n.AdditiveBlending ? h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  12794. e.blendFuncSeparate(e.ONE, e.ONE, e.ONE, e.ONE)) : (e.blendEquation(e.FUNC_ADD),
  12795. e.blendFunc(e.SRC_ALPHA, e.ONE)) : t === n.SubtractiveBlending ? h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  12796. e.blendFuncSeparate(e.ZERO, e.ZERO, e.ONE_MINUS_SRC_COLOR, e.ONE_MINUS_SRC_ALPHA)) : (e.blendEquation(e.FUNC_ADD),
  12797. e.blendFunc(e.ZERO, e.ONE_MINUS_SRC_COLOR)) : t === n.MultiplyBlending ? h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  12798. e.blendFuncSeparate(e.ZERO, e.ZERO, e.SRC_COLOR, e.SRC_ALPHA)) : (e.blendEquation(e.FUNC_ADD),
  12799. e.blendFunc(e.ZERO, e.SRC_COLOR)) : h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  12800. e.blendFuncSeparate(e.ONE, e.ONE_MINUS_SRC_ALPHA, e.ONE, e.ONE_MINUS_SRC_ALPHA)) : (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  12801. e.blendFuncSeparate(e.SRC_ALPHA, e.ONE_MINUS_SRC_ALPHA, e.ONE, e.ONE_MINUS_SRC_ALPHA)),
  12802. d = t,
  12803. y = h),
  12804. t === n.CustomBlending ? (s = s || r,
  12805. l = l || o,
  12806. c = c || a,
  12807. r === p && s === m || (e.blendEquationSeparate(i(r), i(s)),
  12808. p = r,
  12809. m = s),
  12810. o === f && a === g && l === v && c === A || (e.blendFuncSeparate(i(o), i(a), i(l), i(c)),
  12811. f = o,
  12812. g = a,
  12813. v = l,
  12814. A = c)) : (p = null,
  12815. f = null,
  12816. g = null,
  12817. m = null,
  12818. v = null,
  12819. A = null)
  12820. }
  12821. ,
  12822. this.setDepthFunc = function(t) {
  12823. if (C !== t) {
  12824. if (t)
  12825. switch (t) {
  12826. case n.NeverDepth:
  12827. e.depthFunc(e.NEVER);
  12828. break;
  12829. case n.AlwaysDepth:
  12830. e.depthFunc(e.ALWAYS);
  12831. break;
  12832. case n.LessDepth:
  12833. e.depthFunc(e.LESS);
  12834. break;
  12835. case n.LessEqualDepth:
  12836. e.depthFunc(e.LEQUAL);
  12837. break;
  12838. case n.EqualDepth:
  12839. e.depthFunc(e.EQUAL);
  12840. break;
  12841. case n.GreaterEqualDepth:
  12842. e.depthFunc(e.GEQUAL);
  12843. break;
  12844. case n.GreaterDepth:
  12845. e.depthFunc(e.GREATER);
  12846. break;
  12847. case n.NotEqualDepth:
  12848. e.depthFunc(e.NOTEQUAL);
  12849. break;
  12850. default:
  12851. e.depthFunc(e.LEQUAL)
  12852. }
  12853. else
  12854. e.depthFunc(e.LEQUAL);
  12855. C = t
  12856. }
  12857. }
  12858. ,
  12859. this.setDepthTest = function(t) {
  12860. t ? this.enable(e.DEPTH_TEST) : this.disable(e.DEPTH_TEST)
  12861. }
  12862. ,
  12863. this.setDepthWrite = function(t) {
  12864. I !== t && (e.depthMask(t),
  12865. I = t)
  12866. }
  12867. ,
  12868. this.setColorWrite = function(t) {
  12869. E !== t && (e.colorMask(t, t, t, t),
  12870. E = t)
  12871. }
  12872. ,
  12873. this.setStencilFunc = function(t, i, n) {
  12874. w === t && _ === i && T === n || (e.stencilFunc(t, i, n),
  12875. w = t,
  12876. _ = i,
  12877. T = n)
  12878. }
  12879. ,
  12880. this.setStencilOp = function(t, i, n) {
  12881. x === t && S === i && M === n || (e.stencilOp(t, i, n),
  12882. x = t,
  12883. S = i,
  12884. M = n)
  12885. }
  12886. ,
  12887. this.setStencilTest = function(t) {
  12888. t ? this.enable(e.STENCIL_TEST) : this.disable(e.STENCIL_TEST)
  12889. }
  12890. ,
  12891. this.setStencilWrite = function(t) {
  12892. b !== t && (e.stencilMask(t),
  12893. b = t)
  12894. }
  12895. ,
  12896. this.setFlipSided = function(t) {
  12897. R !== t && (t ? e.frontFace(e.CW) : e.frontFace(e.CCW),
  12898. R = t)
  12899. }
  12900. ,
  12901. this.setLineWidth = function(t) {
  12902. t !== P && (e.lineWidth(t),
  12903. P = t)
  12904. }
  12905. ,
  12906. this.setPolygonOffset = function(t, i, n) {
  12907. t ? this.enable(e.POLYGON_OFFSET_FILL) : this.disable(e.POLYGON_OFFSET_FILL),
  12908. !t || O === i && L === n || (e.polygonOffset(i, n),
  12909. O = i,
  12910. L = n)
  12911. }
  12912. ,
  12913. this.getScissorTest = function() {
  12914. return D
  12915. }
  12916. ,
  12917. this.setScissorTest = function(t) {
  12918. D = t,
  12919. t ? this.enable(e.SCISSOR_TEST) : this.disable(e.SCISSOR_TEST)
  12920. }
  12921. ,
  12922. this.activeTexture = function(t) {
  12923. void 0 === t && (t = e.TEXTURE0 + N - 1),
  12924. B !== t && (e.activeTexture(t),
  12925. B = t)
  12926. }
  12927. ,
  12928. this.bindTexture = function(t, i) {
  12929. void 0 === B && r.activeTexture();
  12930. var n = F[B];
  12931. void 0 === n && (n = {
  12932. type: void 0,
  12933. texture: void 0
  12934. },
  12935. F[B] = n),
  12936. n.type === t && n.texture === i || (e.bindTexture(t, i),
  12937. n.type = t,
  12938. n.texture = i)
  12939. }
  12940. ,
  12941. this.compressedTexImage2D = function() {
  12942. try {
  12943. e.compressedTexImage2D.apply(e, arguments)
  12944. } catch (e) {
  12945. console.error(e)
  12946. }
  12947. }
  12948. ,
  12949. this.texImage2D = function() {
  12950. try {
  12951. e.texImage2D.apply(e, arguments)
  12952. } catch (e) {
  12953. console.error(e)
  12954. }
  12955. }
  12956. ,
  12957. this.clearColor = function(t, i, n, r) {
  12958. o.set(t, i, n, r),
  12959. V.equals(o) === !1 && (e.clearColor(t, i, n, r),
  12960. V.copy(o))
  12961. }
  12962. ,
  12963. this.clearDepth = function(t) {
  12964. U !== t && (e.clearDepth(t),
  12965. U = t)
  12966. }
  12967. ,
  12968. this.clearStencil = function(t) {
  12969. k !== t && (e.clearStencil(t),
  12970. k = t)
  12971. }
  12972. ,
  12973. this.scissor = function(t) {
  12974. H.equals(t) === !1 && (e.scissor(t.x, t.y, t.z, t.w),
  12975. H.copy(t))
  12976. }
  12977. ,
  12978. this.viewport = function(t) {
  12979. G.equals(t) === !1 && (e.viewport(t.x, t.y, t.z, t.w),
  12980. G.copy(t))
  12981. }
  12982. ,
  12983. this.reset = function() {
  12984. for (var t = 0; t < l.length; t++)
  12985. 1 === l[t] && (e.disableVertexAttribArray(t),
  12986. l[t] = 0);
  12987. h = {},
  12988. u = null,
  12989. B = void 0,
  12990. F = {},
  12991. d = null,
  12992. E = null,
  12993. I = null,
  12994. b = null,
  12995. R = null
  12996. }
  12997. }
  12998. }
  12999. , {
  13000. three: 217
  13001. }],
  13002. 104: [function(e, t, i) {
  13003. (function(i, n) {
  13004. "use strict";
  13005. function r(e) {
  13006. this.urls = e;
  13007. var t = i("bWVzc2FnZSBiaW5hcnlfbWVzaCB7CglyZXBlYXRlZCBjaHVua19zaW1wbGUgY2h1bmsgPSAxOwoJcmVwZWF0ZWQgY2h1bmtfcXVhbnRpemVkIHF1YW50aXplZF9jaHVuayA9IDI7Cn0KCi8vIERlZmluaXRpb24gb2YgdmVydGljZXM6IDNEIGNvb3JkaW5hdGVzLCBhbmQgMkQgdGV4dHVyZSBjb29yZGluYXRlcy4KbWVzc2FnZSB2ZXJ0aWNlc19zaW1wbGUgewoJcmVwZWF0ZWQgZmxvYXQgeHl6ID0gMSBbcGFja2VkPXRydWVdOyAgLy8geF8wLHlfMCx6XzAsIHhfMSx5XzEsel8xLCAuLi4KCXJlcGVhdGVkIGZsb2F0IHV2ID0gMiBbcGFja2VkPXRydWVdOyAgLy8gdV8wLHZfMCwgdV8xLHZfMSwgLi4uCn0KCi8vIEluZGV4ZXMgb2YgdmVydGljZXMgb2YgZmFjZXMKbWVzc2FnZSBmYWNlc19zaW1wbGUgewoJcmVwZWF0ZWQgdWludDMyIGZhY2VzID0gMSBbcGFja2VkPXRydWVdOyAvLyBpMDAsaTAxLGkwMiwgaTEwLGkxMSxpMTIsIC4uLgp9CgovLyBBIHNpbXBseSBlbmNvZGVkIGNodW5rLgovLyBUT0RPOiBhZGQgY2h1bmsgcHJvcGVyaXRlcyAoc3VjaCBhcyAicmVmbGVjdGl2ZSIpCm1lc3NhZ2UgY2h1bmtfc2ltcGxlIHsKCW9wdGlvbmFsIHZlcnRpY2VzX3NpbXBsZSB2ZXJ0aWNlcyA9IDE7CglvcHRpb25hbCBmYWNlc19zaW1wbGUgZmFjZXMgPSAyOwoJb3B0aW9uYWwgc3RyaW5nIGNodW5rX25hbWUgPSAzOwoJb3B0aW9uYWwgc3RyaW5nIG1hdGVyaWFsX25hbWUgPSA0Owp9CgovLyBRdWFudGl6ZWQgdmVyc2lvbnMgZm9sbG93OgptZXNzYWdlIHZlcnRpY2VzX3F1YW50aXplZCB7CglvcHRpb25hbCBmbG9hdCBxdWFudGl6YXRpb24gPSAxOwoJcmVwZWF0ZWQgZmxvYXQgdHJhbnNsYXRpb24gPSAyOwoJcmVwZWF0ZWQgc2ludDMyIHggPSAzIFtwYWNrZWQ9dHJ1ZV07CglyZXBlYXRlZCBzaW50MzIgeSA9IDQgW3BhY2tlZD10cnVlXTsKCXJlcGVhdGVkIHNpbnQzMiB6ID0gNSBbcGFja2VkPXRydWVdOwp9CgptZXNzYWdlIHV2X3F1YW50aXplZCB7CglvcHRpb25hbCBzdHJpbmcgbmFtZSA9IDE7CglvcHRpb25hbCBmbG9hdCBxdWFudGl6YXRpb24gPSAyOwoJcmVwZWF0ZWQgc2ludDMyIHUgPSAzIFtwYWNrZWQ9dHJ1ZV07CglyZXBlYXRlZCBzaW50MzIgdiA9IDQgW3BhY2tlZD10cnVlXTsKfQoKLy8gSW5kZXhlcyBvZiB2ZXJ0aWNlcyBvZiBmYWNlcwptZXNzYWdlIGZhY2VzX2NvbXByZXNzZWQgewoJcmVwZWF0ZWQgc2ludDMyIGZhY2VzID0gMSBbcGFja2VkPXRydWVdOyAvLyBpMDAsaTAxLGkwMiwgaTEwLGkxMSxpMTIsIC4uLgp9CgptZXNzYWdlIGNodW5rX3F1YW50aXplZCB7CglvcHRpb25hbCBzdHJpbmcgY2h1bmtfbmFtZSA9IDE7CglvcHRpb25hbCBzdHJpbmcgbWF0ZXJpYWxfbmFtZSA9IDI7CglvcHRpb25hbCB2ZXJ0aWNlc19xdWFudGl6ZWQgdmVydGljZXMgPSAzOwoJcmVwZWF0ZWQgdXZfcXVhbnRpemVkIHV2cyA9IDQ7CglvcHRpb25hbCBmYWNlc19zaW1wbGUgZmFjZXMgPSA1Owp9Cg==", "base64");
  13008. this.builder = a.loadProto(t),
  13009. this.decoder = this.builder.build("binary_mesh")
  13010. }
  13011. var o = e("three")
  13012. , a = e("protobufjs")
  13013. , s = e("../util/logger")
  13014. , l = (e("../util/common"),
  13015. e("../util/ajax"))
  13016. , c = e("../objects/Chunk")
  13017. , h = new s(n);
  13018. r.prototype = {
  13019. constructor: r,
  13020. load: function(e, t, i, n) {
  13021. return h.time("download"),
  13022. l.get(e, {
  13023. responseType: "arraybuffer"
  13024. }).done(function(r) {
  13025. h.timeEnd("download"),
  13026. this.parse(r, e, t, i, n)
  13027. }
  13028. .bind(this)).fail(n)
  13029. },
  13030. parse: function(e, t, i, n, r) {
  13031. var o = this.readProtobuf(e);
  13032. if (!o)
  13033. return r();
  13034. try {
  13035. h.time("convert to webgl"),
  13036. this.convertProtobufToSceneObject(o, t, i, n, r),
  13037. h.timeEnd("convert to webgl")
  13038. } catch (e) {
  13039. return h.error("failed parsing .dam"),
  13040. h.error(e.message),
  13041. r()
  13042. }
  13043. },
  13044. readProtobuf: function(e) {
  13045. var t;
  13046. try {
  13047. h.time("parse proto"),
  13048. t = this.decoder.decode(e),
  13049. h.timeEnd("parse proto")
  13050. } catch (e) {
  13051. return h.error("failed parsing proto for .dam"),
  13052. h.error(e.message),
  13053. null
  13054. }
  13055. return t
  13056. },
  13057. convertProtobufToSceneObject: function(e, t, i, n, r) {
  13058. function a(e) {
  13059. var i = new o.BufferGeometry;
  13060. return i.addAttribute("position", new o.BufferAttribute(new Float32Array(e.vertices.xyz,0,3),3)),
  13061. e.vertices.uv.length > 0 && i.addAttribute("uv", new o.BufferAttribute(new Float32Array(e.vertices.uv,0,2),2)),
  13062. i.setIndex(new o.BufferAttribute(new Uint32Array(e.faces.faces,0,1),1)),
  13063. i.applyMatrix(s),
  13064. i.computeBoundingBox(),
  13065. new c({
  13066. geometry: i,
  13067. textureName: e.material_name,
  13068. name: e.chunk_name,
  13069. meshUrl: t
  13070. })
  13071. }
  13072. if (0 === e.chunk.length)
  13073. return h.warn("No chunks in damfile..."),
  13074. i([]);
  13075. var s = new o.Matrix4;
  13076. s.set(1, 0, 0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1);
  13077. var l = e.chunk.map(a);
  13078. return l ? i(l) : (h.error(".dam protobuf came out with no chunks..."),
  13079. r())
  13080. }
  13081. },
  13082. t.exports = r
  13083. }
  13084. ).call(this, e("buffer").Buffer, "/js/loaders/DamLoader.js")
  13085. }
  13086. , {
  13087. "../objects/Chunk": 144,
  13088. "../util/ajax": 181,
  13089. "../util/common": 185,
  13090. "../util/logger": 189,
  13091. buffer: 198,
  13092. protobufjs: 214,
  13093. three: 217
  13094. }],
  13095. 105: [function(e, t, i) {
  13096. (function(i) {
  13097. "use strict";
  13098. var n = (e("three"),
  13099. e("../settings"),
  13100. e("../util/browser"),
  13101. e("./DamLoader"))
  13102. , r = e("../util/logger")
  13103. , o = (e("../ab"),
  13104. new r(i));
  13105. t.exports = {
  13106. getLoaders: function() {
  13107. return [["_50k", ".dam", n], ["", ".dam", n]]
  13108. },
  13109. load: function(e, t, i, n, r, a) {
  13110. var s = this.getLoaders();
  13111. a = a || 0;
  13112. var l = s[a];
  13113. if (!l)
  13114. return void (r && r("No suitable model file found..."));
  13115. var c = l[0]
  13116. , h = l[1]
  13117. , u = new l[2](t)
  13118. , d = t.get(e + c + h);
  13119. d ? (o.debug("Trying " + c + h),
  13120. u.load(d, i, n, function() {
  13121. this.load(e, t, i, n, r, ++a)
  13122. }
  13123. .bind(this))) : (o.debug("Skipping " + h + ", not available"),
  13124. this.load(e, t, i, n, r, ++a))
  13125. }
  13126. }
  13127. }
  13128. ).call(this, "/js/loaders/ModelLoader.js")
  13129. }
  13130. , {
  13131. "../ab": 3,
  13132. "../settings": 166,
  13133. "../util/browser": 182,
  13134. "../util/logger": 189,
  13135. "./DamLoader": 104,
  13136. three: 217
  13137. }],
  13138. 106: [function(e, t, i) {
  13139. (function(i) {
  13140. "use strict";
  13141. var n = e("../util/common")
  13142. , r = e("../util/texture")
  13143. , o = e("../util/browser")
  13144. , a = e("../util/logger")
  13145. , s = e("../settings")
  13146. , l = new a(i);
  13147. t.exports = {
  13148. load: function(e, t) {
  13149. function i(e, i) {
  13150. e || (t.push(i),
  13151. p++,
  13152. d.notify(p, a),
  13153. p === a && d.resolve())
  13154. }
  13155. if (!e.chunks[0] || !e.chunks[0].meshUrl)
  13156. return $.when();
  13157. var a = n.countUnique(e.chunks.map(function(e) {
  13158. return e.textureName
  13159. }))
  13160. , c = e.chunks[0].meshUrl.indexOf("_50k") !== -1 ? "_50k" : ""
  13161. , h = "_50k" === c ? "high" : "low";
  13162. s.minimalMemoryMode && "high" === h && (o.detectSamsungS6() ? (l.warn("Galaxy S6 cannot handle large textures, turning down quality."),
  13163. h = "low") : a > s.maxMobileTextures && (l.warn("Model probably too large for mobile, turning down quality."),
  13164. h = "low"));
  13165. var u = e.data.job.uuid + c + "_texture_jpg_" + h + "/"
  13166. , d = $.Deferred()
  13167. , p = 0;
  13168. return e.chunks.forEach(function(t) {
  13169. if (!t.material.map && t.textureName) {
  13170. var n = e.urls.get(u + t.textureName);
  13171. t.setTextureMap(r.load(n, i.bind(this, r.isLoaded(n))))
  13172. }
  13173. }),
  13174. d.promise()
  13175. }
  13176. }
  13177. }
  13178. ).call(this, "/js/loaders/ModelTextureLoader.js")
  13179. }
  13180. , {
  13181. "../settings": 166,
  13182. "../util/browser": 182,
  13183. "../util/common": 185,
  13184. "../util/logger": 189,
  13185. "../util/texture": 194
  13186. }],
  13187. 107: [function(e, t, i) {
  13188. (function(i, n) {
  13189. "use strict";
  13190. function r(e) {
  13191. this.model = e,
  13192. this.modelDataPath = this.model.urls.get("vision.modeldata")+"?m="+new Date().getTime(),
  13193. this.sweepLocationsPath = this.model.urls.get("sweep_locations.csv");
  13194. var t = i("Ly8gUHJvdG9jb2wgQnVmZmVyIGZvciBwdWNrIHZpc2liaWxpdHkgYW5kIHJlbGF0ZWQgZGF0YQovLwovLyBUbyBkdW1wIG91dCBhIGJpbnJheSBtYW5pZmVzdCBpbiB0ZXh0IGZvcm1hdCwgeW91IGNhbiB1c2UgcHJvdG9jIGRpcmVjdGx5OgovLyAgIHByb3RvYyAtLXByb3RvX3BhdGggfi9kZXYvbXBfdmlzaW9uLyAgLS1kZWNvZGU9ZW9zLnN0b3JhZ2UuVmlzaW9uTW9kZWxkYXRhIH4vZGV2L21wX3Zpc2lvbi9lb3Mvc3RvcmFnZS92aXNpb25fbW9kZWxkYXRhLnByb3RvIDwgdmlzaW9uLm1vZGVsZGF0YQoKLy8gcGFja2FnZSBlb3Muc3RvcmFnZTsKCi8vIGltcG9ydCAiZW9zL2luZnJhL2NvbW1vbi5wcm90byI7Ci8vIFRoZSBmb2xsb3dpbmcgd2VyZSBtYW51YWxseSBleHRyYWN0ZWQgaGVyZSwgSlMgZG9lcyBub3QgbGlrZSBwcm90b2J1ZiBpbXBvcnRzCgptZXNzYWdlIEFmZmluZTNmIHsKCW9wdGlvbmFsIFF1YXRlcm5pb25mIHJvdGF0aW9uID0gMTsKCW9wdGlvbmFsIFZlY3RvcjNmIHRyYW5zbGF0aW9uID0gMjsKfQoKbWVzc2FnZSBRdWF0ZXJuaW9uZiB7CglvcHRpb25hbCBmbG9hdCB3ID0gMTsKCW9wdGlvbmFsIGZsb2F0IHggPSAyOwoJb3B0aW9uYWwgZmxvYXQgeSA9IDM7CglvcHRpb25hbCBmbG9hdCB6ID0gNDsKfQoKbWVzc2FnZSBWZWN0b3IzZiB7CglvcHRpb25hbCBmbG9hdCB4ID0gMTsKCW9wdGlvbmFsIGZsb2F0IHkgPSAyOwoJb3B0aW9uYWwgZmxvYXQgeiA9IDM7Cn0KCi8vCi8vIE9uZSBzd2VlcCAvIHBhbm8KLy8KbWVzc2FnZSBTd2VlcExvY2F0aW9uIHsKCW9wdGlvbmFsIGJ5dGVzIHV1aWQgPSAxOyAgLyogdXVpZCAqLwoJb3B0aW9uYWwgQWZmaW5lM2YgcG9zZSA9IDI7ICAvKiBjYW1lcmEgcG9zZSAoeCwgeSx6KSBpbiBtZXRlciBhbmQgYSBxdWF0ZXJuaW9uKi8KCW9wdGlvbmFsIFZlY3RvcjNmIHB1Y2sgPSAzOyAgLyogcHVjayBsb2NhdGlvbiAtIHggYW55IGlzIGdlbmVyYWxseSB0aGUgc2FtZSBhcyBwb3NlLCB6IGlzIHRoZSBoZWlnaHQgb2YgdGhlIGNsb3Nlc3QgZmxvb3IgdW5kZXIgdGhlIGNhbWVyYSAqLwoJb3B0aW9uYWwgaW50MzIgZ3JvdXAgPSA0OyAgLyogZmxvb3IgaW5kZXggKi8KCW9wdGlvbmFsIGludDMyIHN1Ymdyb3VwID0gNTsgIC8qIHJvb20gaW5kZXggKi8KCXJlcGVhdGVkIGludDMyIHZpc2libGVzID0gNjsgIC8qIGxpc3Qgb2YgaW5kaWNlcyB0byBhbGwgcHVja3MgdmlzaWJsZSBmcm9tIHRoaXMgcHVjayAqLwoJcmVwZWF0ZWQgZmxvYXQgc2NvcmVzID0gNzsgLyogdXNlZCBhcyBwYXJ0IG9mIHNjb3JpbmcgZnVuY3Rpb24gZm9yIGRldGVybWluaW5nIHdoaWNoIHB1Y2sgdG8gZ28gdG8gbmV4dCAqLwogIG9wdGlvbmFsIHN0cmluZyBzd2VlcF9uYW1lID0gODsKCiAgLy8gV2l0aCBvdXRkb29yIHBhbm9zLCB3ZSBoYXZlIGEgY291cGxlIG9mIGRpZmZlcmVudCBzaXR1YXRpb25zIGZvciBhbGlnbm1lbnQuIFRoZSBjb21tb24KICAvLyBjYXNlIGlzIHRoYXQgdGhlIHBhbm8gYWxpZ25lZCBub3JtYWxseS4gSXQgY291bGQgYWxzbyBoYXZlIGJlZW4gcGxhY2VkIG1hbnVhbGx5IGluCiAgLy8gQ2FwdHVyZUFwcCBvciBXb3Jrc2hvcCwgb3IgbGVmdCB1bmFsaWduZWQgZm9yIGhpZ2hsaWdodC1yZWVsIHZpZXdpbmcuCiAgZW51bSBBbGlnbm1lbnRUeXBlCiAgewogICAgICBVTktOT1dOID0gMDsKICAgICAgQUxJR05FRCA9IDE7CiAgICAgIFVOQUxJR05FRCA9IDI7CiAgICAgIE1BTlVBTExZX1BMQUNFRCA9IDM7CiAgfQogIG9wdGlvbmFsIEFsaWdubWVudFR5cGUgYWxpZ25tZW50X3R5cGUgPSA5IFtkZWZhdWx0ID0gQUxJR05FRF07Cn0KCm1lc3NhZ2UgU3ViZ3JvdXBJbmZvIHsKCW9wdGlvbmFsIGludDMyIHN1Ymdyb3VwID0gMTsKCW9wdGlvbmFsIGZsb2F0IGFyZWEgPSAyOyAvKiBmbG9vciBhcmVhIGluIG1eMiAoc3F1YXJlIG1ldGVyYWdlKSAqLwp9CgovKiBBbGwgcHVja3MgaW4gYSBtb2RlbC4gUHVja3MgYXJlIHN0b3JlZCBpbiBzY2FubmluZyBvcmRlci4gKi8KbWVzc2FnZSBWaXNpb25Nb2RlbGRhdGEgewoJcmVwZWF0ZWQgU3dlZXBMb2NhdGlvbiBzd2VlcExvY2F0aW9ucyA9IDE7CglyZXBlYXRlZCBTdWJncm91cEluZm8gc3ViZ3JvdXBJbmZvcyA9IDI7Cn0K", "base64")
  13195. , n = o.loadProto(t);
  13196. this.decoder = n.build("VisionModeldata")
  13197. }
  13198. var o = e("protobufjs")
  13199. , a = e("../util/ajax")
  13200. , s = (e("../util/common"),
  13201. e("../util/math"))
  13202. , l = e("../util/logger")
  13203. , c = new l(n);
  13204. r.prototype.load = function() {
  13205. return this.modelDataPath ? (c.info("Using vision.modeldata"),
  13206. this.loadVisionModelData()) : this.sweepLocationsPath ? (c.warn("Using sweep_locations.csv"),
  13207. this.loadSweepLocationsCSV()) : (c.warn("No sweep file found"),
  13208. $.when([]))
  13209. }
  13210. ,
  13211. r.prototype.loadVisionModelData = function() {
  13212. return a.get(this.modelDataPath, {
  13213. responseType: "arraybuffer"
  13214. }).then(function(e) {
  13215. var t;
  13216. try {
  13217. t = this.decoder.decode(e)
  13218. } catch (e) {
  13219. return c.warn("Could not decode vision.modeldata, trying sweep_locations.csv"),
  13220. this.loadSweepLocationsCSV()
  13221. }
  13222. var i = t.sweepLocations.map(function(e) {
  13223. return {
  13224. uuid: e.uuid.toUTF8().replace(/-/g, ""),
  13225. position: {
  13226. x: e.pose.translation.x,
  13227. y: e.pose.translation.y,
  13228. z: e.pose.translation.z
  13229. },
  13230. quaternion: {
  13231. x: e.pose.rotation.x,
  13232. y: e.pose.rotation.y,
  13233. z: e.pose.rotation.z,
  13234. w: e.pose.rotation.w
  13235. },
  13236. puck: {
  13237. x: e.puck.x,
  13238. y: e.puck.y,
  13239. z: e.puck.z
  13240. },
  13241. floor: e.group,
  13242. neighbours: e.visibles,
  13243. alignmentType: e.alignment_type
  13244. }
  13245. }).map(function(e) {
  13246. return e.position = s.convertVisionVector(e.position),
  13247. e.quaternion = s.convertVisionQuaternion(e.quaternion),
  13248. e.puck = s.convertVisionVector(e.puck),
  13249. e
  13250. });
  13251. return i.forEach(function(e) {
  13252. e.neighbours = e.neighbours.map(function(e) {
  13253. return i[e].uuid
  13254. })
  13255. }),
  13256. i
  13257. }
  13258. .bind(this), function() {
  13259. return c.warn("Could not load vision.modeldata, trying sweep_locations.csv"),
  13260. this.loadSweepLocationsCSV()
  13261. }
  13262. .bind(this))
  13263. }
  13264. ,
  13265. r.prototype.loadSweepLocationsCSV = function() {
  13266. return a.get(this.sweepLocationsPath).then(function(e) {
  13267. var t = e.split("\n").map(function(e) {
  13268. return e.split(", ")
  13269. }).filter(function(e) {
  13270. return e.length > 1
  13271. }).map(function(e) {
  13272. return {
  13273. uuid: e[0],
  13274. position: {
  13275. x: parseFloat(e[1]),
  13276. y: parseFloat(e[2]),
  13277. z: parseFloat(e[3])
  13278. },
  13279. quaternion: {
  13280. x: parseFloat(e[4]),
  13281. y: parseFloat(e[5]),
  13282. z: parseFloat(e[6]),
  13283. w: parseFloat(e[7])
  13284. }
  13285. }
  13286. }).map(function(e) {
  13287. return e.position = s.convertVisionVector(e.position),
  13288. e.quaternion = s.convertVisionQuaternion(e.quaternion),
  13289. e
  13290. });
  13291. return t
  13292. }).fail(function() {
  13293. c.warn("Could not load sweep_locations.csv, no sweeps loaded.")
  13294. })
  13295. }
  13296. ,
  13297. t.exports = r
  13298. }
  13299. ).call(this, e("buffer").Buffer, "/js/loaders/SweepDataLoader.js")
  13300. }
  13301. , {
  13302. "../util/ajax": 181,
  13303. "../util/common": 185,
  13304. "../util/logger": 189,
  13305. "../util/math": 190,
  13306. buffer: 198,
  13307. protobufjs: 214
  13308. }],
  13309. 108: [function(e, t, i) {
  13310. (function(i) {
  13311. "use strict";
  13312. function n() {
  13313. this.locale = null
  13314. }
  13315. var r = e("../settings")
  13316. , o = e("../util/common")
  13317. , a = e("../util/logger")
  13318. , s = e("../enum/Locale")
  13319. , l = new a(i);
  13320. n.prototype.init = function() {
  13321. var t;
  13322. switch (r.languageTag) {
  13323. case null:
  13324. case "en":
  13325. case s.EN_US:
  13326. this.locale = s.EN_US,
  13327. t = e("./strings-en-US");
  13328. break;
  13329. case "es":
  13330. case s.ES_MX:
  13331. this.locale = s.ES_MX,
  13332. t = e("./strings-es-MX");
  13333. break;
  13334. case "fr":
  13335. case s.FR_FR:
  13336. this.locale = s.FR_FR,
  13337. t = e("./strings-fr-FR");
  13338. break;
  13339. case "de":
  13340. case s.DE_DE:
  13341. this.locale = s.DE_DE,
  13342. t = e("./strings-de-DE");
  13343. break;
  13344. case "ru":
  13345. case s.RU_RU:
  13346. this.locale = s.RU_RU,
  13347. t = e("./strings-ru-RU");
  13348. break;
  13349. case "cn":
  13350. case s.CN_CN:
  13351. this.locale = s.CN_CN,
  13352. t = e("./strings-cn-CN");
  13353. break;
  13354. case "jp":
  13355. case s.JP_JP:
  13356. this.locale = s.JP_JP,
  13357. t = e("./strings-jp-JP");
  13358. break;
  13359. default:
  13360. l.info("Unsupported language tag, defaulting to 'en-US'"),
  13361. this.locale = s.EN_US,
  13362. t = e("./strings-en-US")
  13363. }
  13364. l.info("Using locale '" + this.locale + "'"),
  13365. o.extendObject(this, t)
  13366. }
  13367. ,
  13368. n.prototype.localizeGUI = function() {
  13369. var e = document.querySelector("#gui-parent");
  13370. this.localizeTree(e),
  13371. this.localizeLoadingText()
  13372. }
  13373. ,
  13374. n.prototype.localizeLoadingText = function() {
  13375. // var e = document.querySelector("#loader-cont")
  13376. // , t = e.getAttribute("title");
  13377. // e.removeAttribute("title"),
  13378. // e.setAttribute("data-status", t),
  13379. // e.classList.add(this.locale),
  13380. document.querySelector("#help-dialog").classList.add(this.locale),
  13381. document.querySelector("#interaction-modal").classList.add(this.locale),
  13382. document.querySelector("#gui").classList.add(this.locale);
  13383. }
  13384. ,
  13385. n.prototype.localizeTree = function(e) {
  13386. var t, i, n = /{\[{ ?(\w+) ?}\]}/;
  13387. if (e.nodeType === Node.TEXT_NODE)
  13388. t = e.data.match(n),
  13389. t && (i = t[1],
  13390. e.data = this.localizeText(i) || i);
  13391. else if (e.nodeType === Node.ELEMENT_NODE) {
  13392. var r = e.getAttribute("title");
  13393. r && (t = r.match(n),
  13394. t && (i = t[1],
  13395. e.setAttribute("title", this.localizeText(i) || i)))
  13396. }
  13397. for (e = e.firstChild; e; )
  13398. this.localizeTree(e),
  13399. e = e.nextSibling
  13400. }
  13401. ,
  13402. n.prototype.localizeText = function(t) {
  13403. var i = this[t];
  13404. return i || this.locale === s.EN_US || (l.warn("Localization key '" + t + "' not available for locale '" + this.locale + "', defaulting to English."),
  13405. i = e("./strings-en-US")[t]),
  13406. i || l.warn("Localization key '" + t + "' not available for locale 'en-US'"),
  13407. i
  13408. }
  13409. ,
  13410. t.exports = new n
  13411. }
  13412. ).call(this, "/js/localization/localize.js")
  13413. }
  13414. , {
  13415. "../enum/Locale": 31,
  13416. "../settings": 166,
  13417. "../util/common": 185,
  13418. "../util/logger": 189,
  13419. "./strings-cn-CN": 109,
  13420. "./strings-de-DE": 110,
  13421. "./strings-en-US": 111,
  13422. "./strings-es-MX": 112,
  13423. "./strings-fr-FR": 113,
  13424. "./strings-jp-JP": 114,
  13425. "./strings-ru-RU": 115
  13426. }],
  13427. 109: [function(e, t, i) {
  13428. "use strict";
  13429. t.exports = {
  13430. PAGE_TITLE: "",
  13431. LOADING: "正在加载",
  13432. PRESENTED_BY_CAPS: "呈现者:",
  13433. POWERED_BY: "技术支持:",
  13434. POWERED_BY_CAPS: "技术支持:",
  13435. DESKTOP_SHORT_CTA: "点击一次以探索这个 3D 空间。",
  13436. MOBILE_SHORT_CTA: "点击一次以探索这个 3D 空间。",
  13437. PRESENTED_BY: "呈现者:",
  13438. MORE: "更多 ",
  13439. LESS: "更少 ",
  13440. TAG_CONTENT: "tag™ 内容",
  13441. SHOW: "显示",
  13442. HIDE: "隐藏",
  13443. DOLLHOUSE: "场景屋",
  13444. FLOOR_PLAN: "楼层平面图",
  13445. OPEN_HIGHLIGHTS: "打开精彩片段",
  13446. CLOSE_HIGHLIGHTS: "关闭",
  13447. PREVIOUS: "上一个",
  13448. PLAY: "播放",
  13449. PAUSE: "暂停",
  13450. NEXT: "下一个",
  13451. EXPLORE_3D_SPACE: "探索 3D 空间",
  13452. VIEW_DOLLHOUSE: "观看场景屋",
  13453. SOCIAL_SHARING: "分享这个空间",
  13454. VIEW_IN_VR: "以 VR 观看",
  13455. VIEW_FULLSCREEN: "全屏观看",
  13456. EXIT_FULLSCREEN: " 退出全屏",
  13457. ZOOM_IN: "放大",
  13458. ZOOM_OUT: "缩小",
  13459. FLOOR_NAME: "楼层",
  13460. FLOOR_ALL: "ALL",
  13461. FLOOR_Lang: ["Floor",""],
  13462. TERMS: "条款",
  13463. PORT_TERMS: "port 条款",
  13464. TERMS_OF_USE: "使用条款",
  13465. CLOSE_TERMS: "关闭",
  13466. TERMS_TEXT_FILE: "terms-cn-CN.html",
  13467. TERMS_FAIL: "无法获取条款。请确保您有互联网连接以查看使用条款。",
  13468. WEBVR_FOR_DAYDREAM: "用于 Daydream 视图",
  13469. WEBVR_ENTER_WEBVR: "进入 VR",
  13470. WEBVR_DIFFERENT_HEADSET: "有其他耳机吗?",
  13471. WEBVR_LEARN_MORE: "了解更多",
  13472. WEBVR_VIEW_SPACE: "在 VR 中观看空间",
  13473. WEBVR_DAYDREAM_VIEW: "Daydream 视图",
  13474. WEBVR_DAYDREAM_PHONE: "支持 Daydream 的手机",
  13475. WEBVR_FOR_CARDBOARD: "用于 Google Cardboard",
  13476. WEBVR_VIEW_CARDBOARD: "或在 Google Cardboard 上观看",
  13477. VR_VIEW_SPACE: "在虚拟现实中观看空间",
  13478. VR_LEARN_MORE_CAPS: "了解更多",
  13479. VR_PREVIOUS_CAPS: "上一个’,",
  13480. VR_NEXT_CAPS: "下一个",
  13481. VR_GOT_IT_CAPS: "明白了",
  13482. VR_SHOW_SUPPORTED: "点击以使用 VR 观看空间",
  13483. VR_SHOW_UNSUPPORTED: "很遗憾,您的设备不符合在 VR 中观看空间的最低要求。",
  13484. VR_SHOW_IOS_1: "点击以使用 VR 观看空间",
  13485. VR_SHOW_IOS_2: "需要有 port VR 应用程序和兼容的 iPhone 才能观看",
  13486. VR_WHAT_YOU_NEED: "关于...您需要什么",
  13487. VR_NEED_CARDBOARD: "您使用 Google Cardboard 时需要什么",
  13488. VR_NEED_SAMSUNG: "您使用 Samsung Gear VR 时需要什么",
  13489. VR_NEED_DAYDREAM: "需要事先与 DAYDREAM VIEW 配对",
  13490. VR_NEED_DAYDREAM_PHONE: "支持 Daydream 的手机",
  13491. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13492. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13493. VR_APP: "port VR 应用程序",
  13494. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13495. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13496. VR_COMPATIBLE_IPHONES_2: "iPhone 5s 和更高版本,运行 iOS 9.1 和更高版本",
  13497. VR_COMPATIBLE_IPHONES_3: "兼容的 iPhone",
  13498. VR_COMPATIBLE_ANDROID: "兼容的 Android 设备",
  13499. VR_COMPATIBLE_ANDROID_LONG: "4.5-5.5 英寸、运行 Android OS 4.4.4 和更高版本的兼容型 Android 设备显示屏",
  13500. VR_ANDROID_DETAIL: "4.5 至 5.5 英寸、运行 Android OS 4.4.4 和更高版本的显示屏",
  13501. VR_ANDROID_DVICES: "Android 设备",
  13502. VR_COMPATIBLE_SAMSUNG: "兼容的 Samsung 设备",
  13503. VR_SAMSUNG_DETAIL: "Galaxy S6 和更高版本",
  13504. VR_APP_FOR_CARDBOARD: "用于 Google Cardboard 的 port VR 应用程序",
  13505. VR_APP_FOR_SAMSUNG: "用于 Gear VR 的 port VR 应用程序",
  13506. VR_APP_FOR_ANDROID: "用于 Android 手机的 port VR 应用程序",
  13507. VR_APP_OPEN: "请使用 port VR 应用程序打开",
  13508. VR_DOWNLOAD_HERE: "在此下载",
  13509. VR_REQUIRE_HEADSET: "需要一副 VR 耳机并安装用于 Android 的 port VR 应用程序",
  13510. VR_REDIRECT_TO_STORE: "如果未安装应用程序,您将跳转到应用程序商店。",
  13511. VR_IMPROPER_EMBED: "port 空间未正确嵌入,无法在您的 Web 浏览器支持 VR。",
  13512. VR_OPEN_ANDROID_LINK: "在您的手机上打开链接",
  13513. VR_ANDROID_OPTIONS: "可用的 VR 耳机选项",
  13514. SHARE_TO: "分享到",
  13515. SHARE_LINK: "直接链接",
  13516. SHARE_EXPLORE: "探索",
  13517. SHARE_AT: "在",
  13518. SHARE_WITH: "使用",
  13519. SHARE_3D: "以 3D",
  13520. SHARE_COPIED: "已复制!",
  13521. ERROR_BROWSER_SOLUTION: "安装更新的浏览器以探索 3D。",
  13522. ERROR_BROWSER_EXPLANATION: "WebGL 需要现代的浏览器。",
  13523. ERROR_GENERIC_PROBLEM: "糟糕,出现问题。",
  13524. ERROR_GENERIC_SOLUTION: "重新启动您的浏览器。",
  13525. ERROR_GENERIC_ACTIONS_1: "如果问题仍然存在,",
  13526. ERROR_GENERIC_ACTIONS_2: "请安装支持的浏览器",
  13527. ERROR_GENERIC_ACTIONS_3: " 或",
  13528. ERROR_GENERIC_ACTIONS_4: "查看我们的故障排除指南",
  13529. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "浏览器不受支持。",
  13530. ERROR_WEBGL_IOS_PROBLEM: "iOS 版本不受支持。",
  13531. ERROR_WEBGL_IOS_SOLUTION: "升级到 iOS 8 或更高版本以在 3D 中探索。",
  13532. ERROR_WEBGL_IOS_ACTIONS_1: "点击 ",
  13533. ERROR_WEBGL_IOS_ACTIONS_2: "设置 > 通用 > 软件更新",
  13534. ERROR_WEBGL_SAFARI_PROBLEM: "启用 WebGL 以在 3D 中探索。",
  13535. ERROR_WEBGL_SAFARI_ACTIONS_1: "单击",
  13536. ERROR_WEBGL_SAFARI_ACTIONS_2: "菜单栏中的首选项 > 高级 > 显示开发菜单",
  13537. ERROR_WEBGL_SAFARI_ACTIONS_3: "然后单击",
  13538. ERROR_WEBGL_SAFARI_ACTIONS_4: "开发 > 启用 WebGL",
  13539. ERROR_MISSING_URLS_PROBLEM: "糟糕,没有此模型的全景。",
  13540. ERROR_MISSING_URLS_EXPLANATION: "这是较早的模型。网站所有者可能正在开发一种新模型。",
  13541. ERROR_LOADING_FAILED_PROBLEM: "糟糕,模式不可用。",
  13542. ERROR_LOADING_FAILED_ACTIONS_1: "如果问题仍然存在,",
  13543. ERROR_LOADING_FAILED_ACTIONS_2: "查看我们的故障排除指南",
  13544. ERROR_MAINTENANCE_PROBLEM: "正在进行维护",
  13545. ERROR_MAINTENANCE_SOLUTION: "请过几分钟再来。",
  13546. LINK_TO_LOCATION: "地点链接",
  13547. MENU_COPY: "复制",
  13548. LINK_ALERT_COPY: "请使用 CTRL/CMD + C 复制。",
  13549. ROTATE: "旋转",
  13550. MOVE: "移动",
  13551. INSIDE: "内部",
  13552. ZOOM: "缩放",
  13553. HELP: "小帮手",
  13554. HELP_NAVIGATION_TAB: "导航",
  13555. HELP_MORE_HELP_TAB: "更多帮助",
  13556. HELP_DESKTOP_PANORAMA_1A: "单击并拖动以环顾空间。",
  13557. HELP_DESKTOP_PANORAMA_2A: "单击整个空间内的圆环以四处移动。",
  13558. HELP_DESKTOP_PANORAMA_3A: "使用鼠标滚轮来放大和缩小。",
  13559. HELP_DESKTOP_PANORAMA_1B: "或者,使用箭头键向左向右转。",
  13560. HELP_DESKTOP_PANORAMA_2B: "或者,使用箭头键向前移动和向后移动。",
  13561. HELP_DESKTOP_PANORAMA_3B: "或者,使用加号和减号键来放大和缩小。",
  13562. HELP_DESKTOP_360_2A: "单击内部视图图标以进入空间。",
  13563. HELP_DESKTOP_360_2B: "或者,按 1 号键进入内部视图。 ",
  13564. HELP_DESKTOP_DOLLHOUSE_1A: "左键单击并向左、向右、向上和向下拖动以旋转场景屋。",
  13565. HELP_DESKTOP_DOLLHOUSE_2A: "右键单击并向左、向右、向上和向下拖动以改变场景屋在屏幕上的位置。",
  13566. HELP_DESKTOP_DOLLHOUSE_3A: "使用鼠标滚轮来放大和缩小。",
  13567. HELP_DESKTOP_DOLLHOUSE_1B: "或者,使用箭头键来旋转场景屋。",
  13568. HELP_DESKTOP_FLOORPLAN_1A: "左键单击并向左、向右、向上和向下拖动以改变楼层平面图在屏幕上的位置。",
  13569. HELP_DESKTOP_FLOORPLAN_2A: "右键单击并向左或向右拖动以旋转楼层平面图。",
  13570. HELP_DESKTOP_FLOORPLAN_3A: "使用鼠标滚轮来放大和缩小。",
  13571. HELP_DESKTOP_FLOORPLAN_2B: "或者,使用箭头键以向左或向右旋转。",
  13572. HELP_DESKTOP_FLOORPLAN_3B: "或者,使用箭头键来放大和缩小。",
  13573. HELP_MOBILE_PANORAMA_1: "触摸并拖动以环顾空间。",
  13574. HELP_MOBILE_PANORAMA_2: "点击整个空间内的圆环以四处移动。",
  13575. HELP_MOBILE_3: "使用捏合手势来放大和缩小。",
  13576. HELP_MOBILE_360_2: "点击内部视图图标以进入空间。",
  13577. HELP_MOBILE_DOLLHOUSE_1: "触摸并向上、向下、向左和向右拖动以旋转场景屋。",
  13578. HELP_MOBILE_DOLLHOUSE_2: "用两指触摸并拖动以定位场景屋。",
  13579. HELP_MOBILE_FLOORPLAN_1: "触摸并拖动以定位楼层平面图。",
  13580. HELP_MOBILE_FLOORPLAN_2: "用两指触摸并拖动以旋转楼层平面图。",
  13581. HELP_MORE_HLR_A: "精彩片段集锦",
  13582. HELP_DESKTOP_MORE_HLR_B: "打开以使用缩略图图像在空间中流览。",
  13583. HELP_MORE_DOLLHOUSE_A: "场景屋",
  13584. HELP_DESKTOP_MORE_DOLLHOUSE_B: "单击以查看和旋转 3D 内整个空间的俯视图。",
  13585. HELP_MOBILE_MORE_DOLLHOUSE_B: "点击以查看和旋转 3D 内整个空间的俯视图。",
  13586. HELP_MORE_FLOORS_A: "楼层选择器",
  13587. HELP_DESKTOP_MORE_FLOORS_B: "在空间中的楼层之间切换。",
  13588. HELP_MORE_TAG_A: "tag™ 贴文",
  13589. HELP_DESKTOP_MORE_TAG_B: "单击或悬停鼠标以查看空间中的功能信息。",
  13590. HELP_MOBILE_MORE_TAG_B: "点击以查看空间中的功能信息。",
  13591. HELP_MORE_ZOOM_A: "缩放控件",
  13592. HELP_DESKTOP_MORE_ZOOM_B: "使用这些控件来放大和缩小或使用滚轮。",
  13593. HELP_MORE_TOUR_A: "导览控件",
  13594. HELP_DESKTOP_MORE_TOUR_B: "通过导览播放、暂停以及向前和向后流览。",
  13595. HELP_MORE_INSIDE_A: "内部视图",
  13596. HELP_DESKTOP_MORE_INSIDE_B: "单击以探索空间内部。",
  13597. HELP_MOBILE_MORE_INSIDE_B: "点击以探索空间内部。",
  13598. HELP_MORE_VR_A: "VR 模式",
  13599. HELP_DESKTOP_MORE_VR_B: "单击以在虚拟现实中启动空间。",
  13600. HELP_MOBILE_MORE_VR_B: "点击以在虚拟现实中启动空间。",
  13601. HELP_MORE_360_A: "360° 视图",
  13602. HELP_DESKTOP_MORE_360_B: "单击精彩片段集锦中的 360 视图中以观看室外场景。",
  13603. HELP_MOBILE_MORE_360_B: "点击精彩片段集锦中的 360 视图中以观看室外场景。",
  13604. HELP_MORE_FULLSCREEN_A: "全屏",
  13605. HELP_DESKTOP_MORE_FULLSCREEN_B: "将 3D Showcase 扩展到全屏。",
  13606. CLOSE: "关闭"
  13607. }
  13608. }
  13609. , {}],
  13610. 110: [function(e, t, i) {
  13611. "use strict";
  13612. t.exports = {
  13613. PAGE_TITLE: "",
  13614. LOADING: "Lädt",
  13615. PRESENTED_BY_CAPS: "PRÄSENTIERT VON",
  13616. POWERED_BY: "Angetrieben von",
  13617. POWERED_BY_CAPS: "ANGETRIEBEN VON",
  13618. DESKTOP_SHORT_CTA: "Sehen sie sich in diesem 3D Raum um.",
  13619. MOBILE_SHORT_CTA: "Sehen sie sich in diesem 3D Raum um.",
  13620. PRESENTED_BY: "Präsentiert von ",
  13621. MORE: "Mehr ",
  13622. LESS: "Weniger ",
  13623. TAG_CONTENT: "tag™ Inhalt",
  13624. SHOW: "Anzeigen",
  13625. HIDE: "Verbergen",
  13626. DOLLHOUSE: "Puppenhaus",
  13627. FLOOR_PLAN: "Grundriss",
  13628. OPEN_HIGHLIGHTS: "Highlights anzeigen",
  13629. CLOSE_HIGHLIGHTS: "Schließen",
  13630. PREVIOUS: "Vorheriges",
  13631. PLAY: "Abspielen",
  13632. PAUSE: "Pausieren",
  13633. NEXT: "Nächstes",
  13634. EXPLORE_3D_SPACE: "Innenraum betreten",
  13635. VIEW_DOLLHOUSE: "Puppenhaus ansehen",
  13636. SOCIAL_SHARING: "Teilen Sie diesen Raum",
  13637. VIEW_IN_VR: "In VR ansehen",
  13638. VIEW_FULLSCREEN: "Ansicht im Vollbildmodus",
  13639. EXIT_FULLSCREEN: "Beenden des Vollbildmodus",
  13640. ZOOM_IN: "Vergrößern",
  13641. ZOOM_OUT: "Verkleinern",
  13642. FLOOR_NAME: "Etage ",
  13643. FLOOR_ALL: "Alle",
  13644. TERMS: "Bedingungen",
  13645. PORT_TERMS: "port Bedingungen",
  13646. TERMS_OF_USE: "Nutzungsbedingungen",
  13647. TERMS_TEXT_FILE: "terms-de-DE.html",
  13648. CLOSE_TERMS: "Schließen",
  13649. TERMS_FAIL: "Konnte die Nutzungsbedingungen nicht abrufen. Bitte stellen Sie sicher, dass Sie zum Internet verbunden sind.",
  13650. HELP: "Hilfe",
  13651. HELP_NAVIGATION_TAB: "Navigation",
  13652. HELP_MORE_HELP_TAB: "Hilfe-Details",
  13653. CLOSE: "Schließen",
  13654. HELP_DESKTOP_PANORAMA_1A: "Klicken und ziehen Sie um sich im Raum umzusehen.",
  13655. HELP_DESKTOP_PANORAMA_2A: "Klicken Sie auf die Ringe im Raum um sich zu bewegen.",
  13656. HELP_DESKTOP_PANORAMA_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  13657. HELP_DESKTOP_PANORAMA_1B: "Oder verwenden Sie die Pfeiltasten um sich nach links und rechts zu bewegen.",
  13658. HELP_DESKTOP_PANORAMA_2B: "Oder verwenden Sie die Pfeiltasten um sich vorwärts und rückwärts zubewegen.",
  13659. HELP_DESKTOP_PANORAMA_3B: "Oder verwenden Sie die Plus- und Minus-Tasten zum Vergrößern und Verkleinern.",
  13660. HELP_DESKTOP_360_2A: "Klicken Sie die Innenansicht ikone, um diesen Raum zu starten .",
  13661. HELP_DESKTOP_360_2B: "Oder, drücken Sie die 1-Taste um die Innenraumansicht zu starten.",
  13662. HELP_DESKTOP_DOLLHOUSE_1A: "Klicken Sie mit der linken Maustaste und ziehen Sie nach links, rechts, oben und unten um das Puppenhaus zu drehen.",
  13663. 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.",
  13664. HELP_DESKTOP_DOLLHOUSE_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  13665. HELP_DESKTOP_DOLLHOUSE_1B: "Oder verwenden Sie die Pfeiltasten um das Puppenhaus zu drehen.",
  13666. 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.",
  13667. HELP_DESKTOP_FLOORPLAN_2A: "Klicken Sie mit der rechten Maustaste und ziehen Sie nach links oder rechts um den Grundriss zu drehen.",
  13668. HELP_DESKTOP_FLOORPLAN_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  13669. HELP_DESKTOP_FLOORPLAN_2B: "Oder verwenden Sie die Pfeiltasten um das Modell nach links oder rechts zu drehen.",
  13670. HELP_DESKTOP_FLOORPLAN_3B: "Oder verwenden Sie die Pfeiltasten zum Vergrößern und Verkleinern.",
  13671. HELP_MOBILE_PANORAMA_1: "Berühren und ziehen an dem Raum um sich umzusehen.",
  13672. HELP_MOBILE_PANORAMA_2: "Klicken Sie auf die Ringe im Raum, um sich zu bewegen.",
  13673. HELP_MOBILE_3: "Benutzen Sie die Zoom-Gäste zum Vergrößern und Verkleinern.",
  13674. HELP_MOBILE_360_2: "Tippen Sie die Innenansicht ikone, um diesen Raum zu starten.",
  13675. HELP_MOBILE_DOLLHOUSE_1: "Berühren und nach oben, unten, links und rechts ziehen um das Puppenhaus zu drehen.",
  13676. HELP_MOBILE_DOLLHOUSE_2: "Berühren und mit zwei Fingern ziehen um das Puppenhaus zu positionieren.",
  13677. HELP_MOBILE_FLOORPLAN_1: "Berühren und ziehen, um den Grundriss zu positionieren.",
  13678. HELP_MOBILE_FLOORPLAN_2: "Berühren und ziehen mit zwei Fingern, um den Grundriss zu drehen.",
  13679. HELP_MORE_HLR_A: "Liste das Highlight",
  13680. HELP_DESKTOP_MORE_HLR_B: "Öffnen um durch den Raum mit Vorschau-Bildern zu navigieren.",
  13681. HELP_MORE_DOLLHOUSE_A: "Puppenhaus Ansicht",
  13682. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Klicken Sie um die von oben nach unten Sicht des gesamten Raumes in 3D anzuzeigen und zu drehen.",
  13683. HELP_MOBILE_MORE_DOLLHOUSE_B: "Tippen Sie um die von oben nach unten Sicht des gesamten Raumes in 3D anzuzeigen und zu drehen.",
  13684. HELP_MORE_FLOORS_A: "Etage auswählen",
  13685. HELP_DESKTOP_MORE_FLOORS_B: "Zwischen den Etagen im Raum wechseln.",
  13686. HELP_MORE_TAG_A: "tag™ Posts",
  13687. HELP_DESKTOP_MORE_TAG_B: "Klicken Sie auf oder bewegen Sie Ihren Mauszeiger über die Informationen über die Funktionen im Raum.",
  13688. HELP_MOBILE_MORE_TAG_B: "Tippen Sie für Informationen über die Funktionen im Raum.",
  13689. HELP_MORE_ZOOM_A: "Zoom Steuerung",
  13690. HELP_DESKTOP_MORE_ZOOM_B: "Verwenden Sie diese Steuerung oder das Scrollrad zum Vergrößern und Verkleinern.",
  13691. HELP_MORE_TOUR_A: "Tour Steuerung",
  13692. HELP_DESKTOP_MORE_TOUR_B: "Abspielen, pausieren und vorwärts und rückwärts durch eine geführte Tour navigieren.",
  13693. HELP_MORE_INSIDE_A: "Innenansicht",
  13694. HELP_DESKTOP_MORE_INSIDE_B: "Klicken Sie hier um sich im Raum umzusehen.",
  13695. HELP_MOBILE_MORE_INSIDE_B: "Sehen Sie sich in diesen 3D Raum um.",
  13696. HELP_MORE_VR_A: "VR Modus",
  13697. HELP_DESKTOP_MORE_VR_B: "Klicken Sie hier, um den Raum in der virtuellen Realität zu starten.",
  13698. HELP_MOBILE_MORE_VR_B: "Tippen Sie um den Raum in der virtuellen Realität zu starten.",
  13699. HELP_MORE_360_A: "360° Views Ansicht ",
  13700. HELP_DESKTOP_MORE_360_B: "Klicken Sie die 360° Views Ansicht in das Highlight um Aussen-Szenen zu sehen.",
  13701. HELP_MOBILE_MORE_360_B: "Tippen Sie die 360° Views Ansicht in das Highlight um Aussen-Szenen zu sehen.",
  13702. HELP_MORE_FULLSCREEN_A: "Vollbild",
  13703. HELP_DESKTOP_MORE_FULLSCREEN_B: "Erweitern Sie 3D Showcase im Vollbildmodus.",
  13704. WEBVR_FOR_CARDBOARD: "Für Google Cardboard",
  13705. WEBVR_FOR_DAYDREAM: "Für Daydream View",
  13706. WEBVR_ENTER_WEBVR: "Starten Sie VR",
  13707. WEBVR_DIFFERENT_HEADSET: "Haben Sie anderes Headset?",
  13708. WEBVR_LEARN_MORE: "Mehr Infos",
  13709. WEBVR_VIEW_SPACE: "Ansicht des Raumes in VR",
  13710. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13711. WEBVR_DAYDREAM_PHONE: "Daydream-fähiges Handy",
  13712. WEBVR_VIEW_CARDBOARD: "Oder mit Google Cardboard ansehen",
  13713. VR_WHAT_YOU_NEED: "Was Sie dafür brauchen...",
  13714. VR_NEED_DAYDREAM_PHONE: "Daydream-fähiges Handy",
  13715. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13716. VR_APP: "port VR App",
  13717. VR_APP_OPEN: "Oder öffnen Sie die port VR App",
  13718. 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",
  13719. VR_SAMSUNG_DETAIL: "Galaxy S6 und neuer",
  13720. VR_APP_FOR_ANDROID: "port VR app für Android",
  13721. VR_NEED_DAYDREAM: "ERFORDERT VOR DER 'PAIRING' MIT DAYDREAM VIEW",
  13722. VR_VIEW_SPACE: "Ansicht des Raumes in VR",
  13723. VR_LEARN_MORE_CAPS: "MEHR INFOS",
  13724. VR_PREVIOUS_CAPS: "ZURÜCK",
  13725. VR_NEXT_CAPS: "WEITER",
  13726. VR_GOT_IT_CAPS: "VERSTANDEN",
  13727. VR_SHOW_SUPPORTED: "Tippen Sie um den Raum in VR zu sehen",
  13728. VR_SHOW_UNSUPPORTED: "Schade, aber Ihr Gerät erfüllt nicht die Mindestanforderungen um den Raum in VR zu sehen.",
  13729. VR_SHOW_IOS_1: "Tippen Sie um den Raum in VR zu sehen",
  13730. VR_SHOW_IOS_2: "port VR App sowie kompatibles iPhone sind von nöten um diesen Raum zu sehen",
  13731. VR_NEED_CARDBOARD: "Was Sie dafür brauchen ist Google Cardboard",
  13732. VR_NEED_SAMSUNG: "Was Sie dafür brauchen ist Samsung Gear VR",
  13733. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13734. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13735. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13736. VR_COMPATIBLE_IPHONES_2: "iPhone 5s oder neuer, mit iOS 9.1 und später",
  13737. VR_COMPATIBLE_IPHONES_3: "Kompatibles iPhones",
  13738. VR_COMPATIBLE_ANDROID: "Kompatibles Android Gerät",
  13739. VR_ANDROID_DETAIL: "Bildschirmdiagonale von 11,5 bis 14 cm (4,5 - 5,5 Zoll) und Android 4.4.4 und neuer",
  13740. VR_ANDROID_DVICES: "Android Geräte",
  13741. VR_COMPATIBLE_SAMSUNG: "Kompatible Samsung Geräte",
  13742. VR_APP_FOR_CARDBOARD: "port VR App für Google Cardboard",
  13743. VR_APP_FOR_SAMSUNG: "port VR App für Gear VR",
  13744. VR_DOWNLOAD_HERE: "Hier runterladen",
  13745. VR_REQUIRE_HEADSET: "Benötigt das ein VR-Headset und port VR App für Android installiert wird",
  13746. VR_REDIRECT_TO_STORE: "Wenn App nicht installiert ist, werden Sie zum App Store umgeleitet.",
  13747. VR_IMPROPER_EMBED: "Der port Raum ist nicht richtig eingebettet um VR in Ihrem Webbrowser zu unterstützen.",
  13748. VR_OPEN_ANDROID_LINK: "Öffnen Sie den Link auf Ihrem Handy",
  13749. VR_ANDROID_OPTIONS: "VR Headset Optionen",
  13750. SHARE_TO: "Teilen auf",
  13751. SHARE_LINK: "Direkter Link",
  13752. SHARE_EXPLORE: "Umsehen",
  13753. SHARE_AT: "auf",
  13754. SHARE_WITH: "mit",
  13755. SHARE_3D: "in 3D",
  13756. SHARE_COPIED: "Kopiert!",
  13757. ERROR_BROWSER_SOLUTION: "Installieren Sie einen neueren Browser um sich in 3D umzusehen.",
  13758. ERROR_BROWSER_EXPLANATION: "WebGL benötigt einen modernen Browser.",
  13759. ERROR_GENERIC_PROBLEM: "Huch, etwas ist schief gelaufen.",
  13760. ERROR_GENERIC_SOLUTION: "Starten Sie Ihren Browser neu.",
  13761. ERROR_GENERIC_ACTIONS_1: "Wenn das Problem weiterhin besteht, ",
  13762. ERROR_GENERIC_ACTIONS_2: "Installieren Sie einen unterstützten Browser",
  13763. ERROR_GENERIC_ACTIONS_3: " oder ",
  13764. ERROR_GENERIC_ACTIONS_4: "Sehen Sie unseren Leitfaden zur Fehlerbehebung",
  13765. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Browser wird nicht unterstützt.",
  13766. ERROR_WEBGL_IOS_PROBLEM: "iOS-Version wird nicht unterstützt.",
  13767. ERROR_WEBGL_IOS_SOLUTION: "Aktualisieren Sie auf iOS 8 oder neuer um sich in 3D umzusehen.",
  13768. ERROR_WEBGL_IOS_ACTIONS_1: "Tippen ",
  13769. ERROR_WEBGL_IOS_ACTIONS_2: "Einstellungen > Allgemein > Softwareaktualisierung",
  13770. ERROR_WEBGL_SAFARI_PROBLEM: "Aktivieren Sie WebVR um sich in 3D umzusehen.",
  13771. ERROR_WEBGL_SAFARI_ACTIONS_1: "Klicken ",
  13772. ERROR_WEBGL_SAFARI_ACTIONS_2: "Präferenzen > Fortgeschrittene > Entwickler-Menü anzeigen",
  13773. ERROR_WEBGL_SAFARI_ACTIONS_3: "Klicken Sie dann ",
  13774. ERROR_WEBGL_SAFARI_ACTIONS_4: "Entwickler > WebGL Aktivieren",
  13775. ERROR_MISSING_URLS_PROBLEM: "Huch, es gibt keine Panoramen für dieses Modell .",
  13776. ERROR_MISSING_URLS_EXPLANATION: "Dies ist ein älteres Modell. Der Website-Besitzer hat eventuell ein neues Modell in Arbeit.",
  13777. ERROR_LOADING_FAILED_PROBLEM: "Huch, das Modell ist nicht verfügbar.",
  13778. ERROR_LOADING_FAILED_ACTIONS_1: "Wenn das Problem weiterhin besteht, ",
  13779. ERROR_LOADING_FAILED_ACTIONS_2: "sehen Sie unseren Leitfaden zur Fehlerbehebung",
  13780. ERROR_MAINTENANCE_PROBLEM: "Wartung im Gange.",
  13781. ERROR_MAINTENANCE_SOLUTION: "Bitte versuchen Sie es in ein paar Minuten nochmal.",
  13782. LINK_TO_LOCATION: "Link zu",
  13783. MENU_COPY: "Kopieren",
  13784. LINK_ALERT_COPY: "Bitte benutzen Sie CTRL/CMD + C zum kopieren.",
  13785. ROTATE: "Drehen",
  13786. INSIDE: "Drinnen",
  13787. MOVE: "Bewegen",
  13788. ZOOM: "Vergrößern"
  13789. }
  13790. }
  13791. , {}],
  13792. 111: [function(e, t, i) {
  13793. "use strict";
  13794. t.exports = {
  13795. PAGE_TITLE: "",
  13796. LOADING: "Loading",
  13797. PRESENTED_BY_CAPS: "PRESENTED BY",
  13798. POWERED_BY: "powered by ",
  13799. POWERED_BY_CAPS: "POWERED BY",
  13800. DESKTOP_SHORT_CTA: "Click to explore this 3D space.",
  13801. MOBILE_SHORT_CTA: "Tap to explore this 3D space.",
  13802. PRESENTED_BY: "Presented by ",
  13803. MORE: "More ",
  13804. LESS: "Less ",
  13805. TAG_CONTENT: "tag™ Content",
  13806. SHOW: "Show",
  13807. HIDE: "Hide",
  13808. DOLLHOUSE: "Dollhouse",
  13809. FLOOR_PLAN: "Floor plan",
  13810. OPEN_HIGHLIGHTS: "Open Highlights",
  13811. CLOSE_HIGHLIGHTS: "Close",
  13812. PREVIOUS: "Previous",
  13813. PLAY: "Play",
  13814. PAUSE: "Pause",
  13815. NEXT: "Next",
  13816. EXPLORE_3D_SPACE: "Explore 3D Space",
  13817. VIEW_DOLLHOUSE: "View dollhouse",
  13818. SOCIAL_SHARING: "Share this Space",
  13819. VIEW_IN_VR: "View in VR",
  13820. VIEW_FULLSCREEN: "全屏",
  13821. EXIT_FULLSCREEN: "退出全屏",
  13822. ZOOM_IN: "Zoom in",
  13823. ZOOM_OUT: "Zoom out",
  13824. FLOOR_NAME: "Floor ",
  13825. FLOOR_ALL: "全部",
  13826. TERMS: "Terms",
  13827. PORT_TERMS: "port terms",
  13828. TERMS_OF_USE: "Terms of Use",
  13829. TERMS_TEXT_FILE: "terms-en-US.html",
  13830. CLOSE_TERMS: "Close",
  13831. TERMS_FAIL: "Could not fetch terms. Please make sure you have an internet connection to view the terms of use.",
  13832. HELP: "Help",
  13833. HELP_NAVIGATION_TAB: "Navigation",
  13834. HELP_MORE_HELP_TAB: "More Help",
  13835. CLOSE: "Close",
  13836. HELP_DESKTOP_PANORAMA_1A: "Click and Drag to look around the Space.",
  13837. HELP_DESKTOP_PANORAMA_2A: "Click on the rings throughout the space to move around.",
  13838. HELP_DESKTOP_PANORAMA_3A: "Use the scroll wheel to zoom in and out.",
  13839. HELP_DESKTOP_PANORAMA_1B: "Or, use the arrow keys to turn left and right.",
  13840. HELP_DESKTOP_PANORAMA_2B: "Or, use the arrow keys to move forward and back.",
  13841. HELP_DESKTOP_PANORAMA_3B: "Or, use the plus and minus keys to zoom in and out.",
  13842. HELP_DESKTOP_360_2A: "Click the Inside View icon to enter the Space.",
  13843. HELP_DESKTOP_360_2B: "Or, press the number 1 key to enter Inside View.",
  13844. HELP_DESKTOP_DOLLHOUSE_1A: "Left click and drag left, right, up, and down to rotate the Dollhouse.",
  13845. HELP_DESKTOP_DOLLHOUSE_2A: "Right click and drag left, right, up, and down to change the Dollhouse position on screen.",
  13846. HELP_DESKTOP_DOLLHOUSE_3A: "Use the scroll wheel to zoom in and out.",
  13847. HELP_DESKTOP_DOLLHOUSE_1B: "Or, use the arrow keys to rotate the Dollhouse.",
  13848. HELP_DESKTOP_FLOORPLAN_1A: "Left click and drag left, right, up, and down to change the Floorplan position on screen.",
  13849. HELP_DESKTOP_FLOORPLAN_2A: "Right click and drag left or right to rotate the Floorplan.",
  13850. HELP_DESKTOP_FLOORPLAN_3A: "Use the scroll wheel to zoom in and out.",
  13851. HELP_DESKTOP_FLOORPLAN_2B: "Or, use the arrow keys to rotate left or right.",
  13852. HELP_DESKTOP_FLOORPLAN_3B: "Or, use the arrow keys to zoom in and out.",
  13853. HELP_MOBILE_PANORAMA_1: "Touch and Drag to look around the Space.",
  13854. HELP_MOBILE_PANORAMA_2: "Tap on the rings throughout the Space to move around.",
  13855. HELP_MOBILE_3: "Use a pinch gesture to zoom in and out.",
  13856. HELP_MOBILE_360_2: "Tap the Inside View icon to enter the Space.",
  13857. HELP_MOBILE_DOLLHOUSE_1: "Touch and drag up, down, left, and right to rotate the Dollhouse.",
  13858. HELP_MOBILE_DOLLHOUSE_2: "Touch and drag with two fingers to position the Dollhouse.",
  13859. HELP_MOBILE_FLOORPLAN_1: "Touch and drag to position the Floorplan.",
  13860. HELP_MOBILE_FLOORPLAN_2: "Touch and drag with two fingers to rotate the Floorplan.",
  13861. HELP_MORE_HLR_A: "Highlight Reel",
  13862. HELP_DESKTOP_MORE_HLR_B: "Open to navigate through the Space using thumbnail images.",
  13863. HELP_MORE_DOLLHOUSE_A: "Dollhouse View",
  13864. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Click to view and rotate a top-down view of the entire Space in 3D.",
  13865. HELP_MOBILE_MORE_DOLLHOUSE_B: "Tap to view and rotate a top-down view of the entire Space in 3D.",
  13866. HELP_MORE_FLOORS_A: "Floor Selector",
  13867. HELP_DESKTOP_MORE_FLOORS_B: "Switch between floors in the Space.",
  13868. HELP_MORE_TAG_A: "tag™ Posts",
  13869. HELP_DESKTOP_MORE_TAG_B: "Click or hover over for information about features in the Space.",
  13870. HELP_MOBILE_MORE_TAG_B: "Tap for information about features in the Space.",
  13871. HELP_MORE_ZOOM_A: "Zoom Controls",
  13872. HELP_DESKTOP_MORE_ZOOM_B: "Use these controls to zoom in and out or use the scroll wheel.",
  13873. HELP_MORE_TOUR_A: "Tour Controls",
  13874. HELP_DESKTOP_MORE_TOUR_B: "Play, pause, and navigate forward and backward through a Guided Tour.",
  13875. HELP_MORE_INSIDE_A: "Inside View",
  13876. HELP_DESKTOP_MORE_INSIDE_B: "Click to explore inside the Space.",
  13877. HELP_MOBILE_MORE_INSIDE_B: "Tap to explore inside the Space.",
  13878. HELP_MORE_VR_A: "VR Mode",
  13879. HELP_DESKTOP_MORE_VR_B: "Click to launch the Space in virtual reality.",
  13880. HELP_MOBILE_MORE_VR_B: "Tap to launch the Space in virtual reality.",
  13881. HELP_MORE_360_A: "360° Views",
  13882. HELP_DESKTOP_MORE_360_B: "Click 360 Views in the Highlight Reel to view outdoor scenes.",
  13883. HELP_MOBILE_MORE_360_B: "Tap 360 Views in the Highlight Reel to view outdoor scenes.",
  13884. HELP_MORE_FULLSCREEN_A: "Full screen",
  13885. HELP_DESKTOP_MORE_FULLSCREEN_B: "Expand 3D Showcase to full screen.",
  13886. WEBVR_FOR_CARDBOARD: "For Google Cardboard",
  13887. WEBVR_VIEW_CARDBOARD: "Or View on Google Cardboard",
  13888. WEBVR_FOR_DAYDREAM: "For Daydream View",
  13889. WEBVR_ENTER_WEBVR: "ENTER VR",
  13890. WEBVR_DIFFERENT_HEADSET: "Have a different headset?",
  13891. WEBVR_LEARN_MORE: "Learn more",
  13892. WEBVR_VIEW_SPACE: "View Space in VR",
  13893. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13894. WEBVR_DAYDREAM_PHONE: "Daydream-ready phone",
  13895. VR_VIEW_SPACE: "View Space in Virtual Reality",
  13896. VR_LEARN_MORE_CAPS: "LEARN MORE",
  13897. VR_PREVIOUS_CAPS: "PREVIOUS",
  13898. VR_NEXT_CAPS: "NEXT",
  13899. VR_GOT_IT_CAPS: "GOT IT",
  13900. VR_SHOW_SUPPORTED: "Tap to view the Space in VR with",
  13901. VR_SHOW_UNSUPPORTED: "Sorry, but your device doesn't meet the minimum requirements to view a space in VR.",
  13902. VR_SHOW_IOS_1: "Tap to view the space in VR",
  13903. VR_SHOW_IOS_2: "Requires port VR app and compatible iPhone to view",
  13904. VR_WHAT_YOU_NEED: "What You'll Need For...",
  13905. VR_NEED_CARDBOARD: "What you'll need with Google Cardboard",
  13906. VR_NEED_SAMSUNG: "What you'll need with Samsung Gear VR",
  13907. VR_NEED_DAYDREAM: "NEEDS PRIOR PAIRING WITH DAYDREAM VIEW",
  13908. VR_NEED_DAYDREAM_PHONE: "Daydream-ready phone",
  13909. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13910. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13911. VR_APP: "port VR App",
  13912. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13913. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13914. VR_COMPATIBLE_IPHONES_2: "iPhone 5s and newer, running iOS 9.1 and higher",
  13915. VR_COMPATIBLE_IPHONES_3: "Compatible iPhones",
  13916. VR_COMPATIBLE_ANDROID: "Compatible Android Devices",
  13917. VR_COMPATIBLE_ANDROID_LONG: 'Compatible Android Devices Displays from 4.5"-5.5" running Android OS 4.4.4 and higher',
  13918. VR_ANDROID_DETAIL: 'Displays from 4.5"-5.5" running Android OS 4.4.4 and higher',
  13919. VR_ANDROID_DVICES: "Android Devices",
  13920. VR_COMPATIBLE_SAMSUNG: "Compatible Samsung Devices",
  13921. VR_SAMSUNG_DETAIL: "Galaxy S6 and Above",
  13922. VR_APP_FOR_CARDBOARD: "port VR app for Google Cardboard",
  13923. VR_APP_FOR_SAMSUNG: "port VR app for Gear VR",
  13924. VR_APP_FOR_ANDROID: "port VR app for Android Phones",
  13925. VR_APP_OPEN: "Open with the port VR app instead",
  13926. VR_DOWNLOAD_HERE: "Download here",
  13927. VR_REQUIRE_HEADSET: "Requires a VR headset and port VR app for Android to be installed",
  13928. VR_REDIRECT_TO_STORE: "If app is not installed, you will be redirected to the app store.",
  13929. VR_IMPROPER_EMBED: "The port Space is not embedded properly to support VR in your web browser.",
  13930. VR_OPEN_ANDROID_LINK: "Open the Link on Your Mobile Phone",
  13931. VR_ANDROID_OPTIONS: "Available VR Headset Options",
  13932. SHARE_TO: "Share to",
  13933. SHARE_LINK: "Direct Link",
  13934. SHARE_EXPLORE: "Explore ",
  13935. SHARE_AT: "at",
  13936. SHARE_WITH: "with",
  13937. SHARE_3D: " in 3D",
  13938. SHARE_COPIED: "Copied!",
  13939. ERROR_BROWSER_SOLUTION: "Install a new browser to explore in 3D.",
  13940. ERROR_BROWSER_EXPLANATION: "WebGL requires a modern browser.",
  13941. ERROR_GENERIC_PROBLEM: "Oops, something went wrong.",
  13942. ERROR_GENERIC_SOLUTION: "Restart your browser.",
  13943. ERROR_GENERIC_ACTIONS_1: "If the problem persists, ",
  13944. ERROR_GENERIC_ACTIONS_2: "install a supported browser",
  13945. ERROR_GENERIC_ACTIONS_3: " or ",
  13946. ERROR_GENERIC_ACTIONS_4: "see our troubleshooting guide",
  13947. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Browser not supported.",
  13948. ERROR_WEBGL_IOS_PROBLEM: "iOS version not supported.",
  13949. ERROR_WEBGL_IOS_SOLUTION: "Upgrade to iOS 8 or higher to explore in 3D.",
  13950. ERROR_WEBGL_IOS_ACTIONS_1: "Tap ",
  13951. ERROR_WEBGL_IOS_ACTIONS_2: "Settings > General > Software Update",
  13952. ERROR_WEBGL_SAFARI_PROBLEM: "Enable WebGL to explore in 3D.",
  13953. ERROR_WEBGL_SAFARI_ACTIONS_1: "Click ",
  13954. ERROR_WEBGL_SAFARI_ACTIONS_2: "Preferences > Advanced > Show Develop menu",
  13955. ERROR_WEBGL_SAFARI_ACTIONS_3: "Then click ",
  13956. ERROR_WEBGL_SAFARI_ACTIONS_4: "Develop > Enable WebGL",
  13957. ERROR_MISSING_URLS_PROBLEM: "Oops, there are no panoramas for this model.",
  13958. ERROR_MISSING_URLS_EXPLANATION: "This is an older model. The website owner may have a new model on the way.",
  13959. ERROR_LOADING_FAILED_PROBLEM: "模型不可用.",
  13960. ERROR_LOADING_FAILED_ACTIONS_1: "If the problem persists, ",
  13961. ERROR_LOADING_FAILED_ACTIONS_2: "see our troubleshooting guide",
  13962. ERROR_MAINTENANCE_PROBLEM: "Maintenance in progress.",
  13963. ERROR_MAINTENANCE_SOLUTION: "Please come back in a few minutes.",
  13964. LINK_TO_LOCATION: "Link to location",
  13965. MENU_COPY: "Copy",
  13966. LINK_ALERT_COPY: "Please use CTRL/CMD + C to copy.",
  13967. ROTATE: "Rotate",
  13968. INSIDE: "Inside",
  13969. MOVE: "Move",
  13970. ZOOM: "Zoom"
  13971. }
  13972. }
  13973. , {}],
  13974. 112: [function(e, t, i) {
  13975. "use strict";
  13976. t.exports = {
  13977. PAGE_TITLE: "",
  13978. LOADING: "Cargando",
  13979. PRESENTED_BY_CAPS: "PRESENTADO POR",
  13980. POWERED_BY: "potenciando por ",
  13981. POWERED_BY_CAPS: "POTENCIADO POR ",
  13982. DESKTOP_SHORT_CTA: "Haga clic para explorar este Espacio 3D.",
  13983. MOBILE_SHORT_CTA: "Pulse para explorar este Espacio 3D.",
  13984. PRESENTED_BY: "Presentado por ",
  13985. MORE: "Más ",
  13986. LESS: "Menos ",
  13987. TAG_CONTENT: "Contenido de tag™",
  13988. SHOW: "Mostrar",
  13989. HIDE: "Ocultar",
  13990. DOLLHOUSE: "Dollhouse",
  13991. FLOOR_PLAN: "Planos",
  13992. OPEN_HIGHLIGHTS: "Aspectos Destacados",
  13993. CLOSE_HIGHLIGHTS: "Cerrar",
  13994. PREVIOUS: "Anterior",
  13995. PLAY: "Play",
  13996. PAUSE: "Pausa",
  13997. NEXT: "Siguiente",
  13998. EXPLORE_3D_SPACE: "Explorar el Espacio 3D",
  13999. VIEW_DOLLHOUSE: "Ver dollhouse",
  14000. SOCIAL_SHARING: "Compartir este espacio",
  14001. VIEW_IN_VR: "Ver en realidad virtual",
  14002. VIEW_FULLSCREEN: "Ver en pantalla completa",
  14003. EXIT_FULLSCREEN: "Salir de pantalla completa",
  14004. ZOOM_IN: "Acercar",
  14005. ZOOM_OUT: "Alejar",
  14006. FLOOR_NAME: "Piso ",
  14007. FLOOR_ALL: "Todas",
  14008. TERMS: "Condiciones",
  14009. PORT_TERMS: "port términos de uso",
  14010. TERMS_OF_USE: "Términos de uso",
  14011. TERMS_TEXT_FILE: "terms-es-MX.html",
  14012. CLOSE_TERMS: "Cerrar",
  14013. 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.",
  14014. HELP: "Ayuda",
  14015. HELP_NAVIGATION_TAB: "Navegación",
  14016. HELP_MORE_HELP_TAB: "Más Ayuda",
  14017. CLOSE: "Cerrar",
  14018. HELP_DESKTOP_PANORAMA_1A: "Haga clic y arrastre para mirar alrededor del espacio.",
  14019. HELP_DESKTOP_PANORAMA_2A: "Haga clic en los aros a lo largo del espacio para moverse.",
  14020. HELP_DESKTOP_PANORAMA_3A: "Use la rueda de desplazamiento para acercar o alejar.",
  14021. HELP_DESKTOP_PANORAMA_1B: "O use las teclas de flecha para girar a la izquierda y a la derecha.",
  14022. HELP_DESKTOP_PANORAMA_2B: "O use las teclas de dirección para adelantar o retroceder.",
  14023. HELP_DESKTOP_PANORAMA_3B: "O use la tecla más para acercar y la tecla menos para alejar.",
  14024. HELP_DESKTOP_360_2A: "Haga clic en el icono Vista Interior para ingresar al Espacio.",
  14025. HELP_DESKTOP_360_2B: "O bien, presione la tecla numero 1 para entrar en la Vista Interior.",
  14026. HELP_DESKTOP_DOLLHOUSE_1A: "Haga clic izquierdo y arrastre hacia la izquierda, derecha, arriba o abajo para girar la Dollhouse.",
  14027. HELP_DESKTOP_DOLLHOUSE_2A: "Haga clic derecho y arrastre hacia la izquierda, derecha, arriba o abajo para cambiar la posición della dollhouse.",
  14028. HELP_DESKTOP_DOLLHOUSE_3A: "Use la rueda de desplazamiento para acercar o alejar.",
  14029. HELP_DESKTOP_DOLLHOUSE_1B: "O use las teclas de dirección para girar la Dollhouse.",
  14030. 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.",
  14031. HELP_DESKTOP_FLOORPLAN_2A: "Haga clic derecho y arrastre hacia la izquierda o derecha para girar la planta.",
  14032. HELP_DESKTOP_FLOORPLAN_3A: "Use la rueda de desplazamiento para acercar o alejar.",
  14033. HELP_DESKTOP_FLOORPLAN_2B: "O use las teclas para girar hacia la izquierda o derecha.",
  14034. HELP_DESKTOP_FLOORPLAN_3B: "O use las teclas de dirección para acercar o alejar.",
  14035. HELP_MOBILE_PANORAMA_1: "Toque y arrastre para mirar alrededor del espacio.",
  14036. HELP_MOBILE_PANORAMA_2: "Toque en los aros a lo largo del espacio para moverse.",
  14037. HELP_MOBILE_3: "Use el gesto de pellizcar para acercar o alejar.",
  14038. HELP_MOBILE_360_2: "Toque el ícono Vista Interior para entrar en el Espacio.",
  14039. HELP_MOBILE_DOLLHOUSE_1: "Toque y arrastre con dos dedos para cambiar la posición della dollhouse.",
  14040. HELP_MOBILE_DOLLHOUSE_2: "Toque y arrastre con dos dedos para cambiar la posición de la vista aérea.",
  14041. HELP_MOBILE_FLOORPLAN_1: "Toque y arrastre para cambiar la posición de la planta.",
  14042. HELP_MOBILE_FLOORPLAN_2: "Toque y arrastre con dos dedos para girar la planta.",
  14043. HELP_MORE_HLR_A: "Galería destacada",
  14044. HELP_DESKTOP_MORE_HLR_B: "Abra para navegar a través del espacio utilizando imágenes en miniatura.",
  14045. HELP_MORE_DOLLHOUSE_A: "Vista aérea por pisos",
  14046. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Haga clic para ver y girar la Dollhouse del espacio completo en 3D.",
  14047. HELP_MOBILE_MORE_DOLLHOUSE_B: "Toque para ver y girar la vista Dollhouse del espacio completo en 3D.",
  14048. HELP_MORE_FLOORS_A: "Seleccionador de plantas",
  14049. HELP_DESKTOP_MORE_FLOORS_B: "Cambie de una planta a otra en el espacio.",
  14050. HELP_MORE_TAG_A: "tag™ Posts",
  14051. HELP_DESKTOP_MORE_TAG_B: "Haga clic o coloque el cursor para obtener más información acerca de las características del espacio.",
  14052. HELP_MOBILE_MORE_TAG_B: "Toque para obtener más información acerca de las características del espacio.",
  14053. HELP_MORE_ZOOM_A: "Controles de zoom",
  14054. HELP_DESKTOP_MORE_ZOOM_B: "Use estos controles o la rueda de desplazamiento para acercar o alejar.",
  14055. HELP_MORE_TOUR_A: "Controles de recorrido",
  14056. HELP_DESKTOP_MORE_TOUR_B: "Reproduzca, pause, adelante o retroceda a través de un recorrido guiado.",
  14057. HELP_MORE_INSIDE_A: "Vista interior",
  14058. HELP_DESKTOP_MORE_INSIDE_B: "Haga clic para explorar el interior del espacio.",
  14059. HELP_MOBILE_MORE_INSIDE_B: "Toque para explorar el interior del espacio.",
  14060. HELP_MORE_VR_A: "Modo de realidad virtual",
  14061. HELP_DESKTOP_MORE_VR_B: "Toque para ver el espacio en realidad virtual.",
  14062. HELP_MOBILE_MORE_VR_B: "Toque para ver el espacio en realidad virtual.",
  14063. HELP_MORE_360_A: "360° Views",
  14064. HELP_DESKTOP_MORE_360_B: "Una vez que se encuentre en galería destacada, haga clic en vistas de 360º para ver el exterior.",
  14065. HELP_MOBILE_MORE_360_B: "Una vez que se encuentre en galería destacada, toque en vistas de 360º para ver el exterior.",
  14066. HELP_MORE_FULLSCREEN_A: "Pantalla completa",
  14067. HELP_DESKTOP_MORE_FULLSCREEN_B: "Expanda el escenario 3D para verlo en pantalla completa.",
  14068. WEBVR_FOR_CARDBOARD: "Para Google Cardboard",
  14069. WEBVR_FOR_DAYDREAM: "Para Daydream View",
  14070. WEBVR_ENTER_WEBVR: "ENTRAR VR",
  14071. WEBVR_DIFFERENT_HEADSET: "¿Tiene un auricular diferente?",
  14072. WEBVR_LEARN_MORE: "Más información",
  14073. WEBVR_VIEW_SPACE: "Ver Espacio en VR",
  14074. WEBVR_DAYDREAM_VIEW: "Daydream View",
  14075. WEBVR_DAYDREAM_PHONE: "Daydream Teléfono listos",
  14076. WEBVR_VIEW_CARDBOARD: "O Ver en Google Cardboard",
  14077. VR_NEED_DAYDREAM: "Necesidades antes de acoplarse con Daydream View",
  14078. VR_NEED_DAYDREAM_PHONE: "Teléfono listo para Daydream",
  14079. VR_GOOGLE_DAYDREAM: "Daydream de Google",
  14080. VR_APP: "port VR App",
  14081. VR_COMPATIBLE_ANDROID_LONG: 'Compatible con los Dispositivos Android con Pantallas de 4.5"-5.5" operando Android OS 4.4.4 y posteriores',
  14082. VR_APP_FOR_ANDROID: "Aplicación port VR para Teléfonos Android",
  14083. VR_APP_OPEN: "Abrir con la aplicación port VR en su lugar",
  14084. VR_VIEW_SPACE: "Ver Espacio en realidad virtual",
  14085. VR_LEARN_MORE_CAPS: "SABER MÁS",
  14086. VR_PREVIOUS_CAPS: "ANTERIOR",
  14087. VR_NEXT_CAPS: "SIGUIENTE",
  14088. VR_GOT_IT_CAPS: "COMPRENDIDO",
  14089. VR_SHOW_SUPPORTED: "Pulse para ver el Espacio en realidad virtual con",
  14090. VR_SHOW_UNSUPPORTED: "Lo sentimos, pero su dispositivo no cumple los requisitos mínimos para ver un Espacio en realidad virtual.",
  14091. VR_SHOW_IOS_1: "Pulse para ver el Espacio en realidad virtual",
  14092. VR_SHOW_IOS_2: "Necesita la aplicación port VR y un iPhone compatible para ver",
  14093. VR_WHAT_YOU_NEED: "Lo que necesitaras...",
  14094. VR_NEED_CARDBOARD: "Lo que necesitaras con Google Cardboard",
  14095. VR_NEED_SAMSUNG: "Lo que necesitaras con el Samsung Gear VR",
  14096. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  14097. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  14098. VR_COMPATIBLE_IPHONES_1: "iPhones",
  14099. VR_COMPATIBLE_IPHONES_2: "Compatible con iPhone 6S o superior y con iOS 9.1 en adelante",
  14100. VR_COMPATIBLE_IPHONES_3: "iPhones compatibles",
  14101. VR_COMPATIBLE_ANDROID: "Dispositivos Android compatibles",
  14102. VR_ANDROID_DETAIL: "Pantallas de 11.43 cm a 13.97 cm con OS de Android 4.4.4 en adelante",
  14103. VR_ANDROID_DVICES: "Dispositivos Android",
  14104. VR_COMPATIBLE_SAMSUNG: "Dispositivos compatibles del Samsung",
  14105. VR_SAMSUNG_DETAIL: "Galaxy S5 en adelante",
  14106. VR_APP_FOR_CARDBOARD: "Aplicación port VR para Google Cardboard",
  14107. VR_APP_FOR_SAMSUNG: "Aplicación port VR para Gear VR",
  14108. VR_DOWNLOAD_HERE: "Descargar aquí",
  14109. VR_REQUIRE_HEADSET: "Necesita un casco de realidad virtual y que se instale la aplicación port VR para Android",
  14110. VR_REDIRECT_TO_STORE: "Si la aplicación no está instalada, se le redirigirá a la tienda de aplicaciones.",
  14111. VR_IMPROPER_EMBED: "El espacio de port no está incorporado correctamente para apoyar VR en su navegador web.",
  14112. VR_OPEN_ANDROID_LINK: "Abre el enlace en tu teléfono móvil",
  14113. VR_ANDROID_OPTIONS: "Opciones de auriculares en RV disponibles",
  14114. SHARE_TO: "Compartir en",
  14115. SHARE_LINK: "Enlace directo",
  14116. SHARE_EXPLORE: "Explorar ",
  14117. SHARE_AT: "en",
  14118. SHARE_WITH: "con",
  14119. SHARE_3D: " en 3D",
  14120. SHARE_COPIED: "¡Copiado!",
  14121. ERROR_BROWSER_SOLUTION: "Instale un nuevo navegador para explorar en 3D.",
  14122. ERROR_BROWSER_EXPLANATION: "WebGL requiere un navegador moderno.",
  14123. ERROR_GENERIC_PROBLEM: "Vaya, algo ha ido mal.",
  14124. ERROR_GENERIC_SOLUTION: "Reinicie su navegador.",
  14125. ERROR_GENERIC_ACTIONS_1: "Si el problema persiste, ",
  14126. ERROR_GENERIC_ACTIONS_2: "instale un navegador compatible",
  14127. ERROR_GENERIC_ACTIONS_3: " o ",
  14128. ERROR_GENERIC_ACTIONS_4: "consulte nuestra guía de solución de problemas",
  14129. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Navegador no compatible.",
  14130. ERROR_WEBGL_IOS_PROBLEM: "Versión de iOS no compatible.",
  14131. ERROR_WEBGL_IOS_SOLUTION: "Actualice a iOS 8 o superior para explorar en 3D.",
  14132. ERROR_WEBGL_IOS_ACTIONS_1: "Pulse ",
  14133. ERROR_WEBGL_IOS_ACTIONS_2: "Ajustes > General > Actualización de software",
  14134. ERROR_WEBGL_SAFARI_PROBLEM: "Habilite WebGL para explorar en 3D.",
  14135. ERROR_WEBGL_SAFARI_ACTIONS_1: "Haga clic en ",
  14136. ERROR_WEBGL_SAFARI_ACTIONS_2: "Preferencias > Avanzado > Mostrar el menú Desarrollar",
  14137. ERROR_WEBGL_SAFARI_ACTIONS_3: "Después, haga clic en ",
  14138. ERROR_WEBGL_SAFARI_ACTIONS_4: "Desarrollar > Habilitar WebGL",
  14139. ERROR_MISSING_URLS_PROBLEM: "Vaya, no hay panoramas para este modelo.",
  14140. ERROR_MISSING_URLS_EXPLANATION: "Este es un modelo antiguo. El propietario del sitio web puede tener un nuevo modelo en mente.",
  14141. ERROR_LOADING_FAILED_PROBLEM: "Vaya, modelo no disponible.",
  14142. ERROR_LOADING_FAILED_ACTIONS_1: "Si el problema persiste, ",
  14143. ERROR_LOADING_FAILED_ACTIONS_2: "consulte nuestra guía de solución de problemas",
  14144. ERROR_MAINTENANCE_PROBLEM: "Mantenimiento en progreso.",
  14145. ERROR_MAINTENANCE_SOLUTION: "Regrese en unos minutos.",
  14146. LINK_TO_LOCATION: "Enlace a la ubicación",
  14147. MENU_COPY: "Copiar",
  14148. LINK_ALERT_COPY: "Utilice CTRL/CMD + C para copiar.",
  14149. ROTATE: "Girar",
  14150. INSIDE: "Interior",
  14151. MOVE: "Moverse",
  14152. ZOOM: "Acercar o alejar"
  14153. }
  14154. }
  14155. , {}],
  14156. 113: [function(e, t, i) {
  14157. "use strict";
  14158. t.exports = {
  14159. PAGE_TITLE: "",
  14160. LOADING: "Chargement",
  14161. PRESENTED_BY_CAPS: "PRÉSENTÉ PAR",
  14162. POWERED_BY: "alimenté par ",
  14163. POWERED_BY_CAPS: "ALIMENTÉ PAR",
  14164. DESKTOP_SHORT_CTA: "Cliquez pour explorer l'Espace 3D.",
  14165. MOBILE_SHORT_CTA: "Cliquez pour explorer l'Espace 3D.",
  14166. PRESENTED_BY: "Présenté par ",
  14167. MORE: "Plus ",
  14168. LESS: "Moins ",
  14169. TAG_CONTENT: "Contenu tag™",
  14170. SHOW: "Montrer",
  14171. HIDE: "Cacher",
  14172. DOLLHOUSE: "Dollhouse",
  14173. FLOOR_PLAN: "Plan de sol",
  14174. OPEN_HIGHLIGHTS: "Ouvrir les faits saillants",
  14175. CLOSE_HIGHLIGHTS: "Fermer",
  14176. PREVIOUS: "Précédent",
  14177. PLAY: "Lecture",
  14178. PAUSE: "Pause",
  14179. NEXT: "Suivant",
  14180. EXPLORE_3D_SPACE: "Explorer l'Espace en 3D",
  14181. VIEW_DOLLHOUSE: "Voir dollhouse",
  14182. SOCIAL_SHARING: "Partager cet espace",
  14183. VIEW_IN_VR: "Voir en VR",
  14184. VIEW_FULLSCREEN: "Plein écran",
  14185. EXIT_FULLSCREEN: "Fermer plein écran",
  14186. ZOOM_IN: "Zoom avant",
  14187. ZOOM_OUT: "Zoom arrière",
  14188. FLOOR_NAME: "Étage ",
  14189. FLOOR_ALL: "Tous",
  14190. TERMS: "Mentions légales",
  14191. PORT_TERMS: "port mentions légales",
  14192. TERMS_OF_USE: "Conditions d'utilisation",
  14193. TERMS_TEXT_FILE: "terms-fr-FR.html",
  14194. CLOSE_TERMS: "Fermer",
  14195. TERMS_FAIL: "Impossible d'accéder aux mentions légales. Vérifiez que vous avez une connexion Internet pour afficher les conditions d'utilisation.",
  14196. HELP: "Aide",
  14197. HELP_NAVIGATION_TAB: "Navigation",
  14198. HELP_MORE_HELP_TAB: "Aide",
  14199. CLOSE: "Fermer",
  14200. HELP_DESKTOP_PANORAMA_1A: "Cliquez et faites glisser pour regarder autour de l’espace.",
  14201. HELP_DESKTOP_PANORAMA_2A: "Cliquez sur les anneaux pour vous déplacer.",
  14202. HELP_DESKTOP_PANORAMA_3A: "Utilisez la molette de votre souris pour zoomer.",
  14203. HELP_DESKTOP_PANORAMA_1B: "Ou utilisez les touches pour tourner.",
  14204. HELP_DESKTOP_PANORAMA_2B: "Ou utilisez les touches pour avancer et reculer.",
  14205. HELP_DESKTOP_PANORAMA_3B: "Ou utilisez les touches plus et moins pour zoomer.",
  14206. HELP_DESKTOP_360_2A: "Cliquez sur l’icône Vue Intérieure pour entrer dans l’Espace.",
  14207. HELP_DESKTOP_360_2B: "Ou, appuyez sur la touche numéro 1 pour entrer dans la Vue Intérieure.",
  14208. HELP_DESKTOP_DOLLHOUSE_1A: "Faites un clic gauche et bougez votre souris pour faire pivoter la vue Dollhouse.",
  14209. HELP_DESKTOP_DOLLHOUSE_2A: "Faites un clic droit et bougez votre souris pour changer la position de la vue Dollhouse.",
  14210. HELP_DESKTOP_DOLLHOUSE_3A: "Utilisez la molette de votre souris pour zoomer.",
  14211. HELP_DESKTOP_DOLLHOUSE_1B: "Ou utilisez les touches pour faire pivoter la vue Dollhouse.",
  14212. HELP_DESKTOP_FLOORPLAN_1A: "Faites un clic droit pour changer la position du plan sur l’écran.",
  14213. HELP_DESKTOP_FLOORPLAN_2A: "Faites un clic droit et faites glisser à gauche ou à droite pour faire pivoter le plan.",
  14214. HELP_DESKTOP_FLOORPLAN_3A: "Utilisez la molette de votre souris pour zoomer.",
  14215. HELP_DESKTOP_FLOORPLAN_2B: "Ou utilisez les touches pour faire pivoter à gauche ou à droite.",
  14216. HELP_DESKTOP_FLOORPLAN_3B: "Ou utilisez les touches pour effectuer un zoom avant ou arrière.",
  14217. HELP_MOBILE_PANORAMA_1: "Touchez et faites glisser pour regarder autour de l’espace.",
  14218. HELP_MOBILE_PANORAMA_2: "Tapez sur les anneaux dans tout l’espace pour vous déplacer.",
  14219. HELP_MOBILE_3: "Utilisez un geste de pincement pour zoomer avant/arrière.",
  14220. HELP_MOBILE_360_2: "Tapez sur l’icône Vue Intérieure pour entrer dans l’Espace.",
  14221. HELP_MOBILE_DOLLHOUSE_1: "Touchez et faites glisser vers le haut/bas/gauche/droite pour faire pivoter la vue Dollhouse.",
  14222. HELP_MOBILE_DOLLHOUSE_2: "Touchez et faites glisser avec deux doigts pour positionner vue en coupe.",
  14223. HELP_MOBILE_FLOORPLAN_1: "Touchez et faites glisser pour positionner le plan.",
  14224. HELP_MOBILE_FLOORPLAN_2: "Touchez et faites glisser avec deux doigts pour faire pivoter le plan.",
  14225. HELP_MORE_HLR_A: "Carrousel",
  14226. HELP_DESKTOP_MORE_HLR_B: "Ouvrez pour naviguer dans l’espace en utilisant les vignettes.",
  14227. HELP_MORE_DOLLHOUSE_A: "Vue en coupe",
  14228. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Cliquez pour afficher et faire pivoter l’espace entier en 3D.",
  14229. HELP_MOBILE_MORE_DOLLHOUSE_B: "Tapez pour afficher et faire pivoter l’espace entier en 3D.",
  14230. HELP_MORE_FLOORS_A: "Sélecteur d’étage",
  14231. HELP_DESKTOP_MORE_FLOORS_B: "Basculer entre les étages dans l’espace.",
  14232. HELP_MORE_TAG_A: "tag™ Posts",
  14233. HELP_DESKTOP_MORE_TAG_B: "Cliquez ou survolez pour obtenir des informations sur l’espace.",
  14234. HELP_MOBILE_MORE_TAG_B: "Tapez pour obtenir des informations sur l’espace.",
  14235. HELP_MORE_ZOOM_A: "Commandes de zoom",
  14236. HELP_DESKTOP_MORE_ZOOM_B: "Utilisez votre clavier ou la molette de votre souris pour zoomer.",
  14237. HELP_MORE_TOUR_A: "Commandes de la visite",
  14238. HELP_DESKTOP_MORE_TOUR_B: "Mettez en marche ou en pause, avancez et reculez lors d'une visite guidée.",
  14239. HELP_MORE_INSIDE_A: "Vue intérieure",
  14240. HELP_DESKTOP_MORE_INSIDE_B: "Cliquez pour explorer l’intérieur de l’espace.",
  14241. HELP_MOBILE_MORE_INSIDE_B: "Tapez pour explorer l’intérieur de l’espace.",
  14242. HELP_MORE_VR_A: "Mode RV",
  14243. HELP_DESKTOP_MORE_VR_B: "Cliquez pour lancer l’espace en réalité virtuelle.",
  14244. HELP_MOBILE_MORE_VR_B: "Tapez pour lancer l’espace en réalité virtuelle.",
  14245. HELP_MORE_360_A: "Vues 360°",
  14246. HELP_DESKTOP_MORE_360_B: "Cliquez sur vues 360°, dans le carrousel pour voir les scènes extérieures.",
  14247. HELP_MOBILE_MORE_360_B: "Tapez sur vues 360°, dans le carrousel pour voir les scènes extérieures.",
  14248. HELP_MORE_FULLSCREEN_A: "Plein écran",
  14249. HELP_DESKTOP_MORE_FULLSCREEN_B: "Voir 3D Showcase en plein écran.",
  14250. WEBVR_FOR_CARDBOARD: "Pour Google Cardboard",
  14251. WEBVR_FOR_DAYDREAM: "Pour Daydream View",
  14252. WEBVR_ENTER_WEBVR: "ENTRER VR",
  14253. WEBVR_DIFFERENT_HEADSET: "Avez-vous un casque différent?",
  14254. WEBVR_LEARN_MORE: "En savoir plus",
  14255. WEBVR_VIEW_SPACE: "Voir Espace en VR",
  14256. WEBVR_DAYDREAM_VIEW: "Daydream View",
  14257. WEBVR_DAYDREAM_PHONE: "Téléphone compatibles Daydream",
  14258. WEBVR_VIEW_CARDBOARD: "Ou Afficher sur Google Cardboard",
  14259. VR_VIEW_SPACE: "Voir l'Espace en Réalité Virtuelle",
  14260. VR_LEARN_MORE_CAPS: "EN SAVOIR PLUS",
  14261. VR_PREVIOUS_CAPS: "PRÉCÉDENT",
  14262. VR_NEXT_CAPS: "SUIVANT",
  14263. VR_GOT_IT_CAPS: "BIEN COMPRIS",
  14264. VR_SHOW_SUPPORTED: "Taper pour voir l'Espace en VR avec",
  14265. VR_SHOW_UNSUPPORTED: "Désolé mais votre appareil ne répond pas aux critères minimaux pour voir cet Espace en mode VR.",
  14266. VR_SHOW_IOS_1: "Taper pour voir l’Espace en Realité Virtuelle",
  14267. VR_SHOW_IOS_2: "Nécessite l’application port VR et un iPhone compatible pour voir",
  14268. VR_WHAT_YOU_NEED: "Ce dont vous aurez besoin pour...",
  14269. VR_NEED_CARDBOARD: "Ce dont vous aurez besoin avec Google Cardboard",
  14270. VR_NEED_SAMSUNG: "Ce dont vous aurez besoin avec Samsung Gear VR",
  14271. VR_NEED_DAYDREAM: "BESOINS AVANT APPARIEMENT AVEC DAYDREAM VIEW",
  14272. VR_NEED_DAYDREAM_PHONE: "Téléphone compatible avec Daydream",
  14273. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  14274. VR_GOOGLE_DAYDREAM: "Google Daydream",
  14275. VR_APP: "port VR App",
  14276. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  14277. VR_COMPATIBLE_IPHONES_1: "iPhones",
  14278. VR_COMPATIBLE_IPHONES_2: "iPhone 5s et plus récent, avec iOS 9.1 et plus récent",
  14279. VR_COMPATIBLE_IPHONES_3: "iPhones compatibles",
  14280. VR_COMPATIBLE_ANDROID: "Appareils Android compatibles",
  14281. 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",
  14282. VR_ANDROID_DETAIL: 'Écrans 4.5" à 5.5" avec Android 4.4.4 ou plus récent',
  14283. VR_ANDROID_DVICES: "Appareils Android",
  14284. VR_COMPATIBLE_SAMSUNG: "Appareils Samsung Compatibles",
  14285. VR_SAMSUNG_DETAIL: "Galaxy S6 et plus récents",
  14286. VR_APP_FOR_CARDBOARD: "Application port VR pour Google Cardboard",
  14287. VR_APP_FOR_SAMSUNG: "Application port VR pour Gear VR",
  14288. VR_APP_FOR_ANDROID: "Application port VR pour téléphones Android",
  14289. VR_APP_OPEN: "Ouvrir plutôt avec l’application port VR",
  14290. VR_DOWNLOAD_HERE: "Télécharger ici",
  14291. VR_REQUIRE_HEADSET: "Nécessite un casque VR et l'application port VR pour Android afin d'être installé",
  14292. VR_REDIRECT_TO_STORE: "Si l'application n'est pas installée, vous serez rediriger vers l'App store.",
  14293. VR_IMPROPER_EMBED: "L'Espace port n'est pas correctement intégré pour supporter VR dans votre navigateur Web.",
  14294. VR_OPEN_ANDROID_LINK: "Ouvrez ce lien avec votre appareil mobile",
  14295. VR_ANDROID_OPTIONS: "Options disponibles pour casque VR sous",
  14296. SHARE_TO: "Partager sur",
  14297. SHARE_LINK: "Lien direct",
  14298. SHARE_EXPLORE: "Explorer ",
  14299. SHARE_AT: "à",
  14300. SHARE_WITH: "avec",
  14301. SHARE_3D: " en 3D",
  14302. SHARE_COPIED: "Copié!",
  14303. ERROR_BROWSER_SOLUTION: "Installer un nouveau navigateur pour explorer en 3D.",
  14304. ERROR_BROWSER_EXPLANATION: "WebGL a besoin d'un navigateur récent.",
  14305. ERROR_GENERIC_PROBLEM: "Il y eu un problème.",
  14306. ERROR_GENERIC_SOLUTION: "Redémarrer votre navigateur.",
  14307. ERROR_GENERIC_ACTIONS_1: "Si le problème persiste, ",
  14308. ERROR_GENERIC_ACTIONS_2: "installez un navigateur plus récent",
  14309. ERROR_GENERIC_ACTIONS_3: " ou ",
  14310. ERROR_GENERIC_ACTIONS_4: "voir notre guide de dépannage",
  14311. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Navigateur non-supporté.",
  14312. ERROR_WEBGL_IOS_PROBLEM: "Version iOS non-supportée.",
  14313. ERROR_WEBGL_IOS_SOLUTION: "Mettre à jour avec iOS8 au minimum pour voir l'Espace en 3D.",
  14314. ERROR_WEBGL_IOS_ACTIONS_1: "Tapez ",
  14315. ERROR_WEBGL_IOS_ACTIONS_2: "Paramètres > Général > Mise à jour Software",
  14316. ERROR_WEBGL_SAFARI_PROBLEM: "Activez WegGL pour explorer en 3D.",
  14317. ERROR_WEBGL_SAFARI_ACTIONS_1: "Cliquez ",
  14318. ERROR_WEBGL_SAFARI_ACTIONS_2: "Préferences > Avancés > Voir menu développeur",
  14319. ERROR_WEBGL_SAFARI_ACTIONS_3: "Puis cliquez ",
  14320. ERROR_WEBGL_SAFARI_ACTIONS_4: "Développe > Activé WebGL",
  14321. ERROR_MISSING_URLS_PROBLEM: "Il n'y a pas de panoromas pour ce modèle.",
  14322. ERROR_MISSING_URLS_EXPLANATION: "Ceci est un ancien modèle. Le propriétaire du site a peut-être un nouveau modèle en cours.",
  14323. ERROR_LOADING_FAILED_PROBLEM: "Ce modèle n'est pas disponible.",
  14324. ERROR_LOADING_FAILED_ACTIONS_1: "Si le problème persiste, ",
  14325. ERROR_LOADING_FAILED_ACTIONS_2: "voir notre guide de dépannage",
  14326. ERROR_MAINTENANCE_PROBLEM: "Maintenance en cours.",
  14327. ERROR_MAINTENANCE_SOLUTION: "Revenez dans quelques instants.",
  14328. LINK_TO_LOCATION: "Lien vers l'emplacement",
  14329. MENU_COPY: "Copie",
  14330. LINK_ALERT_COPY: "Utiliser CTRL+CMD C pour copier.",
  14331. ROTATE: "Faire pivoter",
  14332. INSIDE: "Intérieure",
  14333. MOVE: "Se déplacer",
  14334. ZOOM: "Zoom"
  14335. }
  14336. }
  14337. , {}],
  14338. 114: [function(e, t, i) {
  14339. "use strict";
  14340. t.exports = {
  14341. PAGE_TITLE: "",
  14342. LOADING: "読み込み中",
  14343. PRESENTED_BY_CAPS: "PRESENTED BY",
  14344. POWERED_BY: "powered by",
  14345. POWERED_BY_CAPS: "POWERED BY",
  14346. DESKTOP_SHORT_CTA: "クリックしてこの3D Spaceを探索",
  14347. MOBILE_SHORT_CTA: "タップしてこの3D Spaceを探索",
  14348. PRESENTED_BY: "Presented by ",
  14349. MORE: "全て表示 ",
  14350. LESS: "閉じる ",
  14351. TAG_CONTENT: "tag™コンテンツ ",
  14352. SHOW: "表示",
  14353. HIDE: "非表示",
  14354. DOLLHOUSE: "ドールハウス",
  14355. FLOOR_PLAN: "フロアプラン",
  14356. OPEN_HIGHLIGHTS: "ハイライトを開く",
  14357. CLOSE_HIGHLIGHTS: "閉じる",
  14358. PREVIOUS: "前へ",
  14359. PLAY: "再生",
  14360. PAUSE: "一時停止",
  14361. NEXT: "次へ",
  14362. EXPLORE_3D_SPACE: "3DSpaceの探索",
  14363. VIEW_DOLLHOUSE: "ドールハウスの表示",
  14364. SOCIAL_SHARING: "このSpaceを共有する",
  14365. VIEW_IN_VR: "VRで表示",
  14366. VIEW_FULLSCREEN: "フルスクリーン表示",
  14367. EXIT_FULLSCREEN: "フルスクリーン表示を終了",
  14368. ZOOM_IN: "ズームイン",
  14369. ZOOM_OUT: "ズームアウト",
  14370. FLOOR_NAME: "フロア ",
  14371. FLOOR_ALL: "すべて",
  14372. TERMS: "規約",
  14373. PORT_TERMS: "port規約",
  14374. TERMS_OF_USE: "利用規約",
  14375. CLOSE_TERMS: "閉じる",
  14376. TERMS_TEXT_FILE: "terms-jp-JP.html",
  14377. TERMS_FAIL: "規約を取得できませんでした。利用規約を表示するためにインターネットに接続されていることを確認してください。",
  14378. WEBVR_FOR_DAYDREAM: "Daydream View用",
  14379. WEBVR_ENTER_WEBVR: "VRに入る",
  14380. WEBVR_DIFFERENT_HEADSET: "別のヘッドセットをお持ちですか?",
  14381. WEBVR_LEARN_MORE: "もっと詳しく",
  14382. WEBVR_VIEW_SPACE: "VRでSpaceを表示",
  14383. WEBVR_DAYDREAM_VIEW: "Daydream View",
  14384. WEBVR_DAYDREAM_PHONE: "Daydream対応スマホ",
  14385. WEBVR_FOR_CARDBOARD: "Google Cardboard用",
  14386. WEBVR_VIEW_CARDBOARD: "またはGoogle Cardboardで表示",
  14387. VR_VIEW_SPACE: "バーチャルリアリティでSpaceを表示",
  14388. VR_LEARN_MORE_CAPS: "もっと詳しく",
  14389. VR_PREVIOUS_CAPS: "前へ",
  14390. VR_NEXT_CAPS: "次へ",
  14391. VR_GOT_IT_CAPS: "了解",
  14392. VR_SHOW_SUPPORTED: "タップして次を使用してVRでSpaceを表示: ",
  14393. VR_SHOW_UNSUPPORTED: "お使いのデバイスはVRでSpaceを表示する最低要件を満たしていません",
  14394. VR_SHOW_IOS_1: "タップしてVRでSpaceを表示",
  14395. VR_SHOW_IOS_2: "表示するにはport VRアプリと互換性のあるiPhoneが必要です",
  14396. VR_WHAT_YOU_NEED: "必要なもの",
  14397. VR_NEED_CARDBOARD: "Google Cardboardに必要なもの",
  14398. VR_NEED_SAMSUNG: "Samsung Gear VRに必要なもの",
  14399. VR_NEED_DAYDREAM: "事前にDaydream Viewとのペアリングが必要です",
  14400. VR_NEED_DAYDREAM_PHONE: "Daydream対応スマホ",
  14401. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  14402. VR_GOOGLE_DAYDREAM: "Google Daydream",
  14403. VR_APP: "port VRアプリ",
  14404. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  14405. VR_COMPATIBLE_IPHONES_1: "iPhone",
  14406. VR_COMPATIBLE_IPHONES_2: "iOS 9.1以降で動作するiPhone 5s以降のモデル",
  14407. VR_COMPATIBLE_IPHONES_3: "互換性のあるiPhone",
  14408. VR_COMPATIBLE_ANDROID: "互換性のあるAndroidデバイス",
  14409. VR_COMPATIBLE_ANDROID_LONG: "Android OS 4.4.4以降で動作する互換性のあるAndroidデバイスの4.5~5.5インチディスプレイ",
  14410. VR_ANDROID_DETAIL: "Android OS 4.4.4以降で動作する4.5~5.5インチディスプレイ",
  14411. VR_ANDROID_DVICES: "Androidデバイス",
  14412. VR_COMPATIBLE_SAMSUNG: "互換性のあるSamsungデバイス",
  14413. VR_SAMSUNG_DETAIL: "Galaxy S5以降のモデル",
  14414. VR_APP_FOR_CARDBOARD: "Google Cardboard用のport VRアプリ",
  14415. VR_APP_FOR_SAMSUNG: "Gear VR 用のport VRアプリ",
  14416. VR_APP_FOR_ANDROID: "Androidフォン用のport VRアプリ",
  14417. VR_APP_OPEN: "port VRアプリで開く",
  14418. VR_DOWNLOAD_HERE: "ここからダウンロード",
  14419. VR_REQUIRE_HEADSET: "Android 用のVRヘッドセットとport VRアプリ をインストールする必要があります",
  14420. VR_REDIRECT_TO_STORE: "アプリがインストールされていない場合、App Storeにリダイレクトされます",
  14421. VR_IMPROPER_EMBED: "お使いのウェブブラウザでVRがサポートされるようport Spaceが適切に埋め込まれていません。",
  14422. VR_OPEN_ANDROID_LINK: "お使いの携帯電話でリンクを開いてください",
  14423. VR_ANDROID_OPTIONS: "利用可能なVRヘッドセットオプション",
  14424. SHARE_TO: "共有先",
  14425. SHARE_LINK: "ダイレクトリンク",
  14426. SHARE_EXPLORE: "探索",
  14427. SHARE_AT: "場所",
  14428. SHARE_WITH: "使用アプリ",
  14429. SHARE_3D: "3Dで",
  14430. SHARE_COPIED: "コピーされました!",
  14431. ERROR_BROWSER_SOLUTION: "3D探索するには、新しいバージョンのブラウザをインストールしてください",
  14432. ERROR_BROWSER_EXPLANATION: "WebGLにはモダンブラウザが必要です。",
  14433. ERROR_GENERIC_PROBLEM: "問題が発生しました。",
  14434. ERROR_GENERIC_SOLUTION: "ブラウザを再起動してください。",
  14435. ERROR_GENERIC_ACTIONS_1: "問題が解決しない場合は、",
  14436. ERROR_GENERIC_ACTIONS_2: "サポートされているブラウザをインストールしてください",
  14437. ERROR_GENERIC_ACTIONS_3: "または",
  14438. ERROR_GENERIC_ACTIONS_4: "トラブルシューティングガイドを参照してください",
  14439. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "ブラウザがサポートされていません。",
  14440. ERROR_WEBGL_IOS_PROBLEM: "サポートされていないiOSバージョンです。",
  14441. ERROR_WEBGL_IOS_SOLUTION: "3D探索するには、iOS 8以降にアップグレードしてください。",
  14442. ERROR_WEBGL_IOS_ACTIONS_1: "以下の順にタップします:",
  14443. ERROR_WEBGL_IOS_ACTIONS_2: "設定 > 全般 > ソフトウェアの更新",
  14444. ERROR_WEBGL_SAFARI_PROBLEM: "WebGLを有効にして3Dで探索します。",
  14445. ERROR_WEBGL_SAFARI_ACTIONS_1: "以下の順にクリックします:",
  14446. ERROR_WEBGL_SAFARI_ACTIONS_2: "環境設定 > 詳細 > メニューバーに開発メニューを表示",
  14447. ERROR_WEBGL_SAFARI_ACTIONS_3: "その後、以下の順にクリックします:",
  14448. ERROR_WEBGL_SAFARI_ACTIONS_4: "開発 > WebGLを有効にする",
  14449. ERROR_MISSING_URLS_PROBLEM: "このモデルではパノラマを使用できません。",
  14450. ERROR_MISSING_URLS_EXPLANATION: "これは古いモデルです。ウェブサイト所有者が新しいモデルを開発中かもしれません。",
  14451. ERROR_LOADING_FAILED_PROBLEM: "モデルは利用できません。",
  14452. ERROR_LOADING_FAILED_ACTIONS_1: "問題が解決しない場合は、",
  14453. ERROR_LOADING_FAILED_ACTIONS_2: "トラブルシューティングガイドを参照してください",
  14454. ERROR_MAINTENANCE_PROBLEM: "メンテナンスは進行中です。",
  14455. ERROR_MAINTENANCE_SOLUTION: "しばらくしてからやり直し てください。",
  14456. LINK_TO_LOCATION: "ロケーションへのリンク",
  14457. MENU_COPY: "コピー",
  14458. LINK_ALERT_COPY: "コピーするにはCTRL/CMD + Cを使用してください。",
  14459. ROTATE: "回転",
  14460. MOVE: "移動",
  14461. INSIDE: "内側",
  14462. ZOOM: "ズーム",
  14463. HELP: "ヘルプ",
  14464. HELP_NAVIGATION_TAB: "ナビゲーション",
  14465. HELP_MORE_HELP_TAB: "その他のヘルプ",
  14466. HELP_DESKTOP_PANORAMA_1A: "Spaceを見回すには、クリックしてドラッグします。",
  14467. HELP_DESKTOP_PANORAMA_2A: "移動するには、Space全体にあるリングをクリックします。",
  14468. HELP_DESKTOP_PANORAMA_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
  14469. HELP_DESKTOP_PANORAMA_1B: "または、矢印キーを使用して左右に向きを変えます。",
  14470. HELP_DESKTOP_PANORAMA_2B: "または、矢印キーを使用して前後に向きを変えます。",
  14471. HELP_DESKTOP_PANORAMA_3B: "あるいは、プラス(+)キーまたはマイナス(-)キーを使用して、ズームイン、ズームアウトします。",
  14472. HELP_DESKTOP_360_2A: "内側ビューアイコンをクリックしてSpaceに入ります。",
  14473. HELP_DESKTOP_360_2B: "または、数字キー1を押して内側ビューに入ります。",
  14474. HELP_DESKTOP_DOLLHOUSE_1A: "左クリックと左右、上下のドラッグでドールハウスを回転します。",
  14475. HELP_DESKTOP_DOLLHOUSE_2A: "右クリックと左右、上下のドラッグでドールハウスの画面上の位置を変更します。",
  14476. HELP_DESKTOP_DOLLHOUSE_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
  14477. HELP_DESKTOP_DOLLHOUSE_1B: "または、矢印キーを使用してドールハウスを回転します。",
  14478. HELP_DESKTOP_FLOORPLAN_1A: "左ボタンを押しながら、上下左右にドラッグしてフロアプランの画面上の位置を変更します。",
  14479. HELP_DESKTOP_FLOORPLAN_2A: "右ボタンを押しながら左右にドラッグして、フロアプランを回転します。",
  14480. HELP_DESKTOP_FLOORPLAN_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
  14481. HELP_DESKTOP_FLOORPLAN_2B: "または、矢印キーを使用して左右に回転します。",
  14482. HELP_DESKTOP_FLOORPLAN_3B: "または、矢印キーを使用して、ズームイン、ズームアウトします。",
  14483. HELP_MOBILE_PANORAMA_1: "Spaceを見回すには、タッチしてドラッグします。",
  14484. HELP_MOBILE_PANORAMA_2: "移動するには、Space全体にあるリングをタップします。",
  14485. HELP_MOBILE_3: "ピンチジェスチャーを使用してズームイン、ズームアウトします。",
  14486. HELP_MOBILE_360_2: "内側ビューアイコンをタップしてSpaceに入ります。",
  14487. HELP_MOBILE_DOLLHOUSE_1: "タッチして上下左右にドラッグしてドールハウスを回転します。",
  14488. HELP_MOBILE_DOLLHOUSE_2: "タッチして、2本指でドラッグしてドールハウスを配置します。",
  14489. HELP_MOBILE_FLOORPLAN_1: "タッチ&ドラッグしてフロアプランを配置します。",
  14490. HELP_MOBILE_FLOORPLAN_2: "タッチして、2本指でドラッグしてフロアプランを回転します。",
  14491. HELP_MORE_HLR_A: "ハイライト",
  14492. HELP_DESKTOP_MORE_HLR_B: "サムネイル画像を使用してSpaceを移動するために開きます。",
  14493. HELP_MORE_DOLLHOUSE_A: "ドールハウス",
  14494. HELP_DESKTOP_MORE_DOLLHOUSE_B: "クリックして3DでSpace全体のトップダウンビューを表示して回転します。",
  14495. HELP_MOBILE_MORE_DOLLHOUSE_B: "タップして3DでSpace全体のトップダウンビューを表示して回転します。",
  14496. HELP_MORE_FLOORS_A: "フロアセレクター",
  14497. HELP_DESKTOP_MORE_FLOORS_B: "Space内のフロアを切り替えます。",
  14498. HELP_MORE_TAG_A: "tag™ Posts",
  14499. HELP_DESKTOP_MORE_TAG_B: "クリックするか、カーソルを置くとSpace内の機能についての説明が表示されます。",
  14500. HELP_MOBILE_MORE_TAG_B: "タップするとSpace内の機能についての説明が表示されます。",
  14501. HELP_MORE_ZOOM_A: "ズームコントロール",
  14502. HELP_DESKTOP_MORE_ZOOM_B: "これらのコントロールまたはスクロールホイールを使用して、ズームイン、ズームアウトします。",
  14503. HELP_MORE_TOUR_A: "ツアーコントロール",
  14504. HELP_DESKTOP_MORE_TOUR_B: "ガイド付きツアー中に再生、一時停止、前方・後方に移動します。",
  14505. HELP_MORE_INSIDE_A: "内側ビュー",
  14506. HELP_DESKTOP_MORE_INSIDE_B: "クリックしてSpace内を探索します。",
  14507. HELP_MOBILE_MORE_INSIDE_B: "タップしてSpace内を探索します。",
  14508. HELP_MORE_VR_A: "VRモード",
  14509. HELP_DESKTOP_MORE_VR_B: "クリックしてバーチャルリアリティでSpaceを起動します。",
  14510. HELP_MOBILE_MORE_VR_B: "タップしてバーチャルリアリティでSpaceを起動します。",
  14511. HELP_MORE_360_A: "360° Views",
  14512. HELP_DESKTOP_MORE_360_B: "Highlight Reelの360° Viewsをクリックして屋外シーンを表示します。",
  14513. HELP_MOBILE_MORE_360_B: "Highlight Reelの360° Viewsをタップして屋外シーンを表示します。",
  14514. HELP_MORE_FULLSCREEN_A: "フルスクリーン",
  14515. HELP_DESKTOP_MORE_FULLSCREEN_B: "3D Showcaseをフルスクリーン表示にします。",
  14516. CLOSE: "閉じる"
  14517. }
  14518. }
  14519. , {}],
  14520. 115: [function(e, t, i) {
  14521. "use strict";
  14522. t.exports = {
  14523. PAGE_TITLE: "",
  14524. LOADING: "Загрузка",
  14525. PRESENTED_BY_CAPS: "ПРЕДСТАВЛЕНО",
  14526. POWERED_BY: "разработано на платформе ",
  14527. POWERED_BY_CAPS: "РАЗРАБОТАНО НА ПЛАТФОРМЕ",
  14528. DESKTOP_SHORT_CTA: "Нажмите для просмотра.",
  14529. MOBILE_SHORT_CTA: "Нажмите для просмотра.",
  14530. PRESENTED_BY: "Представлено ",
  14531. MORE: "Больше ",
  14532. LESS: "Меньше ",
  14533. TAG_CONTENT: "tag™ Контент",
  14534. SHOW: "Показать",
  14535. HIDE: "Скрыть",
  14536. DOLLHOUSE: "Dollhouse",
  14537. FLOOR_PLAN: "Планировка",
  14538. OPEN_HIGHLIGHTS: "Открыть Фотоколлаж",
  14539. CLOSE_HIGHLIGHTS: "Закрыть",
  14540. PREVIOUS: "Предыдущий",
  14541. PLAY: "Воспроизвести",
  14542. PAUSE: "Пауза",
  14543. NEXT: "Следующий",
  14544. EXPLORE_3D_SPACE: "Просмотреть 3D модель",
  14545. VIEW_DOLLHOUSE: "Посмотреть Dollhouse",
  14546. SOCIAL_SHARING: "Поделиться этой моделью",
  14547. VIEW_IN_VR: "Посмотреть в VR",
  14548. VIEW_FULLSCREEN: "Полный экран",
  14549. EXIT_FULLSCREEN: "Выйти из полноэкранного режима",
  14550. ZOOM_IN: "Увеличить",
  14551. ZOOM_OUT: "Уменьшить",
  14552. FLOOR_NAME: "Этаж ",
  14553. FLOOR_ALL: "Все",
  14554. TERMS: "Условия",
  14555. PORT_TERMS: "Правила пользования",
  14556. TERMS_OF_USE: "Условия использования",
  14557. TERMS_TEXT_FILE: "terms-ru-RU.html",
  14558. CLOSE_TERMS: "Закрыть",
  14559. TERMS_FAIL: "Не удалось загрузить условия использования. Для просмотра условий использования, пожалуйста, убедитесь, что у Вас есть подключение к Интернету.",
  14560. HELP: "Помощь",
  14561. HELP_NAVIGATION_TAB: "Навигация",
  14562. HELP_MORE_HELP_TAB: "Доп. Помощь",
  14563. CLOSE: "Закрыть",
  14564. HELP_DESKTOP_PANORAMA_1A: "Нажмите и перетащите, чтобы осмотреть пространство вокруг.",
  14565. HELP_DESKTOP_PANORAMA_2A: "Для передвижения по модели нажимайте на круги .",
  14566. HELP_DESKTOP_PANORAMA_3A: "Используйте колесо прокрутки для увеличения и уменьшения.",
  14567. HELP_DESKTOP_PANORAMA_1B: "Или используйте клавиши со стрелками для поворота влево и вправо.",
  14568. HELP_DESKTOP_PANORAMA_2B: "Или используйте стрелки для перемещения вперед и назад.",
  14569. HELP_DESKTOP_PANORAMA_3B: "Или используйте клавиши ‘плюс’ и ‘минус’ для увеличения и уменьшения изображения.",
  14570. HELP_DESKTOP_360_2A: "Нажмите на значок ‘Вид Изнутри’, чтобы увидеть внутреннюю панораму.",
  14571. HELP_DESKTOP_360_2B: "или нажмите 1 на клавиатуре, чтобы увидеть внутреннюю панораму.",
  14572. HELP_DESKTOP_DOLLHOUSE_1A: "Нажмите левую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы повернуть Dollhouse.",
  14573. HELP_DESKTOP_DOLLHOUSE_2A: "Нажмите правую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы изменить позицию Dollhouse на экране.",
  14574. HELP_DESKTOP_DOLLHOUSE_3A: "Используйте колесо прокрутки чтобы увеличить и уменьшить.",
  14575. HELP_DESKTOP_DOLLHOUSE_1B: "Или используйте клавиши со стрелками, чтобы повернуть Dollhouse.",
  14576. HELP_DESKTOP_FLOORPLAN_1A: "Нажмите левую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы изменить положение Планировки на экране.",
  14577. HELP_DESKTOP_FLOORPLAN_2A: "Нажмите правую кнопку мыши и перетащите влево или вправо, чтобы повернуть Планировку.",
  14578. HELP_DESKTOP_FLOORPLAN_3A: "Используйте колесо прокрутки чтобы увеличить и уменьшить.",
  14579. HELP_DESKTOP_FLOORPLAN_2B: "Или используйте клавиши со стрелками для поворота влево или вправо.",
  14580. HELP_DESKTOP_FLOORPLAN_3B: "Или используйте стрелки для увеличения и уменьшения.",
  14581. HELP_MOBILE_PANORAMA_1: "Нажмите и перетащите, чтобы осмотреть модель.",
  14582. HELP_MOBILE_PANORAMA_2: "Для передвижения по модели нажимайте на круги.",
  14583. HELP_MOBILE_3: "Используйте движение двумя пальцами в разные стороны, чтобы увеличить и уменьшить.",
  14584. HELP_MOBILE_360_2: "Нажмите на значок ‘Вид Изнутри’, чтобы увидеть внутреннюю панораму.",
  14585. HELP_MOBILE_DOLLHOUSE_1: "Нажмите и перетащите вверх, вниз, влево и вправо, чтобы повернуть Dollhouse.",
  14586. HELP_MOBILE_DOLLHOUSE_2: "Нажмите и перетащите, чтобы расположить Dollhouse.",
  14587. HELP_MOBILE_FLOORPLAN_1: "Нажмите и перетащите, чтобы расположить план здания.",
  14588. HELP_MOBILE_FLOORPLAN_2: "Коснитесь и перетащите двумя пальцами, чтобы повернуть план здания.",
  14589. HELP_MORE_HLR_A: "Фотоколлаж",
  14590. HELP_DESKTOP_MORE_HLR_B: "Откройте для перемещения по модели, используя иконки изображений.",
  14591. HELP_MORE_DOLLHOUSE_A: "Dollhouse",
  14592. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Нажмите и поверните сверху вниз чтобы просмотреть всю 3D модель.",
  14593. HELP_MOBILE_MORE_DOLLHOUSE_B: "Нажмите и поверните сверху вниз чтобы просмотреть всю 3D модель.",
  14594. HELP_MORE_FLOORS_A: "Выбор Этажа",
  14595. HELP_DESKTOP_MORE_FLOORS_B: "Переключение между этажами.",
  14596. HELP_MORE_TAG_A: "tag™ Posts",
  14597. HELP_DESKTOP_MORE_TAG_B: "Нажмите или наведите курсор мыши для получения информации о функциях в Пространстве.",
  14598. HELP_MOBILE_MORE_TAG_B: "Нажмите для получения информации о функциях.",
  14599. HELP_MORE_ZOOM_A: "Масштаб",
  14600. HELP_DESKTOP_MORE_ZOOM_B: "Используйте эти кнопки для увеличения и уменьшения изображения или используйте колесо прокрутки.",
  14601. HELP_MORE_TOUR_A: "Управление Туром",
  14602. HELP_DESKTOP_MORE_TOUR_B: "Используйте кнопки Воспроизвести, Пауза, Вперед и Назад для управления фотоколлажем.",
  14603. HELP_MORE_INSIDE_A: "Вид Изнутри",
  14604. HELP_DESKTOP_MORE_INSIDE_B: "Нажмите, чтобы просмотреть модель изнутри.",
  14605. HELP_MOBILE_MORE_INSIDE_B: "Нажмите, чтобы просмотреть модель изнутри.",
  14606. HELP_MORE_VR_A: "Режим VR",
  14607. HELP_DESKTOP_MORE_VR_B: "Нажмите, чтобы запустить модель в виртуальной реальности.",
  14608. HELP_MOBILE_MORE_VR_B: "Нажмите, чтобы запустить модель в виртуальной реальности.",
  14609. HELP_MORE_360_A: "360° Views",
  14610. HELP_DESKTOP_MORE_360_B: "Нажмите на “360 Views” в фотоколлаже, чтобы просмотреть внешний пейзаж.",
  14611. HELP_MOBILE_MORE_360_B: "Нажмите на “360 Views” в фотоколлаже, чтобы просмотреть внешний пейзаж.",
  14612. HELP_MORE_FULLSCREEN_A: "Полный экран",
  14613. HELP_DESKTOP_MORE_FULLSCREEN_B: "Развернуть 3D Showcase во весь экран.",
  14614. WEBVR_FOR_CARDBOARD: "Для Google Cardboard",
  14615. WEBVR_FOR_DAYDREAM: "Для просмотра в Daydream",
  14616. WEBVR_ENTER_WEBVR: "ВОЙТИ В VR ",
  14617. WEBVR_DIFFERENT_HEADSET: "Есть другой VR-шлем?",
  14618. WEBVR_LEARN_MORE: "Узнать больше",
  14619. WEBVR_VIEW_SPACE: "Запустить модель в VR",
  14620. WEBVR_DAYDREAM_VIEW: "Посмотреть в Daydream",
  14621. WEBVR_DAYDREAM_PHONE: "Daydream-готовый телефон",
  14622. WEBVR_VIEW_CARDBOARD: "Или просмотреть в Google Cardboard",
  14623. VR_WHAT_YOU_NEED: "Что Вам потребуется...",
  14624. VR_NEED_DAYDREAM_PHONE: "Daydream-готовый телефон",
  14625. VR_GOOGLE_DAYDREAM: "Google Daydream",
  14626. VR_APP: "port VR App",
  14627. VR_APP_OPEN: "Или открыть через приложение port VR",
  14628. VR_COMPATIBLE_ANDROID_LONG: 'Совместимые Android устройства с диагональю экрана 4.5"-5.5" дюймов и Android версией 4.4.4, и выше',
  14629. VR_SAMSUNG_DETAIL: "Galaxy S6 и выше",
  14630. VR_APP_FOR_ANDROID: "Приложение port VR для Android",
  14631. VR_NEED_DAYDREAM: "Необходимо для соединением с Daydream",
  14632. VR_VIEW_SPACE: "Запустить модель в VR",
  14633. VR_LEARN_MORE_CAPS: "УЗНАТЬ БОЛЬШЕ",
  14634. VR_PREVIOUS_CAPS: "ПРЕДЫДУЩИЙ",
  14635. VR_NEXT_CAPS: "СЛЕДУЮЩИЙ",
  14636. VR_GOT_IT_CAPS: "ЯСНО",
  14637. VR_SHOW_SUPPORTED: "Нажмите, чтобы просмотреть модель в VR с помощью",
  14638. VR_SHOW_UNSUPPORTED: "Извините, но Ваше устройство не соответствует минимальным требованиям для просмотра модели в VR.",
  14639. VR_SHOW_IOS_1: "Нажмите, чтобы просмотреть модель в VR",
  14640. VR_SHOW_IOS_2: "Для просмотра требуется приложение port VR и совместимый iPhone",
  14641. VR_NEED_CARDBOARD: "Что Вам потребуется для Google Cardboard",
  14642. VR_NEED_SAMSUNG: "Что Вам потребуется для Samsung Gear VR",
  14643. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  14644. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  14645. VR_COMPATIBLE_IPHONES_1: "iPhones",
  14646. VR_COMPATIBLE_IPHONES_2: "iPhone 5s или новее с iOS 9.1 и выше",
  14647. VR_COMPATIBLE_IPHONES_3: "Совместимые модели iPhone",
  14648. VR_COMPATIBLE_ANDROID: "Совместимые Android устройства",
  14649. VR_ANDROID_DETAIL: 'Экран от 4.5" до 5.5" и Android 4.4.4, и выше',
  14650. VR_ANDROID_DVICES: "Android устройства",
  14651. VR_COMPATIBLE_SAMSUNG: "Совместимые Samsung устройства",
  14652. VR_APP_FOR_CARDBOARD: "Приложение port VR для Google Cardboard",
  14653. VR_APP_FOR_SAMSUNG: "Приложение port VR для Gear VR",
  14654. VR_DOWNLOAD_HERE: "Скачать здесь",
  14655. VR_REQUIRE_HEADSET: "Требуется VR-шлем и установленное приложение port VR для Android",
  14656. VR_REDIRECT_TO_STORE: "Если приложение не установлено, Вы будете перенаправлены на страницу магазина приложений.",
  14657. VR_IMPROPER_EMBED: "port модель не встроена должным образом для поддержки VR в вашем веб-браузере.",
  14658. VR_OPEN_ANDROID_LINK: "Откройте ссылку на Вашем мобильном телефоне",
  14659. VR_ANDROID_OPTIONS: "Доступные опции VR-шлемов",
  14660. SHARE_TO: "Поделиться",
  14661. SHARE_LINK: "Прямая ссылка",
  14662. SHARE_EXPLORE: "просмотреть",
  14663. SHARE_AT: "на",
  14664. SHARE_WITH: "с",
  14665. SHARE_3D: "в 3D",
  14666. SHARE_COPIED: "Скопировано!",
  14667. ERROR_BROWSER_SOLUTION: "установите новый браузер, чтобы просмотреть 3D пространство.",
  14668. ERROR_BROWSER_EXPLANATION: "WebGL требует современный браузер.",
  14669. ERROR_GENERIC_PROBLEM: "Ой, что-то пошло не так.",
  14670. ERROR_GENERIC_SOLUTION: "Перезапустите браузер.",
  14671. ERROR_GENERIC_ACTIONS_1: "Если проблема не устранена, ",
  14672. ERROR_GENERIC_ACTIONS_2: "установите поддерживаемый браузер",
  14673. ERROR_GENERIC_ACTIONS_3: " или ",
  14674. ERROR_GENERIC_ACTIONS_4: "смотрите наше руководство по устранению неполадок",
  14675. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Браузер не поддерживается.",
  14676. ERROR_WEBGL_IOS_PROBLEM: "iOS-версия не поддерживается.",
  14677. ERROR_WEBGL_IOS_SOLUTION: "Обновите до iOS 8 или выше, чтобы просмотреть пространство в 3D.",
  14678. ERROR_WEBGL_IOS_ACTIONS_1: "Нажмите ",
  14679. ERROR_WEBGL_IOS_ACTIONS_2: "Настройки > Общие > Обновление ПО",
  14680. ERROR_WEBGL_SAFARI_PROBLEM: "Включите WebGL для 3D-просмотра.",
  14681. ERROR_WEBGL_SAFARI_ACTIONS_1: "Нажмите ",
  14682. ERROR_WEBGL_SAFARI_ACTIONS_2: "Настойки > Дополнения > Показывать меню “Разработка” в строке меню",
  14683. ERROR_WEBGL_SAFARI_ACTIONS_3: "Затем нажмите ",
  14684. ERROR_WEBGL_SAFARI_ACTIONS_4: "Разработка > Разрешить WebGL",
  14685. ERROR_MISSING_URLS_PROBLEM: "Ой, для этой модели нет панорамы.",
  14686. ERROR_MISSING_URLS_EXPLANATION: "Эта модель устарела. У владельца веб-сайта может быть новая модель.",
  14687. ERROR_LOADING_FAILED_PROBLEM: "Ой, модель недоступна.",
  14688. ERROR_LOADING_FAILED_ACTIONS_1: "Если проблема не устранена, ",
  14689. ERROR_LOADING_FAILED_ACTIONS_2: "посмотрите наше руководство по устранению неполадок",
  14690. ERROR_MAINTENANCE_PROBLEM: "Выполняется техническое обслуживание.",
  14691. ERROR_MAINTENANCE_SOLUTION: "Пожалуйста, попробуйте снова через несколько минут.",
  14692. LINK_TO_LOCATION: "Ссылка на местоположение",
  14693. MENU_COPY: "Копировать",
  14694. LINK_ALERT_COPY: "Для того, чтобы скопировать, пожалуйста, используйте CTRL/CMD + C.",
  14695. ROTATE: "Вращать",
  14696. MOVE: "Передвигаться",
  14697. INSIDE: "Вид изнутри",
  14698. ZOOM: "Масштаб"
  14699. }
  14700. }
  14701. , {}],
  14702. 116: [function(e, t, i) {//main.js
  14703. (function(t) {
  14704. "use strict";
  14705. var modelProgressBase = 0.4;
  14706. var progressUpdate = function(e){ // 0 <= e <= 1
  14707. console.log('e1:'+e)
  14708. e = Math.round(modelProgressBase * e * 100);
  14709. console.log('e2:'+e)
  14710. var t = $('.progressbar');
  14711. t.find('.bar').css('width',e+'%');
  14712. t.find('.label').css('left', t.width() * e / 100 - 15 + 'px' ); //上面跟着的字的百分比
  14713. t.find('.perc').text(e +'%'); //具体数字的百分比
  14714. }
  14715. $('#gui-loading').fadeIn(200);
  14716. progressUpdate(0.1)
  14717. var fileName = g_version ? 'modeldata.js' : 'someData.json' ;
  14718. $.ajax(g_Prefix + "data/"+window.number+"/"+fileName+"?"+randomTime().getTime(),{dataType: "json"}).done( function(e){ //改
  14719. var data = matcher(e);
  14720. data.files.templates[0] = g_Prefix + e.files.templates[0].replace("{{number}}",window.number);
  14721. data.user = {
  14722. "is_authenticated": false,
  14723. "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"]
  14724. }
  14725. try{//处理一下导览数据
  14726. data.model.images = data.model.images.filter(e=>{
  14727. if(!e.locations && !e.thumbnail_signed_src)return; //旧的曾有导览数据是错误的,将它删除
  14728. if(e.locations && e.locations.length == 0)return;
  14729. return e
  14730. })
  14731. }catch(e){console.log(e) }
  14732. window.MP_PREFETCHED_MODELDATA = data;
  14733. data.model.summary = data.summary
  14734. data.model.name = data.name
  14735. for(let i in data){
  14736. data[i] == "false" && (data[i] = false)
  14737. }
  14738. progressUpdate(0.7);
  14739. StartLoad(); //xzw someData.js是我整合的 原本在html里 但这样每个场景的html都不一样了
  14740. if(data.weixinDesc){
  14741. g_weixinObj.desc = data.weixinDesc;
  14742. }
  14743. if(data.shareImgUrl){
  14744. g_weixinObj.imgUrl = data.shareImgUrl
  14745. }
  14746. window.wx && manage.weixinShare();
  14747. //初始画面
  14748. data.camera_start && data.camera_start.thumbImg && E(data.camera_start.thumbImg)
  14749. function E(e) {
  14750. $("<img/>").attr("src", e).on("load", function() {
  14751. $("#gui-thumb").css("backgroundImage", "url(" + e + ")").fadeIn(500),
  14752. $(this).remove()
  14753. })
  14754. }
  14755. })
  14756. function StartLoad(){//当加载完data后
  14757. function i() {
  14758. var e = Y.getModelIDFromQueryString();
  14759. if (!e)
  14760. return b(null, "loading-failed");
  14761. var t = Y.parseSidUrl(e)
  14762. , i = l()
  14763. , a = c()
  14764. , s = o()
  14765. , u = V.quickstart.enabled
  14766. , g = null
  14767. , m = null
  14768. , v = null
  14769. , w = null
  14770. , T = null
  14771. , x = null
  14772. , S = null
  14773. , M = null
  14774. , R = null
  14775. , P = null
  14776. , O = null
  14777. , L = null
  14778. , N = new ue;
  14779. r(s);
  14780. h({ //MP开头写法
  14781. urlBase: t.urlBase
  14782. }).then(function() {
  14783. return re.init(),
  14784. d(t, e) //getModel and load
  14785. }).then(function(e) {
  14786. progressUpdate(0.9)
  14787. return P = e,
  14788. p(P, V.appConfig.segment_key, V.appConfig.keen_write_key, V.appConfig.keen_project_id, {
  14789. startSource: i,
  14790. autoplay: V.autoplay,
  14791. quickstart: u
  14792. }),
  14793. P.urls.init()
  14794. }).then(function() {
  14795. return P.loadPanos()
  14796. }).then(function() {
  14797. m = X.getStartCameraOptions(P, P.panos),
  14798. S = A(P),
  14799. O = y(u, m.mode),
  14800. v = O.controls,
  14801. w = O.player,
  14802. T = O.director,
  14803. x = O.tagManager,
  14804. M = O.tileDownloader,
  14805. R = O.qualityManager,
  14806. L = O.panoRenderer,
  14807. C(P, S, O, s),
  14808. w.director = T,//xzw add
  14809. P.supportsTiles && M.start(),
  14810. !u || m.mode === D.PANORAMA && m.pano || (de.warn("Tried to quickstart, but failed as we are not starting in inside mode."),
  14811. u = !1);
  14812. var e = null;
  14813. if (u) {
  14814. de.warn("Quickstart engaged. Hold on to your knickers.");
  14815. var t = v.controls[D.PANORAMA];
  14816. g = new ie(R,S.scene,S.camera,t,s),
  14817. _(S, s, P),
  14818. e = g.load(m).then(function() {
  14819. S.addComponent(g),
  14820. S.once(le.AfterRender, function() {
  14821. de.warn("First render after quickstart load finished.")
  14822. })
  14823. })
  14824. }
  14825. window.flyToFirst = function(){//xzw add
  14826. var pano = w.model.panos.get("8d778e19657f433fb9cf8947d823bb70");
  14827. var q = new _x.Quaternion(0.7099827027821568,-0.07708150183830938,0.6958985789714591,0.07555241737970636);
  14828. var lookAtPoint = new _x.Vector3(0,0,-1).applyQuaternion(q).add(pano.position);
  14829. w.flyToPano({pano:pano, lookAtPoint:lookAtPoint})
  14830. };
  14831. return $.when(e, U.startLoading(P, w, T, V.autoplay, u, N))
  14832. }).then(function() {
  14833. return f(P, U.onProgress, i, !u, a)
  14834. }).then(function() {
  14835. if (m.quickstart = u,
  14836. I(P, S, O, s),
  14837. S.started || _(S, s, P),
  14838. H.modelLoaded(P, w, v, V.autoplay),
  14839. E(w, P, m, V.autoplay).done(function() {
  14840. T.autoTour()
  14841. }),
  14842. !P.supportsTiles) {
  14843. var e = new Z(P,w);
  14844. e.start()
  14845. }
  14846. u && (S.removeComponent(g),
  14847. g.destroy(),
  14848. m.pano.enter()),
  14849. U.init(P, T, w, v, S, m, H.getSessionId()),
  14850. U.endLoading(P, T, x),
  14851. S.once(le.AfterRender, function() {
  14852. N.setAppReadyTime();
  14853. var e = N.calcFullLoadingTime();
  14854. de.warn("Total load time: " + e / 1e3),
  14855. H.loadComplete(e),
  14856. de.warn("First render after model load finished.")
  14857. }),
  14858. S.on(le.MemoryUsageUpdated, n)
  14859. }).fail(b.bind(this, e))
  14860. }
  14861. function n(e) {
  14862. ce.update(e)
  14863. }
  14864. function r(e) {
  14865. de.info("Version", "2.25.6-0-gd87e5b1"),
  14866. q.defaultMaxListeners = 1e3,
  14867. a(e),
  14868. s()
  14869. }
  14870. function o() {
  14871. return document.getElementById("player")
  14872. }
  14873. function a(e) {
  14874. e.addEventListener("dragenter", T, !1),
  14875. e.addEventListener("dragover", T, !1)
  14876. }
  14877. function s() {
  14878. F.valueFromHash("title", !0) || $(document).ready(function() {
  14879. var e = $(".model-title");
  14880. e.hide()
  14881. })
  14882. }
  14883. function l() {
  14884. return F.valueFromHash("play", !1) ? "autoplay" : F.inIframe() ? "click" : "fullpage"
  14885. }
  14886. function c() {
  14887. return {
  14888. panoElementsToLoad: 6,
  14889. modelElementsToLoad: 0,
  14890. totalElementsLoaded: 0,
  14891. totalElementsToLoad: 0,
  14892. totalPercentageLoaded: 0,
  14893. progressCallback: null
  14894. }
  14895. }
  14896. function h(e) {
  14897. return K.loadFeatureFlags(e).done(function(e) {
  14898. K.updateDependentSettings(e, V)
  14899. })
  14900. }
  14901. // function u(e) {
  14902. // return Q.get(e.urlBase + "/api/v1/config/showcase", {
  14903. // responseType: "json",
  14904. // prefetchFrom: "config"
  14905. // }).then(function(e) {
  14906. // return e ? void j.extendObject(V.appConfig, e) : {}
  14907. // }, function(e) {
  14908. // return de.warn("Failed loading runtime config, using defaults."),
  14909. // $.when({})
  14910. // })
  14911. // }
  14912. function d(e, t) {
  14913. var i = B.getModel({
  14914. url: t,
  14915. floors: F.valueFromHash("f", !0),
  14916. autoload: !1
  14917. })
  14918. ;
  14919. return $.when(i, n).then(null, function(e) {
  14920. return this
  14921. })
  14922. }
  14923. function p(e, t, i, n, r) {
  14924. de.info("Model data loaded"),
  14925. de.debug("UUID: " + e.data.job.uuid),
  14926. J.init(K.getFlags()),
  14927. i && H.initKeen({
  14928. token: i,
  14929. appId: n
  14930. }),
  14931. H.initSegment({
  14932. model: e.sid,
  14933. version: "2.25.6-0-gd87e5b1",
  14934. startSource: r.startSource,
  14935. token: t,
  14936. autoplay: r.autoplay,
  14937. quickstart: r.quickstart
  14938. })
  14939. }
  14940. function f(e, t, i, n, r) {
  14941. return r.progressCallback = t,
  14942. H.sessionStart(),
  14943. e.load(n).progress(g.bind(this, r))
  14944. }
  14945. function g(e, t) {
  14946. e.modelElementsToLoad = t[1],
  14947. v(e),
  14948. m(e)
  14949. }
  14950. function m(e) {
  14951. e.totalElementsLoaded++,
  14952. e.totalPercentageLoaded = e.totalElementsLoaded / e.totalElementsToLoad,
  14953. //----许钟文-----------------模型进度条向后调整
  14954. isNaN(e.totalPercentageLoaded) && (e.totalPercentageLoaded = 0);
  14955. e.totalPercentageLoaded = modelProgressBase + (1-modelProgressBase)*e.totalPercentageLoaded;
  14956. console.log('pro:'+e.totalPercentageLoaded)
  14957. //---------------------------
  14958. e.progressCallback && e.progressCallback(100 * e.totalPercentageLoaded)
  14959. }
  14960. function v(e) {
  14961. e.totalElementsToLoad = e.modelElementsToLoad + e.panoElementsToLoad
  14962. }
  14963. function A(e) {
  14964. var t = new x.PerspectiveCamera;
  14965. t.layers.enable(he.PANOMARKERS),
  14966. t.layers.enable(he.RETICULE),
  14967. t.layers.enable(he.TAG);
  14968. var i = new x.Scene
  14969. , n = new x.AmbientLight(16777215);
  14970. i.add(n),
  14971. // i.skybox = new W,
  14972. // i.add(i.skybox),
  14973. i.plane = new x.Mesh(new x.PlaneBufferGeometry(1e5,1e5),new x.RawShaderMaterial({
  14974. side: x.DoubleSide
  14975. })),
  14976. i.plane.position.y = 0,
  14977. i.plane.rotateX(-Math.PI / 2),
  14978. i.plane.material.visible = !1,
  14979. i.add(i.plane),
  14980. i.updateMatrixWorld(),
  14981. V.showScreenshotLocations && e.data.images.forEach(function(e) {
  14982. if (e.metadata && e.metadata.camera_position) {
  14983. var t = e.metadata.camera_position
  14984. , n = new x.Mesh(new x.BoxGeometry(.3,.3,.3));
  14985. n.position = t.clone(),
  14986. i.add(n);
  14987. var r = e.metadata.camera_quaternion
  14988. , o = new x.Vector3(0,0,-1).applyQuaternion(r);
  14989. i.add(new x.ArrowHelper(o,t.clone(),1,16711680))
  14990. }
  14991. }),
  14992. V.showAxis && (i.add(new x.ArrowHelper(new x.Vector3(0,1,0),new x.Vector3(0,0,0),1,255)),
  14993. i.add(new x.ArrowHelper(new x.Vector3(0,0,1),new x.Vector3(0,0,0),1,16711680)),
  14994. i.add(new x.ArrowHelper(new x.Vector3(1,0,0),new x.Vector3(0,0,0),1,65280)));
  14995. var r = new te(i,t,z);
  14996. return r
  14997. }
  14998. function y(e, t) {
  14999. var i = e ? 1 : 1e3
  15000. , n = J.tilegen || J.imgopt ? 6 : 2;
  15001. n = F.valueFromHash("tileconc", n);
  15002. var r = new ne
  15003. , o = new ae({
  15004. concurrentDownloads: n
  15005. })
  15006. , a = new se
  15007. , s = new P
  15008. , l = new M
  15009. , c = new S(t)
  15010. , h = new R
  15011. , u = new O(i)
  15012. , d = new L
  15013. , p = new oe;
  15014. return {
  15015. qualityManager: r,
  15016. panoRenderer: a,
  15017. tileDownloader: o,
  15018. player: c,
  15019. director: l,
  15020. modelManager: s,
  15021. tagManager: p,
  15022. displayController: u,
  15023. labelDisplayController: d,
  15024. controls: h
  15025. }
  15026. }
  15027. function C(e, t, i, n) {
  15028. var r = i.controls
  15029. , o = i.qualityManager
  15030. , a = i.panoRenderer
  15031. , s = i.tileDownloader
  15032. , l = i.modelManager;
  15033. r.init(n, l),
  15034. ee.init(i.director, r, i.player, l, t),
  15035. o.init(l),
  15036. s.init(o),
  15037. a.init(t, s, o),
  15038. l.init(s, a, o),
  15039. l.addModel(e),
  15040. t.addComponent(G)
  15041. }
  15042. function I(e, t, i, n) {
  15043. var r = i.qualityManager
  15044. , o = i.panoRenderer
  15045. , a = i.tileDownloader
  15046. , s = i.modelManager
  15047. , l = i.player
  15048. , c = i.director
  15049. , h = i.tagManager
  15050. , u = i.displayController
  15051. , d = i.labelDisplayController
  15052. , p = i.controls;
  15053. t.scene.add(e),
  15054. t.qualityManager = r;
  15055. var f = {
  15056. camera: t.camera,
  15057. director: c,
  15058. modelManager: s,
  15059. tileDownloader: a,
  15060. panoRenderer: o,
  15061. qualityManager: r,
  15062. tagManager: h,
  15063. container: n,
  15064. controls: p
  15065. };
  15066. l.init(f),
  15067. l.setScene(t.scene),
  15068. h.init(s, l),
  15069. c.init(l, s),
  15070. u.init(c, l, s, h, n),
  15071. d.init(l, s, n),
  15072. z.bindEvents(l),
  15073. t.addComponent(h),
  15074. t.addComponent(l),
  15075. t.addComponent(o),
  15076. l.sceneRenderer = t; //xzw add 方便resize
  15077. }
  15078. function E(e, t, i, n) {
  15079. return de.info("Starting player in " + i.mode),
  15080. H.report(t.sid, "started-playing", n, i.quickstart),
  15081. e.start(i)
  15082. }
  15083. function b(e, t) {
  15084. de.error(t),
  15085. k.error(t),
  15086. H.report(e, "error-" + t)
  15087. }
  15088. function w(e) {
  15089. var t = F.details();
  15090. t && "Safari" === t.name && t.version > 500 && t.version < 600 ? (k.error("webgl-safari"),
  15091. H.report(e, "error-webgl-safari")) : (k.error("webgl-generic"),
  15092. H.report(e, "error-webgl-generic"))
  15093. }
  15094. function _(e, t, i) {
  15095. try {
  15096. e.start(t)
  15097. } catch (e) {
  15098. throw de.warn(e.message),
  15099. w(i.sid),
  15100. e
  15101. }
  15102. }
  15103. function T(e) {
  15104. e.stopPropagation(),
  15105. e.preventDefault()
  15106. }
  15107. //czj 判断someData 有没有hoticon字段 修改热点的样式
  15108. if (window.MP_PREFETCHED_MODELDATA.hoticon){
  15109. g_HotImage = {
  15110. point: window.MP_PREFETCHED_MODELDATA.hoticon.default || "https://super.4dage.com/images/4dagePoint2.png",
  15111. point2: window.MP_PREFETCHED_MODELDATA.hoticon.higt || "https://super.4dage.com/images/4dagePoint.png"
  15112. } ;
  15113. }
  15114. //czj 判断someData 有没有backgroundMusic 添加音乐
  15115. if (window.MP_PREFETCHED_MODELDATA.backgroundMusic) {
  15116. if(window.isLocal) g_bgAudio.src = manage.dealURL(window.MP_PREFETCHED_MODELDATA.backgroundMusic) ;
  15117. //else g_bgAudio.src = window.MP_PREFETCHED_MODELDATA.backgroundMusic.substr(0,4)=="http" ? window.MP_PREFETCHED_MODELDATA.backgroundMusic : "//" + window.MP_PREFETCHED_MODELDATA.backgroundMusic;
  15118. else g_bgAudio.src = window.MP_PREFETCHED_MODELDATA.backgroundMusic
  15119. $("#volume").show();
  15120. }else if (g_version === "one"){
  15121. g_bgAudio.src = g_Prefix+"/audio/"+"audio"+window.number + "/background.mp3";
  15122. //g_bgAudio.src = manage.dealURL(src) ;
  15123. }
  15124. //隐藏公司logo
  15125. if(window.MP_PREFETCHED_MODELDATA.loadlogo){
  15126. showLogo();
  15127. }
  15128. e("./lib/three75-shim"),
  15129. e("./lib/array-polyfill"),
  15130. e("./lib/performance-polyfill"),
  15131. e("./lib/shaders/CopyShader.js"),
  15132. e("./lib/shaders/HorizontalBlurShader.js"),
  15133. e("./lib/shaders/VerticalBlurShader.js"),
  15134. e("./lib/postprocessing/EffectComposer.js"),
  15135. e("./lib/postprocessing/RenderPass.js"),
  15136. e("./lib/postprocessing/MaskPass.js"),
  15137. e("./lib/postprocessing/ShaderPass.js"),
  15138. window.Promise || (window.Promise = e("promise-polyfill"));
  15139. var x = e("three")
  15140. , _x = e("three")
  15141. , S = (e("./util/sentry"),
  15142. e("./player"))
  15143. , M = e("./director")
  15144. , R = e("./controls/CameraControls")
  15145. , P = e("./model/ModelManager")
  15146. , O = e("./DisplayController")
  15147. , L = e("./label/LabelDisplayController")
  15148. , D = e("./enum/Viewmode")
  15149. , N = e("./util/logger")
  15150. , B = e("./showcase")
  15151. , F = e("./util/browser")
  15152. , V = e("./settings")
  15153. , U = e("./gui/gui")
  15154. , k = e("./gui/error")
  15155. , H = e("./analytics")
  15156. , G = e("./util/transitions")
  15157. , z = e("./effects")
  15158. , W = e("./objects/Skybox")
  15159. , j = e("./util/common")
  15160. , Y = (e("./util/PanoramaCollection"),
  15161. e("./util/math"),
  15162. e("./util/showcase"))
  15163. , X = e("./util/camera")
  15164. , Z = (e("./objects/Panorama"),
  15165. e("./cameras/PanoramaCamera"),
  15166. e("./preloaders"))
  15167. , q = e("events").EventEmitter
  15168. , K = e("./featureflags")
  15169. , Q = (e("./util/lerp"),
  15170. e("./util/ajax"))
  15171. , J = e("./ab")
  15172. , ee = e("./sdk/automation.js")
  15173. , te = e("./scene/SceneRenderer")
  15174. , ie = e("./scene/QuickstartManager")
  15175. , ne = e("./tile/QualityManager.js")
  15176. , re = e("./localization/localize")
  15177. , oe = e("./tag/tagManager")
  15178. , ae = e("./tile/TileDownloader")
  15179. , se = e("./tile/PanoRenderer")
  15180. , le = (e("./enum/PanoSizeClass"),
  15181. e("./enum/PanoramaEvents"),
  15182. e("./enum/SceneRendererEvents"))
  15183. , ce = e("./gui/memoryUsage")
  15184. , he = e("./enum/RenderLayers")
  15185. , ue = e("./TimingData")
  15186. , de = new N(t);
  15187. N.level = V.logLevel,
  15188. N.consoleEnabled = V.console,
  15189. i()
  15190. }
  15191. }
  15192. ).call(this, "/js/main.js")
  15193. }
  15194. , {
  15195. "./DisplayController": 1,
  15196. "./TimingData": 2,
  15197. "./ab": 3,
  15198. "./analytics": 4,
  15199. "./cameras/PanoramaCamera": 7,
  15200. "./controls/CameraControls": 9,
  15201. "./director": 15,
  15202. "./effects": 16,
  15203. "./enum/PanoSizeClass": 36,
  15204. "./enum/PanoramaEvents": 37,
  15205. "./enum/RenderLayers": 41,
  15206. "./enum/SceneRendererEvents": 43,
  15207. "./enum/Viewmode": 51,
  15208. "./featureflags": 59,
  15209. "./gui/error": 64,
  15210. "./gui/gui": 65,
  15211. "./gui/memoryUsage": 73,
  15212. "./label/LabelDisplayController": 91,
  15213. "./lib/array-polyfill": 92,
  15214. "./lib/performance-polyfill": 95,
  15215. "./lib/postprocessing/EffectComposer.js": 96,
  15216. "./lib/postprocessing/MaskPass.js": 97,
  15217. "./lib/postprocessing/RenderPass.js": 98,
  15218. "./lib/postprocessing/ShaderPass.js": 99,
  15219. "./lib/shaders/CopyShader.js": 100,
  15220. "./lib/shaders/HorizontalBlurShader.js": 101,
  15221. "./lib/shaders/VerticalBlurShader.js": 102,
  15222. "./lib/three75-shim": 103,
  15223. "./localization/localize": 108,
  15224. "./tag/tagManager": 124,
  15225. "./model/ModelManager": 140,
  15226. "./objects/Panorama": 148,
  15227. "./objects/Skybox": 152,
  15228. "./player": 155,
  15229. "./preloaders": 156,
  15230. "./scene/QuickstartManager": 157,
  15231. "./scene/SceneRenderer": 158,
  15232. "./sdk/automation.js": 164,
  15233. "./settings": 166,
  15234. "./showcase": 168,
  15235. "./tile/PanoRenderer": 169,
  15236. "./tile/QualityManager.js": 170,
  15237. "./tile/TileDownloader": 171,
  15238. "./util/PanoramaCollection": 178,
  15239. "./util/ajax": 181,
  15240. "./util/browser": 182,
  15241. "./util/camera": 183,
  15242. "./util/common": 185,
  15243. "./util/lerp": 188,
  15244. "./util/logger": 189,
  15245. "./util/math": 190,
  15246. "./util/sentry": 192,
  15247. "./util/showcase": 193,
  15248. "./util/transitions": 195,
  15249. events: 202,
  15250. "promise-polyfill": 213,
  15251. three: 217
  15252. }],
  15253. 117: [function(e, t, i) {
  15254. "use strict";
  15255. function n(e) {
  15256. e = e || {}
  15257. r.RawShaderMaterial.call(this, a.extendObject({
  15258. fragmentShader: o.cube.fragmentShader,
  15259. vertexShader: o.cube.vertexShader,
  15260. uniforms: r.UniformsUtils.clone(o.cube.uniforms),
  15261. name: "CubemapMaterial",
  15262. }, e))
  15263. }
  15264. var r = e("three")
  15265. , o = e("../shaders")
  15266. , a = e("../util/common");
  15267. n.prototype = Object.create(r.RawShaderMaterial.prototype),
  15268. n.prototype.constructor = n,
  15269. t.exports = n
  15270. }
  15271. , {
  15272. "../shaders": 167,
  15273. "../util/common": 185,
  15274. three: 217
  15275. }],
  15276. 118: [function(e, t, i) {
  15277. "use strict";
  15278. function n(e) {
  15279. e = e || {}
  15280. r.RawShaderMaterial.call(this, a.extendObject({
  15281. fragmentShader: o.model.fragmentShader,
  15282. vertexShader: o.model.vertexShader,
  15283. uniforms: r.UniformsUtils.clone(o.model.uniforms),
  15284. name: "ModelTextureMaterial",
  15285. }, e))
  15286. }
  15287. var r = e("three")
  15288. , o = e("../shaders")
  15289. , a = e("../util/common");
  15290. n.prototype = Object.create(r.RawShaderMaterial.prototype),
  15291. n.prototype.constructor = n,
  15292. n.prototype.setProjectedPanos = function(e, t, i) {
  15293. i && (this.uniforms.progress.value = 0),
  15294. e.ensureSkyboxReadyForRender(),
  15295. this.uniforms.pano0Map.value = e.getSkyboxTexture(),
  15296. this.uniforms.pano0Position.value.copy(e.position),
  15297. this.uniforms.pano0Matrix.value.copy(e.skyboxMesh.matrixWorld),
  15298. t.ensureSkyboxReadyForRender(),
  15299. this.uniforms.pano1Map.value = t.getSkyboxTexture(),
  15300. this.uniforms.pano1Position.value.copy(t.position),
  15301. this.uniforms.pano1Matrix.value.copy(t.skyboxMesh.matrixWorld)
  15302. }
  15303. /* n.prototype.setEyeDir = function(dir, pos) {//加
  15304. this.uniforms.eyeDir.value.copy(dir)
  15305. this.uniforms.eyePos.value.copy(pos)
  15306. }
  15307. n.prototype.setBendCameraQua = function(matrix) {//加
  15308. this.uniforms.cameraDeltaMatrix.value.copy(matrix)
  15309. } */
  15310. ,
  15311. t.exports = n
  15312. }
  15313. , {
  15314. "../shaders": 167,
  15315. "../util/common": 185,
  15316. three: 217
  15317. }],
  15318. 119: [function(e, t, i) {
  15319. (function(i) {
  15320. "use strict";
  15321. function n(e, t, i, n) {
  15322. this.div = null,
  15323. this.body = null,
  15324. this.label = e,
  15325. this.description = t,
  15326. this.parsedDescription = [],
  15327. this.media = i || {
  15328. type: null
  15329. },
  15330. this.loadingSpinner = null,
  15331. this.parser = new r({
  15332. supportLinks: !u.valueFromHash("mls"),
  15333. keepLinkLabels: !0
  15334. }),
  15335. this.state = I.CLOSED,
  15336. this.orientation = "",
  15337. this.initialTransform = "",
  15338. this.hovering = !1,
  15339. this.openTransition = null,
  15340. this.closeTransition = null,
  15341. this.openPromise = null,
  15342. this.closePromise = null,
  15343. this.animationTransition = null,
  15344. this.animationScale = 0
  15345. }
  15346. var r = e("../Parser/DescriptionParser")
  15347. , o = e("../Media/Link")
  15348. , a = e("../Media/Image")
  15349. , s = e("../Media/EmbedlyPlayer")
  15350. , l = e("../Media/EmbedlyEmbed")
  15351. , c = e("../../util/transitions")
  15352. , h = e("../../util/lerp")
  15353. , u = e("../../util/browser")
  15354. , d = e("./BillboardEvent")
  15355. , p = e("../Media/MediaEvent")
  15356. , f = e("../Parser/DescriptionChunkType")
  15357. , g = e("events").EventEmitter
  15358. , m = e("./billboardSettings")
  15359. , v = e("./overlaySettings")
  15360. , A = e("../../util/logger")
  15361. , y = new A(i)
  15362. , C = document.getElementById("tag-billboards");
  15363. C.addEventListener("touchend", function(e) {
  15364. C.style.pointerEvents = "none"
  15365. }),
  15366. C.addEventListener("touchcancel", function(e) {
  15367. C.style.pointerEvents = "none"
  15368. });
  15369. var I = {
  15370. CLOSED: "closed",
  15371. OPENING: "opening",
  15372. OPEN: "open",
  15373. CLOSING: "closing",
  15374. ACTIVE: "active"
  15375. };
  15376. n.prototype = Object.create(g.prototype),
  15377. n.prototype.build = function(e) {
  15378. this.parsedDescription = this.parser.parse(this.description);
  15379. var t = document.createElement("div");
  15380. t.className = "tag-container has-hotzone",
  15381. this.div = t,
  15382. this.body = document.createElement("div"),
  15383. this.body.className = "tag-body";
  15384. var i = document.createElement("div");
  15385. i.classList.add("tag-content");
  15386. var n = document.createElement("div");
  15387. n.classList.add("tag-text-content");
  15388. var r = document.createElement("div");
  15389. r.className = "tag-label",
  15390. r.textContent = this.label,
  15391. n.appendChild(r);
  15392. var o = document.createElement("div");
  15393. o.className = "tag-desc",
  15394. n.appendChild(o),
  15395. i.appendChild(n),
  15396. this.body.appendChild(i),
  15397. this.appendDescriptionElements(this.parsedDescription, o),
  15398. this.appendMedia(),
  15399. t.appendChild(this.body),
  15400. C.appendChild(t),
  15401. this.bindEvents(t, this.body)
  15402. }
  15403. ,
  15404. n.prototype.bindEvents = function(e, t) {
  15405. var i = function(e) {
  15406. return function(t) {
  15407. if (!this.div.classList.contains("overlay")) {
  15408. var i, n = document.getElementById("player");
  15409. try {
  15410. i = new MouseEvent(e,t)
  15411. } catch (n) {
  15412. i = document.createEvent("MouseEvents"),
  15413. 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)
  15414. }
  15415. n.dispatchEvent(i)
  15416. }
  15417. }
  15418. };
  15419. t.addEventListener("mousedown", function(e) {
  15420. e.stopPropagation()
  15421. }),
  15422. t.addEventListener("mouseup", function(e) {
  15423. e.stopPropagation()
  15424. }),
  15425. e.addEventListener("touchstart", function(e) {
  15426. C.style.pointerEvents = "auto"
  15427. }),
  15428. e.addEventListener("mousedown", i("mousedown").bind(this)),
  15429. e.addEventListener("mouseup", i("mouseup").bind(this)),
  15430. t.addEventListener("mouseover", function(t) {
  15431. this.state === I.OPEN && e.classList.remove("has-hotzone")
  15432. }
  15433. .bind(this)),
  15434. e.addEventListener("mouseenter", function(e) {
  15435. this.state !== I.CLOSING && (this.hovering = !0,
  15436. this.emit(d.ENTER))
  15437. }
  15438. .bind(this)),
  15439. e.addEventListener("mouseleave", function(e) {
  15440. this.hovering = !1,
  15441. this.emit(d.LEAVE)
  15442. }
  15443. .bind(this)),
  15444. e.addEventListener("gesturestart", function(e) {
  15445. e.preventDefault()
  15446. });
  15447. var n = e.querySelector(".tag-text-content")
  15448. , r = 0;
  15449. n.addEventListener("touchstart", function(e) {
  15450. r = e.changedTouches[0].clientY
  15451. }),
  15452. n.addEventListener("touchmove", function(t) {
  15453. function i(e) {
  15454. e && (0 === e.scrollTop && t.changedTouches[0].clientY > r || e.scrollTop + e.clientHeight - e.scrollHeight === 0 && t.changedTouches[0].clientY < r) && t.preventDefault()
  15455. }
  15456. return e.classList.contains("overlay") ? i(this.querySelector(".tag-desc")) : void i(this)
  15457. }),
  15458. e.addEventListener("touchmove", function(e) {
  15459. 0 === (n.compareDocumentPosition(e.target) & Node.DOCUMENT_POSITION_CONTAINED_BY) && e.preventDefault()
  15460. })
  15461. }
  15462. ,
  15463. n.prototype.appendDescriptionElements = function(e, t) {
  15464. e.length > 0 && this.div.classList.add("has-text"),
  15465. e.forEach(function(e, i) {
  15466. switch (e.type) {
  15467. case f.TEXT:
  15468. t.appendChild(this.createTextElement(e.text));
  15469. break;
  15470. case f.LINK:
  15471. t.appendChild(this.createLinkElement(e.link))
  15472. }
  15473. }
  15474. .bind(this))
  15475. }
  15476. ,
  15477. n.prototype.appendLoadingSpinner = function() {
  15478. this.loadingSpinner = document.createElement("div"),
  15479. this.loadingSpinner.classList.add("loading-spinner");
  15480. var e = document.createElement("div");
  15481. e.classList.add("gui-spinner-icon"),
  15482. this.loadingSpinner.appendChild(e),
  15483. this.body.appendChild(this.loadingSpinner)
  15484. }
  15485. ,
  15486. n.prototype.onMediaLoadFinished = function() {
  15487. this.loadingSpinner && (this.loadingSpinner.parentNode.removeChild(this.loadingSpinner),
  15488. this.applyOrientation(this.orientation),
  15489. this.loadingSpinner = null)
  15490. }
  15491. ,
  15492. n.prototype.appendMedia = function() {
  15493. if (this.media && this.media.type && "error" !== this.media.type && (!u.valueFromHash("mls", 0) || this.media.type === f.IMAGE)) {
  15494. this.appendLoadingSpinner();
  15495. var e = document.createElement("div");
  15496. e.classList.add("tag-media-content");
  15497. var t = document.createElement("i");
  15498. switch (["icon", "icon-close-thin", "close"].forEach(function(e) {
  15499. t.classList.add(e)
  15500. }),
  15501. this.body.appendChild(t),
  15502. this.body.appendChild(e),
  15503. this.media.type) {
  15504. case f.IMAGE:
  15505. e.appendChild(this.createImageElement(this.media, this.body));
  15506. break;
  15507. case f.VIDEO:
  15508. e.appendChild(this.createVideoElement(this.media, this.body));
  15509. break;
  15510. case f.RICH:
  15511. e.appendChild(this.createEmbedElement(this.media, this.body))
  15512. }
  15513. }
  15514. }
  15515. ,
  15516. n.prototype.createTextElement = function(e) {
  15517. var t = document.createElement("span");
  15518. return t.textContent = e,
  15519. t
  15520. }
  15521. ;
  15522. n.prototype.createLinkElement = function(e) {
  15523. var t = new o(e);
  15524. return t.on(p.LINK_CLICK, this.emit.bind(this, p.LINK_CLICK)),
  15525. t.createDomElement()
  15526. }
  15527. ,
  15528. n.prototype.createImageElement = function(e, t) {
  15529. function i() {
  15530. function e() {
  15531. m || (r.classList.remove("view-image"),
  15532. c.classList.add("overlay"),
  15533. i(),
  15534. window.addEventListener("resize", b),
  15535. c.addEventListener("click", a),
  15536. g.addEventListener("click", l),
  15537. f.addEventListener("click", s),
  15538. m = !0,
  15539. o.emit(p.IMAGE_OPENED))
  15540. }
  15541. function i() {
  15542. t.classList.add("show-info"),
  15543. h.classList.remove("collapsible"),
  15544. h.style.height = "";
  15545. var e = parseFloat(getComputedStyle(I).lineHeight)
  15546. , i = y + e
  15547. , r = c.clientWidth - 2 * v.boundaryWidth - C
  15548. , a = c.clientHeight - 2 * v.boundaryHeight - C - i
  15549. , s = a
  15550. , l = s * n.aspect;
  15551. l > r && (l = r,
  15552. s = l / n.aspect),
  15553. s > a && (s = a,
  15554. l = s * n.aspect),
  15555. l += C,
  15556. s += C + i,
  15557. t.style.width = l + "px",
  15558. t.style.height = s + "px",
  15559. u.style.paddingTop = e + C + "px",
  15560. o.description.length > 0 && (h.classList.add("collapsible"),
  15561. h.style.height = h.clientHeight + 12 + "px",
  15562. E.style.height = "calc(100% - " + I.clientHeight + "px)")
  15563. }
  15564. function a(e) {
  15565. e.target === c && s()
  15566. }
  15567. function s() {
  15568. m && (m = !1,
  15569. r.classList.add("view-image"),
  15570. c.classList.remove("overlay"),
  15571. h.style.height = "",
  15572. u.style.paddingTop = "",
  15573. t.style.width = "",
  15574. t.style.height = "",
  15575. window.removeEventListener("resize", b),
  15576. c.removeEventListener("click", a),
  15577. g.removeEventListener("click", l),
  15578. f.removeEventListener("click", s),
  15579. o.emit(p.IMAGE_CLOSED),
  15580. o.close(!0))
  15581. }
  15582. function l(e) {
  15583. t.classList.toggle("show-info")
  15584. }
  15585. var c = o.div
  15586. , h = c.getElementsByClassName("tag-content")[0]
  15587. , u = c.getElementsByClassName("tag-media-content")[0]
  15588. , f = t.getElementsByClassName("close")[0]
  15589. , g = h.getElementsByClassName("tag-label")[0];
  15590. c.classList.add("has-image"),
  15591. r.classList.add("view-image"),
  15592. c.classList.add(n.aspect >= 1 ? "image-landscape" : "image-portrait"),
  15593. o.applyOrientation(o.orientation);
  15594. var m = !1
  15595. , A = getComputedStyle(h)
  15596. , y = parseFloat(A.paddingTop) + parseFloat(A.paddingBottom)
  15597. , C = 2 * parseFloat(getComputedStyle(u).paddingLeft)
  15598. , I = h.querySelector(".tag-label")
  15599. , E = h.querySelector(".tag-desc")
  15600. , b = function() {
  15601. var e, t, n = 0;
  15602. return function() {
  15603. clearInterval(e),
  15604. clearTimeout(t),
  15605. e = setInterval(function() {
  15606. var e = c.clientHeight;
  15607. n !== e && (i(),
  15608. n = e)
  15609. }, 100),
  15610. t = setTimeout(clearInterval.bind(this, e), 1e3)
  15611. }
  15612. }();
  15613. n.on(p.IMAGE_OPENING, e),
  15614. o.on(d.ACTIVATE, e),
  15615. o.on(p.IMAGE_CLOSED, n.onClosed.bind(n)),
  15616. o.on(d.CLOSING, s)
  15617. }
  15618. var n = new a
  15619. , r = n.createDomElement();
  15620. this.once(d.OPENED, function() {
  15621. n.load(e.src).then(i).catch(function(t) {
  15622. y.warn("Failed to load image:", e.src),
  15623. y.warn("with error:", t)
  15624. }).then(this.onMediaLoadFinished.bind(this))
  15625. });
  15626. var o = this;
  15627. return r
  15628. }
  15629. ,
  15630. n.prototype.createVideoElement = function(e, t) {
  15631. var i = new s({
  15632. autoPlay: !0,
  15633. autoResume: !0,
  15634. startMuted: !1,
  15635. loop: !1
  15636. })
  15637. , n = i.createDomElement();
  15638. return this.once(d.OPENED, function() {
  15639. i.load(e.src).then(function() {
  15640. this.div.classList.add("has-video"),
  15641. this.state !== I.OPEN && this.state !== I.ACTIVE || (i.show(),
  15642. i.play()),
  15643. this.on(d.OPENING, i.show.bind(i)),
  15644. this.on(d.OPENED, i.play.bind(i)),
  15645. this.on(d.CLOSING, i.pause.bind(i)),
  15646. this.on(d.CLOSED, i.hide.bind(i))
  15647. }
  15648. .bind(this)).catch(function(t) {
  15649. y.warn("Failed to embed video:", e.src),
  15650. y.warn("with error:", t)
  15651. }).then(this.onMediaLoadFinished.bind(this))
  15652. }
  15653. .bind(this)),
  15654. n
  15655. }
  15656. ,
  15657. n.prototype.createEmbedElement = function(e, t) {
  15658. var i = new l
  15659. , n = i.createDomElement();
  15660. return this.once(d.OPENED, function() {
  15661. i.load(e.src).then(function() {
  15662. this.div.classList.add("has-embed"),
  15663. this.state !== I.OPEN && this.state !== I.ACTIVE || i.show(),
  15664. this.applyOrientation(this.orientation),
  15665. this.on(d.OPENING, i.show.bind(i)),
  15666. this.on(d.CLOSED, i.hide.bind(i))
  15667. }
  15668. .bind(this)).catch(function(t) {
  15669. y.warn("Failed to embed:", e.src),
  15670. y.warn("with error:", t)
  15671. }).then(this.onMediaLoadFinished.bind(this))
  15672. }
  15673. .bind(this)),
  15674. n
  15675. }
  15676. ,
  15677. n.prototype.open = function(e) {
  15678. return this.openPromise = $.Deferred(),
  15679. this.state === I.ACTIVE ? this.openPromise.resolve().promise() : (this.hovering || this.div.classList.add("has-hotzone"),
  15680. this.openTransition ? e && this.setActiveState() : this.openTransition = c.setTimeout(function() {
  15681. this.state !== I.OPEN && (this.emit(d.OPENING),
  15682. e && this.emit(d.ACTIVATING),
  15683. this.state = I.OPENING,
  15684. this.animateOpen(function() {
  15685. e && this.setActiveState(),
  15686. this.openPromise.resolve()
  15687. }
  15688. .bind(this)))
  15689. }
  15690. .bind(this), m.animation.openDelay),
  15691. c.cancel(this.closeTransition),
  15692. this.closePromise && this.closePromise.reject(),
  15693. this.closeTransition = void 0,
  15694. this.openPromise.promise())
  15695. }
  15696. ,
  15697. n.prototype.close = function(e) {
  15698. return this.closePromise = $.Deferred(),
  15699. !e && this.hovering ? this.closePromise.reject().promise() : (this.closeTransition || (this.closeTransition = c.setTimeout(function() {
  15700. this.state !== I.CLOSED && (this.emit(d.CLOSING),
  15701. this.state = I.CLOSING,
  15702. this.animateClose())
  15703. }
  15704. .bind(this), m.animation.closeDelay)),
  15705. c.cancel(this.openTransition),
  15706. this.openPromise && this.openPromise.reject(),
  15707. this.openTransition = void 0,
  15708. this.closePromise.resolve(),
  15709. this.closePromise.promise())
  15710. }
  15711. ,
  15712. n.prototype.setActiveState = function() {
  15713. this.state !== I.CLOSED && (this.state = I.ACTIVE,
  15714. this.emit(d.ACTIVATE),
  15715. this.div.classList.remove("has-hotzone"))
  15716. }
  15717. ,
  15718. n.prototype.animateOpen = function(e) {
  15719. if (this.state === I.OPENING) {
  15720. if (c.cancel(this.animationTransition),
  15721. u.detectSamsungNative())
  15722. return this.boardOrientation = null,
  15723. this.div.style.visibility = "visible",
  15724. this.emit(d.OPENED),
  15725. this.state = I.OPEN,
  15726. void (e && e());
  15727. this.div.style.webkitTransform = "scale(0)",
  15728. this.div.style.transform = "scale(0)",
  15729. this.div.style.visibility = "visible",
  15730. this.animationTransition = c.start(h.property(this, "animationScale", 1), m.animation.openDuration, function() {
  15731. this.emit(d.OPENED),
  15732. this.state = I.OPEN,
  15733. e && e()
  15734. }
  15735. .bind(this))
  15736. }
  15737. }
  15738. ,
  15739. n.prototype.animateClose = function(e) {
  15740. this.state === I.CLOSING && (c.cancel(this.animationTransition),
  15741. this.animationTransition = c.start(h.property(this, "animationScale", 0), m.animation.closeDuration, function() {
  15742. this.emit(d.CLOSED),
  15743. this.state = I.CLOSED,
  15744. this.div.style.visibility = "hidden",
  15745. this.div.classList.contains("has-hotzone") || this.div.classList.add("has-hotzone"),
  15746. e && e()
  15747. }
  15748. .bind(this)))
  15749. }
  15750. ,
  15751. n.prototype.needsUpdate = function() {
  15752. return this.state !== I.CLOSED
  15753. }
  15754. ,
  15755. n.prototype.update = function(e, t) {
  15756. if (this.needsUpdate()) {
  15757. var i = (this.updateOrientation(e),
  15758. this.calcScale(t))
  15759. , n = {
  15760. x: (e.x + 1) * $("#player").width() / 2,
  15761. y: (e.y + 1) * $("#player").height() / 2
  15762. };
  15763. this.div.screenTransform = this.initialTransform + " translate(" + n.x + "px, " + n.y + "px) scale(" + i * this.animationScale + ")",
  15764. this.div.style.webkitTransform = this.div.screenTransform,
  15765. this.div.style.transform = this.div.screenTransform
  15766. }
  15767. }
  15768. ,
  15769. n.prototype.getDimensions = function() {
  15770. return this.div.getBoundingClientRect()
  15771. }
  15772. ,
  15773. n.prototype.calcScale = function(e) {
  15774. return Math.sqrt(e / 40) * m.boardToDiscRatio
  15775. }
  15776. ,
  15777. n.prototype.updateOrientation = function(e) {
  15778. if (this.state !== I.ACTIVE) {
  15779. var t = 1 / 3
  15780. , i = e.y < -t ? 0 : e.y < t ? 1 : 2
  15781. , n = e.x < -t ? 0 : e.x < t ? 1 : 2
  15782. , r = "";
  15783. r += 0 === n ? "right" : 2 === n ? "left" : "",
  15784. r += 0 === i ? "-down" : 2 === i ? "-up" : "",
  15785. 1 === n && (r = 0 === i ? "bottom" : 2 === i ? "top" : "",
  15786. 1 === i && (r = $("#player").width() > $("#player").height() ? e.x < 0 ? "right" : "left" : e.y < 0 ? "bottom" : "top")),
  15787. 1 === n && 1 === i && r === this.orientation || this.applyOrientation(r)
  15788. }
  15789. }
  15790. ,
  15791. n.prototype.applyOrientation = function(e) {
  15792. this.div.style.transform = this.div.style.webkitTransform = "",
  15793. this.div.classList.remove("tag-container-" + this.orientation),
  15794. this.div.classList.add("tag-container-" + e);
  15795. var t = window.getComputedStyle(this.div);
  15796. this.initialTransform = t.transform || t.webkitTransform,
  15797. "none" === this.initialTransform && (this.initialTransform = "");
  15798. var i = t.transform.slice(7, -1).split(",")
  15799. , n = -i[4]
  15800. , r = -i[5];
  15801. this.div.style.webkitTransformOrigin = n + "px " + r + "px",
  15802. this.div.style.transformOrigin = n + "px " + r + "px",
  15803. this.orientation = e
  15804. }
  15805. ,
  15806. t.exports = n
  15807. }
  15808. ).call(this, "/js/tag/Billboard/Billboard.js")
  15809. }
  15810. , {
  15811. "../../util/browser": 182,
  15812. "../../util/lerp": 188,
  15813. "../../util/logger": 189,
  15814. "../../util/transitions": 195,
  15815. "../Media/EmbedlyEmbed": 125,
  15816. "../Media/EmbedlyPlayer": 126,
  15817. "../Media/Image": 128,
  15818. "../Media/Link": 129,
  15819. "../Media/MediaEvent": 131,
  15820. "../Parser/DescriptionChunkType": 133,
  15821. "../Parser/DescriptionParser": 134,
  15822. "./BillboardEvent": 120,
  15823. "./billboardSettings": 121,
  15824. "./overlaySettings": 122,
  15825. events: 202
  15826. }],
  15827. 120: [function(e, t, i) {
  15828. "use strict";
  15829. t.exports = Object.freeze({
  15830. ENTER: "billboard.enter",
  15831. LEAVE: "billboard.leave",
  15832. OPENING: "billboard.opening",
  15833. OPENED: "billboard.open",
  15834. CLOSING: "billboard.closing",
  15835. CLOSED: "billboard.closed",
  15836. ACTIVATING: "billboard.activating",
  15837. ACTIVATE: "billboard.activate"
  15838. })
  15839. }
  15840. , {}],
  15841. 121: [function(e, t, i) {
  15842. "use strict";
  15843. t.exports = Object.freeze({
  15844. animation: Object.freeze({
  15845. hoverOnClosing: !1,
  15846. openDelay: 100,
  15847. closeDelay: 50,
  15848. openDuration: 200,
  15849. closeDuration: 100
  15850. }),
  15851. boardToDiscRatio: 1.2
  15852. })
  15853. }
  15854. , {}],
  15855. 122: [function(e, t, i) {
  15856. "use strict";
  15857. t.exports = Object.freeze({
  15858. boundaryWidth: 30,
  15859. boundaryHeight: 0
  15860. })
  15861. }
  15862. , {}],
  15863. /*********************************创建热点模型************************************************** */
  15864. "hot": [function(e, t, i) {//热点
  15865. "use strict";
  15866. function hot(sid,d,model){
  15867. this.sid = sid;
  15868. /* this.position = (new r.Vector3).fromArray( this.conversionArray(d.position) )
  15869. if(d.quaternion){
  15870. this.quaternion = d.quaternion;
  15871. }else{
  15872. this.rotation = this.conversionArray(d.rotation)
  15873. } */
  15874. this.position = this.convertValue(d.position, r.Vector3)
  15875. if(d.quaternion){
  15876. this.quaternion = this.convertValue(d.quaternion, r.Quaternion)
  15877. }else{
  15878. this.rotation = new r.Euler().setFromVector3(this.convertValue(d.rotation, r.Vector3 ))
  15879. }
  15880. this.quaternion || (this.quaternion = new THREE.Quaternion().setFromEuler(this.rotation))
  15881. this.isSprite = d.isSprite
  15882. this.actionType = (d.noAction ? 'noAction' : d.actionType) || "common"
  15883. this.linkType = d.linkType || "common"
  15884. this.link = d.link;
  15885. this.model = model;
  15886. this.size = d.size;
  15887. this.infoAttribute = d.infoAttribute || {};
  15888. this.styleImg = [] // 存储热点icon的图片 [{src:...}, {src:...} ] 最多两个,里面是带有src的object, 可以是img
  15889. this.transformAtPanos = d.transformAtPanos || {}
  15890. for (let i in this.transformAtPanos) {
  15891. this.transformAtPanos[i].pos = new THREE.Vector3().fromArray(this.transformAtPanos[i].pos)
  15892. this.transformAtPanos[i].qua && (this.transformAtPanos[i].qua = new THREE.Quaternion().fromArray(this.transformAtPanos[i].qua))
  15893. }
  15894. this.build();
  15895. d.infoAttribute && d.infoAttribute.title && this.setTitleElem(d.infoAttribute.title)
  15896. this.changeTex()
  15897. this.visibleData = d.visiblePanos
  15898. //this.setVisiblePanos(d.visiblePanos);
  15899. }
  15900. var r = e("three")
  15901. , f = e("../shaders")
  15902. , a = e("../settings")
  15903. , s = e("../enum/Viewmode")
  15904. , p = e("../objects/Panorama")
  15905. , math = e("../util/math")
  15906. , te = e("../util/texture");
  15907. var raycaster = new r.Raycaster;
  15908. //热点大小
  15909. var geometry = new r.PlaneBufferGeometry( g_HotMeshSize.g_HotMeshWidth, g_HotMeshSize.g_HotMeshHeight,1,1);
  15910. var defaultTex1 = te.load(g_HotImage.point);
  15911. var defaultTex2 = te.load(g_HotImage.point2);
  15912. hot.prototype.changeTex = function(){
  15913. var u = this.mesh.material.uniforms
  15914. if(this.styleImg.length){
  15915. u.texture1.value = te.load(this.styleImg[0].src);
  15916. u.texture2.value = te.load(this.styleImg[1]&&this.styleImg[1].src || this.styleImg[0].src);
  15917. }else{
  15918. u.texture1.value = defaultTex1;
  15919. u.texture2.value = defaultTex2;
  15920. }
  15921. }
  15922. hot.prototype.initStyleImg = function(t){
  15923. this.styleImg = []
  15924. t.styleImg = t.styleImg || [];
  15925. t.styleImg.forEach((src)=>{
  15926. this.styleImg.push({src:manage.dealURL(src)})
  15927. })
  15928. this.changeTex()
  15929. }
  15930. hot.prototype.update = function(camera) {
  15931. if(this.isSprite){
  15932. this.mesh.quaternion.copy(camera.quaternion)
  15933. }
  15934. //this.showTitle()
  15935. }
  15936. hot.prototype.setVisiblePanos = function(visibleData){
  15937. this.visiblePanos = [];
  15938. this.model.panos.list.forEach((pano)=>{// 模型遮挡的, 直接不可见
  15939. if(visibleData && !visibleData.includes(pano.id))return; //在热点可视中设置过,不可见
  15940. var isShelter = convertTool.ifIntersectChunks(pano.position, this.position, {model: this.model.colliders});
  15941. if(!isShelter){
  15942. this.visiblePanos.push(pano.id)
  15943. }
  15944. })
  15945. }
  15946. //绘制热点
  15947. hot.prototype.build = function(){
  15948. var t = r.UniformsUtils.clone(f.hot.uniforms);
  15949. var shaderMaterial = new r.ShaderMaterial({
  15950. uniforms: t,
  15951. vertexShader: f.hot.vertexShader,
  15952. fragmentShader: f.hot.fragmentShader,
  15953. transparent: !0
  15954. })
  15955. var sprite = new r.Mesh( geometry, shaderMaterial );
  15956. var hotIconScale = parseFloat(this.infoAttribute.hotIconScale || window.MP_PREFETCHED_MODELDATA.hotIconScale);
  15957. sprite.dynamic = true;
  15958. sprite.position.copy(this.position);
  15959. sprite.quaternion.copy(this.quaternion)
  15960. hotIconScale && sprite.scale.set(hotIconScale, hotIconScale, hotIconScale)
  15961. // this.size && sprite.scale.set(this.size,this.size,this.size);
  15962. sprite.name = this.sid;
  15963. sprite.type = "hotSprite";
  15964. sprite.belongHot = this;
  15965. if(this.link) sprite.hotLink = this.link;
  15966. this.mesh = sprite;
  15967. this.model.add(sprite);
  15968. g_HotMeshes.push(sprite);
  15969. }
  15970. hot.prototype.setTitleElem = function(title){
  15971. var root = $("#hot");
  15972. var elem = $(`<div> ${title}</div>`)
  15973. root.append(elem);
  15974. this.titleElem = elem;
  15975. }
  15976. hot.prototype.showTitle = function(){
  15977. if(!this.titleElem)return;
  15978. var pos = math.getPos2d(this.position, player.camera, $("#player")[0])
  15979. if(pos.trueSide){//inSight
  15980. this.titleElem.css( { "left" : `${pos.pos.x}px`, "top": `${pos.pos.y}px ` });
  15981. this.titleElem.css("display","block");
  15982. }else{
  15983. this.titleElem.css("display","none");
  15984. }
  15985. }
  15986. /* hot.prototype.showTitle = function(){//一直显示title的话
  15987. if(!this.titleElem)return;
  15988. var unvisi = ()=>{
  15989. this.titleElem.css("display","none");
  15990. }
  15991. var visi = ()=>{
  15992. var pos = math.getPos2d(this.position, player.camera, $("#player")[0])
  15993. if(pos.trueSide){//inSight
  15994. this.titleElem.css( { "left" : `${pos.pos.x}px`, "top": `${pos.pos.y}px ` });
  15995. this.titleElem.css("display","block");
  15996. }else{
  15997. unvisi()
  15998. }
  15999. }
  16000. if(this.mesh.visible){
  16001. if(player.mode == 'panorama'){
  16002. visi()
  16003. }else{
  16004. var ifShelter = convertTool.ifShelter(this.position)
  16005. if(ifShelter)unvisi()
  16006. else visi()
  16007. }
  16008. }else{
  16009. unvisi()
  16010. }
  16011. }
  16012. */
  16013. hot.prototype.hideTitle = function(){
  16014. if(!this.titleElem)return;
  16015. this.titleElem.css("display","none");
  16016. }
  16017. hot.prototype.closestPanoTowardTag = function(e, t) {
  16018. var i = []
  16019. , o = []
  16020. , l = this.mesh.position;
  16021. if (e === s.PANORAMA) {
  16022. var c = .5
  16023. , h = t.position.clone().sub(l).normalize();
  16024. // 方奕卓 注释掉下面的筛选条件, 使热点列表能点击过渡
  16025. // i.push(p.filters.isPanoAligned()),
  16026. // i.push(p.filters.inPanoDirection(l, h, c)),
  16027. // i.push(p.filters.isNeighbourPanoTo(t)),
  16028. o.push(p.scoreFunctions.direction(l, h))
  16029. }
  16030. var u = new r.Vector3
  16031. , d = function(e) {
  16032. u.copy(l).sub(e.position);
  16033. var t = -r.Math.radToDeg(Math.atan(u.y / Math.sqrt(u.x * u.x + u.z * u.z)))
  16034. , i = a.tags.navigate.tiltTolerance;
  16035. return a.insideLookLimitDown - i < t && t < a.insideLookLimitUp + i
  16036. }
  16037. , f = function(e) {
  16038. return Math.abs(e.position.x - l.x) > a.tags.visibility.cameraClearance || Math.abs(e.position.z - l.z) > a.tags.visibility.cameraClearance
  16039. };
  16040. i.push(f, d, (pano)=>{ // add
  16041. return player.checkHasNeighbor(pano)
  16042. }),
  16043. o.push(p.scoreFunctions.distanceSquared(this.mesh, -2));
  16044. var g = t.model.panos.sortByScore(i, o);
  16045. if (g && a.tags.navigate.lineOfSight) {
  16046. for (var m = 0; m < g.length; m++) {
  16047. var v = g[m].pano
  16048. , A = v.position.distanceTo(l);
  16049. raycaster.set(v.position, l.clone().sub(v.position).normalize());
  16050. var y = raycaster.intersectObjects(t.model.colliders);
  16051. // return g[0].pano;
  16052. if (0 === y.length || y[0].distance > A) {
  16053. console.log(m);
  16054. return v
  16055. }
  16056. }
  16057. return null
  16058. }
  16059. return g && g.length > 0 && g[0].pano
  16060. }
  16061. var getLink = function(link){
  16062. var src = '';
  16063. var r = link.substring(link.indexOf("html") + 4)//给热点后面加上随机数,让热点确保是最新的
  16064. , o = "en" == manage.number("lang") ? "&lang=" + manage.number("lang") : "";//如果热点的内容是英文版的
  16065. -1 == r.indexOf("?") ? src = link + "?time=" + randomTime().getTime() + "&id=" + window.number + o : src = link + "&time=" + randomTime().getTime() + "&id=" + window.number + o
  16066. return src
  16067. }
  16068. var musicOff = function(){
  16069. //打开热点的时候把背景音乐关闭了,避免与热点里面的音乐冲突
  16070. //g_bgAudio && g_bgAudio.pause();
  16071. if(g_bgAudio && !g_bgAudio.paused){
  16072. manage.switchBgmState(false);
  16073. g_bgAudio.pauseByHot = true
  16074. }
  16075. if(SoundOnVideo){
  16076. SoundOnVideo.pauseByHot = true
  16077. switchSoundBtn(SoundOnVideo)
  16078. }
  16079. if(g_tourAudio)g_tourAudio.pause()
  16080. }
  16081. hot.prototype.examine = function(e, options) {
  16082. try{
  16083. window.parent.postMessage("clickHot",'*')
  16084. //$("#app .aside li" , parent.document)[0].click();
  16085. }catch(e){
  16086. console.log(e)
  16087. }
  16088. options = options || {}
  16089. if(this.actionType == 'noAction' )return;
  16090. if(this.linkType!="common" && this.infoAttribute.iframe && this.infoAttribute.iframe[0] && !options.dontOpen){
  16091. var src = getLink(this.infoAttribute.iframe[0]);
  16092. if(this.linkType=="jumpLink"){
  16093. /* var newPage = window.open(src, "_blank" );
  16094. newPage.focus(); */
  16095. var href = window.location.href
  16096. var index = href.indexOf("&")
  16097. if(index>-1) href = href.substr(0,index) /* pushState replaceState*/
  16098. history.pushState(null, "", href+'&qs=1&firstView=pano:'+player.currentPano.id+',qua:'+ player.quaternion.toArray());
  16099. window.location.href = src
  16100. }else if(this.linkType=="iframeDiv"){
  16101. var div = document.createElement("div");
  16102. $("body").append(div);
  16103. div.style.position = 'fixed';
  16104. div.style.width = div.style.height = "100%";
  16105. div.style.left = div.style.top = '0';
  16106. div.style["z-index"] = "999"
  16107. exit = document.createElement("div");
  16108. exit.id ='myColne'
  16109. exit.style["background-image"] = "url(images/close1.png)";
  16110. exit.style.position = 'absolute';
  16111. exit.style.width = exit.style.height = "50px";
  16112. exit.style.right = '17px'; exit.style.top = "20px"
  16113. exit.style.cursor = "pointer";
  16114. exit.style["background-repeat"] = "no-repeat";
  16115. exit.style["background-size"] = "100%,100%";
  16116. exit.style["background-position"] = "center center";
  16117. exit.style["background-color"] = "rgba(0, 0, 0, 0.2)";
  16118. exit.style["border-radius"] = "50%";
  16119. exit.style["z-index"] = "3"
  16120. exit.onclick = ()=>{
  16121. $(div).remove()
  16122. if(g_bgAudio && g_bgAudio.pauseByHot){
  16123. manage.switchBgmState(true)
  16124. }
  16125. try{
  16126. window.parent.postMessage("closeHot",'*')
  16127. }catch(e){
  16128. console.log(e)
  16129. }
  16130. }
  16131. var myElement = document.createElement("iframe");
  16132. myElement.style.position = 'absolute';
  16133. myElement.style.width = myElement.style.height = "100%";
  16134. myElement.style.left = myElement.style.top = '0';
  16135. myElement.src = src
  16136. div.appendChild(exit);
  16137. div.appendChild(myElement)
  16138. musicOff()
  16139. /* //打开热点的时候把背景音乐关闭了,避免与热点里面的音乐冲突
  16140. //g_bgAudio && g_bgAudio.pause();
  16141. if(g_bgAudio && !g_bgAudio.paused){
  16142. manage.switchBgmState(false);
  16143. g_bgAudio.pauseByHot = true
  16144. }
  16145. if(g_tourAudio)g_tourAudio.pause()
  16146. */
  16147. }
  16148. return;
  16149. }
  16150. if(settings.dontExamHot || this.actionType == 'dontExam'){
  16151. o();
  16152. return;
  16153. }
  16154. if(!player.currentPano)return;
  16155. var hotPop = document.getElementById('popup');
  16156. //获取那个热点的链接
  16157. if(this.link){
  16158. g_currentHot = this;
  16159. hotPop.style.display = "block";
  16160. hotPop.classList.add("wait");
  16161. var myElement = document.createElement("iframe");
  16162. //打开热点的时候把背景音乐关闭了,避免与热点里面的音乐冲突
  16163. //g_bgAudio && g_bgAudio.pause();
  16164. /* if(g_bgAudio && !g_bgAudio.paused){
  16165. manage.switchBgmState(false);
  16166. g_bgAudio.pauseByHot = true
  16167. }
  16168. if(g_tourAudio)g_tourAudio.pause()*/
  16169. musicOff()
  16170. var src = getLink(this.link )
  16171. myElement.src = src;
  16172. myElement.id = "id1";
  16173. myElement.allowTransparency = "true";
  16174. // myElement.scrolling = "no";
  16175. var element=document.getElementById("id1"); //判断页面是否有iframe
  16176. if (typeof(element)== "undefined" || element == null){
  16177. document.querySelector(".popup-content").appendChild(myElement);
  16178. //移动端自动播放
  16179. var videoLoaddingResult = false
  16180. window.loaddingSuccess = function() {
  16181. videoLoaddingResult = true
  16182. }
  16183. setTimeout(function func() {
  16184. if (videoLoaddingResult) {
  16185. var $iframe = document.querySelector('#id1').contentWindow.document;
  16186. if($iframe.querySelector('video')){
  16187. $iframe.querySelector('video').play();
  16188. // alert($iframe.querySelector('video'));
  16189. if(!$iframe.querySelector('video').paused && $iframe.querySelector('.playPause')){
  16190. $iframe.querySelector('.playPause').classList.add("fa-pause");
  16191. }
  16192. }
  16193. if($iframe.querySelector('audio')){
  16194. $iframe.querySelector('audio').play();
  16195. }
  16196. } else {
  16197. setTimeout(func, 300)
  16198. }
  16199. }, 800);
  16200. }
  16201. //setTimeout(function(){$('#player').on("click",e.closePopup);},20)
  16202. }
  16203. // if(hotListSta) {
  16204. // hotPop.classList.remove("wait");
  16205. // return;
  16206. // }
  16207. var t = e.mode
  16208. , i = a.tags.navigate.nearestPano && this.closestPanoTowardTag(t, e.currentPano) || e.currentPano
  16209. , n = this.mesh.position;
  16210. e.flyingToTag = true;
  16211. var o = function() {
  16212. e.flyingToTag = false;
  16213. if(this.link){
  16214. hotPop.classList.remove("wait");
  16215. }
  16216. }.bind(this);
  16217. if(settings.dontExamHot){
  16218. o();
  16219. return;
  16220. }
  16221. if (t === s.PANORAMA){
  16222. var l = {
  16223. pano: i,
  16224. lookAtPoint: n,
  16225. duration: null,
  16226. maxDistanceOverride: null,
  16227. skipWarpingCheck: !1
  16228. };
  16229. e.flyToPano(l, o)
  16230. }else {
  16231. var c = {
  16232. pano: i
  16233. };
  16234. if (n) {
  16235. var h = (new r.Matrix4).lookAt(i.position, n, new r.Vector3(0,1,0));
  16236. c.quaternion = (new r.Quaternion).setFromRotationMatrix(h)
  16237. }
  16238. c.callback = o,
  16239. c.duration = 1500,
  16240. c.mode = s.PANORAMA,
  16241. e.flyToNewMode(c)
  16242. }
  16243. },
  16244. //判断someData里面是否有special字段,如果有就会处理这些特殊的大场景
  16245. // if(window.MP_PREFETCHED_MODELDATA.special){
  16246. // specialScene.special().beforeImplement();
  16247. // }
  16248. //czj 判断是否是数组 如果不是将对象转换为数组
  16249. /* hot.prototype.conversionArray = function(obj){
  16250. if(Object.prototype.toString.call(obj)=='[object Array]') return obj;
  16251. var arr = []
  16252. for (var i in obj) {
  16253. arr.push(obj[i]); //属性
  16254. }
  16255. return arr
  16256. } */
  16257. hot.prototype.convertValue = function(v ,Type){
  16258. var value;
  16259. if(v instanceof Array){
  16260. v.forEach((v1)=>{v1 = parseFloat(v1)})
  16261. value = new Type().fromArray(v);
  16262. }else{
  16263. for(let i in v){v[i] = parseFloat(v[i])}
  16264. value = new Type().copy(v);
  16265. }
  16266. return value
  16267. }
  16268. t.exports = hot;
  16269. }
  16270. , {
  16271. three: 217,
  16272. "../shaders":167,
  16273. "../enum/Viewmode":51,
  16274. "../objects/Panorama":148,
  16275. "../util/texture":194,
  16276. "../settings":166,
  16277. "../util/math": 190,
  16278. }],
  16279. /************************************创建热点模型************************************ */
  16280. 123: [function(e, t, i) {//tag
  16281. (function(i) {
  16282. "use strict";
  16283. function n(e, t, i) {
  16284. var n = i.version || "0";
  16285. "0" !== n && I.info("tag defined using version " + n),
  16286. this.model = e,
  16287. this.sid = t,
  16288. this.color = (new r.Color).set(i.color || l.tagDefault),
  16289. this.hoverColor = l._darken(this.color, .2),
  16290. this.floor = null,
  16291. this.floorIndex = i.floor,
  16292. this.mode = s.PANORAMA,
  16293. i.preferred_camera && i.preferred_camera.mode && (this.mode = i.preferred_camera.mode),
  16294. this.obj3d = null,
  16295. this.disc = null,
  16296. this.materials = {
  16297. disc: null,
  16298. pole: null
  16299. },
  16300. this.position = (new r.Vector3).copy(i.position),
  16301. this.discPosition = (new r.Vector3).copy(i.stem.direction),
  16302. this.discWorldPosition = null,
  16303. this.discScale = .05,
  16304. this.poleEnabled = i.stem.enabled,
  16305. this.billboard = new o(i.label,i.description,i.media,this),
  16306. this.visibleTransition = null,
  16307. this.hoveringDisc = !1
  16308. }
  16309. var r = e("three")
  16310. , o = e("./Billboard/Billboard")
  16311. , a = e("../settings")
  16312. , s = e("../enum/Viewmode")
  16313. , l = e("../enum/Colors")
  16314. , c = e("../enum/RenderLayers")
  16315. , h = e("../enum/RenderOrder")
  16316. , u = (e("../util/common"),
  16317. e("../util/math"))
  16318. , d = e("../util/texture")
  16319. , p = e("../objects/Panorama")
  16320. , f = e("../shaders")
  16321. , g = e("../util/transitions")
  16322. , m = e("../util/lerp")
  16323. , v = e("../util/easing")
  16324. , A = e("./Billboard/BillboardEvent")
  16325. , y = e("events").EventEmitter
  16326. , C = e("../util/logger")
  16327. , I = new C(i)
  16328. , 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==")
  16329. , 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")
  16330. , w = new r.PlaneBufferGeometry(1,1);
  16331. n.prototype = Object.create(y.prototype),
  16332. n.raycaster = new r.Raycaster,
  16333. n.prototype.bindEvents = function() {
  16334. this.billboard.on(A.ENTER, this.setHoverState.bind(this)),
  16335. this.billboard.on(A.LEAVE, this.setFreeState.bind(this))
  16336. }
  16337. ,
  16338. n.prototype.build = function() {
  16339. return this.floor = this.model.floors.get(this.floorIndex) || this.model.floors.first(),
  16340. this.floor && (this.billboard.build(this.model.sid),
  16341. this.obj3d = this.buildObject3D(),
  16342. this.floor.add(this.obj3d)),
  16343. this
  16344. }
  16345. ,
  16346. n.prototype.buildObject3D = function() {
  16347. var e = new r.Object3D;
  16348. e.position.copy(this.position);
  16349. var t = r.UniformsUtils.clone(f.tagDisc.uniforms);
  16350. t.bg.value = b,
  16351. t.mask.value = E,
  16352. t.color.value.copy(this.color),
  16353. this.materials.disc = new r.RawShaderMaterial({
  16354. transparent: !0,
  16355. vertexShader: f.tagDisc.vertexShader,
  16356. fragmentShader: f.tagDisc.fragmentShader,
  16357. uniforms: t
  16358. }),
  16359. this.disc = new r.Mesh(w,this.materials.disc),
  16360. this.disc.layers.set(c.TAG),
  16361. this.disc.position.copy(this.discPosition),
  16362. this.disc.renderOrder = h.tagDisc,
  16363. this.disc.tag = this;
  16364. var i = this.buildPole();
  16365. return i.layers.set(c.TAG),
  16366. i.renderOrder = h.tagStem,
  16367. e.add(i),
  16368. e.layers.set(c.TAG),
  16369. e.add(this.disc)
  16370. }
  16371. ,
  16372. n.prototype.buildPole = function() {
  16373. var e = new r.BufferGeometry
  16374. , t = new Float32Array(6);
  16375. return t[0] = t[1] = t[2] = 0,
  16376. t[3] = this.discPosition.x,
  16377. t[4] = this.discPosition.y,
  16378. t[5] = this.discPosition.z,
  16379. e.addAttribute("position", new r.BufferAttribute(t,3)),
  16380. this.materials.pole = new r.LineBasicMaterial({
  16381. linewidth: a.tags.pole.width,
  16382. color: a.tags.pole.color,
  16383. opacity: 0,
  16384. visible: this.poleEnabled,
  16385. transparent: !0,
  16386. depthWrite: !1
  16387. }),
  16388. new r.Line(e,this.materials.pole)
  16389. }
  16390. ,
  16391. n.prototype.setFreeState = function(e) {
  16392. !e && this.hoveringDisc || this.billboard.close(e).then(function() {
  16393. this.materials.disc.uniforms.color.value = this.color
  16394. }
  16395. .bind(this))
  16396. }
  16397. ,
  16398. n.prototype.setHoverState = function(e) {
  16399. this.billboard.open(e),
  16400. this.materials.disc.uniforms.color.value = this.hoverColor
  16401. }
  16402. ,
  16403. n.prototype.hide = function(e, t) {
  16404. var i = $.Deferred();
  16405. if (0 === this.materials.disc.uniforms.opacity.value && !g.isRunning(this.visibleTransition))
  16406. return i.resolve().promise();
  16407. e = e || 0,
  16408. t = t || 0,
  16409. g.cancel(this.visibleTransition);
  16410. var n = this.materials.disc.uniforms.opacity.value / a.tags.disc.opacity
  16411. , r = t + e
  16412. , o = t / r;
  16413. return this.visibleTransition = g.start(function(e) {
  16414. var t = m.property(e.materials.disc.uniforms.opacity, "value", 0)
  16415. , i = m.property(e.materials.pole, "opacity", 0);
  16416. return function(n) {
  16417. t(n),
  16418. e.materials.pole && i(n)
  16419. }
  16420. }(this), r * n, function() {
  16421. i.resolve()
  16422. }, o, v[a.warp.blendEasing]),
  16423. i.promise()
  16424. }
  16425. ,
  16426. n.prototype.show = function(e, t) {
  16427. var i = $.Deferred();
  16428. if (this.materials.disc.uniforms.opacity.value === a.tags.disc.opacity && !g.isRunning(this.visibleTransition))
  16429. return i.resolve().promise();
  16430. e = e || 0,
  16431. t = t || 0,
  16432. g.cancel(this.visibleTransition);
  16433. var n = (a.tags.disc.opacity - this.materials.disc.uniforms.opacity.value) / a.tags.disc.opacity
  16434. , r = t + e
  16435. , o = t / r;
  16436. return this.visibleTransition = g.start(function(e) {
  16437. var t = m.property(e.materials.disc.uniforms.opacity, "value", a.tags.disc.opacity)
  16438. , i = m.property(e.materials.pole, "opacity", a.tags.pole.opacity);
  16439. return function(n) {
  16440. t(n),
  16441. e.materials.pole && i(n)
  16442. }
  16443. }(this), r * n, function() {
  16444. i.resolve()
  16445. }, o, v[a.warp.blendEasing]),
  16446. i.promise()
  16447. }
  16448. ,
  16449. n.prototype.closestPanoTowardTag = function(e, t) {
  16450. var i = []
  16451. , o = []
  16452. , l = this.disc.getWorldPosition();
  16453. if (e === s.PANORAMA) {
  16454. var c = .5
  16455. , h = t.position.clone().sub(l).normalize();
  16456. i.push(p.filters.isPanoAligned()),
  16457. i.push(p.filters.inPanoDirection(l, h, c)),
  16458. i.push(p.filters.isNeighbourPanoTo(t)),
  16459. o.push(p.scoreFunctions.direction(l, h))
  16460. }
  16461. var u = new r.Vector3
  16462. , d = function(e) {
  16463. u.copy(l).sub(e.position);
  16464. var t = -r.Math.radToDeg(Math.atan(u.y / Math.sqrt(u.x * u.x + u.z * u.z)))
  16465. , i = a.tags.navigate.tiltTolerance;
  16466. return a.insideLookLimitDown - i < t && t < a.insideLookLimitUp + i
  16467. }
  16468. , f = function(e) {
  16469. return Math.abs(e.position.x - l.x) > a.tags.visibility.cameraClearance || Math.abs(e.position.z - l.z) > a.tags.visibility.cameraClearance
  16470. };
  16471. i.push(f, d),
  16472. o.push(p.scoreFunctions.distanceSquared(this, -2));
  16473. var g = this.model.panos.sortByScore(i, o);
  16474. if (a.tags.navigate.lineOfSight) {
  16475. for (var m = 0; m < g.length; m++) {
  16476. var v = g[m].pano
  16477. , A = v.position.distanceTo(l);
  16478. if (!a.tags.visibility.anyDistance && A > a.tags.visibility.visibleDistance)
  16479. return null;
  16480. n.raycaster.set(v.position, l.clone().sub(v.position).normalize());
  16481. var y = n.raycaster.intersectObjects(this.model.colliders);
  16482. if (0 === y.length || y[0].distance > A)
  16483. return v
  16484. }
  16485. return null
  16486. }
  16487. return g.length > 0 && g[0].pano
  16488. }
  16489. ,
  16490. n.prototype.examine = function(e) {
  16491. var t = e.mode
  16492. , i = a.tags.navigate.nearestPano && this.closestPanoTowardTag(t, e.currentPano) || e.currentPano
  16493. , n = this.disc.getWorldPosition();
  16494. this.billboard.setActiveState();
  16495. var o = function() {
  16496. var t = this.billboard.getDimensions()
  16497. , n = new r.Vector3;
  16498. u.convertScreenPositionToNDC(t.left + t.width / 2, t.top + t.height / 2, n),
  16499. n.unproject(e.camera),
  16500. e.flyToPano({
  16501. pano: i,
  16502. lookAtPoint: n
  16503. })
  16504. }
  16505. .bind(this);
  16506. if (t === s.PANORAMA)
  16507. if (i !== e.currentPano) {
  16508. var l = {
  16509. pano: i,
  16510. lookAtPoint: n,
  16511. duration: null,
  16512. maxDistanceOverride: null,
  16513. skipWarpingCheck: !1
  16514. };
  16515. e.flyToPano(l, o)
  16516. } else
  16517. setTimeout(function() {
  16518. this.billboard.open().then(function() {
  16519. o()
  16520. })
  16521. }
  16522. .bind(this), 0);
  16523. else {
  16524. var c = {
  16525. pano: i
  16526. };
  16527. if (n) {
  16528. var h = (new r.Matrix4).lookAt(i.position, n, new r.Vector3(0,1,0));
  16529. c.quaternion = (new r.Quaternion).setFromRotationMatrix(h)
  16530. }
  16531. c.callback = o,
  16532. c.duration = 1500,
  16533. c.mode = s.PANORAMA,
  16534. e.flyToNewMode(c)
  16535. }
  16536. }
  16537. ,
  16538. n.prototype.update = function(e, t) {
  16539. var i = new r.Vector3;
  16540. return function(e, t) {
  16541. this.discWorldPosition = this.disc.getWorldPosition(),
  16542. this.updateDisc(e, t),
  16543. this.billboard.needsUpdate() && (i.copy(this.discWorldPosition).project(t),
  16544. i.z < 1 && (i.y *= -1,
  16545. this.billboard.update(i, this.getDiscRadius(i, t))))
  16546. }
  16547. }(),
  16548. n.prototype.updateDisc = function(e, t) {
  16549. var i = new r.Vector3
  16550. , o = new r.Vector3
  16551. , l = new r.Vector3
  16552. , c = new r.Vector3
  16553. , h = new r.Vector3;
  16554. return function(e, t) {
  16555. var u = a.tags.visibility
  16556. , d = a.tags.disc.scale
  16557. , p = e === s.DOLLHOUSE || e === s.FLOORPLAN ? a.tags.visibility.visibleDistance : t.position.distanceTo(this.discWorldPosition);
  16558. 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)),
  16559. this.obj3d.visible) {
  16560. this.disc.quaternion.copy(t.quaternion);
  16561. var f = d.maxSize - (d.maxSize - d.minSize) * r.Math.smoothstep(p, d.nearBound, d.farBound);
  16562. i.copy(this.discWorldPosition).project(t),
  16563. o.set($("#player").width() / 2, $("#player").height() / 2, 1).multiply(i),
  16564. l.set(f / 2, 0, 0).add(o),
  16565. c.set(2 / $("#player").width(), 2 / $("#player").height(), 1).multiply(l),
  16566. h.copy(c).unproject(t);
  16567. var g = h.distanceTo(this.discWorldPosition)
  16568. , m = 1 + a.tags.disc.scale.responsiveness / 100 * (n.viewportScale() - 1);
  16569. this.discScale = g * m,
  16570. this.disc.scale.set(this.discScale, this.discScale, this.discScale)
  16571. }
  16572. }
  16573. }(),
  16574. n.prototype.getDiscRadius = function(e, t) {
  16575. var i = new r.Vector3;
  16576. return function(e, t) {
  16577. return i.set(-this.discScale / 2, 0, 0).applyQuaternion(t.quaternion).add(this.discWorldPosition).project(t),
  16578. Math.abs(e.x - i.x) * $("#player").width()
  16579. }
  16580. }(),
  16581. n.prototype.tagVisibleOnCurrentFloor = function(e) {
  16582. return !(e === s.DOLLHOUSE || e === s.FLOORPLAN) || this.model.allFloorsVisible || !this.floor.hidden
  16583. }
  16584. ,
  16585. n.prototype.offScreen = function(e, t) {
  16586. var i = e.getWorldPosition().project(t);
  16587. return !(-1 < i.x && i.x < 1 && -1 < i.y && i.y < 1)
  16588. }
  16589. ,
  16590. n.viewportScale = function() {
  16591. return n.viewportWidth === $("#player").width() && n.viewportHeight === $("#player").height() || (n.viewportWidth = $("#player").width(),
  16592. n.viewportHeight = $("#player").height(),
  16593. n.currentViewportScale = Math.sqrt(Math.min(n.viewportWidth, n.viewportHeight) / a.tags.disc.scale.baseViewportSize)),
  16594. n.currentViewportScale
  16595. }
  16596. ,
  16597. t.exports = n
  16598. }
  16599. ).call(this, "/js/tag/tag.js")
  16600. }
  16601. , {
  16602. "../enum/Colors": 19,
  16603. "../enum/RenderLayers": 41,
  16604. "../enum/RenderOrder": 42,
  16605. "../enum/Viewmode": 51,
  16606. "../objects/Panorama": 148,
  16607. "../settings": 166,
  16608. "../shaders": 167,
  16609. "../util/common": 185,
  16610. "../util/easing": 186,
  16611. "../util/lerp": 188,
  16612. "../util/logger": 189,
  16613. "../util/math": 190,
  16614. "../util/texture": 194,
  16615. "../util/transitions": 195,
  16616. "./Billboard/Billboard": 119,
  16617. "./Billboard/BillboardEvent": 120,
  16618. events: 202,
  16619. three: 217
  16620. }],
  16621. 124: [function(e, t, i) {
  16622. (function(i) {
  16623. "use strict";
  16624. function n() {
  16625. this.tagState = y.IDLE,
  16626. this.intersectTag = null,
  16627. this.hoveredTag = null,
  16628. this.activeTag = null,
  16629. this.tagDiscs = [],
  16630. this.raycaster = new r.Raycaster,
  16631. this.modelManager = null,
  16632. this.player = null,
  16633. this.totaltags = 0,
  16634. this.navigatingViaTag = !1,
  16635. this.enabled = !1
  16636. }
  16637. var r = e("three")
  16638. , o = e("../util/logger")
  16639. , a = e("../util/common")
  16640. , s = e("../controls/serializer")
  16641. , l = e("../objects/Snapshot")
  16642. , c = e("../settings")
  16643. , h = e("./Billboard/BillboardEvent")
  16644. , u = e("./Media/MediaEvent")
  16645. , d = e("./Media/LinkType")
  16646. , p = e("../enum/Viewmode")
  16647. , f = e("../enum/WarpStyle")
  16648. , g = e("../enum/BlackoutStyle")
  16649. , m = e("../enum/ModelManagerEvents")
  16650. , v = e("../enum/tagEvents")
  16651. , A = e("../enum/PlayerEvents")
  16652. , y = (e("../util/lerp"),
  16653. e("../enum/TagStates"))
  16654. , C = e("events").EventEmitter
  16655. , I = new o(i);
  16656. a.extend(n, C),
  16657. n.prototype.init = function(e, t) {
  16658. this.modelManager = e,
  16659. this.player = t,
  16660. this.updateModel(),
  16661. this.bindEvents()
  16662. }
  16663. ,
  16664. n.prototype.update = function(e) {
  16665. this.updateTags(this.player.mode, this.player.camera, this.player.currentPano, this.player.flying)
  16666. }
  16667. ,
  16668. n.prototype.updateTags = function(e, t, i, n) {
  16669. for (var r in this.model.tags)
  16670. this.model.tags[r].update(e, t, i, n)
  16671. }
  16672. ,
  16673. n.prototype.updateModel = function() {
  16674. this.model = this.modelManager.getActiveModel(),
  16675. this.gettagsFromModel(),
  16676. this.totaltags = Object.keys(this.model.tags).length
  16677. }
  16678. ,
  16679. n.prototype.gettagsFromModel = function() {
  16680. this.tagDiscs = [];
  16681. for (var e in this.model.tags) {
  16682. var t = this.model.tags[e].disc;
  16683. t && this.tagDiscs.push(t)
  16684. }
  16685. }
  16686. ,
  16687. n.prototype.bindEvents = function() {
  16688. function e() {
  16689. Object.keys(this.model.tags).forEach(function(e) {
  16690. var t = this.model.tags[e];
  16691. t.bindEvents(),
  16692. t.billboard.on(u.LINK_CLICK, function(e) {
  16693. e.type === d.NAVIGATION && this.navigateViaLink(e.url)
  16694. }
  16695. .bind(this)),
  16696. t.billboard.on(u.IMAGE_OPENED, function() {
  16697. this.tagState = y.EXAMINE,
  16698. this.emit(u.IMAGE_OPENED)
  16699. }
  16700. .bind(this)),
  16701. t.billboard.on(h.CLOSING, this.dismissExaminedTag.bind(this))
  16702. }
  16703. .bind(this))
  16704. }
  16705. this.modelManager.on(m.ActiveModelChanged, this.updateModel.bind(this)),
  16706. this.modelManager.on(m.ActiveModelChanged, e.bind(this)),
  16707. this.player.on(A.ModeChanging, this.onPlayerModeChanging.bind(this)),
  16708. this.player.on(A.PanoChosen, this.onPanoChange.bind(this)),
  16709. this.player.on(A.Ready, this.onPlayerReady.bind(this)),
  16710. this.player.on(A.FlyingEnded, this.onPlayerFlyingEnded.bind(this)),
  16711. this.player.on(A.WarpStarted, this.handleWarpStart.bind(this)),
  16712. this.player.on(A.WarpInterrupted, this.handleWarpInterruption.bind(this)),
  16713. e.call(this)
  16714. }
  16715. ,
  16716. n.prototype.navigateViaLink = function(e) {
  16717. var t = s.deserialize(e);
  16718. if (t)
  16719. if (t.mode === p.PANORAMA) {
  16720. try {
  16721. this.player.model.panos.get(t.panoId)
  16722. } catch (e) {
  16723. return void I.warn("Unable to find panorama location", t.panoId)
  16724. }
  16725. this.player.warpToPanoById(t.panoId, t.quaternion, null, null, f.BLACK)
  16726. } else {
  16727. var i = {
  16728. cameraMode: t.mode,
  16729. position: t.position,
  16730. quaternion: t.quaternion,
  16731. scanId: t.panoId,
  16732. orthoZoom: t.zoom,
  16733. floorVisibility: t.floorVisibility,
  16734. thumbUrl: null,
  16735. name: null
  16736. };
  16737. this.player.flyToNewMode({
  16738. mode: t.mode,
  16739. duration: c.warp.outsideTime,
  16740. warpDest: new l(i),
  16741. force: !0
  16742. })
  16743. }
  16744. }
  16745. ,
  16746. n.prototype.handleWarpStart = function(e, t, i, n) {
  16747. this.dismissExaminedTag(),
  16748. t === f.BLACK && (null !== n && void 0 !== n || (n = c.warp.teleportTime),
  16749. e && (i = g.END),
  16750. this.hideShowTagsForBlackoutStyle(i, n))
  16751. }
  16752. ,
  16753. n.prototype.handleWarpInterruption = function(e, t, i) {
  16754. null !== i && void 0 !== i || (i = c.warp.teleportTime),
  16755. this.hideShowTagsForBlackoutStyle(t, i)
  16756. }
  16757. ,
  16758. n.prototype.hideShowTagsForBlackoutStyle = function(e, t) {
  16759. var i = 0
  16760. , n = 0
  16761. , r = t / 2;
  16762. switch (null !== e && void 0 !== e || (e = g.MIDDLE),
  16763. e) {
  16764. case g.END:
  16765. this.hideAlltags(r);
  16766. break;
  16767. case g.BEGINNING:
  16768. this.hideAlltags().done(this.showAlltags.bind(this, r));
  16769. break;
  16770. case g.NONE:
  16771. break;
  16772. case g.MIDDLE:
  16773. i = r,
  16774. n = r,
  16775. this.hideAlltags(n),
  16776. setTimeout(function() {
  16777. this.showAlltags(i)
  16778. }
  16779. .bind(this), n);
  16780. break;
  16781. case g.FADEIN:
  16782. setTimeout(function() {
  16783. this.showAlltags(r)
  16784. }
  16785. .bind(this), r)
  16786. }
  16787. }
  16788. ,
  16789. n.prototype.onPlayerModeChanging = function(e, t) {
  16790. t !== p.PANORAMA && this.dismissExaminedTag(),
  16791. t === p.PANORAMA && player.currentPano && !player.currentPano.isAligned() && (t = p.OUTDOOR);
  16792. var i = t !== p.OUTDOOR;
  16793. i !== this.model.tagsShown && (i ? this.showAlltags(c.tags.startup.fadeInDuration) : this.hideAlltags(c.tags.startup.fadeInDuration))
  16794. }
  16795. ,
  16796. n.prototype.onPanoChange = function(e, t) {
  16797. var i = this.navigatingViaTag;
  16798. if (this.navigatingViaTag = !1,
  16799. !i) {
  16800. this.dismissExaminedTag();
  16801. var n = e && !e.isAligned() ? p.OUTDOOR : p.PANORAMA
  16802. , r = t && !t.isAligned() ? p.OUTDOOR : p.PANORAMA;
  16803. n !== r && (r === p.PANORAMA ? this.showAlltags(c.tags.startup.fadeInDuration, null, !0) : this.hideAlltags(c.tags.startup.fadeInDuration))
  16804. }
  16805. }
  16806. ,
  16807. n.prototype.onPlayerReady = function(e, t, i) {
  16808. this.startAlltags(e, t ? i : null)
  16809. }
  16810. ,
  16811. n.prototype.onPlayerFlyingEnded = function(e, t) {
  16812. this.updateClosestTags(e)
  16813. }
  16814. ,
  16815. n.prototype.dismissExaminedTag = function() {
  16816. this.activeTag && this.tagState === y.EXAMINE && this.dismissActiveTag(),
  16817. this.hoveredTag && (this.hoveredTag.setFreeState(!0),
  16818. this.hoveredTag = null)
  16819. }
  16820. ,
  16821. n.prototype.startAlltags = function(e, t) {
  16822. this.model.shouldShowtags = c.tags.enabled,
  16823. this.enabled = !0,
  16824. e || (this.showAlltags(c.tags.startup.fadeInDuration, c.tags.startup.fadeInDelay),
  16825. t && setTimeout(function() {
  16826. this.activateTag(this.model.getTagBySid(t))
  16827. }
  16828. .bind(this), c.tags.startup.fadeInDuration / 2))
  16829. }
  16830. ,
  16831. n.prototype.showAlltags = function(e, t, i) {
  16832. function n() {
  16833. o++,
  16834. o === this.totaltags && (this.model.tagsShown = !0,
  16835. r.resolve())
  16836. }
  16837. var r = $.Deferred();
  16838. if (!i && this.player.mode === p.PANORAMA && this.player.currentPano && !this.player.currentPano.isAligned() || !this.model.shouldShowtags)
  16839. return r.resolve().promise();
  16840. var o = 0;
  16841. for (var a in this.model.tags) {
  16842. var s = this.model.tags[a];
  16843. s.show(e, t).done(n.bind(this))
  16844. }
  16845. return r.promise()
  16846. }
  16847. ,
  16848. n.prototype.hideAlltags = function(e, t) {
  16849. function i() {
  16850. r++,
  16851. r === this.totaltags && (this.model.tagsShown = !1,
  16852. n.resolve())
  16853. }
  16854. var n = $.Deferred()
  16855. , r = 0;
  16856. for (var o in this.model.tags) {
  16857. var a = this.model.tags[o];
  16858. a.hide(e, t).done(i.bind(this)),
  16859. a === this.activeTag && this.dismissActiveTag()
  16860. }
  16861. return n.promise()
  16862. }
  16863. ,
  16864. n.prototype.enableHovering = function() {
  16865. this.enabled = !0
  16866. }
  16867. ,
  16868. n.prototype.disableHovering = function() {
  16869. this.enabled = !1
  16870. }
  16871. ,
  16872. n.prototype.activateTag = function(e, t) {
  16873. t = t || y.EXAMINE,
  16874. this.activeTag = e,
  16875. this.activeTag.hoveringDisc = !0,
  16876. this.activeTag.setHoverState(t === y.EXAMINE),
  16877. this.tagState = t,
  16878. this.emit(v.TagActivated, e)
  16879. }
  16880. ,
  16881. n.prototype.dismissActiveTag = function() {
  16882. this.activeTag.hoveringDisc = !1,
  16883. this.activeTag.setFreeState(!0);
  16884. var e = this.activeTag;
  16885. this.activeTag = null,
  16886. this.tagState = y.IDLE,
  16887. this.emit(v.TagDismissed, e)
  16888. }
  16889. ,
  16890. n.prototype.clickedOnTag = function(e) {
  16891. var t = function() {
  16892. this.navigatingViaTag = !0,
  16893. this.activeTag.examine(this.player),
  16894. this.emit(v.TagNavigation, this.activeTag)
  16895. }
  16896. .bind(this);
  16897. return this.tagState !== y.EXAMINE ? (this.activateTag(this.intersectTag, y.EXAMINE),
  16898. this.activeTag = this.intersectTag,
  16899. t(),
  16900. !0) : (this.dismissActiveTag(),
  16901. !1)
  16902. }
  16903. ,
  16904. n.prototype.intersecttag = function() {
  16905. var e = new r.Vector3
  16906. , t = new r.Vector3
  16907. , i = new r.Vector3;
  16908. return function(n, r, o) {
  16909. if (!this.enabled)
  16910. return null;
  16911. var a = null
  16912. , s = this.tagDiscs.filter(function(e) {
  16913. return e.parent.visible
  16914. });
  16915. if (s.length > 0) {
  16916. var l = this.model.floors.reduce(function(e, t) {
  16917. return t.hidden ? e : e.concat(t.collider.children)
  16918. }, s);
  16919. e.set(n.x, n.y, -1).unproject(o),
  16920. t.set(n.x, n.y, 1).unproject(o),
  16921. i.copy(t).sub(e).normalize(),
  16922. this.raycaster.set(e, i);
  16923. var c = this.raycaster.intersectObjects(l);
  16924. c.length > 0 && s.indexOf(c[0].object) !== -1 && (a = c[0].object.tag)
  16925. }
  16926. return this.intersectTag = a,
  16927. r && (this.activeTag && a !== this.activeTag && (this.tagState === y.BROWSE || this.tagState === y.EXAMINE && a) && this.dismissActiveTag(),
  16928. a && a !== this.activeTag && (a.listeners(h.ENTER).length < 1 && (a.billboard.on(h.ENTER, function() {
  16929. this.hoveredTag = a
  16930. }
  16931. .bind(this)),
  16932. a.billboard.on(h.LEAVE, function() {
  16933. this.hoveredTag = null
  16934. }
  16935. .bind(this))),
  16936. this.activateTag(a, y.BROWSE))),
  16937. a
  16938. }
  16939. }(),
  16940. n.prototype.rankedtagInDirection = function() {
  16941. var e = []
  16942. , t = []
  16943. , i = new r.Vector3
  16944. , n = new r.Vector3
  16945. , o = new r.Vector3;
  16946. return function(r, a, s, l) {
  16947. var c = 0;
  16948. t.length = 0;
  16949. for (var h = 0; h < this.closesttags.length; h++) {
  16950. var u = this.closesttags[h];
  16951. n.copy(u.position),
  16952. n.add(u.discPosition),
  16953. i.copy(a),
  16954. i.sub(n).negate(),
  16955. i.normalize();
  16956. var d = i.dot(l);
  16957. if (d >= 0) {
  16958. o.copy(n),
  16959. o.project(s);
  16960. var p = this.intersecttag(o, !1, s);
  16961. if (p) {
  16962. if (c >= e.length)
  16963. for (var f = 0; f < 64; f++)
  16964. e.push({
  16965. tag: u,
  16966. dot: d
  16967. });
  16968. var g = e[c];
  16969. g.tag = u,
  16970. g.dot = d,
  16971. g.position = math.projectPositionToCanvas(n, s),
  16972. t.push(g),
  16973. c++
  16974. }
  16975. }
  16976. }
  16977. return t.sort(function(e, t) {
  16978. return e.dot > t.dot ? -1 : e.dot < t.dot ? 1 : 0
  16979. }),
  16980. r < t.length ? t[r].tag : null
  16981. }
  16982. }(),
  16983. n.prototype.updateClosestTags = function() {
  16984. var e = new r.Vector3
  16985. , t = 30;
  16986. return function(i) {
  16987. this.closesttags || (this.closesttags = []),
  16988. this.closesttags.length = 0;
  16989. var n = this.model.tags;
  16990. if (n)
  16991. for (var r in n)
  16992. if (n.hasOwnProperty(r)) {
  16993. var o = n[r]
  16994. , a = o.position;
  16995. e.copy(i),
  16996. e.sub(a).negate();
  16997. var s = e.lengthSq();
  16998. s < t && this.closesttags.push(o)
  16999. }
  17000. }
  17001. }(),
  17002. t.exports = n
  17003. }
  17004. ).call(this, "/js/tag/tagManager.js")
  17005. }
  17006. , {
  17007. "../controls/serializer": 14,
  17008. "../enum/BlackoutStyle": 18,
  17009. "../enum/tagEvents": 32,
  17010. "../enum/ModelManagerEvents": 33,
  17011. "../enum/PlayerEvents": 40,
  17012. "../enum/TagStates": 44,
  17013. "../enum/Viewmode": 51,
  17014. "../enum/WarpStyle": 52,
  17015. "../objects/Snapshot": 153,
  17016. "../settings": 166,
  17017. "../util/common": 185,
  17018. "../util/lerp": 188,
  17019. "../util/logger": 189,
  17020. "./Billboard/BillboardEvent": 120,
  17021. "./Media/LinkType": 130,
  17022. "./Media/MediaEvent": 131,
  17023. events: 202,
  17024. three: 217
  17025. }],
  17026. 125: [function(e, t, i) {
  17027. (function(i) {
  17028. "use strict";
  17029. function n() {
  17030. this.embedWrapper = null,
  17031. this.embedElement = null
  17032. }
  17033. var r = e("../../util/ajax")
  17034. , o = e("./mediaSettings")
  17035. , a = e("../../settings")
  17036. , s = e("../../util/logger")
  17037. , l = new s(i);
  17038. n.prototype.createDomElement = function() {
  17039. return this.embedWrapper = document.createElement("div"),
  17040. this.embedWrapper.classList.add("tag-embed"),
  17041. this.embedWrapper.classList.add("hidden"),
  17042. this.embedWrapper
  17043. }
  17044. ,
  17045. n.prototype.load = function(e) {
  17046. var t = "https://api.embedly.com/1/oembed?key=" + a.appConfig.embedly_key + "&url=" + encodeURIComponent(e) + "&maxwidth=" + o.maxEmbedWidth;
  17047. return new Promise(function(e, i) {
  17048. r.get(t).then(function(t) {
  17049. if (t = JSON.parse(t),
  17050. t.html && t.html.indexOf("<script") === -1) {
  17051. this.embedWrapper.innerHTML = t.html;
  17052. var n = Math.min(t.width, o.maxEmbedWidth) || o.maxEmbedWidth;
  17053. if (this.embedWrapper.style.width = n + "px",
  17054. t.height) {
  17055. var r = t.height / t.width;
  17056. this.embedWrapper.style.height = n * r + "px"
  17057. }
  17058. this.embedElement = this.embedWrapper.firstChild;
  17059. var a = [];
  17060. try {
  17061. a = [].slice.call(this.embedElement.querySelectorAll("a"))
  17062. } catch (e) {
  17063. l.debug("Error getting `a` elements for embed; was it an iframe?")
  17064. }
  17065. a.forEach(function(e) {
  17066. e.setAttribute("target", "_blank")
  17067. }),
  17068. this.embedElement.classList.add("hidden"),
  17069. this.embedWrapper.classList.remove("hidden"),
  17070. e()
  17071. } else
  17072. i("Not a valid embed")
  17073. }
  17074. .bind(this), function(e) {
  17075. i(e.response)
  17076. })
  17077. }
  17078. .bind(this))
  17079. }
  17080. ,
  17081. n.prototype.show = function() {
  17082. this.embedElement && this.embedElement.classList.remove("hidden")
  17083. }
  17084. ,
  17085. n.prototype.hide = function() {
  17086. this.embedElement && this.embedElement.classList.add("hidden")
  17087. }
  17088. ,
  17089. t.exports = n
  17090. }
  17091. ).call(this, "/js/tag/Media/EmbedlyEmbed.js")
  17092. }
  17093. , {
  17094. "../../settings": 166,
  17095. "../../util/ajax": 181,
  17096. "../../util/logger": 189,
  17097. "./mediaSettings": 132
  17098. }],
  17099. 126: [function(e, t, i) {
  17100. (function(i) {
  17101. "use strict";
  17102. function n(e) {
  17103. o.call(this),
  17104. this.options = e,
  17105. this.playerControls = null,
  17106. this.state = s.NOT_READY
  17107. }
  17108. var r = e("../../util/browser")
  17109. , o = e("./EmbedlyEmbed")
  17110. , a = e("../../util/logger")
  17111. , s = (new a(i),
  17112. Object.freeze({
  17113. NOT_READY: "player.not.ready",
  17114. CUED: "player.cued",
  17115. PLAYING: "player.playing",
  17116. PAUSED: "player.paused"
  17117. }));
  17118. n.prototype = Object.create(o.prototype),
  17119. n.prototype.createDomElement = function() {
  17120. return this.embedWrapper = document.createElement("div"),
  17121. this.embedWrapper.classList.add("tag-video"),
  17122. this.embedWrapper.classList.add("hidden"),
  17123. this.embedWrapper
  17124. }
  17125. ,
  17126. n.prototype.load = function(e) {
  17127. var t = function() {
  17128. function e(e) {
  17129. this.playerState = s.CUED,
  17130. this.options.startMuted && this.playerControls.mute()
  17131. }
  17132. function t(e) {
  17133. this.playerState = e
  17134. }
  17135. function i(e) {
  17136. this.playerControls.setCurrentTime(0),
  17137. this.options.loop ? this.playerControls.play() : this.playerControls.pause()
  17138. }
  17139. this.playerControls = new playerjs.Player(this.embedElement),
  17140. this.playerControls.on("ready", e.bind(this)),
  17141. this.playerControls.on("play", t.bind(this, s.PLAYING)),
  17142. this.playerControls.on("pause", t.bind(this, s.PAUSED)),
  17143. this.playerControls.on("ended", i.bind(this))
  17144. }
  17145. .bind(this);
  17146. return o.prototype.load.call(this, e).then(t.bind(this))
  17147. }
  17148. ,
  17149. n.prototype.play = function() {
  17150. var e = r.isMobile();
  17151. return function() {
  17152. this.playerState !== s.NOT_READY && this.playerControls && !e && (this.state === s.CUED && this.options.autoPlay || this.options.autoResume) && this.playerControls.play()
  17153. }
  17154. }(),
  17155. n.prototype.pause = function() {
  17156. this.playerState !== s.NOT_READY && this.playerControls && this.playerControls.pause()
  17157. }
  17158. ,
  17159. t.exports = n
  17160. }
  17161. ).call(this, "/js/tag/Media/EmbedlyPlayer.js")
  17162. }
  17163. , {
  17164. "../../util/browser": 182,
  17165. "../../util/logger": 189,
  17166. "./EmbedlyEmbed": 125
  17167. }],
  17168. 127: [function(e, t, i) {
  17169. (function(i) {
  17170. "use strict";
  17171. function n(e) {
  17172. function t() {
  17173. return a.debug("requesting file from embedly:", e.href),
  17174. r.get(e.href, {
  17175. responseType: e.responseType
  17176. }).then(function(t) {
  17177. return a.debug("requesting file finished:", e.href),
  17178. t
  17179. })
  17180. }
  17181. function i() {}
  17182. return s = new Promise(function(e, n) {
  17183. s.catch(i).then(function() {
  17184. t().then(e, n)
  17185. })
  17186. }
  17187. )
  17188. }
  17189. var r = e("../../util/ajax")
  17190. , o = (e("./mediaSettings"),
  17191. e("../../util/logger"))
  17192. , a = new o(i)
  17193. , s = Promise.resolve();
  17194. t.exports.enqueue = n
  17195. }
  17196. ).call(this, "/js/tag/Media/EmbedlyQueue.js")
  17197. }
  17198. , {
  17199. "../../util/ajax": 181,
  17200. "../../util/logger": 189,
  17201. "./mediaSettings": 132
  17202. }],
  17203. 128: [function(e, t, i) {
  17204. (function(i) {
  17205. "use strict";
  17206. function n() {
  17207. this.imageWrapper = null,
  17208. this.width = 0,
  17209. this.height = 0,
  17210. this.aspect = 1
  17211. }
  17212. var r = e("./MediaEvent")
  17213. , o = e("./EmbedlyQueue")
  17214. , a = e("events").EventEmitter
  17215. , s = e("../../util/logger")
  17216. , l = e("../../settings");
  17217. new s(i);
  17218. n.prototype = Object.create(a.prototype),
  17219. n.prototype.createDomElement = function() {
  17220. return this.imageWrapper = document.createElement("div"),
  17221. this.imageWrapper.classList.add("tag-image"),
  17222. this.imageWrapper.classList.add("hidden"),
  17223. this.imageWrapper.addEventListener("click", function(e) {
  17224. e.stopPropagation(),
  17225. this.emit(r.IMAGE_OPENING),
  17226. this.imageWrapper.style.pointerEvents = "none"
  17227. }
  17228. .bind(this)),
  17229. this.imageWrapper
  17230. }
  17231. ,
  17232. n.prototype.onClosed = function() {
  17233. this.imageWrapper.style.pointerEvents = "auto"
  17234. }
  17235. ,
  17236. n.prototype.load = function(e) {
  17237. var t = Math.max(window.screen.height, window.screen.width)
  17238. , i = "https://i.embed.ly/1/display/resize?key=" + l.appConfig.embedly_key + "&url=" + encodeURIComponent(e) + "&width=" + t + "&height=" + t;
  17239. return new Promise(function(e, t) {
  17240. function n(t) {
  17241. var i = t.target;
  17242. this.width = i.naturalWidth,
  17243. this.height = i.naturalHeight,
  17244. this.aspect = this.width / this.height;
  17245. var n = t.target.src;
  17246. this.imageWrapper.style.backgroundImage = 'url("' + n + '")',
  17247. this.imageWrapper.style.width = this.width + "px",
  17248. this.imageWrapper.style.height = this.height + "px",
  17249. this.imageWrapper.classList.remove("hidden"),
  17250. e()
  17251. }
  17252. o.enqueue({
  17253. href: i,
  17254. responseType: "arraybuffer"
  17255. }).then(function(e) {
  17256. var t = new Uint8Array(e)
  17257. , i = new Blob([t])
  17258. , r = new window.Image;
  17259. r.addEventListener("load", n.bind(this));
  17260. var o = URL.createObjectURL(i);
  17261. r.src = o
  17262. }
  17263. .bind(this), t)
  17264. }
  17265. .bind(this))
  17266. }
  17267. ,
  17268. t.exports = n
  17269. }
  17270. ).call(this, "/js/tag/Media/Image.js")
  17271. }
  17272. , {
  17273. "../../settings": 166,
  17274. "../../util/logger": 189,
  17275. "./EmbedlyQueue": 127,
  17276. "./MediaEvent": 131,
  17277. events: 202
  17278. }],
  17279. 129: [function(e, t, i) {
  17280. "use strict";
  17281. function n(e) {
  17282. this.label = e.label,
  17283. this.href = e.url,
  17284. this.type = this.updateLinkForType(),
  17285. this.domElement = null,
  17286. this.id = c++
  17287. }
  17288. var r = e("./LinkType")
  17289. , o = e("./MediaEvent")
  17290. , a = e("../../util/browser")
  17291. , s = e("../../analytics")
  17292. , l = e("events").EventEmitter
  17293. , c = 0;
  17294. n.prototype = Object.create(l.prototype),
  17295. n.prototype.updateLinkForType = function() {
  17296. function e(e) {
  17297. var t = new RegExp("[#&?]start=([^#&?]*)")
  17298. , i = t.exec(e);
  17299. return i[1]
  17300. }
  17301. function t(e) {
  17302. return e + "&play=1"
  17303. }
  17304. var i = a.valueFromHash("m") || a.valueFromHash("model");
  17305. 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),
  17306. r.NAVIGATION) : (this.href = t(this.href),
  17307. r.MODEL) : r.EXT_LINK
  17308. }
  17309. ;
  17310. var h = {};
  17311. n.prototype.createDomElement = function() {
  17312. function e(e) {
  17313. switch (e.stopPropagation(),
  17314. h[this.id] = !0,
  17315. s.trackAlways("click_tag_link", {
  17316. link_type: this.type,
  17317. link_count: c,
  17318. links_clicked: Object.keys(h).length
  17319. }),
  17320. this.type) {
  17321. case r.MODEL:
  17322. window.location.replace(this.href);
  17323. break;
  17324. case r.EXT_LINK:
  17325. window.open(this.href, "_blank")
  17326. }
  17327. this.emit(o.LINK_CLICK, {
  17328. type: this.type,
  17329. url: this.href
  17330. })
  17331. }
  17332. if (this.domElement = document.createElement("a"),
  17333. this.domElement.classList.add("tag-link"),
  17334. this.domElement.textContent = this.label,
  17335. this.type === r.EXT_LINK) {
  17336. this.domElement.textContent += " ";
  17337. var t = document.createElement("i");
  17338. t.classList.add("icon-ext-link"),
  17339. t.title = "Link to external web site",
  17340. this.domElement.appendChild(t)
  17341. }
  17342. return this.domElement.addEventListener("click", e.bind(this)),
  17343. this.domElement
  17344. }
  17345. ,
  17346. t.exports = n
  17347. }
  17348. , {
  17349. "../../analytics": 4,
  17350. "../../util/browser": 182,
  17351. "./LinkType": 130,
  17352. "./MediaEvent": 131,
  17353. events: 202
  17354. }],
  17355. 130: [function(e, t, i) {
  17356. "use strict";
  17357. t.exports = {
  17358. NAVIGATION: "navigation",
  17359. MODEL: "model",
  17360. EXT_LINK: "ext-link"
  17361. }
  17362. }
  17363. , {}],
  17364. 131: [function(e, t, i) {
  17365. "use strict";
  17366. t.exports = Object.freeze({
  17367. LINK_CLICK: "mtmedia.link",
  17368. IMAGE_LOADED: "mtmedia.image.loaded",
  17369. IMAGE_OPENING: "mtmedia.image.opening",
  17370. IMAGE_OPENED: "mtmedia.image.opened",
  17371. IMAGE_CLOSING: "mtmedia.image.closing",
  17372. IMAGE_CLOSED: "mtmedia.image.closed",
  17373. VIDEO_START: "mtmedia.video.start",
  17374. VIDEO_PAUSE: "mtmedia.video.pause",
  17375. VIDEO_ENDED: "mtmedia.video.end"
  17376. })
  17377. }
  17378. , {}],
  17379. 132: [function(e, t, i) {
  17380. "use strict";
  17381. t.exports = Object.freeze({
  17382. maxEmbedWidth: 350,
  17383. defaultAspectRatio: .75
  17384. })
  17385. }
  17386. , {}],
  17387. 133: [function(e, t, i) {
  17388. "use strict";
  17389. t.exports = Object.freeze({
  17390. TEXT: "text",
  17391. LINK: "link",
  17392. IMAGE: "photo",
  17393. VIDEO: "video",
  17394. RICH: "rich"
  17395. })
  17396. }
  17397. , {}],
  17398. 134: [function(e, t, i) {
  17399. "use strict";
  17400. function n(e) {
  17401. this.capabilities = {
  17402. links: {
  17403. enable: e.supportLinks,
  17404. keepLabels: e.keepLinkLabels
  17405. }
  17406. }
  17407. }
  17408. var r = e("./DescriptionChunkType");
  17409. n.prototype.parse = function(e, t) {
  17410. var i = []
  17411. , n = e.split("[").map(function(e, t) {
  17412. return 0 === t ? e : "[" + e
  17413. });
  17414. return n.forEach(function(e) {
  17415. var n = this.findMarkdown(e);
  17416. if (n) {
  17417. if (n.url.indexOf("javascript:") !== -1)
  17418. return;
  17419. this.addLinkChunk(i, n, t),
  17420. this.addTextChunk(i, e.slice(n.markdown.length))
  17421. } else
  17422. this.addTextChunk(i, e)
  17423. }
  17424. .bind(this)),
  17425. i
  17426. }
  17427. ,
  17428. n.prototype.findMarkdown = function(e) {
  17429. var t = /\[([^\]]*)\]\((.*)\)/
  17430. , i = e.match(t);
  17431. if (i) {
  17432. for (var n = i[2], r = 1, o = 0; o < n.length && ("(" === n[o] ? r++ : ")" === n[o] && r--,
  17433. 0 !== r); )
  17434. o++;
  17435. var a = n.length - o;
  17436. return {
  17437. markdown: i[0].substring(0, i[0].length - a),
  17438. label: i[1],
  17439. url: i[2].substring(0, o)
  17440. }
  17441. }
  17442. }
  17443. ,
  17444. n.prototype.addTextChunk = function(e, t) {
  17445. 0 !== t.length && e.push({
  17446. type: r.TEXT,
  17447. text: t
  17448. })
  17449. }
  17450. ,
  17451. n.prototype.addLinkChunk = function(e, t) {
  17452. if (!this.capabilities.links.enable)
  17453. return void (this.capabilities.links.keepLabels && this.addTextChunk(e, t.label));
  17454. var i = {
  17455. label: t.label,
  17456. url: t.url
  17457. };
  17458. i.url.indexOf("://") === -1 && (i.url = "http://" + i.url),
  17459. e.push({
  17460. type: r.LINK,
  17461. link: i
  17462. })
  17463. }
  17464. ,
  17465. t.exports = n
  17466. }
  17467. , {
  17468. "./DescriptionChunkType": 133
  17469. }],
  17470. 135: [function(e, t, i) {
  17471. (function(i) {
  17472. "use strict";
  17473. var n = e("../util/logger")
  17474. , r = new n(i)
  17475. , o = {
  17476. parseIdsFromChunkName: function(e, t) {
  17477. t.floorId = o.parseFloor(e),
  17478. t.roomId = o.parseRoom(e)
  17479. },
  17480. parseFloor: function(e) {
  17481. var t = e.match(/_group([0-9]+)/);
  17482. if (!t)
  17483. return 0;
  17484. try {
  17485. return parseInt(t[1], 10)
  17486. } catch (e) {
  17487. return r.warn('Non-int value "' + t[1] + '" for mesh group, defaulting to floor 0'),
  17488. 0
  17489. }
  17490. },
  17491. parseRoom: function(e) {
  17492. var t = e.match(/_sub([0-9]+)/);
  17493. if (!t)
  17494. return -1;
  17495. try {
  17496. return parseInt(t[1], 10)
  17497. } catch (e) {
  17498. return r.warn('Non-int value "' + t[1] + '" for mesh subgroup, defaulting to subgroup 0'),
  17499. 0
  17500. }
  17501. }
  17502. };
  17503. t.exports = o
  17504. }
  17505. ).call(this, "/js/model/Chunks.js")
  17506. }
  17507. , {
  17508. "../util/logger": 189
  17509. }],
  17510. 136: [function(e, t, i) {
  17511. (function(i) {
  17512. "use strict";
  17513. function n(e) {
  17514. s.call(this),
  17515. this.model = e,
  17516. this.exploded = !1
  17517. }
  17518. var r = e("../objects/Floor")
  17519. , o = (e("../settings"),
  17520. e("../util/logger"))
  17521. , a = e("../util/transitions")
  17522. , s = e("../util/IndexedCollection")
  17523. , l = e("../util/common")
  17524. , c = e("../util/easing");
  17525. new o(i);
  17526. l.inherit(n, s),
  17527. n.prototype.add = function(e) {
  17528. s.prototype.add.call(this, e),
  17529. this.model.add(e)
  17530. }
  17531. ,
  17532. n.prototype.getIndex = function(e) {
  17533. return e.floorIndex
  17534. }
  17535. ,
  17536. n.prototype.build = function() {
  17537. this.list.forEach(function(e) {
  17538. e.build()
  17539. })
  17540. }
  17541. ,
  17542. n.prototype.size = function() {
  17543. return this.length
  17544. }
  17545. ,
  17546. n.prototype.sort = function() {
  17547. s.prototype.sort.call(this, function(e, t) {
  17548. return e.floorIndex - t.floorIndex
  17549. })
  17550. }
  17551. ,
  17552. n.prototype.nextFloor = function(e, t) {
  17553. return this.index[e.floorIndex + t] || null
  17554. }
  17555. ,
  17556. n.prototype.getFloorAtPoint = function(e) {
  17557. for (var t = null, i = 1 / 0, n = 0; n < this.list.length; n++) {
  17558. var r = this.list[n]
  17559. , o = r.distanceToPoint(e);
  17560. (!t || i > o) && (i = o,
  17561. t = r)
  17562. }
  17563. return t
  17564. }
  17565. ,
  17566. n.prototype.getOrMakeFloor = function(e) {
  17567. var t = this.index[e];
  17568. return t || (t = new r(this.model,e),
  17569. this.add(t)),
  17570. t
  17571. }
  17572. ,
  17573. n.prototype.hide = function() {
  17574. this.list.forEach(function(e) {
  17575. e.hide()
  17576. })
  17577. }
  17578. ,
  17579. n.prototype.show = function() {
  17580. this.list.forEach(function(e) {
  17581. e.show()
  17582. })
  17583. }
  17584. ,
  17585. n.prototype.names = function() {
  17586. return this.list.reduce(function(e, t) {
  17587. return e.concat(t.name)
  17588. }, [])
  17589. }
  17590. ,
  17591. n.prototype.toggleExplodeHorizontal = function() {
  17592. function e(e, t) {
  17593. r.copy(e.position),
  17594. e.position.x = i[e.floorIndex] * t,
  17595. e.position.y = 1 * e.floorIndex * t,
  17596. r.sub(e.position).multiplyScalar(-1),
  17597. e.panos.forEach(function(e) {
  17598. e.translate(r)
  17599. })
  17600. }
  17601. var t, i = [], n = 0;
  17602. this.list.forEach(function(e, r, o) {
  17603. t = r > 0 ? Math.max(o[r - 1].boundingBox.max.x - e.boundingBox.min.x, e.boundingBox.size().x / 2) : 0,
  17604. n += t,
  17605. i[r] = n
  17606. }),
  17607. i = i.map(function(e) {
  17608. return e - n / 2
  17609. });
  17610. var r = this.list[0].position.clone();
  17611. this.exploded ? this.list.forEach(function(t) {
  17612. a.start(function(i) {
  17613. e(t, 1 - i)
  17614. }, 1500, null, 0, c.easeOutExpo)
  17615. }) : this.list.forEach(function(t) {
  17616. a.start(function(i) {
  17617. e(t, i)
  17618. }, 1500, null, 0, c.easeOutExpo)
  17619. }),
  17620. this.exploded = !this.exploded
  17621. }
  17622. ,
  17623. n.prototype.toggleExplodeVertical = function() {
  17624. function e(e, i) {
  17625. var n = n.copy(e.position);
  17626. e.position.y = (5 * e.floorIndex - t.y / 2) * i,
  17627. n.sub(e.position).multiplyScalar(-1),
  17628. e.panos.forEach(function(e) {
  17629. e.translate(n)
  17630. })
  17631. }
  17632. var t = this.model.size;
  17633. this.list[0].position.clone();
  17634. this.exploded ? this.list.forEach(function(t) {
  17635. a.start(function(i) {
  17636. e(t, 1 - i)
  17637. }, 1500, null, 0, c.easeOutExpo)
  17638. }) : this.list.forEach(function(t) {
  17639. a.start(function(i) {
  17640. e(t, i)
  17641. }, 1500, null, 0, c.easeOutExpo)
  17642. }),
  17643. this.exploded = !this.exploded
  17644. }
  17645. ,
  17646. t.exports = n
  17647. }
  17648. ).call(this, "/js/model/FloorCollection.js")
  17649. }
  17650. , {
  17651. "../objects/Floor": 146,
  17652. "../settings": 166,
  17653. "../util/IndexedCollection": 175,
  17654. "../util/common": 185,
  17655. "../util/easing": 186,
  17656. "../util/logger": 189,
  17657. "../util/transitions": 195
  17658. }],
  17659. 137: [function(e, t, i) {
  17660. (function(i) {
  17661. "use strict";
  17662. function n() {
  17663. c.call(this)
  17664. }
  17665. var r = e("../settings")
  17666. , o = e("../util/logger")
  17667. , a = e("../enum/Viewmode")
  17668. , s = e("../objects/Snapshot")
  17669. , l = (e("../util/math"),
  17670. e("../util/common"))
  17671. , c = e("../util/IndexedCollection")
  17672. , h = new o(i);
  17673. l.inherit(n, c),
  17674. n.prototype.getImage = function(e) {
  17675. return e && this.index.hasOwnProperty(e) ? this.index[e] : null
  17676. }
  17677. ,
  17678. n.prototype.filterByModesAndReel = function(e, t) {
  17679. for (var i = [], n = 0; n < t.length; n += 1) {
  17680. var r = t[n]
  17681. , o = this.index[r.sid];
  17682. o && i.push(o)
  17683. }
  17684. var s = e[a.DOLLHOUSE]
  17685. , l = e[a.FLOORPLAN];
  17686. i = i.filter(function(e) {
  17687. if (!e.metadata || void 0 === e.metadata.camera_mode)
  17688. return !0;
  17689. var t;
  17690. try {
  17691. t = a.convertWorkshopModeInt(e.metadata.camera_mode)
  17692. } catch (e) {
  17693. return h.debug(e.message),
  17694. !1
  17695. }
  17696. return t === a.PANORAMA || t === a.FLOORPLAN && l || t === a.DOLLHOUSE && s
  17697. }),
  17698. i.length !== this.list.length && h.info("Disallowed " + (this.list.length - i.length) + " highlight images"),
  17699. this.list = i,
  17700. this.reIndex()
  17701. }
  17702. ,
  17703. n.prototype.getHeroLocations = function(panos) {//改 增加二级location
  17704. if (0 === this.list.length)
  17705. return [];
  17706. var locations = [];
  17707. var deal = (info, container)=>{
  17708. var src = info.thumbnail_signed_src,
  17709. o = info.name || "";
  17710. if (info.metadata && void 0 !== info.metadata.camera_quaternion) {
  17711. if (!r.show360Views.enabled && info.metadata.scan_id) {
  17712. let a = panos.get(info.metadata.scan_id);
  17713. if (a && !a.isAligned()) return
  17714. }
  17715. var cameraMode = a.convertWorkshopModeInt(info.metadata.camera_mode);
  17716. if (cameraMode === a.MESH) return
  17717. if(window.isLocal)src = manage.dealURL(src)
  17718. else src = "one" === g_version ? g_Prefix + src + "?" + randomTime().getTime() : src + "?" + randomTime().getTime()
  17719. var l = {
  17720. cameraMode: cameraMode,
  17721. position: info.metadata.camera_position,
  17722. quaternion: info.metadata.camera_quaternion,
  17723. zoom: info.metadata.zoom,
  17724. panoId: info.metadata.scan_id,
  17725. orthoZoom: info.metadata.ortho_zoom,
  17726. floorVisibility: void 0 !== info.metadata.floor_visibility ? info.metadata.floor_visibility.slice(0) : [],
  17727. thumbUrl: src,
  17728. name: n.filterImageName(o),
  17729. sid: info.sid
  17730. }
  17731. var item = new s(l);
  17732. item.momentTour = info.momentTour
  17733. container.push(item)
  17734. return item
  17735. }
  17736. }
  17737. this.list.forEach(image=>{
  17738. if(image.images){
  17739. var folder = $.extend({}, image )
  17740. folder.heroLocations = [];
  17741. image.images.list.forEach(child=>{
  17742. deal(child, folder.heroLocations);
  17743. })
  17744. folder.musicInfo = folder.musicInfo || {}
  17745. locations.push(folder)
  17746. delete folder.images;
  17747. delete folder.locations;
  17748. }else{
  17749. var item = deal(image, locations);
  17750. item.musicInfo = image.musicInfo || g_data2.tourAudio[item.sid] || {}//新的music数据统一写在每个info下,如果有musicInfo则覆盖g_data2.tourAudio
  17751. }
  17752. })
  17753. return locations
  17754. }
  17755. ,
  17756. n.prototype.getIndex = function(e) {
  17757. return e.sid
  17758. }
  17759. ,
  17760. n.filterImageName = function(e) {
  17761. return "" === e || e.match(/^[0-9.]+_[0-9.]+$/) ? null : e
  17762. }
  17763. ,
  17764. t.exports = n
  17765. }
  17766. ).call(this, "/js/model/ImageCollection.js")
  17767. }
  17768. , {
  17769. "../enum/Viewmode": 51,
  17770. "../objects/Snapshot": 153,
  17771. "../settings": 166,
  17772. "../util/IndexedCollection": 175,
  17773. "../util/common": 185,
  17774. "../util/logger": 189,
  17775. "../util/math": 190
  17776. }],
  17777. 138: [function(e, t, i) {
  17778. (function(i) {
  17779. "use strict";
  17780. function n() {
  17781. u.call(this)
  17782. }
  17783. var r = e("../label/Label")
  17784. , o = e("../settings")
  17785. , a = e("../util/logger")
  17786. , s = e("../util/math")
  17787. , l = e("../util/ajax")
  17788. , c = e("./RoomCollection")
  17789. , h = e("../util/common")
  17790. , u = e("../util/IndexedCollection");
  17791. new a(i);
  17792. h.inherit(n, u),
  17793. n.prototype.getIndex = function(e) {
  17794. return e.labelId
  17795. }
  17796. ,
  17797. n.prototype.associateWithRooms = function(e) {
  17798. this.forEach(function(t) {
  17799. e.forEach(function(e) {
  17800. e.roomId === t.roomId && (t.room = e)
  17801. })
  17802. })
  17803. }
  17804. ,
  17805. n.prototype.createFromLabelData = function(e) {
  17806. e.forEach(function(e) {
  17807. var t = n.parseRoomIndexFromWorkshopRoomId(e.roomId);
  17808. t = c.generateRoomId(e.floorId, t);
  17809. var i = new r(e.sid,e.position || e.positions[0],e.text,e.floorId,t);
  17810. i.position = s.convertWorkshopVector(i.position),
  17811. this.add(i),
  17812. i.build()
  17813. }
  17814. .bind(this))
  17815. }
  17816. ,
  17817. n.prototype.load = function(e, t) {
  17818. return l.get(e, {
  17819. responseType: "json",
  17820. auth: t ? o.authorizationHeader : null
  17821. }).done(function(e) {
  17822. var t = [];
  17823. for (var i in e) {
  17824. var n = e[i];
  17825. t.push(n)
  17826. }
  17827. this.createFromLabelData(t)
  17828. }
  17829. .bind(this))
  17830. }
  17831. ,
  17832. n.parseRoomIndexFromWorkshopRoomId = function(e) {
  17833. var t = -1;
  17834. if (e) {
  17835. if(typeof e == 'number'){
  17836. t = parseInt(e)
  17837. }else{
  17838. var i = e.split("_");
  17839. t = parseInt(i[0])
  17840. }
  17841. }
  17842. return t
  17843. }
  17844. ,
  17845. t.exports = n
  17846. }
  17847. ).call(this, "/js/model/LabelCollection.js")
  17848. }
  17849. , {
  17850. "../label/Label": 90,
  17851. "../settings": 166,
  17852. "../util/IndexedCollection": 175,
  17853. "../util/ajax": 181,
  17854. "../util/common": 185,
  17855. "../util/logger": 189,
  17856. "../util/math": 190,
  17857. "./RoomCollection": 141
  17858. }],
  17859. 139: [function(e, t, i) {
  17860. (function(i) {
  17861. "use strict";
  17862. function n(e, t) {
  17863. o.Object3D.call(this)
  17864. this.sid = window.number;//t.sid,
  17865. this.data = t,
  17866. this.options = e,
  17867. this.urls = new s(e.urlFiles),
  17868. this.isPublic = void 0 !== t.is_public && t.is_public,
  17869. //创建heroLocations
  17870. this.images = new _(this),
  17871. this.images.extend(t.images),
  17872. this.images.forEach((info)=>{
  17873. if(info.locations){
  17874. info.images = new _(this);
  17875. info.images.extend(info.locations)
  17876. }
  17877. })
  17878. this.heroLocations = []
  17879. //this.heroImage = this.images.getImage(t.icon), //初始画面沒有用到icon
  17880. this.outdoorPanoLocations = [],
  17881. this.floors = new d(this),
  17882. this.floorsEnabled = void 0 === e.floors || e.floors,
  17883. this.changingFloor = !1,
  17884. this.chunks = [],
  17885. this.panos = new A,
  17886. this.colliders = [],
  17887. this.loadPanosPromise = null,
  17888. this.loadMeshTexturesPromise = null,
  17889. this.auxDataPromise = null,
  17890. this.meshTexturesLoaded = !1,
  17891. this.meshTextures = [],
  17892. this.tags = {},
  17893. this.tagsShown = !1,
  17894. this.shouldShowtags = !1,
  17895. this.has360Views = !1,
  17896. this.showingLabels = f.labels.enabled && t.player_options.labels,
  17897. this.supportedModes = {},
  17898. this.supportedModes[c.PANORAMA] = !0,
  17899. this.supportedModes[c.DOLLHOUSE] = !t.player_options || t.player_options.dollhouse && w.valueFromHash("dh", 1),
  17900. this.supportedModes[c.FLOORPLAN] = !t.player_options || t.player_options.floor_plan && w.valueFromHash("dh", 1),
  17901. this.supportedModes[c.TRANSITIONING] = !0,
  17902. this.supportsTiles = this.configureTiling(),
  17903. // this.supportsVR = t.is_vr,
  17904. this.supportsVR = window.MP_PREFETCHED_MODELDATA.supportsVR || false//true; // 方奕卓 VR功能可配置
  17905. this.mode = c.DOLLHOUSE,
  17906. this.size = null,
  17907. this.center = null,
  17908. this.boundingBox = new o.Box3,
  17909. this.currentFloor = null,
  17910. this.allFloorsVisible = !0,
  17911. this.projectedPano0 = null,
  17912. this.projectedPano1 = null,
  17913. this.floorsEnabled && t.floors && t.floors.indexOf(",") !== -1 && t.floors.split(",").forEach(function(e, t) {
  17914. this.addFloor(new u(this,t,e.trim()))
  17915. }
  17916. .bind(this)),
  17917. this.waitQueue = [],
  17918. this.on("load", function(e) {
  17919. 0 !== this.waitQueue.length && (this.waitQueue = this.waitQueue.filter(function(e) {
  17920. return !e.isLoadedCallback()
  17921. }),
  17922. 0 === this.waitQueue.length && this.emit("waiting-done"))
  17923. }
  17924. .bind(this)),
  17925. this.setupCustomProperties()
  17926. this.hots = {};
  17927. }
  17928. function r() {
  17929. try {
  17930. var e = document.createElement("canvas")
  17931. , t = e.getContext("webgl");
  17932. t || (t = e.getContext("experimental-webgl"));
  17933. var i = t.getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE);
  17934. return i
  17935. } catch (e) {
  17936. return 0
  17937. }
  17938. }
  17939. var o = e("three")
  17940. , a = e("../util/ajax")
  17941. , s = e("../util/ModelUrls")
  17942. , l = e("../objects/BoundingTextureSkybox")
  17943. , c = e("../enum/Viewmode")
  17944. , h = e("../enum/RenderOrder")
  17945. , u = (e("../enum/AlignmentType"),
  17946. e("../objects/Floor"))
  17947. , d = e("./FloorCollection")
  17948. , p = e("../objects/Chunk")
  17949. , f = (e("../objects/Room"),
  17950. e("../objects/Snapshot"),
  17951. e("../label/Label"),
  17952. e("../util/math"),
  17953. e("../settings"))
  17954. ,ss = e("../shaders")
  17955. , g = e("../util/logger")
  17956. , m = e("../tag/tag")
  17957. , v = (e("../tag/tagManager"),
  17958. e("../objects/Panorama"))
  17959. , A = e("../util/PanoramaCollection")
  17960. , y = e("../loaders/ModelLoader")
  17961. , C = e("../loaders/ModelTextureLoader")
  17962. , I = e("../loaders/SweepDataLoader")
  17963. , E = e("../util/transitions")
  17964. , b = e("../util/common")
  17965. , es = e("../util/easing")
  17966. ,lerp = e("../util/lerp")
  17967. ,tex = e("../util/texture")
  17968. , w = e("./../util/browser")
  17969. , _ = e("./ImageCollection")
  17970. , T = e("./RoomCollection")
  17971. , x = e("./LabelCollection")
  17972. , S = e("./Chunks")
  17973. , M = e("./../util/showcase")
  17974. , R = e("../exception/BasicException")
  17975. , P = (e("../constants")
  17976. ,e("events").EventEmitter)
  17977. ,Hot = e("hot")
  17978. , O = new g(i);
  17979. n.prototype = Object.create(o.Object3D.prototype),
  17980. b.extend(n, P),
  17981. n.prototype.setupCustomProperties = function() {
  17982. var e = f.modelAlpha;
  17983. Object.defineProperty(this, "alpha", {
  17984. get: function() {
  17985. return e
  17986. },
  17987. set: function(t) {
  17988. e = t,
  17989. this.chunks.forEach(function(t) {
  17990. t.material && t.material.uniforms.modelAlpha && (t.material.uniforms.modelAlpha.value = e)
  17991. })
  17992. }
  17993. })
  17994. }
  17995. ,
  17996. n.prototype.configureTiling = function() {
  17997. var e = r();
  17998. if (e < 2048)
  17999. return !1;
  18000. O.warn("Max cube texture size: " + e);
  18001. for (var t = 0; t < f.tiling.tilingFlagNames.length; t++) {
  18002. var i = f.tiling.tilingFlagNames[t];
  18003. if ("1" === w.valueFromHash(i, null))
  18004. return !0;
  18005. if ("0" === w.valueFromHash(i, null))
  18006. return !1
  18007. }
  18008. //--------------------------------------------许钟文-------------------------------------------
  18009. //return true;
  18010. return !!M.modelDataPromisesTiles(this.data) //免去访问mdoeldata.json的vision_version,不明白这是什么
  18011. //--------------------------------------------e n d -------------------------------------------
  18012. }
  18013. ,
  18014. n.prototype.toggleAlpha = function() {
  18015. this.alpha < 1 ? this.alpha = 1 : this.alpha = 0
  18016. }
  18017. ,
  18018. n.prototype.load = function(e) {
  18019. var t = function() {
  18020. return $.when(this.loadPanos(), this.loadMesh())
  18021. }
  18022. , i = this.urls.init().then(t.bind(this));
  18023. return e ? i = i.then(this.loadMeshTextures.bind(this)) : i.then(this.loadMeshTextures.bind(this)),
  18024. this.auxDataPromise = $.when( /*this.loadHighlightReel(), this.loadtags() */this.loadhots(), this.loadLabels()),
  18025. $.when(i, this.auxDataPromise).done(this.build.bind(this)) //不要另外使用active_reel文件
  18026. }
  18027. ,
  18028. n.prototype.loadMesh = function() {
  18029. function e(e) {
  18030. O.error(e),
  18031. n.reject("loading-failed")
  18032. }
  18033. function t(e, t) {
  18034. n.notify(e, t)
  18035. }
  18036. function i(e, t) {
  18037. if (0 === e.length) {
  18038. O.warn("No geometry found for model, loading faux geometry, disabling outside mode"),
  18039. r.supportedModes[c.DOLLHOUSE] = !1,
  18040. r.supportedModes[c.FLOORPLAN] = !1;
  18041. var i = new p({
  18042. geometry: new o.PlaneBufferGeometry(5,5,1,1)
  18043. });
  18044. i.material.visible = !1,
  18045. i.rotateX(-Math.PI / 2),
  18046. i.geometry.computeBoundingBox(),
  18047. e = [i]
  18048. }
  18049. e.forEach(function(e) {
  18050. var t = r.floorsEnabled ? S.parseFloor(e.name) : 0;
  18051. r.addChunk(t, e)
  18052. }),
  18053. r.floors.sort(),
  18054. n.resolve(r)
  18055. }
  18056. var n = $.Deferred()
  18057. , r = this;
  18058. return y.load(r.data.job.uuid, r.urls, i, t, e),
  18059. n.promise()
  18060. }
  18061. ,
  18062. n.prototype.loadMeshTextures = function() {
  18063. return this.loadTexturesPromise ? this.loadTexturesPromise : (this.loadTexturesPromise = C.load(this, this.meshTextures).then(function() {
  18064. this.meshTexturesLoaded = !0
  18065. }
  18066. .bind(this)),
  18067. this.loadTexturesPromise)
  18068. }
  18069. ,
  18070. /* n.prototype.loadtags = function() {//xzw改
  18071. var e = $.Deferred();
  18072. if (!f.tags.enabled)
  18073. return e.resolve();
  18074. //var t = this.options.urlBase + "/api/v1/jsonstore/model/tags/" + this.sid;
  18075. t = "data/" + this.sid + "/tags.json"
  18076. return a.get(t, {
  18077. responseType: "json",
  18078. auth: this.isPublic ? null : f.authorizationHeader
  18079. }).done(function(t) {
  18080. var i = 0
  18081. , n = 0;
  18082. for (var r in t) {
  18083. var o = t[r];
  18084. o.enabled && (n++,
  18085. (o.label.length || o.description.length) && (this.tags[r] = new m(this,r,o),
  18086. i++))
  18087. }
  18088. i !== n && O.warn("Disallowed " + (n - i) + " tags with no text data"),
  18089. e.resolve()
  18090. }
  18091. .bind(this)).fail(function() {
  18092. O.warn("Getting tags failed, not displaying tags."),
  18093. e.resolve()
  18094. }),
  18095. e
  18096. } */
  18097. n.prototype.shineHots = function(){ //xzw
  18098. E.trigger({
  18099. func: function(e) {
  18100. var opa = e <= .5 ? 2 * e : -2 * e + 2
  18101. for(var i in this.hots){
  18102. this.hots[i].mesh.material.uniforms.opac.value = opa;
  18103. }
  18104. }.bind(this),
  18105. cycling: true,
  18106. duration: 3000,
  18107. //easing: "easeInOutQuad",
  18108. name: "hotShine"
  18109. })
  18110. },
  18111. n.prototype.createHotItem = function(data, hots) {
  18112. var docFragment = document.createDocumentFragment();
  18113. var keyAry = Object.keys(data);
  18114. for(var i = 0; i < keyAry.length; i++){
  18115. var li = document.createElement('li');
  18116. var span = document.createElement('span');
  18117. span.innerHTML = data[keyAry[i]].title || data[keyAry[i]].infoAttribute.title || '热点';
  18118. // console.log(span.innerHTML);
  18119. li.hot = hots[keyAry[i]]; // 列表每一项对应一个热点
  18120. li.appendChild(span);
  18121. docFragment.appendChild(li);
  18122. }
  18123. var ul = document.querySelector('#hotListContent ul');
  18124. ul.appendChild(docFragment);
  18125. console.log(docFragment);
  18126. }
  18127. n.prototype.loadOverlays = function(overlays){
  18128. var overlays = window.data2 && window.data2.overlays
  18129. overlays && overlays.forEach((info)=>{
  18130. //if(info.file.includes('20210312_112357584.mp4') /* || info.animateInfo */ )return;
  18131. new Overlay(info)
  18132. })
  18133. setTimeout(Overlay.load, 300)
  18134. }
  18135. n.prototype.loadhots = function() {//xzw
  18136. var e = $.Deferred();
  18137. var t = g_Prefix+"data/" + this.sid + "/data2.js" +'?'+ randomTime().getTime();
  18138. return a.get(t, {
  18139. responseType: "json",
  18140. auth: this.isPublic ? null : f.authorizationHeader
  18141. }).done(function(t) {
  18142. window.data2 = t;
  18143. if(!t){
  18144. console.error("data2 is null")
  18145. }else{
  18146. g_data2 = hotMatcher(t);
  18147. this.hotsCount = 0;
  18148. /* for(var i in t.hots){
  18149. this.hotsCount ++;
  18150. this.hots[i] = new Hot(i, t.hots[i], this);
  18151. t.hots[i].infoAttribute || (t.hots[i].infoAttribute = {})
  18152. this.hots[i].initStyleImg(t.hots[i].infoAttribute);
  18153. };
  18154. window.hotData = t.hots
  18155. t.hots && this.createHotItem(t.hots, this.hots); */
  18156. //因为热点保存后在hots里的顺序会被修改,所以使用order来记录顺序,这里要重排序:
  18157. window.hotData = {}
  18158. if(t.hots){
  18159. var sids = Object.keys(t.hots).sort((a,b)=>{return t.hots[a].order - t.hots[b].order});
  18160. sids.forEach((sid)=>{
  18161. this.hotsCount++,
  18162. this.hots[sid] = new Hot(sid,t.hots[sid] ,this);
  18163. t.hots[sid].infoAttribute || (t.hots[sid].infoAttribute = {})
  18164. this.hots[sid].initStyleImg(t.hots[sid].infoAttribute);
  18165. window.hotData[sid] = t.hots[sid];
  18166. })
  18167. }
  18168. this.createHotItem(window.hotData, this.hots);
  18169. g_index = w.valueFromHash("m");
  18170. /* if(t.tourAudio){
  18171. g_tourAudio = new Audio;
  18172. g_tourAudio.loop = false;
  18173. g_tourAudio.addEventListener('ended', function () {
  18174. var ev = document.createEvent("MouseEvent");
  18175. ev.initEvent("tourAudioEnded",true,true);
  18176. window.dispatchEvent(ev);
  18177. });
  18178. }; */
  18179. }
  18180. /***************************方奕卓 请求data.js数据, 用于初始化热点列表 ****************************/
  18181. /* var dataJsPromise = $.Deferred();
  18182. var dataJsUrl = g_Prefix+"data/" + this.sid + "/hot/js/data.js" +'?'+ randomTime().getTime();
  18183. a.get(dataJsUrl,{
  18184. responseType: "json",
  18185. auth: this.isPublic ? null : f.authorizationHeader
  18186. }).done(function(data) {
  18187. window.hotData = data;
  18188. this.createHotItem(data, this.hots);
  18189. for(let i in this.hots){//add
  18190. data[i] && this.hots[i].initStyleImg(data[i]);
  18191. }
  18192. dataJsPromise.resolve();
  18193. }.bind(this)).fail(function(){
  18194. console.log('Data.js is empty');
  18195. dataJsPromise.resolve();
  18196. }) */
  18197. e.resolve();
  18198. }.bind(this)).fail(function() {
  18199. console.log('没有热点');
  18200. e.resolve()
  18201. }),
  18202. e
  18203. }
  18204. ,
  18205. n.prototype.loadPanos = function() {
  18206. if (this.loadPanosPromise)
  18207. return this.loadPanosPromise;
  18208. var e = new I(this);
  18209. return this.loadPanosPromise = e.load().then(function(e) {
  18210. return this.data.sweeps && Object.keys(this.data.sweeps).length > 0 && (e = e.filter(function(e) {
  18211. if(this.data.sweeps[e.uuid])return this.data.sweeps[e.uuid].enabled
  18212. else console.log(e.uuid)
  18213. }
  18214. .bind(this))),
  18215. this.panos.extend(e.map(function(e) {
  18216. return new v(this,e.uuid,e,this.supportsTiles)
  18217. }
  18218. .bind(this))),
  18219. this.panos.forEach(function(e) {
  18220. e.neighbourUUIDs && (e.neighbourUUIDs.forEach(function(t) {
  18221. var i = this.panos.get(t);
  18222. i && this.panos.setNeighbour(e, i, !0)
  18223. }
  18224. .bind(this)),
  18225. e.neighbourPanos = this.panos.getNeighbours(e) || this.panos.setNeighbour(e, e, !0))
  18226. }
  18227. .bind(this)),
  18228. 0 === this.panos.length && (O.warn("Model has no panos, turning off inside mode"),
  18229. this.supportedModes[c.PANORAMA] = !1),
  18230. $.when(this)
  18231. }
  18232. .bind(this)),
  18233. this.loadPanosPromise
  18234. }
  18235. ,
  18236. n.prototype.loadHighlightReel = function() {//xzw
  18237. var e = $.Deferred()
  18238. // , t = this.options.urlBase + "/api/v1/jsonstore/model/highlights/" + this.sid + "/active_reel";
  18239. ,t = this.options.urlBase + "data/" + this.sid + "/active_reel.json";
  18240. return a.get(t, {
  18241. responseType: "json",
  18242. auth: this.isPublic ? null : f.authorizationHeader
  18243. }).done(function(t) {
  18244. t.reel ? (O.info("Got highlight reel with " + t.reel.length + " items"),
  18245. this.images.filterByModesAndReel(this.supportedModes, t.reel)) : O.info("No highlight reel found"),
  18246. e.resolve()
  18247. }
  18248. .bind(this)).fail(function() {
  18249. O.warn("Getting highlight reel failed, no highlights available"),
  18250. e.resolve()
  18251. }),
  18252. e
  18253. }
  18254. ,
  18255. n.prototype.waitForLoad = function(e, t) {
  18256. t() || (this.waitQueue.push({
  18257. object: e,
  18258. isLoadedCallback: t
  18259. }),
  18260. 1 === this.waitQueue.length && this.emit("waiting"))
  18261. }
  18262. ,
  18263. n.prototype.hide = function() {
  18264. this.floors.hide()
  18265. }
  18266. ,
  18267. n.prototype.show = function() {
  18268. this.floors.show()
  18269. }
  18270. ,
  18271. n.prototype.floorNames = function() {
  18272. return this.floors.names()
  18273. }
  18274. ,
  18275. n.prototype.warpDestFloors = function(e, t) {
  18276. if (!e || this.floors.length !== e.length)
  18277. return void this.toggleAllFloors(!0);
  18278. var i = e.findIndex(function(e) {
  18279. return e
  18280. }
  18281. .bind(this));
  18282. i !== -1 && this.setFloor(this.floors.list[i], null, t)
  18283. }
  18284. ,
  18285. n.prototype.setFloor = function(e, t, i) {
  18286. this.allFloorsVisible && this.emit("allfloors.toggled", !1, this.currentFloor),
  18287. this.allFloorsVisible = !1,
  18288. this._setFloor(e, t, i)
  18289. }
  18290. ,
  18291. n.prototype.toggleAllFloors = function(e) {
  18292. this.allFloorsVisible = void 0 !== e ? e : !this.allFloorsVisible,
  18293. this.emit("allfloors.toggled", this.allFloorsVisible, this.currentFloor),
  18294. this._setFloor(this.currentFloor)
  18295. }
  18296. ,
  18297. n.prototype._setFloor = function(e, t, i) {
  18298. t = t || this.mode,
  18299. this.emit("floor.changed", e, t, this.currentFloor),
  18300. this.currentFloor = e;
  18301. var n;
  18302. if (t === c.PANORAMA) {
  18303. if (this.show(),
  18304. this.shouldShowtags && this.tagsShown)
  18305. for (n in this.tags)
  18306. this.tags[n].show(f.showFloorDuration)
  18307. } else if ((t === c.FLOORPLAN || t === c.DOLLHOUSE) && (this.floors.list.forEach(function(e, t) {
  18308. e.toggle(e === this.currentFloor || this.allFloorsVisible, i || this.allFloorsVisible)
  18309. }
  18310. .bind(this)),
  18311. this.shouldShowtags && this.tagsShown))
  18312. for (n in this.tags) {
  18313. var r = this.tags[n];
  18314. this.allFloorsVisible ? r.show(f.showFloorDuration) : r.floor === this.currentFloor ? r.show(f.showFloorDuration, f.showFloorDelay) : r.hide(f.hideFloorDuration, f.hideFloorDelay)
  18315. }
  18316. var o = this
  18317. , a = e;
  18318. E.start(function() {}, f.showFloorDelay, function() {
  18319. o.floors.forEach(function(e) {
  18320. e.chunks.forEach(function(t) {
  18321. t.renderOrder = e === a ? h.visibleFloor : h.ghostFloor
  18322. })
  18323. })
  18324. }
  18325. .bind(this))
  18326. }
  18327. ,
  18328. n.prototype.toggleExplode = function() {
  18329. this.floors.toggleExplodeHorizontal()
  18330. }
  18331. ,
  18332. n.prototype.toggleExplodeUp = function() {
  18333. this.floors.toggleExplodeVertical()
  18334. }
  18335. ,
  18336. n.prototype.nextFloor = function(e) {
  18337. return this.floors.nextFloor(this.currentFloor, e)
  18338. }
  18339. ,
  18340. n.prototype.addFloor = function(e) {
  18341. this.floors.add(e)
  18342. }
  18343. ,
  18344. n.prototype.getFloorAtPoint = function(e) {
  18345. return this.floors.getFloorAtPoint(e)
  18346. }
  18347. ,
  18348. n.prototype.getTagBySid = function(e) {
  18349. return this.tags[e]
  18350. }
  18351. ,
  18352. n.prototype.addChunk = function(e, t) {
  18353. this.floors.getOrMakeFloor(e).addChunk(t),
  18354. this.chunks.push(t)
  18355. }
  18356. ,
  18357. n.prototype.setMode = function(e) {
  18358. if (!this.supportedModes[e])
  18359. throw new R("Mode not supported for this model: " + e);
  18360. this.mode = e;
  18361. this.skybox.material.transparent = e == "panorama" ? false : true //xzw add // 如果skybox透明,会让其中其他mesh 如热点的透明出问题
  18362. this.chunks.forEach(function(t) {
  18363. t.setMode(e)
  18364. })
  18365. }
  18366. ,
  18367. n.prototype.build = function() {
  18368. this.heroLocations = this.images.getHeroLocations(this.panos);
  18369. var e = function() {
  18370. 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()
  18371. }
  18372. .bind(this)();
  18373. this.has360Views = f.show360Views.enabled && this.heroLocations.some(function(e) {
  18374. return e.cameraMode === c.PANORAMA && this.panos.get(e.panoId) && !this.panos.get(e.panoId).isAligned()
  18375. }
  18376. .bind(this)) || e,
  18377. null === this.heroImage && O.warn("No hero image defined."),
  18378. this.currentFloor = this.floors.last(),
  18379. this.floors.build(),
  18380. this.colliders = this.floors.reduce(function(e, t) {
  18381. return e.concat(t.collider.children)
  18382. }, []),
  18383. this.panos.forEach(function(e) {
  18384. e.build1(),
  18385. e.on("enter", function() {
  18386. e.floor !== this.currentFloor && this.setFloor(e.floor)
  18387. }
  18388. .bind(this))
  18389. }
  18390. .bind(this)),
  18391. this.panos.forEach(function(e) {
  18392. e.build2()
  18393. }),
  18394. this.floors.forEach(function(e) {
  18395. this.boundingBox.union(e.boundingBox)
  18396. }
  18397. .bind(this)),
  18398. this.size = this.boundingBox.size(),
  18399. this.center = this.boundingBox.center(),
  18400. this.floors.forEach(function(e) {
  18401. O.info("Floor " + e + ": " + e.children.length + " chunks, " + e.panos.length + " panos.")
  18402. }
  18403. .bind(this)),
  18404. this.panos.populate_path_graph(),
  18405. this.skybox = new l(this.boundingBox),
  18406. this.skybox.matrixWorldNeedsUpdate = !0,
  18407. this.add(this.skybox);
  18408. setTimeout(function(){
  18409. this.hotsCount && this.shineHots();
  18410. }.bind(this),1300);//xzw 热点开始闪烁
  18411. for (var t in this.tags)
  18412. this.tags[t].build();
  18413. //add-----
  18414. for(let i in this.hots){
  18415. this.hots[i].setVisiblePanos(this.hots[i].visibleData);
  18416. }
  18417. //---------
  18418. this.createFloorLogo()
  18419. return O.debug("Done building model"),
  18420. v.raycastsDone > 0 && (O.warn("raycasts: " + v.raycastsDone),
  18421. O.warn("raycasts skipped: " + v.raycastsSkipped)),
  18422. this.buildRooms(),
  18423. this.labels.associateWithRooms(this.rooms),
  18424. $.when(this)
  18425. }
  18426. ,
  18427. n.prototype.createFloorLogo = function(){
  18428. console.log('createFloorLogo')
  18429. if(this.floorLogos || !settings.floorlogoURL)return;
  18430. var url = settings.floorlogoURL
  18431. var map = tex.load(url);//可以追加done
  18432. this.floorLogos = [];
  18433. for(var i=0; i<2; i++){ //不可共用uniforms等 [0]在上一个位置,[1]是下一个位置、 是飞入及飞出后的位置
  18434. var material = new o.MeshBasicMaterial({
  18435. opacity:0,
  18436. map:map,
  18437. side: o.DoubleSide,
  18438. transparent: !0,
  18439. depthWrite: !1,
  18440. depthTest:false//改 在chunk\skybox外也可看到
  18441. });
  18442. var logo = new o.Mesh(new o.PlaneGeometry(2,2,1,1),material);
  18443. //var s = (Store.metadata.floorLogoSize || 100)/100;
  18444. //logo.scale.set(s,s,s);
  18445. logo.position.set(0,-1.5,0);
  18446. logo.lookAt(logo.position.clone().add(new o.Vector3(0,1,0)));
  18447. logo.renderOrder = 100;//cover the videoSkybox
  18448. //logo.layers.set(0)
  18449. this.add(logo);
  18450. this.floorLogos.push(logo);
  18451. }
  18452. this.floorLogos[1].visible = false;
  18453. }
  18454. n.prototype.adjustfloorLogoHeight = function(o){
  18455. var h = player.currentPano.floorPosition.y + 0.01;
  18456. this.floorLogos[1].position.setY(h);
  18457. this.floorLogos[0].position.setY(h);
  18458. //publicObjectSet.player.path.currentPanoMarker.mesh.position.y = h
  18459. },
  18460. n.prototype.changefloorLogoOpa = function(o){//改 i, opacity, time, delay
  18461. if(!this.floorLogos) return;
  18462. E.cancelById("flOpa_"+o.index);//先停止之前该logo的透明度变化
  18463. if(o.from!=void 0)this.floorLogos[o.index].material.opacity = o.from;//初始透明度
  18464. if(!o.dur){//立刻
  18465. //this.floorLogos[o.index].material.uniforms.opacity.value = o.opa;
  18466. this.floorLogos[o.index].material.opacity = o.opa;
  18467. }else{
  18468. //E.start(lerp.uniform(this.floorLogos[o.index], "opacity", o.opa), o.dur || 0, null,
  18469. E.start(lerp.property(this.floorLogos[o.index].material, "opacity", o.opa), o.dur || 0, null,
  18470. o.delay||0, es["easeInQuad"], "changefloorLogoOpa", "flOpa_"+o.index)
  18471. }
  18472. },
  18473. n.prototype.updateFloorlogo = function() { //xzw add 更新地标的旋转
  18474. var lastQ, lastP;
  18475. var equals = function(v1, v2, min){
  18476. return Math.abs(v1-v2) < min
  18477. }
  18478. var isSame = function(now, last, k){//如果和上次相同就不改变
  18479. if(!last)return false;
  18480. var R = k.sceneRenderer;
  18481. //var min = R.AFPS < 38 ? 0.005 : R.AFPS < 45 ? 0.0008 : R.AFPS < 50 ? 0.0006 : 0.0003;
  18482. //暂时:
  18483. var min = 0.0008
  18484. var same = equals(now.x , last.x, min) && equals(now.y , last.y, min) && equals(now.z , last.z, min)
  18485. && (now.w!=void 0 ? equals(now.w , last.w, min) : true)
  18486. return same;
  18487. }
  18488. return function(Q, k){
  18489. if(!Q)return;
  18490. /* if(Config.ifFish && window.lowFPS){
  18491. this.fLCompute++;
  18492. if(R.AFPS < 38){
  18493. if(k.flyingToTag && k.flying && k.fLCompute %4 !=1) return; //点击tag过渡
  18494. else if(k.flying && k.fLCompute%2 !=1) return;
  18495. k.fLCompute %= 4;
  18496. }else if(R.AFPS < 45){
  18497. if(k.flyingToTag && k.flying && k.fLCompute %3 !=1) return; //点击tag过渡
  18498. else if(k.flying && k.fLCompute%2 !=1) return;
  18499. k.fLCompute %= 6;
  18500. }else{
  18501. if(k.flyingToTag && k.flying && k.fLCompute %2 !=1) return;
  18502. //else if(k.flying && k.fLCompute%2 !=1) return;
  18503. k.fLCompute %= 2;
  18504. }
  18505. } */
  18506. var sameQ, sameP, quaternion, visible;
  18507. for(var i=0;i<2;i++){
  18508. var logo = this.floorLogos[i];
  18509. if(!logo.visible || logo.material.uniforms.opacity.value==0) continue;
  18510. visible = true;
  18511. }
  18512. if(!visible)return; //如果两个都不可见,就不更改,如果有一个可见,就都改
  18513. var c = k.cameraControls.activeControl;
  18514. var sameQ = c ? ( c.lat < 10 ? equals(c.lon, lastQ, 0.1) : equals(c.lon, lastQ, 1) ): false;
  18515. sameQ || (lastQ = c ? c.lon : null); //相机旋转是否改变了
  18516. for(var i=0;i<2;i++){
  18517. var logo = this.floorLogos[i];
  18518. if(!sameQ){
  18519. if(!quaternion){
  18520. var a = new THREE.Vector3(0,0,-1);
  18521. a.applyQuaternion(Q);
  18522. a.setY(0);
  18523. var _ = (new THREE.Matrix4).lookAt(a,new THREE.Vector3, new THREE.Vector3(0,1,0));
  18524. quaternion = (new THREE.Quaternion).setFromRotationMatrix(_)
  18525. var a = new THREE.Quaternion( 0, 0.7071067811865476, 0.7071067811865476 , 0)//计算得
  18526. quaternion.multiply(a);
  18527. }
  18528. logo.quaternion.copy(quaternion);
  18529. }
  18530. }
  18531. }
  18532. }()
  18533. n.prototype.loadLabels = function() {//xzw
  18534. this.labels = new x(this);
  18535. var e = $.Deferred();
  18536. //加载俯视图的标签 注释这个备注就会加载
  18537. //原先是labels, 改为showLabels,因为之前的somedata写的labels都是true
  18538. //window.MP_PREFETCHED_MODELDATA.showingLabels ? this.showingLabels = true : '';
  18539. /* if (!this.showingLabels)
  18540. return e.resolve(); */
  18541. // var t = this.options.urlBase + "/api/v1/jsonstore/model/labels/" + this.sid;
  18542. var t = g_Prefix + "data/" + this.sid + "/labels.json";
  18543. return this.labels.load(t, !this.isPublic).done(e.resolve.bind(e)).fail(function() {
  18544. O.warn("Getting labels failed, not displaying labels."),
  18545. e.resolve()
  18546. }),
  18547. e
  18548. }
  18549. ,
  18550. n.prototype.buildRooms = function() {
  18551. this.rooms = new T(this),
  18552. this.rooms.createFromChunks(this.chunks),
  18553. this.rooms.calcRoomBoundaries()
  18554. }
  18555. ,
  18556. n.prototype.updateProjectedPanos = function() {
  18557. this.projectedPano0 && this.projectedPano1 && this.setProjectedPanos(this.projectedPano0, this.projectedPano1, !1)
  18558. }
  18559. ,
  18560. n.prototype.setProjectedPanos = function(e, t, i) {
  18561. void 0 !== i && null !== i || (i = !0),
  18562. i = !!i,
  18563. this.projectedPano0 = e,
  18564. this.projectedPano1 = t,
  18565. this.skybox.material.setProjectedPanos(e, t, i),
  18566. this.chunks.forEach(function(n) {
  18567. n.materialInside.setProjectedPanos(e, t, i)
  18568. })
  18569. }
  18570. ,
  18571. n.prototype.setSide = function(e) {
  18572. this.floors.forEach(function(t) {
  18573. t.collider.material.side = e
  18574. })
  18575. }
  18576. ,
  18577. n.prototype.heroCount = function() {
  18578. return this.heroLocations ? this.heroLocations.length : 0
  18579. }
  18580. ,
  18581. n.prototype.getHeroDescriptorByIndex = function(e=[]) {//改 因增加了二级目录
  18582. if (e[0] < 0)
  18583. return O.warn("Model.getHeroDescriptorByHeroIndex() -> heroIndex is less than 0."),
  18584. null;
  18585. if (this.heroCount() < 1)
  18586. return O.warn("Model.getHeroDescriptorByIndex() -> No hero locations in this model"),
  18587. null;
  18588. var t = this.heroLocations[e[0]];
  18589. if(t.heroLocations && e[1]!=void 0){
  18590. t = t.heroLocations[e[1]];
  18591. }
  18592. return void 0 === t ? (O.warn("Model.getHeroDescriptorByIndex() -> Index " + e + " is not a validindex"),
  18593. null) : t
  18594. }
  18595. ,
  18596. n.prototype.findPanoramicHero = function() {
  18597. for (var e in this.heroLocations)
  18598. if (this.heroLocations[e].cameraMode === c.PANORAMA)
  18599. return this.heroLocations[e];
  18600. return null
  18601. }
  18602. ,
  18603. n.prototype.listImagePanos = function() {
  18604. var e = []
  18605. , t = this;
  18606. return this.images.forEach(function(i) {
  18607. if (i.metadata && i.metadata.scan_id) {
  18608. var n = t.panos.get(i.metadata.scan_id);
  18609. n && (t.supportsTiles || n.isLoaded("high") || e.push(n))
  18610. }
  18611. }),
  18612. e
  18613. }
  18614. ,
  18615. n.prototype.fadePanoMarkers = function(e, t) {
  18616. this.panos.fadeMarkerOpacity(e, t)
  18617. }
  18618. ,
  18619. n.prototype.setSweepVisibility = function(e) {
  18620. this.panos.forEach(function(t) {
  18621. t.marker && (t.marker.visible = e)
  18622. })
  18623. }
  18624. ,
  18625. n.prototype.outsideAllowed = function() {
  18626. return this.supportedModes[c.DOLLHOUSE] && this.supportedModes[c.FLOORPLAN]
  18627. }
  18628. ,
  18629. t.exports = n
  18630. }
  18631. ).call(this, "/js/model/Model.js")
  18632. }
  18633. , {
  18634. "../constants": 8,
  18635. "../enum/AlignmentType": 17,
  18636. "../enum/RenderOrder": 42,
  18637. "../enum/Viewmode": 51,
  18638. "../exception/BasicException": 55,
  18639. "../label/Label": 90,
  18640. "../loaders/ModelLoader": 105,
  18641. "../loaders/ModelTextureLoader": 106,
  18642. "../loaders/SweepDataLoader": 107,
  18643. "../tag/tag": 123,
  18644. "../tag/tagManager": 124,
  18645. "../objects/BoundingTextureSkybox": 143,
  18646. "../objects/Chunk": 144,
  18647. "../objects/Floor": 146,
  18648. "../objects/Panorama": 148,
  18649. "../objects/Room": 150,
  18650. "../objects/Snapshot": 153,
  18651. "../settings": 166,
  18652. "../shaders": 167,
  18653. "../util/ModelUrls": 177,
  18654. "../util/PanoramaCollection": 178,
  18655. "../util/ajax": 181,
  18656. "../util/common": 185,
  18657. "../util/easing": 186,
  18658. "../util/lerp": 188,
  18659. "../util/logger": 189,
  18660. "../util/math": 190,
  18661. "../util/texture": 194,
  18662. "../util/transitions": 195,
  18663. "./../util/browser": 182,
  18664. "./../util/showcase": 193,
  18665. "./Chunks": 135,
  18666. "./FloorCollection": 136,
  18667. "./ImageCollection": 137,
  18668. "./LabelCollection": 138,
  18669. "./RoomCollection": 141,
  18670. events: 202,
  18671. three: 217,
  18672. "hot": "hot"
  18673. }],
  18674. 140: [function(e, t, i) {
  18675. "use strict";
  18676. function n() {
  18677. this.modelMap = {},
  18678. this.activeModel = null,
  18679. this.modelCount = 0,
  18680. this.tileDownloader = null,
  18681. this.panoRenderer = null
  18682. }
  18683. var r = (e("three"),
  18684. e("../util/common"))
  18685. , o = e("../exception/BasicException")
  18686. , a = e("../enum/ModelManagerEvents")
  18687. , s = e("../enum/PanoRendererEvents")
  18688. , l = e("events").EventEmitter;
  18689. n.prototype.init = function(e, t, i) {
  18690. this.tileDownloader = e,
  18691. this.panoRenderer = t,
  18692. this.qualityManager = i,
  18693. this.bindEvents()
  18694. }
  18695. ,
  18696. n.prototype.bindEvents = function() {
  18697. this.panoRenderer.on(s.TileRenderSuccess, this.onTileRendered.bind(this))
  18698. }
  18699. ,
  18700. n.prototype.onTileRendered = function(e, t, i, n) {}
  18701. ,
  18702. n.prototype.addModel = function(e) {
  18703. this.modelMap[e.sid] = e,
  18704. 0 === this.modelCount && this.activateModel(e.sid),
  18705. this.modelCount++,
  18706. this.emit(a.ModelAdded)
  18707. }
  18708. ,
  18709. n.prototype.getModel = function(e) {
  18710. return this.modelMap[e]
  18711. }
  18712. ,
  18713. n.prototype.activateModel = function(e) {
  18714. var t = this.modelMap[e];
  18715. if (!t)
  18716. throw new o("Tried to activate invalid model!");
  18717. var i = this.activeModel;
  18718. this.activeModel = t,
  18719. this.tileDownloader.setPanoData(t.panos, t.listImagePanos(), t.sid),
  18720. this.tileDownloader.setUrls(t.urls),
  18721. t.panos.forEach(function(e) {
  18722. e.attachToPanoRenderer(this.panoRenderer),
  18723. e.tileDownloader = this.tileDownloader,
  18724. e.qualityManager = this.qualityManager
  18725. }
  18726. .bind(this)),
  18727. this.emit(a.ActiveModelChanged, {
  18728. oldModel: i,
  18729. model: t
  18730. })
  18731. }
  18732. ,
  18733. n.prototype.getActiveModel = function() {
  18734. return this.activeModel
  18735. }
  18736. ,
  18737. r.extend(n, l),
  18738. t.exports = n
  18739. }
  18740. , {
  18741. "../enum/ModelManagerEvents": 33,
  18742. "../enum/PanoRendererEvents": 35,
  18743. "../exception/BasicException": 55,
  18744. "../util/common": 185,
  18745. events: 202,
  18746. three: 217
  18747. }],
  18748. 141: [function(e, t, i) {
  18749. (function(i) {
  18750. "use strict";
  18751. function n() {
  18752. s.call(this)
  18753. }
  18754. var r = e("../objects/Room")
  18755. , o = (e("../settings"),
  18756. e("../util/logger"))
  18757. , a = (e("../util/transitions"),
  18758. e("../util/easing"),
  18759. e("../util/common"))
  18760. , s = e("../util/IndexedCollection")
  18761. , l = e("./Chunks");
  18762. new o(i);
  18763. a.inherit(n, s),
  18764. n.prototype.getIndex = function(e) {
  18765. return e.roomId
  18766. }
  18767. ,
  18768. n.prototype.calcRoomBoundaries = function() {
  18769. this.forEach(function(e) {
  18770. e.calcBoundaries()
  18771. })
  18772. }
  18773. ,
  18774. n.prototype.createFromChunks = function(e) {
  18775. var t = {
  18776. floorId: -1,
  18777. roomId: -1
  18778. }
  18779. , i = {};
  18780. e.forEach(function(e) {
  18781. l.parseIdsFromChunkName(e.name, t);
  18782. var o = i[t.roomId];
  18783. if (!o) {
  18784. var a = n.generateRoomId(t.floorId, t.roomId);
  18785. o = new r(t.floorId,a),
  18786. this.add(o),
  18787. i[t.roomId] = o
  18788. }
  18789. o.addChunk(e)
  18790. }
  18791. .bind(this)),
  18792. this.calcRoomBoundaries()
  18793. }
  18794. ,
  18795. n.generateRoomId = function(e, t) {
  18796. return e + "_" + t
  18797. }
  18798. ,
  18799. t.exports = n
  18800. }
  18801. ).call(this, "/js/model/RoomCollection.js")
  18802. }
  18803. , {
  18804. "../objects/Room": 150,
  18805. "../settings": 166,
  18806. "../util/IndexedCollection": 175,
  18807. "../util/common": 185,
  18808. "../util/easing": 186,
  18809. "../util/logger": 189,
  18810. "../util/transitions": 195,
  18811. "./Chunks": 135
  18812. }],
  18813. 142: [function(e, t, i) {
  18814. "use strict";
  18815. function n(e, t, i) {
  18816. e = e.clone().expandByScalar(0.01);//改
  18817. var n = e.size()
  18818. , o = new r.BoxGeometry(n.x,n.y,n.z);
  18819. o.boundingBox = e,
  18820. r.Mesh.call(this, o, t),
  18821. this.position.copy(e.center()),
  18822. this.frustumCulled = !1,
  18823. i && this.add(new r.WireframeHelper(this))
  18824. }
  18825. var r = e("three");
  18826. n.prototype = Object.create(r.Mesh.prototype),
  18827. n.prototype.constructor = n,
  18828. t.exports = n
  18829. }
  18830. , {
  18831. three: 217
  18832. }],
  18833. 143: [function(e, t, i) {
  18834. (function(i) {
  18835. "use strict";
  18836. function n(e) {
  18837. h.time("Computing a nice bounding cubemap");
  18838. var t = new a({
  18839. side: r.BackSide,
  18840. transparent: !0
  18841. });
  18842. t.uniforms.modelAlpha.value = 0,
  18843. t.uniforms.opacity.value = 1 - s.modelAlpha,
  18844. this.renderOrder = l.boundingSkybox,
  18845. o.call(this, e, t),
  18846. h.timeEnd("Computing a nice bounding cubemap")
  18847. }
  18848. var r = e("three")
  18849. , o = (e("../enum/Viewmode"),
  18850. e("../shaders"),
  18851. e("./BoundingMesh"))
  18852. , a = e("../materials/ModelTextureMaterial")
  18853. , s = e("../settings")
  18854. , l = e("../enum/RenderOrder")
  18855. , c = e("../util/logger")
  18856. , h = new c(i);
  18857. n.prototype = Object.create(o.prototype),
  18858. n.prototype.constructor = n,
  18859. t.exports = n
  18860. }
  18861. ).call(this, "/js/objects/BoundingTextureSkybox.js")
  18862. }
  18863. , {
  18864. "../enum/RenderOrder": 42,
  18865. "../enum/Viewmode": 51,
  18866. "../materials/ModelTextureMaterial": 118,
  18867. "../settings": 166,
  18868. "../shaders": 167,
  18869. "../util/logger": 189,
  18870. "./BoundingMesh": 142,
  18871. three: 217
  18872. }],
  18873. 144: [function(e, t, i) {
  18874. "use strict";
  18875. function n(e) {
  18876. this.materialInside = new s({
  18877. side: r.DoubleSide
  18878. });
  18879. var t = r.UniformsUtils.clone(o.modelOutside.uniforms);
  18880. this.materialOutside = new r.RawShaderMaterial({
  18881. fragmentShader: o.modelOutside.fragmentShader,
  18882. vertexShader: o.modelOutside.vertexShader,
  18883. uniforms: t,
  18884. side: r.FrontSide,
  18885. name: "chunkOut"
  18886. }),
  18887. r.Mesh.call(this, e.geometry, this.materialInside),
  18888. this.name = e.name || "",
  18889. this.textureName = e.textureName,
  18890. this.meshUrl = e.meshUrl
  18891. }
  18892. var r = e("three")
  18893. , o = e("../shaders")
  18894. , a = e("../enum/Viewmode")
  18895. , s = e("../materials/ModelTextureMaterial");
  18896. n.prototype = Object.create(r.Mesh.prototype),
  18897. n.prototype.setTextureMap = function(e) {
  18898. this.materialInside.uniforms.map.value = e,
  18899. this.materialOutside.uniforms.map.value = e
  18900. }
  18901. ,
  18902. n.prototype.setMode = function(e) {
  18903. var t = e === a.DOLLHOUSE || e === a.FLOORPLAN ? this.materialOutside : this.materialInside;
  18904. t.side = e === a.PANORAMA ? r.DoubleSide : r.FrontSide,
  18905. t.transparent = this.material.transparent,
  18906. t.uniforms.opacity.value = this.material.uniforms.opacity.value,
  18907. this.material = t
  18908. }
  18909. ,
  18910. t.exports = n
  18911. }
  18912. , {
  18913. "../enum/Viewmode": 51,
  18914. "../materials/ModelTextureMaterial": 118,
  18915. "../shaders": 167,
  18916. three: 217
  18917. }],
  18918. 145: [function(e, t, i) {
  18919. "use strict";
  18920. function n(e) {
  18921. this.chunksize = e || 10,
  18922. this.chunks = {},
  18923. this.boundingBoxes = {},
  18924. this.children = [],
  18925. this.offset = new r.Vector3(0,.5,0),
  18926. this.material = new r.MeshBasicMaterial({
  18927. color: 16777215 * Math.random(),
  18928. side: r.DoubleSide
  18929. })
  18930. }
  18931. var r = e("three");
  18932. e("../enum/Viewmode");
  18933. n.prototype.add = function(e) {
  18934. var t, i, n, o, a, s, l, c, h, u, d, p, f, g, m = e.attributes;
  18935. m ? (t = m.position.array,
  18936. i = void 0 !== e.index ? e.index.array : void 0) : (t = e.vertices,
  18937. n = e.faces);
  18938. var v = new r.Vector3;
  18939. if (i)
  18940. for (o = 0,
  18941. a = i.length; o < a; o += 3) {
  18942. var A = 3 * i[o]
  18943. , y = 3 * i[o + 1]
  18944. , C = 3 * i[o + 2];
  18945. s = (t[A] + t[y] + t[C]) / 3,
  18946. l = (t[A + 1] + t[y + 1] + t[C + 1]) / 3,
  18947. c = (t[A + 2] + t[y + 2] + t[C + 2]) / 3,
  18948. h = Math.floor(s / this.chunksize),
  18949. u = Math.floor(l / this.chunksize),
  18950. d = Math.floor(c / this.chunksize),
  18951. p = h + "." + u + "." + d,
  18952. p in this.chunks ? (g = this.chunks[p],
  18953. f = this.boundingBoxes[p]) : (g = this.chunks[p] = [],
  18954. f = this.boundingBoxes[p] = new r.Box3),
  18955. 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]),
  18956. f.expandByPoint(v.set(t[A], t[A + 1], t[A + 2])),
  18957. f.expandByPoint(v.set(t[y], t[y + 1], t[y + 2])),
  18958. f.expandByPoint(v.set(t[C], t[C + 1], t[C + 2]))
  18959. }
  18960. else
  18961. for (o = 0,
  18962. a = t.length; o < a; o += 9)
  18963. s = (t[o] + t[o + 3] + t[o + 6]) / 3,
  18964. l = (t[o + 1] + t[o + 4] + t[o + 7]) / 3,
  18965. c = (t[o + 2] + t[o + 5] + t[o + 8]) / 3,
  18966. h = Math.floor(s / this.chunksize),
  18967. u = Math.floor(l / this.chunksize),
  18968. d = Math.floor(c / this.chunksize),
  18969. p = h + "." + u + "." + d,
  18970. p in this.chunks ? (g = this.chunks[p],
  18971. f = this.boundingBoxes[p]) : (g = this.chunks[p] = [],
  18972. f = this.boundingBoxes[p] = new r.Box3),
  18973. 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]),
  18974. f.expandByPoint(v.set(t[o], t[o + 1], t[o + 2])),
  18975. f.expandByPoint(v.set(t[o + 3], t[o + 4], t[o + 5])),
  18976. f.expandByPoint(v.set(t[o + 6], t[o + 7], t[o + 8]))
  18977. }
  18978. ,
  18979. n.prototype.build = function() {
  18980. var e = new r.Object3D;
  18981. e.material = this.material;
  18982. for (var t in this.chunks) {
  18983. var i = this.chunks[t]
  18984. , n = new r.BufferGeometry;
  18985. n.addAttribute("position", new r.BufferAttribute(new Float32Array(i),3)),
  18986. n.boundingBox = this.boundingBoxes[t];
  18987. var o = new r.Mesh(n,this.material);
  18988. o.material.visible = !1,
  18989. e.add(o),
  18990. this.chunks[t] = []
  18991. }
  18992. return e
  18993. }
  18994. ,
  18995. t.exports = n
  18996. }
  18997. , {
  18998. "../enum/Viewmode": 51,
  18999. three: 217
  19000. }],
  19001. 146: [function(e, t, i) {
  19002. "use strict";
  19003. var r = e("three")
  19004. , o = e("../settings")
  19005. , a = e("../util/common")
  19006. , s = e("../util/lerp")
  19007. , l = e("./ChunkedCollider")
  19008. , c = e("../util/transitions")
  19009. , h = e("../util/easing")
  19010. , u = (e("../objects/Panorama"),
  19011. e("../enum/RenderOrder"))
  19012. , d = e("../localization/localize");
  19013. function n(e, t, i) {
  19014. r.Object3D.call(this),
  19015. this.model = e,
  19016. this.floorIndex = t,
  19017. this.lang = o.languageTag,
  19018. this.name = i || o.languageTag === "cn" ? "Floor " + (t + 1) + "" : "第" + (t + 1) + "层",
  19019. this.panos = [],
  19020. this.chunks = [],
  19021. this.colliderBuilder = new l(3),
  19022. this.collider = null,
  19023. this.center = null,
  19024. this.boundingBox = new r.Box3,
  19025. this.size = null,
  19026. this.hidden = !1,
  19027. this.conservativeBoundingBox = new r.Box3,
  19028. this.debugColor = 16777215 * Math.random(),
  19029. this.transition = null
  19030. }
  19031. n.prototype = Object.create(r.Object3D.prototype),
  19032. n.prototype.enter = function(e) {
  19033. this.model.setFloor(this, e)
  19034. }
  19035. ,
  19036. n.prototype.hide = function(e) {
  19037. if (!this.hidden || this.transition) {
  19038. this.chunks.forEach(function(e) {
  19039. e.material.transparent = !0
  19040. }),
  19041. c.cancel(this.transition);
  19042. var t = e ? 0 : o.hideFloorDuration + o.hideFloorDelay
  19043. , i = e ? 0 : o.hideFloorDelay / t;
  19044. this.transition = c.start(s.allUniforms(this.chunks, "opacity", .08), t, function() {
  19045. this.hidden = !0
  19046. }
  19047. .bind(this), i, h.easeInOutQuad)
  19048. }
  19049. }
  19050. ,
  19051. n.prototype.show = function(e) {
  19052. if (this.hidden || this.transition) {
  19053. this.hidden = !1,
  19054. c.cancel(this.transition);
  19055. var t = e ? o.showFloorDuration : o.showFloorDuration + o.showFloorDelay
  19056. , i = e ? 0 : o.showFloorDelay / t;
  19057. this.transition = c.start(s.allUniforms(this.chunks, "opacity", 1), t, function() {
  19058. this.hidden || this.chunks.forEach(function(e) {
  19059. e.material.transparent = !1
  19060. })
  19061. }
  19062. .bind(this), i, h.easeInOutQuad)
  19063. }
  19064. }
  19065. ,
  19066. n.prototype.toggle = function(e, t) {
  19067. e = void 0 === e ? this.hidden : e,
  19068. e ? this.show(t) : this.hide(t)
  19069. }
  19070. ,
  19071. n.prototype.containsPoint = function(e) {
  19072. return this.collider.children.some(function(t) {
  19073. return t.geometry.boundingBox || t.geometry.computeBoundingBox(),
  19074. t.geometry.boundingBox.containsPoint(e)
  19075. })
  19076. }
  19077. ,
  19078. n.prototype.distanceToPoint = function(e) {
  19079. var t = null
  19080. , i = 1 / 0;
  19081. return this.collider.children.forEach(function(n) {
  19082. n.geometry.boundingBox || n.geometry.computeBoundingBox();
  19083. var r = n.geometry.boundingBox.distanceToPoint(e);
  19084. (!t || i > r) && (i = r,
  19085. t = n)
  19086. }),
  19087. i
  19088. }
  19089. ,
  19090. n.prototype.addChunk = function(e) {
  19091. e.renderOrder = u.ghostFloor,
  19092. this.add(e),
  19093. this.chunks.push(e),
  19094. this.boundingBox.union(e.geometry.boundingBox),
  19095. this.size = this.boundingBox.size(),
  19096. this.colliderBuilder.add(e.geometry)
  19097. }
  19098. ,
  19099. n.prototype.addPano = function(e) {
  19100. this.panos.push(e),
  19101. this.add(e.skyboxMesh),
  19102. e.marker && this.add(e.marker);
  19103. var t = new r.Vector3(1,1,1)
  19104. , i = (new r.Box3).setFromCenterAndSize(e.position, t);
  19105. this.boundingBox.union(i)
  19106. }
  19107. ,
  19108. n.prototype.build = function() {
  19109. this.collider = this.colliderBuilder.build(!0),
  19110. this.add(this.collider),
  19111. this.center = this.boundingBox.center(),
  19112. this.conservativeBoundingBox.copy(this.boundingBox),
  19113. this.conservativeBoundingBox.min.y = a.lowerMedian(this.collider.children.map(function(e) {
  19114. return e.geometry.boundingBox.min.y
  19115. }), 5),
  19116. this.conservativeBoundingBox.max.y = a.lowerMedian(this.collider.children.map(function(e) {
  19117. return e.geometry.boundingBox.max.y
  19118. }), 5),
  19119. this.colliderBuilder = null
  19120. }
  19121. ,
  19122. n.prototype.toShortString = function() {
  19123. return a.nth(this.floorIndex + 1)
  19124. }
  19125. ,
  19126. n.prototype.toString = function() {
  19127. return this.name
  19128. }
  19129. ,
  19130. t.exports = n
  19131. }
  19132. , {
  19133. "../enum/RenderOrder": 42,
  19134. "../localization/localize": 108,
  19135. "./strings-cn-CN": 109,
  19136. "../objects/Panorama": 148,
  19137. "../settings": 166,
  19138. "../util/common": 185,
  19139. "../util/easing": 186,
  19140. "../util/lerp": 188,
  19141. "../util/transitions": 195,
  19142. "./ChunkedCollider": 145,
  19143. three: 217
  19144. }],
  19145. 147: [function(e, t, i) {
  19146. "use strict";
  19147. function n(e) {
  19148. this.player = e,
  19149. this.obj3d = null,
  19150. this.UP = new r.Vector3(0,1,0)
  19151. }
  19152. var r = e("three")
  19153. , o = e("../settings");
  19154. n.prototype.prefs = {
  19155. linewidth: 3,
  19156. height: .07,
  19157. opacity: .45,
  19158. endScale: .05
  19159. },
  19160. n.prototype.discard = function() {
  19161. if (this.obj3d) {
  19162. var e = this.obj3d.parent;
  19163. e && e.remove(this.obj3d)
  19164. }
  19165. this.obj3d = null
  19166. }
  19167. ,
  19168. n.prototype.draw = function() {
  19169. if (this.discard(),
  19170. o.showNeighbors) {
  19171. var e = this.player.currentPano.floor;
  19172. this.obj3d = new r.Object3D;
  19173. var t = this.player.model.panos.getNeighbours(this.player.currentPano)
  19174. , i = this.player.currentPano.floorPosition.clone().sub(this.player.model.position);
  19175. i.y += this.prefs.height;
  19176. var n = .1525
  19177. , a = .127
  19178. , s = .0127
  19179. , l = .1
  19180. , c = .19
  19181. , h = .2032
  19182. , u = .2286
  19183. , d = .255
  19184. , p = new r.Matrix4;
  19185. for (var f in t)
  19186. if (t[f]) {
  19187. var g = this.player.model.panos.get(f)
  19188. , m = (g.position.clone().sub(this.player.model.position),
  19189. g.position.clone().sub(g.floorPosition))
  19190. , v = g.floorPosition.clone().sub(this.player.model.position);
  19191. v.y += this.prefs.height;
  19192. var A = new r.Geometry;
  19193. 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)),
  19194. 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)),
  19195. p.identity().setPosition(m),
  19196. A.applyMatrix(p),
  19197. A.vertices.push(new r.Vector3(0,-this.prefs.endScale,0)),
  19198. 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)),
  19199. p.lookAt(v, i, this.UP).setPosition(v),
  19200. A.applyMatrix(p),
  19201. A.vertices.push(v, i);
  19202. var y = new r.Line(A,new r.LineBasicMaterial({
  19203. color: g.debugColor.getHex(),
  19204. transparent: !0,
  19205. opacity: this.prefs.opacity,
  19206. depthWrite: !1,
  19207. name: "sLine" + f,
  19208. linewidth: this.prefs.linewidth
  19209. }));
  19210. this.obj3d.add(y)
  19211. }
  19212. e.add(this.obj3d)
  19213. }
  19214. }
  19215. ,
  19216. n.prototype.update = function() {
  19217. o.showNeighbors && this.obj3d && this.obj3d.updateMatrixWorld()
  19218. }
  19219. ,
  19220. t.exports = n
  19221. }
  19222. , {
  19223. "../settings": 166,
  19224. three: 217
  19225. }],
  19226. 148: [function(e, t, i) {
  19227. (function(i) {
  19228. "use strict";
  19229. function n(e, t, i, n) {
  19230. this.model = e,
  19231. this.id = t,
  19232. this.alignmentType = i.alignmentType || l.ALIGNED,
  19233. this.neighbourUUIDs = i.neighbours || null,
  19234. this.neighbourPanos = null,
  19235. this.floor = null,
  19236. this.floorIndex = i.floor,
  19237. this.failedLoadingAt = 0,
  19238. this.maxLoadRetries = 4,
  19239. this.origin = i.position.clone(),
  19240. this.position = this.alignmentType === l.UNALIGNED ? new r.Vector3(0,-5,0) : i.position.clone(),
  19241. this.quaternion = i.quaternion.clone(),
  19242. this.skyboxMesh = new r.Mesh(E),
  19243. this.skyboxMesh.position.copy(this.position),
  19244. this.skyboxMesh.quaternion.copy(this.quaternion),
  19245. this.skyboxMesh.name = "skybox",
  19246. this.skyboxMesh.visible = !1,
  19247. this.skyboxMesh.updateMatrix(),
  19248. this.skyboxMesh.updateMatrixWorld(),
  19249. this.marker = null,
  19250. this.showFloorMarker = !window.MP_PREFETCHED_MODELDATA.hideFloorMarker;
  19251. this.isAligned() && (this.marker = new r.Mesh(b,new r.MeshBasicMaterial({
  19252. map: w,
  19253. side: r.DoubleSide,
  19254. opacity: 0,
  19255. transparent: !0,
  19256. depthWrite: !1
  19257. })),
  19258. this.marker.visible = this.showFloorMarker,
  19259. this.marker.renderOrder = s.panoMarker,
  19260. this.marker.name = "marker",
  19261. this.marker.pano = this,
  19262. this.marker.layers.set(v.PANOMARKERS),
  19263. this.marker.updateMatrixWorld(),
  19264. a.colorMarkerOnLoad && this.on("load", function() {
  19265. this.marker.material.color.set(65280)
  19266. })),
  19267. this.debugColor = (new r.Color).setHSL(.06 + .53 * Math.random(), .8 + .2 * Math.random(), .5 + .2 * Math.random()),
  19268. this.floorPosition = i.puck ? i.puck.clone() : null,
  19269. this.tiled = n,
  19270. this.tiled ? this.solidSkybox = null : (this.solidSkybox = new r.Texture([null, null, null, null, null, null]),
  19271. this.solidSkybox.flipY = !1,
  19272. a.minimalMemoryMode && (this.solidSkybox.minFilter = r.LinearFilter,
  19273. this.solidSkybox.magFilter = r.LinearFilter,
  19274. this.solidSkybox.generateMipmaps = !1)),
  19275. this.zoomed = !1,
  19276. this.panoRenderer = null,
  19277. this.qualityManager = null,
  19278. this.tileDownloader = null,
  19279. this.tiledPanoRenderTarget = null,
  19280. this.minimumTiledPanoLoaded = !1,
  19281. this.highestPartialTileRenderOpCompleted = 0,
  19282. this.highestFullTileRenderOpCompleted = 0,
  19283. this.shouldRedrawOnBaseLoaded = !1,
  19284. this.lockUntilRenderingComplete = !1,
  19285. a.colorMarkerOnLoad && this.on("load", function() {
  19286. this.marker.material.color.set(65280)
  19287. });
  19288. /********************************************************************fyz改vr from徐世廷*************************************************************/
  19289. var e = new r.TextureLoader;
  19290. e.setCrossOrigin(!0);
  19291. var g = e.load("images/texture.jpg");
  19292. if (this.vrMarker = new r.Mesh(new r.OctahedronGeometry(.1,0),new r.MeshLambertMaterial({
  19293. color: 16777215,
  19294. transparent: !0,
  19295. opacity: .75,
  19296. map: g
  19297. })),
  19298. this.vrMarker.boluoType = "vr",
  19299. this.vrMarker.position.z = 1,
  19300. this.vrMarker.enabled = !0,
  19301. this.vrMarker.visible = !1,
  19302. window.vrMarkers = window.vrMarkers || [],
  19303. window.vrMarkers.push(this.vrMarker),
  19304. this.marker && this.marker.add(this.vrMarker),
  19305. a.showAxis && (this.skyboxMesh.add(new r.ArrowHelper(new r.Vector3(0,1,0),new r.Vector3(0,0,0),1,255)),
  19306. this.skyboxMesh.add(new r.ArrowHelper(new r.Vector3(0,0,1),new r.Vector3(0,0,0),1,16711680)),
  19307. this.skyboxMesh.add(new r.ArrowHelper(new r.Vector3(1,0,0),new r.Vector3(0,0,0),1,65280))),
  19308. this.adjustAngleEnable) {
  19309. var i = new r.Quaternion;
  19310. i.setFromAxisAngle(new r.Vector3(1,0,0), this.adjustAngleX),
  19311. this.skyboxMesh.quaternion.multiply(i);
  19312. var m = new r.Quaternion;
  19313. m.setFromAxisAngle(new r.Vector3(0,1,0), this.adjustAngleY),
  19314. this.skyboxMesh.quaternion.multiply(m);
  19315. var n = new r.Quaternion;
  19316. n.setFromAxisAngle(new r.Vector3(0,0,1), this.adjustAngleZ),
  19317. this.skyboxMesh.quaternion.multiply(n),
  19318. this.skyboxMesh.updateMatrix(),
  19319. this.skyboxMesh.updateMatrixWorld(),
  19320. this.model.updateProjectedPanos()
  19321. }
  19322. /**************************************************************************************************************************************/
  19323. }
  19324. var r = e("three")
  19325. , o = e("../util/logger")
  19326. , a = e("../settings")
  19327. , s = (e("../enum/Viewmode"),
  19328. e("../enum/RenderOrder"))
  19329. , l = e("../enum/AlignmentType")
  19330. , c = (e("../util/common"),
  19331. e("../util/transitions"))
  19332. , h = e("../util/lerp")
  19333. , u = e("../util/ajax")
  19334. , d = e("../util/texture")
  19335. , p = e("../util/panorama")
  19336. , f = (e("../enum/TileDownloaderEvents"),
  19337. e("../enum/PanoramaEvents"))
  19338. , g = e("../enum/PanoRendererEvents")
  19339. , m = e("../enum/PanoSizeClass")
  19340. , v = e("../enum/RenderLayers")
  19341. , A = (e("../scene/SceneRenderer"),
  19342. e("../enum/GLCubeFaces"),
  19343. e("../exception/BasicException"))
  19344. , y = e("../tile/TileUtils")
  19345. , C = e("events").EventEmitter
  19346. , I = new o(i)
  19347. , E = new r.SphereBufferGeometry(.1)
  19348. , b = new r.PlaneBufferGeometry(.4,.4,1,1)
  19349. , w = d.load("images/marker-256x256.png");
  19350. n.prototype = Object.create(C.prototype),
  19351. n.prototype.enter = function() {
  19352. var e = null;
  19353. return function() {
  19354. this.setZoomed(!1),
  19355. this.emit("enter", {
  19356. oldPano: e,
  19357. newPano: this
  19358. }),
  19359. e = this
  19360. playMusic(this)
  19361. }
  19362. }(),
  19363. n.prototype.exit = function() {
  19364. this.tiled ? (this.clearWaitDeferreds(),
  19365. this.minimumTiledPanoLoaded = !1,
  19366. this.tiledPanoRenderTarget = null,
  19367. this.setZoomed(!1),
  19368. this.panoRenderer.deactivateTiledPano(this),
  19369. this.highestPartialTileRenderOpCompleted = 0,
  19370. this.highestFullTileRenderOpCompleted = 0) : (this.solidSkybox.dispose(),
  19371. this.solidSkybox.loaded = !1,
  19372. this.solidSkybox.version = 0),
  19373. this.emit("exit")
  19374. }
  19375. ,
  19376. n.prototype.hoverOn = function(e) {
  19377. this.marker && (c.start(h.property(this.marker.material, "opacity", a[e].markerOpacityOnHover), 250),
  19378. a.navigation.panoScores & a.navigation.mouseDirection && this.addTextSprite("HIT", 12525854))
  19379. }
  19380. ,
  19381. n.prototype.hoverOff = function(e) {
  19382. this.marker && c.start(h.property(this.marker.material, "opacity", a[e].markerOpacity), 250)
  19383. }
  19384. ,
  19385. n.prototype.build1 = function() {
  19386. this.floor = this.floor || this.model.floors.get(this.floorIndex) || this.raycastToFindFloor() || this.model.getFloorAtPoint(this.position),
  19387. this.floor.addPano(this),
  19388. this.floorPosition = this.floorPosition || this.raycastFloorPosition(),
  19389. this.neighbourPanos = this.neighbourPanos || this.findNeighourPanos(),
  19390. a.colorMarkerByFloor && this.marker && this.marker.material.color.set(this.floor.debugColor)
  19391. }
  19392. ,
  19393. n.prototype.build2 = function() {
  19394. this.floorPosition = this.floorPosition || this.interpolateFloorPosition(),
  19395. this.height = this.position.distanceTo(this.floorPosition),
  19396. this.placeMarker()
  19397. }
  19398. ,
  19399. n.prototype.interpolateFloorPosition = function() {
  19400. var e = this.model.panos.filter(n.filters.isNeighbourPanoTo(this)).filter(function(e) {
  19401. return !!e.floorPosition
  19402. }).sort(function(e, t) {
  19403. return e.position.distanceTo(this.position) - t.position.distanceTo(this.position)
  19404. }
  19405. .bind(this))
  19406. , t = this.position.clone();
  19407. return e.length >= 2 ? t.y = (e[0].floorPosition.y + e[1].floorPosition.y) / 2 : t.add(a.noMeshFloorPositionOffset),
  19408. t
  19409. }
  19410. ,
  19411. n.prototype.raycastFloorPosition = function() {
  19412. I.warn("Performance warning: Raycasting to find floor position");
  19413. var e = new r.Raycaster(this.position,new r.Vector3(0,-1,0))
  19414. , t = e.intersectObjects(this.model.colliders);
  19415. return t.length ? t[0].point : null
  19416. }
  19417. ,
  19418. n.prototype.raycastToFindFloor = function() {
  19419. 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)];
  19420. return function() {
  19421. I.warn("Performance warning: Raycasting to find floor index");
  19422. for (var t = 0; t < e.length; t++) {
  19423. var i = new r.Raycaster(this.position.clone(),e[t].clone())
  19424. , n = i.intersectObjects(this.model.colliders);
  19425. if (n.length)
  19426. return n[0].object.parent.parent
  19427. }
  19428. return null
  19429. }
  19430. }(),
  19431. n.prototype.placeMarker = function() {
  19432. this.marker && (this.marker.position.copy(this.floorPosition),
  19433. this.marker.position.y += .05,
  19434. this.marker.lookAt(new r.Vector3(0,1,0).add(this.marker.position)))
  19435. }
  19436. ,
  19437. n.prototype.translate = function(e) {
  19438. this.position.add(e),
  19439. this.floorPosition.add(e)
  19440. }
  19441. ,
  19442. n.prototype.findClosestMidtpointPanoTo = function(e) {
  19443. (new r.Vector3).addVectors(this.position, e.position).divideScalar(2);
  19444. return this.model.panos.find([n.filters.notIn([this, e])], [n.sortFunctions.distanceToPoint(point)])
  19445. }
  19446. ,
  19447. n.prototype.attachToPanoRenderer = function(e) {
  19448. this.panoRenderer = e,
  19449. this.panoRenderer.on(g.TileRenderSuccess, this.onTileRendered.bind(this)),
  19450. this.panoRenderer.on(g.PanoRenderComplete, this.onPanoRendered.bind(this)),
  19451. this.panoRenderer.on(g.TileRenderFailure, this.onTileRenderFail.bind(this)),
  19452. this.panoRenderer.on(g.UploadAttemptedForAllTiles, this.onUploadAttemptedForAllTiles.bind(this))
  19453. }
  19454. ;
  19455. var _ = {};
  19456. n.prototype.getWaitDeferred = function(e) {
  19457. var t = _[this.id];
  19458. t || (t = {},
  19459. _[this.id] = t);
  19460. var i = t[e];
  19461. return i || (i = {
  19462. deferred: $.Deferred(),
  19463. active: !1
  19464. },
  19465. t[e] = i),
  19466. i
  19467. }
  19468. ,
  19469. n.prototype.resetWaitDeferred = function(e) {
  19470. var t = this.getWaitDeferred(e);
  19471. t.active = !1,
  19472. t.deferred = $.Deferred()
  19473. }
  19474. ,
  19475. n.prototype.clearWaitDeferreds = function() {
  19476. var e = _[this.id];
  19477. e || (e = {},
  19478. _[this.id] = e);
  19479. for (var t in e)
  19480. if (e.hasOwnProperty(t)) {
  19481. var i = e[t];
  19482. i.active = !1,
  19483. i.deferred = $.Deferred()
  19484. }
  19485. }
  19486. ,
  19487. n.prototype.loadTiledPano = function() {
  19488. var e = (new r.Vector3,
  19489. [])
  19490. , t = [];
  19491. return function(i, n, r, o, a, s) {
  19492. null !== o && void 0 !== o || (o = !0),
  19493. null !== a && void 0 !== a || (a = !0);
  19494. var l = this.getWaitDeferred(i)
  19495. , c = l.deferred
  19496. , h = null
  19497. , u = null;
  19498. if (r && ("number" == typeof r ? h = r : (h = r.hFov,
  19499. u = r.vFov)),
  19500. !this.isLoaded(i)) {
  19501. if (!l.active) {
  19502. if (l.active = !0,
  19503. r) {
  19504. var d = y.matchingTilesInDirection(this, i, n, h, u);
  19505. e[this.id + ":" + i] = {
  19506. tileCount: 0,
  19507. targetTileCount: d
  19508. },
  19509. I.info("Loading partial pano: " + this.id + " with " + d + " tiles")
  19510. }
  19511. t[this.id] || (t[this.id] = !0,
  19512. this.on(f.LoadComplete, function(e, t) {
  19513. var i = this.getWaitDeferred(e).deferred;
  19514. i && "pending" === i.state() && this.highestPartialTileRenderOpCompleted >= e && (i.resolve(e, t),
  19515. this.resetWaitDeferred(e))
  19516. }
  19517. .bind(this)),
  19518. this.on(f.LoadFailed, function(e) {
  19519. var t = this.getWaitDeferred(e).deferred;
  19520. t && "pending" === t.state() && this.highestPartialTileRenderOpCompleted >= e && (t.reject(e),
  19521. this.resetWaitDeferred(e))
  19522. }
  19523. .bind(this)),
  19524. this.on(f.TileLoaded, function(t, i, n) {
  19525. var r = this.getWaitDeferred(t).deferred;
  19526. if (r && "pending" === r.state()) {
  19527. r.notify(t, i, n);
  19528. var o = e[this.id + ":" + t];
  19529. o && (o.tileCount++,
  19530. o.tileCount === o.targetTileCount && (this.onPanoRendered(this.id, t, n, !0),
  19531. r.resolve(t, n),
  19532. this.resetWaitDeferred(t)))
  19533. }
  19534. }
  19535. .bind(this)))
  19536. }
  19537. this.tileDownloader.clearForceQueue(),
  19538. this.tileDownloader.forceQueueTilesForPano(this, i, n, h, u, s),
  19539. this.tiledPanoRenderTarget = this.panoRenderer.activateTiledPano(this, this.qualityManager.getMaxNavPanoSize(), o),
  19540. this.panoRenderer.renderPanoTiles(this.id, n, a)
  19541. }
  19542. return c.promise()
  19543. }
  19544. }(),
  19545. n.prototype.onUploadAttemptedForAllTiles = function(e, t, i) {
  19546. if (e === this.id) {
  19547. var n = this.qualityManager.getPanoSize(m.BASE);
  19548. t === n && this.shouldRedrawOnBaseLoaded && (this.shouldRedrawOnBaseLoaded = !1,
  19549. this.panoRenderer.resetRenderStatus(this.id, !0, !1),
  19550. this.panoRenderer.renderPanoTiles(this.id, null, !0, !0))
  19551. }
  19552. }
  19553. ,
  19554. n.prototype.onTileRendered = function(e, t, i, n) {
  19555. e === this.id && this.emit(f.TileLoaded, t, i, n)
  19556. }
  19557. ,
  19558. n.prototype.onPanoRendered = function(e, t, i, n) {
  19559. e === this.id && (this.minimumTiledPanoLoaded = !0,
  19560. this.updateSkyboxForZoomLevel(),
  19561. t > this.highestPartialTileRenderOpCompleted && (this.highestPartialTileRenderOpCompleted = t),
  19562. !n && t > this.highestFullTileRenderOpCompleted && (this.highestFullTileRenderOpCompleted = t),
  19563. this.emit("load", t),
  19564. this.model.emit("load", this),
  19565. this.emit(f.LoadComplete, t, i))
  19566. }
  19567. ,
  19568. n.prototype.setZoomed = function(e) {
  19569. this.zoomed = e,
  19570. this.updateSkyboxForZoomLevel()
  19571. }
  19572. ,
  19573. n.prototype.ensureSkyboxReadyForRender = function() {
  19574. this.tiled || (this.solidSkybox.loaded || (this.solidSkybox.needsUpdate = !0),
  19575. this.solidSkybox.loaded = !0)
  19576. }
  19577. ,
  19578. n.prototype.updateSkyboxForZoomLevel = function() {
  19579. this.minimumTiledPanoLoaded && this.model.updateProjectedPanos()
  19580. }
  19581. ,
  19582. n.prototype.getSkyboxTexture = function() {
  19583. return this.tiled ? this.minimumTiledPanoLoaded ? this.zoomed ? this.panoRenderer.zoomRenderTarget.texture : this.tiledPanoRenderTarget.texture : null : this.solidSkybox
  19584. }
  19585. ,
  19586. n.prototype.onTileRenderFail = function(e, t, i) {
  19587. e === this.id && this.emit(f.LoadFailed, t)
  19588. }
  19589. ,
  19590. n.prototype.isLoaded = function(e) {
  19591. if (this.tiled) {
  19592. if (e && "string" == typeof e)
  19593. throw new A("Wrong panoSize given to Panorama.isLoaded(); a tiled pano uses PanoSizeClass");
  19594. return !!this.minimumTiledPanoLoaded && (!e || this.highestPartialTileRenderOpCompleted >= e)
  19595. }
  19596. if (e && "number" == typeof e)
  19597. throw new A("Wrong panoSize given to Panorama.isLoaded(); a non-tiled pano uses high/low.");
  19598. return !!this.solidSkybox.high || e in this.solidSkybox
  19599. }
  19600. ,
  19601. n.prototype.loadCube = function(e) {
  19602. if (this.isLoaded(e))
  19603. return I.info("Skipping load of pano, already loaded"),
  19604. $.when();
  19605. this.emit("loading", e),
  19606. this.model.emit("loading", this);
  19607. var t = p.getCubemapUrls(this.model.urls, this.id, e)
  19608. , i = t.filter(function(e) {
  19609. return !e
  19610. });
  19611. "low" === e && i.length > 0 && (I.info("Pano", this.id, "not available in low res, loading high res right away"),
  19612. e = "high",
  19613. t = p.getCubemapUrls(this.model.urls, this.id, e));
  19614. var n = 0
  19615. , r = [0, 1, 2, 3, 4, 5].map(function(e, i, n) {
  19616. return u.getImage(t[i])
  19617. }
  19618. .bind(this));
  19619. return $.when(r[0], r[1], r[2], r[3], r[4], r[5]).then(function(t, i, n, r, o, a) {
  19620. return this.solidSkybox[e] = [t, i, n, r, o, a],
  19621. "high" !== e && this.solidSkybox.high || (this.solidSkybox.image = this.solidSkybox[e],
  19622. this.solidSkybox.low = null),
  19623. this.solidSkybox.needsUpdate = !0,
  19624. this.emit("load", e),
  19625. this.model.emit("load", this),
  19626. this
  19627. }
  19628. .bind(this), function() {
  19629. I.error("Downloading cubemap for pano", this.id, "failed"),
  19630. this.failedLoadingAt = Date.now()
  19631. }
  19632. .bind(this), function() {
  19633. return $.when(++n, 6)
  19634. })
  19635. }
  19636. ,
  19637. n.raycastsSkipped = 0,
  19638. n.raycastsDone = 0,
  19639. n.prototype.findNeighourPanos = function() {
  19640. return this.model.panos.setNeighbour(this.id, this.id, !1),
  19641. this.model.panos.forEach(function(e) {
  19642. if (e !== this && (!this.model.panos.neighbourMap[this.id] || void 0 === this.model.panos.neighbourMap[this.id][e.id])) {
  19643. var t = this.position.distanceTo(e.position);
  19644. if (t > a.panoramaNeighbourMaxDistance)
  19645. return this.model.panos.setNeighbour(this, e, !1),
  19646. void n.raycastsSkipped++;
  19647. var i = e.position.clone().sub(this.position).normalize()
  19648. , o = new r.Raycaster(this.position,i.clone(),0,t)
  19649. , s = o.intersectObjects(this.model.colliders);
  19650. n.raycastsDone++,
  19651. this.model.panos.setNeighbour(this, e, 0 === s.length),
  19652. 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)))
  19653. }
  19654. }
  19655. .bind(this)),
  19656. this.model.panos.neighbourMap[this.id]
  19657. }
  19658. ,
  19659. n.prototype.worldPosition = function() {
  19660. return this.position
  19661. }
  19662. ,
  19663. n.prototype.addTextSprite = function(e, t) {
  19664. this.removeTextSprite();
  19665. var i = document.createElement("canvas")
  19666. , n = i.getContext("2d");
  19667. i.width = 256,
  19668. i.height = 256;
  19669. var o = "Arial"
  19670. , a = 60;
  19671. n.font = "bold " + a + "px " + o,
  19672. n.fillStyle = "white";
  19673. var s = n.measureText(e).width;
  19674. n.fillText(e, (i.width - s) / 2, (i.height + a) / 2);
  19675. var l = new r.Texture(i);
  19676. l.needsUpdate = !0;
  19677. var c = new r.SpriteMaterial({
  19678. map: l,
  19679. color: t || 16428055
  19680. });
  19681. this.text3d = new r.Sprite(c),
  19682. this.text3d.position.copy(this.skyboxMesh.position),
  19683. this.floor.add(this.text3d)
  19684. }
  19685. ,
  19686. n.prototype.removeTextSprite = function() {
  19687. this.text3d && (this.floor.remove(this.text3d),
  19688. this.text3d = null)
  19689. }
  19690. ,
  19691. n.prototype.isAligned = function() {
  19692. return this.alignmentType === l.ALIGNED
  19693. }
  19694. ,
  19695. n.filters = {
  19696. inDirection: function(e, t, i) {
  19697. return function(n) {
  19698. var r = n.position.clone().sub(e).normalize();
  19699. return r.dot(t) > i
  19700. }
  19701. },
  19702. inFloorDirection: function(e, t, i) {
  19703. return function(n) {
  19704. var r = n.floorPosition.clone().sub(e).normalize();
  19705. return r.dot(t) > i
  19706. }
  19707. },
  19708. inPanoDirection: function(e, t, i) {
  19709. return i = a.navigation.panoScores ? a.navigation.filterStrictness : i,
  19710. function(n) {
  19711. var r = n.floorPosition.clone().sub(e).normalize()
  19712. , o = n.position.clone().sub(e).normalize();
  19713. return r.dot(t) > i || o.dot(t) > i
  19714. }
  19715. },
  19716. atFloor: function(e) {
  19717. return function(t) {
  19718. return !e || t.floor === e
  19719. }
  19720. },
  19721. not: function(e) {
  19722. return function(t) {
  19723. return t !== e
  19724. }
  19725. },
  19726. notIn: function(e) {
  19727. return function(t) {
  19728. return e.indexOf(t) === -1
  19729. }
  19730. },
  19731. isLoaded: function() {
  19732. return function(e) {
  19733. return e.isLoaded()
  19734. }
  19735. },
  19736. isNotLoaded: function() {
  19737. return function(e) {
  19738. return !e.isLoaded()
  19739. }
  19740. },
  19741. isCloseEnoughTo: function(e, t) {
  19742. return function(i) {
  19743. return e.distanceTo(i.floorPosition) < t
  19744. }
  19745. },
  19746. hasMinimumHeightDifferenceTo: function(e, t) {
  19747. return function(i) {
  19748. return Math.abs(i.position.y - e.y) > t
  19749. }
  19750. },
  19751. isNotBehindNormal: function(e, t) {
  19752. var i = new r.Vector3;
  19753. return t = t.clone(),
  19754. function(n) {
  19755. var r = i.copy(n.position).sub(e).normalize();
  19756. return r.dot(t) > 0
  19757. }
  19758. },
  19759. isNeighbourPanoTo: function(e) {
  19760. return function(t) {
  19761. return !e || !e.neighbourPanos || !!e.neighbourPanos[t.id]
  19762. }
  19763. },
  19764. isNeighbourOfNeighbourTo: function(e) {
  19765. return function(t) {
  19766. return !!e.neighbourPanos[t.id] || e.neighbourUUIDs.some(function(i) {
  19767. var n = e.model.panos.get(i);
  19768. return !!n && n.neighbourPanos[t.id]
  19769. })
  19770. }
  19771. },
  19772. isNotRecentlyFailed: function(e) {
  19773. return function(t) {
  19774. return Date.now() - t.failedLoadingAt > e
  19775. }
  19776. },
  19777. isOnVisibleFloor: function() {
  19778. return function(e) {
  19779. return !e.floor.hidden
  19780. }
  19781. },
  19782. isPanoAligned: function() {
  19783. return function(e) {
  19784. return e.isAligned()
  19785. }
  19786. }
  19787. },
  19788. n.sortFunctions = {
  19789. distanceToPoint: function(e) {
  19790. return function(t, i) {
  19791. return t.position.distanceTo(e) - i.position.distanceTo(e)
  19792. }
  19793. },
  19794. floorDistanceToPoint: function(e) {
  19795. return function(t, i) {
  19796. return t.floorPosition.distanceTo(e) - i.floorPosition.distanceTo(e)
  19797. }
  19798. },
  19799. choose: function(e) {
  19800. return function(t, i) {
  19801. return e.id === t.id ? -1 : e.id === i.id ? 1 : 0
  19802. }
  19803. }
  19804. },
  19805. n.scoreFunctions = {
  19806. distance: function(e, t) {
  19807. return t = t || a.navigation.distanceFactor,
  19808. function(i) {
  19809. return e ? e.position.distanceTo(i.position) * t : 0
  19810. }
  19811. },
  19812. distanceSquared: function(e, t) {
  19813. return t = t || a.navigation.distanceFactor,
  19814. function(i) {
  19815. return e ? e.position.distanceToSquared(i.position) * t : 0
  19816. }
  19817. },
  19818. direction: function(e, t) {
  19819. return function(i) {
  19820. var n = i.position.clone().sub(e).normalize();
  19821. return n.dot(t) * a.navigation.directionFactor
  19822. }
  19823. },
  19824. angle: function(e, t) {
  19825. return function(i) {
  19826. var n = i.position.clone().sub(e).normalize();
  19827. return n.angleTo(t) * a.navigation.angleFactor
  19828. }
  19829. },
  19830. inFieldOfView: function(e, t) {
  19831. return function(i) {
  19832. var n = i.position.clone().sub(e).normalize();
  19833. return n.dot(t) > .75 ? 10 : -1
  19834. }
  19835. },
  19836. optionality: function(e) {
  19837. return function(t) {
  19838. var i = t.neighbourUUIDs.filter(function(t) {
  19839. return !(t in e.neighbourUUIDs) && t !== e.id
  19840. });
  19841. return i.length * a.navigation.optionalityFactor
  19842. }
  19843. },
  19844. penalizeHeightDifferenceUnder: function(e, t) {
  19845. return function(i) {
  19846. return e.y - i.position.y < t ? -20 : 0
  19847. }
  19848. }
  19849. },
  19850. t.exports = n
  19851. }
  19852. ).call(this, "/js/objects/Panorama.js")
  19853. }
  19854. , {
  19855. "../enum/AlignmentType": 17,
  19856. "../enum/GLCubeFaces": 25,
  19857. "../enum/PanoRendererEvents": 35,
  19858. "../enum/PanoSizeClass": 36,
  19859. "../enum/PanoramaEvents": 37,
  19860. "../enum/RenderLayers": 41,
  19861. "../enum/RenderOrder": 42,
  19862. "../enum/TileDownloaderEvents": 45,
  19863. "../enum/Viewmode": 51,
  19864. "../exception/BasicException": 55,
  19865. "../scene/SceneRenderer": 158,
  19866. "../settings": 166,
  19867. "../tile/TileUtils": 174,
  19868. "../util/ajax": 181,
  19869. "../util/common": 185,
  19870. "../util/lerp": 188,
  19871. "../util/logger": 189,
  19872. "../util/panorama": 191,
  19873. "../util/texture": 194,
  19874. "../util/transitions": 195,
  19875. events: 202,
  19876. three: 217
  19877. }],
  19878. 149: [function(e, t, i) {
  19879. "use strict";
  19880. function n(e) {
  19881. var t = r.UniformsUtils.clone(c.waypoint.uniforms);
  19882. t.map.value = d,
  19883. t.opacity.value = 0,
  19884. t.color.value.set(o.reticuleColor),
  19885. t.showMouseMarker = !window.MP_PREFETCHED_MODELDATA.hideMouseMarker;
  19886. r.Mesh.call(this, new r.PlaneBufferGeometry(.4,.4,1,1), new r.RawShaderMaterial({
  19887. side: r.DoubleSide,
  19888. depthWrite: !1,
  19889. depthTest: !1,
  19890. transparent: !0,
  19891. vertexShader: c.waypoint.vertexShader,
  19892. fragmentShader: c.waypoint.fragmentShader,
  19893. uniforms: t,
  19894. name: "waypoint",
  19895. opacity: 0,
  19896. visible: t.showMouseMarker // 显示/隐藏鼠标标志
  19897. })),
  19898. this.layers.set(h.RETICULE),
  19899. this.renderOrder = u.reticule,
  19900. this.player = e,
  19901. this.direction = new r.Vector3,
  19902. this.hidden = !0,
  19903. this.mouseLastMoveTime = Date.now()
  19904. }
  19905. var r = e("three")
  19906. , o = e("../settings")
  19907. , a = e("../util/transitions")
  19908. , s = e("../util/texture")
  19909. , l = e("../util/lerp")
  19910. , c = e("../shaders")
  19911. , h = e("../enum/RenderLayers")
  19912. , u = e("../enum/RenderOrder")
  19913. , d = s.load("images/reticule-256x256.png");
  19914. n.prototype = Object.create(r.Mesh.prototype),
  19915. n.prototype.move = function(e, t, i) {
  19916. this.hidden = i,
  19917. this.mouseLastMoveTime = Date.now()
  19918. }
  19919. ,
  19920. n.prototype.hide = function() {
  19921. this.hidden || (this.hidden = !0,
  19922. a.start(l.property(this.material.uniforms.opacity, "value", 0), o.reticuleOpacityTransitionTime))
  19923. }
  19924. ,
  19925. n.prototype.show = function() {
  19926. this.hidden = !1,
  19927. this.material.opacity <= 0 && a.start(l.property(this.material.uniforms.opacity, "value", o[this.player.mode].reticuleOpacity), o.reticuleOpacityTransitionTime)
  19928. }
  19929. ,
  19930. n.prototype.update = function() {
  19931. Date.now() - this.mouseLastMoveTime > o.hideReticuleTimeout && !this.hidden && this.hide()
  19932. }
  19933. ,
  19934. n.prototype.updatePosition = function(e, t) {
  19935. if (!this.hidden) {
  19936. if (!t)
  19937. return this.hide();
  19938. var i = t.point
  19939. , n = e.distanceTo(i)
  19940. , r = 1 + .01 * n;
  19941. n < 1 && (r -= 1 - n),
  19942. this.show(),
  19943. this.scale.set(r, r, r),
  19944. this.direction = this.direction.multiplyScalar(.8),
  19945. this.direction.add(t.face.normal.clone().multiplyScalar(.2)),
  19946. this.position.copy(i).add(t.face.normal.clone().multiplyScalar(.01)),
  19947. this.lookAt(this.position.clone().add(this.direction))
  19948. }
  19949. }
  19950. ,
  19951. n.prototype.writeAstag = function() {
  19952. var e = Math.floor(4294967296 * (1 + Math.random())).toString(16) + Math.floor(16 * (1 + Math.random())).toString(16)
  19953. , t = new Date;
  19954. this.tagCount = "undefined" == typeof this.tagCount ? 1 : this.tagCount + 1;
  19955. var i = {
  19956. enabled: !0,
  19957. version: "0",
  19958. created: t.toISOString(),
  19959. created_by: "APITest",
  19960. position: this.position.clone(),
  19961. stem: {
  19962. enabled: o.tags.pole.enabled,
  19963. direction: this.direction.multiplyScalar(o.tags.pole.height)
  19964. },
  19965. label: "tag " + this.tagCount,
  19966. description: "Description " + e,
  19967. floor: function(e) {
  19968. if (e.currentFloor) {
  19969. var t = e.floors.indexOf(e.currentFloor);
  19970. return t > -1 ? t : void 0
  19971. }
  19972. }(this.player.model),
  19973. type: "info",
  19974. metadata: {
  19975. preferred_camera: {
  19976. mode: this.player.mode
  19977. }
  19978. }
  19979. };
  19980. console.log("--------------------------"),
  19981. console.log(JSON.stringify(i));
  19982. var n = this.player.model.addtag(e, i).build();
  19983. n && (n.disc && this.player.tagDiscs.push(n.disc),
  19984. n.visible || n.show(o.tags.startup.fadeInDuration))
  19985. }
  19986. ,
  19987. t.exports = n
  19988. }
  19989. , {
  19990. "../enum/RenderLayers": 41,
  19991. "../enum/RenderOrder": 42,
  19992. "../settings": 166,
  19993. "../shaders": 167,
  19994. "../util/lerp": 188,
  19995. "../util/texture": 194,
  19996. "../util/transitions": 195,
  19997. three: 217
  19998. }],
  19999. 150: [function(e, t, i) {
  20000. "use strict";
  20001. function n(e, t) {
  20002. this.chunks = [],
  20003. this.floorId = e,
  20004. this.roomId = t,
  20005. this.position = new r.Vector3
  20006. }
  20007. var r = e("three");
  20008. n.prototype.addChunk = function(e) {
  20009. this.chunks.push(e)
  20010. }
  20011. ,
  20012. n.prototype.calcBoundaries = function() {
  20013. 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++) {
  20014. var s = this.chunks[a]
  20015. , l = s.geometry.attributes.position;
  20016. if (l)
  20017. for (var c = 0; c < l.array.length; c += 3)
  20018. e.set(l.array[c], l.array[c + 1], l.array[c + 2]),
  20019. t.add(e),
  20020. 0 === c ? (i.copy(e),
  20021. n.copy(e)) : (i.max(e),
  20022. n.min(e)),
  20023. o++
  20024. }
  20025. o > 0 ? (t.multiplyScalar(1 / o),
  20026. this.average = t) : this.average = null,
  20027. this.boundsMax = i,
  20028. this.boundsMin = n,
  20029. this.center = new r.Vector3,
  20030. this.center.copy(i).sub(n).multiplyScalar(.5).add(n)
  20031. }
  20032. ,
  20033. t.exports = n
  20034. }
  20035. , {
  20036. three: 217
  20037. }],
  20038. 151: [function(e, t, i) {
  20039. (function(i) {
  20040. "use strict";
  20041. function n(e, t, i) {
  20042. this.obj3d = null,
  20043. this.nodes = [],
  20044. this.colorHull = [],
  20045. this.shortPaths = {},
  20046. this.floorHull = null,
  20047. this.cameraHull = null,
  20048. this.floorPathDistance = 0,
  20049. this.floorCurvePoints = null,
  20050. this.floorCurveColors = null,
  20051. this.camCurvePoints = null,
  20052. this.warpDestHeroLoc = null,
  20053. this.warpDestPano = null,
  20054. this.warpPathPoints = null,
  20055. this.warpPathLengths = [0],
  20056. this.warpLength = 0,
  20057. this.closeWarpDistance = 4,
  20058. this.UP = A.UP.clone(),
  20059. this.longestStep = 0,
  20060. this.upcomingTransType = null,
  20061. this.burnsDir = 1, //导览在DOLLHOUSE停留时的旋转方向 1 或 -1
  20062. this.prevNextDist = 0,
  20063. this.nextI = 0,
  20064. this.activeTransType = null,
  20065. this.lastTransType = null,
  20066. this.bunnyObj = null,
  20067. this.director = e,
  20068. this.player = t,
  20069. this.playerControls = i,
  20070. this.modelManager = t.modelManager,
  20071. this.updateModel(),
  20072. this.updateDefaultsFromModelData(),
  20073. this.bindEvents(),
  20074. this.warping = !1,
  20075. this.waitingToWarp = !1,
  20076. this.warpInterrupted = !1,
  20077. this.warpInterruptionBlackoutStyle = null,
  20078. this.warpInterruptionTravelTime = null
  20079. }
  20080. var r = e("three")
  20081. , o = e("../util/logger")
  20082. , a = e("../enum/Viewmode")
  20083. , s = e("../enum/RenderOrder")
  20084. , l = e("../enum/WarpStyle")
  20085. , c = e("../settings")
  20086. , h = e("../util/math")
  20087. , u = e("../util/lerp")
  20088. , d = e("../util/easing")
  20089. , p = e("../util/transitions")
  20090. , f = e("../objects/Snapshot")
  20091. , g = e("../effects")
  20092. , m = e("../shaders")
  20093. , v = (e("../gui/gui"),
  20094. e("../util/texture"))
  20095. , A = e("../enum/Vectors")
  20096. , y = (e("../model/ModelManager"),
  20097. new o(i))
  20098. , C = e("../enum/PlayerEvents")
  20099. , I = e("../enum/BlackoutStyle")
  20100. , E = e("../enum/ModelManagerEvents")
  20101. , b = e("../constants")
  20102. , w = {
  20103. 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"),
  20104. pathEnd: v.load("images/End.png"),
  20105. 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==")
  20106. };
  20107. n.prototype.setScene = function(e) {
  20108. this.createCpm(e),
  20109. this.createBunnyObj(e)
  20110. }
  20111. ,
  20112. n.prototype.updateModel = function() {
  20113. this.model = this.modelManager.getActiveModel()
  20114. }
  20115. ,
  20116. n.prototype.bindEvents = function() {
  20117. this.modelManager.on(E.ActiveModelChanged, this.updateModel.bind(this))
  20118. }
  20119. ,
  20120. n.prototype.updateDefaultsFromModelData = function() {
  20121. this.model.data
  20122. }
  20123. ,
  20124. n.prototype.pointPathDistance = function(e) {
  20125. for (var t = 0, i = 1; i < e.length; i += 1)
  20126. t += e[i - 1].distanceTo(e[i]);
  20127. return t
  20128. }
  20129. ,
  20130. n.prototype.pointPathLengths = function(e) {
  20131. for (var t = [0], i = 1; i < e.length; i += 1)
  20132. t.push(t[i - 1] + e[i - 1].distanceTo(e[i]));
  20133. return t
  20134. }
  20135. ,
  20136. n.prototype.interpAlongPath = function(e, t, i) {
  20137. var n, o = new r.Vector3, a = t[t.length - 1];
  20138. if (i < 1) {
  20139. n = i * a;
  20140. for (var s = 1; s < t.length; s += 1)
  20141. if (t[s] > n) {
  20142. var l = (n - t[s - 1]) / (t[s] - t[s - 1]);
  20143. return o.copy(e[s]),
  20144. o.sub(e[s - 1]),
  20145. o.multiplyScalar(l),
  20146. o.add(e[s - 1]),
  20147. o
  20148. }
  20149. } else
  20150. o.copy(e[e.length - 1]);
  20151. return o
  20152. }
  20153. ,
  20154. n.prototype.pathHeight = function() {
  20155. return this.player.mode !== a.FLOORPLAN ? c.path.height : c.path.outsideHeight
  20156. }
  20157. ,
  20158. n.prototype.createBunnyObj = function(e) {
  20159. this.bunnyObj || (this.bunnyObj = new r.AxisHelper(.1),
  20160. this.bunnyObj.visible = c.warp.showBunny),
  20161. this.bunnyObj.parent && this.bunnyObj.parent.remove(bunnyObj),
  20162. e.add(this.bunnyObj)
  20163. }
  20164. ,
  20165. n.prototype.createCpm = function(e) {
  20166. if (!this.currentPanoMarker) {
  20167. var t = this.makeWaypointObj(w.pathEnd, "Current");
  20168. t.material.uniforms.opacity.value = 0,
  20169. this.currentPanoMarker = {
  20170. mesh: t,
  20171. placed: !1
  20172. }
  20173. }
  20174. this.currentPanoMarker.mesh.parent && this.currentPanoMarker.mesh.parent.remove(this.currentPanoMarker.mesh),
  20175. this.placeCpm(),
  20176. this.currentPanoMarker.mesh.parent || e.add(this.currentPanoMarker.mesh)
  20177. }
  20178. ,
  20179. n.prototype.placeCpm = function() {
  20180. if (c.path.mapGuides && this.player.currentPano && this.player.currentPano.isAligned()) {
  20181. var e = this.player.currentPano.floor;
  20182. this.currentPanoMarker.mesh.parent !== this.player.currentPano.floor && (this.currentPanoMarker.mesh.parent && this.currentPanoMarker.mesh.parent.remove(this.currentPanoMarker.mesh),
  20183. e.add(this.currentPanoMarker.mesh)),
  20184. this.currentPanoMarker.mesh.position.copy(this.player.currentPano.floorPosition).sub(e.position),
  20185. this.currentPanoMarker.mesh.position.y += this.pathHeight(),
  20186. this.currentPanoMarker.placed = !0
  20187. } else
  20188. this.popOutCpm()
  20189. }
  20190. ,
  20191. n.prototype.fadeInCpm = function(e) {
  20192. 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)
  20193. }
  20194. ,
  20195. n.prototype.fadeOutCpm = function(e) {
  20196. p.start(u.property(this.currentPanoMarker.mesh.material.uniforms.opacity, "value", 0), e)
  20197. }
  20198. ,
  20199. n.prototype.popInCpm = function() {
  20200. c.path.mapGuides && this.currentPanoMarker.placed && this.fadeInCpm(2)
  20201. }
  20202. ,
  20203. n.prototype.popOutCpm = function() {
  20204. this.fadeOutCpm(2)
  20205. }
  20206. ,
  20207. n.prototype.brushPrefs = {
  20208. linewidth: 7,
  20209. strokeWidth: 15,
  20210. cvSegments: 48,
  20211. paveStep: .1,
  20212. paveWidth: .2,
  20213. lookBlendDist: 3,
  20214. maxTurn: r.Math.degToRad(2)
  20215. },
  20216. n.prototype.panoPathDistance = function(e) {
  20217. var t = this.model.panos;
  20218. if (!e || e.length < 2)
  20219. return 0;
  20220. for (var i = [], n = 0; n < e.length; n += 1)
  20221. i.push(t.get(e[n]).floorPosition);
  20222. return this.pointPathDistance(i)
  20223. }
  20224. ,
  20225. n.prototype.loadTileTexture = function(e) {
  20226. var t = v.load(e, function(t) {
  20227. t.wrapS = r.RepeatWrapping,
  20228. t.wrapT = r.RepeatWrapping,
  20229. t.needsUpdate = !0,
  20230. y.debug('path texture "' + e + '" is ready')
  20231. }, function() {
  20232. y.error('path texture "' + e + '" failed')
  20233. });
  20234. return t.mapping = r.UVMapping,
  20235. t
  20236. }
  20237. ,
  20238. n.prototype.buildWarpDestinationDescriptor = function(e, t, i, n, r, o) {
  20239. var a = {
  20240. cameraMode: n,
  20241. position: e,
  20242. quaternion: t,
  20243. panoId: i,
  20244. orthoZoom: o,
  20245. floorVisibility: r,
  20246. thumbUrl: null,
  20247. name: null
  20248. };
  20249. return new f(a)
  20250. }
  20251. ,
  20252. n.prototype.buildWarpDestinationDescriptorFromHero = function(e) {
  20253. return this.buildWarpDestinationDescriptor(e.position, e.quaternion, this.getHeroId(e), e.cameraMode, e.floorVisibility, e.orthoZoom)
  20254. }
  20255. ,
  20256. n.prototype.setWarpDestination = function(e) {
  20257. this.warpDestHeroLoc = e
  20258. }
  20259. ,
  20260. n.prototype.setWarpDestinationByHeroIndex = function(e) {
  20261. var t = this.getHeroDescriptorByHeroIndex(e);
  20262. return null !== t && (this.setWarpDestination(t),
  20263. !0)
  20264. }
  20265. ,
  20266. n.prototype.setWarpDestinationByPano = function(e, t) {
  20267. var i = this.model.panos.get(e.id);
  20268. return !!i && this.setWarpDestinationByPanoId(e.id, t)
  20269. }
  20270. ,
  20271. n.prototype.setWarpDestinationByPanoId = function(e, t) {
  20272. var i = this.model.panos.get(e);
  20273. if (i) {
  20274. t = t || new r.Quaternion;
  20275. var n = this.buildWarpDestinationDescriptor(i.position, t, i.id, "panorama", [], -1);
  20276. return this.setWarpDestination(n),
  20277. !0
  20278. }
  20279. return !1
  20280. }
  20281. ,
  20282. n.prototype.getHeroDescriptorByHeroIndex = function(e) {
  20283. var t = this.model.heroCount();
  20284. /* if (null !== this.warpDestHeroLoc && t < 2)
  20285. return y.info("ShowPath.getHeroDescriptorByHeroIndex() -> Only one hero location is available."),
  20286. this.model.getHeroDescriptorByIndex(0); */
  20287. var i = this.model.getHeroDescriptorByIndex(e);
  20288. if (i) {
  20289. var n = i.isPano() ? i.panoId : i.cameraMode;
  20290. y.debug('ShowPath.getHeroDescriptorByHeroIndex() -> New brush/warp destination: "' + n + '" out of ' + t + " choices.")
  20291. }
  20292. return i
  20293. }
  20294. ,
  20295. n.prototype.getHeroDescriptorByPano = function(e) {
  20296. var t = this.model.panos.get(e.id);
  20297. return t ? this.getHeroDescriptorByPanoId(e.id) : null
  20298. }
  20299. ,
  20300. n.prototype.getHeroDescriptorByPanoId = function(e) {
  20301. var t = this.getHeroIndexFromPanoId(e);
  20302. return this.getHeroDescriptorByHeroIndex(t)
  20303. }
  20304. ,
  20305. n.prototype.getHeroIndexFromPanoId = function(e) {
  20306. for (var t = 0; t < this.model.heroLocations.length; t++) {
  20307. var i = this.model.heroLocations[t]
  20308. , n = this.getHeroId(i);
  20309. if (n && n === e)
  20310. return t
  20311. }
  20312. return -1
  20313. }
  20314. ,
  20315. n.prototype.getHeroPano = function(e) {
  20316. if (null === e)
  20317. return y.warn("getHeroPano(): no destination"),
  20318. null;
  20319. var t = this.getHeroId(e)
  20320. , i = this.model.panos.get(t);
  20321. return void 0 === i && (i = null,
  20322. "" !== t && y.debug('unable to find pano "' + t + '"')),
  20323. i
  20324. }
  20325. ,
  20326. n.prototype.getHeroId = function(e) {
  20327. return e.panoId
  20328. }
  20329. ,
  20330. n.prototype.setWarpDestPano = function() {
  20331. return this.warpDestPano = this.getHeroPano(this.warpDestHeroLoc),
  20332. this.warpDestPano
  20333. }
  20334. ,
  20335. n.prototype.brushToWarpPano = function(e, t) {
  20336. if (this.discardPathObject(),
  20337. !this.setWarpDestPano())
  20338. return !1;
  20339. if (this.warpDestHeroLoc.cameraMode !== a.PANORAMA && y.warn("Can only brush from pano to pano"),
  20340. !this.warpDestPano)
  20341. return y.info("No brush"),
  20342. !1;
  20343. if (!this.player.currentPano)
  20344. return y.debug("No current pano, visibility undefined"),
  20345. !1;
  20346. if (!this.warpDestPano)
  20347. return y.info("No wPano, visibility undefined"),
  20348. !1;
  20349. if (!this.warpDestPano.isAligned())
  20350. return y.debug("Cannot brush to unaligned pano"),
  20351. !1;
  20352. var i = (e === l.STD || e === l.WALK) && c.path.mapGuides
  20353. , n = !0;
  20354. if (this.player.currentPano.id === this.warpDestPano.id)
  20355. y.debug("Already at destination pano");
  20356. else {
  20357. this.nodes = this.findShortestPath(this.player.currentPano, this.warpDestPano),
  20358. n = void 0 === this.nodes || null === this.nodes || this.nodes.length < 1,
  20359. this.obj3d = new r.Object3D,
  20360. y.debug('Brushing from "' + this.player.currentPano.id + '" to "' + this.warpDestPano.id + '" (' + (this.nodes ? this.nodes.length : 0) + ")"),
  20361. n ? (y.info('No "walkable" route, using fall-back warp style transition'),
  20362. e = t) : (this.setPathHulls(this.nodes),
  20363. this.setFloorCurves(),
  20364. 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)))),
  20365. this.player.currentPano.floor.add(this.obj3d);
  20366. var o = this.player.mode === a.DOLLHOUSE || this.player.mode === a.FLOORPLAN
  20367. , s = e === l.STD;
  20368. if (!n && (i || s)) {
  20369. if (o) {
  20370. var h = this.makeStartMarker(this.floorHull[0], this.floorCurvePoints);
  20371. this.obj3d.add(h)
  20372. }
  20373. var u = this.makeEndMarker(this.floorHull[this.floorHull.length - 1]);
  20374. this.obj3d.add(u)
  20375. }
  20376. this.appearSlow()
  20377. }
  20378. return this.upcomingTransType = e,
  20379. !n
  20380. }
  20381. ,
  20382. n.prototype.findShortestPath = function(e, t) {
  20383. if (!e || !t)
  20384. return null;
  20385. var i = c.warp.walkExtraPanosDistance
  20386. , n = e.id + ":" + t.id + ":" + i;
  20387. if (this.shortPaths.hasOwnProperty(n))
  20388. return this.shortPaths[n] ? this.shortPaths[n].slice() : null;
  20389. var r = t.id + ":" + e.id + ":" + i;
  20390. if (this.shortPaths.hasOwnProperty(r))
  20391. return this.shortPaths[r] ? this.shortPaths[r].slice().reverse() : null;
  20392. var o = this.model.panos.aStarSearch(e, t);
  20393. return this.model.panos.includeNodesNearPath(o, i),
  20394. this.shortPaths[n] = o ? o.slice() : null,
  20395. o
  20396. }
  20397. ,
  20398. n.prototype.makePathHulls = function(e) {
  20399. var t, i, n, r, o, a = 0, s = [], l = [], h = [], u = this.model.panos;
  20400. t = u.get(e[0]),
  20401. r = t.floor.floorIndex;
  20402. for (var d = 0; d < e.length; d += 1)
  20403. t = u.get(e[d]),
  20404. i = t.floorPosition.clone().sub(this.model.position),
  20405. i.y += this.pathHeight(),
  20406. s.push(i),
  20407. l.push(t.position.clone()),
  20408. n = t.floor.floorIndex,
  20409. h.push(n > r ? c.path.colorUp : n < r ? c.path.colorDown : c.path.color),
  20410. d > 0 && (o = l[d].distanceTo(l[d - 1]),
  20411. o > a && (a = o));
  20412. return a > this.longestStep && (this.longestStep = a,
  20413. y.debug("path contains " + a + " meter segment")),
  20414. {
  20415. floor: s,
  20416. camera: l,
  20417. color: h
  20418. }
  20419. }
  20420. ,
  20421. n.prototype.makeFloorCurves = function(e, t, i) {
  20422. var n = this.player.mode === a.PANORAMA ? c.path.waypointIndoorRadius : c.path.waypointRadius
  20423. , o = this.pointPathDistance(e) - 2 * n
  20424. , s = e.slice(0)
  20425. , l = s[1].clone().sub(s[0]);
  20426. l.y = 0,
  20427. l.normalize().multiplyScalar(n),
  20428. s[0] = (new r.Vector3).copy(s[0]).add(l),
  20429. l = s[s.length - 2].clone().sub(s[s.length - 1]),
  20430. l.y = 0,
  20431. l.normalize().multiplyScalar(n),
  20432. s[s.length - 1] = (new r.Vector3).copy(s[s.length - 1]).add(l);
  20433. var h = new r.CatmullRomCurve3(s)
  20434. , u = Math.floor(o / i);
  20435. u = 4 * Math.floor(u / 4),
  20436. u = Math.max(4, u);
  20437. for (var d, p, f, g = h.getSpacedPoints(u), m = [], v = new r.Vector3, A = 0; A < g.length; A += 1) {
  20438. f = 0,
  20439. d = g[A].distanceTo(e[0]);
  20440. for (var y = 1; y < e.length; y += 1)
  20441. v.copy(g[A]).sub(e[y]),
  20442. v.y *= 4,
  20443. p = v.length(),
  20444. p < d && (f = y);
  20445. m.push(t[f])
  20446. }
  20447. return {
  20448. distance: o,
  20449. points: g,
  20450. colors: m
  20451. }
  20452. }
  20453. ,
  20454. n.prototype.makeCameraCurvePoints = function(e, t) {
  20455. var i = this.pointPathDistance(e)
  20456. , n = new r.CatmullRomCurve3(e);
  20457. return n.getSpacedPoints(Math.max(2, Math.floor(i / t)))
  20458. }
  20459. ,
  20460. n.prototype.makeCameraCurveTangents = function(e, t) {
  20461. var i = this.pointPathDistance(e)
  20462. , n = new r.CatmullRomCurve3(e)
  20463. , o = Math.max(2, Math.floor(i / t));
  20464. o || (o = 5);
  20465. for (var a = [], s = 0; s <= o; s++)
  20466. a.push(n.getTangentAt(s / o));
  20467. return a
  20468. }
  20469. ,
  20470. n.prototype.setPathHulls = function(e) {
  20471. var t = this.makePathHulls(e);
  20472. this.floorHull = t.floor,
  20473. this.cameraHull = t.camera,
  20474. this.colorHull = t.color
  20475. }
  20476. ,
  20477. n.prototype.setFloorCurves = function() {
  20478. var e = this.makeFloorCurves(this.floorHull, this.colorHull, this.brushPrefs.paveStep);
  20479. this.floorPathDistance = e.distance,
  20480. this.floorCurvePoints = e.points,
  20481. this.floorCurveColors = e.colors
  20482. }
  20483. ,
  20484. n.prototype.setCameraCurvePoints = function() {
  20485. this.camCurvePoints = this.makeCameraCurvePoints(this.cameraHull, c.warp.stepFactor * this.brushPrefs.paveStep)
  20486. }
  20487. ,
  20488. n.prototype.chooseWarpPath = function(e) {
  20489. var t, i, n, o = this.playerControls.cameras[a.PANORAMA];
  20490. if (this.player.currentPano === this.warpDestPano || !e)
  20491. return this.warpPathPoints = null,
  20492. this.warpLength = 0,
  20493. !1;
  20494. this.nodes = this.findShortestPath(this.player.currentPano, this.warpDestPano),
  20495. void 0 === this.nodes || null === this.nodes || this.nodes.length < 1 ? (y.debug("warp path to unreachable node"),
  20496. t = this.warpDestPano.position.clone().sub(o.position),
  20497. i = t.clone().negate(),
  20498. t.multiplyScalar(.15).add(o.position),
  20499. i.multiplyScalar(.15).add(this.warpDestPano.position),
  20500. t.y = o.position.y,
  20501. i.y = this.warpDestPano.position.y,
  20502. n = new r.CubicBezierCurve3(o.position.clone(),t,i,this.warpDestPano.position.clone()),
  20503. this.warpPathPoints = n.getSpacedPoints(this.brushPrefs.cvSegments)) : (y.debug("follow warp path (path distance was " + this.nodes.length + " nodes, " + this.floorPathDistance + ")"),
  20504. this.setCameraCurvePoints(),
  20505. this.warpPathPoints = this.camCurvePoints.slice(0)),
  20506. this.warpLength = 0,
  20507. this.warpPathLengths = [0];
  20508. 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) {
  20509. s.copy(this.warpPathPoints[d - 1]).sub(this.warpPathPoints[d]);
  20510. var p = s.length();
  20511. s.y *= c.warp.climbEffort;
  20512. var f = s.length() / p;
  20513. if (d > 1) {
  20514. s.setY(0).normalize(),
  20515. l.copy(this.warpPathPoints[d - 2]).sub(this.warpPathPoints[d - 1]).setY(0).normalize();
  20516. var g = Math.min(1, s.dot(l))
  20517. , m = 1 + (c.warp.brakeStrength - 1) * (1 - r.Math.smoothstep(g, u, h));
  20518. f = Math.max(m, f)
  20519. }
  20520. this.warpLength += p * f,
  20521. this.warpPathLengths[d] = this.warpLength
  20522. }
  20523. return !0
  20524. }
  20525. ,
  20526. n.prototype.drawPathRibbon = function(e, t) {
  20527. this.bunnyObj.visible = c.warp.showBunny;
  20528. 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) {
  20529. h.copy(e[u]),
  20530. 0 === u ? h.sub(e[u + 1]) : h.sub(e[u - 1]).negate(),
  20531. h.normalize(),
  20532. n.crossVectors(h, A.UP),
  20533. n.multiplyScalar(i);
  20534. var d = (new r.Vector3).copy(e[u]).add(o);
  20535. d.sub(n),
  20536. l.vertices.push(d),
  20537. d = (new r.Vector3).copy(e[u]).add(o),
  20538. d.add(n),
  20539. l.vertices.push(d)
  20540. }
  20541. var p, f = 0;
  20542. for (u = 0; u < e.length - 1; u += 1) {
  20543. var g = 2 * u
  20544. , v = f;
  20545. f += e[u + 1].distanceTo(e[u]);
  20546. var y = f
  20547. , C = t[u]
  20548. , I = t[u + 1];
  20549. p = new r.Face3(g,g + 1,g + 2),
  20550. p.vertexColors = [new r.Color(C), new r.Color(C), new r.Color(I)],
  20551. l.faces.push(p),
  20552. l.faceVertexUvs[0].push([new r.Vector2(0,v), new r.Vector2(1,v), new r.Vector2(0,y)]),
  20553. p = new r.Face3(g + 2,g + 1,g + 3),
  20554. p.vertexColors = [new r.Color(I), new r.Color(C), new r.Color(I)],
  20555. l.faces.push(p),
  20556. l.faceVertexUvs[0].push([new r.Vector2(0,y), new r.Vector2(1,v), new r.Vector2(1,y)])
  20557. }
  20558. l.computeFaceNormals(),
  20559. l.computeVertexNormals();
  20560. var E, b;
  20561. this.player.mode === a.PANORAMA ? (b = r.UniformsUtils.clone(m.ribbon.uniforms),
  20562. b.map.value = w.path,
  20563. b.opacity.value = 0,
  20564. b.color.value.set(c.path.color),
  20565. E = new r.RawShaderMaterial({
  20566. side: r.DoubleSide,
  20567. depthWrite: !1,
  20568. transparent: !0,
  20569. vertexShader: m.ribbon.vertexShader,
  20570. fragmentShader: m.ribbon.fragmentShader,
  20571. uniforms: b,
  20572. name: "ribbonT",
  20573. opacity: 0
  20574. })) : E = new r.MeshBasicMaterial({
  20575. color: 16777215,
  20576. side: r.DoubleSide,
  20577. name: "ribbonOut",
  20578. vertexColors: r.VertexColors
  20579. });
  20580. var _ = new r.Mesh(l,E);
  20581. return _.name = "ribbon",
  20582. this.player.mode === a.PANORAMA && (_.renderOrder = s.ribbon),
  20583. _
  20584. }
  20585. ,
  20586. n.prototype.drawPathPavement = function(e) {
  20587. for (var t, i = .25, n = new r.Vector3, o = new r.Geometry, s = new r.Vector3, l = 0; l < e.length; l += 1)
  20588. s.copy(e[l]),
  20589. 0 === l ? s.sub(e[l + 1]).negate() : s.sub(e[l - 1]),
  20590. s.normalize(),
  20591. n.crossVectors(s, A.UP),
  20592. n.multiplyScalar(this.brushPrefs.paveWidth),
  20593. t = (new r.Vector3).copy(e[l]),
  20594. t.sub(n),
  20595. o.vertices.push(t),
  20596. o.vertices.push((new r.Vector3).copy(e[l])),
  20597. t = (new r.Vector3).copy(e[l]),
  20598. t.add(n),
  20599. o.vertices.push(t);
  20600. var h, u, d;
  20601. for (l = 0; l < e.length - 1; l += 1)
  20602. h = 3 * l + 1,
  20603. u = l * i,
  20604. d = u + i,
  20605. o.faces.push(new r.Face3(h - 1,h,h + 3)),
  20606. o.faceVertexUvs[0].push([new r.Vector2(0,u), new r.Vector2(.5,u), new r.Vector2(.5,d)]),
  20607. o.faces.push(new r.Face3(h + 3,h + 2,h - 1)),
  20608. o.faceVertexUvs[0].push([new r.Vector2(.5,d), new r.Vector2(0,d), new r.Vector2(0,u)]),
  20609. o.faces.push(new r.Face3(h + 3,h,h + 1)),
  20610. o.faceVertexUvs[0].push([new r.Vector2(.5,d), new r.Vector2(.5,u), new r.Vector2(1,u)]),
  20611. o.faces.push(new r.Face3(h + 3,h + 1,h + 4)),
  20612. o.faceVertexUvs[0].push([new r.Vector2(.5,d), new r.Vector2(1,u), new r.Vector2(1,d)]);
  20613. var p = this.player.mode === a.PANORAMA ? new r.MeshBasicMaterial({
  20614. color: c.path.color,
  20615. side: r.DoubleSide,
  20616. transparent: !0,
  20617. depthWrite: !1,
  20618. opacity: 0,
  20619. name: "paveT",
  20620. map: w.path
  20621. }) : new r.MeshBasicMaterial({
  20622. color: c.path.color,
  20623. side: r.DoubleSide,
  20624. transparent: !0,
  20625. depthWrite: !1,
  20626. opacity: 1,
  20627. name: "paveO",
  20628. map: w.path
  20629. });
  20630. return new r.Mesh(o,p)
  20631. }
  20632. ,
  20633. n.prototype.hintPrefs = {
  20634. rad: .18,
  20635. width: .0125,
  20636. depth: .0625,
  20637. setBack: -.04,
  20638. markRad: .25,
  20639. markInnerRad: .16
  20640. },
  20641. n.prototype.makeWaypointObj = function(e, t) {
  20642. var i = new r.Geometry
  20643. , n = this.player.mode === a.PANORAMA ? c.path.waypointIndoorRadius : c.path.waypointRadius
  20644. , o = this.pathHeight();
  20645. 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)),
  20646. i.faces.push(new r.Face3(0,1,2), new r.Face3(2,3,0)),
  20647. i.faceVertexUvs[0].push([new r.Vector2(0,0), new r.Vector2(1,0), new r.Vector2(1,1)]),
  20648. i.faceVertexUvs[0].push([new r.Vector2(1,1), new r.Vector2(0,1), new r.Vector2(0,0)]);
  20649. var s = r.UniformsUtils.clone(m.waypoint.uniforms);
  20650. s.map.value = e,
  20651. s.opacity.value = 0,
  20652. s.color.value.set(c.path.color);
  20653. var l = {
  20654. side: r.DoubleSide,
  20655. depthWrite: !1,
  20656. transparent: !0,
  20657. vertexShader: m.waypoint.vertexShader,
  20658. fragmentShader: m.waypoint.fragmentShader,
  20659. uniforms: s,
  20660. name: "waypoint",
  20661. opacity: 0
  20662. };
  20663. this.player.mode !== a.PANORAMA && (l.depthTest = !1,
  20664. l.name = "wayPtOut");
  20665. var h = new r.RawShaderMaterial(l)
  20666. , u = new r.Mesh(i,h);
  20667. return u.name = t,
  20668. u
  20669. }
  20670. ,
  20671. n.prototype.makeStartMarker = function(e, t) {
  20672. var i = (new r.Vector3).copy(t[1]).sub(t[0]);
  20673. i.y = 0,
  20674. i.normalize();
  20675. var n = Math.acos(i.x)
  20676. , o = this.makeWaypointObj(w.pathStart, "Start");
  20677. return o.rotateOnAxis(new r.Vector3(0,1,0), n),
  20678. o.position.copy(e),
  20679. o
  20680. }
  20681. ,
  20682. n.prototype.makeEndMarker = function(e) {
  20683. var t = this.makeWaypointObj(w.pathEnd, "End")
  20684. , i = this.model.panos.get(this.nodes[0]).floor.floorIndex
  20685. , n = this.model.panos.get(this.nodes[this.nodes.length - 1]).floor.floorIndex;
  20686. return i < n ? t.material.uniforms.color.value.set(c.path.colorUp) : i > n && t.material.uniforms.color.value.set(c.path.colorDown),
  20687. t.position.copy(e),
  20688. t
  20689. }
  20690. ,
  20691. n.prototype.pathClean = function(e) {
  20692. if (e) {
  20693. for (var t in e.children)
  20694. this.pathClean(e.children[t]);
  20695. e.geometry && e.geometry.dispose(),
  20696. e.material && e.material.dispose()
  20697. }
  20698. }
  20699. ,
  20700. n.prototype.discardPathObject = function() {
  20701. if (this.obj3d) {
  20702. var e = this.obj3d.parent;
  20703. e && e.remove(this.obj3d),
  20704. this.pathClean(this.obj3d)
  20705. }
  20706. this.obj3d = null,
  20707. this.popInCpm()
  20708. }
  20709. ,
  20710. n.prototype.discardSlow = function() {
  20711. if (this.obj3d) {
  20712. if (this.player.mode !== a.PANORAMA)
  20713. return void this.discardPathObject();
  20714. for (var e, t = this, i = 0, n = function() {
  20715. this.discardPathObject()
  20716. }
  20717. .bind(this), r = 0; r < t.obj3d.children.length; r += 1)
  20718. e = t.obj3d.children[r],
  20719. 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]),
  20720. i += 1,
  20721. n = null);
  20722. 0 === i && this.discardPathObject(),
  20723. this.player.mode !== a.PANORAMA && this.fadeInCpm(c.path.fadeInTime - 3)
  20724. }
  20725. }
  20726. ,
  20727. n.prototype.appearSlow = function() {
  20728. var e, t = this;
  20729. this.fadeOutCpm(c.path.fadeInTime);
  20730. for (var i = this.player.mode === a.PANORAMA ? c.path.opacity : 1, n = 0; n < t.obj3d.children.length; n += 1)
  20731. e = t.obj3d.children[n],
  20732. 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]))
  20733. }
  20734. ,
  20735. n.prototype.update = function() {
  20736. this.obj3d && this.obj3d.updateMatrixWorld()
  20737. }
  20738. ,
  20739. n.prototype.calcBurnsAmount = function(e) {//计算导览点旋转角
  20740. var t = r.Math.degToRad(c.warp.burnsAngle);
  20741. if (this.player.mode === a.PANORAMA) {
  20742. var i = this.burnsDir * t;
  20743. if (this.upcomingTransType === l.BLACK)
  20744. return i;
  20745. var n = e;
  20746. if (null === n)
  20747. return y.warn("Transition request for non-highlight"),
  20748. i;
  20749. var o = this.getHeroDescriptorByHeroIndex(n);
  20750. if (null === o)
  20751. return i;
  20752. if (!o.isPano())
  20753. return i;
  20754. var s = this.getHeroPano(o)
  20755. , h = this.playerControls.cameras[a.PANORAMA]
  20756. , u = A.FORWARD.clone().applyQuaternion(h.quaternion).setY(0).normalize()
  20757. , d = Math.min(r.Math.degToRad(c.warp.minBurnsAngle), t)
  20758. , p = function(e) {
  20759. var i = Math.acos(Math.min(1, e.dot(u)))
  20760. , n = (new r.Vector3).crossVectors(u, e);
  20761. return Math.max(d, Math.min(Math.abs(i), t)) * Math.sign(n.y)
  20762. };
  20763. if (s === this.player.currentPano)
  20764. return i = p(A.FORWARD.clone().applyQuaternion(o.quaternion).setY(0).normalize());
  20765. var f = this.findShortestPath(this.player.currentPano, s);
  20766. if (void 0 === f || null === f || f.length < 1)
  20767. return y.debug("Empty path ahead..."),
  20768. i;
  20769. var g = this.makePathHulls(f)
  20770. , m = new r.CatmullRomCurve3(g.camera)
  20771. , v = Math.min(.1, c.warp.lookAheadDist / m.getLength());
  20772. return i = p(m.getPointAt(v).clone().sub(h.position).setY(0).normalize())
  20773. }
  20774. return this.player.mode === a.DOLLHOUSE ? .02 * this.burnsDir : this.burnsDir
  20775. }
  20776. ,
  20777. n.prototype.waitNextStep = function(e, t, time) {//xzw 改时间
  20778. var i = (time==void 0)? c.warp.tourStepDelay : time;
  20779. i || (i = this.lastTransType === l.BLACK ? b.tourStepDelaySlideShow : b.tourStepDelayDefault);
  20780. var n = new r.Euler
  20781. , o = new r.Vector3;
  20782. y.debug("Starting wait: " + (void 0 !== t));
  20783. var s = this.calcBurnsAmount(e)
  20784. , h = function() {
  20785. this.endWarpState(),
  20786. this.player.mode === a.DOLLHOUSE && (this.playerControls.cameras[a.DOLLHOUSE].controls.rotationAcceleration.x = 0),
  20787. t && t()
  20788. }
  20789. .bind(this)
  20790. , u = function(e, t) {
  20791. if (this.warpInterrupted)
  20792. return h(),
  20793. !0;
  20794. var r = t || 1e3 / 60;
  20795. if (c.warp.doBurns)
  20796. if (this.player.mode === a.PANORAMA) {
  20797. var l = this.playerControls.cameras[a.PANORAMA];
  20798. n.setFromQuaternion(l.quaternion, c.warp.eOrder);
  20799. var u = r * s / i;
  20800. //u = Math.sign(u) * Math.max(u, 0.0001) //add 如果音频长的话,使旋转可见,否则以为停住了
  20801. n.y += u,
  20802. o.set(0, 0, -1),
  20803. o.applyEuler(n),
  20804. o.add(l.position),
  20805. l.controls.lookAt(o),
  20806. l.controls.lookVector.copy(o)
  20807. ,l.lookAt(o)
  20808. } else
  20809. this.player.mode === a.DOLLHOUSE ? this.playerControls.controls[a.DOLLHOUSE].rotationAcceleration.x = s : this.playerControls.controls[a.FLOORPLAN].absoluteScale *= .9996
  20810. }
  20811. .bind(this);
  20812. this.startWarpState(),
  20813. p.start(u, i, h, 0, d.easeInOutQuad, "wait")
  20814. }
  20815. ,
  20816. n.prototype.warpToNonPano = function(e) {
  20817. if (this.discardPathObject(),
  20818. this.warpDestHeroLoc.cameraMode === a.DOLLHOUSE || this.warpDestHeroLoc.cameraMode === a.FLOORPLAN) {
  20819. var t = function() {
  20820. e && e()
  20821. }
  20822. .bind(this);
  20823. this.player.flyToNewMode({
  20824. mode: this.warpDestHeroLoc.cameraMode,
  20825. duration: c.warp.outsideTime,
  20826. warpDest: this.warpDestHeroLoc,
  20827. callback: t,
  20828. force: !0
  20829. })
  20830. } else
  20831. y.warn("no warp destination!!!"),
  20832. e && e()
  20833. }
  20834. ,
  20835. n.prototype._resetWarpShaderParams = function(e) {//
  20836. this.player.mode === a.PANORAMA && (void 0 !== e.material.uniforms.blackout && (e.material.uniforms.blackout.value = 0),
  20837. void 0 !== e.material.uniforms.modelAlpha && (e.material.uniforms.modelAlpha.value = 0))
  20838. /* if(momentTourBlackNewType && "newBlack" in e.material.defines){
  20839. delete e.material.defines.newBlack;
  20840. e.material.needsUpdate = true
  20841. } */
  20842. }
  20843. ,
  20844. n.prototype._clearWarpShading = function() {
  20845. for (var e = this.model.chunks, t = 0; t < e.length; t += 1)
  20846. this._resetWarpShaderParams(e[t]),
  20847. e[t].visible = !0;
  20848. this._resetWarpShaderParams(this.model.skybox)
  20849. }
  20850. ,
  20851. n.prototype._warpStopFlying = function() {
  20852. this.activeTransType = null,
  20853. this.placeCpm()
  20854. }
  20855. ,
  20856. n.prototype._wrapupTravelOnlyBits = function() {
  20857. this._warpStopFlying(),
  20858. this.warpPathPoints && (this.player.currentPano.exit(),
  20859. this.warpDestPano.enter(),
  20860. this.player.currentPano = this.warpDestPano),
  20861. this.player.spider.draw(),
  20862. this.placeCpm()
  20863. }
  20864. ,
  20865. n.prototype._wrapupTravel = function(e) {
  20866. this._wrapupTravelOnlyBits(),
  20867. this.warpCameraAim(e)
  20868. }
  20869. ,
  20870. n.prototype._wrapupWarpShading = function(e) {
  20871. this._clearWarpShading(),
  20872. this._wrapupTravel(e)
  20873. }
  20874. ,
  20875. n.prototype.wrapupWarpShadingOnly = function(e, t) {
  20876. t !== I.END && this._clearWarpShading(),
  20877. this._wrapupTravelOnlyBits(),
  20878. this.upcomingTransType = null,
  20879. e && e()
  20880. }
  20881. ,
  20882. n.prototype._warpCameraAim = function(e, t) {//到每个片段终点时转向终点朝向。
  20883. var i = this.warpDestHeroLoc.quaternion
  20884. , n = this.playerControls.cameras[a.PANORAMA]
  20885. , o = new r.Vector3(0,0,1).applyQuaternion(i).normalize()
  20886. , s = new r.Vector3(0,0,1).applyQuaternion(n.quaternion).normalize()
  20887. , l = s.dot(o)
  20888. , u = r.Math.radToDeg(Math.acos(l))
  20889. , f = new r.Euler(0,0,0,c.warp.eOrder).setFromQuaternion(i, c.warp.eOrder)
  20890. , g = (new r.Euler).setFromQuaternion(n.quaternion, c.warp.eOrder)
  20891. , m = new r.Euler(f.x - g.x,f.y - g.y,f.z - g.z,c.warp.eOrder);
  20892. m.y = h.constrainedTurn(m.y),
  20893. this.burnsDir = Math.sign(m.y);
  20894. var v = new r.Euler(0,0,0,c.warp.eOrder)
  20895. , A = new r.Vector3
  20896. , C = function(e, t) {
  20897. return !!this.warpInterrupted || (v.x = g.x + e * m.x,
  20898. v.y = g.y + e * m.y,
  20899. v.z = g.z + e * m.z,
  20900. A.set(0, 0, -1),
  20901. A.applyEuler(v),
  20902. A.add(n.position),
  20903. n.controls.lookAt(A),
  20904. n.controls.lookVector.copy(A),
  20905. void n.lookAt(A))
  20906. }
  20907. .bind(this);
  20908. /* return u > c.warp.minRotation ? (p.start(C, e, t, 0, d[c.warp.movementEasing])
  20909. ,(this.warpDestHeroLoc.zoom != this.player.zoomLevel) && //add 原地转向最终方位时
  20910. this.player.smoothZoomFovTo(null, this.warpDestHeroLoc.zoom , e)
  20911. ):
  20912. (y.info("Aim angle only is " + u.toPrecision(3) + " degrees, skipping explicit re-aim")
  20913. ,void (t && t())
  20914. ) */
  20915. (this.warpDestHeroLoc.zoom != this.player.zoomLevel) && //add 原地转向最终方位时
  20916. this.player.smoothZoomFovTo(null, this.warpDestHeroLoc.zoom , e)
  20917. return u > c.warp.minRotation ? p.start(C, e, t, 0, d[c.warp.movementEasing]) :
  20918. (y.info("Aim angle only is " + u.toPrecision(3) + " degrees, skipping explicit re-aim")
  20919. ,void (t && t())
  20920. )
  20921. }
  20922. ,
  20923. n.prototype._warpBendAim = function(e, t, i, n) {
  20924. var o = n || 0
  20925. , s = this.playerControls.cameras[a.PANORAMA]
  20926. , l = new r.Euler(0,0,0,c.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, c.warp.eOrder)
  20927. , u = (new r.Euler).setFromQuaternion(s.quaternion, c.warp.eOrder)
  20928. , f = new r.Euler(l.x - u.x,l.y - u.y,l.z - u.z,c.warp.eOrder);
  20929. f.y = h.constrainedTurn(f.y);
  20930. var g = Math.min(r.Math.degToRad(c.warp.softBendTilt), Math.abs(f.x));
  20931. f.x = g * Math.sign(f.x),
  20932. g = Math.min(r.Math.degToRad(Math.max(0, c.warp.softBendAngle)), g),
  20933. this.burnsDir = Math.sign(f.y),
  20934. g *= Math.sign(f.y),
  20935. f.y = g;
  20936. var m = new r.Euler(0,0,0,c.warp.eOrder)
  20937. , v = new r.Vector3
  20938. , A = function(e, t) {
  20939. if (e < .5)
  20940. m.x = u.x + e * f.x,
  20941. m.y = u.y + e * f.y,
  20942. m.z = u.z + e * f.z;
  20943. else {
  20944. var i = (1 - e) * c.warp.softBendEnd;
  20945. m.x = l.x - i * f.x,
  20946. m.y = l.y - i * f.y,
  20947. m.z = l.z - i * f.z
  20948. }
  20949. v.set(0, 0, -1),
  20950. v.applyEuler(m),
  20951. v.add(s.position);
  20952. s.controls.lookAt(v),
  20953. s.controls.lookVector.copy(v),
  20954. s.lookAt(v);
  20955. }
  20956. .bind(this);
  20957. if(momentTourBlackNewType){
  20958. A(1)
  20959. }else return p.start(A, t, i, o, d[c.warp.movementEasing])
  20960. }
  20961. ,
  20962. n.prototype._warpStepCameraAim = function(e, t, i) {
  20963. var n = this.playerControls.cameras[a.PANORAMA]
  20964. , o = new r.Euler(0,0,0,c.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, c.warp.eOrder)
  20965. , s = (new r.Euler).setFromQuaternion(n.quaternion, c.warp.eOrder)
  20966. , l = new r.Euler(o.x - s.x,o.y - s.y,o.z - s.z,c.warp.eOrder);
  20967. l.y = h.constrainedTurn(l.y),
  20968. this.burnsDir = Math.sign(l.y);
  20969. var u = new r.Euler(0,0,0,c.warp.eOrder)
  20970. , f = new r.Vector3
  20971. , g = function(e, t) {
  20972. e < .5 ? u.copy(s) : u.copy(o),
  20973. f.set(0, 0, -1),
  20974. f.applyEuler(u),
  20975. f.add(n.position),
  20976. n.controls.lookAt(f),
  20977. n.controls.lookVector.copy(f),
  20978. n.lookAt(f)
  20979. }
  20980. .bind(this);
  20981. return p.start(g, t, i, 0, d[c.warp.movementEasing])
  20982. }
  20983. ,
  20984. n.prototype.setBurnsDir = function() {
  20985. var e = this.playerControls.cameras[a.PANORAMA]
  20986. , t = new r.Euler(0,0,0,c.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, c.warp.eOrder)
  20987. , i = (new r.Euler).setFromQuaternion(e.quaternion, c.warp.eOrder)
  20988. , n = new r.Euler(t.x - i.x,t.y - i.y,t.z - i.z,c.warp.eOrder);
  20989. n.y = h.constrainedTurn(n.y),
  20990. this.burnsDir = Math.sign(n.y)
  20991. }
  20992. ,
  20993. n.prototype.stepWarpPath = function(e, t) {
  20994. var i = this.playerControls.cameras[a.PANORAMA];
  20995. if (!this.warpPathPoints)
  20996. return i.position.copy(this.warpDestPano.position),
  20997. !0;
  20998. var n = this.warpPathPoints[0]
  20999. , o = this.warpDestPano.position;
  21000. if (null !== this.nodes && this.cameraHull.length > 1) {
  21001. var s = new r.Vector3;
  21002. 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),
  21003. i.position.copy(s)
  21004. } else
  21005. e < .5 ? i.position.copy(n) : i.position.copy(o)
  21006. }
  21007. ,
  21008. n.prototype.interruptAndFastForward = function(e, t) {
  21009. this.warping && (this.warpInterrupted = !0,
  21010. this.warpInterruptionBlackoutStyle = e,
  21011. this.warpInterruptionTravelTime = t,
  21012. null !== this.warpInterruptionBlackoutStyle && void 0 !== this.warpInterruptionBlackoutStyle || (this.warpInterruptionBlackoutStyle = I.MIDDLE),
  21013. null !== this.warpInterruptionTravelTime && void 0 !== this.warpInterruptionTravelTime || (this.warpInterruptionTravelTime = c.minWarpTime))
  21014. }
  21015. ,
  21016. n.prototype.warpCameraAim = function(e) {
  21017. var t = c.warp.minWarpTime;
  21018. if (this.upcomingTransType === l.BLACK)
  21019. t = c.warp.teleportTime;
  21020. else {
  21021. var i = this.playerControls.cameras[a.PANORAMA]
  21022. , n = new r.Euler(0,0,0,c.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, c.warp.eOrder)
  21023. , o = (new r.Euler).setFromQuaternion(i.quaternion, c.warp.eOrder)
  21024. , s = new r.Euler(n.x - o.x,n.y - o.y,n.z - o.z,c.warp.eOrder);
  21025. s.y = h.constrainedTurn(s.y);
  21026. var u = 1e3 * Math.abs(s.y) / r.Math.degToRad(c.warp.maxAimPerSec);
  21027. t = Math.max(t, u)
  21028. }
  21029. var d = function() {
  21030. this._warpStopFlying(),
  21031. this.discardSlow(),
  21032. e && e()
  21033. }
  21034. .bind(this);
  21035. this._warpCameraAim(t, d)
  21036. }
  21037. ,
  21038. n.prototype.warpCommonParameters = function(e, t, i, n) {
  21039. this.model.skybox.material.uniforms.blackout.value = n;
  21040. var r = u.uniform(this.model.skybox, "progress", 1)
  21041. , o = u.allUniforms(this.model.chunks, "progress", 1)
  21042. , a = !1
  21043. , s = function() {
  21044. if (this.warpInterrupted)
  21045. return a = !0,
  21046. !0
  21047. }
  21048. .bind(this)
  21049. , l = function(e, t) {
  21050. return i && a ? (this.model.skybox.material.uniforms.progress.value = 0,
  21051. !0) : void r(e, t)
  21052. }
  21053. .bind(this)
  21054. , h = function(e, t) {
  21055. return i && a ? (o(0),
  21056. !0) : void o(e, t)
  21057. }
  21058. .bind(this);
  21059. p.start(s, e, null, t, null, "safeHaltWatch"),
  21060. p.start(l, e, null, t, d[c.warp.blendEasing], "skyboxProgress"),
  21061. p.start(h, e, null, t, d[c.warp.blendEasing], "chunkProgress")
  21062. }
  21063. ,
  21064. n.prototype.warpTravel_STD = function(e) {
  21065. 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),
  21066. 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;
  21067. w += this.warpLength * c.warp.timePerMeter,
  21068. c.warp.flySpeed > .01 && (w = 1e3 * this.warpLength / c.warp.flySpeed);
  21069. var _ = !1
  21070. , T = this.warpDestHeroLoc.quaternion
  21071. , x = new r.Vector3(0,0,-1).applyQuaternion(T).normalize()
  21072. , S = this.warpPathPoints[this.warpPathPoints.length - 1].clone().sub(this.warpPathPoints[this.warpPathPoints.length - 2]).normalize()
  21073. , M = S.dot(x)
  21074. , R = r.Math.radToDeg(Math.acos(M))
  21075. , P = function(e) {
  21076. var t = o
  21077. , i = r.Math.smoothstep(e, 0, t) * (1 - r.Math.smoothstep(e, 1 - t, 1));
  21078. return i
  21079. }
  21080. , O = function() {
  21081. return E.lookAt(C, t, A.UP),
  21082. s.setFromRotationMatrix(E, c.warp.eOrder),
  21083. m.setFromQuaternion(n.quaternion, c.warp.eOrder),
  21084. b.set(s.x - m.x, s.y - m.y, s.z - m.z, c.warp.eOrder),
  21085. h.constrainedTurn(b.y)
  21086. }
  21087. .bind(this)
  21088. , L = function(e, t) {
  21089. if (this.warpInterrupted)
  21090. return _ = !0,
  21091. !0
  21092. }
  21093. .bind(this)
  21094. , D = function(e, t) {
  21095. return _ || !this.warpPathPoints ? (g.blur(0),
  21096. !0) : void g.blur(e)
  21097. }
  21098. .bind(this)
  21099. , N = u.allUniforms(this.model.chunks, "modelAlpha", 1)
  21100. , B = function(e, t) {
  21101. return _ || !this.warpPathPoints ? (N(0),
  21102. !0) : void N(e, t)
  21103. }
  21104. .bind(this)
  21105. , F = function(e, t) {
  21106. if (!this.warpPathPoints)
  21107. return n.position.copy(this.warpDestPano.position),
  21108. !0;
  21109. if (_)
  21110. return !0;
  21111. var i = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, e);
  21112. n.position.copy(i),
  21113. C = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, .99 * e)
  21114. }
  21115. .bind(this)
  21116. , V = function(e, n) {
  21117. return this.warpPathPoints ? !!_ || void (t = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, Math.min(e + i, 1))) : (y.debug("Lost bunny."),
  21118. !0)
  21119. }
  21120. .bind(this)
  21121. , U = function(e, o) {
  21122. if (_)
  21123. return y.debug(">>>> Walkthrough interupted at t=" + e),
  21124. !0;
  21125. if (!this.warpPathPoints)
  21126. return !0;
  21127. var a = this.warpLength * e
  21128. , l = r.Math.smoothstep(a, 0, this.brushPrefs.lookBlendDist)
  21129. , u = r.Math.smoothstep(a, this.warpLength - this.brushPrefs.lookBlendDist, this.warpLength);
  21130. c.warp.matchCam && (l *= 1 - u),
  21131. E.lookAt(C, t, A.UP),
  21132. s.setFromRotationMatrix(E, c.warp.eOrder),
  21133. m.setFromQuaternion(n.quaternion, c.warp.eOrder),
  21134. b.set(s.x - m.x, s.y - m.y, s.z - m.z, c.warp.eOrder),
  21135. b.y = h.constrainedTurn(b.y),
  21136. s.x = m.x + l * b.x,
  21137. s.y = m.y + l * b.y,
  21138. s.z = m.z + l * b.z,
  21139. b.set(s.x - v.x, s.y - v.y, s.z - v.z, c.warp.eOrder),
  21140. b.y = h.constrainedTurn(b.y);
  21141. var d = r.Math.degToRad(c.warp.maxTurnPerSec) * o / 1e3;
  21142. b.y = Math.sign(b.y) * Math.min(d, Math.abs(b.y)),
  21143. v.x = v.x + b.x * c.warp.turnFriction,
  21144. v.y = v.y + b.y * c.warp.turnFriction,
  21145. v.z = v.z + b.z * c.warp.turnFriction,
  21146. v.x = Math.max(r.Math.degToRad(c.warp.minDownAngle), v.x);
  21147. var p = t.clone().sub(C).normalize();
  21148. if (R < c.warp.maxAimRotation && u > 0) {
  21149. var g = 1 - u;
  21150. p.x = p.x * g + u * S.x,
  21151. p.y = p.y * g + u * S.y,
  21152. p.z = p.z * g + u * S.z,
  21153. p.normalize()
  21154. }
  21155. this.bunnyObj.position.copy(n.position).add(p),
  21156. f.set(0, 0, -1).applyEuler(v).normalize(),
  21157. f.multiplyScalar(8),
  21158. f.add(n.position),
  21159. e > 1 - i && c.warp.matchCam || (n.controls.lookAt(f),
  21160. n.controls.lookVector.copy(f),
  21161. n.lookAt(f))
  21162. }
  21163. .bind(this)
  21164. , k = function() {
  21165. _ ? (this.discardSlow(),
  21166. this.upcomingTransType = l.BLACK,
  21167. this.warpTravel_BLACK(-.5, this.warpInterruptionTravelTime, I.BEGINNING, e)) : this._wrapupWarpShading(e)
  21168. }
  21169. .bind(this);
  21170. V(0);
  21171. var H = c.warp.motionLeadTime + 1e3 * Math.abs(O()) / r.Math.degToRad(c.warp.maxTurnPerSec);
  21172. w += H;
  21173. var G = H / w;
  21174. this.warpCommonParameters(w, G, !0, I.NONE),
  21175. p.start(L, w, null, 0, null, "_haltWatcher"),
  21176. c.warp.blur > 0 && (g.blurStrength = c.warp.blur,
  21177. p.start(D, w, null, G, P, "blurring")),
  21178. p.start(B, w, null, G, P, "modelAlpha"),
  21179. p.start(F, w, null, G, d[c.warp.blendEasing], "followPath"),
  21180. p.start(V, w, null, G, d[c.warp.blendEasing], "goBunny"),
  21181. p.start(U, w, k, 0, d[c.warp.blendEasing], "lookAtBunny")
  21182. }
  21183. ,
  21184. n.prototype.warpTravel_BLACK = function(e, t, i, n) {
  21185. var r = e || 0;
  21186. void 0 !== t && null !== t || (t = c.warp.teleportTime)
  21187. if(momentTourBlackNewType){
  21188. player.sceneRenderer.effects.transitionMaskPass.start(player.sceneRenderer)
  21189. var camera = this.playerControls.cameras[a.PANORAMA];
  21190. var end = this.warpDestHeroLoc.position
  21191. camera.position.copy(end)
  21192. setTimeout(()=>{
  21193. player.sceneRenderer.effects.transitionMaskPass.stop()
  21194. this.wrapupWarpShadingOnly(n, i);
  21195. },t)
  21196. }else{
  21197. var o = function() {
  21198. this.wrapupWarpShadingOnly(n, i);
  21199. }
  21200. .bind(this);
  21201. p.start(this.stepWarpPath.bind(this), t, o, r, d[c.warp.blendEasing], "stepMotion")
  21202. }
  21203. this.warpCommonParameters(t, r, !1, i)
  21204. this.model.chunks.concat(this.model.skybox).forEach(function(e) {// 改
  21205. if(window.momentTourBlackNewType){
  21206. e.material.uniforms.blackout.value = 5//i 改
  21207. //e.material.defines.newBlack = ''
  21208. //e.material.needsUpdate = true
  21209. }else{
  21210. e.material.uniforms.blackout.value = i
  21211. }
  21212. }),
  21213. this._warpBendAim(null, t, null, r);
  21214. }
  21215. ,
  21216. n.prototype.flightStepWalk = function(e, t, i) {
  21217. var n = .001
  21218. , o = 1
  21219. , a = 1.2
  21220. , s = new r.Vector3
  21221. , h = new r.Vector3
  21222. , u = function(e, t) {
  21223. var i = Math.min(this.player.position.distanceTo(e.position), c.transition.flytimeMaxDistanceThreshold)
  21224. , r = i * c.transition.flytimeDistanceMultiplier + c.transition.flyTime;
  21225. h.copy(A.FORWARD),
  21226. this.player.getDirection(h),
  21227. s.copy(t).sub(e.position).normalize();
  21228. var l = s.dot(h)
  21229. , u = Math.acos(l)
  21230. , d = u / r;
  21231. return d > n && (r *= d / n,
  21232. u < o && (r *= a)),
  21233. r
  21234. };
  21235. return function(e, t, i) {
  21236. if (this.warpInterrupted)
  21237. i && i();
  21238. else if (this.activeTransType !== l.WALK)
  21239. this._clearWarpShading(),
  21240. this._warpStopFlying(),
  21241. this.player.spider.draw(),
  21242. this.placeCpm(),
  21243. i && i();
  21244. else if (this.player.currentPano !== e) {
  21245. var n = {
  21246. pano: e,
  21247. lookAtPoint: t,
  21248. duration: null,
  21249. maxDistanceOverride: c.warp.walkMaxDist,
  21250. skipWarpingCheck: !1,
  21251. constantMoveSpeed: !0
  21252. };
  21253. if(e == this.warpDestPano){//到达终点前,放大到终点的zoom
  21254. n.zoomLevel = this.warpDestHeroLoc.zoom
  21255. }
  21256. n.duration = u.call(this, e, t),
  21257. this.player.nonInterruptingFlyToPano(n, i)
  21258. } else
  21259. i && i()
  21260. }
  21261. }(),
  21262. n.prototype.makeWalkFlightFunc = function(e, t, i) {
  21263. return this.flightStepWalk.bind(this, e, t, i)
  21264. }
  21265. ,
  21266. n.prototype.warpTravel_WALK = function() {
  21267. var e = [];
  21268. return function(t) {
  21269. var i = this.player.model.panos;
  21270. e.length = 0;
  21271. for (var n = null, o = !1, a = 0; a < this.nodes.length; a++) {
  21272. var s = this.nodes[a]
  21273. , l = i.get(s);
  21274. a === this.nodes.length - 1;
  21275. o = n && l.position.distanceTo(n.position) < c.warp.walkMinDist,
  21276. n && o || (e.push(s),
  21277. n = l)
  21278. }
  21279. o && this.nodes.length > 1 && (e[e.length - 1] = this.nodes[this.nodes.length - 1]);
  21280. var h = e.length
  21281. , u = i.get(e[h - 1])
  21282. , d = new Array(h + 1);
  21283. d[d.length - 1] = function() {
  21284. t && t()
  21285. }
  21286. .bind(this);
  21287. for (var p = h - 1, f = d.length - 1; f > 0; f -= 1) {
  21288. var g = e[p];
  21289. u = i.get(g);
  21290. var m = new r.Vector3;
  21291. this.getLookAtForWalkingTourNode(e, p, m),
  21292. d[f - 1] = this.makeWalkFlightFunc(u, m, d[f]),
  21293. p--
  21294. }
  21295. d[0]()
  21296. }
  21297. }(),
  21298. n.prototype.getLookAtForWalkingTourNode = function() {
  21299. var e = new r.Vector3
  21300. , t = new r.Vector3
  21301. , i = new r.Vector3
  21302. , n = new r.Vector3
  21303. , o = new r.Vector3
  21304. , a = .65
  21305. , s = .75
  21306. , l = .2
  21307. , c = .4
  21308. , h = .2
  21309. , u = 3;
  21310. return function(r, d, p) {
  21311. var f = r.length;
  21312. if (d >= f)
  21313. return !1;
  21314. var g = 1
  21315. , m = 1;
  21316. t.set(0, 0, 0),
  21317. o.set(0, 0, 0);
  21318. for (var v = null, A = d; A < d + u && !(A >= f); A++) {
  21319. if (v = this.player.model.panos.get(r[A]),
  21320. this.getOrientationForWalkingTourNode(r, A, i),
  21321. A === d && e.copy(i),
  21322. n.copy(i),
  21323. A > d) {
  21324. var y = n.dot(e) < a;
  21325. g *= y ? l : s,
  21326. m *= y ? h : c
  21327. }
  21328. i.multiplyScalar(g),
  21329. t.add(i),
  21330. o.lerp(v.position, m)
  21331. }
  21332. return t.normalize(),
  21333. p.copy(o),
  21334. p.add(t),
  21335. !0
  21336. }
  21337. }(),
  21338. n.prototype.getOrientationForWalkingTourNode = function(e, t, i) {
  21339. var n = e.length;
  21340. if (t >= n)
  21341. return !1;
  21342. if (t === n - 1)
  21343. i.copy(A.FORWARD).applyQuaternion(this.warpDestHeroLoc.quaternion);
  21344. else {
  21345. var r = this.player.model.panos.get(e[t])
  21346. , o = this.player.model.panos.get(e[t + 1]);
  21347. i.copy(o.position).sub(r.position)
  21348. }
  21349. return i.normalize(),
  21350. !0
  21351. }
  21352. ,
  21353. n.prototype.warpCameraTravel = function(e, t, i, n) {
  21354. if (this.activeTransType = this.upcomingTransType,
  21355. this.lastTransType = this.activeTransType,
  21356. this.upcomingTransType = null,
  21357. !e) {
  21358. var r = function() {
  21359. this._wrapupTravel(n)
  21360. }
  21361. .bind(this)
  21362. , o = {
  21363. pano: this.warpDestPano,
  21364. lookAtPoint: null,
  21365. duration: null,
  21366. maxDistanceOverride: null,
  21367. skipWarpingCheck: !1
  21368. };
  21369. return void this.player.flyToPano(o, r)
  21370. }
  21371. this.activeTransType === l.BLACK ? this.warpTravel_BLACK(null, i, t, n) : this.activeTransType === l.WALK ? this.warpTravel_WALK(function() {
  21372. this._clearWarpShading(),
  21373. this._warpStopFlying(),
  21374. this.player.spider.draw(),
  21375. this.placeCpm(),
  21376. n && n()
  21377. }
  21378. .bind(this)) : this.warpTravel_STD(n)
  21379. }
  21380. ,
  21381. n.prototype.startWarpState = function() {
  21382. this.warping = !0,
  21383. this.warpInterrupted = !1,
  21384. this.warpInterruptionBlackoutStyle = null,
  21385. this.warpInterruptionTravelTime = null
  21386. }
  21387. ,
  21388. n.prototype.endWarpState = function() {
  21389. this.warping = !1
  21390. }
  21391. ,
  21392. n.prototype.warpToPano = function(e, t, i, n) {
  21393. if (this.warping)
  21394. return void y.warn("Cannot warp when already warping");
  21395. if (this.upcomingTransType = e,
  21396. this.activeTransType = null,
  21397. !this.setWarpDestPano())
  21398. return this.upcomingTransType = null,
  21399. void this.warpToNonPano(n);
  21400. if (this.player.mode !== a.PANORAMA)
  21401. return this.upcomingTransType = null,
  21402. this.discardSlow(),
  21403. void this.player.flyToNewMode({
  21404. mode: a.PANORAMA,
  21405. pano: this.warpDestPano,
  21406. duration: c.warp.outsideTime,
  21407. warpDest: this.warpDestHeroLoc,
  21408. callback: n,
  21409. force: !0
  21410. });
  21411. if (!this.warpDestPano)
  21412. return y.warn("no warp destination, callback dropped"),
  21413. void (this.upcomingTransType = null);
  21414. 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)
  21415. , o = this.chooseWarpPath(r);
  21416. if (o && this.upcomingTransType !== l.WALK) {
  21417. var s = function() {
  21418. this.waitingToWarp = !1,
  21419. this.warpToPano(e, t, i, n)
  21420. }
  21421. .bind(this);
  21422. if (this.player.checkAndWaitForPanoLoad(this.warpDestPano, "high", "low", this.player.basePanoSize, s))
  21423. return void (this.waitingToWarp = !0)
  21424. }
  21425. this.player.currentPano || (y.warn("Arrived at a very strange spot!"),
  21426. this.player.currentPano = this.warpDestPano,
  21427. this.placeCpm(),
  21428. this.fadeOutCpm(c.path.fadeOutTime),
  21429. this.player.spider.draw()),
  21430. y.debug("Warping to pano ", this.warpDestPano.position),
  21431. this.upcomingTransType !== l.WALK && this.player.emit(C.PanoChosen, this.player.currentPano, this.warpDestPano),
  21432. this.startWarpState();
  21433. var h = function() {
  21434. this.endWarpState(),
  21435. n && n()
  21436. }
  21437. .bind(this);
  21438. o ? this.warpCameraTravel(r, t, i, h) : this.warpCameraAim(h)
  21439. //this.player.smoothZoomToDefault(c.zoom.restoreTime);
  21440. }
  21441. ,
  21442. t.exports = n
  21443. }
  21444. ).call(this, "/js/objects/ShowPath.js")
  21445. }
  21446. , {
  21447. "../constants": 8,
  21448. "../effects": 16,
  21449. "../enum/BlackoutStyle": 18,
  21450. "../enum/ModelManagerEvents": 33,
  21451. "../enum/PlayerEvents": 40,
  21452. "../enum/RenderOrder": 42,
  21453. "../enum/Vectors": 50,
  21454. "../enum/Viewmode": 51,
  21455. "../enum/WarpStyle": 52,
  21456. "../gui/gui": 65,
  21457. "../model/ModelManager": 140,
  21458. "../objects/Snapshot": 153,
  21459. "../settings": 166,
  21460. "../shaders": 167,
  21461. "../util/easing": 186,
  21462. "../util/lerp": 188,
  21463. "../util/logger": 189,
  21464. "../util/math": 190,
  21465. "../util/texture": 194,
  21466. "../util/transitions": 195,
  21467. three: 217
  21468. }],
  21469. 152: [function(e, t, i) {
  21470. "use strict";
  21471. function n() {
  21472. var e = new r.SphereBufferGeometry(a.skyboxRadius,20,5)
  21473. , t = new r.RawShaderMaterial({
  21474. fragmentShader: o.skysphere.fragmentShader,
  21475. vertexShader: o.skysphere.vertexShader,
  21476. uniforms: r.UniformsUtils.clone(o.skysphere.uniforms),
  21477. side: r.BackSide,
  21478. name: "skysphere"
  21479. });
  21480. t.uniforms.radius.value = e.parameters.radius,
  21481. r.Mesh.call(this, e, t)
  21482. }
  21483. var r = e("three")
  21484. , o = e("../shaders")
  21485. , a = e("../settings");
  21486. n.prototype = Object.create(r.Mesh.prototype),
  21487. n.prototype.constructor = n,
  21488. t.exports = n
  21489. }
  21490. , {
  21491. "../settings": 166,
  21492. "../shaders": 167,
  21493. three: 217
  21494. }],
  21495. 153: [function(e, t, i) {
  21496. (function(i) {
  21497. "use strict";
  21498. function n(e) {
  21499. o.call(this, e),
  21500. this.sid = e.sid,//xzw add
  21501. this.panoId = e.panoId,
  21502. this.orthoZoom = e.orthoZoom,
  21503. this.floorVisibility = e.floorVisibility,
  21504. this.thumbUrl = e.thumbUrl,
  21505. this.name = e.name,
  21506. this.zoom = e.zoom
  21507. }
  21508. var r = (e("three"),
  21509. e("../util/logger"))
  21510. , o = (e("../settings"),
  21511. e("../enum/Viewmode"),
  21512. e("../util/common"),
  21513. e("../util/transitions"),
  21514. e("../util/lerp"),
  21515. e("../util/ajax"),
  21516. e("../util/texture"),
  21517. e("./View"));
  21518. e("events").EventEmitter,
  21519. new r(i);
  21520. n.prototype = Object.create(o.prototype),
  21521. n.prototype.isPano = function() {
  21522. return this.panoId && "" !== this.panoId && this.panoId != "outside"
  21523. }
  21524. ,
  21525. t.exports = n
  21526. }
  21527. ).call(this, "/js/objects/Snapshot.js")
  21528. }
  21529. , {
  21530. "../enum/Viewmode": 51,
  21531. "../settings": 166,
  21532. "../util/ajax": 181,
  21533. "../util/common": 185,
  21534. "../util/lerp": 188,
  21535. "../util/logger": 189,
  21536. "../util/texture": 194,
  21537. "../util/transitions": 195,
  21538. "./View": 154,
  21539. events: 202,
  21540. three: 217
  21541. }],
  21542. 154: [function(e, t, i) {
  21543. (function(i) {
  21544. "use strict";
  21545. function n(e) {
  21546. e = e || {},
  21547. this.position = new r.Vector3,
  21548. this.quaternion = new r.Quaternion,
  21549. this.update(e)
  21550. }
  21551. var r = e("three")
  21552. , o = e("../util/logger")
  21553. , a = (e("../settings"),
  21554. e("../enum/Viewmode"),
  21555. e("../util/common"),
  21556. e("../util/transitions"),
  21557. e("../util/lerp"),
  21558. e("../util/ajax"),
  21559. e("../util/texture"),
  21560. e("events").EventEmitter);
  21561. new o(i);
  21562. n.prototype = Object.create(a.prototype),
  21563. n.prototype.isValid = function() {
  21564. return !!this.cameraMode
  21565. }
  21566. ,
  21567. n.prototype.update = function(e) {
  21568. return this.cameraMode = e.cameraMode || this.cameraMode,
  21569. this.pano = e.pano || this.pano,
  21570. e.position && this.position.copy(e.position),
  21571. e.quaternion && this.quaternion.copy(e.quaternion),
  21572. this
  21573. }
  21574. ,
  21575. t.exports = n
  21576. }
  21577. ).call(this, "/js/objects/View.js")
  21578. }
  21579. , {
  21580. "../enum/Viewmode": 51,
  21581. "../settings": 166,
  21582. "../util/ajax": 181,
  21583. "../util/common": 185,
  21584. "../util/lerp": 188,
  21585. "../util/logger": 189,
  21586. "../util/texture": 194,
  21587. "../util/transitions": 195,
  21588. events: 202,
  21589. three: 217
  21590. }],
  21591. 155: [function(e, t, i) {//player.js
  21592. (function(i) {
  21593. "use strict";
  21594. function n(e) {
  21595. this.currentPano = null,
  21596. this.nextPano = null,
  21597. this.camera = null,
  21598. this.paused = !1,
  21599. this.flying = !1,
  21600. this.sceneIntersectionPlane = null,
  21601. this.target = new r.Vector3,
  21602. this.mouse = new r.Vector3(1.1,1.1,.5),
  21603. this.mouseAtMouseDown = new r.Vector2,
  21604. this.mouseCouldBeClickToMove = !1,
  21605. this.mouseLastMoveTime = Date.now(),
  21606. this.mouseDown = !1,
  21607. this.mouseDownTimer = null,
  21608. this.couldBeLongTap = !1,
  21609. this.containsMouse = !1, //
  21610. this.isTouchEvent = !1,
  21611. this.isPanoHover = !1,
  21612. this.reticule = new a(this),
  21613. this.panoMarkers = [],
  21614. this.spider = new h(this),
  21615. this.quaternion = new r.Quaternion,
  21616. this.position = new r.Vector3(15,10,15),
  21617. this.previousState = null,
  21618. this.lastInsideView = new c,
  21619. this.last360View = new c,
  21620. this.raycaster = new r.Raycaster,
  21621. this.intersect = null,
  21622. this.lastChangeTime = Date.now(),
  21623. this.history = new I,
  21624. this.cameraControls = null,
  21625. this.path = null,
  21626. this.model = null,
  21627. this.domElement = null,
  21628. this.cachedPanoCandidates = null,
  21629. this.basePanoSize = 0,
  21630. this.standardPanoSize = 0,
  21631. this.highPanoSize = 0,
  21632. this.ultraHighPanoSize = 0,
  21633. this.zoomLevel = 1,
  21634. this.zooming = 0,
  21635. this.zoomSpeed = .5,
  21636. this.scrollZoomSpeed = .06,
  21637. this.zoomSpeedAdjust = .05,
  21638. this.defaultZoomIncrement = .2,
  21639. this.baseFov = f.insideFOV,
  21640. this.zoomFov = this.baseFov,
  21641. this.zoomEnabled = !0,
  21642. this.preRenderingEnabled = !1,
  21643. this.setupCustomProperties(e),
  21644. this.zoomStats = new L
  21645. }
  21646. var r = e("three")
  21647. , o = e("./util/logger")
  21648. , a = e("./objects/Reticule")
  21649. , s = e("./objects/Panorama")
  21650. , l = e("./objects/ShowPath")
  21651. , c = e("./objects/View")
  21652. , h = (e("./objects/Snapshot"),
  21653. e("./objects/NSpider"))
  21654. , u = e("./enum/Viewmode")
  21655. , d = (e("./enum/TagStates"),
  21656. e("./enum/Vectors"))
  21657. , p = e("./enum/Keys")
  21658. , f = (e("./enum/AlignmentType"),
  21659. e("./settings"))
  21660. , g = e("./util/common")
  21661. , m = (e("./util/browser"),
  21662. e("./util/math"))
  21663. , v = e("./util/lerp")
  21664. , A = e("./util/easing")
  21665. , y = e("./util/transitions")
  21666. , C = e("events").EventEmitter
  21667. , I = (e("./shaders"),
  21668. e("./util/history"))
  21669. , E = (e("./util/camera"),
  21670. e("./model/ModelManager"),
  21671. e("./enum/PathDiscardMode"))
  21672. , b = e("./enum/PathDisplayMode")
  21673. , w = e("./enum/PlayerEvents")
  21674. , _ = e("./enum/ControlEvents")
  21675. , T = e("./enum/ModelManagerEvents")
  21676. , x = e("./enum/WarpStyle")
  21677. , S = e("./enum/BlackoutStyle")
  21678. , M = e("./exception/BasicException")
  21679. , R = e("./enum/PanoSizeClass")
  21680. , P = (e("./tile/TileDownloader"),
  21681. e("./tile/TilePrioritizer"))
  21682. , O = (e("./enum/PanoramaEvents"),
  21683. e("./enum/ZoomEvents"))
  21684. , L = e("./util/ZoomStats")
  21685. , D = e("./constants")
  21686. , N = e("./util/common")
  21687. , B = e("./util/cameraLight")
  21688. , Hot = e('hot')
  21689. , F = new o(i)
  21690. , V = Object.freeze({
  21691. FlyToPano: y.getUniqueId(),
  21692. FlyToNewMode: y.getUniqueId(),
  21693. FlyToSameMode: y.getUniqueId(),
  21694. FlyToViewFloor: y.getUniqueId(),
  21695. LookTransition: y.getUniqueId(),
  21696. ZoomTransition: y.getUniqueId()
  21697. });
  21698. n.prototype = Object.create(C.prototype),
  21699. n.prototype.init = function(e) {
  21700. window.player = this
  21701. this.modelManager = e.modelManager,
  21702. this.tileDownloader = e.tileDownloader,
  21703. this.panoRenderer = e.panoRenderer,
  21704. this.qualityManager = e.qualityManager,
  21705. this.domElement = e.container,
  21706. this.camera = e.camera,
  21707. this.tagManager = e.tagManager,
  21708. this.cameraControls = e.controls,
  21709. this.path = new l(e.director,this,e.controls),
  21710. this.basePanoSize = this.qualityManager.getPanoSize(R.BASE),
  21711. this.standardPanoSize = this.qualityManager.getPanoSize(R.STANDARD),
  21712. this.highPanoSize = this.qualityManager.getPanoSize(R.HIGH),
  21713. this.ultraHighPanoSize = this.qualityManager.getPanoSize(R.ULTRAHIGH),
  21714. this.tileDownloader.processPriorityQueue = !1,
  21715. this.tileDownloader.tilePrioritizer = new P(this.qualityManager,this.basePanoSize,this.standardPanoSize,this.highPanoSize,this.ultraHighPanoSize),
  21716. this.bindEvents(e.container),
  21717. this.updateModel()
  21718. }
  21719. //xzw add: 截图
  21720. function dataURLtoBlob(dataurl) {
  21721. var arr = dataurl.split(','), mime = arr[0].match(/:(.*?);/)[1],
  21722. bstr = atob(arr[1]), n = bstr.length, u8arr = new Uint8Array(n);
  21723. while(n--){
  21724. u8arr[n] = bstr.charCodeAt(n);
  21725. };
  21726. return new Blob([u8arr], {type:mime});
  21727. }
  21728. n.prototype.screenShot = function(o){
  21729. if(this.flying || this.flyingToTag) return;
  21730. var R = this.sceneRenderer;
  21731. R.updateScreenSize(o);
  21732. for(var i in this.model.panos.index){
  21733. if(!this.model.panos.index[i].marker) continue;
  21734. this.model.panos.index[i].marker.forceHide = this.model.panos.index[i].marker.visible;
  21735. this.model.panos.index[i].marker.visible = false;
  21736. }
  21737. for(var i in this.model.hots){
  21738. this.model.hots[i].mesh.visible = false;
  21739. }
  21740. this.reticule.visible = false;
  21741. this.reticule.forceUnvisible = true;
  21742. this.path.currentPanoMarker.mesh.visible = false;
  21743. setTimeout(function(){//因resize效用没办法立即生效(原因未知),故而延后
  21744. R.renderer.clear(true,true,true);
  21745. R.renderer.render(R.scene, R.camera);
  21746. var imgData = R.renderer.domElement.toDataURL(o.type,0.9);
  21747. o.f && o.f(imgData)
  21748. R.updateScreenSize({resize:true});
  21749. this.reticule.visible = true;
  21750. for(var i in this.model.hots){
  21751. this.model.hots[i].mesh.visible = true;
  21752. }
  21753. for(var i in this.model.panos.index){
  21754. this.model.panos.index[i].marker.visible = this.model.panos.index[i].marker.forceHide;
  21755. }
  21756. this.path.currentPanoMarker.mesh.visible = true;
  21757. R.renderer.render(R.scene, R.camera);
  21758. }.bind(this),30) //这个数字不能太小
  21759. }
  21760. var scaleImg = e("scaleImg");
  21761. var ResizeImg = function(img, option){
  21762. var img2; //不能直接改img 否则可能触发第二次img.onload
  21763. var compress = function(ratio,type){
  21764. var image = img2 || img;
  21765. var c = document.createElement('canvas');
  21766. c.width = image.width; c.height = image.height;
  21767. var ctx = c.getContext('2d');
  21768. ctx.drawImage(image,0,0,image.width,image.height);
  21769. img2 = scaleImg(ratio/* option.maxSize/oldSize */, c, type/* option.type||"png" */);//最大不能超过0.8M
  21770. }
  21771. var reCom = function(){ //如果有了img2 就只需要img2 否则创造新的img2
  21772. var image = img2 || img;
  21773. var blob = dataURLtoBlob(image.src);
  21774. if(option.maxWeight && blob.size > option.maxWeight){
  21775. compress(option.maxWeight/blob.size, "jpeg")
  21776. blob = dataURLtoBlob(image.src);
  21777. }
  21778. if(!img2){
  21779. img2 = new Image();
  21780. }
  21781. img2.base64Src = image.src;
  21782. img2.src = window.URL.createObjectURL(blob);
  21783. }
  21784. var oldSize = Math.max(img.width, img.height);
  21785. if(option.toType != "png"){//不是非要png的话
  21786. if(option.oldType == "jpeg"){//jpeg先判断尺寸,然后是尺寸
  21787. if(oldSize > option.maxSize){
  21788. compress(option.maxSize/oldSize, "jpeg");
  21789. }
  21790. reCom();
  21791. }else if(option.oldType == "png"){//png先判断数据量 如果数据量达标,就无视大小(有可能超出大小)
  21792. if(option.maxWeight && option.weight > option.maxWeight){//如果一开始大小不大就不压缩 还是png
  21793. compress(oldSize>option.maxSize ? option.maxSize/oldSize : 1, "jpeg");
  21794. reCom();
  21795. }
  21796. }
  21797. }else{
  21798. //?貌似png会越压缩越大?
  21799. }
  21800. return img2 || img;
  21801. }
  21802. var _fixType=function(type) {
  21803. type = type.toLowerCase().replace(/jpg/i, 'jpeg');
  21804. var r = type.match(/png|jpeg|bmp|gif/)[0];
  21805. return 'image/' + r;
  21806. };
  21807. var saveFile=function(data, filename){
  21808. var save_link = document.createElementNS('http://www.w3.org/1999/xhtml', 'a');
  21809. save_link.href = data;
  21810. save_link.download = filename;
  21811. var event = document.createEvent('MouseEvents');
  21812. event.initMouseEvent('click', true, false, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
  21813. save_link.dispatchEvent(event);
  21814. };
  21815. n.prototype.getWrapShot = function(){ //获取导览点截图/初始画面和信息
  21816. var info = this.getSnapAngleInfo();
  21817. var str = ',{\r\t' + info;
  21818. var arg = arguments[0];
  21819. this.screenShot({ width:g_snapShotWidth*4, height:g_snapShotHeight*4, type:"image/jpeg", f:function(imgData){
  21820. if (arg && arg.__callback) {
  21821. return arg.__callback(imgData, info)
  21822. }
  21823. var img = new Image();
  21824. img.src = imgData;
  21825. img.onload = function(){
  21826. var img2 = ResizeImg(this,{maxSize: g_snapShotWidth, oldType:"jpeg"}); //暂定缩略图大小
  21827. img2.src.replace(_fixType("image/jpeg"),'image/octet-stream');
  21828. var filename = "snap" + (new Date()).getTime();
  21829. saveFile(img2.src,filename + ".jpg");
  21830. str +=(',\r\t"thumbnail_signed_src":"'+filename+'.jpg",');
  21831. str +=('\r\t"sid":"'+filename+'",');
  21832. str +=('\r\t"name":"'+filename+'"\r}');
  21833. logData(str)
  21834. }
  21835. }});
  21836. }
  21837. ,
  21838. n.prototype.getSnapAngleInfo = function(){
  21839. var info = {};
  21840. var str = '"metadata":{';
  21841. var q = this.camera.quaternion.clone();
  21842. switch (this.mode) {
  21843. case "panorama":
  21844. info.scan_id = this.currentPano.id;
  21845. str += ('"scan_id":"'+this.currentPano.id+'",');
  21846. break;
  21847. case "floorplan":
  21848. info.camera_mode = 1;
  21849. q = (new r.Quaternion).setFromAxisAngle(new r.Vector3(0,1,0), r.Math.degToRad(90))
  21850. q.multiply(this.camera.quaternion);
  21851. str += ('"camera_mode":1,');
  21852. //str += ('"ortho_zoom":'+m.toPrecision(this.cameraControls.activeControl.currentScale * $("#player").height() / $("#player").width() * D.workshopApsect * 16, 4)+",");
  21853. str += ('"ortho_zoom":'+ m.toPrecision(this.cameraControls.activeControl.currentScale, 4 )+",");
  21854. break;
  21855. case "dollhouse":
  21856. info.camera_mode = 2;
  21857. str += ('"camera_mode":2,');
  21858. break;
  21859. }
  21860. info.camera_position = m.toPrecision(this.camera.position.toArray(),4);
  21861. console.log(info.camera_position)
  21862. if(window.screenSta === 'tour'){ // fyz 导览截屏需要做额外的
  21863. /**fyz 对相机截屏的角度进行校对 */
  21864. var out = new r.Quaternion(q.x, q.y, q.z, q.w)
  21865. out.multiply(new r.Quaternion(Math.sqrt(2) / 2, Math.sqrt(2) / 2, 0, 0).conjugate())
  21866. out.x *= -1;
  21867. out.w *= -1;
  21868. info.camera_quaternion = m.toPrecision(out.toArray(),4);
  21869. }else{
  21870. info.camera_quaternion = m.toPrecision(q.toArray(),4);;
  21871. }
  21872. info.zoom = this.zoomLevel;
  21873. console.log(info.camera_quaternion)
  21874. // str += ( '"camera_position":['+ info.camera_position + '],"camera_quaternion":['+info.camera_quaternion+"]}");
  21875. // fyz 扩展编辑页面, 加上导览点缩放值
  21876. str += ( '"camera_position":['+ info.camera_position + '],"camera_quaternion":['+info.camera_quaternion+'], "zoom":' + info.zoom + '}');
  21877. return str;
  21878. }
  21879. //------end
  21880. n.prototype.closePopup = function() {//xzw 关闭热点页面
  21881. if(!g_currentHot) return;
  21882. g_currentHot = null;
  21883. var hotPop = document.getElementById('popup');
  21884. hotPop.style.display = "none";
  21885. document.querySelector(".popup-content").removeChild(document.getElementById("id1"));
  21886. $("#popup iframe:last").remove();
  21887. var _bgaudio = document.getElementById("bgaudio");
  21888. try{
  21889. window.parent.postMessage("closeHot",'*')
  21890. }catch(e){
  21891. console.log(e)
  21892. }
  21893. //判断音乐是否暂停或者是否存在
  21894. /* if(g_bgAudio && g_bgAudio.paused && g_bgAudio.readyState != 0 && g_play === 1)
  21895. {
  21896. //g_bgAudio.play();
  21897. manage.switchBgmState(true)
  21898. }; */
  21899. if(g_bgAudio && g_bgAudio.pauseByHot){
  21900. manage.switchBgmState(true)
  21901. }
  21902. playMusic(player.currentPano)
  21903. //$('#player').off("click",this.closePopup);
  21904. return false
  21905. }
  21906. n.prototype.setupCustomProperties = function(e) {
  21907. var t = e || u.PANORAMA;
  21908. Object.defineProperty(this, "mode", {
  21909. get: function() {
  21910. return t
  21911. },
  21912. set: function(e) {
  21913. var i = t;
  21914. t = e,
  21915. this.onModeUpdated(i, t)
  21916. }
  21917. })
  21918. }
  21919. ,
  21920. n.prototype.isInMode = function() {
  21921. for (var e = 0; e < arguments.length; e++)
  21922. if (this.mode === arguments[e])
  21923. return !0;
  21924. return !1
  21925. }
  21926. ,
  21927. n.prototype.isOutsideMode = function(e) {
  21928. return e = e || this.mode,
  21929. e === u.DOLLHOUSE || e === u.FLOORPLAN
  21930. }
  21931. ,
  21932. n.prototype.is360View = function(e, t) {
  21933. return e === u.PANORAMA && t && !t.isAligned()
  21934. }
  21935. ,
  21936. n.prototype.setScene = function(e) {
  21937. this.sceneIntersectionPlane = e.plane,
  21938. this.path.setScene(e),
  21939. this.moveReticuleToScene(e)
  21940. }
  21941. ,
  21942. n.prototype.moveReticuleToScene = function(e) {
  21943. this.reticule.parent && this.reticule.parent.remove(this.reticule),
  21944. e.add(this.reticule)
  21945. }
  21946. ,
  21947. n.prototype.updateModel = function() {
  21948. function e(e, t, n) {
  21949. this.mode === u.DOLLHOUSE && e !== n && i.call(this, e.center.y)
  21950. }
  21951. function t(e, t) {
  21952. if (this.mode === u.DOLLHOUSE) {
  21953. var n = e ? this.model.center.y : n = t.center.y;
  21954. i.call(this, n)
  21955. }
  21956. }
  21957. function i(e) {
  21958. var t = this.cameraControls.cameras[u.DOLLHOUSE]
  21959. , i = this.cameraControls.controls[u.DOLLHOUSE]
  21960. , n = t.position.y + (e - i.target.y)
  21961. , r = f.showFloorDuration + f.showFloorDelay;
  21962. y.start(v.property(i.target, "y", e), r, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToViewFloor),
  21963. y.start(v.property(t.position, "y", n), r, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToViewFloor)
  21964. }
  21965. this.model = this.modelManager.getActiveModel(),
  21966. this.model.on("floor.changed", e.bind(this)),
  21967. this.model.on("allfloors.toggled", t.bind(this)),
  21968. this.on(w.PanoChosen, this.model.setProjectedPanos.bind(this.model));
  21969. /*******************************************************************VR fyz改 from徐世廷*******************************************************************/
  21970. var e2 = this;
  21971. this.model.panos.list.forEach(function(a) {
  21972. a.vrMarker.addEventListener("click", function() {
  21973. e2.flyToPano({
  21974. pano: a
  21975. })
  21976. })
  21977. })
  21978. /********************************************************************************************************************************************/
  21979. }
  21980. ,
  21981. n.prototype.updateModelDependentData = function() {
  21982. this.cameraControls.setModelForControls(this.model),
  21983. this.getPanoMarkersFromModel(this.model)
  21984. }
  21985. ,
  21986. n.prototype.onModelChanged = function() {
  21987. this.updateModel(),
  21988. this.updateModelDependentData()
  21989. }
  21990. ,
  21991. n.prototype.getPanoMarkersFromModel = function(e) {
  21992. this.panoMarkers = e.panos.list.reduce(function(e, t) {
  21993. return t.marker ? e.concat(t.marker) : e
  21994. }, [])
  21995. }
  21996. ,
  21997. n.prototype.handleControlMove = function(e) {
  21998. this.emit(w.Move, e)
  21999. }
  22000. ,
  22001. n.prototype.handleControlInputStart = function(e) {
  22002. this.emit(w.InputStart, e)
  22003. }
  22004. ,
  22005. n.prototype.onModeUpdated = function(e, t) {
  22006. this.cameraControls.activateControls(t),
  22007. this.emit(w.ModeChanged, e, t)
  22008. }
  22009. ,
  22010. n.prototype.isWarping = function() {
  22011. return this.path.warping
  22012. }
  22013. ,
  22014. n.prototype.isWaitingToWarp = function() {
  22015. return this.path.waitingToWarp
  22016. }
  22017. ,
  22018. n.prototype.getLabelScaleFactor = function() {
  22019. if (this.isOutsideMode()) {
  22020. var e = 10
  22021. , t = Math.sqrt(this.cameraControls.controls[u.FLOORPLAN].currentScale / e);
  22022. return t
  22023. }
  22024. return .5
  22025. }
  22026. ,
  22027. n.prototype.changeMusic = function() {//xzw add
  22028. /* if(!this.director.tourIsPlaying && g_play && g_bgAudio){
  22029. g_playAudio = g_bgAudio;
  22030. //g_bgAudio.play();
  22031. manage.switchBgmState(true)
  22032. }else{
  22033. if(!g_play){
  22034. g_playAudio = g_bgAudio;
  22035. }else{//防止再次播放时重播一遍
  22036. g_playAudio = null;
  22037. }
  22038. } */
  22039. /* if(!this.director.tourIsPlaying && g_bgAudio){
  22040. manage.switchBgmState(true)
  22041. } */
  22042. if(!this.director.tourIsPlaying) this.director.bgmReplay()
  22043. }
  22044. ,
  22045. n.prototype.bindEvents = function(e) {
  22046. e !== document && e.setAttribute("tabindex", -1),
  22047. e.addEventListener("mousedown", this.onMouseDown.bind(this)),
  22048. e.addEventListener("mousemove", this.onMouseMove.bind(this)),
  22049. e.addEventListener("mouseover", this.onMouseOver.bind(this)),
  22050. e.addEventListener("mouseout", this.onMouseOut.bind(this)),
  22051. e.addEventListener("mouseup", this.onMouseUp.bind(this)),
  22052. this.modelManager.on(T.ActiveModelChanged, this.onModelChanged.bind(this)),
  22053. e.addEventListener("touchstart", this.onTouchStart.bind(this)),
  22054. e.addEventListener("touchmove", this.onTouchMove.bind(this)),
  22055. e.addEventListener("touchend", this.onTouchEnd.bind(this)),
  22056. e.addEventListener("pointerdown", this.onPointerDown.bind(this)),
  22057. e.addEventListener("pointermove", this.onPointerMove.bind(this)),
  22058. e.addEventListener("pointerup", this.onPointerUp.bind(this)),
  22059. e.addEventListener("pointerout", this.onPointerOut.bind(this)),
  22060. e.addEventListener("pointercancel", this.onPointerCancel.bind(this)),
  22061. document.addEventListener("keydown", this.onKeyDown.bind(this)),
  22062. this.cameraControls.on(_.Move, this.handleControlMove.bind(this)),
  22063. this.cameraControls.on(_.InputStart, this.handleControlInputStart.bind(this)),
  22064. this.cameraControls.on(_.Pinch, this.handleControlPinch.bind(this)),
  22065. this.cameraControls.on(_.Scroll, this.handleControlScroll.bind(this)),
  22066. window.addEventListener("snapshotBegin", this.getWrapShot.bind(this)),//xzw add
  22067. window.addEventListener("tourAudioEnded", this.changeMusic.bind(this));//xzw add
  22068. // lzb
  22069. window.getSeft && getSeft(this);
  22070. //判断是否是移动端,如果是给关闭按钮添加touchstart事件
  22071. if(/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)){
  22072. $('#closepop').on("touchstart",this.closePopup.bind(this));
  22073. }else{
  22074. $('#closepop').on("click",this.closePopup.bind(this));
  22075. }
  22076. }
  22077. ,
  22078. n.prototype.onMouseDown = function(e) {
  22079. e.currentTarget !== document && e.currentTarget.focus(),
  22080. 0 === e.button && (this.handleInputStart.call(this, e.clientX, e.clientY, !1),
  22081. this.updateIntersect())
  22082. }
  22083. ,
  22084. n.prototype.onMouseMove = function(e) {
  22085. this.isTouchEvent = !1,
  22086. this.handleInputMove.call(this, e.clientX, e.clientY, !1)
  22087. }
  22088. ,
  22089. n.prototype.onMouseOver = function(e) {
  22090. this.containsMouse = !0,
  22091. !this.mouseDown || 0 !== e.which && 0 !== e.buttons || (this.mouseDown = !1)
  22092. }
  22093. ,
  22094. n.prototype.onMouseOut = function(e) {
  22095. this.containsMouse = !1
  22096. }
  22097. ,
  22098. n.prototype.onMouseUp = function(e) {
  22099. this.handleInputEnd.call(this, e.clientX, e.clientY, !1);
  22100. }
  22101. ,
  22102. n.prototype.onTouchStart = function(e) {
  22103. if (e.currentTarget !== document && e.currentTarget.focus(),
  22104. !this.mouseDown) {
  22105. this.couldBeLongTap = !0;
  22106. var t = g.average(e.changedTouches, "clientX")
  22107. , i = g.average(e.changedTouches, "clientY");
  22108. this.handleInputStart.call(this, t, i, !0),
  22109. this.mouseDownTimer = setTimeout(function() {
  22110. this.updateIntersect(),
  22111. this.handleInputEnd.call(this, t, i, !0)
  22112. }
  22113. .bind(this), f.input.longTapThreshold)
  22114. }
  22115. }
  22116. ,
  22117. n.prototype.onTouchMove = function(e) {
  22118. var t = g.average(e.changedTouches, "clientX")
  22119. , i = g.average(e.changedTouches, "clientY");
  22120. this.handleInputMove.call(this, t, i, !0)
  22121. }
  22122. ,
  22123. n.prototype.onTouchEnd = function(e) {
  22124. if (clearTimeout(this.mouseDownTimer),
  22125. this.mouseDown) {
  22126. this.couldBeLongTap = !1,
  22127. this.updateIntersect();
  22128. var t = g.average(e.changedTouches, "clientX")
  22129. , i = g.average(e.changedTouches, "clientY");
  22130. this.handleInputEnd.call(this, t, i, !0)
  22131. }
  22132. }
  22133. ,
  22134. n.prototype.onPointerDown = function(e) {
  22135. return e.currentTarget !== document && e.currentTarget.focus(),
  22136. this.mouseDown || "mouse" === e.pointerType ? this.onMouseDown(e) : (this.couldBeLongTap = !0,
  22137. this.handleInputStart.call(this, e.clientX, e.clientY, !0),
  22138. void (this.mouseDownTimer = setTimeout(function() {
  22139. this.updateIntersect(),
  22140. this.handleInputEnd.call(this, e.clientX, e.clientY, !0)
  22141. }
  22142. .bind(this), f.input.longTapThreshold)))
  22143. }
  22144. ,
  22145. n.prototype.onPointerMove = function(e) {
  22146. "mouse" !== e.pointerType ? this.handleInputMove.call(this, e.clientX, e.clientY, !0) : this.onMouseMove(e)
  22147. }
  22148. ,
  22149. n.prototype.onPointerUp = function(e) {
  22150. return this.mouseDown && "mouse" !== e.pointerType ? (clearTimeout(this.mouseDownTimer),
  22151. this.couldBeLongTap = !1,
  22152. this.updateIntersect(),
  22153. void this.handleInputEnd.call(this, e.clientX, e.clientY, !0)) : this.onMouseUp(e)
  22154. }
  22155. ,
  22156. n.prototype.onPointerOut = function(e) {
  22157. this.mouseDown = !1
  22158. }
  22159. ,
  22160. n.prototype.onPointerCancel = function(e) {
  22161. this.mouseDown = !1
  22162. }
  22163. ,
  22164. n.prototype.onKeyDown = function(e) {
  22165. var t = function() {
  22166. this.cameraControls.activeControl && this.cameraControls.activeControl.emit(_.Move, "key")
  22167. }
  22168. .bind(this)
  22169. , i = e.which;
  22170. switch (i) {
  22171. case p.F:
  22172. t(),
  22173. this.changeFloor(-1);
  22174. break;
  22175. case p.R:
  22176. t(),
  22177. this.changeFloor(1)
  22178. }
  22179. if (this.mode === u.PANORAMA)
  22180. switch (i) {
  22181. case p.UPARROW:
  22182. case p.W:
  22183. this.flyLocalDirection(d.FORWARD.clone());
  22184. break;
  22185. case p.DOWNARROW:
  22186. case p.S:
  22187. this.flyLocalDirection(d.BACK.clone());
  22188. break;
  22189. case p.A:
  22190. this.flyLocalDirection(d.LEFT.clone());
  22191. break;
  22192. case p.D:
  22193. this.flyLocalDirection(d.RIGHT.clone())
  22194. }
  22195. }
  22196. ,
  22197. n.prototype.handleScrollPinchZoom = function() {
  22198. return function(e) {
  22199. var t = e
  22200. , i = this.zoomLevel;
  22201. this.zoomBy(t),
  22202. this.currentPano && this.zoomStats.addZoomAction(i, this.zoomLevel, this.currentPano.id)
  22203. }
  22204. }(),
  22205. n.prototype.handleControlPinch = function(e) {
  22206. f.zoom.enabled ? this.handleScrollPinchZoom(1 - e) : this.flyLocalDirection(new r.Vector3(0,0,e).normalize())
  22207. }
  22208. ,
  22209. n.prototype.handleControlScroll = function(e) {
  22210. f.zoom.enabled ? (e > 0 ? e = 1 + this.scrollZoomSpeed : e < 0 && (e = 1 - this.scrollZoomSpeed),
  22211. 0 !== e && this.handleScrollPinchZoom(e)) : this.flyLocalDirection(new r.Vector3(0,0,-e).normalize())
  22212. }
  22213. ,
  22214. n.prototype.handleInputStart = function(e, t, i) {
  22215. //许钟文加
  22216. var pad = this.handelPadding(e, t);
  22217. e = pad.x;
  22218. t = pad.y;
  22219. this.isTouchEvent = i,
  22220. m.convertScreenPositionToNDC(e, t, this.mouse),
  22221. m.convertScreenPositionToNDC(e, t, this.mouseAtMouseDown),
  22222. this.mouseCouldBeClickToMove = !0,
  22223. this.mouseDown = !0;
  22224. if (this.mouseCouldBeClickToMove) {
  22225. //window.DownInterface && new DownInterface().state(this,Hot);
  22226. window.Hotpoint && new Hotpoint().state(this,Hot);
  22227. }
  22228. if(!this.overlayInitedPlay /* && !settings.isEdit */ && this.overlayGroup.children.length){
  22229. this.overlayGroup.children.forEach((overlay)=>{
  22230. overlay.overlayType == "video" && overlay.plane.material.map.image.play()
  22231. })
  22232. this.overlayInitedPlay = true
  22233. playVideo()//add
  22234. }
  22235. /* this.overlayGroup.children.forEach((overlay)=>{
  22236. overlay.overlayType == "video" && overlay.visible && overlay.inSight() && overlay.videoControl(true)
  22237. }) */
  22238. }
  22239. ,
  22240. n.prototype.handelPadding = function(x, y) {
  22241. //去除player左边和上面的宽高,因为pc的player左上有其他element 许钟文
  22242. if (!this.pad)
  22243. this.pad = {
  22244. x: dom.getOffset("left", $("#player")[0]),
  22245. y: dom.getOffset("top", $("#player")[0])
  22246. }
  22247. return {
  22248. x: x - this.pad.x,
  22249. y: y - this.pad.y
  22250. }
  22251. }
  22252. n.prototype.handleInputMove = function(e, t, i) {
  22253. //许钟文加
  22254. var pad = this.handelPadding(e, t);
  22255. e = pad.x;
  22256. t = pad.y;
  22257. this.isTouchEvent = i,
  22258. m.convertScreenPositionToNDC(e, t, this.mouse),
  22259. this.mouseAtMouseDown.distanceTo(this.mouse) > f.input.moveToleranceNDC && (this.mouseCouldBeClickToMove = !1,
  22260. this.couldBeLongTap = !1,
  22261. clearTimeout(this.mouseDownTimer)),
  22262. this.mouseLastMoveTime = Date.now(),
  22263. this.reticule.move(e, t, i)
  22264. }
  22265. ,
  22266. n.prototype.handleInputEnd = function(e, t, i) {//xzw
  22267. if (this.isTouchEvent = i,
  22268. this.mouseDown = !1,
  22269. this.cameraControls.controls[u.PANORAMA].emit("interaction.direct"),
  22270. !i && this.couldBeLongTap)
  22271. return !0;
  22272. if (this.handleLongTap())
  22273. return !0;
  22274. if (this.mouseCouldBeClickToMove) {
  22275. if (this.flying)
  22276. return this.path.activeTransType === x.WALK && this.emit(w.WarpInterruptedWithFlyTo, this.path.activeTransType),
  22277. !0;
  22278. //add----
  22279. if(this.checkHotClick())//add
  22280. return !0;
  22281. if(checkSoundBtnClick(this.intersect))//add
  22282. return !0;
  22283. if(this.hoveringPlane){
  22284. this.clickOverlay(this.hoveringPlane)
  22285. return;
  22286. }
  22287. if (this.cameraControls.activeControl && this.cameraControls.activeControl.emit(_.Move, this.isTouchEvent ? "touch" : "mouse"),
  22288. this.history.invalidate(),
  22289. this.intersect)
  22290. return this.flyToPanoClosestToMouse();
  22291. if (this.mode === u.PANORAMA) {
  22292. var n = this.closestPanoInDirection(this.getMouseDirection());
  22293. return n ? this.flyToPano({
  22294. pano: n
  22295. }) : this.bump(this.getMouseDirection())
  22296. }
  22297. }
  22298. this.intersect && this.closestPano && this.closestPano.hoverOff(this.mode)
  22299. }
  22300. ,
  22301. n.prototype.handleLongTap = function() {
  22302. if (this.couldBeLongTap && (!this.isPanoHover || this.mode !== u.PANORAMA))
  22303. return this.cameraControls.activeControl && this.cameraControls.activeControl.emit(_.LongTap, "touch"),
  22304. !0
  22305. }
  22306. ,
  22307. n.prototype.checktagClick = function() {
  22308. if (this.tagManager.intersectTag) {
  22309. var e = this.isTouchEvent
  22310. , t = this.tagManager.clickedOnTag(e, this);
  22311. return e || t || y.cancelById(V.LookTransition),
  22312. !0
  22313. }
  22314. if (this.tagManager.activeTag)
  22315. return this.tagManager.dismissActiveTag(),
  22316. !1
  22317. }
  22318. ,
  22319. n.prototype.rankedtagInDirection = function(e, t) {
  22320. return this.tagManager.rankedtagInDirection(e, this.position, this.camera, t)
  22321. }
  22322. ,
  22323. n.prototype.start = function(e) {
  22324. //-------------------
  22325. window.initOverlay(r)
  22326. this.model.loadOverlays()
  22327. loadVideo();//add
  22328. //-------------------
  22329. var t = e.mode
  22330. , i = e.pano
  22331. , n = e.position
  22332. , rr = e.quaternion
  22333. , o = e.tag
  22334. , a = e.quickstart
  22335. , s = $.Deferred();
  22336. this.updateModelDependentData(),
  22337. this.updateFromControls(),
  22338. this.findDefaultViews();
  22339. var l = this.is360View(t, i);
  22340. return !this.model.outsideAllowed() || l || a ? (updateVideo({type:"beforeFlyIn", pano:i, dur:0}),
  22341. this.startInside(i, n, rr, o, s)) : this.startOutside(e, s),
  22342. s.done(function(e) {
  22343. this.emit(w.Ready, l, e, o)
  22344. }
  22345. .bind(this)),
  22346. s.promise()
  22347. }
  22348. ,
  22349. n.prototype.startOutside = function(e, t) {
  22350. var i = e.mode
  22351. , n = e.pano
  22352. , r = e.position
  22353. , o = e.quaternion
  22354. , a = e.zoom
  22355. , s = e.floorVisibility
  22356. , l = e.tag;
  22357. this.emit(w.StartOutside, f[i].transitionTime),
  22358. this.isOutsideMode(i) ? (this.model.warpDestFloors(s, !0),
  22359. y.cancelById(V.FlyToViewFloor),
  22360. i === u.FLOORPLAN ? this.floorplanMode(r, o, a) : this.dollhouseMode(r, o),
  22361. t.resolve(!1)) : this.startInsideWithFlyin(n, r, o, l, t)
  22362. }
  22363. ,
  22364. n.prototype.startInside = function(e, t, i, n, r) {
  22365. r = r || $.Deferred(),
  22366. this.currentPano = e;
  22367. var o = e && !e.isAligned();
  22368. if (t = o ? e.position : t || e.position,
  22369. i = i || e.quaternion,
  22370. e) {
  22371. var a = this.startInside.bind(this, e, t, i, n, r);
  22372. if (this.checkAndWaitForPanoLoad(e, "high", "low", this.basePanoSize, a))
  22373. return
  22374. }
  22375. //add
  22376. this.transitionPos({type:"beforeFlytopano", pano:this.currentPano, dur:0})
  22377. this.updateHotVisible()
  22378. return this.mode = u.PANORAMA,
  22379. e.floor.enter(this.mode),
  22380. this.emit(w.PanoChosen, this.currentPano, this.currentPano),
  22381. this.switchCameraMode(this.mode, i),
  22382. this.emit(w.StartInside, o),
  22383. r.resolve(!0),
  22384. r
  22385. }
  22386. ,
  22387. n.prototype.startInsideWithFlyin = function(e, t, i, n, r) {
  22388. if (r = r || $.Deferred(),
  22389. this.dollhouseMode(),
  22390. !e)
  22391. return F.warn("Player.startInsideWithFlyin() -> targetPano is invalid."),
  22392. r.resolve(!1),
  22393. r;
  22394. t = t || e.position;
  22395. var o = i || this.cameraControls.activeControl.camera.quaternion
  22396. , a = e.position;
  22397. return this.fitDollhouse(a, t, o),
  22398. setTimeout(function(t) {
  22399. this.cameraControls.activeControl && (this.cameraControls.activeControl.maxDistance = t);
  22400. var n = {
  22401. mode: u.PANORAMA,
  22402. pano: e,
  22403. quaternion: i,
  22404. callback: function() {
  22405. this.emit(w.FlyinFinished),
  22406. r.resolve(!0)
  22407. }
  22408. .bind(this)
  22409. };
  22410. this.flyToNewMode(n)
  22411. }.bind(this, this.cameraControls.activeControl.maxDistance), f.startupFlyinDelay),
  22412. r
  22413. }
  22414. ,
  22415. n.prototype.checkAndWaitForPanoLoad = function() {
  22416. var e = {}
  22417. , t = {}
  22418. , i = 5e3
  22419. , n = function() {
  22420. for (var n in e)
  22421. if (e.hasOwnProperty(n) && e[n]) {
  22422. var r = performance.now() - t[n];
  22423. if (r < i)
  22424. return !0
  22425. }
  22426. return !1
  22427. };
  22428. return function(r, o, a, s, l, c, h, u, d, p) {
  22429. if (n())
  22430. return !0;
  22431. var f = function(t, i, n) {
  22432. N.delayOneFrame(function() {
  22433. e[t] = !1,
  22434. l && l(i, n)
  22435. }
  22436. .bind(this))
  22437. }
  22438. .bind(this, r.id)
  22439. , g = function(t, i) {
  22440. N.delayOneFrame(function() {
  22441. e[t] = !1,
  22442. c && c(i)
  22443. }
  22444. .bind(this))
  22445. }
  22446. .bind(this, r.id);
  22447. try {
  22448. return null !== u && void 0 !== u || (u = !0),
  22449. 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),
  22450. e[r.id] && (t[r.id] = performance.now()),
  22451. e[r.id]
  22452. } catch (n) {
  22453. throw e[r.id] = !1,
  22454. t[r.id] = performance.now() - i,
  22455. n
  22456. }
  22457. }
  22458. }(),
  22459. n.prototype.checkAndWaitForWholePanoLoad = function(e, t, i, n, r) {
  22460. if (!e)
  22461. throw new M("Player.checkAndWaitForWholePanoLoad() -> Cannot load texture for null pano.");
  22462. return r && this.model.waitForLoad(e, function() {
  22463. return e.isLoaded(i)
  22464. }),
  22465. !e.isLoaded(t) && (e.loadCube(t).done(n),
  22466. !0)
  22467. }
  22468. ,
  22469. n.prototype.checkAndWaitForTiledPanoLoad = function() {
  22470. var e = new r.Vector3;
  22471. return function(t, i, n, r, o, a, s, l) {
  22472. if (!t)
  22473. throw new M("Player.checkAndWaitForTiledPanoLoad() -> Cannot load texture for null pano.");
  22474. return e.copy(d.FORWARD),
  22475. this.getDirection(e),
  22476. !t.isLoaded(i) && (a && this.model.waitForLoad(t, function() {
  22477. return t.isLoaded(i)
  22478. }),
  22479. t.loadTiledPano(i, e, null, s, l).done(function(e, t) {
  22480. n && n(e, t)
  22481. }
  22482. .bind(this)).fail(function(e) {
  22483. r && r(e)
  22484. }
  22485. .bind(this)).progress(function(e, t, i) {
  22486. o && o(e, t, i)
  22487. }
  22488. .bind(this)),
  22489. !0)
  22490. }
  22491. }(),
  22492. n.prototype.switchCameraMode = function(e, t) {
  22493. var i = this.cameraControls.controls[e]
  22494. , n = i.camera;
  22495. switch (e) {
  22496. case u.PANORAMA:
  22497. n.position.copy(this.currentPano.position);
  22498. var o = t ? d.FORWARD.clone().applyQuaternion(t) : this.getDirection().setY(0).normalize();
  22499. i.lookAt(o.add(n.position));
  22500. break;
  22501. case u.DOLLHOUSE:
  22502. /* var a = this.position.clone();
  22503. 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),
  22504. n.position.copy(a),
  22505. i.target.copy(this.target.clone().setY(this.model.center.y));
  22506. break; */
  22507. //for多楼层 且 让模型刚好适应屏幕
  22508. var box = this.model.boundingBox.clone();
  22509. box.applyMatrix4(this.camera.matrixWorld);//将 boundingbox、也就是模型, 转换到当前相机朝向
  22510. var boxSize = box.size() //其中boxSize.x是模型在当前相机视角下的横向宽度,当飞出后,该宽度要刚好占满窗口宽度
  22511. var fov = B.getHFOVFromVFOV(f.insideFOV, n.aspect, 1); //获得在当前窗口的横向的fov
  22512. var distance = Math.abs(boxSize.x) / 2 / Math.tan(THREE.Math.degToRad(fov / 2))//根据上面获得的参数得到target到相机的距离
  22513. console.log(boxSize.x,distance, boxSize.length() / 2)
  22514. distance += boxSize.length() / 2 //由于此时模型从中心向相机的部分由于近大远小仍超出屏幕,所以将target放在靠近模型靠近相机的这一端,故而再加上box的对角线长度的一半, 虽然本该加上Math.sqrt(boxSize.z*boxSize.z +boxSize.y+boxSize.y)/2,但是这样模型显得比较满
  22515. if(this.mode === u.PANORAMA){
  22516. i.target.copy(this.model.center);
  22517. var vec = this.getDirection().negate().setY(1).normalize()//获得朝向
  22518. }else{
  22519. i.target.copy(this.target.clone().setY(this.model.center.y))
  22520. var vec = d.DOWN.clone().applyQuaternion(this.quaternion).setY(1).normalize()
  22521. }
  22522. vec.multiplyScalar(distance )
  22523. n.position.copy(i.target.clone().add(vec))
  22524. break
  22525. case u.FLOORPLAN:
  22526. n.position.copy(this.model.center).setY(f.floorplan.cameraHeight),
  22527. i.target.copy(this.model.center).setY(0),
  22528. i.zoomToContain(this.model.size),
  22529. i.rotateToView(this.model.size, this.getDirection())
  22530. }
  22531. i.update(0)
  22532. }
  22533. ,
  22534. n.prototype.update = function() {
  22535. var e = (new r.Vector3,
  22536. {})
  22537. , t = [];
  22538. return function(i) {
  22539. this.updatePersistentZooming(i),
  22540. this.updateFromControls(i),
  22541. this.getCurrentNodePanos(t)
  22542. if(this.hasChanged(e) ) {
  22543. this.lastChangeTime = Date.now(),
  22544. !this.mouseDown && this.containsMouse && this.updateIntersect(),
  22545. this.emit(w.ViewChanged),
  22546. this.intersectHot && this.intersectHot.showTitle()
  22547. this.intersect && this.magnifier && this.magnifier.update(this.intersect.point)
  22548. }
  22549. if(e.cameraChanged){
  22550. //this.controlVideosPlay()
  22551. for(var i in this.model.hots){
  22552. this.model.hots[i].update(this.camera)
  22553. }
  22554. this.overlayGroup.children.forEach(overlay=>{
  22555. overlay.update()
  22556. })
  22557. }
  22558. this.model.supportsTiles && (this.updateTileDownloader(t),
  22559. this.updatePanoRenderer(t)),
  22560. this.updatePreRendering(t),
  22561. this.reticule.update(),
  22562. this.path.update(),
  22563. this.spider.update(),
  22564. this.cachedPanoCandidates && f.navigation.panoScores && this.model.panos.showPanoScores(this.cachedPanoCandidates),
  22565. this.updateControlLocks(),
  22566. this.model.supportsTiles && this.updateZoomPano()
  22567. }
  22568. }(),
  22569. /* n.prototype.controlVideosPlay = function() {//判断box视频是否可见 不可见就暂停
  22570. var lastMode, lastPano;
  22571. return function(){
  22572. var mode = this.mode;
  22573. var pano = mode == "panorama" ? this.currentPano : "";
  22574. if(mode != "panorama" || pano != lastPano){
  22575. overlay.noBlock = null
  22576. }
  22577. this.overlayGroup.children.forEach((overlay)=>{
  22578. if(overlay.overlayType == "video" ){
  22579. var matrix = overlay.plane.matrixWorld;
  22580. var inSight = false;
  22581. var cameraDir = this.getDirection();
  22582. var planeDir = (new r.Vector3).copy(d.FORWARD).applyQuaternion(overlay.plane.quaternion)
  22583. var vertexes = []
  22584. if(cameraDir.angleTo(planeDir)>Math.PI/2){//朝向相机视线
  22585. for(let i=0; i<4; i++){
  22586. var vertex = overlay.plane.geometry.vertices[i].clone().applyMatrix4(matrix)
  22587. vertexes.push(vertex)
  22588. if(overlay.noBlock == null){
  22589. if(!m.ifShelter(vertex)){
  22590. overlay.noBlock = true
  22591. }
  22592. inSight = true; break;
  22593. }else{
  22594. overlay.noBlock = true
  22595. }
  22596. if(m.getPos2d(vertex, this.camera, $("#player")[0]).inSight){
  22597. inSight = true; break;
  22598. }
  22599. }
  22600. }
  22601. overlay.inSight = inSight
  22602. if(!inSight)overlay.plane.material.map.image.pause()
  22603. else overlay.plane.material.map.image.play()//maybe fail
  22604. }
  22605. })
  22606. lastMode = mode, lastPano = pano
  22607. }
  22608. }() */
  22609. n.prototype.updatePersistentZooming = function(e) {
  22610. 1 === this.zooming ? this.zoomBy(1 + this.zoomSpeed * e) : this.zooming === -1 && this.zoomBy(1 - this.zoomSpeed * e)
  22611. }
  22612. ,
  22613. n.prototype.updateControlLocks = function() {
  22614. this.currentPano && this.model.supportsTiles && (this.cameraControls.controls[u.PANORAMA].locked = !this.currentPano.highestFullTileRenderOpCompleted && this.currentPano.lockUntilRenderingComplete)
  22615. }
  22616. ,
  22617. n.prototype.updatePanoRenderer = function() {
  22618. var e = new r.Vector3;
  22619. return function(t) {
  22620. var i = this.nextPano || this.currentPano;
  22621. this.panoRenderer.hasQueuedTiles() && i && (e.copy(d.FORWARD),
  22622. this.getDirection(e),
  22623. this.panoRenderer.updateDirection(e))
  22624. }
  22625. }(),
  22626. n.prototype.cleanupInactivePanos = function() {
  22627. var e = []
  22628. , t = [];
  22629. return function() {
  22630. e.length = 0,
  22631. e.push(this.currentPano),
  22632. this.nextPano && e.push(this.nextPano),
  22633. t.length = 0;
  22634. for (var i = 0; i < this.panoRenderer.activePanos.length; i++)
  22635. t.push(this.panoRenderer.activePanos[i]);
  22636. for (var n = 0; n < t.length; n++) {
  22637. for (var r = t[n], o = !0, a = 0; a < e.length; a++)
  22638. r.id === e[a].id && (o = !1);
  22639. o && r.exit()
  22640. }
  22641. }
  22642. }(),
  22643. n.prototype.updatePreRendering = function() {
  22644. var e = {};
  22645. return function(t) {
  22646. if (1 === f.tiling.preRenderTourPanos && this.preRenderingEnabled) {
  22647. var i = this.nextPano || this.currentPano;
  22648. if (i && t && t.length > 1) {
  22649. var n = t.findIndex(function(e) {
  22650. if (e.id === i.id)
  22651. return !0
  22652. });
  22653. if (n >= 0 && n + 1 < t.length) {
  22654. var r = t[n + 1];
  22655. r.isLoaded(this.basePanoSize) || e[r.id] || (window.setTimeout(function(t) {
  22656. this.checkAndWaitForPanoLoad(t, "high", "low", this.basePanoSize, null, null, null, !1, !1, !1),
  22657. window.setTimeout(function(t) {
  22658. e[t.id] = !1
  22659. }
  22660. .bind(this, t), f.tiling.panoPreRenderRepeatDelay)
  22661. }
  22662. .bind(this, r), f.tiling.panoPreRenderDelay),
  22663. e[r.id] = !0)
  22664. }
  22665. }
  22666. }
  22667. }
  22668. }(),
  22669. n.prototype.enablePreRendering = function() {
  22670. this.preRenderingEnabled = !0
  22671. }
  22672. ,
  22673. n.prototype.disablePreRendering = function() {
  22674. this.preRenderingEnabled = !1,
  22675. this.cleanupInactivePanos()
  22676. }
  22677. ,
  22678. n.prototype.updateTileDownloader = function() {
  22679. var e = new r.Vector3;
  22680. return function(t) {
  22681. var i = this.nextPano || this.currentPano;
  22682. i && (e.copy(d.FORWARD),
  22683. this.getDirection(e),
  22684. this.tileDownloader.tilePrioritizer.updateCriteria(i, this.position, e, t.length > 0 ? t : null),
  22685. this.tileDownloader.processPriorityQueue = !0)
  22686. }
  22687. }(),
  22688. n.prototype.updateFromControls = function(e) {
  22689. null !== e && void 0 !== e || (e = 0),
  22690. this.cameraControls.activeControl && (this.cameraControls.activeControl.update(e),
  22691. this.quaternion.copy(this.cameraControls.activeControl.camera.quaternion),
  22692. this.position.copy(this.cameraControls.activeControl.camera.position),
  22693. this.target.copy(this.cameraControls.activeControl.target),
  22694. this.cameraControls.activeControl.camera.updateProjectionMatrix(),
  22695. this.camera.projectionMatrix.copy(this.cameraControls.activeControl.camera.projectionMatrix)),
  22696. this.camera.position.copy(this.position),
  22697. this.camera.quaternion.copy(this.quaternion),
  22698. this.camera.updateMatrix(),
  22699. this.camera.updateMatrixWorld()
  22700. }
  22701. ,
  22702. n.prototype.hasChanged = function(e) {
  22703. /* if (!this.previousState)
  22704. return this.previousState = {
  22705. allFloorsVisible: this.model.allFloorsVisible,
  22706. position: this.position.clone(),
  22707. quaternion: this.quaternion.clone(),
  22708. mouse: this.mouse.clone(),
  22709. labelScaleFactor: this.getLabelScaleFactor(),
  22710. currentFloor: this.model.currentFloor,
  22711. projectionMatrix: this.camera.projectionMatrix.clone(),
  22712. worldMatrix: this.camera.matrixWorld.clone(),
  22713. mode: this.mode,
  22714. modelPosition: this.model.position.clone(),
  22715. modelCenter: this.model.center.clone(),
  22716. zoomLevel: this.zoomLevel
  22717. },
  22718. !0;
  22719. 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;
  22720. return e.allFloorsVisible = this.model.allFloorsVisible !== this.previousState.allFloorsVisible,
  22721. e.moved = !this.position.equals(this.previousState.position),
  22722. e.rotated = !this.quaternion.equals(this.previousState.quaternion),
  22723. e.mouseMoved = !this.mouse.equals(this.previousState.mouse),
  22724. e.labelScaleFactor = this.getLabelScaleFactor() !== this.previousState.labelScaleFactor,
  22725. e.floorChanged = this.model.currentFloor !== this.previousState.currentFloor,
  22726. e.cameraProjectionChanged = !this.camera.projectionMatrix.equals(this.previousState.projectionMatrix),
  22727. e.cameraWorldMatrixChanged = !this.camera.matrixWorld.equals(this.previousState.worldMatrix),
  22728. e.modeChanged = this.mode !== this.previousState.mode,
  22729. e.modelPositionChanged = !this.model.position.equals(this.previousState.modelPosition),
  22730. e.modelCenterChanged = !this.model.center.equals(this.previousState.modelCenter),
  22731. e.nextPanoActive = null !== this.nextPano,
  22732. e.zoomLevel = this.zoomLevel !== this.previousState.zoomLevel,
  22733. this.previousState.allFloorsVisible = this.model.allFloorsVisible,
  22734. this.previousState.position.copy(this.position),
  22735. this.previousState.quaternion.copy(this.quaternion),
  22736. this.previousState.mouse.copy(this.mouse),
  22737. this.previousState.labelScaleFactor = this.getLabelScaleFactor(),
  22738. this.previousState.currentFloor = this.model.currentFloor,
  22739. this.previousState.projectionMatrix.copy(this.camera.projectionMatrix),
  22740. this.previousState.worldMatrix.copy(this.camera.matrixWorld),
  22741. this.previousState.mode = this.mode,
  22742. this.previousState.modelPosition.copy(this.model.position),
  22743. this.previousState.modelCenter.copy(this.model.center),
  22744. this.previousState.zoomLevel = this.zoomLevel,
  22745. !t */
  22746. if (!this.previousState)
  22747. {
  22748. this.previousState = {
  22749. allFloorsVisible: this.model.allFloorsVisible,
  22750. position: this.position.clone(),
  22751. quaternion: this.quaternion.clone(),
  22752. mouse: this.mouse.clone(),
  22753. //labelScaleFactor: this.getLabelScaleFactor(),
  22754. currentFloor: this.model.currentFloor,
  22755. projectionMatrix: this.camera.projectionMatrix.clone(),
  22756. worldMatrix: this.camera.matrixWorld.clone(),
  22757. mode: this.mode,
  22758. modelPosition: this.model.position.clone(),
  22759. modelCenter: this.model.center.clone(),
  22760. zoomLevel: this.zoomLevel
  22761. };
  22762. return !0;
  22763. }
  22764. //许钟文改 分成相机是否改变cameraChanged 和其他
  22765. 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)
  22766. 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 ;
  22767. e.cameraChanged = !a;
  22768. /* if(!t){//主要判断相机是否旋转
  22769. e.cameraChanged2 = !MathLight.closeTo(this.quaternion, this.previousState.quaternion, 3) || !MathLight.closeTo(this.position, this.previousState.position, 4)
  22770. }else e.cameraChanged2 = false */
  22771. e.allFloorsVisible = this.model.allFloorsVisible !== this.previousState.allFloorsVisible,
  22772. e.moved = !this.position.equals(this.previousState.position),
  22773. e.rotated = !this.quaternion.equals(this.previousState.quaternion),
  22774. e.mouseMoved = !this.mouse.equals(this.previousState.mouse),
  22775. // e.labelScaleFactor = this.getLabelScaleFactor() !== this.previousState.labelScaleFactor,
  22776. e.floorChanged = this.model.currentFloor !== this.previousState.currentFloor,
  22777. e.cameraProjectionChanged = !this.camera.projectionMatrix.equals(this.previousState.projectionMatrix),
  22778. e.cameraWorldMatrixChanged = !this.camera.matrixWorld.equals(this.previousState.worldMatrix),
  22779. e.modeChanged = this.mode !== this.previousState.mode,
  22780. e.modelPositionChanged = !this.model.position.equals(this.previousState.modelPosition),
  22781. e.modelCenterChanged = !this.model.center.equals(this.previousState.modelCenter),
  22782. e.nextPanoActive = null !== this.nextPano,
  22783. e.zoomLevel = this.zoomLevel !== this.previousState.zoomLevel,
  22784. this.previousState.allFloorsVisible = this.model.allFloorsVisible,
  22785. this.previousState.position.copy(this.position),
  22786. this.previousState.quaternion.copy(this.quaternion),
  22787. this.previousState.mouse.copy(this.mouse),
  22788. //this.previousState.labelScaleFactor = this.getLabelScaleFactor(),
  22789. this.previousState.currentFloor = this.model.currentFloor,
  22790. this.previousState.projectionMatrix.copy(this.camera.projectionMatrix),
  22791. this.previousState.worldMatrix.copy(this.camera.matrixWorld),
  22792. this.previousState.mode = this.mode,
  22793. this.previousState.modelPosition.copy(this.model.position),
  22794. this.previousState.modelCenter.copy(this.model.center),
  22795. this.previousState.zoomLevel = this.zoomLevel;
  22796. //console.log("cameraChanged2 "+ e.cameraChanged2 + ", mouseMoved "+e.mouseMoved)
  22797. return !t
  22798. }
  22799. ,
  22800. n.prototype.updateIntersect = function() {
  22801. var e = this.flying || this.isWarping()
  22802. , t = this.isOutsideMode() && this.cameraControls.controls[this.mode].isEngaged()
  22803. , i = y.getById(V.LookTransition)
  22804. , n = !(e || t || this.isTouchEvent || i.length && i[0].running);
  22805. //this.tagManager.intersecttag(this.mouse, n, this.camera) || (this.intersect = this.getMouseIntersect(),//--MP
  22806. this.intersect = this.getMouseIntersect(); //xzw change
  22807. this.intersect && this.updateClosestPano(this.intersect),
  22808. // this.intersect && console.log(this.intersect.point),
  22809. this.closestPano || this.closestPanoInDirection(this.getMouseDirection()) ? (this.reticule.updatePosition(this.position, this.intersect),
  22810. f.navigation.panoScores && !f.navigation.mouseDirection && this.closestPanoInDirection(this.getDirection())) : this.reticule.hide()
  22811. }
  22812. ,
  22813. n.prototype.checkHotClick = function() {
  22814. if(this.intersectHot){
  22815. this.intersectHot.examine(this)
  22816. /* g_touraudio.pause();
  22817. g_bgaudio = false;
  22818. document.getElementById("bgaudio").pause();
  22819. var sWidth = document.body.scrollWidth;
  22820. var sHeight = document.body.scrollHeight;
  22821. var pop1 = document.getElementById('popup');
  22822. pop1.style.display = "block";
  22823. var myElement = document.createElement("iframe");
  22824. myElement.src = g_HotMeshes[i].hotLink;
  22825. myElement.id = "id1";
  22826. myElement.allowTransparency = "true";
  22827. myElement.style.width = "100%";
  22828. myElement.style.height = "100%";
  22829. myElement.scrolling = "no";
  22830. var element=document.getElementById("id1");
  22831. if (typeof(element)== "undefined" || element == null){
  22832. document.getElementById("popup").appendChild(myElement);
  22833. }
  22834. var oClose = document.getElementById("closepop");
  22835. oClose.onclick = function() {
  22836. pop1.style.display = "none";
  22837. document.getElementById("popup").removeChild(document.getElementById("id1"));
  22838. $("#popup iframe:last").remove();
  22839. document.getElementById("bgaudio").play();
  22840. } */
  22841. return true;
  22842. }
  22843. },
  22844. n.prototype.getMouseDirection = function(e) {
  22845. e = e || this.mouse;
  22846. var t = new r.Vector3(e.x,e.y,-1).unproject(this.camera)
  22847. , i = new r.Vector3(e.x,e.y,1).unproject(this.camera);
  22848. return i.sub(t).normalize()
  22849. }
  22850. ,
  22851. n.prototype.hoverOverlay = function(mesh){
  22852. if(!mesh){
  22853. this.hoveringPlane = null;
  22854. $("#player").css("cursor",this.currentCursor || "" );
  22855. }else{
  22856. var overlay = mesh.parent;
  22857. $("#player").css("cursor","pointer");
  22858. this.hoveringPlane = overlay;
  22859. return true;
  22860. }
  22861. },
  22862. n.prototype.clickOverlay = function(overlay){
  22863. if(this.openOverlay && !overlay)return;
  22864. if(overlay == window.videoPlane){
  22865. if(overlay.material.map.image.paused) playVideo(true)
  22866. else playVideo(false)
  22867. return
  22868. }
  22869. var plane = overlay.plane;
  22870. if(overlay.overlayType == "video"){
  22871. /* if(plane.material.map.image.paused) plane.material.map.image.play()
  22872. else plane.material.map.image.pause() */
  22873. overlay.switchPlay(!!overlay.pausedByUser)
  22874. }
  22875. /* if(window.EditOverlay &&EditOverlay.editing){
  22876. if(EditOverlay.editPlane && overlay != EditOverlay.editPlane) EditOverlay.closeOverlayPanel('cancel')
  22877. $('#overlayProp').removeClass('atRight').removeClass('hide')
  22878. EditOverlay.endAddPlane();
  22879. EditOverlay.updateOverlayPanel(overlay)
  22880. EditOverlay.controlSelectOverlay(overlay)
  22881. return;
  22882. } */
  22883. },
  22884. n.prototype.getMouseIntersect = function(e, t) {//xzw change
  22885. e = e || this.mouse.clone(),
  22886. t = t || this.model.floors.reduce(function(e, t) {
  22887. return t.hidden ? e : e.concat(t.collider.children)
  22888. }, this.mode === u.PANORAMA ? this.panoMarkers : []);
  22889. for(var i in this.model.hots){
  22890. t.push(this.model.hots[i].mesh);
  22891. }
  22892. window.videoPlane && t.push(window.videoPlane)
  22893. this.overlayGroup && (t = t.concat(this.overlayGroup.children.filter(e=>e.overlayType == "video")));
  22894. var i = new r.Vector3(e.x,e.y,-1).unproject(this.camera);
  22895. this.raycaster.set(i, this.getMouseDirection(e));
  22896. var n = this.raycaster.intersectObjects(t, true);//add true
  22897. // n[0] && console.log(n[0].point);
  22898. if(g_HotStatus=="add"){
  22899. var points = this.raycaster.intersectObjects(window.player.model.chunks);
  22900. console.log(points[0]);
  22901. points.length >= 1? ($('#player').css('cursor', 'cell'),window.hotPointPos = points[0].point): ($('#player').css('cursor', 'not-allowed'), window.hotPointsPos = false)
  22902. }
  22903. this.intersectHot && this.intersectHot.hideTitle()
  22904. if (0 === n.length){
  22905. this.intersectHot = null; //add
  22906. if(g_HotStatus!="add") $("#player").css("cursor","");
  22907. return null;
  22908. }
  22909. var o = n[0];
  22910. if(o.object.type == "hotSprite"){ //add
  22911. this.intersectHot = o.object.belongHot;
  22912. this.intersectHot.showTitle()
  22913. this.intersectHot.actionType == 'noAction' || $("#player").css("cursor","pointer");
  22914. return;
  22915. }
  22916. this.intersectHot = null;
  22917. if(o.object == window.videoPlane){
  22918. this.hoveringPlane = window.videoPlane;
  22919. $("#player").css("cursor","pointer");
  22920. return
  22921. }
  22922. var intersect = this.hoverOverlay(this.overlayGroup && o && o.object.parent.parent == this.overlayGroup && o.object)
  22923. if(!intersect && g_HotStatus!="add") $("#player").css("cursor","");
  22924. if (o.face) {
  22925. o.normal = o.face.normal.applyQuaternion(o.object.quaternion);
  22926. var a = this.position.clone().sub(o.point);
  22927. a.dot(o.normal) < 0 && o.normal.negate(),
  22928. this.currentPano ? o.onFloor = o.point.y < this.position.y - .5 * this.currentPano.height : o.onFloor = o.point.y < this.position.y - .5,
  22929. o.horizontal = o.normal.y > .8
  22930. }
  22931. // console.log(o.point);
  22932. return o
  22933. }
  22934. ,
  22935. n.prototype.updateClosestPano = function(e) {
  22936. var t = [s.filters.isPanoAligned()];
  22937. if (this.mode === u.PANORAMA) {
  22938. if (!this.currentPano)
  22939. return;
  22940. t.push(s.filters.not(this.currentPano)),
  22941. t.push(s.filters.inFloorDirection(this.currentPano.floorPosition, this.getDirection(), .25)),
  22942. t.push(s.filters.isNeighbourPanoTo(this.currentPano)),
  22943. t.push(s.filters.isCloseEnoughTo(e.point, f.panoFloorClickRadius)),
  22944. t.push(s.filters.isNotBehindNormal(e.point, e.normal))
  22945. } else{
  22946. t.push((pano)=>{ // add
  22947. return this.checkHasNeighbor(pano)
  22948. })
  22949. t.push(s.filters.isOnVisibleFloor()),
  22950. this.mode !== u.FLOORPLAN && t.push(s.filters.inDirection(this.position, this.getDirection(), .25));
  22951. }
  22952. var i = this.model.panos.find(t, [s.sortFunctions.floorDistanceToPoint(e.point)]);
  22953. i !== this.closestPano ? (i && (this.isPanoHover = !0),
  22954. this.emit(w.ClosestPanoChanging, this.closestPano, i, this.mode),
  22955. this.closestPano = i) : this.isPanoHover = !1
  22956. }
  22957. ,
  22958. n.prototype.dollhouseMode = function(e, t) {
  22959. this.emit(w.ModeChanging, this.mode, u.DOLLHOUSE),
  22960. this.mode = u.DOLLHOUSE,
  22961. this.cameraControls.controls[u.DOLLHOUSE].reset();
  22962. var i = new r.Vector3(this.model.center.x,0,this.model.center.z)
  22963. , n = new r.Vector3(15,10,15);
  22964. if (e && t) {
  22965. var o = d.FORWARD.clone().applyQuaternion(t)
  22966. , a = this.model.center.clone().sub(e)
  22967. , s = a.dot(o);
  22968. s > 0 ? (i = o.clone().multiplyScalar(s).add(e),
  22969. n.copy(e)) : F.warn("Tried to initiate dollhouse mode that wasn't looking at the model", e, t)
  22970. }
  22971. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(0, !0),
  22972. this.cameraControls.controls[u.DOLLHOUSE].target.copy(i),
  22973. this.cameraControls.cameras[u.DOLLHOUSE].position.copy(n),
  22974. this.updateFromControls(),
  22975. this.model.alpha = 1,
  22976. this.model.skybox.material.uniforms.opacity.value = 0
  22977. }
  22978. ,
  22979. n.prototype.insideMode = function(e, t) {
  22980. var i = $.Deferred()
  22981. , n = t || null;
  22982. if (this.mode !== u.PANORAMA && this.mode !== u.TRANSITIONING) {
  22983. var r = [s.filters.isPanoAligned()];
  22984. this.model.currentFloor && r.push(s.filters.atFloor(this.model.currentFloor)),
  22985. e = e || this.currentPano || this.model.panos.find(r, [s.sortFunctions.distanceToPoint(this.cameraControls.activeControl.target)]),
  22986. this.flyToNewMode({
  22987. mode: u.PANORAMA,
  22988. pano: e,
  22989. callback: n
  22990. }).done(i.resolve.bind(i)).fail(i.reject.bind(i))
  22991. } else {
  22992. var o = this.mode === u.PANORAMA ? "Already in panorama mode" : "Cannot change mode during mode transition";
  22993. i.reject(o)
  22994. }
  22995. return i.promise()
  22996. }
  22997. ,
  22998. n.prototype.fitDollhouse = function(e, t, i) {//许钟文改 飞入前寻找和初始视角最合适的位置
  22999. //if(urlHasValue('oldEntry')){
  23000. //搬自一代。
  23001. var maxY = this.model.boundingBox.max.y;
  23002. var n = d.FORWARD.clone().applyQuaternion(i)
  23003. , i = n.clone().add(e);
  23004. this.cameraControls.activeControl.target.copy(i),
  23005. this.cameraControls.activeControl.camera.position.set(0, maxY * 2.4, 0).add(e).add(n.multiplyScalar(-10))
  23006. //return;
  23007. /* //this.camera.position.copy(this.model.center);
  23008. //this.camera.updateMatrixWorld()
  23009. this.switchCameraMode("dollhouse", i) */
  23010. //}//下面是二代代码,看不太懂。因为有的场景在靠近一端的某个方向截取的初始视角会甩镜头,也就是不是下去之后的方向
  23011. //直接用一代的这个 效果和二代几乎一样,且不会甩
  23012. /* var n = d.FORWARD.clone().applyQuaternion(i);
  23013. this.cameraControls.activeControl.target.copy(n).add(e);
  23014. var o = d.RIGHT.clone().applyQuaternion(i)
  23015. , a = d.UP.clone()
  23016. , s = o.clone().applyAxisAngle(a, Math.PI / 2)
  23017. , l = this.model.boundingBox.max.clone()
  23018. , c = this.model.boundingBox.min.clone()
  23019. , 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)]
  23020. , u = 0
  23021. , p = 0
  23022. , g = 0;
  23023. h.forEach(function(e, t, i) {
  23024. var n = Math.abs(e.dot(o))
  23025. , r = e.dot(s);
  23026. n > u && (u = n,
  23027. p = r),
  23028. r > g && (g = r)
  23029. });
  23030. 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)))
  23031. , v = s.clone().multiplyScalar(p).add(t)
  23032. , A = s.clone().multiplyScalar(g).add(t);
  23033. p = u / Math.tan(this.cameraControls.activeControl.camera.fov / 2 * this.cameraControls.activeControl.camera.aspect * (Math.PI / 180));
  23034. g = m / Math.tan(this.cameraControls.activeControl.camera.fov / 2 * (Math.PI / 180));
  23035. p = Math.max(p, 10),
  23036. g = Math.max(g, 10);
  23037. var y = n.clone().multiplyScalar(-p).add(v).sub(t).length()
  23038. , C = n.clone().multiplyScalar(-g).add(v).sub(t).length();
  23039. this.cameraControls.activeControl.maxDistance = f.skyboxRadius - 1;
  23040. y >= C ? this.cameraControls.activeControl.camera.position.set(0, 6, 0).add(v).add(n.multiplyScalar(1.1 * -p))
  23041. : this.cameraControls.activeControl.camera.position.set(0, 6, 0).add(A).add(n.multiplyScalar(1.1 * -g))
  23042. */
  23043. }
  23044. ,
  23045. n.prototype.floorplanMode = function(e, t, i) {
  23046. this.mode = u.FLOORPLAN;
  23047. var n = this.cameraControls.controls[u.FLOORPLAN];
  23048. n.reset();
  23049. var r = e ? e : this.model.center;
  23050. if (n.target.copy(r).setY(0),
  23051. n.camera.position.copy(r).setY(f.floorplan.cameraHeight),
  23052. i ? (n.currentScale = i / ($("#player").width() / $("#player").height()),
  23053. n.absoluteScale = n.currentScale) : n.zoomToContain(this.model.size),
  23054. t) {
  23055. var o = d.LEFT.clone().applyQuaternion(t);
  23056. n.rotateLeft(-Math.atan2(o.x, o.z))
  23057. } else
  23058. n.rotateToView(this.model.size, this.getDirection());
  23059. n.update(0)
  23060. }
  23061. ,
  23062. n.prototype.nonInterruptingFlyToPano = function(e, t) {
  23063. return e.skipWarpingCheck = !0,
  23064. this.flyToPano(e, t)
  23065. }
  23066. ,
  23067. n.prototype.updateMarkerVisi = function() {//加
  23068. if(this.mode != "panorama")return;
  23069. this.model.panos.list.forEach((pano)=>{
  23070. if(!pano.marker)return;
  23071. pano.marker.material.visible = !!pano.neighbourPanos[this.currentPano.id];
  23072. })
  23073. }
  23074. ,
  23075. n.prototype.updateHotVisible = function(pano){
  23076. var hots = this.model.hots;
  23077. pano = pano || this.currentPano;
  23078. for (var index in hots){
  23079. var visible;
  23080. if(this.mode != "panorama"){
  23081. visible = true;
  23082. }else{
  23083. //hots[index].mesh.material.depthTest = false;
  23084. visible = !hots[index].visiblePanos || hots[index].visiblePanos.indexOf(pano.id) > -1
  23085. }
  23086. hots[index].mesh.visible = visible;
  23087. }
  23088. }
  23089. n.prototype.flyToPano = function(e, t) {
  23090. var i = e.pano
  23091. , aim = e.lookAtPoint
  23092. , aimQua = e.quaternion //ADD
  23093. , o = e.duration
  23094. , a = e.aimDuration
  23095. , s = e.maxDistanceOverride
  23096. , l = e.skipWarpingCheck
  23097. , c = e.constantMoveSpeed
  23098. , h = null
  23099. , p = null
  23100. if (aim){
  23101. var _ = (new r.Matrix4).lookAt(i.position, aim, d.UP)
  23102. aimQua = (new r.Quaternion).setFromRotationMatrix(_)
  23103. }
  23104. else aimQua = aimQua
  23105. var zoomLevel = e.zoomLevel || 1 //add
  23106. if(this.flying) return t && t(e)
  23107. window.specialScene && specialScene.special().specifySpot && specialScene.special().specifySpot(i);
  23108. if (this.isWarping() && !l && (this.path.activeTransType === x.BLACK || this.path.activeTransType === x.STD))
  23109. return F.warn("Player.flyToPano() -> Cannot fly when warping"),
  23110. t && t(),
  23111. !1;
  23112. if (this.updateLastView(),
  23113. this.mode !== u.PANORAMA) {
  23114. var m;
  23115. void this.flyToNewMode({
  23116. mode: u.PANORAMA,
  23117. pano: i,
  23118. duration: o,
  23119. quaternion: aimQua ,
  23120. callback: t
  23121. })
  23122. }
  23123. if (!i || (h = g.deepExtend(e),
  23124. p = function() {
  23125. N.delayOneFrame(function() {
  23126. this.flyToPano(h, t)
  23127. }
  23128. .bind(this))
  23129. }
  23130. .bind(this),
  23131. !this.checkAndWaitForPanoLoad(i, "high", "low", this.basePanoSize, p))) {
  23132. var C = function(e) {
  23133. t && t(e)
  23134. }
  23135. .bind(this);
  23136. this.currentPano || (this.currentPano = i,
  23137. this.path.placeCpm(),
  23138. this.path.fadeOutCpm(f.path.fadeOutTime),
  23139. this.spider.draw());
  23140. var I = o;
  23141. if ("number" != typeof o) {
  23142. var E = s || f.transition.flytimeMaxDistanceThreshold;
  23143. I = Math.min(this.currentPano.position.distanceTo(i.position), E) * f.transition.flytimeDistanceMultiplier + f.transition.flyTime
  23144. }
  23145. if (f.transition.flySpeed > .01 && (I = 1e3 * this.currentPano.position.distanceTo(i.position) / f.transition.flySpeed),
  23146. zoomLevel !== this.zoomLevel)
  23147. switch (f.zoom.transitionStyle) {
  23148. case 1:
  23149. this.smoothZoomFovTo(null, zoomLevel, zoomLevel == 1 ? I / 2 : I); //改
  23150. break;
  23151. case 2:
  23152. return h = g.deepExtend(e),
  23153. p = this.flyToPano.bind(this, h, t),
  23154. void this.smoothZoomFovTo(null, zoomLevel, f.zoom.restoreTime * (this.zoomLevel - 1), p)
  23155. }
  23156. if (aimQua) {
  23157. y.cancelById(V.LookTransition),
  23158. I *= f.transition.aimSlowFactor;
  23159. var b = this.cameraControls.activeControl.camera.quaternion.clone()
  23160. , S = b.clone()
  23161. , M = new r.Vector3;
  23162. if (i === this.currentPano) {
  23163. var R = d.FORWARD.clone().applyQuaternion(b)
  23164. , P = d.FORWARD.clone().applyQuaternion(aimQua)
  23165. , O = R.angleTo(P);
  23166. return void 0 !== a && null !== a || (a = 1 * Math.sqrt(O) / f.tags.navigate.rotateSpeedFactor * 1e3),
  23167. void y.start(function(e) {
  23168. S.copy(b),
  23169. v.quaternion(S, aimQua)(e),
  23170. M.copy(d.FORWARD).applyQuaternion(S).add(this.cameraControls.activeControl.camera.position),
  23171. this.cameraControls.activeControl.lookAt(M)
  23172. }
  23173. .bind(this), a, C, 0, A[f.transition.movementEasing], null, V.LookTransition)
  23174. }
  23175. }
  23176. if (i === this.currentPano || this.flying)
  23177. return void C();
  23178. this.flying = !0;
  23179. var L = this.position.clone()
  23180. , D = this.currentPano;
  23181. F.debug("Flying to pano ", i.position),
  23182. this.emit(w.PanoChosen, this.currentPano, i),
  23183. this.emit(w.FlyingStarted, i.position, L, i, D)
  23184. //---------before fly--------------- add
  23185. this.updateHotVisible(i); //更新热点显示
  23186. this.transitionPos({type:"beforeFlytopano", pano:i, dur:I})//add
  23187. Overlay.updateVisibles([this.currentPano, i])
  23188. //地标变化
  23189. if(this.model.floorLogos){
  23190. this.model.changefloorLogoOpa({index:0, opa:0, dur: p, delay:0.7})//this.model.floorLogoFade(0, _duration*0.5, 0.7);
  23191. this.model.floorLogos[1].position.copy(i.floorPosition.clone().sub(this.model.position));
  23192. //this.model.adjustfloorLogoHeight();
  23193. this.model.floorLogos[1].material.opacity = 0;//uniforms.opacity.value = 0;
  23194. this.model.floorLogos[1].visible = true;
  23195. this.model.changefloorLogoOpa({index:1, opa:1, dur: 250})//this.model.floorLogoShow(1,250);
  23196. }
  23197. //=======================================
  23198. aimQua && y.start(function(e) {
  23199. S.copy(b),
  23200. v.quaternion(S, aimQua)(e),
  23201. M.copy(d.FORWARD).applyQuaternion(S).add(this.cameraControls.activeControl.camera.position),
  23202. this.cameraControls.activeControl.lookAt(M)
  23203. }
  23204. .bind(this), I, null, 0, A[f.transition.movementEasing], null, V.LookTransition);
  23205. var B = c ? null : A[f.transition.movementEasing];
  23206. this.nextPano = i
  23207. //===========================
  23208. updateVideo({type:"beforeFlytopano", pano:i, dur:I})//add
  23209. //===========================
  23210. y.start(v.uniform(this.model.skybox, "progress", 1), I, null, 0, A[f.transition.blendEasing], "skyFly", V.FlyToPano),
  23211. y.start(v.allUniforms(this.model.chunks, "progress", 1), I, null, 0, A[f.transition.blendEasing], "chunkFly", V.FlyToPano),
  23212. y.start(v.vector(this.cameraControls.cameras[u.PANORAMA].position, i.position), I, function(e) {
  23213. this.flying = !1,
  23214. this.currentPano !== i && this.currentPano.exit(),
  23215. i.enter(),
  23216. this.currentPano = i,
  23217. this.nextPano = null,
  23218. this.path.placeCpm(),
  23219. this.path.fadeOutCpm(f.path.fadeOutTime),
  23220. this.spider.draw(),
  23221. this.emit(w.FlyingEnded, i.position, L, i, D),
  23222. this.updateMarkerVisi(),//add
  23223. C(e)
  23224. //add:
  23225. if(this.mode == "panorama" ){
  23226. if(this.model.floorLogos){
  23227. this.model.floorLogos[0].position.copy(this.model.floorLogos[1].position)
  23228. //this.model.adjustfloorLogoHeight()
  23229. this.model.changefloorLogoOpa({index:0,opa:1,dur:0});//this.model.floorLogos[0].material.uniforms.opacity.value = 1;
  23230. this.model.floorLogos[1].visible = false;
  23231. }
  23232. updateVideo({type:"flyDone", pano:i})//add
  23233. Overlay.updateVisibles([this.currentPano])//add
  23234. }
  23235. }
  23236. .bind(this), 0, B, "camFly", V.FlyToPano)
  23237. }
  23238. }
  23239. ,
  23240. window._transitionPosId = 9999
  23241. n.prototype.transitionPos = function(o={}) {//渐变overlay和热点的位置
  23242. y.cancelById(_transitionPosId)
  23243. var begin = function(object, pos, qua, scale){
  23244. if(pos){
  23245. if(!same(object.position, pos, 0.01)){
  23246. y.start(v.vector(object.position, pos), o.dur, (e)=>{
  23247. },0, A[f.transition.movementEasing], "transitionPos", _transitionPosId)
  23248. }
  23249. if(qua && !same(object.quaternion, qua, 1e-6)){
  23250. y.start(v.quaternion(object.quaternion, qua), o.dur, (e)=>{
  23251. },0, A[f.transition.movementEasing], "transitionPos", _transitionPosId)
  23252. }
  23253. if(scale && !same(object.scale, scale, 0.001)){
  23254. y.start(v.vector(object.scale, scale), o.dur, (e)=>{
  23255. },0, A[f.transition.movementEasing], "transitionPos", _transitionPosId)
  23256. }
  23257. }
  23258. }
  23259. var same = function(vec1, vec2, diff){
  23260. var s = Math.abs(vec1.x-vec2.x) < diff && Math.abs(vec1.y-vec2.y) < diff && Math.abs(vec1.z-vec2.z) < diff
  23261. if(s && vec1.w) s = Math.abs(vec1.w-vec2.w) < diff
  23262. return s
  23263. }
  23264. var sid = o.pano != void 0 ? o.pano.id : "outside";
  23265. this.overlayGroup.children.forEach(overlay=>{
  23266. var panoData = overlay.transformAtPanos[sid]
  23267. var useCustom = !panoData
  23268. //if(overlay.usingTransformData || !useCustom){
  23269. var pos = useCustom ? overlay.posCustom : panoData.pos;
  23270. var qua = useCustom ? overlay.quaCustom : panoData.qua;
  23271. var scale = useCustom ? overlay.getScaleBySize(overlay.widthCustom, overlay.heightCustom) :
  23272. overlay.getScaleBySize(panoData.width , panoData.height)
  23273. scale = new THREE.Vector3(scale.x, scale.y, overlay.scale.z)
  23274. begin(overlay, pos, qua, scale )
  23275. //}
  23276. overlay.usingTransformData = !useCustom
  23277. })
  23278. for(let i in this.model.hots){//是否判断visible?
  23279. var hot = this.model.hots[i];
  23280. var panoData = hot.transformAtPanos[sid];
  23281. var useCustom = !panoData
  23282. //if(hot.usingTransformData || !useCustom){
  23283. var pos = useCustom ? hot.position : panoData.pos;
  23284. var qua = hot.isSprite ? null : (useCustom ? hot.quaternion : panoData.qua);
  23285. begin(hot.mesh, pos, qua )
  23286. //}
  23287. hot.usingTransformData = !useCustom;
  23288. }
  23289. }
  23290. window._tranOutsideFocus = 4399
  23291. n.prototype.focusPoint = function(o={}){//当在外时,聚焦相机到这一点
  23292. console.log("focusPoint")
  23293. if(this.mode == "floorplan"){
  23294. var modelSize = o.modelSize || new THREE.Vector3(8,8,8);//可视范围
  23295. var control = this.cameraControls.controls.floorplan;
  23296. var absoluteScale = control.getDefaultAbsoluteScale(modelSize)
  23297. var currentScale = control.absoluteScale;
  23298. var currentTarget = control.target.clone()
  23299. y.cancelById(window._tranOutsideFocus, true);
  23300. y.start(function(progress){
  23301. control.absoluteScale = absoluteScale*progress + currentScale*(1-progress);
  23302. control.target = o.aim.clone().multiplyScalar(progress).add(currentTarget.clone().multiplyScalar(1-progress))
  23303. control.camera.position.copy(control.target.clone().add(control.offset)) //维持角度
  23304. }.bind(this) , o.dur || 600, null/* cancelFuc */, 0, A[f.transition.movementEasing], "outsideFocus", window._tranOutsideFocus, null/* cancelFuc */);
  23305. }else if(player.mode == "dollhouse"){
  23306. var control = player.cameraControls.controls.dollhouse;
  23307. var radius = o.radius || 8;
  23308. var currentTarget = control.target.clone()
  23309. var dir = control.offset.clone().normalize()
  23310. var currentRadius = control.offset.length();
  23311. y.cancelById(window._tranOutsideFocus, true);
  23312. y.start(function(progress){
  23313. control.target = o.aim.clone().multiplyScalar(progress).add(currentTarget.clone().multiplyScalar(1-progress))
  23314. let radius_ = radius*progress+currentRadius*(1-progress)
  23315. control.camera.position.copy(control.target.clone().add(dir.clone().multiplyScalar(radius_)))
  23316. }.bind(this) , o.dur || 600, null/* cancelFuc */, 0, A[f.transition.movementEasing], "outsideFocus", window._tranOutsideFocus, null/* cancelFuc */);
  23317. }else if(this.mode == 'panorama'){
  23318. this.flyToPano({
  23319. lookAtPoint: o.aim.clone() ,
  23320. pano: this.currentPano,
  23321. aimDuration: o.dur || 600
  23322. })
  23323. }
  23324. }
  23325. n.prototype.fastForwardActivePanoFlight = function(e) {
  23326. e = e || f.transition.fastForwardFactor / 10 * 4 + 1,
  23327. y.adjustSpeed(V.FlyToPano, e),
  23328. y.adjustSpeed(V.LookTransition, e)
  23329. }
  23330. ,
  23331. n.prototype.flyToPanoClosestToMouse = function() {
  23332. if (Date.now() - this.mouseLastMoveTime > 50 && (this.intersect = this.getMouseIntersect(),
  23333. this.intersect && this.updateClosestPano(this.intersect)),
  23334. this.closestPano)
  23335. return this.flyToPano({
  23336. pano: this.closestPano
  23337. });
  23338. var e = this.getMouseDirection();
  23339. this.flyDirection(e) || this.flyToPano({
  23340. pano: this.currentPano
  23341. })
  23342. }
  23343. ,
  23344. n.prototype.flyLocalDirection = function(e) {
  23345. var t = this.getDirection(e)
  23346. , i = 1 === e.z ? .4 : .75
  23347. , n = 1 === Math.abs(e.x);
  23348. return this.flyDirection(t, i, n)
  23349. }
  23350. ,
  23351. n.prototype.flyDirection = function(e, t, i) {
  23352. this.closePopup();//xzw add
  23353. var n = $.Deferred();
  23354. this.history.invalidate();
  23355. var r = this.closestPanoInDirection(e, t, i);
  23356. return r ? this.flyToPano({
  23357. pano: r
  23358. }, n.resolve.bind(n, !0)) : (this.bump(e),
  23359. n.resolve(!1)),
  23360. n.promise()
  23361. }
  23362. ,
  23363. n.prototype.closestPanoInDirection = function(e, t, i) {
  23364. return this.rankedPanoInDirection(0, e, t, i)
  23365. }
  23366. ,
  23367. n.prototype.rankedPanoInDirection = function() {
  23368. var e = {
  23369. pano: null,
  23370. candidates: []
  23371. };
  23372. return function(t, i, n, r) {
  23373. t || (t = 0),
  23374. n = void 0 !== n ? n : .75;
  23375. var o = r ? "angle" : "direction";
  23376. 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),
  23377. this.cachedPanoCandidates = e.candidates,
  23378. e.pano
  23379. }
  23380. }(),
  23381. n.prototype.bump = function(e) {
  23382. if (this.mode === u.PANORAMA && !this.flying && !this.isWarping()) {
  23383. 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;
  23384. if (s)
  23385. t = function() {
  23386. y.start(v.property(this.cameraControls.cameras[u.PANORAMA], "zoom", a > 0 ? 1.04 : .96), o, i, 0, A.easeInOutSine, "bumpZStart")
  23387. }
  23388. .bind(this),
  23389. i = function() {
  23390. y.start(v.property(this.cameraControls.cameras[u.PANORAMA], "zoom", 1), 5 * o, n, 0, A.easeInOutSine, "bumpZRelax")
  23391. }
  23392. .bind(this);
  23393. else {
  23394. var l = this.camera.position.clone()
  23395. , c = e.clone();
  23396. this.raycaster.set(l, c);
  23397. var h = this.model.floors.reduce(function(e, t) {
  23398. return e.concat(t.collider.children)
  23399. }, [])
  23400. , d = this.raycaster.intersectObjects(h)
  23401. , p = d.length > 0 ? d[0].distance / 25 : .04
  23402. , g = l.clone().add(c.multiplyScalar(p));
  23403. t = function() {
  23404. y.start(v.vector(this.cameraControls.cameras[u.PANORAMA].position, g), o, i, 0, A.easeInOutSine, "bumpTStart")
  23405. }
  23406. .bind(this),
  23407. i = function() {
  23408. y.start(v.vector(this.cameraControls.cameras[u.PANORAMA].position, l), 5 * o, n, 0, A.easeInOutSine, "bumpTRelax")
  23409. }
  23410. .bind(this)
  23411. }
  23412. n = function() {
  23413. this.flying = !1
  23414. }
  23415. .bind(this),
  23416. this.flying = !0,
  23417. t()
  23418. }
  23419. }
  23420. ,
  23421. n.prototype.changeFloor = function(e) {
  23422. if (!this.is360View(this.mode, this.currentPano))
  23423. if (this.mode === u.PANORAMA) {
  23424. var t = this.history.reversePano(e);
  23425. t && t.isAligned() ? this.flyToPano({
  23426. pano: t
  23427. }) : this.changeFloorByScore(e)
  23428. } else
  23429. this.model.setFloor(this.model.nextFloor(e) || this.model.currentFloor)
  23430. }
  23431. ,
  23432. n.prototype.changeFloorByScore = function() {
  23433. var e = {
  23434. pano: null,
  23435. candidates: []
  23436. };
  23437. return function(t) {
  23438. var i = this.model.nextFloor(t);
  23439. 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),
  23440. void (e.pano ? (this.cachedPanoCandidates = e.candidates,
  23441. this.history.push(t, this.currentPano),
  23442. this.flyToPano({
  23443. pano: e.pano
  23444. })) : F.warn("No pano found on selected floor, not moving there."))) : void F.debug("player.changeFloor(" + t + "): no such floor")
  23445. }
  23446. }(),
  23447. n.prototype.gotoFloor = function(e) {
  23448. var t = e - this.model.currentFloor.floorIndex;
  23449. this.changeFloor(t)
  23450. }
  23451. ,
  23452. n.prototype.getDirection = function(e) {
  23453. return e = e ? e : (new r.Vector3).copy(d.FORWARD),
  23454. e.applyQuaternion(this.camera.quaternion)
  23455. }
  23456. ,
  23457. n.prototype.flyToSameMode = function(e, t, i, n, o) {
  23458. if (o = o || $.Deferred(),
  23459. this.mode === u.TRANSITIONING)
  23460. return F.warn("should not be transitioning here"),
  23461. n && n(!1),
  23462. o.reject().promise();
  23463. var a = i || !1
  23464. , s = i ? i.position : this.position
  23465. , l = this.position.clone()
  23466. , c = this.currentPano;
  23467. if (F.debug("New pose in mode " + this.mode),
  23468. !e || (retryCallback = function() {
  23469. N.delayOneFrame(function() {
  23470. this.flyToSameMode(e, t, i, n, o)
  23471. }
  23472. .bind(this))
  23473. }
  23474. .bind(this),
  23475. !this.checkAndWaitForPanoLoad(e, "high", "low", this.basePanoSize, retryCallback))) {
  23476. var h = function() {
  23477. this.emit(w.FlyingEnded, s, l, e, c),
  23478. n && n(!0)
  23479. }
  23480. .bind(this)
  23481. , d = f[this.mode]
  23482. , p = void 0 !== t ? t : d.transitionTime
  23483. , g = new r.Vector3
  23484. , C = new r.Vector3;
  23485. if (this.emit(w.FlyingStarted, s, l, e, c),
  23486. this.mode === u.PANORAMA)
  23487. F.warn("we should not be here for panorama views");
  23488. else if (this.mode === u.DOLLHOUSE)
  23489. if (a) {
  23490. var I = new r.Vector3(0,1,0);
  23491. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(1, !0),
  23492. this.model.warpDestFloors(i.floorVisibility),
  23493. C.copy(i.position);
  23494. var E = new r.Vector3(0,0,-1).applyQuaternion(i.quaternion)
  23495. , b = new r.Raycaster(C.clone(),E.clone(),0,1 / 0)
  23496. , _ = b.intersectObjects(this.model.colliders)
  23497. , T = 3;
  23498. _.length ? (g.copy(_[0].point),
  23499. T = .75 * C.distanceTo(g)) : (g.copy(E).multiplyScalar(3).add(C),
  23500. F.debug("Tried to restore dollhouse mode that did not intersect...", i.position, i.quaternion));
  23501. var x = (new r.Matrix4).lookAt(C, g, I)
  23502. , S = (new r.Euler).setFromRotationMatrix(x, f.warp.eOrder)
  23503. , M = g.distanceTo(C)
  23504. , R = (new r.Matrix4).lookAt(this.cameraControls.cameras[u.DOLLHOUSE].position, this.cameraControls.controls[u.DOLLHOUSE].target, I)
  23505. , P = (new r.Euler).setFromRotationMatrix(R, f.warp.eOrder)
  23506. , O = this.cameraControls.cameras[u.DOLLHOUSE].position.distanceTo(this.cameraControls.controls[u.DOLLHOUSE].target);
  23507. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(Math.min(O, T), !0);
  23508. var L = new r.Euler(S.x - P.x,S.y - P.y,S.z - P.z,f.warp.eOrder);
  23509. L.y = L.y > Math.PI ? L.y -= 2 * Math.PI : L.y < -Math.PI ? L.y += 2 * Math.PI : L.y,
  23510. this.path.burnsDir = Math.sign(L.y);
  23511. var D = new r.Euler(0,0,0,f.warp.eOrder)
  23512. , B = new r.Vector3;
  23513. y.start(v.vector(this.cameraControls.controls[u.DOLLHOUSE].target, g), p, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToSameMode),
  23514. y.start(function(e, t) {
  23515. D.x = P.x + e * L.x,
  23516. D.y = P.y + e * L.y,
  23517. D.z = P.z + e * L.z;
  23518. var i = O + e * (M - O);
  23519. B.set(0, 0, i).applyEuler(D).add(this.cameraControls.controls[u.DOLLHOUSE].target),
  23520. this.cameraControls.cameras[u.DOLLHOUSE].position.copy(B).add(this.model.position)
  23521. }
  23522. .bind(this), p, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToSameMode),
  23523. y.start(function(e, t) {
  23524. this.cameraControls.controls[u.DOLLHOUSE].update(),
  23525. this.quaternion.copy(this.cameraControls.cameras[u.DOLLHOUSE].quaternion),
  23526. this.position.copy(this.cameraControls.cameras[u.DOLLHOUSE].position)
  23527. }
  23528. .bind(this), p, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToSameMode)
  23529. } else
  23530. F.warn("invalid warp destination in flyToSameMode()? ignore it then");
  23531. else if (this.path.placeCpm(),
  23532. this.path.fadeInCpm(f.path.fadeInTime),
  23533. i) {
  23534. this.model.warpDestFloors(i.floorVisibility);
  23535. var U = this.cameraControls.cameras[u.FLOORPLAN]
  23536. , k = this.cameraControls.controls[u.FLOORPLAN]
  23537. , H = k.target.clone()
  23538. , G = i.position.clone().sub(H)
  23539. , z = U.position.clone().sub(k.target)
  23540. , W = z.length()
  23541. , j = new r.Vector3(-1,0,0).applyQuaternion(i.quaternion).normalize()
  23542. , Y = Math.atan2(k.offset.x, k.offset.z)
  23543. , X = Math.atan2(j.x, j.z)
  23544. , Z = k.absoluteScale
  23545. , q = m.convertWorkshopOrthoZoom(i.orthoZoom);
  23546. y.start(function(e, t) {
  23547. k.target.copy(G).multiplyScalar(e).add(H);
  23548. var i = Y + (X - Y) * e;
  23549. k.offset.x = W * Math.sin(i),
  23550. k.offset.z = W * Math.cos(i),
  23551. U.position.copy(k.target).add(k.offset),
  23552. k.absoluteScale = Z + e * (q - Z),
  23553. k.update(),
  23554. this.quaternion.copy(U.quaternion),
  23555. this.position.copy(U.position),
  23556. this.target.copy(k.target),
  23557. this.camera.projectionMatrix.copy(U.projectionMatrix)
  23558. }
  23559. .bind(this), p, null, 0, A[f.flydown.movementEasing], null, V.FlyToSameMode)
  23560. } else
  23561. F.info("flyToSameMode() funny floorplan view? skipping");
  23562. return y.setTimeout(function(e) {
  23563. this.mode = e,
  23564. h(),
  23565. o.resolve(!0)
  23566. }
  23567. .bind(this, this.mode), p, V.FlyToSameMode),
  23568. this.mode = u.TRANSITIONING,
  23569. o.promise()
  23570. }
  23571. }
  23572. ,
  23573. n.prototype.flyToNewMode = function(e, t) {
  23574. e = e || {};
  23575. var i = e.mode
  23576. , n = e.pano
  23577. , o = e.duration
  23578. , a = e.warpDest
  23579. , s = e.callback
  23580. , l = e.force
  23581. , c = e.quaternion;
  23582. if (t = t || $.Deferred(),
  23583. this.isWarping())
  23584. return F.warn("Player.flyToNewMode() -> Cannot fly when warping"),
  23585. s && s(!1),
  23586. t.reject("Cannot change mode during tour transition").promise();
  23587. if (this.mode === u.TRANSITIONING)
  23588. return s && s(!1),
  23589. t.reject("Cannot change mode during mode transition").promise();
  23590. if (i === this.mode)
  23591. return l ? (this.flyToSameMode(n, o, a, s).done(t.resolve.bind(t)).fail(t.reject.bind(t)),
  23592. t.promise()) : (s && s(!1),
  23593. t.reject("Already in " + i + " mode").promise());
  23594. var h = a || !1;
  23595. F.debug("Switching mode to " + i);
  23596. var d = function() {
  23597. N.delayOneFrame(function() {
  23598. this.flyToNewMode(e, t)
  23599. }
  23600. .bind(this))
  23601. }
  23602. .bind(this);
  23603. if (n && this.checkAndWaitForPanoLoad(n, "low", "low", this.basePanoSize, d))
  23604. return t.promise();
  23605. if (!this.model.meshTexturesLoaded && this.isOutsideMode(i))
  23606. return F.info("Waiting for model textures to be loaded before going out to dollhouse"),
  23607. this.model.waitForLoad(this.model, function() {
  23608. return this.model.meshTexturesLoaded;
  23609. }
  23610. .bind(this)),
  23611. this.model.loadMeshTextures().done(d),
  23612. t.promise();
  23613. this.history.invalidate(),
  23614. this.updateLastView();
  23615. var p = this.mode
  23616. , C = this.cameraControls.cameras[i];
  23617. e = g.deepExtend({}, f[i], f[p + "-" + i]);
  23618. var I = void 0 !== o ? o : e.transitionTime;
  23619. this.emit(w.ModeChanging, p, i, n),
  23620. n && (this.currentPano = n),
  23621. this.switchCameraMode(i, c),
  23622. y.cancelById(V.LookTransition);
  23623. //before fly---------------------
  23624. if(this.mode == "panorama"){
  23625. if(this.model.floorLogos){
  23626. this.model.floorLogos[0].visible = false;
  23627. this.model.floorLogos[1].visible = false;
  23628. }
  23629. }
  23630. if(i == "panorama"){
  23631. updateVideo({type:"beforeFlyIn", pano:this.currentPano, dur:I})//add
  23632. this.transitionPos({type:"beforeFlyIn", pano:n, dur:I})//add
  23633. }else{
  23634. updateVideo({type:"beforeFlyOut", dur:I})//add
  23635. this.transitionPos({type:"beforeFlyOut", dur:I/2})//add
  23636. }
  23637. //------------------------------------
  23638. var _ = (new r.Vector3).copy(this.position);
  23639. if (i === u.PANORAMA){
  23640. this.emit(w.PanoChosen, n, n),
  23641. setTimeout(function() {
  23642. n.floor.enter(i)
  23643. }
  23644. .bind(this), I / 2),
  23645. this.path.fadeOutCpm(f.path.fadeOutTime);
  23646. if(this.model.floorLogos){
  23647. this.model.floorLogos[0].position.copy(n.floorPosition.clone().sub(this.model.position));//改
  23648. this.model.floorLogos[1].position.copy(this.model.floorLogos[0].position);//for floorIcon position
  23649. }
  23650. }else if (i === u.DOLLHOUSE) {
  23651. if (h && (this.model.stayPut = !0),
  23652. a ? (this.cameraControls.controls[u.DOLLHOUSE].resetRanges(1, !0),
  23653. this.model.warpDestFloors(a.floorVisibility)) : this.model.toggleAllFloors(!0),
  23654. this.path.placeCpm(),
  23655. this.path.fadeInCpm(f.path.fadeInTime),
  23656. h) {
  23657. var T = new r.Vector3(this.model.center.x,0,this.model.center.z);
  23658. _.set(15, 10, 15);
  23659. var M = new r.Vector3(0,0,-1).applyQuaternion(a.quaternion)
  23660. , R = new r.Raycaster(a.position.clone(),M.clone(),0,1 / 0)
  23661. , P = R.intersectObjects([this.sceneIntersectionPlane]);
  23662. P.length ? (T.copy(P[0].point),
  23663. _.copy(a.position),
  23664. 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),
  23665. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(3, !0)),
  23666. this.cameraControls.controls[u.DOLLHOUSE].target.copy(T),
  23667. _.add(this.model.position),
  23668. C.position.copy(_),
  23669. this.cameraControls.controls[u.DOLLHOUSE].update()
  23670. }
  23671. } else if (this.path.placeCpm(),
  23672. this.path.fadeInCpm(f.path.fadeInTime),
  23673. a) {
  23674. this.model.warpDestFloors(a.floorVisibility);
  23675. var O = this.cameraControls.cameras[u.FLOORPLAN]
  23676. , L = this.cameraControls.controls[u.FLOORPLAN]
  23677. , D = O.position.clone().sub(L.target)
  23678. , B = new r.Vector3(-1,0,0).applyQuaternion(a.quaternion).normalize()
  23679. , U = Math.atan2(B.x, B.z);
  23680. L.target.copy(a.position);
  23681. var k = D.length();
  23682. L.offset.x = k * Math.sin(U),
  23683. L.offset.y = 0,
  23684. L.offset.z = k * Math.cos(U),
  23685. O.position.copy(L.target).add(L.offset);
  23686. L.target.clone().sub(C.position);
  23687. C.quaternion.copy(a.quaternion),
  23688. L.currentScale = m.convertWorkshopOrthoZoom(a.orthoZoom),
  23689. L.absoluteScale = L.currentScale,
  23690. L.update()
  23691. } else
  23692. this.model.currentFloor.enter(i);
  23693. var H = this.currentPano
  23694. , G = this.position.clone();
  23695. return this.emit(w.FlyingStarted, _, G, n, this.currentPano),
  23696. this.flying = !0,
  23697. this.isOutsideMode(i) && this.is360View(p, H) ? (h || i !== u.DOLLHOUSE || (C.position.set(15, 10, 15),
  23698. C.controls.target.set(this.model.center.x, 0, this.model.center.z),
  23699. C.controls.update()),
  23700. e.blackoutStyle = S.FADEIN,
  23701. I = f.show360Views.transitionTime,
  23702. this.fade360View(I, C, e)) : this.isOutsideMode(p) && this.is360View(i, n) ? (h && this.switchCameraMode(i, h.quaternion),
  23703. this.mode = i,
  23704. this.path && this.path.popOutCpm(),
  23705. e.blackoutStyle = S.END,
  23706. I = f.show360Views.transitionTime,
  23707. this.fade360View(I, C, e)) : (y.start(v.property(this.model, "alpha", e.modelAlpha, null), I * e.modelAlphaLength, null, e.modelAlphaDelay, null, V.FlyToNewMode),
  23708. y.start(v.vector(this.position, C.position), I, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToNewMode),
  23709. y.start(v.quaternion(this.quaternion, C.quaternion), I * e.rotationDuration, null, e.rotationDelay, A[f.flydown.rotationEasing], null, V.FlyToNewMode),
  23710. y.start(v.matrix4(this.camera.projectionMatrix, C.projectionMatrix), I * e.cameraMatrixDuration, null, e.cameraMatrixDelay, e.cameraMatrixEase, null, V.FlyToNewMode),
  23711. y.start(v.uniform(this.model.skybox, "opacity", e.skyboxOpacity), I * e.skyboxOpacityLength, null, e.skyboxOpacityDelay, null, V.FlyToNewMode),
  23712. y.start(v.property(this.reticule.material.uniforms.opacity, "value", 0), I, null, V.FlyToNewMode)),
  23713. y.setTimeout(function() {
  23714. this.flying = !1,
  23715. p === u.PANORAMA && i !== u.PANORAMA ? this.currentPano.exit() : p !== u.PANORAMA && i === u.PANORAMA && (this.currentPano !== H && H.exit(),
  23716. this.currentPano.enter(),
  23717. this.path.placeCpm(),
  23718. this.path.fadeOutCpm(f.path.fadeOutTime),
  23719. this.spider.draw()),
  23720. p === u.DOLLHOUSE && this.cameraControls.controls[u.DOLLHOUSE].resetRanges(),
  23721. this.mode = i,
  23722. this.emit(w.FlyingEnded, _, G, this.currentPano, H)
  23723. //add:
  23724. this.updateMarkerVisi() ;
  23725. (this.mode == u.PANORAMA) && this.updateHotVisible(),
  23726. this.mode == u.PANORAMA&&this.model.floorLogos&&(
  23727. this.model.changefloorLogoOpa({index:0, from:0, opa:1, dur: 150 }),//this.model.floorLogoShow(0,150);
  23728. this.model.floorLogos[0].visible = true
  23729. )
  23730. if(this.mode == u.PANORAMA){
  23731. Overlay.updateVisibles([this.currentPano])
  23732. updateVideo({type:"flyDone", pano:this.currentPano})//add
  23733. }else{
  23734. Overlay.updateVisibles(true)
  23735. }
  23736. h && p !== u.PANORAMA && i === u.PANORAMA ? this.startWarp(b.Retain, E.Retain, x.BLACK, null, null, s) : (s && s(),
  23737. t.resolve())
  23738. }
  23739. .bind(this), I, V.FlyToNewMode),
  23740. this.mode = u.TRANSITIONING,
  23741. p == "panorama" && this.updateHotVisible(),
  23742. t.promise()
  23743. }
  23744. ,
  23745. n.prototype.fade360View = function(e, t, i) {
  23746. this.tagManager.hideShowTagsForBlackoutStyle(i.blackoutStyle, e),
  23747. $(this.domElement).fadeOut(.5 * e, function() {
  23748. this.model.skybox.material.uniforms.opacity.value = i.skyboxOpacity,
  23749. this.model.alpha = i.modelAlpha,
  23750. this.position.copy(t.position),
  23751. this.quaternion.copy(t.quaternion),
  23752. this.camera.projectionMatrix.copy(t.projectionMatrix),
  23753. $(this.domElement).fadeIn(.5 * e)
  23754. }
  23755. .bind(this))
  23756. }
  23757. ,
  23758. n.prototype.findDefaultViews = function() {
  23759. this.findDefaultView(this.lastInsideView, !0),
  23760. this.findDefaultView(this.last360View, !1)
  23761. }
  23762. ,
  23763. n.prototype.findDefaultView = function(e, t) {
  23764. var i, n = this.model.heroLocations, r = this.model.panos, o = n.findIndex(function(e) {
  23765. if (e.cameraMode !== u.PANORAMA)
  23766. return !1;
  23767. var i = r.get(e.panoId);
  23768. return i && i.isAligned() === t
  23769. });
  23770. o >= 0 ? (i = r.get(n[o].panoId),
  23771. e.update({
  23772. cameraMode: u.PANORAMA,
  23773. pano: i,
  23774. position: n[o].position,
  23775. quaternion: n[o].quaternion
  23776. })) : (o = r.list.findIndex(function(e) {
  23777. return e.isAligned() === t
  23778. }),
  23779. o >= 0 ? (i = r.list[o],
  23780. e.update({
  23781. cameraMode: u.PANORAMA,
  23782. pano: i,
  23783. position: i.position
  23784. })) : F.warn("There are no", t ? "inside" : "360º", "views in this model"))
  23785. }
  23786. ,
  23787. n.prototype.updateLastView = function() {
  23788. if (this.mode === u.PANORAMA) {
  23789. var e = this.currentPano.isAligned() ? this.lastInsideView : this.last360View;
  23790. e.update({
  23791. pano: this.currentPano,
  23792. position: this.position,
  23793. quaternion: this.quaternion
  23794. })
  23795. }
  23796. }
  23797. ,
  23798. n.prototype.goToLastView = function(e, t) {
  23799. var i = $.Deferred()
  23800. , n = i.resolve.bind(i)
  23801. , r = i.reject.bind(i)
  23802. , o = e ? this.lastInsideView : this.last360View;
  23803. return this.isInMode(u.PANORAMA) && this.currentPano.isAligned() !== e && this.updateLastView(),
  23804. this.isInMode(u.PANORAMA) ? (this.path && this.path.popOutCpm(),
  23805. this.fadeToView(e, o, f.show360Views.transitionTime, t).done(n).fail(r)) : this.isOutsideMode() && this.flyToNewMode({
  23806. mode: o.cameraMode,
  23807. pano: o.pano,
  23808. quaternion: o.quaternion,
  23809. callback: t
  23810. }).done(n).fail(r),
  23811. i.promise()
  23812. }
  23813. ,
  23814. n.prototype.fadeToView = function(e, t, i, n) {
  23815. var r = $.Deferred()
  23816. , o = r.resolve.bind(r)
  23817. , a = r.reject.bind(r);
  23818. if (!t.isValid() || t.cameraMode === u.PANORAMA && !t.pano)
  23819. return F.warn("Tried to fade to an illegal view", t.cameraMode),
  23820. a("Cannot go to illegal view"),
  23821. r.promise();
  23822. var s = (f[t.cameraMode],
  23823. function() {
  23824. $(this.domElement).fadeIn(.5 * i),
  23825. n && n(),
  23826. o()
  23827. }
  23828. .bind(this))
  23829. , l = e ? S.FADEIN : S.END;
  23830. return this.tagManager.hideShowTagsForBlackoutStyle(l, i),
  23831. $(this.domElement).fadeOut(.5 * i, function() {
  23832. this.model.fadePanoMarkers(e ? f.panorama.markerOpacity : 0),
  23833. t.cameraMode === u.PANORAMA ? this.flyToPano({
  23834. pano: t.pano,
  23835. lookAtPoint: d.FORWARD.clone().applyQuaternion(t.quaternion).add(t.pano.position),
  23836. duration: 0
  23837. }, s) : this.flyToNewMode({
  23838. mode: t.cameraMode,
  23839. quaternion: t.quaternion,
  23840. duration: 0,
  23841. callback: s
  23842. })
  23843. }
  23844. .bind(this)),
  23845. r.promise()
  23846. }
  23847. ,
  23848. n.prototype.startWarp = function(e, t, i, n, r, o) {
  23849. if (this.cameraControls.activeControl && (this.cameraControls.activeControl.enabled = !1),
  23850. this.flying)
  23851. return F.warn("Player.startWarp() -> Cannot warp when flying"),
  23852. o && o(),
  23853. !1;
  23854. null !== e && void 0 !== e || (e = b.Show),
  23855. this.history.invalidate()
  23856. e !== b.Retain ? this.path.brushToWarpPano(i, x.BLACK) || (i = x.BLACK) : i = this.path.upcomingTransType;
  23857. var a = this.path.warpDestPano && !this.path.warpDestPano.isAligned();
  23858. return this.emit(w.WarpStarted, a, i, n, r),
  23859. n = n || S.MIDDLE,
  23860. this.path.warpToPano(i, n, r, function() {
  23861. t === E.Slow ? this.path.discardSlow() : t === E.Standard && this.path.discardPathObject(),
  23862. this.emit(w.WarpEnded, i),
  23863. this.cameraControls.activeControl && (this.cameraControls.activeControl.enabled = !0),
  23864. o && o()
  23865. }
  23866. .bind(this)),
  23867. e === b.Hide && this.path.discardPathObject(),
  23868. !0
  23869. }
  23870. ,
  23871. n.prototype.warpToPanoById = function(e, t, i, n, r, o, a, s) {
  23872. return this.path.setWarpDestinationByPanoId(e, t) ? this.startWarp(i, n, r, o, a, s) : (F.warn("Player.warpToPanoById() -> Could not setWarpDestinationByPanoId()"),
  23873. s && s(),
  23874. !1)
  23875. }
  23876. ,
  23877. n.prototype.warpToPanoByHeroIndex = function(e, t, i, n, r, o, a) {
  23878. return this.path.setWarpDestinationByHeroIndex(e) ? this.startWarp(t, i, n, r, o, a) : (F.warn("Player.warpToPanoByHeroIndex() -> Could not setWarpDestinationByHeroIndex()"),
  23879. a && a(),
  23880. !1)
  23881. }
  23882. ,
  23883. n.prototype.warpToPano = function(e, t, i, n, r, o, a, s) {
  23884. return this.warpToPanoById(e.id, t, i, n, r, o, a, s)
  23885. }
  23886. ,
  23887. n.prototype.warpToNonPanoByHeroIndex = function(e, t) {
  23888. return this.path.setWarpDestinationByHeroIndex(e) ? (this.path.warpToNonPano(t),
  23889. !0) : (F.warn("Player.warpToNonPanoByHeroIndex() -> Could not setWarpDestinationByHeroIndex()"),
  23890. t && t(),
  23891. !1)
  23892. }
  23893. ,
  23894. n.prototype.aimTourCamera = function(e, t, i, n) {
  23895. return F.debug("player.aimTourCamera(" + e + ") calling warpToPanoByHeroIndex(" + e + ")"),
  23896. this.warpToPanoByHeroIndex(e, t, i, null, null, null, n)
  23897. }
  23898. ,
  23899. n.prototype.showPathToHeroLocation = function(e) {
  23900. this.path.setWarpDestinationByHeroIndex(e) && this.path.brushToWarpPano(x.STD, x.BLACK)
  23901. }
  23902. ,
  23903. n.prototype.tourInterlude = function(e, t) {
  23904. this.history.invalidate();
  23905. this.path.discardSlow();
  23906. //xzw:
  23907. var currentLocation = this.model.heroLocations[this.director.currentItem[0]]
  23908. var restChildCount = currentLocation.heroLocations ? (currentLocation.heroLocations.length-this.director.currentItem[1]-1) : 0
  23909. var current = g_tourAudio ? 1e3 * g_tourAudio.currentTime : 0
  23910. var rotTime = currentLocation && currentLocation.musicInfo.music ? currentLocation.musicInfo.time - current : 2e3;
  23911. if(restChildCount){//如果当前folder中还有剩下的item,平分一下时间
  23912. var timeEachItem = 2000;//假设每个item飞的时间
  23913. var rotTime = (rotTime-timeEachItem*restChildCount) / (restChildCount+1);
  23914. }
  23915. rotTime = Math.max(0, rotTime)
  23916. console.log("rotTime "+rotTime +" at item "+this.director.currentItem + ",musicCurrentTime:"+current)
  23917. this.path.waitNextStep(e, function() {
  23918. t && t()
  23919. }.bind(this), rotTime)
  23920. }
  23921. ,
  23922. n.prototype.stopInterlude = function() {
  23923. this.interruptAndFastForward(null, 0)
  23924. }
  23925. ,
  23926. n.prototype.interruptAndFastForward = function(e, t) {
  23927. this.isWarping() && this.emit(w.WarpInterrupted, this.path.activeTransType, e, t),
  23928. this.flying && this.emit(w.FlyingInterrupted),
  23929. this.path.interruptAndFastForward(e, t)
  23930. }
  23931. ,
  23932. n.prototype.setSize = function(e, t) {
  23933. var i = e / t;
  23934. this.baseFov = B.clampVFOV(f.insideFOV, f.insideFOVMax, e, t);
  23935. var n = B.getHFOVFromVFOV(f.insideFOV, e, t);
  23936. n > f.insideFOVMax ? this.baseFov = B.getVFOVFromHFOV(f.insideFOVMax, e, t) : this.baseFov = f.insideFOV;
  23937. for (var r in this.cameraControls.cameras) {
  23938. var o = this.cameraControls.cameras[r];
  23939. o.fov = this.baseFov * (1 / this.zoomLevel),
  23940. o.updateAspect(i)
  23941. }
  23942. }
  23943. ,
  23944. n.prototype.toJSON = function() {
  23945. var e = {};
  23946. return this.cameraControls.activeControl ? (e = this.cameraControls.activeControl.toJSON(),
  23947. e.camera_mode = u.toInt(this.mode),
  23948. this.isOutsideMode() ? this.model.allFloorsVisible ? e.floor_visibility = [] : e.floor_visibility = this.model.floors.list.map(function(e) {
  23949. return e.hidden ? 0 : 1
  23950. }) : u.PANORAMA && (e.scan_id = this.currentPano.id),
  23951. e) : e
  23952. }
  23953. ,
  23954. n.prototype.getCurrentNodePanos = function(e) {
  23955. this.model.panos.map;
  23956. if (e.length = 0, this.path.nodes){
  23957. var momentTour = this.director.getMomentTour(this.director.destinationItem)
  23958. if(momentTour == 'black'){ //改 upcomingPanos如果是black的只需要起点和终点
  23959. if(this.path.nodes.length){
  23960. e.push(this.model.panos.get(this.path.nodes[0]))
  23961. }
  23962. if(this.path.nodes.length>1){
  23963. e.push(this.model.panos.get(this.path.nodes[this.path.nodes.length-1]))
  23964. }
  23965. }else{
  23966. for (var t = 0; t < this.path.nodes.length; t++) {
  23967. var i = this.path.nodes[t];
  23968. e.push(this.model.panos.get(i))
  23969. }
  23970. }
  23971. }
  23972. }
  23973. ,
  23974. n.prototype.zoomIncrementally = function(e) {
  23975. var t = this.zoomLevel;
  23976. this.zoomTo(this.zoomLevel + e),
  23977. t !== this.zoomLevel && this.currentPano && this.zoomStats.addZoomAction(t, this.zoomLevel, this.currentPano.id)
  23978. }
  23979. ,
  23980. n.prototype.zoomInIncrementally = function(e) {
  23981. e = e || this.defaultZoomIncrement,
  23982. this.zoomIncrementally(e)
  23983. }
  23984. ,
  23985. n.prototype.zoomOutIncrementally = function(e) {
  23986. e = e || -this.defaultZoomIncrement,
  23987. this.zoomIncrementally(e)
  23988. }
  23989. ,
  23990. n.prototype.zoomBy = function(e) {
  23991. this.zoomTo(this.zoomLevel * e)
  23992. }
  23993. ,
  23994. n.prototype.zoomIn = function() {
  23995. this.zoomBy(1 + this.zoomSpeed)
  23996. }
  23997. ,
  23998. n.prototype.zoomOut = function() {
  23999. this.zoomBy(1 - this.zoomSpeed)
  24000. }
  24001. ,
  24002. n.prototype.zoomTo = function(e, t) {
  24003. if (t || f.zoom.enabled && this.mode === u.PANORAMA && this.zoomEnabled) {
  24004. if (e < f.zoom.min && (e = f.zoom.min),
  24005. e > f.zoom.max && (e = f.zoom.max),
  24006. e > this.zoomLevel ? (this.emit(O.ZoomIn),
  24007. e === f.zoom.max && this.emit(O.ZoomMax)) : e < this.zoomLevel && (this.emit(O.ZoomOut),
  24008. e === f.zoom.min && this.emit(O.ZoomMin)),
  24009. this.cameraControls.activeControl) {
  24010. var i = this.cameraControls.activeControl.camera;
  24011. this.zoomLevel = e,
  24012. i.fov = this.baseFov * (1 / this.zoomLevel),
  24013. i.updateProjectionMatrix(),
  24014. this.zoomFov = i.fov
  24015. }
  24016. }
  24017. }
  24018. ,
  24019. n.prototype.increaseZoomSpeed = function() {
  24020. this.zoomSpeed = this.clampZoomSpeed(this.zoomSpeed + this.zoomSpeedAdjust)
  24021. }
  24022. ,
  24023. n.prototype.decreaseZoomSpeed = function() {
  24024. this.zoomSpeed = this.clampZoomSpeed(this.zoomSpeed - this.zoomSpeedAdjust)
  24025. }
  24026. ,
  24027. n.prototype.clampZoomSpeed = function(e) {
  24028. return e < 0 ? 0 : e
  24029. }
  24030. ,
  24031. n.prototype.activatePersistentZooming = function(e) {
  24032. this.zooming = e ? 1 : -1
  24033. }
  24034. ,
  24035. n.prototype.deactivatePersistentZooming = function() {
  24036. this.zooming = 0
  24037. }
  24038. ,
  24039. n.prototype.zoomDefault = function() {
  24040. this.zoomTo(1, !0)
  24041. }
  24042. ,
  24043. window.fovTranId = 333;//add
  24044. n.prototype.smoothZoomToDefault = function(e, t) {
  24045. y.cancelById(window.fovTranId)
  24046. var i, n = this.zoomLevel,
  24047. r = function(e) {
  24048. e > 1 && (e = 1),
  24049. i = n * (1 - e) + e,
  24050. this.zoomTo(i, !0)
  24051. }.bind(this),
  24052. o = function() {
  24053. this.zoomDefault(),
  24054. t && window.setTimeout(t, 50)
  24055. }.bind(this);
  24056. y.start(r, e, o, null, 0, A[f.transition.blendEasing], null, window.fovTranId)
  24057. }
  24058. n.prototype.smoothZoomFovTo = function (fov, zoomLevel, dur, callback) {//add
  24059. y.cancelById(window.fovTranId)
  24060. console.log("smoothZoomFovTo "+zoomLevel)
  24061. var i,
  24062. n = this.zoomLevel,
  24063. aimLevel = zoomLevel || this.baseFov / fov
  24064. if (n == aimLevel) return
  24065. var fun = function (e) {
  24066. e > 1 && (e = 1), (i = n * (1 - e) + e * aimLevel),
  24067. this.zoomTo(i, !0)
  24068. }.bind(this)
  24069. y.start(fun, dur, callback, null, 0, A[f.transition.blendEasing], null, window.fovTranId)
  24070. }
  24071. ,
  24072. n.prototype.updateZoomPano = function() {
  24073. if (!this.panoRenderer.zoomPanoRenderingDisabled && this.mode === u.PANORAMA) {
  24074. var e = this.currentPano;
  24075. if (e) {
  24076. var t = this.zoomLevel > f.zoom.activationThreshold
  24077. , i = this.flying && this.nextPano && this.nextPano !== this.currentPano
  24078. , n = !i && !this.isWarping()
  24079. , r = t /*&& n*/; // 允许flying状态下加载4K图
  24080. this.tileDownloader.tilePrioritizer.setZoomingActive(r),
  24081. this.panoRenderer.setZoomingActive(r, e, !0);
  24082. var o = function(e, t) {
  24083. this.panoRenderer.resetRenderStatus(e.id, !1, !0, this.qualityManager.getMaxNavPanoSize()),
  24084. this.panoRenderer.clearAllQueuedUploadsForPano(e.id),
  24085. this.panoRenderer.renderPanoTiles(e.id, null, !1, !1),
  24086. e.setZoomed(t)
  24087. }
  24088. .bind(this);
  24089. r && !e.zoomed ? (o(e, !0),
  24090. this.panoRenderer.enableUltraHighQualityMode(function() {
  24091. this.qualityManager.useUltraHighResolutionPanos && !f.zoom.overridemax && (f.zoom.max = D.ultraHighQualityMaxZoom),
  24092. r && o(e, !0)
  24093. }
  24094. .bind(this))) : !t && e.zoomed && o(e, !1)
  24095. }
  24096. }
  24097. },
  24098. n.prototype.checkHasNeighbor = function(pano){//add
  24099. for(var i in pano.neighbourPanos ){
  24100. if(i == pano.id)continue;
  24101. if(pano.neighbourPanos[i]){
  24102. return true;
  24103. }
  24104. }
  24105. }
  24106. ,
  24107. t.exports = n
  24108. }
  24109. ).call(this, "/js/player.js")
  24110. }
  24111. , {
  24112. "./constants": 8,
  24113. "./enum/AlignmentType": 17,
  24114. "./enum/BlackoutStyle": 18,
  24115. "./enum/ControlEvents": 21,
  24116. "./enum/Keys": 30,
  24117. "./enum/ModelManagerEvents": 33,
  24118. "./enum/PanoSizeClass": 36,
  24119. "./enum/PanoramaEvents": 37,
  24120. "./enum/PathDiscardMode": 38,
  24121. "./enum/PathDisplayMode": 39,
  24122. "./enum/PlayerEvents": 40,
  24123. "./enum/TagStates": 44,
  24124. "./enum/Vectors": 50,
  24125. "./enum/Viewmode": 51,
  24126. "./enum/WarpStyle": 52,
  24127. "./enum/ZoomEvents": 53,
  24128. "./exception/BasicException": 55,
  24129. "./model/ModelManager": 140,
  24130. "./objects/NSpider": 147,
  24131. "./objects/Panorama": 148,
  24132. "./objects/Reticule": 149,
  24133. "./objects/ShowPath": 151,
  24134. "./objects/Snapshot": 153,
  24135. "./objects/View": 154,
  24136. "./settings": 166,
  24137. "./shaders": 167,
  24138. "./tile/TileDownloader": 171,
  24139. "./tile/TilePrioritizer": 172,
  24140. "./util/ZoomStats": 179,
  24141. "./util/browser": 182,
  24142. "./util/camera": 183,
  24143. "./util/cameraLight": 184,
  24144. "./util/common": 185,
  24145. "./util/easing": 186,
  24146. "./util/history": 187,
  24147. "./util/lerp": 188,
  24148. "./util/logger": 189,
  24149. "./util/math": 190,
  24150. "./util/transitions": 195,
  24151. "hot":"hot",
  24152. "scaleImg":"scaleImg",
  24153. events: 202,
  24154. three: 217
  24155. }],
  24156. "scaleImg":[function(t, e){// xzw
  24157. var OUTPUT = e;
  24158. (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")}
  24159. function n(t){if(t){var e,a=G.getImageData(0,0,s,f),i=a.data;for(e=0;at>e;e+=4)
  24160. 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}
  24161. return G.getImageData(0,0,s,f)}
  24162. 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}
  24163. a||(a=t.input,i=t.output,r=t.inputRemovable,t.scale&&(t=t.scale));var u,d;if(a.src)
  24164. if(u=document.createElement("canvas"),null!=a.naturalWidth)
  24165. 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}
  24166. else
  24167. 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)
  24168. 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)
  24169. for(h(),J=n(),K=J.data,x=0;f>x;x++)
  24170. 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)
  24171. 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)
  24172. W=new Float32Array(at);else
  24173. for(W=[],et=0;at>et;++et)
  24174. W[et]=0;for(b=0;w>b;b++)
  24175. 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)
  24176. 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;}
  24177. delete p,h(),J=n(W)}
  24178. 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}
  24179. if("png-src"===i||"jpeg-src"===i)
  24180. return B.toDataURL("image/"+i.split("-")[0],0.85)}
  24181. return B}
  24182. var e=this;"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=t),exports.scale=t):c=t}).call(this);
  24183. OUTPUT.exports = c;
  24184. }, {}
  24185. ],
  24186. 156: [function(e, t, i) {
  24187. (function(i) {
  24188. "use strict";
  24189. function n(e, t) {
  24190. this.model = e,
  24191. this.panos = e.panos,
  24192. this.player = t,
  24193. this.imagePanos = this.listImagePanos(),
  24194. this.retryMinimumTime = 1e4
  24195. }
  24196. var r = (e("three"),
  24197. e("./enum/Viewmode"))
  24198. , o = (e("./settings"),
  24199. e("./objects/Panorama"))
  24200. , a = e("./util/logger")
  24201. , s = new a(i);
  24202. n.prototype.start = function() {
  24203. this.loadNextPano(function(e) {
  24204. e ? this.start() : (s.debug("No suitable pano loaded, waiting a little while before looking again"),
  24205. setTimeout(function() {
  24206. this.start()
  24207. }
  24208. .bind(this), 1e3))
  24209. }
  24210. .bind(this))
  24211. }
  24212. ,
  24213. n.prototype.validLoadTarget = function(e) {
  24214. return e && !e.isLoaded("high") && Date.now() - e.failedLoadingAt > this.retryMinimumTime
  24215. }
  24216. ,
  24217. n.prototype.listImagePanos = function() {
  24218. var e = []
  24219. , t = this;
  24220. return this.model.images.forEach(function(i) {
  24221. if (i.metadata && i.metadata.scan_id) {
  24222. var n = t.model.panos.get(i.metadata.scan_id);
  24223. n && !n.isLoaded("high") && e.push(n)
  24224. }
  24225. }),
  24226. e
  24227. }
  24228. ,
  24229. n.prototype.nextNotLoadedImage = function() {
  24230. for (; this.imagePanos.length > 0; ) {
  24231. var e = this.imagePanos[0];
  24232. if (!e.isLoaded("high"))
  24233. return e;
  24234. this.imagePanos.shift()
  24235. }
  24236. return null
  24237. }
  24238. ,
  24239. n.prototype.loadNextPano = function(e) {
  24240. var t, i, n = this.model.waitQueue.filter(function(e) {
  24241. return e.object instanceof o
  24242. });
  24243. n.length > 0 ? (t = n[0].object,
  24244. s.debug("Overrode pano selection: Flying to an unloaded pano " + t.id)) : this.validLoadTarget(this.player.currentPano) ? (t = this.player.currentPano,
  24245. s.debug("Overrode pano selection: Currently at an unloaded pano " + t.id)) : this.validLoadTarget(this.player.closestPano) ? (t = this.player.closestPano,
  24246. s.debug("Overrode pano selection: Hovering over an unloaded pano " + t.id)) : this.validLoadTarget(this.nextNotLoadedImage()) ? (i = "high",
  24247. t = this.imagePanos[0],
  24248. 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())]),
  24249. t && s.debug("Normal pano selection: neighbor " + t.id)),
  24250. t ? (i = i || t.isLoaded("low") ? "high" : "low",
  24251. s.debug("Preloading " + i + "-res pano " + t.id),
  24252. t.loadCube(i).done(e).fail(function() {
  24253. s.warn("Failed preloading pano", t.id, ", marking it as failed and forgetting it for a while"),
  24254. e()
  24255. })) : e && e(null)
  24256. }
  24257. ,
  24258. t.exports = n
  24259. }
  24260. ).call(this, "/js/preloaders.js")
  24261. }
  24262. , {
  24263. "./enum/Viewmode": 51,
  24264. "./objects/Panorama": 148,
  24265. "./settings": 166,
  24266. "./util/logger": 189,
  24267. three: 217
  24268. }],
  24269. 157: [function(e, t, i) {
  24270. (function(i) {
  24271. "use strict";
  24272. function n(e, t, i, n, r) {
  24273. this.qualityManager = e,
  24274. this.scene = t,
  24275. this.camera = i,
  24276. this.container = r,
  24277. this.controls = n,
  24278. this.controls.enabled = !0,
  24279. this.controls.locked = !0,
  24280. this.quickstartCamera = n.camera,
  24281. this.quickstartCamera.fov = h.clampVFOV(a.insideFOV, a.insideFOVMax, $("#player").width(), $("#player").height()),
  24282. this.skybox = null
  24283. }
  24284. var r = e("three")
  24285. , o = e("../util/logger")
  24286. , a = e("../constants")
  24287. , s = (e("../util/transitions"),
  24288. e("../util/lerp"),
  24289. e("../util/easing"),
  24290. e("../enum/Vectors"))
  24291. , l = e("../enum/PanoSizeClass")
  24292. , c = (e("../materials/ModelTextureMaterial"),
  24293. e("../materials/CubemapMaterial"))
  24294. , h = (e("../cameras/PanoramaCamera"),
  24295. e("../controls/PanoramaControls"),
  24296. e("../tile/TileUtils"),
  24297. e("../util/camera"),
  24298. e("../util/cameraLight"))
  24299. , u = (e("../util/browser"),
  24300. e("../settings"),
  24301. e("../gui/helpManager"),
  24302. new o(i));
  24303. n.prototype.load = function(e) {
  24304. e.pano.shouldRedrawOnBaseLoaded = !0;
  24305. var t, i, n = this, r = s.FORWARD.clone().applyQuaternion(e.quaternion), o = r.clone().negate();
  24306. this.controls.lookAt(r.add(this.quickstartCamera.position));
  24307. var a = this.qualityManager.getPanoSize(l.BASE)
  24308. , c = this.qualityManager.getPanoSize(l.STANDARD);
  24309. if (e.pano.tiled) {
  24310. u.warn("Loading startPano, TILED", e.pano.id);
  24311. var d = h.getHFOVForCamera(this.quickstartCamera, $("#player").width(), $("#player").height())
  24312. , p = this.quickstartCamera.fov;
  24313. u.warn("Quickstart loading tiles in frustum: [horizontal FOV: " + d + ", vertical FOV: " + p + "]"),
  24314. t = e.pano.loadTiledPano(c, r, {
  24315. hFov: d,
  24316. vFov: p
  24317. }, !1, !1, !0),
  24318. i = e.pano.loadTiledPano(a, o, null, !1, !1, !0)
  24319. } else
  24320. u.warn("Loading startPano", e.pano.id),
  24321. t = e.pano.loadCube("high");
  24322. return $.when(t).then(function() {
  24323. n.init(e.pano, e.quaternion),
  24324. e.pano.tiled ? i.done(function() {
  24325. e.pano.lockUntilRenderingComplete = !1,
  24326. this.controls.locked = !1
  24327. }
  24328. .bind(this)) : this.controls.locked = !1
  24329. }
  24330. .bind(this))
  24331. }
  24332. ,
  24333. n.prototype.init = function(e, t) {
  24334. u.info("Quickstart done loading, adding scene objects"),
  24335. e.lockUntilRenderingComplete = !0,
  24336. this.skybox = new r.Mesh(new r.CubeGeometry(1,1,1),new c({
  24337. side: r.BackSide
  24338. })),
  24339. this.skybox.material.uniforms.map.value = e.getSkyboxTexture(),
  24340. this.skybox.quaternion.copy(e.quaternion),
  24341. this.scene.add(this.skybox),
  24342. $(this.container).show()
  24343. }
  24344. ,
  24345. n.prototype.update = function(e) {
  24346. this.controls.update(e),
  24347. this.camera.copy(this.quickstartCamera)
  24348. }
  24349. ,
  24350. n.prototype.setSize = function(e, t) {
  24351. this.quickstartCamera.updateAspect(e / t)
  24352. }
  24353. ,
  24354. n.prototype.destroy = function() {
  24355. this.scene.remove(this.skybox)
  24356. }
  24357. ,
  24358. t.exports = n
  24359. }
  24360. ).call(this, "/js/scene/QuickstartManager.js")
  24361. }
  24362. , {
  24363. "../cameras/PanoramaCamera": 7,
  24364. "../constants": 8,
  24365. "../controls/PanoramaControls": 13,
  24366. "../enum/PanoSizeClass": 36,
  24367. "../enum/Vectors": 50,
  24368. "../gui/helpManager": 68,
  24369. "../materials/CubemapMaterial": 117,
  24370. "../materials/ModelTextureMaterial": 118,
  24371. "../settings": 166,
  24372. "../tile/TileUtils": 174,
  24373. "../util/browser": 182,
  24374. "../util/camera": 183,
  24375. "../util/cameraLight": 184,
  24376. "../util/easing": 186,
  24377. "../util/lerp": 188,
  24378. "../util/logger": 189,
  24379. "../util/transitions": 195,
  24380. three: 217
  24381. }],
  24382. 158: [function(e, t, i) {
  24383. "use strict";
  24384. function n(e, t, i) {
  24385. this.scene = e,
  24386. this.camera = t,
  24387. this.renderer = null,
  24388. this.effects = i,
  24389. this.animateCallback = null,
  24390. this.composer = null,
  24391. this.qualityManager = null,
  24392. e.renderWidth = 0,
  24393. e.renderHeight = 0,
  24394. this.updateClock = new r.Clock,
  24395. this.components = [],
  24396. this.updateListeners = [],
  24397. this.resizeListeners = [],
  24398. this.forceUpdateSize = !1,
  24399. this.started = !1,
  24400. this.textures = {},
  24401. this.suspendedObjects = []
  24402. }
  24403. var r = e("three")
  24404. , o = e("../shaders")
  24405. , a = e("../enum/SceneRendererEvents")
  24406. , s = e("../enum/GLTextureType")
  24407. , l = e("../enum/GLCubeFaces")
  24408. , c = e("../exception/BasicException")
  24409. , h = e("../exception/RendererCreationException")
  24410. /**********************************************************************fyz改 from徐世廷**********************************************************************/
  24411. , m = e("../util/browser")
  24412. /**************************************************************************************************************************************************/
  24413. , u = e("../settings")
  24414. , d = e("events").EventEmitter;
  24415. window.requestAnimationFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame,
  24416. n.prototype = Object.create(d.prototype),
  24417. n.prototype.addComponent = function(e) {
  24418. this.components.push(e),
  24419. e.update && this.updateListeners.push(e),
  24420. e.setSize && (this.resizeListeners.push(e),
  24421. this.forceUpdateSize = !0)
  24422. }
  24423. ,
  24424. n.prototype.removeComponent = function(e) {
  24425. var t = function(t) {
  24426. return t !== e
  24427. };
  24428. this.components = this.components.filter(t),
  24429. this.updateListeners = this.updateListeners.filter(t),
  24430. this.resizeListeners = this.resizeListeners.filter(t)
  24431. }
  24432. ,
  24433. n.prototype.start = function(e) {
  24434. if (this.started)
  24435. throw new c("Can't start SceneRenderer, already started");
  24436. this.createContext(e),
  24437. /***************************************************VR fyz改 from徐世廷**********************************************************************/
  24438. m.isMobile() && this.boluoVrInit(),
  24439. /*******************************************************************************************************************************/
  24440. this.initComposer(),
  24441. this.started = !0,
  24442. (p = p.bind(this))()
  24443. }
  24444. ,
  24445. n.prototype.createContext = function(e) {
  24446. try {
  24447. this.renderer = new r.WebGLRenderer({antialias: !m.isMobile(), alpha:true}),//透明
  24448. this.renderer.autoClear = !0,
  24449. this.renderer.setPixelRatio(window.devicePixelRatio ? window.devicePixelRatio : 1),
  24450. this.renderer.setSize($("#player").width(), $("#player").height(), false), //改
  24451. this.renderer.setClearColor( 0x000000, 0 ); //透明
  24452. this.emit(a.ContextCreated)
  24453. } catch (e) {
  24454. throw new h("Unable to create a WebGL rendering context")
  24455. }
  24456. u.profiling.enabled && this.overrideTextures(),
  24457. e.appendChild(this.renderer.domElement)
  24458. /* window.stats = new Stats();
  24459. e.appendChild( stats.dom ); */
  24460. }
  24461. ,
  24462. n.prototype.overrideTextures = function() {
  24463. var e = this.renderer.context
  24464. , t = 0
  24465. , i = e.createTexture;
  24466. e.createTexture = function() {
  24467. var n = i.call(e);
  24468. return n.id = t++,
  24469. this.textures[n.id] = n,
  24470. n
  24471. }
  24472. .bind(this);
  24473. var n = e.texImage2D;
  24474. e.texImage2D = function(t, i, r, o, a, l, c, h, u) {
  24475. var d, p = this.getTextureTypeFromTarget(e, t);
  24476. d = p === s.TextureCube ? e.getParameter(e.TEXTURE_BINDING_CUBE_MAP) : e.getParameter(e.TEXTURE_BINDING_2D),
  24477. void 0 !== c ? n.call(e, t, i, r, o, a, l, c, h, u) : (c = o,
  24478. h = a,
  24479. u = l,
  24480. o = u.naturalWidth,
  24481. a = u.naturalHeight,
  24482. n.call(e, t, i, r, c, h, u));
  24483. var f = this.textures[d.id];
  24484. f.width = p === s.TextureCube ? 6 * o : o,
  24485. f.height = a
  24486. }
  24487. .bind(this);
  24488. var r = e.deleteTexture;
  24489. e.deleteTexture = function(t) {
  24490. delete this.textures[t.id],
  24491. r.call(e, t)
  24492. }
  24493. .bind(this)
  24494. }
  24495. ,
  24496. n.prototype.updateTextureMemory = function() {
  24497. var e = null;
  24498. return function() {
  24499. var t = 0;
  24500. for (var i in this.textures) {
  24501. var n = this.textures[i];
  24502. n.width && n.height && (t += n.width * n.height * 4)
  24503. }
  24504. t !== e && this.emit(a.MemoryUsageUpdated, t),
  24505. e = t
  24506. }
  24507. }(),
  24508. n.prototype.getTextureTypeFromTarget = function(e, t) {
  24509. switch (t) {
  24510. case e.TEXTURE_CUBE_MAP_POSITIVE_X:
  24511. case e.TEXTURE_CUBE_MAP_NEGATIVE_X:
  24512. case e.TEXTURE_CUBE_MAP_POSITIVE_Y:
  24513. case e.TEXTURE_CUBE_MAP_NEGATIVE_Y:
  24514. case e.TEXTURE_CUBE_MAP_POSITIVE_Z:
  24515. case e.TEXTURE_CUBE_MAP_NEGATIVE_Z:
  24516. return s.TextureCube;
  24517. case e.TEXTURE_2D:
  24518. return s.Texture2D;
  24519. default:
  24520. return null
  24521. }
  24522. }
  24523. ,
  24524. n.prototype.initComposer = function() {
  24525. this.composer = new r.EffectComposer(this.renderer),
  24526. this.composer.addPass(new r.RenderPass(this.scene,this.camera)),
  24527. //this.composer.addPass(this.effects.hblurPass),
  24528. //this.composer.addPass(this.effects.vblurPass)
  24529. this.composer.addPass(this.effects.transitionMaskPass)//add
  24530. }
  24531. ,
  24532. n.prototype.setSize = function(e, t, devicePixelRatio) {
  24533. this.renderWidth = e,
  24534. this.renderHeight = t,
  24535. this.effects.aspect = e / t,
  24536. /* this.renderer.setSize(e, t), -----MP */
  24537. this.renderer.setSize(e, t, false, devicePixelRatio), //改 为了防止给canvas设置宽高
  24538. this.composer.setSize(e, t);
  24539. for (var i = 0; i < this.resizeListeners.length; i++)
  24540. this.resizeListeners[i].setSize(e, t)
  24541. }
  24542. ,
  24543. n.prototype.render = function() {
  24544. this.effects.currentBlur > 0 ? this.composer.render() : this.renderer.render(this.scene, this.camera)
  24545. //this.effects.transitionMaskPass.enabled ? this.composer.render() : this.renderer.render(this.scene, this.camera)
  24546. }
  24547. /******************************************************************************************************徐世廷**********************************************************************/
  24548. var vrPermission = {};
  24549. var vrPermissionCallBack = function(info1,info2){
  24550. if(info1 == "reset"){
  24551. vrPermission = {};
  24552. }else{
  24553. vrPermission[info1] = info2
  24554. if(Object.keys(vrPermission).length == 2 && (vrPermission.deviceMotion != "granted" || vrPermission.deviceOrientation != "granted")){
  24555. alert("运动和方向访问失败。这会导致画面视角一直固定。您需要完全关闭此应用,然后再次打开,并允许访问运动与方向。" )
  24556. }
  24557. }
  24558. }
  24559. n.prototype.boluoVrInit = function() {
  24560. console.log("boluoVrInit")
  24561. this.isHuawei5X = m.detectHUAWEI5X(),
  24562. this.oldRenderer = this.renderer,
  24563. this.newRenderer = new this.vrRenderer(this.renderer,this,this.camera);
  24564. window.panoCamera = this.camera;
  24565. var a = this;
  24566. window._vrEnabled = !1,
  24567. Object.defineProperty(window, "vrEnabled", {
  24568. get: function() {
  24569. return window._vrEnabled
  24570. },
  24571. set: function(b) {
  24572. b = !!b,
  24573. b ? (a.renderer = a.newRenderer,
  24574. window.vrMarkers.forEach(function(a) {
  24575. a.visible = !0
  24576. })) : (a.renderer = a.oldRenderer,
  24577. window.vrMarkers.forEach(function(a) {
  24578. a.visible = !1
  24579. })),
  24580. a.cursor.visible = b,
  24581. a.setSize(window.innerWidth, window.innerHeight),
  24582. window._vrEnabled = b
  24583. if(b){
  24584. setTimeout(function(){
  24585. console.log("orientEnable"+window.orientEnable)
  24586. if(window.vrEnabled && !window.orientEnable){//很可能没能触发陀螺仪事件
  24587. if(m.detectIOS()/* && m.detectSafari() */){
  24588. var b = m.iosVersion();//{major: 10, minor: 3, patch: 1}
  24589. console.log("开始获取权限 major"+b.major)
  24590. if(b.major == 12 && b.minor>=2){
  24591. if(browser.detectSafari()) alert("浏览器未能检测到转动。为完整体验VR效果,请打开 “设置” > “Safari” > “隐私和安全” 下的 “运动和方向访问” 开关,然后刷新此页面。")
  24592. else{//app??
  24593. alert("浏览器未能检测到转动。请在手机或浏览器设置中开启了运动和方向访问等设置,然后刷新此页面。")
  24594. }
  24595. }else if(b.major >= 13){
  24596. if(!window.location.href.includes("https://")){
  24597. console.log("需要https");
  24598. alert("当前网页下,高于ios12的浏览器版本可能不支持陀螺仪开启。")
  24599. return;
  24600. }
  24601. var hasFailed = window.vrPermission && (window.vrPermission.deviceMotion != "granted" || window.vrPermission.deviceOrientation != "granted")
  24602. setTimeout(()=>{//如果使用了alert会阻断这个事件,报以下错requusting device orientation or motion access requires a user gesture
  24603. if(!window.vrEnabled || window.orientEnable)return;
  24604. vrPermissionCallBack("reset")
  24605. console.log(window.DeviceMotionEvent)
  24606. if ( window.DeviceMotionEvent && window.DeviceMotionEvent.requestPermission && typeof window.DeviceMotionEvent.requestPermission === 'function') {
  24607. console.log("开始获取权限1")
  24608. ///注意:需要https 本地服务器permissionState会得到denied
  24609. window.DeviceMotionEvent.requestPermission().then(permissionState => {
  24610. console.log("permissionState1: "+permissionState)
  24611. vrPermissionCallBack("deviceMotion", permissionState)
  24612. }).catch(function(e){
  24613. vrPermissionCallBack("deviceMotion", false)
  24614. console.log(e)
  24615. })
  24616. }else{
  24617. console.log("window.DeviceMotionEvent undefined")
  24618. vrPermissionCallBack("deviceMotion", false)
  24619. }
  24620. if ( window.DeviceOrientationEvent && window.DeviceOrientationEvent.requestPermission && typeof window.DeviceOrientationEvent.requestPermission === 'function') {
  24621. console.log("开始获取权限2")
  24622. window.DeviceOrientationEvent.requestPermission().then(permissionState => {
  24623. console.log("permissionState2: "+permissionState)
  24624. vrPermissionCallBack("deviceOrientation", permissionState)
  24625. }).catch(function(e){
  24626. vrPermissionCallBack("deviceOrientation", false)
  24627. console.log(e)
  24628. })
  24629. }else{
  24630. console.log("window.DeviceOrientationEvent undefined")
  24631. vrPermissionCallBack("deviceOrientation", false)
  24632. }
  24633. },hasFailed ? 0 : 150)
  24634. /* /* setTimeout(function(){
  24635. if(settings.vrEnabled && !window.orientEnable){
  24636. $alert("若画面视角一直固定,您需要完全关闭Safari浏览器,然后再次打开以开启运动和方向访问。")
  24637. }
  24638. },4000) */
  24639. }else console.log("陀螺仪未能启用 ios "+b.major+"."+b.minor)
  24640. }else{
  24641. //$alert("浏览器未能检测到转动", "请在手机或浏览器设置中开启了运动和方向访问等设置,然后刷新此页面。")
  24642. }
  24643. }else{
  24644. //已经触发了
  24645. }
  24646. },200);
  24647. }
  24648. }
  24649. }),
  24650. this.createCursor(.5, !1, 1, 16777215, 0);
  24651. var b = {
  24652. setSize: function(b, c) {
  24653. a.camera.aspect = b / c
  24654. }
  24655. };
  24656. this.resizeListeners.push(b),
  24657. this.vrLoadingInit()
  24658. }
  24659. ,
  24660. n.prototype.vrLoadingInit = function() {
  24661. var a = function(camera) {
  24662. var a = this
  24663. , b = new r.RingGeometry(1.3,1.5,32,32,0,1.2 * Math.PI)
  24664. , c = new r.MeshBasicMaterial({
  24665. color: 4967932,
  24666. side: r.DoubleSide
  24667. })
  24668. , d = new r.Mesh(b,c);
  24669. this.mesh = d,
  24670. d.position.z = -2,
  24671. d.scale.set(.08, .08, .08),
  24672. d.visible = !1,
  24673. camera.add(d),
  24674. //window.player.camera.add(d),
  24675. a.enabled = !1,
  24676. this.update = function(b) {
  24677. 1 == a.enabled && (d.rotation.z += 15 * b)
  24678. }
  24679. }
  24680. , a = new a(this.camera);
  24681. window.Loading = a,
  24682. this.updateListeners.push(a)
  24683. }
  24684. ,
  24685. n.prototype.createCursor = function(a, b, c, d, e) {
  24686. var g, h = new r.SpriteMaterial({
  24687. opacity: c,
  24688. color: d,
  24689. transparent: b,
  24690. map: this.boluoGetTexture("images/cursor.png"),
  24691. needsUpdate: !0,
  24692. side: r.DoubleSide
  24693. });
  24694. h.map.offset = new r.Vector2(1 / 17 * e,0),
  24695. h.map.repeat = new r.Vector2(1 / 17,1),
  24696. h.depthTest = !1,
  24697. h.blending = r.AdditiveBlending,
  24698. g = new r.Sprite(h),
  24699. // g.scale.set(a, a, a),
  24700. g.scale.set(.3,.3,.3)
  24701. g.position.z = -2,
  24702. g.visible = !1,
  24703. g.name = "cursor",
  24704. this.camera.add(g),
  24705. this.scene.add(this.camera),
  24706. this.cursor = g;
  24707. var i = new this.CursorAnimation(this.scene,g,this.camera);
  24708. this.cursor.triggerTargetEvent = i.triggerTargetEvent,
  24709. this.updateListeners.push(i)
  24710. }
  24711. ,
  24712. window.orientEnable = 0; //是否能触发deviceorientation
  24713. n.prototype.CursorAnimation = function(a, b, c) {
  24714. function d() {
  24715. g.orient = r.Math.degToRad(window.orientation || 0)
  24716. }
  24717. function e(a) {
  24718. if(!window.vrEnabled && window.orientEnable) return;
  24719. window.orientEnable || (window.orientEnable = 1);
  24720. var b = r.Math.degToRad(a.alpha)
  24721. , c = r.Math.degToRad(a.beta)
  24722. , d = r.Math.degToRad(a.gamma);
  24723. if (this.isHuawei5X ? (-1e3 === g.alpha && (g.alpha = b),
  24724. -1e3 === g.beta && (g.beta = c),
  24725. -1e3 === g.gamma && (g.gamma = d),
  24726. Math.abs(b - g.alpha) > .06 && (g.alpha = b),
  24727. Math.abs(c - g.beta) > .006 && (g.beta = c),
  24728. Math.abs(d - g.gamma) > .006 && (g.gamma = d)) : (g.alpha = b,
  24729. g.beta = c,
  24730. g.gamma = d),
  24731. n.vrDebug) {
  24732. $("#info-device-orientation").css("display", "block");
  24733. var e = "";
  24734. e += "alpha=(" + g.alpha + ")<BR/>",
  24735. e += "beta=(" + g.beta + ")<BR/>",
  24736. e += "gamma=" + g.gamma + "<BR/>",
  24737. document.getElementById("info-device-orientation").innerHTML = e
  24738. }
  24739. }
  24740. this.cursor = b,
  24741. this.raycaster = new r.Raycaster,
  24742. this.targetEventObj = {},
  24743. this.type = 1,
  24744. this.tweenFlag = !0;
  24745. var g = this;
  24746. this.target = c,
  24747. console.log(c.uuid),
  24748. this.euler = new r.Euler,
  24749. this.q0 = new r.Quaternion,
  24750. this.q1 = new r.Quaternion(-Math.sqrt(.5),0,0,Math.sqrt(.5)),
  24751. this.zee = new r.Vector3(0,0,1),
  24752. this.alpha = -1e3,
  24753. this.beta = -1e3,
  24754. this.gamma = -1e3,
  24755. this.orient = r.Math.degToRad(window.orientation || 0),
  24756. window.addEventListener("orientationchange", d),
  24757. window.addEventListener("deviceorientation", e),
  24758. this.setObjectQuaternion = function(a, b, d, e, f) {
  24759. g.euler.set(d, b, -e, "YXZ"),
  24760. a.setFromEuler(g.euler),
  24761. a.multiply(g.q1),
  24762. a.multiply(g.q0.setFromAxisAngle(g.zee, -f)),
  24763. c.updateMatrixWorld()
  24764. }
  24765. ,
  24766. parent !== window && window.addEventListener("message", function(a) {
  24767. var b = JSON.parse(a.data)
  24768. , c = -1 !== window.navigator.userAgent.indexOf("KIW-TL00H");
  24769. b && b.alpha && b.beta && b.gamma && function(a) {
  24770. var c = r.Math.degToRad(b.alpha)
  24771. , d = r.Math.degToRad(b.beta)
  24772. , e = r.Math.degToRad(b.gamma);
  24773. a ? (-1e3 === g.alpha && (g.alpha = c),
  24774. -1e3 === g.beta && (g.beta = d),
  24775. -1e3 === g.gamma && (g.gamma = e),
  24776. Math.abs(c - g.alpha) > .06 && (g.alpha = c),
  24777. Math.abs(d - g.beta) > .006 && (g.beta = d),
  24778. Math.abs(e - g.gamma) > .006 && (g.gamma = e)) : (g.alpha = c,
  24779. g.beta = d,
  24780. g.gamma = e)
  24781. }(c)
  24782. }),
  24783. this.update = function(a) {
  24784. TWEEN.update();
  24785. if(window.ifTest && window.vrEnabled) this.triggerTargetEvent() //测试时不根据陀螺仪来转向
  24786. else window.vrEnabled && (this.setObjectQuaternion(this.target.quaternion, this.alpha, this.beta, this.gamma, this.orient ),
  24787. this.triggerTargetEvent())
  24788. }
  24789. ,
  24790. this.triggerTargetEvent = function() {
  24791. var a = this.choseObj()
  24792. , b = a ? a.object : void 0;
  24793. this.targetEventObj.currentObj = b,
  24794. b !== this.targetEventObj.lastObj && (b && this.autoCursorPosition(a),
  24795. 1 === this.type ? (this.cursorAnimate && this.cursorAnimate.stop(),
  24796. b && b.enabled && this.startAnimate(function() {
  24797. this.clickCallback(b)
  24798. }
  24799. .bind(this))) : this.type,
  24800. this.targetEventObj.lastObj = b)
  24801. }
  24802. ,
  24803. this.choseObj = function() {
  24804. this.raycaster.setFromCamera({
  24805. x: 0,
  24806. y: 0
  24807. }, c);
  24808. var a = (this.raycaster.ray,
  24809. window.vrMarkers)
  24810. , b = this.raycaster.intersectObjects(a);
  24811. if (b.length > 0)
  24812. return b[0]
  24813. }
  24814. ,
  24815. this.clickCallback = function(a) {
  24816. this.runTHREEAction(a, "onclick")
  24817. }
  24818. ,
  24819. this.runTHREEAction = function(a, b) {
  24820. switch (b) {
  24821. case "onclick":
  24822. a._listeners && a._listeners.click && a._listeners.click.forEach(function(a) {
  24823. a()
  24824. });
  24825. break;
  24826. case "onhover":
  24827. a._listeners && a._listeners.hover && a._listeners.hover.forEach(function(a) {
  24828. a()
  24829. });
  24830. break;
  24831. case "onout":
  24832. a._listeners && a._listeners.out && a._listeners.out.forEach(function(a) {
  24833. a()
  24834. })
  24835. }
  24836. }
  24837. ,
  24838. this.startAnimate = function(a) {
  24839. this.tweenFlag && this.initAnimation(a)
  24840. }
  24841. ,
  24842. this.initAnimation = function(a) {
  24843. var b = this
  24844. , c = this.cursor.material.map.offset
  24845. , d = function(a) {
  24846. return Math.floor(17 * a) / 17
  24847. };
  24848. b.tweenFlag = !1,
  24849. this.cursorAnimate = new TWEEN.Tween(c).to({
  24850. x: 1
  24851. }, 1e3).onStart(function() {
  24852. b.tweenFlag = !1
  24853. }).onStop(function() {
  24854. b.tweenFlag = !0,
  24855. this.x = 0,
  24856. c.x = 0
  24857. }).onUpdate(function() {}).onComplete(function() {
  24858. a(),
  24859. c.x = 0,
  24860. setTimeout(function() {
  24861. b.tweenFlag = !0
  24862. }, 1500)
  24863. }),
  24864. this.cursorAnimate.easing(d),
  24865. this.cursorAnimate.start()
  24866. }
  24867. ,
  24868. this.autoCursorPosition = function(a) {
  24869. // var b = Math.abs(a.distance - 10);
  24870. // this.cursor.position.z = -b,
  24871. // b /= 10;
  24872. // alert(b);
  24873. // this.cursor.scale.set(b, b, b)
  24874. this.cursor.scale.set(.3,.3,.3)
  24875. }
  24876. }
  24877. ,
  24878. n.prototype.vrRenderer = function(a, b, c) {
  24879. var d = new b.vrCamera(c);
  24880. d.bananaAspect = .8,
  24881. this.width,
  24882. this.height;
  24883. var b = this;
  24884. this.setSize = function(c, d) {
  24885. a.setSize.call(this, c, d),
  24886. b.width = c,
  24887. b.height = d
  24888. }
  24889. ,
  24890. this.render = function(b, c, e, f) {
  24891. window.cameraQua = c.quaternion.clone();
  24892. var g, h;
  24893. if (c.__RESS__SKIP__STEREO__)
  24894. return a.render(b, c, e, f);
  24895. if ("PerspectiveCamera" === c.type)
  24896. g = d.cameraL,
  24897. h = d.cameraR,
  24898. b.updateMatrixWorld(),
  24899. null === c.parent && c.updateMatrixWorld(),
  24900. d.vrCameraUpdate(c);
  24901. else {
  24902. if ("OrthographicCamera" !== c.type)
  24903. return DEBUG && console.error("Unsupported renderer: ", c.type);
  24904. g = h = c
  24905. }
  24906. a.setScissorTest(!0),
  24907. a.setScissor(0, 0, this.width / 2, this.height),
  24908. a.setViewport(0, 0, this.width / 2, this.height),
  24909. a.render.call(this, b, g, e, f),
  24910. a.setScissor(this.width / 2, 0, this.width / 2, this.height),
  24911. a.setViewport(this.width / 2, 0, this.width / 2, this.height),
  24912. a.render.call(this, b, h, e, f),
  24913. a.setScissorTest(!1)
  24914. }
  24915. ,
  24916. this.__proto__ = {
  24917. __proto__: a
  24918. }
  24919. }
  24920. ,
  24921. n.prototype.vrCamera = function(a) {
  24922. this.type = "StereoCamera",
  24923. this._aspect = 1,
  24924. this._overlap = .064,
  24925. this.cameraL = new r.PerspectiveCamera,
  24926. this.cameraL.layers.enable(1),
  24927. this.cameraL.near = 0.01,//xzw add
  24928. this.cameraL.matrixAutoUpdate = !1,
  24929. this.cameraR = new r.PerspectiveCamera,
  24930. this.cameraR.layers.enable(2),
  24931. this.cameraR.near = 0.01,//xzw add
  24932. this.cameraR.matrixAutoUpdate = !1,
  24933. this.eyeRight = new r.Matrix4,
  24934. this.eyeLeft = new r.Matrix4,
  24935. this.vrCameraNeedsUpdate = !0,
  24936. window.vrCameraL = this.cameraL; // fyz 记录vr相机
  24937. Object.defineProperty(this, "bananaAspect", {
  24938. get: function() {
  24939. return this._aspect
  24940. },
  24941. set: function(a) {
  24942. this._aspect !== a && (this.vrCameraNeedsUpdate = !0),
  24943. this._aspect = a
  24944. }
  24945. }),
  24946. Object.defineProperty(this, "overlap", {
  24947. get: function() {
  24948. return this._overlap
  24949. },
  24950. set: function(a) {
  24951. this._overlap !== a && (this.vrCameraNeedsUpdate = !0),
  24952. this._overlap = a
  24953. }
  24954. }),
  24955. this.vrCameraUpdate = function(a) {
  24956. this.vrCameraNeedsUpdate = true;
  24957. if (this.vrCameraNeedsUpdate = this.vrCameraNeedsUpdate || this.bananaFov !== a.fov || this.bananaReal_aspect !== a.aspect * this.bananaAspect || this.bananaNear !== a.near || this.bananaFar !== a.far,
  24958. this.vrCameraNeedsUpdate) {
  24959. this.vrCameraNeedsUpdate = !1,
  24960. //console.debug("vrCameraUpdate"),
  24961. this.bananaFocus = a.focus,
  24962. this.bananaFov = a.fov,
  24963. this.bananaReal_aspect = a.aspect * this.bananaAspect,
  24964. this.bananaNear = a.near,
  24965. this.bananaFar = a.far,
  24966. //console.debug(a.aspect),
  24967. this.bananaFocus = 10;
  24968. 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);
  24969. this.eyeLeft.elements[12] = -e,
  24970. this.eyeRight.elements[12] = e,
  24971. b = -g * this.bananaReal_aspect + f,
  24972. c = g * this.bananaReal_aspect + f,
  24973. d.elements[0] = 2 * this.bananaNear / (c - b),
  24974. d.elements[8] = (c + b) / (c - b),
  24975. this.cameraL.projectionMatrix.copy(d),
  24976. b = -g * this.bananaReal_aspect - f,
  24977. c = g * this.bananaReal_aspect - f,
  24978. d.elements[0] = 2 * this.bananaNear / (c - b),
  24979. d.elements[8] = (c + b) / (c - b),
  24980. this.cameraR.projectionMatrix.copy(d)
  24981. }
  24982. this.cameraL.matrixWorld.copy(a.matrixWorld).multiply(this.eyeLeft),
  24983. this.cameraR.matrixWorld.copy(a.matrixWorld).multiply(this.eyeRight)
  24984. }
  24985. }
  24986. ,
  24987. n.prototype.boluoGetTexture = function(a) {
  24988. var b = new r.TextureLoader;
  24989. return b.crossOrigin = "anonymous",
  24990. b.load(a)
  24991. }
  24992. ,
  24993. /***********************************************************************************************************************************************************************************/
  24994. n.prototype.updateScreenSize = function() {//xzw 改 为了截屏 要改canvas大小 以及缩放时不模糊
  24995. var W,H;//当截屏时有setTimeout 期间不能恢复大小,所以要用W,H记录正常大小
  24996. return function(o){
  24997. var render = false;
  24998. var ratio;
  24999. var w, h; //记录应当render的大小
  25000. if(o && !o.resize && o.width!= void 0 && o.height!= void 0){
  25001. w = o.width, h = o.height, render = true, ratio=1;
  25002. }else{
  25003. w = $('#player').width();
  25004. h = $('#player').height();
  25005. o && o.resize && (W = this.renderWidth, H = this.renderHeight);
  25006. (w !== W || h !== H || this.forceUpdateSize) &&
  25007. (W = w, H = h, render = true, ratio = window.devicePixelRatio);
  25008. }
  25009. if(render){
  25010. this.setSize(w, h, ratio);
  25011. this.forceUpdateSize = !1
  25012. }
  25013. }
  25014. }()
  25015. ,
  25016. n.prototype.updateComponents = function() {
  25017. for (var e = Math.min(1, this.updateClock.getDelta()), t = 0; t < this.updateListeners.length; t++)
  25018. this.updateListeners[t].update(e)
  25019. }
  25020. ,
  25021. n.prototype.suspend = function() {
  25022. this.started = !1,
  25023. this.suspendedObjects = this.scene.children.map(function(e) {
  25024. return this.scene.remove(e),
  25025. e
  25026. }
  25027. .bind(this)),
  25028. this.render()
  25029. }
  25030. ,
  25031. n.prototype.resume = function() {
  25032. this.suspendedObjects.forEach(function(e) {
  25033. this.scene.add(e)
  25034. }
  25035. .bind(this)),
  25036. this.suspendedObjects = [],
  25037. this.started = !0,
  25038. p()
  25039. }
  25040. ;
  25041. var p = function() {
  25042. this.started && (window.requestAnimationFrame(p),
  25043. this.updateScreenSize(), // fyz resize
  25044. this.updateComponents(),
  25045. this.updateTextureMemory(),
  25046. this.render(),
  25047. window.stats && (window.fps = stats.update()),
  25048. this.emit(a.AfterRender))
  25049. };
  25050. n.prototype.getImageData = function() {
  25051. var e = document.createElement("canvas")
  25052. , t = e.getContext("2d");
  25053. return function(i, n, r) {
  25054. return e.width === n && e.height === r || (e.width = n,
  25055. e.height = r),
  25056. t.drawImage(i, 0, 0, n, r),
  25057. t.getImageData(0, 0, n, r)
  25058. }
  25059. }(),
  25060. n.prototype.initSizedTexture2D = function(e, t, i) {
  25061. var n = this.renderer
  25062. , o = n.context
  25063. , a = n.state
  25064. , s = new r.Texture(null);
  25065. s.flipY = !1,
  25066. i !== !0 && (i = !1),
  25067. s.generateMipmaps = i;
  25068. var l = n.paramThreeToGL(s.format)
  25069. , c = n.paramThreeToGL(s.type)
  25070. , h = n.properties.get(s)
  25071. , u = o.createTexture();
  25072. a.bindTexture(o.TEXTURE_2D, u),
  25073. o.pixelStorei(o.UNPACK_FLIP_Y_WEBGL, s.flipY),
  25074. o.texImage2D(o.TEXTURE_2D, 0, l, e, e, 0, l, c, null),
  25075. s.wrapS = t,
  25076. s.wrapT = t;
  25077. var d = n.paramThreeToGL(t);
  25078. return o.texParameteri(o.TEXTURE_2D, o.TEXTURE_WRAP_S, d),
  25079. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_WRAP_T, d),
  25080. i ? (s.magFilter = r.LinearFilter,
  25081. s.minFilter = r.LinearMipMapLinearFilter,
  25082. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_MAG_FILTER, o.LINEAR),
  25083. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_MIN_FILTER, o.LINEAR_MIPMAP_NEAREST),
  25084. o.generateMipmap(o.TEXTURE_2D)) : (s.magFilter = r.LinearFilter,
  25085. s.minFilter = r.LinearFilter,
  25086. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_MAG_FILTER, o.LINEAR),
  25087. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_MIN_FILTER, o.LINEAR)),
  25088. a.bindTexture(o.TEXTURE_2D, null),
  25089. h.__webglTexture = u,
  25090. s
  25091. }
  25092. ,
  25093. n.prototype.initSizedCubeMap = function(e, t) {
  25094. var i = this.renderer
  25095. , n = i.context
  25096. , o = i.state
  25097. , a = new r.CubeTexture([null, null, null, null, null, null]);
  25098. a.flipY = !1,
  25099. a.generateMipmaps = t;
  25100. var s = i.paramThreeToGL(a.format)
  25101. , l = i.paramThreeToGL(a.type)
  25102. , c = i.properties.get(a)
  25103. , h = n.createTexture();
  25104. o.bindTexture(n.TEXTURE_CUBE_MAP, h),
  25105. n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL, a.flipY);
  25106. for (var u = 0; u < 6; u++)
  25107. n.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X + u, 0, s, e, e, 0, s, l, null);
  25108. return t ? (a.magFilter = r.LinearFilter,
  25109. a.minFilter = r.LinearMipMapLinearFilter,
  25110. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MAG_FILTER, n.LINEAR),
  25111. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MIN_FILTER, n.LINEAR_MIPMAP_LINEAR),
  25112. n.texParameteri(n.TEXTURE_CUBE_MAP, n.GENERATE_MIPMAP, n.TRUE),
  25113. n.generateMipmap(n.TEXTURE_CUBE_MAP)) : (a.magFilter = r.LinearFilter,
  25114. a.minFilter = r.LinearFilter,
  25115. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MAG_FILTER, n.LINEAR),
  25116. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MIN_FILTER, n.LINEAR)),
  25117. o.bindTexture(n.TEXTURE_CUBE_MAP, null),
  25118. c.__image__webglTextureCube = h,
  25119. a
  25120. }
  25121. ,
  25122. n.prototype.deallocateCubeTexture = function(e) {
  25123. var t = this.renderer
  25124. , i = t.context
  25125. , n = t.properties.get(e);
  25126. i.deleteTexture(n.__image__webglTextureCube)
  25127. }
  25128. ,
  25129. n.prototype.uploadTexture2D = function(e, t, i, n, r, o) {
  25130. var a = this.renderer
  25131. , s = a.context
  25132. , l = a.state
  25133. , c = a.properties.get(t);
  25134. l.bindTexture(s.TEXTURE_2D, c.__webglTexture),
  25135. s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL, t.flipY),
  25136. s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL, t.premultiplyAlpha),
  25137. s.pixelStorei(s.UNPACK_ALIGNMENT, t.unpackAlignment),
  25138. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_WRAP_S, a.paramThreeToGL(t.wrapS)),
  25139. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_WRAP_T, a.paramThreeToGL(t.wrapT)),
  25140. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_MAG_FILTER, a.paramThreeToGL(t.magFilter)),
  25141. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_MIN_FILTER, a.paramThreeToGL(t.minFilter)),
  25142. s.texSubImage2D(s.TEXTURE_2D, 0, i, n, s.RGBA, s.UNSIGNED_BYTE, e),
  25143. t.generateMipmaps && s.generateMipmap(s.TEXTURE_2D),
  25144. l.bindTexture(s.TEXTURE_2D, null)
  25145. }
  25146. ,
  25147. n.prototype.uploadTexture3D = function(e, t, i, n, r, o, a) {
  25148. var s = this.renderer
  25149. , l = s.context
  25150. , c = s.state
  25151. , h = s.properties.get(t);
  25152. c.bindTexture(l.TEXTURE_CUBE_MAP, h.__image__webglTextureCube),
  25153. l.pixelStorei(l.UNPACK_FLIP_Y_WEBGL, t.flipY),
  25154. l.texSubImage2D(r, 0, i, n, l.RGBA, l.UNSIGNED_BYTE, e),
  25155. t.generateMipmaps && l.generateMipmap(l.TEXTURE_CUBE_MAP),
  25156. c.bindTexture(l.TEXTURE_CUBE_MAP, null)
  25157. }
  25158. ,
  25159. n.prototype.rebuildMipMaps2D = function(e) {
  25160. var t = this.renderer
  25161. , i = t.context
  25162. , n = t.state;
  25163. t.properties.get(e);
  25164. i.generateMipmap(i.TEXTURE_2D),
  25165. n.bindTexture(i.TEXTURE_2D, null)
  25166. }
  25167. ,
  25168. n.prototype.rebuildMipMaps3D = function(e) {
  25169. var t = this.renderer
  25170. , i = t.context
  25171. , n = t.state
  25172. , r = t.properties.get(e);
  25173. n.bindTexture(i.TEXTURE_CUBE_MAP, r.__image__webglTextureCube),
  25174. i.generateMipmap(i.TEXTURE_CUBE_MAP),
  25175. n.bindTexture(i.TEXTURE_CUBE_MAP, null)
  25176. }
  25177. ,
  25178. n.prototype.renderToCubeMap = function() {
  25179. var e = !1
  25180. , t = null
  25181. , i = null
  25182. , n = null
  25183. , a = null
  25184. , s = null
  25185. , l = 1;
  25186. return function(c, h, u, d, p, f, g, m, v, A, y, C, I, E, b, w) {
  25187. var _ = this.renderer;
  25188. _.context;
  25189. e || (i = new r.OrthographicCamera(l / -2,l / 2,l / 2,l / -2,-200,200),
  25190. i.position.z = 150,
  25191. t = new r.Scene,
  25192. t.add(i),
  25193. n = new r.ShaderMaterial({
  25194. uniforms: {
  25195. tDiffuse: {
  25196. type: "t",
  25197. value: null
  25198. },
  25199. alpha: {
  25200. type: "f",
  25201. value: 1
  25202. }
  25203. },
  25204. vertexShader: o.basicTextured.vertexShader,
  25205. fragmentShader: o.basicTextured.fragmentShader,
  25206. depthWrite: !1,
  25207. depthTest: !1,
  25208. side: r.DoubleSide
  25209. }),
  25210. a = new r.PlaneBufferGeometry(l,l),
  25211. s = new r.Mesh(a,n),
  25212. s.position.z = 0,
  25213. t.add(s),
  25214. e = !0);
  25215. var T = a.getAttribute("uv");
  25216. T.setDynamic(!0),
  25217. T.needsUpdate = !0;
  25218. var x = T.array
  25219. , S = p / u
  25220. , M = f / d
  25221. , R = g / u
  25222. , P = m / d;
  25223. x[0] = S,
  25224. x[1] = M + P,
  25225. x[2] = S + R,
  25226. x[3] = M + P,
  25227. x[4] = S,
  25228. x[5] = M,
  25229. x[6] = S + R,
  25230. x[7] = M;
  25231. var O = a.getAttribute("position");
  25232. O.setDynamic(!0),
  25233. O.needsUpdate = !0;
  25234. var L = O.array
  25235. , D = v / h.width - l / 2
  25236. , N = A / h.height - l / 2
  25237. , B = y / h.width
  25238. , F = C / h.height;
  25239. L[0] = D,
  25240. L[1] = N + F,
  25241. L[3] = D + B,
  25242. L[4] = N + F,
  25243. L[6] = D,
  25244. L[7] = N,
  25245. L[9] = D + B,
  25246. L[10] = N;
  25247. this.renderer.properties.get(c);
  25248. n.uniforms.tDiffuse.value = c,
  25249. n.blending = E || r.NoBlending,
  25250. n.transparent = !!b,
  25251. void 0 !== w && null !== w || (w = 1),
  25252. n.uniforms.alpha.value = w,
  25253. n.needUpdate = !0,
  25254. h.activeCubeFace = I,
  25255. h.viewport.set(0, 0, h.width, h.height);
  25256. var V = this.renderer.autoClear;
  25257. this.renderer.autoClear = !1,
  25258. this.renderer.render(t, i, h, !1),
  25259. this.renderer.autoClear = V
  25260. }
  25261. }(),
  25262. n.prototype.copyCubeMap = function() {
  25263. var e = !1
  25264. , t = null
  25265. , i = null
  25266. , a = null
  25267. , s = null
  25268. , l = null
  25269. , c = new r.Euler;
  25270. new r.Vector3;
  25271. return function(h, u, d, p, f, g, m, v, A) {
  25272. this.renderer;
  25273. if (!e) {
  25274. var y = 2;
  25275. i = new r.OrthographicCamera(y / -2,y / 2,y / 2,y / -2,0,200),
  25276. i.position.set(0, 0, 0),
  25277. t = new r.Scene,
  25278. t.add(i),
  25279. a = new r.ShaderMaterial({
  25280. uniforms: {
  25281. tDiffuse: {
  25282. type: "t",
  25283. value: null
  25284. },
  25285. alpha: {
  25286. type: "f",
  25287. value: 1
  25288. }
  25289. },
  25290. vertexShader: o.copyCubeMap.vertexShader,
  25291. fragmentShader: o.copyCubeMap.fragmentShader,
  25292. depthWrite: !1,
  25293. depthTest: !1,
  25294. side: r.DoubleSide
  25295. }),
  25296. s = new r.BoxGeometry(y,y,y),
  25297. l = new r.Mesh(s,a),
  25298. t.add(l),
  25299. e = !0
  25300. }
  25301. for (var C = 0; C < 6; C++)
  25302. n.getCubeOrientationForCubeFace(C, c),
  25303. l.rotation.copy(c),
  25304. l.matrixWorldNeedsUpdate = !0,
  25305. l.updateMatrixWorld(),
  25306. a.uniforms.tDiffuse.value = h,
  25307. a.blending = m || r.NoBlending,
  25308. a.transparent = !!v,
  25309. void 0 !== A && null !== A || (A = 1),
  25310. a.uniforms.alpha.value = A,
  25311. a.needUpdate = !0,
  25312. u.activeCubeFace = C,
  25313. u.viewport.set(0, 0, f, g),
  25314. this.renderer.render(t, i, u, !1)
  25315. }
  25316. }(),
  25317. n.getLookAtForCubeFace = function(e, t) {
  25318. switch (e) {
  25319. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  25320. t.set(1, 0, 0);
  25321. break;
  25322. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  25323. t.set(-1, 0, 0);
  25324. break;
  25325. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  25326. t.set(0, 1, 0);
  25327. break;
  25328. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  25329. t.set(0, -1, 0);
  25330. break;
  25331. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  25332. t.set(0, 0, 1);
  25333. break;
  25334. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  25335. t.set(0, 0, -1)
  25336. }
  25337. }
  25338. ,
  25339. n.getCubeOrientationForCubeFace = function(e, t) {
  25340. switch (e) {
  25341. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  25342. t.set(0, -Math.PI / 2, 0);
  25343. break;
  25344. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  25345. t.set(0, Math.PI / 2, 0);
  25346. break;
  25347. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  25348. t.set(Math.PI / 2, Math.PI, 0);
  25349. break;
  25350. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  25351. t.set(-Math.PI / 2, Math.PI, 0);
  25352. break;
  25353. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  25354. t.set(0, -Math.PI, 0);
  25355. break;
  25356. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  25357. t.set(0, 0, 0)
  25358. }
  25359. }
  25360. ,
  25361. t.exports = n
  25362. }
  25363. , {
  25364. "../enum/GLCubeFaces": 25,
  25365. "../enum/GLTextureType": 26,
  25366. "../enum/SceneRendererEvents": 43,
  25367. "../exception/BasicException": 55,
  25368. "../exception/RendererCreationException": 57,
  25369. "../settings": 166,
  25370. "../shaders": 167,
  25371. /********************************************************************fyz改 from徐世廷**********************************************************************/
  25372. "../util/browser": 182,
  25373. /************************************************************************************************************************************************/
  25374. events: 202,
  25375. three: 217
  25376. }],
  25377. 159: [function(e, t, i) {
  25378. "use strict";
  25379. function n(e) {
  25380. this.messenger = new a(e),
  25381. this.clientKey = null
  25382. }
  25383. var r = e("../util/ajax")
  25384. , o = e("./PostMessageType")
  25385. , a = e("./postmessage")
  25386. , s = e("./VersionInfo")
  25387. , l = e("events").EventEmitter
  25388. , c = window.location.origin + "/api/v1/user/";
  25389. n.prototype = Object.create(l.prototype),
  25390. n.prototype.bindEvents = function() {
  25391. this.messenger.on(o.ACTION, this.onMessageReceived.bind(this))
  25392. }
  25393. ,
  25394. n.prototype.waitForConnection = function() {
  25395. var e = new Promise(function(e, t) {
  25396. this.messenger.on(o.CONNECT, function(i) {
  25397. this.onConnectionReceived(i).then(e.bind(this, i.sdkVersion), t.bind())
  25398. }
  25399. .bind(this))
  25400. }
  25401. .bind(this));
  25402. return e
  25403. }
  25404. ,
  25405. n.prototype.onConnectionReceived = function(e) {
  25406. return this.messenger.setTarget(e.source, e.origin),
  25407. this.verifyConnection(e).then(function(t, i) {
  25408. this.messenger.send({
  25409. type: o.ACCEPT,
  25410. toId: e.fromId,
  25411. warning: i
  25412. }),
  25413. this.clientKey = t,
  25414. this.messenger.removeAllListeners(o.CONNECT),
  25415. this.bindEvents()
  25416. }
  25417. .bind(this), function(t) {
  25418. this.messenger.send({
  25419. type: o.REJECT,
  25420. toId: e.fromId,
  25421. reason: t
  25422. }),
  25423. this.messenger.setTarget()
  25424. }
  25425. .bind(this))
  25426. }
  25427. ,
  25428. n.prototype.verifyConnection = function(e) {
  25429. return new Promise(function(t, i) {
  25430. var n;
  25431. if (s.isDeprecated(e.sdkVersion))
  25432. n = "这个版本正在被弃用";
  25433. else if (!s.isSupported(e.sdkVersion))
  25434. return i("不支持此版本的SDK");
  25435. var o = {
  25436. cache: !1,
  25437. headers: {
  25438. "X-port-Application-Key": e.applicationKey,
  25439. "X-port-Referrer": e.origin
  25440. }
  25441. };
  25442. r.get(c, o).done(t.bind(this, e.applicationKey, n)).fail(i.bind(this, "key/referrer mismatch"))
  25443. }
  25444. )
  25445. }
  25446. ,
  25447. n.prototype.onMessageReceived = function(e) {
  25448. if (this.validateClientApplicationKey(e.applicationKey)) {
  25449. var t = this;
  25450. e.onDone = function(i) {
  25451. i.toId = e.fromId,
  25452. i.uid = e.uid,
  25453. i.type = o.RESPONSE,
  25454. t.messenger.send(i)
  25455. }
  25456. ,
  25457. this.emit(o.ACTION, e)
  25458. }
  25459. }
  25460. ,
  25461. n.prototype.validateClientApplicationKey = function(e) {
  25462. return this.clientKey === e
  25463. }
  25464. ,
  25465. n.prototype.sendEvent = function(e, t) {
  25466. this.messenger.send({
  25467. type: o.EVENT,
  25468. eventType: e,
  25469. eventData: t
  25470. })
  25471. }
  25472. ,
  25473. t.exports = n
  25474. }
  25475. , {
  25476. "../util/ajax": 181,
  25477. "./PostMessageType": 160,
  25478. "./VersionInfo": 163,
  25479. "./postmessage": 165,
  25480. events: 202
  25481. }],
  25482. 160: [function(e, t, i) {
  25483. "use strict";
  25484. t.exports = Object.freeze({
  25485. CONNECT: "postmessage.connect",
  25486. ACCEPT: "postmessage.accept",
  25487. REJECT: "postmessage.reject",
  25488. ACTION: "postmessage.action",
  25489. RESPONSE: "postmessage.response",
  25490. EVENT: "postmessage.event"
  25491. })
  25492. }
  25493. , {}],
  25494. 161: [function(e, t, i) {
  25495. "use strict";
  25496. t.exports = Object.freeze({
  25497. MOVE: "sdk.move",
  25498. ENTER_PANO: "sdk.enterpano",
  25499. MODEL_LOADED: "sdk.modelloaded"
  25500. })
  25501. }
  25502. , {}],
  25503. 162: [function(e, t, i) {
  25504. "use strict";
  25505. t.exports = Object.freeze({
  25506. FLY: "transition.fly",
  25507. FADEOUT: "transition.fade",
  25508. INSTANT: "transition.instant"
  25509. })
  25510. }
  25511. , {}],
  25512. 163: [function(e, t, i) {
  25513. "use strict";
  25514. t.exports = {
  25515. current: "1.0",
  25516. supported: ["1.0"],
  25517. deprecated: [],
  25518. isSupported: function(e) {
  25519. return this.supported.indexOf(e) !== -1
  25520. },
  25521. isDeprecated: function(e) {
  25522. return this.deprecated.indexOf(e) !== -1
  25523. },
  25524. isValid: function(e) {
  25525. return this.isSupported(e) || this.isDeprecated(e)
  25526. }
  25527. }
  25528. }
  25529. , {}],
  25530. 164: [function(e, t, i) {
  25531. (function(i) {
  25532. "use strict";
  25533. function n(e, t, i) {
  25534. e && (e = e.toLowerCase().trim());
  25535. var n = new I.UP.clone
  25536. , r = Math.PI / 3
  25537. , o = Math.PI / 2;
  25538. switch (e) {
  25539. case "left":
  25540. i.copy(t),
  25541. i.applyAxisAngle(n, o);
  25542. break;
  25543. case "right":
  25544. i.copy(t),
  25545. i.applyAxisAngle(n, -o);
  25546. break;
  25547. case "forwardleft":
  25548. i.copy(t),
  25549. i.applyAxisAngle(n, r);
  25550. break;
  25551. case "forwardright":
  25552. i.copy(t),
  25553. i.applyAxisAngle(n, -r);
  25554. break;
  25555. case "forward":
  25556. default:
  25557. i.copy(t)
  25558. }
  25559. return i
  25560. }
  25561. function r(e, t) {
  25562. if (e) {
  25563. var i = {
  25564. pano: e,
  25565. lookAtPoint: null,
  25566. duration: null,
  25567. maxDistanceOverride: null,
  25568. skipWarpingCheck: !1
  25569. };
  25570. this.player.flyToPano(i, function() {
  25571. t && t({
  25572. success: !0,
  25573. message: "Transition complete."
  25574. })
  25575. })
  25576. } else
  25577. R.warn("Showcase -> clickPanoObject: Unable to find pano."),
  25578. t && t({
  25579. success: !1,
  25580. error: "Unable to find pano."
  25581. })
  25582. }
  25583. function o(e, t) {
  25584. var i = this.findRankedPano(e, t);
  25585. return i >= 0 ? this.handleToObject[i] : (R.warn("Showcase -> findRankedPanoObject: Unable to find nearby pano."),
  25586. null)
  25587. }
  25588. function a(e, t) {
  25589. var i = this.findRankedtag(e, t);
  25590. return i >= 0 ? this.handleToObject[i] : (R.warn("Showcase -> findRankedtagObject: Unable to find nearby tag."),
  25591. null)
  25592. }
  25593. function s(e, t) {
  25594. t.copy(I.FORWARD),
  25595. e.getDirection(t)
  25596. }
  25597. function l(e) {
  25598. function t(e) {
  25599. var t = (new c.Euler).setFromQuaternion(e.quaternion, "YXZ");
  25600. return {
  25601. x: c.Math.radToDeg(t._x),
  25602. y: c.Math.radToDeg(t._y),
  25603. z: c.Math.radToDeg(t._z)
  25604. }
  25605. }
  25606. var i = function(e) {
  25607. return e.alignmentType !== m.ALIGNED ? null : {
  25608. x: e.position.x,
  25609. y: e.position.y,
  25610. z: e.position.z
  25611. }
  25612. };
  25613. return {
  25614. panos: e.panos.list.map(function(n) {
  25615. var r = y.getCubemapUrls(e.urls, n.id, "high")[C.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z];
  25616. return {
  25617. uuid: n.id,
  25618. aligned: n.alignmentType === m.ALIGNED,
  25619. neighbourUUIDs: n.neighbourUUIDs.slice(),
  25620. position: i(n),
  25621. rotation: t(n),
  25622. thumbnail: r
  25623. }
  25624. })
  25625. }
  25626. }
  25627. var c = e("three")
  25628. , h = e("./ApiHost")
  25629. , u = e("../util/logger")
  25630. , d = e("../util/common")
  25631. , p = e("../util/math")
  25632. , f = e("../enum/ModelManagerEvents")
  25633. , g = e("./PostMessageType")
  25634. , m = e("../enum/AlignmentType")
  25635. , v = e("../enum/Direction")
  25636. , A = e("./TransitionStyles")
  25637. , y = e("../util/panorama")
  25638. , C = e("../enum/GLCubeFaces")
  25639. , I = e("../enum/Vectors")
  25640. , E = e("../enum/Viewmode")
  25641. , b = e("../enum/WarpStyle")
  25642. , w = (e("../enum/Keys"),
  25643. e("../enum/PlayerEvents"))
  25644. , _ = e("../sdk/SdkEvents")
  25645. , I = e("../enum/Vectors")
  25646. , T = e("../enum/ControlEvents")
  25647. , x = e("../enum/RenderLayers")
  25648. , S = (e("../constants"),
  25649. e("../settings"))
  25650. , M = e("../lib/jpeg_encoder")
  25651. , R = new u(i)
  25652. , P = function() {
  25653. var e = function e() {
  25654. e.playerDirection.copy(e.player.mode === E.FLOORPLAN ? I.UP : I.FORWARD),
  25655. e.player.getDirection(e.playerDirection),
  25656. e.projectVectors();
  25657. var t = e.playerDirection.angleTo(e.lastFacingDirection);
  25658. if (e.angleTravelled += Math.abs(t),
  25659. e.angleTravelled >= Math.abs(e.angle)) {
  25660. if (e.active = !1,
  25661. e.onDone) {
  25662. var i = e.onDone;
  25663. i()
  25664. }
  25665. } else
  25666. e.lastFacingDirection.copy(e.playerDirection),
  25667. window.setTimeout(e, 4)
  25668. };
  25669. return e.active = !1,
  25670. e.angle = 0,
  25671. e.angleTravelled = 0,
  25672. e.playerDirection = new c.Vector3,
  25673. e.lastFacingDirection = new c.Vector3,
  25674. e.onDone = null,
  25675. e.player = null,
  25676. e.start = function(t, i, n, r) {
  25677. e.active = !0,
  25678. t && i && (i = 0),
  25679. e.angle = t || i,
  25680. e.xAngle = t,
  25681. e.yAngle = i,
  25682. e.angleTravelled = 0,
  25683. e.playerDirection.copy(n.mode === E.FLOORPLAN ? I.UP : I.FORWARD),
  25684. n.getDirection(e.playerDirection),
  25685. e.lastFacingDirection.copy(e.playerDirection),
  25686. e.projectVectors(),
  25687. e.onDone = r,
  25688. e.player = n,
  25689. e()
  25690. }
  25691. ,
  25692. e.projectVectors = function() {
  25693. e.xAngle && (e.playerDirection.projectOnPlane(I.UP),
  25694. e.lastFacingDirection.projectOnPlane(I.UP))
  25695. }
  25696. ,
  25697. e
  25698. }()
  25699. , O = function() {
  25700. var e = new c.Vector3;
  25701. return function(t) {
  25702. t ? (e.copy(t.position),
  25703. e.add(t.discPosition),
  25704. p.projectPositionToCanvas(e, this.player.camera, e),
  25705. this.click(e.x, e.y)) : R.warn("Showcase -> clicktagObject: Unable to find tag.")
  25706. }
  25707. }()
  25708. , L = function() {
  25709. return this.player.mode === E.PANORAMA ? S.insideLookLimitUp : this.player.mode === E.DOLLHOUSE ? 90 - c.Math.radToDeg(S.dollhouseDefault.minPolarAngle) : null
  25710. }
  25711. , D = function() {
  25712. return this.player.mode === E.PANORAMA ? S.insideLookLimitDown : this.player.mode === E.DOLLHOUSE ? 90 - c.Math.radToDeg(S.dollhouseDefault.maxPolarAngle) : null
  25713. }
  25714. , N = function(e) {
  25715. var t = new c.Vector3;
  25716. return function(e) {
  25717. var i = this.player.getDirection();
  25718. t.copy(i);
  25719. var n = t.y;
  25720. t.y = 0,
  25721. t.normalize();
  25722. var r = c.Math.radToDeg(t.angleTo(i)) * (n < 0 ? -1 : 1);
  25723. if (this.player.mode !== E.DOLLHOUSE && this.player.mode !== E.PANORAMA)
  25724. return 0 !== e && R.warn("Cannot rotate in y direction when in " + this.player.mode + " mode"),
  25725. 0;
  25726. this.player.mode === E.DOLLHOUSE && (r = -r);
  25727. var o = L.call(this) - .1
  25728. , a = D.call(this) + .1
  25729. , s = r + e;
  25730. s > o ? s = o : s < a && (s = a);
  25731. var l = s - r;
  25732. return e > 0 && l < .01 && (l = 0),
  25733. e < 0 && l > -.01 && (l = 0),
  25734. l
  25735. }
  25736. }()
  25737. , B = function() {
  25738. var e = new c.Euler;
  25739. return function(t) {
  25740. return e.setFromQuaternion(t.quaternion, "YXZ"),
  25741. {
  25742. position: {
  25743. x: t.position.x,
  25744. y: t.position.y,
  25745. z: t.position.z
  25746. },
  25747. rotation: {
  25748. x: c.Math.radToDeg(e.x),
  25749. y: c.Math.radToDeg(e.y),
  25750. z: 0
  25751. },
  25752. pano: t.currentPano ? t.currentPano.id : null,
  25753. mode: t.mode
  25754. }
  25755. }
  25756. }()
  25757. , F = null;
  25758. t.exports = {
  25759. init: function(e, t, i, n, r) {
  25760. V.init(e, t, i, r),
  25761. F = new Promise(function(e, t) {
  25762. i.on(w.Ready, function() {
  25763. e()
  25764. })
  25765. }
  25766. .bind(this));
  25767. var o = new h(window)
  25768. , a = o.waitForConnection();
  25769. a.then(function(e) {
  25770. o.on(g.ACTION, V.onMessageReceive.bind(V))
  25771. });
  25772. var s = function() {
  25773. var e = Date.now();
  25774. return function() {
  25775. if (!(Date.now() - e < 100)) {
  25776. var t = B(i);
  25777. o.sendEvent(_.MOVE, {
  25778. state: t
  25779. }),
  25780. e = Date.now()
  25781. }
  25782. }
  25783. }();
  25784. i.on(w.Move, s),
  25785. i.on(w.ViewChanged, s),
  25786. n.on(f.ActiveModelChanged, function(e) {
  25787. function t(e) {
  25788. var t, i = e.newPano.id;
  25789. e.oldPano && (t = e.oldPano.id),
  25790. i !== t && o.sendEvent(_.ENTER_PANO, {
  25791. oldPano: t,
  25792. newPano: i
  25793. })
  25794. }
  25795. var i = e.model
  25796. , n = e.oldModel;
  25797. V.model = i,
  25798. a.then(function() {
  25799. o.sendEvent(_.MODEL_LOADED, {
  25800. metadata: l(i)
  25801. })
  25802. }),
  25803. n && n.panos.forEach(function(e) {
  25804. e.removeEventListener("enter", t)
  25805. }),
  25806. i.panos.forEach(function(e) {
  25807. e.on("enter", t)
  25808. })
  25809. })
  25810. }
  25811. };
  25812. var V = {
  25813. director: null,
  25814. player: null,
  25815. controls: null,
  25816. sceneRenderer: null,
  25817. model: null,
  25818. init: function(e, t, i, n) {
  25819. this.director = e,
  25820. this.player = i,
  25821. this.controls = t,
  25822. this.sceneRenderer = n
  25823. },
  25824. handleToObject: {},
  25825. objectToHandle: {},
  25826. handleCount: 0,
  25827. onMessageReceive: function(e) {
  25828. if (e) {
  25829. var t = e.targetFunction
  25830. , i = e.params
  25831. , n = e.onDone;
  25832. t && this[t] && this[t](i, n)
  25833. }
  25834. },
  25835. waitForInit: function(e, t) {
  25836. F.then(t.bind({
  25837. success: !0,
  25838. message: "Init complete."
  25839. }))
  25840. },
  25841. moveToPano: function(e, t) {
  25842. var i = new c.Euler(0,0,0,"YXZ")
  25843. , n = new c.Quaternion;
  25844. return function(e, t) {
  25845. var r = e.pano
  25846. , o = e.rotation
  25847. , a = e.transition;
  25848. if (!this.model)
  25849. return t({
  25850. success: !1,
  25851. error: "The model has not been loaded yet"
  25852. });
  25853. var s = this.model.panos.get(r);
  25854. if (!s)
  25855. return t({
  25856. success: !1,
  25857. error: r + " does not exist in this model"
  25858. });
  25859. if (!o)
  25860. return t({
  25861. sucess: !1,
  25862. erorr: o + " is not a valid rotation"
  25863. });
  25864. i.set(c.Math.degToRad(o.x || 0), c.Math.degToRad(o.y || 0), c.Math.degToRad(o.z || 0), "YXZ"),
  25865. console.log(o.z);
  25866. var l = {
  25867. success: !0,
  25868. message: r
  25869. };
  25870. if (a === A.FADEOUT)
  25871. n.setFromEuler(i),
  25872. this.player.warpToPano(s, n, null, null, b.BLACK, null, null, t.bind(this, l));
  25873. else {
  25874. var h, u;
  25875. a === A.INSTANT && (h = 0,
  25876. u = 0);
  25877. var d = I.FORWARD.clone().applyEuler(i).add(s.position);
  25878. this.player.flyToPano({
  25879. pano: s,
  25880. lookAtPoint: d,
  25881. duration: h,
  25882. aimDuration: u
  25883. }, t.bind(this, l))
  25884. }
  25885. }
  25886. }(),
  25887. moveInDirection: function(e, t) {
  25888. var i = e.direction;
  25889. return "undefined" == typeof v[i] ? (R.warn("Showcase -> moveInDirection: Cannot move in invalid direction."),
  25890. void (t && t({
  25891. success: !1,
  25892. error: "Invalid direction."
  25893. }))) : void this.player.flyLocalDirection(I[i].clone()).then(function(e) {
  25894. t(e ? {
  25895. success: !0,
  25896. message: "moved " + i
  25897. } : {
  25898. success: !1,
  25899. error: "Cannot move in direction: " + i
  25900. })
  25901. })
  25902. },
  25903. getPose: function(e, t) {
  25904. this.player.camera.position,
  25905. (new c.Euler).setFromQuaternion(this.player.camera.quaternion, "YXZ");
  25906. return t({
  25907. success: !0,
  25908. message: B(this.player)
  25909. })
  25910. },
  25911. takeScreenShot: function() {
  25912. var e = new c.PerspectiveCamera
  25913. , t = new c.WebGLRenderTarget;
  25914. return function(i, n) {
  25915. if (!i.resolution)
  25916. return n({
  25917. success: !1,
  25918. error: "An invalid resolution was specified"
  25919. });
  25920. if (i.resolution.width === -1 || i.resolution.height === -1) {
  25921. var r = this.sceneRenderer.renderer.getSize();
  25922. i.resolution.width = r.width,
  25923. i.resolution.height = r.height
  25924. }
  25925. e.layers.set(x.DEFAULT),
  25926. i.visibleObjects && (i.visibleObjects.showtags && e.layers.enable(x.TAG),
  25927. i.visibleObjects.showPucks && e.layers.enable(x.PANOMARKERS),
  25928. i.visibleObjects.showReticule && e.layers.enable(x.RETICULE));
  25929. var o = i.resolution.width
  25930. , a = i.resolution.height
  25931. , s = o / a;
  25932. e.position.copy(this.sceneRenderer.camera.position),
  25933. e.quaternion.copy(this.sceneRenderer.camera.quaternion),
  25934. e.projectionMatrix.copy(this.player.camera.projectionMatrix),
  25935. e.projectionMatrix.elements[0] = this.player.camera.projectionMatrix.elements[5] / s,
  25936. t.setSize(o, a),
  25937. this.sceneRenderer.renderer.render(this.sceneRenderer.scene, e, t);
  25938. var l = new Uint8Array(o * a * 4);
  25939. this.sceneRenderer.renderer.readRenderTargetPixels(t, 0, 0, o, a, l);
  25940. var c = M.encode({
  25941. data: l,
  25942. width: o,
  25943. height: a,
  25944. heading: 180,
  25945. pitch: 0
  25946. }, {
  25947. quality: 75,
  25948. flipY: !0
  25949. })
  25950. , h = "data:image/jpg;base64," + d.uint8ToBase64(c.data);
  25951. n({
  25952. success: !0,
  25953. message: h
  25954. })
  25955. }
  25956. }(),
  25957. findRankedPano: function(e, t) {
  25958. var i = new c.Vector3
  25959. , r = new c.Vector3;
  25960. return function(e, t) {
  25961. s(this.player, r),
  25962. n(t, r, i);
  25963. var o = this.player.rankedPanoInDirection(e, i);
  25964. if (o) {
  25965. var a = this.objectToHandle[o.id];
  25966. return a || (this.objectToHandle[o.id] = a = this.handleCount++,
  25967. this.handleToObject[a] = o),
  25968. a
  25969. }
  25970. return R.warn("Showcase -> findRankedPano: Unable to find nearby pano."),
  25971. -1
  25972. }
  25973. }(),
  25974. findRankedtag: function(e, t) {
  25975. var i = new c.Vector3
  25976. , r = new c.Vector3;
  25977. return function(e, t) {
  25978. s(this.player, r),
  25979. n(t, r, i);
  25980. var o = this.player.rankedtagInDirection(e, i);
  25981. if (o) {
  25982. var a = this.objectToHandle[o.sid];
  25983. return a || (this.objectToHandle[o.sid] = a = this.handleCount++,
  25984. this.handleToObject[a] = o),
  25985. a
  25986. }
  25987. return R.warn("Showcase -> findRankedtag: Unable to find nearby tag."),
  25988. -1
  25989. }
  25990. }(),
  25991. clickNearesttag: function(e) {
  25992. this.clickRankedtag(0, e)
  25993. },
  25994. clickRankedtag: function(e, t) {
  25995. var i = a.call(this, e, t);
  25996. i && O.call(this, i)
  25997. },
  25998. clickNearestPano: function(e, t) {
  25999. this.clickRankedPano(0, e, t)
  26000. },
  26001. clickRankedPano: function(e, t, i) {
  26002. var n = o.call(this, e, t);
  26003. n ? r.call(this, n, i) : i(null)
  26004. },
  26005. clickPano: function(e, t) {
  26006. var i = this.handleTable[e];
  26007. i ? r.call(this, i, t) : t(null)
  26008. },
  26009. rotateDirection: function() {
  26010. return function(e, t) {
  26011. var i = e.direction
  26012. , n = e.angle;
  26013. if (!P.active) {
  26014. var r = 0
  26015. , o = 0
  26016. , a = 0
  26017. , s = 0;
  26018. if (!n || isNaN(n))
  26019. return R.warn("Showcase -> rotateDirection: Invalid rotation angle."),
  26020. void (t && t({
  26021. success: !1,
  26022. error: "Invalid rotation angle."
  26023. }));
  26024. if (this.player.mode === E.TRANSITIONING)
  26025. return R.warn("Automation -> rotateDirection: Cannot rotate while transitioning"),
  26026. void (t && t({
  26027. success: !1,
  26028. error: "Cannot rotate while transitioning"
  26029. }));
  26030. if (i === v.RIGHT || i === v.LEFT)
  26031. i === v.RIGHT && (n = -n),
  26032. r = n > 0 ? -1 : 1,
  26033. a = n;
  26034. else {
  26035. if (i !== v.UP && i !== v.DOWN)
  26036. return R.warn("Showcase -> rotateDirection: Invalid direction for rotation: " + i),
  26037. void (t && t({
  26038. success: !1,
  26039. error: "Invalid direction for rotation."
  26040. }));
  26041. if (this.player.mode === E.FLOORPLAN)
  26042. return R.warn("Showcase -> rotateDirection: Cannot rotate " + i + " in floorplan mode"),
  26043. void (t && t({
  26044. success: !1,
  26045. error: "Cannot rotate " + i + " in floorplan mode"
  26046. }));
  26047. if (i === v.DOWN && (n = -n),
  26048. n = N.call(this, n),
  26049. 0 === n)
  26050. return R.warn("Showcase -> rotateDirection: Already at maximum rotation in direction: " + i),
  26051. void (t && t({
  26052. success: !1,
  26053. error: "Already at maximum rotation in direction: " + i
  26054. }));
  26055. o = n > 0 ? 1 : -1,
  26056. s = n
  26057. }
  26058. var l = n;
  26059. n = c.Math.degToRad(n),
  26060. a = c.Math.degToRad(a),
  26061. s = c.Math.degToRad(s);
  26062. var h = this.controls.activeControl
  26063. , u = function() {
  26064. h.stopRotating(!0),
  26065. t && t({
  26066. success: !0,
  26067. message: "Rotated " + l.toFixed(2) + "° in direction: " + e.direction
  26068. })
  26069. };
  26070. h.startRotating(r, o),
  26071. P.start(a, s, this.player, u)
  26072. }
  26073. }
  26074. }(),
  26075. rotate: function() {
  26076. var e = new c.Vector3
  26077. , t = new c.Vector3;
  26078. return function(i, n) {
  26079. var r = i.xAngle
  26080. , o = i.yAngle;
  26081. if (!P.active) {
  26082. if (r = r || 0,
  26083. o = o || 0,
  26084. isNaN(r) || isNaN(o))
  26085. return R.warn("Showcase -> rotate: Invalid rotation angle."),
  26086. void (n && n({
  26087. success: !1,
  26088. error: "Invalid rotation angle."
  26089. }));
  26090. if (this.player.mode === E.TRANSITIONING)
  26091. return R.warn("Automation -> rotate: Cannot rotate while transitioning"),
  26092. void (n && n({
  26093. success: !1,
  26094. error: "Cannot rotate while transitioning"
  26095. }));
  26096. Math.abs(r) < .01 && (r = 0),
  26097. Math.abs(o) < .01 && (o = 0);
  26098. var a = o;
  26099. o = N.call(this, o),
  26100. r = -r;
  26101. var s = a > 0 ? "UP" : "DOWN";
  26102. if (!r && a && !o)
  26103. return R.warn("Showcase -> rotate: Already at maximum rotation in direction: " + s),
  26104. void (n && n({
  26105. success: !1,
  26106. error: "Already at maximum rotation in direction: " + s
  26107. }));
  26108. a > o && R.warn("Showcase -> rotate: Reached maximum rotation in direction: " + s);
  26109. var l = o;
  26110. o = c.Math.degToRad(o),
  26111. r = c.Math.degToRad(r),
  26112. e.copy(this.player.mode === E.FLOORPLAN ? I.UP : I.FORWARD),
  26113. this.player.getDirection(e),
  26114. t.copy(e).applyAxisAngle(I.UP, r),
  26115. t.applyAxisAngle(I.RIGHT, o);
  26116. var h = (e.angleTo(t),
  26117. r > 0 ? -1 : r < 0 ? 1 : 0)
  26118. , u = o > 0 ? 1 : o < 0 ? -1 : 0;
  26119. Math.abs(r) > Math.abs(o) ? u *= Math.abs(o / r) : Math.abs(o) > Math.abs(r) && (h *= Math.abs(r / o));
  26120. var d = this.controls.activeControl
  26121. , p = function() {
  26122. d.stopRotating(!0),
  26123. n && n({
  26124. success: !0,
  26125. message: "Rotated " + i.xAngle.toFixed(2) + "° horizontally, " + l.toFixed(2) + "° vertically"
  26126. })
  26127. };
  26128. d.startRotating(h, u),
  26129. P.start(r, o, this.player, p)
  26130. }
  26131. }
  26132. }(),
  26133. panCamera: function(e, t) {
  26134. function i(e) {
  26135. switch (r.removeAllListeners(T.AutoPanComplete),
  26136. r.removeAllListeners(T.AutoPanInterrupt),
  26137. r.removeAllListeners(T.AutoPanClamped),
  26138. e) {
  26139. case T.AutoPanInterrupt:
  26140. t({
  26141. success: !0,
  26142. message: "Camera panning interrupted."
  26143. });
  26144. break;
  26145. case T.AutoPanClamped:
  26146. if (r.autoPanPosition.x !== n.x || r.autoPanPosition.z !== n.z) {
  26147. if (Math.abs(this.player.position.x - r.autoPanPosition.x) < .01 && Math.abs(this.player.position.z - r.autoPanPosition.z) < .01)
  26148. return void t({
  26149. success: !1,
  26150. error: "Already at edge of current model bounds."
  26151. });
  26152. var i = "The view point is outside the bounds for the current model. ";
  26153. i += "The view point was clamped to " + o(r.target.x, r.target.z),
  26154. console.warn(i)
  26155. }
  26156. case T.AutoPanComplete:
  26157. t({
  26158. success: !0,
  26159. message: "Panned camera to position " + o(r.autoPanPosition.x, r.autoPanPosition.z)
  26160. })
  26161. }
  26162. }
  26163. if (this.player.mode !== E.DOLLHOUSE && this.player.mode !== E.FLOORPLAN)
  26164. return t({
  26165. success: !1,
  26166. error: "Camera panning is not available in the current mode: " + this.player.mode
  26167. });
  26168. var n = e.position
  26169. , r = this.player.control;
  26170. r.setAutoPanPosition(n.x, n.z),
  26171. r.autoPan = !0;
  26172. var o = function(e, t) {
  26173. return "(" + e.toFixed(2) + ", " + t.toFixed(2) + ")"
  26174. };
  26175. r.on(T.AutoPanComplete, i.bind(this, T.AutoPanComplete)),
  26176. r.on(T.AutoPanInterrupt, i.bind(this, T.AutoPanInterrupt)),
  26177. r.on(T.AutoPanClamped, i.bind(this, T.AutoPanClamped))
  26178. },
  26179. click: function(e, t) {
  26180. var i = e.x
  26181. , n = e.y
  26182. , r = e.percentage;
  26183. r === !0 && (i = i / 100 * $("#player").width(),
  26184. n = n / 100 * $("#player").height()),
  26185. this.player.handleInputStart(i, n),
  26186. this.player.updateIntersect(),
  26187. this.player.handleInputEnd(i, n)
  26188. },
  26189. mouseOver: function(e, t) {
  26190. var i = e.x
  26191. , n = e.y
  26192. , r = e.percentage;
  26193. r === !0 && (i = i / 100 * $("#player").width(),
  26194. n = n / 100 * $("#player").height()),
  26195. this.player.handleInputMove(i, n),
  26196. this.player.updateIntersect()
  26197. },
  26198. moveToMode: function(e, t) {
  26199. function i(e) {
  26200. t(e ? {
  26201. success: !1,
  26202. error: "Failed to load new mode: " + e
  26203. } : {
  26204. success: !0,
  26205. message: "Moved to new mode: " + n
  26206. })
  26207. }
  26208. var n = e.mode;
  26209. n === E.PANORAMA || n === E.DOLLHOUSE || n === E.FLOORPLAN ? this.director.changeMode(n).then(function() {
  26210. i()
  26211. }, function(e) {
  26212. i(e)
  26213. }) : t({
  26214. success: !1,
  26215. error: "Invalid mode selection"
  26216. })
  26217. }
  26218. }
  26219. }
  26220. ).call(this, "/js/sdk/automation.js")
  26221. }
  26222. , {
  26223. "../constants": 8,
  26224. "../enum/AlignmentType": 17,
  26225. "../enum/ControlEvents": 21,
  26226. "../enum/Direction": 22,
  26227. "../enum/GLCubeFaces": 25,
  26228. "../enum/Keys": 30,
  26229. "../enum/ModelManagerEvents": 33,
  26230. "../enum/PlayerEvents": 40,
  26231. "../enum/RenderLayers": 41,
  26232. "../enum/Vectors": 50,
  26233. "../enum/Viewmode": 51,
  26234. "../enum/WarpStyle": 52,
  26235. "../lib/jpeg_encoder": 94,
  26236. "../sdk/SdkEvents": 161,
  26237. "../settings": 166,
  26238. "../util/common": 185,
  26239. "../util/logger": 189,
  26240. "../util/math": 190,
  26241. "../util/panorama": 191,
  26242. "./ApiHost": 159,
  26243. "./PostMessageType": 160,
  26244. "./TransitionStyles": 162,
  26245. three: 217
  26246. }],
  26247. 165: [function(e, t, i) {
  26248. "use strict";
  26249. function n(e) {
  26250. this.sourceWindow = e,
  26251. this.targetWindow = null,
  26252. this.targetOrigin = null,
  26253. this.id = Math.floor(1e5 * Math.random()),
  26254. this.bindEvents()
  26255. }
  26256. var r = e("./PostMessageType")
  26257. , o = e("events").EventEmitter;
  26258. n.prototype = Object.create(o.prototype),
  26259. n.prototype.bindEvents = function() {
  26260. this.sourceWindow.addEventListener("message", this.onPostmessageReceived.bind(this))
  26261. }
  26262. ,
  26263. n.prototype.setTarget = function(e, t) {
  26264. this.targetWindow = e,
  26265. this.targetOrigin = t
  26266. }
  26267. ,
  26268. n.prototype.onPostmessageReceived = function(e) {
  26269. var t = e.origin || e.originalEvent.origin
  26270. , i = e.source;
  26271. switch (e.data.type) {
  26272. case r.CONNECT:
  26273. break;
  26274. case r.RESPONSE:
  26275. if (this.id !== e.data.toId)
  26276. return;
  26277. default:
  26278. if (!this.validateMessageOrigin(t))
  26279. return
  26280. }
  26281. var n = e.data;
  26282. n.source = i,
  26283. n.origin = t,
  26284. n.timestamp = Date.now(),
  26285. this.emit(e.data.type, n)
  26286. }
  26287. ,
  26288. n.prototype.validateMessageOrigin = function(e) {
  26289. return "*" === this.targetOrigin || e === this.targetOrigin
  26290. }
  26291. ,
  26292. n.prototype.send = function(e) {
  26293. this.targetWindow && this.targetOrigin && (e.fromId = this.id,
  26294. this.targetWindow.postMessage(e, this.targetOrigin))
  26295. }
  26296. ,
  26297. t.exports = n
  26298. }
  26299. , {
  26300. "./PostMessageType": 160,
  26301. events: 202
  26302. }],
  26303. 166: [function(e, t, i) {
  26304. "use strict";
  26305. var n = e("three")
  26306. , r = e("./util/browser")
  26307. , o = e("./enum/Viewmode")
  26308. , a = e("./enum/VROption")
  26309. , s = e("./enum/Colors")
  26310. , l = e("./enum/WarpStyle")
  26311. , c = e("./util/easing")
  26312. , h = e("./util/common")
  26313. , u = e("./util/showcase")
  26314. , d = e("./constants")
  26315. , p = {
  26316. debug: !1,
  26317. version: "2.25.6-0-gd87e5b1",
  26318. languageTag: r.valueFromHash("lang", null),
  26319. pageTitle: "四维虚拟漫游",
  26320. authorizationHeader: u.getAuthorizationHeader(),
  26321. autoplay: r.valueFromHash("play", !1) || !r.inIframe(),
  26322. logLevel: r.valueFromHash("log", 2),
  26323. skyboxRadius: 2500,
  26324. modelBoundsPadding: 5,
  26325. showNeighbors: !1,
  26326. brand: r.valueFromHash("brand", !0),
  26327. showHighlights: r.valueFromHash("hhl", !0) && r.valueFromHash("hr", 1),
  26328. startHighlights: r.valueFromHash("hl", -1),
  26329. specialEdition: r.valueFromHash("bn", 0),
  26330. useWheel: r.valueFromHash("wh", !0),
  26331. crossOrigin: "anonymous",
  26332. fancierTransition: !1,
  26333. wireframe: !1,
  26334. skyboxWireframe: !1,
  26335. modelAlpha: 1,
  26336. highlightPanoSelection: !1,
  26337. showSweeps: !0,
  26338. showSkyboxes: !1,
  26339. showMesh: !0,
  26340. showFloors: !1,
  26341. showFloorDuration: 300,
  26342. showFloorDelay: 300,
  26343. hideFloorDuration: 300,
  26344. hideFloorDelay: 0,
  26345. reticuleOpacityTransitionTime: 250,
  26346. reticuleColor: window.MP_PREFETCHED_MODELDATA.mouseMarkerColor || s.newBlue, // 方奕卓 配置鼠标标志颜色
  26347. markerOpacityTransitionTime: 500,
  26348. guiAnimationSpeed: 250,
  26349. highlightAnimationDuration: 500,
  26350. modelComponentLoadSpinnerDelay: 150,
  26351. captureErrors: !1,
  26352. maxMobileTextures: 6,
  26353. minimalMemoryMode: r.valueFromHash("m3", r.isMobile()),
  26354. startupFlyinDelay: 3e3,
  26355. dollhouseDefault: {
  26356. minDistance: 15,
  26357. maxDistance: 50,
  26358. minPolarAngle: n.Math.degToRad(10),
  26359. maxPolarAngle: n.Math.degToRad(90)
  26360. },
  26361. hideReticuleTimeout: 1e3,
  26362. analytics: {
  26363. inactivityThreshold: 30,
  26364. sessionTrackingRate: .15,
  26365. maxTrackedErrors: 20,
  26366. sessionDurationPingFrequency: 10,
  26367. sessionDurationTimeout: 15
  26368. },
  26369. flydown: {
  26370. movementEasing: "easeInOutQuad",
  26371. movementDelay: .001,
  26372. rotationEasing: "easeInOutQuad",
  26373. rotationDelay: .5,
  26374. modelTextureDelay: .75,
  26375. skyboxDelay: .75
  26376. },
  26377. transition: {
  26378. flySpeed: .001,
  26379. flyTime: 750,
  26380. flytimeMaxDistanceThreshold: 5,
  26381. flytimeDistanceMultiplier: 150,
  26382. aimTime: 1500,
  26383. aimSlowFactor: 1.5,
  26384. blur: 0.8,
  26385. movementEasing: "easeInOutQuad",
  26386. blendEasing: "easeInOutQuad",
  26387. fastForwardFactor: 3//r.valueFromHash("mfis", 3)
  26388. },
  26389. show360Views: {
  26390. enabled: !0,
  26391. transitionTime: 1e3
  26392. },
  26393. quickstart: {
  26394. enabled: 1 === r.valueFromHash("qust", 0) || 1 === r.valueFromHash("qs", 0),
  26395. animation: 1400,
  26396. showTextDelay: 500,
  26397. fadeOutDelay: 3e3,
  26398. fovChange: 10
  26399. },
  26400. appConfig: {
  26401. webvr_version: null,
  26402. segment_key: null,
  26403. embedly_key: null,
  26404. branch_key: null,
  26405. keen_write_key: null,
  26406. keen_project_id: null
  26407. },
  26408. vr: {
  26409. enabled: !0,
  26410. allowWebVR: !1,
  26411. option: r.valueFromHash("vr", a.CONTEXTUAL)
  26412. },
  26413. share: {
  26414. enabled: !r.valueFromHash("mls", 0) && r.valueFromHash("brand", !0)
  26415. },
  26416. input: {
  26417. longTapThreshold: 200,
  26418. moveToleranceNDC: .08,
  26419. touchMoveThreshold: 25
  26420. },
  26421. help: {
  26422. modalStayDuration: 600
  26423. },
  26424. immersive: {
  26425. timeToShowAgain: 1250,
  26426. uiStayDuration: 600
  26427. },
  26428. tourInteraction: {
  26429. disabled: "0" === r.valueFromHash("tourcta", null),
  26430. showPauseButton: 1e3,
  26431. showModal: 1500,
  26432. allowNextClick: 200,
  26433. largeModal: "1" === r.valueFromHash("tourcta", null),
  26434. smallModal: "2" === r.valueFromHash("tourcta", null)
  26435. },
  26436. labels: {
  26437. enabled: !1,
  26438. hideUntilStart: !0,
  26439. fadeInDuration: 250,
  26440. fadeInDelay: 250,
  26441. fadeOutDuration: 250,
  26442. fadeOutDelay: 0,
  26443. zoomHideThreshhold: {
  26444. mobile: r.isSmallScreen() ? .45 : .6,
  26445. desktop: 2
  26446. },
  26447. zoomTruncateThreshhold: {
  26448. mobile: r.isSmallScreen() ? .35 : .45,
  26449. desktop: .85
  26450. },
  26451. minLengthForTruncate: 16,
  26452. truncateLength: 12,
  26453. truncateSuffix: "..."
  26454. },
  26455. tags: {
  26456. enabled: r.valueFromHash("mt", 1),
  26457. startup: {
  26458. hideUntilStart: !0,
  26459. fadeInDuration: 500,
  26460. fadeInDelay: 100
  26461. },
  26462. visibility: {
  26463. anyDistance: !0,
  26464. visibleDistance: 8,
  26465. cameraClearance: .1,
  26466. alphaTestLevel: .05,
  26467. hideViaFloor: !0,
  26468. hideOffScreenDisc: !1,
  26469. hideOffScreenObject: !1
  26470. },
  26471. disc: {
  26472. opacity: 1,
  26473. disabledOpacity: .5,
  26474. scale: {
  26475. nearBound: 1.5,
  26476. farBound: 4.8,
  26477. linkFarBound: !1,
  26478. linkPercent: 40,
  26479. maxSize: 80,
  26480. minSize: 40,
  26481. baseViewportSize: 800,
  26482. responsiveness: 100
  26483. }
  26484. },
  26485. pole: {
  26486. enabled: !0,
  26487. height: .5,
  26488. width: 2,
  26489. opacity: .5,
  26490. color: "white"
  26491. },
  26492. navigate: {
  26493. nearestPano: !0,
  26494. lineOfSight: !0,
  26495. reactivate: !0,
  26496. aimAt: "disc",
  26497. tiltTolerance: 25,
  26498. rotateSpeedFactor: .6
  26499. }
  26500. },
  26501. path: {
  26502. color: window.MP_PREFETCHED_MODELDATA.floorMarkerColor || s.newBlue, // 方奕卓 配置导览标志颜色
  26503. colorUp: s._desat(s.newBlue, .5),
  26504. colorDown: s._darken(s.newBlue, .35),
  26505. opacity: .5,
  26506. style: "ribbon",
  26507. height: .025,
  26508. ribbonWidth: .24,
  26509. outsideHeight: .5,
  26510. waypointRadius: .5,
  26511. waypointIndoorRadius: .24,
  26512. waypointPulse: 1e3,
  26513. typ: l.BLACK,
  26514. meshFree: r.valueFromHash("mf", 1),
  26515. mapGuides: r.valueFromHash("guides", !0),
  26516. fadeInTime: 400,
  26517. fadeOutTime: 300
  26518. },
  26519. warp: {
  26520. nearPanoDist: .1,
  26521. matchCam: !1,
  26522. blur: .33,
  26523. fastTime: 1500,
  26524. teleportTime: 1500,
  26525. outsideTime: 2e3,
  26526. lookAheadMax: .3,
  26527. lookAheadDist: 2.5,
  26528. softPushDist: .37,
  26529. softPushEnd: .3,
  26530. softBendAngle: 8,
  26531. softBendTilt: 4,
  26532. softBendEnd: .3,
  26533. doBurns: true, //r.valueFromHash("kb", !0),
  26534. burnsAngle: 8, //导览在每个点停留时的旋转角度
  26535. minBurnsAngle: 35,
  26536. minDownAngle: -35,
  26537. maxTurnPerSec: 280,
  26538. maxAimPerSec: 35,
  26539. minRotation: 12,
  26540. maxAimRotation: 33.2,
  26541. turnFriction: .2,
  26542. flySpeed: .01,
  26543. minWarpTime: 1200,
  26544. warpInterruptionRedirectTime: 500,
  26545. tourStepDelay: r.valueFromHash("st", 0),
  26546. walkDelay: 0,
  26547. walkMaxDist: 50,
  26548. walkMinDist: .8,
  26549. walkSlideShowThreshhold: 3000,
  26550. walkExtraPanosDistance: .4,
  26551. timePerMeter: 1200,
  26552. motionLeadTime: 5000,
  26553. movementEasing: "easeInOutQuad",
  26554. blendEasing: "easeInOutQuad",
  26555. showBunny: !1,
  26556. loop: r.valueFromHash("lp", !1),
  26557. auto: r.valueFromHash("ts", -1),
  26558. eOrder: 'YXZ', //"YXZ",
  26559. stepFactor: .25,
  26560. brakeStrength: 2,
  26561. minBrakeAngle: .1,
  26562. maxBrakeAngle: 1.8,
  26563. climbEffort: 4
  26564. },
  26565. rotationFriction: .05,
  26566. rotationAccelerationInside: 4.5,
  26567. rotationAccelerationOutside: .15,
  26568. rotationAfterMoveMultiplier: 40,
  26569. rotationAfterMoveHistoryCount: 5,
  26570. panFriction: .09,
  26571. panAccelerationOutside: 60,
  26572. onload: r.valueFromHash("onload", o.PANORAMA),
  26573. zoomNearLimit: .1,
  26574. zoomFarLimit: 50,
  26575. navigation: {
  26576. panoScores: !1,
  26577. mouseDirection: !0,
  26578. filterStrictness: .75,
  26579. angleFactor: -30,
  26580. directionFactor: 10,
  26581. distanceFactor: -1,
  26582. optionalityFactor: 3
  26583. },
  26584. sdkInit: !1,
  26585. secretPanelWord: [38, 38, 40, 40, 37, 39, 37, 39, 66, 65],
  26586. console: r.valueFromHash("console", !1),
  26587. noMeshFloorPositionOffset: new n.Vector3(0,-1.2,0),
  26588. panoramaNeighbourMaxDistance: 5,
  26589. panoFloorClickRadius: .35,
  26590. showScreenshotLocations: !1,
  26591. showAxis: !1,
  26592. showNeighbourRaycasts: !1,
  26593. colorMarkerOnLoad: !1,
  26594. colorMarkerByFloor: !1,
  26595. tiling: {
  26596. panoPreRenderRepeatDelay: 2500,
  26597. panoPreRenderDelay: 500,
  26598. preRenderTourPanos: r.valueFromHash("tileprerender", 0),
  26599. tilingFlagNames: ["usetiles", "tiles"],
  26600. maxNavPanoQuality: r.valueFromHash("maxtileq", null),
  26601. maxZoomPanoQuality: r.valueFromHash("maxztileq", null),
  26602. overlayStyle: r.valueFromHash("tileoverlay", 0),
  26603. uploadIntervalDelay: r.valueFromHash("tileupdelay", 10),
  26604. initialIntervalDelay: r.valueFromHash("itiledelay", 0),
  26605. maxNonBaseUploadsPerFrame: r.valueFromHash("maxnbtpf", 2),
  26606. maxBaseUploadsPerFrame: r.valueFromHash("maxbtpf", 6),
  26607. customCompression: r.valueFromHash("tilecustcomp", 0),
  26608. // mobileHighQualityOverride: !1,
  26609. mobileHighQualityOverride: 1,
  26610. allowUltraHighResolution: true
  26611. },
  26612. zoom: {
  26613. enabled: true,
  26614. forceOff: r.valueFromHash("nozoom", 0),
  26615. overridemax: r.valueFromHash("maxzoom", null),
  26616. overridemin: r.valueFromHash("minzoom", null),
  26617. max: d.highQualityMaxZoom,
  26618. min: 1,
  26619. transitionStyle: r.valueFromHash("zoomtrans", 1),
  26620. activationThreshold: 1.1,
  26621. restoreTime: 500
  26622. },
  26623. profiling: {
  26624. enabled: r.valueFromHash("mem", !1)
  26625. }
  26626. };
  26627. p = h.deepExtend(p, d, {
  26628. insideFOV: r.valueFromHash("fov", d.insideFOV),
  26629. insideFOVMax: r.valueFromHash("fovmax", d.insideFOVMax),
  26630. panorama: {
  26631. transitionTime: 1e3,
  26632. modelAlpha: 0,
  26633. modelAlphaDelay: p.flydown.modelTextureDelay,
  26634. modelAlphaLength: 1,
  26635. skyboxOpacity: 1,
  26636. skyboxOpacityDelay: p.flydown.skyboxDelay,
  26637. skyboxOpacityLength: .9,
  26638. fovLength: 1,
  26639. fovDelay: 0,
  26640. cameraMatrixDuration: .8,
  26641. cameraMatrixDelay: 0,
  26642. cameraMatrixEase: c.easeInCubic,
  26643. reticuleOpacity: 1,
  26644. markerOpacity: .3,
  26645. markerOpacityOnHover: 1
  26646. },
  26647. dollhouse: {
  26648. transitionTime: 1e3,
  26649. modelAlpha: 1,
  26650. modelAlphaDelay: 0,
  26651. modelAlphaLength: 1 - p.flydown.modelTextureDelay,
  26652. skyboxOpacity: 0,
  26653. skyboxOpacityDelay: 0,
  26654. skyboxOpacityLength: 1 - p.flydown.skyboxDelay,
  26655. fovLength: 1,
  26656. fovDelay: 0,
  26657. cameraMatrixDuration: .8,
  26658. cameraMatrixDelay: .3,
  26659. cameraMatrixEase: c.easeInCubic,
  26660. reticuleOpacity: 1,
  26661. markerOpacity: 0,
  26662. markerOpacityOnHover: 0
  26663. },
  26664. floorplan: {
  26665. transitionTime: 1e3,
  26666. modelAlpha: 1,
  26667. modelAlphaDelay: 0,
  26668. modelAlphaLength: 1 - p.flydown.modelTextureDelay,
  26669. skyboxOpacity: 0,
  26670. skyboxOpacityDelay: 0,
  26671. skyboxOpacityLength: 1 - p.flydown.skyboxDelay,
  26672. fovLength: 1,
  26673. fovDelay: 0,
  26674. cameraMatrixDuration: .5,
  26675. cameraMatrixDelay: 0,
  26676. cameraMatrixEase: c.easeOutCubic,
  26677. reticuleOpacity: 1,
  26678. markerOpacity: 0,
  26679. markerOpacityOnHover: 0,
  26680. cameraHeight: 50
  26681. },
  26682. transitioning: {
  26683. reticuleOpacity: 0,
  26684. markerOpacity: .3,
  26685. markerOpacityOnHover: 1
  26686. },
  26687. "floorplan-dollhouse": {
  26688. rotationDelay: 0,
  26689. rotationDuration: 1
  26690. },
  26691. "floorplan-panorama": {
  26692. rotationDelay: .5,
  26693. rotationDuration: 1
  26694. },
  26695. "dollhouse-panorama": {
  26696. rotationDelay: .5,
  26697. rotationDuration: 1
  26698. },
  26699. "dollhouse-floorplan": {
  26700. rotationDelay: 0,
  26701. rotationDuration: 1,
  26702. cameraMatrixDuration: 1.05,
  26703. cameraMatrixDelay: .5
  26704. },
  26705. "panorama-dollhouse": {
  26706. rotationDelay: 0,
  26707. rotationDuration: .5
  26708. },
  26709. "panorama-floorplan": {
  26710. transitionTime: 1500,
  26711. rotationDelay: 0,
  26712. rotationDuration: .5
  26713. }
  26714. }),
  26715. p.path.meshFree && (p.path.typ = l.WALK),
  26716. p.zoom.max = p.zoom.overridemax || p.zoom.max,
  26717. p.zoom.min = p.zoom.overridemin || p.zoom.min,
  26718. t.exports = p
  26719. }
  26720. , {
  26721. "./constants": 8,
  26722. "./enum/Colors": 19,
  26723. "./enum/VROption": 47,
  26724. "./enum/Viewmode": 51,
  26725. "./enum/WarpStyle": 52,
  26726. "./util/browser": 182,
  26727. "./util/common": 185,
  26728. "./util/easing": 186,
  26729. "./util/showcase": 193,
  26730. three: 217
  26731. }],
  26732. 167: [function(e, t, i) {
  26733. "use strict";
  26734. var n = e("three")
  26735. , r = e("./settings")
  26736. , 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"
  26737. , a = "precision highp float;\nprecision highp int;\n\nuniform mat4 viewMatrix;\nuniform vec3 cameraPosition;\n";
  26738. t.exports = {
  26739. basicTextured: {
  26740. uniforms: {
  26741. tDiffuse: {
  26742. type: "t",
  26743. value: null
  26744. },
  26745. alpha: {
  26746. type: "f",
  26747. value: 1
  26748. }
  26749. },
  26750. vertexShader: "varying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}",
  26751. 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}"
  26752. },
  26753. copyCubeMap: {
  26754. uniforms: {
  26755. tDiffuse: {
  26756. type: "t",
  26757. value: null
  26758. },
  26759. alpha: {
  26760. type: "f",
  26761. value: 1
  26762. }
  26763. },
  26764. 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}",
  26765. 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}"
  26766. },
  26767. cube: {
  26768. uniforms: {
  26769. map: {
  26770. type: "t",
  26771. value: null
  26772. },
  26773. opacity: {
  26774. type: "f",
  26775. value: 1
  26776. }
  26777. },
  26778. vertexShader: o + "varying vec3 vWorldPosition;\n\nvoid main() {\n vWorldPosition = position;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}\n",
  26779. 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"
  26780. },
  26781. model: {
  26782. uniforms: {
  26783. map: {
  26784. type: "t",
  26785. value: null
  26786. },
  26787. modelAlpha: {
  26788. type: "f",
  26789. value: r.modelAlpha
  26790. },
  26791. opacity: {
  26792. type: "f",
  26793. value: 1
  26794. },
  26795. progress: {
  26796. type: "f",
  26797. value: 0
  26798. },
  26799. blackout: {
  26800. type: "i",
  26801. value: 0
  26802. },
  26803. pano0Map: {
  26804. type: "t",
  26805. value: null
  26806. },
  26807. pano0Position: {
  26808. type: "v3",
  26809. value: new n.Vector3
  26810. },
  26811. pano0Matrix: {
  26812. type: "m4",
  26813. value: new n.Matrix4
  26814. },
  26815. pano1Map: {
  26816. type: "t",
  26817. value: null
  26818. },
  26819. pano1Position: {
  26820. type: "v3",
  26821. value: new n.Vector3
  26822. },
  26823. pano1Matrix: {
  26824. type: "m4",
  26825. value: new n.Matrix4
  26826. }
  26827. },
  26828. vertexShader: o + `uniform vec3 pano0Position;
  26829. uniform mat4 pano0Matrix;\n\nuniform vec3 pano1Position;\n
  26830. uniform mat4 pano1Matrix;\n\nvarying vec2 vUv;\n
  26831. varying vec3 vWorldPosition0;
  26832. varying vec3 vWorldPosition1;
  26833. uniform int blackout;
  26834. void main() {
  26835. vUv = uv;
  26836. vec4 worldPosition = modelMatrix * vec4(position, 1.0);
  26837. vec3 positionLocalToPanoCenter0 = worldPosition.xyz - pano0Position;
  26838. vWorldPosition0 = (vec4(positionLocalToPanoCenter0, 1.0) * pano0Matrix).xyz;
  26839. vWorldPosition0.x *= -1.0;
  26840. vec3 positionLocalToPanoCenter1 = worldPosition.xyz - pano1Position;
  26841. vWorldPosition1 = (vec4(positionLocalToPanoCenter1, 1.0) * pano1Matrix).xyz;
  26842. vWorldPosition1.x *= -1.0;
  26843. gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
  26844. }`,
  26845. fragmentShader: a + `uniform sampler2D map;\nuniform float modelAlpha;\nuniform float opacity;\n
  26846. 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
  26847. void main() {
  26848. const vec4 BLACK = vec4(0.0, 0.0, 0.0, 1.0);
  26849. const vec4 GREY = vec4(0.5, 0.5, 0.5, 1.0);
  26850. vec4 colorFromPanos;
  26851. if (blackout == 5){
  26852. colorFromPanos = textureCube( pano1Map, vWorldPosition1.xyz) ;
  26853. }else{
  26854. vec4 colorFromPano0 = textureCube( pano0Map, vWorldPosition0.xyz);
  26855. vec4 colorFromPano1 = textureCube( pano1Map, vWorldPosition1.xyz);
  26856. if (blackout == 0) {colorFromPanos = mix(colorFromPano0, colorFromPano1, progress);}
  26857. else if (blackout == 1) {
  26858. colorFromPanos = mix(colorFromPano0, BLACK, min(1.0, progress*2.0));
  26859. colorFromPanos = mix(colorFromPanos, colorFromPano1, max(0.0, progress * 2.0 - 1.0));
  26860. }
  26861. else if (blackout == 2) {colorFromPanos = mix(colorFromPano0, BLACK, progress);}
  26862. else if (blackout == 3) {colorFromPanos = mix(BLACK, colorFromPano1, max(0.0, progress * 2.0 - 1.0));}
  26863. }
  26864. vec4 colorFromTexture = texture2D( map, vUv );
  26865. colorFromPanos = mix(colorFromPanos, colorFromTexture, modelAlpha);
  26866. float whiteness = 1.0 - smoothstep(0.1, 0.2, opacity);
  26867. colorFromPanos = mix(colorFromPanos, GREY, whiteness);
  26868. gl_FragColor = vec4(colorFromPanos.rgb, opacity);
  26869. }`
  26870. },
  26871. hot:{
  26872. uniforms:{
  26873. color:{
  26874. type: "c",
  26875. value: new n.Color( 0xff2200 )
  26876. },
  26877. opac:{
  26878. type: "f",
  26879. value: 0
  26880. },
  26881. texture1:{
  26882. type: "t",
  26883. value: null
  26884. },
  26885. texture2:{
  26886. type: "t",
  26887. value: null
  26888. }
  26889. },
  26890. vertexShader:"varying vec2 vUv;\n\nvoid main() {\n\n vUv = uv ;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n",
  26891. 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"
  26892. },
  26893. modelOutside: {
  26894. uniforms: {
  26895. map: {
  26896. type: "t",
  26897. value: null
  26898. },
  26899. opacity: {
  26900. type: "f",
  26901. value: 1
  26902. }
  26903. },
  26904. vertexShader: o + "varying vec2 vUv;\n\nvoid main() {\n\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n",
  26905. 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"
  26906. },
  26907. ribbon: {
  26908. uniforms: {
  26909. map: {
  26910. type: "t",
  26911. value: null
  26912. },
  26913. opacity: {
  26914. type: "f",
  26915. value: 1
  26916. },
  26917. color: {
  26918. type: "c",
  26919. value: new n.Color(r.path.color)
  26920. }
  26921. },
  26922. 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",
  26923. 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"
  26924. },
  26925. waypoint: {
  26926. uniforms: {
  26927. map: {
  26928. type: "t",
  26929. value: null
  26930. },
  26931. opacity: {
  26932. type: "f",
  26933. value: 1
  26934. },
  26935. pulse: {
  26936. type: "f",
  26937. value: 1
  26938. },
  26939. nearFade: {
  26940. type: "v2",
  26941. value: new n.Vector2(2 * r.insideNear,2 * r.path.waypointIndoorRadius)
  26942. },
  26943. color: {
  26944. type: "c",
  26945. value: new n.Color(r.reticuleColor)
  26946. }
  26947. },
  26948. 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",
  26949. 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"
  26950. },
  26951. modelDebug: {
  26952. uniforms: {
  26953. map: {
  26954. type: "t",
  26955. value: null
  26956. },
  26957. modelAlpha: {
  26958. type: "f",
  26959. value: r.modelAlpha
  26960. },
  26961. depthmapRatio: {
  26962. type: "f",
  26963. value: 0
  26964. },
  26965. opacity: {
  26966. type: "f",
  26967. value: 1
  26968. },
  26969. progress: {
  26970. type: "f",
  26971. value: 0
  26972. },
  26973. considerOcclusion: {
  26974. type: "i",
  26975. value: r.fancierTransition
  26976. },
  26977. highlightPanoSelection: {
  26978. type: "i",
  26979. value: 0
  26980. },
  26981. useThirdPano: {
  26982. type: "i",
  26983. value: r.useThirdPano
  26984. },
  26985. pano0Map: {
  26986. type: "t",
  26987. value: null
  26988. },
  26989. pano0Depth: {
  26990. type: "t",
  26991. value: null
  26992. },
  26993. pano0Position: {
  26994. type: "v3",
  26995. value: new n.Vector3
  26996. },
  26997. pano0Matrix: {
  26998. type: "m4",
  26999. value: new n.Matrix4
  27000. },
  27001. pano0Weight: {
  27002. type: "f",
  27003. value: r.transition.pano0Weight
  27004. },
  27005. pano1Map: {
  27006. type: "t",
  27007. value: null
  27008. },
  27009. pano1Depth: {
  27010. type: "t",
  27011. value: null
  27012. },
  27013. pano1Position: {
  27014. type: "v3",
  27015. value: new n.Vector3
  27016. },
  27017. pano1Matrix: {
  27018. type: "m4",
  27019. value: new n.Matrix4
  27020. },
  27021. pano1Weight: {
  27022. type: "f",
  27023. value: r.transition.pano1Weight
  27024. },
  27025. pano2Map: {
  27026. type: "t",
  27027. value: null
  27028. },
  27029. pano2Depth: {
  27030. type: "t",
  27031. value: null
  27032. },
  27033. pano2Position: {
  27034. type: "v3",
  27035. value: new n.Vector3
  27036. },
  27037. pano2Matrix: {
  27038. type: "m4",
  27039. value: new n.Matrix4
  27040. },
  27041. pano2Weight: {
  27042. type: "f",
  27043. value: r.transition.pano2Weight
  27044. }
  27045. },
  27046. 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",
  27047. 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"
  27048. },
  27049. customDepth: {
  27050. uniforms: {
  27051. panoPosition: {
  27052. type: "v3",
  27053. value: new n.Vector3
  27054. }
  27055. },
  27056. 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",
  27057. 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"
  27058. },
  27059. skysphere: {
  27060. uniforms: {
  27061. radius: {
  27062. type: "f",
  27063. value: 0
  27064. }
  27065. },
  27066. 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",
  27067. 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"
  27068. },
  27069. tagDisc: {
  27070. uniforms: {
  27071. opacity: {
  27072. type: "f",
  27073. value: 0
  27074. },
  27075. color: {
  27076. type: "c",
  27077. value: new n.Color
  27078. },
  27079. bg: {
  27080. type: "t",
  27081. value: null
  27082. },
  27083. mask: {
  27084. type: "t",
  27085. value: null
  27086. }
  27087. },
  27088. vertexShader: o + "varying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}",
  27089. 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"
  27090. }
  27091. }
  27092. }
  27093. , {
  27094. "./settings": 166,
  27095. three: 217
  27096. }],
  27097. 168: [function(e, t, i) {
  27098. (function(i) {
  27099. "use strict";
  27100. var n = e("three")
  27101. , r = (e("url"),
  27102. e("./util/ajax"))
  27103. , o = e("./settings")
  27104. , a = e("./util/logger")
  27105. , s = e("./util/math")
  27106. , l = e("./util/showcase")
  27107. , c = e("./objects/Panorama")
  27108. , h = new a(i)
  27109. , u = e("./model/Model")
  27110. , d = e("./shaders")
  27111. , p = e("./util/transitions")
  27112. , f = e("./objects/Chunk")
  27113. , g = e("./objects/Reticule")
  27114. , m = e("./objects/Skybox")
  27115. , v = e("./objects/Floor")
  27116. , A = e("./cameras/DollhouseCamera")
  27117. , y = e("./cameras/FloorplanCamera")
  27118. , C = e("./cameras/PanoramaCamera")
  27119. , I = e("./controls/DollhouseControls")
  27120. , E = e("./controls/FloorplanControls")
  27121. , b = e("./controls/PanoramaControls");
  27122. n.ImageUtils.crossOrigin = o.crossOrigin,
  27123. t.exports = {
  27124. shaders: d,
  27125. transitions: p,
  27126. Model: u,
  27127. Chunk: f,
  27128. Floor: v,
  27129. Skybox: m,
  27130. Reticule: g,
  27131. Panorama: c,
  27132. DollhouseCamera: A,
  27133. FloorplanCamera: y,
  27134. PanoramaCamera: C,
  27135. DollhouseControls: I,
  27136. FloorplanControls: E,
  27137. PanoramaControls: b,
  27138. getModel: function(e) {
  27139. if (!e.url)
  27140. throw 'getModel(): missing parameter "url"';
  27141. e.autoload = void 0 === e.autoload || e.autoload;
  27142. var t = l.parseSidUrl(e.url);
  27143. e.urlBase = t.urlBase,
  27144. e.urlModel = t.urlModel,
  27145. e.urlFiles = t.urlFiles;
  27146. var i = this._getPlatformError();
  27147. return i ? $.Deferred().reject(i).promise() : (this.options = e,
  27148. this._loadModel().then(this._buildModel.bind(this)))
  27149. },
  27150. _getPlatformError: function() {
  27151. 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"
  27152. },
  27153. _loadModel: function() {
  27154. return r.get(this.options.urlModel, {
  27155. responseType: "json",
  27156. prefetchFrom: "model",
  27157. auth: l.getAuthorizationHeader()
  27158. }).then(null, function() {
  27159. return h.warn("Model loading failed at initial metadata load"),
  27160. "loading-failed"
  27161. })
  27162. },
  27163. _buildModel: function(e) {
  27164. e = l.normalizeModeldata(e, s);
  27165. var t = new u(this.options,e);
  27166. return this.options.autoload ? t.load(!0) : $.when(t)
  27167. }
  27168. }
  27169. }
  27170. ).call(this, "/js/showcase.js")
  27171. }
  27172. , {
  27173. "./cameras/DollhouseCamera": 5,
  27174. "./cameras/FloorplanCamera": 6,
  27175. "./cameras/PanoramaCamera": 7,
  27176. "./controls/DollhouseControls": 10,
  27177. "./controls/FloorplanControls": 11,
  27178. "./controls/PanoramaControls": 13,
  27179. "./model/Model": 139,
  27180. "./objects/Chunk": 144,
  27181. "./objects/Floor": 146,
  27182. "./objects/Panorama": 148,
  27183. "./objects/Reticule": 149,
  27184. "./objects/Skybox": 152,
  27185. "./settings": 166,
  27186. "./shaders": 167,
  27187. "./util/ajax": 181,
  27188. "./util/logger": 189,
  27189. "./util/math": 190,
  27190. "./util/showcase": 193,
  27191. "./util/transitions": 195,
  27192. three: 217,
  27193. url: 208
  27194. }],
  27195. 169: [function(e, t, i) {
  27196. "use strict";
  27197. function n() {
  27198. var e = {
  27199. renderTarget: null,
  27200. inUse: !1,
  27201. size: -1,
  27202. pano: null
  27203. };
  27204. return e
  27205. }
  27206. function r(e) {
  27207. M.push(e)
  27208. }
  27209. function o(e) {
  27210. var t = n();
  27211. return t.inUse = !0,
  27212. t.size = e,
  27213. r(t),
  27214. t
  27215. }
  27216. function a(e) {
  27217. for (var t = 0; t < M.length; t++) {
  27218. var i = M[t];
  27219. if (!i.inUse && i.size === e)
  27220. return i.inUse = !0,
  27221. i
  27222. }
  27223. return null
  27224. }
  27225. function s(e) {
  27226. for (var t = 0; t < M.length; t++) {
  27227. var i = M[t];
  27228. if (i.renderTarget === e)
  27229. return i.inUse = !1,
  27230. !0
  27231. }
  27232. return !1
  27233. }
  27234. function l() {
  27235. this.tileDirectory = {},
  27236. this.activeRenderTargetDescriptors = {},
  27237. this.activePanos = [],
  27238. this.panoLODDescriptors = {},
  27239. this.panoDescriptors = {},
  27240. this.tileTrees = {},
  27241. this.sceneRenderer = null,
  27242. this.tileDownloader = null,
  27243. this.forceQueue = [],
  27244. this.uploadQueues = {},
  27245. this.uploadInterval = null,
  27246. this.uploadIntervalCancelled = !1,
  27247. this.usingTileOverlay = !1,
  27248. this.overlayTilesLoaded = !1,
  27249. this.overlayTileBase = null,
  27250. this.overlayTilesBasic = {},
  27251. this.overlayTilesEnhanced = {},
  27252. this.zoomRenderTarget = null,
  27253. this.zoomPano = null,
  27254. this.zoomingActive = !1,
  27255. this.zoomPanoId = null,
  27256. this.zoomPanoRenderingDisabled = !1,
  27257. this.direction = new h.Vector3,
  27258. this.initTime = -1,
  27259. this.maxBaseUploadsPerFrame = x,
  27260. this.maxNonBaseUploadsPerFrame = T
  27261. }
  27262. function c() {
  27263. this.uploadIntervalCancelled || (this.overlayTilesLoaded || !this.usingTileOverlay ? (b = !0,
  27264. this.updateUploadQueue(this.maxNonBaseUploadsPerFrame, this.maxBaseUploadsPerFrame),
  27265. this.peekNextFromUploadQueue() ? this.refreshUploadInterval(w) : this.uploadInterval = null) : this.refreshUploadInterval(this.uploadIntervalDelay))
  27266. }
  27267. var h = e("three")
  27268. , u = e("../exception/BasicException")
  27269. , d = e("../settings")
  27270. , p = e("../enum/PanoSizeClass")
  27271. , f = (e("../objects/Panorama"),
  27272. e("../enum/PanoRendererEvents"))
  27273. , g = e("../enum/SceneRendererEvents")
  27274. , m = e("../enum/TileDownloaderEvents")
  27275. , v = e("../enum/Vectors")
  27276. , A = (e("../enum/GLCubeFaces"),
  27277. e("../objects/Panorama"),
  27278. e("./TileTree"))
  27279. , y = (e("./TileDownloader"),
  27280. e("./TilePrioritizer"))
  27281. , C = e("./TileUtils")
  27282. , p = e("../enum/PanoSizeClass")
  27283. , I = (e("../util/browser"),
  27284. e("../util/panorama"))
  27285. , E = e("events").EventEmitter
  27286. , b = !1
  27287. , w = d.tiling.uploadIntervalDelay
  27288. , _ = d.tiling.initialIntervalDelay
  27289. , T = d.tiling.maxNonBaseUploadsPerFrame
  27290. , x = d.tiling.maxBaseUploadsPerFrame
  27291. , S = {
  27292. Base: 0,
  27293. Remaining: 1
  27294. }
  27295. , M = [];
  27296. l.prototype = Object.create(E.prototype),
  27297. l.prototype.init = function(e, t, i) {
  27298. this.sceneRenderer = e,
  27299. this.tileDownloader = t,
  27300. this.qualityManager = i,
  27301. this.bindEvents(),
  27302. this.sceneRenderer.on(g.ContextCreated, this.loadOverlayTiles.bind(this)),
  27303. this.initTime = performance.now()
  27304. }
  27305. ,
  27306. l.prototype.getActivePanoTextures = function(e) {
  27307. e = e || [];
  27308. for (var t = 0; t < M.length; t++) {
  27309. var i = M[t];
  27310. i.renderTarget && i.renderTarget.texture && e.push(i.renderTarget.texture)
  27311. }
  27312. }
  27313. ,
  27314. l.prototype.hasQueuedTiles = function() {
  27315. var e = this.peekNextFromUploadQueue();
  27316. return null !== e && void 0 !== e
  27317. }
  27318. ,
  27319. l.prototype.getActiveRenderTargetDescriptor = function(e) {
  27320. return this.activeRenderTargetDescriptors[e]
  27321. }
  27322. ,
  27323. l.prototype.setActiveRenderTargetDescriptor = function(e, t) {
  27324. this.activeRenderTargetDescriptors[e] = t
  27325. }
  27326. ,
  27327. l.prototype.loadOverlayTiles = function() {
  27328. if (0 !== d.tiling.overlayStyle) {
  27329. var e = 0
  27330. , t = function(t, n, r) {
  27331. t = n ? t[n] = this.sceneRenderer.initSizedTexture2D(C.TILE_SIZE, h.ClampToEdgeWrapping) : this.overlayTileBase = this.sceneRenderer.initSizedTexture2D(C.TILE_SIZE, h.ClampToEdgeWrapping),
  27332. this.sceneRenderer.uploadTexture2D(r, t, 0, 0, C.TILE_SIZE, C.TILE_SIZE),
  27333. e++,
  27334. e === i.length && (this.overlayTilesLoaded = !0)
  27335. }
  27336. .bind(this)
  27337. , 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)]];
  27338. i.forEach(function(e) {
  27339. this.tileDownloader.loadImage(e[0], 0, e[1])
  27340. }
  27341. .bind(this)),
  27342. this.usingTileOverlay = !0
  27343. } else
  27344. this.usingTileOverlay = !1
  27345. }
  27346. ,
  27347. l.prototype.bindEvents = function() {
  27348. this.tileDownloader.on(m.TileDownloadSuccess, this.onTileDownloaded.bind(this))
  27349. }
  27350. ,
  27351. l.prototype.setupZoomRenderTarget = function() {
  27352. if (this.qualityManager.getMaxZoomPanoSize() >= this.qualityManager.getMaxNavPanoSize()) {
  27353. if (this.zoomRenderTarget && this.zoomRenderTarget.width === this.qualityManager.getMaxZoomPanoSize())
  27354. return;
  27355. var e = this.zoomRenderTarget;
  27356. if (this.zoomRenderTarget = this.initTiledPano(this.qualityManager.getMaxZoomPanoSize(), !1),
  27357. e) {
  27358. var t = e.width
  27359. , i = this.zoomRenderTarget.width;
  27360. this.sceneRenderer.copyCubeMap(e.texture, this.zoomRenderTarget, t, t, i, i),
  27361. e.texture.dispose(),
  27362. e.texture.loaded = !1,
  27363. e.texture.version = 0,
  27364. this.sceneRenderer.deallocateCubeTexture(e.texture),
  27365. e.texture = null
  27366. }
  27367. this.zoomPanoRenderingDisabled = !1
  27368. } else
  27369. this.zoomPanoRenderingDisabled = !0
  27370. }
  27371. ,
  27372. l.prototype.enableUltraHighQualityMode = function(e) {
  27373. if (!this.qualityManager.ultraHighQualityModeEnabled()) {
  27374. var t = this.qualityManager.getPanoSize(p.ULTRAHIGH);
  27375. this.tileDownloader.testDownload(t, C.TILE_SIZE, function(t) {
  27376. t && (this.qualityManager.enableUltraHighQualityMode(),
  27377. this.setupZoomRenderTarget(),
  27378. e())
  27379. }
  27380. .bind(this))
  27381. }
  27382. }
  27383. ,
  27384. l.prototype.activateTiledPano = function(e, t, i) {
  27385. i && this.clearAllQueuedUploads();
  27386. for (var n = 0; n < C.FACES_PER_PANO; n++)
  27387. this.initTileTree(e.id, n, this.qualityManager.getMaxPossiblePanoSize());
  27388. this.linkAllTilesAndNodes(e);
  27389. var r = this.getActiveRenderTargetDescriptor(e.id)
  27390. , l = t;
  27391. if (l > this.qualityManager.getMaxNavPanoSize() && (l = this.qualityManager.getMaxNavPanoSize()),
  27392. !r || l !== r.size) {
  27393. if (r && s(r.renderTarget),
  27394. r = a(l),
  27395. !r) {
  27396. var c = this.initTiledPano(l, !1);
  27397. r = o(c.width),
  27398. r.renderTarget = c
  27399. }
  27400. r.pano = e,
  27401. this.resetPanoDescriptor(e.id),
  27402. this.resetPanoLODDescriptors(e.id),
  27403. this.resetRenderStatus(e.id, !0, !0)
  27404. }
  27405. this.setActiveRenderTargetDescriptor(e.id, r);
  27406. var h = i ? 0 : 1;
  27407. return this.updateActivePanos(e, h),
  27408. r.renderTarget
  27409. }
  27410. ,
  27411. l.prototype.deactivateTiledPano = function(e) {
  27412. var t = this.getActiveRenderTargetDescriptor(e.id);
  27413. this.isRenderTargetDescriptorValid(t) && s(t.renderTarget),
  27414. this.setActiveRenderTargetDescriptor(e.id, null);
  27415. var i = this.getUploadQueueForPano(e.id);
  27416. this.clearUploadQueue(i),
  27417. this.updateActivePanos()
  27418. }
  27419. ,
  27420. l.prototype.updateActivePanos = function() {
  27421. var e = [];
  27422. return function(t, i) {
  27423. e.length = 0;
  27424. for (var n = 0; n < this.activePanos.length; n++) {
  27425. t && e.length === i && e.push(t);
  27426. var r = this.activePanos[n]
  27427. , o = this.getActiveRenderTargetDescriptor(r.id);
  27428. t && r.id === t.id || !this.isRenderTargetDescriptorValid(o) || e.push(r)
  27429. }
  27430. t && i >= e.length && e.push(t),
  27431. this.activePanos.length = 0,
  27432. this.activePanos.push.apply(this.activePanos, e)
  27433. }
  27434. }(),
  27435. l.prototype.getActivePanoCount = function() {
  27436. return this.activePanos.length
  27437. }
  27438. ,
  27439. l.prototype.resetRenderStatus = function(e, t, i, n) {
  27440. var r = null;
  27441. n && (r = A.getLevelCountForSize(C.TILE_SIZE, n) + 1);
  27442. for (var o = function(e, n, r, o) {
  27443. i && (n.tile.zoomUploaded = !1),
  27444. t && (n.tile.uploaded = !1)
  27445. }, a = 0; a < C.FACES_PER_PANO; a++) {
  27446. var s = this.getTileTree(e, a);
  27447. s.breadthFirst({
  27448. callback: o.bind(this, a),
  27449. minLevel: r
  27450. })
  27451. }
  27452. }
  27453. ,
  27454. l.prototype.copyBaseRenderStatusToZoomed = function(e) {
  27455. for (var t = A.getLevelCountForSize(C.TILE_SIZE, this.qualityManager.getMaxNavPanoSize()), i = function(e, t, i, n) {
  27456. t.tile.zoomUploaded = t.tile.uploaded,
  27457. t.zoomCovered = t.covered
  27458. }, n = 0; n < C.FACES_PER_PANO; n++) {
  27459. var r = this.getTileTree(e, n);
  27460. r.breadthFirst({
  27461. callback: i.bind(this, n),
  27462. maxLevel: t
  27463. })
  27464. }
  27465. }
  27466. ,
  27467. l.prototype.renderPanoTiles = function() {
  27468. var e = [];
  27469. return function(t, i, n, r) {
  27470. this.zoomRenderTarget && this.zoomRenderTarget.width === this.qualityManager.getMaxZoomPanoSize() || this.zoomPanoRenderingDisabled || this.setupZoomRenderTarget(),
  27471. i = i || this.direction || v.FORWARD;
  27472. var o = this.getActiveRenderTargetDescriptor(t);
  27473. if (!this.isRenderTargetDescriptorValid(o))
  27474. throw new u("PanoRenderer.renderPanoTiles() -> Cannot render to a pano that is not activated.");
  27475. for (var a = 0; a < C.FACES_PER_PANO; a++) {
  27476. var s = this.getTileTree(t, a);
  27477. e.length = 0,
  27478. s.breadthFirst({
  27479. saveVisited: e
  27480. });
  27481. for (var l = 0; l < e.length; l++) {
  27482. var c = e[l];
  27483. this.queueTileUpload(c.tile, !1, r || 0 === l && n)
  27484. }
  27485. }
  27486. this.updateDirection(i)
  27487. }
  27488. }(),
  27489. l.prototype.isRenderTargetDescriptorValid = function(e) {
  27490. return e && e.renderTarget
  27491. }
  27492. ,
  27493. l.prototype.isPanoActive = function(e) {
  27494. var t = this.getActiveRenderTargetDescriptor(e);
  27495. return this.isRenderTargetDescriptorValid(t)
  27496. }
  27497. ,
  27498. l.prototype.isPanoZoomed = function(e) {
  27499. return this.zoomingActive && this.zoomPanoId === e
  27500. }
  27501. ,
  27502. l.prototype.initTileTree = function(e, t, i) {
  27503. var n = this.tileTrees[e];
  27504. n || (n = [],
  27505. this.tileTrees[e] = n);
  27506. var r = n[t];
  27507. if (!r) {
  27508. var o = A.getLevelCountForSize(C.TILE_SIZE, i);
  27509. r = new A(C.TILE_SIZE,o),
  27510. n[t] = r
  27511. }
  27512. }
  27513. ,
  27514. l.prototype.getTileTree = function(e, t) {
  27515. var i = this.tileTrees[e];
  27516. if (!i)
  27517. throw new u("PanoRenderer.getTileTree() -> Tree array not yet initialized!");
  27518. var n = i[t];
  27519. if (!n)
  27520. throw new u("PanoRenderer.getTileTree() -> Tree not yet initialized!");
  27521. return n
  27522. }
  27523. ,
  27524. l.prototype.initTiledPano = function(e, t) {
  27525. var i = this.sceneRenderer.renderer
  27526. , n = (i.context,
  27527. new h.WebGLRenderTargetCube(e,e,{
  27528. stencilBuffer: !1
  27529. }))
  27530. , r = new h.CubeTexture([]);
  27531. n.texture = r,
  27532. r.image = [null, null, null, null, null, null],
  27533. r.flipY = !0,
  27534. t ? (r.generateMipmaps = !0,
  27535. r.magFilter = h.LinearFilter,
  27536. r.minFilter = h.LinearMipMapLinearFilter) : (r.generateMipmaps = !1,
  27537. r.magFilter = h.LinearFilter,
  27538. r.minFilter = h.LinearFilter),
  27539. r.format = h.RGBAFormat,
  27540. i.setRenderTarget(n),
  27541. i.setRenderTarget(null);
  27542. var o = i.properties.get(r);
  27543. return o.__image__webglTextureCube = o.__webglTexture,
  27544. n
  27545. }
  27546. ,
  27547. l.prototype.getUploadQueueForPano = function(e) {
  27548. var t = this.uploadQueues[e];
  27549. return t || (t = [],
  27550. this.uploadQueues[e] = t),
  27551. t
  27552. }
  27553. ,
  27554. l.prototype.isTileUploaded = function(e) {
  27555. return this.isPanoZoomed(e.panoId) ? e.zoomUploaded : e.uploaded
  27556. }
  27557. ,
  27558. l.prototype.setUploaded = function(e, t) {
  27559. this.isPanoZoomed(e.panoId) ? e.zoomUploaded = t : e.uploaded = t
  27560. }
  27561. ,
  27562. l.prototype.queueTileUpload = function(e, t, i) {
  27563. var n = this.getActiveRenderTargetDescriptor(e.panoId);
  27564. if (this.isRenderTargetDescriptorValid(n) && e.downloaded && !this.isTileUploaded(e) && (!e.uploadQueued || i) && (!(e.panoSize > this.qualityManager.getMaxNavPanoSize()) || this.zoomingActive)) {
  27565. var r = this.getUploadQueueForPano(e.panoId);
  27566. 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),
  27567. e.uploadQueued = !0,
  27568. this.uploadInterval || this.uploadIntervalCancelled || this.refreshUploadInterval(0))
  27569. }
  27570. }
  27571. ,
  27572. l.prototype.shoulPushToFrontOfQueue = function(e) {
  27573. return 0 === A.getLevelCountForSize(C.TILE_SIZE, e.panoSize)
  27574. }
  27575. ,
  27576. l.prototype.getTopUploadQueue = function() {
  27577. for (var e = null, t = null, i = S.Base; i <= S.Remaining; i++)
  27578. for (var n = 0; n < this.activePanos.length; n++)
  27579. if (e = this.activePanos[n],
  27580. t = this.getUploadQueueForPano(e.id),
  27581. t.length > 0)
  27582. switch (i) {
  27583. case S.Base:
  27584. if (0 === t[0].level)
  27585. return t;
  27586. break;
  27587. case S.Remaining:
  27588. return t
  27589. }
  27590. return null
  27591. }
  27592. ,
  27593. l.prototype.getNextFromUploadQueue = function() {
  27594. var e = function(e) {
  27595. var t = e.shift();
  27596. return t.uploadQueued = !1,
  27597. t
  27598. };
  27599. return function() {
  27600. if (this.forceQueue.length > 0)
  27601. return e(this.forceQueue);
  27602. var t = this.getTopUploadQueue();
  27603. return t && t.length > 0 ? e(t) : null
  27604. }
  27605. }(),
  27606. l.prototype.peekNextFromUploadQueue = function() {
  27607. if (this.forceQueue.length > 0)
  27608. return this.forceQueue[0];
  27609. var e = this.getTopUploadQueue();
  27610. return e && e.length > 0 ? e[0] : null
  27611. }
  27612. ,
  27613. l.prototype.clearAllQueuedUploads = function() {
  27614. this.clearAllUploadQueues(null, 0)
  27615. }
  27616. ,
  27617. l.prototype.clearAllQueuedUploadsForPano = function(e) {
  27618. this.clearAllUploadQueues(e, 0)
  27619. }
  27620. ,
  27621. l.prototype.clearAllUploadQueues = function(e, t) {
  27622. if (e)
  27623. this.clearUploadQueue(this.getUploadQueueForPano(e), t),
  27624. this.clearUploadQueue(this.forceQueue, t, e);
  27625. else {
  27626. for (var i = 0; i < this.activePanos.length; i++) {
  27627. var n = this.activePanos[i];
  27628. this.clearUploadQueue(this.getUploadQueueForPano(n.id), t)
  27629. }
  27630. this.clearUploadQueue(this.forceQueue, t)
  27631. }
  27632. }
  27633. ,
  27634. l.prototype.clearUploadQueue = function(e, t, i) {
  27635. void 0 !== t && null !== t || (t = 0);
  27636. for (var n = 0; n < e.length; ) {
  27637. var r = e[n];
  27638. (!i || i && i === r.tile.panoId) && r.level >= t ? (r.uploadQueued = !1,
  27639. e.splice(n, 1)) : n++
  27640. }
  27641. }
  27642. ,
  27643. l.prototype.refreshUploadInterval = function() {
  27644. var e = null;
  27645. return function(t) {
  27646. this.uploadIntervalCancelled || (e || (e = c.bind(this)),
  27647. null !== t && void 0 !== t || (t = w),
  27648. b || (t = _),
  27649. this.uploadInterval = window.setTimeout(e, t),
  27650. this.uploadIntervalDelay = t)
  27651. }
  27652. }(),
  27653. l.prototype.update = function() {
  27654. var e = performance.now()
  27655. , t = 0;
  27656. return function() {
  27657. this.uploadIntervalCancelled = !0,
  27658. window.clearTimeout(this.uploadInterval),
  27659. this.uploadInterval = null;
  27660. var i = performance.now() - e;
  27661. !(i > w || 0 === t) || !this.overlayTilesLoaded && this.usingTileOverlay || (this.updateUploadQueue(this.maxNonBaseUploadsPerFrame, this.maxBaseUploadsPerFrame),
  27662. e = performance.now()),
  27663. t++
  27664. }
  27665. }(),
  27666. l.prototype.updateUploadQueue = function(e, t) {
  27667. e || (e = 1);
  27668. for (var i = 0, n = 0; ; ) {
  27669. if (n >= t || i >= e)
  27670. break;
  27671. var r = this.getNextFromUploadQueue();
  27672. if (!r)
  27673. break;
  27674. if (0 !== r.level ? i++ : n++,
  27675. !(r.panoSize > this.qualityManager.getMaxNavPanoSize()) || this.zoomingActive) {
  27676. var o = this.getActiveRenderTargetDescriptor(r.panoId);
  27677. this.isRenderTargetDescriptorValid(o) && this.uploadTile(r, r.forceUpload)
  27678. }
  27679. }
  27680. }
  27681. ,
  27682. l.prototype.updateDirection = function(e) {
  27683. if (e = e || this.direction) {
  27684. this.direction = e;
  27685. for (var t = 0; t < this.activePanos.length; t++) {
  27686. var i = this.activePanos[t]
  27687. , n = this.getUploadQueueForPano(i.id);
  27688. y.sortPanoTiles(n, i, this.direction)
  27689. }
  27690. }
  27691. }
  27692. ,
  27693. l.prototype.uploadTile = function() {
  27694. var e = {}
  27695. , t = (new h.Vector4,
  27696. d.tiling.overlayStyle);
  27697. return function(i, n) {
  27698. var r = i.panoId
  27699. , o = i.image
  27700. , a = i.tileSize
  27701. , s = i.panoSize
  27702. , l = i.tileIndex
  27703. , c = (i.faceTileIndex,
  27704. i.totalTiles)
  27705. , u = (i.face,
  27706. i.tileX)
  27707. , d = i.tileY
  27708. , p = !0
  27709. , g = !1
  27710. , m = (this.getPanoDescriptor(r),
  27711. this.getPanoLODDescriptor(r, s))
  27712. , v = this.getActiveRenderTargetDescriptor(r)
  27713. , A = v.renderTarget
  27714. , y = v.size;
  27715. if (this.isPanoZoomed(r) && (A = this.zoomRenderTarget,
  27716. y = this.qualityManager.getMaxZoomPanoSize()),
  27717. this.isRenderTargetDescriptorValid(v) || (p = !1,
  27718. g = !1),
  27719. n || (this.anyUploaded(i.node) && (p = !1,
  27720. g = !0),
  27721. this.isTileUploaded(i) && (p = !1,
  27722. g = !1)),
  27723. p) {
  27724. var C = u * a
  27725. , I = d * a
  27726. , E = a / s * y
  27727. , b = C / s * y
  27728. , w = I / s * y;
  27729. e[a] || (e[a] = this.sceneRenderer.initSizedTexture2D(a, h.ClampToEdgeWrapping));
  27730. var _ = e[a];
  27731. if (this.sceneRenderer.uploadTexture2D(o, _, 0, 0, a, a),
  27732. 1 === t || 2 === t) {
  27733. var T = 1 === t ? this.overlayTilesBasic : this.overlayTilesEnhanced;
  27734. this.sceneRenderer.renderToCubeMap(_, A, a, a, 0, 0, a, a, b, w, E, E, i.cubeFace),
  27735. this.sceneRenderer.renderToCubeMap(T[s], A, a, a, 0, 0, a, a, b, w, E, E, i.cubeFace, h.NormalBlending, !0, .5)
  27736. } else
  27737. this.sceneRenderer.renderToCubeMap(_, A, a, a, 0, 0, a, a, b, w, E, E, i.cubeFace);
  27738. m.uploadCount++,
  27739. this.emit(f.TileRenderSuccess, r, s, l, c),
  27740. m.uploadCount === c && this.emit(f.PanoRenderComplete, r, s, c),
  27741. this.setUploaded(i, !0),
  27742. this.addCoverageForNode(i.node)
  27743. } else
  27744. this.setUploaded(i, !1);
  27745. return i.uploadAttempted || (m.uploadAttempts++,
  27746. this.emit(f.TileUploadAttempted, r, s, l, c)),
  27747. i.uploadAttempted = !0,
  27748. m.uploadAttempts === c && this.emit(f.UploadAttemptedForAllTiles, r, s, c),
  27749. g
  27750. }
  27751. }(),
  27752. l.prototype.linkTileAndNode = function(e, t) {
  27753. t.tile = e,
  27754. e.node = t
  27755. }
  27756. ,
  27757. l.prototype.linkAllTilesAndNodes = function(e) {
  27758. for (var t = function(t, i, n, r, o) {
  27759. var a = this.getTileDirectoryEntry(e.id, i, r, o);
  27760. this.linkTileAndNode(a, n)
  27761. }, i = 0; i < C.FACES_PER_PANO; i++) {
  27762. var n = this.getTileTree(e.id, i);
  27763. n.breadthFirst({
  27764. callback: t.bind(this, n, i)
  27765. })
  27766. }
  27767. }
  27768. ,
  27769. l.prototype.anyUploaded = function(e) {
  27770. if (!e)
  27771. return !1;
  27772. if (e.tile && this.isTileUploaded(e.tile))
  27773. return !0;
  27774. if (e.children)
  27775. for (var t = 0; t < e.children.length; t++) {
  27776. var i = e.children[t];
  27777. if (this.anyUploaded(i))
  27778. return !0
  27779. }
  27780. return !1
  27781. }
  27782. ,
  27783. l.prototype.setNodeCovered = function(e, t) {
  27784. this.isPanoZoomed(e.tile.panoId) ? e.zoomCovered = t : e.covered = t
  27785. }
  27786. ,
  27787. l.prototype.isNodeCovered = function(e) {
  27788. return !!e && (this.isPanoZoomed(e.tile.panoId) ? e.zoomCovered : e.covered)
  27789. }
  27790. ,
  27791. l.prototype.addCoverageForNode = function(e) {
  27792. if (this.setNodeCovered(e, !0),
  27793. e.parent && e.covered) {
  27794. var t = e.parent;
  27795. this.nodeSubcovered(t) && this.addCoverageForNode(t, !0)
  27796. }
  27797. }
  27798. ,
  27799. l.prototype.calcFullCoverage = function(e) {
  27800. var t = !1;
  27801. if (e.children)
  27802. for (var i = 0; i < e.children.length; i++) {
  27803. var n = e.children[i];
  27804. t = t || this.calcFullCoverage(n)
  27805. }
  27806. e.covered = e.tile.uploaded || t
  27807. }
  27808. ,
  27809. l.prototype.nodeSubcovered = function(e) {
  27810. if (!e.children)
  27811. return !1;
  27812. for (var t = 0; t < e.children.length; t++)
  27813. if (!e.children[t] || !this.isNodeCovered(e.children[t]))
  27814. return !1;
  27815. return !0
  27816. }
  27817. ,
  27818. l.prototype.resetPanoDescriptor = function(e) {
  27819. this.getPanoDescriptor(e)
  27820. }
  27821. ,
  27822. l.prototype.getPanoDescriptor = function(e) {
  27823. var t = this.panoDescriptors[e];
  27824. return t || (t = {},
  27825. this.panoDescriptors[e] = t),
  27826. t
  27827. }
  27828. ,
  27829. l.prototype.resetPanoLODDescriptors = function(e) {
  27830. var t = this.getPanoLODDescriptors(e);
  27831. for (var i in t)
  27832. if (t.hasOwnProperty(i)) {
  27833. var n = t[i];
  27834. n.uploadCount = 0,
  27835. n.uploadAttempts = 0
  27836. }
  27837. }
  27838. ,
  27839. l.prototype.getPanoLODDescriptor = function(e, t) {
  27840. var i = this.getPanoLODDescriptors(e)
  27841. , n = i[t];
  27842. return n || (n = {
  27843. uploadCount: 0,
  27844. uploadAttempts: 0
  27845. },
  27846. i[t] = n),
  27847. n
  27848. }
  27849. ,
  27850. l.prototype.getPanoLODDescriptors = function(e) {
  27851. var t = this.panoLODDescriptors[e];
  27852. return t || (t = {},
  27853. this.panoLODDescriptors[e] = t),
  27854. t
  27855. }
  27856. ,
  27857. l.prototype.onTileDownloaded = function(e) {
  27858. var t = A.getLevelCountForSize(C.TILE_SIZE, e.panoSize)
  27859. , i = this.getTileDirectoryEntry(e.panoId, e.face, t, e.faceTileIndex);
  27860. if (i.downloaded = !0,
  27861. i.image = e.image,
  27862. i.panoSize = e.panoSize,
  27863. i.tileX = e.tileX,
  27864. i.tileY = e.tileY,
  27865. i.totalTiles = e.totalTiles,
  27866. i.tileIndex = e.tileIndex,
  27867. i.faceTileIndex = e.faceTileIndex,
  27868. i.face = e.face,
  27869. i.cubeFace = I.mapFaceToCubemapFace(e.face),
  27870. i.panoId = e.panoId,
  27871. i.tileSize = e.tileSize,
  27872. i.direction = (new h.Vector3).copy(e.direction),
  27873. i.node = null,
  27874. i.level = A.getLevelCountForSize(C.TILE_SIZE, i.panoSize),
  27875. this.isPanoActive(i.panoId)) {
  27876. var n = this.getTileTree(i.panoId, i.face)
  27877. , r = n.getSubNode(i.panoSize, i.tileX, i.tileY);
  27878. this.linkTileAndNode(i, r),
  27879. this.queueTileUpload(i, !0)
  27880. }
  27881. }
  27882. ,
  27883. l.prototype.getTileDirectoryEntry = function(e, t, i, n) {
  27884. var r = this.tileDirectory[e];
  27885. r || (r = {},
  27886. this.tileDirectory[e] = r);
  27887. var o = 16384 * t + 1024 * i + n
  27888. , a = r[o];
  27889. return a || (a = {
  27890. downloaded: !1,
  27891. uploaded: !1,
  27892. zoomUploaded: !1
  27893. },
  27894. r[o] = a),
  27895. a._key = e + ":" + t + ":" + i + ":" + n,
  27896. a._tileKey = o,
  27897. a
  27898. }
  27899. ,
  27900. l.prototype.setZoomingActive = function(e, t, i) {
  27901. this.zoomPanoRenderingDisabled || e === this.zoomingActive && this.zoomPanoId === t.id || (this.zoomingActive = e,
  27902. this.zoomPanoId = t.id,
  27903. this.zoomingActive && (this.zoomPanoId !== t.id || i) && this.updateZoomedPanoFromBase(t))
  27904. }
  27905. ,
  27906. l.prototype.updateZoomedPanoFromBase = function(e) {
  27907. if (!this.zoomPanoRenderingDisabled) {
  27908. var t = this.getActiveRenderTargetDescriptor(e.id);
  27909. if (t && t.renderTarget) {
  27910. var i = this.qualityManager.getMaxZoomPanoSize()
  27911. , n = t.renderTarget
  27912. , r = t.size;
  27913. this.sceneRenderer.copyCubeMap(n.texture, this.zoomRenderTarget, r, r, i, i),
  27914. this.copyBaseRenderStatusToZoomed(e.id)
  27915. }
  27916. }
  27917. }
  27918. ,
  27919. t.exports = l
  27920. }
  27921. , {
  27922. "../enum/GLCubeFaces": 25,
  27923. "../enum/PanoRendererEvents": 35,
  27924. "../enum/PanoSizeClass": 36,
  27925. "../enum/SceneRendererEvents": 43,
  27926. "../enum/TileDownloaderEvents": 45,
  27927. "../enum/Vectors": 50,
  27928. "../exception/BasicException": 55,
  27929. "../objects/Panorama": 148,
  27930. "../settings": 166,
  27931. "../util/browser": 182,
  27932. "../util/panorama": 191,
  27933. "./TileDownloader": 171,
  27934. "./TilePrioritizer": 172,
  27935. "./TileTree": 173,
  27936. "./TileUtils": 174,
  27937. events: 202,
  27938. three: 217
  27939. }],
  27940. 170: [function(e, t, i) {
  27941. "use strict";
  27942. function n(e, t, i) {
  27943. this.maxNavPanoSize = -1,
  27944. this.maxZoomPanoSize = -1,
  27945. this.devicePixelDensity = e,
  27946. this.deviceScreenSize = t,
  27947. this.clientBandwidth = i,
  27948. this.panoSizeClassMap = {},
  27949. this.useHighResolutionPanos = !0,
  27950. this.useUltraHighResolutionPanos = !1,
  27951. this.modelHasUltraHighPanos = !1
  27952. }
  27953. var r = e("../enum/PanoSizeClass")
  27954. , o = e("../settings")
  27955. , a = e("../util/browser")
  27956. , s = e("../constants")
  27957. , l = e("../util/showcase")
  27958. , c = e("../enum/ModelManagerEvents");
  27959. n.prototype.init = function(e) {
  27960. this.buildPanoSizeClassMap(this.devicePixelDensity, this.deviceScreenSize, this.clientBandwidth),
  27961. this.ultraHighSize = this.getPanoSize(r.ULTRAHIGH),
  27962. this.highSize = this.getPanoSize(r.HIGH),
  27963. this.standardSize = this.getPanoSize(r.STANDARD),
  27964. this.baseSize = this.getPanoSize(r.BASE),
  27965. o.tiling.maxZoomPanoQuality && this.ultraHighSize <= o.tiling.maxZoomPanoQuality && (o.tiling.allowUltraHighResolution = !0),
  27966. this.highQualityThreshold = a.valueFromHash("threshold2k", s.windowHeightHighQualityThreshold),
  27967. this.updateMaximums(),
  27968. e.on(c.ActiveModelChanged, this.onModelChanged.bind(this))
  27969. }
  27970. ,
  27971. n.prototype.updateFromModel = function(e) {
  27972. this.updateHighResolutionSettings(e),
  27973. this.updateUltraHighResolutionSettings(e)
  27974. }
  27975. ,
  27976. n.prototype.updateHighResolutionSettings = function(e) {
  27977. //---------------------许钟文---------原始的会判断modeldata里version,以致useHighResolutionPanos为false,所以我直接变为true啦----------------------------------
  27978. l.modelDataPromisesTiles(e.data) ? this.useHighResolutionPanos = !0 : this.useHighResolutionPanos = !1,
  27979. //this.useHighResolutionPanos = !0;
  27980. //----------------------e n d -----------------------------------------------------------------
  27981. this.updateMaximums()
  27982. }
  27983. ,
  27984. n.prototype.updateUltraHighResolutionSettings = function(e) {
  27985. o.tiling.allowUltraHighResolution && this.modelHasUltraHighPanos ? this.useUltraHighResolutionPanos = !0 : this.useUltraHighResolutionPanos = !1,
  27986. this.updateMaximums()
  27987. }
  27988. ,
  27989. n.prototype.enableUltraHighQualityMode = function() {
  27990. this.modelHasUltraHighPanos = !0,
  27991. this.updateUltraHighResolutionSettings(null)
  27992. }
  27993. ,
  27994. n.prototype.ultraHighQualityModeEnabled = function() {
  27995. return this.modelHasUltraHighPanos
  27996. }
  27997. ,
  27998. n.prototype.onModelChanged = function(e) {
  27999. this.updateFromModel(e.model),
  28000. this.updateMaximums()
  28001. }
  28002. ,
  28003. n.prototype.updateMaximums = function() {
  28004. this.maxNavPanoSize = o.tiling.maxNavPanoQuality || this.detectMaxNavPanoSize(),
  28005. this.maxZoomPanoSize = o.tiling.maxZoomPanoQuality || this.detectMaxZoomPanoSize(),
  28006. this.maxZoomPanoSize < this.maxNavPanoSize && (this.maxNavPanoSize = this.maxZoomPanoSize)
  28007. }
  28008. ,
  28009. n.prototype.buildPanoSizeClassMap = function() {
  28010. this.panoSizeClassMap[r.BASE] = 512,
  28011. this.panoSizeClassMap[r.STANDARD] = 1024,
  28012. this.panoSizeClassMap[r.HIGH] = 2048,
  28013. this.panoSizeClassMap[r.ULTRAHIGH] = 4096
  28014. }
  28015. ,
  28016. n.prototype.getPanoSize = function(e) {
  28017. return this.panoSizeClassMap[e]
  28018. }
  28019. ,
  28020. n.prototype.getMaxPossiblePanoSize = function() {
  28021. return this.getPanoSize(r.ULTRAHIGH)
  28022. }
  28023. ,
  28024. n.prototype.getMaxPanoSize = function() {
  28025. return this.maxZoomPanoSize
  28026. }
  28027. ,
  28028. n.prototype.getMaxNavPanoSize = function() {
  28029. return this.maxNavPanoSize
  28030. }
  28031. ,
  28032. n.prototype.getMaxZoomPanoSize = function() {
  28033. return this.maxZoomPanoSize
  28034. }
  28035. ,
  28036. n.prototype.detectMaxNavPanoSizeClass = function() {
  28037. if(settings.mobileNavHigh)return r.HIGH //改
  28038. else return this.useHighResolutionPanos ? a.isMobile() ? r.STANDARD : $("#player").height() < this.highQualityThreshold ? r.STANDARD : r.HIGH : r.STANDARD
  28039. }
  28040. ,
  28041. n.prototype.detectMaxNavPanoSize = function() {
  28042. var e = this.detectMaxNavPanoSizeClass();
  28043. return this.getPanoSize(e)
  28044. }
  28045. ,
  28046. n.prototype.detectMaxZoomPanoSize = function() {
  28047. 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)
  28048. }
  28049. ,
  28050. t.exports = n
  28051. }
  28052. , {
  28053. "../constants": 8,
  28054. "../enum/ModelManagerEvents": 33,
  28055. "../enum/PanoSizeClass": 36,
  28056. "../settings": 166,
  28057. "../util/browser": 182,
  28058. "../util/showcase": 193
  28059. }],
  28060. 171: [function(e, t, i) {
  28061. (function(i) {
  28062. "use strict";
  28063. function n(e) {
  28064. this.panos = null,
  28065. this.retryMinimumTime = 1e4,
  28066. this.urls = null,
  28067. this.panoLoadCallbacks = {},
  28068. this.downloadDescriptors = {},
  28069. this.priorityQueue = [],
  28070. this.forceQueue = [],
  28071. this.activeDownloads = [],
  28072. this.qualityManager = null,
  28073. this.tilePrioritizer = null,
  28074. this.refreshInterval = null,
  28075. this.processPriorityQueue = !1,
  28076. this.concurrentDownloads = e.concurrentDownloads || 1,
  28077. this.downloadTestResults = {}
  28078. }
  28079. var r = e("three")
  28080. , o = (e("../enum/Viewmode"),
  28081. e("../settings"))
  28082. , a = (e("../objects/Panorama"),
  28083. e("../util/logger"))
  28084. , s = (e("../enum/Vectors"),
  28085. e("../enum/PanoSizeClass"),
  28086. e("../enum/TileDownloaderEvents"))
  28087. , l = e("./TilePrioritizer")
  28088. , c = e("./TileUtils")
  28089. , h = (e("../enum/GLCubeFaces"),
  28090. e("../enum/DownloadStatus"))
  28091. , u = e("../util/panorama")
  28092. , d = e("../util/ajax")
  28093. , p = e("../ab")
  28094. , f = e("events").EventEmitter
  28095. , g = (new a(i),
  28096. Object.freeze({
  28097. Testing: 1,
  28098. Success: 2,
  28099. Fail: 3
  28100. }));
  28101. n.prototype = Object.create(f.prototype),
  28102. n.IDLE_REFRESH_DELAY = 500,
  28103. n.ACTIVE_REFRESH_DELAY = 16,
  28104. n.DOWNLOAD_RETRIES = 4,
  28105. n.prototype.init = function(e) {
  28106. this.qualityManager = e
  28107. }
  28108. ,
  28109. n.prototype.setUrls = function(e) {
  28110. this.urls = e
  28111. }
  28112. ,
  28113. n.prototype.setPanoData = function(e, t, i) {
  28114. this.panos = e,
  28115. this.imagePanos = t,
  28116. this.panoGroupId = i
  28117. }
  28118. ,
  28119. n.prototype.start = function() {
  28120. this.refreshUpdateInterval(0)
  28121. }
  28122. ,
  28123. n.prototype.stop = function() {
  28124. window.cancel(this.refreshInterval)
  28125. }
  28126. ,
  28127. n.prototype.refreshUpdateInterval = function(e) {
  28128. e || (e = 0),
  28129. this.refreshInterval = window.setTimeout(function() {
  28130. var e = this.update();
  28131. e ? this.refreshUpdateInterval(n.ACTIVE_REFRESH_DELAY) : this.refreshUpdateInterval(n.IDLE_REFRESH_DELAY)
  28132. }
  28133. .bind(this), e)
  28134. }
  28135. ,
  28136. n.prototype.update = function() {
  28137. var e = this.forceQueue.length > 0;
  28138. return this.processQueueForDownloading(this.forceQueue),
  28139. this.processPriorityQueue && (this.queuePrioritizedTilesForPanos(this.panos),
  28140. this.priorityQueue.length > 0 && (e = !0),
  28141. this.processQueueForDownloading(this.priorityQueue)),
  28142. e
  28143. }
  28144. ,
  28145. n.prototype.forceQueueTilesForPano = function() {
  28146. var e = []
  28147. , t = [];
  28148. return function(i, n, r, o, a, s) {
  28149. e.length = 0;
  28150. for (var u = this.getTileDownloadDescriptors(i, n), d = 0; d < u.length; d++) {
  28151. var p = u[d];
  28152. p.status !== h.None && p.status !== h.Queued || e.push(p)
  28153. }
  28154. if (r && e.length > 0) {
  28155. l.sortPanoTiles(e, i, r),
  28156. t.length = 0,
  28157. c.matchingTilesInDirection(i, n, r, o, a, t);
  28158. for (var f = 0, g = function(e) {
  28159. return e.face === m.face && e.faceTileIndex === m.faceTileIndex
  28160. }; f < e.length; ) {
  28161. var m = e[f]
  28162. , v = t.findIndex(g);
  28163. v < 0 ? e.splice(f, 1) : f++
  28164. }
  28165. }
  28166. for (var A = 0; A < e.length; A++)
  28167. this.forceQueue.push(e[A]);
  28168. this.setStatusForAllDescriptors(this.forceQueue, h.ForceQueued),
  28169. this.clearFromQueue(this.priorityQueue, h.ForceQueued, !1),
  28170. s && this.processQueueForDownloading(this.forceQueue, !0)
  28171. }
  28172. }(),
  28173. n.prototype.clearForceQueue = function() {
  28174. this.clearQueue(this.forceQueue)
  28175. }
  28176. ,
  28177. n.prototype.queuePrioritizedTilesForPanos = function(e) {
  28178. this.tilePrioritizer && (this.clearQueue(this.priorityQueue),
  28179. this.tilePrioritizer.filterAndPrioritize(this.priorityQueue, e, this),
  28180. this.clearFromQueue(this.priorityQueue, h.None, !0),
  28181. this.setStatusOrRemoveForAllDescriptors(this.priorityQueue, h.Queued))
  28182. }
  28183. ,
  28184. n.prototype.clearQueue = function(e) {
  28185. this.setStatusForAllDescriptors(e, h.None),
  28186. e.length = 0
  28187. }
  28188. ,
  28189. n.prototype.clearFromQueue = function(e, t, i) {
  28190. for (var n = 0; n < e.length; n++) {
  28191. var r = e[n];
  28192. r && (t === r.status && !i || t !== r.status && i) && (e[n] = null)
  28193. }
  28194. }
  28195. ,
  28196. n.prototype.setStatusForAllDescriptors = function(e, t) {
  28197. for (var i = 0; i < e.length; i++) {
  28198. var n = e[i];
  28199. n && (n.status = t)
  28200. }
  28201. }
  28202. ,
  28203. n.prototype.setStatusOrRemoveForAllDescriptors = function(e, t) {
  28204. for (var i = 0; i < e.length; i++) {
  28205. var n = e[i];
  28206. n && (n.status !== t ? n.status = t : e[i] = null)
  28207. }
  28208. }
  28209. ,
  28210. n.prototype.getTileDownloadDescriptors = function(e, t) {
  28211. var i = this.getAllTileDownloadDescriptorsForPano(e)
  28212. , n = i[t];
  28213. return n || (n = this.buildDownloadDescriptorArray(t),
  28214. i[t] = n,
  28215. this.initTileDownloadDescriptors(n, e, t)),
  28216. n
  28217. }
  28218. ,
  28219. n.prototype.getAllTileDownloadDescriptorsForPano = function(e) {
  28220. var t = this.downloadDescriptors[e.id];
  28221. return t || (t = {},
  28222. this.downloadDescriptors[e.id] = t),
  28223. t
  28224. }
  28225. ,
  28226. n.prototype.processQueueForDownloading = function(e, t) {
  28227. if (this.cleanupActiveDownloads(),
  28228. this.activeDownloads.length < this.concurrentDownloads || t)
  28229. for (var i = t ? e.length : this.concurrentDownloads - this.activeDownloads.length, n = 0, r = 0; n < i && e.length > 0; r++) {
  28230. var o = e.shift();
  28231. o && (this.startDownload(o),
  28232. n++)
  28233. }
  28234. }
  28235. ,
  28236. n.prototype.testDownload = function(e, t, i) {
  28237. var n = this.downloadTestResults[e];
  28238. if (n)
  28239. return void (n === g.Success ? i(!0) : n === g.Fail && i(!1));
  28240. this.downloadTestResults[e] = g.Testing;
  28241. var r = this.panos.list[0]
  28242. , o = this.getTileUrl(r.id, e, t, 0)
  28243. , a = function(t) {
  28244. this.downloadTestResults[e] = g.Success,
  28245. i(!0)
  28246. }
  28247. .bind(this)
  28248. , s = function() {
  28249. this.downloadTestResults[e] = g.Fail,
  28250. i(!1)
  28251. }
  28252. .bind(this);
  28253. this.loadImage(o, 0, a, s)
  28254. }
  28255. ,
  28256. n.prototype.startDownload = function(e) {
  28257. e.status = h.Downloading;
  28258. var t = this.getTileUrl(e.pano.id, e.panoSize, e.tileSize, e.tileIndex);
  28259. this.activeDownloads.push(e),
  28260. this.loadImage(t, n.DOWNLOAD_RETRIES, this.downloadComplete.bind(this, e), this.downloadFailed.bind(this, e))
  28261. }
  28262. ,
  28263. n.prototype.downloadFailed = function(e, t) {}
  28264. ,
  28265. n.prototype.downloadComplete = function(e, t) {
  28266. if (e.panoGroupId === this.panoGroupId) {
  28267. var i = this.getPanoLoadCallbacks(e.pano, e.panoSize);
  28268. e.status = h.Downloaded,
  28269. i && i.onProgress && i.onProgress(e.pano, e.panoSize);
  28270. var n = {
  28271. panoId: e.pano.id,
  28272. image: t,
  28273. tileSize: e.tileSize,
  28274. panoSize: e.panoSize,
  28275. tileIndex: e.tileIndex,
  28276. faceTileIndex: e.faceTileIndex,
  28277. totalTiles: e.totalTiles,
  28278. face: e.face,
  28279. tileX: e.tileX,
  28280. tileY: e.tileY,
  28281. direction: e.direction
  28282. };
  28283. e.image = t,
  28284. this.emit(s.TileDownloadSuccess, n),
  28285. this.isPanoDownloaded(e.pano, e.panoSize) && (n = {
  28286. panoId: e.pano.id,
  28287. tileSize: e.tileSize,
  28288. panoSize: e.panoSize
  28289. },
  28290. this.emit(s.PanoDownloadComplete, n),
  28291. i && i.onLoad && i.onLoad(e.pano, e.panoSize))
  28292. }
  28293. }
  28294. ,
  28295. n.prototype.cleanupActiveDownloads = function() {
  28296. var e = [];
  28297. return function() {
  28298. e.length = 0;
  28299. for (var t = 0; t < this.activeDownloads.length; t++) {
  28300. var i = this.activeDownloads[t];
  28301. i.status !== h.Downloaded && i.status !== h.Failed && e.push(i)
  28302. }
  28303. this.activeDownloads.length = 0,
  28304. this.activeDownloads.push.apply(this.activeDownloads, e)
  28305. }
  28306. }(),
  28307. n.prototype.isPanoDownloaded = function(e, t) {
  28308. var i = this.getTileDownloadDescriptors(e, t);
  28309. if (i.length <= 0)
  28310. return !1;
  28311. for (var n = 0; n < i.length; n++) {
  28312. var r = i[n];
  28313. if (r.status !== h.Downloaded)
  28314. return !1
  28315. }
  28316. return !0
  28317. }
  28318. ,
  28319. n.prototype.setPanoLoadCallbacks = function(e, t, i, n, r) {
  28320. var o = e.id + ":" + this.qualityManager.getPanoSize(t);
  28321. this.panoLoadCallbacks[o] = {
  28322. onLoad: i,
  28323. onFail: n,
  28324. onProgress: r
  28325. }
  28326. }
  28327. ,
  28328. n.prototype.getPanoLoadCallbacks = function(e, t) {
  28329. var i = e.id + ":" + t;
  28330. return this.panoLoadCallbacks[i]
  28331. }
  28332. ,
  28333. n.prototype.buildDownloadDescriptorArray = function(e) {
  28334. for (var t = c.getTileCountForSize(e), i = [], n = 0; n < t; n++) {
  28335. var r = this.buildDownloadDescriptor();
  28336. i.push(r)
  28337. }
  28338. return i
  28339. }
  28340. ,
  28341. n.prototype.buildDownloadDescriptor = function() {
  28342. var e = {
  28343. panoGroupId: null,
  28344. pano: null,
  28345. panoSize: -1,
  28346. tileSize: -1,
  28347. tileIndex: -1,
  28348. totalTiles: -1,
  28349. faceTileIndex: -1,
  28350. status: h.None,
  28351. url: null,
  28352. image: null,
  28353. direction: new r.Vector3,
  28354. face: -1,
  28355. cubeFace: -1,
  28356. tileX: -1,
  28357. tileY: -1
  28358. };
  28359. return e
  28360. }
  28361. ,
  28362. n.prototype.initTileDownloadDescriptors = function(e, t, i) {
  28363. for (var n = 0; n < e.length; n++) {
  28364. var r = e[n];
  28365. this.initTileDownloadDescriptor(r, t, i, n)
  28366. }
  28367. }
  28368. ,
  28369. n.prototype.initTileDownloadDescriptor = function(e, t, i, n) {
  28370. var r = i >= c.TILE_SIZE ? c.TILE_SIZE : i;
  28371. e.face = c.getFaceForTile(i, n),
  28372. e.cubeFace = u.mapFaceToCubemapFace(e.face),
  28373. e.panoGroupId = this.panoGroupId,
  28374. e.pano = t,
  28375. e.panoSize = i,
  28376. e.tileSize = r,
  28377. e.tileIndex = n,
  28378. e.totalTiles = c.getTileCountForSize(i),
  28379. e.status = h.None,
  28380. e.image = null,
  28381. c.getTileLocation(e.panoSize, e.tileIndex, e),
  28382. c.getTileVector(e.panoSize, e.tileSize, e.cubeFace, e.tileX, e.tileY, c.LocationOnTile.Center, 0, e.direction)
  28383. }
  28384. ,
  28385. n.prototype.getTileUrl = function() {
  28386. var e = {
  28387. 256: "256",
  28388. 512: "512",
  28389. 1024: "1k",
  28390. 2048: "2k",
  28391. 4096: "4k"
  28392. }
  28393. , t = {
  28394. face: -1,
  28395. faceTileIndex: -1,
  28396. tileX: -1,
  28397. tileY: -1
  28398. };
  28399. return function(i, n, r, a) {
  28400. c.getTileLocation(n, a, t);
  28401. var s = Math.floor(n / r)
  28402. , l = s * s
  28403. , h = Math.floor(a / l)
  28404. , u = "";
  28405. 1 === o.tiling.customCompression && (u = "_" + o.tiling["q" + e[n]]);
  28406. var d = this.urls.get("tiles/" + i + "/" + e[n] + u + "_face" + h + "_" + t.tileX + "_" + t.tileY + ".jpg");
  28407. return d = p.changeIfTileGenerating(d)
  28408. }
  28409. }(),
  28410. n.prototype.loadImage = function(e, t, i, n) {
  28411. d.getImage(e, t).then(function(e) {
  28412. i(e)
  28413. }).fail(n)
  28414. }
  28415. ,
  28416. t.exports = n
  28417. }
  28418. ).call(this, "/js/tile/TileDownloader.js")
  28419. }
  28420. , {
  28421. "../ab": 3,
  28422. "../enum/DownloadStatus": 24,
  28423. "../enum/GLCubeFaces": 25,
  28424. "../enum/PanoSizeClass": 36,
  28425. "../enum/TileDownloaderEvents": 45,
  28426. "../enum/Vectors": 50,
  28427. "../enum/Viewmode": 51,
  28428. "../objects/Panorama": 148,
  28429. "../settings": 166,
  28430. "../util/ajax": 181,
  28431. "../util/logger": 189,
  28432. "../util/panorama": 191,
  28433. "./TilePrioritizer": 172,
  28434. "./TileUtils": 174,
  28435. events: 202,
  28436. three: 217
  28437. }],
  28438. 172: [function(e, t, i) {
  28439. (function(i) {
  28440. "use strict";
  28441. function n(e, t, i, o, a) {
  28442. this.qualityManager = e,
  28443. this.maxNavQuality = this.qualityManager.getMaxNavPanoSize(),
  28444. this.maxZoomQuality = this.qualityManager.getMaxZoomPanoSize(),
  28445. this.baseSize = t,
  28446. this.standardSize = i,
  28447. this.highSize = o,
  28448. this.ultraHighSize = a,
  28449. this.priorityCriteria = new n.PriorityCriteria(null,new r.Vector3(0,0,0),new r.Vector3(0,0,-1),new r.Vector3(0,0,-1))
  28450. }
  28451. var r = e("three")
  28452. , o = (e("../enum/Viewmode"),
  28453. e("../settings"),
  28454. e("../settings"),
  28455. e("../objects/Panorama"))
  28456. , a = e("../util/logger")
  28457. , s = (e("../enum/Vectors"),
  28458. e("../enum/PanoSizeClass"),
  28459. e("../enum/ModelManagerEvents"),
  28460. e("../enum/GLCubeFaces"),
  28461. e("../enum/DownloadStatus"))
  28462. , l = (e("../util/browser"),
  28463. e("./TileUtils"))
  28464. , c = e("../util/math")
  28465. , h = (e("events").EventEmitter,
  28466. new a(i),
  28467. Object.freeze({
  28468. None: 0,
  28469. DirectionalFOV: 1
  28470. }));
  28471. n.PriorityCriteria = function(e, t, i, n, o) {
  28472. this.pano = e,
  28473. this.cameraPosition = (new r.Vector3).copy(t),
  28474. this.cameraDir = (new r.Vector3).copy(i),
  28475. this.panoSpaceDir = (new r.Vector3).copy(n),
  28476. this.upcomingPanos = o,
  28477. this.copy = function(e) {
  28478. this.pano = e.pano,
  28479. this.cameraPosition.copy(e.cameraPosition),
  28480. this.cameraDir.copy(e.cameraDir),
  28481. this.panoSpaceDir.copy(e.panoSpaceDir),
  28482. this.upcomingPanos = o
  28483. }
  28484. ,
  28485. this.zoomingActive = !1
  28486. }
  28487. ,
  28488. n.DIRECTIONAL_FOV = 180,
  28489. n.DIRECTIONAL_FOV_NARROW = 120,
  28490. n.MAX_SCORED_PANOS_TOCONSIDER = 6,
  28491. n.MAX_SCORED_PANOS_TOADD = 2,
  28492. n.MAX_UPCOMING_PANOS_TOADD = 3,
  28493. n.DIRECTION_SCORE_STRICTNESS = .75,
  28494. n.appendQueue = function(e, t) {
  28495. if (e && t)
  28496. for (var i = 0; i < t.length; i++)
  28497. e.push(t[i])
  28498. }
  28499. ,
  28500. n.prototype.updateCriteria = function(e, t, i, n) {
  28501. this.priorityCriteria.pano = e,
  28502. this.priorityCriteria.cameraPosition.copy(t),
  28503. this.priorityCriteria.cameraDir.copy(i),
  28504. this.priorityCriteria.upcomingPanos = n,
  28505. this.maxNavQuality = this.qualityManager.getMaxNavPanoSize(),
  28506. this.maxZoomQuality = this.qualityManager.getMaxZoomPanoSize()
  28507. }
  28508. ,
  28509. n.prototype.filterAndPrioritize = function() {
  28510. var e = []
  28511. , t = []
  28512. , i = [];
  28513. return function(r, o, a) {
  28514. this.populateNeighborPanos(this.priorityCriteria.pano, o, e),
  28515. this.populateScoredPanos(this.priorityCriteria.pano, o, t, this.priorityCriteria.cameraDir, n.MAX_SCORED_PANOS_TOCONSIDER);
  28516. var s = this.baseSize
  28517. , l = this.standardSize
  28518. , c = this.highSize
  28519. , h = this.ultraHighSize;
  28520. this.queueTilesForPano(r, a, this.priorityCriteria.pano, s),
  28521. this.priorityCriteria.upcomingPanos && this.queueTilesForPanos(r, this.priorityCriteria.upcomingPanos, a, s, n.MAX_UPCOMING_PANOS_TOADD),
  28522. i.length = 0,
  28523. this.canDownloadSize(l) && this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, l, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV_NARROW),
  28524. n.sortPanoTiles(i, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  28525. n.appendQueue(r, i),
  28526. this.queueTilesForPanos(r, t, a, s, n.MAX_SCORED_PANOS_TOADD),
  28527. i.length = 0,
  28528. this.canDownloadSize(c) && this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, c, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV_NARROW),
  28529. this.canDownloadSize(h) && this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, h, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV_NARROW),
  28530. n.sortPanoTiles(i, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  28531. n.appendQueue(r, i),
  28532. i.length = 0,
  28533. this.canDownloadSize(l) && this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, l, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV),
  28534. this.canDownloadSize(c) && this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, c, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV),
  28535. this.canDownloadSize(h) && this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, h, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV),
  28536. n.sortPanoTiles(i, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  28537. n.appendQueue(r, i),
  28538. this.queueTilesForPanos(r, e, a, s)
  28539. }
  28540. }(),
  28541. n.prototype.canDownloadSize = function(e) {
  28542. return this.maxNavQuality >= e || this.maxZoomQuality >= e && this.zoomingActive
  28543. }
  28544. ,
  28545. n.prototype.populateNeighborPanos = function(e, t, i) {
  28546. i = i || [],
  28547. i.length = 0;
  28548. var n = t.getNeighbours(e);
  28549. for (var r in n)
  28550. if (n.hasOwnProperty(r)) {
  28551. var o = t.get(r);
  28552. i.push(o)
  28553. }
  28554. return i
  28555. }
  28556. ,
  28557. n.prototype.populateScoredPanos = function(e, t, i, r, a) {
  28558. i = i || [],
  28559. i.length = 0;
  28560. var s = [o.filters.inPanoDirection(e.position, r, n.DIRECTION_SCORE_STRICTNESS), o.filters.not(e)]
  28561. , l = [o.scoreFunctions.distanceSquared(e), o.scoreFunctions.direction(e.position, r)]
  28562. , c = t.sortByScore(s, l);
  28563. if (c)
  28564. for (var h = 0; h < c.length && h < a; h++) {
  28565. var u = c[h].pano;
  28566. i.push(u)
  28567. }
  28568. return i
  28569. }
  28570. ,
  28571. n.prototype.queueTilesForPanos = function(e, t, i, n, r) {
  28572. for (var o = 0, a = 0; a < t.length; a++) {
  28573. var s = t[a]
  28574. , l = this.queueTilesForPano(e, i, s, n);
  28575. if (o += l > 0 ? 1 : 0,
  28576. r && o >= r)
  28577. break
  28578. }
  28579. return o
  28580. }
  28581. ,
  28582. n.prototype.queueTilesForPano = function() {
  28583. var e = {
  28584. filter: h.None
  28585. };
  28586. return function(t, i, n, r) {
  28587. return this.filterAndQueueTileDownloadDescriptors(t, i, n, r, e)
  28588. }
  28589. }(),
  28590. n.prototype.queueTilesForPanosInDirection = function() {
  28591. var e = new r.Vector3;
  28592. return function(t, i, n, r, o, a, s, l) {
  28593. for (var h = 0, u = 0; u < n.length; u++) {
  28594. var d = n[u];
  28595. e.copy(d.position),
  28596. e.sub(o),
  28597. e.normalize();
  28598. var p = Math.max(Math.min(a.dot(e), 1), -1)
  28599. , f = c.getFOVDotThreshold(s);
  28600. if (p >= f) {
  28601. var g = this.queueTilesInDirectionForPano(t, i, d, r, o, a, s);
  28602. if (h += g > 0 ? 1 : 0,
  28603. l && h >= l)
  28604. break
  28605. }
  28606. }
  28607. return h
  28608. }
  28609. }(),
  28610. n.prototype.queueTilesInDirectionForPanos = function(e, t, i, n, r, o, a, s) {
  28611. for (var l = 0, c = 0; c < i.length; c++) {
  28612. var h = i[c]
  28613. , u = this.queueTilesInDirectionForPano(e, t, h, n, o, a);
  28614. if (l += u > 0 ? 1 : 0,
  28615. s && l >= s)
  28616. break
  28617. }
  28618. return l
  28619. }
  28620. ,
  28621. n.prototype.queueTilesInDirectionForPano = function() {
  28622. var e = {
  28623. filter: h.DirectionalFOV,
  28624. direction: new r.Vector3,
  28625. fov: 60
  28626. }
  28627. , t = new r.Vector3;
  28628. return function(i, n, r, o, a, s, c) {
  28629. return t.copy(s),
  28630. l.getRelativeDirection(r.quaternion, t),
  28631. e.direction.copy(t),
  28632. e.fov = c,
  28633. this.filterAndQueueTileDownloadDescriptors(i, n, r, o, e)
  28634. }
  28635. }(),
  28636. n.prototype.filterAndQueueTileDownloadDescriptors = function() {
  28637. var e = [];
  28638. return function(t, i, n, r, o) {
  28639. var a = i.getTileDownloadDescriptors(n, r);
  28640. e.length = 0,
  28641. this.filterTileDownloadDescriptors(n, a, e, o);
  28642. for (var s = 0, l = 0; l < e.length; l++) {
  28643. var c = e[l];
  28644. c && (t.push(c),
  28645. s++)
  28646. }
  28647. return s
  28648. }
  28649. }(),
  28650. n.prototype.filterTileDownloadDescriptors = function() {
  28651. new r.Vector3;
  28652. return function(e, t, i, n) {
  28653. var r, o;
  28654. switch (n.filter) {
  28655. case h.DirectionalFOV:
  28656. for (r = 0; r < t.length; r++)
  28657. o = t[r],
  28658. l.isTileWithinFOV(o.panoSize, o.tileSize, o.face, o.tileX, o.tileY, n.direction, n.fov) && i.push(o);
  28659. break;
  28660. default:
  28661. for (r = 0; r < t.length; r++)
  28662. o = t[r],
  28663. i.push(o)
  28664. }
  28665. for (r = 0; r < i.length; r++)
  28666. o = i[r],
  28667. this.canIncludeDescriptor(o) || (i[r] = null)
  28668. }
  28669. }(),
  28670. n.prototype.canIncludeDescriptor = function(e) {
  28671. return e.status !== s.Downloading && e.status !== s.Downloaded
  28672. }
  28673. ,
  28674. n.prototype.canIncludePano = function(e, t) {
  28675. return !e.isLoaded(t)
  28676. }
  28677. ,
  28678. n.getFOVDotThreshold = function(e) {
  28679. return Math.cos(r.Math.degToRad(e / 2))
  28680. }
  28681. ;
  28682. var u = function() {
  28683. var e = function e(t, i) {
  28684. var n = e._panoSpaceDir
  28685. , r = e._fovThreshold
  28686. , o = e._fovThresholdNarrow
  28687. , a = Math.max(Math.min(n.dot(t.direction), 1), -1)
  28688. , s = Math.max(Math.min(n.dot(i.direction), 1), -1);
  28689. return t._dot = a,
  28690. i._dot = s,
  28691. 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)
  28692. };
  28693. return e._panoSpaceDir = new r.Vector3,
  28694. e._fovThreshold = -1,
  28695. e._fovThresholdNarrow = -1,
  28696. e
  28697. }();
  28698. n.sortPanoTiles = function(e, t, i) {
  28699. u._panoSpaceDir.copy(i),
  28700. l.getRelativeDirection(t.quaternion, u._panoSpaceDir),
  28701. u._fovThresholdNarrow = c.getFOVDotThreshold(n.DIRECTIONAL_FOV_NARROW),
  28702. u._fovThreshold = c.getFOVDotThreshold(n.DIRECTIONAL_FOV),
  28703. e.sort(u)
  28704. }
  28705. ,
  28706. n.insertSortedPanoTile = function(e, t, i, r) {
  28707. u._panoSpaceDir.copy(r),
  28708. l.getRelativeDirection(i.quaternion, u._panoSpaceDir),
  28709. u._fovThresholdNarrow = c.getFOVDotThreshold(n.DIRECTIONAL_FOV_NARROW),
  28710. u._fovThreshold = c.getFOVDotThreshold(n.DIRECTIONAL_FOV);
  28711. for (var o = -1, a = 0; a < e.length; a++) {
  28712. var s = u(t, e[a]);
  28713. if (s <= 0) {
  28714. o = a;
  28715. break
  28716. }
  28717. }
  28718. if (o === -1)
  28719. e[e.length] = t;
  28720. else {
  28721. for (var h = e.length; h > o; h--)
  28722. e[h] = e[h - 1];
  28723. e[o] = t
  28724. }
  28725. }
  28726. ,
  28727. n.prototype.setZoomingActive = function(e) {
  28728. e !== this.zoomingActive && (this.zoomingActive = e)
  28729. }
  28730. ,
  28731. t.exports = n
  28732. }
  28733. ).call(this, "/js/tile/TilePrioritizer.js")
  28734. }
  28735. , {
  28736. "../enum/DownloadStatus": 24,
  28737. "../enum/GLCubeFaces": 25,
  28738. "../enum/ModelManagerEvents": 33,
  28739. "../enum/PanoSizeClass": 36,
  28740. "../enum/Vectors": 50,
  28741. "../enum/Viewmode": 51,
  28742. "../objects/Panorama": 148,
  28743. "../settings": 166,
  28744. "../util/browser": 182,
  28745. "../util/logger": 189,
  28746. "../util/math": 190,
  28747. "./TileUtils": 174,
  28748. events: 202,
  28749. three: 217
  28750. }],
  28751. 173: [function(e, t, i) {
  28752. "use strict";
  28753. function n(e, t) {
  28754. this.levels = t,
  28755. this.tileSize = e,
  28756. this.root = null,
  28757. this.allNodes = [],
  28758. a(this)
  28759. }
  28760. function r(e, t) {
  28761. this.tree = e,
  28762. this.parent = t,
  28763. this.children = [],
  28764. this.id = ++u
  28765. }
  28766. function o(e, t, i, r, a, s, l, h) {
  28767. if (e) {
  28768. l = l || n.TraversalType.PreOrder;
  28769. var u = r * c + i;
  28770. if (l === n.TraversalType.PreOrder && (a && a(e, t, u, i, r),
  28771. s && s.push(e)),
  28772. e.children && 0 !== e.children.length) {
  28773. for (var d = r * c, p = i * c, f = 0; f < c; f++)
  28774. for (var g = 0; g < c; g++)
  28775. o(e.children[g * c + f], t + 1, p + f, d + g, a, s, l, h);
  28776. l === n.TraversalType.PostOrder && (a && a(e, t, u, i, r),
  28777. s && s.push(e))
  28778. }
  28779. }
  28780. }
  28781. function a(e) {
  28782. e.root = s(e, null, 0)
  28783. }
  28784. function s(e, t, i) {
  28785. if (i > e.levels)
  28786. return null;
  28787. var n = new r(e,t);
  28788. e.allNodes.push(n);
  28789. for (var o = 0; o < h; o++)
  28790. n.children[o] = s(e, n, i + 1);
  28791. return n
  28792. }
  28793. function l(e, t, i, n, r) {
  28794. if (!e)
  28795. return null;
  28796. if (0 === i)
  28797. return e;
  28798. if (!e.children || 0 === e.children.length)
  28799. return null;
  28800. var o = Math.pow(c, i)
  28801. , a = o / c
  28802. , s = n % a
  28803. , h = r % a
  28804. , u = Math.floor(r / a)
  28805. , d = Math.floor(n / a)
  28806. , p = u * c + d
  28807. , f = e.children[p];
  28808. return l(f, t + 1, i - 1, s, h)
  28809. }
  28810. var c = (e("three"),
  28811. e("./TileUtils"),
  28812. e("../objects/Panorama"),
  28813. e("../util/panorama"),
  28814. e("events").EventEmitter,
  28815. 2)
  28816. , h = c * c;
  28817. n.TraversalType = Object.freeze({
  28818. PreOrder: 0,
  28819. PostOrder: 1
  28820. });
  28821. var u = 0;
  28822. n.getLevelCountForSize = function(e, t) {
  28823. var i = 0;
  28824. for (t < e && (t = e); ; ) {
  28825. if (t /= c,
  28826. t < e)
  28827. break;
  28828. i++
  28829. }
  28830. return i
  28831. }
  28832. ,
  28833. n.getSizeForLevel = function(e, t) {
  28834. return Math.pow(c, t) * e
  28835. }
  28836. ,
  28837. n.prototype.getSubNode = function(e, t, i) {
  28838. (!t || e < this.tileSize) && (t = 0),
  28839. (!i || e < this.tileSize) && (i = 0),
  28840. e < this.tileSize && (e = this.tileSize);
  28841. var r = n.getLevelCountForSize(this.tileSize, e)
  28842. , o = l(this.root, 0, r, t, i);
  28843. return o
  28844. }
  28845. ,
  28846. n.prototype.breadthFirst = function(e) {
  28847. e = e || {};
  28848. var t = !!e.nullLevelEnd
  28849. , i = e.maxLevel
  28850. , n = e.minLevel
  28851. , r = e.callback
  28852. , o = e.saveVisited
  28853. , a = []
  28854. , s = {}
  28855. , l = 0
  28856. , c = 0;
  28857. for (a.push(this.root),
  28858. a.push(s); a.length > 0 && !(i && l > i); ) {
  28859. var h = a.shift();
  28860. if (h === s)
  28861. (!n || l >= n) && (r && t && r(null),
  28862. o && t && o.push(null)),
  28863. a.length > 0 && a.push(s),
  28864. l++,
  28865. c = 0;
  28866. else {
  28867. if (h.children)
  28868. for (var u = 0; u < h.children.length; u++) {
  28869. var d = h.children[u];
  28870. d && a.push(h.children[u])
  28871. }
  28872. var p = this.getFaceIndexFromNode(h);
  28873. (!n || l >= n) && (r && r(h, l, p),
  28874. o && o.push(h)),
  28875. c++
  28876. }
  28877. }
  28878. }
  28879. ,
  28880. n.prototype.getFaceIndexFromNode = function(e) {
  28881. if (!e)
  28882. return -1;
  28883. for (var t = 1, i = e, n = 0, r = 0; ; ) {
  28884. var o = i.parent;
  28885. if (!o)
  28886. break;
  28887. for (var a = -1, s = 0; s < o.children.length; s++)
  28888. o.children[s] === i && (a = s);
  28889. var l = a % c
  28890. , h = Math.floor(a / c);
  28891. n = l * t + n,
  28892. r = h * t + r,
  28893. t *= c,
  28894. i = o
  28895. }
  28896. return r * t + n
  28897. }
  28898. ,
  28899. n.prototype.depthFirst = function(e, t, i) {
  28900. o(this.root, 0, 0, 0, e, t, i, this.tileSize)
  28901. }
  28902. ,
  28903. t.exports = n
  28904. }
  28905. , {
  28906. "../objects/Panorama": 148,
  28907. "../util/panorama": 191,
  28908. "./TileUtils": 174,
  28909. events: 202,
  28910. three: 217
  28911. }],
  28912. 174: [function(e, t, i) {
  28913. "use strict";
  28914. var n = e("../enum/GLCubeFaces")
  28915. , r = e("../util/MathLight")
  28916. , o = {};
  28917. o.TILE_SIZE = 512,
  28918. o.FACES_PER_PANO = 6,
  28919. o.LocationOnTile = {
  28920. Center: 0,
  28921. UpperLeft: 1,
  28922. UpperRight: 2,
  28923. LowerRight: 3,
  28924. LowerLeft: 4
  28925. },
  28926. o.getTileVector = function() {
  28927. return function(e, t, i, a, s, l, c, h) {
  28928. l = l || o.LocationOnTile.Center;
  28929. var u = e / t
  28930. , d = a / u;
  28931. s = -s + (u - 1);
  28932. var p = s / u
  28933. , f = t / e
  28934. , g = 2 * f
  28935. , m = g / 2
  28936. , v = 2 * d - 1 + m
  28937. , A = 2 * p - 1 + m;
  28938. switch (l) {
  28939. case o.LocationOnTile.UpperLeft:
  28940. v -= m,
  28941. A += m,
  28942. v += c * g;
  28943. break;
  28944. case o.LocationOnTile.UpperRight:
  28945. v += m,
  28946. A += m,
  28947. A -= c * g;
  28948. break;
  28949. case o.LocationOnTile.LowerRight:
  28950. v += m,
  28951. A -= m,
  28952. v -= c * g;
  28953. break;
  28954. case o.LocationOnTile.LowerLeft:
  28955. v -= m,
  28956. A -= m,
  28957. A += c * g;
  28958. break;
  28959. case o.LocationOnTile.Center:
  28960. }
  28961. switch (i) {
  28962. case n.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  28963. r.setVector(h, -1, A, -v);
  28964. break;
  28965. case n.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  28966. r.setVector(h, 1, A, v);
  28967. break;
  28968. case n.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  28969. r.setVector(h, -v, 1, -A);
  28970. break;
  28971. case n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  28972. r.setVector(h, -v, -1, A);
  28973. break;
  28974. case n.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  28975. r.setVector(h, -v, A, 1);
  28976. break;
  28977. case n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  28978. r.setVector(h, v, A, -1)
  28979. }
  28980. r.normalize(h)
  28981. }
  28982. }(),
  28983. o.getFaceForTile = function(e, t) {
  28984. var i = o.TILE_SIZE;
  28985. e < o.TILE_SIZE && (i = e);
  28986. var n = Math.floor(e / i)
  28987. , r = n * n;
  28988. return Math.floor(t / r)
  28989. }
  28990. ,
  28991. o.getTileLocation = function(e, t, i) {
  28992. var n = o.TILE_SIZE;
  28993. e < o.TILE_SIZE && (n = e);
  28994. var r = o.getFaceForTile(e, t)
  28995. , a = Math.floor(e / n)
  28996. , s = a * a
  28997. , l = t - r * s;
  28998. i.tileX = l % a,
  28999. i.tileY = Math.floor(l / a),
  29000. i.face = r,
  29001. i.faceTileIndex = l
  29002. }
  29003. ,
  29004. o.getTileCountForSize = function(e) {
  29005. if (e <= o.TILE_SIZE)
  29006. return o.FACES_PER_PANO;
  29007. var t = Math.floor(e / o.TILE_SIZE)
  29008. , i = t * t
  29009. , n = i * o.FACES_PER_PANO;
  29010. return n
  29011. }
  29012. ,
  29013. o.getRelativeDirection = function() {
  29014. var e = new r.Matrix4
  29015. , t = new r.Quaternion;
  29016. return function(i, n) {
  29017. t.copy(i),
  29018. t.inverse(),
  29019. e.makeRotationFromQuaternion(t),
  29020. e.applyToVector3(n),
  29021. r.normalize(n)
  29022. }
  29023. }(),
  29024. o.matchingTilesInDirection = function() {
  29025. var e = new r.Vector3
  29026. , t = new r.Vector3(0,0,-1)
  29027. , i = new r.Quaternion
  29028. , n = function(e, t) {
  29029. e.push({
  29030. face: t.face,
  29031. faceTileIndex: t.faceTileIndex,
  29032. tileX: t.tileX,
  29033. tileY: t.tileY
  29034. })
  29035. }
  29036. , a = function() {
  29037. var e = {
  29038. face: -1,
  29039. faceTileIndex: -1,
  29040. tileX: -1,
  29041. tileY: -1
  29042. };
  29043. return function(t, i, r) {
  29044. for (var a = o.getTileCountForSize(t), s = 0, l = 0; l < a; l++)
  29045. o.getTileLocation(t, l, e),
  29046. i && !i(e) || (s++,
  29047. r && n(r, e));
  29048. return s
  29049. }
  29050. }();
  29051. return function(n, s, l, c, h, u) {
  29052. var d = s < o.TILE_SIZE ? s : o.TILE_SIZE;
  29053. o.getTileCountForSize(s);
  29054. if (!c && !h)
  29055. return a(s, null, u);
  29056. var p = !!h;
  29057. if (h = h || c,
  29058. h = Math.max(0, Math.min(h, 360)),
  29059. c = Math.max(0, Math.min(c, 360)),
  29060. r.copyVector(l, e),
  29061. o.getRelativeDirection(n.quaternion, e),
  29062. p) {
  29063. i.setFromUnitVectors(e, t);
  29064. var f = function(e) {
  29065. return o.isTileWithinFrustum(s, d, e.face, e.tileX, e.tileY, i, c, h)
  29066. };
  29067. return a(s, f, u)
  29068. }
  29069. var g = function(t) {
  29070. return o.isTileWithinFOV(s, d, t.face, t.tileX, t.tileY, e, c)
  29071. };
  29072. return a(s, g, u)
  29073. }
  29074. }(),
  29075. o.isTileWithinFrustum = function() {
  29076. var e = new r.Vector3
  29077. , t = 1e-5;
  29078. return function(i, n, a, s, l, c, h, u) {
  29079. 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++)
  29080. if (o.getTileVector(i, n, m, s, l, b, 0, e),
  29081. r.applyQuaternionToVector(c, e),
  29082. e.z >= -t)
  29083. I++;
  29084. else {
  29085. var w = -1 / e.z
  29086. , _ = e.x * w
  29087. , T = e.y * w;
  29088. T > d ? v++ : T < p && A++,
  29089. _ > f ? y++ : _ < g && C++,
  29090. E++
  29091. }
  29092. return A !== E && v !== E && y !== E && C !== E
  29093. }
  29094. }(),
  29095. o.isTileWithinFOV = function() {
  29096. var e = new r.Vector3
  29097. , t = new r.Vector3(0,1,0)
  29098. , i = new r.Vector3(1,0,0);
  29099. return function(n, a, s, l, c, h, u) {
  29100. var d = o.mapFaceToCubemapFace(s);
  29101. if (r.cross(h, t, i),
  29102. o.getTileVector(n, a, d, l, c, o.LocationOnTile.Center, 0, e),
  29103. o.isWithinFOV(e, h, u, null))
  29104. return !0;
  29105. for (var p = u / 360, f = Math.floor(1 / p), g = 0, m = 0; m < f; m++) {
  29106. for (var v = o.LocationOnTile.UpperLeft; v <= o.LocationOnTile.LowerLeft; v++)
  29107. if (o.getTileVector(n, a, d, l, c, v, g, e),
  29108. o.isWithinFOV(e, h, u, null))
  29109. return !0;
  29110. g += p
  29111. }
  29112. return !1
  29113. }
  29114. }(),
  29115. o.isWithinFOV = function() {
  29116. var e = new r.Vector3
  29117. , t = new r.Vector3;
  29118. return function(i, n, o, a) {
  29119. if (r.copyVector(i, t),
  29120. a) {
  29121. r.copyVector(a, e),
  29122. r.normalize(e);
  29123. var s = r.dot(e, i);
  29124. e.x *= s,
  29125. e.y *= s,
  29126. e.z *= s,
  29127. r.subVector(t, e)
  29128. }
  29129. var l = o / 2 * r.RADIANS_PER_DEGREE
  29130. , c = Math.cos(l)
  29131. , h = r.dot(t, n);
  29132. return h >= c
  29133. }
  29134. }(),
  29135. o.mapFaceToCubemapFace = function() {
  29136. var e = {
  29137. 0: n.GL_TEXTURE_CUBE_MAP_POSITIVE_Y,
  29138. 1: n.GL_TEXTURE_CUBE_MAP_POSITIVE_Z,
  29139. 2: n.GL_TEXTURE_CUBE_MAP_POSITIVE_X,
  29140. 3: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,
  29141. 4: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
  29142. 5: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
  29143. };
  29144. return function(t) {
  29145. return e[t]
  29146. }
  29147. }(),
  29148. t.exports = o
  29149. }
  29150. , {
  29151. "../enum/GLCubeFaces": 25,
  29152. "../util/MathLight": 176
  29153. }],
  29154. 175: [function(e, t, i) {
  29155. (function(i) {
  29156. "use strict";
  29157. function n() {
  29158. this.list = [],
  29159. this.index = {},
  29160. Object.defineProperty(this, "length", {
  29161. get: function() {
  29162. return this.list.length
  29163. }
  29164. })
  29165. }
  29166. var r = (e("./common"),
  29167. e("./logger"));
  29168. new r(i);
  29169. n.prototype.forEach = function(e) {
  29170. this.list.forEach(e)
  29171. }
  29172. ,
  29173. n.prototype.add = function(e) {
  29174. this.list.push(e),
  29175. this.index[this.getIndex(e)] = e
  29176. }
  29177. ,
  29178. n.prototype.getIndex = function(e) {
  29179. throw new Error("IndexedCollection.getIndex not implemented in subclass.")
  29180. }
  29181. ,
  29182. n.prototype.extend = function(e) {
  29183. for (var t = 0; t < e.length; t++)
  29184. this.add(e[t])
  29185. }
  29186. ,
  29187. n.prototype.get = function(e) {
  29188. return this.index[e]
  29189. }
  29190. ,
  29191. n.prototype.first = function() {
  29192. return this.list[0]
  29193. }
  29194. ,
  29195. n.prototype.last = function() {
  29196. return this.list[this.list.length - 1]
  29197. }
  29198. ,
  29199. n.prototype.reIndex = function() {
  29200. this.index = {};
  29201. var e = this;
  29202. this.forEach(function(t) {
  29203. e.index[e.getIndex(t)] = t
  29204. })
  29205. }
  29206. ,
  29207. n.prototype.filter = function(e) {
  29208. var t = this.list.filter(e);
  29209. return this.reIndex(),
  29210. t
  29211. }
  29212. ,
  29213. n.prototype.reduce = function(e, t) {
  29214. return this.list.reduce(e, t)
  29215. }
  29216. ,
  29217. n.prototype.sort = function(e) {
  29218. return this.list.sort(e)
  29219. }
  29220. ,
  29221. n.prototype.indexOf = function(e) {
  29222. for (var t = 0; t < this.list.length; ++t)
  29223. if (this.list[t] === e)
  29224. return t;
  29225. return -1
  29226. }
  29227. ,
  29228. t.exports = n
  29229. }
  29230. ).call(this, "/js/util/IndexedCollection.js")
  29231. }
  29232. , {
  29233. "./common": 185,
  29234. "./logger": 189
  29235. }],
  29236. 176: [function(e, t, i) {
  29237. "use strict";
  29238. var n = e("../constants")
  29239. , r = {};
  29240. r.RADIANS_PER_DEGREE = Math.PI / 180,
  29241. r.DEGREES_PER_RADIAN = 180 / Math.PI,
  29242. r.Vector3 = function(e, t, i) {
  29243. this.x = e || 0,
  29244. this.y = t || 0,
  29245. this.z = i || 0
  29246. }
  29247. ,
  29248. r.Matrix4 = function() {
  29249. this.elements = new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]),
  29250. arguments.length > 0 && console.error("MathLight.Matrix4: the constructor no longer reads arguments. use .set() instead.")
  29251. }
  29252. ,
  29253. r.Matrix4.prototype = {
  29254. identity: function() {
  29255. return this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
  29256. this
  29257. },
  29258. copy: function(e) {
  29259. return this.elements.set(e.elements),
  29260. this
  29261. },
  29262. applyToVector3: function(e) {
  29263. var t = e.x
  29264. , i = e.y
  29265. , n = e.z
  29266. , r = this.elements;
  29267. return e.x = r[0] * t + r[4] * i + r[8] * n + r[12],
  29268. e.y = r[1] * t + r[5] * i + r[9] * n + r[13],
  29269. e.z = r[2] * t + r[6] * i + r[10] * n + r[14],
  29270. this
  29271. },
  29272. getInverse: function(e, t) {
  29273. var i = this.elements
  29274. , n = e.elements
  29275. , r = n[0]
  29276. , o = n[1]
  29277. , a = n[2]
  29278. , s = n[3]
  29279. , l = n[4]
  29280. , c = n[5]
  29281. , h = n[6]
  29282. , u = n[7]
  29283. , d = n[8]
  29284. , p = n[9]
  29285. , f = n[10]
  29286. , g = n[11]
  29287. , m = n[12]
  29288. , v = n[13]
  29289. , A = n[14]
  29290. , y = n[15]
  29291. , C = p * A * u - v * f * u + v * h * g - c * A * g - p * h * y + c * f * y
  29292. , I = m * f * u - d * A * u - m * h * g + l * A * g + d * h * y - l * f * y
  29293. , E = d * v * u - m * p * u + m * c * g - l * v * g - d * c * y + l * p * y
  29294. , b = m * p * h - d * v * h - m * c * f + l * v * f + d * c * A - l * p * A
  29295. , w = r * C + o * I + a * E + s * b;
  29296. if (0 === w) {
  29297. var _ = "MathLight.Matrix4.getInverse(): can't invert matrix, determinant is 0";
  29298. if (t)
  29299. throw new Error(_);
  29300. return console.warn(_),
  29301. this.identity()
  29302. }
  29303. var T = 1 / w;
  29304. return i[0] = C * T,
  29305. i[1] = (v * f * s - p * A * s - v * a * g + o * A * g + p * a * y - o * f * y) * T,
  29306. i[2] = (c * A * s - v * h * s + v * a * u - o * A * u - c * a * y + o * h * y) * T,
  29307. i[3] = (p * h * s - c * f * s - p * a * u + o * f * u + c * a * g - o * h * g) * T,
  29308. i[4] = I * T,
  29309. i[5] = (d * A * s - m * f * s + m * a * g - r * A * g - d * a * y + r * f * y) * T,
  29310. i[6] = (m * h * s - l * A * s - m * a * u + r * A * u + l * a * y - r * h * y) * T,
  29311. i[7] = (l * f * s - d * h * s + d * a * u - r * f * u - l * a * g + r * h * g) * T,
  29312. i[8] = E * T,
  29313. i[9] = (m * p * s - d * v * s - m * o * g + r * v * g + d * o * y - r * p * y) * T,
  29314. i[10] = (l * v * s - m * c * s + m * o * u - r * v * u - l * o * y + r * c * y) * T,
  29315. i[11] = (d * c * s - l * p * s - d * o * u + r * p * u + l * o * g - r * c * g) * T,
  29316. i[12] = b * T,
  29317. i[13] = (d * v * a - m * p * a + m * o * f - r * v * f - d * o * A + r * p * A) * T,
  29318. i[14] = (m * c * a - l * v * a - m * o * h + r * v * h + l * o * A - r * c * A) * T,
  29319. i[15] = (l * p * a - d * c * a + d * o * h - r * p * h - l * o * f + r * c * f) * T,
  29320. this
  29321. },
  29322. makeRotationFromQuaternion: function(e) {
  29323. var t = this.elements
  29324. , i = e.x
  29325. , n = e.y
  29326. , r = e.z
  29327. , o = e.w
  29328. , a = i + i
  29329. , s = n + n
  29330. , l = r + r
  29331. , c = i * a
  29332. , h = i * s
  29333. , u = i * l
  29334. , d = n * s
  29335. , p = n * l
  29336. , f = r * l
  29337. , g = o * a
  29338. , m = o * s
  29339. , v = o * l;
  29340. return t[0] = 1 - (d + f),
  29341. t[4] = h - v,
  29342. t[8] = u + m,
  29343. t[1] = h + v,
  29344. t[5] = 1 - (c + f),
  29345. t[9] = p - g,
  29346. t[2] = u - m,
  29347. t[6] = p + g,
  29348. t[10] = 1 - (c + d),
  29349. t[3] = 0,
  29350. t[7] = 0,
  29351. t[11] = 0,
  29352. t[12] = 0,
  29353. t[13] = 0,
  29354. t[14] = 0,
  29355. t[15] = 1,
  29356. this
  29357. }
  29358. },
  29359. r.Quaternion = function(e, t, i, n) {
  29360. this._x = e || 0,
  29361. this._y = t || 0,
  29362. this._z = i || 0,
  29363. this._w = void 0 !== n ? n : 1
  29364. }
  29365. ,
  29366. r.Quaternion.prototype = {
  29367. get x() {
  29368. return this._x
  29369. },
  29370. set x(e) {
  29371. this._x = e
  29372. },
  29373. get y() {
  29374. return this._y
  29375. },
  29376. set y(e) {
  29377. this._y = e
  29378. },
  29379. get z() {
  29380. return this._z
  29381. },
  29382. set z(e) {
  29383. this._z = e
  29384. },
  29385. get w() {
  29386. return this._w
  29387. },
  29388. set w(e) {
  29389. this._w = e
  29390. },
  29391. copy: function(e) {
  29392. this._x = e.x,
  29393. this._y = e.y,
  29394. this._z = e.z,
  29395. this._w = e.w
  29396. },
  29397. inverse: function() {
  29398. return this.conjugate().normalize()
  29399. },
  29400. conjugate: function() {
  29401. return this._x *= -1,
  29402. this._y *= -1,
  29403. this._z *= -1,
  29404. this
  29405. },
  29406. length: function() {
  29407. return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w)
  29408. },
  29409. normalize: function() {
  29410. var e = this.length();
  29411. return 0 === e ? (this._x = 0,
  29412. this._y = 0,
  29413. this._z = 0,
  29414. this._w = 1) : (e = 1 / e,
  29415. this._x = this._x * e,
  29416. this._y = this._y * e,
  29417. this._z = this._z * e,
  29418. this._w = this._w * e),
  29419. this
  29420. },
  29421. setFromAxisAngle: function(e, t) {
  29422. var i = t / 2
  29423. , n = Math.sin(i);
  29424. return this._x = e.x * n,
  29425. this._y = e.y * n,
  29426. this._z = e.z * n,
  29427. this._w = Math.cos(i),
  29428. this
  29429. },
  29430. setFromUnitVectors: function() {
  29431. var e, t, i = 1e-6;
  29432. return function(n, o) {
  29433. return void 0 === e && (e = new r.Vector3),
  29434. t = r.dot(n, o) + 1,
  29435. t < i ? (t = 0,
  29436. 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),
  29437. this._x = e.x,
  29438. this._y = e.y,
  29439. this._z = e.z,
  29440. this._w = t,
  29441. this.normalize()
  29442. }
  29443. }(),
  29444. multiply: function(e) {
  29445. return this.multiplyQuaternions(this, e)
  29446. },
  29447. premultiply: function(e) {
  29448. return this.multiplyQuaternions(e, this)
  29449. },
  29450. multiplyQuaternions: function(e, t) {
  29451. var i = e._x
  29452. , n = e._y
  29453. , r = e._z
  29454. , o = e._w
  29455. , a = t._x
  29456. , s = t._y
  29457. , l = t._z
  29458. , c = t._w;
  29459. return this._x = i * c + o * a + n * l - r * s,
  29460. this._y = n * c + o * s + r * a - i * l,
  29461. this._z = r * c + o * l + i * s - n * a,
  29462. this._w = o * c - i * a - n * s - r * l,
  29463. this
  29464. }
  29465. },
  29466. r.convertWorkshopVector = function(e) {
  29467. return new r.Vector3(-e.x,e.y,e.z)
  29468. }
  29469. ,
  29470. r.convertWorkshopQuaternion = function(e) {
  29471. 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))
  29472. }
  29473. ;
  29474. r.convertWorkshopOrthoZoom = function(e) {//xzw
  29475. //return e === -1 ? -1 : e / 16 * ($("#player").width() / $("#player").height()) / n.workshopApsect
  29476. return e === -1 ? -1 : e * ($("#player").width() / $("#player").height()) / g_snapShotWidth * g_snapShotHeight;
  29477. }
  29478. ,
  29479. r.convertWorkshopPanoramaQuaternion = function(e) {
  29480. 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))
  29481. }
  29482. ,
  29483. r.normalize = function(e) {
  29484. var t = e.x * e.x + e.y * e.y + e.z * e.z
  29485. , i = Math.sqrt(t);
  29486. e.x /= i,
  29487. e.y /= i,
  29488. e.z /= i
  29489. }
  29490. ,
  29491. r.dot = function(e, t) {
  29492. return e.x * t.x + e.y * t.y + e.z * t.z
  29493. }
  29494. ,
  29495. r.cross = function(e, t, i) {
  29496. var n = e.x
  29497. , r = e.y
  29498. , o = e.z;
  29499. i.x = r * t.z - o * t.y,
  29500. i.y = o * t.x - n * t.z,
  29501. i.z = n * t.y - r * t.x
  29502. }
  29503. ,
  29504. r.setVector = function(e, t, i, n) {
  29505. e.x = t,
  29506. e.y = i,
  29507. e.z = n
  29508. }
  29509. ,
  29510. r.copyVector = function(e, t) {
  29511. t.x = e.x,
  29512. t.y = e.y,
  29513. t.z = e.z
  29514. }
  29515. ,
  29516. r.addVector = function(e, t) {
  29517. e.x += t.x,
  29518. e.y += t.y,
  29519. e.z += t.z
  29520. }
  29521. ,
  29522. r.subVector = function(e, t) {
  29523. e.x -= t.x,
  29524. e.y -= t.y,
  29525. e.z -= t.z
  29526. }
  29527. ,
  29528. r.applyQuaternionToVector = function(e, t) {
  29529. var i = t.x
  29530. , n = t.y
  29531. , r = t.z
  29532. , o = e.x
  29533. , a = e.y
  29534. , s = e.z
  29535. , l = e.w
  29536. , c = l * i + a * r - s * n
  29537. , h = l * n + s * i - o * r
  29538. , u = l * r + o * n - a * i
  29539. , d = -o * i - a * n - s * r;
  29540. t.x = c * l + d * -o + h * -s - u * -a,
  29541. t.y = h * l + d * -a + u * -o - c * -s,
  29542. t.z = u * l + d * -s + c * -a - h * -o
  29543. }
  29544. ,
  29545. r.angleBetweenVectors = function(e, t) {
  29546. return Math.acos(r.dot(e, t))
  29547. }
  29548. ,
  29549. t.exports = r
  29550. }
  29551. , {
  29552. "../constants": 8
  29553. }],
  29554. 177: [function(e, t, i) {
  29555. (function(i) {
  29556. "use strict";
  29557. function n(e) {
  29558. this.cache = null,
  29559. this.expires = 0
  29560. }
  29561. function r() {
  29562. this.baseUrl = null,
  29563. this.cache = null,
  29564. this.expires = 0
  29565. }
  29566. function o() {
  29567. this.baseUrl = null,
  29568. this.expires = 0
  29569. }
  29570. function a(e) {
  29571. this.initialLoadingPromise = null,
  29572. this.endpoint = e + "?type=3",
  29573. this.urlContainer = null,
  29574. this.authorizationHeader = h.getAuthorizationHeader(),
  29575. this.containerClasses = [o, r, n]
  29576. }
  29577. var s = e("./ajax")
  29578. , l = e("./logger")
  29579. , c = e("../constants")
  29580. , h = e("./showcase")
  29581. , u = (e("../ab"),
  29582. new l(i));
  29583. n.prototype = {
  29584. version: 1,
  29585. validate: function(e) {
  29586. return "catalog.json"in e && Object.keys(e).length > 0
  29587. },
  29588. update: function(e) {
  29589. return this.cache = e,
  29590. this.expires = Date.now() + c.signedUrlDefaultExpireTime,
  29591. $.when()
  29592. },
  29593. get: function(e) {
  29594. return this.cache[e]
  29595. }
  29596. },
  29597. r.prototype = {
  29598. version: 2,
  29599. validate: function(e) {
  29600. return "catalog.json"in e && "base.url"in e && Object.keys(e).length > 1
  29601. },
  29602. update: function(e) {
  29603. return this.baseUrl = e["base.url"],
  29604. this.cache = e,
  29605. this.expires = Date.now() + c.signedUrlDefaultExpireTime,
  29606. $.when()
  29607. },
  29608. get: function(e) {
  29609. var t = this.cache[e];
  29610. return t ? this.baseUrl.replace("{{filename}}", e) + t : null
  29611. }
  29612. },
  29613. o.prototype = {
  29614. version: 3,
  29615. validate: function(e) {
  29616. return e.templates && e.catalog_file && (!e.expires || 1e3 * e.expires > Date.now())
  29617. },
  29618. update: function(e) {
  29619. return this.baseUrl = e.templates[0],
  29620. e.expires ? this.expires = 1e3 * e.expires : this.expires = Date.now() + c.signedUrlDefaultExpireTime,
  29621. $.when()
  29622. },
  29623. get: function(e) {
  29624. return this.baseUrl.replace("{{filename}}", e)
  29625. }
  29626. },
  29627. a.prototype = {
  29628. init: function() {
  29629. return this.initialLoadingPromise ? this.initialLoadingPromise : (setInterval(function() {
  29630. var e = this.urlContainer ? this.urlContainer.expires : Date.now();
  29631. Date.now() + c.signedUrlRefreshBuffer > e && (u.debug("Refreshing urls..."),
  29632. this.refresh().done(function() {
  29633. u.debug("Refreshed")
  29634. }).fail(function() {
  29635. u.error("Failed url refresh, urls might go stale soon")
  29636. }))
  29637. }
  29638. .bind(this), c.signedUrlCheckInterval),
  29639. this.initialLoadingPromise = this.refresh(),
  29640. this.initialLoadingPromise)
  29641. },
  29642. refresh: function(e) { //已经在someData.js里加载过了 不用再加载file了吧
  29643. e = e || {};
  29644. /*var t = void 0 === e.cache || e.cache;
  29645. return s.get( this.endpoint , { //file
  29646. responseType: "json",
  29647. prefetchFrom: t ? "files" : null,
  29648. cache: t,
  29649. auth: this.authorizationHeader
  29650. }).then(function(e) {
  29651. if (this.urlContainer && this.urlContainer.validate(e))
  29652. return this.urlContainer.update(e);
  29653. for (var i = 0; i < this.containerClasses.length; i++) {
  29654. var n = this.containerClasses[i]
  29655. , r = new n;
  29656. if (r.validate(e))
  29657. return u.info("Using urls version " + r.version),
  29658. this.urlContainer = r,
  29659. this.urlContainer.update(e)
  29660. }
  29661. return t ? this.refresh({
  29662. cache: !1
  29663. }) : $.Deferred().reject("missing-urls")
  29664. }
  29665. .bind(this), function(e) {
  29666. return "loading-failed"
  29667. }) */
  29668. return $.Deferred().resolve();
  29669. },
  29670. get: function(e) {
  29671. //return this.urlContainer.get(e)
  29672. return window.MP_PREFETCHED_MODELDATA.files.templates[0].replace("{{filename}}", e)
  29673. }
  29674. },
  29675. t.exports = a
  29676. }
  29677. ).call(this, "/js/util/ModelUrls.js")
  29678. }
  29679. , {
  29680. "../ab": 3,
  29681. "../constants": 8,
  29682. "./ajax": 181,
  29683. "./logger": 189,
  29684. "./showcase": 193
  29685. }],
  29686. 178: [function(e, t, i) {
  29687. (function(i) {
  29688. "use strict";
  29689. function n() {
  29690. u.call(this),
  29691. this.neighbourMap = {},
  29692. this.map = null
  29693. }
  29694. var r = e("three")
  29695. , o = e("./common")
  29696. , a = e("../settings")
  29697. , s = e("../objects/Panorama")
  29698. , a = e("../settings")
  29699. , l = e("./aStar")
  29700. , c = e("./logger")
  29701. , h = new c(i)
  29702. , u = e("./IndexedCollection")
  29703. , d = e("./transitions");
  29704. o.inherit(n, u),
  29705. n.prototype.getIndex = function(e) {
  29706. return e.id
  29707. }
  29708. ,
  29709. n.prototype.find = function(e, t) {
  29710. var i = o.filterAll(this.list, e);
  29711. return 0 === i.length ? null : (t && t.forEach(function(e) {
  29712. i = o.stableSort(i, e)
  29713. }),
  29714. i[0])
  29715. }
  29716. ,
  29717. n.prototype.sortByScore = function(e, t) {
  29718. var i = o.filterAll(this.list, e);
  29719. return 0 === i.length ? null : i = i.map(function(e) {
  29720. return {
  29721. pano: e,
  29722. score: t.reduce(function(t, i) {
  29723. return t + i(e)
  29724. }, 0)
  29725. }
  29726. }).sort(function(e, t) {
  29727. return t.score - e.score;
  29728. })
  29729. }
  29730. ,
  29731. n.prototype.lowestByScore = function(e, t, i) {
  29732. return this.findRankedByScore(0, e, t, i)
  29733. }
  29734. ,
  29735. n.prototype.findRankedByScore = function(e, t, i, n) {
  29736. n && (n.candidates = null,
  29737. n.pano = null),
  29738. e || (e = 0);
  29739. var r = this.sortByScore(t, i);
  29740. return !r || 0 === r.length || e >= r.length ? null : (n && (n.candidates = r,
  29741. n.pano = r[e].pano),
  29742. r[e].pano)
  29743. }
  29744. ,
  29745. n.prototype.showPanoScores = function(e) {
  29746. this.list.forEach(function(e) {
  29747. e.removeTextSprite()
  29748. });
  29749. var t = 6344768;
  29750. e.forEach(function(e) {
  29751. e.pano.addTextSprite(e.score.toFixed(2), t),
  29752. t = 16428055
  29753. })
  29754. }
  29755. ,
  29756. n.prototype.isNeighbour = function(e, t) {
  29757. return this.neighbourMap[e.id][t.id]
  29758. }
  29759. ,
  29760. n.prototype.getNeighbours = function(e) {
  29761. return this.neighbourMap[e.id]
  29762. }
  29763. ,
  29764. n.prototype.setNeighbour = function(e, t, i) {
  29765. return this.neighbourMap[e.id] || (this.neighbourMap[e.id] = {}),
  29766. this.neighbourMap[t.id] || (this.neighbourMap[t.id] = {}),
  29767. this.neighbourMap[e.id][e.id] = !0,
  29768. this.neighbourMap[t.id][t.id] = !0,
  29769. this.neighbourMap[e.id][t.id] = i,
  29770. this.neighbourMap[t.id][e.id] = i,
  29771. this.neighbourMap[e.id]
  29772. }
  29773. ,
  29774. n.prototype.findClosest = function(e, t) {
  29775. var i = [s.filters.isPanoAligned()];
  29776. return t && i.push(s.filters.inDirection(e, t, .75)),
  29777. this.find(i, [s.sortFunctions.distanceToPoint(e)])
  29778. }
  29779. ,
  29780. n.prototype.dualNeighbors = function(e, t) {
  29781. var i, n = [];
  29782. for (i in this.neighbourMap[e.id])
  29783. this.neighbourMap[t.id][i] && n.push(i);
  29784. return n
  29785. }
  29786. ,
  29787. n.prototype.populate_path_graph = function() {
  29788. 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;
  29789. for (e = 0; e < this.list.length; e += 1) {
  29790. o = this.list[e],
  29791. s = {},
  29792. l = !1,
  29793. i = o.neighbourPanos || o.findNeighourPanos();
  29794. for (t in i)
  29795. if (i[t]) {
  29796. a = this.index[t],
  29797. p.copy(o.floorPosition),
  29798. p.sub(a.floorPosition);
  29799. var m = Math.sqrt(p.x * p.x + p.z * p.z)
  29800. , v = (Math.abs(p.y) / Math.max(m, .01),
  29801. Math.max(0, Math.abs(p.y) - .2));
  29802. v > 0 ? (f += 1,
  29803. v = Math.pow(4 * v, 2),
  29804. m = Math.pow(m, 2),
  29805. n = Math.sqrt(v * v + m * m)) : (g += 1,
  29806. n = p.length()),
  29807. s[a.id] = n,
  29808. l = !0
  29809. }
  29810. l ? u[o.id] = s : d += 1
  29811. }
  29812. this.map = u,
  29813. h.info("graph ready in " + (Date.now() - c) + "ms, " + d + " had no neighbors")
  29814. }
  29815. ,
  29816. n.prototype.aStarSearch = function(e, t) {
  29817. var i = Date.now()
  29818. , n = new l({
  29819. start: e,
  29820. isEnd: function(e) {
  29821. return e === t
  29822. },
  29823. neighbor: function(e) {
  29824. var t = e.neighbourPanos || e.findNeighourPanos()
  29825. , i = [];
  29826. for (var n in t)
  29827. t[n] && i.push(this.index[n]); //add: t[n] &&
  29828. return i
  29829. }
  29830. .bind(this),
  29831. distance: function(e, t) {
  29832. var i = this.map[e.id]
  29833. , n = i[t.id];
  29834. return n
  29835. }
  29836. .bind(this),
  29837. heuristic: function(e, t) {
  29838. return 1
  29839. }
  29840. .bind(this),
  29841. hash: function(e) {
  29842. return e.id
  29843. },
  29844. timeout: 5e3
  29845. });
  29846. if (h.debug("A* search in " + (Date.now() - i) + "ms"),
  29847. "success" !== n.status)
  29848. return h.debug("Did not find A* path from " + e + " to " + t),
  29849. null;
  29850. h.debug("Total cost " + n.cost.toPrecision(3) + ", " + n.path.length + " steps");
  29851. var r = [];
  29852. return n.path.forEach(function(e) {
  29853. r.push(e.id)
  29854. }),
  29855. r
  29856. }
  29857. ,
  29858. n.prototype.includeNodesNearPath = function() {
  29859. var e = new r.Vector3
  29860. , t = new r.Vector3
  29861. , i = new r.Vector3
  29862. , n = new r.Vector3
  29863. , o = new r.Vector3
  29864. , a = new r.Vector3
  29865. , s = new r.Vector3
  29866. , l = new r.Vector3
  29867. , c = []
  29868. , h = new r.Vector3
  29869. , u = new r.Vector3;
  29870. return function(r, d) {
  29871. if (r)
  29872. for (var p = function(e, t, i) {
  29873. return o.copy(t).sub(e),
  29874. o.dot(i)
  29875. }, f = function(e, t) {
  29876. return p(h, e.position, i) - p(h, t.position, i)
  29877. }, g = 0; g < r.length - 1; ) {
  29878. var m = r[g]
  29879. , v = r[g + 1]
  29880. , A = this.index[m]
  29881. , y = this.index[v];
  29882. h.copy(A.position),
  29883. u.copy(y.position),
  29884. c.length = 0,
  29885. e.copy(u).sub(h),
  29886. i.copy(e).normalize();
  29887. for (var C = 0; C < this.list.length; C++) {
  29888. var I = this.list[C];
  29889. o.copy(I.position).sub(h);
  29890. var E = o.dot(i);
  29891. if (E > 0) {
  29892. s.copy(i),
  29893. s.multiplyScalar(E),
  29894. a.copy(o),
  29895. a.sub(s);
  29896. var b = a.length();
  29897. if (b < d) {
  29898. t.copy(e).negate(),
  29899. n.copy(t).normalize(),
  29900. l.copy(I.position).sub(u);
  29901. var w = l.dot(n);
  29902. w > 0 && c.push(I)
  29903. }
  29904. }
  29905. }
  29906. if (c.length > 0) {
  29907. c.sort(f);
  29908. for (var _ = r.length + c.length - 1; _ >= g + c.length; _--)
  29909. r[_] = r[_ - c.length];
  29910. for (var T = 0; T < c.length; T++)
  29911. r[T + g + 1] = c[T].id
  29912. }
  29913. g += c.length + 1
  29914. }
  29915. }
  29916. }(),
  29917. n.prototype.fadeMarkerOpacity = function(e, t) {
  29918. var i = void 0 === e ? a.panorama.markerOpacity : e
  29919. , n = this.list.findIndex(function(e) {
  29920. return e.marker
  29921. });
  29922. if (!(n < 0)) {
  29923. var r = this.list[n].marker.material.opacity;
  29924. if (r !== e) {
  29925. var o = i - r;
  29926. d.trigger({
  29927. func: function(e, t) {
  29928. var i = r + e * o;
  29929. this.forEach(function(e) {
  29930. e.marker && (e.marker.material.opacity = i)
  29931. })
  29932. }
  29933. .bind(this),
  29934. duration: void 0 === t ? a.markerOpacityTransitionTime : t,
  29935. name: "_fpm"
  29936. })
  29937. }
  29938. }
  29939. }
  29940. ,
  29941. t.exports = n
  29942. }
  29943. ).call(this, "/js/util/PanoramaCollection.js")
  29944. }
  29945. , {
  29946. "../objects/Panorama": 148,
  29947. "../settings": 166,
  29948. "./IndexedCollection": 175,
  29949. "./aStar": 180,
  29950. "./common": 185,
  29951. "./logger": 189,
  29952. "./transitions": 195,
  29953. three: 217
  29954. }],
  29955. 179: [function(e, t, i) {
  29956. "use strict";
  29957. function n() {
  29958. this.actionSequence = [],
  29959. this.actionSequenceInProgress = !1
  29960. }
  29961. function r(e, t, i, n) {
  29962. s.trackAlways("zoom_" + e, {
  29963. from: t,
  29964. to: i,
  29965. pano: n
  29966. })
  29967. }
  29968. function o(e, t) {
  29969. r("initial", 1, e, t)
  29970. }
  29971. function a(e, t, i) {
  29972. r("followup", e, t, i)
  29973. }
  29974. var s = e("../analytics");
  29975. n.prototype.reset = function(e) {
  29976. this.actionSequenceInProgress = !1,
  29977. this.actionSequence.length = 0
  29978. }
  29979. ,
  29980. n.prototype.addZoomAction = function() {
  29981. var e = null
  29982. , t = null
  29983. , i = !1
  29984. , n = function() {
  29985. if (e = null,
  29986. this.actionSequence.length > 0) {
  29987. var i = this.actionSequence[0].start
  29988. , n = this.actionSequence[this.actionSequence.length - 1].end;
  29989. 1 === i ? o(n, t) : a(i, n, t)
  29990. }
  29991. this.reset()
  29992. };
  29993. return function(r, o, a) {
  29994. if (r !== o) {
  29995. i || (n = n.bind(this),
  29996. i = !0),
  29997. e && (window.clearTimeout(e),
  29998. e = null),
  29999. a === t && this.actionSequenceInProgress || (this.reset(),
  30000. t = a),
  30001. this.actionSequenceInProgress = !0;
  30002. var s = {
  30003. start: r,
  30004. end: o
  30005. };
  30006. this.actionSequence.push(s),
  30007. e = window.setTimeout(n, 150)
  30008. }
  30009. }
  30010. }(),
  30011. t.exports = n
  30012. }
  30013. , {
  30014. "../analytics": 4
  30015. }],
  30016. 180: [function(e, t, i) {
  30017. "use strict";
  30018. function n(e) {
  30019. void 0 === e.timeout && (e.timeout = 1 / 0);
  30020. var t = e.hash || o
  30021. , i = {
  30022. data: e.start,
  30023. g: 0,
  30024. h: e.heuristic(e.start)
  30025. }
  30026. , n = i;
  30027. i.f = i.h;
  30028. var h = new s
  30029. , u = new l(a)
  30030. , d = c();
  30031. u.push(i),
  30032. d.set(t(i.data), i);
  30033. for (var p = new Date; u.size(); ) {
  30034. if (new Date - p > e.timeout)
  30035. return {
  30036. status: "timeout",
  30037. cost: n.g,
  30038. path: r(n)
  30039. };
  30040. var f = u.pop();
  30041. if (d.delete(t(f.data)),
  30042. e.isEnd(f.data))
  30043. return {
  30044. status: "success",
  30045. cost: f.g,
  30046. path: r(f)
  30047. };
  30048. h.add(t(f.data));
  30049. for (var g = e.neighbor(f.data), m = 0; m < g.length; m++) {
  30050. var v = g[m];
  30051. if (!h.contains(t(v))) {
  30052. var A = f.g + e.distance(f.data, v)
  30053. , y = d.get(t(v))
  30054. , C = !1;
  30055. if (void 0 === y)
  30056. y = {
  30057. data: v
  30058. },
  30059. d.set(t(v), y);
  30060. else {
  30061. if (y.g < A)
  30062. continue;
  30063. C = !0
  30064. }
  30065. y.parent = f,
  30066. y.g = A,
  30067. y.h = e.heuristic(v),
  30068. y.f = A + y.h,
  30069. y.h < n.h && (n = y),
  30070. C ? u.heapify() : u.push(y)
  30071. }
  30072. }
  30073. }
  30074. return {
  30075. status: "noPath",
  30076. cost: n.g,
  30077. path: r(n)
  30078. }
  30079. }
  30080. function r(e) {
  30081. if (void 0 !== e.parent) {
  30082. var t = r(e.parent);
  30083. return t.push(e.data),
  30084. t
  30085. }
  30086. return [e.data]
  30087. }
  30088. function o(e) {
  30089. return e.toString()
  30090. }
  30091. function a(e, t) {
  30092. return e.f - t.f
  30093. }
  30094. var s = e("Set")
  30095. , l = e("heap")
  30096. , c = e("dict");
  30097. t.exports = n
  30098. }
  30099. , {
  30100. Set: 196,
  30101. dict: 210,
  30102. heap: 211
  30103. }],
  30104. 181: [function(e, t, i) {
  30105. (function(i) {
  30106. "use strict";
  30107. function n(e, t, i) {
  30108. var n = new XMLHttpRequest;
  30109. if (i && "withCredentials"in n)
  30110. n.open(e, t, i);
  30111. else if ("undefined" != typeof XDomainRequest)
  30112. n = new XDomainRequest,
  30113. n.open(e, t);
  30114. else {
  30115. if (i)
  30116. throw "Browser does not support CORS!";
  30117. n.open(e, t)
  30118. }
  30119. return n
  30120. }
  30121. function r(e, t, i) {
  30122. function o() {
  30123. u.warn("Retrying ", t),
  30124. r(e, t, i).done(c.resolve.bind(c)).progress(c.notify.bind(c)).fail(c.reject.bind(c))
  30125. }
  30126. function a(e, t) {
  30127. var i = e.response;
  30128. if ("json" === t && "object" != typeof i)
  30129. try {
  30130. i = JSON.parse(e.responseText)
  30131. } catch (e) {
  30132. return void c.reject({
  30133. error: "Failed parsing JSON"
  30134. })
  30135. }
  30136. else if ("image/jpeg" === t) {
  30137. var n = new Uint8Array(e.response)
  30138. , r = new Blob([n],{
  30139. type: "image/jpeg"
  30140. })
  30141. , o = URL.createObjectURL(r);
  30142. i = new Image,
  30143. i.src = o,
  30144. i.crossOrigin = "Anonymous",
  30145. i.onload = function() {
  30146. URL.revokeObjectURL(o)
  30147. }
  30148. }
  30149. return i
  30150. }
  30151. var s = n(e, t, !1);
  30152. if (i = i || {},
  30153. i.retries = void 0 !== i.retries ? i.retries : 0,
  30154. i.retry = void 0 !== i.retry ? i.retry : "get" === e.toLowerCase(),
  30155. i.responseType)
  30156. if (["arraybuffer", "text", "json"].indexOf(i.responseType) > -1)
  30157. s.responseType = i.responseType;
  30158. else {
  30159. if ("image/jpeg" !== i.responseType)
  30160. throw new Error('reponseType can only be one of "arraybuffer", "text" or "json", "image/jpeg"');
  30161. s.responseType = "arraybuffer"
  30162. }
  30163. if ("json" === i.responseType && s.setRequestHeader("Accept", "application/json"),
  30164. i.auth && s.setRequestHeader("Authorization", i.auth),
  30165. "object" == typeof i.data && (i.data = JSON.stringify(i.data),
  30166. s.setRequestHeader("Content-Type", "application/json")),
  30167. "object" == typeof i.headers)
  30168. for (var l in i.headers)
  30169. s.setRequestHeader(l, i.headers[l]);
  30170. var c = $.Deferred();
  30171. return s.onreadystatechange = function(e) {
  30172. if (4 === this.readyState)
  30173. if (this.status >= 500 && this.status <= 600 && i.retry && i.retries < 3)
  30174. i.retries++,
  30175. setTimeout(o, 1e3);
  30176. else if (200 === this.status) {
  30177. var t = a(this, i.responseType);
  30178. c.resolve(t)
  30179. } else
  30180. c.reject(this)
  30181. }
  30182. ,
  30183. s.onprogress = function(e) {
  30184. c.notify(e)
  30185. }
  30186. ,
  30187. s.send(i.data),
  30188. c.promise()
  30189. }
  30190. function o(e) {
  30191. return Object.keys(e).sort().map(function(t) {
  30192. return {
  30193. key: t,
  30194. value: e[t]
  30195. }
  30196. })
  30197. }
  30198. function a(e, t) {
  30199. var i = t.responseType || null
  30200. , n = t.auth || null
  30201. , r = t.prefetchFrom || null
  30202. , a = e + "__" + i + "__" + n + "__" + r;
  30203. return t.headers && o(t.headers).forEach(function(e) {
  30204. a += "__" + e.key + ":" + e.value
  30205. }),
  30206. a
  30207. }
  30208. function s(e, t) {
  30209. return window.MP_REQUEST_CACHE ? window.MP_REQUEST_CACHE[a(e, t)] : null
  30210. }
  30211. function l(e, t, i) {
  30212. window.MP_REQUEST_CACHE && (window.MP_REQUEST_CACHE[a(e, t)] = i)
  30213. }
  30214. var c = e("./logger")
  30215. , h = e("../ab")
  30216. , u = new c(i);
  30217. window.URL = window.URL || window.webkitURL,
  30218. window.MP_REQUEST_CACHE = window.MP_REQUEST_CACHE || {},
  30219. window.MP_PREFETCHED_MODELDATA = window.MP_PREFETCHED_MODELDATA || {}
  30220. /* setTimeout(function() {//MP-- xzw delete
  30221. window.MP_REQUEST_CACHE = null,
  30222. window.MP_PREFETCHED_MODELDATA = {}
  30223. }, 6e4),
  30224. window.onpageshow = function(e) {
  30225. e.persisted && (window.MP_REQUEST_CACHE = null,
  30226. window.MP_PREFETCHED_MODELDATA = {})
  30227. } */
  30228. ,
  30229. t.exports = {
  30230. get: function(e, t) {
  30231. t = t || {};
  30232. var i = void 0 === t.cache || t.cache;
  30233. if (i) {
  30234. var n = s(e, t);
  30235. if (n)
  30236. return n
  30237. }
  30238. var o;
  30239. return o = t.prefetchFrom && window.MP_PREFETCHED_MODELDATA[t.prefetchFrom] ? $.when(window.MP_PREFETCHED_MODELDATA[t.prefetchFrom]) : r("GET", e, t),
  30240. i && l(e, t, o),
  30241. o
  30242. },
  30243. post: function(e, t) {
  30244. return r("POST", e, t)
  30245. },
  30246. patch: function(e, t) {
  30247. return r("PATCH", e, t)
  30248. },
  30249. getImage: function(e, t) {
  30250. function i() {
  30251. u.warn("Retrying ", e),
  30252. o.getImage(e, t - 1).done(n.resolve.bind(n)).progress(n.notify.bind(n)).fail(n.reject.bind(n))
  30253. }
  30254. var n = $.Deferred()
  30255. , r = new Image
  30256. , o = this;
  30257. return e = h.changeIfImageOptimzing(e),
  30258. null !== t && void 0 !== t || (t = 3),
  30259. r.onerror = function() {
  30260. t > 0 ? setTimeout(i, 1e3) : n.reject()
  30261. }
  30262. ,
  30263. r.onload = function() {
  30264. n.resolve(r)
  30265. }
  30266. ,
  30267. r.crossOrigin = "anonymous",
  30268. r.src = e,
  30269. n
  30270. }
  30271. }
  30272. }
  30273. ).call(this, "/js/util/ajax.js")
  30274. }
  30275. , {
  30276. "../ab": 3,
  30277. "./logger": 189
  30278. }],
  30279. 182: [function(e, t, i) {
  30280. "use strict";
  30281. function n(e, t) {
  30282. var i = window.navigator.userAgent
  30283. , n = i.match(e);
  30284. return n = n ? n[1].split(t) : [],
  30285. {
  30286. major: parseInt(n[0]) || 0,
  30287. minor: parseInt(n[1]) || 0,
  30288. patch: parseInt(n[2]) || 0
  30289. }
  30290. }
  30291. var r = e("../exception/DeviceMismatchException");
  30292. window.browser = t.exports = {
  30293. isFullscreen: function() {
  30294. return document.fullscreenElement || document.mozFullscreenElement || document.mozFullScreenElement || document.webkitFullscreenElement || document.msFullscreenElement
  30295. },
  30296. supportsFullscreen: function() {
  30297. return document.fullscreenEnabled || document.mozFullscreenEnabled || document.mozFullScreenEnabled || document.webkitFullscreenEnabled || document.msFullscreenEnabled
  30298. },
  30299. isPointerLocked: function() {
  30300. return document.pointerLockElement || document.mozPointerLockElement || document.webkitPointerLockElement
  30301. },
  30302. requestFullscreen: function(e, t) {
  30303. e.requestFullscreen ? e.requestFullscreen() : e.mozRequestFullScreen ? e.mozRequestFullScreen() : e.webkitRequestFullscreen ? e.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT) : e.msRequestFullscreen && e.msRequestFullscreen(),
  30304. t && $(document).on("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", browser.requestPointerLock)
  30305. },
  30306. requestPointerLock: function() {
  30307. var e;
  30308. if (document.fullscreenElement)
  30309. e = document.fullscreenElement();
  30310. else if (document.mozFullscreenElement)
  30311. e = document.mozFullscreenElement();
  30312. else if (document.mozFullScreenElement)
  30313. e = document.mozFullScreenElement();
  30314. else {
  30315. if (!document.webkitFullscreenElement)
  30316. return;
  30317. e = document.webkitFullscreenElement()
  30318. }
  30319. e.requestPointerLock = e.requestPointerLock || e.mozRequestPointerLock || e.webkitRequestPointerLock,
  30320. e.requestPointerLock(),
  30321. $(document).off("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", this)
  30322. },
  30323. exitPointerLock: function() {
  30324. document.exitPointerLock = document.exitPointerLock || document.mozExitPointerLock || document.webkitExitPointerLock,
  30325. document.exitPointerLock()
  30326. },
  30327. exitFullscreen: function() {
  30328. document.exitFullscreen ? document.exitFullscreen() : document.msExitFullscreen ? document.msExitFullscreen() : document.mozCancelFullScreen ? document.mozCancelFullScreen() : document.webkitExitFullscreen && document.webkitExitFullscreen()
  30329. },
  30330. details: function() {
  30331. var e = navigator.userAgent.match("(Firefox|Chrome|Safari)/([\\d]+)");
  30332. return e ? {
  30333. name: e[1],
  30334. version: parseInt(e[2]),
  30335. platform: navigator.platform
  30336. } : {}
  30337. },
  30338. is: function(e) {
  30339. return this.details() && this.details().name === e
  30340. },
  30341. inIframe: function() {
  30342. return window.parent !== window
  30343. },
  30344. aspectRatio: function() {
  30345. var e = $("#player").width() / $("#player").height();
  30346. return isFinite(e) ? e : 0
  30347. },
  30348. userAgent: function() {
  30349. return window.navigator.userAgent
  30350. },
  30351. isMobile: function() {
  30352. var e = navigator.userAgent || navigator.vendor || window.opera;
  30353. 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))
  30354. },
  30355. isLandscape: function() {
  30356. return this.isMobile && this.aspectRatio() > 1
  30357. },
  30358. isSmallScreen: function() {
  30359. var e = screen.width / window.devicePixelRatio;
  30360. return e < 240
  30361. },
  30362. detectIE: function() {
  30363. var e = window.navigator.userAgent
  30364. , t = e.indexOf("MSIE ");
  30365. return t !== -1 || !!navigator.userAgent.match(/Trident.*rv\:11\./)
  30366. },
  30367. detectSafari: function() {
  30368. var e = window.navigator.userAgent
  30369. , t = e.indexOf("Safari");
  30370. return t !== -1 && !this.detectChrome()
  30371. },
  30372. detectFirefox: function() {
  30373. var e = window.navigator.userAgent;
  30374. return e.indexOf("Firefox") !== -1
  30375. },
  30376. detectChrome: function() {
  30377. var e = window.navigator.userAgent;
  30378. return e.indexOf("Chrome") !== -1 && !this.detectOpera()
  30379. },
  30380. detectOpera: function() {
  30381. var e = window.navigator.userAgent;
  30382. return e.indexOf("OPR") !== -1
  30383. },
  30384. detectIOS: function() {
  30385. return this.detectIPhone() || this.detectIPad() || this.detectIPod()
  30386. },
  30387. detectIPad: function() {
  30388. var e = window.navigator.userAgent
  30389. , t = /iPad/;
  30390. return t.test(e)
  30391. },
  30392. detectIPod: function() {
  30393. var e = window.navigator.userAgent
  30394. , t = /iPod/;
  30395. return t.test(e)
  30396. },
  30397. detectIPhone: function() {
  30398. var e = window.navigator.userAgent
  30399. , t = /iPhone/;
  30400. return t.test(e)
  30401. },
  30402. detectAndroid: function() {
  30403. var e = window.navigator.userAgent;
  30404. return e.indexOf("Android") !== -1
  30405. },
  30406. detectAndroidMobile: function() {
  30407. var e = window.navigator.userAgent;
  30408. return this.detectAndroid() && e.indexOf("Mobile") !== -1
  30409. },
  30410. detectSamsungNative: function() {
  30411. var e = window.navigator.userAgent;
  30412. return e.indexOf("SM-G900H") !== -1 || e.indexOf("GT-I9500") !== -1 || e.indexOf("SM-N900") !== -1
  30413. },
  30414. detectSamsungS6: function() {
  30415. var e = window.navigator.userAgent;
  30416. return e.indexOf("SM-G92") !== -1
  30417. },
  30418. /************************************************************fyz改from徐世廷*************************************************************/
  30419. detectHUAWEI5X: function() {
  30420. return -1 !== window.navigator.userAgent.indexOf("KIW-TL00H")
  30421. },
  30422. /*******************************************************************************************************************************/
  30423. detectWebVR: function() {
  30424. return !(!window.navigator.getVRDisplays || !window.VRDisplay)
  30425. },
  30426. getVRDisplay: function() {
  30427. var e = $.Deferred();
  30428. return this.detectWebVR() ? (navigator.getVRDisplays().then(function(t) {
  30429. t.length >= 1 && e.resolve(t[0]),
  30430. e.reject(null)
  30431. }),
  30432. e) : e.reject(null)
  30433. },
  30434. iosVersion: function() {
  30435. if (!this.detectIOS())
  30436. throw new r("Did not detect an iDevice");
  30437. var e = /((?:\d+\_?){1,3}) like Mac OS/
  30438. , t = "_";
  30439. return n(e, t)
  30440. },
  30441. androidVersion: function() {
  30442. if (!this.detectAndroid())
  30443. throw new r("Did not detect an Android based device");
  30444. var e = /Android ((?:\d+\.?){1,3})/
  30445. , t = ".";
  30446. return n(e, t)
  30447. },
  30448. valueFromCookie: function(e, t) {
  30449. var i = new RegExp(e + "=([0-9a-f]+)(; ?|$)").exec(document.cookie);
  30450. if (!i)
  30451. return t;
  30452. var n = i[1];
  30453. return "boolean" == typeof t ? "true" === n || "1" === n : "number" == typeof t ? parseFloat(n) : n
  30454. },
  30455. valueFromHash: function(e, t) {
  30456. var i = new RegExp("[#&?]" + e + "=([^#&?]*)")
  30457. , n = i.exec(window.location.href);
  30458. if (!n)
  30459. return t;
  30460. var r = n[1];
  30461. return "boolean" == typeof t ? "true" === r || "1" === r : "number" == typeof t ? parseFloat(r) : window.decodeURIComponent(r)
  30462. }
  30463. }
  30464. //changeLog()
  30465. }
  30466. , {
  30467. "../exception/DeviceMismatchException": 56
  30468. }],
  30469. 183: [function(e, t, i) {
  30470. (function(i) {
  30471. "use strict";
  30472. function n(e, t) {
  30473. var i = r(t);
  30474. var replaceAll = function (str, f, e) {
  30475. //f全部替换成e
  30476. var reg = new RegExp(f, "g"); //创建正则RegExp对象
  30477. return str.replace(reg, e);
  30478. };
  30479. var urlFirstView = c.valueFromHash('firstView');
  30480. if(urlFirstView){
  30481. try{
  30482. urlFirstView = replaceAll(urlFirstView, "pano:", '"pano":"')
  30483. urlFirstView = replaceAll(urlFirstView, ",qua:", '","qua":[')
  30484. urlFirstView = "{"+urlFirstView+"]}"
  30485. let info = JSON.parse(urlFirstView);
  30486. i.pano = t.index[info.pano] //panos.get(info.pano)
  30487. if(!i.pano){
  30488. urlFirstView = false
  30489. console.error('检测到firstView但是 找不到该pano')
  30490. }else{
  30491. i.quaternion = new THREE.Quaternion().fromArray(info.qua)
  30492. i.zoom = -1;
  30493. i.mode = "panorama"
  30494. i.setByUrl = true
  30495. }
  30496. }catch(e){
  30497. urlFirstView = false
  30498. console.error('检测到firstView但是解析出错'+e)
  30499. }
  30500. }
  30501. if (Object.keys(i).length > 0)
  30502. return i;
  30503. if (e.heroImage)
  30504. i = o(e, t);
  30505. else if (window.MP_PREFETCHED_MODELDATA.camera_start) {
  30506. var n = window.MP_PREFETCHED_MODELDATA.camera_start;
  30507. try {
  30508. Object.keys(n).length > 0 && !l.isEmptyQuaternion(n.camera.quaternion) && (i.mode = h.convertWorkshopModeInt(n.mode),
  30509. i.position = n.camera.position,
  30510. //i.quaternion = n.camera.quaternion,
  30511. i.quaternion = new th.Quaternion().fromArray(n.camera.quaternion),//xzw
  30512. i.zoom = l.convertWorkshopOrthoZoom(n.camera.zoom),
  30513. n.pano && (i.pano = t.get(n.pano.uuid) || t.findClosest(i.position),
  30514. d.debug("Using camera_start"),
  30515. d.debug("Modeldata pano: ", i.pano.quaternion),
  30516. d.debug("Camera start pano: ", n.pano.quaternion)),
  30517. i.mode !== h.PANORAMA && (i.floorVisibility = e.heroImage.metadata.floor_visibility))
  30518. } catch (e) {
  30519. d.warn(e.message)
  30520. if(i.mode == "panorama" && !i.pano)i.pano = t.list[0]
  30521. }
  30522. }
  30523. if (e.outsideAllowed() || i.mode === h.PANORAMA || (i = {}),
  30524. i.mode === h.MESH && i.position && (i.mode = h.PANORAMA,
  30525. i.pano = t.findClosest(i.position),
  30526. i.quaternion = i.pano.quaternion),
  30527. 0 === Object.keys(i).length) {
  30528. var a = t.list[0];
  30529. a && (i.mode = h.PANORAMA,
  30530. i.pano = a,
  30531. i.position = a.position,
  30532. i.quaternion = a.quaternion,
  30533. d.info("Starting at 1st pano " + a.id))
  30534. }
  30535. return i.mode = i.mode || h.DOLLHOUSE,
  30536. i
  30537. }
  30538. function r(e) {
  30539. var t = c.valueFromHash("start", "")
  30540. , i = {};
  30541. if ("" !== t) {
  30542. d.debug("Start override found in parameters, trying to parse..."),
  30543. i = a(t) || {};
  30544. var n = c.valueFromHash("tag", null);
  30545. n && (i.tag = n),
  30546. i.panoId && (i.pano = e.get(i.panoId))
  30547. }
  30548. return i
  30549. }
  30550. function o(e, t) {
  30551. if (!e.heroImage || !e.heroImage.metadata.camera_position)
  30552. return {};
  30553. var i = {}
  30554. , n = e.heroImage.metadata;
  30555. d.debug("Using start position from thumbnail image"),
  30556. i.position = n.camera_position,
  30557. i.quaternion = n.camera_quaternion;
  30558. try {
  30559. i.mode = h.convertWorkshopModeInt(n.camera_mode),
  30560. i.mode === h.PANORAMA ? i.pano = t.get(n.scan_id) : i.floorVisibility = n.floor_visibility
  30561. } catch (e) {
  30562. d.debug(e.message)
  30563. }
  30564. return i
  30565. }
  30566. function a(e) {
  30567. return s.deserialize(e)
  30568. }
  30569. var s = e("../controls/serializer")
  30570. , l = e("../util/math")
  30571. , c = e("./browser")
  30572. , h = e("../enum/Viewmode")
  30573. , u = e("../util/logger")
  30574. , th = e("three")//xzw
  30575. , d = new u(i);
  30576. t.exports = {
  30577. getStartCameraOptions: n
  30578. }
  30579. }
  30580. ).call(this, "/js/util/camera.js")
  30581. }
  30582. , {
  30583. "../controls/serializer": 14,
  30584. "../enum/Viewmode": 51,
  30585. "../util/logger": 189,
  30586. "../util/math": 190,
  30587. "./browser": 182,
  30588. "three": 217
  30589. }],
  30590. 184: [function(e, t, i) {
  30591. "use strict";
  30592. function n(e, t, i) {
  30593. return o(e.fov, t, i)
  30594. }
  30595. var r = e("./MathLight")
  30596. , o = function(e, t, i) {
  30597. var n = t
  30598. , o = i
  30599. , a = 2 * Math.atan(Math.tan(e * r.RADIANS_PER_DEGREE / 2) * (n / o)) * r.DEGREES_PER_RADIAN;
  30600. return a
  30601. }
  30602. , a = function(e, t, i) {
  30603. var n = t
  30604. , o = i
  30605. , a = 2 * Math.atan(Math.tan(e * r.RADIANS_PER_DEGREE / 2) * (o / n)) * r.DEGREES_PER_RADIAN;
  30606. return a
  30607. }
  30608. , s = function(e, t, i, n) {
  30609. var r = o(e, i, n);
  30610. return r > t ? a(t, i, n) : e
  30611. };
  30612. t.exports = {
  30613. clampVFOV: s,
  30614. getHFOVForCamera: n,
  30615. getHFOVFromVFOV: o,
  30616. getVFOVFromHFOV: a
  30617. }
  30618. window.MathLight = t.exports
  30619. }
  30620. , {
  30621. "./MathLight": 176
  30622. }],
  30623. 185: [function(e, t, i) {
  30624. "use strict";
  30625. var n = e("three");
  30626. t.exports = {
  30627. delayOneFrame: function(e) {
  30628. window.setTimeout(e, 1)
  30629. },
  30630. normalizeUrl: function(e) {
  30631. return e.replace("https://", "http://")
  30632. },
  30633. domainFromUrl: function(e) {
  30634. var t = /^([^:]*:\/\/)?(www\.)?([^\/]+)/.exec(e);
  30635. return t ? t[3] : e
  30636. },
  30637. average: function(e, t) {
  30638. if (0 === e.length)
  30639. return null;
  30640. for (var i = 0, n = 0, r = 0; r < e.length; r++) {
  30641. var o = t ? e[r][t] : e[r];
  30642. i += o,
  30643. n++
  30644. }
  30645. return i / n
  30646. },
  30647. countUnique: function(e) {
  30648. for (var t = {}, i = 0; i < e.length; i++)
  30649. t[e[i]] = 1 + (t[e[i]] || 0);
  30650. return Object.keys(t).length
  30651. },
  30652. averageVectors: function(e, t) {
  30653. var i = new n.Vector3;
  30654. if (0 === e.length)
  30655. return i;
  30656. for (var r = 0, o = 0; o < e.length; o++) {
  30657. var a = t ? e[o][t] : e[o];
  30658. i.add(a),
  30659. r++
  30660. }
  30661. return i.divideScalar(r)
  30662. },
  30663. equalLists: function(e, t) {
  30664. if (e.length !== t.length)
  30665. return !1;
  30666. for (var i = 0; i < e.length; i++)
  30667. if (e[i] !== t[i])
  30668. return !1;
  30669. return !0
  30670. },
  30671. lowerMedian: function(e, t) {
  30672. if (0 === e.length)
  30673. return null;
  30674. t = t || 2,
  30675. e.sort(function(e, t) {
  30676. return e - t
  30677. });
  30678. var i = Math.floor(e.length / t);
  30679. return e[i]
  30680. },
  30681. stableSort: function(e, t) {
  30682. return e.map(function(e, t) {
  30683. return {
  30684. value: e,
  30685. index: t
  30686. }
  30687. }).sort(function(e, i) {
  30688. var n = t(e.value, i.value);
  30689. return 0 !== n ? n : e.index - i.index
  30690. }).map(function(e) {
  30691. return e.value
  30692. })
  30693. },
  30694. filterAll: function(e, t) {
  30695. return e.filter(function(e) {
  30696. return t.every(function(t) {
  30697. return t(e)
  30698. })
  30699. })
  30700. },
  30701. formatDate: function(e) {
  30702. return [e.getFullYear(), e.getMonth() + 1, e.getDate()].join("-")
  30703. },
  30704. formatDatetime: function(e) {
  30705. return [e.getFullYear(), e.getMonth() + 1, e.getDate(), e.getHours(), e.getMinutes()].join("-")
  30706. },
  30707. randomString: function(e) {
  30708. for (var t = "", i = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", n = 0; n < e; n++)
  30709. t += i.charAt(Math.floor(Math.random() * i.length));
  30710. return t
  30711. },
  30712. uint8ToBase64: function(e, t) {
  30713. t && "number" == typeof t || (t = 8192);
  30714. for (var i = [], n = 0; n < e.length; n += t)
  30715. i.push(String.fromCharCode.apply(null, e.subarray(n, n + t)));
  30716. return btoa(i.join(""))
  30717. },
  30718. uuid4: function e(t) {
  30719. return t ? (t ^ 16 * Math.random() >> t / 4).toString(16) : ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, e)
  30720. },
  30721. nth: function(e) {
  30722. return e %= 10,
  30723. 1 === e ? e + "st" : 2 === e ? e + "nd" : 3 === e ? e + "rd" : e + "th"
  30724. },
  30725. extendObject: function(e, t) {
  30726. return Object.keys(t).forEach(function(i) {
  30727. e[i] = t[i]
  30728. }),
  30729. e
  30730. },
  30731. deepExtend: function e(t) {
  30732. t = t || {};
  30733. for (var i = 1; i < arguments.length; i++) {
  30734. var n = arguments[i];
  30735. if (n)
  30736. for (var r in n)
  30737. n.hasOwnProperty(r) && ("object" == typeof n[r] ? t[r] = e(t[r], n[r]) : t[r] = n[r])
  30738. }
  30739. return t
  30740. },
  30741. inherit: function(e, t) {
  30742. e.prototype = Object.create(t.prototype),
  30743. e.prototype.constructor = e
  30744. },
  30745. extend: function(e, t) {
  30746. for (var i in t.prototype)
  30747. e.prototype[i] = t.prototype[i]
  30748. }
  30749. ,
  30750. getVisiblePano : function(positions = [], options={}){//add
  30751. var visiblePanos = [];
  30752. var panos = options.panos || player.model.panos.list;
  30753. options.posAtPanos = options.posAtPanos || {}//在不同漫游点的positions
  30754. panos.forEach((pano)=>{
  30755. if(!pano.isAligned())return;
  30756. var A = pano.position.clone();
  30757. var posB = options.posAtPanos[pano.id] || positions;
  30758. var posLength = posB.length
  30759. for(let i=0;i<posLength;i++){
  30760. var B = posB[i];
  30761. var ray = new THREE.Raycaster(A.clone(), B.clone().sub(A).normalize(), 0, A.distanceTo(B) - (options.tolerance||0) )
  30762. var o = ray.intersectObjects(options.model || player.model.colliders, true);
  30763. if (!o || !o.length){ //只要有一点可见,就算整体可见
  30764. visiblePanos.push(pano );
  30765. break;
  30766. }
  30767. }
  30768. })
  30769. return visiblePanos
  30770. }
  30771. ,
  30772. sortByScore : function(list, request, rank) {
  30773. var i = this.filterAll(list, request);
  30774. return 0 === i.length ? null : i = i.map(function(e) {
  30775. return {
  30776. item: e,
  30777. score: rank.reduce(function(t, i) {
  30778. return t + i(e);
  30779. }, 0)
  30780. };
  30781. }).sort(function(e, t) {
  30782. return t.score - e.score;
  30783. });
  30784. }
  30785. },
  30786. Math.sign = function(e) {
  30787. return e < 0 ? -1 : 1
  30788. }
  30789. window.common = t.exports
  30790. }
  30791. , {
  30792. three: 217
  30793. }],
  30794. 186: [function(e, t, i) {
  30795. "use strict";
  30796. var n = {};
  30797. n.linearTween = function(e, t, i, n) {
  30798. return i * e / n + t
  30799. }
  30800. ,
  30801. n.easeInQuad = function(e, t, i, n) {
  30802. return e /= n,
  30803. i * e * e + t
  30804. }
  30805. ,
  30806. n.easeOutQuad = function(e, t, i, n) {
  30807. return e /= n,
  30808. -i * e * (e - 2) + t
  30809. }
  30810. ,
  30811. n.easeInOutQuad = function(e, t, i, n) {
  30812. return e /= n / 2,
  30813. e < 1 ? i / 2 * e * e + t : (e--,
  30814. -i / 2 * (e * (e - 2) - 1) + t)
  30815. }
  30816. ,
  30817. n.easeInCubic = function(e, t, i, n) {
  30818. return e /= n,
  30819. i * e * e * e + t
  30820. }
  30821. ,
  30822. n.easeOutCubic = function(e, t, i, n) {
  30823. return e /= n,
  30824. e--,
  30825. i * (e * e * e + 1) + t
  30826. }
  30827. ,
  30828. n.easeInOutCubic = function(e, t, i, n) {
  30829. return e /= n / 2,
  30830. e < 1 ? i / 2 * e * e * e + t : (e -= 2,
  30831. i / 2 * (e * e * e + 2) + t)
  30832. }
  30833. ,
  30834. n.easeInQuart = function(e, t, i, n) {
  30835. return e /= n,
  30836. i * e * e * e * e + t
  30837. }
  30838. ,
  30839. n.easeOutQuart = function(e, t, i, n) {
  30840. return e /= n,
  30841. e--,
  30842. -i * (e * e * e * e - 1) + t
  30843. }
  30844. ,
  30845. n.easeInOutQuart = function(e, t, i, n) {
  30846. return e /= n / 2,
  30847. e < 1 ? i / 2 * e * e * e * e + t : (e -= 2,
  30848. -i / 2 * (e * e * e * e - 2) + t)
  30849. }
  30850. ,
  30851. n.easeInQuint = function(e, t, i, n) {
  30852. return e /= n,
  30853. i * e * e * e * e * e + t
  30854. }
  30855. ,
  30856. n.easeOutQuint = function(e, t, i, n) {
  30857. return e /= n,
  30858. e--,
  30859. i * (e * e * e * e * e + 1) + t
  30860. }
  30861. ,
  30862. n.easeInOutQuint = function(e, t, i, n) {
  30863. return e /= n / 2,
  30864. e < 1 ? i / 2 * e * e * e * e * e + t : (e -= 2,
  30865. i / 2 * (e * e * e * e * e + 2) + t)
  30866. }
  30867. ,
  30868. n.easeInSine = function(e, t, i, n) {
  30869. return -i * Math.cos(e / n * (Math.PI / 2)) + i + t
  30870. }
  30871. ,
  30872. n.easeOutSine = function(e, t, i, n) {
  30873. return i * Math.sin(e / n * (Math.PI / 2)) + t
  30874. }
  30875. ,
  30876. n.easeInOutSine = function(e, t, i, n) {
  30877. return -i / 2 * (Math.cos(Math.PI * e / n) - 1) + t
  30878. }
  30879. ,
  30880. n.easeInExpo = function(e, t, i, n) {
  30881. return i * Math.pow(2, 10 * (e / n - 1)) + t
  30882. }
  30883. ,
  30884. n.easeOutExpo = function(e, t, i, n) {
  30885. return i * (-Math.pow(2, -10 * e / n) + 1) + t
  30886. }
  30887. ,
  30888. n.easeInOutExpo = function(e, t, i, n) {
  30889. return e /= n / 2,
  30890. e < 1 ? i / 2 * Math.pow(2, 10 * (e - 1)) + t : (e--,
  30891. i / 2 * (-Math.pow(2, -10 * e) + 2) + t)
  30892. }
  30893. ,
  30894. n.easeInCirc = function(e, t, i, n) {
  30895. return e /= n,
  30896. -i * (Math.sqrt(1 - e * e) - 1) + t
  30897. }
  30898. ,
  30899. n.easeOutCirc = function(e, t, i, n) {
  30900. return e /= n,
  30901. e--,
  30902. i * Math.sqrt(1 - e * e) + t
  30903. }
  30904. ,
  30905. n.easeInOutCirc = function(e, t, i, n) {
  30906. return e /= n / 2,
  30907. e < 1 ? -i / 2 * (Math.sqrt(1 - e * e) - 1) + t : (e -= 2,
  30908. i / 2 * (Math.sqrt(1 - e * e) + 1) + t)
  30909. }
  30910. ,
  30911. n.easeInElastic = function(e, t, i, n) {
  30912. var r = 1.70158
  30913. , o = 0
  30914. , a = i;
  30915. return 0 === e ? t : 1 === (e /= n) ? t + i : (o || (o = .3 * n),
  30916. a < Math.abs(i) ? (a = i,
  30917. r = o / 4) : r = o / (2 * Math.PI) * Math.asin(i / a),
  30918. -(a * Math.pow(2, 10 * (e -= 1)) * Math.sin((e * n - r) * (2 * Math.PI) / o)) + t)
  30919. }
  30920. ,
  30921. n.easeOutElastic = function(e, t, i, n) {
  30922. var r = 1.70158
  30923. , o = 0
  30924. , a = i;
  30925. return 0 === e ? t : 1 === (e /= n) ? t + i : (o || (o = .3 * n),
  30926. a < Math.abs(i) ? (a = i,
  30927. r = o / 4) : r = o / (2 * Math.PI) * Math.asin(i / a),
  30928. a * Math.pow(2, -10 * e) * Math.sin((e * n - r) * (2 * Math.PI) / o) + i + t)
  30929. }
  30930. ,
  30931. n.easeInOutElastic = function(e, t, i, n) {
  30932. var r = 1.70158
  30933. , o = 0
  30934. , a = i;
  30935. return 0 === e ? t : 2 === (e /= n / 2) ? t + i : (o || (o = n * (.3 * 1.5)),
  30936. a < Math.abs(i) ? (a = i,
  30937. r = o / 4) : r = o / (2 * Math.PI) * Math.asin(i / a),
  30938. 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)
  30939. }
  30940. ,
  30941. n.easeInBack = function(e, t, i, n, r) {
  30942. return void 0 === r && (r = 1.70158),
  30943. i * (e /= n) * e * ((r + 1) * e - r) + t
  30944. }
  30945. ,
  30946. n.easeOutBack = function(e, t, i, n, r) {
  30947. return void 0 === r && (r = 1.70158),
  30948. i * ((e = e / n - 1) * e * ((r + 1) * e + r) + 1) + t
  30949. }
  30950. ,
  30951. n.easeInOutBack = function(e, t, i, n, r) {
  30952. return void 0 === r && (r = 1.70158),
  30953. (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
  30954. }
  30955. ,
  30956. n.easeOutBounce = function(e, t, i, n) {
  30957. 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
  30958. }
  30959. ,
  30960. n.easeInBounce = function(e, t, i, r) {
  30961. return i - n.easeOutBounce(r - e, 0, i, r) + t
  30962. }
  30963. ,
  30964. n.easeInOutBounce = function(e, t, i, r) {
  30965. 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
  30966. }
  30967. ,
  30968. t.exports = n
  30969. window.easing = n
  30970. }
  30971. , {}],
  30972. 187: [function(e, t, i) {
  30973. "use strict";
  30974. function n() {
  30975. this.events = [],
  30976. this.valid = !1
  30977. }
  30978. var r = e("../enum/Joystick");
  30979. n.prototype.push = function(e, t) {
  30980. this.events.push({
  30981. direction: e,
  30982. pano: t
  30983. }),
  30984. this.valid = !0
  30985. }
  30986. ,
  30987. n.prototype.pop = function(e) {
  30988. var t = this.events.pop();
  30989. return this.events.length < 1 && (this.valid = !1),
  30990. t
  30991. }
  30992. ,
  30993. n.prototype.peek = function() {
  30994. return this.events.length ? this.events[this.events.length - 1] : {
  30995. direction: null,
  30996. pano: null
  30997. }
  30998. }
  30999. ,
  31000. n.prototype.invalidate = function() {
  31001. this.events = [],
  31002. this.valid = !1
  31003. }
  31004. ,
  31005. n.prototype.reversePano = function(e) {
  31006. if (!this.valid)
  31007. return null;
  31008. var t = this.peek();
  31009. return r.opposite(e) === t.direction ? (this.pop(),
  31010. t.pano) : null
  31011. }
  31012. ,
  31013. t.exports = n
  31014. }
  31015. , {
  31016. "../enum/Joystick": 29
  31017. }],
  31018. 188: [function(e, t, i) {
  31019. "use strict";
  31020. window.lerp = t.exports = {
  31021. vector: function(e, t) {
  31022. var i = e.clone();
  31023. return t = t.clone(),
  31024. function(n) {
  31025. e.set(i.x * (1 - n) + t.x * n, i.y * (1 - n) + t.y * n, i.z * (1 - n) + t.z * n)
  31026. }
  31027. },
  31028. quaternion: function(e, t) {
  31029. var i = e.clone();
  31030. return function(n) {
  31031. e.copy(i).slerp(t, n)
  31032. }
  31033. },
  31034. property: function(e, t, i, n) {
  31035. var r = e[t];
  31036. return function(o) {
  31037. e[t] = r * (1 - o) + i * o,
  31038. n && n(e[t])
  31039. }
  31040. },
  31041. uniform: function(e, t, i) {
  31042. var n = e.material.uniforms[t].value;
  31043. return function(r) {
  31044. e.material.uniforms[t] && (e.material.uniforms[t].value = n * (1 - r) + i * r)
  31045. }
  31046. },
  31047. matrix4: function(e, t) {
  31048. var i = e.clone();
  31049. return function(n) {
  31050. for (var r = e.elements, o = i.elements, a = t.elements, s = 0; s < 16; s++)
  31051. r[s] = o[s] * (1 - n) + a[s] * n
  31052. }
  31053. },
  31054. allUniforms: function(e, t, i) {
  31055. var n = e.map(function(e) {
  31056. return this.uniform(e, t, i)
  31057. }
  31058. .bind(this));
  31059. return function(e) {
  31060. n.forEach(function(t) {
  31061. t(e)
  31062. })
  31063. }
  31064. }
  31065. }
  31066. }
  31067. , {}],
  31068. 189: [function(e, t, i) {
  31069. "use strict";
  31070. function n(e) {
  31071. var t, i, o, a, s = e.split("/"), l = "[" + s[s.length - 1].replace(".js", "") + "]", c = {};
  31072. if (n.consoleEnabled) {
  31073. var h = function(e) {
  31074. $("#debug-console").append("<p>" + e + "</p>"),
  31075. $("#debug-console")[0].scrollTop = $("#debug-console")[0].scrollHeight
  31076. };
  31077. t = function(e) {
  31078. h(Array.prototype.slice.call(arguments).join(" "))
  31079. }
  31080. ,
  31081. i = function(e) {
  31082. h(Array.prototype.slice.call(arguments).join(" "))
  31083. }
  31084. ,
  31085. o = function(e) {
  31086. h("WARN: " + Array.prototype.slice.call(arguments).join(" "))
  31087. }
  31088. ,
  31089. a = function(e) {
  31090. h("ERROR: " + Array.prototype.slice.call(arguments).join(" "))
  31091. }
  31092. } else
  31093. console.log ? (t = console.log,
  31094. i = console.info ? console.info : console.log,
  31095. o = console.warn ? console.warn : console.log,
  31096. a = console.error ? console.error : console.log) : t = i = o = a = function() {}
  31097. ;
  31098. var u = function(e) {
  31099. return [l, n.timestamp()].concat(Array.prototype.slice.call(e))
  31100. }
  31101. , d = function(t, i) {
  31102. if (r) {
  31103. var o = Array.prototype.slice.call(t).join(" ");
  31104. r.captureMessage(o, {
  31105. level: i,
  31106. path: e,
  31107. timestamp: n.timestamp()
  31108. })
  31109. }
  31110. }
  31111. , p = function(t, i) {
  31112. if (r) {
  31113. var o = Array.prototype.slice.call(t).join(" ");
  31114. r.captureException(new Error(o), {
  31115. level: i,
  31116. path: e,
  31117. timestamp: n.timestamp()
  31118. })
  31119. }
  31120. };
  31121. return {
  31122. debug: function() {
  31123. n.level >= n.levels.debug && t.apply(console, u(arguments))
  31124. },
  31125. info: function() {
  31126. n.level >= n.levels.info && i.apply(console, u(arguments))
  31127. },
  31128. warn: function() {
  31129. d(arguments, "warn"),
  31130. n.level >= n.levels.warn && o.apply(console, u(arguments))
  31131. },
  31132. error: function() {
  31133. p(arguments, "error"),
  31134. n.level >= n.levels.error && a.apply(console, u(arguments))
  31135. },
  31136. v3str: function(e, t) {
  31137. var i = void 0 === t ? 2 : t;
  31138. return "(" + e.x.toPrecision(i) + ", " + e.y.toPrecision(i) + ", " + e.z.toPrecision(i) + ")"
  31139. },
  31140. eulstr: function(e, t) {
  31141. var i = void 0 === t ? 2 : t;
  31142. return "(" + THREE.Math.radToDeg(e.x).toPrecision(i) + ", " + THREE.Math.radToDeg(e.y).toPrecision(i) + ", " + THREE.Math.radToDeg(e.z).toPrecision(i) + ' "' + e.order + '")'
  31143. },
  31144. time: function(e) {
  31145. n.level >= n.levels.debug && (c[e] = Date.now())
  31146. },
  31147. timeEnd: function(e) {
  31148. if (n.level >= n.levels.debug) {
  31149. var t = c[e];
  31150. if (!t)
  31151. return;
  31152. var i = (Date.now() - t) / 1e3;
  31153. this.debug(e, i + "s")
  31154. }
  31155. }
  31156. }
  31157. }
  31158. var r = window.Raven;
  31159. n.timestamp = function() {
  31160. return (Date.now() - window.navigationStart) / 1e3 + "s"
  31161. }
  31162. ,
  31163. n.levels = {
  31164. debug: 3,
  31165. info: 2,
  31166. warn: 1,
  31167. error: 0
  31168. },
  31169. n.level = n.levels.info,
  31170. t.exports = n
  31171. }
  31172. , {}],
  31173. 190: [function(e, t, i) {
  31174. "use strict";
  31175. var n = e("three")
  31176. , r = e("../enum/GLCubeFaces")
  31177. , o = e("../constants");
  31178. t.exports = {
  31179. convertVisionVector: function(e) {
  31180. return new n.Vector3(e.x,e.z,-e.y)
  31181. },
  31182. convertVisionQuaternion: function(e) {
  31183. 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)))
  31184. },
  31185. convertWorkshopVector: function(e) {
  31186. return new n.Vector3(-e.x,e.y,e.z)
  31187. },
  31188. convertWorkshopQuaternion: function(e) {
  31189. 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))
  31190. },
  31191. convertWorkshopPanoramaQuaternion: function(e) {
  31192. 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)))
  31193. },
  31194. convertWorkshopOrthoZoom: function(e) {// xzw
  31195. //return e === -1 ? -1 : e / 16 * ($("#player").width() / $("#player").height()) / o.workshopApsect
  31196. //return e;
  31197. return e === -1 ? -1 : e * ($("#player").width() / $("#player").height()) / g_snapShotWidth * g_snapShotHeight;
  31198. },
  31199. toPrecision: function(e, t) {//xzw change
  31200. var f = function(e, t){
  31201. var i = Math.pow(10, t);
  31202. return Math.round(e * i) / i
  31203. }
  31204. if(e instanceof Array){
  31205. for(var s=0; s<e.length; s++){
  31206. e[s] = f(e[s],t);
  31207. }
  31208. return e;
  31209. }
  31210. else return f(e,t)
  31211. },
  31212. isEmptyQuaternion: function(e) {
  31213. return 0 === Math.abs(e.x) && 0 === Math.abs(e.y) && 0 === Math.abs(e.z) && 0 === Math.abs(e.w)
  31214. },
  31215. projectPositionToCanvas: function(e, t, i) {
  31216. i = i || new n.Vector3,
  31217. i.copy(e);
  31218. var r = .5 * $("#player").width()
  31219. , o = .5 * $("#player").height();
  31220. return i.project(t),
  31221. i.x = i.x * r + r,
  31222. i.y = -(i.y * o) + o,
  31223. i
  31224. },
  31225. convertScreenPositionToNDC: function(e, t, i) {
  31226. return i = i || new n.Vector2,
  31227. i.x = e / $("#player").width() * 2 - 1,
  31228. i.y = 2 * -(t / $("#player").height()) + 1,
  31229. i
  31230. },
  31231. constrainedTurn: function(e) {
  31232. var t = e % (2 * Math.PI);
  31233. return t = t > Math.PI ? t -= 2 * Math.PI : t < -Math.PI ? t += 2 * Math.PI : t
  31234. },
  31235. getFOVDotThreshold: function(e) {
  31236. return Math.cos(n.Math.degToRad(e / 2))
  31237. },
  31238. transform2DForwardVectorByCubeFace: function(e, t, i, n) {
  31239. switch (e) {
  31240. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  31241. i.set(1, t.y, t.x);
  31242. break;
  31243. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  31244. i.set(-1, t.y, -t.x);
  31245. break;
  31246. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  31247. i.set(-t.x, 1, -t.y);
  31248. break;
  31249. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  31250. i.set(-t.x, -1, t.y);
  31251. break;
  31252. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  31253. i.set(-t.x, t.y, 1);
  31254. break;
  31255. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  31256. i.set(t.x, t.y, -1)
  31257. }
  31258. n && i.normalize()
  31259. },
  31260. //add:
  31261. getPos2d : function(point, camera, dom){
  31262. var camera = camera ;
  31263. var dom = dom;
  31264. 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);
  31265. var x,y;
  31266. x = (pos.x + 1) / 2 * dom.clientWidth;
  31267. y = (1 - (pos.y + 1) / 2) * dom.clientHeight;
  31268. var inSight = x <= dom.clientWidth && x >= 0
  31269. && y <= dom.clientHeight && y >= 0
  31270. return {
  31271. pos: new THREE.Vector2(x,y),
  31272. vector: pos,
  31273. trueSide : pos.z<1, //trueSide为false时,即使在屏幕范围内可见,也是反方向的另一个不可以被渲染的点 参见Tag.update
  31274. inSight : inSight //在屏幕范围内可见
  31275. };
  31276. }
  31277. }
  31278. window.math = t.exports
  31279. }
  31280. , {
  31281. "../constants": 8,
  31282. "../enum/GLCubeFaces": 25,
  31283. three: 217
  31284. }],
  31285. 191: [function(e, t, i) {
  31286. "use strict";
  31287. function n(e, t, i) {
  31288. return a.map(function(n, o) {
  31289. return e.get("pan/" + i + "/" + t + "_skybox" + r(n) + ".jpg")
  31290. }
  31291. .bind(this))
  31292. }
  31293. function r(e) {
  31294. return s[e]
  31295. }
  31296. var o = e("../enum/GLCubeFaces")
  31297. , a = [0, 1, 2, 3, 4, 5]
  31298. , s = {
  31299. 0: o.GL_TEXTURE_CUBE_MAP_POSITIVE_Y,
  31300. 1: o.GL_TEXTURE_CUBE_MAP_POSITIVE_Z,
  31301. 2: o.GL_TEXTURE_CUBE_MAP_POSITIVE_X,
  31302. 3: o.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,
  31303. 4: o.GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
  31304. 5: o.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
  31305. };
  31306. t.exports = {
  31307. mapFaceToCubemapFace: r,
  31308. getCubemapUrls: n
  31309. }
  31310. }
  31311. , {
  31312. "../enum/GLCubeFaces": 25
  31313. }],
  31314. 192: [function(e, t, i) {
  31315. "use strict";
  31316. t.exports = {
  31317. captureErrors: function(e, t, i) {
  31318. if ("Raven"in window) {
  31319. Raven.config(e, t).install(),
  31320. i && Raven.setTagsContext(i);
  31321. var n = console.warn
  31322. , r = console.error;
  31323. console.warn = function() {
  31324. var e = Array.prototype.slice.call(arguments);
  31325. Raven.captureMessage(e.join(" "), {
  31326. level: "warning"
  31327. }),
  31328. n.apply(console, e)
  31329. }
  31330. ,
  31331. console.error = function() {
  31332. var e = Array.prototype.slice.call(arguments);
  31333. Raven.captureException(new Error(e.join(" ")), {
  31334. level: "error"
  31335. }),
  31336. r.apply(console, e)
  31337. }
  31338. } else
  31339. console.error("Raven not found, not capturing errors.")
  31340. }
  31341. }
  31342. }
  31343. , {}],
  31344. 193: [function(e, t, i) {
  31345. (function(i) {
  31346. "use strict";
  31347. var n = e("./browser")
  31348. , r = e("../constants")
  31349. , o = e("url")
  31350. , a = e("./logger")
  31351. , ss = e('three')
  31352. , s = new a(i)
  31353. , l = {
  31354. getAuthorizationHeader: function() {
  31355. var e = n.valueFromHash("auth");
  31356. if (e)
  31357. return e.replace(",", " ");
  31358. var t = n.valueFromCookie("token");
  31359. return t ? "Token " + t : null
  31360. },
  31361. parseSidUrl: function(e) {
  31362. var t, i;
  31363. t=g_Prefix;
  31364. if (e = e || "",
  31365. e.match(/^https?/)) {
  31366. var n = o.parse(e);
  31367. t = g_Prefix,
  31368. i = e
  31369. } else{
  31370. //xzw 原先的不能用
  31371. //t = window.location.protocol + "//" + window.location.host, //MP
  31372. t = g_Prefix
  31373. //i = t + "/api/player/models/" + e; //MP
  31374. i = t + "data/" + e;
  31375. }
  31376. return {
  31377. urlBase: t,
  31378. urlModel: i,
  31379. urlFiles: i + (i.match(/\/$/) ? "files" : "/files"),
  31380. urlThumb: i + (i.match(/\/$/) ? "thumb" : "/thumb")
  31381. }
  31382. },
  31383. getModelIDFromQueryString: function() {
  31384. return n.valueFromHash("model") || n.valueFromHash("m")
  31385. },
  31386. /* normalizeModeldata: function(e, t) {//xzw 修改导览images数据
  31387. e = JSON.parse(JSON.stringify(e));
  31388. var i = null;
  31389. if (e.images.forEach(function(n) {
  31390. if(!n.metadata) return;
  31391. if ("string" == typeof n.metadata)
  31392. try {
  31393. n.metadata = JSON.parse(n.metadata)
  31394. } catch (e) {
  31395. s.warn("Unable to parse image metadata"),
  31396. n.metadata = null
  31397. }
  31398. else{
  31399. "object" == typeof n.metadata && s.debug("image.metadata already a JSON object");
  31400. }
  31401. if(n.metadata.camera_position instanceof Array){//xzw 改的格式
  31402. n.metadata.camera_position = new ss.Vector3().fromArray(n.metadata.camera_position);
  31403. n.metadata.camera_quaternion = new ss.Quaternion().fromArray(n.metadata.camera_quaternion);
  31404. }else{
  31405. n.metadata.camera_quaternion && (n.metadata.camera_quaternion = t.convertWorkshopQuaternion(n.metadata.camera_quaternion)),
  31406. n.metadata.camera_position && (n.metadata.camera_position = t.convertWorkshopVector(n.metadata.camera_position))
  31407. n.metadata.zoom = n.metadata.zoom || 1;
  31408. }
  31409. !i && e.icon && e.icon === n.sid && (i = n.metadata)
  31410. }),
  31411. //icon初始视角的:
  31412. i && i.camera_quaternion && i.camera_position && i.scan_position && i.scan_quaternion) {
  31413. var n = {};
  31414. n.pano = {
  31415. quaternion: t.convertWorkshopPanoramaQuaternion(i.scan_quaternion),
  31416. position: t.convertWorkshopVector(i.scan_position),
  31417. uuid: i.scan_id
  31418. },
  31419. n.camera = {
  31420. quaternion: i.camera_quaternion,
  31421. position: i.camera_position
  31422. },
  31423. e.startPano = n
  31424. }
  31425. return e
  31426. },
  31427. */
  31428. normalizeModeldata: function(e, t) {//xzw 修改导览images数据
  31429. e = JSON.parse(JSON.stringify(e));
  31430. var i = null;
  31431. var deal = function(n) {
  31432. if(!n.metadata) return;
  31433. if ("string" == typeof n.metadata)
  31434. try {
  31435. n.metadata = JSON.parse(n.metadata)
  31436. } catch (e) {
  31437. s.warn("Unable to parse image metadata"),
  31438. n.metadata = null
  31439. }
  31440. else{
  31441. "object" == typeof n.metadata && s.debug("image.metadata already a JSON object");
  31442. }
  31443. if(n.metadata.camera_position instanceof Array){//xzw 改的格式
  31444. n.metadata.camera_position = new ss.Vector3().fromArray(n.metadata.camera_position);
  31445. n.metadata.camera_quaternion = new ss.Quaternion().fromArray(n.metadata.camera_quaternion);
  31446. }else{
  31447. n.metadata.camera_position = new ss.Vector3().copy(n.metadata.camera_position)
  31448. n.metadata.camera_quaternion = new ss.Quaternion().copy(n.metadata.camera_quaternion)
  31449. /* n.metadata.camera_quaternion && (n.metadata.camera_quaternion = i.convertWorkshopQuaternion(n.metadata.camera_quaternion)),
  31450. n.metadata.camera_position && (n.metadata.camera_position = i.convertWorkshopVector(n.metadata.camera_position)) */
  31451. }
  31452. !i && e.icon && e.icon === n.sid && (i = n.metadata)
  31453. }
  31454. //改
  31455. e.images.forEach(info=>{
  31456. if(info.locations){
  31457. info.locations.forEach(a=>deal(a))
  31458. }else{
  31459. deal(info)
  31460. }
  31461. })
  31462. //icon初始视角的:
  31463. if(i && i.camera_quaternion && i.camera_position && i.scan_position && i.scan_quaternion) {
  31464. var n = {};
  31465. n.pano = {
  31466. quaternion: t.convertWorkshopPanoramaQuaternion(i.scan_quaternion),
  31467. position: t.convertWorkshopVector(i.scan_position),
  31468. uuid: i.scan_id
  31469. },
  31470. n.camera = {
  31471. quaternion: i.camera_quaternion,
  31472. position: i.camera_position
  31473. },
  31474. e.startPano = n
  31475. }
  31476. return e
  31477. },
  31478. visionVersionToInt: function() {
  31479. var e = new RegExp(["(?:[0-9.]+\\.){1,4}", "([0-9]+)", "[^\\.]*$"].join(""));
  31480. return function(t) {
  31481. if (!t)
  31482. throw new Error("Vision version is required");
  31483. var i = e.exec(t);
  31484. if (null === i)
  31485. throw new Error("String is not a vision version: " + t);
  31486. return parseInt(i[1])
  31487. }
  31488. }(),
  31489. modelDataPromisesTiles: function(e) {
  31490. var vision_version = e.vision_version || window.MP_PREFETCHED_MODELDATA.vision_version
  31491. if (vision_version)
  31492. try {
  31493. return l.visionVersionToInt(vision_version) >= l.visionVersionToInt(r.visionTilingStartVersion)
  31494. } catch (t) {
  31495. s.warn("Invalid vision version: " + vision_version)
  31496. }
  31497. // var t = e.created ? new Date(e.created) : null;
  31498. // return t && t >= r.visionTilingStartDate
  31499. return false
  31500. }
  31501. };
  31502. t.exports = l
  31503. }
  31504. ).call(this, "/js/util/showcase.js")
  31505. }
  31506. , {
  31507. "../constants": 8,
  31508. "./browser": 182,
  31509. "./logger": 189,
  31510. three:217,
  31511. url: 208
  31512. }],
  31513. 194: [function(e, t, i) {
  31514. "use strict";
  31515. var n = e("../util/ajax")
  31516. , r = e("three")
  31517. , o = e("../settings")
  31518. , a = {};
  31519. t.exports = {
  31520. load: function(e, t, i) {
  31521. var s = a[e];
  31522. return s ? (t && setTimeout(function() {
  31523. t(s)
  31524. }, 1),
  31525. s) : (s = new r.Texture,
  31526. o.minimalMemoryMode && (s.minFilter = r.LinearFilter,
  31527. s.magFilter = r.LinearFilter,
  31528. s.generateMipmaps = !1),
  31529. s.sourceFile = e,
  31530. a[e] = s,
  31531. n.getImage(e).then(function(e) {
  31532. s.image = e,
  31533. s.needsUpdate = !0,
  31534. t && t(s)
  31535. }).fail(i),
  31536. s)
  31537. },
  31538. loadBase64: function(e, t) {
  31539. t = t || "png";
  31540. var i = new r.Texture;
  31541. return i.image = document.createElement("img"),
  31542. i.image.setAttribute("src", "data:image/" + t + ";base64," + e),
  31543. o.minimalMemoryMode && (i.minFilter = r.LinearFilter,
  31544. i.magFilter = r.LinearFilter,
  31545. i.generateMipmaps = !1),
  31546. i.needsUpdate = !0,
  31547. i
  31548. },
  31549. isLoaded: function(e) {
  31550. return !!a[e]
  31551. }
  31552. }
  31553. window.Texture = t.exports
  31554. }
  31555. , {
  31556. "../settings": 166,
  31557. "../util/ajax": 181,
  31558. three: 217
  31559. }],
  31560. 195: [function(e, t, i) {
  31561. "use strict";
  31562. var n = e("./easing");
  31563. window.transitions = t.exports = {
  31564. globalDone: null,
  31565. funcs: [],
  31566. counter: 0,
  31567. uniqueID: 0,
  31568. start: function(e, t, i, r, o, a, s) {
  31569. return r = r || 0,
  31570. this.funcs.push({
  31571. func: e,
  31572. current: -r * Math.abs(t),
  31573. duration: (1 - Math.max(r, 0)) * Math.abs(t),
  31574. done: i,
  31575. easing: o || n.linearTween,
  31576. cycling: t < 0,
  31577. running: !0,
  31578. debug: r < 0,
  31579. name: a || "T" + this.counter,
  31580. id: void 0 === s ? this.counter : s,
  31581. paused: !1
  31582. }),
  31583. e(0, 16),
  31584. this.counter += 1,
  31585. e
  31586. },
  31587. trigger: function(e) {
  31588. var t = void 0 === e.delayRatio ? 0 : e.delayRatio
  31589. , i = e.func || function() {}
  31590. , r = void 0 === e.duration ? 0 : e.duration;
  31591. void 0 !== e.cycling && e.cycling && (r = -Math.abs(r));
  31592. var o = e.done || null
  31593. , a = e.easing || n.linearTween
  31594. , s = e.name || "R" + this.counter
  31595. , l = void 0 === e.id ? this.counter : e.id;
  31596. return this.start(i, r, o, t, a, s, l)
  31597. },
  31598. setTimeout: function(e, t, i) {
  31599. var n = void 0 === i ? this.counter : i;
  31600. return this.trigger({
  31601. done: e,
  31602. duration: void 0 === t ? 0 : t,
  31603. name: "O" + this.counter,
  31604. id: n
  31605. })
  31606. },
  31607. pause: function() {
  31608. this.paused = !0
  31609. },
  31610. resume: function() {
  31611. this.paused = !1
  31612. },
  31613. update: function(e) {
  31614. this.funcs.forEach(function(t) {
  31615. if (!(t.paused || (t.current += 1e3 * e,
  31616. t.current < 0)))
  31617. if (t.current >= t.duration && !t.cycling) {
  31618. var i = t.easing(1, 0, 1, 1);
  31619. t.func(i, 1e3 * e),
  31620. t.done && t.done(),
  31621. t.running = !1
  31622. } else {
  31623. var n = t.easing(t.current % t.duration / t.duration, 0, 1, 1)
  31624. , r = t.func(n, 1e3 * e) || !1;
  31625. r && (t.done && t.done(),
  31626. t.running = !1)
  31627. }
  31628. });
  31629. var t = this.funcs.length;
  31630. this.funcs = this.funcs.filter(function(e) {
  31631. return e.running
  31632. });
  31633. var i = this.funcs.length;
  31634. if (t > 0 && 0 === i && this.globalDone) {
  31635. var n = this.globalDone;
  31636. this.globalDone = null,
  31637. n()
  31638. }
  31639. },
  31640. adjustSpeed: function(e, t) {
  31641. for (var i = this.getById(e), n = 0; n < i.length; n++) {
  31642. var r = i[n];
  31643. r.duration /= t,
  31644. r.current /= t
  31645. }
  31646. },
  31647. getById: function(e) {
  31648. return this.funcs.filter(function(t) {
  31649. return e === t.id
  31650. })
  31651. },
  31652. get: function(e) {
  31653. for (var t = 0; t < this.funcs.length; t += 1)
  31654. if (this.funcs[t].func === e)
  31655. return this.funcs[t];
  31656. return null
  31657. },
  31658. isRunning: function(e) {
  31659. var t = this.get(e);
  31660. return null !== t && t.running
  31661. },
  31662. countActive: function() {
  31663. for (var e = 0, t = 0; t < this.funcs.length; t += 1)
  31664. e += this.funcs[t].running;
  31665. return e
  31666. },
  31667. listActive: function() {
  31668. for (var e = [], t = 0; t < this.funcs.length; t += 1)
  31669. this.funcs[t].running && e.push(this.funcs[t].name);
  31670. return e
  31671. },
  31672. done: function(e) {
  31673. this.globalDone = e
  31674. },
  31675. cancelById: function(e) {
  31676. var t = void 0 === e ? 0 : e;
  31677. this.funcs = this.funcs.filter(function(e) {
  31678. return e.id !== t
  31679. })
  31680. },
  31681. cancel: function(e) {
  31682. this.funcs = this.funcs.filter(function(t) {
  31683. return t.func !== e
  31684. })
  31685. },
  31686. getUniqueId: function() {
  31687. return this.uniqueID -= 1,
  31688. this.uniqueID
  31689. }
  31690. }
  31691. }
  31692. , {
  31693. "./easing": 186
  31694. }],
  31695. 196: [function(e, t, i) {
  31696. function n(e) {
  31697. if (this.set = {},
  31698. this.infContains = function() {
  31699. return !0
  31700. }
  31701. ,
  31702. "object" == typeof e)
  31703. if (e instanceof Array)
  31704. for (var t = 0; t < e.length; t++)
  31705. this.set[e[t]] = !0;
  31706. else
  31707. this.set = e;
  31708. else if ("function" == typeof e)
  31709. this.infContains = e;
  31710. else if ("undefined" != typeof e)
  31711. throw new Error("set must be either an array or an object.")
  31712. }
  31713. t.exports = n,
  31714. n.prototype.contains = function(e) {
  31715. return !!this.set[e]
  31716. }
  31717. ,
  31718. n.prototype.has = n.prototype.contains,
  31719. n.prototype.add = function(e) {
  31720. if (1 == arguments.length)
  31721. this.set[e] = !0;
  31722. else
  31723. for (var t = 0; t < arguments.length; t++)
  31724. this.set[arguments[t]] = !0
  31725. }
  31726. ,
  31727. n.prototype.addAll = function(e) {
  31728. if ("object" != typeof e && !(e instanceof Array))
  31729. throw new Error("arr must be an array.");
  31730. for (var t = 0; t < e.length; t++)
  31731. this.add(e[t])
  31732. }
  31733. ,
  31734. n.prototype.remove = function(e) {
  31735. if (1 == arguments.length)
  31736. delete this.set[e];
  31737. else
  31738. for (var t = 0; t < arguments.length; t++)
  31739. delete this.set[arguments[t]]
  31740. }
  31741. ,
  31742. n.prototype.delete = n.prototype.remove,
  31743. n.prototype.clear = function() {
  31744. this.set = {}
  31745. }
  31746. ,
  31747. n.prototype.size = function() {
  31748. return Object.keys(this.set).length
  31749. }
  31750. ,
  31751. n.prototype.toString = function() {
  31752. return "{" + Object.keys(this.set).toString() + "}"
  31753. }
  31754. ,
  31755. n.prototype.toArray = function() {
  31756. return "undefined" == typeof this.set ? [] : Object.keys(this.set)
  31757. }
  31758. ,
  31759. n.prototype["*values"] = n.prototype.toArray
  31760. }
  31761. , {}],
  31762. 197: [function(e, t, i) {}
  31763. , {}],
  31764. 198: [function(e, t, i) {
  31765. (function(t) {
  31766. "use strict";
  31767. function n() {
  31768. try {
  31769. var e = new Uint8Array(1);
  31770. return e.__proto__ = {
  31771. __proto__: Uint8Array.prototype,
  31772. foo: function() {
  31773. return 42
  31774. }
  31775. },
  31776. 42 === e.foo() && "function" == typeof e.subarray && 0 === e.subarray(1, 1).byteLength
  31777. } catch (e) {
  31778. return !1
  31779. }
  31780. }
  31781. function r() {
  31782. return a.TYPED_ARRAY_SUPPORT ? 2147483647 : 1073741823
  31783. }
  31784. function o(e, t) {
  31785. if (r() < t)
  31786. throw new RangeError("Invalid typed array length");
  31787. return a.TYPED_ARRAY_SUPPORT ? (e = new Uint8Array(t),
  31788. e.__proto__ = a.prototype) : (null === e && (e = new a(t)),
  31789. e.length = t),
  31790. e
  31791. }
  31792. function a(e, t, i) {
  31793. if (!(a.TYPED_ARRAY_SUPPORT || this instanceof a))
  31794. return new a(e,t,i);
  31795. if ("number" == typeof e) {
  31796. if ("string" == typeof t)
  31797. throw new Error("If encoding is specified then the first argument must be a string");
  31798. return h(this, e)
  31799. }
  31800. return s(this, e, t, i)
  31801. }
  31802. function s(e, t, i, n) {
  31803. if ("number" == typeof t)
  31804. throw new TypeError('"value" argument must not be a number');
  31805. return "undefined" != typeof ArrayBuffer && t instanceof ArrayBuffer ? p(e, t, i, n) : "string" == typeof t ? u(e, t, i) : f(e, t)
  31806. }
  31807. function l(e) {
  31808. if ("number" != typeof e)
  31809. throw new TypeError('"size" argument must be a number');
  31810. if (e < 0)
  31811. throw new RangeError('"size" argument must not be negative')
  31812. }
  31813. function c(e, t, i, n) {
  31814. return l(t),
  31815. 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)
  31816. }
  31817. function h(e, t) {
  31818. if (l(t),
  31819. e = o(e, t < 0 ? 0 : 0 | g(t)),
  31820. !a.TYPED_ARRAY_SUPPORT)
  31821. for (var i = 0; i < t; ++i)
  31822. e[i] = 0;
  31823. return e
  31824. }
  31825. function u(e, t, i) {
  31826. if ("string" == typeof i && "" !== i || (i = "utf8"),
  31827. !a.isEncoding(i))
  31828. throw new TypeError('"encoding" must be a valid string encoding');
  31829. var n = 0 | v(t, i);
  31830. e = o(e, n);
  31831. var r = e.write(t, i);
  31832. return r !== n && (e = e.slice(0, r)),
  31833. e
  31834. }
  31835. function d(e, t) {
  31836. var i = t.length < 0 ? 0 : 0 | g(t.length);
  31837. e = o(e, i);
  31838. for (var n = 0; n < i; n += 1)
  31839. e[n] = 255 & t[n];
  31840. return e
  31841. }
  31842. function p(e, t, i, n) {
  31843. if (t.byteLength,
  31844. i < 0 || t.byteLength < i)
  31845. throw new RangeError("'offset' is out of bounds");
  31846. if (t.byteLength < i + (n || 0))
  31847. throw new RangeError("'length' is out of bounds");
  31848. return t = void 0 === i && void 0 === n ? new Uint8Array(t) : void 0 === n ? new Uint8Array(t,i) : new Uint8Array(t,i,n),
  31849. a.TYPED_ARRAY_SUPPORT ? (e = t,
  31850. e.__proto__ = a.prototype) : e = d(e, t),
  31851. e
  31852. }
  31853. function f(e, t) {
  31854. if (a.isBuffer(t)) {
  31855. var i = 0 | g(t.length);
  31856. return e = o(e, i),
  31857. 0 === e.length ? e : (t.copy(e, 0, 0, i),
  31858. e)
  31859. }
  31860. if (t) {
  31861. if ("undefined" != typeof ArrayBuffer && t.buffer instanceof ArrayBuffer || "length"in t)
  31862. return "number" != typeof t.length || K(t.length) ? o(e, 0) : d(e, t);
  31863. if ("Buffer" === t.type && $(t.data))
  31864. return d(e, t.data)
  31865. }
  31866. throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")
  31867. }
  31868. function g(e) {
  31869. if (e >= r())
  31870. throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + r().toString(16) + " bytes");
  31871. return 0 | e
  31872. }
  31873. function m(e) {
  31874. return +e != e && (e = 0),
  31875. a.alloc(+e)
  31876. }
  31877. function v(e, t) {
  31878. if (a.isBuffer(e))
  31879. return e.length;
  31880. if ("undefined" != typeof ArrayBuffer && "function" == typeof ArrayBuffer.isView && (ArrayBuffer.isView(e) || e instanceof ArrayBuffer))
  31881. return e.byteLength;
  31882. "string" != typeof e && (e = "" + e);
  31883. var i = e.length;
  31884. if (0 === i)
  31885. return 0;
  31886. for (var n = !1; ; )
  31887. switch (t) {
  31888. case "ascii":
  31889. case "latin1":
  31890. case "binary":
  31891. return i;
  31892. case "utf8":
  31893. case "utf-8":
  31894. case void 0:
  31895. return j(e).length;
  31896. case "ucs2":
  31897. case "ucs-2":
  31898. case "utf16le":
  31899. case "utf-16le":
  31900. return 2 * i;
  31901. case "hex":
  31902. return i >>> 1;
  31903. case "base64":
  31904. return Z(e).length;
  31905. default:
  31906. if (n)
  31907. return j(e).length;
  31908. t = ("" + t).toLowerCase(),
  31909. n = !0
  31910. }
  31911. }
  31912. function A(e, t, i) {
  31913. var n = !1;
  31914. if ((void 0 === t || t < 0) && (t = 0),
  31915. t > this.length)
  31916. return "";
  31917. if ((void 0 === i || i > this.length) && (i = this.length),
  31918. i <= 0)
  31919. return "";
  31920. if (i >>>= 0,
  31921. t >>>= 0,
  31922. i <= t)
  31923. return "";
  31924. for (e || (e = "utf8"); ; )
  31925. switch (e) {
  31926. case "hex":
  31927. return L(this, t, i);
  31928. case "utf8":
  31929. case "utf-8":
  31930. return M(this, t, i);
  31931. case "ascii":
  31932. return P(this, t, i);
  31933. case "latin1":
  31934. case "binary":
  31935. return O(this, t, i);
  31936. case "base64":
  31937. return S(this, t, i);
  31938. case "ucs2":
  31939. case "ucs-2":
  31940. case "utf16le":
  31941. case "utf-16le":
  31942. return D(this, t, i);
  31943. default:
  31944. if (n)
  31945. throw new TypeError("Unknown encoding: " + e);
  31946. e = (e + "").toLowerCase(),
  31947. n = !0
  31948. }
  31949. }
  31950. function y(e, t, i) {
  31951. var n = e[t];
  31952. e[t] = e[i],
  31953. e[i] = n
  31954. }
  31955. function C(e, t, i, n, r) {
  31956. if (0 === e.length)
  31957. return -1;
  31958. if ("string" == typeof i ? (n = i,
  31959. i = 0) : i > 2147483647 ? i = 2147483647 : i < -2147483648 && (i = -2147483648),
  31960. i = +i,
  31961. isNaN(i) && (i = r ? 0 : e.length - 1),
  31962. i < 0 && (i = e.length + i),
  31963. i >= e.length) {
  31964. if (r)
  31965. return -1;
  31966. i = e.length - 1
  31967. } else if (i < 0) {
  31968. if (!r)
  31969. return -1;
  31970. i = 0
  31971. }
  31972. if ("string" == typeof t && (t = a.from(t, n)),
  31973. a.isBuffer(t))
  31974. return 0 === t.length ? -1 : I(e, t, i, n, r);
  31975. if ("number" == typeof t)
  31976. return t &= 255,
  31977. 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);
  31978. throw new TypeError("val must be string, number or Buffer")
  31979. }
  31980. function I(e, t, i, n, r) {
  31981. function o(e, t) {
  31982. return 1 === a ? e[t] : e.readUInt16BE(t * a)
  31983. }
  31984. var a = 1
  31985. , s = e.length
  31986. , l = t.length;
  31987. if (void 0 !== n && (n = String(n).toLowerCase(),
  31988. "ucs2" === n || "ucs-2" === n || "utf16le" === n || "utf-16le" === n)) {
  31989. if (e.length < 2 || t.length < 2)
  31990. return -1;
  31991. a = 2,
  31992. s /= 2,
  31993. l /= 2,
  31994. i /= 2
  31995. }
  31996. var c;
  31997. if (r) {
  31998. var h = -1;
  31999. for (c = i; c < s; c++)
  32000. if (o(e, c) === o(t, h === -1 ? 0 : c - h)) {
  32001. if (h === -1 && (h = c),
  32002. c - h + 1 === l)
  32003. return h * a
  32004. } else
  32005. h !== -1 && (c -= c - h),
  32006. h = -1
  32007. } else
  32008. for (i + l > s && (i = s - l),
  32009. c = i; c >= 0; c--) {
  32010. for (var u = !0, d = 0; d < l; d++)
  32011. if (o(e, c + d) !== o(t, d)) {
  32012. u = !1;
  32013. break
  32014. }
  32015. if (u)
  32016. return c
  32017. }
  32018. return -1
  32019. }
  32020. function E(e, t, i, n) {
  32021. i = Number(i) || 0;
  32022. var r = e.length - i;
  32023. n ? (n = Number(n),
  32024. n > r && (n = r)) : n = r;
  32025. var o = t.length;
  32026. if (o % 2 !== 0)
  32027. throw new TypeError("Invalid hex string");
  32028. n > o / 2 && (n = o / 2);
  32029. for (var a = 0; a < n; ++a) {
  32030. var s = parseInt(t.substr(2 * a, 2), 16);
  32031. if (isNaN(s))
  32032. return a;
  32033. e[i + a] = s
  32034. }
  32035. return a
  32036. }
  32037. function b(e, t, i, n) {
  32038. return q(j(t, e.length - i), e, i, n)
  32039. }
  32040. function w(e, t, i, n) {
  32041. return q(Y(t), e, i, n)
  32042. }
  32043. function _(e, t, i, n) {
  32044. return w(e, t, i, n)
  32045. }
  32046. function T(e, t, i, n) {
  32047. return q(Z(t), e, i, n)
  32048. }
  32049. function x(e, t, i, n) {
  32050. return q(X(t, e.length - i), e, i, n)
  32051. }
  32052. function S(e, t, i) {
  32053. return 0 === t && i === e.length ? Q.fromByteArray(e) : Q.fromByteArray(e.slice(t, i))
  32054. }
  32055. function M(e, t, i) {
  32056. i = Math.min(e.length, i);
  32057. for (var n = [], r = t; r < i; ) {
  32058. var o = e[r]
  32059. , a = null
  32060. , s = o > 239 ? 4 : o > 223 ? 3 : o > 191 ? 2 : 1;
  32061. if (r + s <= i) {
  32062. var l, c, h, u;
  32063. switch (s) {
  32064. case 1:
  32065. o < 128 && (a = o);
  32066. break;
  32067. case 2:
  32068. l = e[r + 1],
  32069. 128 === (192 & l) && (u = (31 & o) << 6 | 63 & l,
  32070. u > 127 && (a = u));
  32071. break;
  32072. case 3:
  32073. l = e[r + 1],
  32074. c = e[r + 2],
  32075. 128 === (192 & l) && 128 === (192 & c) && (u = (15 & o) << 12 | (63 & l) << 6 | 63 & c,
  32076. u > 2047 && (u < 55296 || u > 57343) && (a = u));
  32077. break;
  32078. case 4:
  32079. l = e[r + 1],
  32080. c = e[r + 2],
  32081. h = e[r + 3],
  32082. 128 === (192 & l) && 128 === (192 & c) && 128 === (192 & h) && (u = (15 & o) << 18 | (63 & l) << 12 | (63 & c) << 6 | 63 & h,
  32083. u > 65535 && u < 1114112 && (a = u))
  32084. }
  32085. }
  32086. null === a ? (a = 65533,
  32087. s = 1) : a > 65535 && (a -= 65536,
  32088. n.push(a >>> 10 & 1023 | 55296),
  32089. a = 56320 | 1023 & a),
  32090. n.push(a),
  32091. r += s
  32092. }
  32093. return R(n)
  32094. }
  32095. function R(e) {
  32096. var t = e.length;
  32097. if (t <= ee)
  32098. return String.fromCharCode.apply(String, e);
  32099. for (var i = "", n = 0; n < t; )
  32100. i += String.fromCharCode.apply(String, e.slice(n, n += ee));
  32101. return i
  32102. }
  32103. function P(e, t, i) {
  32104. var n = "";
  32105. i = Math.min(e.length, i);
  32106. for (var r = t; r < i; ++r)
  32107. n += String.fromCharCode(127 & e[r]);
  32108. return n
  32109. }
  32110. function O(e, t, i) {
  32111. var n = "";
  32112. i = Math.min(e.length, i);
  32113. for (var r = t; r < i; ++r)
  32114. n += String.fromCharCode(e[r]);
  32115. return n
  32116. }
  32117. function L(e, t, i) {
  32118. var n = e.length;
  32119. (!t || t < 0) && (t = 0),
  32120. (!i || i < 0 || i > n) && (i = n);
  32121. for (var r = "", o = t; o < i; ++o)
  32122. r += W(e[o]);
  32123. return r
  32124. }
  32125. function D(e, t, i) {
  32126. for (var n = e.slice(t, i), r = "", o = 0; o < n.length; o += 2)
  32127. r += String.fromCharCode(n[o] + 256 * n[o + 1]);
  32128. return r
  32129. }
  32130. function N(e, t, i) {
  32131. if (e % 1 !== 0 || e < 0)
  32132. throw new RangeError("offset is not uint");
  32133. if (e + t > i)
  32134. throw new RangeError("Trying to access beyond buffer length")
  32135. }
  32136. function B(e, t, i, n, r, o) {
  32137. if (!a.isBuffer(e))
  32138. throw new TypeError('"buffer" argument must be a Buffer instance');
  32139. if (t > r || t < o)
  32140. throw new RangeError('"value" argument is out of bounds');
  32141. if (i + n > e.length)
  32142. throw new RangeError("Index out of range")
  32143. }
  32144. function F(e, t, i, n) {
  32145. t < 0 && (t = 65535 + t + 1);
  32146. for (var r = 0, o = Math.min(e.length - i, 2); r < o; ++r)
  32147. e[i + r] = (t & 255 << 8 * (n ? r : 1 - r)) >>> 8 * (n ? r : 1 - r)
  32148. }
  32149. function V(e, t, i, n) {
  32150. t < 0 && (t = 4294967295 + t + 1);
  32151. for (var r = 0, o = Math.min(e.length - i, 4); r < o; ++r)
  32152. e[i + r] = t >>> 8 * (n ? r : 3 - r) & 255
  32153. }
  32154. function U(e, t, i, n, r, o) {
  32155. if (i + n > e.length)
  32156. throw new RangeError("Index out of range");
  32157. if (i < 0)
  32158. throw new RangeError("Index out of range")
  32159. }
  32160. function k(e, t, i, n, r) {
  32161. return r || U(e, t, i, 4, 3.4028234663852886e38, -3.4028234663852886e38),
  32162. J.write(e, t, i, n, 23, 4),
  32163. i + 4
  32164. }
  32165. function H(e, t, i, n, r) {
  32166. return r || U(e, t, i, 8, 1.7976931348623157e308, -1.7976931348623157e308),
  32167. J.write(e, t, i, n, 52, 8),
  32168. i + 8
  32169. }
  32170. function G(e) {
  32171. if (e = z(e).replace(te, ""),
  32172. e.length < 2)
  32173. return "";
  32174. for (; e.length % 4 !== 0; )
  32175. e += "=";
  32176. return e
  32177. }
  32178. function z(e) {
  32179. return e.trim ? e.trim() : e.replace(/^\s+|\s+$/g, "")
  32180. }
  32181. function W(e) {
  32182. return e < 16 ? "0" + e.toString(16) : e.toString(16)
  32183. }
  32184. function j(e, t) {
  32185. t = t || 1 / 0;
  32186. for (var i, n = e.length, r = null, o = [], a = 0; a < n; ++a) {
  32187. if (i = e.charCodeAt(a),
  32188. i > 55295 && i < 57344) {
  32189. if (!r) {
  32190. if (i > 56319) {
  32191. (t -= 3) > -1 && o.push(239, 191, 189);
  32192. continue
  32193. }
  32194. if (a + 1 === n) {
  32195. (t -= 3) > -1 && o.push(239, 191, 189);
  32196. continue
  32197. }
  32198. r = i;
  32199. continue
  32200. }
  32201. if (i < 56320) {
  32202. (t -= 3) > -1 && o.push(239, 191, 189),
  32203. r = i;
  32204. continue
  32205. }
  32206. i = (r - 55296 << 10 | i - 56320) + 65536
  32207. } else
  32208. r && (t -= 3) > -1 && o.push(239, 191, 189);
  32209. if (r = null,
  32210. i < 128) {
  32211. if ((t -= 1) < 0)
  32212. break;
  32213. o.push(i)
  32214. } else if (i < 2048) {
  32215. if ((t -= 2) < 0)
  32216. break;
  32217. o.push(i >> 6 | 192, 63 & i | 128)
  32218. } else if (i < 65536) {
  32219. if ((t -= 3) < 0)
  32220. break;
  32221. o.push(i >> 12 | 224, i >> 6 & 63 | 128, 63 & i | 128)
  32222. } else {
  32223. if (!(i < 1114112))
  32224. throw new Error("Invalid code point");
  32225. if ((t -= 4) < 0)
  32226. break;
  32227. o.push(i >> 18 | 240, i >> 12 & 63 | 128, i >> 6 & 63 | 128, 63 & i | 128)
  32228. }
  32229. }
  32230. return o
  32231. }
  32232. function Y(e) {
  32233. for (var t = [], i = 0; i < e.length; ++i)
  32234. t.push(255 & e.charCodeAt(i));
  32235. return t
  32236. }
  32237. function X(e, t) {
  32238. for (var i, n, r, o = [], a = 0; a < e.length && !((t -= 2) < 0); ++a)
  32239. i = e.charCodeAt(a),
  32240. n = i >> 8,
  32241. r = i % 256,
  32242. o.push(r),
  32243. o.push(n);
  32244. return o
  32245. }
  32246. function Z(e) {
  32247. return Q.toByteArray(G(e))
  32248. }
  32249. function q(e, t, i, n) {
  32250. for (var r = 0; r < n && !(r + i >= t.length || r >= e.length); ++r)
  32251. t[r + i] = e[r];
  32252. return r
  32253. }
  32254. function K(e) {
  32255. return e !== e
  32256. }
  32257. var Q = e("base64-js")
  32258. , J = e("ieee754")
  32259. , $ = e("isarray");
  32260. i.Buffer = a,
  32261. i.SlowBuffer = m,
  32262. i.INSPECT_MAX_BYTES = 50,
  32263. a.TYPED_ARRAY_SUPPORT = void 0 !== t.TYPED_ARRAY_SUPPORT ? t.TYPED_ARRAY_SUPPORT : n(),
  32264. i.kMaxLength = r(),
  32265. a.poolSize = 8192,
  32266. a._augment = function(e) {
  32267. return e.__proto__ = a.prototype,
  32268. e
  32269. }
  32270. ,
  32271. a.from = function(e, t, i) {
  32272. return s(null, e, t, i)
  32273. }
  32274. ,
  32275. a.TYPED_ARRAY_SUPPORT && (a.prototype.__proto__ = Uint8Array.prototype,
  32276. a.__proto__ = Uint8Array,
  32277. "undefined" != typeof Symbol && Symbol.species && a[Symbol.species] === a && Object.defineProperty(a, Symbol.species, {
  32278. value: null,
  32279. configurable: !0
  32280. })),
  32281. a.alloc = function(e, t, i) {
  32282. return c(null, e, t, i)
  32283. }
  32284. ,
  32285. a.allocUnsafe = function(e) {
  32286. return h(null, e)
  32287. }
  32288. ,
  32289. a.allocUnsafeSlow = function(e) {
  32290. return h(null, e)
  32291. }
  32292. ,
  32293. a.isBuffer = function(e) {
  32294. return !(null == e || !e._isBuffer)
  32295. }
  32296. ,
  32297. a.compare = function(e, t) {
  32298. if (!a.isBuffer(e) || !a.isBuffer(t))
  32299. throw new TypeError("Arguments must be Buffers");
  32300. if (e === t)
  32301. return 0;
  32302. for (var i = e.length, n = t.length, r = 0, o = Math.min(i, n); r < o; ++r)
  32303. if (e[r] !== t[r]) {
  32304. i = e[r],
  32305. n = t[r];
  32306. break
  32307. }
  32308. return i < n ? -1 : n < i ? 1 : 0
  32309. }
  32310. ,
  32311. a.isEncoding = function(e) {
  32312. switch (String(e).toLowerCase()) {
  32313. case "hex":
  32314. case "utf8":
  32315. case "utf-8":
  32316. case "ascii":
  32317. case "latin1":
  32318. case "binary":
  32319. case "base64":
  32320. case "ucs2":
  32321. case "ucs-2":
  32322. case "utf16le":
  32323. case "utf-16le":
  32324. return !0;
  32325. default:
  32326. return !1
  32327. }
  32328. }
  32329. ,
  32330. a.concat = function(e, t) {
  32331. if (!$(e))
  32332. throw new TypeError('"list" argument must be an Array of Buffers');
  32333. if (0 === e.length)
  32334. return a.alloc(0);
  32335. var i;
  32336. if (void 0 === t)
  32337. for (t = 0,
  32338. i = 0; i < e.length; ++i)
  32339. t += e[i].length;
  32340. var n = a.allocUnsafe(t)
  32341. , r = 0;
  32342. for (i = 0; i < e.length; ++i) {
  32343. var o = e[i];
  32344. if (!a.isBuffer(o))
  32345. throw new TypeError('"list" argument must be an Array of Buffers');
  32346. o.copy(n, r),
  32347. r += o.length
  32348. }
  32349. return n
  32350. }
  32351. ,
  32352. a.byteLength = v,
  32353. a.prototype._isBuffer = !0,
  32354. a.prototype.swap16 = function() {
  32355. var e = this.length;
  32356. if (e % 2 !== 0)
  32357. throw new RangeError("Buffer size must be a multiple of 16-bits");
  32358. for (var t = 0; t < e; t += 2)
  32359. y(this, t, t + 1);
  32360. return this
  32361. }
  32362. ,
  32363. a.prototype.swap32 = function() {
  32364. var e = this.length;
  32365. if (e % 4 !== 0)
  32366. throw new RangeError("Buffer size must be a multiple of 32-bits");
  32367. for (var t = 0; t < e; t += 4)
  32368. y(this, t, t + 3),
  32369. y(this, t + 1, t + 2);
  32370. return this
  32371. }
  32372. ,
  32373. a.prototype.swap64 = function() {
  32374. var e = this.length;
  32375. if (e % 8 !== 0)
  32376. throw new RangeError("Buffer size must be a multiple of 64-bits");
  32377. for (var t = 0; t < e; t += 8)
  32378. y(this, t, t + 7),
  32379. y(this, t + 1, t + 6),
  32380. y(this, t + 2, t + 5),
  32381. y(this, t + 3, t + 4);
  32382. return this
  32383. }
  32384. ,
  32385. a.prototype.toString = function() {
  32386. var e = 0 | this.length;
  32387. return 0 === e ? "" : 0 === arguments.length ? M(this, 0, e) : A.apply(this, arguments)
  32388. }
  32389. ,
  32390. a.prototype.equals = function(e) {
  32391. if (!a.isBuffer(e))
  32392. throw new TypeError("Argument must be a Buffer");
  32393. return this === e || 0 === a.compare(this, e)
  32394. }
  32395. ,
  32396. a.prototype.inspect = function() {
  32397. var e = ""
  32398. , t = i.INSPECT_MAX_BYTES;
  32399. return this.length > 0 && (e = this.toString("hex", 0, t).match(/.{2}/g).join(" "),
  32400. this.length > t && (e += " ... ")),
  32401. "<Buffer " + e + ">"
  32402. }
  32403. ,
  32404. a.prototype.compare = function(e, t, i, n, r) {
  32405. if (!a.isBuffer(e))
  32406. throw new TypeError("Argument must be a Buffer");
  32407. if (void 0 === t && (t = 0),
  32408. void 0 === i && (i = e ? e.length : 0),
  32409. void 0 === n && (n = 0),
  32410. void 0 === r && (r = this.length),
  32411. t < 0 || i > e.length || n < 0 || r > this.length)
  32412. throw new RangeError("out of range index");
  32413. if (n >= r && t >= i)
  32414. return 0;
  32415. if (n >= r)
  32416. return -1;
  32417. if (t >= i)
  32418. return 1;
  32419. if (t >>>= 0,
  32420. i >>>= 0,
  32421. n >>>= 0,
  32422. r >>>= 0,
  32423. this === e)
  32424. return 0;
  32425. 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)
  32426. if (c[u] !== h[u]) {
  32427. o = c[u],
  32428. s = h[u];
  32429. break
  32430. }
  32431. return o < s ? -1 : s < o ? 1 : 0
  32432. }
  32433. ,
  32434. a.prototype.includes = function(e, t, i) {
  32435. return this.indexOf(e, t, i) !== -1
  32436. }
  32437. ,
  32438. a.prototype.indexOf = function(e, t, i) {
  32439. return C(this, e, t, i, !0)
  32440. }
  32441. ,
  32442. a.prototype.lastIndexOf = function(e, t, i) {
  32443. return C(this, e, t, i, !1)
  32444. }
  32445. ,
  32446. a.prototype.write = function(e, t, i, n) {
  32447. if (void 0 === t)
  32448. n = "utf8",
  32449. i = this.length,
  32450. t = 0;
  32451. else if (void 0 === i && "string" == typeof t)
  32452. n = t,
  32453. i = this.length,
  32454. t = 0;
  32455. else {
  32456. if (!isFinite(t))
  32457. throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");
  32458. t |= 0,
  32459. isFinite(i) ? (i |= 0,
  32460. void 0 === n && (n = "utf8")) : (n = i,
  32461. i = void 0)
  32462. }
  32463. var r = this.length - t;
  32464. if ((void 0 === i || i > r) && (i = r),
  32465. e.length > 0 && (i < 0 || t < 0) || t > this.length)
  32466. throw new RangeError("Attempt to write outside buffer bounds");
  32467. n || (n = "utf8");
  32468. for (var o = !1; ; )
  32469. switch (n) {
  32470. case "hex":
  32471. return E(this, e, t, i);
  32472. case "utf8":
  32473. case "utf-8":
  32474. return b(this, e, t, i);
  32475. case "ascii":
  32476. return w(this, e, t, i);
  32477. case "latin1":
  32478. case "binary":
  32479. return _(this, e, t, i);
  32480. case "base64":
  32481. return T(this, e, t, i);
  32482. case "ucs2":
  32483. case "ucs-2":
  32484. case "utf16le":
  32485. case "utf-16le":
  32486. return x(this, e, t, i);
  32487. default:
  32488. if (o)
  32489. throw new TypeError("Unknown encoding: " + n);
  32490. n = ("" + n).toLowerCase(),
  32491. o = !0
  32492. }
  32493. }
  32494. ,
  32495. a.prototype.toJSON = function() {
  32496. return {
  32497. type: "Buffer",
  32498. data: Array.prototype.slice.call(this._arr || this, 0)
  32499. }
  32500. }
  32501. ;
  32502. var ee = 4096;
  32503. a.prototype.slice = function(e, t) {
  32504. var i = this.length;
  32505. e = ~~e,
  32506. t = void 0 === t ? i : ~~t,
  32507. e < 0 ? (e += i,
  32508. e < 0 && (e = 0)) : e > i && (e = i),
  32509. t < 0 ? (t += i,
  32510. t < 0 && (t = 0)) : t > i && (t = i),
  32511. t < e && (t = e);
  32512. var n;
  32513. if (a.TYPED_ARRAY_SUPPORT)
  32514. n = this.subarray(e, t),
  32515. n.__proto__ = a.prototype;
  32516. else {
  32517. var r = t - e;
  32518. n = new a(r,void 0);
  32519. for (var o = 0; o < r; ++o)
  32520. n[o] = this[o + e]
  32521. }
  32522. return n
  32523. }
  32524. ,
  32525. a.prototype.readUIntLE = function(e, t, i) {
  32526. e |= 0,
  32527. t |= 0,
  32528. i || N(e, t, this.length);
  32529. for (var n = this[e], r = 1, o = 0; ++o < t && (r *= 256); )
  32530. n += this[e + o] * r;
  32531. return n
  32532. }
  32533. ,
  32534. a.prototype.readUIntBE = function(e, t, i) {
  32535. e |= 0,
  32536. t |= 0,
  32537. i || N(e, t, this.length);
  32538. for (var n = this[e + --t], r = 1; t > 0 && (r *= 256); )
  32539. n += this[e + --t] * r;
  32540. return n
  32541. }
  32542. ,
  32543. a.prototype.readUInt8 = function(e, t) {
  32544. return t || N(e, 1, this.length),
  32545. this[e]
  32546. }
  32547. ,
  32548. a.prototype.readUInt16LE = function(e, t) {
  32549. return t || N(e, 2, this.length),
  32550. this[e] | this[e + 1] << 8
  32551. }
  32552. ,
  32553. a.prototype.readUInt16BE = function(e, t) {
  32554. return t || N(e, 2, this.length),
  32555. this[e] << 8 | this[e + 1]
  32556. }
  32557. ,
  32558. a.prototype.readUInt32LE = function(e, t) {
  32559. return t || N(e, 4, this.length),
  32560. (this[e] | this[e + 1] << 8 | this[e + 2] << 16) + 16777216 * this[e + 3]
  32561. }
  32562. ,
  32563. a.prototype.readUInt32BE = function(e, t) {
  32564. return t || N(e, 4, this.length),
  32565. 16777216 * this[e] + (this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3])
  32566. }
  32567. ,
  32568. a.prototype.readIntLE = function(e, t, i) {
  32569. e |= 0,
  32570. t |= 0,
  32571. i || N(e, t, this.length);
  32572. for (var n = this[e], r = 1, o = 0; ++o < t && (r *= 256); )
  32573. n += this[e + o] * r;
  32574. return r *= 128,
  32575. n >= r && (n -= Math.pow(2, 8 * t)),
  32576. n
  32577. }
  32578. ,
  32579. a.prototype.readIntBE = function(e, t, i) {
  32580. e |= 0,
  32581. t |= 0,
  32582. i || N(e, t, this.length);
  32583. for (var n = t, r = 1, o = this[e + --n]; n > 0 && (r *= 256); )
  32584. o += this[e + --n] * r;
  32585. return r *= 128,
  32586. o >= r && (o -= Math.pow(2, 8 * t)),
  32587. o
  32588. }
  32589. ,
  32590. a.prototype.readInt8 = function(e, t) {
  32591. return t || N(e, 1, this.length),
  32592. 128 & this[e] ? (255 - this[e] + 1) * -1 : this[e]
  32593. }
  32594. ,
  32595. a.prototype.readInt16LE = function(e, t) {
  32596. t || N(e, 2, this.length);
  32597. var i = this[e] | this[e + 1] << 8;
  32598. return 32768 & i ? 4294901760 | i : i
  32599. }
  32600. ,
  32601. a.prototype.readInt16BE = function(e, t) {
  32602. t || N(e, 2, this.length);
  32603. var i = this[e + 1] | this[e] << 8;
  32604. return 32768 & i ? 4294901760 | i : i
  32605. }
  32606. ,
  32607. a.prototype.readInt32LE = function(e, t) {
  32608. return t || N(e, 4, this.length),
  32609. this[e] | this[e + 1] << 8 | this[e + 2] << 16 | this[e + 3] << 24
  32610. }
  32611. ,
  32612. a.prototype.readInt32BE = function(e, t) {
  32613. return t || N(e, 4, this.length),
  32614. this[e] << 24 | this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3]
  32615. }
  32616. ,
  32617. a.prototype.readFloatLE = function(e, t) {
  32618. return t || N(e, 4, this.length),
  32619. J.read(this, e, !0, 23, 4)
  32620. }
  32621. ,
  32622. a.prototype.readFloatBE = function(e, t) {
  32623. return t || N(e, 4, this.length),
  32624. J.read(this, e, !1, 23, 4)
  32625. }
  32626. ,
  32627. a.prototype.readDoubleLE = function(e, t) {
  32628. return t || N(e, 8, this.length),
  32629. J.read(this, e, !0, 52, 8)
  32630. }
  32631. ,
  32632. a.prototype.readDoubleBE = function(e, t) {
  32633. return t || N(e, 8, this.length),
  32634. J.read(this, e, !1, 52, 8)
  32635. }
  32636. ,
  32637. a.prototype.writeUIntLE = function(e, t, i, n) {
  32638. if (e = +e,
  32639. t |= 0,
  32640. i |= 0,
  32641. !n) {
  32642. var r = Math.pow(2, 8 * i) - 1;
  32643. B(this, e, t, i, r, 0)
  32644. }
  32645. var o = 1
  32646. , a = 0;
  32647. for (this[t] = 255 & e; ++a < i && (o *= 256); )
  32648. this[t + a] = e / o & 255;
  32649. return t + i
  32650. }
  32651. ,
  32652. a.prototype.writeUIntBE = function(e, t, i, n) {
  32653. if (e = +e,
  32654. t |= 0,
  32655. i |= 0,
  32656. !n) {
  32657. var r = Math.pow(2, 8 * i) - 1;
  32658. B(this, e, t, i, r, 0)
  32659. }
  32660. var o = i - 1
  32661. , a = 1;
  32662. for (this[t + o] = 255 & e; --o >= 0 && (a *= 256); )
  32663. this[t + o] = e / a & 255;
  32664. return t + i
  32665. }
  32666. ,
  32667. a.prototype.writeUInt8 = function(e, t, i) {
  32668. return e = +e,
  32669. t |= 0,
  32670. i || B(this, e, t, 1, 255, 0),
  32671. a.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)),
  32672. this[t] = 255 & e,
  32673. t + 1
  32674. }
  32675. ,
  32676. a.prototype.writeUInt16LE = function(e, t, i) {
  32677. return e = +e,
  32678. t |= 0,
  32679. i || B(this, e, t, 2, 65535, 0),
  32680. a.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e,
  32681. this[t + 1] = e >>> 8) : F(this, e, t, !0),
  32682. t + 2
  32683. }
  32684. ,
  32685. a.prototype.writeUInt16BE = function(e, t, i) {
  32686. return e = +e,
  32687. t |= 0,
  32688. i || B(this, e, t, 2, 65535, 0),
  32689. a.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 8,
  32690. this[t + 1] = 255 & e) : F(this, e, t, !1),
  32691. t + 2
  32692. }
  32693. ,
  32694. a.prototype.writeUInt32LE = function(e, t, i) {
  32695. return e = +e,
  32696. t |= 0,
  32697. i || B(this, e, t, 4, 4294967295, 0),
  32698. a.TYPED_ARRAY_SUPPORT ? (this[t + 3] = e >>> 24,
  32699. this[t + 2] = e >>> 16,
  32700. this[t + 1] = e >>> 8,
  32701. this[t] = 255 & e) : V(this, e, t, !0),
  32702. t + 4
  32703. }
  32704. ,
  32705. a.prototype.writeUInt32BE = function(e, t, i) {
  32706. return e = +e,
  32707. t |= 0,
  32708. i || B(this, e, t, 4, 4294967295, 0),
  32709. a.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 24,
  32710. this[t + 1] = e >>> 16,
  32711. this[t + 2] = e >>> 8,
  32712. this[t + 3] = 255 & e) : V(this, e, t, !1),
  32713. t + 4
  32714. }
  32715. ,
  32716. a.prototype.writeIntLE = function(e, t, i, n) {
  32717. if (e = +e,
  32718. t |= 0,
  32719. !n) {
  32720. var r = Math.pow(2, 8 * i - 1);
  32721. B(this, e, t, i, r - 1, -r)
  32722. }
  32723. var o = 0
  32724. , a = 1
  32725. , s = 0;
  32726. for (this[t] = 255 & e; ++o < i && (a *= 256); )
  32727. e < 0 && 0 === s && 0 !== this[t + o - 1] && (s = 1),
  32728. this[t + o] = (e / a >> 0) - s & 255;
  32729. return t + i
  32730. }
  32731. ,
  32732. a.prototype.writeIntBE = function(e, t, i, n) {
  32733. if (e = +e,
  32734. t |= 0,
  32735. !n) {
  32736. var r = Math.pow(2, 8 * i - 1);
  32737. B(this, e, t, i, r - 1, -r)
  32738. }
  32739. var o = i - 1
  32740. , a = 1
  32741. , s = 0;
  32742. for (this[t + o] = 255 & e; --o >= 0 && (a *= 256); )
  32743. e < 0 && 0 === s && 0 !== this[t + o + 1] && (s = 1),
  32744. this[t + o] = (e / a >> 0) - s & 255;
  32745. return t + i
  32746. }
  32747. ,
  32748. a.prototype.writeInt8 = function(e, t, i) {
  32749. return e = +e,
  32750. t |= 0,
  32751. i || B(this, e, t, 1, 127, -128),
  32752. a.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)),
  32753. e < 0 && (e = 255 + e + 1),
  32754. this[t] = 255 & e,
  32755. t + 1
  32756. }
  32757. ,
  32758. a.prototype.writeInt16LE = function(e, t, i) {
  32759. return e = +e,
  32760. t |= 0,
  32761. i || B(this, e, t, 2, 32767, -32768),
  32762. a.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e,
  32763. this[t + 1] = e >>> 8) : F(this, e, t, !0),
  32764. t + 2
  32765. }
  32766. ,
  32767. a.prototype.writeInt16BE = function(e, t, i) {
  32768. return e = +e,
  32769. t |= 0,
  32770. i || B(this, e, t, 2, 32767, -32768),
  32771. a.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 8,
  32772. this[t + 1] = 255 & e) : F(this, e, t, !1),
  32773. t + 2
  32774. }
  32775. ,
  32776. a.prototype.writeInt32LE = function(e, t, i) {
  32777. return e = +e,
  32778. t |= 0,
  32779. i || B(this, e, t, 4, 2147483647, -2147483648),
  32780. a.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e,
  32781. this[t + 1] = e >>> 8,
  32782. this[t + 2] = e >>> 16,
  32783. this[t + 3] = e >>> 24) : V(this, e, t, !0),
  32784. t + 4
  32785. }
  32786. ,
  32787. a.prototype.writeInt32BE = function(e, t, i) {
  32788. return e = +e,
  32789. t |= 0,
  32790. i || B(this, e, t, 4, 2147483647, -2147483648),
  32791. e < 0 && (e = 4294967295 + e + 1),
  32792. a.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 24,
  32793. this[t + 1] = e >>> 16,
  32794. this[t + 2] = e >>> 8,
  32795. this[t + 3] = 255 & e) : V(this, e, t, !1),
  32796. t + 4
  32797. }
  32798. ,
  32799. a.prototype.writeFloatLE = function(e, t, i) {
  32800. return k(this, e, t, !0, i)
  32801. }
  32802. ,
  32803. a.prototype.writeFloatBE = function(e, t, i) {
  32804. return k(this, e, t, !1, i)
  32805. }
  32806. ,
  32807. a.prototype.writeDoubleLE = function(e, t, i) {
  32808. return H(this, e, t, !0, i)
  32809. }
  32810. ,
  32811. a.prototype.writeDoubleBE = function(e, t, i) {
  32812. return H(this, e, t, !1, i)
  32813. }
  32814. ,
  32815. a.prototype.copy = function(e, t, i, n) {
  32816. if (i || (i = 0),
  32817. n || 0 === n || (n = this.length),
  32818. t >= e.length && (t = e.length),
  32819. t || (t = 0),
  32820. n > 0 && n < i && (n = i),
  32821. n === i)
  32822. return 0;
  32823. if (0 === e.length || 0 === this.length)
  32824. return 0;
  32825. if (t < 0)
  32826. throw new RangeError("targetStart out of bounds");
  32827. if (i < 0 || i >= this.length)
  32828. throw new RangeError("sourceStart out of bounds");
  32829. if (n < 0)
  32830. throw new RangeError("sourceEnd out of bounds");
  32831. n > this.length && (n = this.length),
  32832. e.length - t < n - i && (n = e.length - t + i);
  32833. var r, o = n - i;
  32834. if (this === e && i < t && t < n)
  32835. for (r = o - 1; r >= 0; --r)
  32836. e[r + t] = this[r + i];
  32837. else if (o < 1e3 || !a.TYPED_ARRAY_SUPPORT)
  32838. for (r = 0; r < o; ++r)
  32839. e[r + t] = this[r + i];
  32840. else
  32841. Uint8Array.prototype.set.call(e, this.subarray(i, i + o), t);
  32842. return o
  32843. }
  32844. ,
  32845. a.prototype.fill = function(e, t, i, n) {
  32846. if ("string" == typeof e) {
  32847. if ("string" == typeof t ? (n = t,
  32848. t = 0,
  32849. i = this.length) : "string" == typeof i && (n = i,
  32850. i = this.length),
  32851. 1 === e.length) {
  32852. var r = e.charCodeAt(0);
  32853. r < 256 && (e = r)
  32854. }
  32855. if (void 0 !== n && "string" != typeof n)
  32856. throw new TypeError("encoding must be a string");
  32857. if ("string" == typeof n && !a.isEncoding(n))
  32858. throw new TypeError("Unknown encoding: " + n)
  32859. } else
  32860. "number" == typeof e && (e &= 255);
  32861. if (t < 0 || this.length < t || this.length < i)
  32862. throw new RangeError("Out of range index");
  32863. if (i <= t)
  32864. return this;
  32865. t >>>= 0,
  32866. i = void 0 === i ? this.length : i >>> 0,
  32867. e || (e = 0);
  32868. var o;
  32869. if ("number" == typeof e)
  32870. for (o = t; o < i; ++o)
  32871. this[o] = e;
  32872. else {
  32873. var s = a.isBuffer(e) ? e : j(new a(e,n).toString())
  32874. , l = s.length;
  32875. for (o = 0; o < i - t; ++o)
  32876. this[o + t] = s[o % l]
  32877. }
  32878. return this
  32879. }
  32880. ;
  32881. var te = /[^+\/0-9A-Za-z-_]/g
  32882. }
  32883. ).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
  32884. }
  32885. , {
  32886. "base64-js": 199,
  32887. ieee754: 200,
  32888. isarray: 201
  32889. }],
  32890. 199: [function(e, t, i) {
  32891. "use strict";
  32892. function n(e) {
  32893. var t = e.length;
  32894. if (t % 4 > 0)
  32895. throw new Error("Invalid string. Length must be a multiple of 4");
  32896. return "=" === e[t - 2] ? 2 : "=" === e[t - 1] ? 1 : 0
  32897. }
  32898. function r(e) {
  32899. return 3 * e.length / 4 - n(e)
  32900. }
  32901. function o(e) {
  32902. var t, i, r, o, a, s, l = e.length;
  32903. a = n(e),
  32904. s = new u(3 * l / 4 - a),
  32905. r = a > 0 ? l - 4 : l;
  32906. var c = 0;
  32907. for (t = 0,
  32908. i = 0; t < r; t += 4,
  32909. i += 3)
  32910. o = h[e.charCodeAt(t)] << 18 | h[e.charCodeAt(t + 1)] << 12 | h[e.charCodeAt(t + 2)] << 6 | h[e.charCodeAt(t + 3)],
  32911. s[c++] = o >> 16 & 255,
  32912. s[c++] = o >> 8 & 255,
  32913. s[c++] = 255 & o;
  32914. return 2 === a ? (o = h[e.charCodeAt(t)] << 2 | h[e.charCodeAt(t + 1)] >> 4,
  32915. s[c++] = 255 & o) : 1 === a && (o = h[e.charCodeAt(t)] << 10 | h[e.charCodeAt(t + 1)] << 4 | h[e.charCodeAt(t + 2)] >> 2,
  32916. s[c++] = o >> 8 & 255,
  32917. s[c++] = 255 & o),
  32918. s
  32919. }
  32920. function a(e) {
  32921. return c[e >> 18 & 63] + c[e >> 12 & 63] + c[e >> 6 & 63] + c[63 & e]
  32922. }
  32923. function s(e, t, i) {
  32924. for (var n, r = [], o = t; o < i; o += 3)
  32925. n = (e[o] << 16) + (e[o + 1] << 8) + e[o + 2],
  32926. r.push(a(n));
  32927. return r.join("")
  32928. }
  32929. function l(e) {
  32930. for (var t, i = e.length, n = i % 3, r = "", o = [], a = 16383, l = 0, h = i - n; l < h; l += a)
  32931. o.push(s(e, l, l + a > h ? h : l + a));
  32932. return 1 === n ? (t = e[i - 1],
  32933. r += c[t >> 2],
  32934. r += c[t << 4 & 63],
  32935. r += "==") : 2 === n && (t = (e[i - 2] << 8) + e[i - 1],
  32936. r += c[t >> 10],
  32937. r += c[t >> 4 & 63],
  32938. r += c[t << 2 & 63],
  32939. r += "="),
  32940. o.push(r),
  32941. o.join("")
  32942. }
  32943. i.byteLength = r,
  32944. i.toByteArray = o,
  32945. i.fromByteArray = l;
  32946. for (var c = [], h = [], u = "undefined" != typeof Uint8Array ? Uint8Array : Array, d = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", p = 0, f = d.length; p < f; ++p)
  32947. c[p] = d[p],
  32948. h[d.charCodeAt(p)] = p;
  32949. h["-".charCodeAt(0)] = 62,
  32950. h["_".charCodeAt(0)] = 63
  32951. }
  32952. , {}],
  32953. 200: [function(e, t, i) {
  32954. i.read = function(e, t, i, n, r) {
  32955. 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];
  32956. for (u += d,
  32957. o = p & (1 << -h) - 1,
  32958. p >>= -h,
  32959. h += s; h > 0; o = 256 * o + e[t + u],
  32960. u += d,
  32961. h -= 8)
  32962. ;
  32963. for (a = o & (1 << -h) - 1,
  32964. o >>= -h,
  32965. h += n; h > 0; a = 256 * a + e[t + u],
  32966. u += d,
  32967. h -= 8)
  32968. ;
  32969. if (0 === o)
  32970. o = 1 - c;
  32971. else {
  32972. if (o === l)
  32973. return a ? NaN : (p ? -1 : 1) * (1 / 0);
  32974. a += Math.pow(2, n),
  32975. o -= c
  32976. }
  32977. return (p ? -1 : 1) * a * Math.pow(2, o - n)
  32978. }
  32979. ,
  32980. i.write = function(e, t, i, n, r, o) {
  32981. 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;
  32982. for (t = Math.abs(t),
  32983. isNaN(t) || t === 1 / 0 ? (s = isNaN(t) ? 1 : 0,
  32984. a = h) : (a = Math.floor(Math.log(t) / Math.LN2),
  32985. t * (l = Math.pow(2, -a)) < 1 && (a--,
  32986. l *= 2),
  32987. t += a + u >= 1 ? d / l : d * Math.pow(2, 1 - u),
  32988. t * l >= 2 && (a++,
  32989. l /= 2),
  32990. a + u >= h ? (s = 0,
  32991. a = h) : a + u >= 1 ? (s = (t * l - 1) * Math.pow(2, r),
  32992. a += u) : (s = t * Math.pow(2, u - 1) * Math.pow(2, r),
  32993. a = 0)); r >= 8; e[i + p] = 255 & s,
  32994. p += f,
  32995. s /= 256,
  32996. r -= 8)
  32997. ;
  32998. for (a = a << r | s,
  32999. c += r; c > 0; e[i + p] = 255 & a,
  33000. p += f,
  33001. a /= 256,
  33002. c -= 8)
  33003. ;
  33004. e[i + p - f] |= 128 * g
  33005. }
  33006. }
  33007. , {}],
  33008. 201: [function(e, t, i) {
  33009. var n = {}.toString;
  33010. t.exports = Array.isArray || function(e) {
  33011. return "[object Array]" == n.call(e)
  33012. }
  33013. }
  33014. , {}],
  33015. 202: [function(e, t, i) {
  33016. function n() {
  33017. this._events = this._events || {},
  33018. this._maxListeners = this._maxListeners || void 0
  33019. }
  33020. function r(e) {
  33021. return "function" == typeof e
  33022. }
  33023. function o(e) {
  33024. return "number" == typeof e
  33025. }
  33026. function a(e) {
  33027. return "object" == typeof e && null !== e
  33028. }
  33029. function s(e) {
  33030. return void 0 === e
  33031. }
  33032. t.exports = n,
  33033. n.EventEmitter = n,
  33034. n.prototype._events = void 0,
  33035. n.prototype._maxListeners = void 0,
  33036. n.defaultMaxListeners = 10,
  33037. n.prototype.setMaxListeners = function(e) {
  33038. if (!o(e) || e < 0 || isNaN(e))
  33039. throw TypeError("n must be a positive number");
  33040. return this._maxListeners = e,
  33041. this
  33042. }
  33043. ,
  33044. n.prototype.emit = function(e) {
  33045. var t, i, n, o, l, c;
  33046. if (this._events || (this._events = {}),
  33047. "error" === e && (!this._events.error || a(this._events.error) && !this._events.error.length)) {
  33048. if (t = arguments[1],
  33049. t instanceof Error)
  33050. throw t;
  33051. var h = new Error('Uncaught, unspecified "error" event. (' + t + ")");
  33052. throw h.context = t,
  33053. h
  33054. }
  33055. if (i = this._events[e],
  33056. s(i))
  33057. return !1;
  33058. if (r(i))
  33059. switch (arguments.length) {
  33060. case 1:
  33061. i.call(this);
  33062. break;
  33063. case 2:
  33064. i.call(this, arguments[1]);
  33065. break;
  33066. case 3:
  33067. i.call(this, arguments[1], arguments[2]);
  33068. break;
  33069. default:
  33070. o = Array.prototype.slice.call(arguments, 1),
  33071. i.apply(this, o)
  33072. }
  33073. else if (a(i))
  33074. for (o = Array.prototype.slice.call(arguments, 1),
  33075. c = i.slice(),
  33076. n = c.length,
  33077. l = 0; l < n; l++)
  33078. c[l].apply(this, o);
  33079. return !0
  33080. }
  33081. ,
  33082. n.prototype.addListener = function(e, t) {
  33083. var i;
  33084. if (!r(t))
  33085. throw TypeError("listener must be a function");
  33086. return this._events || (this._events = {}),
  33087. this._events.newListener && this.emit("newListener", e, r(t.listener) ? t.listener : t),
  33088. this._events[e] ? a(this._events[e]) ? this._events[e].push(t) : this._events[e] = [this._events[e], t] : this._events[e] = t,
  33089. a(this._events[e]) && !this._events[e].warned && (i = s(this._maxListeners) ? n.defaultMaxListeners : this._maxListeners,
  33090. i && i > 0 && this._events[e].length > i && (this._events[e].warned = !0,
  33091. console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.", this._events[e].length),
  33092. "function" == typeof console.trace && console.trace())),
  33093. this
  33094. }
  33095. ,
  33096. n.prototype.on = n.prototype.addListener,
  33097. n.prototype.once = function(e, t) {
  33098. function i() {
  33099. this.removeListener(e, i),
  33100. n || (n = !0,
  33101. t.apply(this, arguments))
  33102. }
  33103. if (!r(t))
  33104. throw TypeError("listener must be a function");
  33105. var n = !1;
  33106. return i.listener = t,
  33107. this.on(e, i),
  33108. this
  33109. }
  33110. ,
  33111. n.prototype.removeListener = function(e, t) {
  33112. var i, n, o, s;
  33113. if (!r(t))
  33114. throw TypeError("listener must be a function");
  33115. if (!this._events || !this._events[e])
  33116. return this;
  33117. if (i = this._events[e],
  33118. o = i.length,
  33119. n = -1,
  33120. i === t || r(i.listener) && i.listener === t)
  33121. delete this._events[e],
  33122. this._events.removeListener && this.emit("removeListener", e, t);
  33123. else if (a(i)) {
  33124. for (s = o; s-- > 0; )
  33125. if (i[s] === t || i[s].listener && i[s].listener === t) {
  33126. n = s;
  33127. break
  33128. }
  33129. if (n < 0)
  33130. return this;
  33131. 1 === i.length ? (i.length = 0,
  33132. delete this._events[e]) : i.splice(n, 1),
  33133. this._events.removeListener && this.emit("removeListener", e, t)
  33134. }
  33135. return this
  33136. }
  33137. ,
  33138. n.prototype.removeAllListeners = function(e) {
  33139. var t, i;
  33140. if (!this._events)
  33141. return this;
  33142. if (!this._events.removeListener)
  33143. return 0 === arguments.length ? this._events = {} : this._events[e] && delete this._events[e],
  33144. this;
  33145. if (0 === arguments.length) {
  33146. for (t in this._events)
  33147. "removeListener" !== t && this.removeAllListeners(t);
  33148. return this.removeAllListeners("removeListener"),
  33149. this._events = {},
  33150. this
  33151. }
  33152. if (i = this._events[e],
  33153. r(i))
  33154. this.removeListener(e, i);
  33155. else if (i)
  33156. for (; i.length; )
  33157. this.removeListener(e, i[i.length - 1]);
  33158. return delete this._events[e],
  33159. this
  33160. }
  33161. ,
  33162. n.prototype.listeners = function(e) {
  33163. var t;
  33164. return t = this._events && this._events[e] ? r(this._events[e]) ? [this._events[e]] : this._events[e].slice() : []
  33165. }
  33166. ,
  33167. n.prototype.listenerCount = function(e) {
  33168. if (this._events) {
  33169. var t = this._events[e];
  33170. if (r(t))
  33171. return 1;
  33172. if (t)
  33173. return t.length
  33174. }
  33175. return 0
  33176. }
  33177. ,
  33178. n.listenerCount = function(e, t) {
  33179. return e.listenerCount(t)
  33180. }
  33181. }
  33182. , {}],
  33183. 203: [function(e, t, i) {
  33184. function n() {
  33185. throw new Error("setTimeout has not been defined")
  33186. }
  33187. function r() {
  33188. throw new Error("clearTimeout has not been defined")
  33189. }
  33190. function o(e) {
  33191. if (u === setTimeout)
  33192. return setTimeout(e, 0);
  33193. if ((u === n || !u) && setTimeout)
  33194. return u = setTimeout,
  33195. setTimeout(e, 0);
  33196. try {
  33197. return u(e, 0)
  33198. } catch (t) {
  33199. try {
  33200. return u.call(null, e, 0)
  33201. } catch (t) {
  33202. return u.call(this, e, 0)
  33203. }
  33204. }
  33205. }
  33206. function a(e) {
  33207. if (d === clearTimeout)
  33208. return clearTimeout(e);
  33209. if ((d === r || !d) && clearTimeout)
  33210. return d = clearTimeout,
  33211. clearTimeout(e);
  33212. try {
  33213. return d(e)
  33214. } catch (t) {
  33215. try {
  33216. return d.call(null, e)
  33217. } catch (t) {
  33218. return d.call(this, e)
  33219. }
  33220. }
  33221. }
  33222. function s() {
  33223. m && f && (m = !1,
  33224. f.length ? g = f.concat(g) : v = -1,
  33225. g.length && l())
  33226. }
  33227. function l() {
  33228. if (!m) {
  33229. var e = o(s);
  33230. m = !0;
  33231. for (var t = g.length; t; ) {
  33232. for (f = g,
  33233. g = []; ++v < t; )
  33234. f && f[v].run();
  33235. v = -1,
  33236. t = g.length
  33237. }
  33238. f = null,
  33239. m = !1,
  33240. a(e)
  33241. }
  33242. }
  33243. function c(e, t) {
  33244. this.fun = e,
  33245. this.array = t
  33246. }
  33247. function h() {}
  33248. var u, d, p = t.exports = {};
  33249. !function() {
  33250. try {
  33251. u = "function" == typeof setTimeout ? setTimeout : n
  33252. } catch (e) {
  33253. u = n
  33254. }
  33255. try {
  33256. d = "function" == typeof clearTimeout ? clearTimeout : r
  33257. } catch (e) {
  33258. d = r
  33259. }
  33260. }();
  33261. var f, g = [], m = !1, v = -1;
  33262. p.nextTick = function(e) {
  33263. var t = new Array(arguments.length - 1);
  33264. if (arguments.length > 1)
  33265. for (var i = 1; i < arguments.length; i++)
  33266. t[i - 1] = arguments[i];
  33267. g.push(new c(e,t)),
  33268. 1 !== g.length || m || o(l)
  33269. }
  33270. ,
  33271. c.prototype.run = function() {
  33272. this.fun.apply(null, this.array)
  33273. }
  33274. ,
  33275. p.title = "browser",
  33276. p.browser = !0,
  33277. p.env = {},
  33278. p.argv = [],
  33279. p.version = "",
  33280. p.versions = {},
  33281. p.on = h,
  33282. p.addListener = h,
  33283. p.once = h,
  33284. p.off = h,
  33285. p.removeListener = h,
  33286. p.removeAllListeners = h,
  33287. p.emit = h,
  33288. p.binding = function(e) {
  33289. throw new Error("process.binding is not supported")
  33290. }
  33291. ,
  33292. p.cwd = function() {
  33293. return "/"
  33294. }
  33295. ,
  33296. p.chdir = function(e) {
  33297. throw new Error("process.chdir is not supported")
  33298. }
  33299. ,
  33300. p.umask = function() {
  33301. return 0
  33302. }
  33303. }
  33304. , {}],
  33305. 204: [function(e, t, i) {
  33306. (function(e) {
  33307. !function(n) {
  33308. function r(e) {
  33309. throw new RangeError(L[e])
  33310. }
  33311. function o(e, t) {
  33312. for (var i = e.length, n = []; i--; )
  33313. n[i] = t(e[i]);
  33314. return n
  33315. }
  33316. function a(e, t) {
  33317. var i = e.split("@")
  33318. , n = "";
  33319. i.length > 1 && (n = i[0] + "@",
  33320. e = i[1]),
  33321. e = e.replace(O, ".");
  33322. var r = e.split(".")
  33323. , a = o(r, t).join(".");
  33324. return n + a
  33325. }
  33326. function s(e) {
  33327. for (var t, i, n = [], r = 0, o = e.length; r < o; )
  33328. t = e.charCodeAt(r++),
  33329. t >= 55296 && t <= 56319 && r < o ? (i = e.charCodeAt(r++),
  33330. 56320 == (64512 & i) ? n.push(((1023 & t) << 10) + (1023 & i) + 65536) : (n.push(t),
  33331. r--)) : n.push(t);
  33332. return n
  33333. }
  33334. function l(e) {
  33335. return o(e, function(e) {
  33336. var t = "";
  33337. return e > 65535 && (e -= 65536,
  33338. t += B(e >>> 10 & 1023 | 55296),
  33339. e = 56320 | 1023 & e),
  33340. t += B(e)
  33341. }).join("")
  33342. }
  33343. function c(e) {
  33344. return e - 48 < 10 ? e - 22 : e - 65 < 26 ? e - 65 : e - 97 < 26 ? e - 97 : E
  33345. }
  33346. function h(e, t) {
  33347. return e + 22 + 75 * (e < 26) - ((0 != t) << 5)
  33348. }
  33349. function u(e, t, i) {
  33350. var n = 0;
  33351. for (e = i ? N(e / T) : e >> 1,
  33352. e += N(e / t); e > D * w >> 1; n += E)
  33353. e = N(e / D);
  33354. return N(n + (D + 1) * e / (e + _))
  33355. }
  33356. function d(e) {
  33357. var t, i, n, o, a, s, h, d, p, f, g = [], m = e.length, v = 0, A = S, y = x;
  33358. for (i = e.lastIndexOf(M),
  33359. i < 0 && (i = 0),
  33360. n = 0; n < i; ++n)
  33361. e.charCodeAt(n) >= 128 && r("not-basic"),
  33362. g.push(e.charCodeAt(n));
  33363. for (o = i > 0 ? i + 1 : 0; o < m; ) {
  33364. for (a = v,
  33365. s = 1,
  33366. h = E; o >= m && r("invalid-input"),
  33367. d = c(e.charCodeAt(o++)),
  33368. (d >= E || d > N((I - v) / s)) && r("overflow"),
  33369. v += d * s,
  33370. p = h <= y ? b : h >= y + w ? w : h - y,
  33371. !(d < p); h += E)
  33372. f = E - p,
  33373. s > N(I / f) && r("overflow"),
  33374. s *= f;
  33375. t = g.length + 1,
  33376. y = u(v - a, t, 0 == a),
  33377. N(v / t) > I - A && r("overflow"),
  33378. A += N(v / t),
  33379. v %= t,
  33380. g.splice(v++, 0, A)
  33381. }
  33382. return l(g)
  33383. }
  33384. function p(e) {
  33385. var t, i, n, o, a, l, c, d, p, f, g, m, v, A, y, C = [];
  33386. for (e = s(e),
  33387. m = e.length,
  33388. t = S,
  33389. i = 0,
  33390. a = x,
  33391. l = 0; l < m; ++l)
  33392. g = e[l],
  33393. g < 128 && C.push(B(g));
  33394. for (n = o = C.length,
  33395. o && C.push(M); n < m; ) {
  33396. for (c = I,
  33397. l = 0; l < m; ++l)
  33398. g = e[l],
  33399. g >= t && g < c && (c = g);
  33400. for (v = n + 1,
  33401. c - t > N((I - i) / v) && r("overflow"),
  33402. i += (c - t) * v,
  33403. t = c,
  33404. l = 0; l < m; ++l)
  33405. if (g = e[l],
  33406. g < t && ++i > I && r("overflow"),
  33407. g == t) {
  33408. for (d = i,
  33409. p = E; f = p <= a ? b : p >= a + w ? w : p - a,
  33410. !(d < f); p += E)
  33411. y = d - f,
  33412. A = E - f,
  33413. C.push(B(h(f + y % A, 0))),
  33414. d = N(y / A);
  33415. C.push(B(h(d, 0))),
  33416. a = u(i, v, n == o),
  33417. i = 0,
  33418. ++n
  33419. }
  33420. ++i,
  33421. ++t
  33422. }
  33423. return C.join("")
  33424. }
  33425. function f(e) {
  33426. return a(e, function(e) {
  33427. return R.test(e) ? d(e.slice(4).toLowerCase()) : e
  33428. })
  33429. }
  33430. function g(e) {
  33431. return a(e, function(e) {
  33432. return P.test(e) ? "xn--" + p(e) : e
  33433. })
  33434. }
  33435. var m = "object" == typeof i && i && !i.nodeType && i
  33436. , v = "object" == typeof t && t && !t.nodeType && t
  33437. , A = "object" == typeof e && e;
  33438. A.global !== A && A.window !== A && A.self !== A || (n = A);
  33439. 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 = {
  33440. overflow: "Overflow: input needs wider integers to process",
  33441. "not-basic": "Illegal input >= 0x80 (not a basic code point)",
  33442. "invalid-input": "Invalid input"
  33443. }, D = E - b, N = Math.floor, B = String.fromCharCode;
  33444. if (y = {
  33445. version: "1.4.1",
  33446. ucs2: {
  33447. decode: s,
  33448. encode: l
  33449. },
  33450. decode: d,
  33451. encode: p,
  33452. toASCII: g,
  33453. toUnicode: f
  33454. },
  33455. "function" == typeof define && "object" == typeof define.amd && define.amd)
  33456. define("punycode", function() {
  33457. return y
  33458. });
  33459. else if (m && v)
  33460. if (t.exports == m)
  33461. v.exports = y;
  33462. else
  33463. for (C in y)
  33464. y.hasOwnProperty(C) && (m[C] = y[C]);
  33465. else
  33466. n.punycode = y
  33467. }(this)
  33468. }
  33469. ).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
  33470. }
  33471. , {}],
  33472. 205: [function(e, t, i) {
  33473. "use strict";
  33474. function n(e, t) {
  33475. return Object.prototype.hasOwnProperty.call(e, t)
  33476. }
  33477. t.exports = function(e, t, i, o) {
  33478. t = t || "&",
  33479. i = i || "=";
  33480. var a = {};
  33481. if ("string" != typeof e || 0 === e.length)
  33482. return a;
  33483. var s = /\+/g;
  33484. e = e.split(t);
  33485. var l = 1e3;
  33486. o && "number" == typeof o.maxKeys && (l = o.maxKeys);
  33487. var c = e.length;
  33488. l > 0 && c > l && (c = l);
  33489. for (var h = 0; h < c; ++h) {
  33490. var u, d, p, f, g = e[h].replace(s, "%20"), m = g.indexOf(i);
  33491. m >= 0 ? (u = g.substr(0, m),
  33492. d = g.substr(m + 1)) : (u = g,
  33493. d = ""),
  33494. p = decodeURIComponent(u),
  33495. f = decodeURIComponent(d),
  33496. n(a, p) ? r(a[p]) ? a[p].push(f) : a[p] = [a[p], f] : a[p] = f
  33497. }
  33498. return a
  33499. }
  33500. ;
  33501. var r = Array.isArray || function(e) {
  33502. return "[object Array]" === Object.prototype.toString.call(e)
  33503. }
  33504. }
  33505. , {}],
  33506. 206: [function(e, t, i) {
  33507. "use strict";
  33508. function n(e, t) {
  33509. if (e.map)
  33510. return e.map(t);
  33511. for (var i = [], n = 0; n < e.length; n++)
  33512. i.push(t(e[n], n));
  33513. return i
  33514. }
  33515. var r = function(e) {
  33516. switch (typeof e) {
  33517. case "string":
  33518. return e;
  33519. case "boolean":
  33520. return e ? "true" : "false";
  33521. case "number":
  33522. return isFinite(e) ? e : "";
  33523. default:
  33524. return ""
  33525. }
  33526. };
  33527. t.exports = function(e, t, i, s) {
  33528. return t = t || "&",
  33529. i = i || "=",
  33530. null === e && (e = void 0),
  33531. "object" == typeof e ? n(a(e), function(a) {
  33532. var s = encodeURIComponent(r(a)) + i;
  33533. return o(e[a]) ? n(e[a], function(e) {
  33534. return s + encodeURIComponent(r(e))
  33535. }).join(t) : s + encodeURIComponent(r(e[a]))
  33536. }).join(t) : s ? encodeURIComponent(r(s)) + i + encodeURIComponent(r(e)) : ""
  33537. }
  33538. ;
  33539. var o = Array.isArray || function(e) {
  33540. return "[object Array]" === Object.prototype.toString.call(e)
  33541. }
  33542. , a = Object.keys || function(e) {
  33543. var t = [];
  33544. for (var i in e)
  33545. Object.prototype.hasOwnProperty.call(e, i) && t.push(i);
  33546. return t
  33547. }
  33548. }
  33549. , {}],
  33550. 207: [function(e, t, i) {
  33551. "use strict";
  33552. i.decode = i.parse = e("./decode"),
  33553. i.encode = i.stringify = e("./encode")
  33554. }
  33555. , {
  33556. "./decode": 205,
  33557. "./encode": 206
  33558. }],
  33559. 208: [function(e, t, i) {
  33560. "use strict";
  33561. function n() {
  33562. this.protocol = null,
  33563. this.slashes = null,
  33564. this.auth = null,
  33565. this.host = null,
  33566. this.port = null,
  33567. this.hostname = null,
  33568. this.hash = null,
  33569. this.search = null,
  33570. this.query = null,
  33571. this.pathname = null,
  33572. this.path = null,
  33573. this.href = null
  33574. }
  33575. function r(e, t, i) {
  33576. if (e && c.isObject(e) && e instanceof n)
  33577. return e;
  33578. var r = new n;
  33579. return r.parse(e, t, i),
  33580. r
  33581. }
  33582. function o(e) {
  33583. return c.isString(e) && (e = r(e)),
  33584. e instanceof n ? e.format() : n.prototype.format.call(e)
  33585. }
  33586. function a(e, t) {
  33587. return r(e, !1, !0).resolve(t)
  33588. }
  33589. function s(e, t) {
  33590. return e ? r(e, !1, !0).resolveObject(t) : t
  33591. }
  33592. var l = e("punycode")
  33593. , c = e("./util");
  33594. i.parse = r,
  33595. i.resolve = a,
  33596. i.resolveObject = s,
  33597. i.format = o,
  33598. i.Url = n;
  33599. var h = /^([a-z0-9.+-]+:)/i
  33600. , u = /:[0-9]*$/
  33601. , d = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/
  33602. , p = ["<", ">", '"', "`", " ", "\r", "\n", "\t"]
  33603. , f = ["{", "}", "|", "\\", "^", "`"].concat(p)
  33604. , g = ["'"].concat(f)
  33605. , m = ["%", "/", "?", ";", "#"].concat(g)
  33606. , v = ["/", "?", "#"]
  33607. , A = 255
  33608. , y = /^[+a-z0-9A-Z_-]{0,63}$/
  33609. , C = /^([+a-z0-9A-Z_-]{0,63})(.*)$/
  33610. , I = {
  33611. javascript: !0,
  33612. "javascript:": !0
  33613. }
  33614. , E = {
  33615. javascript: !0,
  33616. "javascript:": !0
  33617. }
  33618. , b = {
  33619. http: !0,
  33620. https: !0,
  33621. ftp: !0,
  33622. gopher: !0,
  33623. file: !0,
  33624. "http:": !0,
  33625. "https:": !0,
  33626. "ftp:": !0,
  33627. "gopher:": !0,
  33628. "file:": !0
  33629. }
  33630. , w = e("querystring");
  33631. n.prototype.parse = function(e, t, i) {
  33632. if (!c.isString(e))
  33633. throw new TypeError("Parameter 'url' must be a string, not " + typeof e);
  33634. var n = e.indexOf("?")
  33635. , r = n !== -1 && n < e.indexOf("#") ? "?" : "#"
  33636. , o = e.split(r)
  33637. , a = /\\/g;
  33638. o[0] = o[0].replace(a, "/"),
  33639. e = o.join(r);
  33640. var s = e;
  33641. if (s = s.trim(),
  33642. !i && 1 === e.split("#").length) {
  33643. var u = d.exec(s);
  33644. if (u)
  33645. return this.path = s,
  33646. this.href = s,
  33647. this.pathname = u[1],
  33648. u[2] ? (this.search = u[2],
  33649. t ? this.query = w.parse(this.search.substr(1)) : this.query = this.search.substr(1)) : t && (this.search = "",
  33650. this.query = {}),
  33651. this
  33652. }
  33653. var p = h.exec(s);
  33654. if (p) {
  33655. p = p[0];
  33656. var f = p.toLowerCase();
  33657. this.protocol = f,
  33658. s = s.substr(p.length)
  33659. }
  33660. if (i || p || s.match(/^\/\/[^@\/]+@[^@\/]+/)) {
  33661. var _ = "//" === s.substr(0, 2);
  33662. !_ || p && E[p] || (s = s.substr(2),
  33663. this.slashes = !0)
  33664. }
  33665. if (!E[p] && (_ || p && !b[p])) {
  33666. for (var T = -1, x = 0; x < v.length; x++) {
  33667. var S = s.indexOf(v[x]);
  33668. S !== -1 && (T === -1 || S < T) && (T = S)
  33669. }
  33670. var M, R;
  33671. R = T === -1 ? s.lastIndexOf("@") : s.lastIndexOf("@", T),
  33672. R !== -1 && (M = s.slice(0, R),
  33673. s = s.slice(R + 1),
  33674. this.auth = decodeURIComponent(M)),
  33675. T = -1;
  33676. for (var x = 0; x < m.length; x++) {
  33677. var S = s.indexOf(m[x]);
  33678. S !== -1 && (T === -1 || S < T) && (T = S)
  33679. }
  33680. T === -1 && (T = s.length),
  33681. this.host = s.slice(0, T),
  33682. s = s.slice(T),
  33683. this.parseHost(),
  33684. this.hostname = this.hostname || "";
  33685. var P = "[" === this.hostname[0] && "]" === this.hostname[this.hostname.length - 1];
  33686. if (!P)
  33687. for (var O = this.hostname.split(/\./), x = 0, L = O.length; x < L; x++) {
  33688. var D = O[x];
  33689. if (D && !D.match(y)) {
  33690. for (var N = "", B = 0, F = D.length; B < F; B++)
  33691. N += D.charCodeAt(B) > 127 ? "x" : D[B];
  33692. if (!N.match(y)) {
  33693. var V = O.slice(0, x)
  33694. , U = O.slice(x + 1)
  33695. , k = D.match(C);
  33696. k && (V.push(k[1]),
  33697. U.unshift(k[2])),
  33698. U.length && (s = "/" + U.join(".") + s),
  33699. this.hostname = V.join(".");
  33700. break
  33701. }
  33702. }
  33703. }
  33704. this.hostname.length > A ? this.hostname = "" : this.hostname = this.hostname.toLowerCase(),
  33705. P || (this.hostname = l.toASCII(this.hostname));
  33706. var H = this.port ? ":" + this.port : ""
  33707. , G = this.hostname || "";
  33708. this.host = G + H,
  33709. this.href += this.host,
  33710. P && (this.hostname = this.hostname.substr(1, this.hostname.length - 2),
  33711. "/" !== s[0] && (s = "/" + s))
  33712. }
  33713. if (!I[f])
  33714. for (var x = 0, L = g.length; x < L; x++) {
  33715. var z = g[x];
  33716. if (s.indexOf(z) !== -1) {
  33717. var W = encodeURIComponent(z);
  33718. W === z && (W = escape(z)),
  33719. s = s.split(z).join(W)
  33720. }
  33721. }
  33722. var j = s.indexOf("#");
  33723. j !== -1 && (this.hash = s.substr(j),
  33724. s = s.slice(0, j));
  33725. var Y = s.indexOf("?");
  33726. if (Y !== -1 ? (this.search = s.substr(Y),
  33727. this.query = s.substr(Y + 1),
  33728. t && (this.query = w.parse(this.query)),
  33729. s = s.slice(0, Y)) : t && (this.search = "",
  33730. this.query = {}),
  33731. s && (this.pathname = s),
  33732. b[f] && this.hostname && !this.pathname && (this.pathname = "/"),
  33733. this.pathname || this.search) {
  33734. var H = this.pathname || ""
  33735. , X = this.search || "";
  33736. this.path = H + X
  33737. }
  33738. return this.href = this.format(),
  33739. this
  33740. }
  33741. ,
  33742. n.prototype.format = function() {
  33743. var e = this.auth || "";
  33744. e && (e = encodeURIComponent(e),
  33745. e = e.replace(/%3A/i, ":"),
  33746. e += "@");
  33747. var t = this.protocol || ""
  33748. , i = this.pathname || ""
  33749. , n = this.hash || ""
  33750. , r = !1
  33751. , o = "";
  33752. this.host ? r = e + this.host : this.hostname && (r = e + (this.hostname.indexOf(":") === -1 ? this.hostname : "[" + this.hostname + "]"),
  33753. this.port && (r += ":" + this.port)),
  33754. this.query && c.isObject(this.query) && Object.keys(this.query).length && (o = w.stringify(this.query));
  33755. var a = this.search || o && "?" + o || "";
  33756. return t && ":" !== t.substr(-1) && (t += ":"),
  33757. this.slashes || (!t || b[t]) && r !== !1 ? (r = "//" + (r || ""),
  33758. i && "/" !== i.charAt(0) && (i = "/" + i)) : r || (r = ""),
  33759. n && "#" !== n.charAt(0) && (n = "#" + n),
  33760. a && "?" !== a.charAt(0) && (a = "?" + a),
  33761. i = i.replace(/[?#]/g, function(e) {
  33762. return encodeURIComponent(e)
  33763. }),
  33764. a = a.replace("#", "%23"),
  33765. t + r + i + a + n
  33766. }
  33767. ,
  33768. n.prototype.resolve = function(e) {
  33769. return this.resolveObject(r(e, !1, !0)).format()
  33770. }
  33771. ,
  33772. n.prototype.resolveObject = function(e) {
  33773. if (c.isString(e)) {
  33774. var t = new n;
  33775. t.parse(e, !1, !0),
  33776. e = t
  33777. }
  33778. for (var i = new n, r = Object.keys(this), o = 0; o < r.length; o++) {
  33779. var a = r[o];
  33780. i[a] = this[a]
  33781. }
  33782. if (i.hash = e.hash,
  33783. "" === e.href)
  33784. return i.href = i.format(),
  33785. i;
  33786. if (e.slashes && !e.protocol) {
  33787. for (var s = Object.keys(e), l = 0; l < s.length; l++) {
  33788. var h = s[l];
  33789. "protocol" !== h && (i[h] = e[h])
  33790. }
  33791. return b[i.protocol] && i.hostname && !i.pathname && (i.path = i.pathname = "/"),
  33792. i.href = i.format(),
  33793. i
  33794. }
  33795. if (e.protocol && e.protocol !== i.protocol) {
  33796. if (!b[e.protocol]) {
  33797. for (var u = Object.keys(e), d = 0; d < u.length; d++) {
  33798. var p = u[d];
  33799. i[p] = e[p]
  33800. }
  33801. return i.href = i.format(),
  33802. i
  33803. }
  33804. if (i.protocol = e.protocol,
  33805. e.host || E[e.protocol])
  33806. i.pathname = e.pathname;
  33807. else {
  33808. for (var f = (e.pathname || "").split("/"); f.length && !(e.host = f.shift()); )
  33809. ;
  33810. e.host || (e.host = ""),
  33811. e.hostname || (e.hostname = ""),
  33812. "" !== f[0] && f.unshift(""),
  33813. f.length < 2 && f.unshift(""),
  33814. i.pathname = f.join("/")
  33815. }
  33816. if (i.search = e.search,
  33817. i.query = e.query,
  33818. i.host = e.host || "",
  33819. i.auth = e.auth,
  33820. i.hostname = e.hostname || e.host,
  33821. i.port = e.port,
  33822. i.pathname || i.search) {
  33823. var g = i.pathname || ""
  33824. , m = i.search || "";
  33825. i.path = g + m
  33826. }
  33827. return i.slashes = i.slashes || e.slashes,
  33828. i.href = i.format(),
  33829. i
  33830. }
  33831. var v = i.pathname && "/" === i.pathname.charAt(0)
  33832. , A = e.host || e.pathname && "/" === e.pathname.charAt(0)
  33833. , y = A || v || i.host && e.pathname
  33834. , C = y
  33835. , I = i.pathname && i.pathname.split("/") || []
  33836. , f = e.pathname && e.pathname.split("/") || []
  33837. , w = i.protocol && !b[i.protocol];
  33838. if (w && (i.hostname = "",
  33839. i.port = null,
  33840. i.host && ("" === I[0] ? I[0] = i.host : I.unshift(i.host)),
  33841. i.host = "",
  33842. e.protocol && (e.hostname = null,
  33843. e.port = null,
  33844. e.host && ("" === f[0] ? f[0] = e.host : f.unshift(e.host)),
  33845. e.host = null),
  33846. y = y && ("" === f[0] || "" === I[0])),
  33847. A)
  33848. i.host = e.host || "" === e.host ? e.host : i.host,
  33849. i.hostname = e.hostname || "" === e.hostname ? e.hostname : i.hostname,
  33850. i.search = e.search,
  33851. i.query = e.query,
  33852. I = f;
  33853. else if (f.length)
  33854. I || (I = []),
  33855. I.pop(),
  33856. I = I.concat(f),
  33857. i.search = e.search,
  33858. i.query = e.query;
  33859. else if (!c.isNullOrUndefined(e.search)) {
  33860. if (w) {
  33861. i.hostname = i.host = I.shift();
  33862. var _ = !!(i.host && i.host.indexOf("@") > 0) && i.host.split("@");
  33863. _ && (i.auth = _.shift(),
  33864. i.host = i.hostname = _.shift())
  33865. }
  33866. return i.search = e.search,
  33867. i.query = e.query,
  33868. c.isNull(i.pathname) && c.isNull(i.search) || (i.path = (i.pathname ? i.pathname : "") + (i.search ? i.search : "")),
  33869. i.href = i.format(),
  33870. i
  33871. }
  33872. if (!I.length)
  33873. return i.pathname = null,
  33874. i.search ? i.path = "/" + i.search : i.path = null,
  33875. i.href = i.format(),
  33876. i;
  33877. 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--)
  33878. T = I[M],
  33879. "." === T ? I.splice(M, 1) : ".." === T ? (I.splice(M, 1),
  33880. S++) : S && (I.splice(M, 1),
  33881. S--);
  33882. if (!y && !C)
  33883. for (; S--; S)
  33884. I.unshift("..");
  33885. !y || "" === I[0] || I[0] && "/" === I[0].charAt(0) || I.unshift(""),
  33886. x && "/" !== I.join("/").substr(-1) && I.push("");
  33887. var R = "" === I[0] || I[0] && "/" === I[0].charAt(0);
  33888. if (w) {
  33889. i.hostname = i.host = R ? "" : I.length ? I.shift() : "";
  33890. var _ = !!(i.host && i.host.indexOf("@") > 0) && i.host.split("@");
  33891. _ && (i.auth = _.shift(),
  33892. i.host = i.hostname = _.shift())
  33893. }
  33894. return y = y || i.host && I.length,
  33895. y && !R && I.unshift(""),
  33896. I.length ? i.pathname = I.join("/") : (i.pathname = null,
  33897. i.path = null),
  33898. c.isNull(i.pathname) && c.isNull(i.search) || (i.path = (i.pathname ? i.pathname : "") + (i.search ? i.search : "")),
  33899. i.auth = e.auth || i.auth,
  33900. i.slashes = i.slashes || e.slashes,
  33901. i.href = i.format(),
  33902. i
  33903. }
  33904. ,
  33905. n.prototype.parseHost = function() {
  33906. var e = this.host
  33907. , t = u.exec(e);
  33908. t && (t = t[0],
  33909. ":" !== t && (this.port = t.substr(1)),
  33910. e = e.substr(0, e.length - t.length)),
  33911. e && (this.hostname = e)
  33912. }
  33913. }
  33914. , {
  33915. "./util": 209,
  33916. punycode: 204,
  33917. querystring: 207
  33918. }],
  33919. 209: [function(e, t, i) {
  33920. "use strict";
  33921. t.exports = {
  33922. isString: function(e) {
  33923. return "string" == typeof e
  33924. },
  33925. isObject: function(e) {
  33926. return "object" == typeof e && null !== e
  33927. },
  33928. isNull: function(e) {
  33929. return null === e
  33930. },
  33931. isNullOrUndefined: function(e) {
  33932. return null == e
  33933. }
  33934. }
  33935. }
  33936. , {}],
  33937. 210: [function(e, t, i) {
  33938. "use strict";
  33939. function n(e) {
  33940. return l + e
  33941. }
  33942. function r(e) {
  33943. return e.substring(l.length)
  33944. }
  33945. function o(e, t) {
  33946. for (var i in t)
  33947. Object.defineProperty(e, i, {
  33948. value: t[i],
  33949. configurable: !0,
  33950. writable: !0
  33951. })
  33952. }
  33953. function a(e) {
  33954. if ("string" != typeof e)
  33955. throw new TypeError("key must be a string.")
  33956. }
  33957. var s = Object.prototype.hasOwnProperty
  33958. , l = "~";
  33959. t.exports = function(e) {
  33960. var t = Object.create(null)
  33961. , i = 0
  33962. , l = {};
  33963. return o(l, {
  33964. get: function(e, i) {
  33965. a(e);
  33966. var r = n(e);
  33967. return r in t ? t[r] : i
  33968. },
  33969. set: function(e, r) {
  33970. a(e);
  33971. var o = n(e);
  33972. return o in t || ++i,
  33973. t[o] = r
  33974. },
  33975. has: function(e) {
  33976. return a(e),
  33977. n(e)in t
  33978. },
  33979. delete: function(e) {
  33980. a(e);
  33981. var r = n(e);
  33982. return r in t && (--i,
  33983. delete t[r],
  33984. !0)
  33985. },
  33986. clear: function() {
  33987. t = Object.create(null),
  33988. i = 0
  33989. },
  33990. forEach: function(e, i) {
  33991. if ("function" != typeof e)
  33992. throw new TypeError("`callback` must be a function");
  33993. for (var n in t)
  33994. if (s.call(t, n)) {
  33995. var o = r(n)
  33996. , a = t[n];
  33997. e.call(i, a, o, l)
  33998. }
  33999. }
  34000. }),
  34001. Object.defineProperty(l, "size", {
  34002. get: function() {
  34003. return i
  34004. },
  34005. configurable: !0
  34006. }),
  34007. "object" == typeof e && null !== e && Object.keys(e).forEach(function(t) {
  34008. l.set(t, e[t])
  34009. }),
  34010. l
  34011. }
  34012. }
  34013. , {}],
  34014. 211: [function(e, t, i) {
  34015. t.exports = e("./lib/heap")
  34016. }
  34017. , {
  34018. "./lib/heap": 212
  34019. }],
  34020. 212: [function(e, t, i) {
  34021. (function() {
  34022. var e, n, r, o, a, s, l, c, h, u, d, p, f, g, m;
  34023. r = Math.floor,
  34024. u = Math.min,
  34025. n = function(e, t) {
  34026. return e < t ? -1 : e > t ? 1 : 0
  34027. }
  34028. ,
  34029. h = function(e, t, i, o, a) {
  34030. var s;
  34031. if (null == i && (i = 0),
  34032. null == a && (a = n),
  34033. i < 0)
  34034. throw new Error("lo must be non-negative");
  34035. for (null == o && (o = e.length); i < o; )
  34036. s = r((i + o) / 2),
  34037. a(t, e[s]) < 0 ? o = s : i = s + 1;
  34038. return [].splice.apply(e, [i, i - i].concat(t)),
  34039. t
  34040. }
  34041. ,
  34042. s = function(e, t, i) {
  34043. return null == i && (i = n),
  34044. e.push(t),
  34045. g(e, 0, e.length - 1, i)
  34046. }
  34047. ,
  34048. a = function(e, t) {
  34049. var i, r;
  34050. return null == t && (t = n),
  34051. i = e.pop(),
  34052. e.length ? (r = e[0],
  34053. e[0] = i,
  34054. m(e, 0, t)) : r = i,
  34055. r
  34056. }
  34057. ,
  34058. c = function(e, t, i) {
  34059. var r;
  34060. return null == i && (i = n),
  34061. r = e[0],
  34062. e[0] = t,
  34063. m(e, 0, i),
  34064. r
  34065. }
  34066. ,
  34067. l = function(e, t, i) {
  34068. var r;
  34069. return null == i && (i = n),
  34070. e.length && i(e[0], t) < 0 && (r = [e[0], t],
  34071. t = r[0],
  34072. e[0] = r[1],
  34073. m(e, 0, i)),
  34074. t
  34075. }
  34076. ,
  34077. o = function(e, t) {
  34078. var i, o, a, s, l, c;
  34079. for (null == t && (t = n),
  34080. s = function() {
  34081. c = [];
  34082. for (var t = 0, i = r(e.length / 2); 0 <= i ? t < i : t > i; 0 <= i ? t++ : t--)
  34083. c.push(t);
  34084. return c
  34085. }
  34086. .apply(this).reverse(),
  34087. l = [],
  34088. o = 0,
  34089. a = s.length; o < a; o++)
  34090. i = s[o],
  34091. l.push(m(e, i, t));
  34092. return l
  34093. }
  34094. ,
  34095. f = function(e, t, i) {
  34096. var r;
  34097. if (null == i && (i = n),
  34098. r = e.indexOf(t),
  34099. r !== -1)
  34100. return g(e, 0, r, i),
  34101. m(e, r, i)
  34102. }
  34103. ,
  34104. d = function(e, t, i) {
  34105. var r, a, s, c, h;
  34106. if (null == i && (i = n),
  34107. a = e.slice(0, t),
  34108. !a.length)
  34109. return a;
  34110. for (o(a, i),
  34111. h = e.slice(t),
  34112. s = 0,
  34113. c = h.length; s < c; s++)
  34114. r = h[s],
  34115. l(a, r, i);
  34116. return a.sort(i).reverse()
  34117. }
  34118. ,
  34119. p = function(e, t, i) {
  34120. var r, s, l, c, d, p, f, g, m, v;
  34121. if (null == i && (i = n),
  34122. 10 * t <= e.length) {
  34123. if (c = e.slice(0, t).sort(i),
  34124. !c.length)
  34125. return c;
  34126. for (l = c[c.length - 1],
  34127. g = e.slice(t),
  34128. d = 0,
  34129. f = g.length; d < f; d++)
  34130. r = g[d],
  34131. i(r, l) < 0 && (h(c, r, 0, null, i),
  34132. c.pop(),
  34133. l = c[c.length - 1]);
  34134. return c
  34135. }
  34136. for (o(e, i),
  34137. v = [],
  34138. s = p = 0,
  34139. m = u(t, e.length); 0 <= m ? p < m : p > m; s = 0 <= m ? ++p : --p)
  34140. v.push(a(e, i));
  34141. return v
  34142. }
  34143. ,
  34144. g = function(e, t, i, r) {
  34145. var o, a, s;
  34146. for (null == r && (r = n),
  34147. o = e[i]; i > t && (s = i - 1 >> 1,
  34148. a = e[s],
  34149. r(o, a) < 0); )
  34150. e[i] = a,
  34151. i = s;
  34152. return e[i] = o
  34153. }
  34154. ,
  34155. m = function(e, t, i) {
  34156. var r, o, a, s, l;
  34157. for (null == i && (i = n),
  34158. o = e.length,
  34159. l = t,
  34160. a = e[t],
  34161. r = 2 * t + 1; r < o; )
  34162. s = r + 1,
  34163. s < o && !(i(e[r], e[s]) < 0) && (r = s),
  34164. e[t] = e[r],
  34165. t = r,
  34166. r = 2 * t + 1;
  34167. return e[t] = a,
  34168. g(e, l, t, i)
  34169. }
  34170. ,
  34171. e = function() {
  34172. function e(e) {
  34173. this.cmp = null != e ? e : n,
  34174. this.nodes = []
  34175. }
  34176. return e.push = s,
  34177. e.pop = a,
  34178. e.replace = c,
  34179. e.pushpop = l,
  34180. e.heapify = o,
  34181. e.updateItem = f,
  34182. e.nlargest = d,
  34183. e.nsmallest = p,
  34184. e.prototype.push = function(e) {
  34185. return s(this.nodes, e, this.cmp)
  34186. }
  34187. ,
  34188. e.prototype.pop = function() {
  34189. return a(this.nodes, this.cmp)
  34190. }
  34191. ,
  34192. e.prototype.peek = function() {
  34193. return this.nodes[0]
  34194. }
  34195. ,
  34196. e.prototype.contains = function(e) {
  34197. return this.nodes.indexOf(e) !== -1
  34198. }
  34199. ,
  34200. e.prototype.replace = function(e) {
  34201. return c(this.nodes, e, this.cmp)
  34202. }
  34203. ,
  34204. e.prototype.pushpop = function(e) {
  34205. return l(this.nodes, e, this.cmp)
  34206. }
  34207. ,
  34208. e.prototype.heapify = function() {
  34209. return o(this.nodes, this.cmp)
  34210. }
  34211. ,
  34212. e.prototype.updateItem = function(e) {
  34213. return f(this.nodes, e, this.cmp)
  34214. }
  34215. ,
  34216. e.prototype.clear = function() {
  34217. return this.nodes = []
  34218. }
  34219. ,
  34220. e.prototype.empty = function() {
  34221. return 0 === this.nodes.length
  34222. }
  34223. ,
  34224. e.prototype.size = function() {
  34225. return this.nodes.length
  34226. }
  34227. ,
  34228. e.prototype.clone = function() {
  34229. var t;
  34230. return t = new e,
  34231. t.nodes = this.nodes.slice(0),
  34232. t
  34233. }
  34234. ,
  34235. e.prototype.toArray = function() {
  34236. return this.nodes.slice(0)
  34237. }
  34238. ,
  34239. e.prototype.insert = e.prototype.push,
  34240. e.prototype.top = e.prototype.peek,
  34241. e.prototype.front = e.prototype.peek,
  34242. e.prototype.has = e.prototype.contains,
  34243. e.prototype.copy = e.prototype.clone,
  34244. e
  34245. }(),
  34246. function(e, n) {
  34247. return "function" == typeof define && define.amd ? define([], n) : "object" == typeof i ? t.exports = n() : e.Heap = n()
  34248. }(this, function() {
  34249. return e
  34250. })
  34251. }
  34252. ).call(this)
  34253. }
  34254. , {}],
  34255. 213: [function(e, t, i) {
  34256. !function(e) {
  34257. function i() {}
  34258. function n(e, t) {
  34259. return function() {
  34260. e.apply(t, arguments)
  34261. }
  34262. }
  34263. function r(e) {
  34264. if ("object" != typeof this)
  34265. throw new TypeError("Promises must be constructed via new");
  34266. if ("function" != typeof e)
  34267. throw new TypeError("not a function");
  34268. this._state = 0,
  34269. this._handled = !1,
  34270. this._value = void 0,
  34271. this._deferreds = [],
  34272. h(e, this)
  34273. }
  34274. function o(e, t) {
  34275. for (; 3 === e._state; )
  34276. e = e._value;
  34277. return 0 === e._state ? void e._deferreds.push(t) : (e._handled = !0,
  34278. void r._immediateFn(function() {
  34279. var i = 1 === e._state ? t.onFulfilled : t.onRejected;
  34280. if (null === i)
  34281. return void (1 === e._state ? a : s)(t.promise, e._value);
  34282. var n;
  34283. try {
  34284. n = i(e._value)
  34285. } catch (e) {
  34286. return void s(t.promise, e)
  34287. }
  34288. a(t.promise, n)
  34289. }))
  34290. }
  34291. function a(e, t) {
  34292. try {
  34293. if (t === e)
  34294. throw new TypeError("A promise cannot be resolved with itself.");
  34295. if (t && ("object" == typeof t || "function" == typeof t)) {
  34296. var i = t.then;
  34297. if (t instanceof r)
  34298. return e._state = 3,
  34299. e._value = t,
  34300. void l(e);
  34301. if ("function" == typeof i)
  34302. return void h(n(i, t), e)
  34303. }
  34304. e._state = 1,
  34305. e._value = t,
  34306. l(e)
  34307. } catch (t) {
  34308. s(e, t)
  34309. }
  34310. }
  34311. function s(e, t) {
  34312. e._state = 2,
  34313. e._value = t,
  34314. l(e)
  34315. }
  34316. function l(e) {
  34317. 2 === e._state && 0 === e._deferreds.length && r._immediateFn(function() {
  34318. e._handled || r._unhandledRejectionFn(e._value)
  34319. });
  34320. for (var t = 0, i = e._deferreds.length; t < i; t++)
  34321. o(e, e._deferreds[t]);
  34322. e._deferreds = null
  34323. }
  34324. function c(e, t, i) {
  34325. this.onFulfilled = "function" == typeof e ? e : null,
  34326. this.onRejected = "function" == typeof t ? t : null,
  34327. this.promise = i
  34328. }
  34329. function h(e, t) {
  34330. var i = !1;
  34331. try {
  34332. e(function(e) {
  34333. i || (i = !0,
  34334. a(t, e))
  34335. }, function(e) {
  34336. i || (i = !0,
  34337. s(t, e))
  34338. })
  34339. } catch (e) {
  34340. if (i)
  34341. return;
  34342. i = !0,
  34343. s(t, e)
  34344. }
  34345. }
  34346. var u = setTimeout;
  34347. r.prototype.catch = function(e) {
  34348. return this.then(null, e)
  34349. }
  34350. ,
  34351. r.prototype.then = function(e, t) {
  34352. var n = new this.constructor(i);
  34353. return o(this, new c(e,t,n)),
  34354. n
  34355. }
  34356. ,
  34357. r.all = function(e) {
  34358. var t = Array.prototype.slice.call(e);
  34359. return new r(function(e, i) {
  34360. function n(o, a) {
  34361. try {
  34362. if (a && ("object" == typeof a || "function" == typeof a)) {
  34363. var s = a.then;
  34364. if ("function" == typeof s)
  34365. return void s.call(a, function(e) {
  34366. n(o, e)
  34367. }, i)
  34368. }
  34369. t[o] = a,
  34370. 0 === --r && e(t)
  34371. } catch (e) {
  34372. i(e)
  34373. }
  34374. }
  34375. if (0 === t.length)
  34376. return e([]);
  34377. for (var r = t.length, o = 0; o < t.length; o++)
  34378. n(o, t[o])
  34379. }
  34380. )
  34381. }
  34382. ,
  34383. r.resolve = function(e) {
  34384. return e && "object" == typeof e && e.constructor === r ? e : new r(function(t) {
  34385. t(e)
  34386. }
  34387. )
  34388. }
  34389. ,
  34390. r.reject = function(e) {
  34391. return new r(function(t, i) {
  34392. i(e)
  34393. }
  34394. )
  34395. }
  34396. ,
  34397. r.race = function(e) {
  34398. return new r(function(t, i) {
  34399. for (var n = 0, r = e.length; n < r; n++)
  34400. e[n].then(t, i)
  34401. }
  34402. )
  34403. }
  34404. ,
  34405. r._immediateFn = "function" == typeof setImmediate && function(e) {
  34406. setImmediate(e)
  34407. }
  34408. || function(e) {
  34409. u(e, 0)
  34410. }
  34411. ,
  34412. r._unhandledRejectionFn = function(e) {
  34413. "undefined" != typeof console && console && console.warn("Possible Unhandled Promise Rejection:", e)
  34414. }
  34415. ,
  34416. r._setImmediateFn = function(e) {
  34417. r._immediateFn = e
  34418. }
  34419. ,
  34420. r._setUnhandledRejectionFn = function(e) {
  34421. r._unhandledRejectionFn = e
  34422. }
  34423. ,
  34424. "undefined" != typeof t && t.exports ? t.exports = r : e.Promise || (e.Promise = r)
  34425. }(this)
  34426. }
  34427. , {}],
  34428. 214: [function(e, t, i) {
  34429. (function(i) {
  34430. !function(i, n) {
  34431. "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)
  34432. }(this, function(t, n) {
  34433. "use strict";
  34434. var r = {};
  34435. return r.ByteBuffer = t,
  34436. r.Long = t.Long || null,
  34437. r.VERSION = "5.0.1",
  34438. r.WIRE_TYPES = {},
  34439. r.WIRE_TYPES.VARINT = 0,
  34440. r.WIRE_TYPES.BITS64 = 1,
  34441. r.WIRE_TYPES.LDELIM = 2,
  34442. r.WIRE_TYPES.STARTGROUP = 3,
  34443. r.WIRE_TYPES.ENDGROUP = 4,
  34444. r.WIRE_TYPES.BITS32 = 5,
  34445. r.PACKABLE_WIRE_TYPES = [r.WIRE_TYPES.VARINT, r.WIRE_TYPES.BITS64, r.WIRE_TYPES.BITS32],
  34446. r.TYPES = {
  34447. int32: {
  34448. name: "int32",
  34449. wireType: r.WIRE_TYPES.VARINT,
  34450. defaultValue: 0
  34451. },
  34452. uint32: {
  34453. name: "uint32",
  34454. wireType: r.WIRE_TYPES.VARINT,
  34455. defaultValue: 0
  34456. },
  34457. sint32: {
  34458. name: "sint32",
  34459. wireType: r.WIRE_TYPES.VARINT,
  34460. defaultValue: 0
  34461. },
  34462. int64: {
  34463. name: "int64",
  34464. wireType: r.WIRE_TYPES.VARINT,
  34465. defaultValue: r.Long ? r.Long.ZERO : void 0
  34466. },
  34467. uint64: {
  34468. name: "uint64",
  34469. wireType: r.WIRE_TYPES.VARINT,
  34470. defaultValue: r.Long ? r.Long.UZERO : void 0
  34471. },
  34472. sint64: {
  34473. name: "sint64",
  34474. wireType: r.WIRE_TYPES.VARINT,
  34475. defaultValue: r.Long ? r.Long.ZERO : void 0
  34476. },
  34477. bool: {
  34478. name: "bool",
  34479. wireType: r.WIRE_TYPES.VARINT,
  34480. defaultValue: !1
  34481. },
  34482. double: {
  34483. name: "double",
  34484. wireType: r.WIRE_TYPES.BITS64,
  34485. defaultValue: 0
  34486. },
  34487. string: {
  34488. name: "string",
  34489. wireType: r.WIRE_TYPES.LDELIM,
  34490. defaultValue: ""
  34491. },
  34492. bytes: {
  34493. name: "bytes",
  34494. wireType: r.WIRE_TYPES.LDELIM,
  34495. defaultValue: null
  34496. },
  34497. fixed32: {
  34498. name: "fixed32",
  34499. wireType: r.WIRE_TYPES.BITS32,
  34500. defaultValue: 0
  34501. },
  34502. sfixed32: {
  34503. name: "sfixed32",
  34504. wireType: r.WIRE_TYPES.BITS32,
  34505. defaultValue: 0
  34506. },
  34507. fixed64: {
  34508. name: "fixed64",
  34509. wireType: r.WIRE_TYPES.BITS64,
  34510. defaultValue: r.Long ? r.Long.UZERO : void 0
  34511. },
  34512. sfixed64: {
  34513. name: "sfixed64",
  34514. wireType: r.WIRE_TYPES.BITS64,
  34515. defaultValue: r.Long ? r.Long.ZERO : void 0
  34516. },
  34517. float: {
  34518. name: "float",
  34519. wireType: r.WIRE_TYPES.BITS32,
  34520. defaultValue: 0
  34521. },
  34522. enum: {
  34523. name: "enum",
  34524. wireType: r.WIRE_TYPES.VARINT,
  34525. defaultValue: 0
  34526. },
  34527. message: {
  34528. name: "message",
  34529. wireType: r.WIRE_TYPES.LDELIM,
  34530. defaultValue: null
  34531. },
  34532. group: {
  34533. name: "group",
  34534. wireType: r.WIRE_TYPES.STARTGROUP,
  34535. defaultValue: null
  34536. }
  34537. },
  34538. 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],
  34539. r.ID_MIN = 1,
  34540. r.ID_MAX = 536870911,
  34541. r.convertFieldsToCamelCase = !1,
  34542. r.populateAccessors = !0,
  34543. r.populateDefaults = !0,
  34544. r.Util = function() {
  34545. var t = {};
  34546. return t.IS_NODE = !("object" != typeof i || i + "" != "[object process]" || i.browser),
  34547. t.XHR = function() {
  34548. for (var e = [function() {
  34549. return new XMLHttpRequest
  34550. }
  34551. , function() {
  34552. return new ActiveXObject("Msxml2.XMLHTTP")
  34553. }
  34554. , function() {
  34555. return new ActiveXObject("Msxml3.XMLHTTP")
  34556. }
  34557. , function() {
  34558. return new ActiveXObject("Microsoft.XMLHTTP")
  34559. }
  34560. ], t = null, i = 0; i < e.length; i++) {
  34561. try {
  34562. t = e[i]()
  34563. } catch (e) {
  34564. continue
  34565. }
  34566. break
  34567. }
  34568. if (!t)
  34569. throw Error("XMLHttpRequest is not supported");
  34570. return t
  34571. }
  34572. ,
  34573. t.fetch = function(i, n) {
  34574. if (n && "function" != typeof n && (n = null),
  34575. t.IS_NODE) {
  34576. var r = e("fs");
  34577. if (n)
  34578. r.readFile(i, function(e, t) {
  34579. n(e ? null : "" + t)
  34580. });
  34581. else
  34582. try {
  34583. return r.readFileSync(i)
  34584. } catch (e) {
  34585. return null
  34586. }
  34587. } else {
  34588. var o = t.XHR();
  34589. if (o.open("GET", i, !!n),
  34590. o.setRequestHeader("Accept", "text/plain"),
  34591. "function" == typeof o.overrideMimeType && o.overrideMimeType("text/plain"),
  34592. !n)
  34593. return o.send(null),
  34594. 200 == o.status || 0 == o.status && "string" == typeof o.responseText ? o.responseText : null;
  34595. if (o.onreadystatechange = function() {
  34596. 4 == o.readyState && n(200 == o.status || 0 == o.status && "string" == typeof o.responseText ? o.responseText : null)
  34597. }
  34598. ,
  34599. 4 == o.readyState)
  34600. return;
  34601. o.send(null)
  34602. }
  34603. }
  34604. ,
  34605. t.toCamelCase = function(e) {
  34606. return e.replace(/_([a-zA-Z])/g, function(e, t) {
  34607. return t.toUpperCase()
  34608. })
  34609. }
  34610. ,
  34611. t
  34612. }(),
  34613. r.Lang = {
  34614. DELIM: /[\s\{\}=;:\[\],'"\(\)<>]/g,
  34615. RULE: /^(?:required|optional|repeated|map)$/,
  34616. TYPE: /^(?:double|float|int32|uint32|sint32|int64|uint64|sint64|fixed32|sfixed32|fixed64|sfixed64|bool|string|bytes)$/,
  34617. NAME: /^[a-zA-Z_][a-zA-Z_0-9]*$/,
  34618. TYPEDEF: /^[a-zA-Z][a-zA-Z_0-9]*$/,
  34619. TYPEREF: /^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)+$/,
  34620. FQTYPEREF: /^(?:\.[a-zA-Z][a-zA-Z_0-9]*)+$/,
  34621. NUMBER: /^-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+|([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?)|inf|nan)$/,
  34622. NUMBER_DEC: /^(?:[1-9][0-9]*|0)$/,
  34623. NUMBER_HEX: /^0[xX][0-9a-fA-F]+$/,
  34624. NUMBER_OCT: /^0[0-7]+$/,
  34625. NUMBER_FLT: /^([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?|inf|nan)$/,
  34626. BOOL: /^(?:true|false)$/i,
  34627. ID: /^(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,
  34628. NEGID: /^\-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,
  34629. WHITESPACE: /\s/,
  34630. STRING: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")|(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,
  34631. STRING_DQ: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,
  34632. STRING_SQ: /(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g
  34633. },
  34634. r.DotProto = function(e, t) {
  34635. function i(e, i) {
  34636. var n = -1
  34637. , r = 1;
  34638. if ("-" == e.charAt(0) && (r = -1,
  34639. e = e.substring(1)),
  34640. t.NUMBER_DEC.test(e))
  34641. n = parseInt(e);
  34642. else if (t.NUMBER_HEX.test(e))
  34643. n = parseInt(e.substring(2), 16);
  34644. else {
  34645. if (!t.NUMBER_OCT.test(e))
  34646. throw Error("illegal id value: " + (r < 0 ? "-" : "") + e);
  34647. n = parseInt(e.substring(1), 8)
  34648. }
  34649. if (n = r * n | 0,
  34650. !i && n < 0)
  34651. throw Error("illegal id value: " + (r < 0 ? "-" : "") + e);
  34652. return n
  34653. }
  34654. function n(e) {
  34655. var i = 1;
  34656. if ("-" == e.charAt(0) && (i = -1,
  34657. e = e.substring(1)),
  34658. t.NUMBER_DEC.test(e))
  34659. return i * parseInt(e, 10);
  34660. if (t.NUMBER_HEX.test(e))
  34661. return i * parseInt(e.substring(2), 16);
  34662. if (t.NUMBER_OCT.test(e))
  34663. return i * parseInt(e.substring(1), 8);
  34664. if ("inf" === e)
  34665. return i * (1 / 0);
  34666. if ("nan" === e)
  34667. return NaN;
  34668. if (t.NUMBER_FLT.test(e))
  34669. return i * parseFloat(e);
  34670. throw Error("illegal number value: " + (i < 0 ? "-" : "") + e)
  34671. }
  34672. function r(e, t, i) {
  34673. "undefined" == typeof e[t] ? e[t] = i : (Array.isArray(e[t]) || (e[t] = [e[t]]),
  34674. e[t].push(i))
  34675. }
  34676. var o = {}
  34677. , a = function(e) {
  34678. this.source = e + "",
  34679. this.index = 0,
  34680. this.line = 1,
  34681. this.stack = [],
  34682. this._stringOpen = null
  34683. }
  34684. , s = a.prototype;
  34685. s._readString = function() {
  34686. var e = '"' === this._stringOpen ? t.STRING_DQ : t.STRING_SQ;
  34687. e.lastIndex = this.index - 1;
  34688. var i = e.exec(this.source);
  34689. if (!i)
  34690. throw Error("unterminated string");
  34691. return this.index = e.lastIndex,
  34692. this.stack.push(this._stringOpen),
  34693. this._stringOpen = null,
  34694. i[1]
  34695. }
  34696. ,
  34697. s.next = function() {
  34698. if (this.stack.length > 0)
  34699. return this.stack.shift();
  34700. if (this.index >= this.source.length)
  34701. return null;
  34702. if (null !== this._stringOpen)
  34703. return this._readString();
  34704. var e, i, n;
  34705. do {
  34706. for (e = !1; t.WHITESPACE.test(n = this.source.charAt(this.index)); )
  34707. if ("\n" === n && ++this.line,
  34708. ++this.index === this.source.length)
  34709. return null;
  34710. if ("/" === this.source.charAt(this.index))
  34711. if (++this.index,
  34712. "/" === this.source.charAt(this.index)) {
  34713. for (; "\n" !== this.source.charAt(++this.index); )
  34714. if (this.index == this.source.length)
  34715. return null;
  34716. ++this.index,
  34717. ++this.line,
  34718. e = !0
  34719. } else {
  34720. if ("*" !== (n = this.source.charAt(this.index)))
  34721. return "/";
  34722. do {
  34723. if ("\n" === n && ++this.line,
  34724. ++this.index === this.source.length)
  34725. return null;
  34726. i = n,
  34727. n = this.source.charAt(this.index)
  34728. } while ("*" !== i || "/" !== n);++this.index,
  34729. e = !0
  34730. }
  34731. } while (e);if (this.index === this.source.length)
  34732. return null;
  34733. var r = this.index;
  34734. t.DELIM.lastIndex = 0;
  34735. var o = t.DELIM.test(this.source.charAt(r++));
  34736. if (!o)
  34737. for (; r < this.source.length && !t.DELIM.test(this.source.charAt(r)); )
  34738. ++r;
  34739. var a = this.source.substring(this.index, this.index = r);
  34740. return '"' !== a && "'" !== a || (this._stringOpen = a),
  34741. a
  34742. }
  34743. ,
  34744. s.peek = function() {
  34745. if (0 === this.stack.length) {
  34746. var e = this.next();
  34747. if (null === e)
  34748. return null;
  34749. this.stack.push(e)
  34750. }
  34751. return this.stack[0]
  34752. }
  34753. ,
  34754. s.skip = function(e) {
  34755. var t = this.next();
  34756. if (t !== e)
  34757. throw Error("illegal '" + t + "', '" + e + "' expected")
  34758. }
  34759. ,
  34760. s.omit = function(e) {
  34761. return this.peek() === e && (this.next(),
  34762. !0)
  34763. }
  34764. ,
  34765. s.toString = function() {
  34766. return "Tokenizer (" + this.index + "/" + this.source.length + " at line " + this.line + ")"
  34767. }
  34768. ,
  34769. o.Tokenizer = a;
  34770. var l = function(e) {
  34771. this.tn = new a(e),
  34772. this.proto3 = !1
  34773. }
  34774. , c = l.prototype;
  34775. return c.parse = function() {
  34776. var e, i, n = {
  34777. name: "[ROOT]",
  34778. package: null,
  34779. messages: [],
  34780. enums: [],
  34781. imports: [],
  34782. options: {},
  34783. services: []
  34784. }, r = !0;
  34785. try {
  34786. for (; e = this.tn.next(); )
  34787. switch (e) {
  34788. case "package":
  34789. if (!r || null !== n.package)
  34790. throw Error("unexpected 'package'");
  34791. if (e = this.tn.next(),
  34792. !t.TYPEREF.test(e))
  34793. throw Error("illegal package name: " + e);
  34794. this.tn.skip(";"),
  34795. n.package = e;
  34796. break;
  34797. case "import":
  34798. if (!r)
  34799. throw Error("unexpected 'import'");
  34800. e = this.tn.peek(),
  34801. ("public" === e || (i = "weak" === e)) && this.tn.next(),
  34802. e = this._readString(),
  34803. this.tn.skip(";"),
  34804. i || n.imports.push(e);
  34805. break;
  34806. case "syntax":
  34807. if (!r)
  34808. throw Error("unexpected 'syntax'");
  34809. this.tn.skip("="),
  34810. "proto3" === (n.syntax = this._readString()) && (this.proto3 = !0),
  34811. this.tn.skip(";");
  34812. break;
  34813. case "message":
  34814. this._parseMessage(n, null),
  34815. r = !1;
  34816. break;
  34817. case "enum":
  34818. this._parseEnum(n),
  34819. r = !1;
  34820. break;
  34821. case "option":
  34822. this._parseOption(n);
  34823. break;
  34824. case "service":
  34825. this._parseService(n);
  34826. break;
  34827. case "extend":
  34828. this._parseExtend(n);
  34829. break;
  34830. default:
  34831. throw Error("unexpected '" + e + "'")
  34832. }
  34833. } catch (e) {
  34834. throw e.message = "Parse error at line " + this.tn.line + ": " + e.message,
  34835. e
  34836. }
  34837. return delete n.name,
  34838. n
  34839. }
  34840. ,
  34841. l.parse = function(e) {
  34842. return new l(e).parse()
  34843. }
  34844. ,
  34845. c._readString = function() {
  34846. var e, t, i = "";
  34847. do {
  34848. if (t = this.tn.next(),
  34849. "'" !== t && '"' !== t)
  34850. throw Error("illegal string delimiter: " + t);
  34851. i += this.tn.next(),
  34852. this.tn.skip(t),
  34853. e = this.tn.peek()
  34854. } while ('"' === e || '"' === e);return i
  34855. }
  34856. ,
  34857. c._readValue = function(e) {
  34858. var i = this.tn.peek();
  34859. if ('"' === i || "'" === i)
  34860. return this._readString();
  34861. if (this.tn.next(),
  34862. t.NUMBER.test(i))
  34863. return n(i);
  34864. if (t.BOOL.test(i))
  34865. return "true" === i.toLowerCase();
  34866. if (e && t.TYPEREF.test(i))
  34867. return i;
  34868. throw Error("illegal value: " + i)
  34869. }
  34870. ,
  34871. c._parseOption = function(e, i) {
  34872. var n = this.tn.next()
  34873. , r = !1;
  34874. if ("(" === n && (r = !0,
  34875. n = this.tn.next()),
  34876. !t.TYPEREF.test(n))
  34877. throw Error("illegal option name: " + n);
  34878. var o = n;
  34879. r && (this.tn.skip(")"),
  34880. o = "(" + o + ")",
  34881. n = this.tn.peek(),
  34882. t.FQTYPEREF.test(n) && (o += n,
  34883. this.tn.next())),
  34884. this.tn.skip("="),
  34885. this._parseOptionValue(e, o),
  34886. i || this.tn.skip(";")
  34887. }
  34888. ,
  34889. c._parseOptionValue = function(e, i) {
  34890. var n = this.tn.peek();
  34891. if ("{" !== n)
  34892. r(e.options, i, this._readValue(!0));
  34893. else
  34894. for (this.tn.skip("{"); "}" !== (n = this.tn.next()); ) {
  34895. if (!t.NAME.test(n))
  34896. throw Error("illegal option name: " + i + "." + n);
  34897. this.tn.omit(":") ? r(e.options, i + "." + n, this._readValue(!0)) : this._parseOptionValue(e, i + "." + n)
  34898. }
  34899. }
  34900. ,
  34901. c._parseService = function(e) {
  34902. var i = this.tn.next();
  34903. if (!t.NAME.test(i))
  34904. throw Error("illegal service name at line " + this.tn.line + ": " + i);
  34905. var n = i
  34906. , r = {
  34907. name: n,
  34908. rpc: {},
  34909. options: {}
  34910. };
  34911. for (this.tn.skip("{"); "}" !== (i = this.tn.next()); )
  34912. if ("option" === i)
  34913. this._parseOption(r);
  34914. else {
  34915. if ("rpc" !== i)
  34916. throw Error("illegal service token: " + i);
  34917. this._parseServiceRPC(r)
  34918. }
  34919. this.tn.omit(";"),
  34920. e.services.push(r)
  34921. }
  34922. ,
  34923. c._parseServiceRPC = function(e) {
  34924. var i = "rpc"
  34925. , n = this.tn.next();
  34926. if (!t.NAME.test(n))
  34927. throw Error("illegal rpc service method name: " + n);
  34928. var r = n
  34929. , o = {
  34930. request: null,
  34931. response: null,
  34932. request_stream: !1,
  34933. response_stream: !1,
  34934. options: {}
  34935. };
  34936. if (this.tn.skip("("),
  34937. n = this.tn.next(),
  34938. "stream" === n.toLowerCase() && (o.request_stream = !0,
  34939. n = this.tn.next()),
  34940. !t.TYPEREF.test(n))
  34941. throw Error("illegal rpc service request type: " + n);
  34942. if (o.request = n,
  34943. this.tn.skip(")"),
  34944. n = this.tn.next(),
  34945. "returns" !== n.toLowerCase())
  34946. throw Error("illegal rpc service request type delimiter: " + n);
  34947. if (this.tn.skip("("),
  34948. n = this.tn.next(),
  34949. "stream" === n.toLowerCase() && (o.response_stream = !0,
  34950. n = this.tn.next()),
  34951. o.response = n,
  34952. this.tn.skip(")"),
  34953. n = this.tn.peek(),
  34954. "{" === n) {
  34955. for (this.tn.next(); "}" !== (n = this.tn.next()); ) {
  34956. if ("option" !== n)
  34957. throw Error("illegal rpc service token: " + n);
  34958. this._parseOption(o)
  34959. }
  34960. this.tn.omit(";")
  34961. } else
  34962. this.tn.skip(";");
  34963. "undefined" == typeof e[i] && (e[i] = {}),
  34964. e[i][r] = o
  34965. }
  34966. ,
  34967. c._parseMessage = function(e, n) {
  34968. var r = !!n
  34969. , o = this.tn.next()
  34970. , a = {
  34971. name: "",
  34972. fields: [],
  34973. enums: [],
  34974. messages: [],
  34975. options: {},
  34976. services: [],
  34977. oneofs: {}
  34978. };
  34979. if (!t.NAME.test(o))
  34980. throw Error("illegal " + (r ? "group" : "message") + " name: " + o);
  34981. for (a.name = o,
  34982. r && (this.tn.skip("="),
  34983. n.id = i(this.tn.next()),
  34984. a.isGroup = !0),
  34985. o = this.tn.peek(),
  34986. "[" === o && n && this._parseFieldOptions(n),
  34987. this.tn.skip("{"); "}" !== (o = this.tn.next()); )
  34988. if (t.RULE.test(o))
  34989. this._parseMessageField(a, o);
  34990. else if ("oneof" === o)
  34991. this._parseMessageOneOf(a);
  34992. else if ("enum" === o)
  34993. this._parseEnum(a);
  34994. else if ("message" === o)
  34995. this._parseMessage(a);
  34996. else if ("option" === o)
  34997. this._parseOption(a);
  34998. else if ("service" === o)
  34999. this._parseService(a);
  35000. else if ("extensions" === o)
  35001. a.extensions = this._parseExtensionRanges();
  35002. else if ("reserved" === o)
  35003. this._parseIgnored();
  35004. else if ("extend" === o)
  35005. this._parseExtend(a);
  35006. else {
  35007. if (!t.TYPEREF.test(o))
  35008. throw Error("illegal message token: " + o);
  35009. if (!this.proto3)
  35010. throw Error("illegal field rule: " + o);
  35011. this._parseMessageField(a, "optional", o)
  35012. }
  35013. return this.tn.omit(";"),
  35014. e.messages.push(a),
  35015. a
  35016. }
  35017. ,
  35018. c._parseIgnored = function() {
  35019. for (; ";" !== this.tn.peek(); )
  35020. this.tn.next();
  35021. this.tn.skip(";")
  35022. }
  35023. ,
  35024. c._parseMessageField = function(e, n, r) {
  35025. if (!t.RULE.test(n))
  35026. throw Error("illegal message field rule: " + n);
  35027. var o, a = {
  35028. rule: n,
  35029. type: "",
  35030. name: "",
  35031. options: {},
  35032. id: 0
  35033. };
  35034. if ("map" === n) {
  35035. if (r)
  35036. throw Error("illegal type: " + r);
  35037. if (this.tn.skip("<"),
  35038. o = this.tn.next(),
  35039. !t.TYPE.test(o) && !t.TYPEREF.test(o))
  35040. throw Error("illegal message field type: " + o);
  35041. if (a.keytype = o,
  35042. this.tn.skip(","),
  35043. o = this.tn.next(),
  35044. !t.TYPE.test(o) && !t.TYPEREF.test(o))
  35045. throw Error("illegal message field: " + o);
  35046. if (a.type = o,
  35047. this.tn.skip(">"),
  35048. o = this.tn.next(),
  35049. !t.NAME.test(o))
  35050. throw Error("illegal message field name: " + o);
  35051. a.name = o,
  35052. this.tn.skip("="),
  35053. a.id = i(this.tn.next()),
  35054. o = this.tn.peek(),
  35055. "[" === o && this._parseFieldOptions(a),
  35056. this.tn.skip(";")
  35057. } else if (r = "undefined" != typeof r ? r : this.tn.next(),
  35058. "group" === r) {
  35059. var s = this._parseMessage(e, a);
  35060. if (!/^[A-Z]/.test(s.name))
  35061. throw Error("illegal group name: " + s.name);
  35062. a.type = s.name,
  35063. a.name = s.name.toLowerCase(),
  35064. this.tn.omit(";")
  35065. } else {
  35066. if (!t.TYPE.test(r) && !t.TYPEREF.test(r))
  35067. throw Error("illegal message field type: " + r);
  35068. if (a.type = r,
  35069. o = this.tn.next(),
  35070. !t.NAME.test(o))
  35071. throw Error("illegal message field name: " + o);
  35072. a.name = o,
  35073. this.tn.skip("="),
  35074. a.id = i(this.tn.next()),
  35075. o = this.tn.peek(),
  35076. "[" === o && this._parseFieldOptions(a),
  35077. this.tn.skip(";")
  35078. }
  35079. return e.fields.push(a),
  35080. a
  35081. }
  35082. ,
  35083. c._parseMessageOneOf = function(e) {
  35084. var i = this.tn.next();
  35085. if (!t.NAME.test(i))
  35086. throw Error("illegal oneof name: " + i);
  35087. var n, r = i, o = [];
  35088. for (this.tn.skip("{"); "}" !== (i = this.tn.next()); )
  35089. n = this._parseMessageField(e, "optional", i),
  35090. n.oneof = r,
  35091. o.push(n.id);
  35092. this.tn.omit(";"),
  35093. e.oneofs[r] = o
  35094. }
  35095. ,
  35096. c._parseFieldOptions = function(e) {
  35097. this.tn.skip("[");
  35098. for (var t, i = !0; "]" !== (t = this.tn.peek()); )
  35099. i || this.tn.skip(","),
  35100. this._parseOption(e, !0),
  35101. i = !1;
  35102. this.tn.next()
  35103. }
  35104. ,
  35105. c._parseEnum = function(e) {
  35106. var n = {
  35107. name: "",
  35108. values: [],
  35109. options: {}
  35110. }
  35111. , r = this.tn.next();
  35112. if (!t.NAME.test(r))
  35113. throw Error("illegal name: " + r);
  35114. for (n.name = r,
  35115. this.tn.skip("{"); "}" !== (r = this.tn.next()); )
  35116. if ("option" === r)
  35117. this._parseOption(n);
  35118. else {
  35119. if (!t.NAME.test(r))
  35120. throw Error("illegal name: " + r);
  35121. this.tn.skip("=");
  35122. var o = {
  35123. name: r,
  35124. id: i(this.tn.next(), !0)
  35125. };
  35126. r = this.tn.peek(),
  35127. "[" === r && this._parseFieldOptions({
  35128. options: {}
  35129. }),
  35130. this.tn.skip(";"),
  35131. n.values.push(o)
  35132. }
  35133. this.tn.omit(";"),
  35134. e.enums.push(n)
  35135. }
  35136. ,
  35137. c._parseExtensionRanges = function() {
  35138. var t, i, r, o = [];
  35139. do {
  35140. for (i = []; ; ) {
  35141. switch (t = this.tn.next()) {
  35142. case "min":
  35143. r = e.ID_MIN;
  35144. break;
  35145. case "max":
  35146. r = e.ID_MAX;
  35147. break;
  35148. default:
  35149. r = n(t)
  35150. }
  35151. if (i.push(r),
  35152. 2 === i.length)
  35153. break;
  35154. if ("to" !== this.tn.peek()) {
  35155. i.push(r);
  35156. break
  35157. }
  35158. this.tn.next()
  35159. }
  35160. o.push(i)
  35161. } while (this.tn.omit(","));return this.tn.skip(";"),
  35162. o
  35163. }
  35164. ,
  35165. c._parseExtend = function(e) {
  35166. var i = this.tn.next();
  35167. if (!t.TYPEREF.test(i))
  35168. throw Error("illegal extend reference: " + i);
  35169. var n = {
  35170. ref: i,
  35171. fields: []
  35172. };
  35173. for (this.tn.skip("{"); "}" !== (i = this.tn.next()); )
  35174. if (t.RULE.test(i))
  35175. this._parseMessageField(n, i);
  35176. else {
  35177. if (!t.TYPEREF.test(i))
  35178. throw Error("illegal extend token: " + i);
  35179. if (!this.proto3)
  35180. throw Error("illegal field rule: " + i);
  35181. this._parseMessageField(n, "optional", i)
  35182. }
  35183. return this.tn.omit(";"),
  35184. e.messages.push(n),
  35185. n
  35186. }
  35187. ,
  35188. c.toString = function() {
  35189. return "Parser at line " + this.tn.line
  35190. }
  35191. ,
  35192. o.Parser = l,
  35193. o
  35194. }(r, r.Lang),
  35195. r.Reflect = function(e) {
  35196. function i(i) {
  35197. if ("string" == typeof i && (i = e.TYPES[i]),
  35198. "undefined" == typeof i.defaultValue)
  35199. throw Error("default value for type " + i.name + " is not supported");
  35200. return i == e.TYPES.bytes ? new t(0) : i.defaultValue
  35201. }
  35202. function n(t, i) {
  35203. if (t && "number" == typeof t.low && "number" == typeof t.high && "boolean" == typeof t.unsigned && t.low === t.low && t.high === t.high)
  35204. return new e.Long(t.low,t.high,"undefined" == typeof i ? t.unsigned : i);
  35205. if ("string" == typeof t)
  35206. return e.Long.fromString(t, i || !1, 10);
  35207. if ("number" == typeof t)
  35208. return e.Long.fromNumber(t, i || !1);
  35209. throw Error("not convertible to Long")
  35210. }
  35211. function r(t, i) {
  35212. var n = i.readVarint32()
  35213. , o = 7 & n
  35214. , a = n >>> 3;
  35215. switch (o) {
  35216. case e.WIRE_TYPES.VARINT:
  35217. do
  35218. n = i.readUint8();
  35219. while (128 === (128 & n));break;
  35220. case e.WIRE_TYPES.BITS64:
  35221. i.offset += 8;
  35222. break;
  35223. case e.WIRE_TYPES.LDELIM:
  35224. n = i.readVarint32(),
  35225. i.offset += n;
  35226. break;
  35227. case e.WIRE_TYPES.STARTGROUP:
  35228. r(a, i);
  35229. break;
  35230. case e.WIRE_TYPES.ENDGROUP:
  35231. if (a === t)
  35232. return !1;
  35233. throw Error("Illegal GROUPEND after unknown group: " + a + " (" + t + " expected)");
  35234. case e.WIRE_TYPES.BITS32:
  35235. i.offset += 4;
  35236. break;
  35237. default:
  35238. throw Error("Illegal wire type in unknown group " + t + ": " + o)
  35239. }
  35240. return !0
  35241. }
  35242. var o = {}
  35243. , a = function(e, t, i) {
  35244. this.builder = e,
  35245. this.parent = t,
  35246. this.name = i,
  35247. this.className
  35248. }
  35249. , s = a.prototype;
  35250. s.fqn = function() {
  35251. for (var e = this.name, t = this; ; ) {
  35252. if (t = t.parent,
  35253. null == t)
  35254. break;
  35255. e = t.name + "." + e
  35256. }
  35257. return e
  35258. }
  35259. ,
  35260. s.toString = function(e) {
  35261. return (e ? this.className + " " : "") + this.fqn()
  35262. }
  35263. ,
  35264. s.build = function() {
  35265. throw Error(this.toString(!0) + " cannot be built directly")
  35266. }
  35267. ,
  35268. o.T = a;
  35269. var l = function(e, t, i, n, r) {
  35270. a.call(this, e, t, i),
  35271. this.className = "Namespace",
  35272. this.children = [],
  35273. this.options = n || {},
  35274. this.syntax = r || "proto2"
  35275. }
  35276. , c = l.prototype = Object.create(a.prototype);
  35277. c.getChildren = function(e) {
  35278. if (e = e || null,
  35279. null == e)
  35280. return this.children.slice();
  35281. for (var t = [], i = 0, n = this.children.length; i < n; ++i)
  35282. this.children[i]instanceof e && t.push(this.children[i]);
  35283. return t
  35284. }
  35285. ,
  35286. c.addChild = function(e) {
  35287. var t;
  35288. if (t = this.getChild(e.name))
  35289. if (t instanceof d.Field && t.name !== t.originalName && null === this.getChild(t.originalName))
  35290. t.name = t.originalName;
  35291. else {
  35292. if (!(e instanceof d.Field && e.name !== e.originalName && null === this.getChild(e.originalName)))
  35293. throw Error("Duplicate name in namespace " + this.toString(!0) + ": " + e.name);
  35294. e.name = e.originalName
  35295. }
  35296. this.children.push(e)
  35297. }
  35298. ,
  35299. c.getChild = function(e) {
  35300. for (var t = "number" == typeof e ? "id" : "name", i = 0, n = this.children.length; i < n; ++i)
  35301. if (this.children[i][t] === e)
  35302. return this.children[i];
  35303. return null
  35304. }
  35305. ,
  35306. c.resolve = function(e, t) {
  35307. var i = "string" == typeof e ? e.split(".") : e
  35308. , n = this
  35309. , r = 0;
  35310. if ("" === i[r]) {
  35311. for (; null !== n.parent; )
  35312. n = n.parent;
  35313. r++
  35314. }
  35315. var a;
  35316. do {
  35317. do {
  35318. if (!(n instanceof o.Namespace)) {
  35319. n = null;
  35320. break
  35321. }
  35322. if (a = n.getChild(i[r]),
  35323. !a || !(a instanceof o.T) || t && !(a instanceof o.Namespace)) {
  35324. n = null;
  35325. break
  35326. }
  35327. n = a,
  35328. r++
  35329. } while (r < i.length);if (null != n)
  35330. break;
  35331. if (null !== this.parent)
  35332. return this.parent.resolve(e, t)
  35333. } while (null != n);return n
  35334. }
  35335. ,
  35336. c.qn = function(e) {
  35337. var t = []
  35338. , i = e;
  35339. do
  35340. t.unshift(i.name),
  35341. i = i.parent;
  35342. while (null !== i);for (var n = 1; n <= t.length; n++) {
  35343. var r = t.slice(t.length - n);
  35344. if (e === this.resolve(r, e instanceof o.Namespace))
  35345. return r.join(".")
  35346. }
  35347. return e.fqn()
  35348. }
  35349. ,
  35350. c.build = function() {
  35351. for (var e, t = {}, i = this.children, n = 0, r = i.length; n < r; ++n)
  35352. e = i[n],
  35353. e instanceof l && (t[e.name] = e.build());
  35354. return Object.defineProperty && Object.defineProperty(t, "$options", {
  35355. value: this.buildOpt()
  35356. }),
  35357. t
  35358. }
  35359. ,
  35360. c.buildOpt = function() {
  35361. for (var e = {}, t = Object.keys(this.options), i = 0, n = t.length; i < n; ++i) {
  35362. var r = t[i]
  35363. , o = this.options[t[i]];
  35364. e[r] = o
  35365. }
  35366. return e
  35367. }
  35368. ,
  35369. c.getOption = function(e) {
  35370. return "undefined" == typeof e ? this.options : "undefined" != typeof this.options[e] ? this.options[e] : null
  35371. }
  35372. ,
  35373. o.Namespace = l;
  35374. var h = function(t, i, n, r) {
  35375. if (this.type = t,
  35376. this.resolvedType = i,
  35377. this.isMapKey = n,
  35378. this.syntax = r,
  35379. n && e.MAP_KEY_TYPES.indexOf(t) < 0)
  35380. throw Error("Invalid map key type: " + t.name)
  35381. }
  35382. , u = h.prototype;
  35383. h.defaultFieldValue = i,
  35384. u.verifyValue = function(i) {
  35385. function r(e, t) {
  35386. throw Error("Illegal value for " + o.toString(!0) + " of type " + o.type.name + ": " + e + " (" + t + ")")
  35387. }
  35388. var o = this;
  35389. switch (this.type) {
  35390. case e.TYPES.int32:
  35391. case e.TYPES.sint32:
  35392. case e.TYPES.sfixed32:
  35393. return ("number" != typeof i || i === i && i % 1 !== 0) && r(typeof i, "not an integer"),
  35394. i > 4294967295 ? 0 | i : i;
  35395. case e.TYPES.uint32:
  35396. case e.TYPES.fixed32:
  35397. return ("number" != typeof i || i === i && i % 1 !== 0) && r(typeof i, "not an integer"),
  35398. i < 0 ? i >>> 0 : i;
  35399. case e.TYPES.int64:
  35400. case e.TYPES.sint64:
  35401. case e.TYPES.sfixed64:
  35402. if (e.Long)
  35403. try {
  35404. return n(i, !1)
  35405. } catch (e) {
  35406. r(typeof i, e.message)
  35407. }
  35408. else
  35409. r(typeof i, "requires Long.js");
  35410. case e.TYPES.uint64:
  35411. case e.TYPES.fixed64:
  35412. if (e.Long)
  35413. try {
  35414. return n(i, !0)
  35415. } catch (e) {
  35416. r(typeof i, e.message)
  35417. }
  35418. else
  35419. r(typeof i, "requires Long.js");
  35420. case e.TYPES.bool:
  35421. return "boolean" != typeof i && r(typeof i, "not a boolean"),
  35422. i;
  35423. case e.TYPES.float:
  35424. case e.TYPES.double:
  35425. return "number" != typeof i && r(typeof i, "not a number"),
  35426. i;
  35427. case e.TYPES.string:
  35428. return "string" == typeof i || i && i instanceof String || r(typeof i, "not a string"),
  35429. "" + i;
  35430. case e.TYPES.bytes:
  35431. return t.isByteBuffer(i) ? i : t.wrap(i, "base64");
  35432. case e.TYPES.enum:
  35433. var a = this.resolvedType.getChildren(e.Reflect.Enum.Value);
  35434. for (l = 0; l < a.length; l++) {
  35435. if (a[l].name == i)
  35436. return a[l].id;
  35437. if (a[l].id == i)
  35438. return a[l].id
  35439. }
  35440. if ("proto3" === this.syntax)
  35441. return ("number" != typeof i || i === i && i % 1 !== 0) && r(typeof i, "not an integer"),
  35442. (i > 4294967295 || i < 0) && r(typeof i, "not in range for uint32"),
  35443. i;
  35444. r(i, "not a valid enum value");
  35445. case e.TYPES.group:
  35446. case e.TYPES.message:
  35447. if (i && "object" == typeof i || r(typeof i, "object expected"),
  35448. i instanceof this.resolvedType.clazz)
  35449. return i;
  35450. if (i instanceof e.Builder.Message) {
  35451. var s = {};
  35452. for (var l in i)
  35453. i.hasOwnProperty(l) && (s[l] = i[l]);
  35454. i = s
  35455. }
  35456. return new this.resolvedType.clazz(i)
  35457. }
  35458. throw Error("[INTERNAL] Illegal value for " + this.toString(!0) + ": " + i + " (undefined type " + this.type + ")")
  35459. }
  35460. ,
  35461. u.calculateLength = function(i, n) {
  35462. if (null === n)
  35463. return 0;
  35464. var r;
  35465. switch (this.type) {
  35466. case e.TYPES.int32:
  35467. return n < 0 ? t.calculateVarint64(n) : t.calculateVarint32(n);
  35468. case e.TYPES.uint32:
  35469. return t.calculateVarint32(n);
  35470. case e.TYPES.sint32:
  35471. return t.calculateVarint32(t.zigZagEncode32(n));
  35472. case e.TYPES.fixed32:
  35473. case e.TYPES.sfixed32:
  35474. case e.TYPES.float:
  35475. return 4;
  35476. case e.TYPES.int64:
  35477. case e.TYPES.uint64:
  35478. return t.calculateVarint64(n);
  35479. case e.TYPES.sint64:
  35480. return t.calculateVarint64(t.zigZagEncode64(n));
  35481. case e.TYPES.fixed64:
  35482. case e.TYPES.sfixed64:
  35483. return 8;
  35484. case e.TYPES.bool:
  35485. return 1;
  35486. case e.TYPES.enum:
  35487. return t.calculateVarint32(n);
  35488. case e.TYPES.double:
  35489. return 8;
  35490. case e.TYPES.string:
  35491. return r = t.calculateUTF8Bytes(n),
  35492. t.calculateVarint32(r) + r;
  35493. case e.TYPES.bytes:
  35494. if (n.remaining() < 0)
  35495. throw Error("Illegal value for " + this.toString(!0) + ": " + n.remaining() + " bytes remaining");
  35496. return t.calculateVarint32(n.remaining()) + n.remaining();
  35497. case e.TYPES.message:
  35498. return r = this.resolvedType.calculate(n),
  35499. t.calculateVarint32(r) + r;
  35500. case e.TYPES.group:
  35501. return r = this.resolvedType.calculate(n),
  35502. r + t.calculateVarint32(i << 3 | e.WIRE_TYPES.ENDGROUP)
  35503. }
  35504. throw Error("[INTERNAL] Illegal value to encode in " + this.toString(!0) + ": " + n + " (unknown type)")
  35505. }
  35506. ,
  35507. u.encodeValue = function(i, n, r) {
  35508. if (null === n)
  35509. return r;
  35510. switch (this.type) {
  35511. case e.TYPES.int32:
  35512. n < 0 ? r.writeVarint64(n) : r.writeVarint32(n);
  35513. break;
  35514. case e.TYPES.uint32:
  35515. r.writeVarint32(n);
  35516. break;
  35517. case e.TYPES.sint32:
  35518. r.writeVarint32ZigZag(n);
  35519. break;
  35520. case e.TYPES.fixed32:
  35521. r.writeUint32(n);
  35522. break;
  35523. case e.TYPES.sfixed32:
  35524. r.writeInt32(n);
  35525. break;
  35526. case e.TYPES.int64:
  35527. case e.TYPES.uint64:
  35528. r.writeVarint64(n);
  35529. break;
  35530. case e.TYPES.sint64:
  35531. r.writeVarint64ZigZag(n);
  35532. break;
  35533. case e.TYPES.fixed64:
  35534. r.writeUint64(n);
  35535. break;
  35536. case e.TYPES.sfixed64:
  35537. r.writeInt64(n);
  35538. break;
  35539. case e.TYPES.bool:
  35540. "string" == typeof n ? r.writeVarint32("false" === n.toLowerCase() ? 0 : !!n) : r.writeVarint32(n ? 1 : 0);
  35541. break;
  35542. case e.TYPES.enum:
  35543. r.writeVarint32(n);
  35544. break;
  35545. case e.TYPES.float:
  35546. r.writeFloat32(n);
  35547. break;
  35548. case e.TYPES.double:
  35549. r.writeFloat64(n);
  35550. break;
  35551. case e.TYPES.string:
  35552. r.writeVString(n);
  35553. break;
  35554. case e.TYPES.bytes:
  35555. if (n.remaining() < 0)
  35556. throw Error("Illegal value for " + this.toString(!0) + ": " + n.remaining() + " bytes remaining");
  35557. var o = n.offset;
  35558. r.writeVarint32(n.remaining()),
  35559. r.append(n),
  35560. n.offset = o;
  35561. break;
  35562. case e.TYPES.message:
  35563. var a = (new t).LE();
  35564. this.resolvedType.encode(n, a),
  35565. r.writeVarint32(a.offset),
  35566. r.append(a.flip());
  35567. break;
  35568. case e.TYPES.group:
  35569. this.resolvedType.encode(n, r),
  35570. r.writeVarint32(i << 3 | e.WIRE_TYPES.ENDGROUP);
  35571. break;
  35572. default:
  35573. throw Error("[INTERNAL] Illegal value to encode in " + this.toString(!0) + ": " + n + " (unknown type)")
  35574. }
  35575. return r
  35576. }
  35577. ,
  35578. u.decode = function(t, i, n) {
  35579. if (i != this.type.wireType)
  35580. throw Error("Unexpected wire type for element");
  35581. var r, o;
  35582. switch (this.type) {
  35583. case e.TYPES.int32:
  35584. return 0 | t.readVarint32();
  35585. case e.TYPES.uint32:
  35586. return t.readVarint32() >>> 0;
  35587. case e.TYPES.sint32:
  35588. return 0 | t.readVarint32ZigZag();
  35589. case e.TYPES.fixed32:
  35590. return t.readUint32() >>> 0;
  35591. case e.TYPES.sfixed32:
  35592. return 0 | t.readInt32();
  35593. case e.TYPES.int64:
  35594. return t.readVarint64();
  35595. case e.TYPES.uint64:
  35596. return t.readVarint64().toUnsigned();
  35597. case e.TYPES.sint64:
  35598. return t.readVarint64ZigZag();
  35599. case e.TYPES.fixed64:
  35600. return t.readUint64();
  35601. case e.TYPES.sfixed64:
  35602. return t.readInt64();
  35603. case e.TYPES.bool:
  35604. return !!t.readVarint32();
  35605. case e.TYPES.enum:
  35606. return t.readVarint32();
  35607. case e.TYPES.float:
  35608. return t.readFloat();
  35609. case e.TYPES.double:
  35610. return t.readDouble();
  35611. case e.TYPES.string:
  35612. return t.readVString();
  35613. case e.TYPES.bytes:
  35614. if (o = t.readVarint32(),
  35615. t.remaining() < o)
  35616. throw Error("Illegal number of bytes for " + this.toString(!0) + ": " + o + " required but got only " + t.remaining());
  35617. return r = t.clone(),
  35618. r.limit = r.offset + o,
  35619. t.offset += o,
  35620. r;
  35621. case e.TYPES.message:
  35622. return o = t.readVarint32(),
  35623. this.resolvedType.decode(t, o);
  35624. case e.TYPES.group:
  35625. return this.resolvedType.decode(t, -1, n)
  35626. }
  35627. throw Error("[INTERNAL] Illegal decode type")
  35628. }
  35629. ,
  35630. u.valueFromString = function(i) {
  35631. if (!this.isMapKey)
  35632. throw Error("valueFromString() called on non-map-key element");
  35633. switch (this.type) {
  35634. case e.TYPES.int32:
  35635. case e.TYPES.sint32:
  35636. case e.TYPES.sfixed32:
  35637. case e.TYPES.uint32:
  35638. case e.TYPES.fixed32:
  35639. return this.verifyValue(parseInt(i));
  35640. case e.TYPES.int64:
  35641. case e.TYPES.sint64:
  35642. case e.TYPES.sfixed64:
  35643. case e.TYPES.uint64:
  35644. case e.TYPES.fixed64:
  35645. return this.verifyValue(i);
  35646. case e.TYPES.bool:
  35647. return "true" === i;
  35648. case e.TYPES.string:
  35649. return this.verifyValue(i);
  35650. case e.TYPES.bytes:
  35651. return t.fromBinary(i)
  35652. }
  35653. }
  35654. ,
  35655. u.valueToString = function(t) {
  35656. if (!this.isMapKey)
  35657. throw Error("valueToString() called on non-map-key element");
  35658. return this.type === e.TYPES.bytes ? t.toString("binary") : t.toString()
  35659. }
  35660. ,
  35661. o.Element = h;
  35662. var d = function(e, t, i, n, r, o) {
  35663. l.call(this, e, t, i, n, o),
  35664. this.className = "Message",
  35665. this.extensions = void 0,
  35666. this.clazz = null,
  35667. this.isGroup = !!r,
  35668. this._fields = null,
  35669. this._fieldsById = null,
  35670. this._fieldsByName = null
  35671. }
  35672. , p = d.prototype = Object.create(l.prototype);
  35673. p.build = function(i) {
  35674. if (this.clazz && !i)
  35675. return this.clazz;
  35676. var n = function(e, i) {
  35677. function n(i, r, o, a) {
  35678. if (null === i || "object" != typeof i) {
  35679. if (a && a instanceof e.Reflect.Enum) {
  35680. var s = e.Reflect.Enum.getName(a.object, i);
  35681. if (null !== s)
  35682. return s
  35683. }
  35684. return i
  35685. }
  35686. if (t.isByteBuffer(i))
  35687. return r ? i.toBase64() : i.toBuffer();
  35688. if (e.Long.isLong(i))
  35689. return o ? i.toString() : e.Long.fromValue(i);
  35690. var l;
  35691. if (Array.isArray(i))
  35692. return l = [],
  35693. i.forEach(function(e, t) {
  35694. l[t] = n(e, r, o, a)
  35695. }),
  35696. l;
  35697. if (l = {},
  35698. i instanceof e.Map) {
  35699. for (var c = i.entries(), h = c.next(); !h.done; h = c.next())
  35700. l[i.keyElem.valueToString(h.value[0])] = n(h.value[1], r, o, i.valueElem.resolvedType);
  35701. return l
  35702. }
  35703. var u = i.$type
  35704. , d = void 0;
  35705. for (var p in i)
  35706. i.hasOwnProperty(p) && (u && (d = u.getChild(p)) ? l[p] = n(i[p], r, o, d.resolvedType) : l[p] = n(i[p], r, o));
  35707. return l
  35708. }
  35709. var r = i.getChildren(e.Reflect.Message.Field)
  35710. , o = i.getChildren(e.Reflect.Message.OneOf)
  35711. , a = function(n, s) {
  35712. e.Builder.Message.call(this);
  35713. for (var l = 0, c = o.length; l < c; ++l)
  35714. this[o[l].name] = null;
  35715. for (l = 0,
  35716. c = r.length; l < c; ++l) {
  35717. var h = r[l];
  35718. this[h.name] = h.repeated ? [] : h.map ? new e.Map(h) : null,
  35719. !h.required && "proto3" !== i.syntax || null === h.defaultValue || (this[h.name] = h.defaultValue)
  35720. }
  35721. if (arguments.length > 0) {
  35722. var u;
  35723. 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)
  35724. for (l = 0,
  35725. c = arguments.length; l < c; ++l)
  35726. "undefined" != typeof (u = arguments[l]) && this.$set(r[l].name, u);
  35727. else
  35728. this.$set(n)
  35729. }
  35730. }
  35731. , s = a.prototype = Object.create(e.Builder.Message.prototype);
  35732. s.add = function(t, n, r) {
  35733. var o = i._fieldsByName[t];
  35734. if (!r) {
  35735. if (!o)
  35736. throw Error(this + "#" + t + " is undefined");
  35737. if (!(o instanceof e.Reflect.Message.Field))
  35738. throw Error(this + "#" + t + " is not a field: " + o.toString(!0));
  35739. if (!o.repeated)
  35740. throw Error(this + "#" + t + " is not a repeated field");
  35741. n = o.verifyValue(n, !0)
  35742. }
  35743. return null === this[t] && (this[t] = []),
  35744. this[t].push(n),
  35745. this
  35746. }
  35747. ,
  35748. s.$add = s.add,
  35749. s.set = function(t, n, r) {
  35750. if (t && "object" == typeof t) {
  35751. r = n;
  35752. for (var o in t)
  35753. t.hasOwnProperty(o) && "undefined" != typeof (n = t[o]) && this.$set(o, n, r);
  35754. return this
  35755. }
  35756. var a = i._fieldsByName[t];
  35757. if (r)
  35758. this[t] = n;
  35759. else {
  35760. if (!a)
  35761. throw Error(this + "#" + t + " is not a field: undefined");
  35762. if (!(a instanceof e.Reflect.Message.Field))
  35763. throw Error(this + "#" + t + " is not a field: " + a.toString(!0));
  35764. this[a.name] = n = a.verifyValue(n)
  35765. }
  35766. if (a && a.oneof) {
  35767. var s = this[a.oneof.name];
  35768. null !== n ? (null !== s && s !== a.name && (this[s] = null),
  35769. this[a.oneof.name] = a.name) : s === t && (this[a.oneof.name] = null)
  35770. }
  35771. return this
  35772. }
  35773. ,
  35774. s.$set = s.set,
  35775. s.get = function(t, n) {
  35776. if (n)
  35777. return this[t];
  35778. var r = i._fieldsByName[t];
  35779. if (!(r && r instanceof e.Reflect.Message.Field))
  35780. throw Error(this + "#" + t + " is not a field: undefined");
  35781. if (!(r instanceof e.Reflect.Message.Field))
  35782. throw Error(this + "#" + t + " is not a field: " + r.toString(!0));
  35783. return this[r.name]
  35784. }
  35785. ,
  35786. s.$get = s.get;
  35787. for (var l = 0; l < r.length; l++) {
  35788. var c = r[l];
  35789. c instanceof e.Reflect.Message.ExtensionField || i.builder.options.populateAccessors && function(e) {
  35790. var t = e.originalName.replace(/(_[a-zA-Z])/g, function(e) {
  35791. return e.toUpperCase().replace("_", "")
  35792. });
  35793. t = t.substring(0, 1).toUpperCase() + t.substring(1);
  35794. var n = e.originalName.replace(/([A-Z])/g, function(e) {
  35795. return "_" + e
  35796. })
  35797. , r = function(t, i) {
  35798. return this[e.name] = i ? t : e.verifyValue(t),
  35799. this
  35800. }
  35801. , o = function() {
  35802. return this[e.name]
  35803. };
  35804. null === i.getChild("set" + t) && (s["set" + t] = r),
  35805. null === i.getChild("set_" + n) && (s["set_" + n] = r),
  35806. null === i.getChild("get" + t) && (s["get" + t] = o),
  35807. null === i.getChild("get_" + n) && (s["get_" + n] = o)
  35808. }(c)
  35809. }
  35810. s.encode = function(e, n) {
  35811. "boolean" == typeof e && (n = e,
  35812. e = void 0);
  35813. var r = !1;
  35814. e || (e = new t,
  35815. r = !0);
  35816. var o = e.littleEndian;
  35817. try {
  35818. return i.encode(this, e.LE(), n),
  35819. (r ? e.flip() : e).LE(o)
  35820. } catch (t) {
  35821. throw e.LE(o),
  35822. t
  35823. }
  35824. }
  35825. ,
  35826. a.encode = function(e, t, i) {
  35827. return new a(e).encode(t, i)
  35828. }
  35829. ,
  35830. s.calculate = function() {
  35831. return i.calculate(this)
  35832. }
  35833. ,
  35834. s.encodeDelimited = function(e, n) {
  35835. var r = !1;
  35836. e || (e = new t,
  35837. r = !0);
  35838. var o = (new t).LE();
  35839. return i.encode(this, o, n).flip(),
  35840. e.writeVarint32(o.remaining()),
  35841. e.append(o),
  35842. r ? e.flip() : e
  35843. }
  35844. ,
  35845. s.encodeAB = function() {
  35846. try {
  35847. return this.encode().toArrayBuffer()
  35848. } catch (e) {
  35849. throw e.encoded && (e.encoded = e.encoded.toArrayBuffer()),
  35850. e
  35851. }
  35852. }
  35853. ,
  35854. s.toArrayBuffer = s.encodeAB,
  35855. s.encodeNB = function() {
  35856. try {
  35857. return this.encode().toBuffer()
  35858. } catch (e) {
  35859. throw e.encoded && (e.encoded = e.encoded.toBuffer()),
  35860. e
  35861. }
  35862. }
  35863. ,
  35864. s.toBuffer = s.encodeNB,
  35865. s.encode64 = function() {
  35866. try {
  35867. return this.encode().toBase64()
  35868. } catch (e) {
  35869. throw e.encoded && (e.encoded = e.encoded.toBase64()),
  35870. e
  35871. }
  35872. }
  35873. ,
  35874. s.toBase64 = s.encode64,
  35875. s.encodeHex = function() {
  35876. try {
  35877. return this.encode().toHex()
  35878. } catch (e) {
  35879. throw e.encoded && (e.encoded = e.encoded.toHex()),
  35880. e
  35881. }
  35882. }
  35883. ,
  35884. s.toHex = s.encodeHex,
  35885. s.toRaw = function(e, t) {
  35886. return n(this, !!e, !!t, this.$type)
  35887. }
  35888. ,
  35889. s.encodeJSON = function() {
  35890. return JSON.stringify(n(this, !0, !0, this.$type))
  35891. }
  35892. ,
  35893. a.decode = function(e, n, r) {
  35894. "string" == typeof n && (r = n,
  35895. n = -1),
  35896. "string" == typeof e && (e = t.wrap(e, r ? r : "base64")),
  35897. e = t.isByteBuffer(e) ? e : t.wrap(e);
  35898. var o = e.littleEndian;
  35899. try {
  35900. var a = i.decode(e.LE());
  35901. return e.LE(o),
  35902. a
  35903. } catch (t) {
  35904. throw e.LE(o),
  35905. t
  35906. }
  35907. }
  35908. ,
  35909. a.decodeDelimited = function(e, n) {
  35910. if ("string" == typeof e && (e = t.wrap(e, n ? n : "base64")),
  35911. e = t.isByteBuffer(e) ? e : t.wrap(e),
  35912. e.remaining() < 1)
  35913. return null;
  35914. var r = e.offset
  35915. , o = e.readVarint32();
  35916. if (e.remaining() < o)
  35917. return e.offset = r,
  35918. null;
  35919. try {
  35920. var a = i.decode(e.slice(e.offset, e.offset + o).LE());
  35921. return e.offset += o,
  35922. a
  35923. } catch (t) {
  35924. throw e.offset += o,
  35925. t
  35926. }
  35927. }
  35928. ,
  35929. a.decode64 = function(e) {
  35930. return a.decode(e, "base64")
  35931. }
  35932. ,
  35933. a.decodeHex = function(e) {
  35934. return a.decode(e, "hex")
  35935. }
  35936. ,
  35937. a.decodeJSON = function(e) {
  35938. return new a(JSON.parse(e))
  35939. }
  35940. ,
  35941. s.toString = function() {
  35942. return i.toString()
  35943. }
  35944. ;
  35945. return Object.defineProperty && (Object.defineProperty(a, "$options", {
  35946. value: i.buildOpt()
  35947. }),
  35948. Object.defineProperty(s, "$options", {
  35949. value: a.$options
  35950. }),
  35951. Object.defineProperty(a, "$type", {
  35952. value: i
  35953. }),
  35954. Object.defineProperty(s, "$type", {
  35955. value: i
  35956. })),
  35957. a
  35958. }(e, this);
  35959. this._fields = [],
  35960. this._fieldsById = {},
  35961. this._fieldsByName = {};
  35962. for (var r, o = 0, a = this.children.length; o < a; o++)
  35963. if (r = this.children[o],
  35964. r instanceof A || r instanceof d || r instanceof E) {
  35965. if (n.hasOwnProperty(r.name))
  35966. throw Error("Illegal reflect child of " + this.toString(!0) + ": " + r.toString(!0) + " cannot override static property '" + r.name + "'");
  35967. n[r.name] = r.build()
  35968. } else if (r instanceof d.Field)
  35969. r.build(),
  35970. this._fields.push(r),
  35971. this._fieldsById[r.id] = r,
  35972. this._fieldsByName[r.name] = r;
  35973. else if (!(r instanceof d.OneOf || r instanceof I))
  35974. throw Error("Illegal reflect child of " + this.toString(!0) + ": " + this.children[o].toString(!0));
  35975. return this.clazz = n
  35976. }
  35977. ,
  35978. p.encode = function(e, t, i) {
  35979. for (var n, r, o = null, a = 0, s = this._fields.length; a < s; ++a)
  35980. n = this._fields[a],
  35981. r = e[n.name],
  35982. n.required && null === r ? null === o && (o = n) : n.encode(i ? r : n.verifyValue(r), t, e);
  35983. if (null !== o) {
  35984. var l = Error("Missing at least one required field for " + this.toString(!0) + ": " + o);
  35985. throw l.encoded = t,
  35986. l
  35987. }
  35988. return t
  35989. }
  35990. ,
  35991. p.calculate = function(e) {
  35992. for (var t, i, n = 0, r = 0, o = this._fields.length; r < o; ++r) {
  35993. if (t = this._fields[r],
  35994. i = e[t.name],
  35995. t.required && null === i)
  35996. throw Error("Missing at least one required field for " + this.toString(!0) + ": " + t);
  35997. n += t.calculate(i, e)
  35998. }
  35999. return n
  36000. }
  36001. ,
  36002. p.decode = function(t, i, n) {
  36003. i = "number" == typeof i ? i : -1;
  36004. for (var o, a, s, l, c = t.offset, h = new this.clazz; t.offset < c + i || i === -1 && t.remaining() > 0; ) {
  36005. if (o = t.readVarint32(),
  36006. a = 7 & o,
  36007. s = o >>> 3,
  36008. a === e.WIRE_TYPES.ENDGROUP) {
  36009. if (s !== n)
  36010. throw Error("Illegal group end indicator for " + this.toString(!0) + ": " + s + " (" + (n ? n + " expected" : "not a group") + ")");
  36011. break
  36012. }
  36013. if (l = this._fieldsById[s]) {
  36014. if (l.repeated && !l.options.packed)
  36015. h[l.name].push(l.decode(a, t));
  36016. else if (l.map) {
  36017. var u = l.decode(a, t);
  36018. h[l.name].set(u[0], u[1])
  36019. } else if (h[l.name] = l.decode(a, t),
  36020. l.oneof) {
  36021. var d = h[l.oneof.name];
  36022. null !== d && d !== l.name && (h[d] = null),
  36023. h[l.oneof.name] = l.name
  36024. }
  36025. } else
  36026. switch (a) {
  36027. case e.WIRE_TYPES.VARINT:
  36028. t.readVarint32();
  36029. break;
  36030. case e.WIRE_TYPES.BITS32:
  36031. t.offset += 4;
  36032. break;
  36033. case e.WIRE_TYPES.BITS64:
  36034. t.offset += 8;
  36035. break;
  36036. case e.WIRE_TYPES.LDELIM:
  36037. var p = t.readVarint32();
  36038. t.offset += p;
  36039. break;
  36040. case e.WIRE_TYPES.STARTGROUP:
  36041. for (; r(s, t); )
  36042. ;
  36043. break;
  36044. default:
  36045. throw Error("Illegal wire type for unknown field " + s + " in " + this.toString(!0) + "#decode: " + a)
  36046. }
  36047. }
  36048. for (var f = 0, g = this._fields.length; f < g; ++f)
  36049. if (l = this._fields[f],
  36050. null === h[l.name])
  36051. if ("proto3" === this.syntax)
  36052. h[l.name] = l.defaultValue;
  36053. else {
  36054. if (l.required) {
  36055. var m = Error("Missing at least one required field for " + this.toString(!0) + ": " + l.name);
  36056. throw m.decoded = h,
  36057. m
  36058. }
  36059. e.populateDefaults && null !== l.defaultValue && (h[l.name] = l.defaultValue)
  36060. }
  36061. return h
  36062. }
  36063. ,
  36064. o.Message = d;
  36065. var f = function(t, i, n, r, o, s, l, c, h, u) {
  36066. a.call(this, t, i, s),
  36067. this.className = "Message.Field",
  36068. this.required = "required" === n,
  36069. this.repeated = "repeated" === n,
  36070. this.map = "map" === n,
  36071. this.keyType = r || null,
  36072. this.type = o,
  36073. this.resolvedType = null,
  36074. this.id = l,
  36075. this.options = c || {},
  36076. this.defaultValue = null,
  36077. this.oneof = h || null,
  36078. this.syntax = u || "proto2",
  36079. this.originalName = this.name,
  36080. this.element = null,
  36081. this.keyElement = null,
  36082. !this.builder.options.convertFieldsToCamelCase || this instanceof d.ExtensionField || (this.name = e.Util.toCamelCase(this.name))
  36083. }
  36084. , g = f.prototype = Object.create(a.prototype);
  36085. g.build = function() {
  36086. this.element = new h(this.type,this.resolvedType,!1,this.syntax),
  36087. this.map && (this.keyElement = new h(this.keyType,void 0,!0,this.syntax)),
  36088. "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)
  36089. }
  36090. ,
  36091. g.verifyValue = function(t, i) {
  36092. function n(e, t) {
  36093. throw Error("Illegal value for " + r.toString(!0) + " of type " + r.type.name + ": " + e + " (" + t + ")")
  36094. }
  36095. i = i || !1;
  36096. var r = this;
  36097. if (null === t)
  36098. return this.required && n(typeof t, "required"),
  36099. "proto3" === this.syntax && this.type !== e.TYPES.message && n(typeof t, "proto3 field without field presence cannot be null"),
  36100. null;
  36101. var o;
  36102. if (this.repeated && !i) {
  36103. Array.isArray(t) || (t = [t]);
  36104. var a = [];
  36105. for (o = 0; o < t.length; o++)
  36106. a.push(this.element.verifyValue(t[o]));
  36107. return a
  36108. }
  36109. return this.map && !i ? t instanceof e.Map ? t : (t instanceof Object || n(typeof t, "expected ProtoBuf.Map or raw object for map field"),
  36110. new e.Map(this,t)) : (!this.repeated && Array.isArray(t) && n(typeof t, "no array expected"),
  36111. this.element.verifyValue(t))
  36112. }
  36113. ,
  36114. g.hasWirePresence = function(t, i) {
  36115. if ("proto3" !== this.syntax)
  36116. return null !== t;
  36117. if (this.oneof && i[this.oneof.name] === this.name)
  36118. return !0;
  36119. switch (this.type) {
  36120. case e.TYPES.int32:
  36121. case e.TYPES.sint32:
  36122. case e.TYPES.sfixed32:
  36123. case e.TYPES.uint32:
  36124. case e.TYPES.fixed32:
  36125. return 0 !== t;
  36126. case e.TYPES.int64:
  36127. case e.TYPES.sint64:
  36128. case e.TYPES.sfixed64:
  36129. case e.TYPES.uint64:
  36130. case e.TYPES.fixed64:
  36131. return 0 !== t.low || 0 !== t.high;
  36132. case e.TYPES.bool:
  36133. return t;
  36134. case e.TYPES.float:
  36135. case e.TYPES.double:
  36136. return 0 !== t;
  36137. case e.TYPES.string:
  36138. return t.length > 0;
  36139. case e.TYPES.bytes:
  36140. return t.remaining() > 0;
  36141. case e.TYPES.enum:
  36142. return 0 !== t;
  36143. case e.TYPES.message:
  36144. return null !== t;
  36145. default:
  36146. return !0
  36147. }
  36148. }
  36149. ,
  36150. g.encode = function(i, n, r) {
  36151. if (null === this.type || "object" != typeof this.type)
  36152. throw Error("[INTERNAL] Unresolved type in " + this.toString(!0) + ": " + this.type);
  36153. if (null === i || this.repeated && 0 == i.length)
  36154. return n;
  36155. try {
  36156. if (this.repeated) {
  36157. var o;
  36158. if (this.options.packed && e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0) {
  36159. n.writeVarint32(this.id << 3 | e.WIRE_TYPES.LDELIM),
  36160. n.ensureCapacity(n.offset += 1);
  36161. var a = n.offset;
  36162. for (o = 0; o < i.length; o++)
  36163. this.element.encodeValue(this.id, i[o], n);
  36164. var s = n.offset - a
  36165. , l = t.calculateVarint32(s);
  36166. if (l > 1) {
  36167. var c = n.slice(a, n.offset);
  36168. a += l - 1,
  36169. n.offset = a,
  36170. n.append(c)
  36171. }
  36172. n.writeVarint32(s, a - l)
  36173. } else
  36174. for (o = 0; o < i.length; o++)
  36175. n.writeVarint32(this.id << 3 | this.type.wireType),
  36176. this.element.encodeValue(this.id, i[o], n)
  36177. } else
  36178. this.map ? i.forEach(function(i, r, o) {
  36179. var a = t.calculateVarint32(8 | this.keyType.wireType) + this.keyElement.calculateLength(1, r) + t.calculateVarint32(16 | this.type.wireType) + this.element.calculateLength(2, i);
  36180. n.writeVarint32(this.id << 3 | e.WIRE_TYPES.LDELIM),
  36181. n.writeVarint32(a),
  36182. n.writeVarint32(8 | this.keyType.wireType),
  36183. this.keyElement.encodeValue(1, r, n),
  36184. n.writeVarint32(16 | this.type.wireType),
  36185. this.element.encodeValue(2, i, n)
  36186. }, this) : this.hasWirePresence(i, r) && (n.writeVarint32(this.id << 3 | this.type.wireType),
  36187. this.element.encodeValue(this.id, i, n))
  36188. } catch (e) {
  36189. throw Error("Illegal value for " + this.toString(!0) + ": " + i + " (" + e + ")")
  36190. }
  36191. return n
  36192. }
  36193. ,
  36194. g.calculate = function(i, n) {
  36195. if (i = this.verifyValue(i),
  36196. null === this.type || "object" != typeof this.type)
  36197. throw Error("[INTERNAL] Unresolved type in " + this.toString(!0) + ": " + this.type);
  36198. if (null === i || this.repeated && 0 == i.length)
  36199. return 0;
  36200. var r = 0;
  36201. try {
  36202. if (this.repeated) {
  36203. var o, a;
  36204. if (this.options.packed && e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0) {
  36205. for (r += t.calculateVarint32(this.id << 3 | e.WIRE_TYPES.LDELIM),
  36206. a = 0,
  36207. o = 0; o < i.length; o++)
  36208. a += this.element.calculateLength(this.id, i[o]);
  36209. r += t.calculateVarint32(a),
  36210. r += a
  36211. } else
  36212. for (o = 0; o < i.length; o++)
  36213. r += t.calculateVarint32(this.id << 3 | this.type.wireType),
  36214. r += this.element.calculateLength(this.id, i[o])
  36215. } else
  36216. this.map ? i.forEach(function(i, n, o) {
  36217. var a = t.calculateVarint32(8 | this.keyType.wireType) + this.keyElement.calculateLength(1, n) + t.calculateVarint32(16 | this.type.wireType) + this.element.calculateLength(2, i);
  36218. r += t.calculateVarint32(this.id << 3 | e.WIRE_TYPES.LDELIM),
  36219. r += t.calculateVarint32(a),
  36220. r += a
  36221. }, this) : this.hasWirePresence(i, n) && (r += t.calculateVarint32(this.id << 3 | this.type.wireType),
  36222. r += this.element.calculateLength(this.id, i))
  36223. } catch (e) {
  36224. throw Error("Illegal value for " + this.toString(!0) + ": " + i + " (" + e + ")")
  36225. }
  36226. return r
  36227. }
  36228. ,
  36229. g.decode = function(t, i, n) {
  36230. 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;
  36231. if (!a)
  36232. throw Error("Illegal wire type for field " + this.toString(!0) + ": " + t + " (" + this.type.wireType + " expected)");
  36233. if (t == e.WIRE_TYPES.LDELIM && this.repeated && this.options.packed && e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0 && !n) {
  36234. o = i.readVarint32(),
  36235. o = i.offset + o;
  36236. for (var s = []; i.offset < o; )
  36237. s.push(this.decode(this.type.wireType, i, !0));
  36238. return s
  36239. }
  36240. if (this.map) {
  36241. var l = h.defaultFieldValue(this.keyType);
  36242. if (r = h.defaultFieldValue(this.type),
  36243. o = i.readVarint32(),
  36244. i.remaining() < o)
  36245. throw Error("Illegal number of bytes for " + this.toString(!0) + ": " + o + " required but got only " + i.remaining());
  36246. var c = i.clone();
  36247. for (c.limit = c.offset + o,
  36248. i.offset += o; c.remaining() > 0; ) {
  36249. var u = c.readVarint32();
  36250. t = 7 & u;
  36251. var d = u >>> 3;
  36252. if (1 === d)
  36253. l = this.keyElement.decode(c, t, d);
  36254. else {
  36255. if (2 !== d)
  36256. throw Error("Unexpected tag in map field key/value submessage");
  36257. r = this.element.decode(c, t, d)
  36258. }
  36259. }
  36260. return [l, r]
  36261. }
  36262. return this.element.decode(i, t, this.id)
  36263. }
  36264. ,
  36265. o.Message.Field = f;
  36266. var m = function(e, t, i, n, r, o, a) {
  36267. f.call(this, e, t, i, null, n, r, o, a),
  36268. this.extension
  36269. };
  36270. m.prototype = Object.create(f.prototype),
  36271. o.Message.ExtensionField = m;
  36272. var v = function(e, t, i) {
  36273. a.call(this, e, t, i),
  36274. this.fields = []
  36275. };
  36276. o.Message.OneOf = v;
  36277. var A = function(e, t, i, n, r) {
  36278. l.call(this, e, t, i, n, r),
  36279. this.className = "Enum",
  36280. this.object = null
  36281. };
  36282. A.getName = function(e, t) {
  36283. for (var i, n = Object.keys(e), r = 0; r < n.length; ++r)
  36284. if (e[i = n[r]] === t)
  36285. return i;
  36286. return null
  36287. }
  36288. ;
  36289. var y = A.prototype = Object.create(l.prototype);
  36290. y.build = function(t) {
  36291. if (this.object && !t)
  36292. return this.object;
  36293. for (var i = new e.Builder.Enum, n = this.getChildren(A.Value), r = 0, o = n.length; r < o; ++r)
  36294. i[n[r].name] = n[r].id;
  36295. return Object.defineProperty && Object.defineProperty(i, "$options", {
  36296. value: this.buildOpt(),
  36297. enumerable: !1
  36298. }),
  36299. this.object = i
  36300. }
  36301. ,
  36302. o.Enum = A;
  36303. var C = function(e, t, i, n) {
  36304. a.call(this, e, t, i),
  36305. this.className = "Enum.Value",
  36306. this.id = n
  36307. };
  36308. C.prototype = Object.create(a.prototype),
  36309. o.Enum.Value = C;
  36310. var I = function(e, t, i, n) {
  36311. a.call(this, e, t, i),
  36312. this.field = n
  36313. };
  36314. I.prototype = Object.create(a.prototype),
  36315. o.Extension = I;
  36316. var E = function(e, t, i, n) {
  36317. l.call(this, e, t, i, n),
  36318. this.className = "Service",
  36319. this.clazz = null
  36320. }
  36321. , b = E.prototype = Object.create(l.prototype);
  36322. b.build = function(i) {
  36323. return this.clazz && !i ? this.clazz : this.clazz = function(e, i) {
  36324. for (var n = function(t) {
  36325. e.Builder.Service.call(this),
  36326. this.rpcImpl = t || function(e, t, i) {
  36327. setTimeout(i.bind(this, Error("Not implemented, see: https://github.com/dcodeIO/ProtoBuf.js/wiki/Services")), 0)
  36328. }
  36329. }, r = n.prototype = Object.create(e.Builder.Service.prototype), o = i.getChildren(e.Reflect.Service.RPCMethod), a = 0; a < o.length; a++)
  36330. !function(e) {
  36331. r[e.name] = function(n, r) {
  36332. try {
  36333. try {
  36334. n = e.resolvedRequestType.clazz.decode(t.wrap(n))
  36335. } catch (e) {
  36336. if (!(e instanceof TypeError))
  36337. throw e
  36338. }
  36339. if (null === n || "object" != typeof n)
  36340. throw Error("Illegal arguments");
  36341. n instanceof e.resolvedRequestType.clazz || (n = new e.resolvedRequestType.clazz(n)),
  36342. this.rpcImpl(e.fqn(), n, function(t, n) {
  36343. if (t)
  36344. return void r(t);
  36345. null === n && (n = "");
  36346. try {
  36347. n = e.resolvedResponseType.clazz.decode(n)
  36348. } catch (e) {}
  36349. 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))
  36350. })
  36351. } catch (e) {
  36352. setTimeout(r.bind(this, e), 0)
  36353. }
  36354. }
  36355. ,
  36356. n[e.name] = function(t, i, r) {
  36357. new n(t)[e.name](i, r)
  36358. }
  36359. ,
  36360. Object.defineProperty && (Object.defineProperty(n[e.name], "$options", {
  36361. value: e.buildOpt()
  36362. }),
  36363. Object.defineProperty(r[e.name], "$options", {
  36364. value: n[e.name].$options
  36365. }))
  36366. }(o[a]);
  36367. return Object.defineProperty && (Object.defineProperty(n, "$options", {
  36368. value: i.buildOpt()
  36369. }),
  36370. Object.defineProperty(r, "$options", {
  36371. value: n.$options
  36372. }),
  36373. Object.defineProperty(n, "$type", {
  36374. value: i
  36375. }),
  36376. Object.defineProperty(r, "$type", {
  36377. value: i
  36378. })),
  36379. n
  36380. }(e, this)
  36381. }
  36382. ,
  36383. o.Service = E;
  36384. var w = function(e, t, i, n) {
  36385. a.call(this, e, t, i),
  36386. this.className = "Service.Method",
  36387. this.options = n || {}
  36388. }
  36389. , _ = w.prototype = Object.create(a.prototype);
  36390. _.buildOpt = c.buildOpt,
  36391. o.Service.Method = w;
  36392. var T = function(e, t, i, n, r, o, a, s) {
  36393. w.call(this, e, t, i, s),
  36394. this.className = "Service.RPCMethod",
  36395. this.requestName = n,
  36396. this.responseName = r,
  36397. this.requestStream = o,
  36398. this.responseStream = a,
  36399. this.resolvedRequestType = null,
  36400. this.resolvedResponseType = null
  36401. };
  36402. return T.prototype = Object.create(w.prototype),
  36403. o.Service.RPCMethod = T,
  36404. o
  36405. }(r),
  36406. r.Builder = function(t, i, n) {
  36407. function r(e) {
  36408. e.messages && e.messages.forEach(function(t) {
  36409. t.syntax = e.syntax,
  36410. r(t)
  36411. }),
  36412. e.enums && e.enums.forEach(function(t) {
  36413. t.syntax = e.syntax
  36414. })
  36415. }
  36416. var o = function(e) {
  36417. this.ns = new n.Namespace(this,null,""),
  36418. this.ptr = this.ns,
  36419. this.resolved = !1,
  36420. this.result = null,
  36421. this.files = {},
  36422. this.importRoot = null,
  36423. this.options = e || {}
  36424. }
  36425. , a = o.prototype;
  36426. return o.isMessage = function(e) {
  36427. return "string" == typeof e.name && ("undefined" == typeof e.values && "undefined" == typeof e.rpc)
  36428. }
  36429. ,
  36430. o.isMessageField = function(e) {
  36431. return "string" == typeof e.rule && "string" == typeof e.name && "string" == typeof e.type && "undefined" != typeof e.id
  36432. }
  36433. ,
  36434. o.isEnum = function(e) {
  36435. return "string" == typeof e.name && !("undefined" == typeof e.values || !Array.isArray(e.values) || 0 === e.values.length)
  36436. }
  36437. ,
  36438. o.isService = function(e) {
  36439. return !("string" != typeof e.name || "object" != typeof e.rpc || !e.rpc)
  36440. }
  36441. ,
  36442. o.isExtend = function(e) {
  36443. return "string" == typeof e.ref
  36444. }
  36445. ,
  36446. a.reset = function() {
  36447. return this.ptr = this.ns,
  36448. this
  36449. }
  36450. ,
  36451. a.define = function(e) {
  36452. if ("string" != typeof e || !i.TYPEREF.test(e))
  36453. throw Error("illegal namespace: " + e);
  36454. return e.split(".").forEach(function(e) {
  36455. var t = this.ptr.getChild(e);
  36456. null === t && this.ptr.addChild(t = new n.Namespace(this,this.ptr,e)),
  36457. this.ptr = t
  36458. }, this),
  36459. this
  36460. }
  36461. ,
  36462. a.create = function(e) {
  36463. if (!e)
  36464. return this;
  36465. if (Array.isArray(e)) {
  36466. if (0 === e.length)
  36467. return this;
  36468. e = e.slice()
  36469. } else
  36470. e = [e];
  36471. for (var i = [e]; i.length > 0; ) {
  36472. if (e = i.pop(),
  36473. !Array.isArray(e))
  36474. throw Error("not a valid namespace: " + JSON.stringify(e));
  36475. for (; e.length > 0; ) {
  36476. var r = e.shift();
  36477. if (o.isMessage(r)) {
  36478. var a = new n.Message(this,this.ptr,r.name,r.options,r.isGroup,r.syntax)
  36479. , s = {};
  36480. r.oneofs && Object.keys(r.oneofs).forEach(function(e) {
  36481. a.addChild(s[e] = new n.Message.OneOf(this,a,e))
  36482. }, this),
  36483. r.fields && r.fields.forEach(function(e) {
  36484. if (null !== a.getChild(0 | e.id))
  36485. throw Error("duplicate or invalid field id in " + a.name + ": " + e.id);
  36486. if (e.options && "object" != typeof e.options)
  36487. throw Error("illegal field options in " + a.name + "#" + e.name);
  36488. var t = null;
  36489. if ("string" == typeof e.oneof && !(t = s[e.oneof]))
  36490. throw Error("illegal oneof in " + a.name + "#" + e.name + ": " + e.oneof);
  36491. e = new n.Message.Field(this,a,e.rule,e.keytype,e.type,e.name,e.id,e.options,t,r.syntax),
  36492. t && t.fields.push(e),
  36493. a.addChild(e)
  36494. }, this);
  36495. var l = [];
  36496. if (r.enums && r.enums.forEach(function(e) {
  36497. l.push(e)
  36498. }),
  36499. r.messages && r.messages.forEach(function(e) {
  36500. l.push(e)
  36501. }),
  36502. r.services && r.services.forEach(function(e) {
  36503. l.push(e)
  36504. }),
  36505. r.extensions && ("number" == typeof r.extensions[0] ? a.extensions = [r.extensions] : a.extensions = r.extensions),
  36506. this.ptr.addChild(a),
  36507. l.length > 0) {
  36508. i.push(e),
  36509. e = l,
  36510. l = null,
  36511. this.ptr = a,
  36512. a = null;
  36513. continue
  36514. }
  36515. l = null
  36516. } else if (o.isEnum(r))
  36517. a = new n.Enum(this,this.ptr,r.name,r.options,r.syntax),
  36518. r.values.forEach(function(e) {
  36519. a.addChild(new n.Enum.Value(this,a,e.name,e.id))
  36520. }, this),
  36521. this.ptr.addChild(a);
  36522. else if (o.isService(r))
  36523. a = new n.Service(this,this.ptr,r.name,r.options),
  36524. Object.keys(r.rpc).forEach(function(e) {
  36525. var t = r.rpc[e];
  36526. a.addChild(new n.Service.RPCMethod(this,a,e,t.request,t.response,!!t.request_stream,!!t.response_stream,t.options))
  36527. }, this),
  36528. this.ptr.addChild(a);
  36529. else {
  36530. if (!o.isExtend(r))
  36531. throw Error("not a valid definition: " + JSON.stringify(r));
  36532. if (a = this.ptr.resolve(r.ref, !0))
  36533. r.fields.forEach(function(e) {
  36534. if (null !== a.getChild(0 | e.id))
  36535. throw Error("duplicate extended field id in " + a.name + ": " + e.id);
  36536. if (a.extensions) {
  36537. var i = !1;
  36538. if (a.extensions.forEach(function(t) {
  36539. e.id >= t[0] && e.id <= t[1] && (i = !0)
  36540. }),
  36541. !i)
  36542. throw Error("illegal extended field id in " + a.name + ": " + e.id + " (not within valid ranges)")
  36543. }
  36544. var r = e.name;
  36545. this.options.convertFieldsToCamelCase && (r = t.Util.toCamelCase(r));
  36546. var o = new n.Message.ExtensionField(this,a,e.rule,e.type,this.ptr.fqn() + "." + r,e.id,e.options)
  36547. , s = new n.Extension(this,this.ptr,e.name,o);
  36548. o.extension = s,
  36549. this.ptr.addChild(s),
  36550. a.addChild(o)
  36551. }, this);
  36552. else if (!/\.?google\.protobuf\./.test(r.ref))
  36553. throw Error("extended message " + r.ref + " is not defined")
  36554. }
  36555. r = null,
  36556. a = null
  36557. }
  36558. e = null,
  36559. this.ptr = this.ptr.parent
  36560. }
  36561. return this.resolved = !1,
  36562. this.result = null,
  36563. this
  36564. }
  36565. ,
  36566. a.import = function(i, n) {
  36567. var o = "/";
  36568. if ("string" == typeof n) {
  36569. if (t.Util.IS_NODE && (n = e("path").resolve(n)),
  36570. this.files[n] === !0)
  36571. return this.reset();
  36572. this.files[n] = !0
  36573. } else if ("object" == typeof n) {
  36574. var a = n.root;
  36575. t.Util.IS_NODE && (a = e("path").resolve(a)),
  36576. (a.indexOf("\\") >= 0 || n.file.indexOf("\\") >= 0) && (o = "\\");
  36577. var s = a + o + n.file;
  36578. if (this.files[s] === !0)
  36579. return this.reset();
  36580. this.files[s] = !0
  36581. }
  36582. if (i.imports && i.imports.length > 0) {
  36583. var l, c = !1;
  36584. "object" == typeof n ? (this.importRoot = n.root,
  36585. c = !0,
  36586. l = this.importRoot,
  36587. n = n.file,
  36588. (l.indexOf("\\") >= 0 || n.indexOf("\\") >= 0) && (o = "\\")) : "string" == typeof n ? this.importRoot ? l = this.importRoot : n.indexOf("/") >= 0 ? (l = n.replace(/\/[^\/]*$/, ""),
  36589. "" === l && (l = "/")) : n.indexOf("\\") >= 0 ? (l = n.replace(/\\[^\\]*$/, ""),
  36590. o = "\\") : l = "." : l = null;
  36591. for (var h = 0; h < i.imports.length; h++)
  36592. if ("string" == typeof i.imports[h]) {
  36593. if (!l)
  36594. throw Error("cannot determine import root");
  36595. var u = i.imports[h];
  36596. if ("google/protobuf/descriptor.proto" === u)
  36597. continue;
  36598. if (u = l + o + u,
  36599. this.files[u] === !0)
  36600. continue;
  36601. /\.proto$/i.test(u) && !t.DotProto && (u = u.replace(/\.proto$/, ".json"));
  36602. var d = t.Util.fetch(u);
  36603. if (null === d)
  36604. throw Error("failed to import '" + u + "' in '" + n + "': file not found");
  36605. /\.json$/i.test(u) ? this.import(JSON.parse(d + ""), u) : this.import(t.DotProto.Parser.parse(d), u)
  36606. } else
  36607. n ? /\.(\w+)$/.test(n) ? this.import(i.imports[h], n.replace(/^(.+)\.(\w+)$/, function(e, t, i) {
  36608. return t + "_import" + h + "." + i
  36609. })) : this.import(i.imports[h], n + "_import" + h) : this.import(i.imports[h]);
  36610. c && (this.importRoot = null)
  36611. }
  36612. i.package && this.define(i.package),
  36613. i.syntax && r(i);
  36614. var p = this.ptr;
  36615. return i.options && Object.keys(i.options).forEach(function(e) {
  36616. p.options[e] = i.options[e]
  36617. }),
  36618. i.messages && (this.create(i.messages),
  36619. this.ptr = p),
  36620. i.enums && (this.create(i.enums),
  36621. this.ptr = p),
  36622. i.services && (this.create(i.services),
  36623. this.ptr = p),
  36624. i.extends && this.create(i.extends),
  36625. this.reset()
  36626. }
  36627. ,
  36628. a.resolveAll = function() {
  36629. var e;
  36630. if (null == this.ptr || "object" == typeof this.ptr.type)
  36631. return this;
  36632. if (this.ptr instanceof n.Namespace)
  36633. this.ptr.children.forEach(function(e) {
  36634. this.ptr = e,
  36635. this.resolveAll()
  36636. }, this);
  36637. else if (this.ptr instanceof n.Message.Field) {
  36638. if (i.TYPE.test(this.ptr.type))
  36639. this.ptr.type = t.TYPES[this.ptr.type];
  36640. else {
  36641. if (!i.TYPEREF.test(this.ptr.type))
  36642. throw Error("illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  36643. if (e = (this.ptr instanceof n.Message.ExtensionField ? this.ptr.extension.parent : this.ptr.parent).resolve(this.ptr.type, !0),
  36644. !e)
  36645. throw Error("unresolvable type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  36646. if (this.ptr.resolvedType = e,
  36647. e instanceof n.Enum) {
  36648. if (this.ptr.type = t.TYPES.enum,
  36649. "proto3" === this.ptr.syntax && "proto3" !== e.syntax)
  36650. throw Error("proto3 message cannot reference proto2 enum")
  36651. } else {
  36652. if (!(e instanceof n.Message))
  36653. throw Error("illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  36654. this.ptr.type = e.isGroup ? t.TYPES.group : t.TYPES.message
  36655. }
  36656. }
  36657. if (this.ptr.map) {
  36658. if (!i.TYPE.test(this.ptr.keyType))
  36659. throw Error("illegal key type for map field in " + this.ptr.toString(!0) + ": " + this.ptr.keyType);
  36660. this.ptr.keyType = t.TYPES[this.ptr.keyType]
  36661. }
  36662. } else if (this.ptr instanceof t.Reflect.Service.Method) {
  36663. if (!(this.ptr instanceof t.Reflect.Service.RPCMethod))
  36664. throw Error("illegal service type in " + this.ptr.toString(!0));
  36665. if (e = this.ptr.parent.resolve(this.ptr.requestName, !0),
  36666. !(e && e instanceof t.Reflect.Message))
  36667. throw Error("Illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.requestName);
  36668. if (this.ptr.resolvedRequestType = e,
  36669. e = this.ptr.parent.resolve(this.ptr.responseName, !0),
  36670. !(e && e instanceof t.Reflect.Message))
  36671. throw Error("Illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.responseName);
  36672. this.ptr.resolvedResponseType = e
  36673. } else if (!(this.ptr instanceof t.Reflect.Message.OneOf || this.ptr instanceof t.Reflect.Extension || this.ptr instanceof t.Reflect.Enum.Value))
  36674. throw Error("illegal object in namespace: " + typeof this.ptr + ": " + this.ptr);
  36675. return this.reset()
  36676. }
  36677. ,
  36678. a.build = function(e) {
  36679. if (this.reset(),
  36680. this.resolved || (this.resolveAll(),
  36681. this.resolved = !0,
  36682. this.result = null),
  36683. null === this.result && (this.result = this.ns.build()),
  36684. !e)
  36685. return this.result;
  36686. for (var t = "string" == typeof e ? e.split(".") : e, i = this.result, n = 0; n < t.length; n++) {
  36687. if (!i[t[n]]) {
  36688. i = null;
  36689. break
  36690. }
  36691. i = i[t[n]]
  36692. }
  36693. return i
  36694. }
  36695. ,
  36696. a.lookup = function(e, t) {
  36697. return e ? this.ns.resolve(e, t) : this.ns
  36698. }
  36699. ,
  36700. a.toString = function() {
  36701. return "Builder"
  36702. }
  36703. ,
  36704. o.Message = function() {}
  36705. ,
  36706. o.Enum = function() {}
  36707. ,
  36708. o.Service = function() {}
  36709. ,
  36710. o
  36711. }(r, r.Lang, r.Reflect),
  36712. r.Map = function(e, t) {
  36713. function i(e) {
  36714. var t = 0;
  36715. return {
  36716. next: function() {
  36717. return t < e.length ? {
  36718. done: !1,
  36719. value: e[t++]
  36720. } : {
  36721. done: !0
  36722. }
  36723. }
  36724. }
  36725. }
  36726. var n = function(e, i) {
  36727. if (!e.map)
  36728. throw Error("field is not a map");
  36729. if (this.field = e,
  36730. this.keyElem = new t.Element(e.keyType,null,!0,e.syntax),
  36731. this.valueElem = new t.Element(e.type,e.resolvedType,!1,e.syntax),
  36732. this.map = {},
  36733. Object.defineProperty(this, "size", {
  36734. get: function() {
  36735. return Object.keys(this.map).length
  36736. }
  36737. }),
  36738. i)
  36739. for (var n = Object.keys(i), r = 0; r < n.length; r++) {
  36740. var o = this.keyElem.valueFromString(n[r])
  36741. , a = this.valueElem.verifyValue(i[n[r]]);
  36742. this.map[this.keyElem.valueToString(o)] = {
  36743. key: o,
  36744. value: a
  36745. }
  36746. }
  36747. }
  36748. , r = n.prototype;
  36749. return r.clear = function() {
  36750. this.map = {}
  36751. }
  36752. ,
  36753. r.delete = function(e) {
  36754. var t = this.keyElem.valueToString(this.keyElem.verifyValue(e))
  36755. , i = t in this.map;
  36756. return delete this.map[t],
  36757. i
  36758. }
  36759. ,
  36760. r.entries = function() {
  36761. for (var e, t = [], n = Object.keys(this.map), r = 0; r < n.length; r++)
  36762. t.push([(e = this.map[n[r]]).key, e.value]);
  36763. return i(t)
  36764. }
  36765. ,
  36766. r.keys = function() {
  36767. for (var e = [], t = Object.keys(this.map), n = 0; n < t.length; n++)
  36768. e.push(this.map[t[n]].key);
  36769. return i(e)
  36770. }
  36771. ,
  36772. r.values = function() {
  36773. for (var e = [], t = Object.keys(this.map), n = 0; n < t.length; n++)
  36774. e.push(this.map[t[n]].value);
  36775. return i(e)
  36776. }
  36777. ,
  36778. r.forEach = function(e, t) {
  36779. for (var i, n = Object.keys(this.map), r = 0; r < n.length; r++)
  36780. e.call(t, (i = this.map[n[r]]).value, i.key, this)
  36781. }
  36782. ,
  36783. r.set = function(e, t) {
  36784. var i = this.keyElem.verifyValue(e)
  36785. , n = this.valueElem.verifyValue(t);
  36786. return this.map[this.keyElem.valueToString(i)] = {
  36787. key: i,
  36788. value: n
  36789. },
  36790. this
  36791. }
  36792. ,
  36793. r.get = function(e) {
  36794. var t = this.keyElem.valueToString(this.keyElem.verifyValue(e));
  36795. if (t in this.map)
  36796. return this.map[t].value
  36797. }
  36798. ,
  36799. r.has = function(e) {
  36800. var t = this.keyElem.valueToString(this.keyElem.verifyValue(e));
  36801. return t in this.map
  36802. }
  36803. ,
  36804. n
  36805. }(r, r.Reflect),
  36806. r.loadProto = function(e, t, i) {
  36807. return ("string" == typeof t || t && "string" == typeof t.file && "string" == typeof t.root) && (i = t,
  36808. t = void 0),
  36809. r.loadJson(r.DotProto.Parser.parse(e), t, i)
  36810. }
  36811. ,
  36812. r.protoFromString = r.loadProto,
  36813. r.loadProtoFile = function(e, t, i) {
  36814. if (t && "object" == typeof t ? (i = t,
  36815. t = null) : t && "function" == typeof t || (t = null),
  36816. t)
  36817. return r.Util.fetch("string" == typeof e ? e : e.root + "/" + e.file, function(n) {
  36818. if (null === n)
  36819. return void t(Error("Failed to fetch file"));
  36820. try {
  36821. t(null, r.loadProto(n, i, e))
  36822. } catch (e) {
  36823. t(e)
  36824. }
  36825. });
  36826. var n = r.Util.fetch("object" == typeof e ? e.root + "/" + e.file : e);
  36827. return null === n ? null : r.loadProto(n, i, e)
  36828. }
  36829. ,
  36830. r.protoFromFile = r.loadProtoFile,
  36831. r.newBuilder = function(e) {
  36832. return e = e || {},
  36833. "undefined" == typeof e.convertFieldsToCamelCase && (e.convertFieldsToCamelCase = r.convertFieldsToCamelCase),
  36834. "undefined" == typeof e.populateAccessors && (e.populateAccessors = r.populateAccessors),
  36835. new r.Builder(e)
  36836. }
  36837. ,
  36838. r.loadJson = function(e, t, i) {
  36839. return ("string" == typeof t || t && "string" == typeof t.file && "string" == typeof t.root) && (i = t,
  36840. t = null),
  36841. t && "object" == typeof t || (t = r.newBuilder()),
  36842. "string" == typeof e && (e = JSON.parse(e)),
  36843. t.import(e, i),
  36844. t.resolveAll(),
  36845. t
  36846. }
  36847. ,
  36848. r.loadJsonFile = function(e, t, i) {
  36849. if (t && "object" == typeof t ? (i = t,
  36850. t = null) : t && "function" == typeof t || (t = null),
  36851. t)
  36852. return r.Util.fetch("string" == typeof e ? e : e.root + "/" + e.file, function(n) {
  36853. if (null === n)
  36854. return void t(Error("Failed to fetch file"));
  36855. try {
  36856. t(null, r.loadJson(JSON.parse(n), i, e))
  36857. } catch (e) {
  36858. t(e)
  36859. }
  36860. });
  36861. var n = r.Util.fetch("object" == typeof e ? e.root + "/" + e.file : e);
  36862. return null === n ? null : r.loadJson(JSON.parse(n), i, e)
  36863. }
  36864. ,
  36865. r
  36866. })
  36867. }
  36868. ).call(this, e("_process"))
  36869. }
  36870. , {
  36871. _process: 203,
  36872. bytebuffer: 215,
  36873. fs: 197,
  36874. path: 197
  36875. }],
  36876. 215: [function(e, t, i) {
  36877. !function(i, n) {
  36878. "function" == typeof define && define.amd ? define(["long"], n) : "function" == typeof e && "object" == typeof t && t && t.exports ? t.exports = function() {
  36879. var t;
  36880. try {
  36881. t = e("long")
  36882. } catch (e) {}
  36883. return n(t)
  36884. }() : (i.dcodeIO = i.dcodeIO || {}).ByteBuffer = n(i.dcodeIO.Long)
  36885. }(this, function(e) {
  36886. "use strict";
  36887. function t(e) {
  36888. var t = 0;
  36889. return function() {
  36890. return t < e.length ? e.charCodeAt(t++) : null
  36891. }
  36892. }
  36893. function i() {
  36894. var e = []
  36895. , t = [];
  36896. return function() {
  36897. return 0 === arguments.length ? t.join("") + l.apply(String, e) : (e.length + arguments.length > 1024 && (t.push(l.apply(String, e)),
  36898. e.length = 0),
  36899. void Array.prototype.push.apply(e, arguments))
  36900. }
  36901. }
  36902. function n(e, t, i, n, r) {
  36903. 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];
  36904. for (u += d,
  36905. o = p & (1 << -h) - 1,
  36906. p >>= -h,
  36907. h += s; h > 0; o = 256 * o + e[t + u],
  36908. u += d,
  36909. h -= 8)
  36910. ;
  36911. for (a = o & (1 << -h) - 1,
  36912. o >>= -h,
  36913. h += n; h > 0; a = 256 * a + e[t + u],
  36914. u += d,
  36915. h -= 8)
  36916. ;
  36917. if (0 === o)
  36918. o = 1 - c;
  36919. else {
  36920. if (o === l)
  36921. return a ? NaN : (p ? -1 : 1) * (1 / 0);
  36922. a += Math.pow(2, n),
  36923. o -= c
  36924. }
  36925. return (p ? -1 : 1) * a * Math.pow(2, o - n)
  36926. }
  36927. function r(e, t, i, n, r, o) {
  36928. 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;
  36929. for (t = Math.abs(t),
  36930. isNaN(t) || t === 1 / 0 ? (s = isNaN(t) ? 1 : 0,
  36931. a = h) : (a = Math.floor(Math.log(t) / Math.LN2),
  36932. t * (l = Math.pow(2, -a)) < 1 && (a--,
  36933. l *= 2),
  36934. t += a + u >= 1 ? d / l : d * Math.pow(2, 1 - u),
  36935. t * l >= 2 && (a++,
  36936. l /= 2),
  36937. a + u >= h ? (s = 0,
  36938. a = h) : a + u >= 1 ? (s = (t * l - 1) * Math.pow(2, r),
  36939. a += u) : (s = t * Math.pow(2, u - 1) * Math.pow(2, r),
  36940. a = 0)); r >= 8; e[i + p] = 255 & s,
  36941. p += f,
  36942. s /= 256,
  36943. r -= 8)
  36944. ;
  36945. for (a = a << r | s,
  36946. c += r; c > 0; e[i + p] = 255 & a,
  36947. p += f,
  36948. a /= 256,
  36949. c -= 8)
  36950. ;
  36951. e[i + p - f] |= 128 * g
  36952. }
  36953. var o = function(e, t, i) {
  36954. if ("undefined" == typeof e && (e = o.DEFAULT_CAPACITY),
  36955. "undefined" == typeof t && (t = o.DEFAULT_ENDIAN),
  36956. "undefined" == typeof i && (i = o.DEFAULT_NOASSERT),
  36957. !i) {
  36958. if (e |= 0,
  36959. e < 0)
  36960. throw RangeError("Illegal capacity");
  36961. t = !!t,
  36962. i = !!i
  36963. }
  36964. this.buffer = 0 === e ? s : new ArrayBuffer(e),
  36965. this.view = 0 === e ? null : new Uint8Array(this.buffer),
  36966. this.offset = 0,
  36967. this.markedOffset = -1,
  36968. this.limit = e,
  36969. this.littleEndian = t,
  36970. this.noAssert = i
  36971. };
  36972. o.VERSION = "5.0.1",
  36973. o.LITTLE_ENDIAN = !0,
  36974. o.BIG_ENDIAN = !1,
  36975. o.DEFAULT_CAPACITY = 16,
  36976. o.DEFAULT_ENDIAN = o.BIG_ENDIAN,
  36977. o.DEFAULT_NOASSERT = !1,
  36978. o.Long = e || null;
  36979. var a = o.prototype;
  36980. a.__isByteBuffer__,
  36981. Object.defineProperty(a, "__isByteBuffer__", {
  36982. value: !0,
  36983. enumerable: !1,
  36984. configurable: !1
  36985. });
  36986. var s = new ArrayBuffer(0)
  36987. , l = String.fromCharCode;
  36988. o.accessor = function() {
  36989. return Uint8Array
  36990. }
  36991. ,
  36992. o.allocate = function(e, t, i) {
  36993. return new o(e,t,i)
  36994. }
  36995. ,
  36996. o.concat = function(e, t, i, n) {
  36997. "boolean" != typeof t && "string" == typeof t || (n = i,
  36998. i = t,
  36999. t = void 0);
  37000. for (var r, a = 0, s = 0, l = e.length; s < l; ++s)
  37001. o.isByteBuffer(e[s]) || (e[s] = o.wrap(e[s], t)),
  37002. r = e[s].limit - e[s].offset,
  37003. r > 0 && (a += r);
  37004. if (0 === a)
  37005. return new o(0,i,n);
  37006. var c, h = new o(a,i,n);
  37007. for (s = 0; s < l; )
  37008. c = e[s++],
  37009. r = c.limit - c.offset,
  37010. r <= 0 || (h.view.set(c.view.subarray(c.offset, c.limit), h.offset),
  37011. h.offset += r);
  37012. return h.limit = h.offset,
  37013. h.offset = 0,
  37014. h
  37015. }
  37016. ,
  37017. o.isByteBuffer = function(e) {
  37018. return (e && e.__isByteBuffer__) === !0
  37019. }
  37020. ,
  37021. o.type = function() {
  37022. return ArrayBuffer
  37023. }
  37024. ,
  37025. o.wrap = function(e, t, i, n) {
  37026. if ("string" != typeof t && (n = i,
  37027. i = t,
  37028. t = void 0),
  37029. "string" == typeof e)
  37030. switch ("undefined" == typeof t && (t = "utf8"),
  37031. t) {
  37032. case "base64":
  37033. return o.fromBase64(e, i);
  37034. case "hex":
  37035. return o.fromHex(e, i);
  37036. case "binary":
  37037. return o.fromBinary(e, i);
  37038. case "utf8":
  37039. return o.fromUTF8(e, i);
  37040. case "debug":
  37041. return o.fromDebug(e, i);
  37042. default:
  37043. throw Error("Unsupported encoding: " + t)
  37044. }
  37045. if (null === e || "object" != typeof e)
  37046. throw TypeError("Illegal buffer");
  37047. var r;
  37048. if (o.isByteBuffer(e))
  37049. return r = a.clone.call(e),
  37050. r.markedOffset = -1,
  37051. r;
  37052. if (e instanceof Uint8Array)
  37053. r = new o(0,i,n),
  37054. e.length > 0 && (r.buffer = e.buffer,
  37055. r.offset = e.byteOffset,
  37056. r.limit = e.byteOffset + e.byteLength,
  37057. r.view = new Uint8Array(e.buffer));
  37058. else if (e instanceof ArrayBuffer)
  37059. r = new o(0,i,n),
  37060. e.byteLength > 0 && (r.buffer = e,
  37061. r.offset = 0,
  37062. r.limit = e.byteLength,
  37063. r.view = e.byteLength > 0 ? new Uint8Array(e) : null);
  37064. else {
  37065. if ("[object Array]" !== Object.prototype.toString.call(e))
  37066. throw TypeError("Illegal buffer");
  37067. r = new o(e.length,i,n),
  37068. r.limit = e.length;
  37069. for (var s = 0; s < e.length; ++s)
  37070. r.view[s] = e[s]
  37071. }
  37072. return r
  37073. }
  37074. ,
  37075. a.writeBitSet = function(e, t) {
  37076. var i = "undefined" == typeof t;
  37077. if (i && (t = this.offset),
  37078. !this.noAssert) {
  37079. if (!(e instanceof Array))
  37080. throw TypeError("Illegal BitSet: Not an array");
  37081. if ("number" != typeof t || t % 1 !== 0)
  37082. throw TypeError("Illegal offset: " + t + " (not an integer)");
  37083. if (t >>>= 0,
  37084. t < 0 || t + 0 > this.buffer.byteLength)
  37085. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  37086. }
  37087. var n, r = t, o = e.length, a = o >> 3, s = 0;
  37088. for (t += this.writeVarint32(o, t); a--; )
  37089. 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,
  37090. this.writeByte(n, t++);
  37091. if (s < o) {
  37092. var l = 0;
  37093. for (n = 0; s < o; )
  37094. n |= (1 & !!e[s++]) << l++;
  37095. this.writeByte(n, t++)
  37096. }
  37097. return i ? (this.offset = t,
  37098. this) : t - r
  37099. }
  37100. ,
  37101. a.readBitSet = function(e) {
  37102. var t = "undefined" == typeof e;
  37103. t && (e = this.offset);
  37104. var i, n = this.readVarint32(e), r = n.value, o = r >> 3, a = 0, s = [];
  37105. for (e += n.length; o--; )
  37106. i = this.readByte(e++),
  37107. s[a++] = !!(1 & i),
  37108. s[a++] = !!(2 & i),
  37109. s[a++] = !!(4 & i),
  37110. s[a++] = !!(8 & i),
  37111. s[a++] = !!(16 & i),
  37112. s[a++] = !!(32 & i),
  37113. s[a++] = !!(64 & i),
  37114. s[a++] = !!(128 & i);
  37115. if (a < r) {
  37116. var l = 0;
  37117. for (i = this.readByte(e++); a < r; )
  37118. s[a++] = !!(i >> l++ & 1)
  37119. }
  37120. return t && (this.offset = e),
  37121. s
  37122. }
  37123. ,
  37124. a.readBytes = function(e, t) {
  37125. var i = "undefined" == typeof t;
  37126. if (i && (t = this.offset),
  37127. !this.noAssert) {
  37128. if ("number" != typeof t || t % 1 !== 0)
  37129. throw TypeError("Illegal offset: " + t + " (not an integer)");
  37130. if (t >>>= 0,
  37131. t < 0 || t + e > this.buffer.byteLength)
  37132. throw RangeError("Illegal offset: 0 <= " + t + " (+" + e + ") <= " + this.buffer.byteLength)
  37133. }
  37134. var n = this.slice(t, t + e);
  37135. return i && (this.offset += e),
  37136. n
  37137. }
  37138. ,
  37139. a.writeBytes = a.append,
  37140. a.writeInt8 = function(e, t) {
  37141. var i = "undefined" == typeof t;
  37142. if (i && (t = this.offset),
  37143. !this.noAssert) {
  37144. if ("number" != typeof e || e % 1 !== 0)
  37145. throw TypeError("Illegal value: " + e + " (not an integer)");
  37146. if (e |= 0,
  37147. "number" != typeof t || t % 1 !== 0)
  37148. throw TypeError("Illegal offset: " + t + " (not an integer)");
  37149. if (t >>>= 0,
  37150. t < 0 || t + 0 > this.buffer.byteLength)
  37151. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  37152. }
  37153. t += 1;
  37154. var n = this.buffer.byteLength;
  37155. return t > n && this.resize((n *= 2) > t ? n : t),
  37156. t -= 1,
  37157. this.view[t] = e,
  37158. i && (this.offset += 1),
  37159. this
  37160. }
  37161. ,
  37162. a.writeByte = a.writeInt8,
  37163. a.readInt8 = function(e) {
  37164. var t = "undefined" == typeof e;
  37165. if (t && (e = this.offset),
  37166. !this.noAssert) {
  37167. if ("number" != typeof e || e % 1 !== 0)
  37168. throw TypeError("Illegal offset: " + e + " (not an integer)");
  37169. if (e >>>= 0,
  37170. e < 0 || e + 1 > this.buffer.byteLength)
  37171. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  37172. }
  37173. var i = this.view[e];
  37174. return 128 === (128 & i) && (i = -(255 - i + 1)),
  37175. t && (this.offset += 1),
  37176. i
  37177. }
  37178. ,
  37179. a.readByte = a.readInt8,
  37180. a.writeUint8 = function(e, t) {
  37181. var i = "undefined" == typeof t;
  37182. if (i && (t = this.offset),
  37183. !this.noAssert) {
  37184. if ("number" != typeof e || e % 1 !== 0)
  37185. throw TypeError("Illegal value: " + e + " (not an integer)");
  37186. if (e >>>= 0,
  37187. "number" != typeof t || t % 1 !== 0)
  37188. throw TypeError("Illegal offset: " + t + " (not an integer)");
  37189. if (t >>>= 0,
  37190. t < 0 || t + 0 > this.buffer.byteLength)
  37191. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  37192. }
  37193. t += 1;
  37194. var n = this.buffer.byteLength;
  37195. return t > n && this.resize((n *= 2) > t ? n : t),
  37196. t -= 1,
  37197. this.view[t] = e,
  37198. i && (this.offset += 1),
  37199. this
  37200. }
  37201. ,
  37202. a.writeUInt8 = a.writeUint8,
  37203. a.readUint8 = function(e) {
  37204. var t = "undefined" == typeof e;
  37205. if (t && (e = this.offset),
  37206. !this.noAssert) {
  37207. if ("number" != typeof e || e % 1 !== 0)
  37208. throw TypeError("Illegal offset: " + e + " (not an integer)");
  37209. if (e >>>= 0,
  37210. e < 0 || e + 1 > this.buffer.byteLength)
  37211. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  37212. }
  37213. var i = this.view[e];
  37214. return t && (this.offset += 1),
  37215. i
  37216. }
  37217. ,
  37218. a.readUInt8 = a.readUint8,
  37219. a.writeInt16 = function(e, t) {
  37220. var i = "undefined" == typeof t;
  37221. if (i && (t = this.offset),
  37222. !this.noAssert) {
  37223. if ("number" != typeof e || e % 1 !== 0)
  37224. throw TypeError("Illegal value: " + e + " (not an integer)");
  37225. if (e |= 0,
  37226. "number" != typeof t || t % 1 !== 0)
  37227. throw TypeError("Illegal offset: " + t + " (not an integer)");
  37228. if (t >>>= 0,
  37229. t < 0 || t + 0 > this.buffer.byteLength)
  37230. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  37231. }
  37232. t += 2;
  37233. var n = this.buffer.byteLength;
  37234. return t > n && this.resize((n *= 2) > t ? n : t),
  37235. t -= 2,
  37236. this.littleEndian ? (this.view[t + 1] = (65280 & e) >>> 8,
  37237. this.view[t] = 255 & e) : (this.view[t] = (65280 & e) >>> 8,
  37238. this.view[t + 1] = 255 & e),
  37239. i && (this.offset += 2),
  37240. this
  37241. }
  37242. ,
  37243. a.writeShort = a.writeInt16,
  37244. a.readInt16 = function(e) {
  37245. var t = "undefined" == typeof e;
  37246. if (t && (e = this.offset),
  37247. !this.noAssert) {
  37248. if ("number" != typeof e || e % 1 !== 0)
  37249. throw TypeError("Illegal offset: " + e + " (not an integer)");
  37250. if (e >>>= 0,
  37251. e < 0 || e + 2 > this.buffer.byteLength)
  37252. throw RangeError("Illegal offset: 0 <= " + e + " (+2) <= " + this.buffer.byteLength)
  37253. }
  37254. var i = 0;
  37255. return this.littleEndian ? (i = this.view[e],
  37256. i |= this.view[e + 1] << 8) : (i = this.view[e] << 8,
  37257. i |= this.view[e + 1]),
  37258. 32768 === (32768 & i) && (i = -(65535 - i + 1)),
  37259. t && (this.offset += 2),
  37260. i
  37261. }
  37262. ,
  37263. a.readShort = a.readInt16,
  37264. a.writeUint16 = function(e, t) {
  37265. var i = "undefined" == typeof t;
  37266. if (i && (t = this.offset),
  37267. !this.noAssert) {
  37268. if ("number" != typeof e || e % 1 !== 0)
  37269. throw TypeError("Illegal value: " + e + " (not an integer)");
  37270. if (e >>>= 0,
  37271. "number" != typeof t || t % 1 !== 0)
  37272. throw TypeError("Illegal offset: " + t + " (not an integer)");
  37273. if (t >>>= 0,
  37274. t < 0 || t + 0 > this.buffer.byteLength)
  37275. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  37276. }
  37277. t += 2;
  37278. var n = this.buffer.byteLength;
  37279. return t > n && this.resize((n *= 2) > t ? n : t),
  37280. t -= 2,
  37281. this.littleEndian ? (this.view[t + 1] = (65280 & e) >>> 8,
  37282. this.view[t] = 255 & e) : (this.view[t] = (65280 & e) >>> 8,
  37283. this.view[t + 1] = 255 & e),
  37284. i && (this.offset += 2),
  37285. this
  37286. }
  37287. ,
  37288. a.writeUInt16 = a.writeUint16,
  37289. a.readUint16 = function(e) {
  37290. var t = "undefined" == typeof e;
  37291. if (t && (e = this.offset),
  37292. !this.noAssert) {
  37293. if ("number" != typeof e || e % 1 !== 0)
  37294. throw TypeError("Illegal offset: " + e + " (not an integer)");
  37295. if (e >>>= 0,
  37296. e < 0 || e + 2 > this.buffer.byteLength)
  37297. throw RangeError("Illegal offset: 0 <= " + e + " (+2) <= " + this.buffer.byteLength)
  37298. }
  37299. var i = 0;
  37300. return this.littleEndian ? (i = this.view[e],
  37301. i |= this.view[e + 1] << 8) : (i = this.view[e] << 8,
  37302. i |= this.view[e + 1]),
  37303. t && (this.offset += 2),
  37304. i
  37305. }
  37306. ,
  37307. a.readUInt16 = a.readUint16,
  37308. a.writeInt32 = function(e, t) {
  37309. var i = "undefined" == typeof t;
  37310. if (i && (t = this.offset),
  37311. !this.noAssert) {
  37312. if ("number" != typeof e || e % 1 !== 0)
  37313. throw TypeError("Illegal value: " + e + " (not an integer)");
  37314. if (e |= 0,
  37315. "number" != typeof t || t % 1 !== 0)
  37316. throw TypeError("Illegal offset: " + t + " (not an integer)");
  37317. if (t >>>= 0,
  37318. t < 0 || t + 0 > this.buffer.byteLength)
  37319. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  37320. }
  37321. t += 4;
  37322. var n = this.buffer.byteLength;
  37323. return t > n && this.resize((n *= 2) > t ? n : t),
  37324. t -= 4,
  37325. this.littleEndian ? (this.view[t + 3] = e >>> 24 & 255,
  37326. this.view[t + 2] = e >>> 16 & 255,
  37327. this.view[t + 1] = e >>> 8 & 255,
  37328. this.view[t] = 255 & e) : (this.view[t] = e >>> 24 & 255,
  37329. this.view[t + 1] = e >>> 16 & 255,
  37330. this.view[t + 2] = e >>> 8 & 255,
  37331. this.view[t + 3] = 255 & e),
  37332. i && (this.offset += 4),
  37333. this
  37334. }
  37335. ,
  37336. a.writeInt = a.writeInt32,
  37337. a.readInt32 = function(e) {
  37338. var t = "undefined" == typeof e;
  37339. if (t && (e = this.offset),
  37340. !this.noAssert) {
  37341. if ("number" != typeof e || e % 1 !== 0)
  37342. throw TypeError("Illegal offset: " + e + " (not an integer)");
  37343. if (e >>>= 0,
  37344. e < 0 || e + 4 > this.buffer.byteLength)
  37345. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  37346. }
  37347. var i = 0;
  37348. return this.littleEndian ? (i = this.view[e + 2] << 16,
  37349. i |= this.view[e + 1] << 8,
  37350. i |= this.view[e],
  37351. i += this.view[e + 3] << 24 >>> 0) : (i = this.view[e + 1] << 16,
  37352. i |= this.view[e + 2] << 8,
  37353. i |= this.view[e + 3],
  37354. i += this.view[e] << 24 >>> 0),
  37355. i |= 0,
  37356. t && (this.offset += 4),
  37357. i
  37358. }
  37359. ,
  37360. a.readInt = a.readInt32,
  37361. a.writeUint32 = function(e, t) {
  37362. var i = "undefined" == typeof t;
  37363. if (i && (t = this.offset),
  37364. !this.noAssert) {
  37365. if ("number" != typeof e || e % 1 !== 0)
  37366. throw TypeError("Illegal value: " + e + " (not an integer)");
  37367. if (e >>>= 0,
  37368. "number" != typeof t || t % 1 !== 0)
  37369. throw TypeError("Illegal offset: " + t + " (not an integer)");
  37370. if (t >>>= 0,
  37371. t < 0 || t + 0 > this.buffer.byteLength)
  37372. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  37373. }
  37374. t += 4;
  37375. var n = this.buffer.byteLength;
  37376. return t > n && this.resize((n *= 2) > t ? n : t),
  37377. t -= 4,
  37378. this.littleEndian ? (this.view[t + 3] = e >>> 24 & 255,
  37379. this.view[t + 2] = e >>> 16 & 255,
  37380. this.view[t + 1] = e >>> 8 & 255,
  37381. this.view[t] = 255 & e) : (this.view[t] = e >>> 24 & 255,
  37382. this.view[t + 1] = e >>> 16 & 255,
  37383. this.view[t + 2] = e >>> 8 & 255,
  37384. this.view[t + 3] = 255 & e),
  37385. i && (this.offset += 4),
  37386. this
  37387. }
  37388. ,
  37389. a.writeUInt32 = a.writeUint32,
  37390. a.readUint32 = function(e) {
  37391. var t = "undefined" == typeof e;
  37392. if (t && (e = this.offset),
  37393. !this.noAssert) {
  37394. if ("number" != typeof e || e % 1 !== 0)
  37395. throw TypeError("Illegal offset: " + e + " (not an integer)");
  37396. if (e >>>= 0,
  37397. e < 0 || e + 4 > this.buffer.byteLength)
  37398. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  37399. }
  37400. var i = 0;
  37401. return this.littleEndian ? (i = this.view[e + 2] << 16,
  37402. i |= this.view[e + 1] << 8,
  37403. i |= this.view[e],
  37404. i += this.view[e + 3] << 24 >>> 0) : (i = this.view[e + 1] << 16,
  37405. i |= this.view[e + 2] << 8,
  37406. i |= this.view[e + 3],
  37407. i += this.view[e] << 24 >>> 0),
  37408. t && (this.offset += 4),
  37409. i
  37410. }
  37411. ,
  37412. a.readUInt32 = a.readUint32,
  37413. e && (a.writeInt64 = function(t, i) {
  37414. var n = "undefined" == typeof i;
  37415. if (n && (i = this.offset),
  37416. !this.noAssert) {
  37417. if ("number" == typeof t)
  37418. t = e.fromNumber(t);
  37419. else if ("string" == typeof t)
  37420. t = e.fromString(t);
  37421. else if (!(t && t instanceof e))
  37422. throw TypeError("Illegal value: " + t + " (not an integer or Long)");
  37423. if ("number" != typeof i || i % 1 !== 0)
  37424. throw TypeError("Illegal offset: " + i + " (not an integer)");
  37425. if (i >>>= 0,
  37426. i < 0 || i + 0 > this.buffer.byteLength)
  37427. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  37428. }
  37429. "number" == typeof t ? t = e.fromNumber(t) : "string" == typeof t && (t = e.fromString(t)),
  37430. i += 8;
  37431. var r = this.buffer.byteLength;
  37432. i > r && this.resize((r *= 2) > i ? r : i),
  37433. i -= 8;
  37434. var o = t.low
  37435. , a = t.high;
  37436. return this.littleEndian ? (this.view[i + 3] = o >>> 24 & 255,
  37437. this.view[i + 2] = o >>> 16 & 255,
  37438. this.view[i + 1] = o >>> 8 & 255,
  37439. this.view[i] = 255 & o,
  37440. i += 4,
  37441. this.view[i + 3] = a >>> 24 & 255,
  37442. this.view[i + 2] = a >>> 16 & 255,
  37443. this.view[i + 1] = a >>> 8 & 255,
  37444. this.view[i] = 255 & a) : (this.view[i] = a >>> 24 & 255,
  37445. this.view[i + 1] = a >>> 16 & 255,
  37446. this.view[i + 2] = a >>> 8 & 255,
  37447. this.view[i + 3] = 255 & a,
  37448. i += 4,
  37449. this.view[i] = o >>> 24 & 255,
  37450. this.view[i + 1] = o >>> 16 & 255,
  37451. this.view[i + 2] = o >>> 8 & 255,
  37452. this.view[i + 3] = 255 & o),
  37453. n && (this.offset += 8),
  37454. this
  37455. }
  37456. ,
  37457. a.writeLong = a.writeInt64,
  37458. a.readInt64 = function(t) {
  37459. var i = "undefined" == typeof t;
  37460. if (i && (t = this.offset),
  37461. !this.noAssert) {
  37462. if ("number" != typeof t || t % 1 !== 0)
  37463. throw TypeError("Illegal offset: " + t + " (not an integer)");
  37464. if (t >>>= 0,
  37465. t < 0 || t + 8 > this.buffer.byteLength)
  37466. throw RangeError("Illegal offset: 0 <= " + t + " (+8) <= " + this.buffer.byteLength)
  37467. }
  37468. var n = 0
  37469. , r = 0;
  37470. this.littleEndian ? (n = this.view[t + 2] << 16,
  37471. n |= this.view[t + 1] << 8,
  37472. n |= this.view[t],
  37473. n += this.view[t + 3] << 24 >>> 0,
  37474. t += 4,
  37475. r = this.view[t + 2] << 16,
  37476. r |= this.view[t + 1] << 8,
  37477. r |= this.view[t],
  37478. r += this.view[t + 3] << 24 >>> 0) : (r = this.view[t + 1] << 16,
  37479. r |= this.view[t + 2] << 8,
  37480. r |= this.view[t + 3],
  37481. r += this.view[t] << 24 >>> 0,
  37482. t += 4,
  37483. n = this.view[t + 1] << 16,
  37484. n |= this.view[t + 2] << 8,
  37485. n |= this.view[t + 3],
  37486. n += this.view[t] << 24 >>> 0);
  37487. var o = new e(n,r,!1);
  37488. return i && (this.offset += 8),
  37489. o
  37490. }
  37491. ,
  37492. a.readLong = a.readInt64,
  37493. a.writeUint64 = function(t, i) {
  37494. var n = "undefined" == typeof i;
  37495. if (n && (i = this.offset),
  37496. !this.noAssert) {
  37497. if ("number" == typeof t)
  37498. t = e.fromNumber(t);
  37499. else if ("string" == typeof t)
  37500. t = e.fromString(t);
  37501. else if (!(t && t instanceof e))
  37502. throw TypeError("Illegal value: " + t + " (not an integer or Long)");
  37503. if ("number" != typeof i || i % 1 !== 0)
  37504. throw TypeError("Illegal offset: " + i + " (not an integer)");
  37505. if (i >>>= 0,
  37506. i < 0 || i + 0 > this.buffer.byteLength)
  37507. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  37508. }
  37509. "number" == typeof t ? t = e.fromNumber(t) : "string" == typeof t && (t = e.fromString(t)),
  37510. i += 8;
  37511. var r = this.buffer.byteLength;
  37512. i > r && this.resize((r *= 2) > i ? r : i),
  37513. i -= 8;
  37514. var o = t.low
  37515. , a = t.high;
  37516. return this.littleEndian ? (this.view[i + 3] = o >>> 24 & 255,
  37517. this.view[i + 2] = o >>> 16 & 255,
  37518. this.view[i + 1] = o >>> 8 & 255,
  37519. this.view[i] = 255 & o,
  37520. i += 4,
  37521. this.view[i + 3] = a >>> 24 & 255,
  37522. this.view[i + 2] = a >>> 16 & 255,
  37523. this.view[i + 1] = a >>> 8 & 255,
  37524. this.view[i] = 255 & a) : (this.view[i] = a >>> 24 & 255,
  37525. this.view[i + 1] = a >>> 16 & 255,
  37526. this.view[i + 2] = a >>> 8 & 255,
  37527. this.view[i + 3] = 255 & a,
  37528. i += 4,
  37529. this.view[i] = o >>> 24 & 255,
  37530. this.view[i + 1] = o >>> 16 & 255,
  37531. this.view[i + 2] = o >>> 8 & 255,
  37532. this.view[i + 3] = 255 & o),
  37533. n && (this.offset += 8),
  37534. this
  37535. }
  37536. ,
  37537. a.writeUInt64 = a.writeUint64,
  37538. a.readUint64 = function(t) {
  37539. var i = "undefined" == typeof t;
  37540. if (i && (t = this.offset),
  37541. !this.noAssert) {
  37542. if ("number" != typeof t || t % 1 !== 0)
  37543. throw TypeError("Illegal offset: " + t + " (not an integer)");
  37544. if (t >>>= 0,
  37545. t < 0 || t + 8 > this.buffer.byteLength)
  37546. throw RangeError("Illegal offset: 0 <= " + t + " (+8) <= " + this.buffer.byteLength)
  37547. }
  37548. var n = 0
  37549. , r = 0;
  37550. this.littleEndian ? (n = this.view[t + 2] << 16,
  37551. n |= this.view[t + 1] << 8,
  37552. n |= this.view[t],
  37553. n += this.view[t + 3] << 24 >>> 0,
  37554. t += 4,
  37555. r = this.view[t + 2] << 16,
  37556. r |= this.view[t + 1] << 8,
  37557. r |= this.view[t],
  37558. r += this.view[t + 3] << 24 >>> 0) : (r = this.view[t + 1] << 16,
  37559. r |= this.view[t + 2] << 8,
  37560. r |= this.view[t + 3],
  37561. r += this.view[t] << 24 >>> 0,
  37562. t += 4,
  37563. n = this.view[t + 1] << 16,
  37564. n |= this.view[t + 2] << 8,
  37565. n |= this.view[t + 3],
  37566. n += this.view[t] << 24 >>> 0);
  37567. var o = new e(n,r,!0);
  37568. return i && (this.offset += 8),
  37569. o
  37570. }
  37571. ,
  37572. a.readUInt64 = a.readUint64),
  37573. a.writeFloat32 = function(e, t) {
  37574. var i = "undefined" == typeof t;
  37575. if (i && (t = this.offset),
  37576. !this.noAssert) {
  37577. if ("number" != typeof e)
  37578. throw TypeError("Illegal value: " + e + " (not a number)");
  37579. if ("number" != typeof t || t % 1 !== 0)
  37580. throw TypeError("Illegal offset: " + t + " (not an integer)");
  37581. if (t >>>= 0,
  37582. t < 0 || t + 0 > this.buffer.byteLength)
  37583. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  37584. }
  37585. t += 4;
  37586. var n = this.buffer.byteLength;
  37587. return t > n && this.resize((n *= 2) > t ? n : t),
  37588. t -= 4,
  37589. r(this.view, e, t, this.littleEndian, 23, 4),
  37590. i && (this.offset += 4),
  37591. this
  37592. }
  37593. ,
  37594. a.writeFloat = a.writeFloat32,
  37595. a.readFloat32 = function(e) {
  37596. var t = "undefined" == typeof e;
  37597. if (t && (e = this.offset),
  37598. !this.noAssert) {
  37599. if ("number" != typeof e || e % 1 !== 0)
  37600. throw TypeError("Illegal offset: " + e + " (not an integer)");
  37601. if (e >>>= 0,
  37602. e < 0 || e + 4 > this.buffer.byteLength)
  37603. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  37604. }
  37605. var i = n(this.view, e, this.littleEndian, 23, 4);
  37606. return t && (this.offset += 4),
  37607. i
  37608. }
  37609. ,
  37610. a.readFloat = a.readFloat32,
  37611. a.writeFloat64 = function(e, t) {
  37612. var i = "undefined" == typeof t;
  37613. if (i && (t = this.offset),
  37614. !this.noAssert) {
  37615. if ("number" != typeof e)
  37616. throw TypeError("Illegal value: " + e + " (not a number)");
  37617. if ("number" != typeof t || t % 1 !== 0)
  37618. throw TypeError("Illegal offset: " + t + " (not an integer)");
  37619. if (t >>>= 0,
  37620. t < 0 || t + 0 > this.buffer.byteLength)
  37621. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  37622. }
  37623. t += 8;
  37624. var n = this.buffer.byteLength;
  37625. return t > n && this.resize((n *= 2) > t ? n : t),
  37626. t -= 8,
  37627. r(this.view, e, t, this.littleEndian, 52, 8),
  37628. i && (this.offset += 8),
  37629. this
  37630. }
  37631. ,
  37632. a.writeDouble = a.writeFloat64,
  37633. a.readFloat64 = function(e) {
  37634. var t = "undefined" == typeof e;
  37635. if (t && (e = this.offset),
  37636. !this.noAssert) {
  37637. if ("number" != typeof e || e % 1 !== 0)
  37638. throw TypeError("Illegal offset: " + e + " (not an integer)");
  37639. if (e >>>= 0,
  37640. e < 0 || e + 8 > this.buffer.byteLength)
  37641. throw RangeError("Illegal offset: 0 <= " + e + " (+8) <= " + this.buffer.byteLength)
  37642. }
  37643. var i = n(this.view, e, this.littleEndian, 52, 8);
  37644. return t && (this.offset += 8),
  37645. i
  37646. }
  37647. ,
  37648. a.readDouble = a.readFloat64,
  37649. o.MAX_VARINT32_BYTES = 5,
  37650. o.calculateVarint32 = function(e) {
  37651. return e >>>= 0,
  37652. e < 128 ? 1 : e < 16384 ? 2 : e < 1 << 21 ? 3 : e < 1 << 28 ? 4 : 5
  37653. }
  37654. ,
  37655. o.zigZagEncode32 = function(e) {
  37656. return ((e |= 0) << 1 ^ e >> 31) >>> 0
  37657. }
  37658. ,
  37659. o.zigZagDecode32 = function(e) {
  37660. return e >>> 1 ^ -(1 & e) | 0
  37661. }
  37662. ,
  37663. a.writeVarint32 = function(e, t) {
  37664. var i = "undefined" == typeof t;
  37665. if (i && (t = this.offset),
  37666. !this.noAssert) {
  37667. if ("number" != typeof e || e % 1 !== 0)
  37668. throw TypeError("Illegal value: " + e + " (not an integer)");
  37669. if (e |= 0,
  37670. "number" != typeof t || t % 1 !== 0)
  37671. throw TypeError("Illegal offset: " + t + " (not an integer)");
  37672. if (t >>>= 0,
  37673. t < 0 || t + 0 > this.buffer.byteLength)
  37674. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  37675. }
  37676. var n, r = o.calculateVarint32(e);
  37677. t += r;
  37678. var a = this.buffer.byteLength;
  37679. for (t > a && this.resize((a *= 2) > t ? a : t),
  37680. t -= r,
  37681. e >>>= 0; e >= 128; )
  37682. n = 127 & e | 128,
  37683. this.view[t++] = n,
  37684. e >>>= 7;
  37685. return this.view[t++] = e,
  37686. i ? (this.offset = t,
  37687. this) : r
  37688. }
  37689. ,
  37690. a.writeVarint32ZigZag = function(e, t) {
  37691. return this.writeVarint32(o.zigZagEncode32(e), t)
  37692. }
  37693. ,
  37694. a.readVarint32 = function(e) {
  37695. var t = "undefined" == typeof e;
  37696. if (t && (e = this.offset),
  37697. !this.noAssert) {
  37698. if ("number" != typeof e || e % 1 !== 0)
  37699. throw TypeError("Illegal offset: " + e + " (not an integer)");
  37700. if (e >>>= 0,
  37701. e < 0 || e + 1 > this.buffer.byteLength)
  37702. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  37703. }
  37704. var i, n = 0, r = 0;
  37705. do {
  37706. if (!this.noAssert && e > this.limit) {
  37707. var o = Error("Truncated");
  37708. throw o.truncated = !0,
  37709. o
  37710. }
  37711. i = this.view[e++],
  37712. n < 5 && (r |= (127 & i) << 7 * n),
  37713. ++n
  37714. } while (0 !== (128 & i));return r |= 0,
  37715. t ? (this.offset = e,
  37716. r) : {
  37717. value: r,
  37718. length: n
  37719. }
  37720. }
  37721. ,
  37722. a.readVarint32ZigZag = function(e) {
  37723. var t = this.readVarint32(e);
  37724. return "object" == typeof t ? t.value = o.zigZagDecode32(t.value) : t = o.zigZagDecode32(t),
  37725. t
  37726. }
  37727. ,
  37728. e && (o.MAX_VARINT64_BYTES = 10,
  37729. o.calculateVarint64 = function(t) {
  37730. "number" == typeof t ? t = e.fromNumber(t) : "string" == typeof t && (t = e.fromString(t));
  37731. var i = t.toInt() >>> 0
  37732. , n = t.shiftRightUnsigned(28).toInt() >>> 0
  37733. , r = t.shiftRightUnsigned(56).toInt() >>> 0;
  37734. 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
  37735. }
  37736. ,
  37737. o.zigZagEncode64 = function(t) {
  37738. return "number" == typeof t ? t = e.fromNumber(t, !1) : "string" == typeof t ? t = e.fromString(t, !1) : t.unsigned !== !1 && (t = t.toSigned()),
  37739. t.shiftLeft(1).xor(t.shiftRight(63)).toUnsigned()
  37740. }
  37741. ,
  37742. o.zigZagDecode64 = function(t) {
  37743. return "number" == typeof t ? t = e.fromNumber(t, !1) : "string" == typeof t ? t = e.fromString(t, !1) : t.unsigned !== !1 && (t = t.toSigned()),
  37744. t.shiftRightUnsigned(1).xor(t.and(e.ONE).toSigned().negate()).toSigned()
  37745. }
  37746. ,
  37747. a.writeVarint64 = function(t, i) {
  37748. var n = "undefined" == typeof i;
  37749. if (n && (i = this.offset),
  37750. !this.noAssert) {
  37751. if ("number" == typeof t)
  37752. t = e.fromNumber(t);
  37753. else if ("string" == typeof t)
  37754. t = e.fromString(t);
  37755. else if (!(t && t instanceof e))
  37756. throw TypeError("Illegal value: " + t + " (not an integer or Long)");
  37757. if ("number" != typeof i || i % 1 !== 0)
  37758. throw TypeError("Illegal offset: " + i + " (not an integer)");
  37759. if (i >>>= 0,
  37760. i < 0 || i + 0 > this.buffer.byteLength)
  37761. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  37762. }
  37763. "number" == typeof t ? t = e.fromNumber(t, !1) : "string" == typeof t ? t = e.fromString(t, !1) : t.unsigned !== !1 && (t = t.toSigned());
  37764. var r = o.calculateVarint64(t)
  37765. , a = t.toInt() >>> 0
  37766. , s = t.shiftRightUnsigned(28).toInt() >>> 0
  37767. , l = t.shiftRightUnsigned(56).toInt() >>> 0;
  37768. i += r;
  37769. var c = this.buffer.byteLength;
  37770. switch (i > c && this.resize((c *= 2) > i ? c : i),
  37771. i -= r,
  37772. r) {
  37773. case 10:
  37774. this.view[i + 9] = l >>> 7 & 1;
  37775. case 9:
  37776. this.view[i + 8] = 9 !== r ? 128 | l : 127 & l;
  37777. case 8:
  37778. this.view[i + 7] = 8 !== r ? s >>> 21 | 128 : s >>> 21 & 127;
  37779. case 7:
  37780. this.view[i + 6] = 7 !== r ? s >>> 14 | 128 : s >>> 14 & 127;
  37781. case 6:
  37782. this.view[i + 5] = 6 !== r ? s >>> 7 | 128 : s >>> 7 & 127;
  37783. case 5:
  37784. this.view[i + 4] = 5 !== r ? 128 | s : 127 & s;
  37785. case 4:
  37786. this.view[i + 3] = 4 !== r ? a >>> 21 | 128 : a >>> 21 & 127;
  37787. case 3:
  37788. this.view[i + 2] = 3 !== r ? a >>> 14 | 128 : a >>> 14 & 127;
  37789. case 2:
  37790. this.view[i + 1] = 2 !== r ? a >>> 7 | 128 : a >>> 7 & 127;
  37791. case 1:
  37792. this.view[i] = 1 !== r ? 128 | a : 127 & a
  37793. }
  37794. return n ? (this.offset += r,
  37795. this) : r
  37796. }
  37797. ,
  37798. a.writeVarint64ZigZag = function(e, t) {
  37799. return this.writeVarint64(o.zigZagEncode64(e), t)
  37800. }
  37801. ,
  37802. a.readVarint64 = function(t) {
  37803. var i = "undefined" == typeof t;
  37804. if (i && (t = this.offset),
  37805. !this.noAssert) {
  37806. if ("number" != typeof t || t % 1 !== 0)
  37807. throw TypeError("Illegal offset: " + t + " (not an integer)");
  37808. if (t >>>= 0,
  37809. t < 0 || t + 1 > this.buffer.byteLength)
  37810. throw RangeError("Illegal offset: 0 <= " + t + " (+1) <= " + this.buffer.byteLength)
  37811. }
  37812. var n = t
  37813. , r = 0
  37814. , o = 0
  37815. , a = 0
  37816. , s = 0;
  37817. if (s = this.view[t++],
  37818. r = 127 & s,
  37819. 128 & s && (s = this.view[t++],
  37820. r |= (127 & s) << 7,
  37821. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  37822. r |= (127 & s) << 14,
  37823. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  37824. r |= (127 & s) << 21,
  37825. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  37826. o = 127 & s,
  37827. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  37828. o |= (127 & s) << 7,
  37829. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  37830. o |= (127 & s) << 14,
  37831. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  37832. o |= (127 & s) << 21,
  37833. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  37834. a = 127 & s,
  37835. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  37836. a |= (127 & s) << 7,
  37837. 128 & s || this.noAssert && "undefined" == typeof s))))))))))
  37838. throw Error("Buffer overrun");
  37839. var l = e.fromBits(r | o << 28, o >>> 4 | a << 24, !1);
  37840. return i ? (this.offset = t,
  37841. l) : {
  37842. value: l,
  37843. length: t - n
  37844. }
  37845. }
  37846. ,
  37847. a.readVarint64ZigZag = function(t) {
  37848. var i = this.readVarint64(t);
  37849. return i && i.value instanceof e ? i.value = o.zigZagDecode64(i.value) : i = o.zigZagDecode64(i),
  37850. i
  37851. }
  37852. ),
  37853. a.writeCString = function(e, i) {
  37854. var n = "undefined" == typeof i;
  37855. n && (i = this.offset);
  37856. var r, o = e.length;
  37857. if (!this.noAssert) {
  37858. if ("string" != typeof e)
  37859. throw TypeError("Illegal str: Not a string");
  37860. for (r = 0; r < o; ++r)
  37861. if (0 === e.charCodeAt(r))
  37862. throw RangeError("Illegal str: Contains NULL-characters");
  37863. if ("number" != typeof i || i % 1 !== 0)
  37864. throw TypeError("Illegal offset: " + i + " (not an integer)");
  37865. if (i >>>= 0,
  37866. i < 0 || i + 0 > this.buffer.byteLength)
  37867. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  37868. }
  37869. o = h.calculateUTF16asUTF8(t(e))[1],
  37870. i += o + 1;
  37871. var a = this.buffer.byteLength;
  37872. return i > a && this.resize((a *= 2) > i ? a : i),
  37873. i -= o + 1,
  37874. h.encodeUTF16toUTF8(t(e), function(e) {
  37875. this.view[i++] = e
  37876. }
  37877. .bind(this)),
  37878. this.view[i++] = 0,
  37879. n ? (this.offset = i,
  37880. this) : o
  37881. }
  37882. ,
  37883. a.readCString = function(e) {
  37884. var t = "undefined" == typeof e;
  37885. if (t && (e = this.offset),
  37886. !this.noAssert) {
  37887. if ("number" != typeof e || e % 1 !== 0)
  37888. throw TypeError("Illegal offset: " + e + " (not an integer)");
  37889. if (e >>>= 0,
  37890. e < 0 || e + 1 > this.buffer.byteLength)
  37891. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  37892. }
  37893. var n, r = e, o = -1;
  37894. return h.decodeUTF8toUTF16(function() {
  37895. if (0 === o)
  37896. return null;
  37897. if (e >= this.limit)
  37898. throw RangeError("Illegal range: Truncated data, " + e + " < " + this.limit);
  37899. return o = this.view[e++],
  37900. 0 === o ? null : o
  37901. }
  37902. .bind(this), n = i(), !0),
  37903. t ? (this.offset = e,
  37904. n()) : {
  37905. string: n(),
  37906. length: e - r
  37907. }
  37908. }
  37909. ,
  37910. a.writeIString = function(e, i) {
  37911. var n = "undefined" == typeof i;
  37912. if (n && (i = this.offset),
  37913. !this.noAssert) {
  37914. if ("string" != typeof e)
  37915. throw TypeError("Illegal str: Not a string");
  37916. if ("number" != typeof i || i % 1 !== 0)
  37917. throw TypeError("Illegal offset: " + i + " (not an integer)");
  37918. if (i >>>= 0,
  37919. i < 0 || i + 0 > this.buffer.byteLength)
  37920. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  37921. }
  37922. var r, o = i;
  37923. r = h.calculateUTF16asUTF8(t(e), this.noAssert)[1],
  37924. i += 4 + r;
  37925. var a = this.buffer.byteLength;
  37926. if (i > a && this.resize((a *= 2) > i ? a : i),
  37927. i -= 4 + r,
  37928. this.littleEndian ? (this.view[i + 3] = r >>> 24 & 255,
  37929. this.view[i + 2] = r >>> 16 & 255,
  37930. this.view[i + 1] = r >>> 8 & 255,
  37931. this.view[i] = 255 & r) : (this.view[i] = r >>> 24 & 255,
  37932. this.view[i + 1] = r >>> 16 & 255,
  37933. this.view[i + 2] = r >>> 8 & 255,
  37934. this.view[i + 3] = 255 & r),
  37935. i += 4,
  37936. h.encodeUTF16toUTF8(t(e), function(e) {
  37937. this.view[i++] = e
  37938. }
  37939. .bind(this)),
  37940. i !== o + 4 + r)
  37941. throw RangeError("Illegal range: Truncated data, " + i + " == " + (i + 4 + r));
  37942. return n ? (this.offset = i,
  37943. this) : i - o
  37944. }
  37945. ,
  37946. a.readIString = function(e) {
  37947. var t = "undefined" == typeof e;
  37948. if (t && (e = this.offset),
  37949. !this.noAssert) {
  37950. if ("number" != typeof e || e % 1 !== 0)
  37951. throw TypeError("Illegal offset: " + e + " (not an integer)");
  37952. if (e >>>= 0,
  37953. e < 0 || e + 4 > this.buffer.byteLength)
  37954. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  37955. }
  37956. var i = e
  37957. , n = this.readUint32(e)
  37958. , r = this.readUTF8String(n, o.METRICS_BYTES, e += 4);
  37959. return e += r.length,
  37960. t ? (this.offset = e,
  37961. r.string) : {
  37962. string: r.string,
  37963. length: e - i
  37964. }
  37965. }
  37966. ,
  37967. o.METRICS_CHARS = "c",
  37968. o.METRICS_BYTES = "b",
  37969. a.writeUTF8String = function(e, i) {
  37970. var n = "undefined" == typeof i;
  37971. if (n && (i = this.offset),
  37972. !this.noAssert) {
  37973. if ("number" != typeof i || i % 1 !== 0)
  37974. throw TypeError("Illegal offset: " + i + " (not an integer)");
  37975. if (i >>>= 0,
  37976. i < 0 || i + 0 > this.buffer.byteLength)
  37977. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  37978. }
  37979. var r, o = i;
  37980. r = h.calculateUTF16asUTF8(t(e))[1],
  37981. i += r;
  37982. var a = this.buffer.byteLength;
  37983. return i > a && this.resize((a *= 2) > i ? a : i),
  37984. i -= r,
  37985. h.encodeUTF16toUTF8(t(e), function(e) {
  37986. this.view[i++] = e
  37987. }
  37988. .bind(this)),
  37989. n ? (this.offset = i,
  37990. this) : i - o
  37991. }
  37992. ,
  37993. a.writeString = a.writeUTF8String,
  37994. o.calculateUTF8Chars = function(e) {
  37995. return h.calculateUTF16asUTF8(t(e))[0]
  37996. }
  37997. ,
  37998. o.calculateUTF8Bytes = function(e) {
  37999. return h.calculateUTF16asUTF8(t(e))[1]
  38000. }
  38001. ,
  38002. o.calculateString = o.calculateUTF8Bytes,
  38003. a.readUTF8String = function(e, t, n) {
  38004. "number" == typeof t && (n = t,
  38005. t = void 0);
  38006. var r = "undefined" == typeof n;
  38007. if (r && (n = this.offset),
  38008. "undefined" == typeof t && (t = o.METRICS_CHARS),
  38009. !this.noAssert) {
  38010. if ("number" != typeof e || e % 1 !== 0)
  38011. throw TypeError("Illegal length: " + e + " (not an integer)");
  38012. if (e |= 0,
  38013. "number" != typeof n || n % 1 !== 0)
  38014. throw TypeError("Illegal offset: " + n + " (not an integer)");
  38015. if (n >>>= 0,
  38016. n < 0 || n + 0 > this.buffer.byteLength)
  38017. throw RangeError("Illegal offset: 0 <= " + n + " (+0) <= " + this.buffer.byteLength)
  38018. }
  38019. var a, s = 0, l = n;
  38020. if (t === o.METRICS_CHARS) {
  38021. if (a = i(),
  38022. h.decodeUTF8(function() {
  38023. return s < e && n < this.limit ? this.view[n++] : null
  38024. }
  38025. .bind(this), function(e) {
  38026. ++s,
  38027. h.UTF8toUTF16(e, a)
  38028. }),
  38029. s !== e)
  38030. throw RangeError("Illegal range: Truncated data, " + s + " == " + e);
  38031. return r ? (this.offset = n,
  38032. a()) : {
  38033. string: a(),
  38034. length: n - l
  38035. }
  38036. }
  38037. if (t === o.METRICS_BYTES) {
  38038. if (!this.noAssert) {
  38039. if ("number" != typeof n || n % 1 !== 0)
  38040. throw TypeError("Illegal offset: " + n + " (not an integer)");
  38041. if (n >>>= 0,
  38042. n < 0 || n + e > this.buffer.byteLength)
  38043. throw RangeError("Illegal offset: 0 <= " + n + " (+" + e + ") <= " + this.buffer.byteLength)
  38044. }
  38045. var c = n + e;
  38046. if (h.decodeUTF8toUTF16(function() {
  38047. return n < c ? this.view[n++] : null
  38048. }
  38049. .bind(this), a = i(), this.noAssert),
  38050. n !== c)
  38051. throw RangeError("Illegal range: Truncated data, " + n + " == " + c);
  38052. return r ? (this.offset = n,
  38053. a()) : {
  38054. string: a(),
  38055. length: n - l
  38056. }
  38057. }
  38058. throw TypeError("Unsupported metrics: " + t)
  38059. }
  38060. ,
  38061. a.readString = a.readUTF8String,
  38062. a.writeVString = function(e, i) {
  38063. var n = "undefined" == typeof i;
  38064. if (n && (i = this.offset),
  38065. !this.noAssert) {
  38066. if ("string" != typeof e)
  38067. throw TypeError("Illegal str: Not a string");
  38068. if ("number" != typeof i || i % 1 !== 0)
  38069. throw TypeError("Illegal offset: " + i + " (not an integer)");
  38070. if (i >>>= 0,
  38071. i < 0 || i + 0 > this.buffer.byteLength)
  38072. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  38073. }
  38074. var r, a, s = i;
  38075. r = h.calculateUTF16asUTF8(t(e), this.noAssert)[1],
  38076. a = o.calculateVarint32(r),
  38077. i += a + r;
  38078. var l = this.buffer.byteLength;
  38079. if (i > l && this.resize((l *= 2) > i ? l : i),
  38080. i -= a + r,
  38081. i += this.writeVarint32(r, i),
  38082. h.encodeUTF16toUTF8(t(e), function(e) {
  38083. this.view[i++] = e
  38084. }
  38085. .bind(this)),
  38086. i !== s + r + a)
  38087. throw RangeError("Illegal range: Truncated data, " + i + " == " + (i + r + a));
  38088. return n ? (this.offset = i,
  38089. this) : i - s
  38090. }
  38091. ,
  38092. a.readVString = function(e) {
  38093. var t = "undefined" == typeof e;
  38094. if (t && (e = this.offset),
  38095. !this.noAssert) {
  38096. if ("number" != typeof e || e % 1 !== 0)
  38097. throw TypeError("Illegal offset: " + e + " (not an integer)");
  38098. if (e >>>= 0,
  38099. e < 0 || e + 1 > this.buffer.byteLength)
  38100. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  38101. }
  38102. var i = e
  38103. , n = this.readVarint32(e)
  38104. , r = this.readUTF8String(n.value, o.METRICS_BYTES, e += n.length);
  38105. return e += r.length,
  38106. t ? (this.offset = e,
  38107. r.string) : {
  38108. string: r.string,
  38109. length: e - i
  38110. }
  38111. }
  38112. ,
  38113. a.append = function(e, t, i) {
  38114. "number" != typeof t && "string" == typeof t || (i = t,
  38115. t = void 0);
  38116. var n = "undefined" == typeof i;
  38117. if (n && (i = this.offset),
  38118. !this.noAssert) {
  38119. if ("number" != typeof i || i % 1 !== 0)
  38120. throw TypeError("Illegal offset: " + i + " (not an integer)");
  38121. if (i >>>= 0,
  38122. i < 0 || i + 0 > this.buffer.byteLength)
  38123. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  38124. }
  38125. e instanceof o || (e = o.wrap(e, t));
  38126. var r = e.limit - e.offset;
  38127. if (r <= 0)
  38128. return this;
  38129. i += r;
  38130. var a = this.buffer.byteLength;
  38131. return i > a && this.resize((a *= 2) > i ? a : i),
  38132. i -= r,
  38133. this.view.set(e.view.subarray(e.offset, e.limit), i),
  38134. e.offset += r,
  38135. n && (this.offset += r),
  38136. this
  38137. }
  38138. ,
  38139. a.appendTo = function(e, t) {
  38140. return e.append(this, t),
  38141. this
  38142. }
  38143. ,
  38144. a.assert = function(e) {
  38145. return this.noAssert = !e,
  38146. this
  38147. }
  38148. ,
  38149. a.capacity = function() {
  38150. return this.buffer.byteLength
  38151. }
  38152. ,
  38153. a.clear = function() {
  38154. return this.offset = 0,
  38155. this.limit = this.buffer.byteLength,
  38156. this.markedOffset = -1,
  38157. this
  38158. }
  38159. ,
  38160. a.clone = function(e) {
  38161. var t = new o(0,this.littleEndian,this.noAssert);
  38162. return e ? (t.buffer = new ArrayBuffer(this.buffer.byteLength),
  38163. t.view = new Uint8Array(t.buffer)) : (t.buffer = this.buffer,
  38164. t.view = this.view),
  38165. t.offset = this.offset,
  38166. t.markedOffset = this.markedOffset,
  38167. t.limit = this.limit,
  38168. t
  38169. }
  38170. ,
  38171. a.compact = function(e, t) {
  38172. if ("undefined" == typeof e && (e = this.offset),
  38173. "undefined" == typeof t && (t = this.limit),
  38174. !this.noAssert) {
  38175. if ("number" != typeof e || e % 1 !== 0)
  38176. throw TypeError("Illegal begin: Not an integer");
  38177. if (e >>>= 0,
  38178. "number" != typeof t || t % 1 !== 0)
  38179. throw TypeError("Illegal end: Not an integer");
  38180. if (t >>>= 0,
  38181. e < 0 || e > t || t > this.buffer.byteLength)
  38182. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  38183. }
  38184. if (0 === e && t === this.buffer.byteLength)
  38185. return this;
  38186. var i = t - e;
  38187. if (0 === i)
  38188. return this.buffer = s,
  38189. this.view = null,
  38190. this.markedOffset >= 0 && (this.markedOffset -= e),
  38191. this.offset = 0,
  38192. this.limit = 0,
  38193. this;
  38194. var n = new ArrayBuffer(i)
  38195. , r = new Uint8Array(n);
  38196. return r.set(this.view.subarray(e, t)),
  38197. this.buffer = n,
  38198. this.view = r,
  38199. this.markedOffset >= 0 && (this.markedOffset -= e),
  38200. this.offset = 0,
  38201. this.limit = i,
  38202. this
  38203. }
  38204. ,
  38205. a.copy = function(e, t) {
  38206. if ("undefined" == typeof e && (e = this.offset),
  38207. "undefined" == typeof t && (t = this.limit),
  38208. !this.noAssert) {
  38209. if ("number" != typeof e || e % 1 !== 0)
  38210. throw TypeError("Illegal begin: Not an integer");
  38211. if (e >>>= 0,
  38212. "number" != typeof t || t % 1 !== 0)
  38213. throw TypeError("Illegal end: Not an integer");
  38214. if (t >>>= 0,
  38215. e < 0 || e > t || t > this.buffer.byteLength)
  38216. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  38217. }
  38218. if (e === t)
  38219. return new o(0,this.littleEndian,this.noAssert);
  38220. var i = t - e
  38221. , n = new o(i,this.littleEndian,this.noAssert);
  38222. return n.offset = 0,
  38223. n.limit = i,
  38224. n.markedOffset >= 0 && (n.markedOffset -= e),
  38225. this.copyTo(n, 0, e, t),
  38226. n
  38227. }
  38228. ,
  38229. a.copyTo = function(e, t, i, n) {
  38230. var r, a;
  38231. if (!this.noAssert && !o.isByteBuffer(e))
  38232. throw TypeError("Illegal target: Not a ByteBuffer");
  38233. if (t = (a = "undefined" == typeof t) ? e.offset : 0 | t,
  38234. i = (r = "undefined" == typeof i) ? this.offset : 0 | i,
  38235. n = "undefined" == typeof n ? this.limit : 0 | n,
  38236. t < 0 || t > e.buffer.byteLength)
  38237. throw RangeError("Illegal target range: 0 <= " + t + " <= " + e.buffer.byteLength);
  38238. if (i < 0 || n > this.buffer.byteLength)
  38239. throw RangeError("Illegal source range: 0 <= " + i + " <= " + this.buffer.byteLength);
  38240. var s = n - i;
  38241. return 0 === s ? e : (e.ensureCapacity(t + s),
  38242. e.view.set(this.view.subarray(i, n), t),
  38243. r && (this.offset += s),
  38244. a && (e.offset += s),
  38245. this)
  38246. }
  38247. ,
  38248. a.ensureCapacity = function(e) {
  38249. var t = this.buffer.byteLength;
  38250. return t < e ? this.resize((t *= 2) > e ? t : e) : this
  38251. }
  38252. ,
  38253. a.fill = function(e, t, i) {
  38254. var n = "undefined" == typeof t;
  38255. if (n && (t = this.offset),
  38256. "string" == typeof e && e.length > 0 && (e = e.charCodeAt(0)),
  38257. "undefined" == typeof t && (t = this.offset),
  38258. "undefined" == typeof i && (i = this.limit),
  38259. !this.noAssert) {
  38260. if ("number" != typeof e || e % 1 !== 0)
  38261. throw TypeError("Illegal value: " + e + " (not an integer)");
  38262. if (e |= 0,
  38263. "number" != typeof t || t % 1 !== 0)
  38264. throw TypeError("Illegal begin: Not an integer");
  38265. if (t >>>= 0,
  38266. "number" != typeof i || i % 1 !== 0)
  38267. throw TypeError("Illegal end: Not an integer");
  38268. if (i >>>= 0,
  38269. t < 0 || t > i || i > this.buffer.byteLength)
  38270. throw RangeError("Illegal range: 0 <= " + t + " <= " + i + " <= " + this.buffer.byteLength)
  38271. }
  38272. if (t >= i)
  38273. return this;
  38274. for (; t < i; )
  38275. this.view[t++] = e;
  38276. return n && (this.offset = t),
  38277. this
  38278. }
  38279. ,
  38280. a.flip = function() {
  38281. return this.limit = this.offset,
  38282. this.offset = 0,
  38283. this
  38284. }
  38285. ,
  38286. a.mark = function(e) {
  38287. if (e = "undefined" == typeof e ? this.offset : e,
  38288. !this.noAssert) {
  38289. if ("number" != typeof e || e % 1 !== 0)
  38290. throw TypeError("Illegal offset: " + e + " (not an integer)");
  38291. if (e >>>= 0,
  38292. e < 0 || e + 0 > this.buffer.byteLength)
  38293. throw RangeError("Illegal offset: 0 <= " + e + " (+0) <= " + this.buffer.byteLength)
  38294. }
  38295. return this.markedOffset = e,
  38296. this
  38297. }
  38298. ,
  38299. a.order = function(e) {
  38300. if (!this.noAssert && "boolean" != typeof e)
  38301. throw TypeError("Illegal littleEndian: Not a boolean");
  38302. return this.littleEndian = !!e,
  38303. this
  38304. }
  38305. ,
  38306. a.LE = function(e) {
  38307. return this.littleEndian = "undefined" == typeof e || !!e,
  38308. this
  38309. }
  38310. ,
  38311. a.BE = function(e) {
  38312. return this.littleEndian = "undefined" != typeof e && !e,
  38313. this
  38314. }
  38315. ,
  38316. a.prepend = function(e, t, i) {
  38317. "number" != typeof t && "string" == typeof t || (i = t,
  38318. t = void 0);
  38319. var n = "undefined" == typeof i;
  38320. if (n && (i = this.offset),
  38321. !this.noAssert) {
  38322. if ("number" != typeof i || i % 1 !== 0)
  38323. throw TypeError("Illegal offset: " + i + " (not an integer)");
  38324. if (i >>>= 0,
  38325. i < 0 || i + 0 > this.buffer.byteLength)
  38326. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  38327. }
  38328. e instanceof o || (e = o.wrap(e, t));
  38329. var r = e.limit - e.offset;
  38330. if (r <= 0)
  38331. return this;
  38332. var a = r - i;
  38333. if (a > 0) {
  38334. var s = new ArrayBuffer(this.buffer.byteLength + a)
  38335. , l = new Uint8Array(s);
  38336. l.set(this.view.subarray(i, this.buffer.byteLength), r),
  38337. this.buffer = s,
  38338. this.view = l,
  38339. this.offset += a,
  38340. this.markedOffset >= 0 && (this.markedOffset += a),
  38341. this.limit += a,
  38342. i += a
  38343. } else {
  38344. new Uint8Array(this.buffer)
  38345. }
  38346. return this.view.set(e.view.subarray(e.offset, e.limit), i - r),
  38347. e.offset = e.limit,
  38348. n && (this.offset -= r),
  38349. this
  38350. }
  38351. ,
  38352. a.prependTo = function(e, t) {
  38353. return e.prepend(this, t),
  38354. this
  38355. }
  38356. ,
  38357. a.printDebug = function(e) {
  38358. "function" != typeof e && (e = console.log.bind(console)),
  38359. e(this.toString() + "\n-------------------------------------------------------------------\n" + this.toDebug(!0))
  38360. }
  38361. ,
  38362. a.remaining = function() {
  38363. return this.limit - this.offset
  38364. }
  38365. ,
  38366. a.reset = function() {
  38367. return this.markedOffset >= 0 ? (this.offset = this.markedOffset,
  38368. this.markedOffset = -1) : this.offset = 0,
  38369. this
  38370. }
  38371. ,
  38372. a.resize = function(e) {
  38373. if (!this.noAssert) {
  38374. if ("number" != typeof e || e % 1 !== 0)
  38375. throw TypeError("Illegal capacity: " + e + " (not an integer)");
  38376. if (e |= 0,
  38377. e < 0)
  38378. throw RangeError("Illegal capacity: 0 <= " + e)
  38379. }
  38380. if (this.buffer.byteLength < e) {
  38381. var t = new ArrayBuffer(e)
  38382. , i = new Uint8Array(t);
  38383. i.set(this.view),
  38384. this.buffer = t,
  38385. this.view = i
  38386. }
  38387. return this
  38388. }
  38389. ,
  38390. a.reverse = function(e, t) {
  38391. if ("undefined" == typeof e && (e = this.offset),
  38392. "undefined" == typeof t && (t = this.limit),
  38393. !this.noAssert) {
  38394. if ("number" != typeof e || e % 1 !== 0)
  38395. throw TypeError("Illegal begin: Not an integer");
  38396. if (e >>>= 0,
  38397. "number" != typeof t || t % 1 !== 0)
  38398. throw TypeError("Illegal end: Not an integer");
  38399. if (t >>>= 0,
  38400. e < 0 || e > t || t > this.buffer.byteLength)
  38401. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  38402. }
  38403. return e === t ? this : (Array.prototype.reverse.call(this.view.subarray(e, t)),
  38404. this)
  38405. }
  38406. ,
  38407. a.skip = function(e) {
  38408. if (!this.noAssert) {
  38409. if ("number" != typeof e || e % 1 !== 0)
  38410. throw TypeError("Illegal length: " + e + " (not an integer)");
  38411. e |= 0
  38412. }
  38413. var t = this.offset + e;
  38414. if (!this.noAssert && (t < 0 || t > this.buffer.byteLength))
  38415. throw RangeError("Illegal length: 0 <= " + this.offset + " + " + e + " <= " + this.buffer.byteLength);
  38416. return this.offset = t,
  38417. this
  38418. }
  38419. ,
  38420. a.slice = function(e, t) {
  38421. if ("undefined" == typeof e && (e = this.offset),
  38422. "undefined" == typeof t && (t = this.limit),
  38423. !this.noAssert) {
  38424. if ("number" != typeof e || e % 1 !== 0)
  38425. throw TypeError("Illegal begin: Not an integer");
  38426. if (e >>>= 0,
  38427. "number" != typeof t || t % 1 !== 0)
  38428. throw TypeError("Illegal end: Not an integer");
  38429. if (t >>>= 0,
  38430. e < 0 || e > t || t > this.buffer.byteLength)
  38431. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  38432. }
  38433. var i = this.clone();
  38434. return i.offset = e,
  38435. i.limit = t,
  38436. i
  38437. }
  38438. ,
  38439. a.toBuffer = function(e) {
  38440. var t = this.offset
  38441. , i = this.limit;
  38442. if (!this.noAssert) {
  38443. if ("number" != typeof t || t % 1 !== 0)
  38444. throw TypeError("Illegal offset: Not an integer");
  38445. if (t >>>= 0,
  38446. "number" != typeof i || i % 1 !== 0)
  38447. throw TypeError("Illegal limit: Not an integer");
  38448. if (i >>>= 0,
  38449. t < 0 || t > i || i > this.buffer.byteLength)
  38450. throw RangeError("Illegal range: 0 <= " + t + " <= " + i + " <= " + this.buffer.byteLength)
  38451. }
  38452. if (!e && 0 === t && i === this.buffer.byteLength)
  38453. return this.buffer;
  38454. if (t === i)
  38455. return s;
  38456. var n = new ArrayBuffer(i - t);
  38457. return new Uint8Array(n).set(new Uint8Array(this.buffer).subarray(t, i), 0),
  38458. n
  38459. }
  38460. ,
  38461. a.toArrayBuffer = a.toBuffer,
  38462. a.toString = function(e, t, i) {
  38463. if ("undefined" == typeof e)
  38464. return "ByteBufferAB(offset=" + this.offset + ",markedOffset=" + this.markedOffset + ",limit=" + this.limit + ",capacity=" + this.capacity() + ")";
  38465. switch ("number" == typeof e && (e = "utf8",
  38466. t = e,
  38467. i = t),
  38468. e) {
  38469. case "utf8":
  38470. return this.toUTF8(t, i);
  38471. case "base64":
  38472. return this.toBase64(t, i);
  38473. case "hex":
  38474. return this.toHex(t, i);
  38475. case "binary":
  38476. return this.toBinary(t, i);
  38477. case "debug":
  38478. return this.toDebug();
  38479. case "columns":
  38480. return this.toColumns();
  38481. default:
  38482. throw Error("Unsupported encoding: " + e)
  38483. }
  38484. }
  38485. ;
  38486. var c = function() {
  38487. 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)
  38488. i[t[n]] = n;
  38489. return e.encode = function(e, i) {
  38490. for (var n, r; null !== (n = e()); )
  38491. i(t[n >> 2 & 63]),
  38492. r = (3 & n) << 4,
  38493. null !== (n = e()) ? (r |= n >> 4 & 15,
  38494. i(t[63 & (r | n >> 4 & 15)]),
  38495. r = (15 & n) << 2,
  38496. null !== (n = e()) ? (i(t[63 & (r | n >> 6 & 3)]),
  38497. i(t[63 & n])) : (i(t[63 & r]),
  38498. i(61))) : (i(t[63 & r]),
  38499. i(61),
  38500. i(61))
  38501. }
  38502. ,
  38503. e.decode = function(e, t) {
  38504. function n(e) {
  38505. throw Error("Illegal character code: " + e)
  38506. }
  38507. for (var r, o, a; null !== (r = e()); )
  38508. if (o = i[r],
  38509. "undefined" == typeof o && n(r),
  38510. null !== (r = e()) && (a = i[r],
  38511. "undefined" == typeof a && n(r),
  38512. t(o << 2 >>> 0 | (48 & a) >> 4),
  38513. null !== (r = e()))) {
  38514. if (o = i[r],
  38515. "undefined" == typeof o) {
  38516. if (61 === r)
  38517. break;
  38518. n(r)
  38519. }
  38520. if (t((15 & a) << 4 >>> 0 | (60 & o) >> 2),
  38521. null !== (r = e())) {
  38522. if (a = i[r],
  38523. "undefined" == typeof a) {
  38524. if (61 === r)
  38525. break;
  38526. n(r)
  38527. }
  38528. t((3 & o) << 6 >>> 0 | a)
  38529. }
  38530. }
  38531. }
  38532. ,
  38533. e.test = function(e) {
  38534. return /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.test(e)
  38535. }
  38536. ,
  38537. e
  38538. }();
  38539. a.toBase64 = function(e, t) {
  38540. if ("undefined" == typeof e && (e = this.offset),
  38541. "undefined" == typeof t && (t = this.limit),
  38542. e |= 0,
  38543. t |= 0,
  38544. e < 0 || t > this.capacity || e > t)
  38545. throw RangeError("begin, end");
  38546. var n;
  38547. return c.encode(function() {
  38548. return e < t ? this.view[e++] : null
  38549. }
  38550. .bind(this), n = i()),
  38551. n()
  38552. }
  38553. ,
  38554. o.fromBase64 = function(e, i) {
  38555. if ("string" != typeof e)
  38556. throw TypeError("str");
  38557. var n = new o(e.length / 4 * 3,i)
  38558. , r = 0;
  38559. return c.decode(t(e), function(e) {
  38560. n.view[r++] = e
  38561. }),
  38562. n.limit = r,
  38563. n
  38564. }
  38565. ,
  38566. o.btoa = function(e) {
  38567. return o.fromBinary(e).toBase64()
  38568. }
  38569. ,
  38570. o.atob = function(e) {
  38571. return o.fromBase64(e).toBinary()
  38572. }
  38573. ,
  38574. a.toBinary = function(e, t) {
  38575. if ("undefined" == typeof e && (e = this.offset),
  38576. "undefined" == typeof t && (t = this.limit),
  38577. e |= 0,
  38578. t |= 0,
  38579. e < 0 || t > this.capacity() || e > t)
  38580. throw RangeError("begin, end");
  38581. if (e === t)
  38582. return "";
  38583. for (var i = [], n = []; e < t; )
  38584. i.push(this.view[e++]),
  38585. i.length >= 1024 && (n.push(String.fromCharCode.apply(String, i)),
  38586. i = []);
  38587. return n.join("") + String.fromCharCode.apply(String, i)
  38588. }
  38589. ,
  38590. o.fromBinary = function(e, t) {
  38591. if ("string" != typeof e)
  38592. throw TypeError("str");
  38593. for (var i, n = 0, r = e.length, a = new o(r,t); n < r; ) {
  38594. if (i = e.charCodeAt(n),
  38595. i > 255)
  38596. throw RangeError("illegal char code: " + i);
  38597. a.view[n++] = i
  38598. }
  38599. return a.limit = r,
  38600. a
  38601. }
  38602. ,
  38603. a.toDebug = function(e) {
  38604. for (var t, i = -1, n = this.buffer.byteLength, r = "", o = "", a = ""; i < n; ) {
  38605. if (i !== -1 && (t = this.view[i],
  38606. r += t < 16 ? "0" + t.toString(16).toUpperCase() : t.toString(16).toUpperCase(),
  38607. e && (o += t > 32 && t < 127 ? String.fromCharCode(t) : ".")),
  38608. ++i,
  38609. e && i > 0 && i % 16 === 0 && i !== n) {
  38610. for (; r.length < 51; )
  38611. r += " ";
  38612. a += r + o + "\n",
  38613. r = o = ""
  38614. }
  38615. 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 ? " " : ""
  38616. }
  38617. if (e && " " !== r) {
  38618. for (; r.length < 51; )
  38619. r += " ";
  38620. a += r + o + "\n"
  38621. }
  38622. return e ? a : r
  38623. }
  38624. ,
  38625. o.fromDebug = function(e, t, i) {
  38626. 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; ) {
  38627. switch (n = e.charAt(l++)) {
  38628. case "!":
  38629. if (!i) {
  38630. if (u || d || p) {
  38631. f = !0;
  38632. break
  38633. }
  38634. u = d = p = !0
  38635. }
  38636. s.offset = s.markedOffset = s.limit = c,
  38637. h = !1;
  38638. break;
  38639. case "|":
  38640. if (!i) {
  38641. if (u || p) {
  38642. f = !0;
  38643. break
  38644. }
  38645. u = p = !0
  38646. }
  38647. s.offset = s.limit = c,
  38648. h = !1;
  38649. break;
  38650. case "[":
  38651. if (!i) {
  38652. if (u || d) {
  38653. f = !0;
  38654. break
  38655. }
  38656. u = d = !0
  38657. }
  38658. s.offset = s.markedOffset = c,
  38659. h = !1;
  38660. break;
  38661. case "<":
  38662. if (!i) {
  38663. if (u) {
  38664. f = !0;
  38665. break
  38666. }
  38667. u = !0
  38668. }
  38669. s.offset = c,
  38670. h = !1;
  38671. break;
  38672. case "]":
  38673. if (!i) {
  38674. if (p || d) {
  38675. f = !0;
  38676. break
  38677. }
  38678. p = d = !0
  38679. }
  38680. s.limit = s.markedOffset = c,
  38681. h = !1;
  38682. break;
  38683. case ">":
  38684. if (!i) {
  38685. if (p) {
  38686. f = !0;
  38687. break
  38688. }
  38689. p = !0
  38690. }
  38691. s.limit = c,
  38692. h = !1;
  38693. break;
  38694. case "'":
  38695. if (!i) {
  38696. if (d) {
  38697. f = !0;
  38698. break
  38699. }
  38700. d = !0
  38701. }
  38702. s.markedOffset = c,
  38703. h = !1;
  38704. break;
  38705. case " ":
  38706. h = !1;
  38707. break;
  38708. default:
  38709. if (!i && h) {
  38710. f = !0;
  38711. break
  38712. }
  38713. if (r = parseInt(n + e.charAt(l++), 16),
  38714. !i && (isNaN(r) || r < 0 || r > 255))
  38715. throw TypeError("Illegal str: Not a debug encoded string");
  38716. s.view[c++] = r,
  38717. h = !0
  38718. }
  38719. if (f)
  38720. throw TypeError("Illegal str: Invalid symbol at " + l)
  38721. }
  38722. if (!i) {
  38723. if (!u || !p)
  38724. throw TypeError("Illegal str: Missing offset or limit");
  38725. if (c < s.buffer.byteLength)
  38726. throw TypeError("Illegal str: Not a debug encoded string (is it hex?) " + c + " < " + a)
  38727. }
  38728. return s
  38729. }
  38730. ,
  38731. a.toHex = function(e, t) {
  38732. if (e = "undefined" == typeof e ? this.offset : e,
  38733. t = "undefined" == typeof t ? this.limit : t,
  38734. !this.noAssert) {
  38735. if ("number" != typeof e || e % 1 !== 0)
  38736. throw TypeError("Illegal begin: Not an integer");
  38737. if (e >>>= 0,
  38738. "number" != typeof t || t % 1 !== 0)
  38739. throw TypeError("Illegal end: Not an integer");
  38740. if (t >>>= 0,
  38741. e < 0 || e > t || t > this.buffer.byteLength)
  38742. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  38743. }
  38744. for (var i, n = new Array(t - e); e < t; )
  38745. i = this.view[e++],
  38746. i < 16 ? n.push("0", i.toString(16)) : n.push(i.toString(16));
  38747. return n.join("")
  38748. }
  38749. ,
  38750. o.fromHex = function(e, t, i) {
  38751. if (!i) {
  38752. if ("string" != typeof e)
  38753. throw TypeError("Illegal str: Not a string");
  38754. if (e.length % 2 !== 0)
  38755. throw TypeError("Illegal str: Length not a multiple of 2")
  38756. }
  38757. for (var n, r = e.length, a = new o(r / 2 | 0,t), s = 0, l = 0; s < r; s += 2) {
  38758. if (n = parseInt(e.substring(s, s + 2), 16),
  38759. !i && (!isFinite(n) || n < 0 || n > 255))
  38760. throw TypeError("Illegal str: Contains non-hex characters");
  38761. a.view[l++] = n
  38762. }
  38763. return a.limit = l,
  38764. a
  38765. }
  38766. ;
  38767. var h = function() {
  38768. var e = {};
  38769. return e.MAX_CODEPOINT = 1114111,
  38770. e.encodeUTF8 = function(e, t) {
  38771. var i = null;
  38772. for ("number" == typeof e && (i = e,
  38773. e = function() {
  38774. return null
  38775. }
  38776. ); null !== i || null !== (i = e()); )
  38777. i < 128 ? t(127 & i) : i < 2048 ? (t(i >> 6 & 31 | 192),
  38778. t(63 & i | 128)) : i < 65536 ? (t(i >> 12 & 15 | 224),
  38779. t(i >> 6 & 63 | 128),
  38780. t(63 & i | 128)) : (t(i >> 18 & 7 | 240),
  38781. t(i >> 12 & 63 | 128),
  38782. t(i >> 6 & 63 | 128),
  38783. t(63 & i | 128)),
  38784. i = null
  38785. }
  38786. ,
  38787. e.decodeUTF8 = function(e, t) {
  38788. for (var i, n, r, o, a = function(e) {
  38789. e = e.slice(0, e.indexOf(null));
  38790. var t = Error(e.toString());
  38791. throw t.name = "TruncatedError",
  38792. t.bytes = e,
  38793. t
  38794. }; null !== (i = e()); )
  38795. if (0 === (128 & i))
  38796. t(i);
  38797. else if (192 === (224 & i))
  38798. null === (n = e()) && a([i, n]),
  38799. t((31 & i) << 6 | 63 & n);
  38800. else if (224 === (240 & i))
  38801. (null === (n = e()) || null === (r = e())) && a([i, n, r]),
  38802. t((15 & i) << 12 | (63 & n) << 6 | 63 & r);
  38803. else {
  38804. if (240 !== (248 & i))
  38805. throw RangeError("Illegal starting byte: " + i);
  38806. (null === (n = e()) || null === (r = e()) || null === (o = e())) && a([i, n, r, o]),
  38807. t((7 & i) << 18 | (63 & n) << 12 | (63 & r) << 6 | 63 & o)
  38808. }
  38809. }
  38810. ,
  38811. e.UTF16toUTF8 = function(e, t) {
  38812. for (var i, n = null; ; ) {
  38813. if (null === (i = null !== n ? n : e()))
  38814. break;
  38815. i >= 55296 && i <= 57343 && null !== (n = e()) && n >= 56320 && n <= 57343 ? (t(1024 * (i - 55296) + n - 56320 + 65536),
  38816. n = null) : t(i)
  38817. }
  38818. null !== n && t(n)
  38819. }
  38820. ,
  38821. e.UTF8toUTF16 = function(e, t) {
  38822. var i = null;
  38823. for ("number" == typeof e && (i = e,
  38824. e = function() {
  38825. return null
  38826. }
  38827. ); null !== i || null !== (i = e()); )
  38828. i <= 65535 ? t(i) : (i -= 65536,
  38829. t((i >> 10) + 55296),
  38830. t(i % 1024 + 56320)),
  38831. i = null
  38832. }
  38833. ,
  38834. e.encodeUTF16toUTF8 = function(t, i) {
  38835. e.UTF16toUTF8(t, function(t) {
  38836. e.encodeUTF8(t, i)
  38837. })
  38838. }
  38839. ,
  38840. e.decodeUTF8toUTF16 = function(t, i) {
  38841. e.decodeUTF8(t, function(t) {
  38842. e.UTF8toUTF16(t, i)
  38843. })
  38844. }
  38845. ,
  38846. e.calculateCodePoint = function(e) {
  38847. return e < 128 ? 1 : e < 2048 ? 2 : e < 65536 ? 3 : 4
  38848. }
  38849. ,
  38850. e.calculateUTF8 = function(e) {
  38851. for (var t, i = 0; null !== (t = e()); )
  38852. i += t < 128 ? 1 : t < 2048 ? 2 : t < 65536 ? 3 : 4;
  38853. return i
  38854. }
  38855. ,
  38856. e.calculateUTF16asUTF8 = function(t) {
  38857. var i = 0
  38858. , n = 0;
  38859. return e.UTF16toUTF8(t, function(e) {
  38860. ++i,
  38861. n += e < 128 ? 1 : e < 2048 ? 2 : e < 65536 ? 3 : 4
  38862. }),
  38863. [i, n]
  38864. }
  38865. ,
  38866. e
  38867. }();
  38868. return a.toUTF8 = function(e, t) {
  38869. if ("undefined" == typeof e && (e = this.offset),
  38870. "undefined" == typeof t && (t = this.limit),
  38871. !this.noAssert) {
  38872. if ("number" != typeof e || e % 1 !== 0)
  38873. throw TypeError("Illegal begin: Not an integer");
  38874. if (e >>>= 0,
  38875. "number" != typeof t || t % 1 !== 0)
  38876. throw TypeError("Illegal end: Not an integer");
  38877. if (t >>>= 0,
  38878. e < 0 || e > t || t > this.buffer.byteLength)
  38879. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  38880. }
  38881. var n;
  38882. try {
  38883. h.decodeUTF8toUTF16(function() {
  38884. return e < t ? this.view[e++] : null
  38885. }
  38886. .bind(this), n = i())
  38887. } catch (i) {
  38888. if (e !== t)
  38889. throw RangeError("Illegal range: Truncated data, " + e + " != " + t)
  38890. }
  38891. return n()
  38892. }
  38893. ,
  38894. o.fromUTF8 = function(e, i, n) {
  38895. if (!n && "string" != typeof e)
  38896. throw TypeError("Illegal str: Not a string");
  38897. var r = new o(h.calculateUTF16asUTF8(t(e), !0)[1],i,n)
  38898. , a = 0;
  38899. return h.encodeUTF16toUTF8(t(e), function(e) {
  38900. r.view[a++] = e
  38901. }),
  38902. r.limit = a,
  38903. r
  38904. }
  38905. ,
  38906. o
  38907. })
  38908. }
  38909. , {
  38910. long: 216
  38911. }],
  38912. 216: [function(e, t, i) {
  38913. !function(i, n) {
  38914. "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()
  38915. }(this, function() {
  38916. "use strict";
  38917. function e(e, t, i) {
  38918. this.low = 0 | e,
  38919. this.high = 0 | t,
  38920. this.unsigned = !!i
  38921. }
  38922. function t(e) {
  38923. return (e && e.__isLong__) === !0
  38924. }
  38925. function i(e, t) {
  38926. var i, n, o;
  38927. return t ? (e >>>= 0,
  38928. (o = 0 <= e && e < 256) && (n = l[e]) ? n : (i = r(e, (0 | e) < 0 ? -1 : 0, !0),
  38929. o && (l[e] = i),
  38930. i)) : (e |= 0,
  38931. (o = -128 <= e && e < 128) && (n = s[e]) ? n : (i = r(e, e < 0 ? -1 : 0, !1),
  38932. o && (s[e] = i),
  38933. i))
  38934. }
  38935. function n(e, t) {
  38936. if (isNaN(e) || !isFinite(e))
  38937. return t ? m : g;
  38938. if (t) {
  38939. if (e < 0)
  38940. return m;
  38941. if (e >= d)
  38942. return I
  38943. } else {
  38944. if (e <= -p)
  38945. return E;
  38946. if (e + 1 >= p)
  38947. return C
  38948. }
  38949. return e < 0 ? n(-e, t).neg() : r(e % u | 0, e / u | 0, t)
  38950. }
  38951. function r(t, i, n) {
  38952. return new e(t,i,n)
  38953. }
  38954. function o(e, t, i) {
  38955. if (0 === e.length)
  38956. throw Error("empty string");
  38957. if ("NaN" === e || "Infinity" === e || "+Infinity" === e || "-Infinity" === e)
  38958. return g;
  38959. if ("number" == typeof t ? (i = t,
  38960. t = !1) : t = !!t,
  38961. i = i || 10,
  38962. i < 2 || 36 < i)
  38963. throw RangeError("radix");
  38964. var r;
  38965. if ((r = e.indexOf("-")) > 0)
  38966. throw Error("interior hyphen");
  38967. if (0 === r)
  38968. return o(e.substring(1), t, i).neg();
  38969. for (var a = n(c(i, 8)), s = g, l = 0; l < e.length; l += 8) {
  38970. var h = Math.min(8, e.length - l)
  38971. , u = parseInt(e.substring(l, l + h), i);
  38972. if (h < 8) {
  38973. var d = n(c(i, h));
  38974. s = s.mul(d).add(n(u))
  38975. } else
  38976. s = s.mul(a),
  38977. s = s.add(n(u))
  38978. }
  38979. return s.unsigned = t,
  38980. s
  38981. }
  38982. function a(t) {
  38983. return t instanceof e ? t : "number" == typeof t ? n(t) : "string" == typeof t ? o(t) : r(t.low, t.high, t.unsigned)
  38984. }
  38985. e.prototype.__isLong__,
  38986. Object.defineProperty(e.prototype, "__isLong__", {
  38987. value: !0,
  38988. enumerable: !1,
  38989. configurable: !1
  38990. }),
  38991. e.isLong = t;
  38992. var s = {}
  38993. , l = {};
  38994. e.fromInt = i,
  38995. e.fromNumber = n,
  38996. e.fromBits = r;
  38997. var c = Math.pow;
  38998. e.fromString = o,
  38999. e.fromValue = a;
  39000. var h = 1 << 24
  39001. , u = 4294967296
  39002. , d = 0x10000000000000000
  39003. , p = d / 2
  39004. , f = i(h)
  39005. , g = i(0);
  39006. e.ZERO = g;
  39007. var m = i(0, !0);
  39008. e.UZERO = m;
  39009. var v = i(1);
  39010. e.ONE = v;
  39011. var A = i(1, !0);
  39012. e.UONE = A;
  39013. var y = i(-1);
  39014. e.NEG_ONE = y;
  39015. var C = r(-1, 2147483647, !1);
  39016. e.MAX_VALUE = C;
  39017. var I = r(-1, -1, !0);
  39018. e.MAX_UNSIGNED_VALUE = I;
  39019. var E = r(0, -2147483648, !1);
  39020. e.MIN_VALUE = E;
  39021. var b = e.prototype;
  39022. return b.toInt = function() {
  39023. return this.unsigned ? this.low >>> 0 : this.low
  39024. }
  39025. ,
  39026. b.toNumber = function() {
  39027. return this.unsigned ? (this.high >>> 0) * u + (this.low >>> 0) : this.high * u + (this.low >>> 0)
  39028. }
  39029. ,
  39030. b.toString = function(e) {
  39031. if (e = e || 10,
  39032. e < 2 || 36 < e)
  39033. throw RangeError("radix");
  39034. if (this.isZero())
  39035. return "0";
  39036. if (this.isNegative()) {
  39037. if (this.eq(E)) {
  39038. var t = n(e)
  39039. , i = this.div(t)
  39040. , r = i.mul(t).sub(this);
  39041. return i.toString(e) + r.toInt().toString(e)
  39042. }
  39043. return "-" + this.neg().toString(e)
  39044. }
  39045. for (var o = n(c(e, 6), this.unsigned), a = this, s = ""; ; ) {
  39046. var l = a.div(o)
  39047. , h = a.sub(l.mul(o)).toInt() >>> 0
  39048. , u = h.toString(e);
  39049. if (a = l,
  39050. a.isZero())
  39051. return u + s;
  39052. for (; u.length < 6; )
  39053. u = "0" + u;
  39054. s = "" + u + s
  39055. }
  39056. }
  39057. ,
  39058. b.getHighBits = function() {
  39059. return this.high
  39060. }
  39061. ,
  39062. b.getHighBitsUnsigned = function() {
  39063. return this.high >>> 0
  39064. }
  39065. ,
  39066. b.getLowBits = function() {
  39067. return this.low
  39068. }
  39069. ,
  39070. b.getLowBitsUnsigned = function() {
  39071. return this.low >>> 0
  39072. }
  39073. ,
  39074. b.getNumBitsAbs = function() {
  39075. if (this.isNegative())
  39076. return this.eq(E) ? 64 : this.neg().getNumBitsAbs();
  39077. for (var e = 0 != this.high ? this.high : this.low, t = 31; t > 0 && 0 == (e & 1 << t); t--)
  39078. ;
  39079. return 0 != this.high ? t + 33 : t + 1
  39080. }
  39081. ,
  39082. b.isZero = function() {
  39083. return 0 === this.high && 0 === this.low
  39084. }
  39085. ,
  39086. b.isNegative = function() {
  39087. return !this.unsigned && this.high < 0
  39088. }
  39089. ,
  39090. b.isPositive = function() {
  39091. return this.unsigned || this.high >= 0
  39092. }
  39093. ,
  39094. b.isOdd = function() {
  39095. return 1 === (1 & this.low)
  39096. }
  39097. ,
  39098. b.isEven = function() {
  39099. return 0 === (1 & this.low)
  39100. }
  39101. ,
  39102. b.equals = function(e) {
  39103. return t(e) || (e = a(e)),
  39104. (this.unsigned === e.unsigned || this.high >>> 31 !== 1 || e.high >>> 31 !== 1) && (this.high === e.high && this.low === e.low)
  39105. }
  39106. ,
  39107. b.eq = b.equals,
  39108. b.notEquals = function(e) {
  39109. return !this.eq(e)
  39110. }
  39111. ,
  39112. b.neq = b.notEquals,
  39113. b.lessThan = function(e) {
  39114. return this.comp(e) < 0
  39115. }
  39116. ,
  39117. b.lt = b.lessThan,
  39118. b.lessThanOrEqual = function(e) {
  39119. return this.comp(e) <= 0
  39120. }
  39121. ,
  39122. b.lte = b.lessThanOrEqual,
  39123. b.greaterThan = function(e) {
  39124. return this.comp(e) > 0
  39125. }
  39126. ,
  39127. b.gt = b.greaterThan,
  39128. b.greaterThanOrEqual = function(e) {
  39129. return this.comp(e) >= 0
  39130. }
  39131. ,
  39132. b.gte = b.greaterThanOrEqual,
  39133. b.compare = function(e) {
  39134. if (t(e) || (e = a(e)),
  39135. this.eq(e))
  39136. return 0;
  39137. var i = this.isNegative()
  39138. , n = e.isNegative();
  39139. 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
  39140. }
  39141. ,
  39142. b.comp = b.compare,
  39143. b.negate = function() {
  39144. return !this.unsigned && this.eq(E) ? E : this.not().add(v)
  39145. }
  39146. ,
  39147. b.neg = b.negate,
  39148. b.add = function(e) {
  39149. t(e) || (e = a(e));
  39150. var i = this.high >>> 16
  39151. , n = 65535 & this.high
  39152. , o = this.low >>> 16
  39153. , s = 65535 & this.low
  39154. , l = e.high >>> 16
  39155. , c = 65535 & e.high
  39156. , h = e.low >>> 16
  39157. , u = 65535 & e.low
  39158. , d = 0
  39159. , p = 0
  39160. , f = 0
  39161. , g = 0;
  39162. return g += s + u,
  39163. f += g >>> 16,
  39164. g &= 65535,
  39165. f += o + h,
  39166. p += f >>> 16,
  39167. f &= 65535,
  39168. p += n + c,
  39169. d += p >>> 16,
  39170. p &= 65535,
  39171. d += i + l,
  39172. d &= 65535,
  39173. r(f << 16 | g, d << 16 | p, this.unsigned)
  39174. }
  39175. ,
  39176. b.subtract = function(e) {
  39177. return t(e) || (e = a(e)),
  39178. this.add(e.neg())
  39179. }
  39180. ,
  39181. b.sub = b.subtract,
  39182. b.multiply = function(e) {
  39183. if (this.isZero())
  39184. return g;
  39185. if (t(e) || (e = a(e)),
  39186. e.isZero())
  39187. return g;
  39188. if (this.eq(E))
  39189. return e.isOdd() ? E : g;
  39190. if (e.eq(E))
  39191. return this.isOdd() ? E : g;
  39192. if (this.isNegative())
  39193. return e.isNegative() ? this.neg().mul(e.neg()) : this.neg().mul(e).neg();
  39194. if (e.isNegative())
  39195. return this.mul(e.neg()).neg();
  39196. if (this.lt(f) && e.lt(f))
  39197. return n(this.toNumber() * e.toNumber(), this.unsigned);
  39198. var i = this.high >>> 16
  39199. , o = 65535 & this.high
  39200. , s = this.low >>> 16
  39201. , l = 65535 & this.low
  39202. , c = e.high >>> 16
  39203. , h = 65535 & e.high
  39204. , u = e.low >>> 16
  39205. , d = 65535 & e.low
  39206. , p = 0
  39207. , m = 0
  39208. , v = 0
  39209. , A = 0;
  39210. return A += l * d,
  39211. v += A >>> 16,
  39212. A &= 65535,
  39213. v += s * d,
  39214. m += v >>> 16,
  39215. v &= 65535,
  39216. v += l * u,
  39217. m += v >>> 16,
  39218. v &= 65535,
  39219. m += o * d,
  39220. p += m >>> 16,
  39221. m &= 65535,
  39222. m += s * u,
  39223. p += m >>> 16,
  39224. m &= 65535,
  39225. m += l * h,
  39226. p += m >>> 16,
  39227. m &= 65535,
  39228. p += i * d + o * u + s * h + l * c,
  39229. p &= 65535,
  39230. r(v << 16 | A, p << 16 | m, this.unsigned)
  39231. }
  39232. ,
  39233. b.mul = b.multiply,
  39234. b.divide = function(e) {
  39235. if (t(e) || (e = a(e)),
  39236. e.isZero())
  39237. throw Error("division by zero");
  39238. if (this.isZero())
  39239. return this.unsigned ? m : g;
  39240. var i, r, o;
  39241. if (this.unsigned) {
  39242. if (e.unsigned || (e = e.toUnsigned()),
  39243. e.gt(this))
  39244. return m;
  39245. if (e.gt(this.shru(1)))
  39246. return A;
  39247. o = m
  39248. } else {
  39249. if (this.eq(E)) {
  39250. if (e.eq(v) || e.eq(y))
  39251. return E;
  39252. if (e.eq(E))
  39253. return v;
  39254. var s = this.shr(1);
  39255. return i = s.div(e).shl(1),
  39256. i.eq(g) ? e.isNegative() ? v : y : (r = this.sub(e.mul(i)),
  39257. o = i.add(r.div(e)))
  39258. }
  39259. if (e.eq(E))
  39260. return this.unsigned ? m : g;
  39261. if (this.isNegative())
  39262. return e.isNegative() ? this.neg().div(e.neg()) : this.neg().div(e).neg();
  39263. if (e.isNegative())
  39264. return this.div(e.neg()).neg();
  39265. o = g
  39266. }
  39267. for (r = this; r.gte(e); ) {
  39268. i = Math.max(1, Math.floor(r.toNumber() / e.toNumber()));
  39269. 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); )
  39270. i -= h,
  39271. u = n(i, this.unsigned),
  39272. d = u.mul(e);
  39273. u.isZero() && (u = v),
  39274. o = o.add(u),
  39275. r = r.sub(d)
  39276. }
  39277. return o
  39278. }
  39279. ,
  39280. b.div = b.divide,
  39281. b.modulo = function(e) {
  39282. return t(e) || (e = a(e)),
  39283. this.sub(this.div(e).mul(e))
  39284. }
  39285. ,
  39286. b.mod = b.modulo,
  39287. b.not = function() {
  39288. return r(~this.low, ~this.high, this.unsigned)
  39289. }
  39290. ,
  39291. b.and = function(e) {
  39292. return t(e) || (e = a(e)),
  39293. r(this.low & e.low, this.high & e.high, this.unsigned)
  39294. }
  39295. ,
  39296. b.or = function(e) {
  39297. return t(e) || (e = a(e)),
  39298. r(this.low | e.low, this.high | e.high, this.unsigned)
  39299. }
  39300. ,
  39301. b.xor = function(e) {
  39302. return t(e) || (e = a(e)),
  39303. r(this.low ^ e.low, this.high ^ e.high, this.unsigned)
  39304. }
  39305. ,
  39306. b.shiftLeft = function(e) {
  39307. return t(e) && (e = e.toInt()),
  39308. 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)
  39309. }
  39310. ,
  39311. b.shl = b.shiftLeft,
  39312. b.shiftRight = function(e) {
  39313. return t(e) && (e = e.toInt()),
  39314. 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)
  39315. }
  39316. ,
  39317. b.shr = b.shiftRight,
  39318. b.shiftRightUnsigned = function(e) {
  39319. if (t(e) && (e = e.toInt()),
  39320. e &= 63,
  39321. 0 === e)
  39322. return this;
  39323. var i = this.high;
  39324. if (e < 32) {
  39325. var n = this.low;
  39326. return r(n >>> e | i << 32 - e, i >>> e, this.unsigned)
  39327. }
  39328. return 32 === e ? r(i, 0, this.unsigned) : r(i >>> e - 32, 0, this.unsigned)
  39329. }
  39330. ,
  39331. b.shru = b.shiftRightUnsigned,
  39332. b.toSigned = function() {
  39333. return this.unsigned ? r(this.low, this.high, !1) : this
  39334. }
  39335. ,
  39336. b.toUnsigned = function() {
  39337. return this.unsigned ? this : r(this.low, this.high, !0)
  39338. }
  39339. ,
  39340. b.toBytes = function(e) {
  39341. return e ? this.toBytesLE() : this.toBytesBE()
  39342. }
  39343. ,
  39344. b.toBytesLE = function() {
  39345. var e = this.high
  39346. , t = this.low;
  39347. return [255 & t, t >>> 8 & 255, t >>> 16 & 255, t >>> 24 & 255, 255 & e, e >>> 8 & 255, e >>> 16 & 255, e >>> 24 & 255]
  39348. }
  39349. ,
  39350. b.toBytesBE = function() {
  39351. var e = this.high
  39352. , t = this.low;
  39353. return [e >>> 24 & 255, e >>> 16 & 255, e >>> 8 & 255, 255 & e, t >>> 24 & 255, t >>> 16 & 255, t >>> 8 & 255, 255 & t]
  39354. }
  39355. ,
  39356. e
  39357. })
  39358. }
  39359. , {}],
  39360. 217: [function(e, t, i) {
  39361. var n = {
  39362. REVISION: "75"
  39363. };
  39364. "function" == typeof define && define.amd ? define("three", n) : "undefined" != typeof i && "undefined" != typeof t && (t.exports = n),
  39365. void 0 === Number.EPSILON && (Number.EPSILON = Math.pow(2, -52)),
  39366. void 0 === Math.sign && (Math.sign = function(e) {
  39367. return e < 0 ? -1 : e > 0 ? 1 : +e
  39368. }
  39369. ),
  39370. void 0 === Function.prototype.name && void 0 !== Object.defineProperty && Object.defineProperty(Function.prototype, "name", {
  39371. get: function() {
  39372. return this.toString().match(/^\s*function\s*(\S*)\s*\(/)[1]
  39373. }
  39374. }),
  39375. void 0 === Object.assign && Object.defineProperty(Object, "assign", {
  39376. writable: !0,
  39377. configurable: !0,
  39378. value: function(e) {
  39379. "use strict";
  39380. if (void 0 === e || null === e)
  39381. throw new TypeError("Cannot convert first argument to object");
  39382. for (var t = Object(e), i = 1, n = arguments.length; i !== n; ++i) {
  39383. var r = arguments[i];
  39384. if (void 0 !== r && null !== r) {
  39385. r = Object(r);
  39386. for (var o = Object.keys(r), a = 0, s = o.length; a !== s; ++a) {
  39387. var l = o[a]
  39388. , c = Object.getOwnPropertyDescriptor(r, l);
  39389. void 0 !== c && c.enumerable && (t[l] = r[l])
  39390. }
  39391. }
  39392. }
  39393. return t
  39394. }
  39395. }),
  39396. n.MOUSE = {
  39397. LEFT: 0,
  39398. MIDDLE: 1,
  39399. RIGHT: 2
  39400. },
  39401. n.CullFaceNone = 0,
  39402. n.CullFaceBack = 1,
  39403. n.CullFaceFront = 2,
  39404. n.CullFaceFrontBack = 3,
  39405. n.FrontFaceDirectionCW = 0,
  39406. n.FrontFaceDirectionCCW = 1,
  39407. n.BasicShadowMap = 0,
  39408. n.PCFShadowMap = 1,
  39409. n.PCFSoftShadowMap = 2,
  39410. n.FrontSide = 0,
  39411. n.BackSide = 1,
  39412. n.DoubleSide = 2,
  39413. n.FlatShading = 1,
  39414. n.SmoothShading = 2,
  39415. n.NoColors = 0,
  39416. n.FaceColors = 1,
  39417. n.VertexColors = 2,
  39418. n.NoBlending = 0,
  39419. n.NormalBlending = 1,
  39420. n.AdditiveBlending = 2,
  39421. n.SubtractiveBlending = 3,
  39422. n.MultiplyBlending = 4,
  39423. n.CustomBlending = 5,
  39424. n.AddEquation = 100,
  39425. n.SubtractEquation = 101,
  39426. n.ReverseSubtractEquation = 102,
  39427. n.MinEquation = 103,
  39428. n.MaxEquation = 104,
  39429. n.ZeroFactor = 200,
  39430. n.OneFactor = 201,
  39431. n.SrcColorFactor = 202,
  39432. n.OneMinusSrcColorFactor = 203,
  39433. n.SrcAlphaFactor = 204,
  39434. n.OneMinusSrcAlphaFactor = 205,
  39435. n.DstAlphaFactor = 206,
  39436. n.OneMinusDstAlphaFactor = 207,
  39437. n.DstColorFactor = 208,
  39438. n.OneMinusDstColorFactor = 209,
  39439. n.SrcAlphaSaturateFactor = 210,
  39440. n.NeverDepth = 0,
  39441. n.AlwaysDepth = 1,
  39442. n.LessDepth = 2,
  39443. n.LessEqualDepth = 3,
  39444. n.EqualDepth = 4,
  39445. n.GreaterEqualDepth = 5,
  39446. n.GreaterDepth = 6,
  39447. n.NotEqualDepth = 7,
  39448. n.MultiplyOperation = 0,
  39449. n.MixOperation = 1,
  39450. n.AddOperation = 2,
  39451. n.NoToneMapping = 0,
  39452. n.LinearToneMapping = 1,
  39453. n.ReinhardToneMapping = 2,
  39454. n.Uncharted2ToneMapping = 3,
  39455. n.CineonToneMapping = 4,
  39456. n.UVMapping = 300,
  39457. n.CubeReflectionMapping = 301,
  39458. n.CubeRefractionMapping = 302,
  39459. n.EquirectangularReflectionMapping = 303,
  39460. n.EquirectangularRefractionMapping = 304,
  39461. n.SphericalReflectionMapping = 305,
  39462. n.CubeUVReflectionMapping = 306,
  39463. n.CubeUVRefractionMapping = 307,
  39464. n.RepeatWrapping = 1e3,
  39465. n.ClampToEdgeWrapping = 1001,
  39466. n.MirroredRepeatWrapping = 1002,
  39467. n.NearestFilter = 1003,
  39468. n.NearestMipMapNearestFilter = 1004,
  39469. n.NearestMipMapLinearFilter = 1005,
  39470. n.LinearFilter = 1006,
  39471. n.LinearMipMapNearestFilter = 1007,
  39472. n.LinearMipMapLinearFilter = 1008,
  39473. n.UnsignedByteType = 1009,
  39474. n.ByteType = 1010,
  39475. n.ShortType = 1011,
  39476. n.UnsignedShortType = 1012,
  39477. n.IntType = 1013,
  39478. n.UnsignedIntType = 1014,
  39479. n.FloatType = 1015,
  39480. n.HalfFloatType = 1025,
  39481. n.UnsignedShort4444Type = 1016,
  39482. n.UnsignedShort5551Type = 1017,
  39483. n.UnsignedShort565Type = 1018,
  39484. n.AlphaFormat = 1019,
  39485. n.RGBFormat = 1020,
  39486. n.RGBAFormat = 1021,
  39487. n.LuminanceFormat = 1022,
  39488. n.LuminanceAlphaFormat = 1023,
  39489. n.RGBEFormat = n.RGBAFormat,
  39490. n.RGB_S3TC_DXT1_Format = 2001,
  39491. n.RGBA_S3TC_DXT1_Format = 2002,
  39492. n.RGBA_S3TC_DXT3_Format = 2003,
  39493. n.RGBA_S3TC_DXT5_Format = 2004,
  39494. n.RGB_PVRTC_4BPPV1_Format = 2100,
  39495. n.RGB_PVRTC_2BPPV1_Format = 2101,
  39496. n.RGBA_PVRTC_4BPPV1_Format = 2102,
  39497. n.RGBA_PVRTC_2BPPV1_Format = 2103,
  39498. n.RGB_ETC1_Format = 2151,
  39499. n.LoopOnce = 2200,
  39500. n.LoopRepeat = 2201,
  39501. n.LoopPingPong = 2202,
  39502. n.InterpolateDiscrete = 2300,
  39503. n.InterpolateLinear = 2301,
  39504. n.InterpolateSmooth = 2302,
  39505. n.ZeroCurvatureEnding = 2400,
  39506. n.ZeroSlopeEnding = 2401,
  39507. n.WrapAroundEnding = 2402,
  39508. n.TrianglesDrawMode = 0,
  39509. n.TriangleStripDrawMode = 1,
  39510. n.TriangleFanDrawMode = 2,
  39511. n.LinearEncoding = 3e3,
  39512. n.sRGBEncoding = 3001,
  39513. n.GammaEncoding = 3007,
  39514. n.RGBEEncoding = 3002,
  39515. n.LogLuvEncoding = 3003,
  39516. n.RGBM7Encoding = 3004,
  39517. n.RGBM16Encoding = 3005,
  39518. n.RGBDEncoding = 3006,
  39519. n.Color = function(e) {
  39520. return 3 === arguments.length ? this.fromArray(arguments) : this.set(e)
  39521. }
  39522. ,
  39523. n.Color.prototype = {
  39524. constructor: n.Color,
  39525. r: 1,
  39526. g: 1,
  39527. b: 1,
  39528. set: function(e) {
  39529. return e instanceof n.Color ? this.copy(e) : "number" == typeof e ? this.setHex(e) : "string" == typeof e && this.setStyle(e),
  39530. this
  39531. },
  39532. setScalar: function(e) {
  39533. this.r = e,
  39534. this.g = e,
  39535. this.b = e
  39536. },
  39537. setHex: function(e) {
  39538. return e = Math.floor(e),
  39539. this.r = (e >> 16 & 255) / 255,
  39540. this.g = (e >> 8 & 255) / 255,
  39541. this.b = (255 & e) / 255,
  39542. this
  39543. },
  39544. setRGB: function(e, t, i) {
  39545. return this.r = e,
  39546. this.g = t,
  39547. this.b = i,
  39548. this
  39549. },
  39550. setHSL: function() {
  39551. function e(e, t, i) {
  39552. return i < 0 && (i += 1),
  39553. i > 1 && (i -= 1),
  39554. i < 1 / 6 ? e + 6 * (t - e) * i : i < .5 ? t : i < 2 / 3 ? e + 6 * (t - e) * (2 / 3 - i) : e
  39555. }
  39556. return function(t, i, r) {
  39557. if (t = n.Math.euclideanModulo(t, 1),
  39558. i = n.Math.clamp(i, 0, 1),
  39559. r = n.Math.clamp(r, 0, 1),
  39560. 0 === i)
  39561. this.r = this.g = this.b = r;
  39562. else {
  39563. var o = r <= .5 ? r * (1 + i) : r + i - r * i
  39564. , a = 2 * r - o;
  39565. this.r = e(a, o, t + 1 / 3),
  39566. this.g = e(a, o, t),
  39567. this.b = e(a, o, t - 1 / 3)
  39568. }
  39569. return this
  39570. }
  39571. }(),
  39572. setStyle: function(e) {
  39573. function t(t) {
  39574. void 0 !== t && parseFloat(t) < 1 && console.warn("THREE.Color: Alpha component of " + e + " will be ignored.")
  39575. }
  39576. var i;
  39577. if (i = /^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(e)) {
  39578. var r, o = i[1], a = i[2];
  39579. switch (o) {
  39580. case "rgb":
  39581. case "rgba":
  39582. if (r = /^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a))
  39583. return this.r = Math.min(255, parseInt(r[1], 10)) / 255,
  39584. this.g = Math.min(255, parseInt(r[2], 10)) / 255,
  39585. this.b = Math.min(255, parseInt(r[3], 10)) / 255,
  39586. t(r[5]),
  39587. this;
  39588. if (r = /^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a))
  39589. return this.r = Math.min(100, parseInt(r[1], 10)) / 100,
  39590. this.g = Math.min(100, parseInt(r[2], 10)) / 100,
  39591. this.b = Math.min(100, parseInt(r[3], 10)) / 100,
  39592. t(r[5]),
  39593. this;
  39594. break;
  39595. case "hsl":
  39596. case "hsla":
  39597. if (r = /^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a)) {
  39598. var s = parseFloat(r[1]) / 360
  39599. , l = parseInt(r[2], 10) / 100
  39600. , c = parseInt(r[3], 10) / 100;
  39601. return t(r[5]),
  39602. this.setHSL(s, l, c)
  39603. }
  39604. }
  39605. } else if (i = /^\#([A-Fa-f0-9]+)$/.exec(e)) {
  39606. var h = i[1]
  39607. , u = h.length;
  39608. if (3 === u)
  39609. return this.r = parseInt(h.charAt(0) + h.charAt(0), 16) / 255,
  39610. this.g = parseInt(h.charAt(1) + h.charAt(1), 16) / 255,
  39611. this.b = parseInt(h.charAt(2) + h.charAt(2), 16) / 255,
  39612. this;
  39613. if (6 === u)
  39614. return this.r = parseInt(h.charAt(0) + h.charAt(1), 16) / 255,
  39615. this.g = parseInt(h.charAt(2) + h.charAt(3), 16) / 255,
  39616. this.b = parseInt(h.charAt(4) + h.charAt(5), 16) / 255,
  39617. this
  39618. }
  39619. if (e && e.length > 0) {
  39620. var h = n.ColorKeywords[e];
  39621. void 0 !== h ? this.setHex(h) : console.warn("THREE.Color: Unknown color " + e)
  39622. }
  39623. return this
  39624. },
  39625. clone: function() {
  39626. return new this.constructor(this.r,this.g,this.b)
  39627. },
  39628. copy: function(e) {
  39629. return this.r = e.r,
  39630. this.g = e.g,
  39631. this.b = e.b,
  39632. this
  39633. },
  39634. copyGammaToLinear: function(e, t) {
  39635. return void 0 === t && (t = 2),
  39636. this.r = Math.pow(e.r, t),
  39637. this.g = Math.pow(e.g, t),
  39638. this.b = Math.pow(e.b, t),
  39639. this
  39640. },
  39641. copyLinearToGamma: function(e, t) {
  39642. void 0 === t && (t = 2);
  39643. var i = t > 0 ? 1 / t : 1;
  39644. return this.r = Math.pow(e.r, i),
  39645. this.g = Math.pow(e.g, i),
  39646. this.b = Math.pow(e.b, i),
  39647. this
  39648. },
  39649. convertGammaToLinear: function() {
  39650. var e = this.r
  39651. , t = this.g
  39652. , i = this.b;
  39653. return this.r = e * e,
  39654. this.g = t * t,
  39655. this.b = i * i,
  39656. this
  39657. },
  39658. convertLinearToGamma: function() {
  39659. return this.r = Math.sqrt(this.r),
  39660. this.g = Math.sqrt(this.g),
  39661. this.b = Math.sqrt(this.b),
  39662. this
  39663. },
  39664. getHex: function() {
  39665. return 255 * this.r << 16 ^ 255 * this.g << 8 ^ 255 * this.b << 0
  39666. },
  39667. getHexString: function() {
  39668. return ("000000" + this.getHex().toString(16)).slice(-6)
  39669. },
  39670. getHSL: function(e) {
  39671. var t, i, n = e || {
  39672. h: 0,
  39673. s: 0,
  39674. l: 0
  39675. }, 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;
  39676. if (l === s)
  39677. t = 0,
  39678. i = 0;
  39679. else {
  39680. var h = s - l;
  39681. switch (i = c <= .5 ? h / (s + l) : h / (2 - s - l),
  39682. s) {
  39683. case r:
  39684. t = (o - a) / h + (o < a ? 6 : 0);
  39685. break;
  39686. case o:
  39687. t = (a - r) / h + 2;
  39688. break;
  39689. case a:
  39690. t = (r - o) / h + 4
  39691. }
  39692. t /= 6
  39693. }
  39694. return n.h = t,
  39695. n.s = i,
  39696. n.l = c,
  39697. n
  39698. },
  39699. getStyle: function() {
  39700. return "rgb(" + (255 * this.r | 0) + "," + (255 * this.g | 0) + "," + (255 * this.b | 0) + ")"
  39701. },
  39702. offsetHSL: function(e, t, i) {
  39703. var n = this.getHSL();
  39704. return n.h += e,
  39705. n.s += t,
  39706. n.l += i,
  39707. this.setHSL(n.h, n.s, n.l),
  39708. this
  39709. },
  39710. add: function(e) {
  39711. return this.r += e.r,
  39712. this.g += e.g,
  39713. this.b += e.b,
  39714. this
  39715. },
  39716. addColors: function(e, t) {
  39717. return this.r = e.r + t.r,
  39718. this.g = e.g + t.g,
  39719. this.b = e.b + t.b,
  39720. this
  39721. },
  39722. addScalar: function(e) {
  39723. return this.r += e,
  39724. this.g += e,
  39725. this.b += e,
  39726. this
  39727. },
  39728. multiply: function(e) {
  39729. return this.r *= e.r,
  39730. this.g *= e.g,
  39731. this.b *= e.b,
  39732. this
  39733. },
  39734. multiplyScalar: function(e) {
  39735. return this.r *= e,
  39736. this.g *= e,
  39737. this.b *= e,
  39738. this
  39739. },
  39740. lerp: function(e, t) {
  39741. return this.r += (e.r - this.r) * t,
  39742. this.g += (e.g - this.g) * t,
  39743. this.b += (e.b - this.b) * t,
  39744. this
  39745. },
  39746. equals: function(e) {
  39747. return e.r === this.r && e.g === this.g && e.b === this.b
  39748. },
  39749. fromArray: function(e, t) {
  39750. return void 0 === t && (t = 0),
  39751. this.r = e[t],
  39752. this.g = e[t + 1],
  39753. this.b = e[t + 2],
  39754. this
  39755. },
  39756. toArray: function(e, t) {
  39757. return void 0 === e && (e = []),
  39758. void 0 === t && (t = 0),
  39759. e[t] = this.r,
  39760. e[t + 1] = this.g,
  39761. e[t + 2] = this.b,
  39762. e
  39763. }
  39764. },
  39765. n.ColorKeywords = {
  39766. aliceblue: 15792383,
  39767. antiquewhite: 16444375,
  39768. aqua: 65535,
  39769. aquamarine: 8388564,
  39770. azure: 15794175,
  39771. beige: 16119260,
  39772. bisque: 16770244,
  39773. black: 0,
  39774. blanchedalmond: 16772045,
  39775. blue: 255,
  39776. blueviolet: 9055202,
  39777. brown: 10824234,
  39778. burlywood: 14596231,
  39779. cadetblue: 6266528,
  39780. chartreuse: 8388352,
  39781. chocolate: 13789470,
  39782. coral: 16744272,
  39783. cornflowerblue: 6591981,
  39784. cornsilk: 16775388,
  39785. crimson: 14423100,
  39786. cyan: 65535,
  39787. darkblue: 139,
  39788. darkcyan: 35723,
  39789. darkgoldenrod: 12092939,
  39790. darkgray: 11119017,
  39791. darkgreen: 25600,
  39792. darkgrey: 11119017,
  39793. darkkhaki: 12433259,
  39794. darkmagenta: 9109643,
  39795. darkolivegreen: 5597999,
  39796. darkorange: 16747520,
  39797. darkorchid: 10040012,
  39798. darkred: 9109504,
  39799. darksalmon: 15308410,
  39800. darkseagreen: 9419919,
  39801. darkslateblue: 4734347,
  39802. darkslategray: 3100495,
  39803. darkslategrey: 3100495,
  39804. darkturquoise: 52945,
  39805. darkviolet: 9699539,
  39806. deeppink: 16716947,
  39807. deepskyblue: 49151,
  39808. dimgray: 6908265,
  39809. dimgrey: 6908265,
  39810. dodgerblue: 2003199,
  39811. firebrick: 11674146,
  39812. floralwhite: 16775920,
  39813. forestgreen: 2263842,
  39814. fuchsia: 16711935,
  39815. gainsboro: 14474460,
  39816. ghostwhite: 16316671,
  39817. gold: 16766720,
  39818. goldenrod: 14329120,
  39819. gray: 8421504,
  39820. green: 32768,
  39821. greenyellow: 11403055,
  39822. grey: 8421504,
  39823. honeydew: 15794160,
  39824. hotpink: 16738740,
  39825. indianred: 13458524,
  39826. indigo: 4915330,
  39827. ivory: 16777200,
  39828. khaki: 15787660,
  39829. lavender: 15132410,
  39830. lavenderblush: 16773365,
  39831. lawngreen: 8190976,
  39832. lemonchiffon: 16775885,
  39833. lightblue: 11393254,
  39834. lightcoral: 15761536,
  39835. lightcyan: 14745599,
  39836. lightgoldenrodyellow: 16448210,
  39837. lightgray: 13882323,
  39838. lightgreen: 9498256,
  39839. lightgrey: 13882323,
  39840. lightpink: 16758465,
  39841. lightsalmon: 16752762,
  39842. lightseagreen: 2142890,
  39843. lightskyblue: 8900346,
  39844. lightslategray: 7833753,
  39845. lightslategrey: 7833753,
  39846. lightsteelblue: 11584734,
  39847. lightyellow: 16777184,
  39848. lime: 65280,
  39849. limegreen: 3329330,
  39850. linen: 16445670,
  39851. magenta: 16711935,
  39852. maroon: 8388608,
  39853. mediumaquamarine: 6737322,
  39854. mediumblue: 205,
  39855. mediumorchid: 12211667,
  39856. mediumpurple: 9662683,
  39857. mediumseagreen: 3978097,
  39858. mediumslateblue: 8087790,
  39859. mediumspringgreen: 64154,
  39860. mediumturquoise: 4772300,
  39861. mediumvioletred: 13047173,
  39862. midnightblue: 1644912,
  39863. mintcream: 16121850,
  39864. mistyrose: 16770273,
  39865. moccasin: 16770229,
  39866. navajowhite: 16768685,
  39867. navy: 128,
  39868. oldlace: 16643558,
  39869. olive: 8421376,
  39870. olivedrab: 7048739,
  39871. orange: 16753920,
  39872. orangered: 16729344,
  39873. orchid: 14315734,
  39874. palegoldenrod: 15657130,
  39875. palegreen: 10025880,
  39876. paleturquoise: 11529966,
  39877. palevioletred: 14381203,
  39878. papayawhip: 16773077,
  39879. peachpuff: 16767673,
  39880. peru: 13468991,
  39881. pink: 16761035,
  39882. plum: 14524637,
  39883. powderblue: 11591910,
  39884. purple: 8388736,
  39885. red: 16711680,
  39886. rosybrown: 12357519,
  39887. royalblue: 4286945,
  39888. saddlebrown: 9127187,
  39889. salmon: 16416882,
  39890. sandybrown: 16032864,
  39891. seagreen: 3050327,
  39892. seashell: 16774638,
  39893. sienna: 10506797,
  39894. silver: 12632256,
  39895. skyblue: 8900331,
  39896. slateblue: 6970061,
  39897. slategray: 7372944,
  39898. slategrey: 7372944,
  39899. snow: 16775930,
  39900. springgreen: 65407,
  39901. steelblue: 4620980,
  39902. tan: 13808780,
  39903. teal: 32896,
  39904. thistle: 14204888,
  39905. tomato: 16737095,
  39906. turquoise: 4251856,
  39907. violet: 15631086,
  39908. wheat: 16113331,
  39909. white: 16777215,
  39910. whitesmoke: 16119285,
  39911. yellow: 16776960,
  39912. yellowgreen: 10145074
  39913. },
  39914. n.Quaternion = function(e, t, i, n) {
  39915. this._x = e || 0,
  39916. this._y = t || 0,
  39917. this._z = i || 0,
  39918. this._w = void 0 !== n ? n : 1
  39919. }
  39920. ,
  39921. n.Quaternion.prototype = {
  39922. constructor: n.Quaternion,
  39923. get x() {
  39924. return this._x
  39925. },
  39926. set x(e) {
  39927. this._x = e,
  39928. this.onChangeCallback()
  39929. },
  39930. get y() {
  39931. return this._y
  39932. },
  39933. set y(e) {
  39934. this._y = e,
  39935. this.onChangeCallback()
  39936. },
  39937. get z() {
  39938. return this._z
  39939. },
  39940. set z(e) {
  39941. this._z = e,
  39942. this.onChangeCallback()
  39943. },
  39944. get w() {
  39945. return this._w
  39946. },
  39947. set w(e) {
  39948. this._w = e,
  39949. this.onChangeCallback()
  39950. },
  39951. set: function(e, t, i, n) {
  39952. return this._x = e,
  39953. this._y = t,
  39954. this._z = i,
  39955. this._w = n,
  39956. this.onChangeCallback(),
  39957. this
  39958. },
  39959. clone: function() {
  39960. return new this.constructor(this._x,this._y,this._z,this._w)
  39961. },
  39962. copy: function(e) {
  39963. return this._x = e.x,
  39964. this._y = e.y,
  39965. this._z = e.z,
  39966. this._w = e.w,
  39967. this.onChangeCallback(),
  39968. this
  39969. },
  39970. setFromEuler: function(e, t) {
  39971. if (e instanceof n.Euler == !1)
  39972. throw new Error("THREE.Quaternion: .setFromEuler() now expects a Euler rotation rather than a Vector3 and order.");
  39973. var i = Math.cos(e._x / 2)
  39974. , r = Math.cos(e._y / 2)
  39975. , o = Math.cos(e._z / 2)
  39976. , a = Math.sin(e._x / 2)
  39977. , s = Math.sin(e._y / 2)
  39978. , l = Math.sin(e._z / 2)
  39979. , c = e.order;
  39980. return "XYZ" === c ? (this._x = a * r * o + i * s * l,
  39981. this._y = i * s * o - a * r * l,
  39982. this._z = i * r * l + a * s * o,
  39983. this._w = i * r * o - a * s * l) : "YXZ" === c ? (this._x = a * r * o + i * s * l,
  39984. this._y = i * s * o - a * r * l,
  39985. this._z = i * r * l - a * s * o,
  39986. this._w = i * r * o + a * s * l) : "ZXY" === c ? (this._x = a * r * o - i * s * l,
  39987. this._y = i * s * o + a * r * l,
  39988. this._z = i * r * l + a * s * o,
  39989. this._w = i * r * o - a * s * l) : "ZYX" === c ? (this._x = a * r * o - i * s * l,
  39990. this._y = i * s * o + a * r * l,
  39991. this._z = i * r * l - a * s * o,
  39992. this._w = i * r * o + a * s * l) : "YZX" === c ? (this._x = a * r * o + i * s * l,
  39993. this._y = i * s * o + a * r * l,
  39994. this._z = i * r * l - a * s * o,
  39995. this._w = i * r * o - a * s * l) : "XZY" === c && (this._x = a * r * o - i * s * l,
  39996. this._y = i * s * o - a * r * l,
  39997. this._z = i * r * l + a * s * o,
  39998. this._w = i * r * o + a * s * l),
  39999. t !== !1 && this.onChangeCallback(),
  40000. this
  40001. },
  40002. setFromAxisAngle: function(e, t) {
  40003. var i = t / 2
  40004. , n = Math.sin(i);
  40005. return this._x = e.x * n,
  40006. this._y = e.y * n,
  40007. this._z = e.z * n,
  40008. this._w = Math.cos(i),
  40009. this.onChangeCallback(),
  40010. this
  40011. },
  40012. setFromRotationMatrix: function(e) {
  40013. 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;
  40014. return d > 0 ? (t = .5 / Math.sqrt(d + 1),
  40015. this._w = .25 / t,
  40016. this._x = (h - l) * t,
  40017. this._y = (o - c) * t,
  40018. this._z = (a - r) * t) : n > s && n > u ? (t = 2 * Math.sqrt(1 + n - s - u),
  40019. this._w = (h - l) / t,
  40020. this._x = .25 * t,
  40021. this._y = (r + a) / t,
  40022. this._z = (o + c) / t) : s > u ? (t = 2 * Math.sqrt(1 + s - n - u),
  40023. this._w = (o - c) / t,
  40024. this._x = (r + a) / t,
  40025. this._y = .25 * t,
  40026. this._z = (l + h) / t) : (t = 2 * Math.sqrt(1 + u - n - s),
  40027. this._w = (a - r) / t,
  40028. this._x = (o + c) / t,
  40029. this._y = (l + h) / t,
  40030. this._z = .25 * t),
  40031. this.onChangeCallback(),
  40032. this
  40033. },
  40034. setFromUnitVectors: function() {
  40035. var e, t, i = 1e-6;
  40036. return function(r, o) {
  40037. return void 0 === e && (e = new n.Vector3),
  40038. t = r.dot(o) + 1,
  40039. t < i ? (t = 0,
  40040. 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),
  40041. this._x = e.x,
  40042. this._y = e.y,
  40043. this._z = e.z,
  40044. this._w = t,
  40045. this.normalize(),
  40046. this
  40047. }
  40048. }(),
  40049. inverse: function() {
  40050. return this.conjugate().normalize(),
  40051. this
  40052. },
  40053. conjugate: function() {
  40054. return this._x *= -1,
  40055. this._y *= -1,
  40056. this._z *= -1,
  40057. this.onChangeCallback(),
  40058. this
  40059. },
  40060. dot: function(e) {
  40061. return this._x * e._x + this._y * e._y + this._z * e._z + this._w * e._w
  40062. },
  40063. lengthSq: function() {
  40064. return this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w
  40065. },
  40066. length: function() {
  40067. return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w)
  40068. },
  40069. normalize: function() {
  40070. var e = this.length();
  40071. return 0 === e ? (this._x = 0,
  40072. this._y = 0,
  40073. this._z = 0,
  40074. this._w = 1) : (e = 1 / e,
  40075. this._x = this._x * e,
  40076. this._y = this._y * e,
  40077. this._z = this._z * e,
  40078. this._w = this._w * e),
  40079. this.onChangeCallback(),
  40080. this
  40081. },
  40082. multiply: function(e, t) {
  40083. return void 0 !== t ? (console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),
  40084. this.multiplyQuaternions(e, t)) : this.multiplyQuaternions(this, e)
  40085. },
  40086. multiplyQuaternions: function(e, t) {
  40087. var i = e._x
  40088. , n = e._y
  40089. , r = e._z
  40090. , o = e._w
  40091. , a = t._x
  40092. , s = t._y
  40093. , l = t._z
  40094. , c = t._w;
  40095. return this._x = i * c + o * a + n * l - r * s,
  40096. this._y = n * c + o * s + r * a - i * l,
  40097. this._z = r * c + o * l + i * s - n * a,
  40098. this._w = o * c - i * a - n * s - r * l,
  40099. this.onChangeCallback(),
  40100. this
  40101. },
  40102. slerp: function(e, t) {
  40103. if (0 === t)
  40104. return this;
  40105. if (1 === t)
  40106. return this.copy(e);
  40107. var i = this._x
  40108. , n = this._y
  40109. , r = this._z
  40110. , o = this._w
  40111. , a = o * e._w + i * e._x + n * e._y + r * e._z;
  40112. if (a < 0 ? (this._w = -e._w,
  40113. this._x = -e._x,
  40114. this._y = -e._y,
  40115. this._z = -e._z,
  40116. a = -a) : this.copy(e),
  40117. a >= 1)
  40118. return this._w = o,
  40119. this._x = i,
  40120. this._y = n,
  40121. this._z = r,
  40122. this;
  40123. var s = Math.sqrt(1 - a * a);
  40124. if (Math.abs(s) < .001)
  40125. return this._w = .5 * (o + this._w),
  40126. this._x = .5 * (i + this._x),
  40127. this._y = .5 * (n + this._y),
  40128. this._z = .5 * (r + this._z),
  40129. this;
  40130. var l = Math.atan2(s, a)
  40131. , c = Math.sin((1 - t) * l) / s
  40132. , h = Math.sin(t * l) / s;
  40133. return this._w = o * c + this._w * h,
  40134. this._x = i * c + this._x * h,
  40135. this._y = n * c + this._y * h,
  40136. this._z = r * c + this._z * h,
  40137. this.onChangeCallback(),
  40138. this
  40139. },
  40140. equals: function(e) {
  40141. return e._x === this._x && e._y === this._y && e._z === this._z && e._w === this._w
  40142. },
  40143. fromArray: function(e, t) {
  40144. return void 0 === t && (t = 0),
  40145. this._x = e[t],
  40146. this._y = e[t + 1],
  40147. this._z = e[t + 2],
  40148. this._w = e[t + 3],
  40149. this.onChangeCallback(),
  40150. this
  40151. },
  40152. toArray: function(e, t) {
  40153. return void 0 === e && (e = []),
  40154. void 0 === t && (t = 0),
  40155. e[t] = this._x,
  40156. e[t + 1] = this._y,
  40157. e[t + 2] = this._z,
  40158. e[t + 3] = this._w,
  40159. e
  40160. },
  40161. onChange: function(e) {
  40162. return this.onChangeCallback = e,
  40163. this
  40164. },
  40165. onChangeCallback: function() {}
  40166. },
  40167. Object.assign(n.Quaternion, {
  40168. slerp: function(e, t, i, n) {
  40169. return i.copy(e).slerp(t, n)
  40170. },
  40171. slerpFlat: function(e, t, i, n, r, o, a) {
  40172. var s = i[n + 0]
  40173. , l = i[n + 1]
  40174. , c = i[n + 2]
  40175. , h = i[n + 3]
  40176. , u = r[o + 0]
  40177. , d = r[o + 1]
  40178. , p = r[o + 2]
  40179. , f = r[o + 3];
  40180. if (h !== f || s !== u || l !== d || c !== p) {
  40181. var g = 1 - a
  40182. , m = s * u + l * d + c * p + h * f
  40183. , v = m >= 0 ? 1 : -1
  40184. , A = 1 - m * m;
  40185. if (A > Number.EPSILON) {
  40186. var y = Math.sqrt(A)
  40187. , C = Math.atan2(y, m * v);
  40188. g = Math.sin(g * C) / y,
  40189. a = Math.sin(a * C) / y
  40190. }
  40191. var I = a * v;
  40192. if (s = s * g + u * I,
  40193. l = l * g + d * I,
  40194. c = c * g + p * I,
  40195. h = h * g + f * I,
  40196. g === 1 - a) {
  40197. var E = 1 / Math.sqrt(s * s + l * l + c * c + h * h);
  40198. s *= E,
  40199. l *= E,
  40200. c *= E,
  40201. h *= E
  40202. }
  40203. }
  40204. e[t] = s,
  40205. e[t + 1] = l,
  40206. e[t + 2] = c,
  40207. e[t + 3] = h
  40208. }
  40209. }),
  40210. n.Vector2 = function(e, t) {
  40211. this.x = e || 0,
  40212. this.y = t || 0
  40213. }
  40214. ,
  40215. n.Vector2.prototype = {
  40216. constructor: n.Vector2,
  40217. get width() {
  40218. return this.x
  40219. },
  40220. set width(e) {
  40221. this.x = e
  40222. },
  40223. get height() {
  40224. return this.y
  40225. },
  40226. set height(e) {
  40227. this.y = e
  40228. },
  40229. set: function(e, t) {
  40230. return this.x = e,
  40231. this.y = t,
  40232. this
  40233. },
  40234. setScalar: function(e) {
  40235. return this.x = e,
  40236. this.y = e,
  40237. this
  40238. },
  40239. setX: function(e) {
  40240. return this.x = e,
  40241. this
  40242. },
  40243. setY: function(e) {
  40244. return this.y = e,
  40245. this
  40246. },
  40247. setComponent: function(e, t) {
  40248. switch (e) {
  40249. case 0:
  40250. this.x = t;
  40251. break;
  40252. case 1:
  40253. this.y = t;
  40254. break;
  40255. default:
  40256. throw new Error("index is out of range: " + e)
  40257. }
  40258. },
  40259. getComponent: function(e) {
  40260. switch (e) {
  40261. case 0:
  40262. return this.x;
  40263. case 1:
  40264. return this.y;
  40265. default:
  40266. throw new Error("index is out of range: " + e)
  40267. }
  40268. },
  40269. clone: function() {
  40270. return new this.constructor(this.x,this.y)
  40271. },
  40272. copy: function(e) {
  40273. return this.x = e.x,
  40274. this.y = e.y,
  40275. this
  40276. },
  40277. add: function(e, t) {
  40278. return void 0 !== t ? (console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),
  40279. this.addVectors(e, t)) : (this.x += e.x,
  40280. this.y += e.y,
  40281. this)
  40282. },
  40283. addScalar: function(e) {
  40284. return this.x += e,
  40285. this.y += e,
  40286. this
  40287. },
  40288. addVectors: function(e, t) {
  40289. return this.x = e.x + t.x,
  40290. this.y = e.y + t.y,
  40291. this
  40292. },
  40293. addScaledVector: function(e, t) {
  40294. return this.x += e.x * t,
  40295. this.y += e.y * t,
  40296. this
  40297. },
  40298. sub: function(e, t) {
  40299. return void 0 !== t ? (console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
  40300. this.subVectors(e, t)) : (this.x -= e.x,
  40301. this.y -= e.y,
  40302. this)
  40303. },
  40304. subScalar: function(e) {
  40305. return this.x -= e,
  40306. this.y -= e,
  40307. this
  40308. },
  40309. subVectors: function(e, t) {
  40310. return this.x = e.x - t.x,
  40311. this.y = e.y - t.y,
  40312. this
  40313. },
  40314. multiply: function(e) {
  40315. return this.x *= e.x,
  40316. this.y *= e.y,
  40317. this
  40318. },
  40319. multiplyScalar: function(e) {
  40320. return isFinite(e) ? (this.x *= e,
  40321. this.y *= e) : (this.x = 0,
  40322. this.y = 0),
  40323. this
  40324. },
  40325. divide: function(e) {
  40326. return this.x /= e.x,
  40327. this.y /= e.y,
  40328. this
  40329. },
  40330. divideScalar: function(e) {
  40331. return this.multiplyScalar(1 / e)
  40332. },
  40333. min: function(e) {
  40334. return this.x = Math.min(this.x, e.x),
  40335. this.y = Math.min(this.y, e.y),
  40336. this
  40337. },
  40338. max: function(e) {
  40339. return this.x = Math.max(this.x, e.x),
  40340. this.y = Math.max(this.y, e.y),
  40341. this
  40342. },
  40343. clamp: function(e, t) {
  40344. return this.x = Math.max(e.x, Math.min(t.x, this.x)),
  40345. this.y = Math.max(e.y, Math.min(t.y, this.y)),
  40346. this
  40347. },
  40348. clampScalar: function() {
  40349. var e, t;
  40350. return function(i, r) {
  40351. return void 0 === e && (e = new n.Vector2,
  40352. t = new n.Vector2),
  40353. e.set(i, i),
  40354. t.set(r, r),
  40355. this.clamp(e, t)
  40356. }
  40357. }(),
  40358. clampLength: function(e, t) {
  40359. var i = this.length();
  40360. return this.multiplyScalar(Math.max(e, Math.min(t, i)) / i),
  40361. this
  40362. },
  40363. floor: function() {
  40364. return this.x = Math.floor(this.x),
  40365. this.y = Math.floor(this.y),
  40366. this
  40367. },
  40368. ceil: function() {
  40369. return this.x = Math.ceil(this.x),
  40370. this.y = Math.ceil(this.y),
  40371. this
  40372. },
  40373. round: function() {
  40374. return this.x = Math.round(this.x),
  40375. this.y = Math.round(this.y),
  40376. this
  40377. },
  40378. roundToZero: function() {
  40379. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x),
  40380. this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y),
  40381. this
  40382. },
  40383. negate: function() {
  40384. return this.x = -this.x,
  40385. this.y = -this.y,
  40386. this
  40387. },
  40388. dot: function(e) {
  40389. return this.x * e.x + this.y * e.y
  40390. },
  40391. lengthSq: function() {
  40392. return this.x * this.x + this.y * this.y
  40393. },
  40394. length: function() {
  40395. return Math.sqrt(this.x * this.x + this.y * this.y)
  40396. },
  40397. lengthManhattan: function() {
  40398. return Math.abs(this.x) + Math.abs(this.y)
  40399. },
  40400. normalize: function() {
  40401. return this.divideScalar(this.length())
  40402. },
  40403. angle: function() {
  40404. var e = Math.atan2(this.y, this.x);
  40405. return e < 0 && (e += 2 * Math.PI),
  40406. e
  40407. },
  40408. distanceTo: function(e) {
  40409. return Math.sqrt(this.distanceToSquared(e))
  40410. },
  40411. distanceToSquared: function(e) {
  40412. var t = this.x - e.x
  40413. , i = this.y - e.y;
  40414. return t * t + i * i
  40415. },
  40416. setLength: function(e) {
  40417. return this.multiplyScalar(e / this.length())
  40418. },
  40419. lerp: function(e, t) {
  40420. return this.x += (e.x - this.x) * t,
  40421. this.y += (e.y - this.y) * t,
  40422. this
  40423. },
  40424. lerpVectors: function(e, t, i) {
  40425. return this.subVectors(t, e).multiplyScalar(i).add(e),
  40426. this
  40427. },
  40428. equals: function(e) {
  40429. return e.x === this.x && e.y === this.y
  40430. },
  40431. fromArray: function(e, t) {
  40432. return void 0 === t && (t = 0),
  40433. this.x = e[t],
  40434. this.y = e[t + 1],
  40435. this
  40436. },
  40437. toArray: function(e, t) {
  40438. return void 0 === e && (e = []),
  40439. void 0 === t && (t = 0),
  40440. e[t] = this.x,
  40441. e[t + 1] = this.y,
  40442. e
  40443. },
  40444. fromAttribute: function(e, t, i) {
  40445. return void 0 === i && (i = 0),
  40446. t = t * e.itemSize + i,
  40447. this.x = e.array[t],
  40448. this.y = e.array[t + 1],
  40449. this
  40450. },
  40451. rotateAround: function(e, t) {
  40452. var i = Math.cos(t)
  40453. , n = Math.sin(t)
  40454. , r = this.x - e.x
  40455. , o = this.y - e.y;
  40456. return this.x = r * i - o * n + e.x,
  40457. this.y = r * n + o * i + e.y,
  40458. this
  40459. }
  40460. },
  40461. n.Vector3 = function(e, t, i) {
  40462. this.x = e || 0,
  40463. this.y = t || 0,
  40464. this.z = i || 0
  40465. }
  40466. ,
  40467. n.Vector3.prototype = {
  40468. constructor: n.Vector3,
  40469. set: function(e, t, i) {
  40470. return this.x = e,
  40471. this.y = t,
  40472. this.z = i,
  40473. this
  40474. },
  40475. setScalar: function(e) {
  40476. return this.x = e,
  40477. this.y = e,
  40478. this.z = e,
  40479. this
  40480. },
  40481. setX: function(e) {
  40482. return this.x = e,
  40483. this
  40484. },
  40485. setY: function(e) {
  40486. return this.y = e,
  40487. this
  40488. },
  40489. setZ: function(e) {
  40490. return this.z = e,
  40491. this
  40492. },
  40493. setComponent: function(e, t) {
  40494. switch (e) {
  40495. case 0:
  40496. this.x = t;
  40497. break;
  40498. case 1:
  40499. this.y = t;
  40500. break;
  40501. case 2:
  40502. this.z = t;
  40503. break;
  40504. default:
  40505. throw new Error("index is out of range: " + e)
  40506. }
  40507. },
  40508. getComponent: function(e) {
  40509. switch (e) {
  40510. case 0:
  40511. return this.x;
  40512. case 1:
  40513. return this.y;
  40514. case 2:
  40515. return this.z;
  40516. default:
  40517. throw new Error("index is out of range: " + e)
  40518. }
  40519. },
  40520. clone: function() {
  40521. return new this.constructor(this.x,this.y,this.z)
  40522. },
  40523. copy: function(e) {
  40524. return this.x = e.x,
  40525. this.y = e.y,
  40526. this.z = e.z,
  40527. this
  40528. },
  40529. add: function(e, t) {
  40530. return void 0 !== t ? (console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),
  40531. this.addVectors(e, t)) : (this.x += e.x,
  40532. this.y += e.y,
  40533. this.z += e.z,
  40534. this)
  40535. },
  40536. addScalar: function(e) {
  40537. return this.x += e,
  40538. this.y += e,
  40539. this.z += e,
  40540. this
  40541. },
  40542. addVectors: function(e, t) {
  40543. return this.x = e.x + t.x,
  40544. this.y = e.y + t.y,
  40545. this.z = e.z + t.z,
  40546. this
  40547. },
  40548. addScaledVector: function(e, t) {
  40549. return this.x += e.x * t,
  40550. this.y += e.y * t,
  40551. this.z += e.z * t,
  40552. this
  40553. },
  40554. sub: function(e, t) {
  40555. return void 0 !== t ? (console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
  40556. this.subVectors(e, t)) : (this.x -= e.x,
  40557. this.y -= e.y,
  40558. this.z -= e.z,
  40559. this)
  40560. },
  40561. subScalar: function(e) {
  40562. return this.x -= e,
  40563. this.y -= e,
  40564. this.z -= e,
  40565. this
  40566. },
  40567. subVectors: function(e, t) {
  40568. return this.x = e.x - t.x,
  40569. this.y = e.y - t.y,
  40570. this.z = e.z - t.z,
  40571. this
  40572. },
  40573. multiply: function(e, t) {
  40574. return void 0 !== t ? (console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),
  40575. this.multiplyVectors(e, t)) : (this.x *= e.x,
  40576. this.y *= e.y,
  40577. this.z *= e.z,
  40578. this)
  40579. },
  40580. multiplyScalar: function(e) {
  40581. return isFinite(e) ? (this.x *= e,
  40582. this.y *= e,
  40583. this.z *= e) : (this.x = 0,
  40584. this.y = 0,
  40585. this.z = 0),
  40586. this
  40587. },
  40588. multiplyVectors: function(e, t) {
  40589. return this.x = e.x * t.x,
  40590. this.y = e.y * t.y,
  40591. this.z = e.z * t.z,
  40592. this
  40593. },
  40594. applyEuler: function() {
  40595. var e;
  40596. return function(t) {
  40597. return t instanceof n.Euler == !1 && console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),
  40598. void 0 === e && (e = new n.Quaternion),
  40599. this.applyQuaternion(e.setFromEuler(t)),
  40600. this
  40601. }
  40602. }(),
  40603. applyAxisAngle: function() {
  40604. var e;
  40605. return function(t, i) {
  40606. return void 0 === e && (e = new n.Quaternion),
  40607. this.applyQuaternion(e.setFromAxisAngle(t, i)),
  40608. this
  40609. }
  40610. }(),
  40611. applyMatrix3: function(e) {
  40612. var t = this.x
  40613. , i = this.y
  40614. , n = this.z
  40615. , r = e.elements;
  40616. return this.x = r[0] * t + r[3] * i + r[6] * n,
  40617. this.y = r[1] * t + r[4] * i + r[7] * n,
  40618. this.z = r[2] * t + r[5] * i + r[8] * n,
  40619. this
  40620. },
  40621. applyMatrix4: function(e) {
  40622. var t = this.x
  40623. , i = this.y
  40624. , n = this.z
  40625. , r = e.elements;
  40626. return this.x = r[0] * t + r[4] * i + r[8] * n + r[12],
  40627. this.y = r[1] * t + r[5] * i + r[9] * n + r[13],
  40628. this.z = r[2] * t + r[6] * i + r[10] * n + r[14],
  40629. this
  40630. },
  40631. applyProjection: function(e) {
  40632. var t = this.x
  40633. , i = this.y
  40634. , n = this.z
  40635. , r = e.elements
  40636. , o = 1 / (r[3] * t + r[7] * i + r[11] * n + r[15]);
  40637. return this.x = (r[0] * t + r[4] * i + r[8] * n + r[12]) * o,
  40638. this.y = (r[1] * t + r[5] * i + r[9] * n + r[13]) * o,
  40639. this.z = (r[2] * t + r[6] * i + r[10] * n + r[14]) * o,
  40640. this
  40641. },
  40642. applyQuaternion: function(e) {
  40643. var t = this.x
  40644. , i = this.y
  40645. , n = this.z
  40646. , r = e.x
  40647. , o = e.y
  40648. , a = e.z
  40649. , s = e.w
  40650. , l = s * t + o * n - a * i
  40651. , c = s * i + a * t - r * n
  40652. , h = s * n + r * i - o * t
  40653. , u = -r * t - o * i - a * n;
  40654. return this.x = l * s + u * -r + c * -a - h * -o,
  40655. this.y = c * s + u * -o + h * -r - l * -a,
  40656. this.z = h * s + u * -a + l * -o - c * -r,
  40657. this
  40658. },
  40659. project: function() {
  40660. var e;
  40661. return function(t) {
  40662. return void 0 === e && (e = new n.Matrix4),
  40663. e.multiplyMatrices(t.projectionMatrix, e.getInverse(t.matrixWorld)),
  40664. this.applyProjection(e)
  40665. }
  40666. }(),
  40667. unproject: function() {
  40668. var e;
  40669. return function(t) {
  40670. return void 0 === e && (e = new n.Matrix4),
  40671. e.multiplyMatrices(t.matrixWorld, e.getInverse(t.projectionMatrix)),
  40672. this.applyProjection(e)
  40673. }
  40674. }(),
  40675. transformDirection: function(e) {
  40676. var t = this.x
  40677. , i = this.y
  40678. , n = this.z
  40679. , r = e.elements;
  40680. return this.x = r[0] * t + r[4] * i + r[8] * n,
  40681. this.y = r[1] * t + r[5] * i + r[9] * n,
  40682. this.z = r[2] * t + r[6] * i + r[10] * n,
  40683. this.normalize(),
  40684. this
  40685. },
  40686. divide: function(e) {
  40687. return this.x /= e.x,
  40688. this.y /= e.y,
  40689. this.z /= e.z,
  40690. this
  40691. },
  40692. divideScalar: function(e) {
  40693. return this.multiplyScalar(1 / e)
  40694. },
  40695. min: function(e) {
  40696. return this.x = Math.min(this.x, e.x),
  40697. this.y = Math.min(this.y, e.y),
  40698. this.z = Math.min(this.z, e.z),
  40699. this
  40700. },
  40701. max: function(e) {
  40702. return this.x = Math.max(this.x, e.x),
  40703. this.y = Math.max(this.y, e.y),
  40704. this.z = Math.max(this.z, e.z),
  40705. this
  40706. },
  40707. clamp: function(e, t) {
  40708. return this.x = Math.max(e.x, Math.min(t.x, this.x)),
  40709. this.y = Math.max(e.y, Math.min(t.y, this.y)),
  40710. this.z = Math.max(e.z, Math.min(t.z, this.z)),
  40711. this
  40712. },
  40713. clampScalar: function() {
  40714. var e, t;
  40715. return function(i, r) {
  40716. return void 0 === e && (e = new n.Vector3,
  40717. t = new n.Vector3),
  40718. e.set(i, i, i),
  40719. t.set(r, r, r),
  40720. this.clamp(e, t)
  40721. }
  40722. }(),
  40723. clampLength: function(e, t) {
  40724. var i = this.length();
  40725. return this.multiplyScalar(Math.max(e, Math.min(t, i)) / i),
  40726. this
  40727. },
  40728. floor: function() {
  40729. return this.x = Math.floor(this.x),
  40730. this.y = Math.floor(this.y),
  40731. this.z = Math.floor(this.z),
  40732. this
  40733. },
  40734. ceil: function() {
  40735. return this.x = Math.ceil(this.x),
  40736. this.y = Math.ceil(this.y),
  40737. this.z = Math.ceil(this.z),
  40738. this
  40739. },
  40740. round: function() {
  40741. return this.x = Math.round(this.x),
  40742. this.y = Math.round(this.y),
  40743. this.z = Math.round(this.z),
  40744. this
  40745. },
  40746. roundToZero: function() {
  40747. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x),
  40748. this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y),
  40749. this.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z),
  40750. this
  40751. },
  40752. negate: function() {
  40753. return this.x = -this.x,
  40754. this.y = -this.y,
  40755. this.z = -this.z,
  40756. this
  40757. },
  40758. dot: function(e) {
  40759. return this.x * e.x + this.y * e.y + this.z * e.z
  40760. },
  40761. lengthSq: function() {
  40762. return this.x * this.x + this.y * this.y + this.z * this.z
  40763. },
  40764. length: function() {
  40765. return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z)
  40766. },
  40767. lengthManhattan: function() {
  40768. return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z)
  40769. },
  40770. normalize: function() {
  40771. return this.divideScalar(this.length())
  40772. },
  40773. setLength: function(e) {
  40774. return this.multiplyScalar(e / this.length())
  40775. },
  40776. lerp: function(e, t) {
  40777. return this.x += (e.x - this.x) * t,
  40778. this.y += (e.y - this.y) * t,
  40779. this.z += (e.z - this.z) * t,
  40780. this
  40781. },
  40782. lerpVectors: function(e, t, i) {
  40783. return this.subVectors(t, e).multiplyScalar(i).add(e),
  40784. this
  40785. },
  40786. cross: function(e, t) {
  40787. if (void 0 !== t)
  40788. return console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),
  40789. this.crossVectors(e, t);
  40790. var i = this.x
  40791. , n = this.y
  40792. , r = this.z;
  40793. return this.x = n * e.z - r * e.y,
  40794. this.y = r * e.x - i * e.z,
  40795. this.z = i * e.y - n * e.x,
  40796. this
  40797. },
  40798. crossVectors: function(e, t) {
  40799. var i = e.x
  40800. , n = e.y
  40801. , r = e.z
  40802. , o = t.x
  40803. , a = t.y
  40804. , s = t.z;
  40805. return this.x = n * s - r * a,
  40806. this.y = r * o - i * s,
  40807. this.z = i * a - n * o,
  40808. this
  40809. },
  40810. projectOnVector: function() {
  40811. var e, t;
  40812. return function(i) {
  40813. return void 0 === e && (e = new n.Vector3),
  40814. e.copy(i).normalize(),
  40815. t = this.dot(e),
  40816. this.copy(e).multiplyScalar(t)
  40817. }
  40818. }(),
  40819. projectOnPlane: function() {
  40820. var e;
  40821. return function(t) {
  40822. return void 0 === e && (e = new n.Vector3),
  40823. e.copy(this).projectOnVector(t),
  40824. this.sub(e)
  40825. }
  40826. }(),
  40827. reflect: function() {
  40828. var e;
  40829. return function(t) {
  40830. return void 0 === e && (e = new n.Vector3),
  40831. this.sub(e.copy(t).multiplyScalar(2 * this.dot(t)))
  40832. }
  40833. }(),
  40834. angleTo: function(e) {
  40835. var t = this.dot(e) / Math.sqrt(this.lengthSq() * e.lengthSq());
  40836. return Math.acos(n.Math.clamp(t, -1, 1))
  40837. },
  40838. distanceTo: function(e) {
  40839. return Math.sqrt(this.distanceToSquared(e))
  40840. },
  40841. distanceToSquared: function(e) {
  40842. var t = this.x - e.x
  40843. , i = this.y - e.y
  40844. , n = this.z - e.z;
  40845. return t * t + i * i + n * n
  40846. },
  40847. setFromSpherical: function(e) {
  40848. var t = Math.sin(e.phi) * e.radius;
  40849. return this.x = t * Math.sin(e.theta),
  40850. this.y = Math.cos(e.phi) * e.radius,
  40851. this.z = t * Math.cos(e.theta),
  40852. this
  40853. },
  40854. setFromMatrixPosition: function(e) {
  40855. return this.setFromMatrixColumn(e, 3)
  40856. },
  40857. setFromMatrixScale: function(e) {
  40858. var t = this.setFromMatrixColumn(e, 0).length()
  40859. , i = this.setFromMatrixColumn(e, 1).length()
  40860. , n = this.setFromMatrixColumn(e, 2).length();
  40861. return this.x = t,
  40862. this.y = i,
  40863. this.z = n,
  40864. this
  40865. },
  40866. setFromMatrixColumn: function(e, t) {
  40867. return "number" == typeof e && (console.warn("THREE.Vector3: setFromMatrixColumn now expects ( matrix, index )."),
  40868. e = arguments[1],
  40869. t = arguments[0]),
  40870. this.fromArray(e.elements, 4 * t)
  40871. },
  40872. equals: function(e) {
  40873. return e.x === this.x && e.y === this.y && e.z === this.z
  40874. },
  40875. fromArray: function(e, t) {
  40876. return void 0 === t && (t = 0),
  40877. this.x = e[t],
  40878. this.y = e[t + 1],
  40879. this.z = e[t + 2],
  40880. this
  40881. },
  40882. toArray: function(e, t) {
  40883. return void 0 === e && (e = []),
  40884. void 0 === t && (t = 0),
  40885. e[t] = this.x,
  40886. e[t + 1] = this.y,
  40887. e[t + 2] = this.z,
  40888. e
  40889. },
  40890. fromAttribute: function(e, t, i) {
  40891. return void 0 === i && (i = 0),
  40892. t = t * e.itemSize + i,
  40893. this.x = e.array[t],
  40894. this.y = e.array[t + 1],
  40895. this.z = e.array[t + 2],
  40896. this
  40897. }
  40898. },
  40899. n.Vector4 = function(e, t, i, n) {
  40900. this.x = e || 0,
  40901. this.y = t || 0,
  40902. this.z = i || 0,
  40903. this.w = void 0 !== n ? n : 1
  40904. }
  40905. ,
  40906. n.Vector4.prototype = {
  40907. constructor: n.Vector4,
  40908. set: function(e, t, i, n) {
  40909. return this.x = e,
  40910. this.y = t,
  40911. this.z = i,
  40912. this.w = n,
  40913. this
  40914. },
  40915. setScalar: function(e) {
  40916. return this.x = e,
  40917. this.y = e,
  40918. this.z = e,
  40919. this.w = e,
  40920. this
  40921. },
  40922. setX: function(e) {
  40923. return this.x = e,
  40924. this
  40925. },
  40926. setY: function(e) {
  40927. return this.y = e,
  40928. this
  40929. },
  40930. setZ: function(e) {
  40931. return this.z = e,
  40932. this
  40933. },
  40934. setW: function(e) {
  40935. return this.w = e,
  40936. this
  40937. },
  40938. setComponent: function(e, t) {
  40939. switch (e) {
  40940. case 0:
  40941. this.x = t;
  40942. break;
  40943. case 1:
  40944. this.y = t;
  40945. break;
  40946. case 2:
  40947. this.z = t;
  40948. break;
  40949. case 3:
  40950. this.w = t;
  40951. break;
  40952. default:
  40953. throw new Error("index is out of range: " + e)
  40954. }
  40955. },
  40956. getComponent: function(e) {
  40957. switch (e) {
  40958. case 0:
  40959. return this.x;
  40960. case 1:
  40961. return this.y;
  40962. case 2:
  40963. return this.z;
  40964. case 3:
  40965. return this.w;
  40966. default:
  40967. throw new Error("index is out of range: " + e)
  40968. }
  40969. },
  40970. clone: function() {
  40971. return new this.constructor(this.x,this.y,this.z,this.w)
  40972. },
  40973. copy: function(e) {
  40974. return this.x = e.x,
  40975. this.y = e.y,
  40976. this.z = e.z,
  40977. this.w = void 0 !== e.w ? e.w : 1,
  40978. this
  40979. },
  40980. add: function(e, t) {
  40981. return void 0 !== t ? (console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),
  40982. this.addVectors(e, t)) : (this.x += e.x,
  40983. this.y += e.y,
  40984. this.z += e.z,
  40985. this.w += e.w,
  40986. this)
  40987. },
  40988. addScalar: function(e) {
  40989. return this.x += e,
  40990. this.y += e,
  40991. this.z += e,
  40992. this.w += e,
  40993. this
  40994. },
  40995. addVectors: function(e, t) {
  40996. return this.x = e.x + t.x,
  40997. this.y = e.y + t.y,
  40998. this.z = e.z + t.z,
  40999. this.w = e.w + t.w,
  41000. this
  41001. },
  41002. addScaledVector: function(e, t) {
  41003. return this.x += e.x * t,
  41004. this.y += e.y * t,
  41005. this.z += e.z * t,
  41006. this.w += e.w * t,
  41007. this
  41008. },
  41009. sub: function(e, t) {
  41010. return void 0 !== t ? (console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
  41011. this.subVectors(e, t)) : (this.x -= e.x,
  41012. this.y -= e.y,
  41013. this.z -= e.z,
  41014. this.w -= e.w,
  41015. this)
  41016. },
  41017. subScalar: function(e) {
  41018. return this.x -= e,
  41019. this.y -= e,
  41020. this.z -= e,
  41021. this.w -= e,
  41022. this
  41023. },
  41024. subVectors: function(e, t) {
  41025. return this.x = e.x - t.x,
  41026. this.y = e.y - t.y,
  41027. this.z = e.z - t.z,
  41028. this.w = e.w - t.w,
  41029. this
  41030. },
  41031. multiplyScalar: function(e) {
  41032. return isFinite(e) ? (this.x *= e,
  41033. this.y *= e,
  41034. this.z *= e,
  41035. this.w *= e) : (this.x = 0,
  41036. this.y = 0,
  41037. this.z = 0,
  41038. this.w = 0),
  41039. this
  41040. },
  41041. applyMatrix4: function(e) {
  41042. var t = this.x
  41043. , i = this.y
  41044. , n = this.z
  41045. , r = this.w
  41046. , o = e.elements;
  41047. return this.x = o[0] * t + o[4] * i + o[8] * n + o[12] * r,
  41048. this.y = o[1] * t + o[5] * i + o[9] * n + o[13] * r,
  41049. this.z = o[2] * t + o[6] * i + o[10] * n + o[14] * r,
  41050. this.w = o[3] * t + o[7] * i + o[11] * n + o[15] * r,
  41051. this
  41052. },
  41053. divideScalar: function(e) {
  41054. return this.multiplyScalar(1 / e)
  41055. },
  41056. setAxisAngleFromQuaternion: function(e) {
  41057. this.w = 2 * Math.acos(e.w);
  41058. var t = Math.sqrt(1 - e.w * e.w);
  41059. return t < 1e-4 ? (this.x = 1,
  41060. this.y = 0,
  41061. this.z = 0) : (this.x = e.x / t,
  41062. this.y = e.y / t,
  41063. this.z = e.z / t),
  41064. this
  41065. },
  41066. setAxisAngleFromRotationMatrix: function(e) {
  41067. 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];
  41068. if (Math.abs(c - u) < o && Math.abs(h - f) < o && Math.abs(p - g) < o) {
  41069. if (Math.abs(c + u) < a && Math.abs(h + f) < a && Math.abs(p + g) < a && Math.abs(l + d + m - 3) < a)
  41070. return this.set(1, 0, 0, 0),
  41071. this;
  41072. t = Math.PI;
  41073. var v = (l + 1) / 2
  41074. , A = (d + 1) / 2
  41075. , y = (m + 1) / 2
  41076. , C = (c + u) / 4
  41077. , I = (h + f) / 4
  41078. , E = (p + g) / 4;
  41079. return v > A && v > y ? v < o ? (i = 0,
  41080. n = .707106781,
  41081. r = .707106781) : (i = Math.sqrt(v),
  41082. n = C / i,
  41083. r = I / i) : A > y ? A < o ? (i = .707106781,
  41084. n = 0,
  41085. r = .707106781) : (n = Math.sqrt(A),
  41086. i = C / n,
  41087. r = E / n) : y < o ? (i = .707106781,
  41088. n = .707106781,
  41089. r = 0) : (r = Math.sqrt(y),
  41090. i = I / r,
  41091. n = E / r),
  41092. this.set(i, n, r, t),
  41093. this
  41094. }
  41095. var b = Math.sqrt((g - p) * (g - p) + (h - f) * (h - f) + (u - c) * (u - c));
  41096. return Math.abs(b) < .001 && (b = 1),
  41097. this.x = (g - p) / b,
  41098. this.y = (h - f) / b,
  41099. this.z = (u - c) / b,
  41100. this.w = Math.acos((l + d + m - 1) / 2),
  41101. this
  41102. },
  41103. min: function(e) {
  41104. return this.x = Math.min(this.x, e.x),
  41105. this.y = Math.min(this.y, e.y),
  41106. this.z = Math.min(this.z, e.z),
  41107. this.w = Math.min(this.w, e.w),
  41108. this
  41109. },
  41110. max: function(e) {
  41111. return this.x = Math.max(this.x, e.x),
  41112. this.y = Math.max(this.y, e.y),
  41113. this.z = Math.max(this.z, e.z),
  41114. this.w = Math.max(this.w, e.w),
  41115. this
  41116. },
  41117. clamp: function(e, t) {
  41118. return this.x = Math.max(e.x, Math.min(t.x, this.x)),
  41119. this.y = Math.max(e.y, Math.min(t.y, this.y)),
  41120. this.z = Math.max(e.z, Math.min(t.z, this.z)),
  41121. this.w = Math.max(e.w, Math.min(t.w, this.w)),
  41122. this
  41123. },
  41124. clampScalar: function() {
  41125. var e, t;
  41126. return function(i, r) {
  41127. return void 0 === e && (e = new n.Vector4,
  41128. t = new n.Vector4),
  41129. e.set(i, i, i, i),
  41130. t.set(r, r, r, r),
  41131. this.clamp(e, t)
  41132. }
  41133. }(),
  41134. floor: function() {
  41135. return this.x = Math.floor(this.x),
  41136. this.y = Math.floor(this.y),
  41137. this.z = Math.floor(this.z),
  41138. this.w = Math.floor(this.w),
  41139. this
  41140. },
  41141. ceil: function() {
  41142. return this.x = Math.ceil(this.x),
  41143. this.y = Math.ceil(this.y),
  41144. this.z = Math.ceil(this.z),
  41145. this.w = Math.ceil(this.w),
  41146. this
  41147. },
  41148. round: function() {
  41149. return this.x = Math.round(this.x),
  41150. this.y = Math.round(this.y),
  41151. this.z = Math.round(this.z),
  41152. this.w = Math.round(this.w),
  41153. this
  41154. },
  41155. roundToZero: function() {
  41156. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x),
  41157. this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y),
  41158. this.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z),
  41159. this.w = this.w < 0 ? Math.ceil(this.w) : Math.floor(this.w),
  41160. this
  41161. },
  41162. negate: function() {
  41163. return this.x = -this.x,
  41164. this.y = -this.y,
  41165. this.z = -this.z,
  41166. this.w = -this.w,
  41167. this
  41168. },
  41169. dot: function(e) {
  41170. return this.x * e.x + this.y * e.y + this.z * e.z + this.w * e.w
  41171. },
  41172. lengthSq: function() {
  41173. return this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w
  41174. },
  41175. length: function() {
  41176. return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w)
  41177. },
  41178. lengthManhattan: function() {
  41179. return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z) + Math.abs(this.w)
  41180. },
  41181. normalize: function() {
  41182. return this.divideScalar(this.length())
  41183. },
  41184. setLength: function(e) {
  41185. return this.multiplyScalar(e / this.length())
  41186. },
  41187. lerp: function(e, t) {
  41188. return this.x += (e.x - this.x) * t,
  41189. this.y += (e.y - this.y) * t,
  41190. this.z += (e.z - this.z) * t,
  41191. this.w += (e.w - this.w) * t,
  41192. this
  41193. },
  41194. lerpVectors: function(e, t, i) {
  41195. return this.subVectors(t, e).multiplyScalar(i).add(e),
  41196. this
  41197. },
  41198. equals: function(e) {
  41199. return e.x === this.x && e.y === this.y && e.z === this.z && e.w === this.w
  41200. },
  41201. fromArray: function(e, t) {
  41202. return void 0 === t && (t = 0),
  41203. this.x = e[t],
  41204. this.y = e[t + 1],
  41205. this.z = e[t + 2],
  41206. this.w = e[t + 3],
  41207. this
  41208. },
  41209. toArray: function(e, t) {
  41210. return void 0 === e && (e = []),
  41211. void 0 === t && (t = 0),
  41212. e[t] = this.x,
  41213. e[t + 1] = this.y,
  41214. e[t + 2] = this.z,
  41215. e[t + 3] = this.w,
  41216. e
  41217. },
  41218. fromAttribute: function(e, t, i) {
  41219. return void 0 === i && (i = 0),
  41220. t = t * e.itemSize + i,
  41221. this.x = e.array[t],
  41222. this.y = e.array[t + 1],
  41223. this.z = e.array[t + 2],
  41224. this.w = e.array[t + 3],
  41225. this
  41226. }
  41227. },
  41228. n.Euler = function(e, t, i, r) {
  41229. this._x = e || 0,
  41230. this._y = t || 0,
  41231. this._z = i || 0,
  41232. this._order = r || n.Euler.DefaultOrder
  41233. }
  41234. ,
  41235. n.Euler.RotationOrders = ["XYZ", "YZX", "ZXY", "XZY", "YXZ", "ZYX"],
  41236. n.Euler.DefaultOrder = "XYZ",
  41237. n.Euler.prototype = {
  41238. constructor: n.Euler,
  41239. get x() {
  41240. return this._x
  41241. },
  41242. set x(e) {
  41243. this._x = e,
  41244. this.onChangeCallback()
  41245. },
  41246. get y() {
  41247. return this._y
  41248. },
  41249. set y(e) {
  41250. this._y = e,
  41251. this.onChangeCallback()
  41252. },
  41253. get z() {
  41254. return this._z
  41255. },
  41256. set z(e) {
  41257. this._z = e,
  41258. this.onChangeCallback()
  41259. },
  41260. get order() {
  41261. return this._order
  41262. },
  41263. set order(e) {
  41264. this._order = e,
  41265. this.onChangeCallback()
  41266. },
  41267. set: function(e, t, i, n) {
  41268. return this._x = e,
  41269. this._y = t,
  41270. this._z = i,
  41271. this._order = n || this._order,
  41272. this.onChangeCallback(),
  41273. this
  41274. },
  41275. clone: function() {
  41276. return new this.constructor(this._x,this._y,this._z,this._order)
  41277. },
  41278. copy: function(e) {
  41279. return this._x = e._x,
  41280. this._y = e._y,
  41281. this._z = e._z,
  41282. this._order = e._order,
  41283. this.onChangeCallback(),
  41284. this
  41285. },
  41286. setFromRotationMatrix: function(e, t, i) {
  41287. var r = n.Math.clamp
  41288. , o = e.elements
  41289. , a = o[0]
  41290. , s = o[4]
  41291. , l = o[8]
  41292. , c = o[1]
  41293. , h = o[5]
  41294. , u = o[9]
  41295. , d = o[2]
  41296. , p = o[6]
  41297. , f = o[10];
  41298. return t = t || this._order,
  41299. "XYZ" === t ? (this._y = Math.asin(r(l, -1, 1)),
  41300. Math.abs(l) < .99999 ? (this._x = Math.atan2(-u, f),
  41301. this._z = Math.atan2(-s, a)) : (this._x = Math.atan2(p, h),
  41302. this._z = 0)) : "YXZ" === t ? (this._x = Math.asin(-r(u, -1, 1)),
  41303. Math.abs(u) < .99999 ? (this._y = Math.atan2(l, f),
  41304. this._z = Math.atan2(c, h)) : (this._y = Math.atan2(-d, a),
  41305. this._z = 0)) : "ZXY" === t ? (this._x = Math.asin(r(p, -1, 1)),
  41306. Math.abs(p) < .99999 ? (this._y = Math.atan2(-d, f),
  41307. this._z = Math.atan2(-s, h)) : (this._y = 0,
  41308. this._z = Math.atan2(c, a))) : "ZYX" === t ? (this._y = Math.asin(-r(d, -1, 1)),
  41309. Math.abs(d) < .99999 ? (this._x = Math.atan2(p, f),
  41310. this._z = Math.atan2(c, a)) : (this._x = 0,
  41311. this._z = Math.atan2(-s, h))) : "YZX" === t ? (this._z = Math.asin(r(c, -1, 1)),
  41312. Math.abs(c) < .99999 ? (this._x = Math.atan2(-u, h),
  41313. this._y = Math.atan2(-d, a)) : (this._x = 0,
  41314. this._y = Math.atan2(l, f))) : "XZY" === t ? (this._z = Math.asin(-r(s, -1, 1)),
  41315. Math.abs(s) < .99999 ? (this._x = Math.atan2(p, h),
  41316. this._y = Math.atan2(l, a)) : (this._x = Math.atan2(-u, f),
  41317. this._y = 0)) : console.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: " + t),
  41318. this._order = t,
  41319. i !== !1 && this.onChangeCallback(),
  41320. this
  41321. },
  41322. setFromQuaternion: function() {
  41323. var e;
  41324. return function(t, i, r) {
  41325. return void 0 === e && (e = new n.Matrix4),
  41326. e.makeRotationFromQuaternion(t),
  41327. this.setFromRotationMatrix(e, i, r),
  41328. this
  41329. }
  41330. }(),
  41331. setFromVector3: function(e, t) {
  41332. return this.set(e.x, e.y, e.z, t || this._order)
  41333. },
  41334. reorder: function() {
  41335. var e = new n.Quaternion;
  41336. return function(t) {
  41337. e.setFromEuler(this),
  41338. this.setFromQuaternion(e, t)
  41339. }
  41340. }(),
  41341. equals: function(e) {
  41342. return e._x === this._x && e._y === this._y && e._z === this._z && e._order === this._order
  41343. },
  41344. fromArray: function(e) {
  41345. return this._x = e[0],
  41346. this._y = e[1],
  41347. this._z = e[2],
  41348. void 0 !== e[3] && (this._order = e[3]),
  41349. this.onChangeCallback(),
  41350. this
  41351. },
  41352. toArray: function(e, t) {
  41353. return void 0 === e && (e = []),
  41354. void 0 === t && (t = 0),
  41355. e[t] = this._x,
  41356. e[t + 1] = this._y,
  41357. e[t + 2] = this._z,
  41358. e[t + 3] = this._order,
  41359. e
  41360. },
  41361. toVector3: function(e) {
  41362. return e ? e.set(this._x, this._y, this._z) : new n.Vector3(this._x,this._y,this._z)
  41363. },
  41364. onChange: function(e) {
  41365. return this.onChangeCallback = e,
  41366. this
  41367. },
  41368. onChangeCallback: function() {}
  41369. },
  41370. n.Line3 = function(e, t) {
  41371. this.start = void 0 !== e ? e : new n.Vector3,
  41372. this.end = void 0 !== t ? t : new n.Vector3
  41373. }
  41374. ,
  41375. n.Line3.prototype = {
  41376. constructor: n.Line3,
  41377. set: function(e, t) {
  41378. return this.start.copy(e),
  41379. this.end.copy(t),
  41380. this
  41381. },
  41382. clone: function() {
  41383. return (new this.constructor).copy(this)
  41384. },
  41385. copy: function(e) {
  41386. return this.start.copy(e.start),
  41387. this.end.copy(e.end),
  41388. this
  41389. },
  41390. center: function(e) {
  41391. var t = e || new n.Vector3;
  41392. return t.addVectors(this.start, this.end).multiplyScalar(.5)
  41393. },
  41394. delta: function(e) {
  41395. var t = e || new n.Vector3;
  41396. return t.subVectors(this.end, this.start)
  41397. },
  41398. distanceSq: function() {
  41399. return this.start.distanceToSquared(this.end)
  41400. },
  41401. distance: function() {
  41402. return this.start.distanceTo(this.end)
  41403. },
  41404. at: function(e, t) {
  41405. var i = t || new n.Vector3;
  41406. return this.delta(i).multiplyScalar(e).add(this.start)
  41407. },
  41408. closestPointToPointParameter: function() {
  41409. var e = new n.Vector3
  41410. , t = new n.Vector3;
  41411. return function(i, r) {
  41412. e.subVectors(i, this.start),
  41413. t.subVectors(this.end, this.start);
  41414. var o = t.dot(t)
  41415. , a = t.dot(e)
  41416. , s = a / o;
  41417. return r && (s = n.Math.clamp(s, 0, 1)),
  41418. s
  41419. }
  41420. }(),
  41421. closestPointToPoint: function(e, t, i) {
  41422. var r = this.closestPointToPointParameter(e, t)
  41423. , o = i || new n.Vector3;
  41424. return this.delta(o).multiplyScalar(r).add(this.start)
  41425. },
  41426. applyMatrix4: function(e) {
  41427. return this.start.applyMatrix4(e),
  41428. this.end.applyMatrix4(e),
  41429. this
  41430. },
  41431. equals: function(e) {
  41432. return e.start.equals(this.start) && e.end.equals(this.end)
  41433. }
  41434. },
  41435. n.Box2 = function(e, t) {
  41436. this.min = void 0 !== e ? e : new n.Vector2(+(1 / 0),+(1 / 0)),
  41437. this.max = void 0 !== t ? t : new n.Vector2(-(1 / 0),-(1 / 0))
  41438. }
  41439. ,
  41440. n.Box2.prototype = {
  41441. constructor: n.Box2,
  41442. set: function(e, t) {
  41443. return this.min.copy(e),
  41444. this.max.copy(t),
  41445. this
  41446. },
  41447. setFromPoints: function(e) {
  41448. this.makeEmpty();
  41449. for (var t = 0, i = e.length; t < i; t++)
  41450. this.expandByPoint(e[t]);
  41451. return this
  41452. },
  41453. setFromCenterAndSize: function() {
  41454. var e = new n.Vector2;
  41455. return function(t, i) {
  41456. var n = e.copy(i).multiplyScalar(.5);
  41457. return this.min.copy(t).sub(n),
  41458. this.max.copy(t).add(n),
  41459. this
  41460. }
  41461. }(),
  41462. clone: function() {
  41463. return (new this.constructor).copy(this)
  41464. },
  41465. copy: function(e) {
  41466. return this.min.copy(e.min),
  41467. this.max.copy(e.max),
  41468. this
  41469. },
  41470. makeEmpty: function() {
  41471. return this.min.x = this.min.y = +(1 / 0),
  41472. this.max.x = this.max.y = -(1 / 0),
  41473. this
  41474. },
  41475. isEmpty: function() {
  41476. return this.max.x < this.min.x || this.max.y < this.min.y
  41477. },
  41478. center: function(e) {
  41479. var t = e || new n.Vector2;
  41480. return t.addVectors(this.min, this.max).multiplyScalar(.5)
  41481. },
  41482. size: function(e) {
  41483. var t = e || new n.Vector2;
  41484. return t.subVectors(this.max, this.min)
  41485. },
  41486. expandByPoint: function(e) {
  41487. return this.min.min(e),
  41488. this.max.max(e),
  41489. this
  41490. },
  41491. expandByVector: function(e) {
  41492. return this.min.sub(e),
  41493. this.max.add(e),
  41494. this
  41495. },
  41496. expandByScalar: function(e) {
  41497. return this.min.addScalar(-e),
  41498. this.max.addScalar(e),
  41499. this
  41500. },
  41501. containsPoint: function(e) {
  41502. return !(e.x < this.min.x || e.x > this.max.x || e.y < this.min.y || e.y > this.max.y)
  41503. },
  41504. containsBox: function(e) {
  41505. 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
  41506. },
  41507. getParameter: function(e, t) {
  41508. var i = t || new n.Vector2;
  41509. 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))
  41510. },
  41511. intersectsBox: function(e) {
  41512. 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)
  41513. },
  41514. clampPoint: function(e, t) {
  41515. var i = t || new n.Vector2;
  41516. return i.copy(e).clamp(this.min, this.max)
  41517. },
  41518. distanceToPoint: function() {
  41519. var e = new n.Vector2;
  41520. return function(t) {
  41521. var i = e.copy(t).clamp(this.min, this.max);
  41522. return i.sub(t).length()
  41523. }
  41524. }(),
  41525. intersect: function(e) {
  41526. return this.min.max(e.min),
  41527. this.max.min(e.max),
  41528. this
  41529. },
  41530. union: function(e) {
  41531. return this.min.min(e.min),
  41532. this.max.max(e.max),
  41533. this
  41534. },
  41535. translate: function(e) {
  41536. return this.min.add(e),
  41537. this.max.add(e),
  41538. this
  41539. },
  41540. equals: function(e) {
  41541. return e.min.equals(this.min) && e.max.equals(this.max)
  41542. }
  41543. },
  41544. n.Box3 = function(e, t) {
  41545. this.min = void 0 !== e ? e : new n.Vector3(+(1 / 0),+(1 / 0),+(1 / 0)),
  41546. this.max = void 0 !== t ? t : new n.Vector3(-(1 / 0),-(1 / 0),-(1 / 0))
  41547. }
  41548. ,
  41549. n.Box3.prototype = {
  41550. constructor: n.Box3,
  41551. set: function(e, t) {
  41552. return this.min.copy(e),
  41553. this.max.copy(t),
  41554. this
  41555. },
  41556. setFromArray: function(e) {
  41557. this.makeEmpty();
  41558. 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) {
  41559. var c = e[s]
  41560. , h = e[s + 1]
  41561. , u = e[s + 2];
  41562. c < t && (t = c),
  41563. h < i && (i = h),
  41564. u < n && (n = u),
  41565. c > r && (r = c),
  41566. h > o && (o = h),
  41567. u > a && (a = u)
  41568. }
  41569. this.min.set(t, i, n),
  41570. this.max.set(r, o, a)
  41571. },
  41572. setFromPoints: function(e) {
  41573. this.makeEmpty();
  41574. for (var t = 0, i = e.length; t < i; t++)
  41575. this.expandByPoint(e[t]);
  41576. return this
  41577. },
  41578. setFromCenterAndSize: function() {
  41579. var e = new n.Vector3;
  41580. return function(t, i) {
  41581. var n = e.copy(i).multiplyScalar(.5);
  41582. return this.min.copy(t).sub(n),
  41583. this.max.copy(t).add(n),
  41584. this
  41585. }
  41586. }(),
  41587. setFromObject: function() {
  41588. var e;
  41589. return function(t) {
  41590. void 0 === e && (e = new n.Box3);
  41591. var i = this;
  41592. return this.makeEmpty(),
  41593. t.updateMatrixWorld(!0),
  41594. t.traverse(function(t) {
  41595. var n = t.geometry;
  41596. void 0 !== n && (null === n.boundingBox && n.computeBoundingBox(),
  41597. n.boundingBox.isEmpty() === !1 && (e.copy(n.boundingBox),
  41598. e.applyMatrix4(t.matrixWorld),
  41599. i.union(e)))
  41600. }),
  41601. this
  41602. }
  41603. }(),
  41604. clone: function() {
  41605. return (new this.constructor).copy(this)
  41606. },
  41607. copy: function(e) {
  41608. return this.min.copy(e.min),
  41609. this.max.copy(e.max),
  41610. this
  41611. },
  41612. makeEmpty: function() {
  41613. return this.min.x = this.min.y = this.min.z = +(1 / 0),
  41614. this.max.x = this.max.y = this.max.z = -(1 / 0),
  41615. this
  41616. },
  41617. isEmpty: function() {
  41618. return this.max.x < this.min.x || this.max.y < this.min.y || this.max.z < this.min.z
  41619. },
  41620. center: function(e) {
  41621. var t = e || new n.Vector3;
  41622. return t.addVectors(this.min, this.max).multiplyScalar(.5)
  41623. },
  41624. size: function(e) {
  41625. var t = e || new n.Vector3;
  41626. return t.subVectors(this.max, this.min)
  41627. },
  41628. expandByPoint: function(e) {
  41629. return this.min.min(e),
  41630. this.max.max(e),
  41631. this
  41632. },
  41633. expandByVector: function(e) {
  41634. return this.min.sub(e),
  41635. this.max.add(e),
  41636. this
  41637. },
  41638. expandByScalar: function(e) {
  41639. return this.min.addScalar(-e),
  41640. this.max.addScalar(e),
  41641. this
  41642. },
  41643. containsPoint: function(e) {
  41644. 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)
  41645. },
  41646. containsBox: function(e) {
  41647. 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
  41648. },
  41649. getParameter: function(e, t) {
  41650. var i = t || new n.Vector3;
  41651. 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))
  41652. },
  41653. intersectsBox: function(e) {
  41654. 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)
  41655. },
  41656. intersectsSphere: function() {
  41657. var e;
  41658. return function(t) {
  41659. return void 0 === e && (e = new n.Vector3),
  41660. this.clampPoint(t.center, e),
  41661. e.distanceToSquared(t.center) <= t.radius * t.radius
  41662. }
  41663. }(),
  41664. intersectsPlane: function(e) {
  41665. var t, i;
  41666. return e.normal.x > 0 ? (t = e.normal.x * this.min.x,
  41667. i = e.normal.x * this.max.x) : (t = e.normal.x * this.max.x,
  41668. i = e.normal.x * this.min.x),
  41669. e.normal.y > 0 ? (t += e.normal.y * this.min.y,
  41670. i += e.normal.y * this.max.y) : (t += e.normal.y * this.max.y,
  41671. i += e.normal.y * this.min.y),
  41672. e.normal.z > 0 ? (t += e.normal.z * this.min.z,
  41673. i += e.normal.z * this.max.z) : (t += e.normal.z * this.max.z,
  41674. i += e.normal.z * this.min.z),
  41675. t <= e.constant && i >= e.constant
  41676. },
  41677. clampPoint: function(e, t) {
  41678. var i = t || new n.Vector3;
  41679. return i.copy(e).clamp(this.min, this.max)
  41680. },
  41681. distanceToPoint: function() {
  41682. var e = new n.Vector3;
  41683. return function(t) {
  41684. var i = e.copy(t).clamp(this.min, this.max);
  41685. return i.sub(t).length()
  41686. }
  41687. }(),
  41688. getBoundingSphere: function() {
  41689. var e = new n.Vector3;
  41690. return function(t) {
  41691. var i = t || new n.Sphere;
  41692. return i.center = this.center(),
  41693. i.radius = .5 * this.size(e).length(),
  41694. i
  41695. }
  41696. }(),
  41697. intersect: function(e) {
  41698. return this.min.max(e.min),
  41699. this.max.min(e.max),
  41700. this
  41701. },
  41702. union: function(e) {
  41703. return this.min.min(e.min),
  41704. this.max.max(e.max),
  41705. this
  41706. },
  41707. applyMatrix4: function() {
  41708. 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];
  41709. return function(t) {
  41710. return e[0].set(this.min.x, this.min.y, this.min.z).applyMatrix4(t),
  41711. e[1].set(this.min.x, this.min.y, this.max.z).applyMatrix4(t),
  41712. e[2].set(this.min.x, this.max.y, this.min.z).applyMatrix4(t),
  41713. e[3].set(this.min.x, this.max.y, this.max.z).applyMatrix4(t),
  41714. e[4].set(this.max.x, this.min.y, this.min.z).applyMatrix4(t),
  41715. e[5].set(this.max.x, this.min.y, this.max.z).applyMatrix4(t),
  41716. e[6].set(this.max.x, this.max.y, this.min.z).applyMatrix4(t),
  41717. e[7].set(this.max.x, this.max.y, this.max.z).applyMatrix4(t),
  41718. this.makeEmpty(),
  41719. this.setFromPoints(e),
  41720. this
  41721. }
  41722. }(),
  41723. translate: function(e) {
  41724. return this.min.add(e),
  41725. this.max.add(e),
  41726. this
  41727. },
  41728. equals: function(e) {
  41729. return e.min.equals(this.min) && e.max.equals(this.max)
  41730. }
  41731. },
  41732. n.Matrix3 = function() {
  41733. this.elements = new Float32Array([1, 0, 0, 0, 1, 0, 0, 0, 1]),
  41734. arguments.length > 0 && console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")
  41735. }
  41736. ,
  41737. n.Matrix3.prototype = {
  41738. constructor: n.Matrix3,
  41739. set: function(e, t, i, n, r, o, a, s, l) {
  41740. var c = this.elements;
  41741. return c[0] = e,
  41742. c[1] = n,
  41743. c[2] = a,
  41744. c[3] = t,
  41745. c[4] = r,
  41746. c[5] = s,
  41747. c[6] = i,
  41748. c[7] = o,
  41749. c[8] = l,
  41750. this
  41751. },
  41752. identity: function() {
  41753. return this.set(1, 0, 0, 0, 1, 0, 0, 0, 1),
  41754. this
  41755. },
  41756. clone: function() {
  41757. return (new this.constructor).fromArray(this.elements)
  41758. },
  41759. copy: function(e) {
  41760. var t = e.elements;
  41761. return this.set(t[0], t[3], t[6], t[1], t[4], t[7], t[2], t[5], t[8]),
  41762. this
  41763. },
  41764. setFromMatrix4: function(e) {
  41765. var t = e.elements;
  41766. return this.set(t[0], t[4], t[8], t[1], t[5], t[9], t[2], t[6], t[10]),
  41767. this
  41768. },
  41769. applyToVector3Array: function() {
  41770. var e;
  41771. return function(t, i, r) {
  41772. void 0 === e && (e = new n.Vector3),
  41773. void 0 === i && (i = 0),
  41774. void 0 === r && (r = t.length);
  41775. for (var o = 0, a = i; o < r; o += 3,
  41776. a += 3)
  41777. e.fromArray(t, a),
  41778. e.applyMatrix3(this),
  41779. e.toArray(t, a);
  41780. return t
  41781. }
  41782. }(),
  41783. applyToBuffer: function() {
  41784. var e;
  41785. return function(t, i, r) {
  41786. void 0 === e && (e = new n.Vector3),
  41787. void 0 === i && (i = 0),
  41788. void 0 === r && (r = t.length / t.itemSize);
  41789. for (var o = 0, a = i; o < r; o++,
  41790. a++)
  41791. e.x = t.getX(a),
  41792. e.y = t.getY(a),
  41793. e.z = t.getZ(a),
  41794. e.applyMatrix3(this),
  41795. t.setXYZ(e.x, e.y, e.z);
  41796. return t
  41797. }
  41798. }(),
  41799. multiplyScalar: function(e) {
  41800. var t = this.elements;
  41801. return t[0] *= e,
  41802. t[3] *= e,
  41803. t[6] *= e,
  41804. t[1] *= e,
  41805. t[4] *= e,
  41806. t[7] *= e,
  41807. t[2] *= e,
  41808. t[5] *= e,
  41809. t[8] *= e,
  41810. this
  41811. },
  41812. determinant: function() {
  41813. var e = this.elements
  41814. , t = e[0]
  41815. , i = e[1]
  41816. , n = e[2]
  41817. , r = e[3]
  41818. , o = e[4]
  41819. , a = e[5]
  41820. , s = e[6]
  41821. , l = e[7]
  41822. , c = e[8];
  41823. return t * o * c - t * a * l - i * r * c + i * a * s + n * r * l - n * o * s
  41824. },
  41825. getInverse: function(e, t) {
  41826. e instanceof n.Matrix4 && console.warn("THREE.Matrix3.getInverse no longer takes a Matrix4 argument.");
  41827. var i = e.elements
  41828. , r = this.elements
  41829. , o = i[0]
  41830. , a = i[1]
  41831. , s = i[2]
  41832. , l = i[3]
  41833. , c = i[4]
  41834. , h = i[5]
  41835. , u = i[6]
  41836. , d = i[7]
  41837. , p = i[8]
  41838. , f = p * c - h * d
  41839. , g = h * u - p * l
  41840. , m = d * l - c * u
  41841. , v = o * f + a * g + s * m;
  41842. if (0 === v) {
  41843. var A = "THREE.Matrix3.getInverse(): can't invert matrix, determinant is 0";
  41844. if (t)
  41845. throw new Error(A);
  41846. return console.warn(A),
  41847. this.identity()
  41848. }
  41849. return r[0] = f,
  41850. r[1] = s * d - p * a,
  41851. r[2] = h * a - s * c,
  41852. r[3] = g,
  41853. r[4] = p * o - s * u,
  41854. r[5] = s * l - h * o,
  41855. r[6] = m,
  41856. r[7] = a * u - d * o,
  41857. r[8] = c * o - a * l,
  41858. this.multiplyScalar(1 / v)
  41859. },
  41860. transpose: function() {
  41861. var e, t = this.elements;
  41862. return e = t[1],
  41863. t[1] = t[3],
  41864. t[3] = e,
  41865. e = t[2],
  41866. t[2] = t[6],
  41867. t[6] = e,
  41868. e = t[5],
  41869. t[5] = t[7],
  41870. t[7] = e,
  41871. this
  41872. },
  41873. flattenToArrayOffset: function(e, t) {
  41874. var i = this.elements;
  41875. return e[t] = i[0],
  41876. e[t + 1] = i[1],
  41877. e[t + 2] = i[2],
  41878. e[t + 3] = i[3],
  41879. e[t + 4] = i[4],
  41880. e[t + 5] = i[5],
  41881. e[t + 6] = i[6],
  41882. e[t + 7] = i[7],
  41883. e[t + 8] = i[8],
  41884. e
  41885. },
  41886. getNormalMatrix: function(e) {
  41887. return this.setFromMatrix4(e).getInverse(this).transpose()
  41888. },
  41889. transposeIntoArray: function(e) {
  41890. var t = this.elements;
  41891. return e[0] = t[0],
  41892. e[1] = t[3],
  41893. e[2] = t[6],
  41894. e[3] = t[1],
  41895. e[4] = t[4],
  41896. e[5] = t[7],
  41897. e[6] = t[2],
  41898. e[7] = t[5],
  41899. e[8] = t[8],
  41900. this
  41901. },
  41902. fromArray: function(e) {
  41903. return this.elements.set(e),
  41904. this
  41905. },
  41906. toArray: function() {
  41907. var e = this.elements;
  41908. return [e[0], e[1], e[2], e[3], e[4], e[5], e[6], e[7], e[8]]
  41909. }
  41910. },
  41911. n.Matrix4 = function() {
  41912. this.elements = new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]),
  41913. arguments.length > 0 && console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")
  41914. }
  41915. ,
  41916. n.Matrix4.prototype = {
  41917. constructor: n.Matrix4,
  41918. set: function(e, t, i, n, r, o, a, s, l, c, h, u, d, p, f, g) {
  41919. var m = this.elements;
  41920. return m[0] = e,
  41921. m[4] = t,
  41922. m[8] = i,
  41923. m[12] = n,
  41924. m[1] = r,
  41925. m[5] = o,
  41926. m[9] = a,
  41927. m[13] = s,
  41928. m[2] = l,
  41929. m[6] = c,
  41930. m[10] = h,
  41931. m[14] = u,
  41932. m[3] = d,
  41933. m[7] = p,
  41934. m[11] = f,
  41935. m[15] = g,
  41936. this
  41937. },
  41938. identity: function() {
  41939. return this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
  41940. this
  41941. },
  41942. clone: function() {
  41943. return (new n.Matrix4).fromArray(this.elements)
  41944. },
  41945. copy: function(e) {
  41946. return this.elements.set(e.elements),
  41947. this
  41948. },
  41949. copyPosition: function(e) {
  41950. var t = this.elements
  41951. , i = e.elements;
  41952. return t[12] = i[12],
  41953. t[13] = i[13],
  41954. t[14] = i[14],
  41955. this
  41956. },
  41957. extractBasis: function(e, t, i) {
  41958. return e.setFromMatrixColumn(this, 0),
  41959. t.setFromMatrixColumn(this, 1),
  41960. i.setFromMatrixColumn(this, 2),
  41961. this
  41962. },
  41963. makeBasis: function(e, t, i) {
  41964. 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),
  41965. this
  41966. },
  41967. extractRotation: function() {
  41968. var e;
  41969. return function(t) {
  41970. void 0 === e && (e = new n.Vector3);
  41971. var i = this.elements
  41972. , r = t.elements
  41973. , o = 1 / e.setFromMatrixColumn(t, 0).length()
  41974. , a = 1 / e.setFromMatrixColumn(t, 1).length()
  41975. , s = 1 / e.setFromMatrixColumn(t, 2).length();
  41976. return i[0] = r[0] * o,
  41977. i[1] = r[1] * o,
  41978. i[2] = r[2] * o,
  41979. i[4] = r[4] * a,
  41980. i[5] = r[5] * a,
  41981. i[6] = r[6] * a,
  41982. i[8] = r[8] * s,
  41983. i[9] = r[9] * s,
  41984. i[10] = r[10] * s,
  41985. this
  41986. }
  41987. }(),
  41988. makeRotationFromEuler: function(e) {
  41989. e instanceof n.Euler == !1 && console.error("THREE.Matrix: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");
  41990. var t = this.elements
  41991. , i = e.x
  41992. , r = e.y
  41993. , o = e.z
  41994. , a = Math.cos(i)
  41995. , s = Math.sin(i)
  41996. , l = Math.cos(r)
  41997. , c = Math.sin(r)
  41998. , h = Math.cos(o)
  41999. , u = Math.sin(o);
  42000. if ("XYZ" === e.order) {
  42001. var d = a * h
  42002. , p = a * u
  42003. , f = s * h
  42004. , g = s * u;
  42005. t[0] = l * h,
  42006. t[4] = -l * u,
  42007. t[8] = c,
  42008. t[1] = p + f * c,
  42009. t[5] = d - g * c,
  42010. t[9] = -s * l,
  42011. t[2] = g - d * c,
  42012. t[6] = f + p * c,
  42013. t[10] = a * l
  42014. } else if ("YXZ" === e.order) {
  42015. var m = l * h
  42016. , v = l * u
  42017. , A = c * h
  42018. , y = c * u;
  42019. t[0] = m + y * s,
  42020. t[4] = A * s - v,
  42021. t[8] = a * c,
  42022. t[1] = a * u,
  42023. t[5] = a * h,
  42024. t[9] = -s,
  42025. t[2] = v * s - A,
  42026. t[6] = y + m * s,
  42027. t[10] = a * l
  42028. } else if ("ZXY" === e.order) {
  42029. var m = l * h
  42030. , v = l * u
  42031. , A = c * h
  42032. , y = c * u;
  42033. t[0] = m - y * s,
  42034. t[4] = -a * u,
  42035. t[8] = A + v * s,
  42036. t[1] = v + A * s,
  42037. t[5] = a * h,
  42038. t[9] = y - m * s,
  42039. t[2] = -a * c,
  42040. t[6] = s,
  42041. t[10] = a * l
  42042. } else if ("ZYX" === e.order) {
  42043. var d = a * h
  42044. , p = a * u
  42045. , f = s * h
  42046. , g = s * u;
  42047. t[0] = l * h,
  42048. t[4] = f * c - p,
  42049. t[8] = d * c + g,
  42050. t[1] = l * u,
  42051. t[5] = g * c + d,
  42052. t[9] = p * c - f,
  42053. t[2] = -c,
  42054. t[6] = s * l,
  42055. t[10] = a * l
  42056. } else if ("YZX" === e.order) {
  42057. var C = a * l
  42058. , I = a * c
  42059. , E = s * l
  42060. , b = s * c;
  42061. t[0] = l * h,
  42062. t[4] = b - C * u,
  42063. t[8] = E * u + I,
  42064. t[1] = u,
  42065. t[5] = a * h,
  42066. t[9] = -s * h,
  42067. t[2] = -c * h,
  42068. t[6] = I * u + E,
  42069. t[10] = C - b * u
  42070. } else if ("XZY" === e.order) {
  42071. var C = a * l
  42072. , I = a * c
  42073. , E = s * l
  42074. , b = s * c;
  42075. t[0] = l * h,
  42076. t[4] = -u,
  42077. t[8] = c * h,
  42078. t[1] = C * u + b,
  42079. t[5] = a * h,
  42080. t[9] = I * u - E,
  42081. t[2] = E * u - I,
  42082. t[6] = s * h,
  42083. t[10] = b * u + C
  42084. }
  42085. return t[3] = 0,
  42086. t[7] = 0,
  42087. t[11] = 0,
  42088. t[12] = 0,
  42089. t[13] = 0,
  42090. t[14] = 0,
  42091. t[15] = 1,
  42092. this
  42093. },
  42094. makeRotationFromQuaternion: function(e) {
  42095. var t = this.elements
  42096. , i = e.x
  42097. , n = e.y
  42098. , r = e.z
  42099. , o = e.w
  42100. , a = i + i
  42101. , s = n + n
  42102. , l = r + r
  42103. , c = i * a
  42104. , h = i * s
  42105. , u = i * l
  42106. , d = n * s
  42107. , p = n * l
  42108. , f = r * l
  42109. , g = o * a
  42110. , m = o * s
  42111. , v = o * l;
  42112. return t[0] = 1 - (d + f),
  42113. t[4] = h - v,
  42114. t[8] = u + m,
  42115. t[1] = h + v,
  42116. t[5] = 1 - (c + f),
  42117. t[9] = p - g,
  42118. t[2] = u - m,
  42119. t[6] = p + g,
  42120. t[10] = 1 - (c + d),
  42121. t[3] = 0,
  42122. t[7] = 0,
  42123. t[11] = 0,
  42124. t[12] = 0,
  42125. t[13] = 0,
  42126. t[14] = 0,
  42127. t[15] = 1,
  42128. this
  42129. },
  42130. lookAt: function() {
  42131. var e, t, i;
  42132. return function(r, o, a) {
  42133. void 0 === e && (e = new n.Vector3),
  42134. void 0 === t && (t = new n.Vector3),
  42135. void 0 === i && (i = new n.Vector3);
  42136. var s = this.elements;
  42137. return i.subVectors(r, o).normalize(),
  42138. 0 === i.lengthSq() && (i.z = 1),
  42139. e.crossVectors(a, i).normalize(),
  42140. 0 === e.lengthSq() && (i.x += 1e-4,
  42141. e.crossVectors(a, i).normalize()),
  42142. t.crossVectors(i, e),
  42143. s[0] = e.x,
  42144. s[4] = t.x,
  42145. s[8] = i.x,
  42146. s[1] = e.y,
  42147. s[5] = t.y,
  42148. s[9] = i.y,
  42149. s[2] = e.z,
  42150. s[6] = t.z,
  42151. s[10] = i.z,
  42152. this
  42153. }
  42154. }(),
  42155. multiply: function(e, t) {
  42156. return void 0 !== t ? (console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),
  42157. this.multiplyMatrices(e, t)) : this.multiplyMatrices(this, e)
  42158. },
  42159. multiplyMatrices: function(e, t) {
  42160. var i = e.elements
  42161. , n = t.elements
  42162. , r = this.elements
  42163. , o = i[0]
  42164. , a = i[4]
  42165. , s = i[8]
  42166. , l = i[12]
  42167. , c = i[1]
  42168. , h = i[5]
  42169. , u = i[9]
  42170. , d = i[13]
  42171. , p = i[2]
  42172. , f = i[6]
  42173. , g = i[10]
  42174. , m = i[14]
  42175. , v = i[3]
  42176. , A = i[7]
  42177. , y = i[11]
  42178. , C = i[15]
  42179. , I = n[0]
  42180. , E = n[4]
  42181. , b = n[8]
  42182. , w = n[12]
  42183. , _ = n[1]
  42184. , T = n[5]
  42185. , x = n[9]
  42186. , S = n[13]
  42187. , M = n[2]
  42188. , R = n[6]
  42189. , P = n[10]
  42190. , O = n[14]
  42191. , L = n[3]
  42192. , D = n[7]
  42193. , N = n[11]
  42194. , B = n[15];
  42195. return r[0] = o * I + a * _ + s * M + l * L,
  42196. r[4] = o * E + a * T + s * R + l * D,
  42197. r[8] = o * b + a * x + s * P + l * N,
  42198. r[12] = o * w + a * S + s * O + l * B,
  42199. r[1] = c * I + h * _ + u * M + d * L,
  42200. r[5] = c * E + h * T + u * R + d * D,
  42201. r[9] = c * b + h * x + u * P + d * N,
  42202. r[13] = c * w + h * S + u * O + d * B,
  42203. r[2] = p * I + f * _ + g * M + m * L,
  42204. r[6] = p * E + f * T + g * R + m * D,
  42205. r[10] = p * b + f * x + g * P + m * N,
  42206. r[14] = p * w + f * S + g * O + m * B,
  42207. r[3] = v * I + A * _ + y * M + C * L,
  42208. r[7] = v * E + A * T + y * R + C * D,
  42209. r[11] = v * b + A * x + y * P + C * N,
  42210. r[15] = v * w + A * S + y * O + C * B,
  42211. this
  42212. },
  42213. multiplyToArray: function(e, t, i) {
  42214. var n = this.elements;
  42215. return this.multiplyMatrices(e, t),
  42216. i[0] = n[0],
  42217. i[1] = n[1],
  42218. i[2] = n[2],
  42219. i[3] = n[3],
  42220. i[4] = n[4],
  42221. i[5] = n[5],
  42222. i[6] = n[6],
  42223. i[7] = n[7],
  42224. i[8] = n[8],
  42225. i[9] = n[9],
  42226. i[10] = n[10],
  42227. i[11] = n[11],
  42228. i[12] = n[12],
  42229. i[13] = n[13],
  42230. i[14] = n[14],
  42231. i[15] = n[15],
  42232. this
  42233. },
  42234. multiplyScalar: function(e) {
  42235. var t = this.elements;
  42236. return t[0] *= e,
  42237. t[4] *= e,
  42238. t[8] *= e,
  42239. t[12] *= e,
  42240. t[1] *= e,
  42241. t[5] *= e,
  42242. t[9] *= e,
  42243. t[13] *= e,
  42244. t[2] *= e,
  42245. t[6] *= e,
  42246. t[10] *= e,
  42247. t[14] *= e,
  42248. t[3] *= e,
  42249. t[7] *= e,
  42250. t[11] *= e,
  42251. t[15] *= e,
  42252. this
  42253. },
  42254. applyToVector3Array: function() {
  42255. var e;
  42256. return function(t, i, r) {
  42257. void 0 === e && (e = new n.Vector3),
  42258. void 0 === i && (i = 0),
  42259. void 0 === r && (r = t.length);
  42260. for (var o = 0, a = i; o < r; o += 3,
  42261. a += 3)
  42262. e.fromArray(t, a),
  42263. e.applyMatrix4(this),
  42264. e.toArray(t, a);
  42265. return t
  42266. }
  42267. }(),
  42268. applyToBuffer: function() {
  42269. var e;
  42270. return function(t, i, r) {
  42271. void 0 === e && (e = new n.Vector3),
  42272. void 0 === i && (i = 0),
  42273. void 0 === r && (r = t.length / t.itemSize);
  42274. for (var o = 0, a = i; o < r; o++,
  42275. a++)
  42276. e.x = t.getX(a),
  42277. e.y = t.getY(a),
  42278. e.z = t.getZ(a),
  42279. e.applyMatrix4(this),
  42280. t.setXYZ(e.x, e.y, e.z);
  42281. return t
  42282. }
  42283. }(),
  42284. determinant: function() {
  42285. var e = this.elements
  42286. , t = e[0]
  42287. , i = e[4]
  42288. , n = e[8]
  42289. , r = e[12]
  42290. , o = e[1]
  42291. , a = e[5]
  42292. , s = e[9]
  42293. , l = e[13]
  42294. , c = e[2]
  42295. , h = e[6]
  42296. , u = e[10]
  42297. , d = e[14]
  42298. , p = e[3]
  42299. , f = e[7]
  42300. , g = e[11]
  42301. , m = e[15];
  42302. 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)
  42303. },
  42304. transpose: function() {
  42305. var e, t = this.elements;
  42306. return e = t[1],
  42307. t[1] = t[4],
  42308. t[4] = e,
  42309. e = t[2],
  42310. t[2] = t[8],
  42311. t[8] = e,
  42312. e = t[6],
  42313. t[6] = t[9],
  42314. t[9] = e,
  42315. e = t[3],
  42316. t[3] = t[12],
  42317. t[12] = e,
  42318. e = t[7],
  42319. t[7] = t[13],
  42320. t[13] = e,
  42321. e = t[11],
  42322. t[11] = t[14],
  42323. t[14] = e,
  42324. this
  42325. },
  42326. flattenToArrayOffset: function(e, t) {
  42327. var i = this.elements;
  42328. return e[t] = i[0],
  42329. e[t + 1] = i[1],
  42330. e[t + 2] = i[2],
  42331. e[t + 3] = i[3],
  42332. e[t + 4] = i[4],
  42333. e[t + 5] = i[5],
  42334. e[t + 6] = i[6],
  42335. e[t + 7] = i[7],
  42336. e[t + 8] = i[8],
  42337. e[t + 9] = i[9],
  42338. e[t + 10] = i[10],
  42339. e[t + 11] = i[11],
  42340. e[t + 12] = i[12],
  42341. e[t + 13] = i[13],
  42342. e[t + 14] = i[14],
  42343. e[t + 15] = i[15],
  42344. e
  42345. },
  42346. getPosition: function() {
  42347. var e;
  42348. return function() {
  42349. return void 0 === e && (e = new n.Vector3),
  42350. console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),
  42351. e.setFromMatrixColumn(this, 3)
  42352. }
  42353. }(),
  42354. setPosition: function(e) {
  42355. var t = this.elements;
  42356. return t[12] = e.x,
  42357. t[13] = e.y,
  42358. t[14] = e.z,
  42359. this
  42360. },
  42361. getInverse: function(e, t) {
  42362. var i = this.elements
  42363. , n = e.elements
  42364. , r = n[0]
  42365. , o = n[1]
  42366. , a = n[2]
  42367. , s = n[3]
  42368. , l = n[4]
  42369. , c = n[5]
  42370. , h = n[6]
  42371. , u = n[7]
  42372. , d = n[8]
  42373. , p = n[9]
  42374. , f = n[10]
  42375. , g = n[11]
  42376. , m = n[12]
  42377. , v = n[13]
  42378. , A = n[14]
  42379. , y = n[15]
  42380. , C = p * A * u - v * f * u + v * h * g - c * A * g - p * h * y + c * f * y
  42381. , I = m * f * u - d * A * u - m * h * g + l * A * g + d * h * y - l * f * y
  42382. , E = d * v * u - m * p * u + m * c * g - l * v * g - d * c * y + l * p * y
  42383. , b = m * p * h - d * v * h - m * c * f + l * v * f + d * c * A - l * p * A
  42384. , w = r * C + o * I + a * E + s * b;
  42385. if (0 === w) {
  42386. var _ = "THREE.Matrix4.getInverse(): can't invert matrix, determinant is 0";
  42387. if (t)
  42388. throw new Error(_);
  42389. return console.warn(_),
  42390. this.identity()
  42391. }
  42392. return i[0] = C,
  42393. i[1] = v * f * s - p * A * s - v * a * g + o * A * g + p * a * y - o * f * y,
  42394. i[2] = c * A * s - v * h * s + v * a * u - o * A * u - c * a * y + o * h * y,
  42395. i[3] = p * h * s - c * f * s - p * a * u + o * f * u + c * a * g - o * h * g,
  42396. i[4] = I,
  42397. i[5] = d * A * s - m * f * s + m * a * g - r * A * g - d * a * y + r * f * y,
  42398. i[6] = m * h * s - l * A * s - m * a * u + r * A * u + l * a * y - r * h * y,
  42399. i[7] = l * f * s - d * h * s + d * a * u - r * f * u - l * a * g + r * h * g,
  42400. i[8] = E,
  42401. i[9] = m * p * s - d * v * s - m * o * g + r * v * g + d * o * y - r * p * y,
  42402. i[10] = l * v * s - m * c * s + m * o * u - r * v * u - l * o * y + r * c * y,
  42403. i[11] = d * c * s - l * p * s - d * o * u + r * p * u + l * o * g - r * c * g,
  42404. i[12] = b,
  42405. i[13] = d * v * a - m * p * a + m * o * f - r * v * f - d * o * A + r * p * A,
  42406. i[14] = m * c * a - l * v * a - m * o * h + r * v * h + l * o * A - r * c * A,
  42407. i[15] = l * p * a - d * c * a + d * o * h - r * p * h - l * o * f + r * c * f,
  42408. this.multiplyScalar(1 / w)
  42409. },
  42410. scale: function(e) {
  42411. var t = this.elements
  42412. , i = e.x
  42413. , n = e.y
  42414. , r = e.z;
  42415. return t[0] *= i,
  42416. t[4] *= n,
  42417. t[8] *= r,
  42418. t[1] *= i,
  42419. t[5] *= n,
  42420. t[9] *= r,
  42421. t[2] *= i,
  42422. t[6] *= n,
  42423. t[10] *= r,
  42424. t[3] *= i,
  42425. t[7] *= n,
  42426. t[11] *= r,
  42427. this
  42428. },
  42429. getMaxScaleOnAxis: function() {
  42430. var e = this.elements
  42431. , t = e[0] * e[0] + e[1] * e[1] + e[2] * e[2]
  42432. , i = e[4] * e[4] + e[5] * e[5] + e[6] * e[6]
  42433. , n = e[8] * e[8] + e[9] * e[9] + e[10] * e[10];
  42434. return Math.sqrt(Math.max(t, i, n))
  42435. },
  42436. makeTranslation: function(e, t, i) {
  42437. return this.set(1, 0, 0, e, 0, 1, 0, t, 0, 0, 1, i, 0, 0, 0, 1),
  42438. this
  42439. },
  42440. makeRotationX: function(e) {
  42441. var t = Math.cos(e)
  42442. , i = Math.sin(e);
  42443. return this.set(1, 0, 0, 0, 0, t, -i, 0, 0, i, t, 0, 0, 0, 0, 1),
  42444. this
  42445. },
  42446. makeRotationY: function(e) {
  42447. var t = Math.cos(e)
  42448. , i = Math.sin(e);
  42449. return this.set(t, 0, i, 0, 0, 1, 0, 0, -i, 0, t, 0, 0, 0, 0, 1),
  42450. this
  42451. },
  42452. makeRotationZ: function(e) {
  42453. var t = Math.cos(e)
  42454. , i = Math.sin(e);
  42455. return this.set(t, -i, 0, 0, i, t, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
  42456. this
  42457. },
  42458. makeRotationAxis: function(e, t) {
  42459. var i = Math.cos(t)
  42460. , n = Math.sin(t)
  42461. , r = 1 - i
  42462. , o = e.x
  42463. , a = e.y
  42464. , s = e.z
  42465. , l = r * o
  42466. , c = r * a;
  42467. 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),
  42468. this
  42469. },
  42470. makeScale: function(e, t, i) {
  42471. return this.set(e, 0, 0, 0, 0, t, 0, 0, 0, 0, i, 0, 0, 0, 0, 1),
  42472. this
  42473. },
  42474. compose: function(e, t, i) {
  42475. return this.makeRotationFromQuaternion(t),
  42476. this.scale(i),
  42477. this.setPosition(e),
  42478. this
  42479. },
  42480. decompose: function() {
  42481. var e, t;
  42482. return function(i, r, o) {
  42483. void 0 === e && (e = new n.Vector3),
  42484. void 0 === t && (t = new n.Matrix4);
  42485. var a = this.elements
  42486. , s = e.set(a[0], a[1], a[2]).length()
  42487. , l = e.set(a[4], a[5], a[6]).length()
  42488. , c = e.set(a[8], a[9], a[10]).length()
  42489. , h = this.determinant();
  42490. h < 0 && (s = -s),
  42491. i.x = a[12],
  42492. i.y = a[13],
  42493. i.z = a[14],
  42494. t.elements.set(this.elements);
  42495. var u = 1 / s
  42496. , d = 1 / l
  42497. , p = 1 / c;
  42498. return t.elements[0] *= u,
  42499. t.elements[1] *= u,
  42500. t.elements[2] *= u,
  42501. t.elements[4] *= d,
  42502. t.elements[5] *= d,
  42503. t.elements[6] *= d,
  42504. t.elements[8] *= p,
  42505. t.elements[9] *= p,
  42506. t.elements[10] *= p,
  42507. r.setFromRotationMatrix(t),
  42508. o.x = s,
  42509. o.y = l,
  42510. o.z = c,
  42511. this
  42512. }
  42513. }(),
  42514. makeFrustum: function(e, t, i, n, r, o) {
  42515. var a = this.elements
  42516. , s = 2 * r / (t - e)
  42517. , l = 2 * r / (n - i)
  42518. , c = (t + e) / (t - e)
  42519. , h = (n + i) / (n - i)
  42520. , u = -(o + r) / (o - r)
  42521. , d = -2 * o * r / (o - r);
  42522. return a[0] = s,
  42523. a[4] = 0,
  42524. a[8] = c,
  42525. a[12] = 0,
  42526. a[1] = 0,
  42527. a[5] = l,
  42528. a[9] = h,
  42529. a[13] = 0,
  42530. a[2] = 0,
  42531. a[6] = 0,
  42532. a[10] = u,
  42533. a[14] = d,
  42534. a[3] = 0,
  42535. a[7] = 0,
  42536. a[11] = -1,
  42537. a[15] = 0,
  42538. this
  42539. },
  42540. makePerspective: function(e, t, i, r) {
  42541. var o = i * Math.tan(n.Math.degToRad(.5 * e))
  42542. , a = -o
  42543. , s = a * t
  42544. , l = o * t;
  42545. return this.makeFrustum(s, l, a, o, i, r)
  42546. },
  42547. makeOrthographic: function(e, t, i, n, r, o) {
  42548. var a = this.elements
  42549. , s = 1 / (t - e)
  42550. , l = 1 / (i - n)
  42551. , c = 1 / (o - r)
  42552. , h = (t + e) * s
  42553. , u = (i + n) * l
  42554. , d = (o + r) * c;
  42555. return a[0] = 2 * s,
  42556. a[4] = 0,
  42557. a[8] = 0,
  42558. a[12] = -h,
  42559. a[1] = 0,
  42560. a[5] = 2 * l,
  42561. a[9] = 0,
  42562. a[13] = -u,
  42563. a[2] = 0,
  42564. a[6] = 0,
  42565. a[10] = -2 * c,
  42566. a[14] = -d,
  42567. a[3] = 0,
  42568. a[7] = 0,
  42569. a[11] = 0,
  42570. a[15] = 1,
  42571. this
  42572. },
  42573. equals: function(e) {
  42574. for (var t = this.elements, i = e.elements, n = 0; n < 16; n++)
  42575. if (t[n] !== i[n])
  42576. return !1;
  42577. return !0
  42578. },
  42579. fromArray: function(e) {
  42580. return this.elements.set(e),
  42581. this
  42582. },
  42583. toArray: function() {
  42584. var e = this.elements;
  42585. 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]]
  42586. }
  42587. },
  42588. n.Ray = function(e, t) {
  42589. this.origin = void 0 !== e ? e : new n.Vector3,
  42590. this.direction = void 0 !== t ? t : new n.Vector3
  42591. }
  42592. ,
  42593. n.Ray.prototype = {
  42594. constructor: n.Ray,
  42595. set: function(e, t) {
  42596. return this.origin.copy(e),
  42597. this.direction.copy(t),
  42598. this
  42599. },
  42600. clone: function() {
  42601. return (new this.constructor).copy(this)
  42602. },
  42603. copy: function(e) {
  42604. return this.origin.copy(e.origin),
  42605. this.direction.copy(e.direction),
  42606. this
  42607. },
  42608. at: function(e, t) {
  42609. var i = t || new n.Vector3;
  42610. return i.copy(this.direction).multiplyScalar(e).add(this.origin)
  42611. },
  42612. lookAt: function(e) {
  42613. this.direction.copy(e).sub(this.origin).normalize()
  42614. },
  42615. recast: function() {
  42616. var e = new n.Vector3;
  42617. return function(t) {
  42618. return this.origin.copy(this.at(t, e)),
  42619. this
  42620. }
  42621. }(),
  42622. closestPointToPoint: function(e, t) {
  42623. var i = t || new n.Vector3;
  42624. i.subVectors(e, this.origin);
  42625. var r = i.dot(this.direction);
  42626. return r < 0 ? i.copy(this.origin) : i.copy(this.direction).multiplyScalar(r).add(this.origin)
  42627. },
  42628. distanceToPoint: function(e) {
  42629. return Math.sqrt(this.distanceSqToPoint(e))
  42630. },
  42631. distanceSqToPoint: function() {
  42632. var e = new n.Vector3;
  42633. return function(t) {
  42634. var i = e.subVectors(t, this.origin).dot(this.direction);
  42635. return i < 0 ? this.origin.distanceToSquared(t) : (e.copy(this.direction).multiplyScalar(i).add(this.origin),
  42636. e.distanceToSquared(t))
  42637. }
  42638. }(),
  42639. distanceSqToSegment: function() {
  42640. var e = new n.Vector3
  42641. , t = new n.Vector3
  42642. , i = new n.Vector3;
  42643. return function(n, r, o, a) {
  42644. e.copy(n).add(r).multiplyScalar(.5),
  42645. t.copy(r).sub(n).normalize(),
  42646. i.copy(this.origin).sub(e);
  42647. 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);
  42648. if (m > 0)
  42649. if (s = d * f - p,
  42650. l = d * p - f,
  42651. h = u * m,
  42652. s >= 0)
  42653. if (l >= -h)
  42654. if (l <= h) {
  42655. var v = 1 / m;
  42656. s *= v,
  42657. l *= v,
  42658. c = s * (s + d * l + 2 * p) + l * (d * s + l + 2 * f) + g
  42659. } else
  42660. l = u,
  42661. s = Math.max(0, -(d * l + p)),
  42662. c = -s * s + l * (l + 2 * f) + g;
  42663. else
  42664. l = -u,
  42665. s = Math.max(0, -(d * l + p)),
  42666. c = -s * s + l * (l + 2 * f) + g;
  42667. else
  42668. l <= -h ? (s = Math.max(0, -(-d * u + p)),
  42669. l = s > 0 ? -u : Math.min(Math.max(-u, -f), u),
  42670. c = -s * s + l * (l + 2 * f) + g) : l <= h ? (s = 0,
  42671. l = Math.min(Math.max(-u, -f), u),
  42672. c = l * (l + 2 * f) + g) : (s = Math.max(0, -(d * u + p)),
  42673. l = s > 0 ? u : Math.min(Math.max(-u, -f), u),
  42674. c = -s * s + l * (l + 2 * f) + g);
  42675. else
  42676. l = d > 0 ? -u : u,
  42677. s = Math.max(0, -(d * l + p)),
  42678. c = -s * s + l * (l + 2 * f) + g;
  42679. return o && o.copy(this.direction).multiplyScalar(s).add(this.origin),
  42680. a && a.copy(t).multiplyScalar(l).add(e),
  42681. c
  42682. }
  42683. }(),
  42684. intersectSphere: function() {
  42685. var e = new n.Vector3;
  42686. return function(t, i) {
  42687. e.subVectors(t.center, this.origin);
  42688. var n = e.dot(this.direction)
  42689. , r = e.dot(e) - n * n
  42690. , o = t.radius * t.radius;
  42691. if (r > o)
  42692. return null;
  42693. var a = Math.sqrt(o - r)
  42694. , s = n - a
  42695. , l = n + a;
  42696. return s < 0 && l < 0 ? null : s < 0 ? this.at(l, i) : this.at(s, i)
  42697. }
  42698. }(),
  42699. intersectsSphere: function(e) {
  42700. return this.distanceToPoint(e.center) <= e.radius
  42701. },
  42702. distanceToPlane: function(e) {
  42703. var t = e.normal.dot(this.direction);
  42704. if (0 === t)
  42705. return 0 === e.distanceToPoint(this.origin) ? 0 : null;
  42706. var i = -(this.origin.dot(e.normal) + e.constant) / t;
  42707. return i >= 0 ? i : null
  42708. },
  42709. intersectPlane: function(e, t) {
  42710. var i = this.distanceToPlane(e);
  42711. return null === i ? null : this.at(i, t)
  42712. },
  42713. intersectsPlane: function(e) {
  42714. var t = e.distanceToPoint(this.origin);
  42715. if (0 === t)
  42716. return !0;
  42717. var i = e.normal.dot(this.direction);
  42718. return i * t < 0
  42719. },
  42720. intersectBox: function(e, t) {
  42721. 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;
  42722. return l >= 0 ? (i = (e.min.x - u.x) * l,
  42723. n = (e.max.x - u.x) * l) : (i = (e.max.x - u.x) * l,
  42724. n = (e.min.x - u.x) * l),
  42725. c >= 0 ? (r = (e.min.y - u.y) * c,
  42726. o = (e.max.y - u.y) * c) : (r = (e.max.y - u.y) * c,
  42727. o = (e.min.y - u.y) * c),
  42728. i > o || r > n ? null : ((r > i || i !== i) && (i = r),
  42729. (o < n || n !== n) && (n = o),
  42730. h >= 0 ? (a = (e.min.z - u.z) * h,
  42731. s = (e.max.z - u.z) * h) : (a = (e.max.z - u.z) * h,
  42732. s = (e.min.z - u.z) * h),
  42733. i > s || a > n ? null : ((a > i || i !== i) && (i = a),
  42734. (s < n || n !== n) && (n = s),
  42735. n < 0 ? null : this.at(i >= 0 ? i : n, t)))
  42736. },
  42737. intersectsBox: function() {
  42738. var e = new n.Vector3;
  42739. return function(t) {
  42740. return null !== this.intersectBox(t, e)
  42741. }
  42742. }(),
  42743. intersectTriangle: function() {
  42744. var e = new n.Vector3
  42745. , t = new n.Vector3
  42746. , i = new n.Vector3
  42747. , r = new n.Vector3;
  42748. return function(n, o, a, s, l) {
  42749. t.subVectors(o, n),
  42750. i.subVectors(a, n),
  42751. r.crossVectors(t, i);
  42752. var c, h = this.direction.dot(r);
  42753. if (h > 0) {
  42754. if (s)
  42755. return null;
  42756. c = 1
  42757. } else {
  42758. if (!(h < 0))
  42759. return null;
  42760. c = -1,
  42761. h = -h
  42762. }
  42763. e.subVectors(this.origin, n);
  42764. var u = c * this.direction.dot(i.crossVectors(e, i));
  42765. if (u < 0)
  42766. return null;
  42767. var d = c * this.direction.dot(t.cross(e));
  42768. if (d < 0)
  42769. return null;
  42770. if (u + d > h)
  42771. return null;
  42772. var p = -c * e.dot(r);
  42773. return p < 0 ? null : this.at(p / h, l)
  42774. }
  42775. }(),
  42776. applyMatrix4: function(e) {
  42777. return this.direction.add(this.origin).applyMatrix4(e),
  42778. this.origin.applyMatrix4(e),
  42779. this.direction.sub(this.origin),
  42780. this.direction.normalize(),
  42781. this
  42782. },
  42783. equals: function(e) {
  42784. return e.origin.equals(this.origin) && e.direction.equals(this.direction)
  42785. }
  42786. },
  42787. n.Sphere = function(e, t) {
  42788. this.center = void 0 !== e ? e : new n.Vector3,
  42789. this.radius = void 0 !== t ? t : 0
  42790. }
  42791. ,
  42792. n.Sphere.prototype = {
  42793. constructor: n.Sphere,
  42794. set: function(e, t) {
  42795. return this.center.copy(e),
  42796. this.radius = t,
  42797. this
  42798. },
  42799. setFromPoints: function() {
  42800. var e = new n.Box3;
  42801. return function(t, i) {
  42802. var n = this.center;
  42803. void 0 !== i ? n.copy(i) : e.setFromPoints(t).center(n);
  42804. for (var r = 0, o = 0, a = t.length; o < a; o++)
  42805. r = Math.max(r, n.distanceToSquared(t[o]));
  42806. return this.radius = Math.sqrt(r),
  42807. this
  42808. }
  42809. }(),
  42810. clone: function() {
  42811. return (new this.constructor).copy(this)
  42812. },
  42813. copy: function(e) {
  42814. return this.center.copy(e.center),
  42815. this.radius = e.radius,
  42816. this
  42817. },
  42818. empty: function() {
  42819. return this.radius <= 0
  42820. },
  42821. containsPoint: function(e) {
  42822. return e.distanceToSquared(this.center) <= this.radius * this.radius
  42823. },
  42824. distanceToPoint: function(e) {
  42825. return e.distanceTo(this.center) - this.radius
  42826. },
  42827. intersectsSphere: function(e) {
  42828. var t = this.radius + e.radius;
  42829. return e.center.distanceToSquared(this.center) <= t * t
  42830. },
  42831. intersectsBox: function(e) {
  42832. return e.intersectsSphere(this)
  42833. },
  42834. intersectsPlane: function(e) {
  42835. return Math.abs(this.center.dot(e.normal) - e.constant) <= this.radius
  42836. },
  42837. clampPoint: function(e, t) {
  42838. var i = this.center.distanceToSquared(e)
  42839. , r = t || new n.Vector3;
  42840. return r.copy(e),
  42841. i > this.radius * this.radius && (r.sub(this.center).normalize(),
  42842. r.multiplyScalar(this.radius).add(this.center)),
  42843. r
  42844. },
  42845. getBoundingBox: function(e) {
  42846. var t = e || new n.Box3;
  42847. return t.set(this.center, this.center),
  42848. t.expandByScalar(this.radius),
  42849. t
  42850. },
  42851. applyMatrix4: function(e) {
  42852. return this.center.applyMatrix4(e),
  42853. this.radius = this.radius * e.getMaxScaleOnAxis(),
  42854. this
  42855. },
  42856. translate: function(e) {
  42857. return this.center.add(e),
  42858. this
  42859. },
  42860. equals: function(e) {
  42861. return e.center.equals(this.center) && e.radius === this.radius
  42862. }
  42863. },
  42864. n.Frustum = function(e, t, i, r, o, a) {
  42865. 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]
  42866. }
  42867. ,
  42868. n.Frustum.prototype = {
  42869. constructor: n.Frustum,
  42870. set: function(e, t, i, n, r, o) {
  42871. var a = this.planes;
  42872. return a[0].copy(e),
  42873. a[1].copy(t),
  42874. a[2].copy(i),
  42875. a[3].copy(n),
  42876. a[4].copy(r),
  42877. a[5].copy(o),
  42878. this
  42879. },
  42880. clone: function() {
  42881. return (new this.constructor).copy(this)
  42882. },
  42883. copy: function(e) {
  42884. for (var t = this.planes, i = 0; i < 6; i++)
  42885. t[i].copy(e.planes[i]);
  42886. return this
  42887. },
  42888. setFromMatrix: function(e) {
  42889. var t = this.planes
  42890. , i = e.elements
  42891. , n = i[0]
  42892. , r = i[1]
  42893. , o = i[2]
  42894. , a = i[3]
  42895. , s = i[4]
  42896. , l = i[5]
  42897. , c = i[6]
  42898. , h = i[7]
  42899. , u = i[8]
  42900. , d = i[9]
  42901. , p = i[10]
  42902. , f = i[11]
  42903. , g = i[12]
  42904. , m = i[13]
  42905. , v = i[14]
  42906. , A = i[15];
  42907. return t[0].setComponents(a - n, h - s, f - u, A - g).normalize(),
  42908. t[1].setComponents(a + n, h + s, f + u, A + g).normalize(),
  42909. t[2].setComponents(a + r, h + l, f + d, A + m).normalize(),
  42910. t[3].setComponents(a - r, h - l, f - d, A - m).normalize(),
  42911. t[4].setComponents(a - o, h - c, f - p, A - v).normalize(),
  42912. t[5].setComponents(a + o, h + c, f + p, A + v).normalize(),
  42913. this
  42914. },
  42915. intersectsObject: function() {
  42916. var e = new n.Sphere;
  42917. return function(t) {
  42918. var i = t.geometry;
  42919. return null === i.boundingSphere && i.computeBoundingSphere(),
  42920. e.copy(i.boundingSphere),
  42921. e.applyMatrix4(t.matrixWorld),
  42922. this.intersectsSphere(e)
  42923. }
  42924. }(),
  42925. intersectsSphere: function(e) {
  42926. for (var t = this.planes, i = e.center, n = -e.radius, r = 0; r < 6; r++) {
  42927. var o = t[r].distanceToPoint(i);
  42928. if (o < n)
  42929. return !1
  42930. }
  42931. return !0
  42932. },
  42933. intersectsBox: function() {
  42934. var e = new n.Vector3
  42935. , t = new n.Vector3;
  42936. return function(i) {
  42937. for (var n = this.planes, r = 0; r < 6; r++) {
  42938. var o = n[r];
  42939. e.x = o.normal.x > 0 ? i.min.x : i.max.x,
  42940. t.x = o.normal.x > 0 ? i.max.x : i.min.x,
  42941. e.y = o.normal.y > 0 ? i.min.y : i.max.y,
  42942. t.y = o.normal.y > 0 ? i.max.y : i.min.y,
  42943. e.z = o.normal.z > 0 ? i.min.z : i.max.z,
  42944. t.z = o.normal.z > 0 ? i.max.z : i.min.z;
  42945. var a = o.distanceToPoint(e)
  42946. , s = o.distanceToPoint(t);
  42947. if (a < 0 && s < 0)
  42948. return !1
  42949. }
  42950. return !0
  42951. }
  42952. }(),
  42953. containsPoint: function(e) {
  42954. for (var t = this.planes, i = 0; i < 6; i++)
  42955. if (t[i].distanceToPoint(e) < 0)
  42956. return !1;
  42957. return !0
  42958. }
  42959. },
  42960. n.Plane = function(e, t) {
  42961. this.normal = void 0 !== e ? e : new n.Vector3(1,0,0),
  42962. this.constant = void 0 !== t ? t : 0
  42963. }
  42964. ,
  42965. n.Plane.prototype = {
  42966. constructor: n.Plane,
  42967. set: function(e, t) {
  42968. return this.normal.copy(e),
  42969. this.constant = t,
  42970. this
  42971. },
  42972. setComponents: function(e, t, i, n) {
  42973. return this.normal.set(e, t, i),
  42974. this.constant = n,
  42975. this
  42976. },
  42977. setFromNormalAndCoplanarPoint: function(e, t) {
  42978. return this.normal.copy(e),
  42979. this.constant = -t.dot(this.normal),
  42980. this
  42981. },
  42982. setFromCoplanarPoints: function() {
  42983. var e = new n.Vector3
  42984. , t = new n.Vector3;
  42985. return function(i, n, r) {
  42986. var o = e.subVectors(r, n).cross(t.subVectors(i, n)).normalize();
  42987. return this.setFromNormalAndCoplanarPoint(o, i),
  42988. this
  42989. }
  42990. }(),
  42991. clone: function() {
  42992. return (new this.constructor).copy(this)
  42993. },
  42994. copy: function(e) {
  42995. return this.normal.copy(e.normal),
  42996. this.constant = e.constant,
  42997. this
  42998. },
  42999. normalize: function() {
  43000. var e = 1 / this.normal.length();
  43001. return this.normal.multiplyScalar(e),
  43002. this.constant *= e,
  43003. this
  43004. },
  43005. negate: function() {
  43006. return this.constant *= -1,
  43007. this.normal.negate(),
  43008. this
  43009. },
  43010. distanceToPoint: function(e) {
  43011. return this.normal.dot(e) + this.constant
  43012. },
  43013. distanceToSphere: function(e) {
  43014. return this.distanceToPoint(e.center) - e.radius
  43015. },
  43016. projectPoint: function(e, t) {
  43017. return this.orthoPoint(e, t).sub(e).negate()
  43018. },
  43019. orthoPoint: function(e, t) {
  43020. var i = this.distanceToPoint(e)
  43021. , r = t || new n.Vector3;
  43022. return r.copy(this.normal).multiplyScalar(i)
  43023. },
  43024. intersectLine: function() {
  43025. var e = new n.Vector3;
  43026. return function(t, i) {
  43027. var r = i || new n.Vector3
  43028. , o = t.delta(e)
  43029. , a = this.normal.dot(o);
  43030. if (0 !== a) {
  43031. var s = -(t.start.dot(this.normal) + this.constant) / a;
  43032. if (!(s < 0 || s > 1))
  43033. return r.copy(o).multiplyScalar(s).add(t.start)
  43034. } else if (0 === this.distanceToPoint(t.start))
  43035. return r.copy(t.start)
  43036. }
  43037. }(),
  43038. intersectsLine: function(e) {
  43039. var t = this.distanceToPoint(e.start)
  43040. , i = this.distanceToPoint(e.end);
  43041. return t < 0 && i > 0 || i < 0 && t > 0
  43042. },
  43043. intersectsBox: function(e) {
  43044. return e.intersectsPlane(this)
  43045. },
  43046. intersectsSphere: function(e) {
  43047. return e.intersectsPlane(this)
  43048. },
  43049. coplanarPoint: function(e) {
  43050. var t = e || new n.Vector3;
  43051. return t.copy(this.normal).multiplyScalar(-this.constant)
  43052. },
  43053. applyMatrix4: function() {
  43054. var e = new n.Vector3
  43055. , t = new n.Vector3
  43056. , i = new n.Matrix3;
  43057. return function(n, r) {
  43058. var o = r || i.getNormalMatrix(n)
  43059. , a = e.copy(this.normal).applyMatrix3(o)
  43060. , s = this.coplanarPoint(t);
  43061. return s.applyMatrix4(n),
  43062. this.setFromNormalAndCoplanarPoint(a, s),
  43063. this
  43064. }
  43065. }(),
  43066. translate: function(e) {
  43067. return this.constant = this.constant - e.dot(this.normal),
  43068. this
  43069. },
  43070. equals: function(e) {
  43071. return e.normal.equals(this.normal) && e.constant === this.constant
  43072. }
  43073. },
  43074. n.Spherical = function(e, t, i) {
  43075. return this.radius = void 0 !== e ? e : 1,
  43076. this.phi = void 0 !== t ? t : 0,
  43077. this.theta = void 0 !== i ? i : 0,
  43078. this
  43079. }
  43080. ,
  43081. n.Spherical.prototype = {
  43082. constructor: n.Spherical,
  43083. set: function(e, t, i) {
  43084. this.radius = e,
  43085. this.phi = t,
  43086. this.theta = i
  43087. },
  43088. clone: function() {
  43089. return (new this.constructor).copy(this)
  43090. },
  43091. copy: function(e) {
  43092. return this.radius.copy(e.radius),
  43093. this.phi.copy(e.phi),
  43094. this.theta.copy(e.theta),
  43095. this
  43096. },
  43097. makeSafe: function() {
  43098. var e = 1e-6;
  43099. this.phi = Math.max(e, Math.min(Math.PI - e, this.phi))
  43100. },
  43101. setFromVector3: function(e) {
  43102. return this.radius = e.length(),
  43103. 0 === this.radius ? (this.theta = 0,
  43104. this.phi = 0) : (this.theta = Math.atan2(e.x, e.z),
  43105. this.phi = Math.acos(n.Math.clamp(e.y / this.radius, -1, 1))),
  43106. this
  43107. }
  43108. },
  43109. n.Math = {
  43110. generateUUID: function() {
  43111. var e, t = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""), i = new Array(36), n = 0;
  43112. return function() {
  43113. for (var r = 0; r < 36; r++)
  43114. 8 === r || 13 === r || 18 === r || 23 === r ? i[r] = "-" : 14 === r ? i[r] = "4" : (n <= 2 && (n = 33554432 + 16777216 * Math.random() | 0),
  43115. e = 15 & n,
  43116. n >>= 4,
  43117. i[r] = t[19 === r ? 3 & e | 8 : e]);
  43118. return i.join("")
  43119. }
  43120. }(),
  43121. clamp: function(e, t, i) {
  43122. return Math.max(t, Math.min(i, e))
  43123. },
  43124. euclideanModulo: function(e, t) {
  43125. return (e % t + t) % t
  43126. },
  43127. mapLinear: function(e, t, i, n, r) {
  43128. return n + (e - t) * (r - n) / (i - t)
  43129. },
  43130. smoothstep: function(e, t, i) {
  43131. return e <= t ? 0 : e >= i ? 1 : (e = (e - t) / (i - t),
  43132. e * e * (3 - 2 * e))
  43133. },
  43134. smootherstep: function(e, t, i) {
  43135. return e <= t ? 0 : e >= i ? 1 : (e = (e - t) / (i - t),
  43136. e * e * e * (e * (6 * e - 15) + 10))
  43137. },
  43138. random16: function() {
  43139. return console.warn("THREE.Math.random16() has been deprecated. Use Math.random() instead."),
  43140. Math.random()
  43141. },
  43142. randInt: function(e, t) {
  43143. return e + Math.floor(Math.random() * (t - e + 1))
  43144. },
  43145. randFloat: function(e, t) {
  43146. return e + Math.random() * (t - e)
  43147. },
  43148. randFloatSpread: function(e) {
  43149. return e * (.5 - Math.random())
  43150. },
  43151. degToRad: function() {
  43152. var e = Math.PI / 180;
  43153. return function(t) {
  43154. return t * e
  43155. }
  43156. }(),
  43157. radToDeg: function() {
  43158. var e = 180 / Math.PI;
  43159. return function(t) {
  43160. return t * e
  43161. }
  43162. }(),
  43163. isPowerOfTwo: function(e) {
  43164. return 0 === (e & e - 1) && 0 !== e
  43165. },
  43166. nearestPowerOfTwo: function(e) {
  43167. return Math.pow(2, Math.round(Math.log(e) / Math.LN2))
  43168. },
  43169. nextPowerOfTwo: function(e) {
  43170. return e--,
  43171. e |= e >> 1,
  43172. e |= e >> 2,
  43173. e |= e >> 4,
  43174. e |= e >> 8,
  43175. e |= e >> 16,
  43176. e++,
  43177. e
  43178. }
  43179. },
  43180. n.Spline = function(e) {
  43181. function t(e, t, i, n, r, o, a) {
  43182. var s = .5 * (i - e)
  43183. , l = .5 * (n - t);
  43184. return (2 * (t - i) + s + l) * a + (-3 * (t - i) - 2 * s - l) * o + s * r + t
  43185. }
  43186. this.points = e;
  43187. var i, r, o, a, s, l, c, h, u, d = [], p = {
  43188. x: 0,
  43189. y: 0,
  43190. z: 0
  43191. };
  43192. this.initFromArray = function(e) {
  43193. this.points = [];
  43194. for (var t = 0; t < e.length; t++)
  43195. this.points[t] = {
  43196. x: e[t][0],
  43197. y: e[t][1],
  43198. z: e[t][2]
  43199. }
  43200. }
  43201. ,
  43202. this.getPoint = function(e) {
  43203. return i = (this.points.length - 1) * e,
  43204. r = Math.floor(i),
  43205. o = i - r,
  43206. d[0] = 0 === r ? r : r - 1,
  43207. d[1] = r,
  43208. d[2] = r > this.points.length - 2 ? this.points.length - 1 : r + 1,
  43209. d[3] = r > this.points.length - 3 ? this.points.length - 1 : r + 2,
  43210. l = this.points[d[0]],
  43211. c = this.points[d[1]],
  43212. h = this.points[d[2]],
  43213. u = this.points[d[3]],
  43214. a = o * o,
  43215. s = o * a,
  43216. p.x = t(l.x, c.x, h.x, u.x, o, a, s),
  43217. p.y = t(l.y, c.y, h.y, u.y, o, a, s),
  43218. p.z = t(l.z, c.z, h.z, u.z, o, a, s),
  43219. p
  43220. }
  43221. ,
  43222. this.getControlPointsArray = function() {
  43223. var e, t, i = this.points.length, n = [];
  43224. for (e = 0; e < i; e++)
  43225. t = this.points[e],
  43226. n[e] = [t.x, t.y, t.z];
  43227. return n
  43228. }
  43229. ,
  43230. this.getLength = function(e) {
  43231. var t, i, r, o, a = 0, s = 0, l = 0, c = new n.Vector3, h = new n.Vector3, u = [], d = 0;
  43232. for (u[0] = 0,
  43233. e || (e = 100),
  43234. r = this.points.length * e,
  43235. c.copy(this.points[0]),
  43236. t = 1; t < r; t++)
  43237. i = t / r,
  43238. o = this.getPoint(i),
  43239. h.copy(o),
  43240. d += h.distanceTo(c),
  43241. c.copy(o),
  43242. a = (this.points.length - 1) * i,
  43243. s = Math.floor(a),
  43244. s !== l && (u[s] = d,
  43245. l = s);
  43246. return u[u.length] = d,
  43247. {
  43248. chunks: u,
  43249. total: d
  43250. }
  43251. }
  43252. ,
  43253. this.reparametrizeByArcLength = function(e) {
  43254. var t, i, r, o, a, s, l, c, h = [], u = new n.Vector3, d = this.getLength();
  43255. for (h.push(u.copy(this.points[0]).clone()),
  43256. t = 1; t < this.points.length; t++) {
  43257. for (s = d.chunks[t] - d.chunks[t - 1],
  43258. l = Math.ceil(e * s / d.total),
  43259. o = (t - 1) / (this.points.length - 1),
  43260. a = t / (this.points.length - 1),
  43261. i = 1; i < l - 1; i++)
  43262. r = o + i * (1 / l) * (a - o),
  43263. c = this.getPoint(r),
  43264. h.push(u.copy(c).clone());
  43265. h.push(u.copy(this.points[t]).clone())
  43266. }
  43267. this.points = h
  43268. }
  43269. }
  43270. ,
  43271. n.Triangle = function(e, t, i) {
  43272. this.a = void 0 !== e ? e : new n.Vector3,
  43273. this.b = void 0 !== t ? t : new n.Vector3,
  43274. this.c = void 0 !== i ? i : new n.Vector3
  43275. }
  43276. ,
  43277. n.Triangle.normal = function() {
  43278. var e = new n.Vector3;
  43279. return function(t, i, r, o) {
  43280. var a = o || new n.Vector3;
  43281. a.subVectors(r, i),
  43282. e.subVectors(t, i),
  43283. a.cross(e);
  43284. var s = a.lengthSq();
  43285. return s > 0 ? a.multiplyScalar(1 / Math.sqrt(s)) : a.set(0, 0, 0)
  43286. }
  43287. }(),
  43288. n.Triangle.barycoordFromPoint = function() {
  43289. var e = new n.Vector3
  43290. , t = new n.Vector3
  43291. , i = new n.Vector3;
  43292. return function(r, o, a, s, l) {
  43293. e.subVectors(s, o),
  43294. t.subVectors(a, o),
  43295. i.subVectors(r, o);
  43296. var c = e.dot(e)
  43297. , h = e.dot(t)
  43298. , u = e.dot(i)
  43299. , d = t.dot(t)
  43300. , p = t.dot(i)
  43301. , f = c * d - h * h
  43302. , g = l || new n.Vector3;
  43303. if (0 === f)
  43304. return g.set(-2, -1, -1);
  43305. var m = 1 / f
  43306. , v = (d * u - h * p) * m
  43307. , A = (c * p - h * u) * m;
  43308. return g.set(1 - v - A, A, v)
  43309. }
  43310. }(),
  43311. n.Triangle.containsPoint = function() {
  43312. var e = new n.Vector3;
  43313. return function(t, i, r, o) {
  43314. var a = n.Triangle.barycoordFromPoint(t, i, r, o, e);
  43315. return a.x >= 0 && a.y >= 0 && a.x + a.y <= 1
  43316. }
  43317. }(),
  43318. n.Triangle.prototype = {
  43319. constructor: n.Triangle,
  43320. set: function(e, t, i) {
  43321. return this.a.copy(e),
  43322. this.b.copy(t),
  43323. this.c.copy(i),
  43324. this
  43325. },
  43326. setFromPointsAndIndices: function(e, t, i, n) {
  43327. return this.a.copy(e[t]),
  43328. this.b.copy(e[i]),
  43329. this.c.copy(e[n]),
  43330. this
  43331. },
  43332. clone: function() {
  43333. return (new this.constructor).copy(this)
  43334. },
  43335. copy: function(e) {
  43336. return this.a.copy(e.a),
  43337. this.b.copy(e.b),
  43338. this.c.copy(e.c),
  43339. this
  43340. },
  43341. area: function() {
  43342. var e = new n.Vector3
  43343. , t = new n.Vector3;
  43344. return function() {
  43345. return e.subVectors(this.c, this.b),
  43346. t.subVectors(this.a, this.b),
  43347. .5 * e.cross(t).length()
  43348. }
  43349. }(),
  43350. midpoint: function(e) {
  43351. var t = e || new n.Vector3;
  43352. return t.addVectors(this.a, this.b).add(this.c).multiplyScalar(1 / 3)
  43353. },
  43354. normal: function(e) {
  43355. return n.Triangle.normal(this.a, this.b, this.c, e)
  43356. },
  43357. plane: function(e) {
  43358. var t = e || new n.Plane;
  43359. return t.setFromCoplanarPoints(this.a, this.b, this.c)
  43360. },
  43361. barycoordFromPoint: function(e, t) {
  43362. return n.Triangle.barycoordFromPoint(e, this.a, this.b, this.c, t)
  43363. },
  43364. containsPoint: function(e) {
  43365. return n.Triangle.containsPoint(e, this.a, this.b, this.c)
  43366. },
  43367. equals: function(e) {
  43368. return e.a.equals(this.a) && e.b.equals(this.b) && e.c.equals(this.c)
  43369. }
  43370. },
  43371. n.Interpolant = function(e, t, i, n) {
  43372. this.parameterPositions = e,
  43373. this._cachedIndex = 0,
  43374. this.resultBuffer = void 0 !== n ? n : new t.constructor(i),
  43375. this.sampleValues = t,
  43376. this.valueSize = i
  43377. }
  43378. ,
  43379. n.Interpolant.prototype = {
  43380. constructor: n.Interpolant,
  43381. evaluate: function(e) {
  43382. var t = this.parameterPositions
  43383. , i = this._cachedIndex
  43384. , n = t[i]
  43385. , r = t[i - 1];
  43386. e: {
  43387. t: {
  43388. var o;
  43389. i: {
  43390. n: if (!(e < n)) {
  43391. for (var a = i + 2; ; ) {
  43392. if (void 0 === n) {
  43393. if (e < r)
  43394. break n;
  43395. return i = t.length,
  43396. this._cachedIndex = i,
  43397. this.afterEnd_(i - 1, e, r)
  43398. }
  43399. if (i === a)
  43400. break;
  43401. if (r = n,
  43402. n = t[++i],
  43403. e < n)
  43404. break t
  43405. }
  43406. o = t.length;
  43407. break i
  43408. }
  43409. {
  43410. if (e >= r)
  43411. break e;
  43412. var s = t[1];
  43413. e < s && (i = 2,
  43414. r = s);
  43415. for (var a = i - 2; ; ) {
  43416. if (void 0 === r)
  43417. return this._cachedIndex = 0,
  43418. this.beforeStart_(0, e, n);
  43419. if (i === a)
  43420. break;
  43421. if (n = r,
  43422. r = t[--i - 1],
  43423. e >= r)
  43424. break t
  43425. }
  43426. o = i,
  43427. i = 0
  43428. }
  43429. }
  43430. for (; i < o; ) {
  43431. var l = i + o >>> 1;
  43432. e < t[l] ? o = l : i = l + 1
  43433. }
  43434. if (n = t[i],
  43435. r = t[i - 1],
  43436. void 0 === r)
  43437. return this._cachedIndex = 0,
  43438. this.beforeStart_(0, e, n);
  43439. if (void 0 === n)
  43440. return i = t.length,
  43441. this._cachedIndex = i,
  43442. this.afterEnd_(i - 1, r, e)
  43443. }
  43444. this._cachedIndex = i,
  43445. this.intervalChanged_(i, r, n)
  43446. }
  43447. return this.interpolate_(i, r, e, n)
  43448. },
  43449. settings: null,
  43450. DefaultSettings_: {},
  43451. getSettings_: function() {
  43452. return this.settings || this.DefaultSettings_
  43453. },
  43454. copySampleValue_: function(e) {
  43455. for (var t = this.resultBuffer, i = this.sampleValues, n = this.valueSize, r = e * n, o = 0; o !== n; ++o)
  43456. t[o] = i[r + o];
  43457. return t
  43458. },
  43459. interpolate_: function(e, t, i, n) {
  43460. throw new Error("call to abstract method")
  43461. },
  43462. intervalChanged_: function(e, t, i) {}
  43463. },
  43464. Object.assign(n.Interpolant.prototype, {
  43465. beforeStart_: n.Interpolant.prototype.copySampleValue_,
  43466. afterEnd_: n.Interpolant.prototype.copySampleValue_
  43467. }),
  43468. n.CubicInterpolant = function(e, t, i, r) {
  43469. n.Interpolant.call(this, e, t, i, r),
  43470. this._weightPrev = -0,
  43471. this._offsetPrev = -0,
  43472. this._weightNext = -0,
  43473. this._offsetNext = -0
  43474. }
  43475. ,
  43476. n.CubicInterpolant.prototype = Object.assign(Object.create(n.Interpolant.prototype), {
  43477. constructor: n.CubicInterpolant,
  43478. DefaultSettings_: {
  43479. endingStart: n.ZeroCurvatureEnding,
  43480. endingEnd: n.ZeroCurvatureEnding
  43481. },
  43482. intervalChanged_: function(e, t, i) {
  43483. var r = this.parameterPositions
  43484. , o = e - 2
  43485. , a = e + 1
  43486. , s = r[o]
  43487. , l = r[a];
  43488. if (void 0 === s)
  43489. switch (this.getSettings_().endingStart) {
  43490. case n.ZeroSlopeEnding:
  43491. o = e,
  43492. s = 2 * t - i;
  43493. break;
  43494. case n.WrapAroundEnding:
  43495. o = r.length - 2,
  43496. s = t + r[o] - r[o + 1];
  43497. break;
  43498. default:
  43499. o = e,
  43500. s = i
  43501. }
  43502. if (void 0 === l)
  43503. switch (this.getSettings_().endingEnd) {
  43504. case n.ZeroSlopeEnding:
  43505. a = e,
  43506. l = 2 * i - t;
  43507. break;
  43508. case n.WrapAroundEnding:
  43509. a = 1,
  43510. l = i + r[1] - r[0];
  43511. break;
  43512. default:
  43513. a = e - 1,
  43514. l = t
  43515. }
  43516. var c = .5 * (i - t)
  43517. , h = this.valueSize;
  43518. this._weightPrev = c / (t - s),
  43519. this._weightNext = c / (l - i),
  43520. this._offsetPrev = o * h,
  43521. this._offsetNext = a * h
  43522. },
  43523. interpolate_: function(e, t, i, n) {
  43524. 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)
  43525. r[C] = m * o[c + C] + v * o[l + C] + A * o[s + C] + y * o[h + C];
  43526. return r
  43527. }
  43528. }),
  43529. n.DiscreteInterpolant = function(e, t, i, r) {
  43530. n.Interpolant.call(this, e, t, i, r)
  43531. }
  43532. ,
  43533. n.DiscreteInterpolant.prototype = Object.assign(Object.create(n.Interpolant.prototype), {
  43534. constructor: n.DiscreteInterpolant,
  43535. interpolate_: function(e, t, i, n) {
  43536. return this.copySampleValue_(e - 1)
  43537. }
  43538. }),
  43539. n.LinearInterpolant = function(e, t, i, r) {
  43540. n.Interpolant.call(this, e, t, i, r)
  43541. }
  43542. ,
  43543. n.LinearInterpolant.prototype = Object.assign(Object.create(n.Interpolant.prototype), {
  43544. constructor: n.LinearInterpolant,
  43545. interpolate_: function(e, t, i, n) {
  43546. 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)
  43547. r[u] = o[l + u] * h + o[s + u] * c;
  43548. return r
  43549. }
  43550. }),
  43551. n.QuaternionLinearInterpolant = function(e, t, i, r) {
  43552. n.Interpolant.call(this, e, t, i, r)
  43553. }
  43554. ,
  43555. n.QuaternionLinearInterpolant.prototype = Object.assign(Object.create(n.Interpolant.prototype), {
  43556. constructor: n.QuaternionLinearInterpolant,
  43557. interpolate_: function(e, t, i, r) {
  43558. 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)
  43559. n.Quaternion.slerpFlat(o, 0, a, l - s, a, l, c);
  43560. return o
  43561. }
  43562. }),
  43563. n.Clock = function(e) {
  43564. this.autoStart = void 0 === e || e,
  43565. this.startTime = 0,
  43566. this.oldTime = 0,
  43567. this.elapsedTime = 0,
  43568. this.running = !1
  43569. }
  43570. ,
  43571. n.Clock.prototype = {
  43572. constructor: n.Clock,
  43573. start: function() {
  43574. this.startTime = performance.now(),
  43575. this.oldTime = this.startTime,
  43576. this.running = !0
  43577. },
  43578. stop: function() {
  43579. this.getElapsedTime(),
  43580. this.running = !1
  43581. },
  43582. getElapsedTime: function() {
  43583. return this.getDelta(),
  43584. this.elapsedTime
  43585. },
  43586. getDelta: function() {
  43587. var e = 0;
  43588. if (this.autoStart && !this.running && this.start(),
  43589. this.running) {
  43590. var t = performance.now();
  43591. e = .001 * (t - this.oldTime),
  43592. this.oldTime = t,
  43593. this.elapsedTime += e
  43594. }
  43595. return e
  43596. }
  43597. },
  43598. n.EventDispatcher = function() {}
  43599. ,
  43600. n.EventDispatcher.prototype = {
  43601. constructor: n.EventDispatcher,
  43602. apply: function(e) {
  43603. e.addEventListener = n.EventDispatcher.prototype.addEventListener,
  43604. e.hasEventListener = n.EventDispatcher.prototype.hasEventListener,
  43605. e.removeEventListener = n.EventDispatcher.prototype.removeEventListener,
  43606. e.dispatchEvent = n.EventDispatcher.prototype.dispatchEvent
  43607. },
  43608. addEventListener: function(e, t) {
  43609. void 0 === this._listeners && (this._listeners = {});
  43610. var i = this._listeners;
  43611. void 0 === i[e] && (i[e] = []),
  43612. i[e].indexOf(t) === -1 && i[e].push(t)
  43613. },
  43614. hasEventListener: function(e, t) {
  43615. if (void 0 === this._listeners)
  43616. return !1;
  43617. var i = this._listeners;
  43618. return void 0 !== i[e] && i[e].indexOf(t) !== -1
  43619. },
  43620. removeEventListener: function(e, t) {
  43621. if (void 0 !== this._listeners) {
  43622. var i = this._listeners
  43623. , n = i[e];
  43624. if (void 0 !== n) {
  43625. var r = n.indexOf(t);
  43626. r !== -1 && n.splice(r, 1)
  43627. }
  43628. }
  43629. },
  43630. dispatchEvent: function(e) {
  43631. if (void 0 !== this._listeners) {
  43632. var t = this._listeners
  43633. , i = t[e.type];
  43634. if (void 0 !== i) {
  43635. e.target = this;
  43636. for (var n = [], r = i.length, o = 0; o < r; o++)
  43637. n[o] = i[o];
  43638. for (var o = 0; o < r; o++)
  43639. n[o].call(this, e)
  43640. }
  43641. }
  43642. }
  43643. },
  43644. n.Layers = function() {
  43645. this.mask = 1
  43646. }
  43647. ,
  43648. n.Layers.prototype = {
  43649. constructor: n.Layers,
  43650. set: function(e) {
  43651. this.mask = 1 << e
  43652. },
  43653. enable: function(e) {
  43654. this.mask |= 1 << e
  43655. },
  43656. toggle: function(e) {
  43657. this.mask ^= 1 << e
  43658. },
  43659. disable: function(e) {
  43660. this.mask &= ~(1 << e)
  43661. },
  43662. test: function(e) {
  43663. return 0 !== (this.mask & e.mask)
  43664. }
  43665. },
  43666. function(e) {
  43667. function t(e, t) {
  43668. return e.distance - t.distance
  43669. }
  43670. function i(e, t, n, r) {
  43671. if (e.visible !== !1 && (e.raycast(t, n),
  43672. r === !0))
  43673. for (var o = e.children, a = 0, s = o.length; a < s; a++)
  43674. i(o[a], t, n, !0)
  43675. }
  43676. e.Raycaster = function(t, i, n, r) {
  43677. this.ray = new e.Ray(t,i),
  43678. this.near = n || 0,
  43679. this.far = r || 1 / 0,
  43680. this.params = {
  43681. Mesh: {},
  43682. Line: {},
  43683. LOD: {},
  43684. Points: {
  43685. threshold: 1
  43686. },
  43687. Sprite: {}
  43688. },
  43689. Object.defineProperties(this.params, {
  43690. PointCloud: {
  43691. get: function() {
  43692. return console.warn("THREE.Raycaster: params.PointCloud has been renamed to params.Points."),
  43693. this.Points
  43694. }
  43695. }
  43696. })
  43697. }
  43698. ,
  43699. e.Raycaster.prototype = {
  43700. constructor: e.Raycaster,
  43701. linePrecision: 1,
  43702. set: function(e, t) {
  43703. this.ray.set(e, t)
  43704. },
  43705. setFromCamera: function(t, i) {
  43706. i instanceof e.PerspectiveCamera ? (this.ray.origin.setFromMatrixPosition(i.matrixWorld),
  43707. 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),
  43708. this.ray.direction.set(0, 0, -1).transformDirection(i.matrixWorld)) : console.error("THREE.Raycaster: Unsupported camera type.")
  43709. },
  43710. intersectObject: function(e, n) {
  43711. var r = [];
  43712. return i(e, this, r, n),
  43713. r.sort(t),
  43714. r
  43715. },
  43716. intersectObjects: function(e, n) {
  43717. var r = [];
  43718. if (Array.isArray(e) === !1)
  43719. return console.warn("THREE.Raycaster.intersectObjects: objects is not an Array."),
  43720. r;
  43721. for (var o = 0, a = e.length; o < a; o++)
  43722. i(e[o], this, r, n);
  43723. return r.sort(t),
  43724. r
  43725. }
  43726. }
  43727. }(n),
  43728. n.Object3D = function() {
  43729. function e() {
  43730. o.setFromEuler(r, !1)
  43731. }
  43732. function t() {
  43733. r.setFromQuaternion(o, void 0, !1)
  43734. }
  43735. Object.defineProperty(this, "id", {
  43736. value: n.Object3DIdCount++
  43737. }),
  43738. this.uuid = n.Math.generateUUID(),
  43739. this.name = "",
  43740. this.type = "Object3D",
  43741. this.parent = null,
  43742. this.children = [],
  43743. this.up = n.Object3D.DefaultUp.clone();
  43744. var i = new n.Vector3
  43745. , r = new n.Euler
  43746. , o = new n.Quaternion
  43747. , a = new n.Vector3(1,1,1);
  43748. r.onChange(e),
  43749. o.onChange(t),
  43750. Object.defineProperties(this, {
  43751. position: {
  43752. enumerable: !0,
  43753. value: i
  43754. },
  43755. rotation: {
  43756. enumerable: !0,
  43757. value: r
  43758. },
  43759. quaternion: {
  43760. enumerable: !0,
  43761. value: o
  43762. },
  43763. scale: {
  43764. enumerable: !0,
  43765. value: a
  43766. },
  43767. modelViewMatrix: {
  43768. value: new n.Matrix4
  43769. },
  43770. normalMatrix: {
  43771. value: new n.Matrix3
  43772. }
  43773. }),
  43774. this.rotationAutoUpdate = !0,
  43775. this.matrix = new n.Matrix4,
  43776. this.matrixWorld = new n.Matrix4,
  43777. this.matrixAutoUpdate = n.Object3D.DefaultMatrixAutoUpdate,
  43778. this.matrixWorldNeedsUpdate = !1,
  43779. this.layers = new n.Layers,
  43780. this.visible = !0,
  43781. this.castShadow = !1,
  43782. this.receiveShadow = !1,
  43783. this.frustumCulled = !0,
  43784. this.renderOrder = 0,
  43785. this.userData = {}
  43786. }
  43787. ,
  43788. n.Object3D.DefaultUp = new n.Vector3(0,1,0),
  43789. n.Object3D.DefaultMatrixAutoUpdate = !0,
  43790. n.Object3D.prototype = {
  43791. constructor: n.Object3D,
  43792. applyMatrix: function(e) {
  43793. this.matrix.multiplyMatrices(e, this.matrix),
  43794. this.matrix.decompose(this.position, this.quaternion, this.scale)
  43795. },
  43796. setRotationFromAxisAngle: function(e, t) {
  43797. this.quaternion.setFromAxisAngle(e, t)
  43798. },
  43799. setRotationFromEuler: function(e) {
  43800. this.quaternion.setFromEuler(e, !0)
  43801. },
  43802. setRotationFromMatrix: function(e) {
  43803. this.quaternion.setFromRotationMatrix(e)
  43804. },
  43805. setRotationFromQuaternion: function(e) {
  43806. this.quaternion.copy(e)
  43807. },
  43808. rotateOnAxis: function() {
  43809. var e = new n.Quaternion;
  43810. return function(t, i) {
  43811. return e.setFromAxisAngle(t, i),
  43812. this.quaternion.multiply(e),
  43813. this
  43814. }
  43815. }(),
  43816. rotateX: function() {
  43817. var e = new n.Vector3(1,0,0);
  43818. return function(t) {
  43819. return this.rotateOnAxis(e, t)
  43820. }
  43821. }(),
  43822. rotateY: function() {
  43823. var e = new n.Vector3(0,1,0);
  43824. return function(t) {
  43825. return this.rotateOnAxis(e, t)
  43826. }
  43827. }(),
  43828. rotateZ: function() {
  43829. var e = new n.Vector3(0,0,1);
  43830. return function(t) {
  43831. return this.rotateOnAxis(e, t)
  43832. }
  43833. }(),
  43834. translateOnAxis: function() {
  43835. var e = new n.Vector3;
  43836. return function(t, i) {
  43837. return e.copy(t).applyQuaternion(this.quaternion),
  43838. this.position.add(e.multiplyScalar(i)),
  43839. this
  43840. }
  43841. }(),
  43842. translateX: function() {
  43843. var e = new n.Vector3(1,0,0);
  43844. return function(t) {
  43845. return this.translateOnAxis(e, t)
  43846. }
  43847. }(),
  43848. translateY: function() {
  43849. var e = new n.Vector3(0,1,0);
  43850. return function(t) {
  43851. return this.translateOnAxis(e, t)
  43852. }
  43853. }(),
  43854. translateZ: function() {
  43855. var e = new n.Vector3(0,0,1);
  43856. return function(t) {
  43857. return this.translateOnAxis(e, t)
  43858. }
  43859. }(),
  43860. localToWorld: function(e) {
  43861. return e.applyMatrix4(this.matrixWorld)
  43862. },
  43863. worldToLocal: function() {
  43864. var e = new n.Matrix4;
  43865. return function(t) {
  43866. return t.applyMatrix4(e.getInverse(this.matrixWorld))
  43867. }
  43868. }(),
  43869. lookAt: function() {
  43870. var e = new n.Matrix4;
  43871. return function(t) {
  43872. e.lookAt(t, this.position, this.up),
  43873. this.quaternion.setFromRotationMatrix(e)
  43874. }
  43875. }(),
  43876. add: function(e) {
  43877. if (arguments.length > 1) {
  43878. for (var t = 0; t < arguments.length; t++)
  43879. this.add(arguments[t]);
  43880. return this
  43881. }
  43882. return e === this ? (console.error("THREE.Object3D.add: object can't be added as a child of itself.", e),
  43883. this) : (e instanceof n.Object3D ? (null !== e.parent && e.parent.remove(e),
  43884. e.parent = this,
  43885. e.dispatchEvent({
  43886. type: "added"
  43887. }),
  43888. this.children.push(e)) : console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.", e),
  43889. this)
  43890. },
  43891. remove: function(e) {
  43892. if (arguments.length > 1)
  43893. for (var t = 0; t < arguments.length; t++)
  43894. this.remove(arguments[t]);
  43895. var i = this.children.indexOf(e);
  43896. i !== -1 && (e.parent = null,
  43897. e.dispatchEvent({
  43898. type: "removed"
  43899. }),
  43900. this.children.splice(i, 1))
  43901. },
  43902. getObjectById: function(e) {
  43903. return this.getObjectByProperty("id", e)
  43904. },
  43905. getObjectByName: function(e) {
  43906. return this.getObjectByProperty("name", e)
  43907. },
  43908. getObjectByProperty: function(e, t) {
  43909. if (this[e] === t)
  43910. return this;
  43911. for (var i = 0, n = this.children.length; i < n; i++) {
  43912. var r = this.children[i]
  43913. , o = r.getObjectByProperty(e, t);
  43914. if (void 0 !== o)
  43915. return o
  43916. }
  43917. },
  43918. getWorldPosition: function(e) {
  43919. var t = e || new n.Vector3;
  43920. return this.updateMatrixWorld(!0),
  43921. t.setFromMatrixPosition(this.matrixWorld)
  43922. },
  43923. getWorldQuaternion: function() {
  43924. var e = new n.Vector3
  43925. , t = new n.Vector3;
  43926. return function(i) {
  43927. var r = i || new n.Quaternion;
  43928. return this.updateMatrixWorld(!0),
  43929. this.matrixWorld.decompose(e, r, t),
  43930. r
  43931. }
  43932. }(),
  43933. getWorldRotation: function() {
  43934. var e = new n.Quaternion;
  43935. return function(t) {
  43936. var i = t || new n.Euler;
  43937. return this.getWorldQuaternion(e),
  43938. i.setFromQuaternion(e, this.rotation.order, !1)
  43939. }
  43940. }(),
  43941. getWorldScale: function() {
  43942. var e = new n.Vector3
  43943. , t = new n.Quaternion;
  43944. return function(i) {
  43945. var r = i || new n.Vector3;
  43946. return this.updateMatrixWorld(!0),
  43947. this.matrixWorld.decompose(e, t, r),
  43948. r
  43949. }
  43950. }(),
  43951. getWorldDirection: function() {
  43952. var e = new n.Quaternion;
  43953. return function(t) {
  43954. var i = t || new n.Vector3;
  43955. return this.getWorldQuaternion(e),
  43956. i.set(0, 0, 1).applyQuaternion(e)
  43957. }
  43958. }(),
  43959. raycast: function() {},
  43960. traverse: function(e) {
  43961. e(this);
  43962. for (var t = this.children, i = 0, n = t.length; i < n; i++)
  43963. t[i].traverse(e)
  43964. },
  43965. traverseVisible: function(e) {
  43966. if (this.visible !== !1) {
  43967. e(this);
  43968. for (var t = this.children, i = 0, n = t.length; i < n; i++)
  43969. t[i].traverseVisible(e)
  43970. }
  43971. },
  43972. traverseAncestors: function(e) {
  43973. var t = this.parent;
  43974. null !== t && (e(t),
  43975. t.traverseAncestors(e))
  43976. },
  43977. updateMatrix: function() {
  43978. this.matrix.compose(this.position, this.quaternion, this.scale),
  43979. this.matrixWorldNeedsUpdate = !0
  43980. },
  43981. updateMatrixWorld: function(e) {
  43982. this.matrixAutoUpdate === !0 && this.updateMatrix(),
  43983. this.matrixWorldNeedsUpdate !== !0 && e !== !0 || (null === this.parent ? this.matrixWorld.copy(this.matrix) : this.matrixWorld.multiplyMatrices(this.parent.matrixWorld, this.matrix),
  43984. this.matrixWorldNeedsUpdate = !1,
  43985. e = !0);
  43986. for (var t = 0, i = this.children.length; t < i; t++)
  43987. this.children[t].updateMatrixWorld(e)
  43988. },
  43989. toJSON: function(e) {
  43990. function t(e) {
  43991. var t = [];
  43992. for (var i in e) {
  43993. var n = e[i];
  43994. delete n.metadata,
  43995. t.push(n)
  43996. }
  43997. return t
  43998. }
  43999. var i = void 0 === e
  44000. , n = {};
  44001. i && (e = {
  44002. geometries: {},
  44003. materials: {},
  44004. textures: {},
  44005. images: {}
  44006. },
  44007. n.metadata = {
  44008. version: 4.4,
  44009. type: "Object",
  44010. generator: "Object3D.toJSON"
  44011. });
  44012. var r = {};
  44013. if (r.uuid = this.uuid,
  44014. r.type = this.type,
  44015. "" !== this.name && (r.name = this.name),
  44016. "{}" !== JSON.stringify(this.userData) && (r.userData = this.userData),
  44017. this.castShadow === !0 && (r.castShadow = !0),
  44018. this.receiveShadow === !0 && (r.receiveShadow = !0),
  44019. this.visible === !1 && (r.visible = !1),
  44020. r.matrix = this.matrix.toArray(),
  44021. void 0 !== this.geometry && (void 0 === e.geometries[this.geometry.uuid] && (e.geometries[this.geometry.uuid] = this.geometry.toJSON(e)),
  44022. r.geometry = this.geometry.uuid),
  44023. void 0 !== this.material && (void 0 === e.materials[this.material.uuid] && (e.materials[this.material.uuid] = this.material.toJSON(e)),
  44024. r.material = this.material.uuid),
  44025. this.children.length > 0) {
  44026. r.children = [];
  44027. for (var o = 0; o < this.children.length; o++)
  44028. r.children.push(this.children[o].toJSON(e).object)
  44029. }
  44030. if (i) {
  44031. var a = t(e.geometries)
  44032. , s = t(e.materials)
  44033. , l = t(e.textures)
  44034. , c = t(e.images);
  44035. a.length > 0 && (n.geometries = a),
  44036. s.length > 0 && (n.materials = s),
  44037. l.length > 0 && (n.textures = l),
  44038. c.length > 0 && (n.images = c)
  44039. }
  44040. return n.object = r,
  44041. n
  44042. },
  44043. clone: function(e) {
  44044. return (new this.constructor).copy(this, e)
  44045. },
  44046. copy: function(e, t) {
  44047. if (void 0 === t && (t = !0),
  44048. this.name = e.name,
  44049. this.up.copy(e.up),
  44050. this.position.copy(e.position),
  44051. this.quaternion.copy(e.quaternion),
  44052. this.scale.copy(e.scale),
  44053. this.rotationAutoUpdate = e.rotationAutoUpdate,
  44054. this.matrix.copy(e.matrix),
  44055. this.matrixWorld.copy(e.matrixWorld),
  44056. this.matrixAutoUpdate = e.matrixAutoUpdate,
  44057. this.matrixWorldNeedsUpdate = e.matrixWorldNeedsUpdate,
  44058. this.visible = e.visible,
  44059. this.castShadow = e.castShadow,
  44060. this.receiveShadow = e.receiveShadow,
  44061. this.frustumCulled = e.frustumCulled,
  44062. this.renderOrder = e.renderOrder,
  44063. this.userData = JSON.parse(JSON.stringify(e.userData)),
  44064. t === !0)
  44065. for (var i = 0; i < e.children.length; i++) {
  44066. var n = e.children[i];
  44067. this.add(n.clone())
  44068. }
  44069. return this
  44070. }
  44071. },
  44072. n.EventDispatcher.prototype.apply(n.Object3D.prototype),
  44073. n.Object3DIdCount = 0,
  44074. n.Face3 = function(e, t, i, r, o, a) {
  44075. this.a = e,
  44076. this.b = t,
  44077. this.c = i,
  44078. this.normal = r instanceof n.Vector3 ? r : new n.Vector3,
  44079. this.vertexNormals = Array.isArray(r) ? r : [],
  44080. this.color = o instanceof n.Color ? o : new n.Color,
  44081. this.vertexColors = Array.isArray(o) ? o : [],
  44082. this.materialIndex = void 0 !== a ? a : 0
  44083. }
  44084. ,
  44085. n.Face3.prototype = {
  44086. constructor: n.Face3,
  44087. clone: function() {
  44088. return (new this.constructor).copy(this)
  44089. },
  44090. copy: function(e) {
  44091. this.a = e.a,
  44092. this.b = e.b,
  44093. this.c = e.c,
  44094. this.normal.copy(e.normal),
  44095. this.color.copy(e.color),
  44096. this.materialIndex = e.materialIndex;
  44097. for (var t = 0, i = e.vertexNormals.length; t < i; t++)
  44098. this.vertexNormals[t] = e.vertexNormals[t].clone();
  44099. for (var t = 0, i = e.vertexColors.length; t < i; t++)
  44100. this.vertexColors[t] = e.vertexColors[t].clone();
  44101. return this
  44102. }
  44103. },
  44104. n.BufferAttribute = function(e, t) {
  44105. this.uuid = n.Math.generateUUID(),
  44106. this.array = e,
  44107. this.itemSize = t,
  44108. this.dynamic = !1,
  44109. this.updateRange = {
  44110. offset: 0,
  44111. count: -1
  44112. },
  44113. this.version = 0
  44114. }
  44115. ,
  44116. n.BufferAttribute.prototype = {
  44117. constructor: n.BufferAttribute,
  44118. get count() {
  44119. return this.array.length / this.itemSize
  44120. },
  44121. set needsUpdate(e) {
  44122. e === !0 && this.version++
  44123. },
  44124. setDynamic: function(e) {
  44125. return this.dynamic = e,
  44126. this
  44127. },
  44128. copy: function(e) {
  44129. return this.array = new e.array.constructor(e.array),
  44130. this.itemSize = e.itemSize,
  44131. this.dynamic = e.dynamic,
  44132. this
  44133. },
  44134. copyAt: function(e, t, i) {
  44135. e *= this.itemSize,
  44136. i *= t.itemSize;
  44137. for (var n = 0, r = this.itemSize; n < r; n++)
  44138. this.array[e + n] = t.array[i + n];
  44139. return this
  44140. },
  44141. copyArray: function(e) {
  44142. return this.array.set(e),
  44143. this
  44144. },
  44145. copyColorsArray: function(e) {
  44146. for (var t = this.array, i = 0, r = 0, o = e.length; r < o; r++) {
  44147. var a = e[r];
  44148. void 0 === a && (console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined", r),
  44149. a = new n.Color),
  44150. t[i++] = a.r,
  44151. t[i++] = a.g,
  44152. t[i++] = a.b
  44153. }
  44154. return this
  44155. },
  44156. copyIndicesArray: function(e) {
  44157. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  44158. var o = e[n];
  44159. t[i++] = o.a,
  44160. t[i++] = o.b,
  44161. t[i++] = o.c
  44162. }
  44163. return this
  44164. },
  44165. copyVector2sArray: function(e) {
  44166. for (var t = this.array, i = 0, r = 0, o = e.length; r < o; r++) {
  44167. var a = e[r];
  44168. void 0 === a && (console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined", r),
  44169. a = new n.Vector2),
  44170. t[i++] = a.x,
  44171. t[i++] = a.y
  44172. }
  44173. return this
  44174. },
  44175. copyVector3sArray: function(e) {
  44176. for (var t = this.array, i = 0, r = 0, o = e.length; r < o; r++) {
  44177. var a = e[r];
  44178. void 0 === a && (console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined", r),
  44179. a = new n.Vector3),
  44180. t[i++] = a.x,
  44181. t[i++] = a.y,
  44182. t[i++] = a.z
  44183. }
  44184. return this
  44185. },
  44186. copyVector4sArray: function(e) {
  44187. for (var t = this.array, i = 0, r = 0, o = e.length; r < o; r++) {
  44188. var a = e[r];
  44189. void 0 === a && (console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined", r),
  44190. a = new n.Vector4),
  44191. t[i++] = a.x,
  44192. t[i++] = a.y,
  44193. t[i++] = a.z,
  44194. t[i++] = a.w
  44195. }
  44196. return this
  44197. },
  44198. set: function(e, t) {
  44199. return void 0 === t && (t = 0),
  44200. this.array.set(e, t),
  44201. this
  44202. },
  44203. getX: function(e) {
  44204. return this.array[e * this.itemSize]
  44205. },
  44206. setX: function(e, t) {
  44207. return this.array[e * this.itemSize] = t,
  44208. this
  44209. },
  44210. getY: function(e) {
  44211. return this.array[e * this.itemSize + 1]
  44212. },
  44213. setY: function(e, t) {
  44214. return this.array[e * this.itemSize + 1] = t,
  44215. this
  44216. },
  44217. getZ: function(e) {
  44218. return this.array[e * this.itemSize + 2]
  44219. },
  44220. setZ: function(e, t) {
  44221. return this.array[e * this.itemSize + 2] = t,
  44222. this
  44223. },
  44224. getW: function(e) {
  44225. return this.array[e * this.itemSize + 3]
  44226. },
  44227. setW: function(e, t) {
  44228. return this.array[e * this.itemSize + 3] = t,
  44229. this
  44230. },
  44231. setXY: function(e, t, i) {
  44232. return e *= this.itemSize,
  44233. this.array[e + 0] = t,
  44234. this.array[e + 1] = i,
  44235. this
  44236. },
  44237. setXYZ: function(e, t, i, n) {
  44238. return e *= this.itemSize,
  44239. this.array[e + 0] = t,
  44240. this.array[e + 1] = i,
  44241. this.array[e + 2] = n,
  44242. this
  44243. },
  44244. setXYZW: function(e, t, i, n, r) {
  44245. return e *= this.itemSize,
  44246. this.array[e + 0] = t,
  44247. this.array[e + 1] = i,
  44248. this.array[e + 2] = n,
  44249. this.array[e + 3] = r,
  44250. this
  44251. },
  44252. clone: function() {
  44253. return (new this.constructor).copy(this)
  44254. }
  44255. },
  44256. n.Int8Attribute = function(e, t) {
  44257. return new n.BufferAttribute(new Int8Array(e),t)
  44258. }
  44259. ,
  44260. n.Uint8Attribute = function(e, t) {
  44261. return new n.BufferAttribute(new Uint8Array(e),t)
  44262. }
  44263. ,
  44264. n.Uint8ClampedAttribute = function(e, t) {
  44265. return new n.BufferAttribute(new Uint8ClampedArray(e),t)
  44266. }
  44267. ,
  44268. n.Int16Attribute = function(e, t) {
  44269. return new n.BufferAttribute(new Int16Array(e),t)
  44270. }
  44271. ,
  44272. n.Uint16Attribute = function(e, t) {
  44273. return new n.BufferAttribute(new Uint16Array(e),t)
  44274. }
  44275. ;
  44276. n.Int32Attribute = function(e, t) {
  44277. return new n.BufferAttribute(new Int32Array(e),t)
  44278. }
  44279. ;
  44280. n.Uint32Attribute = function(e, t) {
  44281. return new n.BufferAttribute(new Uint32Array(e),t)
  44282. }
  44283. ,
  44284. n.Float32Attribute = function(e, t) {
  44285. return new n.BufferAttribute(new Float32Array(e),t)
  44286. }
  44287. ,
  44288. n.Float64Attribute = function(e, t) {
  44289. return new n.BufferAttribute(new Float64Array(e),t)
  44290. }
  44291. ,
  44292. n.DynamicBufferAttribute = function(e, t) {
  44293. return console.warn("THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setDynamic( true ) instead."),
  44294. new n.BufferAttribute(e,t).setDynamic(!0)
  44295. }
  44296. ,
  44297. n.InstancedBufferAttribute = function(e, t, i) {
  44298. n.BufferAttribute.call(this, e, t),
  44299. this.meshPerAttribute = i || 1
  44300. }
  44301. ,
  44302. n.InstancedBufferAttribute.prototype = Object.create(n.BufferAttribute.prototype),
  44303. n.InstancedBufferAttribute.prototype.constructor = n.InstancedBufferAttribute,
  44304. n.InstancedBufferAttribute.prototype.copy = function(e) {
  44305. return n.BufferAttribute.prototype.copy.call(this, e),
  44306. this.meshPerAttribute = e.meshPerAttribute,
  44307. this
  44308. }
  44309. ,
  44310. n.InterleavedBuffer = function(e, t) {
  44311. this.uuid = n.Math.generateUUID(),
  44312. this.array = e,
  44313. this.stride = t,
  44314. this.dynamic = !1,
  44315. this.updateRange = {
  44316. offset: 0,
  44317. count: -1
  44318. },
  44319. this.version = 0
  44320. }
  44321. ,
  44322. n.InterleavedBuffer.prototype = {
  44323. constructor: n.InterleavedBuffer,
  44324. get length() {
  44325. return this.array.length
  44326. },
  44327. get count() {
  44328. return this.array.length / this.stride
  44329. },
  44330. set needsUpdate(e) {
  44331. e === !0 && this.version++
  44332. },
  44333. setDynamic: function(e) {
  44334. return this.dynamic = e,
  44335. this
  44336. },
  44337. copy: function(e) {
  44338. return this.array = new e.array.constructor(e.array),
  44339. this.stride = e.stride,
  44340. this.dynamic = e.dynamic,
  44341. this
  44342. },
  44343. copyAt: function(e, t, i) {
  44344. e *= this.stride,
  44345. i *= t.stride;
  44346. for (var n = 0, r = this.stride; n < r; n++)
  44347. this.array[e + n] = t.array[i + n];
  44348. return this
  44349. },
  44350. set: function(e, t) {
  44351. return void 0 === t && (t = 0),
  44352. this.array.set(e, t),
  44353. this
  44354. },
  44355. clone: function() {
  44356. return (new this.constructor).copy(this)
  44357. }
  44358. },
  44359. n.InstancedInterleavedBuffer = function(e, t, i) {
  44360. n.InterleavedBuffer.call(this, e, t),
  44361. this.meshPerAttribute = i || 1
  44362. }
  44363. ,
  44364. n.InstancedInterleavedBuffer.prototype = Object.create(n.InterleavedBuffer.prototype),
  44365. n.InstancedInterleavedBuffer.prototype.constructor = n.InstancedInterleavedBuffer,
  44366. n.InstancedInterleavedBuffer.prototype.copy = function(e) {
  44367. return n.InterleavedBuffer.prototype.copy.call(this, e),
  44368. this.meshPerAttribute = e.meshPerAttribute,
  44369. this
  44370. }
  44371. ,
  44372. n.InterleavedBufferAttribute = function(e, t, i) {
  44373. this.uuid = n.Math.generateUUID(),
  44374. this.data = e,
  44375. this.itemSize = t,
  44376. this.offset = i
  44377. }
  44378. ,
  44379. n.InterleavedBufferAttribute.prototype = {
  44380. constructor: n.InterleavedBufferAttribute,
  44381. get length() {
  44382. return console.warn("THREE.BufferAttribute: .length has been deprecated. Please use .count."),
  44383. this.array.length
  44384. },
  44385. get count() {
  44386. return this.data.count
  44387. },
  44388. setX: function(e, t) {
  44389. return this.data.array[e * this.data.stride + this.offset] = t,
  44390. this
  44391. },
  44392. setY: function(e, t) {
  44393. return this.data.array[e * this.data.stride + this.offset + 1] = t,
  44394. this
  44395. },
  44396. setZ: function(e, t) {
  44397. return this.data.array[e * this.data.stride + this.offset + 2] = t,
  44398. this
  44399. },
  44400. setW: function(e, t) {
  44401. return this.data.array[e * this.data.stride + this.offset + 3] = t,
  44402. this
  44403. },
  44404. getX: function(e) {
  44405. return this.data.array[e * this.data.stride + this.offset]
  44406. },
  44407. getY: function(e) {
  44408. return this.data.array[e * this.data.stride + this.offset + 1]
  44409. },
  44410. getZ: function(e) {
  44411. return this.data.array[e * this.data.stride + this.offset + 2]
  44412. },
  44413. getW: function(e) {
  44414. return this.data.array[e * this.data.stride + this.offset + 3]
  44415. },
  44416. setXY: function(e, t, i) {
  44417. return e = e * this.data.stride + this.offset,
  44418. this.data.array[e + 0] = t,
  44419. this.data.array[e + 1] = i,
  44420. this
  44421. },
  44422. setXYZ: function(e, t, i, n) {
  44423. return e = e * this.data.stride + this.offset,
  44424. this.data.array[e + 0] = t,
  44425. this.data.array[e + 1] = i,
  44426. this.data.array[e + 2] = n,
  44427. this
  44428. },
  44429. setXYZW: function(e, t, i, n, r) {
  44430. return e = e * this.data.stride + this.offset,
  44431. this.data.array[e + 0] = t,
  44432. this.data.array[e + 1] = i,
  44433. this.data.array[e + 2] = n,
  44434. this.data.array[e + 3] = r,
  44435. this
  44436. }
  44437. },
  44438. n.Geometry = function() {
  44439. Object.defineProperty(this, "id", {
  44440. value: n.GeometryIdCount++
  44441. }),
  44442. this.uuid = n.Math.generateUUID(),
  44443. this.name = "",
  44444. this.type = "Geometry",
  44445. this.vertices = [],
  44446. this.colors = [],
  44447. this.faces = [],
  44448. this.faceVertexUvs = [[]],
  44449. this.morphTargets = [],
  44450. this.morphNormals = [],
  44451. this.skinWeights = [],
  44452. this.skinIndices = [],
  44453. this.lineDistances = [],
  44454. this.boundingBox = null,
  44455. this.boundingSphere = null,
  44456. this.verticesNeedUpdate = !1,
  44457. this.elementsNeedUpdate = !1,
  44458. this.uvsNeedUpdate = !1,
  44459. this.normalsNeedUpdate = !1,
  44460. this.colorsNeedUpdate = !1,
  44461. this.lineDistancesNeedUpdate = !1,
  44462. this.groupsNeedUpdate = !1
  44463. }
  44464. ,
  44465. n.Geometry.prototype = {
  44466. constructor: n.Geometry,
  44467. applyMatrix: function(e) {
  44468. for (var t = (new n.Matrix3).getNormalMatrix(e), i = 0, r = this.vertices.length; i < r; i++) {
  44469. var o = this.vertices[i];
  44470. o.applyMatrix4(e)
  44471. }
  44472. for (var i = 0, r = this.faces.length; i < r; i++) {
  44473. var a = this.faces[i];
  44474. a.normal.applyMatrix3(t).normalize();
  44475. for (var s = 0, l = a.vertexNormals.length; s < l; s++)
  44476. a.vertexNormals[s].applyMatrix3(t).normalize()
  44477. }
  44478. return null !== this.boundingBox && this.computeBoundingBox(),
  44479. null !== this.boundingSphere && this.computeBoundingSphere(),
  44480. this.verticesNeedUpdate = !0,
  44481. this.normalsNeedUpdate = !0,
  44482. this
  44483. },
  44484. rotateX: function() {
  44485. var e;
  44486. return function(t) {
  44487. return void 0 === e && (e = new n.Matrix4),
  44488. e.makeRotationX(t),
  44489. this.applyMatrix(e),
  44490. this
  44491. }
  44492. }(),
  44493. rotateY: function() {
  44494. var e;
  44495. return function(t) {
  44496. return void 0 === e && (e = new n.Matrix4),
  44497. e.makeRotationY(t),
  44498. this.applyMatrix(e),
  44499. this
  44500. }
  44501. }(),
  44502. rotateZ: function() {
  44503. var e;
  44504. return function(t) {
  44505. return void 0 === e && (e = new n.Matrix4),
  44506. e.makeRotationZ(t),
  44507. this.applyMatrix(e),
  44508. this
  44509. }
  44510. }(),
  44511. translate: function() {
  44512. var e;
  44513. return function(t, i, r) {
  44514. return void 0 === e && (e = new n.Matrix4),
  44515. e.makeTranslation(t, i, r),
  44516. this.applyMatrix(e),
  44517. this
  44518. }
  44519. }(),
  44520. scale: function() {
  44521. var e;
  44522. return function(t, i, r) {
  44523. return void 0 === e && (e = new n.Matrix4),
  44524. e.makeScale(t, i, r),
  44525. this.applyMatrix(e),
  44526. this
  44527. }
  44528. }(),
  44529. lookAt: function() {
  44530. var e;
  44531. return function(t) {
  44532. void 0 === e && (e = new n.Object3D),
  44533. e.lookAt(t),
  44534. e.updateMatrix(),
  44535. this.applyMatrix(e.matrix)
  44536. }
  44537. }(),
  44538. fromBufferGeometry: function(e) {
  44539. function t(e, t, r, o) {
  44540. var a = void 0 !== s ? [u[e].clone(), u[t].clone(), u[r].clone()] : []
  44541. , f = void 0 !== l ? [i.colors[e].clone(), i.colors[t].clone(), i.colors[r].clone()] : []
  44542. , g = new n.Face3(e,t,r,a,f,o);
  44543. i.faces.push(g),
  44544. void 0 !== c && i.faceVertexUvs[0].push([d[e].clone(), d[t].clone(), d[r].clone()]),
  44545. void 0 !== h && i.faceVertexUvs[1].push([p[e].clone(), p[t].clone(), p[r].clone()])
  44546. }
  44547. var i = this
  44548. , r = null !== e.index ? e.index.array : void 0
  44549. , o = e.attributes
  44550. , a = o.position.array
  44551. , s = void 0 !== o.normal ? o.normal.array : void 0
  44552. , l = void 0 !== o.color ? o.color.array : void 0
  44553. , c = void 0 !== o.uv ? o.uv.array : void 0
  44554. , h = void 0 !== o.uv2 ? o.uv2.array : void 0;
  44555. void 0 !== h && (this.faceVertexUvs[1] = []);
  44556. for (var u = [], d = [], p = [], f = 0, g = 0; f < a.length; f += 3,
  44557. g += 2)
  44558. i.vertices.push(new n.Vector3(a[f],a[f + 1],a[f + 2])),
  44559. void 0 !== s && u.push(new n.Vector3(s[f],s[f + 1],s[f + 2])),
  44560. void 0 !== l && i.colors.push(new n.Color(l[f],l[f + 1],l[f + 2])),
  44561. void 0 !== c && d.push(new n.Vector2(c[g],c[g + 1])),
  44562. void 0 !== h && p.push(new n.Vector2(h[g],h[g + 1]));
  44563. if (void 0 !== r) {
  44564. var m = e.groups;
  44565. if (m.length > 0)
  44566. for (var f = 0; f < m.length; f++)
  44567. for (var v = m[f], A = v.start, y = v.count, g = A, C = A + y; g < C; g += 3)
  44568. t(r[g], r[g + 1], r[g + 2], v.materialIndex);
  44569. else
  44570. for (var f = 0; f < r.length; f += 3)
  44571. t(r[f], r[f + 1], r[f + 2])
  44572. } else
  44573. for (var f = 0; f < a.length / 3; f += 3)
  44574. t(f, f + 1, f + 2);
  44575. return this.computeFaceNormals(),
  44576. null !== e.boundingBox && (this.boundingBox = e.boundingBox.clone()),
  44577. null !== e.boundingSphere && (this.boundingSphere = e.boundingSphere.clone()),
  44578. this
  44579. },
  44580. center: function() {
  44581. this.computeBoundingBox();
  44582. var e = this.boundingBox.center().negate();
  44583. return this.translate(e.x, e.y, e.z),
  44584. e
  44585. },
  44586. normalize: function() {
  44587. this.computeBoundingSphere();
  44588. var e = this.boundingSphere.center
  44589. , t = this.boundingSphere.radius
  44590. , i = 0 === t ? 1 : 1 / t
  44591. , r = new n.Matrix4;
  44592. 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),
  44593. this.applyMatrix(r),
  44594. this
  44595. },
  44596. computeFaceNormals: function() {
  44597. for (var e = new n.Vector3, t = new n.Vector3, i = 0, r = this.faces.length; i < r; i++) {
  44598. var o = this.faces[i]
  44599. , a = this.vertices[o.a]
  44600. , s = this.vertices[o.b]
  44601. , l = this.vertices[o.c];
  44602. e.subVectors(l, s),
  44603. t.subVectors(a, s),
  44604. e.cross(t),
  44605. e.normalize(),
  44606. o.normal.copy(e)
  44607. }
  44608. },
  44609. computeVertexNormals: function(e) {
  44610. void 0 === e && (e = !0);
  44611. var t, i, r, o, a, s;
  44612. for (s = new Array(this.vertices.length),
  44613. t = 0,
  44614. i = this.vertices.length; t < i; t++)
  44615. s[t] = new n.Vector3;
  44616. if (e) {
  44617. var l, c, h, u = new n.Vector3, d = new n.Vector3;
  44618. for (r = 0,
  44619. o = this.faces.length; r < o; r++)
  44620. a = this.faces[r],
  44621. l = this.vertices[a.a],
  44622. c = this.vertices[a.b],
  44623. h = this.vertices[a.c],
  44624. u.subVectors(h, c),
  44625. d.subVectors(l, c),
  44626. u.cross(d),
  44627. s[a.a].add(u),
  44628. s[a.b].add(u),
  44629. s[a.c].add(u)
  44630. } else
  44631. for (r = 0,
  44632. o = this.faces.length; r < o; r++)
  44633. a = this.faces[r],
  44634. s[a.a].add(a.normal),
  44635. s[a.b].add(a.normal),
  44636. s[a.c].add(a.normal);
  44637. for (t = 0,
  44638. i = this.vertices.length; t < i; t++)
  44639. s[t].normalize();
  44640. for (r = 0,
  44641. o = this.faces.length; r < o; r++) {
  44642. a = this.faces[r];
  44643. var p = a.vertexNormals;
  44644. 3 === p.length ? (p[0].copy(s[a.a]),
  44645. p[1].copy(s[a.b]),
  44646. p[2].copy(s[a.c])) : (p[0] = s[a.a].clone(),
  44647. p[1] = s[a.b].clone(),
  44648. p[2] = s[a.c].clone())
  44649. }
  44650. this.faces.length > 0 && (this.normalsNeedUpdate = !0)
  44651. },
  44652. computeMorphNormals: function() {
  44653. var e, t, i, r, o;
  44654. for (i = 0,
  44655. r = this.faces.length; i < r; i++)
  44656. for (o = this.faces[i],
  44657. o.__originalFaceNormal ? o.__originalFaceNormal.copy(o.normal) : o.__originalFaceNormal = o.normal.clone(),
  44658. o.__originalVertexNormals || (o.__originalVertexNormals = []),
  44659. e = 0,
  44660. t = o.vertexNormals.length; e < t; e++)
  44661. o.__originalVertexNormals[e] ? o.__originalVertexNormals[e].copy(o.vertexNormals[e]) : o.__originalVertexNormals[e] = o.vertexNormals[e].clone();
  44662. var a = new n.Geometry;
  44663. for (a.faces = this.faces,
  44664. e = 0,
  44665. t = this.morphTargets.length; e < t; e++) {
  44666. if (!this.morphNormals[e]) {
  44667. this.morphNormals[e] = {},
  44668. this.morphNormals[e].faceNormals = [],
  44669. this.morphNormals[e].vertexNormals = [];
  44670. var s, l, c = this.morphNormals[e].faceNormals, h = this.morphNormals[e].vertexNormals;
  44671. for (i = 0,
  44672. r = this.faces.length; i < r; i++)
  44673. s = new n.Vector3,
  44674. l = {
  44675. a: new n.Vector3,
  44676. b: new n.Vector3,
  44677. c: new n.Vector3
  44678. },
  44679. c.push(s),
  44680. h.push(l)
  44681. }
  44682. var u = this.morphNormals[e];
  44683. a.vertices = this.morphTargets[e].vertices,
  44684. a.computeFaceNormals(),
  44685. a.computeVertexNormals();
  44686. var s, l;
  44687. for (i = 0,
  44688. r = this.faces.length; i < r; i++)
  44689. o = this.faces[i],
  44690. s = u.faceNormals[i],
  44691. l = u.vertexNormals[i],
  44692. s.copy(o.normal),
  44693. l.a.copy(o.vertexNormals[0]),
  44694. l.b.copy(o.vertexNormals[1]),
  44695. l.c.copy(o.vertexNormals[2])
  44696. }
  44697. for (i = 0,
  44698. r = this.faces.length; i < r; i++)
  44699. o = this.faces[i],
  44700. o.normal = o.__originalFaceNormal,
  44701. o.vertexNormals = o.__originalVertexNormals
  44702. },
  44703. computeTangents: function() {
  44704. console.warn("THREE.Geometry: .computeTangents() has been removed.")
  44705. },
  44706. computeLineDistances: function() {
  44707. for (var e = 0, t = this.vertices, i = 0, n = t.length; i < n; i++)
  44708. i > 0 && (e += t[i].distanceTo(t[i - 1])),
  44709. this.lineDistances[i] = e
  44710. },
  44711. computeBoundingBox: function() {
  44712. null === this.boundingBox && (this.boundingBox = new n.Box3),
  44713. this.boundingBox.setFromPoints(this.vertices)
  44714. },
  44715. computeBoundingSphere: function() {
  44716. null === this.boundingSphere && (this.boundingSphere = new n.Sphere),
  44717. this.boundingSphere.setFromPoints(this.vertices)
  44718. },
  44719. merge: function(e, t, i) {
  44720. if (e instanceof n.Geometry == !1)
  44721. return void console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.", e);
  44722. 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];
  44723. void 0 === i && (i = 0),
  44724. void 0 !== t && (r = (new n.Matrix3).getNormalMatrix(t));
  44725. for (var d = 0, p = s.length; d < p; d++) {
  44726. var f = s[d]
  44727. , g = f.clone();
  44728. void 0 !== t && g.applyMatrix4(t),
  44729. a.push(g)
  44730. }
  44731. for (d = 0,
  44732. p = c.length; d < p; d++) {
  44733. var m, v, A, y = c[d], C = y.vertexNormals, I = y.vertexColors;
  44734. m = new n.Face3(y.a + o,y.b + o,y.c + o),
  44735. m.normal.copy(y.normal),
  44736. void 0 !== r && m.normal.applyMatrix3(r).normalize();
  44737. for (var E = 0, b = C.length; E < b; E++)
  44738. v = C[E].clone(),
  44739. void 0 !== r && v.applyMatrix3(r).normalize(),
  44740. m.vertexNormals.push(v);
  44741. m.color.copy(y.color);
  44742. for (var E = 0, b = I.length; E < b; E++)
  44743. A = I[E],
  44744. m.vertexColors.push(A.clone());
  44745. m.materialIndex = y.materialIndex + i,
  44746. l.push(m)
  44747. }
  44748. for (d = 0,
  44749. p = u.length; d < p; d++) {
  44750. var w = u[d]
  44751. , _ = [];
  44752. if (void 0 !== w) {
  44753. for (var E = 0, b = w.length; E < b; E++)
  44754. _.push(w[E].clone());
  44755. h.push(_)
  44756. }
  44757. }
  44758. },
  44759. mergeMesh: function(e) {
  44760. return e instanceof n.Mesh == !1 ? void console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.", e) : (e.matrixAutoUpdate && e.updateMatrix(),
  44761. void this.merge(e.geometry, e.matrix))
  44762. },
  44763. mergeVertices: function() {
  44764. var e, t, i, n, r, o, a, s, l = {}, c = [], h = [], u = 4, d = Math.pow(10, u);
  44765. for (i = 0,
  44766. n = this.vertices.length; i < n; i++)
  44767. e = this.vertices[i],
  44768. t = Math.round(e.x * d) + "_" + Math.round(e.y * d) + "_" + Math.round(e.z * d),
  44769. void 0 === l[t] ? (l[t] = i,
  44770. c.push(this.vertices[i]),
  44771. h[i] = c.length - 1) : h[i] = h[l[t]];
  44772. var p = [];
  44773. for (i = 0,
  44774. n = this.faces.length; i < n; i++) {
  44775. r = this.faces[i],
  44776. r.a = h[r.a],
  44777. r.b = h[r.b],
  44778. r.c = h[r.c],
  44779. o = [r.a, r.b, r.c];
  44780. for (var f = -1, g = 0; g < 3; g++)
  44781. if (o[g] === o[(g + 1) % 3]) {
  44782. f = g,
  44783. p.push(i);
  44784. break
  44785. }
  44786. }
  44787. for (i = p.length - 1; i >= 0; i--) {
  44788. var m = p[i];
  44789. for (this.faces.splice(m, 1),
  44790. a = 0,
  44791. s = this.faceVertexUvs.length; a < s; a++)
  44792. this.faceVertexUvs[a].splice(m, 1)
  44793. }
  44794. var v = this.vertices.length - c.length;
  44795. return this.vertices = c,
  44796. v
  44797. },
  44798. sortFacesByMaterialIndex: function() {
  44799. function e(e, t) {
  44800. return e.materialIndex - t.materialIndex
  44801. }
  44802. for (var t = this.faces, i = t.length, n = 0; n < i; n++)
  44803. t[n]._id = n;
  44804. t.sort(e);
  44805. var r, o, a = this.faceVertexUvs[0], s = this.faceVertexUvs[1];
  44806. a && a.length === i && (r = []),
  44807. s && s.length === i && (o = []);
  44808. for (var n = 0; n < i; n++) {
  44809. var l = t[n]._id;
  44810. r && r.push(a[l]),
  44811. o && o.push(s[l])
  44812. }
  44813. r && (this.faceVertexUvs[0] = r),
  44814. o && (this.faceVertexUvs[1] = o)
  44815. },
  44816. toJSON: function() {
  44817. function e(e, t, i) {
  44818. return i ? e | 1 << t : e & ~(1 << t)
  44819. }
  44820. function t(e) {
  44821. var t = e.x.toString() + e.y.toString() + e.z.toString();
  44822. return void 0 !== d[t] ? d[t] : (d[t] = u.length / 3,
  44823. u.push(e.x, e.y, e.z),
  44824. d[t])
  44825. }
  44826. function i(e) {
  44827. var t = e.r.toString() + e.g.toString() + e.b.toString();
  44828. return void 0 !== f[t] ? f[t] : (f[t] = p.length,
  44829. p.push(e.getHex()),
  44830. f[t])
  44831. }
  44832. function n(e) {
  44833. var t = e.x.toString() + e.y.toString();
  44834. return void 0 !== m[t] ? m[t] : (m[t] = g.length / 2,
  44835. g.push(e.x, e.y),
  44836. m[t])
  44837. }
  44838. var r = {
  44839. metadata: {
  44840. version: 4.4,
  44841. type: "Geometry",
  44842. generator: "Geometry.toJSON"
  44843. }
  44844. };
  44845. if (r.uuid = this.uuid,
  44846. r.type = this.type,
  44847. "" !== this.name && (r.name = this.name),
  44848. void 0 !== this.parameters) {
  44849. var o = this.parameters;
  44850. for (var a in o)
  44851. void 0 !== o[a] && (r[a] = o[a]);
  44852. return r
  44853. }
  44854. for (var s = [], l = 0; l < this.vertices.length; l++) {
  44855. var c = this.vertices[l];
  44856. s.push(c.x, c.y, c.z)
  44857. }
  44858. for (var h = [], u = [], d = {}, p = [], f = {}, g = [], m = {}, l = 0; l < this.faces.length; l++) {
  44859. var v = this.faces[l]
  44860. , A = !0
  44861. , y = !1
  44862. , C = void 0 !== this.faceVertexUvs[0][l]
  44863. , I = v.normal.length() > 0
  44864. , E = v.vertexNormals.length > 0
  44865. , b = 1 !== v.color.r || 1 !== v.color.g || 1 !== v.color.b
  44866. , w = v.vertexColors.length > 0
  44867. , _ = 0;
  44868. if (_ = e(_, 0, 0),
  44869. _ = e(_, 1, A),
  44870. _ = e(_, 2, y),
  44871. _ = e(_, 3, C),
  44872. _ = e(_, 4, I),
  44873. _ = e(_, 5, E),
  44874. _ = e(_, 6, b),
  44875. _ = e(_, 7, w),
  44876. h.push(_),
  44877. h.push(v.a, v.b, v.c),
  44878. h.push(v.materialIndex),
  44879. C) {
  44880. var T = this.faceVertexUvs[0][l];
  44881. h.push(n(T[0]), n(T[1]), n(T[2]))
  44882. }
  44883. if (I && h.push(t(v.normal)),
  44884. E) {
  44885. var x = v.vertexNormals;
  44886. h.push(t(x[0]), t(x[1]), t(x[2]))
  44887. }
  44888. if (b && h.push(i(v.color)),
  44889. w) {
  44890. var S = v.vertexColors;
  44891. h.push(i(S[0]), i(S[1]), i(S[2]))
  44892. }
  44893. }
  44894. return r.data = {},
  44895. r.data.vertices = s,
  44896. r.data.normals = u,
  44897. p.length > 0 && (r.data.colors = p),
  44898. g.length > 0 && (r.data.uvs = [g]),
  44899. r.data.faces = h,
  44900. r
  44901. },
  44902. clone: function() {
  44903. return (new n.Geometry).copy(this)
  44904. },
  44905. copy: function(e) {
  44906. this.vertices = [],
  44907. this.faces = [],
  44908. this.faceVertexUvs = [[]];
  44909. for (var t = e.vertices, i = 0, n = t.length; i < n; i++)
  44910. this.vertices.push(t[i].clone());
  44911. for (var r = e.faces, i = 0, n = r.length; i < n; i++)
  44912. this.faces.push(r[i].clone());
  44913. for (var i = 0, n = e.faceVertexUvs.length; i < n; i++) {
  44914. var o = e.faceVertexUvs[i];
  44915. void 0 === this.faceVertexUvs[i] && (this.faceVertexUvs[i] = []);
  44916. for (var a = 0, s = o.length; a < s; a++) {
  44917. for (var l = o[a], c = [], h = 0, u = l.length; h < u; h++) {
  44918. var d = l[h];
  44919. c.push(d.clone())
  44920. }
  44921. this.faceVertexUvs[i].push(c)
  44922. }
  44923. }
  44924. return this
  44925. },
  44926. dispose: function() {
  44927. this.dispatchEvent({
  44928. type: "dispose"
  44929. })
  44930. }
  44931. },
  44932. n.EventDispatcher.prototype.apply(n.Geometry.prototype),
  44933. n.GeometryIdCount = 0,
  44934. n.DirectGeometry = function() {
  44935. Object.defineProperty(this, "id", {
  44936. value: n.GeometryIdCount++
  44937. }),
  44938. this.uuid = n.Math.generateUUID(),
  44939. this.name = "",
  44940. this.type = "DirectGeometry",
  44941. this.indices = [],
  44942. this.vertices = [],
  44943. this.normals = [],
  44944. this.colors = [],
  44945. this.uvs = [],
  44946. this.uvs2 = [],
  44947. this.groups = [],
  44948. this.morphTargets = {},
  44949. this.skinWeights = [],
  44950. this.skinIndices = [],
  44951. this.boundingBox = null,
  44952. this.boundingSphere = null,
  44953. this.verticesNeedUpdate = !1,
  44954. this.normalsNeedUpdate = !1,
  44955. this.colorsNeedUpdate = !1,
  44956. this.uvsNeedUpdate = !1,
  44957. this.groupsNeedUpdate = !1
  44958. }
  44959. ,
  44960. n.DirectGeometry.prototype = {
  44961. constructor: n.DirectGeometry,
  44962. computeBoundingBox: n.Geometry.prototype.computeBoundingBox,
  44963. computeBoundingSphere: n.Geometry.prototype.computeBoundingSphere,
  44964. computeFaceNormals: function() {
  44965. console.warn("THREE.DirectGeometry: computeFaceNormals() is not a method of this type of geometry.")
  44966. },
  44967. computeVertexNormals: function() {
  44968. console.warn("THREE.DirectGeometry: computeVertexNormals() is not a method of this type of geometry.")
  44969. },
  44970. computeGroups: function(e) {
  44971. for (var t, i, n = [], r = e.faces, o = 0; o < r.length; o++) {
  44972. var a = r[o];
  44973. a.materialIndex !== i && (i = a.materialIndex,
  44974. void 0 !== t && (t.count = 3 * o - t.start,
  44975. n.push(t)),
  44976. t = {
  44977. start: 3 * o,
  44978. materialIndex: i
  44979. })
  44980. }
  44981. void 0 !== t && (t.count = 3 * o - t.start,
  44982. n.push(t)),
  44983. this.groups = n
  44984. },
  44985. fromGeometry: function(e) {
  44986. 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;
  44987. if (c > 0) {
  44988. t = [];
  44989. for (var h = 0; h < c; h++)
  44990. t[h] = [];
  44991. this.morphTargets.position = t
  44992. }
  44993. var u, d = e.morphNormals, p = d.length;
  44994. if (p > 0) {
  44995. u = [];
  44996. for (var h = 0; h < p; h++)
  44997. u[h] = [];
  44998. this.morphTargets.normal = u
  44999. }
  45000. for (var f = e.skinIndices, g = e.skinWeights, m = f.length === r.length, v = g.length === r.length, h = 0; h < i.length; h++) {
  45001. var A = i[h];
  45002. this.vertices.push(r[A.a], r[A.b], r[A.c]);
  45003. var y = A.vertexNormals;
  45004. if (3 === y.length)
  45005. this.normals.push(y[0], y[1], y[2]);
  45006. else {
  45007. var C = A.normal;
  45008. this.normals.push(C, C, C)
  45009. }
  45010. var I = A.vertexColors;
  45011. if (3 === I.length)
  45012. this.colors.push(I[0], I[1], I[2]);
  45013. else {
  45014. var E = A.color;
  45015. this.colors.push(E, E, E)
  45016. }
  45017. if (a === !0) {
  45018. var b = o[0][h];
  45019. void 0 !== b ? this.uvs.push(b[0], b[1], b[2]) : (console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ", h),
  45020. this.uvs.push(new n.Vector2, new n.Vector2, new n.Vector2))
  45021. }
  45022. if (s === !0) {
  45023. var b = o[1][h];
  45024. void 0 !== b ? this.uvs2.push(b[0], b[1], b[2]) : (console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ", h),
  45025. this.uvs2.push(new n.Vector2, new n.Vector2, new n.Vector2))
  45026. }
  45027. for (var w = 0; w < c; w++) {
  45028. var _ = l[w].vertices;
  45029. t[w].push(_[A.a], _[A.b], _[A.c])
  45030. }
  45031. for (var w = 0; w < p; w++) {
  45032. var T = d[w].vertexNormals[h];
  45033. u[w].push(T.a, T.b, T.c)
  45034. }
  45035. m && this.skinIndices.push(f[A.a], f[A.b], f[A.c]),
  45036. v && this.skinWeights.push(g[A.a], g[A.b], g[A.c])
  45037. }
  45038. return this.computeGroups(e),
  45039. this.verticesNeedUpdate = e.verticesNeedUpdate,
  45040. this.normalsNeedUpdate = e.normalsNeedUpdate,
  45041. this.colorsNeedUpdate = e.colorsNeedUpdate,
  45042. this.uvsNeedUpdate = e.uvsNeedUpdate,
  45043. this.groupsNeedUpdate = e.groupsNeedUpdate,
  45044. this
  45045. },
  45046. dispose: function() {
  45047. this.dispatchEvent({
  45048. type: "dispose"
  45049. })
  45050. }
  45051. },
  45052. n.EventDispatcher.prototype.apply(n.DirectGeometry.prototype),
  45053. n.BufferGeometry = function() {
  45054. Object.defineProperty(this, "id", {
  45055. value: n.GeometryIdCount++
  45056. }),
  45057. this.uuid = n.Math.generateUUID(),
  45058. this.name = "",
  45059. this.type = "BufferGeometry",
  45060. this.index = null,
  45061. this.attributes = {},
  45062. this.morphAttributes = {},
  45063. this.groups = [],
  45064. this.boundingBox = null,
  45065. this.boundingSphere = null,
  45066. this.drawRange = {
  45067. start: 0,
  45068. count: 1 / 0
  45069. }
  45070. }
  45071. ,
  45072. n.BufferGeometry.prototype = {
  45073. constructor: n.BufferGeometry,
  45074. getIndex: function() {
  45075. return this.index
  45076. },
  45077. setIndex: function(e) {
  45078. this.index = e
  45079. },
  45080. addAttribute: function(e, t) {
  45081. return t instanceof n.BufferAttribute == !1 && t instanceof n.InterleavedBufferAttribute == !1 ? (console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),
  45082. void this.addAttribute(e, new n.BufferAttribute(arguments[1],arguments[2]))) : "index" === e ? (console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),
  45083. void this.setIndex(t)) : (this.attributes[e] = t,
  45084. this)
  45085. },
  45086. getAttribute: function(e) {
  45087. return this.attributes[e]
  45088. },
  45089. removeAttribute: function(e) {
  45090. return delete this.attributes[e],
  45091. this
  45092. },
  45093. addGroup: function(e, t, i) {
  45094. this.groups.push({
  45095. start: e,
  45096. count: t,
  45097. materialIndex: void 0 !== i ? i : 0
  45098. })
  45099. },
  45100. clearGroups: function() {
  45101. this.groups = []
  45102. },
  45103. setDrawRange: function(e, t) {
  45104. this.drawRange.start = e,
  45105. this.drawRange.count = t
  45106. },
  45107. applyMatrix: function(e) {
  45108. var t = this.attributes.position;
  45109. void 0 !== t && (e.applyToVector3Array(t.array),
  45110. t.needsUpdate = !0);
  45111. var i = this.attributes.normal;
  45112. if (void 0 !== i) {
  45113. var r = (new n.Matrix3).getNormalMatrix(e);
  45114. r.applyToVector3Array(i.array),
  45115. i.needsUpdate = !0
  45116. }
  45117. return null !== this.boundingBox && this.computeBoundingBox(),
  45118. null !== this.boundingSphere && this.computeBoundingSphere(),
  45119. this
  45120. },
  45121. rotateX: function() {
  45122. var e;
  45123. return function(t) {
  45124. return void 0 === e && (e = new n.Matrix4),
  45125. e.makeRotationX(t),
  45126. this.applyMatrix(e),
  45127. this
  45128. }
  45129. }(),
  45130. rotateY: function() {
  45131. var e;
  45132. return function(t) {
  45133. return void 0 === e && (e = new n.Matrix4),
  45134. e.makeRotationY(t),
  45135. this.applyMatrix(e),
  45136. this
  45137. }
  45138. }(),
  45139. rotateZ: function() {
  45140. var e;
  45141. return function(t) {
  45142. return void 0 === e && (e = new n.Matrix4),
  45143. e.makeRotationZ(t),
  45144. this.applyMatrix(e),
  45145. this
  45146. }
  45147. }(),
  45148. translate: function() {
  45149. var e;
  45150. return function(t, i, r) {
  45151. return void 0 === e && (e = new n.Matrix4),
  45152. e.makeTranslation(t, i, r),
  45153. this.applyMatrix(e),
  45154. this
  45155. }
  45156. }(),
  45157. scale: function() {
  45158. var e;
  45159. return function(t, i, r) {
  45160. return void 0 === e && (e = new n.Matrix4),
  45161. e.makeScale(t, i, r),
  45162. this.applyMatrix(e),
  45163. this
  45164. }
  45165. }(),
  45166. lookAt: function() {
  45167. var e;
  45168. return function(t) {
  45169. void 0 === e && (e = new n.Object3D),
  45170. e.lookAt(t),
  45171. e.updateMatrix(),
  45172. this.applyMatrix(e.matrix)
  45173. }
  45174. }(),
  45175. center: function() {
  45176. this.computeBoundingBox();
  45177. var e = this.boundingBox.center().negate();
  45178. return this.translate(e.x, e.y, e.z),
  45179. e
  45180. },
  45181. setFromObject: function(e) {
  45182. var t = e.geometry;
  45183. if (e instanceof n.Points || e instanceof n.Line) {
  45184. var i = new n.Float32Attribute(3 * t.vertices.length,3)
  45185. , r = new n.Float32Attribute(3 * t.colors.length,3);
  45186. if (this.addAttribute("position", i.copyVector3sArray(t.vertices)),
  45187. this.addAttribute("color", r.copyColorsArray(t.colors)),
  45188. t.lineDistances && t.lineDistances.length === t.vertices.length) {
  45189. var o = new n.Float32Attribute(t.lineDistances.length,1);
  45190. this.addAttribute("lineDistance", o.copyArray(t.lineDistances))
  45191. }
  45192. null !== t.boundingSphere && (this.boundingSphere = t.boundingSphere.clone()),
  45193. null !== t.boundingBox && (this.boundingBox = t.boundingBox.clone())
  45194. } else
  45195. e instanceof n.Mesh && t instanceof n.Geometry && this.fromGeometry(t);
  45196. return this
  45197. },
  45198. updateFromObject: function(e) {
  45199. var t = e.geometry;
  45200. if (e instanceof n.Mesh) {
  45201. var i = t.__directGeometry;
  45202. if (void 0 === i)
  45203. return this.fromGeometry(t);
  45204. i.verticesNeedUpdate = t.verticesNeedUpdate,
  45205. i.normalsNeedUpdate = t.normalsNeedUpdate,
  45206. i.colorsNeedUpdate = t.colorsNeedUpdate,
  45207. i.uvsNeedUpdate = t.uvsNeedUpdate,
  45208. i.groupsNeedUpdate = t.groupsNeedUpdate,
  45209. t.verticesNeedUpdate = !1,
  45210. t.normalsNeedUpdate = !1,
  45211. t.colorsNeedUpdate = !1,
  45212. t.uvsNeedUpdate = !1,
  45213. t.groupsNeedUpdate = !1,
  45214. t = i
  45215. }
  45216. if (t.verticesNeedUpdate === !0) {
  45217. var r = this.attributes.position;
  45218. void 0 !== r && (r.copyVector3sArray(t.vertices),
  45219. r.needsUpdate = !0),
  45220. t.verticesNeedUpdate = !1
  45221. }
  45222. if (t.normalsNeedUpdate === !0) {
  45223. var r = this.attributes.normal;
  45224. void 0 !== r && (r.copyVector3sArray(t.normals),
  45225. r.needsUpdate = !0),
  45226. t.normalsNeedUpdate = !1
  45227. }
  45228. if (t.colorsNeedUpdate === !0) {
  45229. var r = this.attributes.color;
  45230. void 0 !== r && (r.copyColorsArray(t.colors),
  45231. r.needsUpdate = !0),
  45232. t.colorsNeedUpdate = !1
  45233. }
  45234. if (t.uvsNeedUpdate) {
  45235. var r = this.attributes.uv;
  45236. void 0 !== r && (r.copyVector2sArray(t.uvs),
  45237. r.needsUpdate = !0),
  45238. t.uvsNeedUpdate = !1
  45239. }
  45240. if (t.lineDistancesNeedUpdate) {
  45241. var r = this.attributes.lineDistance;
  45242. void 0 !== r && (r.copyArray(t.lineDistances),
  45243. r.needsUpdate = !0),
  45244. t.lineDistancesNeedUpdate = !1
  45245. }
  45246. return t.groupsNeedUpdate && (t.computeGroups(e.geometry),
  45247. this.groups = t.groups,
  45248. t.groupsNeedUpdate = !1),
  45249. this
  45250. },
  45251. fromGeometry: function(e) {
  45252. return e.__directGeometry = (new n.DirectGeometry).fromGeometry(e),
  45253. this.fromDirectGeometry(e.__directGeometry)
  45254. },
  45255. fromDirectGeometry: function(e) {
  45256. var t = new Float32Array(3 * e.vertices.length);
  45257. if (this.addAttribute("position", new n.BufferAttribute(t,3).copyVector3sArray(e.vertices)),
  45258. e.normals.length > 0) {
  45259. var i = new Float32Array(3 * e.normals.length);
  45260. this.addAttribute("normal", new n.BufferAttribute(i,3).copyVector3sArray(e.normals))
  45261. }
  45262. if (e.colors.length > 0) {
  45263. var r = new Float32Array(3 * e.colors.length);
  45264. this.addAttribute("color", new n.BufferAttribute(r,3).copyColorsArray(e.colors))
  45265. }
  45266. if (e.uvs.length > 0) {
  45267. var o = new Float32Array(2 * e.uvs.length);
  45268. this.addAttribute("uv", new n.BufferAttribute(o,2).copyVector2sArray(e.uvs))
  45269. }
  45270. if (e.uvs2.length > 0) {
  45271. var a = new Float32Array(2 * e.uvs2.length);
  45272. this.addAttribute("uv2", new n.BufferAttribute(a,2).copyVector2sArray(e.uvs2))
  45273. }
  45274. if (e.indices.length > 0) {
  45275. var s = e.vertices.length > 65535 ? Uint32Array : Uint16Array
  45276. , l = new s(3 * e.indices.length);
  45277. this.setIndex(new n.BufferAttribute(l,1).copyIndicesArray(e.indices))
  45278. }
  45279. this.groups = e.groups;
  45280. for (var c in e.morphTargets) {
  45281. for (var h = [], u = e.morphTargets[c], d = 0, p = u.length; d < p; d++) {
  45282. var f = u[d]
  45283. , g = new n.Float32Attribute(3 * f.length,3);
  45284. h.push(g.copyVector3sArray(f))
  45285. }
  45286. this.morphAttributes[c] = h
  45287. }
  45288. if (e.skinIndices.length > 0) {
  45289. var m = new n.Float32Attribute(4 * e.skinIndices.length,4);
  45290. this.addAttribute("skinIndex", m.copyVector4sArray(e.skinIndices))
  45291. }
  45292. if (e.skinWeights.length > 0) {
  45293. var v = new n.Float32Attribute(4 * e.skinWeights.length,4);
  45294. this.addAttribute("skinWeight", v.copyVector4sArray(e.skinWeights))
  45295. }
  45296. return null !== e.boundingSphere && (this.boundingSphere = e.boundingSphere.clone()),
  45297. null !== e.boundingBox && (this.boundingBox = e.boundingBox.clone()),
  45298. this
  45299. },
  45300. computeBoundingBox: function() {
  45301. new n.Vector3;
  45302. return function() {
  45303. null === this.boundingBox && (this.boundingBox = new n.Box3);
  45304. var e = this.attributes.position.array;
  45305. e && this.boundingBox.setFromArray(e),
  45306. void 0 !== e && 0 !== e.length || (this.boundingBox.min.set(0, 0, 0),
  45307. this.boundingBox.max.set(0, 0, 0)),
  45308. (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)
  45309. }
  45310. }(),
  45311. computeBoundingSphere: function() {
  45312. var e = new n.Box3
  45313. , t = new n.Vector3;
  45314. return function() {
  45315. null === this.boundingSphere && (this.boundingSphere = new n.Sphere);
  45316. var i = this.attributes.position.array;
  45317. if (i) {
  45318. var r = this.boundingSphere.center;
  45319. e.setFromArray(i),
  45320. e.center(r);
  45321. for (var o = 0, a = 0, s = i.length; a < s; a += 3)
  45322. t.fromArray(i, a),
  45323. o = Math.max(o, r.distanceToSquared(t));
  45324. this.boundingSphere.radius = Math.sqrt(o),
  45325. isNaN(this.boundingSphere.radius) && console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.', this)
  45326. }
  45327. }
  45328. }(),
  45329. computeFaceNormals: function() {},
  45330. computeVertexNormals: function() {
  45331. var e = this.index
  45332. , t = this.attributes
  45333. , i = this.groups;
  45334. if (t.position) {
  45335. var r = t.position.array;
  45336. if (void 0 === t.normal)
  45337. this.addAttribute("normal", new n.BufferAttribute(new Float32Array(r.length),3));
  45338. else
  45339. for (var o = t.normal.array, a = 0, s = o.length; a < s; a++)
  45340. o[a] = 0;
  45341. 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;
  45342. if (e) {
  45343. var v = e.array;
  45344. 0 === i.length && this.addGroup(0, v.length);
  45345. for (var A = 0, y = i.length; A < y; ++A)
  45346. for (var C = i[A], I = C.start, E = C.count, a = I, s = I + E; a < s; a += 3)
  45347. l = 3 * v[a + 0],
  45348. c = 3 * v[a + 1],
  45349. h = 3 * v[a + 2],
  45350. d.fromArray(r, l),
  45351. p.fromArray(r, c),
  45352. f.fromArray(r, h),
  45353. g.subVectors(f, p),
  45354. m.subVectors(d, p),
  45355. g.cross(m),
  45356. u[l] += g.x,
  45357. u[l + 1] += g.y,
  45358. u[l + 2] += g.z,
  45359. u[c] += g.x,
  45360. u[c + 1] += g.y,
  45361. u[c + 2] += g.z,
  45362. u[h] += g.x,
  45363. u[h + 1] += g.y,
  45364. u[h + 2] += g.z
  45365. } else
  45366. for (var a = 0, s = r.length; a < s; a += 9)
  45367. d.fromArray(r, a),
  45368. p.fromArray(r, a + 3),
  45369. f.fromArray(r, a + 6),
  45370. g.subVectors(f, p),
  45371. m.subVectors(d, p),
  45372. g.cross(m),
  45373. u[a] = g.x,
  45374. u[a + 1] = g.y,
  45375. u[a + 2] = g.z,
  45376. u[a + 3] = g.x,
  45377. u[a + 4] = g.y,
  45378. u[a + 5] = g.z,
  45379. u[a + 6] = g.x,
  45380. u[a + 7] = g.y,
  45381. u[a + 8] = g.z;
  45382. this.normalizeNormals(),
  45383. t.normal.needsUpdate = !0
  45384. }
  45385. },
  45386. merge: function(e, t) {
  45387. if (e instanceof n.BufferGeometry == !1)
  45388. return void console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.", e);
  45389. void 0 === t && (t = 0);
  45390. var i = this.attributes;
  45391. for (var r in i)
  45392. if (void 0 !== e.attributes[r])
  45393. 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++,
  45394. u++)
  45395. a[u] = l[h];
  45396. return this
  45397. },
  45398. normalizeNormals: function() {
  45399. for (var e, t, i, n, r = this.attributes.normal.array, o = 0, a = r.length; o < a; o += 3)
  45400. e = r[o],
  45401. t = r[o + 1],
  45402. i = r[o + 2],
  45403. n = 1 / Math.sqrt(e * e + t * t + i * i),
  45404. r[o] *= n,
  45405. r[o + 1] *= n,
  45406. r[o + 2] *= n
  45407. },
  45408. toNonIndexed: function() {
  45409. if (null === this.index)
  45410. return console.warn("THREE.BufferGeometry.toNonIndexed(): Geometry is already non-indexed."),
  45411. this;
  45412. var e = new n.BufferGeometry
  45413. , t = this.index.array
  45414. , i = this.attributes;
  45415. for (var r in i) {
  45416. 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++) {
  45417. c = t[u] * s;
  45418. for (var p = 0; p < s; p++)
  45419. l[h++] = a[c++]
  45420. }
  45421. e.addAttribute(r, new n.BufferAttribute(l,s))
  45422. }
  45423. return e
  45424. },
  45425. toJSON: function() {
  45426. var e = {
  45427. metadata: {
  45428. version: 4.4,
  45429. type: "BufferGeometry",
  45430. generator: "BufferGeometry.toJSON"
  45431. }
  45432. };
  45433. if (e.uuid = this.uuid,
  45434. e.type = this.type,
  45435. "" !== this.name && (e.name = this.name),
  45436. void 0 !== this.parameters) {
  45437. var t = this.parameters;
  45438. for (var i in t)
  45439. void 0 !== t[i] && (e[i] = t[i]);
  45440. return e
  45441. }
  45442. e.data = {
  45443. attributes: {}
  45444. };
  45445. var n = this.index;
  45446. if (null !== n) {
  45447. var r = Array.prototype.slice.call(n.array);
  45448. e.data.index = {
  45449. type: n.array.constructor.name,
  45450. array: r
  45451. }
  45452. }
  45453. var o = this.attributes;
  45454. for (var i in o) {
  45455. var a = o[i]
  45456. , r = Array.prototype.slice.call(a.array);
  45457. e.data.attributes[i] = {
  45458. itemSize: a.itemSize,
  45459. type: a.array.constructor.name,
  45460. array: r
  45461. }
  45462. }
  45463. var s = this.groups;
  45464. s.length > 0 && (e.data.groups = JSON.parse(JSON.stringify(s)));
  45465. var l = this.boundingSphere;
  45466. return null !== l && (e.data.boundingSphere = {
  45467. center: l.center.toArray(),
  45468. radius: l.radius
  45469. }),
  45470. e
  45471. },
  45472. clone: function() {
  45473. return (new n.BufferGeometry).copy(this)
  45474. },
  45475. copy: function(e) {
  45476. var t = e.index;
  45477. null !== t && this.setIndex(t.clone());
  45478. var i = e.attributes;
  45479. for (var n in i) {
  45480. var r = i[n];
  45481. this.addAttribute(n, r.clone())
  45482. }
  45483. for (var o = e.groups, a = 0, s = o.length; a < s; a++) {
  45484. var l = o[a];
  45485. this.addGroup(l.start, l.count)
  45486. }
  45487. return this
  45488. },
  45489. dispose: function() {
  45490. this.dispatchEvent({
  45491. type: "dispose"
  45492. })
  45493. }
  45494. },
  45495. n.EventDispatcher.prototype.apply(n.BufferGeometry.prototype),
  45496. n.BufferGeometry.MaxIndex = 65535,
  45497. n.InstancedBufferGeometry = function() {
  45498. n.BufferGeometry.call(this),
  45499. this.type = "InstancedBufferGeometry",
  45500. this.maxInstancedCount = void 0
  45501. }
  45502. ,
  45503. n.InstancedBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  45504. n.InstancedBufferGeometry.prototype.constructor = n.InstancedBufferGeometry,
  45505. n.InstancedBufferGeometry.prototype.addGroup = function(e, t, i) {
  45506. this.groups.push({
  45507. start: e,
  45508. count: t,
  45509. instances: i
  45510. })
  45511. }
  45512. ,
  45513. n.InstancedBufferGeometry.prototype.copy = function(e) {
  45514. var t = e.index;
  45515. null !== t && this.setIndex(t.clone());
  45516. var i = e.attributes;
  45517. for (var n in i) {
  45518. var r = i[n];
  45519. this.addAttribute(n, r.clone())
  45520. }
  45521. for (var o = e.groups, a = 0, s = o.length; a < s; a++) {
  45522. var l = o[a];
  45523. this.addGroup(l.start, l.count, l.instances)
  45524. }
  45525. return this
  45526. }
  45527. ,
  45528. n.EventDispatcher.prototype.apply(n.InstancedBufferGeometry.prototype),
  45529. n.Uniform = function(e, t) {
  45530. this.type = e,
  45531. this.value = t,
  45532. this.dynamic = !1
  45533. }
  45534. ,
  45535. n.Uniform.prototype = {
  45536. constructor: n.Uniform,
  45537. onUpdate: function(e) {
  45538. return this.dynamic = !0,
  45539. this.onUpdateCallback = e,
  45540. this
  45541. }
  45542. },
  45543. n.AnimationClip = function(e, t, i) {
  45544. this.name = e || n.Math.generateUUID(),
  45545. this.tracks = i,
  45546. this.duration = void 0 !== t ? t : -1,
  45547. this.duration < 0 && this.resetDuration(),
  45548. this.trim(),
  45549. this.optimize()
  45550. }
  45551. ,
  45552. n.AnimationClip.prototype = {
  45553. constructor: n.AnimationClip,
  45554. resetDuration: function() {
  45555. for (var e = this.tracks, t = 0, i = 0, n = e.length; i !== n; ++i) {
  45556. var r = this.tracks[i];
  45557. t = Math.max(t, r.times[r.times.length - 1])
  45558. }
  45559. this.duration = t
  45560. },
  45561. trim: function() {
  45562. for (var e = 0; e < this.tracks.length; e++)
  45563. this.tracks[e].trim(0, this.duration);
  45564. return this
  45565. },
  45566. optimize: function() {
  45567. for (var e = 0; e < this.tracks.length; e++)
  45568. this.tracks[e].optimize();
  45569. return this
  45570. }
  45571. },
  45572. Object.assign(n.AnimationClip, {
  45573. parse: function(e) {
  45574. for (var t = [], i = e.tracks, r = 1 / (e.fps || 1), o = 0, a = i.length; o !== a; ++o)
  45575. t.push(n.KeyframeTrack.parse(i[o]).scale(r));
  45576. return new n.AnimationClip(e.name,e.duration,t)
  45577. },
  45578. toJSON: function(e) {
  45579. for (var t = [], i = e.tracks, r = {
  45580. name: e.name,
  45581. duration: e.duration,
  45582. tracks: t
  45583. }, o = 0, a = i.length; o !== a; ++o)
  45584. t.push(n.KeyframeTrack.toJSON(i[o]));
  45585. return r
  45586. },
  45587. CreateFromMorphTargetSequence: function(e, t, i) {
  45588. for (var r = t.length, o = [], a = 0; a < r; a++) {
  45589. var s = []
  45590. , l = [];
  45591. s.push((a + r - 1) % r, a, (a + 1) % r),
  45592. l.push(0, 1, 0);
  45593. var c = n.AnimationUtils.getKeyframeOrder(s);
  45594. s = n.AnimationUtils.sortedArray(s, 1, c),
  45595. l = n.AnimationUtils.sortedArray(l, 1, c),
  45596. 0 === s[0] && (s.push(r),
  45597. l.push(l[0])),
  45598. o.push(new n.NumberKeyframeTrack(".morphTargetInfluences[" + t[a].name + "]",s,l).scale(1 / i))
  45599. }
  45600. return new n.AnimationClip(e,-1,o)
  45601. },
  45602. findByName: function(e, t) {
  45603. for (var i = 0; i < e.length; i++)
  45604. if (e[i].name === t)
  45605. return e[i];
  45606. return null
  45607. },
  45608. CreateClipsFromMorphTargetSequences: function(e, t) {
  45609. for (var i = {}, r = /^([\w-]*?)([\d]+)$/, o = 0, a = e.length; o < a; o++) {
  45610. var s = e[o]
  45611. , l = s.name.match(r);
  45612. if (l && l.length > 1) {
  45613. var c = l[1]
  45614. , h = i[c];
  45615. h || (i[c] = h = []),
  45616. h.push(s)
  45617. }
  45618. }
  45619. var u = [];
  45620. for (var c in i)
  45621. u.push(n.AnimationClip.CreateFromMorphTargetSequence(c, i[c], t));
  45622. return u
  45623. },
  45624. parseAnimation: function(e, t, i) {
  45625. if (!e)
  45626. return console.error(" no animation in JSONLoader data"),
  45627. null;
  45628. for (var r = function(e, t, i, r, o) {
  45629. if (0 !== i.length) {
  45630. var a = []
  45631. , s = [];
  45632. n.AnimationUtils.flattenJSON(i, a, s, r),
  45633. 0 !== a.length && o.push(new e(t,a,s))
  45634. }
  45635. }, o = [], a = e.name || "default", s = e.length || -1, l = e.fps || 30, c = e.hierarchy || [], h = 0; h < c.length; h++) {
  45636. var u = c[h].keys;
  45637. if (u && 0 != u.length)
  45638. if (u[0].morphTargets) {
  45639. for (var d = {}, p = 0; p < u.length; p++)
  45640. if (u[p].morphTargets)
  45641. for (var f = 0; f < u[p].morphTargets.length; f++)
  45642. d[u[p].morphTargets[f]] = -1;
  45643. for (var g in d) {
  45644. for (var m = [], v = [], f = 0; f !== u[p].morphTargets.length; ++f) {
  45645. var A = u[p];
  45646. m.push(A.time),
  45647. v.push(A.morphTarget === g ? 1 : 0)
  45648. }
  45649. o.push(new n.NumberKeyframeTrack(".morphTargetInfluence[" + g + "]",m,v))
  45650. }
  45651. s = d.length * (l || 1)
  45652. } else {
  45653. var y = ".bones[" + t[h].name + "]";
  45654. r(n.VectorKeyframeTrack, y + ".position", u, "pos", o),
  45655. r(n.QuaternionKeyframeTrack, y + ".quaternion", u, "rot", o),
  45656. r(n.VectorKeyframeTrack, y + ".scale", u, "scl", o)
  45657. }
  45658. }
  45659. if (0 === o.length)
  45660. return null;
  45661. var C = new n.AnimationClip(a,s,o);
  45662. return C
  45663. }
  45664. }),
  45665. n.AnimationMixer = function(e) {
  45666. this._root = e,
  45667. this._initMemoryManager(),
  45668. this._accuIndex = 0,
  45669. this.time = 0,
  45670. this.timeScale = 1
  45671. }
  45672. ,
  45673. n.AnimationMixer.prototype = {
  45674. constructor: n.AnimationMixer,
  45675. clipAction: function(e, t) {
  45676. 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];
  45677. if (void 0 !== l) {
  45678. var c = l.actionByRoot[o];
  45679. if (void 0 !== c)
  45680. return c;
  45681. if (i = l.knownActions[0],
  45682. s = i._clip,
  45683. e !== a && e !== s)
  45684. throw new Error("Different clips with the same name detected!")
  45685. }
  45686. if (null === s)
  45687. return null;
  45688. var h = new n.AnimationMixer._Action(this,s,t);
  45689. return this._bindAction(h, i),
  45690. this._addInactiveAction(h, a, o),
  45691. h
  45692. },
  45693. existingAction: function(e, t) {
  45694. var i = t || this._root
  45695. , n = i.uuid
  45696. , r = "string" == typeof e ? e : e.name
  45697. , o = this._actionsByClip[r];
  45698. return void 0 !== o ? o.actionByRoot[n] || null : null
  45699. },
  45700. stopAllAction: function() {
  45701. var e = this._actions
  45702. , t = this._nActiveActions
  45703. , i = this._bindings
  45704. , n = this._nActiveBindings;
  45705. this._nActiveActions = 0,
  45706. this._nActiveBindings = 0;
  45707. for (var r = 0; r !== t; ++r)
  45708. e[r].reset();
  45709. for (var r = 0; r !== n; ++r)
  45710. i[r].useCount = 0;
  45711. return this
  45712. },
  45713. update: function(e) {
  45714. e *= this.timeScale;
  45715. 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) {
  45716. var s = t[a];
  45717. s.enabled && s._update(n, e, r, o)
  45718. }
  45719. for (var l = this._bindings, c = this._nActiveBindings, a = 0; a !== c; ++a)
  45720. l[a].apply(o);
  45721. return this
  45722. },
  45723. getRoot: function() {
  45724. return this._root
  45725. },
  45726. uncacheClip: function(e) {
  45727. var t = this._actions
  45728. , i = e.name
  45729. , n = this._actionsByClip
  45730. , r = n[i];
  45731. if (void 0 !== r) {
  45732. for (var o = r.knownActions, a = 0, s = o.length; a !== s; ++a) {
  45733. var l = o[a];
  45734. this._deactivateAction(l);
  45735. var c = l._cacheIndex
  45736. , h = t[t.length - 1];
  45737. l._cacheIndex = null,
  45738. l._byClipCacheIndex = null,
  45739. h._cacheIndex = c,
  45740. t[c] = h,
  45741. t.pop(),
  45742. this._removeInactiveBindingsForAction(l)
  45743. }
  45744. delete n[i]
  45745. }
  45746. },
  45747. uncacheRoot: function(e) {
  45748. var t = e.uuid
  45749. , i = this._actionsByClip;
  45750. for (var n in i) {
  45751. var r = i[n].actionByRoot
  45752. , o = r[t];
  45753. void 0 !== o && (this._deactivateAction(o),
  45754. this._removeInactiveAction(o))
  45755. }
  45756. var a = this._bindingsByRootAndName
  45757. , s = a[t];
  45758. if (void 0 !== s)
  45759. for (var l in s) {
  45760. var c = s[l];
  45761. c.restoreOriginalState(),
  45762. this._removeInactiveBinding(c)
  45763. }
  45764. },
  45765. uncacheAction: function(e, t) {
  45766. var i = this.existingAction(e, t);
  45767. null !== i && (this._deactivateAction(i),
  45768. this._removeInactiveAction(i))
  45769. }
  45770. },
  45771. n.EventDispatcher.prototype.apply(n.AnimationMixer.prototype),
  45772. n.AnimationMixer._Action = function(e, t, i) {
  45773. this._mixer = e,
  45774. this._clip = t,
  45775. this._localRoot = i || null;
  45776. for (var r = t.tracks, o = r.length, a = new Array(o), s = {
  45777. endingStart: n.ZeroCurvatureEnding,
  45778. endingEnd: n.ZeroCurvatureEnding
  45779. }, l = 0; l !== o; ++l) {
  45780. var c = r[l].createInterpolant(null);
  45781. a[l] = c,
  45782. c.settings = s
  45783. }
  45784. this._interpolantSettings = s,
  45785. this._interpolants = a,
  45786. this._propertyBindings = new Array(o),
  45787. this._cacheIndex = null,
  45788. this._byClipCacheIndex = null,
  45789. this._timeScaleInterpolant = null,
  45790. this._weightInterpolant = null,
  45791. this.loop = n.LoopRepeat,
  45792. this._loopCount = -1,
  45793. this._startTime = null,
  45794. this.time = 0,
  45795. this.timeScale = 1,
  45796. this._effectiveTimeScale = 1,
  45797. this.weight = 1,
  45798. this._effectiveWeight = 1,
  45799. this.repetitions = 1 / 0,
  45800. this.paused = !1,
  45801. this.enabled = !0,
  45802. this.clampWhenFinished = !1,
  45803. this.zeroSlopeAtStart = !0,
  45804. this.zeroSlopeAtEnd = !0
  45805. }
  45806. ,
  45807. n.AnimationMixer._Action.prototype = {
  45808. constructor: n.AnimationMixer._Action,
  45809. play: function() {
  45810. return this._mixer._activateAction(this),
  45811. this
  45812. },
  45813. stop: function() {
  45814. return this._mixer._deactivateAction(this),
  45815. this.reset()
  45816. },
  45817. reset: function() {
  45818. return this.paused = !1,
  45819. this.enabled = !0,
  45820. this.time = 0,
  45821. this._loopCount = -1,
  45822. this._startTime = null,
  45823. this.stopFading().stopWarping()
  45824. },
  45825. isRunning: function() {
  45826. this._startTime;
  45827. return this.enabled && !this.paused && 0 !== this.timeScale && null === this._startTime && this._mixer._isActiveAction(this)
  45828. },
  45829. isScheduled: function() {
  45830. return this._mixer._isActiveAction(this)
  45831. },
  45832. startAt: function(e) {
  45833. return this._startTime = e,
  45834. this
  45835. },
  45836. setLoop: function(e, t) {
  45837. return this.loop = e,
  45838. this.repetitions = t,
  45839. this
  45840. },
  45841. setEffectiveWeight: function(e) {
  45842. return this.weight = e,
  45843. this._effectiveWeight = this.enabled ? e : 0,
  45844. this.stopFading()
  45845. },
  45846. getEffectiveWeight: function() {
  45847. return this._effectiveWeight
  45848. },
  45849. fadeIn: function(e) {
  45850. return this._scheduleFading(e, 0, 1)
  45851. },
  45852. fadeOut: function(e) {
  45853. return this._scheduleFading(e, 1, 0)
  45854. },
  45855. crossFadeFrom: function(e, t, i) {
  45856. this._mixer;
  45857. if (e.fadeOut(t),
  45858. this.fadeIn(t),
  45859. i) {
  45860. var n = this._clip.duration
  45861. , r = e._clip.duration
  45862. , o = r / n
  45863. , a = n / r;
  45864. e.warp(1, o, t),
  45865. this.warp(a, 1, t)
  45866. }
  45867. return this
  45868. },
  45869. crossFadeTo: function(e, t, i) {
  45870. return e.crossFadeFrom(this, t, i)
  45871. },
  45872. stopFading: function() {
  45873. var e = this._weightInterpolant;
  45874. return null !== e && (this._weightInterpolant = null,
  45875. this._mixer._takeBackControlInterpolant(e)),
  45876. this
  45877. },
  45878. setEffectiveTimeScale: function(e) {
  45879. return this.timeScale = e,
  45880. this._effectiveTimeScale = this.paused ? 0 : e,
  45881. this.stopWarping()
  45882. },
  45883. getEffectiveTimeScale: function() {
  45884. return this._effectiveTimeScale
  45885. },
  45886. setDuration: function(e) {
  45887. return this.timeScale = this._clip.duration / e,
  45888. this.stopWarping()
  45889. },
  45890. syncWith: function(e) {
  45891. return this.time = e.time,
  45892. this.timeScale = e.timeScale,
  45893. this.stopWarping()
  45894. },
  45895. halt: function(e) {
  45896. return this.warp(this._currentTimeScale, 0, e)
  45897. },
  45898. warp: function(e, t, i) {
  45899. var n = this._mixer
  45900. , r = n.time
  45901. , o = this._timeScaleInterpolant
  45902. , a = this.timeScale;
  45903. null === o && (o = n._lendControlInterpolant(),
  45904. this._timeScaleInterpolant = o);
  45905. var s = o.parameterPositions
  45906. , l = o.sampleValues;
  45907. return s[0] = r,
  45908. s[1] = r + i,
  45909. l[0] = e / a,
  45910. l[1] = t / a,
  45911. this
  45912. },
  45913. stopWarping: function() {
  45914. var e = this._timeScaleInterpolant;
  45915. return null !== e && (this._timeScaleInterpolant = null,
  45916. this._mixer._takeBackControlInterpolant(e)),
  45917. this
  45918. },
  45919. getMixer: function() {
  45920. return this._mixer
  45921. },
  45922. getClip: function() {
  45923. return this._clip
  45924. },
  45925. getRoot: function() {
  45926. return this._localRoot || this._mixer._root
  45927. },
  45928. _update: function(e, t, i, n) {
  45929. var r = this._startTime;
  45930. if (null !== r) {
  45931. var o = (e - r) * i;
  45932. if (o < 0 || 0 === i)
  45933. return;
  45934. this._startTime = null,
  45935. t = i * o
  45936. }
  45937. t *= this._updateTimeScale(e);
  45938. var a = this._updateTime(t)
  45939. , s = this._updateWeight(e);
  45940. if (s > 0)
  45941. for (var l = this._interpolants, c = this._propertyBindings, h = 0, u = l.length; h !== u; ++h)
  45942. l[h].evaluate(a),
  45943. c[h].accumulate(n, s)
  45944. },
  45945. _updateWeight: function(e) {
  45946. var t = 0;
  45947. if (this.enabled) {
  45948. t = this.weight;
  45949. var i = this._weightInterpolant;
  45950. if (null !== i) {
  45951. var n = i.evaluate(e)[0];
  45952. t *= n,
  45953. e > i.parameterPositions[1] && (this.stopFading(),
  45954. 0 === n && (this.enabled = !1))
  45955. }
  45956. }
  45957. return this._effectiveWeight = t,
  45958. t
  45959. },
  45960. _updateTimeScale: function(e) {
  45961. var t = 0;
  45962. if (!this.paused) {
  45963. t = this.timeScale;
  45964. var i = this._timeScaleInterpolant;
  45965. if (null !== i) {
  45966. var n = i.evaluate(e)[0];
  45967. t *= n,
  45968. e > i.parameterPositions[1] && (this.stopWarping(),
  45969. 0 === t ? this.pause = !0 : this.timeScale = t)
  45970. }
  45971. }
  45972. return this._effectiveTimeScale = t,
  45973. t
  45974. },
  45975. _updateTime: function(e) {
  45976. var t = this.time + e;
  45977. if (0 === e)
  45978. return t;
  45979. var i = this._clip.duration
  45980. , r = this.loop
  45981. , o = this._loopCount
  45982. , a = !1;
  45983. switch (r) {
  45984. case n.LoopOnce:
  45985. if (o === -1 && (this.loopCount = 0,
  45986. this._setEndings(!0, !0, !1)),
  45987. t >= i)
  45988. t = i;
  45989. else {
  45990. if (!(t < 0))
  45991. break;
  45992. t = 0
  45993. }
  45994. this.clampWhenFinished ? this.pause = !0 : this.enabled = !1,
  45995. this._mixer.dispatchEvent({
  45996. type: "finished",
  45997. action: this,
  45998. direction: e < 0 ? -1 : 1
  45999. });
  46000. break;
  46001. case n.LoopPingPong:
  46002. a = !0;
  46003. case n.LoopRepeat:
  46004. if (o === -1 && (e > 0 ? (o = 0,
  46005. this._setEndings(!0, 0 === this.repetitions, a)) : this._setEndings(0 === this.repetitions, !0, a)),
  46006. t >= i || t < 0) {
  46007. var s = Math.floor(t / i);
  46008. t -= i * s,
  46009. o += Math.abs(s);
  46010. var l = this.repetitions - o;
  46011. if (l < 0) {
  46012. this.clampWhenFinished ? this.paused = !0 : this.enabled = !1,
  46013. t = e > 0 ? i : 0,
  46014. this._mixer.dispatchEvent({
  46015. type: "finished",
  46016. action: this,
  46017. direction: e > 0 ? 1 : -1
  46018. });
  46019. break
  46020. }
  46021. if (0 === l) {
  46022. var c = e < 0;
  46023. this._setEndings(c, !c, a)
  46024. } else
  46025. this._setEndings(!1, !1, a);
  46026. this._loopCount = o,
  46027. this._mixer.dispatchEvent({
  46028. type: "loop",
  46029. action: this,
  46030. loopDelta: s
  46031. })
  46032. }
  46033. if (r === n.LoopPingPong && 1 === (1 & o))
  46034. return this.time = t,
  46035. i - t
  46036. }
  46037. return this.time = t,
  46038. t
  46039. },
  46040. _setEndings: function(e, t, i) {
  46041. var r = this._interpolantSettings;
  46042. i ? (r.endingStart = n.ZeroSlopeEnding,
  46043. r.endingEnd = n.ZeroSlopeEnding) : (e ? r.endingStart = this.zeroSlopeAtStart ? n.ZeroSlopeEnding : n.ZeroCurvatureEnding : r.endingStart = n.WrapAroundEnding,
  46044. t ? r.endingEnd = this.zeroSlopeAtEnd ? n.ZeroSlopeEnding : n.ZeroCurvatureEnding : r.endingEnd = n.WrapAroundEnding)
  46045. },
  46046. _scheduleFading: function(e, t, i) {
  46047. var n = this._mixer
  46048. , r = n.time
  46049. , o = this._weightInterpolant;
  46050. null === o && (o = n._lendControlInterpolant(),
  46051. this._weightInterpolant = o);
  46052. var a = o.parameterPositions
  46053. , s = o.sampleValues;
  46054. return a[0] = r,
  46055. s[0] = t,
  46056. a[1] = r + e,
  46057. s[1] = i,
  46058. this
  46059. }
  46060. },
  46061. Object.assign(n.AnimationMixer.prototype, {
  46062. _bindAction: function(e, t) {
  46063. var i = e._localRoot || this._root
  46064. , r = e._clip.tracks
  46065. , o = r.length
  46066. , a = e._propertyBindings
  46067. , s = e._interpolants
  46068. , l = i.uuid
  46069. , c = this._bindingsByRootAndName
  46070. , h = c[l];
  46071. void 0 === h && (h = {},
  46072. c[l] = h);
  46073. for (var u = 0; u !== o; ++u) {
  46074. var d = r[u]
  46075. , p = d.name
  46076. , f = h[p];
  46077. if (void 0 !== f)
  46078. a[u] = f;
  46079. else {
  46080. if (f = a[u],
  46081. void 0 !== f) {
  46082. null === f._cacheIndex && (++f.referenceCount,
  46083. this._addInactiveBinding(f, l, p));
  46084. continue
  46085. }
  46086. var g = t && t._propertyBindings[u].binding.parsedPath;
  46087. f = new n.PropertyMixer(n.PropertyBinding.create(i, p, g),d.ValueTypeName,d.getValueSize()),
  46088. ++f.referenceCount,
  46089. this._addInactiveBinding(f, l, p),
  46090. a[u] = f
  46091. }
  46092. s[u].resultBuffer = f.buffer
  46093. }
  46094. },
  46095. _activateAction: function(e) {
  46096. if (!this._isActiveAction(e)) {
  46097. if (null === e._cacheIndex) {
  46098. var t = (e._localRoot || this._root).uuid
  46099. , i = e._clip.name
  46100. , n = this._actionsByClip[i];
  46101. this._bindAction(e, n && n.knownActions[0]),
  46102. this._addInactiveAction(e, i, t)
  46103. }
  46104. for (var r = e._propertyBindings, o = 0, a = r.length; o !== a; ++o) {
  46105. var s = r[o];
  46106. 0 === s.useCount++ && (this._lendBinding(s),
  46107. s.saveOriginalState())
  46108. }
  46109. this._lendAction(e)
  46110. }
  46111. },
  46112. _deactivateAction: function(e) {
  46113. if (this._isActiveAction(e)) {
  46114. for (var t = e._propertyBindings, i = 0, n = t.length; i !== n; ++i) {
  46115. var r = t[i];
  46116. 0 === --r.useCount && (r.restoreOriginalState(),
  46117. this._takeBackBinding(r))
  46118. }
  46119. this._takeBackAction(e)
  46120. }
  46121. },
  46122. _initMemoryManager: function() {
  46123. this._actions = [],
  46124. this._nActiveActions = 0,
  46125. this._actionsByClip = {},
  46126. this._bindings = [],
  46127. this._nActiveBindings = 0,
  46128. this._bindingsByRootAndName = {},
  46129. this._controlInterpolants = [],
  46130. this._nActiveControlInterpolants = 0;
  46131. var e = this;
  46132. this.stats = {
  46133. actions: {
  46134. get total() {
  46135. return e._actions.length
  46136. },
  46137. get inUse() {
  46138. return e._nActiveActions
  46139. }
  46140. },
  46141. bindings: {
  46142. get total() {
  46143. return e._bindings.length
  46144. },
  46145. get inUse() {
  46146. return e._nActiveBindings
  46147. }
  46148. },
  46149. controlInterpolants: {
  46150. get total() {
  46151. return e._controlInterpolants.length
  46152. },
  46153. get inUse() {
  46154. return e._nActiveControlInterpolants
  46155. }
  46156. }
  46157. }
  46158. },
  46159. _isActiveAction: function(e) {
  46160. var t = e._cacheIndex;
  46161. return null !== t && t < this._nActiveActions
  46162. },
  46163. _addInactiveAction: function(e, t, i) {
  46164. var n = this._actions
  46165. , r = this._actionsByClip
  46166. , o = r[t];
  46167. if (void 0 === o)
  46168. o = {
  46169. knownActions: [e],
  46170. actionByRoot: {}
  46171. },
  46172. e._byClipCacheIndex = 0,
  46173. r[t] = o;
  46174. else {
  46175. var a = o.knownActions;
  46176. e._byClipCacheIndex = a.length,
  46177. a.push(e)
  46178. }
  46179. e._cacheIndex = n.length,
  46180. n.push(e),
  46181. o.actionByRoot[i] = e
  46182. },
  46183. _removeInactiveAction: function(e) {
  46184. var t = this._actions
  46185. , i = t[t.length - 1]
  46186. , n = e._cacheIndex;
  46187. i._cacheIndex = n,
  46188. t[n] = i,
  46189. t.pop(),
  46190. e._cacheIndex = null;
  46191. var r = e._clip.name
  46192. , o = this._actionsByClip
  46193. , a = o[r]
  46194. , s = a.knownActions
  46195. , l = s[s.length - 1]
  46196. , c = e._byClipCacheIndex;
  46197. l._byClipCacheIndex = c,
  46198. s[c] = l,
  46199. s.pop(),
  46200. e._byClipCacheIndex = null;
  46201. var h = a.actionByRoot
  46202. , u = (t._localRoot || this._root).uuid;
  46203. delete h[u],
  46204. 0 === s.length && delete o[r],
  46205. this._removeInactiveBindingsForAction(e)
  46206. },
  46207. _removeInactiveBindingsForAction: function(e) {
  46208. for (var t = e._propertyBindings, i = 0, n = t.length; i !== n; ++i) {
  46209. var r = t[i];
  46210. 0 === --r.referenceCount && this._removeInactiveBinding(r)
  46211. }
  46212. },
  46213. _lendAction: function(e) {
  46214. var t = this._actions
  46215. , i = e._cacheIndex
  46216. , n = this._nActiveActions++
  46217. , r = t[n];
  46218. e._cacheIndex = n,
  46219. t[n] = e,
  46220. r._cacheIndex = i,
  46221. t[i] = r
  46222. },
  46223. _takeBackAction: function(e) {
  46224. var t = this._actions
  46225. , i = e._cacheIndex
  46226. , n = --this._nActiveActions
  46227. , r = t[n];
  46228. e._cacheIndex = n,
  46229. t[n] = e,
  46230. r._cacheIndex = i,
  46231. t[i] = r
  46232. },
  46233. _addInactiveBinding: function(e, t, i) {
  46234. var n = this._bindingsByRootAndName
  46235. , r = n[t]
  46236. , o = this._bindings;
  46237. void 0 === r && (r = {},
  46238. n[t] = r),
  46239. r[i] = e,
  46240. e._cacheIndex = o.length,
  46241. o.push(e)
  46242. },
  46243. _removeInactiveBinding: function(e) {
  46244. var t = this._bindings
  46245. , i = e.binding
  46246. , n = i.rootNode.uuid
  46247. , r = i.path
  46248. , o = this._bindingsByRootAndName
  46249. , a = o[n]
  46250. , s = t[t.length - 1]
  46251. , l = e._cacheIndex;
  46252. s._cacheIndex = l,
  46253. t[l] = s,
  46254. t.pop(),
  46255. delete a[r];
  46256. e: {
  46257. for (var c in a)
  46258. break e;
  46259. delete o[n]
  46260. }
  46261. },
  46262. _lendBinding: function(e) {
  46263. var t = this._bindings
  46264. , i = e._cacheIndex
  46265. , n = this._nActiveBindings++
  46266. , r = t[n];
  46267. e._cacheIndex = n,
  46268. t[n] = e,
  46269. r._cacheIndex = i,
  46270. t[i] = r
  46271. },
  46272. _takeBackBinding: function(e) {
  46273. var t = this._bindings
  46274. , i = e._cacheIndex
  46275. , n = --this._nActiveBindings
  46276. , r = t[n];
  46277. e._cacheIndex = n,
  46278. t[n] = e,
  46279. r._cacheIndex = i,
  46280. t[i] = r
  46281. },
  46282. _lendControlInterpolant: function() {
  46283. var e = this._controlInterpolants
  46284. , t = this._nActiveControlInterpolants++
  46285. , i = e[t];
  46286. return void 0 === i && (i = new n.LinearInterpolant(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer),
  46287. i.__cacheIndex = t,
  46288. e[t] = i),
  46289. i
  46290. },
  46291. _takeBackControlInterpolant: function(e) {
  46292. var t = this._controlInterpolants
  46293. , i = e.__cacheIndex
  46294. , n = --this._nActiveControlInterpolants
  46295. , r = t[n];
  46296. e.__cacheIndex = n,
  46297. t[n] = e,
  46298. r.__cacheIndex = i,
  46299. t[i] = r
  46300. },
  46301. _controlInterpolantsResultBuffer: new Float32Array(1)
  46302. }),
  46303. n.AnimationObjectGroup = function(e) {
  46304. this.uuid = n.Math.generateUUID(),
  46305. this._objects = Array.prototype.slice.call(arguments),
  46306. this.nCachedObjects_ = 0;
  46307. var t = {};
  46308. this._indicesByUUID = t;
  46309. for (var i = 0, r = arguments.length; i !== r; ++i)
  46310. t[arguments[i].uuid] = i;
  46311. this._paths = [],
  46312. this._parsedPaths = [],
  46313. this._bindings = [],
  46314. this._bindingsIndicesByPath = {};
  46315. var o = this;
  46316. this.stats = {
  46317. objects: {
  46318. get total() {
  46319. return o._objects.length
  46320. },
  46321. get inUse() {
  46322. return this.total - o.nCachedObjects_
  46323. }
  46324. },
  46325. get bindingsPerObject() {
  46326. return o._bindings.length
  46327. }
  46328. }
  46329. }
  46330. ,
  46331. n.AnimationObjectGroup.prototype = {
  46332. constructor: n.AnimationObjectGroup,
  46333. add: function(e) {
  46334. 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) {
  46335. var d = arguments[h]
  46336. , p = d.uuid
  46337. , f = o[p];
  46338. if (void 0 === f) {
  46339. f = i++,
  46340. o[p] = f,
  46341. t.push(d);
  46342. for (var g = 0, m = c; g !== m; ++g)
  46343. l[g].push(new n.PropertyBinding(d,a[g],s[g]))
  46344. } else if (f < r) {
  46345. var v = t[f]
  46346. , A = --r
  46347. , y = t[A];
  46348. o[y.uuid] = f,
  46349. t[f] = y,
  46350. o[p] = A,
  46351. t[A] = d;
  46352. for (var g = 0, m = c; g !== m; ++g) {
  46353. var C = l[g]
  46354. , I = C[A]
  46355. , E = C[f];
  46356. C[f] = I,
  46357. void 0 === E && (E = new n.PropertyBinding(d,a[g],s[g])),
  46358. C[A] = E
  46359. }
  46360. } else
  46361. t[f] !== v && console.error("Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes...")
  46362. }
  46363. this.nCachedObjects_ = r
  46364. },
  46365. remove: function(e) {
  46366. for (var t = this._objects, i = (t.length,
  46367. this.nCachedObjects_), n = this._indicesByUUID, r = this._bindings, o = r.length, a = 0, s = arguments.length; a !== s; ++a) {
  46368. var l = arguments[a]
  46369. , c = l.uuid
  46370. , h = n[c];
  46371. if (void 0 !== h && h >= i) {
  46372. var u = i++
  46373. , d = t[u];
  46374. n[d.uuid] = h,
  46375. t[h] = d,
  46376. n[c] = u,
  46377. t[u] = l;
  46378. for (var p = 0, f = o; p !== f; ++p) {
  46379. var g = r[p]
  46380. , m = g[u]
  46381. , v = g[h];
  46382. g[h] = m,
  46383. g[u] = v
  46384. }
  46385. }
  46386. }
  46387. this.nCachedObjects_ = i
  46388. },
  46389. uncache: function(e) {
  46390. 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) {
  46391. var c = arguments[s]
  46392. , h = c.uuid
  46393. , u = r[h];
  46394. if (void 0 !== u)
  46395. if (delete r[h],
  46396. u < n) {
  46397. var d = --n
  46398. , p = t[d]
  46399. , f = --i
  46400. , g = t[f];
  46401. r[p.uuid] = u,
  46402. t[u] = p,
  46403. r[g.uuid] = d,
  46404. t[d] = g,
  46405. t.pop();
  46406. for (var m = 0, v = a; m !== v; ++m) {
  46407. var A = o[m]
  46408. , y = A[d]
  46409. , C = A[f];
  46410. A[u] = y,
  46411. A[d] = C,
  46412. A.pop()
  46413. }
  46414. } else {
  46415. var f = --i
  46416. , g = t[f];
  46417. r[g.uuid] = u,
  46418. t[u] = g,
  46419. t.pop();
  46420. for (var m = 0, v = a; m !== v; ++m) {
  46421. var A = o[m];
  46422. A[u] = A[f],
  46423. A.pop()
  46424. }
  46425. }
  46426. }
  46427. this.nCachedObjects_ = n
  46428. },
  46429. subscribe_: function(e, t) {
  46430. var i = this._bindingsIndicesByPath
  46431. , r = i[e]
  46432. , o = this._bindings;
  46433. if (void 0 !== r)
  46434. return o[r];
  46435. var a = this._paths
  46436. , s = this._parsedPaths
  46437. , l = this._objects
  46438. , c = l.length
  46439. , h = this.nCachedObjects_
  46440. , u = new Array(c);
  46441. r = o.length,
  46442. i[e] = r,
  46443. a.push(e),
  46444. s.push(t),
  46445. o.push(u);
  46446. for (var d = h, p = l.length; d !== p; ++d) {
  46447. var f = l[d];
  46448. u[d] = new n.PropertyBinding(f,e,t)
  46449. }
  46450. return u
  46451. },
  46452. unsubscribe_: function(e) {
  46453. var t = this._bindingsIndicesByPath
  46454. , i = t[e];
  46455. if (void 0 !== i) {
  46456. var n = this._paths
  46457. , r = this._parsedPaths
  46458. , o = this._bindings
  46459. , a = o.length - 1
  46460. , s = o[a]
  46461. , l = e[a];
  46462. t[l] = i,
  46463. o[i] = s,
  46464. o.pop(),
  46465. r[i] = r[a],
  46466. r.pop(),
  46467. n[i] = n[a],
  46468. n.pop()
  46469. }
  46470. }
  46471. },
  46472. n.AnimationUtils = {
  46473. arraySlice: function(e, t, i) {
  46474. return n.AnimationUtils.isTypedArray(e) ? new e.constructor(e.subarray(t, i)) : e.slice(t, i)
  46475. },
  46476. convertArray: function(e, t, i) {
  46477. return !e || !i && e.constructor === t ? e : "number" == typeof t.BYTES_PER_ELEMENT ? new t(e) : Array.prototype.slice.call(e)
  46478. },
  46479. isTypedArray: function(e) {
  46480. return ArrayBuffer.isView(e) && !(e instanceof DataView)
  46481. },
  46482. getKeyframeOrder: function(e) {
  46483. function t(t, i) {
  46484. return e[t] - e[i]
  46485. }
  46486. for (var i = e.length, n = new Array(i), r = 0; r !== i; ++r)
  46487. n[r] = r;
  46488. return n.sort(t),
  46489. n
  46490. },
  46491. sortedArray: function(e, t, i) {
  46492. for (var n = e.length, r = new e.constructor(n), o = 0, a = 0; a !== n; ++o)
  46493. for (var s = i[o] * t, l = 0; l !== t; ++l)
  46494. r[a++] = e[s + l];
  46495. return r
  46496. },
  46497. flattenJSON: function(e, t, i, n) {
  46498. for (var r = 1, o = e[0]; void 0 !== o && void 0 === o[n]; )
  46499. o = e[r++];
  46500. if (void 0 !== o) {
  46501. var a = o[n];
  46502. if (void 0 !== a)
  46503. if (Array.isArray(a)) {
  46504. do
  46505. a = o[n],
  46506. void 0 !== a && (t.push(o.time),
  46507. i.push.apply(i, a)),
  46508. o = e[r++];
  46509. while (void 0 !== o)
  46510. } else if (void 0 !== a.toArray) {
  46511. do
  46512. a = o[n],
  46513. void 0 !== a && (t.push(o.time),
  46514. a.toArray(i, i.length)),
  46515. o = e[r++];
  46516. while (void 0 !== o)
  46517. } else
  46518. do
  46519. a = o[n],
  46520. void 0 !== a && (t.push(o.time),
  46521. i.push(a)),
  46522. o = e[r++];
  46523. while (void 0 !== o)
  46524. }
  46525. }
  46526. },
  46527. n.KeyframeTrack = function(e, t, i, r) {
  46528. if (void 0 === e)
  46529. throw new Error("track name is undefined");
  46530. if (void 0 === t || 0 === t.length)
  46531. throw new Error("no keyframes in track named " + e);
  46532. this.name = e,
  46533. this.times = n.AnimationUtils.convertArray(t, this.TimeBufferType),
  46534. this.values = n.AnimationUtils.convertArray(i, this.ValueBufferType),
  46535. this.setInterpolation(r || this.DefaultInterpolation),
  46536. this.validate(),
  46537. this.optimize()
  46538. }
  46539. ,
  46540. n.KeyframeTrack.prototype = {
  46541. constructor: n.KeyframeTrack,
  46542. TimeBufferType: Float32Array,
  46543. ValueBufferType: Float32Array,
  46544. DefaultInterpolation: n.InterpolateLinear,
  46545. InterpolantFactoryMethodDiscrete: function(e) {
  46546. return new n.DiscreteInterpolant(this.times,this.values,this.getValueSize(),e)
  46547. },
  46548. InterpolantFactoryMethodLinear: function(e) {
  46549. return new n.LinearInterpolant(this.times,this.values,this.getValueSize(),e)
  46550. },
  46551. InterpolantFactoryMethodSmooth: function(e) {
  46552. return new n.CubicInterpolant(this.times,this.values,this.getValueSize(),e)
  46553. },
  46554. setInterpolation: function(e) {
  46555. var t = void 0;
  46556. switch (e) {
  46557. case n.InterpolateDiscrete:
  46558. t = this.InterpolantFactoryMethodDiscrete;
  46559. break;
  46560. case n.InterpolateLinear:
  46561. t = this.InterpolantFactoryMethodLinear;
  46562. break;
  46563. case n.InterpolateSmooth:
  46564. t = this.InterpolantFactoryMethodSmooth
  46565. }
  46566. if (void 0 === t) {
  46567. var i = "unsupported interpolation for " + this.ValueTypeName + " keyframe track named " + this.name;
  46568. if (void 0 === this.createInterpolant) {
  46569. if (e === this.DefaultInterpolation)
  46570. throw new Error(i);
  46571. this.setInterpolation(this.DefaultInterpolation)
  46572. }
  46573. return void console.warn(i)
  46574. }
  46575. this.createInterpolant = t
  46576. },
  46577. getInterpolation: function() {
  46578. switch (this.createInterpolant) {
  46579. case this.InterpolantFactoryMethodDiscrete:
  46580. return n.InterpolateDiscrete;
  46581. case this.InterpolantFactoryMethodLinear:
  46582. return n.InterpolateLinear;
  46583. case this.InterpolantFactoryMethodSmooth:
  46584. return n.InterpolateSmooth
  46585. }
  46586. },
  46587. getValueSize: function() {
  46588. return this.values.length / this.times.length
  46589. },
  46590. shift: function(e) {
  46591. if (0 !== e)
  46592. for (var t = this.times, i = 0, n = t.length; i !== n; ++i)
  46593. t[i] += e;
  46594. return this
  46595. },
  46596. scale: function(e) {
  46597. if (1 !== e)
  46598. for (var t = this.times, i = 0, n = t.length; i !== n; ++i)
  46599. t[i] *= e;
  46600. return this
  46601. },
  46602. trim: function(e, t) {
  46603. for (var i = this.times, r = i.length, o = 0, a = r - 1; o !== r && i[o] < e; )
  46604. ++o;
  46605. for (; a !== -1 && i[a] > t; )
  46606. --a;
  46607. if (++a,
  46608. 0 !== o || a !== r) {
  46609. o >= a && (a = Math.max(a, 1),
  46610. o = a - 1);
  46611. var s = this.getValueSize();
  46612. this.times = n.AnimationUtils.arraySlice(i, o, a),
  46613. this.values = n.AnimationUtils.arraySlice(this.values, o * s, a * s)
  46614. }
  46615. return this
  46616. },
  46617. validate: function() {
  46618. var e = !0
  46619. , t = this.getValueSize();
  46620. t - Math.floor(t) !== 0 && (console.error("invalid value size in track", this),
  46621. e = !1);
  46622. var i = this.times
  46623. , r = this.values
  46624. , o = i.length;
  46625. 0 === o && (console.error("track is empty", this),
  46626. e = !1);
  46627. for (var a = null, s = 0; s !== o; s++) {
  46628. var l = i[s];
  46629. if ("number" == typeof l && isNaN(l)) {
  46630. console.error("time is not a valid number", this, s, l),
  46631. e = !1;
  46632. break
  46633. }
  46634. if (null !== a && a > l) {
  46635. console.error("out of order keys", this, s, l, a),
  46636. e = !1;
  46637. break
  46638. }
  46639. a = l
  46640. }
  46641. if (void 0 !== r && n.AnimationUtils.isTypedArray(r))
  46642. for (var s = 0, c = r.length; s !== c; ++s) {
  46643. var h = r[s];
  46644. if (isNaN(h)) {
  46645. console.error("value is not a valid number", this, s, h),
  46646. e = !1;
  46647. break
  46648. }
  46649. }
  46650. return e
  46651. },
  46652. optimize: function() {
  46653. for (var e = this.times, t = this.values, i = this.getValueSize(), r = 1, o = 1, a = e.length - 1; o <= a; ++o) {
  46654. var s = !1
  46655. , l = e[o]
  46656. , c = e[o + 1];
  46657. if (l !== c && (1 !== o || l !== l[0]))
  46658. for (var h = o * i, u = h - i, d = h + i, p = 0; p !== i; ++p) {
  46659. var f = t[h + p];
  46660. if (f !== t[u + p] || f !== t[d + p]) {
  46661. s = !0;
  46662. break
  46663. }
  46664. }
  46665. if (s) {
  46666. if (o !== r) {
  46667. e[r] = e[o];
  46668. for (var g = o * i, m = r * i, p = 0; p !== i; ++p)
  46669. t[m + p] = t[g + p]
  46670. }
  46671. ++r
  46672. }
  46673. }
  46674. return r !== e.length && (this.times = n.AnimationUtils.arraySlice(e, 0, r),
  46675. this.values = n.AnimationUtils.arraySlice(t, 0, r * i)),
  46676. this
  46677. }
  46678. },
  46679. Object.assign(n.KeyframeTrack, {
  46680. parse: function(e) {
  46681. if (void 0 === e.type)
  46682. throw new Error("track type undefined, can not parse");
  46683. var t = n.KeyframeTrack._getTrackTypeForValueTypeName(e.type);
  46684. if (void 0 === e.times) {
  46685. console.warn("legacy JSON format detected, converting");
  46686. var i = []
  46687. , r = [];
  46688. n.AnimationUtils.flattenJSON(e.keys, i, r, "value"),
  46689. e.times = i,
  46690. e.values = r
  46691. }
  46692. return void 0 !== t.parse ? t.parse(e) : new t(e.name,e.times,e.values,e.interpolation)
  46693. },
  46694. toJSON: function(e) {
  46695. var t, i = e.constructor;
  46696. if (void 0 !== i.toJSON)
  46697. t = i.toJSON(e);
  46698. else {
  46699. t = {
  46700. name: e.name,
  46701. times: n.AnimationUtils.convertArray(e.times, Array),
  46702. values: n.AnimationUtils.convertArray(e.values, Array)
  46703. };
  46704. var r = e.getInterpolation();
  46705. r !== e.DefaultInterpolation && (t.interpolation = r)
  46706. }
  46707. return t.type = e.ValueTypeName,
  46708. t
  46709. },
  46710. _getTrackTypeForValueTypeName: function(e) {
  46711. switch (e.toLowerCase()) {
  46712. case "scalar":
  46713. case "double":
  46714. case "float":
  46715. case "number":
  46716. case "integer":
  46717. return n.NumberKeyframeTrack;
  46718. case "vector":
  46719. case "vector2":
  46720. case "vector3":
  46721. case "vector4":
  46722. return n.VectorKeyframeTrack;
  46723. case "color":
  46724. return n.ColorKeyframeTrack;
  46725. case "quaternion":
  46726. return n.QuaternionKeyframeTrack;
  46727. case "bool":
  46728. case "boolean":
  46729. return n.BooleanKeyframeTrack;
  46730. case "string":
  46731. return n.StringKeyframeTrack
  46732. }
  46733. throw new Error("Unsupported typeName: " + e)
  46734. }
  46735. }),
  46736. n.PropertyBinding = function(e, t, i) {
  46737. this.path = t,
  46738. this.parsedPath = i || n.PropertyBinding.parseTrackName(t),
  46739. this.node = n.PropertyBinding.findNode(e, this.parsedPath.nodeName) || e,
  46740. this.rootNode = e
  46741. }
  46742. ,
  46743. n.PropertyBinding.prototype = {
  46744. constructor: n.PropertyBinding,
  46745. getValue: function(e, t) {
  46746. this.bind(),
  46747. this.getValue(e, t)
  46748. },
  46749. setValue: function(e, t) {
  46750. this.bind(),
  46751. this.setValue(e, t)
  46752. },
  46753. bind: function() {
  46754. var e = this.node
  46755. , t = this.parsedPath
  46756. , i = t.objectName
  46757. , r = t.propertyName
  46758. , o = t.propertyIndex;
  46759. if (e || (e = n.PropertyBinding.findNode(this.rootNode, t.nodeName) || this.rootNode,
  46760. this.node = e),
  46761. this.getValue = this._getValue_unavailable,
  46762. this.setValue = this._setValue_unavailable,
  46763. !e)
  46764. return void console.error(" trying to update node for track: " + this.path + " but it wasn't found.");
  46765. if (i) {
  46766. var a = t.objectIndex;
  46767. switch (i) {
  46768. case "materials":
  46769. if (!e.material)
  46770. return void console.error(" can not bind to material as node does not have a material", this);
  46771. if (!e.material.materials)
  46772. return void console.error(" can not bind to material.materials as node.material does not have a materials array", this);
  46773. e = e.material.materials;
  46774. break;
  46775. case "bones":
  46776. if (!e.skeleton)
  46777. return void console.error(" can not bind to bones as node does not have a skeleton", this);
  46778. e = e.skeleton.bones;
  46779. for (var s = 0; s < e.length; s++)
  46780. if (e[s].name === a) {
  46781. a = s;
  46782. break
  46783. }
  46784. break;
  46785. default:
  46786. if (void 0 === e[i])
  46787. return void console.error(" can not bind to objectName of node, undefined", this);
  46788. e = e[i]
  46789. }
  46790. if (void 0 !== a) {
  46791. if (void 0 === e[a])
  46792. return void console.error(" trying to bind to objectIndex of objectName, but is undefined:", this, e);
  46793. e = e[a]
  46794. }
  46795. }
  46796. var l = e[r];
  46797. if (!l) {
  46798. var c = t.nodeName;
  46799. return void console.error(" trying to update property for track: " + c + "." + r + " but it wasn't found.", e)
  46800. }
  46801. var h = this.Versioning.None;
  46802. void 0 !== e.needsUpdate ? (h = this.Versioning.NeedsUpdate,
  46803. this.targetObject = e) : void 0 !== e.matrixWorldNeedsUpdate && (h = this.Versioning.MatrixWorldNeedsUpdate,
  46804. this.targetObject = e);
  46805. var u = this.BindingType.Direct;
  46806. if (void 0 !== o) {
  46807. if ("morphTargetInfluences" === r) {
  46808. if (!e.geometry)
  46809. return void console.error(" can not bind to morphTargetInfluences becasuse node does not have a geometry", this);
  46810. if (!e.geometry.morphTargets)
  46811. return void console.error(" can not bind to morphTargetInfluences becasuse node does not have a geometry.morphTargets", this);
  46812. for (var s = 0; s < this.node.geometry.morphTargets.length; s++)
  46813. if (e.geometry.morphTargets[s].name === o) {
  46814. o = s;
  46815. break
  46816. }
  46817. }
  46818. u = this.BindingType.ArrayElement,
  46819. this.resolvedProperty = l,
  46820. this.propertyIndex = o
  46821. } else
  46822. void 0 !== l.fromArray && void 0 !== l.toArray ? (u = this.BindingType.HasFromToArray,
  46823. this.resolvedProperty = l) : void 0 !== l.length ? (u = this.BindingType.EntireArray,
  46824. this.resolvedProperty = l) : this.propertyName = r;
  46825. this.getValue = this.GetterByBindingType[u],
  46826. this.setValue = this.SetterByBindingTypeAndVersioning[u][h]
  46827. },
  46828. unbind: function() {
  46829. this.node = null,
  46830. this.getValue = this._getValue_unbound,
  46831. this.setValue = this._setValue_unbound
  46832. }
  46833. },
  46834. Object.assign(n.PropertyBinding.prototype, {
  46835. _getValue_unavailable: function() {},
  46836. _setValue_unavailable: function() {},
  46837. _getValue_unbound: n.PropertyBinding.prototype.getValue,
  46838. _setValue_unbound: n.PropertyBinding.prototype.setValue,
  46839. BindingType: {
  46840. Direct: 0,
  46841. EntireArray: 1,
  46842. ArrayElement: 2,
  46843. HasFromToArray: 3
  46844. },
  46845. Versioning: {
  46846. None: 0,
  46847. NeedsUpdate: 1,
  46848. MatrixWorldNeedsUpdate: 2
  46849. },
  46850. GetterByBindingType: [function(e, t) {
  46851. e[t] = this.node[this.propertyName]
  46852. }
  46853. , function(e, t) {
  46854. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  46855. e[t++] = i[n]
  46856. }
  46857. , function(e, t) {
  46858. e[t] = this.resolvedProperty[this.propertyIndex]
  46859. }
  46860. , function(e, t) {
  46861. this.resolvedProperty.toArray(e, t)
  46862. }
  46863. ],
  46864. SetterByBindingTypeAndVersioning: [[function(e, t) {
  46865. this.node[this.propertyName] = e[t]
  46866. }
  46867. , function(e, t) {
  46868. this.node[this.propertyName] = e[t],
  46869. this.targetObject.needsUpdate = !0
  46870. }
  46871. , function(e, t) {
  46872. this.node[this.propertyName] = e[t],
  46873. this.targetObject.matrixWorldNeedsUpdate = !0
  46874. }
  46875. ], [function(e, t) {
  46876. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  46877. i[n] = e[t++]
  46878. }
  46879. , function(e, t) {
  46880. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  46881. i[n] = e[t++];
  46882. this.targetObject.needsUpdate = !0
  46883. }
  46884. , function(e, t) {
  46885. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  46886. i[n] = e[t++];
  46887. this.targetObject.matrixWorldNeedsUpdate = !0
  46888. }
  46889. ], [function(e, t) {
  46890. this.resolvedProperty[this.propertyIndex] = e[t]
  46891. }
  46892. , function(e, t) {
  46893. this.resolvedProperty[this.propertyIndex] = e[t],
  46894. this.targetObject.needsUpdate = !0
  46895. }
  46896. , function(e, t) {
  46897. this.resolvedProperty[this.propertyIndex] = e[t],
  46898. this.targetObject.matrixWorldNeedsUpdate = !0
  46899. }
  46900. ], [function(e, t) {
  46901. this.resolvedProperty.fromArray(e, t)
  46902. }
  46903. , function(e, t) {
  46904. this.resolvedProperty.fromArray(e, t),
  46905. this.targetObject.needsUpdate = !0
  46906. }
  46907. , function(e, t) {
  46908. this.resolvedProperty.fromArray(e, t),
  46909. this.targetObject.matrixWorldNeedsUpdate = !0
  46910. }
  46911. ]]
  46912. }),
  46913. n.PropertyBinding.Composite = function(e, t, i) {
  46914. var r = i || n.PropertyBinding.parseTrackName(t);
  46915. this._targetGroup = e,
  46916. this._bindings = e.subscribe_(t, r)
  46917. }
  46918. ,
  46919. n.PropertyBinding.Composite.prototype = {
  46920. constructor: n.PropertyBinding.Composite,
  46921. getValue: function(e, t) {
  46922. this.bind();
  46923. var i = this._targetGroup.nCachedObjects_
  46924. , n = this._bindings[i];
  46925. void 0 !== n && n.getValue(e, t)
  46926. },
  46927. setValue: function(e, t) {
  46928. for (var i = this._bindings, n = this._targetGroup.nCachedObjects_, r = i.length; n !== r; ++n)
  46929. i[n].setValue(e, t)
  46930. },
  46931. bind: function() {
  46932. for (var e = this._bindings, t = this._targetGroup.nCachedObjects_, i = e.length; t !== i; ++t)
  46933. e[t].bind()
  46934. },
  46935. unbind: function() {
  46936. for (var e = this._bindings, t = this._targetGroup.nCachedObjects_, i = e.length; t !== i; ++t)
  46937. e[t].unbind()
  46938. }
  46939. },
  46940. n.PropertyBinding.create = function(e, t, i) {
  46941. return e instanceof n.AnimationObjectGroup ? new n.PropertyBinding.Composite(e,t,i) : new n.PropertyBinding(e,t,i)
  46942. }
  46943. ,
  46944. n.PropertyBinding.parseTrackName = function(e) {
  46945. var t = /^(([\w]+\/)*)([\w-\d]+)?(\.([\w]+)(\[([\w\d\[\]\_.:\- ]+)\])?)?(\.([\w.]+)(\[([\w\d\[\]\_. ]+)\])?)$/
  46946. , i = t.exec(e);
  46947. if (!i)
  46948. throw new Error("cannot parse trackName at all: " + e);
  46949. i.index === t.lastIndex && t.lastIndex++;
  46950. var n = {
  46951. nodeName: i[3],
  46952. objectName: i[5],
  46953. objectIndex: i[7],
  46954. propertyName: i[9],
  46955. propertyIndex: i[11]
  46956. };
  46957. if (null === n.propertyName || 0 === n.propertyName.length)
  46958. throw new Error("can not parse propertyName from trackName: " + e);
  46959. return n
  46960. }
  46961. ,
  46962. n.PropertyBinding.findNode = function(e, t) {
  46963. if (!t || "" === t || "root" === t || "." === t || t === -1 || t === e.name || t === e.uuid)
  46964. return e;
  46965. if (e.skeleton) {
  46966. var i = function(e) {
  46967. for (var i = 0; i < e.bones.length; i++) {
  46968. var n = e.bones[i];
  46969. if (n.name === t)
  46970. return n
  46971. }
  46972. return null
  46973. }
  46974. , n = i(e.skeleton);
  46975. if (n)
  46976. return n
  46977. }
  46978. if (e.children) {
  46979. var r = function(e) {
  46980. for (var i = 0; i < e.length; i++) {
  46981. var n = e[i];
  46982. if (n.name === t || n.uuid === t)
  46983. return n;
  46984. var o = r(n.children);
  46985. if (o)
  46986. return o
  46987. }
  46988. return null
  46989. }
  46990. , o = r(e.children);
  46991. if (o)
  46992. return o
  46993. }
  46994. return null
  46995. }
  46996. ,
  46997. n.PropertyMixer = function(e, t, i) {
  46998. this.binding = e,
  46999. this.valueSize = i;
  47000. var n, r = Float64Array;
  47001. switch (t) {
  47002. case "quaternion":
  47003. n = this._slerp;
  47004. break;
  47005. case "string":
  47006. case "bool":
  47007. r = Array,
  47008. n = this._select;
  47009. break;
  47010. default:
  47011. n = this._lerp
  47012. }
  47013. this.buffer = new r(4 * i),
  47014. this._mixBufferRegion = n,
  47015. this.cumulativeWeight = 0,
  47016. this.useCount = 0,
  47017. this.referenceCount = 0
  47018. }
  47019. ,
  47020. n.PropertyMixer.prototype = {
  47021. constructor: n.PropertyMixer,
  47022. accumulate: function(e, t) {
  47023. var i = this.buffer
  47024. , n = this.valueSize
  47025. , r = e * n + n
  47026. , o = this.cumulativeWeight;
  47027. if (0 === o) {
  47028. for (var a = 0; a !== n; ++a)
  47029. i[r + a] = i[a];
  47030. o = t
  47031. } else {
  47032. o += t;
  47033. var s = t / o;
  47034. this._mixBufferRegion(i, r, 0, s, n)
  47035. }
  47036. this.cumulativeWeight = o
  47037. },
  47038. apply: function(e) {
  47039. var t = this.valueSize
  47040. , i = this.buffer
  47041. , n = e * t + t
  47042. , r = this.cumulativeWeight
  47043. , o = this.binding;
  47044. if (this.cumulativeWeight = 0,
  47045. r < 1) {
  47046. var a = 3 * t;
  47047. this._mixBufferRegion(i, n, a, 1 - r, t)
  47048. }
  47049. for (var s = t, l = t + t; s !== l; ++s)
  47050. if (i[s] !== i[s + t]) {
  47051. o.setValue(i, n);
  47052. break
  47053. }
  47054. },
  47055. saveOriginalState: function() {
  47056. var e = this.binding
  47057. , t = this.buffer
  47058. , i = this.valueSize
  47059. , n = 3 * i;
  47060. e.getValue(t, n);
  47061. for (var r = i, o = n; r !== o; ++r)
  47062. t[r] = t[n + r % i];
  47063. this.cumulativeWeight = 0
  47064. },
  47065. restoreOriginalState: function() {
  47066. var e = 3 * this.valueSize;
  47067. this.binding.setValue(this.buffer, e)
  47068. },
  47069. _select: function(e, t, i, n, r) {
  47070. if (n >= .5)
  47071. for (var o = 0; o !== r; ++o)
  47072. e[t + o] = e[i + o]
  47073. },
  47074. _slerp: function(e, t, i, r, o) {
  47075. n.Quaternion.slerpFlat(e, t, e, t, e, i, r)
  47076. },
  47077. _lerp: function(e, t, i, n, r) {
  47078. for (var o = 1 - n, a = 0; a !== r; ++a) {
  47079. var s = t + a;
  47080. e[s] = e[s] * o + e[i + a] * n
  47081. }
  47082. }
  47083. },
  47084. n.BooleanKeyframeTrack = function(e, t, i) {
  47085. n.KeyframeTrack.call(this, e, t, i)
  47086. }
  47087. ,
  47088. n.BooleanKeyframeTrack.prototype = Object.assign(Object.create(n.KeyframeTrack.prototype), {
  47089. constructor: n.BooleanKeyframeTrack,
  47090. ValueTypeName: "bool",
  47091. ValueBufferType: Array,
  47092. DefaultInterpolation: n.IntepolateDiscrete,
  47093. InterpolantFactoryMethodLinear: void 0,
  47094. InterpolantFactoryMethodSmooth: void 0
  47095. }),
  47096. n.NumberKeyframeTrack = function(e, t, i, r) {
  47097. n.KeyframeTrack.call(this, e, t, i, r)
  47098. }
  47099. ,
  47100. n.NumberKeyframeTrack.prototype = Object.assign(Object.create(n.KeyframeTrack.prototype), {
  47101. constructor: n.NumberKeyframeTrack,
  47102. ValueTypeName: "number"
  47103. }),
  47104. n.QuaternionKeyframeTrack = function(e, t, i, r) {
  47105. n.KeyframeTrack.call(this, e, t, i, r)
  47106. }
  47107. ,
  47108. n.QuaternionKeyframeTrack.prototype = Object.assign(Object.create(n.KeyframeTrack.prototype), {
  47109. constructor: n.QuaternionKeyframeTrack,
  47110. ValueTypeName: "quaternion",
  47111. DefaultInterpolation: n.InterpolateLinear,
  47112. InterpolantFactoryMethodLinear: function(e) {
  47113. return new n.QuaternionLinearInterpolant(this.times,this.values,this.getValueSize(),e)
  47114. },
  47115. InterpolantFactoryMethodSmooth: void 0
  47116. }),
  47117. n.StringKeyframeTrack = function(e, t, i, r) {
  47118. n.KeyframeTrack.call(this, e, t, i, r)
  47119. }
  47120. ,
  47121. n.StringKeyframeTrack.prototype = Object.assign(Object.create(n.KeyframeTrack.prototype), {
  47122. constructor: n.StringKeyframeTrack,
  47123. ValueTypeName: "string",
  47124. ValueBufferType: Array,
  47125. DefaultInterpolation: n.IntepolateDiscrete,
  47126. InterpolantFactoryMethodLinear: void 0,
  47127. InterpolantFactoryMethodSmooth: void 0
  47128. }),
  47129. n.VectorKeyframeTrack = function(e, t, i, r) {
  47130. n.KeyframeTrack.call(this, e, t, i, r)
  47131. }
  47132. ,
  47133. n.VectorKeyframeTrack.prototype = Object.assign(Object.create(n.KeyframeTrack.prototype), {
  47134. constructor: n.VectorKeyframeTrack,
  47135. ValueTypeName: "vector"
  47136. }),
  47137. n.Audio = function(e) {
  47138. n.Object3D.call(this),
  47139. this.type = "Audio",
  47140. this.context = e.context,
  47141. this.source = this.context.createBufferSource(),
  47142. this.source.onended = this.onEnded.bind(this),
  47143. this.gain = this.context.createGain(),
  47144. this.gain.connect(e.getInput()),
  47145. this.autoplay = !1,
  47146. this.startTime = 0,
  47147. this.playbackRate = 1,
  47148. this.isPlaying = !1,
  47149. this.hasPlaybackControl = !0,
  47150. this.sourceType = "empty",
  47151. this.filter = null
  47152. }
  47153. ,
  47154. n.Audio.prototype = Object.create(n.Object3D.prototype),
  47155. n.Audio.prototype.constructor = n.Audio,
  47156. n.Audio.prototype.getOutput = function() {
  47157. return this.gain
  47158. }
  47159. ,
  47160. n.Audio.prototype.load = function(e) {
  47161. var t = new n.AudioBuffer(this.context);
  47162. return t.load(e),
  47163. this.setBuffer(t),
  47164. this
  47165. }
  47166. ,
  47167. n.Audio.prototype.setNodeSource = function(e) {
  47168. return this.hasPlaybackControl = !1,
  47169. this.sourceType = "audioNode",
  47170. this.source = e,
  47171. this.connect(),
  47172. this
  47173. }
  47174. ,
  47175. n.Audio.prototype.setBuffer = function(e) {
  47176. var t = this;
  47177. return e.onReady(function(e) {
  47178. t.source.buffer = e,
  47179. t.sourceType = "buffer",
  47180. t.autoplay && t.play()
  47181. }),
  47182. this
  47183. }
  47184. ,
  47185. n.Audio.prototype.play = function() {
  47186. if (this.isPlaying === !0)
  47187. return void console.warn("THREE.Audio: Audio is already playing.");
  47188. if (this.hasPlaybackControl === !1)
  47189. return void console.warn("THREE.Audio: this Audio has no playback control.");
  47190. var e = this.context.createBufferSource();
  47191. e.buffer = this.source.buffer,
  47192. e.loop = this.source.loop,
  47193. e.onended = this.source.onended,
  47194. e.start(0, this.startTime),
  47195. e.playbackRate.value = this.playbackRate,
  47196. this.isPlaying = !0,
  47197. this.source = e,
  47198. this.connect()
  47199. }
  47200. ,
  47201. n.Audio.prototype.pause = function() {
  47202. return this.hasPlaybackControl === !1 ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.source.stop(),
  47203. void (this.startTime = this.context.currentTime))
  47204. }
  47205. ,
  47206. n.Audio.prototype.stop = function() {
  47207. return this.hasPlaybackControl === !1 ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.source.stop(),
  47208. void (this.startTime = 0))
  47209. }
  47210. ,
  47211. n.Audio.prototype.connect = function() {
  47212. null !== this.filter ? (this.source.connect(this.filter),
  47213. this.filter.connect(this.getOutput())) : this.source.connect(this.getOutput())
  47214. }
  47215. ,
  47216. n.Audio.prototype.disconnect = function() {
  47217. null !== this.filter ? (this.source.disconnect(this.filter),
  47218. this.filter.disconnect(this.getOutput())) : this.source.disconnect(this.getOutput())
  47219. }
  47220. ,
  47221. n.Audio.prototype.getFilter = function() {
  47222. return this.filter
  47223. }
  47224. ,
  47225. n.Audio.prototype.setFilter = function(e) {
  47226. void 0 === e && (e = null),
  47227. this.isPlaying === !0 ? (this.disconnect(),
  47228. this.filter = e,
  47229. this.connect()) : this.filter = e
  47230. }
  47231. ,
  47232. n.Audio.prototype.setPlaybackRate = function(e) {
  47233. return this.hasPlaybackControl === !1 ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.playbackRate = e,
  47234. void (this.isPlaying === !0 && (this.source.playbackRate.value = this.playbackRate)))
  47235. }
  47236. ,
  47237. n.Audio.prototype.getPlaybackRate = function() {
  47238. return this.playbackRate
  47239. }
  47240. ,
  47241. n.Audio.prototype.onEnded = function() {
  47242. this.isPlaying = !1
  47243. }
  47244. ,
  47245. n.Audio.prototype.setLoop = function(e) {
  47246. return this.hasPlaybackControl === !1 ? void console.warn("THREE.Audio: this Audio has no playback control.") : void (this.source.loop = e)
  47247. }
  47248. ,
  47249. n.Audio.prototype.getLoop = function() {
  47250. return this.hasPlaybackControl === !1 ? (console.warn("THREE.Audio: this Audio has no playback control."),
  47251. !1) : this.source.loop
  47252. }
  47253. ,
  47254. n.Audio.prototype.setVolume = function(e) {
  47255. this.gain.gain.value = e
  47256. }
  47257. ,
  47258. n.Audio.prototype.getVolume = function() {
  47259. return this.gain.gain.value
  47260. }
  47261. ,
  47262. n.AudioAnalyser = function(e, t) {
  47263. this.analyser = e.context.createAnalyser(),
  47264. this.analyser.fftSize = void 0 !== t ? t : 2048,
  47265. this.data = new Uint8Array(this.analyser.frequencyBinCount),
  47266. e.getOutput().connect(this.analyser)
  47267. }
  47268. ,
  47269. n.AudioAnalyser.prototype = {
  47270. constructor: n.AudioAnalyser,
  47271. getData: function() {
  47272. return this.analyser.getByteFrequencyData(this.data),
  47273. this.data
  47274. }
  47275. },
  47276. n.AudioBuffer = function(e) {
  47277. this.context = e,
  47278. this.ready = !1,
  47279. this.readyCallbacks = []
  47280. }
  47281. ,
  47282. n.AudioBuffer.prototype.load = function(e) {
  47283. var t = this
  47284. , i = new XMLHttpRequest;
  47285. return i.open("GET", e, !0),
  47286. i.responseType = "arraybuffer",
  47287. i.onload = function(e) {
  47288. t.context.decodeAudioData(this.response, function(e) {
  47289. t.buffer = e,
  47290. t.ready = !0;
  47291. for (var i = 0; i < t.readyCallbacks.length; i++)
  47292. t.readyCallbacks[i](t.buffer);
  47293. t.readyCallbacks = []
  47294. })
  47295. }
  47296. ,
  47297. i.send(),
  47298. this
  47299. }
  47300. ,
  47301. n.AudioBuffer.prototype.onReady = function(e) {
  47302. this.ready ? e(this.buffer) : this.readyCallbacks.push(e)
  47303. }
  47304. ,
  47305. n.PositionalAudio = function(e) {
  47306. n.Audio.call(this, e),
  47307. this.panner = this.context.createPanner(),
  47308. this.panner.connect(this.gain)
  47309. }
  47310. ,
  47311. n.PositionalAudio.prototype = Object.create(n.Audio.prototype),
  47312. n.PositionalAudio.prototype.constructor = n.PositionalAudio,
  47313. n.PositionalAudio.prototype.getOutput = function() {
  47314. return this.panner
  47315. }
  47316. ,
  47317. n.PositionalAudio.prototype.setRefDistance = function(e) {
  47318. this.panner.refDistance = e
  47319. }
  47320. ,
  47321. n.PositionalAudio.prototype.getRefDistance = function() {
  47322. return this.panner.refDistance
  47323. }
  47324. ,
  47325. n.PositionalAudio.prototype.setRolloffFactor = function(e) {
  47326. this.panner.rolloffFactor = e
  47327. }
  47328. ,
  47329. n.PositionalAudio.prototype.getRolloffFactor = function() {
  47330. return this.panner.rolloffFactor
  47331. }
  47332. ,
  47333. n.PositionalAudio.prototype.setDistanceModel = function(e) {
  47334. this.panner.distanceModel = e
  47335. }
  47336. ,
  47337. n.PositionalAudio.prototype.getDistanceModel = function() {
  47338. return this.panner.distanceModel
  47339. }
  47340. ,
  47341. n.PositionalAudio.prototype.setMaxDistance = function(e) {
  47342. this.panner.maxDistance = e
  47343. }
  47344. ,
  47345. n.PositionalAudio.prototype.getMaxDistance = function() {
  47346. return this.panner.maxDistance
  47347. }
  47348. ,
  47349. n.PositionalAudio.prototype.updateMatrixWorld = function() {
  47350. var e = new n.Vector3;
  47351. return function(t) {
  47352. n.Object3D.prototype.updateMatrixWorld.call(this, t),
  47353. e.setFromMatrixPosition(this.matrixWorld),
  47354. this.panner.setPosition(e.x, e.y, e.z)
  47355. }
  47356. }(),
  47357. n.AudioListener = function() {
  47358. n.Object3D.call(this),
  47359. this.type = "AudioListener",
  47360. this.context = new (window.AudioContext || window.webkitAudioContext),
  47361. this.gain = this.context.createGain(),
  47362. this.gain.connect(this.context.destination),
  47363. this.filter = null
  47364. }
  47365. ,
  47366. n.AudioListener.prototype = Object.create(n.Object3D.prototype),
  47367. n.AudioListener.prototype.constructor = n.AudioListener,
  47368. n.AudioListener.prototype.getInput = function() {
  47369. return this.gain
  47370. }
  47371. ,
  47372. n.AudioListener.prototype.removeFilter = function() {
  47373. null !== this.filter && (this.gain.disconnect(this.filter),
  47374. this.filter.disconnect(this.context.destination),
  47375. this.gain.connect(this.context.destination),
  47376. this.filter = null)
  47377. }
  47378. ,
  47379. n.AudioListener.prototype.setFilter = function(e) {
  47380. null !== this.filter ? (this.gain.disconnect(this.filter),
  47381. this.filter.disconnect(this.context.destination)) : this.gain.disconnect(this.context.destination),
  47382. this.filter = e,
  47383. this.gain.connect(this.filter),
  47384. this.filter.connect(this.context.destination)
  47385. }
  47386. ,
  47387. n.AudioListener.prototype.getFilter = function() {
  47388. return this.filter
  47389. }
  47390. ,
  47391. n.AudioListener.prototype.setMasterVolume = function(e) {
  47392. this.gain.gain.value = e
  47393. }
  47394. ,
  47395. n.AudioListener.prototype.getMasterVolume = function() {
  47396. return this.gain.gain.value
  47397. }
  47398. ,
  47399. n.AudioListener.prototype.updateMatrixWorld = function() {
  47400. var e = new n.Vector3
  47401. , t = new n.Quaternion
  47402. , i = new n.Vector3
  47403. , r = new n.Vector3;
  47404. return function(o) {
  47405. n.Object3D.prototype.updateMatrixWorld.call(this, o);
  47406. var a = this.context.listener
  47407. , s = this.up;
  47408. this.matrixWorld.decompose(e, t, i),
  47409. r.set(0, 0, -1).applyQuaternion(t),
  47410. a.setPosition(e.x, e.y, e.z),
  47411. a.setOrientation(r.x, r.y, r.z, s.x, s.y, s.z)
  47412. }
  47413. }(),
  47414. n.Camera = function() {
  47415. n.Object3D.call(this),
  47416. this.type = "Camera",
  47417. this.matrixWorldInverse = new n.Matrix4,
  47418. this.projectionMatrix = new n.Matrix4
  47419. }
  47420. ,
  47421. n.Camera.prototype = Object.create(n.Object3D.prototype),
  47422. n.Camera.prototype.constructor = n.Camera,
  47423. n.Camera.prototype.getWorldDirection = function() {
  47424. var e = new n.Quaternion;
  47425. return function(t) {
  47426. var i = t || new n.Vector3;
  47427. return this.getWorldQuaternion(e),
  47428. i.set(0, 0, -1).applyQuaternion(e)
  47429. }
  47430. }(),
  47431. n.Camera.prototype.lookAt = function() {
  47432. var e = new n.Matrix4;
  47433. return function(t) {
  47434. e.lookAt(this.position, t, this.up),
  47435. this.quaternion.setFromRotationMatrix(e)
  47436. }
  47437. }(),
  47438. n.Camera.prototype.clone = function() {
  47439. return (new this.constructor).copy(this)
  47440. }
  47441. ,
  47442. n.Camera.prototype.copy = function(e) {
  47443. return n.Object3D.prototype.copy.call(this, e),
  47444. this.matrixWorldInverse.copy(e.matrixWorldInverse),
  47445. this.projectionMatrix.copy(e.projectionMatrix),
  47446. this
  47447. }
  47448. ,
  47449. n.CubeCamera = function(e, t, i) {
  47450. n.Object3D.call(this),
  47451. this.type = "CubeCamera";
  47452. var r = 90
  47453. , o = 1
  47454. , a = new n.PerspectiveCamera(r,o,e,t);
  47455. a.up.set(0, -1, 0),
  47456. a.lookAt(new n.Vector3(1,0,0)),
  47457. this.add(a);
  47458. var s = new n.PerspectiveCamera(r,o,e,t);
  47459. s.up.set(0, -1, 0),
  47460. s.lookAt(new n.Vector3(-1,0,0)),
  47461. this.add(s);
  47462. var l = new n.PerspectiveCamera(r,o,e,t);
  47463. l.up.set(0, 0, 1),
  47464. l.lookAt(new n.Vector3(0,1,0)),
  47465. this.add(l);
  47466. var c = new n.PerspectiveCamera(r,o,e,t);
  47467. c.up.set(0, 0, -1),
  47468. c.lookAt(new n.Vector3(0,-1,0)),
  47469. this.add(c);
  47470. var h = new n.PerspectiveCamera(r,o,e,t);
  47471. h.up.set(0, -1, 0),
  47472. h.lookAt(new n.Vector3(0,0,1)),
  47473. this.add(h);
  47474. var u = new n.PerspectiveCamera(r,o,e,t);
  47475. u.up.set(0, -1, 0),
  47476. u.lookAt(new n.Vector3(0,0,-1)),
  47477. this.add(u);
  47478. var d = {
  47479. format: n.RGBFormat,
  47480. magFilter: n.LinearFilter,
  47481. minFilter: n.LinearFilter
  47482. };
  47483. this.renderTarget = new n.WebGLRenderTargetCube(i,i,d),
  47484. this.updateCubeMap = function(e, t) {
  47485. null === this.parent && this.updateMatrixWorld();
  47486. var i = this.renderTarget
  47487. , n = i.texture.generateMipmaps;
  47488. i.texture.generateMipmaps = !1,
  47489. i.activeCubeFace = 0,
  47490. e.render(t, a, i),
  47491. i.activeCubeFace = 1,
  47492. e.render(t, s, i),
  47493. i.activeCubeFace = 2,
  47494. e.render(t, l, i),
  47495. i.activeCubeFace = 3,
  47496. e.render(t, c, i),
  47497. i.activeCubeFace = 4,
  47498. e.render(t, h, i),
  47499. i.texture.generateMipmaps = n,
  47500. i.activeCubeFace = 5,
  47501. e.render(t, u, i),
  47502. e.setRenderTarget(null)
  47503. }
  47504. }
  47505. ,
  47506. n.CubeCamera.prototype = Object.create(n.Object3D.prototype),
  47507. n.CubeCamera.prototype.constructor = n.CubeCamera,
  47508. n.OrthographicCamera = function(e, t, i, r, o, a) {
  47509. n.Camera.call(this),
  47510. this.type = "OrthographicCamera",
  47511. this.zoom = 1,
  47512. this.left = e,
  47513. this.right = t,
  47514. this.top = i,
  47515. this.bottom = r,
  47516. this.near = void 0 !== o ? o : .1,
  47517. this.far = void 0 !== a ? a : 2e3,
  47518. this.updateProjectionMatrix()
  47519. }
  47520. ,
  47521. n.OrthographicCamera.prototype = Object.create(n.Camera.prototype),
  47522. n.OrthographicCamera.prototype.constructor = n.OrthographicCamera,
  47523. n.OrthographicCamera.prototype.updateProjectionMatrix = function() {
  47524. var e = (this.right - this.left) / (2 * this.zoom)
  47525. , t = (this.top - this.bottom) / (2 * this.zoom)
  47526. , i = (this.right + this.left) / 2
  47527. , n = (this.top + this.bottom) / 2;
  47528. this.projectionMatrix.makeOrthographic(i - e, i + e, n + t, n - t, this.near, this.far)
  47529. }
  47530. ,
  47531. n.OrthographicCamera.prototype.copy = function(e) {
  47532. return n.Camera.prototype.copy.call(this, e),
  47533. this.left = e.left,
  47534. this.right = e.right,
  47535. this.top = e.top,
  47536. this.bottom = e.bottom,
  47537. this.near = e.near,
  47538. this.far = e.far,
  47539. this.zoom = e.zoom,
  47540. this
  47541. }
  47542. ,
  47543. n.OrthographicCamera.prototype.toJSON = function(e) {
  47544. var t = n.Object3D.prototype.toJSON.call(this, e);
  47545. return t.object.zoom = this.zoom,
  47546. t.object.left = this.left,
  47547. t.object.right = this.right,
  47548. t.object.top = this.top,
  47549. t.object.bottom = this.bottom,
  47550. t.object.near = this.near,
  47551. t.object.far = this.far,
  47552. t
  47553. }
  47554. ,
  47555. n.PerspectiveCamera = function(e, t, i, r) {
  47556. n.Camera.call(this),
  47557. this.type = "PerspectiveCamera",
  47558. this.focalLength = 10,
  47559. this.zoom = 1,
  47560. this.fov = void 0 !== e ? e : 50,
  47561. this.aspect = void 0 !== t ? t : 1,
  47562. this.near = void 0 !== i ? i : .1,
  47563. this.far = void 0 !== r ? r : 2e3,
  47564. this.updateProjectionMatrix()
  47565. }
  47566. ,
  47567. n.PerspectiveCamera.prototype = Object.create(n.Camera.prototype),
  47568. n.PerspectiveCamera.prototype.constructor = n.PerspectiveCamera,
  47569. n.PerspectiveCamera.prototype.setLens = function(e, t) {
  47570. void 0 === t && (t = 24),
  47571. this.fov = 2 * n.Math.radToDeg(Math.atan(t / (2 * e))),
  47572. this.updateProjectionMatrix()
  47573. }
  47574. ,
  47575. n.PerspectiveCamera.prototype.setViewOffset = function(e, t, i, n, r, o) {
  47576. this.fullWidth = e,
  47577. this.fullHeight = t,
  47578. this.x = i,
  47579. this.y = n,
  47580. this.width = r,
  47581. this.height = o,
  47582. this.updateProjectionMatrix()
  47583. }
  47584. ,
  47585. n.PerspectiveCamera.prototype.updateProjectionMatrix = function() {
  47586. var e = n.Math.radToDeg(2 * Math.atan(Math.tan(.5 * n.Math.degToRad(this.fov)) / this.zoom));
  47587. if (this.fullWidth) {
  47588. var t = this.fullWidth / this.fullHeight
  47589. , i = Math.tan(n.Math.degToRad(.5 * e)) * this.near
  47590. , r = -i
  47591. , o = t * r
  47592. , a = t * i
  47593. , s = Math.abs(a - o)
  47594. , l = Math.abs(i - r);
  47595. 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)
  47596. } else
  47597. this.projectionMatrix.makePerspective(e, this.aspect, this.near, this.far)
  47598. }
  47599. ,
  47600. n.PerspectiveCamera.prototype.copy = function(e) {
  47601. return n.Camera.prototype.copy.call(this, e),
  47602. this.focalLength = e.focalLength,
  47603. this.zoom = e.zoom,
  47604. this.fov = e.fov,
  47605. this.aspect = e.aspect,
  47606. this.near = e.near,
  47607. this.far = e.far,
  47608. this
  47609. }
  47610. ,
  47611. n.PerspectiveCamera.prototype.toJSON = function(e) {
  47612. var t = n.Object3D.prototype.toJSON.call(this, e);
  47613. return t.object.focalLength = this.focalLength,
  47614. t.object.zoom = this.zoom,
  47615. t.object.fov = this.fov,
  47616. t.object.aspect = this.aspect,
  47617. t.object.near = this.near,
  47618. t.object.far = this.far,
  47619. t
  47620. }
  47621. ,
  47622. n.StereoCamera = function() {
  47623. this.type = "StereoCamera",
  47624. this.aspect = 1,
  47625. this.cameraL = new n.PerspectiveCamera,
  47626. this.cameraL.layers.enable(1),
  47627. this.cameraL.matrixAutoUpdate = !1,
  47628. this.cameraR = new n.PerspectiveCamera,
  47629. this.cameraR.layers.enable(2),
  47630. this.cameraR.matrixAutoUpdate = !1
  47631. }
  47632. ,
  47633. n.StereoCamera.prototype = {
  47634. constructor: n.StereoCamera,
  47635. update: function() {
  47636. var e, t, i, r, o, a = new n.Matrix4, s = new n.Matrix4;
  47637. return function(l) {
  47638. var c = e !== l.focalLength || t !== l.fov || i !== l.aspect * this.aspect || r !== l.near || o !== l.far;
  47639. if (c) {
  47640. e = l.focalLength,
  47641. t = l.fov,
  47642. i = l.aspect * this.aspect,
  47643. r = l.near,
  47644. o = l.far;
  47645. var h, u, d = l.projectionMatrix.clone(), p = .032, f = p * r / e, g = r * Math.tan(n.Math.degToRad(.5 * t));
  47646. s.elements[12] = -p,
  47647. a.elements[12] = p,
  47648. h = -g * i + f,
  47649. u = g * i + f,
  47650. d.elements[0] = 2 * r / (u - h),
  47651. d.elements[8] = (u + h) / (u - h),
  47652. this.cameraL.projectionMatrix.copy(d),
  47653. h = -g * i - f,
  47654. u = g * i - f,
  47655. d.elements[0] = 2 * r / (u - h),
  47656. d.elements[8] = (u + h) / (u - h),
  47657. this.cameraR.projectionMatrix.copy(d)
  47658. }
  47659. this.cameraL.matrixWorld.copy(l.matrixWorld).multiply(s),
  47660. this.cameraR.matrixWorld.copy(l.matrixWorld).multiply(a)
  47661. }
  47662. }()
  47663. },
  47664. n.Light = function(e, t) {
  47665. n.Object3D.call(this),
  47666. this.type = "Light",
  47667. this.color = new n.Color(e),
  47668. this.intensity = void 0 !== t ? t : 1,
  47669. this.receiveShadow = void 0
  47670. }
  47671. ,
  47672. n.Light.prototype = Object.create(n.Object3D.prototype),
  47673. n.Light.prototype.constructor = n.Light,
  47674. n.Light.prototype.copy = function(e) {
  47675. return n.Object3D.prototype.copy.call(this, e),
  47676. this.color.copy(e.color),
  47677. this.intensity = e.intensity,
  47678. this
  47679. }
  47680. ,
  47681. n.Light.prototype.toJSON = function(e) {
  47682. var t = n.Object3D.prototype.toJSON.call(this, e);
  47683. return t.object.color = this.color.getHex(),
  47684. t.object.intensity = this.intensity,
  47685. void 0 !== this.groundColor && (t.object.groundColor = this.groundColor.getHex()),
  47686. void 0 !== this.distance && (t.object.distance = this.distance),
  47687. void 0 !== this.angle && (t.object.angle = this.angle),
  47688. void 0 !== this.decay && (t.object.decay = this.decay),
  47689. void 0 !== this.penumbra && (t.object.penumbra = this.penumbra),
  47690. t
  47691. }
  47692. ,
  47693. n.LightShadow = function(e) {
  47694. this.camera = e,
  47695. this.bias = 0,
  47696. this.radius = 1,
  47697. this.mapSize = new n.Vector2(512,512),
  47698. this.map = null,
  47699. this.matrix = new n.Matrix4
  47700. }
  47701. ,
  47702. n.LightShadow.prototype = {
  47703. constructor: n.LightShadow,
  47704. copy: function(e) {
  47705. return this.camera = e.camera.clone(),
  47706. this.bias = e.bias,
  47707. this.radius = e.radius,
  47708. this.mapSize.copy(e.mapSize),
  47709. this
  47710. },
  47711. clone: function() {
  47712. return (new this.constructor).copy(this)
  47713. }
  47714. },
  47715. n.AmbientLight = function(e, t) {
  47716. n.Light.call(this, e, t),
  47717. this.type = "AmbientLight",
  47718. this.castShadow = void 0
  47719. }
  47720. ,
  47721. n.AmbientLight.prototype = Object.create(n.Light.prototype),
  47722. n.AmbientLight.prototype.constructor = n.AmbientLight,
  47723. n.DirectionalLight = function(e, t) {
  47724. n.Light.call(this, e, t),
  47725. this.type = "DirectionalLight",
  47726. this.position.set(0, 1, 0),
  47727. this.updateMatrix(),
  47728. this.target = new n.Object3D,
  47729. this.shadow = new n.LightShadow(new n.OrthographicCamera(-5,5,5,-5,.5,500))
  47730. }
  47731. ,
  47732. n.DirectionalLight.prototype = Object.create(n.Light.prototype),
  47733. n.DirectionalLight.prototype.constructor = n.DirectionalLight,
  47734. n.DirectionalLight.prototype.copy = function(e) {
  47735. return n.Light.prototype.copy.call(this, e),
  47736. this.target = e.target.clone(),
  47737. this.shadow = e.shadow.clone(),
  47738. this
  47739. }
  47740. ,
  47741. n.HemisphereLight = function(e, t, i) {
  47742. n.Light.call(this, e, i),
  47743. this.type = "HemisphereLight",
  47744. this.castShadow = void 0,
  47745. this.position.set(0, 1, 0),
  47746. this.updateMatrix(),
  47747. this.groundColor = new n.Color(t)
  47748. }
  47749. ,
  47750. n.HemisphereLight.prototype = Object.create(n.Light.prototype),
  47751. n.HemisphereLight.prototype.constructor = n.HemisphereLight,
  47752. n.HemisphereLight.prototype.copy = function(e) {
  47753. return n.Light.prototype.copy.call(this, e),
  47754. this.groundColor.copy(e.groundColor),
  47755. this
  47756. }
  47757. ,
  47758. n.PointLight = function(e, t, i, r) {
  47759. n.Light.call(this, e, t),
  47760. this.type = "PointLight",
  47761. this.distance = void 0 !== i ? i : 0,
  47762. this.decay = void 0 !== r ? r : 1,
  47763. this.shadow = new n.LightShadow(new n.PerspectiveCamera(90,1,.5,500))
  47764. }
  47765. ,
  47766. n.PointLight.prototype = Object.create(n.Light.prototype),
  47767. n.PointLight.prototype.constructor = n.PointLight,
  47768. Object.defineProperty(n.PointLight.prototype, "power", {
  47769. get: function() {
  47770. return 4 * this.intensity * Math.PI
  47771. },
  47772. set: function(e) {
  47773. this.intensity = e / (4 * Math.PI)
  47774. }
  47775. }),
  47776. n.PointLight.prototype.copy = function(e) {
  47777. return n.Light.prototype.copy.call(this, e),
  47778. this.distance = e.distance,
  47779. this.decay = e.decay,
  47780. this.shadow = e.shadow.clone(),
  47781. this
  47782. }
  47783. ,
  47784. n.SpotLight = function(e, t, i, r, o, a) {
  47785. n.Light.call(this, e, t),
  47786. this.type = "SpotLight",
  47787. this.position.set(0, 1, 0),
  47788. this.updateMatrix(),
  47789. this.target = new n.Object3D,
  47790. this.distance = void 0 !== i ? i : 0,
  47791. this.angle = void 0 !== r ? r : Math.PI / 3,
  47792. this.penumbra = void 0 !== o ? o : 0,
  47793. this.decay = void 0 !== a ? a : 1,
  47794. this.shadow = new n.LightShadow(new n.PerspectiveCamera(50,1,.5,500))
  47795. }
  47796. ,
  47797. n.SpotLight.prototype = Object.create(n.Light.prototype),
  47798. n.SpotLight.prototype.constructor = n.SpotLight,
  47799. Object.defineProperty(n.SpotLight.prototype, "power", {
  47800. get: function() {
  47801. return this.intensity * Math.PI
  47802. },
  47803. set: function(e) {
  47804. this.intensity = e / Math.PI
  47805. }
  47806. }),
  47807. n.SpotLight.prototype.copy = function(e) {
  47808. return n.Light.prototype.copy.call(this, e),
  47809. this.distance = e.distance,
  47810. this.angle = e.angle,
  47811. this.penumbra = e.penumbra,
  47812. this.decay = e.decay,
  47813. this.target = e.target.clone(),
  47814. this.shadow = e.shadow.clone(),
  47815. this
  47816. }
  47817. ,
  47818. n.Cache = {
  47819. enabled: !1,
  47820. files: {},
  47821. add: function(e, t) {
  47822. this.enabled !== !1 && (this.files[e] = t)
  47823. },
  47824. get: function(e) {
  47825. if (this.enabled !== !1)
  47826. return this.files[e]
  47827. },
  47828. remove: function(e) {
  47829. delete this.files[e]
  47830. },
  47831. clear: function() {
  47832. this.files = {}
  47833. }
  47834. },
  47835. n.Loader = function() {
  47836. this.onLoadStart = function() {}
  47837. ,
  47838. this.onLoadProgress = function() {}
  47839. ,
  47840. this.onLoadComplete = function() {}
  47841. }
  47842. ,
  47843. n.Loader.prototype = {
  47844. constructor: n.Loader,
  47845. crossOrigin: void 0,
  47846. extractUrlBase: function(e) {
  47847. var t = e.split("/");
  47848. return 1 === t.length ? "./" : (t.pop(),
  47849. t.join("/") + "/")
  47850. },
  47851. initMaterials: function(e, t, i) {
  47852. for (var n = [], r = 0; r < e.length; ++r)
  47853. n[r] = this.createMaterial(e[r], t, i);
  47854. return n
  47855. },
  47856. createMaterial: function() {
  47857. var e, t, i;
  47858. return function(r, o, a) {
  47859. function s(e, i, r, s, c) {
  47860. var h, u = o + e, d = n.Loader.Handlers.get(u);
  47861. null !== d ? h = d.load(u) : (t.setCrossOrigin(a),
  47862. h = t.load(u)),
  47863. void 0 !== i && (h.repeat.fromArray(i),
  47864. 1 !== i[0] && (h.wrapS = n.RepeatWrapping),
  47865. 1 !== i[1] && (h.wrapT = n.RepeatWrapping)),
  47866. void 0 !== r && h.offset.fromArray(r),
  47867. void 0 !== s && ("repeat" === s[0] && (h.wrapS = n.RepeatWrapping),
  47868. "mirror" === s[0] && (h.wrapS = n.MirroredRepeatWrapping),
  47869. "repeat" === s[1] && (h.wrapT = n.RepeatWrapping),
  47870. "mirror" === s[1] && (h.wrapT = n.MirroredRepeatWrapping)),
  47871. void 0 !== c && (h.anisotropy = c);
  47872. var p = n.Math.generateUUID();
  47873. return l[p] = h,
  47874. p
  47875. }
  47876. void 0 === e && (e = new n.Color),
  47877. void 0 === t && (t = new n.TextureLoader),
  47878. void 0 === i && (i = new n.MaterialLoader);
  47879. var l = {}
  47880. , c = {
  47881. uuid: n.Math.generateUUID(),
  47882. type: "MeshLambertMaterial"
  47883. };
  47884. for (var h in r) {
  47885. var u = r[h];
  47886. switch (h) {
  47887. case "DbgColor":
  47888. case "DbgIndex":
  47889. case "opticalDensity":
  47890. case "illumination":
  47891. break;
  47892. case "DbgName":
  47893. c.name = u;
  47894. break;
  47895. case "blending":
  47896. c.blending = n[u];
  47897. break;
  47898. case "colorAmbient":
  47899. case "mapAmbient":
  47900. console.warn("THREE.Loader.createMaterial:", h, "is no longer supported.");
  47901. break;
  47902. case "colorDiffuse":
  47903. c.color = e.fromArray(u).getHex();
  47904. break;
  47905. case "colorSpecular":
  47906. c.specular = e.fromArray(u).getHex();
  47907. break;
  47908. case "colorEmissive":
  47909. c.emissive = e.fromArray(u).getHex();
  47910. break;
  47911. case "specularCoef":
  47912. c.shininess = u;
  47913. break;
  47914. case "shading":
  47915. "basic" === u.toLowerCase() && (c.type = "MeshBasicMaterial"),
  47916. "phong" === u.toLowerCase() && (c.type = "MeshPhongMaterial");
  47917. break;
  47918. case "mapDiffuse":
  47919. c.map = s(u, r.mapDiffuseRepeat, r.mapDiffuseOffset, r.mapDiffuseWrap, r.mapDiffuseAnisotropy);
  47920. break;
  47921. case "mapDiffuseRepeat":
  47922. case "mapDiffuseOffset":
  47923. case "mapDiffuseWrap":
  47924. case "mapDiffuseAnisotropy":
  47925. break;
  47926. case "mapLight":
  47927. c.lightMap = s(u, r.mapLightRepeat, r.mapLightOffset, r.mapLightWrap, r.mapLightAnisotropy);
  47928. break;
  47929. case "mapLightRepeat":
  47930. case "mapLightOffset":
  47931. case "mapLightWrap":
  47932. case "mapLightAnisotropy":
  47933. break;
  47934. case "mapAO":
  47935. c.aoMap = s(u, r.mapAORepeat, r.mapAOOffset, r.mapAOWrap, r.mapAOAnisotropy);
  47936. break;
  47937. case "mapAORepeat":
  47938. case "mapAOOffset":
  47939. case "mapAOWrap":
  47940. case "mapAOAnisotropy":
  47941. break;
  47942. case "mapBump":
  47943. c.bumpMap = s(u, r.mapBumpRepeat, r.mapBumpOffset, r.mapBumpWrap, r.mapBumpAnisotropy);
  47944. break;
  47945. case "mapBumpScale":
  47946. c.bumpScale = u;
  47947. break;
  47948. case "mapBumpRepeat":
  47949. case "mapBumpOffset":
  47950. case "mapBumpWrap":
  47951. case "mapBumpAnisotropy":
  47952. break;
  47953. case "mapNormal":
  47954. c.normalMap = s(u, r.mapNormalRepeat, r.mapNormalOffset, r.mapNormalWrap, r.mapNormalAnisotropy);
  47955. break;
  47956. case "mapNormalFactor":
  47957. c.normalScale = [u, u];
  47958. break;
  47959. case "mapNormalRepeat":
  47960. case "mapNormalOffset":
  47961. case "mapNormalWrap":
  47962. case "mapNormalAnisotropy":
  47963. break;
  47964. case "mapSpecular":
  47965. c.specularMap = s(u, r.mapSpecularRepeat, r.mapSpecularOffset, r.mapSpecularWrap, r.mapSpecularAnisotropy);
  47966. break;
  47967. case "mapSpecularRepeat":
  47968. case "mapSpecularOffset":
  47969. case "mapSpecularWrap":
  47970. case "mapSpecularAnisotropy":
  47971. break;
  47972. case "mapAlpha":
  47973. c.alphaMap = s(u, r.mapAlphaRepeat, r.mapAlphaOffset, r.mapAlphaWrap, r.mapAlphaAnisotropy);
  47974. break;
  47975. case "mapAlphaRepeat":
  47976. case "mapAlphaOffset":
  47977. case "mapAlphaWrap":
  47978. case "mapAlphaAnisotropy":
  47979. break;
  47980. case "flipSided":
  47981. c.side = n.BackSide;
  47982. break;
  47983. case "doubleSided":
  47984. c.side = n.DoubleSide;
  47985. break;
  47986. case "transparency":
  47987. console.warn("THREE.Loader.createMaterial: transparency has been renamed to opacity"),
  47988. c.opacity = u;
  47989. break;
  47990. case "depthTest":
  47991. case "depthWrite":
  47992. case "colorWrite":
  47993. case "opacity":
  47994. case "reflectivity":
  47995. case "transparent":
  47996. case "visible":
  47997. case "wireframe":
  47998. c[h] = u;
  47999. break;
  48000. case "vertexColors":
  48001. u === !0 && (c.vertexColors = n.VertexColors),
  48002. "face" === u && (c.vertexColors = n.FaceColors);
  48003. break;
  48004. default:
  48005. console.error("THREE.Loader.createMaterial: Unsupported", h, u)
  48006. }
  48007. }
  48008. return "MeshBasicMaterial" === c.type && delete c.emissive,
  48009. "MeshPhongMaterial" !== c.type && delete c.specular,
  48010. c.opacity < 1 && (c.transparent = !0),
  48011. i.setTextures(l),
  48012. i.parse(c)
  48013. }
  48014. }()
  48015. },
  48016. n.Loader.Handlers = {
  48017. handlers: [],
  48018. add: function(e, t) {
  48019. this.handlers.push(e, t)
  48020. },
  48021. get: function(e) {
  48022. for (var t = this.handlers, i = 0, n = t.length; i < n; i += 2) {
  48023. var r = t[i]
  48024. , o = t[i + 1];
  48025. if (r.test(e))
  48026. return o
  48027. }
  48028. return null
  48029. }
  48030. },
  48031. n.XHRLoader = function(e) {
  48032. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  48033. }
  48034. ,
  48035. n.XHRLoader.prototype = {
  48036. constructor: n.XHRLoader,
  48037. load: function(e, t, i, r) {
  48038. void 0 !== this.path && (e = this.path + e);
  48039. var o = this
  48040. , a = n.Cache.get(e);
  48041. if (void 0 !== a)
  48042. return t && setTimeout(function() {
  48043. t(a)
  48044. }, 0),
  48045. a;
  48046. var s = new XMLHttpRequest;
  48047. return s.overrideMimeType("text/plain"),
  48048. s.open("GET", e, !0),
  48049. s.addEventListener("load", function(i) {
  48050. var a = i.target.response;
  48051. n.Cache.add(e, a),
  48052. 200 === this.status ? (t && t(a),
  48053. o.manager.itemEnd(e)) : 0 === this.status ? (console.warn("THREE.XHRLoader: HTTP Status 0 received."),
  48054. t && t(a),
  48055. o.manager.itemEnd(e)) : (r && r(i),
  48056. o.manager.itemError(e))
  48057. }, !1),
  48058. void 0 !== i && s.addEventListener("progress", function(e) {
  48059. i(e)
  48060. }, !1),
  48061. s.addEventListener("error", function(t) {
  48062. r && r(t),
  48063. o.manager.itemError(e)
  48064. }, !1),
  48065. void 0 !== this.responseType && (s.responseType = this.responseType),
  48066. void 0 !== this.withCredentials && (s.withCredentials = this.withCredentials),
  48067. s.send(null),
  48068. o.manager.itemStart(e),
  48069. s
  48070. },
  48071. setPath: function(e) {
  48072. this.path = e
  48073. },
  48074. setResponseType: function(e) {
  48075. this.responseType = e
  48076. },
  48077. setWithCredentials: function(e) {
  48078. this.withCredentials = e
  48079. }
  48080. },
  48081. n.FontLoader = function(e) {
  48082. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  48083. }
  48084. ,
  48085. n.FontLoader.prototype = {
  48086. constructor: n.FontLoader,
  48087. load: function(e, t, i, r) {
  48088. var o = new n.XHRLoader(this.manager);
  48089. o.load(e, function(e) {
  48090. t(new n.Font(JSON.parse(e.substring(65, e.length - 2))))
  48091. }, i, r)
  48092. }
  48093. },
  48094. n.ImageLoader = function(e) {
  48095. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  48096. }
  48097. ,
  48098. n.ImageLoader.prototype = {
  48099. constructor: n.ImageLoader,
  48100. load: function(e, t, i, r) {
  48101. void 0 !== this.path && (e = this.path + e);
  48102. var o = this
  48103. , a = n.Cache.get(e);
  48104. if (void 0 !== a)
  48105. return o.manager.itemStart(e),
  48106. t ? setTimeout(function() {
  48107. t(a),
  48108. o.manager.itemEnd(e)
  48109. }, 0) : o.manager.itemEnd(e),
  48110. a;
  48111. var s = document.createElement("img");
  48112. return s.addEventListener("load", function(i) {
  48113. n.Cache.add(e, this),
  48114. t && t(this),
  48115. o.manager.itemEnd(e)
  48116. }, !1),
  48117. void 0 !== i && s.addEventListener("progress", function(e) {
  48118. i(e)
  48119. }, !1),
  48120. s.addEventListener("error", function(t) {
  48121. r && r(t),
  48122. o.manager.itemError(e)
  48123. }, !1),
  48124. void 0 !== this.crossOrigin && (s.crossOrigin = this.crossOrigin),
  48125. o.manager.itemStart(e),
  48126. s.src = e,
  48127. s
  48128. },
  48129. setCrossOrigin: function(e) {
  48130. this.crossOrigin = e
  48131. },
  48132. setPath: function(e) {
  48133. this.path = e
  48134. }
  48135. },
  48136. n.JSONLoader = function(e) {
  48137. "boolean" == typeof e && (console.warn("THREE.JSONLoader: showStatus parameter has been removed from constructor."),
  48138. e = void 0),
  48139. this.manager = void 0 !== e ? e : n.DefaultLoadingManager,
  48140. this.withCredentials = !1
  48141. }
  48142. ,
  48143. n.JSONLoader.prototype = {
  48144. constructor: n.JSONLoader,
  48145. get statusDomElement() {
  48146. return void 0 === this._statusDomElement && (this._statusDomElement = document.createElement("div")),
  48147. console.warn("THREE.JSONLoader: .statusDomElement has been removed."),
  48148. this._statusDomElement
  48149. },
  48150. load: function(e, t, i, r) {
  48151. var o = this
  48152. , a = this.texturePath && "string" == typeof this.texturePath ? this.texturePath : n.Loader.prototype.extractUrlBase(e)
  48153. , s = new n.XHRLoader(this.manager);
  48154. s.setWithCredentials(this.withCredentials),
  48155. s.load(e, function(i) {
  48156. var n = JSON.parse(i)
  48157. , r = n.metadata;
  48158. if (void 0 !== r) {
  48159. var s = r.type;
  48160. if (void 0 !== s) {
  48161. if ("object" === s.toLowerCase())
  48162. return void console.error("THREE.JSONLoader: " + e + " should be loaded with THREE.ObjectLoader instead.");
  48163. if ("scene" === s.toLowerCase())
  48164. return void console.error("THREE.JSONLoader: " + e + " should be loaded with THREE.SceneLoader instead.")
  48165. }
  48166. }
  48167. var l = o.parse(n, a);
  48168. t(l.geometry, l.materials)
  48169. }, i, r)
  48170. },
  48171. setTexturePath: function(e) {
  48172. this.texturePath = e
  48173. },
  48174. parse: function(e, t) {
  48175. function i(t) {
  48176. function i(e, t) {
  48177. return e & 1 << t
  48178. }
  48179. 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;
  48180. if (void 0 !== e.uvs) {
  48181. for (r = 0; r < e.uvs.length; r++)
  48182. e.uvs[r].length && B++;
  48183. for (r = 0; r < B; r++)
  48184. s.faceVertexUvs[r] = []
  48185. }
  48186. for (l = 0,
  48187. c = L.length; l < c; )
  48188. E = new n.Vector3,
  48189. E.x = L[l++] * t,
  48190. E.y = L[l++] * t,
  48191. E.z = L[l++] * t,
  48192. s.vertices.push(E);
  48193. for (l = 0,
  48194. c = O.length; l < c; )
  48195. if (f = O[l++],
  48196. g = i(f, 0),
  48197. m = i(f, 1),
  48198. v = i(f, 3),
  48199. A = i(f, 4),
  48200. y = i(f, 5),
  48201. C = i(f, 6),
  48202. I = i(f, 7),
  48203. g) {
  48204. if (w = new n.Face3,
  48205. w.a = O[l],
  48206. w.b = O[l + 1],
  48207. w.c = O[l + 3],
  48208. _ = new n.Face3,
  48209. _.a = O[l + 1],
  48210. _.b = O[l + 2],
  48211. _.c = O[l + 3],
  48212. l += 4,
  48213. m && (p = O[l++],
  48214. w.materialIndex = p,
  48215. _.materialIndex = p),
  48216. a = s.faces.length,
  48217. v)
  48218. for (r = 0; r < B; r++)
  48219. for (S = e.uvs[r],
  48220. s.faceVertexUvs[r][a] = [],
  48221. s.faceVertexUvs[r][a + 1] = [],
  48222. o = 0; o < 4; o++)
  48223. d = O[l++],
  48224. R = S[2 * d],
  48225. P = S[2 * d + 1],
  48226. M = new n.Vector2(R,P),
  48227. 2 !== o && s.faceVertexUvs[r][a].push(M),
  48228. 0 !== o && s.faceVertexUvs[r][a + 1].push(M);
  48229. if (A && (u = 3 * O[l++],
  48230. w.normal.set(D[u++], D[u++], D[u]),
  48231. _.normal.copy(w.normal)),
  48232. y)
  48233. for (r = 0; r < 4; r++)
  48234. u = 3 * O[l++],
  48235. x = new n.Vector3(D[u++],D[u++],D[u]),
  48236. 2 !== r && w.vertexNormals.push(x),
  48237. 0 !== r && _.vertexNormals.push(x);
  48238. if (C && (h = O[l++],
  48239. T = N[h],
  48240. w.color.setHex(T),
  48241. _.color.setHex(T)),
  48242. I)
  48243. for (r = 0; r < 4; r++)
  48244. h = O[l++],
  48245. T = N[h],
  48246. 2 !== r && w.vertexColors.push(new n.Color(T)),
  48247. 0 !== r && _.vertexColors.push(new n.Color(T));
  48248. s.faces.push(w),
  48249. s.faces.push(_)
  48250. } else {
  48251. if (b = new n.Face3,
  48252. b.a = O[l++],
  48253. b.b = O[l++],
  48254. b.c = O[l++],
  48255. m && (p = O[l++],
  48256. b.materialIndex = p),
  48257. a = s.faces.length,
  48258. v)
  48259. for (r = 0; r < B; r++)
  48260. for (S = e.uvs[r],
  48261. s.faceVertexUvs[r][a] = [],
  48262. o = 0; o < 3; o++)
  48263. d = O[l++],
  48264. R = S[2 * d],
  48265. P = S[2 * d + 1],
  48266. M = new n.Vector2(R,P),
  48267. s.faceVertexUvs[r][a].push(M);
  48268. if (A && (u = 3 * O[l++],
  48269. b.normal.set(D[u++], D[u++], D[u])),
  48270. y)
  48271. for (r = 0; r < 3; r++)
  48272. u = 3 * O[l++],
  48273. x = new n.Vector3(D[u++],D[u++],D[u]),
  48274. b.vertexNormals.push(x);
  48275. if (C && (h = O[l++],
  48276. b.color.setHex(N[h])),
  48277. I)
  48278. for (r = 0; r < 3; r++)
  48279. h = O[l++],
  48280. b.vertexColors.push(new n.Color(N[h]));
  48281. s.faces.push(b)
  48282. }
  48283. }
  48284. function r() {
  48285. var t = void 0 !== e.influencesPerVertex ? e.influencesPerVertex : 2;
  48286. if (e.skinWeights)
  48287. for (var i = 0, r = e.skinWeights.length; i < r; i += t) {
  48288. var o = e.skinWeights[i]
  48289. , a = t > 1 ? e.skinWeights[i + 1] : 0
  48290. , l = t > 2 ? e.skinWeights[i + 2] : 0
  48291. , c = t > 3 ? e.skinWeights[i + 3] : 0;
  48292. s.skinWeights.push(new n.Vector4(o,a,l,c))
  48293. }
  48294. if (e.skinIndices)
  48295. for (var i = 0, r = e.skinIndices.length; i < r; i += t) {
  48296. var h = e.skinIndices[i]
  48297. , u = t > 1 ? e.skinIndices[i + 1] : 0
  48298. , d = t > 2 ? e.skinIndices[i + 2] : 0
  48299. , p = t > 3 ? e.skinIndices[i + 3] : 0;
  48300. s.skinIndices.push(new n.Vector4(h,u,d,p))
  48301. }
  48302. s.bones = e.bones,
  48303. 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.")
  48304. }
  48305. function o(t) {
  48306. if (void 0 !== e.morphTargets)
  48307. for (var i = 0, r = e.morphTargets.length; i < r; i++) {
  48308. s.morphTargets[i] = {},
  48309. s.morphTargets[i].name = e.morphTargets[i].name,
  48310. s.morphTargets[i].vertices = [];
  48311. for (var o = s.morphTargets[i].vertices, a = e.morphTargets[i].vertices, l = 0, c = a.length; l < c; l += 3) {
  48312. var h = new n.Vector3;
  48313. h.x = a[l] * t,
  48314. h.y = a[l + 1] * t,
  48315. h.z = a[l + 2] * t,
  48316. o.push(h)
  48317. }
  48318. }
  48319. if (void 0 !== e.morphColors && e.morphColors.length > 0) {
  48320. console.warn('THREE.JSONLoader: "morphColors" no longer supported. Using them as face colors.');
  48321. for (var u = s.faces, d = e.morphColors[0].colors, i = 0, r = u.length; i < r; i++)
  48322. u[i].color.fromArray(d, 3 * i)
  48323. }
  48324. }
  48325. function a() {
  48326. var t = []
  48327. , i = [];
  48328. void 0 !== e.animation && i.push(e.animation),
  48329. void 0 !== e.animations && (e.animations.length ? i = i.concat(e.animations) : i.push(e.animations));
  48330. for (var r = 0; r < i.length; r++) {
  48331. var o = n.AnimationClip.parseAnimation(i[r], s.bones);
  48332. o && t.push(o)
  48333. }
  48334. if (s.morphTargets) {
  48335. var a = n.AnimationClip.CreateClipsFromMorphTargetSequences(s.morphTargets, 10);
  48336. t = t.concat(a)
  48337. }
  48338. t.length > 0 && (s.animations = t)
  48339. }
  48340. var s = new n.Geometry
  48341. , l = void 0 !== e.scale ? 1 / e.scale : 1;
  48342. if (i(l),
  48343. r(),
  48344. o(l),
  48345. a(),
  48346. s.computeFaceNormals(),
  48347. s.computeBoundingSphere(),
  48348. void 0 === e.materials || 0 === e.materials.length)
  48349. return {
  48350. geometry: s
  48351. };
  48352. var c = n.Loader.prototype.initMaterials(e.materials, t, this.crossOrigin);
  48353. return {
  48354. geometry: s,
  48355. materials: c
  48356. }
  48357. }
  48358. },
  48359. n.LoadingManager = function(e, t, i) {
  48360. var n = this
  48361. , r = !1
  48362. , o = 0
  48363. , a = 0;
  48364. this.onStart = void 0,
  48365. this.onLoad = e,
  48366. this.onProgress = t,
  48367. this.onError = i,
  48368. this.itemStart = function(e) {
  48369. a++,
  48370. r === !1 && void 0 !== n.onStart && n.onStart(e, o, a),
  48371. r = !0
  48372. }
  48373. ,
  48374. this.itemEnd = function(e) {
  48375. o++,
  48376. void 0 !== n.onProgress && n.onProgress(e, o, a),
  48377. o === a && (r = !1,
  48378. void 0 !== n.onLoad && n.onLoad())
  48379. }
  48380. ,
  48381. this.itemError = function(e) {
  48382. void 0 !== n.onError && n.onError(e)
  48383. }
  48384. }
  48385. ,
  48386. n.DefaultLoadingManager = new n.LoadingManager,
  48387. n.BufferGeometryLoader = function(e) {
  48388. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  48389. }
  48390. ,
  48391. n.BufferGeometryLoader.prototype = {
  48392. constructor: n.BufferGeometryLoader,
  48393. load: function(e, t, i, r) {
  48394. var o = this
  48395. , a = new n.XHRLoader(o.manager);
  48396. a.load(e, function(e) {
  48397. t(o.parse(JSON.parse(e)))
  48398. }, i, r)
  48399. },
  48400. parse: function(e) {
  48401. var t = new n.BufferGeometry
  48402. , i = e.data.index
  48403. , r = {
  48404. Int8Array: Int8Array,
  48405. Uint8Array: Uint8Array,
  48406. Uint8ClampedArray: Uint8ClampedArray,
  48407. Int16Array: Int16Array,
  48408. Uint16Array: Uint16Array,
  48409. Int32Array: Int32Array,
  48410. Uint32Array: Uint32Array,
  48411. Float32Array: Float32Array,
  48412. Float64Array: Float64Array
  48413. };
  48414. if (void 0 !== i) {
  48415. var o = new r[i.type](i.array);
  48416. t.setIndex(new n.BufferAttribute(o,1))
  48417. }
  48418. var a = e.data.attributes;
  48419. for (var s in a) {
  48420. var l = a[s]
  48421. , o = new r[l.type](l.array);
  48422. t.addAttribute(s, new n.BufferAttribute(o,l.itemSize))
  48423. }
  48424. var c = e.data.groups || e.data.drawcalls || e.data.offsets;
  48425. if (void 0 !== c)
  48426. for (var h = 0, u = c.length; h !== u; ++h) {
  48427. var d = c[h];
  48428. t.addGroup(d.start, d.count, d.materialIndex)
  48429. }
  48430. var p = e.data.boundingSphere;
  48431. if (void 0 !== p) {
  48432. var f = new n.Vector3;
  48433. void 0 !== p.center && f.fromArray(p.center),
  48434. t.boundingSphere = new n.Sphere(f,p.radius)
  48435. }
  48436. return t
  48437. }
  48438. },
  48439. n.MaterialLoader = function(e) {
  48440. this.manager = void 0 !== e ? e : n.DefaultLoadingManager,
  48441. this.textures = {}
  48442. }
  48443. ,
  48444. n.MaterialLoader.prototype = {
  48445. constructor: n.MaterialLoader,
  48446. load: function(e, t, i, r) {
  48447. var o = this
  48448. , a = new n.XHRLoader(o.manager);
  48449. a.load(e, function(e) {
  48450. t(o.parse(JSON.parse(e)))
  48451. }, i, r)
  48452. },
  48453. setTextures: function(e) {
  48454. this.textures = e
  48455. },
  48456. getTexture: function(e) {
  48457. var t = this.textures;
  48458. return void 0 === t[e] && console.warn("THREE.MaterialLoader: Undefined texture", e),
  48459. t[e]
  48460. },
  48461. parse: function(e) {
  48462. var t = new n[e.type];
  48463. if (void 0 !== e.uuid && (t.uuid = e.uuid),
  48464. void 0 !== e.name && (t.name = e.name),
  48465. void 0 !== e.color && t.color.setHex(e.color),
  48466. void 0 !== e.roughness && (t.roughness = e.roughness),
  48467. void 0 !== e.metalness && (t.metalness = e.metalness),
  48468. void 0 !== e.emissive && t.emissive.setHex(e.emissive),
  48469. void 0 !== e.specular && t.specular.setHex(e.specular),
  48470. void 0 !== e.shininess && (t.shininess = e.shininess),
  48471. void 0 !== e.uniforms && (t.uniforms = e.uniforms),
  48472. void 0 !== e.vertexShader && (t.vertexShader = e.vertexShader),
  48473. void 0 !== e.fragmentShader && (t.fragmentShader = e.fragmentShader),
  48474. void 0 !== e.vertexColors && (t.vertexColors = e.vertexColors),
  48475. void 0 !== e.shading && (t.shading = e.shading),
  48476. void 0 !== e.blending && (t.blending = e.blending),
  48477. void 0 !== e.side && (t.side = e.side),
  48478. void 0 !== e.opacity && (t.opacity = e.opacity),
  48479. void 0 !== e.transparent && (t.transparent = e.transparent),
  48480. void 0 !== e.alphaTest && (t.alphaTest = e.alphaTest),
  48481. void 0 !== e.depthTest && (t.depthTest = e.depthTest),
  48482. void 0 !== e.depthWrite && (t.depthWrite = e.depthWrite),
  48483. void 0 !== e.colorWrite && (t.colorWrite = e.colorWrite),
  48484. void 0 !== e.wireframe && (t.wireframe = e.wireframe),
  48485. void 0 !== e.wireframeLinewidth && (t.wireframeLinewidth = e.wireframeLinewidth),
  48486. void 0 !== e.size && (t.size = e.size),
  48487. void 0 !== e.sizeAttenuation && (t.sizeAttenuation = e.sizeAttenuation),
  48488. void 0 !== e.map && (t.map = this.getTexture(e.map)),
  48489. void 0 !== e.alphaMap && (t.alphaMap = this.getTexture(e.alphaMap),
  48490. t.transparent = !0),
  48491. void 0 !== e.bumpMap && (t.bumpMap = this.getTexture(e.bumpMap)),
  48492. void 0 !== e.bumpScale && (t.bumpScale = e.bumpScale),
  48493. void 0 !== e.normalMap && (t.normalMap = this.getTexture(e.normalMap)),
  48494. void 0 !== e.normalScale) {
  48495. var i = e.normalScale;
  48496. Array.isArray(i) === !1 && (i = [i, i]),
  48497. t.normalScale = (new n.Vector2).fromArray(i)
  48498. }
  48499. if (void 0 !== e.displacementMap && (t.displacementMap = this.getTexture(e.displacementMap)),
  48500. void 0 !== e.displacementScale && (t.displacementScale = e.displacementScale),
  48501. void 0 !== e.displacementBias && (t.displacementBias = e.displacementBias),
  48502. void 0 !== e.roughnessMap && (t.roughnessMap = this.getTexture(e.roughnessMap)),
  48503. void 0 !== e.metalnessMap && (t.metalnessMap = this.getTexture(e.metalnessMap)),
  48504. void 0 !== e.emissiveMap && (t.emissiveMap = this.getTexture(e.emissiveMap)),
  48505. void 0 !== e.emissiveIntensity && (t.emissiveIntensity = e.emissiveIntensity),
  48506. void 0 !== e.specularMap && (t.specularMap = this.getTexture(e.specularMap)),
  48507. void 0 !== e.envMap && (t.envMap = this.getTexture(e.envMap),
  48508. t.combine = n.MultiplyOperation),
  48509. e.reflectivity && (t.reflectivity = e.reflectivity),
  48510. void 0 !== e.lightMap && (t.lightMap = this.getTexture(e.lightMap)),
  48511. void 0 !== e.lightMapIntensity && (t.lightMapIntensity = e.lightMapIntensity),
  48512. void 0 !== e.aoMap && (t.aoMap = this.getTexture(e.aoMap)),
  48513. void 0 !== e.aoMapIntensity && (t.aoMapIntensity = e.aoMapIntensity),
  48514. void 0 !== e.materials)
  48515. for (var r = 0, o = e.materials.length; r < o; r++)
  48516. t.materials.push(this.parse(e.materials[r]));
  48517. return t
  48518. }
  48519. },
  48520. n.ObjectLoader = function(e) {
  48521. this.manager = void 0 !== e ? e : n.DefaultLoadingManager,
  48522. this.texturePath = ""
  48523. }
  48524. ,
  48525. n.ObjectLoader.prototype = {
  48526. constructor: n.ObjectLoader,
  48527. load: function(e, t, i, r) {
  48528. "" === this.texturePath && (this.texturePath = e.substring(0, e.lastIndexOf("/") + 1));
  48529. var o = this
  48530. , a = new n.XHRLoader(o.manager);
  48531. a.load(e, function(e) {
  48532. o.parse(JSON.parse(e), t)
  48533. }, i, r)
  48534. },
  48535. setTexturePath: function(e) {
  48536. this.texturePath = e
  48537. },
  48538. setCrossOrigin: function(e) {
  48539. this.crossOrigin = e
  48540. },
  48541. parse: function(e, t) {
  48542. var i = this.parseGeometries(e.geometries)
  48543. , n = this.parseImages(e.images, function() {
  48544. void 0 !== t && t(a)
  48545. })
  48546. , r = this.parseTextures(e.textures, n)
  48547. , o = this.parseMaterials(e.materials, r)
  48548. , a = this.parseObject(e.object, i, o);
  48549. return e.animations && (a.animations = this.parseAnimations(e.animations)),
  48550. void 0 !== e.images && 0 !== e.images.length || void 0 !== t && t(a),
  48551. a
  48552. },
  48553. parseGeometries: function(e) {
  48554. var t = {};
  48555. if (void 0 !== e)
  48556. for (var i = new n.JSONLoader, r = new n.BufferGeometryLoader, o = 0, a = e.length; o < a; o++) {
  48557. var s, l = e[o];
  48558. switch (l.type) {
  48559. case "PlaneGeometry":
  48560. case "PlaneBufferGeometry":
  48561. s = new n[l.type](l.width,l.height,l.widthSegments,l.heightSegments);
  48562. break;
  48563. case "BoxGeometry":
  48564. case "BoxBufferGeometry":
  48565. case "CubeGeometry":
  48566. s = new n[l.type](l.width,l.height,l.depth,l.widthSegments,l.heightSegments,l.depthSegments);
  48567. break;
  48568. case "CircleGeometry":
  48569. case "CircleBufferGeometry":
  48570. s = new n[l.type](l.radius,l.segments,l.thetaStart,l.thetaLength);
  48571. break;
  48572. case "CylinderGeometry":
  48573. case "CylinderBufferGeometry":
  48574. s = new n[l.type](l.radiusTop,l.radiusBottom,l.height,l.radialSegments,l.heightSegments,l.openEnded,l.thetaStart,l.thetaLength);
  48575. break;
  48576. case "SphereGeometry":
  48577. case "SphereBufferGeometry":
  48578. s = new n[l.type](l.radius,l.widthSegments,l.heightSegments,l.phiStart,l.phiLength,l.thetaStart,l.thetaLength);
  48579. break;
  48580. case "DodecahedronGeometry":
  48581. s = new n.DodecahedronGeometry(l.radius,l.detail);
  48582. break;
  48583. case "IcosahedronGeometry":
  48584. s = new n.IcosahedronGeometry(l.radius,l.detail);
  48585. break;
  48586. case "OctahedronGeometry":
  48587. s = new n.OctahedronGeometry(l.radius,l.detail);
  48588. break;
  48589. case "TetrahedronGeometry":
  48590. s = new n.TetrahedronGeometry(l.radius,l.detail);
  48591. break;
  48592. case "RingGeometry":
  48593. case "RingBufferGeometry":
  48594. s = new n[l.type](l.innerRadius,l.outerRadius,l.thetaSegments,l.phiSegments,l.thetaStart,l.thetaLength);
  48595. break;
  48596. case "TorusGeometry":
  48597. case "TorusBufferGeometry":
  48598. s = new n[l.type](l.radius,l.tube,l.radialSegments,l.tubularSegments,l.arc);
  48599. break;
  48600. case "TorusKnotGeometry":
  48601. case "TorusKnotBufferGeometry":
  48602. s = new n[l.type](l.radius,l.tube,l.tubularSegments,l.radialSegments,l.p,l.q);
  48603. break;
  48604. case "LatheGeometry":
  48605. s = new n.LatheGeometry(l.points,l.segments,l.phiStart,l.phiLength);
  48606. break;
  48607. case "BufferGeometry":
  48608. s = r.parse(l);
  48609. break;
  48610. case "Geometry":
  48611. s = i.parse(l.data, this.texturePath).geometry;
  48612. break;
  48613. default:
  48614. console.warn('THREE.ObjectLoader: Unsupported geometry type "' + l.type + '"');
  48615. continue
  48616. }
  48617. s.uuid = l.uuid,
  48618. void 0 !== l.name && (s.name = l.name),
  48619. t[l.uuid] = s
  48620. }
  48621. return t
  48622. },
  48623. parseMaterials: function(e, t) {
  48624. var i = {};
  48625. if (void 0 !== e) {
  48626. var r = new n.MaterialLoader;
  48627. r.setTextures(t);
  48628. for (var o = 0, a = e.length; o < a; o++) {
  48629. var s = r.parse(e[o]);
  48630. i[s.uuid] = s
  48631. }
  48632. }
  48633. return i
  48634. },
  48635. parseAnimations: function(e) {
  48636. for (var t = [], i = 0; i < e.length; i++) {
  48637. var r = n.AnimationClip.parse(e[i]);
  48638. t.push(r)
  48639. }
  48640. return t
  48641. },
  48642. parseImages: function(e, t) {
  48643. function i(e) {
  48644. return r.manager.itemStart(e),
  48645. s.load(e, function() {
  48646. r.manager.itemEnd(e)
  48647. })
  48648. }
  48649. var r = this
  48650. , o = {};
  48651. if (void 0 !== e && e.length > 0) {
  48652. var a = new n.LoadingManager(t)
  48653. , s = new n.ImageLoader(a);
  48654. s.setCrossOrigin(this.crossOrigin);
  48655. for (var l = 0, c = e.length; l < c; l++) {
  48656. var h = e[l]
  48657. , u = /^(\/\/)|([a-z]+:(\/\/)?)/i.test(h.url) ? h.url : r.texturePath + h.url;
  48658. o[h.uuid] = i(u)
  48659. }
  48660. }
  48661. return o
  48662. },
  48663. parseTextures: function(e, t) {
  48664. function i(e) {
  48665. return "number" == typeof e ? e : (console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.", e),
  48666. n[e])
  48667. }
  48668. var r = {};
  48669. if (void 0 !== e)
  48670. for (var o = 0, a = e.length; o < a; o++) {
  48671. var s = e[o];
  48672. void 0 === s.image && console.warn('THREE.ObjectLoader: No "image" specified for', s.uuid),
  48673. void 0 === t[s.image] && console.warn("THREE.ObjectLoader: Undefined image", s.image);
  48674. var l = new n.Texture(t[s.image]);
  48675. l.needsUpdate = !0,
  48676. l.uuid = s.uuid,
  48677. void 0 !== s.name && (l.name = s.name),
  48678. void 0 !== s.mapping && (l.mapping = i(s.mapping)),
  48679. void 0 !== s.offset && (l.offset = new n.Vector2(s.offset[0],s.offset[1])),
  48680. void 0 !== s.repeat && (l.repeat = new n.Vector2(s.repeat[0],s.repeat[1])),
  48681. void 0 !== s.minFilter && (l.minFilter = i(s.minFilter)),
  48682. void 0 !== s.magFilter && (l.magFilter = i(s.magFilter)),
  48683. void 0 !== s.anisotropy && (l.anisotropy = s.anisotropy),
  48684. Array.isArray(s.wrap) && (l.wrapS = i(s.wrap[0]),
  48685. l.wrapT = i(s.wrap[1])),
  48686. r[s.uuid] = l
  48687. }
  48688. return r
  48689. },
  48690. parseObject: function() {
  48691. var e = new n.Matrix4;
  48692. return function(t, i, r) {
  48693. function o(e) {
  48694. return void 0 === i[e] && console.warn("THREE.ObjectLoader: Undefined geometry", e),
  48695. i[e]
  48696. }
  48697. function a(e) {
  48698. if (void 0 !== e)
  48699. return void 0 === r[e] && console.warn("THREE.ObjectLoader: Undefined material", e),
  48700. r[e]
  48701. }
  48702. var s;
  48703. switch (t.type) {
  48704. case "Scene":
  48705. s = new n.Scene;
  48706. break;
  48707. case "PerspectiveCamera":
  48708. s = new n.PerspectiveCamera(t.fov,t.aspect,t.near,t.far);
  48709. break;
  48710. case "OrthographicCamera":
  48711. s = new n.OrthographicCamera(t.left,t.right,t.top,t.bottom,t.near,t.far);
  48712. break;
  48713. case "AmbientLight":
  48714. s = new n.AmbientLight(t.color,t.intensity);
  48715. break;
  48716. case "DirectionalLight":
  48717. s = new n.DirectionalLight(t.color,t.intensity);
  48718. break;
  48719. case "PointLight":
  48720. s = new n.PointLight(t.color,t.intensity,t.distance,t.decay);
  48721. break;
  48722. case "SpotLight":
  48723. s = new n.SpotLight(t.color,t.intensity,t.distance,t.angle,t.penumbra,t.decay);
  48724. break;
  48725. case "HemisphereLight":
  48726. s = new n.HemisphereLight(t.color,t.groundColor,t.intensity);
  48727. break;
  48728. case "Mesh":
  48729. var l = o(t.geometry)
  48730. , c = a(t.material);
  48731. s = l.bones && l.bones.length > 0 ? new n.SkinnedMesh(l,c) : new n.Mesh(l,c);
  48732. break;
  48733. case "LOD":
  48734. s = new n.LOD;
  48735. break;
  48736. case "Line":
  48737. s = new n.Line(o(t.geometry),a(t.material),t.mode);
  48738. break;
  48739. case "PointCloud":
  48740. case "Points":
  48741. s = new n.Points(o(t.geometry),a(t.material));
  48742. break;
  48743. case "Sprite":
  48744. s = new n.Sprite(a(t.material));
  48745. break;
  48746. case "Group":
  48747. s = new n.Group;
  48748. break;
  48749. default:
  48750. s = new n.Object3D
  48751. }
  48752. if (s.uuid = t.uuid,
  48753. void 0 !== t.name && (s.name = t.name),
  48754. void 0 !== t.matrix ? (e.fromArray(t.matrix),
  48755. e.decompose(s.position, s.quaternion, s.scale)) : (void 0 !== t.position && s.position.fromArray(t.position),
  48756. void 0 !== t.rotation && s.rotation.fromArray(t.rotation),
  48757. void 0 !== t.scale && s.scale.fromArray(t.scale)),
  48758. void 0 !== t.castShadow && (s.castShadow = t.castShadow),
  48759. void 0 !== t.receiveShadow && (s.receiveShadow = t.receiveShadow),
  48760. void 0 !== t.visible && (s.visible = t.visible),
  48761. void 0 !== t.userData && (s.userData = t.userData),
  48762. void 0 !== t.children)
  48763. for (var h in t.children)
  48764. s.add(this.parseObject(t.children[h], i, r));
  48765. if ("LOD" === t.type)
  48766. for (var u = t.levels, d = 0; d < u.length; d++) {
  48767. var p = u[d]
  48768. , h = s.getObjectByProperty("uuid", p.object);
  48769. void 0 !== h && s.addLevel(h, p.distance)
  48770. }
  48771. return s
  48772. }
  48773. }()
  48774. },
  48775. n.TextureLoader = function(e) {
  48776. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  48777. }
  48778. ,
  48779. n.TextureLoader.prototype = {
  48780. constructor: n.TextureLoader,
  48781. load: function(e, t, i, r) {
  48782. var o = new n.Texture
  48783. , a = new n.ImageLoader(this.manager);
  48784. return a.setCrossOrigin(this.crossOrigin),
  48785. a.setPath(this.path),
  48786. a.load(e, function(e) {
  48787. o.image = e,
  48788. o.needsUpdate = !0,
  48789. void 0 !== t && t(o)
  48790. }, i, r),
  48791. o
  48792. },
  48793. setCrossOrigin: function(e) {
  48794. this.crossOrigin = e
  48795. },
  48796. setPath: function(e) {
  48797. this.path = e
  48798. }
  48799. },
  48800. n.CubeTextureLoader = function(e) {
  48801. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  48802. }
  48803. ,
  48804. n.CubeTextureLoader.prototype = {
  48805. constructor: n.CubeTextureLoader,
  48806. load: function(e, t, i, r) {
  48807. function o(i) {
  48808. s.load(e[i], function(e) {
  48809. a.images[i] = e,
  48810. l++,
  48811. 6 === l && (a.needsUpdate = !0,
  48812. t && t(a))
  48813. }, void 0, r)
  48814. }
  48815. var a = new n.CubeTexture
  48816. , s = new n.ImageLoader(this.manager);
  48817. s.setCrossOrigin(this.crossOrigin),
  48818. s.setPath(this.path);
  48819. for (var l = 0, c = 0; c < e.length; ++c)
  48820. o(c);
  48821. return a
  48822. },
  48823. setCrossOrigin: function(e) {
  48824. this.crossOrigin = e
  48825. },
  48826. setPath: function(e) {
  48827. this.path = e
  48828. }
  48829. },
  48830. n.DataTextureLoader = n.BinaryTextureLoader = function(e) {
  48831. this.manager = void 0 !== e ? e : n.DefaultLoadingManager,
  48832. this._parser = null
  48833. }
  48834. ,
  48835. n.BinaryTextureLoader.prototype = {
  48836. constructor: n.BinaryTextureLoader,
  48837. load: function(e, t, i, r) {
  48838. var o = this
  48839. , a = new n.DataTexture
  48840. , s = new n.XHRLoader(this.manager);
  48841. return s.setResponseType("arraybuffer"),
  48842. s.load(e, function(e) {
  48843. var i = o._parser(e);
  48844. i && (void 0 !== i.image ? a.image = i.image : void 0 !== i.data && (a.image.width = i.width,
  48845. a.image.height = i.height,
  48846. a.image.data = i.data),
  48847. a.wrapS = void 0 !== i.wrapS ? i.wrapS : n.ClampToEdgeWrapping,
  48848. a.wrapT = void 0 !== i.wrapT ? i.wrapT : n.ClampToEdgeWrapping,
  48849. a.magFilter = void 0 !== i.magFilter ? i.magFilter : n.LinearFilter,
  48850. a.minFilter = void 0 !== i.minFilter ? i.minFilter : n.LinearMipMapLinearFilter,
  48851. a.anisotropy = void 0 !== i.anisotropy ? i.anisotropy : 1,
  48852. void 0 !== i.format && (a.format = i.format),
  48853. void 0 !== i.type && (a.type = i.type),
  48854. void 0 !== i.mipmaps && (a.mipmaps = i.mipmaps),
  48855. 1 === i.mipmapCount && (a.minFilter = n.LinearFilter),
  48856. a.needsUpdate = !0,
  48857. t && t(a, i))
  48858. }, i, r),
  48859. a
  48860. }
  48861. },
  48862. n.CompressedTextureLoader = function(e) {
  48863. this.manager = void 0 !== e ? e : n.DefaultLoadingManager,
  48864. this._parser = null
  48865. }
  48866. ;
  48867. n.CompressedTextureLoader.prototype = {
  48868. constructor: n.CompressedTextureLoader,
  48869. load: function(e, t, i, r) {
  48870. function o(o) {
  48871. c.load(e[o], function(e) {
  48872. var i = a._parser(e, !0);
  48873. s[o] = {
  48874. width: i.width,
  48875. height: i.height,
  48876. format: i.format,
  48877. mipmaps: i.mipmaps
  48878. },
  48879. h += 1,
  48880. 6 === h && (1 === i.mipmapCount && (l.minFilter = n.LinearFilter),
  48881. l.format = i.format,
  48882. l.needsUpdate = !0,
  48883. t && t(l))
  48884. }, i, r)
  48885. }
  48886. var a = this
  48887. , s = []
  48888. , l = new n.CompressedTexture;
  48889. l.image = s;
  48890. var c = new n.XHRLoader(this.manager);
  48891. if (c.setPath(this.path),
  48892. c.setResponseType("arraybuffer"),
  48893. Array.isArray(e))
  48894. for (var h = 0, u = 0, d = e.length; u < d; ++u)
  48895. o(u);
  48896. else
  48897. c.load(e, function(e) {
  48898. var i = a._parser(e, !0);
  48899. if (i.isCubemap)
  48900. for (var r = i.mipmaps.length / i.mipmapCount, o = 0; o < r; o++) {
  48901. s[o] = {
  48902. mipmaps: []
  48903. };
  48904. for (var c = 0; c < i.mipmapCount; c++)
  48905. s[o].mipmaps.push(i.mipmaps[o * i.mipmapCount + c]),
  48906. s[o].format = i.format,
  48907. s[o].width = i.width,
  48908. s[o].height = i.height
  48909. }
  48910. else
  48911. l.image.width = i.width,
  48912. l.image.height = i.height,
  48913. l.mipmaps = i.mipmaps;
  48914. 1 === i.mipmapCount && (l.minFilter = n.LinearFilter),
  48915. l.format = i.format,
  48916. l.needsUpdate = !0,
  48917. t && t(l)
  48918. }, i, r);
  48919. return l
  48920. },
  48921. setPath: function(e) {
  48922. this.path = e
  48923. }
  48924. };
  48925. n.Material = function() {
  48926. Object.defineProperty(this, "id", {
  48927. value: n.MaterialIdCount++
  48928. }),
  48929. this.uuid = n.Math.generateUUID(),
  48930. this.name = "",
  48931. this.type = "Material",
  48932. this.side = n.FrontSide,
  48933. this.opacity = 1,
  48934. this.transparent = !1,
  48935. this.blending = n.NormalBlending,
  48936. this.blendSrc = n.SrcAlphaFactor,
  48937. this.blendDst = n.OneMinusSrcAlphaFactor,
  48938. this.blendEquation = n.AddEquation,
  48939. this.blendSrcAlpha = null,
  48940. this.blendDstAlpha = null,
  48941. this.blendEquationAlpha = null,
  48942. this.depthFunc = n.LessEqualDepth,
  48943. this.depthTest = !0,
  48944. this.depthWrite = !0,
  48945. this.colorWrite = !0,
  48946. this.precision = null,
  48947. this.polygonOffset = !1,
  48948. this.polygonOffsetFactor = 0,
  48949. this.polygonOffsetUnits = 0,
  48950. this.alphaTest = 0,
  48951. this.premultipliedAlpha = !1,
  48952. this.overdraw = 0,
  48953. this.visible = !0,
  48954. this._needsUpdate = !0
  48955. }
  48956. ,
  48957. n.Material.prototype = {
  48958. constructor: n.Material,
  48959. get needsUpdate() {
  48960. return this._needsUpdate
  48961. },
  48962. set needsUpdate(e) {
  48963. e === !0 && this.update(),
  48964. this._needsUpdate = e
  48965. },
  48966. setValues: function(e) {
  48967. if (void 0 !== e)
  48968. for (var t in e) {
  48969. var i = e[t];
  48970. if (void 0 !== i) {
  48971. var r = this[t];
  48972. 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.")
  48973. } else
  48974. console.warn("THREE.Material: '" + t + "' parameter is undefined.")
  48975. }
  48976. },
  48977. toJSON: function(e) {
  48978. function t(e) {
  48979. var t = [];
  48980. for (var i in e) {
  48981. var n = e[i];
  48982. delete n.metadata,
  48983. t.push(n)
  48984. }
  48985. return t
  48986. }
  48987. var i = void 0 === e;
  48988. i && (e = {
  48989. textures: {},
  48990. images: {}
  48991. });
  48992. var r = {
  48993. metadata: {
  48994. version: 4.4,
  48995. type: "Material",
  48996. generator: "Material.toJSON"
  48997. }
  48998. };
  48999. if (r.uuid = this.uuid,
  49000. r.type = this.type,
  49001. "" !== this.name && (r.name = this.name),
  49002. this.color instanceof n.Color && (r.color = this.color.getHex()),
  49003. .5 !== this.roughness && (r.roughness = this.roughness),
  49004. .5 !== this.metalness && (r.metalness = this.metalness),
  49005. this.emissive instanceof n.Color && (r.emissive = this.emissive.getHex()),
  49006. this.specular instanceof n.Color && (r.specular = this.specular.getHex()),
  49007. void 0 !== this.shininess && (r.shininess = this.shininess),
  49008. this.map instanceof n.Texture && (r.map = this.map.toJSON(e).uuid),
  49009. this.alphaMap instanceof n.Texture && (r.alphaMap = this.alphaMap.toJSON(e).uuid),
  49010. this.lightMap instanceof n.Texture && (r.lightMap = this.lightMap.toJSON(e).uuid),
  49011. this.bumpMap instanceof n.Texture && (r.bumpMap = this.bumpMap.toJSON(e).uuid,
  49012. r.bumpScale = this.bumpScale),
  49013. this.normalMap instanceof n.Texture && (r.normalMap = this.normalMap.toJSON(e).uuid,
  49014. r.normalScale = this.normalScale.toArray()),
  49015. this.displacementMap instanceof n.Texture && (r.displacementMap = this.displacementMap.toJSON(e).uuid,
  49016. r.displacementScale = this.displacementScale,
  49017. r.displacementBias = this.displacementBias),
  49018. this.roughnessMap instanceof n.Texture && (r.roughnessMap = this.roughnessMap.toJSON(e).uuid),
  49019. this.metalnessMap instanceof n.Texture && (r.metalnessMap = this.metalnessMap.toJSON(e).uuid),
  49020. this.emissiveMap instanceof n.Texture && (r.emissiveMap = this.emissiveMap.toJSON(e).uuid),
  49021. this.specularMap instanceof n.Texture && (r.specularMap = this.specularMap.toJSON(e).uuid),
  49022. this.envMap instanceof n.Texture && (r.envMap = this.envMap.toJSON(e).uuid,
  49023. r.reflectivity = this.reflectivity),
  49024. void 0 !== this.size && (r.size = this.size),
  49025. void 0 !== this.sizeAttenuation && (r.sizeAttenuation = this.sizeAttenuation),
  49026. void 0 !== this.vertexColors && this.vertexColors !== n.NoColors && (r.vertexColors = this.vertexColors),
  49027. void 0 !== this.shading && this.shading !== n.SmoothShading && (r.shading = this.shading),
  49028. void 0 !== this.blending && this.blending !== n.NormalBlending && (r.blending = this.blending),
  49029. void 0 !== this.side && this.side !== n.FrontSide && (r.side = this.side),
  49030. this.opacity < 1 && (r.opacity = this.opacity),
  49031. this.transparent === !0 && (r.transparent = this.transparent),
  49032. this.alphaTest > 0 && (r.alphaTest = this.alphaTest),
  49033. this.premultipliedAlpha === !0 && (r.premultipliedAlpha = this.premultipliedAlpha),
  49034. this.wireframe === !0 && (r.wireframe = this.wireframe),
  49035. this.wireframeLinewidth > 1 && (r.wireframeLinewidth = this.wireframeLinewidth),
  49036. i) {
  49037. var o = t(e.textures)
  49038. , a = t(e.images);
  49039. o.length > 0 && (r.textures = o),
  49040. a.length > 0 && (r.images = a)
  49041. }
  49042. return r
  49043. },
  49044. clone: function() {
  49045. return (new this.constructor).copy(this)
  49046. },
  49047. copy: function(e) {
  49048. return this.name = e.name,
  49049. this.side = e.side,
  49050. this.opacity = e.opacity,
  49051. this.transparent = e.transparent,
  49052. this.blending = e.blending,
  49053. this.blendSrc = e.blendSrc,
  49054. this.blendDst = e.blendDst,
  49055. this.blendEquation = e.blendEquation,
  49056. this.blendSrcAlpha = e.blendSrcAlpha,
  49057. this.blendDstAlpha = e.blendDstAlpha,
  49058. this.blendEquationAlpha = e.blendEquationAlpha,
  49059. this.depthFunc = e.depthFunc,
  49060. this.depthTest = e.depthTest,
  49061. this.depthWrite = e.depthWrite,
  49062. this.colorWrite = e.colorWrite,
  49063. this.precision = e.precision,
  49064. this.polygonOffset = e.polygonOffset,
  49065. this.polygonOffsetFactor = e.polygonOffsetFactor,
  49066. this.polygonOffsetUnits = e.polygonOffsetUnits,
  49067. this.alphaTest = e.alphaTest,
  49068. this.premultipliedAlpha = e.premultipliedAlpha,
  49069. this.overdraw = e.overdraw,
  49070. this.visible = e.visible,
  49071. this
  49072. },
  49073. update: function() {
  49074. this.dispatchEvent({
  49075. type: "update"
  49076. })
  49077. },
  49078. dispose: function() {
  49079. this.dispatchEvent({
  49080. type: "dispose"
  49081. })
  49082. }
  49083. },
  49084. n.EventDispatcher.prototype.apply(n.Material.prototype),
  49085. n.MaterialIdCount = 0,
  49086. n.LineBasicMaterial = function(e) {
  49087. n.Material.call(this),
  49088. this.type = "LineBasicMaterial",
  49089. this.color = new n.Color(16777215),
  49090. this.linewidth = 1,
  49091. this.linecap = "round",
  49092. this.linejoin = "round",
  49093. this.blending = n.NormalBlending,
  49094. this.vertexColors = n.NoColors,
  49095. this.fog = !0,
  49096. this.setValues(e)
  49097. }
  49098. ,
  49099. n.LineBasicMaterial.prototype = Object.create(n.Material.prototype),
  49100. n.LineBasicMaterial.prototype.constructor = n.LineBasicMaterial,
  49101. n.LineBasicMaterial.prototype.copy = function(e) {
  49102. return n.Material.prototype.copy.call(this, e),
  49103. this.color.copy(e.color),
  49104. this.linewidth = e.linewidth,
  49105. this.linecap = e.linecap,
  49106. this.linejoin = e.linejoin,
  49107. this.vertexColors = e.vertexColors,
  49108. this.fog = e.fog,
  49109. this
  49110. }
  49111. ,
  49112. n.LineDashedMaterial = function(e) {
  49113. n.Material.call(this),
  49114. this.type = "LineDashedMaterial",
  49115. this.color = new n.Color(16777215),
  49116. this.linewidth = 1,
  49117. this.scale = 1,
  49118. this.dashSize = 3,
  49119. this.gapSize = 1,
  49120. this.blending = n.NormalBlending,
  49121. this.vertexColors = n.NoColors,
  49122. this.fog = !0,
  49123. this.setValues(e)
  49124. }
  49125. ,
  49126. n.LineDashedMaterial.prototype = Object.create(n.Material.prototype),
  49127. n.LineDashedMaterial.prototype.constructor = n.LineDashedMaterial,
  49128. n.LineDashedMaterial.prototype.copy = function(e) {
  49129. return n.Material.prototype.copy.call(this, e),
  49130. this.color.copy(e.color),
  49131. this.linewidth = e.linewidth,
  49132. this.scale = e.scale,
  49133. this.dashSize = e.dashSize,
  49134. this.gapSize = e.gapSize,
  49135. this.vertexColors = e.vertexColors,
  49136. this.fog = e.fog,
  49137. this
  49138. }
  49139. ,
  49140. n.MeshBasicMaterial = function(e) {
  49141. n.Material.call(this),
  49142. this.type = "MeshBasicMaterial",
  49143. this.color = new n.Color(16777215),
  49144. this.map = null,
  49145. this.aoMap = null,
  49146. this.aoMapIntensity = 1,
  49147. this.specularMap = null,
  49148. this.alphaMap = null,
  49149. this.envMap = null,
  49150. this.combine = n.MultiplyOperation,
  49151. this.reflectivity = 1,
  49152. this.refractionRatio = .98,
  49153. this.fog = !0,
  49154. this.shading = n.SmoothShading,
  49155. this.blending = n.NormalBlending,
  49156. this.wireframe = !1,
  49157. this.wireframeLinewidth = 1,
  49158. this.wireframeLinecap = "round",
  49159. this.wireframeLinejoin = "round",
  49160. this.vertexColors = n.NoColors,
  49161. this.skinning = !1,
  49162. this.morphTargets = !1,
  49163. this.setValues(e)
  49164. }
  49165. ,
  49166. n.MeshBasicMaterial.prototype = Object.create(n.Material.prototype),
  49167. n.MeshBasicMaterial.prototype.constructor = n.MeshBasicMaterial,
  49168. n.MeshBasicMaterial.prototype.copy = function(e) {
  49169. return n.Material.prototype.copy.call(this, e),
  49170. this.color.copy(e.color),
  49171. this.map = e.map,
  49172. this.aoMap = e.aoMap,
  49173. this.aoMapIntensity = e.aoMapIntensity,
  49174. this.specularMap = e.specularMap,
  49175. this.alphaMap = e.alphaMap,
  49176. this.envMap = e.envMap,
  49177. this.combine = e.combine,
  49178. this.reflectivity = e.reflectivity,
  49179. this.refractionRatio = e.refractionRatio,
  49180. this.fog = e.fog,
  49181. this.shading = e.shading,
  49182. this.wireframe = e.wireframe,
  49183. this.wireframeLinewidth = e.wireframeLinewidth,
  49184. this.wireframeLinecap = e.wireframeLinecap,
  49185. this.wireframeLinejoin = e.wireframeLinejoin,
  49186. this.vertexColors = e.vertexColors,
  49187. this.skinning = e.skinning,
  49188. this.morphTargets = e.morphTargets,
  49189. this
  49190. }
  49191. ,
  49192. n.MeshLambertMaterial = function(e) {
  49193. n.Material.call(this),
  49194. this.type = "MeshLambertMaterial",
  49195. this.color = new n.Color(16777215),
  49196. this.map = null,
  49197. this.lightMap = null,
  49198. this.lightMapIntensity = 1,
  49199. this.aoMap = null,
  49200. this.aoMapIntensity = 1,
  49201. this.emissive = new n.Color(0),
  49202. this.emissiveIntensity = 1,
  49203. this.emissiveMap = null,
  49204. this.specularMap = null,
  49205. this.alphaMap = null,
  49206. this.envMap = null,
  49207. this.combine = n.MultiplyOperation,
  49208. this.reflectivity = 1,
  49209. this.refractionRatio = .98,
  49210. this.fog = !0,
  49211. this.blending = n.NormalBlending,
  49212. this.wireframe = !1,
  49213. this.wireframeLinewidth = 1,
  49214. this.wireframeLinecap = "round",
  49215. this.wireframeLinejoin = "round",
  49216. this.vertexColors = n.NoColors,
  49217. this.skinning = !1,
  49218. this.morphTargets = !1,
  49219. this.morphNormals = !1,
  49220. this.setValues(e)
  49221. }
  49222. ,
  49223. n.MeshLambertMaterial.prototype = Object.create(n.Material.prototype),
  49224. n.MeshLambertMaterial.prototype.constructor = n.MeshLambertMaterial,
  49225. n.MeshLambertMaterial.prototype.copy = function(e) {
  49226. return n.Material.prototype.copy.call(this, e),
  49227. this.color.copy(e.color),
  49228. this.map = e.map,
  49229. this.lightMap = e.lightMap,
  49230. this.lightMapIntensity = e.lightMapIntensity,
  49231. this.aoMap = e.aoMap,
  49232. this.aoMapIntensity = e.aoMapIntensity,
  49233. this.emissive.copy(e.emissive),
  49234. this.emissiveMap = e.emissiveMap,
  49235. this.emissiveIntensity = e.emissiveIntensity,
  49236. this.specularMap = e.specularMap,
  49237. this.alphaMap = e.alphaMap,
  49238. this.envMap = e.envMap,
  49239. this.combine = e.combine,
  49240. this.reflectivity = e.reflectivity,
  49241. this.refractionRatio = e.refractionRatio,
  49242. this.fog = e.fog,
  49243. this.wireframe = e.wireframe,
  49244. this.wireframeLinewidth = e.wireframeLinewidth,
  49245. this.wireframeLinecap = e.wireframeLinecap,
  49246. this.wireframeLinejoin = e.wireframeLinejoin,
  49247. this.vertexColors = e.vertexColors,
  49248. this.skinning = e.skinning,
  49249. this.morphTargets = e.morphTargets,
  49250. this.morphNormals = e.morphNormals,
  49251. this
  49252. }
  49253. ,
  49254. n.MeshPhongMaterial = function(e) {
  49255. n.Material.call(this),
  49256. this.type = "MeshPhongMaterial",
  49257. this.color = new n.Color(16777215),
  49258. this.specular = new n.Color(1118481),
  49259. this.shininess = 30,
  49260. this.map = null,
  49261. this.lightMap = null,
  49262. this.lightMapIntensity = 1,
  49263. this.aoMap = null,
  49264. this.aoMapIntensity = 1,
  49265. this.emissive = new n.Color(0),
  49266. this.emissiveIntensity = 1,
  49267. this.emissiveMap = null,
  49268. this.bumpMap = null,
  49269. this.bumpScale = 1,
  49270. this.normalMap = null,
  49271. this.normalScale = new n.Vector2(1,1),
  49272. this.displacementMap = null,
  49273. this.displacementScale = 1,
  49274. this.displacementBias = 0,
  49275. this.specularMap = null,
  49276. this.alphaMap = null,
  49277. this.envMap = null,
  49278. this.combine = n.MultiplyOperation,
  49279. this.reflectivity = 1,
  49280. this.refractionRatio = .98,
  49281. this.fog = !0,
  49282. this.shading = n.SmoothShading,
  49283. this.blending = n.NormalBlending,
  49284. this.wireframe = !1,
  49285. this.wireframeLinewidth = 1,
  49286. this.wireframeLinecap = "round",
  49287. this.wireframeLinejoin = "round",
  49288. this.vertexColors = n.NoColors,
  49289. this.skinning = !1,
  49290. this.morphTargets = !1,
  49291. this.morphNormals = !1,
  49292. this.setValues(e)
  49293. }
  49294. ,
  49295. n.MeshPhongMaterial.prototype = Object.create(n.Material.prototype),
  49296. n.MeshPhongMaterial.prototype.constructor = n.MeshPhongMaterial,
  49297. n.MeshPhongMaterial.prototype.copy = function(e) {
  49298. return n.Material.prototype.copy.call(this, e),
  49299. this.color.copy(e.color),
  49300. this.specular.copy(e.specular),
  49301. this.shininess = e.shininess,
  49302. this.map = e.map,
  49303. this.lightMap = e.lightMap,
  49304. this.lightMapIntensity = e.lightMapIntensity,
  49305. this.aoMap = e.aoMap,
  49306. this.aoMapIntensity = e.aoMapIntensity,
  49307. this.emissive.copy(e.emissive),
  49308. this.emissiveMap = e.emissiveMap,
  49309. this.emissiveIntensity = e.emissiveIntensity,
  49310. this.bumpMap = e.bumpMap,
  49311. this.bumpScale = e.bumpScale,
  49312. this.normalMap = e.normalMap,
  49313. this.normalScale.copy(e.normalScale),
  49314. this.displacementMap = e.displacementMap,
  49315. this.displacementScale = e.displacementScale,
  49316. this.displacementBias = e.displacementBias,
  49317. this.specularMap = e.specularMap,
  49318. this.alphaMap = e.alphaMap,
  49319. this.envMap = e.envMap,
  49320. this.combine = e.combine,
  49321. this.reflectivity = e.reflectivity,
  49322. this.refractionRatio = e.refractionRatio,
  49323. this.fog = e.fog,
  49324. this.shading = e.shading,
  49325. this.wireframe = e.wireframe,
  49326. this.wireframeLinewidth = e.wireframeLinewidth,
  49327. this.wireframeLinecap = e.wireframeLinecap,
  49328. this.wireframeLinejoin = e.wireframeLinejoin,
  49329. this.vertexColors = e.vertexColors,
  49330. this.skinning = e.skinning,
  49331. this.morphTargets = e.morphTargets,
  49332. this.morphNormals = e.morphNormals,
  49333. this
  49334. }
  49335. ,
  49336. n.MeshStandardMaterial = function(e) {
  49337. n.Material.call(this),
  49338. this.type = "MeshStandardMaterial",
  49339. this.color = new n.Color(16777215),
  49340. this.roughness = .5,
  49341. this.metalness = .5,
  49342. this.map = null,
  49343. this.lightMap = null,
  49344. this.lightMapIntensity = 1,
  49345. this.aoMap = null,
  49346. this.aoMapIntensity = 1,
  49347. this.emissive = new n.Color(0),
  49348. this.emissiveIntensity = 1,
  49349. this.emissiveMap = null,
  49350. this.bumpMap = null,
  49351. this.bumpScale = 1,
  49352. this.normalMap = null,
  49353. this.normalScale = new n.Vector2(1,1),
  49354. this.displacementMap = null,
  49355. this.displacementScale = 1,
  49356. this.displacementBias = 0,
  49357. this.roughnessMap = null,
  49358. this.metalnessMap = null,
  49359. this.alphaMap = null,
  49360. this.envMap = null,
  49361. this.envMapIntensity = 1,
  49362. this.refractionRatio = .98,
  49363. this.fog = !0,
  49364. this.shading = n.SmoothShading,
  49365. this.blending = n.NormalBlending,
  49366. this.wireframe = !1,
  49367. this.wireframeLinewidth = 1,
  49368. this.wireframeLinecap = "round",
  49369. this.wireframeLinejoin = "round",
  49370. this.vertexColors = n.NoColors,
  49371. this.skinning = !1,
  49372. this.morphTargets = !1,
  49373. this.morphNormals = !1,
  49374. this.setValues(e)
  49375. }
  49376. ,
  49377. n.MeshStandardMaterial.prototype = Object.create(n.Material.prototype),
  49378. n.MeshStandardMaterial.prototype.constructor = n.MeshStandardMaterial,
  49379. n.MeshStandardMaterial.prototype.copy = function(e) {
  49380. return n.Material.prototype.copy.call(this, e),
  49381. this.color.copy(e.color),
  49382. this.roughness = e.roughness,
  49383. this.metalness = e.metalness,
  49384. this.map = e.map,
  49385. this.lightMap = e.lightMap,
  49386. this.lightMapIntensity = e.lightMapIntensity,
  49387. this.aoMap = e.aoMap,
  49388. this.aoMapIntensity = e.aoMapIntensity,
  49389. this.emissive.copy(e.emissive),
  49390. this.emissiveMap = e.emissiveMap,
  49391. this.emissiveIntensity = e.emissiveIntensity,
  49392. this.bumpMap = e.bumpMap,
  49393. this.bumpScale = e.bumpScale,
  49394. this.normalMap = e.normalMap,
  49395. this.normalScale.copy(e.normalScale),
  49396. this.displacementMap = e.displacementMap,
  49397. this.displacementScale = e.displacementScale,
  49398. this.displacementBias = e.displacementBias,
  49399. this.roughnessMap = e.roughnessMap,
  49400. this.metalnessMap = e.metalnessMap,
  49401. this.alphaMap = e.alphaMap,
  49402. this.envMap = e.envMap,
  49403. this.envMapIntensity = e.envMapIntensity,
  49404. this.refractionRatio = e.refractionRatio,
  49405. this.fog = e.fog,
  49406. this.shading = e.shading,
  49407. this.wireframe = e.wireframe,
  49408. this.wireframeLinewidth = e.wireframeLinewidth,
  49409. this.wireframeLinecap = e.wireframeLinecap,
  49410. this.wireframeLinejoin = e.wireframeLinejoin,
  49411. this.vertexColors = e.vertexColors,
  49412. this.skinning = e.skinning,
  49413. this.morphTargets = e.morphTargets,
  49414. this.morphNormals = e.morphNormals,
  49415. this
  49416. }
  49417. ,
  49418. n.MeshDepthMaterial = function(e) {
  49419. n.Material.call(this),
  49420. this.type = "MeshDepthMaterial",
  49421. this.morphTargets = !1,
  49422. this.wireframe = !1,
  49423. this.wireframeLinewidth = 1,
  49424. this.setValues(e)
  49425. }
  49426. ,
  49427. n.MeshDepthMaterial.prototype = Object.create(n.Material.prototype),
  49428. n.MeshDepthMaterial.prototype.constructor = n.MeshDepthMaterial,
  49429. n.MeshDepthMaterial.prototype.copy = function(e) {
  49430. return n.Material.prototype.copy.call(this, e),
  49431. this.wireframe = e.wireframe,
  49432. this.wireframeLinewidth = e.wireframeLinewidth,
  49433. this
  49434. }
  49435. ,
  49436. n.MeshNormalMaterial = function(e) {
  49437. n.Material.call(this, e),
  49438. this.type = "MeshNormalMaterial",
  49439. this.wireframe = !1,
  49440. this.wireframeLinewidth = 1,
  49441. this.morphTargets = !1,
  49442. this.setValues(e)
  49443. }
  49444. ,
  49445. n.MeshNormalMaterial.prototype = Object.create(n.Material.prototype),
  49446. n.MeshNormalMaterial.prototype.constructor = n.MeshNormalMaterial,
  49447. n.MeshNormalMaterial.prototype.copy = function(e) {
  49448. return n.Material.prototype.copy.call(this, e),
  49449. this.wireframe = e.wireframe,
  49450. this.wireframeLinewidth = e.wireframeLinewidth,
  49451. this
  49452. }
  49453. ,
  49454. n.MultiMaterial = function(e) {
  49455. this.uuid = n.Math.generateUUID(),
  49456. this.type = "MultiMaterial",
  49457. this.materials = e instanceof Array ? e : [],
  49458. this.visible = !0
  49459. }
  49460. ,
  49461. n.MultiMaterial.prototype = {
  49462. constructor: n.MultiMaterial,
  49463. toJSON: function(e) {
  49464. for (var t = {
  49465. metadata: {
  49466. version: 4.2,
  49467. type: "material",
  49468. generator: "MaterialExporter"
  49469. },
  49470. uuid: this.uuid,
  49471. type: this.type,
  49472. materials: []
  49473. }, i = this.materials, n = 0, r = i.length; n < r; n++) {
  49474. var o = i[n].toJSON(e);
  49475. delete o.metadata,
  49476. t.materials.push(o)
  49477. }
  49478. return t.visible = this.visible,
  49479. t
  49480. },
  49481. clone: function() {
  49482. for (var e = new this.constructor, t = 0; t < this.materials.length; t++)
  49483. e.materials.push(this.materials[t].clone());
  49484. return e.visible = this.visible,
  49485. e
  49486. }
  49487. },
  49488. n.PointsMaterial = function(e) {
  49489. n.Material.call(this),
  49490. this.type = "PointsMaterial",
  49491. this.color = new n.Color(16777215),
  49492. this.map = null,
  49493. this.size = 1,
  49494. this.sizeAttenuation = !0,
  49495. this.blending = n.NormalBlending,
  49496. this.vertexColors = n.NoColors,
  49497. this.fog = !0,
  49498. this.setValues(e)
  49499. }
  49500. ,
  49501. n.PointsMaterial.prototype = Object.create(n.Material.prototype),
  49502. n.PointsMaterial.prototype.constructor = n.PointsMaterial,
  49503. n.PointsMaterial.prototype.copy = function(e) {
  49504. return n.Material.prototype.copy.call(this, e),
  49505. this.color.copy(e.color),
  49506. this.map = e.map,
  49507. this.size = e.size,
  49508. this.sizeAttenuation = e.sizeAttenuation,
  49509. this.vertexColors = e.vertexColors,
  49510. this.fog = e.fog,
  49511. this
  49512. }
  49513. ,
  49514. n.ShaderMaterial = function(e) {
  49515. n.Material.call(this),
  49516. this.type = "ShaderMaterial",
  49517. this.defines = {},
  49518. this.uniforms = {},
  49519. this.vertexShader = "void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",
  49520. this.fragmentShader = "void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}",
  49521. this.shading = n.SmoothShading,
  49522. this.linewidth = 1,
  49523. this.wireframe = !1,
  49524. this.wireframeLinewidth = 1,
  49525. this.fog = !1,
  49526. this.lights = !1,
  49527. this.vertexColors = n.NoColors,
  49528. this.skinning = !1,
  49529. this.morphTargets = !1,
  49530. this.morphNormals = !1,
  49531. this.extensions = {
  49532. derivatives: !1,
  49533. fragDepth: !1,
  49534. drawBuffers: !1,
  49535. shaderTextureLOD: !1
  49536. },
  49537. this.defaultAttributeValues = {
  49538. color: [1, 1, 1],
  49539. uv: [0, 0],
  49540. uv2: [0, 0]
  49541. },
  49542. this.index0AttributeName = void 0,
  49543. void 0 !== e && (void 0 !== e.attributes && console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."),
  49544. this.setValues(e))
  49545. }
  49546. ,
  49547. n.ShaderMaterial.prototype = Object.create(n.Material.prototype),
  49548. n.ShaderMaterial.prototype.constructor = n.ShaderMaterial,
  49549. n.ShaderMaterial.prototype.copy = function(e) {
  49550. return n.Material.prototype.copy.call(this, e),
  49551. this.fragmentShader = e.fragmentShader,
  49552. this.vertexShader = e.vertexShader,
  49553. this.uniforms = n.UniformsUtils.clone(e.uniforms),
  49554. this.defines = e.defines,
  49555. this.shading = e.shading,
  49556. this.wireframe = e.wireframe,
  49557. this.wireframeLinewidth = e.wireframeLinewidth,
  49558. this.fog = e.fog,
  49559. this.lights = e.lights,
  49560. this.vertexColors = e.vertexColors,
  49561. this.skinning = e.skinning,
  49562. this.morphTargets = e.morphTargets,
  49563. this.morphNormals = e.morphNormals,
  49564. this.extensions = e.extensions,
  49565. this
  49566. }
  49567. ,
  49568. n.ShaderMaterial.prototype.toJSON = function(e) {
  49569. var t = n.Material.prototype.toJSON.call(this, e);
  49570. return t.uniforms = this.uniforms,
  49571. t.vertexShader = this.vertexShader,
  49572. t.fragmentShader = this.fragmentShader,
  49573. t
  49574. }
  49575. ,
  49576. n.RawShaderMaterial = function(e) {
  49577. n.ShaderMaterial.call(this, e),
  49578. this.type = "RawShaderMaterial"
  49579. }
  49580. ,
  49581. n.RawShaderMaterial.prototype = Object.create(n.ShaderMaterial.prototype),
  49582. n.RawShaderMaterial.prototype.constructor = n.RawShaderMaterial,
  49583. n.SpriteMaterial = function(e) {
  49584. n.Material.call(this),
  49585. this.type = "SpriteMaterial",
  49586. this.color = new n.Color(16777215),
  49587. this.map = null,
  49588. this.rotation = 0,
  49589. this.fog = !1,
  49590. this.setValues(e)
  49591. }
  49592. ,
  49593. n.SpriteMaterial.prototype = Object.create(n.Material.prototype),
  49594. n.SpriteMaterial.prototype.constructor = n.SpriteMaterial,
  49595. n.SpriteMaterial.prototype.copy = function(e) {
  49596. return n.Material.prototype.copy.call(this, e),
  49597. this.color.copy(e.color),
  49598. this.map = e.map,
  49599. this.rotation = e.rotation,
  49600. this.fog = e.fog,
  49601. this
  49602. }
  49603. ,
  49604. n.Texture = function(e, t, i, r, o, a, s, l, c) {
  49605. Object.defineProperty(this, "id", {
  49606. value: n.TextureIdCount++
  49607. }),
  49608. this.uuid = n.Math.generateUUID(),
  49609. this.name = "",
  49610. this.sourceFile = "",
  49611. this.image = void 0 !== e ? e : n.Texture.DEFAULT_IMAGE,
  49612. this.mipmaps = [],
  49613. this.mapping = void 0 !== t ? t : n.Texture.DEFAULT_MAPPING,
  49614. this.wrapS = void 0 !== i ? i : n.ClampToEdgeWrapping,
  49615. this.wrapT = void 0 !== r ? r : n.ClampToEdgeWrapping,
  49616. this.magFilter = void 0 !== o ? o : n.LinearFilter,
  49617. this.minFilter = void 0 !== a ? a : n.LinearMipMapLinearFilter,
  49618. this.anisotropy = void 0 !== c ? c : 1,
  49619. this.format = void 0 !== s ? s : n.RGBAFormat,
  49620. this.type = void 0 !== l ? l : n.UnsignedByteType,
  49621. this.offset = new n.Vector2(0,0),
  49622. this.repeat = new n.Vector2(1,1),
  49623. this.generateMipmaps = !0,
  49624. this.premultiplyAlpha = !1,
  49625. this.flipY = !0,
  49626. this.unpackAlignment = 4,
  49627. this.encoding = n.LinearEncoding,
  49628. this.version = 0,
  49629. this.onUpdate = null
  49630. }
  49631. ,
  49632. n.Texture.DEFAULT_IMAGE = void 0,
  49633. n.Texture.DEFAULT_MAPPING = n.UVMapping,
  49634. n.Texture.prototype = {
  49635. constructor: n.Texture,
  49636. set needsUpdate(e) {
  49637. e === !0 && this.version++
  49638. },
  49639. clone: function() {
  49640. return (new this.constructor).copy(this)
  49641. },
  49642. copy: function(e) {
  49643. return this.image = e.image,
  49644. this.mipmaps = e.mipmaps.slice(0),
  49645. this.mapping = e.mapping,
  49646. this.wrapS = e.wrapS,
  49647. this.wrapT = e.wrapT,
  49648. this.magFilter = e.magFilter,
  49649. this.minFilter = e.minFilter,
  49650. this.anisotropy = e.anisotropy,
  49651. this.format = e.format,
  49652. this.type = e.type,
  49653. this.offset.copy(e.offset),
  49654. this.repeat.copy(e.repeat),
  49655. this.generateMipmaps = e.generateMipmaps,
  49656. this.premultiplyAlpha = e.premultiplyAlpha,
  49657. this.flipY = e.flipY,
  49658. this.unpackAlignment = e.unpackAlignment,
  49659. this.encoding = e.encoding,
  49660. this
  49661. },
  49662. toJSON: function(e) {
  49663. function t(e) {
  49664. var t;
  49665. return void 0 !== e.toDataURL ? t = e : (t = document.createElement("canvas"),
  49666. t.width = e.width,
  49667. t.height = e.height,
  49668. t.getContext("2d").drawImage(e, 0, 0, e.width, e.height)),
  49669. t.width > 2048 || t.height > 2048 ? t.toDataURL("image/jpeg", .6) : t.toDataURL("image/png")
  49670. }
  49671. if (void 0 !== e.textures[this.uuid])
  49672. return e.textures[this.uuid];
  49673. var i = {
  49674. metadata: {
  49675. version: 4.4,
  49676. type: "Texture",
  49677. generator: "Texture.toJSON"
  49678. },
  49679. uuid: this.uuid,
  49680. name: this.name,
  49681. mapping: this.mapping,
  49682. repeat: [this.repeat.x, this.repeat.y],
  49683. offset: [this.offset.x, this.offset.y],
  49684. wrap: [this.wrapS, this.wrapT],
  49685. minFilter: this.minFilter,
  49686. magFilter: this.magFilter,
  49687. anisotropy: this.anisotropy
  49688. };
  49689. if (void 0 !== this.image) {
  49690. var r = this.image;
  49691. void 0 === r.uuid && (r.uuid = n.Math.generateUUID()),
  49692. void 0 === e.images[r.uuid] && (e.images[r.uuid] = {
  49693. uuid: r.uuid,
  49694. url: t(r)
  49695. }),
  49696. i.image = r.uuid
  49697. }
  49698. return e.textures[this.uuid] = i,
  49699. i
  49700. },
  49701. dispose: function() {
  49702. this.dispatchEvent({
  49703. type: "dispose"
  49704. })
  49705. },
  49706. transformUv: function(e) {
  49707. if (this.mapping === n.UVMapping) {
  49708. if (e.multiply(this.repeat),
  49709. e.add(this.offset),
  49710. e.x < 0 || e.x > 1)
  49711. switch (this.wrapS) {
  49712. case n.RepeatWrapping:
  49713. e.x = e.x - Math.floor(e.x);
  49714. break;
  49715. case n.ClampToEdgeWrapping:
  49716. e.x = e.x < 0 ? 0 : 1;
  49717. break;
  49718. case n.MirroredRepeatWrapping:
  49719. 1 === Math.abs(Math.floor(e.x) % 2) ? e.x = Math.ceil(e.x) - e.x : e.x = e.x - Math.floor(e.x)
  49720. }
  49721. if (e.y < 0 || e.y > 1)
  49722. switch (this.wrapT) {
  49723. case n.RepeatWrapping:
  49724. e.y = e.y - Math.floor(e.y);
  49725. break;
  49726. case n.ClampToEdgeWrapping:
  49727. e.y = e.y < 0 ? 0 : 1;
  49728. break;
  49729. case n.MirroredRepeatWrapping:
  49730. 1 === Math.abs(Math.floor(e.y) % 2) ? e.y = Math.ceil(e.y) - e.y : e.y = e.y - Math.floor(e.y)
  49731. }
  49732. this.flipY && (e.y = 1 - e.y)
  49733. }
  49734. }
  49735. },
  49736. n.EventDispatcher.prototype.apply(n.Texture.prototype),
  49737. n.TextureIdCount = 0,
  49738. n.CanvasTexture = function(e, t, i, r, o, a, s, l, c) {
  49739. n.Texture.call(this, e, t, i, r, o, a, s, l, c),
  49740. this.needsUpdate = !0
  49741. }
  49742. ,
  49743. n.CanvasTexture.prototype = Object.create(n.Texture.prototype),
  49744. n.CanvasTexture.prototype.constructor = n.CanvasTexture,
  49745. n.CubeTexture = function(e, t, i, r, o, a, s, l, c) {
  49746. e = void 0 !== e ? e : [],
  49747. t = void 0 !== t ? t : n.CubeReflectionMapping,
  49748. n.Texture.call(this, e, t, i, r, o, a, s, l, c),
  49749. this.flipY = !1
  49750. }
  49751. ,
  49752. n.CubeTexture.prototype = Object.create(n.Texture.prototype),
  49753. n.CubeTexture.prototype.constructor = n.CubeTexture,
  49754. Object.defineProperty(n.CubeTexture.prototype, "images", {
  49755. get: function() {
  49756. return this.image
  49757. },
  49758. set: function(e) {
  49759. this.image = e
  49760. }
  49761. }),
  49762. n.CompressedTexture = function(e, t, i, r, o, a, s, l, c, h, u) {
  49763. n.Texture.call(this, null, a, s, l, c, h, r, o, u),
  49764. this.image = {
  49765. width: t,
  49766. height: i
  49767. },
  49768. this.mipmaps = e,
  49769. this.flipY = !1,
  49770. this.generateMipmaps = !1
  49771. }
  49772. ,
  49773. n.CompressedTexture.prototype = Object.create(n.Texture.prototype),
  49774. n.CompressedTexture.prototype.constructor = n.CompressedTexture,
  49775. n.DataTexture = function(e, t, i, r, o, a, s, l, c, h, u) {
  49776. n.Texture.call(this, null, a, s, l, c, h, r, o, u),
  49777. this.image = {
  49778. data: e,
  49779. width: t,
  49780. height: i
  49781. },
  49782. this.magFilter = void 0 !== c ? c : n.NearestFilter,
  49783. this.minFilter = void 0 !== h ? h : n.NearestFilter,
  49784. this.flipY = !1,
  49785. this.generateMipmaps = !1
  49786. }
  49787. ,
  49788. n.DataTexture.prototype = Object.create(n.Texture.prototype),
  49789. n.DataTexture.prototype.constructor = n.DataTexture,
  49790. n.VideoTexture = function(e, t, i, r, o, a, s, l, c) {
  49791. function h() {
  49792. requestAnimationFrame(h)
  49793. if( !e.paused && e.readyState === e.HAVE_ENOUGH_DATA){//改 add !e.paused
  49794. u.needsUpdate = !0
  49795. }
  49796. }
  49797. n.Texture.call(this, e, t, i, r, o, a, s, l, c),
  49798. this.generateMipmaps = !1;
  49799. var u = this;
  49800. h()
  49801. }
  49802. ,
  49803. n.VideoTexture.prototype = Object.create(n.Texture.prototype),
  49804. n.VideoTexture.prototype.constructor = n.VideoTexture,
  49805. n.Group = function() {
  49806. n.Object3D.call(this),
  49807. this.type = "Group"
  49808. }
  49809. ,
  49810. n.Group.prototype = Object.create(n.Object3D.prototype),
  49811. n.Group.prototype.constructor = n.Group,
  49812. n.Points = function(e, t) {
  49813. n.Object3D.call(this),
  49814. this.type = "Points",
  49815. this.geometry = void 0 !== e ? e : new n.Geometry,
  49816. this.material = void 0 !== t ? t : new n.PointsMaterial({
  49817. color: 16777215 * Math.random()
  49818. })
  49819. }
  49820. ,
  49821. n.Points.prototype = Object.create(n.Object3D.prototype),
  49822. n.Points.prototype.constructor = n.Points,
  49823. n.Points.prototype.raycast = function() {
  49824. var e = new n.Matrix4
  49825. , t = new n.Ray
  49826. , i = new n.Sphere;
  49827. return function(r, o) {
  49828. function a(e, i) {
  49829. var n = t.distanceSqToPoint(e);
  49830. if (n < d) {
  49831. var a = t.closestPointToPoint(e);
  49832. a.applyMatrix4(c);
  49833. var l = r.ray.origin.distanceTo(a);
  49834. if (l < r.near || l > r.far)
  49835. return;
  49836. o.push({
  49837. distance: l,
  49838. distanceToRay: Math.sqrt(n),
  49839. point: a.clone(),
  49840. index: i,
  49841. face: null,
  49842. object: s
  49843. })
  49844. }
  49845. }
  49846. var s = this
  49847. , l = this.geometry
  49848. , c = this.matrixWorld
  49849. , h = r.params.Points.threshold;
  49850. if (null === l.boundingSphere && l.computeBoundingSphere(),
  49851. i.copy(l.boundingSphere),
  49852. i.applyMatrix4(c),
  49853. r.ray.intersectsSphere(i) !== !1) {
  49854. e.getInverse(c),
  49855. t.copy(r.ray).applyMatrix4(e);
  49856. var u = h / ((this.scale.x + this.scale.y + this.scale.z) / 3)
  49857. , d = u * u
  49858. , p = new n.Vector3;
  49859. if (l instanceof n.BufferGeometry) {
  49860. var f = l.index
  49861. , g = l.attributes
  49862. , m = g.position.array;
  49863. if (null !== f)
  49864. for (var v = f.array, A = 0, y = v.length; A < y; A++) {
  49865. var C = v[A];
  49866. p.fromArray(m, 3 * C),
  49867. a(p, C)
  49868. }
  49869. else
  49870. for (var A = 0, I = m.length / 3; A < I; A++)
  49871. p.fromArray(m, 3 * A),
  49872. a(p, A)
  49873. } else
  49874. for (var E = l.vertices, A = 0, I = E.length; A < I; A++)
  49875. a(E[A], A)
  49876. }
  49877. }
  49878. }(),
  49879. n.Points.prototype.clone = function() {
  49880. return new this.constructor(this.geometry,this.material).copy(this)
  49881. }
  49882. ,
  49883. n.Line = function(e, t, i) {
  49884. return 1 === i ? (console.warn("THREE.Line: parameter THREE.LinePieces no longer supported. Created THREE.LineSegments instead."),
  49885. new n.LineSegments(e,t)) : (n.Object3D.call(this),
  49886. this.type = "Line",
  49887. this.geometry = void 0 !== e ? e : new n.Geometry,
  49888. void (this.material = void 0 !== t ? t : new n.LineBasicMaterial({
  49889. color: 16777215 * Math.random()
  49890. })))
  49891. }
  49892. ,
  49893. n.Line.prototype = Object.create(n.Object3D.prototype),
  49894. n.Line.prototype.constructor = n.Line,
  49895. n.Line.prototype.raycast = function() {
  49896. var e = new n.Matrix4
  49897. , t = new n.Ray
  49898. , i = new n.Sphere;
  49899. return function(r, o) {
  49900. var a = r.linePrecision
  49901. , s = a * a
  49902. , l = this.geometry
  49903. , c = this.matrixWorld;
  49904. if (null === l.boundingSphere && l.computeBoundingSphere(),
  49905. i.copy(l.boundingSphere),
  49906. i.applyMatrix4(c),
  49907. r.ray.intersectsSphere(i) !== !1) {
  49908. e.getInverse(c),
  49909. t.copy(r.ray).applyMatrix4(e);
  49910. var h = new n.Vector3
  49911. , u = new n.Vector3
  49912. , d = new n.Vector3
  49913. , p = new n.Vector3
  49914. , f = this instanceof n.LineSegments ? 2 : 1;
  49915. if (l instanceof n.BufferGeometry) {
  49916. var g = l.index
  49917. , m = l.attributes
  49918. , v = m.position.array;
  49919. if (null !== g)
  49920. for (var A = g.array, y = 0, C = A.length - 1; y < C; y += f) {
  49921. var I = A[y]
  49922. , E = A[y + 1];
  49923. h.fromArray(v, 3 * I),
  49924. u.fromArray(v, 3 * E);
  49925. var b = t.distanceSqToSegment(h, u, p, d);
  49926. if (!(b > s)) {
  49927. p.applyMatrix4(this.matrixWorld);
  49928. var w = r.ray.origin.distanceTo(p);
  49929. w < r.near || w > r.far || o.push({
  49930. distance: w,
  49931. point: d.clone().applyMatrix4(this.matrixWorld),
  49932. index: y,
  49933. face: null,
  49934. faceIndex: null,
  49935. object: this
  49936. })
  49937. }
  49938. }
  49939. else
  49940. for (var y = 0, C = v.length / 3 - 1; y < C; y += f) {
  49941. h.fromArray(v, 3 * y),
  49942. u.fromArray(v, 3 * y + 3);
  49943. var b = t.distanceSqToSegment(h, u, p, d);
  49944. if (!(b > s)) {
  49945. p.applyMatrix4(this.matrixWorld);
  49946. var w = r.ray.origin.distanceTo(p);
  49947. w < r.near || w > r.far || o.push({
  49948. distance: w,
  49949. point: d.clone().applyMatrix4(this.matrixWorld),
  49950. index: y,
  49951. face: null,
  49952. faceIndex: null,
  49953. object: this
  49954. })
  49955. }
  49956. }
  49957. } else if (l instanceof n.Geometry)
  49958. for (var _ = l.vertices, T = _.length, y = 0; y < T - 1; y += f) {
  49959. var b = t.distanceSqToSegment(_[y], _[y + 1], p, d);
  49960. if (!(b > s)) {
  49961. p.applyMatrix4(this.matrixWorld);
  49962. var w = r.ray.origin.distanceTo(p);
  49963. w < r.near || w > r.far || o.push({
  49964. distance: w,
  49965. point: d.clone().applyMatrix4(this.matrixWorld),
  49966. index: y,
  49967. face: null,
  49968. faceIndex: null,
  49969. object: this
  49970. })
  49971. }
  49972. }
  49973. }
  49974. }
  49975. }(),
  49976. n.Line.prototype.clone = function() {
  49977. return new this.constructor(this.geometry,this.material).copy(this)
  49978. }
  49979. ,
  49980. n.LineStrip = 0,
  49981. n.LinePieces = 1,
  49982. n.LineSegments = function(e, t) {
  49983. n.Line.call(this, e, t),
  49984. this.type = "LineSegments"
  49985. }
  49986. ,
  49987. n.LineSegments.prototype = Object.create(n.Line.prototype),
  49988. n.LineSegments.prototype.constructor = n.LineSegments,
  49989. n.Mesh = function(e, t) {
  49990. n.Object3D.call(this),
  49991. this.type = "Mesh",
  49992. this.geometry = void 0 !== e ? e : new n.Geometry,
  49993. this.material = void 0 !== t ? t : new n.MeshBasicMaterial({
  49994. color: 16777215 * Math.random()
  49995. }),
  49996. this.drawMode = n.TrianglesDrawMode,
  49997. this.updateMorphTargets()
  49998. }
  49999. ,
  50000. n.Mesh.prototype = Object.create(n.Object3D.prototype),
  50001. n.Mesh.prototype.constructor = n.Mesh,
  50002. n.Mesh.prototype.setDrawMode = function(e) {
  50003. this.drawMode = e
  50004. }
  50005. ,
  50006. n.Mesh.prototype.updateMorphTargets = function() {
  50007. if (void 0 !== this.geometry.morphTargets && this.geometry.morphTargets.length > 0) {
  50008. this.morphTargetBase = -1,
  50009. this.morphTargetInfluences = [],
  50010. this.morphTargetDictionary = {};
  50011. for (var e = 0, t = this.geometry.morphTargets.length; e < t; e++)
  50012. this.morphTargetInfluences.push(0),
  50013. this.morphTargetDictionary[this.geometry.morphTargets[e].name] = e
  50014. }
  50015. }
  50016. ,
  50017. n.Mesh.prototype.getMorphTargetIndexByName = function(e) {
  50018. return void 0 !== this.morphTargetDictionary[e] ? this.morphTargetDictionary[e] : (console.warn("THREE.Mesh.getMorphTargetIndexByName: morph target " + e + " does not exist. Returning 0."),
  50019. 0)
  50020. }
  50021. ,
  50022. n.Mesh.prototype.raycast = function() {
  50023. function e(e, t, i, r, o, a, s) {
  50024. return n.Triangle.barycoordFromPoint(e, t, i, r, m),
  50025. o.multiplyScalar(m.x),
  50026. a.multiplyScalar(m.y),
  50027. s.multiplyScalar(m.z),
  50028. o.add(a).add(s),
  50029. o.clone()
  50030. }
  50031. function t(e, t, i, r, o, a, s) {
  50032. var l, c = e.material;
  50033. if (l = c.side === n.BackSide ? i.intersectTriangle(a, o, r, !0, s) : i.intersectTriangle(r, o, a, c.side !== n.DoubleSide, s),
  50034. null === l)
  50035. return null;
  50036. A.copy(s),
  50037. A.applyMatrix4(e.matrixWorld);
  50038. var h = t.ray.origin.distanceTo(A);
  50039. return h < t.near || h > t.far ? null : {
  50040. distance: h,
  50041. point: A.clone(),
  50042. object: e
  50043. }
  50044. }
  50045. function i(i, r, o, a, h, u, d, m) {
  50046. s.fromArray(a, 3 * u),
  50047. l.fromArray(a, 3 * d),
  50048. c.fromArray(a, 3 * m);
  50049. var A = t(i, r, o, s, l, c, v);
  50050. return A && (h && (p.fromArray(h, 2 * u),
  50051. f.fromArray(h, 2 * d),
  50052. g.fromArray(h, 2 * m),
  50053. A.uv = e(v, s, l, c, p, f, g)),
  50054. A.face = new n.Face3(u,d,m,n.Triangle.normal(s, l, c)),
  50055. A.faceIndex = u),
  50056. A
  50057. }
  50058. var r = new n.Matrix4
  50059. , o = new n.Ray
  50060. , a = new n.Sphere
  50061. , s = new n.Vector3
  50062. , l = new n.Vector3
  50063. , c = new n.Vector3
  50064. , h = new n.Vector3
  50065. , u = new n.Vector3
  50066. , d = new n.Vector3
  50067. , p = new n.Vector2
  50068. , f = new n.Vector2
  50069. , g = new n.Vector2
  50070. , m = new n.Vector3
  50071. , v = new n.Vector3
  50072. , A = new n.Vector3;
  50073. return function(m, A) {
  50074. var y = this.geometry
  50075. , C = this.material
  50076. , I = this.matrixWorld;
  50077. if (void 0 !== C && (null === y.boundingSphere && y.computeBoundingSphere(),
  50078. a.copy(y.boundingSphere),
  50079. a.applyMatrix4(I),
  50080. m.ray.intersectsSphere(a) !== !1 && (r.getInverse(I),
  50081. o.copy(m.ray).applyMatrix4(r),
  50082. null === y.boundingBox || o.intersectsBox(y.boundingBox) !== !1))) {
  50083. var E, b;
  50084. if (y instanceof n.BufferGeometry) {
  50085. var w, _, T, x = y.index, S = y.attributes, M = S.position.array;
  50086. if (void 0 !== S.uv && (E = S.uv.array),
  50087. null !== x)
  50088. for (var R = x.array, P = 0, O = R.length; P < O; P += 3)
  50089. w = R[P],
  50090. _ = R[P + 1],
  50091. T = R[P + 2],
  50092. b = i(this, m, o, M, E, w, _, T),
  50093. b && (b.faceIndex = Math.floor(P / 3),
  50094. A.push(b));
  50095. else
  50096. for (var P = 0, O = M.length; P < O; P += 9)
  50097. w = P / 3,
  50098. _ = w + 1,
  50099. T = w + 2,
  50100. b = i(this, m, o, M, E, w, _, T),
  50101. b && (b.index = w,
  50102. A.push(b))
  50103. } else if (y instanceof n.Geometry) {
  50104. 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];
  50105. k.length > 0 && (E = k);
  50106. for (var H = 0, G = U.length; H < G; H++) {
  50107. var z = U[H]
  50108. , W = B === !0 ? F[z.materialIndex] : C;
  50109. if (void 0 !== W) {
  50110. if (L = V[z.a],
  50111. D = V[z.b],
  50112. N = V[z.c],
  50113. W.morphTargets === !0) {
  50114. var j = y.morphTargets
  50115. , Y = this.morphTargetInfluences;
  50116. s.set(0, 0, 0),
  50117. l.set(0, 0, 0),
  50118. c.set(0, 0, 0);
  50119. for (var X = 0, Z = j.length; X < Z; X++) {
  50120. var q = Y[X];
  50121. if (0 !== q) {
  50122. var K = j[X].vertices;
  50123. s.addScaledVector(h.subVectors(K[z.a], L), q),
  50124. l.addScaledVector(u.subVectors(K[z.b], D), q),
  50125. c.addScaledVector(d.subVectors(K[z.c], N), q)
  50126. }
  50127. }
  50128. s.add(L),
  50129. l.add(D),
  50130. c.add(N),
  50131. L = s,
  50132. D = l,
  50133. N = c
  50134. }
  50135. if (b = t(this, m, o, L, D, N, v)) {
  50136. if (E) {
  50137. var Q = E[H];
  50138. p.copy(Q[0]),
  50139. f.copy(Q[1]),
  50140. g.copy(Q[2]),
  50141. b.uv = e(v, L, D, N, p, f, g)
  50142. }
  50143. b.face = z,
  50144. b.faceIndex = H,
  50145. A.push(b)
  50146. }
  50147. }
  50148. }
  50149. }
  50150. }
  50151. }
  50152. }(),
  50153. n.Mesh.prototype.clone = function() {
  50154. return new this.constructor(this.geometry,this.material).copy(this)
  50155. }
  50156. ,
  50157. n.Bone = function(e) {
  50158. n.Object3D.call(this),
  50159. this.type = "Bone",
  50160. this.skin = e
  50161. }
  50162. ,
  50163. n.Bone.prototype = Object.create(n.Object3D.prototype),
  50164. n.Bone.prototype.constructor = n.Bone,
  50165. n.Bone.prototype.copy = function(e) {
  50166. return n.Object3D.prototype.copy.call(this, e),
  50167. this.skin = e.skin,
  50168. this
  50169. }
  50170. ,
  50171. n.Skeleton = function(e, t, i) {
  50172. if (this.useVertexTexture = void 0 === i || i,
  50173. this.identityMatrix = new n.Matrix4,
  50174. e = e || [],
  50175. this.bones = e.slice(0),
  50176. this.useVertexTexture) {
  50177. var r = Math.sqrt(4 * this.bones.length);
  50178. r = n.Math.nextPowerOfTwo(Math.ceil(r)),
  50179. r = Math.max(r, 4),
  50180. this.boneTextureWidth = r,
  50181. this.boneTextureHeight = r,
  50182. this.boneMatrices = new Float32Array(this.boneTextureWidth * this.boneTextureHeight * 4),
  50183. this.boneTexture = new n.DataTexture(this.boneMatrices,this.boneTextureWidth,this.boneTextureHeight,n.RGBAFormat,n.FloatType)
  50184. } else
  50185. this.boneMatrices = new Float32Array(16 * this.bones.length);
  50186. if (void 0 === t)
  50187. this.calculateInverses();
  50188. else if (this.bones.length === t.length)
  50189. this.boneInverses = t.slice(0);
  50190. else {
  50191. console.warn("THREE.Skeleton bonInverses is the wrong length."),
  50192. this.boneInverses = [];
  50193. for (var o = 0, a = this.bones.length; o < a; o++)
  50194. this.boneInverses.push(new n.Matrix4)
  50195. }
  50196. }
  50197. ,
  50198. n.Skeleton.prototype.calculateInverses = function() {
  50199. this.boneInverses = [];
  50200. for (var e = 0, t = this.bones.length; e < t; e++) {
  50201. var i = new n.Matrix4;
  50202. this.bones[e] && i.getInverse(this.bones[e].matrixWorld),
  50203. this.boneInverses.push(i)
  50204. }
  50205. }
  50206. ,
  50207. n.Skeleton.prototype.pose = function() {
  50208. for (var e, t = 0, i = this.bones.length; t < i; t++)
  50209. e = this.bones[t],
  50210. e && e.matrixWorld.getInverse(this.boneInverses[t]);
  50211. for (var t = 0, i = this.bones.length; t < i; t++)
  50212. e = this.bones[t],
  50213. e && (e.parent ? (e.matrix.getInverse(e.parent.matrixWorld),
  50214. e.matrix.multiply(e.matrixWorld)) : e.matrix.copy(e.matrixWorld),
  50215. e.matrix.decompose(e.position, e.quaternion, e.scale));
  50216. }
  50217. ,
  50218. n.Skeleton.prototype.update = function() {
  50219. var e = new n.Matrix4;
  50220. return function() {
  50221. for (var t = 0, i = this.bones.length; t < i; t++) {
  50222. var n = this.bones[t] ? this.bones[t].matrixWorld : this.identityMatrix;
  50223. e.multiplyMatrices(n, this.boneInverses[t]),
  50224. e.flattenToArrayOffset(this.boneMatrices, 16 * t)
  50225. }
  50226. this.useVertexTexture && (this.boneTexture.needsUpdate = !0)
  50227. }
  50228. }(),
  50229. n.Skeleton.prototype.clone = function() {
  50230. return new n.Skeleton(this.bones,this.boneInverses,this.useVertexTexture)
  50231. }
  50232. ,
  50233. n.SkinnedMesh = function(e, t, i) {
  50234. n.Mesh.call(this, e, t),
  50235. this.type = "SkinnedMesh",
  50236. this.bindMode = "attached",
  50237. this.bindMatrix = new n.Matrix4,
  50238. this.bindMatrixInverse = new n.Matrix4;
  50239. var r = [];
  50240. if (this.geometry && void 0 !== this.geometry.bones) {
  50241. for (var o, a, s = 0, l = this.geometry.bones.length; s < l; ++s)
  50242. a = this.geometry.bones[s],
  50243. o = new n.Bone(this),
  50244. r.push(o),
  50245. o.name = a.name,
  50246. o.position.fromArray(a.pos),
  50247. o.quaternion.fromArray(a.rotq),
  50248. void 0 !== a.scl && o.scale.fromArray(a.scl);
  50249. for (var s = 0, l = this.geometry.bones.length; s < l; ++s)
  50250. a = this.geometry.bones[s],
  50251. a.parent !== -1 && null !== a.parent ? r[a.parent].add(r[s]) : this.add(r[s])
  50252. }
  50253. this.normalizeSkinWeights(),
  50254. this.updateMatrixWorld(!0),
  50255. this.bind(new n.Skeleton(r,void 0,i), this.matrixWorld)
  50256. }
  50257. ,
  50258. n.SkinnedMesh.prototype = Object.create(n.Mesh.prototype),
  50259. n.SkinnedMesh.prototype.constructor = n.SkinnedMesh,
  50260. n.SkinnedMesh.prototype.bind = function(e, t) {
  50261. this.skeleton = e,
  50262. void 0 === t && (this.updateMatrixWorld(!0),
  50263. this.skeleton.calculateInverses(),
  50264. t = this.matrixWorld),
  50265. this.bindMatrix.copy(t),
  50266. this.bindMatrixInverse.getInverse(t)
  50267. }
  50268. ,
  50269. n.SkinnedMesh.prototype.pose = function() {
  50270. this.skeleton.pose()
  50271. }
  50272. ,
  50273. n.SkinnedMesh.prototype.normalizeSkinWeights = function() {
  50274. if (this.geometry instanceof n.Geometry)
  50275. for (var e = 0; e < this.geometry.skinWeights.length; e++) {
  50276. var t = this.geometry.skinWeights[e]
  50277. , i = 1 / t.lengthManhattan();
  50278. i !== 1 / 0 ? t.multiplyScalar(i) : t.set(1, 0, 0, 0)
  50279. }
  50280. else if (this.geometry instanceof n.BufferGeometry)
  50281. for (var r = new n.Vector4, o = this.geometry.attributes.skinWeight, e = 0; e < o.count; e++) {
  50282. r.x = o.getX(e),
  50283. r.y = o.getY(e),
  50284. r.z = o.getZ(e),
  50285. r.w = o.getW(e);
  50286. var i = 1 / r.lengthManhattan();
  50287. i !== 1 / 0 ? r.multiplyScalar(i) : r.set(1, 0, 0, 0),
  50288. o.setXYZW(e, r.x, r.y, r.z, r.w)
  50289. }
  50290. }
  50291. ,
  50292. n.SkinnedMesh.prototype.updateMatrixWorld = function(e) {
  50293. n.Mesh.prototype.updateMatrixWorld.call(this, !0),
  50294. "attached" === this.bindMode ? this.bindMatrixInverse.getInverse(this.matrixWorld) : "detached" === this.bindMode ? this.bindMatrixInverse.getInverse(this.bindMatrix) : console.warn("THREE.SkinnedMesh unrecognized bindMode: " + this.bindMode)
  50295. }
  50296. ,
  50297. n.SkinnedMesh.prototype.clone = function() {
  50298. return new this.constructor(this.geometry,this.material,this.useVertexTexture).copy(this)
  50299. }
  50300. ,
  50301. n.LOD = function() {
  50302. n.Object3D.call(this),
  50303. this.type = "LOD",
  50304. Object.defineProperties(this, {
  50305. levels: {
  50306. enumerable: !0,
  50307. value: []
  50308. },
  50309. objects: {
  50310. get: function() {
  50311. return console.warn("THREE.LOD: .objects has been renamed to .levels."),
  50312. this.levels
  50313. }
  50314. }
  50315. })
  50316. }
  50317. ,
  50318. n.LOD.prototype = Object.create(n.Object3D.prototype),
  50319. n.LOD.prototype.constructor = n.LOD,
  50320. n.LOD.prototype.addLevel = function(e, t) {
  50321. void 0 === t && (t = 0),
  50322. t = Math.abs(t);
  50323. for (var i = this.levels, n = 0; n < i.length && !(t < i[n].distance); n++)
  50324. ;
  50325. i.splice(n, 0, {
  50326. distance: t,
  50327. object: e
  50328. }),
  50329. this.add(e)
  50330. }
  50331. ,
  50332. n.LOD.prototype.getObjectForDistance = function(e) {
  50333. for (var t = this.levels, i = 1, n = t.length; i < n && !(e < t[i].distance); i++)
  50334. ;
  50335. return t[i - 1].object
  50336. }
  50337. ,
  50338. n.LOD.prototype.raycast = function() {
  50339. var e = new n.Vector3;
  50340. return function(t, i) {
  50341. e.setFromMatrixPosition(this.matrixWorld);
  50342. var n = t.ray.origin.distanceTo(e);
  50343. this.getObjectForDistance(n).raycast(t, i)
  50344. }
  50345. }(),
  50346. n.LOD.prototype.update = function() {
  50347. var e = new n.Vector3
  50348. , t = new n.Vector3;
  50349. return function(i) {
  50350. var n = this.levels;
  50351. if (n.length > 1) {
  50352. e.setFromMatrixPosition(i.matrixWorld),
  50353. t.setFromMatrixPosition(this.matrixWorld);
  50354. var r = e.distanceTo(t);
  50355. n[0].object.visible = !0;
  50356. for (var o = 1, a = n.length; o < a && r >= n[o].distance; o++)
  50357. n[o - 1].object.visible = !1,
  50358. n[o].object.visible = !0;
  50359. for (; o < a; o++)
  50360. n[o].object.visible = !1
  50361. }
  50362. }
  50363. }(),
  50364. n.LOD.prototype.copy = function(e) {
  50365. n.Object3D.prototype.copy.call(this, e, !1);
  50366. for (var t = e.levels, i = 0, r = t.length; i < r; i++) {
  50367. var o = t[i];
  50368. this.addLevel(o.object.clone(), o.distance)
  50369. }
  50370. return this
  50371. }
  50372. ,
  50373. n.LOD.prototype.toJSON = function(e) {
  50374. var t = n.Object3D.prototype.toJSON.call(this, e);
  50375. t.object.levels = [];
  50376. for (var i = this.levels, r = 0, o = i.length; r < o; r++) {
  50377. var a = i[r];
  50378. t.object.levels.push({
  50379. object: a.object.uuid,
  50380. distance: a.distance
  50381. })
  50382. }
  50383. return t
  50384. }
  50385. ,
  50386. n.Sprite = function() {
  50387. var e = new Uint16Array([0, 1, 2, 0, 2, 3])
  50388. , t = new Float32Array([-.5, -.5, 0, .5, -.5, 0, .5, .5, 0, -.5, .5, 0])
  50389. , i = new Float32Array([0, 0, 1, 0, 1, 1, 0, 1])
  50390. , r = new n.BufferGeometry;
  50391. return r.setIndex(new n.BufferAttribute(e,1)),
  50392. r.addAttribute("position", new n.BufferAttribute(t,3)),
  50393. r.addAttribute("uv", new n.BufferAttribute(i,2)),
  50394. function(e) {
  50395. n.Object3D.call(this),
  50396. this.type = "Sprite",
  50397. this.geometry = r,
  50398. this.material = void 0 !== e ? e : new n.SpriteMaterial
  50399. }
  50400. }(),
  50401. n.Sprite.prototype = Object.create(n.Object3D.prototype),
  50402. n.Sprite.prototype.constructor = n.Sprite,
  50403. n.Sprite.prototype.raycast = function() {
  50404. var e = new n.Vector3;
  50405. return function(t, i) {
  50406. e.setFromMatrixPosition(this.matrixWorld);
  50407. var n = t.ray.distanceSqToPoint(e)
  50408. , r = this.scale.x * this.scale.y;
  50409. n > r || i.push({
  50410. distance: Math.sqrt(n),
  50411. point: this.position,
  50412. face: null,
  50413. object: this
  50414. })
  50415. }
  50416. }(),
  50417. n.Sprite.prototype.clone = function() {
  50418. return new this.constructor(this.material).copy(this)
  50419. }
  50420. ,
  50421. n.Particle = n.Sprite,
  50422. n.LensFlare = function(e, t, i, r, o) {
  50423. n.Object3D.call(this),
  50424. this.lensFlares = [],
  50425. this.positionScreen = new n.Vector3,
  50426. this.customUpdateCallback = void 0,
  50427. void 0 !== e && this.add(e, t, i, r, o)
  50428. }
  50429. ,
  50430. n.LensFlare.prototype = Object.create(n.Object3D.prototype),
  50431. n.LensFlare.prototype.constructor = n.LensFlare,
  50432. n.LensFlare.prototype.add = function(e, t, i, r, o, a) {
  50433. void 0 === t && (t = -1),
  50434. void 0 === i && (i = 0),
  50435. void 0 === a && (a = 1),
  50436. void 0 === o && (o = new n.Color(16777215)),
  50437. void 0 === r && (r = n.NormalBlending),
  50438. i = Math.min(i, Math.max(0, i)),
  50439. this.lensFlares.push({
  50440. texture: e,
  50441. size: t,
  50442. distance: i,
  50443. x: 0,
  50444. y: 0,
  50445. z: 0,
  50446. scale: 1,
  50447. rotation: 0,
  50448. opacity: a,
  50449. color: o,
  50450. blending: r
  50451. })
  50452. }
  50453. ,
  50454. n.LensFlare.prototype.updateLensFlares = function() {
  50455. var e, t, i = this.lensFlares.length, n = 2 * -this.positionScreen.x, r = 2 * -this.positionScreen.y;
  50456. for (e = 0; e < i; e++)
  50457. t = this.lensFlares[e],
  50458. t.x = this.positionScreen.x + n * t.distance,
  50459. t.y = this.positionScreen.y + r * t.distance,
  50460. t.wantedRotation = t.x * Math.PI * .25,
  50461. t.rotation += .25 * (t.wantedRotation - t.rotation)
  50462. }
  50463. ,
  50464. n.LensFlare.prototype.copy = function(e) {
  50465. n.Object3D.prototype.copy.call(this, e),
  50466. this.positionScreen.copy(e.positionScreen),
  50467. this.customUpdateCallback = e.customUpdateCallback;
  50468. for (var t = 0, i = e.lensFlares.length; t < i; t++)
  50469. this.lensFlares.push(e.lensFlares[t]);
  50470. return this
  50471. }
  50472. ,
  50473. n.Scene = function() {
  50474. n.Object3D.call(this),
  50475. this.type = "Scene",
  50476. this.fog = null,
  50477. this.overrideMaterial = null,
  50478. this.autoUpdate = !0
  50479. }
  50480. ,
  50481. n.Scene.prototype = Object.create(n.Object3D.prototype),
  50482. n.Scene.prototype.constructor = n.Scene,
  50483. n.Scene.prototype.copy = function(e, t) {
  50484. return n.Object3D.prototype.copy.call(this, e, t),
  50485. null !== e.fog && (this.fog = e.fog.clone()),
  50486. null !== e.overrideMaterial && (this.overrideMaterial = e.overrideMaterial.clone()),
  50487. this.autoUpdate = e.autoUpdate,
  50488. this.matrixAutoUpdate = e.matrixAutoUpdate,
  50489. this
  50490. }
  50491. ,
  50492. n.Fog = function(e, t, i) {
  50493. this.name = "",
  50494. this.color = new n.Color(e),
  50495. this.near = void 0 !== t ? t : 1,
  50496. this.far = void 0 !== i ? i : 1e3
  50497. }
  50498. ,
  50499. n.Fog.prototype.clone = function() {
  50500. return new n.Fog(this.color.getHex(),this.near,this.far)
  50501. }
  50502. ,
  50503. n.FogExp2 = function(e, t) {
  50504. this.name = "",
  50505. this.color = new n.Color(e),
  50506. this.density = void 0 !== t ? t : 25e-5
  50507. }
  50508. ,
  50509. n.FogExp2.prototype.clone = function() {
  50510. return new n.FogExp2(this.color.getHex(),this.density)
  50511. }
  50512. ,
  50513. n.ShaderChunk = {},
  50514. n.ShaderChunk.alphamap_fragment = "#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif\n",
  50515. n.ShaderChunk.alphamap_pars_fragment = "#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif\n",
  50516. n.ShaderChunk.alphatest_fragment = "#ifdef ALPHATEST\n\tif ( diffuseColor.a < ALPHATEST ) discard;\n#endif\n",
  50517. 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",
  50518. n.ShaderChunk.aomap_pars_fragment = "#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",
  50519. n.ShaderChunk.begin_vertex = "\nvec3 transformed = vec3( position );\n",
  50520. n.ShaderChunk.beginnormal_vertex = "\nvec3 objectNormal = vec3( normal );\n",
  50521. 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",
  50522. 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",
  50523. n.ShaderChunk.color_fragment = "#ifdef USE_COLOR\n\tdiffuseColor.rgb *= vColor;\n#endif",
  50524. n.ShaderChunk.color_pars_fragment = "#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif\n",
  50525. n.ShaderChunk.color_pars_vertex = "#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",
  50526. n.ShaderChunk.color_vertex = "#ifdef USE_COLOR\n\tvColor.xyz = color.xyz;\n#endif",
  50527. 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",
  50528. 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",
  50529. n.ShaderChunk.defaultnormal_vertex = "#ifdef FLIP_SIDED\n\tobjectNormal = -objectNormal;\n#endif\nvec3 transformedNormal = normalMatrix * objectNormal;\n",
  50530. n.ShaderChunk.displacementmap_vertex = "#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normal * ( texture2D( displacementMap, uv ).x * displacementScale + displacementBias );\n#endif\n",
  50531. n.ShaderChunk.displacementmap_pars_vertex = "#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif\n",
  50532. 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",
  50533. n.ShaderChunk.emissivemap_pars_fragment = "#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif\n",
  50534. 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",
  50535. n.ShaderChunk.encodings_fragment = " gl_FragColor = linearToOutputTexel( gl_FragColor );\n",
  50536. 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",
  50537. 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",
  50538. 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",
  50539. 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",
  50540. 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",
  50541. 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",
  50542. n.ShaderChunk.lightmap_fragment = "#ifdef USE_LIGHTMAP\n\treflectedLight.indirectDiffuse += PI * texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n#endif\n",
  50543. n.ShaderChunk.lightmap_pars_fragment = "#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",
  50544. 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",
  50545. 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",
  50546. n.ShaderChunk.lights_phong_fragment = "BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;\n",
  50547. 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",
  50548. n.ShaderChunk.lights_phong_pars_vertex = "#ifdef USE_ENVMAP\n\tvarying vec3 vWorldPosition;\n#endif\n",
  50549. n.ShaderChunk.lights_phong_vertex = "#ifdef USE_ENVMAP\n\tvWorldPosition = worldPosition.xyz;\n#endif\n",
  50550. 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",
  50551. 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",
  50552. 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",
  50553. n.ShaderChunk.logdepthbuf_fragment = "#if defined(USE_LOGDEPTHBUF) && defined(USE_LOGDEPTHBUF_EXT)\n\tgl_FragDepthEXT = log2(vFragDepth) * logDepthBufFC * 0.5;\n#endif",
  50554. 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",
  50555. 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",
  50556. 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",
  50557. n.ShaderChunk.map_fragment = "#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif\n",
  50558. n.ShaderChunk.map_pars_fragment = "#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n",
  50559. 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",
  50560. n.ShaderChunk.map_particle_pars_fragment = "#ifdef USE_MAP\n\tuniform vec4 offsetRepeat;\n\tuniform sampler2D map;\n#endif\n",
  50561. n.ShaderChunk.metalnessmap_fragment = "float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.r;\n#endif\n",
  50562. n.ShaderChunk.metalnessmap_pars_fragment = "#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",
  50563. 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",
  50564. 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";
  50565. 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";
  50566. 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",
  50567. 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",
  50568. n.ShaderChunk.premultiplied_alpha_fragment = "#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif\n",
  50569. 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",
  50570. n.ShaderChunk.roughnessmap_fragment = "float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.r;\n#endif\n",
  50571. n.ShaderChunk.roughnessmap_pars_fragment = "#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",
  50572. 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",
  50573. 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",
  50574. 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",
  50575. 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",
  50576. 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",
  50577. 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",
  50578. 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",
  50579. 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",
  50580. 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",
  50581. n.ShaderChunk.specularmap_pars_fragment = "#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",
  50582. n.ShaderChunk.tonemapping_fragment = "#if defined( TONE_MAPPING )\n gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif\n",
  50583. 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",
  50584. n.ShaderChunk.uv2_pars_fragment = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif",
  50585. n.ShaderChunk.uv2_pars_vertex = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n#endif",
  50586. n.ShaderChunk.uv2_vertex = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = uv2;\n#endif",
  50587. 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",
  50588. 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",
  50589. 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",
  50590. 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",
  50591. n.UniformsUtils = {
  50592. merge: function(e) {
  50593. for (var t = {}, i = 0; i < e.length; i++) {
  50594. var n = this.clone(e[i]);
  50595. for (var r in n)
  50596. t[r] = n[r]
  50597. }
  50598. return t
  50599. },
  50600. clone: function(e) {
  50601. var t = {};
  50602. for (var i in e) {
  50603. t[i] = {};
  50604. for (var r in e[i]) {
  50605. var o = e[i][r];
  50606. 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
  50607. }
  50608. }
  50609. return t
  50610. }
  50611. },
  50612. n.UniformsLib = {
  50613. common: {
  50614. diffuse: {
  50615. type: "c",
  50616. value: new n.Color(15658734)
  50617. },
  50618. opacity: {
  50619. type: "f",
  50620. value: 1
  50621. },
  50622. map: {
  50623. type: "t",
  50624. value: null
  50625. },
  50626. offsetRepeat: {
  50627. type: "v4",
  50628. value: new n.Vector4(0,0,1,1)
  50629. },
  50630. specularMap: {
  50631. type: "t",
  50632. value: null
  50633. },
  50634. alphaMap: {
  50635. type: "t",
  50636. value: null
  50637. },
  50638. envMap: {
  50639. type: "t",
  50640. value: null
  50641. },
  50642. flipEnvMap: {
  50643. type: "f",
  50644. value: -1
  50645. },
  50646. reflectivity: {
  50647. type: "f",
  50648. value: 1
  50649. },
  50650. refractionRatio: {
  50651. type: "f",
  50652. value: .98
  50653. }
  50654. },
  50655. aomap: {
  50656. aoMap: {
  50657. type: "t",
  50658. value: null
  50659. },
  50660. aoMapIntensity: {
  50661. type: "f",
  50662. value: 1
  50663. }
  50664. },
  50665. lightmap: {
  50666. lightMap: {
  50667. type: "t",
  50668. value: null
  50669. },
  50670. lightMapIntensity: {
  50671. type: "f",
  50672. value: 1
  50673. }
  50674. },
  50675. emissivemap: {
  50676. emissiveMap: {
  50677. type: "t",
  50678. value: null
  50679. }
  50680. },
  50681. bumpmap: {
  50682. bumpMap: {
  50683. type: "t",
  50684. value: null
  50685. },
  50686. bumpScale: {
  50687. type: "f",
  50688. value: 1
  50689. }
  50690. },
  50691. normalmap: {
  50692. normalMap: {
  50693. type: "t",
  50694. value: null
  50695. },
  50696. normalScale: {
  50697. type: "v2",
  50698. value: new n.Vector2(1,1)
  50699. }
  50700. },
  50701. displacementmap: {
  50702. displacementMap: {
  50703. type: "t",
  50704. value: null
  50705. },
  50706. displacementScale: {
  50707. type: "f",
  50708. value: 1
  50709. },
  50710. displacementBias: {
  50711. type: "f",
  50712. value: 0
  50713. }
  50714. },
  50715. roughnessmap: {
  50716. roughnessMap: {
  50717. type: "t",
  50718. value: null
  50719. }
  50720. },
  50721. metalnessmap: {
  50722. metalnessMap: {
  50723. type: "t",
  50724. value: null
  50725. }
  50726. },
  50727. fog: {
  50728. fogDensity: {
  50729. type: "f",
  50730. value: 25e-5
  50731. },
  50732. fogNear: {
  50733. type: "f",
  50734. value: 1
  50735. },
  50736. fogFar: {
  50737. type: "f",
  50738. value: 2e3
  50739. },
  50740. fogColor: {
  50741. type: "c",
  50742. value: new n.Color(16777215)
  50743. }
  50744. },
  50745. lights: {
  50746. ambientLightColor: {
  50747. type: "fv",
  50748. value: []
  50749. },
  50750. directionalLights: {
  50751. type: "sa",
  50752. value: [],
  50753. properties: {
  50754. direction: {
  50755. type: "v3"
  50756. },
  50757. color: {
  50758. type: "c"
  50759. },
  50760. shadow: {
  50761. type: "i"
  50762. },
  50763. shadowBias: {
  50764. type: "f"
  50765. },
  50766. shadowRadius: {
  50767. type: "f"
  50768. },
  50769. shadowMapSize: {
  50770. type: "v2"
  50771. }
  50772. }
  50773. },
  50774. directionalShadowMap: {
  50775. type: "tv",
  50776. value: []
  50777. },
  50778. directionalShadowMatrix: {
  50779. type: "m4v",
  50780. value: []
  50781. },
  50782. spotLights: {
  50783. type: "sa",
  50784. value: [],
  50785. properties: {
  50786. color: {
  50787. type: "c"
  50788. },
  50789. position: {
  50790. type: "v3"
  50791. },
  50792. direction: {
  50793. type: "v3"
  50794. },
  50795. distance: {
  50796. type: "f"
  50797. },
  50798. coneCos: {
  50799. type: "f"
  50800. },
  50801. penumbraCos: {
  50802. type: "f"
  50803. },
  50804. decay: {
  50805. type: "f"
  50806. },
  50807. shadow: {
  50808. type: "i"
  50809. },
  50810. shadowBias: {
  50811. type: "f"
  50812. },
  50813. shadowRadius: {
  50814. type: "f"
  50815. },
  50816. shadowMapSize: {
  50817. type: "v2"
  50818. }
  50819. }
  50820. },
  50821. spotShadowMap: {
  50822. type: "tv",
  50823. value: []
  50824. },
  50825. spotShadowMatrix: {
  50826. type: "m4v",
  50827. value: []
  50828. },
  50829. pointLights: {
  50830. type: "sa",
  50831. value: [],
  50832. properties: {
  50833. color: {
  50834. type: "c"
  50835. },
  50836. position: {
  50837. type: "v3"
  50838. },
  50839. decay: {
  50840. type: "f"
  50841. },
  50842. distance: {
  50843. type: "f"
  50844. },
  50845. shadow: {
  50846. type: "i"
  50847. },
  50848. shadowBias: {
  50849. type: "f"
  50850. },
  50851. shadowRadius: {
  50852. type: "f"
  50853. },
  50854. shadowMapSize: {
  50855. type: "v2"
  50856. }
  50857. }
  50858. },
  50859. pointShadowMap: {
  50860. type: "tv",
  50861. value: []
  50862. },
  50863. pointShadowMatrix: {
  50864. type: "m4v",
  50865. value: []
  50866. },
  50867. hemisphereLights: {
  50868. type: "sa",
  50869. value: [],
  50870. properties: {
  50871. direction: {
  50872. type: "v3"
  50873. },
  50874. skyColor: {
  50875. type: "c"
  50876. },
  50877. groundColor: {
  50878. type: "c"
  50879. }
  50880. }
  50881. }
  50882. },
  50883. points: {
  50884. diffuse: {
  50885. type: "c",
  50886. value: new n.Color(15658734)
  50887. },
  50888. opacity: {
  50889. type: "f",
  50890. value: 1
  50891. },
  50892. size: {
  50893. type: "f",
  50894. value: 1
  50895. },
  50896. scale: {
  50897. type: "f",
  50898. value: 1
  50899. },
  50900. map: {
  50901. type: "t",
  50902. value: null
  50903. },
  50904. offsetRepeat: {
  50905. type: "v4",
  50906. value: new n.Vector4(0,0,1,1)
  50907. }
  50908. }
  50909. },
  50910. 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",
  50911. 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",
  50912. 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",
  50913. 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",
  50914. 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",
  50915. 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",
  50916. 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",
  50917. 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",
  50918. 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",
  50919. 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",
  50920. 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",
  50921. 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",
  50922. 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",
  50923. 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",
  50924. 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",
  50925. 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",
  50926. 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",
  50927. 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",
  50928. 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",
  50929. 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",
  50930. 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",
  50931. 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",
  50932. 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",
  50933. 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",
  50934. n.ShaderLib = {
  50935. basic: {
  50936. uniforms: n.UniformsUtils.merge([n.UniformsLib.common, n.UniformsLib.aomap, n.UniformsLib.fog]),
  50937. vertexShader: n.ShaderChunk.meshbasic_vert,
  50938. fragmentShader: n.ShaderChunk.meshbasic_frag
  50939. },
  50940. lambert: {
  50941. uniforms: n.UniformsUtils.merge([n.UniformsLib.common, n.UniformsLib.aomap, n.UniformsLib.lightmap, n.UniformsLib.emissivemap, n.UniformsLib.fog, n.UniformsLib.lights, {
  50942. emissive: {
  50943. type: "c",
  50944. value: new n.Color(0)
  50945. }
  50946. }]),
  50947. vertexShader: n.ShaderChunk.meshlambert_vert,
  50948. fragmentShader: n.ShaderChunk.meshlambert_frag
  50949. },
  50950. phong: {
  50951. 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, {
  50952. emissive: {
  50953. type: "c",
  50954. value: new n.Color(0)
  50955. },
  50956. specular: {
  50957. type: "c",
  50958. value: new n.Color(1118481)
  50959. },
  50960. shininess: {
  50961. type: "f",
  50962. value: 30
  50963. }
  50964. }]),
  50965. vertexShader: n.ShaderChunk.meshphong_vert,
  50966. fragmentShader: n.ShaderChunk.meshphong_frag
  50967. },
  50968. standard: {
  50969. 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, {
  50970. emissive: {
  50971. type: "c",
  50972. value: new n.Color(0)
  50973. },
  50974. roughness: {
  50975. type: "f",
  50976. value: .5
  50977. },
  50978. metalness: {
  50979. type: "f",
  50980. value: 0
  50981. },
  50982. envMapIntensity: {
  50983. type: "f",
  50984. value: 1
  50985. }
  50986. }]),
  50987. vertexShader: n.ShaderChunk.meshstandard_vert,
  50988. fragmentShader: n.ShaderChunk.meshstandard_frag
  50989. },
  50990. points: {
  50991. uniforms: n.UniformsUtils.merge([n.UniformsLib.points, n.UniformsLib.fog]),
  50992. vertexShader: n.ShaderChunk.points_vert,
  50993. fragmentShader: n.ShaderChunk.points_frag
  50994. },
  50995. dashed: {
  50996. uniforms: n.UniformsUtils.merge([n.UniformsLib.common, n.UniformsLib.fog, {
  50997. scale: {
  50998. type: "f",
  50999. value: 1
  51000. },
  51001. dashSize: {
  51002. type: "f",
  51003. value: 1
  51004. },
  51005. totalSize: {
  51006. type: "f",
  51007. value: 2
  51008. }
  51009. }]),
  51010. vertexShader: n.ShaderChunk.linedashed_vert,
  51011. fragmentShader: n.ShaderChunk.linedashed_frag
  51012. },
  51013. depth: {
  51014. uniforms: {
  51015. mNear: {
  51016. type: "f",
  51017. value: 1
  51018. },
  51019. mFar: {
  51020. type: "f",
  51021. value: 2e3
  51022. },
  51023. opacity: {
  51024. type: "f",
  51025. value: 1
  51026. }
  51027. },
  51028. vertexShader: n.ShaderChunk.depth_vert,
  51029. fragmentShader: n.ShaderChunk.depth_frag
  51030. },
  51031. normal: {
  51032. uniforms: {
  51033. opacity: {
  51034. type: "f",
  51035. value: 1
  51036. }
  51037. },
  51038. vertexShader: n.ShaderChunk.normal_vert,
  51039. fragmentShader: n.ShaderChunk.normal_frag
  51040. },
  51041. cube: {
  51042. uniforms: {
  51043. tCube: {
  51044. type: "t",
  51045. value: null
  51046. },
  51047. tFlip: {
  51048. type: "f",
  51049. value: -1
  51050. }
  51051. },
  51052. vertexShader: n.ShaderChunk.cube_vert,
  51053. fragmentShader: n.ShaderChunk.cube_frag
  51054. },
  51055. equirect: {
  51056. uniforms: {
  51057. tEquirect: {
  51058. type: "t",
  51059. value: null
  51060. },
  51061. tFlip: {
  51062. type: "f",
  51063. value: -1
  51064. }
  51065. },
  51066. vertexShader: n.ShaderChunk.equirect_vert,
  51067. fragmentShader: n.ShaderChunk.equirect_frag
  51068. },
  51069. depthRGBA: {
  51070. uniforms: {},
  51071. vertexShader: n.ShaderChunk.depthRGBA_vert,
  51072. fragmentShader: n.ShaderChunk.depthRGBA_frag
  51073. },
  51074. distanceRGBA: {
  51075. uniforms: {
  51076. lightPos: {
  51077. type: "v3",
  51078. value: new n.Vector3(0,0,0)
  51079. }
  51080. },
  51081. vertexShader: n.ShaderChunk.distanceRGBA_vert,
  51082. fragmentShader: n.ShaderChunk.distanceRGBA_frag
  51083. }
  51084. },
  51085. n.WebGLRenderer = function(e) {
  51086. function t() {
  51087. return null === ye ? Oe : 1
  51088. }
  51089. function i(e, t, i, n) {
  51090. se === !0 && (e *= n,
  51091. t *= n,
  51092. i *= n),
  51093. Ye.clearColor(e, t, i, n)
  51094. }
  51095. function r() {
  51096. Ye.init(),
  51097. Ye.scissor(we.copy(Le).multiplyScalar(Oe)),
  51098. Ye.viewport(Te.copy(Ne).multiplyScalar(Oe)),
  51099. i(Se.r, Se.g, Se.b, Me)
  51100. }
  51101. function o() {
  51102. Ae = null,
  51103. be = null,
  51104. Ee = "",
  51105. Ie = -1,
  51106. Ye.reset()
  51107. }
  51108. function a(e) {
  51109. e.preventDefault(),
  51110. o(),
  51111. r(),
  51112. Xe.clear()
  51113. }
  51114. function s(e) {
  51115. var t = e.target;
  51116. t.removeEventListener("dispose", s),
  51117. h(t),
  51118. ke.textures--
  51119. }
  51120. function l(e) {
  51121. var t = e.target;
  51122. t.removeEventListener("dispose", l),
  51123. u(t),
  51124. ke.textures--
  51125. }
  51126. function c(e) {
  51127. var t = e.target;
  51128. t.removeEventListener("dispose", c),
  51129. d(t)
  51130. }
  51131. function h(e) {
  51132. var t = Xe.get(e);
  51133. if (e.image && t.__image__webglTextureCube)
  51134. Ge.deleteTexture(t.__image__webglTextureCube);
  51135. else {
  51136. if (void 0 === t.__webglInit)
  51137. return;
  51138. Ge.deleteTexture(t.__webglTexture)
  51139. }
  51140. Xe.delete(e)
  51141. }
  51142. function u(e) {
  51143. var t = Xe.get(e)
  51144. , i = Xe.get(e.texture);
  51145. if (e && void 0 !== i.__webglTexture) {
  51146. if (Ge.deleteTexture(i.__webglTexture),
  51147. e instanceof n.WebGLRenderTargetCube)
  51148. for (var r = 0; r < 6; r++)
  51149. Ge.deleteFramebuffer(t.__webglFramebuffer[r]),
  51150. Ge.deleteRenderbuffer(t.__webglDepthbuffer[r]);
  51151. else
  51152. Ge.deleteFramebuffer(t.__webglFramebuffer),
  51153. Ge.deleteRenderbuffer(t.__webglDepthbuffer);
  51154. Xe.delete(e.texture),
  51155. Xe.delete(e)
  51156. }
  51157. }
  51158. function d(e) {
  51159. p(e),
  51160. Xe.delete(e)
  51161. }
  51162. function p(e) {
  51163. var t = Xe.get(e).program;
  51164. e.program = void 0,
  51165. void 0 !== t && qe.releaseProgram(t)
  51166. }
  51167. function f(e, t, i, r) {
  51168. var o;
  51169. if (i instanceof n.InstancedBufferGeometry && (o = We.get("ANGLE_instanced_arrays"),
  51170. null === o))
  51171. return void console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");
  51172. void 0 === r && (r = 0),
  51173. Ye.initAttributes();
  51174. var a = i.attributes
  51175. , s = t.getAttributes()
  51176. , l = e.defaultAttributeValues;
  51177. for (var c in s) {
  51178. var h = s[c];
  51179. if (h >= 0) {
  51180. var u = a[c];
  51181. if (void 0 !== u) {
  51182. var d = u.itemSize
  51183. , p = Ze.getAttributeBuffer(u);
  51184. if (u instanceof n.InterleavedBufferAttribute) {
  51185. var f = u.data
  51186. , g = f.stride
  51187. , m = u.offset;
  51188. f instanceof n.InstancedInterleavedBuffer ? (Ye.enableAttributeAndDivisor(h, f.meshPerAttribute, o),
  51189. void 0 === i.maxInstancedCount && (i.maxInstancedCount = f.meshPerAttribute * f.count)) : Ye.enableAttribute(h),
  51190. Ge.bindBuffer(Ge.ARRAY_BUFFER, p),
  51191. Ge.vertexAttribPointer(h, d, Ge.FLOAT, !1, g * f.array.BYTES_PER_ELEMENT, (r * g + m) * f.array.BYTES_PER_ELEMENT)
  51192. } else
  51193. u instanceof n.InstancedBufferAttribute ? (Ye.enableAttributeAndDivisor(h, u.meshPerAttribute, o),
  51194. void 0 === i.maxInstancedCount && (i.maxInstancedCount = u.meshPerAttribute * u.count)) : Ye.enableAttribute(h),
  51195. Ge.bindBuffer(Ge.ARRAY_BUFFER, p),
  51196. Ge.vertexAttribPointer(h, d, Ge.FLOAT, !1, 0, r * d * 4)
  51197. } else if (void 0 !== l) {
  51198. var v = l[c];
  51199. if (void 0 !== v)
  51200. switch (v.length) {
  51201. case 2:
  51202. Ge.vertexAttrib2fv(h, v);
  51203. break;
  51204. case 3:
  51205. Ge.vertexAttrib3fv(h, v);
  51206. break;
  51207. case 4:
  51208. Ge.vertexAttrib4fv(h, v);
  51209. break;
  51210. default:
  51211. Ge.vertexAttrib1fv(h, v)
  51212. }
  51213. }
  51214. }
  51215. }
  51216. Ye.disableUnusedAttributes()
  51217. }
  51218. function g(e, t) {
  51219. return Math.abs(t[0]) - Math.abs(e[0])
  51220. }
  51221. function m(e, t) {
  51222. 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
  51223. }
  51224. function v(e, t) {
  51225. 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
  51226. }
  51227. function A(e, t, i, n, r) {
  51228. var o, a;
  51229. i.transparent ? (o = de,
  51230. a = ++pe) : (o = he,
  51231. a = ++ue);
  51232. var s = o[a];
  51233. void 0 !== s ? (s.id = e.id,
  51234. s.object = e,
  51235. s.geometry = t,
  51236. s.material = i,
  51237. s.z = Ve.z,
  51238. s.group = r) : (s = {
  51239. id: e.id,
  51240. object: e,
  51241. geometry: t,
  51242. material: i,
  51243. z: Ve.z,
  51244. group: r
  51245. },
  51246. o.push(s))
  51247. }
  51248. function y(e, t) {
  51249. if (e.visible !== !1) {
  51250. if (e.layers.test(t.layers))
  51251. if (e instanceof n.Light)
  51252. ce.push(e);
  51253. else if (e instanceof n.Sprite)
  51254. e.frustumCulled !== !1 && Be.intersectsObject(e) !== !0 || ge.push(e);
  51255. else if (e instanceof n.LensFlare)
  51256. me.push(e);
  51257. else if (e instanceof n.ImmediateRenderObject)
  51258. ve.sortObjects === !0 && (Ve.setFromMatrixPosition(e.matrixWorld),
  51259. Ve.applyProjection(Fe)),
  51260. A(e, null, e.material, Ve.z, null);
  51261. else if ((e instanceof n.Mesh || e instanceof n.Line || e instanceof n.Points) && (e instanceof n.SkinnedMesh && e.skeleton.update(),
  51262. e.frustumCulled === !1 || Be.intersectsObject(e) === !0)) {
  51263. var i = e.material;
  51264. if (i.visible === !0) {
  51265. ve.sortObjects === !0 && (Ve.setFromMatrixPosition(e.matrixWorld),
  51266. Ve.applyProjection(Fe));
  51267. var r = Ze.update(e);
  51268. if (i instanceof n.MultiMaterial)
  51269. for (var o = r.groups, a = i.materials, s = 0, l = o.length; s < l; s++) {
  51270. var c = o[s]
  51271. , h = a[c.materialIndex];
  51272. h.visible === !0 && A(e, r, h, Ve.z, c)
  51273. }
  51274. else
  51275. A(e, r, i, Ve.z, null)
  51276. }
  51277. }
  51278. for (var u = e.children, s = 0, l = u.length; s < l; s++)
  51279. y(u[s], t)
  51280. }
  51281. }
  51282. function C(e, t, i, r) {
  51283. for (var o = 0, a = e.length; o < a; o++) {
  51284. var s = e[o]
  51285. , l = s.object
  51286. , c = s.geometry
  51287. , h = void 0 === r ? s.material : r
  51288. , u = s.group;
  51289. if (l.modelViewMatrix.multiplyMatrices(t.matrixWorldInverse, l.matrixWorld),
  51290. l.normalMatrix.getNormalMatrix(l.modelViewMatrix),
  51291. l instanceof n.ImmediateRenderObject) {
  51292. E(h);
  51293. var d = w(t, i, h, l);
  51294. Ee = "",
  51295. l.render(function(e) {
  51296. ve.renderBufferImmediate(e, d, h)
  51297. })
  51298. } else
  51299. ve.renderBufferDirect(t, i, c, h, l, u)
  51300. }
  51301. }
  51302. function I(e, t, i) {
  51303. var r = Xe.get(e)
  51304. , o = qe.getParameters(e, Ue, t, i)
  51305. , a = qe.getProgramCode(e, o)
  51306. , s = r.program
  51307. , l = !0;
  51308. if (void 0 === s)
  51309. e.addEventListener("dispose", c);
  51310. else if (s.code !== a)
  51311. p(e);
  51312. else {
  51313. if (void 0 !== o.shaderID)
  51314. return;
  51315. l = !1
  51316. }
  51317. if (l) {
  51318. if (o.shaderID) {
  51319. var h = n.ShaderLib[o.shaderID];
  51320. r.__webglShader = {
  51321. name: e.type,
  51322. uniforms: n.UniformsUtils.clone(h.uniforms),
  51323. vertexShader: h.vertexShader,
  51324. fragmentShader: h.fragmentShader
  51325. }
  51326. } else
  51327. r.__webglShader = {
  51328. name: e.type,
  51329. uniforms: e.uniforms,
  51330. vertexShader: e.vertexShader,
  51331. fragmentShader: e.fragmentShader
  51332. };
  51333. e.__webglShader = r.__webglShader,
  51334. s = qe.acquireProgram(e, o, a),
  51335. r.program = s,
  51336. e.program = s
  51337. }
  51338. var u = s.getAttributes();
  51339. if (e.morphTargets) {
  51340. e.numSupportedMorphTargets = 0;
  51341. for (var d = 0; d < ve.maxMorphTargets; d++)
  51342. u["morphTarget" + d] >= 0 && e.numSupportedMorphTargets++
  51343. }
  51344. if (e.morphNormals) {
  51345. e.numSupportedMorphNormals = 0;
  51346. for (var d = 0; d < ve.maxMorphNormals; d++)
  51347. u["morphNormal" + d] >= 0 && e.numSupportedMorphNormals++
  51348. }
  51349. r.uniformsList = [];
  51350. var f = r.__webglShader.uniforms
  51351. , g = r.program.getUniforms();
  51352. for (var m in f) {
  51353. var v = g[m];
  51354. v && r.uniformsList.push([r.__webglShader.uniforms[m], v])
  51355. }
  51356. (e instanceof n.MeshPhongMaterial || e instanceof n.MeshLambertMaterial || e instanceof n.MeshStandardMaterial || e.lights) && (r.lightsHash = Ue.hash,
  51357. f.ambientLightColor.value = Ue.ambient,
  51358. f.directionalLights.value = Ue.directional,
  51359. f.spotLights.value = Ue.spot,
  51360. f.pointLights.value = Ue.point,
  51361. f.hemisphereLights.value = Ue.hemi,
  51362. f.directionalShadowMap.value = Ue.directionalShadowMap,
  51363. f.directionalShadowMatrix.value = Ue.directionalShadowMatrix,
  51364. f.spotShadowMap.value = Ue.spotShadowMap,
  51365. f.spotShadowMatrix.value = Ue.spotShadowMatrix,
  51366. f.pointShadowMap.value = Ue.pointShadowMap,
  51367. f.pointShadowMatrix.value = Ue.pointShadowMatrix),
  51368. r.hasDynamicUniforms = !1;
  51369. for (var A = 0, y = r.uniformsList.length; A < y; A++) {
  51370. var C = r.uniformsList[A][0];
  51371. if (C.dynamic === !0) {
  51372. r.hasDynamicUniforms = !0;
  51373. break
  51374. }
  51375. }
  51376. }
  51377. function E(e) {
  51378. b(e),
  51379. 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),
  51380. Ye.setDepthFunc(e.depthFunc),
  51381. Ye.setDepthTest(e.depthTest),
  51382. Ye.setDepthWrite(e.depthWrite),
  51383. Ye.setColorWrite(e.colorWrite),
  51384. Ye.setPolygonOffset(e.polygonOffset, e.polygonOffsetFactor, e.polygonOffsetUnits)
  51385. }
  51386. function b(e) {
  51387. e.side !== n.DoubleSide ? Ye.enable(Ge.CULL_FACE) : Ye.disable(Ge.CULL_FACE),
  51388. Ye.setFlipSided(e.side === n.BackSide)
  51389. }
  51390. function w(e, t, i, r) {
  51391. xe = 0;
  51392. var o = Xe.get(i);
  51393. void 0 === o.program && (i.needsUpdate = !0),
  51394. void 0 !== o.lightsHash && o.lightsHash !== Ue.hash && (i.needsUpdate = !0),
  51395. i.needsUpdate && (I(i, t, r),
  51396. i.needsUpdate = !1);
  51397. var a = !1
  51398. , s = !1
  51399. , l = !1
  51400. , c = o.program
  51401. , h = c.getUniforms()
  51402. , u = o.__webglShader.uniforms;
  51403. if (c.id !== Ae && (Ge.useProgram(c.program),
  51404. Ae = c.id,
  51405. a = !0,
  51406. s = !0,
  51407. l = !0),
  51408. i.id !== Ie && (Ie = i.id,
  51409. s = !0),
  51410. (a || e !== be) && (Ge.uniformMatrix4fv(h.projectionMatrix, !1, e.projectionMatrix.elements),
  51411. je.logarithmicDepthBuffer && Ge.uniform1f(h.logDepthBufFC, 2 / (Math.log(e.far + 1) / Math.LN2)),
  51412. e !== be && (be = e,
  51413. s = !0,
  51414. l = !0),
  51415. (i instanceof n.ShaderMaterial || i instanceof n.MeshPhongMaterial || i instanceof n.MeshStandardMaterial || i.envMap) && void 0 !== h.cameraPosition && (Ve.setFromMatrixPosition(e.matrixWorld),
  51416. Ge.uniform3f(h.cameraPosition, Ve.x, Ve.y, Ve.z)),
  51417. (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),
  51418. void 0 !== h.toneMappingExposure && Ge.uniform1f(h.toneMappingExposure, ve.toneMappingExposure),
  51419. void 0 !== h.toneMappingWhitePoint && Ge.uniform1f(h.toneMappingWhitePoint, ve.toneMappingWhitePoint)),
  51420. i.skinning)
  51421. if (r.bindMatrix && void 0 !== h.bindMatrix && Ge.uniformMatrix4fv(h.bindMatrix, !1, r.bindMatrix.elements),
  51422. r.bindMatrixInverse && void 0 !== h.bindMatrixInverse && Ge.uniformMatrix4fv(h.bindMatrixInverse, !1, r.bindMatrixInverse.elements),
  51423. je.floatVertexTextures && r.skeleton && r.skeleton.useVertexTexture) {
  51424. if (void 0 !== h.boneTexture) {
  51425. var d = B();
  51426. Ge.uniform1i(h.boneTexture, d),
  51427. ve.setTexture(r.skeleton.boneTexture, d)
  51428. }
  51429. void 0 !== h.boneTextureWidth && Ge.uniform1i(h.boneTextureWidth, r.skeleton.boneTextureWidth),
  51430. void 0 !== h.boneTextureHeight && Ge.uniform1i(h.boneTextureHeight, r.skeleton.boneTextureHeight)
  51431. } else
  51432. r.skeleton && r.skeleton.boneMatrices && void 0 !== h.boneGlobalMatrices && Ge.uniformMatrix4fv(h.boneGlobalMatrices, !1, r.skeleton.boneMatrices);
  51433. return s && ((i instanceof n.MeshPhongMaterial || i instanceof n.MeshLambertMaterial || i instanceof n.MeshStandardMaterial || i.lights) && D(u, l),
  51434. t && i.fog && R(u, t),
  51435. (i instanceof n.MeshBasicMaterial || i instanceof n.MeshLambertMaterial || i instanceof n.MeshPhongMaterial || i instanceof n.MeshStandardMaterial) && T(u, i),
  51436. i instanceof n.LineBasicMaterial ? x(u, i) : i instanceof n.LineDashedMaterial ? (x(u, i),
  51437. 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,
  51438. u.mFar.value = e.far,
  51439. u.opacity.value = i.opacity) : i instanceof n.MeshNormalMaterial && (u.opacity.value = i.opacity),
  51440. V(o.uniformsList)),
  51441. N(h, r),
  51442. void 0 !== h.modelMatrix && Ge.uniformMatrix4fv(h.modelMatrix, !1, r.matrixWorld.elements),
  51443. o.hasDynamicUniforms === !0 && _(o.uniformsList, r, e),
  51444. c
  51445. }
  51446. function _(e, t, i) {
  51447. for (var n = [], r = 0, o = e.length; r < o; r++) {
  51448. var a = e[r][0]
  51449. , s = a.onUpdateCallback;
  51450. void 0 !== s && (s.bind(a)(t, i),
  51451. n.push(e[r]))
  51452. }
  51453. V(n)
  51454. }
  51455. function T(e, t) {
  51456. e.opacity.value = t.opacity,
  51457. e.diffuse.value = t.color,
  51458. t.emissive && e.emissive.value.copy(t.emissive).multiplyScalar(t.emissiveIntensity),
  51459. e.map.value = t.map,
  51460. e.specularMap.value = t.specularMap,
  51461. e.alphaMap.value = t.alphaMap,
  51462. t.aoMap && (e.aoMap.value = t.aoMap,
  51463. e.aoMapIntensity.value = t.aoMapIntensity);
  51464. var i;
  51465. 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),
  51466. void 0 !== i) {
  51467. i instanceof n.WebGLRenderTarget && (i = i.texture);
  51468. var r = i.offset
  51469. , o = i.repeat;
  51470. e.offsetRepeat.value.set(r.x, r.y, o.x, o.y)
  51471. }
  51472. e.envMap.value = t.envMap,
  51473. e.flipEnvMap.value = t.envMap instanceof n.WebGLRenderTargetCube ? 1 : -1,
  51474. e.reflectivity.value = t.reflectivity,
  51475. e.refractionRatio.value = t.refractionRatio
  51476. }
  51477. function x(e, t) {
  51478. e.diffuse.value = t.color,
  51479. e.opacity.value = t.opacity
  51480. }
  51481. function S(e, t) {
  51482. e.dashSize.value = t.dashSize,
  51483. e.totalSize.value = t.dashSize + t.gapSize,
  51484. e.scale.value = t.scale
  51485. }
  51486. function M(e, t) {
  51487. if (e.diffuse.value = t.color,
  51488. e.opacity.value = t.opacity,
  51489. e.size.value = t.size * Oe,
  51490. e.scale.value = te.clientHeight / 2,
  51491. e.map.value = t.map,
  51492. null !== t.map) {
  51493. var i = t.map.offset
  51494. , n = t.map.repeat;
  51495. e.offsetRepeat.value.set(i.x, i.y, n.x, n.y)
  51496. }
  51497. }
  51498. function R(e, t) {
  51499. e.fogColor.value = t.color,
  51500. t instanceof n.Fog ? (e.fogNear.value = t.near,
  51501. e.fogFar.value = t.far) : t instanceof n.FogExp2 && (e.fogDensity.value = t.density)
  51502. }
  51503. function P(e, t) {
  51504. t.lightMap && (e.lightMap.value = t.lightMap,
  51505. e.lightMapIntensity.value = t.lightMapIntensity),
  51506. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap)
  51507. }
  51508. function O(e, t) {
  51509. e.specular.value = t.specular,
  51510. e.shininess.value = Math.max(t.shininess, 1e-4),
  51511. t.lightMap && (e.lightMap.value = t.lightMap,
  51512. e.lightMapIntensity.value = t.lightMapIntensity),
  51513. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap),
  51514. t.bumpMap && (e.bumpMap.value = t.bumpMap,
  51515. e.bumpScale.value = t.bumpScale),
  51516. t.normalMap && (e.normalMap.value = t.normalMap,
  51517. e.normalScale.value.copy(t.normalScale)),
  51518. t.displacementMap && (e.displacementMap.value = t.displacementMap,
  51519. e.displacementScale.value = t.displacementScale,
  51520. e.displacementBias.value = t.displacementBias)
  51521. }
  51522. function L(e, t) {
  51523. e.roughness.value = t.roughness,
  51524. e.metalness.value = t.metalness,
  51525. t.roughnessMap && (e.roughnessMap.value = t.roughnessMap),
  51526. t.metalnessMap && (e.metalnessMap.value = t.metalnessMap),
  51527. t.lightMap && (e.lightMap.value = t.lightMap,
  51528. e.lightMapIntensity.value = t.lightMapIntensity),
  51529. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap),
  51530. t.bumpMap && (e.bumpMap.value = t.bumpMap,
  51531. e.bumpScale.value = t.bumpScale),
  51532. t.normalMap && (e.normalMap.value = t.normalMap,
  51533. e.normalScale.value.copy(t.normalScale)),
  51534. t.displacementMap && (e.displacementMap.value = t.displacementMap,
  51535. e.displacementScale.value = t.displacementScale,
  51536. e.displacementBias.value = t.displacementBias),
  51537. t.envMap && (e.envMapIntensity.value = t.envMapIntensity)
  51538. }
  51539. function D(e, t) {
  51540. e.ambientLightColor.needsUpdate = t,
  51541. e.directionalLights.needsUpdate = t,
  51542. e.pointLights.needsUpdate = t,
  51543. e.spotLights.needsUpdate = t,
  51544. e.hemisphereLights.needsUpdate = t
  51545. }
  51546. function N(e, t) {
  51547. Ge.uniformMatrix4fv(e.modelViewMatrix, !1, t.modelViewMatrix.elements),
  51548. e.normalMatrix && Ge.uniformMatrix3fv(e.normalMatrix, !1, t.normalMatrix.elements)
  51549. }
  51550. function B() {
  51551. var e = xe;
  51552. return e >= je.maxTextures && console.warn("WebGLRenderer: trying to use " + e + " texture units while this GPU supports only " + je.maxTextures),
  51553. xe += 1,
  51554. e
  51555. }
  51556. function F(e, t, i, r) {
  51557. var o, a;
  51558. if ("1i" === t)
  51559. Ge.uniform1i(i, r);
  51560. else if ("1f" === t)
  51561. Ge.uniform1f(i, r);
  51562. else if ("2f" === t)
  51563. Ge.uniform2f(i, r[0], r[1]);
  51564. else if ("3f" === t)
  51565. Ge.uniform3f(i, r[0], r[1], r[2]);
  51566. else if ("4f" === t)
  51567. Ge.uniform4f(i, r[0], r[1], r[2], r[3]);
  51568. else if ("1iv" === t)
  51569. Ge.uniform1iv(i, r);
  51570. else if ("3iv" === t)
  51571. Ge.uniform3iv(i, r);
  51572. else if ("1fv" === t)
  51573. Ge.uniform1fv(i, r);
  51574. else if ("2fv" === t)
  51575. Ge.uniform2fv(i, r);
  51576. else if ("3fv" === t)
  51577. Ge.uniform3fv(i, r);
  51578. else if ("4fv" === t)
  51579. Ge.uniform4fv(i, r);
  51580. else if ("Matrix2fv" === t)
  51581. Ge.uniformMatrix2fv(i, !1, r);
  51582. else if ("Matrix3fv" === t)
  51583. Ge.uniformMatrix3fv(i, !1, r);
  51584. else if ("Matrix4fv" === t)
  51585. Ge.uniformMatrix4fv(i, !1, r);
  51586. else if ("i" === t)
  51587. Ge.uniform1i(i, r);
  51588. else if ("f" === t)
  51589. Ge.uniform1f(i, r);
  51590. else if ("v2" === t)
  51591. Ge.uniform2f(i, r.x, r.y);
  51592. else if ("v3" === t)
  51593. Ge.uniform3f(i, r.x, r.y, r.z);
  51594. else if ("v4" === t)
  51595. Ge.uniform4f(i, r.x, r.y, r.z, r.w);
  51596. else if ("c" === t)
  51597. Ge.uniform3f(i, r.r, r.g, r.b);
  51598. else if ("s" === t) {
  51599. var s = e.properties;
  51600. for (var l in s) {
  51601. var c = s[l]
  51602. , h = i[l]
  51603. , u = r[l];
  51604. F(c, c.type, h, u)
  51605. }
  51606. } else if ("sa" === t)
  51607. for (var s = e.properties, d = 0, p = r.length; d < p; d++)
  51608. for (var l in s) {
  51609. var c = s[l]
  51610. , h = i[d][l]
  51611. , u = r[d][l];
  51612. F(c, c.type, h, u)
  51613. }
  51614. else if ("iv1" === t)
  51615. Ge.uniform1iv(i, r);
  51616. else if ("iv" === t)
  51617. Ge.uniform3iv(i, r);
  51618. else if ("fv1" === t)
  51619. Ge.uniform1fv(i, r);
  51620. else if ("fv" === t)
  51621. Ge.uniform3fv(i, r);
  51622. else if ("v2v" === t) {
  51623. void 0 === e._array && (e._array = new Float32Array(2 * r.length));
  51624. for (var d = 0, f = 0, g = r.length; d < g; d++,
  51625. f += 2)
  51626. e._array[f + 0] = r[d].x,
  51627. e._array[f + 1] = r[d].y;
  51628. Ge.uniform2fv(i, e._array)
  51629. } else if ("v3v" === t) {
  51630. void 0 === e._array && (e._array = new Float32Array(3 * r.length));
  51631. for (var d = 0, m = 0, g = r.length; d < g; d++,
  51632. m += 3)
  51633. e._array[m + 0] = r[d].x,
  51634. e._array[m + 1] = r[d].y,
  51635. e._array[m + 2] = r[d].z;
  51636. Ge.uniform3fv(i, e._array)
  51637. } else if ("v4v" === t) {
  51638. void 0 === e._array && (e._array = new Float32Array(4 * r.length));
  51639. for (var d = 0, v = 0, g = r.length; d < g; d++,
  51640. v += 4)
  51641. e._array[v + 0] = r[d].x,
  51642. e._array[v + 1] = r[d].y,
  51643. e._array[v + 2] = r[d].z,
  51644. e._array[v + 3] = r[d].w;
  51645. Ge.uniform4fv(i, e._array)
  51646. } else if ("m2" === t)
  51647. Ge.uniformMatrix2fv(i, !1, r.elements);
  51648. else if ("m3" === t)
  51649. Ge.uniformMatrix3fv(i, !1, r.elements);
  51650. else if ("m3v" === t) {
  51651. void 0 === e._array && (e._array = new Float32Array(9 * r.length));
  51652. for (var d = 0, g = r.length; d < g; d++)
  51653. r[d].flattenToArrayOffset(e._array, 9 * d);
  51654. Ge.uniformMatrix3fv(i, !1, e._array)
  51655. } else if ("m4" === t)
  51656. Ge.uniformMatrix4fv(i, !1, r.elements);
  51657. else if ("m4v" === t) {
  51658. void 0 === e._array && (e._array = new Float32Array(16 * r.length));
  51659. for (var d = 0, g = r.length; d < g; d++)
  51660. r[d].flattenToArrayOffset(e._array, 16 * d);
  51661. Ge.uniformMatrix4fv(i, !1, e._array)
  51662. } else if ("t" === t) {
  51663. if (o = r,
  51664. a = B(),
  51665. Ge.uniform1i(i, a),
  51666. !o)
  51667. return;
  51668. 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)
  51669. } else if ("tv" === t) {
  51670. void 0 === e._array && (e._array = []);
  51671. for (var d = 0, g = e.value.length; d < g; d++)
  51672. e._array[d] = B();
  51673. Ge.uniform1iv(i, e._array);
  51674. for (var d = 0, g = e.value.length; d < g; d++)
  51675. o = e.value[d],
  51676. a = e._array[d],
  51677. 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))
  51678. } else
  51679. console.warn("THREE.WebGLRenderer: Unknown uniform type: " + t)
  51680. }
  51681. function V(e) {
  51682. for (var t = 0, i = e.length; t < i; t++) {
  51683. var n = e[t][0];
  51684. if (n.needsUpdate !== !1) {
  51685. var r = n.type
  51686. , o = e[t][1]
  51687. , a = n.value;
  51688. F(n, r, o, a)
  51689. }
  51690. }
  51691. }
  51692. function U(e, t) {
  51693. 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;
  51694. for (Ue.shadowsPointLight = 0,
  51695. i = 0,
  51696. r = e.length; i < r; i++)
  51697. if (o = e[i],
  51698. a = o.color,
  51699. s = o.intensity,
  51700. l = o.distance,
  51701. o instanceof n.AmbientLight)
  51702. c += a.r * s,
  51703. h += a.g * s,
  51704. u += a.b * s;
  51705. else if (o instanceof n.DirectionalLight) {
  51706. var A = Ke.get(o);
  51707. A.color.copy(o.color).multiplyScalar(o.intensity),
  51708. A.direction.setFromMatrixPosition(o.matrixWorld),
  51709. Ve.setFromMatrixPosition(o.target.matrixWorld),
  51710. A.direction.sub(Ve),
  51711. A.direction.transformDirection(d),
  51712. A.shadow = o.castShadow,
  51713. o.castShadow && (A.shadowBias = o.shadow.bias,
  51714. A.shadowRadius = o.shadow.radius,
  51715. A.shadowMapSize = o.shadow.mapSize,
  51716. Ue.shadows[v++] = o),
  51717. Ue.directionalShadowMap[p] = o.shadow.map,
  51718. Ue.directionalShadowMatrix[p] = o.shadow.matrix,
  51719. Ue.directional[p++] = A
  51720. } else if (o instanceof n.SpotLight) {
  51721. var A = Ke.get(o);
  51722. A.position.setFromMatrixPosition(o.matrixWorld),
  51723. A.position.applyMatrix4(d),
  51724. A.color.copy(a).multiplyScalar(s),
  51725. A.distance = l,
  51726. A.direction.setFromMatrixPosition(o.matrixWorld),
  51727. Ve.setFromMatrixPosition(o.target.matrixWorld),
  51728. A.direction.sub(Ve),
  51729. A.direction.transformDirection(d),
  51730. A.coneCos = Math.cos(o.angle),
  51731. A.penumbraCos = Math.cos(o.angle * (1 - o.penumbra)),
  51732. A.decay = 0 === o.distance ? 0 : o.decay,
  51733. A.shadow = o.castShadow,
  51734. o.castShadow && (A.shadowBias = o.shadow.bias,
  51735. A.shadowRadius = o.shadow.radius,
  51736. A.shadowMapSize = o.shadow.mapSize,
  51737. Ue.shadows[v++] = o),
  51738. Ue.spotShadowMap[g] = o.shadow.map,
  51739. Ue.spotShadowMatrix[g] = o.shadow.matrix,
  51740. Ue.spot[g++] = A
  51741. } else if (o instanceof n.PointLight) {
  51742. var A = Ke.get(o);
  51743. A.position.setFromMatrixPosition(o.matrixWorld),
  51744. A.position.applyMatrix4(d),
  51745. A.color.copy(o.color).multiplyScalar(o.intensity),
  51746. A.distance = o.distance,
  51747. A.decay = 0 === o.distance ? 0 : o.decay,
  51748. A.shadow = o.castShadow,
  51749. o.castShadow && (A.shadowBias = o.shadow.bias,
  51750. A.shadowRadius = o.shadow.radius,
  51751. A.shadowMapSize = o.shadow.mapSize,
  51752. Ue.shadows[v++] = o),
  51753. Ue.pointShadowMap[f] = o.shadow.map,
  51754. void 0 === Ue.pointShadowMatrix[f] && (Ue.pointShadowMatrix[f] = new n.Matrix4),
  51755. Ve.setFromMatrixPosition(o.matrixWorld).negate(),
  51756. Ue.pointShadowMatrix[f].identity().setPosition(Ve),
  51757. Ue.point[f++] = A
  51758. } else if (o instanceof n.HemisphereLight) {
  51759. var A = Ke.get(o);
  51760. A.direction.setFromMatrixPosition(o.matrixWorld),
  51761. A.direction.transformDirection(d),
  51762. A.direction.normalize(),
  51763. A.skyColor.copy(o.color).multiplyScalar(s),
  51764. A.groundColor.copy(o.groundColor).multiplyScalar(s),
  51765. Ue.hemi[m++] = A
  51766. }
  51767. Ue.ambient[0] = c,
  51768. Ue.ambient[1] = h,
  51769. Ue.ambient[2] = u,
  51770. Ue.directional.length = p,
  51771. Ue.spot.length = g,
  51772. Ue.point.length = f,
  51773. Ue.hemi.length = m,
  51774. Ue.shadows.length = v,
  51775. Ue.hash = p + "," + f + "," + g + "," + m + "," + v
  51776. }
  51777. function k(e, t, i) {
  51778. var r;
  51779. if (i ? (Ge.texParameteri(e, Ge.TEXTURE_WRAP_S, ee(t.wrapS)),
  51780. Ge.texParameteri(e, Ge.TEXTURE_WRAP_T, ee(t.wrapT)),
  51781. Ge.texParameteri(e, Ge.TEXTURE_MAG_FILTER, ee(t.magFilter)),
  51782. Ge.texParameteri(e, Ge.TEXTURE_MIN_FILTER, ee(t.minFilter))) : (Ge.texParameteri(e, Ge.TEXTURE_WRAP_S, Ge.CLAMP_TO_EDGE),
  51783. Ge.texParameteri(e, Ge.TEXTURE_WRAP_T, Ge.CLAMP_TO_EDGE),
  51784. 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),
  51785. Ge.texParameteri(e, Ge.TEXTURE_MAG_FILTER, $(t.magFilter)),
  51786. Ge.texParameteri(e, Ge.TEXTURE_MIN_FILTER, $(t.minFilter)),
  51787. 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)),
  51788. r = We.get("EXT_texture_filter_anisotropic")) {
  51789. if (t.type === n.FloatType && null === We.get("OES_texture_float_linear"))
  51790. return;
  51791. if (t.type === n.HalfFloatType && null === We.get("OES_texture_half_float_linear"))
  51792. return;
  51793. (t.anisotropy > 1 || Xe.get(t).__currentAnisotropy) && (Ge.texParameterf(e, r.TEXTURE_MAX_ANISOTROPY_EXT, Math.min(t.anisotropy, ve.getMaxAnisotropy())),
  51794. Xe.get(t).__currentAnisotropy = t.anisotropy)
  51795. }
  51796. }
  51797. function H(e, t, i) {
  51798. void 0 === e.__webglInit && (e.__webglInit = !0,
  51799. t.addEventListener("dispose", s),
  51800. e.__webglTexture = Ge.createTexture(),
  51801. ke.textures++),
  51802. Ye.activeTexture(Ge.TEXTURE0 + i),
  51803. Ye.bindTexture(Ge.TEXTURE_2D, e.__webglTexture),
  51804. Ge.pixelStorei(Ge.UNPACK_FLIP_Y_WEBGL, t.flipY),
  51805. Ge.pixelStorei(Ge.UNPACK_PREMULTIPLY_ALPHA_WEBGL, t.premultiplyAlpha),
  51806. Ge.pixelStorei(Ge.UNPACK_ALIGNMENT, t.unpackAlignment);
  51807. var r = G(t.image, je.maxTextureSize);
  51808. W(t) && z(r) === !1 && (r = j(r));
  51809. var o = z(r)
  51810. , a = ee(t.format)
  51811. , l = ee(t.type);
  51812. k(Ge.TEXTURE_2D, t, o);
  51813. var c, h = t.mipmaps;
  51814. if (t instanceof n.DataTexture)
  51815. if (h.length > 0 && o) {
  51816. for (var u = 0, d = h.length; u < d; u++)
  51817. c = h[u],
  51818. Ye.texImage2D(Ge.TEXTURE_2D, u, a, c.width, c.height, 0, a, l, c.data);
  51819. t.generateMipmaps = !1
  51820. } else
  51821. Ye.texImage2D(Ge.TEXTURE_2D, 0, a, r.width, r.height, 0, a, l, r.data);
  51822. else if (t instanceof n.CompressedTexture)
  51823. for (var u = 0, d = h.length; u < d; u++)
  51824. c = h[u],
  51825. 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);
  51826. else if (h.length > 0 && o) {
  51827. for (var u = 0, d = h.length; u < d; u++)
  51828. c = h[u],
  51829. Ye.texImage2D(Ge.TEXTURE_2D, u, a, a, l, c);
  51830. t.generateMipmaps = !1
  51831. } else
  51832. Ye.texImage2D(Ge.TEXTURE_2D, 0, a, a, l, r);
  51833. t.generateMipmaps && o && Ge.generateMipmap(Ge.TEXTURE_2D),
  51834. e.__version = t.version,
  51835. t.onUpdate && t.onUpdate(t)
  51836. }
  51837. function G(e, t) {
  51838. if (e.width > t || e.height > t) {
  51839. var i = t / Math.max(e.width, e.height)
  51840. , n = document.createElement("canvas");
  51841. n.width = Math.floor(e.width * i),
  51842. n.height = Math.floor(e.height * i);
  51843. var r = n.getContext("2d");
  51844. return r.drawImage(e, 0, 0, e.width, e.height, 0, 0, n.width, n.height),
  51845. console.warn("THREE.WebGLRenderer: image is too big (" + e.width + "x" + e.height + "). Resized to " + n.width + "x" + n.height, e),
  51846. n
  51847. }
  51848. return e
  51849. }
  51850. function z(e) {
  51851. return n.Math.isPowerOfTwo(e.width) && n.Math.isPowerOfTwo(e.height)
  51852. }
  51853. function W(e) {
  51854. return e.wrapS !== n.ClampToEdgeWrapping || e.wrapT !== n.ClampToEdgeWrapping || e.minFilter !== n.NearestFilter && e.minFilter !== n.LinearFilter
  51855. }
  51856. function j(e) {
  51857. if (e instanceof HTMLImageElement || e instanceof HTMLCanvasElement) {
  51858. var t = document.createElement("canvas");
  51859. t.width = n.Math.nearestPowerOfTwo(e.width),
  51860. t.height = n.Math.nearestPowerOfTwo(e.height);
  51861. var i = t.getContext("2d");
  51862. return i.drawImage(e, 0, 0, t.width, t.height),
  51863. console.warn("THREE.WebGLRenderer: image is not power of two (" + e.width + "x" + e.height + "). Resized to " + t.width + "x" + t.height, e),
  51864. t
  51865. }
  51866. return e
  51867. }
  51868. function Y(e, t) {
  51869. var i = Xe.get(e);
  51870. if (6 === e.image.length)
  51871. if (e.version > 0 && i.__version !== e.version) {
  51872. i.__image__webglTextureCube || (e.addEventListener("dispose", s),
  51873. i.__image__webglTextureCube = Ge.createTexture(),
  51874. ke.textures++),
  51875. Ye.activeTexture(Ge.TEXTURE0 + t),
  51876. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, i.__image__webglTextureCube),
  51877. Ge.pixelStorei(Ge.UNPACK_FLIP_Y_WEBGL, e.flipY);
  51878. for (var r = e instanceof n.CompressedTexture, o = e.image[0]instanceof n.DataTexture, a = [], l = 0; l < 6; l++)
  51879. !ve.autoScaleCubemaps || r || o ? a[l] = o ? e.image[l].image : e.image[l] : a[l] = G(e.image[l], je.maxCubemapSize);
  51880. var c = a[0]
  51881. , h = z(c)
  51882. , u = ee(e.format)
  51883. , d = ee(e.type);
  51884. k(Ge.TEXTURE_CUBE_MAP, e, h);
  51885. for (var l = 0; l < 6; l++)
  51886. if (r)
  51887. for (var p, f = a[l].mipmaps, g = 0, m = f.length; g < m; g++)
  51888. p = f[g],
  51889. 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);
  51890. else
  51891. 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]);
  51892. e.generateMipmaps && h && Ge.generateMipmap(Ge.TEXTURE_CUBE_MAP),
  51893. i.__version = e.version,
  51894. e.onUpdate && e.onUpdate(e)
  51895. } else
  51896. Ye.activeTexture(Ge.TEXTURE0 + t),
  51897. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, i.__image__webglTextureCube)
  51898. }
  51899. function X(e, t) {
  51900. Ye.activeTexture(Ge.TEXTURE0 + t),
  51901. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, Xe.get(e).__webglTexture)
  51902. }
  51903. function Z(e, t, i, n) {
  51904. var r = ee(t.texture.format)
  51905. , o = ee(t.texture.type);
  51906. Ye.texImage2D(n, 0, r, t.width, t.height, 0, r, o, null),
  51907. Ge.bindFramebuffer(Ge.FRAMEBUFFER, e),
  51908. Ge.framebufferTexture2D(Ge.FRAMEBUFFER, i, n, Xe.get(t.texture).__webglTexture, 0),
  51909. Ge.bindFramebuffer(Ge.FRAMEBUFFER, null)
  51910. }
  51911. function q(e, t) {
  51912. Ge.bindRenderbuffer(Ge.RENDERBUFFER, e),
  51913. t.depthBuffer && !t.stencilBuffer ? (Ge.renderbufferStorage(Ge.RENDERBUFFER, Ge.DEPTH_COMPONENT16, t.width, t.height),
  51914. 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),
  51915. Ge.framebufferRenderbuffer(Ge.FRAMEBUFFER, Ge.DEPTH_STENCIL_ATTACHMENT, Ge.RENDERBUFFER, e)) : Ge.renderbufferStorage(Ge.RENDERBUFFER, Ge.RGBA4, t.width, t.height),
  51916. Ge.bindRenderbuffer(Ge.RENDERBUFFER, null)
  51917. }
  51918. function K(e) {
  51919. var t = Xe.get(e)
  51920. , i = e instanceof n.WebGLRenderTargetCube;
  51921. if (i) {
  51922. t.__webglDepthbuffer = [];
  51923. for (var r = 0; r < 6; r++)
  51924. Ge.bindFramebuffer(Ge.FRAMEBUFFER, t.__webglFramebuffer[r]),
  51925. t.__webglDepthbuffer[r] = Ge.createRenderbuffer(),
  51926. q(t.__webglDepthbuffer[r], e)
  51927. } else
  51928. Ge.bindFramebuffer(Ge.FRAMEBUFFER, t.__webglFramebuffer),
  51929. t.__webglDepthbuffer = Ge.createRenderbuffer(),
  51930. q(t.__webglDepthbuffer, e);
  51931. Ge.bindFramebuffer(Ge.FRAMEBUFFER, null)
  51932. }
  51933. function Q(e) {
  51934. var t = Xe.get(e)
  51935. , i = Xe.get(e.texture);
  51936. e.addEventListener("dispose", l),
  51937. i.__webglTexture = Ge.createTexture(),
  51938. ke.textures++;
  51939. var r = e instanceof n.WebGLRenderTargetCube
  51940. , o = n.Math.isPowerOfTwo(e.width) && n.Math.isPowerOfTwo(e.height);
  51941. if (r) {
  51942. t.__webglFramebuffer = [];
  51943. for (var a = 0; a < 6; a++)
  51944. t.__webglFramebuffer[a] = Ge.createFramebuffer()
  51945. } else
  51946. t.__webglFramebuffer = Ge.createFramebuffer();
  51947. if (r) {
  51948. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, i.__webglTexture),
  51949. k(Ge.TEXTURE_CUBE_MAP, e.texture, o);
  51950. for (var a = 0; a < 6; a++)
  51951. Z(t.__webglFramebuffer[a], e, Ge.COLOR_ATTACHMENT0, Ge.TEXTURE_CUBE_MAP_POSITIVE_X + a);
  51952. e.texture.generateMipmaps && o && Ge.generateMipmap(Ge.TEXTURE_CUBE_MAP),
  51953. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, null)
  51954. } else
  51955. Ye.bindTexture(Ge.TEXTURE_2D, i.__webglTexture),
  51956. k(Ge.TEXTURE_2D, e.texture, o),
  51957. Z(t.__webglFramebuffer, e, Ge.COLOR_ATTACHMENT0, Ge.TEXTURE_2D),
  51958. e.texture.generateMipmaps && o && Ge.generateMipmap(Ge.TEXTURE_2D),
  51959. Ye.bindTexture(Ge.TEXTURE_2D, null);
  51960. e.depthBuffer && K(e)
  51961. }
  51962. function J(e) {
  51963. var t = e instanceof n.WebGLRenderTargetCube ? Ge.TEXTURE_CUBE_MAP : Ge.TEXTURE_2D
  51964. , i = Xe.get(e.texture).__webglTexture;
  51965. Ye.bindTexture(t, i),
  51966. Ge.generateMipmap(t),
  51967. Ye.bindTexture(t, null)
  51968. }
  51969. function $(e) {
  51970. return e === n.NearestFilter || e === n.NearestMipMapNearestFilter || e === n.NearestMipMapLinearFilter ? Ge.NEAREST : Ge.LINEAR
  51971. }
  51972. function ee(e) {
  51973. var t;
  51974. if (e === n.RepeatWrapping)
  51975. return Ge.REPEAT;
  51976. if (e === n.ClampToEdgeWrapping)
  51977. return Ge.CLAMP_TO_EDGE;
  51978. if (e === n.MirroredRepeatWrapping)
  51979. return Ge.MIRRORED_REPEAT;
  51980. if (e === n.NearestFilter)
  51981. return Ge.NEAREST;
  51982. if (e === n.NearestMipMapNearestFilter)
  51983. return Ge.NEAREST_MIPMAP_NEAREST;
  51984. if (e === n.NearestMipMapLinearFilter)
  51985. return Ge.NEAREST_MIPMAP_LINEAR;
  51986. if (e === n.LinearFilter)
  51987. return Ge.LINEAR;
  51988. if (e === n.LinearMipMapNearestFilter)
  51989. return Ge.LINEAR_MIPMAP_NEAREST;
  51990. if (e === n.LinearMipMapLinearFilter)
  51991. return Ge.LINEAR_MIPMAP_LINEAR;
  51992. if (e === n.UnsignedByteType)
  51993. return Ge.UNSIGNED_BYTE;
  51994. if (e === n.UnsignedShort4444Type)
  51995. return Ge.UNSIGNED_SHORT_4_4_4_4;
  51996. if (e === n.UnsignedShort5551Type)
  51997. return Ge.UNSIGNED_SHORT_5_5_5_1;
  51998. if (e === n.UnsignedShort565Type)
  51999. return Ge.UNSIGNED_SHORT_5_6_5;
  52000. if (e === n.ByteType)
  52001. return Ge.BYTE;
  52002. if (e === n.ShortType)
  52003. return Ge.SHORT;
  52004. if (e === n.UnsignedShortType)
  52005. return Ge.UNSIGNED_SHORT;
  52006. if (e === n.IntType)
  52007. return Ge.INT;
  52008. if (e === n.UnsignedIntType)
  52009. return Ge.UNSIGNED_INT;
  52010. if (e === n.FloatType)
  52011. return Ge.FLOAT;
  52012. if (t = We.get("OES_texture_half_float"),
  52013. null !== t && e === n.HalfFloatType)
  52014. return t.HALF_FLOAT_OES;
  52015. if (e === n.AlphaFormat)
  52016. return Ge.ALPHA;
  52017. if (e === n.RGBFormat)
  52018. return Ge.RGB;
  52019. if (e === n.RGBAFormat)
  52020. return Ge.RGBA;
  52021. if (e === n.LuminanceFormat)
  52022. return Ge.LUMINANCE;
  52023. if (e === n.LuminanceAlphaFormat)
  52024. return Ge.LUMINANCE_ALPHA;
  52025. if (e === n.AddEquation)
  52026. return Ge.FUNC_ADD;
  52027. if (e === n.SubtractEquation)
  52028. return Ge.FUNC_SUBTRACT;
  52029. if (e === n.ReverseSubtractEquation)
  52030. return Ge.FUNC_REVERSE_SUBTRACT;
  52031. if (e === n.ZeroFactor)
  52032. return Ge.ZERO;
  52033. if (e === n.OneFactor)
  52034. return Ge.ONE;
  52035. if (e === n.SrcColorFactor)
  52036. return Ge.SRC_COLOR;
  52037. if (e === n.OneMinusSrcColorFactor)
  52038. return Ge.ONE_MINUS_SRC_COLOR;
  52039. if (e === n.SrcAlphaFactor)
  52040. return Ge.SRC_ALPHA;
  52041. if (e === n.OneMinusSrcAlphaFactor)
  52042. return Ge.ONE_MINUS_SRC_ALPHA;
  52043. if (e === n.DstAlphaFactor)
  52044. return Ge.DST_ALPHA;
  52045. if (e === n.OneMinusDstAlphaFactor)
  52046. return Ge.ONE_MINUS_DST_ALPHA;
  52047. if (e === n.DstColorFactor)
  52048. return Ge.DST_COLOR;
  52049. if (e === n.OneMinusDstColorFactor)
  52050. return Ge.ONE_MINUS_DST_COLOR;
  52051. if (e === n.SrcAlphaSaturateFactor)
  52052. return Ge.SRC_ALPHA_SATURATE;
  52053. if (t = We.get("WEBGL_compressed_texture_s3tc"),
  52054. null !== t) {
  52055. if (e === n.RGB_S3TC_DXT1_Format)
  52056. return t.COMPRESSED_RGB_S3TC_DXT1_EXT;
  52057. if (e === n.RGBA_S3TC_DXT1_Format)
  52058. return t.COMPRESSED_RGBA_S3TC_DXT1_EXT;
  52059. if (e === n.RGBA_S3TC_DXT3_Format)
  52060. return t.COMPRESSED_RGBA_S3TC_DXT3_EXT;
  52061. if (e === n.RGBA_S3TC_DXT5_Format)
  52062. return t.COMPRESSED_RGBA_S3TC_DXT5_EXT
  52063. }
  52064. if (t = We.get("WEBGL_compressed_texture_pvrtc"),
  52065. null !== t) {
  52066. if (e === n.RGB_PVRTC_4BPPV1_Format)
  52067. return t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;
  52068. if (e === n.RGB_PVRTC_2BPPV1_Format)
  52069. return t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;
  52070. if (e === n.RGBA_PVRTC_4BPPV1_Format)
  52071. return t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;
  52072. if (e === n.RGBA_PVRTC_2BPPV1_Format)
  52073. return t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG
  52074. }
  52075. if (t = We.get("WEBGL_compressed_texture_etc1"),
  52076. null !== t && e === n.RGB_ETC1_Format)
  52077. return t.COMPRESSED_RGB_ETC1_WEBGL;
  52078. if (t = We.get("EXT_blend_minmax"),
  52079. null !== t) {
  52080. if (e === n.MinEquation)
  52081. return t.MIN_EXT;
  52082. if (e === n.MaxEquation)
  52083. return t.MAX_EXT
  52084. }
  52085. return 0
  52086. }
  52087. console.log("THREE.WebGLRenderer", n.REVISION),
  52088. e = e || {};
  52089. var te = void 0 !== e.canvas ? e.canvas : document.createElement("canvas")
  52090. , ie = void 0 !== e.context ? e.context : null
  52091. , ne = void 0 !== e.alpha && e.alpha
  52092. , re = void 0 === e.depth || e.depth
  52093. , oe = void 0 === e.stencil || e.stencil
  52094. , ae = void 0 !== e.antialias && e.antialias
  52095. , se = void 0 === e.premultipliedAlpha || e.premultipliedAlpha
  52096. , le = void 0 !== e.preserveDrawingBuffer && e.preserveDrawingBuffer
  52097. , ce = []
  52098. , he = []
  52099. , ue = -1
  52100. , de = []
  52101. , pe = -1
  52102. , fe = new Float32Array(8)
  52103. , ge = []
  52104. , me = [];
  52105. this.domElement = te,
  52106. this.context = null,
  52107. this.autoClear = !0,
  52108. this.autoClearColor = !0,
  52109. this.autoClearDepth = !0,
  52110. this.autoClearStencil = !0,
  52111. this.sortObjects = !0,
  52112. this.gammaFactor = 2,
  52113. this.gammaInput = !1,
  52114. this.gammaOutput = !1,
  52115. this.physicallyCorrectLights = !1,
  52116. this.toneMapping = n.LinearToneMapping,
  52117. this.toneMappingExposure = 1,
  52118. this.toneMappingWhitePoint = 1,
  52119. this.maxMorphTargets = 8,
  52120. this.maxMorphNormals = 4,
  52121. this.autoScaleCubemaps = !0;
  52122. var ve = this
  52123. , Ae = null
  52124. , ye = null
  52125. , Ce = null
  52126. , Ie = -1
  52127. , Ee = ""
  52128. , be = null
  52129. , we = new n.Vector4
  52130. , _e = null
  52131. , Te = new n.Vector4
  52132. , xe = 0
  52133. , Se = new n.Color(0)
  52134. , Me = 0
  52135. , Re = te.width
  52136. , Pe = te.height
  52137. , Oe = 1
  52138. , Le = new n.Vector4(0,0,Re,Pe)
  52139. , De = !1
  52140. , Ne = new n.Vector4(0,0,Re,Pe)
  52141. , Be = new n.Frustum
  52142. , Fe = new n.Matrix4
  52143. , Ve = new n.Vector3
  52144. , Ue = {
  52145. hash: "",
  52146. ambient: [0, 0, 0],
  52147. directional: [],
  52148. directionalShadowMap: [],
  52149. directionalShadowMatrix: [],
  52150. spot: [],
  52151. spotShadowMap: [],
  52152. spotShadowMatrix: [],
  52153. point: [],
  52154. pointShadowMap: [],
  52155. pointShadowMatrix: [],
  52156. hemi: [],
  52157. shadows: [],
  52158. shadowsPointLight: 0
  52159. }
  52160. , ke = {
  52161. geometries: 0,
  52162. textures: 0
  52163. }
  52164. , He = {
  52165. calls: 0,
  52166. vertices: 0,
  52167. faces: 0,
  52168. points: 0
  52169. };
  52170. this.info = {
  52171. render: He,
  52172. memory: ke,
  52173. programs: null
  52174. };
  52175. var Ge;
  52176. try {
  52177. var ze = {
  52178. alpha: ne,
  52179. depth: re,
  52180. stencil: oe,
  52181. antialias: ae,
  52182. premultipliedAlpha: se,
  52183. preserveDrawingBuffer: le
  52184. };
  52185. if (Ge = ie || te.getContext("webgl", ze) || te.getContext("experimental-webgl", ze),
  52186. null === Ge)
  52187. throw null !== te.getContext("webgl") ? "Error creating WebGL context with your selected attributes." : "Error creating WebGL context.";
  52188. void 0 === Ge.getShaderPrecisionFormat && (Ge.getShaderPrecisionFormat = function() {
  52189. return {
  52190. rangeMin: 1,
  52191. rangeMax: 1,
  52192. precision: 1
  52193. }
  52194. }
  52195. ),
  52196. te.addEventListener("webglcontextlost", a, !1)
  52197. } catch (e) {
  52198. console.error("THREE.WebGLRenderer: " + e)
  52199. }
  52200. var We = new n.WebGLExtensions(Ge);
  52201. We.get("OES_texture_float"),
  52202. We.get("OES_texture_float_linear"),
  52203. We.get("OES_texture_half_float"),
  52204. We.get("OES_texture_half_float_linear"),
  52205. We.get("OES_standard_derivatives"),
  52206. We.get("ANGLE_instanced_arrays"),
  52207. We.get("OES_element_index_uint") && (n.BufferGeometry.MaxIndex = 4294967296);
  52208. var je = new n.WebGLCapabilities(Ge,We,e)
  52209. , Ye = new n.WebGLState(Ge,We,ee)
  52210. , Xe = new n.WebGLProperties
  52211. , Ze = new n.WebGLObjects(Ge,Xe,this.info)
  52212. , qe = new n.WebGLPrograms(this,je)
  52213. , Ke = new n.WebGLLights;
  52214. this.info.programs = qe.programs;
  52215. var Qe = new n.WebGLBufferRenderer(Ge,We,He)
  52216. , Je = new n.WebGLIndexedBufferRenderer(Ge,We,He);
  52217. r(),
  52218. this.context = Ge,
  52219. this.capabilities = je,
  52220. this.extensions = We,
  52221. this.properties = Xe,
  52222. this.state = Ye;
  52223. var $e = new n.WebGLShadowMap(this,Ue,Ze);
  52224. this.shadowMap = $e;
  52225. var et = new n.SpritePlugin(this,ge)
  52226. , tt = new n.LensFlarePlugin(this,me);
  52227. this.getContext = function() {
  52228. return Ge
  52229. }
  52230. ,
  52231. this.getContextAttributes = function() {
  52232. return Ge.getContextAttributes()
  52233. }
  52234. ,
  52235. this.forceContextLoss = function() {
  52236. We.get("WEBGL_lose_context").loseContext()
  52237. }
  52238. ,
  52239. this.getMaxAnisotropy = function() {
  52240. var e;
  52241. return function() {
  52242. if (void 0 !== e)
  52243. return e;
  52244. var t = We.get("EXT_texture_filter_anisotropic");
  52245. return e = null !== t ? Ge.getParameter(t.MAX_TEXTURE_MAX_ANISOTROPY_EXT) : 0
  52246. }
  52247. }(),
  52248. this.getPrecision = function() {
  52249. return je.precision
  52250. }
  52251. ,
  52252. this.getPixelRatio = function() {
  52253. return Oe
  52254. }
  52255. ,
  52256. this.setPixelRatio = function(e) {
  52257. void 0 !== e && (Oe = e,
  52258. this.setSize(Ne.z, Ne.w, !1))
  52259. }
  52260. ,
  52261. this.getSize = function() {
  52262. return {
  52263. width: Re,
  52264. height: Pe
  52265. }
  52266. }
  52267. ,
  52268. this.setSize = function(e, t, i, devicePixelRatio) {
  52269. if(devicePixelRatio != void 0) Oe = devicePixelRatio; //xzw add 改分辨率 始终保持清晰
  52270. Re = e,
  52271. Pe = t,
  52272. te.width = e * Oe,
  52273. te.height = t * Oe,
  52274. i !== !1 && (te.style.width = e + "px",
  52275. te.style.height = t + "px"),
  52276. this.setViewport(0, 0, e, t)
  52277. }
  52278. ,
  52279. this.setViewport = function(e, t, i, n) {
  52280. Ye.viewport(Ne.set(e, t, i, n))
  52281. }
  52282. ,
  52283. this.setScissor = function(e, t, i, n) {
  52284. Ye.scissor(Le.set(e, t, i, n))
  52285. }
  52286. ,
  52287. this.setScissorTest = function(e) {
  52288. Ye.setScissorTest(De = e)
  52289. }
  52290. ,
  52291. this.getClearColor = function() {
  52292. return Se
  52293. }
  52294. ,
  52295. this.setClearColor = function(e, t) {
  52296. Se.set(e),
  52297. Me = void 0 !== t ? t : 1,
  52298. i(Se.r, Se.g, Se.b, Me)
  52299. }
  52300. ,
  52301. this.getClearAlpha = function() {
  52302. return Me
  52303. }
  52304. ,
  52305. this.setClearAlpha = function(e) {
  52306. Me = e,
  52307. i(Se.r, Se.g, Se.b, Me)
  52308. }
  52309. ,
  52310. this.clear = function(e, t, i) {
  52311. var n = 0;
  52312. (void 0 === e || e) && (n |= Ge.COLOR_BUFFER_BIT),
  52313. (void 0 === t || t) && (n |= Ge.DEPTH_BUFFER_BIT),
  52314. (void 0 === i || i) && (n |= Ge.STENCIL_BUFFER_BIT),
  52315. Ge.clear(n)
  52316. }
  52317. ,
  52318. this.clearColor = function() {
  52319. this.clear(!0, !1, !1)
  52320. }
  52321. ,
  52322. this.clearDepth = function() {
  52323. this.clear(!1, !0, !1)
  52324. }
  52325. ,
  52326. this.clearStencil = function() {
  52327. this.clear(!1, !1, !0)
  52328. }
  52329. ,
  52330. this.clearTarget = function(e, t, i, n) {
  52331. this.setRenderTarget(e),
  52332. this.clear(t, i, n)
  52333. }
  52334. ,
  52335. this.resetGLState = o,
  52336. this.dispose = function() {
  52337. te.removeEventListener("webglcontextlost", a, !1)
  52338. }
  52339. ,
  52340. this.renderBufferImmediate = function(e, t, i) {
  52341. Ye.initAttributes();
  52342. var r = Xe.get(e);
  52343. e.hasPositions && !r.position && (r.position = Ge.createBuffer()),
  52344. e.hasNormals && !r.normal && (r.normal = Ge.createBuffer()),
  52345. e.hasUvs && !r.uv && (r.uv = Ge.createBuffer()),
  52346. e.hasColors && !r.color && (r.color = Ge.createBuffer());
  52347. var o = t.getAttributes();
  52348. if (e.hasPositions && (Ge.bindBuffer(Ge.ARRAY_BUFFER, r.position),
  52349. Ge.bufferData(Ge.ARRAY_BUFFER, e.positionArray, Ge.DYNAMIC_DRAW),
  52350. Ye.enableAttribute(o.position),
  52351. Ge.vertexAttribPointer(o.position, 3, Ge.FLOAT, !1, 0, 0)),
  52352. e.hasNormals) {
  52353. if (Ge.bindBuffer(Ge.ARRAY_BUFFER, r.normal),
  52354. "MeshPhongMaterial" !== i.type && "MeshStandardMaterial" !== i.type && i.shading === n.FlatShading)
  52355. for (var a = 0, s = 3 * e.count; a < s; a += 9) {
  52356. var l = e.normalArray
  52357. , c = (l[a + 0] + l[a + 3] + l[a + 6]) / 3
  52358. , h = (l[a + 1] + l[a + 4] + l[a + 7]) / 3
  52359. , u = (l[a + 2] + l[a + 5] + l[a + 8]) / 3;
  52360. l[a + 0] = c,
  52361. l[a + 1] = h,
  52362. l[a + 2] = u,
  52363. l[a + 3] = c,
  52364. l[a + 4] = h,
  52365. l[a + 5] = u,
  52366. l[a + 6] = c,
  52367. l[a + 7] = h,
  52368. l[a + 8] = u
  52369. }
  52370. Ge.bufferData(Ge.ARRAY_BUFFER, e.normalArray, Ge.DYNAMIC_DRAW),
  52371. Ye.enableAttribute(o.normal),
  52372. Ge.vertexAttribPointer(o.normal, 3, Ge.FLOAT, !1, 0, 0)
  52373. }
  52374. e.hasUvs && i.map && (Ge.bindBuffer(Ge.ARRAY_BUFFER, r.uv),
  52375. Ge.bufferData(Ge.ARRAY_BUFFER, e.uvArray, Ge.DYNAMIC_DRAW),
  52376. Ye.enableAttribute(o.uv),
  52377. Ge.vertexAttribPointer(o.uv, 2, Ge.FLOAT, !1, 0, 0)),
  52378. e.hasColors && i.vertexColors !== n.NoColors && (Ge.bindBuffer(Ge.ARRAY_BUFFER, r.color),
  52379. Ge.bufferData(Ge.ARRAY_BUFFER, e.colorArray, Ge.DYNAMIC_DRAW),
  52380. Ye.enableAttribute(o.color),
  52381. Ge.vertexAttribPointer(o.color, 3, Ge.FLOAT, !1, 0, 0)),
  52382. Ye.disableUnusedAttributes(),
  52383. Ge.drawArrays(Ge.TRIANGLES, 0, e.count),
  52384. e.count = 0
  52385. }
  52386. ,
  52387. this.renderBufferDirect = function(e, i, r, o, a, s) {
  52388. E(o);
  52389. var l = w(e, i, o, a)
  52390. , c = !1
  52391. , h = r.id + "_" + l.id + "_" + o.wireframe;
  52392. h !== Ee && (Ee = h,
  52393. c = !0);
  52394. var u = a.morphTargetInfluences;
  52395. if (void 0 !== u) {
  52396. for (var d = [], p = 0, m = u.length; p < m; p++) {
  52397. var v = u[p];
  52398. d.push([v, p])
  52399. }
  52400. d.sort(g),
  52401. d.length > 8 && (d.length = 8);
  52402. for (var A = r.morphAttributes, p = 0, m = d.length; p < m; p++) {
  52403. var v = d[p];
  52404. if (fe[p] = v[0],
  52405. 0 !== v[0]) {
  52406. var y = v[1];
  52407. o.morphTargets === !0 && A.position && r.addAttribute("morphTarget" + p, A.position[y]),
  52408. o.morphNormals === !0 && A.normal && r.addAttribute("morphNormal" + p, A.normal[y])
  52409. } else
  52410. o.morphTargets === !0 && r.removeAttribute("morphTarget" + p),
  52411. o.morphNormals === !0 && r.removeAttribute("morphNormal" + p)
  52412. }
  52413. var C = l.getUniforms();
  52414. null !== C.morphTargetInfluences && Ge.uniform1fv(C.morphTargetInfluences, fe),
  52415. c = !0
  52416. }
  52417. var y = r.index
  52418. , I = r.attributes.position;
  52419. o.wireframe === !0 && (y = Ze.getWireframeAttribute(r));
  52420. var b;
  52421. null !== y ? (b = Je,
  52422. b.setIndex(y)) : b = Qe,
  52423. c && (f(o, l, r),
  52424. null !== y && Ge.bindBuffer(Ge.ELEMENT_ARRAY_BUFFER, Ze.getAttributeBuffer(y)));
  52425. var _ = 0
  52426. , T = 1 / 0;
  52427. null !== y ? T = y.count : void 0 !== I && (T = I.count);
  52428. var x = r.drawRange.start
  52429. , S = r.drawRange.count
  52430. , M = null !== s ? s.start : 0
  52431. , R = null !== s ? s.count : 1 / 0
  52432. , P = Math.max(_, x, M)
  52433. , O = Math.min(_ + T, x + S, M + R) - 1
  52434. , L = Math.max(0, O - P + 1);
  52435. if (a instanceof n.Mesh)
  52436. if (o.wireframe === !0)
  52437. Ye.setLineWidth(o.wireframeLinewidth * t()),
  52438. b.setMode(Ge.LINES);
  52439. else
  52440. switch (a.drawMode) {
  52441. case n.TrianglesDrawMode:
  52442. b.setMode(Ge.TRIANGLES);
  52443. break;
  52444. case n.TriangleStripDrawMode:
  52445. b.setMode(Ge.TRIANGLE_STRIP);
  52446. break;
  52447. case n.TriangleFanDrawMode:
  52448. b.setMode(Ge.TRIANGLE_FAN)
  52449. }
  52450. else if (a instanceof n.Line) {
  52451. var D = o.linewidth;
  52452. void 0 === D && (D = 1),
  52453. Ye.setLineWidth(D * t()),
  52454. a instanceof n.LineSegments ? b.setMode(Ge.LINES) : b.setMode(Ge.LINE_STRIP)
  52455. } else
  52456. a instanceof n.Points && b.setMode(Ge.POINTS);
  52457. r instanceof n.InstancedBufferGeometry ? r.maxInstancedCount > 0 && b.renderInstances(r, P, L) : b.render(P, L)
  52458. }
  52459. ,
  52460. this.render = function(e, t, i, r) {
  52461. if (t instanceof n.Camera == !1)
  52462. return void console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");
  52463. var o = e.fog;
  52464. if (Ee = "",
  52465. Ie = -1,
  52466. be = null,
  52467. e.autoUpdate === !0 && e.updateMatrixWorld(),
  52468. null === t.parent && t.updateMatrixWorld(),
  52469. t.matrixWorldInverse.getInverse(t.matrixWorld),
  52470. Fe.multiplyMatrices(t.projectionMatrix, t.matrixWorldInverse),
  52471. Be.setFromMatrix(Fe),
  52472. ce.length = 0,
  52473. ue = -1,
  52474. pe = -1,
  52475. ge.length = 0,
  52476. me.length = 0,
  52477. y(e, t),
  52478. he.length = ue + 1,
  52479. de.length = pe + 1,
  52480. ve.sortObjects === !0 && (he.sort(m),
  52481. de.sort(v)),
  52482. U(ce, t),
  52483. $e.render(e, t),
  52484. He.calls = 0,
  52485. He.vertices = 0,
  52486. He.faces = 0,
  52487. He.points = 0,
  52488. void 0 === i && (i = null),
  52489. this.setRenderTarget(i),
  52490. (this.autoClear || r) && this.clear(this.autoClearColor, this.autoClearDepth, this.autoClearStencil),
  52491. e.overrideMaterial) {
  52492. var a = e.overrideMaterial;
  52493. C(he, t, o, a),
  52494. C(de, t, o, a)
  52495. } else
  52496. Ye.setBlending(n.NoBlending),
  52497. C(he, t, o),
  52498. C(de, t, o);
  52499. if (et.render(e, t),
  52500. tt.render(e, t, Te),
  52501. i) {
  52502. var s = i.texture;
  52503. s.generateMipmaps && z(i) && s.minFilter !== n.NearestFilter && s.minFilter !== n.LinearFilter && J(i)
  52504. }
  52505. Ye.setDepthTest(!0),
  52506. Ye.setDepthWrite(!0),
  52507. Ye.setColorWrite(!0)
  52508. }
  52509. ,
  52510. this.setFaceCulling = function(e, t) {
  52511. e === n.CullFaceNone ? Ye.disable(Ge.CULL_FACE) : (t === n.FrontFaceDirectionCW ? Ge.frontFace(Ge.CW) : Ge.frontFace(Ge.CCW),
  52512. e === n.CullFaceBack ? Ge.cullFace(Ge.BACK) : e === n.CullFaceFront ? Ge.cullFace(Ge.FRONT) : Ge.cullFace(Ge.FRONT_AND_BACK),
  52513. Ye.enable(Ge.CULL_FACE))
  52514. }
  52515. ,
  52516. this.setTexture = function(e, t) {
  52517. var i = Xe.get(e);
  52518. if (e.version > 0 && i.__version !== e.version) {
  52519. var n = e.image;
  52520. 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)
  52521. }
  52522. Ye.activeTexture(Ge.TEXTURE0 + t),
  52523. Ye.bindTexture(Ge.TEXTURE_2D, i.__webglTexture)
  52524. }
  52525. ,
  52526. this.getCurrentRenderTarget = function() {
  52527. return ye
  52528. }
  52529. ,
  52530. this.setRenderTarget = function(e) {
  52531. ye = e,
  52532. e && void 0 === Xe.get(e).__webglFramebuffer && Q(e);
  52533. var t, i = e instanceof n.WebGLRenderTargetCube;
  52534. if (e) {
  52535. var r = Xe.get(e);
  52536. t = i ? r.__webglFramebuffer[e.activeCubeFace] : r.__webglFramebuffer,
  52537. we.copy(e.scissor),
  52538. _e = e.scissorTest,
  52539. Te.copy(e.viewport)
  52540. } else
  52541. t = null,
  52542. we.copy(Le).multiplyScalar(Oe),
  52543. _e = De,
  52544. Te.copy(Ne).multiplyScalar(Oe);
  52545. if (Ce !== t && (Ge.bindFramebuffer(Ge.FRAMEBUFFER, t),
  52546. Ce = t),
  52547. Ye.scissor(we),
  52548. Ye.setScissorTest(_e),
  52549. Ye.viewport(Te),
  52550. i) {
  52551. var o = Xe.get(e.texture);
  52552. Ge.framebufferTexture2D(Ge.FRAMEBUFFER, Ge.COLOR_ATTACHMENT0, Ge.TEXTURE_CUBE_MAP_POSITIVE_X + e.activeCubeFace, o.__webglTexture, e.activeMipMapLevel)
  52553. }
  52554. }
  52555. ,
  52556. this.readRenderTargetPixels = function(e, t, i, r, o, a) {
  52557. if (e instanceof n.WebGLRenderTarget == !1)
  52558. return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");
  52559. var s = Xe.get(e).__webglFramebuffer;
  52560. if (s) {
  52561. var l = !1;
  52562. s !== Ce && (Ge.bindFramebuffer(Ge.FRAMEBUFFER, s),
  52563. l = !0);
  52564. try {
  52565. var c = e.texture;
  52566. if (c.format !== n.RGBAFormat && ee(c.format) !== Ge.getParameter(Ge.IMPLEMENTATION_COLOR_READ_FORMAT))
  52567. return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");
  52568. 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")))
  52569. return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");
  52570. 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.")
  52571. } finally {
  52572. l && Ge.bindFramebuffer(Ge.FRAMEBUFFER, Ce)
  52573. }
  52574. }
  52575. }
  52576. }
  52577. ,
  52578. n.WebGLRenderTarget = function(e, t, i) {
  52579. this.uuid = n.Math.generateUUID(),
  52580. this.width = e,
  52581. this.height = t,
  52582. this.scissor = new n.Vector4(0,0,e,t),
  52583. this.scissorTest = !1,
  52584. this.viewport = new n.Vector4(0,0,e,t),
  52585. i = i || {},
  52586. void 0 === i.minFilter && (i.minFilter = n.LinearFilter),
  52587. this.texture = new n.Texture(void 0,void 0,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy),
  52588. this.depthBuffer = void 0 === i.depthBuffer || i.depthBuffer,
  52589. this.stencilBuffer = void 0 === i.stencilBuffer || i.stencilBuffer
  52590. }
  52591. ,
  52592. n.WebGLRenderTarget.prototype = {
  52593. constructor: n.WebGLRenderTarget,
  52594. setSize: function(e, t) {
  52595. this.width === e && this.height === t || (this.width = e,
  52596. this.height = t,
  52597. this.dispose()),
  52598. this.viewport.set(0, 0, e, t),
  52599. this.scissor.set(0, 0, e, t)
  52600. },
  52601. clone: function() {
  52602. return (new this.constructor).copy(this)
  52603. },
  52604. copy: function(e) {
  52605. return this.width = e.width,
  52606. this.height = e.height,
  52607. this.viewport.copy(e.viewport),
  52608. this.texture = e.texture.clone(),
  52609. this.depthBuffer = e.depthBuffer,
  52610. this.stencilBuffer = e.stencilBuffer,
  52611. this
  52612. },
  52613. dispose: function() {
  52614. this.dispatchEvent({
  52615. type: "dispose"
  52616. })
  52617. }
  52618. },
  52619. n.EventDispatcher.prototype.apply(n.WebGLRenderTarget.prototype),
  52620. n.WebGLRenderTargetCube = function(e, t, i) {
  52621. n.WebGLRenderTarget.call(this, e, t, i),
  52622. this.activeCubeFace = 0,
  52623. this.activeMipMapLevel = 0
  52624. }
  52625. ,
  52626. n.WebGLRenderTargetCube.prototype = Object.create(n.WebGLRenderTarget.prototype),
  52627. n.WebGLRenderTargetCube.prototype.constructor = n.WebGLRenderTargetCube,
  52628. n.WebGLBufferRenderer = function(e, t, i) {
  52629. function r(e) {
  52630. s = e
  52631. }
  52632. function o(t, n) {
  52633. e.drawArrays(s, t, n),
  52634. i.calls++,
  52635. i.vertices += n,
  52636. s === e.TRIANGLES && (i.faces += n / 3)
  52637. }
  52638. function a(r) {
  52639. var o = t.get("ANGLE_instanced_arrays");
  52640. if (null === o)
  52641. return void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");
  52642. var a = r.attributes.position
  52643. , l = 0;
  52644. a instanceof n.InterleavedBufferAttribute ? (l = a.data.count,
  52645. o.drawArraysInstancedANGLE(s, 0, l, r.maxInstancedCount)) : (l = a.count,
  52646. o.drawArraysInstancedANGLE(s, 0, l, r.maxInstancedCount)),
  52647. i.calls++,
  52648. i.vertices += l * r.maxInstancedCount,
  52649. s === e.TRIANGLES && (i.faces += r.maxInstancedCount * l / 3)
  52650. }
  52651. var s;
  52652. this.setMode = r,
  52653. this.render = o,
  52654. this.renderInstances = a
  52655. }
  52656. ,
  52657. n.WebGLIndexedBufferRenderer = function(e, t, i) {
  52658. function n(e) {
  52659. s = e
  52660. }
  52661. function r(i) {
  52662. i.array instanceof Uint32Array && t.get("OES_element_index_uint") ? (l = e.UNSIGNED_INT,
  52663. c = 4) : (l = e.UNSIGNED_SHORT,
  52664. c = 2)
  52665. }
  52666. function o(t, n) {
  52667. e.drawElements(s, n, l, t * c),
  52668. i.calls++,
  52669. i.vertices += n,
  52670. s === e.TRIANGLES && (i.faces += n / 3)
  52671. }
  52672. function a(n, r, o) {
  52673. var a = t.get("ANGLE_instanced_arrays");
  52674. 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),
  52675. i.calls++,
  52676. i.vertices += o * n.maxInstancedCount,
  52677. void (s === e.TRIANGLES && (i.faces += n.maxInstancedCount * o / 3)))
  52678. }
  52679. var s, l, c;
  52680. this.setMode = n,
  52681. this.setIndex = r,
  52682. this.render = o,
  52683. this.renderInstances = a
  52684. }
  52685. ,
  52686. n.WebGLExtensions = function(e) {
  52687. var t = {};
  52688. this.get = function(i) {
  52689. if (void 0 !== t[i])
  52690. return t[i];
  52691. var n;
  52692. switch (i) {
  52693. case "EXT_texture_filter_anisotropic":
  52694. n = e.getExtension("EXT_texture_filter_anisotropic") || e.getExtension("MOZ_EXT_texture_filter_anisotropic") || e.getExtension("WEBKIT_EXT_texture_filter_anisotropic");
  52695. break;
  52696. case "WEBGL_compressed_texture_s3tc":
  52697. n = e.getExtension("WEBGL_compressed_texture_s3tc") || e.getExtension("MOZ_WEBGL_compressed_texture_s3tc") || e.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");
  52698. break;
  52699. case "WEBGL_compressed_texture_pvrtc":
  52700. n = e.getExtension("WEBGL_compressed_texture_pvrtc") || e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");
  52701. break;
  52702. case "WEBGL_compressed_texture_etc1":
  52703. n = e.getExtension("WEBGL_compressed_texture_etc1");
  52704. break;
  52705. default:
  52706. n = e.getExtension(i)
  52707. }
  52708. return null === n && console.warn("THREE.WebGLRenderer: " + i + " extension not supported."),
  52709. t[i] = n,
  52710. n
  52711. }
  52712. }
  52713. ,
  52714. n.WebGLCapabilities = function(e, t, i) {
  52715. function n(t) {
  52716. if ("highp" === t) {
  52717. if (e.getShaderPrecisionFormat(e.VERTEX_SHADER, e.HIGH_FLOAT).precision > 0 && e.getShaderPrecisionFormat(e.FRAGMENT_SHADER, e.HIGH_FLOAT).precision > 0)
  52718. return "highp";
  52719. t = "mediump"
  52720. }
  52721. 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"
  52722. }
  52723. this.getMaxPrecision = n,
  52724. this.precision = void 0 !== i.precision ? i.precision : "highp",
  52725. this.logarithmicDepthBuffer = void 0 !== i.logarithmicDepthBuffer && i.logarithmicDepthBuffer,
  52726. this.maxTextures = e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),
  52727. this.maxVertexTextures = e.getParameter(e.MAX_VERTEX_TEXTURE_IMAGE_UNITS),
  52728. this.maxTextureSize = e.getParameter(e.MAX_TEXTURE_SIZE),
  52729. this.maxCubemapSize = e.getParameter(e.MAX_CUBE_MAP_TEXTURE_SIZE),
  52730. this.maxAttributes = e.getParameter(e.MAX_VERTEX_ATTRIBS),
  52731. this.maxVertexUniforms = e.getParameter(e.MAX_VERTEX_UNIFORM_VECTORS),
  52732. this.maxVaryings = e.getParameter(e.MAX_VARYING_VECTORS),
  52733. this.maxFragmentUniforms = e.getParameter(e.MAX_FRAGMENT_UNIFORM_VECTORS),
  52734. this.vertexTextures = this.maxVertexTextures > 0,
  52735. this.floatFragmentTextures = !!t.get("OES_texture_float"),
  52736. this.floatVertexTextures = this.vertexTextures && this.floatFragmentTextures;
  52737. var r = n(this.precision);
  52738. r !== this.precision && (console.warn("THREE.WebGLRenderer:", this.precision, "not supported, using", r, "instead."),
  52739. this.precision = r),
  52740. this.logarithmicDepthBuffer && (this.logarithmicDepthBuffer = !!t.get("EXT_frag_depth"))
  52741. }
  52742. ,
  52743. n.WebGLGeometries = function(e, t, i) {
  52744. function r(e) {
  52745. var t = e.geometry;
  52746. if (void 0 !== h[t.id])
  52747. return h[t.id];
  52748. t.addEventListener("dispose", o);
  52749. var r;
  52750. return t instanceof n.BufferGeometry ? r = t : t instanceof n.Geometry && (void 0 === t._bufferGeometry && (t._bufferGeometry = (new n.BufferGeometry).setFromObject(e)),
  52751. r = t._bufferGeometry),
  52752. h[t.id] = r,
  52753. i.memory.geometries++,
  52754. r
  52755. }
  52756. function o(e) {
  52757. var n = e.target
  52758. , r = h[n.id];
  52759. null !== r.index && s(r.index),
  52760. l(r.attributes),
  52761. n.removeEventListener("dispose", o),
  52762. delete h[n.id];
  52763. var a = t.get(n);
  52764. a.wireframe && s(a.wireframe),
  52765. t.delete(n);
  52766. var c = t.get(r);
  52767. c.wireframe && s(c.wireframe),
  52768. t.delete(r),
  52769. i.memory.geometries--
  52770. }
  52771. function a(e) {
  52772. return e instanceof n.InterleavedBufferAttribute ? t.get(e.data).__webglBuffer : t.get(e).__webglBuffer
  52773. }
  52774. function s(t) {
  52775. var i = a(t);
  52776. void 0 !== i && (e.deleteBuffer(i),
  52777. c(t))
  52778. }
  52779. function l(e) {
  52780. for (var t in e)
  52781. s(e[t])
  52782. }
  52783. function c(e) {
  52784. e instanceof n.InterleavedBufferAttribute ? t.delete(e.data) : t.delete(e)
  52785. }
  52786. var h = {};
  52787. this.get = r
  52788. }
  52789. ,
  52790. n.WebGLLights = function() {
  52791. var e = {};
  52792. this.get = function(t) {
  52793. if (void 0 !== e[t.id])
  52794. return e[t.id];
  52795. var i;
  52796. switch (t.type) {
  52797. case "DirectionalLight":
  52798. i = {
  52799. direction: new n.Vector3,
  52800. color: new n.Color,
  52801. shadow: !1,
  52802. shadowBias: 0,
  52803. shadowRadius: 1,
  52804. shadowMapSize: new n.Vector2
  52805. };
  52806. break;
  52807. case "SpotLight":
  52808. i = {
  52809. position: new n.Vector3,
  52810. direction: new n.Vector3,
  52811. color: new n.Color,
  52812. distance: 0,
  52813. coneCos: 0,
  52814. penumbraCos: 0,
  52815. decay: 0,
  52816. shadow: !1,
  52817. shadowBias: 0,
  52818. shadowRadius: 1,
  52819. shadowMapSize: new n.Vector2
  52820. };
  52821. break;
  52822. case "PointLight":
  52823. i = {
  52824. position: new n.Vector3,
  52825. color: new n.Color,
  52826. distance: 0,
  52827. decay: 0,
  52828. shadow: !1,
  52829. shadowBias: 0,
  52830. shadowRadius: 1,
  52831. shadowMapSize: new n.Vector2
  52832. };
  52833. break;
  52834. case "HemisphereLight":
  52835. i = {
  52836. direction: new n.Vector3,
  52837. skyColor: new n.Color,
  52838. groundColor: new n.Color
  52839. }
  52840. }
  52841. return e[t.id] = i,
  52842. i
  52843. }
  52844. }
  52845. ,
  52846. n.WebGLObjects = function(e, t, i) {
  52847. function r(t) {
  52848. var i = u.get(t);
  52849. t.geometry instanceof n.Geometry && i.updateFromObject(t);
  52850. var r = i.index
  52851. , a = i.attributes;
  52852. null !== r && o(r, e.ELEMENT_ARRAY_BUFFER);
  52853. for (var s in a)
  52854. o(a[s], e.ARRAY_BUFFER);
  52855. var l = i.morphAttributes;
  52856. for (var s in l)
  52857. for (var c = l[s], h = 0, d = c.length; h < d; h++)
  52858. o(c[h], e.ARRAY_BUFFER);
  52859. return i
  52860. }
  52861. function o(e, i) {
  52862. var r = e instanceof n.InterleavedBufferAttribute ? e.data : e
  52863. , o = t.get(r);
  52864. void 0 === o.__webglBuffer ? a(o, r, i) : o.version !== r.version && s(o, r, i)
  52865. }
  52866. function a(t, i, n) {
  52867. t.__webglBuffer = e.createBuffer(),
  52868. e.bindBuffer(n, t.__webglBuffer);
  52869. var r = i.dynamic ? e.DYNAMIC_DRAW : e.STATIC_DRAW;
  52870. e.bufferData(n, i.array, r),
  52871. t.version = i.version
  52872. }
  52873. function s(t, i, n) {
  52874. e.bindBuffer(n, t.__webglBuffer),
  52875. 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)),
  52876. i.updateRange.count = 0),
  52877. t.version = i.version
  52878. }
  52879. function l(e) {
  52880. return e instanceof n.InterleavedBufferAttribute ? t.get(e.data).__webglBuffer : t.get(e).__webglBuffer
  52881. }
  52882. function c(i) {
  52883. var r = t.get(i);
  52884. if (void 0 !== r.wireframe)
  52885. return r.wireframe;
  52886. var a = []
  52887. , s = i.index
  52888. , l = i.attributes
  52889. , c = l.position;
  52890. if (null !== s)
  52891. for (var u = {}, d = s.array, p = 0, f = d.length; p < f; p += 3) {
  52892. var g = d[p + 0]
  52893. , m = d[p + 1]
  52894. , v = d[p + 2];
  52895. h(u, g, m) && a.push(g, m),
  52896. h(u, m, v) && a.push(m, v),
  52897. h(u, v, g) && a.push(v, g)
  52898. }
  52899. else
  52900. for (var d = l.position.array, p = 0, f = d.length / 3 - 1; p < f; p += 3) {
  52901. var g = p + 0
  52902. , m = p + 1
  52903. , v = p + 2;
  52904. a.push(g, m, m, v, v, g)
  52905. }
  52906. var A = c.count > 65535 ? Uint32Array : Uint16Array
  52907. , y = new n.BufferAttribute(new A(a),1);
  52908. return o(y, e.ELEMENT_ARRAY_BUFFER),
  52909. r.wireframe = y,
  52910. y
  52911. }
  52912. function h(e, t, i) {
  52913. if (t > i) {
  52914. var n = t;
  52915. t = i,
  52916. i = n
  52917. }
  52918. var r = e[t];
  52919. return void 0 === r ? (e[t] = [i],
  52920. !0) : r.indexOf(i) === -1 && (r.push(i),
  52921. !0)
  52922. }
  52923. var u = new n.WebGLGeometries(e,t,i);
  52924. this.getAttributeBuffer = l,
  52925. this.getWireframeAttribute = c,
  52926. this.update = r
  52927. }
  52928. ,
  52929. n.WebGLProgram = function() {
  52930. function e(e) {
  52931. switch (e) {
  52932. case n.LinearEncoding:
  52933. return ["Linear", "( value )"];
  52934. case n.sRGBEncoding:
  52935. return ["sRGB", "( value )"];
  52936. case n.RGBEEncoding:
  52937. return ["RGBE", "( value )"];
  52938. case n.RGBM7Encoding:
  52939. return ["RGBM", "( value, 7.0 )"];
  52940. case n.RGBM16Encoding:
  52941. return ["RGBM", "( value, 16.0 )"];
  52942. case n.RGBDEncoding:
  52943. return ["RGBD", "( value, 256.0 )"];
  52944. case n.GammaEncoding:
  52945. return ["Gamma", "( value, float( GAMMA_FACTOR ) )"];
  52946. default:
  52947. throw new Error("unsupported encoding: " + e)
  52948. }
  52949. }
  52950. function t(t, i) {
  52951. var n = e(i);
  52952. return "vec4 " + t + "( vec4 value ) { return " + n[0] + "ToLinear" + n[1] + "; }"
  52953. }
  52954. function i(t, i) {
  52955. var n = e(i);
  52956. return "vec4 " + t + "( vec4 value ) { return LinearTo" + n[0] + n[1] + "; }"
  52957. }
  52958. function r(e, t) {
  52959. var i;
  52960. switch (t) {
  52961. case n.LinearToneMapping:
  52962. i = "Linear";
  52963. break;
  52964. case n.ReinhardToneMapping:
  52965. i = "Reinhard";
  52966. break;
  52967. case n.Uncharted2ToneMapping:
  52968. i = "Uncharted2";
  52969. break;
  52970. case n.CineonToneMapping:
  52971. i = "OptimizedCineon";
  52972. break;
  52973. default:
  52974. throw new Error("unsupported toneMapping: " + t)
  52975. }
  52976. return "vec3 " + e + "( vec3 color ) { return " + i + "ToneMapping( color ); }"
  52977. }
  52978. function o(e, t, i) {
  52979. e = e || {};
  52980. 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" : ""];
  52981. return n.filter(c).join("\n")
  52982. }
  52983. function a(e) {
  52984. var t = [];
  52985. for (var i in e) {
  52986. var n = e[i];
  52987. n !== !1 && t.push("#define " + i + " " + n)
  52988. }
  52989. return t.join("\n")
  52990. }
  52991. function s(e, t, i) {
  52992. for (var n = {}, r = e.getProgramParameter(t, e.ACTIVE_UNIFORMS), o = 0; o < r; o++) {
  52993. var a = e.getActiveUniform(t, o)
  52994. , s = a.name
  52995. , l = e.getUniformLocation(t, s)
  52996. , c = f.exec(s);
  52997. if (c) {
  52998. var h = c[1]
  52999. , u = c[2]
  53000. , d = n[h];
  53001. d || (d = n[h] = {}),
  53002. d[u] = l
  53003. } else if (c = g.exec(s)) {
  53004. var p = c[1]
  53005. , v = c[2]
  53006. , A = c[3]
  53007. , y = n[p];
  53008. y || (y = n[p] = []);
  53009. var C = y[v];
  53010. C || (C = y[v] = {}),
  53011. C[A] = l
  53012. } else if (c = m.exec(s)) {
  53013. var p = c[1];
  53014. n[p] = l
  53015. } else
  53016. n[s] = l
  53017. }
  53018. return n
  53019. }
  53020. function l(e, t, i) {
  53021. for (var n = {}, r = e.getProgramParameter(t, e.ACTIVE_ATTRIBUTES), o = 0; o < r; o++) {
  53022. var a = e.getActiveAttrib(t, o)
  53023. , s = a.name;
  53024. n[s] = e.getAttribLocation(t, s)
  53025. }
  53026. return n
  53027. }
  53028. function c(e) {
  53029. return "" !== e
  53030. }
  53031. function h(e, t) {
  53032. 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)
  53033. }
  53034. function u(e) {
  53035. function t(e, t) {
  53036. var i = n.ShaderChunk[t];
  53037. if (void 0 === i)
  53038. throw new Error("Can not resolve #include <" + t + ">");
  53039. return u(i)
  53040. }
  53041. var i = /#include +<([\w\d.]+)>/g;
  53042. return e.replace(i, t)
  53043. }
  53044. function d(e) {
  53045. function t(e, t, i, n) {
  53046. for (var r = "", o = parseInt(t); o < parseInt(i); o++)
  53047. r += n.replace(/\[ i \]/g, "[ " + o + " ]");
  53048. return r
  53049. }
  53050. var i = /for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g;
  53051. return e.replace(i, t)
  53052. }
  53053. var p = 0
  53054. , f = /^([\w\d_]+)\.([\w\d_]+)$/
  53055. , g = /^([\w\d_]+)\[(\d+)\]\.([\w\d_]+)$/
  53056. , m = /^([\w\d_]+)\[0\]$/;
  53057. return function(e, f, g, m) {
  53058. var v = e.context
  53059. , A = g.extensions
  53060. , y = g.defines
  53061. , C = g.__webglShader.vertexShader
  53062. , I = g.__webglShader.fragmentShader
  53063. , E = "SHADOWMAP_TYPE_BASIC";
  53064. m.shadowMapType === n.PCFShadowMap ? E = "SHADOWMAP_TYPE_PCF" : m.shadowMapType === n.PCFSoftShadowMap && (E = "SHADOWMAP_TYPE_PCF_SOFT");
  53065. var b = "ENVMAP_TYPE_CUBE"
  53066. , w = "ENVMAP_MODE_REFLECTION"
  53067. , _ = "ENVMAP_BLENDING_MULTIPLY";
  53068. if (m.envMap) {
  53069. switch (g.envMap.mapping) {
  53070. case n.CubeReflectionMapping:
  53071. case n.CubeRefractionMapping:
  53072. b = "ENVMAP_TYPE_CUBE";
  53073. break;
  53074. case n.CubeUVReflectionMapping:
  53075. case n.CubeUVRefractionMapping:
  53076. b = "ENVMAP_TYPE_CUBE_UV";
  53077. break;
  53078. case n.EquirectangularReflectionMapping:
  53079. case n.EquirectangularRefractionMapping:
  53080. b = "ENVMAP_TYPE_EQUIREC";
  53081. break;
  53082. case n.SphericalReflectionMapping:
  53083. b = "ENVMAP_TYPE_SPHERE"
  53084. }
  53085. switch (g.envMap.mapping) {
  53086. case n.CubeRefractionMapping:
  53087. case n.EquirectangularRefractionMapping:
  53088. w = "ENVMAP_MODE_REFRACTION"
  53089. }
  53090. switch (g.combine) {
  53091. case n.MultiplyOperation:
  53092. _ = "ENVMAP_BLENDING_MULTIPLY";
  53093. break;
  53094. case n.MixOperation:
  53095. _ = "ENVMAP_BLENDING_MIX";
  53096. break;
  53097. case n.AddOperation:
  53098. _ = "ENVMAP_BLENDING_ADD"
  53099. }
  53100. }
  53101. var T, x, S = e.gammaFactor > 0 ? e.gammaFactor : 1, M = o(A, m, e.extensions), R = a(y), P = v.createProgram();
  53102. g instanceof n.RawShaderMaterial ? (T = "",
  53103. 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"),
  53104. 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")),
  53105. C = u(C, m),
  53106. C = h(C, m),
  53107. I = u(I, m),
  53108. I = h(I, m),
  53109. g instanceof n.ShaderMaterial == !1 && (C = d(C),
  53110. I = d(I));
  53111. var O = T + C
  53112. , L = x + I
  53113. , D = n.WebGLShader(v, v.VERTEX_SHADER, O)
  53114. , N = n.WebGLShader(v, v.FRAGMENT_SHADER, L);
  53115. v.attachShader(P, D),
  53116. v.attachShader(P, N),
  53117. void 0 !== g.index0AttributeName ? v.bindAttribLocation(P, 0, g.index0AttributeName) : m.morphTargets === !0 && v.bindAttribLocation(P, 0, "position"),
  53118. v.linkProgram(P);
  53119. var B = v.getProgramInfoLog(P)
  53120. , F = v.getShaderInfoLog(D)
  53121. , V = v.getShaderInfoLog(N)
  53122. , U = !0
  53123. , k = !0;
  53124. v.getProgramParameter(P, v.LINK_STATUS) === !1 ? (U = !1,
  53125. 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),
  53126. k && (this.diagnostics = {
  53127. runnable: U,
  53128. material: g,
  53129. programLog: B,
  53130. vertexShader: {
  53131. log: F,
  53132. prefix: T
  53133. },
  53134. fragmentShader: {
  53135. log: V,
  53136. prefix: x
  53137. }
  53138. }),
  53139. v.deleteShader(D),
  53140. v.deleteShader(N);
  53141. var H;
  53142. this.getUniforms = function() {
  53143. return void 0 === H && (H = s(v, P)),
  53144. H
  53145. }
  53146. ;
  53147. var G;
  53148. return this.getAttributes = function() {
  53149. return void 0 === G && (G = l(v, P)),
  53150. G
  53151. }
  53152. ,
  53153. this.destroy = function() {
  53154. v.deleteProgram(P),
  53155. this.program = void 0
  53156. }
  53157. ,
  53158. Object.defineProperties(this, {
  53159. uniforms: {
  53160. get: function() {
  53161. return console.warn("THREE.WebGLProgram: .uniforms is now .getUniforms()."),
  53162. this.getUniforms()
  53163. }
  53164. },
  53165. attributes: {
  53166. get: function() {
  53167. return console.warn("THREE.WebGLProgram: .attributes is now .getAttributes()."),
  53168. this.getAttributes()
  53169. }
  53170. }
  53171. }),
  53172. this.id = p++,
  53173. this.code = f,
  53174. this.usedTimes = 1,
  53175. this.program = P,
  53176. this.vertexShader = D,
  53177. this.fragmentShader = N,
  53178. this
  53179. }
  53180. }(),
  53181. n.WebGLPrograms = function(e, t) {
  53182. function i(e) {
  53183. if (t.floatVertexTextures && e && e.skeleton && e.skeleton.useVertexTexture)
  53184. return 1024;
  53185. var i = t.maxVertexUniforms
  53186. , r = Math.floor((i - 20) / 4)
  53187. , o = r;
  53188. return void 0 !== e && e instanceof n.SkinnedMesh && (o = Math.min(e.skeleton.bones.length, o),
  53189. 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)")),
  53190. o
  53191. }
  53192. function r(e, t) {
  53193. var i;
  53194. return e ? e instanceof n.Texture ? i = e.encoding : e instanceof n.WebGLRenderTarget && (i = e.texture.encoding) : i = n.LinearEncoding,
  53195. i === n.LinearEncoding && t && (i = n.GammaEncoding),
  53196. i
  53197. }
  53198. var o = []
  53199. , a = {
  53200. MeshDepthMaterial: "depth",
  53201. MeshNormalMaterial: "normal",
  53202. MeshBasicMaterial: "basic",
  53203. MeshLambertMaterial: "lambert",
  53204. MeshPhongMaterial: "phong",
  53205. MeshStandardMaterial: "standard",
  53206. LineBasicMaterial: "basic",
  53207. LineDashedMaterial: "dashed",
  53208. PointsMaterial: "points"
  53209. }
  53210. , 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"];
  53211. this.getParameters = function(o, s, l, c) {
  53212. var h = a[o.type]
  53213. , u = i(c)
  53214. , d = e.getPrecision();
  53215. null !== o.precision && (d = t.getMaxPrecision(o.precision),
  53216. d !== o.precision && console.warn("THREE.WebGLProgram.getParameters:", o.precision, "not supported, using", d, "instead."));
  53217. var p = {
  53218. shaderID: h,
  53219. precision: d,
  53220. supportsVertexTextures: t.vertexTextures,
  53221. outputEncoding: r(e.getCurrentRenderTarget(), e.gammaOutput),
  53222. map: !!o.map,
  53223. mapEncoding: r(o.map, e.gammaInput),
  53224. envMap: !!o.envMap,
  53225. envMapMode: o.envMap && o.envMap.mapping,
  53226. envMapEncoding: r(o.envMap, e.gammaInput),
  53227. envMapCubeUV: !!o.envMap && (o.envMap.mapping === n.CubeUVReflectionMapping || o.envMap.mapping === n.CubeUVRefractionMapping),
  53228. lightMap: !!o.lightMap,
  53229. aoMap: !!o.aoMap,
  53230. emissiveMap: !!o.emissiveMap,
  53231. emissiveMapEncoding: r(o.emissiveMap, e.gammaInput),
  53232. bumpMap: !!o.bumpMap,
  53233. normalMap: !!o.normalMap,
  53234. displacementMap: !!o.displacementMap,
  53235. roughnessMap: !!o.roughnessMap,
  53236. metalnessMap: !!o.metalnessMap,
  53237. specularMap: !!o.specularMap,
  53238. alphaMap: !!o.alphaMap,
  53239. combine: o.combine,
  53240. vertexColors: o.vertexColors,
  53241. fog: l,
  53242. useFog: o.fog,
  53243. fogExp: l instanceof n.FogExp2,
  53244. flatShading: o.shading === n.FlatShading,
  53245. sizeAttenuation: o.sizeAttenuation,
  53246. logarithmicDepthBuffer: t.logarithmicDepthBuffer,
  53247. skinning: o.skinning,
  53248. maxBones: u,
  53249. useVertexTexture: t.floatVertexTextures && c && c.skeleton && c.skeleton.useVertexTexture,
  53250. morphTargets: o.morphTargets,
  53251. morphNormals: o.morphNormals,
  53252. maxMorphTargets: e.maxMorphTargets,
  53253. maxMorphNormals: e.maxMorphNormals,
  53254. numDirLights: s.directional.length,
  53255. numPointLights: s.point.length,
  53256. numSpotLights: s.spot.length,
  53257. numHemiLights: s.hemi.length,
  53258. pointLightShadows: s.shadowsPointLight,
  53259. shadowMapEnabled: e.shadowMap.enabled && c.receiveShadow && s.shadows.length > 0,
  53260. shadowMapType: e.shadowMap.type,
  53261. toneMapping: e.toneMapping,
  53262. physicallyCorrectLights: e.physicallyCorrectLights,
  53263. premultipliedAlpha: o.premultipliedAlpha,
  53264. alphaTest: o.alphaTest,
  53265. doubleSided: o.side === n.DoubleSide,
  53266. flipSided: o.side === n.BackSide
  53267. };
  53268. return p
  53269. }
  53270. ,
  53271. this.getProgramCode = function(e, t) {
  53272. var i = [];
  53273. if (t.shaderID ? i.push(t.shaderID) : (i.push(e.fragmentShader),
  53274. i.push(e.vertexShader)),
  53275. void 0 !== e.defines)
  53276. for (var n in e.defines)
  53277. i.push(n),
  53278. i.push(e.defines[n]);
  53279. for (var r = 0; r < s.length; r++) {
  53280. var o = s[r];
  53281. i.push(o),
  53282. i.push(t[o])
  53283. }
  53284. return i.join()
  53285. }
  53286. ,
  53287. this.acquireProgram = function(t, i, r) {
  53288. for (var a, s = 0, l = o.length; s < l; s++) {
  53289. var c = o[s];
  53290. if (c.code === r) {
  53291. a = c,
  53292. ++a.usedTimes;
  53293. break
  53294. }
  53295. }
  53296. return void 0 === a && (a = new n.WebGLProgram(e,r,t,i),
  53297. o.push(a)),
  53298. a
  53299. }
  53300. ,
  53301. this.releaseProgram = function(e) {
  53302. if (0 === --e.usedTimes) {
  53303. var t = o.indexOf(e);
  53304. o[t] = o[o.length - 1],
  53305. o.pop(),
  53306. e.destroy()
  53307. }
  53308. }
  53309. ,
  53310. this.programs = o
  53311. }
  53312. ,
  53313. n.WebGLProperties = function() {
  53314. var e = {};
  53315. this.get = function(t) {
  53316. var i = t.uuid
  53317. , n = e[i];
  53318. return void 0 === n && (n = {},
  53319. e[i] = n),
  53320. n
  53321. }
  53322. ,
  53323. this.delete = function(t) {
  53324. delete e[t.uuid]
  53325. }
  53326. ,
  53327. this.clear = function() {
  53328. e = {}
  53329. }
  53330. }
  53331. ,
  53332. n.WebGLShader = function() {
  53333. function e(e) {
  53334. for (var t = e.split("\n"), i = 0; i < t.length; i++)
  53335. t[i] = i + 1 + ": " + t[i];
  53336. return t.join("\n")
  53337. }
  53338. return function(t, i, n) {
  53339. var r = t.createShader(i);
  53340. return t.shaderSource(r, n),
  53341. t.compileShader(r),
  53342. t.getShaderParameter(r, t.COMPILE_STATUS) === !1 && console.error("THREE.WebGLShader: Shader couldn't compile."),
  53343. "" !== t.getShaderInfoLog(r) && console.warn("THREE.WebGLShader: gl.getShaderInfoLog()", i === t.VERTEX_SHADER ? "vertex" : "fragment", t.getShaderInfoLog(r), e(n)),
  53344. r
  53345. }
  53346. }(),
  53347. n.WebGLShadowMap = function(e, t, i) {
  53348. function r(e, t, i, r) {
  53349. var o = e.geometry
  53350. , a = null
  53351. , s = v
  53352. , l = e.customDepthMaterial;
  53353. if (i && (s = A,
  53354. l = e.customDistanceMaterial),
  53355. l)
  53356. a = l;
  53357. else {
  53358. var c = void 0 !== o.morphTargets && o.morphTargets.length > 0 && t.morphTargets
  53359. , h = e instanceof n.SkinnedMesh && t.skinning
  53360. , u = 0;
  53361. c && (u |= f),
  53362. h && (u |= g),
  53363. a = s[u]
  53364. }
  53365. return a.visible = t.visible,
  53366. a.wireframe = t.wireframe,
  53367. a.wireframeLinewidth = t.wireframeLinewidth,
  53368. i && void 0 !== a.uniforms.lightPos && a.uniforms.lightPos.value.copy(r),
  53369. a
  53370. }
  53371. function o(e, t, i) {
  53372. if (e.visible !== !1) {
  53373. 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)) {
  53374. var r = e.material;
  53375. r.visible === !0 && (e.modelViewMatrix.multiplyMatrices(i.matrixWorldInverse, e.matrixWorld),
  53376. p.push(e))
  53377. }
  53378. for (var a = e.children, s = 0, c = a.length; s < c; s++)
  53379. o(a[s], t, i)
  53380. }
  53381. }
  53382. 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) {
  53383. var x = 0 !== (T & f)
  53384. , S = 0 !== (T & g)
  53385. , M = new n.ShaderMaterial({
  53386. uniforms: b,
  53387. vertexShader: E.vertexShader,
  53388. fragmentShader: E.fragmentShader,
  53389. morphTargets: x,
  53390. skinning: S
  53391. });
  53392. v[T] = M;
  53393. var R = new n.ShaderMaterial({
  53394. defines: {
  53395. USE_SHADOWMAP: ""
  53396. },
  53397. uniforms: _,
  53398. vertexShader: w.vertexShader,
  53399. fragmentShader: w.fragmentShader,
  53400. morphTargets: x,
  53401. skinning: S
  53402. });
  53403. A[T] = R
  53404. }
  53405. var P = this;
  53406. this.enabled = !1,
  53407. this.autoUpdate = !0,
  53408. this.needsUpdate = !1,
  53409. this.type = n.PCFShadowMap,
  53410. this.cullFace = n.CullFaceFront,
  53411. this.render = function(f, g) {
  53412. var m, v, A = t.shadows;
  53413. if (0 !== A.length && P.enabled !== !1 && (P.autoUpdate !== !1 || P.needsUpdate !== !1)) {
  53414. s.clearColor(1, 1, 1, 1),
  53415. s.disable(a.BLEND),
  53416. s.enable(a.CULL_FACE),
  53417. a.frontFace(a.CCW),
  53418. a.cullFace(P.cullFace === n.CullFaceFront ? a.FRONT : a.BACK),
  53419. s.setDepthTest(!0),
  53420. s.setScissorTest(!1);
  53421. for (var E = 0, b = A.length; E < b; E++) {
  53422. var w = A[E]
  53423. , _ = w.shadow
  53424. , T = _.camera;
  53425. if (h.copy(_.mapSize),
  53426. w instanceof n.PointLight) {
  53427. m = 6,
  53428. v = !0;
  53429. var x = h.x
  53430. , S = h.y;
  53431. I[0].set(2 * x, S, x, S),
  53432. I[1].set(0, S, x, S),
  53433. I[2].set(3 * x, S, x, S),
  53434. I[3].set(x, S, x, S),
  53435. I[4].set(3 * x, 0, x, S),
  53436. I[5].set(x, 0, x, S),
  53437. h.x *= 4,
  53438. h.y *= 2
  53439. } else
  53440. m = 1,
  53441. v = !1;
  53442. if (null === _.map) {
  53443. var M = {
  53444. minFilter: n.NearestFilter,
  53445. magFilter: n.NearestFilter,
  53446. format: n.RGBAFormat
  53447. };
  53448. _.map = new n.WebGLRenderTarget(h.x,h.y,M),
  53449. w instanceof n.SpotLight && (T.aspect = h.x / h.y),
  53450. T.updateProjectionMatrix()
  53451. }
  53452. var R = _.map
  53453. , O = _.matrix;
  53454. d.setFromMatrixPosition(w.matrixWorld),
  53455. T.position.copy(d),
  53456. e.setRenderTarget(R),
  53457. e.clear();
  53458. for (var L = 0; L < m; L++) {
  53459. if (v) {
  53460. u.copy(T.position),
  53461. u.add(y[L]),
  53462. T.up.copy(C[L]),
  53463. T.lookAt(u);
  53464. var D = I[L];
  53465. s.viewport(D)
  53466. } else
  53467. u.setFromMatrixPosition(w.target.matrixWorld),
  53468. T.lookAt(u);
  53469. T.updateMatrixWorld(),
  53470. T.matrixWorldInverse.getInverse(T.matrixWorld),
  53471. O.set(.5, 0, 0, .5, 0, .5, 0, .5, 0, 0, .5, .5, 0, 0, 0, 1),
  53472. O.multiply(T.projectionMatrix),
  53473. O.multiply(T.matrixWorldInverse),
  53474. c.multiplyMatrices(T.projectionMatrix, T.matrixWorldInverse),
  53475. l.setFromMatrix(c),
  53476. p.length = 0,
  53477. o(f, g, T);
  53478. for (var N = 0, B = p.length; N < B; N++) {
  53479. var F = p[N]
  53480. , V = i.update(F)
  53481. , U = F.material;
  53482. if (U instanceof n.MultiMaterial)
  53483. for (var k = V.groups, H = U.materials, G = 0, z = k.length; G < z; G++) {
  53484. var W = k[G]
  53485. , j = H[W.materialIndex];
  53486. if (j.visible === !0) {
  53487. var Y = r(F, j, v, d);
  53488. e.renderBufferDirect(T, null, V, Y, F, W)
  53489. }
  53490. }
  53491. else {
  53492. var Y = r(F, U, v, d);
  53493. e.renderBufferDirect(T, null, V, Y, F, null)
  53494. }
  53495. }
  53496. }
  53497. }
  53498. var X = e.getClearColor()
  53499. , Z = e.getClearAlpha();
  53500. e.setClearColor(X, Z),
  53501. s.enable(a.BLEND),
  53502. P.cullFace === n.CullFaceFront && a.cullFace(a.BACK),
  53503. P.needsUpdate = !1
  53504. }
  53505. }
  53506. }
  53507. ,
  53508. n.WebGLState = function(e, t, i) {
  53509. var r = this
  53510. , o = new n.Vector4
  53511. , a = new Uint8Array(16)
  53512. , s = new Uint8Array(16)
  53513. , l = new Uint8Array(16)
  53514. , c = {}
  53515. , h = null
  53516. , u = null
  53517. , d = null
  53518. , p = null
  53519. , f = null
  53520. , g = null
  53521. , m = null
  53522. , v = null
  53523. , A = !1
  53524. , y = null
  53525. , C = null
  53526. , I = null
  53527. , E = null
  53528. , b = null
  53529. , w = null
  53530. , _ = null
  53531. , T = null
  53532. , x = null
  53533. , S = null
  53534. , M = null
  53535. , R = null
  53536. , P = null
  53537. , O = null
  53538. , L = null
  53539. , D = e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS)
  53540. , N = void 0
  53541. , B = {}
  53542. , F = new n.Vector4
  53543. , V = null
  53544. , U = null
  53545. , k = new n.Vector4
  53546. , H = new n.Vector4
  53547. , G = e.createTexture();
  53548. e.bindTexture(e.TEXTURE_2D, G),
  53549. e.texParameteri(e.TEXTURE_2D, e.TEXTURE_MIN_FILTER, e.LINEAR),
  53550. e.texImage2D(e.TEXTURE_2D, 0, e.RGB, 1, 1, 0, e.RGB, e.UNSIGNED_BYTE, new Uint8Array(3)),
  53551. this.init = function() {
  53552. this.clearColor(0, 0, 0, 1),
  53553. this.clearDepth(1),
  53554. this.clearStencil(0),
  53555. this.enable(e.DEPTH_TEST),
  53556. e.depthFunc(e.LEQUAL),
  53557. e.frontFace(e.CCW),
  53558. e.cullFace(e.BACK),
  53559. this.enable(e.CULL_FACE),
  53560. this.enable(e.BLEND),
  53561. e.blendEquation(e.FUNC_ADD),
  53562. e.blendFunc(e.SRC_ALPHA, e.ONE_MINUS_SRC_ALPHA)
  53563. }
  53564. ,
  53565. this.initAttributes = function() {
  53566. for (var e = 0, t = a.length; e < t; e++)
  53567. a[e] = 0
  53568. }
  53569. ,
  53570. this.enableAttribute = function(i) {
  53571. if (a[i] = 1,
  53572. 0 === s[i] && (e.enableVertexAttribArray(i),
  53573. s[i] = 1),
  53574. 0 !== l[i]) {
  53575. var n = t.get("ANGLE_instanced_arrays");
  53576. n.vertexAttribDivisorANGLE(i, 0),
  53577. l[i] = 0
  53578. }
  53579. }
  53580. ,
  53581. this.enableAttributeAndDivisor = function(t, i, n) {
  53582. a[t] = 1,
  53583. 0 === s[t] && (e.enableVertexAttribArray(t),
  53584. s[t] = 1),
  53585. l[t] !== i && (n.vertexAttribDivisorANGLE(t, i),
  53586. l[t] = i)
  53587. }
  53588. ,
  53589. this.disableUnusedAttributes = function() {
  53590. for (var t = 0, i = s.length; t < i; t++)
  53591. s[t] !== a[t] && (e.disableVertexAttribArray(t),
  53592. s[t] = 0)
  53593. }
  53594. ,
  53595. this.enable = function(t) {
  53596. c[t] !== !0 && (e.enable(t),
  53597. c[t] = !0)
  53598. }
  53599. ,
  53600. this.disable = function(t) {
  53601. c[t] !== !1 && (e.disable(t),
  53602. c[t] = !1)
  53603. }
  53604. ,
  53605. this.getCompressedTextureFormats = function() {
  53606. if (null === h && (h = [],
  53607. t.get("WEBGL_compressed_texture_pvrtc") || t.get("WEBGL_compressed_texture_s3tc") || t.get("WEBGL_compressed_texture_etc1")))
  53608. for (var i = e.getParameter(e.COMPRESSED_TEXTURE_FORMATS), n = 0; n < i.length; n++)
  53609. h.push(i[n]);
  53610. return h
  53611. }
  53612. ,
  53613. this.setBlending = function(t, r, o, a, s, l, c, h) {
  53614. t === n.NoBlending ? this.disable(e.BLEND) : this.enable(e.BLEND),
  53615. t === u && h === A || (t === n.AdditiveBlending ? h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  53616. e.blendFuncSeparate(e.ONE, e.ONE, e.ONE, e.ONE)) : (e.blendEquation(e.FUNC_ADD),
  53617. e.blendFunc(e.SRC_ALPHA, e.ONE)) : t === n.SubtractiveBlending ? h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  53618. e.blendFuncSeparate(e.ZERO, e.ZERO, e.ONE_MINUS_SRC_COLOR, e.ONE_MINUS_SRC_ALPHA)) : (e.blendEquation(e.FUNC_ADD),
  53619. e.blendFunc(e.ZERO, e.ONE_MINUS_SRC_COLOR)) : t === n.MultiplyBlending ? h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  53620. e.blendFuncSeparate(e.ZERO, e.ZERO, e.SRC_COLOR, e.SRC_ALPHA)) : (e.blendEquation(e.FUNC_ADD),
  53621. e.blendFunc(e.ZERO, e.SRC_COLOR)) : h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  53622. e.blendFuncSeparate(e.ONE, e.ONE_MINUS_SRC_ALPHA, e.ONE, e.ONE_MINUS_SRC_ALPHA)) : (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  53623. e.blendFuncSeparate(e.SRC_ALPHA, e.ONE_MINUS_SRC_ALPHA, e.ONE, e.ONE_MINUS_SRC_ALPHA)),
  53624. u = t,
  53625. A = h),
  53626. t === n.CustomBlending ? (s = s || r,
  53627. l = l || o,
  53628. c = c || a,
  53629. r === d && s === g || (e.blendEquationSeparate(i(r), i(s)),
  53630. d = r,
  53631. g = s),
  53632. o === p && a === f && l === m && c === v || (e.blendFuncSeparate(i(o), i(a), i(l), i(c)),
  53633. p = o,
  53634. f = a,
  53635. m = l,
  53636. v = c)) : (d = null,
  53637. p = null,
  53638. f = null,
  53639. g = null,
  53640. m = null,
  53641. v = null)
  53642. }
  53643. ,
  53644. this.setDepthFunc = function(t) {
  53645. if (y !== t) {
  53646. if (t)
  53647. switch (t) {
  53648. case n.NeverDepth:
  53649. e.depthFunc(e.NEVER);
  53650. break;
  53651. case n.AlwaysDepth:
  53652. e.depthFunc(e.ALWAYS);
  53653. break;
  53654. case n.LessDepth:
  53655. e.depthFunc(e.LESS);
  53656. break;
  53657. case n.LessEqualDepth:
  53658. e.depthFunc(e.LEQUAL);
  53659. break;
  53660. case n.EqualDepth:
  53661. e.depthFunc(e.EQUAL);
  53662. break;
  53663. case n.GreaterEqualDepth:
  53664. e.depthFunc(e.GEQUAL);
  53665. break;
  53666. case n.GreaterDepth:
  53667. e.depthFunc(e.GREATER);
  53668. break;
  53669. case n.NotEqualDepth:
  53670. e.depthFunc(e.NOTEQUAL);
  53671. break;
  53672. default:
  53673. e.depthFunc(e.LEQUAL)
  53674. }
  53675. else
  53676. e.depthFunc(e.LEQUAL);
  53677. y = t
  53678. }
  53679. }
  53680. ,
  53681. this.setDepthTest = function(t) {
  53682. t ? this.enable(e.DEPTH_TEST) : this.disable(e.DEPTH_TEST)
  53683. }
  53684. ,
  53685. this.setDepthWrite = function(t) {
  53686. C !== t && (e.depthMask(t),
  53687. C = t)
  53688. }
  53689. ,
  53690. this.setColorWrite = function(t) {
  53691. I !== t && (e.colorMask(t, t, t, t),
  53692. I = t)
  53693. }
  53694. ,
  53695. this.setStencilFunc = function(t, i, n) {
  53696. b === t && w === i && _ === n || (e.stencilFunc(t, i, n),
  53697. b = t,
  53698. w = i,
  53699. _ = n)
  53700. }
  53701. ,
  53702. this.setStencilOp = function(t, i, n) {
  53703. T === t && x === i && S === n || (e.stencilOp(t, i, n),
  53704. T = t,
  53705. x = i,
  53706. S = n)
  53707. }
  53708. ,
  53709. this.setStencilTest = function(t) {
  53710. t ? this.enable(e.STENCIL_TEST) : this.disable(e.STENCIL_TEST)
  53711. }
  53712. ,
  53713. this.setStencilWrite = function(t) {
  53714. E !== t && (e.stencilMask(t),
  53715. E = t)
  53716. }
  53717. ,
  53718. this.setFlipSided = function(t) {
  53719. M !== t && (t ? e.frontFace(e.CW) : e.frontFace(e.CCW),
  53720. M = t)
  53721. }
  53722. ,
  53723. this.setLineWidth = function(t) {
  53724. t !== R && (e.lineWidth(t),
  53725. R = t)
  53726. }
  53727. ,
  53728. this.setPolygonOffset = function(t, i, n) {
  53729. t ? this.enable(e.POLYGON_OFFSET_FILL) : this.disable(e.POLYGON_OFFSET_FILL),
  53730. !t || P === i && O === n || (e.polygonOffset(i, n),
  53731. P = i,
  53732. O = n)
  53733. }
  53734. ,
  53735. this.getScissorTest = function() {
  53736. return L
  53737. }
  53738. ,
  53739. this.setScissorTest = function(t) {
  53740. L = t,
  53741. t ? this.enable(e.SCISSOR_TEST) : this.disable(e.SCISSOR_TEST)
  53742. }
  53743. ,
  53744. this.activeTexture = function(t) {
  53745. void 0 === t && (t = e.TEXTURE0 + D - 1),
  53746. N !== t && (e.activeTexture(t),
  53747. N = t)
  53748. }
  53749. ,
  53750. this.bindTexture = function(t, i) {
  53751. void 0 === N && r.activeTexture();
  53752. var n = B[N];
  53753. void 0 === n && (n = {
  53754. type: void 0,
  53755. texture: void 0
  53756. },
  53757. B[N] = n),
  53758. n.type === t && n.texture === i || (e.bindTexture(t, i || G),
  53759. n.type = t,
  53760. n.texture = i)
  53761. }
  53762. ,
  53763. this.compressedTexImage2D = function() {
  53764. try {
  53765. e.compressedTexImage2D.apply(e, arguments)
  53766. } catch (e) {
  53767. console.error(e)
  53768. }
  53769. }
  53770. ,
  53771. this.texImage2D = function() {
  53772. try {
  53773. e.texImage2D.apply(e, arguments)
  53774. } catch (e) {
  53775. console.error(e)
  53776. }
  53777. }
  53778. ,
  53779. this.clearColor = function(t, i, n, r) {
  53780. o.set(t, i, n, r),
  53781. F.equals(o) === !1 && (e.clearColor(t, i, n, r),
  53782. F.copy(o))
  53783. }
  53784. ,
  53785. this.clearDepth = function(t) {
  53786. V !== t && (e.clearDepth(t),
  53787. V = t)
  53788. }
  53789. ,
  53790. this.clearStencil = function(t) {
  53791. U !== t && (e.clearStencil(t),
  53792. U = t)
  53793. }
  53794. ,
  53795. this.scissor = function(t) {
  53796. k.equals(t) === !1 && (e.scissor(t.x, t.y, t.z, t.w),
  53797. k.copy(t))
  53798. }
  53799. ,
  53800. this.viewport = function(t) {
  53801. H.equals(t) === !1 && (e.viewport(t.x, t.y, t.z, t.w),
  53802. H.copy(t))
  53803. }
  53804. ,
  53805. this.reset = function() {
  53806. for (var t = 0; t < s.length; t++)
  53807. 1 === s[t] && (e.disableVertexAttribArray(t),
  53808. s[t] = 0);
  53809. c = {},
  53810. h = null,
  53811. N = void 0,
  53812. B = {},
  53813. u = null,
  53814. I = null,
  53815. C = null,
  53816. E = null,
  53817. M = null
  53818. }
  53819. }
  53820. ,
  53821. n.LensFlarePlugin = function(e, t) {
  53822. function i() {
  53823. var e = new Float32Array([-1, -1, 0, 0, 1, -1, 1, 0, 1, 1, 1, 1, -1, 1, 0, 1])
  53824. , t = new Uint16Array([0, 1, 2, 0, 2, 3]);
  53825. o = p.createBuffer(),
  53826. a = p.createBuffer(),
  53827. p.bindBuffer(p.ARRAY_BUFFER, o),
  53828. p.bufferData(p.ARRAY_BUFFER, e, p.STATIC_DRAW),
  53829. p.bindBuffer(p.ELEMENT_ARRAY_BUFFER, a),
  53830. p.bufferData(p.ELEMENT_ARRAY_BUFFER, t, p.STATIC_DRAW),
  53831. u = p.createTexture(),
  53832. d = p.createTexture(),
  53833. f.bindTexture(p.TEXTURE_2D, u),
  53834. p.texImage2D(p.TEXTURE_2D, 0, p.RGB, 16, 16, 0, p.RGB, p.UNSIGNED_BYTE, null),
  53835. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_WRAP_S, p.CLAMP_TO_EDGE),
  53836. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_WRAP_T, p.CLAMP_TO_EDGE),
  53837. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_MAG_FILTER, p.NEAREST),
  53838. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_MIN_FILTER, p.NEAREST),
  53839. f.bindTexture(p.TEXTURE_2D, d),
  53840. p.texImage2D(p.TEXTURE_2D, 0, p.RGBA, 16, 16, 0, p.RGBA, p.UNSIGNED_BYTE, null),
  53841. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_WRAP_S, p.CLAMP_TO_EDGE),
  53842. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_WRAP_T, p.CLAMP_TO_EDGE),
  53843. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_MAG_FILTER, p.NEAREST),
  53844. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_MIN_FILTER, p.NEAREST),
  53845. h = p.getParameter(p.MAX_VERTEX_TEXTURE_IMAGE_UNITS) > 0;
  53846. var i;
  53847. i = h ? {
  53848. 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"),
  53849. 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")
  53850. } : {
  53851. 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"),
  53852. 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")
  53853. },
  53854. s = r(i),
  53855. l = {
  53856. vertex: p.getAttribLocation(s, "position"),
  53857. uv: p.getAttribLocation(s, "uv")
  53858. },
  53859. c = {
  53860. renderType: p.getUniformLocation(s, "renderType"),
  53861. map: p.getUniformLocation(s, "map"),
  53862. occlusionMap: p.getUniformLocation(s, "occlusionMap"),
  53863. opacity: p.getUniformLocation(s, "opacity"),
  53864. color: p.getUniformLocation(s, "color"),
  53865. scale: p.getUniformLocation(s, "scale"),
  53866. rotation: p.getUniformLocation(s, "rotation"),
  53867. screenPosition: p.getUniformLocation(s, "screenPosition")
  53868. }
  53869. }
  53870. function r(t) {
  53871. var i = p.createProgram()
  53872. , n = p.createShader(p.FRAGMENT_SHADER)
  53873. , r = p.createShader(p.VERTEX_SHADER)
  53874. , o = "precision " + e.getPrecision() + " float;\n";
  53875. return p.shaderSource(n, o + t.fragmentShader),
  53876. p.shaderSource(r, o + t.vertexShader),
  53877. p.compileShader(n),
  53878. p.compileShader(r),
  53879. p.attachShader(i, n),
  53880. p.attachShader(i, r),
  53881. p.linkProgram(i),
  53882. i
  53883. }
  53884. var o, a, s, l, c, h, u, d, p = e.context, f = e.state;
  53885. this.render = function(r, g, m) {
  53886. if (0 !== t.length) {
  53887. var v = new n.Vector3
  53888. , A = m.w / m.z
  53889. , y = .5 * m.z
  53890. , C = .5 * m.w
  53891. , I = 16 / m.w
  53892. , E = new n.Vector2(I * A,I)
  53893. , b = new n.Vector3(1,1,0)
  53894. , w = new n.Vector2(1,1);
  53895. void 0 === s && i(),
  53896. p.useProgram(s),
  53897. f.initAttributes(),
  53898. f.enableAttribute(l.vertex),
  53899. f.enableAttribute(l.uv),
  53900. f.disableUnusedAttributes(),
  53901. p.uniform1i(c.occlusionMap, 0),
  53902. p.uniform1i(c.map, 1),
  53903. p.bindBuffer(p.ARRAY_BUFFER, o),
  53904. p.vertexAttribPointer(l.vertex, 2, p.FLOAT, !1, 16, 0),
  53905. p.vertexAttribPointer(l.uv, 2, p.FLOAT, !1, 16, 8),
  53906. p.bindBuffer(p.ELEMENT_ARRAY_BUFFER, a),
  53907. f.disable(p.CULL_FACE),
  53908. f.setDepthWrite(!1);
  53909. for (var _ = 0, T = t.length; _ < T; _++) {
  53910. I = 16 / m.w,
  53911. E.set(I * A, I);
  53912. var x = t[_];
  53913. if (v.set(x.matrixWorld.elements[12], x.matrixWorld.elements[13], x.matrixWorld.elements[14]),
  53914. v.applyMatrix4(g.matrixWorldInverse),
  53915. v.applyProjection(g.projectionMatrix),
  53916. b.copy(v),
  53917. w.x = b.x * y + y,
  53918. w.y = b.y * C + C,
  53919. h || w.x > 0 && w.x < m.z && w.y > 0 && w.y < m.w) {
  53920. f.activeTexture(p.TEXTURE0),
  53921. f.bindTexture(p.TEXTURE_2D, null),
  53922. f.activeTexture(p.TEXTURE1),
  53923. f.bindTexture(p.TEXTURE_2D, u),
  53924. p.copyTexImage2D(p.TEXTURE_2D, 0, p.RGB, m.x + w.x - 8, m.y + w.y - 8, 16, 16, 0),
  53925. p.uniform1i(c.renderType, 0),
  53926. p.uniform2f(c.scale, E.x, E.y),
  53927. p.uniform3f(c.screenPosition, b.x, b.y, b.z),
  53928. f.disable(p.BLEND),
  53929. f.enable(p.DEPTH_TEST),
  53930. p.drawElements(p.TRIANGLES, 6, p.UNSIGNED_SHORT, 0),
  53931. f.activeTexture(p.TEXTURE0),
  53932. f.bindTexture(p.TEXTURE_2D, d),
  53933. p.copyTexImage2D(p.TEXTURE_2D, 0, p.RGBA, m.x + w.x - 8, m.y + w.y - 8, 16, 16, 0),
  53934. p.uniform1i(c.renderType, 1),
  53935. f.disable(p.DEPTH_TEST),
  53936. f.activeTexture(p.TEXTURE1),
  53937. f.bindTexture(p.TEXTURE_2D, u),
  53938. p.drawElements(p.TRIANGLES, 6, p.UNSIGNED_SHORT, 0),
  53939. x.positionScreen.copy(b),
  53940. x.customUpdateCallback ? x.customUpdateCallback(x) : x.updateLensFlares(),
  53941. p.uniform1i(c.renderType, 2),
  53942. f.enable(p.BLEND);
  53943. for (var S = 0, M = x.lensFlares.length; S < M; S++) {
  53944. var R = x.lensFlares[S];
  53945. R.opacity > .001 && R.scale > .001 && (b.x = R.x,
  53946. b.y = R.y,
  53947. b.z = R.z,
  53948. I = R.size * R.scale / m.w,
  53949. E.x = I * A,
  53950. E.y = I,
  53951. p.uniform3f(c.screenPosition, b.x, b.y, b.z),
  53952. p.uniform2f(c.scale, E.x, E.y),
  53953. p.uniform1f(c.rotation, R.rotation),
  53954. p.uniform1f(c.opacity, R.opacity),
  53955. p.uniform3f(c.color, R.color.r, R.color.g, R.color.b),
  53956. f.setBlending(R.blending, R.blendEquation, R.blendSrc, R.blendDst),
  53957. e.setTexture(R.texture, 1),
  53958. p.drawElements(p.TRIANGLES, 6, p.UNSIGNED_SHORT, 0))
  53959. }
  53960. }
  53961. }
  53962. f.enable(p.CULL_FACE),
  53963. f.enable(p.DEPTH_TEST),
  53964. f.setDepthWrite(!0),
  53965. e.resetGLState()
  53966. }
  53967. }
  53968. }
  53969. ,
  53970. n.SpritePlugin = function(e, t) {
  53971. function i() {
  53972. var e = new Float32Array([-.5, -.5, 0, 0, .5, -.5, 1, 0, .5, .5, 1, 1, -.5, .5, 0, 1])
  53973. , t = new Uint16Array([0, 1, 2, 0, 2, 3]);
  53974. a = d.createBuffer(),
  53975. s = d.createBuffer(),
  53976. d.bindBuffer(d.ARRAY_BUFFER, a),
  53977. d.bufferData(d.ARRAY_BUFFER, e, d.STATIC_DRAW),
  53978. d.bindBuffer(d.ELEMENT_ARRAY_BUFFER, s),
  53979. d.bufferData(d.ELEMENT_ARRAY_BUFFER, t, d.STATIC_DRAW),
  53980. l = r(),
  53981. c = {
  53982. position: d.getAttribLocation(l, "position"),
  53983. uv: d.getAttribLocation(l, "uv")
  53984. },
  53985. h = {
  53986. uvOffset: d.getUniformLocation(l, "uvOffset"),
  53987. uvScale: d.getUniformLocation(l, "uvScale"),
  53988. rotation: d.getUniformLocation(l, "rotation"),
  53989. scale: d.getUniformLocation(l, "scale"),
  53990. color: d.getUniformLocation(l, "color"),
  53991. map: d.getUniformLocation(l, "map"),
  53992. opacity: d.getUniformLocation(l, "opacity"),
  53993. modelViewMatrix: d.getUniformLocation(l, "modelViewMatrix"),
  53994. projectionMatrix: d.getUniformLocation(l, "projectionMatrix"),
  53995. fogType: d.getUniformLocation(l, "fogType"),
  53996. fogDensity: d.getUniformLocation(l, "fogDensity"),
  53997. fogNear: d.getUniformLocation(l, "fogNear"),
  53998. fogFar: d.getUniformLocation(l, "fogFar"),
  53999. fogColor: d.getUniformLocation(l, "fogColor"),
  54000. alphaTest: d.getUniformLocation(l, "alphaTest")
  54001. };
  54002. var i = document.createElement("canvas");
  54003. i.width = 8,
  54004. i.height = 8;
  54005. var o = i.getContext("2d");
  54006. o.fillStyle = "white",
  54007. o.fillRect(0, 0, 8, 8),
  54008. u = new n.Texture(i),
  54009. u.needsUpdate = !0
  54010. }
  54011. function r() {
  54012. var t = d.createProgram()
  54013. , i = d.createShader(d.VERTEX_SHADER)
  54014. , n = d.createShader(d.FRAGMENT_SHADER);
  54015. 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")),
  54016. 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")),
  54017. d.compileShader(i),
  54018. d.compileShader(n),
  54019. d.attachShader(t, i),
  54020. d.attachShader(t, n),
  54021. d.linkProgram(t),
  54022. t
  54023. }
  54024. function o(e, t) {
  54025. return e.renderOrder !== t.renderOrder ? e.renderOrder - t.renderOrder : e.z !== t.z ? t.z - e.z : t.id - e.id
  54026. }
  54027. 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;
  54028. this.render = function(r, v) {
  54029. if (0 !== t.length) {
  54030. void 0 === l && i(),
  54031. d.useProgram(l),
  54032. p.initAttributes(),
  54033. p.enableAttribute(c.position),
  54034. p.enableAttribute(c.uv),
  54035. p.disableUnusedAttributes(),
  54036. p.disable(d.CULL_FACE),
  54037. p.enable(d.BLEND),
  54038. d.bindBuffer(d.ARRAY_BUFFER, a),
  54039. d.vertexAttribPointer(c.position, 2, d.FLOAT, !1, 16, 0),
  54040. d.vertexAttribPointer(c.uv, 2, d.FLOAT, !1, 16, 8),
  54041. d.bindBuffer(d.ELEMENT_ARRAY_BUFFER, s),
  54042. d.uniformMatrix4fv(h.projectionMatrix, !1, v.projectionMatrix.elements),
  54043. p.activeTexture(d.TEXTURE0),
  54044. d.uniform1i(h.map, 0);
  54045. var A = 0
  54046. , y = 0
  54047. , C = r.fog;
  54048. C ? (d.uniform3f(h.fogColor, C.color.r, C.color.g, C.color.b),
  54049. C instanceof n.Fog ? (d.uniform1f(h.fogNear, C.near),
  54050. d.uniform1f(h.fogFar, C.far),
  54051. d.uniform1i(h.fogType, 1),
  54052. A = 1,
  54053. y = 1) : C instanceof n.FogExp2 && (d.uniform1f(h.fogDensity, C.density),
  54054. d.uniform1i(h.fogType, 2),
  54055. A = 2,
  54056. y = 2)) : (d.uniform1i(h.fogType, 0),
  54057. A = 0,
  54058. y = 0);
  54059. for (var I = 0, E = t.length; I < E; I++) {
  54060. var b = t[I];
  54061. b.modelViewMatrix.multiplyMatrices(v.matrixWorldInverse, b.matrixWorld),
  54062. b.z = -b.modelViewMatrix.elements[14]
  54063. }
  54064. t.sort(o);
  54065. for (var w = [], I = 0, E = t.length; I < E; I++) {
  54066. var b = t[I]
  54067. , _ = b.material;
  54068. d.uniform1f(h.alphaTest, _.alphaTest),
  54069. d.uniformMatrix4fv(h.modelViewMatrix, !1, b.modelViewMatrix.elements),
  54070. b.matrixWorld.decompose(f, g, m),
  54071. w[0] = m.x,
  54072. w[1] = m.y;
  54073. var T = 0;
  54074. r.fog && _.fog && (T = y),
  54075. A !== T && (d.uniform1i(h.fogType, T),
  54076. A = T),
  54077. null !== _.map ? (d.uniform2f(h.uvOffset, _.map.offset.x, _.map.offset.y),
  54078. d.uniform2f(h.uvScale, _.map.repeat.x, _.map.repeat.y)) : (d.uniform2f(h.uvOffset, 0, 0),
  54079. d.uniform2f(h.uvScale, 1, 1)),
  54080. d.uniform1f(h.opacity, _.opacity),
  54081. d.uniform3f(h.color, _.color.r, _.color.g, _.color.b),
  54082. d.uniform1f(h.rotation, _.rotation),
  54083. d.uniform2fv(h.scale, w),
  54084. p.setBlending(_.blending, _.blendEquation, _.blendSrc, _.blendDst),
  54085. p.setDepthTest(_.depthTest),
  54086. p.setDepthWrite(_.depthWrite),
  54087. _.map && _.map.image && _.map.image.width ? e.setTexture(_.map, 0) : e.setTexture(u, 0),
  54088. d.drawElements(d.TRIANGLES, 6, d.UNSIGNED_SHORT, 0)
  54089. }
  54090. p.enable(d.CULL_FACE),
  54091. e.resetGLState()
  54092. }
  54093. }
  54094. }
  54095. ,
  54096. Object.defineProperties(n.Box2.prototype, {
  54097. empty: {
  54098. value: function() {
  54099. return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."),
  54100. this.isEmpty()
  54101. }
  54102. },
  54103. isIntersectionBox: {
  54104. value: function(e) {
  54105. return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."),
  54106. this.intersectsBox(e)
  54107. }
  54108. }
  54109. }),
  54110. Object.defineProperties(n.Box3.prototype, {
  54111. empty: {
  54112. value: function() {
  54113. return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),
  54114. this.isEmpty()
  54115. }
  54116. },
  54117. isIntersectionBox: {
  54118. value: function(e) {
  54119. return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),
  54120. this.intersectsBox(e)
  54121. }
  54122. },
  54123. isIntersectionSphere: {
  54124. value: function(e) {
  54125. return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),
  54126. this.intersectsSphere(e)
  54127. }
  54128. }
  54129. }),
  54130. Object.defineProperties(n.Matrix3.prototype, {
  54131. multiplyVector3: {
  54132. value: function(e) {
  54133. return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),
  54134. e.applyMatrix3(this)
  54135. }
  54136. },
  54137. multiplyVector3Array: {
  54138. value: function(e) {
  54139. return console.warn("THREE.Matrix3: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead."),
  54140. this.applyToVector3Array(e)
  54141. }
  54142. }
  54143. }),
  54144. Object.defineProperties(n.Matrix4.prototype, {
  54145. extractPosition: {
  54146. value: function(e) {
  54147. return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),
  54148. this.copyPosition(e)
  54149. }
  54150. },
  54151. setRotationFromQuaternion: {
  54152. value: function(e) {
  54153. return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),
  54154. this.makeRotationFromQuaternion(e)
  54155. }
  54156. },
  54157. multiplyVector3: {
  54158. value: function(e) {
  54159. return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) or vector.applyProjection( matrix ) instead."),
  54160. e.applyProjection(this)
  54161. }
  54162. },
  54163. multiplyVector4: {
  54164. value: function(e) {
  54165. return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),
  54166. e.applyMatrix4(this)
  54167. }
  54168. },
  54169. multiplyVector3Array: {
  54170. value: function(e) {
  54171. return console.warn("THREE.Matrix4: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead."),
  54172. this.applyToVector3Array(e)
  54173. }
  54174. },
  54175. rotateAxis: {
  54176. value: function(e) {
  54177. console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),
  54178. e.transformDirection(this)
  54179. }
  54180. },
  54181. crossVector: {
  54182. value: function(e) {
  54183. return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),
  54184. e.applyMatrix4(this)
  54185. }
  54186. },
  54187. translate: {
  54188. value: function(e) {
  54189. console.error("THREE.Matrix4: .translate() has been removed.")
  54190. }
  54191. },
  54192. rotateX: {
  54193. value: function(e) {
  54194. console.error("THREE.Matrix4: .rotateX() has been removed.")
  54195. }
  54196. },
  54197. rotateY: {
  54198. value: function(e) {
  54199. console.error("THREE.Matrix4: .rotateY() has been removed.")
  54200. }
  54201. },
  54202. rotateZ: {
  54203. value: function(e) {
  54204. console.error("THREE.Matrix4: .rotateZ() has been removed.")
  54205. }
  54206. },
  54207. rotateByAxis: {
  54208. value: function(e, t) {
  54209. console.error("THREE.Matrix4: .rotateByAxis() has been removed.")
  54210. }
  54211. }
  54212. }),
  54213. Object.defineProperties(n.Plane.prototype, {
  54214. isIntersectionLine: {
  54215. value: function(e) {
  54216. return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),
  54217. this.intersectsLine(e)
  54218. }
  54219. }
  54220. }),
  54221. Object.defineProperties(n.Quaternion.prototype, {
  54222. multiplyVector3: {
  54223. value: function(e) {
  54224. return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),
  54225. e.applyQuaternion(this)
  54226. }
  54227. }
  54228. }),
  54229. Object.defineProperties(n.Ray.prototype, {
  54230. isIntersectionBox: {
  54231. value: function(e) {
  54232. return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),
  54233. this.intersectsBox(e)
  54234. }
  54235. },
  54236. isIntersectionPlane: {
  54237. value: function(e) {
  54238. return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),
  54239. this.intersectsPlane(e)
  54240. }
  54241. },
  54242. isIntersectionSphere: {
  54243. value: function(e) {
  54244. return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),
  54245. this.intersectsSphere(e)
  54246. }
  54247. }
  54248. }),
  54249. Object.defineProperties(n.Vector3.prototype, {
  54250. setEulerFromRotationMatrix: {
  54251. value: function() {
  54252. console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")
  54253. }
  54254. },
  54255. setEulerFromQuaternion: {
  54256. value: function() {
  54257. console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")
  54258. }
  54259. },
  54260. getPositionFromMatrix: {
  54261. value: function(e) {
  54262. return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),
  54263. this.setFromMatrixPosition(e)
  54264. }
  54265. },
  54266. getScaleFromMatrix: {
  54267. value: function(e) {
  54268. return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),
  54269. this.setFromMatrixScale(e)
  54270. }
  54271. },
  54272. getColumnFromMatrix: {
  54273. value: function(e, t) {
  54274. return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),
  54275. this.setFromMatrixColumn(e, t)
  54276. }
  54277. }
  54278. }),
  54279. n.Face4 = function(e, t, i, r, o, a, s) {
  54280. return console.warn("THREE.Face4 has been removed. A THREE.Face3 will be created instead."),
  54281. new n.Face3(e,t,i,o,a,s)
  54282. }
  54283. ,
  54284. n.Vertex = function(e, t, i) {
  54285. return console.warn("THREE.Vertex has been removed. Use THREE.Vector3 instead."),
  54286. new n.Vector3(e,t,i)
  54287. }
  54288. ,
  54289. Object.defineProperties(n.Object3D.prototype, {
  54290. eulerOrder: {
  54291. get: function() {
  54292. return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),
  54293. this.rotation.order
  54294. },
  54295. set: function(e) {
  54296. console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),
  54297. this.rotation.order = e
  54298. }
  54299. },
  54300. getChildByName: {
  54301. value: function(e) {
  54302. return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),
  54303. this.getObjectByName(e)
  54304. }
  54305. },
  54306. renderDepth: {
  54307. set: function(e) {
  54308. console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")
  54309. }
  54310. },
  54311. translate: {
  54312. value: function(e, t) {
  54313. return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),
  54314. this.translateOnAxis(t, e)
  54315. }
  54316. },
  54317. useQuaternion: {
  54318. get: function() {
  54319. console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")
  54320. },
  54321. set: function(e) {
  54322. console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")
  54323. }
  54324. }
  54325. }),
  54326. Object.defineProperties(n, {
  54327. PointCloud: {
  54328. value: function(e, t) {
  54329. return console.warn("THREE.PointCloud has been renamed to THREE.Points."),
  54330. new n.Points(e,t)
  54331. }
  54332. },
  54333. ParticleSystem: {
  54334. value: function(e, t) {
  54335. return console.warn("THREE.ParticleSystem has been renamed to THREE.Points."),
  54336. new n.Points(e,t)
  54337. }
  54338. }
  54339. }),
  54340. Object.defineProperties(n.Light.prototype, {
  54341. onlyShadow: {
  54342. set: function(e) {
  54343. console.warn("THREE.Light: .onlyShadow has been removed.")
  54344. }
  54345. },
  54346. shadowCameraFov: {
  54347. set: function(e) {
  54348. console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."),
  54349. this.shadow.camera.fov = e
  54350. }
  54351. },
  54352. shadowCameraLeft: {
  54353. set: function(e) {
  54354. console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."),
  54355. this.shadow.camera.left = e
  54356. }
  54357. },
  54358. shadowCameraRight: {
  54359. set: function(e) {
  54360. console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),
  54361. this.shadow.camera.right = e
  54362. }
  54363. },
  54364. shadowCameraTop: {
  54365. set: function(e) {
  54366. console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),
  54367. this.shadow.camera.top = e
  54368. }
  54369. },
  54370. shadowCameraBottom: {
  54371. set: function(e) {
  54372. console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),
  54373. this.shadow.camera.bottom = e
  54374. }
  54375. },
  54376. shadowCameraNear: {
  54377. set: function(e) {
  54378. console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),
  54379. this.shadow.camera.near = e
  54380. }
  54381. },
  54382. shadowCameraFar: {
  54383. set: function(e) {
  54384. console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),
  54385. this.shadow.camera.far = e
  54386. }
  54387. },
  54388. shadowCameraVisible: {
  54389. set: function(e) {
  54390. console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")
  54391. }
  54392. },
  54393. shadowBias: {
  54394. set: function(e) {
  54395. console.warn("THREE.Light: .shadowBias is now .shadow.bias."),
  54396. this.shadow.bias = e
  54397. }
  54398. },
  54399. shadowDarkness: {
  54400. set: function(e) {
  54401. console.warn("THREE.Light: .shadowDarkness has been removed.")
  54402. }
  54403. },
  54404. shadowMapWidth: {
  54405. set: function(e) {
  54406. console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),
  54407. this.shadow.mapSize.width = e
  54408. }
  54409. },
  54410. shadowMapHeight: {
  54411. set: function(e) {
  54412. console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),
  54413. this.shadow.mapSize.height = e
  54414. }
  54415. }
  54416. }),
  54417. Object.defineProperties(n.BufferAttribute.prototype, {
  54418. length: {
  54419. get: function() {
  54420. return console.warn("THREE.BufferAttribute: .length has been deprecated. Please use .count."),
  54421. this.array.length
  54422. }
  54423. }
  54424. }),
  54425. Object.defineProperties(n.BufferGeometry.prototype, {
  54426. drawcalls: {
  54427. get: function() {
  54428. return console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups."),
  54429. this.groups
  54430. }
  54431. },
  54432. offsets: {
  54433. get: function() {
  54434. return console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups."),
  54435. this.groups
  54436. }
  54437. },
  54438. addIndex: {
  54439. value: function(e) {
  54440. console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),
  54441. this.setIndex(e)
  54442. }
  54443. },
  54444. addDrawCall: {
  54445. value: function(e, t, i) {
  54446. void 0 !== i && console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),
  54447. console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),
  54448. this.addGroup(e, t)
  54449. }
  54450. },
  54451. clearDrawCalls: {
  54452. value: function() {
  54453. console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."),
  54454. this.clearGroups()
  54455. }
  54456. },
  54457. computeTangents: {
  54458. value: function() {
  54459. console.warn("THREE.BufferGeometry: .computeTangents() has been removed.")
  54460. }
  54461. },
  54462. computeOffsets: {
  54463. value: function() {
  54464. console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")
  54465. }
  54466. }
  54467. }),
  54468. Object.defineProperties(n.Material.prototype, {
  54469. wrapAround: {
  54470. get: function() {
  54471. console.warn("THREE." + this.type + ": .wrapAround has been removed.")
  54472. },
  54473. set: function(e) {
  54474. console.warn("THREE." + this.type + ": .wrapAround has been removed.")
  54475. }
  54476. },
  54477. wrapRGB: {
  54478. get: function() {
  54479. return console.warn("THREE." + this.type + ": .wrapRGB has been removed."),
  54480. new n.Color
  54481. }
  54482. }
  54483. }),
  54484. Object.defineProperties(n, {
  54485. PointCloudMaterial: {
  54486. value: function(e) {
  54487. return console.warn("THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial."),
  54488. new n.PointsMaterial(e)
  54489. }
  54490. },
  54491. ParticleBasicMaterial: {
  54492. value: function(e) {
  54493. return console.warn("THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial."),
  54494. new n.PointsMaterial(e)
  54495. }
  54496. },
  54497. ParticleSystemMaterial: {
  54498. value: function(e) {
  54499. return console.warn("THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial."),
  54500. new n.PointsMaterial(e)
  54501. }
  54502. }
  54503. }),
  54504. Object.defineProperties(n.MeshPhongMaterial.prototype, {
  54505. metal: {
  54506. get: function() {
  54507. return console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead."),
  54508. !1
  54509. },
  54510. set: function(e) {
  54511. console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead")
  54512. }
  54513. }
  54514. }),
  54515. Object.defineProperties(n.ShaderMaterial.prototype, {
  54516. derivatives: {
  54517. get: function() {
  54518. return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),
  54519. this.extensions.derivatives
  54520. },
  54521. set: function(e) {
  54522. console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),
  54523. this.extensions.derivatives = e
  54524. }
  54525. }
  54526. }),
  54527. Object.defineProperties(n.WebGLRenderer.prototype, {
  54528. supportsFloatTextures: {
  54529. value: function() {
  54530. return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."),
  54531. this.extensions.get("OES_texture_float")
  54532. }
  54533. },
  54534. supportsHalfFloatTextures: {
  54535. value: function() {
  54536. return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."),
  54537. this.extensions.get("OES_texture_half_float")
  54538. }
  54539. },
  54540. supportsStandardDerivatives: {
  54541. value: function() {
  54542. return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."),
  54543. this.extensions.get("OES_standard_derivatives")
  54544. }
  54545. },
  54546. supportsCompressedTextureS3TC: {
  54547. value: function() {
  54548. return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),
  54549. this.extensions.get("WEBGL_compressed_texture_s3tc")
  54550. }
  54551. },
  54552. supportsCompressedTexturePVRTC: {
  54553. value: function() {
  54554. return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),
  54555. this.extensions.get("WEBGL_compressed_texture_pvrtc")
  54556. }
  54557. },
  54558. supportsBlendMinMax: {
  54559. value: function() {
  54560. return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."),
  54561. this.extensions.get("EXT_blend_minmax")
  54562. }
  54563. },
  54564. supportsVertexTextures: {
  54565. value: function() {
  54566. return this.capabilities.vertexTextures
  54567. }
  54568. },
  54569. supportsInstancedArrays: {
  54570. value: function() {
  54571. return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."),
  54572. this.extensions.get("ANGLE_instanced_arrays")
  54573. }
  54574. },
  54575. enableScissorTest: {
  54576. value: function(e) {
  54577. console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),
  54578. this.setScissorTest(e)
  54579. }
  54580. },
  54581. initMaterial: {
  54582. value: function() {
  54583. console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")
  54584. }
  54585. },
  54586. addPrePlugin: {
  54587. value: function() {
  54588. console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")
  54589. }
  54590. },
  54591. addPostPlugin: {
  54592. value: function() {
  54593. console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")
  54594. }
  54595. },
  54596. updateShadowMap: {
  54597. value: function() {
  54598. console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")
  54599. }
  54600. },
  54601. shadowMapEnabled: {
  54602. get: function() {
  54603. return this.shadowMap.enabled
  54604. },
  54605. set: function(e) {
  54606. console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),
  54607. this.shadowMap.enabled = e
  54608. }
  54609. },
  54610. shadowMapType: {
  54611. get: function() {
  54612. return this.shadowMap.type
  54613. },
  54614. set: function(e) {
  54615. console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),
  54616. this.shadowMap.type = e
  54617. }
  54618. },
  54619. shadowMapCullFace: {
  54620. get: function() {
  54621. return this.shadowMap.cullFace
  54622. },
  54623. set: function(e) {
  54624. console.warn("THREE.WebGLRenderer: .shadowMapCullFace is now .shadowMap.cullFace."),
  54625. this.shadowMap.cullFace = e
  54626. }
  54627. }
  54628. }),
  54629. Object.defineProperties(n.WebGLRenderTarget.prototype, {
  54630. wrapS: {
  54631. get: function() {
  54632. return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),
  54633. this.texture.wrapS
  54634. },
  54635. set: function(e) {
  54636. console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),
  54637. this.texture.wrapS = e
  54638. }
  54639. },
  54640. wrapT: {
  54641. get: function() {
  54642. return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),
  54643. this.texture.wrapT
  54644. },
  54645. set: function(e) {
  54646. console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),
  54647. this.texture.wrapT = e
  54648. }
  54649. },
  54650. magFilter: {
  54651. get: function() {
  54652. return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),
  54653. this.texture.magFilter
  54654. },
  54655. set: function(e) {
  54656. console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),
  54657. this.texture.magFilter = e
  54658. }
  54659. },
  54660. minFilter: {
  54661. get: function() {
  54662. return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),
  54663. this.texture.minFilter
  54664. },
  54665. set: function(e) {
  54666. console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),
  54667. this.texture.minFilter = e
  54668. }
  54669. },
  54670. anisotropy: {
  54671. get: function() {
  54672. return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),
  54673. this.texture.anisotropy
  54674. },
  54675. set: function(e) {
  54676. console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),
  54677. this.texture.anisotropy = e
  54678. }
  54679. },
  54680. offset: {
  54681. get: function() {
  54682. return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),
  54683. this.texture.offset
  54684. },
  54685. set: function(e) {
  54686. console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),
  54687. this.texture.offset = e
  54688. }
  54689. },
  54690. repeat: {
  54691. get: function() {
  54692. return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),
  54693. this.texture.repeat
  54694. },
  54695. set: function(e) {
  54696. console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),
  54697. this.texture.repeat = e
  54698. }
  54699. },
  54700. format: {
  54701. get: function() {
  54702. return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),
  54703. this.texture.format
  54704. },
  54705. set: function(e) {
  54706. console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),
  54707. this.texture.format = e
  54708. }
  54709. },
  54710. type: {
  54711. get: function() {
  54712. return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),
  54713. this.texture.type
  54714. },
  54715. set: function(e) {
  54716. console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),
  54717. this.texture.type = e
  54718. }
  54719. },
  54720. generateMipmaps: {
  54721. get: function() {
  54722. return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),
  54723. this.texture.generateMipmaps
  54724. },
  54725. set: function(e) {
  54726. console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),
  54727. this.texture.generateMipmaps = e
  54728. }
  54729. }
  54730. }),
  54731. n.GeometryUtils = {
  54732. merge: function(e, t, i) {
  54733. console.warn("THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead.");
  54734. var r;
  54735. t instanceof n.Mesh && (t.matrixAutoUpdate && t.updateMatrix(),
  54736. r = t.matrix,
  54737. t = t.geometry),
  54738. e.merge(t, r, i)
  54739. },
  54740. center: function(e) {
  54741. return console.warn("THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead."),
  54742. e.center()
  54743. }
  54744. },
  54745. n.ImageUtils = {
  54746. crossOrigin: void 0,
  54747. loadTexture: function(e, t, i, r) {
  54748. console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");
  54749. var o = new n.TextureLoader;
  54750. o.setCrossOrigin(this.crossOrigin);
  54751. var a = o.load(e, i, void 0, r);
  54752. return t && (a.mapping = t),
  54753. a
  54754. },
  54755. loadTextureCube: function(e, t, i, r) {
  54756. console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");
  54757. var o = new n.CubeTextureLoader;
  54758. o.setCrossOrigin(this.crossOrigin);
  54759. var a = o.load(e, i, void 0, r);
  54760. return t && (a.mapping = t),
  54761. a
  54762. },
  54763. loadCompressedTexture: function() {
  54764. console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")
  54765. },
  54766. loadCompressedTextureCube: function() {
  54767. console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")
  54768. }
  54769. },
  54770. n.Projector = function() {
  54771. console.error("THREE.Projector has been moved to /examples/js/renderers/Projector.js."),
  54772. this.projectVector = function(e, t) {
  54773. console.warn("THREE.Projector: .projectVector() is now vector.project()."),
  54774. e.project(t)
  54775. }
  54776. ,
  54777. this.unprojectVector = function(e, t) {
  54778. console.warn("THREE.Projector: .unprojectVector() is now vector.unproject()."),
  54779. e.unproject(t)
  54780. }
  54781. ,
  54782. this.pickingRay = function(e, t) {
  54783. console.error("THREE.Projector: .pickingRay() is now raycaster.setFromCamera().")
  54784. }
  54785. }
  54786. ,
  54787. n.CanvasRenderer = function() {
  54788. console.error("THREE.CanvasRenderer has been moved to /examples/js/renderers/CanvasRenderer.js"),
  54789. this.domElement = document.createElement("canvas"),
  54790. this.clear = function() {}
  54791. ,
  54792. this.render = function() {}
  54793. ,
  54794. this.setClearColor = function() {}
  54795. ,
  54796. this.setSize = function() {}
  54797. }
  54798. ,
  54799. n.MeshFaceMaterial = n.MultiMaterial,
  54800. n.CurveUtils = {
  54801. tangentQuadraticBezier: function(e, t, i, n) {
  54802. return 2 * (1 - e) * (i - t) + 2 * e * (n - i)
  54803. },
  54804. tangentCubicBezier: function(e, t, i, n, r) {
  54805. 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
  54806. },
  54807. tangentSpline: function(e, t, i, n, r) {
  54808. var o = 6 * e * e - 6 * e
  54809. , a = 3 * e * e - 4 * e + 1
  54810. , s = -6 * e * e + 6 * e
  54811. , l = 3 * e * e - 2 * e;
  54812. return o + a + s + l
  54813. },
  54814. interpolate: function(e, t, i, n, r) {
  54815. var o = .5 * (i - e)
  54816. , a = .5 * (n - t)
  54817. , s = r * r
  54818. , l = r * s;
  54819. return (2 * t - 2 * i + o + a) * l + (-3 * t + 3 * i - 2 * o - a) * s + o * r + t
  54820. }
  54821. },
  54822. n.SceneUtils = {
  54823. createMultiMaterialObject: function(e, t) {
  54824. for (var i = new n.Group, r = 0, o = t.length; r < o; r++)
  54825. i.add(new n.Mesh(e,t[r]));
  54826. return i
  54827. },
  54828. detach: function(e, t, i) {
  54829. e.applyMatrix(t.matrixWorld),
  54830. t.remove(e),
  54831. i.add(e)
  54832. },
  54833. attach: function(e, t, i) {
  54834. var r = new n.Matrix4;
  54835. r.getInverse(i.matrixWorld),
  54836. e.applyMatrix(r),
  54837. t.remove(e),
  54838. i.add(e)
  54839. }
  54840. },
  54841. n.ShapeUtils = {
  54842. area: function(e) {
  54843. for (var t = e.length, i = 0, n = t - 1, r = 0; r < t; n = r++)
  54844. i += e[n].x * e[r].y - e[r].x * e[n].y;
  54845. return .5 * i
  54846. },
  54847. triangulate: function() {
  54848. function e(e, t, i, n, r, o) {
  54849. var a, s, l, c, h, u, d, p, f;
  54850. if (s = e[o[t]].x,
  54851. l = e[o[t]].y,
  54852. c = e[o[i]].x,
  54853. h = e[o[i]].y,
  54854. u = e[o[n]].x,
  54855. d = e[o[n]].y,
  54856. Number.EPSILON > (c - s) * (d - l) - (h - l) * (u - s))
  54857. return !1;
  54858. var g, m, v, A, y, C, I, E, b, w, _, T, x, S, M;
  54859. for (g = u - c,
  54860. m = d - h,
  54861. v = s - u,
  54862. A = l - d,
  54863. y = c - s,
  54864. C = h - l,
  54865. a = 0; a < r; a++)
  54866. if (p = e[o[a]].x,
  54867. f = e[o[a]].y,
  54868. !(p === s && f === l || p === c && f === h || p === u && f === d) && (I = p - s,
  54869. E = f - l,
  54870. b = p - c,
  54871. w = f - h,
  54872. _ = p - u,
  54873. T = f - d,
  54874. M = g * w - m * b,
  54875. x = y * E - C * I,
  54876. S = v * T - A * _,
  54877. M >= -Number.EPSILON && S >= -Number.EPSILON && x >= -Number.EPSILON))
  54878. return !1;
  54879. return !0
  54880. }
  54881. return function(t, i) {
  54882. var r = t.length;
  54883. if (r < 3)
  54884. return null;
  54885. var o, a, s, l = [], c = [], h = [];
  54886. if (n.ShapeUtils.area(t) > 0)
  54887. for (a = 0; a < r; a++)
  54888. c[a] = a;
  54889. else
  54890. for (a = 0; a < r; a++)
  54891. c[a] = r - 1 - a;
  54892. var u = r
  54893. , d = 2 * u;
  54894. for (a = u - 1; u > 2; ) {
  54895. if (d-- <= 0)
  54896. return console.warn("THREE.ShapeUtils: Unable to triangulate polygon! in triangulate()"),
  54897. i ? h : l;
  54898. if (o = a,
  54899. u <= o && (o = 0),
  54900. a = o + 1,
  54901. u <= a && (a = 0),
  54902. s = a + 1,
  54903. u <= s && (s = 0),
  54904. e(t, o, a, s, u, c)) {
  54905. var p, f, g, m, v;
  54906. for (p = c[o],
  54907. f = c[a],
  54908. g = c[s],
  54909. l.push([t[p], t[f], t[g]]),
  54910. h.push([c[o], c[a], c[s]]),
  54911. m = a,
  54912. v = a + 1; v < u; m++,
  54913. v++)
  54914. c[m] = c[v];
  54915. u--,
  54916. d = 2 * u
  54917. }
  54918. }
  54919. return i ? h : l
  54920. }
  54921. }(),
  54922. triangulateShape: function(e, t) {
  54923. function i(e, t, i) {
  54924. 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
  54925. }
  54926. function r(e, t, n, r, o) {
  54927. var a = t.x - e.x
  54928. , s = t.y - e.y
  54929. , l = r.x - n.x
  54930. , c = r.y - n.y
  54931. , h = e.x - n.x
  54932. , u = e.y - n.y
  54933. , d = s * l - a * c
  54934. , p = s * h - a * u;
  54935. if (Math.abs(d) > Number.EPSILON) {
  54936. var f;
  54937. if (d > 0) {
  54938. if (p < 0 || p > d)
  54939. return [];
  54940. if (f = c * h - l * u,
  54941. f < 0 || f > d)
  54942. return []
  54943. } else {
  54944. if (p > 0 || p < d)
  54945. return [];
  54946. if (f = c * h - l * u,
  54947. f > 0 || f < d)
  54948. return []
  54949. }
  54950. if (0 === f)
  54951. return !o || 0 !== p && p !== d ? [e] : [];
  54952. if (f === d)
  54953. return !o || 0 !== p && p !== d ? [t] : [];
  54954. if (0 === p)
  54955. return [n];
  54956. if (p === d)
  54957. return [r];
  54958. var g = f / d;
  54959. return [{
  54960. x: e.x + g * a,
  54961. y: e.y + g * s
  54962. }]
  54963. }
  54964. if (0 !== p || c * h !== l * u)
  54965. return [];
  54966. var m = 0 === a && 0 === s
  54967. , v = 0 === l && 0 === c;
  54968. if (m && v)
  54969. return e.x !== n.x || e.y !== n.y ? [] : [e];
  54970. if (m)
  54971. return i(n, r, e) ? [e] : [];
  54972. if (v)
  54973. return i(e, t, n) ? [n] : [];
  54974. var A, y, C, I, E, b, w, _;
  54975. return 0 !== a ? (e.x < t.x ? (A = e,
  54976. C = e.x,
  54977. y = t,
  54978. I = t.x) : (A = t,
  54979. C = t.x,
  54980. y = e,
  54981. I = e.x),
  54982. n.x < r.x ? (E = n,
  54983. w = n.x,
  54984. b = r,
  54985. _ = r.x) : (E = r,
  54986. w = r.x,
  54987. b = n,
  54988. _ = n.x)) : (e.y < t.y ? (A = e,
  54989. C = e.y,
  54990. y = t,
  54991. I = t.y) : (A = t,
  54992. C = t.y,
  54993. y = e,
  54994. I = e.y),
  54995. n.y < r.y ? (E = n,
  54996. w = n.y,
  54997. b = r,
  54998. _ = r.y) : (E = r,
  54999. w = r.y,
  55000. b = n,
  55001. _ = n.y)),
  55002. C <= w ? I < w ? [] : I === w ? o ? [] : [E] : I <= _ ? [E, y] : [E, b] : C > _ ? [] : C === _ ? o ? [] : [A] : I <= _ ? [A, y] : [A, b]
  55003. }
  55004. function o(e, t, i, n) {
  55005. var r = t.x - e.x
  55006. , o = t.y - e.y
  55007. , a = i.x - e.x
  55008. , s = i.y - e.y
  55009. , l = n.x - e.x
  55010. , c = n.y - e.y
  55011. , h = r * s - o * a
  55012. , u = r * c - o * l;
  55013. if (Math.abs(h) > Number.EPSILON) {
  55014. var d = l * s - c * a;
  55015. return h > 0 ? u >= 0 && d >= 0 : u >= 0 || d >= 0
  55016. }
  55017. return u > 0
  55018. }
  55019. function a(e, t) {
  55020. function i(e, t) {
  55021. var i = A.length - 1
  55022. , n = e - 1;
  55023. n < 0 && (n = i);
  55024. var r = e + 1;
  55025. r > i && (r = 0);
  55026. var a = o(A[e], A[n], A[r], s[t]);
  55027. if (!a)
  55028. return !1;
  55029. var l = s.length - 1
  55030. , c = t - 1;
  55031. c < 0 && (c = l);
  55032. var h = t + 1;
  55033. return h > l && (h = 0),
  55034. a = o(s[t], s[c], s[h], A[e]),
  55035. !!a
  55036. }
  55037. function n(e, t) {
  55038. var i, n, o;
  55039. for (i = 0; i < A.length; i++)
  55040. if (n = i + 1,
  55041. n %= A.length,
  55042. o = r(e, t, A[i], A[n], !0),
  55043. o.length > 0)
  55044. return !0;
  55045. return !1
  55046. }
  55047. function a(e, i) {
  55048. var n, o, a, s, l;
  55049. for (n = 0; n < y.length; n++)
  55050. for (o = t[y[n]],
  55051. a = 0; a < o.length; a++)
  55052. if (s = a + 1,
  55053. s %= o.length,
  55054. l = r(e, i, o[a], o[s], !0),
  55055. l.length > 0)
  55056. return !0;
  55057. return !1
  55058. }
  55059. 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++)
  55060. y.push(I);
  55061. for (var b = 0, w = 2 * y.length; y.length > 0; ) {
  55062. if (w--,
  55063. w < 0) {
  55064. console.log("Infinite Loop! Holes left:" + y.length + ", Probably Hole outside Shape!");
  55065. break
  55066. }
  55067. for (c = b; c < A.length; c++) {
  55068. h = A[c],
  55069. l = -1;
  55070. for (var I = 0; I < y.length; I++)
  55071. if (d = y[I],
  55072. p = h.x + ":" + h.y + ":" + d,
  55073. void 0 === C[p]) {
  55074. s = t[d];
  55075. for (var _ = 0; _ < s.length; _++)
  55076. if (u = s[_],
  55077. i(c, _) && !n(h, u) && !a(h, u)) {
  55078. l = _,
  55079. y.splice(I, 1),
  55080. f = A.slice(0, c + 1),
  55081. g = A.slice(c),
  55082. m = s.slice(l),
  55083. v = s.slice(0, l + 1),
  55084. A = f.concat(m).concat(v).concat(g),
  55085. b = c;
  55086. break
  55087. }
  55088. if (l >= 0)
  55089. break;
  55090. C[p] = !0
  55091. }
  55092. if (l >= 0)
  55093. break
  55094. }
  55095. }
  55096. return A
  55097. }
  55098. for (var s, l, c, h, u, d, p = {}, f = e.concat(), g = 0, m = t.length; g < m; g++)
  55099. Array.prototype.push.apply(f, t[g]);
  55100. for (s = 0,
  55101. l = f.length; s < l; s++)
  55102. u = f[s].x + ":" + f[s].y,
  55103. void 0 !== p[u] && console.warn("THREE.Shape: Duplicate point", u),
  55104. p[u] = s;
  55105. var v = a(e, t)
  55106. , A = n.ShapeUtils.triangulate(v, !1);
  55107. for (s = 0,
  55108. l = A.length; s < l; s++)
  55109. for (h = A[s],
  55110. c = 0; c < 3; c++)
  55111. u = h[c].x + ":" + h[c].y,
  55112. d = p[u],
  55113. void 0 !== d && (h[c] = d);
  55114. return A.concat()
  55115. },
  55116. isClockWise: function(e) {
  55117. return n.ShapeUtils.area(e) < 0
  55118. },
  55119. b2: function() {
  55120. function e(e, t) {
  55121. var i = 1 - e;
  55122. return i * i * t
  55123. }
  55124. function t(e, t) {
  55125. return 2 * (1 - e) * e * t
  55126. }
  55127. function i(e, t) {
  55128. return e * e * t
  55129. }
  55130. return function(n, r, o, a) {
  55131. return e(n, r) + t(n, o) + i(n, a)
  55132. }
  55133. }(),
  55134. b3: function() {
  55135. function e(e, t) {
  55136. var i = 1 - e;
  55137. return i * i * i * t
  55138. }
  55139. function t(e, t) {
  55140. var i = 1 - e;
  55141. return 3 * i * i * e * t
  55142. }
  55143. function i(e, t) {
  55144. var i = 1 - e;
  55145. return 3 * i * e * e * t
  55146. }
  55147. function n(e, t) {
  55148. return e * e * e * t
  55149. }
  55150. return function(r, o, a, s, l) {
  55151. return e(r, o) + t(r, a) + i(r, s) + n(r, l)
  55152. }
  55153. }()
  55154. },
  55155. n.Curve = function() {}
  55156. ,
  55157. n.Curve.prototype = {
  55158. constructor: n.Curve,
  55159. getPoint: function(e) {
  55160. return console.warn("THREE.Curve: Warning, getPoint() not implemented!"),
  55161. null
  55162. },
  55163. getPointAt: function(e) {
  55164. var t = this.getUtoTmapping(e);
  55165. return this.getPoint(t)
  55166. },
  55167. getPoints: function(e) {
  55168. e || (e = 5);
  55169. var t, i = [];
  55170. for (t = 0; t <= e; t++)
  55171. i.push(this.getPoint(t / e));
  55172. return i
  55173. },
  55174. getSpacedPoints: function(e) {
  55175. e || (e = 5);
  55176. var t, i = [];
  55177. for (t = 0; t <= e; t++)
  55178. i.push(this.getPointAt(t / e));
  55179. return i
  55180. },
  55181. getLength: function() {
  55182. var e = this.getLengths();
  55183. return e[e.length - 1]
  55184. },
  55185. getLengths: function(e) {
  55186. if (e || (e = this.__arcLengthDivisions ? this.__arcLengthDivisions : 200),
  55187. this.cacheArcLengths && this.cacheArcLengths.length === e + 1 && !this.needsUpdate)
  55188. return this.cacheArcLengths;
  55189. this.needsUpdate = !1;
  55190. var t, i, n = [], r = this.getPoint(0), o = 0;
  55191. for (n.push(0),
  55192. i = 1; i <= e; i++)
  55193. t = this.getPoint(i / e),
  55194. o += t.distanceTo(r),
  55195. n.push(o),
  55196. r = t;
  55197. return this.cacheArcLengths = n,
  55198. n
  55199. },
  55200. updateArcLengths: function() {
  55201. this.needsUpdate = !0,
  55202. this.getLengths()
  55203. },
  55204. getUtoTmapping: function(e, t) {
  55205. var i, n = this.getLengths(), r = 0, o = n.length;
  55206. i = t ? t : e * n[o - 1];
  55207. for (var a, s = 0, l = o - 1; s <= l; )
  55208. if (r = Math.floor(s + (l - s) / 2),
  55209. a = n[r] - i,
  55210. a < 0)
  55211. s = r + 1;
  55212. else {
  55213. if (!(a > 0)) {
  55214. l = r;
  55215. break
  55216. }
  55217. l = r - 1
  55218. }
  55219. if (r = l,
  55220. n[r] === i) {
  55221. var c = r / (o - 1);
  55222. return c
  55223. }
  55224. var h = n[r]
  55225. , u = n[r + 1]
  55226. , d = u - h
  55227. , p = (i - h) / d
  55228. , c = (r + p) / (o - 1);
  55229. return c
  55230. },
  55231. getTangent: function(e) {
  55232. var t = 1e-4
  55233. , i = e - t
  55234. , n = e + t;
  55235. i < 0 && (i = 0),
  55236. n > 1 && (n = 1);
  55237. var r = this.getPoint(i)
  55238. , o = this.getPoint(n)
  55239. , a = o.clone().sub(r);
  55240. return a.normalize()
  55241. },
  55242. getTangentAt: function(e) {
  55243. var t = this.getUtoTmapping(e);
  55244. return this.getTangent(t)
  55245. }
  55246. },
  55247. n.Curve.create = function(e, t) {
  55248. return e.prototype = Object.create(n.Curve.prototype),
  55249. e.prototype.constructor = e,
  55250. e.prototype.getPoint = t,
  55251. e
  55252. }
  55253. ,
  55254. n.CurvePath = function() {
  55255. this.curves = [],
  55256. this.autoClose = !1
  55257. }
  55258. ,
  55259. n.CurvePath.prototype = Object.create(n.Curve.prototype),
  55260. n.CurvePath.prototype.constructor = n.CurvePath,
  55261. n.CurvePath.prototype.add = function(e) {
  55262. this.curves.push(e)
  55263. }
  55264. ,
  55265. n.CurvePath.prototype.closePath = function() {
  55266. var e = this.curves[0].getPoint(0)
  55267. , t = this.curves[this.curves.length - 1].getPoint(1);
  55268. e.equals(t) || this.curves.push(new n.LineCurve(t,e))
  55269. }
  55270. ,
  55271. n.CurvePath.prototype.getPoint = function(e) {
  55272. for (var t = e * this.getLength(), i = this.getCurveLengths(), n = 0; n < i.length; ) {
  55273. if (i[n] >= t) {
  55274. var r = i[n] - t
  55275. , o = this.curves[n]
  55276. , a = 1 - r / o.getLength();
  55277. return o.getPointAt(a)
  55278. }
  55279. n++
  55280. }
  55281. return null
  55282. }
  55283. ,
  55284. n.CurvePath.prototype.getLength = function() {
  55285. var e = this.getCurveLengths();
  55286. return e[e.length - 1]
  55287. }
  55288. ,
  55289. n.CurvePath.prototype.getCurveLengths = function() {
  55290. if (this.cacheLengths && this.cacheLengths.length === this.curves.length)
  55291. return this.cacheLengths;
  55292. for (var e = [], t = 0, i = 0, n = this.curves.length; i < n; i++)
  55293. t += this.curves[i].getLength(),
  55294. e.push(t);
  55295. return this.cacheLengths = e,
  55296. e
  55297. }
  55298. ,
  55299. n.CurvePath.prototype.createPointsGeometry = function(e) {
  55300. var t = this.getPoints(e);
  55301. return this.createGeometry(t)
  55302. }
  55303. ,
  55304. n.CurvePath.prototype.createSpacedPointsGeometry = function(e) {
  55305. var t = this.getSpacedPoints(e);
  55306. return this.createGeometry(t)
  55307. }
  55308. ,
  55309. n.CurvePath.prototype.createGeometry = function(e) {
  55310. for (var t = new n.Geometry, i = 0, r = e.length; i < r; i++) {
  55311. var o = e[i];
  55312. t.vertices.push(new n.Vector3(o.x,o.y,o.z || 0))
  55313. }
  55314. return t
  55315. }
  55316. ,
  55317. n.Font = function(e) {
  55318. this.data = e
  55319. }
  55320. ,
  55321. n.Font.prototype = {
  55322. constructor: n.Font,
  55323. generateShapes: function(e, t, i) {
  55324. function r(e) {
  55325. for (var i = String(e).split(""), n = t / a.resolution, r = 0, s = [], l = 0; l < i.length; l++) {
  55326. var c = o(i[l], n, r);
  55327. r += c.offset,
  55328. s.push(c.path)
  55329. }
  55330. return s
  55331. }
  55332. function o(e, t, r) {
  55333. var o = a.glyphs[e] || a.glyphs["?"];
  55334. if (o) {
  55335. 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;
  55336. if (o.o)
  55337. for (var E = o._cachedOutline || (o._cachedOutline = o.o.split(" ")), b = 0, w = E.length; b < w; ) {
  55338. var _ = E[b++];
  55339. switch (_) {
  55340. case "m":
  55341. s = E[b++] * t + r,
  55342. l = E[b++] * t,
  55343. A.moveTo(s, l);
  55344. break;
  55345. case "l":
  55346. s = E[b++] * t + r,
  55347. l = E[b++] * t,
  55348. A.lineTo(s, l);
  55349. break;
  55350. case "q":
  55351. if (c = E[b++] * t + r,
  55352. h = E[b++] * t,
  55353. p = E[b++] * t + r,
  55354. f = E[b++] * t,
  55355. A.quadraticCurveTo(p, f, c, h),
  55356. v = y[y.length - 1]) {
  55357. u = v.x,
  55358. d = v.y;
  55359. for (var T = 1; T <= i; T++) {
  55360. var x = T / i;
  55361. C(x, u, p, c),
  55362. C(x, d, f, h)
  55363. }
  55364. }
  55365. break;
  55366. case "b":
  55367. if (c = E[b++] * t + r,
  55368. h = E[b++] * t,
  55369. p = E[b++] * t + r,
  55370. f = E[b++] * t,
  55371. g = E[b++] * t + r,
  55372. m = E[b++] * t,
  55373. A.bezierCurveTo(p, f, g, m, c, h),
  55374. v = y[y.length - 1]) {
  55375. u = v.x,
  55376. d = v.y;
  55377. for (var T = 1; T <= i; T++) {
  55378. var x = T / i;
  55379. I(x, u, p, g, c),
  55380. I(x, d, f, m, h)
  55381. }
  55382. }
  55383. }
  55384. }
  55385. return {
  55386. offset: o.ha * t,
  55387. path: A
  55388. }
  55389. }
  55390. }
  55391. void 0 === t && (t = 100),
  55392. void 0 === i && (i = 4);
  55393. for (var a = this.data, s = r(e), l = [], c = 0, h = s.length; c < h; c++)
  55394. Array.prototype.push.apply(l, s[c].toShapes());
  55395. return l
  55396. }
  55397. },
  55398. n.Path = function(e) {
  55399. n.CurvePath.call(this),
  55400. this.actions = [],
  55401. e && this.fromPoints(e)
  55402. }
  55403. ,
  55404. n.Path.prototype = Object.create(n.CurvePath.prototype),
  55405. n.Path.prototype.constructor = n.Path,
  55406. n.Path.prototype.fromPoints = function(e) {
  55407. this.moveTo(e[0].x, e[0].y);
  55408. for (var t = 1, i = e.length; t < i; t++)
  55409. this.lineTo(e[t].x, e[t].y)
  55410. }
  55411. ,
  55412. n.Path.prototype.moveTo = function(e, t) {
  55413. this.actions.push({
  55414. action: "moveTo",
  55415. args: [e, t]
  55416. })
  55417. }
  55418. ,
  55419. n.Path.prototype.lineTo = function(e, t) {
  55420. var i = this.actions[this.actions.length - 1].args
  55421. , r = i[i.length - 2]
  55422. , o = i[i.length - 1]
  55423. , a = new n.LineCurve(new n.Vector2(r,o),new n.Vector2(e,t));
  55424. this.curves.push(a),
  55425. this.actions.push({
  55426. action: "lineTo",
  55427. args: [e, t]
  55428. })
  55429. }
  55430. ,
  55431. n.Path.prototype.quadraticCurveTo = function(e, t, i, r) {
  55432. var o = this.actions[this.actions.length - 1].args
  55433. , a = o[o.length - 2]
  55434. , s = o[o.length - 1]
  55435. , l = new n.QuadraticBezierCurve(new n.Vector2(a,s),new n.Vector2(e,t),new n.Vector2(i,r));
  55436. this.curves.push(l),
  55437. this.actions.push({
  55438. action: "quadraticCurveTo",
  55439. args: [e, t, i, r]
  55440. })
  55441. }
  55442. ,
  55443. n.Path.prototype.bezierCurveTo = function(e, t, i, r, o, a) {
  55444. var s = this.actions[this.actions.length - 1].args
  55445. , l = s[s.length - 2]
  55446. , c = s[s.length - 1]
  55447. , h = new n.CubicBezierCurve(new n.Vector2(l,c),new n.Vector2(e,t),new n.Vector2(i,r),new n.Vector2(o,a));
  55448. this.curves.push(h),
  55449. this.actions.push({
  55450. action: "bezierCurveTo",
  55451. args: [e, t, i, r, o, a]
  55452. })
  55453. }
  55454. ,
  55455. n.Path.prototype.splineThru = function(e) {
  55456. var t = Array.prototype.slice.call(arguments)
  55457. , i = this.actions[this.actions.length - 1].args
  55458. , r = i[i.length - 2]
  55459. , o = i[i.length - 1]
  55460. , a = [new n.Vector2(r,o)];
  55461. Array.prototype.push.apply(a, e);
  55462. var s = new n.SplineCurve(a);
  55463. this.curves.push(s),
  55464. this.actions.push({
  55465. action: "splineThru",
  55466. args: t
  55467. })
  55468. }
  55469. ,
  55470. n.Path.prototype.arc = function(e, t, i, n, r, o) {
  55471. var a = this.actions[this.actions.length - 1].args
  55472. , s = a[a.length - 2]
  55473. , l = a[a.length - 1];
  55474. this.absarc(e + s, t + l, i, n, r, o)
  55475. }
  55476. ,
  55477. n.Path.prototype.absarc = function(e, t, i, n, r, o) {
  55478. this.absellipse(e, t, i, i, n, r, o)
  55479. }
  55480. ,
  55481. n.Path.prototype.ellipse = function(e, t, i, n, r, o, a, s) {
  55482. var l = this.actions[this.actions.length - 1].args
  55483. , c = l[l.length - 2]
  55484. , h = l[l.length - 1];
  55485. this.absellipse(e + c, t + h, i, n, r, o, a, s)
  55486. }
  55487. ,
  55488. n.Path.prototype.absellipse = function(e, t, i, r, o, a, s, l) {
  55489. var c = [e, t, i, r, o, a, s, l || 0]
  55490. , h = new n.EllipseCurve(e,t,i,r,o,a,s,l);
  55491. this.curves.push(h);
  55492. var u = h.getPoint(1);
  55493. c.push(u.x),
  55494. c.push(u.y),
  55495. this.actions.push({
  55496. action: "ellipse",
  55497. args: c
  55498. })
  55499. }
  55500. ,
  55501. n.Path.prototype.getSpacedPoints = function(e) {
  55502. e || (e = 40);
  55503. for (var t = [], i = 0; i < e; i++)
  55504. t.push(this.getPoint(i / e));
  55505. return this.autoClose && t.push(t[0]),
  55506. t
  55507. }
  55508. ,
  55509. n.Path.prototype.getPoints = function(e) {
  55510. e = e || 12;
  55511. 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++) {
  55512. var A = this.actions[m]
  55513. , y = A.action
  55514. , C = A.args;
  55515. switch (y) {
  55516. case "moveTo":
  55517. g.push(new n.Vector2(C[0],C[1]));
  55518. break;
  55519. case "lineTo":
  55520. g.push(new n.Vector2(C[0],C[1]));
  55521. break;
  55522. case "quadraticCurveTo":
  55523. t = C[2],
  55524. i = C[3],
  55525. a = C[0],
  55526. s = C[1],
  55527. g.length > 0 ? (h = g[g.length - 1],
  55528. l = h.x,
  55529. c = h.y) : (h = this.actions[m - 1].args,
  55530. l = h[h.length - 2],
  55531. c = h[h.length - 1]);
  55532. for (var I = 1; I <= e; I++) {
  55533. var E = I / e;
  55534. u = p(E, l, a, t),
  55535. d = p(E, c, s, i),
  55536. g.push(new n.Vector2(u,d))
  55537. }
  55538. break;
  55539. case "bezierCurveTo":
  55540. t = C[4],
  55541. i = C[5],
  55542. a = C[0],
  55543. s = C[1],
  55544. r = C[2],
  55545. o = C[3],
  55546. g.length > 0 ? (h = g[g.length - 1],
  55547. l = h.x,
  55548. c = h.y) : (h = this.actions[m - 1].args,
  55549. l = h[h.length - 2],
  55550. c = h[h.length - 1]);
  55551. for (var I = 1; I <= e; I++) {
  55552. var E = I / e;
  55553. u = f(E, l, a, r, t),
  55554. d = f(E, c, s, o, i),
  55555. g.push(new n.Vector2(u,d))
  55556. }
  55557. break;
  55558. case "splineThru":
  55559. h = this.actions[m - 1].args;
  55560. var b = new n.Vector2(h[h.length - 2],h[h.length - 1])
  55561. , w = [b]
  55562. , _ = e * C[0].length;
  55563. w = w.concat(C[0]);
  55564. for (var T = new n.SplineCurve(w), I = 1; I <= _; I++)
  55565. g.push(T.getPointAt(I / _));
  55566. break;
  55567. case "arc":
  55568. 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++) {
  55569. var E = I / N;
  55570. L || (E = 1 - E),
  55571. x = P + E * D,
  55572. u = S + R * Math.cos(x),
  55573. d = M + R * Math.sin(x),
  55574. g.push(new n.Vector2(u,d))
  55575. }
  55576. break;
  55577. case "ellipse":
  55578. 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;
  55579. 0 !== k && (B = Math.cos(k),
  55580. F = Math.sin(k));
  55581. for (var I = 1; I <= N; I++) {
  55582. var E = I / N;
  55583. if (L || (E = 1 - E),
  55584. x = P + E * D,
  55585. u = S + V * Math.cos(x),
  55586. d = M + U * Math.sin(x),
  55587. 0 !== k) {
  55588. var H = u
  55589. , G = d;
  55590. u = (H - S) * B - (G - M) * F + S,
  55591. d = (H - S) * F + (G - M) * B + M
  55592. }
  55593. g.push(new n.Vector2(u,d))
  55594. }
  55595. }
  55596. }
  55597. var z = g[g.length - 1];
  55598. 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),
  55599. this.autoClose && g.push(g[0]),
  55600. g
  55601. }
  55602. ,
  55603. n.Path.prototype.toShapes = function(e, t) {
  55604. function i(e) {
  55605. for (var t = [], i = new n.Path, r = 0, o = e.length; r < o; r++) {
  55606. var a = e[r]
  55607. , s = a.args
  55608. , l = a.action;
  55609. "moveTo" === l && 0 !== i.actions.length && (t.push(i),
  55610. i = new n.Path),
  55611. i[l].apply(i, s)
  55612. }
  55613. return 0 !== i.actions.length && t.push(i),
  55614. t
  55615. }
  55616. function r(e) {
  55617. for (var t = [], i = 0, r = e.length; i < r; i++) {
  55618. var o = e[i]
  55619. , a = new n.Shape;
  55620. a.actions = o.actions,
  55621. a.curves = o.curves,
  55622. t.push(a)
  55623. }
  55624. return t
  55625. }
  55626. function o(e, t) {
  55627. for (var i = t.length, n = !1, r = i - 1, o = 0; o < i; r = o++) {
  55628. var a = t[r]
  55629. , s = t[o]
  55630. , l = s.x - a.x
  55631. , c = s.y - a.y;
  55632. if (Math.abs(c) > Number.EPSILON) {
  55633. if (c < 0 && (a = t[o],
  55634. l = -l,
  55635. s = t[r],
  55636. c = -c),
  55637. e.y < a.y || e.y > s.y)
  55638. continue;
  55639. if (e.y === a.y) {
  55640. if (e.x === a.x)
  55641. return !0
  55642. } else {
  55643. var h = c * (e.x - a.x) - l * (e.y - a.y);
  55644. if (0 === h)
  55645. return !0;
  55646. if (h < 0)
  55647. continue;
  55648. n = !n
  55649. }
  55650. } else {
  55651. if (e.y !== a.y)
  55652. continue;
  55653. if (s.x <= e.x && e.x <= a.x || a.x <= e.x && e.x <= s.x)
  55654. return !0
  55655. }
  55656. }
  55657. return n
  55658. }
  55659. var a = n.ShapeUtils.isClockWise
  55660. , s = i(this.actions);
  55661. if (0 === s.length)
  55662. return [];
  55663. if (t === !0)
  55664. return r(s);
  55665. var l, c, h, u = [];
  55666. if (1 === s.length)
  55667. return c = s[0],
  55668. h = new n.Shape,
  55669. h.actions = c.actions,
  55670. h.curves = c.curves,
  55671. u.push(h),
  55672. u;
  55673. var d = !a(s[0].getPoints());
  55674. d = e ? !d : d;
  55675. var p, f = [], g = [], m = [], v = 0;
  55676. g[v] = void 0,
  55677. m[v] = [];
  55678. for (var A = 0, y = s.length; A < y; A++)
  55679. c = s[A],
  55680. p = c.getPoints(),
  55681. l = a(p),
  55682. l = e ? !l : l,
  55683. l ? (!d && g[v] && v++,
  55684. g[v] = {
  55685. s: new n.Shape,
  55686. p: p
  55687. },
  55688. g[v].s.actions = c.actions,
  55689. g[v].s.curves = c.curves,
  55690. d && v++,
  55691. m[v] = []) : m[v].push({
  55692. h: c,
  55693. p: p[0]
  55694. });
  55695. if (!g[0])
  55696. return r(s);
  55697. if (g.length > 1) {
  55698. for (var C = !1, I = [], E = 0, b = g.length; E < b; E++)
  55699. f[E] = [];
  55700. for (var E = 0, b = g.length; E < b; E++)
  55701. for (var w = m[E], _ = 0; _ < w.length; _++) {
  55702. for (var T = w[_], x = !0, S = 0; S < g.length; S++)
  55703. o(T.p, g[S].p) && (E !== S && I.push({
  55704. froms: E,
  55705. tos: S,
  55706. hole: _
  55707. }),
  55708. x ? (x = !1,
  55709. f[S].push(T)) : C = !0);
  55710. x && f[E].push(T)
  55711. }
  55712. I.length > 0 && (C || (m = f))
  55713. }
  55714. for (var M, A = 0, R = g.length; A < R; A++) {
  55715. h = g[A].s,
  55716. u.push(h),
  55717. M = m[A];
  55718. for (var P = 0, O = M.length; P < O; P++)
  55719. h.holes.push(M[P].h)
  55720. }
  55721. return u
  55722. }
  55723. ,
  55724. n.Shape = function() {
  55725. n.Path.apply(this, arguments),
  55726. this.holes = []
  55727. }
  55728. ,
  55729. n.Shape.prototype = Object.create(n.Path.prototype),
  55730. n.Shape.prototype.constructor = n.Shape,
  55731. n.Shape.prototype.extrude = function(e) {
  55732. return new n.ExtrudeGeometry(this,e)
  55733. }
  55734. ,
  55735. n.Shape.prototype.makeGeometry = function(e) {
  55736. return new n.ShapeGeometry(this,e)
  55737. }
  55738. ,
  55739. n.Shape.prototype.getPointsHoles = function(e) {
  55740. for (var t = [], i = 0, n = this.holes.length; i < n; i++)
  55741. t[i] = this.holes[i].getPoints(e);
  55742. return t
  55743. }
  55744. ,
  55745. n.Shape.prototype.extractAllPoints = function(e) {
  55746. return {
  55747. shape: this.getPoints(e),
  55748. holes: this.getPointsHoles(e)
  55749. }
  55750. }
  55751. ,
  55752. n.Shape.prototype.extractPoints = function(e) {
  55753. return this.extractAllPoints(e)
  55754. }
  55755. ,
  55756. n.LineCurve = function(e, t) {
  55757. this.v1 = e,
  55758. this.v2 = t
  55759. }
  55760. ,
  55761. n.LineCurve.prototype = Object.create(n.Curve.prototype),
  55762. n.LineCurve.prototype.constructor = n.LineCurve,
  55763. n.LineCurve.prototype.getPoint = function(e) {
  55764. var t = this.v2.clone().sub(this.v1);
  55765. return t.multiplyScalar(e).add(this.v1),
  55766. t
  55767. }
  55768. ,
  55769. n.LineCurve.prototype.getPointAt = function(e) {
  55770. return this.getPoint(e)
  55771. }
  55772. ,
  55773. n.LineCurve.prototype.getTangent = function(e) {
  55774. var t = this.v2.clone().sub(this.v1);
  55775. return t.normalize()
  55776. }
  55777. ,
  55778. n.QuadraticBezierCurve = function(e, t, i) {
  55779. this.v0 = e,
  55780. this.v1 = t,
  55781. this.v2 = i
  55782. }
  55783. ,
  55784. n.QuadraticBezierCurve.prototype = Object.create(n.Curve.prototype),
  55785. n.QuadraticBezierCurve.prototype.constructor = n.QuadraticBezierCurve,
  55786. n.QuadraticBezierCurve.prototype.getPoint = function(e) {
  55787. var t = n.ShapeUtils.b2;
  55788. 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))
  55789. }
  55790. ,
  55791. n.QuadraticBezierCurve.prototype.getTangent = function(e) {
  55792. var t = n.CurveUtils.tangentQuadraticBezier;
  55793. 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()
  55794. }
  55795. ,
  55796. n.CubicBezierCurve = function(e, t, i, n) {
  55797. this.v0 = e,
  55798. this.v1 = t,
  55799. this.v2 = i,
  55800. this.v3 = n
  55801. }
  55802. ,
  55803. n.CubicBezierCurve.prototype = Object.create(n.Curve.prototype),
  55804. n.CubicBezierCurve.prototype.constructor = n.CubicBezierCurve,
  55805. n.CubicBezierCurve.prototype.getPoint = function(e) {
  55806. var t = n.ShapeUtils.b3;
  55807. 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))
  55808. }
  55809. ,
  55810. n.CubicBezierCurve.prototype.getTangent = function(e) {
  55811. var t = n.CurveUtils.tangentCubicBezier;
  55812. 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()
  55813. }
  55814. ,
  55815. n.SplineCurve = function(e) {
  55816. this.points = void 0 == e ? [] : e
  55817. }
  55818. ,
  55819. n.SplineCurve.prototype = Object.create(n.Curve.prototype),
  55820. n.SplineCurve.prototype.constructor = n.SplineCurve,
  55821. n.SplineCurve.prototype.getPoint = function(e) {
  55822. var t = this.points
  55823. , i = (t.length - 1) * e
  55824. , r = Math.floor(i)
  55825. , o = i - r
  55826. , a = t[0 === r ? r : r - 1]
  55827. , s = t[r]
  55828. , l = t[r > t.length - 2 ? t.length - 1 : r + 1]
  55829. , c = t[r > t.length - 3 ? t.length - 1 : r + 2]
  55830. , h = n.CurveUtils.interpolate;
  55831. return new n.Vector2(h(a.x, s.x, l.x, c.x, o),h(a.y, s.y, l.y, c.y, o))
  55832. }
  55833. ,
  55834. n.EllipseCurve = function(e, t, i, n, r, o, a, s) {
  55835. this.aX = e,
  55836. this.aY = t,
  55837. this.xRadius = i,
  55838. this.yRadius = n,
  55839. this.aStartAngle = r,
  55840. this.aEndAngle = o,
  55841. this.aClockwise = a,
  55842. this.aRotation = s || 0
  55843. }
  55844. ,
  55845. n.EllipseCurve.prototype = Object.create(n.Curve.prototype),
  55846. n.EllipseCurve.prototype.constructor = n.EllipseCurve,
  55847. n.EllipseCurve.prototype.getPoint = function(e) {
  55848. var t = this.aEndAngle - this.aStartAngle;
  55849. t < 0 && (t += 2 * Math.PI),
  55850. t > 2 * Math.PI && (t -= 2 * Math.PI);
  55851. var i;
  55852. i = this.aClockwise === !0 ? this.aEndAngle + (1 - e) * (2 * Math.PI - t) : this.aStartAngle + e * t;
  55853. var r = this.aX + this.xRadius * Math.cos(i)
  55854. , o = this.aY + this.yRadius * Math.sin(i);
  55855. if (0 !== this.aRotation) {
  55856. var a = Math.cos(this.aRotation)
  55857. , s = Math.sin(this.aRotation)
  55858. , l = r
  55859. , c = o;
  55860. r = (l - this.aX) * a - (c - this.aY) * s + this.aX,
  55861. o = (l - this.aX) * s + (c - this.aY) * a + this.aY
  55862. }
  55863. return new n.Vector2(r,o)
  55864. }
  55865. ,
  55866. n.ArcCurve = function(e, t, i, r, o, a) {
  55867. n.EllipseCurve.call(this, e, t, i, i, r, o, a)
  55868. }
  55869. ,
  55870. n.ArcCurve.prototype = Object.create(n.EllipseCurve.prototype),
  55871. n.ArcCurve.prototype.constructor = n.ArcCurve,
  55872. n.LineCurve3 = n.Curve.create(function(e, t) {
  55873. this.v1 = e,
  55874. this.v2 = t
  55875. }, function(e) {
  55876. var t = new n.Vector3;
  55877. return t.subVectors(this.v2, this.v1),
  55878. t.multiplyScalar(e),
  55879. t.add(this.v1),
  55880. t
  55881. }),
  55882. n.QuadraticBezierCurve3 = n.Curve.create(function(e, t, i) {
  55883. this.v0 = e,
  55884. this.v1 = t,
  55885. this.v2 = i
  55886. }, function(e) {
  55887. var t = n.ShapeUtils.b2;
  55888. 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))
  55889. }),
  55890. n.CubicBezierCurve3 = n.Curve.create(function(e, t, i, n) {
  55891. this.v0 = e,
  55892. this.v1 = t,
  55893. this.v2 = i,
  55894. this.v3 = n
  55895. }, function(e) {
  55896. var t = n.ShapeUtils.b3;
  55897. 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))
  55898. }),
  55899. n.SplineCurve3 = n.Curve.create(function(e) {
  55900. console.warn("THREE.SplineCurve3 will be deprecated. Please use THREE.CatmullRomCurve3"),
  55901. this.points = void 0 == e ? [] : e
  55902. }, function(e) {
  55903. var t = this.points
  55904. , i = (t.length - 1) * e
  55905. , r = Math.floor(i)
  55906. , o = i - r
  55907. , a = t[0 == r ? r : r - 1]
  55908. , s = t[r]
  55909. , l = t[r > t.length - 2 ? t.length - 1 : r + 1]
  55910. , c = t[r > t.length - 3 ? t.length - 1 : r + 2]
  55911. , h = n.CurveUtils.interpolate;
  55912. 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))
  55913. }),
  55914. n.CatmullRomCurve3 = function() {
  55915. function e() {}
  55916. var t = new n.Vector3
  55917. , i = new e
  55918. , r = new e
  55919. , o = new e;
  55920. return e.prototype.init = function(e, t, i, n) {
  55921. this.c0 = e,
  55922. this.c1 = i,
  55923. this.c2 = -3 * e + 3 * t - 2 * i - n,
  55924. this.c3 = 2 * e - 2 * t + i + n
  55925. }
  55926. ,
  55927. e.prototype.initNonuniformCatmullRom = function(e, t, i, n, r, o, a) {
  55928. var s = (t - e) / r - (i - e) / (r + o) + (i - t) / o
  55929. , l = (i - t) / o - (n - t) / (o + a) + (n - i) / a;
  55930. s *= o,
  55931. l *= o,
  55932. this.init(t, i, s, l)
  55933. }
  55934. ,
  55935. e.prototype.initCatmullRom = function(e, t, i, n, r) {
  55936. this.init(t, i, r * (i - e), r * (n - t))
  55937. }
  55938. ,
  55939. e.prototype.calc = function(e) {
  55940. var t = e * e
  55941. , i = t * e;
  55942. return this.c0 + this.c1 * e + this.c2 * t + this.c3 * i
  55943. }
  55944. ,
  55945. n.Curve.create(function(e) {
  55946. this.points = e || [],
  55947. this.closed = !1
  55948. }, function(e) {
  55949. var a, s, l, c, h = this.points;
  55950. c = h.length,
  55951. c < 2 && console.log("duh, you need at least 2 points"),
  55952. a = (c - (this.closed ? 0 : 1)) * e,
  55953. s = Math.floor(a),
  55954. l = a - s,
  55955. this.closed ? s += s > 0 ? 0 : (Math.floor(Math.abs(s) / h.length) + 1) * h.length : 0 === l && s === c - 1 && (s = c - 2,
  55956. l = 1);
  55957. var u, d, p, f;
  55958. if (this.closed || s > 0 ? u = h[(s - 1) % c] : (t.subVectors(h[0], h[1]).add(h[0]),
  55959. u = t),
  55960. d = h[s % c],
  55961. p = h[(s + 1) % c],
  55962. this.closed || s + 2 < c ? f = h[(s + 2) % c] : (t.subVectors(h[c - 1], h[c - 2]).add(h[c - 1]),
  55963. f = t),
  55964. void 0 === this.type || "centripetal" === this.type || "chordal" === this.type) {
  55965. var g = "chordal" === this.type ? .5 : .25
  55966. , m = Math.pow(u.distanceToSquared(d), g)
  55967. , v = Math.pow(d.distanceToSquared(p), g)
  55968. , A = Math.pow(p.distanceToSquared(f), g);
  55969. v < 1e-4 && (v = 1),
  55970. m < 1e-4 && (m = v),
  55971. A < 1e-4 && (A = v),
  55972. i.initNonuniformCatmullRom(u.x, d.x, p.x, f.x, m, v, A),
  55973. r.initNonuniformCatmullRom(u.y, d.y, p.y, f.y, m, v, A),
  55974. o.initNonuniformCatmullRom(u.z, d.z, p.z, f.z, m, v, A)
  55975. } else if ("catmullrom" === this.type) {
  55976. var y = void 0 !== this.tension ? this.tension : .5;
  55977. i.initCatmullRom(u.x, d.x, p.x, f.x, y),
  55978. r.initCatmullRom(u.y, d.y, p.y, f.y, y),
  55979. o.initCatmullRom(u.z, d.z, p.z, f.z, y)
  55980. }
  55981. var C = new n.Vector3(i.calc(l),r.calc(l),o.calc(l));
  55982. return C
  55983. })
  55984. }(),
  55985. n.ClosedSplineCurve3 = function(e) {
  55986. console.warn("THREE.ClosedSplineCurve3 has been deprecated. Please use THREE.CatmullRomCurve3."),
  55987. n.CatmullRomCurve3.call(this, e),
  55988. this.type = "catmullrom",
  55989. this.closed = !0
  55990. }
  55991. ,
  55992. n.ClosedSplineCurve3.prototype = Object.create(n.CatmullRomCurve3.prototype),
  55993. n.BoxGeometry = function(e, t, i, r, o, a) {
  55994. n.Geometry.call(this),
  55995. this.type = "BoxGeometry",
  55996. this.parameters = {
  55997. width: e,
  55998. height: t,
  55999. depth: i,
  56000. widthSegments: r,
  56001. heightSegments: o,
  56002. depthSegments: a
  56003. },
  56004. this.fromBufferGeometry(new n.BoxBufferGeometry(e,t,i,r,o,a)),
  56005. this.mergeVertices()
  56006. }
  56007. ,
  56008. n.BoxGeometry.prototype = Object.create(n.Geometry.prototype),
  56009. n.BoxGeometry.prototype.constructor = n.BoxGeometry,
  56010. n.CubeGeometry = n.BoxGeometry,
  56011. n.BoxBufferGeometry = function(e, t, i, r, o, a) {
  56012. function s(e, t, i) {
  56013. var n = 0;
  56014. return n += e * t * 2,
  56015. n += e * i * 2,
  56016. n += i * t * 2,
  56017. 4 * n
  56018. }
  56019. function l(e, t, i, r, o, a, s, l, h, u, I) {
  56020. 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++)
  56021. for (var L = O * b - _, D = 0; D < x; D++) {
  56022. var N = D * E - w;
  56023. P[e] = N * r,
  56024. P[t] = L * o,
  56025. P[i] = T,
  56026. p[m] = P.x,
  56027. p[m + 1] = P.y,
  56028. p[m + 2] = P.z,
  56029. P[e] = 0,
  56030. P[t] = 0,
  56031. P[i] = l > 0 ? 1 : -1,
  56032. f[m] = P.x,
  56033. f[m + 1] = P.y,
  56034. f[m + 2] = P.z,
  56035. g[v] = D / h,
  56036. g[v + 1] = 1 - O / u,
  56037. m += 3,
  56038. v += 2,
  56039. M += 1
  56040. }
  56041. for (O = 0; O < u; O++)
  56042. for (D = 0; D < h; D++) {
  56043. var B = y + D + x * O
  56044. , F = y + D + x * (O + 1)
  56045. , V = y + (D + 1) + x * (O + 1)
  56046. , U = y + (D + 1) + x * O;
  56047. d[A] = B,
  56048. d[A + 1] = F,
  56049. d[A + 2] = U,
  56050. d[A + 3] = F,
  56051. d[A + 4] = V,
  56052. d[A + 5] = U,
  56053. A += 6,
  56054. R += 6
  56055. }
  56056. c.addGroup(C, R, I),
  56057. C += R,
  56058. y += M
  56059. }
  56060. n.BufferGeometry.call(this),
  56061. this.type = "BoxBufferGeometry",
  56062. this.parameters = {
  56063. width: e,
  56064. height: t,
  56065. depth: i,
  56066. widthSegments: r,
  56067. heightSegments: o,
  56068. depthSegments: a
  56069. };
  56070. var c = this;
  56071. r = Math.floor(r) || 1,
  56072. o = Math.floor(o) || 1,
  56073. a = Math.floor(a) || 1;
  56074. var h = s(r, o, a)
  56075. , u = h / 4 * 6
  56076. , d = new (u > 65535 ? Uint32Array : Uint16Array)(u)
  56077. , p = new Float32Array(3 * h)
  56078. , f = new Float32Array(3 * h)
  56079. , g = new Float32Array(2 * h)
  56080. , m = 0
  56081. , v = 0
  56082. , A = 0
  56083. , y = 0
  56084. , C = 0;
  56085. l("z", "y", "x", -1, -1, i, t, e, a, o, 0),
  56086. l("z", "y", "x", 1, -1, i, t, -e, a, o, 1),
  56087. l("x", "z", "y", 1, 1, e, i, t, r, a, 2),
  56088. l("x", "z", "y", 1, -1, e, i, -t, r, a, 3),
  56089. l("x", "y", "z", 1, -1, e, t, i, r, o, 4),
  56090. l("x", "y", "z", -1, -1, e, t, -i, r, o, 5),
  56091. this.setIndex(new n.BufferAttribute(d,1)),
  56092. this.addAttribute("position", new n.BufferAttribute(p,3)),
  56093. this.addAttribute("normal", new n.BufferAttribute(f,3)),
  56094. this.addAttribute("uv", new n.BufferAttribute(g,2))
  56095. }
  56096. ,
  56097. n.BoxBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  56098. n.BoxBufferGeometry.prototype.constructor = n.BoxBufferGeometry,
  56099. n.CircleGeometry = function(e, t, i, r) {
  56100. n.Geometry.call(this),
  56101. this.type = "CircleGeometry",
  56102. this.parameters = {
  56103. radius: e,
  56104. segments: t,
  56105. thetaStart: i,
  56106. thetaLength: r
  56107. },
  56108. this.fromBufferGeometry(new n.CircleBufferGeometry(e,t,i,r))
  56109. }
  56110. ,
  56111. n.CircleGeometry.prototype = Object.create(n.Geometry.prototype),
  56112. n.CircleGeometry.prototype.constructor = n.CircleGeometry,
  56113. n.CircleBufferGeometry = function(e, t, i, r) {
  56114. n.BufferGeometry.call(this),
  56115. this.type = "CircleBufferGeometry",
  56116. this.parameters = {
  56117. radius: e,
  56118. segments: t,
  56119. thetaStart: i,
  56120. thetaLength: r
  56121. },
  56122. e = e || 50,
  56123. t = void 0 !== t ? Math.max(3, t) : 8,
  56124. i = void 0 !== i ? i : 0,
  56125. r = void 0 !== r ? r : 2 * Math.PI;
  56126. var o = t + 2
  56127. , a = new Float32Array(3 * o)
  56128. , s = new Float32Array(3 * o)
  56129. , l = new Float32Array(2 * o);
  56130. s[2] = 1,
  56131. l[0] = .5,
  56132. l[1] = .5;
  56133. for (var c = 0, h = 3, u = 2; c <= t; c++,
  56134. h += 3,
  56135. u += 2) {
  56136. var d = i + c / t * r;
  56137. a[h] = e * Math.cos(d),
  56138. a[h + 1] = e * Math.sin(d),
  56139. s[h + 2] = 1,
  56140. l[u] = (a[h] / e + 1) / 2,
  56141. l[u + 1] = (a[h + 1] / e + 1) / 2
  56142. }
  56143. for (var p = [], h = 1; h <= t; h++)
  56144. p.push(h, h + 1, 0);
  56145. this.setIndex(new n.BufferAttribute(new Uint16Array(p),1)),
  56146. this.addAttribute("position", new n.BufferAttribute(a,3)),
  56147. this.addAttribute("normal", new n.BufferAttribute(s,3)),
  56148. this.addAttribute("uv", new n.BufferAttribute(l,2)),
  56149. this.boundingSphere = new n.Sphere(new n.Vector3,e)
  56150. }
  56151. ,
  56152. n.CircleBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  56153. n.CircleBufferGeometry.prototype.constructor = n.CircleBufferGeometry,
  56154. n.CylinderBufferGeometry = function(e, t, i, r, o, a, s, l) {
  56155. function c() {
  56156. var e = (r + 1) * (o + 1);
  56157. return a === !1 && (e += 2 * (r + 1) + 2 * r),
  56158. e
  56159. }
  56160. function h() {
  56161. var e = r * o * 2 * 3;
  56162. return a === !1 && (e += 2 * r * 3),
  56163. e
  56164. }
  56165. function u() {
  56166. var a, c, h = new n.Vector3, u = new n.Vector3, d = (t - e) / i;
  56167. for (c = 0; c <= o; c++) {
  56168. var p = []
  56169. , f = c / o
  56170. , b = f * (t - e) + e;
  56171. for (a = 0; a <= r; a++) {
  56172. var w = a / r;
  56173. u.x = b * Math.sin(w * l + s),
  56174. u.y = -f * i + E,
  56175. u.z = b * Math.cos(w * l + s),
  56176. m.setXYZ(y, u.x, u.y, u.z),
  56177. h.copy(u),
  56178. (0 === e && 0 === c || 0 === t && c === o) && (h.x = Math.sin(w * l + s),
  56179. h.z = Math.cos(w * l + s)),
  56180. h.setY(Math.sqrt(h.x * h.x + h.z * h.z) * d).normalize(),
  56181. v.setXYZ(y, h.x, h.y, h.z),
  56182. A.setXY(y, w, 1 - f),
  56183. p.push(y),
  56184. y++
  56185. }
  56186. I.push(p)
  56187. }
  56188. for (a = 0; a < r; a++)
  56189. for (c = 0; c < o; c++) {
  56190. var _ = I[c][a]
  56191. , T = I[c + 1][a]
  56192. , x = I[c + 1][a + 1]
  56193. , S = I[c][a + 1];
  56194. g.setX(C, _),
  56195. C++,
  56196. g.setX(C, T),
  56197. C++,
  56198. g.setX(C, S),
  56199. C++,
  56200. g.setX(C, T),
  56201. C++,
  56202. g.setX(C, x),
  56203. C++,
  56204. g.setX(C, S),
  56205. C++
  56206. }
  56207. }
  56208. function d(i) {
  56209. var o, a, c, h = new n.Vector2, u = new n.Vector3, d = i === !0 ? e : t, p = i === !0 ? 1 : -1;
  56210. for (a = y,
  56211. o = 1; o <= r; o++)
  56212. m.setXYZ(y, 0, E * p, 0),
  56213. v.setXYZ(y, 0, p, 0),
  56214. i === !0 ? (h.x = o / r,
  56215. h.y = 0) : (h.x = (o - 1) / r,
  56216. h.y = 1),
  56217. A.setXY(y, h.x, h.y),
  56218. y++;
  56219. for (c = y,
  56220. o = 0; o <= r; o++) {
  56221. var f = o / r;
  56222. u.x = d * Math.sin(f * l + s),
  56223. u.y = E * p,
  56224. u.z = d * Math.cos(f * l + s),
  56225. m.setXYZ(y, u.x, u.y, u.z),
  56226. v.setXYZ(y, 0, p, 0),
  56227. A.setXY(y, f, i === !0 ? 1 : 0),
  56228. y++
  56229. }
  56230. for (o = 0; o < r; o++) {
  56231. var I = a + o
  56232. , b = c + o;
  56233. i === !0 ? (g.setX(C, b),
  56234. C++,
  56235. g.setX(C, b + 1),
  56236. C++,
  56237. g.setX(C, I),
  56238. C++) : (g.setX(C, b + 1),
  56239. C++,
  56240. g.setX(C, b),
  56241. C++,
  56242. g.setX(C, I),
  56243. C++)
  56244. }
  56245. }
  56246. n.BufferGeometry.call(this),
  56247. this.type = "CylinderBufferGeometry",
  56248. this.parameters = {
  56249. radiusTop: e,
  56250. radiusBottom: t,
  56251. height: i,
  56252. radialSegments: r,
  56253. heightSegments: o,
  56254. openEnded: a,
  56255. thetaStart: s,
  56256. thetaLength: l
  56257. },
  56258. e = void 0 !== e ? e : 20,
  56259. t = void 0 !== t ? t : 20,
  56260. i = void 0 !== i ? i : 100,
  56261. r = Math.floor(r) || 8,
  56262. o = Math.floor(o) || 1,
  56263. a = void 0 !== a && a,
  56264. s = void 0 !== s ? s : 0,
  56265. l = void 0 !== l ? l : 2 * Math.PI;
  56266. var p = c()
  56267. , f = h()
  56268. , g = new n.BufferAttribute(new (f > 65535 ? Uint32Array : Uint16Array)(f),1)
  56269. , m = new n.BufferAttribute(new Float32Array(3 * p),3)
  56270. , v = new n.BufferAttribute(new Float32Array(3 * p),3)
  56271. , A = new n.BufferAttribute(new Float32Array(2 * p),2)
  56272. , y = 0
  56273. , C = 0
  56274. , I = []
  56275. , E = i / 2;
  56276. u(),
  56277. a === !1 && (e > 0 && d(!0),
  56278. t > 0 && d(!1)),
  56279. this.setIndex(g),
  56280. this.addAttribute("position", m),
  56281. this.addAttribute("normal", v),
  56282. this.addAttribute("uv", A)
  56283. }
  56284. ,
  56285. n.CylinderBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  56286. n.CylinderBufferGeometry.prototype.constructor = n.CylinderBufferGeometry,
  56287. n.CylinderGeometry = function(e, t, i, r, o, a, s, l) {
  56288. n.Geometry.call(this),
  56289. this.type = "CylinderGeometry",
  56290. this.parameters = {
  56291. radiusTop: e,
  56292. radiusBottom: t,
  56293. height: i,
  56294. radialSegments: r,
  56295. heightSegments: o,
  56296. openEnded: a,
  56297. thetaStart: s,
  56298. thetaLength: l
  56299. },
  56300. this.fromBufferGeometry(new n.CylinderBufferGeometry(e,t,i,r,o,a,s,l)),
  56301. this.mergeVertices()
  56302. }
  56303. ,
  56304. n.CylinderGeometry.prototype = Object.create(n.Geometry.prototype),
  56305. n.CylinderGeometry.prototype.constructor = n.CylinderGeometry,
  56306. n.EdgesGeometry = function(e, t) {
  56307. function i(e, t) {
  56308. return e - t
  56309. }
  56310. n.BufferGeometry.call(this),
  56311. t = void 0 !== t ? t : 1;
  56312. var r, o = Math.cos(n.Math.degToRad(t)), a = [0, 0], s = {}, l = ["a", "b", "c"];
  56313. e instanceof n.BufferGeometry ? (r = new n.Geometry,
  56314. r.fromBufferGeometry(e)) : r = e.clone(),
  56315. r.mergeVertices(),
  56316. r.computeFaceNormals();
  56317. for (var c = r.vertices, h = r.faces, u = 0, d = h.length; u < d; u++)
  56318. for (var p = h[u], f = 0; f < 3; f++) {
  56319. a[0] = p[l[f]],
  56320. a[1] = p[l[(f + 1) % 3]],
  56321. a.sort(i);
  56322. var g = a.toString();
  56323. void 0 === s[g] ? s[g] = {
  56324. vert1: a[0],
  56325. vert2: a[1],
  56326. face1: u,
  56327. face2: void 0
  56328. } : s[g].face2 = u
  56329. }
  56330. var m = [];
  56331. for (var g in s) {
  56332. var v = s[g];
  56333. if (void 0 === v.face2 || h[v.face1].normal.dot(h[v.face2].normal) <= o) {
  56334. var A = c[v.vert1];
  56335. m.push(A.x),
  56336. m.push(A.y),
  56337. m.push(A.z),
  56338. A = c[v.vert2],
  56339. m.push(A.x),
  56340. m.push(A.y),
  56341. m.push(A.z)
  56342. }
  56343. }
  56344. this.addAttribute("position", new n.BufferAttribute(new Float32Array(m),3))
  56345. }
  56346. ,
  56347. n.EdgesGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  56348. n.EdgesGeometry.prototype.constructor = n.EdgesGeometry,
  56349. n.ExtrudeGeometry = function(e, t) {
  56350. return "undefined" == typeof e ? void (e = []) : (n.Geometry.call(this),
  56351. this.type = "ExtrudeGeometry",
  56352. e = Array.isArray(e) ? e : [e],
  56353. this.addShapeList(e, t),
  56354. void this.computeFaceNormals())
  56355. }
  56356. ;
  56357. n.ExtrudeGeometry.prototype = Object.create(n.Geometry.prototype);
  56358. n.ExtrudeGeometry.prototype.constructor = n.ExtrudeGeometry,
  56359. n.ExtrudeGeometry.prototype.addShapeList = function(e, t) {
  56360. for (var i = e.length, n = 0; n < i; n++) {
  56361. var r = e[n];
  56362. this.addShape(r, t)
  56363. }
  56364. }
  56365. ,
  56366. n.ExtrudeGeometry.prototype.addShape = function(e, t) {
  56367. function i(e, t, i) {
  56368. return t || console.error("THREE.ExtrudeGeometry: vec does not exist"),
  56369. t.clone().multiplyScalar(i).add(e)
  56370. }
  56371. function r(e, t, i) {
  56372. 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;
  56373. if (Math.abs(d) > Number.EPSILON) {
  56374. var p = Math.sqrt(u)
  56375. , f = Math.sqrt(c * c + h * h)
  56376. , g = t.x - l / p
  56377. , m = t.y + s / p
  56378. , v = i.x - h / f
  56379. , A = i.y + c / f
  56380. , y = ((v - g) * h - (A - m) * c) / (s * h - l * c);
  56381. r = g + s * y - e.x,
  56382. o = m + l * y - e.y;
  56383. var C = r * r + o * o;
  56384. if (C <= 2)
  56385. return new n.Vector2(r,o);
  56386. a = Math.sqrt(C / 2)
  56387. } else {
  56388. var I = !1;
  56389. s > Number.EPSILON ? c > Number.EPSILON && (I = !0) : s < -Number.EPSILON ? c < -Number.EPSILON && (I = !0) : Math.sign(l) === Math.sign(h) && (I = !0),
  56390. I ? (r = -l,
  56391. o = s,
  56392. a = Math.sqrt(u)) : (r = s,
  56393. o = l,
  56394. a = Math.sqrt(u / 2))
  56395. }
  56396. return new n.Vector2(r / a,o / a)
  56397. }
  56398. function o() {
  56399. if (C) {
  56400. var e = 0
  56401. , t = z * e;
  56402. for (Y = 0; Y < W; Y++)
  56403. G = N[Y],
  56404. c(G[2] + t, G[1] + t, G[0] + t);
  56405. for (e = E + 2 * y,
  56406. t = z * e,
  56407. Y = 0; Y < W; Y++)
  56408. G = N[Y],
  56409. c(G[0] + t, G[1] + t, G[2] + t)
  56410. } else {
  56411. for (Y = 0; Y < W; Y++)
  56412. G = N[Y],
  56413. c(G[2], G[1], G[0]);
  56414. for (Y = 0; Y < W; Y++)
  56415. G = N[Y],
  56416. c(G[0] + z * E, G[1] + z * E, G[2] + z * E)
  56417. }
  56418. }
  56419. function a() {
  56420. var e = 0;
  56421. for (s(B, e),
  56422. e += B.length,
  56423. x = 0,
  56424. S = L.length; x < S; x++)
  56425. T = L[x],
  56426. s(T, e),
  56427. e += T.length
  56428. }
  56429. function s(e, t) {
  56430. var i, n;
  56431. for (Y = e.length; --Y >= 0; ) {
  56432. i = Y,
  56433. n = Y - 1,
  56434. n < 0 && (n = e.length - 1);
  56435. var r = 0
  56436. , o = E + 2 * y;
  56437. for (r = 0; r < o; r++) {
  56438. var a = z * r
  56439. , s = z * (r + 1)
  56440. , l = t + i + a
  56441. , c = t + n + a
  56442. , u = t + n + s
  56443. , d = t + i + s;
  56444. h(l, c, u, d, e, r, o, i, n)
  56445. }
  56446. }
  56447. }
  56448. function l(e, t, i) {
  56449. M.vertices.push(new n.Vector3(e,t,i))
  56450. }
  56451. function c(e, t, i) {
  56452. e += R,
  56453. t += R,
  56454. i += R,
  56455. M.faces.push(new n.Face3(e,t,i,null,null,0));
  56456. var r = _.generateTopUV(M, e, t, i);
  56457. M.faceVertexUvs[0].push(r)
  56458. }
  56459. function h(e, t, i, r, o, a, s, l, c) {
  56460. e += R,
  56461. t += R,
  56462. i += R,
  56463. r += R,
  56464. M.faces.push(new n.Face3(e,t,r,null,null,1)),
  56465. M.faces.push(new n.Face3(t,i,r,null,null,1));
  56466. var h = _.generateSideWallUV(M, e, t, i, r);
  56467. M.faceVertexUvs[0].push([h[0], h[1], h[3]]),
  56468. M.faceVertexUvs[0].push([h[1], h[2], h[3]])
  56469. }
  56470. 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;
  56471. b && (u = b.getSpacedPoints(E),
  56472. w = !0,
  56473. C = !1,
  56474. d = void 0 !== t.frames ? t.frames : new n.TubeGeometry.FrenetFrames(b,E,!1),
  56475. p = new n.Vector3,
  56476. f = new n.Vector3,
  56477. g = new n.Vector3),
  56478. C || (y = 0,
  56479. v = 0,
  56480. A = 0);
  56481. 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);
  56482. if (D) {
  56483. for (O = O.reverse(),
  56484. x = 0,
  56485. S = L.length; x < S; x++)
  56486. T = L[x],
  56487. n.ShapeUtils.isClockWise(T) && (L[x] = T.reverse());
  56488. D = !1
  56489. }
  56490. var N = n.ShapeUtils.triangulateShape(O, L)
  56491. , B = O;
  56492. for (x = 0,
  56493. S = L.length; x < S; x++)
  56494. T = L[x],
  56495. O = O.concat(T);
  56496. 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++,
  56497. Z++,
  56498. q++)
  56499. Z === X && (Z = 0),
  56500. q === X && (q = 0),
  56501. j[Y] = r(B[Y], B[Z], B[q]);
  56502. var K, Q = [], J = j.concat();
  56503. for (x = 0,
  56504. S = L.length; x < S; x++) {
  56505. for (T = L[x],
  56506. K = [],
  56507. Y = 0,
  56508. X = T.length,
  56509. Z = X - 1,
  56510. q = Y + 1; Y < X; Y++,
  56511. Z++,
  56512. q++)
  56513. Z === X && (Z = 0),
  56514. q === X && (q = 0),
  56515. K[Y] = r(T[Y], T[Z], T[q]);
  56516. Q.push(K),
  56517. J = J.concat(K)
  56518. }
  56519. for (F = 0; F < y; F++) {
  56520. for (U = F / y,
  56521. k = v * (1 - U),
  56522. V = A * Math.sin(U * Math.PI / 2),
  56523. Y = 0,
  56524. X = B.length; Y < X; Y++)
  56525. H = i(B[Y], j[Y], V),
  56526. l(H.x, H.y, -k);
  56527. for (x = 0,
  56528. S = L.length; x < S; x++)
  56529. for (T = L[x],
  56530. K = Q[x],
  56531. Y = 0,
  56532. X = T.length; Y < X; Y++)
  56533. H = i(T[Y], K[Y], V),
  56534. l(H.x, H.y, -k)
  56535. }
  56536. for (V = A,
  56537. Y = 0; Y < z; Y++)
  56538. H = C ? i(O[Y], J[Y], V) : O[Y],
  56539. w ? (f.copy(d.normals[0]).multiplyScalar(H.x),
  56540. p.copy(d.binormals[0]).multiplyScalar(H.y),
  56541. g.copy(u[0]).add(f).add(p),
  56542. l(g.x, g.y, g.z)) : l(H.x, H.y, 0);
  56543. var $;
  56544. for ($ = 1; $ <= E; $++)
  56545. for (Y = 0; Y < z; Y++)
  56546. H = C ? i(O[Y], J[Y], V) : O[Y],
  56547. w ? (f.copy(d.normals[$]).multiplyScalar(H.x),
  56548. p.copy(d.binormals[$]).multiplyScalar(H.y),
  56549. g.copy(u[$]).add(f).add(p),
  56550. l(g.x, g.y, g.z)) : l(H.x, H.y, m / E * $);
  56551. for (F = y - 1; F >= 0; F--) {
  56552. for (U = F / y,
  56553. k = v * (1 - U),
  56554. V = A * Math.sin(U * Math.PI / 2),
  56555. Y = 0,
  56556. X = B.length; Y < X; Y++)
  56557. H = i(B[Y], j[Y], V),
  56558. l(H.x, H.y, m + k);
  56559. for (x = 0,
  56560. S = L.length; x < S; x++)
  56561. for (T = L[x],
  56562. K = Q[x],
  56563. Y = 0,
  56564. X = T.length; Y < X; Y++)
  56565. H = i(T[Y], K[Y], V),
  56566. w ? l(H.x, H.y + u[E - 1].y, u[E - 1].x + k) : l(H.x, H.y, m + k)
  56567. }
  56568. o(),
  56569. a()
  56570. }
  56571. ,
  56572. n.ExtrudeGeometry.WorldUVGenerator = {
  56573. generateTopUV: function(e, t, i, r) {
  56574. var o = e.vertices
  56575. , a = o[t]
  56576. , s = o[i]
  56577. , l = o[r];
  56578. return [new n.Vector2(a.x,a.y), new n.Vector2(s.x,s.y), new n.Vector2(l.x,l.y)]
  56579. },
  56580. generateSideWallUV: function(e, t, i, r, o) {
  56581. var a = e.vertices
  56582. , s = a[t]
  56583. , l = a[i]
  56584. , c = a[r]
  56585. , h = a[o];
  56586. 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)]
  56587. }
  56588. },
  56589. n.ShapeGeometry = function(e, t) {
  56590. n.Geometry.call(this),
  56591. this.type = "ShapeGeometry",
  56592. Array.isArray(e) === !1 && (e = [e]),
  56593. this.addShapeList(e, t),
  56594. this.computeFaceNormals()
  56595. }
  56596. ,
  56597. n.ShapeGeometry.prototype = Object.create(n.Geometry.prototype),
  56598. n.ShapeGeometry.prototype.constructor = n.ShapeGeometry,
  56599. n.ShapeGeometry.prototype.addShapeList = function(e, t) {
  56600. for (var i = 0, n = e.length; i < n; i++)
  56601. this.addShape(e[i], t);
  56602. return this
  56603. }
  56604. ,
  56605. n.ShapeGeometry.prototype.addShape = function(e, t) {
  56606. void 0 === t && (t = {});
  56607. 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);
  56608. if (p) {
  56609. for (u = u.reverse(),
  56610. i = 0,
  56611. r = d.length; i < r; i++)
  56612. o = d[i],
  56613. n.ShapeUtils.isClockWise(o) && (d[i] = o.reverse());
  56614. p = !1
  56615. }
  56616. var f = n.ShapeUtils.triangulateShape(u, d);
  56617. for (i = 0,
  56618. r = d.length; i < r; i++)
  56619. o = d[i],
  56620. u = u.concat(o);
  56621. var g, m, v = u.length, A = f.length;
  56622. for (i = 0; i < v; i++)
  56623. g = u[i],
  56624. this.vertices.push(new n.Vector3(g.x,g.y,0));
  56625. for (i = 0; i < A; i++) {
  56626. m = f[i];
  56627. var y = m[0] + c
  56628. , C = m[1] + c
  56629. , I = m[2] + c;
  56630. this.faces.push(new n.Face3(y,C,I,null,null,s)),
  56631. this.faceVertexUvs[0].push(l.generateTopUV(this, y, C, I))
  56632. }
  56633. }
  56634. ,
  56635. n.LatheBufferGeometry = function(e, t, i, r) {
  56636. n.BufferGeometry.call(this),
  56637. this.type = "LatheBufferGeometry",
  56638. this.parameters = {
  56639. points: e,
  56640. segments: t,
  56641. phiStart: i,
  56642. phiLength: r
  56643. },
  56644. t = Math.floor(t) || 12,
  56645. i = i || 0,
  56646. r = r || 2 * Math.PI,
  56647. r = n.Math.clamp(r, 0, 2 * Math.PI);
  56648. 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),
  56649. 1 / t), m = new n.Vector3, v = new n.Vector2;
  56650. for (a = 0; a <= t; a++) {
  56651. var A = i + a * g * r
  56652. , y = Math.sin(A)
  56653. , C = Math.cos(A);
  56654. for (s = 0; s <= e.length - 1; s++)
  56655. m.x = e[s].x * y,
  56656. m.y = e[s].y,
  56657. m.z = e[s].x * C,
  56658. u.setXYZ(p, m.x, m.y, m.z),
  56659. v.x = a / t,
  56660. v.y = s / (e.length - 1),
  56661. d.setXY(p, v.x, v.y),
  56662. p++
  56663. }
  56664. for (a = 0; a < t; a++)
  56665. for (s = 0; s < e.length - 1; s++) {
  56666. o = s + a * e.length;
  56667. var I = o
  56668. , E = o + e.length
  56669. , b = o + e.length + 1
  56670. , w = o + 1;
  56671. h.setX(f, I),
  56672. f++,
  56673. h.setX(f, E),
  56674. f++,
  56675. h.setX(f, w),
  56676. f++,
  56677. h.setX(f, E),
  56678. f++,
  56679. h.setX(f, b),
  56680. f++,
  56681. h.setX(f, w),
  56682. f++
  56683. }
  56684. if (this.setIndex(h),
  56685. this.addAttribute("position", u),
  56686. this.addAttribute("uv", d),
  56687. this.computeVertexNormals(),
  56688. r === 2 * Math.PI) {
  56689. var _ = this.attributes.normal.array
  56690. , T = new n.Vector3
  56691. , x = new n.Vector3
  56692. , S = new n.Vector3;
  56693. for (o = t * e.length * 3,
  56694. a = 0,
  56695. s = 0; a < e.length; a++,
  56696. s += 3)
  56697. T.x = _[s + 0],
  56698. T.y = _[s + 1],
  56699. T.z = _[s + 2],
  56700. x.x = _[o + s + 0],
  56701. x.y = _[o + s + 1],
  56702. x.z = _[o + s + 2],
  56703. S.addVectors(T, x).normalize(),
  56704. _[s + 0] = _[o + s + 0] = S.x,
  56705. _[s + 1] = _[o + s + 1] = S.y,
  56706. _[s + 2] = _[o + s + 2] = S.z
  56707. }
  56708. }
  56709. ,
  56710. n.LatheBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  56711. n.LatheBufferGeometry.prototype.constructor = n.LatheBufferGeometry,
  56712. n.LatheGeometry = function(e, t, i, r) {
  56713. n.Geometry.call(this),
  56714. this.type = "LatheGeometry",
  56715. this.parameters = {
  56716. points: e,
  56717. segments: t,
  56718. phiStart: i,
  56719. phiLength: r
  56720. },
  56721. this.fromBufferGeometry(new n.LatheBufferGeometry(e,t,i,r)),
  56722. this.mergeVertices()
  56723. }
  56724. ,
  56725. n.LatheGeometry.prototype = Object.create(n.Geometry.prototype),
  56726. n.LatheGeometry.prototype.constructor = n.LatheGeometry,
  56727. n.PlaneGeometry = function(e, t, i, r) {
  56728. n.Geometry.call(this),
  56729. this.type = "PlaneGeometry",
  56730. this.parameters = {
  56731. width: e,
  56732. height: t,
  56733. widthSegments: i,
  56734. heightSegments: r
  56735. },
  56736. this.fromBufferGeometry(new n.PlaneBufferGeometry(e,t,i,r))
  56737. }
  56738. ,
  56739. n.PlaneGeometry.prototype = Object.create(n.Geometry.prototype),
  56740. n.PlaneGeometry.prototype.constructor = n.PlaneGeometry,
  56741. n.PlaneBufferGeometry = function(e, t, i, r) {
  56742. n.BufferGeometry.call(this),
  56743. this.type = "PlaneBufferGeometry",
  56744. this.parameters = {
  56745. width: e,
  56746. height: t,
  56747. widthSegments: i,
  56748. heightSegments: r
  56749. };
  56750. 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++)
  56751. for (var y = A * d - a, C = 0; C < c; C++) {
  56752. var I = C * u - o;
  56753. p[m] = I,
  56754. p[m + 1] = -y,
  56755. f[m + 2] = 1,
  56756. g[v] = C / s,
  56757. g[v + 1] = 1 - A / l,
  56758. m += 3,
  56759. v += 2
  56760. }
  56761. m = 0;
  56762. for (var E = new (p.length / 3 > 65535 ? Uint32Array : Uint16Array)(s * l * 6), A = 0; A < l; A++)
  56763. for (var C = 0; C < s; C++) {
  56764. var b = C + c * A
  56765. , w = C + c * (A + 1)
  56766. , _ = C + 1 + c * (A + 1)
  56767. , T = C + 1 + c * A;
  56768. E[m] = b,
  56769. E[m + 1] = w,
  56770. E[m + 2] = T,
  56771. E[m + 3] = w,
  56772. E[m + 4] = _,
  56773. E[m + 5] = T,
  56774. m += 6
  56775. }
  56776. this.setIndex(new n.BufferAttribute(E,1)),
  56777. this.addAttribute("position", new n.BufferAttribute(p,3)),
  56778. this.addAttribute("normal", new n.BufferAttribute(f,3)),
  56779. this.addAttribute("uv", new n.BufferAttribute(g,2))
  56780. }
  56781. ,
  56782. n.PlaneBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  56783. n.PlaneBufferGeometry.prototype.constructor = n.PlaneBufferGeometry,
  56784. n.RingBufferGeometry = function(e, t, i, r, o, a) {
  56785. n.BufferGeometry.call(this),
  56786. this.type = "RingBufferGeometry",
  56787. this.parameters = {
  56788. innerRadius: e,
  56789. outerRadius: t,
  56790. thetaSegments: i,
  56791. phiSegments: r,
  56792. thetaStart: o,
  56793. thetaLength: a
  56794. },
  56795. e = e || 20,
  56796. t = t || 50,
  56797. o = void 0 !== o ? o : 0,
  56798. a = void 0 !== a ? a : 2 * Math.PI,
  56799. i = void 0 !== i ? Math.max(3, i) : 8,
  56800. r = void 0 !== r ? Math.max(1, r) : 1;
  56801. 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;
  56802. for (l = 0; l <= r; l++) {
  56803. for (c = 0; c <= i; c++)
  56804. s = o + c / i * a,
  56805. C.x = A * Math.cos(s),
  56806. C.y = A * Math.sin(s),
  56807. p.setXYZ(m, C.x, C.y, C.z),
  56808. f.setXYZ(m, 0, 0, 1),
  56809. I.x = (C.x / t + 1) / 2,
  56810. I.y = (C.y / t + 1) / 2,
  56811. g.setXY(m, I.x, I.y),
  56812. m++;
  56813. A += y
  56814. }
  56815. for (l = 0; l < r; l++) {
  56816. var E = l * (i + 1);
  56817. for (c = 0; c < i; c++) {
  56818. s = c + E;
  56819. var b = s
  56820. , w = s + i + 1
  56821. , _ = s + i + 2
  56822. , T = s + 1;
  56823. d.setX(v, b),
  56824. v++,
  56825. d.setX(v, w),
  56826. v++,
  56827. d.setX(v, _),
  56828. v++,
  56829. d.setX(v, b),
  56830. v++,
  56831. d.setX(v, _),
  56832. v++,
  56833. d.setX(v, T),
  56834. v++
  56835. }
  56836. }
  56837. this.setIndex(d),
  56838. this.addAttribute("position", p),
  56839. this.addAttribute("normal", f),
  56840. this.addAttribute("uv", g)
  56841. }
  56842. ,
  56843. n.RingBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  56844. n.RingBufferGeometry.prototype.constructor = n.RingBufferGeometry,
  56845. n.RingGeometry = function(e, t, i, r, o, a) {
  56846. n.Geometry.call(this),
  56847. this.type = "RingGeometry",
  56848. this.parameters = {
  56849. innerRadius: e,
  56850. outerRadius: t,
  56851. thetaSegments: i,
  56852. phiSegments: r,
  56853. thetaStart: o,
  56854. thetaLength: a
  56855. },
  56856. this.fromBufferGeometry(new n.RingBufferGeometry(e,t,i,r,o,a))
  56857. }
  56858. ,
  56859. n.RingGeometry.prototype = Object.create(n.Geometry.prototype),
  56860. n.RingGeometry.prototype.constructor = n.RingGeometry,
  56861. n.SphereGeometry = function(e, t, i, r, o, a, s) {
  56862. n.Geometry.call(this),
  56863. this.type = "SphereGeometry",
  56864. this.parameters = {
  56865. radius: e,
  56866. widthSegments: t,
  56867. heightSegments: i,
  56868. phiStart: r,
  56869. phiLength: o,
  56870. thetaStart: a,
  56871. thetaLength: s
  56872. },
  56873. this.fromBufferGeometry(new n.SphereBufferGeometry(e,t,i,r,o,a,s))
  56874. }
  56875. ,
  56876. n.SphereGeometry.prototype = Object.create(n.Geometry.prototype),
  56877. n.SphereGeometry.prototype.constructor = n.SphereGeometry,
  56878. n.SphereBufferGeometry = function(e, t, i, r, o, a, s) {
  56879. n.BufferGeometry.call(this),
  56880. this.type = "SphereBufferGeometry",
  56881. this.parameters = {
  56882. radius: e,
  56883. widthSegments: t,
  56884. heightSegments: i,
  56885. phiStart: r,
  56886. phiLength: o,
  56887. thetaStart: a,
  56888. thetaLength: s
  56889. },
  56890. e = e || 50,
  56891. t = Math.max(3, Math.floor(t) || 8),
  56892. i = Math.max(2, Math.floor(i) || 6),
  56893. r = void 0 !== r ? r : 0,
  56894. o = void 0 !== o ? o : 2 * Math.PI,
  56895. a = void 0 !== a ? a : 0,
  56896. s = void 0 !== s ? s : Math.PI;
  56897. 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++) {
  56898. for (var v = [], A = m / i, y = 0; y <= t; y++) {
  56899. var C = y / t
  56900. , I = -e * Math.cos(r + C * o) * Math.sin(a + A * s)
  56901. , E = e * Math.cos(a + A * s)
  56902. , b = e * Math.sin(r + C * o) * Math.sin(a + A * s);
  56903. g.set(I, E, b).normalize(),
  56904. h.setXYZ(p, I, E, b),
  56905. u.setXYZ(p, g.x, g.y, g.z),
  56906. d.setXY(p, C, 1 - A),
  56907. v.push(p),
  56908. p++
  56909. }
  56910. f.push(v)
  56911. }
  56912. for (var w = [], m = 0; m < i; m++)
  56913. for (var y = 0; y < t; y++) {
  56914. var _ = f[m][y + 1]
  56915. , T = f[m][y]
  56916. , x = f[m + 1][y]
  56917. , S = f[m + 1][y + 1];
  56918. (0 !== m || a > 0) && w.push(_, T, S),
  56919. (m !== i - 1 || l < Math.PI) && w.push(T, x, S)
  56920. }
  56921. this.setIndex(new (h.count > 65535 ? n.Uint32Attribute : n.Uint16Attribute)(w,1)),
  56922. this.addAttribute("position", h),
  56923. this.addAttribute("normal", u),
  56924. this.addAttribute("uv", d),
  56925. this.boundingSphere = new n.Sphere(new n.Vector3,e)
  56926. }
  56927. ,
  56928. n.SphereBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  56929. n.SphereBufferGeometry.prototype.constructor = n.SphereBufferGeometry,
  56930. n.TextGeometry = function(e, t) {
  56931. t = t || {};
  56932. var i = t.font;
  56933. if (i instanceof n.Font == !1)
  56934. return console.error("THREE.TextGeometry: font parameter is not an instance of THREE.Font."),
  56935. new n.Geometry;
  56936. var r = i.generateShapes(e, t.size, t.curveSegments);
  56937. t.amount = void 0 !== t.height ? t.height : 50,
  56938. void 0 === t.bevelThickness && (t.bevelThickness = 10),
  56939. void 0 === t.bevelSize && (t.bevelSize = 8),
  56940. void 0 === t.bevelEnabled && (t.bevelEnabled = !1),
  56941. n.ExtrudeGeometry.call(this, r, t),
  56942. this.type = "TextGeometry"
  56943. }
  56944. ,
  56945. n.TextGeometry.prototype = Object.create(n.ExtrudeGeometry.prototype),
  56946. n.TextGeometry.prototype.constructor = n.TextGeometry,
  56947. n.TorusBufferGeometry = function(e, t, i, r, o) {
  56948. n.BufferGeometry.call(this),
  56949. this.type = "TorusBufferGeometry",
  56950. this.parameters = {
  56951. radius: e,
  56952. tube: t,
  56953. radialSegments: i,
  56954. tubularSegments: r,
  56955. arc: o
  56956. },
  56957. e = e || 100,
  56958. t = t || 40,
  56959. i = Math.floor(i) || 8,
  56960. r = Math.floor(r) || 6,
  56961. o = o || 2 * Math.PI;
  56962. 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;
  56963. for (a = 0; a <= i; a++)
  56964. for (s = 0; s <= r; s++) {
  56965. var C = s / r * o
  56966. , I = a / i * Math.PI * 2;
  56967. A.x = (e + t * Math.cos(I)) * Math.cos(C),
  56968. A.y = (e + t * Math.cos(I)) * Math.sin(C),
  56969. A.z = t * Math.sin(I),
  56970. u[f] = A.x,
  56971. u[f + 1] = A.y,
  56972. u[f + 2] = A.z,
  56973. v.x = e * Math.cos(C),
  56974. v.y = e * Math.sin(C),
  56975. y.subVectors(A, v).normalize(),
  56976. d[f] = y.x,
  56977. d[f + 1] = y.y,
  56978. d[f + 2] = y.z,
  56979. p[g] = s / r,
  56980. p[g + 1] = a / i,
  56981. f += 3,
  56982. g += 2
  56983. }
  56984. for (a = 1; a <= i; a++)
  56985. for (s = 1; s <= r; s++) {
  56986. var E = (r + 1) * a + s - 1
  56987. , b = (r + 1) * (a - 1) + s - 1
  56988. , w = (r + 1) * (a - 1) + s
  56989. , _ = (r + 1) * a + s;
  56990. h[m] = E,
  56991. h[m + 1] = b,
  56992. h[m + 2] = _,
  56993. h[m + 3] = b,
  56994. h[m + 4] = w,
  56995. h[m + 5] = _,
  56996. m += 6
  56997. }
  56998. this.setIndex(new n.BufferAttribute(h,1)),
  56999. this.addAttribute("position", new n.BufferAttribute(u,3)),
  57000. this.addAttribute("normal", new n.BufferAttribute(d,3)),
  57001. this.addAttribute("uv", new n.BufferAttribute(p,2))
  57002. }
  57003. ,
  57004. n.TorusBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  57005. n.TorusBufferGeometry.prototype.constructor = n.TorusBufferGeometry,
  57006. n.TorusGeometry = function(e, t, i, r, o) {
  57007. n.Geometry.call(this),
  57008. this.type = "TorusGeometry",
  57009. this.parameters = {
  57010. radius: e,
  57011. tube: t,
  57012. radialSegments: i,
  57013. tubularSegments: r,
  57014. arc: o
  57015. },
  57016. this.fromBufferGeometry(new n.TorusBufferGeometry(e,t,i,r,o))
  57017. }
  57018. ,
  57019. n.TorusGeometry.prototype = Object.create(n.Geometry.prototype),
  57020. n.TorusGeometry.prototype.constructor = n.TorusGeometry,
  57021. n.TorusKnotBufferGeometry = function(e, t, i, r, o, a) {
  57022. function s(e, t, i, n, r) {
  57023. var o = Math.cos(e)
  57024. , a = Math.sin(e)
  57025. , s = i / t * e
  57026. , l = Math.cos(s);
  57027. r.x = n * (2 + l) * .5 * o,
  57028. r.y = n * (2 + l) * a * .5,
  57029. r.z = n * Math.sin(s) * .5
  57030. }
  57031. n.BufferGeometry.call(this),
  57032. this.type = "TorusKnotBufferGeometry",
  57033. this.parameters = {
  57034. radius: e,
  57035. tube: t,
  57036. tubularSegments: i,
  57037. radialSegments: r,
  57038. p: o,
  57039. q: a
  57040. },
  57041. e = e || 100,
  57042. t = t || 40,
  57043. i = Math.floor(i) || 64,
  57044. r = Math.floor(r) || 8,
  57045. o = o || 2,
  57046. a = a || 3;
  57047. 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;
  57048. for (l = 0; l <= i; ++l) {
  57049. var T = l / i * o * Math.PI * 2;
  57050. for (s(T, o, a, e, I),
  57051. s(T + .01, o, a, e, E),
  57052. w.subVectors(E, I),
  57053. _.addVectors(E, I),
  57054. b.crossVectors(w, _),
  57055. _.crossVectors(b, w),
  57056. b.normalize(),
  57057. _.normalize(),
  57058. c = 0; c <= r; ++c) {
  57059. var x = c / r * Math.PI * 2
  57060. , S = -t * Math.cos(x)
  57061. , M = t * Math.sin(x);
  57062. A.x = I.x + (S * _.x + M * b.x),
  57063. A.y = I.y + (S * _.y + M * b.y),
  57064. A.z = I.z + (S * _.z + M * b.z),
  57065. p.setXYZ(m, A.x, A.y, A.z),
  57066. y.subVectors(A, I).normalize(),
  57067. f.setXYZ(m, y.x, y.y, y.z),
  57068. C.x = l / i,
  57069. C.y = c / r,
  57070. g.setXY(m, C.x, C.y),
  57071. m++
  57072. }
  57073. }
  57074. for (c = 1; c <= i; c++)
  57075. for (l = 1; l <= r; l++) {
  57076. var R = (r + 1) * (c - 1) + (l - 1)
  57077. , P = (r + 1) * c + (l - 1)
  57078. , O = (r + 1) * c + l
  57079. , L = (r + 1) * (c - 1) + l;
  57080. d.setX(v, R),
  57081. v++,
  57082. d.setX(v, P),
  57083. v++,
  57084. d.setX(v, L),
  57085. v++,
  57086. d.setX(v, P),
  57087. v++,
  57088. d.setX(v, O),
  57089. v++,
  57090. d.setX(v, L),
  57091. v++
  57092. }
  57093. this.setIndex(d),
  57094. this.addAttribute("position", p),
  57095. this.addAttribute("normal", f),
  57096. this.addAttribute("uv", g)
  57097. }
  57098. ,
  57099. n.TorusKnotBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  57100. n.TorusKnotBufferGeometry.prototype.constructor = n.TorusKnotBufferGeometry,
  57101. n.TorusKnotGeometry = function(e, t, i, r, o, a, s) {
  57102. n.Geometry.call(this),
  57103. this.type = "TorusKnotGeometry",
  57104. this.parameters = {
  57105. radius: e,
  57106. tube: t,
  57107. tubularSegments: i,
  57108. radialSegments: r,
  57109. p: o,
  57110. q: a
  57111. },
  57112. void 0 !== s && console.warn("THREE.TorusKnotGeometry: heightScale has been deprecated. Use .scale( x, y, z ) instead."),
  57113. this.fromBufferGeometry(new n.TorusKnotBufferGeometry(e,t,i,r,o,a)),
  57114. this.mergeVertices()
  57115. }
  57116. ,
  57117. n.TorusKnotGeometry.prototype = Object.create(n.Geometry.prototype),
  57118. n.TorusKnotGeometry.prototype.constructor = n.TorusKnotGeometry,
  57119. n.TubeGeometry = function(e, t, i, r, o, a) {
  57120. function s(e, t, i) {
  57121. return R.vertices.push(new n.Vector3(e,t,i)) - 1
  57122. }
  57123. n.Geometry.call(this),
  57124. this.type = "TubeGeometry",
  57125. this.parameters = {
  57126. path: e,
  57127. segments: t,
  57128. radius: i,
  57129. radialSegments: r,
  57130. closed: o,
  57131. taper: a
  57132. },
  57133. t = t || 64,
  57134. i = i || 1,
  57135. r = r || 8,
  57136. o = o || !1,
  57137. a = a || n.TubeGeometry.NoTaper;
  57138. 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;
  57139. for (this.tangents = D,
  57140. this.normals = N,
  57141. this.binormals = B,
  57142. v = 0; v < P; v++)
  57143. for (M[v] = [],
  57144. u = v / (P - 1),
  57145. m = e.getPointAt(u),
  57146. l = D[v],
  57147. c = N[v],
  57148. h = B[v],
  57149. p = i * a(u),
  57150. A = 0; A < r; A++)
  57151. d = A / r * 2 * Math.PI,
  57152. f = -p * Math.cos(d),
  57153. g = p * Math.sin(d),
  57154. O.copy(m),
  57155. O.x += f * c.x + g * h.x,
  57156. O.y += f * c.y + g * h.y,
  57157. O.z += f * c.z + g * h.z,
  57158. M[v][A] = s(O.x, O.y, O.z);
  57159. for (v = 0; v < t; v++)
  57160. for (A = 0; A < r; A++)
  57161. y = o ? (v + 1) % t : v + 1,
  57162. C = (A + 1) % r,
  57163. I = M[v][A],
  57164. E = M[y][A],
  57165. b = M[y][C],
  57166. w = M[v][C],
  57167. _ = new n.Vector2(v / t,A / r),
  57168. T = new n.Vector2((v + 1) / t,A / r),
  57169. x = new n.Vector2((v + 1) / t,(A + 1) / r),
  57170. S = new n.Vector2(v / t,(A + 1) / r),
  57171. this.faces.push(new n.Face3(I,E,w)),
  57172. this.faceVertexUvs[0].push([_, T, S]),
  57173. this.faces.push(new n.Face3(E,b,w)),
  57174. this.faceVertexUvs[0].push([T.clone(), x, S.clone()]);
  57175. this.computeFaceNormals(),
  57176. this.computeVertexNormals()
  57177. }
  57178. ,
  57179. n.TubeGeometry.prototype = Object.create(n.Geometry.prototype),
  57180. n.TubeGeometry.prototype.constructor = n.TubeGeometry,
  57181. n.TubeGeometry.NoTaper = function(e) {
  57182. return 1
  57183. }
  57184. ,
  57185. n.TubeGeometry.SinusoidalTaper = function(e) {
  57186. return Math.sin(Math.PI * e)
  57187. }
  57188. ,
  57189. n.TubeGeometry.FrenetFrames = function(e, t, i) {
  57190. function r() {
  57191. f[0] = new n.Vector3,
  57192. g[0] = new n.Vector3,
  57193. a = Number.MAX_VALUE,
  57194. s = Math.abs(p[0].x),
  57195. l = Math.abs(p[0].y),
  57196. c = Math.abs(p[0].z),
  57197. s <= a && (a = s,
  57198. d.set(1, 0, 0)),
  57199. l <= a && (a = l,
  57200. d.set(0, 1, 0)),
  57201. c <= a && d.set(0, 0, 1),
  57202. m.crossVectors(p[0], d).normalize(),
  57203. f[0].crossVectors(p[0], m),
  57204. g[0].crossVectors(p[0], f[0])
  57205. }
  57206. 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;
  57207. for (this.tangents = p,
  57208. this.normals = f,
  57209. this.binormals = g,
  57210. h = 0; h < A; h++)
  57211. u = h / (A - 1),
  57212. p[h] = e.getTangentAt(u),
  57213. p[h].normalize();
  57214. for (r(),
  57215. h = 1; h < A; h++)
  57216. f[h] = f[h - 1].clone(),
  57217. g[h] = g[h - 1].clone(),
  57218. m.crossVectors(p[h - 1], p[h]),
  57219. m.length() > Number.EPSILON && (m.normalize(),
  57220. o = Math.acos(n.Math.clamp(p[h - 1].dot(p[h]), -1, 1)),
  57221. f[h].applyMatrix4(v.makeRotationAxis(m, o))),
  57222. g[h].crossVectors(p[h], f[h]);
  57223. if (i)
  57224. for (o = Math.acos(n.Math.clamp(f[0].dot(f[A - 1]), -1, 1)),
  57225. o /= A - 1,
  57226. p[0].dot(m.crossVectors(f[0], f[A - 1])) > 0 && (o = -o),
  57227. h = 1; h < A; h++)
  57228. f[h].applyMatrix4(v.makeRotationAxis(p[h], o * h)),
  57229. g[h].crossVectors(p[h], f[h])
  57230. }
  57231. ,
  57232. n.PolyhedronGeometry = function(e, t, i, r) {
  57233. function o(e) {
  57234. var t = e.normalize().clone();
  57235. t.index = u.vertices.push(t) - 1;
  57236. var i = l(e) / 2 / Math.PI + .5
  57237. , r = c(e) / Math.PI + .5;
  57238. return t.uv = new n.Vector2(i,1 - r),
  57239. t
  57240. }
  57241. function a(e, t, i, r) {
  57242. var o = new n.Face3(e.index,t.index,i.index,[e.clone(), t.clone(), i.clone()],void 0,r);
  57243. u.faces.push(o),
  57244. C.copy(e).add(t).add(i).divideScalar(3);
  57245. var a = l(C);
  57246. u.faceVertexUvs[0].push([h(e.uv, e, a), h(t.uv, t, a), h(i.uv, i, a)])
  57247. }
  57248. function s(e, t) {
  57249. 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++) {
  57250. l[h] = [];
  57251. 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++)
  57252. 0 === g && h === i ? l[h][g] = d : l[h][g] = o(d.clone().lerp(p, g / f))
  57253. }
  57254. for (var h = 0; h < i; h++)
  57255. for (var g = 0; g < 2 * (i - h) - 1; g++) {
  57256. var m = Math.floor(g / 2);
  57257. 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)
  57258. }
  57259. }
  57260. function l(e) {
  57261. return Math.atan2(e.z, -e.x)
  57262. }
  57263. function c(e) {
  57264. return Math.atan2(-e.y, Math.sqrt(e.x * e.x + e.z * e.z))
  57265. }
  57266. function h(e, t, i) {
  57267. return i < 0 && 1 === e.x && (e = new n.Vector2(e.x - 1,e.y)),
  57268. 0 === t.x && 0 === t.z && (e = new n.Vector2(i / 2 / Math.PI + .5,e.y)),
  57269. e.clone()
  57270. }
  57271. n.Geometry.call(this),
  57272. this.type = "PolyhedronGeometry",
  57273. this.parameters = {
  57274. vertices: e,
  57275. indices: t,
  57276. radius: i,
  57277. detail: r
  57278. },
  57279. i = i || 1,
  57280. r = r || 0;
  57281. for (var u = this, d = 0, p = e.length; d < p; d += 3)
  57282. o(new n.Vector3(e[d],e[d + 1],e[d + 2]));
  57283. for (var f = this.vertices, g = [], d = 0, m = 0, p = t.length; d < p; d += 3,
  57284. m++) {
  57285. var v = f[t[d]]
  57286. , A = f[t[d + 1]]
  57287. , y = f[t[d + 2]];
  57288. g[m] = new n.Face3(v.index,A.index,y.index,[v.clone(), A.clone(), y.clone()],void 0,m)
  57289. }
  57290. for (var C = new n.Vector3, d = 0, p = g.length; d < p; d++)
  57291. s(g[d], r);
  57292. for (var d = 0, p = this.faceVertexUvs[0].length; d < p; d++) {
  57293. var I = this.faceVertexUvs[0][d]
  57294. , E = I[0].x
  57295. , b = I[1].x
  57296. , w = I[2].x
  57297. , _ = Math.max(E, b, w)
  57298. , T = Math.min(E, b, w);
  57299. _ > .9 && T < .1 && (E < .2 && (I[0].x += 1),
  57300. b < .2 && (I[1].x += 1),
  57301. w < .2 && (I[2].x += 1))
  57302. }
  57303. for (var d = 0, p = this.vertices.length; d < p; d++)
  57304. this.vertices[d].multiplyScalar(i);
  57305. this.mergeVertices(),
  57306. this.computeFaceNormals(),
  57307. this.boundingSphere = new n.Sphere(new n.Vector3,i)
  57308. }
  57309. ,
  57310. n.PolyhedronGeometry.prototype = Object.create(n.Geometry.prototype),
  57311. n.PolyhedronGeometry.prototype.constructor = n.PolyhedronGeometry,
  57312. n.DodecahedronGeometry = function(e, t) {
  57313. var i = (1 + Math.sqrt(5)) / 2
  57314. , r = 1 / i
  57315. , 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]
  57316. , 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];
  57317. n.PolyhedronGeometry.call(this, o, a, e, t),
  57318. this.type = "DodecahedronGeometry",
  57319. this.parameters = {
  57320. radius: e,
  57321. detail: t
  57322. }
  57323. }
  57324. ,
  57325. n.DodecahedronGeometry.prototype = Object.create(n.PolyhedronGeometry.prototype),
  57326. n.DodecahedronGeometry.prototype.constructor = n.DodecahedronGeometry,
  57327. n.IcosahedronGeometry = function(e, t) {
  57328. var i = (1 + Math.sqrt(5)) / 2
  57329. , 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]
  57330. , 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];
  57331. n.PolyhedronGeometry.call(this, r, o, e, t),
  57332. this.type = "IcosahedronGeometry",
  57333. this.parameters = {
  57334. radius: e,
  57335. detail: t
  57336. }
  57337. }
  57338. ,
  57339. n.IcosahedronGeometry.prototype = Object.create(n.PolyhedronGeometry.prototype),
  57340. n.IcosahedronGeometry.prototype.constructor = n.IcosahedronGeometry,
  57341. n.OctahedronGeometry = function(e, t) {
  57342. var i = [1, 0, 0, -1, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 1, 0, 0, -1]
  57343. , 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];
  57344. n.PolyhedronGeometry.call(this, i, r, e, t),
  57345. this.type = "OctahedronGeometry",
  57346. this.parameters = {
  57347. radius: e,
  57348. detail: t
  57349. }
  57350. }
  57351. ,
  57352. n.OctahedronGeometry.prototype = Object.create(n.PolyhedronGeometry.prototype),
  57353. n.OctahedronGeometry.prototype.constructor = n.OctahedronGeometry,
  57354. n.TetrahedronGeometry = function(e, t) {
  57355. var i = [1, 1, 1, -1, -1, 1, -1, 1, -1, 1, -1, -1]
  57356. , r = [2, 1, 0, 0, 3, 2, 1, 3, 0, 2, 3, 1];
  57357. n.PolyhedronGeometry.call(this, i, r, e, t),
  57358. this.type = "TetrahedronGeometry",
  57359. this.parameters = {
  57360. radius: e,
  57361. detail: t
  57362. }
  57363. }
  57364. ,
  57365. n.TetrahedronGeometry.prototype = Object.create(n.PolyhedronGeometry.prototype),
  57366. n.TetrahedronGeometry.prototype.constructor = n.TetrahedronGeometry,
  57367. n.ParametricGeometry = function(e, t, i) {
  57368. n.Geometry.call(this),
  57369. this.type = "ParametricGeometry",
  57370. this.parameters = {
  57371. func: e,
  57372. slices: t,
  57373. stacks: i
  57374. };
  57375. var r, o, a, s, l, c = this.vertices, h = this.faces, u = this.faceVertexUvs[0], d = t + 1;
  57376. for (r = 0; r <= i; r++)
  57377. for (l = r / i,
  57378. o = 0; o <= t; o++)
  57379. s = o / t,
  57380. a = e(s, l),
  57381. c.push(a);
  57382. var p, f, g, m, v, A, y, C;
  57383. for (r = 0; r < i; r++)
  57384. for (o = 0; o < t; o++)
  57385. p = r * d + o,
  57386. f = r * d + o + 1,
  57387. g = (r + 1) * d + o + 1,
  57388. m = (r + 1) * d + o,
  57389. v = new n.Vector2(o / t,r / i),
  57390. A = new n.Vector2((o + 1) / t,r / i),
  57391. y = new n.Vector2((o + 1) / t,(r + 1) / i),
  57392. C = new n.Vector2(o / t,(r + 1) / i),
  57393. h.push(new n.Face3(p,f,m)),
  57394. u.push([v, A, C]),
  57395. h.push(new n.Face3(f,g,m)),
  57396. u.push([A.clone(), y, C.clone()]);
  57397. this.computeFaceNormals(),
  57398. this.computeVertexNormals()
  57399. }
  57400. ,
  57401. n.ParametricGeometry.prototype = Object.create(n.Geometry.prototype),
  57402. n.ParametricGeometry.prototype.constructor = n.ParametricGeometry,
  57403. n.WireframeGeometry = function(e) {
  57404. function t(e, t) {
  57405. return e - t
  57406. }
  57407. n.BufferGeometry.call(this);
  57408. var i = [0, 0]
  57409. , r = {}
  57410. , o = ["a", "b", "c"];
  57411. if (e instanceof n.Geometry) {
  57412. for (var a = e.vertices, s = e.faces, l = 0, c = new Uint32Array(6 * s.length), h = 0, u = s.length; h < u; h++)
  57413. for (var d = s[h], p = 0; p < 3; p++) {
  57414. i[0] = d[o[p]],
  57415. i[1] = d[o[(p + 1) % 3]],
  57416. i.sort(t);
  57417. var f = i.toString();
  57418. void 0 === r[f] && (c[2 * l] = i[0],
  57419. c[2 * l + 1] = i[1],
  57420. r[f] = !0,
  57421. l++)
  57422. }
  57423. for (var g = new Float32Array(2 * l * 3), h = 0, u = l; h < u; h++)
  57424. for (var p = 0; p < 2; p++) {
  57425. var m = a[c[2 * h + p]]
  57426. , v = 6 * h + 3 * p;
  57427. g[v + 0] = m.x,
  57428. g[v + 1] = m.y,
  57429. g[v + 2] = m.z
  57430. }
  57431. this.addAttribute("position", new n.BufferAttribute(g,3))
  57432. } else if (e instanceof n.BufferGeometry)
  57433. if (null !== e.index) {
  57434. var A = e.index.array
  57435. , a = e.attributes.position
  57436. , y = e.groups
  57437. , l = 0;
  57438. 0 === y.length && e.addGroup(0, A.length);
  57439. for (var c = new Uint32Array(2 * A.length), C = 0, I = y.length; C < I; ++C)
  57440. for (var E = y[C], b = E.start, w = E.count, h = b, _ = b + w; h < _; h += 3)
  57441. for (var p = 0; p < 3; p++) {
  57442. i[0] = A[h + p],
  57443. i[1] = A[h + (p + 1) % 3],
  57444. i.sort(t);
  57445. var f = i.toString();
  57446. void 0 === r[f] && (c[2 * l] = i[0],
  57447. c[2 * l + 1] = i[1],
  57448. r[f] = !0,
  57449. l++)
  57450. }
  57451. for (var g = new Float32Array(2 * l * 3), h = 0, u = l; h < u; h++)
  57452. for (var p = 0; p < 2; p++) {
  57453. var v = 6 * h + 3 * p
  57454. , T = c[2 * h + p];
  57455. g[v + 0] = a.getX(T),
  57456. g[v + 1] = a.getY(T),
  57457. g[v + 2] = a.getZ(T)
  57458. }
  57459. this.addAttribute("position", new n.BufferAttribute(g,3))
  57460. } else {
  57461. 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++)
  57462. for (var p = 0; p < 3; p++) {
  57463. var v = 18 * h + 6 * p
  57464. , S = 9 * h + 3 * p;
  57465. g[v + 0] = a[S],
  57466. g[v + 1] = a[S + 1],
  57467. g[v + 2] = a[S + 2];
  57468. var T = 9 * h + 3 * ((p + 1) % 3);
  57469. g[v + 3] = a[T],
  57470. g[v + 4] = a[T + 1],
  57471. g[v + 5] = a[T + 2]
  57472. }
  57473. this.addAttribute("position", new n.BufferAttribute(g,3))
  57474. }
  57475. }
  57476. ,
  57477. n.WireframeGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  57478. n.WireframeGeometry.prototype.constructor = n.WireframeGeometry,
  57479. n.AxisHelper = function(e) {
  57480. e = e || 1;
  57481. var t = new Float32Array([0, 0, 0, e, 0, 0, 0, 0, 0, 0, e, 0, 0, 0, 0, 0, 0, e])
  57482. , i = new Float32Array([1, 0, 0, 1, .6, 0, 0, 1, 0, .6, 1, 0, 0, 0, 1, 0, .6, 1])
  57483. , r = new n.BufferGeometry;
  57484. r.addAttribute("position", new n.BufferAttribute(t,3)),
  57485. r.addAttribute("color", new n.BufferAttribute(i,3));
  57486. var o = new n.LineBasicMaterial({
  57487. vertexColors: n.VertexColors
  57488. });
  57489. n.LineSegments.call(this, r, o)
  57490. }
  57491. ,
  57492. n.AxisHelper.prototype = Object.create(n.LineSegments.prototype),
  57493. n.AxisHelper.prototype.constructor = n.AxisHelper,
  57494. n.ArrowHelper = function() {
  57495. var e = new n.Geometry;
  57496. e.vertices.push(new n.Vector3(0,0,0), new n.Vector3(0,1,0));
  57497. var t = new n.CylinderGeometry(0,.5,1,5,1);
  57498. return t.translate(0, -.5, 0),
  57499. function(i, r, o, a, s, l) {
  57500. n.Object3D.call(this),
  57501. void 0 === a && (a = 16776960),
  57502. void 0 === o && (o = 1),
  57503. void 0 === s && (s = .2 * o),
  57504. void 0 === l && (l = .2 * s),
  57505. this.position.copy(r),
  57506. this.line = new n.Line(e,new n.LineBasicMaterial({
  57507. color: a
  57508. })),
  57509. this.line.matrixAutoUpdate = !1,
  57510. this.add(this.line),
  57511. this.cone = new n.Mesh(t,new n.MeshBasicMaterial({
  57512. color: a
  57513. })),
  57514. this.cone.matrixAutoUpdate = !1,
  57515. this.add(this.cone),
  57516. this.setDirection(i),
  57517. this.setLength(o, s, l)
  57518. }
  57519. }(),
  57520. n.ArrowHelper.prototype = Object.create(n.Object3D.prototype),
  57521. n.ArrowHelper.prototype.constructor = n.ArrowHelper,
  57522. n.ArrowHelper.prototype.setDirection = function() {
  57523. var e, t = new n.Vector3;
  57524. return function(i) {
  57525. 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(),
  57526. e = Math.acos(i.y),
  57527. this.quaternion.setFromAxisAngle(t, e))
  57528. }
  57529. }(),
  57530. n.ArrowHelper.prototype.setLength = function(e, t, i) {
  57531. void 0 === t && (t = .2 * e),
  57532. void 0 === i && (i = .2 * t),
  57533. this.line.scale.set(1, Math.max(0, e - t), 1),
  57534. this.line.updateMatrix(),
  57535. this.cone.scale.set(i, t, i),
  57536. this.cone.position.y = e,
  57537. this.cone.updateMatrix()
  57538. }
  57539. ,
  57540. n.ArrowHelper.prototype.setColor = function(e) {
  57541. this.line.material.color.set(e),
  57542. this.cone.material.color.set(e)
  57543. }
  57544. ,
  57545. n.BoxHelper = function(e) {
  57546. 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])
  57547. , i = new Float32Array(24)
  57548. , r = new n.BufferGeometry;
  57549. r.setIndex(new n.BufferAttribute(t,1)),
  57550. r.addAttribute("position", new n.BufferAttribute(i,3)),
  57551. n.LineSegments.call(this, r, new n.LineBasicMaterial({
  57552. color: 16776960
  57553. })),
  57554. void 0 !== e && this.update(e)
  57555. }
  57556. ,
  57557. n.BoxHelper.prototype = Object.create(n.LineSegments.prototype),
  57558. n.BoxHelper.prototype.constructor = n.BoxHelper,
  57559. n.BoxHelper.prototype.update = function() {
  57560. var e = new n.Box3;
  57561. return function(t) {
  57562. if (e.setFromObject(t),
  57563. !e.isEmpty()) {
  57564. var i = e.min
  57565. , n = e.max
  57566. , r = this.geometry.attributes.position
  57567. , o = r.array;
  57568. o[0] = n.x,
  57569. o[1] = n.y,
  57570. o[2] = n.z,
  57571. o[3] = i.x,
  57572. o[4] = n.y,
  57573. o[5] = n.z,
  57574. o[6] = i.x,
  57575. o[7] = i.y,
  57576. o[8] = n.z,
  57577. o[9] = n.x,
  57578. o[10] = i.y,
  57579. o[11] = n.z,
  57580. o[12] = n.x,
  57581. o[13] = n.y,
  57582. o[14] = i.z,
  57583. o[15] = i.x,
  57584. o[16] = n.y,
  57585. o[17] = i.z,
  57586. o[18] = i.x,
  57587. o[19] = i.y,
  57588. o[20] = i.z,
  57589. o[21] = n.x,
  57590. o[22] = i.y,
  57591. o[23] = i.z,
  57592. r.needsUpdate = !0,
  57593. this.geometry.computeBoundingSphere()
  57594. }
  57595. }
  57596. }(),
  57597. n.BoundingBoxHelper = function(e, t) {
  57598. var i = void 0 !== t ? t : 8947848;
  57599. this.object = e,
  57600. this.box = new n.Box3,
  57601. n.Mesh.call(this, new n.BoxGeometry(1,1,1), new n.MeshBasicMaterial({
  57602. color: i,
  57603. wireframe: !0
  57604. }))
  57605. }
  57606. ,
  57607. n.BoundingBoxHelper.prototype = Object.create(n.Mesh.prototype),
  57608. n.BoundingBoxHelper.prototype.constructor = n.BoundingBoxHelper,
  57609. n.BoundingBoxHelper.prototype.update = function() {
  57610. this.box.setFromObject(this.object),
  57611. this.box.size(this.scale),
  57612. this.box.center(this.position)
  57613. }
  57614. ,
  57615. n.CameraHelper = function(e) {
  57616. function t(e, t, n) {
  57617. i(e, n),
  57618. i(t, n)
  57619. }
  57620. function i(e, t) {
  57621. r.vertices.push(new n.Vector3),
  57622. r.colors.push(new n.Color(t)),
  57623. void 0 === a[e] && (a[e] = []),
  57624. a[e].push(r.vertices.length - 1)
  57625. }
  57626. var r = new n.Geometry
  57627. , o = new n.LineBasicMaterial({
  57628. color: 16777215,
  57629. vertexColors: n.FaceColors
  57630. })
  57631. , a = {}
  57632. , s = 16755200
  57633. , l = 16711680
  57634. , c = 43775
  57635. , h = 16777215
  57636. , u = 3355443;
  57637. t("n1", "n2", s),
  57638. t("n2", "n4", s),
  57639. t("n4", "n3", s),
  57640. t("n3", "n1", s),
  57641. t("f1", "f2", s),
  57642. t("f2", "f4", s),
  57643. t("f4", "f3", s),
  57644. t("f3", "f1", s),
  57645. t("n1", "f1", s),
  57646. t("n2", "f2", s),
  57647. t("n3", "f3", s),
  57648. t("n4", "f4", s),
  57649. t("p", "n1", l),
  57650. t("p", "n2", l),
  57651. t("p", "n3", l),
  57652. t("p", "n4", l),
  57653. t("u1", "u2", c),
  57654. t("u2", "u3", c),
  57655. t("u3", "u1", c),
  57656. t("c", "t", h),
  57657. t("p", "c", u),
  57658. t("cn1", "cn2", u),
  57659. t("cn3", "cn4", u),
  57660. t("cf1", "cf2", u),
  57661. t("cf3", "cf4", u),
  57662. n.LineSegments.call(this, r, o),
  57663. this.camera = e,
  57664. this.camera.updateProjectionMatrix(),
  57665. this.matrix = e.matrixWorld,
  57666. this.matrixAutoUpdate = !1,
  57667. this.pointMap = a,
  57668. this.update()
  57669. }
  57670. ,
  57671. n.CameraHelper.prototype = Object.create(n.LineSegments.prototype),
  57672. n.CameraHelper.prototype.constructor = n.CameraHelper,
  57673. n.CameraHelper.prototype.update = function() {
  57674. function e(e, n, a, s) {
  57675. r.set(n, a, s).unproject(o);
  57676. var l = i[e];
  57677. if (void 0 !== l)
  57678. for (var c = 0, h = l.length; c < h; c++)
  57679. t.vertices[l[c]].copy(r)
  57680. }
  57681. var t, i, r = new n.Vector3, o = new n.Camera;
  57682. return function() {
  57683. t = this.geometry,
  57684. i = this.pointMap;
  57685. var n = 1
  57686. , r = 1;
  57687. o.projectionMatrix.copy(this.camera.projectionMatrix),
  57688. e("c", 0, 0, -1),
  57689. e("t", 0, 0, 1),
  57690. e("n1", -n, -r, -1),
  57691. e("n2", n, -r, -1),
  57692. e("n3", -n, r, -1),
  57693. e("n4", n, r, -1),
  57694. e("f1", -n, -r, 1),
  57695. e("f2", n, -r, 1),
  57696. e("f3", -n, r, 1),
  57697. e("f4", n, r, 1),
  57698. e("u1", .7 * n, 1.1 * r, -1),
  57699. e("u2", .7 * -n, 1.1 * r, -1),
  57700. e("u3", 0, 2 * r, -1),
  57701. e("cf1", -n, 0, 1),
  57702. e("cf2", n, 0, 1),
  57703. e("cf3", 0, -r, 1),
  57704. e("cf4", 0, r, 1),
  57705. e("cn1", -n, 0, -1),
  57706. e("cn2", n, 0, -1),
  57707. e("cn3", 0, -r, -1),
  57708. e("cn4", 0, r, -1),
  57709. t.verticesNeedUpdate = !0
  57710. }
  57711. }(),
  57712. n.DirectionalLightHelper = function(e, t) {
  57713. n.Object3D.call(this),
  57714. this.light = e,
  57715. this.light.updateMatrixWorld(),
  57716. this.matrix = e.matrixWorld,
  57717. this.matrixAutoUpdate = !1,
  57718. t = t || 1;
  57719. var i = new n.Geometry;
  57720. 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));
  57721. var r = new n.LineBasicMaterial({
  57722. fog: !1
  57723. });
  57724. r.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  57725. this.lightPlane = new n.Line(i,r),
  57726. this.add(this.lightPlane),
  57727. i = new n.Geometry,
  57728. i.vertices.push(new n.Vector3, new n.Vector3),
  57729. r = new n.LineBasicMaterial({
  57730. fog: !1
  57731. }),
  57732. r.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  57733. this.targetLine = new n.Line(i,r),
  57734. this.add(this.targetLine),
  57735. this.update()
  57736. }
  57737. ,
  57738. n.DirectionalLightHelper.prototype = Object.create(n.Object3D.prototype),
  57739. n.DirectionalLightHelper.prototype.constructor = n.DirectionalLightHelper,
  57740. n.DirectionalLightHelper.prototype.dispose = function() {
  57741. this.lightPlane.geometry.dispose(),
  57742. this.lightPlane.material.dispose(),
  57743. this.targetLine.geometry.dispose(),
  57744. this.targetLine.material.dispose()
  57745. }
  57746. ,
  57747. n.DirectionalLightHelper.prototype.update = function() {
  57748. var e = new n.Vector3
  57749. , t = new n.Vector3
  57750. , i = new n.Vector3;
  57751. return function() {
  57752. e.setFromMatrixPosition(this.light.matrixWorld),
  57753. t.setFromMatrixPosition(this.light.target.matrixWorld),
  57754. i.subVectors(t, e),
  57755. this.lightPlane.lookAt(i),
  57756. this.lightPlane.material.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  57757. this.targetLine.geometry.vertices[1].copy(i),
  57758. this.targetLine.geometry.verticesNeedUpdate = !0,
  57759. this.targetLine.material.color.copy(this.lightPlane.material.color)
  57760. }
  57761. }(),
  57762. n.EdgesHelper = function(e, t, i) {
  57763. var r = void 0 !== t ? t : 16777215;
  57764. n.LineSegments.call(this, new n.EdgesGeometry(e.geometry,i), new n.LineBasicMaterial({
  57765. color: r
  57766. })),
  57767. this.matrix = e.matrixWorld,
  57768. this.matrixAutoUpdate = !1
  57769. }
  57770. ,
  57771. n.EdgesHelper.prototype = Object.create(n.LineSegments.prototype),
  57772. n.EdgesHelper.prototype.constructor = n.EdgesHelper,
  57773. n.FaceNormalsHelper = function(e, t, i, r) {
  57774. this.object = e,
  57775. this.size = void 0 !== t ? t : 1;
  57776. var o = void 0 !== i ? i : 16776960
  57777. , a = void 0 !== r ? r : 1
  57778. , s = 0
  57779. , l = this.object.geometry;
  57780. l instanceof n.Geometry ? s = l.faces.length : console.warn("THREE.FaceNormalsHelper: only THREE.Geometry is supported. Use THREE.VertexNormalsHelper, instead.");
  57781. var c = new n.BufferGeometry
  57782. , h = new n.Float32Attribute(2 * s * 3,3);
  57783. c.addAttribute("position", h),
  57784. n.LineSegments.call(this, c, new n.LineBasicMaterial({
  57785. color: o,
  57786. linewidth: a
  57787. })),
  57788. this.matrixAutoUpdate = !1,
  57789. this.update()
  57790. }
  57791. ,
  57792. n.FaceNormalsHelper.prototype = Object.create(n.LineSegments.prototype),
  57793. n.FaceNormalsHelper.prototype.constructor = n.FaceNormalsHelper,
  57794. n.FaceNormalsHelper.prototype.update = function() {
  57795. var e = new n.Vector3
  57796. , t = new n.Vector3
  57797. , i = new n.Matrix3;
  57798. return function() {
  57799. this.object.updateMatrixWorld(!0),
  57800. i.getNormalMatrix(this.object.matrixWorld);
  57801. 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++) {
  57802. var u = s[c]
  57803. , d = u.normal;
  57804. e.copy(a[u.a]).add(a[u.b]).add(a[u.c]).divideScalar(3).applyMatrix4(n),
  57805. t.copy(d).applyMatrix3(i).normalize().multiplyScalar(this.size).add(e),
  57806. r.setXYZ(l, e.x, e.y, e.z),
  57807. l += 1,
  57808. r.setXYZ(l, t.x, t.y, t.z),
  57809. l += 1
  57810. }
  57811. return r.needsUpdate = !0,
  57812. this
  57813. }
  57814. }(),
  57815. n.GridHelper = function(e, t) {
  57816. var i = new n.Geometry
  57817. , r = new n.LineBasicMaterial({
  57818. vertexColors: n.VertexColors
  57819. });
  57820. this.color1 = new n.Color(4473924),
  57821. this.color2 = new n.Color(8947848);
  57822. for (var o = -e; o <= e; o += t) {
  57823. 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));
  57824. var a = 0 === o ? this.color1 : this.color2;
  57825. i.colors.push(a, a, a, a)
  57826. }
  57827. n.LineSegments.call(this, i, r)
  57828. }
  57829. ,
  57830. n.GridHelper.prototype = Object.create(n.LineSegments.prototype),
  57831. n.GridHelper.prototype.constructor = n.GridHelper,
  57832. n.GridHelper.prototype.setColors = function(e, t) {
  57833. this.color1.set(e),
  57834. this.color2.set(t),
  57835. this.geometry.colorsNeedUpdate = !0
  57836. }
  57837. ,
  57838. n.HemisphereLightHelper = function(e, t) {
  57839. n.Object3D.call(this),
  57840. this.light = e,
  57841. this.light.updateMatrixWorld(),
  57842. this.matrix = e.matrixWorld,
  57843. this.matrixAutoUpdate = !1,
  57844. this.colors = [new n.Color, new n.Color];
  57845. var i = new n.SphereGeometry(t,4,2);
  57846. i.rotateX(-Math.PI / 2);
  57847. for (var r = 0, o = 8; r < o; r++)
  57848. i.faces[r].color = this.colors[r < 4 ? 0 : 1];
  57849. var a = new n.MeshBasicMaterial({
  57850. vertexColors: n.FaceColors,
  57851. wireframe: !0
  57852. });
  57853. this.lightSphere = new n.Mesh(i,a),
  57854. this.add(this.lightSphere),
  57855. this.update()
  57856. }
  57857. ,
  57858. n.HemisphereLightHelper.prototype = Object.create(n.Object3D.prototype),
  57859. n.HemisphereLightHelper.prototype.constructor = n.HemisphereLightHelper,
  57860. n.HemisphereLightHelper.prototype.dispose = function() {
  57861. this.lightSphere.geometry.dispose(),
  57862. this.lightSphere.material.dispose()
  57863. }
  57864. ,
  57865. n.HemisphereLightHelper.prototype.update = function() {
  57866. var e = new n.Vector3;
  57867. return function() {
  57868. this.colors[0].copy(this.light.color).multiplyScalar(this.light.intensity),
  57869. this.colors[1].copy(this.light.groundColor).multiplyScalar(this.light.intensity),
  57870. this.lightSphere.lookAt(e.setFromMatrixPosition(this.light.matrixWorld).negate()),
  57871. this.lightSphere.geometry.colorsNeedUpdate = !0
  57872. }
  57873. }(),
  57874. n.PointLightHelper = function(e, t) {
  57875. this.light = e,
  57876. this.light.updateMatrixWorld();
  57877. var i = new n.SphereGeometry(t,4,2)
  57878. , r = new n.MeshBasicMaterial({
  57879. wireframe: !0,
  57880. fog: !1
  57881. });
  57882. r.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  57883. n.Mesh.call(this, i, r),
  57884. this.matrix = this.light.matrixWorld,
  57885. this.matrixAutoUpdate = !1
  57886. }
  57887. ,
  57888. n.PointLightHelper.prototype = Object.create(n.Mesh.prototype),
  57889. n.PointLightHelper.prototype.constructor = n.PointLightHelper,
  57890. n.PointLightHelper.prototype.dispose = function() {
  57891. this.geometry.dispose(),
  57892. this.material.dispose()
  57893. }
  57894. ,
  57895. n.PointLightHelper.prototype.update = function() {
  57896. this.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)
  57897. }
  57898. ,
  57899. n.SkeletonHelper = function(e) {
  57900. this.bones = this.getBoneList(e);
  57901. for (var t = new n.Geometry, i = 0; i < this.bones.length; i++) {
  57902. var r = this.bones[i];
  57903. r.parent instanceof n.Bone && (t.vertices.push(new n.Vector3),
  57904. t.vertices.push(new n.Vector3),
  57905. t.colors.push(new n.Color(0,0,1)),
  57906. t.colors.push(new n.Color(0,1,0)))
  57907. }
  57908. t.dynamic = !0;
  57909. var o = new n.LineBasicMaterial({
  57910. vertexColors: n.VertexColors,
  57911. depthTest: !1,
  57912. depthWrite: !1,
  57913. transparent: !0
  57914. });
  57915. n.LineSegments.call(this, t, o),
  57916. this.root = e,
  57917. this.matrix = e.matrixWorld,
  57918. this.matrixAutoUpdate = !1,
  57919. this.update()
  57920. }
  57921. ,
  57922. n.SkeletonHelper.prototype = Object.create(n.LineSegments.prototype),
  57923. n.SkeletonHelper.prototype.constructor = n.SkeletonHelper,
  57924. n.SkeletonHelper.prototype.getBoneList = function(e) {
  57925. var t = [];
  57926. e instanceof n.Bone && t.push(e);
  57927. for (var i = 0; i < e.children.length; i++)
  57928. t.push.apply(t, this.getBoneList(e.children[i]));
  57929. return t
  57930. }
  57931. ,
  57932. n.SkeletonHelper.prototype.update = function() {
  57933. 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++) {
  57934. var a = this.bones[o];
  57935. a.parent instanceof n.Bone && (i.multiplyMatrices(t, a.matrixWorld),
  57936. e.vertices[r].setFromMatrixPosition(i),
  57937. i.multiplyMatrices(t, a.parent.matrixWorld),
  57938. e.vertices[r + 1].setFromMatrixPosition(i),
  57939. r += 2)
  57940. }
  57941. e.verticesNeedUpdate = !0,
  57942. e.computeBoundingSphere()
  57943. }
  57944. ,
  57945. n.SpotLightHelper = function(e) {
  57946. n.Object3D.call(this),
  57947. this.light = e,
  57948. this.light.updateMatrixWorld(),
  57949. this.matrix = e.matrixWorld,
  57950. this.matrixAutoUpdate = !1;
  57951. var t = new n.CylinderGeometry(0,1,1,8,1,!0);
  57952. t.translate(0, -.5, 0),
  57953. t.rotateX(-Math.PI / 2);
  57954. var i = new n.MeshBasicMaterial({
  57955. wireframe: !0,
  57956. fog: !1
  57957. });
  57958. this.cone = new n.Mesh(t,i),
  57959. this.add(this.cone),
  57960. this.update()
  57961. }
  57962. ,
  57963. n.SpotLightHelper.prototype = Object.create(n.Object3D.prototype),
  57964. n.SpotLightHelper.prototype.constructor = n.SpotLightHelper,
  57965. n.SpotLightHelper.prototype.dispose = function() {
  57966. this.cone.geometry.dispose(),
  57967. this.cone.material.dispose()
  57968. }
  57969. ,
  57970. n.SpotLightHelper.prototype.update = function() {
  57971. var e = new n.Vector3
  57972. , t = new n.Vector3;
  57973. return function() {
  57974. var i = this.light.distance ? this.light.distance : 1e4
  57975. , n = i * Math.tan(this.light.angle);
  57976. this.cone.scale.set(n, n, i),
  57977. e.setFromMatrixPosition(this.light.matrixWorld),
  57978. t.setFromMatrixPosition(this.light.target.matrixWorld),
  57979. this.cone.lookAt(t.sub(e)),
  57980. this.cone.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)
  57981. }
  57982. }(),
  57983. n.VertexNormalsHelper = function(e, t, i, r) {
  57984. this.object = e,
  57985. this.size = void 0 !== t ? t : 1;
  57986. var o = void 0 !== i ? i : 16711680
  57987. , a = void 0 !== r ? r : 1
  57988. , s = 0
  57989. , l = this.object.geometry;
  57990. l instanceof n.Geometry ? s = 3 * l.faces.length : l instanceof n.BufferGeometry && (s = l.attributes.normal.count);
  57991. var c = new n.BufferGeometry
  57992. , h = new n.Float32Attribute(2 * s * 3,3);
  57993. c.addAttribute("position", h),
  57994. n.LineSegments.call(this, c, new n.LineBasicMaterial({
  57995. color: o,
  57996. linewidth: a
  57997. })),
  57998. this.matrixAutoUpdate = !1,
  57999. this.update()
  58000. }
  58001. ,
  58002. n.VertexNormalsHelper.prototype = Object.create(n.LineSegments.prototype),
  58003. n.VertexNormalsHelper.prototype.constructor = n.VertexNormalsHelper,
  58004. n.VertexNormalsHelper.prototype.update = function() {
  58005. var e = new n.Vector3
  58006. , t = new n.Vector3
  58007. , i = new n.Matrix3;
  58008. return function() {
  58009. var r = ["a", "b", "c"];
  58010. this.object.updateMatrixWorld(!0),
  58011. i.getNormalMatrix(this.object.matrixWorld);
  58012. var o = this.object.matrixWorld
  58013. , a = this.geometry.attributes.position
  58014. , s = this.object.geometry;
  58015. if (s instanceof n.Geometry)
  58016. for (var l = s.vertices, c = s.faces, h = 0, u = 0, d = c.length; u < d; u++)
  58017. for (var p = c[u], f = 0, g = p.vertexNormals.length; f < g; f++) {
  58018. var m = l[p[r[f]]]
  58019. , v = p.vertexNormals[f];
  58020. e.copy(m).applyMatrix4(o),
  58021. t.copy(v).applyMatrix3(i).normalize().multiplyScalar(this.size).add(e),
  58022. a.setXYZ(h, e.x, e.y, e.z),
  58023. h += 1,
  58024. a.setXYZ(h, t.x, t.y, t.z),
  58025. h += 1
  58026. }
  58027. else if (s instanceof n.BufferGeometry)
  58028. for (var A = s.attributes.position, y = s.attributes.normal, h = 0, f = 0, g = A.count; f < g; f++)
  58029. e.set(A.getX(f), A.getY(f), A.getZ(f)).applyMatrix4(o),
  58030. t.set(y.getX(f), y.getY(f), y.getZ(f)),
  58031. t.applyMatrix3(i).normalize().multiplyScalar(this.size).add(e),
  58032. a.setXYZ(h, e.x, e.y, e.z),
  58033. h += 1,
  58034. a.setXYZ(h, t.x, t.y, t.z),
  58035. h += 1;
  58036. return a.needsUpdate = !0,
  58037. this
  58038. }
  58039. }(),
  58040. n.WireframeHelper = function(e, t) {
  58041. var i = void 0 !== t ? t : 16777215;
  58042. n.LineSegments.call(this, new n.WireframeGeometry(e.geometry), new n.LineBasicMaterial({
  58043. color: i
  58044. })),
  58045. this.matrix = e.matrixWorld,
  58046. this.matrixAutoUpdate = !1
  58047. }
  58048. ,
  58049. n.WireframeHelper.prototype = Object.create(n.LineSegments.prototype),
  58050. n.WireframeHelper.prototype.constructor = n.WireframeHelper,
  58051. n.ImmediateRenderObject = function(e) {
  58052. n.Object3D.call(this),
  58053. this.material = e,
  58054. this.render = function(e) {}
  58055. }
  58056. ,
  58057. n.ImmediateRenderObject.prototype = Object.create(n.Object3D.prototype),
  58058. n.ImmediateRenderObject.prototype.constructor = n.ImmediateRenderObject,
  58059. n.MorphBlendMesh = function(e, t) {
  58060. n.Mesh.call(this, e, t),
  58061. this.animationsMap = {},
  58062. this.animationsList = [];
  58063. var i = this.geometry.morphTargets.length
  58064. , r = "__default"
  58065. , o = 0
  58066. , a = i - 1
  58067. , s = i / 1;
  58068. this.createAnimation(r, o, a, s),
  58069. this.setAnimationWeight(r, 1)
  58070. }
  58071. ,
  58072. n.MorphBlendMesh.prototype = Object.create(n.Mesh.prototype),
  58073. n.MorphBlendMesh.prototype.constructor = n.MorphBlendMesh,
  58074. n.MorphBlendMesh.prototype.createAnimation = function(e, t, i, n) {
  58075. var r = {
  58076. start: t,
  58077. end: i,
  58078. length: i - t + 1,
  58079. fps: n,
  58080. duration: (i - t) / n,
  58081. lastFrame: 0,
  58082. currentFrame: 0,
  58083. active: !1,
  58084. time: 0,
  58085. direction: 1,
  58086. weight: 1,
  58087. directionBackwards: !1,
  58088. mirroredLoop: !1
  58089. };
  58090. this.animationsMap[e] = r,
  58091. this.animationsList.push(r)
  58092. }
  58093. ,
  58094. n.MorphBlendMesh.prototype.autoCreateAnimations = function(e) {
  58095. for (var t, i = /([a-z]+)_?(\d+)/i, n = {}, r = this.geometry, o = 0, a = r.morphTargets.length; o < a; o++) {
  58096. var s = r.morphTargets[o]
  58097. , l = s.name.match(i);
  58098. if (l && l.length > 1) {
  58099. var c = l[1];
  58100. n[c] || (n[c] = {
  58101. start: 1 / 0,
  58102. end: -(1 / 0)
  58103. });
  58104. var h = n[c];
  58105. o < h.start && (h.start = o),
  58106. o > h.end && (h.end = o),
  58107. t || (t = c)
  58108. }
  58109. }
  58110. for (var c in n) {
  58111. var h = n[c];
  58112. this.createAnimation(c, h.start, h.end, e)
  58113. }
  58114. this.firstAnimation = t
  58115. }
  58116. ,
  58117. n.MorphBlendMesh.prototype.setAnimationDirectionForward = function(e) {
  58118. var t = this.animationsMap[e];
  58119. t && (t.direction = 1,
  58120. t.directionBackwards = !1)
  58121. }
  58122. ,
  58123. n.MorphBlendMesh.prototype.setAnimationDirectionBackward = function(e) {
  58124. var t = this.animationsMap[e];
  58125. t && (t.direction = -1,
  58126. t.directionBackwards = !0)
  58127. }
  58128. ,
  58129. n.MorphBlendMesh.prototype.setAnimationFPS = function(e, t) {
  58130. var i = this.animationsMap[e];
  58131. i && (i.fps = t,
  58132. i.duration = (i.end - i.start) / i.fps)
  58133. }
  58134. ,
  58135. n.MorphBlendMesh.prototype.setAnimationDuration = function(e, t) {
  58136. var i = this.animationsMap[e];
  58137. i && (i.duration = t,
  58138. i.fps = (i.end - i.start) / i.duration)
  58139. }
  58140. ,
  58141. n.MorphBlendMesh.prototype.setAnimationWeight = function(e, t) {
  58142. var i = this.animationsMap[e];
  58143. i && (i.weight = t)
  58144. }
  58145. ,
  58146. n.MorphBlendMesh.prototype.setAnimationTime = function(e, t) {
  58147. var i = this.animationsMap[e];
  58148. i && (i.time = t)
  58149. }
  58150. ,
  58151. n.MorphBlendMesh.prototype.getAnimationTime = function(e) {
  58152. var t = 0
  58153. , i = this.animationsMap[e];
  58154. return i && (t = i.time),
  58155. t
  58156. }
  58157. ,
  58158. n.MorphBlendMesh.prototype.getAnimationDuration = function(e) {
  58159. var t = -1
  58160. , i = this.animationsMap[e];
  58161. return i && (t = i.duration),
  58162. t
  58163. }
  58164. ,
  58165. n.MorphBlendMesh.prototype.playAnimation = function(e) {
  58166. var t = this.animationsMap[e];
  58167. t ? (t.time = 0,
  58168. t.active = !0) : console.warn("THREE.MorphBlendMesh: animation[" + e + "] undefined in .playAnimation()")
  58169. }
  58170. ,
  58171. n.MorphBlendMesh.prototype.stopAnimation = function(e) {
  58172. var t = this.animationsMap[e];
  58173. t && (t.active = !1)
  58174. }
  58175. ,
  58176. n.MorphBlendMesh.prototype.update = function(e) {
  58177. for (var t = 0, i = this.animationsList.length; t < i; t++) {
  58178. var r = this.animationsList[t];
  58179. if (r.active) {
  58180. var o = r.duration / r.length;
  58181. r.time += r.direction * e,
  58182. r.mirroredLoop ? (r.time > r.duration || r.time < 0) && (r.direction *= -1,
  58183. r.time > r.duration && (r.time = r.duration,
  58184. r.directionBackwards = !0),
  58185. r.time < 0 && (r.time = 0,
  58186. r.directionBackwards = !1)) : (r.time = r.time % r.duration,
  58187. r.time < 0 && (r.time += r.duration));
  58188. var a = r.start + n.Math.clamp(Math.floor(r.time / o), 0, r.length - 1)
  58189. , s = r.weight;
  58190. a !== r.currentFrame && (this.morphTargetInfluences[r.lastFrame] = 0,
  58191. this.morphTargetInfluences[r.currentFrame] = 1 * s,
  58192. this.morphTargetInfluences[a] = 0,
  58193. r.lastFrame = r.currentFrame,
  58194. r.currentFrame = a);
  58195. var l = r.time % o / o;
  58196. r.directionBackwards && (l = 1 - l),
  58197. r.currentFrame !== r.lastFrame ? (this.morphTargetInfluences[r.currentFrame] = l * s,
  58198. this.morphTargetInfluences[r.lastFrame] = (1 - l) * s) : this.morphTargetInfluences[r.currentFrame] = s
  58199. }
  58200. }
  58201. }
  58202. ,
  58203. "undefined" != typeof i ? ("undefined" != typeof t && t.exports && (i = t.exports = n),
  58204. i.THREE = n) : this.THREE = n
  58205. window.THREE = n
  58206. }
  58207. , {}]
  58208. }, {}, [116]);
  58209. function initTransitionPass(THREE){
  58210. THREE.TransitionPass = function ( scene, camera ) {
  58211. this.renderScene = scene;
  58212. this.renderCamera = camera;
  58213. this.coverRenderTarget = new THREE.WebGLRenderTarget( 100, 100, {
  58214. minFilter: THREE.LinearFilter, magFilter: THREE.LinearFilter,
  58215. format: THREE.RGBAFormat
  58216. });
  58217. this.coverTex = this.coverRenderTarget.texture;
  58218. this.enabled = false;
  58219. this.oldClearColor = new THREE.Color();
  58220. this.oldClearAlpha = 1;
  58221. this.camera = new THREE.OrthographicCamera( - 1, 1, 1, - 1, 0, 1 );
  58222. this.scene = new THREE.Scene();
  58223. this.material = this.getMaskMaterial()
  58224. var copyShader = THREE.CopyShader;
  58225. this.materialCopy = new THREE.ShaderMaterial( {
  58226. uniforms: this.copyUniforms,
  58227. vertexShader: copyShader.vertexShader,
  58228. fragmentShader: copyShader.fragmentShader,
  58229. blending: THREE.NoBlending,
  58230. depthTest: false,
  58231. depthWrite: false,
  58232. transparent: true
  58233. } );
  58234. this.quad = new THREE.Mesh( new THREE.PlaneBufferGeometry( 2, 2 ), this.material);
  58235. this.quad.frustumCulled = false; // Avoid getting clipped
  58236. this.scene.add( this.quad );
  58237. }
  58238. THREE.TransitionPass.prototype = {//波形扩散,出下一个画面
  58239. constructor: THREE.TransitionPass,
  58240. setSize: function ( width, height ) {
  58241. this.coverRenderTarget.setSize( width, height );
  58242. },
  58243. render: function ( renderer, writeBuffer, readBuffer, delta, maskActive ) {
  58244. var oldAutoClear = renderer.autoClear;
  58245. renderer.autoClear = false;
  58246. var uniforms = this.quad.material.uniforms
  58247. uniforms.bgTex.value = readBuffer.texture;
  58248. uniforms.coverTex.value = this.coverTex;
  58249. uniforms.progress.value = player.model.skybox.material.uniforms.progress.value//
  58250. uniforms.screenRatio.value = player.domElement.clientWidth / player.domElement.clientHeight;// 使波纹为圆形
  58251. uniforms.screenRatio.value *= uniforms.screenRatio.value
  58252. renderer.render( this.scene, this.camera);
  58253. renderer.autoClear = oldAutoClear;
  58254. },
  58255. start:function(sceneRenderer){
  58256. this.enabled = true
  58257. //draw coverTex
  58258. this.quad.material.uniforms.progress.value = 1;
  58259. sceneRenderer.renderer.render( sceneRenderer.scene, sceneRenderer.camera, this.coverRenderTarget, true );
  58260. },
  58261. stop:function(){
  58262. this.enabled = false
  58263. }
  58264. ,
  58265. getMaskMaterial :function(){
  58266. return new THREE.ShaderMaterial( {
  58267. uniforms: {
  58268. coverTex: {
  58269. type: "t",
  58270. value: null
  58271. },
  58272. bgTex: {
  58273. type: "t",
  58274. value: null
  58275. },
  58276. progress:{
  58277. type: "f",
  58278. value: 0
  58279. },
  58280. screenRatio:{
  58281. type: "f",
  58282. value: 1
  58283. }
  58284. },
  58285. vertexShader: `
  58286. varying vec2 vUv;
  58287. void main()
  58288. {
  58289. vUv = uv;
  58290. gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
  58291. }
  58292. `,
  58293. fragmentShader: `
  58294. uniform sampler2D coverTex;
  58295. uniform sampler2D bgTex;
  58296. uniform float progress;
  58297. uniform float screenRatio;
  58298. varying vec2 vUv;
  58299. void main() {
  58300. const float maxRadius = 0.708; // sqrt(0.5^2+0.5^2)
  58301. const float minRadius = 0.0 ;
  58302. float radius = sqrt((vUv.x - 0.5)*(vUv.x - 0.5) + (vUv.y - 0.5)*(vUv.y - 0.5)/screenRatio);
  58303. float diff = 0.15;
  58304. float radiusIn = maxRadius * progress + minRadius * (1.0-progress);
  58305. float radiusOut = radiusIn + diff;
  58306. if(radius < radiusIn) {
  58307. gl_FragColor = texture2D(bgTex, vUv);
  58308. //gl_FragColor = vec4(0.0,0.0,1.0,1.0);//
  58309. }else if(radius>radiusOut){
  58310. gl_FragColor = texture2D(coverTex, vUv) ;
  58311. //gl_FragColor = vec4(1.0,1.0,0.0,1.0);//
  58312. }else{
  58313. vec4 color1 = texture2D(bgTex, vUv);
  58314. vec4 color2 = texture2D(coverTex, vUv);
  58315. float rotio = smoothstep(radiusIn ,radiusOut,radius);
  58316. gl_FragColor = mix(color1, color2, rotio);
  58317. }
  58318. }
  58319. `
  58320. } );
  58321. },
  58322. }
  58323. }
  58324. /*
  58325. 笔记:
  58326. 导览缩放的几处: 1 搜索smoothZoomFovTo 2 flightStepWalk里
  58327. */